MK25S-RAMBo10a_lang_base: file format elf32-avr Disassembly of section .text: 00000000 <__vectors>: 0: 0c 94 b8 50 jmp 0xa170 ; 0xa170 <__dtors_end> 4: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 8: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> c: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 10: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 14: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 18: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 1c: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 20: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 24: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 28: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 2c: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 30: 0c 94 c3 74 jmp 0xe986 ; 0xe986 <__vector_12> 34: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 38: 0d 94 d1 14 jmp 0x229a2 ; 0x229a2 <__vector_14> 3c: 0d 94 15 12 jmp 0x2242a ; 0x2242a <__vector_15> 40: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 44: 0d 94 6a 22 jmp 0x244d4 ; 0x244d4 <__vector_17> 48: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 4c: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 50: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 54: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 58: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 5c: 0c 94 43 6d jmp 0xda86 ; 0xda86 <__vector_23> 60: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 64: 0d 94 45 99 jmp 0x3328a ; 0x3328a <__vector_25> 68: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 6c: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 70: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 74: 0c 94 72 7d jmp 0xfae4 ; 0xfae4 <__vector_29> 78: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 7c: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 80: 0d 94 1b 17 jmp 0x22e36 ; 0x22e36 <__vector_32> 84: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 88: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 8c: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 90: 0d 94 01 99 jmp 0x33202 ; 0x33202 <__vector_36> 94: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 98: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 9c: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> a0: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> a4: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> a8: 0d 94 70 0d jmp 0x21ae0 ; 0x21ae0 <__vector_42> ac: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> b0: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> b4: 0d 94 65 0d jmp 0x21aca ; 0x21aca <__vector_45> b8: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> bc: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> c0: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> c4: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> c8: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> cc: 0d 94 25 0d jmp 0x21a4a ; 0x21a4a <__vector_51> d0: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> d4: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> d8: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> dc: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> e0: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 000000e4 <__loc_sec_start>: ... 00000100 <_SEC_LANG>: 100: 5f 53 45 43 5f 4c 41 4e 47 00 00 00 00 00 00 00 _SEC_LANG....... ... 00003600 <__loc_pri_start>: 3600: ff ff .word 0xffff ; ???? 3602: 53 6f ori r21, 0xF3 ; 243 3604: 6d 65 ori r22, 0x5D ; 93 3606: 20 70 andi r18, 0x00 ; 0 3608: 72 6f ori r23, 0xF2 ; 242 360a: 62 6c ori r22, 0xC2 ; 194 360c: 65 6d ori r22, 0xD5 ; 213 360e: 20 65 ori r18, 0x50 ; 80 3610: 6e 63 ori r22, 0x3E ; 62 3612: 6f 75 andi r22, 0x5F ; 95 3614: 6e 74 andi r22, 0x4E ; 78 3616: 65 72 andi r22, 0x25 ; 37 3618: 65 64 ori r22, 0x45 ; 69 361a: 2c 20 and r2, r12 361c: 5a 2d mov r21, r10 361e: 6c 65 ori r22, 0x5C ; 92 3620: 76 65 ori r23, 0x56 ; 86 3622: 6c 69 ori r22, 0x9C ; 156 3624: 6e 67 ori r22, 0x7E ; 126 3626: 20 65 ori r18, 0x50 ; 80 3628: 6e 66 ori r22, 0x6E ; 110 362a: 6f 72 andi r22, 0x2F ; 47 362c: 63 65 ori r22, 0x53 ; 83 362e: 64 20 and r6, r4 3630: 2e 2e mov r2, r30 3632: 2e 00 .word 0x002e ; ???? 00003634 : 3634: ff ff 4d 65 73 68 20 62 65 64 20 6c 65 76 65 6c ..Mesh bed level 3644: 69 6e 67 20 66 61 69 6c 65 64 2e 20 50 72 69 6e ing failed. Prin 3654: 74 20 63 61 6e 63 65 6c 65 64 2e 00 t canceled.. 00003660 : 3660: ff ff 48 65 61 74 69 6e 67 20 64 69 73 61 62 6c ..Heating disabl 3670: 65 64 20 62 79 20 73 61 66 65 74 79 20 74 69 6d ed by safety tim 3680: 65 72 2e 00 er.. 00003684 : 3684: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 3694: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 36a4: 6c 65 76 65 6c 2e 00 level.. 000036ab : 36ab: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 36bb: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 36cb: 6c 65 76 65 6c 2e 20 50 6c 65 61 73 65 20 72 65 level. Please re 36db: 2d 73 6c 69 63 65 20 74 68 65 20 6d 6f 64 65 6c -slice the model 36eb: 20 61 67 61 69 6e 2e 00 again.. 000036f3 : 36f3: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 3703: 66 6f 72 20 61 20 6e 65 77 65 72 20 66 69 72 6d for a newer firm 3713: 77 61 72 65 2e 00 ware.. 00003719 : 3719: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 3729: 66 6f 72 20 61 20 6e 65 77 65 72 20 66 69 72 6d for a newer firm 3739: 77 61 72 65 2e 20 50 6c 65 61 73 65 20 75 70 64 ware. Please upd 3749: 61 74 65 20 74 68 65 20 66 69 72 6d 77 61 72 65 ate the firmware 3759: 2e 00 .. 0000375b : 375b: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 376b: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 377b: 70 72 69 6e 74 65 72 20 74 79 70 65 2e 00 printer type.. 00003789 : 3789: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 3799: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 37a9: 70 72 69 6e 74 65 72 20 74 79 70 65 2e 20 50 6c printer type. Pl 37b9: 65 61 73 65 20 72 65 2d 73 6c 69 63 65 20 74 68 ease re-slice th 37c9: 65 20 6d 6f 64 65 6c 20 61 67 61 69 6e 2e 00 e model again.. 000037d8 : 37d8: ff ff 50 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 ..Press the knob 37e8: 20 74 6f 20 70 72 65 68 65 61 74 20 6e 6f 7a 7a to preheat nozz 37f8: 6c 65 20 61 6e 64 20 63 6f 6e 74 69 6e 75 65 2e le and continue. ... 00003809 : 3809: ff ff 50 6c 65 61 73 65 20 70 72 65 73 73 20 74 ..Please press t 3819: 68 65 20 6b 6e 6f 62 20 74 6f 20 75 6e 6c 6f 61 he knob to unloa 3829: 64 20 66 69 6c 61 6d 65 6e 74 00 d filament. 00003834 : 3834: ff ff 61 6e 64 20 70 72 65 73 73 20 74 68 65 20 ..and press the 3844: 6b 6e 6f 62 00 knob. 00003849 : 3849: ff ff 49 6e 73 65 72 74 20 66 69 6c 61 6d 65 6e ..Insert filamen 3859: 74 00 t. 0000385b : 385b: ff ff 43 6f 6c 6f 72 20 6e 6f 74 20 63 6f 72 72 ..Color not corr 386b: 65 63 74 00 ect. 0000386f : 386f: ff ff 46 69 6c 61 6d 65 6e 74 20 6e 6f 74 20 6c ..Filament not l 387f: 6f 61 64 65 64 00 oaded. 00003885 : 3885: ff ff 43 68 61 6e 67 65 64 20 63 6f 72 72 65 63 ..Changed correc 3895: 74 6c 79 00 tly. 00003899 : 3899: ff ff 4c 6f 61 64 69 6e 67 20 63 6f 6c 6f 72 00 ..Loading color. 000038a9 : 38a9: ff ff 43 68 61 6e 67 65 20 73 75 63 63 65 73 73 ..Change success 38b9: 21 00 !. 000038bb : 38bb: ff ff 50 6c 65 61 73 65 20 6f 70 65 6e 20 69 64 ..Please open id 38cb: 6c 65 72 20 61 6e 64 20 72 65 6d 6f 76 65 20 66 ler and remove f 38db: 69 6c 61 6d 65 6e 74 20 6d 61 6e 75 61 6c 6c 79 ilament manually 38eb: 2e 00 .. 000038ed : 38ed: ff ff 57 61 73 20 66 69 6c 61 6d 65 6e 74 20 75 ..Was filament u 38fd: 6e 6c 6f 61 64 20 73 75 63 63 65 73 73 66 75 6c nload successful 390d: 3f 00 ?. 0000390f : 390f: ff ff 50 6c 65 61 73 65 20 75 70 67 72 61 64 65 ..Please upgrade 391f: 2e 00 .. 00003921 : 3921: ff ff 4e 65 77 20 66 69 72 6d 77 61 72 65 20 76 ..New firmware v 3931: 65 72 73 69 6f 6e 20 61 76 61 69 6c 61 62 6c 65 ersion available 3941: 3a 00 :. 00003943 : 3943: ff ff 57 61 69 74 69 6e 67 20 66 6f 72 20 50 49 ..Waiting for PI 3953: 4e 44 41 20 70 72 6f 62 65 20 63 6f 6f 6c 69 6e NDA probe coolin 3963: 67 00 g. 00003965 : 3965: ff ff 50 6c 65 61 73 65 20 77 61 69 74 00 ..Please wait. 00003973 : 3973: ff ff 4e 6f 20 6d 6f 76 65 2e 00 ..No move.. 0000397e : 397e: ff ff 57 61 69 74 20 66 6f 72 20 75 73 65 72 2e ..Wait for user. 398e: 2e 2e 00 ... 00003991 : 3991: ff ff 53 74 61 62 6c 65 20 61 6d 62 69 65 6e 74 ..Stable ambient 39a1: 20 74 65 6d 70 65 72 61 74 75 72 65 20 32 31 2d temperature 21- 39b1: 32 36 43 20 69 73 20 6e 65 65 64 65 64 20 61 20 26C is needed a 39c1: 72 69 67 69 64 20 73 74 61 6e 64 20 69 73 20 72 rigid stand is r 39d1: 65 71 75 69 72 65 64 2e 00 equired.. 000039da : 39da: ff ff 50 6c 65 61 73 65 20 72 75 6e 20 58 59 5a ..Please run XYZ 39ea: 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 66 69 72 calibration fir 39fa: 73 74 2e 00 st.. 000039fe : 39fe: ff ff 50 6c 65 61 73 65 20 75 6e 6c 6f 61 64 20 ..Please unload 3a0e: 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 66 69 72 the filament fir 3a1e: 73 74 2c 20 74 68 65 6e 20 72 65 70 65 61 74 20 st, then repeat 3a2e: 74 68 69 73 20 61 63 74 69 6f 6e 2e 00 this action.. 00003a3b : 3a3b: ff ff 43 68 65 63 6b 73 00 ..Checks. 00003a44 : 3a44: ff ff 4e 6f 7a 7a 6c 65 20 64 2e 00 ..Nozzle d.. 00003a50 : 3a50: ff ff 41 6c 70 68 61 62 65 74 00 ..Alphabet. 00003a5b : 3a5b: ff ff 53 6f 72 74 00 ..Sort. 00003a62 : 3a62: ff ff 54 69 6d 65 00 ..Time. 00003a69 : 3a69: ff ff 4e 6f 72 6d 61 6c 00 ..Normal. 00003a72 : 3a72: ff ff 53 44 20 63 61 72 64 00 ..SD card. 00003a7c : 3a7c: ff ff 53 65 6c 65 63 74 20 6c 61 6e 67 75 61 67 ..Select languag 3a8c: 65 00 e. 00003a8e : 3a8e: ff ff 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 00 ..Nozzle change. 00003a9e : 3a9e: ff ff 48 57 20 53 65 74 75 70 00 ..HW Setup. 00003aa9 : 3aa9: ff ff 4c 6f 61 64 69 6e 67 20 54 65 73 74 00 ..Loading Test. 00003ab8 : 3ab8: ff ff 44 69 73 61 62 6c 65 20 73 74 65 70 70 65 ..Disable steppe 3ac8: 72 73 00 rs. 00003acb : 3acb: ff ff 4d 6f 76 65 20 61 78 69 73 00 ..Move axis. 00003ad7 : 3ad7: ff ff 54 65 6d 70 65 72 61 74 75 72 65 00 ..Temperature. 00003ae5 : 3ae5: ff ff 50 49 4e 44 41 20 63 61 6c 2e 00 ..PINDA cal.. 00003af2 : 3af2: ff ff 52 65 73 65 74 20 58 59 5a 20 63 61 6c 69 ..Reset XYZ cali 3b02: 62 72 2e 00 br.. 00003b06 : 3b06: ff ff 53 68 6f 77 20 65 6e 64 20 73 74 6f 70 73 ..Show end stops ... 00003b17 : 3b17: ff ff 50 49 44 20 63 61 6c 69 62 72 61 74 69 6f ..PID calibratio 3b27: 6e 00 n. 00003b29 : 3b29: ff ff 42 65 64 20 6c 65 76 65 6c 20 63 6f 72 72 ..Bed level corr 3b39: 65 63 74 00 ect. 00003b3d : 3b3d: ff ff 4d 65 73 68 20 42 65 64 20 4c 65 76 65 6c ..Mesh Bed Level 3b4d: 69 6e 67 00 ing. 00003b51 : 3b51: ff ff 43 61 6c 69 62 72 61 74 65 20 5a 00 ..Calibrate Z. 00003b5f : 3b5f: ff ff 43 61 6c 69 62 72 61 74 65 20 58 59 5a 00 ..Calibrate XYZ. 00003b6f : 3b6f: ff ff 53 65 6c 66 74 65 73 74 00 ..Selftest. 00003b7a : 3b7a: ff ff 57 69 7a 61 72 64 00 ..Wizard. 00003b83 : 3b83: ff ff 54 65 73 74 69 6e 67 20 66 69 6c 61 6d 65 ..Testing filame 3b93: 6e 74 00 nt. 00003b96 : 3b96: ff ff 4c 6f 61 64 20 41 6c 6c 00 ..Load All. 00003ba1 : 3ba1: ff ff 50 6c 65 61 73 65 20 70 75 6c 6c 20 6f 75 ..Please pull ou 3bb1: 74 20 66 69 6c 61 6d 65 6e 74 20 69 6d 6d 65 64 t filament immed 3bc1: 69 61 74 65 6c 79 00 iately. 00003bc8 : 3bc8: ff ff 52 65 73 65 74 00 ..Reset. 00003bd0 : 3bd0: ff ff 52 65 6e 61 6d 65 00 ..Rename. 00003bd9 : 3bd9: ff ff 46 69 72 73 74 20 6c 61 79 65 72 20 63 61 ..First layer ca 3be9: 6c 2e 00 l.. 00003bec : 3bec: ff ff 53 65 6c 65 63 74 00 ..Select. 00003bf5 : 3bf5: ff ff 53 74 65 65 6c 20 73 68 65 65 74 73 00 ..Steel sheets. 00003c04 : 3c04: ff ff 53 75 70 70 6f 72 74 00 ..Support. 00003c0e : 3c0e: ff ff 46 61 69 6c 20 73 74 61 74 73 20 4d 4d 55 ..Fail stats MMU ... 00003c1f : 3c1f: ff ff 46 61 69 6c 20 73 74 61 74 73 00 ..Fail stats. 00003c2c : 3c2c: ff ff 53 74 61 74 69 73 74 69 63 73 00 ..Statistics. 00003c39 : 3c39: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 00 ..Calibration. 00003c47 : 3c47: ff ff 41 75 74 6f 4c 6f 61 64 20 66 69 6c 61 6d ..AutoLoad filam 3c57: 65 6e 74 00 ent. 00003c5b : 3c5b: ff ff 4c 6f 61 64 20 66 69 6c 61 6d 65 6e 74 00 ..Load filament. 00003c6b : 3c6b: ff ff 55 6e 6c 6f 61 64 20 66 69 6c 61 6d 65 6e ..Unload filamen 3c7b: 74 00 t. 00003c7d : 3c7d: ff ff 4c 6f 61 64 20 74 6f 20 6e 6f 7a 7a 6c 65 ..Load to nozzle ... 00003c8e : 3c8e: ff ff 50 72 65 6c 6f 61 64 20 74 6f 20 4d 4d 55 ..Preload to MMU ... 00003c9f : 3c9f: ff ff 4e 6f 20 53 44 20 63 61 72 64 00 ..No SD card. 00003cac : 3cac: ff ff 50 72 69 6e 74 20 66 72 6f 6d 20 53 44 00 ..Print from SD. 00003cbc : 3cbc: ff ff 52 65 73 75 6d 65 20 70 72 69 6e 74 00 ..Resume print. 00003ccb : 3ccb: ff ff 50 61 75 73 65 20 70 72 69 6e 74 00 ..Pause print. 00003cd9 : 3cd9: ff ff 53 65 74 20 52 65 61 64 79 00 ..Set Ready. 00003ce5 : 3ce5: ff ff 53 65 74 20 6e 6f 74 20 52 65 61 64 79 00 ..Set not Ready. 00003cf5 : 3cf5: ff ff 50 72 65 68 65 61 74 00 ..Preheat. 00003cff : 3cff: ff ff 54 75 6e 65 00 ..Tune. 00003d06 : 3d06: ff ff 4c 69 76 65 20 61 64 6a 75 73 74 20 5a 00 ..Live adjust Z. 00003d16 : 3d16: ff ff 52 65 70 72 69 6e 74 00 ..Reprint. 00003d20 : 3d20: ff ff 49 6e 66 6f 20 73 63 72 65 65 6e 00 ..Info screen. 00003d2e : 3d2e: ff ff 41 73 73 69 73 74 00 ..Assist. 00003d37 : 3d37: ff ff 4f 6e 63 65 00 ..Once. 00003d3e : 3d3e: ff ff 53 6f 75 6e 64 00 ..Sound. 00003d46 : 3d46: ff ff 4c 6f 75 64 00 ..Loud. 00003d4d : 3d4d: ff ff 46 69 6c 2e 20 73 65 6e 73 6f 72 00 ..Fil. sensor. 00003d5b : 3d5b: ff ff 43 68 61 6e 67 65 20 66 69 6c 61 6d 65 6e ..Change filamen 3d6b: 74 00 t. 00003d6d : 3d6d: ff ff 46 6c 6f 77 00 ..Flow. 00003d74 : 3d74: ff ff 53 70 65 65 64 00 ..Speed. 00003d7c : 3d7c: ff ff 4d 61 67 6e 65 74 73 20 63 6f 6d 70 2e 00 ..Magnets comp.. 00003d8c : 3d8c: ff ff 4e 2f 41 00 ..N/A. 00003d92 : 3d92: ff ff 5a 2d 70 72 6f 62 65 20 6e 72 2e 00 ..Z-probe nr.. 00003da0 : 3da0: ff ff 4d 65 73 68 00 ..Mesh. 00003da7 : 3da7: ff ff 53 65 74 74 69 6e 67 73 00 ..Settings. 00003db2 : 3db2: ff ff 59 65 73 00 ..Yes. 00003db8 : 3db8: ff ff 4e 6f 00 ..No. 00003dbd : 3dbd: ff ff 53 74 6f 70 20 70 72 69 6e 74 00 ..Stop print. 00003dca : 3dca: ff ff 43 68 65 63 6b 69 6e 67 20 66 69 6c 65 00 ..Checking file. 00003dda : 3dda: ff ff 46 69 6c 65 20 69 6e 63 6f 6d 70 6c 65 74 ..File incomplet 3dea: 65 2e 00 e.. 00003ded : 3ded: ff ff 84 52 65 66 72 65 73 68 00 ...Refresh. 00003df8 : 3df8: ff ff 4d 61 69 6e 00 ..Main. 00003dff : 3dff: ff ff 57 61 69 74 69 6e 67 20 66 6f 72 20 6e 6f ..Waiting for no 3e0f: 7a 7a 6c 65 20 61 6e 64 20 62 65 64 20 63 6f 6f zzle and bed coo 3e1f: 6c 69 6e 67 00 ling. 00003e24 : 3e24: ff ff 53 65 6c 65 63 74 20 66 69 6c 61 6d 65 6e ..Select filamen 3e34: 74 3a 00 t:. 00003e37 : 3e37: ff ff 53 65 6c 66 74 65 73 74 20 4f 4b 00 ..Selftest OK. 00003e45 : 3e45: ff ff 53 65 6c 66 74 65 73 74 20 73 74 61 72 74 ..Selftest start ... 00003e56 : 3e56: ff ff 53 77 61 70 70 65 64 00 ..Swapped. 00003e60 : 3e60: ff ff 46 72 6f 6e 74 2f 6c 65 66 74 20 66 61 6e ..Front/left fan 3e70: 73 00 s. 00003e72 : 3e72: ff ff 41 78 69 73 00 ..Axis. 00003e79 : 3e79: ff ff 41 78 69 73 20 6c 65 6e 67 74 68 00 ..Axis length. 00003e87 : 3e87: ff ff 4c 6f 6f 73 65 20 70 75 6c 6c 65 79 00 ..Loose pulley. 00003e96 : 3e96: ff ff 45 6e 64 73 74 6f 70 20 6e 6f 74 20 68 69 ..Endstop not hi 3ea6: 74 00 t. 00003ea8 : 3ea8: ff ff 45 6e 64 73 74 6f 70 00 ..Endstop. 00003eb2 : 3eb2: ff ff 4d 6f 74 6f 72 00 ..Motor. 00003eba : 3eba: ff ff 45 6e 64 73 74 6f 70 73 00 ..Endstops. 00003ec5 : 3ec5: ff ff 57 69 72 69 6e 67 20 65 72 72 6f 72 00 ..Wiring error. 00003ed4 : 3ed4: ff ff 42 65 64 2f 48 65 61 74 65 72 00 ..Bed/Heater. 00003ee1 : 3ee1: ff ff 4e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 00 ..Not connected. 00003ef1 : 3ef1: ff ff 48 65 61 74 65 72 2f 54 68 65 72 6d 69 73 ..Heater/Thermis 3f01: 74 6f 72 00 tor. 00003f05 : 3f05: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 3a 00 ..Please check:. 00003f15 : 3f15: ff ff 53 65 6c 66 74 65 73 74 20 65 72 72 6f 72 ..Selftest error 3f25: 21 00 !. 00003f27 : 3f27: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 3f37: 72 00 r. 00003f39 : 3f39: ff ff 50 72 69 6e 74 20 66 61 6e 3a 00 ..Print fan:. 00003f46 : 3f46: ff ff 48 6f 74 65 6e 64 20 66 61 6e 3a 00 ..Hotend fan:. 00003f54 : 3f54: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 68 6f ..Calibrating ho 3f64: 6d 65 00 me. 00003f67 : 3f67: ff ff 53 65 6c 66 74 65 73 74 20 66 61 69 6c 65 ..Selftest faile 3f77: 64 00 d. 00003f79 : 3f79: ff ff 41 6c 6c 20 63 6f 72 72 65 63 74 00 ..All correct. 00003f87 : 3f87: ff ff 43 68 65 63 6b 69 6e 67 20 73 65 6e 73 6f ..Checking senso 3f97: 72 73 00 rs. 00003f9a : 3f9a: ff ff 43 68 65 63 6b 69 6e 67 20 68 6f 74 65 6e ..Checking hoten 3faa: 64 00 d. 00003fac : 3fac: ff ff 43 68 65 63 6b 69 6e 67 20 62 65 64 00 ..Checking bed. 00003fbb : 3fbb: ff ff 43 68 65 63 6b 69 6e 67 20 5a 20 61 78 69 ..Checking Z axi 3fcb: 73 00 s. 00003fcd : 3fcd: ff ff 43 68 65 63 6b 69 6e 67 20 59 20 61 78 69 ..Checking Y axi 3fdd: 73 00 s. 00003fdf : 3fdf: ff ff 43 68 65 63 6b 69 6e 67 20 58 20 61 78 69 ..Checking X axi 3fef: 73 00 s. 00003ff1 : 3ff1: ff ff 43 68 65 63 6b 69 6e 67 20 65 6e 64 73 74 ..Checking endst 4001: 6f 70 73 00 ops. 00004005 : 4005: ff ff 43 61 72 64 20 72 65 6d 6f 76 65 64 00 ..Card removed. 00004014 : 4014: ff ff 42 61 63 6b 00 ..Back. 0000401b : 401b: ff ff 41 75 74 6f 20 70 6f 77 65 72 00 ..Auto power. 00004028 : 4028: ff ff 53 69 6c 65 6e 74 00 ..Silent. 00004031 : 4031: ff ff 4d 6f 64 65 00 ..Mode. 00004038 : 4038: ff ff 48 69 67 68 20 70 6f 77 65 72 00 ..High power. 00004045 : 4045: ff ff 53 74 72 69 63 74 00 ..Strict. 0000404e : 404e: ff ff 57 61 72 6e 00 ..Warn. 00004055 : 4055: ff ff 4e 6f 6e 65 00 ..None. 0000405c : 405c: ff ff 48 6f 74 65 6e 64 20 61 74 20 32 38 30 43 ..Hotend at 280C 406c: 21 20 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 64 ! Nozzle changed 407c: 20 61 6e 64 20 74 69 67 68 74 65 6e 65 64 20 74 and tightened t 408c: 6f 20 73 70 65 63 73 3f 00 o specs?. 00004095 : 4095: ff ff 46 6f 72 20 61 20 4e 6f 7a 7a 6c 65 20 63 ..For a Nozzle c 40a5: 68 61 6e 67 65 20 70 6c 65 61 73 65 20 72 65 61 hange please rea 40b5: 64 0a 70 72 75 73 61 2e 69 6f 2f 6e 6f 7a 7a 6c d.prusa.io/nozzl 40c5: 65 2d 6d 6b 33 73 00 e-mk3s. 000040cc : 40cc: ff ff 50 49 44 20 63 61 6c 2e 20 66 69 6e 69 73 ..PID cal. finis 40dc: 68 65 64 00 hed. 000040e0 : 40e0: ff ff 50 49 44 20 63 61 6c 2e 00 ..PID cal.. 000040eb : 40eb: ff ff 50 72 69 6e 74 20 70 61 75 73 65 64 00 ..Print paused. 000040fa : 40fa: ff ff 50 72 69 6e 74 20 61 62 6f 72 74 65 64 00 ..Print aborted. 0000410a : 410a: ff ff 43 6f 70 79 20 73 65 6c 65 63 74 65 64 20 ..Copy selected 411a: 6c 61 6e 67 75 61 67 65 3f 00 language?. 00004124 : 4124: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 4134: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 4144: 68 65 20 47 2d 63 6f 64 65 2e 00 he G-code.. 0000414f : 414f: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 415f: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 416f: 68 65 20 47 2d 63 6f 64 65 2e 20 50 6c 65 61 73 he G-code. Pleas 417f: 65 20 63 68 65 63 6b 20 74 68 65 20 76 61 6c 75 e check the valu 418f: 65 20 69 6e 20 73 65 74 74 69 6e 67 73 2e 00 e in settings.. 0000419e : 419e: ff ff 54 68 65 72 65 20 69 73 20 6e 6f 20 66 69 ..There is no fi 41ae: 6c 61 6d 65 6e 74 20 6c 6f 61 64 65 64 2e 00 lament loaded.. 000041bd : 41bd: ff ff 54 68 65 72 65 20 69 73 20 73 74 69 6c 6c ..There is still 41cd: 20 61 20 6e 65 65 64 20 74 6f 20 6d 61 6b 65 20 a need to make 41dd: 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 20 50 Z calibration. P 41ed: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 41fd: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 420d: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 421d: 63 74 69 6f 6e 20 43 61 6c 69 62 72 61 74 69 6f ction Calibratio 422d: 6e 20 66 6c 6f 77 2e 00 n flow.. 00004235 : 4235: ff ff 50 72 69 6e 74 65 72 20 68 61 73 20 6e 6f ..Printer has no 4245: 74 20 62 65 65 6e 20 63 61 6c 69 62 72 61 74 65 t been calibrate 4255: 64 20 79 65 74 2e 20 50 6c 65 61 73 65 20 66 6f d yet. Please fo 4265: 6c 6c 6f 77 20 74 68 65 20 6d 61 6e 75 61 6c 2c llow the manual, 4275: 20 63 68 61 70 74 65 72 20 46 69 72 73 74 20 73 chapter First s 4285: 74 65 70 73 2c 20 73 65 63 74 69 6f 6e 20 43 61 teps, section Ca 4295: 6c 69 62 72 61 74 69 6f 6e 20 66 6c 6f 77 2e 00 libration flow.. 000042a5 : 42a5: ff ff 53 65 6c 66 74 65 73 74 20 77 69 6c 6c 20 ..Selftest will 42b5: 62 65 20 72 75 6e 20 74 6f 20 63 61 6c 69 62 72 be run to calibr 42c5: 61 74 65 20 61 63 63 75 72 61 74 65 20 73 65 6e ate accurate sen 42d5: 73 6f 72 6c 65 73 73 20 72 65 68 6f 6d 69 6e 67 sorless rehoming 42e5: 2e 00 .. 000042e7 : 42e7: ff ff 4f 6c 64 20 73 65 74 74 69 6e 67 73 20 66 ..Old settings f 42f7: 6f 75 6e 64 2e 20 44 65 66 61 75 6c 74 20 50 49 ound. Default PI 4307: 44 2c 20 45 73 74 65 70 73 20 65 74 63 2e 20 77 D, Esteps etc. w 4317: 69 6c 6c 20 62 65 20 73 65 74 2e 00 ill be set.. 00004323 : 4323: ff ff 57 61 72 6e 69 6e 67 3a 20 62 6f 74 68 20 ..Warning: both 4333: 70 72 69 6e 74 65 72 20 74 79 70 65 20 61 6e 64 printer type and 4343: 20 6d 6f 74 68 65 72 62 6f 61 72 64 20 74 79 70 motherboard typ 4353: 65 20 63 68 61 6e 67 65 64 2e 00 e changed.. 0000435e : 435e: ff ff 57 61 72 6e 69 6e 67 3a 20 70 72 69 6e 74 ..Warning: print 436e: 65 72 20 74 79 70 65 20 63 68 61 6e 67 65 64 2e er type changed. ... 0000437f : 437f: ff ff 57 61 72 6e 69 6e 67 3a 20 6d 6f 74 68 65 ..Warning: mothe 438f: 72 62 6f 61 72 64 20 74 79 70 65 20 63 68 61 6e rboard type chan 439f: 67 65 64 2e 00 ged.. 000043a4 : 43a4: ff ff 53 68 65 65 74 00 ..Sheet. 000043ac : 43ac: ff ff 4e 6f 74 20 73 70 69 6e 6e 69 6e 67 00 ..Not spinning. 000043bb : 43bb: ff ff 53 70 69 6e 6e 69 6e 67 00 ..Spinning. 000043c6 : 43c6: ff ff 4c 65 66 74 20 68 6f 74 65 6e 64 20 66 61 ..Left hotend fa 43d6: 6e 3f 00 n?. 000043d9 : 43d9: ff ff 46 72 6f 6e 74 20 70 72 69 6e 74 20 66 61 ..Front print fa 43e9: 6e 3f 00 n?. 000043ec : 43ec: ff ff 46 61 6e 20 74 65 73 74 00 ..Fan test. 000043f7 : 43f7: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4407: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 53 6b 65 n all right. Ske 4417: 77 20 77 69 6c 6c 20 62 65 20 63 6f 72 72 65 63 w will be correc 4427: 74 65 64 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c ted automaticall 4437: 79 2e 00 y.. 0000443a : 443a: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 444a: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 58 2f 59 n all right. X/Y 445a: 20 61 78 65 73 20 61 72 65 20 73 6c 69 67 68 74 axes are slight 446a: 6c 79 20 73 6b 65 77 65 64 2e 20 47 6f 6f 64 20 ly skewed. Good 447a: 6a 6f 62 21 00 job!. 0000447f : 447f: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 448f: 6e 20 6f 6b 2e 20 58 2f 59 20 61 78 65 73 20 61 n ok. X/Y axes a 449f: 72 65 20 70 65 72 70 65 6e 64 69 63 75 6c 61 72 re perpendicular 44af: 2e 20 43 6f 6e 67 72 61 74 75 6c 61 74 69 6f 6e . Congratulation 44bf: 73 21 00 s!. 000044c2 : 44c2: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 44d2: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 52 n compromised. R 44e2: 69 67 68 74 20 66 72 6f 6e 74 20 63 61 6c 69 62 ight front calib 44f2: 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 6e 6f 74 ration point not 4502: 20 72 65 61 63 68 61 62 6c 65 2e 00 reachable.. 0000450e : 450e: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 451e: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 46 n compromised. F 452e: 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e ront calibration 453e: 20 70 6f 69 6e 74 73 20 6e 6f 74 20 72 65 61 63 points not reac 454e: 68 61 62 6c 65 2e 00 hable.. 00004555 : 4555: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4565: 6e 20 66 61 69 6c 65 64 2e 20 52 69 67 68 74 20 n failed. Right 4575: 66 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f front calibratio 4585: 6e 20 70 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 n point not reac 4595: 68 61 62 6c 65 2e 00 hable.. 0000459c : 459c: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 45ac: 6e 20 66 61 69 6c 65 64 2e 20 46 72 6f 6e 74 20 n failed. Front 45bc: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 45cc: 74 73 20 6e 6f 74 20 72 65 61 63 68 61 62 6c 65 ts not reachable 45dc: 2e 00 .. 000045de : 45de: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 45ee: 6e 20 66 61 69 6c 65 64 2e 20 50 6c 65 61 73 65 n failed. Please 45fe: 20 63 6f 6e 73 75 6c 74 20 74 68 65 20 6d 61 6e consult the man 460e: 75 61 6c 2e 00 ual.. 00004613 : 4613: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4623: 6e 20 66 61 69 6c 65 64 2e 20 42 65 64 20 63 61 n failed. Bed ca 4633: 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 libration point 4643: 77 61 73 20 6e 6f 74 20 66 6f 75 6e 64 2e 00 was not found.. 00004652 : 4652: ff ff 50 6c 65 61 73 65 20 70 6c 61 63 65 20 73 ..Please place s 4662: 74 65 65 6c 20 73 68 65 65 74 20 6f 6e 20 68 65 teel sheet on he 4672: 61 74 62 65 64 2e 00 atbed.. 00004679 : 4679: ff ff 44 69 73 74 61 6e 63 65 20 62 65 74 77 65 ..Distance betwe 4689: 65 6e 20 74 69 70 20 6f 66 20 74 68 65 20 6e 6f en tip of the no 4699: 7a 7a 6c 65 20 61 6e 64 20 74 68 65 20 62 65 64 zzle and the bed 46a9: 20 73 75 72 66 61 63 65 20 68 61 73 20 6e 6f 74 surface has not 46b9: 20 62 65 65 6e 20 73 65 74 20 79 65 74 2e 20 50 been set yet. P 46c9: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 46d9: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 46e9: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 46f9: 63 74 69 6f 6e 20 46 69 72 73 74 20 6c 61 79 65 ction First laye 4709: 72 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 00 r calibration.. 00004718 : 4718: ff ff 50 6c 61 63 65 20 61 20 73 68 65 65 74 20 ..Place a sheet 4728: 6f 66 20 70 61 70 65 72 20 75 6e 64 65 72 20 74 of paper under t 4738: 68 65 20 6e 6f 7a 7a 6c 65 20 64 75 72 69 6e 67 he nozzle during 4748: 20 74 68 65 20 63 61 6c 69 62 72 61 74 69 6f 6e the calibration 4758: 20 6f 66 20 66 69 72 73 74 20 34 20 70 6f 69 6e of first 4 poin 4768: 74 73 2e 20 49 66 20 74 68 65 20 6e 6f 7a 7a 6c ts. If the nozzl 4778: 65 20 63 61 74 63 68 65 73 20 74 68 65 20 70 61 e catches the pa 4788: 70 65 72 2c 20 70 6f 77 65 72 20 6f 66 66 20 74 per, power off t 4798: 68 65 20 70 72 69 6e 74 65 72 20 69 6d 6d 65 64 he printer immed 47a8: 69 61 74 65 6c 79 2e 00 iately.. 000047b0 : 47b0: ff ff 53 65 61 72 63 68 69 6e 67 20 62 65 64 20 ..Searching bed 47c0: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 47d0: 74 00 t. 000047d2 : 47d2: ff ff 4d 65 61 73 75 72 69 6e 67 20 72 65 66 65 ..Measuring refe 47e2: 72 65 6e 63 65 20 68 65 69 67 68 74 20 6f 66 20 rence height of 47f2: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 4802: 74 00 t. 00004804 : 4804: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 74 ..Please clean t 4814: 68 65 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 63 61 he nozzle for ca 4824: 6c 69 62 72 61 74 69 6f 6e 2e 20 43 6c 69 63 6b libration. Click 4834: 20 77 68 65 6e 20 64 6f 6e 65 2e 00 when done.. 00004840 : 4840: ff ff 41 75 74 6f 20 68 6f 6d 65 00 ..Auto home. 0000484c : 484c: ff ff 52 65 73 75 6d 69 6e 67 20 70 72 69 6e 74 ..Resuming print ... 0000485d : 485d: ff ff 50 49 4e 44 41 20 48 65 61 74 69 6e 67 00 ..PINDA Heating. 0000486d : 486d: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 20 64 6f ..Calibration do 487d: 6e 65 00 ne. 00004880 : 4880: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 5a 00 ..Calibrating Z. 00004890 : 4890: ff ff 42 65 64 20 64 6f 6e 65 00 ..Bed done. 0000489b : 489b: ff ff 42 65 64 20 48 65 61 74 69 6e 67 00 ..Bed Heating. 000048a9 : 48a9: ff ff 48 65 61 74 69 6e 67 20 64 6f 6e 65 2e 00 ..Heating done.. 000048b9 : 48b9: ff ff 48 65 61 74 69 6e 67 00 ..Heating. 000048c3 : 48c3: ff ff 54 6f 74 61 6c 00 ..Total. 000048cb : 48cb: ff ff 4c 61 73 74 20 70 72 69 6e 74 00 ..Last print. 000048d8 : 48d8: ff ff 4d 4d 55 20 66 61 69 6c 73 00 ..MMU fails. 000048e4 : 48e4: ff ff 4d 4d 55 20 6c 6f 61 64 20 66 61 69 6c 73 ..MMU load fails ... 000048f5 : 48f5: ff ff 4d 4d 55 20 70 6f 77 65 72 20 66 61 69 6c ..MMU power fail 4905: 73 00 s. 00004907 : 4907: ff ff 4d 61 74 65 72 69 61 6c 20 63 68 61 6e 67 ..Material chang 4917: 65 73 00 es. 0000491a : 491a: ff ff 4c 61 73 74 20 70 72 69 6e 74 20 66 61 69 ..Last print fai 492a: 6c 75 72 65 73 00 lures. 00004930 : 4930: ff ff 54 6f 74 61 6c 20 66 61 69 6c 75 72 65 73 ..Total failures ... 00004941 : 4941: ff ff 46 69 6c 2e 20 72 75 6e 6f 75 74 73 00 ..Fil. runouts. 00004950 : 4950: ff ff 54 65 6d 70 65 72 61 74 75 72 65 73 00 ..Temperatures. 0000495f : 495f: ff ff 53 65 6e 73 6f 72 20 69 6e 66 6f 00 ..Sensor info. 0000496d : 496d: ff ff 45 78 74 72 75 64 65 72 20 69 6e 66 6f 00 ..Extruder info. 0000497d : 497d: ff ff 58 59 5a 20 63 61 6c 2e 20 64 65 74 61 69 ..XYZ cal. detai 498d: 6c 73 00 ls. 00004990 : 4990: ff ff 50 72 69 6e 74 65 72 20 49 50 20 41 64 64 ..Printer IP Add 49a0: 72 3a 00 r:. 000049a3 : 49a3: ff ff 75 6e 6b 6e 6f 77 6e 00 ..unknown. 000049ad : 49ad: ff ff 4d 4d 55 20 63 6f 6e 6e 65 63 74 65 64 00 ..MMU connected. 000049bd : 49bd: ff ff 44 61 74 65 3a 00 ..Date:. 000049c5 : 49c5: ff ff 74 6f 20 75 6e 6c 6f 61 64 20 66 69 6c 61 ..to unload fila 49d5: 6d 65 6e 74 00 ment. 000049da : 49da: ff ff 74 6f 20 6c 6f 61 64 20 66 69 6c 61 6d 65 ..to load filame 49ea: 6e 74 00 nt. 000049ed : 49ed: ff ff 50 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 ..Press the knob ... 000049fe : 49fe: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4a0e: 63 75 74 00 cut. 00004a12 : 4a12: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4a22: 65 6a 65 63 74 00 eject. 00004a28 : 4a28: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4a38: 75 6e 6c 6f 61 64 00 unload. 00004a3f : 4a3f: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4a4f: 6c 6f 61 64 00 load. 00004a54 : 4a54: ff ff 43 6f 6f 6c 64 6f 77 6e 00 ..Cooldown. 00004a5f : 4a5f: ff ff 46 69 6c 61 6d 65 6e 74 20 65 78 74 72 75 ..Filament extru 4a6f: 64 69 6e 67 20 26 20 77 69 74 68 20 63 6f 72 72 ding & with corr 4a7f: 65 63 74 20 63 6f 6c 6f 72 3f 00 ect color?. 00004a8a : 4a8a: ff ff 45 6a 65 63 74 00 ..Eject. 00004a92 : 4a92: ff ff 41 75 74 6f 6c 6f 61 64 69 6e 67 20 66 69 ..Autoloading fi 4aa2: 6c 61 6d 65 6e 74 20 69 73 20 61 63 74 69 76 65 lament is active 4ab2: 2c 20 6a 75 73 74 20 70 72 65 73 73 20 74 68 65 , just press the 4ac2: 20 6b 6e 6f 62 20 61 6e 64 20 69 6e 73 65 72 74 knob and insert 4ad2: 20 66 69 6c 61 6d 65 6e 74 2e 2e 2e 00 filament.... 00004adf : 4adf: ff ff 54 6f 74 61 6c 20 66 69 6c 61 6d 65 6e 74 ..Total filament ... 00004af0 : 4af0: ff ff 54 6f 74 61 6c 20 70 72 69 6e 74 20 74 69 ..Total print ti 4b00: 6d 65 00 me. 00004b03 : 4b03: ff ff 46 69 6c 61 6d 65 6e 74 20 75 73 65 64 00 ..Filament used. 00004b13 : 4b13: ff ff 50 72 69 6e 74 20 74 69 6d 65 00 ..Print time. 00004b20 : 4b20: ff ff 50 72 65 68 65 61 74 20 74 68 65 20 6e 6f ..Preheat the no 4b30: 7a 7a 6c 65 21 00 zzle!. 00004b36 : 4b36: ff ff 45 52 52 4f 52 3a 00 ..ERROR:. 00004b3f : 4b3f: ff ff 59 20 64 69 73 74 61 6e 63 65 20 66 72 6f ..Y distance fro 4b4f: 6d 20 6d 69 6e 00 m min. 00004b55 : 4b55: ff ff 4c 65 66 74 00 ..Left. 00004b5c : 4b5c: ff ff 52 69 67 68 74 00 ..Right. 00004b64 : 4b64: ff ff 4d 65 61 73 75 72 65 64 20 73 6b 65 77 00 ..Measured skew. 00004b74 : 4b74: ff ff 53 6c 69 67 68 74 20 73 6b 65 77 00 ..Slight skew. 00004b82 : 4b82: ff ff 53 65 76 65 72 65 20 73 6b 65 77 00 ..Severe skew. 00004b90 : 4b90: ff ff 5b 30 3b 30 5d 20 70 6f 69 6e 74 20 6f 66 ..[0;0] point of 4ba0: 66 73 65 74 00 fset. 00004ba5 : 4ba5: ff ff 41 64 6a 75 73 74 69 6e 67 20 5a 00 ..Adjusting Z. 00004bb3 : 4bb3: ff ff 52 65 61 72 20 73 69 64 65 20 5b e4 6d 5d ..Rear side [.m] ... 00004bc4 : 4bc4: ff ff 46 72 6f 6e 74 20 73 69 64 65 5b e4 6d 5d ..Front side[.m] ... 00004bd5 : 4bd5: ff ff 52 69 67 68 74 20 73 69 64 65 5b e4 6d 5d ..Right side[.m] ... 00004be6 : 4be6: ff ff 4c 65 66 74 20 73 69 64 65 20 5b e4 6d 5d ..Left side [.m] ... 00004bf7 : 4bf7: ff ff 53 65 74 20 74 65 6d 70 65 72 61 74 75 72 ..Set temperatur 4c07: 65 3a 00 e:. 00004c0a : 4c0a: ff ff 41 72 65 20 6c 65 66 74 20 61 6e 64 20 72 ..Are left and r 4c1a: 69 67 68 74 20 5a 2d 63 61 72 72 69 61 67 65 73 ight Z-carriages 4c2a: 20 61 6c 6c 20 75 70 3f 00 all up?. 00004c33 : 4c33: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 58 59 ..Calibrating XY 4c43: 5a 2e 20 52 6f 74 61 74 65 20 74 68 65 20 6b 6e Z. Rotate the kn 4c53: 6f 62 20 74 6f 20 6d 6f 76 65 20 74 68 65 20 5a ob to move the Z 4c63: 20 63 61 72 72 69 61 67 65 20 75 70 20 74 6f 20 carriage up to 4c73: 74 68 65 20 65 6e 64 20 73 74 6f 70 70 65 72 73 the end stoppers 4c83: 2e 20 43 6c 69 63 6b 20 77 68 65 6e 20 64 6f 6e . Click when don 4c93: 65 2e 00 e.. 00004c96 : 4c96: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 5a 2e ..Calibrating Z. 4ca6: 20 52 6f 74 61 74 65 20 74 68 65 20 6b 6e 6f 62 Rotate the knob 4cb6: 20 74 6f 20 6d 6f 76 65 20 74 68 65 20 5a 20 63 to move the Z c 4cc6: 61 72 72 69 61 67 65 20 75 70 20 74 6f 20 74 68 arriage up to th 4cd6: 65 20 65 6e 64 20 73 74 6f 70 70 65 72 73 2e 20 e end stoppers. 4ce6: 43 6c 69 63 6b 20 77 68 65 6e 20 64 6f 6e 65 2e Click when done. ... 00004cf7 : 4cf7: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 4d07: 69 6f 6e 20 66 61 69 6c 65 64 00 ion failed. 00004d12 : 4d12: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 4d22: 69 6f 6e 20 69 73 20 66 69 6e 69 73 68 65 64 20 ion is finished 4d32: 61 6e 64 20 61 63 74 69 76 65 2e 20 49 74 20 63 and active. It c 4d42: 61 6e 20 62 65 20 64 69 73 61 62 6c 65 64 20 69 an be disabled i 4d52: 6e 20 6d 65 6e 75 20 53 65 74 74 69 6e 67 73 2d n menu Settings- 4d62: 3e 50 49 4e 44 41 20 63 61 6c 2e 00 >PINDA cal.. 00004d6e : 4d6e: ff ff 45 78 74 72 75 64 65 72 00 ..Extruder. 00004d79 : 4d79: ff ff 4d 6f 76 65 20 5a 00 ..Move Z. 00004d82 : 4d82: ff ff 4d 6f 76 65 20 59 00 ..Move Y. 00004d8b : 4d8b: ff ff 4d 6f 76 65 20 58 00 ..Move X. 00004d94 : 4d94: ff ff 53 68 65 65 74 20 25 2e 37 73 0a 5a 20 6f ..Sheet %.7s.Z o 4da4: 66 66 73 65 74 3a 20 25 2b 31 2e 33 66 6d 6d 0a ffset: %+1.3fmm. 4db4: 25 63 43 6f 6e 74 69 6e 75 65 0a 25 63 52 65 73 %cContinue.%cRes 4dc4: 65 74 00 et. 00004dc7 : 4dc7: ff ff 50 6c 65 61 73 65 20 6c 6f 61 64 20 66 69 ..Please load fi 4dd7: 6c 61 6d 65 6e 74 20 66 69 72 73 74 2e 00 lament first.. 00004de5 : 4de5: ff ff 43 61 6e 63 65 6c 00 ..Cancel. 00004dee : 4dee: ff ff 52 75 6e 6e 69 6e 67 20 57 69 7a 61 72 64 ..Running Wizard 4dfe: 20 77 69 6c 6c 20 64 65 6c 65 74 65 20 63 75 72 will delete cur 4e0e: 72 65 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e rent calibration 4e1e: 20 72 65 73 75 6c 74 73 20 61 6e 64 20 73 74 61 results and sta 4e2e: 72 74 20 66 72 6f 6d 20 74 68 65 20 62 65 67 69 rt from the begi 4e3e: 6e 6e 69 6e 67 2e 00 nning.. 00004e45 : 4e45: ff ff 50 72 65 68 65 61 74 69 6e 67 20 6e 6f 7a ..Preheating noz 4e55: 7a 6c 65 2e 20 50 6c 65 61 73 65 20 77 61 69 74 zle. Please wait 4e65: 2e 00 .. 00004e67 : 4e67: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 4e77: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 4e87: 65 20 65 78 74 72 75 64 65 72 2c 20 74 68 65 6e e extruder, then 4e97: 20 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 press the knob 4ea7: 74 6f 20 6c 6f 61 64 20 69 74 2e 00 to load it.. 00004eb3 : 4eb3: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 4ec3: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 4ed3: 65 20 66 69 72 73 74 20 74 75 62 65 20 6f 66 20 e first tube of 4ee3: 74 68 65 20 4d 4d 55 2c 20 74 68 65 6e 20 70 72 the MMU, then pr 4ef3: 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 74 6f 20 ess the knob to 4f03: 6c 6f 61 64 20 69 74 2e 00 load it.. 00004f0c : 4f0c: ff ff 54 68 65 20 70 72 69 6e 74 65 72 20 77 69 ..The printer wi 4f1c: 6c 6c 20 73 74 61 72 74 20 70 72 69 6e 74 69 6e ll start printin 4f2c: 67 20 61 20 7a 69 67 2d 7a 61 67 20 6c 69 6e 65 g a zig-zag line 4f3c: 2e 20 52 6f 74 61 74 65 20 74 68 65 20 6b 6e 6f . Rotate the kno 4f4c: 62 20 75 6e 74 69 6c 20 79 6f 75 20 72 65 61 63 b until you reac 4f5c: 68 20 74 68 65 20 6f 70 74 69 6d 61 6c 20 68 65 h the optimal he 4f6c: 69 67 68 74 2e 20 43 68 65 63 6b 20 74 68 65 20 ight. Check the 4f7c: 70 69 63 74 75 72 65 73 20 69 6e 20 74 68 65 20 pictures in the 4f8c: 68 61 6e 64 62 6f 6f 6b 20 28 43 61 6c 69 62 72 handbook (Calibr 4f9c: 61 74 69 6f 6e 20 63 68 61 70 74 65 72 29 2e 00 ation chapter).. 00004fac : 4fac: ff ff 53 65 6c 65 63 74 20 74 65 6d 70 65 72 61 ..Select tempera 4fbc: 74 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 ture which match 4fcc: 65 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c es your material 4fdc: 2e 00 .. 00004fde : 4fde: ff ff 53 65 6c 65 63 74 20 61 20 66 69 6c 61 6d ..Select a filam 4fee: 65 6e 74 20 66 6f 72 20 74 68 65 20 46 69 72 73 ent for the Firs 4ffe: 74 20 4c 61 79 65 72 20 43 61 6c 69 62 72 61 74 t Layer Calibrat 500e: 69 6f 6e 20 61 6e 64 20 73 65 6c 65 63 74 20 69 ion and select i 501e: 74 20 69 6e 20 74 68 65 20 6f 6e 2d 73 63 72 65 t in the on-scre 502e: 65 6e 20 6d 65 6e 75 2e 00 en menu.. 00005037 : 5037: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 63 61 6c ..Now I will cal 5047: 69 62 72 61 74 65 20 64 69 73 74 61 6e 63 65 20 ibrate distance 5057: 62 65 74 77 65 65 6e 20 74 69 70 20 6f 66 20 74 between tip of t 5067: 68 65 20 6e 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 he nozzle and he 5077: 61 74 62 65 64 20 73 75 72 66 61 63 65 2e 00 atbed surface.. 00005086 : 5086: ff ff 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 ..Z calibration 5096: 72 65 63 6f 6d 6d 65 6e 64 65 64 2e 20 52 75 6e recommended. Run 50a6: 20 69 74 20 6e 6f 77 3f 00 it now?. 000050af : 50af: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 50bf: 73 74 65 65 6c 20 73 68 65 65 74 20 66 72 6f 6d steel sheet from 50cf: 20 68 65 61 74 62 65 64 2e 00 heatbed.. 000050d9 : 50d9: ff ff 49 73 20 73 74 65 65 6c 20 73 68 65 65 74 ..Is steel sheet 50e9: 20 6f 6e 20 68 65 61 74 62 65 64 3f 00 on heatbed?. 000050f6 : 50f6: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 20 6f ..Please check o 5106: 75 72 20 68 61 6e 64 62 6f 6f 6b 20 61 6e 64 20 ur handbook and 5116: 66 69 78 20 74 68 65 20 70 72 6f 62 6c 65 6d 2e fix the problem. 5126: 20 54 68 65 6e 20 72 65 73 75 6d 65 20 74 68 65 Then resume the 5136: 20 57 69 7a 61 72 64 20 62 79 20 72 65 62 6f 6f Wizard by reboo 5146: 74 69 6e 67 20 74 68 65 20 70 72 69 6e 74 65 72 ting the printer 5156: 2e 00 .. 00005158 : 5158: ff ff 41 6c 6c 20 69 73 20 64 6f 6e 65 2e 20 48 ..All is done. H 5168: 61 70 70 79 20 70 72 69 6e 74 69 6e 67 21 00 appy printing!. 00005177 : 5177: ff ff 59 6f 75 20 63 61 6e 20 61 6c 77 61 79 73 ..You can always 5187: 20 72 65 73 75 6d 65 20 74 68 65 20 57 69 7a 61 resume the Wiza 5197: 72 64 20 66 72 6f 6d 20 43 61 6c 69 62 72 61 74 rd from Calibrat 51a7: 69 6f 6e 20 2d 3e 20 57 69 7a 61 72 64 2e 00 ion -> Wizard.. 000051b6 : 51b6: ff ff 49 66 20 79 6f 75 20 68 61 76 65 20 61 64 ..If you have ad 51c6: 64 69 74 69 6f 6e 61 6c 20 73 74 65 65 6c 20 73 ditional steel s 51d6: 68 65 65 74 73 2c 20 63 61 6c 69 62 72 61 74 65 heets, calibrate 51e6: 20 74 68 65 69 72 20 70 72 65 73 65 74 73 20 69 their presets i 51f6: 6e 20 53 65 74 74 69 6e 67 73 20 2d 20 48 57 20 n Settings - HW 5206: 53 65 74 75 70 20 2d 20 53 74 65 65 6c 20 73 68 Setup - Steel sh 5216: 65 65 74 73 2e 00 eets.. 0000521c : 521c: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 68 ..Please clean h 522c: 65 61 74 62 65 64 20 61 6e 64 20 74 68 65 6e 20 eatbed and then 523c: 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 2e 00 press the knob.. 0000524c : 524c: ff ff 44 6f 20 79 6f 75 20 77 61 6e 74 20 74 6f ..Do you want to 525c: 20 72 65 70 65 61 74 20 6c 61 73 74 20 73 74 65 repeat last ste 526c: 70 20 74 6f 20 72 65 61 64 6a 75 73 74 20 64 69 p to readjust di 527c: 73 74 61 6e 63 65 20 62 65 74 77 65 65 6e 20 6e stance between n 528c: 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 61 74 62 65 ozzle and heatbe 529c: 64 3f 00 d?. 0000529f : 529f: ff ff 53 65 6c 65 63 74 20 6e 6f 7a 7a 6c 65 20 ..Select nozzle 52af: 70 72 65 68 65 61 74 20 74 65 6d 70 65 72 61 74 preheat temperat 52bf: 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 65 ure which matche 52cf: 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c 2e s your material. ... 000052e0 : 52e0: ff ff 49 73 20 66 69 6c 61 6d 65 6e 74 20 6c 6f ..Is filament lo 52f0: 61 64 65 64 3f 00 aded?. 000052f6 : 52f6: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 70 72 65 ..Now I will pre 5306: 68 65 61 74 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 heat nozzle for 5316: 50 4c 41 2e 00 PLA.. 0000531b : 531b: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 7a 20 63 ..I will run z c 532b: 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 2e 00 alibration now.. 0000533b : 533b: ff ff 4e 6f 77 20 72 65 6d 6f 76 65 20 74 68 65 ..Now remove the 534b: 20 74 65 73 74 20 70 72 69 6e 74 20 66 72 6f 6d test print from 535b: 20 73 74 65 65 6c 20 73 68 65 65 74 2e 00 steel sheet.. 00005369 : 5369: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 5379: 73 68 69 70 70 69 6e 67 20 68 65 6c 70 65 72 73 shipping helpers 5389: 20 66 69 72 73 74 2e 00 first.. 00005391 : 5391: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 78 79 7a ..I will run xyz 53a1: 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 calibration now 53b1: 2e 20 49 74 20 77 69 6c 6c 20 74 61 6b 65 20 75 . It will take u 53c1: 70 20 74 6f 20 32 34 20 6d 69 6e 73 2e 00 p to 24 mins.. 000053cf : 53cf: ff ff 46 69 72 73 74 2c 20 49 20 77 69 6c 6c 20 ..First, I will 53df: 72 75 6e 20 74 68 65 20 73 65 6c 66 74 65 73 74 run the selftest 53ef: 20 74 6f 20 63 68 65 63 6b 20 6d 6f 73 74 20 63 to check most c 53ff: 6f 6d 6d 6f 6e 20 61 73 73 65 6d 62 6c 79 20 70 ommon assembly p 540f: 72 6f 62 6c 65 6d 73 2e 00 roblems.. 00005418 : 5418: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 5428: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 5438: 33 20 70 72 69 6e 74 65 72 2e 20 57 6f 75 6c 64 3 printer. Would 5448: 20 79 6f 75 20 6c 69 6b 65 20 6d 65 20 74 6f 20 you like me to 5458: 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f 75 67 guide you throug 5468: 68 20 74 68 65 20 73 65 74 75 70 20 70 72 6f 63 h the setup proc 5478: 65 73 73 3f 00 ess?. 0000547d : 547d: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 548d: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 549d: 33 20 70 72 69 6e 74 65 72 2e 20 49 20 77 69 6c 3 printer. I wil 54ad: 6c 20 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f l guide you thro 54bd: 75 67 68 20 61 20 73 68 6f 72 74 20 73 65 74 75 ugh a short setu 54cd: 70 20 70 72 6f 63 65 73 73 2c 20 69 6e 20 77 68 p process, in wh 54dd: 69 63 68 20 74 68 65 20 5a 2d 61 78 69 73 20 77 ich the Z-axis w 54ed: 69 6c 6c 20 62 65 20 63 61 6c 69 62 72 61 74 65 ill be calibrate 54fd: 64 2e 20 54 68 65 6e 2c 20 79 6f 75 20 77 69 6c d. Then, you wil 550d: 6c 20 62 65 20 72 65 61 64 79 20 74 6f 20 70 72 l be ready to pr 551d: 69 6e 74 2e 00 int.. 00005522 : 5522: ff ff 50 61 75 73 65 00 ..Pause. 0000552a : 552a: ff ff 46 53 20 41 63 74 69 6f 6e 00 ..FS Action. 00005536 : 5536: ff ff 43 6f 6e 74 2e 00 ..Cont.. 0000553e : 553e: ff ff 46 2e 20 61 75 74 6f 6c 6f 61 64 00 ..F. autoload. 0000554c : 554c: ff ff 46 2e 20 72 75 6e 6f 75 74 00 ..F. runout. 00005558 : 5558: ff ff 43 75 74 74 65 72 00 ..Cutter. 00005561 : 5561: ff ff 46 61 6e 20 73 70 65 65 64 00 ..Fan speed. 0000556d : 556d: ff ff 42 65 64 00 ..Bed. 00005573 : 5573: ff ff 46 61 6e 73 20 63 68 65 63 6b 00 ..Fans check. 00005580 : 5580: ff ff 4d 6f 64 65 6c 00 ..Model. 00005588 : 5588: ff ff 4e 6f 7a 7a 6c 65 00 ..Nozzle. 00005591 : 5591: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 53 65 ..Feeding to FSe 55a1: 6e 73 6f 72 00 nsor. 000055a6 : 55a6: ff ff 4d 6f 76 69 6e 67 20 73 65 6c 65 63 74 6f ..Moving selecto 55b6: 72 00 r. 000055b8 : 55b8: ff ff 48 6f 6d 69 6e 67 00 ..Homing. 000055c1 : 55c1: ff ff 52 65 74 72 61 63 74 20 66 72 6f 6d 20 46 ..Retract from F 55d1: 49 4e 44 41 00 INDA. 000055d6 : 55d6: ff ff 45 6a 65 63 74 69 6e 67 20 66 69 6c 61 6d ..Ejecting filam 55e6: 65 6e 74 00 ent. 000055ea : 55ea: ff ff 50 61 72 6b 69 6e 67 20 73 65 6c 65 63 74 ..Parking select 55fa: 6f 72 00 or. 000055fd : 55fd: ff ff 52 65 74 75 72 6e 69 6e 67 20 73 65 6c 65 ..Returning sele 560d: 63 74 6f 72 00 ctor. 00005612 : 5612: ff ff 50 65 72 66 6f 72 6d 69 6e 67 20 63 75 74 ..Performing cut ... 00005623 : 5623: ff ff 50 75 73 68 69 6e 67 20 66 69 6c 61 6d 65 ..Pushing filame 5633: 6e 74 00 nt. 00005636 : 5636: ff ff 50 72 65 70 61 72 69 6e 67 20 62 6c 61 64 ..Preparing blad 5646: 65 00 e. 00005648 : 5648: ff ff 53 65 6c 65 63 74 69 6e 67 20 66 69 6c 2e ..Selecting fil. 5658: 20 73 6c 6f 74 00 slot. 0000565e : 565e: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 ..Unloading fila 566e: 6d 65 6e 74 00 ment. 00005673 : 5673: ff ff 45 52 52 20 54 4d 43 20 66 61 69 6c 65 64 ..ERR TMC failed ... 00005684 : 5684: ff ff 45 52 52 20 48 65 6c 70 20 66 69 6c 61 6d ..ERR Help filam 5694: 65 6e 74 00 ent. 00005698 : 5698: ff ff 45 52 52 20 49 6e 74 65 72 6e 61 6c 00 ..ERR Internal. 000056a7 : 56a7: ff ff 45 52 52 20 57 61 69 74 20 66 6f 72 20 55 ..ERR Wait for U 56b7: 73 65 72 00 ser. 000056bb : 56bb: ff ff 46 69 6e 69 73 68 69 6e 67 20 6d 6f 76 65 ..Finishing move 56cb: 6d 65 6e 74 73 00 ments. 000056d1 : 56d1: ff ff 41 76 6f 69 64 69 6e 67 20 67 72 69 6e 64 ..Avoiding grind ... 000056e2 : 56e2: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 6e 6f 7a ..Feeding to noz 56f2: 7a 6c 65 00 zle. 000056f6 : 56f6: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 65 78 74 ..Feeding to ext 5706: 72 75 64 65 72 00 ruder. 0000570c : 570c: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 49 4e ..Feeding to FIN 571c: 44 41 00 DA. 0000571f : 571f: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 70 ..Unloading to p 572f: 75 6c 6c 65 79 00 ulley. 00005735 : 5735: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 46 ..Unloading to F 5745: 49 4e 44 41 00 INDA. 0000574a : 574a: ff ff 44 69 73 65 6e 67 61 67 69 6e 67 20 69 64 ..Disengaging id 575a: 6c 65 72 00 ler. 0000575e : 575e: ff ff 45 6e 67 61 67 69 6e 67 20 69 64 6c 65 72 ..Engaging idler ... 0000576f : 576f: ff ff 4f 4b 00 ..OK. 00005774 <_ZN4MMU2L23MSG_TITLE_UNKNOWN_ERRORE.lto_priv.490>: 5774: ff ff 55 4e 4b 4e 4f 57 4e 20 45 52 52 4f 52 00 ..UNKNOWN ERROR. 00005784 <_ZN4MMU2L25MSG_TITLE_FILAMENT_CHANGEE.lto_priv.489>: 5784: ff ff 46 49 4c 41 4d 45 4e 54 20 43 48 41 4e 47 ..FILAMENT CHANG 5794: 45 00 E. 00005796 <_ZN4MMU2L26MSG_TITLE_FILAMENT_EJECTEDE.lto_priv.488>: 5796: ff ff 46 49 4c 41 4d 45 4e 54 20 45 4a 45 43 54 ..FILAMENT EJECT 57a6: 45 44 00 ED. 000057a9 <_ZN4MMU2L25MSG_TITLE_UNLOAD_MANUALLYE.lto_priv.487>: 57a9: ff ff 55 4e 4c 4f 41 44 20 4d 41 4e 55 41 4c 4c ..UNLOAD MANUALL 57b9: 59 00 Y. 000057bb <_ZN4MMU2L26MSG_TITLE_FW_RUNTIME_ERRORE.lto_priv.486>: 57bb: ff ff 46 57 20 52 55 4e 54 49 4d 45 20 45 52 52 ..FW RUNTIME ERR 57cb: 4f 52 00 OR. 000057ce <_ZN4MMU2L26MSG_TITLE_FW_UPDATE_NEEDEDE.lto_priv.485>: 57ce: ff ff 4d 4d 55 20 46 57 20 55 50 44 41 54 45 20 ..MMU FW UPDATE 57de: 4e 45 45 44 45 44 00 NEEDED. 000057e5 <_ZN4MMU2L20MSG_TITLE_QUEUE_FULLE.lto_priv.484>: 57e5: ff ff 51 55 45 55 45 20 46 55 4c 4c 00 ..QUEUE FULL. 000057f2 <_ZN4MMU2L22MSG_TITLE_INVALID_TOOLE.lto_priv.483>: 57f2: ff ff 49 4e 56 41 4c 49 44 20 54 4f 4f 4c 00 ..INVALID TOOL. 00005801 <_ZN4MMU2L33MSG_TITLE_FILAMENT_ALREADY_LOADEDE.lto_priv.482>: 5801: ff ff 46 49 4c 2e 20 41 4c 52 45 41 44 59 20 4c ..FIL. ALREADY L 5811: 4f 41 44 45 44 00 OADED. 00005817 <_ZN4MMU2L29MSG_TITLE_COMMUNICATION_ERRORE.lto_priv.481>: 5817: ff ff 43 4f 4d 4d 55 4e 49 43 41 54 49 4f 4e 20 ..COMMUNICATION 5827: 45 52 52 4f 52 00 ERROR. 0000582d <_ZN4MMU2L28MSG_TITLE_MMU_NOT_RESPONDINGE.lto_priv.480>: 582d: ff ff 4d 4d 55 20 4e 4f 54 20 52 45 53 50 4f 4e ..MMU NOT RESPON 583d: 44 49 4e 47 00 DING. 00005842 <_ZN4MMU2L23MSG_TITLE_MMU_MCU_ERRORE.lto_priv.479>: 5842: ff ff 4d 4d 55 20 4d 43 55 20 45 52 52 4f 52 00 ..MMU MCU ERROR. 00005852 <_ZN4MMU2L25MSG_TITLE_SELFTEST_FAILEDE.lto_priv.478>: 5852: ff ff 4d 4d 55 20 53 45 4c 46 54 45 53 54 20 46 ..MMU SELFTEST F 5862: 41 49 4c 45 44 00 AILED. 00005868 <_ZN4MMU2L28MSG_TITLE_TMC_DRIVER_SHORTEDE.lto_priv.477>: 5868: ff ff 54 4d 43 20 44 52 49 56 45 52 20 53 48 4f ..TMC DRIVER SHO 5878: 52 54 45 44 00 RTED. 0000587d <_ZN4MMU2L32MSG_TITLE_TMC_UNDERVOLTAGE_ERRORE.lto_priv.476>: 587d: ff ff 54 4d 43 20 55 4e 44 45 52 56 4f 4c 54 41 ..TMC UNDERVOLTA 588d: 47 45 20 45 52 52 00 GE ERR. 00005894 <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_RESETE.lto_priv.475>: 5894: ff ff 54 4d 43 20 44 52 49 56 45 52 20 52 45 53 ..TMC DRIVER RES 58a4: 45 54 00 ET. 000058a7 <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_ERRORE.lto_priv.474>: 58a7: ff ff 54 4d 43 20 44 52 49 56 45 52 20 45 52 52 ..TMC DRIVER ERR 58b7: 4f 52 00 OR. 000058ba <_ZN4MMU2L28MSG_TITLE_TMC_OVERHEAT_ERRORE.lto_priv.473>: 58ba: ff ff 54 4d 43 20 4f 56 45 52 48 45 41 54 20 45 ..TMC OVERHEAT E 58ca: 52 52 4f 52 00 RROR. 000058cf <_ZN4MMU2L33MSG_TITLE_TMC_WARNING_TMC_TOO_HOTE.lto_priv.472>: 58cf: ff ff 57 41 52 4e 49 4e 47 20 54 4d 43 20 54 4f ..WARNING TMC TO 58df: 4f 20 48 4f 54 00 O HOT. 000058e5 <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_MOVEE.lto_priv.471>: 58e5: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 4d ..IDLER CANNOT M 58f5: 4f 56 45 00 OVE. 000058f9 <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_HOMEE.lto_priv.470>: 58f9: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 48 ..IDLER CANNOT H 5909: 4f 4d 45 00 OME. 0000590d <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_MOVEE.lto_priv.469>: 590d: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 591d: 54 20 4d 4f 56 45 00 T MOVE. 00005924 <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_HOMEE.lto_priv.468>: 5924: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 5934: 54 20 48 4f 4d 45 00 T HOME. 0000593b <_ZN4MMU2L33MSG_TITLE_LOAD_TO_EXTRUDER_FAILEDE.lto_priv.467>: 593b: ff ff 4c 4f 41 44 20 54 4f 20 45 58 54 52 2e 20 ..LOAD TO EXTR. 594b: 46 41 49 4c 45 44 00 FAILED. 00005952 <_ZN4MMU2L23MSG_TITLE_INSPECT_FINDAE.lto_priv.466>: 5952: ff ff 49 4e 53 50 45 43 54 20 46 49 4e 44 41 00 ..INSPECT FINDA. 00005962 <_ZN4MMU2L27MSG_TITLE_FSENSOR_TOO_EARLYE.lto_priv.465>: 5962: ff ff 46 53 45 4e 53 4f 52 20 54 4f 4f 20 45 41 ..FSENSOR TOO EA 5972: 52 4c 59 00 RLY. 00005976 <_ZN4MMU2L28MSG_TITLE_PULLEY_CANNOT_MOVEE.lto_priv.464>: 5976: ff ff 50 55 4c 4c 45 59 20 43 41 4e 4e 4f 54 20 ..PULLEY CANNOT 5986: 4d 4f 56 45 00 MOVE. 0000598b <_ZN4MMU2L32MSG_TITLE_FSENSOR_FILAMENT_STUCKE.lto_priv.463>: 598b: ff ff 46 53 45 4e 53 4f 52 20 46 49 4c 2e 20 53 ..FSENSOR FIL. S 599b: 54 55 43 4b 00 TUCK. 000059a0 <_ZN4MMU2L31MSG_TITLE_FSENSOR_DIDNT_TRIGGERE.lto_priv.462>: 59a0: ff ff 46 53 45 4e 53 4f 52 20 44 49 44 4e 54 20 ..FSENSOR DIDNT 59b0: 54 52 49 47 47 2e 00 TRIGG.. 000059b7 <_ZN4MMU2L30MSG_TITLE_FINDA_FILAMENT_STUCKE.lto_priv.461>: 59b7: ff ff 46 49 4e 44 41 20 46 49 4c 41 4d 2e 20 53 ..FINDA FILAM. S 59c7: 54 55 43 4b 00 TUCK. 000059cc <_ZN4MMU2L29MSG_TITLE_FINDA_DIDNT_TRIGGERE.lto_priv.460>: 59cc: ff ff 46 49 4e 44 41 20 44 49 44 4e 54 20 54 52 ..FINDA DIDNT TR 59dc: 49 47 47 45 52 00 IGGER. 000059e2 : 59e2: ff ff 43 75 74 20 66 69 6c 61 6d 65 6e 74 00 ..Cut filament. 000059f1 : 59f1: ff ff 45 6a 65 63 74 20 66 72 6f 6d 20 4d 4d 55 ..Eject from MMU ... 00005a02 : 5a02: ff ff 4c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 ..Loading filame 5a12: 6e 74 00 nt. 00005a15 : 5a15: ff ff 4d 4d 55 20 52 65 74 72 79 3a 20 52 65 73 ..MMU Retry: Res 5a25: 74 6f 72 69 6e 67 20 74 65 6d 70 65 72 61 74 75 toring temperatu 5a35: 72 65 2e 2e 2e 00 re.... 00005a3b : 5a3b: ff ff 53 6f 72 74 69 6e 67 20 66 69 6c 65 73 00 ..Sorting files. 00005a4b : 5a4b: ff ff 53 6f 6d 65 20 66 69 6c 65 73 20 77 69 6c ..Some files wil 5a5b: 6c 20 6e 6f 74 20 62 65 20 73 6f 72 74 65 64 2e l not be sorted. 5a6b: 20 4d 61 78 2e 20 4e 6f 2e 20 6f 66 20 66 69 6c Max. No. of fil 5a7b: 65 73 20 69 6e 20 31 20 66 6f 6c 64 65 72 20 66 es in 1 folder f 5a8b: 6f 72 20 73 6f 72 74 69 6e 67 20 69 73 20 31 30 or sorting is 10 5a9b: 30 2e 00 0.. 00005a9e : 5a9e: ff ff 53 54 4f 50 50 45 44 2e 00 ..STOPPED.. 00005aa9 : 5aa9: ff ff 4f 66 66 00 ..Off. 00005aaf : 5aaf: ff ff 4f 6e 00 ..On. 00005ab4 : 5ab4: ff ff 55 6e 65 78 70 65 63 74 65 64 20 65 72 72 ..Unexpected err 5ac4: 6f 72 20 6f 63 63 75 72 72 65 64 2e 00 or occurred.. 00005ad1 : 5ad1: ff ff 4d 36 30 30 20 46 69 6c 61 6d 65 6e 74 20 ..M600 Filament 5ae1: 43 68 61 6e 67 65 2e 20 4c 6f 61 64 20 61 20 6e Change. Load a n 5af1: 65 77 20 66 69 6c 61 6d 65 6e 74 20 6f 72 20 65 ew filament or e 5b01: 6a 65 63 74 20 74 68 65 20 6f 6c 64 20 6f 6e 65 ject the old one 5b11: 2e 00 .. 00005b13 : 5b13: ff ff 52 65 6d 6f 76 65 20 74 68 65 20 65 6a 65 ..Remove the eje 5b23: 63 74 65 64 20 66 69 6c 61 6d 65 6e 74 20 66 72 cted filament fr 5b33: 6f 6d 20 74 68 65 20 66 72 6f 6e 74 20 6f 66 20 om the front of 5b43: 74 68 65 20 4d 4d 55 2e 00 the MMU.. 00005b4c : 5b4c: ff ff 46 69 6c 61 6d 65 6e 74 20 64 65 74 65 63 ..Filament detec 5b5c: 74 65 64 20 75 6e 65 78 70 65 63 74 65 64 6c 79 ted unexpectedly 5b6c: 2e 20 45 6e 73 75 72 65 20 6e 6f 20 66 69 6c 61 . Ensure no fila 5b7c: 6d 65 6e 74 20 69 73 20 6c 6f 61 64 65 64 2e 20 ment is loaded. 5b8c: 43 68 65 63 6b 20 74 68 65 20 73 65 6e 73 6f 72 Check the sensor 5b9c: 73 20 61 6e 64 20 77 69 72 69 6e 67 2e 00 s and wiring.. 00005baa : 5baa: ff ff 49 6e 74 65 72 6e 61 6c 20 72 75 6e 74 69 ..Internal runti 5bba: 6d 65 20 65 72 72 6f 72 2e 20 54 72 79 20 72 65 me error. Try re 5bca: 73 65 74 74 69 6e 67 20 74 68 65 20 4d 4d 55 20 setting the MMU 5bda: 6f 72 20 75 70 64 61 74 69 6e 67 20 74 68 65 20 or updating the 5bea: 66 69 72 6d 77 61 72 65 2e 00 firmware.. 00005bf4 : 5bf4: ff ff 4d 4d 55 20 46 57 20 76 65 72 73 69 6f 6e ..MMU FW version 5c04: 20 69 73 20 69 6e 63 6f 6d 70 61 74 69 62 6c 65 is incompatible 5c14: 20 77 69 74 68 20 70 72 69 6e 74 65 72 20 46 57 with printer FW 5c24: 2e 55 70 64 61 74 65 20 74 6f 20 76 65 72 73 69 .Update to versi 5c34: 6f 6e 20 33 2e 30 2e 33 2e 00 on 3.0.3.. 00005c3e : 5c3e: ff ff 4d 4d 55 20 46 69 72 6d 77 61 72 65 20 69 ..MMU Firmware i 5c4e: 6e 74 65 72 6e 61 6c 20 65 72 72 6f 72 2c 20 70 nternal error, p 5c5e: 6c 65 61 73 65 20 72 65 73 65 74 20 74 68 65 20 lease reset the 5c6e: 4d 4d 55 2e 00 MMU.. 00005c73 : 5c73: ff ff 52 65 71 75 65 73 74 65 64 20 66 69 6c 61 ..Requested fila 5c83: 6d 65 6e 74 20 74 6f 6f 6c 20 69 73 20 6e 6f 74 ment tool is not 5c93: 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 74 68 available on th 5ca3: 69 73 20 68 61 72 64 77 61 72 65 2e 20 43 68 65 is hardware. Che 5cb3: 63 6b 20 74 68 65 20 47 2d 63 6f 64 65 20 66 6f ck the G-code fo 5cc3: 72 20 74 6f 6f 6c 20 69 6e 64 65 78 20 6f 75 74 r tool index out 5cd3: 20 6f 66 20 72 61 6e 67 65 20 28 54 30 2d 54 34 of range (T0-T4 5ce3: 29 2e 00 ).. 00005ce6 : 5ce6: ff ff 43 61 6e 6e 6f 74 20 70 65 72 66 6f 72 6d ..Cannot perform 5cf6: 20 74 68 65 20 61 63 74 69 6f 6e 2c 20 66 69 6c the action, fil 5d06: 61 6d 65 6e 74 20 69 73 20 61 6c 72 65 61 64 79 ament is already 5d16: 20 6c 6f 61 64 65 64 2e 20 55 6e 6c 6f 61 64 20 loaded. Unload 5d26: 69 74 20 66 69 72 73 74 2e 00 it first.. 00005d30 : 5d30: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 5d40: 64 69 6e 67 20 63 6f 72 72 65 63 74 6c 79 2e 20 ding correctly. 5d50: 43 68 65 63 6b 20 74 68 65 20 77 69 72 69 6e 67 Check the wiring 5d60: 20 61 6e 64 20 63 6f 6e 6e 65 63 74 6f 72 73 2e and connectors. ... 00005d71 : 5d71: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 5d81: 64 69 6e 67 2e 20 43 68 65 63 6b 20 74 68 65 20 ding. Check the 5d91: 77 69 72 69 6e 67 20 61 6e 64 20 63 6f 6e 6e 65 wiring and conne 5da1: 63 74 6f 72 73 2e 00 ctors.. 00005da8 : 5da8: ff ff 4d 6f 72 65 20 64 65 74 61 69 6c 73 20 6f ..More details o 5db8: 6e 6c 69 6e 65 2e 00 nline.. 00005dbf : 5dbf: ff ff 54 68 65 20 49 64 6c 65 72 20 63 61 6e 6e ..The Idler cann 5dcf: 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 72 6c 79 ot home properly 5ddf: 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 6e 79 74 . Check for anyt 5def: 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 20 69 74 hing blocking it 5dff: 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 s movement.. 00005e0b : 5e0b: ff ff 43 61 6e 27 74 20 6d 6f 76 65 20 53 65 6c ..Can't move Sel 5e1b: 65 63 74 6f 72 20 6f 72 20 49 64 6c 65 72 2e 00 ector or Idler.. 00005e2b : 5e2b: ff ff 54 68 65 20 53 65 6c 65 63 74 6f 72 20 63 ..The Selector c 5e3b: 61 6e 6e 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 annot home prope 5e4b: 72 6c 79 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 rly. Check for a 5e5b: 6e 79 74 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 nything blocking 5e6b: 20 69 74 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 its movement.. 00005e7a : 5e7a: ff ff 4c 6f 61 64 69 6e 67 20 74 6f 20 65 78 74 ..Loading to ext 5e8a: 72 75 64 65 72 20 66 61 69 6c 65 64 2e 20 49 6e ruder failed. In 5e9a: 73 70 65 63 74 20 74 68 65 20 66 69 6c 61 6d 65 spect the filame 5eaa: 6e 74 20 74 69 70 20 73 68 61 70 65 2e 20 52 65 nt tip shape. Re 5eba: 66 69 6e 65 20 74 68 65 20 73 65 6e 73 6f 72 20 fine the sensor 5eca: 63 61 6c 69 62 72 61 74 69 6f 6e 2c 20 69 66 20 calibration, if 5eda: 6e 65 65 64 65 64 2e 00 needed.. 00005ee2 : 5ee2: ff ff 53 65 6c 65 63 74 6f 72 20 63 61 6e 27 74 ..Selector can't 5ef2: 20 6d 6f 76 65 20 64 75 65 20 74 6f 20 46 49 4e move due to FIN 5f02: 44 41 20 64 65 74 65 63 74 69 6e 67 20 61 20 66 DA detecting a f 5f12: 69 6c 61 6d 65 6e 74 2e 20 4d 61 6b 65 20 73 75 ilament. Make su 5f22: 72 65 20 6e 6f 20 66 69 6c 61 6d 65 6e 74 20 69 re no filament i 5f32: 73 20 69 6e 20 53 65 6c 65 63 74 6f 72 20 61 6e s in Selector an 5f42: 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 20 70 72 d FINDA works pr 5f52: 6f 70 65 72 6c 79 2e 00 operly.. 00005f5a : 5f5a: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 5f6a: 72 20 74 72 69 67 67 65 72 65 64 20 74 6f 6f 20 r triggered too 5f7a: 65 61 72 6c 79 20 77 68 69 6c 65 20 6c 6f 61 64 early while load 5f8a: 69 6e 67 20 74 6f 20 65 78 74 72 75 64 65 72 2e ing to extruder. 5f9a: 20 43 68 65 63 6b 20 74 68 65 72 65 20 69 73 6e Check there isn 5faa: 27 74 20 61 6e 79 74 68 69 6e 67 20 73 74 75 63 't anything stuc 5fba: 6b 20 69 6e 20 50 54 46 45 20 74 75 62 65 2e 20 k in PTFE tube. 5fca: 43 68 65 63 6b 20 74 68 61 74 20 73 65 6e 73 6f Check that senso 5fda: 72 20 72 65 61 64 73 20 70 72 6f 70 65 72 6c 79 r reads properly 5fea: 2e 00 .. 00005fec : 5fec: ff ff 50 75 6c 6c 65 79 20 6d 6f 74 6f 72 20 73 ..Pulley motor s 5ffc: 74 61 6c 6c 65 64 2e 20 45 6e 73 75 72 65 20 74 talled. Ensure t 600c: 68 65 20 70 75 6c 6c 65 79 20 63 61 6e 20 6d 6f he pulley can mo 601c: 76 65 20 61 6e 64 20 63 68 65 63 6b 20 74 68 65 ve and check the 602c: 20 77 69 72 69 6e 67 2e 00 wiring.. 00006035 : 6035: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 6045: 72 20 64 69 64 6e 27 74 20 73 77 69 74 63 68 20 r didn't switch 6055: 6f 66 66 20 77 68 69 6c 65 20 75 6e 6c 6f 61 64 off while unload 6065: 69 6e 67 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e ing filament. En 6075: 73 75 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 sure filament ca 6085: 6e 20 6d 6f 76 65 20 61 6e 64 20 74 68 65 20 73 n move and the s 6095: 65 6e 73 6f 72 20 77 6f 72 6b 73 2e 00 ensor works.. 000060a2 : 60a2: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 60b2: 72 20 64 69 64 6e 27 74 20 74 72 69 67 67 65 72 r didn't trigger 60c2: 20 77 68 69 6c 65 20 6c 6f 61 64 69 6e 67 20 74 while loading t 60d2: 68 65 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e 73 he filament. Ens 60e2: 75 72 65 20 74 68 65 20 73 65 6e 73 6f 72 20 69 ure the sensor i 60f2: 73 20 63 61 6c 69 62 72 61 74 65 64 20 61 6e 64 s calibrated and 6102: 20 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 72 65 the filament re 6112: 61 63 68 65 64 20 69 74 2e 00 ached it.. 0000611c : 611c: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 73 ..FINDA didn't s 612c: 77 69 74 63 68 20 6f 66 66 20 77 68 69 6c 65 20 witch off while 613c: 75 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 unloading filame 614c: 6e 74 2e 20 54 72 79 20 75 6e 6c 6f 61 64 69 6e nt. Try unloadin 615c: 67 20 6d 61 6e 75 61 6c 6c 79 2e 20 45 6e 73 75 g manually. Ensu 616c: 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 6e 20 re filament can 617c: 6d 6f 76 65 20 61 6e 64 20 46 49 4e 44 41 20 77 move and FINDA w 618c: 6f 72 6b 73 2e 00 orks.. 00006192 : 6192: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 74 ..FINDA didn't t 61a2: 72 69 67 67 65 72 20 77 68 69 6c 65 20 6c 6f 61 rigger while loa 61b2: 64 69 6e 67 20 74 68 65 20 66 69 6c 61 6d 65 6e ding the filamen 61c2: 74 2e 20 45 6e 73 75 72 65 20 74 68 65 20 66 69 t. Ensure the fi 61d2: 6c 61 6d 65 6e 74 20 63 61 6e 20 6d 6f 76 65 20 lament can move 61e2: 61 6e 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 2e and FINDA works. ... 000061f3 : 61f3: ff ff 44 69 73 61 62 6c 65 00 ..Disable. 000061fd : 61fd: ff ff 53 74 6f 70 00 ..Stop. 00006204 : 6204: ff ff 4c 6f 61 64 00 ..Load. 0000620b : 620b: ff ff 55 6e 6c 6f 61 64 00 ..Unload. 00006214 : 6214: ff ff 52 65 73 65 74 4d 4d 55 00 ..ResetMMU. 0000621f : 621f: ff ff 52 65 74 72 79 00 ..Retry. 00006227 : 6227: ff ff 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 ..Bed leveling f 6237: 61 69 6c 65 64 2e 20 53 65 6e 73 6f 72 20 64 69 ailed. Sensor di 6247: 64 6e 27 74 20 74 72 69 67 67 65 72 2e 20 44 65 dn't trigger. De 6257: 62 72 69 73 20 6f 6e 20 6e 6f 7a 7a 6c 65 3f 20 bris on nozzle? 6267: 57 61 69 74 69 6e 67 20 66 6f 72 20 72 65 73 65 Waiting for rese 6277: 74 2e 00 t.. 0000627a : 627a: ff ff 53 65 6e 73 69 74 69 76 69 74 79 00 ..Sensitivity. 00006288 : 6288: ff ff 44 6f 6e 65 00 ..Done. 0000628f <__loc_pri_end>: 628f: 65 6e ori r22, 0xE5 ; 229 6291: 71 75 andi r23, 0x51 ; 81 6293: 65 69 ori r22, 0x95 ; 149 6295: 6e 67 ori r22, 0x7E ; 126 6297: 20 22 and r2, r16 ... 0000629a : 629a: 44 6f 6e 65 20 70 72 69 6e 74 69 6e 67 20 66 69 Done printing fi 62aa: 6c 65 00 le. 000062ad : 62ad: 4e 6f 20 4c 69 6e 65 20 4e 75 6d 62 65 72 20 77 No Line Number w 62bd: 69 74 68 20 63 68 65 63 6b 73 75 6d 2c 20 4c 61 ith checksum, La 62cd: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 000062d7 : 62d7: 4e 6f 20 43 68 65 63 6b 73 75 6d 20 77 69 74 68 No Checksum with 62e7: 20 6c 69 6e 65 20 6e 75 6d 62 65 72 2c 20 4c 61 line number, La 62f7: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 00006301 : 6301: 63 68 65 63 6b 73 75 6d 20 6d 69 73 6d 61 74 63 checksum mismatc 6311: 68 2c 20 4c 61 73 74 20 4c 69 6e 65 3a 20 00 h, Last Line: . 00006320 : 6320: 4c 69 6e 65 20 4e 75 6d 62 65 72 20 69 73 20 6e Line Number is n 6330: 6f 74 20 4c 61 73 74 20 4c 69 6e 65 20 4e 75 6d ot Last Line Num 6340: 62 65 72 2b 31 2c 20 4c 61 73 74 20 4c 69 6e 65 ber+1, Last Line 6350: 3a 20 00 : . 00006353 : 6353: 25 75 20 62 79 74 65 73 20 77 72 69 74 74 65 6e %u bytes written 6363: 20 74 6f 20 25 53 20 61 74 20 61 64 64 72 65 73 to %S at addres 6373: 73 20 30 78 25 30 38 78 0a 00 s 0x%08x.. 0000637d : 637d: 44 25 64 20 2d 20 52 65 61 64 2f 57 72 69 74 65 D%d - Read/Write 638d: 20 25 53 0a 00 %S.. 00006392 <__c.2310>: 6392: 3f 3f 00 ??. 00006395 <__c.2308>: 6395: 52 6f 6d 61 6e 61 00 Romana. 0000639c <__c.2305>: 639c: 48 72 76 61 74 73 6b 69 00 Hrvatski. 000063a5 <__c.2302>: 63a5: 4d 61 67 79 61 72 00 Magyar. 000063ac <__c.2299>: 63ac: 53 6c 6f 76 65 6e 63 69 6e 61 00 Slovencina. 000063b7 <__c.2296>: 63b7: 4e 6f 72 73 6b 00 Norsk. 000063bd <__c.2293>: 63bd: 53 76 65 6e 73 6b 61 00 Svenska. 000063c5 <__c.2290>: 63c5: 4e 65 64 65 72 6c 61 6e 64 73 00 Nederlands. 000063d0 <__c.2287>: 63d0: 50 6f 6c 73 6b 69 00 Polski. 000063d7 <__c.2284>: 63d7: 49 74 61 6c 69 61 6e 6f 00 Italiano. 000063e0 <__c.2281>: 63e0: 46 72 61 6e 63 61 69 73 00 Francais. 000063e9 <__c.2278>: 63e9: 45 73 70 61 6e 6f 6c 00 Espanol. 000063f1 <__c.2275>: 63f1: 44 65 75 74 73 63 68 00 Deutsch. 000063f9 <__c.2272>: 63f9: 43 65 73 74 69 6e 61 00 Cestina. 00006401 <__c.2269>: 6401: 45 6e 67 6c 69 73 68 00 English. 00006409 : 6409: 20 43 6f 75 6e 74 20 58 3a 20 00 Count X: . 00006414 : 6414: 45 30 3a 25 64 20 52 50 4d 20 50 52 4e 31 3a 25 E0:%d RPM PRN1:% 6424: 64 20 52 50 4d 20 45 30 40 3a 25 75 20 50 52 4e d RPM E0@:%u PRN 6434: 31 40 3a 25 75 0a 00 1@:%u.. 0000643b : 643b: 52 65 73 65 6e 64 00 Resend. 00006442 : 6442: 25 53 3a 20 25 6c 64 0a 25 53 0a 00 %S: %ld.%S.. 0000644e : 644e: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 69 66 69 63 //action:notific 645e: 61 74 69 6f 6e 20 25 53 0a 00 ation %S.. 00006468 : 6468: 46 69 6c 61 6d 65 6e 74 20 72 75 6e 6f 75 74 20 Filament runout 6478: 64 65 74 65 63 74 65 64 21 00 detected!. 00006482 : 6482: 64 69 73 61 62 6c 65 64 00 disabled. 0000648b : 648b: 65 6e 61 62 6c 65 64 00 enabled. 00006493 : 6493: 45 45 50 52 4f 4d 00 EEPROM. 0000649a : 649a: 53 52 41 4d 00 SRAM. 0000649f : 649f: 44 2d 31 20 2d 20 45 6e 64 6c 65 73 73 20 6c 6f D-1 - Endless lo 64af: 6f 70 0a 00 op.. 000064b3 : 64b3: 41 63 74 69 76 65 20 45 78 74 72 75 64 65 72 3a Active Extruder: 64c3: 20 30 00 0. 000064c6 : 64c6: 49 6e 76 61 6c 69 64 20 65 78 74 72 75 64 65 72 Invalid extruder ... 000064d7 : 64d7: 4d 32 32 30 20 53 25 64 00 M220 S%d. 000064e0 : 64e0: 53 44 20 70 72 69 6e 74 69 6e 67 20 62 79 74 65 SD printing byte 64f0: 20 00 . 000064f2 : 64f2: 25 75 00 %u. 000064f5 : 64f5: 55 6e 6b 6e 6f 77 6e 20 63 6f 6d 6d 61 6e 64 3a Unknown command: 6505: 20 22 00 ". 00006508 <_ZZ16process_commandsvE3__c__55_>: 6508: 4d 32 30 30 20 49 6e 76 61 6c 69 64 20 65 78 74 M200 Invalid ext 6518: 72 75 64 65 72 20 00 ruder . 0000651f : 651f: 7a 5f 6d 61 78 3a 20 00 z_max: . 00006527 : 6527: 7a 5f 6d 69 6e 3a 20 00 z_min: . 0000652f <_ZZ16process_commandsvE3__c__54_>: 652f: 79 5f 6d 69 6e 3a 20 00 y_min: . 00006537 : 6537: 54 52 49 47 47 45 52 45 44 00 TRIGGERED. 00006541 : 6541: 6f 70 65 6e 00 open. 00006546 <_ZZ16process_commandsvE3__c__53_>: 6546: 78 5f 6d 69 6e 3a 20 00 x_min: . 0000654e <_ZZ16process_commandsvE3__c__52_>: 654e: 52 65 70 6f 72 74 69 6e 67 20 65 6e 64 73 74 6f Reporting endsto 655e: 70 20 73 74 61 74 75 73 00 p status. 00006567 : 6567: 4d 31 31 32 20 63 61 6c 6c 65 64 2e 20 45 6d 65 M112 called. Eme 6577: 72 67 65 6e 63 79 20 53 74 6f 70 2e 00 rgency Stop.. 00006584 : 6584: 2f 2f 61 63 74 69 6f 6e 3a 75 76 6c 6f 5f 72 65 //action:uvlo_re 6594: 63 6f 76 65 72 79 5f 72 65 61 64 79 00 covery_ready. 000065a1 <_ZZ16process_commandsvE3__c__38_>: 65a1: 25 53 3a 25 6c 75 20 63 6d 0a 25 53 3a 25 6c 75 %S:%lu cm.%S:%lu 65b1: 20 6d 69 6e 0a 00 min.. 000065b7 <_ZZ16process_commandsvE3__c__37_>: 65b7: 53 49 4c 45 4e 54 00 SILENT. 000065be <_ZZ16process_commandsvE3__c__36_>: 65be: 4e 4f 52 4d 41 4c 00 NORMAL. 000065c5 <_ZZ16process_commandsvE3__c__35_>: 65c5: 25 53 20 4d 4f 44 45 3a 20 50 65 72 63 65 6e 74 %S MODE: Percent 65d5: 20 64 6f 6e 65 3a 20 25 68 68 64 3b 20 70 72 69 done: %hhd; pri 65e5: 6e 74 20 74 69 6d 65 20 72 65 6d 61 69 6e 69 6e nt time remainin 65f5: 67 20 69 6e 20 6d 69 6e 73 3a 20 25 64 3b 20 43 g in mins: %d; C 6605: 68 61 6e 67 65 20 69 6e 20 6d 69 6e 73 3a 20 25 hange in mins: % 6615: 64 0a 00 d.. 00006618 <_ZZ16process_commandsvE3__c__34_>: 6618: 50 72 69 6e 74 65 72 53 74 61 74 65 3a 20 25 64 PrinterState: %d 6628: 0a 00 .. 0000662a <_ZZ16process_commandsvE3__c__30_>: 662a: 45 6e 64 20 66 69 6c 65 20 6c 69 73 74 00 End file list. 00006638 <_ZZ16process_commandsvE3__c__29_>: 6638: 42 65 67 69 6e 20 66 69 6c 65 20 6c 69 73 74 00 Begin file list. 00006648 : 6648: 55 6e 6b 6e 6f 77 6e 20 25 63 20 63 6f 64 65 3a Unknown %c code: 6658: 20 25 73 0a 00 %s.. 0000665d <_ZZ16process_commandsvE3__c__27_>: 665d: 0a 50 49 4e 44 41 20 74 65 6d 70 65 72 61 74 75 .PINDA temperatu 666d: 72 65 3a 20 25 2e 31 66 20 5a 20 73 68 69 66 74 re: %.1f Z shift 667d: 20 28 6d 6d 29 3a 20 25 2e 33 66 00 (mm): %.3f. 00006689 <_ZZ16process_commandsvE3__c__26_>: 6689: 0a 53 74 65 70 3a 20 25 64 2f 36 0a 00 .Step: %d/6.. 00006696 <_ZZ16process_commandsvE3__c__25_>: 6696: 0a 53 74 65 70 3a 20 25 64 2f 36 20 28 73 6b 69 .Step: %d/6 (ski 66a6: 70 70 65 64 29 0a 50 49 4e 44 41 20 74 65 6d 70 pped).PINDA temp 66b6: 65 72 61 74 75 72 65 3a 20 25 64 20 5a 20 73 68 erature: %d Z sh 66c6: 69 66 74 20 28 6d 6d 29 3a 30 0a 00 ift (mm):0.. 000066d2 <_ZZ16process_commandsvE3__c__24_>: 66d2: 0a 5a 45 52 4f 3a 20 25 2e 33 66 0a 00 .ZERO: %.3f.. 000066df <_ZZ16process_commandsvE3__c__23_>: 66df: 73 74 61 72 74 20 74 65 6d 70 65 72 61 74 75 72 start temperatur 66ef: 65 3a 20 25 2e 31 66 0a 00 e: %.1f.. 000066f8 <_ZZ16process_commandsvE3__c__20_>: 66f8: 25 64 20 20 25 2e 32 66 00 %d %.2f. 00006701 <_ZZ16process_commandsvE3__c__19_>: 6701: 25 53 20 58 3a 20 25 2e 35 66 20 59 3a 20 25 2e %S X: %.5f Y: %. 6711: 35 66 20 5a 3a 20 25 2e 35 66 0a 00 5f Z: %.5f.. 0000671d <_ZZ16process_commandsvE3__c__18_>: 671d: 53 6c 65 65 70 2e 2e 2e 00 Sleep.... 00006726 : 6726: 45 30 3a 25 64 20 52 50 4d 0a 50 52 4e 30 3a 25 E0:%d RPM.PRN0:% 6736: 64 20 52 50 4d 0a 00 d RPM.. 0000673d : 673d: 47 39 30 00 G90. 00006741 : 6741: 4d 31 30 37 00 M107. 00006746 : 6746: 53 75 70 65 72 50 49 4e 44 41 00 SuperPINDA. 00006751 : 6751: 48 42 65 64 20 6f 6e 20 6c 6f 61 64 00 HBed on load. 0000675e : 675e: 46 6c 61 73 68 41 69 72 00 FlashAir. 00006767 : 6767: 45 72 72 3a 48 4f 54 45 4e 44 20 46 41 4e 20 45 Err:HOTEND FAN E 6777: 52 52 4f 52 00 RROR. 0000677c : 677c: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 64 //action:resumed ... 0000678d : 678d: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 00 //action:resume. 0000679d : 679d: 2f 2f 61 63 74 69 6f 6e 3a 72 65 61 64 79 00 //action:ready. 000067ac : 67ac: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 5f 72 65 61 //action:not_rea 67bc: 64 79 00 dy. 000067bf : 67bf: 2f 2f 61 63 74 69 6f 6e 3a 63 61 6e 63 65 6c 00 //action:cancel. 000067cf : 67cf: 4d 38 34 00 M84. 000067d3 : 67d3: 4f 4b 00 OK. 000067d6 : 67d6: 4c 43 44 20 73 74 61 74 75 73 20 63 68 61 6e 67 LCD status chang 67e6: 65 64 00 ed. 000067e9 <_ZZN10CardReader7releaseEvE3__c.lto_priv.499>: 67e9: 53 44 20 63 61 72 64 20 72 65 6c 65 61 73 65 64 SD card released ... 000067fa : 67fa: 2f 2f 61 63 74 69 6f 6e 3a 73 74 61 72 74 00 //action:start. 00006809 : 6809: 47 39 31 00 G91. 0000680d : 680d: 4d 37 30 32 00 M702. 00006812 : 6812: 47 32 38 20 57 00 G28 W. 00006818 : 6818: 4d 35 30 30 00 M500. 0000681d : 681d: 42 61 64 20 69 6e 74 65 72 72 75 70 74 00 Bad interrupt. 0000682b : 682b: 57 61 74 63 68 64 6f 67 20 74 69 6d 65 6f 75 74 Watchdog timeout ... 0000683c : 683c: 53 74 61 74 69 63 20 6d 65 6d 6f 72 79 20 68 61 Static memory ha 684c: 73 0a 62 65 65 6e 20 6f 76 65 72 77 72 69 74 74 s.been overwritt 685c: 65 6e 00 en. 0000685f : 685f: 46 49 52 4d 57 41 52 45 20 43 52 41 53 48 21 0a FIRMWARE CRASH!. 686f: 43 72 61 73 68 20 72 65 61 73 6f 6e 3a 0a 00 Crash reason:.. 0000687e : 687e: 20 20 50 6c 61 6e 6e 65 72 42 75 66 66 65 72 42 PlannerBufferB 688e: 79 74 65 73 3a 20 00 ytes: . 00006895 : 6895: 20 46 72 65 65 20 4d 65 6d 6f 72 79 3a 20 00 Free Memory: . 000068a4 : 68a4: 20 7c 20 41 75 74 68 6f 72 3a 20 00 | Author: . 000068b0 : 68b0: 20 4c 61 73 74 20 55 70 64 61 74 65 64 3a 20 00 Last Updated: . 000068c0 : 68c0: 20 53 6f 66 74 77 61 72 65 20 52 65 73 65 74 00 Software Reset. 000068d0 : 68d0: 20 57 61 74 63 68 64 6f 67 20 52 65 73 65 74 00 Watchdog Reset. 000068e0 : 68e0: 20 42 72 6f 77 6e 20 6f 75 74 20 52 65 73 65 74 Brown out Reset ... 000068f1 : 68f1: 20 45 78 74 65 72 6e 61 6c 20 52 65 73 65 74 00 External Reset. 00006901 : 6901: 50 6f 77 65 72 55 70 00 PowerUp. 00006909 : 6909: 65 72 72 6f 72 20 77 72 69 74 69 6e 67 20 74 6f error writing to 6919: 20 66 69 6c 65 00 file. 0000691f : 691f: 44 6f 6e 65 20 73 61 76 69 6e 67 20 66 69 6c 65 Done saving file 692f: 2e 00 .. 00006931 : 6931: 6f 6b 00 ok. 00006934 : 6934: 46 69 6c 61 6d 65 6e 74 00 Filament. 0000693d : 693d: 4d 65 61 73 75 72 65 64 20 73 6b 65 77 73 3a 20 Measured skews: 694d: 25 66 20 25 66 0a 00 %f %f.. 00006954 : 6954: 46 69 74 74 69 6e 67 20 66 61 69 6c 65 64 20 3d Fitting failed = 6964: 3e 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 > calibration fa 6974: 69 6c 65 64 2e 0a 00 iled... 0000697b : 697b: 43 61 6c 69 62 72 61 74 69 6f 6e 20 73 75 63 63 Calibration succ 698b: 65 73 73 2e 0a 00 ess... 00006991 : 6991: 41 6c 6c 20 34 20 63 61 6c 69 62 72 61 74 69 6f All 4 calibratio 69a1: 6e 20 70 6f 69 6e 74 73 20 66 6f 75 6e 64 2e 0a n points found.. ... 000069b2 : 69b2: 31 2f 34 00 1/4. 000069b6 : 69b6: 31 2f 34 00 1/4. 000069ba : 69ba: 31 2f 39 00 1/9. 000069be : 69be: 45 72 72 3a 50 52 49 4e 54 20 46 41 4e 20 45 52 Err:PRINT FAN ER 69ce: 52 4f 52 00 ROR. 000069d2 : 69d2: 25 63 25 33 64 2f 25 64 81 00 %c%3d/%d.. 000069dc : 69dc: 5a 25 36 2e 32 66 25 63 00 Z%6.2f%c. 000069e5 : 69e5: 5a 20 20 20 2d 2d 2d 20 00 Z --- . 000069ee : 69ee: 86 25 33 64 25 25 00 .%3d%%. 000069f5 : 69f5: 2d 2d 2d 25 25 00 ---%%. 000069fb : 69fb: 25 33 64 25 25 00 %3d%%. 00006a01 : 6a01: 20 53 44 00 SD. 00006a05 : 6a05: 20 20 20 00 . 00006a09 : 6a09: 20 48 4f 00 HO. 00006a0d : 6a0d: 20 46 52 4d 20 00 FRM . 00006a13 : 6a13: 87 2d 2d 3a 2d 2d 20 20 00 .--:-- . 00006a1c : 6a1c: 87 25 33 75 68 20 25 63 25 63 00 .%3uh %c%c. 00006a27 : 6a27: 87 25 30 32 75 3a 25 30 32 75 25 63 25 63 00 .%02u:%02u%c%c. 00006a36 : 6a36: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 64 00 //action:paused. 00006a46 : 6a46: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 00 //action:pause. 00006a55 <_ZZL16lcd_support_menuvE3__c__16_>: 6a55: 44 75 6d 70 20 74 6f 20 73 65 72 69 61 6c 00 Dump to serial. 00006a64 : 6a64: 68 65 6c 70 2e 70 72 75 73 61 33 64 2e 63 6f 6d help.prusa3d.com ... 00006a75 : 6a75: 66 6f 72 75 6d 2e 70 72 75 73 61 33 64 2e 63 6f forum.prusa3d.co 6a85: 6d 00 m. 00006a87 : 6a87: 70 72 75 73 61 33 64 2e 63 6f 6d 00 prusa3d.com. 00006a93 : 6a93: 4d 37 30 31 00 M701. 00006a98 : 6a98: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 6aa8: 0a 25 31 30 6c 64 64 20 25 30 32 64 68 20 25 30 .%10ldd %02dh %0 6ab8: 32 64 6d 00 2dm. 00006abc : 6abc: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 6acc: 0a 25 31 30 6c 64 68 20 25 30 32 64 6d 20 25 30 .%10ldh %02dm %0 6adc: 32 64 73 00 2ds. 00006ae0 : 6ae0: 25 36 2e 32 66 6d 6d 00 %6.2fmm. 00006ae8 : 6ae8: 25 53 0a 25 53 0a 25 53 3a 0a 25 53 3a 00 %S.%S.%S:.%S:. 00006af6 : 6af6: 25 33 2e 32 66 81 00 %3.2f.. 00006afd : 6afd: 25 2d 31 34 2e 31 34 53 3a 0a 25 53 0a 25 2d 31 %-14.14S:.%S.%-1 6b0d: 34 2e 31 34 53 3a 25 33 2e 32 66 81 0a 25 2d 31 4.14S:%3.2f..%-1 6b1d: 34 2e 31 34 53 3a 25 33 2e 32 66 81 00 4.14S:%3.2f.. 00006b2a : 6b2a: 20 20 30 00 0. 00006b2e : 6b2e: 20 20 31 00 1. 00006b32 : 6b32: 46 49 4e 44 41 00 FINDA. 00006b38 : 6b38: 50 49 4e 44 41 00 PINDA. 00006b3e : 6b3e: 57 69 7a 61 72 64 20 65 6e 64 20 73 74 61 74 65 Wizard end state 6b4e: 3a 20 25 64 0a 00 : %d.. 00006b54 : 6b54: 53 70 6f 6f 6c 4a 6f 69 6e 00 SpoolJoin. 00006b5e : 6b5e: 46 69 72 6d 77 61 72 65 00 Firmware. 00006b67 : 6b67: 50 72 75 73 61 20 69 33 20 4d 4b 32 2e 35 53 20 Prusa i3 MK2.5S 6b77: 4f 4b 2e 00 OK.. 00006b7b : 6b7b: 4d 36 30 30 00 M600. 00006b80 : 6b80: 53 44 20 63 61 72 64 20 6f 6b 00 SD card ok. 00006b8b : 6b8b: 6f 70 65 6e 52 6f 6f 74 20 66 61 69 6c 65 64 00 openRoot failed. 00006b9b : 6b9b: 76 6f 6c 75 6d 65 2e 69 6e 69 74 20 66 61 69 6c volume.init fail 6bab: 65 64 00 ed. 00006bae : 6bae: 53 44 20 69 6e 69 74 20 66 61 69 6c 00 SD init fail. 00006bbb : 6bbb: 6f 70 65 6e 20 66 61 69 6c 65 64 2c 20 46 69 6c open failed, Fil 6bcb: 65 3a 20 00 e: . 00006bcf : 6bcf: 43 61 6e 6e 6f 74 20 65 6e 74 65 72 20 73 75 62 Cannot enter sub 6bdf: 64 69 72 3a 20 00 dir: . 00006be5 : 6be5: 4d 32 34 00 M24. 00006be9 : 6be9: 4d 32 33 20 25 73 00 M23 %s. 00006bf0 : 6bf0: 50 72 69 6e 74 65 72 20 73 74 6f 70 70 65 64 20 Printer stopped 6c00: 64 75 65 20 74 6f 20 65 72 72 6f 72 73 2e 20 53 due to errors. S 6c10: 75 70 65 72 76 69 73 69 6f 6e 20 72 65 71 75 69 upervision requi 6c20: 72 65 64 2e 00 red.. 00006c25 : 6c25: 47 31 20 45 25 2d 2e 33 66 20 46 32 37 30 30 00 G1 E%-.3f F2700. 00006c35 : 6c35: 4d 38 33 00 M83. 00006c39 : 6c39: 31 2f 39 00 1/9. 00006c3d : 6c3d: 88 00 .. 00006c3f : 6c3f: 20 74 6f 6f 20 6c 6f 6e 67 20 65 78 74 72 75 73 too long extrus 6c4f: 69 6f 6e 20 70 72 65 76 65 6e 74 65 64 00 ion prevented. 00006c5d : 6c5d: 20 63 6f 6c 64 20 65 78 74 72 75 73 69 6f 6e 20 cold extrusion 6c6d: 70 72 65 76 65 6e 74 65 64 00 prevented. 00006c77 : 6c77: 4d 6f 76 65 20 61 62 6f 72 74 65 64 00 Move aborted. 00006c84 <__noloc_end>: 6c84: 08 4a sbci r16, 0xA8 ; 168 6c86: d7 3b cpi r29, 0xB7 ; 183 6c88: 3b ce rjmp .-906 ; 0x6900 6c8a: 01 6e ori r16, 0xE1 ; 225 6c8c: 84 bc out 0x24, r8 ; 36 6c8e: bf fd .word 0xfdbf ; ???? 6c90: c1 2f mov r28, r17 6c92: 3d 6c ori r19, 0xCD ; 205 6c94: 74 31 cpi r23, 0x14 ; 20 6c96: 9a bd out 0x2a, r25 ; 42 6c98: 56 83 std Z+6, r21 ; 0x06 6c9a: 3d da rcall .-2950 ; 0x6116 6c9c: 3d 00 .word 0x003d ; ???? 6c9e: c7 7f andi r28, 0xF7 ; 247 6ca0: 11 be out 0x31, r1 ; 49 6ca2: d9 e4 ldi r29, 0x49 ; 73 6ca4: bb 4c sbci r27, 0xCB ; 203 6ca6: 3e 91 ld r19, -X 6ca8: 6b aa std Y+51, r6 ; 0x33 6caa: aa be out 0x3a, r10 ; 58 6cac: 00 00 nop 6cae: 00 80 ld r0, Z 6cb0: 3f 05 cpc r19, r15 6cb2: a8 4c sbci r26, 0xC8 ; 200 6cb4: cd b2 in r12, 0x1d ; 29 6cb6: d4 4e sbci r29, 0xE4 ; 228 6cb8: b9 38 cpi r27, 0x89 ; 137 6cba: 36 a9 ldd r19, Z+54 ; 0x36 6cbc: 02 0c add r0, r2 6cbe: 50 b9 out 0x00, r21 ; 0 6cc0: 91 86 std Z+9, r9 ; 0x09 6cc2: 88 08 sbc r8, r8 6cc4: 3c a6 std Y+44, r3 ; 0x2c 6cc6: aa aa std Y+50, r10 ; 0x32 6cc8: 2a be out 0x3a, r2 ; 58 6cca: 00 00 nop 6ccc: 00 80 ld r0, Z 6cce: 3f 07 cpc r19, r31 6cd0: 63 42 sbci r22, 0x23 ; 35 6cd2: 36 b7 in r19, 0x36 ; 54 6cd4: 9b d8 rcall .-3786 ; 0x5e0c 6cd6: a7 1a sub r10, r23 6cd8: 39 68 ori r19, 0x89 ; 137 6cda: 56 18 sub r5, r6 6cdc: ae ba out 0x1e, r10 ; 30 6cde: ab 55 subi r26, 0x5B ; 91 6ce0: 8c 1d adc r24, r12 6ce2: 3c b7 in r19, 0x3c ; 60 6ce4: cc 57 subi r28, 0x7C ; 124 6ce6: 63 bd out 0x23, r22 ; 35 6ce8: 6d ed ldi r22, 0xDD ; 221 6cea: fd 75 andi r31, 0x5D ; 93 6cec: 3e f6 brtc .-114 ; 0x6c7c 6cee: 17 72 andi r17, 0x27 ; 39 6cf0: 31 bf out 0x31, r19 ; 49 6cf2: 00 00 nop 6cf4: 00 80 ld r0, Z 6cf6: 3f 08 sbc r3, r15 6cf8: 00 00 nop 6cfa: 00 be out 0x30, r0 ; 48 6cfc: 92 24 eor r9, r2 6cfe: 49 12 cpse r4, r25 6d00: 3e ab std Y+54, r19 ; 0x36 6d02: aa aa std Y+50, r10 ; 0x32 6d04: 2a be out 0x3a, r2 ; 58 6d06: cd cc rjmp .-1638 ; 0x66a2 <_ZZ16process_commandsvE3__c__25_+0xc> 6d08: cc 4c sbci r28, 0xCC ; 204 6d0a: 3e 00 .word 0x003e ; ???? 6d0c: 00 00 nop 6d0e: 80 be out 0x30, r8 ; 48 6d10: ab aa std Y+51, r10 ; 0x33 6d12: aa aa std Y+50, r10 ; 0x32 6d14: 3e 00 .word 0x003e ; ???? 6d16: 00 00 nop 6d18: 00 bf out 0x30, r16 ; 48 6d1a: 00 00 nop 6d1c: 00 80 ld r0, Z 6d1e: 3f 00 .word 0x003f ; ???? 6d20: 00 00 nop 6d22: 00 00 nop 6d24: 08 41 sbci r16, 0x18 ; 24 6d26: 78 d3 rcall .+1776 ; 0x7418 6d28: bb 43 sbci r27, 0x3B ; 59 6d2a: 87 d1 rcall .+782 ; 0x703a <__trampolines_start+0x2e8> 6d2c: 13 3d cpi r17, 0xD3 ; 211 6d2e: 19 0e add r1, r25 6d30: 3c c3 rjmp .+1656 ; 0x73aa 6d32: bd 42 sbci r27, 0x2D ; 45 6d34: 82 ad ldd r24, Z+58 ; 0x3a 6d36: 2b 3e cpi r18, 0xEB ; 235 6d38: 68 ec ldi r22, 0xC8 ; 200 6d3a: 82 76 andi r24, 0x62 ; 98 6d3c: be d9 rcall .-3204 ; 0x60ba 6d3e: 8f e1 ldi r24, 0x1F ; 31 6d40: a9 3e cpi r26, 0xE9 ; 233 6d42: 4c 80 ldd r4, Y+4 ; 0x04 6d44: ef ff .word 0xffef ; ???? 6d46: be 01 movw r22, r28 6d48: c4 ff sbrs r28, 4 6d4a: 7f 3f cpi r23, 0xFF ; 255 6d4c: 00 00 nop 6d4e: 00 00 nop ... 00006d52 <__trampolines_start>: 6d52: 0c 94 08 ea jmp 0x1d410 ; 0x1d410 6d56: 0c 94 c8 b0 jmp 0x16190 ; 0x16190 6d5a: 0d 94 91 30 jmp 0x26122 ; 0x26122 6d5e: 0d 94 40 64 jmp 0x2c880 ; 0x2c880 6d62: 0c 94 02 c1 jmp 0x18204 ; 0x18204 6d66: 0d 94 e7 02 jmp 0x205ce ; 0x205ce 6d6a: 0c 94 56 b5 jmp 0x16aac ; 0x16aac 6d6e: 0c 94 46 b3 jmp 0x1668c ; 0x1668c 6d72: 0c 94 43 c1 jmp 0x18286 ; 0x18286 6d76: 0d 94 d4 01 jmp 0x203a8 ; 0x203a8 6d7a: 0c 94 ab 6d jmp 0xdb56 ; 0xdb56 <__vector_23+0xd0> 6d7e: 0c 94 b4 e2 jmp 0x1c568 ; 0x1c568 6d82: 0c 94 2c ec jmp 0x1d858 ; 0x1d858 6d86: 0c 94 96 bc jmp 0x1792c ; 0x1792c 6d8a: 0d 94 17 40 jmp 0x2802e ; 0x2802e 6d8e: 0d 94 9f 06 jmp 0x20d3e ; 0x20d3e 6d92: 0c 94 8e 6b jmp 0xd71c ; 0xd71c 6d96: 0d 94 f5 10 jmp 0x221ea ; 0x221ea 6d9a: 0d 94 28 02 jmp 0x20450 ; 0x20450 6d9e: 0c 94 d3 bb jmp 0x177a6 ; 0x177a6 6da2: 0d 94 b8 04 jmp 0x20970 ; 0x20970 6da6: 0c 94 1e b5 jmp 0x16a3c ; 0x16a3c ()> 6daa: 0c 94 e8 b5 jmp 0x16bd0 ; 0x16bd0 6dae: 0c 94 c6 e7 jmp 0x1cf8c ; 0x1cf8c 6db2: 0c 94 ad fd jmp 0x1fb5a ; 0x1fb5a 6db6: 0d 94 a8 06 jmp 0x20d50 ; 0x20d50 6dba: 0c 94 cc e2 jmp 0x1c598 ; 0x1c598 6dbe: 0d 94 75 31 jmp 0x262ea ; 0x262ea 6dc2: 0c 94 ca fc jmp 0x1f994 ; 0x1f994 6dc6: 0d 94 ae 0d jmp 0x21b5c ; 0x21b5c 6dca: 0d 94 a5 31 jmp 0x2634a ; 0x2634a 6dce: 0c 94 9f fc jmp 0x1f93e ; 0x1f93e 6dd2: 0c 94 fc e2 jmp 0x1c5f8 ; 0x1c5f8 6dd6: 0c 94 ed e2 jmp 0x1c5da ; 0x1c5da 6dda: 0c 94 05 b5 jmp 0x16a0a ; 0x16a0a ()> 6dde: 0c 94 77 e9 jmp 0x1d2ee ; 0x1d2ee 6de2: 0c 94 25 c1 jmp 0x1824a ; 0x1824a 6de6: 0c 94 d7 ba jmp 0x175ae ; 0x175ae 6dea: 0d 94 66 2f jmp 0x25ecc ; 0x25ecc 6dee: 0c 94 f9 e2 jmp 0x1c5f2 ; 0x1c5f2 6df2: 0c 94 c0 c0 jmp 0x18180 ; 0x18180 6df6: 0d 94 c0 30 jmp 0x26180 ; 0x26180 6dfa: 0c 94 2f c1 jmp 0x1825e ; 0x1825e 6dfe: 0d 94 d3 39 jmp 0x273a6 ; 0x273a6 6e02: 0c 94 c5 fd jmp 0x1fb8a ; 0x1fb8a 6e06: 0c 94 d0 fd jmp 0x1fba0 ; 0x1fba0 6e0a: 0d 94 e2 10 jmp 0x221c4 ; 0x221c4 6e0e: 0c 94 3b b3 jmp 0x16676 ; 0x16676 6e12: 0d 94 49 2f jmp 0x25e92 ; 0x25e92 6e16: 0c 94 cd bb jmp 0x1779a ; 0x1779a 6e1a: 0c 94 0a b5 jmp 0x16a14 ; 0x16a14 ()> 6e1e: 0c 94 ac fe jmp 0x1fd58 ; 0x1fd58 6e22: 0d 94 5f 31 jmp 0x262be ; 0x262be 6e26: 0c 94 52 ef jmp 0x1dea4 ; 0x1dea4 6e2a: 0d 94 65 31 jmp 0x262ca ; 0x262ca 6e2e: 0c 94 a9 fc jmp 0x1f952 ; 0x1f952 6e32: 0c 94 e2 fe jmp 0x1fdc4 ; 0x1fdc4 6e36: 0d 94 ac 95 jmp 0x32b58 ; 0x32b58 6e3a: 0d 94 3f 6a jmp 0x2d47e ; 0x2d47e 6e3e: 0c 94 28 fe jmp 0x1fc50 ; 0x1fc50 6e42: 0c 94 70 bc jmp 0x178e0 ; 0x178e0 6e46: 0d 94 29 04 jmp 0x20852 ; 0x20852 6e4a: 0c 94 e9 6d jmp 0xdbd2 ; 0xdbd2 <__vector_23+0x14c> 6e4e: 0c 94 7c 6d jmp 0xdaf8 ; 0xdaf8 <__vector_23+0x72> 6e52: 0c 94 f6 b0 jmp 0x161ec ; 0x161ec 6e56: 0c 94 23 b5 jmp 0x16a46 ; 0x16a46 ()> 6e5a: 0c 94 94 b1 jmp 0x16328 ; 0x16328 6e5e: 0c 94 e3 b0 jmp 0x161c6 ; 0x161c6 6e62: 0d 94 37 2f jmp 0x25e6e ; 0x25e6e 6e66: 0d 94 20 2f jmp 0x25e40 ; 0x25e40 6e6a: 0d 94 c3 30 jmp 0x26186 ; 0x26186 6e6e: 0c 94 d9 bb jmp 0x177b2 ; 0x177b2 6e72: 0c 94 cc f6 jmp 0x1ed98 ; 0x1ed98 6e76: 0c 94 cc e7 jmp 0x1cf98 ; 0x1cf98 6e7a: 0d 94 c5 63 jmp 0x2c78a ; 0x2c78a 6e7e: 0d 94 2e 3a jmp 0x2745c ; 0x2745c 6e82: 0c 94 1d c6 jmp 0x18c3a ; 0x18c3a 6e86: 0d 94 82 11 jmp 0x22304 ; 0x22304 6e8a: 0c 94 d7 6d jmp 0xdbae ; 0xdbae <__vector_23+0x128> 6e8e: 0d 94 3e 11 jmp 0x2227c ; 0x2227c 6e92: 0c 94 9a b1 jmp 0x16334 ; 0x16334 6e96: 0c 94 f2 fd jmp 0x1fbe4 ; 0x1fbe4 6e9a: 0c 94 c0 b0 jmp 0x16180 ; 0x16180 6e9e: 0d 94 96 2e jmp 0x25d2c ; 0x25d2c 6ea2: 0d 94 69 07 jmp 0x20ed2 ; 0x20ed2 6ea6: 0d 94 0a 22 jmp 0x24414 ; 0x24414 6eaa: 0d 94 6d 31 jmp 0x262da ; 0x262da 6eae: 0c 94 b3 fc jmp 0x1f966 ; 0x1f966 6eb2: 0c 94 f8 c0 jmp 0x181f0 ; 0x181f0 6eb6: 0c 94 6c b5 jmp 0x16ad8 ; 0x16ad8 6eba: 0d 94 c5 04 jmp 0x2098a ; 0x2098a 6ebe: 0c 94 02 bb jmp 0x17604 ; 0x17604 6ec2: 0d 94 b5 31 jmp 0x2636a ; 0x2636a 6ec6: 0d 94 46 6a jmp 0x2d48c ; 0x2d48c 6eca: 0c 94 d1 f7 jmp 0x1efa2 ; 0x1efa2 6ece: 0c 94 e9 f7 jmp 0x1efd2 ; 0x1efd2 6ed2: 0c 94 15 fe jmp 0x1fc2a ; 0x1fc2a 6ed6: 0d 94 94 01 jmp 0x20328 ; 0x20328 6eda: 0c 94 11 c1 jmp 0x18222 ; 0x18222 6ede: 0c 94 3e ef jmp 0x1de7c ; 0x1de7c 6ee2: 0c 94 cf b5 jmp 0x16b9e ; 0x16b9e 6ee6: 0d 94 52 2f jmp 0x25ea4 ; 0x25ea4 6eea: 0c 94 52 fe jmp 0x1fca4 ; 0x1fca4 6eee: 0c 94 87 bc jmp 0x1790e ; 0x1790e 6ef2: 0d 94 b6 30 jmp 0x2616c ; 0x2616c 6ef6: 0c 94 95 6d jmp 0xdb2a ; 0xdb2a <__vector_23+0xa4> 6efa: 0c 94 06 e9 jmp 0x1d20c ; 0x1d20c 6efe: 0c 94 9b bc jmp 0x17936 ; 0x17936 6f02: 0c 94 2b eb jmp 0x1d656 ; 0x1d656 6f06: 0c 94 b4 6d jmp 0xdb68 ; 0xdb68 <__vector_23+0xe2> 6f0a: 0c 94 d4 c0 jmp 0x181a8 ; 0x181a8 6f0e: 0d 94 dd 69 jmp 0x2d3ba ; 0x2d3ba 6f12: 0c 94 67 fe jmp 0x1fcce ; 0x1fcce 6f16: 0c 94 cd ea jmp 0x1d59a ; 0x1d59a 6f1a: 0d 94 9e 11 jmp 0x2233c ; 0x2233c 6f1e: 0d 94 8d 31 jmp 0x2631a ; 0x2631a 6f22: 0c 94 62 b0 jmp 0x160c4 ; 0x160c4 6f26: 0d 94 62 31 jmp 0x262c4 ; 0x262c4 6f2a: 0c 94 a8 e2 jmp 0x1c550 ; 0x1c550 6f2e: 0c 94 60 bc jmp 0x178c0 ; 0x178c0 6f32: 0c 94 d1 b0 jmp 0x161a2 ; 0x161a2 6f36: 0d 94 a5 93 jmp 0x3274a ; 0x3274a <_menu_edit_P()> 6f3a: 0d 94 ad 31 jmp 0x2635a ; 0x2635a 6f3e: 0c 94 cd ba jmp 0x1759a ; 0x1759a 6f42: 0d 94 87 2f jmp 0x25f0e ; 0x25f0e 6f46: 0d 94 fc 30 jmp 0x261f8 ; 0x261f8 6f4a: 0d 94 2b 31 jmp 0x26256 ; 0x26256 6f4e: 0c 94 1d fc jmp 0x1f83a ; 0x1f83a 6f52: 0c 94 b6 c0 jmp 0x1816c ; 0x1816c 6f56: 0c 94 6b fc jmp 0x1f8d6 ; 0x1f8d6 6f5a: 0d 94 0a 05 jmp 0x20a14 ; 0x20a14 6f5e: 0c 94 02 e3 jmp 0x1c604 ; 0x1c604 6f62: 0d 94 78 1d jmp 0x23af0 ; 0x23af0 6f66: 0c 94 b1 c0 jmp 0x18162 ; 0x18162 6f6a: 0c 94 cb b0 jmp 0x16196 ; 0x16196 6f6e: 0d 94 de 63 jmp 0x2c7bc ; 0x2c7bc 6f72: 0c 94 39 c1 jmp 0x18272 ; 0x18272 6f76: 0c 94 6b f7 jmp 0x1eed6 ; 0x1eed6 6f7a: 0c 94 a9 c0 jmp 0x18152 ; 0x18152 6f7e: 0c 94 02 c4 jmp 0x18804 ; 0x18804 6f82: 0d 94 b9 30 jmp 0x26172 ; 0x26172 6f86: 0c 94 17 fe jmp 0x1fc2e ; 0x1fc2e 6f8a: 0c 94 9b ff jmp 0x1ff36 ; 0x1ff36 6f8e: 0c 94 7c bc jmp 0x178f8 ; 0x178f8 6f92: 0c 94 62 6d jmp 0xdac4 ; 0xdac4 <__vector_23+0x3e> 6f96: 0d 94 31 2f jmp 0x25e62 ; 0x25e62 6f9a: 0d 94 8f 02 jmp 0x2051e ; 0x2051e 6f9e: 0c 94 d5 b0 jmp 0x161aa ; 0x161aa 6fa2: 0d 94 4e 01 jmp 0x2029c ; 0x2029c 6fa6: 0d 94 bd 31 jmp 0x2637a ; 0x2637a 6faa: 0c 94 93 bb jmp 0x17726 ; 0x17726 6fae: 0c 94 03 b1 jmp 0x16206 ; 0x16206 6fb2: 0c 94 59 fe jmp 0x1fcb2 ; 0x1fcb2 6fb6: 0c 94 57 5e jmp 0xbcae ; 0xbcae <_GLOBAL__sub_D_card> 6fba: 0d 94 1d 09 jmp 0x2123a ; 0x2123a 6fbe: 0d 94 85 31 jmp 0x2630a ; 0x2630a 6fc2: 0c 94 b9 fd jmp 0x1fb72 ; 0x1fb72 6fc6: 0d 94 20 64 jmp 0x2c840 ; 0x2c840 6fca: 0c 94 db ef jmp 0x1dfb6 ; 0x1dfb6 6fce: 0d 94 27 00 jmp 0x2004e ; 0x2004e 6fd2: 0d 94 b6 2e jmp 0x25d6c ; 0x25d6c 6fd6: 0d 94 7d 31 jmp 0x262fa ; 0x262fa 6fda: 0c 94 db fc jmp 0x1f9b6 ; 0x1f9b6 6fde: 0d 94 3b 2f jmp 0x25e76 ; 0x25e76 6fe2: 0c 94 20 b3 jmp 0x16640 ; 0x16640 6fe6: 0c 94 3f c6 jmp 0x18c7e ; 0x18c7e 6fea: 0c 94 61 b4 jmp 0x168c2 ; 0x168c2 6fee: 0d 94 df 0e jmp 0x21dbe ; 0x21dbe 6ff2: 0c 94 e2 bb jmp 0x177c4 ; 0x177c4 6ff6: 0c 94 97 b6 jmp 0x16d2e ; 0x16d2e 6ffa: 0c 94 58 bc jmp 0x178b0 ; 0x178b0 6ffe: 0c 94 55 b7 jmp 0x16eaa ; 0x16eaa 7002: 0c 94 87 6d jmp 0xdb0e ; 0xdb0e <__vector_23+0x88> 7006: 0d 94 5c 31 jmp 0x262b8 ; 0x262b8 700a: 0c 94 bc b0 jmp 0x16178 ; 0x16178 700e: 0c 94 ca f6 jmp 0x1ed94 ; 0x1ed94 7012: 0c 94 ff b0 jmp 0x161fe ; 0x161fe 7016: 0c 94 ed b0 jmp 0x161da ; 0x161da 701a: 0c 94 95 fc jmp 0x1f92a ; 0x1f92a 701e: 0c 94 e1 f6 jmp 0x1edc2 ; 0x1edc2 7022: 0d 94 16 07 jmp 0x20e2c ; 0x20e2c 7026: 0c 94 28 b5 jmp 0x16a50 ; 0x16a50 ()> 702a: 0d 94 32 0c jmp 0x21864 ; 0x21864 702e: 0c 94 75 fc jmp 0x1f8ea ; 0x1f8ea 7032: 0c 94 c4 b0 jmp 0x16188 ; 0x16188 7036: 0d 94 b1 06 jmp 0x20d62 ; 0x20d62 703a: 0d 94 e4 00 jmp 0x201c8 ; 0x201c8 703e: 0d 94 28 31 jmp 0x26250 ; 0x26250 7042: 0c 94 dc c0 jmp 0x181b8 ; 0x181b8 7046: 0c 94 1b c1 jmp 0x18236 ; 0x18236 704a: 0d 94 74 12 jmp 0x224e8 ; 0x224e8 704e: 0c 94 60 fe jmp 0x1fcc0 ; 0x1fcc0 7052: 0c 94 c9 ea jmp 0x1d592 ; 0x1d592 7056: 0c 94 fb b0 jmp 0x161f6 ; 0x161f6 705a: 0c 94 68 bc jmp 0x178d0 ; 0x178d0 705e: 0d 94 4f 6a jmp 0x2d49e ; 0x2d49e 7062: 0c 94 db b0 jmp 0x161b6 ; 0x161b6 7066: 0d 94 95 31 jmp 0x2632a ; 0x2632a 706a: 0d 94 c0 04 jmp 0x20980 ; 0x20980 706e: 0d 94 3d 64 jmp 0x2c87a ; 0x2c87a 7072: 0c 94 e4 c0 jmp 0x181c8 ; 0x181c8 7076: 0d 94 44 64 jmp 0x2c888 ; 0x2c888 707a: 0d 94 6c 07 jmp 0x20ed8 ; 0x20ed8 707e: 0c 94 98 bc jmp 0x17930 ; 0x17930 7082: 0c 94 61 fc jmp 0x1f8c2 ; 0x1f8c2 7086: 0c 94 09 fd jmp 0x1fa12 ; 0x1fa12 708a: 0d 94 80 0f jmp 0x21f00 ; 0x21f00 708e: 0d 94 23 6a jmp 0x2d446 ; 0x2d446 7092: 0c 94 55 70 jmp 0xe0aa ; 0xe0aa 7096: 0c 94 ee c0 jmp 0x181dc ; 0x181dc 709a: 0c 94 b5 b3 jmp 0x1676a ; 0x1676a 709e: 0d 94 06 2f jmp 0x25e0c ; 0x25e0c 70a2: 0c 94 ca bb jmp 0x17794 ; 0x17794 70a6: 0c 94 f1 b0 jmp 0x161e2 ; 0x161e2 70aa: 0d 94 54 6a jmp 0x2d4a8 ; 0x2d4a8 70ae: 0c 94 ff e2 jmp 0x1c5fe ; 0x1c5fe 70b2: 0c 94 0e e3 jmp 0x1c61c ; 0x1c61c 70b6: 0d 94 71 11 jmp 0x222e2 ; 0x222e2 70ba: 0c 94 73 e9 jmp 0x1d2e6 ; 0x1d2e6 70be: 0c 94 14 b3 jmp 0x16628 ; 0x16628 70c2: 0c 94 d6 bb jmp 0x177ac ; 0x177ac 70c6: 0c 94 47 ba jmp 0x1748e ; 0x1748e 70ca: 0c 94 b1 b8 jmp 0x17162 ; 0x17162 70ce: 0d 94 cc 2e jmp 0x25d98 ; 0x25d98 70d2: 0c 94 5c e6 jmp 0x1ccb8 ; 0x1ccb8 70d6: 0c 94 5f ea jmp 0x1d4be ; 0x1d4be 70da: 0c 94 14 b5 jmp 0x16a28 ; 0x16a28 ()> 70de: 0c 94 77 b6 jmp 0x16cee ; 0x16cee 70e2: 0c 94 7f fc jmp 0x1f8fe ; 0x1f8fe 70e6: 0d 94 ef 0c jmp 0x219de ; 0x219de 70ea: 0d 94 6b 0a jmp 0x214d6 ; 0x214d6 70ee: 0d 94 79 30 jmp 0x260f2 ; 0x260f2 70f2: 0d 94 9d 31 jmp 0x2633a ; 0x2633a 70f6: 0c 94 f7 b0 jmp 0x161ee ; 0x161ee 70fa: 0c 94 b6 b0 jmp 0x1616c ; 0x1616c 70fe: 0c 94 89 fc jmp 0x1f912 ; 0x1f912 7102: 0c 94 df b0 jmp 0x161be ; 0x161be 7106: 0d 94 42 6a jmp 0x2d484 ; 0x2d484 710a: 0c 94 ca c0 jmp 0x18194 ; 0x18194 710e: 0d 94 98 1c jmp 0x23930 ; 0x23930 7112: 0c 94 7f b4 jmp 0x168fe ; 0x168fe 7116: 0c 94 e9 b0 jmp 0x161d2 ; 0x161d2 711a: 0c 94 6e fe jmp 0x1fcdc ; 0x1fcdc 711e: 0c 94 3a 6f jmp 0xde74 ; 0xde74 7122: 0c 94 19 b5 jmp 0x16a32 ; 0x16a32 ()> 7126: 0d 94 2e 31 jmp 0x2625c ; 0x2625c 712a: 0d 94 c2 2e jmp 0x25d84 ; 0x25d84 712e: 0c 94 0f b5 jmp 0x16a1e ; 0x16a1e ()> 7132: 0c 94 2f b3 jmp 0x1665e ; 0x1665e 7136: 0c 94 0e fe jmp 0x1fc1c ; 0x1fc1c 713a: 0c 94 d0 bb jmp 0x177a0 ; 0x177a0 0000713e <__trampolines_end>: 713e: 6e 61 ori r22, 0x1E ; 30 7140: 6e 00 .word 0x006e ; ???? 00007142 <__c.2228>: 7142: 69 6e 66 00 00 40 7a 10 f3 5a 00 a0 72 4e 18 09 inf..@z..Z..rN.. 7152: 00 10 a5 d4 e8 00 00 e8 76 48 17 00 00 e4 0b 54 ........vH.....T 7162: 02 00 00 ca 9a 3b 00 00 00 e1 f5 05 00 00 80 96 .....;.......... 7172: 98 00 00 00 40 42 0f 00 00 00 a0 86 01 00 00 00 ....@B.......... 7182: 10 27 00 00 00 00 e8 03 00 00 00 00 64 00 00 00 .'..........d... 7192: 00 00 0a 00 00 00 00 00 01 00 00 00 00 00 2c 76 ..............,v 71a2: d8 88 dc 67 4f 08 23 df c1 df ae 59 e1 b1 b7 96 ...gO.#....Y.... 71b2: e5 e3 e4 53 c6 3a e6 51 99 76 96 e8 e6 c2 84 26 ...S.:.Q.v.....& 71c2: eb 89 8c 9b 62 ed 40 7c 6f fc ef bc 9c 9f 40 f2 ....b.@|o.....@. 71d2: ba a5 6f a5 f4 90 05 5a 2a f7 5c 93 6b 6c f9 67 ..o....Z*.\.kl.g 71e2: 6d c1 1b fc e0 e4 0d 47 fe f5 20 e6 b5 00 d0 ed m......G.. ..... 71f2: 90 2e 03 00 94 35 77 05 00 80 84 1e 08 00 00 20 .....5w........ 7202: 4e 0a 00 00 00 c8 0c 33 33 33 33 0f 98 6e 12 83 N......3333..n.. 7212: 11 41 ef 8d 21 14 89 3b e6 55 16 cf fe e6 db 18 .A..!..;.U...... 7222: d1 84 4b 38 1b f7 7c 1d 90 1d a4 bb e4 24 20 32 ..K8..|......$ 2 7232: 84 72 5e 22 81 00 c9 f1 24 ec a1 e5 3d 27 .r^"....$...=' 00007240 : 7240: 22 00 ". 00007242 : ... 00007243 : 7243: 20 45 53 50 00 ESP. 00007248 : 7248: 20 4e 53 50 00 NSP. 0000724d : 724d: 20 4f 46 46 00 OFF. 00007252 : 7252: 20 4f 4e 00 ON. 00007256 : 7256: 50 56 30 31 00 PV01. 0000725b : 725b: 20 5b 4d 50 5d 20 00 [MP] . 00007262 : 7262: 25 69 20 68 6f 75 72 73 20 25 69 20 6d 69 6e 75 %i hours %i minu 7272: 74 65 73 00 tes. 00007276 : 7276: 52 58 20 74 69 6d 65 6f 75 74 00 RX timeout. 00007281 : 7281: 4d 33 31 30 00 M310. 00007286 : 7286: 4d 31 31 32 00 M112. 0000728b : 728b: 4d 31 31 30 00 M110. 00007290 : 7290: 46 75 6c 6c 20 52 58 20 42 75 66 66 65 72 00 Full RX Buffer. 0000729f : 729f: 53 65 74 74 69 6e 67 73 20 53 74 6f 72 65 64 00 Settings Stored. 000072af : 72af: 53 74 6f 72 65 64 20 73 65 74 74 69 6e 67 73 20 Stored settings 72bf: 72 65 74 72 69 65 76 65 64 00 retrieved. 000072c9 : 72c9: 48 61 72 64 63 6f 64 65 64 20 44 65 66 61 75 6c Hardcoded Defaul 72d9: 74 20 53 65 74 74 69 6e 67 73 20 4c 6f 61 64 65 t Settings Loade 72e9: 64 00 d. 000072eb : 72eb: 56 32 00 00 00 00 c8 42 00 00 c8 42 00 00 c8 43 V2.....B...B...C 72fb: 00 00 05 43 00 00 48 43 00 00 48 43 00 00 40 41 ...C..HC..HC..@A 730b: 00 00 f0 42 e8 03 00 00 e8 03 00 00 c8 00 00 00 ...B............ 731b: 88 13 00 00 00 40 9c 44 00 40 9c 44 00 00 00 00 .....@.D.@.D.... 732b: 00 00 00 00 20 4e 00 00 00 00 20 41 00 00 20 41 .... N.... A.. A 733b: cd cc cc 3e 00 00 90 40 00 00 00 00 00 00 00 00 ...>...@........ 734b: 00 00 00 00 cd cc cc 3e 3d 0a 81 41 ff 08 43 3e .......>=..A..C> 735b: b0 99 ab 43 8f 42 fc 42 e6 5a 34 3f 4c 62 b0 45 ...C.B.B.Z4?Lb.E 736b: 00 00 00 00 00 40 40 00 00 34 42 00 00 00 00 00 .....@@..4B..... 737b: 00 00 00 00 00 00 41 00 00 00 e0 3f 00 00 2c 43 ......A....?..,C 738b: 00 00 2c 43 00 00 40 41 00 00 f0 42 c0 03 00 00 ..,C..@A...B.... 739b: c0 03 00 00 c8 00 00 00 88 13 00 00 10 10 10 10 ................ 73ab: 00 40 9c 44 00 00 80 3f 00 00 00 3f 19 14 00 00 .@.D...?...?.... ... 000073bc : 73bc: 20 30 78 00 0x. 000073c0 : 73c0: 20 30 78 00 0x. 000073c4 : 73c4: 65 72 72 6f 72 3a 20 00 error: . 000073cc : 73cc: 44 32 33 20 2d 20 65 6d 65 72 67 65 6e 63 79 20 D23 - emergency 73dc: 73 65 72 69 61 6c 20 64 75 6d 70 00 serial dump. 000073e8 : 73e8: 43 75 73 74 6f 6d 00 Custom. 000073ef : 73ef: 4e 79 6c 6f 6e 50 41 00 NylonPA. 000073f7 : 73f7: 53 61 74 69 6e 20 20 00 Satin . 000073ff : 73ff: 54 65 78 74 75 72 00 Textur. 00007406 : 7406: 53 6d 6f 6f 74 68 00 Smooth. 0000740d : 740d: 31 2e 30 00 1.0. 00007411 : 7411: 31 2e 35 00 1.5. 00007415 : 7415: 55 4e 4b 4e 4f 57 4e 00 UNKNOWN. 0000741d : 741d: 4c 41 31 30 43 3a 20 4c 69 6e 65 61 72 20 41 64 LA10C: Linear Ad 742d: 76 61 6e 63 65 20 6d 6f 64 65 3a 20 00 vance mode: . 0000743a : 743a: 4c 41 31 30 43 3a 20 41 64 6a 75 73 74 65 64 20 LA10C: Adjusted 744a: 45 2d 4a 65 72 6b 3a 20 00 E-Jerk: . 00007453 <_PRI_LANG_SIGNATURE>: 7453: ff ff ff ff .... 00007457 : 7457: 3e 0f a8 af 00 48 00 69 96 00 00 df 60 25 55 58 >....H.i....`%UX 7467: 87 68 04 27 f2 e0 00 5e 34 03 cc 19 60 f3 3c 0e .h.'...^4...`.<. 7477: f8 8f 00 db 08 02 94 92 00 3e 1c 07 9a 87 00 e5 .........>...... 7487: 24 00 85 28 52 7e 06 00 1b e4 00 7e 78 12 70 78 $..(R~.....~x.px 7497: 70 61 f8 12 78 8f 88 41 78 42 70 78 70 61 78 25 pa..x..AxBpxpax% 74a7: 70 78 70 61 f8 50 78 8f 88 d1 f0 25 27 07 87 61 pxpa.Px....%'..a 74b7: f0 25 27 8f 88 41 2c 0d 27 aa 50 d1 bc 07 07 87 .%'..A,.'.P..... 74c7: 11 61 be 78 8f 88 11 41 78 52 70 78 70 61 f8 52 .a.x...AxRpxpa.R 74d7: 78 8f 88 41 20 12 78 88 70 63 20 52 78 88 70 63 x..A .x.pc Rx.pc 74e7: 48 52 78 88 87 43 03 11 17 99 70 64 18 12 78 f8 HRx..C....pd..x. 74f7: 70 65 44 12 f8 f8 f0 45 18 42 78 f8 70 65 18 25 peD....E.Bx.pe.% 7507: 78 f8 70 65 18 52 78 f8 70 65 18 50 78 f8 70 65 x.pe.Rx.pe.Px.pe 7517: 0c 07 8f 87 23 65 a2 0f 8f 8f 11 45 00 12 06 22 ....#e.....E..." 7527: 70 69 00 12 07 22 27 49 00 25 06 22 70 69 00 25 pi..."'I.%."pi.% 7537: 07 22 27 49 00 12 06 22 27 6c 02 62 36 a2 70 6c ."'I..."'l.b6.pl 7547: 40 45 6c 44 70 4c 03 62 22 22 70 6c 43 88 88 88 @ElDpL.b""plC... 7557: f0 4c 78 12 bc 88 80 6e 78 52 bc 88 80 6e 38 12 .Lx....nxR...n8. 7567: 78 88 70 6f 78 12 78 88 87 4f 38 42 78 88 70 6f x.pox.x..O8Bx.po 7577: 38 25 78 88 70 6f 3a 00 79 ac 78 6f 3d 07 9a ac 8%x.po:.y.xo=... 7587: 78 6f 78 50 78 88 87 ef 39 49 78 88 70 6f 08 52 xoxPx...9Ix.po.R 7597: bc 88 80 72 98 52 f8 8f 98 52 20 12 78 70 f0 73 ...r.R...R .xp.s 75a7: 48 12 78 63 87 53 20 52 78 70 f0 73 48 52 78 63 H.xc.S Rxp.sHRxc 75b7: 87 53 10 07 87 0f 24 73 12 78 63 87 24 53 60 69 .S....$s.xc.$S`i 75c7: 9a 98 8b e2 23 04 e4 44 30 74 10 4e 44 43 24 74 ....#..D0t.NDC$t 75d7: 7c 12 88 89 60 75 3c 50 88 88 70 55 78 25 28 89 |...`u: 7613: 00 40 14 54 .@.T 00007617 : 7617: cd cc cc 3d 0a d7 23 3c 17 b7 d1 38 77 cc 2b 32 ...=..#<...8w.+2 7627: 95 95 e6 24 1f b1 4f 0a ...$..O. 0000762f : 762f: 00 00 20 41 00 00 c8 42 00 40 1c 46 20 bc be 4c .. A...B.@.F ..L 763f: ca 1b 0e 5a ae c5 9d 74 ...Z...t 00007647 : 7647: 4e 41 4e NAN 0000764a : 764a: 49 4e 46 INF 0000764d : 764d: 00 00 7a 43 00 00 52 43 00 00 52 43 ..zC..RC..RC 00007659 : 7659: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 00007665 : 7665: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 00007671 : 7671: 20 50 3a 00 P:. 00007675 : 7675: 20 42 40 3a 00 B@:. 0000767a : 767a: 20 40 3a 00 @:. 0000767e : 767e: 20 2f 00 /. 00007681 : 7681: 20 54 30 3a 00 T0:. 00007686 : 7686: 20 2f 00 /. 00007689 : 7689: 20 42 3a 00 B:. 0000768d : 768d: 20 2f 00 /. 00007690 : 7690: 54 3a 00 T:. 00007693 : 7693: 25 53 45 78 63 65 73 73 69 76 65 20 62 65 64 20 %SExcessive bed 76a3: 6c 65 76 65 6c 69 6e 67 20 63 6f 72 72 65 63 74 leveling correct 76b3: 69 6f 6e 3a 20 25 69 20 6d 69 63 72 6f 6e 73 0a ion: %i microns. ... 000076c4 : 76c4: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 76d4: 6c 65 64 2e 20 54 6f 6f 20 6d 75 63 68 20 76 61 led. Too much va 76e4: 72 69 61 74 69 6f 6e 20 66 72 6f 6d 20 65 65 70 riation from eep 76f4: 72 6f 6d 20 6d 65 73 68 00 rom mesh. 000076fd : 76fd: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 770d: 6c 65 64 2e 20 53 65 6e 73 6f 72 20 74 72 69 67 led. Sensor trig 771d: 67 65 72 65 64 20 74 6f 6f 20 73 6f 6f 6e 00 gered too soon. 0000772c : 772c: 20 20 00 . 0000772f : 772f: 4d 65 61 73 75 72 65 64 20 70 6f 69 6e 74 73 3a Measured points: ... 00007740 : 7740: 5a 20 73 65 61 72 63 68 20 68 65 69 67 68 74 3a Z search height: 7750: 20 35 2e 30 66 00 5.0f. 00007756 : 7756: 4e 75 6d 20 58 2c 59 3a 20 37 2c 37 00 Num X,Y: 7,7. 00007763 : 7763: 4d 65 73 68 20 62 65 64 20 6c 65 76 65 6c 69 6e Mesh bed levelin 7773: 67 20 6e 6f 74 20 61 63 74 69 76 65 2e 00 g not active.. 00007781 : 7781: 20 45 3a 00 E:. 00007785 : 7785: 20 5a 3a 00 Z:. 00007789 : 7789: 20 59 3a 00 Y:. 0000778d : 778d: 20 45 3a 00 E:. 00007791 : 7791: 20 5a 3a 00 Z:. 00007795 : 7795: 20 59 3a 00 Y:. 00007799 : 7799: 58 3a 00 X:. 0000779c : 779c: 20 2d 3e 20 00 -> . 000077a1 : 77a1: 53 70 6f 6f 6c 4a 6f 69 6e 3a 20 00 SpoolJoin: . 000077ad : 77ad: 2c 20 00 , . 000077b0 : 77b0: 49 6e 61 63 74 69 76 69 74 79 20 53 68 75 74 64 Inactivity Shutd 77c0: 6f 77 6e 00 own. 000077c4 : 77c4: 4b 49 4c 4c 45 44 2e 00 KILLED.. 000077cc : 77cc: 50 72 69 6e 74 65 72 20 68 61 6c 74 65 64 2e 20 Printer halted. 77dc: 6b 69 6c 6c 28 29 20 63 61 6c 6c 65 64 21 00 kill() called!. 000077eb : 77eb: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 77fb: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 780b: 69 6e 67 20 74 6f 20 30 2e 20 43 6c 69 63 6b 20 ing to 0. Click 781b: 74 6f 20 63 6f 6e 74 69 6e 75 65 2e 00 to continue.. 00007828 : 7828: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 7838: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 7848: 69 6e 67 20 74 6f 20 30 00 ing to 0. 00007851 : 7851: 20 45 3a 30 20 42 3a 00 E:0 B:. 00007859 : 7859: 54 3a 00 T:. 0000785c : 785c: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 786c: 20 69 6e 70 75 74 00 input. 00007873 : 7873: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 7883: 20 75 73 65 72 00 user. 00007889 : 7889: 62 75 73 79 3a 20 70 72 6f 63 65 73 73 69 6e 67 busy: processing ... 0000789a : 789a: 73 65 72 69 61 6c 20 64 75 6d 70 20 00 serial dump . 000078a7 : 78a7: 49 6e 76 61 6c 69 64 20 54 20 63 6f 64 65 2e 00 Invalid T code.. 000078b7 : 78b7: 44 75 70 6c 69 63 61 74 65 20 54 2d 63 6f 64 65 Duplicate T-code 78c7: 20 69 67 6e 6f 72 65 64 2e 00 ignored.. 000078d1 : 78d1: 41 64 76 61 6e 63 65 20 4b 3d 00 Advance K=. 000078dc : 78dc: 4b 20 6f 75 74 20 6f 66 20 61 6c 6c 6f 77 65 64 K out of allowed 78ec: 20 72 61 6e 67 65 21 00 range!. 000078f4 <_sPrinterName>: 78f4: 4d 4b 32 2e 35 53 00 MK2.5S. 000078fb <_sPrinterMmuName>: 78fb: 4d 4b 32 2e 35 53 4d 4d 55 32 53 00 MK2.5SMMU2S. 00007907 <_nPrinterMmuType>: 7907: 1c 4f .O 00007909 <_nPrinterType>: 7909: fc 00 .. 0000790b : 790b: 25 33 64 2f 25 33 64 00 %3d/%3d. 00007913 : 7913: 25 33 64 00 %3d. 00007917 : 7917: 20 0a 20 0a 20 0a 20 00 . . . . 0000791f : 791f: 25 53 53 74 61 74 69 73 74 69 63 73 3a 0a 25 53 %SStatistics:.%S 792f: 20 20 4d 37 38 20 53 25 6c 75 20 54 25 6c 75 0a M78 S%lu T%lu. ... 00007940 : 7940: 25 53 41 72 63 20 53 65 74 74 69 6e 67 73 3a 20 %SArc Settings: 7950: 50 3a 4d 61 78 20 6c 65 6e 67 74 68 28 6d 6d 29 P:Max length(mm) 7960: 20 53 3a 4d 69 6e 20 6c 65 6e 67 74 68 20 28 6d S:Min length (m 7970: 6d 29 20 4e 3a 43 6f 72 72 65 63 74 69 6f 6e 73 m) N:Corrections 7980: 20 52 3a 4d 69 6e 20 73 65 67 6d 65 6e 74 73 20 R:Min segments 7990: 46 3a 53 65 67 6d 65 6e 74 73 2f 73 65 63 2e 0a F:Segments/sec.. 79a0: 25 53 20 20 4d 32 31 34 20 50 25 2e 32 66 20 53 %S M214 P%.2f S 79b0: 25 2e 32 66 20 4e 25 64 20 52 25 64 20 46 25 64 %.2f N%d R%d F%d 79c0: 0a 00 .. 000079c2 : 79c2: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 79d2: 6e 67 73 3a 20 44 69 73 61 62 6c 65 64 0a 00 ngs: Disabled.. 000079e1 : 79e1: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 79f1: 6e 67 73 3a 0a 25 53 20 20 20 4d 32 30 30 20 44 ngs:.%S M200 D 7a01: 25 2e 32 66 0a 00 %.2f.. 00007a07 : 7a07: 25 53 52 65 74 72 61 63 74 3a 20 53 3d 4c 65 6e %SRetract: S=Len 7a17: 67 74 68 20 28 6d 6d 29 20 46 3a 53 70 65 65 64 gth (mm) F:Speed 7a27: 20 28 6d 6d 2f 6d 29 20 5a 3a 20 5a 4c 69 66 74 (mm/m) Z: ZLift 7a37: 20 28 6d 6d 29 0a 25 53 20 20 20 4d 32 30 37 20 (mm).%S M207 7a47: 53 25 2e 32 66 20 46 25 2e 32 66 20 5a 25 2e 32 S%.2f F%.2f Z%.2 7a57: 66 0a 25 53 52 65 63 6f 76 65 72 3a 20 53 3d 45 f.%SRecover: S=E 7a67: 78 74 72 61 20 6c 65 6e 67 74 68 20 28 6d 6d 29 xtra length (mm) 7a77: 20 46 3a 53 70 65 65 64 20 28 6d 6d 2f 6d 29 0a F:Speed (mm/m). 7a87: 25 53 20 20 20 4d 32 30 38 20 53 25 2e 32 66 20 %S M208 S%.2f 7a97: 46 25 2e 32 66 0a 25 53 41 75 74 6f 2d 52 65 74 F%.2f.%SAuto-Ret 7aa7: 72 61 63 74 3a 20 53 3d 30 20 74 6f 20 64 69 73 ract: S=0 to dis 7ab7: 61 62 6c 65 2c 20 31 20 74 6f 20 69 6e 74 65 72 able, 1 to inter 7ac7: 70 72 65 74 20 65 78 74 72 75 64 65 2d 6f 6e 6c pret extrude-onl 7ad7: 79 20 6d 6f 76 65 73 20 61 73 20 72 65 74 72 61 y moves as retra 7ae7: 63 74 73 20 6f 72 20 72 65 63 6f 76 65 72 69 65 cts or recoverie 7af7: 73 0a 25 53 20 20 20 4d 32 30 39 20 53 25 64 0a s.%S M209 S%d. ... 00007b08 : 7b08: 25 53 50 49 44 20 68 65 61 74 62 65 64 20 73 65 %SPID heatbed se 7b18: 74 74 69 6e 67 73 3a 0a 25 53 20 20 20 4d 33 30 ttings:.%S M30 7b28: 34 20 50 25 2e 32 66 20 49 25 2e 32 66 20 44 25 4 P%.2f I%.2f D% 7b38: 2e 32 66 0a 00 .2f.. 00007b3d : 7b3d: 25 53 50 49 44 20 73 65 74 74 69 6e 67 73 3a 0a %SPID settings:. 7b4d: 25 53 20 20 20 4d 33 30 31 20 50 25 2e 32 66 20 %S M301 P%.2f 7b5d: 49 25 2e 32 66 20 44 25 2e 32 66 0a 00 I%.2f D%.2f.. 00007b6a : 7b6a: 25 53 53 74 65 70 73 20 70 65 72 20 75 6e 69 74 %SSteps per unit 7b7a: 3a 0a 25 53 20 20 4d 39 32 20 58 25 2e 32 66 20 :.%S M92 X%.2f 7b8a: 59 25 2e 32 66 20 5a 25 2e 32 66 20 45 25 2e 32 Y%.2f Z%.2f E%.2 7b9a: 66 0a 25 53 4d 61 78 69 6d 75 6d 20 66 65 65 64 f.%SMaximum feed 7baa: 72 61 74 65 73 20 28 6d 6d 2f 73 29 3a 0a 25 53 rates (mm/s):.%S 7bba: 20 20 4d 32 30 33 20 58 25 2e 32 66 20 59 25 2e M203 X%.2f Y%. 7bca: 32 66 20 5a 25 2e 32 66 20 45 25 2e 32 66 0a 25 2f Z%.2f E%.2f.% 7bda: 53 4d 61 78 69 6d 75 6d 20 61 63 63 65 6c 65 72 SMaximum acceler 7bea: 61 74 69 6f 6e 20 28 6d 6d 2f 73 32 29 3a 0a 25 ation (mm/s2):.% 7bfa: 53 20 20 4d 32 30 31 20 58 25 6c 75 20 59 25 6c S M201 X%lu Y%l 7c0a: 75 20 5a 25 6c 75 20 45 25 6c 75 0a 25 53 41 63 u Z%lu E%lu.%SAc 7c1a: 63 65 6c 65 72 61 74 69 6f 6e 3a 20 50 3d 70 72 celeration: P=pr 7c2a: 69 6e 74 2c 20 52 3d 72 65 74 72 61 63 74 2c 20 int, R=retract, 7c3a: 54 3d 74 72 61 76 65 6c 0a 25 53 20 20 4d 32 30 T=travel.%S M20 7c4a: 34 20 50 25 2e 32 66 20 52 25 2e 32 66 20 54 25 4 P%.2f R%.2f T% 7c5a: 2e 32 66 0a 25 53 41 64 76 61 6e 63 65 64 20 76 .2f.%SAdvanced v 7c6a: 61 72 69 61 62 6c 65 73 3a 20 53 3d 4d 69 6e 20 ariables: S=Min 7c7a: 66 65 65 64 72 61 74 65 20 28 6d 6d 2f 73 29 2c feedrate (mm/s), 7c8a: 20 54 3d 4d 69 6e 20 74 72 61 76 65 6c 20 66 65 T=Min travel fe 7c9a: 65 64 72 61 74 65 20 28 6d 6d 2f 73 29 2c 20 42 edrate (mm/s), B 7caa: 3d 6d 69 6e 69 6d 75 6d 20 73 65 67 6d 65 6e 74 =minimum segment 7cba: 20 74 69 6d 65 20 28 75 73 29 2c 20 58 3d 6d 61 time (us), X=ma 7cca: 78 69 6d 75 6d 20 58 59 20 6a 65 72 6b 20 28 6d ximum XY jerk (m 7cda: 6d 2f 73 29 2c 20 20 5a 3d 6d 61 78 69 6d 75 6d m/s), Z=maximum 7cea: 20 5a 20 6a 65 72 6b 20 28 6d 6d 2f 73 29 2c 20 Z jerk (mm/s), 7cfa: 20 45 3d 6d 61 78 69 6d 75 6d 20 45 20 6a 65 72 E=maximum E jer 7d0a: 6b 20 28 6d 6d 2f 73 29 0a 25 53 20 20 4d 32 30 k (mm/s).%S M20 7d1a: 35 20 53 25 2e 32 66 20 54 25 2e 32 66 20 42 25 5 S%.2f T%.2f B% 7d2a: 6c 75 20 58 25 2e 32 66 20 59 25 2e 32 66 20 5a lu X%.2f Y%.2f Z 7d3a: 25 2e 32 66 20 45 25 2e 32 66 0a 25 53 48 6f 6d %.2f E%.2f.%SHom 7d4a: 65 20 6f 66 66 73 65 74 20 28 6d 6d 29 3a 0a 25 e offset (mm):.% 7d5a: 53 20 20 4d 32 30 36 20 58 25 2e 32 66 20 59 25 S M206 X%.2f Y% 7d6a: 2e 32 66 20 5a 25 2e 32 66 0a 00 .2f Z%.2f.. 00007d75 : 7d75: 43 61 70 3a 25 53 3a 25 63 0a 00 Cap:%S:%c.. 00007d80 : 7d80: 50 52 55 53 41 5f 4d 4d 55 32 00 PRUSA_MMU2. 00007d8b : 7d8b: 45 58 54 45 4e 44 45 44 5f 4d 32 30 00 EXTENDED_M20. 00007d98 : 7d98: 41 55 54 4f 52 45 50 4f 52 54 5f 50 4f 53 49 54 AUTOREPORT_POSIT 7da8: 49 4f 4e 00 ION. 00007dac : 7dac: 41 55 54 4f 52 45 50 4f 52 54 5f 46 41 4e 53 00 AUTOREPORT_FANS. 00007dbc : 7dbc: 41 55 54 4f 52 45 50 4f 52 54 5f 54 45 4d 50 00 AUTOREPORT_TEMP. 00007dcc : ... 00007dcd : 7dcd: 44 65 6c 65 74 69 6f 6e 20 66 61 69 6c 65 64 2c Deletion failed, 7ddd: 20 46 69 6c 65 3a 20 00 File: . 00007de5 : 7de5: 46 69 6c 65 20 64 65 6c 65 74 65 64 3a 00 File deleted:. 00007df3 : 7df3: 4e 6f 74 20 53 44 20 70 72 69 6e 74 69 6e 67 00 Not SD printing. 00007e03 : 7e03: 50 72 69 6e 74 20 73 61 76 65 64 00 Print saved. 00007e0f : 7e0f: 53 44 20 70 72 69 6e 74 20 70 61 75 73 65 64 00 SD print paused. 00007e1f : 7e1f: 25 33 64 2f 25 33 64 00 %3d/%3d. 00007e27 : 7e27: 66 76 00 fv. 00007e2a : 7e2a: 74 68 78 00 thx. 00007e2e : 7e2e: 50 52 4e 00 PRN. 00007e32 <_ZZ16process_commandsvE3__c__84_>: 7e32: 22 28 32 29 00 "(2). 00007e37 <_ZZ16process_commandsvE3__c__83_>: 7e37: 6e 6f 20 76 61 6c 69 64 20 63 6f 6d 6d 61 6e 64 no valid command ... 00007e48 <_ZZ16process_commandsvE3__c__82_>: 7e48: 7a 65 72 6f 72 69 7a 65 64 00 zerorized. 00007e52 <_ZZ16process_commandsvE3__c__81_>: 7e52: 66 61 63 74 6f 72 79 20 72 65 73 74 6f 72 65 64 factory restored ... 00007e63 <_ZZ16process_commandsvE3__c__79_>: 7e63: 69 6e 64 65 78 2c 20 74 65 6d 70 2c 20 75 73 74 index, temp, ust 7e73: 65 70 2c 20 75 6d 00 ep, um. 00007e7a <_ZZ16process_commandsvE3__c__80_>: 7e7a: 50 49 4e 44 41 20 63 61 6c 20 73 74 61 74 75 73 PINDA cal status 7e8a: 3a 20 00 : . 00007e8d <_ZZ16process_commandsvE3__c__78_>: 7e8d: 50 3a 00 P:. 00007e90 <_ZZ16process_commandsvE3__c__77_>: 7e90: 57 61 69 74 20 66 6f 72 20 50 49 4e 44 41 20 74 Wait for PINDA t 7ea0: 61 72 67 65 74 20 74 65 6d 70 65 72 61 74 75 72 arget temperatur 7eb0: 65 3a 00 e:. 00007eb3 <_ZZ16process_commandsvE3__c__76_>: 7eb3: 20 41 00 A. 00007eb6 <_ZZ16process_commandsvE3__c__75_>: 7eb6: 20 50 00 P. 00007eb9 <_ZZ16process_commandsvE3__c__74_>: 7eb9: 20 42 00 B. 00007ebc <_ZZ16process_commandsvE3__c__73_>: 7ebc: 20 4c 00 L. 00007ebf <_ZZ16process_commandsvE3__c__72_>: 7ebf: 20 52 00 R. 00007ec2 <_ZZ16process_commandsvE3__c__71_>: 7ec2: 20 5a 00 Z. 00007ec5 <_ZZ16process_commandsvE3__c__70_>: 7ec5: 20 4e 4f 54 20 49 4e 49 54 49 41 4c 49 5a 45 44 NOT INITIALIZED ... 00007ed6 <_ZZ16process_commandsvE3__c__69_>: 7ed6: 53 68 65 65 74 20 00 Sheet . 00007edd <_ZZ16process_commandsvE3__c__68_>: 7edd: 20 5a 20 56 41 4c 55 45 20 4f 55 54 20 4f 46 20 Z VALUE OUT OF 7eed: 52 41 4e 47 45 00 RANGE. 00007ef3 <_ZZ16process_commandsvE3__c__67_>: 7ef3: 49 6e 76 61 6c 69 64 20 73 68 65 65 74 20 49 44 Invalid sheet ID 7f03: 2e 20 41 6c 6c 6f 77 65 64 3a 20 30 2e 2e 00 . Allowed: 0... 00007f12 <_ZZ16process_commandsvE3__c__66_>: 7f12: 41 55 54 4f 00 AUTO. 00007f17 <_ZZ16process_commandsvE3__c__65_>: 7f17: 4c 41 4e 47 20 53 45 4c 20 46 4f 52 43 45 44 00 LANG SEL FORCED. 00007f27 <_ZZ16process_commandsvE3__c__64_>: 7f27: 20 64 3a 00 d:. 00007f2b <_ZZ16process_commandsvE3__c__63_>: 7f2b: 20 69 3a 00 i:. 00007f2f <_ZZ16process_commandsvE3__c__62_>: 7f2f: 20 70 3a 00 p:. 00007f33 <_ZZ16process_commandsvE3__c__61_>: 7f33: 20 64 3a 00 d:. 00007f37 <_ZZ16process_commandsvE3__c__60_>: 7f37: 20 69 3a 00 i:. 00007f3b <_ZZ16process_commandsvE3__c__59_>: 7f3b: 20 70 3a 00 p:. 00007f3f <_ZZ16process_commandsvE3__c__58_>: 7f3f: 25 69 25 25 0a 00 %i%%.. 00007f45 <_ZZ16process_commandsvE3__c__57_>: 7f45: 25 69 25 25 0a 00 %i%%.. 00007f4b <_ZZ16process_commandsvE3__c__56_>: 7f4b: 22 28 31 29 00 "(1). 00007f50 <_ZZ16process_commandsvE3__c__51_>: 7f50: 2f 2f 00 //. 00007f53 <_ZZ16process_commandsvE3__c__50_>: ... 00007f54 <_ZZ16process_commandsvE3__c__49_>: 7f54: 20 45 58 54 52 55 44 45 52 5f 43 4f 55 4e 54 3a EXTRUDER_COUNT: 7f64: 31 00 1. 00007f66 <_ZZ16process_commandsvE3__c__48_>: 7f66: 20 4d 41 43 48 49 4e 45 5f 54 59 50 45 3a 00 MACHINE_TYPE:. 00007f75 <_ZZ16process_commandsvE3__c__47_>: 7f75: 31 2e 30 00 1.0. 00007f79 <_ZZ16process_commandsvE3__c__46_>: 7f79: 20 62 61 73 65 64 20 6f 6e 20 4d 61 72 6c 69 6e based on Marlin 7f89: 20 46 49 52 4d 57 41 52 45 5f 55 52 4c 3a 68 74 FIRMWARE_URL:ht 7f99: 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d tps://github.com 7fa9: 2f 70 72 75 73 61 33 64 2f 50 72 75 73 61 2d 46 /prusa3d/Prusa-F 7fb9: 69 72 6d 77 61 72 65 20 50 52 4f 54 4f 43 4f 4c irmware PROTOCOL 7fc9: 5f 56 45 52 53 49 4f 4e 3a 00 _VERSION:. 00007fd3 <_ZZ16process_commandsvE3__c__45_>: 7fd3: 37 37 33 31 30 32 34 65 64 00 7731024ed. 00007fdd <_ZZ16process_commandsvE3__c__44_>: 7fdd: 5f 00 _. 00007fdf <_ZZ16process_commandsvE3__c__43_>: 7fdf: 38 32 37 39 00 8279. 00007fe4 <_ZZ16process_commandsvE3__c__42_>: 7fe4: 2b 00 +. 00007fe6 <_ZZ16process_commandsvE3__c__41_>: 7fe6: 46 49 52 4d 57 41 52 45 5f 4e 41 4d 45 3a 50 72 FIRMWARE_NAME:Pr 7ff6: 75 73 61 2d 46 69 72 6d 77 61 72 65 20 00 usa-Firmware . 00008004 <_ZZ16process_commandsvE3__c__40_>: 8004: 4d 31 31 33 20 53 00 M113 S. 0000800b <_ZZ16process_commandsvE3__c__39_>: 800b: 6f 6b 20 00 ok . 0000800f <_ZZ16process_commandsvE3__c__33_>: 800f: 6e 2f 61 00 n/a. 00008013 <_ZZ16process_commandsvE3__c__32_>: 8013: 3f 54 6f 73 68 69 62 61 20 46 6c 61 73 68 41 69 ?Toshiba FlashAi 8023: 72 20 47 65 74 49 50 20 66 61 69 6c 65 64 0a 00 r GetIP failed.. 00008033 : 8033: 00 01 25 30 1d 0c ff 24 31 1c 0b ff 23 2f 1b 0a ..%0...$1...#/.. 8043: 17 ff 04 06 22 2b 1a 03 36 35 35 38 ...."+..6558 0000804f <_ZZ16process_commandsvE3__c__31_>: 804f: 25 69 20 6d 69 6e 2c 20 25 69 20 73 65 63 00 %i min, %i sec. 0000805e <_ZZ16process_commandsvE3__c__28_>: 805e: 49 6e 76 61 6c 69 64 20 4d 20 63 6f 64 65 3a 20 Invalid M code: 806e: 25 73 0a 00 %s.. 00008072 <_ZZ16process_commandsvE3__c__22_>: 8072: 50 49 4e 44 41 20 70 72 6f 62 65 20 63 61 6c 69 PINDA probe cali 8082: 62 72 61 74 69 6f 6e 20 73 74 61 72 74 00 bration start. 00008090 <_ZZ16process_commandsvE3__c__21_>: 8090: 4e 6f 20 50 49 4e 44 41 20 74 68 65 72 6d 69 73 No PINDA thermis 80a0: 74 6f 72 00 tor. 000080a4 <_ZZ16process_commandsvE3__c__17_>: 80a4: 73 65 74 00 set. 000080a8 <_ZZ16process_commandsvE3__c__16_>: 80a8: 6e 6f 7a 7a 6c 65 00 nozzle. 000080af <_ZZ16process_commandsvE3__c__15_>: 80af: 4d 42 4c 00 MBL. 000080b3 <_ZZ16process_commandsvE3__c__14_>: 80b3: 46 52 00 FR. 000080b6 <_ZZ16process_commandsvE3__c__13_>: 80b6: 4c 7a 00 Lz. 000080b9 <_ZZ16process_commandsvE3__c__12_>: 80b9: 4c 61 6e 67 00 Lang. 000080be <_ZZ16process_commandsvE3__c__11_>: 80be: 31 5f 37 35 6d 6d 5f 4d 4b 32 35 53 2d 52 41 4d 1_75mm_MK25S-RAM 80ce: 42 6f 31 30 61 2d 45 33 44 76 36 66 75 6c 6c 00 Bo10a-E3Dv6full. 000080de <_ZZ16process_commandsvE3__c__10_>: 80de: 52 65 76 00 Rev. 000080e2 : 80e2: 33 2e 31 34 2e 31 2d 38 32 37 39 00 3.14.1-8279. 000080ee : 80ee: 46 69 72 00 Fir. 000080f2 : 80f2: 53 4e 20 69 6e 76 61 6c 69 64 00 SN invalid. 000080fd : 80fd: 53 4e 00 SN. 00008100 : 8100: 52 45 53 45 54 00 RESET. 00008106 : 8106: 4d 4d 55 52 45 53 00 MMURES. 0000810d : 810d: 75 76 6c 6f 00 uvlo. 00008112 : 8112: 46 41 4e 00 FAN. 00008116 : 8116: 46 41 4e 50 49 4e 54 53 54 00 FANPINTST. 00008120 : 8120: 50 52 55 53 41 00 PRUSA. 00008126 : 8126: 4d 31 30 34 53 30 00 M104S0. 0000812d : 812d: 47 31 58 31 30 59 31 38 30 46 34 30 30 30 00 G1X10Y180F4000. 0000813c : 813c: 47 31 5a 31 30 46 31 33 30 30 00 G1Z10F1300. 00008147 : 8147: 4d 31 34 30 53 30 00 M140S0. 0000814e : 814e: 47 31 45 2d 30 2e 30 37 35 46 32 31 30 30 00 G1E-0.075F2100. 0000815d : 815d: 4d 32 30 34 53 31 30 30 30 00 M204S1000. 00008167 : 8167: 47 31 5a 35 46 37 32 30 30 00 G1Z5F7200. 00008171 : 8171: 47 31 45 2d 31 2e 35 46 32 31 30 30 00 G1E-1.5F2100. 0000817e : 817e: 47 31 5a 30 2e 32 00 G1Z0.2. 00008185 : 8185: 47 31 58 32 30 32 2e 35 45 38 46 31 34 30 30 00 G1X202.5E8F1400. 00008195 : 8195: 47 31 59 2d 32 46 31 30 30 30 00 G1Y-2F1000. 000081a0 : 81a0: 47 31 58 32 34 30 45 32 35 46 32 32 30 30 00 G1X240E25F2200. 000081af : 81af: 47 31 5a 30 2e 33 46 31 30 30 30 00 G1Z0.3F1000. 000081bb : 81bb: 47 31 58 35 35 45 38 46 32 30 30 30 00 G1X55E8F2000. 000081c8 : 81c8: 47 31 58 35 45 32 39 46 31 38 30 30 00 G1X5E29F1800. 000081d5 : 81d5: 47 31 58 35 35 45 32 39 46 31 30 37 33 00 G1X55E29F1073. 000081e3 : 81e3: 47 39 32 45 30 00 G92E0. 000081e9 : 81e9: 47 32 38 00 G28. 000081ed : 81ed: 4d 31 30 39 00 M109. 000081f2 : 81f2: 4d 31 39 30 00 M190. 000081f7 : 81f7: 10 00 c9 02 10 01 2c 01 40 01 22 01 70 01 18 01 ......,.@.".p... 8207: b0 01 0e 01 f0 01 04 01 50 02 fa 00 b0 02 f0 00 ........P....... 8217: 30 03 e6 00 d0 03 dc 00 90 04 d2 00 70 05 c8 00 0...........p... 8227: a0 06 be 00 00 08 b4 00 b0 09 aa 00 d0 0b a0 00 ................ 8237: 60 0e 96 00 60 11 8c 00 00 15 82 00 20 19 78 00 `...`....... .x. 8247: c0 1d 6e 00 a0 22 64 00 b0 27 5a 00 90 2c 50 00 ..n.."d..'Z..,P. 8257: 00 31 46 00 e0 34 3c 00 10 38 32 00 90 3a 28 00 .1F..4<..82..:(. 8267: 60 3c 1e 00 a0 3d 14 00 80 3e 0a 00 20 3f 00 00 `<...=...>.. ?.. 00008277 : 8277: 45 78 70 65 72 69 6d 65 6e 74 61 6c 00 Experimental. 00008284 : 8284: 30 2e 38 30 00 0.80. 00008289 : 8289: 30 2e 36 30 00 0.60. 0000828e : 828e: 30 2e 34 30 00 0.40. 00008293 : 8293: 30 2e 32 35 00 0.25. 00008298 : 8298: 44 69 73 61 62 6c 65 20 66 61 72 6d 20 6d 6f 64 Disable farm mod 82a8: 65 00 e. 000082aa : 82aa: 52 65 73 65 74 20 4d 4d 55 00 Reset MMU. 000082b4 : 82b4: 4d 4d 55 00 MMU. 000082b8 : 82b8: 4d 34 34 00 M44. 000082bc : 82bc: 47 39 39 00 G99. 000082c0 : 82c0: 44 69 73 61 62 6c 65 20 66 61 72 6d 20 6d 6f 64 Disable farm mod 82d0: 65 3f 00 e?. 000082d3 : 82d3: 47 32 38 20 58 59 00 G28 XY. 000082da : 82da: 4d 20 38 34 00 M 84. 000082df : 82df: 85 2e 2e 00 .... 000082e3 : 82e3: 25 33 64 2f 30 00 %3d/0. 000082e9 : 82e9: 25 33 64 2f 30 00 %3d/0. 000082ef : 82ef: 6c 63 64 5f 73 65 6c 66 63 68 65 63 6b 5f 61 78 lcd_selfcheck_ax 82ff: 69 73 20 25 64 2c 20 25 64 0a 00 is %d, %d.. 0000830a : 830a: 48 6f 74 65 6e 64 00 Hotend. 00008311 : 8311: 42 65 64 00 Bed. 00008315 : 8315: 5a 00 Z. 00008317 : 8317: 59 00 Y. 00008319 : 8319: 58 00 X. 0000831b <_ZL13STR_SEPARATOR.lto_priv.412>: 831b: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ---------------- 832b: 2d 2d 2d 2d 00 ----. 00008330 : 8330: 53 75 70 65 72 50 49 4e 44 41 3a 00 SuperPINDA:. 0000833c : 833c: 3d 67 41 67 4e 81 47 81 3c 81 2d 81 0d 68 26 81 =gAgN.G.<.-..h&. 834c: cf 67 .g 0000834e : 834e: 47 31 59 25 2e 34 66 45 25 2e 34 66 00 G1Y%.4fE%.4f. 0000835b : 835b: 47 31 5a 25 2e 32 66 00 G1Z%.2f. 00008363 : 8363: 47 31 58 35 30 59 31 35 35 00 G1X50Y155. 0000836d : 836d: e3 81 3d 67 35 6c 71 81 67 81 5d 81 ..=g5lq.g.]. 00008379 : 8379: 47 31 58 25 2e 34 66 45 25 2e 34 66 00 G1X%.4fE%.4f. 00008386 : 8386: 47 31 46 31 30 38 30 00 G1F1080. 0000838e : 838e: d5 81 c8 81 bb 81 af 81 e3 81 a0 81 95 81 85 81 ................ 839e: 7e 81 ~. 000083a0 : 83a0: 54 25 64 00 T%d. 000083a4 : 83a4: 47 31 5a 30 2e 34 00 G1Z0.4. 000083ab : 83ab: 47 31 59 2d 33 46 31 30 30 30 00 G1Y-3F1000. 000083b6 : 83b6: 41 67 f2 81 ed 81 e9 81 e3 81 Ag........ 000083c0 : 83c0: 4d 38 34 20 58 59 00 M84 XY. 000083c7 : 83c7: 4d 31 30 39 20 53 32 38 30 00 M109 S280. 000083d1 : 83d1: 47 31 20 58 31 32 35 20 5a 32 30 30 20 46 31 30 G1 X125 Z200 F10 83e1: 30 30 00 00. 000083e4 : 83e4: 49 6e 76 61 6c 69 64 20 50 49 44 20 63 61 6c 2e Invalid PID cal. 83f4: 20 72 65 73 75 6c 74 73 2e 20 4e 6f 74 20 73 74 results. Not st 8404: 6f 72 65 64 20 74 6f 20 45 45 50 52 4f 4d 2e 00 ored to EEPROM.. 00008414 : 8414: 4d 33 30 31 20 50 25 2e 32 66 20 49 25 2e 32 66 M301 P%.2f I%.2f 8424: 20 44 25 2e 32 66 00 D%.2f. 0000842b : 842b: 4d 33 30 33 20 45 30 20 53 25 33 75 00 M303 E0 S%3u. 00008438 : 8438: 52 43 00 RC. 0000843b : 843b: 44 45 56 00 DEV. 0000843f : 843f: 42 45 54 41 00 BETA. 00008444 : 8444: 41 4c 50 48 41 00 ALPHA. 0000844a : 844a: 00 00 21 00 24 00 27 00 2a 00 2d 00 30 00 33 00 ..!.$.'.*.-.0.3. 845a: 01 01 00 00 04 01 07 01 0a 01 .......... 00008464 : 8464: 00 00 22 00 25 00 28 00 2b 00 2e 00 31 00 34 00 ..".%.(.+...1.4. 8474: 02 01 00 00 05 01 08 01 0b 01 .......... 0000847e : 847e: 00 00 20 00 23 00 26 00 29 00 2c 00 2f 00 32 00 .. .#.&.).,./.2. 848e: 00 01 00 00 03 01 06 01 09 01 .......... 00008498 : 8498: 05 05 05 05 07 05 08 08 08 08 02 02 02 02 0a 0a ................ 84a8: 08 08 04 04 04 04 01 01 01 01 01 01 01 01 03 03 ................ 84b8: 03 03 03 03 03 03 04 07 07 07 0c 0c 0c 0c 0c 0c ................ 84c8: 0c 0c 02 02 02 02 06 06 06 06 06 06 06 06 0b 0b ................ 84d8: 0b 0b 0b 0b 0b 0b 07 07 0a 0a 0a 0a 0a 0a 05 05 ................ 84e8: 05 04 04 04 08 08 ...... 000084ee : 84ee: 01 02 10 20 20 08 08 10 20 40 10 20 40 80 02 01 ... ... @. @... 84fe: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 80 40 ........... @..@ 850e: 20 10 08 04 02 01 80 04 02 01 80 40 20 10 08 04 ..........@ ... 851e: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 01 02 ........... @... 852e: 04 08 10 20 40 80 10 08 04 08 80 10 20 40 04 40 ... @....... @.@ 853e: 80 10 20 40 04 80 .. @.. 00008544 : 8544: 00 00 0a 0b 02 09 0c 0d 0e 08 07 03 04 01 00 00 ................ ... 8570: 12 11 10 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ ... 0000859a : 859a: 33 2e 31 34 2e 31 00 3.14.1. 000085a1 : 85a1: 0a 20 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 . Original Prusa 85b1: 20 69 33 0a 20 20 20 50 72 75 73 61 20 52 65 73 i3. Prusa Res 85c1: 65 61 72 63 68 0a 25 32 30 2e 32 30 53 00 earch.%20.20S. 000085cf : 85cf: 53 70 6f 6f 6c 4a 6f 69 6e 20 69 73 20 00 SpoolJoin is . 000085dd : 85dd: 61 64 63 5f 69 6e 69 74 00 adc_init. 000085e6 : 85e6: 20 0a 20 0a 20 0a 20 00 . . . . 000085ee : 85ee: 41 6c 6c 20 44 61 74 61 00 All Data. 000085f7 : 85f7: 53 65 72 76 69 63 65 20 70 72 65 70 00 Service prep. 00008604 : 8604: 53 68 69 70 70 69 6e 67 20 70 72 65 70 00 Shipping prep. 00008612 : 8612: 53 74 61 74 69 73 74 69 63 73 00 Statistics. 0000861d : 861d: 4c 61 6e 67 75 61 67 65 00 Language. 00008626 <_ZZL13factory_resetcE3__c.lto_priv.498>: 8626: 45 52 41 53 49 4e 47 20 61 6c 6c 20 64 61 74 61 ERASING all data ... 00008637 : 8637: 46 61 63 74 6f 72 79 20 52 45 53 45 54 00 Factory RESET. 00008645 : 8645: 50 52 55 53 41 33 44 46 57 00 PRUSA3DFW. 0000864f : 864f: 03 00 0e 00 01 00 40 00 ......@. 00008657 : 8657: 03 00 02 00 00 00 04 00 ........ 0000865f : 865f: 70 72 75 73 61 33 64 00 prusa3d. 00008667 : 8667: 32 30 32 35 2d 30 34 2d 32 32 20 32 32 3a 30 33 2025-04-22 22:03 8677: 3a 35 33 00 :53. 0000867b : 867b: 20 33 2e 31 34 2e 31 2d 38 32 37 39 5f 37 37 33 3.14.1-8279_773 868b: 31 30 32 34 65 64 00 1024ed. 00008692 : 8692: 73 74 61 72 74 00 start. 00008698 : 8698: 4d 32 39 00 M29. 0000869c : 869c: 25 2d 39 2e 39 53 5b 00 %-9.9S[. 000086a4 : 86a4: 33 33 29 42 00 00 58 41 9a 99 8d 41 33 33 53 40 33)B..XA...A33S@ 000086b4 : 86b4: 20 0a 20 0a 20 00 . . . 000086ba : 86ba: 4d 4d 55 32 3a 00 MMU2:. 000086c0 : 86c0: 4d 65 61 73 75 72 65 20 63 65 6e 74 65 72 20 20 Measure center ... 000086d1 : 86d1: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 65 xyzcal_measure_e 86e1: 6e 74 65 72 0a 00 nter.. 000086e7 : 86e7: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 38 20 63 xyzcal_spiral8 c 86f7: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d 8707: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d 8717: 20 61 64 3d 25 64 0a 00 ad=%d.. 0000871f : 871f: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 6e xyzcal_searchZ n 872f: 6f 20 73 69 67 6e 61 6c 0a 20 78 3d 25 6c 64 20 o signal. x=%ld 873f: 79 3d 25 6c 64 20 7a 3d 25 6c 64 0a 00 y=%ld z=%ld.. 0000874c : 874c: 20 4f 4e 2d 53 49 47 4e 41 4c 20 61 74 20 78 3d ON-SIGNAL at x= 875c: 25 64 20 79 3d 25 64 20 7a 3d 25 64 20 61 64 3d %d y=%d z=%d ad= 876c: 25 64 0a 00 %d.. 00008770 : 8770: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 78 xyzcal_searchZ x 8780: 3d 25 6c 64 20 79 3d 25 6c 64 20 7a 3d 25 6c 64 =%ld y=%ld z=%ld 8790: 0a 00 .. 00008792 : 8792: 25 30 32 78 00 %02x. 00008797 : 8797: 20 5b 25 66 20 25 66 5d 20 6d 6d 20 70 61 74 74 [%f %f] mm patt 87a7: 65 72 6e 20 63 65 6e 74 65 72 0a 00 ern center.. 000087b3 : 87b3: 20 5b 25 66 20 25 66 5d 5b 25 66 5d 20 6d 6d 20 [%f %f][%f] mm 87c3: 64 69 76 65 72 67 65 6e 63 65 0a 00 divergence.. 000087cf : 87cf: 00 00 f0 00 f8 01 fc 03 fe 07 fe 07 fe 07 fe 07 ................ 87df: fc 03 f8 01 f0 00 00 00 ........ 000087e7 : 87e7: 00 00 00 00 f0 00 f8 01 fc 03 fc 03 fc 03 fc 03 ................ 87f7: f8 01 f0 00 00 00 00 00 ........ 000087ff : 87ff: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 6c xyzcal_measure_l 880f: 65 61 76 65 0a 00 eave.. 00008815 : 8815: 20 3c 20 00 < . 00008819 : 8819: 57 41 52 4e 49 4e 47 3a 20 46 72 6f 6e 74 20 70 WARNING: Front p 8829: 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 68 61 62 oint not reachab 8839: 6c 65 2e 20 59 20 63 6f 6f 72 64 69 6e 61 74 65 le. Y coordinate 8849: 3a 00 :. 0000884b : ... 0000884c : 884c: 00 00 40 41 00 00 80 40 00 00 5c 43 00 00 80 40 ..@A...@..\C...@ 885c: 00 00 5c 43 00 00 44 43 00 00 40 41 00 00 44 43 ..\C..DC..@A..DC 0000886c : 886c: 25 64 2f 34 00 %d/4. 00008871 : 8871: 49 74 65 72 61 74 69 6f 6e 3a 20 00 Iteration: . 0000887d : 887d: 43 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 69 6c Calibration fail 888d: 65 64 21 20 43 68 65 63 6b 20 74 68 65 20 61 78 ed! Check the ax 889d: 65 73 20 61 6e 64 20 72 75 6e 20 61 67 61 69 6e es and run again 88ad: 2e 00 .. 000088af : 88af: 4d 49 4e 54 45 4d 50 20 42 45 44 20 66 69 78 65 MINTEMP BED fixe 88bf: 64 00 d. 000088c1 : 88c1: 4d 49 4e 54 45 4d 50 20 48 4f 54 45 4e 44 20 66 MINTEMP HOTEND f 88d1: 69 78 65 64 00 ixed. 000088d6 : 88d6: 24 f4 d4 30 50 c3 8e 20 c2 a2 40 17 82 8b 70 11 $..0P.. ..@...p. 88e6: 12 7a 91 0d 81 6c d9 0a a8 61 e1 08 c7 58 66 07 .z...l...a...Xf. 88f6: 61 51 43 06 1e 4b 5d 05 c1 45 a7 04 1a 41 11 04 aQC..K]..E...A.. 8906: 09 3d 98 03 71 39 31 03 40 36 db 02 65 33 91 02 .=..q91.@6..e3.. 8916: d4 30 54 02 80 2e 1d 02 63 2c ee 01 75 2a c5 01 .0T.....c,..u*.. 8926: b0 28 a0 01 10 27 81 01 8f 25 64 01 2b 24 4b 01 .(...'...%d.+$K. 8936: e0 22 34 01 ac 21 1f 01 8d 20 0d 01 80 1f fc 00 ."4..!... ...... 8946: 84 1e ed 00 97 1d df 00 b8 1c d2 00 e6 1b c6 00 ................ 8956: 20 1b bc 00 64 1a b2 00 b2 19 a8 00 0a 19 a0 00 ...d........... 8966: 6a 18 99 00 d1 17 91 00 40 17 8b 00 b5 16 84 00 j.......@....... 8976: 31 16 7e 00 b3 15 79 00 3a 15 73 00 c7 14 6f 00 1.~...y.:.s...o. 8986: 58 14 6a 00 ee 13 66 00 88 13 63 00 25 13 5e 00 X.j...f...c.%.^. 8996: c7 12 5b 00 6c 12 57 00 15 12 54 00 c1 11 51 00 ..[.l.W...T...Q. 89a6: 70 11 4f 00 21 11 4b 00 d6 10 49 00 8d 10 47 00 p.O.!.K...I...G. 89b6: 46 10 44 00 02 10 42 00 c0 0f 40 00 80 0f 3e 00 F.D...B...@...>. 89c6: 42 0f 3c 00 06 0f 3b 00 cb 0e 38 00 93 0e 37 00 B.<...;...8...7. 89d6: 5c 0e 35 00 27 0e 34 00 f3 0d 32 00 c1 0d 31 00 \.5.'.4...2...1. 89e6: 90 0d 30 00 60 0d 2e 00 32 0d 2d 00 05 0d 2c 00 ..0.`...2.-...,. 89f6: d9 0c 2b 00 ae 0c 29 00 85 0c 29 00 5c 0c 27 00 ..+...)...).\.'. 8a06: 35 0c 27 00 0e 0c 26 00 e8 0b 24 00 c4 0b 24 00 5.'...&...$...$. 8a16: a0 0b 23 00 7d 0b 23 00 5a 0b 21 00 39 0b 21 00 ..#.}.#.Z.!.9.!. 8a26: 18 0b 20 00 f8 0a 1f 00 d9 0a 1e 00 bb 0a 1e 00 .. ............. 8a36: 9d 0a 1d 00 80 0a 1d 00 63 0a 1c 00 47 0a 1b 00 ........c...G... 8a46: 2c 0a 1b 00 11 0a 1a 00 f7 09 1a 00 dd 09 19 00 ,............... 8a56: c4 09 19 00 ab 09 19 00 92 09 17 00 7b 09 18 00 ............{... 8a66: 63 09 17 00 4c 09 16 00 36 09 16 00 20 09 16 00 c...L...6... ... 8a76: 0a 09 15 00 f5 08 15 00 e0 08 14 00 cc 08 14 00 ................ 8a86: b8 08 14 00 a4 08 14 00 90 08 13 00 7d 08 12 00 ............}... 8a96: 6b 08 13 00 58 08 12 00 46 08 12 00 34 08 11 00 k...X...F...4... 8aa6: 23 08 11 00 12 08 11 00 01 08 11 00 f0 07 10 00 #............... 8ab6: e0 07 10 00 d0 07 10 00 c0 07 10 00 b0 07 0f 00 ................ 8ac6: a1 07 10 00 91 07 0e 00 83 07 0f 00 74 07 0f 00 ............t... 8ad6: 65 07 0e 00 57 07 0e 00 49 07 0e 00 3b 07 0d 00 e...W...I...;... 8ae6: 2e 07 0e 00 20 07 0d 00 13 07 0d 00 06 07 0d 00 .... ........... 8af6: f9 06 0c 00 ed 06 0d 00 e0 06 0c 00 d4 06 0c 00 ................ 8b06: c8 06 0c 00 bc 06 0c 00 b0 06 0c 00 a4 06 0b 00 ................ 8b16: 99 06 0c 00 8d 06 0b 00 82 06 0b 00 77 06 0b 00 ............w... 8b26: 6c 06 0b 00 61 06 0a 00 57 06 0b 00 4c 06 0a 00 l...a...W...L... 8b36: 42 06 0a 00 38 06 0a 00 2e 06 0a 00 24 06 0a 00 B...8.......$... 8b46: 1a 06 0a 00 10 06 09 00 07 06 0a 00 fd 05 09 00 ................ 8b56: f4 05 09 00 eb 05 09 00 e2 05 09 00 d9 05 09 00 ................ 8b66: d0 05 09 00 c7 05 09 00 be 05 09 00 b5 05 08 00 ................ 8b76: ad 05 08 00 a5 05 09 00 9c 05 08 00 94 05 08 00 ................ 8b86: 8c 05 08 00 84 05 08 00 7c 05 08 00 74 05 08 00 ........|...t... 8b96: 6c 05 07 00 65 05 08 00 5d 05 07 00 56 05 08 00 l...e...]...V... 8ba6: 4e 05 07 00 47 05 07 00 40 05 08 00 38 05 07 00 N...G...@...8... 8bb6: 31 05 07 00 2a 05 07 00 23 05 07 00 1c 05 06 00 1...*...#....... 8bc6: 16 05 07 00 0f 05 07 00 08 05 06 00 02 05 07 00 ................ 8bd6: fb 04 06 00 f5 04 07 00 ee 04 06 00 e8 04 06 00 ................ 8be6: e2 04 07 00 db 04 06 00 d5 04 06 00 cf 04 06 00 ................ 8bf6: c9 04 06 00 c3 04 06 00 bd 04 06 00 b7 04 06 00 ................ 8c06: b1 04 05 00 ac 04 06 00 a6 04 06 00 a0 04 05 00 ................ 8c16: 9b 04 06 00 95 04 05 00 90 04 06 00 8a 04 05 00 ................ 8c26: 85 04 05 00 80 04 06 00 7a 04 05 00 75 04 05 00 ........z...u... 8c36: 70 04 05 00 6b 04 05 00 66 04 05 00 61 04 05 00 p...k...f...a... 8c46: 5c 04 05 00 57 04 05 00 52 04 05 00 4d 04 05 00 \...W...R...M... 8c56: 48 04 05 00 43 04 05 00 3e 04 04 00 3a 04 05 00 H...C...>...:... 8c66: 35 04 05 00 30 04 04 00 2c 04 05 00 27 04 04 00 5...0...,...'... 8c76: 23 04 05 00 1e 04 04 00 1a 04 04 00 16 04 05 00 #............... 8c86: 11 04 04 00 0d 04 04 00 09 04 05 00 04 04 04 00 ................ 8c96: 00 04 04 00 fc 03 04 00 f8 03 04 00 f4 03 04 00 ................ 8ca6: f0 03 04 00 ec 03 04 00 e8 03 04 00 e4 03 04 00 ................ 8cb6: e0 03 04 00 dc 03 04 00 d8 03 04 00 d4 03 04 00 ................ 8cc6: d0 03 04 00 cc 03 04 00 c8 03 03 00 c5 03 03 00 ................ 00008cd6 : 8cd6: 24 f4 04 d9 20 1b c4 0c 5c 0e 98 04 c4 09 5f 02 $... ...\....._. 8ce6: 65 07 71 01 f4 05 f9 00 fb 04 b3 00 48 04 87 00 e.q.........H... 8cf6: c1 03 69 00 58 03 55 00 03 03 45 00 be 02 3a 00 ..i.X.U...E...:. 8d06: 84 02 31 00 53 02 2a 00 29 02 25 00 04 02 20 00 ..1.S.*.).%... . 8d16: e4 01 1c 00 c8 01 19 00 af 01 17 00 98 01 14 00 ................ 8d26: 84 01 13 00 71 01 10 00 61 01 10 00 51 01 0e 00 ....q...a...Q... 8d36: 43 01 0d 00 36 01 0b 00 2b 01 0b 00 20 01 0b 00 C...6...+... ... 8d46: 15 01 09 00 0c 01 09 00 03 01 08 00 fb 00 08 00 ................ 8d56: f3 00 08 00 eb 00 07 00 e4 00 06 00 de 00 06 00 ................ 8d66: d8 00 06 00 d2 00 06 00 cc 00 05 00 c7 00 05 00 ................ 8d76: c2 00 05 00 bd 00 04 00 b9 00 04 00 b5 00 04 00 ................ 8d86: b1 00 04 00 ad 00 04 00 a9 00 04 00 a5 00 03 00 ................ 8d96: a2 00 03 00 9f 00 04 00 9b 00 03 00 98 00 03 00 ................ 8da6: 95 00 02 00 93 00 03 00 90 00 03 00 8d 00 02 00 ................ 8db6: 8b 00 03 00 88 00 02 00 86 00 02 00 84 00 03 00 ................ 8dc6: 81 00 02 00 7f 00 02 00 7d 00 02 00 7b 00 02 00 ........}...{... 8dd6: 79 00 02 00 77 00 01 00 76 00 02 00 74 00 02 00 y...w...v...t... 8de6: 72 00 01 00 71 00 02 00 6f 00 02 00 6d 00 01 00 r...q...o...m... 8df6: 6c 00 02 00 6a 00 01 00 69 00 02 00 67 00 01 00 l...j...i...g... 8e06: 66 00 01 00 65 00 01 00 64 00 02 00 62 00 01 00 f...e...d...b... 8e16: 61 00 01 00 60 00 01 00 5f 00 02 00 5d 00 01 00 a...`..._...]... 8e26: 5c 00 01 00 5b 00 01 00 5a 00 01 00 59 00 01 00 \...[...Z...Y... 8e36: 58 00 01 00 57 00 01 00 56 00 01 00 55 00 01 00 X...W...V...U... 8e46: 54 00 01 00 53 00 00 00 53 00 01 00 52 00 01 00 T...S...S...R... 8e56: 51 00 01 00 50 00 01 00 4f 00 01 00 4e 00 00 00 Q...P...O...N... 8e66: 4e 00 01 00 4d 00 01 00 4c 00 01 00 4b 00 00 00 N...M...L...K... 8e76: 4b 00 01 00 4a 00 01 00 49 00 01 00 48 00 00 00 K...J...I...H... 8e86: 48 00 01 00 47 00 01 00 46 00 00 00 46 00 01 00 H...G...F...F... 8e96: 45 00 00 00 45 00 01 00 44 00 01 00 43 00 00 00 E...E...D...C... 8ea6: 43 00 01 00 42 00 00 00 42 00 01 00 41 00 00 00 C...B...B...A... 8eb6: 41 00 01 00 40 00 01 00 3f 00 00 00 3f 00 01 00 A...@...?...?... 8ec6: 3e 00 00 00 3e 00 01 00 3d 00 00 00 3d 00 01 00 >...>...=...=... 8ed6: 3c 00 00 00 3c 00 00 00 3c 00 01 00 3b 00 00 00 <...<...<...;... 8ee6: 3b 00 01 00 3a 00 00 00 3a 00 01 00 39 00 00 00 ;...:...:...9... 8ef6: 39 00 01 00 38 00 00 00 38 00 00 00 38 00 01 00 9...8...8...8... 8f06: 37 00 00 00 37 00 01 00 36 00 00 00 36 00 00 00 7...7...6...6... 8f16: 36 00 01 00 35 00 00 00 35 00 00 00 35 00 01 00 6...5...5...5... 8f26: 34 00 00 00 34 00 00 00 34 00 01 00 33 00 00 00 4...4...4...3... 8f36: 33 00 00 00 33 00 01 00 32 00 00 00 32 00 00 00 3...3...2...2... 8f46: 32 00 01 00 31 00 00 00 31 00 00 00 31 00 01 00 2...1...1...1... 8f56: 30 00 00 00 30 00 00 00 30 00 01 00 2f 00 00 00 0...0...0.../... 8f66: 2f 00 00 00 2f 00 00 00 2f 00 01 00 2e 00 00 00 /.../.../....... 8f76: 2e 00 00 00 2e 00 01 00 2d 00 00 00 2d 00 00 00 ........-...-... 8f86: 2d 00 00 00 2d 00 01 00 2c 00 00 00 2c 00 00 00 -...-...,...,... 8f96: 2c 00 00 00 2c 00 01 00 2b 00 00 00 2b 00 00 00 ,...,...+...+... 8fa6: 2b 00 00 00 2b 00 01 00 2a 00 00 00 2a 00 00 00 +...+...*...*... 8fb6: 2a 00 00 00 2a 00 01 00 29 00 00 00 29 00 00 00 *...*...)...)... 8fc6: 29 00 00 00 29 00 00 00 29 00 01 00 28 00 00 00 )...)...)...(... 8fd6: 28 00 00 00 28 00 00 00 28 00 00 00 28 00 01 00 (...(...(...(... 8fe6: 27 00 00 00 27 00 00 00 27 00 00 00 27 00 00 00 '...'...'...'... 8ff6: 27 00 01 00 26 00 00 00 26 00 00 00 26 00 00 00 '...&...&...&... 9006: 26 00 00 00 26 00 01 00 25 00 00 00 25 00 00 00 &...&...%...%... 9016: 25 00 00 00 25 00 00 00 25 00 00 00 25 00 01 00 %...%...%...%... 9026: 24 00 00 00 24 00 00 00 24 00 00 00 24 00 00 00 $...$...$...$... 9036: 24 00 01 00 23 00 00 00 23 00 00 00 23 00 00 00 $...#...#...#... 9046: 23 00 00 00 23 00 00 00 23 00 00 00 23 00 01 00 #...#...#...#... 9056: 22 00 00 00 22 00 00 00 22 00 00 00 22 00 00 00 "..."..."..."... 9066: 22 00 00 00 22 00 01 00 21 00 00 00 21 00 00 00 "..."...!...!... 9076: 21 00 00 00 21 00 00 00 21 00 00 00 21 00 00 00 !...!...!...!... 9086: 21 00 01 00 20 00 00 00 20 00 00 00 20 00 00 00 !... ... ... ... 9096: 20 00 00 00 20 00 00 00 20 00 00 00 20 00 00 00 ... ... ... ... 90a6: 20 00 01 00 1f 00 00 00 1f 00 00 00 1f 00 00 00 ............... 90b6: 1f 00 00 00 1f 00 00 00 1f 00 00 00 1f 00 01 00 ................ 90c6: 1e 00 00 00 1e 00 00 00 1e 00 00 00 1e 00 00 00 ................ 000090d6 : 90d6: 45 30 3a 20 00 E0: . 000090db : 90db: 5a 3a 20 00 Z: . 000090df : 90df: 59 3a 20 00 Y: . 000090e3 : 90e3: 58 3a 20 00 X: . 000090e7 : 90e7: 4d 53 31 2c 4d 53 32 20 50 69 6e 73 00 MS1,MS2 Pins. 000090f4 <_ZZ12PID_autotunefiiE3__c__16_>: 90f4: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 69 6e PID Autotune fin 9104: 69 73 68 65 64 21 20 50 75 74 20 74 68 65 20 6c ished! Put the l 9114: 61 73 74 20 4b 70 2c 20 4b 69 20 61 6e 64 20 4b ast Kp, Ki and K 9124: 64 20 63 6f 6e 73 74 61 6e 74 73 20 66 72 6f 6d d constants from 9134: 20 61 62 6f 76 65 20 69 6e 74 6f 20 43 6f 6e 66 above into Conf 9144: 69 67 75 72 61 74 69 6f 6e 2e 68 00 iguration.h. 00009150 <_ZZ12PID_autotunefiiE3__c__15_>: 9150: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9160: 6c 65 64 21 20 74 69 6d 65 6f 75 74 00 led! timeout. 0000916d <_ZZ12PID_autotunefiiE3__c__14_>: 916d: 20 40 3a 00 @:. 00009171 <_ZZ12PID_autotunefiiE3__c__13_>: 9171: 54 3a 00 T:. 00009174 <_ZZ12PID_autotunefiiE3__c__12_>: 9174: 42 3a 00 B:. 00009177 <_ZZ12PID_autotunefiiE3__c__11_>: 9177: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9187: 6c 65 64 21 20 54 65 6d 70 65 72 61 74 75 72 65 led! Temperature 9197: 20 74 6f 6f 20 68 69 67 68 00 too high. 000091a1 <_ZZ12PID_autotunefiiE3__c__10_>: 91a1: 20 4b 64 3a 20 00 Kd: . 000091a7 : 91a7: 20 4b 69 3a 20 00 Ki: . 000091ad : 91ad: 20 4b 70 3a 20 00 Kp: . 000091b3 : 91b3: 20 43 6c 61 73 73 69 63 20 50 49 44 20 00 Classic PID . 000091c1 : 91c1: 20 54 75 3a 20 00 Tu: . 000091c7 : 91c7: 20 4b 75 3a 20 00 Ku: . 000091cd : 91cd: 20 6d 61 78 3a 20 00 max: . 000091d4 : 91d4: 20 6d 69 6e 3a 20 00 min: . 000091db : 91db: 20 64 3a 20 00 d: . 000091e0 : 91e0: 20 62 69 61 73 3a 20 00 bias: . 000091e8 : 91e8: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 73 74 61 PID Autotune sta 91f8: 72 74 00 rt. 000091fb : 91fb: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 920b: 6c 65 64 2e 20 42 61 64 20 65 78 74 72 75 64 65 led. Bad extrude 921b: 72 20 6e 75 6d 62 65 72 2e 00 r number.. 00009225 : 9225: 48 6f 74 65 6e 64 20 66 61 6e 20 73 70 65 65 64 Hotend fan speed 9235: 20 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 is lower than e 9245: 78 70 65 63 74 65 64 00 xpected. 0000924d : 924d: 50 72 69 6e 74 20 66 61 6e 20 73 70 65 65 64 20 Print fan speed 925d: 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 78 is lower than ex 926d: 70 65 63 74 65 64 00 pected. 00009274 : 9274: 4d 49 4e 54 45 4d 50 20 42 45 44 00 MINTEMP BED. 00009280 : 9280: 4d 49 4e 54 45 4d 50 00 MINTEMP. 00009288 : 9288: 4d 41 58 54 45 4d 50 00 MAXTEMP. 00009290 : 9290: 4d 41 58 54 45 4d 50 20 42 45 44 00 MAXTEMP BED. 0000929c : 929c: 70 01 2c 01 90 01 27 01 b0 01 22 01 c0 01 1d 01 p.,...'..."..... 92ac: f0 01 18 01 10 02 13 01 30 02 0e 01 60 02 09 01 ........0...`... 92bc: 90 02 04 01 c0 02 ff 00 00 03 fa 00 40 03 f5 00 ............@... 92cc: 80 03 f0 00 d0 03 eb 00 20 04 e6 00 70 04 e1 00 ........ ...p... 92dc: e0 04 dc 00 40 05 d7 00 c0 05 d2 00 40 06 cd 00 ....@.......@... 92ec: d0 06 c8 00 80 07 c3 00 30 08 be 00 f0 08 b9 00 ........0....... 92fc: c0 09 b4 00 b0 0a af 00 b0 0b aa 00 d0 0c a5 00 ................ 930c: 00 0e a0 00 50 0f 9b 00 c0 10 96 00 50 12 91 00 ....P.......P... 931c: 00 14 8c 00 c0 15 87 00 b0 17 82 00 b0 19 7d 00 ..............}. 932c: d0 1b 78 00 00 1e 73 00 40 20 6e 00 90 22 69 00 ..x...s.@ n.."i. 933c: f0 24 64 00 40 27 5f 00 90 29 5a 00 e0 2b 55 00 .$d.@'_..)Z..+U. 934c: 10 2e 50 00 20 30 4b 00 10 32 46 00 e0 33 41 00 ..P. 0K..2F..3A. 935c: 90 35 3c 00 10 37 37 00 70 38 32 00 a0 39 2d 00 .5<..77.p82..9-. 936c: b0 3a 28 00 a0 3b 23 00 60 3c 1e 00 10 3d 19 00 .:(..;#.`<...=.. 937c: 90 3d 14 00 10 3e 0f 00 70 3e 0a 00 c0 3e 05 00 .=...>..p>...>.. 938c: 00 3f 00 00 .?.. 00009390 : 9390: 20 48 4f 54 45 4e 44 20 54 48 45 52 4d 41 4c 20 HOTEND THERMAL 93a0: 52 55 4e 41 57 41 59 00 RUNAWAY. 000093a8 : 93a8: 20 48 45 41 54 42 45 44 20 54 48 45 52 4d 41 4c HEATBED THERMAL 93b8: 20 52 55 4e 41 57 41 59 00 RUNAWAY. 000093c1 : 93c1: 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 00 THERMAL RUNAWAY. 000093d1 : 93d1: 42 45 44 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 BED THERMAL RUNA 93e1: 57 41 59 00 WAY. 000093e5 : 93e5: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 93f5: 20 28 50 52 45 48 45 41 54 20 48 4f 54 45 4e 44 (PREHEAT HOTEND 9405: 29 00 ). 00009407 : 9407: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 9417: 20 28 50 52 45 48 45 41 54 20 48 45 41 54 42 45 (PREHEAT HEATBE 9427: 44 29 00 D). 0000942a : 942a: 50 52 45 48 45 41 54 20 45 52 52 4f 52 00 PREHEAT ERROR. 00009438 : 9438: 42 45 44 20 50 52 45 48 45 41 54 20 45 52 52 4f BED PREHEAT ERRO 9448: 52 00 R. 0000944a : 944a: 20 74 72 69 67 67 65 72 65 64 21 00 triggered!. 00009456 : 9456: 48 65 61 74 65 72 73 20 73 77 69 74 63 68 65 64 Heaters switched 9466: 20 6f 66 66 2e 20 00 off. . 0000946d : 946d: 3a 20 00 : . 00009470 : 9470: 45 72 72 3a 20 00 Err: . 00009476 : 9476: 00 ff 01 02 01 00 02 ff ff fe 00 01 fe 01 ff 00 ................ 00009486 : 9486: 50 6c 65 61 73 65 20 72 65 73 74 61 72 74 00 Please restart. 00009495 <__vector_51::__c>: 9495: 55 53 41 52 54 32 20 72 78 20 46 75 6c 6c 21 21 USART2 rx Full!! 94a5: 21 00 !. 000094a7 : 94a7: 3a 20 00 : . 000094aa : 94aa: 25 2d 31 32 2e 31 32 53 25 2d 64 2f 36 00 %-12.12S%-d/6. 000094b8 : 94b8: 25 33 64 2f 25 2d 33 64 00 %3d/%-3d. 000094c1 : 94c1: 20 3a 20 00 : . 000094c5 : 94c5: 25 33 53 00 %3S. 000094c9 : 94c9: 25 2d 37 73 00 %-7s. 000094ce : 94ce: 25 2d 31 35 2e 31 35 53 25 2d 35 64 0a 25 2d 31 %-15.15S%-5d.%-1 94de: 35 2e 31 35 53 25 2d 35 64 0a 00 5.15S%-5d.. 000094e9 : 94e9: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d 94f9: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 . %-16.16S%-3d. 00009508 : 9508: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d 9518: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. 9528: 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 %-16.16S%-3d. 00009535 : 9535: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d 9545: 0a 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 .%S. %-16.16S%-3 9555: 64 0a 00 d.. 00009558 : 9558: 20 25 73 25 33 64 81 20 0a 00 %s%3d. .. 00009562 : 9562: 25 75 2e 25 75 2e 25 75 2e 25 75 00 %u.%u.%u.%u. 0000956e <_ZZL16lcd_support_menuvE3__c__15_>: 956e: 20 00 . 00009570 <_ZZL16lcd_support_menuvE3__c__14_>: 9570: 20 00 . 00009572 <_ZZL16lcd_support_menuvE3__c__13_>: 9572: 46 6c 61 73 68 41 69 72 20 49 50 20 41 64 64 72 FlashAir IP Addr 9582: 3a 00 :. 00009584 <_ZZL16lcd_support_menuvE3__c__12_>: 9584: 4d 4d 55 20 20 20 20 20 20 20 20 4e 2f 41 00 MMU N/A. 00009593 <_ZZL16lcd_support_menuvE3__c__11_>: 9593: 25 64 2e 25 64 2e 25 64 00 %d.%d.%d. 0000959c <_ZZL16lcd_support_menuvE3__c__10_>: 959c: 20 46 57 3a 00 FW:. 000095a1 : 95a1: 32 30 32 35 2d 30 34 2d 32 32 00 2025-04-22. 000095ac : 95ac: 45 33 44 76 36 66 75 6c 6c 00 E3Dv6full. 000095b6 : 95b6: 52 41 4d 42 6f 31 30 61 00 RAMBo10a. 000095bf : 95bf: 31 5f 37 35 6d 6d 5f 4d 4b 32 35 53 00 1_75mm_MK25S. 000095cc : 95cc: 20 48 61 73 68 3a 37 37 33 31 30 32 34 65 64 00 Hash:7731024ed. 000095dc : 95dc: 20 52 65 70 6f 3a 70 72 75 73 61 33 64 00 Repo:prusa3d. 000095ea : 95ea: 20 33 2e 31 34 2e 31 2d 38 32 37 39 00 3.14.1-8279. 000095f7 : 95f7: 46 69 72 6d 77 61 72 65 3a 00 Firmware:. 00009601 : 9601: 3e 00 >. 00009603 <_ZZ24lcd_generic_preheat_menuvE3__c__20_>: 9603: 46 4c 45 58 20 2d 20 20 32 34 30 2f 35 30 00 FLEX - 240/50. 00009612 <_ZZ24lcd_generic_preheat_menuvE3__c__19_>: 9612: 46 4c 45 58 20 2d 20 20 32 34 30 00 FLEX - 240. 0000961e <_ZZ24lcd_generic_preheat_menuvE3__c__18_>: 961e: 50 50 20 20 20 2d 20 20 32 35 34 2f 31 30 30 00 PP - 254/100. 0000962e <_ZZ24lcd_generic_preheat_menuvE3__c__17_>: 962e: 50 50 20 20 20 2d 20 20 32 35 34 00 PP - 254. 0000963a <_ZZ24lcd_generic_preheat_menuvE3__c__16_>: 963a: 48 49 50 53 20 2d 20 20 32 32 30 2f 31 30 30 00 HIPS - 220/100. 0000964a <_ZZ24lcd_generic_preheat_menuvE3__c__15_>: 964a: 48 49 50 53 20 2d 20 20 32 32 30 00 HIPS - 220. 00009656 <_ZZ24lcd_generic_preheat_menuvE3__c__14_>: 9656: 41 42 53 20 20 2d 20 20 32 35 35 2f 31 30 30 00 ABS - 255/100. 00009666 <_ZZ24lcd_generic_preheat_menuvE3__c__13_>: 9666: 41 42 53 20 20 2d 20 20 32 35 35 00 ABS - 255. 00009672 <_ZZ24lcd_generic_preheat_menuvE3__c__12_>: 9672: 50 41 20 20 20 2d 20 20 32 37 35 2f 39 30 00 PA - 275/90. 00009681 <_ZZ24lcd_generic_preheat_menuvE3__c__11_>: 9681: 50 41 20 20 20 2d 20 20 32 37 35 00 PA - 275. 0000968d <_ZZ24lcd_generic_preheat_menuvE3__c__10_>: 968d: 50 56 42 20 20 2d 20 20 32 31 35 2f 37 35 00 PVB - 215/75. 0000969c : 969c: 50 56 42 20 20 2d 20 20 32 31 35 00 PVB - 215. 000096a8 : 96a8: 50 43 20 20 20 2d 20 20 32 37 35 2f 31 30 35 00 PC - 275/105. 000096b8 : 96b8: 50 43 20 20 20 2d 20 20 32 37 35 00 PC - 275. 000096c4 : 96c4: 41 53 41 20 20 2d 20 20 32 36 30 2f 31 30 35 00 ASA - 260/105. 000096d4 : 96d4: 41 53 41 20 20 2d 20 20 32 36 30 00 ASA - 260. 000096e0 : 96e0: 50 45 54 20 20 2d 20 20 32 33 30 2f 38 35 00 PET - 230/85. 000096ef : 96ef: 50 45 54 20 20 2d 20 20 32 33 30 00 PET - 230. 000096fb : 96fb: 50 4c 41 20 20 2d 20 20 32 31 35 2f 36 30 00 PLA - 215/60. 0000970a : 970a: 50 4c 41 20 20 2d 20 20 32 31 35 00 PLA - 215. 00009716 : 9716: 6e 6f 7a 7a 6c 65 20 2d 20 20 32 35 30 2f 30 00 nozzle - 250/0. 00009726 : 9726: 66 61 72 6d 20 20 20 2d 20 20 32 35 30 2f 38 30 farm - 250/80 ... 00009737 : 9737: 25 2d 31 32 2e 31 32 53 25 2b 38 2e 31 66 00 %-12.12S%+8.1f. 00009746 : 9746: 45 78 74 72 75 64 65 72 3a 00 Extruder:. 00009750 : 9750: 25 63 25 31 37 2e 32 66 6d 6d 00 %c%17.2fmm. 0000975b : 975b: 58 3a 00 X:. 0000975e : 975e: 59 3a 00 Y:. 00009761 : 9761: 5a 3a 00 Z:. 00009764 : 9764: 25 63 25 2d 31 33 2e 31 33 53 25 2b 35 2e 33 66 %c%-13.13S%+5.3f ... 00009775 : 9775: 25 33 75 00 %3u. 00009779 : 9779: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio 9789: 6e 20 66 61 69 6c 65 64 2e 20 43 6f 6e 74 69 6e n failed. Contin 9799: 75 65 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 ue with pressing 97a9: 20 74 68 65 20 6b 6e 6f 62 2e 00 the knob.. 000097b4 : 97b4: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio 97c4: 6e 20 64 6f 6e 65 2e 20 43 6f 6e 74 69 6e 75 65 n done. Continue 97d4: 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 20 74 with pressing t 97e4: 68 65 20 6b 6e 6f 62 2e 00 he knob.. 000097ed : 97ed: 5a 30 00 Z0. 000097f0 : 97f0: 5a 31 00 Z1. 000097f3 : 97f3: 59 30 00 Y0. 000097f6 : 97f6: 59 31 00 Y1. 000097f9 : 97f9: 58 30 00 X0. 000097fc : 97fc: 58 31 00 X1. 000097ff : 97ff: 45 6e 64 20 73 74 6f 70 73 20 64 69 61 67 00 End stops diag. 0000980e : 980e: 47 38 30 00 G80. 00009812 : 9812: 4d 34 35 00 M45. 00009816 : 9816: 4d 34 35 20 5a 00 M45 Z. 0000981c : 981c: 47 37 36 00 G76. 00009820 : 9820: 4d 37 30 31 20 50 30 00 M701 P0. 00009828 : 9828: 57 69 7a 61 72 64 20 73 74 61 74 65 3a 20 25 64 Wizard state: %d 9838: 0a 00 .. 0000983a : 983a: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 32 20 63 xyzcal_spiral2 c 984a: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d 985a: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d 986a: 20 61 64 3d 25 64 0a 00 ad=%d.. 00009872 <_ZL4endl.lto_priv.365>: 9872: 0a 00 .. 00009874 : 9874: 43 6f 75 6e 74 64 6f 77 6e 3a 20 25 64 20 00 Countdown: %d . 00009883 : 9883: 25 64 0a 00 %d.. 00009887 : 9887: 53 63 61 6e 20 63 6f 75 6e 74 64 6f 77 6e 3a 20 Scan countdown: ... 00009898 : 9898: 50 61 74 74 65 72 6e 20 63 65 6e 74 65 72 20 5b Pattern center [ 98a8: 25 66 20 25 66 5d 2c 20 6d 61 74 63 68 20 25 66 %f %f], match %f 98b8: 25 25 0a 00 %%.. 000098bc : 98bc: 20 5b 25 66 2c 20 25 66 5d 5b 25 66 5d 20 66 69 [%f, %f][%f] fi 98cc: 6e 61 6c 20 63 69 72 63 6c 65 0a 00 nal circle.. 000098d8 : 98d8: 00 00 a0 40 00 00 a0 40 00 00 00 40 ...@...@...@ 000098e4 : 98e4: 00 00 7a 43 00 00 56 43 9a d9 51 43 ..zC..VC..QC 000098f0 : 98f0: ff ff ff ... 000098f3 <_ZL16ramming_sequence.lto_priv.366>: 98f3: e0 2d 90 3e 89 88 b2 41 11 36 9c 3e 77 77 c1 41 .-.>...A.6.>ww.A 9903: 29 cb b0 3e ef ee da 41 ba 49 cc 3e ef ee fc 41 )..>...A.I.>...A 9913: 61 c3 f3 3e ef ee 16 42 9c a2 13 3f cd cc 36 42 a..>...B...?..6B 9923: 8a b0 11 3f ab aa 56 42 88 63 dd 3d ab aa 56 42 ...?..VB.c.=..VB 9933: b8 af 43 3f 55 55 72 42 18 26 53 3f 33 b3 82 42 ..C?UUrB.&S?3..B 9943: 30 2a 59 3f ef 6e 86 42 00 00 70 c1 00 00 c8 42 0*Y?.n.B..p....B 9953: 00 00 c4 c1 00 00 a0 41 00 00 e0 c0 00 00 20 41 .......A...... A 9963: 00 00 60 c0 00 00 c0 40 00 00 a0 41 22 22 f2 40 ..`....@...A"".@ 9973: 00 00 a0 c1 9a 99 a1 40 00 00 0c c2 55 55 05 42 .......@....UU.B 00009983 : 9983: 43 6f 6f 6c 69 6e 67 20 74 69 6d 65 72 20 73 74 Cooling timer st 9993: 6f 70 70 65 64 00 opped. 00009999 : 9999: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 00 Heater cooldown. 000099a9 : 99a9: 43 6f 6f 6c 69 6e 67 20 54 69 6d 65 6f 75 74 20 Cooling Timeout 99b9: 73 74 61 72 74 65 64 00 started. 000099c1 : 99c1: 53 61 76 69 6e 67 20 61 6e 64 20 70 61 72 6b 69 Saving and parki 99d1: 6e 67 00 ng. 000099d4 : 99d4: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 20 Heater cooldown 99e4: 70 65 6e 64 69 6e 67 00 pending. 000099ec : 99ec: 52 65 73 75 6d 69 6e 67 20 58 59 5a 00 Resuming XYZ. 000099f9 : 99f9: 57 72 69 74 69 6e 67 20 74 6f 20 66 69 6c 65 3a Writing to file: 9a09: 20 00 . 00009a0b : 9a0b: 46 69 6c 65 20 61 6c 72 65 61 64 79 20 6f 70 65 File already ope 9a1b: 6e 65 64 00 ned. 00009a1f : 9a1f: 6f 57 5e 57 4a 57 35 57 1f 57 0c 57 f6 56 e2 56 oW^WJW5W.W.W.V.V 9a2f: d1 56 bb 56 4a 57 5e 57 a7 56 98 56 84 56 73 56 .V.VJW^W.V.V.VsV 9a3f: 5e 56 02 5a 48 56 36 56 23 56 12 56 fd 55 ea 55 ^V.ZHV6V#V.V.U.U 9a4f: d6 55 c1 55 b8 55 a6 55 91 55 .U.U.U.U.U 00009a59 : 9a59: 4d 36 30 30 20 41 55 54 4f 00 M600 AUTO. 00009a63 : 9a63: 46 49 4e 44 41 20 66 69 6c 61 6d 65 6e 74 20 72 FINDA filament r 9a73: 75 6e 6f 75 74 21 00 unout!. 00009a7a : 9a7a: 43 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 20 74 69 Communication ti 9a8a: 6d 65 6f 75 74 00 meout. 00009a90 : 9a90: 50 72 6f 74 6f 63 6f 6c 20 45 72 72 6f 72 00 Protocol Error. 00009a9f : 9a9f: 03 00 03 ... 00009aa2 : 9aa2: 56 65 72 73 69 6f 6e 20 6d 69 73 6d 61 74 63 68 Version mismatch ... 00009ab3 : 9ab3: 43 6f 6d 6d 61 6e 64 20 45 72 72 6f 72 00 Command Error. 00009ac1 : 9ac1: 43 6f 6d 6d 61 6e 64 20 72 65 6a 65 63 74 65 64 Command rejected ... 00009ad2 : 9ad2: 4d 4d 55 20 42 75 74 74 6f 6e 20 70 75 73 68 65 MMU Button pushe 9ae2: 64 00 d. 00009ae4 : 9ae4: 52 65 74 72 79 42 75 74 74 6f 6e 50 72 65 73 73 RetryButtonPress 9af4: 65 64 00 ed. 00009af7 <_ZN4MMU2L11errorTitlesE.lto_priv.454>: 9af7: cc 59 b7 59 a0 59 8b 59 76 59 62 59 52 59 3b 59 .Y.Y.Y.YvYbYRY;Y 9b07: 24 59 0d 59 f9 58 e5 58 cf 58 cf 58 cf 58 ba 58 $Y.Y.X.X.X.X.X.X 9b17: ba 58 ba 58 a7 58 a7 58 a7 58 94 58 94 58 94 58 .X.X.X.X.X.X.X.X 9b27: 7d 58 7d 58 7d 58 68 58 68 58 68 58 52 58 52 58 }X}X}XhXhXhXRXRX 9b37: 52 58 42 58 2d 58 17 58 01 58 f2 57 e5 57 ce 57 RXBX-X.X.X.W.W.W 9b47: bb 57 a9 57 96 57 84 57 74 57 .W.W.W.WtW 00009b51 : 9b51: 42 75 74 74 6f 6e 00 Button. 00009b58 : 9b58: 43 68 65 63 6b 55 73 65 72 49 6e 70 75 74 2d 62 CheckUserInput-b 9b68: 74 6e 4c 4d 52 20 00 tnLMR . 00009b6f : 9b6f: 52 65 73 65 74 52 65 74 72 79 41 74 74 65 6d 70 ResetRetryAttemp 9b7f: 74 73 00 ts. 00009b82 <_ZZN4MMU231ReportErrorHookSensorLineRenderEvE3__c.lto_priv.453>: 9b82: 46 49 3a 20 20 46 53 3a 20 20 20 20 3e 20 20 82 FI: FS: > . 9b92: 20 20 20 81 00 .. 00009b97 : 9b97: 48 6f 74 65 6e 64 20 74 65 6d 70 65 72 61 74 75 Hotend temperatu 9ba7: 72 65 20 72 65 61 63 68 65 64 00 re reached. 00009bb2 : 9bb2: 52 65 73 75 6d 69 6e 67 20 54 65 6d 70 00 Resuming Temp. 00009bc0 : 9bc0: 43 6f 6f 6c 64 6f 77 6e 20 66 6c 61 67 20 63 6c Cooldown flag cl 9bd0: 65 61 72 65 64 00 eared. 00009bd6 : 9bd6: 20 57 3a 00 W:. 00009bda : 9bda: 20 45 3a 00 E:. 00009bde : 9bde: 54 3a 00 T:. 00009be1 : 9be1: 4e 6f 20 30 78 46 46 20 72 65 63 65 69 76 65 64 No 0xFF received ... 00009bf2 : 9bf2: 53 65 6e 64 69 6e 67 20 30 78 46 46 00 Sending 0xFF. 00009bff : 9bff: 46 69 6c 65 20 73 65 6c 65 63 74 65 64 00 File selected. 00009c0d : 9c0d: 20 53 69 7a 65 3a 20 00 Size: . 00009c15 : 9c15: 46 69 6c 65 20 6f 70 65 6e 65 64 3a 20 00 File opened: . 00009c23 : 9c23: 4e 6f 77 20 66 72 65 73 68 20 66 69 6c 65 3a 20 Now fresh file: ... 00009c34 : 9c34: 4e 6f 77 20 64 6f 69 6e 67 20 66 69 6c 65 3a 20 Now doing file: ... 00009c45 : 9c45: 22 20 70 6f 73 00 " pos. 00009c4b : 9c4b: 22 20 70 61 72 65 6e 74 3a 22 00 " parent:". 00009c56 : 9c56: 53 55 42 52 4f 55 54 49 4e 45 20 43 41 4c 4c 20 SUBROUTINE CALL 9c66: 74 61 72 67 65 74 3a 22 00 target:". 00009c6f : 9c6f: 74 72 79 69 6e 67 20 74 6f 20 63 61 6c 6c 20 73 trying to call s 9c7f: 75 62 2d 67 63 6f 64 65 20 66 69 6c 65 73 20 77 ub-gcode files w 9c8f: 69 74 68 20 74 6f 6f 20 6d 61 6e 79 20 6c 65 76 ith too many lev 9c9f: 65 6c 73 2e 00 els.. 00009ca4 : 9ca4: 20 22 25 73 22 00 "%s". 00009caa : 9caa: 20 25 23 6c 78 00 %#lx. 00009cb0 : 9cb0: 44 49 52 5f 45 58 49 54 00 DIR_EXIT. 00009cb9 : 9cb9: 44 49 52 5f 45 4e 54 45 52 3a 20 25 73 20 22 25 DIR_ENTER: %s "% 9cc9: 73 22 0a 00 s".. 00009ccd : 9ccd: 61 75 74 6f 25 69 2e 67 00 auto%i.g. 00009cd6 : 9cd6: 04 1a .. 00009cd8 : 9cd8: 44 65 63 72 65 6d 65 6e 74 52 65 74 72 79 41 74 DecrementRetryAt 9ce8: 74 65 6d 70 74 73 00 tempts. 00009cef : 9cef: 08 1b 1c ... 00009cf2 : 9cf2: 0b 14 .. 00009cf4 : 9cf4: 52 53 54 43 6f 6d 6d 54 69 6d 65 6f 75 74 00 RSTCommTimeout. 00009d03 : 9d03: 2c 20 6c 61 73 74 20 62 79 74 65 73 3a 20 00 , last bytes: . 00009d12 <_ZL10bufferFull.lto_priv.518>: 9d12: 22 20 66 61 69 6c 65 64 3a 20 42 75 66 66 65 72 " failed: Buffer 9d22: 20 66 75 6c 6c 21 00 full!. 00009d29 : 9d29: 22 00 ". 00009d2b : 9d2b: 45 6e 71 75 65 69 6e 67 20 74 6f 20 74 68 65 20 Enqueing to the 9d3b: 66 72 6f 6e 74 3a 20 22 00 front: ". 00009d44 : 9d44: 45 72 72 6f 72 3a 00 Error:. 00009d4b : 9d4b: 4d 4d 55 32 74 6f 6f 6c 3d 00 MMU2tool=. 00009d55 <_ZL9mmu2Magic.lto_priv.348>: 9d55: 4d 4d 55 32 3a 00 MMU2:. 00009d5b <_ZL9mmu2Magic.lto_priv.349>: 9d5b: 4d 4d 55 32 3a 00 MMU2:. 00009d61 : 9d61: 65 63 68 6f 3a 00 echo:. 00009d67 : 9d67: 3e 53 30 2a 63 36 2e 00 >S0*c6.. 00009d6f : 9d6f: 4d 4d 55 20 69 73 20 00 MMU is . 00009d77 : 9d77: 25 2e 31 30 53 20 00 %.10S . 00009d7e : 9d7e: 25 34 64 00 %4d. 00009d82 : 9d82: 45 78 72 65 6d 65 20 73 70 61 6e 20 6f 66 20 74 Exreme span of t 9d92: 68 65 20 5a 20 76 61 6c 75 65 73 21 00 he Z values!. 00009d9f : 9d9f: 25 64 2f 39 00 %d/9. 00009da4 : 9da4: 4d 4d 55 32 3a 00 MMU2:. 00009daa : 9daa: 25 33 64 00 %3d. 00009dae : 9dae: 18 01 04 19 02 0a ...... 00009db4 : 9db4: 92 61 1c 61 a2 60 35 60 ec 5f 5a 5f e2 5e 7a 5e .a.a.`5`._Z_.^z^ 9dc4: 2b 5e 0b 5e bf 5d 0b 5e a8 5d a8 5d a8 5d a8 5d +^.^.].^.].].].] 9dd4: a8 5d a8 5d a8 5d a8 5d a8 5d a8 5d a8 5d a8 5d .].].].].].].].] 9de4: a8 5d a8 5d a8 5d a8 5d a8 5d a8 5d a8 5d a8 5d .].].].].].].].] 9df4: a8 5d a8 5d 71 5d 30 5d e6 5c 73 5c 3e 5c f4 5b .].]q]0].\s\>\.[ 9e04: aa 5b 4c 5b 13 5b d1 5a b4 5a .[L[.[.Z.Z 00009e0e : 9e0e: 01 01 01 01 01 01 01 02 71 01 71 01 32 32 32 03 ........q.q.222. 9e1e: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 ................ 9e2e: 03 03 93 93 24 38 03 93 03 01 02 56 03 ....$8.....V. 00009e3b : 9e3b: 65 00 66 00 67 00 68 00 69 00 6a 00 6b 00 6c 00 e.f.g.h.i.j.k.l. 9e4b: 73 00 74 00 7d 00 7e 00 c9 00 d3 00 dd 00 ca 00 s.t.}.~......... 9e5b: d4 00 de 00 2d 01 37 01 41 01 2e 01 38 01 42 01 ....-.7.A...8.B. 9e6b: 2f 01 39 01 43 01 30 01 3a 01 44 01 31 01 3b 01 /.9.C.0.:.D.1.;. 9e7b: 45 01 32 01 91 01 92 01 f5 01 f6 01 f7 01 f8 01 E.2............. 9e8b: f9 01 fa 01 fb 01 fc 01 84 03 .......... 00009e95 : 9e95: 1f 62 88 62 14 62 0b 62 04 62 8a 4a ff 3c fd 61 .b.b.b.b.b.J.<.a 9ea5: f3 61 .a 00009ea7 : 9ea7: 25 2e 32 30 53 0a 70 72 75 73 61 2e 69 6f 2f 30 %.20S.prusa.io/0 9eb7: 34 25 68 75 00 4%hu. 00009ebc : 9ebc: 7b 5b 45 52 52 3a 00 {[ERR:. 00009ec3 <_ZL14FW_VERSION_STR.lto_priv.501>: 9ec3: 33 2e 31 34 2e 31 00 3.14.1. 00009eca : 9eca: 5d 5b 46 57 52 3a 00 ][FWR:. 00009ed1 : 9ed1: 5d 5b 54 49 4d 3a 00 ][TIM:. 00009ed8 : 9ed8: 5d 5b 46 4e 4d 3a 00 ][FNM:. 00009edf : 9edf: 5d 5b 46 45 4d 3a 00 ][FEM:. 00009ee6 : 9ee6: 5d 5b 50 43 44 3a 00 ][PCD:. 00009eed : 9eed: 5b 54 46 55 3a 00 [TFU:. 00009ef3 : 9ef3: 5b 50 52 4e 3a 00 [PRN:. 00009ef9 : 9ef9: 5b 50 46 4e 3a 30 5d 00 [PFN:0]. 00009f01 : 9f01: 5b 44 49 41 3a 00 [DIA:. 00009f07 : 9f07: 5d 5b 41 54 42 3a 00 ][ATB:. 00009f0e : 9f0e: 5d 5b 41 54 30 3a 00 ][AT0:. 00009f15 : 9f15: 5d 5b 53 54 42 3a 00 ][STB:. 00009f1c : 9f1c: 5b 53 54 30 3a 00 [ST0:. 00009f22 : 9f22: 7b 5b 50 52 4e 3a 35 5d 00 {[PRN:5]. 00009f2b : 9f2b: 7b 5b 50 52 4e 3a 30 5d 00 {[PRN:0]. 00009f34 : 9f34: 7b 5b 50 52 4e 3a 39 5d 00 {[PRN:9]. 00009f3d : 9f3d: 7b 5b 50 52 4e 3a 38 5d 00 {[PRN:8]. 00009f46 : 9f46: 7b 5b 52 45 53 3a 30 5d 5b 46 49 4c 3a 00 {[RES:0][FIL:. 00009f54 : 9f54: 7b 5b 52 45 53 3a 31 5d 5b 46 49 4c 3a 00 {[RES:1][FIL:. 00009f62 : 9f62: 00 00 21 10 42 20 63 30 84 40 a5 50 c6 60 e7 70 ..!.B c0.@.P.`.p 9f72: 08 81 29 91 4a a1 6b b1 8c c1 ad d1 ce e1 ef f1 ..).J.k......... 9f82: 31 12 10 02 73 32 52 22 b5 52 94 42 f7 72 d6 62 1...s2R".R.B.r.b 9f92: 39 93 18 83 7b b3 5a a3 bd d3 9c c3 ff f3 de e3 9...{.Z......... 9fa2: 62 24 43 34 20 04 01 14 e6 64 c7 74 a4 44 85 54 b$C4 ....d.t.D.T 9fb2: 6a a5 4b b5 28 85 09 95 ee e5 cf f5 ac c5 8d d5 j.K.(........... 9fc2: 53 36 72 26 11 16 30 06 d7 76 f6 66 95 56 b4 46 S6r&..0..v.f.V.F 9fd2: 5b b7 7a a7 19 97 38 87 df f7 fe e7 9d d7 bc c7 [.z...8......... 9fe2: c4 48 e5 58 86 68 a7 78 40 08 61 18 02 28 23 38 .H.X.h.x@.a..(#8 9ff2: cc c9 ed d9 8e e9 af f9 48 89 69 99 0a a9 2b b9 ........H.i...+. a002: f5 5a d4 4a b7 7a 96 6a 71 1a 50 0a 33 3a 12 2a .Z.J.z.jq.P.3:.* a012: fd db dc cb bf fb 9e eb 79 9b 58 8b 3b bb 1a ab ........y.X.;... a022: a6 6c 87 7c e4 4c c5 5c 22 2c 03 3c 60 0c 41 1c .l.|.L.\",.<`.A. a032: ae ed 8f fd ec cd cd dd 2a ad 0b bd 68 8d 49 9d ........*...h.I. a042: 97 7e b6 6e d5 5e f4 4e 13 3e 32 2e 51 1e 70 0e .~.n.^.N.>2.Q.p. a052: 9f ff be ef dd df fc cf 1b bf 3a af 59 9f 78 8f ..........:.Y.x. a062: 88 91 a9 81 ca b1 eb a1 0c d1 2d c1 4e f1 6f e1 ..........-.N.o. a072: 80 10 a1 00 c2 30 e3 20 04 50 25 40 46 70 67 60 .....0. .P%@Fpg` a082: b9 83 98 93 fb a3 da b3 3d c3 1c d3 7f e3 5e f3 ........=.....^. a092: b1 02 90 12 f3 22 d2 32 35 42 14 52 77 62 56 72 .....".25B.RwbVr a0a2: ea b5 cb a5 a8 95 89 85 6e f5 4f e5 2c d5 0d c5 ........n.O.,... a0b2: e2 34 c3 24 a0 14 81 04 66 74 47 64 24 54 05 44 .4.$....ftGd$T.D a0c2: db a7 fa b7 99 87 b8 97 5f e7 7e f7 1d c7 3c d7 ........_.~...<. a0d2: d3 26 f2 36 91 06 b0 16 57 66 76 76 15 46 34 56 .&.6....Wfvv.F4V a0e2: 4c d9 6d c9 0e f9 2f e9 c8 99 e9 89 8a b9 ab a9 L.m.../......... a0f2: 44 58 65 48 06 78 27 68 c0 18 e1 08 82 38 a3 28 DXeH.x'h.....8.( a102: 7d cb 5c db 3f eb 1e fb f9 8b d8 9b bb ab 9a bb }.\.?........... a112: 75 4a 54 5a 37 6a 16 7a f1 0a d0 1a b3 2a 92 3a uJTZ7j.z.....*.: a122: 2e fd 0f ed 6c dd 4d cd aa bd 8b ad e8 9d c9 8d ....l.M......... a132: 26 7c 07 6c 64 5c 45 4c a2 3c 83 2c e0 1c c1 0c &|.ld\EL.<.,.... a142: 1f ef 3e ff 5d cf 7c df 9b af ba bf d9 8f f8 9f ..>.].|......... a152: 17 6e 36 7e 55 4e 74 5e 93 2e b2 3e d1 0e f0 1e .n6~UNt^...>.... 0000a162 : a162: 7c 3c 3e 3f 2f 2a 22 5c 00 00 |<>?/*"\.. 0000a16c <__ctors_start>: a16c: c5 36 cpi r28, 0x65 ; 101 0000a16e <__ctors_end>: a16e: 57 5e subi r21, 0xE7 ; 231 0000a170 <__dtors_end>: a170: 11 24 eor r1, r1 a172: 1f be out 0x3f, r1 ; 63 a174: cf ef ldi r28, 0xFF ; 255 a176: d1 e2 ldi r29, 0x21 ; 33 a178: de bf out 0x3e, r29 ; 62 a17a: cd bf out 0x3d, r28 ; 61 a17c: 00 e0 ldi r16, 0x00 ; 0 a17e: 0c bf out 0x3c, r16 ; 60 0000a180 <__do_copy_data>: a180: 13 e0 ldi r17, 0x03 ; 3 a182: a0 e0 ldi r26, 0x00 ; 0 a184: b2 e0 ldi r27, 0x02 ; 2 a186: e0 e5 ldi r30, 0x50 ; 80 a188: fd e4 ldi r31, 0x4D ; 77 a18a: 03 e0 ldi r16, 0x03 ; 3 a18c: 0b bf out 0x3b, r16 ; 59 a18e: 02 c0 rjmp .+4 ; 0xa194 <__do_copy_data+0x14> a190: 07 90 elpm r0, Z+ a192: 0d 92 st X+, r0 a194: a4 30 cpi r26, 0x04 ; 4 a196: b1 07 cpc r27, r17 a198: d9 f7 brne .-10 ; 0xa190 <__do_copy_data+0x10> 0000a19a <__do_clear_bss>: a19a: 27 e1 ldi r18, 0x17 ; 23 a19c: a4 e0 ldi r26, 0x04 ; 4 a19e: b3 e0 ldi r27, 0x03 ; 3 a1a0: 01 c0 rjmp .+2 ; 0xa1a4 <.do_clear_bss_start> 0000a1a2 <.do_clear_bss_loop>: a1a2: 1d 92 st X+, r1 0000a1a4 <.do_clear_bss_start>: a1a4: a4 30 cpi r26, 0x04 ; 4 a1a6: b2 07 cpc r27, r18 a1a8: e1 f7 brne .-8 ; 0xa1a2 <.do_clear_bss_loop> 0000a1aa <__do_global_ctors>: a1aa: 10 e5 ldi r17, 0x50 ; 80 a1ac: c7 eb ldi r28, 0xB7 ; 183 a1ae: d0 e5 ldi r29, 0x50 ; 80 a1b0: 00 e0 ldi r16, 0x00 ; 0 a1b2: 06 c0 rjmp .+12 ; 0xa1c0 <__do_global_ctors+0x16> a1b4: 21 97 sbiw r28, 0x01 ; 1 a1b6: 01 09 sbc r16, r1 a1b8: 80 2f mov r24, r16 a1ba: fe 01 movw r30, r28 a1bc: 0f 94 ec a0 call 0x341d8 ; 0x341d8 <__tablejump2__> a1c0: c6 3b cpi r28, 0xB6 ; 182 a1c2: d1 07 cpc r29, r17 a1c4: 80 e0 ldi r24, 0x00 ; 0 a1c6: 08 07 cpc r16, r24 a1c8: a9 f7 brne .-22 ; 0xa1b4 <__do_global_ctors+0xa> a1ca: 0e 94 9f d8 call 0x1b13e ; 0x1b13e
a1ce: 0d 94 96 a6 jmp 0x34d2c ; 0x34d2c <__do_global_dtors> 0000a1d2 <__bad_interrupt>: a1d2: 0c 94 bb 74 jmp 0xe976 ; 0xe976 <__vector_default> 0000a1d6 : a1d6: 2f 92 push r2 a1d8: 3f 92 push r3 a1da: 4f 92 push r4 a1dc: 5f 92 push r5 a1de: 6f 92 push r6 a1e0: 7f 92 push r7 a1e2: 8f 92 push r8 a1e4: 9f 92 push r9 a1e6: af 92 push r10 a1e8: bf 92 push r11 a1ea: cf 92 push r12 a1ec: df 92 push r13 a1ee: ef 92 push r14 a1f0: ff 92 push r15 a1f2: 0f 93 push r16 a1f4: 1f 93 push r17 a1f6: cf 93 push r28 a1f8: df 93 push r29 a1fa: cd b7 in r28, 0x3d ; 61 a1fc: de b7 in r29, 0x3e ; 62 a1fe: 2f 97 sbiw r28, 0x0f ; 15 a200: 0f b6 in r0, 0x3f ; 63 a202: f8 94 cli a204: de bf out 0x3e, r29 ; 62 a206: 0f be out 0x3f, r0 ; 63 a208: cd bf out 0x3d, r28 ; 61 a20a: 6c 01 movw r12, r24 a20c: 1b 01 movw r2, r22 a20e: 5a 01 movw r10, r20 a210: fc 01 movw r30, r24 a212: 17 82 std Z+7, r1 ; 0x07 a214: 16 82 std Z+6, r1 ; 0x06 a216: 83 81 ldd r24, Z+3 ; 0x03 a218: 9e 01 movw r18, r28 a21a: 2f 5f subi r18, 0xFF ; 255 a21c: 3f 4f sbci r19, 0xFF ; 255 a21e: 49 01 movw r8, r18 a220: 81 fd sbrc r24, 1 a222: d2 c0 rjmp .+420 ; 0xa3c8 a224: 8f ef ldi r24, 0xFF ; 255 a226: 9f ef ldi r25, 0xFF ; 255 a228: ee c2 rjmp .+1500 ; 0xa806 a22a: f1 2c mov r15, r1 a22c: 51 2c mov r5, r1 a22e: 00 e0 ldi r16, 0x00 ; 0 a230: 00 32 cpi r16, 0x20 ; 32 a232: 38 f4 brcc .+14 ; 0xa242 a234: 8b 32 cpi r24, 0x2B ; 43 a236: 09 f1 breq .+66 ; 0xa27a a238: 90 f4 brcc .+36 ; 0xa25e a23a: 80 32 cpi r24, 0x20 ; 32 a23c: f9 f0 breq .+62 ; 0xa27c a23e: 83 32 cpi r24, 0x23 ; 35 a240: 09 f1 breq .+66 ; 0xa284 a242: 07 fd sbrc r16, 7 a244: 34 c0 rjmp .+104 ; 0xa2ae a246: 20 ed ldi r18, 0xD0 ; 208 a248: 28 0f add r18, r24 a24a: 2a 30 cpi r18, 0x0A ; 10 a24c: 20 f5 brcc .+72 ; 0xa296 a24e: 06 ff sbrs r16, 6 a250: 1b c0 rjmp .+54 ; 0xa288 a252: fa e0 ldi r31, 0x0A ; 10 a254: ff 9e mul r15, r31 a256: 20 0d add r18, r0 a258: 11 24 eor r1, r1 a25a: f2 2e mov r15, r18 a25c: 05 c0 rjmp .+10 ; 0xa268 a25e: 8d 32 cpi r24, 0x2D ; 45 a260: 79 f0 breq .+30 ; 0xa280 a262: 80 33 cpi r24, 0x30 ; 48 a264: 71 f7 brne .-36 ; 0xa242 a266: 01 60 ori r16, 0x01 ; 1 a268: f1 01 movw r30, r2 a26a: 93 fd sbrc r25, 3 a26c: 85 91 lpm r24, Z+ a26e: 93 ff sbrs r25, 3 a270: 81 91 ld r24, Z+ a272: 1f 01 movw r2, r30 a274: 81 11 cpse r24, r1 a276: dc cf rjmp .-72 ; 0xa230 a278: 1a c0 rjmp .+52 ; 0xa2ae a27a: 02 60 ori r16, 0x02 ; 2 a27c: 04 60 ori r16, 0x04 ; 4 a27e: f4 cf rjmp .-24 ; 0xa268 a280: 08 60 ori r16, 0x08 ; 8 a282: f2 cf rjmp .-28 ; 0xa268 a284: 00 61 ori r16, 0x10 ; 16 a286: f0 cf rjmp .-32 ; 0xa268 a288: 3a e0 ldi r19, 0x0A ; 10 a28a: 53 9e mul r5, r19 a28c: 20 0d add r18, r0 a28e: 11 24 eor r1, r1 a290: 52 2e mov r5, r18 a292: 00 62 ori r16, 0x20 ; 32 a294: e9 cf rjmp .-46 ; 0xa268 a296: 8e 32 cpi r24, 0x2E ; 46 a298: 21 f4 brne .+8 ; 0xa2a2 a29a: 06 fd sbrc r16, 6 a29c: b1 c2 rjmp .+1378 ; 0xa800 a29e: 00 64 ori r16, 0x40 ; 64 a2a0: e3 cf rjmp .-58 ; 0xa268 a2a2: 8c 36 cpi r24, 0x6C ; 108 a2a4: 11 f4 brne .+4 ; 0xa2aa a2a6: 00 68 ori r16, 0x80 ; 128 a2a8: df cf rjmp .-66 ; 0xa268 a2aa: 88 36 cpi r24, 0x68 ; 104 a2ac: e9 f2 breq .-70 ; 0xa268 a2ae: 9b eb ldi r25, 0xBB ; 187 a2b0: 98 0f add r25, r24 a2b2: 93 30 cpi r25, 0x03 ; 3 a2b4: 08 f0 brcs .+2 ; 0xa2b8 a2b6: 5f c0 rjmp .+190 ; 0xa376 a2b8: 00 61 ori r16, 0x10 ; 16 a2ba: 80 5e subi r24, 0xE0 ; 224 a2bc: 06 fd sbrc r16, 6 a2be: 02 c0 rjmp .+4 ; 0xa2c4 a2c0: 46 e0 ldi r20, 0x06 ; 6 a2c2: f4 2e mov r15, r20 a2c4: 10 2f mov r17, r16 a2c6: 1f 73 andi r17, 0x3F ; 63 a2c8: 85 36 cpi r24, 0x65 ; 101 a2ca: 09 f0 breq .+2 ; 0xa2ce a2cc: 5b c0 rjmp .+182 ; 0xa384 a2ce: 10 64 ori r17, 0x40 ; 64 a2d0: 17 ff sbrs r17, 7 a2d2: 61 c0 rjmp .+194 ; 0xa396 a2d4: 8f 2d mov r24, r15 a2d6: 9b e3 ldi r25, 0x3B ; 59 a2d8: 9f 15 cp r25, r15 a2da: 08 f4 brcc .+2 ; 0xa2de a2dc: 8b e3 ldi r24, 0x3B ; 59 a2de: 44 24 eor r4, r4 a2e0: 43 94 inc r4 a2e2: 48 0e add r4, r24 a2e4: 27 e0 ldi r18, 0x07 ; 7 a2e6: 35 01 movw r6, r10 a2e8: f4 e0 ldi r31, 0x04 ; 4 a2ea: 6f 0e add r6, r31 a2ec: 71 1c adc r7, r1 a2ee: f5 01 movw r30, r10 a2f0: 60 81 ld r22, Z a2f2: 71 81 ldd r23, Z+1 ; 0x01 a2f4: 82 81 ldd r24, Z+2 ; 0x02 a2f6: 93 81 ldd r25, Z+3 ; 0x03 a2f8: 04 2d mov r16, r4 a2fa: a4 01 movw r20, r8 a2fc: 0f 94 95 9c call 0x3392a ; 0x3392a <__ftoa_engine> a300: 5c 01 movw r10, r24 a302: f9 81 ldd r31, Y+1 ; 0x01 a304: fc 87 std Y+12, r31 ; 0x0c a306: f0 ff sbrs r31, 0 a308: 03 c0 rjmp .+6 ; 0xa310 a30a: 0d e2 ldi r16, 0x2D ; 45 a30c: f3 ff sbrs r31, 3 a30e: 07 c0 rjmp .+14 ; 0xa31e a310: 0b e2 ldi r16, 0x2B ; 43 a312: 11 fd sbrc r17, 1 a314: 04 c0 rjmp .+8 ; 0xa31e a316: 01 2f mov r16, r17 a318: 04 70 andi r16, 0x04 ; 4 a31a: 12 fd sbrc r17, 2 a31c: 00 e2 ldi r16, 0x20 ; 32 a31e: 2c 85 ldd r18, Y+12 ; 0x0c a320: 2c 70 andi r18, 0x0C ; 12 a322: e2 2e mov r14, r18 a324: 09 f4 brne .+2 ; 0xa328 a326: 6b c0 rjmp .+214 ; 0xa3fe a328: 01 11 cpse r16, r1 a32a: d8 c2 rjmp .+1456 ; 0xa8dc a32c: f3 e0 ldi r31, 0x03 ; 3 a32e: e1 2c mov r14, r1 a330: f5 15 cp r31, r5 a332: a0 f4 brcc .+40 ; 0xa35c a334: 83 e0 ldi r24, 0x03 ; 3 a336: e5 2c mov r14, r5 a338: e8 1a sub r14, r24 a33a: 13 fd sbrc r17, 3 a33c: 08 c0 rjmp .+16 ; 0xa34e a33e: b6 01 movw r22, r12 a340: 80 e2 ldi r24, 0x20 ; 32 a342: 90 e0 ldi r25, 0x00 ; 0 a344: 0f 94 44 9e call 0x33c88 ; 0x33c88 a348: ea 94 dec r14 a34a: e1 10 cpse r14, r1 a34c: f8 cf rjmp .-16 ; 0xa33e a34e: 00 23 and r16, r16 a350: 29 f0 breq .+10 ; 0xa35c a352: b6 01 movw r22, r12 a354: 80 2f mov r24, r16 a356: 90 e0 ldi r25, 0x00 ; 0 a358: 0f 94 44 9e call 0x33c88 ; 0x33c88 a35c: 3c 85 ldd r19, Y+12 ; 0x0c a35e: 2e e3 ldi r18, 0x3E ; 62 a360: a2 2e mov r10, r18 a362: 21 e7 ldi r18, 0x71 ; 113 a364: b2 2e mov r11, r18 a366: 33 fd sbrc r19, 3 a368: 04 c0 rjmp .+8 ; 0xa372 a36a: 92 e4 ldi r25, 0x42 ; 66 a36c: a9 2e mov r10, r25 a36e: 91 e7 ldi r25, 0x71 ; 113 a370: b9 2e mov r11, r25 a372: 10 71 andi r17, 0x10 ; 16 a374: 22 c0 rjmp .+68 ; 0xa3ba a376: 9b e9 ldi r25, 0x9B ; 155 a378: 98 0f add r25, r24 a37a: 93 30 cpi r25, 0x03 ; 3 a37c: 08 f0 brcs .+2 ; 0xa380 a37e: 47 c1 rjmp .+654 ; 0xa60e a380: 0f 7e andi r16, 0xEF ; 239 a382: 9c cf rjmp .-200 ; 0xa2bc a384: 86 36 cpi r24, 0x66 ; 102 a386: 11 f4 brne .+4 ; 0xa38c a388: 10 68 ori r17, 0x80 ; 128 a38a: a2 cf rjmp .-188 ; 0xa2d0 a38c: ff 20 and r15, r15 a38e: 09 f4 brne .+2 ; 0xa392 a390: 9f cf rjmp .-194 ; 0xa2d0 a392: fa 94 dec r15 a394: 9d cf rjmp .-198 ; 0xa2d0 a396: e7 e0 ldi r30, 0x07 ; 7 a398: 2f 2d mov r18, r15 a39a: ef 15 cp r30, r15 a39c: 18 f4 brcc .+6 ; 0xa3a4 a39e: 27 e0 ldi r18, 0x07 ; 7 a3a0: 37 e0 ldi r19, 0x07 ; 7 a3a2: f3 2e mov r15, r19 a3a4: 41 2c mov r4, r1 a3a6: 9f cf rjmp .-194 ; 0xa2e6 a3a8: 11 11 cpse r17, r1 a3aa: 80 52 subi r24, 0x20 ; 32 a3ac: b6 01 movw r22, r12 a3ae: 90 e0 ldi r25, 0x00 ; 0 a3b0: 0f 94 44 9e call 0x33c88 ; 0x33c88 a3b4: 8f ef ldi r24, 0xFF ; 255 a3b6: a8 1a sub r10, r24 a3b8: b8 0a sbc r11, r24 a3ba: f5 01 movw r30, r10 a3bc: 84 91 lpm r24, Z a3be: 81 11 cpse r24, r1 a3c0: f3 cf rjmp .-26 ; 0xa3a8 a3c2: e1 10 cpse r14, r1 a3c4: 84 c2 rjmp .+1288 ; 0xa8ce a3c6: 53 01 movw r10, r6 a3c8: f6 01 movw r30, r12 a3ca: 93 81 ldd r25, Z+3 ; 0x03 a3cc: f1 01 movw r30, r2 a3ce: 93 fd sbrc r25, 3 a3d0: 85 91 lpm r24, Z+ a3d2: 93 ff sbrs r25, 3 a3d4: 81 91 ld r24, Z+ a3d6: 1f 01 movw r2, r30 a3d8: 88 23 and r24, r24 a3da: 09 f4 brne .+2 ; 0xa3de a3dc: 11 c2 rjmp .+1058 ; 0xa800 a3de: 85 32 cpi r24, 0x25 ; 37 a3e0: 41 f4 brne .+16 ; 0xa3f2 a3e2: 93 fd sbrc r25, 3 a3e4: 85 91 lpm r24, Z+ a3e6: 93 ff sbrs r25, 3 a3e8: 81 91 ld r24, Z+ a3ea: 1f 01 movw r2, r30 a3ec: 85 32 cpi r24, 0x25 ; 37 a3ee: 09 f0 breq .+2 ; 0xa3f2 a3f0: 1c cf rjmp .-456 ; 0xa22a a3f2: b6 01 movw r22, r12 a3f4: 90 e0 ldi r25, 0x00 ; 0 a3f6: 0f 94 44 9e call 0x33c88 ; 0x33c88 a3fa: 35 01 movw r6, r10 a3fc: e4 cf rjmp .-56 ; 0xa3c6 a3fe: 17 ff sbrs r17, 7 a400: 6f c0 rjmp .+222 ; 0xa4e0 a402: 4a 0c add r4, r10 a404: fc 85 ldd r31, Y+12 ; 0x0c a406: f4 ff sbrs r31, 4 a408: 04 c0 rjmp .+8 ; 0xa412 a40a: 8a 81 ldd r24, Y+2 ; 0x02 a40c: 81 33 cpi r24, 0x31 ; 49 a40e: 09 f4 brne .+2 ; 0xa412 a410: 4a 94 dec r4 a412: 14 14 cp r1, r4 a414: 0c f0 brlt .+2 ; 0xa418 a416: 86 c0 rjmp .+268 ; 0xa524 a418: 28 e0 ldi r18, 0x08 ; 8 a41a: 24 15 cp r18, r4 a41c: 10 f4 brcc .+4 ; 0xa422 a41e: 88 e0 ldi r24, 0x08 ; 8 a420: 48 2e mov r4, r24 a422: 85 e0 ldi r24, 0x05 ; 5 a424: 90 e0 ldi r25, 0x00 ; 0 a426: 17 ff sbrs r17, 7 a428: 06 c0 rjmp .+12 ; 0xa436 a42a: c5 01 movw r24, r10 a42c: b7 fe sbrs r11, 7 a42e: 02 c0 rjmp .+4 ; 0xa434 a430: 90 e0 ldi r25, 0x00 ; 0 a432: 80 e0 ldi r24, 0x00 ; 0 a434: 01 96 adiw r24, 0x01 ; 1 a436: 01 11 cpse r16, r1 a438: 01 96 adiw r24, 0x01 ; 1 a43a: ff 20 and r15, r15 a43c: 31 f0 breq .+12 ; 0xa44a a43e: 2f 2d mov r18, r15 a440: 30 e0 ldi r19, 0x00 ; 0 a442: 2f 5f subi r18, 0xFF ; 255 a444: 3f 4f sbci r19, 0xFF ; 255 a446: 82 0f add r24, r18 a448: 93 1f adc r25, r19 a44a: 58 16 cp r5, r24 a44c: 19 06 cpc r1, r25 a44e: 19 f0 breq .+6 ; 0xa456 a450: 14 f0 brlt .+4 ; 0xa456 a452: e5 2c mov r14, r5 a454: e8 1a sub r14, r24 a456: 81 2f mov r24, r17 a458: 89 70 andi r24, 0x09 ; 9 a45a: 11 f4 brne .+4 ; 0xa460 a45c: e1 10 cpse r14, r1 a45e: 67 c0 rjmp .+206 ; 0xa52e a460: 00 23 and r16, r16 a462: 29 f0 breq .+10 ; 0xa46e a464: b6 01 movw r22, r12 a466: 80 2f mov r24, r16 a468: 90 e0 ldi r25, 0x00 ; 0 a46a: 0f 94 44 9e call 0x33c88 ; 0x33c88 a46e: 13 fd sbrc r17, 3 a470: 02 c0 rjmp .+4 ; 0xa476 a472: e1 10 cpse r14, r1 a474: 63 c0 rjmp .+198 ; 0xa53c a476: 17 ff sbrs r17, 7 a478: 7c c0 rjmp .+248 ; 0xa572 a47a: 85 01 movw r16, r10 a47c: b7 fe sbrs r11, 7 a47e: 02 c0 rjmp .+4 ; 0xa484 a480: 10 e0 ldi r17, 0x00 ; 0 a482: 00 e0 ldi r16, 0x00 ; 0 a484: c5 01 movw r24, r10 a486: 84 19 sub r24, r4 a488: 91 09 sbc r25, r1 a48a: 2c 01 movw r4, r24 a48c: 6f 2d mov r22, r15 a48e: 70 e0 ldi r23, 0x00 ; 0 a490: ee 27 eor r30, r30 a492: ff 27 eor r31, r31 a494: e6 1b sub r30, r22 a496: f7 0b sbc r31, r23 a498: ff 87 std Y+15, r31 ; 0x0f a49a: ee 87 std Y+14, r30 ; 0x0e a49c: 0f 3f cpi r16, 0xFF ; 255 a49e: 10 07 cpc r17, r16 a4a0: 29 f4 brne .+10 ; 0xa4ac a4a2: b6 01 movw r22, r12 a4a4: 8e e2 ldi r24, 0x2E ; 46 a4a6: 90 e0 ldi r25, 0x00 ; 0 a4a8: 0f 94 44 9e call 0x33c88 ; 0x33c88 a4ac: a0 16 cp r10, r16 a4ae: b1 06 cpc r11, r17 a4b0: 0c f4 brge .+2 ; 0xa4b4 a4b2: 4b c0 rjmp .+150 ; 0xa54a a4b4: 40 16 cp r4, r16 a4b6: 51 06 cpc r5, r17 a4b8: 0c f0 brlt .+2 ; 0xa4bc a4ba: 47 c0 rjmp .+142 ; 0xa54a a4bc: f5 01 movw r30, r10 a4be: e0 1b sub r30, r16 a4c0: f1 0b sbc r31, r17 a4c2: e8 0d add r30, r8 a4c4: f9 1d adc r31, r9 a4c6: 81 81 ldd r24, Z+1 ; 0x01 a4c8: 01 50 subi r16, 0x01 ; 1 a4ca: 11 09 sbc r17, r1 a4cc: 2e 85 ldd r18, Y+14 ; 0x0e a4ce: 3f 85 ldd r19, Y+15 ; 0x0f a4d0: 02 17 cp r16, r18 a4d2: 13 07 cpc r17, r19 a4d4: e4 f1 brlt .+120 ; 0xa54e a4d6: b6 01 movw r22, r12 a4d8: 90 e0 ldi r25, 0x00 ; 0 a4da: 0f 94 44 9e call 0x33c88 ; 0x33c88 a4de: de cf rjmp .-68 ; 0xa49c a4e0: 16 fd sbrc r17, 6 a4e2: 9f cf rjmp .-194 ; 0xa422 a4e4: ef 2d mov r30, r15 a4e6: f0 e0 ldi r31, 0x00 ; 0 a4e8: ea 15 cp r30, r10 a4ea: fb 05 cpc r31, r11 a4ec: 34 f0 brlt .+12 ; 0xa4fa a4ee: 3c ef ldi r19, 0xFC ; 252 a4f0: a3 16 cp r10, r19 a4f2: 3f ef ldi r19, 0xFF ; 255 a4f4: b3 06 cpc r11, r19 a4f6: 0c f0 brlt .+2 ; 0xa4fa a4f8: 10 68 ori r17, 0x80 ; 128 a4fa: 32 96 adiw r30, 0x02 ; 2 a4fc: e8 0d add r30, r8 a4fe: f9 1d adc r31, r9 a500: 01 c0 rjmp .+2 ; 0xa504 a502: fa 94 dec r15 a504: ff 20 and r15, r15 a506: 19 f0 breq .+6 ; 0xa50e a508: 82 91 ld r24, -Z a50a: 80 33 cpi r24, 0x30 ; 48 a50c: d1 f3 breq .-12 ; 0xa502 a50e: 17 ff sbrs r17, 7 a510: 88 cf rjmp .-240 ; 0xa422 a512: 44 24 eor r4, r4 a514: 43 94 inc r4 a516: 4f 0c add r4, r15 a518: fa 14 cp r15, r10 a51a: 1b 04 cpc r1, r11 a51c: 31 f0 breq .+12 ; 0xa52a a51e: 2c f0 brlt .+10 ; 0xa52a a520: fa 18 sub r15, r10 a522: 7f cf rjmp .-258 ; 0xa422 a524: 44 24 eor r4, r4 a526: 43 94 inc r4 a528: 7c cf rjmp .-264 ; 0xa422 a52a: f1 2c mov r15, r1 a52c: 7a cf rjmp .-268 ; 0xa422 a52e: b6 01 movw r22, r12 a530: 80 e2 ldi r24, 0x20 ; 32 a532: 90 e0 ldi r25, 0x00 ; 0 a534: 0f 94 44 9e call 0x33c88 ; 0x33c88 a538: ea 94 dec r14 a53a: 90 cf rjmp .-224 ; 0xa45c a53c: b6 01 movw r22, r12 a53e: 80 e3 ldi r24, 0x30 ; 48 a540: 90 e0 ldi r25, 0x00 ; 0 a542: 0f 94 44 9e call 0x33c88 ; 0x33c88 a546: ea 94 dec r14 a548: 94 cf rjmp .-216 ; 0xa472 a54a: 80 e3 ldi r24, 0x30 ; 48 a54c: bd cf rjmp .-134 ; 0xa4c8 a54e: a0 16 cp r10, r16 a550: b1 06 cpc r11, r17 a552: 41 f4 brne .+16 ; 0xa564 a554: 9a 81 ldd r25, Y+2 ; 0x02 a556: 96 33 cpi r25, 0x36 ; 54 a558: 50 f4 brcc .+20 ; 0xa56e a55a: 95 33 cpi r25, 0x35 ; 53 a55c: 19 f4 brne .+6 ; 0xa564 a55e: 3c 85 ldd r19, Y+12 ; 0x0c a560: 34 ff sbrs r19, 4 a562: 05 c0 rjmp .+10 ; 0xa56e a564: b6 01 movw r22, r12 a566: 90 e0 ldi r25, 0x00 ; 0 a568: 0f 94 44 9e call 0x33c88 ; 0x33c88 a56c: 2a cf rjmp .-428 ; 0xa3c2 a56e: 81 e3 ldi r24, 0x31 ; 49 a570: f9 cf rjmp .-14 ; 0xa564 a572: 8a 81 ldd r24, Y+2 ; 0x02 a574: 81 33 cpi r24, 0x31 ; 49 a576: 19 f0 breq .+6 ; 0xa57e a578: 9c 85 ldd r25, Y+12 ; 0x0c a57a: 9f 7e andi r25, 0xEF ; 239 a57c: 9c 87 std Y+12, r25 ; 0x0c a57e: b6 01 movw r22, r12 a580: 90 e0 ldi r25, 0x00 ; 0 a582: 0f 94 44 9e call 0x33c88 ; 0x33c88 a586: ff 20 and r15, r15 a588: a9 f0 breq .+42 ; 0xa5b4 a58a: b6 01 movw r22, r12 a58c: 8e e2 ldi r24, 0x2E ; 46 a58e: 90 e0 ldi r25, 0x00 ; 0 a590: 0f 94 44 9e call 0x33c88 ; 0x33c88 a594: f3 94 inc r15 a596: f3 94 inc r15 a598: e2 e0 ldi r30, 0x02 ; 2 a59a: 01 e0 ldi r16, 0x01 ; 1 a59c: 0e 0f add r16, r30 a59e: e8 0d add r30, r8 a5a0: f9 2d mov r31, r9 a5a2: f1 1d adc r31, r1 a5a4: 80 81 ld r24, Z a5a6: b6 01 movw r22, r12 a5a8: 90 e0 ldi r25, 0x00 ; 0 a5aa: 0f 94 44 9e call 0x33c88 ; 0x33c88 a5ae: e0 2f mov r30, r16 a5b0: 0f 11 cpse r16, r15 a5b2: f3 cf rjmp .-26 ; 0xa59a a5b4: 85 e6 ldi r24, 0x65 ; 101 a5b6: 90 e0 ldi r25, 0x00 ; 0 a5b8: 14 ff sbrs r17, 4 a5ba: 02 c0 rjmp .+4 ; 0xa5c0 a5bc: 85 e4 ldi r24, 0x45 ; 69 a5be: 90 e0 ldi r25, 0x00 ; 0 a5c0: b6 01 movw r22, r12 a5c2: 0f 94 44 9e call 0x33c88 ; 0x33c88 a5c6: b7 fc sbrc r11, 7 a5c8: 06 c0 rjmp .+12 ; 0xa5d6 a5ca: a1 14 cp r10, r1 a5cc: b1 04 cpc r11, r1 a5ce: c1 f4 brne .+48 ; 0xa600 a5d0: ec 85 ldd r30, Y+12 ; 0x0c a5d2: e4 ff sbrs r30, 4 a5d4: 15 c0 rjmp .+42 ; 0xa600 a5d6: b1 94 neg r11 a5d8: a1 94 neg r10 a5da: b1 08 sbc r11, r1 a5dc: 8d e2 ldi r24, 0x2D ; 45 a5de: b6 01 movw r22, r12 a5e0: 90 e0 ldi r25, 0x00 ; 0 a5e2: 0f 94 44 9e call 0x33c88 ; 0x33c88 a5e6: 80 e3 ldi r24, 0x30 ; 48 a5e8: 2a e0 ldi r18, 0x0A ; 10 a5ea: a2 16 cp r10, r18 a5ec: b1 04 cpc r11, r1 a5ee: 54 f4 brge .+20 ; 0xa604 a5f0: b6 01 movw r22, r12 a5f2: 90 e0 ldi r25, 0x00 ; 0 a5f4: 0f 94 44 9e call 0x33c88 ; 0x33c88 a5f8: b6 01 movw r22, r12 a5fa: c5 01 movw r24, r10 a5fc: c0 96 adiw r24, 0x30 ; 48 a5fe: b4 cf rjmp .-152 ; 0xa568 a600: 8b e2 ldi r24, 0x2B ; 43 a602: ed cf rjmp .-38 ; 0xa5de a604: 8f 5f subi r24, 0xFF ; 255 a606: fa e0 ldi r31, 0x0A ; 10 a608: af 1a sub r10, r31 a60a: b1 08 sbc r11, r1 a60c: ed cf rjmp .-38 ; 0xa5e8 a60e: 83 36 cpi r24, 0x63 ; 99 a610: c9 f0 breq .+50 ; 0xa644 a612: 83 37 cpi r24, 0x73 ; 115 a614: 71 f1 breq .+92 ; 0xa672 a616: 83 35 cpi r24, 0x53 ; 83 a618: 09 f0 breq .+2 ; 0xa61c a61a: 5b c0 rjmp .+182 ; 0xa6d2 a61c: 35 01 movw r6, r10 a61e: f2 e0 ldi r31, 0x02 ; 2 a620: 6f 0e add r6, r31 a622: 71 1c adc r7, r1 a624: f5 01 movw r30, r10 a626: a0 80 ld r10, Z a628: b1 80 ldd r11, Z+1 ; 0x01 a62a: 6f 2d mov r22, r15 a62c: 70 e0 ldi r23, 0x00 ; 0 a62e: 06 fd sbrc r16, 6 a630: 02 c0 rjmp .+4 ; 0xa636 a632: 6f ef ldi r22, 0xFF ; 255 a634: 7f ef ldi r23, 0xFF ; 255 a636: c5 01 movw r24, r10 a638: 0f 94 d8 9d call 0x33bb0 ; 0x33bb0 a63c: 9d 87 std Y+13, r25 ; 0x0d a63e: 8c 87 std Y+12, r24 ; 0x0c a640: 00 68 ori r16, 0x80 ; 128 a642: 0d c0 rjmp .+26 ; 0xa65e a644: 35 01 movw r6, r10 a646: 32 e0 ldi r19, 0x02 ; 2 a648: 63 0e add r6, r19 a64a: 71 1c adc r7, r1 a64c: f5 01 movw r30, r10 a64e: 80 81 ld r24, Z a650: 89 83 std Y+1, r24 ; 0x01 a652: 21 e0 ldi r18, 0x01 ; 1 a654: 30 e0 ldi r19, 0x00 ; 0 a656: 3d 87 std Y+13, r19 ; 0x0d a658: 2c 87 std Y+12, r18 ; 0x0c a65a: 54 01 movw r10, r8 a65c: 0f 77 andi r16, 0x7F ; 127 a65e: 03 fd sbrc r16, 3 a660: 06 c0 rjmp .+12 ; 0xa66e a662: 2c 85 ldd r18, Y+12 ; 0x0c a664: 3d 85 ldd r19, Y+13 ; 0x0d a666: 52 16 cp r5, r18 a668: 13 06 cpc r1, r19 a66a: 09 f0 breq .+2 ; 0xa66e a66c: a8 f4 brcc .+42 ; 0xa698 a66e: e5 2c mov r14, r5 a670: 2b c0 rjmp .+86 ; 0xa6c8 a672: 35 01 movw r6, r10 a674: 32 e0 ldi r19, 0x02 ; 2 a676: 63 0e add r6, r19 a678: 71 1c adc r7, r1 a67a: f5 01 movw r30, r10 a67c: a0 80 ld r10, Z a67e: b1 80 ldd r11, Z+1 ; 0x01 a680: 6f 2d mov r22, r15 a682: 70 e0 ldi r23, 0x00 ; 0 a684: 06 fd sbrc r16, 6 a686: 02 c0 rjmp .+4 ; 0xa68c a688: 6f ef ldi r22, 0xFF ; 255 a68a: 7f ef ldi r23, 0xFF ; 255 a68c: c5 01 movw r24, r10 a68e: 0f 94 fd 9d call 0x33bfa ; 0x33bfa a692: 9d 87 std Y+13, r25 ; 0x0d a694: 8c 87 std Y+12, r24 ; 0x0c a696: e2 cf rjmp .-60 ; 0xa65c a698: b6 01 movw r22, r12 a69a: 80 e2 ldi r24, 0x20 ; 32 a69c: 90 e0 ldi r25, 0x00 ; 0 a69e: 0f 94 44 9e call 0x33c88 ; 0x33c88 a6a2: 5a 94 dec r5 a6a4: de cf rjmp .-68 ; 0xa662 a6a6: f5 01 movw r30, r10 a6a8: 07 fd sbrc r16, 7 a6aa: 85 91 lpm r24, Z+ a6ac: 07 ff sbrs r16, 7 a6ae: 81 91 ld r24, Z+ a6b0: 5f 01 movw r10, r30 a6b2: b6 01 movw r22, r12 a6b4: 90 e0 ldi r25, 0x00 ; 0 a6b6: 0f 94 44 9e call 0x33c88 ; 0x33c88 a6ba: e1 10 cpse r14, r1 a6bc: ea 94 dec r14 a6be: 8c 85 ldd r24, Y+12 ; 0x0c a6c0: 9d 85 ldd r25, Y+13 ; 0x0d a6c2: 01 97 sbiw r24, 0x01 ; 1 a6c4: 9d 87 std Y+13, r25 ; 0x0d a6c6: 8c 87 std Y+12, r24 ; 0x0c a6c8: ec 85 ldd r30, Y+12 ; 0x0c a6ca: fd 85 ldd r31, Y+13 ; 0x0d a6cc: ef 2b or r30, r31 a6ce: 59 f7 brne .-42 ; 0xa6a6 a6d0: 78 ce rjmp .-784 ; 0xa3c2 a6d2: 84 36 cpi r24, 0x64 ; 100 a6d4: 19 f0 breq .+6 ; 0xa6dc a6d6: 89 36 cpi r24, 0x69 ; 105 a6d8: 09 f0 breq .+2 ; 0xa6dc a6da: 74 c0 rjmp .+232 ; 0xa7c4 a6dc: 35 01 movw r6, r10 a6de: 07 ff sbrs r16, 7 a6e0: 66 c0 rjmp .+204 ; 0xa7ae a6e2: f4 e0 ldi r31, 0x04 ; 4 a6e4: 6f 0e add r6, r31 a6e6: 71 1c adc r7, r1 a6e8: f5 01 movw r30, r10 a6ea: 60 81 ld r22, Z a6ec: 71 81 ldd r23, Z+1 ; 0x01 a6ee: 82 81 ldd r24, Z+2 ; 0x02 a6f0: 93 81 ldd r25, Z+3 ; 0x03 a6f2: 10 2f mov r17, r16 a6f4: 1f 76 andi r17, 0x6F ; 111 a6f6: 97 ff sbrs r25, 7 a6f8: 08 c0 rjmp .+16 ; 0xa70a a6fa: 90 95 com r25 a6fc: 80 95 com r24 a6fe: 70 95 com r23 a700: 61 95 neg r22 a702: 7f 4f sbci r23, 0xFF ; 255 a704: 8f 4f sbci r24, 0xFF ; 255 a706: 9f 4f sbci r25, 0xFF ; 255 a708: 10 68 ori r17, 0x80 ; 128 a70a: 2a e0 ldi r18, 0x0A ; 10 a70c: 30 e0 ldi r19, 0x00 ; 0 a70e: a4 01 movw r20, r8 a710: 0f 94 6b 9f call 0x33ed6 ; 0x33ed6 <__ultoa_invert> a714: a8 2e mov r10, r24 a716: a8 18 sub r10, r8 a718: ba 2c mov r11, r10 a71a: 01 2f mov r16, r17 a71c: 16 ff sbrs r17, 6 a71e: 0a c0 rjmp .+20 ; 0xa734 a720: 0e 7f andi r16, 0xFE ; 254 a722: af 14 cp r10, r15 a724: 38 f4 brcc .+14 ; 0xa734 a726: 14 ff sbrs r17, 4 a728: 04 c0 rjmp .+8 ; 0xa732 a72a: 12 fd sbrc r17, 2 a72c: 02 c0 rjmp .+4 ; 0xa732 a72e: 01 2f mov r16, r17 a730: 0e 7e andi r16, 0xEE ; 238 a732: bf 2c mov r11, r15 a734: 04 ff sbrs r16, 4 a736: a3 c0 rjmp .+326 ; 0xa87e a738: fe 01 movw r30, r28 a73a: ea 0d add r30, r10 a73c: f1 1d adc r31, r1 a73e: 80 81 ld r24, Z a740: 80 33 cpi r24, 0x30 ; 48 a742: 09 f0 breq .+2 ; 0xa746 a744: 95 c0 rjmp .+298 ; 0xa870 a746: 09 7e andi r16, 0xE9 ; 233 a748: f0 2f mov r31, r16 a74a: f8 70 andi r31, 0x08 ; 8 a74c: ef 2e mov r14, r31 a74e: 03 fd sbrc r16, 3 a750: a5 c0 rjmp .+330 ; 0xa89c a752: 00 ff sbrs r16, 0 a754: 9f c0 rjmp .+318 ; 0xa894 a756: fa 2c mov r15, r10 a758: b5 14 cp r11, r5 a75a: 10 f4 brcc .+4 ; 0xa760 a75c: f5 0c add r15, r5 a75e: fb 18 sub r15, r11 a760: 04 ff sbrs r16, 4 a762: a2 c0 rjmp .+324 ; 0xa8a8 a764: b6 01 movw r22, r12 a766: 80 e3 ldi r24, 0x30 ; 48 a768: 90 e0 ldi r25, 0x00 ; 0 a76a: 0f 94 44 9e call 0x33c88 ; 0x33c88 a76e: 02 ff sbrs r16, 2 a770: 09 c0 rjmp .+18 ; 0xa784 a772: 88 e7 ldi r24, 0x78 ; 120 a774: 90 e0 ldi r25, 0x00 ; 0 a776: 01 ff sbrs r16, 1 a778: 02 c0 rjmp .+4 ; 0xa77e a77a: 88 e5 ldi r24, 0x58 ; 88 a77c: 90 e0 ldi r25, 0x00 ; 0 a77e: b6 01 movw r22, r12 a780: 0f 94 44 9e call 0x33c88 ; 0x33c88 a784: af 14 cp r10, r15 a786: 08 f4 brcc .+2 ; 0xa78a a788: 9b c0 rjmp .+310 ; 0xa8c0 a78a: aa 94 dec r10 a78c: 0a 2d mov r16, r10 a78e: 10 e0 ldi r17, 0x00 ; 0 a790: 0f 5f subi r16, 0xFF ; 255 a792: 1f 4f sbci r17, 0xFF ; 255 a794: 08 0d add r16, r8 a796: 19 1d adc r17, r9 a798: f8 01 movw r30, r16 a79a: 82 91 ld r24, -Z a79c: 8f 01 movw r16, r30 a79e: b6 01 movw r22, r12 a7a0: 90 e0 ldi r25, 0x00 ; 0 a7a2: 0f 94 44 9e call 0x33c88 ; 0x33c88 a7a6: 80 16 cp r8, r16 a7a8: 91 06 cpc r9, r17 a7aa: b1 f7 brne .-20 ; 0xa798 a7ac: 0a ce rjmp .-1004 ; 0xa3c2 a7ae: f2 e0 ldi r31, 0x02 ; 2 a7b0: 6f 0e add r6, r31 a7b2: 71 1c adc r7, r1 a7b4: f5 01 movw r30, r10 a7b6: 60 81 ld r22, Z a7b8: 71 81 ldd r23, Z+1 ; 0x01 a7ba: 07 2e mov r0, r23 a7bc: 00 0c add r0, r0 a7be: 88 0b sbc r24, r24 a7c0: 99 0b sbc r25, r25 a7c2: 97 cf rjmp .-210 ; 0xa6f2 a7c4: 10 2f mov r17, r16 a7c6: 85 37 cpi r24, 0x75 ; 117 a7c8: a9 f4 brne .+42 ; 0xa7f4 a7ca: 1f 7e andi r17, 0xEF ; 239 a7cc: 2a e0 ldi r18, 0x0A ; 10 a7ce: 30 e0 ldi r19, 0x00 ; 0 a7d0: 35 01 movw r6, r10 a7d2: 17 ff sbrs r17, 7 a7d4: 44 c0 rjmp .+136 ; 0xa85e a7d6: f4 e0 ldi r31, 0x04 ; 4 a7d8: 6f 0e add r6, r31 a7da: 71 1c adc r7, r1 a7dc: f5 01 movw r30, r10 a7de: 60 81 ld r22, Z a7e0: 71 81 ldd r23, Z+1 ; 0x01 a7e2: 82 81 ldd r24, Z+2 ; 0x02 a7e4: 93 81 ldd r25, Z+3 ; 0x03 a7e6: a4 01 movw r20, r8 a7e8: 0f 94 6b 9f call 0x33ed6 ; 0x33ed6 <__ultoa_invert> a7ec: a8 2e mov r10, r24 a7ee: a8 18 sub r10, r8 a7f0: 1f 77 andi r17, 0x7F ; 127 a7f2: 92 cf rjmp .-220 ; 0xa718 a7f4: 19 7f andi r17, 0xF9 ; 249 a7f6: 8f 36 cpi r24, 0x6F ; 111 a7f8: 79 f1 breq .+94 ; 0xa858 a7fa: f0 f4 brcc .+60 ; 0xa838 a7fc: 88 35 cpi r24, 0x58 ; 88 a7fe: 39 f1 breq .+78 ; 0xa84e a800: f6 01 movw r30, r12 a802: 86 81 ldd r24, Z+6 ; 0x06 a804: 97 81 ldd r25, Z+7 ; 0x07 a806: 2f 96 adiw r28, 0x0f ; 15 a808: 0f b6 in r0, 0x3f ; 63 a80a: f8 94 cli a80c: de bf out 0x3e, r29 ; 62 a80e: 0f be out 0x3f, r0 ; 63 a810: cd bf out 0x3d, r28 ; 61 a812: df 91 pop r29 a814: cf 91 pop r28 a816: 1f 91 pop r17 a818: 0f 91 pop r16 a81a: ff 90 pop r15 a81c: ef 90 pop r14 a81e: df 90 pop r13 a820: cf 90 pop r12 a822: bf 90 pop r11 a824: af 90 pop r10 a826: 9f 90 pop r9 a828: 8f 90 pop r8 a82a: 7f 90 pop r7 a82c: 6f 90 pop r6 a82e: 5f 90 pop r5 a830: 4f 90 pop r4 a832: 3f 90 pop r3 a834: 2f 90 pop r2 a836: 08 95 ret a838: 80 37 cpi r24, 0x70 ; 112 a83a: 39 f0 breq .+14 ; 0xa84a a83c: 88 37 cpi r24, 0x78 ; 120 a83e: 01 f7 brne .-64 ; 0xa800 a840: 14 fd sbrc r17, 4 a842: 14 60 ori r17, 0x04 ; 4 a844: 20 e1 ldi r18, 0x10 ; 16 a846: 30 e0 ldi r19, 0x00 ; 0 a848: c3 cf rjmp .-122 ; 0xa7d0 a84a: 10 61 ori r17, 0x10 ; 16 a84c: f9 cf rjmp .-14 ; 0xa840 a84e: 04 fd sbrc r16, 4 a850: 16 60 ori r17, 0x06 ; 6 a852: 20 e1 ldi r18, 0x10 ; 16 a854: 32 e0 ldi r19, 0x02 ; 2 a856: bc cf rjmp .-136 ; 0xa7d0 a858: 28 e0 ldi r18, 0x08 ; 8 a85a: 30 e0 ldi r19, 0x00 ; 0 a85c: b9 cf rjmp .-142 ; 0xa7d0 a85e: f2 e0 ldi r31, 0x02 ; 2 a860: 6f 0e add r6, r31 a862: 71 1c adc r7, r1 a864: f5 01 movw r30, r10 a866: 60 81 ld r22, Z a868: 71 81 ldd r23, Z+1 ; 0x01 a86a: 90 e0 ldi r25, 0x00 ; 0 a86c: 80 e0 ldi r24, 0x00 ; 0 a86e: bb cf rjmp .-138 ; 0xa7e6 a870: 02 fd sbrc r16, 2 a872: 02 c0 rjmp .+4 ; 0xa878 a874: b3 94 inc r11 a876: 68 cf rjmp .-304 ; 0xa748 a878: b3 94 inc r11 a87a: b3 94 inc r11 a87c: 65 cf rjmp .-310 ; 0xa748 a87e: 80 2f mov r24, r16 a880: 86 78 andi r24, 0x86 ; 134 a882: 09 f4 brne .+2 ; 0xa886 a884: 61 cf rjmp .-318 ; 0xa748 a886: f6 cf rjmp .-20 ; 0xa874 a888: b6 01 movw r22, r12 a88a: 80 e2 ldi r24, 0x20 ; 32 a88c: 90 e0 ldi r25, 0x00 ; 0 a88e: 0f 94 44 9e call 0x33c88 ; 0x33c88 a892: b3 94 inc r11 a894: b5 14 cp r11, r5 a896: c0 f3 brcs .-16 ; 0xa888 a898: e1 2c mov r14, r1 a89a: 62 cf rjmp .-316 ; 0xa760 a89c: e5 2c mov r14, r5 a89e: eb 18 sub r14, r11 a8a0: b5 14 cp r11, r5 a8a2: 08 f4 brcc .+2 ; 0xa8a6 a8a4: 5d cf rjmp .-326 ; 0xa760 a8a6: f8 cf rjmp .-16 ; 0xa898 a8a8: 80 2f mov r24, r16 a8aa: 86 78 andi r24, 0x86 ; 134 a8ac: 09 f4 brne .+2 ; 0xa8b0 a8ae: 6a cf rjmp .-300 ; 0xa784 a8b0: 8b e2 ldi r24, 0x2B ; 43 a8b2: 01 ff sbrs r16, 1 a8b4: 80 e2 ldi r24, 0x20 ; 32 a8b6: 07 fd sbrc r16, 7 a8b8: 8d e2 ldi r24, 0x2D ; 45 a8ba: b6 01 movw r22, r12 a8bc: 90 e0 ldi r25, 0x00 ; 0 a8be: 60 cf rjmp .-320 ; 0xa780 a8c0: b6 01 movw r22, r12 a8c2: 80 e3 ldi r24, 0x30 ; 48 a8c4: 90 e0 ldi r25, 0x00 ; 0 a8c6: 0f 94 44 9e call 0x33c88 ; 0x33c88 a8ca: fa 94 dec r15 a8cc: 5b cf rjmp .-330 ; 0xa784 a8ce: b6 01 movw r22, r12 a8d0: 80 e2 ldi r24, 0x20 ; 32 a8d2: 90 e0 ldi r25, 0x00 ; 0 a8d4: 0f 94 44 9e call 0x33c88 ; 0x33c88 a8d8: ea 94 dec r14 a8da: 73 cd rjmp .-1306 ; 0xa3c2 a8dc: 24 e0 ldi r18, 0x04 ; 4 a8de: e1 2c mov r14, r1 a8e0: 25 15 cp r18, r5 a8e2: 08 f0 brcs .+2 ; 0xa8e6 a8e4: 36 cd rjmp .-1428 ; 0xa352 a8e6: 84 e0 ldi r24, 0x04 ; 4 a8e8: 26 cd rjmp .-1460 ; 0xa336 0000a8ea : uint16_t restore_interrupted_gcode() { // When recovering from a previous print move, restore the originally // calculated start position on the first USB/SD command. This accounts // properly for relative moves if ( a8ea: 20 e0 ldi r18, 0x00 ; 0 a8ec: 30 e0 ldi r19, 0x00 ; 0 a8ee: 40 e8 ldi r20, 0x80 ; 128 a8f0: 5f eb ldi r21, 0xBF ; 191 a8f2: 60 91 7e 02 lds r22, 0x027E ; 0x80027e a8f6: 70 91 7f 02 lds r23, 0x027F ; 0x80027f a8fa: 80 91 80 02 lds r24, 0x0280 ; 0x800280 a8fe: 90 91 81 02 lds r25, 0x0281 ; 0x800281 a902: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> a906: 88 23 and r24, r24 a908: 21 f1 breq .+72 ; 0xa952 (saved_start_position[0] != SAVED_START_POSITION_UNSET) && ( (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_SDCARD) || a90a: e0 91 cb 11 lds r30, 0x11CB ; 0x8011cb a90e: f0 91 cc 11 lds r31, 0x11CC ; 0x8011cc a912: e2 52 subi r30, 0x22 ; 34 a914: f0 4f sbci r31, 0xF0 ; 240 uint16_t restore_interrupted_gcode() { // When recovering from a previous print move, restore the originally // calculated start position on the first USB/SD command. This accounts // properly for relative moves if ( (saved_start_position[0] != SAVED_START_POSITION_UNSET) && ( a916: 80 81 ld r24, Z a918: 8b 7f andi r24, 0xFB ; 251 a91a: 82 30 cpi r24, 0x02 ; 2 a91c: d1 f4 brne .+52 ; 0xa952 (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_SDCARD) || (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR) ) ) { memcpy(current_position, saved_start_position, sizeof(current_position)); a91e: 80 e1 ldi r24, 0x10 ; 16 a920: ee e7 ldi r30, 0x7E ; 126 a922: f2 e0 ldi r31, 0x02 ; 2 a924: a5 ef ldi r26, 0xF5 ; 245 a926: b1 e1 ldi r27, 0x11 ; 17 a928: 01 90 ld r0, Z+ a92a: 0d 92 st X+, r0 a92c: 8a 95 dec r24 a92e: e1 f7 brne .-8 ; 0xa928 saved_start_position[0] = SAVED_START_POSITION_UNSET; a930: 80 e0 ldi r24, 0x00 ; 0 a932: 90 e0 ldi r25, 0x00 ; 0 a934: a0 e8 ldi r26, 0x80 ; 128 a936: bf eb ldi r27, 0xBF ; 191 a938: 80 93 7e 02 sts 0x027E, r24 ; 0x80027e a93c: 90 93 7f 02 sts 0x027F, r25 ; 0x80027f a940: a0 93 80 02 sts 0x0280, r26 ; 0x800280 a944: b0 93 81 02 sts 0x0281, r27 ; 0x800281 return saved_segment_idx; a948: 80 91 e0 11 lds r24, 0x11E0 ; 0x8011e0 a94c: 90 91 e1 11 lds r25, 0x11E1 ; 0x8011e1 a950: 08 95 ret } else return 1; //begin with the first segment a952: 81 e0 ldi r24, 0x01 ; 1 a954: 90 e0 ldi r25, 0x00 ; 0 } a956: 08 95 ret 0000a958 : void plan_set_e_position(const float &e); // Reset the E position to zero at the start of the next segment void plan_reset_next_e(); inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); } a958: 80 e1 ldi r24, 0x10 ; 16 a95a: e3 e9 ldi r30, 0x93 ; 147 a95c: f6 e0 ldi r31, 0x06 ; 6 a95e: a5 ef ldi r26, 0xF5 ; 245 a960: b1 e1 ldi r27, 0x11 ; 17 a962: 01 90 ld r0, Z+ a964: 0d 92 st X+, r0 a966: 8a 95 dec r24 a968: e1 f7 brne .-8 ; 0xa962 a96a: 08 95 ret 0000a96c : /// @brief Calculate the LCD row offset /// @param row LCD row number, ranges from 0 to LCD_HEIGHT - 1 /// @return row offset which the LCD register understands static uint8_t __attribute__((noinline)) lcd_get_row_offset(uint8_t row) { return pgm_read_byte(row_offsets + min(row, LCD_HEIGHT - 1)); a96c: e6 e1 ldi r30, 0x16 ; 22 a96e: f6 e7 ldi r31, 0x76 ; 118 a970: 83 30 cpi r24, 0x03 ; 3 a972: 21 f0 breq .+8 ; 0xa97c a974: e8 2f mov r30, r24 a976: f0 e0 ldi r31, 0x00 ; 0 a978: ed 5e subi r30, 0xED ; 237 a97a: f9 48 sbci r31, 0x89 ; 137 a97c: 84 91 lpm r24, Z } a97e: 08 95 ret 0000a980 : static int read(void); static void flush(void); static /*FORCE_INLINE*/ int available(void) { return (unsigned int)(RX_BUFFER_SIZE + rx_buffer.head - rx_buffer.tail) % RX_BUFFER_SIZE; a980: 80 91 af 05 lds r24, 0x05AF ; 0x8005af a984: 90 91 b0 05 lds r25, 0x05B0 ; 0x8005b0 a988: 20 91 b1 05 lds r18, 0x05B1 ; 0x8005b1 a98c: 30 91 b2 05 lds r19, 0x05B2 ; 0x8005b2 a990: 82 1b sub r24, r18 a992: 93 0b sbc r25, r19 } a994: 8f 77 andi r24, 0x7F ; 127 a996: 99 27 eor r25, r25 a998: 08 95 ret 0000a99a : memset((void*)adc_values, 0, sizeof(adc_values)); } static void adc_setmux(uint8_t ch) { ch &= 0x0f; a99a: 98 2f mov r25, r24 a99c: 9f 70 andi r25, 0x0F ; 15 if (ch & 0x08) ADCSRB |= (1 << MUX5); a99e: 83 ff sbrs r24, 3 a9a0: 0d c0 rjmp .+26 ; 0xa9bc a9a2: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> a9a6: 88 60 ori r24, 0x08 ; 8 else ADCSRB &= ~(1 << MUX5); a9a8: 80 93 7b 00 sts 0x007B, r24 ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); a9ac: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> a9b0: 88 7f andi r24, 0xF8 ; 248 a9b2: 97 70 andi r25, 0x07 ; 7 a9b4: 89 2b or r24, r25 a9b6: 80 93 7c 00 sts 0x007C, r24 ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> } a9ba: 08 95 ret static void adc_setmux(uint8_t ch) { ch &= 0x0f; if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); a9bc: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> a9c0: 87 7f andi r24, 0xF7 ; 247 a9c2: f2 cf rjmp .-28 ; 0xa9a8 0000a9c4 : // don't reverse this or there may be problems if the RX interrupt // occurs after reading the value of rx_buffer_head but before writing // the value to rx_buffer_tail; the previous value of rx_buffer_head // may be written to rx_buffer_tail, making it appear as if the buffer // were full, not empty. rx_buffer.head = rx_buffer.tail; a9c4: 80 91 b1 05 lds r24, 0x05B1 ; 0x8005b1 a9c8: 90 91 b2 05 lds r25, 0x05B2 ; 0x8005b2 a9cc: 90 93 b0 05 sts 0x05B0, r25 ; 0x8005b0 a9d0: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af void FlushSerialRequestResend() { //char cmdbuffer[bufindr][100]="Resend:"; MYSERIAL.flush(); printf_P(_N("%S: %ld\n%S\n"), _n("Resend"), gcode_LastN + 1, MSG_OK); a9d4: 81 e3 ldi r24, 0x31 ; 49 a9d6: 99 e6 ldi r25, 0x69 ; 105 a9d8: 9f 93 push r25 a9da: 8f 93 push r24 a9dc: 80 91 d1 11 lds r24, 0x11D1 ; 0x8011d1 a9e0: 90 91 d2 11 lds r25, 0x11D2 ; 0x8011d2 a9e4: a0 91 d3 11 lds r26, 0x11D3 ; 0x8011d3 a9e8: b0 91 d4 11 lds r27, 0x11D4 ; 0x8011d4 a9ec: 01 96 adiw r24, 0x01 ; 1 a9ee: a1 1d adc r26, r1 a9f0: b1 1d adc r27, r1 a9f2: bf 93 push r27 a9f4: af 93 push r26 a9f6: 9f 93 push r25 a9f8: 8f 93 push r24 a9fa: 8b e3 ldi r24, 0x3B ; 59 a9fc: 94 e6 ldi r25, 0x64 ; 100 a9fe: 9f 93 push r25 aa00: 8f 93 push r24 aa02: 82 e4 ldi r24, 0x42 ; 66 aa04: 94 e6 ldi r25, 0x64 ; 100 aa06: 9f 93 push r25 aa08: 8f 93 push r24 aa0a: 0f 94 9e 9e call 0x33d3c ; 0x33d3c aa0e: 8d b7 in r24, 0x3d ; 61 aa10: 9e b7 in r25, 0x3e ; 62 aa12: 0a 96 adiw r24, 0x0a ; 10 aa14: 0f b6 in r0, 0x3f ; 63 aa16: f8 94 cli aa18: 9e bf out 0x3e, r25 ; 62 aa1a: 0f be out 0x3f, r0 ; 63 aa1c: 8d bf out 0x3d, r24 ; 61 } aa1e: 08 95 ret 0000aa20 : bool __attribute__((noinline)) eeprom_is_sheet_initialized(uint8_t sheet_num) { return (eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base->s[sheet_num].z_offset))) != EEPROM_EMPTY_VALUE16); } bool __attribute__((noinline)) eeprom_is_initialized_block(const void *__p, size_t __n) { aa20: 0f 93 push r16 aa22: 1f 93 push r17 aa24: cf 93 push r28 aa26: df 93 push r29 aa28: ec 01 movw r28, r24 aa2a: c6 0f add r28, r22 aa2c: d7 1f adc r29, r23 const uint8_t *p = (const uint8_t*)__p; while (__n--) { aa2e: 8c 17 cp r24, r28 aa30: 9d 07 cpc r25, r29 aa32: 79 f0 breq .+30 ; 0xaa52 if (eeprom_read_byte(p++) != EEPROM_EMPTY_VALUE) aa34: 8c 01 movw r16, r24 aa36: 0f 5f subi r16, 0xFF ; 255 aa38: 1f 4f sbci r17, 0xFF ; 255 aa3a: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 aa3e: 8f 3f cpi r24, 0xFF ; 255 aa40: 31 f0 breq .+12 ; 0xaa4e return true; aa42: 81 e0 ldi r24, 0x01 ; 1 } return false; } aa44: df 91 pop r29 aa46: cf 91 pop r28 aa48: 1f 91 pop r17 aa4a: 0f 91 pop r16 aa4c: 08 95 ret bool __attribute__((noinline)) eeprom_is_initialized_block(const void *__p, size_t __n) { const uint8_t *p = (const uint8_t*)__p; while (__n--) { if (eeprom_read_byte(p++) != EEPROM_EMPTY_VALUE) aa4e: c8 01 movw r24, r16 aa50: ee cf rjmp .-36 ; 0xaa2e return true; } return false; aa52: 80 e0 ldi r24, 0x00 ; 0 aa54: f7 cf rjmp .-18 ; 0xaa44 0000aa56 : #if defined(__cplusplus) } #endif // Return True if a character was found static inline bool code_seen(char code) { return (strchr_pointer = strchr(CMDBUFFER_CURRENT_STRING, code)) != NULL; } aa56: 68 2f mov r22, r24 aa58: 88 0f add r24, r24 aa5a: 77 0b sbc r23, r23 aa5c: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb aa60: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc aa64: 8f 51 subi r24, 0x1F ; 31 aa66: 90 4f sbci r25, 0xF0 ; 240 aa68: 0f 94 33 a6 call 0x34c66 ; 0x34c66 aa6c: 9c 01 movw r18, r24 aa6e: 90 93 f6 16 sts 0x16F6, r25 ; 0x8016f6 aa72: 80 93 f5 16 sts 0x16F5, r24 ; 0x8016f5 aa76: 81 e0 ldi r24, 0x01 ; 1 aa78: 23 2b or r18, r19 aa7a: 09 f4 brne .+2 ; 0xaa7e aa7c: 80 e0 ldi r24, 0x00 ; 0 aa7e: 08 95 ret 0000aa80 : static inline bool code_seen_P(const char *code_PROGMEM) { return (strchr_pointer = strstr_P(CMDBUFFER_CURRENT_STRING, code_PROGMEM)) != NULL; } static inline float code_value() { return strtod_noE(strchr_pointer+1, NULL);} static inline long code_value_long() { return strtol(strchr_pointer+1, NULL, 10); } static inline int16_t code_value_short() { return int16_t(strtol(strchr_pointer+1, NULL, 10)); }; static inline uint8_t code_value_uint8() { return uint8_t(strtol(strchr_pointer+1, NULL, 10)); }; aa80: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 aa84: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 aa88: 4a e0 ldi r20, 0x0A ; 10 aa8a: 50 e0 ldi r21, 0x00 ; 0 aa8c: 70 e0 ldi r23, 0x00 ; 0 aa8e: 60 e0 ldi r22, 0x00 ; 0 aa90: 01 96 adiw r24, 0x01 ; 1 aa92: 0f 94 67 9b call 0x336ce ; 0x336ce aa96: 86 2f mov r24, r22 aa98: 08 95 ret 0000aa9a : // Return True if a character was found static inline bool code_seen(char code) { return (strchr_pointer = strchr(CMDBUFFER_CURRENT_STRING, code)) != NULL; } static inline bool code_seen_P(const char *code_PROGMEM) { return (strchr_pointer = strstr_P(CMDBUFFER_CURRENT_STRING, code_PROGMEM)) != NULL; } static inline float code_value() { return strtod_noE(strchr_pointer+1, NULL);} static inline long code_value_long() { return strtol(strchr_pointer+1, NULL, 10); } static inline int16_t code_value_short() { return int16_t(strtol(strchr_pointer+1, NULL, 10)); }; aa9a: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 aa9e: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 aaa2: 4a e0 ldi r20, 0x0A ; 10 aaa4: 50 e0 ldi r21, 0x00 ; 0 aaa6: 70 e0 ldi r23, 0x00 ; 0 aaa8: 60 e0 ldi r22, 0x00 ; 0 aaaa: 01 96 adiw r24, 0x01 ; 1 aaac: 0f 94 67 9b call 0x336ce ; 0x336ce aab0: cb 01 movw r24, r22 aab2: 08 95 ret 0000aab4 : #endif babystep_apply(); // Apply Z height correction aka baby stepping before mesh bed leveing gets activated. { // Apply the bed level correction to the mesh bool eeprom_bed_correction_valid = eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1; auto bedCorrectHelper = [eeprom_bed_correction_valid] (char code, uint8_t *eep_address) -> int8_t { aab4: 0f 93 push r16 aab6: 1f 93 push r17 aab8: cf 93 push r28 aaba: df 93 push r29 aabc: 8c 01 movw r16, r24 aabe: 86 2f mov r24, r22 aac0: ea 01 movw r28, r20 if (code_seen(code)) { aac2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 aac6: 88 23 and r24, r24 aac8: 19 f1 breq .+70 ; 0xab10 // Verify value is within allowed range int16_t temp = code_value_short(); aaca: 0e 94 4d 55 call 0xaa9a ; 0xaa9a if (abs(temp) > BED_ADJUSTMENT_UM_MAX) { aace: 9c 01 movw r18, r24 aad0: 97 ff sbrs r25, 7 aad2: 03 c0 rjmp .+6 ; 0xaada aad4: 31 95 neg r19 aad6: 21 95 neg r18 aad8: 31 09 sbc r19, r1 aada: 25 36 cpi r18, 0x65 ; 101 aadc: 31 05 cpc r19, r1 aade: 9c f0 brlt .+38 ; 0xab06 printf_P(PSTR("%SExcessive bed leveling correction: %i microns\n"), errormagic, temp); aae0: 9f 93 push r25 aae2: 8f 93 push r24 aae4: 84 e4 ldi r24, 0x44 ; 68 aae6: 9d e9 ldi r25, 0x9D ; 157 aae8: 9f 93 push r25 aaea: 8f 93 push r24 aaec: 83 e9 ldi r24, 0x93 ; 147 aaee: 96 e7 ldi r25, 0x76 ; 118 aaf0: 9f 93 push r25 aaf2: 8f 93 push r24 aaf4: 0f 94 9e 9e call 0x33d3c ; 0x33d3c aaf8: 0f 90 pop r0 aafa: 0f 90 pop r0 aafc: 0f 90 pop r0 aafe: 0f 90 pop r0 ab00: 0f 90 pop r0 ab02: 0f 90 pop r0 return (int8_t)temp; // Value is valid, use it } } else if (eeprom_bed_correction_valid) { return (int8_t)eeprom_read_byte(eep_address); } return 0; ab04: 80 e0 ldi r24, 0x00 ; 0 }; ab06: df 91 pop r29 ab08: cf 91 pop r28 ab0a: 1f 91 pop r17 ab0c: 0f 91 pop r16 ab0e: 08 95 ret if (abs(temp) > BED_ADJUSTMENT_UM_MAX) { printf_P(PSTR("%SExcessive bed leveling correction: %i microns\n"), errormagic, temp); } else { return (int8_t)temp; // Value is valid, use it } } else if (eeprom_bed_correction_valid) { ab10: f8 01 movw r30, r16 ab12: 80 81 ld r24, Z ab14: 88 23 and r24, r24 ab16: b1 f3 breq .-20 ; 0xab04 return (int8_t)eeprom_read_byte(eep_address); ab18: ce 01 movw r24, r28 } return 0; }; ab1a: df 91 pop r29 ab1c: cf 91 pop r28 ab1e: 1f 91 pop r17 ab20: 0f 91 pop r16 printf_P(PSTR("%SExcessive bed leveling correction: %i microns\n"), errormagic, temp); } else { return (int8_t)temp; // Value is valid, use it } } else if (eeprom_bed_correction_valid) { return (int8_t)eeprom_read_byte(eep_address); ab22: 0d 94 dc 9f jmp 0x33fb8 ; 0x33fb8 0000ab26 : // Return True if a character was found static inline bool code_seen(char code) { return (strchr_pointer = strchr(CMDBUFFER_CURRENT_STRING, code)) != NULL; } static inline bool code_seen_P(const char *code_PROGMEM) { return (strchr_pointer = strstr_P(CMDBUFFER_CURRENT_STRING, code_PROGMEM)) != NULL; } static inline float code_value() { return strtod_noE(strchr_pointer+1, NULL);} static inline long code_value_long() { return strtol(strchr_pointer+1, NULL, 10); } ab26: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 ab2a: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 ab2e: 4a e0 ldi r20, 0x0A ; 10 ab30: 50 e0 ldi r21, 0x00 ; 0 ab32: 70 e0 ldi r23, 0x00 ; 0 ab34: 60 e0 ldi r22, 0x00 ; 0 ab36: 01 96 adiw r24, 0x01 ; 1 ab38: 0d 94 67 9b jmp 0x336ce ; 0x336ce 0000ab3c : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); ab3c: 60 e0 ldi r22, 0x00 ; 0 ab3e: 86 e6 ldi r24, 0x66 ; 102 ab40: 9f e0 ldi r25, 0x0F ; 15 ab42: 0f 94 00 a0 call 0x34000 ; 0x34000 ab46: 60 e0 ldi r22, 0x00 ; 0 ab48: 88 e6 ldi r24, 0x68 ; 104 ab4a: 9f e0 ldi r25, 0x0F ; 15 ab4c: 0f 94 00 a0 call 0x34000 ; 0x34000 ab50: 60 e0 ldi r22, 0x00 ; 0 ab52: 85 e6 ldi r24, 0x65 ; 101 ab54: 9f e0 ldi r25, 0x0F ; 15 ab56: 0f 94 00 a0 call 0x34000 ; 0x34000 ab5a: 60 e0 ldi r22, 0x00 ; 0 ab5c: 84 e6 ldi r24, 0x64 ; 100 ab5e: 9f e0 ldi r25, 0x0F ; 15 ab60: 0f 94 00 a0 call 0x34000 ; 0x34000 ab64: 60 e0 ldi r22, 0x00 ; 0 ab66: 82 ed ldi r24, 0xD2 ; 210 ab68: 9e e0 ldi r25, 0x0E ; 14 ab6a: 0f 94 00 a0 call 0x34000 ; 0x34000 ab6e: 60 e0 ldi r22, 0x00 ; 0 ab70: 8f ec ldi r24, 0xCF ; 207 ab72: 9e e0 ldi r25, 0x0E ; 14 ab74: 0d 94 00 a0 jmp 0x34000 ; 0x34000 0000ab78 : // This function may update bufindw, therefore for the power panic to work, this function must be called // with the interrupts disabled! static bool __attribute__((noinline)) cmdqueue_could_enqueue_back(size_t len_asked) { // MAX_CMD_SIZE has to accommodate the zero terminator. if (len_asked >= MAX_CMD_SIZE) ab78: 80 36 cpi r24, 0x60 ; 96 ab7a: 91 05 cpc r25, r1 ab7c: f8 f4 brcc .+62 ; 0xabbc return false; if (bufindr == bufindw && buflen > 0) ab7e: 40 91 cb 11 lds r20, 0x11CB ; 0x8011cb ab82: 50 91 cc 11 lds r21, 0x11CC ; 0x8011cc ab86: 20 91 dc 0f lds r18, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> ab8a: 30 91 dd 0f lds r19, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> ab8e: 42 17 cp r20, r18 ab90: 53 07 cpc r21, r19 ab92: 39 f4 brne .+14 ; 0xaba2 ab94: 60 91 cf 11 lds r22, 0x11CF ; 0x8011cf ab98: 70 91 d0 11 lds r23, 0x11D0 ; 0x8011d0 ab9c: 16 16 cp r1, r22 ab9e: 17 06 cpc r1, r23 aba0: 6c f0 brlt .+26 ; 0xabbc // If there is some data stored starting at bufindw, len_asked is certainly smaller than // the allocated data buffer. Try to reserve a new buffer and to move the already received // serial data. // How much memory to reserve for the commands pushed to the front? // End of the queue, when pushing to the end. size_t endw = bufindw + len_asked + (1 + CMDHDRSIZE); aba2: b9 01 movw r22, r18 aba4: 68 0f add r22, r24 aba6: 79 1f adc r23, r25 aba8: fb 01 movw r30, r22 abaa: e3 59 subi r30, 0x93 ; 147 abac: ff 4f sbci r31, 0xFF ; 255 if (bufindw < bufindr) abae: 24 17 cp r18, r20 abb0: 35 07 cpc r19, r21 abb2: 30 f4 brcc .+12 ; 0xabc0 // Simple case. There is a contiguous space between the write buffer and the read buffer. return endw + CMDBUFFER_RESERVE_FRONT <= bufindr; abb4: 81 e0 ldi r24, 0x01 ; 1 abb6: 4e 17 cp r20, r30 abb8: 5f 07 cpc r21, r31 abba: 08 f4 brcc .+2 ; 0xabbe // with the interrupts disabled! static bool __attribute__((noinline)) cmdqueue_could_enqueue_back(size_t len_asked) { // MAX_CMD_SIZE has to accommodate the zero terminator. if (len_asked >= MAX_CMD_SIZE) return false; abbc: 80 e0 ldi r24, 0x00 ; 0 // Be careful! The bufindw needs to be changed atomically for the power panic & filament panic to work. ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { bufindw = 0; } return true; } return false; } abbe: 08 95 ret size_t endw = bufindw + len_asked + (1 + CMDHDRSIZE); if (bufindw < bufindr) // Simple case. There is a contiguous space between the write buffer and the read buffer. return endw + CMDBUFFER_RESERVE_FRONT <= bufindr; // Otherwise the free space is split between the start and end. if (// Could one fit to the end, including the reserve? abc0: ee 3e cpi r30, 0xEE ; 238 abc2: f1 40 sbci r31, 0x01 ; 1 abc4: f8 f0 brcs .+62 ; 0xac04 // If there is some data stored starting at bufindw, len_asked is certainly smaller than // the allocated data buffer. Try to reserve a new buffer and to move the already received // serial data. // How much memory to reserve for the commands pushed to the front? // End of the queue, when pushing to the end. size_t endw = bufindw + len_asked + (1 + CMDHDRSIZE); abc6: 6c 5f subi r22, 0xFC ; 252 abc8: 7f 4f sbci r23, 0xFF ; 255 if (bufindw < bufindr) // Simple case. There is a contiguous space between the write buffer and the read buffer. return endw + CMDBUFFER_RESERVE_FRONT <= bufindr; // Otherwise the free space is split between the start and end. if (// Could one fit to the end, including the reserve? endw + CMDBUFFER_RESERVE_FRONT <= sizeof(cmdbuffer) || abca: 6e 3e cpi r22, 0xEE ; 238 abcc: 71 40 sbci r23, 0x01 ; 1 abce: 18 f4 brcc .+6 ; 0xabd6 // Could one fit to the end, and the reserve to the start? (endw <= sizeof(cmdbuffer) && CMDBUFFER_RESERVE_FRONT <= bufindr)) abd0: 49 36 cpi r20, 0x69 ; 105 abd2: 51 05 cpc r21, r1 abd4: b8 f4 brcc .+46 ; 0xac04 return true; // Could one fit both to the start? if (len_asked + (1 + CMDHDRSIZE) + CMDBUFFER_RESERVE_FRONT <= bufindr) { abd6: 83 59 subi r24, 0x93 ; 147 abd8: 9f 4f sbci r25, 0xFF ; 255 abda: 48 17 cp r20, r24 abdc: 59 07 cpc r21, r25 abde: 70 f3 brcs .-36 ; 0xabbc // Mark the rest of the buffer as used. memset(cmdbuffer+bufindw, 0, sizeof(cmdbuffer)-bufindw); abe0: 4d ee ldi r20, 0xED ; 237 abe2: 51 e0 ldi r21, 0x01 ; 1 abe4: 42 1b sub r20, r18 abe6: 53 0b sbc r21, r19 abe8: 70 e0 ldi r23, 0x00 ; 0 abea: 60 e0 ldi r22, 0x00 ; 0 abec: c9 01 movw r24, r18 abee: 82 52 subi r24, 0x22 ; 34 abf0: 90 4f sbci r25, 0xF0 ; 240 abf2: 0f 94 0e a6 call 0x34c1c ; 0x34c1c // and point to the start. // Be careful! The bufindw needs to be changed atomically for the power panic & filament panic to work. ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { bufindw = 0; } abf6: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); abf8: f8 94 cli abfa: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> abfe: 10 92 dc 0f sts 0x0FDC, r1 ; 0x800fdc <_ZL7bufindw.lto_priv.516> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; ac02: 8f bf out 0x3f, r24 ; 63 // Otherwise the free space is split between the start and end. if (// Could one fit to the end, including the reserve? endw + CMDBUFFER_RESERVE_FRONT <= sizeof(cmdbuffer) || // Could one fit to the end, and the reserve to the start? (endw <= sizeof(cmdbuffer) && CMDBUFFER_RESERVE_FRONT <= bufindr)) return true; ac04: 81 e0 ldi r24, 0x01 ; 1 ac06: 08 95 ret 0000ac08 : //we have no temp compensation data } } #endif //ndef PINDA_THERMISTOR float temp_comp_interpolation(float inp_temperature) { ac08: 2f 92 push r2 ac0a: 3f 92 push r3 ac0c: 4f 92 push r4 ac0e: 5f 92 push r5 ac10: 6f 92 push r6 ac12: 7f 92 push r7 ac14: 8f 92 push r8 ac16: 9f 92 push r9 ac18: af 92 push r10 ac1a: bf 92 push r11 ac1c: cf 92 push r12 ac1e: df 92 push r13 ac20: ef 92 push r14 ac22: ff 92 push r15 ac24: 0f 93 push r16 ac26: 1f 93 push r17 ac28: cf 93 push r28 ac2a: df 93 push r29 ac2c: cd b7 in r28, 0x3d ; 61 ac2e: de b7 in r29, 0x3e ; 62 ac30: cc 58 subi r28, 0x8C ; 140 ac32: d2 40 sbci r29, 0x02 ; 2 ac34: 0f b6 in r0, 0x3f ; 63 ac36: f8 94 cli ac38: de bf out 0x3e, r29 ; 62 ac3a: 0f be out 0x3f, r0 ; 63 ac3c: cd bf out 0x3d, r28 ; 61 ac3e: cb 58 subi r28, 0x8B ; 139 ac40: dd 4f sbci r29, 0xFD ; 253 ac42: 68 83 st Y, r22 ac44: 79 83 std Y+1, r23 ; 0x01 ac46: 8a 83 std Y+2, r24 ; 0x02 ac48: 9b 83 std Y+3, r25 ; 0x03 ac4a: c5 57 subi r28, 0x75 ; 117 ac4c: d2 40 sbci r29, 0x02 ; 2 //cubic spline interpolation int n, i, j; float h[10], a, b, c, d, sum, s[10] = { 0 }, x[10], F[10], f[10], m[10][10] = { 0 }, temp; ac4e: fe 01 movw r30, r28 ac50: e7 54 subi r30, 0x47 ; 71 ac52: fe 4f sbci r31, 0xFE ; 254 ac54: 88 e2 ldi r24, 0x28 ; 40 ac56: df 01 movw r26, r30 ac58: 1d 92 st X+, r1 ac5a: 8a 95 dec r24 ac5c: e9 f7 brne .-6 ; 0xac58 ac5e: e8 5b subi r30, 0xB8 ; 184 ac60: f1 40 sbci r31, 0x01 ; 1 ac62: 1f 01 movw r2, r30 ac64: 80 e9 ldi r24, 0x90 ; 144 ac66: 91 e0 ldi r25, 0x01 ; 1 ac68: df 01 movw r26, r30 ac6a: fc 01 movw r30, r24 ac6c: 1d 92 st X+, r1 ac6e: 31 97 sbiw r30, 0x01 ; 1 ac70: e9 f7 brne .-6 ; 0xac6c int shift[10]; int temp_C[10]; n = 6; //number of measured points shift[0] = 0; ac72: c7 5a subi r28, 0xA7 ; 167 ac74: dd 4f sbci r29, 0xFD ; 253 ac76: 19 82 std Y+1, r1 ; 0x01 ac78: 18 82 st Y, r1 ac7a: c9 55 subi r28, 0x59 ; 89 ac7c: d2 40 sbci r29, 0x02 ; 2 ac7e: 9e 01 movw r18, r28 ac80: 2f 51 subi r18, 0x1F ; 31 ac82: 3e 4f sbci r19, 0xFE ; 254 ac84: c1 59 subi r28, 0x91 ; 145 ac86: dd 4f sbci r29, 0xFD ; 253 ac88: 39 83 std Y+1, r19 ; 0x01 ac8a: 28 83 st Y, r18 ac8c: cf 56 subi r28, 0x6F ; 111 ac8e: d2 40 sbci r29, 0x02 ; 2 ac90: 8e 01 movw r16, r28 ac92: 07 5a subi r16, 0xA7 ; 167 ac94: 1d 4f sbci r17, 0xFD ; 253 ac96: ce 01 movw r24, r28 ac98: 8f 5c subi r24, 0xCF ; 207 ac9a: 9d 4f sbci r25, 0xFD ; 253 ac9c: c3 59 subi r28, 0x93 ; 147 ac9e: dd 4f sbci r29, 0xFD ; 253 aca0: 99 83 std Y+1, r25 ; 0x01 aca2: 88 83 st Y, r24 aca4: cd 56 subi r28, 0x6D ; 109 aca6: d2 40 sbci r29, 0x02 ; 2 aca8: 3c 01 movw r6, r24 acaa: 49 01 movw r8, r18 acac: 40 eb ldi r20, 0xB0 ; 176 acae: a4 2e mov r10, r20 acb0: 4f e0 ldi r20, 0x0F ; 15 acb2: b4 2e mov r11, r20 acb4: 53 e2 ldi r21, 0x23 ; 35 acb6: c5 2e mov r12, r21 acb8: d1 2c mov r13, r1 for (i = 0; i < n; i++) { acba: f1 2c mov r15, r1 acbc: e1 2c mov r14, r1 static_assert(start_compensating_temp >= PINDA_MINTEMP, "Temperature compensation start point is lower than PINDA_MINTEMP."); #endif //SUPERPINDA_SUPPORT #else temp_C[i] = 50 + i * 10; //temperature in C #endif x[i] = (float)temp_C[i]; acbe: b6 01 movw r22, r12 acc0: 0d 2c mov r0, r13 acc2: 00 0c add r0, r0 acc4: 88 0b sbc r24, r24 acc6: 99 0b sbc r25, r25 acc8: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> accc: d4 01 movw r26, r8 acce: 6d 93 st X+, r22 acd0: 7d 93 st X+, r23 acd2: 8d 93 st X+, r24 acd4: 9d 93 st X+, r25 acd6: 4d 01 movw r8, r26 f[i] = (float)shift[i]; acd8: f8 01 movw r30, r16 acda: 61 91 ld r22, Z+ acdc: 71 91 ld r23, Z+ acde: 8f 01 movw r16, r30 ace0: 07 2e mov r0, r23 ace2: 00 0c add r0, r0 ace4: 88 0b sbc r24, r24 ace6: 99 0b sbc r25, r25 ace8: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> acec: d3 01 movw r26, r6 acee: 6d 93 st X+, r22 acf0: 7d 93 st X+, r23 acf2: 8d 93 st X+, r24 acf4: 9d 93 st X+, r25 acf6: 3d 01 movw r6, r26 int temp_C[10]; n = 6; //number of measured points shift[0] = 0; for (i = 0; i < n; i++) { acf8: bf ef ldi r27, 0xFF ; 255 acfa: eb 1a sub r14, r27 acfc: fb 0a sbc r15, r27 acfe: e6 e0 ldi r30, 0x06 ; 6 ad00: ee 16 cp r14, r30 ad02: f1 04 cpc r15, r1 ad04: 09 f0 breq .+2 ; 0xad08 ad06: 38 c3 rjmp .+1648 ; 0xb378 temp_C[i] = 50 + i * 10; //temperature in C #endif x[i] = (float)temp_C[i]; f[i] = (float)shift[i]; } if (inp_temperature < x[0]) return 0; ad08: cb 58 subi r28, 0x8B ; 139 ad0a: dd 4f sbci r29, 0xFD ; 253 ad0c: 28 81 ld r18, Y ad0e: 39 81 ldd r19, Y+1 ; 0x01 ad10: 4a 81 ldd r20, Y+2 ; 0x02 ad12: 5b 81 ldd r21, Y+3 ; 0x03 ad14: c5 57 subi r28, 0x75 ; 117 ad16: d2 40 sbci r29, 0x02 ; 2 ad18: c1 59 subi r28, 0x91 ; 145 ad1a: dd 4f sbci r29, 0xFD ; 253 ad1c: a8 81 ld r26, Y ad1e: b9 81 ldd r27, Y+1 ; 0x01 ad20: cf 56 subi r28, 0x6F ; 111 ad22: d2 40 sbci r29, 0x02 ; 2 ad24: 6d 91 ld r22, X+ ad26: 7d 91 ld r23, X+ ad28: 8d 91 ld r24, X+ ad2a: 9c 91 ld r25, X ad2c: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> ad30: 41 2c mov r4, r1 ad32: 51 2c mov r5, r1 ad34: 32 01 movw r6, r4 ad36: 18 16 cp r1, r24 ad38: 0c f4 brge .+2 ; 0xad3c ad3a: 02 c3 rjmp .+1540 ; 0xb340 ad3c: c3 59 subi r28, 0x93 ; 147 ad3e: dd 4f sbci r29, 0xFD ; 253 ad40: 08 81 ld r16, Y ad42: 19 81 ldd r17, Y+1 ; 0x01 ad44: cd 56 subi r28, 0x6D ; 109 ad46: d2 40 sbci r29, 0x02 ; 2 ad48: 0c 5e subi r16, 0xEC ; 236 ad4a: 1f 4f sbci r17, 0xFF ; 255 ad4c: c1 59 subi r28, 0x91 ; 145 ad4e: dd 4f sbci r29, 0xFD ; 253 ad50: e8 80 ld r14, Y ad52: f9 80 ldd r15, Y+1 ; 0x01 ad54: cf 56 subi r28, 0x6F ; 111 ad56: d2 40 sbci r29, 0x02 ; 2 ad58: b4 e1 ldi r27, 0x14 ; 20 ad5a: eb 0e add r14, r27 ad5c: f1 1c adc r15, r1 ad5e: 6e 01 movw r12, r28 ad60: ef ed ldi r30, 0xDF ; 223 ad62: ce 1a sub r12, r30 ad64: ed ef ldi r30, 0xFD ; 253 ad66: de 0a sbc r13, r30 ad68: 9e 01 movw r18, r28 ad6a: 2b 55 subi r18, 0x5B ; 91 ad6c: 3e 4f sbci r19, 0xFE ; 254 ad6e: cf 58 subi r28, 0x8F ; 143 ad70: dd 4f sbci r29, 0xFD ; 253 ad72: 39 83 std Y+1, r19 ; 0x01 ad74: 28 83 st Y, r18 ad76: c1 57 subi r28, 0x71 ; 113 ad78: d2 40 sbci r29, 0x02 ; 2 for (i = n - 1; i>0; i--) { F[i] = (f[i] - f[i - 1]) / (x[i] - x[i - 1]); ad7a: d8 01 movw r26, r16 ad7c: 4d 90 ld r4, X+ ad7e: 5d 90 ld r5, X+ ad80: 6d 90 ld r6, X+ ad82: 7c 90 ld r7, X ad84: f7 01 movw r30, r14 ad86: 60 81 ld r22, Z ad88: 71 81 ldd r23, Z+1 ; 0x01 ad8a: 82 81 ldd r24, Z+2 ; 0x02 ad8c: 93 81 ldd r25, Z+3 ; 0x03 ad8e: d7 01 movw r26, r14 ad90: 5e 91 ld r21, -X ad92: 4e 91 ld r20, -X ad94: 3e 91 ld r19, -X ad96: 2e 91 ld r18, -X ad98: 7d 01 movw r14, r26 ad9a: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> ad9e: 4b 01 movw r8, r22 ada0: 5c 01 movw r10, r24 ada2: f8 01 movw r30, r16 ada4: 52 91 ld r21, -Z ada6: 42 91 ld r20, -Z ada8: 32 91 ld r19, -Z adaa: 22 91 ld r18, -Z adac: 8f 01 movw r16, r30 adae: c3 01 movw r24, r6 adb0: b2 01 movw r22, r4 adb2: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> adb6: a5 01 movw r20, r10 adb8: 94 01 movw r18, r8 adba: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> adbe: d6 01 movw r26, r12 adc0: 9e 93 st -X, r25 adc2: 8e 93 st -X, r24 adc4: 7e 93 st -X, r23 adc6: 6e 93 st -X, r22 adc8: 6d 01 movw r12, r26 h[i - 1] = x[i] - x[i - 1]; adca: cf 58 subi r28, 0x8F ; 143 adcc: dd 4f sbci r29, 0xFD ; 253 adce: e8 81 ld r30, Y add0: f9 81 ldd r31, Y+1 ; 0x01 add2: c1 57 subi r28, 0x71 ; 113 add4: d2 40 sbci r29, 0x02 ; 2 add6: b2 92 st -Z, r11 add8: a2 92 st -Z, r10 adda: 92 92 st -Z, r9 addc: 82 92 st -Z, r8 adde: cf 58 subi r28, 0x8F ; 143 ade0: dd 4f sbci r29, 0xFD ; 253 ade2: f9 83 std Y+1, r31 ; 0x01 ade4: e8 83 st Y, r30 ade6: c1 57 subi r28, 0x71 ; 113 ade8: d2 40 sbci r29, 0x02 ; 2 f[i] = (float)shift[i]; } if (inp_temperature < x[0]) return 0; for (i = n - 1; i>0; i--) { adea: c3 59 subi r28, 0x93 ; 147 adec: dd 4f sbci r29, 0xFD ; 253 adee: 28 81 ld r18, Y adf0: 39 81 ldd r19, Y+1 ; 0x01 adf2: cd 56 subi r28, 0x6D ; 109 adf4: d2 40 sbci r29, 0x02 ; 2 adf6: 02 17 cp r16, r18 adf8: 13 07 cpc r17, r19 adfa: 09 f0 breq .+2 ; 0xadfe adfc: be cf rjmp .-132 ; 0xad7a adfe: 4e 01 movw r8, r28 ae00: 3f e6 ldi r19, 0x6F ; 111 ae02: 83 1a sub r8, r19 ae04: 3e ef ldi r19, 0xFE ; 254 ae06: 93 0a sbc r9, r19 ae08: 5e 01 movw r10, r28 ae0a: 83 ef ldi r24, 0xF3 ; 243 ae0c: a8 1a sub r10, r24 ae0e: 8d ef ldi r24, 0xFD ; 253 ae10: b8 0a sbc r11, r24 ae12: 61 01 movw r12, r2 ae14: 81 01 movw r16, r2 F[i] = (f[i] - f[i - 1]) / (x[i] - x[i - 1]); h[i - 1] = x[i] - x[i - 1]; } //*********** formation of h, s , f matrix ************** for (i = 1; i ae38: 9b 01 movw r18, r22 ae3a: ac 01 movw r20, r24 ae3c: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> ae40: f8 01 movw r30, r16 ae42: 64 a7 std Z+44, r22 ; 0x2c ae44: 75 a7 std Z+45, r23 ; 0x2d ae46: 86 a7 std Z+46, r24 ; 0x2e ae48: 97 a7 std Z+47, r25 ; 0x2f if (i != 1) { ae4a: f1 e0 ldi r31, 0x01 ; 1 ae4c: ef 16 cp r14, r31 ae4e: f1 04 cpc r15, r1 ae50: 61 f0 breq .+24 ; 0xae6a m[i][i - 1] = h[i - 1]; ae52: d8 01 movw r26, r16 ae54: 98 96 adiw r26, 0x28 ; 40 ae56: 4d 92 st X+, r4 ae58: 5d 92 st X+, r5 ae5a: 6d 92 st X+, r6 ae5c: 7c 92 st X, r7 ae5e: 9b 97 sbiw r26, 0x2b ; 43 m[i - 1][i] = h[i - 1]; ae60: f8 01 movw r30, r16 ae62: 44 82 std Z+4, r4 ; 0x04 ae64: 55 82 std Z+5, r5 ; 0x05 ae66: 66 82 std Z+6, r6 ; 0x06 ae68: 77 82 std Z+7, r7 ; 0x07 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); ae6a: ff ef ldi r31, 0xFF ; 255 ae6c: ef 1a sub r14, r31 ae6e: ff 0a sbc r15, r31 ae70: f5 01 movw r30, r10 ae72: 20 81 ld r18, Z ae74: 31 81 ldd r19, Z+1 ; 0x01 ae76: 42 81 ldd r20, Z+2 ; 0x02 ae78: 53 81 ldd r21, Z+3 ; 0x03 ae7a: 84 e0 ldi r24, 0x04 ; 4 ae7c: a8 0e add r10, r24 ae7e: b1 1c adc r11, r1 ae80: 64 81 ldd r22, Z+4 ; 0x04 ae82: 75 81 ldd r23, Z+5 ; 0x05 ae84: 86 81 ldd r24, Z+6 ; 0x06 ae86: 97 81 ldd r25, Z+7 ; 0x07 ae88: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> ae8c: 20 e0 ldi r18, 0x00 ; 0 ae8e: 30 e0 ldi r19, 0x00 ; 0 ae90: 40 ec ldi r20, 0xC0 ; 192 ae92: 50 e4 ldi r21, 0x40 ; 64 ae94: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> ae98: d6 01 movw r26, r12 ae9a: dc 96 adiw r26, 0x3c ; 60 ae9c: 6d 93 st X+, r22 ae9e: 7d 93 st X+, r23 aea0: 8d 93 st X+, r24 aea2: 9c 93 st X, r25 aea4: df 97 sbiw r26, 0x3f ; 63 aea6: 04 5d subi r16, 0xD4 ; 212 aea8: 1f 4f sbci r17, 0xFF ; 255 aeaa: b8 e2 ldi r27, 0x28 ; 40 aeac: cb 0e add r12, r27 aeae: d1 1c adc r13, r1 for (i = n - 1; i>0; i--) { F[i] = (f[i] - f[i - 1]) / (x[i] - x[i - 1]); h[i - 1] = x[i] - x[i - 1]; } //*********** formation of h, s , f matrix ************** for (i = 1; i aeb8: b1 cf rjmp .-158 ; 0xae1c aeba: 7e 01 movw r14, r28 aebc: fd e2 ldi r31, 0x2D ; 45 aebe: ef 0e add r14, r31 aec0: f1 1c adc r15, r1 aec2: 28 e2 ldi r18, 0x28 ; 40 aec4: a2 2e mov r10, r18 aec6: b1 2c mov r11, r1 aec8: 00 eb ldi r16, 0xB0 ; 176 aeca: 1f ef ldi r17, 0xFF ; 255 aecc: 24 e0 ldi r18, 0x04 ; 4 aece: 22 0e add r2, r18 aed0: 31 1c adc r3, r1 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i aeee: 2b 01 movw r4, r22 aef0: 3c 01 movw r6, r24 aef2: 61 01 movw r12, r2 aef4: c0 1a sub r12, r16 aef6: d1 0a sbc r13, r17 for (j = 1; j <= n - 1; j++) aef8: 88 24 eor r8, r8 aefa: 83 94 inc r8 aefc: 91 2c mov r9, r1 m[i + 1][j] -= temp*m[i][j]; aefe: f6 01 movw r30, r12 af00: e0 0f add r30, r16 af02: f1 1f adc r31, r17 af04: ea 0d add r30, r10 af06: fb 1d adc r31, r11 af08: 20 81 ld r18, Z af0a: 31 81 ldd r19, Z+1 ; 0x01 af0c: 42 81 ldd r20, Z+2 ; 0x02 af0e: 53 81 ldd r21, Z+3 ; 0x03 af10: c3 01 movw r24, r6 af12: b2 01 movw r22, r4 af14: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> af18: 9b 01 movw r18, r22 af1a: ac 01 movw r20, r24 af1c: f6 01 movw r30, r12 af1e: 60 81 ld r22, Z af20: 71 81 ldd r23, Z+1 ; 0x01 af22: 82 81 ldd r24, Z+2 ; 0x02 af24: 93 81 ldd r25, Z+3 ; 0x03 af26: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> af2a: d6 01 movw r26, r12 af2c: 6d 93 st X+, r22 af2e: 7d 93 st X+, r23 af30: 8d 93 st X+, r24 af32: 9d 93 st X+, r25 af34: 6d 01 movw r12, r26 m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i af44: 3c e2 ldi r19, 0x2C ; 44 af46: e3 0e add r14, r19 af48: f1 1c adc r15, r1 af4a: 08 52 subi r16, 0x28 ; 40 af4c: 11 09 sbc r17, r1 af4e: 88 e2 ldi r24, 0x28 ; 40 af50: a8 0e add r10, r24 af52: b1 1c adc r11, r1 m[i - 1][i] = h[i - 1]; } m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i af5c: ba cf rjmp .-140 ; 0xaed2 af5e: 1e 01 movw r2, r28 af60: f5 eb ldi r31, 0xB5 ; 181 af62: 2f 0e add r2, r31 af64: 31 1c adc r3, r1 af66: 6e 01 movw r12, r28 af68: 21 eb ldi r18, 0xB1 ; 177 af6a: c2 0e add r12, r18 af6c: d1 1c adc r13, r1 af6e: 7e 01 movw r14, r28 af70: 37 e3 ldi r19, 0x37 ; 55 af72: e3 1a sub r14, r19 af74: 3e ef ldi r19, 0xFE ; 254 af76: f3 0a sbc r15, r19 temp = (m[i + 1][i] / m[i][i]); for (j = 1; j <= n - 1; j++) m[i + 1][j] -= temp*m[i][j]; } //*********** backward substitution ********* for (i = n - 2; i>0; i--) { af78: 04 e0 ldi r16, 0x04 ; 4 af7a: 10 e0 ldi r17, 0x00 ; 0 af7c: 48 01 movw r8, r16 af7e: b1 2c mov r11, r1 af80: a1 2c mov r10, r1 sum = 0; af82: 41 2c mov r4, r1 af84: 51 2c mov r5, r1 af86: 32 01 movw r6, r4 for (j = i; j <= n - 2; j++) sum += m[i][j] * s[j]; af88: f6 01 movw r30, r12 af8a: ea 0d add r30, r10 af8c: fb 1d adc r31, r11 af8e: d7 01 movw r26, r14 af90: aa 0d add r26, r10 af92: bb 1d adc r27, r11 af94: 2d 91 ld r18, X+ af96: 3d 91 ld r19, X+ af98: 4d 91 ld r20, X+ af9a: 5c 91 ld r21, X af9c: 60 81 ld r22, Z af9e: 71 81 ldd r23, Z+1 ; 0x01 afa0: 82 81 ldd r24, Z+2 ; 0x02 afa2: 93 81 ldd r25, Z+3 ; 0x03 afa4: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> afa8: 9b 01 movw r18, r22 afaa: ac 01 movw r20, r24 afac: c3 01 movw r24, r6 afae: b2 01 movw r22, r4 afb0: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> afb4: 2b 01 movw r4, r22 afb6: 3c 01 movw r6, r24 m[i + 1][j] -= temp*m[i][j]; } //*********** backward substitution ********* for (i = n - 2; i>0; i--) { sum = 0; for (j = i; j <= n - 2; j++) afb8: 8f ef ldi r24, 0xFF ; 255 afba: 88 1a sub r8, r24 afbc: 98 0a sbc r9, r24 afbe: 94 e0 ldi r25, 0x04 ; 4 afc0: a9 0e add r10, r25 afc2: b1 1c adc r11, r1 afc4: a5 e0 ldi r26, 0x05 ; 5 afc6: 8a 16 cp r8, r26 afc8: 91 04 cpc r9, r1 afca: f1 f6 brne .-68 ; 0xaf88 sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; afcc: a3 01 movw r20, r6 afce: 92 01 movw r18, r4 afd0: f1 01 movw r30, r2 afd2: 60 81 ld r22, Z afd4: 71 81 ldd r23, Z+1 ; 0x01 afd6: 82 81 ldd r24, Z+2 ; 0x02 afd8: 93 81 ldd r25, Z+3 ; 0x03 afda: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> afde: d6 01 movw r26, r12 afe0: 2d 91 ld r18, X+ afe2: 3d 91 ld r19, X+ afe4: 4d 91 ld r20, X+ afe6: 5c 91 ld r21, X afe8: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> afec: f7 01 movw r30, r14 afee: 60 83 st Z, r22 aff0: 71 83 std Z+1, r23 ; 0x01 aff2: 82 83 std Z+2, r24 ; 0x02 aff4: 93 83 std Z+3, r25 ; 0x03 temp = (m[i + 1][i] / m[i][i]); for (j = 1; j <= n - 1; j++) m[i + 1][j] -= temp*m[i][j]; } //*********** backward substitution ********* for (i = n - 2; i>0; i--) { aff6: 01 50 subi r16, 0x01 ; 1 aff8: 11 09 sbc r17, r1 affa: f8 e2 ldi r31, 0x28 ; 40 affc: 2f 1a sub r2, r31 affe: 31 08 sbc r3, r1 b000: 2c e2 ldi r18, 0x2C ; 44 b002: c2 1a sub r12, r18 b004: d1 08 sbc r13, r1 b006: 34 e0 ldi r19, 0x04 ; 4 b008: e3 1a sub r14, r19 b00a: f1 08 sbc r15, r1 b00c: 01 15 cp r16, r1 b00e: 11 05 cpc r17, r1 b010: 09 f0 breq .+2 ; 0xb014 b012: b4 cf rjmp .-152 ; 0xaf7c sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; } for (i = 0; i x[i + 1])) { b014: cb 50 subi r28, 0x0B ; 11 b016: de 4f sbci r29, 0xFE ; 254 b018: 88 81 ld r24, Y b01a: 99 81 ldd r25, Y+1 ; 0x01 b01c: aa 81 ldd r26, Y+2 ; 0x02 b01e: bb 81 ldd r27, Y+3 ; 0x03 b020: c5 5f subi r28, 0xF5 ; 245 b022: d1 40 sbci r29, 0x01 ; 1 b024: cf 57 subi r28, 0x7F ; 127 b026: dd 4f sbci r29, 0xFD ; 253 b028: 88 83 st Y, r24 b02a: 99 83 std Y+1, r25 ; 0x01 b02c: aa 83 std Y+2, r26 ; 0x02 b02e: bb 83 std Y+3, r27 ; 0x03 b030: c1 58 subi r28, 0x81 ; 129 b032: d2 40 sbci r29, 0x02 ; 2 b034: 1e 01 movw r2, r28 b036: 97 e4 ldi r25, 0x47 ; 71 b038: 29 1a sub r2, r25 b03a: 9e ef ldi r25, 0xFE ; 254 b03c: 39 0a sbc r3, r25 b03e: 10 e0 ldi r17, 0x00 ; 0 b040: 00 e0 ldi r16, 0x00 ; 0 b042: c1 59 subi r28, 0x91 ; 145 b044: dd 4f sbci r29, 0xFD ; 253 b046: a8 81 ld r26, Y b048: b9 81 ldd r27, Y+1 ; 0x01 b04a: cf 56 subi r28, 0x6F ; 111 b04c: d2 40 sbci r29, 0x02 ; 2 b04e: cd 90 ld r12, X+ b050: dd 90 ld r13, X+ b052: ed 90 ld r14, X+ b054: fd 90 ld r15, X+ b056: c1 59 subi r28, 0x91 ; 145 b058: dd 4f sbci r29, 0xFD ; 253 b05a: b9 83 std Y+1, r27 ; 0x01 b05c: a8 83 st Y, r26 b05e: cf 56 subi r28, 0x6F ; 111 b060: d2 40 sbci r29, 0x02 ; 2 b062: cb 58 subi r28, 0x8B ; 139 b064: dd 4f sbci r29, 0xFD ; 253 b066: 28 81 ld r18, Y b068: 39 81 ldd r19, Y+1 ; 0x01 b06a: 4a 81 ldd r20, Y+2 ; 0x02 b06c: 5b 81 ldd r21, Y+3 ; 0x03 b06e: c5 57 subi r28, 0x75 ; 117 b070: d2 40 sbci r29, 0x02 ; 2 b072: c7 01 movw r24, r14 b074: b6 01 movw r22, r12 b076: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> b07a: 18 16 cp r1, r24 b07c: b4 f0 brlt .+44 ; 0xb0aa b07e: cb 58 subi r28, 0x8B ; 139 b080: dd 4f sbci r29, 0xFD ; 253 b082: 28 81 ld r18, Y b084: 39 81 ldd r19, Y+1 ; 0x01 b086: 4a 81 ldd r20, Y+2 ; 0x02 b088: 5b 81 ldd r21, Y+3 ; 0x03 b08a: c5 57 subi r28, 0x75 ; 117 b08c: d2 40 sbci r29, 0x02 ; 2 b08e: c1 59 subi r28, 0x91 ; 145 b090: dd 4f sbci r29, 0xFD ; 253 b092: e8 81 ld r30, Y b094: f9 81 ldd r31, Y+1 ; 0x01 b096: cf 56 subi r28, 0x6F ; 111 b098: d2 40 sbci r29, 0x02 ; 2 b09a: 60 81 ld r22, Z b09c: 71 81 ldd r23, Z+1 ; 0x01 b09e: 82 81 ldd r24, Z+2 ; 0x02 b0a0: 93 81 ldd r25, Z+3 ; 0x03 b0a2: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> b0a6: 87 ff sbrs r24, 7 b0a8: 18 c0 rjmp .+48 ; 0xb0da b0aa: 04 30 cpi r16, 0x04 ; 4 b0ac: 11 05 cpc r17, r1 b0ae: 09 f0 breq .+2 ; 0xb0b2 b0b0: 30 c1 rjmp .+608 ; 0xb312 b0b2: cb 58 subi r28, 0x8B ; 139 b0b4: dd 4f sbci r29, 0xFD ; 253 b0b6: 28 81 ld r18, Y b0b8: 39 81 ldd r19, Y+1 ; 0x01 b0ba: 4a 81 ldd r20, Y+2 ; 0x02 b0bc: 5b 81 ldd r21, Y+3 ; 0x03 b0be: c5 57 subi r28, 0x75 ; 117 b0c0: d2 40 sbci r29, 0x02 ; 2 b0c2: cf 57 subi r28, 0x7F ; 127 b0c4: dd 4f sbci r29, 0xFD ; 253 b0c6: 68 81 ld r22, Y b0c8: 79 81 ldd r23, Y+1 ; 0x01 b0ca: 8a 81 ldd r24, Y+2 ; 0x02 b0cc: 9b 81 ldd r25, Y+3 ; 0x03 b0ce: c1 58 subi r28, 0x81 ; 129 b0d0: d2 40 sbci r29, 0x02 ; 2 b0d2: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> b0d6: 87 ff sbrs r24, 7 b0d8: 1c c1 rjmp .+568 ; 0xb312 a = (s[i + 1] - s[i]) / (6 * h[i]); b0da: d1 01 movw r26, r2 b0dc: 14 96 adiw r26, 0x04 ; 4 b0de: 8d 90 ld r8, X+ b0e0: 9d 90 ld r9, X+ b0e2: ad 90 ld r10, X+ b0e4: bc 90 ld r11, X b0e6: 17 97 sbiw r26, 0x07 ; 7 b0e8: 8d 91 ld r24, X+ b0ea: 9d 91 ld r25, X+ b0ec: 0d 90 ld r0, X+ b0ee: bc 91 ld r27, X b0f0: a0 2d mov r26, r0 b0f2: cf 58 subi r28, 0x8F ; 143 b0f4: dd 4f sbci r29, 0xFD ; 253 b0f6: 88 83 st Y, r24 b0f8: 99 83 std Y+1, r25 ; 0x01 b0fa: aa 83 std Y+2, r26 ; 0x02 b0fc: bb 83 std Y+3, r27 ; 0x03 b0fe: c1 57 subi r28, 0x71 ; 113 b100: d2 40 sbci r29, 0x02 ; 2 b102: f8 01 movw r30, r16 b104: ee 0f add r30, r30 b106: ff 1f adc r31, r31 b108: ee 0f add r30, r30 b10a: ff 1f adc r31, r31 b10c: 21 e9 ldi r18, 0x91 ; 145 b10e: 31 e0 ldi r19, 0x01 ; 1 b110: 2c 0f add r18, r28 b112: 3d 1f adc r19, r29 b114: e2 0f add r30, r18 b116: f3 1f adc r31, r19 b118: 40 80 ld r4, Z b11a: 51 80 ldd r5, Z+1 ; 0x01 b11c: 62 80 ldd r6, Z+2 ; 0x02 b11e: 73 80 ldd r7, Z+3 ; 0x03 b = s[i] / 2; c = (f[i + 1] - f[i]) / h[i] - (2 * h[i] * s[i] + s[i + 1] * h[i]) / 6; b120: c3 59 subi r28, 0x93 ; 147 b122: dd 4f sbci r29, 0xFD ; 253 b124: a8 81 ld r26, Y b126: b9 81 ldd r27, Y+1 ; 0x01 b128: cd 56 subi r28, 0x6D ; 109 b12a: d2 40 sbci r29, 0x02 ; 2 b12c: 8d 91 ld r24, X+ b12e: 9d 91 ld r25, X+ b130: 0d 90 ld r0, X+ b132: bc 91 ld r27, X b134: a0 2d mov r26, r0 b136: c3 58 subi r28, 0x83 ; 131 b138: dd 4f sbci r29, 0xFD ; 253 b13a: 88 83 st Y, r24 b13c: 99 83 std Y+1, r25 ; 0x01 b13e: aa 83 std Y+2, r26 ; 0x02 b140: bb 83 std Y+3, r27 ; 0x03 b142: cd 57 subi r28, 0x7D ; 125 b144: d2 40 sbci r29, 0x02 ; 2 d = f[i]; sum = a*pow((inp_temperature - x[i]), 3) + b*pow((inp_temperature - x[i]), 2) + c*(inp_temperature - x[i]) + d; b146: a7 01 movw r20, r14 b148: 96 01 movw r18, r12 b14a: cb 58 subi r28, 0x8B ; 139 b14c: dd 4f sbci r29, 0xFD ; 253 b14e: 68 81 ld r22, Y b150: 79 81 ldd r23, Y+1 ; 0x01 b152: 8a 81 ldd r24, Y+2 ; 0x02 b154: 9b 81 ldd r25, Y+3 ; 0x03 b156: c5 57 subi r28, 0x75 ; 117 b158: d2 40 sbci r29, 0x02 ; 2 b15a: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> b15e: 6b 01 movw r12, r22 b160: 7c 01 movw r14, r24 b162: 20 e0 ldi r18, 0x00 ; 0 b164: 30 e0 ldi r19, 0x00 ; 0 b166: 40 e4 ldi r20, 0x40 ; 64 b168: 50 e4 ldi r21, 0x40 ; 64 b16a: 0f 94 74 a4 call 0x348e8 ; 0x348e8 b16e: cb 57 subi r28, 0x7B ; 123 b170: dd 4f sbci r29, 0xFD ; 253 b172: 68 83 st Y, r22 b174: 79 83 std Y+1, r23 ; 0x01 b176: 8a 83 std Y+2, r24 ; 0x02 b178: 9b 83 std Y+3, r25 ; 0x03 b17a: c5 58 subi r28, 0x85 ; 133 b17c: d2 40 sbci r29, 0x02 ; 2 for (i = 0; i x[i + 1])) { a = (s[i + 1] - s[i]) / (6 * h[i]); b = s[i] / 2; c = (f[i + 1] - f[i]) / h[i] - (2 * h[i] * s[i] + s[i + 1] * h[i]) / 6; b17e: c3 58 subi r28, 0x83 ; 131 b180: dd 4f sbci r29, 0xFD ; 253 b182: 28 81 ld r18, Y b184: 39 81 ldd r19, Y+1 ; 0x01 b186: 4a 81 ldd r20, Y+2 ; 0x02 b188: 5b 81 ldd r21, Y+3 ; 0x03 b18a: cd 57 subi r28, 0x7D ; 125 b18c: d2 40 sbci r29, 0x02 ; 2 b18e: c3 59 subi r28, 0x93 ; 147 b190: dd 4f sbci r29, 0xFD ; 253 b192: e8 81 ld r30, Y b194: f9 81 ldd r31, Y+1 ; 0x01 b196: cd 56 subi r28, 0x6D ; 109 b198: d2 40 sbci r29, 0x02 ; 2 b19a: 64 81 ldd r22, Z+4 ; 0x04 b19c: 75 81 ldd r23, Z+5 ; 0x05 b19e: 86 81 ldd r24, Z+6 ; 0x06 b1a0: 97 81 ldd r25, Z+7 ; 0x07 b1a2: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> b1a6: a3 01 movw r20, r6 b1a8: 92 01 movw r18, r4 b1aa: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> b1ae: c7 58 subi r28, 0x87 ; 135 b1b0: dd 4f sbci r29, 0xFD ; 253 b1b2: 68 83 st Y, r22 b1b4: 79 83 std Y+1, r23 ; 0x01 b1b6: 8a 83 std Y+2, r24 ; 0x02 b1b8: 9b 83 std Y+3, r25 ; 0x03 b1ba: c9 57 subi r28, 0x79 ; 121 b1bc: d2 40 sbci r29, 0x02 ; 2 b1be: a3 01 movw r20, r6 b1c0: 92 01 movw r18, r4 b1c2: c3 01 movw r24, r6 b1c4: b2 01 movw r22, r4 b1c6: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> b1ca: cf 58 subi r28, 0x8F ; 143 b1cc: dd 4f sbci r29, 0xFD ; 253 b1ce: 28 81 ld r18, Y b1d0: 39 81 ldd r19, Y+1 ; 0x01 b1d2: 4a 81 ldd r20, Y+2 ; 0x02 b1d4: 5b 81 ldd r21, Y+3 ; 0x03 b1d6: c1 57 subi r28, 0x71 ; 113 b1d8: d2 40 sbci r29, 0x02 ; 2 b1da: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> b1de: c7 57 subi r28, 0x77 ; 119 b1e0: dd 4f sbci r29, 0xFD ; 253 b1e2: 68 83 st Y, r22 b1e4: 79 83 std Y+1, r23 ; 0x01 b1e6: 8a 83 std Y+2, r24 ; 0x02 b1e8: 9b 83 std Y+3, r25 ; 0x03 b1ea: c9 58 subi r28, 0x89 ; 137 b1ec: d2 40 sbci r29, 0x02 ; 2 b1ee: a3 01 movw r20, r6 b1f0: 92 01 movw r18, r4 b1f2: c5 01 movw r24, r10 b1f4: b4 01 movw r22, r8 b1f6: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> b1fa: 9b 01 movw r18, r22 b1fc: ac 01 movw r20, r24 b1fe: c7 57 subi r28, 0x77 ; 119 b200: dd 4f sbci r29, 0xFD ; 253 b202: 68 81 ld r22, Y b204: 79 81 ldd r23, Y+1 ; 0x01 b206: 8a 81 ldd r24, Y+2 ; 0x02 b208: 9b 81 ldd r25, Y+3 ; 0x03 b20a: c9 58 subi r28, 0x89 ; 137 b20c: d2 40 sbci r29, 0x02 ; 2 b20e: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> b212: 20 e0 ldi r18, 0x00 ; 0 b214: 30 e0 ldi r19, 0x00 ; 0 b216: 40 ec ldi r20, 0xC0 ; 192 b218: 50 e4 ldi r21, 0x40 ; 64 b21a: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> b21e: 9b 01 movw r18, r22 b220: ac 01 movw r20, r24 b222: c7 58 subi r28, 0x87 ; 135 b224: dd 4f sbci r29, 0xFD ; 253 b226: 68 81 ld r22, Y b228: 79 81 ldd r23, Y+1 ; 0x01 b22a: 8a 81 ldd r24, Y+2 ; 0x02 b22c: 9b 81 ldd r25, Y+3 ; 0x03 b22e: c9 57 subi r28, 0x79 ; 121 b230: d2 40 sbci r29, 0x02 ; 2 b232: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> d = f[i]; sum = a*pow((inp_temperature - x[i]), 3) + b*pow((inp_temperature - x[i]), 2) + c*(inp_temperature - x[i]) + d; b236: a7 01 movw r20, r14 b238: 96 01 movw r18, r12 b23a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> b23e: c7 58 subi r28, 0x87 ; 135 b240: dd 4f sbci r29, 0xFD ; 253 b242: 68 83 st Y, r22 b244: 79 83 std Y+1, r23 ; 0x01 b246: 8a 83 std Y+2, r24 ; 0x02 b248: 9b 83 std Y+3, r25 ; 0x03 b24a: c9 57 subi r28, 0x79 ; 121 b24c: d2 40 sbci r29, 0x02 ; 2 s[i] = (m[i][n - 1] - sum) / m[i][i]; } for (i = 0; i x[i + 1])) { a = (s[i + 1] - s[i]) / (6 * h[i]); b24e: cf 58 subi r28, 0x8F ; 143 b250: dd 4f sbci r29, 0xFD ; 253 b252: 28 81 ld r18, Y b254: 39 81 ldd r19, Y+1 ; 0x01 b256: 4a 81 ldd r20, Y+2 ; 0x02 b258: 5b 81 ldd r21, Y+3 ; 0x03 b25a: c1 57 subi r28, 0x71 ; 113 b25c: d2 40 sbci r29, 0x02 ; 2 b25e: c5 01 movw r24, r10 b260: b4 01 movw r22, r8 b262: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> b266: 4b 01 movw r8, r22 b268: 5c 01 movw r10, r24 b26a: 20 e0 ldi r18, 0x00 ; 0 b26c: 30 e0 ldi r19, 0x00 ; 0 b26e: 40 ec ldi r20, 0xC0 ; 192 b270: 50 e4 ldi r21, 0x40 ; 64 b272: c3 01 movw r24, r6 b274: b2 01 movw r22, r4 b276: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> b27a: 9b 01 movw r18, r22 b27c: ac 01 movw r20, r24 b27e: c5 01 movw r24, r10 b280: b4 01 movw r22, r8 b282: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> b = s[i] / 2; c = (f[i + 1] - f[i]) / h[i] - (2 * h[i] * s[i] + s[i + 1] * h[i]) / 6; d = f[i]; sum = a*pow((inp_temperature - x[i]), 3) + b*pow((inp_temperature - x[i]), 2) + c*(inp_temperature - x[i]) + d; b286: cb 57 subi r28, 0x7B ; 123 b288: dd 4f sbci r29, 0xFD ; 253 b28a: 28 81 ld r18, Y b28c: 39 81 ldd r19, Y+1 ; 0x01 b28e: 4a 81 ldd r20, Y+2 ; 0x02 b290: 5b 81 ldd r21, Y+3 ; 0x03 b292: c5 58 subi r28, 0x85 ; 133 b294: d2 40 sbci r29, 0x02 ; 2 b296: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> b29a: 4b 01 movw r8, r22 b29c: 5c 01 movw r10, r24 } for (i = 0; i x[i + 1])) { a = (s[i + 1] - s[i]) / (6 * h[i]); b = s[i] / 2; b29e: 20 e0 ldi r18, 0x00 ; 0 b2a0: 30 e0 ldi r19, 0x00 ; 0 b2a2: 40 e0 ldi r20, 0x00 ; 0 b2a4: 5f e3 ldi r21, 0x3F ; 63 b2a6: cf 58 subi r28, 0x8F ; 143 b2a8: dd 4f sbci r29, 0xFD ; 253 b2aa: 68 81 ld r22, Y b2ac: 79 81 ldd r23, Y+1 ; 0x01 b2ae: 8a 81 ldd r24, Y+2 ; 0x02 b2b0: 9b 81 ldd r25, Y+3 ; 0x03 b2b2: c1 57 subi r28, 0x71 ; 113 b2b4: d2 40 sbci r29, 0x02 ; 2 b2b6: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> b2ba: 2b 01 movw r4, r22 b2bc: 3c 01 movw r6, r24 c = (f[i + 1] - f[i]) / h[i] - (2 * h[i] * s[i] + s[i + 1] * h[i]) / 6; d = f[i]; sum = a*pow((inp_temperature - x[i]), 3) + b*pow((inp_temperature - x[i]), 2) + c*(inp_temperature - x[i]) + d; b2be: a7 01 movw r20, r14 b2c0: 96 01 movw r18, r12 b2c2: c7 01 movw r24, r14 b2c4: b6 01 movw r22, r12 b2c6: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> b2ca: 9b 01 movw r18, r22 b2cc: ac 01 movw r20, r24 b2ce: c3 01 movw r24, r6 b2d0: b2 01 movw r22, r4 b2d2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> b2d6: 9b 01 movw r18, r22 b2d8: ac 01 movw r20, r24 b2da: c5 01 movw r24, r10 b2dc: b4 01 movw r22, r8 b2de: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> b2e2: 9b 01 movw r18, r22 b2e4: ac 01 movw r20, r24 b2e6: c7 58 subi r28, 0x87 ; 135 b2e8: dd 4f sbci r29, 0xFD ; 253 b2ea: 68 81 ld r22, Y b2ec: 79 81 ldd r23, Y+1 ; 0x01 b2ee: 8a 81 ldd r24, Y+2 ; 0x02 b2f0: 9b 81 ldd r25, Y+3 ; 0x03 b2f2: c9 57 subi r28, 0x79 ; 121 b2f4: d2 40 sbci r29, 0x02 ; 2 b2f6: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> b2fa: c3 58 subi r28, 0x83 ; 131 b2fc: dd 4f sbci r29, 0xFD ; 253 b2fe: 28 81 ld r18, Y b300: 39 81 ldd r19, Y+1 ; 0x01 b302: 4a 81 ldd r20, Y+2 ; 0x02 b304: 5b 81 ldd r21, Y+3 ; 0x03 b306: cd 57 subi r28, 0x7D ; 125 b308: d2 40 sbci r29, 0x02 ; 2 b30a: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> b30e: 2b 01 movw r4, r22 b310: 3c 01 movw r6, r24 b312: 0f 5f subi r16, 0xFF ; 255 b314: 1f 4f sbci r17, 0xFF ; 255 b316: f4 e0 ldi r31, 0x04 ; 4 b318: 2f 0e add r2, r31 b31a: 31 1c adc r3, r1 b31c: c3 59 subi r28, 0x93 ; 147 b31e: dd 4f sbci r29, 0xFD ; 253 b320: 28 81 ld r18, Y b322: 39 81 ldd r19, Y+1 ; 0x01 b324: cd 56 subi r28, 0x6D ; 109 b326: d2 40 sbci r29, 0x02 ; 2 b328: 2c 5f subi r18, 0xFC ; 252 b32a: 3f 4f sbci r19, 0xFF ; 255 b32c: c3 59 subi r28, 0x93 ; 147 b32e: dd 4f sbci r29, 0xFD ; 253 b330: 39 83 std Y+1, r19 ; 0x01 b332: 28 83 st Y, r18 b334: cd 56 subi r28, 0x6D ; 109 b336: d2 40 sbci r29, 0x02 ; 2 for (j = i; j <= n - 2; j++) sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; } for (i = 0; i b33e: 81 ce rjmp .-766 ; 0xb042 sum = a*pow((inp_temperature - x[i]), 3) + b*pow((inp_temperature - x[i]), 2) + c*(inp_temperature - x[i]) + d; } return sum; } b340: c3 01 movw r24, r6 b342: b2 01 movw r22, r4 b344: c4 57 subi r28, 0x74 ; 116 b346: dd 4f sbci r29, 0xFD ; 253 b348: 0f b6 in r0, 0x3f ; 63 b34a: f8 94 cli b34c: de bf out 0x3e, r29 ; 62 b34e: 0f be out 0x3f, r0 ; 63 b350: cd bf out 0x3d, r28 ; 61 b352: df 91 pop r29 b354: cf 91 pop r28 b356: 1f 91 pop r17 b358: 0f 91 pop r16 b35a: ff 90 pop r15 b35c: ef 90 pop r14 b35e: df 90 pop r13 b360: cf 90 pop r12 b362: bf 90 pop r11 b364: af 90 pop r10 b366: 9f 90 pop r9 b368: 8f 90 pop r8 b36a: 7f 90 pop r7 b36c: 6f 90 pop r6 b36e: 5f 90 pop r5 b370: 4f 90 pop r4 b372: 3f 90 pop r3 b374: 2f 90 pop r2 b376: 08 95 ret shift[0] = 0; for (i = 0; i < n; i++) { if (i > 0) { //read shift in steps from EEPROM shift[i] = eeprom_read_word((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + (i - 1)); b378: c5 01 movw r24, r10 b37a: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 b37e: d8 01 movw r26, r16 b380: 8d 93 st X+, r24 b382: 9c 93 st X, r25 b384: b5 e0 ldi r27, 0x05 ; 5 b386: cb 0e add r12, r27 b388: d1 1c adc r13, r1 b38a: e2 e0 ldi r30, 0x02 ; 2 b38c: ae 0e add r10, r30 b38e: b1 1c adc r11, r1 b390: 96 cc rjmp .-1748 ; 0xacbe 0000b392 : eFilamentAction = FilamentAction::None; } // Common gcode shared by the gcodes. This saves some flash memory static void gcodes_M704_M705_M706(uint16_t gcode) { b392: 0f 93 push r16 b394: 1f 93 push r17 b396: cf 93 push r28 uint8_t mmuSlotIndex = 0xffU; if (MMU2::mmu2.Enabled() && code_seen('P')) b398: 20 91 94 12 lds r18, 0x1294 ; 0x801294 b39c: 21 30 cpi r18, 0x01 ; 1 b39e: 79 f5 brne .+94 ; 0xb3fe b3a0: 8c 01 movw r16, r24 b3a2: 80 e5 ldi r24, 0x50 ; 80 b3a4: 0e 94 2b 55 call 0xaa56 ; 0xaa56 b3a8: 88 23 and r24, r24 b3aa: 49 f1 breq .+82 ; 0xb3fe { mmuSlotIndex = code_value_uint8(); b3ac: 0e 94 40 55 call 0xaa80 ; 0xaa80 b3b0: c8 2f mov r28, r24 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { b3b2: 85 30 cpi r24, 0x05 ; 5 b3b4: 20 f5 brcc .+72 ; 0xb3fe switch (gcode) b3b6: 01 3c cpi r16, 0xC1 ; 193 b3b8: 82 e0 ldi r24, 0x02 ; 2 b3ba: 18 07 cpc r17, r24 b3bc: 49 f0 breq .+18 ; 0xb3d0 b3be: 02 3c cpi r16, 0xC2 ; 194 b3c0: 12 40 sbci r17, 0x02 ; 2 b3c2: 69 f0 breq .+26 ; 0xb3de { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); b3c4: 8c 2f mov r24, r28 default: break; } } } } b3c6: cf 91 pop r28 b3c8: 1f 91 pop r17 b3ca: 0f 91 pop r16 mmuSlotIndex = code_value_uint8(); if (mmuSlotIndex < MMU_FILAMENT_COUNT) { switch (gcode) { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); b3cc: 0d 94 ab 6a jmp 0x2d556 ; 0x2d556 break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); b3d0: 60 e0 ldi r22, 0x00 ; 0 b3d2: 8c 2f mov r24, r28 default: break; } } } } b3d4: cf 91 pop r28 b3d6: 1f 91 pop r17 b3d8: 0f 91 pop r16 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); b3da: 0d 94 ee 6a jmp 0x2d5dc ; 0x2d5dc break; case 706: #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0){ b3de: 8e ec ldi r24, 0xCE ; 206 b3e0: 9e e0 ldi r25, 0x0E ; 14 b3e2: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 b3e6: 88 23 and r24, r24 b3e8: 51 f0 breq .+20 ; 0xb3fe IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { b3ea: 0f 94 b4 53 call 0x2a768 ; 0x2a768 b3ee: 88 23 and r24, r24 b3f0: 31 f0 breq .+12 ; 0xb3fe b3f2: 8c 2f mov r24, r28 default: break; } } } } b3f4: cf 91 pop r28 b3f6: 1f 91 pop r17 b3f8: 0f 91 pop r16 b3fa: 0d 94 6b 6b jmp 0x2d6d6 ; 0x2d6d6 b3fe: cf 91 pop r28 b400: 1f 91 pop r17 b402: 0f 91 pop r16 b404: 08 95 ret 0000b406 : #endif // Return True if a character was found static inline bool code_seen(char code) { return (strchr_pointer = strchr(CMDBUFFER_CURRENT_STRING, code)) != NULL; } static inline bool code_seen_P(const char *code_PROGMEM) { return (strchr_pointer = strstr_P(CMDBUFFER_CURRENT_STRING, code_PROGMEM)) != NULL; } static inline float code_value() { return strtod_noE(strchr_pointer+1, NULL);} b406: 8f 92 push r8 b408: 9f 92 push r9 b40a: af 92 push r10 b40c: bf 92 push r11 b40e: cf 92 push r12 b410: df 92 push r13 b412: ef 92 push r14 b414: ff 92 push r15 b416: 0f 93 push r16 b418: 1f 93 push r17 b41a: cf 93 push r28 b41c: df 93 push r29 b41e: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 b422: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 b426: 0f 5f subi r16, 0xFF ; 255 b428: 1f 4f sbci r17, 0xFF ; 255 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; b42a: 68 01 movw r12, r16 b42c: 8f ef ldi r24, 0xFF ; 255 b42e: c8 1a sub r12, r24 b430: d8 0a sbc r13, r24 b432: d8 01 movw r26, r16 b434: dc 91 ld r29, X } while (isspace(c)); b436: 8d 2f mov r24, r29 b438: 90 e0 ldi r25, 0x00 ; 0 b43a: 0f 94 6d 9d call 0x33ada ; 0x33ada b43e: 7c 01 movw r14, r24 b440: 89 2b or r24, r25 b442: 01 f5 brne .+64 ; 0xb484 flag = 0; if (c == '-') { b444: dd 32 cpi r29, 0x2D ; 45 b446: 01 f5 brne .+64 ; 0xb488 flag = FL_MINUS; c = *nptr++; b448: 68 01 movw r12, r16 b44a: b2 e0 ldi r27, 0x02 ; 2 b44c: cb 0e add r12, r27 b44e: d1 1c adc r13, r1 b450: f8 01 movw r30, r16 b452: d1 81 ldd r29, Z+1 ; 0x01 c = *nptr++; } while (isspace(c)); flag = 0; if (c == '-') { flag = FL_MINUS; b454: c1 e0 ldi r28, 0x01 ; 1 } else if (c == '+') { c = *nptr++; } if (!strncasecmp_P(nptr - 1, pstr_inf, 3)) { b456: 86 01 movw r16, r12 b458: 01 50 subi r16, 0x01 ; 1 b45a: 11 09 sbc r17, r1 b45c: 43 e0 ldi r20, 0x03 ; 3 b45e: 50 e0 ldi r21, 0x00 ; 0 b460: 6a e4 ldi r22, 0x4A ; 74 b462: 76 e7 ldi r23, 0x76 ; 118 b464: c8 01 movw r24, r16 b466: 0f 94 a3 9d call 0x33b46 ; 0x33b46 b46a: 89 2b or r24, r25 b46c: c1 f4 brne .+48 ; 0xb49e nptr += 2; if (!strncasecmp_P(nptr, pstr_inity, 5)) nptr += 5; if (endptr) *endptr = (char*)nptr; return flag & FL_MINUS ? -INFINITY : +INFINITY; b46e: 60 e0 ldi r22, 0x00 ; 0 b470: 70 e0 ldi r23, 0x00 ; 0 b472: 80 e8 ldi r24, 0x80 ; 128 b474: 9f ef ldi r25, 0xFF ; 255 b476: c1 11 cpse r28, r1 b478: db c0 rjmp .+438 ; 0xb630 b47a: 60 e0 ldi r22, 0x00 ; 0 b47c: 70 e0 ldi r23, 0x00 ; 0 b47e: 80 e8 ldi r24, 0x80 ; 128 b480: 9f e7 ldi r25, 0x7F ; 127 b482: d6 c0 rjmp .+428 ; 0xb630 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; b484: 86 01 movw r16, r12 b486: d1 cf rjmp .-94 ; 0xb42a flag = 0; if (c == '-') { flag = FL_MINUS; c = *nptr++; } else if (c == '+') { b488: db 32 cpi r29, 0x2B ; 43 b48a: 39 f4 brne .+14 ; 0xb49a c = *nptr++; b48c: 68 01 movw r12, r16 b48e: f2 e0 ldi r31, 0x02 ; 2 b490: cf 0e add r12, r31 b492: d1 1c adc r13, r1 b494: d8 01 movw r26, r16 b496: 11 96 adiw r26, 0x01 ; 1 b498: dc 91 ld r29, X do { c = *nptr++; } while (isspace(c)); flag = 0; b49a: c0 e0 ldi r28, 0x00 ; 0 b49c: dc cf rjmp .-72 ; 0xb456 return flag & FL_MINUS ? -INFINITY : +INFINITY; } /* NAN() construction is not realised. Length would be 3 characters only. */ if (!strncasecmp_P(nptr - 1, pstr_nan, 3)) { b49e: 43 e0 ldi r20, 0x03 ; 3 b4a0: 50 e0 ldi r21, 0x00 ; 0 b4a2: 67 e4 ldi r22, 0x47 ; 71 b4a4: 76 e7 ldi r23, 0x76 ; 118 b4a6: c8 01 movw r24, r16 b4a8: 0f 94 a3 9d call 0x33b46 ; 0x33b46 b4ac: 89 2b or r24, r25 b4ae: 09 f4 brne .+2 ; 0xb4b2 b4b0: cc c0 rjmp .+408 ; 0xb64a b4b2: f6 01 movw r30, r12 *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; exp = 0; b4b4: 10 e0 ldi r17, 0x00 ; 0 b4b6: 00 e0 ldi r16, 0x00 ; 0 if (endptr) *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; b4b8: 20 e0 ldi r18, 0x00 ; 0 b4ba: 30 e0 ldi r19, 0x00 ; 0 b4bc: a9 01 movw r20, r18 b4be: 6f 01 movw r12, r30 exp = 0; while (1) { c -= '0'; b4c0: d0 53 subi r29, 0x30 ; 48 if (c <= 9) { b4c2: da 30 cpi r29, 0x0A ; 10 b4c4: 60 f5 brcc .+88 ; 0xb51e flag |= FL_ANY; b4c6: bc 2e mov r11, r28 b4c8: 68 94 set b4ca: b1 f8 bld r11, 1 b4cc: 8c 2f mov r24, r28 b4ce: 88 70 andi r24, 0x08 ; 8 if (flag & FL_OVFL) { b4d0: c2 ff sbrs r28, 2 b4d2: 09 c0 rjmp .+18 ; 0xb4e6 if (!(flag & FL_DOT)) b4d4: 81 11 cpse r24, r1 b4d6: 02 c0 rjmp .+4 ; 0xb4dc exp += 1; b4d8: 0f 5f subi r16, 0xFF ; 255 b4da: 1f 4f sbci r17, 0xFF ; 255 b4dc: 31 96 adiw r30, 0x01 ; 1 flag |= FL_DOT; } else { break; } c = *nptr++; b4de: d6 01 movw r26, r12 b4e0: dc 91 ld r29, X b4e2: cb 2d mov r28, r11 b4e4: ec cf rjmp .-40 ; 0xb4be if (flag & FL_OVFL) { if (!(flag & FL_DOT)) exp += 1; } else { if (flag & FL_DOT) b4e6: 88 23 and r24, r24 b4e8: 11 f0 breq .+4 ; 0xb4ee exp -= 1; b4ea: 01 50 subi r16, 0x01 ; 1 b4ec: 11 09 sbc r17, r1 /* x.u32 = x.u32 * 10 + c */ x.u32 = (((x.u32 << 2) + x.u32) << 1) + c; b4ee: a5 e0 ldi r26, 0x05 ; 5 b4f0: b0 e0 ldi r27, 0x00 ; 0 b4f2: 0f 94 71 a0 call 0x340e2 ; 0x340e2 <__muluhisi3> b4f6: 9b 01 movw r18, r22 b4f8: ac 01 movw r20, r24 b4fa: 22 0f add r18, r18 b4fc: 33 1f adc r19, r19 b4fe: 44 1f adc r20, r20 b500: 55 1f adc r21, r21 b502: 2d 0f add r18, r29 b504: 31 1d adc r19, r1 b506: 41 1d adc r20, r1 b508: 51 1d adc r21, r1 if (x.u32 >= (ULONG_MAX - 9) / 10) b50a: 28 39 cpi r18, 0x98 ; 152 b50c: b9 e9 ldi r27, 0x99 ; 153 b50e: 3b 07 cpc r19, r27 b510: 4b 07 cpc r20, r27 b512: b9 e1 ldi r27, 0x19 ; 25 b514: 5b 07 cpc r21, r27 b516: 10 f3 brcs .-60 ; 0xb4dc flag |= FL_OVFL; b518: c6 60 ori r28, 0x06 ; 6 b51a: bc 2e mov r11, r28 b51c: df cf rjmp .-66 ; 0xb4dc } } else if (c == (('.' - '0') & 0xff) && !(flag & FL_DOT)) { b51e: de 3f cpi r29, 0xFE ; 254 b520: 31 f4 brne .+12 ; 0xb52e b522: c3 fd sbrc r28, 3 b524: 33 c0 rjmp .+102 ; 0xb58c flag |= FL_DOT; b526: bc 2e mov r11, r28 b528: 68 94 set b52a: b3 f8 bld r11, 3 b52c: d7 cf rjmp .-82 ; 0xb4dc } c = *nptr++; } // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) b52e: d5 33 cpi r29, 0x35 ; 53 b530: 69 f5 brne .+90 ; 0xb58c { int i; c = *nptr++; b532: 80 81 ld r24, Z i = 2; if (c == '-') { b534: 8d 32 cpi r24, 0x2D ; 45 b536: 31 f4 brne .+12 ; 0xb544 flag |= FL_MEXP; b538: c0 61 ori r28, 0x10 ; 16 c = *nptr++; b53a: bf 01 movw r22, r30 } else if (c == '+') { c = *nptr++; b53c: 6e 5f subi r22, 0xFE ; 254 b53e: 7f 4f sbci r23, 0xFF ; 255 b540: 81 81 ldd r24, Z+1 ; 0x01 b542: 05 c0 rjmp .+10 ; 0xb54e b544: bf 01 movw r22, r30 i = 2; if (c == '-') { flag |= FL_MEXP; c = *nptr++; } else if (c == '+') { b546: 8b 32 cpi r24, 0x2B ; 43 b548: c9 f3 breq .-14 ; 0xb53c // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) { int i; c = *nptr++; b54a: 6f 5f subi r22, 0xFF ; 255 b54c: 7f 4f sbci r23, 0xFF ; 255 c = *nptr++; } else { i = 1; } c -= '0'; b54e: 80 53 subi r24, 0x30 ; 48 if (c > 9) { b550: 8a 30 cpi r24, 0x0A ; 10 b552: e0 f4 brcc .+56 ; 0xb58c b554: fb 01 movw r30, r22 nptr -= i; } else { i = 0; do { if (i < 3200) b556: b0 e8 ldi r27, 0x80 ; 128 b558: eb 16 cp r14, r27 b55a: bc e0 ldi r27, 0x0C ; 12 b55c: fb 06 cpc r15, r27 b55e: 5c f4 brge .+22 ; 0xb576 i = (((i << 2) + i) << 1) + c; /* i = 10*i + c */ b560: b7 01 movw r22, r14 b562: 66 0f add r22, r22 b564: 77 1f adc r23, r23 b566: 66 0f add r22, r22 b568: 77 1f adc r23, r23 b56a: e6 0e add r14, r22 b56c: f7 1e adc r15, r23 b56e: ee 0c add r14, r14 b570: ff 1c adc r15, r15 b572: e8 0e add r14, r24 b574: f1 1c adc r15, r1 c = *nptr++ - '0'; b576: 81 91 ld r24, Z+ b578: 80 53 subi r24, 0x30 ; 48 } while (c <= 9); b57a: 8a 30 cpi r24, 0x0A ; 10 b57c: 60 f3 brcs .-40 ; 0xb556 if (flag & FL_MEXP) b57e: c4 ff sbrs r28, 4 b580: 03 c0 rjmp .+6 ; 0xb588 i = -i; b582: f1 94 neg r15 b584: e1 94 neg r14 b586: f1 08 sbc r15, r1 exp += i; b588: 0e 0d add r16, r14 b58a: 1f 1d adc r17, r15 } if ((flag & FL_ANY) && endptr) *endptr = (char*)nptr - 1; x.flt = __floatunsisf(x.u32); /* manually */ b58c: ca 01 movw r24, r20 b58e: b9 01 movw r22, r18 b590: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> if ((flag & FL_MINUS) && (flag & FL_ANY)) b594: c3 70 andi r28, 0x03 ; 3 b596: c3 30 cpi r28, 0x03 ; 3 b598: 09 f4 brne .+2 ; 0xb59c x.flt = -x.flt; b59a: 90 58 subi r25, 0x80 ; 128 b59c: 4b 01 movw r8, r22 b59e: 5c 01 movw r10, r24 if (x.flt != 0) { b5a0: 20 e0 ldi r18, 0x00 ; 0 b5a2: 30 e0 ldi r19, 0x00 ; 0 b5a4: a9 01 movw r20, r18 b5a6: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> b5aa: 88 23 and r24, r24 b5ac: 09 f4 brne .+2 ; 0xb5b0 b5ae: 3e c0 rjmp .+124 ; 0xb62c if (exp < 0) { nptr = (void*)(pwr_m10 + 5); exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); b5b0: c3 e4 ldi r28, 0x43 ; 67 b5b2: d6 e7 ldi r29, 0x76 ; 118 if ((flag & FL_MINUS) && (flag & FL_ANY)) x.flt = -x.flt; if (x.flt != 0) { int pwr; if (exp < 0) { b5b4: 17 ff sbrs r17, 7 b5b6: 05 c0 rjmp .+10 ; 0xb5c2 nptr = (void*)(pwr_m10 + 5); exp = -exp; b5b8: 11 95 neg r17 b5ba: 01 95 neg r16 b5bc: 11 09 sbc r17, r1 x.flt = -x.flt; if (x.flt != 0) { int pwr; if (exp < 0) { nptr = (void*)(pwr_m10 + 5); b5be: cb e2 ldi r28, 0x2B ; 43 b5c0: d6 e7 ldi r29, 0x76 ; 118 b5c2: 6e 01 movw r12, r28 b5c4: e8 e1 ldi r30, 0x18 ; 24 b5c6: ce 1a sub r12, r30 b5c8: d1 08 sbc r13, r1 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); b5ca: 80 e2 ldi r24, 0x20 ; 32 b5cc: e8 2e mov r14, r24 b5ce: f1 2c mov r15, r1 b5d0: 0d c0 rjmp .+26 ; 0xb5ec for (; exp >= pwr; exp -= pwr) { union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); b5d2: fe 01 movw r30, r28 b5d4: 25 91 lpm r18, Z+ b5d6: 35 91 lpm r19, Z+ b5d8: 45 91 lpm r20, Z+ b5da: 54 91 lpm r21, Z } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { b5dc: 0e 19 sub r16, r14 b5de: 1f 09 sbc r17, r15 union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; b5e0: c5 01 movw r24, r10 b5e2: b4 01 movw r22, r8 b5e4: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> b5e8: 4b 01 movw r8, r22 b5ea: 5c 01 movw r10, r24 b5ec: d5 01 movw r26, r10 b5ee: c4 01 movw r24, r8 } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { b5f0: 0e 15 cp r16, r14 b5f2: 1f 05 cpc r17, r15 b5f4: 74 f7 brge .-36 ; 0xb5d2 float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; } nptr -= sizeof(float); b5f6: 24 97 sbiw r28, 0x04 ; 4 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { b5f8: f5 94 asr r15 b5fa: e7 94 ror r14 b5fc: cc 16 cp r12, r28 b5fe: dd 06 cpc r13, r29 b600: a9 f7 brne .-22 ; 0xb5ec not plus or minus infinity, and not NaN. */ __ATTR_CONST__ static inline int isfinite (double __x) { unsigned char __exp; __asm__ ( b602: 8a 2f mov r24, r26 b604: 88 0f add r24, r24 b606: 8b 2f mov r24, r27 b608: 88 1f adc r24, r24 y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; } nptr -= sizeof(float); } if (!isfinite(x.flt) || x.flt == 0) b60a: 8f 3f cpi r24, 0xFF ; 255 b60c: 49 f0 breq .+18 ; 0xb620 b60e: 20 e0 ldi r18, 0x00 ; 0 b610: 30 e0 ldi r19, 0x00 ; 0 b612: a9 01 movw r20, r18 b614: c5 01 movw r24, r10 b616: b4 01 movw r22, r8 b618: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> b61c: 81 11 cpse r24, r1 b61e: 06 c0 rjmp .+12 ; 0xb62c errno = ERANGE; b620: 82 e2 ldi r24, 0x22 ; 34 b622: 90 e0 ldi r25, 0x00 ; 0 b624: 90 93 f9 16 sts 0x16F9, r25 ; 0x8016f9 b628: 80 93 f8 16 sts 0x16F8, r24 ; 0x8016f8 } return x.flt; b62c: c5 01 movw r24, r10 b62e: b4 01 movw r22, r8 b630: df 91 pop r29 b632: cf 91 pop r28 b634: 1f 91 pop r17 b636: 0f 91 pop r16 b638: ff 90 pop r15 b63a: ef 90 pop r14 b63c: df 90 pop r13 b63e: cf 90 pop r12 b640: bf 90 pop r11 b642: af 90 pop r10 b644: 9f 90 pop r9 b646: 8f 90 pop r8 b648: 08 95 ret /* NAN() construction is not realised. Length would be 3 characters only. */ if (!strncasecmp_P(nptr - 1, pstr_nan, 3)) { if (endptr) *endptr = (char*)nptr + 2; return NAN; b64a: 60 e0 ldi r22, 0x00 ; 0 b64c: 70 e0 ldi r23, 0x00 ; 0 b64e: 80 ec ldi r24, 0xC0 ; 192 b650: 9f e7 ldi r25, 0x7F ; 127 b652: ee cf rjmp .-36 ; 0xb630 0000b654 : } } } #endif //MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 void get_coordinates() { b654: 2f 92 push r2 b656: 3f 92 push r3 b658: 4f 92 push r4 b65a: 5f 92 push r5 b65c: 6f 92 push r6 b65e: 7f 92 push r7 b660: 8f 92 push r8 b662: 9f 92 push r9 b664: af 92 push r10 b666: bf 92 push r11 b668: cf 92 push r12 b66a: df 92 push r13 b66c: ef 92 push r14 b66e: ff 92 push r15 b670: 0f 93 push r16 b672: 1f 93 push r17 b674: cf 93 push r28 b676: df 93 push r29 b678: cd b7 in r28, 0x3d ; 61 b67a: de b7 in r29, 0x3e ; 62 b67c: a1 97 sbiw r28, 0x21 ; 33 b67e: 0f b6 in r0, 0x3f ; 63 b680: f8 94 cli b682: de bf out 0x3e, r29 ; 62 b684: 0f be out 0x3f, r0 ; 63 b686: cd bf out 0x3d, r28 ; 61 b688: 84 ec ldi r24, 0xC4 ; 196 b68a: 92 e0 ldi r25, 0x02 ; 2 b68c: 9d 8f std Y+29, r25 ; 0x1d b68e: 8c 8f std Y+28, r24 ; 0x1c b690: 85 ef ldi r24, 0xF5 ; 245 b692: 28 2e mov r2, r24 b694: 81 e1 ldi r24, 0x11 ; 17 b696: 38 2e mov r3, r24 b698: 03 e9 ldi r16, 0x93 ; 147 b69a: 16 e0 ldi r17, 0x06 ; 6 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i < NUM_AXIS; i++, mask <<= 1) { b69c: 91 e0 ldi r25, 0x01 ; 1 b69e: 9a 8f std Y+26, r25 ; 0x1a b6a0: 19 8e std Y+25, r1 ; 0x19 if(code_seen(axis_codes[i])) b6a2: ec 8d ldd r30, Y+28 ; 0x1c b6a4: fd 8d ldd r31, Y+29 ; 0x1d b6a6: 81 91 ld r24, Z+ b6a8: fd 8f std Y+29, r31 ; 0x1d b6aa: ec 8f std Y+28, r30 ; 0x1c b6ac: 0e 94 2b 55 call 0xaa56 ; 0xaa56 b6b0: e8 2e mov r14, r24 b6b2: 88 23 and r24, r24 b6b4: 09 f4 brne .+2 ; 0xb6b8 b6b6: 54 c1 rjmp .+680 ; 0xb960 { bool relative = axis_relative_modes & mask; b6b8: f0 90 eb 11 lds r15, 0x11EB ; 0x8011eb b6bc: fa 8d ldd r31, Y+26 ; 0x1a b6be: ff 22 and r15, r31 destination[i] = code_value(); b6c0: 0e 94 03 5a call 0xb406 ; 0xb406 b6c4: 2b 01 movw r4, r22 b6c6: 3c 01 movw r6, r24 b6c8: f8 01 movw r30, r16 b6ca: 40 82 st Z, r4 b6cc: 51 82 std Z+1, r5 ; 0x01 b6ce: 62 82 std Z+2, r6 ; 0x02 b6d0: 73 82 std Z+3, r7 ; 0x03 if (i == E_AXIS) { b6d2: f9 8d ldd r31, Y+25 ; 0x19 b6d4: f3 30 cpi r31, 0x03 ; 3 b6d6: 09 f0 breq .+2 ; 0xb6da b6d8: 45 c0 rjmp .+138 ; 0xb764 void get_coordinates() { for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i < NUM_AXIS; i++, mask <<= 1) { if(code_seen(axis_codes[i])) { bool relative = axis_relative_modes & mask; b6da: dd 24 eor r13, r13 b6dc: d3 94 inc r13 b6de: f1 10 cpse r15, r1 b6e0: 01 c0 rjmp .+2 ; 0xb6e4 b6e2: d1 2c mov r13, r1 destination[i] = code_value(); if (i == E_AXIS) { float emult = extruder_multiplier[active_extruder]; b6e4: 80 90 10 02 lds r8, 0x0210 ; 0x800210 b6e8: 90 90 11 02 lds r9, 0x0211 ; 0x800211 b6ec: a0 90 12 02 lds r10, 0x0212 ; 0x800212 b6f0: b0 90 13 02 lds r11, 0x0213 ; 0x800213 if (emult != 1.) { b6f4: 20 e0 ldi r18, 0x00 ; 0 b6f6: 30 e0 ldi r19, 0x00 ; 0 b6f8: 40 e8 ldi r20, 0x80 ; 128 b6fa: 5f e3 ldi r21, 0x3F ; 63 b6fc: c5 01 movw r24, r10 b6fe: b4 01 movw r22, r8 b700: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> b704: 88 23 and r24, r24 b706: 59 f1 breq .+86 ; 0xb75e if (! relative) { b708: f1 10 cpse r15, r1 b70a: 15 c0 rjmp .+42 ; 0xb736 destination[i] -= current_position[i]; b70c: 20 91 01 12 lds r18, 0x1201 ; 0x801201 b710: 30 91 02 12 lds r19, 0x1202 ; 0x801202 b714: 40 91 03 12 lds r20, 0x1203 ; 0x801203 b718: 50 91 04 12 lds r21, 0x1204 ; 0x801204 b71c: c3 01 movw r24, r6 b71e: b2 01 movw r22, r4 b720: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> b724: 60 93 9f 06 sts 0x069F, r22 ; 0x80069f b728: 70 93 a0 06 sts 0x06A0, r23 ; 0x8006a0 b72c: 80 93 a1 06 sts 0x06A1, r24 ; 0x8006a1 b730: 90 93 a2 06 sts 0x06A2, r25 ; 0x8006a2 relative = true; b734: de 2c mov r13, r14 } destination[i] *= emult; b736: a5 01 movw r20, r10 b738: 94 01 movw r18, r8 b73a: 60 91 9f 06 lds r22, 0x069F ; 0x80069f b73e: 70 91 a0 06 lds r23, 0x06A0 ; 0x8006a0 b742: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 b746: 90 91 a2 06 lds r25, 0x06A2 ; 0x8006a2 b74a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> b74e: 60 93 9f 06 sts 0x069F, r22 ; 0x80069f b752: 70 93 a0 06 sts 0x06A0, r23 ; 0x8006a0 b756: 80 93 a1 06 sts 0x06A1, r24 ; 0x8006a1 b75a: 90 93 a2 06 sts 0x06A2, r25 ; 0x8006a2 } } if (relative) b75e: d1 10 cpse r13, r1 b760: 03 c0 rjmp .+6 ; 0xb768 b762: 5f c0 rjmp .+190 ; 0xb822 b764: ff 20 and r15, r15 b766: 89 f0 breq .+34 ; 0xb78a destination[i] += current_position[i]; b768: f1 01 movw r30, r2 b76a: 20 81 ld r18, Z b76c: 31 81 ldd r19, Z+1 ; 0x01 b76e: 42 81 ldd r20, Z+2 ; 0x02 b770: 53 81 ldd r21, Z+3 ; 0x03 b772: f8 01 movw r30, r16 b774: 60 81 ld r22, Z b776: 71 81 ldd r23, Z+1 ; 0x01 b778: 82 81 ldd r24, Z+2 ; 0x02 b77a: 93 81 ldd r25, Z+3 ; 0x03 b77c: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> b780: f8 01 movw r30, r16 b782: 60 83 st Z, r22 b784: 71 83 std Z+1, r23 ; 0x01 b786: 82 83 std Z+2, r24 ; 0x02 b788: 93 83 std Z+3, r25 ; 0x03 #if MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 if (i == Z_AXIS && SilentModeMenu == SILENT_MODE_AUTO) update_currents(); b78a: f9 8d ldd r31, Y+25 ; 0x19 b78c: f2 30 cpi r31, 0x02 ; 2 b78e: d9 f5 brne .+118 ; 0xb806 b790: 80 91 89 03 lds r24, 0x0389 ; 0x800389 b794: 82 30 cpi r24, 0x02 ; 2 b796: 09 f0 breq .+2 ; 0xb79a b798: ee c0 rjmp .+476 ; 0xb976 SERIAL_PROTOCOLLNRPGM(MSG_OK); } #if MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 void update_currents() { float current_high[3] = DEFAULT_PWM_MOTOR_CURRENT_LOUD; b79a: 8c e0 ldi r24, 0x0C ; 12 b79c: e0 ea ldi r30, 0xA0 ; 160 b79e: f2 e0 ldi r31, 0x02 ; 2 b7a0: de 01 movw r26, r28 b7a2: 1d 96 adiw r26, 0x0d ; 13 b7a4: 01 90 ld r0, Z+ b7a6: 0d 92 st X+, r0 b7a8: 8a 95 dec r24 b7aa: e1 f7 brne .-8 ; 0xb7a4 float current_low[3] = DEFAULT_PWM_MOTOR_CURRENT; b7ac: 8c e0 ldi r24, 0x0C ; 12 b7ae: ec ea ldi r30, 0xAC ; 172 b7b0: f2 e0 ldi r31, 0x02 ; 2 b7b2: de 01 movw r26, r28 b7b4: 11 96 adiw r26, 0x01 ; 1 b7b6: 01 90 ld r0, Z+ b7b8: 0d 92 st X+, r0 b7ba: 8a 95 dec r24 b7bc: e1 f7 brne .-8 ; 0xb7b6 float tmp_motor[3]; //SERIAL_ECHOLNPGM("Currents updated: "); if (destination[Z_AXIS] < Z_SILENT) { b7be: c0 90 9b 06 lds r12, 0x069B ; 0x80069b b7c2: d0 90 9c 06 lds r13, 0x069C ; 0x80069c b7c6: e0 90 9d 06 lds r14, 0x069D ; 0x80069d b7ca: f0 90 9e 06 lds r15, 0x069E ; 0x80069e b7ce: 20 e0 ldi r18, 0x00 ; 0 b7d0: 30 e0 ldi r19, 0x00 ; 0 b7d2: a9 01 movw r20, r18 b7d4: c7 01 movw r24, r14 b7d6: b6 01 movw r22, r12 b7d8: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> b7dc: 87 ff sbrs r24, 7 b7de: 52 c0 rjmp .+164 ; 0xb884 b7e0: ce 01 movw r24, r28 b7e2: 01 96 adiw r24, 0x01 ; 1 b7e4: 7c 01 movw r14, r24 //SERIAL_ECHOLNPGM("LOW"); for (uint8_t i = 0; i < 3; i++) { b7e6: d1 2c mov r13, r1 st_current_set(i, current_low[i]); b7e8: f7 01 movw r30, r14 b7ea: 61 91 ld r22, Z+ b7ec: 71 91 ld r23, Z+ b7ee: 81 91 ld r24, Z+ b7f0: 91 91 ld r25, Z+ b7f2: 7f 01 movw r14, r30 b7f4: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> b7f8: 8d 2d mov r24, r13 b7fa: 0f 94 8f 21 call 0x2431e ; 0x2431e //SERIAL_ECHOLNPGM("Currents updated: "); if (destination[Z_AXIS] < Z_SILENT) { //SERIAL_ECHOLNPGM("LOW"); for (uint8_t i = 0; i < 3; i++) { b7fe: d3 94 inc r13 b800: f3 e0 ldi r31, 0x03 ; 3 b802: df 12 cpse r13, r31 b804: f1 cf rjmp .-30 ; 0xb7e8 } } #endif //MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 void get_coordinates() { for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i < NUM_AXIS; i++, mask <<= 1) { b806: f9 8d ldd r31, Y+25 ; 0x19 b808: ff 5f subi r31, 0xFF ; 255 b80a: f9 8f std Y+25, r31 ; 0x19 b80c: 8a 8d ldd r24, Y+26 ; 0x1a b80e: 88 0f add r24, r24 b810: 8a 8f std Y+26, r24 ; 0x1a b812: 94 e0 ldi r25, 0x04 ; 4 b814: 29 0e add r2, r25 b816: 31 1c adc r3, r1 b818: 0c 5f subi r16, 0xFC ; 252 b81a: 1f 4f sbci r17, 0xFF ; 255 b81c: f4 30 cpi r31, 0x04 ; 4 b81e: 09 f0 breq .+2 ; 0xb822 b820: 40 cf rjmp .-384 ; 0xb6a2 if (i == Z_AXIS && SilentModeMenu == SILENT_MODE_AUTO) update_currents(); #endif //MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 } else destination[i] = current_position[i]; //Are these else lines really needed? } if(code_seen('F')) { b822: 86 e4 ldi r24, 0x46 ; 70 b824: 0e 94 2b 55 call 0xaa56 ; 0xaa56 b828: 88 23 and r24, r24 b82a: 99 f0 breq .+38 ; 0xb852 const float next_feedrate = code_value(); b82c: 0e 94 03 5a call 0xb406 ; 0xb406 b830: 6b 01 movw r12, r22 b832: 7c 01 movw r14, r24 if(next_feedrate > 0.f) feedrate = next_feedrate; b834: 20 e0 ldi r18, 0x00 ; 0 b836: 30 e0 ldi r19, 0x00 ; 0 b838: a9 01 movw r20, r18 b83a: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> b83e: 18 16 cp r1, r24 b840: 44 f4 brge .+16 ; 0xb852 b842: c0 92 7a 02 sts 0x027A, r12 ; 0x80027a b846: d0 92 7b 02 sts 0x027B, r13 ; 0x80027b b84a: e0 92 7c 02 sts 0x027C, r14 ; 0x80027c b84e: f0 92 7d 02 sts 0x027D, r15 ; 0x80027d } } b852: a1 96 adiw r28, 0x21 ; 33 b854: 0f b6 in r0, 0x3f ; 63 b856: f8 94 cli b858: de bf out 0x3e, r29 ; 62 b85a: 0f be out 0x3f, r0 ; 63 b85c: cd bf out 0x3d, r28 ; 61 b85e: df 91 pop r29 b860: cf 91 pop r28 b862: 1f 91 pop r17 b864: 0f 91 pop r16 b866: ff 90 pop r15 b868: ef 90 pop r14 b86a: df 90 pop r13 b86c: cf 90 pop r12 b86e: bf 90 pop r11 b870: af 90 pop r10 b872: 9f 90 pop r9 b874: 8f 90 pop r8 b876: 7f 90 pop r7 b878: 6f 90 pop r6 b87a: 5f 90 pop r5 b87c: 4f 90 pop r4 b87e: 3f 90 pop r3 b880: 2f 90 pop r2 b882: 08 95 ret /*MYSERIAL.print(int(i)); SERIAL_ECHOPGM(": "); MYSERIAL.println(current_low[i]);*/ } } else if (destination[Z_AXIS] > Z_HIGH_POWER) { b884: 20 e0 ldi r18, 0x00 ; 0 b886: 30 e0 ldi r19, 0x00 ; 0 b888: 48 e4 ldi r20, 0x48 ; 72 b88a: 53 e4 ldi r21, 0x43 ; 67 b88c: c7 01 movw r24, r14 b88e: b6 01 movw r22, r12 b890: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> b894: 18 16 cp r1, r24 b896: a4 f4 brge .+40 ; 0xb8c0 b898: ce 01 movw r24, r28 b89a: 0d 96 adiw r24, 0x0d ; 13 b89c: 7c 01 movw r14, r24 //SERIAL_ECHOLNPGM("HIGH"); for (uint8_t i = 0; i < 3; i++) { b89e: d1 2c mov r13, r1 st_current_set(i, current_high[i]); b8a0: f7 01 movw r30, r14 b8a2: 61 91 ld r22, Z+ b8a4: 71 91 ld r23, Z+ b8a6: 81 91 ld r24, Z+ b8a8: 91 91 ld r25, Z+ b8aa: 7f 01 movw r14, r30 b8ac: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> b8b0: 8d 2d mov r24, r13 b8b2: 0f 94 8f 21 call 0x2431e ; 0x2431e MYSERIAL.println(current_low[i]);*/ } } else if (destination[Z_AXIS] > Z_HIGH_POWER) { //SERIAL_ECHOLNPGM("HIGH"); for (uint8_t i = 0; i < 3; i++) { b8b6: d3 94 inc r13 b8b8: f3 e0 ldi r31, 0x03 ; 3 b8ba: df 12 cpse r13, r31 b8bc: f1 cf rjmp .-30 ; 0xb8a0 b8be: a3 cf rjmp .-186 ; 0xb806 b8c0: ce 01 movw r24, r28 b8c2: 01 96 adiw r24, 0x01 ; 1 b8c4: 99 a3 std Y+33, r25 ; 0x21 b8c6: 88 a3 std Y+32, r24 ; 0x20 b8c8: fe 01 movw r30, r28 b8ca: 3d 96 adiw r30, 0x0d ; 13 b8cc: ff 8f std Y+31, r31 ; 0x1f b8ce: ee 8f std Y+30, r30 ; 0x1e SERIAL_ECHOPGM(": "); MYSERIAL.println(current_high[i]);*/ } } else { for (uint8_t i = 0; i < 3; i++) { b8d0: 1b 8e std Y+27, r1 ; 0x1b float q = current_low[i] - Z_SILENT*((current_high[i] - current_low[i]) / (Z_HIGH_POWER - Z_SILENT)); b8d2: e8 a1 ldd r30, Y+32 ; 0x20 b8d4: f9 a1 ldd r31, Y+33 ; 0x21 b8d6: c1 90 ld r12, Z+ b8d8: d1 90 ld r13, Z+ b8da: e1 90 ld r14, Z+ b8dc: f1 90 ld r15, Z+ b8de: f9 a3 std Y+33, r31 ; 0x21 b8e0: e8 a3 std Y+32, r30 ; 0x20 b8e2: ee 8d ldd r30, Y+30 ; 0x1e b8e4: ff 8d ldd r31, Y+31 ; 0x1f b8e6: 61 91 ld r22, Z+ b8e8: 71 91 ld r23, Z+ b8ea: 81 91 ld r24, Z+ b8ec: 91 91 ld r25, Z+ b8ee: ff 8f std Y+31, r31 ; 0x1f b8f0: ee 8f std Y+30, r30 ; 0x1e b8f2: a7 01 movw r20, r14 b8f4: 96 01 movw r18, r12 b8f6: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> b8fa: 20 e0 ldi r18, 0x00 ; 0 b8fc: 30 e0 ldi r19, 0x00 ; 0 b8fe: 48 e4 ldi r20, 0x48 ; 72 b900: 53 e4 ldi r21, 0x43 ; 67 b902: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> b906: 4b 01 movw r8, r22 b908: 5c 01 movw r10, r24 tmp_motor[i] = ((current_high[i] - current_low[i]) / (Z_HIGH_POWER - Z_SILENT))*destination[Z_AXIS] + q; b90a: 20 91 9b 06 lds r18, 0x069B ; 0x80069b b90e: 30 91 9c 06 lds r19, 0x069C ; 0x80069c b912: 40 91 9d 06 lds r20, 0x069D ; 0x80069d b916: 50 91 9e 06 lds r21, 0x069E ; 0x80069e b91a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> b91e: 2b 01 movw r4, r22 b920: 3c 01 movw r6, r24 MYSERIAL.println(current_high[i]);*/ } } else { for (uint8_t i = 0; i < 3; i++) { float q = current_low[i] - Z_SILENT*((current_high[i] - current_low[i]) / (Z_HIGH_POWER - Z_SILENT)); b922: 20 e0 ldi r18, 0x00 ; 0 b924: 30 e0 ldi r19, 0x00 ; 0 b926: a9 01 movw r20, r18 b928: c5 01 movw r24, r10 b92a: b4 01 movw r22, r8 b92c: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> b930: 9b 01 movw r18, r22 b932: ac 01 movw r20, r24 b934: c7 01 movw r24, r14 b936: b6 01 movw r22, r12 b938: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> b93c: 9b 01 movw r18, r22 b93e: ac 01 movw r20, r24 tmp_motor[i] = ((current_high[i] - current_low[i]) / (Z_HIGH_POWER - Z_SILENT))*destination[Z_AXIS] + q; b940: c3 01 movw r24, r6 b942: b2 01 movw r22, r4 b944: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> st_current_set(i, tmp_motor[i]); b948: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> b94c: 8b 8d ldd r24, Y+27 ; 0x1b b94e: 0f 94 8f 21 call 0x2431e ; 0x2431e SERIAL_ECHOPGM(": "); MYSERIAL.println(current_high[i]);*/ } } else { for (uint8_t i = 0; i < 3; i++) { b952: fb 8d ldd r31, Y+27 ; 0x1b b954: ff 5f subi r31, 0xFF ; 255 b956: fb 8f std Y+27, r31 ; 0x1b b958: f3 30 cpi r31, 0x03 ; 3 b95a: 09 f0 breq .+2 ; 0xb95e b95c: ba cf rjmp .-140 ; 0xb8d2 b95e: 53 cf rjmp .-346 ; 0xb806 destination[i] += current_position[i]; #if MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 if (i == Z_AXIS && SilentModeMenu == SILENT_MODE_AUTO) update_currents(); #endif //MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 } else destination[i] = current_position[i]; //Are these else lines really needed? b960: f1 01 movw r30, r2 b962: 80 81 ld r24, Z b964: 91 81 ldd r25, Z+1 ; 0x01 b966: a2 81 ldd r26, Z+2 ; 0x02 b968: b3 81 ldd r27, Z+3 ; 0x03 b96a: f8 01 movw r30, r16 b96c: 80 83 st Z, r24 b96e: 91 83 std Z+1, r25 ; 0x01 b970: a2 83 std Z+2, r26 ; 0x02 b972: b3 83 std Z+3, r27 ; 0x03 b974: 48 cf rjmp .-368 ; 0xb806 } } #endif //MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 void get_coordinates() { for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i < NUM_AXIS; i++, mask <<= 1) { b976: ea 8d ldd r30, Y+26 ; 0x1a b978: ee 0f add r30, r30 b97a: ea 8f std Y+26, r30 ; 0x1a b97c: f4 e0 ldi r31, 0x04 ; 4 b97e: 2f 0e add r2, r31 b980: 31 1c adc r3, r1 b982: 0c 5f subi r16, 0xFC ; 252 b984: 1f 4f sbci r17, 0xFF ; 255 b986: 83 e0 ldi r24, 0x03 ; 3 b988: 89 8f std Y+25, r24 ; 0x19 b98a: 8b ce rjmp .-746 ; 0xb6a2 0000b98c : #define DBG(args...) printf_P(args) inline void print_hex_nibble(uint8_t val) { putchar((val > 9)?(val - 10 + 'a'):(val + '0')); b98c: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> b990: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> b994: 90 e0 ldi r25, 0x00 ; 0 b996: 8a 30 cpi r24, 0x0A ; 10 b998: 20 f0 brcs .+8 ; 0xb9a2 b99a: 89 5a subi r24, 0xA9 ; 169 b99c: 9f 4f sbci r25, 0xFF ; 255 b99e: 0d 94 44 9e jmp 0x33c88 ; 0x33c88 b9a2: c0 96 adiw r24, 0x30 ; 48 b9a4: fc cf rjmp .-8 ; 0xb99e 0000b9a6 : WRITE(LCD_PINS_D0, value & 0x01); WRITE(LCD_PINS_D1, value & 0x02); WRITE(LCD_PINS_D2, value & 0x04); WRITE(LCD_PINS_D3, value & 0x08); #endif WRITE(LCD_PINS_D4, value & 0x10); b9a6: 2f b7 in r18, 0x3f ; 63 b9a8: 84 ff sbrs r24, 4 b9aa: 1e c0 rjmp .+60 ; 0xb9e8 b9ac: f8 94 cli b9ae: 90 91 05 01 lds r25, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> b9b2: 92 60 ori r25, 0x02 ; 2 b9b4: 90 93 05 01 sts 0x0105, r25 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> b9b8: 2f bf out 0x3f, r18 ; 63 WRITE(LCD_PINS_D5, value & 0x20); b9ba: 2f b7 in r18, 0x3f ; 63 b9bc: 85 ff sbrs r24, 5 b9be: 19 c0 rjmp .+50 ; 0xb9f2 b9c0: f8 94 cli b9c2: 90 91 05 01 lds r25, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> b9c6: 91 60 ori r25, 0x01 ; 1 b9c8: 90 93 05 01 sts 0x0105, r25 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> b9cc: 2f bf out 0x3f, r18 ; 63 WRITE(LCD_PINS_D6, value & 0x40); b9ce: 86 ff sbrs r24, 6 b9d0: 15 c0 rjmp .+42 ; 0xb9fc b9d2: 45 9a sbi 0x08, 5 ; 8 WRITE(LCD_PINS_D7, value & 0x80); b9d4: 87 ff sbrs r24, 7 b9d6: 14 c0 rjmp .+40 ; 0xba00 b9d8: 46 9a sbi 0x08, 6 ; 8 static void lcd_print_custom(uint8_t c); static void lcd_invalidate_custom_characters(); static void lcd_pulseEnable(void) { WRITE(LCD_PINS_ENABLE,HIGH); b9da: 73 9a sbi 0x0e, 3 ; 14 #else //round up by default __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); #endif __builtin_avr_delay_cycles(__ticks_dc); b9dc: 85 e0 ldi r24, 0x05 ; 5 b9de: 8a 95 dec r24 b9e0: f1 f7 brne .-4 ; 0xb9de b9e2: 00 00 nop _delay_us(1); // enable pulse must be >450ns WRITE(LCD_PINS_ENABLE,LOW); b9e4: 73 98 cbi 0x0e, 3 ; 14 WRITE(LCD_PINS_D5, value & 0x20); WRITE(LCD_PINS_D6, value & 0x40); WRITE(LCD_PINS_D7, value & 0x80); lcd_pulseEnable(); } b9e6: 08 95 ret WRITE(LCD_PINS_D0, value & 0x01); WRITE(LCD_PINS_D1, value & 0x02); WRITE(LCD_PINS_D2, value & 0x04); WRITE(LCD_PINS_D3, value & 0x08); #endif WRITE(LCD_PINS_D4, value & 0x10); b9e8: f8 94 cli b9ea: 90 91 05 01 lds r25, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> b9ee: 9d 7f andi r25, 0xFD ; 253 b9f0: e1 cf rjmp .-62 ; 0xb9b4 WRITE(LCD_PINS_D5, value & 0x20); b9f2: f8 94 cli b9f4: 90 91 05 01 lds r25, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> b9f8: 9e 7f andi r25, 0xFE ; 254 b9fa: e6 cf rjmp .-52 ; 0xb9c8 WRITE(LCD_PINS_D6, value & 0x40); b9fc: 45 98 cbi 0x08, 5 ; 8 b9fe: ea cf rjmp .-44 ; 0xb9d4 WRITE(LCD_PINS_D7, value & 0x80); ba00: 46 98 cbi 0x08, 6 ; 8 ba02: eb cf rjmp .-42 ; 0xb9da 0000ba04 : lcd_pulseEnable(); } static void lcd_send(uint8_t data, uint8_t flags, uint16_t duration = LCD_DEFAULT_DELAY) { ba04: 0f 93 push r16 ba06: 1f 93 push r17 ba08: cf 93 push r28 ba0a: df 93 push r29 ba0c: c8 2f mov r28, r24 ba0e: d6 2f mov r29, r22 ba10: 8a 01 movw r16, r20 WRITE(LCD_PINS_RS,flags&LCD_RS_FLAG); ba12: 60 ff sbrs r22, 0 ba14: 15 c0 rjmp .+42 ; 0xba40 ba16: 5f 9a sbi 0x0b, 7 ; 11 ba18: 8a e1 ldi r24, 0x1A ; 26 ba1a: 8a 95 dec r24 ba1c: f1 f7 brne .-4 ; 0xba1a ba1e: 00 c0 rjmp .+0 ; 0xba20 _delay_us(5); lcd_writebits(data); ba20: 8c 2f mov r24, r28 ba22: 0e 94 d3 5c call 0xb9a6 ; 0xb9a6 #ifndef LCD_8BIT if (!(flags & LCD_HALF_FLAG)) { ba26: d1 fd sbrc r29, 1 ba28: 04 c0 rjmp .+8 ; 0xba32 // _delay_us(LCD_DEFAULT_DELAY); // should not be needed when sending a two nibble instruction. lcd_writebits((data << 4) | (data >> 4)); //force efficient swap opcode even though the lower nibble is ignored in this case ba2a: 8c 2f mov r24, r28 ba2c: 82 95 swap r24 ba2e: 0e 94 d3 5c call 0xb9a6 ; 0xb9a6 } #endif delayMicroseconds(duration); ba32: c8 01 movw r24, r16 } ba34: df 91 pop r29 ba36: cf 91 pop r28 ba38: 1f 91 pop r17 ba3a: 0f 91 pop r16 if (!(flags & LCD_HALF_FLAG)) { // _delay_us(LCD_DEFAULT_DELAY); // should not be needed when sending a two nibble instruction. lcd_writebits((data << 4) | (data >> 4)); //force efficient swap opcode even though the lower nibble is ignored in this case } #endif delayMicroseconds(duration); ba3c: 0c 94 de bf jmp 0x17fbc ; 0x17fbc lcd_pulseEnable(); } static void lcd_send(uint8_t data, uint8_t flags, uint16_t duration = LCD_DEFAULT_DELAY) { WRITE(LCD_PINS_RS,flags&LCD_RS_FLAG); ba40: 5f 98 cbi 0x0b, 7 ; 11 ba42: ea cf rjmp .-44 ; 0xba18 0000ba44 : return def; } return val; } void __attribute__((noinline)) eeprom_init_default_float(float *__p, float def) { ba44: cf 92 push r12 ba46: df 92 push r13 ba48: ef 92 push r14 ba4a: ff 92 push r15 ba4c: cf 93 push r28 ba4e: df 93 push r29 ba50: ec 01 movw r28, r24 ba52: 6a 01 movw r12, r20 ba54: 7b 01 movw r14, r22 if (eeprom_read_dword((uint32_t*)__p) == EEPROM_EMPTY_VALUE32) ba56: 0f 94 e4 9f call 0x33fc8 ; 0x33fc8 ba5a: 6f 3f cpi r22, 0xFF ; 255 ba5c: 7f 4f sbci r23, 0xFF ; 255 ba5e: 8f 4f sbci r24, 0xFF ; 255 ba60: 9f 4f sbci r25, 0xFF ; 255 ba62: 59 f4 brne .+22 ; 0xba7a if (active) { float previous_value = eeprom_read_float(dst); eeprom_float_notify(dst, previous_value, value, true); } #endif //DEBUG_EEPROM_CHANGES eeprom_write_float(dst, value); ba64: b7 01 movw r22, r14 ba66: a6 01 movw r20, r12 ba68: ce 01 movw r24, r28 } void __attribute__((noinline)) eeprom_init_default_float(float *__p, float def) { if (eeprom_read_dword((uint32_t*)__p) == EEPROM_EMPTY_VALUE32) eeprom_write_float_notify(__p, def); } ba6a: df 91 pop r29 ba6c: cf 91 pop r28 ba6e: ff 90 pop r15 ba70: ef 90 pop r14 ba72: df 90 pop r13 ba74: cf 90 pop r12 if (active) { float previous_value = eeprom_read_float(dst); eeprom_float_notify(dst, previous_value, value, true); } #endif //DEBUG_EEPROM_CHANGES eeprom_write_float(dst, value); ba76: 0d 94 32 a0 jmp 0x34064 ; 0x34064 } void __attribute__((noinline)) eeprom_init_default_float(float *__p, float def) { if (eeprom_read_dword((uint32_t*)__p) == EEPROM_EMPTY_VALUE32) eeprom_write_float_notify(__p, def); } ba7a: df 91 pop r29 ba7c: cf 91 pop r28 ba7e: ff 90 pop r15 ba80: ef 90 pop r14 ba82: df 90 pop r13 ba84: cf 90 pop r12 ba86: 08 95 ret 0000ba88 : } } void dcode_core(daddr_t addr_start, const daddr_t addr_end, const dcode_mem_t type, uint8_t dcode, const char* type_desc) { ba88: 7f 92 push r7 ba8a: 8f 92 push r8 ba8c: 9f 92 push r9 ba8e: af 92 push r10 ba90: bf 92 push r11 ba92: cf 92 push r12 ba94: df 92 push r13 ba96: ef 92 push r14 ba98: ff 92 push r15 ba9a: 0f 93 push r16 ba9c: 1f 93 push r17 ba9e: cf 93 push r28 baa0: df 93 push r29 baa2: cd b7 in r28, 0x3d ; 61 baa4: de b7 in r29, 0x3e ; 62 baa6: 60 97 sbiw r28, 0x10 ; 16 baa8: 0f b6 in r0, 0x3f ; 63 baaa: f8 94 cli baac: de bf out 0x3e, r29 ; 62 baae: 0f be out 0x3f, r0 ; 63 bab0: cd bf out 0x3d, r28 ; 61 bab2: 5c 01 movw r10, r24 bab4: 6b 01 movw r12, r22 bab6: 74 2e mov r7, r20 KEEPALIVE_STATE(NOT_BUSY); bab8: 81 e0 ldi r24, 0x01 ; 1 baba: 80 93 78 02 sts 0x0278, r24 ; 0x800278 DBG(_N("D%d - Read/Write %S\n"), dcode, type_desc); babe: 1f 93 push r17 bac0: 0f 93 push r16 bac2: 1f 92 push r1 bac4: 2f 93 push r18 bac6: 8d e7 ldi r24, 0x7D ; 125 bac8: 93 e6 ldi r25, 0x63 ; 99 baca: 9f 93 push r25 bacc: 8f 93 push r24 bace: 0f 94 9e 9e call 0x33d3c ; 0x33d3c daddr_t count = -1; // RW the entire space by default if (code_seen('A')) bad2: 81 e4 ldi r24, 0x41 ; 65 bad4: 0e 94 2b 55 call 0xaa56 ; 0xaa56 bad8: 0f 90 pop r0 bada: 0f 90 pop r0 badc: 0f 90 pop r0 bade: 0f 90 pop r0 bae0: 0f 90 pop r0 bae2: 0f 90 pop r0 bae4: 88 23 and r24, r24 bae6: 89 f0 breq .+34 ; 0xbb0a addr_start = (strchr_pointer[1] == 'x')?strtol(strchr_pointer + 2, 0, 16):(int)code_value(); bae8: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 baec: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 baf0: fc 01 movw r30, r24 baf2: 21 81 ldd r18, Z+1 ; 0x01 baf4: 28 37 cpi r18, 0x78 ; 120 baf6: 09 f0 breq .+2 ; 0xbafa baf8: 56 c0 rjmp .+172 ; 0xbba6 bafa: 40 e1 ldi r20, 0x10 ; 16 bafc: 50 e0 ldi r21, 0x00 ; 0 bafe: 70 e0 ldi r23, 0x00 ; 0 bb00: 60 e0 ldi r22, 0x00 ; 0 bb02: 02 96 adiw r24, 0x02 ; 2 bb04: 0f 94 67 9b call 0x336ce ; 0x336ce bb08: 5b 01 movw r10, r22 if (code_seen('C')) bb0a: 83 e4 ldi r24, 0x43 ; 67 bb0c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 bb10: 88 23 and r24, r24 bb12: 09 f4 brne .+2 ; 0xbb16 bb14: 4d c0 rjmp .+154 ; 0xbbb0 count = code_value_long(); bb16: 0e 94 93 55 call 0xab26 ; 0xab26 bb1a: 4b 01 movw r8, r22 bb1c: 75 01 movw r14, r10 bb1e: ca 14 cp r12, r10 bb20: db 04 cpc r13, r11 bb22: 08 f4 brcc .+2 ; 0xbb26 bb24: 76 01 movw r14, r12 if (addr_start > addr_end) addr_start = addr_end; if ((addr_start + count) > addr_end || (addr_start + count) < addr_start) bb26: c4 01 movw r24, r8 bb28: 8e 0d add r24, r14 bb2a: 9f 1d adc r25, r15 bb2c: c8 16 cp r12, r24 bb2e: d9 06 cpc r13, r25 bb30: 18 f0 brcs .+6 ; 0xbb38 bb32: 8e 15 cp r24, r14 bb34: 9f 05 cpc r25, r15 bb36: 18 f4 brcc .+6 ; 0xbb3e count = addr_end - addr_start; bb38: 46 01 movw r8, r12 bb3a: 8e 18 sub r8, r14 bb3c: 9f 08 sbc r9, r15 if (code_seen('X')) bb3e: 88 e5 ldi r24, 0x58 ; 88 bb40: 0e 94 2b 55 call 0xaa56 ; 0xaa56 bb44: 88 23 and r24, r24 bb46: 09 f4 brne .+2 ; 0xbb4a bb48: 71 c0 rjmp .+226 ; 0xbc2c { uint8_t data[16]; count = parse_hex(strchr_pointer + 1, data, 16); bb4a: 20 91 f5 16 lds r18, 0x16F5 ; 0x8016f5 bb4e: 30 91 f6 16 lds r19, 0x16F6 ; 0x8016f6 bb52: 2f 5f subi r18, 0xFF ; 255 bb54: 3f 4f sbci r19, 0xFF ; 255 bb56: ce 01 movw r24, r28 bb58: 01 96 adiw r24, 0x01 ; 1 bb5a: 5c 01 movw r10, r24 bb5c: dc 01 movw r26, r24 print_hex_byte(val & 0xFF); } int parse_hex(const char* hex, uint8_t* data, int count) { int parsed = 0; bb5e: d1 2c mov r13, r1 bb60: c1 2c mov r12, r1 bb62: f9 01 movw r30, r18 while (*hex) bb64: 80 81 ld r24, Z bb66: 2f 5f subi r18, 0xFF ; 255 bb68: 3f 4f sbci r19, 0xFF ; 255 bb6a: 88 23 and r24, r24 bb6c: b9 f1 breq .+110 ; 0xbbdc { if (count && (parsed >= count)) break; bb6e: 90 e1 ldi r25, 0x10 ; 16 bb70: c9 16 cp r12, r25 bb72: d1 04 cpc r13, r1 bb74: 99 f1 breq .+102 ; 0xbbdc char c = *(hex++); if (c == ' ') continue; bb76: 80 32 cpi r24, 0x20 ; 32 bb78: a1 f3 breq .-24 ; 0xbb62 if (c == '\n') break; bb7a: 8a 30 cpi r24, 0x0A ; 10 bb7c: 79 f1 breq .+94 ; 0xbbdc uint8_t val = 0x00; if ((c >= '0') && (c <= '9')) val |= ((c - '0') << 4); bb7e: 90 ed ldi r25, 0xD0 ; 208 bb80: 98 0f add r25, r24 bb82: 9a 30 cpi r25, 0x0A ; 10 bb84: c8 f4 brcc .+50 ; 0xbbb8 bb86: 82 95 swap r24 bb88: 80 7f andi r24, 0xF0 ; 240 else if ((c >= 'a') && (c <= 'f')) val |= ((c - 'a' + 10) << 4); else return -parsed; c = *(hex++); bb8a: 9f 01 movw r18, r30 bb8c: 2e 5f subi r18, 0xFE ; 254 bb8e: 3f 4f sbci r19, 0xFF ; 255 if ((c >= '0') && (c <= '9')) val |= (c - '0'); bb90: 91 81 ldd r25, Z+1 ; 0x01 bb92: 40 ed ldi r20, 0xD0 ; 208 bb94: 49 0f add r20, r25 bb96: 4a 30 cpi r20, 0x0A ; 10 bb98: b8 f4 brcc .+46 ; 0xbbc8 bb9a: 84 2b or r24, r20 else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); else return -parsed; data[parsed] = val; bb9c: 8d 93 st X+, r24 parsed++; bb9e: ef ef ldi r30, 0xFF ; 255 bba0: ce 1a sub r12, r30 bba2: de 0a sbc r13, r30 bba4: de cf rjmp .-68 ; 0xbb62 { KEEPALIVE_STATE(NOT_BUSY); DBG(_N("D%d - Read/Write %S\n"), dcode, type_desc); daddr_t count = -1; // RW the entire space by default if (code_seen('A')) addr_start = (strchr_pointer[1] == 'x')?strtol(strchr_pointer + 2, 0, 16):(int)code_value(); bba6: 0e 94 03 5a call 0xb406 ; 0xb406 bbaa: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> bbae: ac cf rjmp .-168 ; 0xbb08 void dcode_core(daddr_t addr_start, const daddr_t addr_end, const dcode_mem_t type, uint8_t dcode, const char* type_desc) { KEEPALIVE_STATE(NOT_BUSY); DBG(_N("D%d - Read/Write %S\n"), dcode, type_desc); daddr_t count = -1; // RW the entire space by default bbb0: 88 24 eor r8, r8 bbb2: 8a 94 dec r8 bbb4: 98 2c mov r9, r8 bbb6: b2 cf rjmp .-156 ; 0xbb1c char c = *(hex++); if (c == ' ') continue; if (c == '\n') break; uint8_t val = 0x00; if ((c >= '0') && (c <= '9')) val |= ((c - '0') << 4); else if ((c >= 'a') && (c <= 'f')) val |= ((c - 'a' + 10) << 4); bbb8: 9f e9 ldi r25, 0x9F ; 159 bbba: 98 0f add r25, r24 bbbc: 96 30 cpi r25, 0x06 ; 6 bbbe: 58 f4 brcc .+22 ; 0xbbd6 bbc0: 82 95 swap r24 bbc2: 80 7f andi r24, 0xF0 ; 240 bbc4: 80 57 subi r24, 0x70 ; 112 bbc6: e1 cf rjmp .-62 ; 0xbb8a else return -parsed; c = *(hex++); if ((c >= '0') && (c <= '9')) val |= (c - '0'); else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); bbc8: 4f e9 ldi r20, 0x9F ; 159 bbca: 49 0f add r20, r25 bbcc: 46 30 cpi r20, 0x06 ; 6 bbce: 18 f4 brcc .+6 ; 0xbbd6 bbd0: 97 55 subi r25, 0x57 ; 87 bbd2: 89 2b or r24, r25 bbd4: e3 cf rjmp .-58 ; 0xbb9c else return -parsed; bbd6: d1 94 neg r13 bbd8: c1 94 neg r12 bbda: d1 08 sbc r13, r1 } // TODO: this only handles SRAM/EEPROM 16bit addresses void write_mem(uint16_t address, uint16_t count, const uint8_t* data, const dcode_mem_t type) { for (uint16_t i = 0; i < count; i++) bbdc: 91 2c mov r9, r1 bbde: 81 2c mov r8, r1 bbe0: c8 14 cp r12, r8 bbe2: d9 04 cpc r13, r9 bbe4: 91 f0 breq .+36 ; 0xbc0a bbe6: f5 01 movw r30, r10 bbe8: 61 91 ld r22, Z+ bbea: 5f 01 movw r10, r30 bbec: c4 01 movw r24, r8 bbee: 8e 0d add r24, r14 bbf0: 9f 1d adc r25, r15 { switch (type) bbf2: f1 e0 ldi r31, 0x01 ; 1 bbf4: 7f 16 cp r7, r31 bbf6: 31 f0 breq .+12 ; 0xbc04 { case dcode_mem_t::sram: *((uint8_t*)address) = data[i]; break; bbf8: fc 01 movw r30, r24 bbfa: 60 83 st Z, r22 } // TODO: this only handles SRAM/EEPROM 16bit addresses void write_mem(uint16_t address, uint16_t count, const uint8_t* data, const dcode_mem_t type) { for (uint16_t i = 0; i < count; i++) bbfc: ff ef ldi r31, 0xFF ; 255 bbfe: 8f 1a sub r8, r31 bc00: 9f 0a sbc r9, r31 bc02: ee cf rjmp .-36 ; 0xbbe0 if (active) { uint8_t previous_value = eeprom_read_byte(dst); eeprom_byte_notify(dst, previous_value, value, true); } #endif //DEBUG_EEPROM_CHANGES eeprom_write_byte(dst, value); bc04: 0f 94 24 a0 call 0x34048 ; 0x34048 bc08: f9 cf rjmp .-14 ; 0xbbfc count = parse_hex(strchr_pointer + 1, data, 16); write_mem(addr_start, count, data, type); #if DADDR_SIZE > 16 DBG(_N("%lu bytes written to %S at address 0x%04lx\n"), count, type_desc, addr_start); #else DBG(_N("%u bytes written to %S at address 0x%08x\n"), count, type_desc, addr_start); bc0a: ff 92 push r15 bc0c: ef 92 push r14 bc0e: 1f 93 push r17 bc10: 0f 93 push r16 bc12: 9f 92 push r9 bc14: 8f 92 push r8 bc16: 83 e5 ldi r24, 0x53 ; 83 bc18: 93 e6 ldi r25, 0x63 ; 99 bc1a: 9f 93 push r25 bc1c: 8f 93 push r24 bc1e: 0f 94 9e 9e call 0x33d3c ; 0x33d3c bc22: 0f b6 in r0, 0x3f ; 63 bc24: f8 94 cli bc26: de bf out 0x3e, r29 ; 62 bc28: 0f be out 0x3f, r0 ; 63 bc2a: cd bf out 0x3d, r28 ; 61 #endif } print_mem(addr_start, count, type); bc2c: 47 2d mov r20, r7 bc2e: b4 01 movw r22, r8 bc30: c7 01 movw r24, r14 } bc32: 60 96 adiw r28, 0x10 ; 16 bc34: 0f b6 in r0, 0x3f ; 63 bc36: f8 94 cli bc38: de bf out 0x3e, r29 ; 62 bc3a: 0f be out 0x3f, r0 ; 63 bc3c: cd bf out 0x3d, r28 ; 61 bc3e: df 91 pop r29 bc40: cf 91 pop r28 bc42: 1f 91 pop r17 bc44: 0f 91 pop r16 bc46: ff 90 pop r15 bc48: ef 90 pop r14 bc4a: df 90 pop r13 bc4c: cf 90 pop r12 bc4e: bf 90 pop r11 bc50: af 90 pop r10 bc52: 9f 90 pop r9 bc54: 8f 90 pop r8 bc56: 7f 90 pop r7 DBG(_N("%lu bytes written to %S at address 0x%04lx\n"), count, type_desc, addr_start); #else DBG(_N("%u bytes written to %S at address 0x%08x\n"), count, type_desc, addr_start); #endif } print_mem(addr_start, count, type); bc58: 0d 94 e5 52 jmp 0x2a5ca ; 0x2a5ca 0000bc5c : /// This function should backup variables which may be lost /// For example a power panic in M600 or during MMU error void refresh_print_state_in_ram() { if (saved_printing) return; memcpy(saved_pos, current_position, sizeof(saved_pos)); bc5c: 80 e1 ldi r24, 0x10 ; 16 bc5e: e5 ef ldi r30, 0xF5 ; 245 bc60: f1 e1 ldi r31, 0x11 ; 17 bc62: a0 e9 ldi r26, 0x90 ; 144 bc64: b2 e0 ldi r27, 0x02 ; 2 bc66: 01 90 ld r0, Z+ bc68: 0d 92 st X+, r0 bc6a: 8a 95 dec r24 bc6c: e1 f7 brne .-8 ; 0xbc66 saved_feedmultiply2 = feedmultiply; //save feedmultiply bc6e: 80 91 8e 02 lds r24, 0x028E ; 0x80028e bc72: 90 91 8f 02 lds r25, 0x028F ; 0x80028f bc76: 90 93 f4 11 sts 0x11F4, r25 ; 0x8011f4 <_ZL19saved_feedmultiply2.lto_priv.502+0x1> bc7a: 80 93 f3 11 sts 0x11F3, r24 ; 0x8011f3 <_ZL19saved_feedmultiply2.lto_priv.502> saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); bc7e: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 bc82: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 bc86: 90 93 f0 11 sts 0x11F0, r25 ; 0x8011f0 bc8a: 80 93 ef 11 sts 0x11EF, r24 ; 0x8011ef saved_bed_temperature = (uint8_t)degTargetBed(); bc8e: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed bc92: 80 93 ec 11 sts 0x11EC, r24 ; 0x8011ec saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; bc96: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb bc9a: 83 fb bst r24, 3 bc9c: 88 27 eor r24, r24 bc9e: 80 f9 bld r24, 0 bca0: 80 93 ea 11 sts 0x11EA, r24 ; 0x8011ea saved_fan_speed = fanSpeed; bca4: 80 91 e9 11 lds r24, 0x11E9 ; 0x8011e9 bca8: 80 93 e8 11 sts 0x11E8, r24 ; 0x8011e8 isPartialBackupAvailable = true; } bcac: 08 95 ret 0000bcae <_GLOBAL__sub_D_card>: while(!lcd_clicked()) { delay_keep_alive(0); } KEEPALIVE_STATE(busy_state_backup); } bcae: cf 93 push r28 bcb0: df 93 push r29 //------------------------------------------------------------------------------ /** * \class SdFile * \brief SdBaseFile with Print. */ class SdFile : public SdBaseFile/*, public Print*/ { bcb2: 8a ef ldi r24, 0xFA ; 250 bcb4: 95 e1 ldi r25, 0x15 ; 21 bcb6: 0e 94 3b 70 call 0xe076 ; 0xe076 #ifdef SDSUPPORT #define MAX_DIR_DEPTH 6 #include "SdFile.h" class CardReader bcba: 88 e3 ldi r24, 0x38 ; 56 bcbc: 94 e1 ldi r25, 0x14 ; 20 bcbe: 89 2b or r24, r25 bcc0: 51 f0 breq .+20 ; 0xbcd6 <_GLOBAL__sub_D_card+0x28> bcc2: ca e0 ldi r28, 0x0A ; 10 bcc4: d5 e1 ldi r29, 0x15 ; 21 bcc6: a3 97 sbiw r28, 0x23 ; 35 bcc8: ce 01 movw r24, r28 bcca: 0e 94 3b 70 call 0xe076 ; 0xe076 bcce: 84 e1 ldi r24, 0x14 ; 20 bcd0: c8 33 cpi r28, 0x38 ; 56 bcd2: d8 07 cpc r29, r24 bcd4: c1 f7 brne .-16 ; 0xbcc6 <_GLOBAL__sub_D_card+0x18> bcd6: 85 e1 ldi r24, 0x15 ; 21 bcd8: 94 e1 ldi r25, 0x14 ; 20 bcda: 0e 94 3b 70 call 0xe076 ; 0xe076 bcde: 80 ef ldi r24, 0xF0 ; 240 bce0: 93 e1 ldi r25, 0x13 ; 19 bce2: df 91 pop r29 bce4: cf 91 pop r28 bce6: 0c 94 3b 70 jmp 0xe076 ; 0xe076 0000bcea : print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; } void load_filament_final_feed() { bcea: cf 93 push r28 bcec: df 93 push r29 current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; bcee: c5 ef ldi r28, 0xF5 ; 245 bcf0: d1 e1 ldi r29, 0x11 ; 17 bcf2: 20 e0 ldi r18, 0x00 ; 0 bcf4: 30 e0 ldi r19, 0x00 ; 0 bcf6: 48 ec ldi r20, 0xC8 ; 200 bcf8: 51 e4 ldi r21, 0x41 ; 65 bcfa: 6c 85 ldd r22, Y+12 ; 0x0c bcfc: 7d 85 ldd r23, Y+13 ; 0x0d bcfe: 8e 85 ldd r24, Y+14 ; 0x0e bd00: 9f 85 ldd r25, Y+15 ; 0x0f bd02: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> bd06: 6c 87 std Y+12, r22 ; 0x0c bd08: 7d 87 std Y+13, r23 ; 0x0d bd0a: 8e 87 std Y+14, r24 ; 0x0e bd0c: 9f 87 std Y+15, r25 ; 0x0f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); bd0e: 63 e3 ldi r22, 0x33 ; 51 bd10: 73 e3 ldi r23, 0x33 ; 51 bd12: 83 e5 ldi r24, 0x53 ; 83 bd14: 90 e4 ldi r25, 0x40 ; 64 } bd16: df 91 pop r29 bd18: cf 91 pop r28 } void load_filament_final_feed() { current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); bd1a: 0d 94 70 84 jmp 0x308e0 ; 0x308e0 0000bd1e : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); bd1e: 60 e0 ldi r22, 0x00 ; 0 bd20: 85 ea ldi r24, 0xA5 ; 165 bd22: 9f e0 ldi r25, 0x0F ; 15 bd24: 0f 94 00 a0 call 0x34000 ; 0x34000 bd28: 60 e0 ldi r22, 0x00 ; 0 bd2a: 8f e7 ldi r24, 0x7F ; 127 bd2c: 9c e0 ldi r25, 0x0C ; 12 bd2e: 0f 94 00 a0 call 0x34000 ; 0x34000 // Cancel the state related to a currently saved print void cancel_saved_printing() { eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO, PowerPanic::NO_PENDING_RECOVERY); eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO_Z_LIFTED, 0); saved_start_position[0] = SAVED_START_POSITION_UNSET; bd32: 80 e0 ldi r24, 0x00 ; 0 bd34: 90 e0 ldi r25, 0x00 ; 0 bd36: a0 e8 ldi r26, 0x80 ; 128 bd38: bf eb ldi r27, 0xBF ; 191 bd3a: 80 93 7e 02 sts 0x027E, r24 ; 0x80027e bd3e: 90 93 7f 02 sts 0x027F, r25 ; 0x80027f bd42: a0 93 80 02 sts 0x0280, r26 ; 0x800280 bd46: b0 93 81 02 sts 0x0281, r27 ; 0x800281 saved_printing_type = PowerPanic::PRINT_TYPE_NONE; bd4a: 82 e0 ldi r24, 0x02 ; 2 bd4c: 80 93 79 02 sts 0x0279, r24 ; 0x800279 saved_printing = false; bd50: 10 92 e7 11 sts 0x11E7, r1 ; 0x8011e7 } bd54: 08 95 ret 0000bd56 : enquecommandf_P(MSG_M23, filename); } void restore_extruder_temperature_from_ram() { if ((uint16_t)degTargetHotend(active_extruder) != saved_extruder_temperature) bd56: 80 91 ef 11 lds r24, 0x11EF ; 0x8011ef bd5a: 90 91 f0 11 lds r25, 0x11F0 ; 0x8011f0 bd5e: 20 91 f1 11 lds r18, 0x11F1 ; 0x8011f1 bd62: 30 91 f2 11 lds r19, 0x11F2 ; 0x8011f2 bd66: 28 17 cp r18, r24 bd68: 39 07 cpc r19, r25 bd6a: 71 f0 breq .+28 ; 0xbd88 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; bd6c: 90 93 f2 11 sts 0x11F2, r25 ; 0x8011f2 bd70: 80 93 f1 11 sts 0x11F1, r24 ; 0x8011f1 { setTargetHotend(saved_extruder_temperature); heating_status = HeatingStatus::EXTRUDER_HEATING; bd74: 81 e0 ldi r24, 0x01 ; 1 bd76: 80 93 99 03 sts 0x0399, r24 ; 0x800399 wait_for_heater(_millis(), active_extruder); bd7a: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 bd7e: 0f 94 98 4e call 0x29d30 ; 0x29d30 heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; bd82: 82 e0 ldi r24, 0x02 ; 2 bd84: 80 93 99 03 sts 0x0399, r24 ; 0x800399 } } bd88: 08 95 ret 0000bd8a : saved_fan_speed = fanSpeed; isPartialBackupAvailable = true; } void __attribute__((noinline)) refresh_saved_feedrate_multiplier_in_ram() { if (!saved_printing) { bd8a: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 bd8e: 88 23 and r24, r24 bd90: 41 f0 breq .+16 ; 0xbda2 // There is no saved print, therefore nothing to refresh return; } saved_feedmultiply2 = feedmultiply; bd92: 80 91 8e 02 lds r24, 0x028E ; 0x80028e bd96: 90 91 8f 02 lds r25, 0x028F ; 0x80028f bd9a: 90 93 f4 11 sts 0x11F4, r25 ; 0x8011f4 <_ZL19saved_feedmultiply2.lto_priv.502+0x1> bd9e: 80 93 f3 11 sts 0x11F3, r24 ; 0x8011f3 <_ZL19saved_feedmultiply2.lto_priv.502> } bda2: 08 95 ret 0000bda4 : if (extrudemultiply != 100) out *= float(extrudemultiply) * 0.01f; return out; } void calculate_extruder_multipliers() { bda4: cf 92 push r12 bda6: df 92 push r13 bda8: ef 92 push r14 bdaa: ff 92 push r15 extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); bdac: c0 90 ca 04 lds r12, 0x04CA ; 0x8004ca bdb0: d0 90 cb 04 lds r13, 0x04CB ; 0x8004cb bdb4: e0 90 cc 04 lds r14, 0x04CC ; 0x8004cc bdb8: f0 90 cd 04 lds r15, 0x04CD ; 0x8004cd } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; if (cs.volumetric_enabled && diameter > 0.f) { bdbc: 80 91 c9 04 lds r24, 0x04C9 ; 0x8004c9 bdc0: 88 23 and r24, r24 bdc2: 09 f4 brne .+2 ; 0xbdc6 bdc4: 4e c0 rjmp .+156 ; 0xbe62 bdc6: 20 e0 ldi r18, 0x00 ; 0 bdc8: 30 e0 ldi r19, 0x00 ; 0 bdca: a9 01 movw r20, r18 bdcc: c7 01 movw r24, r14 bdce: b6 01 movw r22, r12 bdd0: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> bdd4: 18 16 cp r1, r24 bdd6: 0c f0 brlt .+2 ; 0xbdda bdd8: 44 c0 rjmp .+136 ; 0xbe62 float area = M_PI * diameter * diameter * 0.25; bdda: 2b ed ldi r18, 0xDB ; 219 bddc: 3f e0 ldi r19, 0x0F ; 15 bdde: 49 e4 ldi r20, 0x49 ; 73 bde0: 50 e4 ldi r21, 0x40 ; 64 bde2: c7 01 movw r24, r14 bde4: b6 01 movw r22, r12 bde6: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> bdea: a7 01 movw r20, r14 bdec: 96 01 movw r18, r12 bdee: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> bdf2: 20 e0 ldi r18, 0x00 ; 0 bdf4: 30 e0 ldi r19, 0x00 ; 0 bdf6: 40 e8 ldi r20, 0x80 ; 128 bdf8: 5e e3 ldi r21, 0x3E ; 62 bdfa: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> bdfe: 9b 01 movw r18, r22 be00: ac 01 movw r20, r24 out = 1.f / area; be02: 60 e0 ldi r22, 0x00 ; 0 be04: 70 e0 ldi r23, 0x00 ; 0 be06: 80 e8 ldi r24, 0x80 ; 128 be08: 9f e3 ldi r25, 0x3F ; 63 be0a: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> be0e: 6b 01 movw r12, r22 be10: 7c 01 movw r14, r24 } if (extrudemultiply != 100) be12: 60 91 59 02 lds r22, 0x0259 ; 0x800259 be16: 70 91 5a 02 lds r23, 0x025A ; 0x80025a be1a: 64 36 cpi r22, 0x64 ; 100 be1c: 71 05 cpc r23, r1 be1e: a1 f0 breq .+40 ; 0xbe48 out *= float(extrudemultiply) * 0.01f; be20: 07 2e mov r0, r23 be22: 00 0c add r0, r0 be24: 88 0b sbc r24, r24 be26: 99 0b sbc r25, r25 be28: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> be2c: 2a e0 ldi r18, 0x0A ; 10 be2e: 37 ed ldi r19, 0xD7 ; 215 be30: 43 e2 ldi r20, 0x23 ; 35 be32: 5c e3 ldi r21, 0x3C ; 60 be34: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> be38: 9b 01 movw r18, r22 be3a: ac 01 movw r20, r24 be3c: c7 01 movw r24, r14 be3e: b6 01 movw r22, r12 be40: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> be44: 6b 01 movw r12, r22 be46: 7c 01 movw r14, r24 return out; } void calculate_extruder_multipliers() { extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); be48: c0 92 10 02 sts 0x0210, r12 ; 0x800210 be4c: d0 92 11 02 sts 0x0211, r13 ; 0x800211 be50: e0 92 12 02 sts 0x0212, r14 ; 0x800212 be54: f0 92 13 02 sts 0x0213, r15 ; 0x800213 extruder_multiplier[1] = calculate_extruder_multiplier(cs.filament_size[1]); #if EXTRUDERS > 2 extruder_multiplier[2] = calculate_extruder_multiplier(cs.filament_size[2]); #endif #endif } be58: ff 90 pop r15 be5a: ef 90 pop r14 be5c: df 90 pop r13 be5e: cf 90 pop r12 be60: 08 95 ret MMU2::mmu2.ClearTMCFailures(); // not stored into EEPROM } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; be62: c1 2c mov r12, r1 be64: d1 2c mov r13, r1 be66: 80 e8 ldi r24, 0x80 ; 128 be68: e8 2e mov r14, r24 be6a: 8f e3 ldi r24, 0x3F ; 63 be6c: f8 2e mov r15, r24 be6e: d1 cf rjmp .-94 ; 0xbe12 0000be70 : } } #endif //FAST_PWM_FAN void save_statistics() { be70: 8f 92 push r8 be72: 9f 92 push r9 be74: af 92 push r10 be76: bf 92 push r11 be78: cf 92 push r12 be7a: df 92 push r13 be7c: ef 92 push r14 be7e: ff 92 push r15 uint32_t _previous_filament = eeprom_init_default_dword((uint32_t *)EEPROM_FILAMENTUSED, 0); //_previous_filament unit: centimeter be80: 81 ef ldi r24, 0xF1 ; 241 be82: 9f e0 ldi r25, 0x0F ; 15 be84: 0f 94 b7 48 call 0x2916e ; 0x2916e be88: 6b 01 movw r12, r22 be8a: 7c 01 movw r14, r24 uint32_t _previous_time = eeprom_init_default_dword((uint32_t *)EEPROM_TOTALTIME, 0); //_previous_time unit: min be8c: 8d ee ldi r24, 0xED ; 237 be8e: 9f e0 ldi r25, 0x0F ; 15 be90: 0f 94 b7 48 call 0x2916e ; 0x2916e be94: 4b 01 movw r8, r22 be96: 5c 01 movw r10, r24 uint32_t time_minutes = print_job_timer.duration() / 60; be98: 0f 94 66 1c call 0x238cc ; 0x238cc be9c: 2c e3 ldi r18, 0x3C ; 60 be9e: 30 e0 ldi r19, 0x00 ; 0 bea0: 40 e0 ldi r20, 0x00 ; 0 bea2: 50 e0 ldi r21, 0x00 ; 0 bea4: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, _previous_time + time_minutes); // EEPROM_TOTALTIME unit: min bea8: ba 01 movw r22, r20 beaa: a9 01 movw r20, r18 beac: 48 0d add r20, r8 beae: 59 1d adc r21, r9 beb0: 6a 1d adc r22, r10 beb2: 7b 1d adc r23, r11 if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); beb4: 8d ee ldi r24, 0xED ; 237 beb6: 9f e0 ldi r25, 0x0F ; 15 beb8: 0f 94 12 a0 call 0x34024 ; 0x34024 eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, _previous_filament + (total_filament_used / 1000)); bebc: 60 91 84 06 lds r22, 0x0684 ; 0x800684 bec0: 70 91 85 06 lds r23, 0x0685 ; 0x800685 bec4: 80 91 86 06 lds r24, 0x0686 ; 0x800686 bec8: 90 91 87 06 lds r25, 0x0687 ; 0x800687 becc: 28 ee ldi r18, 0xE8 ; 232 bece: 33 e0 ldi r19, 0x03 ; 3 bed0: 40 e0 ldi r20, 0x00 ; 0 bed2: 50 e0 ldi r21, 0x00 ; 0 bed4: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> bed8: ba 01 movw r22, r20 beda: a9 01 movw r20, r18 bedc: 4c 0d add r20, r12 bede: 5d 1d adc r21, r13 bee0: 6e 1d adc r22, r14 bee2: 7f 1d adc r23, r15 bee4: 81 ef ldi r24, 0xF1 ; 241 bee6: 9f e0 ldi r25, 0x0F ; 15 bee8: 0f 94 12 a0 call 0x34024 ; 0x34024 print_job_timer.reset(); beec: 0f 94 3b 20 call 0x24076 ; 0x24076 total_filament_used = 0; bef0: 10 92 84 06 sts 0x0684, r1 ; 0x800684 bef4: 10 92 85 06 sts 0x0685, r1 ; 0x800685 bef8: 10 92 86 06 sts 0x0686, r1 ; 0x800686 befc: 10 92 87 06 sts 0x0687, r1 ; 0x800687 if (MMU2::mmu2.Enabled()) { bf00: 80 91 94 12 lds r24, 0x1294 ; 0x801294 bf04: 81 30 cpi r24, 0x01 ; 1 bf06: 81 f4 brne .+32 ; 0xbf28 eeprom_add_dword((uint32_t *)EEPROM_MMU_MATERIAL_CHANGES, MMU2::mmu2.ToolChangeCounter()); bf08: 60 91 98 12 lds r22, 0x1298 ; 0x801298 bf0c: 70 91 99 12 lds r23, 0x1299 ; 0x801299 bf10: 90 e0 ldi r25, 0x00 ; 0 bf12: 80 e0 ldi r24, 0x00 ; 0 bf14: 0f 94 9f 48 call 0x2913e ; 0x2913e /// @return count for toolchange in current print inline uint16_t ToolChangeCounter() const { return toolchange_counter; }; /// Set toolchange counter to zero inline void ClearToolChangeCounter() { toolchange_counter = 0; }; bf18: 10 92 99 12 sts 0x1299, r1 ; 0x801299 bf1c: 10 92 98 12 sts 0x1298, r1 ; 0x801298 inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } inline void ClearTMCFailures() { tmcFailures = 0; } bf20: 10 92 9b 12 sts 0x129B, r1 ; 0x80129b bf24: 10 92 9a 12 sts 0x129A, r1 ; 0x80129a // @@TODO why were EEPROM_MMU_FAIL_TOT and EEPROM_MMU_LOAD_FAIL_TOT behaving differently - i.e. updated with every change? MMU2::mmu2.ClearToolChangeCounter(); MMU2::mmu2.ClearTMCFailures(); // not stored into EEPROM } } bf28: ff 90 pop r15 bf2a: ef 90 pop r14 bf2c: df 90 pop r13 bf2e: cf 90 pop r12 bf30: bf 90 pop r11 bf32: af 90 pop r10 bf34: 9f 90 pop r9 bf36: 8f 90 pop r8 bf38: 08 95 ret 0000bf3a : } #if (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1))))) void gcode_M123() { printf_P(_N("E0:%d RPM PRN1:%d RPM E0@:%u PRN1@:%u\n"), 60*fan_speed[active_extruder], 60*fan_speed[1], newFanSpeed, fanSpeed); bf3a: 80 91 e9 11 lds r24, 0x11E9 ; 0x8011e9 bf3e: 1f 92 push r1 bf40: 8f 93 push r24 bf42: 80 91 40 03 lds r24, 0x0340 ; 0x800340 bf46: 1f 92 push r1 bf48: 8f 93 push r24 bf4a: e5 e8 ldi r30, 0x85 ; 133 bf4c: f3 e0 ldi r31, 0x03 ; 3 bf4e: 42 81 ldd r20, Z+2 ; 0x02 bf50: 53 81 ldd r21, Z+3 ; 0x03 bf52: 2c e3 ldi r18, 0x3C ; 60 bf54: 24 9f mul r18, r20 bf56: c0 01 movw r24, r0 bf58: 25 9f mul r18, r21 bf5a: 90 0d add r25, r0 bf5c: 11 24 eor r1, r1 bf5e: 9f 93 push r25 bf60: 8f 93 push r24 bf62: 40 81 ld r20, Z bf64: 51 81 ldd r21, Z+1 ; 0x01 bf66: 24 9f mul r18, r20 bf68: c0 01 movw r24, r0 bf6a: 25 9f mul r18, r21 bf6c: 90 0d add r25, r0 bf6e: 11 24 eor r1, r1 bf70: 9f 93 push r25 bf72: 8f 93 push r24 bf74: 84 e1 ldi r24, 0x14 ; 20 bf76: 94 e6 ldi r25, 0x64 ; 100 bf78: 9f 93 push r25 bf7a: 8f 93 push r24 bf7c: 0f 94 9e 9e call 0x33d3c ; 0x33d3c bf80: 8d b7 in r24, 0x3d ; 61 bf82: 9e b7 in r25, 0x3e ; 62 bf84: 0a 96 adiw r24, 0x0a ; 10 bf86: 0f b6 in r0, 0x3f ; 63 bf88: f8 94 cli bf8a: 9e bf out 0x3e, r25 ; 62 bf8c: 0f be out 0x3f, r0 ; 63 bf8e: 8d bf out 0x3d, r24 ; 61 } bf90: 08 95 ret 0000bf92 : endstops_hit_on_purpose(); } void refresh_cmd_timeout(void) { previous_millis_cmd.start(); bf92: 8a e4 ldi r24, 0x4A ; 74 bf94: 93 e0 ldi r25, 0x03 ; 3 bf96: 0d 94 a1 11 jmp 0x22342 ; 0x22342 ::start()> 0000bf9a : } } #endif //TMC2130 float __attribute__((noinline)) get_feedrate_mm_s(const float feedrate_mm_min) { return feedrate_mm_min / 60.f; bf9a: 20 e0 ldi r18, 0x00 ; 0 bf9c: 30 e0 ldi r19, 0x00 ; 0 bf9e: 40 e7 ldi r20, 0x70 ; 112 bfa0: 52 e4 ldi r21, 0x42 ; 66 bfa2: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> } bfa6: 08 95 ret 0000bfa8 : } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; bfa8: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.364> //! @param original_feedmultiply feedmultiply to restore static void clean_up_after_endstop_move(int original_feedmultiply) { #ifdef ENDSTOPS_ONLY_FOR_HOMING enable_endstops(false); #endif feedrate = saved_feedrate; bfac: 40 91 3b 03 lds r20, 0x033B ; 0x80033b bfb0: 50 91 3c 03 lds r21, 0x033C ; 0x80033c bfb4: 60 91 3d 03 lds r22, 0x033D ; 0x80033d bfb8: 70 91 3e 03 lds r23, 0x033E ; 0x80033e bfbc: 40 93 7a 02 sts 0x027A, r20 ; 0x80027a bfc0: 50 93 7b 02 sts 0x027B, r21 ; 0x80027b bfc4: 60 93 7c 02 sts 0x027C, r22 ; 0x80027c bfc8: 70 93 7d 02 sts 0x027D, r23 ; 0x80027d feedmultiply = original_feedmultiply; bfcc: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f bfd0: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e previous_millis_cmd.start(); bfd4: 8a e4 ldi r24, 0x4A ; 74 bfd6: 93 e0 ldi r25, 0x03 ; 3 bfd8: 0d 94 a1 11 jmp 0x22342 ; 0x22342 ::start()> 0000bfdc : min_pos[axis] = base_min_pos(axis) + cs.add_homing[axis]; max_pos[axis] = base_max_pos(axis) + cs.add_homing[axis]; } //! @return original feedmultiply static int setup_for_endstop_move(bool enable_endstops_now = true) { bfdc: 1f 93 push r17 bfde: cf 93 push r28 bfe0: df 93 push r29 bfe2: 18 2f mov r17, r24 saved_feedrate = feedrate; bfe4: 80 91 7a 02 lds r24, 0x027A ; 0x80027a bfe8: 90 91 7b 02 lds r25, 0x027B ; 0x80027b bfec: a0 91 7c 02 lds r26, 0x027C ; 0x80027c bff0: b0 91 7d 02 lds r27, 0x027D ; 0x80027d bff4: 80 93 3b 03 sts 0x033B, r24 ; 0x80033b bff8: 90 93 3c 03 sts 0x033C, r25 ; 0x80033c bffc: a0 93 3d 03 sts 0x033D, r26 ; 0x80033d c000: b0 93 3e 03 sts 0x033E, r27 ; 0x80033e int l_feedmultiply = feedmultiply; c004: c0 91 8e 02 lds r28, 0x028E ; 0x80028e c008: d0 91 8f 02 lds r29, 0x028F ; 0x80028f feedmultiply = 100; c00c: 84 e6 ldi r24, 0x64 ; 100 c00e: 90 e0 ldi r25, 0x00 ; 0 c010: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f c014: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e previous_millis_cmd.start(); c018: 8a e4 ldi r24, 0x4A ; 74 c01a: 93 e0 ldi r25, 0x03 ; 3 c01c: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> c020: 10 93 77 02 sts 0x0277, r17 ; 0x800277 <_ZL14check_endstops.lto_priv.364> enable_endstops(enable_endstops_now); return l_feedmultiply; } c024: ce 01 movw r24, r28 c026: df 91 pop r29 c028: cf 91 pop r28 c02a: 1f 91 pop r17 c02c: 08 95 ret 0000c02e : XYZ_CONSTS_FROM_CONFIG(float, base_home_pos, HOME_POS); XYZ_CONSTS_FROM_CONFIG(float, max_length, MAX_LENGTH); XYZ_CONSTS_FROM_CONFIG(float, home_retract_mm, HOME_RETRACT_MM); XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); static void axis_is_at_home(uint8_t axis) { c02e: cf 92 push r12 c030: df 92 push r13 c032: ef 92 push r14 c034: ff 92 push r15 c036: 0f 93 push r16 c038: 1f 93 push r17 c03a: cf 93 push r28 c03c: df 93 push r29 type array##_ext(uint8_t axis) \ { return pgm_read_any(&array##_P[axis]); } XYZ_CONSTS_FROM_CONFIG(float, base_min_pos, MIN_POS); XYZ_CONSTS_FROM_CONFIG(float, base_max_pos, MAX_POS); XYZ_CONSTS_FROM_CONFIG(float, base_home_pos, HOME_POS); c03e: 90 e0 ldi r25, 0x00 ; 0 c040: ec 01 movw r28, r24 c042: cc 0f add r28, r28 c044: dd 1f adc r29, r29 c046: cc 0f add r28, r28 c048: dd 1f adc r29, r29 c04a: fe 01 movw r30, r28 c04c: eb 59 subi r30, 0x9B ; 155 c04e: f9 48 sbci r31, 0x89 ; 137 #define DEFINE_PGM_READ_ANY(type, reader) \ static inline type pgm_read_any(const type *p) \ { return pgm_read_##reader##_near(p); } DEFINE_PGM_READ_ANY(float, float); c050: 25 91 lpm r18, Z+ c052: 35 91 lpm r19, Z+ c054: 45 91 lpm r20, Z+ c056: 54 91 lpm r21, Z XYZ_CONSTS_FROM_CONFIG(float, max_length, MAX_LENGTH); XYZ_CONSTS_FROM_CONFIG(float, home_retract_mm, HOME_RETRACT_MM); XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); static void axis_is_at_home(uint8_t axis) { current_position[axis] = base_home_pos(axis) + cs.add_homing[axis]; c058: fe 01 movw r30, r28 c05a: e6 57 subi r30, 0x76 ; 118 c05c: fb 4f sbci r31, 0xFB ; 251 c05e: c0 80 ld r12, Z c060: d1 80 ldd r13, Z+1 ; 0x01 c062: e2 80 ldd r14, Z+2 ; 0x02 c064: f3 80 ldd r15, Z+3 ; 0x03 c066: 8e 01 movw r16, r28 c068: 0b 50 subi r16, 0x0B ; 11 c06a: 1e 4e sbci r17, 0xEE ; 238 c06c: c7 01 movw r24, r14 c06e: b6 01 movw r22, r12 c070: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> c074: f8 01 movw r30, r16 c076: 60 83 st Z, r22 c078: 71 83 std Z+1, r23 ; 0x01 c07a: 82 83 std Z+2, r24 ; 0x02 c07c: 93 83 std Z+3, r25 ; 0x03 static inline type array(uint8_t axis) \ { return pgm_read_any(&array##_P[axis]); } \ type array##_ext(uint8_t axis) \ { return pgm_read_any(&array##_P[axis]); } XYZ_CONSTS_FROM_CONFIG(float, base_min_pos, MIN_POS); c07e: fe 01 movw r30, r28 c080: e7 5a subi r30, 0xA7 ; 167 c082: f9 48 sbci r31, 0x89 ; 137 #define DEFINE_PGM_READ_ANY(type, reader) \ static inline type pgm_read_any(const type *p) \ { return pgm_read_##reader##_near(p); } DEFINE_PGM_READ_ANY(float, float); c084: 25 91 lpm r18, Z+ c086: 35 91 lpm r19, Z+ c088: 45 91 lpm r20, Z+ c08a: 54 91 lpm r21, Z XYZ_CONSTS_FROM_CONFIG(float, home_retract_mm, HOME_RETRACT_MM); XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); static void axis_is_at_home(uint8_t axis) { current_position[axis] = base_home_pos(axis) + cs.add_homing[axis]; min_pos[axis] = base_min_pos(axis) + cs.add_homing[axis]; c08c: 8e 01 movw r16, r28 c08e: 0c 5d subi r16, 0xDC ; 220 c090: 1d 4f sbci r17, 0xFD ; 253 c092: c7 01 movw r24, r14 c094: b6 01 movw r22, r12 c096: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> c09a: f8 01 movw r30, r16 c09c: 60 83 st Z, r22 c09e: 71 83 std Z+1, r23 ; 0x01 c0a0: 82 83 std Z+2, r24 ; 0x02 c0a2: 93 83 std Z+3, r25 ; 0x03 { return pgm_read_any(&array##_P[axis]); } \ type array##_ext(uint8_t axis) \ { return pgm_read_any(&array##_P[axis]); } XYZ_CONSTS_FROM_CONFIG(float, base_min_pos, MIN_POS); XYZ_CONSTS_FROM_CONFIG(float, base_max_pos, MAX_POS); c0a4: fe 01 movw r30, r28 c0a6: e3 5b subi r30, 0xB3 ; 179 c0a8: f9 48 sbci r31, 0x89 ; 137 #define DEFINE_PGM_READ_ANY(type, reader) \ static inline type pgm_read_any(const type *p) \ { return pgm_read_##reader##_near(p); } DEFINE_PGM_READ_ANY(float, float); c0aa: 25 91 lpm r18, Z+ c0ac: 35 91 lpm r19, Z+ c0ae: 45 91 lpm r20, Z+ c0b0: 54 91 lpm r21, Z XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); static void axis_is_at_home(uint8_t axis) { current_position[axis] = base_home_pos(axis) + cs.add_homing[axis]; min_pos[axis] = base_min_pos(axis) + cs.add_homing[axis]; max_pos[axis] = base_max_pos(axis) + cs.add_homing[axis]; c0b2: c8 5e subi r28, 0xE8 ; 232 c0b4: dd 4f sbci r29, 0xFD ; 253 c0b6: c7 01 movw r24, r14 c0b8: b6 01 movw r22, r12 c0ba: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> c0be: 68 83 st Y, r22 c0c0: 79 83 std Y+1, r23 ; 0x01 c0c2: 8a 83 std Y+2, r24 ; 0x02 c0c4: 9b 83 std Y+3, r25 ; 0x03 } c0c6: df 91 pop r29 c0c8: cf 91 pop r28 c0ca: 1f 91 pop r17 c0cc: 0f 91 pop r16 c0ce: ff 90 pop r15 c0d0: ef 90 pop r14 c0d2: df 90 pop r13 c0d4: cf 90 pop r12 c0d6: 08 95 ret 0000c0d8 : c0d8: 40 e0 ldi r20, 0x00 ; 0 c0da: 50 e0 ldi r21, 0x00 ; 0 c0dc: ba 01 movw r22, r20 c0de: 8d ee ldi r24, 0xED ; 237 c0e0: 9f e0 ldi r25, 0x0F ; 15 c0e2: 0f 94 12 a0 call 0x34024 ; 0x34024 c0e6: 40 e0 ldi r20, 0x00 ; 0 c0e8: 50 e0 ldi r21, 0x00 ; 0 c0ea: ba 01 movw r22, r20 c0ec: 81 ef ldi r24, 0xF1 ; 241 c0ee: 9f e0 ldi r25, 0x0F ; 15 c0f0: 0f 94 12 a0 call 0x34024 ; 0x34024 static void factory_reset_stats(){ eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, 0); eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, 0); failstats_reset_print(); c0f4: 0e 94 9e 55 call 0xab3c ; 0xab3c if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); c0f8: 70 e0 ldi r23, 0x00 ; 0 c0fa: 60 e0 ldi r22, 0x00 ; 0 c0fc: 85 e0 ldi r24, 0x05 ; 5 c0fe: 9f e0 ldi r25, 0x0F ; 15 c100: 0f 94 1e a0 call 0x3403c ; 0x3403c c104: 70 e0 ldi r23, 0x00 ; 0 c106: 60 e0 ldi r22, 0x00 ; 0 c108: 83 e0 ldi r24, 0x03 ; 3 c10a: 9f e0 ldi r25, 0x0F ; 15 c10c: 0f 94 1e a0 call 0x3403c ; 0x3403c c110: 70 e0 ldi r23, 0x00 ; 0 c112: 60 e0 ldi r22, 0x00 ; 0 c114: 81 e0 ldi r24, 0x01 ; 1 c116: 9f e0 ldi r25, 0x0F ; 15 c118: 0f 94 1e a0 call 0x3403c ; 0x3403c c11c: 70 e0 ldi r23, 0x00 ; 0 c11e: 60 e0 ldi r22, 0x00 ; 0 c120: 8f ef ldi r24, 0xFF ; 255 c122: 9e e0 ldi r25, 0x0E ; 14 c124: 0f 94 1e a0 call 0x3403c ; 0x3403c c128: 70 e0 ldi r23, 0x00 ; 0 c12a: 60 e0 ldi r22, 0x00 ; 0 c12c: 83 ed ldi r24, 0xD3 ; 211 c12e: 9e e0 ldi r25, 0x0E ; 14 c130: 0f 94 1e a0 call 0x3403c ; 0x3403c c134: 70 e0 ldi r23, 0x00 ; 0 c136: 60 e0 ldi r22, 0x00 ; 0 c138: 80 ed ldi r24, 0xD0 ; 208 c13a: 9e e0 ldi r25, 0x0E ; 14 c13c: 0f 94 1e a0 call 0x3403c ; 0x3403c if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); c140: 40 e0 ldi r20, 0x00 ; 0 c142: 50 e0 ldi r21, 0x00 ; 0 c144: ba 01 movw r22, r20 c146: 88 ea ldi r24, 0xA8 ; 168 c148: 9c e0 ldi r25, 0x0C ; 12 c14a: 0d 94 12 a0 jmp 0x34024 ; 0x34024 0000c14e : wdt_disable(); } } void softReset(void) { cli(); c14e: f8 94 cli : "n" (_SFR_MEM_ADDR(_WD_CONTROL_REG)), "r" ((uint8_t)(_BV(_WD_CHANGE_BIT) | _BV(WDE))), "r" ((uint8_t) ((value & 0x08 ? _WD_PS3_MASK : 0x00) | _BV(WDE) | (value & 0x07)) ) : "r0" ); c150: 88 e1 ldi r24, 0x18 ; 24 c152: 9f e0 ldi r25, 0x0F ; 15 c154: 0f b6 in r0, 0x3f ; 63 c156: f8 94 cli c158: a8 95 wdr c15a: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> c15e: 0f be out 0x3f, r0 ; 63 c160: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> c164: ff cf rjmp .-2 ; 0xc164 0000c166 : } #endif //End DEBUG_PRINTER_STATES // Block LCD menus when bool __attribute__((noinline)) printer_recovering() { return (eeprom_read_byte((uint8_t*)EEPROM_UVLO) != PowerPanic::NO_PENDING_RECOVERY); c166: 85 ea ldi r24, 0xA5 ; 165 c168: 9f e0 ldi r25, 0x0F ; 15 c16a: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 c16e: 91 e0 ldi r25, 0x01 ; 1 c170: 81 11 cpse r24, r1 c172: 01 c0 rjmp .+2 ; 0xc176 c174: 90 e0 ldi r25, 0x00 ; 0 } c176: 89 2f mov r24, r25 c178: 08 95 ret 0000c17a : bool __attribute__((noinline)) printJobOngoing() { return (IS_SD_PRINTING || usb_timer.running() || print_job_timer.isRunning()); } bool printingIsPaused() { return did_pause_print || print_job_timer.isPaused(); c17a: 80 91 9b 03 lds r24, 0x039B ; 0x80039b c17e: 81 11 cpse r24, r1 c180: 06 c0 rjmp .+12 ; 0xc18e c182: 81 e0 ldi r24, 0x01 ; 1 c184: 90 91 59 03 lds r25, 0x0359 ; 0x800359 c188: 92 30 cpi r25, 0x02 ; 2 c18a: 09 f0 breq .+2 ; 0xc18e c18c: 80 e0 ldi r24, 0x00 ; 0 } c18e: 08 95 ret 0000c190 : WRITE(SUICIDE_PIN, LOW); #endif } bool __attribute__((noinline)) printJobOngoing() { return (IS_SD_PRINTING || usb_timer.running() || print_job_timer.isRunning()); c190: 80 91 6a 13 lds r24, 0x136A ; 0x80136a c194: 81 11 cpse r24, r1 c196: 0a c0 rjmp .+20 ; 0xc1ac c198: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 c19c: 81 11 cpse r24, r1 c19e: 06 c0 rjmp .+12 ; 0xc1ac c1a0: 81 e0 ldi r24, 0x01 ; 1 c1a2: 90 91 59 03 lds r25, 0x0359 ; 0x800359 c1a6: 91 30 cpi r25, 0x01 ; 1 c1a8: 09 f0 breq .+2 ; 0xc1ac c1aa: 80 e0 ldi r24, 0x00 ; 0 } c1ac: 08 95 ret 0000c1ae : && !mesh_bed_leveling_flag && !homing_flag && e_active(); } bool __attribute__((noinline)) babystep_allowed() { c1ae: cf 93 push r28 c1b0: df 93 push r29 return ( !homing_flag c1b2: c0 91 05 12 lds r28, 0x1205 ; 0x801205 && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) c1b6: c1 11 cpse r28, r1 c1b8: 1f c0 rjmp .+62 ; 0xc1f8 && e_active(); } bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag c1ba: 80 91 06 12 lds r24, 0x1206 ; 0x801206 c1be: 81 11 cpse r24, r1 c1c0: 1c c0 rjmp .+56 ; 0xc1fa && !printingIsPaused() c1c2: 0e 94 bd 60 call 0xc17a ; 0xc17a c1c6: 81 11 cpse r24, r1 c1c8: 18 c0 rjmp .+48 ; 0xc1fa && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) c1ca: d0 91 c8 0d lds r29, 0x0DC8 ; 0x800dc8 c1ce: d4 30 cpi r29, 0x04 ; 4 c1d0: 61 f4 brne .+24 ; 0xc1ea c1d2: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 c1d6: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 c1da: 89 2b or r24, r25 c1dc: 91 f4 brne .+36 ; 0xc202 c1de: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed c1e2: 90 91 ee 11 lds r25, 0x11EE ; 0x8011ee c1e6: 89 2b or r24, r25 c1e8: 61 f4 brne .+24 ; 0xc202 || printJobOngoing() c1ea: 0e 94 c8 60 call 0xc190 ; 0xc190 c1ee: c8 2f mov r28, r24 c1f0: 81 11 cpse r24, r1 c1f2: 03 c0 rjmp .+6 ; 0xc1fa || lcd_commands_type == LcdCommands::Idle c1f4: c1 e0 ldi r28, 0x01 ; 1 c1f6: d1 11 cpse r29, r1 bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) c1f8: c0 e0 ldi r28, 0x00 ; 0 || printJobOngoing() || lcd_commands_type == LcdCommands::Idle ) ); } c1fa: 8c 2f mov r24, r28 c1fc: df 91 pop r29 c1fe: cf 91 pop r28 c200: 08 95 ret bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) c202: c1 e0 ldi r28, 0x01 ; 1 c204: fa cf rjmp .-12 ; 0xc1fa 0000c206 : ) ); } bool __attribute__((noinline)) babystep_allowed_strict() { return ( babystep_allowed() && current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU); c206: 0e 94 d7 60 call 0xc1ae ; 0xc1ae c20a: 88 23 and r24, r24 c20c: 89 f0 breq .+34 ; 0xc230 c20e: 20 e0 ldi r18, 0x00 ; 0 c210: 30 e0 ldi r19, 0x00 ; 0 c212: 40 e0 ldi r20, 0x00 ; 0 c214: 50 e4 ldi r21, 0x40 ; 64 c216: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd c21a: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe c21e: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff c222: 90 91 00 12 lds r25, 0x1200 ; 0x801200 c226: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> c22a: 88 1f adc r24, r24 c22c: 88 27 eor r24, r24 c22e: 88 1f adc r24, r24 } c230: 08 95 ret 0000c232 : bool printingIsPaused() { return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() c232: 0e 94 c8 60 call 0xc190 ; 0xc190 || printingIsPaused() || saved_printing || (lcd_commands_type != LcdCommands::Idle) || MMU2::mmu2.MMU_PRINT_SAVED() || homing_flag || mesh_bed_leveling_flag; c236: 81 11 cpse r24, r1 c238: 18 c0 rjmp .+48 ; 0xc26a return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() || printingIsPaused() c23a: 0e 94 bd 60 call 0xc17a ; 0xc17a c23e: 81 11 cpse r24, r1 c240: 14 c0 rjmp .+40 ; 0xc26a || saved_printing c242: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 c246: 81 11 cpse r24, r1 c248: 10 c0 rjmp .+32 ; 0xc26a || (lcd_commands_type != LcdCommands::Idle) c24a: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 c24e: 81 11 cpse r24, r1 c250: 0b c0 rjmp .+22 ; 0xc268 || MMU2::mmu2.MMU_PRINT_SAVED() c252: 80 91 95 12 lds r24, 0x1295 ; 0x801295 c256: 81 11 cpse r24, r1 c258: 07 c0 rjmp .+14 ; 0xc268 || homing_flag c25a: 80 91 05 12 lds r24, 0x1205 ; 0x801205 c25e: 81 11 cpse r24, r1 c260: 04 c0 rjmp .+8 ; 0xc26a || mesh_bed_leveling_flag; c262: 80 91 06 12 lds r24, 0x1206 ; 0x801206 c266: 08 95 ret c268: 81 e0 ldi r24, 0x01 ; 1 } c26a: 08 95 ret 0000c26c : inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); } c26c: 80 e1 ldi r24, 0x10 ; 16 c26e: e5 ef ldi r30, 0xF5 ; 245 c270: f1 e1 ldi r31, 0x11 ; 17 c272: a3 e9 ldi r26, 0x93 ; 147 c274: b6 e0 ldi r27, 0x06 ; 6 c276: 01 90 ld r0, Z+ c278: 0d 92 st X+, r0 c27a: 8a 95 dec r24 c27c: e1 f7 brne .-8 ; 0xc276 c27e: 08 95 ret 0000c280 : //! //! Internally lcd_update() is called by wait_for_heater(). //! //! @param e_move void restore_print_from_ram_and_continue(float e_move) { c280: 4f 92 push r4 c282: 5f 92 push r5 c284: 6f 92 push r6 c286: 7f 92 push r7 c288: 8f 92 push r8 c28a: 9f 92 push r9 c28c: af 92 push r10 c28e: bf 92 push r11 c290: cf 92 push r12 c292: df 92 push r13 c294: ef 92 push r14 c296: ff 92 push r15 c298: 0f 93 push r16 c29a: 1f 93 push r17 c29c: cf 93 push r28 c29e: df 93 push r29 c2a0: 00 d0 rcall .+0 ; 0xc2a2 c2a2: 00 d0 rcall .+0 ; 0xc2a4 c2a4: 1f 92 push r1 c2a6: 1f 92 push r1 c2a8: cd b7 in r28, 0x3d ; 61 c2aa: de b7 in r29, 0x3e ; 62 if (!saved_printing) return; c2ac: 20 91 e7 11 lds r18, 0x11E7 ; 0x8011e7 c2b0: 22 23 and r18, r18 c2b2: 09 f4 brne .+2 ; 0xc2b6 c2b4: 73 c1 rjmp .+742 ; 0xc59c #ifdef FANCHECK // Do not allow resume printing if fans are still not ok if (fan_check_error == EFCE_REPORTED) return; c2b6: 20 91 9c 03 lds r18, 0x039C ; 0x80039c c2ba: 22 30 cpi r18, 0x02 ; 2 c2bc: 09 f4 brne .+2 ; 0xc2c0 c2be: 6e c1 rjmp .+732 ; 0xc59c if (fan_check_error == EFCE_FIXED) fan_check_error = EFCE_OK; //reenable serial stream processing if printing from usb c2c0: 20 91 9c 03 lds r18, 0x039C ; 0x80039c c2c4: 21 30 cpi r18, 0x01 ; 1 c2c6: 11 f4 brne .+4 ; 0xc2cc c2c8: 10 92 9c 03 sts 0x039C, r1 ; 0x80039c c2cc: 2b 01 movw r4, r22 c2ce: 3c 01 movw r6, r24 #endif // Make sure fan is turned off fanSpeed = 0; c2d0: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 // restore bed temperature (bed can be disabled during a thermal warning) if ((uint8_t)degBed() != saved_bed_temperature) c2d4: 10 91 ec 11 lds r17, 0x11EC ; 0x8011ec c2d8: 60 91 8a 03 lds r22, 0x038A ; 0x80038a c2dc: 70 91 8b 03 lds r23, 0x038B ; 0x80038b c2e0: 80 91 8c 03 lds r24, 0x038C ; 0x80038c c2e4: 90 91 8d 03 lds r25, 0x038D ; 0x80038d c2e8: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> c2ec: 61 17 cp r22, r17 c2ee: 31 f0 breq .+12 ; 0xc2fc resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; c2f0: 81 2f mov r24, r17 c2f2: 90 e0 ldi r25, 0x00 ; 0 c2f4: 90 93 ee 11 sts 0x11EE, r25 ; 0x8011ee c2f8: 80 93 ed 11 sts 0x11ED, r24 ; 0x8011ed setTargetBed(saved_bed_temperature); restore_extruder_temperature_from_ram(); c2fc: 0e 94 ab 5e call 0xbd56 ; 0xbd56 // Restore saved fan speed fanSpeed = saved_fan_speed; c300: 80 91 e8 11 lds r24, 0x11E8 ; 0x8011e8 c304: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 axis_relative_modes ^= (-saved_extruder_relative_mode ^ axis_relative_modes) & E_AXIS_MASK; c308: 90 91 eb 11 lds r25, 0x11EB ; 0x8011eb c30c: 80 91 ea 11 lds r24, 0x11EA ; 0x8011ea c310: 81 95 neg r24 c312: 89 27 eor r24, r25 c314: 88 70 andi r24, 0x08 ; 8 c316: 89 27 eor r24, r25 c318: 80 93 eb 11 sts 0x11EB, r24 ; 0x8011eb float e = saved_pos[E_AXIS] - e_move; c31c: a3 01 movw r20, r6 c31e: 92 01 movw r18, r4 c320: 60 91 9c 02 lds r22, 0x029C ; 0x80029c c324: 70 91 9d 02 lds r23, 0x029D ; 0x80029d c328: 80 91 9e 02 lds r24, 0x029E ; 0x80029e c32c: 90 91 9f 02 lds r25, 0x029F ; 0x80029f c330: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> c334: 6d 83 std Y+5, r22 ; 0x05 c336: 7e 83 std Y+6, r23 ; 0x06 c338: 8f 83 std Y+7, r24 ; 0x07 c33a: 98 87 std Y+8, r25 ; 0x08 plan_set_e_position(e); c33c: ce 01 movw r24, r28 c33e: 05 96 adiw r24, 0x05 ; 5 c340: 0f 94 c8 74 call 0x2e990 ; 0x2e990 #ifdef FANCHECK fans_check_enabled = false; c344: 10 92 40 02 sts 0x0240, r1 ; 0x800240 #endif // do not restore XY for commands that do not require that if (saved_pos[X_AXIS] == X_COORD_INVALID) c348: 20 e0 ldi r18, 0x00 ; 0 c34a: 30 e0 ldi r19, 0x00 ; 0 c34c: 40 e8 ldi r20, 0x80 ; 128 c34e: 5f eb ldi r21, 0xBF ; 191 c350: 60 91 90 02 lds r22, 0x0290 ; 0x800290 c354: 70 91 91 02 lds r23, 0x0291 ; 0x800291 c358: 80 91 92 02 lds r24, 0x0292 ; 0x800292 c35c: 90 91 93 02 lds r25, 0x0293 ; 0x800293 c360: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> c364: 81 11 cpse r24, r1 c366: 20 c0 rjmp .+64 ; 0xc3a8 { saved_pos[X_AXIS] = current_position[X_AXIS]; c368: 80 91 f5 11 lds r24, 0x11F5 ; 0x8011f5 c36c: 90 91 f6 11 lds r25, 0x11F6 ; 0x8011f6 c370: a0 91 f7 11 lds r26, 0x11F7 ; 0x8011f7 c374: b0 91 f8 11 lds r27, 0x11F8 ; 0x8011f8 c378: 80 93 90 02 sts 0x0290, r24 ; 0x800290 c37c: 90 93 91 02 sts 0x0291, r25 ; 0x800291 c380: a0 93 92 02 sts 0x0292, r26 ; 0x800292 c384: b0 93 93 02 sts 0x0293, r27 ; 0x800293 saved_pos[Y_AXIS] = current_position[Y_AXIS]; c388: 80 91 f9 11 lds r24, 0x11F9 ; 0x8011f9 c38c: 90 91 fa 11 lds r25, 0x11FA ; 0x8011fa c390: a0 91 fb 11 lds r26, 0x11FB ; 0x8011fb c394: b0 91 fc 11 lds r27, 0x11FC ; 0x8011fc c398: 80 93 94 02 sts 0x0294, r24 ; 0x800294 c39c: 90 93 95 02 sts 0x0295, r25 ; 0x800295 c3a0: a0 93 96 02 sts 0x0296, r26 ; 0x800296 c3a4: b0 93 97 02 sts 0x0297, r27 ; 0x800297 } //first move print head in XY to the saved position: plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], current_position[Z_AXIS], saved_pos[E_AXIS] - e_move, homing_feedrate[Z_AXIS]/13); c3a8: a3 01 movw r20, r6 c3aa: 92 01 movw r18, r4 c3ac: 60 91 9c 02 lds r22, 0x029C ; 0x80029c c3b0: 70 91 9d 02 lds r23, 0x029D ; 0x80029d c3b4: 80 91 9e 02 lds r24, 0x029E ; 0x80029e c3b8: 90 91 9f 02 lds r25, 0x029F ; 0x80029f c3bc: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> c3c0: 69 83 std Y+1, r22 ; 0x01 c3c2: 7a 83 std Y+2, r23 ; 0x02 c3c4: 8b 83 std Y+3, r24 ; 0x03 c3c6: 9c 83 std Y+4, r25 ; 0x04 c3c8: e0 90 fd 11 lds r14, 0x11FD ; 0x8011fd c3cc: f0 90 fe 11 lds r15, 0x11FE ; 0x8011fe c3d0: 00 91 ff 11 lds r16, 0x11FF ; 0x8011ff c3d4: 10 91 00 12 lds r17, 0x1200 ; 0x801200 c3d8: 20 91 94 02 lds r18, 0x0294 ; 0x800294 c3dc: 30 91 95 02 lds r19, 0x0295 ; 0x800295 c3e0: 40 91 96 02 lds r20, 0x0296 ; 0x800296 c3e4: 50 91 97 02 lds r21, 0x0297 ; 0x800297 c3e8: 60 91 90 02 lds r22, 0x0290 ; 0x800290 c3ec: 70 91 91 02 lds r23, 0x0291 ; 0x800291 c3f0: 80 91 92 02 lds r24, 0x0292 ; 0x800292 c3f4: 90 91 93 02 lds r25, 0x0293 ; 0x800293 c3f8: 1f 92 push r1 c3fa: 1f 92 push r1 c3fc: 1f 92 push r1 c3fe: 1f 92 push r1 c400: e2 e6 ldi r30, 0x62 ; 98 c402: 8e 2e mov r8, r30 c404: e7 e2 ldi r30, 0x27 ; 39 c406: 9e 2e mov r9, r30 c408: e6 e7 ldi r30, 0x76 ; 118 c40a: ae 2e mov r10, r30 c40c: e2 e4 ldi r30, 0x42 ; 66 c40e: be 2e mov r11, r30 c410: fe 01 movw r30, r28 c412: 31 96 adiw r30, 0x01 ; 1 c414: 6f 01 movw r12, r30 c416: 0f 94 22 75 call 0x2ea44 ; 0x2ea44 //then move Z plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], saved_pos[E_AXIS] - e_move, homing_feedrate[Z_AXIS]/13); c41a: a3 01 movw r20, r6 c41c: 92 01 movw r18, r4 c41e: 60 91 9c 02 lds r22, 0x029C ; 0x80029c c422: 70 91 9d 02 lds r23, 0x029D ; 0x80029d c426: 80 91 9e 02 lds r24, 0x029E ; 0x80029e c42a: 90 91 9f 02 lds r25, 0x029F ; 0x80029f c42e: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> c432: 69 83 std Y+1, r22 ; 0x01 c434: 7a 83 std Y+2, r23 ; 0x02 c436: 8b 83 std Y+3, r24 ; 0x03 c438: 9c 83 std Y+4, r25 ; 0x04 c43a: e0 90 98 02 lds r14, 0x0298 ; 0x800298 c43e: f0 90 99 02 lds r15, 0x0299 ; 0x800299 c442: 00 91 9a 02 lds r16, 0x029A ; 0x80029a c446: 10 91 9b 02 lds r17, 0x029B ; 0x80029b c44a: 20 91 94 02 lds r18, 0x0294 ; 0x800294 c44e: 30 91 95 02 lds r19, 0x0295 ; 0x800295 c452: 40 91 96 02 lds r20, 0x0296 ; 0x800296 c456: 50 91 97 02 lds r21, 0x0297 ; 0x800297 c45a: 60 91 90 02 lds r22, 0x0290 ; 0x800290 c45e: 70 91 91 02 lds r23, 0x0291 ; 0x800291 c462: 80 91 92 02 lds r24, 0x0292 ; 0x800292 c466: 90 91 93 02 lds r25, 0x0293 ; 0x800293 c46a: 1f 92 push r1 c46c: 1f 92 push r1 c46e: 1f 92 push r1 c470: 1f 92 push r1 c472: 0f 94 22 75 call 0x2ea44 ; 0x2ea44 //and finaly unretract (35mm/s) plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], saved_pos[E_AXIS], FILAMENTCHANGE_RFEED); c476: e0 90 98 02 lds r14, 0x0298 ; 0x800298 c47a: f0 90 99 02 lds r15, 0x0299 ; 0x800299 c47e: 00 91 9a 02 lds r16, 0x029A ; 0x80029a c482: 10 91 9b 02 lds r17, 0x029B ; 0x80029b c486: 20 91 94 02 lds r18, 0x0294 ; 0x800294 c48a: 30 91 95 02 lds r19, 0x0295 ; 0x800295 c48e: 40 91 96 02 lds r20, 0x0296 ; 0x800296 c492: 50 91 97 02 lds r21, 0x0297 ; 0x800297 c496: 60 91 90 02 lds r22, 0x0290 ; 0x800290 c49a: 70 91 91 02 lds r23, 0x0291 ; 0x800291 c49e: 80 91 92 02 lds r24, 0x0292 ; 0x800292 c4a2: 90 91 93 02 lds r25, 0x0293 ; 0x800293 c4a6: 1f 92 push r1 c4a8: 1f 92 push r1 c4aa: 1f 92 push r1 c4ac: 1f 92 push r1 c4ae: 81 2c mov r8, r1 c4b0: 91 2c mov r9, r1 c4b2: f8 ee ldi r31, 0xE8 ; 232 c4b4: af 2e mov r10, r31 c4b6: f2 e4 ldi r31, 0x42 ; 66 c4b8: bf 2e mov r11, r31 c4ba: ac e9 ldi r26, 0x9C ; 156 c4bc: ca 2e mov r12, r26 c4be: a2 e0 ldi r26, 0x02 ; 2 c4c0: da 2e mov r13, r26 c4c2: 0f 94 22 75 call 0x2ea44 ; 0x2ea44 st_synchronize(); c4c6: 0f 94 42 22 call 0x24484 ; 0x24484 #ifdef FANCHECK fans_check_enabled = true; c4ca: 11 e0 ldi r17, 0x01 ; 1 c4cc: 10 93 40 02 sts 0x0240, r17 ; 0x800240 #endif // restore original feedrate/feedmultiply _after_ restoring the extruder position feedrate = saved_feedrate2; c4d0: 60 91 e2 11 lds r22, 0x11E2 ; 0x8011e2 c4d4: 70 91 e3 11 lds r23, 0x11E3 ; 0x8011e3 c4d8: 90 e0 ldi r25, 0x00 ; 0 c4da: 80 e0 ldi r24, 0x00 ; 0 c4dc: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> c4e0: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a c4e4: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b c4e8: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c c4ec: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d feedmultiply = saved_feedmultiply2; c4f0: 80 91 f3 11 lds r24, 0x11F3 ; 0x8011f3 <_ZL19saved_feedmultiply2.lto_priv.502> c4f4: 90 91 f4 11 lds r25, 0x11F4 ; 0x8011f4 <_ZL19saved_feedmultiply2.lto_priv.502+0x1> c4f8: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f c4fc: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e memcpy(current_position, saved_pos, sizeof(saved_pos)); c500: 80 e1 ldi r24, 0x10 ; 16 c502: e0 e9 ldi r30, 0x90 ; 144 c504: f2 e0 ldi r31, 0x02 ; 2 c506: a5 ef ldi r26, 0xF5 ; 245 c508: b1 e1 ldi r27, 0x11 ; 17 c50a: 01 90 ld r0, Z+ c50c: 0d 92 st X+, r0 c50e: 8a 95 dec r24 c510: e1 f7 brne .-8 ; 0xc50a set_destination_to_current(); c512: 0e 94 36 61 call 0xc26c ; 0xc26c //not sd printing nor usb printing } } void restore_print_file_state() { if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { //was sd printing c516: 80 91 79 02 lds r24, 0x0279 ; 0x800279 c51a: 0f b6 in r0, 0x3f ; 63 c51c: f8 94 cli c51e: de bf out 0x3e, r29 ; 62 c520: 0f be out 0x3f, r0 ; 63 c522: cd bf out 0x3d, r28 ; 61 c524: 81 11 cpse r24, r1 c526: 51 c0 rjmp .+162 ; 0xc5ca card.setIndex(saved_sdpos); c528: 60 91 d8 11 lds r22, 0x11D8 ; 0x8011d8 c52c: 70 91 d9 11 lds r23, 0x11D9 ; 0x8011d9 c530: 80 91 da 11 lds r24, 0x11DA ; 0x8011da c534: 90 91 db 11 lds r25, 0x11DB ; 0x8011db { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; c538: 60 93 7e 16 sts 0x167E, r22 ; 0x80167e c53c: 70 93 7f 16 sts 0x167F, r23 ; 0x80167f c540: 80 93 80 16 sts 0x1680, r24 ; 0x801680 c544: 90 93 81 16 sts 0x1681, r25 ; 0x801681 c548: 0f 94 f6 43 call 0x287ec ; 0x287ec sdpos_atomic = saved_sdpos; c54c: 80 91 d8 11 lds r24, 0x11D8 ; 0x8011d8 c550: 90 91 d9 11 lds r25, 0x11D9 ; 0x8011d9 c554: a0 91 da 11 lds r26, 0x11DA ; 0x8011da c558: b0 91 db 11 lds r27, 0x11DB ; 0x8011db c55c: 80 93 dc 11 sts 0x11DC, r24 ; 0x8011dc c560: 90 93 dd 11 sts 0x11DD, r25 ; 0x8011dd c564: a0 93 de 11 sts 0x11DE, r26 ; 0x8011de c568: b0 93 df 11 sts 0x11DF, r27 ; 0x8011df card.sdprinting = true; c56c: 10 93 6a 13 sts 0x136A, r17 ; 0x80136a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); c570: 60 e0 ldi r22, 0x00 ; 0 c572: 85 ea ldi r24, 0xA5 ; 165 c574: 9f e0 ldi r25, 0x0F ; 15 c576: 0f 94 00 a0 call 0x34000 ; 0x34000 c57a: 60 e0 ldi r22, 0x00 ; 0 c57c: 8f e7 ldi r24, 0x7F ; 127 c57e: 9c e0 ldi r25, 0x0C ; 12 c580: 0f 94 00 a0 call 0x34000 ; 0x34000 set_destination_to_current(); restore_print_file_state(); eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO, PowerPanic::NO_PENDING_RECOVERY); eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO_Z_LIFTED, 0); lcd_setstatuspgm(MSG_WELCOME); c584: 87 e6 ldi r24, 0x67 ; 103 c586: 9b e6 ldi r25, 0x6B ; 107 c588: 0e 94 65 e6 call 0x1ccca ; 0x1ccca saved_printing_type = PowerPanic::PRINT_TYPE_NONE; c58c: 82 e0 ldi r24, 0x02 ; 2 c58e: 80 93 79 02 sts 0x0279, r24 ; 0x800279 saved_printing = false; c592: 10 92 e7 11 sts 0x11E7, r1 ; 0x8011e7 planner_aborted = true; // unroll the stack c596: 81 e0 ldi r24, 0x01 ; 1 c598: 80 93 ac 0d sts 0x0DAC, r24 ; 0x800dac } c59c: 28 96 adiw r28, 0x08 ; 8 c59e: 0f b6 in r0, 0x3f ; 63 c5a0: f8 94 cli c5a2: de bf out 0x3e, r29 ; 62 c5a4: 0f be out 0x3f, r0 ; 63 c5a6: cd bf out 0x3d, r28 ; 61 c5a8: df 91 pop r29 c5aa: cf 91 pop r28 c5ac: 1f 91 pop r17 c5ae: 0f 91 pop r16 c5b0: ff 90 pop r15 c5b2: ef 90 pop r14 c5b4: df 90 pop r13 c5b6: cf 90 pop r12 c5b8: bf 90 pop r11 c5ba: af 90 pop r10 c5bc: 9f 90 pop r9 c5be: 8f 90 pop r8 c5c0: 7f 90 pop r7 c5c2: 6f 90 pop r6 c5c4: 5f 90 pop r5 c5c6: 4f 90 pop r4 c5c8: 08 95 ret void restore_print_file_state() { if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { //was sd printing card.setIndex(saved_sdpos); sdpos_atomic = saved_sdpos; card.sdprinting = true; } else if (saved_printing_type == PowerPanic::PRINT_TYPE_HOST) { //was usb printing c5ca: 81 30 cpi r24, 0x01 ; 1 c5cc: 89 f6 brne .-94 ; 0xc570 gcode_LastN = saved_sdpos; //saved_sdpos was reused for storing line number when usb printing c5ce: 80 91 d8 11 lds r24, 0x11D8 ; 0x8011d8 c5d2: 90 91 d9 11 lds r25, 0x11D9 ; 0x8011d9 c5d6: a0 91 da 11 lds r26, 0x11DA ; 0x8011da c5da: b0 91 db 11 lds r27, 0x11DB ; 0x8011db c5de: 80 93 d1 11 sts 0x11D1, r24 ; 0x8011d1 c5e2: 90 93 d2 11 sts 0x11D2, r25 ; 0x8011d2 c5e6: a0 93 d3 11 sts 0x11D3, r26 ; 0x8011d3 c5ea: b0 93 d4 11 sts 0x11D4, r27 ; 0x8011d4 serial_count = 0; c5ee: 10 92 db 0f sts 0x0FDB, r1 ; 0x800fdb c5f2: 10 92 da 0f sts 0x0FDA, r1 ; 0x800fda FlushSerialRequestResend(); c5f6: 0e 94 e2 54 call 0xa9c4 ; 0xa9c4 c5fa: ba cf rjmp .-140 ; 0xc570 0000c5fc : extern void world2machine_initialize(); extern void world2machine_read_valid(float vec_x[2], float vec_y[2], float cntr[2]); extern void world2machine_update_current(); inline void world2machine(float &x, float &y) { c5fc: 3f 92 push r3 c5fe: 4f 92 push r4 c600: 5f 92 push r5 c602: 6f 92 push r6 c604: 7f 92 push r7 c606: 8f 92 push r8 c608: 9f 92 push r9 c60a: af 92 push r10 c60c: bf 92 push r11 c60e: cf 92 push r12 c610: df 92 push r13 c612: ef 92 push r14 c614: ff 92 push r15 c616: 0f 93 push r16 c618: 1f 93 push r17 c61a: cf 93 push r28 c61c: df 93 push r29 if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { c61e: 30 90 dc 16 lds r3, 0x16DC ; 0x8016dc c622: 33 20 and r3, r3 c624: 09 f4 brne .+2 ; 0xc628 c626: 80 c0 rjmp .+256 ; 0xc728 c628: 8b 01 movw r16, r22 c62a: ec 01 movw r28, r24 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { c62c: 31 fe sbrs r3, 1 c62e: 54 c0 rjmp .+168 ; 0xc6d8 // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew[0][0] * x + world2machine_rotation_and_skew[0][1] * y; c630: 88 80 ld r8, Y c632: 99 80 ldd r9, Y+1 ; 0x01 c634: aa 80 ldd r10, Y+2 ; 0x02 c636: bb 80 ldd r11, Y+3 ; 0x03 c638: fb 01 movw r30, r22 c63a: c0 80 ld r12, Z c63c: d1 80 ldd r13, Z+1 ; 0x01 c63e: e2 80 ldd r14, Z+2 ; 0x02 c640: f3 80 ldd r15, Z+3 ; 0x03 float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; c642: 20 91 b1 16 lds r18, 0x16B1 ; 0x8016b1 c646: 30 91 b2 16 lds r19, 0x16B2 ; 0x8016b2 c64a: 40 91 b3 16 lds r20, 0x16B3 ; 0x8016b3 c64e: 50 91 b4 16 lds r21, 0x16B4 ; 0x8016b4 c652: c5 01 movw r24, r10 c654: b4 01 movw r22, r8 c656: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> c65a: 2b 01 movw r4, r22 c65c: 3c 01 movw r6, r24 c65e: 20 91 b5 16 lds r18, 0x16B5 ; 0x8016b5 c662: 30 91 b6 16 lds r19, 0x16B6 ; 0x8016b6 c666: 40 91 b7 16 lds r20, 0x16B7 ; 0x8016b7 c66a: 50 91 b8 16 lds r21, 0x16B8 ; 0x8016b8 c66e: c7 01 movw r24, r14 c670: b6 01 movw r22, r12 c672: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> c676: 9b 01 movw r18, r22 c678: ac 01 movw r20, r24 c67a: c3 01 movw r24, r6 c67c: b2 01 movw r22, r4 c67e: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> c682: 2b 01 movw r4, r22 c684: 3c 01 movw r6, r24 if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew[0][0] * x + world2machine_rotation_and_skew[0][1] * y; c686: 20 91 a9 16 lds r18, 0x16A9 ; 0x8016a9 c68a: 30 91 aa 16 lds r19, 0x16AA ; 0x8016aa c68e: 40 91 ab 16 lds r20, 0x16AB ; 0x8016ab c692: 50 91 ac 16 lds r21, 0x16AC ; 0x8016ac c696: c5 01 movw r24, r10 c698: b4 01 movw r22, r8 c69a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> c69e: 4b 01 movw r8, r22 c6a0: 5c 01 movw r10, r24 c6a2: 20 91 ad 16 lds r18, 0x16AD ; 0x8016ad c6a6: 30 91 ae 16 lds r19, 0x16AE ; 0x8016ae c6aa: 40 91 af 16 lds r20, 0x16AF ; 0x8016af c6ae: 50 91 b0 16 lds r21, 0x16B0 ; 0x8016b0 c6b2: c7 01 movw r24, r14 c6b4: b6 01 movw r22, r12 c6b6: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> c6ba: 9b 01 movw r18, r22 c6bc: ac 01 movw r20, r24 c6be: c5 01 movw r24, r10 c6c0: b4 01 movw r22, r8 c6c2: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; x = out_x; c6c6: 68 83 st Y, r22 c6c8: 79 83 std Y+1, r23 ; 0x01 c6ca: 8a 83 std Y+2, r24 ; 0x02 c6cc: 9b 83 std Y+3, r25 ; 0x03 y = out_y; c6ce: f8 01 movw r30, r16 c6d0: 40 82 st Z, r4 c6d2: 51 82 std Z+1, r5 ; 0x01 c6d4: 62 82 std Z+2, r6 ; 0x02 c6d6: 73 82 std Z+3, r7 ; 0x03 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { c6d8: 30 fe sbrs r3, 0 c6da: 26 c0 rjmp .+76 ; 0xc728 // Then add the offset. x += world2machine_shift[0]; c6dc: 20 91 d4 16 lds r18, 0x16D4 ; 0x8016d4 c6e0: 30 91 d5 16 lds r19, 0x16D5 ; 0x8016d5 c6e4: 40 91 d6 16 lds r20, 0x16D6 ; 0x8016d6 c6e8: 50 91 d7 16 lds r21, 0x16D7 ; 0x8016d7 c6ec: 68 81 ld r22, Y c6ee: 79 81 ldd r23, Y+1 ; 0x01 c6f0: 8a 81 ldd r24, Y+2 ; 0x02 c6f2: 9b 81 ldd r25, Y+3 ; 0x03 c6f4: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> c6f8: 68 83 st Y, r22 c6fa: 79 83 std Y+1, r23 ; 0x01 c6fc: 8a 83 std Y+2, r24 ; 0x02 c6fe: 9b 83 std Y+3, r25 ; 0x03 y += world2machine_shift[1]; c700: 20 91 d8 16 lds r18, 0x16D8 ; 0x8016d8 c704: 30 91 d9 16 lds r19, 0x16D9 ; 0x8016d9 c708: 40 91 da 16 lds r20, 0x16DA ; 0x8016da c70c: 50 91 db 16 lds r21, 0x16DB ; 0x8016db c710: f8 01 movw r30, r16 c712: 60 81 ld r22, Z c714: 71 81 ldd r23, Z+1 ; 0x01 c716: 82 81 ldd r24, Z+2 ; 0x02 c718: 93 81 ldd r25, Z+3 ; 0x03 c71a: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> c71e: f8 01 movw r30, r16 c720: 60 83 st Z, r22 c722: 71 83 std Z+1, r23 ; 0x01 c724: 82 83 std Z+2, r24 ; 0x02 c726: 93 83 std Z+3, r25 ; 0x03 } } } c728: df 91 pop r29 c72a: cf 91 pop r28 c72c: 1f 91 pop r17 c72e: 0f 91 pop r16 c730: ff 90 pop r15 c732: ef 90 pop r14 c734: df 90 pop r13 c736: cf 90 pop r12 c738: bf 90 pop r11 c73a: af 90 pop r10 c73c: 9f 90 pop r9 c73e: 8f 90 pop r8 c740: 7f 90 pop r7 c742: 6f 90 pop r6 c744: 5f 90 pop r5 c746: 4f 90 pop r4 c748: 3f 90 pop r3 c74a: 08 95 ret 0000c74c : } } } inline bool world2machine_clamp(float &x, float &y) { c74c: 2f 92 push r2 c74e: 3f 92 push r3 c750: 4f 92 push r4 c752: 5f 92 push r5 c754: 6f 92 push r6 c756: 7f 92 push r7 c758: 8f 92 push r8 c75a: 9f 92 push r9 c75c: af 92 push r10 c75e: bf 92 push r11 c760: cf 92 push r12 c762: df 92 push r13 c764: ef 92 push r14 c766: ff 92 push r15 c768: 0f 93 push r16 c76a: 1f 93 push r17 c76c: cf 93 push r28 c76e: df 93 push r29 c770: 00 d0 rcall .+0 ; 0xc772 c772: 00 d0 rcall .+0 ; 0xc774 c774: 1f 92 push r1 c776: 1f 92 push r1 c778: cd b7 in r28, 0x3d ; 61 c77a: de b7 in r29, 0x3e ; 62 c77c: 8c 01 movw r16, r24 c77e: 1b 01 movw r2, r22 } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; c780: fc 01 movw r30, r24 c782: 80 81 ld r24, Z c784: 91 81 ldd r25, Z+1 ; 0x01 c786: a2 81 ldd r26, Z+2 ; 0x02 c788: b3 81 ldd r27, Z+3 ; 0x03 c78a: 89 83 std Y+1, r24 ; 0x01 c78c: 9a 83 std Y+2, r25 ; 0x02 c78e: ab 83 std Y+3, r26 ; 0x03 c790: bc 83 std Y+4, r27 ; 0x04 out_y = y; c792: fb 01 movw r30, r22 c794: 80 81 ld r24, Z c796: 91 81 ldd r25, Z+1 ; 0x01 c798: a2 81 ldd r26, Z+2 ; 0x02 c79a: b3 81 ldd r27, Z+3 ; 0x03 c79c: 8d 83 std Y+5, r24 ; 0x05 c79e: 9e 83 std Y+6, r25 ; 0x06 c7a0: af 83 std Y+7, r26 ; 0x07 c7a2: b8 87 std Y+8, r27 ; 0x08 world2machine(out_x, out_y); c7a4: be 01 movw r22, r28 c7a6: 6b 5f subi r22, 0xFB ; 251 c7a8: 7f 4f sbci r23, 0xFF ; 255 c7aa: ce 01 movw r24, r28 c7ac: 01 96 adiw r24, 0x01 ; 1 c7ae: 0e 94 fe 62 call 0xc5fc ; 0xc5fc inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; float tmpx, tmpy; world2machine(x, y, tmpx, tmpy); if (tmpx < X_MIN_POS) { c7b2: c9 80 ldd r12, Y+1 ; 0x01 c7b4: da 80 ldd r13, Y+2 ; 0x02 c7b6: eb 80 ldd r14, Y+3 ; 0x03 c7b8: fc 80 ldd r15, Y+4 ; 0x04 c7ba: 20 e0 ldi r18, 0x00 ; 0 c7bc: 30 e0 ldi r19, 0x00 ; 0 c7be: a9 01 movw r20, r18 c7c0: c7 01 movw r24, r14 c7c2: b6 01 movw r22, r12 c7c4: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> c7c8: 87 ff sbrs r24, 7 c7ca: 35 c0 rjmp .+106 ; 0xc836 tmpx = X_MIN_POS; c7cc: 19 82 std Y+1, r1 ; 0x01 c7ce: 1a 82 std Y+2, r1 ; 0x02 c7d0: 1b 82 std Y+3, r1 ; 0x03 c7d2: 1c 82 std Y+4, r1 ; 0x04 clamped = true; } else if (tmpx > X_MAX_POS) { tmpx = X_MAX_POS; clamped = true; c7d4: ff 24 eor r15, r15 c7d6: f3 94 inc r15 } if (tmpy < Y_MIN_POS) { c7d8: 8d 80 ldd r8, Y+5 ; 0x05 c7da: 9e 80 ldd r9, Y+6 ; 0x06 c7dc: af 80 ldd r10, Y+7 ; 0x07 c7de: b8 84 ldd r11, Y+8 ; 0x08 c7e0: 20 e0 ldi r18, 0x00 ; 0 c7e2: 30 e0 ldi r19, 0x00 ; 0 c7e4: 40 e8 ldi r20, 0x80 ; 128 c7e6: 50 ec ldi r21, 0xC0 ; 192 c7e8: c5 01 movw r24, r10 c7ea: b4 01 movw r22, r8 c7ec: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> c7f0: 87 ff sbrs r24, 7 c7f2: 35 c0 rjmp .+106 ; 0xc85e tmpy = Y_MIN_POS; c7f4: 80 e0 ldi r24, 0x00 ; 0 c7f6: 90 e0 ldi r25, 0x00 ; 0 c7f8: a0 e8 ldi r26, 0x80 ; 128 c7fa: b0 ec ldi r27, 0xC0 ; 192 clamped = true; } else if (tmpy > Y_MAX_POS) { tmpy = Y_MAX_POS; c7fc: 8d 83 std Y+5, r24 ; 0x05 c7fe: 9e 83 std Y+6, r25 ; 0x06 c800: af 83 std Y+7, r26 ; 0x07 c802: b8 87 std Y+8, r27 ; 0x08 clamped = true; } if (clamped) machine2world(tmpx, tmpy, x, y); c804: cd 80 ldd r12, Y+5 ; 0x05 c806: de 80 ldd r13, Y+6 ; 0x06 c808: ef 80 ldd r14, Y+7 ; 0x07 c80a: f8 84 ldd r15, Y+8 ; 0x08 c80c: 89 80 ldd r8, Y+1 ; 0x01 c80e: 9a 80 ldd r9, Y+2 ; 0x02 c810: ab 80 ldd r10, Y+3 ; 0x03 c812: bc 80 ldd r11, Y+4 ; 0x04 world2machine(out_x, out_y); } inline void machine2world(float x, float y, float &out_x, float &out_y) { if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { c814: 70 90 dc 16 lds r7, 0x16DC ; 0x8016dc c818: 71 10 cpse r7, r1 c81a: 4c c0 rjmp .+152 ; 0xc8b4 // No correction. out_x = x; c81c: f8 01 movw r30, r16 c81e: 80 82 st Z, r8 c820: 91 82 std Z+1, r9 ; 0x01 c822: a2 82 std Z+2, r10 ; 0x02 c824: b3 82 std Z+3, r11 ; 0x03 out_y = y; c826: f1 01 movw r30, r2 c828: c0 82 st Z, r12 c82a: d1 82 std Z+1, r13 ; 0x01 c82c: e2 82 std Z+2, r14 ; 0x02 c82e: f3 82 std Z+3, r15 ; 0x03 if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { // Then add the offset. x -= world2machine_shift[0]; y -= world2machine_shift[1]; } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { c830: ff 24 eor r15, r15 c832: f3 94 inc r15 c834: 25 c0 rjmp .+74 ; 0xc880 float tmpx, tmpy; world2machine(x, y, tmpx, tmpy); if (tmpx < X_MIN_POS) { tmpx = X_MIN_POS; clamped = true; } else if (tmpx > X_MAX_POS) { c836: 20 e0 ldi r18, 0x00 ; 0 c838: 30 e0 ldi r19, 0x00 ; 0 c83a: 4a e7 ldi r20, 0x7A ; 122 c83c: 53 e4 ldi r21, 0x43 ; 67 c83e: c7 01 movw r24, r14 c840: b6 01 movw r22, r12 c842: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> } } inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; c846: f1 2c mov r15, r1 float tmpx, tmpy; world2machine(x, y, tmpx, tmpy); if (tmpx < X_MIN_POS) { tmpx = X_MIN_POS; clamped = true; } else if (tmpx > X_MAX_POS) { c848: 18 16 cp r1, r24 c84a: 34 f6 brge .-116 ; 0xc7d8 tmpx = X_MAX_POS; c84c: 80 e0 ldi r24, 0x00 ; 0 c84e: 90 e0 ldi r25, 0x00 ; 0 c850: aa e7 ldi r26, 0x7A ; 122 c852: b3 e4 ldi r27, 0x43 ; 67 c854: 89 83 std Y+1, r24 ; 0x01 c856: 9a 83 std Y+2, r25 ; 0x02 c858: ab 83 std Y+3, r26 ; 0x03 c85a: bc 83 std Y+4, r27 ; 0x04 c85c: bb cf rjmp .-138 ; 0xc7d4 } if (tmpy < Y_MIN_POS) { tmpy = Y_MIN_POS; clamped = true; } else if (tmpy > Y_MAX_POS) { c85e: 20 e0 ldi r18, 0x00 ; 0 c860: 30 e0 ldi r19, 0x00 ; 0 c862: 42 e5 ldi r20, 0x52 ; 82 c864: 53 e4 ldi r21, 0x43 ; 67 c866: c5 01 movw r24, r10 c868: b4 01 movw r22, r8 c86a: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> c86e: 18 16 cp r1, r24 c870: 2c f4 brge .+10 ; 0xc87c tmpy = Y_MAX_POS; c872: 80 e0 ldi r24, 0x00 ; 0 c874: 90 e0 ldi r25, 0x00 ; 0 c876: a2 e5 ldi r26, 0x52 ; 82 c878: b3 e4 ldi r27, 0x43 ; 67 c87a: c0 cf rjmp .-128 ; 0xc7fc clamped = true; } if (clamped) c87c: f1 10 cpse r15, r1 c87e: c2 cf rjmp .-124 ; 0xc804 machine2world(tmpx, tmpy, x, y); return clamped; } c880: 8f 2d mov r24, r15 c882: 28 96 adiw r28, 0x08 ; 8 c884: 0f b6 in r0, 0x3f ; 63 c886: f8 94 cli c888: de bf out 0x3e, r29 ; 62 c88a: 0f be out 0x3f, r0 ; 63 c88c: cd bf out 0x3d, r28 ; 61 c88e: df 91 pop r29 c890: cf 91 pop r28 c892: 1f 91 pop r17 c894: 0f 91 pop r16 c896: ff 90 pop r15 c898: ef 90 pop r14 c89a: df 90 pop r13 c89c: cf 90 pop r12 c89e: bf 90 pop r11 c8a0: af 90 pop r10 c8a2: 9f 90 pop r9 c8a4: 8f 90 pop r8 c8a6: 7f 90 pop r7 c8a8: 6f 90 pop r6 c8aa: 5f 90 pop r5 c8ac: 4f 90 pop r4 c8ae: 3f 90 pop r3 c8b0: 2f 90 pop r2 c8b2: 08 95 ret if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { // No correction. out_x = x; out_y = y; } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { c8b4: 70 fe sbrs r7, 0 c8b6: 1c c0 rjmp .+56 ; 0xc8f0 // Then add the offset. x -= world2machine_shift[0]; c8b8: 20 91 d4 16 lds r18, 0x16D4 ; 0x8016d4 c8bc: 30 91 d5 16 lds r19, 0x16D5 ; 0x8016d5 c8c0: 40 91 d6 16 lds r20, 0x16D6 ; 0x8016d6 c8c4: 50 91 d7 16 lds r21, 0x16D7 ; 0x8016d7 c8c8: c5 01 movw r24, r10 c8ca: b4 01 movw r22, r8 c8cc: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> c8d0: 4b 01 movw r8, r22 c8d2: 5c 01 movw r10, r24 y -= world2machine_shift[1]; c8d4: 20 91 d8 16 lds r18, 0x16D8 ; 0x8016d8 c8d8: 30 91 d9 16 lds r19, 0x16D9 ; 0x8016d9 c8dc: 40 91 da 16 lds r20, 0x16DA ; 0x8016da c8e0: 50 91 db 16 lds r21, 0x16DB ; 0x8016db c8e4: c7 01 movw r24, r14 c8e6: b6 01 movw r22, r12 c8e8: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> c8ec: 6b 01 movw r12, r22 c8ee: 7c 01 movw r14, r24 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { c8f0: 71 fe sbrs r7, 1 c8f2: 9e cf rjmp .-196 ; 0xc830 // Firs the skew & rotation correction. out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; c8f4: 20 91 c4 16 lds r18, 0x16C4 ; 0x8016c4 c8f8: 30 91 c5 16 lds r19, 0x16C5 ; 0x8016c5 c8fc: 40 91 c6 16 lds r20, 0x16C6 ; 0x8016c6 c900: 50 91 c7 16 lds r21, 0x16C7 ; 0x8016c7 c904: c5 01 movw r24, r10 c906: b4 01 movw r22, r8 c908: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> c90c: 2b 01 movw r4, r22 c90e: 3c 01 movw r6, r24 c910: 20 91 c8 16 lds r18, 0x16C8 ; 0x8016c8 c914: 30 91 c9 16 lds r19, 0x16C9 ; 0x8016c9 c918: 40 91 ca 16 lds r20, 0x16CA ; 0x8016ca c91c: 50 91 cb 16 lds r21, 0x16CB ; 0x8016cb c920: c7 01 movw r24, r14 c922: b6 01 movw r22, r12 c924: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> c928: 9b 01 movw r18, r22 c92a: ac 01 movw r20, r24 c92c: c3 01 movw r24, r6 c92e: b2 01 movw r22, r4 c930: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> c934: f8 01 movw r30, r16 c936: 60 83 st Z, r22 c938: 71 83 std Z+1, r23 ; 0x01 c93a: 82 83 std Z+2, r24 ; 0x02 c93c: 93 83 std Z+3, r25 ; 0x03 out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; c93e: 20 91 cc 16 lds r18, 0x16CC ; 0x8016cc c942: 30 91 cd 16 lds r19, 0x16CD ; 0x8016cd c946: 40 91 ce 16 lds r20, 0x16CE ; 0x8016ce c94a: 50 91 cf 16 lds r21, 0x16CF ; 0x8016cf c94e: c5 01 movw r24, r10 c950: b4 01 movw r22, r8 c952: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> c956: 4b 01 movw r8, r22 c958: 5c 01 movw r10, r24 c95a: 20 91 d0 16 lds r18, 0x16D0 ; 0x8016d0 c95e: 30 91 d1 16 lds r19, 0x16D1 ; 0x8016d1 c962: 40 91 d2 16 lds r20, 0x16D2 ; 0x8016d2 c966: 50 91 d3 16 lds r21, 0x16D3 ; 0x8016d3 c96a: c7 01 movw r24, r14 c96c: b6 01 movw r22, r12 c96e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> c972: 9b 01 movw r18, r22 c974: ac 01 movw r20, r24 c976: c5 01 movw r24, r10 c978: b4 01 movw r22, r8 c97a: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> c97e: f1 01 movw r30, r2 c980: 60 83 st Z, r22 c982: 71 83 std Z+1, r23 ; 0x01 c984: 82 83 std Z+2, r24 ; 0x02 c986: 93 83 std Z+3, r25 ; 0x03 c988: 53 cf rjmp .-346 ; 0xc830 0000c98a : if(next_feedrate > 0.f) feedrate = next_feedrate; } } void clamp_to_software_endstops(float target[3]) { c98a: cf 92 push r12 c98c: df 92 push r13 c98e: ef 92 push r14 c990: ff 92 push r15 c992: cf 93 push r28 c994: df 93 push r29 c996: ec 01 movw r28, r24 #ifdef DEBUG_DISABLE_SWLIMITS return; #endif //DEBUG_DISABLE_SWLIMITS world2machine_clamp(target[0], target[1]); c998: bc 01 movw r22, r24 c99a: 6c 5f subi r22, 0xFC ; 252 c99c: 7f 4f sbci r23, 0xFF ; 255 c99e: 0e 94 a6 63 call 0xc74c ; 0xc74c // Clamp the Z coordinate. if (min_software_endstops) { if (target[Z_AXIS] < min_pos[Z_AXIS]) target[Z_AXIS] = min_pos[Z_AXIS]; c9a2: c0 90 2c 02 lds r12, 0x022C ; 0x80022c c9a6: d0 90 2d 02 lds r13, 0x022D ; 0x80022d c9aa: e0 90 2e 02 lds r14, 0x022E ; 0x80022e c9ae: f0 90 2f 02 lds r15, 0x022F ; 0x80022f c9b2: a7 01 movw r20, r14 c9b4: 96 01 movw r18, r12 c9b6: 68 85 ldd r22, Y+8 ; 0x08 c9b8: 79 85 ldd r23, Y+9 ; 0x09 c9ba: 8a 85 ldd r24, Y+10 ; 0x0a c9bc: 9b 85 ldd r25, Y+11 ; 0x0b c9be: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> c9c2: 87 ff sbrs r24, 7 c9c4: 04 c0 rjmp .+8 ; 0xc9ce c9c6: c8 86 std Y+8, r12 ; 0x08 c9c8: d9 86 std Y+9, r13 ; 0x09 c9ca: ea 86 std Y+10, r14 ; 0x0a c9cc: fb 86 std Y+11, r15 ; 0x0b } if (max_software_endstops) { if (target[Z_AXIS] > max_pos[Z_AXIS]) target[Z_AXIS] = max_pos[Z_AXIS]; c9ce: c0 90 20 02 lds r12, 0x0220 ; 0x800220 c9d2: d0 90 21 02 lds r13, 0x0221 ; 0x800221 c9d6: e0 90 22 02 lds r14, 0x0222 ; 0x800222 c9da: f0 90 23 02 lds r15, 0x0223 ; 0x800223 c9de: a7 01 movw r20, r14 c9e0: 96 01 movw r18, r12 c9e2: 68 85 ldd r22, Y+8 ; 0x08 c9e4: 79 85 ldd r23, Y+9 ; 0x09 c9e6: 8a 85 ldd r24, Y+10 ; 0x0a c9e8: 9b 85 ldd r25, Y+11 ; 0x0b c9ea: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> c9ee: 18 16 cp r1, r24 c9f0: 24 f4 brge .+8 ; 0xc9fa c9f2: c8 86 std Y+8, r12 ; 0x08 c9f4: d9 86 std Y+9, r13 ; 0x09 c9f6: ea 86 std Y+10, r14 ; 0x0a c9f8: fb 86 std Y+11, r15 ; 0x0b } } c9fa: df 91 pop r29 c9fc: cf 91 pop r28 c9fe: ff 90 pop r15 ca00: ef 90 pop r14 ca02: df 90 pop r13 ca04: cf 90 pop r12 ca06: 08 95 ret 0000ca08 : plan_buffer_line(x, y, z, e, feed_rate, current_position); } #endif // MESH_BED_LEVELING void prepare_move(uint16_t start_segment_idx) { ca08: 2f 92 push r2 ca0a: 3f 92 push r3 ca0c: 4f 92 push r4 ca0e: 5f 92 push r5 ca10: 6f 92 push r6 ca12: 7f 92 push r7 ca14: 8f 92 push r8 ca16: 9f 92 push r9 ca18: af 92 push r10 ca1a: bf 92 push r11 ca1c: cf 92 push r12 ca1e: df 92 push r13 ca20: ef 92 push r14 ca22: ff 92 push r15 ca24: 0f 93 push r16 ca26: 1f 93 push r17 ca28: cf 93 push r28 ca2a: df 93 push r29 ca2c: cd b7 in r28, 0x3d ; 61 ca2e: de b7 in r29, 0x3e ; 62 ca30: a2 97 sbiw r28, 0x22 ; 34 ca32: 0f b6 in r0, 0x3f ; 63 ca34: f8 94 cli ca36: de bf out 0x3e, r29 ; 62 ca38: 0f be out 0x3f, r0 ; 63 ca3a: cd bf out 0x3d, r28 ; 61 ca3c: 1c 01 movw r2, r24 clamp_to_software_endstops(destination); ca3e: 83 e9 ldi r24, 0x93 ; 147 ca40: 96 e0 ldi r25, 0x06 ; 6 ca42: 0e 94 c5 64 call 0xc98a ; 0xc98a previous_millis_cmd.start(); ca46: 8a e4 ldi r24, 0x4A ; 74 ca48: 93 e0 ldi r25, 0x03 ; 3 ca4a: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> // Do not use feedmultiply for E or Z only moves if((current_position[X_AXIS] == destination[X_AXIS]) && (current_position[Y_AXIS] == destination[Y_AXIS])) { ca4e: 40 90 f5 11 lds r4, 0x11F5 ; 0x8011f5 ca52: 50 90 f6 11 lds r5, 0x11F6 ; 0x8011f6 ca56: 60 90 f7 11 lds r6, 0x11F7 ; 0x8011f7 ca5a: 70 90 f8 11 lds r7, 0x11F8 ; 0x8011f8 ca5e: c0 90 93 06 lds r12, 0x0693 ; 0x800693 ca62: d0 90 94 06 lds r13, 0x0694 ; 0x800694 ca66: e0 90 95 06 lds r14, 0x0695 ; 0x800695 ca6a: f0 90 96 06 lds r15, 0x0696 ; 0x800696 ca6e: a7 01 movw r20, r14 ca70: 96 01 movw r18, r12 ca72: c3 01 movw r24, r6 ca74: b2 01 movw r22, r4 ca76: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> ca7a: 81 11 cpse r24, r1 ca7c: 3f c0 rjmp .+126 ; 0xcafc ca7e: 20 91 97 06 lds r18, 0x0697 ; 0x800697 ca82: 30 91 98 06 lds r19, 0x0698 ; 0x800698 ca86: 40 91 99 06 lds r20, 0x0699 ; 0x800699 ca8a: 50 91 9a 06 lds r21, 0x069A ; 0x80069a ca8e: 60 91 f9 11 lds r22, 0x11F9 ; 0x8011f9 ca92: 70 91 fa 11 lds r23, 0x11FA ; 0x8011fa ca96: 80 91 fb 11 lds r24, 0x11FB ; 0x8011fb ca9a: 90 91 fc 11 lds r25, 0x11FC ; 0x8011fc ca9e: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> caa2: 81 11 cpse r24, r1 caa4: 2b c0 rjmp .+86 ; 0xcafc plan_buffer_line_destinationXYZE(feedrate/60); caa6: 20 e0 ldi r18, 0x00 ; 0 caa8: 30 e0 ldi r19, 0x00 ; 0 caaa: 40 e7 ldi r20, 0x70 ; 112 caac: 52 e4 ldi r21, 0x42 ; 66 caae: 60 91 7a 02 lds r22, 0x027A ; 0x80027a cab2: 70 91 7b 02 lds r23, 0x027B ; 0x80027b cab6: 80 91 7c 02 lds r24, 0x027C ; 0x80027c caba: 90 91 7d 02 lds r25, 0x027D ; 0x80027d cabe: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> cac2: 0f 94 3d 84 call 0x3087a ; 0x3087a #else plan_buffer_line_destinationXYZE(feedrate*feedmultiply*(1./(60.f*100.f))); #endif } set_current_to_destination(); cac6: 0e 94 ac 54 call 0xa958 ; 0xa958 } caca: a2 96 adiw r28, 0x22 ; 34 cacc: 0f b6 in r0, 0x3f ; 63 cace: f8 94 cli cad0: de bf out 0x3e, r29 ; 62 cad2: 0f be out 0x3f, r0 ; 63 cad4: cd bf out 0x3d, r28 ; 61 cad6: df 91 pop r29 cad8: cf 91 pop r28 cada: 1f 91 pop r17 cadc: 0f 91 pop r16 cade: ff 90 pop r15 cae0: ef 90 pop r14 cae2: df 90 pop r13 cae4: cf 90 pop r12 cae6: bf 90 pop r11 cae8: af 90 pop r10 caea: 9f 90 pop r9 caec: 8f 90 pop r8 caee: 7f 90 pop r7 caf0: 6f 90 pop r6 caf2: 5f 90 pop r5 caf4: 4f 90 pop r4 caf6: 3f 90 pop r3 caf8: 2f 90 pop r2 cafa: 08 95 ret if((current_position[X_AXIS] == destination[X_AXIS]) && (current_position[Y_AXIS] == destination[Y_AXIS])) { plan_buffer_line_destinationXYZE(feedrate/60); } else { #ifdef MESH_BED_LEVELING mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply*(1./(60.f*100.f)), start_segment_idx); cafc: 60 91 8e 02 lds r22, 0x028E ; 0x80028e cb00: 70 91 8f 02 lds r23, 0x028F ; 0x80028f cb04: 07 2e mov r0, r23 cb06: 00 0c add r0, r0 cb08: 88 0b sbc r24, r24 cb0a: 99 0b sbc r25, r25 cb0c: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> cb10: 20 91 7a 02 lds r18, 0x027A ; 0x80027a cb14: 30 91 7b 02 lds r19, 0x027B ; 0x80027b cb18: 40 91 7c 02 lds r20, 0x027C ; 0x80027c cb1c: 50 91 7d 02 lds r21, 0x027D ; 0x80027d cb20: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> cb24: 2e e3 ldi r18, 0x3E ; 62 cb26: 33 ec ldi r19, 0xC3 ; 195 cb28: 4e e2 ldi r20, 0x2E ; 46 cb2a: 59 e3 ldi r21, 0x39 ; 57 cb2c: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> cb30: 6f 83 std Y+7, r22 ; 0x07 cb32: 78 87 std Y+8, r23 ; 0x08 cb34: 89 87 std Y+9, r24 ; 0x09 cb36: 9a 87 std Y+10, r25 ; 0x0a void mesh_plan_buffer_line(const float &x, const float &y, const float &z, const float &e, const float &feed_rate, uint16_t start_segment_idx = 0) { float dx = x - current_position[X_AXIS]; float dy = y - current_position[Y_AXIS]; uint16_t n_segments = 0; if (mbl.active) { cb38: 80 91 9c 12 lds r24, 0x129C ; 0x80129c cb3c: 88 23 and r24, r24 cb3e: 09 f4 brne .+2 ; 0xcb42 cb40: 0f c1 rjmp .+542 ; 0xcd60 return 1; //begin with the first segment } #ifdef MESH_BED_LEVELING void mesh_plan_buffer_line(const float &x, const float &y, const float &z, const float &e, const float &feed_rate, uint16_t start_segment_idx = 0) { float dx = x - current_position[X_AXIS]; cb42: a3 01 movw r20, r6 cb44: 92 01 movw r18, r4 cb46: c7 01 movw r24, r14 cb48: b6 01 movw r22, r12 cb4a: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> cb4e: 2b 01 movw r4, r22 cb50: 3c 01 movw r6, r24 float dy = y - current_position[Y_AXIS]; cb52: 20 91 f9 11 lds r18, 0x11F9 ; 0x8011f9 cb56: 30 91 fa 11 lds r19, 0x11FA ; 0x8011fa cb5a: 40 91 fb 11 lds r20, 0x11FB ; 0x8011fb cb5e: 50 91 fc 11 lds r21, 0x11FC ; 0x8011fc cb62: 60 91 97 06 lds r22, 0x0697 ; 0x800697 cb66: 70 91 98 06 lds r23, 0x0698 ; 0x800698 cb6a: 80 91 99 06 lds r24, 0x0699 ; 0x800699 cb6e: 90 91 9a 06 lds r25, 0x069A ; 0x80069a cb72: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> cb76: 6b 87 std Y+11, r22 ; 0x0b cb78: 7c 87 std Y+12, r23 ; 0x0c cb7a: 8d 87 std Y+13, r24 ; 0x0d cb7c: 9e 87 std Y+14, r25 ; 0x0e uint16_t n_segments = 0; if (mbl.active) { float len = fabs(dx) + fabs(dy); cb7e: c3 01 movw r24, r6 cb80: b2 01 movw r22, r4 cb82: 9f 77 andi r25, 0x7F ; 127 cb84: 2b 85 ldd r18, Y+11 ; 0x0b cb86: 3c 85 ldd r19, Y+12 ; 0x0c cb88: 4d 85 ldd r20, Y+13 ; 0x0d cb8a: 5e 85 ldd r21, Y+14 ; 0x0e cb8c: 5f 77 andi r21, 0x7F ; 127 cb8e: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> cb92: 6b 01 movw r12, r22 cb94: 7c 01 movw r14, r24 if (len > 0) cb96: 20 e0 ldi r18, 0x00 ; 0 cb98: 30 e0 ldi r19, 0x00 ; 0 cb9a: a9 01 movw r20, r18 cb9c: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> cba0: 18 16 cp r1, r24 cba2: 0c f0 brlt .+2 ; 0xcba6 cba4: dd c0 rjmp .+442 ; 0xcd60 // Split to 3cm segments or shorter. n_segments = uint16_t(ceil(len / 30.f)); cba6: 20 e0 ldi r18, 0x00 ; 0 cba8: 30 e0 ldi r19, 0x00 ; 0 cbaa: 40 ef ldi r20, 0xF0 ; 240 cbac: 51 e4 ldi r21, 0x41 ; 65 cbae: c7 01 movw r24, r14 cbb0: b6 01 movw r22, r12 cbb2: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> cbb6: 0f 94 e2 a1 call 0x343c4 ; 0x343c4 cbba: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> cbbe: 7e 83 std Y+6, r23 ; 0x06 cbc0: 6d 83 std Y+5, r22 ; 0x05 } if (n_segments > 1 && start_segment_idx) { cbc2: 62 30 cpi r22, 0x02 ; 2 cbc4: 71 05 cpc r23, r1 cbc6: 08 f4 brcc .+2 ; 0xcbca cbc8: cb c0 rjmp .+406 ; 0xcd60 cbca: 21 14 cp r2, r1 cbcc: 31 04 cpc r3, r1 cbce: 09 f4 brne .+2 ; 0xcbd2 cbd0: c7 c0 rjmp .+398 ; 0xcd60 float dz = z - current_position[Z_AXIS]; cbd2: 20 91 fd 11 lds r18, 0x11FD ; 0x8011fd cbd6: 30 91 fe 11 lds r19, 0x11FE ; 0x8011fe cbda: 40 91 ff 11 lds r20, 0x11FF ; 0x8011ff cbde: 50 91 00 12 lds r21, 0x1200 ; 0x801200 cbe2: 60 91 9b 06 lds r22, 0x069B ; 0x80069b cbe6: 70 91 9c 06 lds r23, 0x069C ; 0x80069c cbea: 80 91 9d 06 lds r24, 0x069D ; 0x80069d cbee: 90 91 9e 06 lds r25, 0x069E ; 0x80069e cbf2: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> cbf6: 6f 87 std Y+15, r22 ; 0x0f cbf8: 78 8b std Y+16, r23 ; 0x10 cbfa: 89 8b std Y+17, r24 ; 0x11 cbfc: 9a 8b std Y+18, r25 ; 0x12 float de = e - current_position[E_AXIS]; cbfe: 20 91 01 12 lds r18, 0x1201 ; 0x801201 cc02: 30 91 02 12 lds r19, 0x1202 ; 0x801202 cc06: 40 91 03 12 lds r20, 0x1203 ; 0x801203 cc0a: 50 91 04 12 lds r21, 0x1204 ; 0x801204 cc0e: 60 91 9f 06 lds r22, 0x069F ; 0x80069f cc12: 70 91 a0 06 lds r23, 0x06A0 ; 0x8006a0 cc16: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 cc1a: 90 91 a2 06 lds r25, 0x06A2 ; 0x8006a2 cc1e: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> cc22: 6b 8b std Y+19, r22 ; 0x13 cc24: 7c 8b std Y+20, r23 ; 0x14 cc26: 8d 8b std Y+21, r24 ; 0x15 cc28: 9e 8b std Y+22, r25 ; 0x16 for (uint16_t i = start_segment_idx; i < n_segments; ++ i) { float t = float(i) / float(n_segments); cc2a: ad 81 ldd r26, Y+5 ; 0x05 cc2c: be 81 ldd r27, Y+6 ; 0x06 cc2e: cd 01 movw r24, r26 cc30: b0 e0 ldi r27, 0x00 ; 0 cc32: a0 e0 ldi r26, 0x00 ; 0 cc34: 8f 8f std Y+31, r24 ; 0x1f cc36: 98 a3 std Y+32, r25 ; 0x20 cc38: a9 a3 std Y+33, r26 ; 0x21 cc3a: ba a3 std Y+34, r27 ; 0x22 if (n_segments > 1 && start_segment_idx) { float dz = z - current_position[Z_AXIS]; float de = e - current_position[E_AXIS]; for (uint16_t i = start_segment_idx; i < n_segments; ++ i) { cc3c: 2d 81 ldd r18, Y+5 ; 0x05 cc3e: 3e 81 ldd r19, Y+6 ; 0x06 cc40: 22 16 cp r2, r18 cc42: 33 06 cpc r3, r19 cc44: 08 f0 brcs .+2 ; 0xcc48 cc46: 8c c0 rjmp .+280 ; 0xcd60 float t = float(i) / float(n_segments); cc48: b1 01 movw r22, r2 cc4a: 90 e0 ldi r25, 0x00 ; 0 cc4c: 80 e0 ldi r24, 0x00 ; 0 cc4e: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> cc52: 6b 01 movw r12, r22 cc54: 7c 01 movw r14, r24 cc56: 6f 8d ldd r22, Y+31 ; 0x1f cc58: 78 a1 ldd r23, Y+32 ; 0x20 cc5a: 89 a1 ldd r24, Y+33 ; 0x21 cc5c: 9a a1 ldd r25, Y+34 ; 0x22 cc5e: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> cc62: 9b 01 movw r18, r22 cc64: ac 01 movw r20, r24 cc66: c7 01 movw r24, r14 cc68: b6 01 movw r22, r12 cc6a: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> cc6e: 6b 01 movw r12, r22 cc70: 7c 01 movw r14, r24 plan_buffer_line(current_position[X_AXIS] + t * dx, current_position[Y_AXIS] + t * dy, current_position[Z_AXIS] + t * dz, current_position[E_AXIS] + t * de, cc72: ac 01 movw r20, r24 cc74: 9b 01 movw r18, r22 cc76: 6b 89 ldd r22, Y+19 ; 0x13 cc78: 7c 89 ldd r23, Y+20 ; 0x14 cc7a: 8d 89 ldd r24, Y+21 ; 0x15 cc7c: 9e 89 ldd r25, Y+22 ; 0x16 cc7e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> cc82: 9b 01 movw r18, r22 cc84: ac 01 movw r20, r24 cc86: 60 91 01 12 lds r22, 0x1201 ; 0x801201 cc8a: 70 91 02 12 lds r23, 0x1202 ; 0x801202 cc8e: 80 91 03 12 lds r24, 0x1203 ; 0x801203 cc92: 90 91 04 12 lds r25, 0x1204 ; 0x801204 cc96: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> cc9a: 69 83 std Y+1, r22 ; 0x01 cc9c: 7a 83 std Y+2, r23 ; 0x02 cc9e: 8b 83 std Y+3, r24 ; 0x03 cca0: 9c 83 std Y+4, r25 ; 0x04 for (uint16_t i = start_segment_idx; i < n_segments; ++ i) { float t = float(i) / float(n_segments); plan_buffer_line(current_position[X_AXIS] + t * dx, current_position[Y_AXIS] + t * dy, current_position[Z_AXIS] + t * dz, cca2: a7 01 movw r20, r14 cca4: 96 01 movw r18, r12 cca6: 6f 85 ldd r22, Y+15 ; 0x0f cca8: 78 89 ldd r23, Y+16 ; 0x10 ccaa: 89 89 ldd r24, Y+17 ; 0x11 ccac: 9a 89 ldd r25, Y+18 ; 0x12 ccae: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> float dz = z - current_position[Z_AXIS]; float de = e - current_position[E_AXIS]; for (uint16_t i = start_segment_idx; i < n_segments; ++ i) { float t = float(i) / float(n_segments); plan_buffer_line(current_position[X_AXIS] + t * dx, ccb2: 20 91 fd 11 lds r18, 0x11FD ; 0x8011fd ccb6: 30 91 fe 11 lds r19, 0x11FE ; 0x8011fe ccba: 40 91 ff 11 lds r20, 0x11FF ; 0x8011ff ccbe: 50 91 00 12 lds r21, 0x1200 ; 0x801200 ccc2: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> ccc6: 6f 8b std Y+23, r22 ; 0x17 ccc8: 78 8f std Y+24, r23 ; 0x18 ccca: 89 8f std Y+25, r24 ; 0x19 cccc: 9a 8f std Y+26, r25 ; 0x1a current_position[Y_AXIS] + t * dy, ccce: a7 01 movw r20, r14 ccd0: 96 01 movw r18, r12 ccd2: 6b 85 ldd r22, Y+11 ; 0x0b ccd4: 7c 85 ldd r23, Y+12 ; 0x0c ccd6: 8d 85 ldd r24, Y+13 ; 0x0d ccd8: 9e 85 ldd r25, Y+14 ; 0x0e ccda: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> float dz = z - current_position[Z_AXIS]; float de = e - current_position[E_AXIS]; for (uint16_t i = start_segment_idx; i < n_segments; ++ i) { float t = float(i) / float(n_segments); plan_buffer_line(current_position[X_AXIS] + t * dx, ccde: 20 91 f9 11 lds r18, 0x11F9 ; 0x8011f9 cce2: 30 91 fa 11 lds r19, 0x11FA ; 0x8011fa cce6: 40 91 fb 11 lds r20, 0x11FB ; 0x8011fb ccea: 50 91 fc 11 lds r21, 0x11FC ; 0x8011fc ccee: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> ccf2: 6b 8f std Y+27, r22 ; 0x1b ccf4: 7c 8f std Y+28, r23 ; 0x1c ccf6: 8d 8f std Y+29, r24 ; 0x1d ccf8: 9e 8f std Y+30, r25 ; 0x1e ccfa: a7 01 movw r20, r14 ccfc: 96 01 movw r18, r12 ccfe: c3 01 movw r24, r6 cd00: b2 01 movw r22, r4 cd02: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> cd06: 20 91 f5 11 lds r18, 0x11F5 ; 0x8011f5 cd0a: 30 91 f6 11 lds r19, 0x11F6 ; 0x8011f6 cd0e: 40 91 f7 11 lds r20, 0x11F7 ; 0x8011f7 cd12: 50 91 f8 11 lds r21, 0x11F8 ; 0x8011f8 cd16: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> cd1a: 3f 92 push r3 cd1c: 2f 92 push r2 cd1e: a5 ef ldi r26, 0xF5 ; 245 cd20: b1 e1 ldi r27, 0x11 ; 17 cd22: bf 93 push r27 cd24: af 93 push r26 cd26: 8f 80 ldd r8, Y+7 ; 0x07 cd28: 98 84 ldd r9, Y+8 ; 0x08 cd2a: a9 84 ldd r10, Y+9 ; 0x09 cd2c: ba 84 ldd r11, Y+10 ; 0x0a cd2e: de 01 movw r26, r28 cd30: 11 96 adiw r26, 0x01 ; 1 cd32: 6d 01 movw r12, r26 cd34: ef 88 ldd r14, Y+23 ; 0x17 cd36: f8 8c ldd r15, Y+24 ; 0x18 cd38: 09 8d ldd r16, Y+25 ; 0x19 cd3a: 1a 8d ldd r17, Y+26 ; 0x1a cd3c: 2b 8d ldd r18, Y+27 ; 0x1b cd3e: 3c 8d ldd r19, Y+28 ; 0x1c cd40: 4d 8d ldd r20, Y+29 ; 0x1d cd42: 5e 8d ldd r21, Y+30 ; 0x1e cd44: 0f 94 22 75 call 0x2ea44 ; 0x2ea44 current_position[Y_AXIS] + t * dy, current_position[Z_AXIS] + t * dz, current_position[E_AXIS] + t * de, feed_rate, current_position, i); if (planner_aborted) cd48: 0f 90 pop r0 cd4a: 0f 90 pop r0 cd4c: 0f 90 pop r0 cd4e: 0f 90 pop r0 cd50: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac cd54: 81 11 cpse r24, r1 cd56: b7 ce rjmp .-658 ; 0xcac6 if (n_segments > 1 && start_segment_idx) { float dz = z - current_position[Z_AXIS]; float de = e - current_position[E_AXIS]; for (uint16_t i = start_segment_idx; i < n_segments; ++ i) { cd58: bf ef ldi r27, 0xFF ; 255 cd5a: 2b 1a sub r2, r27 cd5c: 3b 0a sbc r3, r27 cd5e: 6e cf rjmp .-292 ; 0xcc3c if (planner_aborted) return; } } // The rest of the path. plan_buffer_line(x, y, z, e, feed_rate, current_position); cd60: e0 90 9b 06 lds r14, 0x069B ; 0x80069b cd64: f0 90 9c 06 lds r15, 0x069C ; 0x80069c cd68: 00 91 9d 06 lds r16, 0x069D ; 0x80069d cd6c: 10 91 9e 06 lds r17, 0x069E ; 0x80069e cd70: 20 91 97 06 lds r18, 0x0697 ; 0x800697 cd74: 30 91 98 06 lds r19, 0x0698 ; 0x800698 cd78: 40 91 99 06 lds r20, 0x0699 ; 0x800699 cd7c: 50 91 9a 06 lds r21, 0x069A ; 0x80069a cd80: 60 91 93 06 lds r22, 0x0693 ; 0x800693 cd84: 70 91 94 06 lds r23, 0x0694 ; 0x800694 cd88: 80 91 95 06 lds r24, 0x0695 ; 0x800695 cd8c: 90 91 96 06 lds r25, 0x0696 ; 0x800696 cd90: 1f 92 push r1 cd92: 1f 92 push r1 cd94: e5 ef ldi r30, 0xF5 ; 245 cd96: f1 e1 ldi r31, 0x11 ; 17 cd98: ff 93 push r31 cd9a: ef 93 push r30 cd9c: 8f 80 ldd r8, Y+7 ; 0x07 cd9e: 98 84 ldd r9, Y+8 ; 0x08 cda0: a9 84 ldd r10, Y+9 ; 0x09 cda2: ba 84 ldd r11, Y+10 ; 0x0a cda4: ef e9 ldi r30, 0x9F ; 159 cda6: ce 2e mov r12, r30 cda8: e6 e0 ldi r30, 0x06 ; 6 cdaa: de 2e mov r13, r30 cdac: 0f 94 22 75 call 0x2ea44 ; 0x2ea44 cdb0: 0f 90 pop r0 cdb2: 0f 90 pop r0 cdb4: 0f 90 pop r0 cdb6: 0f 90 pop r0 cdb8: 86 ce rjmp .-756 ; 0xcac6 0000cdba : /// @brief Safely move Z-axis by distance delta (mm) /// @param delta travel distance in mm /// @returns The actual travel distance in mm. Endstop may limit the requested move. float raise_z(float delta) { cdba: cf 92 push r12 cdbc: df 92 push r13 cdbe: ef 92 push r14 cdc0: ff 92 push r15 cdc2: cf 93 push r28 float travel_z = current_position[Z_AXIS]; cdc4: c0 90 fd 11 lds r12, 0x11FD ; 0x8011fd cdc8: d0 90 fe 11 lds r13, 0x11FE ; 0x8011fe cdcc: e0 90 ff 11 lds r14, 0x11FF ; 0x8011ff cdd0: f0 90 00 12 lds r15, 0x1200 ; 0x801200 // Prepare to move Z axis current_position[Z_AXIS] += delta; cdd4: a7 01 movw r20, r14 cdd6: 96 01 movw r18, r12 cdd8: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> cddc: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd cde0: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe cde4: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff cde8: 90 93 00 12 sts 0x1200, r25 ; 0x801200 #if defined(Z_MIN_PIN) && (Z_MIN_PIN > -1) && !defined(DEBUG_DISABLE_ZMINLIMIT) bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); cdec: 83 b1 in r24, 0x03 ; 3 #else bool z_min_endstop = false; #endif if (axis_known_position[Z_AXIS] || z_min_endstop) cdee: 90 91 a5 06 lds r25, 0x06A5 ; 0x8006a5 cdf2: 91 11 cpse r25, r1 cdf4: 02 c0 rjmp .+4 ; 0xcdfa cdf6: 84 ff sbrs r24, 4 cdf8: 26 c0 rjmp .+76 ; 0xce46 { // current position is known or very low, it's safe to raise Z clamp_to_software_endstops(current_position); cdfa: 85 ef ldi r24, 0xF5 ; 245 cdfc: 91 e1 ldi r25, 0x11 ; 17 cdfe: 0e 94 c5 64 call 0xc98a ; 0xc98a plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); ce02: 60 91 4e 04 lds r22, 0x044E ; 0x80044e ce06: 70 91 4f 04 lds r23, 0x044F ; 0x80044f ce0a: 80 91 50 04 lds r24, 0x0450 ; 0x800450 ce0e: 90 91 51 04 lds r25, 0x0451 ; 0x800451 ce12: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); ce16: 0f 94 42 22 call 0x24484 ; 0x24484 // Get the final travel distance travel_z = current_position[Z_AXIS] - travel_z; ce1a: a7 01 movw r20, r14 ce1c: 96 01 movw r18, r12 ce1e: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd ce22: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe ce26: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff ce2a: 90 91 00 12 lds r25, 0x1200 ; 0x801200 ce2e: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> ce32: 6b 01 movw r12, r22 ce34: 7c 01 movw r14, r24 #endif //TMC2130 enable_z_endstop(z_endstop_enabled); } return travel_z; } ce36: c7 01 movw r24, r14 ce38: b6 01 movw r22, r12 ce3a: cf 91 pop r28 ce3c: ff 90 pop r15 ce3e: ef 90 pop r14 ce40: df 90 pop r13 ce42: cf 90 pop r12 ce44: 08 95 ret // Get the final travel distance travel_z = current_position[Z_AXIS] - travel_z; } else { // ensure Z is powered in normal mode to overcome initial load enable_z(); ce46: 15 98 cbi 0x02, 5 ; 2 st_synchronize(); ce48: 0f 94 42 22 call 0x24484 ; 0x24484 // rely on crashguard to limit damage bool z_endstop_enabled = enable_z_endstop(true); ce4c: 81 e0 ldi r24, 0x01 ; 1 ce4e: 0f 94 7a 2c call 0x258f4 ; 0x258f4 ce52: c8 2f mov r28, r24 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); ce54: 65 e5 ldi r22, 0x55 ; 85 ce56: 75 e5 ldi r23, 0x55 ; 85 ce58: 85 e5 ldi r24, 0x55 ; 85 ce5a: 91 e4 ldi r25, 0x41 ; 65 ce5c: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); ce60: 0f 94 42 22 call 0x24484 ; 0x24484 // Get the final travel distance travel_z = st_get_position_mm(Z_AXIS) - travel_z; ce64: 82 e0 ldi r24, 0x02 ; 2 ce66: 0f 94 2e 22 call 0x2445c ; 0x2445c ce6a: a7 01 movw r20, r14 ce6c: 96 01 movw r18, r12 ce6e: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> ce72: 6b 01 movw r12, r22 ce74: 7c 01 movw r14, r24 current_position[Z_AXIS] = max_pos[Z_AXIS]; plan_set_position_curposXYZE(); } tmc2130_home_exit(); #endif //TMC2130 enable_z_endstop(z_endstop_enabled); ce76: 8c 2f mov r24, r28 ce78: 0f 94 7a 2c call 0x258f4 ; 0x258f4 ce7c: dc cf rjmp .-72 ; 0xce36 0000ce7e : // // contrarily to a simple move, this function will carefully plan a move // when the current Z position is unknown. In such cases, stallguard is // enabled and will prevent prolonged pushing against the Z tops void raise_z_above(float target) { ce7e: 8f 92 push r8 ce80: 9f 92 push r9 ce82: af 92 push r10 ce84: bf 92 push r11 ce86: cf 92 push r12 ce88: df 92 push r13 ce8a: ef 92 push r14 ce8c: ff 92 push r15 ce8e: 4b 01 movw r8, r22 ce90: 5c 01 movw r10, r24 if (current_position[Z_AXIS] >= target) ce92: c0 90 fd 11 lds r12, 0x11FD ; 0x8011fd ce96: d0 90 fe 11 lds r13, 0x11FE ; 0x8011fe ce9a: e0 90 ff 11 lds r14, 0x11FF ; 0x8011ff ce9e: f0 90 00 12 lds r15, 0x1200 ; 0x801200 cea2: ac 01 movw r20, r24 cea4: 9b 01 movw r18, r22 cea6: c7 01 movw r24, r14 cea8: b6 01 movw r22, r12 ceaa: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> ceae: 87 ff sbrs r24, 7 ceb0: 11 c0 rjmp .+34 ; 0xced4 return; // Use absolute value in case the current position is unknown raise_z(fabs(current_position[Z_AXIS] - target)); ceb2: a5 01 movw r20, r10 ceb4: 94 01 movw r18, r8 ceb6: c7 01 movw r24, r14 ceb8: b6 01 movw r22, r12 ceba: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> cebe: 9f 77 andi r25, 0x7F ; 127 } cec0: ff 90 pop r15 cec2: ef 90 pop r14 cec4: df 90 pop r13 cec6: cf 90 pop r12 cec8: bf 90 pop r11 ceca: af 90 pop r10 cecc: 9f 90 pop r9 cece: 8f 90 pop r8 { if (current_position[Z_AXIS] >= target) return; // Use absolute value in case the current position is unknown raise_z(fabs(current_position[Z_AXIS] - target)); ced0: 0c 94 dd 66 jmp 0xcdba ; 0xcdba } ced4: ff 90 pop r15 ced6: ef 90 pop r14 ced8: df 90 pop r13 ceda: cf 90 pop r12 cedc: bf 90 pop r11 cede: af 90 pop r10 cee0: 9f 90 pop r9 cee2: 8f 90 pop r8 cee4: 08 95 ret 0000cee6 : #ifdef TMC2130 static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, long home_y_value, bool home_z_axis, long home_z_value, bool calib, bool without_mbl) #else static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, long home_y_value, bool home_z_axis, long home_z_value, bool without_mbl) #endif //TMC2130 { cee6: 2f 92 push r2 cee8: 3f 92 push r3 ceea: 4f 92 push r4 ceec: 5f 92 push r5 ceee: 6f 92 push r6 cef0: 7f 92 push r7 cef2: 8f 92 push r8 cef4: 9f 92 push r9 cef6: af 92 push r10 cef8: bf 92 push r11 cefa: cf 92 push r12 cefc: df 92 push r13 cefe: ef 92 push r14 cf00: ff 92 push r15 cf02: 0f 93 push r16 cf04: 1f 93 push r17 cf06: cf 93 push r28 cf08: df 93 push r29 cf0a: 00 d0 rcall .+0 ; 0xcf0c cf0c: 1f 92 push r1 cf0e: 1f 92 push r1 cf10: cd b7 in r28, 0x3d ; 61 cf12: de b7 in r29, 0x3e ; 62 cf14: d8 2e mov r13, r24 cf16: 2a 01 movw r4, r20 cf18: 3b 01 movw r6, r22 cf1a: 32 2e mov r3, r18 cf1c: e9 82 std Y+1, r14 ; 0x01 cf1e: fa 82 std Y+2, r15 ; 0x02 cf20: 0b 83 std Y+3, r16 ; 0x03 cf22: 1c 83 std Y+4, r17 ; 0x04 // Flag for the display update routine and to disable the print cancelation during homing. st_synchronize(); cf24: 0f 94 42 22 call 0x24484 ; 0x24484 homing_flag = true; cf28: 81 e0 ldi r24, 0x01 ; 1 cf2a: 80 93 05 12 sts 0x1205, r24 ; 0x801205 bool home_x = home_x_axis; bool home_y = home_y_axis; bool home_z = home_z_axis; // Either all X,Y,Z codes are present, or none of them. bool home_all_axes = home_x == home_y && home_x == home_z; cf2e: fc 2c mov r15, r12 cf30: e3 2c mov r14, r3 cf32: d3 10 cpse r13, r3 cf34: 10 c0 rjmp .+32 ; 0xcf56 cf36: ed 2c mov r14, r13 cf38: dc 10 cpse r13, r12 cf3a: 0d c0 rjmp .+26 ; 0xcf56 // No X/Y/Z code provided means to home all axes. home_x = home_y = home_z = true; //if we are homing all axes, first move z higher to protect heatbed/steel sheet if (home_all_axes) { raise_z_above(MESH_HOME_Z_SEARCH); cf3c: 60 e0 ldi r22, 0x00 ; 0 cf3e: 70 e0 ldi r23, 0x00 ; 0 cf40: 80 ea ldi r24, 0xA0 ; 160 cf42: 90 e4 ldi r25, 0x40 ; 64 cf44: 0e 94 3f 67 call 0xce7e ; 0xce7e // Either all X,Y,Z codes are present, or none of them. bool home_all_axes = home_x == home_y && home_x == home_z; if (home_all_axes) // No X/Y/Z code provided means to home all axes. home_x = home_y = home_z = true; cf48: ff 24 eor r15, r15 cf4a: f3 94 inc r15 cf4c: ee 24 eor r14, r14 cf4e: e3 94 inc r14 cf50: 22 24 eor r2, r2 cf52: 23 94 inc r2 cf54: 01 c0 rjmp .+2 ; 0xcf58 bool home_x = home_x_axis; bool home_y = home_y_axis; bool home_z = home_z_axis; // Either all X,Y,Z codes are present, or none of them. bool home_all_axes = home_x == home_y && home_x == home_z; cf56: 2d 2c mov r2, r13 } // Reset world2machine_rotation_and_skew and world2machine_shift, therefore // the planner will not perform any adjustments in the XY plane. // Wait for the motors to stop and update the current position with the absolute values. world2machine_revert_to_uncorrected(); cf58: 0f 94 5c 8f call 0x31eb8 ; 0x31eb8 // For mesh bed leveling deactivate the matrix temporarily. // It is necessary to disable the bed leveling for the X and Y homing moves, so that the move is performed // in a single axis only. // In case of re-homing the X or Y axes only, the mesh bed leveling is restored after G28. #ifdef MESH_BED_LEVELING uint8_t mbl_was_active = mbl.active; cf5c: 80 91 9c 12 lds r24, 0x129C ; 0x80129c cf60: 8d 83 std Y+5, r24 ; 0x05 mbl.active = 0; cf62: 10 92 9c 12 sts 0x129C, r1 ; 0x80129c current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); cf66: 82 e0 ldi r24, 0x02 ; 2 cf68: 0f 94 2e 22 call 0x2445c ; 0x2445c cf6c: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd cf70: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe cf74: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff cf78: 90 93 00 12 sts 0x1200, r25 ; 0x801200 #endif // Reset baby stepping to zero, if the babystepping has already been loaded before. if (home_z) cf7c: f1 10 cpse r15, r1 babystep_undo(); cf7e: 0f 94 0b 8b call 0x31616 ; 0x31616 int l_feedmultiply = setup_for_endstop_move(); cf82: 81 e0 ldi r24, 0x01 ; 1 cf84: 0e 94 ee 5f call 0xbfdc ; 0xbfdc cf88: 8c 01 movw r16, r24 set_destination_to_current(); cf8a: 0e 94 36 61 call 0xc26c ; 0xc26c feedrate = 0.0; cf8e: 10 92 7a 02 sts 0x027A, r1 ; 0x80027a cf92: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b cf96: 10 92 7c 02 sts 0x027C, r1 ; 0x80027c cf9a: 10 92 7d 02 sts 0x027D, r1 ; 0x80027d homeaxis(Y_AXIS); else tmc2130_home_calibrate(Y_AXIS); } #else //TMC2130 if(home_x) homeaxis(X_AXIS); cf9e: 22 20 and r2, r2 cfa0: 19 f0 breq .+6 ; 0xcfa8 cfa2: 80 e0 ldi r24, 0x00 ; 0 cfa4: 0f 94 bc 53 call 0x2a778 ; 0x2a778 if(home_y) homeaxis(Y_AXIS); cfa8: ee 20 and r14, r14 cfaa: 19 f0 breq .+6 ; 0xcfb2 cfac: 81 e0 ldi r24, 0x01 ; 1 cfae: 0f 94 bc 53 call 0x2a778 ; 0x2a778 #endif //TMC2130 if(home_x_axis && home_x_value != 0) cfb2: dd 20 and r13, r13 cfb4: e9 f0 breq .+58 ; 0xcff0 cfb6: 41 14 cp r4, r1 cfb8: 51 04 cpc r5, r1 cfba: 61 04 cpc r6, r1 cfbc: 71 04 cpc r7, r1 cfbe: c1 f0 breq .+48 ; 0xcff0 current_position[X_AXIS]=home_x_value+cs.add_homing[X_AXIS]; cfc0: c3 01 movw r24, r6 cfc2: b2 01 movw r22, r4 cfc4: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> cfc8: 9b 01 movw r18, r22 cfca: ac 01 movw r20, r24 cfcc: 60 91 8a 04 lds r22, 0x048A ; 0x80048a cfd0: 70 91 8b 04 lds r23, 0x048B ; 0x80048b cfd4: 80 91 8c 04 lds r24, 0x048C ; 0x80048c cfd8: 90 91 8d 04 lds r25, 0x048D ; 0x80048d cfdc: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> cfe0: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 cfe4: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 cfe8: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 cfec: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 if(home_y_axis && home_y_value != 0) cff0: 33 20 and r3, r3 cff2: 01 f1 breq .+64 ; 0xd034 cff4: 89 81 ldd r24, Y+1 ; 0x01 cff6: 9a 81 ldd r25, Y+2 ; 0x02 cff8: ab 81 ldd r26, Y+3 ; 0x03 cffa: bc 81 ldd r27, Y+4 ; 0x04 cffc: 00 97 sbiw r24, 0x00 ; 0 cffe: a1 05 cpc r26, r1 d000: b1 05 cpc r27, r1 d002: c1 f0 breq .+48 ; 0xd034 current_position[Y_AXIS]=home_y_value+cs.add_homing[Y_AXIS]; d004: bc 01 movw r22, r24 d006: cd 01 movw r24, r26 d008: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> d00c: 9b 01 movw r18, r22 d00e: ac 01 movw r20, r24 d010: 60 91 8e 04 lds r22, 0x048E ; 0x80048e d014: 70 91 8f 04 lds r23, 0x048F ; 0x80048f d018: 80 91 90 04 lds r24, 0x0490 ; 0x800490 d01c: 90 91 91 04 lds r25, 0x0491 ; 0x800491 d020: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> d024: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 d028: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa d02c: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb d030: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc #if Z_HOME_DIR < 0 // If homing towards BED do Z last if(home_z) { d034: ff 20 and r15, r15 d036: 09 f4 brne .+2 ; 0xd03a d038: 99 c0 rjmp .+306 ; 0xd16c #ifdef MESH_BED_LEVELING // If Mesh bed leveling, move X&Y to safe position for home raise_z_above(MESH_HOME_Z_SEARCH); d03a: 60 e0 ldi r22, 0x00 ; 0 d03c: 70 e0 ldi r23, 0x00 ; 0 d03e: 80 ea ldi r24, 0xA0 ; 160 d040: 90 e4 ldi r25, 0x40 ; 64 d042: 0e 94 3f 67 call 0xce7e ; 0xce7e if (!axis_known_position[X_AXIS]) homeaxis(X_AXIS); d046: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 d04a: 81 11 cpse r24, r1 d04c: 02 c0 rjmp .+4 ; 0xd052 d04e: 0f 94 bc 53 call 0x2a778 ; 0x2a778 if (!axis_known_position[Y_AXIS]) homeaxis(Y_AXIS); d052: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 d056: 81 11 cpse r24, r1 d058: 03 c0 rjmp .+6 ; 0xd060 d05a: 81 e0 ldi r24, 0x01 ; 1 d05c: 0f 94 bc 53 call 0x2a778 ; 0x2a778 // 1st mesh bed leveling measurement point, corrected. world2machine_initialize(); d060: 0f 94 c1 8f call 0x31f82 ; 0x31f82 world2machine(pgm_read_float(bed_ref_points_4), pgm_read_float(bed_ref_points_4+1), destination[X_AXIS], destination[Y_AXIS]); d064: e0 e5 ldi r30, 0x50 ; 80 d066: f8 e8 ldi r31, 0x88 ; 136 d068: 85 91 lpm r24, Z+ d06a: 95 91 lpm r25, Z+ d06c: a5 91 lpm r26, Z+ d06e: b4 91 lpm r27, Z d070: ec e4 ldi r30, 0x4C ; 76 d072: f8 e8 ldi r31, 0x88 ; 136 d074: 45 91 lpm r20, Z+ d076: 55 91 lpm r21, Z+ d078: 65 91 lpm r22, Z+ d07a: 74 91 lpm r23, Z } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; d07c: 40 93 93 06 sts 0x0693, r20 ; 0x800693 d080: 50 93 94 06 sts 0x0694, r21 ; 0x800694 d084: 60 93 95 06 sts 0x0695, r22 ; 0x800695 d088: 70 93 96 06 sts 0x0696, r23 ; 0x800696 out_y = y; d08c: 80 93 97 06 sts 0x0697, r24 ; 0x800697 d090: 90 93 98 06 sts 0x0698, r25 ; 0x800698 d094: a0 93 99 06 sts 0x0699, r26 ; 0x800699 d098: b0 93 9a 06 sts 0x069A, r27 ; 0x80069a world2machine(out_x, out_y); d09c: 67 e9 ldi r22, 0x97 ; 151 d09e: 76 e0 ldi r23, 0x06 ; 6 d0a0: 83 e9 ldi r24, 0x93 ; 147 d0a2: 96 e0 ldi r25, 0x06 ; 6 d0a4: 0e 94 fe 62 call 0xc5fc ; 0xc5fc world2machine_reset(); d0a8: 0f 94 23 8f call 0x31e46 ; 0x31e46 if (destination[Y_AXIS] < Y_MIN_POS) d0ac: 20 e0 ldi r18, 0x00 ; 0 d0ae: 30 e0 ldi r19, 0x00 ; 0 d0b0: 40 e8 ldi r20, 0x80 ; 128 d0b2: 50 ec ldi r21, 0xC0 ; 192 d0b4: 60 91 97 06 lds r22, 0x0697 ; 0x800697 d0b8: 70 91 98 06 lds r23, 0x0698 ; 0x800698 d0bc: 80 91 99 06 lds r24, 0x0699 ; 0x800699 d0c0: 90 91 9a 06 lds r25, 0x069A ; 0x80069a d0c4: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> d0c8: 87 ff sbrs r24, 7 d0ca: 0c c0 rjmp .+24 ; 0xd0e4 destination[Y_AXIS] = Y_MIN_POS; d0cc: 80 e0 ldi r24, 0x00 ; 0 d0ce: 90 e0 ldi r25, 0x00 ; 0 d0d0: a0 e8 ldi r26, 0x80 ; 128 d0d2: b0 ec ldi r27, 0xC0 ; 192 d0d4: 80 93 97 06 sts 0x0697, r24 ; 0x800697 d0d8: 90 93 98 06 sts 0x0698, r25 ; 0x800698 d0dc: a0 93 99 06 sts 0x0699, r26 ; 0x800699 d0e0: b0 93 9a 06 sts 0x069A, r27 ; 0x80069a feedrate = homing_feedrate[X_AXIS] / 20; d0e4: 80 e0 ldi r24, 0x00 ; 0 d0e6: 90 e0 ldi r25, 0x00 ; 0 d0e8: a6 e1 ldi r26, 0x16 ; 22 d0ea: b3 e4 ldi r27, 0x43 ; 67 d0ec: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a d0f0: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b d0f4: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c d0f8: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d d0fc: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.364> #ifdef DEBUG_BUILD SERIAL_ECHOLNPGM("plan_set_position()"); MYSERIAL.println(current_position[X_AXIS]);MYSERIAL.println(current_position[Y_AXIS]); MYSERIAL.println(current_position[Z_AXIS]);MYSERIAL.println(current_position[E_AXIS]); #endif plan_set_position_curposXYZE(); d100: 0f 94 30 83 call 0x30660 ; 0x30660 SERIAL_ECHOLNPGM("plan_buffer_line()"); MYSERIAL.println(destination[X_AXIS]);MYSERIAL.println(destination[Y_AXIS]); MYSERIAL.println(destination[Z_AXIS]);MYSERIAL.println(destination[E_AXIS]); MYSERIAL.println(feedrate);MYSERIAL.println(active_extruder); #endif plan_buffer_line_destinationXYZE(feedrate); d104: 60 91 7a 02 lds r22, 0x027A ; 0x80027a d108: 70 91 7b 02 lds r23, 0x027B ; 0x80027b d10c: 80 91 7c 02 lds r24, 0x027C ; 0x80027c d110: 90 91 7d 02 lds r25, 0x027D ; 0x80027d d114: 0f 94 3d 84 call 0x3087a ; 0x3087a st_synchronize(); d118: 0f 94 42 22 call 0x24484 ; 0x24484 current_position[X_AXIS] = destination[X_AXIS]; d11c: 80 91 93 06 lds r24, 0x0693 ; 0x800693 d120: 90 91 94 06 lds r25, 0x0694 ; 0x800694 d124: a0 91 95 06 lds r26, 0x0695 ; 0x800695 d128: b0 91 96 06 lds r27, 0x0696 ; 0x800696 d12c: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 d130: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 d134: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 d138: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = destination[Y_AXIS]; d13c: 80 91 97 06 lds r24, 0x0697 ; 0x800697 d140: 90 91 98 06 lds r25, 0x0698 ; 0x800698 d144: a0 91 99 06 lds r26, 0x0699 ; 0x800699 d148: b0 91 9a 06 lds r27, 0x069A ; 0x80069a d14c: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 d150: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa d154: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb d158: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc d15c: 81 e0 ldi r24, 0x01 ; 1 d15e: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.364> enable_endstops(true); endstops_hit_on_purpose(); d162: 0f 94 96 2c call 0x2592c ; 0x2592c homeaxis(Z_AXIS); d166: 82 e0 ldi r24, 0x02 ; 2 d168: 0f 94 bc 53 call 0x2a778 ; 0x2a778 homeaxis(Z_AXIS); #endif // MESH_BED_LEVELING } #endif // Z_HOME_DIR < 0 if(home_z_axis && home_z_value != 0) d16c: cc 20 and r12, r12 d16e: e9 f0 breq .+58 ; 0xd1aa d170: 81 14 cp r8, r1 d172: 91 04 cpc r9, r1 d174: a1 04 cpc r10, r1 d176: b1 04 cpc r11, r1 d178: c1 f0 breq .+48 ; 0xd1aa current_position[Z_AXIS]=home_z_value+cs.add_homing[Z_AXIS]; d17a: c5 01 movw r24, r10 d17c: b4 01 movw r22, r8 d17e: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> d182: 9b 01 movw r18, r22 d184: ac 01 movw r20, r24 d186: 60 91 92 04 lds r22, 0x0492 ; 0x800492 d18a: 70 91 93 04 lds r23, 0x0493 ; 0x800493 d18e: 80 91 94 04 lds r24, 0x0494 ; 0x800494 d192: 90 91 95 04 lds r25, 0x0495 ; 0x800495 d196: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> d19a: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd d19e: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe d1a2: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff d1a6: 90 93 00 12 sts 0x1200, r25 ; 0x801200 // Set the planner and stepper routine positions. // At this point the mesh bed leveling and world2machine corrections are disabled and current_position // contains the machine coordinates. plan_set_position_curposXYZE(); d1aa: 0f 94 30 83 call 0x30660 ; 0x30660 clean_up_after_endstop_move(l_feedmultiply); d1ae: c8 01 movw r24, r16 d1b0: 0e 94 d4 5f call 0xbfa8 ; 0xbfa8 endstops_hit_on_purpose(); d1b4: 0f 94 96 2c call 0x2592c ; 0x2592c // Load the machine correction matrix world2machine_initialize(); d1b8: 0f 94 c1 8f call 0x31f82 ; 0x31f82 // and correct the current_position XY axes to match the transformed coordinate system. world2machine_update_current(); d1bc: 0f 94 5f 8d call 0x31abe ; 0x31abe #ifdef MESH_BED_LEVELING if (home_x_axis || home_y_axis || without_mbl || home_z_axis) d1c0: d1 10 cpse r13, r1 d1c2: 07 c0 rjmp .+14 ; 0xd1d2 d1c4: 31 10 cpse r3, r1 d1c6: 05 c0 rjmp .+10 ; 0xd1d2 d1c8: 8b 8d ldd r24, Y+27 ; 0x1b d1ca: 81 11 cpse r24, r1 d1cc: 02 c0 rjmp .+4 ; 0xd1d2 d1ce: cc 20 and r12, r12 d1d0: 39 f1 breq .+78 ; 0xd220 { if (! home_z && mbl_was_active) { d1d2: f1 10 cpse r15, r1 d1d4: 25 c0 rjmp .+74 ; 0xd220 d1d6: 9d 81 ldd r25, Y+5 ; 0x05 d1d8: 99 23 and r25, r25 d1da: 11 f1 breq .+68 ; 0xd220 // Re-enable the mesh bed leveling if only the X and Y axes were re-homed. mbl.active = true; d1dc: 81 e0 ldi r24, 0x01 ; 1 d1de: 80 93 9c 12 sts 0x129C, r24 ; 0x80129c // and re-adjust the current logical Z axis with the bed leveling offset applicable at the current XY position. current_position[Z_AXIS] -= mbl.get_z(st_get_position_mm(X_AXIS), st_get_position_mm(Y_AXIS)); d1e2: 0f 94 2e 22 call 0x2445c ; 0x2445c d1e6: 6b 01 movw r12, r22 d1e8: 7c 01 movw r14, r24 d1ea: 80 e0 ldi r24, 0x00 ; 0 d1ec: 0f 94 2e 22 call 0x2445c ; 0x2445c d1f0: a7 01 movw r20, r14 d1f2: 96 01 movw r18, r12 d1f4: 0f 94 08 60 call 0x2c010 ; 0x2c010 d1f8: 9b 01 movw r18, r22 d1fa: ac 01 movw r20, r24 d1fc: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd d200: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe d204: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff d208: 90 91 00 12 lds r25, 0x1200 ; 0x801200 d20c: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> d210: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd d214: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe d218: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff d21c: 90 93 00 12 sts 0x1200, r25 ; 0x801200 } } #endif prusa_statistics(20); d220: 84 e1 ldi r24, 0x14 ; 20 d222: 0f 94 ff 97 call 0x32ffe ; 0x32ffe st_synchronize(); d226: 0f 94 42 22 call 0x24484 ; 0x24484 homing_flag = false; d22a: 10 92 05 12 sts 0x1205, r1 ; 0x801205 #if 0 SERIAL_ECHOPGM("G28, final "); print_world_coordinates(); SERIAL_ECHOPGM("G28, final "); print_physical_coordinates(); SERIAL_ECHOPGM("G28, final "); print_mesh_bed_leveling_table(); #endif } d22e: 0f 90 pop r0 d230: 0f 90 pop r0 d232: 0f 90 pop r0 d234: 0f 90 pop r0 d236: 0f 90 pop r0 d238: df 91 pop r29 d23a: cf 91 pop r28 d23c: 1f 91 pop r17 d23e: 0f 91 pop r16 d240: ff 90 pop r15 d242: ef 90 pop r14 d244: df 90 pop r13 d246: cf 90 pop r12 d248: bf 90 pop r11 d24a: af 90 pop r10 d24c: 9f 90 pop r9 d24e: 8f 90 pop r8 d250: 7f 90 pop r7 d252: 6f 90 pop r6 d254: 5f 90 pop r5 d256: 4f 90 pop r4 d258: 3f 90 pop r3 d25a: 2f 90 pop r2 d25c: 08 95 ret 0000d25e : static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); } void lcd_frame_start() { d25e: e3 e3 ldi r30, 0x33 ; 51 d260: f3 e0 ldi r31, 0x03 ; 3 } else { //character is no longer used (or invalid?), mark it as unused #ifdef DEBUG_CUSTOM_CHARACTERS printf_P(PSTR("discarded char %02x at slot %u\n"), c, i); #endif // DEBUG_CUSTOM_CHARACTERS lcd_custom_characters[i] = 0x7F; d262: 9f e7 ldi r25, 0x7F ; 127 } void lcd_frame_start() { // check all custom characters and discard unused ones for (uint8_t i = 0; i < 8; i++) { uint8_t c = lcd_custom_characters[i]; d264: 81 91 ld r24, Z+ if (c == 0x7F) { //slot empty d266: 8f 37 cpi r24, 0x7F ; 127 d268: 31 f0 breq .+12 ; 0xd276 d26a: df 01 movw r26, r30 d26c: 11 97 sbiw r26, 0x01 ; 1 continue; } else if (c & 0x80) { //slot was used on the last frame update, mark it as potentially unused this time d26e: 87 ff sbrs r24, 7 d270: 07 c0 rjmp .+14 ; 0xd280 lcd_custom_characters[i] = c & 0x7F; d272: 8f 77 andi r24, 0x7F ; 127 d274: 8c 93 st X, r24 memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); } void lcd_frame_start() { // check all custom characters and discard unused ones for (uint8_t i = 0; i < 8; i++) { d276: 83 e0 ldi r24, 0x03 ; 3 d278: eb 33 cpi r30, 0x3B ; 59 d27a: f8 07 cpc r31, r24 d27c: 99 f7 brne .-26 ; 0xd264 for (uint8_t i = 0; i < 8; i++) { printf_P(PSTR(" %02x"), lcd_custom_characters[i]); } printf_P(PSTR("\n")); #endif // DEBUG_CUSTOM_CHARACTERS } d27e: 08 95 ret } else { //character is no longer used (or invalid?), mark it as unused #ifdef DEBUG_CUSTOM_CHARACTERS printf_P(PSTR("discarded char %02x at slot %u\n"), c, i); #endif // DEBUG_CUSTOM_CHARACTERS lcd_custom_characters[i] = 0x7F; d280: 9c 93 st X, r25 d282: f9 cf rjmp .-14 ; 0xd276 0000d284 : } } void lcd_update(uint8_t lcdDrawUpdateOverride) { if (lcd_draw_update < lcdDrawUpdateOverride) d284: 90 91 5b 02 lds r25, 0x025B ; 0x80025b d288: 98 17 cp r25, r24 d28a: 10 f4 brcc .+4 ; 0xd290 lcd_draw_update = lcdDrawUpdateOverride; d28c: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b if (!lcd_update_enabled) return; d290: 80 91 5c 02 lds r24, 0x025C ; 0x80025c d294: 88 23 and r24, r24 d296: 39 f0 breq .+14 ; 0xd2a6 if (lcd_lcdupdate_func) d298: e0 91 d2 03 lds r30, 0x03D2 ; 0x8003d2 d29c: f0 91 d3 03 lds r31, 0x03D3 ; 0x8003d3 d2a0: 30 97 sbiw r30, 0x00 ; 0 d2a2: 09 f0 breq .+2 ; 0xd2a6 lcd_lcdupdate_func(); d2a4: 19 94 eijmp } d2a6: 08 95 ret 0000d2a8 : lcd_set_cursor(c, r); return fputs_P(str, lcdout); } int lcd_printf_P(const char* format, ...) { d2a8: cf 93 push r28 d2aa: df 93 push r29 d2ac: cd b7 in r28, 0x3d ; 61 d2ae: de b7 in r29, 0x3e ; 62 d2b0: ae 01 movw r20, r28 d2b2: 4a 5f subi r20, 0xFA ; 250 d2b4: 5f 4f sbci r21, 0xFF ; 255 d2b6: fa 01 movw r30, r20 d2b8: 61 91 ld r22, Z+ d2ba: 71 91 ld r23, Z+ d2bc: af 01 movw r20, r30 va_list args; va_start(args, format); int ret = vfprintf_P(lcdout, format, args); d2be: 80 ec ldi r24, 0xC0 ; 192 d2c0: 93 e0 ldi r25, 0x03 ; 3 d2c2: 0f 94 23 9f call 0x33e46 ; 0x33e46 va_end(args); return ret; } d2c6: df 91 pop r29 d2c8: cf 91 pop r28 d2ca: 08 95 ret 0000d2cc : return fputc(ch, lcdout); } int lcd_puts_P(const char* str) { return fputs_P(str, lcdout); d2cc: 60 ec ldi r22, 0xC0 ; 192 d2ce: 73 e0 ldi r23, 0x03 ; 3 d2d0: 0d 94 74 9e jmp 0x33ce8 ; 0x33ce8 0000d2d4 : lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address } int lcd_putc(char c) { return fputc(c, lcdout); d2d4: 60 ec ldi r22, 0xC0 ; 192 d2d6: 73 e0 ldi r23, 0x03 ; 3 d2d8: 08 2e mov r0, r24 d2da: 00 0c add r0, r0 d2dc: 99 0b sbc r25, r25 d2de: 0d 94 44 9e jmp 0x33c88 ; 0x33c88 0000d2e2 : va_end(args); return ret; } void lcd_space(uint8_t n) { d2e2: cf 93 push r28 d2e4: c8 2f mov r28, r24 while (n--) lcd_putc(' '); d2e6: c1 50 subi r28, 0x01 ; 1 d2e8: 20 f0 brcs .+8 ; 0xd2f2 d2ea: 80 e2 ldi r24, 0x20 ; 32 d2ec: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 d2f0: fa cf rjmp .-12 ; 0xd2e6 } d2f2: cf 91 pop r28 d2f4: 08 95 ret 0000d2f6 : { return pgm_read_byte(row_offsets + min(row, LCD_HEIGHT - 1)); } void lcd_set_cursor(uint8_t col, uint8_t row) { d2f6: cf 93 push r28 d2f8: c8 2f mov r28, r24 d2fa: 86 2f mov r24, r22 /// @brief set the current LCD row /// @param row LCD row number, ranges from 0 to LCD_HEIGHT - 1 static void FORCE_INLINE lcd_set_current_row(uint8_t row) { lcd_currline = min(row, LCD_HEIGHT - 1); d2fc: 64 30 cpi r22, 0x04 ; 4 d2fe: 08 f0 brcs .+2 ; 0xd302 d300: 83 e0 ldi r24, 0x03 ; 3 d302: 80 93 32 03 sts 0x0332, r24 ; 0x800332 } void lcd_set_cursor(uint8_t col, uint8_t row) { lcd_set_current_row(row); uint8_t addr = col + lcd_get_row_offset(lcd_currline); d306: 0e 94 b6 54 call 0xa96c ; 0xa96c d30a: 8c 0f add r24, r28 lcd_ddram_address = addr; d30c: 80 93 31 03 sts 0x0331, r24 ; 0x800331 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d310: 44 e6 ldi r20, 0x64 ; 100 d312: 50 e0 ldi r21, 0x00 ; 0 d314: 60 e0 ldi r22, 0x00 ; 0 d316: 80 68 ori r24, 0x80 ; 128 { lcd_set_current_row(row); uint8_t addr = col + lcd_get_row_offset(lcd_currline); lcd_ddram_address = addr; lcd_command(LCD_SETDDRAMADDR | addr); } d318: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d31a: 0c 94 02 5d jmp 0xba04 ; 0xba04 0000d31e : { return fputs_P(str, lcdout); } int lcd_puts_at_P(uint8_t c, uint8_t r, const char* str) { d31e: cf 93 push r28 d320: df 93 push r29 d322: ea 01 movw r28, r20 lcd_set_cursor(c, r); d324: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 return fputs_P(str, lcdout); d328: 60 ec ldi r22, 0xC0 ; 192 d32a: 73 e0 ldi r23, 0x03 ; 3 d32c: ce 01 movw r24, r28 } d32e: df 91 pop r29 d330: cf 91 pop r28 } int lcd_puts_at_P(uint8_t c, uint8_t r, const char* str) { lcd_set_cursor(c, r); return fputs_P(str, lcdout); d332: 0d 94 74 9e jmp 0x33ce8 ; 0x33ce8 0000d336 : { return fputc(c, lcdout); } int lcd_putc_at(uint8_t c, uint8_t r, char ch) { d336: cf 93 push r28 d338: c4 2f mov r28, r20 lcd_set_cursor(c, r); d33a: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 return fputc(ch, lcdout); d33e: 60 ec ldi r22, 0xC0 ; 192 d340: 73 e0 ldi r23, 0x03 ; 3 d342: 8c 2f mov r24, r28 d344: cc 0f add r28, r28 d346: 99 0b sbc r25, r25 } d348: cf 91 pop r28 } int lcd_putc_at(uint8_t c, uint8_t r, char ch) { lcd_set_cursor(c, r); return fputc(ch, lcdout); d34a: 0d 94 44 9e jmp 0x33c88 ; 0x33c88 0000d34e : } // Set cursor position to zero and in DDRAM. It does not unshift the display. void lcd_home(void) { lcd_set_cursor(0, 0); d34e: 60 e0 ldi r22, 0x00 ; 0 d350: 80 e0 ldi r24, 0x00 ; 0 d352: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_ddram_address = 0; d356: 10 92 31 03 sts 0x0331, r1 ; 0x800331 } d35a: 08 95 ret 0000d35c : delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d35c: 40 e4 ldi r20, 0x40 ; 64 d35e: 56 e0 ldi r21, 0x06 ; 6 d360: 60 e0 ldi r22, 0x00 ; 0 d362: 81 e0 ldi r24, 0x01 ; 1 d364: 0e 94 02 5d call 0xba04 ; 0xba04 // Clear display, set cursor position to zero and unshift the display. It also invalidates all custom characters void lcd_clear(void) { lcd_command(LCD_CLEARDISPLAY, 1600); lcd_currline = 0; d368: 10 92 32 03 sts 0x0332, r1 ; 0x800332 lcd_ddram_address = 0; d36c: 10 92 31 03 sts 0x0331, r1 ; 0x800331 lcd_send(charToSend, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); d370: 48 e0 ldi r20, 0x08 ; 8 d372: 50 e0 ldi r21, 0x00 ; 0 d374: 6f e7 ldi r22, 0x7F ; 127 d376: 70 e0 ldi r23, 0x00 ; 0 d378: 83 e3 ldi r24, 0x33 ; 51 d37a: 93 e0 ldi r25, 0x03 ; 3 d37c: 0d 94 0e a6 jmp 0x34c1c ; 0x34c1c 0000d380 : } void lcd_update_enable(uint8_t enabled) { // printf_P(PSTR("lcd_update_enable(%u -> %u)\n"), lcd_update_enabled, enabled); if (lcd_update_enabled != enabled) d380: 90 91 5c 02 lds r25, 0x025C ; 0x80025c d384: 98 17 cp r25, r24 d386: 09 f1 breq .+66 ; 0xd3ca { lcd_update_enabled = enabled; d388: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c if (enabled) d38c: 88 23 and r24, r24 d38e: e9 f0 breq .+58 ; 0xd3ca { // Reset encoder position. This is equivalent to re-entering a menu. lcd_encoder = 0; d390: 10 92 07 05 sts 0x0507, r1 ; 0x800507 d394: 10 92 06 05 sts 0x0506, r1 ; 0x800506 lcd_encoder_diff = 0; d398: 10 92 11 06 sts 0x0611, r1 ; 0x800611 <_ZL16lcd_encoder_diff.lto_priv.504> // Enabling the normal LCD update procedure. // Reset the timeout interval. lcd_timeoutToStatus.start(); d39c: 81 eb ldi r24, 0xB1 ; 177 d39e: 93 e0 ldi r25, 0x03 ; 3 d3a0: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> // Force the keypad update now. lcd_next_update_millis = _millis() - 1; d3a4: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 d3a8: 61 50 subi r22, 0x01 ; 1 d3aa: 71 09 sbc r23, r1 d3ac: 81 09 sbc r24, r1 d3ae: 91 09 sbc r25, r1 d3b0: 60 93 93 03 sts 0x0393, r22 ; 0x800393 d3b4: 70 93 94 03 sts 0x0394, r23 ; 0x800394 d3b8: 80 93 95 03 sts 0x0395, r24 ; 0x800395 d3bc: 90 93 96 03 sts 0x0396, r25 ; 0x800396 // Full update. lcd_clear(); d3c0: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_update(2); d3c4: 82 e0 ldi r24, 0x02 ; 2 d3c6: 0c 94 42 69 jmp 0xd284 ; 0xd284 } else { // Clear the LCD always, or let it to the caller? } } } d3ca: 08 95 ret 0000d3cc : lcd_ddram_address++; // no need for preventing ddram overflow } } static void lcd_begin(uint8_t clear) { d3cc: cf 93 push r28 d3ce: c8 2f mov r28, r24 lcd_currline = 0; d3d0: 10 92 32 03 sts 0x0332, r1 ; 0x800332 lcd_ddram_address = 0; d3d4: 10 92 31 03 sts 0x0331, r1 ; 0x800331 lcd_send(charToSend, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); d3d8: 48 e0 ldi r20, 0x08 ; 8 d3da: 50 e0 ldi r21, 0x00 ; 0 d3dc: 6f e7 ldi r22, 0x7F ; 127 d3de: 70 e0 ldi r23, 0x00 ; 0 d3e0: 83 e3 ldi r24, 0x33 ; 51 d3e2: 93 e0 ldi r25, 0x03 ; 3 d3e4: 0f 94 0e a6 call 0x34c1c ; 0x34c1c lcd_currline = 0; lcd_ddram_address = 0; lcd_invalidate_custom_characters(); lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 4500); // wait min 4.1ms d3e8: 44 e9 ldi r20, 0x94 ; 148 d3ea: 51 e1 ldi r21, 0x11 ; 17 d3ec: 62 e0 ldi r22, 0x02 ; 2 d3ee: 80 e3 ldi r24, 0x30 ; 48 d3f0: 0e 94 02 5d call 0xba04 ; 0xba04 // second try lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); d3f4: 46 e9 ldi r20, 0x96 ; 150 d3f6: 50 e0 ldi r21, 0x00 ; 0 d3f8: 62 e0 ldi r22, 0x02 ; 2 d3fa: 80 e3 ldi r24, 0x30 ; 48 d3fc: 0e 94 02 5d call 0xba04 ; 0xba04 // third go! lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); d400: 46 e9 ldi r20, 0x96 ; 150 d402: 50 e0 ldi r21, 0x00 ; 0 d404: 62 e0 ldi r22, 0x02 ; 2 d406: 80 e3 ldi r24, 0x30 ; 48 d408: 0e 94 02 5d call 0xba04 ; 0xba04 #ifndef LCD_8BIT // set to 4-bit interface lcd_send(LCD_FUNCTIONSET | LCD_4BITMODE, LOW | LCD_HALF_FLAG, 150); d40c: 46 e9 ldi r20, 0x96 ; 150 d40e: 50 e0 ldi r21, 0x00 ; 0 d410: 62 e0 ldi r22, 0x02 ; 2 d412: 80 e2 ldi r24, 0x20 ; 32 d414: 0e 94 02 5d call 0xba04 ; 0xba04 #endif // finally, set # lines, font size, etc.0 lcd_command(LCD_FUNCTIONSET | lcd_displayfunction); d418: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce <_ZL19lcd_displayfunction.lto_priv.515> delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d41c: 44 e6 ldi r20, 0x64 ; 100 d41e: 50 e0 ldi r21, 0x00 ; 0 d420: 60 e0 ldi r22, 0x00 ; 0 d422: 80 62 ori r24, 0x20 ; 32 d424: 0e 94 02 5d call 0xba04 ; 0xba04 } // Turn the display on/off (quickly) void lcd_display(void) { lcd_displaycontrol |= LCD_DISPLAYON; d428: 84 e0 ldi r24, 0x04 ; 4 d42a: 80 93 30 03 sts 0x0330, r24 ; 0x800330 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d42e: 44 e6 ldi r20, 0x64 ; 100 d430: 50 e0 ldi r21, 0x00 ; 0 d432: 60 e0 ldi r22, 0x00 ; 0 d434: 8c e0 ldi r24, 0x0C ; 12 d436: 0e 94 02 5d call 0xba04 ; 0xba04 lcd_command(LCD_FUNCTIONSET | lcd_displayfunction); // turn the display on with no cursor or blinking default lcd_displaycontrol = LCD_CURSOROFF | LCD_BLINKOFF; lcd_display(); // clear it off if (clear) lcd_clear(); d43a: c1 11 cpse r28, r1 d43c: 0e 94 ae 69 call 0xd35c ; 0xd35c delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d440: 44 e6 ldi r20, 0x64 ; 100 d442: 50 e0 ldi r21, 0x00 ; 0 d444: 60 e0 ldi r22, 0x00 ; 0 d446: 86 e0 ldi r24, 0x06 ; 6 if (clear) lcd_clear(); // Initialize to default text direction (for romance languages) lcd_displaymode = LCD_ENTRYLEFT | LCD_ENTRYSHIFTDECREMENT; // set the entry mode lcd_command(LCD_ENTRYMODESET | lcd_displaymode); } d448: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d44a: 0c 94 02 5d jmp 0xba04 ; 0xba04 0000d44e : fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream } void lcd_refresh(void) { lcd_begin(1); d44e: 81 e0 ldi r24, 0x01 ; 1 d450: 0c 94 e6 69 jmp 0xd3cc ; 0xd3cc 0000d454 : { lcd_send(value, LOW, duration); } static void lcd_write(uint8_t value) { d454: cf 92 push r12 d456: df 92 push r13 d458: ff 92 push r15 d45a: 0f 93 push r16 d45c: 1f 93 push r17 d45e: cf 93 push r28 d460: df 93 push r29 d462: 00 d0 rcall .+0 ; 0xd464 d464: 00 d0 rcall .+0 ; 0xd466 d466: 1f 92 push r1 d468: 1f 92 push r1 d46a: cd b7 in r28, 0x3d ; 61 d46c: de b7 in r29, 0x3e ; 62 if (value == '\n') { d46e: 8a 30 cpi r24, 0x0A ; 10 d470: d9 f4 brne .+54 ; 0xd4a8 if (lcd_currline > 3) lcd_currline = -1; d472: 80 91 32 03 lds r24, 0x0332 ; 0x800332 d476: 84 30 cpi r24, 0x04 ; 4 d478: 18 f0 brcs .+6 ; 0xd480 d47a: 8f ef ldi r24, 0xFF ; 255 d47c: 80 93 32 03 sts 0x0332, r24 ; 0x800332 lcd_set_cursor(0, lcd_currline + 1); // LF d480: 60 91 32 03 lds r22, 0x0332 ; 0x800332 d484: 6f 5f subi r22, 0xFF ; 255 d486: 80 e0 ldi r24, 0x00 ; 0 d488: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_print_custom(value); } else { lcd_send(value, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } } d48c: 28 96 adiw r28, 0x08 ; 8 d48e: 0f b6 in r0, 0x3f ; 63 d490: f8 94 cli d492: de bf out 0x3e, r29 ; 62 d494: 0f be out 0x3f, r0 ; 63 d496: cd bf out 0x3d, r28 ; 61 d498: df 91 pop r29 d49a: cf 91 pop r28 d49c: 1f 91 pop r17 d49e: 0f 91 pop r16 d4a0: ff 90 pop r15 d4a2: df 90 pop r13 d4a4: cf 90 pop r12 d4a6: 08 95 ret static void lcd_write(uint8_t value) { if (value == '\n') { if (lcd_currline > 3) lcd_currline = -1; lcd_set_cursor(0, lcd_currline + 1); // LF } else if ((value >= 0x80) && (value < (0x80 + CUSTOM_CHARACTERS_CNT))) { d4a8: 90 e8 ldi r25, 0x80 ; 128 d4aa: 98 0f add r25, r24 lcd_print_custom(value); } else { lcd_send(value, HIGH); d4ac: 44 e6 ldi r20, 0x64 ; 100 d4ae: 50 e0 ldi r21, 0x00 ; 0 d4b0: 61 e0 ldi r22, 0x01 ; 1 static void lcd_write(uint8_t value) { if (value == '\n') { if (lcd_currline > 3) lcd_currline = -1; lcd_set_cursor(0, lcd_currline + 1); // LF } else if ((value >= 0x80) && (value < (0x80 + CUSTOM_CHARACTERS_CNT))) { d4b2: 9a 34 cpi r25, 0x4A ; 74 d4b4: 08 f5 brcc .+66 ; 0xd4f8 // Custom character data // #define DEBUG_CUSTOM_CHARACTERS static void lcd_print_custom(uint8_t c) { uint8_t charToSend = pgm_read_byte(&Font[c - 0x80].alternate); // in case no empty slot is found, use the alternate character. d4b6: 48 2f mov r20, r24 d4b8: 40 58 subi r20, 0x80 ; 128 d4ba: 55 0b sbc r21, r21 d4bc: 9a 01 movw r18, r20 d4be: 96 e0 ldi r25, 0x06 ; 6 d4c0: 92 9f mul r25, r18 d4c2: a0 01 movw r20, r0 d4c4: 93 9f mul r25, r19 d4c6: 50 0d add r21, r0 d4c8: 11 24 eor r1, r1 d4ca: fa 01 movw r30, r20 d4cc: e4 5a subi r30, 0xA4 ; 164 d4ce: fb 48 sbci r31, 0x8B ; 139 d4d0: f4 90 lpm r15, Z d4d2: e3 e3 ldi r30, 0x33 ; 51 d4d4: f3 e0 ldi r31, 0x03 ; 3 d4d6: 30 e0 ldi r19, 0x00 ; 0 d4d8: 20 e0 ldi r18, 0x00 ; 0 int8_t slotToUse = -1; d4da: 9f ef ldi r25, 0xFF ; 255 for (uint8_t i = 0; i < 8; i++) { // first check if we already have the character in the lcd memory if ((lcd_custom_characters[i] & 0x7F) == (c & 0x7F)) { d4dc: 61 91 ld r22, Z+ d4de: 78 2f mov r23, r24 d4e0: 76 27 eor r23, r22 d4e2: 7f 77 andi r23, 0x7F ; 127 d4e4: 89 f4 brne .+34 ; 0xd508 lcd_custom_characters[i] = c; // mark the custom character as used d4e6: f9 01 movw r30, r18 d4e8: ed 5c subi r30, 0xCD ; 205 d4ea: fc 4f sbci r31, 0xFC ; 252 d4ec: 80 83 st Z, r24 d4ee: f2 2e mov r15, r18 #ifdef DEBUG_CUSTOM_CHARACTERS printf_P(PSTR("created char %02x at slot %u\n"), c, slotToUse); #endif // DEBUG_CUSTOM_CHARACTERS sendChar: lcd_send(charToSend, HIGH); d4f0: 44 e6 ldi r20, 0x64 ; 100 d4f2: 50 e0 ldi r21, 0x00 ; 0 d4f4: 61 e0 ldi r22, 0x01 ; 1 d4f6: 8f 2d mov r24, r15 if (lcd_currline > 3) lcd_currline = -1; lcd_set_cursor(0, lcd_currline + 1); // LF } else if ((value >= 0x80) && (value < (0x80 + CUSTOM_CHARACTERS_CNT))) { lcd_print_custom(value); } else { lcd_send(value, HIGH); d4f8: 0e 94 02 5d call 0xba04 ; 0xba04 lcd_ddram_address++; // no need for preventing ddram overflow d4fc: 80 91 31 03 lds r24, 0x0331 ; 0x800331 d500: 8f 5f subi r24, 0xFF ; 255 d502: 80 93 31 03 sts 0x0331, r24 ; 0x800331 d506: c2 cf rjmp .-124 ; 0xd48c charToSend = i; // send the found custom character id #ifdef DEBUG_CUSTOM_CHARACTERS printf_P(PSTR("found char %02x at slot %u\n"), c, i); #endif // DEBUG_CUSTOM_CHARACTERS goto sendChar; } else if (lcd_custom_characters[i] == 0x7F) { //found an empty slot. create a new custom character and send it d508: 6f 37 cpi r22, 0x7F ; 127 d50a: 09 f0 breq .+2 ; 0xd50e d50c: 3c c0 rjmp .+120 ; 0xd586 lcd_custom_characters[i] = c; // mark the custom character as used d50e: f9 01 movw r30, r18 d510: ed 5c subi r30, 0xCD ; 205 d512: fc 4f sbci r31, 0xFC ; 252 d514: 80 83 st Z, r24 slotToUse = i; d516: 92 2f mov r25, r18 #ifdef DEBUG_CUSTOM_CHARACTERS printf_P(PSTR("replaced char %02x at slot %u\n"), lcd_custom_characters[slotToUse], slotToUse); #endif // DEBUG_CUSTOM_CHARACTERS createChar: charToSend = slotToUse; d518: f9 2e mov r15, r25 lcd_createChar_P(slotToUse, &Font[c - 0x80]); d51a: fa 01 movw r30, r20 d51c: e9 5a subi r30, 0xA9 ; 169 d51e: fb 48 sbci r31, 0x8B ; 139 "dec __zero_reg__" "\n\t" "brne forBegin_%=" "\n\t" : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); d520: 8e 01 movw r16, r28 d522: 0f 5f subi r16, 0xFF ; 255 d524: 1f 4f sbci r17, 0xFF ; 255 d526: d8 01 movw r26, r16 d528: 95 91 lpm r25, Z+ d52a: 88 e0 ldi r24, 0x08 ; 8 d52c: 18 2e mov r1, r24 0000d52e : d52e: 10 fe sbrs r1, 0 d530: 05 90 lpm r0, Z+ d532: 02 94 swap r0 d534: 80 2d mov r24, r0 d536: 97 95 ror r25 d538: 88 1f adc r24, r24 d53a: 8d 93 st X+, r24 d53c: 1a 94 dec r1 d53e: b9 f7 brne .-18 ; 0xd52e lcd_command(LCD_SETCGRAMADDR | (location << 3)); d540: bf 2d mov r27, r15 d542: e8 e0 ldi r30, 0x08 ; 8 d544: be 02 muls r27, r30 d546: c0 01 movw r24, r0 d548: 11 24 eor r1, r1 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d54a: 44 e6 ldi r20, 0x64 ; 100 d54c: 50 e0 ldi r21, 0x00 ; 0 d54e: 60 e0 ldi r22, 0x00 ; 0 d550: 80 64 ori r24, 0x40 ; 64 d552: 0e 94 02 5d call 0xba04 ; 0xba04 d556: 6e 01 movw r12, r28 d558: f9 e0 ldi r31, 0x09 ; 9 d55a: cf 0e add r12, r31 d55c: d1 1c adc r13, r1 : "z" (char_p), "e" (charmap) ); lcd_command(LCD_SETCGRAMADDR | (location << 3)); for (uint8_t i = 0; i < 8; i++) { lcd_send(charmap[i], HIGH); d55e: 44 e6 ldi r20, 0x64 ; 100 d560: 50 e0 ldi r21, 0x00 ; 0 d562: 61 e0 ldi r22, 0x01 ; 1 d564: d8 01 movw r26, r16 d566: 8d 91 ld r24, X+ d568: 8d 01 movw r16, r26 d56a: 0e 94 02 5d call 0xba04 ; 0xba04 : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); lcd_command(LCD_SETCGRAMADDR | (location << 3)); for (uint8_t i = 0; i < 8; i++) { d56e: c0 16 cp r12, r16 d570: d1 06 cpc r13, r17 d572: a9 f7 brne .-22 ; 0xd55e lcd_send(charmap[i], HIGH); } lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address d574: 80 91 31 03 lds r24, 0x0331 ; 0x800331 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d578: 44 e6 ldi r20, 0x64 ; 100 d57a: 50 e0 ldi r21, 0x00 ; 0 d57c: 60 e0 ldi r22, 0x00 ; 0 d57e: 80 68 ori r24, 0x80 ; 128 d580: 0e 94 02 5d call 0xba04 ; 0xba04 d584: b5 cf rjmp .-150 ; 0xd4f0 goto sendChar; } else if (lcd_custom_characters[i] == 0x7F) { //found an empty slot. create a new custom character and send it lcd_custom_characters[i] = c; // mark the custom character as used slotToUse = i; goto createChar; } else if (!(lcd_custom_characters[i] & 0x80)) { // found potentially unused slot. Remember it in case it's needed d586: 67 ff sbrs r22, 7 slotToUse = i; d588: 92 2f mov r25, r18 d58a: 2f 5f subi r18, 0xFF ; 255 d58c: 3f 4f sbci r19, 0xFF ; 255 static void lcd_print_custom(uint8_t c) { uint8_t charToSend = pgm_read_byte(&Font[c - 0x80].alternate); // in case no empty slot is found, use the alternate character. int8_t slotToUse = -1; for (uint8_t i = 0; i < 8; i++) { d58e: 28 30 cpi r18, 0x08 ; 8 d590: 31 05 cpc r19, r1 d592: 09 f0 breq .+2 ; 0xd596 d594: a3 cf rjmp .-186 ; 0xd4dc } // If this point was reached, then there is no empty slot available. // If there exists any potentially unused slot, then use that one instead. // Otherwise, use the alternate form of the character. if (slotToUse < 0) { d596: 9f 3f cpi r25, 0xFF ; 255 d598: 09 f0 breq .+2 ; 0xd59c d59a: be cf rjmp .-132 ; 0xd518 d59c: a9 cf rjmp .-174 ; 0xd4f0 0000d59e : else lcd_printNumber(n, base); } void lcd_printNumber(unsigned long n, uint8_t base) { d59e: 8f 92 push r8 d5a0: 9f 92 push r9 d5a2: af 92 push r10 d5a4: bf 92 push r11 d5a6: ef 92 push r14 d5a8: ff 92 push r15 d5aa: 0f 93 push r16 d5ac: 1f 93 push r17 d5ae: cf 93 push r28 d5b0: df 93 push r29 d5b2: cd b7 in r28, 0x3d ; 61 d5b4: de b7 in r29, 0x3e ; 62 d5b6: a0 97 sbiw r28, 0x20 ; 32 d5b8: 0f b6 in r0, 0x3f ; 63 d5ba: f8 94 cli d5bc: de bf out 0x3e, r29 ; 62 d5be: 0f be out 0x3f, r0 ; 63 d5c0: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) d5c2: 61 15 cp r22, r1 d5c4: 71 05 cpc r23, r1 d5c6: 81 05 cpc r24, r1 d5c8: 91 05 cpc r25, r1 d5ca: 99 f4 brne .+38 ; 0xd5f2 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); d5cc: 80 e3 ldi r24, 0x30 ; 48 buf[i++] = n % base; n /= base; } for (; i > 0; i--) lcd_print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); } d5ce: a0 96 adiw r28, 0x20 ; 32 d5d0: 0f b6 in r0, 0x3f ; 63 d5d2: f8 94 cli d5d4: de bf out 0x3e, r29 ; 62 d5d6: 0f be out 0x3f, r0 ; 63 d5d8: cd bf out 0x3d, r28 ; 61 d5da: df 91 pop r29 d5dc: cf 91 pop r28 d5de: 1f 91 pop r17 d5e0: 0f 91 pop r16 d5e2: ff 90 pop r15 d5e4: ef 90 pop r14 d5e6: bf 90 pop r11 d5e8: af 90 pop r10 d5ea: 9f 90 pop r9 d5ec: 8f 90 pop r8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); d5ee: 0c 94 2a 6a jmp 0xd454 ; 0xd454 } void lcd_printNumber(unsigned long n, uint8_t base) { unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; d5f2: 00 e0 ldi r16, 0x00 ; 0 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; d5f4: 84 2e mov r8, r20 d5f6: 91 2c mov r9, r1 d5f8: b1 2c mov r11, r1 d5fa: a1 2c mov r10, r1 d5fc: 9e 01 movw r18, r28 d5fe: 2f 5f subi r18, 0xFF ; 255 d600: 3f 4f sbci r19, 0xFF ; 255 d602: 79 01 movw r14, r18 d604: a5 01 movw r20, r10 d606: 94 01 movw r18, r8 d608: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> d60c: f7 01 movw r30, r14 d60e: e0 0f add r30, r16 d610: f1 1d adc r31, r1 d612: 60 83 st Z, r22 n /= base; d614: b9 01 movw r22, r18 d616: ca 01 movw r24, r20 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; d618: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { lcd_print('0'); return; } while (n > 0) d61a: 61 15 cp r22, r1 d61c: 71 05 cpc r23, r1 d61e: 81 05 cpc r24, r1 d620: 91 05 cpc r25, r1 d622: 81 f7 brne .-32 ; 0xd604 d624: 0e 0d add r16, r14 d626: 1f 2d mov r17, r15 d628: 11 1d adc r17, r1 { buf[i++] = n % base; n /= base; } for (; i > 0; i--) d62a: e0 16 cp r14, r16 d62c: f1 06 cpc r15, r17 d62e: 59 f0 breq .+22 ; 0xd646 lcd_print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); d630: f8 01 movw r30, r16 d632: 82 91 ld r24, -Z d634: 8f 01 movw r16, r30 d636: 8a 30 cpi r24, 0x0A ; 10 d638: 20 f4 brcc .+8 ; 0xd642 d63a: 80 5d subi r24, 0xD0 ; 208 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); d63c: 0e 94 2a 6a call 0xd454 ; 0xd454 d640: f4 cf rjmp .-24 ; 0xd62a { buf[i++] = n % base; n /= base; } for (; i > 0; i--) lcd_print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); d642: 89 5c subi r24, 0xC9 ; 201 d644: fb cf rjmp .-10 ; 0xd63c } d646: a0 96 adiw r28, 0x20 ; 32 d648: 0f b6 in r0, 0x3f ; 63 d64a: f8 94 cli d64c: de bf out 0x3e, r29 ; 62 d64e: 0f be out 0x3f, r0 ; 63 d650: cd bf out 0x3d, r28 ; 61 d652: df 91 pop r29 d654: cf 91 pop r28 d656: 1f 91 pop r17 d658: 0f 91 pop r16 d65a: ff 90 pop r15 d65c: ef 90 pop r14 d65e: bf 90 pop r11 d660: af 90 pop r10 d662: 9f 90 pop r9 d664: 8f 90 pop r8 d666: 08 95 ret 0000d668 : void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); } void lcd_print(long n, int base) d668: cf 92 push r12 d66a: df 92 push r13 d66c: ef 92 push r14 d66e: ff 92 push r15 d670: 6b 01 movw r12, r22 d672: 7c 01 movw r14, r24 { if (base == 0) lcd_write(n); else if (base == 10) { if (n < 0) d674: f7 fe sbrs r15, 7 d676: 0b c0 rjmp .+22 ; 0xd68e } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); d678: 8d e2 ldi r24, 0x2D ; 45 d67a: 0e 94 2a 6a call 0xd454 ; 0xd454 else if (base == 10) { if (n < 0) { lcd_print('-'); n = -n; d67e: f0 94 com r15 d680: e0 94 com r14 d682: d0 94 com r13 d684: c0 94 com r12 d686: c1 1c adc r12, r1 d688: d1 1c adc r13, r1 d68a: e1 1c adc r14, r1 d68c: f1 1c adc r15, r1 } lcd_printNumber(n, 10); d68e: 4a e0 ldi r20, 0x0A ; 10 d690: c7 01 movw r24, r14 d692: b6 01 movw r22, r12 } else lcd_printNumber(n, base); } d694: ff 90 pop r15 d696: ef 90 pop r14 d698: df 90 pop r13 d69a: cf 90 pop r12 if (n < 0) { lcd_print('-'); n = -n; } lcd_printNumber(n, 10); d69c: 0c 94 cf 6a jmp 0xd59e ; 0xd59e 0000d6a0 : lcd_space(len); return len; } uint8_t lcd_print_pad_P(const char* s, uint8_t len) { d6a0: 0f 93 push r16 d6a2: 1f 93 push r17 d6a4: cf 93 push r28 d6a6: 8c 01 movw r16, r24 d6a8: c6 2f mov r28, r22 while (len && pgm_read_byte(s)) { d6aa: cc 23 and r28, r28 d6ac: 59 f0 breq .+22 ; 0xd6c4 d6ae: f8 01 movw r30, r16 d6b0: 24 91 lpm r18, Z d6b2: 22 23 and r18, r18 d6b4: 39 f0 breq .+14 ; 0xd6c4 lcd_write(pgm_read_byte(s++)); d6b6: 0f 5f subi r16, 0xFF ; 255 d6b8: 1f 4f sbci r17, 0xFF ; 255 d6ba: 84 91 lpm r24, Z d6bc: 0e 94 2a 6a call 0xd454 ; 0xd454 --len; d6c0: c1 50 subi r28, 0x01 ; 1 d6c2: f3 cf rjmp .-26 ; 0xd6aa } lcd_space(len); d6c4: 8c 2f mov r24, r28 d6c6: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 return len; } d6ca: 8c 2f mov r24, r28 d6cc: cf 91 pop r28 d6ce: 1f 91 pop r17 d6d0: 0f 91 pop r16 d6d2: 08 95 ret 0000d6d4 : { while (*s) lcd_write(*(s++)); } uint8_t lcd_print_pad(const char* s, uint8_t len) { d6d4: 0f 93 push r16 d6d6: 1f 93 push r17 d6d8: cf 93 push r28 d6da: 8c 01 movw r16, r24 d6dc: c6 2f mov r28, r22 while (len && *s) { d6de: cc 23 and r28, r28 d6e0: 49 f0 breq .+18 ; 0xd6f4 d6e2: f8 01 movw r30, r16 d6e4: 81 91 ld r24, Z+ d6e6: 8f 01 movw r16, r30 d6e8: 88 23 and r24, r24 d6ea: 21 f0 breq .+8 ; 0xd6f4 lcd_write(*(s++)); d6ec: 0e 94 2a 6a call 0xd454 ; 0xd454 --len; d6f0: c1 50 subi r28, 0x01 ; 1 d6f2: f5 cf rjmp .-22 ; 0xd6de } lcd_space(len); d6f4: 8c 2f mov r24, r28 d6f6: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 return len; } d6fa: 8c 2f mov r24, r28 d6fc: cf 91 pop r28 d6fe: 1f 91 pop r17 d700: 0f 91 pop r16 d702: 08 95 ret 0000d704 : while (n--) lcd_putc(' '); } void lcd_print(const char* s) { d704: cf 93 push r28 d706: df 93 push r29 d708: ec 01 movw r28, r24 while (*s) lcd_write(*(s++)); d70a: 89 91 ld r24, Y+ d70c: 88 23 and r24, r24 d70e: 19 f0 breq .+6 ; 0xd716 d710: 0e 94 2a 6a call 0xd454 ; 0xd454 d714: fa cf rjmp .-12 ; 0xd70a } d716: df 91 pop r29 d718: cf 91 pop r28 d71a: 08 95 ret 0000d71c : lcd_command(LCD_ENTRYMODESET | lcd_displaymode); } static int lcd_putchar(char c, FILE *) { lcd_write(c); d71c: 0e 94 2a 6a call 0xd454 ; 0xd454 return 0; } d720: 90 e0 ldi r25, 0x00 ; 0 d722: 80 e0 ldi r24, 0x00 ; 0 d724: 08 95 ret 0000d726 : extern void lcd_frame_start(); //! @brief Consume click and longpress event inline void lcd_consume_click() { lcd_click_trigger = 0; d726: 10 92 63 03 sts 0x0363, r1 ; 0x800363 lcd_longpress_trigger = 0; d72a: 10 92 14 06 sts 0x0614, r1 ; 0x800614 } d72e: 08 95 ret 0000d730 : //! Generally is used in modal dialogs. //! //! @retval 0 not clicked //! @retval nonzero clicked uint8_t lcd_clicked(void) { d730: cf 93 push r28 bool clicked = LCD_CLICKED; d732: 80 91 63 03 lds r24, 0x0363 ; 0x800363 d736: c1 e0 ldi r28, 0x01 ; 1 d738: 81 11 cpse r24, r1 d73a: 04 c0 rjmp .+8 ; 0xd744 d73c: c0 e0 ldi r28, 0x00 ; 0 if(clicked) { lcd_consume_click(); } return clicked; } d73e: 8c 2f mov r24, r28 d740: cf 91 pop r28 d742: 08 95 ret uint8_t lcd_clicked(void) { bool clicked = LCD_CLICKED; if(clicked) { lcd_consume_click(); d744: 0e 94 93 6b call 0xd726 ; 0xd726 d748: fa cf rjmp .-12 ; 0xd73e 0000d74a : eeprom_update_byte((unsigned char*)EEPROM_LANG, LANG_ID_FORCE_SELECTION); } uint8_t lang_is_selected(void) { uint8_t lang_eeprom = eeprom_read_byte((unsigned char*)EEPROM_LANG); d74a: 8e ef ldi r24, 0xFE ; 254 d74c: 9f e0 ldi r25, 0x0F ; 15 d74e: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 return (lang_eeprom != LANG_ID_FORCE_SELECTION) && (lang_eeprom == lang_selected); d752: 8e 3f cpi r24, 0xFE ; 254 d754: 39 f0 breq .+14 ; 0xd764 d756: 91 e0 ldi r25, 0x01 ; 1 d758: 20 91 2f 03 lds r18, 0x032F ; 0x80032f d75c: 28 13 cpse r18, r24 d75e: 90 e0 ldi r25, 0x00 ; 0 d760: 89 2f mov r24, r25 d762: 08 95 ret d764: 80 e0 ldi r24, 0x00 ; 0 } d766: 08 95 ret 0000d768 : return _n("??"); } void lang_reset(void) { lang_selected = 0; d768: 10 92 2f 03 sts 0x032F, r1 ; 0x80032f eeprom_update_byte((unsigned char*)EEPROM_LANG, LANG_ID_FORCE_SELECTION); d76c: 6e ef ldi r22, 0xFE ; 254 d76e: 8e ef ldi r24, 0xFE ; 254 d770: 9f e0 ldi r25, 0x0F ; 15 d772: 0d 94 00 a0 jmp 0x34000 ; 0x34000 0000d776 : return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) d776: 85 37 cpi r24, 0x75 ; 117 d778: 28 e6 ldi r18, 0x68 ; 104 d77a: 92 07 cpc r25, r18 d77c: 09 f4 brne .+2 ; 0xd780 d77e: 59 c0 rjmp .+178 ; 0xd832 d780: f8 f4 brcc .+62 ; 0xd7c0 d782: 8e 36 cpi r24, 0x6E ; 110 d784: 25 e6 ldi r18, 0x65 ; 101 d786: 92 07 cpc r25, r18 d788: 09 f4 brne .+2 ; 0xd78c d78a: 59 c0 rjmp .+178 ; 0xd83e d78c: 50 f4 brcc .+20 ; 0xd7a2 d78e: 83 37 cpi r24, 0x73 ; 115 d790: 23 e6 ldi r18, 0x63 ; 99 d792: 92 07 cpc r25, r18 d794: b1 f1 breq .+108 ; 0xd802 d796: 85 36 cpi r24, 0x65 ; 101 d798: 94 46 sbci r25, 0x64 ; 100 d79a: b1 f1 breq .+108 ; 0xd808 //#ifdef COMMUNITY_LANG_GROUP1_QR // case LANG_CODE_QR: return _n("New language"); //community contribution //#endif // COMMUNITY_LANG_GROUP1_QR #endif // COMMUNITY_LANGUAGE_SUPPORT } return _n("??"); d79c: 82 e9 ldi r24, 0x92 ; 146 d79e: 93 e6 ldi r25, 0x63 ; 99 d7a0: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) d7a2: 82 37 cpi r24, 0x72 ; 114 d7a4: 26 e6 ldi r18, 0x66 ; 102 d7a6: 92 07 cpc r25, r18 d7a8: 91 f1 breq .+100 ; 0xd80e d7aa: 82 37 cpi r24, 0x72 ; 114 d7ac: 28 e6 ldi r18, 0x68 ; 104 d7ae: 92 07 cpc r25, r18 d7b0: 09 f4 brne .+2 ; 0xd7b4 d7b2: 42 c0 rjmp .+132 ; 0xd838 d7b4: 83 37 cpi r24, 0x73 ; 115 d7b6: 95 46 sbci r25, 0x65 ; 101 d7b8: 89 f7 brne .-30 ; 0xd79c { case LANG_CODE_EN: return _n("English"); case LANG_CODE_CZ: return _n("Cestina"); case LANG_CODE_DE: return _n("Deutsch"); case LANG_CODE_ES: return _n("Espanol"); d7ba: 89 ee ldi r24, 0xE9 ; 233 d7bc: 93 e6 ldi r25, 0x63 ; 99 d7be: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) d7c0: 8c 36 cpi r24, 0x6C ; 108 d7c2: 20 e7 ldi r18, 0x70 ; 112 d7c4: 92 07 cpc r25, r18 d7c6: 31 f1 breq .+76 ; 0xd814 d7c8: 70 f4 brcc .+28 ; 0xd7e6 d7ca: 8c 36 cpi r24, 0x6C ; 108 d7cc: 2e e6 ldi r18, 0x6E ; 110 d7ce: 92 07 cpc r25, r18 d7d0: 21 f1 breq .+72 ; 0xd81a d7d2: 8f 36 cpi r24, 0x6F ; 111 d7d4: 2e e6 ldi r18, 0x6E ; 110 d7d6: 92 07 cpc r25, r18 d7d8: 31 f1 breq .+76 ; 0xd826 d7da: 84 37 cpi r24, 0x74 ; 116 d7dc: 99 46 sbci r25, 0x69 ; 105 d7de: f1 f6 brne .-68 ; 0xd79c case LANG_CODE_EN: return _n("English"); case LANG_CODE_CZ: return _n("Cestina"); case LANG_CODE_DE: return _n("Deutsch"); case LANG_CODE_ES: return _n("Espanol"); case LANG_CODE_FR: return _n("Francais"); case LANG_CODE_IT: return _n("Italiano"); d7e0: 87 ed ldi r24, 0xD7 ; 215 d7e2: 93 e6 ldi r25, 0x63 ; 99 d7e4: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) d7e6: 8b 36 cpi r24, 0x6B ; 107 d7e8: 23 e7 ldi r18, 0x73 ; 115 d7ea: 92 07 cpc r25, r18 d7ec: f9 f0 breq .+62 ; 0xd82c d7ee: 86 37 cpi r24, 0x76 ; 118 d7f0: 23 e7 ldi r18, 0x73 ; 115 d7f2: 92 07 cpc r25, r18 d7f4: a9 f0 breq .+42 ; 0xd820 d7f6: 8f 36 cpi r24, 0x6F ; 111 d7f8: 92 47 sbci r25, 0x72 ; 114 d7fa: 81 f6 brne .-96 ; 0xd79c #endif // COMMUNITY_LANG_GROUP1_HR #ifdef COMMUNITY_LANG_GROUP2_LT case LANG_CODE_LT: return _n("Lietuviu"); //community Lithuanian contribution #endif // COMMUNITY_LANG_GROUP2_LT #ifdef COMMUNITY_LANG_GROUP1_RO case LANG_CODE_RO: return _n("Romana"); //community Romanian contribution d7fc: 85 e9 ldi r24, 0x95 ; 149 d7fe: 93 e6 ldi r25, 0x63 ; 99 d800: 08 95 ret const char* lang_get_name_by_code(uint16_t code) { switch (code) { case LANG_CODE_EN: return _n("English"); case LANG_CODE_CZ: return _n("Cestina"); d802: 89 ef ldi r24, 0xF9 ; 249 d804: 93 e6 ldi r25, 0x63 ; 99 d806: 08 95 ret case LANG_CODE_DE: return _n("Deutsch"); d808: 81 ef ldi r24, 0xF1 ; 241 d80a: 93 e6 ldi r25, 0x63 ; 99 d80c: 08 95 ret case LANG_CODE_ES: return _n("Espanol"); case LANG_CODE_FR: return _n("Francais"); d80e: 80 ee ldi r24, 0xE0 ; 224 d810: 93 e6 ldi r25, 0x63 ; 99 d812: 08 95 ret case LANG_CODE_IT: return _n("Italiano"); case LANG_CODE_PL: return _n("Polski"); d814: 80 ed ldi r24, 0xD0 ; 208 d816: 93 e6 ldi r25, 0x63 ; 99 d818: 08 95 ret #ifdef COMMUNITY_LANGUAGE_SUPPORT //Community language support #ifdef COMMUNITY_LANG_GROUP1_NL case LANG_CODE_NL: return _n("Nederlands"); //community Dutch contribution d81a: 85 ec ldi r24, 0xC5 ; 197 d81c: 93 e6 ldi r25, 0x63 ; 99 d81e: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_NL #ifdef COMMUNITY_LANG_GROUP1_SV case LANG_CODE_SV: return _n("Svenska"); //community Swedish contribution d820: 8d eb ldi r24, 0xBD ; 189 d822: 93 e6 ldi r25, 0x63 ; 99 d824: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_SV #ifdef COMMUNITY_LANG_GROUP1_NO case LANG_CODE_NO: return _n("Norsk"); //community Swedish contribution d826: 87 eb ldi r24, 0xB7 ; 183 d828: 93 e6 ldi r25, 0x63 ; 99 d82a: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_NO #ifdef COMMUNITY_LANG_GROUP1_DA case LANG_CODE_DA: return _n("Dansk"); //community Danish contribution #endif // COMMUNITY_LANG_GROUP1_DA #ifdef COMMUNITY_LANG_GROUP1_SK case LANG_CODE_SK: return _n("Slovencina"); //community Slovak contribution d82c: 8c ea ldi r24, 0xAC ; 172 d82e: 93 e6 ldi r25, 0x63 ; 99 d830: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_SK #ifdef COMMUNITY_LANG_GROUP1_SL case LANG_CODE_SL: return _n("Slovenscina"); //community Slovanian contribution #endif // COMMUNITY_LANG_GROUP1_SL #ifdef COMMUNITY_LANG_GROUP1_HU case LANG_CODE_HU: return _n("Magyar"); //community Hungarian contribution d832: 85 ea ldi r24, 0xA5 ; 165 d834: 93 e6 ldi r25, 0x63 ; 99 d836: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_HU #ifdef COMMUNITY_LANG_GROUP1_LB case LANG_CODE_LB: return _n("Letzebuergesch"); //community Luxembourgish contribution #endif // COMMUNITY_LANG_GROUP1_LB #ifdef COMMUNITY_LANG_GROUP1_HR case LANG_CODE_HR: return _n("Hrvatski"); //community Croatian contribution d838: 8c e9 ldi r24, 0x9C ; 156 d83a: 93 e6 ldi r25, 0x63 ; 99 d83c: 08 95 ret const char* lang_get_name_by_code(uint16_t code) { switch (code) { case LANG_CODE_EN: return _n("English"); d83e: 81 e0 ldi r24, 0x01 ; 1 d840: 94 e6 ldi r25, 0x64 ; 100 // case LANG_CODE_QR: return _n("New language"); //community contribution //#endif // COMMUNITY_LANG_GROUP1_QR #endif // COMMUNITY_LANGUAGE_SUPPORT } return _n("??"); } d842: 08 95 ret 0000d844 : return (sum == lt_sum); } uint8_t lang_get_count() { if (pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE))) == 0xffffffff) d844: e3 e5 ldi r30, 0x53 ; 83 d846: f4 e7 ldi r31, 0x74 ; 116 d848: 85 91 lpm r24, Z+ d84a: 95 91 lpm r25, Z+ d84c: a5 91 lpm r26, Z+ d84e: b4 91 lpm r27, Z d850: 8f 3f cpi r24, 0xFF ; 255 d852: 9f 4f sbci r25, 0xFF ; 255 d854: af 4f sbci r26, 0xFF ; 255 d856: bf 4f sbci r27, 0xFF ; 255 d858: b1 f0 breq .+44 ; 0xd886 if (header.magic != LANG_MAGIC) break; //break if magic not valid addr += header.size; //calc address of next table count++; //inc counter } #else //XFLASH uint16_t table = _SEC_LANG_TABLE; d85a: 20 e0 ldi r18, 0x00 ; 0 d85c: 31 e0 ldi r19, 0x01 ; 1 uint8_t count = 1; //count = 1 (primary) d85e: 81 e0 ldi r24, 0x01 ; 1 while (pgm_read_dword(((uint32_t*)table)) == LANG_MAGIC) //magic valid d860: f9 01 movw r30, r18 d862: 45 91 lpm r20, Z+ d864: 55 91 lpm r21, Z+ d866: 65 91 lpm r22, Z+ d868: 74 91 lpm r23, Z d86a: 45 3a cpi r20, 0xA5 ; 165 d86c: 5a 45 sbci r21, 0x5A ; 90 d86e: 64 4b sbci r22, 0xB4 ; 180 d870: 7b 44 sbci r23, 0x4B ; 75 d872: 09 f0 breq .+2 ; 0xd876 d874: 08 95 ret { table += pgm_read_word((uint16_t*)(table + 4)); d876: f9 01 movw r30, r18 d878: 34 96 adiw r30, 0x04 ; 4 d87a: 45 91 lpm r20, Z+ d87c: 54 91 lpm r21, Z d87e: 24 0f add r18, r20 d880: 35 1f adc r19, r21 count++; d882: 8f 5f subi r24, 0xFF ; 255 d884: ed cf rjmp .-38 ; 0xd860 } uint8_t lang_get_count() { if (pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE))) == 0xffffffff) return 1; //signature not set - only primary language will be available d886: 81 e0 ldi r24, 0x01 ; 1 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return count; } d888: 08 95 ret 0000d88a : return s + 2;//zero length string == not translated, return orig. str. return (const char*)((char*)lang_table + ui); //return calculated pointer } uint8_t lang_select(uint8_t lang) { d88a: 0f 93 push r16 d88c: 1f 93 push r17 if (lang == LANG_ID_PRI) //primary language d88e: 81 11 cpse r24, r1 d890: 13 c0 rjmp .+38 ; 0xd8b8 { lang_table = 0; d892: 10 92 2e 03 sts 0x032E, r1 ; 0x80032e d896: 10 92 2d 03 sts 0x032D, r1 ; 0x80032d lang_selected = lang; d89a: 10 92 2f 03 sts 0x032F, r1 ; 0x80032f lang_selected = lang; // set language id } } } #endif //XFLASH if (lang_selected == lang) d89e: 90 91 2f 03 lds r25, 0x032F ; 0x80032f d8a2: 98 13 cpse r25, r24 d8a4: 5c c0 rjmp .+184 ; 0xd95e d8a6: 68 2f mov r22, r24 { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); d8a8: 8e ef ldi r24, 0xFE ; 254 d8aa: 9f e0 ldi r25, 0x0F ; 15 d8ac: 0f 94 00 a0 call 0x34000 ; 0x34000 return 1; d8b0: 81 e0 ldi r24, 0x01 ; 1 } return 0; } d8b2: 1f 91 pop r17 d8b4: 0f 91 pop r16 d8b6: 08 95 ret lang_selected = lang; // set language id } } } #else //XFLASH if (lang == LANG_ID_SEC) d8b8: 81 30 cpi r24, 0x01 ; 1 d8ba: 89 f7 brne .-30 ; 0xd89e { uint16_t table = _SEC_LANG_TABLE; if (pgm_read_dword(((uint32_t*)table)) == LANG_MAGIC) //magic valid d8bc: e0 e0 ldi r30, 0x00 ; 0 d8be: f1 e0 ldi r31, 0x01 ; 1 d8c0: 45 91 lpm r20, Z+ d8c2: 55 91 lpm r21, Z+ d8c4: 65 91 lpm r22, Z+ d8c6: 74 91 lpm r23, Z d8c8: 45 3a cpi r20, 0xA5 ; 165 d8ca: 5a 45 sbci r21, 0x5A ; 90 d8cc: 64 4b sbci r22, 0xB4 ; 180 d8ce: 7b 44 sbci r23, 0x4B ; 75 d8d0: 31 f7 brne .-52 ; 0xd89e } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; uint16_t size = pgm_read_word((uint16_t*)(addr + 4)); d8d2: e4 e0 ldi r30, 0x04 ; 4 d8d4: f1 e0 ldi r31, 0x01 ; 1 d8d6: a5 91 lpm r26, Z+ d8d8: b4 91 lpm r27, Z uint16_t lt_sum = pgm_read_word((uint16_t*)(addr + 8)); d8da: e8 e0 ldi r30, 0x08 ; 8 d8dc: f1 e0 ldi r31, 0x01 ; 1 d8de: 65 91 lpm r22, Z+ d8e0: 74 91 lpm r23, Z uint16_t i; for (i = 0; i < size; i++) d8e2: 50 e0 ldi r21, 0x00 ; 0 d8e4: 40 e0 ldi r20, 0x00 ; 0 return 0; } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; d8e6: 30 e0 ldi r19, 0x00 ; 0 d8e8: 20 e0 ldi r18, 0x00 ; 0 uint16_t size = pgm_read_word((uint16_t*)(addr + 4)); uint16_t lt_sum = pgm_read_word((uint16_t*)(addr + 8)); uint16_t i; for (i = 0; i < size; i++) d8ea: a4 17 cp r26, r20 d8ec: b5 07 cpc r27, r21 d8ee: 29 f5 brne .+74 ; 0xd93a sum += (uint16_t)pgm_read_byte((uint8_t*)(addr + i)) << ((i & 1)?0:8); sum -= lt_sum; //subtract checksum d8f0: 26 1b sub r18, r22 d8f2: 37 0b sbc r19, r23 sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes d8f4: 32 27 eor r19, r18 d8f6: 23 27 eor r18, r19 d8f8: 32 27 eor r19, r18 if (lang == LANG_ID_SEC) { uint16_t table = _SEC_LANG_TABLE; if (pgm_read_dword(((uint32_t*)table)) == LANG_MAGIC) //magic valid { if (lang_check(table)) d8fa: 62 17 cp r22, r18 d8fc: 73 07 cpc r23, r19 d8fe: 09 f0 breq .+2 ; 0xd902 d900: ce cf rjmp .-100 ; 0xd89e if (pgm_read_dword(((uint32_t*)(table + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid d902: ec e0 ldi r30, 0x0C ; 12 d904: f1 e0 ldi r31, 0x01 ; 1 d906: 05 91 lpm r16, Z+ d908: 15 91 lpm r17, Z+ d90a: 25 91 lpm r18, Z+ d90c: 34 91 lpm r19, Z d90e: e3 e5 ldi r30, 0x53 ; 83 d910: f4 e7 ldi r31, 0x74 ; 116 d912: 45 91 lpm r20, Z+ d914: 55 91 lpm r21, Z+ d916: 65 91 lpm r22, Z+ d918: 74 91 lpm r23, Z d91a: 04 17 cp r16, r20 d91c: 15 07 cpc r17, r21 d91e: 26 07 cpc r18, r22 d920: 37 07 cpc r19, r23 d922: 09 f0 breq .+2 ; 0xd926 d924: bc cf rjmp .-136 ; 0xd89e { lang_table = (lang_table_t*)table; // set table pointer d926: 20 e0 ldi r18, 0x00 ; 0 d928: 31 e0 ldi r19, 0x01 ; 1 d92a: 30 93 2e 03 sts 0x032E, r19 ; 0x80032e d92e: 20 93 2d 03 sts 0x032D, r18 ; 0x80032d lang_selected = lang; // set language id d932: 91 e0 ldi r25, 0x01 ; 1 d934: 90 93 2f 03 sts 0x032F, r25 ; 0x80032f d938: b2 cf rjmp .-156 ; 0xd89e { uint16_t sum = 0; uint16_t size = pgm_read_word((uint16_t*)(addr + 4)); uint16_t lt_sum = pgm_read_word((uint16_t*)(addr + 8)); uint16_t i; for (i = 0; i < size; i++) sum += (uint16_t)pgm_read_byte((uint8_t*)(addr + i)) << ((i & 1)?0:8); d93a: fa 01 movw r30, r20 d93c: e0 50 subi r30, 0x00 ; 0 d93e: ff 4f sbci r31, 0xFF ; 255 d940: e4 91 lpm r30, Z d942: f0 e0 ldi r31, 0x00 ; 0 d944: 98 e0 ldi r25, 0x08 ; 8 d946: 40 fd sbrc r20, 0 d948: 90 e0 ldi r25, 0x00 ; 0 d94a: 02 c0 rjmp .+4 ; 0xd950 d94c: ee 0f add r30, r30 d94e: ff 1f adc r31, r31 d950: 9a 95 dec r25 d952: e2 f7 brpl .-8 ; 0xd94c d954: 2e 0f add r18, r30 d956: 3f 1f adc r19, r31 uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; uint16_t size = pgm_read_word((uint16_t*)(addr + 4)); uint16_t lt_sum = pgm_read_word((uint16_t*)(addr + 8)); uint16_t i; for (i = 0; i < size; i++) d958: 4f 5f subi r20, 0xFF ; 255 d95a: 5f 4f sbci r21, 0xFF ; 255 d95c: c6 cf rjmp .-116 ; 0xd8ea if (lang_selected == lang) { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); return 1; } return 0; d95e: 80 e0 ldi r24, 0x00 ; 0 d960: a8 cf rjmp .-176 ; 0xd8b2 0000d962 : //lang_table pointer lang_table_t* lang_table = 0; const char* lang_get_translation(const char* s) { if (lang_selected == 0) return s + 2; //primary language selected, return orig. str. d962: 20 91 2f 03 lds r18, 0x032F ; 0x80032f d966: 21 11 cpse r18, r1 d968: 04 c0 rjmp .+8 ; 0xd972 d96a: fc 01 movw r30, r24 d96c: 32 96 adiw r30, 0x02 ; 2 if (ui == 0xffff) return s + 2; //id not assigned, return orig. str. ui = pgm_read_word(((uint16_t*)(((char*)lang_table + 16 + ui*2)))); //read relative offset if (pgm_read_byte(((uint8_t*)((char*)lang_table + ui))) == 0) //read first character return s + 2;//zero length string == not translated, return orig. str. return (const char*)((char*)lang_table + ui); //return calculated pointer } d96e: cf 01 movw r24, r30 d970: 08 95 ret lang_table_t* lang_table = 0; const char* lang_get_translation(const char* s) { if (lang_selected == 0) return s + 2; //primary language selected, return orig. str. if (lang_table == 0) return s + 2; //sec. lang table not found, return orig. str. d972: 40 91 2d 03 lds r20, 0x032D ; 0x80032d d976: 50 91 2e 03 lds r21, 0x032E ; 0x80032e d97a: 41 15 cp r20, r1 d97c: 51 05 cpc r21, r1 d97e: a9 f3 breq .-22 ; 0xd96a uint16_t ui = pgm_read_word(((uint16_t*)s)); //read string id d980: fc 01 movw r30, r24 d982: 25 91 lpm r18, Z+ d984: 34 91 lpm r19, Z if (ui == 0xffff) return s + 2; //id not assigned, return orig. str. d986: 2f 3f cpi r18, 0xFF ; 255 d988: 32 07 cpc r19, r18 d98a: 79 f3 breq .-34 ; 0xd96a ui = pgm_read_word(((uint16_t*)(((char*)lang_table + 16 + ui*2)))); //read relative offset d98c: f9 01 movw r30, r18 d98e: 38 96 adiw r30, 0x08 ; 8 d990: ee 0f add r30, r30 d992: ff 1f adc r31, r31 d994: e4 0f add r30, r20 d996: f5 1f adc r31, r21 d998: 25 91 lpm r18, Z+ d99a: 34 91 lpm r19, Z if (pgm_read_byte(((uint8_t*)((char*)lang_table + ui))) == 0) //read first character d99c: fa 01 movw r30, r20 d99e: e2 0f add r30, r18 d9a0: f3 1f adc r31, r19 d9a2: 24 91 lpm r18, Z d9a4: 22 23 and r18, r18 d9a6: 09 f3 breq .-62 ; 0xd96a d9a8: e2 cf rjmp .-60 ; 0xd96e 0000d9aa : } sound_wait_for_user_reset(); } void M600_load_filament_movements(const char* filament_name) { d9aa: cf 93 push r28 d9ac: df 93 push r29 d9ae: ec 01 movw r28, r24 current_position[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED; d9b0: 20 e0 ldi r18, 0x00 ; 0 d9b2: 30 e0 ldi r19, 0x00 ; 0 d9b4: 4c e8 ldi r20, 0x8C ; 140 d9b6: 52 e4 ldi r21, 0x42 ; 66 d9b8: 60 91 01 12 lds r22, 0x1201 ; 0x801201 d9bc: 70 91 02 12 lds r23, 0x1202 ; 0x801202 d9c0: 80 91 03 12 lds r24, 0x1203 ; 0x801203 d9c4: 90 91 04 12 lds r25, 0x1204 ; 0x801204 d9c8: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> d9cc: 60 93 01 12 sts 0x1201, r22 ; 0x801201 d9d0: 70 93 02 12 sts 0x1202, r23 ; 0x801202 d9d4: 80 93 03 12 sts 0x1203, r24 ; 0x801203 d9d8: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); d9dc: 60 e0 ldi r22, 0x00 ; 0 d9de: 70 e0 ldi r23, 0x00 ; 0 d9e0: 80 ea ldi r24, 0xA0 ; 160 d9e2: 91 e4 ldi r25, 0x41 ; 65 d9e4: 0f 94 70 84 call 0x308e0 ; 0x308e0 load_filament_final_feed(); d9e8: 0e 94 75 5e call 0xbcea ; 0xbcea } void lcd_loading_filament(const char* filament_name) { lcd_clear(); d9ec: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_puts_at_P(0, 0, _T(MSG_LOADING_FILAMENT)); d9f0: 82 e0 ldi r24, 0x02 ; 2 d9f2: 9a e5 ldi r25, 0x5A ; 90 d9f4: 0e 94 b1 6c call 0xd962 ; 0xd962 d9f8: ac 01 movw r20, r24 d9fa: 60 e0 ldi r22, 0x00 ; 0 d9fc: 80 e0 ldi r24, 0x00 ; 0 d9fe: 0e 94 8f 69 call 0xd31e ; 0xd31e if (filament_name[0]) { da02: 88 81 ld r24, Y da04: 88 23 and r24, r24 da06: 39 f0 breq .+14 ; 0xda16 lcd_set_cursor(0, 1); da08: 61 e0 ldi r22, 0x01 ; 1 da0a: 80 e0 ldi r24, 0x00 ; 0 da0c: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_print(filament_name); da10: ce 01 movw r24, r28 da12: 0e 94 82 6b call 0xd704 ; 0xd704 } lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); da16: 85 e6 ldi r24, 0x65 ; 101 da18: 99 e3 ldi r25, 0x39 ; 57 da1a: 0e 94 b1 6c call 0xd962 ; 0xd962 da1e: ac 01 movw r20, r24 da20: 62 e0 ldi r22, 0x02 ; 2 da22: 80 e0 ldi r24, 0x00 ; 0 da24: 0e 94 8f 69 call 0xd31e ; 0xd31e uint16_t slow_seq_time = (FILAMENTCHANGE_FINALFEED * 1000ul) / FILAMENTCHANGE_EFEED_FINAL; uint16_t fast_seq_time = (FILAMENTCHANGE_FIRSTFEED * 1000ul) / FILAMENTCHANGE_EFEED_FIRST; lcd_loading_progress_bar(slow_seq_time + fast_seq_time); //show progress bar for total time of filament loading fast + slow sequence da28: 83 e4 ldi r24, 0x43 ; 67 da2a: 9b e2 ldi r25, 0x2B ; 43 da2c: 0f 94 0b 0c call 0x21816 ; 0x21816 lcd_loading_filament(filament_name); st_synchronize(); } da30: df 91 pop r29 da32: cf 91 pop r28 { current_position[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED; plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); load_filament_final_feed(); lcd_loading_filament(filament_name); st_synchronize(); da34: 0d 94 42 22 jmp 0x24484 ; 0x24484 0000da38 : * A fullscreen message showing "Unloading Filament x" * should be shown on the LCD and LCD updates should be * are disabled in the meantime. */ static void mmu_M600_unload_filament() { if (MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN) return; da38: 0f 94 92 41 call 0x28324 ; 0x28324 da3c: 8f 3f cpi r24, 0xFF ; 255 da3e: 11 f1 breq .+68 ; 0xda84 lcd_update_enable(false); da40: 80 e0 ldi r24, 0x00 ; 0 da42: 0e 94 c0 69 call 0xd380 ; 0xd380 lcd_clear(); da46: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_puts_at_P(0, 1, _T(MSG_UNLOADING_FILAMENT)); da4a: 8e e5 ldi r24, 0x5E ; 94 da4c: 96 e5 ldi r25, 0x56 ; 86 da4e: 0e 94 b1 6c call 0xd962 ; 0xd962 da52: ac 01 movw r20, r24 da54: 61 e0 ldi r22, 0x01 ; 1 da56: 80 e0 ldi r24, 0x00 ; 0 da58: 0e 94 8f 69 call 0xd31e ; 0xd31e } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); da5c: 80 e2 ldi r24, 0x20 ; 32 da5e: 0e 94 2a 6a call 0xd454 ; 0xd454 lcd_print(' '); lcd_print(MMU2::mmu2.get_current_tool() + 1); da62: 0f 94 92 41 call 0x28324 ; 0x28324 da66: 68 2f mov r22, r24 da68: 70 e0 ldi r23, 0x00 ; 0 da6a: 6f 5f subi r22, 0xFF ; 255 da6c: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); da6e: 07 2e mov r0, r23 da70: 00 0c add r0, r0 da72: 88 0b sbc r24, r24 da74: 99 0b sbc r25, r25 da76: 0e 94 34 6b call 0xd668 ; 0xd668 // unload just current filament for multimaterial printers (used also in M702) MMU2::mmu2.unload(); da7a: 0f 94 93 6a call 0x2d526 ; 0x2d526 lcd_update_enable(true); da7e: 81 e0 ldi r24, 0x01 ; 1 da80: 0c 94 c0 69 jmp 0xd380 ; 0xd380 } da84: 08 95 ret 0000da86 <__vector_23>: /// that may further reduce the CPU cycles required by the bed heating automaton /// Due to the nature of bed heating the reduced PID precision may not be a major issue, however doing 8x less ISR(timer0_ovf) may significantly improve the performance static const uint8_t slowInc = 1; ISR(TIMER0_OVF_vect) // timer compare interrupt service routine { da86: 1f 92 push r1 da88: 0f 92 push r0 da8a: 0f b6 in r0, 0x3f ; 63 da8c: 0f 92 push r0 da8e: 11 24 eor r1, r1 da90: 0b b6 in r0, 0x3b ; 59 da92: 0f 92 push r0 da94: 2f 93 push r18 da96: 8f 93 push r24 da98: 9f 93 push r25 da9a: ef 93 push r30 da9c: ff 93 push r31 switch(state){ da9e: e0 91 28 03 lds r30, 0x0328 ; 0x800328 daa2: e8 30 cpi r30, 0x08 ; 8 daa4: e8 f4 brcc .+58 ; 0xdae0 <__vector_23+0x5a> daa6: f0 e0 ldi r31, 0x00 ; 0 daa8: 88 27 eor r24, r24 daaa: e6 5a subi r30, 0xA6 ; 166 daac: f2 49 sbci r31, 0x92 ; 146 daae: 8f 4f sbci r24, 0xFF ; 255 dab0: 0d 94 ec a0 jmp 0x341d8 ; 0x341d8 <__tablejump2__> dab4: 62 6d ori r22, 0xD2 ; 210 dab6: 7c 6d ori r23, 0xDC ; 220 dab8: 87 6d ori r24, 0xD7 ; 215 daba: 95 6d ori r25, 0xD5 ; 213 dabc: ab 6d ori r26, 0xDB ; 219 dabe: b4 6d ori r27, 0xD4 ; 212 dac0: d7 6d ori r29, 0xD7 ; 215 dac2: e9 6d ori r30, 0xD9 ; 217 case States::ZERO_START: if (bedPWMDisabled) return; // stay in the OFF state and do not change the output pin dac4: 80 91 92 06 lds r24, 0x0692 ; 0x800692 dac8: 81 11 cpse r24, r1 daca: 0a c0 rjmp .+20 ; 0xdae0 <__vector_23+0x5a> pwm = soft_pwm_bed << 1;// expecting soft_pwm_bed to be 7bit! dacc: 80 91 5b 06 lds r24, 0x065B ; 0x80065b dad0: 88 0f add r24, r24 dad2: 80 93 27 03 sts 0x0327, r24 ; 0x800327 if( pwm != 0 ){ dad6: 88 23 and r24, r24 dad8: 19 f0 breq .+6 ; 0xdae0 <__vector_23+0x5a> state = States::ZERO; // do nothing, let it tick once again after the 30Hz period dada: 81 e0 ldi r24, 0x01 ; 1 // In any case update our cache of pwm value for the next whole cycle from soft_pwm_bed slowCounter += slowInc; // this does software timer_clk/256 or less (depends on slowInc) if( slowCounter > pwm ){ return; } // otherwise moving towards RISE state = States::ZERO_TO_RISE; // and finalize the change in a transitional state RISE0 dadc: 80 93 28 03 sts 0x0328, r24 ; 0x800328 TCNT0 = 128; OCR0B = 255; TCCR0B = (1 << CS01); // change prescaler to 8, i.e. 7.8kHz break; } } dae0: ff 91 pop r31 dae2: ef 91 pop r30 dae4: 9f 91 pop r25 dae6: 8f 91 pop r24 dae8: 2f 91 pop r18 daea: 0f 90 pop r0 daec: 0b be out 0x3b, r0 ; 59 daee: 0f 90 pop r0 daf0: 0f be out 0x3f, r0 ; 63 daf2: 0f 90 pop r0 daf4: 1f 90 pop r1 daf6: 18 95 reti state = States::ZERO; // do nothing, let it tick once again after the 30Hz period } break; case States::ZERO: // end of state ZERO - we'll either stay in ZERO or change to RISE // In any case update our cache of pwm value for the next whole cycle from soft_pwm_bed slowCounter += slowInc; // this does software timer_clk/256 or less (depends on slowInc) daf8: 80 91 26 03 lds r24, 0x0326 ; 0x800326 dafc: 8f 5f subi r24, 0xFF ; 255 dafe: 80 93 26 03 sts 0x0326, r24 ; 0x800326 if( slowCounter > pwm ){ db02: 90 91 27 03 lds r25, 0x0327 ; 0x800327 db06: 98 17 cp r25, r24 db08: 58 f3 brcs .-42 ; 0xdae0 <__vector_23+0x5a> return; } // otherwise moving towards RISE state = States::ZERO_TO_RISE; // and finalize the change in a transitional state RISE0 db0a: 82 e0 ldi r24, 0x02 ; 2 db0c: e7 cf rjmp .-50 ; 0xdadc <__vector_23+0x56> // even though it may look like the ZERO state may be glued together with the ZERO_TO_RISE, don't do it // the timer must tick once more in order to get rid of occasional output pin toggles. case States::ZERO_TO_RISE: // special state for handling transition between prescalers and switching inverted->non-inverted fast-PWM without toggling the output pin. // It must be done in consequent steps, otherwise the pin will get flipped up and down during one PWM cycle. // Also beware of the correct sequence of the following timer control registers initialization - it really matters! state = States::RISE; // prepare for standard RISE cycles db0e: 83 e0 ldi r24, 0x03 ; 3 db10: 80 93 28 03 sts 0x0328, r24 ; 0x800328 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE db14: 8f e0 ldi r24, 0x0F ; 15 db16: 80 93 25 03 sts 0x0325, r24 ; 0x800325 TCNT0 = 255; // force overflow on the next clock cycle db1a: 8f ef ldi r24, 0xFF ; 255 db1c: 86 bd out 0x26, r24 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz db1e: 81 e0 ldi r24, 0x01 ; 1 db20: 85 bd out 0x25, r24 ; 37 TCCR0A &= ~(1 << COM0B0); // Clear OC0B on Compare Match, set OC0B at BOTTOM (non-inverting mode) db22: 84 b5 in r24, 0x24 ; 36 db24: 8f 7e andi r24, 0xEF ; 239 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE TCNT0 = 255; // force overflow on the next clock cycle TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz // must switch to inverting mode already here, because it takes a whole PWM cycle and it would make a "1" at the end of this pwm cycle // COM0B1 remains set both in inverting and non-inverting mode TCCR0A |= (1 << COM0B0); // inverting mode db26: 84 bd out 0x24, r24 ; 36 db28: db cf rjmp .-74 ; 0xdae0 <__vector_23+0x5a> TCNT0 = 255; // force overflow on the next clock cycle TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz TCCR0A &= ~(1 << COM0B0); // Clear OC0B on Compare Match, set OC0B at BOTTOM (non-inverting mode) break; case States::RISE: OCR0B = (fastMax - fastCounter) << fastShift; db2a: 80 91 25 03 lds r24, 0x0325 ; 0x800325 db2e: 82 95 swap r24 db30: 80 7f andi r24, 0xF0 ; 240 db32: 81 95 neg r24 db34: 88 bd out 0x28, r24 ; 40 if( fastCounter ){ db36: 80 91 25 03 lds r24, 0x0325 ; 0x800325 db3a: 88 23 and r24, r24 db3c: 21 f0 breq .+8 ; 0xdb46 <__vector_23+0xc0> break; case States::FALL: OCR0B = (fastMax - fastCounter) << fastShift; // this is the same as in RISE, because now we are setting the zero part of duty due to inverting mode //TCCR0A |= (1 << COM0B0); // already set in ONE_TO_FALL if( fastCounter ){ --fastCounter; db3e: 81 50 subi r24, 0x01 ; 1 db40: 80 93 25 03 sts 0x0325, r24 ; 0x800325 db44: cd cf rjmp .-102 ; 0xdae0 <__vector_23+0x5a> case States::RISE: OCR0B = (fastMax - fastCounter) << fastShift; if( fastCounter ){ --fastCounter; } else { // end of RISE cycles, changing into state ONE state = States::RISE_TO_ONE; db46: 84 e0 ldi r24, 0x04 ; 4 db48: 80 93 28 03 sts 0x0328, r24 ; 0x800328 OCR0B = 255; // full duty db4c: 8f ef ldi r24, 0xFF ; 255 db4e: 88 bd out 0x28, r24 ; 40 TCNT0 = 254; // make the timer overflow in the next cycle db50: 8e ef ldi r24, 0xFE ; 254 db52: 86 bd out 0x26, r24 ; 38 db54: c5 cf rjmp .-118 ; 0xdae0 <__vector_23+0x5a> // @@TODO these constants are still subject to investigation } break; case States::RISE_TO_ONE: state = States::ONE; db56: 85 e0 ldi r24, 0x05 ; 5 db58: 80 93 28 03 sts 0x0328, r24 ; 0x800328 OCR0B = 255; // full duty db5c: 8f ef ldi r24, 0xFF ; 255 db5e: 88 bd out 0x28, r24 ; 40 TCNT0 = 255; // make the timer overflow in the next cycle db60: 86 bd out 0x26, r24 ; 38 break; case States::FALL_TO_ZERO: state = States::ZERO_START; // go to read new soft_pwm_bed value for the next cycle TCNT0 = 128; OCR0B = 255; TCCR0B = (1 << CS01); // change prescaler to 8, i.e. 7.8kHz db62: 82 e0 ldi r24, 0x02 ; 2 db64: 85 bd out 0x25, r24 ; 37 db66: bc cf rjmp .-136 ; 0xdae0 <__vector_23+0x5a> OCR0B = 255; // full duty TCNT0 = 255; // make the timer overflow in the next cycle TCCR0B = (1 << CS01); // change prescaler to 8, i.e. 7.8kHz break; case States::ONE: // state ONE - we'll either stay in ONE or change to FALL OCR0B = 255; db68: 2f ef ldi r18, 0xFF ; 255 db6a: 28 bd out 0x28, r18 ; 40 if (bedPWMDisabled) return; // stay in the ON state and do not change the output pin db6c: 80 91 92 06 lds r24, 0x0692 ; 0x800692 db70: 81 11 cpse r24, r1 db72: b6 cf rjmp .-148 ; 0xdae0 <__vector_23+0x5a> slowCounter += slowInc; // this does software timer_clk/256 or less db74: 80 91 26 03 lds r24, 0x0326 ; 0x800326 db78: 8f 5f subi r24, 0xFF ; 255 db7a: 80 93 26 03 sts 0x0326, r24 ; 0x800326 if( slowCounter < pwm ){ db7e: 90 91 27 03 lds r25, 0x0327 ; 0x800327 db82: 89 17 cp r24, r25 db84: 08 f4 brcc .+2 ; 0xdb88 <__vector_23+0x102> db86: ac cf rjmp .-168 ; 0xdae0 <__vector_23+0x5a> return; } if( (soft_pwm_bed << 1) >= (255 - slowInc - 1) ){ //@@TODO simplify & explain db88: 80 91 5b 06 lds r24, 0x065B ; 0x80065b db8c: 90 e0 ldi r25, 0x00 ; 0 db8e: 8f 37 cpi r24, 0x7F ; 127 db90: 91 05 cpc r25, r1 db92: 0c f0 brlt .+2 ; 0xdb96 <__vector_23+0x110> db94: a5 cf rjmp .-182 ; 0xdae0 <__vector_23+0x5a> // if slowInc==2, soft_pwm == 251 will be the first to do short drops to zero. 252 will keep full heating return; // want full duty for the next ONE cycle again - so keep on heating and just wait for the next timer ovf } // otherwise moving towards FALL state=States::FALL; db96: 86 e0 ldi r24, 0x06 ; 6 db98: 80 93 28 03 sts 0x0328, r24 ; 0x800328 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE db9c: 8f e0 ldi r24, 0x0F ; 15 db9e: 80 93 25 03 sts 0x0325, r24 ; 0x800325 TCNT0 = 255; // force overflow on the next clock cycle dba2: 26 bd out 0x26, r18 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz dba4: 81 e0 ldi r24, 0x01 ; 1 dba6: 85 bd out 0x25, r24 ; 37 // must switch to inverting mode already here, because it takes a whole PWM cycle and it would make a "1" at the end of this pwm cycle // COM0B1 remains set both in inverting and non-inverting mode TCCR0A |= (1 << COM0B0); // inverting mode dba8: 84 b5 in r24, 0x24 ; 36 dbaa: 80 61 ori r24, 0x10 ; 16 dbac: bc cf rjmp .-136 ; 0xdb26 <__vector_23+0xa0> break; case States::FALL: OCR0B = (fastMax - fastCounter) << fastShift; // this is the same as in RISE, because now we are setting the zero part of duty due to inverting mode dbae: 80 91 25 03 lds r24, 0x0325 ; 0x800325 dbb2: 82 95 swap r24 dbb4: 80 7f andi r24, 0xF0 ; 240 dbb6: 81 95 neg r24 dbb8: 88 bd out 0x28, r24 ; 40 //TCCR0A |= (1 << COM0B0); // already set in ONE_TO_FALL if( fastCounter ){ dbba: 80 91 25 03 lds r24, 0x0325 ; 0x800325 dbbe: 81 11 cpse r24, r1 dbc0: be cf rjmp .-132 ; 0xdb3e <__vector_23+0xb8> --fastCounter; } else { // end of FALL cycles, changing into state ZERO state = States::FALL_TO_ZERO; dbc2: 87 e0 ldi r24, 0x07 ; 7 dbc4: 80 93 28 03 sts 0x0328, r24 ; 0x800328 TCNT0 = 128; //@@TODO again - need to wait long enough to propagate the timer state changes dbc8: 80 e8 ldi r24, 0x80 ; 128 dbca: 86 bd out 0x26, r24 ; 38 OCR0B = 255; dbcc: 8f ef ldi r24, 0xFF ; 255 dbce: 88 bd out 0x28, r24 ; 40 dbd0: 87 cf rjmp .-242 ; 0xdae0 <__vector_23+0x5a> } break; case States::FALL_TO_ZERO: state = States::ZERO_START; // go to read new soft_pwm_bed value for the next cycle dbd2: 10 92 28 03 sts 0x0328, r1 ; 0x800328 TCNT0 = 128; dbd6: 80 e8 ldi r24, 0x80 ; 128 dbd8: 86 bd out 0x26, r24 ; 38 OCR0B = 255; dbda: 8f ef ldi r24, 0xFF ; 255 dbdc: 88 bd out 0x28, r24 ; 40 dbde: c1 cf rjmp .-126 ; 0xdb62 <__vector_23+0xdc> 0000dbe0 : if (updateEEPROM) { eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR_ACTION_NA, (uint8_t)state); } } void Filament_sensor::settings_init_common() { dbe0: cf 93 push r28 dbe2: df 93 push r29 dbe4: ec 01 movw r28, r24 bool enabled = eeprom_read_byte((uint8_t *)EEPROM_FSENSOR); dbe6: 87 e6 ldi r24, 0x67 ; 103 dbe8: 9f e0 ldi r25, 0x0F ; 15 dbea: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 dbee: 91 e0 ldi r25, 0x01 ; 1 dbf0: 81 11 cpse r24, r1 dbf2: 01 c0 rjmp .+2 ; 0xdbf6 dbf4: 90 e0 ldi r25, 0x00 ; 0 if ((state != State::disabled) != enabled) { dbf6: 81 e0 ldi r24, 0x01 ; 1 dbf8: 28 81 ld r18, Y dbfa: 21 11 cpse r18, r1 dbfc: 01 c0 rjmp .+2 ; 0xdc00 dbfe: 80 e0 ldi r24, 0x00 ; 0 dc00: 89 13 cpse r24, r25 state = enabled ? State::initializing : State::disabled; dc02: 98 83 st Y, r25 } autoLoadEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED); dc04: 87 e0 ldi r24, 0x07 ; 7 dc06: 9f e0 ldi r25, 0x0F ; 15 dc08: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 dc0c: 91 e0 ldi r25, 0x01 ; 1 dc0e: 81 11 cpse r24, r1 dc10: 01 c0 rjmp .+2 ; 0xdc14 dc12: 90 e0 ldi r25, 0x00 ; 0 dc14: 99 83 std Y+1, r25 ; 0x01 runoutEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_RUNOUT_ENABLED); dc16: 85 ed ldi r24, 0xD5 ; 213 dc18: 9e e0 ldi r25, 0x0E ; 14 dc1a: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 dc1e: 91 e0 ldi r25, 0x01 ; 1 dc20: 81 11 cpse r24, r1 dc22: 01 c0 rjmp .+2 ; 0xdc26 dc24: 90 e0 ldi r25, 0x00 ; 0 dc26: 9a 83 std Y+2, r25 ; 0x02 sensorActionOnError = (SensorActionOnError)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_ACTION_NA); dc28: 87 e4 ldi r24, 0x47 ; 71 dc2a: 9d e0 ldi r25, 0x0D ; 13 dc2c: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 if (sensorActionOnError == SensorActionOnError::_Undef) { dc30: 8f 3f cpi r24, 0xFF ; 255 dc32: 21 f0 breq .+8 ; 0xdc3c state = enabled ? State::initializing : State::disabled; } autoLoadEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED); runoutEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_RUNOUT_ENABLED); sensorActionOnError = (SensorActionOnError)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_ACTION_NA); dc34: 88 87 std Y+8, r24 ; 0x08 if (sensorActionOnError == SensorActionOnError::_Undef) { sensorActionOnError = SensorActionOnError::_Continue; } } dc36: df 91 pop r29 dc38: cf 91 pop r28 dc3a: 08 95 ret autoLoadEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED); runoutEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_RUNOUT_ENABLED); sensorActionOnError = (SensorActionOnError)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_ACTION_NA); if (sensorActionOnError == SensorActionOnError::_Undef) { sensorActionOnError = SensorActionOnError::_Continue; dc3c: 18 86 std Y+8, r1 ; 0x08 dc3e: fb cf rjmp .-10 ; 0xdc36 0000dc40 : #else // FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { } FSensorBlockRunout::~FSensorBlockRunout() { } #endif // FILAMENT_SENSOR void Filament_sensor::setEnabled(bool enabled) { dc40: cf 93 push r28 dc42: c8 2f mov r28, r24 dc44: 68 2f mov r22, r24 dc46: 87 e6 ldi r24, 0x67 ; 103 dc48: 9f e0 ldi r25, 0x0F ; 15 dc4a: 0f 94 00 a0 call 0x34000 ; 0x34000 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR, enabled); if (enabled) { dc4e: cc 23 and r28, r28 dc50: 19 f0 breq .+6 ; 0xdc58 fsensor.init(); } else { fsensor.deinit(); } } dc52: cf 91 pop r28 #endif // FILAMENT_SENSOR void Filament_sensor::setEnabled(bool enabled) { eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR, enabled); if (enabled) { fsensor.init(); dc54: 0d 94 3e 53 jmp 0x2a67c ; 0x2a67c settings_init(); // also sets the state to State::initializing } void IR_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); SET_INPUT(IR_SENSOR_PIN); // input mode dc58: 51 98 cbi 0x0a, 1 ; 10 WRITE(IR_SENSOR_PIN, 0); // no pullup dc5a: 59 98 cbi 0x0b, 1 ; 11 state = State::disabled; dc5c: 10 92 84 16 sts 0x1684, r1 ; 0x801684 if (enabled) { fsensor.init(); } else { fsensor.deinit(); } } dc60: cf 91 pop r28 dc62: 08 95 ret 0000dc64 : #endif #endif //DEBUG_DISABLE_FANCHECK } void resetFanCheck() { fan_measuring = false; dc64: 10 92 84 03 sts 0x0384, r1 ; 0x800384 extruder_autofan_last_check = _millis(); dc68: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 dc6c: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d dc70: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e dc74: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f dc78: 90 93 90 16 sts 0x1690, r25 ; 0x801690 } dc7c: 08 95 ret 0000dc7e : void setExtruderAutoFanState(uint8_t state) { //If bit 1 is set (0x02), then the hotend fan speed won't be adjusted according to temperature. Useful for forcing //the fan to either On or Off during certain tests/errors. fanState = state; dc7e: 80 93 24 03 sts 0x0324, r24 ; 0x800324 newFanSpeed = 0; if (fanState & 0x01) dc82: 80 fd sbrc r24, 0 dc84: 1c c0 rjmp .+56 ; 0xdcbe { //If bit 1 is set (0x02), then the hotend fan speed won't be adjusted according to temperature. Useful for forcing //the fan to either On or Off during certain tests/errors. fanState = state; newFanSpeed = 0; dc86: 10 92 40 03 sts 0x0340, r1 ; 0x800340 else newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #else //EXTRUDER_ALTFAN_DETECT newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); dc8a: 20 91 40 03 lds r18, 0x0340 ; 0x800340 } #ifdef EXTRUDER_0_AUTO_FAN_PIN void timer4_set_fan0(uint8_t duty) { if (duty == 0 || duty == 255) dc8e: 8f ef ldi r24, 0xFF ; 255 dc90: 82 0f add r24, r18 dc92: 8e 3f cpi r24, 0xFE ; 254 dc94: e8 f0 brcs .+58 ; 0xdcd0 { // We use digital logic if the duty cycle is 0% or 100% TCCR4A &= ~_BV(COM4C1); dc96: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> dc9a: 87 7f andi r24, 0xF7 ; 247 dc9c: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = 0; dca0: 10 92 ad 00 sts 0x00AD, r1 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> dca4: 10 92 ac 00 sts 0x00AC, r1 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> WRITE(EXTRUDER_0_AUTO_FAN_PIN, duty); dca8: 9f b7 in r25, 0x3f ; 63 dcaa: 22 23 and r18, r18 dcac: 61 f0 breq .+24 ; 0xdcc6 dcae: f8 94 cli dcb0: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> dcb4: 80 62 ori r24, 0x20 ; 32 dcb6: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> dcba: 9f bf out 0x3f, r25 ; 63 dcbc: 08 95 ret { #ifdef EXTRUDER_ALTFAN_DETECT if (altfanStatus.isAltfan && !altfanStatus.altfanOverride) newFanSpeed = EXTRUDER_ALTFAN_SPEED_SILENT; else newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #else //EXTRUDER_ALTFAN_DETECT newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; dcbe: 8f ef ldi r24, 0xFF ; 255 dcc0: 80 93 40 03 sts 0x0340, r24 ; 0x800340 dcc4: e2 cf rjmp .-60 ; 0xdc8a dcc6: f8 94 cli dcc8: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> dccc: 8f 7d andi r24, 0xDF ; 223 dcce: f3 cf rjmp .-26 ; 0xdcb6 else { // Use the timer for fan speed. Enable the timer compare output and set the duty cycle. // This function also handles the impossible scenario of a fan speed change during a Tone. // Better be safe than sorry. CRITICAL_SECTION_START; dcd0: ef b7 in r30, 0x3f ; 63 dcd2: f8 94 cli // Enable the PWM output on the fan pin. TCCR4A |= _BV(COM4C1); dcd4: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> dcd8: 88 60 ori r24, 0x08 ; 8 dcda: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = (((uint16_t)duty) * ((uint16_t)((TIMSK4 & _BV(OCIE4A)) ? OCR4A : 255U))) / 255U; dcde: 30 e0 ldi r19, 0x00 ; 0 dce0: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> dce4: 4f ef ldi r20, 0xFF ; 255 dce6: 50 e0 ldi r21, 0x00 ; 0 dce8: 81 ff sbrs r24, 1 dcea: 04 c0 rjmp .+8 ; 0xdcf4 dcec: 40 91 a8 00 lds r20, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> dcf0: 50 91 a9 00 lds r21, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> dcf4: 24 9f mul r18, r20 dcf6: c0 01 movw r24, r0 dcf8: 25 9f mul r18, r21 dcfa: 90 0d add r25, r0 dcfc: 34 9f mul r19, r20 dcfe: 90 0d add r25, r0 dd00: 11 24 eor r1, r1 dd02: 6f ef ldi r22, 0xFF ; 255 dd04: 70 e0 ldi r23, 0x00 ; 0 dd06: 0f 94 a5 a0 call 0x3414a ; 0x3414a <__udivmodhi4> dd0a: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> dd0e: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> CRITICAL_SECTION_END; dd12: ef bf out 0x3f, r30 ; 63 #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); } dd14: 08 95 ret 0000dd16 : } #endif //EXTRUDER_ALTFAN_DETECT void checkExtruderAutoFans() { dd16: 1f 93 push r17 dd18: cf 93 push r28 dd1a: df 93 push r29 #if defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1 if (!(fanState & 0x02)) dd1c: d0 91 24 03 lds r29, 0x0324 ; 0x800324 dd20: d1 fd sbrc r29, 1 dd22: 1d c0 rjmp .+58 ; 0xdd5e temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; dd24: 10 91 9a 03 lds r17, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; dd28: c1 e0 ldi r28, 0x01 ; 1 dd2a: 20 e0 ldi r18, 0x00 ; 0 dd2c: 30 e0 ldi r19, 0x00 ; 0 dd2e: 48 e4 ldi r20, 0x48 ; 72 dd30: 52 e4 ldi r21, 0x42 ; 66 dd32: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 dd36: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 dd3a: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 dd3e: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 dd42: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> dd46: 18 16 cp r1, r24 dd48: 0c f0 brlt .+2 ; 0xdd4c dd4a: c0 e0 ldi r28, 0x00 ; 0 void checkExtruderAutoFans() { #if defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1 if (!(fanState & 0x02)) { fanState &= ~1; dd4c: de 7f andi r29, 0xFE ; 254 fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; dd4e: cd 2b or r28, r29 dd50: 81 e0 ldi r24, 0x01 ; 1 dd52: 11 11 cpse r17, r1 dd54: 01 c0 rjmp .+2 ; 0xdd58 dd56: 80 e0 ldi r24, 0x00 ; 0 fanState |= get_temp_error(); dd58: c8 2b or r28, r24 dd5a: c0 93 24 03 sts 0x0324, r28 ; 0x800324 } setExtruderAutoFanState(fanState); dd5e: 80 91 24 03 lds r24, 0x0324 ; 0x800324 #endif } dd62: df 91 pop r29 dd64: cf 91 pop r28 dd66: 1f 91 pop r17 { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; fanState |= get_temp_error(); } setExtruderAutoFanState(fanState); dd68: 0c 94 3f 6e jmp 0xdc7e ; 0xdc7e 0000dd6c : void __attribute__((noinline)) eeprom_init_default_float(float *__p, float def) { if (eeprom_read_dword((uint32_t*)__p) == EEPROM_EMPTY_VALUE32) eeprom_write_float_notify(__p, def); } void __attribute__((noinline)) eeprom_init_default_block(void *__p, size_t __n, const void *def) { dd6c: ef 92 push r14 dd6e: ff 92 push r15 dd70: 0f 93 push r16 dd72: 1f 93 push r17 dd74: cf 93 push r28 dd76: df 93 push r29 dd78: ec 01 movw r28, r24 dd7a: 8b 01 movw r16, r22 dd7c: 7a 01 movw r14, r20 if (!eeprom_is_initialized_block(__p, __n)) dd7e: 0e 94 10 55 call 0xaa20 ; 0xaa20 dd82: 81 11 cpse r24, r1 dd84: 0b c0 rjmp .+22 ; 0xdd9c #endif //DEBUG_EEPROM_CHANGES } #ifndef DEBUG_EEPROM_CHANGES void eeprom_update_block_notify(const void *__src, void *__dst, size_t __n){ eeprom_update_block(__src, __dst, __n); dd86: a8 01 movw r20, r16 dd88: be 01 movw r22, r28 dd8a: c7 01 movw r24, r14 } void __attribute__((noinline)) eeprom_init_default_block(void *__p, size_t __n, const void *def) { if (!eeprom_is_initialized_block(__p, __n)) eeprom_update_block_notify(def, __p, __n); } dd8c: df 91 pop r29 dd8e: cf 91 pop r28 dd90: 1f 91 pop r17 dd92: 0f 91 pop r16 dd94: ff 90 pop r15 dd96: ef 90 pop r14 #endif //DEBUG_EEPROM_CHANGES } #ifndef DEBUG_EEPROM_CHANGES void eeprom_update_block_notify(const void *__src, void *__dst, size_t __n){ eeprom_update_block(__src, __dst, __n); dd98: 0d 94 f0 9f jmp 0x33fe0 ; 0x33fe0 } void __attribute__((noinline)) eeprom_init_default_block(void *__p, size_t __n, const void *def) { if (!eeprom_is_initialized_block(__p, __n)) eeprom_update_block_notify(def, __p, __n); } dd9c: df 91 pop r29 dd9e: cf 91 pop r28 dda0: 1f 91 pop r17 dda2: 0f 91 pop r16 dda4: ff 90 pop r15 dda6: ef 90 pop r14 dda8: 08 95 ret 0000ddaa : return def; } return val; } uint16_t __attribute__((noinline)) eeprom_init_default_word(uint16_t *__p, uint16_t def) { ddaa: 0f 93 push r16 ddac: 1f 93 push r17 ddae: cf 93 push r28 ddb0: df 93 push r29 ddb2: 8c 01 movw r16, r24 ddb4: d6 2f mov r29, r22 ddb6: c7 2f mov r28, r23 uint16_t val = eeprom_read_word(__p); ddb8: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 if (val == EEPROM_EMPTY_VALUE16) { ddbc: 8f 3f cpi r24, 0xFF ; 255 ddbe: 98 07 cpc r25, r24 ddc0: 39 f4 brne .+14 ; 0xddd0 if (active) { uint16_t previous_value = eeprom_read_word(dst); eeprom_word_notify(dst, previous_value, value, true); } #endif //DEBUG_EEPROM_CHANGES eeprom_write_word(dst, value); ddc2: 6d 2f mov r22, r29 ddc4: 7c 2f mov r23, r28 ddc6: c8 01 movw r24, r16 ddc8: 0f 94 3a a0 call 0x34074 ; 0x34074 uint16_t __attribute__((noinline)) eeprom_init_default_word(uint16_t *__p, uint16_t def) { uint16_t val = eeprom_read_word(__p); if (val == EEPROM_EMPTY_VALUE16) { eeprom_write_word_notify(__p, def); return def; ddcc: 8d 2f mov r24, r29 ddce: 9c 2f mov r25, r28 } return val; } ddd0: df 91 pop r29 ddd2: cf 91 pop r28 ddd4: 1f 91 pop r17 ddd6: 0f 91 pop r16 ddd8: 08 95 ret 0000ddda : void __attribute__((noinline)) eeprom_add_dword(uint32_t *__p, uint32_t add) { eeprom_write_dword_notify(__p, eeprom_read_dword(__p) + add); } uint8_t __attribute__((noinline)) eeprom_init_default_byte(uint8_t *__p, uint8_t def) { ddda: 0f 93 push r16 dddc: 1f 93 push r17 ddde: cf 93 push r28 dde0: 8c 01 movw r16, r24 dde2: c6 2f mov r28, r22 uint8_t val = eeprom_read_byte(__p); dde4: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 if (val == EEPROM_EMPTY_VALUE) { dde8: 8f 3f cpi r24, 0xFF ; 255 ddea: 29 f4 brne .+10 ; 0xddf6 if (active) { uint8_t previous_value = eeprom_read_byte(dst); eeprom_byte_notify(dst, previous_value, value, true); } #endif //DEBUG_EEPROM_CHANGES eeprom_write_byte(dst, value); ddec: 6c 2f mov r22, r28 ddee: c8 01 movw r24, r16 ddf0: 0f 94 24 a0 call 0x34048 ; 0x34048 uint8_t __attribute__((noinline)) eeprom_init_default_byte(uint8_t *__p, uint8_t def) { uint8_t val = eeprom_read_byte(__p); if (val == EEPROM_EMPTY_VALUE) { eeprom_write_byte_notify(__p, def); return def; ddf4: 8c 2f mov r24, r28 } return val; } ddf6: cf 91 pop r28 ddf8: 1f 91 pop r17 ddfa: 0f 91 pop r16 ddfc: 08 95 ret 0000ddfe : void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) { eeprom_write_byte_notify(__p, eeprom_read_byte(__p) + 1); } void __attribute__((noinline)) eeprom_increment_word(uint16_t *__p) { ddfe: cf 93 push r28 de00: df 93 push r29 de02: ec 01 movw r28, r24 eeprom_write_word_notify(__p, eeprom_read_word(__p) + 1); de04: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 de08: bc 01 movw r22, r24 de0a: 6f 5f subi r22, 0xFF ; 255 de0c: 7f 4f sbci r23, 0xFF ; 255 if (active) { uint16_t previous_value = eeprom_read_word(dst); eeprom_word_notify(dst, previous_value, value, true); } #endif //DEBUG_EEPROM_CHANGES eeprom_write_word(dst, value); de0e: ce 01 movw r24, r28 eeprom_write_byte_notify(__p, eeprom_read_byte(__p) + 1); } void __attribute__((noinline)) eeprom_increment_word(uint16_t *__p) { eeprom_write_word_notify(__p, eeprom_read_word(__p) + 1); } de10: df 91 pop r29 de12: cf 91 pop r28 if (active) { uint16_t previous_value = eeprom_read_word(dst); eeprom_word_notify(dst, previous_value, value, true); } #endif //DEBUG_EEPROM_CHANGES eeprom_write_word(dst, value); de14: 0d 94 3a a0 jmp 0x34074 ; 0x34074 0000de18 : void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) { de18: cf 93 push r28 de1a: df 93 push r29 de1c: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, eeprom_read_byte(__p) + 1); de1e: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 de22: 61 e0 ldi r22, 0x01 ; 1 de24: 68 0f add r22, r24 if (active) { uint8_t previous_value = eeprom_read_byte(dst); eeprom_byte_notify(dst, previous_value, value, true); } #endif //DEBUG_EEPROM_CHANGES eeprom_write_byte(dst, value); de26: ce 01 movw r24, r28 eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) { eeprom_write_byte_notify(__p, eeprom_read_byte(__p) + 1); } de28: df 91 pop r29 de2a: cf 91 pop r28 if (active) { uint8_t previous_value = eeprom_read_byte(dst); eeprom_byte_notify(dst, previous_value, value, true); } #endif //DEBUG_EEPROM_CHANGES eeprom_write_byte(dst, value); de2c: 0d 94 24 a0 jmp 0x34048 ; 0x34048 0000de30 : sheet = eeprom_next_initialized_sheet(sheet); if (sheet >= 0) eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), sheet); } bool __attribute__((noinline)) eeprom_is_sheet_initialized(uint8_t sheet_num) { return (eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base->s[sheet_num].z_offset))) != EEPROM_EMPTY_VALUE16); de30: 2b e0 ldi r18, 0x0B ; 11 de32: 82 9f mul r24, r18 de34: c0 01 movw r24, r0 de36: 11 24 eor r1, r1 de38: 80 5b subi r24, 0xB0 ; 176 de3a: 92 4f sbci r25, 0xF2 ; 242 de3c: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 de40: 21 e0 ldi r18, 0x01 ; 1 de42: 01 96 adiw r24, 0x01 ; 1 de44: 09 f4 brne .+2 ; 0xde48 de46: 20 e0 ldi r18, 0x00 ; 0 } de48: 82 2f mov r24, r18 de4a: 08 95 ret 0000de4c : //! //! @param sheet Current sheet //! @return next initialized sheet //! @retval -1 no sheet is initialized int8_t eeprom_next_initialized_sheet(int8_t sheet) { de4c: cf 93 push r28 de4e: df 93 push r29 de50: c8 2f mov r28, r24 de52: d8 e0 ldi r29, 0x08 ; 8 for (int8_t i = 0; i < static_cast(sizeof(Sheets::s)/sizeof(Sheet)); ++i) { ++sheet; de54: cf 5f subi r28, 0xFF ; 255 if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; de56: c8 30 cpi r28, 0x08 ; 8 de58: 0c f0 brlt .+2 ; 0xde5c de5a: c0 e0 ldi r28, 0x00 ; 0 if (eeprom_is_sheet_initialized(sheet)) return sheet; de5c: 8c 2f mov r24, r28 de5e: 0e 94 18 6f call 0xde30 ; 0xde30 de62: 81 11 cpse r24, r1 de64: 03 c0 rjmp .+6 ; 0xde6c de66: d1 50 subi r29, 0x01 ; 1 //! @param sheet Current sheet //! @return next initialized sheet //! @retval -1 no sheet is initialized int8_t eeprom_next_initialized_sheet(int8_t sheet) { for (int8_t i = 0; i < static_cast(sizeof(Sheets::s)/sizeof(Sheet)); ++i) de68: a9 f7 brne .-22 ; 0xde54 { ++sheet; if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; if (eeprom_is_sheet_initialized(sheet)) return sheet; } return -1; de6a: cf ef ldi r28, 0xFF ; 255 } de6c: 8c 2f mov r24, r28 de6e: df 91 pop r29 de70: cf 91 pop r28 de72: 08 95 ret 0000de74 : #endif //DEBUG_EEPROM_CHANGES } void eeprom_switch_to_next_sheet() { int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); de74: 81 ea ldi r24, 0xA1 ; 161 de76: 9d e0 ldi r25, 0x0D ; 13 de78: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 sheet = eeprom_next_initialized_sheet(sheet); de7c: 0e 94 26 6f call 0xde4c ; 0xde4c if (sheet >= 0) eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), sheet); de80: 87 fd sbrc r24, 7 de82: 05 c0 rjmp .+10 ; 0xde8e if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); de84: 68 2f mov r22, r24 de86: 81 ea ldi r24, 0xA1 ; 161 de88: 9d e0 ldi r25, 0x0D ; 13 de8a: 0d 94 00 a0 jmp 0x34000 ; 0x34000 { int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); sheet = eeprom_next_initialized_sheet(sheet); if (sheet >= 0) eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), sheet); } de8e: 08 95 ret 0000de90 : //! | 7 | Custom2 | //! //! @param[in] index //! @param[out] sheetName void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName) { de90: 0f 93 push r16 de92: 1f 93 push r17 de94: cf 93 push r28 de96: c8 2f mov r28, r24 de98: 8b 01 movw r16, r22 static_assert(8 == sizeof(SheetName),"Default sheet name needs to be adjusted."); if (index < 2) { strcpy_P(sheetName.c, PSTR("Smooth")); de9a: 66 e0 ldi r22, 0x06 ; 6 de9c: 74 e7 ldi r23, 0x74 ; 116 //! @param[out] sheetName void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName) { static_assert(8 == sizeof(SheetName),"Default sheet name needs to be adjusted."); if (index < 2) de9e: 82 30 cpi r24, 0x02 ; 2 dea0: 70 f0 brcs .+28 ; 0xdebe { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); dea2: 6f ef ldi r22, 0xFF ; 255 dea4: 73 e7 ldi r23, 0x73 ; 115 if (index < 2) { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) dea6: 84 30 cpi r24, 0x04 ; 4 dea8: 50 f0 brcs .+20 ; 0xdebe { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); deaa: 67 ef ldi r22, 0xF7 ; 247 deac: 73 e7 ldi r23, 0x73 ; 115 } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) deae: 84 30 cpi r24, 0x04 ; 4 deb0: 31 f0 breq .+12 ; 0xdebe { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) { strcpy_P(sheetName.c, PSTR("NylonPA")); deb2: 6f ee ldi r22, 0xEF ; 239 deb4: 73 e7 ldi r23, 0x73 ; 115 } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) deb6: 85 30 cpi r24, 0x05 ; 5 deb8: 11 f0 breq .+4 ; 0xdebe { strcpy_P(sheetName.c, PSTR("NylonPA")); } else { strcpy_P(sheetName.c, PSTR("Custom")); deba: 68 ee ldi r22, 0xE8 ; 232 debc: 73 e7 ldi r23, 0x73 ; 115 debe: c8 01 movw r24, r16 dec0: 0f 94 93 9d call 0x33b26 ; 0x33b26 } if (index <4 || index >5) dec4: 8c ef ldi r24, 0xFC ; 252 dec6: 8c 0f add r24, r28 dec8: 82 30 cpi r24, 0x02 ; 2 deca: 28 f0 brcs .+10 ; 0xded6 { sheetName.c[6] = '0' + ((index % 2)+1); decc: c1 70 andi r28, 0x01 ; 1 dece: cf 5c subi r28, 0xCF ; 207 ded0: f8 01 movw r30, r16 ded2: c6 83 std Z+6, r28 ; 0x06 sheetName.c[7] = '\0'; ded4: 17 82 std Z+7, r1 ; 0x07 } } ded6: cf 91 pop r28 ded8: 1f 91 pop r17 deda: 0f 91 pop r16 dedc: 08 95 ret 0000dede : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); dede: 61 e0 ldi r22, 0x01 ; 1 dee0: 80 ec ldi r24, 0xC0 ; 192 dee2: 9f e0 ldi r25, 0x0F ; 15 dee4: 0f 94 00 a0 call 0x34000 ; 0x34000 dee8: 60 e0 ldi r22, 0x00 ; 0 deea: 8f eb ldi r24, 0xBF ; 191 deec: 9f e0 ldi r25, 0x0F ; 15 deee: 0f 94 00 a0 call 0x34000 ; 0x34000 def2: 60 e0 ldi r22, 0x00 ; 0 def4: 8e eb ldi r24, 0xBE ; 190 def6: 9f e0 ldi r25, 0x0F ; 15 def8: 0f 94 00 a0 call 0x34000 ; 0x34000 defc: 60 e0 ldi r22, 0x00 ; 0 defe: 8d eb ldi r24, 0xBD ; 189 df00: 9f e0 ldi r25, 0x0F ; 15 df02: 0f 94 00 a0 call 0x34000 ; 0x34000 df06: 60 e0 ldi r22, 0x00 ; 0 df08: 8c eb ldi r24, 0xBC ; 188 df0a: 9f e0 ldi r25, 0x0F ; 15 df0c: 0d 94 00 a0 jmp 0x34000 ; 0x34000 0000df10 : { putchar((val > 9)?(val - 10 + 'a'):(val + '0')); } void print_hex_byte(uint8_t val) { df10: cf 93 push r28 df12: c8 2f mov r28, r24 print_hex_nibble(val >> 4); df14: 82 95 swap r24 df16: 8f 70 andi r24, 0x0F ; 15 df18: 0e 94 c6 5c call 0xb98c ; 0xb98c print_hex_nibble(val & 15); df1c: 8c 2f mov r24, r28 df1e: 8f 70 andi r24, 0x0F ; 15 } df20: cf 91 pop r28 } void print_hex_byte(uint8_t val) { print_hex_nibble(val >> 4); print_hex_nibble(val & 15); df22: 0c 94 c6 5c jmp 0xb98c ; 0xb98c 0000df26 : #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) df26: 40 91 cf 11 lds r20, 0x11CF ; 0x8011cf df2a: 50 91 d0 11 lds r21, 0x11D0 ; 0x8011d0 return 0; df2e: 90 e0 ldi r25, 0x00 ; 0 df30: 80 e0 ldi r24, 0x00 ; 0 #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) df32: 41 15 cp r20, r1 df34: 51 05 cpc r21, r1 df36: b1 f1 breq .+108 ; 0xdfa4 char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; for (size_t _buflen = buflen, _bufindr = bufindr;;) { df38: 20 91 cb 11 lds r18, 0x11CB ; 0x8011cb df3c: 30 91 cc 11 lds r19, 0x11CC ; 0x8011cc char lo; char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; df40: 90 e0 ldi r25, 0x00 ; 0 df42: 80 e0 ldi r24, 0x00 ; 0 for (size_t _buflen = buflen, _bufindr = bufindr;;) { if (cmdbuffer[_bufindr] == CMDBUFFER_CURRENT_TYPE_SDCARD) { df44: f9 01 movw r30, r18 df46: e2 52 subi r30, 0x22 ; 34 df48: f0 4f sbci r31, 0xF0 ; 240 df4a: a0 81 ld r26, Z df4c: a2 30 cpi r26, 0x02 ; 2 df4e: 21 f4 brne .+8 ; 0xdf58 sdlen_single.lohi.lo = cmdbuffer[_bufindr + 1]; df50: 61 81 ldd r22, Z+1 ; 0x01 sdlen_single.lohi.hi = cmdbuffer[_bufindr + 2]; df52: 72 81 ldd r23, Z+2 ; 0x02 sdlen += sdlen_single.value; df54: 86 0f add r24, r22 df56: 97 1f adc r25, r23 } if (-- _buflen == 0) df58: 41 50 subi r20, 0x01 ; 1 df5a: 51 09 sbc r21, r1 df5c: 19 f1 breq .+70 ; 0xdfa4 df5e: f9 01 movw r30, r18 df60: ef 51 subi r30, 0x1F ; 31 df62: f0 4f sbci r31, 0xF0 ; 240 break; // First skip the current command ID and iterate up to the end of the string. for (_bufindr += CMDHDRSIZE; cmdbuffer[_bufindr] != 0; ++ _bufindr) ; df64: a1 91 ld r26, Z+ df66: 9f 01 movw r18, r30 df68: 2e 5d subi r18, 0xDE ; 222 df6a: 3f 40 sbci r19, 0x0F ; 15 df6c: a1 11 cpse r26, r1 df6e: fa cf rjmp .-12 ; 0xdf64 df70: f9 01 movw r30, r18 df72: e2 52 subi r30, 0x22 ; 34 df74: f0 4f sbci r31, 0xF0 ; 240 // Second, skip the end of string null character and iterate until a nonzero command ID is found. for (++ _bufindr; _bufindr < sizeof(cmdbuffer) && cmdbuffer[_bufindr] == 0; ++ _bufindr) ; df76: 2d 3e cpi r18, 0xED ; 237 df78: a1 e0 ldi r26, 0x01 ; 1 df7a: 3a 07 cpc r19, r26 df7c: 30 f4 brcc .+12 ; 0xdf8a df7e: a1 91 ld r26, Z+ df80: a1 11 cpse r26, r1 df82: e0 cf rjmp .-64 ; 0xdf44 df84: 2f 5f subi r18, 0xFF ; 255 df86: 3f 4f sbci r19, 0xFF ; 255 df88: f6 cf rjmp .-20 ; 0xdf76 // If the end of the buffer was empty, if (_bufindr == sizeof(cmdbuffer)) { df8a: 2d 3e cpi r18, 0xED ; 237 df8c: e1 e0 ldi r30, 0x01 ; 1 df8e: 3e 07 cpc r19, r30 df90: c9 f6 brne .-78 ; 0xdf44 df92: ee ed ldi r30, 0xDE ; 222 df94: ff e0 ldi r31, 0x0F ; 15 df96: 9f 01 movw r18, r30 df98: 2e 5d subi r18, 0xDE ; 222 df9a: 3f 40 sbci r19, 0x0F ; 15 // skip to the start and find the nonzero command. for (_bufindr = 0; cmdbuffer[_bufindr] == 0; ++ _bufindr) ; df9c: a1 91 ld r26, Z+ df9e: aa 23 and r26, r26 dfa0: d1 f3 breq .-12 ; 0xdf96 dfa2: d0 cf rjmp .-96 ; 0xdf44 } } return sdlen; } dfa4: 08 95 ret 0000dfa6 : // Pop the currently processed command from the queue. // It is expected, that there is at least one command in the queue. bool cmdqueue_pop_front() { if (buflen > 0) { dfa6: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf dfaa: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 dfae: 18 16 cp r1, r24 dfb0: 19 06 cpc r1, r25 dfb2: 0c f0 brlt .+2 ; 0xdfb6 dfb4: 43 c0 rjmp .+134 ; 0xe03c SERIAL_ECHO(serial_count); SERIAL_ECHOPGM(", bufsize "); SERIAL_ECHO(sizeof(cmdbuffer)); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ if (-- buflen == 0) { dfb6: 01 97 sbiw r24, 0x01 ; 1 dfb8: 90 93 d0 11 sts 0x11D0, r25 ; 0x8011d0 dfbc: 80 93 cf 11 sts 0x11CF, r24 ; 0x8011cf dfc0: 89 2b or r24, r25 dfc2: a1 f4 brne .+40 ; 0xdfec // Empty buffer. if (serial_count == 0) dfc4: 80 91 da 0f lds r24, 0x0FDA ; 0x800fda dfc8: 90 91 db 0f lds r25, 0x0FDB ; 0x800fdb dfcc: 89 2b or r24, r25 dfce: 21 f4 brne .+8 ; 0xdfd8 // No serial communication is pending. Reset both pointers to zero. bufindw = 0; dfd0: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> dfd4: 10 92 dc 0f sts 0x0FDC, r1 ; 0x800fdc <_ZL7bufindw.lto_priv.516> bufindr = bufindw; dfd8: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> dfdc: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> dfe0: 90 93 cc 11 sts 0x11CC, r25 ; 0x8011cc dfe4: 80 93 cb 11 sts 0x11CB, r24 ; 0x8011cb SERIAL_ECHOPGM(" new command on the top: "); SERIAL_ECHO(cmdbuffer+bufindr+CMDHDRSIZE); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; dfe8: 81 e0 ldi r24, 0x01 ; 1 dfea: 08 95 ret bufindw = 0; bufindr = bufindw; } else { // There is at least one ready line in the buffer. // First skip the current command ID and iterate up to the end of the string. for (bufindr += CMDHDRSIZE; cmdbuffer[bufindr] != 0; ++ bufindr) ; dfec: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb dff0: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc dff4: 03 96 adiw r24, 0x03 ; 3 dff6: fc 01 movw r30, r24 dff8: e2 52 subi r30, 0x22 ; 34 dffa: f0 4f sbci r31, 0xF0 ; 240 dffc: 20 81 ld r18, Z dffe: 01 96 adiw r24, 0x01 ; 1 e000: 21 11 cpse r18, r1 e002: f9 cf rjmp .-14 ; 0xdff6 e004: fc 01 movw r30, r24 e006: e2 52 subi r30, 0x22 ; 34 e008: f0 4f sbci r31, 0xF0 ; 240 // Second, skip the end of string null character and iterate until a nonzero command ID is found. for (++ bufindr; bufindr < sizeof(cmdbuffer) && cmdbuffer[bufindr] == 0; ++ bufindr) ; e00a: 8d 3e cpi r24, 0xED ; 237 e00c: 21 e0 ldi r18, 0x01 ; 1 e00e: 92 07 cpc r25, r18 e010: 40 f4 brcc .+16 ; 0xe022 e012: 41 91 ld r20, Z+ e014: 9c 01 movw r18, r24 e016: 2f 5f subi r18, 0xFF ; 255 e018: 3f 4f sbci r19, 0xFF ; 255 e01a: 41 11 cpse r20, r1 e01c: e1 cf rjmp .-62 ; 0xdfe0 e01e: c9 01 movw r24, r18 e020: f4 cf rjmp .-24 ; 0xe00a // If the end of the buffer was empty, if (bufindr == sizeof(cmdbuffer)) { e022: ee ed ldi r30, 0xDE ; 222 e024: ff e0 ldi r31, 0x0F ; 15 e026: 8d 3e cpi r24, 0xED ; 237 e028: 21 e0 ldi r18, 0x01 ; 1 e02a: 92 07 cpc r25, r18 e02c: c9 f6 brne .-78 ; 0xdfe0 e02e: cf 01 movw r24, r30 e030: 8e 5d subi r24, 0xDE ; 222 e032: 9f 40 sbci r25, 0x0F ; 15 // skip to the start and find the nonzero command. for (bufindr = 0; cmdbuffer[bufindr] == 0; ++ bufindr) ; e034: 21 91 ld r18, Z+ e036: 22 23 and r18, r18 e038: d1 f3 breq .-12 ; 0xe02e e03a: d2 cf rjmp .-92 ; 0xdfe0 SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; } return false; e03c: 80 e0 ldi r24, 0x00 ; 0 } e03e: 08 95 ret 0000e040 : autostart_atmillis.start(); // reset timer } char *createFilename(char *buffer,const dir_t &p) //buffer>12characters { char *pos=buffer; e040: fc 01 movw r30, r24 for (uint8_t i = 0; i < 11; i++) e042: 20 e0 ldi r18, 0x00 ; 0 { if (p.name[i] == ' ')continue; if (i == 8) { *pos++='.'; e044: 3e e2 ldi r19, 0x2E ; 46 char *createFilename(char *buffer,const dir_t &p) //buffer>12characters { char *pos=buffer; for (uint8_t i = 0; i < 11; i++) { if (p.name[i] == ' ')continue; e046: db 01 movw r26, r22 e048: 4d 91 ld r20, X+ e04a: bd 01 movw r22, r26 e04c: 40 32 cpi r20, 0x20 ; 32 e04e: 49 f0 breq .+18 ; 0xe062 if (i == 8) e050: 28 30 cpi r18, 0x08 ; 8 e052: 11 f4 brne .+4 ; 0xe058 { *pos++='.'; e054: 30 83 st Z, r19 e056: 31 96 adiw r30, 0x01 ; 1 } *pos++=p.name[i]; e058: db 01 movw r26, r22 e05a: 11 97 sbiw r26, 0x01 ; 1 e05c: 4c 91 ld r20, X e05e: 40 83 st Z, r20 e060: 31 96 adiw r30, 0x01 ; 1 } char *createFilename(char *buffer,const dir_t &p) //buffer>12characters { char *pos=buffer; for (uint8_t i = 0; i < 11; i++) e062: 2f 5f subi r18, 0xFF ; 255 e064: 2b 30 cpi r18, 0x0B ; 11 e066: 79 f7 brne .-34 ; 0xe046 { *pos++='.'; } *pos++=p.name[i]; } *pos++=0; e068: 10 82 st Z, r1 return buffer; } e06a: 08 95 ret 0000e06c : public: int8_t readDir(dir_t* dir, char* longFilename); static bool remove(SdBaseFile* dirFile, const char* path); bool remove(); /** Set the file's current position to zero. */ void rewind() {seekSet(0);} e06c: 40 e0 ldi r20, 0x00 ; 0 e06e: 50 e0 ldi r21, 0x00 ; 0 e070: ba 01 movw r22, r20 e072: 0d 94 3f 39 jmp 0x2727e ; 0x2727e 0000e076 : class SdBaseFile { public: /** Create an instance. */ SdBaseFile() : writeError(false), type_(FAT_FILE_TYPE_CLOSED) {} SdBaseFile(const char* path, uint8_t oflag); ~SdBaseFile() {if(isOpen()) close();} e076: fc 01 movw r30, r24 e078: 23 81 ldd r18, Z+3 ; 0x03 e07a: 21 11 cpse r18, r1 e07c: 0d 94 92 6e jmp 0x2dd24 ; 0x2dd24 e080: 08 95 ret 0000e082 : M_UDRx = c; } */ static void write(uint8_t c) { if (selectedSerialPort == 0) e082: 90 91 04 05 lds r25, 0x0504 ; 0x800504 e086: 91 11 cpse r25, r1 e088: 07 c0 rjmp .+14 ; 0xe098 { while (!((M_UCSRxA) & (1 << M_UDREx))); e08a: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> e08e: 95 ff sbrs r25, 5 e090: fc cf rjmp .-8 ; 0xe08a M_UDRx = c; e092: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> e096: 08 95 ret } else if (selectedSerialPort == 1) e098: 91 30 cpi r25, 0x01 ; 1 e09a: 31 f4 brne .+12 ; 0xe0a8 { while (!((UCSR1A) & (1 << UDRE1))); e09c: 90 91 c8 00 lds r25, 0x00C8 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> e0a0: 95 ff sbrs r25, 5 e0a2: fc cf rjmp .-8 ; 0xe09c UDR1 = c; e0a4: 80 93 ce 00 sts 0x00CE, r24 ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> } } e0a8: 08 95 ret 0000e0aa : static FILE _uartout; #define uartout (&_uartout) int uart_putchar(char c, FILE *) { MYSERIAL.write(c); e0aa: 0e 94 41 70 call 0xe082 ; 0xe082 return 0; } e0ae: 90 e0 ldi r25, 0x00 ; 0 e0b0: 80 e0 ldi r24, 0x00 ; 0 e0b2: 08 95 ret 0000e0b4 : void serial_echopair_P(const char *s_P, double v) { serialprintPGM(s_P); SERIAL_ECHO(v); } void serial_echopair_P(const char *s_P, unsigned long v) { serialprintPGM(s_P); SERIAL_ECHO(v); } void serialprintPGM(const char *str) { e0b4: cf 93 push r28 e0b6: df 93 push r29 e0b8: ec 01 movw r28, r24 while(uint8_t ch = pgm_read_byte(str)) { e0ba: fe 01 movw r30, r28 e0bc: 84 91 lpm r24, Z e0be: 88 23 and r24, r24 e0c0: 21 f0 breq .+8 ; 0xe0ca MYSERIAL.write((char)ch); e0c2: 0e 94 41 70 call 0xe082 ; 0xe082 ++str; e0c6: 21 96 adiw r28, 0x01 ; 1 e0c8: f8 cf rjmp .-16 ; 0xe0ba } } e0ca: df 91 pop r29 e0cc: cf 91 pop r28 e0ce: 08 95 ret 0000e0d0 : // Turn off the print fan fanSpeed = 0; } } void serialecho_temperatures() { e0d0: cf 92 push r12 e0d2: df 92 push r13 e0d4: ef 92 push r14 e0d6: ff 92 push r15 //inline so that there is no performance decrease. //deg=degreeCelsius // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degHotend(uint8_t extruder) { return current_temperature[extruder]; e0d8: c0 90 c4 0d lds r12, 0x0DC4 ; 0x800dc4 e0dc: d0 90 c5 0d lds r13, 0x0DC5 ; 0x800dc5 e0e0: e0 90 c6 0d lds r14, 0x0DC6 ; 0x800dc6 e0e4: f0 90 c7 0d lds r15, 0x0DC7 ; 0x800dc7 float tt = degHotend(active_extruder); SERIAL_PROTOCOLPGM("T:"); e0e8: 89 e5 ldi r24, 0x59 ; 89 e0ea: 98 e7 ldi r25, 0x78 ; 120 e0ec: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); e0f0: 42 e0 ldi r20, 0x02 ; 2 e0f2: c7 01 movw r24, r14 e0f4: b6 01 movw r22, r12 e0f6: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOL(tt); SERIAL_PROTOCOLPGM(" E:0 B:"); e0fa: 81 e5 ldi r24, 0x51 ; 81 e0fc: 98 e7 ldi r25, 0x78 ; 120 e0fe: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 e102: 60 91 8a 03 lds r22, 0x038A ; 0x80038a e106: 70 91 8b 03 lds r23, 0x038B ; 0x80038b e10a: 80 91 8c 03 lds r24, 0x038C ; 0x80038c e10e: 90 91 8d 03 lds r25, 0x038D ; 0x80038d e112: 41 e0 ldi r20, 0x01 ; 1 e114: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } e118: ff 90 pop r15 e11a: ef 90 pop r14 e11c: df 90 pop r13 e11e: cf 90 pop r12 float tt = degHotend(active_extruder); SERIAL_PROTOCOLPGM("T:"); SERIAL_PROTOCOL(tt); SERIAL_PROTOCOLPGM(" E:0 B:"); SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); e120: 0d 94 fc 97 jmp 0x32ff8 ; 0x32ff8 0000e124 : } } /// @brief Helper function to reduce code size in M861 /// by extracting common code into one function static void gcode_M861_print_pinda_cal_eeprom() { e124: 4f 92 push r4 e126: 5f 92 push r5 e128: 6f 92 push r6 e12a: 7f 92 push r7 e12c: 8f 92 push r8 e12e: 9f 92 push r9 e130: af 92 push r10 e132: bf 92 push r11 e134: cf 92 push r12 e136: df 92 push r13 e138: ef 92 push r14 e13a: ff 92 push r15 e13c: 0f 93 push r16 e13e: 1f 93 push r17 e140: cf 93 push r28 e142: df 93 push r29 e144: cc 24 eor r12, r12 e146: ca 94 dec r12 e148: dc 2c mov r13, r12 e14a: 76 01 movw r14, r12 e14c: 0e ea ldi r16, 0xAE ; 174 e14e: 1f e0 ldi r17, 0x0F ; 15 e150: 93 e2 ldi r25, 0x23 ; 35 e152: 89 2e mov r8, r25 e154: 91 2c mov r9, r1 e156: a1 2c mov r10, r1 e158: b1 2c mov r11, r1 int16_t usteps = 0; float mm = 0; e15a: 41 2c mov r4, r1 e15c: 51 2c mov r5, r1 e15e: 32 01 movw r6, r4 } /// @brief Helper function to reduce code size in M861 /// by extracting common code into one function static void gcode_M861_print_pinda_cal_eeprom() { int16_t usteps = 0; e160: d0 e0 ldi r29, 0x00 ; 0 e162: c0 e0 ldi r28, 0x00 ; 0 float mm = 0; static const char comma_sep[] PROGMEM = ", "; for (uint8_t i = 0; i < 6; i++) { if(i > 0) { e164: 8f ef ldi r24, 0xFF ; 255 e166: c8 16 cp r12, r24 e168: 09 f4 brne .+2 ; 0xe16c e16a: 5d c0 rjmp .+186 ; 0xe226 usteps = eeprom_read_word((uint16_t*) EEPROM_PROBE_TEMP_SHIFT + (i - 1)); e16c: c8 01 movw r24, r16 e16e: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 e172: ec 01 movw r28, r24 mm = ((float)usteps) / cs.axis_steps_per_mm[Z_AXIS]; e174: bc 01 movw r22, r24 e176: 99 0f add r25, r25 e178: 88 0b sbc r24, r24 e17a: 99 0b sbc r25, r25 e17c: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> e180: 20 91 3e 04 lds r18, 0x043E ; 0x80043e e184: 30 91 3f 04 lds r19, 0x043F ; 0x80043f e188: 40 91 40 04 lds r20, 0x0440 ; 0x800440 e18c: 50 91 41 04 lds r21, 0x0441 ; 0x800441 e190: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> e194: 2b 01 movw r4, r22 e196: 3c 01 movw r6, r24 e198: c7 01 movw r24, r14 e19a: b6 01 movw r22, r12 e19c: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_PROTOCOL(i - 1); } else { SERIAL_PROTOCOLRPGM(MSG_NA); } SERIAL_PROTOCOLRPGM(comma_sep); e1a0: 8d ea ldi r24, 0xAD ; 173 e1a2: 97 e7 ldi r25, 0x77 ; 119 e1a4: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 e1a8: c5 01 movw r24, r10 e1aa: b4 01 movw r22, r8 e1ac: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_PROTOCOL(35 + (i * 5)); SERIAL_PROTOCOLRPGM(comma_sep); e1b0: 8d ea ldi r24, 0xAD ; 173 e1b2: 97 e7 ldi r25, 0x77 ; 119 e1b4: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); e1b8: be 01 movw r22, r28 e1ba: 0d 2e mov r0, r29 e1bc: 00 0c add r0, r0 e1be: 88 0b sbc r24, r24 e1c0: 99 0b sbc r25, r25 e1c2: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); e1c6: 8d ea ldi r24, 0xAD ; 173 e1c8: 97 e7 ldi r25, 0x77 ; 119 e1ca: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_PROTOCOLLN(mm * 1000); e1ce: 20 e0 ldi r18, 0x00 ; 0 e1d0: 30 e0 ldi r19, 0x00 ; 0 e1d2: 4a e7 ldi r20, 0x7A ; 122 e1d4: 54 e4 ldi r21, 0x44 ; 68 e1d6: c3 01 movw r24, r6 e1d8: b2 01 movw r22, r4 e1da: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> e1de: 0f 94 8d 41 call 0x2831a ; 0x2831a e1e2: 85 e0 ldi r24, 0x05 ; 5 e1e4: 88 0e add r8, r24 e1e6: 91 1c adc r9, r1 e1e8: a1 1c adc r10, r1 e1ea: b1 1c adc r11, r1 e1ec: 0e 5f subi r16, 0xFE ; 254 e1ee: 1f 4f sbci r17, 0xFF ; 255 e1f0: 8f ef ldi r24, 0xFF ; 255 e1f2: c8 1a sub r12, r24 e1f4: d8 0a sbc r13, r24 e1f6: e8 0a sbc r14, r24 e1f8: f8 0a sbc r15, r24 /// by extracting common code into one function static void gcode_M861_print_pinda_cal_eeprom() { int16_t usteps = 0; float mm = 0; static const char comma_sep[] PROGMEM = ", "; for (uint8_t i = 0; i < 6; i++) { e1fa: 0a 3b cpi r16, 0xBA ; 186 e1fc: 8f e0 ldi r24, 0x0F ; 15 e1fe: 18 07 cpc r17, r24 e200: 09 f0 breq .+2 ; 0xe204 e202: b0 cf rjmp .-160 ; 0xe164 SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOLLN(mm * 1000); } } e204: df 91 pop r29 e206: cf 91 pop r28 e208: 1f 91 pop r17 e20a: 0f 91 pop r16 e20c: ff 90 pop r15 e20e: ef 90 pop r14 e210: df 90 pop r13 e212: cf 90 pop r12 e214: bf 90 pop r11 e216: af 90 pop r10 e218: 9f 90 pop r9 e21a: 8f 90 pop r8 e21c: 7f 90 pop r7 e21e: 6f 90 pop r6 e220: 5f 90 pop r5 e222: 4f 90 pop r4 e224: 08 95 ret if(i > 0) { usteps = eeprom_read_word((uint16_t*) EEPROM_PROBE_TEMP_SHIFT + (i - 1)); mm = ((float)usteps) / cs.axis_steps_per_mm[Z_AXIS]; SERIAL_PROTOCOL(i - 1); } else { SERIAL_PROTOCOLRPGM(MSG_NA); e226: 8c e8 ldi r24, 0x8C ; 140 e228: 9d e3 ldi r25, 0x3D ; 61 e22a: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 e22e: b8 cf rjmp .-144 ; 0xe1a0 0000e230 : /// @brief load filament for mmu v2 /// @par nozzle_temp nozzle temperature to load filament static void mmu_M600_load_filament(bool automatic) { uint8_t slot; if (automatic) { e230: 88 23 and r24, r24 e232: 71 f1 breq .+92 ; 0xe290 currentMMUSlot = slot; } uint8_t SpoolJoin::nextSlot() { SERIAL_ECHOPGM("SpoolJoin: "); e234: 81 ea ldi r24, 0xA1 ; 161 e236: 97 e7 ldi r25, 0x77 ; 119 e238: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 e23c: 60 91 23 12 lds r22, 0x1223 ; 0x801223 e240: 70 e0 ldi r23, 0x00 ; 0 e242: 90 e0 ldi r25, 0x00 ; 0 e244: 80 e0 ldi r24, 0x00 ; 0 e246: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= MMU_FILAMENT_COUNT-1) currentMMUSlot = 0; e24a: 80 91 23 12 lds r24, 0x1223 ; 0x801223 e24e: 84 30 cpi r24, 0x04 ; 4 e250: d8 f0 brcs .+54 ; 0xe288 e252: 10 92 23 12 sts 0x1223, r1 ; 0x801223 else currentMMUSlot++; SERIAL_ECHOPGM(" -> "); e256: 8c e9 ldi r24, 0x9C ; 156 e258: 97 e7 ldi r25, 0x77 ; 119 e25a: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLN((int)currentMMUSlot); e25e: 80 91 23 12 lds r24, 0x1223 ; 0x801223 e262: 90 e0 ldi r25, 0x00 ; 0 e264: 0f 94 aa 41 call 0x28354 ; 0x28354 return currentMMUSlot; e268: 80 91 23 12 lds r24, 0x1223 ; 0x801223 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; e26c: 20 91 ef 11 lds r18, 0x11EF ; 0x8011ef e270: 30 91 f0 11 lds r19, 0x11F0 ; 0x8011f0 e274: 30 93 f2 11 sts 0x11F2, r19 ; 0x8011f2 e278: 20 93 f1 11 sts 0x11F1, r18 ; 0x8011f1 slot = choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT); } setTargetHotend(saved_extruder_temperature); MMU2::mmu2.load_filament_to_nozzle(slot); e27c: 0e 94 f9 f6 call 0x1edf2 ; 0x1edf2 load_filament_final_feed(); // @@TODO verify e280: 0e 94 75 5e call 0xbcea ; 0xbcea st_synchronize(); e284: 0d 94 42 22 jmp 0x24484 ; 0x24484 { SERIAL_ECHOPGM("SpoolJoin: "); SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= MMU_FILAMENT_COUNT-1) currentMMUSlot = 0; else currentMMUSlot++; e288: 8f 5f subi r24, 0xFF ; 255 e28a: 80 93 23 12 sts 0x1223, r24 ; 0x801223 e28e: e3 cf rjmp .-58 ; 0xe256 uint8_t slot; if (automatic) { slot = SpoolJoin::spooljoin.nextSlot(); } else { // Only ask for the slot if automatic/SpoolJoin is off slot = choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT); e290: 84 e2 ldi r24, 0x24 ; 36 e292: 9e e3 ldi r25, 0x3E ; 62 e294: 0e 94 b1 6c call 0xd962 ; 0xd962 e298: 70 e0 ldi r23, 0x00 ; 0 e29a: 60 e0 ldi r22, 0x00 ; 0 e29c: 0e 94 ea bc call 0x179d4 ; 0x179d4 e2a0: e5 cf rjmp .-54 ; 0xe26c 0000e2a2 : return final_result; } void gcode_M114() { e2a2: cf 93 push r28 e2a4: df 93 push r29 SERIAL_PROTOCOLPGM("X:"); e2a6: 89 e9 ldi r24, 0x99 ; 153 e2a8: 97 e7 ldi r25, 0x77 ; 119 e2aa: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_PROTOCOL(current_position[X_AXIS]); e2ae: c5 ef ldi r28, 0xF5 ; 245 e2b0: d1 e1 ldi r29, 0x11 ; 17 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); e2b2: 68 81 ld r22, Y e2b4: 79 81 ldd r23, Y+1 ; 0x01 e2b6: 8a 81 ldd r24, Y+2 ; 0x02 e2b8: 9b 81 ldd r25, Y+3 ; 0x03 e2ba: 42 e0 ldi r20, 0x02 ; 2 e2bc: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOLPGM(" Y:"); e2c0: 85 e9 ldi r24, 0x95 ; 149 e2c2: 97 e7 ldi r25, 0x77 ; 119 e2c4: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 e2c8: 6c 81 ldd r22, Y+4 ; 0x04 e2ca: 7d 81 ldd r23, Y+5 ; 0x05 e2cc: 8e 81 ldd r24, Y+6 ; 0x06 e2ce: 9f 81 ldd r25, Y+7 ; 0x07 e2d0: 42 e0 ldi r20, 0x02 ; 2 e2d2: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOL(current_position[Y_AXIS]); SERIAL_PROTOCOLPGM(" Z:"); e2d6: 81 e9 ldi r24, 0x91 ; 145 e2d8: 97 e7 ldi r25, 0x77 ; 119 e2da: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 e2de: 68 85 ldd r22, Y+8 ; 0x08 e2e0: 79 85 ldd r23, Y+9 ; 0x09 e2e2: 8a 85 ldd r24, Y+10 ; 0x0a e2e4: 9b 85 ldd r25, Y+11 ; 0x0b e2e6: 42 e0 ldi r20, 0x02 ; 2 e2e8: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOL(current_position[Z_AXIS]); SERIAL_PROTOCOLPGM(" E:"); e2ec: 8d e8 ldi r24, 0x8D ; 141 e2ee: 97 e7 ldi r25, 0x77 ; 119 e2f0: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 e2f4: 6c 85 ldd r22, Y+12 ; 0x0c e2f6: 7d 85 ldd r23, Y+13 ; 0x0d e2f8: 8e 85 ldd r24, Y+14 ; 0x0e e2fa: 9f 85 ldd r25, Y+15 ; 0x0f e2fc: 42 e0 ldi r20, 0x02 ; 2 e2fe: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOL(current_position[E_AXIS]); SERIAL_PROTOCOLRPGM(_n(" Count X: "));////MSG_COUNT_X e302: 89 e0 ldi r24, 0x09 ; 9 e304: 94 e6 ldi r25, 0x64 ; 100 e306: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_PROTOCOL(float(st_get_position(X_AXIS)) / cs.axis_steps_per_mm[X_AXIS]); e30a: 80 e0 ldi r24, 0x00 ; 0 e30c: 0f 94 20 22 call 0x24440 ; 0x24440 e310: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> e314: c2 e3 ldi r28, 0x32 ; 50 e316: d4 e0 ldi r29, 0x04 ; 4 e318: 2c 81 ldd r18, Y+4 ; 0x04 e31a: 3d 81 ldd r19, Y+5 ; 0x05 e31c: 4e 81 ldd r20, Y+6 ; 0x06 e31e: 5f 81 ldd r21, Y+7 ; 0x07 e320: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> e324: 42 e0 ldi r20, 0x02 ; 2 e326: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOLPGM(" Y:"); e32a: 89 e8 ldi r24, 0x89 ; 137 e32c: 97 e7 ldi r25, 0x77 ; 119 e32e: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_PROTOCOL(float(st_get_position(Y_AXIS)) / cs.axis_steps_per_mm[Y_AXIS]); e332: 81 e0 ldi r24, 0x01 ; 1 e334: 0f 94 20 22 call 0x24440 ; 0x24440 e338: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> e33c: 28 85 ldd r18, Y+8 ; 0x08 e33e: 39 85 ldd r19, Y+9 ; 0x09 e340: 4a 85 ldd r20, Y+10 ; 0x0a e342: 5b 85 ldd r21, Y+11 ; 0x0b e344: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> e348: 42 e0 ldi r20, 0x02 ; 2 e34a: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOLPGM(" Z:"); e34e: 85 e8 ldi r24, 0x85 ; 133 e350: 97 e7 ldi r25, 0x77 ; 119 e352: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_PROTOCOL(float(st_get_position(Z_AXIS)) / cs.axis_steps_per_mm[Z_AXIS]); e356: 82 e0 ldi r24, 0x02 ; 2 e358: 0f 94 20 22 call 0x24440 ; 0x24440 e35c: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> e360: 2c 85 ldd r18, Y+12 ; 0x0c e362: 3d 85 ldd r19, Y+13 ; 0x0d e364: 4e 85 ldd r20, Y+14 ; 0x0e e366: 5f 85 ldd r21, Y+15 ; 0x0f e368: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> e36c: 42 e0 ldi r20, 0x02 ; 2 e36e: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOLPGM(" E:"); e372: 81 e8 ldi r24, 0x81 ; 129 e374: 97 e7 ldi r25, 0x77 ; 119 e376: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_PROTOCOLLN(float(st_get_position(E_AXIS)) / cs.axis_steps_per_mm[E_AXIS]); e37a: 83 e0 ldi r24, 0x03 ; 3 e37c: 0f 94 20 22 call 0x24440 ; 0x24440 e380: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> e384: 28 89 ldd r18, Y+16 ; 0x10 e386: 39 89 ldd r19, Y+17 ; 0x11 e388: 4a 89 ldd r20, Y+18 ; 0x12 e38a: 5b 89 ldd r21, Y+19 ; 0x13 e38c: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> } e390: df 91 pop r29 e392: cf 91 pop r28 SERIAL_PROTOCOLPGM(" Y:"); SERIAL_PROTOCOL(float(st_get_position(Y_AXIS)) / cs.axis_steps_per_mm[Y_AXIS]); SERIAL_PROTOCOLPGM(" Z:"); SERIAL_PROTOCOL(float(st_get_position(Z_AXIS)) / cs.axis_steps_per_mm[Z_AXIS]); SERIAL_PROTOCOLPGM(" E:"); SERIAL_PROTOCOLLN(float(st_get_position(E_AXIS)) / cs.axis_steps_per_mm[E_AXIS]); e394: 0d 94 8d 41 jmp 0x2831a ; 0x2831a 0000e398 : #endif //TMC2130 void gcode_M105() { #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1 SERIAL_PROTOCOLPGM("T:"); e398: 80 e9 ldi r24, 0x90 ; 144 e39a: 96 e7 ldi r25, 0x76 ; 118 e39c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 e3a0: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 e3a4: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 e3a8: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 e3ac: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 e3b0: 41 e0 ldi r20, 0x01 ; 1 e3b2: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); e3b6: 8d e8 ldi r24, 0x8D ; 141 e3b8: 96 e7 ldi r25, 0x76 ; 118 e3ba: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; e3be: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 e3c2: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 e3c6: 07 2e mov r0, r23 e3c8: 00 0c add r0, r0 e3ca: 88 0b sbc r24, r24 e3cc: 99 0b sbc r25, r25 e3ce: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> e3d2: 41 e0 ldi r20, 0x01 ; 1 e3d4: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOL_F(degTargetHotend(active_extruder),1); #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 SERIAL_PROTOCOLPGM(" B:"); e3d8: 89 e8 ldi r24, 0x89 ; 137 e3da: 96 e7 ldi r25, 0x76 ; 118 e3dc: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 e3e0: 60 91 8a 03 lds r22, 0x038A ; 0x80038a e3e4: 70 91 8b 03 lds r23, 0x038B ; 0x80038b e3e8: 80 91 8c 03 lds r24, 0x038C ; 0x80038c e3ec: 90 91 8d 03 lds r25, 0x038D ; 0x80038d e3f0: 41 e0 ldi r20, 0x01 ; 1 e3f2: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOL_F(degBed(),1); SERIAL_PROTOCOLPGM(" /"); e3f6: 86 e8 ldi r24, 0x86 ; 134 e3f8: 96 e7 ldi r25, 0x76 ; 118 e3fa: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; e3fe: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed e402: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee e406: 07 2e mov r0, r23 e408: 00 0c add r0, r0 e40a: 88 0b sbc r24, r24 e40c: 99 0b sbc r25, r25 e40e: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> e412: 41 e0 ldi r20, 0x01 ; 1 e414: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOL_F(degTargetBed(),1); #endif //TEMP_BED_PIN SERIAL_PROTOCOLPGM(" T0:"); e418: 81 e8 ldi r24, 0x81 ; 129 e41a: 96 e7 ldi r25, 0x76 ; 118 e41c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 e420: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 e424: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 e428: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 e42c: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 e430: 41 e0 ldi r20, 0x01 ; 1 e432: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); e436: 8e e7 ldi r24, 0x7E ; 126 e438: 96 e7 ldi r25, 0x76 ; 118 e43a: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; e43e: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 e442: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 e446: 07 2e mov r0, r23 e448: 00 0c add r0, r0 e44a: 88 0b sbc r24, r24 e44c: 99 0b sbc r25, r25 e44e: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> e452: 41 e0 ldi r20, 0x01 ; 1 e454: 0f 94 49 97 call 0x32e92 ; 0x32e92 #else SERIAL_ERROR_START; SERIAL_ERRORLNRPGM(_n("No thermistors - no temperature"));////MSG_ERR_NO_THERMISTORS #endif SERIAL_PROTOCOLPGM(" @:"); e458: 8a e7 ldi r24, 0x7A ; 122 e45a: 96 e7 ldi r25, 0x76 ; 118 e45c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); e460: 60 91 62 06 lds r22, 0x0662 ; 0x800662 <_ZL8soft_pwm.lto_priv.506> e464: 70 e0 ldi r23, 0x00 ; 0 e466: 90 e0 ldi r25, 0x00 ; 0 e468: 80 e0 ldi r24, 0x00 ; 0 e46a: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_PROTOCOLPGM("W"); #else SERIAL_PROTOCOL(getHeaterPower(active_extruder)); #endif SERIAL_PROTOCOLPGM(" B@:"); e46e: 85 e7 ldi r24, 0x75 ; 117 e470: 96 e7 ldi r25, 0x76 ; 118 e472: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 e476: 60 91 5b 06 lds r22, 0x065B ; 0x80065b e47a: 70 e0 ldi r23, 0x00 ; 0 e47c: 90 e0 ldi r25, 0x00 ; 0 e47e: 80 e0 ldi r24, 0x00 ; 0 e480: 0f 94 a2 96 call 0x32d44 ; 0x32d44 #else SERIAL_PROTOCOL(getHeaterPower(-1)); #endif #ifdef PINDA_THERMISTOR SERIAL_PROTOCOLPGM(" P:"); e484: 81 e7 ldi r24, 0x71 ; 113 e486: 96 e7 ldi r25, 0x76 ; 118 e488: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); e48c: 60 91 8e 06 lds r22, 0x068E ; 0x80068e e490: 70 91 8f 06 lds r23, 0x068F ; 0x80068f e494: 80 91 90 06 lds r24, 0x0690 ; 0x800690 e498: 90 91 91 06 lds r25, 0x0691 ; 0x800691 e49c: 41 e0 ldi r20, 0x01 ; 1 e49e: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOL_F(100 * (1 + (PtA * (raw/OVERSAMPLENR)) + (PtB * sq((raw/OVERSAMPLENR)))), 5); SERIAL_PROTOCOLPGM(" Rx0->"); SERIAL_PROTOCOL_F(raw, 5); } #endif SERIAL_PROTOCOLLN(); e4a2: 0d 94 fc 97 jmp 0x32ff8 ; 0x32ff8 0000e4a6 : ++str; } } void serialprintlnPGM(const char *str) { serialprintPGM(str); e4a6: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 MYSERIAL.println(); e4aa: 0d 94 fc 97 jmp 0x32ff8 ; 0x32ff8 0000e4ae : /** * Output a "busy" message at regular intervals * while the machine is not accepting commands. */ void host_keepalive() { e4ae: 8f 92 push r8 e4b0: 9f 92 push r9 e4b2: af 92 push r10 e4b4: bf 92 push r11 e4b6: cf 92 push r12 e4b8: df 92 push r13 e4ba: ef 92 push r14 e4bc: ff 92 push r15 #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; long ms = _millis(); e4be: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 e4c2: 6b 01 movw r12, r22 e4c4: 7c 01 movw r14, r24 if (host_keepalive_interval && busy_state != NOT_BUSY) { e4c6: 20 91 32 02 lds r18, 0x0232 ; 0x800232 e4ca: 22 23 and r18, r18 e4cc: 09 f1 breq .+66 ; 0xe510 e4ce: 40 91 78 02 lds r20, 0x0278 ; 0x800278 e4d2: 41 30 cpi r20, 0x01 ; 1 e4d4: e9 f0 breq .+58 ; 0xe510 if ((ms - prev_busy_signal_ms) < (long)(1000L * host_keepalive_interval)) return; e4d6: 80 91 14 02 lds r24, 0x0214 ; 0x800214 e4da: 90 91 15 02 lds r25, 0x0215 ; 0x800215 e4de: a0 91 16 02 lds r26, 0x0216 ; 0x800216 e4e2: b0 91 17 02 lds r27, 0x0217 ; 0x800217 e4e6: 46 01 movw r8, r12 e4e8: 57 01 movw r10, r14 e4ea: 88 1a sub r8, r24 e4ec: 99 0a sbc r9, r25 e4ee: aa 0a sbc r10, r26 e4f0: bb 0a sbc r11, r27 e4f2: 30 e0 ldi r19, 0x00 ; 0 e4f4: a8 ee ldi r26, 0xE8 ; 232 e4f6: b3 e0 ldi r27, 0x03 ; 3 e4f8: 0f 94 7c a0 call 0x340f8 ; 0x340f8 <__umulhisi3> e4fc: 86 16 cp r8, r22 e4fe: 97 06 cpc r9, r23 e500: a8 06 cpc r10, r24 e502: b9 06 cpc r11, r25 e504: 6c f0 brlt .+26 ; 0xe520 switch (busy_state) { e506: 44 30 cpi r20, 0x04 ; 4 e508: 31 f1 breq .+76 ; 0xe556 e50a: 9c f4 brge .+38 ; 0xe532 e50c: 42 30 cpi r20, 0x02 ; 2 e50e: d4 f4 brge .+52 ; 0xe544 break; default: break; } } prev_busy_signal_ms = ms; e510: c0 92 14 02 sts 0x0214, r12 ; 0x800214 e514: d0 92 15 02 sts 0x0215, r13 ; 0x800215 e518: e0 92 16 02 sts 0x0216, r14 ; 0x800216 e51c: f0 92 17 02 sts 0x0217, r15 ; 0x800217 } e520: ff 90 pop r15 e522: ef 90 pop r14 e524: df 90 pop r13 e526: cf 90 pop r12 e528: bf 90 pop r11 e52a: af 90 pop r10 e52c: 9f 90 pop r9 e52e: 8f 90 pop r8 e530: 08 95 ret if (farm_mode) return; long ms = _millis(); if (host_keepalive_interval && busy_state != NOT_BUSY) { if ((ms - prev_busy_signal_ms) < (long)(1000L * host_keepalive_interval)) return; switch (busy_state) { e532: 45 30 cpi r20, 0x05 ; 5 e534: 69 f7 brne .-38 ; 0xe510 case PAUSED_FOR_USER: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; e536: 81 e6 ldi r24, 0x61 ; 97 e538: 9d e9 ldi r25, 0x9D ; 157 e53a: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLNPGM("busy: paused for input"); e53e: 8c e5 ldi r24, 0x5C ; 92 e540: 98 e7 ldi r25, 0x78 ; 120 e542: 06 c0 rjmp .+12 ; 0xe550 if (host_keepalive_interval && busy_state != NOT_BUSY) { if ((ms - prev_busy_signal_ms) < (long)(1000L * host_keepalive_interval)) return; switch (busy_state) { case IN_HANDLER: case IN_PROCESS: SERIAL_ECHO_START; e544: 81 e6 ldi r24, 0x61 ; 97 e546: 9d e9 ldi r25, 0x9D ; 157 e548: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLNPGM("busy: processing"); e54c: 89 e8 ldi r24, 0x89 ; 137 e54e: 98 e7 ldi r25, 0x78 ; 120 SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for input"); e550: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 e554: dd cf rjmp .-70 ; 0xe510 case IN_PROCESS: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: processing"); break; case PAUSED_FOR_USER: SERIAL_ECHO_START; e556: 81 e6 ldi r24, 0x61 ; 97 e558: 9d e9 ldi r25, 0x9D ; 157 e55a: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLNPGM("busy: paused for user"); e55e: 83 e7 ldi r24, 0x73 ; 115 e560: 98 e7 ldi r25, 0x78 ; 120 e562: f6 cf rjmp .-20 ; 0xe550 0000e564 : #endif //TEMP_RESIDENCY_TIME } } void check_babystep() { e564: cf 93 push r28 int babystep_z = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); e566: 81 ea ldi r24, 0xA1 ; 161 e568: 9d e0 ldi r25, 0x0D ; 13 e56a: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 } } void check_babystep() { int babystep_z = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> e56e: cb e0 ldi r28, 0x0B ; 11 e570: 8c 9f mul r24, r28 e572: c0 01 movw r24, r0 e574: 11 24 eor r1, r1 e576: 80 5b subi r24, 0xB0 ; 176 e578: 92 4f sbci r25, 0xF2 ; 242 e57a: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); if ((babystep_z < Z_BABYSTEP_MIN) || (babystep_z > Z_BABYSTEP_MAX)) { e57e: 81 56 subi r24, 0x61 ; 97 e580: 90 4f sbci r25, 0xF0 ; 240 e582: 80 3a cpi r24, 0xA0 ; 160 e584: 9f 40 sbci r25, 0x0F ; 15 e586: c8 f0 brcs .+50 ; 0xe5ba babystep_z = 0; //if babystep value is out of min max range, set it to 0 SERIAL_ECHOLNPGM("Z live adjust out of range. Setting to 0"); e588: 88 e2 ldi r24, 0x28 ; 40 e58a: 98 e7 ldi r25, 0x78 ; 120 e58c: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 eeprom_write_word_notify(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)), e590: 81 ea ldi r24, 0xA1 ; 161 e592: 9d e0 ldi r25, 0x0D ; 13 e594: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); if ((babystep_z < Z_BABYSTEP_MIN) || (babystep_z > Z_BABYSTEP_MAX)) { babystep_z = 0; //if babystep value is out of min max range, set it to 0 SERIAL_ECHOLNPGM("Z live adjust out of range. Setting to 0"); eeprom_write_word_notify(reinterpret_cast(&(EEPROM_Sheets_base-> e598: 8c 9f mul r24, r28 e59a: c0 01 movw r24, r0 e59c: 11 24 eor r1, r1 if (active) { uint16_t previous_value = eeprom_read_word(dst); eeprom_word_notify(dst, previous_value, value, true); } #endif //DEBUG_EEPROM_CHANGES eeprom_write_word(dst, value); e59e: 70 e0 ldi r23, 0x00 ; 0 e5a0: 60 e0 ldi r22, 0x00 ; 0 e5a2: 80 5b subi r24, 0xB0 ; 176 e5a4: 92 4f sbci r25, 0xF2 ; 242 e5a6: 0f 94 3a a0 call 0x34074 ; 0x34074 s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)), babystep_z); lcd_show_fullscreen_message_and_wait_P(PSTR("Z live adjust out of range. Setting to 0. Click to continue.")); e5aa: 8b ee ldi r24, 0xEB ; 235 e5ac: 97 e7 ldi r25, 0x77 ; 119 e5ae: 0f 94 47 0b call 0x2168e ; 0x2168e lcd_update_enable(true); e5b2: 81 e0 ldi r24, 0x01 ; 1 } } e5b4: cf 91 pop r28 SERIAL_ECHOLNPGM("Z live adjust out of range. Setting to 0"); eeprom_write_word_notify(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)), babystep_z); lcd_show_fullscreen_message_and_wait_P(PSTR("Z live adjust out of range. Setting to 0. Click to continue.")); lcd_update_enable(true); e5b6: 0c 94 c0 69 jmp 0xd380 ; 0xd380 } } e5ba: cf 91 pop r28 e5bc: 08 95 ret 0000e5be : #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } void kill(const char *full_screen_message) { e5be: ec 01 movw r28, r24 cli(); // Stop interrupts e5c0: f8 94 cli disable_heater(); e5c2: 0f 94 5f 12 call 0x224be ; 0x224be disable_x(); e5c6: 17 9a sbi 0x02, 7 ; 2 e5c8: 10 92 a3 06 sts 0x06A3, r1 ; 0x8006a3 disable_y(); e5cc: 16 9a sbi 0x02, 6 ; 2 e5ce: 10 92 a4 06 sts 0x06A4, r1 ; 0x8006a4 poweroff_z(); disable_e0(); e5d2: 14 9a sbi 0x02, 4 ; 2 SERIAL_ERROR_START; e5d4: 84 e4 ldi r24, 0x44 ; 68 e5d6: 9d e9 ldi r25, 0x9D ; 157 e5d8: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); e5dc: 8c ec ldi r24, 0xCC ; 204 e5de: 97 e7 ldi r25, 0x77 ; 119 e5e0: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 if (full_screen_message != NULL) { e5e4: 20 97 sbiw r28, 0x00 ; 0 e5e6: 79 f0 breq .+30 ; 0xe606 SERIAL_ERRORLNRPGM(full_screen_message); e5e8: ce 01 movw r24, r28 e5ea: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 e5ee: be 01 movw r22, r28 e5f0: 85 e9 ldi r24, 0x95 ; 149 e5f2: 9c e0 ldi r25, 0x0C ; 12 e5f4: 0f 94 3a a0 call 0x34074 ; 0x34074 if (active) { uint8_t previous_value = eeprom_read_byte(dst); eeprom_byte_notify(dst, previous_value, value, true); } #endif //DEBUG_EEPROM_CHANGES eeprom_write_byte(dst, value); e5f8: 62 e4 ldi r22, 0x42 ; 66 e5fa: 84 e9 ldi r24, 0x94 ; 148 e5fc: 9c e0 ldi r25, 0x0C ; 12 e5fe: 0f 94 24 a0 call 0x34048 ; 0x34048 // update eeprom with the correct kill message to be shown on startup eeprom_write_word_notify((uint16_t*)EEPROM_KILL_MESSAGE, (uint16_t)full_screen_message); eeprom_write_byte_notify((uint8_t*)EEPROM_KILL_PENDING_FLAG, KILL_PENDING_FLAG); softReset(); e602: 0e 94 a7 60 call 0xc14e ; 0xc14e SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); if (full_screen_message != NULL) { SERIAL_ERRORLNRPGM(full_screen_message); } else { full_screen_message = PSTR("KILLED."); e606: c4 ec ldi r28, 0xC4 ; 196 e608: d7 e7 ldi r29, 0x77 ; 119 e60a: f1 cf rjmp .-30 ; 0xe5ee 0000e60c : // Confirm the execution of a command, if sent from a serial line. // Execution of a command from a SD card will not be confirmed. void ClearToSend() { previous_millis_cmd.start(); e60c: 8a e4 ldi r24, 0x4A ; 74 e60e: 93 e0 ldi r25, 0x03 ; 3 e610: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> if (buflen && ((CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB) || (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR))) e614: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf e618: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 e61c: 89 2b or r24, r25 e61e: 79 f0 breq .+30 ; 0xe63e e620: e0 91 cb 11 lds r30, 0x11CB ; 0x8011cb e624: f0 91 cc 11 lds r31, 0x11CC ; 0x8011cc e628: e2 52 subi r30, 0x22 ; 34 e62a: f0 4f sbci r31, 0xF0 ; 240 e62c: 80 81 ld r24, Z e62e: 81 30 cpi r24, 0x01 ; 1 e630: 11 f0 breq .+4 ; 0xe636 e632: 86 30 cpi r24, 0x06 ; 6 e634: 21 f4 brne .+8 ; 0xe63e SERIAL_PROTOCOLLNRPGM(MSG_OK); e636: 81 e3 ldi r24, 0x31 ; 49 e638: 99 e6 ldi r25, 0x69 ; 105 e63a: 0c 94 53 72 jmp 0xe4a6 ; 0xe4a6 } e63e: 08 95 ret 0000e640 : void cmdqueue_reset() { while (buflen) e640: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf e644: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 e648: 89 2b or r24, r25 e64a: 29 f0 breq .+10 ; 0xe656 { // printf_P(PSTR("dumping: \"%s\" of type %u\n"), cmdbuffer+bufindr+CMDHDRSIZE, CMDBUFFER_CURRENT_TYPE); ClearToSend(); e64c: 0e 94 06 73 call 0xe60c ; 0xe60c cmdqueue_pop_front(); e650: 0e 94 d3 6f call 0xdfa6 ; 0xdfa6 e654: f5 cf rjmp .-22 ; 0xe640 } bufindr = 0; e656: 10 92 cc 11 sts 0x11CC, r1 ; 0x8011cc e65a: 10 92 cb 11 sts 0x11CB, r1 ; 0x8011cb bufindw = 0; e65e: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> e662: 10 92 dc 0f sts 0x0FDC, r1 ; 0x800fdc <_ZL7bufindw.lto_priv.516> //commands are removed from command queue after process_command() function is finished //reseting command queue and enqueing new commands during some (usually long running) command processing would cause that new commands are immediately removed from queue (or damaged) //this will ensure that all new commands which are enqueued after cmdqueue reset, will be always executed cmdbuffer_front_already_processed = true; e666: 81 e0 ldi r24, 0x01 ; 1 e668: 80 93 e6 11 sts 0x11E6, r24 ; 0x8011e6 } e66c: 08 95 ret 0000e66e : } // G81_M420 Mesh bed leveling status static void gcode_G81_M420() { e66e: ef 92 push r14 e670: ff 92 push r15 e672: 0f 93 push r16 e674: 1f 93 push r17 e676: cf 93 push r28 e678: df 93 push r29 if (mbl.active) { e67a: 80 91 9c 12 lds r24, 0x129C ; 0x80129c e67e: 88 23 and r24, r24 e680: 89 f1 breq .+98 ; 0xe6e4 } } } void mesh_bed_leveling::print() { SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(MESH_NUM_X_POINTS) "," STRINGIFY(MESH_NUM_Y_POINTS)); e682: 86 e5 ldi r24, 0x56 ; 86 e684: 97 e7 ldi r25, 0x77 ; 119 e686: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 SERIAL_PROTOCOLLNPGM("Z search height: " STRINGIFY(MESH_HOME_Z_SEARCH)); e68a: 80 e4 ldi r24, 0x40 ; 64 e68c: 97 e7 ldi r25, 0x77 ; 119 e68e: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 SERIAL_PROTOCOLLNPGM("Measured points:"); e692: 8f e2 ldi r24, 0x2F ; 47 e694: 97 e7 ldi r25, 0x77 ; 119 e696: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 for (uint8_t y = MESH_NUM_Y_POINTS; y-- > 0;) { e69a: c7 e0 ldi r28, 0x07 ; 7 e69c: dc e1 ldi r29, 0x1C ; 28 e69e: c1 50 subi r28, 0x01 ; 1 e6a0: 58 f1 brcs .+86 ; 0xe6f8 e6a2: cd 9f mul r28, r29 e6a4: 70 01 movw r14, r0 e6a6: 11 24 eor r1, r1 e6a8: 01 e0 ldi r16, 0x01 ; 1 e6aa: 10 e0 ldi r17, 0x00 ; 0 for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) { SERIAL_PROTOCOLPGM(" "); e6ac: 8c e2 ldi r24, 0x2C ; 44 e6ae: 97 e7 ldi r25, 0x77 ; 119 e6b0: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_PROTOCOL_F(z_values[y][x], 5); e6b4: f8 01 movw r30, r16 e6b6: ee 0f add r30, r30 e6b8: ff 1f adc r31, r31 e6ba: ee 0f add r30, r30 e6bc: ff 1f adc r31, r31 e6be: ee 0d add r30, r14 e6c0: ff 1d adc r31, r15 e6c2: e7 56 subi r30, 0x67 ; 103 e6c4: fd 4e sbci r31, 0xED ; 237 e6c6: 60 81 ld r22, Z e6c8: 71 81 ldd r23, Z+1 ; 0x01 e6ca: 82 81 ldd r24, Z+2 ; 0x02 e6cc: 93 81 ldd r25, Z+3 ; 0x03 e6ce: 45 e0 ldi r20, 0x05 ; 5 e6d0: 0f 94 49 97 call 0x32e92 ; 0x32e92 e6d4: 0f 5f subi r16, 0xFF ; 255 e6d6: 1f 4f sbci r17, 0xFF ; 255 void mesh_bed_leveling::print() { SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(MESH_NUM_X_POINTS) "," STRINGIFY(MESH_NUM_Y_POINTS)); SERIAL_PROTOCOLLNPGM("Z search height: " STRINGIFY(MESH_HOME_Z_SEARCH)); SERIAL_PROTOCOLLNPGM("Measured points:"); for (uint8_t y = MESH_NUM_Y_POINTS; y-- > 0;) { for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) { e6d8: 08 30 cpi r16, 0x08 ; 8 e6da: 11 05 cpc r17, r1 e6dc: 39 f7 brne .-50 ; 0xe6ac SERIAL_PROTOCOLPGM(" "); SERIAL_PROTOCOL_F(z_values[y][x], 5); } SERIAL_PROTOCOLLN(); e6de: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 e6e2: dd cf rjmp .-70 ; 0xe69e mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); e6e4: 83 e6 ldi r24, 0x63 ; 99 e6e6: 97 e7 ldi r25, 0x77 ; 119 return; } e6e8: df 91 pop r29 e6ea: cf 91 pop r28 e6ec: 1f 91 pop r17 e6ee: 0f 91 pop r16 e6f0: ff 90 pop r15 e6f2: ef 90 pop r14 static void gcode_G81_M420() { if (mbl.active) { mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); e6f4: 0c 94 53 72 jmp 0xe4a6 ; 0xe4a6 return; } e6f8: df 91 pop r29 e6fa: cf 91 pop r28 e6fc: 1f 91 pop r17 e6fe: 0f 91 pop r16 e700: ff 90 pop r15 e702: ef 90 pop r14 e704: 08 95 ret 0000e706 : return (k >= 0? la10c_convert(k): -1); } float la10c_jerk(float j) { e706: cf 92 push r12 e708: df 92 push r13 e70a: ef 92 push r14 e70c: ff 92 push r15 e70e: 6b 01 movw r12, r22 e710: 7c 01 movw r14, r24 la10c_orig_jerk = j; e712: c0 92 29 03 sts 0x0329, r12 ; 0x800329 e716: d0 92 2a 03 sts 0x032A, r13 ; 0x80032a e71a: e0 92 2b 03 sts 0x032B, r14 ; 0x80032b e71e: f0 92 2c 03 sts 0x032C, r15 ; 0x80032c if(la10c_mode != LA10C_LA10) e722: 80 91 45 03 lds r24, 0x0345 ; 0x800345 e726: 82 30 cpi r24, 0x02 ; 2 e728: b1 f4 brne .+44 ; 0xe756 return j; // check for a compatible range of values prior to convert (be sure that // a higher E-jerk would still be compatible wrt the E accell range) if(j < 4.5 && cs.max_acceleration_mm_per_s2_normal[E_AXIS] < 2000) e72a: 20 e0 ldi r18, 0x00 ; 0 e72c: 30 e0 ldi r19, 0x00 ; 0 e72e: 40 e9 ldi r20, 0x90 ; 144 e730: 50 e4 ldi r21, 0x40 ; 64 e732: c7 01 movw r24, r14 e734: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> e738: 87 ff sbrs r24, 7 e73a: 14 c0 rjmp .+40 ; 0xe764 e73c: 80 91 62 04 lds r24, 0x0462 ; 0x800462 e740: 90 91 63 04 lds r25, 0x0463 ; 0x800463 e744: a0 91 64 04 lds r26, 0x0464 ; 0x800464 e748: b0 91 65 04 lds r27, 0x0465 ; 0x800465 e74c: 80 3d cpi r24, 0xD0 ; 208 e74e: 97 40 sbci r25, 0x07 ; 7 e750: a1 05 cpc r26, r1 e752: b1 05 cpc r27, r1 e754: 20 f5 brcc .+72 ; 0xe79e j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); SERIAL_ECHOLN(j); return j; } e756: c7 01 movw r24, r14 e758: b6 01 movw r22, r12 e75a: ff 90 pop r15 e75c: ef 90 pop r14 e75e: df 90 pop r13 e760: cf 90 pop r12 e762: 08 95 ret // bring low E-jerk values into equivalent LA 1.5 values by // flattening the response in the (0.3-4.5) range using a piecewise // function. Is it truly worth to preserve the difference between // 1.5/2.5 E-jerk for LA1.0? Probably not, but we try nonetheless. j = j < 0.3? j * 11.5: e764: 2a e9 ldi r18, 0x9A ; 154 e766: 39 e9 ldi r19, 0x99 ; 153 e768: 49 e9 ldi r20, 0x99 ; 153 e76a: 5e e3 ldi r21, 0x3E ; 62 e76c: c7 01 movw r24, r14 e76e: b6 01 movw r22, r12 e770: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> e774: 87 ff sbrs r24, 7 e776: 0a c0 rjmp .+20 ; 0xe78c e778: 20 e0 ldi r18, 0x00 ; 0 e77a: 30 e0 ldi r19, 0x00 ; 0 e77c: 48 e3 ldi r20, 0x38 ; 56 e77e: 51 e4 ldi r21, 0x41 ; 65 e780: c7 01 movw r24, r14 e782: b6 01 movw r22, r12 e784: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> e788: 6b 01 movw r12, r22 e78a: 7c 01 movw r14, r24 j < 4.5? j * 0.25 + 3.375: j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); e78c: 8a e3 ldi r24, 0x3A ; 58 e78e: 94 e7 ldi r25, 0x74 ; 116 e790: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLN(j); e794: c7 01 movw r24, r14 e796: b6 01 movw r22, r12 e798: 0f 94 8d 41 call 0x2831a ; 0x2831a e79c: dc cf rjmp .-72 ; 0xe756 // bring low E-jerk values into equivalent LA 1.5 values by // flattening the response in the (0.3-4.5) range using a piecewise // function. Is it truly worth to preserve the difference between // 1.5/2.5 E-jerk for LA1.0? Probably not, but we try nonetheless. j = j < 0.3? j * 11.5: e79e: 2a e9 ldi r18, 0x9A ; 154 e7a0: 39 e9 ldi r19, 0x99 ; 153 e7a2: 49 e9 ldi r20, 0x99 ; 153 e7a4: 5e e3 ldi r21, 0x3E ; 62 e7a6: c7 01 movw r24, r14 e7a8: b6 01 movw r22, r12 e7aa: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> e7ae: 87 fd sbrc r24, 7 e7b0: e3 cf rjmp .-58 ; 0xe778 j < 4.5? j * 0.25 + 3.375: e7b2: 20 e0 ldi r18, 0x00 ; 0 e7b4: 30 e0 ldi r19, 0x00 ; 0 e7b6: 40 e8 ldi r20, 0x80 ; 128 e7b8: 5e e3 ldi r21, 0x3E ; 62 e7ba: c7 01 movw r24, r14 e7bc: b6 01 movw r22, r12 e7be: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> // bring low E-jerk values into equivalent LA 1.5 values by // flattening the response in the (0.3-4.5) range using a piecewise // function. Is it truly worth to preserve the difference between // 1.5/2.5 E-jerk for LA1.0? Probably not, but we try nonetheless. j = j < 0.3? j * 11.5: e7c2: 20 e0 ldi r18, 0x00 ; 0 e7c4: 30 e0 ldi r19, 0x00 ; 0 e7c6: 48 e5 ldi r20, 0x58 ; 88 e7c8: 50 e4 ldi r21, 0x40 ; 64 e7ca: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> e7ce: dc cf rjmp .-72 ; 0xe788 0000e7d0 : return la10c_mode; } void la10c_mode_change(LA10C_MODE mode) { e7d0: cf 92 push r12 e7d2: df 92 push r13 e7d4: ef 92 push r14 e7d6: ff 92 push r15 e7d8: cf 93 push r28 if(mode == la10c_mode) return; e7da: 90 91 45 03 lds r25, 0x0345 ; 0x800345 e7de: 98 17 cp r25, r24 e7e0: b9 f1 breq .+110 ; 0xe850 e7e2: c8 2f mov r28, r24 // always restore to the last unadjusted E-jerk value if(la10c_orig_jerk) e7e4: c0 90 29 03 lds r12, 0x0329 ; 0x800329 e7e8: d0 90 2a 03 lds r13, 0x032A ; 0x80032a e7ec: e0 90 2b 03 lds r14, 0x032B ; 0x80032b e7f0: f0 90 2c 03 lds r15, 0x032C ; 0x80032c e7f4: 20 e0 ldi r18, 0x00 ; 0 e7f6: 30 e0 ldi r19, 0x00 ; 0 e7f8: a9 01 movw r20, r18 e7fa: c7 01 movw r24, r14 e7fc: b6 01 movw r22, r12 e7fe: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> e802: 88 23 and r24, r24 e804: 41 f0 breq .+16 ; 0xe816 cs.max_jerk[E_AXIS] = la10c_orig_jerk; e806: c0 92 86 04 sts 0x0486, r12 ; 0x800486 e80a: d0 92 87 04 sts 0x0487, r13 ; 0x800487 e80e: e0 92 88 04 sts 0x0488, r14 ; 0x800488 e812: f0 92 89 04 sts 0x0489, r15 ; 0x800489 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); e816: 8d e1 ldi r24, 0x1D ; 29 e818: 94 e7 ldi r25, 0x74 ; 116 e81a: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 switch(mode) e81e: c1 30 cpi r28, 0x01 ; 1 e820: 11 f1 breq .+68 ; 0xe866 e822: e0 f0 brcs .+56 ; 0xe85c e824: c2 30 cpi r28, 0x02 ; 2 e826: 11 f1 breq .+68 ; 0xe86c { case LA10C_UNKNOWN: SERIAL_ECHOLNPGM("UNKNOWN"); break; case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; } la10c_mode = mode; e828: c0 93 45 03 sts 0x0345, r28 ; 0x800345 // adjust the E-jerk if needed cs.max_jerk[E_AXIS] = la10c_jerk(cs.max_jerk[E_AXIS]); e82c: 60 91 86 04 lds r22, 0x0486 ; 0x800486 e830: 70 91 87 04 lds r23, 0x0487 ; 0x800487 e834: 80 91 88 04 lds r24, 0x0488 ; 0x800488 e838: 90 91 89 04 lds r25, 0x0489 ; 0x800489 e83c: 0e 94 83 73 call 0xe706 ; 0xe706 e840: 60 93 86 04 sts 0x0486, r22 ; 0x800486 e844: 70 93 87 04 sts 0x0487, r23 ; 0x800487 e848: 80 93 88 04 sts 0x0488, r24 ; 0x800488 e84c: 90 93 89 04 sts 0x0489, r25 ; 0x800489 } e850: cf 91 pop r28 e852: ff 90 pop r15 e854: ef 90 pop r14 e856: df 90 pop r13 e858: cf 90 pop r12 e85a: 08 95 ret cs.max_jerk[E_AXIS] = la10c_orig_jerk; SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); switch(mode) { case LA10C_UNKNOWN: SERIAL_ECHOLNPGM("UNKNOWN"); break; e85c: 85 e1 ldi r24, 0x15 ; 21 e85e: 94 e7 ldi r25, 0x74 ; 116 case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; e860: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 e864: e1 cf rjmp .-62 ; 0xe828 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); switch(mode) { case LA10C_UNKNOWN: SERIAL_ECHOLNPGM("UNKNOWN"); break; case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; e866: 81 e1 ldi r24, 0x11 ; 17 e868: 94 e7 ldi r25, 0x74 ; 116 e86a: fa cf rjmp .-12 ; 0xe860 case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; e86c: 8d e0 ldi r24, 0x0D ; 13 e86e: 94 e7 ldi r25, 0x74 ; 116 e870: f7 cf rjmp .-18 ; 0xe860 0000e872 : bool IsStopped() { return Stopped; }; void finishAndDisableSteppers() { st_synchronize(); e872: 0f 94 42 22 call 0x24484 ; 0x24484 disable_x(); e876: 17 9a sbi 0x02, 7 ; 2 e878: e3 ea ldi r30, 0xA3 ; 163 e87a: f6 e0 ldi r31, 0x06 ; 6 e87c: 10 82 st Z, r1 disable_y(); e87e: 16 9a sbi 0x02, 6 ; 2 e880: 11 82 std Z+1, r1 ; 0x01 disable_z(); disable_e0(); e882: 14 9a sbi 0x02, 4 ; 2 }; // Explicitly set/get/reset the interpretation mode for la10c_value() void la10c_mode_change(LA10C_MODE mode); LA10C_MODE la10c_mode_get(); static inline void la10c_reset() { la10c_mode_change(LA10C_UNKNOWN); } e884: 80 e0 ldi r24, 0x00 ; 0 e886: 0e 94 e8 73 call 0xe7d0 ; 0xe7d0 return percent_done; } static void print_time_remaining_init() { print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; e88a: 8f ef ldi r24, 0xFF ; 255 e88c: 9f ef ldi r25, 0xFF ; 255 e88e: 90 93 75 02 sts 0x0275, r25 ; 0x800275 e892: 80 93 74 02 sts 0x0274, r24 ; 0x800274 print_percent_done_normal = PRINT_PERCENT_DONE_INIT; e896: 2f ef ldi r18, 0xFF ; 255 e898: 20 93 71 02 sts 0x0271, r18 ; 0x800271 print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; e89c: 90 93 3e 02 sts 0x023E, r25 ; 0x80023e e8a0: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d print_percent_done_silent = PRINT_PERCENT_DONE_INIT; e8a4: 20 93 3f 02 sts 0x023F, r18 ; 0x80023f print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; e8a8: 90 93 73 02 sts 0x0273, r25 ; 0x800273 e8ac: 80 93 72 02 sts 0x0272, r24 ; 0x800272 print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; e8b0: 90 93 3c 02 sts 0x023C, r25 ; 0x80023c e8b4: 80 93 3b 02 sts 0x023B, r24 ; 0x80023b la10c_reset(); #endif //in the end of print set estimated time to end of print and extruders used during print to default values for next print print_time_remaining_init(); } e8b8: 08 95 ret 0000e8ba : SERIAL_ECHOLNRPGM(emergency_serial_dump? _N("enabled"): _N("disabled")); } } void __attribute__((noinline)) serial_dump_and_reset(dump_crash_reason reason) { e8ba: 18 2f mov r17, r24 uint16_t sp; uint32_t pc; // we're being called from a live state, so shut off interrupts ... cli(); e8bc: f8 94 cli // sample SP/PC sp = SP; e8be: cd b7 in r28, 0x3d ; 61 e8c0: de b7 in r29, 0x3e ; 62 "rcall .\n" "pop %A0\n" "pop %B0\n" "pop %C0\n" : "=&r" (ret) ); e8c2: 00 d0 rcall .+0 ; 0xe8c4 e8c4: cf 90 pop r12 e8c6: df 90 pop r13 e8c8: ef 90 pop r14 e8ca: 88 e1 ldi r24, 0x18 ; 24 e8cc: 99 e2 ldi r25, 0x29 ; 41 e8ce: 0f b6 in r0, 0x3f ; 63 e8d0: f8 94 cli e8d2: a8 95 wdr e8d4: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> e8d8: 0f be out 0x3f, r0 ; 63 e8da: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> // extend WDT long enough to allow writing the entire stream wdt_enable(WDTO_8S); // ... and heaters WRITE(FAN_PIN, HIGH); e8de: 9f b7 in r25, 0x3f ; 63 e8e0: f8 94 cli e8e2: e2 e0 ldi r30, 0x02 ; 2 e8e4: f1 e0 ldi r31, 0x01 ; 1 e8e6: 80 81 ld r24, Z e8e8: 88 60 ori r24, 0x08 ; 8 e8ea: 80 83 st Z, r24 e8ec: 9f bf out 0x3f, r25 ; 63 disable_heater(); e8ee: 0f 94 5f 12 call 0x224be ; 0x224be // this function can also be called from within a corrupted state, so not use // printf family of functions that use the heap or grow the stack. SERIAL_ECHOLNPGM("D23 - emergency serial dump"); e8f2: 8c ec ldi r24, 0xCC ; 204 e8f4: 93 e7 ldi r25, 0x73 ; 115 e8f6: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 SERIAL_ECHOPGM("error: "); e8fa: 84 ec ldi r24, 0xC4 ; 196 e8fc: 93 e7 ldi r25, 0x73 ; 115 e8fe: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 print((long) c, base); } void MarlinSerial::print(unsigned char b, int base) { print((unsigned long) b, base); e902: 61 2f mov r22, r17 e904: 70 e0 ldi r23, 0x00 ; 0 e906: 90 e0 ldi r25, 0x00 ; 0 e908: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); e90a: 4a e0 ldi r20, 0x0A ; 10 e90c: 0f 94 2c 96 call 0x32c58 ; 0x32c58 MYSERIAL.print((uint8_t)reason, DEC); SERIAL_ECHOPGM(" 0x"); e910: 80 ec ldi r24, 0xC0 ; 192 e912: 93 e7 ldi r25, 0x73 ; 115 e914: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 // we're being called from a live state, so shut off interrupts ... cli(); // sample SP/PC sp = SP; pc = GETPC(); e918: 8e 2d mov r24, r14 e91a: b6 01 movw r22, r12 e91c: 90 e0 ldi r25, 0x00 ; 0 e91e: 40 e1 ldi r20, 0x10 ; 16 e920: 0f 94 2c 96 call 0x32c58 ; 0x32c58 SERIAL_ECHOLNPGM("D23 - emergency serial dump"); SERIAL_ECHOPGM("error: "); MYSERIAL.print((uint8_t)reason, DEC); SERIAL_ECHOPGM(" 0x"); MYSERIAL.print(pc, HEX); SERIAL_ECHOPGM(" 0x"); e924: 8c eb ldi r24, 0xBC ; 188 e926: 93 e7 ldi r25, 0x73 ; 115 e928: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); e92c: be 01 movw r22, r28 e92e: 90 e0 ldi r25, 0x00 ; 0 e930: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); e932: 40 e1 ldi r20, 0x10 ; 16 e934: 0f 94 2c 96 call 0x32c58 ; 0x32c58 } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); e938: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 MYSERIAL.println(sp, HEX); print_mem(0, RAMEND+1, dcode_mem_t::sram); e93c: 40 e0 ldi r20, 0x00 ; 0 e93e: 60 e0 ldi r22, 0x00 ; 0 e940: 72 e2 ldi r23, 0x22 ; 34 e942: 90 e0 ldi r25, 0x00 ; 0 e944: 80 e0 ldi r24, 0x00 ; 0 e946: 0f 94 e5 52 call 0x2a5ca ; 0x2a5ca SERIAL_ECHOLNRPGM(MSG_OK); e94a: 81 e3 ldi r24, 0x31 ; 49 e94c: 99 e6 ldi r25, 0x69 ; 105 e94e: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 // reset soon softReset(); e952: 0e 94 a7 60 call 0xc14e ; 0xc14e 0000e956 : #endif //EMERGENCY_HANDLERS #endif //WATCHDOG } static inline void crash_and_burn(dump_crash_reason reason) { e956: c8 2f mov r28, r24 WRITE(BEEPER, HIGH); e958: 72 9a sbi 0x0e, 2 ; 14 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); e95a: 68 2f mov r22, r24 e95c: 83 e0 ldi r24, 0x03 ; 3 e95e: 9d e0 ldi r25, 0x0D ; 13 e960: 0f 94 00 a0 call 0x34000 ; 0x34000 eeprom_update_byte_notify((uint8_t*)EEPROM_FW_CRASH_FLAG, (uint8_t)reason); #ifdef EMERGENCY_DUMP xfdump_full_dump_and_reset(reason); #elif defined(EMERGENCY_SERIAL_DUMP) if(emergency_serial_dump) e964: 80 91 7c 06 lds r24, 0x067C ; 0x80067c e968: 88 23 and r24, r24 e96a: 19 f0 breq .+6 ; 0xe972 serial_dump_and_reset(reason); e96c: 8c 2f mov r24, r28 e96e: 0e 94 5d 74 call 0xe8ba ; 0xe8ba #endif softReset(); e972: 0e 94 a7 60 call 0xc14e ; 0xc14e 0000e976 <__vector_default>: crash_and_burn(dump_crash_reason::watchdog); } #endif ISR(BADISR_vect) { e976: 1f 92 push r1 e978: 0f 92 push r0 e97a: 0f b6 in r0, 0x3f ; 63 e97c: 0f 92 push r0 e97e: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::bad_isr); e980: 83 e0 ldi r24, 0x03 ; 3 e982: 0e 94 ab 74 call 0xe956 ; 0xe956 0000e986 <__vector_12>: } #ifdef EMERGENCY_HANDLERS #ifdef WATCHDOG ISR(WDT_vect) { e986: 1f 92 push r1 e988: 0f 92 push r0 e98a: 0f b6 in r0, 0x3f ; 63 e98c: 0f 92 push r0 e98e: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::watchdog); e990: 82 e0 ldi r24, 0x02 ; 2 e992: 0e 94 ab 74 call 0xe956 ; 0xe956 0000e996 : } #endif void Config_ResetDefault() { memcpy_P(&cs,&default_conf, sizeof(cs)); e996: 41 ed ldi r20, 0xD1 ; 209 e998: 50 e0 ldi r21, 0x00 ; 0 e99a: 6b ee ldi r22, 0xEB ; 235 e99c: 72 e7 ldi r23, 0x72 ; 114 e99e: 82 e3 ldi r24, 0x32 ; 50 e9a0: 94 e0 ldi r25, 0x04 ; 4 e9a2: 0f 94 76 9d call 0x33aec ; 0x33aec // steps per sq second need to be updated to agree with the units per sq second reset_acceleration_rates(); e9a6: 0f 94 95 74 call 0x2e92a ; 0x2e92a #ifdef PIDTEMP updatePID(); e9aa: 0f 94 96 18 call 0x2312c ; 0x2312c #endif//PIDTEMP #ifdef THERMAL_MODEL thermal_model_reset_settings(); #endif calculate_extruder_multipliers(); e9ae: 0e 94 d2 5e call 0xbda4 ; 0xbda4 SERIAL_ECHO_START; e9b2: 81 e6 ldi r24, 0x61 ; 97 e9b4: 9d e9 ldi r25, 0x9D ; 157 e9b6: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded"); e9ba: 89 ec ldi r24, 0xC9 ; 201 e9bc: 92 e7 ldi r25, 0x72 ; 114 e9be: 0c 94 53 72 jmp 0xe4a6 ; 0xe4a6 0000e9c2 : //! @brief Read M500 configuration //! @retval true Succeeded. Stored settings retrieved or default settings retrieved in case EEPROM cs was empty. //! @retval false Failed. Default settings has been retrieved, because of version mismatch bool Config_RetrieveSettings() { eeprom_read_block(reinterpret_cast(cs.version), reinterpret_cast(EEPROM_M500_base->version), sizeof(cs.version)); e9c2: 44 e0 ldi r20, 0x04 ; 4 e9c4: 50 e0 ldi r21, 0x00 ; 0 e9c6: 64 e1 ldi r22, 0x14 ; 20 e9c8: 70 e0 ldi r23, 0x00 ; 0 e9ca: 82 e3 ldi r24, 0x32 ; 50 e9cc: 94 e0 ldi r25, 0x04 ; 4 e9ce: 0f 94 cc 9f call 0x33f98 ; 0x33f98 // SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << cs.version << "]"); if (strncmp_P(cs.version, default_conf.version, sizeof(EEPROM_VERSION)) == 0) // version number match e9d2: 43 e0 ldi r20, 0x03 ; 3 e9d4: 50 e0 ldi r21, 0x00 ; 0 e9d6: 6b ee ldi r22, 0xEB ; 235 e9d8: 72 e7 ldi r23, 0x72 ; 114 e9da: 82 e3 ldi r24, 0x32 ; 50 e9dc: 94 e0 ldi r25, 0x04 ; 4 e9de: 0f 94 bb 9d call 0x33b76 ; 0x33b76 e9e2: 89 2b or r24, r25 e9e4: 09 f0 breq .+2 ; 0xe9e8 e9e6: 5d c0 rjmp .+186 ; 0xeaa2 { // Initialize arc interpolation settings in eeprom if they are not already eeprom_init_default_float(&EEPROM_M500_base->mm_per_arc_segment, pgm_read_float(&default_conf.mm_per_arc_segment)); e9e8: ef ea ldi r30, 0xAF ; 175 e9ea: f3 e7 ldi r31, 0x73 ; 115 e9ec: 45 91 lpm r20, Z+ e9ee: 55 91 lpm r21, Z+ e9f0: 65 91 lpm r22, Z+ e9f2: 74 91 lpm r23, Z e9f4: 88 ed ldi r24, 0xD8 ; 216 e9f6: 90 e0 ldi r25, 0x00 ; 0 e9f8: 0e 94 22 5d call 0xba44 ; 0xba44 eeprom_init_default_float(&EEPROM_M500_base->min_mm_per_arc_segment, pgm_read_float(&default_conf.min_mm_per_arc_segment)); e9fc: e3 eb ldi r30, 0xB3 ; 179 e9fe: f3 e7 ldi r31, 0x73 ; 115 ea00: 45 91 lpm r20, Z+ ea02: 55 91 lpm r21, Z+ ea04: 65 91 lpm r22, Z+ ea06: 74 91 lpm r23, Z ea08: 8c ed ldi r24, 0xDC ; 220 ea0a: 90 e0 ldi r25, 0x00 ; 0 ea0c: 0e 94 22 5d call 0xba44 ; 0xba44 eeprom_init_default_byte(&EEPROM_M500_base->n_arc_correction, pgm_read_byte(&default_conf.n_arc_correction)); ea10: e7 eb ldi r30, 0xB7 ; 183 ea12: f3 e7 ldi r31, 0x73 ; 115 ea14: 64 91 lpm r22, Z ea16: 80 ee ldi r24, 0xE0 ; 224 ea18: 90 e0 ldi r25, 0x00 ; 0 ea1a: 0e 94 ed 6e call 0xddda ; 0xddda eeprom_init_default_word(&EEPROM_M500_base->min_arc_segments, pgm_read_word(&default_conf.min_arc_segments)); ea1e: e8 eb ldi r30, 0xB8 ; 184 ea20: f3 e7 ldi r31, 0x73 ; 115 ea22: 65 91 lpm r22, Z+ ea24: 74 91 lpm r23, Z ea26: 81 ee ldi r24, 0xE1 ; 225 ea28: 90 e0 ldi r25, 0x00 ; 0 ea2a: 0e 94 d5 6e call 0xddaa ; 0xddaa eeprom_init_default_word(&EEPROM_M500_base->arc_segments_per_sec, pgm_read_word(&default_conf.arc_segments_per_sec)); ea2e: ea eb ldi r30, 0xBA ; 186 ea30: f3 e7 ldi r31, 0x73 ; 115 ea32: 65 91 lpm r22, Z+ ea34: 74 91 lpm r23, Z ea36: 83 ee ldi r24, 0xE3 ; 227 ea38: 90 e0 ldi r25, 0x00 ; 0 ea3a: 0e 94 d5 6e call 0xddaa ; 0xddaa // Initialize the travel_acceleration in eeprom if not already eeprom_init_default_float(&EEPROM_M500_base->travel_acceleration, pgm_read_float(&default_conf.travel_acceleration)); ea3e: eb ea ldi r30, 0xAB ; 171 ea40: f3 e7 ldi r31, 0x73 ; 115 ea42: 45 91 lpm r20, Z+ ea44: 55 91 lpm r21, Z+ ea46: 65 91 lpm r22, Z+ ea48: 74 91 lpm r23, Z ea4a: 84 ed ldi r24, 0xD4 ; 212 ea4c: 90 e0 ldi r25, 0x00 ; 0 ea4e: 0e 94 22 5d call 0xba44 ; 0xba44 // Initialize the max_feedrate_silent and max_acceleration_mm_per_s2_silent in eeprom if not already eeprom_init_default_block(&EEPROM_M500_base->max_feedrate_silent, sizeof(EEPROM_M500_base->max_feedrate_silent), default_conf.max_feedrate_silent); ea52: 47 e8 ldi r20, 0x87 ; 135 ea54: 53 e7 ldi r21, 0x73 ; 115 ea56: 60 e1 ldi r22, 0x10 ; 16 ea58: 70 e0 ldi r23, 0x00 ; 0 ea5a: 80 eb ldi r24, 0xB0 ; 176 ea5c: 90 e0 ldi r25, 0x00 ; 0 ea5e: 0e 94 b6 6e call 0xdd6c ; 0xdd6c eeprom_init_default_block(&EEPROM_M500_base->max_acceleration_mm_per_s2_silent, sizeof(EEPROM_M500_base->max_acceleration_mm_per_s2_silent), default_conf.max_acceleration_mm_per_s2_silent); ea62: 47 e9 ldi r20, 0x97 ; 151 ea64: 53 e7 ldi r21, 0x73 ; 115 ea66: 60 e1 ldi r22, 0x10 ; 16 ea68: 70 e0 ldi r23, 0x00 ; 0 ea6a: 80 ec ldi r24, 0xC0 ; 192 ea6c: 90 e0 ldi r25, 0x00 ; 0 ea6e: 0e 94 b6 6e call 0xdd6c ; 0xdd6c #ifdef TMC2130 eeprom_init_default_block(&EEPROM_M500_base->axis_ustep_resolution, sizeof(EEPROM_M500_base->axis_ustep_resolution), default_conf.axis_ustep_resolution); #endif // TMC2130 // load the CS to RAM eeprom_read_block(reinterpret_cast(&cs), reinterpret_cast(EEPROM_M500_base), sizeof(cs)); ea72: 41 ed ldi r20, 0xD1 ; 209 ea74: 50 e0 ldi r21, 0x00 ; 0 ea76: 64 e1 ldi r22, 0x14 ; 20 ea78: 70 e0 ldi r23, 0x00 ; 0 ea7a: 82 e3 ldi r24, 0x32 ; 50 ea7c: 94 e0 ldi r25, 0x04 ; 4 ea7e: 0f 94 cc 9f call 0x33f98 ; 0x33f98 calculate_extruder_multipliers(); ea82: 0e 94 d2 5e call 0xbda4 ; 0xbda4 tmc2130_set_res(Y_AXIS, cs.axis_ustep_resolution[Y_AXIS]); tmc2130_set_res(Z_AXIS, cs.axis_ustep_resolution[Z_AXIS]); tmc2130_set_res(E_AXIS, cs.axis_ustep_resolution[E_AXIS]); #endif //TMC2130 reset_acceleration_rates(); ea86: 0f 94 95 74 call 0x2e92a ; 0x2e92a // Call updatePID (similar to when we have processed M301) updatePID(); ea8a: 0f 94 96 18 call 0x2312c ; 0x2312c #ifdef THERMAL_MODEL thermal_model_load_settings(); #endif SERIAL_ECHO_START; ea8e: 81 e6 ldi r24, 0x61 ; 97 ea90: 9d e9 ldi r25, 0x9D ; 157 ea92: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLNPGM("Stored settings retrieved"); ea96: 8f ea ldi r24, 0xAF ; 175 ea98: 92 e7 ldi r25, 0x72 ; 114 ea9a: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 ea9e: 81 e0 ldi r24, 0x01 ; 1 eaa0: 08 95 ret } else { Config_ResetDefault(); eaa2: 0e 94 cb 74 call 0xe996 ; 0xe996 //Return false to inform user that eeprom version was changed and firmware is using default hardcoded settings now. //In case that storing to eeprom was not used yet, do not inform user that hardcoded settings are used. if (eeprom_is_initialized_block(EEPROM_M500_base->version, sizeof(EEPROM_M500_base->version))) { eaa6: 64 e0 ldi r22, 0x04 ; 4 eaa8: 70 e0 ldi r23, 0x00 ; 0 eaaa: 84 e1 ldi r24, 0x14 ; 20 eaac: 90 e0 ldi r25, 0x00 ; 0 eaae: 0e 94 10 55 call 0xaa20 ; 0xaa20 eab2: 91 e0 ldi r25, 0x01 ; 1 eab4: 89 27 eor r24, r25 return false; } } return true; } eab6: 08 95 ret 0000eab8 : }; void Config_StoreSettings() { strcpy_P(cs.version, default_conf.version); eab8: 6b ee ldi r22, 0xEB ; 235 eaba: 72 e7 ldi r23, 0x72 ; 114 eabc: 82 e3 ldi r24, 0x32 ; 50 eabe: 94 e0 ldi r25, 0x04 ; 4 eac0: 0f 94 93 9d call 0x33b26 ; 0x33b26 #endif //DEBUG_EEPROM_CHANGES } #ifndef DEBUG_EEPROM_CHANGES void eeprom_update_block_notify(const void *__src, void *__dst, size_t __n){ eeprom_update_block(__src, __dst, __n); eac4: 41 ed ldi r20, 0xD1 ; 209 eac6: 50 e0 ldi r21, 0x00 ; 0 eac8: 64 e1 ldi r22, 0x14 ; 20 eaca: 70 e0 ldi r23, 0x00 ; 0 eacc: 82 e3 ldi r24, 0x32 ; 50 eace: 94 e0 ldi r25, 0x04 ; 4 ead0: 0f 94 f0 9f call 0x33fe0 ; 0x33fe0 eeprom_update_block_notify(reinterpret_cast(&cs), reinterpret_cast(EEPROM_M500_base), sizeof(cs)); #ifdef THERMAL_MODEL thermal_model_save_settings(); #endif SERIAL_ECHO_START; ead4: 81 e6 ldi r24, 0x61 ; 97 ead6: 9d e9 ldi r25, 0x9D ; 157 ead8: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLNPGM("Settings Stored"); eadc: 8f e9 ldi r24, 0x9F ; 159 eade: 92 e7 ldi r25, 0x72 ; 114 eae0: 0c 94 53 72 jmp 0xe4a6 ; 0xe4a6 0000eae4 : { cmdbuffer_front_already_processed = true; } void get_command() { eae4: 2f 92 push r2 eae6: 3f 92 push r3 eae8: 4f 92 push r4 eaea: 5f 92 push r5 eaec: 6f 92 push r6 eaee: 7f 92 push r7 eaf0: 8f 92 push r8 eaf2: 9f 92 push r9 eaf4: af 92 push r10 eaf6: bf 92 push r11 eaf8: cf 92 push r12 eafa: df 92 push r13 eafc: ef 92 push r14 eafe: ff 92 push r15 eb00: 0f 93 push r16 eb02: 1f 93 push r17 eb04: cf 93 push r28 eb06: df 93 push r29 eb08: cd b7 in r28, 0x3d ; 61 eb0a: de b7 in r29, 0x3e ; 62 eb0c: a0 97 sbiw r28, 0x20 ; 32 eb0e: 0f b6 in r0, 0x3f ; 63 eb10: f8 94 cli eb12: de bf out 0x3e, r29 ; 62 eb14: 0f be out 0x3f, r0 ; 63 eb16: cd bf out 0x3d, r28 ; 61 // Test and reserve space for the new command string. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE - 1)) eb18: 8f e5 ldi r24, 0x5F ; 95 eb1a: 90 e0 ldi r25, 0x00 ; 0 eb1c: 0e 94 bc 55 call 0xab78 ; 0xab78 eb20: 88 23 and r24, r24 eb22: 09 f4 brne .+2 ; 0xeb26 eb24: a1 c0 rjmp .+322 ; 0xec68 return; if (MYSERIAL.available() == RX_BUFFER_SIZE - 1) { //compare number of chars buffered in rx buffer with rx buffer size eb26: 0e 94 c0 54 call 0xa980 ; 0xa980 eb2a: 8f 37 cpi r24, 0x7F ; 127 eb2c: 91 05 cpc r25, r1 eb2e: 61 f4 brne .+24 ; 0xeb48 // don't reverse this or there may be problems if the RX interrupt // occurs after reading the value of rx_buffer_head but before writing // the value to rx_buffer_tail; the previous value of rx_buffer_head // may be written to rx_buffer_tail, making it appear as if the buffer // were full, not empty. rx_buffer.head = rx_buffer.tail; eb30: 80 91 b1 05 lds r24, 0x05B1 ; 0x8005b1 eb34: 90 91 b2 05 lds r25, 0x05B2 ; 0x8005b2 eb38: 90 93 b0 05 sts 0x05B0, r25 ; 0x8005b0 eb3c: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af MYSERIAL.flush(); SERIAL_ECHOLNPGM("Full RX Buffer"); //if buffer was full, there is danger that reading of last gcode will not be completed eb40: 80 e9 ldi r24, 0x90 ; 144 eb42: 92 e7 ldi r25, 0x72 ; 114 eb44: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 eb48: 6e 01 movw r12, r28 eb4a: 4f e1 ldi r20, 0x1F ; 31 eb4c: c4 0e add r12, r20 eb4e: d1 1c adc r13, r1 } // Command is complete: store the current line into buffer, move to the next line. // Store type of entry cmdbuffer[bufindw] = gcode_N >= 0 ? CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR : CMDBUFFER_CURRENT_TYPE_USB; eb50: 99 24 eor r9, r9 eb52: 93 94 inc r9 MYSERIAL.flush(); SERIAL_ECHOLNPGM("Full RX Buffer"); //if buffer was full, there is danger that reading of last gcode will not be completed } // start of serial line processing loop while (((MYSERIAL.available() > 0 && !saved_printing) || (MYSERIAL.available() > 0 && printingIsPaused())) && !cmdqueue_serial_disabled) { //is print is saved (crash detection or filament detection), dont process data from serial line eb54: 0e 94 c0 54 call 0xa980 ; 0xa980 eb58: 18 16 cp r1, r24 eb5a: 19 06 cpc r1, r25 eb5c: 0c f0 brlt .+2 ; 0xeb60 eb5e: 78 c0 rjmp .+240 ; 0xec50 eb60: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 eb64: 88 23 and r24, r24 eb66: 29 f0 breq .+10 ; 0xeb72 eb68: 0e 94 bd 60 call 0xc17a ; 0xc17a eb6c: 88 23 and r24, r24 eb6e: 09 f4 brne .+2 ; 0xeb72 eb70: 6f c0 rjmp .+222 ; 0xec50 eb72: 80 91 61 03 lds r24, 0x0361 ; 0x800361 eb76: 81 11 cpse r24, r1 eb78: 6b c0 rjmp .+214 ; 0xec50 } int MarlinSerial::read(void) { // if the head isn't ahead of the tail, we don't have any characters if (rx_buffer.head == rx_buffer.tail) { eb7a: 20 91 b1 05 lds r18, 0x05B1 ; 0x8005b1 eb7e: 30 91 b2 05 lds r19, 0x05B2 ; 0x8005b2 eb82: 80 91 af 05 lds r24, 0x05AF ; 0x8005af eb86: 90 91 b0 05 lds r25, 0x05B0 ; 0x8005b0 eb8a: 82 17 cp r24, r18 eb8c: 93 07 cpc r25, r19 eb8e: 11 f3 breq .-60 ; 0xeb54 return -1; } else { unsigned char c = rx_buffer.buffer[rx_buffer.tail]; eb90: f9 01 movw r30, r18 eb92: e1 5d subi r30, 0xD1 ; 209 eb94: fa 4f sbci r31, 0xFA ; 250 eb96: 80 81 ld r24, Z rx_buffer.tail = (unsigned int)(rx_buffer.tail + 1) % RX_BUFFER_SIZE; eb98: 2f 5f subi r18, 0xFF ; 255 eb9a: 3f 4f sbci r19, 0xFF ; 255 eb9c: 2f 77 andi r18, 0x7F ; 127 eb9e: 33 27 eor r19, r19 eba0: 30 93 b2 05 sts 0x05B2, r19 ; 0x8005b2 eba4: 20 93 b1 05 sts 0x05B1, r18 ; 0x8005b1 //========================================================================== void mp_handle_rx_char(const uint8_t c) { // Check for commit complete // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (c == (uint8_t)(MeatPack_CommandByte)) { eba8: 8f 3f cpi r24, 0xFF ; 255 ebaa: 09 f0 breq .+2 ; 0xebae ebac: 79 c0 rjmp .+242 ; 0xeca0 if (mp_cmd_count > 0) { ebae: 80 91 1b 03 lds r24, 0x031B ; 0x80031b ebb2: 88 23 and r24, r24 ebb4: 09 f4 brne .+2 ; 0xebb8 ebb6: 71 c0 rjmp .+226 ; 0xec9a mp_cmd_active = 1; ebb8: 90 92 1a 03 sts 0x031A, r9 ; 0x80031a mp_cmd_count = 0; ebbc: 10 92 1b 03 sts 0x031B, r1 ; 0x80031b // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - const int rec = MYSERIAL.read(); if (rec < 0) continue; mp_handle_rx_char((uint8_t)rec); char c_res[2] = {0, 0}; ebc0: 1f 8e std Y+31, r1 ; 0x1f ebc2: 18 a2 std Y+32, r1 ; 0x20 mp_handle_rx_char_inner(c); } //========================================================================== uint8_t mp_get_result_char(char* const __restrict out) { if (mp_char_out_count > 0) { ebc4: 80 90 1e 03 lds r8, 0x031E ; 0x80031e ebc8: 88 20 and r8, r8 ebca: 21 f2 breq .-120 ; 0xeb54 const uint8_t res = mp_char_out_count; for (uint8_t i = 0; i < mp_char_out_count; ++i) out[i] = (char)mp_char_out_buf[i]; ebcc: 80 91 1c 03 lds r24, 0x031C ; 0x80031c ebd0: 8f 8f std Y+31, r24 ; 0x1f //========================================================================== uint8_t mp_get_result_char(char* const __restrict out) { if (mp_char_out_count > 0) { const uint8_t res = mp_char_out_count; for (uint8_t i = 0; i < mp_char_out_count; ++i) ebd2: f1 e0 ldi r31, 0x01 ; 1 ebd4: f8 15 cp r31, r8 ebd6: 18 f4 brcc .+6 ; 0xebde out[i] = (char)mp_char_out_buf[i]; ebd8: 80 91 1d 03 lds r24, 0x031D ; 0x80031d ebdc: 88 a3 std Y+32, r24 ; 0x20 mp_char_out_count = 0; ebde: 10 92 1e 03 sts 0x031E, r1 ; 0x80031e ebe2: 16 01 movw r2, r12 const uint8_t char_count = mp_get_result_char(c_res); // Note -- Paired bracket in preproc switch below for (uint8_t i = 0; i < char_count; ++i) { char serial_char = c_res[i]; ebe4: 82 2d mov r24, r2 ebe6: 8c 19 sub r24, r12 ebe8: 88 15 cp r24, r8 ebea: 08 f0 brcs .+2 ; 0xebee ebec: b3 cf rjmp .-154 ; 0xeb54 ebee: f1 01 movw r30, r2 ebf0: 11 91 ld r17, Z+ ebf2: 1f 01 movw r2, r30 #else char serial_char = MYSERIAL.read(); #endif serialTimeoutTimer.start(); ebf4: 81 e2 ldi r24, 0x21 ; 33 ebf6: 93 e0 ldi r25, 0x03 ; 3 ebf8: 0f 94 d6 0f call 0x21fac ; 0x21fac ::start()> if (serial_char < 0) ebfc: 17 fd sbrc r17, 7 ebfe: f2 cf rjmp .-28 ; 0xebe4 ec00: 80 91 da 0f lds r24, 0x0FDA ; 0x800fda ec04: 90 91 db 0f lds r25, 0x0FDB ; 0x800fdb // Ignore extended ASCII characters. These characters have no meaning in the G-code apart from the file names // and Marlin does not support such file names anyway. // Serial characters with a highest bit set to 1 are generated when the USB cable is unplugged, leading // to a hang-up of the print process from an SD card. continue; if(serial_char == '\n' || ec08: 1a 30 cpi r17, 0x0A ; 10 ec0a: 09 f4 brne .+2 ; 0xec0e ec0c: 4b c1 rjmp .+662 ; 0xeea4 ec0e: 1d 30 cpi r17, 0x0D ; 13 ec10: 09 f4 brne .+2 ; 0xec14 ec12: 48 c1 rjmp .+656 ; 0xeea4 serial_char == '\r' || ec14: 8f 35 cpi r24, 0x5F ; 95 ec16: 91 05 cpc r25, r1 ec18: 0c f0 brlt .+2 ; 0xec1c ec1a: 49 c1 rjmp .+658 ; 0xeeae if (MYSERIAL.available() == 0 || ! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1)) return; } // end of "end of line" processing else { // Not an "end of line" symbol. Store the new character into a buffer. if(serial_char == ';') comment_mode = true; ec1c: 1b 33 cpi r17, 0x3B ; 59 ec1e: 11 f4 brne .+4 ; 0xec24 ec20: 90 92 20 03 sts 0x0320, r9 ; 0x800320 if(!comment_mode) cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; ec24: 20 91 20 03 lds r18, 0x0320 ; 0x800320 ec28: 21 11 cpse r18, r1 ec2a: dc cf rjmp .-72 ; 0xebe4 ec2c: 9c 01 movw r18, r24 ec2e: 2f 5f subi r18, 0xFF ; 255 ec30: 3f 4f sbci r19, 0xFF ; 255 ec32: 30 93 db 0f sts 0x0FDB, r19 ; 0x800fdb ec36: 20 93 da 0f sts 0x0FDA, r18 ; 0x800fda ec3a: 20 91 dc 0f lds r18, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> ec3e: 30 91 dd 0f lds r19, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> ec42: 22 52 subi r18, 0x22 ; 34 ec44: 30 4f sbci r19, 0xF0 ; 240 ec46: 82 0f add r24, r18 ec48: 93 1f adc r25, r19 ec4a: fc 01 movw r30, r24 ec4c: 13 83 std Z+3, r17 ; 0x03 ec4e: ca cf rjmp .-108 ; 0xebe4 #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { ec50: 80 91 da 0f lds r24, 0x0FDA ; 0x800fda ec54: 90 91 db 0f lds r25, 0x0FDB ; 0x800fdb ec58: 18 16 cp r1, r24 ec5a: 19 06 cpc r1, r25 ec5c: 0c f4 brge .+2 ; 0xec60 ec5e: 51 c2 rjmp .+1186 ; 0xf102 SERIAL_ECHOLNPGM("RX timeout"); return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ ec60: 80 91 6a 13 lds r24, 0x136A ; 0x80136a ec64: 81 11 cpse r24, r1 ec66: 67 c2 rjmp .+1230 ; 0xf136 prusa_statistics(6); } } #endif //SDSUPPORT } ec68: a0 96 adiw r28, 0x20 ; 32 ec6a: 0f b6 in r0, 0x3f ; 63 ec6c: f8 94 cli ec6e: de bf out 0x3e, r29 ; 62 ec70: 0f be out 0x3f, r0 ; 63 ec72: cd bf out 0x3d, r28 ; 61 ec74: df 91 pop r29 ec76: cf 91 pop r28 ec78: 1f 91 pop r17 ec7a: 0f 91 pop r16 ec7c: ff 90 pop r15 ec7e: ef 90 pop r14 ec80: df 90 pop r13 ec82: cf 90 pop r12 ec84: bf 90 pop r11 ec86: af 90 pop r10 ec88: 9f 90 pop r9 ec8a: 8f 90 pop r8 ec8c: 7f 90 pop r7 ec8e: 6f 90 pop r6 ec90: 5f 90 pop r5 ec92: 4f 90 pop r4 ec94: 3f 90 pop r3 ec96: 2f 90 pop r2 ec98: 08 95 ret if (mp_cmd_count > 0) { mp_cmd_active = 1; mp_cmd_count = 0; } else ++mp_cmd_count; ec9a: 90 92 1b 03 sts 0x031B, r9 ; 0x80031b ec9e: 90 cf rjmp .-224 ; 0xebc0 return; } if (mp_cmd_active > 0) { eca0: 90 91 1a 03 lds r25, 0x031A ; 0x80031a eca4: 99 23 and r25, r25 eca6: 09 f4 brne .+2 ; 0xecaa eca8: 58 c0 rjmp .+176 ; 0xed5a } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { ecaa: 89 3f cpi r24, 0xF9 ; 249 ecac: e9 f1 breq .+122 ; 0xed28 ecae: 70 f5 brcc .+92 ; 0xed0c ecb0: 86 3f cpi r24, 0xF6 ; 246 ecb2: 09 f4 brne .+2 ; 0xecb6 ecb4: 4a c0 rjmp .+148 ; 0xed4a ecb6: 87 3f cpi r24, 0xF7 ; 247 ecb8: 09 f4 brne .+2 ; 0xecbc ecba: 43 c0 rjmp .+134 ; 0xed42 mp_handle_output_char(c); } //========================================================================== void FORCE_INLINE mp_echo_config_state() { SERIAL_ECHOPGM(" [MP] "); // Add space at idx 0 just in case first character is dropped due to timing/sync issues. ecbc: 8b e5 ldi r24, 0x5B ; 91 ecbe: 92 e7 ldi r25, 0x72 ; 114 ecc0: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 // NOTE: if any configuration vars are added below, the outgoing sync text for host plugin // should not contain the "PV' substring, as this is used to indicate protocol version SERIAL_ECHOPGM(MeatPack_ProtocolVersion); ecc4: 86 e5 ldi r24, 0x56 ; 86 ecc6: 92 e7 ldi r25, 0x72 ; 114 ecc8: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 // Echo current state if (mp_config & MPConfig_Active) eccc: 10 91 19 03 lds r17, 0x0319 ; 0x800319 SERIAL_ECHOPGM(" ON"); ecd0: 82 e5 ldi r24, 0x52 ; 82 ecd2: 92 e7 ldi r25, 0x72 ; 114 // NOTE: if any configuration vars are added below, the outgoing sync text for host plugin // should not contain the "PV' substring, as this is used to indicate protocol version SERIAL_ECHOPGM(MeatPack_ProtocolVersion); // Echo current state if (mp_config & MPConfig_Active) ecd4: 10 fd sbrc r17, 0 ecd6: 02 c0 rjmp .+4 ; 0xecdc SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); ecd8: 8d e4 ldi r24, 0x4D ; 77 ecda: 92 e7 ldi r25, 0x72 ; 114 ecdc: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 if (mp_config & MPConfig_NoSpaces) ece0: 01 2f mov r16, r17 ece2: 02 70 andi r16, 0x02 ; 2 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces ece4: 88 e4 ldi r24, 0x48 ; 72 ece6: 92 e7 ldi r25, 0x72 ; 114 if (mp_config & MPConfig_Active) SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); if (mp_config & MPConfig_NoSpaces) ece8: 11 fd sbrc r17, 1 ecea: 02 c0 rjmp .+4 ; 0xecf0 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces else SERIAL_ECHOPGM(" ESP"); // [E]nabled [SP]aces ecec: 83 e4 ldi r24, 0x43 ; 67 ecee: 92 e7 ldi r25, 0x72 ; 114 ecf0: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLNPGM(""); ecf4: 82 e4 ldi r24, 0x42 ; 66 ecf6: 92 e7 ldi r25, 0x72 ; 114 ecf8: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) ecfc: 00 23 and r16, r16 ecfe: 49 f1 breq .+82 ; 0xed52 MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); ed00: 85 e4 ldi r24, 0x45 ; 69 ed02: 80 93 0b 02 sts 0x020B, r24 ; 0x80020b <__DATA_REGION_ORIGIN__+0xb> return; } if (mp_cmd_active > 0) { mp_handle_cmd((MeatPack_Command)c); mp_cmd_active = 0; ed06: 10 92 1a 03 sts 0x031A, r1 ; 0x80031a ed0a: 5a cf rjmp .-332 ; 0xebc0 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { ed0c: 8a 3f cpi r24, 0xFA ; 250 ed0e: 41 f0 breq .+16 ; 0xed20 ed10: 8b 3f cpi r24, 0xFB ; 251 ed12: a1 f6 brne .-88 ; 0xecbc case MPCommand_EnablePacking: { mp_config |= MPConfig_Active; ed14: 80 91 19 03 lds r24, 0x0319 ; 0x800319 ed18: 81 60 ori r24, 0x01 ; 1 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); ed1a: 80 93 19 03 sts 0x0319, r24 ; 0x800319 ed1e: ce cf rjmp .-100 ; 0xecbc #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL REC"); #endif } break; case MPCommand_DisablePacking: { mp_config &= ~(MPConfig_Active); ed20: 80 91 19 03 lds r24, 0x0319 ; 0x800319 ed24: 8e 7f andi r24, 0xFE ; 254 ed26: f9 cf rjmp .-14 ; 0xed1a return out; } //============================================================================== void FORCE_INLINE mp_reset_state() { mp_char_out_count = 0; ed28: 10 92 1e 03 sts 0x031E, r1 ; 0x80031e mp_cmd_active = MPCommand_None; ed2c: 10 92 1a 03 sts 0x031A, r1 ; 0x80031a mp_config = MPConfig_None; ed30: 10 92 19 03 sts 0x0319, r1 ; 0x800319 mp_char_buf = 0; ed34: 10 92 18 03 sts 0x0318, r1 ; 0x800318 mp_cmd_count = 0; ed38: 10 92 1b 03 sts 0x031B, r1 ; 0x80031b mp_cmd_active = 0; mp_full_char_queue = 0; ed3c: 10 92 17 03 sts 0x0317, r1 ; 0x800317 ed40: bd cf rjmp .-134 ; 0xecbc #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] RESET REC"); #endif } break; case MPCommand_EnableNoSpaces: { mp_config |= MPConfig_NoSpaces; ed42: 80 91 19 03 lds r24, 0x0319 ; 0x800319 ed46: 82 60 ori r24, 0x02 ; 2 ed48: e8 cf rjmp .-48 ; 0xed1a #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); ed4a: 80 91 19 03 lds r24, 0x0319 ; 0x800319 ed4e: 8d 7f andi r24, 0xFD ; 253 ed50: e4 cf rjmp .-56 ; 0xed1a // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); else MeatPackLookupTbl[MeatPack_SpaceCharIdx] = ' '; ed52: 90 e2 ldi r25, 0x20 ; 32 ed54: 90 93 0b 02 sts 0x020B, r25 ; 0x80020b <__DATA_REGION_ORIGIN__+0xb> ed58: d6 cf rjmp .-84 ; 0xed06 mp_handle_cmd((MeatPack_Command)c); mp_cmd_active = 0; return; } if (mp_cmd_count > 0) { ed5a: 90 91 1b 03 lds r25, 0x031B ; 0x80031b ed5e: 30 91 19 03 lds r19, 0x0319 ; 0x800319 ed62: 99 23 and r25, r25 ed64: 31 f1 breq .+76 ; 0xedb2 ed66: e0 91 1e 03 lds r30, 0x031E ; 0x80031e //========================================================================== void FORCE_INLINE mp_handle_rx_char_inner(const uint8_t c) { // Packing enabled, handle character and re-arrange them appropriately. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (mp_config & MPConfig_Active) { ed6a: 30 ff sbrs r19, 0 ed6c: 49 c0 rjmp .+146 ; 0xee00 if (mp_full_char_queue > 0) { ed6e: 20 91 17 03 lds r18, 0x0317 ; 0x800317 ed72: 22 23 and r18, r18 ed74: 09 f4 brne .+2 ; 0xed78 ed76: 40 c0 rjmp .+128 ; 0xedf8 #ifdef MP_DEBUG uint32_t mp_chars_decoded = 0; #endif void FORCE_INLINE mp_handle_output_char(const uint8_t c) { mp_char_out_buf[mp_char_out_count++] = c; ed78: 91 e0 ldi r25, 0x01 ; 1 ed7a: 9e 0f add r25, r30 ed7c: 90 93 1e 03 sts 0x031E, r25 ; 0x80031e ed80: ae 2f mov r26, r30 ed82: b0 e0 ldi r27, 0x00 ; 0 ed84: a4 5e subi r26, 0xE4 ; 228 ed86: bc 4f sbci r27, 0xFC ; 252 ed88: ff ef ldi r31, 0xFF ; 255 ed8a: fc 93 st X, r31 // Packing enabled, handle character and re-arrange them appropriately. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (mp_config & MPConfig_Active) { if (mp_full_char_queue > 0) { mp_handle_output_char(c); if (mp_char_buf > 0) { ed8c: 40 91 18 03 lds r20, 0x0318 ; 0x800318 ed90: 44 23 and r20, r20 ed92: 51 f0 breq .+20 ; 0xeda8 #ifdef MP_DEBUG uint32_t mp_chars_decoded = 0; #endif void FORCE_INLINE mp_handle_output_char(const uint8_t c) { mp_char_out_buf[mp_char_out_count++] = c; ed94: ee 5f subi r30, 0xFE ; 254 ed96: e0 93 1e 03 sts 0x031E, r30 ; 0x80031e ed9a: e9 2f mov r30, r25 ed9c: f0 e0 ldi r31, 0x00 ; 0 ed9e: e4 5e subi r30, 0xE4 ; 228 eda0: fc 4f sbci r31, 0xFC ; 252 eda2: 40 83 st Z, r20 if (mp_config & MPConfig_Active) { if (mp_full_char_queue > 0) { mp_handle_output_char(c); if (mp_char_buf > 0) { mp_handle_output_char(mp_char_buf); mp_char_buf = 0; eda4: 10 92 18 03 sts 0x0318, r1 ; 0x800318 } --mp_full_char_queue; eda8: 21 50 subi r18, 0x01 ; 1 edaa: 20 93 17 03 sts 0x0317, r18 ; 0x800317 return; } if (mp_cmd_count > 0) { mp_handle_rx_char_inner((uint8_t)(MeatPack_CommandByte)); mp_cmd_count = 0; edae: 10 92 1b 03 sts 0x031B, r1 ; 0x80031b edb2: e0 91 1e 03 lds r30, 0x031E ; 0x80031e //========================================================================== void FORCE_INLINE mp_handle_rx_char_inner(const uint8_t c) { // Packing enabled, handle character and re-arrange them appropriately. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (mp_config & MPConfig_Active) { edb6: 30 ff sbrs r19, 0 edb8: 6c c0 rjmp .+216 ; 0xee92 if (mp_full_char_queue > 0) { edba: 90 91 17 03 lds r25, 0x0317 ; 0x800317 edbe: 99 23 and r25, r25 edc0: 49 f1 breq .+82 ; 0xee14 #ifdef MP_DEBUG uint32_t mp_chars_decoded = 0; #endif void FORCE_INLINE mp_handle_output_char(const uint8_t c) { mp_char_out_buf[mp_char_out_count++] = c; edc2: 21 e0 ldi r18, 0x01 ; 1 edc4: 2e 0f add r18, r30 edc6: 20 93 1e 03 sts 0x031E, r18 ; 0x80031e edca: ae 2f mov r26, r30 edcc: b0 e0 ldi r27, 0x00 ; 0 edce: a4 5e subi r26, 0xE4 ; 228 edd0: bc 4f sbci r27, 0xFC ; 252 edd2: 8c 93 st X, r24 // Packing enabled, handle character and re-arrange them appropriately. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (mp_config & MPConfig_Active) { if (mp_full_char_queue > 0) { mp_handle_output_char(c); if (mp_char_buf > 0) { edd4: 80 91 18 03 lds r24, 0x0318 ; 0x800318 edd8: 88 23 and r24, r24 edda: 51 f0 breq .+20 ; 0xedf0 #ifdef MP_DEBUG uint32_t mp_chars_decoded = 0; #endif void FORCE_INLINE mp_handle_output_char(const uint8_t c) { mp_char_out_buf[mp_char_out_count++] = c; eddc: ee 5f subi r30, 0xFE ; 254 edde: e0 93 1e 03 sts 0x031E, r30 ; 0x80031e ede2: e2 2f mov r30, r18 ede4: f0 e0 ldi r31, 0x00 ; 0 ede6: e4 5e subi r30, 0xE4 ; 228 ede8: fc 4f sbci r31, 0xFC ; 252 edea: 80 83 st Z, r24 if (mp_config & MPConfig_Active) { if (mp_full_char_queue > 0) { mp_handle_output_char(c); if (mp_char_buf > 0) { mp_handle_output_char(mp_char_buf); mp_char_buf = 0; edec: 10 92 18 03 sts 0x0318, r1 ; 0x800318 } --mp_full_char_queue; edf0: 91 50 subi r25, 0x01 ; 1 edf2: 90 93 17 03 sts 0x0317, r25 ; 0x800317 edf6: e4 ce rjmp .-568 ; 0xebc0 uint8_t buf[2] = { 0,0 }; const uint8_t res = mp_unpack_chars(c, buf); if (res & MeatPack_NextPackedFirst) { ++mp_full_char_queue; if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; edf8: 42 e0 ldi r20, 0x02 ; 2 edfa: 40 93 17 03 sts 0x0317, r20 ; 0x800317 edfe: d7 cf rjmp .-82 ; 0xedae #ifdef MP_DEBUG uint32_t mp_chars_decoded = 0; #endif void FORCE_INLINE mp_handle_output_char(const uint8_t c) { mp_char_out_buf[mp_char_out_count++] = c; ee00: 91 e0 ldi r25, 0x01 ; 1 ee02: 9e 0f add r25, r30 ee04: 90 93 1e 03 sts 0x031E, r25 ; 0x80031e ee08: f0 e0 ldi r31, 0x00 ; 0 ee0a: e4 5e subi r30, 0xE4 ; 228 ee0c: fc 4f sbci r31, 0xFC ; 252 ee0e: 9f ef ldi r25, 0xFF ; 255 ee10: 90 83 st Z, r25 ee12: cd cf rjmp .-102 ; 0xedae ee14: a8 2f mov r26, r24 ee16: af 70 andi r26, 0x0F ; 15 mp_char_buf = 0; } --mp_full_char_queue; } else { uint8_t buf[2] = { 0,0 }; ee18: 30 e0 ldi r19, 0x00 ; 0 uint8_t FORCE_INLINE mp_unpack_chars(const uint8_t pk, uint8_t* __restrict const chars_out) { uint8_t out = 0; #ifdef USE_LOOKUP_TABLE // If lower 4 bytes is 0b1111, the higher 4 are unused, and next char is full. if ((pk & MeatPack_FirstNotPacked) == MeatPack_FirstNotPacked) out |= MeatPack_NextPackedFirst; ee1a: 21 e0 ldi r18, 0x01 ; 1 ee1c: af 30 cpi r26, 0x0F ; 15 ee1e: 29 f0 breq .+10 ; 0xee2a ee20: b0 e0 ldi r27, 0x00 ; 0 else chars_out[0] = MeatPackLookupTbl[(pk & 0xF)]; // Assign lower char ee22: a0 50 subi r26, 0x00 ; 0 ee24: be 4f sbci r27, 0xFE ; 254 ee26: 3c 91 ld r19, X // low = (packed >> 4) & 0xF; // high = (packed & 0xF); //========================================================================== uint8_t FORCE_INLINE mp_unpack_chars(const uint8_t pk, uint8_t* __restrict const chars_out) { uint8_t out = 0; ee28: 20 e0 ldi r18, 0x00 ; 0 // If lower 4 bytes is 0b1111, the higher 4 are unused, and next char is full. if ((pk & MeatPack_FirstNotPacked) == MeatPack_FirstNotPacked) out |= MeatPack_NextPackedFirst; else chars_out[0] = MeatPackLookupTbl[(pk & 0xF)]; // Assign lower char // Check if upper 4 bytes is 0b1111... if so, we don't need the second char. if ((pk & MeatPack_SecondNotPacked) == MeatPack_SecondNotPacked) out |= MeatPack_NextPackedSecond; ee2a: 48 2f mov r20, r24 ee2c: 40 7f andi r20, 0xF0 ; 240 ee2e: 40 3f cpi r20, 0xF0 ; 240 ee30: 59 f4 brne .+22 ; 0xee48 ee32: 22 60 ori r18, 0x02 ; 2 } else { uint8_t buf[2] = { 0,0 }; const uint8_t res = mp_unpack_chars(c, buf); if (res & MeatPack_NextPackedFirst) { ee34: 20 ff sbrs r18, 0 ee36: 13 c0 rjmp .+38 ; 0xee5e ++mp_full_char_queue; ee38: 90 92 17 03 sts 0x0317, r9 ; 0x800317 if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; ee3c: 21 ff sbrs r18, 1 ee3e: 0c c0 rjmp .+24 ; 0xee58 ee40: e2 e0 ldi r30, 0x02 ; 2 ee42: e0 93 17 03 sts 0x0317, r30 ; 0x800317 ee46: bc ce rjmp .-648 ; 0xebc0 if ((pk & MeatPack_FirstNotPacked) == MeatPack_FirstNotPacked) out |= MeatPack_NextPackedFirst; else chars_out[0] = MeatPackLookupTbl[(pk & 0xF)]; // Assign lower char // Check if upper 4 bytes is 0b1111... if so, we don't need the second char. if ((pk & MeatPack_SecondNotPacked) == MeatPack_SecondNotPacked) out |= MeatPack_NextPackedSecond; else chars_out[1] = MeatPackLookupTbl[((pk >> 4) & 0xf)]; // Assign upper char ee48: 82 95 swap r24 ee4a: 8f 70 andi r24, 0x0F ; 15 ee4c: a8 2f mov r26, r24 ee4e: b0 e0 ldi r27, 0x00 ; 0 ee50: a0 50 subi r26, 0x00 ; 0 ee52: be 4f sbci r27, 0xFE ; 254 ee54: 9c 91 ld r25, X ee56: ee cf rjmp .-36 ; 0xee34 const uint8_t res = mp_unpack_chars(c, buf); if (res & MeatPack_NextPackedFirst) { ++mp_full_char_queue; if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; else mp_char_buf = buf[1]; ee58: 90 93 18 03 sts 0x0318, r25 ; 0x800318 ee5c: b1 ce rjmp .-670 ; 0xebc0 #ifdef MP_DEBUG uint32_t mp_chars_decoded = 0; #endif void FORCE_INLINE mp_handle_output_char(const uint8_t c) { mp_char_out_buf[mp_char_out_count++] = c; ee5e: 81 e0 ldi r24, 0x01 ; 1 ee60: 8e 0f add r24, r30 ee62: 80 93 1e 03 sts 0x031E, r24 ; 0x80031e ee66: ae 2f mov r26, r30 ee68: b0 e0 ldi r27, 0x00 ; 0 ee6a: a4 5e subi r26, 0xE4 ; 228 ee6c: bc 4f sbci r27, 0xFC ; 252 ee6e: 3c 93 st X, r19 if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; else mp_char_buf = buf[1]; } else { mp_handle_output_char(buf[0]); if (buf[0] != '\n') { ee70: 3a 30 cpi r19, 0x0A ; 10 ee72: 09 f4 brne .+2 ; 0xee76 ee74: a5 ce rjmp .-694 ; 0xebc0 if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; ee76: 21 ff sbrs r18, 1 ee78: 03 c0 rjmp .+6 ; 0xee80 ee7a: 90 92 17 03 sts 0x0317, r9 ; 0x800317 ee7e: a0 ce rjmp .-704 ; 0xebc0 #ifdef MP_DEBUG uint32_t mp_chars_decoded = 0; #endif void FORCE_INLINE mp_handle_output_char(const uint8_t c) { mp_char_out_buf[mp_char_out_count++] = c; ee80: ee 5f subi r30, 0xFE ; 254 ee82: e0 93 1e 03 sts 0x031E, r30 ; 0x80031e ee86: e8 2f mov r30, r24 ee88: f0 e0 ldi r31, 0x00 ; 0 ee8a: e4 5e subi r30, 0xE4 ; 228 ee8c: fc 4f sbci r31, 0xFC ; 252 ee8e: 90 83 st Z, r25 ee90: 97 ce rjmp .-722 ; 0xebc0 ee92: 91 e0 ldi r25, 0x01 ; 1 ee94: 9e 0f add r25, r30 ee96: 90 93 1e 03 sts 0x031E, r25 ; 0x80031e ee9a: f0 e0 ldi r31, 0x00 ; 0 ee9c: e4 5e subi r30, 0xE4 ; 228 ee9e: fc 4f sbci r31, 0xFC ; 252 eea0: 80 83 st Z, r24 eea2: 8e ce rjmp .-740 ; 0xebc0 continue; if(serial_char == '\n' || serial_char == '\r' || serial_count >= (MAX_CMD_SIZE - 1) ) { if(!serial_count) { //if empty line eea4: 00 97 sbiw r24, 0x00 ; 0 eea6: 19 f4 brne .+6 ; 0xeeae comment_mode = false; //for new command eea8: 10 92 20 03 sts 0x0320, r1 ; 0x800320 eeac: dd ce rjmp .-582 ; 0xec68 eeae: 00 91 dc 0f lds r16, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> eeb2: 10 91 dd 0f lds r17, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> return; } cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; // terminate string eeb6: 0f 51 subi r16, 0x1F ; 31 eeb8: 10 4f sbci r17, 0xF0 ; 240 eeba: 80 0f add r24, r16 eebc: 91 1f adc r25, r17 eebe: fc 01 movw r30, r24 eec0: 10 82 st Z, r1 char* cmd_head = cmdbuffer+bufindw+CMDHDRSIZE; // current command pointer char* cmd_start = cmd_head; // pointer past the line number (if any) eec2: 1a 83 std Y+2, r17 ; 0x02 eec4: 09 83 std Y+1, r16 ; 0x01 if(!comment_mode){ eec6: 80 91 20 03 lds r24, 0x0320 ; 0x800320 eeca: 81 11 cpse r24, r1 eecc: fd c0 rjmp .+506 ; 0xf0c8 long gcode_N = -1; // seen line number // Line numbers must be first in buffer if (*cmd_head == 'N') { eece: f8 01 movw r30, r16 eed0: 80 81 ld r24, Z eed2: 8e 34 cpi r24, 0x4E ; 78 eed4: 09 f0 breq .+2 ; 0xeed8 eed6: 84 c0 rjmp .+264 ; 0xefe0 // Line number met: decode the number, then move cmd_start past all spaces. gcode_N = (strtol(cmd_head+1, &cmd_start, 10)); eed8: 4a e0 ldi r20, 0x0A ; 10 eeda: 50 e0 ldi r21, 0x00 ; 0 eedc: be 01 movw r22, r28 eede: 6f 5f subi r22, 0xFF ; 255 eee0: 7f 4f sbci r23, 0xFF ; 255 eee2: c8 01 movw r24, r16 eee4: 01 96 adiw r24, 0x01 ; 1 eee6: 0f 94 67 9b call 0x336ce ; 0x336ce eeea: 2b 01 movw r4, r22 eeec: 3c 01 movw r6, r24 while (*cmd_start == ' ') ++cmd_start; eeee: e9 80 ldd r14, Y+1 ; 0x01 eef0: fa 80 ldd r15, Y+2 ; 0x02 eef2: f7 01 movw r30, r14 eef4: 80 81 ld r24, Z eef6: 80 32 cpi r24, 0x20 ; 32 eef8: 31 f4 brne .+12 ; 0xef06 eefa: ff ef ldi r31, 0xFF ; 255 eefc: ef 1a sub r14, r31 eefe: ff 0a sbc r15, r31 ef00: fa 82 std Y+2, r15 ; 0x02 ef02: e9 82 std Y+1, r14 ; 0x01 ef04: f4 cf rjmp .-24 ; 0xeeee // Test whether the successive lines are stamped with an increasing line number ID. if(gcode_N != gcode_LastN+1 && strncmp_P(cmd_start, PSTR("M110"), 4)) { ef06: 80 91 d1 11 lds r24, 0x11D1 ; 0x8011d1 ef0a: 90 91 d2 11 lds r25, 0x11D2 ; 0x8011d2 ef0e: a0 91 d3 11 lds r26, 0x11D3 ; 0x8011d3 ef12: b0 91 d4 11 lds r27, 0x11D4 ; 0x8011d4 ef16: 01 96 adiw r24, 0x01 ; 1 ef18: a1 1d adc r26, r1 ef1a: b1 1d adc r27, r1 ef1c: 84 15 cp r24, r4 ef1e: 95 05 cpc r25, r5 ef20: a6 05 cpc r26, r6 ef22: b7 05 cpc r27, r7 ef24: 49 f0 breq .+18 ; 0xef38 ef26: 44 e0 ldi r20, 0x04 ; 4 ef28: 50 e0 ldi r21, 0x00 ; 0 ef2a: 6b e8 ldi r22, 0x8B ; 139 ef2c: 72 e7 ldi r23, 0x72 ; 114 ef2e: c7 01 movw r24, r14 ef30: 0f 94 bb 9d call 0x33b76 ; 0x33b76 ef34: 89 2b or r24, r25 ef36: a1 f4 brne .+40 ; 0xef60 FlushSerialRequestResend(); serial_count = 0; return; } if((strchr_pointer = strchr(cmd_start, '*')) != NULL) ef38: 6a e2 ldi r22, 0x2A ; 42 ef3a: 70 e0 ldi r23, 0x00 ; 0 ef3c: c7 01 movw r24, r14 ef3e: 0f 94 33 a6 call 0x34c66 ; 0x34c66 ef42: 90 93 f6 16 sts 0x16F6, r25 ; 0x8016f6 ef46: 80 93 f5 16 sts 0x16F5, r24 ; 0x8016f5 ef4a: 00 97 sbiw r24, 0x00 ; 0 ef4c: 09 f4 brne .+2 ; 0xef50 ef4e: 41 c0 rjmp .+130 ; 0xefd2 ef50: f8 01 movw r30, r16 { byte checksum = 0; ef52: f1 2c mov r15, r1 char *p = cmd_head; while (p != strchr_pointer) ef54: 8e 17 cp r24, r30 ef56: 9f 07 cpc r25, r31 ef58: f1 f0 breq .+60 ; 0xef96 checksum = checksum^(*p++); ef5a: 21 91 ld r18, Z+ ef5c: f2 26 eor r15, r18 ef5e: fa cf rjmp .-12 ; 0xef54 while (*cmd_start == ' ') ++cmd_start; // Test whether the successive lines are stamped with an increasing line number ID. if(gcode_N != gcode_LastN+1 && strncmp_P(cmd_start, PSTR("M110"), 4)) { // Line numbers not sent in succession and M110 not seen. SERIAL_ERROR_START; ef60: 84 e4 ldi r24, 0x44 ; 68 ef62: 9d e9 ldi r25, 0x9D ; 157 ef64: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ERRORRPGM(_n("Line Number is not Last Line Number+1, Last Line: "));////MSG_ERR_LINE_NO ef68: 80 e2 ldi r24, 0x20 ; 32 ef6a: 93 e6 ldi r25, 0x63 ; 99 char *p = cmd_head; while (p != strchr_pointer) checksum = checksum^(*p++); if (code_value_short() != (int16_t)checksum) { SERIAL_ERROR_START; SERIAL_ERRORRPGM(_n("checksum mismatch, Last Line: "));////MSG_ERR_CHECKSUM_MISMATCH ef6c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 ef70: 60 91 d1 11 lds r22, 0x11D1 ; 0x8011d1 ef74: 70 91 d2 11 lds r23, 0x11D2 ; 0x8011d2 ef78: 80 91 d3 11 lds r24, 0x11D3 ; 0x8011d3 ef7c: 90 91 d4 11 lds r25, 0x11D4 ; 0x8011d4 ef80: 0f 94 a2 96 call 0x32d44 ; 0x32d44 } void MarlinSerial::println(long n, int base) { print(n, base); println(); ef84: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 SERIAL_ERRORLN(gcode_LastN); FlushSerialRequestResend(); ef88: 0e 94 e2 54 call 0xa9c4 ; 0xa9c4 serial_count = 0; ef8c: 10 92 db 0f sts 0x0FDB, r1 ; 0x800fdb ef90: 10 92 da 0f sts 0x0FDA, r1 ; 0x800fda ef94: 69 ce rjmp .-814 ; 0xec68 { byte checksum = 0; char *p = cmd_head; while (p != strchr_pointer) checksum = checksum^(*p++); if (code_value_short() != (int16_t)checksum) { ef96: 0e 94 4d 55 call 0xaa9a ; 0xaa9a ef9a: f8 16 cp r15, r24 ef9c: 19 06 cpc r1, r25 ef9e: 39 f0 breq .+14 ; 0xefae SERIAL_ERROR_START; efa0: 84 e4 ldi r24, 0x44 ; 68 efa2: 9d e9 ldi r25, 0x9D ; 157 efa4: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ERRORRPGM(_n("checksum mismatch, Last Line: "));////MSG_ERR_CHECKSUM_MISMATCH efa8: 81 e0 ldi r24, 0x01 ; 1 efaa: 93 e6 ldi r25, 0x63 ; 99 efac: df cf rjmp .-66 ; 0xef6c FlushSerialRequestResend(); serial_count = 0; return; } // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; efae: e0 91 f5 16 lds r30, 0x16F5 ; 0x8016f5 efb2: f0 91 f6 16 lds r31, 0x16F6 ; 0x8016f6 efb6: 10 82 st Z, r1 return; } } // Handle KILL early, even when Stopped if(strcmp_P(cmd_start, PSTR("M112")) == 0) efb8: e9 80 ldd r14, Y+1 ; 0x01 efba: fa 80 ldd r15, Y+2 ; 0x02 efbc: 66 e8 ldi r22, 0x86 ; 134 efbe: 72 e7 ldi r23, 0x72 ; 114 efc0: c7 01 movw r24, r14 efc2: 0f 94 8a 9d call 0x33b14 ; 0x33b14 efc6: 89 2b or r24, r25 efc8: 39 f5 brne .+78 ; 0xf018 kill(MSG_M112_KILL); efca: 87 e6 ldi r24, 0x67 ; 103 efcc: 95 e6 ldi r25, 0x65 ; 101 efce: 0e 94 df 72 call 0xe5be ; 0xe5be // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; } else { SERIAL_ERROR_START; efd2: 84 e4 ldi r24, 0x44 ; 68 efd4: 9d e9 ldi r25, 0x9D ; 157 efd6: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM efda: 87 ed ldi r24, 0xD7 ; 215 efdc: 92 e6 ldi r25, 0x62 ; 98 efde: c6 cf rjmp .-116 ; 0xef6c } } else { // move cmd_start past all spaces while (*cmd_start == ' ') ++cmd_start; efe0: 89 81 ldd r24, Y+1 ; 0x01 efe2: 9a 81 ldd r25, Y+2 ; 0x02 efe4: fc 01 movw r30, r24 efe6: 20 81 ld r18, Z efe8: 20 32 cpi r18, 0x20 ; 32 efea: 21 f4 brne .+8 ; 0xeff4 efec: 01 96 adiw r24, 0x01 ; 1 efee: 9a 83 std Y+2, r25 ; 0x02 eff0: 89 83 std Y+1, r24 ; 0x01 eff2: f6 cf rjmp .-20 ; 0xefe0 // if we didn't receive 'N' but still see '*' if (strchr(cmd_start, '*') != NULL) eff4: 6a e2 ldi r22, 0x2A ; 42 eff6: 70 e0 ldi r23, 0x00 ; 0 eff8: 0f 94 33 a6 call 0x34c66 ; 0x34c66 effc: 89 2b or r24, r25 effe: 39 f0 breq .+14 ; 0xf00e { SERIAL_ERROR_START; f000: 84 e4 ldi r24, 0x44 ; 68 f002: 9d e9 ldi r25, 0x9D ; 157 f004: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ERRORRPGM(_n("No Line Number with checksum, Last Line: "));////MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM f008: 8d ea ldi r24, 0xAD ; 173 f00a: 92 e6 ldi r25, 0x62 ; 98 f00c: af cf rjmp .-162 ; 0xef6c cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; // terminate string char* cmd_head = cmdbuffer+bufindw+CMDHDRSIZE; // current command pointer char* cmd_start = cmd_head; // pointer past the line number (if any) if(!comment_mode){ long gcode_N = -1; // seen line number f00e: 44 24 eor r4, r4 f010: 4a 94 dec r4 f012: 54 2c mov r5, r4 f014: 32 01 movw r6, r4 f016: d0 cf rjmp .-96 ; 0xefb8 if(strcmp_P(cmd_start, PSTR("M112")) == 0) kill(MSG_M112_KILL); // Bypass Stopped for some commands bool allow_when_stopped = false; if(strncmp_P(cmd_start, PSTR("M310"), 4) == 0) f018: 44 e0 ldi r20, 0x04 ; 4 f01a: 50 e0 ldi r21, 0x00 ; 0 f01c: 61 e8 ldi r22, 0x81 ; 129 f01e: 72 e7 ldi r23, 0x72 ; 114 f020: c7 01 movw r24, r14 f022: 0f 94 bb 9d call 0x33b76 ; 0x33b76 f026: 5c 01 movw r10, r24 allow_when_stopped = true; // Handle the USB timer if ((*cmd_start == 'G') && (GetPrinterState() != PrinterState::IsSDPrinting)) { f028: f7 01 movw r30, r14 f02a: 80 81 ld r24, Z f02c: 87 34 cpi r24, 0x47 ; 71 f02e: 81 f4 brne .+32 ; 0xf050 f030: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.367> f034: 85 30 cpi r24, 0x05 ; 5 f036: 61 f0 breq .+24 ; 0xf050 usb_timer.start(); f038: 85 ed ldi r24, 0xD5 ; 213 f03a: 91 e1 ldi r25, 0x11 ; 17 f03c: 0f 94 d6 0f call 0x21fac ; 0x21fac ::start()> PrinterState GetPrinterState() { return printer_state; } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; f040: f6 e0 ldi r31, 0x06 ; 6 f042: f0 93 cb 0d sts 0x0DCB, r31 ; 0x800dcb <_ZL13printer_state.lto_priv.367> if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); f046: 60 e0 ldi r22, 0x00 ; 0 f048: 85 ea ldi r24, 0xA5 ; 165 f04a: 9f e0 ldi r25, 0x0F ; 15 f04c: 0f 94 00 a0 call 0x34000 ; 0x34000 SetPrinterState(PrinterState::IsHostPrinting); //set printer state busy printing to hide LCD menu while USB printing eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO, PowerPanic::NO_PENDING_RECOVERY); } if (allow_when_stopped == false && Stopped == true) { f050: ab 28 or r10, r11 f052: 21 f0 breq .+8 ; 0xf05c f054: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce f058: 81 11 cpse r24, r1 f05a: 98 cf rjmp .-208 ; 0xef8c } // Command is complete: store the current line into buffer, move to the next line. // Store type of entry cmdbuffer[bufindw] = gcode_N >= 0 ? CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR : CMDBUFFER_CURRENT_TYPE_USB; f05c: 26 e0 ldi r18, 0x06 ; 6 f05e: 77 fc sbrc r7, 7 f060: 21 e0 ldi r18, 0x01 ; 1 f062: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> f066: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f06a: fc 01 movw r30, r24 f06c: e2 52 subi r30, 0x22 ; 34 f06e: f0 4f sbci r31, 0xF0 ; 240 f070: 20 83 st Z, r18 SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ // Store the command itself (without line number or checksum) size_t cmd_len; if (cmd_head == cmd_start) f072: 49 81 ldd r20, Y+1 ; 0x01 f074: 5a 81 ldd r21, Y+2 ; 0x02 cmd_len = strlen(cmd_start) + 1; f076: f8 01 movw r30, r16 SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ // Store the command itself (without line number or checksum) size_t cmd_len; if (cmd_head == cmd_start) f078: da 01 movw r26, r20 f07a: 40 17 cp r20, r16 f07c: 51 07 cpc r21, r17 f07e: a1 f5 brne .+104 ; 0xf0e8 cmd_len = strlen(cmd_start) + 1; f080: 01 90 ld r0, Z+ f082: 00 20 and r0, r0 f084: e9 f7 brne .-6 ; 0xf080 f086: 9f 01 movw r18, r30 f088: 20 1b sub r18, r16 f08a: 31 0b sbc r19, r17 // strip the line number cmd_len = 0; do { cmd_head[cmd_len] = cmd_start[cmd_len]; } while (cmd_head[cmd_len++]); } bufindw += cmd_len + CMDHDRSIZE; f08c: 03 96 adiw r24, 0x03 ; 3 f08e: 28 0f add r18, r24 f090: 39 1f adc r19, r25 if (bufindw == sizeof(cmdbuffer)) f092: 2d 3e cpi r18, 0xED ; 237 f094: f1 e0 ldi r31, 0x01 ; 1 f096: 3f 07 cpc r19, r31 f098: 79 f1 breq .+94 ; 0xf0f8 // strip the line number cmd_len = 0; do { cmd_head[cmd_len] = cmd_start[cmd_len]; } while (cmd_head[cmd_len++]); } bufindw += cmd_len + CMDHDRSIZE; f09a: 30 93 dd 0f sts 0x0FDD, r19 ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f09e: 20 93 dc 0f sts 0x0FDC, r18 ; 0x800fdc <_ZL7bufindw.lto_priv.516> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; f0a2: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf f0a6: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 f0aa: 01 96 adiw r24, 0x01 ; 1 f0ac: 90 93 d0 11 sts 0x11D0, r25 ; 0x8011d0 f0b0: 80 93 cf 11 sts 0x11CF, r24 ; 0x8011cf // Update the processed gcode line if (gcode_N >= 0) f0b4: 77 fc sbrc r7, 7 f0b6: 08 c0 rjmp .+16 ; 0xf0c8 gcode_LastN = gcode_N; f0b8: 40 92 d1 11 sts 0x11D1, r4 ; 0x8011d1 f0bc: 50 92 d2 11 sts 0x11D2, r5 ; 0x8011d2 f0c0: 60 92 d3 11 sts 0x11D3, r6 ; 0x8011d3 f0c4: 70 92 d4 11 sts 0x11D4, r7 ; 0x8011d4 SERIAL_ECHOPGM("Number of commands in the buffer: "); SERIAL_ECHO(buflen); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } // end of 'not comment mode' serial_count = 0; //clear buffer f0c8: 10 92 db 0f sts 0x0FDB, r1 ; 0x800fdb f0cc: 10 92 da 0f sts 0x0FDA, r1 ; 0x800fda // Don't call cmdqueue_could_enqueue_back if there are no characters waiting // in the queue, as this function will reserve the memory. if (MYSERIAL.available() == 0 || ! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1)) f0d0: 0e 94 c0 54 call 0xa980 ; 0xa980 f0d4: 89 2b or r24, r25 f0d6: 09 f4 brne .+2 ; 0xf0da f0d8: c7 cd rjmp .-1138 ; 0xec68 f0da: 8f e5 ldi r24, 0x5F ; 95 f0dc: 90 e0 ldi r25, 0x00 ; 0 f0de: 0e 94 bc 55 call 0xab78 ; 0xab78 f0e2: 81 11 cpse r24, r1 f0e4: 7f cd rjmp .-1282 ; 0xebe4 f0e6: c0 cd rjmp .-1152 ; 0xec68 if (cmd_head == cmd_start) cmd_len = strlen(cmd_start) + 1; else { // strip the line number cmd_len = 0; do { cmd_head[cmd_len] = cmd_start[cmd_len]; } f0e8: 6d 91 ld r22, X+ f0ea: 61 93 st Z+, r22 f0ec: 9d 01 movw r18, r26 f0ee: 24 1b sub r18, r20 f0f0: 35 0b sbc r19, r21 while (cmd_head[cmd_len++]); f0f2: 61 11 cpse r22, r1 f0f4: f9 cf rjmp .-14 ; 0xf0e8 f0f6: ca cf rjmp .-108 ; 0xf08c } bufindw += cmd_len + CMDHDRSIZE; if (bufindw == sizeof(cmdbuffer)) bufindw = 0; f0f8: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f0fc: 10 92 dc 0f sts 0x0FDC, r1 ; 0x800fdc <_ZL7bufindw.lto_priv.516> f100: d0 cf rjmp .-96 ; 0xf0a2 #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { f102: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca f106: 60 e2 ldi r22, 0x20 ; 32 f108: 73 e0 ldi r23, 0x03 ; 3 f10a: 81 11 cpse r24, r1 f10c: 02 c0 rjmp .+4 ; 0xf112 f10e: 60 ed ldi r22, 0xD0 ; 208 f110: 77 e0 ldi r23, 0x07 ; 7 f112: 81 e2 ldi r24, 0x21 ; 33 f114: 93 e0 ldi r25, 0x03 ; 3 f116: 0f 94 a7 0f call 0x21f4e ; 0x21f4e ::expired(unsigned short)> f11a: 88 23 and r24, r24 f11c: 09 f4 brne .+2 ; 0xf120 f11e: a0 cd rjmp .-1216 ; 0xec60 comment_mode = false; f120: 10 92 20 03 sts 0x0320, r1 ; 0x800320 serial_count = 0; f124: 10 92 db 0f sts 0x0FDB, r1 ; 0x800fdb f128: 10 92 da 0f sts 0x0FDA, r1 ; 0x800fda SERIAL_ECHOLNPGM("RX timeout"); f12c: 86 e7 ldi r24, 0x76 ; 118 f12e: 92 e7 ldi r25, 0x72 ; 114 f130: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 f134: 99 cd rjmp .-1230 ; 0xec68 return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ f136: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd f13a: 88 23 and r24, r24 f13c: 09 f4 brne .+2 ; 0xf140 f13e: 94 cd rjmp .-1240 ; 0xec68 f140: 80 91 da 0f lds r24, 0x0FDA ; 0x800fda f144: 90 91 db 0f lds r25, 0x0FDB ; 0x800fdb f148: 89 2b or r24, r25 f14a: 09 f0 breq .+2 ; 0xf14e f14c: 8d cd rjmp .-1254 ; 0xec68 //'#' stops reading from SD to the buffer prematurely, so procedural macro calls are possible // if it occurs, stop_buffering is triggered and the buffer is ran dry. // this character _can_ occur in serial com, due to checksums. however, no checksums are used in SD printing static bool stop_buffering=false; if(buflen==0) stop_buffering=false; f14e: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf f152: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 f156: 89 2b or r24, r25 f158: 11 f4 brne .+4 ; 0xf15e f15a: 10 92 1f 03 sts 0x031F, r1 ; 0x80031f return; // prevent cycling indefinitely - let manage_heaters do their job } // The new command buffer could be updated non-atomically, because it is not yet considered // to be inside the active queue. sd_count.value = card.get_sdpos() - sdpos_atomic; cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_SDCARD; f15e: 12 e0 ldi r17, 0x02 ; 2 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; f160: 01 e0 ldi r16, 0x01 ; 1 } lohi; uint16_t value; } sd_count; sd_count.value = 0; // Reads whole lines from the SD card. Never leaves a half-filled line in the cmdbuffer. while( !card.eof() && !stop_buffering) { f162: 40 91 7e 16 lds r20, 0x167E ; 0x80167e f166: 50 91 7f 16 lds r21, 0x167F ; 0x80167f f16a: 60 91 80 16 lds r22, 0x1680 ; 0x801680 f16e: 70 91 81 16 lds r23, 0x1681 ; 0x801681 f172: 80 91 77 16 lds r24, 0x1677 ; 0x801677 f176: 90 91 78 16 lds r25, 0x1678 ; 0x801678 f17a: a0 91 79 16 lds r26, 0x1679 ; 0x801679 f17e: b0 91 7a 16 lds r27, 0x167A ; 0x80167a f182: 48 17 cp r20, r24 f184: 59 07 cpc r21, r25 f186: 6a 07 cpc r22, r26 f188: 7b 07 cpc r23, r27 f18a: 08 f0 brcs .+2 ; 0xf18e f18c: c1 c0 rjmp .+386 ; 0xf310 f18e: 80 91 1f 03 lds r24, 0x031F ; 0x80031f f192: 81 11 cpse r24, r1 f194: bd c0 rjmp .+378 ; 0xf310 FORCE_INLINE bool isFileOpen() { return file.isOpen(); } bool eof() { return sdpos>=filesize; } FORCE_INLINE int16_t getFilteredGcodeChar() { int16_t c = (int16_t)file.readFilteredGcode(); f196: 0f 94 ce 48 call 0x2919c ; 0x2919c bool createContiguous(SdBaseFile* dirFile, const char* path, uint32_t size); /** \return The current cluster number for a file or directory. */ uint32_t curCluster() const {return curCluster_;} /** \return The current position for a file or directory. */ uint32_t curPosition() const {return curPosition_;} f19a: 40 91 02 16 lds r20, 0x1602 ; 0x801602 f19e: 50 91 03 16 lds r21, 0x1603 ; 0x801603 f1a2: 60 91 04 16 lds r22, 0x1604 ; 0x801604 f1a6: 70 91 05 16 lds r23, 0x1605 ; 0x801605 sdpos = file.curPosition(); f1aa: 40 93 7e 16 sts 0x167E, r20 ; 0x80167e f1ae: 50 93 7f 16 sts 0x167F, r21 ; 0x80167f f1b2: 60 93 80 16 sts 0x1680, r22 ; 0x801680 f1b6: 70 93 81 16 sts 0x1681, r23 ; 0x801681 f1ba: 20 91 da 0f lds r18, 0x0FDA ; 0x800fda f1be: 30 91 db 0f lds r19, 0x0FDB ; 0x800fdb int16_t n=card.getFilteredGcodeChar(); char serial_char = (char)n; if( serial_char == '\n' f1c2: 8a 30 cpi r24, 0x0A ; 10 f1c4: 61 f0 breq .+24 ; 0xf1de || serial_char == '\r' f1c6: 8d 30 cpi r24, 0x0D ; 13 f1c8: 51 f0 breq .+20 ; 0xf1de || serial_char == '#' f1ca: 83 32 cpi r24, 0x23 ; 35 f1cc: 09 f4 brne .+2 ; 0xf1d0 f1ce: 87 c0 rjmp .+270 ; 0xf2de || serial_count >= (MAX_CMD_SIZE - 1) f1d0: 2f 35 cpi r18, 0x5F ; 95 f1d2: 31 05 cpc r19, r1 f1d4: 24 f4 brge .+8 ; 0xf1de || n==-1 f1d6: 8f 3f cpi r24, 0xFF ; 255 f1d8: 98 07 cpc r25, r24 f1da: 09 f0 breq .+2 ; 0xf1de f1dc: 87 c0 rjmp .+270 ; 0xf2ec ){ if(serial_char=='#') stop_buffering=true; if(!serial_count) f1de: 21 15 cp r18, r1 f1e0: 31 05 cpc r19, r1 f1e2: 09 f4 brne .+2 ; 0xf1e6 f1e4: 41 cd rjmp .-1406 ; 0xec68 return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; FORCE_INLINE uint8_t percentDone(){if(!isFileOpen()) return 0; if(filesize) return sdpos/((filesize+99)/100); else return 0;}; FORCE_INLINE char* getWorkDirName(){workDir.getFilename(filename);return filename;}; FORCE_INLINE uint32_t get_sdpos() { if (!isFileOpen()) return 0; else return(sdpos); }; f1e6: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd f1ea: 81 11 cpse r24, r1 f1ec: 03 c0 rjmp .+6 ; 0xf1f4 f1ee: 40 e0 ldi r20, 0x00 ; 0 f1f0: 50 e0 ldi r21, 0x00 ; 0 f1f2: ba 01 movw r22, r20 // to the following non-empty line. return; // prevent cycling indefinitely - let manage_heaters do their job } // The new command buffer could be updated non-atomically, because it is not yet considered // to be inside the active queue. sd_count.value = card.get_sdpos() - sdpos_atomic; f1f4: 80 91 dc 11 lds r24, 0x11DC ; 0x8011dc f1f8: 90 91 dd 11 lds r25, 0x11DD ; 0x8011dd f1fc: 48 1b sub r20, r24 f1fe: 59 0b sbc r21, r25 cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_SDCARD; f200: a0 91 dc 0f lds r26, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> f204: b0 91 dd 0f lds r27, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f208: fd 01 movw r30, r26 f20a: e2 52 subi r30, 0x22 ; 34 f20c: f0 4f sbci r31, 0xF0 ; 240 f20e: 10 83 st Z, r17 cmdbuffer[bufindw+1] = sd_count.lohi.lo; f210: 41 83 std Z+1, r20 ; 0x01 cmdbuffer[bufindw+2] = sd_count.lohi.hi; f212: 52 83 std Z+2, r21 ; 0x02 f214: 13 96 adiw r26, 0x03 ; 3 cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string f216: 22 52 subi r18, 0x22 ; 34 f218: 30 4f sbci r19, 0xF0 ; 240 f21a: f9 01 movw r30, r18 f21c: ea 0f add r30, r26 f21e: fb 1f adc r31, r27 f220: 10 82 st Z, r1 // Calculate the length before disabling the interrupts. uint8_t len = strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE); f222: a2 52 subi r26, 0x22 ; 34 f224: b0 4f sbci r27, 0xF0 ; 240 f226: fd 01 movw r30, r26 f228: 01 90 ld r0, Z+ f22a: 00 20 and r0, r0 f22c: e9 f7 brne .-6 ; 0xf228 f22e: 31 97 sbiw r30, 0x01 ; 1 f230: ea 1b sub r30, r26 f232: fb 0b sbc r31, r27 // MYSERIAL.print(cmdbuffer); // SERIAL_ECHOPGM("buflen:"); // MYSERIAL.print(buflen+1); sd_count.value = 0; cli(); f234: f8 94 cli // This block locks the interrupts globally for 3.56 us, // which corresponds to a maximum repeat frequency of 280.70 kHz. // This blocking is safe in the context of a 10kHz stepper driver interrupt // or a 115200 Bd serial line receive interrupt, which will not trigger faster than 12kHz. ++ buflen; f236: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf f23a: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 f23e: 01 96 adiw r24, 0x01 ; 1 f240: 90 93 d0 11 sts 0x11D0, r25 ; 0x8011d0 f244: 80 93 cf 11 sts 0x11CF, r24 ; 0x8011cf cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_SDCARD; cmdbuffer[bufindw+1] = sd_count.lohi.lo; cmdbuffer[bufindw+2] = sd_count.lohi.hi; cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string // Calculate the length before disabling the interrupts. uint8_t len = strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE); f248: ec 5f subi r30, 0xFC ; 252 // This block locks the interrupts globally for 3.56 us, // which corresponds to a maximum repeat frequency of 280.70 kHz. // This blocking is safe in the context of a 10kHz stepper driver interrupt // or a 115200 Bd serial line receive interrupt, which will not trigger faster than 12kHz. ++ buflen; bufindw += len; f24a: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> f24e: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f252: e8 0f add r30, r24 f254: f9 2f mov r31, r25 f256: f1 1d adc r31, r1 f258: f0 93 dd 0f sts 0x0FDD, r31 ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f25c: e0 93 dc 0f sts 0x0FDC, r30 ; 0x800fdc <_ZL7bufindw.lto_priv.516> f260: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd f264: 88 23 and r24, r24 f266: 09 f4 brne .+2 ; 0xf26a f268: 3d c0 rjmp .+122 ; 0xf2e4 f26a: 80 91 7e 16 lds r24, 0x167E ; 0x80167e f26e: 90 91 7f 16 lds r25, 0x167F ; 0x80167f f272: a0 91 80 16 lds r26, 0x1680 ; 0x801680 f276: b0 91 81 16 lds r27, 0x1681 ; 0x801681 sdpos_atomic = card.get_sdpos(); f27a: 80 93 dc 11 sts 0x11DC, r24 ; 0x8011dc f27e: 90 93 dd 11 sts 0x11DD, r25 ; 0x8011dd f282: a0 93 de 11 sts 0x11DE, r26 ; 0x8011de f286: b0 93 df 11 sts 0x11DF, r27 ; 0x8011df if (bufindw == sizeof(cmdbuffer)) f28a: ed 3e cpi r30, 0xED ; 237 f28c: f1 40 sbci r31, 0x01 ; 1 f28e: 21 f4 brne .+8 ; 0xf298 bufindw = 0; f290: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f294: 10 92 dc 0f sts 0x0FDC, r1 ; 0x800fdc <_ZL7bufindw.lto_priv.516> sei(); f298: 78 94 sei comment_mode = false; //for new command f29a: 10 92 20 03 sts 0x0320, r1 ; 0x800320 serial_count = 0; //clear buffer f29e: 10 92 db 0f sts 0x0FDB, r1 ; 0x800fdb f2a2: 10 92 da 0f sts 0x0FDA, r1 ; 0x800fda if(card.eof()) break; f2a6: 40 91 7e 16 lds r20, 0x167E ; 0x80167e f2aa: 50 91 7f 16 lds r21, 0x167F ; 0x80167f f2ae: 60 91 80 16 lds r22, 0x1680 ; 0x801680 f2b2: 70 91 81 16 lds r23, 0x1681 ; 0x801681 f2b6: 80 91 77 16 lds r24, 0x1677 ; 0x801677 f2ba: 90 91 78 16 lds r25, 0x1678 ; 0x801678 f2be: a0 91 79 16 lds r26, 0x1679 ; 0x801679 f2c2: b0 91 7a 16 lds r27, 0x167A ; 0x80167a f2c6: 48 17 cp r20, r24 f2c8: 59 07 cpc r21, r25 f2ca: 6a 07 cpc r22, r26 f2cc: 7b 07 cpc r23, r27 f2ce: 00 f5 brcc .+64 ; 0xf310 // The following line will reserve buffer space if available. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1)) f2d0: 8f e5 ldi r24, 0x5F ; 95 f2d2: 90 e0 ldi r25, 0x00 ; 0 f2d4: 0e 94 bc 55 call 0xab78 ; 0xab78 f2d8: 81 11 cpse r24, r1 f2da: 43 cf rjmp .-378 ; 0xf162 f2dc: c5 cc rjmp .-1654 ; 0xec68 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; f2de: 00 93 1f 03 sts 0x031F, r16 ; 0x80031f f2e2: 7d cf rjmp .-262 ; 0xf1de f2e4: 80 e0 ldi r24, 0x00 ; 0 f2e6: 90 e0 ldi r25, 0x00 ; 0 f2e8: dc 01 movw r26, r24 f2ea: c7 cf rjmp .-114 ; 0xf27a return; } else { // there are no comments coming from the filtered file cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; f2ec: a9 01 movw r20, r18 f2ee: 4f 5f subi r20, 0xFF ; 255 f2f0: 5f 4f sbci r21, 0xFF ; 255 f2f2: 50 93 db 0f sts 0x0FDB, r21 ; 0x800fdb f2f6: 40 93 da 0f sts 0x0FDA, r20 ; 0x800fda f2fa: 40 91 dc 0f lds r20, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> f2fe: 50 91 dd 0f lds r21, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f302: 42 52 subi r20, 0x22 ; 34 f304: 50 4f sbci r21, 0xF0 ; 240 f306: 24 0f add r18, r20 f308: 35 1f adc r19, r21 f30a: f9 01 movw r30, r18 f30c: 83 83 std Z+3, r24 ; 0x03 f30e: 29 cf rjmp .-430 ; 0xf162 } } if(card.eof()) f310: 40 91 7e 16 lds r20, 0x167E ; 0x80167e f314: 50 91 7f 16 lds r21, 0x167F ; 0x80167f f318: 60 91 80 16 lds r22, 0x1680 ; 0x801680 f31c: 70 91 81 16 lds r23, 0x1681 ; 0x801681 f320: 80 91 77 16 lds r24, 0x1677 ; 0x801677 f324: 90 91 78 16 lds r25, 0x1678 ; 0x801678 f328: a0 91 79 16 lds r26, 0x1679 ; 0x801679 f32c: b0 91 7a 16 lds r27, 0x167A ; 0x80167a f330: 48 17 cp r20, r24 f332: 59 07 cpc r21, r25 f334: 6a 07 cpc r22, r26 f336: 7b 07 cpc r23, r27 f338: 08 f4 brcc .+2 ; 0xf33c f33a: 96 cc rjmp .-1748 ; 0xec68 { // file was fully buffered, but commands might still need to be planned! // do *not* clear sdprinting until all SD commands are consumed to ensure // SD state can be resumed from a saved printing state. sdprinting is only // cleared by printingHasFinished after peforming all remaining moves. if(!cmdqueue_calc_sd_length()) f33c: 0e 94 93 6f call 0xdf26 ; 0xdf26 f340: 89 2b or r24, r25 f342: 09 f0 breq .+2 ; 0xf346 f344: 91 cc rjmp .-1758 ; 0xec68 { // queue is complete, but before we process EOF commands prevent // re-entry by disabling SD processing from any st_synchronize call card.closefile(); f346: 0f 94 e4 41 call 0x283c8 ; 0x283c8 SERIAL_PROTOCOLLNRPGM(_n("Done printing file"));////MSG_FILE_PRINTED f34a: 8a e9 ldi r24, 0x9A ; 154 f34c: 92 e6 ldi r25, 0x62 ; 98 f34e: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 char time[30]; uint32_t t = print_job_timer.duration() / 60; f352: 0f 94 66 1c call 0x238cc ; 0x238cc f356: 6b 01 movw r12, r22 f358: 7c 01 movw r14, r24 int hours, minutes; minutes = t % 60; hours = t / 60; save_statistics(); f35a: 0e 94 38 5f call 0xbe70 ; 0xbe70 // re-entry by disabling SD processing from any st_synchronize call card.closefile(); SERIAL_PROTOCOLLNRPGM(_n("Done printing file"));////MSG_FILE_PRINTED char time[30]; uint32_t t = print_job_timer.duration() / 60; f35e: 8c e3 ldi r24, 0x3C ; 60 f360: 88 2e mov r8, r24 f362: 91 2c mov r9, r1 f364: a1 2c mov r10, r1 f366: b1 2c mov r11, r1 f368: c7 01 movw r24, r14 f36a: b6 01 movw r22, r12 f36c: a5 01 movw r20, r10 f36e: 94 01 movw r18, r8 f370: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> int hours, minutes; minutes = t % 60; f374: ca 01 movw r24, r20 f376: b9 01 movw r22, r18 f378: a5 01 movw r20, r10 f37a: 94 01 movw r18, r8 f37c: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> hours = t / 60; save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); f380: 7f 93 push r23 f382: 6f 93 push r22 SERIAL_PROTOCOLLNRPGM(_n("Done printing file"));////MSG_FILE_PRINTED char time[30]; uint32_t t = print_job_timer.duration() / 60; int hours, minutes; minutes = t % 60; hours = t / 60; f384: c7 01 movw r24, r14 f386: b6 01 movw r22, r12 f388: 20 e1 ldi r18, 0x10 ; 16 f38a: 3e e0 ldi r19, 0x0E ; 14 f38c: 40 e0 ldi r20, 0x00 ; 0 f38e: 50 e0 ldi r21, 0x00 ; 0 f390: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); f394: 3f 93 push r19 f396: 2f 93 push r18 f398: 82 e6 ldi r24, 0x62 ; 98 f39a: 92 e7 ldi r25, 0x72 ; 114 f39c: 9f 93 push r25 f39e: 8f 93 push r24 f3a0: 8e 01 movw r16, r28 f3a2: 0f 5f subi r16, 0xFF ; 255 f3a4: 1f 4f sbci r17, 0xFF ; 255 f3a6: 1f 93 push r17 f3a8: 0f 93 push r16 f3aa: 0f 94 f3 9e call 0x33de6 ; 0x33de6 SERIAL_ECHO_START; f3ae: 81 e6 ldi r24, 0x61 ; 97 f3b0: 9d e9 ldi r25, 0x9D ; 157 f3b2: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLN(time); f3b6: c8 01 movw r24, r16 f3b8: 0f 94 fd 98 call 0x331fa ; 0x331fa #ifndef SHOW_FILENAME_AFTER_FINISH lcd_setstatus(time); f3bc: c8 01 movw r24, r16 f3be: 0e 94 81 ef call 0x1df02 ; 0x1df02 #endif //SHOW_FILENAME_AFTER_FINISH card.printingHasFinished(); f3c2: 0f 94 3e 4d call 0x29a7c ; 0x29a7c if(!autostart_stilltocheck) return; if(autostart_atmillis.expired(5000)) return; } autostart_stilltocheck = false; f3c6: 10 92 56 02 sts 0x0256, r1 ; 0x800256 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.517> if(!mounted) f3ca: 0f b6 in r0, 0x3f ; 63 f3cc: f8 94 cli f3ce: de bf out 0x3e, r29 ; 62 f3d0: 0f be out 0x3f, r0 ; 63 f3d2: cd bf out 0x3d, r28 ; 61 f3d4: 80 91 6b 13 lds r24, 0x136B ; 0x80136b f3d8: 88 23 and r24, r24 f3da: 59 f0 breq .+22 ; 0xf3f2 f3dc: 0f 94 11 44 call 0x28822 ; 0x28822 card.checkautostart(true); if (farm_mode) f3e0: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca f3e4: 88 23 and r24, r24 f3e6: 09 f4 brne .+2 ; 0xf3ea f3e8: 3f cc rjmp .-1922 ; 0xec68 prusa_statistics(6); f3ea: 86 e0 ldi r24, 0x06 ; 6 f3ec: 0f 94 ff 97 call 0x32ffe ; 0x32ffe f3f0: 3b cc rjmp .-1930 ; 0xec68 { mount(); f3f2: 81 e0 ldi r24, 0x01 ; 1 f3f4: 0f 94 7d 4d call 0x29afa ; 0x29afa if(!mounted) //fail f3f8: 80 91 6b 13 lds r24, 0x136B ; 0x80136b f3fc: 81 11 cpse r24, r1 f3fe: ee cf rjmp .-36 ; 0xf3dc f400: ef cf rjmp .-34 ; 0xf3e0 0000f402 : } } #endif //SAFETYTIMER void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument set in Marlin.h { f402: 0f 93 push r16 f404: 1f 93 push r17 f406: cf 93 push r28 f408: df 93 push r29 f40a: d8 2f mov r29, r24 WRITE(IR_SENSOR_PIN, 0); // no pullup state = State::disabled; } bool IR_sensor::update() { switch (state) { f40c: 80 91 84 16 lds r24, 0x1684 ; 0x801684 f410: 81 30 cpi r24, 0x01 ; 1 f412: 09 f4 brne .+2 ; 0xf416 f414: 49 c0 rjmp .+146 ; 0xf4a8 f416: 82 30 cpi r24, 0x02 ; 2 f418: 09 f4 brne .+2 ; 0xf41c f41a: 4d c0 rjmp .+154 ; 0xf4b6 * * If safetytimer_inactive_time is zero, feature is disabled (heating is never turned off because of inactivity) */ static void handleSafetyTimer() { if (printer_active() || !(CHECK_ALL_HEATERS) || !safetytimer_inactive_time) f41c: 0e 94 19 61 call 0xc232 ; 0xc232 f420: 81 11 cpse r24, r1 f422: ec c0 rjmp .+472 ; 0xf5fc f424: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 f428: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 f42c: 00 97 sbiw r24, 0x00 ; 0 f42e: 39 f4 brne .+14 ; 0xf43e f430: 20 91 ed 11 lds r18, 0x11ED ; 0x8011ed f434: 30 91 ee 11 lds r19, 0x11EE ; 0x8011ee f438: 23 2b or r18, r19 f43a: 09 f4 brne .+2 ; 0xf43e f43c: df c0 rjmp .+446 ; 0xf5fc f43e: 40 91 33 02 lds r20, 0x0233 ; 0x800233 f442: 50 91 34 02 lds r21, 0x0234 ; 0x800234 f446: 60 91 35 02 lds r22, 0x0235 ; 0x800235 f44a: 70 91 36 02 lds r23, 0x0236 ; 0x800236 f44e: 41 15 cp r20, r1 f450: 51 05 cpc r21, r1 f452: 61 05 cpc r22, r1 f454: 71 05 cpc r23, r1 f456: 09 f4 brne .+2 ; 0xf45a f458: d1 c0 rjmp .+418 ; 0xf5fc { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) f45a: 89 2b or r24, r25 f45c: 31 f4 brne .+12 ; 0xf46a f45e: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed f462: 90 91 ee 11 lds r25, 0x11EE ; 0x8011ee f466: 89 2b or r24, r25 f468: 29 f0 breq .+10 ; 0xf474 f46a: 80 91 1a 06 lds r24, 0x061A ; 0x80061a f46e: 88 23 and r24, r24 f470: 09 f4 brne .+2 ; 0xf474 f472: 2c c1 rjmp .+600 ; 0xf6cc { safetyTimer.start(); } else if (safetyTimer.expired(farm_mode?FARM_DEFAULT_SAFETYTIMER_TIME_ms:safetytimer_inactive_time)) f474: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca f478: 88 23 and r24, r24 f47a: 21 f0 breq .+8 ; 0xf484 f47c: 40 ee ldi r20, 0xE0 ; 224 f47e: 52 e3 ldi r21, 0x32 ; 50 f480: 69 e2 ldi r22, 0x29 ; 41 f482: 70 e0 ldi r23, 0x00 ; 0 f484: 8a e1 ldi r24, 0x1A ; 26 f486: 96 e0 ldi r25, 0x06 ; 6 f488: 0f 94 e2 0f call 0x21fc4 ; 0x21fc4 ::expired(unsigned long)> f48c: 88 23 and r24, r24 f48e: 09 f4 brne .+2 ; 0xf492 f490: b7 c0 rjmp .+366 ; 0xf600 { disable_heater(); f492: 0f 94 5f 12 call 0x224be ; 0x224be lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_HEATING_SAFETY_DISABLED)); f496: 80 e6 ldi r24, 0x60 ; 96 f498: 96 e3 ldi r25, 0x36 ; 54 f49a: 0e 94 b1 6c call 0xd962 ; 0xd962 f49e: 0f 94 47 0b call 0x2168e ; 0x2168e lcd_return_to_status(); f4a2: 0e 94 17 fe call 0x1fc2e ; 0x1fc2e f4a6: ac c0 rjmp .+344 ; 0xf600 case State::initializing: state = State::ready; // the IR sensor gets ready instantly as it's just a gpio read operation. f4a8: 82 e0 ldi r24, 0x02 ; 2 f4aa: 80 93 84 16 sts 0x1684, r24 ; 0x801684 // initialize the current filament state so that we don't create a switching event right after the sensor is ready. oldFilamentPresent = fsensor.getFilamentPresent(); f4ae: 0e 94 fc c3 call 0x187f8 ; 0x187f8 f4b2: 80 93 87 16 sts 0x1687, r24 ; 0x801687 [[fallthrough]]; case State::ready: { postponedLoadEvent = false; f4b6: 10 92 88 16 sts 0x1688, r1 ; 0x801688 sensorActionOnError = SensorActionOnError::_Continue; } } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) f4ba: 80 91 84 16 lds r24, 0x1684 ; 0x801684 f4be: 82 30 cpi r24, 0x02 ; 2 f4c0: 09 f0 breq .+2 ; 0xf4c4 f4c2: ac cf rjmp .-168 ; 0xf41c return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms f4c4: 80 91 89 16 lds r24, 0x1689 ; 0x801689 f4c8: 81 11 cpse r24, r1 f4ca: 3d c0 rjmp .+122 ; 0xf546 return false; } bool newFilamentPresent = fsensor.getFilamentPresent(); f4cc: 0e 94 fc c3 call 0x187f8 ; 0x187f8 f4d0: c8 2f mov r28, r24 if (oldFilamentPresent != newFilamentPresent) { f4d2: 80 91 87 16 lds r24, 0x1687 ; 0x801687 f4d6: c8 17 cp r28, r24 f4d8: 09 f4 brne .+2 ; 0xf4dc f4da: a0 cf rjmp .-192 ; 0xf41c oldFilamentPresent = newFilamentPresent; f4dc: c0 93 87 16 sts 0x1687, r28 ; 0x801687 eventBlankingTimer.start(); f4e0: 89 e8 ldi r24, 0x89 ; 137 f4e2: 96 e1 ldi r25, 0x16 ; 22 f4e4: 0f 94 d6 0f call 0x21fac ; 0x21fac ::start()> if (newFilamentPresent) { // filament insertion f4e8: cc 23 and r28, r28 f4ea: b1 f1 breq .+108 ; 0xf558 } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( f4ec: 80 91 85 16 lds r24, 0x1685 ; 0x801685 f4f0: 88 23 and r24, r24 f4f2: 11 f1 breq .+68 ; 0xf538 return false; } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) f4f4: 80 91 62 03 lds r24, 0x0362 ; 0x800362 f4f8: 81 11 cpse r24, r1 f4fa: 1e c0 rjmp .+60 ; 0xf538 && !( f4fc: 80 91 94 12 lds r24, 0x1294 ; 0x801294 f500: 81 30 cpi r24, 0x01 ; 1 f502: d1 f0 breq .+52 ; 0xf538 return (block_buffer_head != block_buffer_tail); } //return the nr of buffered moves FORCE_INLINE uint8_t moves_planned() { return (block_buffer_head + BLOCK_BUFFER_SIZE - block_buffer_tail) & (BLOCK_BUFFER_SIZE - 1); f504: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 f508: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 f50c: 89 1b sub r24, r25 f50e: 8f 70 andi r24, 0x0F ; 15 MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts while the MMU is in charge || moves_planned() != 0 f510: 99 f4 brne .+38 ; 0xf538 || printJobOngoing() f512: 0e 94 c8 60 call 0xc190 ; 0xc190 f516: 81 11 cpse r24, r1 f518: 0f c0 rjmp .+30 ; 0xf538 || (lcd_commands_type == LcdCommands::Layer1Cal) f51a: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 f51e: 84 30 cpi r24, 0x04 ; 4 f520: 59 f0 breq .+22 ; 0xf538 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) f522: 8f e5 ldi r24, 0x5F ; 95 f524: 9f e0 ldi r25, 0x0F ; 15 f526: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( f52a: 81 11 cpse r24, r1 f52c: 05 c0 rjmp .+10 ; 0xf538 || printJobOngoing() || (lcd_commands_type == LcdCommands::Layer1Cal) || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) ) ) { menu_submenu(lcd_AutoLoadFilament, true); f52e: 61 e0 ldi r22, 0x01 ; 1 f530: 83 e0 ldi r24, 0x03 ; 3 f532: 98 e3 ldi r25, 0x38 ; 56 f534: 0f 94 29 94 call 0x32852 ; 0x32852 oldFilamentPresent = newFilamentPresent; eventBlankingTimer.start(); if (newFilamentPresent) { // filament insertion // puts_P(PSTR("filament inserted")); triggerFilamentInserted(); postponedLoadEvent = true; f538: 81 e0 ldi r24, 0x01 ; 1 f53a: 80 93 88 16 sts 0x1688, r24 ; 0x801688 void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument set in Marlin.h { #ifdef FILAMENT_SENSOR if (fsensor.update()) { lcd_draw_update = 1; //cause lcd update so that fsensor event polling can be done from the lcd draw routine. f53e: 81 e0 ldi r24, 0x01 ; 1 f540: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b f544: 6b cf rjmp .-298 ; 0xf41c } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms f546: 64 e6 ldi r22, 0x64 ; 100 f548: 70 e0 ldi r23, 0x00 ; 0 f54a: 89 e8 ldi r24, 0x89 ; 137 f54c: 96 e1 ldi r25, 0x16 ; 22 f54e: 0f 94 a7 0f call 0x21f4e ; 0x21f4e ::expired(unsigned short)> f552: 81 11 cpse r24, r1 f554: bb cf rjmp .-138 ; 0xf4cc f556: 62 cf rjmp .-316 ; 0xf41c && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( f558: 80 91 86 16 lds r24, 0x1686 ; 0x801686 f55c: 88 23 and r24, r24 f55e: 79 f3 breq .-34 ; 0xf53e } void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled && (eFilamentAction == FilamentAction::None) f560: 80 91 62 03 lds r24, 0x0362 ; 0x800362 f564: 81 11 cpse r24, r1 f566: eb cf rjmp .-42 ; 0xf53e f568: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 f56c: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 f570: 89 1b sub r24, r25 f572: 8f 70 andi r24, 0x0F ; 15 && ( f574: 21 f4 brne .+8 ; 0xf57e moves_planned() != 0 || printJobOngoing() f576: 0e 94 c8 60 call 0xc190 ; 0xc190 f57a: 88 23 and r24, r24 f57c: 01 f3 breq .-64 ; 0xf53e ) && !( f57e: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 f582: 81 11 cpse r24, r1 f584: dc cf rjmp .-72 ; 0xf53e saved_printing || MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts just before the toolchange f586: 80 91 94 12 lds r24, 0x1294 ; 0x801294 f58a: 81 30 cpi r24, 0x01 ; 1 f58c: c1 f2 breq .-80 ; 0xf53e || (lcd_commands_type == LcdCommands::Layer1Cal) f58e: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 f592: 84 30 cpi r24, 0x04 ; 4 f594: a1 f2 breq .-88 ; 0xf53e || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) f596: 8f e5 ldi r24, 0x5F ; 95 f598: 9f e0 ldi r25, 0x0F ; 15 f59a: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( f59e: 81 11 cpse r24, r1 f5a0: ce cf rjmp .-100 ; 0xf53e } //! @brief Send a notification to the host. Param 'message' must reside in program memory! void sendHostNotification_P(const char* message) { printf_P(MSG_HOST_ACTION_NOTIFICATION, message); f5a2: 88 e6 ldi r24, 0x68 ; 104 f5a4: 94 e6 ldi r25, 0x64 ; 100 f5a6: 9f 93 push r25 f5a8: 8f 93 push r24 f5aa: 8e e4 ldi r24, 0x4E ; 78 f5ac: 94 e6 ldi r25, 0x64 ; 100 f5ae: 9f 93 push r25 f5b0: 8f 93 push r24 f5b2: 0f 94 9e 9e call 0x33d3c ; 0x33d3c void Filament_sensor::filRunout() { // SERIAL_ECHOLNPGM("filRunout"); sendHostNotification_P(MSG_FILAMENT_RUNOUT_DETECTED); runoutEnabled = false; f5b6: 10 92 86 16 sts 0x1686, r1 ; 0x801686 autoLoadEnabled = false; f5ba: 10 92 85 16 sts 0x1685, r1 ; 0x801685 //! //! @param z_move //! @param e_move void stop_and_save_print_to_ram(float z_move, float e_move) { if (saved_printing) return; f5be: 0f 90 pop r0 f5c0: 0f 90 pop r0 f5c2: 0f 90 pop r0 f5c4: 0f 90 pop r0 f5c6: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 f5ca: 81 11 cpse r24, r1 f5cc: 05 c0 rjmp .+10 ; 0xf5d8 f5ce: 60 e0 ldi r22, 0x00 ; 0 f5d0: 70 e0 ldi r23, 0x00 ; 0 f5d2: cb 01 movw r24, r22 f5d4: 0f 94 f1 41 call 0x283e2 ; 0x283e2 stop_and_save_print_to_ram(0, 0); restore_print_from_ram_and_continue(0); f5d8: 60 e0 ldi r22, 0x00 ; 0 f5da: 70 e0 ldi r23, 0x00 ; 0 f5dc: cb 01 movw r24, r22 f5de: 0e 94 40 61 call 0xc280 ; 0xc280 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); f5e2: 85 e6 ldi r24, 0x65 ; 101 f5e4: 9f e0 ldi r25, 0x0F ; 15 f5e6: 0e 94 0c 6f call 0xde18 ; 0xde18 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); f5ea: 81 e0 ldi r24, 0x01 ; 1 f5ec: 9f e0 ldi r25, 0x0F ; 15 f5ee: 0e 94 ff 6e call 0xddfe ; 0xddfe enquecommand_front_P(MSG_M600); f5f2: 8b e7 ldi r24, 0x7B ; 123 f5f4: 9b e6 ldi r25, 0x6B ; 107 f5f6: 0f 94 57 43 call 0x286ae ; 0x286ae f5fa: a1 cf rjmp .-190 ; 0xf53e inline constexpr Timer() : m_isRunning(false) , m_started(0) {}; void start(); void stop(){m_isRunning = false;} f5fc: 10 92 1a 06 sts 0x061A, r1 ; 0x80061a #if defined(KILL_PIN) && KILL_PIN > -1 static int killCount = 0; // make the inactivity button a bit less responsive const int KILL_DELAY = 10000; #endif if(buflen < (BUFSIZE-1)){ f600: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf f604: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 f608: 03 97 sbiw r24, 0x03 ; 3 f60a: 14 f4 brge .+4 ; 0xf610 get_command(); f60c: 0e 94 72 75 call 0xeae4 ; 0xeae4 return(block); } // Returns true if the buffer has a queued block, false otherwise FORCE_INLINE bool blocks_queued() { return (block_buffer_head != block_buffer_tail); f610: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 f614: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 } if (blocks_queued() && GetPrinterState() == PrinterState::IsHostPrinting && usb_timer.expired((USB_TIMER_TIMEOUT) / 2)) f618: 98 17 cp r25, r24 f61a: 81 f0 breq .+32 ; 0xf63c f61c: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.367> f620: 86 30 cpi r24, 0x06 ; 6 f622: 61 f4 brne .+24 ; 0xf63c f624: 68 e8 ldi r22, 0x88 ; 136 f626: 73 e1 ldi r23, 0x13 ; 19 f628: 85 ed ldi r24, 0xD5 ; 213 f62a: 91 e1 ldi r25, 0x11 ; 17 f62c: 0f 94 a7 0f call 0x21f4e ; 0x21f4e ::expired(unsigned short)> f630: 88 23 and r24, r24 f632: 21 f0 breq .+8 ; 0xf63c { // Handle the case where planned moves may take a longer time to execute than the USB timer period. // An example is the toolchange unload sequence generated by PrusaSlicer with default settings. usb_timer.start(); f634: 85 ed ldi r24, 0xD5 ; 213 f636: 91 e1 ldi r25, 0x11 ; 17 f638: 0f 94 d6 0f call 0x21fac ; 0x21fac ::start()> } if(max_inactive_time && previous_millis_cmd.expired(max_inactive_time)) f63c: 40 91 46 03 lds r20, 0x0346 ; 0x800346 f640: 50 91 47 03 lds r21, 0x0347 ; 0x800347 f644: 60 91 48 03 lds r22, 0x0348 ; 0x800348 f648: 70 91 49 03 lds r23, 0x0349 ; 0x800349 f64c: 41 15 cp r20, r1 f64e: 51 05 cpc r21, r1 f650: 61 05 cpc r22, r1 f652: 71 05 cpc r23, r1 f654: 09 f0 breq .+2 ; 0xf658 f656: 3f c0 rjmp .+126 ; 0xf6d6 kill(PSTR("Inactivity Shutdown")); if(stepper_inactive_time && previous_millis_cmd.expired(stepper_inactive_time)) { f658: 40 91 37 02 lds r20, 0x0237 ; 0x800237 f65c: 50 91 38 02 lds r21, 0x0238 ; 0x800238 f660: 60 91 39 02 lds r22, 0x0239 ; 0x800239 f664: 70 91 3a 02 lds r23, 0x023A ; 0x80023a f668: 41 15 cp r20, r1 f66a: 51 05 cpc r21, r1 f66c: 61 05 cpc r22, r1 f66e: 71 05 cpc r23, r1 f670: a9 f0 breq .+42 ; 0xf69c f672: 8a e4 ldi r24, 0x4A ; 74 f674: 93 e0 ldi r25, 0x03 ; 3 f676: 0f 94 e2 0f call 0x21fc4 ; 0x21fc4 ::expired(unsigned long)> f67a: 88 23 and r24, r24 f67c: 79 f0 breq .+30 ; 0xf69c f67e: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 f682: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 if(blocks_queued() == false && ignore_stepper_queue == false) { f686: 98 13 cpse r25, r24 f688: 09 c0 rjmp .+18 ; 0xf69c f68a: d1 11 cpse r29, r1 f68c: 07 c0 rjmp .+14 ; 0xf69c disable_x(); f68e: 17 9a sbi 0x02, 7 ; 2 f690: 10 92 a3 06 sts 0x06A3, r1 ; 0x8006a3 disable_y(); f694: 16 9a sbi 0x02, 6 ; 2 f696: 10 92 a4 06 sts 0x06A4, r1 ; 0x8006a4 disable_z(); disable_e0(); f69a: 14 9a sbi 0x02, 4 ; 2 { uint8_t x_active = 0; uint8_t y_active = 0; uint8_t z_active = 0; uint8_t e_active = 0; uint8_t tail_fan_speed = fanSpeed; f69c: c0 91 e9 11 lds r28, 0x11E9 ; 0x8011e9 block_t *block; if(block_buffer_tail != block_buffer_head) f6a0: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 f6a4: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 f6a8: 98 17 cp r25, r24 f6aa: 01 f1 breq .+64 ; 0xf6ec { uint8_t block_index = block_buffer_tail; f6ac: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 tail_fan_speed = block_buffer[block_index].fan_speed; f6b0: 9e e6 ldi r25, 0x6E ; 110 f6b2: 89 9f mul r24, r25 f6b4: f0 01 movw r30, r0 f6b6: 11 24 eor r1, r1 f6b8: e2 5f subi r30, 0xF2 ; 242 f6ba: f8 4f sbci r31, 0xF8 ; 248 f6bc: c0 81 ld r28, Z while(block_index != block_buffer_head) f6be: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 f6c2: 98 17 cp r25, r24 f6c4: 99 f0 breq .+38 ; 0xf6ec block = &block_buffer[block_index]; if(block->steps[X_AXIS].wide != 0) x_active++; if(block->steps[Y_AXIS].wide != 0) y_active++; if(block->steps[Z_AXIS].wide != 0) z_active++; if(block->steps[E_AXIS].wide != 0) e_active++; block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1); f6c6: 8f 5f subi r24, 0xFF ; 255 f6c8: 8f 70 andi r24, 0x0F ; 15 f6ca: f9 cf rjmp .-14 ; 0xf6be { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) { safetyTimer.start(); f6cc: 8a e1 ldi r24, 0x1A ; 26 f6ce: 96 e0 ldi r25, 0x06 ; 6 f6d0: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> f6d4: 95 cf rjmp .-214 ; 0xf600 // Handle the case where planned moves may take a longer time to execute than the USB timer period. // An example is the toolchange unload sequence generated by PrusaSlicer with default settings. usb_timer.start(); } if(max_inactive_time && previous_millis_cmd.expired(max_inactive_time)) f6d6: 8a e4 ldi r24, 0x4A ; 74 f6d8: 93 e0 ldi r25, 0x03 ; 3 f6da: 0f 94 e2 0f call 0x21fc4 ; 0x21fc4 ::expired(unsigned long)> f6de: 88 23 and r24, r24 f6e0: 09 f4 brne .+2 ; 0xf6e4 f6e2: ba cf rjmp .-140 ; 0xf658 kill(PSTR("Inactivity Shutdown")); f6e4: 80 eb ldi r24, 0xB0 ; 176 f6e6: 97 e7 ldi r25, 0x77 ; 119 f6e8: 0e 94 df 72 call 0xe5be ; 0xe5be if((DISABLE_Z) && (z_active == 0)) disable_z(); if((DISABLE_E) && (e_active == 0)) disable_e0(); #if defined(FAN_PIN) && FAN_PIN > -1 #ifdef FAN_KICKSTART_TIME static unsigned long fan_kick_end; if (tail_fan_speed) { f6ec: cc 23 and r28, r28 f6ee: 09 f4 brne .+2 ; 0xf6f2 f6f0: be c0 rjmp .+380 ; 0xf86e if (fan_kick_end == 0) { f6f2: 80 91 41 03 lds r24, 0x0341 ; 0x800341 f6f6: 90 91 42 03 lds r25, 0x0342 ; 0x800342 f6fa: a0 91 43 03 lds r26, 0x0343 ; 0x800343 f6fe: b0 91 44 03 lds r27, 0x0344 ; 0x800344 f702: 89 2b or r24, r25 f704: 8a 2b or r24, r26 f706: 8b 2b or r24, r27 f708: 81 f4 brne .+32 ; 0xf72a // Just starting up fan - run at full power. fan_kick_end = _millis() + FAN_KICKSTART_TIME; f70a: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 f70e: 60 5e subi r22, 0xE0 ; 224 f710: 7c 4f sbci r23, 0xFC ; 252 f712: 8f 4f sbci r24, 0xFF ; 255 f714: 9f 4f sbci r25, 0xFF ; 255 f716: 60 93 41 03 sts 0x0341, r22 ; 0x800341 f71a: 70 93 42 03 sts 0x0342, r23 ; 0x800342 f71e: 80 93 43 03 sts 0x0343, r24 ; 0x800343 f722: 90 93 44 03 sts 0x0344, r25 ; 0x800344 tail_fan_speed = 255; } else if (fan_kick_end > _millis()) // Fan still spinning up. tail_fan_speed = 255; f726: cf ef ldi r28, 0xFF ; 255 f728: 0f c0 rjmp .+30 ; 0xf748 if (tail_fan_speed) { if (fan_kick_end == 0) { // Just starting up fan - run at full power. fan_kick_end = _millis() + FAN_KICKSTART_TIME; tail_fan_speed = 255; } else if (fan_kick_end > _millis()) f72a: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 f72e: 00 91 41 03 lds r16, 0x0341 ; 0x800341 f732: 10 91 42 03 lds r17, 0x0342 ; 0x800342 f736: 20 91 43 03 lds r18, 0x0343 ; 0x800343 f73a: 30 91 44 03 lds r19, 0x0344 ; 0x800344 f73e: 60 17 cp r22, r16 f740: 71 07 cpc r23, r17 f742: 82 07 cpc r24, r18 f744: 93 07 cpc r25, r19 f746: 78 f3 brcs .-34 ; 0xf726 } else { fan_kick_end = 0; } #endif//FAN_KICKSTART_TIME #ifdef FAN_SOFT_PWM if (fan_measuring) { //if measurement is currently in process, fanSpeedSoftPwm must remain set to 255, but we must update fanSpeedBckp value f748: 80 91 84 03 lds r24, 0x0384 ; 0x800384 f74c: 88 23 and r24, r24 f74e: 09 f4 brne .+2 ; 0xf752 f750: 97 c0 rjmp .+302 ; 0xf880 fanSpeedBckp = tail_fan_speed; f752: c0 93 67 02 sts 0x0267, r28 ; 0x800267 void MMU2::mmu_loop() { // We only leave this method if the current command was successfully completed - that's the Marlin's way of blocking operation // Atomic compare_exchange would have been the most appropriate solution here, but this gets called only in Marlin's task, // so thread safety should be kept static bool avoidRecursion = false; if (avoidRecursion) { f756: 80 91 2d 04 lds r24, 0x042D ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.505> f75a: 81 11 cpse r24, r1 f75c: 07 c0 rjmp .+14 ; 0xf76c return; } avoidRecursion = true; f75e: 81 e0 ldi r24, 0x01 ; 1 f760: 80 93 2d 04 sts 0x042D, r24 ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.505> mmu_loop_inner(true); f764: 0f 94 52 64 call 0x2c8a4 ; 0x2c8a4 avoidRecursion = false; f768: 10 92 2d 04 sts 0x042D, r1 ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.505> lcd_draw_update = 2; lcd_beeper_quick_feedback(); } void lcd_knob_update() { if (lcd_backlight_wake_trigger) { f76c: 80 91 13 06 lds r24, 0x0613 ; 0x800613 <_ZL26lcd_backlight_wake_trigger.lto_priv.503> f770: 88 23 and r24, r24 f772: c9 f1 breq .+114 ; 0xf7e6 lcd_backlight_wake_trigger = false; f774: 10 92 13 06 sts 0x0613, r1 ; 0x800613 <_ZL26lcd_backlight_wake_trigger.lto_priv.503> backlight_wake(); bool did_rotate = false; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { f778: 4f b7 in r20, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); f77a: f8 94 cli if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { f77c: 80 91 11 06 lds r24, 0x0611 ; 0x800611 <_ZL16lcd_encoder_diff.lto_priv.504> f780: 28 2f mov r18, r24 f782: 08 2e mov r0, r24 f784: 00 0c add r0, r0 f786: 33 0b sbc r19, r19 f788: 37 ff sbrs r19, 7 f78a: 03 c0 rjmp .+6 ; 0xf792 f78c: 31 95 neg r19 f78e: 21 95 neg r18 f790: 31 09 sbc r19, r1 f792: 24 30 cpi r18, 0x04 ; 4 f794: 31 05 cpc r19, r1 f796: 0c f4 brge .+2 ; 0xf79a f798: 76 c0 rjmp .+236 ; 0xf886 lcd_encoder += lcd_encoder_diff / ENCODER_PULSES_PER_STEP; f79a: 98 2f mov r25, r24 f79c: 87 ff sbrs r24, 7 f79e: 02 c0 rjmp .+4 ; 0xf7a4 f7a0: 93 e0 ldi r25, 0x03 ; 3 f7a2: 98 0f add r25, r24 f7a4: 95 95 asr r25 f7a6: 95 95 asr r25 f7a8: 20 91 06 05 lds r18, 0x0506 ; 0x800506 f7ac: 30 91 07 05 lds r19, 0x0507 ; 0x800507 f7b0: 29 0f add r18, r25 f7b2: 31 1d adc r19, r1 f7b4: 97 fd sbrc r25, 7 f7b6: 3a 95 dec r19 f7b8: 30 93 07 05 sts 0x0507, r19 ; 0x800507 f7bc: 20 93 06 05 sts 0x0506, r18 ; 0x800506 lcd_encoder_diff %= ENCODER_PULSES_PER_STEP; f7c0: 83 78 andi r24, 0x83 ; 131 f7c2: 87 ff sbrs r24, 7 f7c4: 03 c0 rjmp .+6 ; 0xf7cc f7c6: 81 50 subi r24, 0x01 ; 1 f7c8: 8c 6f ori r24, 0xFC ; 252 f7ca: 8f 5f subi r24, 0xFF ; 255 f7cc: 80 93 11 06 sts 0x0611, r24 ; 0x800611 <_ZL16lcd_encoder_diff.lto_priv.504> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; f7d0: 4f bf out 0x3f, r20 ; 63 // Get lcd_encoder_diff in sync with the encoder hard steps. // We assume that a click happens only when the knob is rotated into a stable position lcd_encoder_diff = 0; } } Sound_MakeSound(did_rotate ? e_SOUND_TYPE_EncoderMove : e_SOUND_TYPE_ButtonEcho); f7d2: 86 e0 ldi r24, 0x06 ; 6 f7d4: 0f 94 9f 2c call 0x2593e ; 0x2593e if (lcd_draw_update == 0) { f7d8: 80 91 5b 02 lds r24, 0x025B ; 0x80025b f7dc: 81 11 cpse r24, r1 f7de: 03 c0 rjmp .+6 ; 0xf7e6 // Update LCD rendering at minimum lcd_draw_update = 1; f7e0: 81 e0 ldi r24, 0x01 ; 1 f7e2: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b lcd_knob_update(); backlight_update(); // handle longpress if(lcd_longpress_trigger) f7e6: 80 91 14 06 lds r24, 0x0614 ; 0x800614 f7ea: 88 23 and r24, r24 f7ec: 61 f0 breq .+24 ; 0xf806 { lcd_consume_click(); // Reset trigger to prevent recursion f7ee: 0e 94 93 6b call 0xd726 ; 0xd726 // long press is not possible in modal mode, wait until ready if (lcd_longpress_func && lcd_update_enabled) f7f2: e0 91 d4 03 lds r30, 0x03D4 ; 0x8003d4 f7f6: f0 91 d5 03 lds r31, 0x03D5 ; 0x8003d5 f7fa: 30 97 sbiw r30, 0x00 ; 0 f7fc: 21 f0 breq .+8 ; 0xf806 f7fe: 80 91 5c 02 lds r24, 0x025C ; 0x80025c f802: 81 11 cpse r24, r1 { lcd_longpress_func(); f804: 19 95 eicall } } inline void TimerStart() { auto_report_timer.start(); } inline bool TimerRunning()const { return auto_report_timer.running(); } inline bool TimerExpired() { return auto_report_timer.expired(auto_report_period * 1000ul); } f806: 20 91 62 13 lds r18, 0x1362 ; 0x801362 f80a: 30 e0 ldi r19, 0x00 ; 0 f80c: a8 ee ldi r26, 0xE8 ; 232 f80e: b3 e0 ldi r27, 0x03 ; 3 f810: 0f 94 7c a0 call 0x340f8 ; 0x340f8 <__umulhisi3> f814: ab 01 movw r20, r22 f816: bc 01 movw r22, r24 f818: 83 e6 ldi r24, 0x63 ; 99 f81a: 93 e1 ldi r25, 0x13 ; 19 f81c: 0f 94 e2 0f call 0x21fc4 ; 0x21fc4 ::expired(unsigned long)> * Output autoreport values according to features requested in M155 */ #if defined(AUTO_REPORT) void host_autoreport() { if (autoReportFeatures.TimerExpired()) f820: 88 23 and r24, r24 f822: 99 f0 breq .+38 ; 0xf84a f824: 80 91 61 13 lds r24, 0x1361 ; 0x801361 { if(autoReportFeatures.Temp()){ f828: 80 fd sbrc r24, 0 gcode_M105(); f82a: 0e 94 cc 71 call 0xe398 ; 0xe398 f82e: 80 91 61 13 lds r24, 0x1361 ; 0x801361 } if(autoReportFeatures.Pos()){ f832: 82 fd sbrc r24, 2 gcode_M114(); f834: 0e 94 51 71 call 0xe2a2 ; 0xe2a2 f838: 80 91 61 13 lds r24, 0x1361 ; 0x801361 } #if defined(AUTO_REPORT) && (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1))))) if(autoReportFeatures.Fans()){ f83c: 81 fd sbrc r24, 1 gcode_M123(); f83e: 0e 94 9d 5f call 0xbf3a ; 0xbf3a } else{ auto_report_timer.stop(); } } inline void TimerStart() { auto_report_timer.start(); } f842: 83 e6 ldi r24, 0x63 ; 99 f844: 93 e1 ldi r25, 0x13 ; 19 f846: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> */ void host_keepalive() { #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; f84a: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca f84e: 81 11 cpse r24, r1 f850: 02 c0 rjmp .+4 ; 0xf856 f852: 0e 94 57 72 call 0xe4ae ; 0xe4ae bool M79_timer_get_status() { return M79_timer.running(); } void M79_timer_update_status() { M79_timer.expired(M79_TIMEOUT); f856: 40 e3 ldi r20, 0x30 ; 48 f858: 55 e7 ldi r21, 0x75 ; 117 f85a: 60 e0 ldi r22, 0x00 ; 0 f85c: 70 e0 ldi r23, 0x00 ; 0 f85e: 8a e5 ldi r24, 0x5A ; 90 f860: 93 e0 ldi r25, 0x03 ; 3 #if defined(AUTO_REPORT) host_autoreport(); #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } f862: df 91 pop r29 f864: cf 91 pop r28 f866: 1f 91 pop r17 f868: 0f 91 pop r16 f86a: 0d 94 e2 0f jmp 0x21fc4 ; 0x21fc4 ::expired(unsigned long)> tail_fan_speed = 255; } else if (fan_kick_end > _millis()) // Fan still spinning up. tail_fan_speed = 255; } else { fan_kick_end = 0; f86e: 10 92 41 03 sts 0x0341, r1 ; 0x800341 f872: 10 92 42 03 sts 0x0342, r1 ; 0x800342 f876: 10 92 43 03 sts 0x0343, r1 ; 0x800343 f87a: 10 92 44 03 sts 0x0344, r1 ; 0x800344 f87e: 64 cf rjmp .-312 ; 0xf748 #ifdef FAN_SOFT_PWM if (fan_measuring) { //if measurement is currently in process, fanSpeedSoftPwm must remain set to 255, but we must update fanSpeedBckp value fanSpeedBckp = tail_fan_speed; } else { fanSpeedSoftPwm = tail_fan_speed; f880: c0 93 05 05 sts 0x0505, r28 ; 0x800505 f884: 68 cf rjmp .-304 ; 0xf756 did_rotate = true; } else { // Get lcd_encoder_diff in sync with the encoder hard steps. // We assume that a click happens only when the knob is rotated into a stable position lcd_encoder_diff = 0; f886: 10 92 11 06 sts 0x0611, r1 ; 0x800611 <_ZL16lcd_encoder_diff.lto_priv.504> f88a: 4f bf out 0x3f, r20 ; 63 } } Sound_MakeSound(did_rotate ? e_SOUND_TYPE_EncoderMove : e_SOUND_TYPE_ButtonEcho); f88c: 80 e0 ldi r24, 0x00 ; 0 f88e: a2 cf rjmp .-188 ; 0xf7d4 0000f890 : #endif #endif } void delay_keep_alive(unsigned int ms) { f890: cf 93 push r28 f892: df 93 push r29 f894: ec 01 movw r28, r24 for (;;) { manage_heater(); f896: 0f 94 5b 32 call 0x264b6 ; 0x264b6 // Manage inactivity, but don't disable steppers on timeout. manage_inactivity(true); f89a: 81 e0 ldi r24, 0x01 ; 1 f89c: 0e 94 01 7a call 0xf402 ; 0xf402 lcd_update(0); f8a0: 80 e0 ldi r24, 0x00 ; 0 f8a2: 0e 94 42 69 call 0xd284 ; 0xd284 if (ms == 0) f8a6: 20 97 sbiw r28, 0x00 ; 0 f8a8: 99 f0 breq .+38 ; 0xf8d0 break; else if (ms >= 50) { f8aa: c2 33 cpi r28, 0x32 ; 50 f8ac: d1 05 cpc r29, r1 f8ae: 40 f0 brcs .+16 ; 0xf8c0 _delay(50); f8b0: 62 e3 ldi r22, 0x32 ; 50 f8b2: 70 e0 ldi r23, 0x00 ; 0 f8b4: 80 e0 ldi r24, 0x00 ; 0 f8b6: 90 e0 ldi r25, 0x00 ; 0 f8b8: 0f 94 7b 0d call 0x21af6 ; 0x21af6 ms -= 50; f8bc: e2 97 sbiw r28, 0x32 ; 50 f8be: eb cf rjmp .-42 ; 0xf896 } else { _delay(ms); f8c0: be 01 movw r22, r28 f8c2: 90 e0 ldi r25, 0x00 ; 0 f8c4: 80 e0 ldi r24, 0x00 ; 0 f8c6: 0f 94 7b 0d call 0x21af6 ; 0x21af6 ms = 0; f8ca: d0 e0 ldi r29, 0x00 ; 0 f8cc: c0 e0 ldi r28, 0x00 ; 0 f8ce: e3 cf rjmp .-58 ; 0xf896 } } } f8d0: df 91 pop r29 f8d2: cf 91 pop r28 f8d4: 08 95 ret 0000f8d6 : /// @brief Re-use the MMU error screen UI to present choices for filament change /// There are two button actions, Load and Eject /// Load will exit the screen and continue as normally by asking the user which slot to load from /// Eject will eject the depleted filament, very useful after FINDA runout events. /// @param eject_slot the MMU slot to eject if the user selects the Eject button choice static void mmu_M600_filament_change_screen(uint8_t eject_slot) { f8d6: cf 93 push r28 f8d8: df 93 push r29 f8da: c8 2f mov r28, r24 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; f8dc: df ef ldi r29, 0xFF ; 255 MMU2::Buttons btn; for(;;) { manage_heater(); f8de: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(true); f8e2: 81 e0 ldi r24, 0x01 ; 1 f8e4: 0e 94 01 7a call 0xf402 ; 0xf402 f8e8: 80 91 92 12 lds r24, 0x1292 ; 0x801292 btn = MMU2::mmu2.GetPrinterButtonOperation(); if (btn != MMU2::Buttons::NoButton) f8ec: 8f 3f cpi r24, 0xFF ; 255 f8ee: d9 f4 brne .+54 ; 0xf926 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { f8f0: 80 91 27 12 lds r24, 0x1227 ; 0x801227 f8f4: 84 30 cpi r24, 0x04 ; 4 f8f6: 21 f4 brne .+8 ; 0xf900 }; inline void InvokeErrorScreen(ErrorCode ec) { // The printer may not raise an error when the MMU is busy if (!logic.CommandInProgress() // MMU must not be busy && MMUCurrentErrorCode() == ErrorCode::OK // The protocol must not be in error state && lastErrorCode != ec) // The error code is not a duplicate f8f8: 80 91 2a 12 lds r24, 0x122A ; 0x80122a f8fc: 81 11 cpse r24, r1 f8fe: ef cf rjmp .-34 ; 0xf8de return lastReadRegisterValue; }; inline void InvokeErrorScreen(ErrorCode ec) { // The printer may not raise an error when the MMU is busy if (!logic.CommandInProgress() // MMU must not be busy && MMUCurrentErrorCode() == ErrorCode::OK // The protocol must not be in error state f900: 80 91 65 12 lds r24, 0x1265 ; 0x801265 f904: 90 91 66 12 lds r25, 0x1266 ; 0x801266 f908: 01 97 sbiw r24, 0x01 ; 1 f90a: 49 f7 brne .-46 ; 0xf8de && lastErrorCode != ec) // The error code is not a duplicate f90c: 80 91 8c 12 lds r24, 0x128C ; 0x80128c f910: 90 91 8d 12 lds r25, 0x128D ; 0x80128d f914: 89 32 cpi r24, 0x29 ; 41 f916: 90 48 sbci r25, 0x80 ; 128 f918: 11 f3 breq .-60 ; 0xf8de { ReportError(ec, ErrorSource::ErrorSourcePrinter); f91a: 60 e0 ldi r22, 0x00 ; 0 f91c: 89 e2 ldi r24, 0x29 ; 41 f91e: 90 e8 ldi r25, 0x80 ; 128 f920: 0f 94 aa 4f call 0x29f54 ; 0x29f54 f924: dc cf rjmp .-72 ; 0xf8de inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; f926: d0 93 92 12 sts 0x1292, r29 ; 0x801292 { MMU2::mmu2.ClearPrinterButtonOperation(); if (btn == MMU2::Buttons::Eject) { f92a: 85 30 cpi r24, 0x05 ; 5 f92c: 39 f4 brne .+14 ; 0xf93c if (eject_slot != (uint8_t)MMU2::FILAMENT_UNKNOWN) { f92e: cf 3f cpi r28, 0xFF ; 255 f930: f9 f2 breq .-66 ; 0xf8f0 MMU2::mmu2.eject_filament(eject_slot, true); f932: 61 e0 ldi r22, 0x01 ; 1 f934: 8c 2f mov r24, r28 f936: 0f 94 ee 6a call 0x2d5dc ; 0x2d5dc f93a: d1 cf rjmp .-94 ; 0xf8de // the operation is done. We must be careful to not raise FILAMENT_CHANGE // screen too quickly continue; } } else if (btn == MMU2::Buttons::Load) f93c: 84 30 cpi r24, 0x04 ; 4 f93e: c1 f6 brne .-80 ; 0xf8f0 } } MMU2::mmu2.InvokeErrorScreen(ErrorCode::FILAMENT_CHANGE); } } f940: df 91 pop r29 f942: cf 91 pop r28 f944: 08 95 ret 0000f946 : static void printFloat(double, uint8_t); public: static /*FORCE_INLINE*/ void write(const char *str) f946: cf 93 push r28 f948: df 93 push r29 f94a: ec 01 movw r28, r24 { while (*str) f94c: 89 91 ld r24, Y+ f94e: 88 23 and r24, r24 f950: 19 f0 breq .+6 ; 0xf958 write(*str++); f952: 0e 94 41 70 call 0xe082 ; 0xe082 f956: fa cf rjmp .-12 ; 0xf94c } f958: df 91 pop r29 f95a: cf 91 pop r28 f95c: 08 95 ret 0000f95e : //adds an command to the main command buffer //thats really done in a non-safe way. //needs overworking someday // Currently the maximum length of a command piped through this function is around 20 characters void enquecommand(const char *cmd, bool from_progmem) { f95e: ff 92 push r15 f960: 0f 93 push r16 f962: 1f 93 push r17 f964: cf 93 push r28 f966: df 93 push r29 f968: ec 01 movw r28, r24 f96a: f6 2e mov r15, r22 size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd); f96c: 66 23 and r22, r22 f96e: 09 f4 brne .+2 ; 0xf972 f970: 4b c0 rjmp .+150 ; 0xfa08 #else extern size_t __strlen_P(const char *) __ATTR_CONST__; /* internal helper function */ __attribute__((__always_inline__)) static __inline__ size_t strlen_P(const char * s); static __inline__ size_t strlen_P(const char *s) { return __builtin_constant_p(__builtin_strlen(s)) ? __builtin_strlen(s) : __strlen_P(s); f972: 0f 94 9a 9d call 0x33b34 ; 0x33b34 <__strlen_P> f976: 8c 01 movw r16, r24 // Does cmd fit the queue while leaving sufficient space at the front for the chained commands? // If it fits, it may move bufindw, so it points to a contiguous buffer, which fits cmd. if (cmdqueue_could_enqueue_back(len)) { f978: c8 01 movw r24, r16 f97a: 0e 94 bc 55 call 0xab78 ; 0xab78 f97e: 88 23 and r24, r24 f980: 09 f4 brne .+2 ; 0xf984 f982: 53 c0 rjmp .+166 ; 0xfa2a // This is dangerous if a mixing of serial and this happens // This may easily be tested: If serial_count > 0, we have a problem. cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_UI; f984: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> f988: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f98c: fc 01 movw r30, r24 f98e: e2 52 subi r30, 0x22 ; 34 f990: f0 4f sbci r31, 0xF0 ; 240 f992: 23 e0 ldi r18, 0x03 ; 3 f994: 20 83 st Z, r18 f996: 8f 51 subi r24, 0x1F ; 31 f998: 90 4f sbci r25, 0xF0 ; 240 if (from_progmem) strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); f99a: be 01 movw r22, r28 // If it fits, it may move bufindw, so it points to a contiguous buffer, which fits cmd. if (cmdqueue_could_enqueue_back(len)) { // This is dangerous if a mixing of serial and this happens // This may easily be tested: If serial_count > 0, we have a problem. cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_UI; if (from_progmem) f99c: ff 20 and r15, r15 f99e: e9 f1 breq .+122 ; 0xfa1a strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); f9a0: 0f 94 93 9d call 0x33b26 ; 0x33b26 else strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; f9a4: 81 e6 ldi r24, 0x61 ; 97 f9a6: 9d e9 ldi r25, 0x9D ; 157 f9a8: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHORPGM(MSG_Enqueing); f9ac: 8f e8 ldi r24, 0x8F ; 143 f9ae: 92 e6 ldi r25, 0x62 ; 98 f9b0: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); f9b4: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> f9b8: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> } }*/ static FORCE_INLINE void print(const char *str) { write(str); f9bc: 8f 51 subi r24, 0x1F ; 31 f9be: 90 4f sbci r25, 0xF0 ; 240 f9c0: 0e 94 a3 7c call 0xf946 ; 0xf946 SERIAL_ECHOLNPGM("\""); f9c4: 80 e4 ldi r24, 0x40 ; 64 f9c6: 92 e7 ldi r25, 0x72 ; 114 f9c8: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 bufindw += len + (CMDHDRSIZE + 1); f9cc: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> f9d0: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f9d4: 04 96 adiw r24, 0x04 ; 4 f9d6: 08 0f add r16, r24 f9d8: 19 1f adc r17, r25 if (bufindw == sizeof(cmdbuffer)) f9da: 0d 3e cpi r16, 0xED ; 237 f9dc: 81 e0 ldi r24, 0x01 ; 1 f9de: 18 07 cpc r17, r24 f9e0: f9 f0 breq .+62 ; 0xfa20 strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); f9e2: 10 93 dd 0f sts 0x0FDD, r17 ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f9e6: 00 93 dc 0f sts 0x0FDC, r16 ; 0x800fdc <_ZL7bufindw.lto_priv.516> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; f9ea: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf f9ee: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 f9f2: 01 96 adiw r24, 0x01 ; 1 f9f4: 90 93 d0 11 sts 0x11D0, r25 ; 0x8011d0 f9f8: 80 93 cf 11 sts 0x11CF, r24 ; 0x8011cf SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } f9fc: df 91 pop r29 f9fe: cf 91 pop r28 fa00: 1f 91 pop r17 fa02: 0f 91 pop r16 fa04: ff 90 pop r15 fa06: 08 95 ret //thats really done in a non-safe way. //needs overworking someday // Currently the maximum length of a command piped through this function is around 20 characters void enquecommand(const char *cmd, bool from_progmem) { size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd); fa08: fc 01 movw r30, r24 fa0a: 01 90 ld r0, Z+ fa0c: 00 20 and r0, r0 fa0e: e9 f7 brne .-6 ; 0xfa0a fa10: 31 97 sbiw r30, 0x01 ; 1 fa12: 8f 01 movw r16, r30 fa14: 08 1b sub r16, r24 fa16: 19 0b sbc r17, r25 fa18: af cf rjmp .-162 ; 0xf978 // This may easily be tested: If serial_count > 0, we have a problem. cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_UI; if (from_progmem) strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); else strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); fa1a: 0f 94 47 a6 call 0x34c8e ; 0x34c8e fa1e: c2 cf rjmp .-124 ; 0xf9a4 SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); if (bufindw == sizeof(cmdbuffer)) bufindw = 0; fa20: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> fa24: 10 92 dc 0f sts 0x0FDC, r1 ; 0x800fdc <_ZL7bufindw.lto_priv.516> fa28: e0 cf rjmp .-64 ; 0xf9ea ++ buflen; #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; fa2a: 84 e4 ldi r24, 0x44 ; 68 fa2c: 9d e9 ldi r25, 0x9D ; 157 fa2e: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHORPGM(MSG_Enqueing); fa32: 8f e8 ldi r24, 0x8F ; 143 fa34: 92 e6 ldi r25, 0x62 ; 98 fa36: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); fa3a: ce 01 movw r24, r28 cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) fa3c: ff 20 and r15, r15 fa3e: 59 f0 breq .+22 ; 0xfa56 SERIAL_PROTOCOLRPGM(cmd); fa40: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); fa44: 82 e1 ldi r24, 0x12 ; 18 fa46: 9d e9 ldi r25, 0x9D ; 157 #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } fa48: df 91 pop r29 fa4a: cf 91 pop r28 fa4c: 1f 91 pop r17 fa4e: 0f 91 pop r16 fa50: ff 90 pop r15 SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); fa52: 0c 94 53 72 jmp 0xe4a6 ; 0xe4a6 fa56: 0e 94 a3 7c call 0xf946 ; 0xf946 fa5a: f4 cf rjmp .-24 ; 0xfa44 0000fa5c : { return extrusion_width - layer_height * (overlap_factor - M_PI/4); } // Common code extracted into one function to reduce code size static void lay1cal_common_enqueue_loop(const char * const * cmd_sequence, const uint8_t steps) { fa5c: 0f 93 push r16 fa5e: 1f 93 push r17 fa60: cf 93 push r28 fa62: df 93 push r29 fa64: d6 2f mov r29, r22 fa66: 8c 01 movw r16, r24 for (uint8_t i = 0; i < steps; ++i) fa68: c0 e0 ldi r28, 0x00 ; 0 { void * const pgm_ptr = pgm_read_ptr(cmd_sequence + i); fa6a: f8 01 movw r30, r16 fa6c: 85 91 lpm r24, Z+ fa6e: 94 91 lpm r25, Z // M702 is currently only used with MMU enabled if (pgm_ptr == MSG_M702 && !MMU2::mmu2.Enabled()) { fa70: 28 e6 ldi r18, 0x68 ; 104 fa72: 8d 30 cpi r24, 0x0D ; 13 fa74: 92 07 cpc r25, r18 fa76: 21 f4 brne .+8 ; 0xfa80 fa78: 20 91 94 12 lds r18, 0x1294 ; 0x801294 fa7c: 21 30 cpi r18, 0x01 ; 1 fa7e: 19 f4 brne .+6 ; 0xfa86 continue; } enquecommand_P(static_cast(pgm_ptr)); fa80: 61 e0 ldi r22, 0x01 ; 1 fa82: 0e 94 af 7c call 0xf95e ; 0xf95e return extrusion_width - layer_height * (overlap_factor - M_PI/4); } // Common code extracted into one function to reduce code size static void lay1cal_common_enqueue_loop(const char * const * cmd_sequence, const uint8_t steps) { for (uint8_t i = 0; i < steps; ++i) fa86: cf 5f subi r28, 0xFF ; 255 fa88: 0e 5f subi r16, 0xFE ; 254 fa8a: 1f 4f sbci r17, 0xFF ; 255 fa8c: dc 13 cpse r29, r28 fa8e: ed cf rjmp .-38 ; 0xfa6a continue; } enquecommand_P(static_cast(pgm_ptr)); } } fa90: df 91 pop r29 fa92: cf 91 pop r28 fa94: 1f 91 pop r17 fa96: 0f 91 pop r16 fa98: 08 95 ret 0000fa9a : static const char bufferFull[] PROGMEM = "\" failed: Buffer full!"; static const char enqueingFront[] PROGMEM = "Enqueing to the front: \""; void enquecommandf_P(const char *fmt, ...) { fa9a: cf 93 push r28 fa9c: df 93 push r29 fa9e: cd b7 in r28, 0x3d ; 61 faa0: de b7 in r29, 0x3e ; 62 faa2: 6e 97 sbiw r28, 0x1e ; 30 faa4: 0f b6 in r0, 0x3f ; 63 faa6: f8 94 cli faa8: de bf out 0x3e, r29 ; 62 faaa: 0f be out 0x3f, r0 ; 63 faac: cd bf out 0x3d, r28 ; 61 faae: 9e 01 movw r18, r28 fab0: 2c 5d subi r18, 0xDC ; 220 fab2: 3f 4f sbci r19, 0xFF ; 255 fab4: f9 01 movw r30, r18 fab6: 41 91 ld r20, Z+ fab8: 51 91 ld r21, Z+ faba: 9f 01 movw r18, r30 // MAX_CMD_SIZE is 96, but for formatting // string we usually don't need more than 30 bytes char cmd_buffer[30]; va_list ap; va_start(ap, fmt); vsnprintf_P(cmd_buffer, sizeof(cmd_buffer), fmt, ap); fabc: 6e e1 ldi r22, 0x1E ; 30 fabe: 70 e0 ldi r23, 0x00 ; 0 fac0: ce 01 movw r24, r28 fac2: 01 96 adiw r24, 0x01 ; 1 fac4: 0f 94 32 9f call 0x33e64 ; 0x33e64 va_end(ap); enquecommand(cmd_buffer, false); fac8: 60 e0 ldi r22, 0x00 ; 0 faca: ce 01 movw r24, r28 facc: 01 96 adiw r24, 0x01 ; 1 face: 0e 94 af 7c call 0xf95e ; 0xf95e } fad2: 6e 96 adiw r28, 0x1e ; 30 fad4: 0f b6 in r0, 0x3f ; 63 fad6: f8 94 cli fad8: de bf out 0x3e, r29 ; 62 fada: 0f be out 0x3f, r0 ; 63 fadc: cd bf out 0x3d, r28 ; 61 fade: df 91 pop r29 fae0: cf 91 pop r28 fae2: 08 95 ret 0000fae4 <__vector_29>: #ifdef ADC_CALLBACK extern void ADC_CALLBACK(); #endif //ADC_CALLBACK ISR(ADC_vect) { fae4: 1f 92 push r1 fae6: 0f 92 push r0 fae8: 0f b6 in r0, 0x3f ; 63 faea: 0f 92 push r0 faec: 11 24 eor r1, r1 faee: 0b b6 in r0, 0x3b ; 59 faf0: 0f 92 push r0 faf2: 2f 93 push r18 faf4: 3f 93 push r19 faf6: 4f 93 push r20 faf8: 5f 93 push r21 fafa: 6f 93 push r22 fafc: 7f 93 push r23 fafe: 8f 93 push r24 fb00: 9f 93 push r25 fb02: af 93 push r26 fb04: bf 93 push r27 fb06: ef 93 push r30 fb08: ff 93 push r31 adc_values[adc_channel] += ADC; fb0a: 20 91 78 00 lds r18, 0x0078 ; 0x800078 <__TEXT_REGION_LENGTH__+0x7c2078> fb0e: 30 91 79 00 lds r19, 0x0079 ; 0x800079 <__TEXT_REGION_LENGTH__+0x7c2079> fb12: e0 91 16 03 lds r30, 0x0316 ; 0x800316 fb16: f0 e0 ldi r31, 0x00 ; 0 fb18: ee 0f add r30, r30 fb1a: ff 1f adc r31, r31 fb1c: ea 5f subi r30, 0xFA ; 250 fb1e: fc 4f sbci r31, 0xFC ; 252 fb20: 80 81 ld r24, Z fb22: 91 81 ldd r25, Z+1 ; 0x01 fb24: 82 0f add r24, r18 fb26: 93 1f adc r25, r19 fb28: 91 83 std Z+1, r25 ; 0x01 fb2a: 80 83 st Z, r24 if (++adc_count == ADC_OVRSAMPL) fb2c: 80 91 05 03 lds r24, 0x0305 ; 0x800305 fb30: 8f 5f subi r24, 0xFF ; 255 fb32: 80 93 05 03 sts 0x0305, r24 ; 0x800305 fb36: 80 31 cpi r24, 0x10 ; 16 fb38: e9 f5 brne .+122 ; 0xfbb4 <__vector_29+0xd0> { // go to the next channel if (++adc_channel == ADC_CHAN_CNT) { fb3a: 80 91 16 03 lds r24, 0x0316 ; 0x800316 fb3e: 8f 5f subi r24, 0xFF ; 255 fb40: 80 93 16 03 sts 0x0316, r24 ; 0x800316 fb44: 88 30 cpi r24, 0x08 ; 8 fb46: 71 f5 brne .+92 ; 0xfba4 <__vector_29+0xc0> #endif // ISR callback from adc when sampling finished void adc_callback() { current_temperature_raw[0] = adc_values[ADC_PIN_IDX(TEMP_0_PIN)]; //heater fb48: 80 91 06 03 lds r24, 0x0306 ; 0x800306 fb4c: 90 91 07 03 lds r25, 0x0307 ; 0x800307 fb50: 90 93 4a 06 sts 0x064A, r25 ; 0x80064a fb54: 80 93 49 06 sts 0x0649, r24 ; 0x800649 current_temperature_bed_raw = adc_values[ADC_PIN_IDX(TEMP_BED_PIN)]; fb58: 80 91 0a 03 lds r24, 0x030A ; 0x80030a fb5c: 90 91 0b 03 lds r25, 0x030B ; 0x80030b fb60: 90 93 4c 06 sts 0x064C, r25 ; 0x80064c fb64: 80 93 4b 06 sts 0x064B, r24 ; 0x80064b #ifdef PINDA_THERMISTOR current_temperature_raw_pinda = adc_values[ADC_PIN_IDX(TEMP_PINDA_PIN)]; fb68: 80 91 08 03 lds r24, 0x0308 ; 0x800308 fb6c: 90 91 09 03 lds r25, 0x0309 ; 0x800309 fb70: 90 93 48 06 sts 0x0648, r25 ; 0x800648 fb74: 80 93 47 06 sts 0x0647, r24 ; 0x800647 current_voltage_raw_bed = adc_values[ADC_PIN_IDX(VOLT_BED_PIN)]; // 6->9 #endif #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) fsensor.voltUpdate(adc_values[ADC_PIN_IDX(VOLT_IR_PIN)]); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) adc_values_ready = true; fb78: 81 e0 ldi r24, 0x01 ; 1 fb7a: 80 93 63 06 sts 0x0663, r24 ; 0x800663 <_ZL16adc_values_ready.lto_priv.519> break; } } } ADCSRA |= (1 << ADSC); //start conversion } fb7e: ff 91 pop r31 fb80: ef 91 pop r30 fb82: bf 91 pop r27 fb84: af 91 pop r26 fb86: 9f 91 pop r25 fb88: 8f 91 pop r24 fb8a: 7f 91 pop r23 fb8c: 6f 91 pop r22 fb8e: 5f 91 pop r21 fb90: 4f 91 pop r20 fb92: 3f 91 pop r19 fb94: 2f 91 pop r18 fb96: 0f 90 pop r0 fb98: 0b be out 0x3b, r0 ; 59 fb9a: 0f 90 pop r0 fb9c: 0f be out 0x3f, r0 ; 63 fb9e: 0f 90 pop r0 fba0: 1f 90 pop r1 fba2: 18 95 reti fba4: 80 91 04 03 lds r24, 0x0304 ; 0x800304 <__data_end> return; // do not start the next measurement since there are no channels remaining } // find the next channel while (++adc_channel_idx) { if (ADC_CHAN_MSK & (1 << adc_channel_idx)) { fba8: 4f e5 ldi r20, 0x5F ; 95 fbaa: 53 e0 ldi r21, 0x03 ; 3 #endif return; // do not start the next measurement since there are no channels remaining } // find the next channel while (++adc_channel_idx) { fbac: 8f 5f subi r24, 0xFF ; 255 fbae: 41 f4 brne .+16 ; 0xfbc0 <__vector_29+0xdc> fbb0: 10 92 04 03 sts 0x0304, r1 ; 0x800304 <__data_end> adc_count = 0; break; } } } ADCSRA |= (1 << ADSC); //start conversion fbb4: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> fbb8: 80 64 ori r24, 0x40 ; 64 fbba: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> fbbe: df cf rjmp .-66 ; 0xfb7e <__vector_29+0x9a> return; // do not start the next measurement since there are no channels remaining } // find the next channel while (++adc_channel_idx) { if (ADC_CHAN_MSK & (1 << adc_channel_idx)) { fbc0: 9a 01 movw r18, r20 fbc2: 08 2e mov r0, r24 fbc4: 02 c0 rjmp .+4 ; 0xfbca <__vector_29+0xe6> fbc6: 35 95 asr r19 fbc8: 27 95 ror r18 fbca: 0a 94 dec r0 fbcc: e2 f7 brpl .-8 ; 0xfbc6 <__vector_29+0xe2> fbce: 20 ff sbrs r18, 0 fbd0: ed cf rjmp .-38 ; 0xfbac <__vector_29+0xc8> fbd2: 80 93 04 03 sts 0x0304, r24 ; 0x800304 <__data_end> adc_setmux(adc_channel_idx); fbd6: 0e 94 cd 54 call 0xa99a ; 0xa99a adc_count = 0; fbda: 10 92 05 03 sts 0x0305, r1 ; 0x800305 fbde: ea cf rjmp .-44 ; 0xfbb4 <__vector_29+0xd0> 0000fbe0 : if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { fbe0: cf 93 push r28 fbe2: df 93 push r29 static void adc_reset() { static const uint8_t first_channel_idx = 0; static_assert((1 << first_channel_idx) & ADC_CHAN_MSK); ADCSRA &= ~(1 << ADSC); //stop conversion just in case fbe4: ca e7 ldi r28, 0x7A ; 122 fbe6: d0 e0 ldi r29, 0x00 ; 0 fbe8: 88 81 ld r24, Y fbea: 8f 7b andi r24, 0xBF ; 191 fbec: 88 83 st Y, r24 adc_count = 0; fbee: 10 92 05 03 sts 0x0305, r1 ; 0x800305 adc_channel = 0; fbf2: 10 92 16 03 sts 0x0316, r1 ; 0x800316 adc_channel_idx = first_channel_idx; fbf6: 10 92 04 03 sts 0x0304, r1 ; 0x800304 <__data_end> adc_setmux(adc_channel_idx); fbfa: 80 e0 ldi r24, 0x00 ; 0 fbfc: 0e 94 cd 54 call 0xa99a ; 0xa99a memset((void*)adc_values, 0, sizeof(adc_values)); fc00: e6 e0 ldi r30, 0x06 ; 6 fc02: f3 e0 ldi r31, 0x03 ; 3 fc04: 80 e1 ldi r24, 0x10 ; 16 fc06: df 01 movw r26, r30 fc08: 1d 92 st X+, r1 fc0a: 8a 95 dec r24 fc0c: e9 f7 brne .-6 ; 0xfc08 ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { adc_reset(); ADCSRA |= (1 << ADSC); //start conversion fc0e: 88 81 ld r24, Y fc10: 80 64 ori r24, 0x40 ; 64 fc12: 88 83 st Y, r24 } fc14: df 91 pop r29 fc16: cf 91 pop r28 fc18: 08 95 ret 0000fc1a : } // G80 - Automatic mesh bed leveling static void gcode_G80() { fc1a: 2f 92 push r2 fc1c: 3f 92 push r3 fc1e: 4f 92 push r4 fc20: 5f 92 push r5 fc22: 6f 92 push r6 fc24: 7f 92 push r7 fc26: 8f 92 push r8 fc28: 9f 92 push r9 fc2a: af 92 push r10 fc2c: bf 92 push r11 fc2e: cf 92 push r12 fc30: df 92 push r13 fc32: ef 92 push r14 fc34: ff 92 push r15 fc36: 0f 93 push r16 fc38: 1f 93 push r17 fc3a: cf 93 push r28 fc3c: df 93 push r29 fc3e: cd b7 in r28, 0x3d ; 61 fc40: de b7 in r29, 0x3e ; 62 fc42: a4 97 sbiw r28, 0x24 ; 36 fc44: 0f b6 in r0, 0x3f ; 63 fc46: f8 94 cli fc48: de bf out 0x3e, r29 ; 62 fc4a: 0f be out 0x3f, r0 ; 63 fc4c: cd bf out 0x3d, r28 ; 61 constexpr float XY_AXIS_FEEDRATE = (homing_feedrate[X_AXIS] * 3) / 60; constexpr float Z_LIFT_FEEDRATE = homing_feedrate[Z_AXIS] / 60; constexpr float Z_CALIBRATION_THRESHOLD_TIGHT = 0.6f; // used for 7x7 MBL constexpr float Z_CALIBRATION_THRESHOLD_RELAXED = 1.f; // used for 3x3 MBL constexpr float MESH_HOME_Z_SEARCH_FAST = 0.35f; st_synchronize(); fc4e: 0f 94 42 22 call 0x24484 ; 0x24484 if (planner_aborted) fc52: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac fc56: 81 11 cpse r24, r1 fc58: 17 c0 rjmp .+46 ; 0xfc88 return; mesh_bed_leveling_flag = true; fc5a: 81 e0 ldi r24, 0x01 ; 1 fc5c: 80 93 06 12 sts 0x1206, r24 ; 0x801206 // Firstly check if we know where we are if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) { fc60: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 fc64: 88 23 and r24, r24 fc66: 49 f0 breq .+18 ; 0xfc7a fc68: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 fc6c: 88 23 and r24, r24 fc6e: 29 f0 breq .+10 ; 0xfc7a fc70: 20 91 a5 06 lds r18, 0x06A5 ; 0x8006a5 fc74: 2f 83 std Y+7, r18 ; 0x07 fc76: 21 11 cpse r18, r1 fc78: 20 c0 rjmp .+64 ; 0xfcba // Mark the command at the top of the command queue as new. // Therefore it will not be removed from the queue. void repeatcommand_front() { cmdbuffer_front_already_processed = true; fc7a: 81 e0 ldi r24, 0x01 ; 1 fc7c: 80 93 e6 11 sts 0x11E6, r24 ; 0x8011e6 // We don't know where we are! HOME! // Push the commands to the front of the message queue in the reverse order! // There shall be always enough space reserved for these commands. repeatcommand_front(); // repeat G80 with all its parameters enquecommand_front_P(G28W); fc80: 82 e1 ldi r24, 0x12 ; 18 fc82: 98 e6 ldi r25, 0x68 ; 104 fc84: 0f 94 57 43 call 0x286ae ; 0x286ae custom_message_state = custom_message_state_old; lcd_update(2); st_synchronize(); mesh_bed_leveling_flag = false; } fc88: a4 96 adiw r28, 0x24 ; 36 fc8a: 0f b6 in r0, 0x3f ; 63 fc8c: f8 94 cli fc8e: de bf out 0x3e, r29 ; 62 fc90: 0f be out 0x3f, r0 ; 63 fc92: cd bf out 0x3d, r28 ; 61 fc94: df 91 pop r29 fc96: cf 91 pop r28 fc98: 1f 91 pop r17 fc9a: 0f 91 pop r16 fc9c: ff 90 pop r15 fc9e: ef 90 pop r14 fca0: df 90 pop r13 fca2: cf 90 pop r12 fca4: bf 90 pop r11 fca6: af 90 pop r10 fca8: 9f 90 pop r9 fcaa: 8f 90 pop r8 fcac: 7f 90 pop r7 fcae: 6f 90 pop r6 fcb0: 5f 90 pop r5 fcb2: 4f 90 pop r4 fcb4: 3f 90 pop r3 fcb6: 2f 90 pop r2 fcb8: 08 95 ret return; } run = false; #endif //PINDA_THERMISTOR uint8_t nMeasPoints = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); fcba: 8b ea ldi r24, 0xAB ; 171 fcbc: 9d e0 ldi r25, 0x0D ; 13 fcbe: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 fcc2: 18 2f mov r17, r24 if (uint8_t codeSeen = code_seen('N'), value = code_value_uint8(); codeSeen && (value == 7 || value == 3)) fcc4: 8e e4 ldi r24, 0x4E ; 78 fcc6: 0e 94 2b 55 call 0xaa56 ; 0xaa56 fcca: 08 2f mov r16, r24 fccc: 0e 94 40 55 call 0xaa80 ; 0xaa80 fcd0: 8e 83 std Y+6, r24 ; 0x06 fcd2: 00 23 and r16, r16 fcd4: 29 f0 breq .+10 ; 0xfce0 fcd6: 87 30 cpi r24, 0x07 ; 7 fcd8: 09 f4 brne .+2 ; 0xfcdc fcda: c9 c0 rjmp .+402 ; 0xfe6e fcdc: 83 30 cpi r24, 0x03 ; 3 fcde: 29 f0 breq .+10 ; 0xfcea nMeasPoints = value; // 7x7 region MBL needs tighter thresholds for triggering a Z realignment. This is because you want to have as little of a misalignment as possible between // the "inner" MBL region and "outer" MBL region which is interpolated from Z calibration values. const float Z_CALIBRATION_THRESHOLD = (nMeasPoints == 3) ? Z_CALIBRATION_THRESHOLD_RELAXED : Z_CALIBRATION_THRESHOLD_TIGHT; fce0: 13 30 cpi r17, 0x03 ; 3 fce2: 09 f0 breq .+2 ; 0xfce6 fce4: c3 c0 rjmp .+390 ; 0xfe6c fce6: 63 e0 ldi r22, 0x03 ; 3 fce8: 6e 83 std Y+6, r22 ; 0x06 fcea: 80 e0 ldi r24, 0x00 ; 0 fcec: 90 e0 ldi r25, 0x00 ; 0 fcee: a0 e8 ldi r26, 0x80 ; 128 fcf0: bf e3 ldi r27, 0x3F ; 63 fcf2: 8a 83 std Y+2, r24 ; 0x02 fcf4: 9b 83 std Y+3, r25 ; 0x03 fcf6: ac 83 std Y+4, r26 ; 0x04 fcf8: bd 83 std Y+5, r27 ; 0x05 uint8_t nProbeRetryCount = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); fcfa: 8a ea ldi r24, 0xAA ; 170 fcfc: 9d e0 ldi r25, 0x0D ; 13 fcfe: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 fd02: 88 8f std Y+24, r24 ; 0x18 if (uint8_t codeSeen = code_seen('C'), value = code_value_uint8(); codeSeen && value >= 1 && value <= 10) fd04: 83 e4 ldi r24, 0x43 ; 67 fd06: 0e 94 2b 55 call 0xaa56 ; 0xaa56 fd0a: 18 2f mov r17, r24 fd0c: 0e 94 40 55 call 0xaa80 ; 0xaa80 fd10: 11 23 and r17, r17 fd12: 29 f0 breq .+10 ; 0xfd1e fd14: 88 23 and r24, r24 fd16: 19 f0 breq .+6 ; 0xfd1e fd18: 8b 30 cpi r24, 0x0B ; 11 fd1a: 08 f4 brcc .+2 ; 0xfd1e fd1c: 88 8f std Y+24, r24 ; 0x18 nProbeRetryCount = value; const float area_min_x = code_seen('X') ? code_value() - x_mesh_density - X_PROBE_OFFSET_FROM_EXTRUDER : -INFINITY; fd1e: 88 e5 ldi r24, 0x58 ; 88 fd20: 0e 94 2b 55 call 0xaa56 ; 0xaa56 fd24: 88 23 and r24, r24 fd26: 09 f4 brne .+2 ; 0xfd2a fd28: ab c0 rjmp .+342 ; 0xfe80 fd2a: 0e 94 03 5a call 0xb406 ; 0xb406 fd2e: 20 e0 ldi r18, 0x00 ; 0 fd30: 30 e0 ldi r19, 0x00 ; 0 fd32: 48 e0 ldi r20, 0x08 ; 8 fd34: 52 e4 ldi r21, 0x42 ; 66 fd36: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> fd3a: 20 e0 ldi r18, 0x00 ; 0 fd3c: 30 e0 ldi r19, 0x00 ; 0 fd3e: 48 eb ldi r20, 0xB8 ; 184 fd40: 51 e4 ldi r21, 0x41 ; 65 fd42: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> fd46: 6a 87 std Y+10, r22 ; 0x0a fd48: 7b 87 std Y+11, r23 ; 0x0b fd4a: 8c 87 std Y+12, r24 ; 0x0c fd4c: 9d 87 std Y+13, r25 ; 0x0d const float area_min_y = code_seen('Y') ? code_value() - y_mesh_density - Y_PROBE_OFFSET_FROM_EXTRUDER : -INFINITY; fd4e: 89 e5 ldi r24, 0x59 ; 89 fd50: 0e 94 2b 55 call 0xaa56 ; 0xaa56 fd54: 88 23 and r24, r24 fd56: 09 f4 brne .+2 ; 0xfd5a fd58: 9c c0 rjmp .+312 ; 0xfe92 fd5a: 0e 94 03 5a call 0xb406 ; 0xb406 fd5e: 20 e0 ldi r18, 0x00 ; 0 fd60: 30 e0 ldi r19, 0x00 ; 0 fd62: 48 e0 ldi r20, 0x08 ; 8 fd64: 52 e4 ldi r21, 0x42 ; 66 fd66: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> fd6a: 20 e0 ldi r18, 0x00 ; 0 fd6c: 30 e0 ldi r19, 0x00 ; 0 fd6e: 40 ea ldi r20, 0xA0 ; 160 fd70: 50 e4 ldi r21, 0x40 ; 64 fd72: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> fd76: 6c 8b std Y+20, r22 ; 0x14 fd78: 7d 8b std Y+21, r23 ; 0x15 fd7a: 8e 8b std Y+22, r24 ; 0x16 fd7c: 9f 8b std Y+23, r25 ; 0x17 const float area_max_x = code_seen('W') ? area_min_x + code_value() + 2 * x_mesh_density : INFINITY; fd7e: 87 e5 ldi r24, 0x57 ; 87 fd80: 0e 94 2b 55 call 0xaa56 ; 0xaa56 fd84: 88 23 and r24, r24 fd86: 09 f4 brne .+2 ; 0xfd8a fd88: 89 c0 rjmp .+274 ; 0xfe9c fd8a: 0e 94 03 5a call 0xb406 ; 0xb406 fd8e: 2a 85 ldd r18, Y+10 ; 0x0a fd90: 3b 85 ldd r19, Y+11 ; 0x0b fd92: 4c 85 ldd r20, Y+12 ; 0x0c fd94: 5d 85 ldd r21, Y+13 ; 0x0d fd96: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> fd9a: 20 e0 ldi r18, 0x00 ; 0 fd9c: 30 e0 ldi r19, 0x00 ; 0 fd9e: 48 e8 ldi r20, 0x88 ; 136 fda0: 52 e4 ldi r21, 0x42 ; 66 fda2: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> fda6: 69 8f std Y+25, r22 ; 0x19 fda8: 7a 8f std Y+26, r23 ; 0x1a fdaa: 8b 8f std Y+27, r24 ; 0x1b fdac: 9c 8f std Y+28, r25 ; 0x1c const float area_max_y = code_seen('H') ? area_min_y + code_value() + 2 * y_mesh_density : INFINITY; fdae: 88 e4 ldi r24, 0x48 ; 72 fdb0: 0e 94 2b 55 call 0xaa56 ; 0xaa56 fdb4: 88 23 and r24, r24 fdb6: 09 f4 brne .+2 ; 0xfdba fdb8: 7a c0 rjmp .+244 ; 0xfeae fdba: 0e 94 03 5a call 0xb406 ; 0xb406 fdbe: 2c 89 ldd r18, Y+20 ; 0x14 fdc0: 3d 89 ldd r19, Y+21 ; 0x15 fdc2: 4e 89 ldd r20, Y+22 ; 0x16 fdc4: 5f 89 ldd r21, Y+23 ; 0x17 fdc6: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> fdca: 20 e0 ldi r18, 0x00 ; 0 fdcc: 30 e0 ldi r19, 0x00 ; 0 fdce: 48 e8 ldi r20, 0x88 ; 136 fdd0: 52 e4 ldi r21, 0x42 ; 66 fdd2: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> fdd6: 6d 8f std Y+29, r22 ; 0x1d fdd8: 7e 8f std Y+30, r23 ; 0x1e fdda: 8f 8f std Y+31, r24 ; 0x1f fddc: 98 a3 std Y+32, r25 ; 0x20 mbl.reset(); //reset mesh bed leveling fdde: 0f 94 f1 55 call 0x2abe2 ; 0x2abe2 mbl.z_values[0][0] = min_pos[Z_AXIS]; fde2: 80 91 2c 02 lds r24, 0x022C ; 0x80022c fde6: 90 91 2d 02 lds r25, 0x022D ; 0x80022d fdea: a0 91 2e 02 lds r26, 0x022E ; 0x80022e fdee: b0 91 2f 02 lds r27, 0x022F ; 0x80022f fdf2: 80 93 9d 12 sts 0x129D, r24 ; 0x80129d fdf6: 90 93 9e 12 sts 0x129E, r25 ; 0x80129e fdfa: a0 93 9f 12 sts 0x129F, r26 ; 0x80129f fdfe: b0 93 a0 12 sts 0x12A0, r27 ; 0x8012a0 // Reset baby stepping to zero, if the babystepping has already been loaded before. babystep_undo(); fe02: 0f 94 0b 8b call 0x31616 ; 0x31616 fe06: 05 ec ldi r16, 0xC5 ; 197 fe08: 1f e0 ldi r17, 0x0F ; 15 bool is_bed_z_jitter_data_valid() // offsets of the Z heiths of the calibration points from the first point are saved as 16bit signed int, scaled to tenths of microns // if at least one 16bit integer has different value then -1 (0x0FFFF), data are considered valid and function returns true, otherwise it returns false { for (int8_t i = 0; i < 8; ++i) { if (eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + i * 2)) != 0x0FFFF) fe0a: c8 01 movw r24, r16 fe0c: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 fe10: 01 96 adiw r24, 0x01 ; 1 fe12: 09 f0 breq .+2 ; 0xfe16 fe14: 51 c0 rjmp .+162 ; 0xfeb8 fe16: 0e 5f subi r16, 0xFE ; 254 fe18: 1f 4f sbci r17, 0xFF ; 255 bool is_bed_z_jitter_data_valid() // offsets of the Z heiths of the calibration points from the first point are saved as 16bit signed int, scaled to tenths of microns // if at least one 16bit integer has different value then -1 (0x0FFFF), data are considered valid and function returns true, otherwise it returns false { for (int8_t i = 0; i < 8; ++i) { fe1a: 05 3d cpi r16, 0xD5 ; 213 fe1c: 8f e0 ldi r24, 0x0F ; 15 fe1e: 18 07 cpc r17, r24 fe20: a1 f7 brne .-24 ; 0xfe0a if (eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + i * 2)) != 0x0FFFF) return true; } return false; fe22: 21 2c mov r2, r1 fe24: ac e9 ldi r26, 0x9C ; 156 fe26: b2 e1 ldi r27, 0x12 ; 18 fe28: ba a3 std Y+34, r27 ; 0x22 fe2a: a9 a3 std Y+33, r26 ; 0x21 // offsets of the Z heiths of the calibration points from the first point are saved as 16bit signed int, scaled to tenths of microns // if at least one 16bit integer has different value then -1 (0x0FFFF), data are considered valid and function returns true, otherwise it returns false { for (int8_t i = 0; i < 8; ++i) { if (eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + i * 2)) != 0x0FFFF) return true; fe2c: b9 87 std Y+9, r27 ; 0x09 fe2e: a8 87 std Y+8, r26 ; 0x08 fe30: 51 2c mov r5, r1 fe32: 41 2c mov r4, r1 // Initialize the default mesh from eeprom and calculate how many points are to be probed bool has_z = is_bed_z_jitter_data_valid(); //checks if we have data from Z calibration (offsets of the Z heiths of the 8 calibration points from the first point) uint8_t meshPointsToProbe = 0; fe34: 31 2c mov r3, r1 fe36: 04 2d mov r16, r4 for (uint8_t row = 0; row < MESH_NUM_Y_POINTS; row++) { for (uint8_t col = 0; col < MESH_NUM_X_POINTS; col++) { bool isOn3x3Mesh = ((row % 3 == 0) && (col % 3 == 0)); fe38: 84 2d mov r24, r4 fe3a: 63 e0 ldi r22, 0x03 ; 3 fe3c: 0f 94 8b a0 call 0x34116 ; 0x34116 <__udivmodqi4> fe40: 98 8b std Y+16, r25 ; 0x10 fe42: 68 84 ldd r6, Y+8 ; 0x08 fe44: 79 84 ldd r7, Y+9 ; 0x09 // Initialize the default mesh from eeprom and calculate how many points are to be probed bool has_z = is_bed_z_jitter_data_valid(); //checks if we have data from Z calibration (offsets of the Z heiths of the 8 calibration points from the first point) uint8_t meshPointsToProbe = 0; for (uint8_t row = 0; row < MESH_NUM_Y_POINTS; row++) { for (uint8_t col = 0; col < MESH_NUM_X_POINTS; col++) { fe46: 10 e0 ldi r17, 0x00 ; 0 bool isOn3x3Mesh = ((row % 3 == 0) && (col % 3 == 0)); fe48: f8 89 ldd r31, Y+16 ; 0x10 fe4a: f1 11 cpse r31, r1 fe4c: 37 c0 rjmp .+110 ; 0xfebc fe4e: 81 2f mov r24, r17 fe50: 63 e0 ldi r22, 0x03 ; 3 fe52: 0f 94 8b a0 call 0x34116 ; 0x34116 <__udivmodqi4> fe56: 91 11 cpse r25, r1 fe58: 31 c0 rjmp .+98 ; 0xfebc if (isOn3x3Mesh) { if (has_z && (row || col)) { fe5a: 21 10 cpse r2, r1 fe5c: 3f c1 rjmp .+638 ; 0x100dc } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { fe5e: 7e 81 ldd r23, Y+6 ; 0x06 fe60: 73 30 cpi r23, 0x03 ; 3 fe62: 09 f4 brne .+2 ; 0xfe66 fe64: 70 c0 rjmp .+224 ; 0xff46 fe66: 8f 81 ldd r24, Y+7 ; 0x07 fe68: 8e 87 std Y+14, r24 ; 0x0e fe6a: 37 c0 rjmp .+110 ; 0xfeda if (uint8_t codeSeen = code_seen('N'), value = code_value_uint8(); codeSeen && (value == 7 || value == 3)) nMeasPoints = value; // 7x7 region MBL needs tighter thresholds for triggering a Z realignment. This is because you want to have as little of a misalignment as possible between // the "inner" MBL region and "outer" MBL region which is interpolated from Z calibration values. const float Z_CALIBRATION_THRESHOLD = (nMeasPoints == 3) ? Z_CALIBRATION_THRESHOLD_RELAXED : Z_CALIBRATION_THRESHOLD_TIGHT; fe6c: 1e 83 std Y+6, r17 ; 0x06 fe6e: 6a e9 ldi r22, 0x9A ; 154 fe70: 79 e9 ldi r23, 0x99 ; 153 fe72: 89 e1 ldi r24, 0x19 ; 25 fe74: 9f e3 ldi r25, 0x3F ; 63 fe76: 6a 83 std Y+2, r22 ; 0x02 fe78: 7b 83 std Y+3, r23 ; 0x03 fe7a: 8c 83 std Y+4, r24 ; 0x04 fe7c: 9d 83 std Y+5, r25 ; 0x05 fe7e: 3d cf rjmp .-390 ; 0xfcfa uint8_t nProbeRetryCount = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); if (uint8_t codeSeen = code_seen('C'), value = code_value_uint8(); codeSeen && value >= 1 && value <= 10) nProbeRetryCount = value; const float area_min_x = code_seen('X') ? code_value() - x_mesh_density - X_PROBE_OFFSET_FROM_EXTRUDER : -INFINITY; fe80: 80 e0 ldi r24, 0x00 ; 0 fe82: 90 e0 ldi r25, 0x00 ; 0 fe84: a0 e8 ldi r26, 0x80 ; 128 fe86: bf ef ldi r27, 0xFF ; 255 fe88: 8a 87 std Y+10, r24 ; 0x0a fe8a: 9b 87 std Y+11, r25 ; 0x0b fe8c: ac 87 std Y+12, r26 ; 0x0c fe8e: bd 87 std Y+13, r27 ; 0x0d fe90: 5e cf rjmp .-324 ; 0xfd4e const float area_min_y = code_seen('Y') ? code_value() - y_mesh_density - Y_PROBE_OFFSET_FROM_EXTRUDER : -INFINITY; fe92: 60 e0 ldi r22, 0x00 ; 0 fe94: 70 e0 ldi r23, 0x00 ; 0 fe96: 80 e8 ldi r24, 0x80 ; 128 fe98: 9f ef ldi r25, 0xFF ; 255 fe9a: 6d cf rjmp .-294 ; 0xfd76 const float area_max_x = code_seen('W') ? area_min_x + code_value() + 2 * x_mesh_density : INFINITY; fe9c: 80 e0 ldi r24, 0x00 ; 0 fe9e: 90 e0 ldi r25, 0x00 ; 0 fea0: a0 e8 ldi r26, 0x80 ; 128 fea2: bf e7 ldi r27, 0x7F ; 127 fea4: 89 8f std Y+25, r24 ; 0x19 fea6: 9a 8f std Y+26, r25 ; 0x1a fea8: ab 8f std Y+27, r26 ; 0x1b feaa: bc 8f std Y+28, r27 ; 0x1c feac: 80 cf rjmp .-256 ; 0xfdae const float area_max_y = code_seen('H') ? area_min_y + code_value() + 2 * y_mesh_density : INFINITY; feae: 60 e0 ldi r22, 0x00 ; 0 feb0: 70 e0 ldi r23, 0x00 ; 0 feb2: 80 e8 ldi r24, 0x80 ; 128 feb4: 9f e7 ldi r25, 0x7F ; 127 feb6: 8f cf rjmp .-226 ; 0xfdd6 feb8: 2f 80 ldd r2, Y+7 ; 0x07 feba: b4 cf rjmp .-152 ; 0xfe24 void reset(); static float get_x(int i) { return BED_X(i) + X_PROBE_OFFSET_FROM_EXTRUDER; } static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } float get_z(float x, float y); void set_z(uint8_t ix, uint8_t iy, float z) { z_values[iy][ix] = z; } febc: 60 e0 ldi r22, 0x00 ; 0 febe: 70 e0 ldi r23, 0x00 ; 0 fec0: 80 ec ldi r24, 0xC0 ; 192 fec2: 9f e7 ldi r25, 0x7F ; 127 fec4: d3 01 movw r26, r6 fec6: 11 96 adiw r26, 0x01 ; 1 fec8: 6d 93 st X+, r22 feca: 7d 93 st X+, r23 fecc: 8d 93 st X+, r24 fece: 9c 93 st X, r25 fed0: 14 97 sbiw r26, 0x04 ; 4 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { fed2: be 81 ldd r27, Y+6 ; 0x06 fed4: b3 30 cpi r27, 0x03 ; 3 fed6: c1 f1 breq .+112 ; 0xff48 fed8: 1e 86 std Y+14, r1 ; 0x0e if (!isOn3x3Mesh) continue; } else { const float x_pos = BED_X(col); feda: 81 2f mov r24, r17 fedc: 0f 94 65 8b call 0x316ca ; 0x316ca fee0: 4b 01 movw r8, r22 fee2: 5c 01 movw r10, r24 const float y_pos = BED_Y(row); fee4: 80 2f mov r24, r16 fee6: 0f 94 65 8b call 0x316ca ; 0x316ca feea: 6b 01 movw r12, r22 feec: 7c 01 movw r14, r24 if ((x_pos < area_min_x || x_pos > area_max_x || y_pos < area_min_y || y_pos > area_max_y) && (!isOn3x3Mesh || has_z)) { feee: a5 01 movw r20, r10 fef0: 94 01 movw r18, r8 fef2: 6a 85 ldd r22, Y+10 ; 0x0a fef4: 7b 85 ldd r23, Y+11 ; 0x0b fef6: 8c 85 ldd r24, Y+12 ; 0x0c fef8: 9d 85 ldd r25, Y+13 ; 0x0d fefa: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> fefe: 18 16 cp r1, r24 ff00: 0c f4 brge .+2 ; 0xff04 ff02: 1c c1 rjmp .+568 ; 0x1013c ff04: 29 8d ldd r18, Y+25 ; 0x19 ff06: 3a 8d ldd r19, Y+26 ; 0x1a ff08: 4b 8d ldd r20, Y+27 ; 0x1b ff0a: 5c 8d ldd r21, Y+28 ; 0x1c ff0c: c5 01 movw r24, r10 ff0e: b4 01 movw r22, r8 ff10: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> ff14: 18 16 cp r1, r24 ff16: 0c f4 brge .+2 ; 0xff1a ff18: 11 c1 rjmp .+546 ; 0x1013c ff1a: a7 01 movw r20, r14 ff1c: 96 01 movw r18, r12 ff1e: 6c 89 ldd r22, Y+20 ; 0x14 ff20: 7d 89 ldd r23, Y+21 ; 0x15 ff22: 8e 89 ldd r24, Y+22 ; 0x16 ff24: 9f 89 ldd r25, Y+23 ; 0x17 ff26: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> ff2a: 18 16 cp r1, r24 ff2c: 0c f4 brge .+2 ; 0xff30 ff2e: 06 c1 rjmp .+524 ; 0x1013c ff30: 2d 8d ldd r18, Y+29 ; 0x1d ff32: 3e 8d ldd r19, Y+30 ; 0x1e ff34: 4f 8d ldd r20, Y+31 ; 0x1f ff36: 58 a1 ldd r21, Y+32 ; 0x20 ff38: c7 01 movw r24, r14 ff3a: b6 01 movw r22, r12 ff3c: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> ff40: 18 16 cp r1, r24 ff42: 0c f4 brge .+2 ; 0xff46 ff44: fb c0 rjmp .+502 ; 0x1013c continue; } } // increment the total point counter if the points are not skipped meshPointsToProbe++; ff46: 33 94 inc r3 // Initialize the default mesh from eeprom and calculate how many points are to be probed bool has_z = is_bed_z_jitter_data_valid(); //checks if we have data from Z calibration (offsets of the Z heiths of the 8 calibration points from the first point) uint8_t meshPointsToProbe = 0; for (uint8_t row = 0; row < MESH_NUM_Y_POINTS; row++) { for (uint8_t col = 0; col < MESH_NUM_X_POINTS; col++) { ff48: 1f 5f subi r17, 0xFF ; 255 ff4a: 24 e0 ldi r18, 0x04 ; 4 ff4c: 62 0e add r6, r18 ff4e: 71 1c adc r7, r1 ff50: 17 30 cpi r17, 0x07 ; 7 ff52: 09 f0 breq .+2 ; 0xff56 ff54: 79 cf rjmp .-270 ; 0xfe48 ff56: 6f ef ldi r22, 0xFF ; 255 ff58: 46 1a sub r4, r22 ff5a: 56 0a sbc r5, r22 ff5c: 88 85 ldd r24, Y+8 ; 0x08 ff5e: 99 85 ldd r25, Y+9 ; 0x09 ff60: 4c 96 adiw r24, 0x1c ; 28 ff62: 99 87 std Y+9, r25 ; 0x09 ff64: 88 87 std Y+8, r24 ; 0x08 babystep_undo(); // Initialize the default mesh from eeprom and calculate how many points are to be probed bool has_z = is_bed_z_jitter_data_valid(); //checks if we have data from Z calibration (offsets of the Z heiths of the 8 calibration points from the first point) uint8_t meshPointsToProbe = 0; for (uint8_t row = 0; row < MESH_NUM_Y_POINTS; row++) { ff66: 97 e0 ldi r25, 0x07 ; 7 ff68: 49 16 cp r4, r25 ff6a: 51 04 cpc r5, r1 ff6c: 09 f0 breq .+2 ; 0xff70 ff6e: 63 cf rjmp .-314 ; 0xfe36 // increment the total point counter if the points are not skipped meshPointsToProbe++; } } mbl.upsample_3x3(); //upsample the default mesh ff70: 0e 94 fc f0 call 0x1e1f8 ; 0x1e1f8 // Save custom message state, set a new custom message state to display: Calibrating point 9. CustomMsg custom_message_type_old = custom_message_type; ff74: a0 91 c7 06 lds r26, 0x06C7 ; 0x8006c7 ff78: af 83 std Y+7, r26 ; 0x07 uint8_t custom_message_state_old = custom_message_state; ff7a: b0 91 ac 03 lds r27, 0x03AC ; 0x8003ac ff7e: b8 87 std Y+8, r27 ; 0x08 custom_message_type = CustomMsg::MeshBedLeveling; ff80: 81 e0 ldi r24, 0x01 ; 1 ff82: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 custom_message_state = meshPointsToProbe + 10; ff86: 8a e0 ldi r24, 0x0A ; 10 ff88: 83 0d add r24, r3 ff8a: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac lcd_update(1); ff8e: 81 e0 ldi r24, 0x01 ; 1 ff90: 0e 94 42 69 call 0xd284 ; 0xd284 // Lift Z to a safe position before probing the first point current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; ff94: 80 e0 ldi r24, 0x00 ; 0 ff96: 90 e0 ldi r25, 0x00 ; 0 ff98: a0 ea ldi r26, 0xA0 ; 160 ff9a: b0 e4 ldi r27, 0x40 ; 64 ff9c: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd ffa0: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe ffa4: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff ffa8: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); ffac: 65 e5 ldi r22, 0x55 ; 85 ffae: 75 e5 ldi r23, 0x55 ; 85 ffb0: 85 e5 ldi r24, 0x55 ; 85 ffb2: 91 e4 ldi r25, 0x41 ; 65 ffb4: 0f 94 70 84 call 0x308e0 ; 0x308e0 // Cycle through all points and probe them int l_feedmultiply = setup_for_endstop_move(false); //save feedrate and feedmultiply, sets feedmultiply to 100 ffb8: 80 e0 ldi r24, 0x00 ; 0 ffba: 0e 94 ee 5f call 0xbfdc ; 0xbfdc ffbe: 9c a3 std Y+36, r25 ; 0x24 ffc0: 8b a3 std Y+35, r24 ; 0x23 ffc2: 31 2c mov r3, r1 uint8_t mesh_point = 0; //index number of calibration point while (mesh_point != MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) { // Get coords of a measuring point. uint8_t ix = mesh_point % MESH_NUM_X_POINTS; // from 0 to MESH_NUM_X_POINTS - 1 ffc4: 83 2d mov r24, r3 ffc6: 67 e0 ldi r22, 0x07 ; 7 ffc8: 0f 94 8b a0 call 0x34116 ; 0x34116 <__udivmodqi4> ffcc: f8 2e mov r15, r24 ffce: 09 2f mov r16, r25 uint8_t iy = mesh_point / MESH_NUM_X_POINTS; if (iy & 1) ix = (MESH_NUM_X_POINTS - 1) - ix; // Zig zag ffd0: 68 2f mov r22, r24 ffd2: 70 e0 ldi r23, 0x00 ; 0 ffd4: 7f 87 std Y+15, r23 ; 0x0f ffd6: 6e 87 std Y+14, r22 ; 0x0e ffd8: 80 ff sbrs r24, 0 ffda: 03 c0 rjmp .+6 ; 0xffe2 ffdc: 76 e0 ldi r23, 0x06 ; 6 ffde: 79 1b sub r23, r25 ffe0: 07 2f mov r16, r23 bool isOn3x3Mesh = ((ix % 3 == 0) && (iy % 3 == 0)); ffe2: 80 2f mov r24, r16 ffe4: 63 e0 ldi r22, 0x03 ; 3 ffe6: 0f 94 8b a0 call 0x34116 ; 0x34116 <__udivmodqi4> ffea: 91 11 cpse r25, r1 ffec: 05 c0 rjmp .+10 ; 0xfff8 ffee: 8f 2d mov r24, r15 fff0: 0f 94 8b a0 call 0x34116 ; 0x34116 <__udivmodqi4> fff4: 11 e0 ldi r17, 0x01 ; 1 fff6: 91 11 cpse r25, r1 fff8: 10 e0 ldi r17, 0x00 ; 0 float x_pos = BED_X(ix); fffa: 80 2f mov r24, r16 fffc: 0f 94 65 8b call 0x316ca ; 0x316ca 10000: 68 8b std Y+16, r22 ; 0x10 10002: 79 8b std Y+17, r23 ; 0x11 10004: 8a 8b std Y+18, r24 ; 0x12 10006: 9b 8b std Y+19, r25 ; 0x13 float y_pos = BED_Y(iy); 10008: 8f 2d mov r24, r15 1000a: 0f 94 65 8b call 0x316ca ; 0x316ca 1000e: 4b 01 movw r8, r22 10010: 5c 01 movw r10, r24 if (nMeasPoints == 3) { 10012: 8e 81 ldd r24, Y+6 ; 0x06 10014: 83 30 cpi r24, 0x03 ; 3 10016: 09 f0 breq .+2 ; 0x1001a 10018: 99 c0 rjmp .+306 ; 0x1014c if (!isOn3x3Mesh) { 1001a: 11 11 cpse r17, r1 1001c: c8 c0 rjmp .+400 ; 0x101ae 1001e: 27 e0 ldi r18, 0x07 ; 7 10020: ae 85 ldd r26, Y+14 ; 0x0e 10022: bf 85 ldd r27, Y+15 ; 0x0f 10024: 2a 9f mul r18, r26 10026: f0 01 movw r30, r0 10028: 2b 9f mul r18, r27 1002a: f0 0d add r31, r0 1002c: 11 24 eor r1, r1 1002e: e0 0f add r30, r16 10030: f1 1d adc r31, r1 10032: ee 0f add r30, r30 10034: ff 1f adc r31, r31 10036: ee 0f add r30, r30 10038: ff 1f adc r31, r31 1003a: e4 56 subi r30, 0x64 ; 100 1003c: fd 4e sbci r31, 0xED ; 237 1003e: 60 e0 ldi r22, 0x00 ; 0 10040: 70 e0 ldi r23, 0x00 ; 0 10042: 80 ec ldi r24, 0xC0 ; 192 10044: 9f e7 ldi r25, 0x7F ; 127 10046: 61 83 std Z+1, r22 ; 0x01 10048: 72 83 std Z+2, r23 ; 0x02 1004a: 83 83 std Z+3, r24 ; 0x03 1004c: 94 83 std Z+4, r25 ; 0x04 1004e: 33 94 inc r3 plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); // Cycle through all points and probe them int l_feedmultiply = setup_for_endstop_move(false); //save feedrate and feedmultiply, sets feedmultiply to 100 uint8_t mesh_point = 0; //index number of calibration point while (mesh_point != MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) { 10050: e1 e3 ldi r30, 0x31 ; 49 10052: 3e 12 cpse r3, r30 10054: b7 cf rjmp .-146 ; 0xffc4 custom_message_state--; mesh_point++; lcd_update(1); } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 10056: 80 e0 ldi r24, 0x00 ; 0 10058: 90 e0 ldi r25, 0x00 ; 0 1005a: a0 ea ldi r26, 0xA0 ; 160 1005c: b0 e4 ldi r27, 0x40 ; 64 1005e: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 10062: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 10066: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 1006a: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 1006e: 65 e5 ldi r22, 0x55 ; 85 10070: 75 e5 ldi r23, 0x55 ; 85 10072: 85 e5 ldi r24, 0x55 ; 85 10074: 91 e4 ldi r25, 0x41 ; 65 10076: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 1007a: 0f 94 42 22 call 0x24484 ; 0x24484 static uint8_t g80_fail_cnt = 0; if (mesh_point != MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) { 1007e: b1 e3 ldi r27, 0x31 ; 49 10080: 3b 16 cp r3, r27 10082: 09 f4 brne .+2 ; 0x10086 10084: 3c c2 rjmp .+1144 ; 0x104fe if (g80_fail_cnt++ >= 1) { 10086: 80 91 3f 03 lds r24, 0x033F ; 0x80033f 1008a: 91 e0 ldi r25, 0x01 ; 1 1008c: 98 0f add r25, r24 1008e: 90 93 3f 03 sts 0x033F, r25 ; 0x80033f 10092: 88 23 and r24, r24 10094: 09 f4 brne .+2 ; 0x10098 10096: d3 c1 rjmp .+934 ; 0x1043e print_stop(); 10098: 60 e0 ldi r22, 0x00 ; 0 1009a: 80 e0 ldi r24, 0x00 ; 0 1009c: 0e 94 92 ef call 0x1df24 ; 0x1df24 lcd_show_fullscreen_message_and_wait_P(_T(MSG_MBL_FAILED)); 100a0: 84 e3 ldi r24, 0x34 ; 52 100a2: 96 e3 ldi r25, 0x36 ; 54 100a4: 0e 94 b1 6c call 0xd962 ; 0xd962 100a8: 0f 94 47 0b call 0x2168e ; 0x2168e lcd_z_calibration_prompt(false); 100ac: 80 e0 ldi r24, 0x00 ; 0 100ae: 0f 94 c1 2f call 0x25f82 ; 0x25f82 current_position[E_AXIS] += default_retraction; plan_buffer_line_curposXYZE(400); } #endif // !PINDA_THERMISTOR exit: KEEPALIVE_STATE(NOT_BUSY); 100b2: 81 e0 ldi r24, 0x01 ; 1 100b4: 80 93 78 02 sts 0x0278, r24 ; 0x800278 // Restore custom message state lcd_setstatuspgm(MSG_WELCOME); 100b8: 87 e6 ldi r24, 0x67 ; 103 100ba: 9b e6 ldi r25, 0x6B ; 107 100bc: 0e 94 65 e6 call 0x1ccca ; 0x1ccca custom_message_type = custom_message_type_old; 100c0: 2f 81 ldd r18, Y+7 ; 0x07 100c2: 20 93 c7 06 sts 0x06C7, r18 ; 0x8006c7 custom_message_state = custom_message_state_old; 100c6: 68 85 ldd r22, Y+8 ; 0x08 100c8: 60 93 ac 03 sts 0x03AC, r22 ; 0x8003ac lcd_update(2); 100cc: 82 e0 ldi r24, 0x02 ; 2 100ce: 0e 94 42 69 call 0xd284 ; 0xd284 st_synchronize(); 100d2: 0f 94 42 22 call 0x24484 ; 0x24484 mesh_bed_leveling_flag = false; 100d6: 10 92 06 12 sts 0x1206, r1 ; 0x801206 100da: d6 cd rjmp .-1108 ; 0xfc88 uint8_t meshPointsToProbe = 0; for (uint8_t row = 0; row < MESH_NUM_Y_POINTS; row++) { for (uint8_t col = 0; col < MESH_NUM_X_POINTS; col++) { bool isOn3x3Mesh = ((row % 3 == 0) && (col % 3 == 0)); if (isOn3x3Mesh) { if (has_z && (row || col)) { 100dc: 01 11 cpse r16, r1 100de: 03 c0 rjmp .+6 ; 0x100e6 100e0: 11 23 and r17, r17 100e2: 09 f4 brne .+2 ; 0x100e6 100e4: bc ce rjmp .-648 ; 0xfe5e // Reconstruct the mesh saved in eeprom uint16_t z_offset_u = eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + 2 * ((col/3) + row - 1))); 100e6: 81 2f mov r24, r17 100e8: 63 e0 ldi r22, 0x03 ; 3 100ea: 0f 94 97 a0 call 0x3412e ; 0x3412e <__divmodqi4> 100ee: 84 0d add r24, r4 100f0: 95 2d mov r25, r5 100f2: 91 1d adc r25, r1 100f4: 88 0f add r24, r24 100f6: 99 1f adc r25, r25 100f8: 8d 53 subi r24, 0x3D ; 61 100fa: 90 4f sbci r25, 0xF0 ; 240 100fc: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 const float z0 = mbl.z_values[0][0] + *reinterpret_cast(&z_offset_u) * 0.01; 10100: bc 01 movw r22, r24 10102: 99 0f add r25, r25 10104: 88 0b sbc r24, r24 10106: 99 0b sbc r25, r25 10108: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 1010c: 2a e0 ldi r18, 0x0A ; 10 1010e: 37 ed ldi r19, 0xD7 ; 215 10110: 43 e2 ldi r20, 0x23 ; 35 10112: 5c e3 ldi r21, 0x3C ; 60 10114: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 10118: 9b 01 movw r18, r22 1011a: ac 01 movw r20, r24 1011c: 60 91 9d 12 lds r22, 0x129D ; 0x80129d 10120: 70 91 9e 12 lds r23, 0x129E ; 0x80129e 10124: 80 91 9f 12 lds r24, 0x129F ; 0x80129f 10128: 90 91 a0 12 lds r25, 0x12A0 ; 0x8012a0 1012c: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 10130: f3 01 movw r30, r6 10132: 61 83 std Z+1, r22 ; 0x01 10134: 72 83 std Z+2, r23 ; 0x02 10136: 83 83 std Z+3, r24 ; 0x03 10138: 94 83 std Z+4, r25 ; 0x04 1013a: 91 ce rjmp .-734 ; 0xfe5e if (!isOn3x3Mesh) continue; } else { const float x_pos = BED_X(col); const float y_pos = BED_Y(row); if ((x_pos < area_min_x || x_pos > area_max_x || y_pos < area_min_y || y_pos > area_max_y) && (!isOn3x3Mesh || has_z)) { 1013c: fe 85 ldd r31, Y+14 ; 0x0e 1013e: ff 23 and r31, r31 10140: 09 f4 brne .+2 ; 0x10144 10142: 02 cf rjmp .-508 ; 0xff48 10144: 22 20 and r2, r2 10146: 09 f4 brne .+2 ; 0x1014a 10148: fe ce rjmp .-516 ; 0xff46 1014a: fe ce rjmp .-516 ; 0xff48 if (!isOn3x3Mesh) { mesh_point++; mbl.set_z(ix, iy, NAN); continue; //skip } } else if ((x_pos < area_min_x || x_pos > area_max_x || y_pos < area_min_y || y_pos > area_max_y) && (!isOn3x3Mesh || has_z)) { 1014c: 28 89 ldd r18, Y+16 ; 0x10 1014e: 39 89 ldd r19, Y+17 ; 0x11 10150: 4a 89 ldd r20, Y+18 ; 0x12 10152: 5b 89 ldd r21, Y+19 ; 0x13 10154: 6a 85 ldd r22, Y+10 ; 0x0a 10156: 7b 85 ldd r23, Y+11 ; 0x0b 10158: 8c 85 ldd r24, Y+12 ; 0x0c 1015a: 9d 85 ldd r25, Y+13 ; 0x0d 1015c: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 10160: 18 16 cp r1, r24 10162: 04 f1 brlt .+64 ; 0x101a4 10164: 28 89 ldd r18, Y+16 ; 0x10 10166: 39 89 ldd r19, Y+17 ; 0x11 10168: 4a 89 ldd r20, Y+18 ; 0x12 1016a: 5b 89 ldd r21, Y+19 ; 0x13 1016c: 69 8d ldd r22, Y+25 ; 0x19 1016e: 7a 8d ldd r23, Y+26 ; 0x1a 10170: 8b 8d ldd r24, Y+27 ; 0x1b 10172: 9c 8d ldd r25, Y+28 ; 0x1c 10174: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 10178: 87 fd sbrc r24, 7 1017a: 14 c0 rjmp .+40 ; 0x101a4 1017c: a5 01 movw r20, r10 1017e: 94 01 movw r18, r8 10180: 6c 89 ldd r22, Y+20 ; 0x14 10182: 7d 89 ldd r23, Y+21 ; 0x15 10184: 8e 89 ldd r24, Y+22 ; 0x16 10186: 9f 89 ldd r25, Y+23 ; 0x17 10188: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 1018c: 18 16 cp r1, r24 1018e: 54 f0 brlt .+20 ; 0x101a4 10190: a5 01 movw r20, r10 10192: 94 01 movw r18, r8 10194: 6d 8d ldd r22, Y+29 ; 0x1d 10196: 7e 8d ldd r23, Y+30 ; 0x1e 10198: 8f 8d ldd r24, Y+31 ; 0x1f 1019a: 98 a1 ldd r25, Y+32 ; 0x20 1019c: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 101a0: 87 ff sbrs r24, 7 101a2: 05 c0 rjmp .+10 ; 0x101ae 101a4: 11 23 and r17, r17 101a6: 09 f4 brne .+2 ; 0x101aa 101a8: 52 cf rjmp .-348 ; 0x1004e 101aa: 21 10 cpse r2, r1 101ac: 50 cf rjmp .-352 ; 0x1004e mesh_point++; continue; //skip } // Move Z up to the probe height of the current Z point. const float z0 = mbl.z_values[iy][ix]; 101ae: 10 e0 ldi r17, 0x00 ; 0 101b0: a7 e0 ldi r26, 0x07 ; 7 101b2: 8e 85 ldd r24, Y+14 ; 0x0e 101b4: 9f 85 ldd r25, Y+15 ; 0x0f 101b6: a8 9f mul r26, r24 101b8: f0 01 movw r30, r0 101ba: a9 9f mul r26, r25 101bc: f0 0d add r31, r0 101be: 11 24 eor r1, r1 101c0: e0 0f add r30, r16 101c2: f1 1f adc r31, r17 101c4: ee 0f add r30, r30 101c6: ff 1f adc r31, r31 101c8: ee 0f add r30, r30 101ca: ff 1f adc r31, r31 101cc: e4 56 subi r30, 0x64 ; 100 101ce: fd 4e sbci r31, 0xED ; 237 101d0: 41 80 ldd r4, Z+1 ; 0x01 101d2: 52 80 ldd r5, Z+2 ; 0x02 101d4: 63 80 ldd r6, Z+3 ; 0x03 101d6: 74 80 ldd r7, Z+4 ; 0x04 const float init_z_bckp = !has_z ? MESH_HOME_Z_SEARCH : z0 + MESH_HOME_Z_SEARCH_FAST; 101d8: c1 2c mov r12, r1 101da: d1 2c mov r13, r1 101dc: e0 ea ldi r30, 0xA0 ; 160 101de: ee 2e mov r14, r30 101e0: e0 e4 ldi r30, 0x40 ; 64 101e2: fe 2e mov r15, r30 101e4: 22 20 and r2, r2 101e6: 51 f0 breq .+20 ; 0x101fc 101e8: 23 e3 ldi r18, 0x33 ; 51 101ea: 33 e3 ldi r19, 0x33 ; 51 101ec: 43 eb ldi r20, 0xB3 ; 179 101ee: 5e e3 ldi r21, 0x3E ; 62 101f0: c3 01 movw r24, r6 101f2: b2 01 movw r22, r4 101f4: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 101f8: 6b 01 movw r12, r22 101fa: 7c 01 movw r14, r24 if (init_z_bckp > current_position[Z_AXIS]) { 101fc: a7 01 movw r20, r14 101fe: 96 01 movw r18, r12 10200: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 10204: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 10208: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 1020c: 90 91 00 12 lds r25, 0x1200 ; 0x801200 10210: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 10214: 87 ff sbrs r24, 7 10216: 10 c0 rjmp .+32 ; 0x10238 current_position[Z_AXIS] = init_z_bckp; 10218: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 1021c: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 10220: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 10224: f0 92 00 12 sts 0x1200, r15 ; 0x801200 plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 10228: 65 e5 ldi r22, 0x55 ; 85 1022a: 75 e5 ldi r23, 0x55 ; 85 1022c: 85 e5 ldi r24, 0x55 ; 85 1022e: 91 e4 ldi r25, 0x41 ; 65 10230: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 10234: 0f 94 42 22 call 0x24484 ; 0x24484 } // Move to XY position of the sensor point. current_position[X_AXIS] = x_pos; 10238: 68 89 ldd r22, Y+16 ; 0x10 1023a: 79 89 ldd r23, Y+17 ; 0x11 1023c: 8a 89 ldd r24, Y+18 ; 0x12 1023e: 9b 89 ldd r25, Y+19 ; 0x13 10240: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 10244: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 10248: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 1024c: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 current_position[Y_AXIS] = y_pos; 10250: 80 92 f9 11 sts 0x11F9, r8 ; 0x8011f9 10254: 90 92 fa 11 sts 0x11FA, r9 ; 0x8011fa 10258: a0 92 fb 11 sts 0x11FB, r10 ; 0x8011fb 1025c: b0 92 fc 11 sts 0x11FC, r11 ; 0x8011fc world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 10260: 69 ef ldi r22, 0xF9 ; 249 10262: 71 e1 ldi r23, 0x11 ; 17 10264: 85 ef ldi r24, 0xF5 ; 245 10266: 91 e1 ldi r25, 0x11 ; 17 10268: 0e 94 a6 63 call 0xc74c ; 0xc74c plan_buffer_line_curposXYZE(XY_AXIS_FEEDRATE); 1026c: 60 e0 ldi r22, 0x00 ; 0 1026e: 70 e0 ldi r23, 0x00 ; 0 10270: 86 e1 ldi r24, 0x16 ; 22 10272: 93 e4 ldi r25, 0x43 ; 67 10274: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 10278: 0f 94 42 22 call 0x24484 ; 0x24484 if (planner_aborted) 1027c: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 10280: 88 23 and r24, r24 10282: 39 f0 breq .+14 ; 0x10292 { custom_message_type = custom_message_type_old; 10284: 7f 81 ldd r23, Y+7 ; 0x07 10286: 70 93 c7 06 sts 0x06C7, r23 ; 0x8006c7 custom_message_state = custom_message_state_old; 1028a: 88 85 ldd r24, Y+8 ; 0x08 1028c: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac 10290: fb cc rjmp .-1546 ; 0xfc88 return; } // Go down until endstop is hit if (!find_bed_induction_sensor_point_z(has_z ? z0 - Z_CALIBRATION_THRESHOLD : -10.f, nProbeRetryCount)) { //if we have data from z calibration max allowed difference is 1mm for each point, if we dont have data max difference is 10mm from initial point 10292: 81 2c mov r8, r1 10294: 91 2c mov r9, r1 10296: 70 e2 ldi r23, 0x20 ; 32 10298: a7 2e mov r10, r23 1029a: 71 ec ldi r23, 0xC1 ; 193 1029c: b7 2e mov r11, r23 1029e: 22 20 and r2, r2 102a0: 51 f0 breq .+20 ; 0x102b6 102a2: 2a 81 ldd r18, Y+2 ; 0x02 102a4: 3b 81 ldd r19, Y+3 ; 0x03 102a6: 4c 81 ldd r20, Y+4 ; 0x04 102a8: 5d 81 ldd r21, Y+5 ; 0x05 102aa: c3 01 movw r24, r6 102ac: b2 01 movw r22, r4 102ae: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 102b2: 4b 01 movw r8, r22 102b4: 5c 01 movw r10, r24 102b6: 48 8d ldd r20, Y+24 ; 0x18 102b8: c5 01 movw r24, r10 102ba: b4 01 movw r22, r8 102bc: 0f 94 fb 55 call 0x2abf6 ; 0x2abf6 102c0: 81 11 cpse r24, r1 102c2: 0b c0 rjmp .+22 ; 0x102da current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); st_synchronize(); if (!find_bed_induction_sensor_point_z(has_z ? z0 - Z_CALIBRATION_THRESHOLD : -10.f, nProbeRetryCount)) { //if we have data from z calibration max allowed difference is 1mm for each point, if we dont have data max difference is 10mm from initial point printf_P(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); 102c4: 87 e2 ldi r24, 0x27 ; 39 102c6: 92 e6 ldi r25, 0x62 ; 98 102c8: 0e 94 b1 6c call 0xd962 ; 0xd962 102cc: 9f 93 push r25 102ce: 8f 93 push r24 102d0: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 102d4: 0f 90 pop r0 102d6: 0f 90 pop r0 102d8: be ce rjmp .-644 ; 0x10056 // Go down until endstop is hit if (!find_bed_induction_sensor_point_z(has_z ? z0 - Z_CALIBRATION_THRESHOLD : -10.f, nProbeRetryCount)) { //if we have data from z calibration max allowed difference is 1mm for each point, if we dont have data max difference is 10mm from initial point printf_P(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); break; } if (init_z_bckp - current_position[Z_AXIS] < 0.f) { //broken cable or initial Z coordinate too low. Go to MESH_HOME_Z_SEARCH and repeat last step (z-probe) again to distinguish between these two cases. 102da: 20 91 fd 11 lds r18, 0x11FD ; 0x8011fd 102de: 30 91 fe 11 lds r19, 0x11FE ; 0x8011fe 102e2: 40 91 ff 11 lds r20, 0x11FF ; 0x8011ff 102e6: 50 91 00 12 lds r21, 0x1200 ; 0x801200 102ea: c7 01 movw r24, r14 102ec: b6 01 movw r22, r12 102ee: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 102f2: 20 e0 ldi r18, 0x00 ; 0 102f4: 30 e0 ldi r19, 0x00 ; 0 102f6: a9 01 movw r20, r18 102f8: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 102fc: 87 ff sbrs r24, 7 102fe: 36 c0 rjmp .+108 ; 0x1036c current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 10300: 60 e0 ldi r22, 0x00 ; 0 10302: 70 e0 ldi r23, 0x00 ; 0 10304: 80 ea ldi r24, 0xA0 ; 160 10306: 90 e4 ldi r25, 0x40 ; 64 10308: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 1030c: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 10310: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 10314: 90 93 00 12 sts 0x1200, r25 ; 0x801200 plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 10318: 65 e5 ldi r22, 0x55 ; 85 1031a: 75 e5 ldi r23, 0x55 ; 85 1031c: 85 e5 ldi r24, 0x55 ; 85 1031e: 91 e4 ldi r25, 0x41 ; 65 10320: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 10324: 0f 94 42 22 call 0x24484 ; 0x24484 if (!find_bed_induction_sensor_point_z(has_z ? z0 - Z_CALIBRATION_THRESHOLD : -10.f, nProbeRetryCount)) { //if we have data from z calibration max allowed difference is 1mm for each point, if we dont have data max difference is 10mm from initial point 10328: 48 8d ldd r20, Y+24 ; 0x18 1032a: c5 01 movw r24, r10 1032c: b4 01 movw r22, r8 1032e: 0f 94 fb 55 call 0x2abf6 ; 0x2abf6 10332: 88 23 and r24, r24 10334: 39 f2 breq .-114 ; 0x102c4 printf_P(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); break; } if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { 10336: 20 91 fd 11 lds r18, 0x11FD ; 0x8011fd 1033a: 30 91 fe 11 lds r19, 0x11FE ; 0x8011fe 1033e: 40 91 ff 11 lds r20, 0x11FF ; 0x8011ff 10342: 50 91 00 12 lds r21, 0x1200 ; 0x801200 10346: 60 e0 ldi r22, 0x00 ; 0 10348: 70 e0 ldi r23, 0x00 ; 0 1034a: 80 ea ldi r24, 0xA0 ; 160 1034c: 90 e4 ldi r25, 0x40 ; 64 1034e: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 10352: 2d ec ldi r18, 0xCD ; 205 10354: 3c ec ldi r19, 0xCC ; 204 10356: 4c ec ldi r20, 0xCC ; 204 10358: 5d e3 ldi r21, 0x3D ; 61 1035a: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1035e: 87 ff sbrs r24, 7 10360: 05 c0 rjmp .+10 ; 0x1036c puts_P(PSTR("Bed leveling failed. Sensor triggered too soon")); 10362: 8d ef ldi r24, 0xFD ; 253 10364: 96 e7 ldi r25, 0x76 ; 118 break; } } if (has_z && fabs(z0 - current_position[Z_AXIS]) > Z_CALIBRATION_THRESHOLD) { //if we have data from z calibration, max. allowed difference is 1mm for each point puts_P(PSTR("Bed leveling failed. Too much variation from eeprom mesh")); 10366: 0f 94 c5 9e call 0x33d8a ; 0x33d8a 1036a: 75 ce rjmp .-790 ; 0x10056 1036c: c0 90 fd 11 lds r12, 0x11FD ; 0x8011fd 10370: d0 90 fe 11 lds r13, 0x11FE ; 0x8011fe 10374: e0 90 ff 11 lds r14, 0x11FF ; 0x8011ff 10378: f0 90 00 12 lds r15, 0x1200 ; 0x801200 if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { puts_P(PSTR("Bed leveling failed. Sensor triggered too soon")); break; } } if (has_z && fabs(z0 - current_position[Z_AXIS]) > Z_CALIBRATION_THRESHOLD) { //if we have data from z calibration, max. allowed difference is 1mm for each point 1037c: 22 20 and r2, r2 1037e: a1 f0 breq .+40 ; 0x103a8 10380: a7 01 movw r20, r14 10382: 96 01 movw r18, r12 10384: c3 01 movw r24, r6 10386: b2 01 movw r22, r4 10388: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1038c: 9b 01 movw r18, r22 1038e: ac 01 movw r20, r24 10390: 5f 77 andi r21, 0x7F ; 127 10392: 6a 81 ldd r22, Y+2 ; 0x02 10394: 7b 81 ldd r23, Y+3 ; 0x03 10396: 8c 81 ldd r24, Y+4 ; 0x04 10398: 9d 81 ldd r25, Y+5 ; 0x05 1039a: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1039e: 87 ff sbrs r24, 7 103a0: 03 c0 rjmp .+6 ; 0x103a8 puts_P(PSTR("Bed leveling failed. Too much variation from eeprom mesh")); 103a2: 84 ec ldi r24, 0xC4 ; 196 103a4: 96 e7 ldi r25, 0x76 ; 118 103a6: df cf rjmp .-66 ; 0x10366 } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 103a8: 8f ea ldi r24, 0xAF ; 175 103aa: 9f e0 ldi r25, 0x0F ; 15 103ac: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 103b0: 88 23 and r24, r24 103b2: 09 f4 brne .+2 ; 0x103b6 103b4: 40 c0 rjmp .+128 ; 0x10436 bool calibration_status_get(CalibrationStatus components); void calibration_status_set(CalibrationStatus components); void calibration_status_clear(CalibrationStatus components); // PINDA has an independent calibration flag inline bool calibration_status_pinda() { return eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA); } 103b6: 86 ea ldi r24, 0xA6 ; 166 103b8: 9f e0 ldi r25, 0x0F ; 15 103ba: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 if (!calibration_status_pinda()) return 0; 103be: 88 23 and r24, r24 103c0: d1 f1 breq .+116 ; 0x10436 return temp_comp_interpolation(temperature_pinda) / cs.axis_steps_per_mm[Z_AXIS]; 103c2: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 103c6: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 103ca: 80 91 90 06 lds r24, 0x0690 ; 0x800690 103ce: 90 91 91 06 lds r25, 0x0691 ; 0x800691 103d2: 0e 94 04 56 call 0xac08 ; 0xac08 103d6: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 103da: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 103de: 40 91 40 04 lds r20, 0x0440 ; 0x800440 103e2: 50 91 41 04 lds r21, 0x0441 ; 0x800441 103e6: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 103ea: 9b 01 movw r18, r22 103ec: ac 01 movw r20, r24 103ee: e7 e0 ldi r30, 0x07 ; 7 103f0: ae 85 ldd r26, Y+14 ; 0x0e 103f2: bf 85 ldd r27, Y+15 ; 0x0f 103f4: ea 9f mul r30, r26 103f6: c0 01 movw r24, r0 103f8: eb 9f mul r30, r27 103fa: 90 0d add r25, r0 103fc: 11 24 eor r1, r1 103fe: 08 0f add r16, r24 10400: 19 1f adc r17, r25 10402: 00 0f add r16, r16 10404: 11 1f adc r17, r17 10406: 00 0f add r16, r16 10408: 11 1f adc r17, r17 1040a: 04 56 subi r16, 0x64 ; 100 1040c: 1d 4e sbci r17, 0xED ; 237 break; } #ifdef PINDA_THERMISTOR float offset_z = temp_compensation_pinda_thermistor_offset(current_temperature_pinda); mbl.set_z(ix, iy, current_position[Z_AXIS] - offset_z); //store measured z values z_values[iy][ix] = z - offset_z; 1040e: c7 01 movw r24, r14 10410: b6 01 movw r22, r12 10412: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 10416: d8 01 movw r26, r16 10418: 11 96 adiw r26, 0x01 ; 1 1041a: 6d 93 st X+, r22 1041c: 7d 93 st X+, r23 1041e: 8d 93 st X+, r24 10420: 9c 93 st X, r25 10422: 14 97 sbiw r26, 0x04 ; 4 #else mbl.set_z(ix, iy, current_position[Z_AXIS]); //store measured z values z_values[iy][ix] = z; #endif //PINDA_THERMISTOR custom_message_state--; 10424: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 10428: 81 50 subi r24, 0x01 ; 1 1042a: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac mesh_point++; lcd_update(1); 1042e: 81 e0 ldi r24, 0x01 ; 1 10430: 0e 94 42 69 call 0xd284 ; 0xd284 10434: 0c ce rjmp .-1000 ; 0x1004e } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 10436: 20 e0 ldi r18, 0x00 ; 0 10438: 30 e0 ldi r19, 0x00 ; 0 1043a: a9 01 movw r20, r18 1043c: d8 cf rjmp .-80 ; 0x103ee print_stop(); lcd_show_fullscreen_message_and_wait_P(_T(MSG_MBL_FAILED)); lcd_z_calibration_prompt(false); goto exit; } Sound_MakeSound(e_SOUND_TYPE_StandardAlert); 1043e: 85 e0 ldi r24, 0x05 ; 5 10440: 0f 94 9f 2c call 0x2593e ; 0x2593e raise_z(-1); enable_z_endstop(true); #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif // TMC2130 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 10444: c1 2c mov r12, r1 10446: d1 2c mov r13, r1 10448: 90 ea ldi r25, 0xA0 ; 160 1044a: e9 2e mov r14, r25 1044c: 90 e4 ldi r25, 0x40 ; 64 1044e: f9 2e mov r15, r25 goto exit; } Sound_MakeSound(e_SOUND_TYPE_StandardAlert); bool bState; do { // repeat until Z-leveling o.k. lcd_display_message_fullscreen_P(_T(MSG_ZLEVELING_ENFORCED)); 10450: 80 e0 ldi r24, 0x00 ; 0 10452: 96 e3 ldi r25, 0x36 ; 54 10454: 0e 94 b1 6c call 0xd962 ; 0xd962 10458: 0f 94 c0 0a call 0x21580 ; 0x21580 #ifdef TMC2130 lcd_wait_for_click_delay(MSG_BED_LEVELING_FAILED_TIMEOUT); calibrate_z_auto(); // Z-leveling (X-assembly stay up!!!) #else // TMC2130 lcd_wait_for_click_delay(0); // ~ no timeout 1045c: 90 e0 ldi r25, 0x00 ; 0 1045e: 80 e0 ldi r24, 0x00 ; 0 10460: 0f 94 a1 34 call 0x26942 ; 0x26942 lcd_calibrate_z_end_stop_manual(true); // Z-leveling (X-assembly stay up!!!) 10464: 81 e0 ldi r24, 0x01 ; 1 10466: 0f 94 fd 34 call 0x269fa ; 0x269fa #endif // TMC2130 // ~ Z-homing (can not be used "G28", because X & Y-homing would have been done before (Z-homing)) bState=enable_z_endstop(false); 1046a: 80 e0 ldi r24, 0x00 ; 0 1046c: 0f 94 7a 2c call 0x258f4 ; 0x258f4 10470: 18 2f mov r17, r24 raise_z(-1); 10472: 60 e0 ldi r22, 0x00 ; 0 10474: 70 e0 ldi r23, 0x00 ; 0 10476: 80 e8 ldi r24, 0x80 ; 128 10478: 9f eb ldi r25, 0xBF ; 191 1047a: 0e 94 dd 66 call 0xcdba ; 0xcdba enable_z_endstop(true); 1047e: 81 e0 ldi r24, 0x01 ; 1 10480: 0f 94 7a 2c call 0x258f4 ; 0x258f4 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif // TMC2130 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 10484: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 10488: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 1048c: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 10490: f0 92 00 12 sts 0x1200, r15 ; 0x801200 plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 10494: 65 e5 ldi r22, 0x55 ; 85 10496: 75 e5 ldi r23, 0x55 ; 85 10498: 85 e5 ldi r24, 0x55 ; 85 1049a: 91 e4 ldi r25, 0x41 ; 65 1049c: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 104a0: 0f 94 42 22 call 0x24484 ; 0x24484 #ifdef TMC2130 tmc2130_home_exit(); #endif // TMC2130 enable_z_endstop(bState); 104a4: 81 2f mov r24, r17 104a6: 0f 94 7a 2c call 0x258f4 ; 0x258f4 } while (st_get_position_mm(Z_AXIS) > MESH_HOME_Z_SEARCH); // i.e. Z-leveling not o.k. 104aa: 82 e0 ldi r24, 0x02 ; 2 104ac: 0f 94 2e 22 call 0x2445c ; 0x2445c 104b0: 20 e0 ldi r18, 0x00 ; 0 104b2: 30 e0 ldi r19, 0x00 ; 0 104b4: 40 ea ldi r20, 0xA0 ; 160 104b6: 50 e4 ldi r21, 0x40 ; 64 104b8: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 104bc: 18 16 cp r1, r24 104be: 44 f2 brlt .-112 ; 0x10450 custom_message_type = custom_message_type_old; 104c0: ef 81 ldd r30, Y+7 ; 0x07 104c2: e0 93 c7 06 sts 0x06C7, r30 ; 0x8006c7 custom_message_state = custom_message_state_old; 104c6: f8 85 ldd r31, Y+8 ; 0x08 104c8: f0 93 ac 03 sts 0x03AC, r31 ; 0x8003ac lcd_update_enable(true); // display / status-line recovery 104cc: 81 e0 ldi r24, 0x01 ; 1 104ce: 0e 94 c0 69 call 0xd380 ; 0xd380 static void gcode_G28(bool home_x_axis, bool home_y_axis, bool home_z_axis) { #ifdef TMC2130 gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, false, true); #else gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, true); 104d2: dd 24 eor r13, r13 104d4: d3 94 inc r13 104d6: df 92 push r13 104d8: 81 2c mov r8, r1 104da: 91 2c mov r9, r1 104dc: 54 01 movw r10, r8 104de: cc 24 eor r12, r12 104e0: c3 94 inc r12 104e2: e1 2c mov r14, r1 104e4: f1 2c mov r15, r1 104e6: 87 01 movw r16, r14 104e8: 21 e0 ldi r18, 0x01 ; 1 104ea: 40 e0 ldi r20, 0x00 ; 0 104ec: 50 e0 ldi r21, 0x00 ; 0 104ee: ba 01 movw r22, r20 104f0: 81 e0 ldi r24, 0x01 ; 1 104f2: 0e 94 73 67 call 0xcee6 ; 0xcee6 104f6: d0 92 e6 11 sts 0x11E6, r13 ; 0x8011e6 104fa: 0f 90 pop r0 104fc: c5 cb rjmp .-2166 ; 0xfc88 lcd_update_enable(true); // display / status-line recovery gcode_G28(true, true, true); // X & Y & Z-homing (must be after individual Z-homing (problem with spool-holder)!) repeatcommand_front(); // re-run (i.e. of "G80") return; } g80_fail_cnt = 0; // no fail was detected. Reset the error counter. 104fe: 10 92 3f 03 sts 0x033F, r1 ; 0x80033f clean_up_after_endstop_move(l_feedmultiply); 10502: 8b a1 ldd r24, Y+35 ; 0x23 10504: 9c a1 ldd r25, Y+36 ; 0x24 10506: 0e 94 d4 5f call 0xbfa8 ; 0xbfa8 // Number of baby steps applied static int babystepLoadZ = 0; void babystep_load() { babystepLoadZ = 0; 1050a: 10 92 2a 05 sts 0x052A, r1 ; 0x80052a <_ZL13babystepLoadZ.lto_priv.459+0x1> 1050e: 10 92 29 05 sts 0x0529, r1 ; 0x800529 <_ZL13babystepLoadZ.lto_priv.459> // Apply Z height correction aka baby stepping before mesh bed leveling gets activated. if (calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 10512: 80 e1 ldi r24, 0x10 ; 16 10514: 0e 94 55 d8 call 0x1b0aa ; 0x1b0aa 10518: 88 23 and r24, r24 1051a: 91 f0 breq .+36 ; 0x10540 { check_babystep(); //checking if babystep is in allowed range, otherwise setting babystep to 0 1051c: 0e 94 b2 72 call 0xe564 ; 0xe564 // End of G80: Apply the baby stepping value. babystepLoadZ = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); 10520: 81 ea ldi r24, 0xA1 ; 161 10522: 9d e0 ldi r25, 0x0D ; 13 10524: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 if (calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) { check_babystep(); //checking if babystep is in allowed range, otherwise setting babystep to 0 // End of G80: Apply the baby stepping value. babystepLoadZ = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> 10528: 2b e0 ldi r18, 0x0B ; 11 1052a: 82 9f mul r24, r18 1052c: c0 01 movw r24, r0 1052e: 11 24 eor r1, r1 10530: 80 5b subi r24, 0xB0 ; 176 10532: 92 4f sbci r25, 0xF2 ; 242 10534: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 10538: 90 93 2a 05 sts 0x052A, r25 ; 0x80052a <_ZL13babystepLoadZ.lto_priv.459+0x1> 1053c: 80 93 29 05 sts 0x0529, r24 ; 0x800529 <_ZL13babystepLoadZ.lto_priv.459> } void babystep_apply() { babystep_load(); shift_z(- float(babystepLoadZ) / float(cs.axis_steps_per_mm[Z_AXIS])); 10540: 60 91 29 05 lds r22, 0x0529 ; 0x800529 <_ZL13babystepLoadZ.lto_priv.459> 10544: 70 91 2a 05 lds r23, 0x052A ; 0x80052a <_ZL13babystepLoadZ.lto_priv.459+0x1> 10548: 07 2e mov r0, r23 1054a: 00 0c add r0, r0 1054c: 88 0b sbc r24, r24 1054e: 99 0b sbc r25, r25 10550: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 10554: 90 58 subi r25, 0x80 ; 128 10556: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 1055a: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 1055e: 40 91 40 04 lds r20, 0x0440 ; 0x800440 10562: 50 91 41 04 lds r21, 0x0441 ; 0x800441 10566: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1056a: 0f 94 d1 8a call 0x315a2 ; 0x315a2 if(eeprom_read_byte((uint8_t *)EEPROM_TEMP_CAL_ACTIVE) && calibration_status_pinda() == true) temp_compensation_apply(); //apply PINDA temperature compensation #endif babystep_apply(); // Apply Z height correction aka baby stepping before mesh bed leveing gets activated. { // Apply the bed level correction to the mesh bool eeprom_bed_correction_valid = eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1; 1056e: 80 ec ldi r24, 0xC0 ; 192 10570: 9f e0 ldi r25, 0x0F ; 15 10572: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 10576: 91 e0 ldi r25, 0x01 ; 1 10578: 81 30 cpi r24, 0x01 ; 1 1057a: 09 f0 breq .+2 ; 0x1057e 1057c: 90 e0 ldi r25, 0x00 ; 0 } } else if (eeprom_bed_correction_valid) { return (int8_t)eeprom_read_byte(eep_address); } return 0; }; 1057e: 99 83 std Y+1, r25 ; 0x01 const int8_t correction[4] = { bedCorrectHelper('L', (uint8_t*)EEPROM_BED_CORRECTION_LEFT), 10580: 4f eb ldi r20, 0xBF ; 191 10582: 5f e0 ldi r21, 0x0F ; 15 10584: 6c e4 ldi r22, 0x4C ; 76 10586: ce 01 movw r24, r28 10588: 01 96 adiw r24, 0x01 ; 1 1058a: 0e 94 5a 55 call 0xaab4 ; 0xaab4 1058e: f8 2e mov r15, r24 bedCorrectHelper('R', (uint8_t*)EEPROM_BED_CORRECTION_RIGHT), 10590: 4e eb ldi r20, 0xBE ; 190 10592: 5f e0 ldi r21, 0x0F ; 15 10594: 62 e5 ldi r22, 0x52 ; 82 10596: ce 01 movw r24, r28 10598: 01 96 adiw r24, 0x01 ; 1 1059a: 0e 94 5a 55 call 0xaab4 ; 0xaab4 1059e: 08 2f mov r16, r24 bedCorrectHelper('F', (uint8_t*)EEPROM_BED_CORRECTION_FRONT), 105a0: 4d eb ldi r20, 0xBD ; 189 105a2: 5f e0 ldi r21, 0x0F ; 15 105a4: 66 e4 ldi r22, 0x46 ; 70 105a6: ce 01 movw r24, r28 105a8: 01 96 adiw r24, 0x01 ; 1 105aa: 0e 94 5a 55 call 0xaab4 ; 0xaab4 105ae: 18 2f mov r17, r24 bedCorrectHelper('B', (uint8_t*)EEPROM_BED_CORRECTION_REAR), 105b0: 4c eb ldi r20, 0xBC ; 188 105b2: 5f e0 ldi r21, 0x0F ; 15 105b4: 62 e4 ldi r22, 0x42 ; 66 105b6: ce 01 movw r24, r28 105b8: 01 96 adiw r24, 0x01 ; 1 105ba: 0e 94 5a 55 call 0xaab4 ; 0xaab4 105be: 21 2f mov r18, r17 105c0: 11 0f add r17, r17 105c2: 33 0b sbc r19, r19 105c4: 08 2e mov r0, r24 105c6: 00 0c add r0, r0 105c8: 99 0b sbc r25, r25 105ca: 5c 01 movw r10, r24 105cc: a2 1a sub r10, r18 105ce: b3 0a sbc r11, r19 105d0: 8f 2d mov r24, r15 105d2: ff 0c add r15, r15 105d4: 99 0b sbc r25, r25 105d6: 28 0f add r18, r24 105d8: 39 1f adc r19, r25 105da: 46 e0 ldi r20, 0x06 ; 6 105dc: 42 9f mul r20, r18 105de: 60 01 movw r12, r0 105e0: 43 9f mul r20, r19 105e2: d0 0c add r13, r0 105e4: 11 24 eor r1, r1 105e6: f1 2c mov r15, r1 105e8: e1 2c mov r14, r1 105ea: 00 2e mov r0, r16 105ec: 00 0c add r0, r0 105ee: 11 0b sbc r17, r17 105f0: 08 1b sub r16, r24 105f2: 19 0b sbc r17, r25 105f4: b7 01 movw r22, r14 105f6: 63 56 subi r22, 0x63 ; 99 105f8: 7d 4e sbci r23, 0xED ; 237 105fa: 3b 01 movw r6, r22 105fc: 46 01 movw r8, r12 105fe: 77 e0 ldi r23, 0x07 ; 7 10600: 7a 83 std Y+2, r23 ; 0x02 }; for (uint8_t row = 0; row < MESH_NUM_Y_POINTS; row++) { for (uint8_t col = 0; col < MESH_NUM_X_POINTS; col++) { constexpr float scaler = 0.001f / (MESH_NUM_X_POINTS - 1); mbl.z_values[row][col] += scaler * ( 10602: d3 01 movw r26, r6 10604: 2d 90 ld r2, X+ 10606: 3d 90 ld r3, X+ 10608: 4d 90 ld r4, X+ 1060a: 5d 90 ld r5, X+ 1060c: 3d 01 movw r6, r26 1060e: fd 01 movw r30, r26 10610: 34 97 sbiw r30, 0x04 ; 4 10612: fb 87 std Y+11, r31 ; 0x0b 10614: ea 87 std Y+10, r30 ; 0x0a 10616: b4 01 movw r22, r8 10618: 09 2c mov r0, r9 1061a: 00 0c add r0, r0 1061c: 88 0b sbc r24, r24 1061e: 99 0b sbc r25, r25 10620: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 10624: 2f e3 ldi r18, 0x3F ; 63 10626: 33 ec ldi r19, 0xC3 ; 195 10628: 4e e2 ldi r20, 0x2E ; 46 1062a: 59 e3 ldi r21, 0x39 ; 57 1062c: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 10630: a2 01 movw r20, r4 10632: 91 01 movw r18, r2 10634: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 10638: aa 85 ldd r26, Y+10 ; 0x0a 1063a: bb 85 ldd r27, Y+11 ; 0x0b 1063c: 6d 93 st X+, r22 1063e: 7d 93 st X+, r23 10640: 8d 93 st X+, r24 10642: 9c 93 st X, r25 10644: 13 97 sbiw r26, 0x03 ; 3 10646: ba 81 ldd r27, Y+2 ; 0x02 10648: b1 50 subi r27, 0x01 ; 1 1064a: ba 83 std Y+2, r27 ; 0x02 1064c: 80 0e add r8, r16 1064e: 91 1e adc r9, r17 bedCorrectHelper('R', (uint8_t*)EEPROM_BED_CORRECTION_RIGHT), bedCorrectHelper('F', (uint8_t*)EEPROM_BED_CORRECTION_FRONT), bedCorrectHelper('B', (uint8_t*)EEPROM_BED_CORRECTION_REAR), }; for (uint8_t row = 0; row < MESH_NUM_Y_POINTS; row++) { for (uint8_t col = 0; col < MESH_NUM_X_POINTS; col++) { 10650: b1 11 cpse r27, r1 10652: d7 cf rjmp .-82 ; 0x10602 10654: ca 0c add r12, r10 10656: db 1c adc r13, r11 10658: ec e1 ldi r30, 0x1C ; 28 1065a: ee 0e add r14, r30 1065c: f1 1c adc r15, r1 bedCorrectHelper('L', (uint8_t*)EEPROM_BED_CORRECTION_LEFT), bedCorrectHelper('R', (uint8_t*)EEPROM_BED_CORRECTION_RIGHT), bedCorrectHelper('F', (uint8_t*)EEPROM_BED_CORRECTION_FRONT), bedCorrectHelper('B', (uint8_t*)EEPROM_BED_CORRECTION_REAR), }; for (uint8_t row = 0; row < MESH_NUM_Y_POINTS; row++) { 1065e: f4 ec ldi r31, 0xC4 ; 196 10660: ef 16 cp r14, r31 10662: f1 04 cpc r15, r1 10664: 39 f6 brne .-114 ; 0x105f4 + correction[3] * row); } } } mbl.upsample_3x3(); //interpolation from 3x3 to 7x7 points using largrangian polynomials while using the same array z_values[iy][ix] for storing (just coppying measured data to new destination and interpolating between them) 10666: 0e 94 fc f0 call 0x1e1f8 ; 0x1e1f8 { // apply magnet compensation uint8_t useMagnetCompensation = code_seen('M') ? code_value_uint8() : eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION); 1066a: 8d e4 ldi r24, 0x4D ; 77 1066c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 10670: 88 23 and r24, r24 10672: 09 f4 brne .+2 ; 0x10676 10674: 84 c0 rjmp .+264 ; 0x1077e 10676: 0e 94 40 55 call 0xaa80 ; 0xaa80 if (nMeasPoints == 7 && useMagnetCompensation) { 1067a: 2e 81 ldd r18, Y+6 ; 0x06 1067c: 27 30 cpi r18, 0x07 ; 7 1067e: 09 f0 breq .+2 ; 0x10682 10680: 94 c0 rjmp .+296 ; 0x107aa 10682: 88 23 and r24, r24 10684: 09 f4 brne .+2 ; 0x10688 10686: 91 c0 rjmp .+290 ; 0x107aa 10688: bb 24 eor r11, r11 1068a: b3 94 inc r11 1068c: aa 24 eor r10, r10 1068e: aa 94 dec r10 10690: ab 0c add r10, r11 10692: 09 a1 ldd r16, Y+33 ; 0x21 10694: 1a a1 ldd r17, Y+34 ; 0x22 //printf_P(PSTR("result: Z = %f \n\n"), mbl.z_values[y][x]); } void mbl_magnet_elimination() { for (uint8_t y = 0; y < MESH_NUM_Y_POINTS; y++) { for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) { 10696: 61 2c mov r6, r1 void mbl_single_point_interpolation(uint8_t x, uint8_t y) { //printf_P(PSTR("x = %d; y = %d \n"), x, y); uint8_t count = 0; float z = 0; if (mbl_point_measurement_valid(x, y + 1)) { z += mbl.z_values[y + 1][x]; /*printf_P(PSTR("x; y+1: Z = %f \n"), mbl.z_values[y + 1][x]);*/ count++; } if (mbl_point_measurement_valid(x, y - 1)) { z += mbl.z_values[y - 1][x]; /*printf_P(PSTR("x; y-1: Z = %f \n"), mbl.z_values[y - 1][x]);*/ count++; } 10698: 8e ef ldi r24, 0xFE ; 254 1069a: 88 2e mov r8, r24 1069c: 8b 0c add r8, r11 } void mbl_magnet_elimination() { for (uint8_t y = 0; y < MESH_NUM_Y_POINTS; y++) { for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) { if (!mbl_point_measurement_valid(x, y)) { 1069e: 6a 2d mov r22, r10 106a0: 86 2d mov r24, r6 106a2: 0f 94 9c 8a call 0x31538 ; 0x31538 106a6: 99 24 eor r9, r9 106a8: 93 94 inc r9 106aa: 96 0c add r9, r6 106ac: 81 11 cpse r24, r1 106ae: 6e c0 rjmp .+220 ; 0x1078c void mbl_single_point_interpolation(uint8_t x, uint8_t y) { //printf_P(PSTR("x = %d; y = %d \n"), x, y); uint8_t count = 0; float z = 0; if (mbl_point_measurement_valid(x, y + 1)) { z += mbl.z_values[y + 1][x]; /*printf_P(PSTR("x; y+1: Z = %f \n"), mbl.z_values[y + 1][x]);*/ count++; } 106b0: 6b 2d mov r22, r11 106b2: 86 2d mov r24, r6 106b4: 0f 94 9c 8a call 0x31538 ; 0x31538 } void mbl_single_point_interpolation(uint8_t x, uint8_t y) { //printf_P(PSTR("x = %d; y = %d \n"), x, y); uint8_t count = 0; float z = 0; 106b8: c1 2c mov r12, r1 106ba: d1 2c mov r13, r1 106bc: 76 01 movw r14, r12 return (valid_points_mask[6 - iy] & (1 << (6 - ix))); } void mbl_single_point_interpolation(uint8_t x, uint8_t y) { //printf_P(PSTR("x = %d; y = %d \n"), x, y); uint8_t count = 0; 106be: 71 2c mov r7, r1 float z = 0; if (mbl_point_measurement_valid(x, y + 1)) { z += mbl.z_values[y + 1][x]; /*printf_P(PSTR("x; y+1: Z = %f \n"), mbl.z_values[y + 1][x]);*/ count++; } 106c0: 88 23 and r24, r24 106c2: 81 f0 breq .+32 ; 0x106e4 106c4: 20 e0 ldi r18, 0x00 ; 0 106c6: 30 e0 ldi r19, 0x00 ; 0 106c8: a9 01 movw r20, r18 106ca: d8 01 movw r26, r16 106cc: 5d 96 adiw r26, 0x1d ; 29 106ce: 6d 91 ld r22, X+ 106d0: 7d 91 ld r23, X+ 106d2: 8d 91 ld r24, X+ 106d4: 9c 91 ld r25, X 106d6: 90 97 sbiw r26, 0x20 ; 32 106d8: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 106dc: 6b 01 movw r12, r22 106de: 7c 01 movw r14, r24 106e0: 77 24 eor r7, r7 106e2: 73 94 inc r7 if (mbl_point_measurement_valid(x, y - 1)) { z += mbl.z_values[y - 1][x]; /*printf_P(PSTR("x; y-1: Z = %f \n"), mbl.z_values[y - 1][x]);*/ count++; } 106e4: 68 2d mov r22, r8 106e6: 86 2d mov r24, r6 106e8: 0f 94 9c 8a call 0x31538 ; 0x31538 106ec: 88 23 and r24, r24 106ee: 69 f0 breq .+26 ; 0x1070a 106f0: f8 01 movw r30, r16 106f2: 7b 97 sbiw r30, 0x1b ; 27 106f4: 20 81 ld r18, Z 106f6: 31 81 ldd r19, Z+1 ; 0x01 106f8: 42 81 ldd r20, Z+2 ; 0x02 106fa: 53 81 ldd r21, Z+3 ; 0x03 106fc: c7 01 movw r24, r14 106fe: b6 01 movw r22, r12 10700: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 10704: 6b 01 movw r12, r22 10706: 7c 01 movw r14, r24 10708: 73 94 inc r7 if (mbl_point_measurement_valid(x + 1, y)) { z += mbl.z_values[y][x + 1]; /*printf_P(PSTR("x+1; y: Z = %f \n"), mbl.z_values[y][x + 1]);*/ count++; } 1070a: 6a 2d mov r22, r10 1070c: 89 2d mov r24, r9 1070e: 0f 94 9c 8a call 0x31538 ; 0x31538 10712: 88 23 and r24, r24 10714: 61 f0 breq .+24 ; 0x1072e 10716: f8 01 movw r30, r16 10718: 25 81 ldd r18, Z+5 ; 0x05 1071a: 36 81 ldd r19, Z+6 ; 0x06 1071c: 47 81 ldd r20, Z+7 ; 0x07 1071e: 50 85 ldd r21, Z+8 ; 0x08 10720: c7 01 movw r24, r14 10722: b6 01 movw r22, r12 10724: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 10728: 6b 01 movw r12, r22 1072a: 7c 01 movw r14, r24 1072c: 73 94 inc r7 if (mbl_point_measurement_valid(x - 1, y)) { z += mbl.z_values[y][x - 1]; /*printf_P(PSTR("x-1; y: Z = %f \n"), mbl.z_values[y][x - 1]);*/ count++; } 1072e: 6a 2d mov r22, r10 10730: 8f ef ldi r24, 0xFF ; 255 10732: 86 0d add r24, r6 10734: 0f 94 9c 8a call 0x31538 ; 0x31538 10738: 88 23 and r24, r24 1073a: 31 f1 breq .+76 ; 0x10788 1073c: f8 01 movw r30, r16 1073e: 33 97 sbiw r30, 0x03 ; 3 10740: 20 81 ld r18, Z 10742: 31 81 ldd r19, Z+1 ; 0x01 10744: 42 81 ldd r20, Z+2 ; 0x02 10746: 53 81 ldd r21, Z+3 ; 0x03 10748: c7 01 movw r24, r14 1074a: b6 01 movw r22, r12 1074c: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 10750: 6b 01 movw r12, r22 10752: 7c 01 movw r14, r24 10754: 73 94 inc r7 if(count != 0) mbl.z_values[y][x] = z / count; //if we have at least one valid point in surrounding area use average value, otherwise use inaccurately measured Z-coordinate 10756: 67 2d mov r22, r7 10758: 70 e0 ldi r23, 0x00 ; 0 1075a: 90 e0 ldi r25, 0x00 ; 0 1075c: 80 e0 ldi r24, 0x00 ; 0 1075e: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 10762: 9b 01 movw r18, r22 10764: ac 01 movw r20, r24 10766: c7 01 movw r24, r14 10768: b6 01 movw r22, r12 1076a: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1076e: d8 01 movw r26, r16 10770: 11 96 adiw r26, 0x01 ; 1 10772: 6d 93 st X+, r22 10774: 7d 93 st X+, r23 10776: 8d 93 st X+, r24 10778: 9c 93 st X, r25 1077a: 14 97 sbiw r26, 0x04 ; 4 1077c: 07 c0 rjmp .+14 ; 0x1078c } mbl.upsample_3x3(); //interpolation from 3x3 to 7x7 points using largrangian polynomials while using the same array z_values[iy][ix] for storing (just coppying measured data to new destination and interpolating between them) { // apply magnet compensation uint8_t useMagnetCompensation = code_seen('M') ? code_value_uint8() : eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION); 1077e: 8c ea ldi r24, 0xAC ; 172 10780: 9d e0 ldi r25, 0x0D ; 13 10782: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 10786: 79 cf rjmp .-270 ; 0x1067a 10788: 71 10 cpse r7, r1 1078a: e5 cf rjmp .-54 ; 0x10756 //printf_P(PSTR("result: Z = %f \n\n"), mbl.z_values[y][x]); } void mbl_magnet_elimination() { for (uint8_t y = 0; y < MESH_NUM_Y_POINTS; y++) { for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) { 1078c: 69 2c mov r6, r9 1078e: 0c 5f subi r16, 0xFC ; 252 10790: 1f 4f sbci r17, 0xFF ; 255 10792: b7 e0 ldi r27, 0x07 ; 7 10794: 9b 12 cpse r9, r27 10796: 83 cf rjmp .-250 ; 0x1069e 10798: b3 94 inc r11 1079a: e9 a1 ldd r30, Y+33 ; 0x21 1079c: fa a1 ldd r31, Y+34 ; 0x22 1079e: 7c 96 adiw r30, 0x1c ; 28 107a0: fa a3 std Y+34, r31 ; 0x22 107a2: e9 a3 std Y+33, r30 ; 0x21 if(count != 0) mbl.z_values[y][x] = z / count; //if we have at least one valid point in surrounding area use average value, otherwise use inaccurately measured Z-coordinate //printf_P(PSTR("result: Z = %f \n\n"), mbl.z_values[y][x]); } void mbl_magnet_elimination() { for (uint8_t y = 0; y < MESH_NUM_Y_POINTS; y++) { 107a4: f8 e0 ldi r31, 0x08 ; 8 107a6: bf 12 cpse r11, r31 107a8: 71 cf rjmp .-286 ; 0x1068c if (nMeasPoints == 7 && useMagnetCompensation) { mbl_magnet_elimination(); } } mbl.active = 1; //activate mesh bed leveling 107aa: 81 e0 ldi r24, 0x01 ; 1 107ac: 80 93 9c 12 sts 0x129C, r24 ; 0x80129c if (code_seen('O') && !code_value_uint8()) { 107b0: 8f e4 ldi r24, 0x4F ; 79 107b2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 107b6: 81 11 cpse r24, r1 107b8: 03 c0 rjmp .+6 ; 0x107c0 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); } else { go_home_with_z_lift(); 107ba: 0f 94 26 8b call 0x3164c ; 0x3164c 107be: 79 cc rjmp .-1806 ; 0x100b2 } } mbl.active = 1; //activate mesh bed leveling if (code_seen('O') && !code_value_uint8()) { 107c0: 0e 94 40 55 call 0xaa80 ; 0xaa80 107c4: 81 11 cpse r24, r1 107c6: f9 cf rjmp .-14 ; 0x107ba // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 107c8: 0e 94 c9 5f call 0xbf92 ; 0xbf92 107cc: 72 cc rjmp .-1820 ; 0x100b2 000107ce : They are shown in order of appearance in the code. There are reasons why some G Codes aren't in numerical order. */ void process_commands() 107ce: 2f 92 push r2 107d0: 3f 92 push r3 107d2: 4f 92 push r4 107d4: 5f 92 push r5 107d6: 6f 92 push r6 107d8: 7f 92 push r7 107da: 8f 92 push r8 107dc: 9f 92 push r9 107de: af 92 push r10 107e0: bf 92 push r11 107e2: cf 92 push r12 107e4: df 92 push r13 107e6: ef 92 push r14 107e8: ff 92 push r15 107ea: 0f 93 push r16 107ec: 1f 93 push r17 107ee: cf 93 push r28 107f0: df 93 push r29 107f2: cd b7 in r28, 0x3d ; 61 107f4: de b7 in r29, 0x3e ; 62 107f6: c3 56 subi r28, 0x63 ; 99 107f8: d1 09 sbc r29, r1 107fa: 0f b6 in r0, 0x3f ; 63 107fc: f8 94 cli 107fe: de bf out 0x3e, r29 ; 62 10800: 0f be out 0x3f, r0 ; 63 10802: cd bf out 0x3d, r28 ; 61 #endif /* CMDBUFFER_DEBUG */ unsigned long codenum; //throw away variable // PRUSA GCODES KEEPALIVE_STATE(IN_HANDLER); 10804: 82 e0 ldi r24, 0x02 ; 2 10806: 80 93 78 02 sts 0x0278, r24 ; 0x800278 st_backlash_y = bl; printf_P(_N("st_backlash_y = %d\n"), st_backlash_y); } #endif //BACKLASH_Y #endif //TMC2130 else if(strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("PRUSA"), 5) == 0) { 1080a: 00 91 cb 11 lds r16, 0x11CB ; 0x8011cb 1080e: 10 91 cc 11 lds r17, 0x11CC ; 0x8011cc 10812: 0f 51 subi r16, 0x1F ; 31 10814: 10 4f sbci r17, 0xF0 ; 240 10816: 45 e0 ldi r20, 0x05 ; 5 10818: 50 e0 ldi r21, 0x00 ; 0 1081a: 60 e2 ldi r22, 0x20 ; 32 1081c: 71 e8 ldi r23, 0x81 ; 129 1081e: c8 01 movw r24, r16 10820: 0f 94 bb 9d call 0x33b76 ; 0x33b76 10824: 89 2b or r24, r25 10826: 09 f0 breq .+2 ; 0x1082a 10828: 9b c1 rjmp .+822 ; 0x10b60 eeprom_update_byte_notify((uint8_t*)EEPROM_FAN_CHECK_ENABLED, true); } } bool farm_prusa_code_seen() { if (!farm_mode) 1082a: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1082e: 88 23 and r24, r24 10830: 09 f4 brne .+2 ; 0x10834 10832: 4d c0 rjmp .+154 ; 0x108ce return false; if (code_seen_P(PSTR("PRN"))) { // PRUSA PRN 10834: 8e e2 ldi r24, 0x2E ; 46 10836: 9e e7 ldi r25, 0x7E ; 126 10838: 0f 94 51 74 call 0x2e8a2 ; 0x2e8a2 1083c: 88 23 and r24, r24 1083e: 79 f0 breq .+30 ; 0x1085e printf_P(_N("%u"), status_number); 10840: 80 91 f7 16 lds r24, 0x16F7 ; 0x8016f7 <_ZL13status_number.lto_priv.496> 10844: 1f 92 push r1 10846: 8f 93 push r24 10848: 82 ef ldi r24, 0xF2 ; 242 1084a: 94 e6 ldi r25, 0x64 ; 100 int index; for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++); /*for (++strchr_pointer; *strchr_pointer == ' ' || *strchr_pointer == '\t'; ++strchr_pointer);*/ if (*(strchr_pointer+index) < '0' || *(strchr_pointer+index) > '9') { printf_P(PSTR("Invalid M code: %s\n"), cmdbuffer + bufindr + CMDHDRSIZE); 1084c: 9f 93 push r25 1084e: 8f 93 push r24 10850: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 10854: 0f 90 pop r0 10856: 0f 90 pop r0 10858: 0f 90 pop r0 1085a: 0f 90 pop r0 1085c: 08 c0 rjmp .+16 ; 0x1086e } else if (code_seen_P(PSTR("thx"))) { // PRUSA thx 1085e: 8a e2 ldi r24, 0x2A ; 42 10860: 9e e7 ldi r25, 0x7E ; 126 10862: 0f 94 51 74 call 0x2e8a2 ; 0x2e8a2 10866: 88 23 and r24, r24 10868: 41 f0 breq .+16 ; 0x1087a no_response = false; 1086a: 10 92 d6 03 sts 0x03D6, r1 ; 0x8003d6 <_ZL11no_response.lto_priv.497> SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); 1086e: 81 e0 ldi r24, 0x01 ; 1 10870: 80 93 78 02 sts 0x0278, r24 ; 0x800278 ClearToSend(); 10874: 0e 94 06 73 call 0xe60c ; 0xe60c 10878: 3a c2 rjmp .+1140 ; 0x10cee trace(); prusa_sd_card_upload = true; card.openFileWrite(strchr_pointer+4); } #endif //PRUSA_M28 else if (code_seen_P(PSTR("fv"))) { // PRUSA fv 1087a: 87 e2 ldi r24, 0x27 ; 39 1087c: 9e e7 ldi r25, 0x7E ; 126 1087e: 0f 94 51 74 call 0x2e8a2 ; 0x2e8a2 10882: 88 23 and r24, r24 10884: 21 f1 breq .+72 ; 0x108ce // get file version #ifdef SDSUPPORT card.openFileReadFilteredGcode(strchr_pointer + 3, true); 10886: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 1088a: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 1088e: 61 e0 ldi r22, 0x01 ; 1 10890: 03 96 adiw r24, 0x03 ; 3 10892: 0f 94 06 4c call 0x2980c ; 0x2980c FORCE_INLINE bool isFileOpen() { return file.isOpen(); } bool eof() { return sdpos>=filesize; } FORCE_INLINE int16_t getFilteredGcodeChar() { int16_t c = (int16_t)file.readFilteredGcode(); 10896: 0f 94 ce 48 call 0x2919c ; 0x2919c 1089a: 8c 01 movw r16, r24 sdpos = file.curPosition(); 1089c: 80 91 02 16 lds r24, 0x1602 ; 0x801602 108a0: 90 91 03 16 lds r25, 0x1603 ; 0x801603 108a4: a0 91 04 16 lds r26, 0x1604 ; 0x801604 108a8: b0 91 05 16 lds r27, 0x1605 ; 0x801605 108ac: 80 93 7e 16 sts 0x167E, r24 ; 0x80167e 108b0: 90 93 7f 16 sts 0x167F, r25 ; 0x80167f 108b4: a0 93 80 16 sts 0x1680, r26 ; 0x801680 108b8: b0 93 81 16 sts 0x1681, r27 ; 0x801681 while (true) { uint16_t readByte = card.getFilteredGcodeChar(); MYSERIAL.write(readByte); 108bc: 80 2f mov r24, r16 108be: 0e 94 41 70 call 0xe082 ; 0xe082 if (readByte == '\n') { 108c2: 0a 30 cpi r16, 0x0A ; 10 108c4: 11 05 cpc r17, r1 108c6: 39 f7 brne .-50 ; 0x10896 break; } } card.closefile(); 108c8: 0f 94 e4 41 call 0x283c8 ; 0x283c8 108cc: d0 cf rjmp .-96 ; 0x1086e - `nozzle D` - check the nozzle diameter (farm mode only), works like M862.1 P, e.g. `PRUSA nozzle D0.4` - `nozzle` - prints nozzle diameter (farm mode only), works like M862.1 P, e.g. `PRUSA nozzle` */ if (farm_prusa_code_seen()) {} else if(code_seen_P(PSTR("FANPINTST"))) { 108ce: 86 e1 ldi r24, 0x16 ; 22 108d0: 91 e8 ldi r25, 0x81 ; 129 108d2: 0f 94 51 74 call 0x2e8a2 ; 0x2e8a2 108d6: 81 11 cpse r24, r1 108d8: ca cf rjmp .-108 ; 0x1086e gcode_PRUSA_BadRAMBoFanTest(); } else if (code_seen_P(PSTR("FAN"))) { // PRUSA FAN 108da: 82 e1 ldi r24, 0x12 ; 18 108dc: 91 e8 ldi r25, 0x81 ; 129 108de: 0f 94 51 74 call 0x2e8a2 ; 0x2e8a2 108e2: 88 23 and r24, r24 108e4: 21 f1 breq .+72 ; 0x1092e printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]); 108e6: 40 91 87 03 lds r20, 0x0387 ; 0x800387 108ea: 50 91 88 03 lds r21, 0x0388 ; 0x800388 108ee: 2c e3 ldi r18, 0x3C ; 60 108f0: 24 9f mul r18, r20 108f2: c0 01 movw r24, r0 108f4: 25 9f mul r18, r21 108f6: 90 0d add r25, r0 108f8: 11 24 eor r1, r1 108fa: 9f 93 push r25 108fc: 8f 93 push r24 108fe: 40 91 85 03 lds r20, 0x0385 ; 0x800385 10902: 50 91 86 03 lds r21, 0x0386 ; 0x800386 10906: 24 9f mul r18, r20 10908: c0 01 movw r24, r0 1090a: 25 9f mul r18, r21 1090c: 90 0d add r25, r0 1090e: 11 24 eor r1, r1 10910: 9f 93 push r25 10912: 8f 93 push r24 10914: 86 e2 ldi r24, 0x26 ; 38 10916: 97 e6 ldi r25, 0x67 ; 103 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 10918: 9f 93 push r25 1091a: 8f 93 push r24 1091c: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 10920: 0f 90 pop r0 10922: 0f 90 pop r0 10924: 0f 90 pop r0 10926: 0f 90 pop r0 10928: 0f 90 pop r0 1092a: 0f 90 pop r0 1092c: a0 cf rjmp .-192 ; 0x1086e if (farm_prusa_code_seen()) {} else if(code_seen_P(PSTR("FANPINTST"))) { gcode_PRUSA_BadRAMBoFanTest(); } else if (code_seen_P(PSTR("FAN"))) { // PRUSA FAN printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]); } else if (code_seen_P(PSTR("uvlo"))) { // PRUSA uvlo 1092e: 8d e0 ldi r24, 0x0D ; 13 10930: 91 e8 ldi r25, 0x81 ; 129 10932: 0f 94 51 74 call 0x2e8a2 ; 0x2e8a2 10936: 88 23 and r24, r24 10938: 11 f1 breq .+68 ; 0x1097e if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD) { 1093a: 8c e8 ldi r24, 0x8C ; 140 1093c: 9f e0 ldi r25, 0x0F ; 15 1093e: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 10942: 81 11 cpse r24, r1 10944: 10 c0 rjmp .+32 ; 0x10966 // M24 - Start SD print enquecommand_P(MSG_M24); 10946: 61 e0 ldi r22, 0x01 ; 1 10948: 85 ee ldi r24, 0xE5 ; 229 1094a: 9b e6 ldi r25, 0x6B ; 107 1094c: 0e 94 af 7c call 0xf95e ; 0xf95e 10950: 60 e0 ldi r22, 0x00 ; 0 10952: 85 ea ldi r24, 0xA5 ; 165 10954: 9f e0 ldi r25, 0x0F ; 15 10956: 0f 94 00 a0 call 0x34000 ; 0x34000 1095a: 60 e0 ldi r22, 0x00 ; 0 1095c: 8f e7 ldi r24, 0x7F ; 127 1095e: 9c e0 ldi r25, 0x0C ; 12 10960: 0f 94 00 a0 call 0x34000 ; 0x34000 10964: 84 cf rjmp .-248 ; 0x1086e // Print is recovered, clear the recovery flag eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO, PowerPanic::NO_PENDING_RECOVERY); eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO_Z_LIFTED, 0); } else if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_HOST) { 10966: 81 30 cpi r24, 0x01 ; 1 10968: 09 f0 breq .+2 ; 0x1096c 1096a: 81 cf rjmp .-254 ; 0x1086e // For Host prints we need to start the timer so that the pause has any effect // this will allow g-codes to be processed while in the paused state // For SD prints, M24 starts the timer print_job_timer.start(); 1096c: 0f 94 56 20 call 0x240ac ; 0x240ac usb_timer.start(); 10970: 85 ed ldi r24, 0xD5 ; 213 10972: 91 e1 ldi r25, 0x11 ; 17 10974: 0f 94 d6 0f call 0x21fac ; 0x21fac ::start()> // Park the extruder to the side and don't resume the print // we must assume that the host as not fully booted up at this point lcd_pause_print(); 10978: 0f 94 80 0f call 0x21f00 ; 0x21f00 1097c: 78 cf rjmp .-272 ; 0x1086e } } else if (code_seen_P(PSTR("MMURES"))) { // PRUSA MMURES 1097e: 86 e0 ldi r24, 0x06 ; 6 10980: 91 e8 ldi r25, 0x81 ; 129 10982: 0f 94 51 74 call 0x2e8a2 ; 0x2e8a2 10986: 88 23 and r24, r24 10988: 21 f0 breq .+8 ; 0x10992 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 1098a: 80 e0 ldi r24, 0x00 ; 0 1098c: 0f 94 5d 62 call 0x2c4ba ; 0x2c4ba 10990: 6e cf rjmp .-292 ; 0x1086e MMU2::mmu2.Reset(MMU2::MMU2::Software); } else if (code_seen_P(PSTR("RESET"))) { // PRUSA RESET 10992: 80 e0 ldi r24, 0x00 ; 0 10994: 91 e8 ldi r25, 0x81 ; 129 10996: 0f 94 51 74 call 0x2e8a2 ; 0x2e8a2 1099a: 81 11 cpse r24, r1 #if defined(XFLASH) && defined(BOOTAPP) boot_app_magic = 0; #endif //defined(XFLASH) && defined(BOOTAPP) softReset(); 1099c: 0e 94 a7 60 call 0xc14e ; 0xc14e } else if (code_seen_P(PSTR("SN"))) { // PRUSA SN 109a0: 8d ef ldi r24, 0xFD ; 253 109a2: 90 e8 ldi r25, 0x80 ; 128 109a4: 0f 94 51 74 call 0x2e8a2 ; 0x2e8a2 109a8: 88 23 and r24, r24 109aa: a9 f0 breq .+42 ; 0x109d6 char SN[20]; eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); 109ac: 44 e1 ldi r20, 0x14 ; 20 109ae: 50 e0 ldi r21, 0x00 ; 0 109b0: 65 e1 ldi r22, 0x15 ; 21 109b2: 7d e0 ldi r23, 0x0D ; 13 109b4: ce 01 movw r24, r28 109b6: 01 96 adiw r24, 0x01 ; 1 109b8: 0f 94 cc 9f call 0x33f98 ; 0x33f98 if (SN[19]) 109bc: 8c 89 ldd r24, Y+20 ; 0x14 109be: 88 23 and r24, r24 109c0: 29 f0 breq .+10 ; 0x109cc puts_P(PSTR("SN invalid")); 109c2: 82 ef ldi r24, 0xF2 ; 242 109c4: 90 e8 ldi r25, 0x80 ; 128 109c6: 0f 94 c5 9e call 0x33d8a ; 0x33d8a 109ca: 51 cf rjmp .-350 ; 0x1086e else puts(SN); 109cc: ce 01 movw r24, r28 109ce: 01 96 adiw r24, 0x01 ; 1 109d0: 0f 94 6b a6 call 0x34cd6 ; 0x34cd6 109d4: 4c cf rjmp .-360 ; 0x1086e } else if(code_seen_P(PSTR("Fir"))){ // PRUSA Fir 109d6: 8e ee ldi r24, 0xEE ; 238 109d8: 90 e8 ldi r25, 0x80 ; 128 109da: 0f 94 51 74 call 0x2e8a2 ; 0x2e8a2 109de: 88 23 and r24, r24 109e0: 29 f0 breq .+10 ; 0x109ec SERIAL_PROTOCOLLNPGM(FW_VERSION_FULL); 109e2: 82 ee ldi r24, 0xE2 ; 226 109e4: 90 e8 ldi r25, 0x80 ; 128 else { SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); 109e6: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 109ea: 41 cf rjmp .-382 ; 0x1086e puts(SN); } else if(code_seen_P(PSTR("Fir"))){ // PRUSA Fir SERIAL_PROTOCOLLNPGM(FW_VERSION_FULL); } else if(code_seen_P(PSTR("Rev"))){ // PRUSA Rev 109ec: 8e ed ldi r24, 0xDE ; 222 109ee: 90 e8 ldi r25, 0x80 ; 128 109f0: 0f 94 51 74 call 0x2e8a2 ; 0x2e8a2 109f4: 88 23 and r24, r24 109f6: 19 f0 breq .+6 ; 0x109fe SERIAL_PROTOCOLLNPGM(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE ); 109f8: 8e eb ldi r24, 0xBE ; 190 109fa: 90 e8 ldi r25, 0x80 ; 128 109fc: f4 cf rjmp .-24 ; 0x109e6 } else if(code_seen_P(PSTR("Lang"))) { // PRUSA Lang 109fe: 89 eb ldi r24, 0xB9 ; 185 10a00: 90 e8 ldi r25, 0x80 ; 128 10a02: 0f 94 51 74 call 0x2e8a2 ; 0x2e8a2 10a06: 88 23 and r24, r24 10a08: 19 f0 breq .+6 ; 0x10a10 lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 10a0a: 0e 94 b4 6b call 0xd768 ; 0xd768 10a0e: 2f cf rjmp .-418 ; 0x1086e SERIAL_PROTOCOLLNPGM(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE ); } else if(code_seen_P(PSTR("Lang"))) { // PRUSA Lang lang_reset(); } else if(code_seen_P(PSTR("Lz"))) { // PRUSA Lz 10a10: 86 eb ldi r24, 0xB6 ; 182 10a12: 90 e8 ldi r25, 0x80 ; 128 10a14: 0f 94 51 74 call 0x2e8a2 ; 0x2e8a2 10a18: 88 23 and r24, r24 10a1a: 79 f0 breq .+30 ; 0x10a3a eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 10a1c: 81 ea ldi r24, 0xA1 ; 161 10a1e: 9d e0 ldi r25, 0x0D ; 13 10a20: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 10a24: 2b e0 ldi r18, 0x0B ; 11 10a26: 82 9f mul r24, r18 10a28: c0 01 movw r24, r0 10a2a: 11 24 eor r1, r1 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 10a2c: 70 e0 ldi r23, 0x00 ; 0 10a2e: 60 e0 ldi r22, 0x00 ; 0 10a30: 80 5b subi r24, 0xB0 ; 176 10a32: 92 4f sbci r25, 0xF2 ; 242 10a34: 0f 94 1e a0 call 0x3403c ; 0x3403c 10a38: 1a cf rjmp .-460 ; 0x1086e } else if(code_seen_P(PSTR("FR"))) { // PRUSA FR 10a3a: 83 eb ldi r24, 0xB3 ; 179 10a3c: 90 e8 ldi r25, 0x80 ; 128 10a3e: 0f 94 51 74 call 0x2e8a2 ; 0x2e8a2 10a42: 88 23 and r24, r24 10a44: 51 f0 breq .+20 ; 0x10a5a // Factory reset function // This function is used to erase parts or whole EEPROM memory which is used for storing calibration and and so on. // Level input parameter sets depth of reset static void factory_reset(char level) { lcd_clear(); 10a46: 0e 94 ae 69 call 0xd35c ; 0xd35c Sound_MakeCustom(100,0,false); 10a4a: 40 e0 ldi r20, 0x00 ; 0 10a4c: 70 e0 ldi r23, 0x00 ; 0 10a4e: 60 e0 ldi r22, 0x00 ; 0 10a50: 84 e6 ldi r24, 0x64 ; 100 10a52: 90 e0 ldi r25, 0x00 ; 0 10a54: 0f 94 c5 31 call 0x2638a ; 0x2638a 10a58: d8 cf rjmp .-80 ; 0x10a0a eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); } else if(code_seen_P(PSTR("FR"))) { // PRUSA FR // Factory full reset factory_reset(0); } else if(code_seen_P(PSTR("MBL"))) { // PRUSA MBL 10a5a: 8f ea ldi r24, 0xAF ; 175 10a5c: 90 e8 ldi r25, 0x80 ; 128 10a5e: 0f 94 51 74 call 0x2e8a2 ; 0x2e8a2 10a62: 88 23 and r24, r24 10a64: e1 f0 breq .+56 ; 0x10a9e // Change the MBL status without changing the logical Z position. if(code_seen('V')) { 10a66: 86 e5 ldi r24, 0x56 ; 86 10a68: 0e 94 2b 55 call 0xaa56 ; 0xaa56 10a6c: 88 23 and r24, r24 10a6e: 09 f4 brne .+2 ; 0x10a72 10a70: fe ce rjmp .-516 ; 0x1086e bool value = code_value_short(); 10a72: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 10a76: 11 e0 ldi r17, 0x01 ; 1 10a78: 89 2b or r24, r25 10a7a: 09 f4 brne .+2 ; 0x10a7e 10a7c: 10 e0 ldi r17, 0x00 ; 0 st_synchronize(); 10a7e: 0f 94 42 22 call 0x24484 ; 0x24484 if(value != mbl.active) { 10a82: 80 91 9c 12 lds r24, 0x129C ; 0x80129c 10a86: 90 e0 ldi r25, 0x00 ; 0 10a88: 18 17 cp r17, r24 10a8a: 19 06 cpc r1, r25 10a8c: 09 f4 brne .+2 ; 0x10a90 10a8e: ef ce rjmp .-546 ; 0x1086e mbl.active = value; 10a90: 10 93 9c 12 sts 0x129C, r17 ; 0x80129c // Use plan_set_z_position to reset the physical values plan_set_z_position(current_position[Z_AXIS]); 10a94: 8d ef ldi r24, 0xFD ; 253 10a96: 91 e1 ldi r25, 0x11 ; 17 10a98: 0f 94 fb 74 call 0x2e9f6 ; 0x2e9f6 10a9c: e8 ce rjmp .-560 ; 0x1086e } } } else if (code_seen_P(PSTR("nozzle"))) { // PRUSA nozzle 10a9e: 88 ea ldi r24, 0xA8 ; 168 10aa0: 90 e8 ldi r25, 0x80 ; 128 10aa2: 0f 94 51 74 call 0x2e8a2 ; 0x2e8a2 10aa6: 88 23 and r24, r24 10aa8: 09 f4 brne .+2 ; 0x10aac 10aaa: e1 ce rjmp .-574 ; 0x1086e uint16_t nDiameter; if(code_seen('D')) { 10aac: 84 e4 ldi r24, 0x44 ; 68 10aae: 0e 94 2b 55 call 0xaa56 ; 0xaa56 10ab2: 88 23 and r24, r24 10ab4: a1 f0 breq .+40 ; 0x10ade nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 10ab6: 0e 94 03 5a call 0xb406 ; 0xb406 10aba: 20 e0 ldi r18, 0x00 ; 0 10abc: 30 e0 ldi r19, 0x00 ; 0 10abe: 4a e7 ldi r20, 0x7A ; 122 10ac0: 54 e4 ldi r21, 0x44 ; 68 10ac2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 10ac6: 20 e0 ldi r18, 0x00 ; 0 10ac8: 30 e0 ldi r19, 0x00 ; 0 10aca: 40 e0 ldi r20, 0x00 ; 0 10acc: 5f e3 ldi r21, 0x3F ; 63 10ace: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 10ad2: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> nozzle_diameter_check(nDiameter); 10ad6: cb 01 movw r24, r22 10ad8: 0e 94 1e f0 call 0x1e03c ; 0x1e03c 10adc: c8 ce rjmp .-624 ; 0x1086e } else if(code_seen_P(PSTR("set")) && farm_mode) { 10ade: 84 ea ldi r24, 0xA4 ; 164 10ae0: 90 e8 ldi r25, 0x80 ; 128 10ae2: 0f 94 51 74 call 0x2e8a2 ; 0x2e8a2 10ae6: 88 23 and r24, r24 10ae8: 49 f1 breq .+82 ; 0x10b3c 10aea: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 10aee: 88 23 and r24, r24 10af0: 29 f1 breq .+74 ; 0x10b3c strchr_pointer++; // skip 1st char (~ 's') strchr_pointer++; // skip 2nd char (~ 'e') 10af2: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 10af6: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 10afa: 02 96 adiw r24, 0x02 ; 2 10afc: 90 93 f6 16 sts 0x16F6, r25 ; 0x8016f6 10b00: 80 93 f5 16 sts 0x16F5, r24 ; 0x8016f5 nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 10b04: 0e 94 03 5a call 0xb406 ; 0xb406 10b08: 6b 01 movw r12, r22 10b0a: 7c 01 movw r14, r24 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 10b0c: 6f ef ldi r22, 0xFF ; 255 10b0e: 87 ea ldi r24, 0xA7 ; 167 10b10: 9d e0 ldi r25, 0x0D ; 13 10b12: 0f 94 00 a0 call 0x34000 ; 0x34000 10b16: 20 e0 ldi r18, 0x00 ; 0 10b18: 30 e0 ldi r19, 0x00 ; 0 10b1a: 4a e7 ldi r20, 0x7A ; 122 10b1c: 54 e4 ldi r21, 0x44 ; 68 10b1e: c7 01 movw r24, r14 10b20: b6 01 movw r22, r12 10b22: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 10b26: 20 e0 ldi r18, 0x00 ; 0 10b28: 30 e0 ldi r19, 0x00 ; 0 10b2a: 40 e0 ldi r20, 0x00 ; 0 10b2c: 5f e3 ldi r21, 0x3F ; 63 10b2e: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 10b32: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 10b36: 85 ea ldi r24, 0xA5 ; 165 10b38: 9d e0 ldi r25, 0x0D ; 13 10b3a: 7c cf rjmp .-264 ; 0x10a34 eeprom_update_byte_notify((uint8_t*)EEPROM_NOZZLE_DIAMETER,(uint8_t)ClNozzleDiameter::_Diameter_Undef); // for correct synchronization after farm-mode exiting eeprom_update_word_notify((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,nDiameter); } else SERIAL_PROTOCOLLN((float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); 10b3c: 85 ea ldi r24, 0xA5 ; 165 10b3e: 9d e0 ldi r25, 0x0D ; 13 10b40: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 10b44: bc 01 movw r22, r24 10b46: 90 e0 ldi r25, 0x00 ; 0 10b48: 80 e0 ldi r24, 0x00 ; 0 10b4a: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 10b4e: 20 e0 ldi r18, 0x00 ; 0 10b50: 30 e0 ldi r19, 0x00 ; 0 10b52: 4a e7 ldi r20, 0x7A ; 122 10b54: 54 e4 ldi r21, 0x44 ; 68 10b56: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 10b5a: 0f 94 8d 41 call 0x2831a ; 0x2831a 10b5e: 87 ce rjmp .-754 ; 0x1086e } } else if(*CMDBUFFER_CURRENT_STRING == 'G') 10b60: d8 01 movw r26, r16 10b62: 8c 91 ld r24, X 10b64: 87 34 cpi r24, 0x47 ; 71 10b66: 11 f0 breq .+4 ; 0x10b6c 10b68: 0c 94 db 90 jmp 0x121b6 ; 0x121b6 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 10b6c: 10 93 f6 16 sts 0x16F6, r17 ; 0x8016f6 10b70: 00 93 f5 16 sts 0x16F5, r16 ; 0x8016f5 gcode_in_progress = code_value_short(); 10b74: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 10b78: 90 93 58 03 sts 0x0358, r25 ; 0x800358 10b7c: 80 93 57 03 sts 0x0357, r24 ; 0x800357 // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 10b80: 8b 34 cpi r24, 0x4B ; 75 10b82: 91 05 cpc r25, r1 10b84: 09 f4 brne .+2 ; 0x10b88 10b86: 45 c6 rjmp .+3210 ; 0x11812 10b88: 0c f0 brlt .+2 ; 0x10b8c 10b8a: 4b c1 rjmp .+662 ; 0x10e22 10b8c: 84 30 cpi r24, 0x04 ; 4 10b8e: 91 05 cpc r25, r1 10b90: 09 f4 brne .+2 ; 0x10b94 10b92: aa c5 rjmp .+2900 ; 0x116e8 10b94: 0c f0 brlt .+2 ; 0x10b98 10b96: c5 c0 rjmp .+394 ; 0x10d22 10b98: 97 fd sbrc r25, 7 10b9a: cf c0 rjmp .+414 ; 0x10d3a 10b9c: 02 97 sbiw r24, 0x02 ; 2 10b9e: 0c f0 brlt .+2 ; 0x10ba2 10ba0: a2 c1 rjmp .+836 ; 0x10ee6 */ case 0: // G0 -> G1 case 1: // G1 { uint16_t start_segment_idx = restore_interrupted_gcode(); 10ba2: 0e 94 75 54 call 0xa8ea ; 0xa8ea 10ba6: 8c 01 movw r16, r24 get_coordinates(); // For X Y Z E F 10ba8: 0e 94 2a 5b call 0xb654 ; 0xb654 if (total_filament_used > ((current_position[E_AXIS] - destination[E_AXIS]) * 100)) { //protection against total_filament_used overflow 10bac: 60 91 84 06 lds r22, 0x0684 ; 0x800684 10bb0: 70 91 85 06 lds r23, 0x0685 ; 0x800685 10bb4: 80 91 86 06 lds r24, 0x0686 ; 0x800686 10bb8: 90 91 87 06 lds r25, 0x0687 ; 0x800687 10bbc: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 10bc0: 6b 01 movw r12, r22 10bc2: 7c 01 movw r14, r24 10bc4: 40 90 01 12 lds r4, 0x1201 ; 0x801201 10bc8: 50 90 02 12 lds r5, 0x1202 ; 0x801202 10bcc: 60 90 03 12 lds r6, 0x1203 ; 0x801203 10bd0: 70 90 04 12 lds r7, 0x1204 ; 0x801204 10bd4: 80 90 9f 06 lds r8, 0x069F ; 0x80069f 10bd8: 90 90 a0 06 lds r9, 0x06A0 ; 0x8006a0 10bdc: a0 90 a1 06 lds r10, 0x06A1 ; 0x8006a1 10be0: b0 90 a2 06 lds r11, 0x06A2 ; 0x8006a2 10be4: a5 01 movw r20, r10 10be6: 94 01 movw r18, r8 10be8: c3 01 movw r24, r6 10bea: b2 01 movw r22, r4 10bec: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 10bf0: 20 e0 ldi r18, 0x00 ; 0 10bf2: 30 e0 ldi r19, 0x00 ; 0 10bf4: 48 ec ldi r20, 0xC8 ; 200 10bf6: 52 e4 ldi r21, 0x42 ; 66 10bf8: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 10bfc: 9b 01 movw r18, r22 10bfe: ac 01 movw r20, r24 10c00: c7 01 movw r24, r14 10c02: b6 01 movw r22, r12 10c04: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 10c08: 18 16 cp r1, r24 10c0a: d4 f4 brge .+52 ; 0x10c40 total_filament_used = total_filament_used + ((destination[E_AXIS] - current_position[E_AXIS]) * 100); 10c0c: a3 01 movw r20, r6 10c0e: 92 01 movw r18, r4 10c10: c5 01 movw r24, r10 10c12: b4 01 movw r22, r8 10c14: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 10c18: 20 e0 ldi r18, 0x00 ; 0 10c1a: 30 e0 ldi r19, 0x00 ; 0 10c1c: 48 ec ldi r20, 0xC8 ; 200 10c1e: 52 e4 ldi r21, 0x42 ; 66 10c20: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 10c24: a7 01 movw r20, r14 10c26: 96 01 movw r18, r12 10c28: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 10c2c: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 10c30: 60 93 84 06 sts 0x0684, r22 ; 0x800684 10c34: 70 93 85 06 sts 0x0685, r23 ; 0x800685 10c38: 80 93 86 06 sts 0x0686, r24 ; 0x800686 10c3c: 90 93 87 06 sts 0x0687, r25 ; 0x800687 } #ifdef FWRETRACT if(cs.autoretract_enabled) { 10c40: 80 91 b4 04 lds r24, 0x04B4 ; 0x8004b4 10c44: 88 23 and r24, r24 10c46: 09 f4 brne .+2 ; 0x10c4a 10c48: 46 c1 rjmp .+652 ; 0x10ed6 if( !(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) { 10c4a: 88 e5 ldi r24, 0x58 ; 88 10c4c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 10c50: 81 11 cpse r24, r1 10c52: 41 c1 rjmp .+642 ; 0x10ed6 10c54: 89 e5 ldi r24, 0x59 ; 89 10c56: 0e 94 2b 55 call 0xaa56 ; 0xaa56 10c5a: 81 11 cpse r24, r1 10c5c: 3c c1 rjmp .+632 ; 0x10ed6 10c5e: 8a e5 ldi r24, 0x5A ; 90 10c60: 0e 94 2b 55 call 0xaa56 ; 0xaa56 10c64: 81 11 cpse r24, r1 10c66: 37 c1 rjmp .+622 ; 0x10ed6 10c68: 85 e4 ldi r24, 0x45 ; 69 10c6a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 10c6e: 88 23 and r24, r24 10c70: 09 f4 brne .+2 ; 0x10c74 10c72: 31 c1 rjmp .+610 ; 0x10ed6 float echange=destination[E_AXIS]-current_position[E_AXIS]; 10c74: 20 91 01 12 lds r18, 0x1201 ; 0x801201 10c78: 30 91 02 12 lds r19, 0x1202 ; 0x801202 10c7c: 40 91 03 12 lds r20, 0x1203 ; 0x801203 10c80: 50 91 04 12 lds r21, 0x1204 ; 0x801204 10c84: 60 91 9f 06 lds r22, 0x069F ; 0x80069f 10c88: 70 91 a0 06 lds r23, 0x06A0 ; 0x8006a0 10c8c: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 10c90: 90 91 a2 06 lds r25, 0x06A2 ; 0x8006a2 10c94: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 10c98: 6b 01 movw r12, r22 10c9a: 7c 01 movw r14, r24 if((echange<-MIN_RETRACT && !retracted[active_extruder]) || (echange>MIN_RETRACT && retracted[active_extruder])) { //move appears to be an attempt to retract or recover 10c9c: 2d ec ldi r18, 0xCD ; 205 10c9e: 3c ec ldi r19, 0xCC ; 204 10ca0: 4c ec ldi r20, 0xCC ; 204 10ca2: 5d eb ldi r21, 0xBD ; 189 10ca4: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 10ca8: 87 ff sbrs r24, 7 10caa: 07 c1 rjmp .+526 ; 0x10eba 10cac: 80 91 03 05 lds r24, 0x0503 ; 0x800503 10cb0: 81 11 cpse r24, r1 10cb2: 0c 94 1e b0 jmp 0x1603c ; 0x1603c st_synchronize(); 10cb6: 0f 94 42 22 call 0x24484 ; 0x24484 current_position[E_AXIS] = destination[E_AXIS]; //hide the slicer-generated retract/recover from calculations 10cba: 80 91 9f 06 lds r24, 0x069F ; 0x80069f 10cbe: 90 91 a0 06 lds r25, 0x06A0 ; 0x8006a0 10cc2: a0 91 a1 06 lds r26, 0x06A1 ; 0x8006a1 10cc6: b0 91 a2 06 lds r27, 0x06A2 ; 0x8006a2 10cca: 80 93 01 12 sts 0x1201, r24 ; 0x801201 10cce: 90 93 02 12 sts 0x1202, r25 ; 0x801202 10cd2: a0 93 03 12 sts 0x1203, r26 ; 0x801203 10cd6: b0 93 04 12 sts 0x1204, r27 ; 0x801204 plan_set_e_position(current_position[E_AXIS]); //AND from the planner 10cda: 81 e0 ldi r24, 0x01 ; 1 10cdc: 92 e1 ldi r25, 0x12 ; 18 10cde: 0f 94 c8 74 call 0x2e990 ; 0x2e990 retract(!retracted[active_extruder]); 10ce2: 90 91 03 05 lds r25, 0x0503 ; 0x800503 10ce6: 81 e0 ldi r24, 0x01 ; 1 10ce8: 89 27 eor r24, r25 10cea: 0e 94 53 be call 0x17ca6 ; 0x17ca6 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); ClearToSend(); } 10cee: cd 59 subi r28, 0x9D ; 157 10cf0: df 4f sbci r29, 0xFF ; 255 10cf2: 0f b6 in r0, 0x3f ; 63 10cf4: f8 94 cli 10cf6: de bf out 0x3e, r29 ; 62 10cf8: 0f be out 0x3f, r0 ; 63 10cfa: cd bf out 0x3d, r28 ; 61 10cfc: df 91 pop r29 10cfe: cf 91 pop r28 10d00: 1f 91 pop r17 10d02: 0f 91 pop r16 10d04: ff 90 pop r15 10d06: ef 90 pop r14 10d08: df 90 pop r13 10d0a: cf 90 pop r12 10d0c: bf 90 pop r11 10d0e: af 90 pop r10 10d10: 9f 90 pop r9 10d12: 8f 90 pop r8 10d14: 7f 90 pop r7 10d16: 6f 90 pop r6 10d18: 5f 90 pop r5 10d1a: 4f 90 pop r4 10d1c: 3f 90 pop r3 10d1e: 2f 90 pop r2 10d20: 08 95 ret else if(*CMDBUFFER_CURRENT_STRING == 'G') { strchr_pointer = CMDBUFFER_CURRENT_STRING; gcode_in_progress = code_value_short(); // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 10d22: 85 31 cpi r24, 0x15 ; 21 10d24: 91 05 cpc r25, r1 10d26: 09 f4 brne .+2 ; 0x10d2a 10d28: d9 c0 rjmp .+434 ; 0x10edc 10d2a: fc f4 brge .+62 ; 0x10d6a 10d2c: 8a 30 cpi r24, 0x0A ; 10 10d2e: 91 05 cpc r25, r1 10d30: 09 f4 brne .+2 ; 0x10d34 10d32: 23 c5 rjmp .+2630 ; 0x1177a 10d34: 0b 97 sbiw r24, 0x0b ; 11 10d36: 09 f4 brne .+2 ; 0x10d3a 10d38: 24 c5 rjmp .+2632 ; 0x11782 case 99: farm_gcode_g99(); break; #endif //PRUSA_FARM default: printf_P(MSG_UNKNOWN_CODE, 'G', cmdbuffer + bufindr + CMDHDRSIZE); 10d3a: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 10d3e: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 10d42: 8f 51 subi r24, 0x1F ; 31 10d44: 90 4f sbci r25, 0xF0 ; 240 10d46: 9f 93 push r25 10d48: 8f 93 push r24 10d4a: 1f 92 push r1 10d4c: 87 e4 ldi r24, 0x47 ; 71 10d4e: 8f 93 push r24 10d50: 88 e4 ldi r24, 0x48 ; 72 10d52: 96 e6 ldi r25, 0x66 ; 102 10d54: 9f 93 push r25 10d56: 8f 93 push r24 10d58: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 10d5c: 0f 90 pop r0 10d5e: 0f 90 pop r0 10d60: 0f 90 pop r0 10d62: 0f 90 pop r0 10d64: 0f 90 pop r0 10d66: 0f 90 pop r0 10d68: b9 c0 rjmp .+370 ; 0x10edc else if(*CMDBUFFER_CURRENT_STRING == 'G') { strchr_pointer = CMDBUFFER_CURRENT_STRING; gcode_in_progress = code_value_short(); // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 10d6a: 8c 31 cpi r24, 0x1C ; 28 10d6c: 91 05 cpc r25, r1 10d6e: 09 f4 brne .+2 ; 0x10d72 10d70: 0a c5 rjmp .+2580 ; 0x11786 10d72: 4e 97 sbiw r24, 0x1e ; 30 10d74: 11 f7 brne .-60 ; 0x10d3a Sensor must be over the bed. The maximum travel distance before an error is triggered is 10mm. */ case 30: { st_synchronize(); 10d76: 0f 94 42 22 call 0x24484 ; 0x24484 homing_flag = true; 10d7a: 81 e0 ldi r24, 0x01 ; 1 10d7c: 80 93 05 12 sts 0x1205, r24 ; 0x801205 // TODO: make sure the bed_level_rotation_matrix is identity or the planner will get set incorectly int l_feedmultiply = setup_for_endstop_move(); 10d80: 0e 94 ee 5f call 0xbfdc ; 0xbfdc 10d84: 8c 01 movw r16, r24 feedrate = homing_feedrate[Z_AXIS]; 10d86: 80 e0 ldi r24, 0x00 ; 0 10d88: 90 e0 ldi r25, 0x00 ; 0 10d8a: a8 e4 ldi r26, 0x48 ; 72 10d8c: b4 e4 ldi r27, 0x44 ; 68 10d8e: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a 10d92: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b 10d96: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c 10d9a: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d find_bed_induction_sensor_point_z(-10.f, 3); 10d9e: 43 e0 ldi r20, 0x03 ; 3 10da0: 60 e0 ldi r22, 0x00 ; 0 10da2: 70 e0 ldi r23, 0x00 ; 0 10da4: 80 e2 ldi r24, 0x20 ; 32 10da6: 91 ec ldi r25, 0xC1 ; 193 10da8: 0f 94 fb 55 call 0x2abf6 ; 0x2abf6 printf_P(_N("%S X: %.5f Y: %.5f Z: %.5f\n"), _T(MSG_BED), _x, _y, _z); 10dac: 70 90 fd 11 lds r7, 0x11FD ; 0x8011fd 10db0: 60 90 fe 11 lds r6, 0x11FE ; 0x8011fe 10db4: 50 90 ff 11 lds r5, 0x11FF ; 0x8011ff 10db8: 40 90 00 12 lds r4, 0x1200 ; 0x801200 10dbc: b0 90 f9 11 lds r11, 0x11F9 ; 0x8011f9 10dc0: a0 90 fa 11 lds r10, 0x11FA ; 0x8011fa 10dc4: 90 90 fb 11 lds r9, 0x11FB ; 0x8011fb 10dc8: 80 90 fc 11 lds r8, 0x11FC ; 0x8011fc 10dcc: f0 90 f5 11 lds r15, 0x11F5 ; 0x8011f5 10dd0: e0 90 f6 11 lds r14, 0x11F6 ; 0x8011f6 10dd4: d0 90 f7 11 lds r13, 0x11F7 ; 0x8011f7 10dd8: c0 90 f8 11 lds r12, 0x11F8 ; 0x8011f8 10ddc: 8d e6 ldi r24, 0x6D ; 109 10dde: 95 e5 ldi r25, 0x55 ; 85 10de0: 0e 94 b1 6c call 0xd962 ; 0xd962 10de4: 4f 92 push r4 10de6: 5f 92 push r5 10de8: 6f 92 push r6 10dea: 7f 92 push r7 10dec: 8f 92 push r8 10dee: 9f 92 push r9 10df0: af 92 push r10 10df2: bf 92 push r11 10df4: cf 92 push r12 10df6: df 92 push r13 10df8: ef 92 push r14 10dfa: ff 92 push r15 10dfc: 9f 93 push r25 10dfe: 8f 93 push r24 10e00: 81 e0 ldi r24, 0x01 ; 1 10e02: 97 e6 ldi r25, 0x67 ; 103 10e04: 9f 93 push r25 10e06: 8f 93 push r24 10e08: 0f 94 9e 9e call 0x33d3c ; 0x33d3c clean_up_after_endstop_move(l_feedmultiply); 10e0c: c8 01 movw r24, r16 10e0e: 0e 94 d4 5f call 0xbfa8 ; 0xbfa8 homing_flag = false; 10e12: 10 92 05 12 sts 0x1205, r1 ; 0x801205 10e16: 0f b6 in r0, 0x3f ; 63 10e18: f8 94 cli 10e1a: de bf out 0x3e, r29 ; 62 10e1c: 0f be out 0x3f, r0 ; 63 10e1e: cd bf out 0x3d, r28 ; 61 10e20: 5d c0 rjmp .+186 ; 0x10edc else if(*CMDBUFFER_CURRENT_STRING == 'G') { strchr_pointer = CMDBUFFER_CURRENT_STRING; gcode_in_progress = code_value_short(); // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 10e22: 88 35 cpi r24, 0x58 ; 88 10e24: 91 05 cpc r25, r1 10e26: 09 f4 brne .+2 ; 0x10e2a 10e28: 59 c0 rjmp .+178 ; 0x10edc 10e2a: f4 f4 brge .+60 ; 0x10e68 10e2c: 81 35 cpi r24, 0x51 ; 81 10e2e: 91 05 cpc r25, r1 10e30: 11 f4 brne .+4 ; 0x10e36 10e32: 0c 94 21 90 jmp 0x12042 ; 0x12042 10e36: 5c f4 brge .+22 ; 0x10e4e 10e38: 8c 34 cpi r24, 0x4C ; 76 10e3a: 91 05 cpc r25, r1 10e3c: 09 f4 brne .+2 ; 0x10e40 10e3e: 0c c5 rjmp .+2584 ; 0x11858 10e40: 80 35 cpi r24, 0x50 ; 80 10e42: 91 05 cpc r25, r1 10e44: 09 f0 breq .+2 ; 0x10e48 10e46: 79 cf rjmp .-270 ; 0x10d3a - `W` - area width (on X axis) - `H` - area height (on Y axis) */ case 80: { gcode_G80(); 10e48: 0e 94 0d 7e call 0xfc1a ; 0xfc1a 10e4c: 47 c0 rjmp .+142 ; 0x10edc else if(*CMDBUFFER_CURRENT_STRING == 'G') { strchr_pointer = CMDBUFFER_CURRENT_STRING; gcode_in_progress = code_value_short(); // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 10e4e: 86 35 cpi r24, 0x56 ; 86 10e50: 91 05 cpc r25, r1 10e52: 11 f4 brne .+4 ; 0x10e58 10e54: 0c 94 25 90 jmp 0x1204a ; 0x1204a 10e58: 87 35 cpi r24, 0x57 ; 87 10e5a: 91 05 cpc r25, r1 10e5c: 09 f0 breq .+2 ; 0x10e60 10e5e: 6d cf rjmp .-294 ; 0x10d3a This G-code will be performed at the end of a calibration script. (Prusa3D specific) */ case 87: calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 10e60: 80 e1 ldi r24, 0x10 ; 16 10e62: 0e 94 86 c6 call 0x18d0c ; 0x18d0c 10e66: 3a c0 rjmp .+116 ; 0x10edc else if(*CMDBUFFER_CURRENT_STRING == 'G') { strchr_pointer = CMDBUFFER_CURRENT_STRING; gcode_in_progress = code_value_short(); // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 10e68: 8c 35 cpi r24, 0x5C ; 92 10e6a: 91 05 cpc r25, r1 10e6c: 11 f4 brne .+4 ; 0x10e72 10e6e: 0c 94 31 90 jmp 0x12062 ; 0x12062 10e72: 74 f4 brge .+28 ; 0x10e90 10e74: 8a 35 cpi r24, 0x5A ; 90 10e76: 91 05 cpc r25, r1 10e78: 11 f4 brne .+4 ; 0x10e7e 10e7a: 0c 94 2a 90 jmp 0x12054 ; 0x12054 10e7e: 8b 35 cpi r24, 0x5B ; 91 10e80: 91 05 cpc r25, r1 10e82: 09 f0 breq .+2 ; 0x10e86 10e84: 5a cf rjmp .-332 ; 0x10d3a /*! ### G91 - Switch on relative mode G91: Set to Relative Positioning All coordinates from now on are relative to the last position. E axis is left intact. */ case 91: { axis_relative_modes |= X_AXIS_MASK | Y_AXIS_MASK | Z_AXIS_MASK; 10e86: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb 10e8a: 87 60 ori r24, 0x07 ; 7 10e8c: 0c 94 2d 90 jmp 0x1205a ; 0x1205a else if(*CMDBUFFER_CURRENT_STRING == 'G') { strchr_pointer = CMDBUFFER_CURRENT_STRING; gcode_in_progress = code_value_short(); // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 10e90: 82 36 cpi r24, 0x62 ; 98 10e92: 91 05 cpc r25, r1 10e94: 11 f4 brne .+4 ; 0x10e9a 10e96: 0c 94 c8 90 jmp 0x12190 ; 0x12190 10e9a: 83 36 cpi r24, 0x63 ; 99 10e9c: 91 05 cpc r25, r1 10e9e: 09 f0 breq .+2 ; 0x10ea2 10ea0: 4c cf rjmp .-360 ; 0x10d3a lcd_update(2); fCheckModeInit(); // alternatively invoke printer reset } void farm_disable() { farm_mode = false; 10ea2: 10 92 ca 0d sts 0x0DCA, r1 ; 0x800dca if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 10ea6: 60 e0 ldi r22, 0x00 ; 0 10ea8: 84 ec ldi r24, 0xC4 ; 196 10eaa: 9f e0 ldi r25, 0x0F ; 15 10eac: 0f 94 00 a0 call 0x34000 ; 0x34000 fCheckModeInit(); // alternatively invoke printer reset } void farm_gcode_g99() { farm_disable(); lcd_update(2); 10eb0: 82 e0 ldi r24, 0x02 ; 2 10eb2: 0e 94 42 69 call 0xd284 ; 0xd284 10eb6: 0c 94 d7 90 jmp 0x121ae ; 0x121ae #ifdef FWRETRACT if(cs.autoretract_enabled) { if( !(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) { float echange=destination[E_AXIS]-current_position[E_AXIS]; if((echange<-MIN_RETRACT && !retracted[active_extruder]) || (echange>MIN_RETRACT && retracted[active_extruder])) { //move appears to be an attempt to retract or recover 10eba: 2d ec ldi r18, 0xCD ; 205 10ebc: 3c ec ldi r19, 0xCC ; 204 10ebe: 4c ec ldi r20, 0xCC ; 204 10ec0: 5d e3 ldi r21, 0x3D ; 61 10ec2: c7 01 movw r24, r14 10ec4: b6 01 movw r22, r12 10ec6: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 10eca: 18 16 cp r1, r24 10ecc: 24 f4 brge .+8 ; 0x10ed6 10ece: 80 91 03 05 lds r24, 0x0503 ; 0x800503 10ed2: 81 11 cpse r24, r1 10ed4: f0 ce rjmp .-544 ; 0x10cb6 } } } #endif //FWRETRACT prepare_move(start_segment_idx); 10ed6: c8 01 movw r24, r16 10ed8: 0e 94 04 65 call 0xca08 ; 0xca08 #endif //PRUSA_FARM default: printf_P(MSG_UNKNOWN_CODE, 'G', cmdbuffer + bufindr + CMDHDRSIZE); } // printf_P(_N("END G-CODE=%u\n"), gcode_in_progress); gcode_in_progress = 0; 10edc: 10 92 58 03 sts 0x0358, r1 ; 0x800358 10ee0: 10 92 57 03 sts 0x0357, r1 ; 0x800357 10ee4: c4 cc rjmp .-1656 ; 0x1086e */ case 2: case 3: { uint16_t start_segment_idx = restore_interrupted_gcode(); 10ee6: 0e 94 75 54 call 0xa8ea ; 0xa8ea 10eea: 2e 96 adiw r28, 0x0e ; 14 10eec: 9f af std Y+63, r25 ; 0x3f 10eee: 8e af std Y+62, r24 ; 0x3e 10ef0: 2e 97 sbiw r28, 0x0e ; 14 #ifdef SF_ARC_FIX bool relative_mode_backup = relative_mode; relative_mode = true; #endif get_coordinates(); // For X Y Z E F 10ef2: 0e 94 2a 5b call 0xb654 ; 0xb654 #ifdef SF_ARC_FIX relative_mode=relative_mode_backup; #endif offset[0] = code_seen('I') ? code_value() : 0.f; 10ef6: 89 e4 ldi r24, 0x49 ; 73 10ef8: 0e 94 2b 55 call 0xaa56 ; 0xaa56 10efc: 88 23 and r24, r24 10efe: 09 f4 brne .+2 ; 0x10f02 10f00: a0 c3 rjmp .+1856 ; 0x11642 10f02: 0e 94 03 5a call 0xb406 ; 0xb406 10f06: 60 93 4f 03 sts 0x034F, r22 ; 0x80034f 10f0a: 70 93 50 03 sts 0x0350, r23 ; 0x800350 10f0e: 80 93 51 03 sts 0x0351, r24 ; 0x800351 10f12: 90 93 52 03 sts 0x0352, r25 ; 0x800352 offset[1] = code_seen('J') ? code_value() : 0.f; 10f16: 8a e4 ldi r24, 0x4A ; 74 10f18: 0e 94 2b 55 call 0xaa56 ; 0xaa56 10f1c: c1 2c mov r12, r1 10f1e: d1 2c mov r13, r1 10f20: 76 01 movw r14, r12 10f22: 88 23 and r24, r24 10f24: 21 f0 breq .+8 ; 0x10f2e 10f26: 0e 94 03 5a call 0xb406 ; 0xb406 10f2a: 6b 01 movw r12, r22 10f2c: 7c 01 movw r14, r24 10f2e: c0 92 53 03 sts 0x0353, r12 ; 0x800353 10f32: d0 92 54 03 sts 0x0354, r13 ; 0x800354 10f36: e0 92 55 03 sts 0x0355, r14 ; 0x800355 10f3a: f0 92 56 03 sts 0x0356, r15 ; 0x800356 prepare_arc_move((gcode_in_progress == 2), start_segment_idx); 10f3e: e0 91 57 03 lds r30, 0x0357 ; 0x800357 10f42: f0 91 58 03 lds r31, 0x0358 ; 0x800358 10f46: a4 96 adiw r28, 0x24 ; 36 10f48: ff af std Y+63, r31 ; 0x3f 10f4a: ee af std Y+62, r30 ; 0x3e 10f4c: a4 97 sbiw r28, 0x24 ; 36 set_current_to_destination(); } void prepare_arc_move(bool isclockwise, uint16_t start_segment_idx) { float r = hypot(offset[X_AXIS], offset[Y_AXIS]); // Compute arc radius for mc_arc 10f4e: 80 90 4f 03 lds r8, 0x034F ; 0x80034f 10f52: 90 90 50 03 lds r9, 0x0350 ; 0x800350 10f56: a0 90 51 03 lds r10, 0x0351 ; 0x800351 10f5a: b0 90 52 03 lds r11, 0x0352 ; 0x800352 10f5e: a7 01 movw r20, r14 10f60: 96 01 movw r18, r12 10f62: c5 01 movw r24, r10 10f64: b4 01 movw r22, r8 10f66: 0f 94 a0 a3 call 0x34740 ; 0x34740 10f6a: 24 96 adiw r28, 0x04 ; 4 10f6c: 6c af std Y+60, r22 ; 0x3c 10f6e: 7d af std Y+61, r23 ; 0x3d 10f70: 8e af std Y+62, r24 ; 0x3e 10f72: 9f af std Y+63, r25 ; 0x3f 10f74: 24 97 sbiw r28, 0x04 ; 4 // Trace the arc mc_arc(current_position, destination, offset, (feedrate * feedmultiply) * (1.f / 6000.f), r, isclockwise, start_segment_idx); 10f76: 60 91 8e 02 lds r22, 0x028E ; 0x80028e 10f7a: 70 91 8f 02 lds r23, 0x028F ; 0x80028f 10f7e: 07 2e mov r0, r23 10f80: 00 0c add r0, r0 10f82: 88 0b sbc r24, r24 10f84: 99 0b sbc r25, r25 10f86: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 10f8a: 20 91 7a 02 lds r18, 0x027A ; 0x80027a 10f8e: 30 91 7b 02 lds r19, 0x027B ; 0x80027b 10f92: 40 91 7c 02 lds r20, 0x027C ; 0x80027c 10f96: 50 91 7d 02 lds r21, 0x027D ; 0x80027d 10f9a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 10f9e: 2e e3 ldi r18, 0x3E ; 62 10fa0: 33 ec ldi r19, 0xC3 ; 195 10fa2: 4e e2 ldi r20, 0x2E ; 46 10fa4: 59 e3 ldi r21, 0x39 ; 57 10fa6: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 10faa: 68 af std Y+56, r22 ; 0x38 10fac: 79 af std Y+57, r23 ; 0x39 10fae: 8a af std Y+58, r24 ; 0x3a 10fb0: 9b af std Y+59, r25 ; 0x3b // The arc is approximated by generating a huge number of tiny, linear segments. The length of each // segment is configured in settings.mm_per_arc_segment. void mc_arc(const float* position, float* target, const float* offset, float feed_rate, float radius, bool isclockwise, uint16_t start_segment_idx) { float start_position[4]; memcpy(start_position, position, sizeof(start_position)); 10fb2: 80 e1 ldi r24, 0x10 ; 16 10fb4: e5 ef ldi r30, 0xF5 ; 245 10fb6: f1 e1 ldi r31, 0x11 ; 17 10fb8: de 01 movw r26, r28 10fba: 11 96 adiw r26, 0x01 ; 1 10fbc: 01 90 ld r0, Z+ 10fbe: 0d 92 st X+, r0 10fc0: 8a 95 dec r24 10fc2: e1 f7 brne .-8 ; 0x10fbc float r_axis_x = -offset[X_AXIS]; // Radius vector from center to current location 10fc4: a5 01 movw r20, r10 10fc6: 94 01 movw r18, r8 10fc8: 50 58 subi r21, 0x80 ; 128 10fca: 28 a7 std Y+40, r18 ; 0x28 10fcc: 39 a7 std Y+41, r19 ; 0x29 10fce: 4a a7 std Y+42, r20 ; 0x2a 10fd0: 5b a7 std Y+43, r21 ; 0x2b float r_axis_y = -offset[Y_AXIS]; 10fd2: d7 01 movw r26, r14 10fd4: c6 01 movw r24, r12 10fd6: b0 58 subi r27, 0x80 ; 128 10fd8: 8c a7 std Y+44, r24 ; 0x2c 10fda: 9d a7 std Y+45, r25 ; 0x2d 10fdc: ae a7 std Y+46, r26 ; 0x2e 10fde: bf a7 std Y+47, r27 ; 0x2f float center_axis_x = start_position[X_AXIS] - r_axis_x; 10fe0: 29 81 ldd r18, Y+1 ; 0x01 10fe2: 3a 81 ldd r19, Y+2 ; 0x02 10fe4: 4b 81 ldd r20, Y+3 ; 0x03 10fe6: 5c 81 ldd r21, Y+4 ; 0x04 10fe8: 28 96 adiw r28, 0x08 ; 8 10fea: 2c af std Y+60, r18 ; 0x3c 10fec: 3d af std Y+61, r19 ; 0x3d 10fee: 4e af std Y+62, r20 ; 0x3e 10ff0: 5f af std Y+63, r21 ; 0x3f 10ff2: 28 97 sbiw r28, 0x08 ; 8 10ff4: c5 01 movw r24, r10 10ff6: b4 01 movw r22, r8 10ff8: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 10ffc: 62 96 adiw r28, 0x12 ; 18 10ffe: 6c af std Y+60, r22 ; 0x3c 11000: 7d af std Y+61, r23 ; 0x3d 11002: 8e af std Y+62, r24 ; 0x3e 11004: 9f af std Y+63, r25 ; 0x3f 11006: 62 97 sbiw r28, 0x12 ; 18 float center_axis_y = start_position[Y_AXIS] - r_axis_y; 11008: 8d 81 ldd r24, Y+5 ; 0x05 1100a: 9e 81 ldd r25, Y+6 ; 0x06 1100c: af 81 ldd r26, Y+7 ; 0x07 1100e: b8 85 ldd r27, Y+8 ; 0x08 11010: 2c 96 adiw r28, 0x0c ; 12 11012: 8c af std Y+60, r24 ; 0x3c 11014: 9d af std Y+61, r25 ; 0x3d 11016: ae af std Y+62, r26 ; 0x3e 11018: bf af std Y+63, r27 ; 0x3f 1101a: 2c 97 sbiw r28, 0x0c ; 12 1101c: 9c 01 movw r18, r24 1101e: ad 01 movw r20, r26 11020: c7 01 movw r24, r14 11022: b6 01 movw r22, r12 11024: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 11028: 66 96 adiw r28, 0x16 ; 22 1102a: 6c af std Y+60, r22 ; 0x3c 1102c: 7d af std Y+61, r23 ; 0x3d 1102e: 8e af std Y+62, r24 ; 0x3e 11030: 9f af std Y+63, r25 ; 0x3f 11032: 66 97 sbiw r28, 0x16 ; 22 float travel_z = target[Z_AXIS] - start_position[Z_AXIS]; 11034: 29 85 ldd r18, Y+9 ; 0x09 11036: 3a 85 ldd r19, Y+10 ; 0x0a 11038: 4b 85 ldd r20, Y+11 ; 0x0b 1103a: 5c 85 ldd r21, Y+12 ; 0x0c 1103c: 60 91 9b 06 lds r22, 0x069B ; 0x80069b 11040: 70 91 9c 06 lds r23, 0x069C ; 0x80069c 11044: 80 91 9d 06 lds r24, 0x069D ; 0x80069d 11048: 90 91 9e 06 lds r25, 0x069E ; 0x80069e 1104c: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 11050: 6a 96 adiw r28, 0x1a ; 26 11052: 6c af std Y+60, r22 ; 0x3c 11054: 7d af std Y+61, r23 ; 0x3d 11056: 8e af std Y+62, r24 ; 0x3e 11058: 9f af std Y+63, r25 ; 0x3f 1105a: 6a 97 sbiw r28, 0x1a ; 26 float rt_x = target[X_AXIS] - center_axis_x; 1105c: 20 91 93 06 lds r18, 0x0693 ; 0x800693 11060: 30 91 94 06 lds r19, 0x0694 ; 0x800694 11064: 40 91 95 06 lds r20, 0x0695 ; 0x800695 11068: 50 91 96 06 lds r21, 0x0696 ; 0x800696 1106c: 6e 96 adiw r28, 0x1e ; 30 1106e: 2c af std Y+60, r18 ; 0x3c 11070: 3d af std Y+61, r19 ; 0x3d 11072: 4e af std Y+62, r20 ; 0x3e 11074: 5f af std Y+63, r21 ; 0x3f 11076: 6e 97 sbiw r28, 0x1e ; 30 11078: 62 96 adiw r28, 0x12 ; 18 1107a: 2c ad ldd r18, Y+60 ; 0x3c 1107c: 3d ad ldd r19, Y+61 ; 0x3d 1107e: 4e ad ldd r20, Y+62 ; 0x3e 11080: 5f ad ldd r21, Y+63 ; 0x3f 11082: 62 97 sbiw r28, 0x12 ; 18 11084: 6e 96 adiw r28, 0x1e ; 30 11086: 6c ad ldd r22, Y+60 ; 0x3c 11088: 7d ad ldd r23, Y+61 ; 0x3d 1108a: 8e ad ldd r24, Y+62 ; 0x3e 1108c: 9f ad ldd r25, Y+63 ; 0x3f 1108e: 6e 97 sbiw r28, 0x1e ; 30 11090: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 11094: 6b 01 movw r12, r22 11096: 7c 01 movw r14, r24 float rt_y = target[Y_AXIS] - center_axis_y; 11098: 80 91 97 06 lds r24, 0x0697 ; 0x800697 1109c: 90 91 98 06 lds r25, 0x0698 ; 0x800698 110a0: a0 91 99 06 lds r26, 0x0699 ; 0x800699 110a4: b0 91 9a 06 lds r27, 0x069A ; 0x80069a 110a8: a2 96 adiw r28, 0x22 ; 34 110aa: 8c af std Y+60, r24 ; 0x3c 110ac: 9d af std Y+61, r25 ; 0x3d 110ae: ae af std Y+62, r26 ; 0x3e 110b0: bf af std Y+63, r27 ; 0x3f 110b2: a2 97 sbiw r28, 0x22 ; 34 110b4: 66 96 adiw r28, 0x16 ; 22 110b6: 2c ad ldd r18, Y+60 ; 0x3c 110b8: 3d ad ldd r19, Y+61 ; 0x3d 110ba: 4e ad ldd r20, Y+62 ; 0x3e 110bc: 5f ad ldd r21, Y+63 ; 0x3f 110be: 66 97 sbiw r28, 0x16 ; 22 110c0: bc 01 movw r22, r24 110c2: cd 01 movw r24, r26 110c4: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 110c8: 4b 01 movw r8, r22 110ca: 5c 01 movw r10, r24 // 20200419 - Add a variable that will be used to hold the arc segment length float mm_per_arc_segment = cs.mm_per_arc_segment; 110cc: 30 90 f6 04 lds r3, 0x04F6 ; 0x8004f6 110d0: 20 90 f7 04 lds r2, 0x04F7 ; 0x8004f7 110d4: 90 91 f8 04 lds r25, 0x04F8 ; 0x8004f8 110d8: 9c ab std Y+52, r25 ; 0x34 110da: a0 91 f9 04 lds r26, 0x04F9 ; 0x8004f9 110de: ac af std Y+60, r26 ; 0x3c // 20210109 - Add a variable to hold the n_arc_correction value unsigned char n_arc_correction = cs.n_arc_correction; 110e0: b0 91 fe 04 lds r27, 0x04FE ; 0x8004fe 110e4: b8 ab std Y+48, r27 ; 0x30 // CCW angle between start_position and target from circle center. Only one atan2() trig computation required. float angular_travel_total = atan2(r_axis_x * rt_y - r_axis_y * rt_x, r_axis_x * rt_x + r_axis_y * rt_y); 110e6: a7 01 movw r20, r14 110e8: 96 01 movw r18, r12 110ea: 68 a5 ldd r22, Y+40 ; 0x28 110ec: 79 a5 ldd r23, Y+41 ; 0x29 110ee: 8a a5 ldd r24, Y+42 ; 0x2a 110f0: 9b a5 ldd r25, Y+43 ; 0x2b 110f2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 110f6: 2b 01 movw r4, r22 110f8: 3c 01 movw r6, r24 110fa: a5 01 movw r20, r10 110fc: 94 01 movw r18, r8 110fe: 6c a5 ldd r22, Y+44 ; 0x2c 11100: 7d a5 ldd r23, Y+45 ; 0x2d 11102: 8e a5 ldd r24, Y+46 ; 0x2e 11104: 9f a5 ldd r25, Y+47 ; 0x2f 11106: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1110a: 9b 01 movw r18, r22 1110c: ac 01 movw r20, r24 1110e: c3 01 movw r24, r6 11110: b2 01 movw r22, r4 11112: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 11116: 2b 01 movw r4, r22 11118: 3c 01 movw r6, r24 1111a: a5 01 movw r20, r10 1111c: 94 01 movw r18, r8 1111e: 68 a5 ldd r22, Y+40 ; 0x28 11120: 79 a5 ldd r23, Y+41 ; 0x29 11122: 8a a5 ldd r24, Y+42 ; 0x2a 11124: 9b a5 ldd r25, Y+43 ; 0x2b 11126: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1112a: 4b 01 movw r8, r22 1112c: 5c 01 movw r10, r24 1112e: a7 01 movw r20, r14 11130: 96 01 movw r18, r12 11132: 6c a5 ldd r22, Y+44 ; 0x2c 11134: 7d a5 ldd r23, Y+45 ; 0x2d 11136: 8e a5 ldd r24, Y+46 ; 0x2e 11138: 9f a5 ldd r25, Y+47 ; 0x2f 1113a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1113e: 9b 01 movw r18, r22 11140: ac 01 movw r20, r24 11142: c5 01 movw r24, r10 11144: b4 01 movw r22, r8 11146: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1114a: a3 01 movw r20, r6 1114c: 92 01 movw r18, r4 1114e: 0f 94 83 a1 call 0x34306 ; 0x34306 11152: 6b 01 movw r12, r22 11154: 7c 01 movw r14, r24 if (angular_travel_total < 0) { angular_travel_total += 2 * M_PI; } 11156: 20 e0 ldi r18, 0x00 ; 0 11158: 30 e0 ldi r19, 0x00 ; 0 1115a: a9 01 movw r20, r18 1115c: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 11160: 87 ff sbrs r24, 7 11162: 0a c0 rjmp .+20 ; 0x11178 11164: 2b ed ldi r18, 0xDB ; 219 11166: 3f e0 ldi r19, 0x0F ; 15 11168: 49 ec ldi r20, 0xC9 ; 201 1116a: 50 e4 ldi r21, 0x40 ; 64 1116c: c7 01 movw r24, r14 1116e: b6 01 movw r22, r12 11170: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 11174: 6b 01 movw r12, r22 11176: 7c 01 movw r14, r24 if (cs.min_arc_segments > 0) 11178: 60 91 ff 04 lds r22, 0x04FF ; 0x8004ff 1117c: 70 91 00 05 lds r23, 0x0500 ; 0x800500 11180: 61 15 cp r22, r1 11182: 71 05 cpc r23, r1 11184: 09 f4 brne .+2 ; 0x11188 11186: 61 c2 rjmp .+1218 ; 0x1164a { // 20200417 - FormerLurker - Implement MIN_ARC_SEGMENTS if it is defined - from Marlin 2.0 implementation // Do this before converting the angular travel for clockwise rotation mm_per_arc_segment = radius * ((2.0f * M_PI) / cs.min_arc_segments); 11188: 90 e0 ldi r25, 0x00 ; 0 1118a: 80 e0 ldi r24, 0x00 ; 0 1118c: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 11190: 9b 01 movw r18, r22 11192: ac 01 movw r20, r24 11194: 6b ed ldi r22, 0xDB ; 219 11196: 7f e0 ldi r23, 0x0F ; 15 11198: 89 ec ldi r24, 0xC9 ; 201 1119a: 90 e4 ldi r25, 0x40 ; 64 1119c: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 111a0: 24 96 adiw r28, 0x04 ; 4 111a2: 2c ad ldd r18, Y+60 ; 0x3c 111a4: 3d ad ldd r19, Y+61 ; 0x3d 111a6: 4e ad ldd r20, Y+62 ; 0x3e 111a8: 5f ad ldd r21, Y+63 ; 0x3f 111aa: 24 97 sbiw r28, 0x04 ; 4 111ac: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 111b0: 5b 01 movw r10, r22 111b2: 8c 01 movw r16, r24 } if (cs.arc_segments_per_sec > 0) 111b4: 60 91 01 05 lds r22, 0x0501 ; 0x800501 111b8: 70 91 02 05 lds r23, 0x0502 ; 0x800502 111bc: 61 15 cp r22, r1 111be: 71 05 cpc r23, r1 111c0: e1 f0 breq .+56 ; 0x111fa { // 20200417 - FormerLurker - Implement MIN_ARC_SEGMENTS if it is defined - from Marlin 2.0 implementation float mm_per_arc_segment_sec = feed_rate / (60.f * float(cs.arc_segments_per_sec)); 111c2: 90 e0 ldi r25, 0x00 ; 0 111c4: 80 e0 ldi r24, 0x00 ; 0 111c6: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 111ca: 20 e0 ldi r18, 0x00 ; 0 111cc: 30 e0 ldi r19, 0x00 ; 0 111ce: 40 e7 ldi r20, 0x70 ; 112 111d0: 52 e4 ldi r21, 0x42 ; 66 111d2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 111d6: 9b 01 movw r18, r22 111d8: ac 01 movw r20, r24 111da: 68 ad ldd r22, Y+56 ; 0x38 111dc: 79 ad ldd r23, Y+57 ; 0x39 111de: 8a ad ldd r24, Y+58 ; 0x3a 111e0: 9b ad ldd r25, Y+59 ; 0x3b 111e2: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 111e6: 3b 01 movw r6, r22 111e8: 4c 01 movw r8, r24 if (mm_per_arc_segment_sec < mm_per_arc_segment) 111ea: 95 01 movw r18, r10 111ec: a8 01 movw r20, r16 111ee: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 111f2: 87 ff sbrs r24, 7 111f4: 02 c0 rjmp .+4 ; 0x111fa mm_per_arc_segment = mm_per_arc_segment_sec; 111f6: 53 01 movw r10, r6 111f8: 84 01 movw r16, r8 } // Note: no need to check to see if min_mm_per_arc_segment is enabled or not (i.e. = 0), since mm_per_arc_segment can never be below 0. if (mm_per_arc_segment < cs.min_mm_per_arc_segment) 111fa: 40 90 fa 04 lds r4, 0x04FA ; 0x8004fa 111fe: 50 90 fb 04 lds r5, 0x04FB ; 0x8004fb 11202: 60 90 fc 04 lds r6, 0x04FC ; 0x8004fc 11206: 70 90 fd 04 lds r7, 0x04FD ; 0x8004fd 1120a: 95 01 movw r18, r10 1120c: a8 01 movw r20, r16 1120e: b2 01 movw r22, r4 11210: c3 01 movw r24, r6 11212: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 11216: 18 16 cp r1, r24 11218: 84 f0 brlt .+32 ; 0x1123a { // 20200417 - FormerLurker - Implement MIN_MM_PER_ARC_SEGMENT if it is defined // This prevents a very high number of segments from being generated for curves of a short radius mm_per_arc_segment = cs.min_mm_per_arc_segment; } else if (mm_per_arc_segment > cs.mm_per_arc_segment) { 1121a: 95 01 movw r18, r10 1121c: a8 01 movw r20, r16 1121e: 63 2d mov r22, r3 11220: 72 2d mov r23, r2 11222: 8c a9 ldd r24, Y+52 ; 0x34 11224: 9c ad ldd r25, Y+60 ; 0x3c 11226: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1122a: 25 01 movw r4, r10 1122c: 38 01 movw r6, r16 1122e: 87 ff sbrs r24, 7 11230: 04 c0 rjmp .+8 ; 0x1123a // 20210113 - This can be implemented in an else if since we can't be below the min AND above the max at the same time. // 20200417 - FormerLurker - Implement MIN_MM_PER_ARC_SEGMENT if it is defined mm_per_arc_segment = cs.mm_per_arc_segment; 11232: 43 2c mov r4, r3 11234: 52 2c mov r5, r2 11236: 6c a8 ldd r6, Y+52 ; 0x34 11238: 7c ac ldd r7, Y+60 ; 0x3c } // Adjust the angular travel if the direction is clockwise if (isclockwise) { angular_travel_total -= 2 * M_PI; } 1123a: a4 96 adiw r28, 0x24 ; 36 1123c: ee ad ldd r30, Y+62 ; 0x3e 1123e: ff ad ldd r31, Y+63 ; 0x3f 11240: a4 97 sbiw r28, 0x24 ; 36 11242: 32 97 sbiw r30, 0x02 ; 2 11244: 51 f4 brne .+20 ; 0x1125a 11246: 2b ed ldi r18, 0xDB ; 219 11248: 3f e0 ldi r19, 0x0F ; 15 1124a: 49 ec ldi r20, 0xC9 ; 201 1124c: 50 e4 ldi r21, 0x40 ; 64 1124e: c7 01 movw r24, r14 11250: b6 01 movw r22, r12 11252: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 11256: 6b 01 movw r12, r22 11258: 7c 01 movw r14, r24 //20141002:full circle for G03 did not work, e.g. G03 X80 Y80 I20 J0 F2000 is giving an Angle of zero so head is not moving //to compensate when start pos = target pos && angle is zero -> angle = 2Pi if (start_position[X_AXIS] == target[X_AXIS] && start_position[Y_AXIS] == target[Y_AXIS] && angular_travel_total == 0) 1125a: 6e 96 adiw r28, 0x1e ; 30 1125c: 2c ad ldd r18, Y+60 ; 0x3c 1125e: 3d ad ldd r19, Y+61 ; 0x3d 11260: 4e ad ldd r20, Y+62 ; 0x3e 11262: 5f ad ldd r21, Y+63 ; 0x3f 11264: 6e 97 sbiw r28, 0x1e ; 30 11266: 28 96 adiw r28, 0x08 ; 8 11268: 6c ad ldd r22, Y+60 ; 0x3c 1126a: 7d ad ldd r23, Y+61 ; 0x3d 1126c: 8e ad ldd r24, Y+62 ; 0x3e 1126e: 9f ad ldd r25, Y+63 ; 0x3f 11270: 28 97 sbiw r28, 0x08 ; 8 11272: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 11276: 81 11 cpse r24, r1 11278: 23 c0 rjmp .+70 ; 0x112c0 1127a: a2 96 adiw r28, 0x22 ; 34 1127c: 2c ad ldd r18, Y+60 ; 0x3c 1127e: 3d ad ldd r19, Y+61 ; 0x3d 11280: 4e ad ldd r20, Y+62 ; 0x3e 11282: 5f ad ldd r21, Y+63 ; 0x3f 11284: a2 97 sbiw r28, 0x22 ; 34 11286: 2c 96 adiw r28, 0x0c ; 12 11288: 6c ad ldd r22, Y+60 ; 0x3c 1128a: 7d ad ldd r23, Y+61 ; 0x3d 1128c: 8e ad ldd r24, Y+62 ; 0x3e 1128e: 9f ad ldd r25, Y+63 ; 0x3f 11290: 2c 97 sbiw r28, 0x0c ; 12 11292: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 11296: 81 11 cpse r24, r1 11298: 13 c0 rjmp .+38 ; 0x112c0 1129a: 20 e0 ldi r18, 0x00 ; 0 1129c: 30 e0 ldi r19, 0x00 ; 0 1129e: a9 01 movw r20, r18 112a0: c7 01 movw r24, r14 112a2: b6 01 movw r22, r12 112a4: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 112a8: 81 11 cpse r24, r1 112aa: 0a c0 rjmp .+20 ; 0x112c0 { angular_travel_total += 2 * M_PI; 112ac: 2b ed ldi r18, 0xDB ; 219 112ae: 3f e0 ldi r19, 0x0F ; 15 112b0: 49 ec ldi r20, 0xC9 ; 201 112b2: 50 e4 ldi r21, 0x40 ; 64 112b4: c7 01 movw r24, r14 112b6: b6 01 movw r22, r12 112b8: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 112bc: 6b 01 movw r12, r22 112be: 7c 01 movw r14, r24 } //end fix G03 // 20200417 - FormerLurker - rename millimeters_of_travel to millimeters_of_travel_arc to better describe what we are // calculating here const float millimeters_of_travel_arc = hypot(angular_travel_total * radius, fabs(travel_z)); 112c0: a7 01 movw r20, r14 112c2: 96 01 movw r18, r12 112c4: 24 96 adiw r28, 0x04 ; 4 112c6: 6c ad ldd r22, Y+60 ; 0x3c 112c8: 7d ad ldd r23, Y+61 ; 0x3d 112ca: 8e ad ldd r24, Y+62 ; 0x3e 112cc: 9f ad ldd r25, Y+63 ; 0x3f 112ce: 24 97 sbiw r28, 0x04 ; 4 112d0: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 112d4: 6a 96 adiw r28, 0x1a ; 26 112d6: 2c ad ldd r18, Y+60 ; 0x3c 112d8: 3d ad ldd r19, Y+61 ; 0x3d 112da: 4e ad ldd r20, Y+62 ; 0x3e 112dc: 5f ad ldd r21, Y+63 ; 0x3f 112de: 6a 97 sbiw r28, 0x1a ; 26 112e0: 0f 94 a0 a3 call 0x34740 ; 0x34740 112e4: 4b 01 movw r8, r22 112e6: 5c 01 movw r10, r24 if (millimeters_of_travel_arc < 0.001) { return; } 112e8: 2f e6 ldi r18, 0x6F ; 111 112ea: 32 e1 ldi r19, 0x12 ; 18 112ec: 43 e8 ldi r20, 0x83 ; 131 112ee: 5a e3 ldi r21, 0x3A ; 58 112f0: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 112f4: 87 fd sbrc r24, 7 112f6: 9e c1 rjmp .+828 ; 0x11634 // Calculate the number of arc segments unsigned short segments = static_cast(ceil(millimeters_of_travel_arc / mm_per_arc_segment)); 112f8: 92 01 movw r18, r4 112fa: a3 01 movw r20, r6 112fc: c5 01 movw r24, r10 112fe: b4 01 movw r22, r8 11300: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 11304: 0f 94 e2 a1 call 0x343c4 ; 0x343c4 11308: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 1130c: 7d ab std Y+53, r23 ; 0x35 1130e: 6c ab std Y+52, r22 ; 0x34 Finding a faster way to approximate sin, knowing that there can be substantial deviations from the true arc when using the previous approximation, would be beneficial. */ // If there is only one segment, no need to do a bunch of work since this is a straight line! if (segments > 1 && start_segment_idx) 11310: 62 30 cpi r22, 0x02 ; 2 11312: 71 05 cpc r23, r1 11314: 08 f4 brcc .+2 ; 0x11318 11316: 5e c1 rjmp .+700 ; 0x115d4 11318: 2e 96 adiw r28, 0x0e ; 14 1131a: 4e ad ldd r20, Y+62 ; 0x3e 1131c: 5f ad ldd r21, Y+63 ; 0x3f 1131e: 2e 97 sbiw r28, 0x0e ; 14 11320: 45 2b or r20, r21 11322: 09 f4 brne .+2 ; 0x11326 11324: 57 c1 rjmp .+686 ; 0x115d4 { // Calculate theta per segments, and linear (z) travel per segment, e travel per segment // as well as the small angle approximation for sin and cos. const float theta_per_segment = angular_travel_total / segments, 11326: 90 e0 ldi r25, 0x00 ; 0 11328: 80 e0 ldi r24, 0x00 ; 0 1132a: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 1132e: 4b 01 movw r8, r22 11330: 5c 01 movw r10, r24 11332: ac 01 movw r20, r24 11334: 9b 01 movw r18, r22 11336: c7 01 movw r24, r14 11338: b6 01 movw r22, r12 1133a: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1133e: 2b 01 movw r4, r22 11340: 3c 01 movw r6, r24 linear_per_segment = travel_z / (segments), 11342: a5 01 movw r20, r10 11344: 94 01 movw r18, r8 11346: 6a 96 adiw r28, 0x1a ; 26 11348: 6c ad ldd r22, Y+60 ; 0x3c 1134a: 7d ad ldd r23, Y+61 ; 0x3d 1134c: 8e ad ldd r24, Y+62 ; 0x3e 1134e: 9f ad ldd r25, Y+63 ; 0x3f 11350: 6a 97 sbiw r28, 0x1a ; 26 11352: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 11356: 28 96 adiw r28, 0x08 ; 8 11358: 6c af std Y+60, r22 ; 0x3c 1135a: 7d af std Y+61, r23 ; 0x3d 1135c: 8e af std Y+62, r24 ; 0x3e 1135e: 9f af std Y+63, r25 ; 0x3f 11360: 28 97 sbiw r28, 0x08 ; 8 segment_extruder_travel = (target[E_AXIS] - start_position[E_AXIS]) / (segments), 11362: 2d 85 ldd r18, Y+13 ; 0x0d 11364: 3e 85 ldd r19, Y+14 ; 0x0e 11366: 4f 85 ldd r20, Y+15 ; 0x0f 11368: 58 89 ldd r21, Y+16 ; 0x10 1136a: 60 91 9f 06 lds r22, 0x069F ; 0x80069f 1136e: 70 91 a0 06 lds r23, 0x06A0 ; 0x8006a0 11372: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 11376: 90 91 a2 06 lds r25, 0x06A2 ; 0x8006a2 1137a: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1137e: a5 01 movw r20, r10 11380: 94 01 movw r18, r8 11382: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 11386: 2c 96 adiw r28, 0x0c ; 12 11388: 6c af std Y+60, r22 ; 0x3c 1138a: 7d af std Y+61, r23 ; 0x3d 1138c: 8e af std Y+62, r24 ; 0x3e 1138e: 9f af std Y+63, r25 ; 0x3f 11390: 2c 97 sbiw r28, 0x0c ; 12 sq_theta_per_segment = theta_per_segment * theta_per_segment, 11392: a3 01 movw r20, r6 11394: 92 01 movw r18, r4 11396: c3 01 movw r24, r6 11398: b2 01 movw r22, r4 1139a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1139e: 6b 01 movw r12, r22 113a0: 7c 01 movw r14, r24 sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6, 113a2: ac 01 movw r20, r24 113a4: 9b 01 movw r18, r22 113a6: c3 01 movw r24, r6 113a8: b2 01 movw r22, r4 113aa: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 113ae: 20 e0 ldi r18, 0x00 ; 0 113b0: 30 e0 ldi r19, 0x00 ; 0 113b2: 40 ec ldi r20, 0xC0 ; 192 113b4: 50 e4 ldi r21, 0x40 ; 64 113b6: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 113ba: 9b 01 movw r18, r22 113bc: ac 01 movw r20, r24 113be: c3 01 movw r24, r6 113c0: b2 01 movw r22, r4 113c2: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 113c6: 6c af std Y+60, r22 ; 0x3c 113c8: 7d af std Y+61, r23 ; 0x3d 113ca: 8e af std Y+62, r24 ; 0x3e 113cc: 9f af std Y+63, r25 ; 0x3f cos_T = 1 - 0.5f * sq_theta_per_segment; 113ce: 20 e0 ldi r18, 0x00 ; 0 113d0: 30 e0 ldi r19, 0x00 ; 0 113d2: 40 e0 ldi r20, 0x00 ; 0 113d4: 5f e3 ldi r21, 0x3F ; 63 113d6: c7 01 movw r24, r14 113d8: b6 01 movw r22, r12 113da: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 113de: 9b 01 movw r18, r22 113e0: ac 01 movw r20, r24 113e2: 60 e0 ldi r22, 0x00 ; 0 113e4: 70 e0 ldi r23, 0x00 ; 0 113e6: 80 e8 ldi r24, 0x80 ; 128 113e8: 9f e3 ldi r25, 0x3F ; 63 113ea: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 113ee: 24 96 adiw r28, 0x04 ; 4 113f0: 6c af std Y+60, r22 ; 0x3c 113f2: 7d af std Y+61, r23 ; 0x3d 113f4: 8e af std Y+62, r24 ; 0x3e 113f6: 9f af std Y+63, r25 ; 0x3f 113f8: 24 97 sbiw r28, 0x04 ; 4 // Loop through all but one of the segments. The last one can be done simply // by moving to the target. for (uint16_t i = 1; i < segments; i++) { 113fa: 22 24 eor r2, r2 113fc: 23 94 inc r2 113fe: 31 2c mov r3, r1 if (n_arc_correction-- == 0) { 11400: d8 a8 ldd r13, Y+48 ; 0x30 11402: da 94 dec r13 11404: 58 a9 ldd r21, Y+48 ; 0x30 11406: 51 11 cpse r21, r1 11408: 25 c1 rjmp .+586 ; 0x11654 // Calculate the actual position for r_axis_x and r_axis_y const float cos_Ti = cos(i * theta_per_segment), sin_Ti = sin(i * theta_per_segment); 1140a: b1 01 movw r22, r2 1140c: 90 e0 ldi r25, 0x00 ; 0 1140e: 80 e0 ldi r24, 0x00 ; 0 11410: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 11414: a3 01 movw r20, r6 11416: 92 01 movw r18, r4 11418: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1141c: 6b 01 movw r12, r22 1141e: 7c 01 movw r14, r24 11420: 0f 94 fe a1 call 0x343fc ; 0x343fc 11424: 6c a7 std Y+44, r22 ; 0x2c 11426: 7d a7 std Y+45, r23 ; 0x2d 11428: 8e a7 std Y+46, r24 ; 0x2e 1142a: 9f a7 std Y+47, r25 ; 0x2f 1142c: c7 01 movw r24, r14 1142e: b6 01 movw r22, r12 11430: 0f 94 c4 a4 call 0x34988 ; 0x34988 11434: 4b 01 movw r8, r22 11436: 5c 01 movw r10, r24 r_axis_x = -offset[X_AXIS] * cos_Ti + offset[Y_AXIS] * sin_Ti; 11438: c0 90 4f 03 lds r12, 0x034F ; 0x80034f 1143c: d0 90 50 03 lds r13, 0x0350 ; 0x800350 11440: e0 90 51 03 lds r14, 0x0351 ; 0x800351 11444: f0 90 52 03 lds r15, 0x0352 ; 0x800352 11448: f7 fa bst r15, 7 1144a: f0 94 com r15 1144c: f7 f8 bld r15, 7 1144e: f0 94 com r15 11450: 80 91 53 03 lds r24, 0x0353 ; 0x800353 11454: 90 91 54 03 lds r25, 0x0354 ; 0x800354 11458: a0 91 55 03 lds r26, 0x0355 ; 0x800355 1145c: b0 91 56 03 lds r27, 0x0356 ; 0x800356 11460: 88 ab std Y+48, r24 ; 0x30 11462: 99 ab std Y+49, r25 ; 0x31 11464: aa ab std Y+50, r26 ; 0x32 11466: bb ab std Y+51, r27 ; 0x33 11468: a7 01 movw r20, r14 1146a: 96 01 movw r18, r12 1146c: 6c a5 ldd r22, Y+44 ; 0x2c 1146e: 7d a5 ldd r23, Y+45 ; 0x2d 11470: 8e a5 ldd r24, Y+46 ; 0x2e 11472: 9f a5 ldd r25, Y+47 ; 0x2f 11474: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 11478: 68 a7 std Y+40, r22 ; 0x28 1147a: 79 a7 std Y+41, r23 ; 0x29 1147c: 8a a7 std Y+42, r24 ; 0x2a 1147e: 9b a7 std Y+43, r25 ; 0x2b 11480: 28 a9 ldd r18, Y+48 ; 0x30 11482: 39 a9 ldd r19, Y+49 ; 0x31 11484: 4a a9 ldd r20, Y+50 ; 0x32 11486: 5b a9 ldd r21, Y+51 ; 0x33 11488: c5 01 movw r24, r10 1148a: b4 01 movw r22, r8 1148c: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 11490: 9b 01 movw r18, r22 11492: ac 01 movw r20, r24 11494: 68 a5 ldd r22, Y+40 ; 0x28 11496: 79 a5 ldd r23, Y+41 ; 0x29 11498: 8a a5 ldd r24, Y+42 ; 0x2a 1149a: 9b a5 ldd r25, Y+43 ; 0x2b 1149c: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 114a0: 68 a7 std Y+40, r22 ; 0x28 114a2: 79 a7 std Y+41, r23 ; 0x29 114a4: 8a a7 std Y+42, r24 ; 0x2a 114a6: 9b a7 std Y+43, r25 ; 0x2b r_axis_y = -offset[X_AXIS] * sin_Ti - offset[Y_AXIS] * cos_Ti; 114a8: a7 01 movw r20, r14 114aa: 96 01 movw r18, r12 114ac: c5 01 movw r24, r10 114ae: b4 01 movw r22, r8 114b0: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 114b4: 6b 01 movw r12, r22 114b6: 7c 01 movw r14, r24 114b8: 28 a9 ldd r18, Y+48 ; 0x30 114ba: 39 a9 ldd r19, Y+49 ; 0x31 114bc: 4a a9 ldd r20, Y+50 ; 0x32 114be: 5b a9 ldd r21, Y+51 ; 0x33 114c0: 6c a5 ldd r22, Y+44 ; 0x2c 114c2: 7d a5 ldd r23, Y+45 ; 0x2d 114c4: 8e a5 ldd r24, Y+46 ; 0x2e 114c6: 9f a5 ldd r25, Y+47 ; 0x2f 114c8: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 114cc: 9b 01 movw r18, r22 114ce: ac 01 movw r20, r24 114d0: c7 01 movw r24, r14 114d2: b6 01 movw r22, r12 114d4: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 114d8: 6c a7 std Y+44, r22 ; 0x2c 114da: 7d a7 std Y+45, r23 ; 0x2d 114dc: 8e a7 std Y+46, r24 ; 0x2e 114de: 9f a7 std Y+47, r25 ; 0x2f // reset n_arc_correction n_arc_correction = cs.n_arc_correction; 114e0: 90 91 fe 04 lds r25, 0x04FE ; 0x8004fe 114e4: 98 ab std Y+48, r25 ; 0x30 r_axis_x = r_axis_x * cos_T - r_axis_y * sin_T; r_axis_y = r_axisi; } // Update Position start_position[X_AXIS] = center_axis_x + r_axis_x; 114e6: 28 a5 ldd r18, Y+40 ; 0x28 114e8: 39 a5 ldd r19, Y+41 ; 0x29 114ea: 4a a5 ldd r20, Y+42 ; 0x2a 114ec: 5b a5 ldd r21, Y+43 ; 0x2b 114ee: 62 96 adiw r28, 0x12 ; 18 114f0: 6c ad ldd r22, Y+60 ; 0x3c 114f2: 7d ad ldd r23, Y+61 ; 0x3d 114f4: 8e ad ldd r24, Y+62 ; 0x3e 114f6: 9f ad ldd r25, Y+63 ; 0x3f 114f8: 62 97 sbiw r28, 0x12 ; 18 114fa: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 114fe: 69 83 std Y+1, r22 ; 0x01 11500: 7a 83 std Y+2, r23 ; 0x02 11502: 8b 83 std Y+3, r24 ; 0x03 11504: 9c 83 std Y+4, r25 ; 0x04 start_position[Y_AXIS] = center_axis_y + r_axis_y; 11506: 2c a5 ldd r18, Y+44 ; 0x2c 11508: 3d a5 ldd r19, Y+45 ; 0x2d 1150a: 4e a5 ldd r20, Y+46 ; 0x2e 1150c: 5f a5 ldd r21, Y+47 ; 0x2f 1150e: 66 96 adiw r28, 0x16 ; 22 11510: 6c ad ldd r22, Y+60 ; 0x3c 11512: 7d ad ldd r23, Y+61 ; 0x3d 11514: 8e ad ldd r24, Y+62 ; 0x3e 11516: 9f ad ldd r25, Y+63 ; 0x3f 11518: 66 97 sbiw r28, 0x16 ; 22 1151a: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1151e: 6d 83 std Y+5, r22 ; 0x05 11520: 7e 83 std Y+6, r23 ; 0x06 11522: 8f 83 std Y+7, r24 ; 0x07 11524: 98 87 std Y+8, r25 ; 0x08 start_position[Z_AXIS] += linear_per_segment; 11526: 28 96 adiw r28, 0x08 ; 8 11528: 2c ad ldd r18, Y+60 ; 0x3c 1152a: 3d ad ldd r19, Y+61 ; 0x3d 1152c: 4e ad ldd r20, Y+62 ; 0x3e 1152e: 5f ad ldd r21, Y+63 ; 0x3f 11530: 28 97 sbiw r28, 0x08 ; 8 11532: 69 85 ldd r22, Y+9 ; 0x09 11534: 7a 85 ldd r23, Y+10 ; 0x0a 11536: 8b 85 ldd r24, Y+11 ; 0x0b 11538: 9c 85 ldd r25, Y+12 ; 0x0c 1153a: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1153e: 69 87 std Y+9, r22 ; 0x09 11540: 7a 87 std Y+10, r23 ; 0x0a 11542: 8b 87 std Y+11, r24 ; 0x0b 11544: 9c 87 std Y+12, r25 ; 0x0c start_position[E_AXIS] += segment_extruder_travel; 11546: 2c 96 adiw r28, 0x0c ; 12 11548: 2c ad ldd r18, Y+60 ; 0x3c 1154a: 3d ad ldd r19, Y+61 ; 0x3d 1154c: 4e ad ldd r20, Y+62 ; 0x3e 1154e: 5f ad ldd r21, Y+63 ; 0x3f 11550: 2c 97 sbiw r28, 0x0c ; 12 11552: 6d 85 ldd r22, Y+13 ; 0x0d 11554: 7e 85 ldd r23, Y+14 ; 0x0e 11556: 8f 85 ldd r24, Y+15 ; 0x0f 11558: 98 89 ldd r25, Y+16 ; 0x10 1155a: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1155e: 6d 87 std Y+13, r22 ; 0x0d 11560: 7e 87 std Y+14, r23 ; 0x0e 11562: 8f 87 std Y+15, r24 ; 0x0f 11564: 98 8b std Y+16, r25 ; 0x10 // Clamp to the calculated position. clamp_to_software_endstops(start_position); 11566: ce 01 movw r24, r28 11568: 01 96 adiw r24, 0x01 ; 1 1156a: 0e 94 c5 64 call 0xc98a ; 0xc98a // Insert the segment into the buffer if (i >= start_segment_idx) 1156e: 2e 96 adiw r28, 0x0e ; 14 11570: ae ad ldd r26, Y+62 ; 0x3e 11572: bf ad ldd r27, Y+63 ; 0x3f 11574: 2e 97 sbiw r28, 0x0e ; 14 11576: 2a 16 cp r2, r26 11578: 3b 06 cpc r3, r27 1157a: f8 f0 brcs .+62 ; 0x115ba plan_buffer_line(start_position[X_AXIS], start_position[Y_AXIS], start_position[Z_AXIS], start_position[E_AXIS], feed_rate, position, i); 1157c: e9 84 ldd r14, Y+9 ; 0x09 1157e: fa 84 ldd r15, Y+10 ; 0x0a 11580: 0b 85 ldd r16, Y+11 ; 0x0b 11582: 1c 85 ldd r17, Y+12 ; 0x0c 11584: 2d 81 ldd r18, Y+5 ; 0x05 11586: 3e 81 ldd r19, Y+6 ; 0x06 11588: 4f 81 ldd r20, Y+7 ; 0x07 1158a: 58 85 ldd r21, Y+8 ; 0x08 1158c: 69 81 ldd r22, Y+1 ; 0x01 1158e: 7a 81 ldd r23, Y+2 ; 0x02 11590: 8b 81 ldd r24, Y+3 ; 0x03 11592: 9c 81 ldd r25, Y+4 ; 0x04 11594: 3f 92 push r3 11596: 2f 92 push r2 11598: e5 ef ldi r30, 0xF5 ; 245 1159a: f1 e1 ldi r31, 0x11 ; 17 1159c: ff 93 push r31 1159e: ef 93 push r30 115a0: 88 ac ldd r8, Y+56 ; 0x38 115a2: 99 ac ldd r9, Y+57 ; 0x39 115a4: aa ac ldd r10, Y+58 ; 0x3a 115a6: bb ac ldd r11, Y+59 ; 0x3b 115a8: fe 01 movw r30, r28 115aa: 3d 96 adiw r30, 0x0d ; 13 115ac: 6f 01 movw r12, r30 115ae: 0f 94 22 75 call 0x2ea44 ; 0x2ea44 115b2: 0f 90 pop r0 115b4: 0f 90 pop r0 115b6: 0f 90 pop r0 115b8: 0f 90 pop r0 // Handle the situation where the planner is aborted hard. if (planner_aborted) 115ba: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 115be: 81 11 cpse r24, r1 115c0: 39 c0 rjmp .+114 ; 0x11634 sq_theta_per_segment = theta_per_segment * theta_per_segment, sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6, cos_T = 1 - 0.5f * sq_theta_per_segment; // Loop through all but one of the segments. The last one can be done simply // by moving to the target. for (uint16_t i = 1; i < segments; i++) { 115c2: ff ef ldi r31, 0xFF ; 255 115c4: 2f 1a sub r2, r31 115c6: 3f 0a sbc r3, r31 115c8: 2c a9 ldd r18, Y+52 ; 0x34 115ca: 3d a9 ldd r19, Y+53 ; 0x35 115cc: 22 15 cp r18, r2 115ce: 33 05 cpc r19, r3 115d0: 09 f0 breq .+2 ; 0x115d4 115d2: 16 cf rjmp .-468 ; 0x11400 if (planner_aborted) return; } } // Clamp to the target position. clamp_to_software_endstops(target); 115d4: 83 e9 ldi r24, 0x93 ; 147 115d6: 96 e0 ldi r25, 0x06 ; 6 115d8: 0e 94 c5 64 call 0xc98a ; 0xc98a // Ensure last segment arrives at target location. plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], feed_rate, position, 0); 115dc: e0 90 9b 06 lds r14, 0x069B ; 0x80069b 115e0: f0 90 9c 06 lds r15, 0x069C ; 0x80069c 115e4: 00 91 9d 06 lds r16, 0x069D ; 0x80069d 115e8: 10 91 9e 06 lds r17, 0x069E ; 0x80069e 115ec: 20 91 97 06 lds r18, 0x0697 ; 0x800697 115f0: 30 91 98 06 lds r19, 0x0698 ; 0x800698 115f4: 40 91 99 06 lds r20, 0x0699 ; 0x800699 115f8: 50 91 9a 06 lds r21, 0x069A ; 0x80069a 115fc: 60 91 93 06 lds r22, 0x0693 ; 0x800693 11600: 70 91 94 06 lds r23, 0x0694 ; 0x800694 11604: 80 91 95 06 lds r24, 0x0695 ; 0x800695 11608: 90 91 96 06 lds r25, 0x0696 ; 0x800696 1160c: 1f 92 push r1 1160e: 1f 92 push r1 11610: e5 ef ldi r30, 0xF5 ; 245 11612: f1 e1 ldi r31, 0x11 ; 17 11614: ff 93 push r31 11616: ef 93 push r30 11618: 88 ac ldd r8, Y+56 ; 0x38 1161a: 99 ac ldd r9, Y+57 ; 0x39 1161c: aa ac ldd r10, Y+58 ; 0x3a 1161e: bb ac ldd r11, Y+59 ; 0x3b 11620: ef e9 ldi r30, 0x9F ; 159 11622: ce 2e mov r12, r30 11624: e6 e0 ldi r30, 0x06 ; 6 11626: de 2e mov r13, r30 11628: 0f 94 22 75 call 0x2ea44 ; 0x2ea44 1162c: 0f 90 pop r0 1162e: 0f 90 pop r0 11630: 0f 90 pop r0 11632: 0f 90 pop r0 // As far as the parser is concerned, the position is now == target. In reality the // motion control system might still be processing the action and the real tool position // in any intermediate location. set_current_to_destination(); 11634: 0e 94 ac 54 call 0xa958 ; 0xa958 previous_millis_cmd.start(); 11638: 8a e4 ldi r24, 0x4A ; 74 1163a: 93 e0 ldi r25, 0x03 ; 3 1163c: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> 11640: 4d cc rjmp .-1894 ; 0x10edc get_coordinates(); // For X Y Z E F #ifdef SF_ARC_FIX relative_mode=relative_mode_backup; #endif offset[0] = code_seen('I') ? code_value() : 0.f; 11642: 60 e0 ldi r22, 0x00 ; 0 11644: 70 e0 ldi r23, 0x00 ; 0 11646: cb 01 movw r24, r22 11648: 5e cc rjmp .-1860 ; 0x10f06 float center_axis_y = start_position[Y_AXIS] - r_axis_y; float travel_z = target[Z_AXIS] - start_position[Z_AXIS]; float rt_x = target[X_AXIS] - center_axis_x; float rt_y = target[Y_AXIS] - center_axis_y; // 20200419 - Add a variable that will be used to hold the arc segment length float mm_per_arc_segment = cs.mm_per_arc_segment; 1164a: a3 2c mov r10, r3 1164c: b2 2c mov r11, r2 1164e: 0c a9 ldd r16, Y+52 ; 0x34 11650: 1c ad ldd r17, Y+60 ; 0x3c 11652: b0 cd rjmp .-1184 ; 0x111b4 // reset n_arc_correction n_arc_correction = cs.n_arc_correction; } else { // Calculate X and Y using the small angle approximation const float r_axisi = r_axis_x * sin_T + r_axis_y * cos_T; 11654: 28 a5 ldd r18, Y+40 ; 0x28 11656: 39 a5 ldd r19, Y+41 ; 0x29 11658: 4a a5 ldd r20, Y+42 ; 0x2a 1165a: 5b a5 ldd r21, Y+43 ; 0x2b 1165c: 6c ad ldd r22, Y+60 ; 0x3c 1165e: 7d ad ldd r23, Y+61 ; 0x3d 11660: 8e ad ldd r24, Y+62 ; 0x3e 11662: 9f ad ldd r25, Y+63 ; 0x3f 11664: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 11668: 4b 01 movw r8, r22 1166a: 5c 01 movw r10, r24 1166c: 2c a5 ldd r18, Y+44 ; 0x2c 1166e: 3d a5 ldd r19, Y+45 ; 0x2d 11670: 4e a5 ldd r20, Y+46 ; 0x2e 11672: 5f a5 ldd r21, Y+47 ; 0x2f 11674: 24 96 adiw r28, 0x04 ; 4 11676: 6c ad ldd r22, Y+60 ; 0x3c 11678: 7d ad ldd r23, Y+61 ; 0x3d 1167a: 8e ad ldd r24, Y+62 ; 0x3e 1167c: 9f ad ldd r25, Y+63 ; 0x3f 1167e: 24 97 sbiw r28, 0x04 ; 4 11680: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 11684: 9b 01 movw r18, r22 11686: ac 01 movw r20, r24 11688: c5 01 movw r24, r10 1168a: b4 01 movw r22, r8 1168c: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 11690: 7b 01 movw r14, r22 11692: 8c 01 movw r16, r24 r_axis_x = r_axis_x * cos_T - r_axis_y * sin_T; 11694: 28 a5 ldd r18, Y+40 ; 0x28 11696: 39 a5 ldd r19, Y+41 ; 0x29 11698: 4a a5 ldd r20, Y+42 ; 0x2a 1169a: 5b a5 ldd r21, Y+43 ; 0x2b 1169c: 24 96 adiw r28, 0x04 ; 4 1169e: 6c ad ldd r22, Y+60 ; 0x3c 116a0: 7d ad ldd r23, Y+61 ; 0x3d 116a2: 8e ad ldd r24, Y+62 ; 0x3e 116a4: 9f ad ldd r25, Y+63 ; 0x3f 116a6: 24 97 sbiw r28, 0x04 ; 4 116a8: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 116ac: 4b 01 movw r8, r22 116ae: 5c 01 movw r10, r24 116b0: 2c a5 ldd r18, Y+44 ; 0x2c 116b2: 3d a5 ldd r19, Y+45 ; 0x2d 116b4: 4e a5 ldd r20, Y+46 ; 0x2e 116b6: 5f a5 ldd r21, Y+47 ; 0x2f 116b8: 6c ad ldd r22, Y+60 ; 0x3c 116ba: 7d ad ldd r23, Y+61 ; 0x3d 116bc: 8e ad ldd r24, Y+62 ; 0x3e 116be: 9f ad ldd r25, Y+63 ; 0x3f 116c0: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 116c4: 9b 01 movw r18, r22 116c6: ac 01 movw r20, r24 116c8: c5 01 movw r24, r10 116ca: b4 01 movw r22, r8 116cc: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 116d0: 68 a7 std Y+40, r22 ; 0x28 116d2: 79 a7 std Y+41, r23 ; 0x29 116d4: 8a a7 std Y+42, r24 ; 0x2a 116d6: 9b a7 std Y+43, r25 ; 0x2b 116d8: d8 aa std Y+48, r13 ; 0x30 r_axis_y = r_axisi; 116da: c7 01 movw r24, r14 116dc: d8 01 movw r26, r16 116de: 8c a7 std Y+44, r24 ; 0x2c 116e0: 9d a7 std Y+45, r25 ; 0x2d 116e2: ae a7 std Y+46, r26 ; 0x2e 116e4: bf a7 std Y+47, r27 ; 0x2f 116e6: ff ce rjmp .-514 ; 0x114e6 - `S` - Time to wait, in seconds */ case 4: codenum = 0; if(code_seen('P')) codenum = code_value(); // milliseconds to wait 116e8: 80 e5 ldi r24, 0x50 ; 80 116ea: 0e 94 2b 55 call 0xaa56 ; 0xaa56 - `P` - Time to wait, in milliseconds - `S` - Time to wait, in seconds */ case 4: codenum = 0; 116ee: c1 2c mov r12, r1 116f0: d1 2c mov r13, r1 116f2: 76 01 movw r14, r12 if(code_seen('P')) codenum = code_value(); // milliseconds to wait 116f4: 88 23 and r24, r24 116f6: 31 f0 breq .+12 ; 0x11704 116f8: 0e 94 03 5a call 0xb406 ; 0xb406 116fc: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 11700: 6b 01 movw r12, r22 11702: 7c 01 movw r14, r24 if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait 11704: 83 e5 ldi r24, 0x53 ; 83 11706: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1170a: 88 23 and r24, r24 1170c: 61 f0 breq .+24 ; 0x11726 1170e: 0e 94 03 5a call 0xb406 ; 0xb406 11712: 20 e0 ldi r18, 0x00 ; 0 11714: 30 e0 ldi r19, 0x00 ; 0 11716: 4a e7 ldi r20, 0x7A ; 122 11718: 54 e4 ldi r21, 0x44 ; 68 1171a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1171e: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 11722: 6b 01 movw r12, r22 11724: 7c 01 movw r14, r24 if(codenum != 0) 11726: c1 14 cp r12, r1 11728: d1 04 cpc r13, r1 1172a: e1 04 cpc r14, r1 1172c: f1 04 cpc r15, r1 1172e: 41 f0 breq .+16 ; 0x11740 { if(custom_message_type != CustomMsg::M117) 11730: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 11734: 87 30 cpi r24, 0x07 ; 7 11736: 21 f0 breq .+8 ; 0x11740 { LCD_MESSAGERPGM(_n("Sleep..."));////MSG_DWELL 11738: 8d e1 ldi r24, 0x1D ; 29 1173a: 97 e6 ldi r25, 0x67 ; 103 1173c: 0e 94 65 e6 call 0x1ccca ; 0x1ccca } } st_synchronize(); 11740: 0f 94 42 22 call 0x24484 ; 0x24484 codenum += _millis(); // keep track of when we started waiting 11744: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 11748: c6 0e add r12, r22 1174a: d7 1e adc r13, r23 1174c: e8 1e adc r14, r24 1174e: f9 1e adc r15, r25 previous_millis_cmd.start(); 11750: 8a e4 ldi r24, 0x4A ; 74 11752: 93 e0 ldi r25, 0x03 ; 3 11754: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> while(_millis() < codenum) { 11758: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 1175c: 6c 15 cp r22, r12 1175e: 7d 05 cpc r23, r13 11760: 8e 05 cpc r24, r14 11762: 9f 05 cpc r25, r15 11764: 08 f0 brcs .+2 ; 0x11768 11766: ba cb rjmp .-2188 ; 0x10edc manage_heater(); 11768: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(); 1176c: 80 e0 ldi r24, 0x00 ; 0 1176e: 0e 94 01 7a call 0xf402 ; 0xf402 lcd_update(0); 11772: 80 e0 ldi r24, 0x00 ; 0 11774: 0e 94 42 69 call 0xd284 ; 0xd284 11778: ef cf rjmp .-34 ; 0x11758 case 10: #if EXTRUDERS > 1 retracted_swap[active_extruder]=(code_seen('S') && code_value_long() == 1); // checks for swap retract argument retract(true,retracted_swap[active_extruder]); #else retract(true); 1177a: 81 e0 ldi r24, 0x01 ; 1 */ case 11: #if EXTRUDERS > 1 retract(false,retracted_swap[active_extruder]); #else retract(false); 1177c: 0e 94 53 be call 0x17ca6 ; 0x17ca6 11780: ad cb rjmp .-2214 ; 0x10edc 11782: 80 e0 ldi r24, 0x00 ; 0 11784: fb cf rjmp .-10 ; 0x1177c { long home_x_value = 0; long home_y_value = 0; long home_z_value = 0; // Which axes should be homed? bool home_x = code_seen(axis_codes[X_AXIS]); 11786: 88 e5 ldi r24, 0x58 ; 88 11788: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1178c: 38 2e mov r3, r24 - `W` - Suppress mesh bed leveling if `X`, `Y` or `Z` are not provided - `C` - Calibrate X and Y origin (home) - Only on MK3/s */ case 28: { long home_x_value = 0; 1178e: 41 2c mov r4, r1 11790: 51 2c mov r5, r1 11792: 32 01 movw r6, r4 long home_y_value = 0; long home_z_value = 0; // Which axes should be homed? bool home_x = code_seen(axis_codes[X_AXIS]); if (home_x) home_x_value = code_value_long(); 11794: 88 23 and r24, r24 11796: 21 f0 breq .+8 ; 0x117a0 11798: 0e 94 93 55 call 0xab26 ; 0xab26 1179c: 2b 01 movw r4, r22 1179e: 3c 01 movw r6, r24 bool home_y = code_seen(axis_codes[Y_AXIS]); 117a0: 89 e5 ldi r24, 0x59 ; 89 117a2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 117a6: 28 2e mov r2, r24 if (home_y) home_y_value = code_value_long(); 117a8: 88 23 and r24, r24 117aa: 71 f1 breq .+92 ; 0x11808 117ac: 0e 94 93 55 call 0xab26 ; 0xab26 117b0: 6c a7 std Y+44, r22 ; 0x2c 117b2: 7d a7 std Y+45, r23 ; 0x2d 117b4: 8e a7 std Y+46, r24 ; 0x2e 117b6: 9f a7 std Y+47, r25 ; 0x2f bool home_z = code_seen(axis_codes[Z_AXIS]); 117b8: 8a e5 ldi r24, 0x5A ; 90 117ba: 0e 94 2b 55 call 0xaa56 ; 0xaa56 117be: d8 2e mov r13, r24 */ case 28: { long home_x_value = 0; long home_y_value = 0; long home_z_value = 0; 117c0: 81 2c mov r8, r1 117c2: 91 2c mov r9, r1 117c4: 54 01 movw r10, r8 bool home_x = code_seen(axis_codes[X_AXIS]); if (home_x) home_x_value = code_value_long(); bool home_y = code_seen(axis_codes[Y_AXIS]); if (home_y) home_y_value = code_value_long(); bool home_z = code_seen(axis_codes[Z_AXIS]); if (home_z) home_z_value = code_value_long(); 117c6: 88 23 and r24, r24 117c8: 21 f0 breq .+8 ; 0x117d2 117ca: 0e 94 93 55 call 0xab26 ; 0xab26 117ce: 4b 01 movw r8, r22 117d0: 5c 01 movw r10, r24 bool without_mbl = code_seen('W'); 117d2: 87 e5 ldi r24, 0x57 ; 87 117d4: 0e 94 2b 55 call 0xaa56 ; 0xaa56 117d8: 88 a7 std Y+40, r24 ; 0x28 // calibrate? #ifdef TMC2130 bool calib = code_seen('C'); gcode_G28(home_x, home_x_value, home_y, home_y_value, home_z, home_z_value, calib, without_mbl); #else gcode_G28(home_x, home_x_value, home_y, home_y_value, home_z, home_z_value, without_mbl); 117da: 8f 93 push r24 117dc: cd 2c mov r12, r13 117de: ec a4 ldd r14, Y+44 ; 0x2c 117e0: fd a4 ldd r15, Y+45 ; 0x2d 117e2: 0e a5 ldd r16, Y+46 ; 0x2e 117e4: 1f a5 ldd r17, Y+47 ; 0x2f 117e6: 22 2d mov r18, r2 117e8: b3 01 movw r22, r6 117ea: a2 01 movw r20, r4 117ec: 83 2d mov r24, r3 117ee: 0e 94 73 67 call 0xcee6 ; 0xcee6 #endif //TMC2130 if ((home_x || home_y || without_mbl || home_z) == false) { 117f2: 0f 90 pop r0 117f4: 31 10 cpse r3, r1 117f6: 72 cb rjmp .-2332 ; 0x10edc 117f8: 21 10 cpse r2, r1 117fa: 70 cb rjmp .-2336 ; 0x10edc 117fc: 38 a5 ldd r19, Y+40 ; 0x28 117fe: 31 11 cpse r19, r1 11800: 6d cb rjmp .-2342 ; 0x10edc 11802: d1 10 cpse r13, r1 11804: 6b cb rjmp .-2346 ; 0x10edc 11806: 20 cb rjmp .-2496 ; 0x10e48 - `C` - Calibrate X and Y origin (home) - Only on MK3/s */ case 28: { long home_x_value = 0; long home_y_value = 0; 11808: 1c a6 std Y+44, r1 ; 0x2c 1180a: 1d a6 std Y+45, r1 ; 0x2d 1180c: 1e a6 std Y+46, r1 ; 0x2e 1180e: 1f a6 std Y+47, r1 ; 0x2f 11810: d3 cf rjmp .-90 ; 0x117b8 else if(*CMDBUFFER_CURRENT_STRING == 'G') { strchr_pointer = CMDBUFFER_CURRENT_STRING; gcode_in_progress = code_value_short(); // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 11812: 08 e2 ldi r16, 0x28 ; 40 11814: 10 e0 ldi r17, 0x00 ; 0 Show/print PINDA temperature interpolating. */ case 75: { for (uint8_t i = 40; i <= 110; i++) printf_P(_N("%d %.2f"), i, temp_comp_interpolation(i)); 11816: 98 ef ldi r25, 0xF8 ; 248 11818: e9 2e mov r14, r25 1181a: 96 e6 ldi r25, 0x66 ; 102 1181c: f9 2e mov r15, r25 1181e: 60 2f mov r22, r16 11820: 70 e0 ldi r23, 0x00 ; 0 11822: 90 e0 ldi r25, 0x00 ; 0 11824: 80 e0 ldi r24, 0x00 ; 0 11826: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 1182a: 0e 94 04 56 call 0xac08 ; 0xac08 1182e: 9f 93 push r25 11830: 8f 93 push r24 11832: 7f 93 push r23 11834: 6f 93 push r22 11836: 1f 93 push r17 11838: 0f 93 push r16 1183a: ff 92 push r15 1183c: ef 92 push r14 1183e: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 11842: 0f 5f subi r16, 0xFF ; 255 11844: 1f 4f sbci r17, 0xFF ; 255 ### G75 - Print temperature interpolation G75: Print temperature interpolation Show/print PINDA temperature interpolating. */ case 75: { for (uint8_t i = 40; i <= 110; i++) 11846: 0f b6 in r0, 0x3f ; 63 11848: f8 94 cli 1184a: de bf out 0x3e, r29 ; 62 1184c: 0f be out 0x3f, r0 ; 63 1184e: cd bf out 0x3d, r28 ; 61 11850: 0f 36 cpi r16, 0x6F ; 111 11852: 11 05 cpc r17, r1 11854: 21 f7 brne .-56 ; 0x1181e 11856: 42 cb rjmp .-2428 ; 0x10edc ``` */ case 76: { #ifdef PINDA_THERMISTOR if (!has_temperature_compensation()) 11858: 0f 94 b2 14 call 0x22964 ; 0x22964 1185c: 81 11 cpse r24, r1 1185e: 05 c0 rjmp .+10 ; 0x1186a { SERIAL_ECHOLNPGM("No PINDA thermistor"); 11860: 80 e9 ldi r24, 0x90 ; 144 11862: 90 e8 ldi r25, 0x80 ; 128 11864: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 11868: 39 cb rjmp .-2446 ; 0x10edc break; } if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 1186a: 82 e0 ldi r24, 0x02 ; 2 1186c: 0e 94 55 d8 call 0x1b0aa ; 0x1b0aa 11870: 81 11 cpse r24, r1 11872: 07 c0 rjmp .+14 ; 0x11882 //we need to know accurate position of first calibration point //if xyz calibration was not performed yet, interrupt temperature calibration and inform user that xyz cal. is needed lcd_show_fullscreen_message_and_wait_P(_T(MSG_RUN_XYZ)); 11874: 8a ed ldi r24, 0xDA ; 218 11876: 99 e3 ldi r25, 0x39 ; 57 11878: 0e 94 b1 6c call 0xd962 ; 0xd962 1187c: 0f 94 47 0b call 0x2168e ; 0x2168e 11880: 2d cb rjmp .-2470 ; 0x10edc break; } if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) 11882: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 11886: 88 23 and r24, r24 11888: 41 f0 breq .+16 ; 0x1189a 1188a: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 1188e: 88 23 and r24, r24 11890: 21 f0 breq .+8 ; 0x1189a 11892: d0 90 a5 06 lds r13, 0x06A5 ; 0x8006a5 11896: d1 10 cpse r13, r1 11898: 08 c0 rjmp .+16 ; 0x118aa 1189a: 81 e0 ldi r24, 0x01 ; 1 1189c: 80 93 e6 11 sts 0x11E6, r24 ; 0x8011e6 { // We don't know where we are! HOME! // Push the commands to the front of the message queue in the reverse order! // There shall be always enough space reserved for these commands. repeatcommand_front(); // repeat G76 with all its parameters enquecommand_front_P(G28W); 118a0: 82 e1 ldi r24, 0x12 ; 18 118a2: 98 e6 ldi r25, 0x68 ; 104 118a4: 0f 94 57 43 call 0x286ae ; 0x286ae 118a8: 19 cb rjmp .-2510 ; 0x10edc break; } lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CAL_WARNING)); 118aa: 81 e9 ldi r24, 0x91 ; 145 118ac: 99 e3 ldi r25, 0x39 ; 57 118ae: 0e 94 b1 6c call 0xd962 ; 0xd962 118b2: 0f 94 47 0b call 0x2168e ; 0x2168e uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false); 118b6: 89 ed ldi r24, 0xD9 ; 217 118b8: 90 e5 ldi r25, 0x50 ; 80 118ba: 0e 94 b1 6c call 0xd962 ; 0xd962 118be: 41 e0 ldi r20, 0x01 ; 1 118c0: 60 e0 ldi r22, 0x00 ; 0 118c2: 0f 94 e0 2d call 0x25bc0 ; 0x25bc0 if (result == LCD_LEFT_BUTTON_CHOICE) 118c6: 81 11 cpse r24, r1 118c8: 6e c0 rjmp .+220 ; 0x119a6 { current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 118ca: 80 e0 ldi r24, 0x00 ; 0 118cc: 90 e0 ldi r25, 0x00 ; 0 118ce: a0 ea ldi r26, 0xA0 ; 160 118d0: b0 e4 ldi r27, 0x40 ; 64 118d2: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 118d6: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 118da: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 118de: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 118e2: 60 e0 ldi r22, 0x00 ; 0 118e4: 70 e0 ldi r23, 0x00 ; 0 118e6: 88 e4 ldi r24, 0x48 ; 72 118e8: 92 e4 ldi r25, 0x42 ; 66 118ea: 0f 94 70 84 call 0x308e0 ; 0x308e0 current_position[Z_AXIS] = 50; 118ee: 80 e0 ldi r24, 0x00 ; 0 118f0: 90 e0 ldi r25, 0x00 ; 0 118f2: a8 e4 ldi r26, 0x48 ; 72 118f4: b2 e4 ldi r27, 0x42 ; 66 118f6: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 118fa: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 118fe: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11902: b0 93 00 12 sts 0x1200, r27 ; 0x801200 current_position[Y_AXIS] = 180; 11906: 80 e0 ldi r24, 0x00 ; 0 11908: 90 e0 ldi r25, 0x00 ; 0 1190a: a4 e3 ldi r26, 0x34 ; 52 1190c: b3 e4 ldi r27, 0x43 ; 67 1190e: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 11912: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 11916: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 1191a: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(3000 / 60); 1191e: 60 e0 ldi r22, 0x00 ; 0 11920: 70 e0 ldi r23, 0x00 ; 0 11922: 88 e4 ldi r24, 0x48 ; 72 11924: 92 e4 ldi r25, 0x42 ; 66 11926: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 1192a: 0f 94 42 22 call 0x24484 ; 0x24484 lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET)); 1192e: 8f ea ldi r24, 0xAF ; 175 11930: 90 e5 ldi r25, 0x50 ; 80 11932: 0e 94 b1 6c call 0xd962 ; 0xd962 11936: 0f 94 47 0b call 0x2168e ; 0x2168e current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 1193a: e0 e5 ldi r30, 0x50 ; 80 1193c: f8 e8 ldi r31, 0x88 ; 136 1193e: 85 91 lpm r24, Z+ 11940: 95 91 lpm r25, Z+ 11942: a5 91 lpm r26, Z+ 11944: b4 91 lpm r27, Z 11946: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 1194a: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 1194e: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 11952: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 11956: ec e4 ldi r30, 0x4C ; 76 11958: f8 e8 ldi r31, 0x88 ; 136 1195a: 85 91 lpm r24, Z+ 1195c: 95 91 lpm r25, Z+ 1195e: a5 91 lpm r26, Z+ 11960: b4 91 lpm r27, Z 11962: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 11966: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 1196a: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 1196e: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 plan_buffer_line_curposXYZE(3000 / 60); 11972: 60 e0 ldi r22, 0x00 ; 0 11974: 70 e0 ldi r23, 0x00 ; 0 11976: 88 e4 ldi r24, 0x48 ; 72 11978: 92 e4 ldi r25, 0x42 ; 66 1197a: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 1197e: 0f 94 42 22 call 0x24484 ; 0x24484 static void gcode_G28(bool home_x_axis, bool home_y_axis, bool home_z_axis) { #ifdef TMC2130 gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, false, true); #else gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, true); 11982: 81 e0 ldi r24, 0x01 ; 1 11984: 8f 93 push r24 11986: 81 2c mov r8, r1 11988: 91 2c mov r9, r1 1198a: 54 01 movw r10, r8 1198c: cc 24 eor r12, r12 1198e: c3 94 inc r12 11990: e1 2c mov r14, r1 11992: f1 2c mov r15, r1 11994: 87 01 movw r16, r14 11996: 20 e0 ldi r18, 0x00 ; 0 11998: 40 e0 ldi r20, 0x00 ; 0 1199a: 50 e0 ldi r21, 0x00 ; 0 1199c: ba 01 movw r22, r20 1199e: 80 e0 ldi r24, 0x00 ; 0 119a0: 0e 94 73 67 call 0xcee6 ; 0xcee6 119a4: 0f 90 pop r0 plan_buffer_line_curposXYZE(3000 / 60); st_synchronize(); gcode_G28(false, false, true); } if ((current_temperature_pinda > 35) && (farm_mode == false)) { 119a6: 20 e0 ldi r18, 0x00 ; 0 119a8: 30 e0 ldi r19, 0x00 ; 0 119aa: 4c e0 ldi r20, 0x0C ; 12 119ac: 52 e4 ldi r21, 0x42 ; 66 119ae: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 119b2: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 119b6: 80 91 90 06 lds r24, 0x0690 ; 0x800690 119ba: 90 91 91 06 lds r25, 0x0691 ; 0x800691 119be: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 119c2: 18 16 cp r1, r24 119c4: 0c f0 brlt .+2 ; 0x119c8 119c6: 76 c0 rjmp .+236 ; 0x11ab4 119c8: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 119cc: 81 11 cpse r24, r1 119ce: 72 c0 rjmp .+228 ; 0x11ab4 //waiting for PIDNA probe to cool down in case that we are not in farm mode current_position[Z_AXIS] = 100; 119d0: 80 e0 ldi r24, 0x00 ; 0 119d2: 90 e0 ldi r25, 0x00 ; 0 119d4: a8 ec ldi r26, 0xC8 ; 200 119d6: b2 e4 ldi r27, 0x42 ; 66 119d8: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 119dc: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 119e0: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 119e4: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 119e8: 60 e0 ldi r22, 0x00 ; 0 119ea: 70 e0 ldi r23, 0x00 ; 0 119ec: 88 e4 ldi r24, 0x48 ; 72 119ee: 92 e4 ldi r25, 0x42 ; 66 119f0: 0f 94 70 84 call 0x308e0 ; 0x308e0 } #ifdef PINDA_THERMISTOR bool lcd_wait_for_pinda(float temp) { disable_heater(); 119f4: 0f 94 5f 12 call 0x224be ; 0x224be LongTimer pinda_timeout; 119f8: 19 82 std Y+1, r1 ; 0x01 119fa: 1a 82 std Y+2, r1 ; 0x02 119fc: 1b 82 std Y+3, r1 ; 0x03 119fe: 1c 82 std Y+4, r1 ; 0x04 11a00: 1d 82 std Y+5, r1 ; 0x05 pinda_timeout.start(); 11a02: ce 01 movw r24, r28 11a04: 01 96 adiw r24, 0x01 ; 1 11a06: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> while (current_temperature_pinda > temp){ lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP_PINDA)); lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); lcd_printf_P(PSTR("%3d/%3d"), (int16_t)current_temperature_pinda, (int16_t) temp); 11a0a: 83 e2 ldi r24, 0x23 ; 35 11a0c: f8 2e mov r15, r24 11a0e: 0f e1 ldi r16, 0x1F ; 31 11a10: 1e e7 ldi r17, 0x7E ; 126 disable_heater(); LongTimer pinda_timeout; pinda_timeout.start(); bool target_temp_reached = true; while (current_temperature_pinda > temp){ 11a12: 20 e0 ldi r18, 0x00 ; 0 11a14: 30 e0 ldi r19, 0x00 ; 0 11a16: 4c e0 ldi r20, 0x0C ; 12 11a18: 52 e4 ldi r21, 0x42 ; 66 11a1a: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 11a1e: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 11a22: 80 91 90 06 lds r24, 0x0690 ; 0x800690 11a26: 90 91 91 06 lds r25, 0x0691 ; 0x800691 11a2a: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 11a2e: 18 16 cp r1, r24 11a30: c4 f5 brge .+112 ; 0x11aa2 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP_PINDA)); 11a32: 83 e4 ldi r24, 0x43 ; 67 11a34: 99 e3 ldi r25, 0x39 ; 57 11a36: 0e 94 b1 6c call 0xd962 ; 0xd962 11a3a: 0f 94 c0 0a call 0x21580 ; 0x21580 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 11a3e: 42 e8 ldi r20, 0x82 ; 130 11a40: 64 e0 ldi r22, 0x04 ; 4 11a42: 80 e0 ldi r24, 0x00 ; 0 11a44: 0e 94 9b 69 call 0xd336 ; 0xd336 lcd_printf_P(PSTR("%3d/%3d"), (int16_t)current_temperature_pinda, (int16_t) temp); 11a48: 1f 92 push r1 11a4a: ff 92 push r15 11a4c: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 11a50: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 11a54: 80 91 90 06 lds r24, 0x0690 ; 0x800690 11a58: 90 91 91 06 lds r25, 0x0691 ; 0x800691 11a5c: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 11a60: 7f 93 push r23 11a62: 6f 93 push r22 11a64: 1f 93 push r17 11a66: 0f 93 push r16 11a68: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 lcd_putc(LCD_STR_DEGREE[0]); 11a6c: 81 e8 ldi r24, 0x81 ; 129 11a6e: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 delay_keep_alive(1000); 11a72: 88 ee ldi r24, 0xE8 ; 232 11a74: 93 e0 ldi r25, 0x03 ; 3 11a76: 0e 94 48 7c call 0xf890 ; 0xf890 serialecho_temperatures(); 11a7a: 0e 94 68 70 call 0xe0d0 ; 0xe0d0 if (pinda_timeout.expired(8 * 60 * 1000ul)) { //PINDA cooling from 60 C to 35 C takes about 7 minutes 11a7e: 40 e0 ldi r20, 0x00 ; 0 11a80: 53 e5 ldi r21, 0x53 ; 83 11a82: 67 e0 ldi r22, 0x07 ; 7 11a84: 70 e0 ldi r23, 0x00 ; 0 11a86: ce 01 movw r24, r28 11a88: 01 96 adiw r24, 0x01 ; 1 11a8a: 0f 94 e2 0f call 0x21fc4 ; 0x21fc4 ::expired(unsigned long)> 11a8e: 0f 90 pop r0 11a90: 0f 90 pop r0 11a92: 0f 90 pop r0 11a94: 0f 90 pop r0 11a96: 0f 90 pop r0 11a98: 0f 90 pop r0 11a9a: 88 23 and r24, r24 11a9c: 09 f4 brne .+2 ; 0x11aa0 11a9e: b9 cf rjmp .-142 ; 0x11a12 target_temp_reached = false; 11aa0: d1 2c mov r13, r1 break; } } lcd_update_enable(true); 11aa2: 81 e0 ldi r24, 0x01 ; 1 11aa4: 0e 94 c0 69 call 0xd380 ; 0xd380 if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails 11aa8: d1 10 cpse r13, r1 11aaa: 04 c0 rjmp .+8 ; 0x11ab4 lcd_temp_cal_show_result(false); 11aac: 80 e0 ldi r24, 0x00 ; 0 11aae: 0f 94 d8 0b call 0x217b0 ; 0x217b0 11ab2: 14 ca rjmp .-3032 ; 0x10edc break; } } st_synchronize(); 11ab4: 0f 94 42 22 call 0x24484 ; 0x24484 homing_flag = true; // keep homing on to avoid babystepping while the LCD is enabled 11ab8: 81 e0 ldi r24, 0x01 ; 1 11aba: 80 93 05 12 sts 0x1205, r24 ; 0x801205 lcd_update_enable(true); 11abe: 0e 94 c0 69 call 0xd380 ; 0xd380 SERIAL_ECHOLNPGM("PINDA probe calibration start"); 11ac2: 82 e7 ldi r24, 0x72 ; 114 11ac4: 90 e8 ldi r25, 0x80 ; 128 11ac6: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 float zero_z; int z_shift = 0; //unit: steps float start_temp = 5 * (int)(current_temperature_pinda / 5); 11aca: 80 90 8e 06 lds r8, 0x068E ; 0x80068e 11ace: 90 90 8f 06 lds r9, 0x068F ; 0x80068f 11ad2: a0 90 90 06 lds r10, 0x0690 ; 0x800690 11ad6: b0 90 91 06 lds r11, 0x0691 ; 0x800691 11ada: 20 e0 ldi r18, 0x00 ; 0 11adc: 30 e0 ldi r19, 0x00 ; 0 11ade: 40 ea ldi r20, 0xA0 ; 160 11ae0: 50 e4 ldi r21, 0x40 ; 64 11ae2: c5 01 movw r24, r10 11ae4: b4 01 movw r22, r8 11ae6: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 11aea: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 11aee: 25 e0 ldi r18, 0x05 ; 5 11af0: 26 9f mul r18, r22 11af2: a0 01 movw r20, r0 11af4: 27 9f mul r18, r23 11af6: 50 0d add r21, r0 11af8: 11 24 eor r1, r1 11afa: ba 01 movw r22, r20 11afc: 55 0f add r21, r21 11afe: 88 0b sbc r24, r24 11b00: 99 0b sbc r25, r25 11b02: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 11b06: 1b 01 movw r2, r22 11b08: 7c 01 movw r14, r24 if (start_temp < 35) start_temp = 35; 11b0a: 20 e0 ldi r18, 0x00 ; 0 11b0c: 30 e0 ldi r19, 0x00 ; 0 11b0e: 4c e0 ldi r20, 0x0C ; 12 11b10: 52 e4 ldi r21, 0x42 ; 66 11b12: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 11b16: 87 ff sbrs r24, 7 11b18: 06 c0 rjmp .+12 ; 0x11b26 11b1a: 21 2c mov r2, r1 11b1c: 31 2c mov r3, r1 11b1e: 1c e0 ldi r17, 0x0C ; 12 11b20: e1 2e mov r14, r17 11b22: 02 e4 ldi r16, 0x42 ; 66 11b24: f0 2e mov r15, r16 if (start_temp < current_temperature_pinda) start_temp += 5; 11b26: 22 2d mov r18, r2 11b28: 33 2d mov r19, r3 11b2a: 4e 2d mov r20, r14 11b2c: 5f 2d mov r21, r15 11b2e: c5 01 movw r24, r10 11b30: b4 01 movw r22, r8 11b32: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 11b36: 18 16 cp r1, r24 11b38: 64 f4 brge .+24 ; 0x11b52 11b3a: 20 e0 ldi r18, 0x00 ; 0 11b3c: 30 e0 ldi r19, 0x00 ; 0 11b3e: 40 ea ldi r20, 0xA0 ; 160 11b40: 50 e4 ldi r21, 0x40 ; 64 11b42: 62 2d mov r22, r2 11b44: 73 2d mov r23, r3 11b46: 8e 2d mov r24, r14 11b48: 9f 2d mov r25, r15 11b4a: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 11b4e: 1b 01 movw r2, r22 11b50: 7c 01 movw r14, r24 printf_P(_N("start temperature: %.1f\n"), start_temp); 11b52: ff 92 push r15 11b54: ef 92 push r14 11b56: 3f 92 push r3 11b58: 2f 92 push r2 11b5a: 8f ed ldi r24, 0xDF ; 223 11b5c: 96 e6 ldi r25, 0x66 ; 102 11b5e: 9f 93 push r25 11b60: 8f 93 push r24 11b62: 0f 94 9e 9e call 0x33d3c ; 0x33d3c setTargetBed(70 + (start_temp - 30)); 11b66: 20 e0 ldi r18, 0x00 ; 0 11b68: 30 e0 ldi r19, 0x00 ; 0 11b6a: 40 ef ldi r20, 0xF0 ; 240 11b6c: 51 e4 ldi r21, 0x41 ; 65 11b6e: 62 2d mov r22, r2 11b70: 73 2d mov r23, r3 11b72: 8e 2d mov r24, r14 11b74: 9f 2d mov r25, r15 11b76: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 11b7a: 20 e0 ldi r18, 0x00 ; 0 11b7c: 30 e0 ldi r19, 0x00 ; 0 11b7e: 4c e8 ldi r20, 0x8C ; 140 11b80: 52 e4 ldi r21, 0x42 ; 66 11b82: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 11b86: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 11b8a: 70 93 ee 11 sts 0x11EE, r23 ; 0x8011ee 11b8e: 60 93 ed 11 sts 0x11ED, r22 ; 0x8011ed custom_message_type = CustomMsg::TempCal; 11b92: 84 e0 ldi r24, 0x04 ; 4 11b94: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 custom_message_state = 1; 11b98: 81 e0 ldi r24, 0x01 ; 1 11b9a: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac lcd_setstatuspgm(_T(MSG_PINDA_CALIBRATION)); 11b9e: 85 ee ldi r24, 0xE5 ; 229 11ba0: 9a e3 ldi r25, 0x3A ; 58 11ba2: 0e 94 b1 6c call 0xd962 ; 0xd962 11ba6: 0e 94 65 e6 call 0x1ccca ; 0x1ccca current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 11baa: 80 e0 ldi r24, 0x00 ; 0 11bac: 90 e0 ldi r25, 0x00 ; 0 11bae: a0 ea ldi r26, 0xA0 ; 160 11bb0: b0 e4 ldi r27, 0x40 ; 64 11bb2: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 11bb6: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 11bba: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11bbe: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11bc2: 60 e0 ldi r22, 0x00 ; 0 11bc4: 70 e0 ldi r23, 0x00 ; 0 11bc6: 88 e4 ldi r24, 0x48 ; 72 11bc8: 92 e4 ldi r25, 0x42 ; 66 11bca: 0f 94 70 84 call 0x308e0 ; 0x308e0 current_position[X_AXIS] = PINDA_PREHEAT_X; 11bce: 80 e0 ldi r24, 0x00 ; 0 11bd0: 90 e0 ldi r25, 0x00 ; 0 11bd2: a0 ea ldi r26, 0xA0 ; 160 11bd4: b1 e4 ldi r27, 0x41 ; 65 11bd6: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 11bda: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 11bde: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 11be2: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 11be6: 80 e0 ldi r24, 0x00 ; 0 11be8: 90 e0 ldi r25, 0x00 ; 0 11bea: a0 e7 ldi r26, 0x70 ; 112 11bec: b2 e4 ldi r27, 0x42 ; 66 11bee: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 11bf2: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 11bf6: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 11bfa: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(3000 / 60); 11bfe: 60 e0 ldi r22, 0x00 ; 0 11c00: 70 e0 ldi r23, 0x00 ; 0 11c02: 88 e4 ldi r24, 0x48 ; 72 11c04: 92 e4 ldi r25, 0x42 ; 66 11c06: 0f 94 70 84 call 0x308e0 ; 0x308e0 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 11c0a: 8a e9 ldi r24, 0x9A ; 154 11c0c: 99 e9 ldi r25, 0x99 ; 153 11c0e: a9 e1 ldi r26, 0x19 ; 25 11c10: be e3 ldi r27, 0x3E ; 62 11c12: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 11c16: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 11c1a: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11c1e: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11c22: 60 e0 ldi r22, 0x00 ; 0 11c24: 70 e0 ldi r23, 0x00 ; 0 11c26: 88 e4 ldi r24, 0x48 ; 72 11c28: 92 e4 ldi r25, 0x42 ; 66 11c2a: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 11c2e: 0f 94 42 22 call 0x24484 ; 0x24484 11c32: 0f 90 pop r0 11c34: 0f 90 pop r0 11c36: 0f 90 pop r0 11c38: 0f 90 pop r0 11c3a: 0f 90 pop r0 11c3c: 0f 90 pop r0 while (current_temperature_pinda < start_temp) 11c3e: 20 91 8e 06 lds r18, 0x068E ; 0x80068e 11c42: 30 91 8f 06 lds r19, 0x068F ; 0x80068f 11c46: 40 91 90 06 lds r20, 0x0690 ; 0x800690 11c4a: 50 91 91 06 lds r21, 0x0691 ; 0x800691 11c4e: 62 2d mov r22, r2 11c50: 73 2d mov r23, r3 11c52: 8e 2d mov r24, r14 11c54: 9f 2d mov r25, r15 11c56: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 11c5a: 18 16 cp r1, r24 11c5c: 3c f4 brge .+14 ; 0x11c6c { delay_keep_alive(1000); 11c5e: 88 ee ldi r24, 0xE8 ; 232 11c60: 93 e0 ldi r25, 0x03 ; 3 11c62: 0e 94 48 7c call 0xf890 ; 0xf890 serialecho_temperatures(); 11c66: 0e 94 68 70 call 0xe0d0 ; 0xe0d0 11c6a: e9 cf rjmp .-46 ; 0x11c3e 11c6c: 60 e0 ldi r22, 0x00 ; 0 11c6e: 86 ea ldi r24, 0xA6 ; 166 11c70: 9f e0 ldi r25, 0x0F ; 15 11c72: 0f 94 00 a0 call 0x34000 ; 0x34000 } eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0); //invalidate temp. calibration in case that in will be aborted during the calibration process current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 11c76: 80 e0 ldi r24, 0x00 ; 0 11c78: 90 e0 ldi r25, 0x00 ; 0 11c7a: a0 ea ldi r26, 0xA0 ; 160 11c7c: b0 e4 ldi r27, 0x40 ; 64 11c7e: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 11c82: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 11c86: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11c8a: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11c8e: 60 e0 ldi r22, 0x00 ; 0 11c90: 70 e0 ldi r23, 0x00 ; 0 11c92: 88 e4 ldi r24, 0x48 ; 72 11c94: 92 e4 ldi r25, 0x42 ; 66 11c96: 0f 94 70 84 call 0x308e0 ; 0x308e0 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 11c9a: ec e4 ldi r30, 0x4C ; 76 11c9c: f8 e8 ldi r31, 0x88 ; 136 11c9e: 85 91 lpm r24, Z+ 11ca0: 95 91 lpm r25, Z+ 11ca2: a5 91 lpm r26, Z+ 11ca4: b4 91 lpm r27, Z 11ca6: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 11caa: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 11cae: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 11cb2: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 11cb6: e0 e5 ldi r30, 0x50 ; 80 11cb8: f8 e8 ldi r31, 0x88 ; 136 11cba: 85 91 lpm r24, Z+ 11cbc: 95 91 lpm r25, Z+ 11cbe: a5 91 lpm r26, Z+ 11cc0: b4 91 lpm r27, Z 11cc2: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 11cc6: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 11cca: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 11cce: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(3000 / 60); 11cd2: 60 e0 ldi r22, 0x00 ; 0 11cd4: 70 e0 ldi r23, 0x00 ; 0 11cd6: 88 e4 ldi r24, 0x48 ; 72 11cd8: 92 e4 ldi r25, 0x42 ; 66 11cda: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 11cde: 0f 94 42 22 call 0x24484 ; 0x24484 bool find_z_result = find_bed_induction_sensor_point_z(-1.f); 11ce2: 43 e0 ldi r20, 0x03 ; 3 11ce4: 60 e0 ldi r22, 0x00 ; 0 11ce6: 70 e0 ldi r23, 0x00 ; 0 11ce8: 80 e8 ldi r24, 0x80 ; 128 11cea: 9f eb ldi r25, 0xBF ; 191 11cec: 0f 94 fb 55 call 0x2abf6 ; 0x2abf6 if (find_z_result == false) { 11cf0: 81 11 cpse r24, r1 11cf2: 05 c0 rjmp .+10 ; 0x11cfe printf_P(_N("\nPINDA temperature: %.1f Z shift (mm): %.3f"), current_temperature_pinda, current_position[Z_AXIS] - zero_z); eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } lcd_temp_cal_show_result(true); 11cf4: 0f 94 d8 0b call 0x217b0 ; 0x217b0 homing_flag = false; 11cf8: 10 92 05 12 sts 0x1205, r1 ; 0x801205 11cfc: ef c8 rjmp .-3618 ; 0x10edc if (find_z_result == false) { lcd_temp_cal_show_result(find_z_result); homing_flag = false; break; } zero_z = current_position[Z_AXIS]; 11cfe: 90 91 fd 11 lds r25, 0x11FD ; 0x8011fd 11d02: 98 a7 std Y+40, r25 ; 0x28 11d04: a0 91 fe 11 lds r26, 0x11FE ; 0x8011fe 11d08: ac a7 std Y+44, r26 ; 0x2c 11d0a: b0 91 ff 11 lds r27, 0x11FF ; 0x8011ff 11d0e: b8 ab std Y+48, r27 ; 0x30 11d10: e0 91 00 12 lds r30, 0x1200 ; 0x801200 11d14: e8 af std Y+56, r30 ; 0x38 printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); 11d16: ef 93 push r30 11d18: bf 93 push r27 11d1a: af 93 push r26 11d1c: 9f 93 push r25 11d1e: 82 ed ldi r24, 0xD2 ; 210 11d20: 96 e6 ldi r25, 0x66 ; 102 11d22: 9f 93 push r25 11d24: 8f 93 push r24 11d26: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 11d2a: 0f 90 pop r0 11d2c: 0f 90 pop r0 11d2e: 0f 90 pop r0 11d30: 0f 90 pop r0 11d32: 0f 90 pop r0 11d34: 0f 90 pop r0 11d36: ae ea ldi r26, 0xAE ; 174 11d38: 8a 2e mov r8, r26 11d3a: af e0 ldi r26, 0x0F ; 15 11d3c: 9a 2e mov r9, r26 11d3e: b3 e2 ldi r27, 0x23 ; 35 11d40: cb 2e mov r12, r27 11d42: d1 2c mov r13, r1 int i = -1; for (; i < 5; i++) 11d44: 0f ef ldi r16, 0xFF ; 255 11d46: 1f ef ldi r17, 0xFF ; 255 { float temp = (40 + i * 5); 11d48: b6 01 movw r22, r12 11d4a: 0d 2c mov r0, r13 11d4c: 00 0c add r0, r0 11d4e: 88 0b sbc r24, r24 11d50: 99 0b sbc r25, r25 11d52: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 11d56: 2b 01 movw r4, r22 11d58: 3c 01 movw r6, r24 printf_P(_N("\nStep: %d/6 (skipped)\nPINDA temperature: %d Z shift (mm):0\n"), i + 2, (40 + i*5)); 11d5a: df 92 push r13 11d5c: cf 92 push r12 11d5e: c8 01 movw r24, r16 11d60: 02 96 adiw r24, 0x02 ; 2 11d62: 9f 93 push r25 11d64: 8f 93 push r24 11d66: 26 e9 ldi r18, 0x96 ; 150 11d68: 36 e6 ldi r19, 0x66 ; 102 11d6a: 3f 93 push r19 11d6c: 2f 93 push r18 11d6e: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 11d72: 58 01 movw r10, r16 11d74: 5f ef ldi r21, 0xFF ; 255 11d76: a5 1a sub r10, r21 11d78: b5 0a sbc r11, r21 if (i >= 0) { 11d7a: 0f 90 pop r0 11d7c: 0f 90 pop r0 11d7e: 0f 90 pop r0 11d80: 0f 90 pop r0 11d82: 0f 90 pop r0 11d84: 0f 90 pop r0 11d86: 11 f4 brne .+4 ; 0x11d8c 11d88: 0c 94 2c b0 jmp 0x16058 ; 0x16058 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 11d8c: 70 e0 ldi r23, 0x00 ; 0 11d8e: 60 e0 ldi r22, 0x00 ; 0 11d90: c4 01 movw r24, r8 11d92: 0f 94 1e a0 call 0x3403c ; 0x3403c eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; 11d96: a3 01 movw r20, r6 11d98: 92 01 movw r18, r4 11d9a: 62 2d mov r22, r2 11d9c: 73 2d mov r23, r3 11d9e: 8e 2d mov r24, r14 11da0: 9f 2d mov r25, r15 11da2: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 11da6: 18 16 cp r1, r24 11da8: 44 f4 brge .+16 ; 0x11dba } zero_z = current_position[Z_AXIS]; printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); int i = -1; for (; i < 5; i++) 11daa: 85 e0 ldi r24, 0x05 ; 5 11dac: a8 16 cp r10, r24 11dae: b1 04 cpc r11, r1 11db0: 11 f0 breq .+4 ; 0x11db6 11db2: 0c 94 38 b0 jmp 0x16070 ; 0x16070 11db6: 05 e0 ldi r16, 0x05 ; 5 11db8: 10 e0 ldi r17, 0x00 ; 0 11dba: 58 01 movw r10, r16 11dbc: 97 e2 ldi r25, 0x27 ; 39 11dbe: a9 1a sub r10, r25 11dc0: 98 ef ldi r25, 0xF8 ; 248 11dc2: b9 0a sbc r11, r25 11dc4: aa 0c add r10, r10 11dc6: bb 1c adc r11, r11 11dc8: 85 e0 ldi r24, 0x05 ; 5 11dca: 80 9f mul r24, r16 11dcc: 10 01 movw r2, r0 11dce: 81 9f mul r24, r17 11dd0: 30 0c add r3, r0 11dd2: 11 24 eor r1, r1 11dd4: 0d 5f subi r16, 0xFD ; 253 11dd6: 1f 4f sbci r17, 0xFF ; 255 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; plan_buffer_line_curposXYZE(3000 / 60); current_position[X_AXIS] = PINDA_PREHEAT_X; current_position[Y_AXIS] = PINDA_PREHEAT_Y; plan_buffer_line_curposXYZE(3000 / 60); current_position[Z_AXIS] = PINDA_PREHEAT_Z; 11dd8: ea e9 ldi r30, 0x9A ; 154 11dda: 4e 2e mov r4, r30 11ddc: e9 e9 ldi r30, 0x99 ; 153 11dde: 5e 2e mov r5, r30 11de0: e9 e1 ldi r30, 0x19 ; 25 11de2: 6e 2e mov r6, r30 11de4: ee e3 ldi r30, 0x3E ; 62 11de6: 7e 2e mov r7, r30 lcd_temp_cal_show_result(find_z_result); break; } z_shift = (int)((current_position[Z_AXIS] - zero_z)*cs.axis_steps_per_mm[Z_AXIS]); printf_P(_N("\nPINDA temperature: %.1f Z shift (mm): %.3f"), current_temperature_pinda, current_position[Z_AXIS] - zero_z); 11de8: fd e5 ldi r31, 0x5D ; 93 11dea: 8f 2e mov r8, r31 11dec: f6 e6 ldi r31, 0x66 ; 102 11dee: 9f 2e mov r9, r31 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; } for (i++; i < 5; i++) 11df0: c8 01 movw r24, r16 11df2: 02 97 sbiw r24, 0x02 ; 2 11df4: 05 97 sbiw r24, 0x05 ; 5 11df6: 0c f0 brlt .+2 ; 0x11dfa 11df8: d4 c0 rjmp .+424 ; 0x11fa2 { float temp = (40 + i * 5); 11dfa: b1 01 movw r22, r2 11dfc: 63 5d subi r22, 0xD3 ; 211 11dfe: 7f 4f sbci r23, 0xFF ; 255 11e00: 07 2e mov r0, r23 11e02: 00 0c add r0, r0 11e04: 88 0b sbc r24, r24 11e06: 99 0b sbc r25, r25 11e08: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 11e0c: 6b 01 movw r12, r22 11e0e: 7c 01 movw r14, r24 printf_P(_N("\nStep: %d/6\n"), i + 2); 11e10: 1f 93 push r17 11e12: 0f 93 push r16 11e14: a9 e8 ldi r26, 0x89 ; 137 11e16: b6 e6 ldi r27, 0x66 ; 102 11e18: bf 93 push r27 11e1a: af 93 push r26 11e1c: 0f 94 9e 9e call 0x33d3c ; 0x33d3c custom_message_state = i + 2; 11e20: 00 93 ac 03 sts 0x03AC, r16 ; 0x8003ac setTargetBed(50 + 10 * (temp - 30) / 5); 11e24: 20 e0 ldi r18, 0x00 ; 0 11e26: 30 e0 ldi r19, 0x00 ; 0 11e28: 40 ef ldi r20, 0xF0 ; 240 11e2a: 51 e4 ldi r21, 0x41 ; 65 11e2c: c7 01 movw r24, r14 11e2e: b6 01 movw r22, r12 11e30: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 11e34: 20 e0 ldi r18, 0x00 ; 0 11e36: 30 e0 ldi r19, 0x00 ; 0 11e38: 40 e2 ldi r20, 0x20 ; 32 11e3a: 51 e4 ldi r21, 0x41 ; 65 11e3c: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 11e40: 20 e0 ldi r18, 0x00 ; 0 11e42: 30 e0 ldi r19, 0x00 ; 0 11e44: 40 ea ldi r20, 0xA0 ; 160 11e46: 50 e4 ldi r21, 0x40 ; 64 11e48: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 11e4c: 20 e0 ldi r18, 0x00 ; 0 11e4e: 30 e0 ldi r19, 0x00 ; 0 11e50: 48 e4 ldi r20, 0x48 ; 72 11e52: 52 e4 ldi r21, 0x42 ; 66 11e54: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 11e58: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 11e5c: 70 93 ee 11 sts 0x11EE, r23 ; 0x8011ee 11e60: 60 93 ed 11 sts 0x11ED, r22 ; 0x8011ed current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 11e64: 80 e0 ldi r24, 0x00 ; 0 11e66: 90 e0 ldi r25, 0x00 ; 0 11e68: a0 ea ldi r26, 0xA0 ; 160 11e6a: b0 e4 ldi r27, 0x40 ; 64 11e6c: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 11e70: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 11e74: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11e78: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11e7c: 60 e0 ldi r22, 0x00 ; 0 11e7e: 70 e0 ldi r23, 0x00 ; 0 11e80: 88 e4 ldi r24, 0x48 ; 72 11e82: 92 e4 ldi r25, 0x42 ; 66 11e84: 0f 94 70 84 call 0x308e0 ; 0x308e0 current_position[X_AXIS] = PINDA_PREHEAT_X; 11e88: 20 e0 ldi r18, 0x00 ; 0 11e8a: 30 e0 ldi r19, 0x00 ; 0 11e8c: 40 ea ldi r20, 0xA0 ; 160 11e8e: 51 e4 ldi r21, 0x41 ; 65 11e90: 20 93 f5 11 sts 0x11F5, r18 ; 0x8011f5 11e94: 30 93 f6 11 sts 0x11F6, r19 ; 0x8011f6 11e98: 40 93 f7 11 sts 0x11F7, r20 ; 0x8011f7 11e9c: 50 93 f8 11 sts 0x11F8, r21 ; 0x8011f8 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 11ea0: 80 e0 ldi r24, 0x00 ; 0 11ea2: 90 e0 ldi r25, 0x00 ; 0 11ea4: a0 e7 ldi r26, 0x70 ; 112 11ea6: b2 e4 ldi r27, 0x42 ; 66 11ea8: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 11eac: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 11eb0: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 11eb4: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(3000 / 60); 11eb8: 60 e0 ldi r22, 0x00 ; 0 11eba: 70 e0 ldi r23, 0x00 ; 0 11ebc: 88 e4 ldi r24, 0x48 ; 72 11ebe: 92 e4 ldi r25, 0x42 ; 66 11ec0: 0f 94 70 84 call 0x308e0 ; 0x308e0 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 11ec4: 40 92 fd 11 sts 0x11FD, r4 ; 0x8011fd 11ec8: 50 92 fe 11 sts 0x11FE, r5 ; 0x8011fe 11ecc: 60 92 ff 11 sts 0x11FF, r6 ; 0x8011ff 11ed0: 70 92 00 12 sts 0x1200, r7 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11ed4: 60 e0 ldi r22, 0x00 ; 0 11ed6: 70 e0 ldi r23, 0x00 ; 0 11ed8: 88 e4 ldi r24, 0x48 ; 72 11eda: 92 e4 ldi r25, 0x42 ; 66 11edc: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 11ee0: 0f 94 42 22 call 0x24484 ; 0x24484 11ee4: 0f 90 pop r0 11ee6: 0f 90 pop r0 11ee8: 0f 90 pop r0 11eea: 0f 90 pop r0 while (current_temperature_pinda < temp) 11eec: 20 91 8e 06 lds r18, 0x068E ; 0x80068e 11ef0: 30 91 8f 06 lds r19, 0x068F ; 0x80068f 11ef4: 40 91 90 06 lds r20, 0x0690 ; 0x800690 11ef8: 50 91 91 06 lds r21, 0x0691 ; 0x800691 11efc: c7 01 movw r24, r14 11efe: b6 01 movw r22, r12 11f00: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 11f04: 18 16 cp r1, r24 11f06: 3c f4 brge .+14 ; 0x11f16 { delay_keep_alive(1000); 11f08: 88 ee ldi r24, 0xE8 ; 232 11f0a: 93 e0 ldi r25, 0x03 ; 3 11f0c: 0e 94 48 7c call 0xf890 ; 0xf890 serialecho_temperatures(); 11f10: 0e 94 68 70 call 0xe0d0 ; 0xe0d0 11f14: eb cf rjmp .-42 ; 0x11eec } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 11f16: 80 e0 ldi r24, 0x00 ; 0 11f18: 90 e0 ldi r25, 0x00 ; 0 11f1a: a0 ea ldi r26, 0xA0 ; 160 11f1c: b0 e4 ldi r27, 0x40 ; 64 11f1e: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 11f22: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 11f26: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11f2a: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11f2e: 60 e0 ldi r22, 0x00 ; 0 11f30: 70 e0 ldi r23, 0x00 ; 0 11f32: 88 e4 ldi r24, 0x48 ; 72 11f34: 92 e4 ldi r25, 0x42 ; 66 11f36: 0f 94 70 84 call 0x308e0 ; 0x308e0 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 11f3a: ec e4 ldi r30, 0x4C ; 76 11f3c: f8 e8 ldi r31, 0x88 ; 136 11f3e: 85 91 lpm r24, Z+ 11f40: 95 91 lpm r25, Z+ 11f42: a5 91 lpm r26, Z+ 11f44: b4 91 lpm r27, Z 11f46: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 11f4a: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 11f4e: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 11f52: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 11f56: e0 e5 ldi r30, 0x50 ; 80 11f58: f8 e8 ldi r31, 0x88 ; 136 11f5a: 85 91 lpm r24, Z+ 11f5c: 95 91 lpm r25, Z+ 11f5e: a5 91 lpm r26, Z+ 11f60: b4 91 lpm r27, Z 11f62: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 11f66: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 11f6a: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 11f6e: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(3000 / 60); 11f72: 60 e0 ldi r22, 0x00 ; 0 11f74: 70 e0 ldi r23, 0x00 ; 0 11f76: 88 e4 ldi r24, 0x48 ; 72 11f78: 92 e4 ldi r25, 0x42 ; 66 11f7a: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 11f7e: 0f 94 42 22 call 0x24484 ; 0x24484 find_z_result = find_bed_induction_sensor_point_z(-1.f); 11f82: 43 e0 ldi r20, 0x03 ; 3 11f84: 60 e0 ldi r22, 0x00 ; 0 11f86: 70 e0 ldi r23, 0x00 ; 0 11f88: 80 e8 ldi r24, 0x80 ; 128 11f8a: 9f eb ldi r25, 0xBF ; 191 11f8c: 0f 94 fb 55 call 0x2abf6 ; 0x2abf6 11f90: 95 e0 ldi r25, 0x05 ; 5 11f92: 29 0e add r2, r25 11f94: 31 1c adc r3, r1 11f96: 0f 5f subi r16, 0xFF ; 255 11f98: 1f 4f sbci r17, 0xFF ; 255 if (find_z_result == false) { 11f9a: 81 11 cpse r24, r1 11f9c: 04 c0 rjmp .+8 ; 0x11fa6 lcd_temp_cal_show_result(find_z_result); 11f9e: 0f 94 d8 0b call 0x217b0 ; 0x217b0 printf_P(_N("\nPINDA temperature: %.1f Z shift (mm): %.3f"), current_temperature_pinda, current_position[Z_AXIS] - zero_z); eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } lcd_temp_cal_show_result(true); 11fa2: 81 e0 ldi r24, 0x01 ; 1 11fa4: a7 ce rjmp .-690 ; 0x11cf4 find_z_result = find_bed_induction_sensor_point_z(-1.f); if (find_z_result == false) { lcd_temp_cal_show_result(find_z_result); break; } z_shift = (int)((current_position[Z_AXIS] - zero_z)*cs.axis_steps_per_mm[Z_AXIS]); 11fa6: 78 a5 ldd r23, Y+40 ; 0x28 11fa8: 6c a5 ldd r22, Y+44 ; 0x2c 11faa: 98 a9 ldd r25, Y+48 ; 0x30 11fac: 88 ad ldd r24, Y+56 ; 0x38 11fae: 27 2f mov r18, r23 11fb0: 36 2f mov r19, r22 11fb2: 49 2f mov r20, r25 11fb4: 58 2f mov r21, r24 11fb6: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 11fba: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 11fbe: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 11fc2: 90 91 00 12 lds r25, 0x1200 ; 0x801200 11fc6: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 11fca: f6 2e mov r15, r22 11fcc: e7 2e mov r14, r23 11fce: d8 2e mov r13, r24 11fd0: c9 2e mov r12, r25 11fd2: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 11fd6: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 11fda: 40 91 40 04 lds r20, 0x0440 ; 0x800440 11fde: 50 91 41 04 lds r21, 0x0441 ; 0x800441 11fe2: d7 01 movw r26, r14 11fe4: f6 01 movw r30, r12 11fe6: 6b 2f mov r22, r27 11fe8: 7a 2f mov r23, r26 11fea: 8f 2f mov r24, r31 11fec: 9e 2f mov r25, r30 11fee: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 11ff2: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 11ff6: 6c ab std Y+52, r22 ; 0x34 11ff8: 7d ab std Y+53, r23 ; 0x35 11ffa: 8e ab std Y+54, r24 ; 0x36 11ffc: 9f ab std Y+55, r25 ; 0x37 printf_P(_N("\nPINDA temperature: %.1f Z shift (mm): %.3f"), current_temperature_pinda, current_position[Z_AXIS] - zero_z); 11ffe: cf 92 push r12 12000: df 92 push r13 12002: ef 92 push r14 12004: ff 92 push r15 12006: 80 91 91 06 lds r24, 0x0691 ; 0x800691 1200a: 8f 93 push r24 1200c: 80 91 90 06 lds r24, 0x0690 ; 0x800690 12010: 8f 93 push r24 12012: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 12016: 8f 93 push r24 12018: 80 91 8e 06 lds r24, 0x068E ; 0x80068e 1201c: 8f 93 push r24 1201e: 9f 92 push r9 12020: 8f 92 push r8 12022: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 12026: 6c a9 ldd r22, Y+52 ; 0x34 12028: 7d a9 ldd r23, Y+53 ; 0x35 1202a: c5 01 movw r24, r10 1202c: 0f 94 1e a0 call 0x3403c ; 0x3403c 12030: a2 e0 ldi r26, 0x02 ; 2 12032: aa 0e add r10, r26 12034: b1 1c adc r11, r1 12036: 0f b6 in r0, 0x3f ; 63 12038: f8 94 cli 1203a: de bf out 0x3e, r29 ; 62 1203c: 0f be out 0x3f, r0 ; 63 1203e: cd bf out 0x3d, r28 ; 61 12040: d7 ce rjmp .-594 ; 0x11df0 /*! ### G81 - Mesh bed leveling status G81: Mesh bed leveling status Prints mesh bed leveling status and bed profile if activated. */ case 81: { gcode_G81_M420(); 12042: 0e 94 37 73 call 0xe66e ; 0xe66e 12046: 0c 94 6e 87 jmp 0x10edc ; 0x10edc This G-code will be performed at the start of a calibration script. (Prusa3D specific) */ case 86: calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1204a: 80 e1 ldi r24, 0x10 ; 16 1204c: 0e 94 31 c6 call 0x18c62 ; 0x18c62 12050: 0c 94 6e 87 jmp 0x10edc ; 0x10edc /*! ### G90 - Switch off relative mode G90: Set to Absolute Positioning All coordinates from now on are absolute relative to the origin of the machine. E axis is left intact. */ case 90: { axis_relative_modes &= ~(X_AXIS_MASK | Y_AXIS_MASK | Z_AXIS_MASK); 12054: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb 12058: 88 7f andi r24, 0xF8 ; 248 /*! ### G91 - Switch on relative mode G91: Set to Relative Positioning All coordinates from now on are relative to the last position. E axis is left intact. */ case 91: { axis_relative_modes |= X_AXIS_MASK | Y_AXIS_MASK | Z_AXIS_MASK; 1205a: 80 93 eb 11 sts 0x11EB, r24 ; 0x8011eb 1205e: 0c 94 6e 87 jmp 0x10edc ; 0x10edc 12062: 54 ec ldi r21, 0xC4 ; 196 12064: c5 2e mov r12, r21 12066: 52 e0 ldi r21, 0x02 ; 2 12068: d5 2e mov r13, r21 1206a: 8e 01 movw r16, r28 1206c: 0c 5d subi r16, 0xDC ; 220 1206e: 1f 4f sbci r17, 0xFF ; 255 else if(*CMDBUFFER_CURRENT_STRING == 'G') { strchr_pointer = CMDBUFFER_CURRENT_STRING; gcode_in_progress = code_value_short(); // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 12070: 58 01 movw r10, r16 12072: ee 24 eor r14, r14 12074: e3 94 inc r14 12076: f1 2c mov r15, r1 float values[NUM_AXIS]; // Check which axes need to be set for(uint8_t i = 0; i < NUM_AXIS; ++i) { codes[i] = code_seen(axis_codes[i]); 12078: d6 01 movw r26, r12 1207a: 8d 91 ld r24, X+ 1207c: 6d 01 movw r12, r26 1207e: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12082: f5 01 movw r30, r10 12084: 81 93 st Z+, r24 12086: 5f 01 movw r10, r30 if(codes[i]) 12088: 88 23 and r24, r24 1208a: 91 f0 breq .+36 ; 0x120b0 values[i] = code_value(); 1208c: 0e 94 03 5a call 0xb406 ; 0xb406 12090: f7 01 movw r30, r14 12092: ee 0f add r30, r30 12094: ff 1f adc r31, r31 12096: ee 0f add r30, r30 12098: ff 1f adc r31, r31 1209a: 34 97 sbiw r30, 0x04 ; 4 1209c: 21 e0 ldi r18, 0x01 ; 1 1209e: 30 e0 ldi r19, 0x00 ; 0 120a0: 2c 0f add r18, r28 120a2: 3d 1f adc r19, r29 120a4: e2 0f add r30, r18 120a6: f3 1f adc r31, r19 120a8: 60 83 st Z, r22 120aa: 71 83 std Z+1, r23 ; 0x01 120ac: 82 83 std Z+2, r24 ; 0x02 120ae: 93 83 std Z+3, r25 ; 0x03 120b0: 3f ef ldi r19, 0xFF ; 255 120b2: e3 1a sub r14, r19 120b4: f3 0a sbc r15, r19 { bool codes[NUM_AXIS]; float values[NUM_AXIS]; // Check which axes need to be set for(uint8_t i = 0; i < NUM_AXIS; ++i) 120b6: 45 e0 ldi r20, 0x05 ; 5 120b8: e4 16 cp r14, r20 120ba: f1 04 cpc r15, r1 120bc: e9 f6 brne .-70 ; 0x12078 codes[i] = code_seen(axis_codes[i]); if(codes[i]) values[i] = code_value(); } if((codes[E_AXIS] && values[E_AXIS] == 0) && 120be: 9f a0 ldd r9, Y+39 ; 0x27 120c0: fc a0 ldd r15, Y+36 ; 0x24 120c2: 99 20 and r9, r9 120c4: 01 f1 breq .+64 ; 0x12106 120c6: 20 e0 ldi r18, 0x00 ; 0 120c8: 30 e0 ldi r19, 0x00 ; 0 120ca: a9 01 movw r20, r18 120cc: 6d 85 ldd r22, Y+13 ; 0x0d 120ce: 7e 85 ldd r23, Y+14 ; 0x0e 120d0: 8f 85 ldd r24, Y+15 ; 0x0f 120d2: 98 89 ldd r25, Y+16 ; 0x10 120d4: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 120d8: 81 11 cpse r24, r1 120da: 15 c0 rjmp .+42 ; 0x12106 120dc: f1 10 cpse r15, r1 120de: 13 c0 rjmp .+38 ; 0x12106 (!codes[X_AXIS] && !codes[Y_AXIS] && !codes[Z_AXIS])) 120e0: 8d a1 ldd r24, Y+37 ; 0x25 120e2: 81 11 cpse r24, r1 120e4: 10 c0 rjmp .+32 ; 0x12106 120e6: 8e a1 ldd r24, Y+38 ; 0x26 120e8: 81 11 cpse r24, r1 120ea: 0d c0 rjmp .+26 ; 0x12106 { // As a special optimization, when _just_ clearing the E position // we schedule a flag asynchronously along with the next block to // reset the starting E position instead of stopping the planner current_position[E_AXIS] = 0; 120ec: 10 92 01 12 sts 0x1201, r1 ; 0x801201 120f0: 10 92 02 12 sts 0x1202, r1 ; 0x801202 120f4: 10 92 03 12 sts 0x1203, r1 ; 0x801203 120f8: 10 92 04 12 sts 0x1204, r1 ; 0x801204 st_set_e_position(position[E_AXIS]); } void plan_reset_next_e() { plan_reset_next_e_queue = true; 120fc: 81 e0 ldi r24, 0x01 ; 1 120fe: 80 93 ef 03 sts 0x03EF, r24 ; 0x8003ef <_ZL23plan_reset_next_e_queue.lto_priv.448> 12102: 0c 94 6e 87 jmp 0x10edc ; 0x10edc plan_reset_next_e(); } else { // In any other case we're forced to synchronize st_synchronize(); 12106: 0f 94 42 22 call 0x24484 ; 0x24484 1210a: ce 01 movw r24, r28 1210c: 01 96 adiw r24, 0x01 ; 1 1210e: 5c 01 movw r10, r24 12110: 2a e8 ldi r18, 0x8A ; 138 12112: c2 2e mov r12, r18 12114: 24 e0 ldi r18, 0x04 ; 4 12116: d2 2e mov r13, r18 12118: 35 ef ldi r19, 0xF5 ; 245 1211a: e3 2e mov r14, r19 1211c: 31 e1 ldi r19, 0x11 ; 17 1211e: f3 2e mov r15, r19 12120: 38 01 movw r6, r16 12122: 93 e0 ldi r25, 0x03 ; 3 12124: 69 0e add r6, r25 12126: 71 1c adc r7, r1 for(uint8_t i = 0; i < 3; ++i) { if(codes[i]) 12128: d8 01 movw r26, r16 1212a: 8d 91 ld r24, X+ 1212c: 8d 01 movw r16, r26 1212e: 88 23 and r24, r24 12130: 89 f0 breq .+34 ; 0x12154 current_position[i] = values[i] + cs.add_homing[i]; 12132: f6 01 movw r30, r12 12134: 20 81 ld r18, Z 12136: 31 81 ldd r19, Z+1 ; 0x01 12138: 42 81 ldd r20, Z+2 ; 0x02 1213a: 53 81 ldd r21, Z+3 ; 0x03 1213c: d5 01 movw r26, r10 1213e: 6d 91 ld r22, X+ 12140: 7d 91 ld r23, X+ 12142: 8d 91 ld r24, X+ 12144: 9c 91 ld r25, X 12146: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1214a: f7 01 movw r30, r14 1214c: 60 83 st Z, r22 1214e: 71 83 std Z+1, r23 ; 0x01 12150: 82 83 std Z+2, r24 ; 0x02 12152: 93 83 std Z+3, r25 ; 0x03 12154: f4 e0 ldi r31, 0x04 ; 4 12156: af 0e add r10, r31 12158: b1 1c adc r11, r1 1215a: 24 e0 ldi r18, 0x04 ; 4 1215c: c2 0e add r12, r18 1215e: d1 1c adc r13, r1 12160: 34 e0 ldi r19, 0x04 ; 4 12162: e3 0e add r14, r19 12164: f1 1c adc r15, r1 } else { // In any other case we're forced to synchronize st_synchronize(); for(uint8_t i = 0; i < 3; ++i) 12166: 60 16 cp r6, r16 12168: 71 06 cpc r7, r17 1216a: f1 f6 brne .-68 ; 0x12128 { if(codes[i]) current_position[i] = values[i] + cs.add_homing[i]; } if(codes[E_AXIS]) 1216c: 99 20 and r9, r9 1216e: 61 f0 breq .+24 ; 0x12188 current_position[E_AXIS] = values[E_AXIS]; 12170: 8d 85 ldd r24, Y+13 ; 0x0d 12172: 9e 85 ldd r25, Y+14 ; 0x0e 12174: af 85 ldd r26, Y+15 ; 0x0f 12176: b8 89 ldd r27, Y+16 ; 0x10 12178: 80 93 01 12 sts 0x1201, r24 ; 0x801201 1217c: 90 93 02 12 sts 0x1202, r25 ; 0x801202 12180: a0 93 03 12 sts 0x1203, r26 ; 0x801203 12184: b0 93 04 12 sts 0x1204, r27 ; 0x801204 // Set all at once plan_set_position_curposXYZE(); 12188: 0f 94 30 83 call 0x30660 ; 0x30660 1218c: 0c 94 6e 87 jmp 0x10edc ; 0x10edc return true; } void farm_gcode_g98() { farm_mode = 1; 12190: 81 e0 ldi r24, 0x01 ; 1 12192: 80 93 ca 0d sts 0x0DCA, r24 ; 0x800dca if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 12196: 61 e0 ldi r22, 0x01 ; 1 12198: 84 ec ldi r24, 0xC4 ; 196 1219a: 9f e0 ldi r25, 0x0F ; 15 1219c: 0f 94 00 a0 call 0x34000 ; 0x34000 eeprom_update_byte_notify((unsigned char *)EEPROM_FARM_MODE, farm_mode); SilentModeMenu = SILENT_MODE_OFF; 121a0: 10 92 89 03 sts 0x0389, r1 ; 0x800389 121a4: 60 e0 ldi r22, 0x00 ; 0 121a6: 8f ef ldi r24, 0xFF ; 255 121a8: 9f e0 ldi r25, 0x0F ; 15 121aa: 0f 94 00 a0 call 0x34000 ; 0x34000 } void farm_gcode_g99() { farm_disable(); lcd_update(2); fCheckModeInit(); // alternatively invoke printer reset 121ae: 0e 94 62 d8 call 0x1b0c4 ; 0x1b0c4 121b2: 0c 94 6e 87 jmp 0x10edc ; 0x10edc /*! --------------------------------------------------------------------------------- # M Commands */ else if(*CMDBUFFER_CURRENT_STRING == 'M') 121b6: 8d 34 cpi r24, 0x4D ; 77 121b8: 11 f0 breq .+4 ; 0x121be 121ba: 0c 94 2e af jmp 0x15e5c ; 0x15e5c { strchr_pointer = CMDBUFFER_CURRENT_STRING; 121be: 10 93 f6 16 sts 0x16F6, r17 ; 0x8016f6 121c2: 00 93 f5 16 sts 0x16F5, r16 ; 0x8016f5 121c6: f8 01 movw r30, r16 121c8: 31 96 adiw r30, 0x01 ; 1 int index; for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++); 121ca: 81 91 ld r24, Z+ 121cc: 80 32 cpi r24, 0x20 ; 32 121ce: e9 f3 breq .-6 ; 0x121ca 121d0: 89 30 cpi r24, 0x09 ; 9 121d2: d9 f3 breq .-10 ; 0x121ca /*for (++strchr_pointer; *strchr_pointer == ' ' || *strchr_pointer == '\t'; ++strchr_pointer);*/ if (*(strchr_pointer+index) < '0' || *(strchr_pointer+index) > '9') { 121d4: 80 53 subi r24, 0x30 ; 48 121d6: 8a 30 cpi r24, 0x0A ; 10 121d8: 30 f0 brcs .+12 ; 0x121e6 printf_P(PSTR("Invalid M code: %s\n"), cmdbuffer + bufindr + CMDHDRSIZE); 121da: 1f 93 push r17 121dc: 0f 93 push r16 121de: 8e e5 ldi r24, 0x5E ; 94 121e0: 90 e8 ldi r25, 0x80 ; 128 121e2: 0c 94 26 84 jmp 0x1084c ; 0x1084c } else { mcode_in_progress = code_value_short(); 121e6: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 121ea: 90 93 ab 0d sts 0x0DAB, r25 ; 0x800dab <_ZL17mcode_in_progress.lto_priv.493+0x1> 121ee: 80 93 aa 0d sts 0x0DAA, r24 ; 0x800daa <_ZL17mcode_in_progress.lto_priv.493> // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 121f2: 8e 3b cpi r24, 0xBE ; 190 121f4: 91 05 cpc r25, r1 121f6: 11 f4 brne .+4 ; 0x121fc 121f8: 0c 94 19 9c jmp 0x13832 ; 0x13832 121fc: 0c f0 brlt .+2 ; 0x12200 121fe: 31 c3 rjmp .+1634 ; 0x12862 12200: 8c 34 cpi r24, 0x4C ; 76 12202: 91 05 cpc r25, r1 12204: 11 f4 brne .+4 ; 0x1220a 12206: 0c 94 02 9b jmp 0x13604 ; 0x13604 1220a: 0c f0 brlt .+2 ; 0x1220e 1220c: df c1 rjmp .+958 ; 0x125cc 1220e: 8c 31 cpi r24, 0x1C ; 28 12210: 91 05 cpc r25, r1 12212: 11 f4 brne .+4 ; 0x12218 12214: 0c 94 39 99 jmp 0x13272 ; 0x13272 12218: 0c f0 brlt .+2 ; 0x1221c 1221a: f4 c0 rjmp .+488 ; 0x12404 1221c: 85 31 cpi r24, 0x15 ; 21 1221e: 91 05 cpc r25, r1 12220: 09 f4 brne .+2 ; 0x12224 12222: 40 c7 rjmp .+3712 ; 0x130a4 12224: 0c f0 brlt .+2 ; 0x12228 12226: 5a c0 rjmp .+180 ; 0x122dc 12228: 81 31 cpi r24, 0x11 ; 17 1222a: 91 05 cpc r25, r1 1222c: 09 f4 brne .+2 ; 0x12230 1222e: 2f c7 rjmp .+3678 ; 0x1308e 12230: dc f4 brge .+54 ; 0x12268 12232: 02 97 sbiw r24, 0x02 ; 2 12234: 08 f4 brcc .+2 ; 0x12238 12236: 93 c6 rjmp .+3366 ; 0x12f5e /*! #### End of M-Commands */ default: printf_P(MSG_UNKNOWN_CODE, 'M', cmdbuffer + bufindr + CMDHDRSIZE); 12238: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 1223c: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 12240: 8f 51 subi r24, 0x1F ; 31 12242: 90 4f sbci r25, 0xF0 ; 240 12244: 9f 93 push r25 12246: 8f 93 push r24 12248: 1f 92 push r1 1224a: 8d e4 ldi r24, 0x4D ; 77 1224c: 8f 93 push r24 1224e: 88 e4 ldi r24, 0x48 ; 72 12250: 96 e6 ldi r25, 0x66 ; 102 12252: 9f 93 push r25 12254: 8f 93 push r24 12256: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 1225a: 0f 90 pop r0 1225c: 0f 90 pop r0 1225e: 0f 90 pop r0 12260: 0f 90 pop r0 12262: 0f 90 pop r0 12264: 0f 90 pop r0 12266: de c6 rjmp .+3516 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12268: 82 31 cpi r24, 0x12 ; 18 1226a: 91 05 cpc r25, r1 1226c: 11 f4 brne .+4 ; 0x12272 1226e: 0c 94 c4 9c jmp 0x13988 ; 0x13988 12272: 44 97 sbiw r24, 0x14 ; 20 12274: 09 f7 brne .-62 ; 0x12238 #### Parameters - `T` - Report timestamps as well. The value is one uint32_t encoded as hex. Requires host software parsing (Cap:EXTENDED_M20). - `L` - Reports long filenames instead of just short filenames. Requires host software parsing (Cap:EXTENDED_M20). */ case 20: KEEPALIVE_STATE(NOT_BUSY); // do not send busy messages during listing. Inhibits the output of manage_heater() 12276: 81 e0 ldi r24, 0x01 ; 1 12278: 80 93 78 02 sts 0x0278, r24 ; 0x800278 SERIAL_PROTOCOLLNRPGM(_N("Begin file list"));////MSG_BEGIN_FILE_LIST 1227c: 88 e3 ldi r24, 0x38 ; 56 1227e: 96 e6 ldi r25, 0x66 ; 102 12280: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 card.ls(CardReader::ls_param(code_seen('L'), code_seen('T'))); 12284: 84 e5 ldi r24, 0x54 ; 84 12286: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1228a: 18 2f mov r17, r24 1228c: 8c e4 ldi r24, 0x4C ; 76 1228e: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12292: 00 e0 ldi r16, 0x00 ; 0 12294: 80 fb bst r24, 0 12296: 00 f9 bld r16, 0 12298: 10 fb bst r17, 0 1229a: 01 f9 bld r16, 1 } // while readDir } void CardReader::ls(ls_param params) { root.rewind(); 1229c: 80 ef ldi r24, 0xF0 ; 240 1229e: 93 e1 ldi r25, 0x13 ; 19 122a0: 0e 94 36 70 call 0xe06c ; 0xe06c lsDive("",root, NULL, LS_SerialPrint, params); 122a4: 83 e2 ldi r24, 0x23 ; 35 122a6: e0 ef ldi r30, 0xF0 ; 240 122a8: f3 e1 ldi r31, 0x13 ; 19 122aa: de 01 movw r26, r28 122ac: 11 96 adiw r26, 0x01 ; 1 122ae: 01 90 ld r0, Z+ 122b0: 0d 92 st X+, r0 122b2: 8a 95 dec r24 122b4: e1 f7 brne .-8 ; 0x122ae 122b6: 20 e0 ldi r18, 0x00 ; 0 122b8: 50 e0 ldi r21, 0x00 ; 0 122ba: 40 e0 ldi r20, 0x00 ; 0 122bc: be 01 movw r22, r28 122be: 6f 5f subi r22, 0xFF ; 255 122c0: 7f 4f sbci r23, 0xFF ; 255 122c2: 8a ed ldi r24, 0xDA ; 218 122c4: 92 e0 ldi r25, 0x02 ; 2 122c6: 0f 94 69 45 call 0x28ad2 ; 0x28ad2 122ca: ce 01 movw r24, r28 122cc: 01 96 adiw r24, 0x01 ; 1 122ce: 0e 94 3b 70 call 0xe076 ; 0xe076 SERIAL_PROTOCOLLNRPGM(_N("End file list"));////MSG_END_FILE_LIST 122d2: 8a e2 ldi r24, 0x2A ; 42 122d4: 96 e6 ldi r25, 0x66 ; 102 122d6: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 122da: a4 c6 rjmp .+3400 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 122dc: 88 31 cpi r24, 0x18 ; 24 122de: 91 05 cpc r25, r1 122e0: 09 f4 brne .+2 ; 0x122e4 122e2: f1 c6 rjmp .+3554 ; 0x130c6 122e4: 84 f4 brge .+32 ; 0x12306 122e6: 86 31 cpi r24, 0x16 ; 22 122e8: 91 05 cpc r25, r1 122ea: 09 f4 brne .+2 ; 0x122ee 122ec: df c6 rjmp .+3518 ; 0x130ac 122ee: 47 97 sbiw r24, 0x17 ; 23 122f0: 09 f0 breq .+2 ; 0x122f4 122f2: a2 cf rjmp .-188 ; 0x12238 M23 [filename] */ case 23: card.openFileReadFilteredGcode(strchr_pointer + 4, true); 122f4: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 122f8: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 122fc: 61 e0 ldi r22, 0x01 ; 1 122fe: 04 96 adiw r24, 0x04 ; 4 12300: 0f 94 06 4c call 0x2980c ; 0x2980c 12304: 8f c6 rjmp .+3358 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12306: 8a 31 cpi r24, 0x1A ; 26 12308: 91 05 cpc r25, r1 1230a: 09 f4 brne .+2 ; 0x1230e 1230c: 22 c7 rjmp .+3652 ; 0x13152 1230e: 0c f0 brlt .+2 ; 0x12312 12310: 42 c7 rjmp .+3716 ; 0x13196 12312: 04 ec ldi r16, 0xC4 ; 196 12314: 12 e0 ldi r17, 0x02 ; 2 12316: f2 e4 ldi r31, 0x42 ; 66 12318: af 2e mov r10, r31 1231a: f2 e0 ldi r31, 0x02 ; 2 1231c: bf 2e mov r11, r31 1231e: a4 e2 ldi r26, 0x24 ; 36 12320: ca 2e mov r12, r26 12322: a2 e0 ldi r26, 0x02 ; 2 12324: da 2e mov r13, r26 12326: b8 e1 ldi r27, 0x18 ; 24 12328: eb 2e mov r14, r27 1232a: b2 e0 ldi r27, 0x02 ; 2 1232c: fb 2e mov r15, r27 1232e: 87 ec ldi r24, 0xC7 ; 199 12330: 88 2e mov r8, r24 12332: 82 e0 ldi r24, 0x02 ; 2 12334: 98 2e mov r9, r24 case 125: case 601: { //Set new pause position for all three axis XYZ for (uint8_t axis = 0; axis < E_AXIS; axis++) { if (code_seen(axis_codes[axis])) { 12336: f8 01 movw r30, r16 12338: 81 91 ld r24, Z+ 1233a: 8f 01 movw r16, r30 1233c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12340: 88 23 and r24, r24 12342: 21 f1 breq .+72 ; 0x1238c //Check that the positions are within hardware limits pause_position[axis] = constrain(code_value(), min_pos[axis], max_pos[axis]); 12344: 0e 94 03 5a call 0xb406 ; 0xb406 12348: d6 01 movw r26, r12 1234a: 4d 90 ld r4, X+ 1234c: 5d 90 ld r5, X+ 1234e: 6d 90 ld r6, X+ 12350: 7c 90 ld r7, X 12352: a3 01 movw r20, r6 12354: 92 01 movw r18, r4 12356: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1235a: 87 fd sbrc r24, 7 1235c: 11 c0 rjmp .+34 ; 0x12380 1235e: 0e 94 03 5a call 0xb406 ; 0xb406 12362: f7 01 movw r30, r14 12364: 40 80 ld r4, Z 12366: 51 80 ldd r5, Z+1 ; 0x01 12368: 62 80 ldd r6, Z+2 ; 0x02 1236a: 73 80 ldd r7, Z+3 ; 0x03 1236c: a3 01 movw r20, r6 1236e: 92 01 movw r18, r4 12370: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 12374: 18 16 cp r1, r24 12376: 24 f0 brlt .+8 ; 0x12380 12378: 0e 94 03 5a call 0xb406 ; 0xb406 1237c: 2b 01 movw r4, r22 1237e: 3c 01 movw r6, r24 12380: d5 01 movw r26, r10 12382: 4d 92 st X+, r4 12384: 5d 92 st X+, r5 12386: 6d 92 st X+, r6 12388: 7c 92 st X, r7 1238a: 13 97 sbiw r26, 0x03 ; 3 1238c: b4 e0 ldi r27, 0x04 ; 4 1238e: ab 0e add r10, r27 12390: b1 1c adc r11, r1 12392: e4 e0 ldi r30, 0x04 ; 4 12394: ce 0e add r12, r30 12396: d1 1c adc r13, r1 12398: f4 e0 ldi r31, 0x04 ; 4 1239a: ef 0e add r14, r31 1239c: f1 1c adc r15, r1 case 25: case 125: case 601: { //Set new pause position for all three axis XYZ for (uint8_t axis = 0; axis < E_AXIS; axis++) { 1239e: 80 16 cp r8, r16 123a0: 91 06 cpc r9, r17 123a2: 49 f6 brne .-110 ; 0x12336 //Check that the positions are within hardware limits pause_position[axis] = constrain(code_value(), min_pos[axis], max_pos[axis]); } } //Set default or new pause position without pausing if (code_seen('S')) { 123a4: 83 e5 ldi r24, 0x53 ; 83 123a6: 0e 94 2b 55 call 0xaa56 ; 0xaa56 123aa: 88 23 and r24, r24 123ac: 11 f4 brne .+4 ; 0x123b2 123ae: 0c 94 04 a9 jmp 0x15208 ; 0x15208 if ( code_value_uint8() == 0 ) { 123b2: 0e 94 40 55 call 0xaa80 ; 0xaa80 123b6: 81 11 cpse r24, r1 123b8: 35 c6 rjmp .+3178 ; 0x13024 pause_position[X_AXIS] = X_PAUSE_POS; 123ba: 80 e0 ldi r24, 0x00 ; 0 123bc: 90 e0 ldi r25, 0x00 ; 0 123be: a8 e4 ldi r26, 0x48 ; 72 123c0: b2 e4 ldi r27, 0x42 ; 66 123c2: 80 93 42 02 sts 0x0242, r24 ; 0x800242 <_ZL14pause_position.lto_priv.495> 123c6: 90 93 43 02 sts 0x0243, r25 ; 0x800243 <_ZL14pause_position.lto_priv.495+0x1> 123ca: a0 93 44 02 sts 0x0244, r26 ; 0x800244 <_ZL14pause_position.lto_priv.495+0x2> 123ce: b0 93 45 02 sts 0x0245, r27 ; 0x800245 <_ZL14pause_position.lto_priv.495+0x3> pause_position[Y_AXIS] = Y_PAUSE_POS; 123d2: 80 e0 ldi r24, 0x00 ; 0 123d4: 90 e0 ldi r25, 0x00 ; 0 123d6: ae e3 ldi r26, 0x3E ; 62 123d8: b3 e4 ldi r27, 0x43 ; 67 123da: 80 93 46 02 sts 0x0246, r24 ; 0x800246 <_ZL14pause_position.lto_priv.495+0x4> 123de: 90 93 47 02 sts 0x0247, r25 ; 0x800247 <_ZL14pause_position.lto_priv.495+0x5> 123e2: a0 93 48 02 sts 0x0248, r26 ; 0x800248 <_ZL14pause_position.lto_priv.495+0x6> 123e6: b0 93 49 02 sts 0x0249, r27 ; 0x800249 <_ZL14pause_position.lto_priv.495+0x7> pause_position[Z_AXIS] = Z_PAUSE_LIFT; 123ea: 80 e0 ldi r24, 0x00 ; 0 123ec: 90 e0 ldi r25, 0x00 ; 0 123ee: a0 ea ldi r26, 0xA0 ; 160 123f0: b1 e4 ldi r27, 0x41 ; 65 123f2: 80 93 4a 02 sts 0x024A, r24 ; 0x80024a <_ZL14pause_position.lto_priv.495+0x8> 123f6: 90 93 4b 02 sts 0x024B, r25 ; 0x80024b <_ZL14pause_position.lto_priv.495+0x9> 123fa: a0 93 4c 02 sts 0x024C, r26 ; 0x80024c <_ZL14pause_position.lto_priv.495+0xa> 123fe: b0 93 4d 02 sts 0x024D, r27 ; 0x80024d <_ZL14pause_position.lto_priv.495+0xb> 12402: 10 c6 rjmp .+3104 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12404: 8c 32 cpi r24, 0x2C ; 44 12406: 91 05 cpc r25, r1 12408: 11 f4 brne .+4 ; 0x1240e 1240a: 0c 94 0a 9a jmp 0x13414 ; 0x13414 1240e: 0c f0 brlt .+2 ; 0x12412 12410: 8f c0 rjmp .+286 ; 0x12530 12412: 8f 31 cpi r24, 0x1F ; 31 12414: 91 05 cpc r25, r1 12416: 09 f4 brne .+2 ; 0x1241a 12418: d3 c7 rjmp .+4006 ; 0x133c0 1241a: 0c f0 brlt .+2 ; 0x1241e 1241c: 52 c0 rjmp .+164 ; 0x124c2 1241e: 8d 31 cpi r24, 0x1D ; 29 12420: 91 05 cpc r25, r1 12422: 09 f4 brne .+2 ; 0x12426 12424: ff c5 rjmp .+3070 ; 0x13024 12426: 4e 97 sbiw r24, 0x1e ; 30 12428: 09 f0 breq .+2 ; 0x1242c 1242a: 06 cf rjmp .-500 ; 0x12238 M30 [filename] */ case 30: if (card.mounted){ 1242c: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 12430: 88 23 and r24, r24 12432: 09 f4 brne .+2 ; 0x12436 12434: f7 c5 rjmp .+3054 ; 0x13024 card.closefile(); 12436: 0f 94 e4 41 call 0x283c8 ; 0x283c8 card.removeFile(strchr_pointer + 4); 1243a: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 1243e: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 12442: 0c 5f subi r16, 0xFC ; 252 12444: 1f 4f sbci r17, 0xFF ; 255 } } void CardReader::removeFile(const char* name) { if(!mounted) return; 12446: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1244a: 88 23 and r24, r24 1244c: 09 f4 brne .+2 ; 0x12450 1244e: ea c5 rjmp .+3028 ; 0x13024 file.close(); 12450: 8a ef ldi r24, 0xFA ; 250 12452: 95 e1 ldi r25, 0x15 ; 21 12454: 0f 94 92 6e call 0x2dd24 ; 0x2dd24 sdprinting = false; 12458: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a const char *fname=name; 1245c: 1d a3 std Y+37, r17 ; 0x25 1245e: 0c a3 std Y+36, r16 ; 0x24 if (!diveSubfolder(fname)) 12460: ce 01 movw r24, r28 12462: 84 96 adiw r24, 0x24 ; 36 12464: 0f 94 81 4b call 0x29702 ; 0x29702 12468: 88 23 and r24, r24 1246a: 09 f4 brne .+2 ; 0x1246e 1246c: db c5 rjmp .+2998 ; 0x13024 return; if (file.remove(curDir, fname)) 1246e: 4c a1 ldd r20, Y+36 ; 0x24 12470: 5d a1 ldd r21, Y+37 ; 0x25 12472: 60 91 13 14 lds r22, 0x1413 ; 0x801413 12476: 70 91 14 14 lds r23, 0x1414 ; 0x801414 * \brief Base class for SdFile with Print and C++ streams. */ class SdBaseFile { public: /** Create an instance. */ SdBaseFile() : writeError(false), type_(FAT_FILE_TYPE_CLOSED) {} 1247a: 19 82 std Y+1, r1 ; 0x01 1247c: 1c 82 std Y+4, r1 ; 0x04 * \a dirFile is not a directory, \a path is not found * or an I/O error occurred. */ bool SdBaseFile::remove(SdBaseFile* dirFile, const char* path) { SdBaseFile file; if (!file.open(dirFile, path, O_WRITE)) goto fail; 1247e: 22 e0 ldi r18, 0x02 ; 2 12480: ce 01 movw r24, r28 12482: 01 96 adiw r24, 0x01 ; 1 12484: 0f 94 89 99 call 0x33312 ; 0x33312 12488: 81 11 cpse r24, r1 1248a: fb c6 rjmp .+3574 ; 0x13282 return file.remove(); fail: // can't set iostate - static function return false; 1248c: 10 e0 ldi r17, 0x00 ; 0 * Reasons for failure include the file is a directory, is read only, * \a dirFile is not a directory, \a path is not found * or an I/O error occurred. */ bool SdBaseFile::remove(SdBaseFile* dirFile, const char* path) { SdBaseFile file; 1248e: ce 01 movw r24, r28 12490: 01 96 adiw r24, 0x01 ; 1 12492: 0e 94 3b 70 call 0xe076 ; 0xe076 12496: 11 23 and r17, r17 12498: 09 f4 brne .+2 ; 0x1249c 1249a: 0a c7 rjmp .+3604 ; 0x132b0 { SERIAL_PROTOCOLPGM("File deleted:"); 1249c: 85 ee ldi r24, 0xE5 ; 229 1249e: 9d e7 ldi r25, 0x7D ; 125 124a0: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_PROTOCOLLN(fname); 124a4: 8c a1 ldd r24, Y+36 ; 0x24 124a6: 9d a1 ldd r25, Y+37 ; 0x25 124a8: 0f 94 fd 98 call 0x331fa ; 0x331fa sdpos = 0; 124ac: 10 92 7e 16 sts 0x167E, r1 ; 0x80167e 124b0: 10 92 7f 16 sts 0x167F, r1 ; 0x80167f 124b4: 10 92 80 16 sts 0x1680, r1 ; 0x801680 124b8: 10 92 81 16 sts 0x1681, r1 ; 0x801681 #ifdef SDCARD_SORT_ALPHA presort(); 124bc: 0f 94 45 49 call 0x2928a ; 0x2928a 124c0: b1 c5 rjmp .+2914 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 124c2: 80 32 cpi r24, 0x20 ; 32 124c4: 91 05 cpc r25, r1 124c6: 09 f4 brne .+2 ; 0x124ca 124c8: 01 c7 rjmp .+3586 ; 0x132cc 124ca: 8a 97 sbiw r24, 0x2a ; 42 124cc: 09 f0 breq .+2 ; 0x124d0 124ce: b4 ce rjmp .-664 ; 0x12238 #### Parameters - `P` - Pin number. - `S` - Pin value. If the pin is analog, values are from 0 to 255. If the pin is digital, values are from 0 to 1. */ case 42: if (code_seen('S')) 124d0: 83 e5 ldi r24, 0x53 ; 83 124d2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 124d6: 88 23 and r24, r24 124d8: 09 f4 brne .+2 ; 0x124dc 124da: a4 c5 rjmp .+2888 ; 0x13024 { uint8_t pin_status = code_value_uint8(); 124dc: 0e 94 40 55 call 0xaa80 ; 0xaa80 124e0: 08 2f mov r16, r24 int8_t pin_number = LED_PIN; if (code_seen('P')) 124e2: 80 e5 ldi r24, 0x50 ; 80 124e4: 0e 94 2b 55 call 0xaa56 ; 0xaa56 */ case 42: if (code_seen('S')) { uint8_t pin_status = code_value_uint8(); int8_t pin_number = LED_PIN; 124e8: 1d e0 ldi r17, 0x0D ; 13 if (code_seen('P')) 124ea: 88 23 and r24, r24 124ec: 19 f0 breq .+6 ; 0x124f4 pin_number = code_value_uint8(); 124ee: 0e 94 40 55 call 0xaa80 ; 0xaa80 124f2: 18 2f mov r17, r24 124f4: e3 e3 ldi r30, 0x33 ; 51 124f6: f0 e8 ldi r31, 0x80 ; 128 for(int8_t i = 0; i < (int8_t)(sizeof(sensitive_pins)/sizeof(sensitive_pins[0])); i++) { if ((int8_t)pgm_read_byte(&sensitive_pins[i]) == pin_number) 124f8: 84 91 lpm r24, Z 124fa: 81 17 cp r24, r17 124fc: 09 f4 brne .+2 ; 0x12500 124fe: 92 c5 rjmp .+2852 ; 0x13024 12500: 31 96 adiw r30, 0x01 ; 1 { uint8_t pin_status = code_value_uint8(); int8_t pin_number = LED_PIN; if (code_seen('P')) pin_number = code_value_uint8(); for(int8_t i = 0; i < (int8_t)(sizeof(sensitive_pins)/sizeof(sensitive_pins[0])); i++) 12502: 30 e8 ldi r19, 0x80 ; 128 12504: ef 34 cpi r30, 0x4F ; 79 12506: f3 07 cpc r31, r19 12508: b9 f7 brne .-18 ; 0x124f8 pin_number = -1; break; } } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) 1250a: 16 30 cpi r17, 0x06 ; 6 1250c: 09 f0 breq .+2 ; 0x12510 1250e: 7f c7 rjmp .+3838 ; 0x1340e fanSpeed = pin_status; 12510: 00 93 e9 11 sts 0x11E9, r16 ; 0x8011e9 #endif if (pin_number > -1) { pinMode(pin_number, OUTPUT); 12514: 61 e0 ldi r22, 0x01 ; 1 12516: 81 2f mov r24, r17 12518: 0e 94 40 c0 call 0x18080 ; 0x18080 digitalWrite(pin_number, pin_status); 1251c: 60 2f mov r22, r16 1251e: 81 2f mov r24, r17 12520: 0e 94 12 c0 call 0x18024 ; 0x18024 analogWrite(pin_number, pin_status); 12524: 60 2f mov r22, r16 12526: 70 e0 ldi r23, 0x00 ; 0 12528: 81 2f mov r24, r17 1252a: 0e 94 71 c0 call 0x180e2 ; 0x180e2 1252e: 7a c5 rjmp .+2804 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12530: 8f 32 cpi r24, 0x2F ; 47 12532: 91 05 cpc r25, r1 12534: 09 f4 brne .+2 ; 0x12538 12536: 97 c7 rjmp .+3886 ; 0x13466 12538: 5c f5 brge .+86 ; 0x12590 1253a: 8d 32 cpi r24, 0x2D ; 45 1253c: 91 05 cpc r25, r1 1253e: 09 f4 brne .+2 ; 0x12542 12540: 82 c7 rjmp .+3844 ; 0x13446 12542: 8e 97 sbiw r24, 0x2e ; 46 12544: 09 f0 breq .+2 ; 0x12548 12546: 78 ce rjmp .-784 ; 0x12238 ### M46 - Show the assigned IP address M46: Show the assigned IP address. */ case 46: { // M46: Prusa3D: Show the assigned IP address. if (card.ToshibaFlashAir_isEnabled()) { 12548: 80 91 db 15 lds r24, 0x15DB ; 0x8015db 1254c: 88 23 and r24, r24 1254e: 09 f4 brne .+2 ; 0x12552 12550: 85 c7 rjmp .+3850 ; 0x1345c uint8_t ip[4]; if (card.ToshibaFlashAir_GetIP(ip)) { 12552: ce 01 movw r24, r28 12554: 01 96 adiw r24, 0x01 ; 1 12556: 0f 94 8a 52 call 0x2a514 ; 0x2a514 1255a: 88 23 and r24, r24 1255c: 09 f4 brne .+2 ; 0x12560 1255e: 79 c7 rjmp .+3826 ; 0x13452 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 12560: 89 81 ldd r24, Y+1 ; 0x01 12562: 0e 94 41 70 call 0xe082 ; 0xe082 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 12566: 8e e2 ldi r24, 0x2E ; 46 12568: 0e 94 41 70 call 0xe082 ; 0xe082 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 1256c: 8a 81 ldd r24, Y+2 ; 0x02 1256e: 0e 94 41 70 call 0xe082 ; 0xe082 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 12572: 8e e2 ldi r24, 0x2E ; 46 12574: 0e 94 41 70 call 0xe082 ; 0xe082 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 12578: 8b 81 ldd r24, Y+3 ; 0x03 1257a: 0e 94 41 70 call 0xe082 ; 0xe082 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 1257e: 8e e2 ldi r24, 0x2E ; 46 12580: 0e 94 41 70 call 0xe082 ; 0xe082 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 12584: 8c 81 ldd r24, Y+4 ; 0x04 12586: 0e 94 41 70 call 0xe082 ; 0xe082 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 1258a: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 1258e: 4a c5 rjmp .+2708 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12590: 89 34 cpi r24, 0x49 ; 73 12592: 91 05 cpc r25, r1 12594: 09 f4 brne .+2 ; 0x12598 12596: 90 c7 rjmp .+3872 ; 0x134b8 12598: 8b 34 cpi r24, 0x4B ; 75 1259a: 91 05 cpc r25, r1 1259c: 11 f4 brne .+4 ; 0x125a2 1259e: 0c 94 fc 9a jmp 0x135f8 ; 0x135f8 125a2: 88 34 cpi r24, 0x48 ; 72 125a4: 91 05 cpc r25, r1 125a6: 09 f0 breq .+2 ; 0x125aa 125a8: 47 ce rjmp .-882 ; 0x12238 #### Parameters - `Snnn` - Set printer state 0 = not_ready, 1 = ready */ case 72: { if(code_seen('S')){ 125aa: 83 e5 ldi r24, 0x53 ; 83 125ac: 0e 94 2b 55 call 0xaa56 ; 0xaa56 125b0: 88 23 and r24, r24 125b2: 09 f4 brne .+2 ; 0x125b6 125b4: 72 c7 rjmp .+3812 ; 0x1349a switch (code_value_uint8()){ 125b6: 0e 94 40 55 call 0xaa80 ; 0xaa80 125ba: 88 23 and r24, r24 125bc: 09 f4 brne .+2 ; 0x125c0 125be: 6a c7 rjmp .+3796 ; 0x13494 125c0: 81 30 cpi r24, 0x01 ; 1 125c2: 09 f0 breq .+2 ; 0x125c6 125c4: 2f c5 rjmp .+2654 ; 0x13024 125c6: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.367> 125ca: 2c c5 rjmp .+2648 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 125cc: 8b 36 cpi r24, 0x6B ; 107 125ce: 91 05 cpc r25, r1 125d0: 11 f4 brne .+4 ; 0x125d6 125d2: 0c 94 bb 9c jmp 0x13976 ; 0x13976 125d6: 0c f0 brlt .+2 ; 0x125da 125d8: ab c0 rjmp .+342 ; 0x12730 125da: 84 35 cpi r24, 0x54 ; 84 125dc: 91 05 cpc r25, r1 125de: 11 f4 brne .+4 ; 0x125e4 125e0: 0c 94 c4 9c jmp 0x13988 ; 0x13988 125e4: 0c f0 brlt .+2 ; 0x125e8 125e6: 5d c0 rjmp .+186 ; 0x126a2 125e8: 8f 34 cpi r24, 0x4F ; 79 125ea: 91 05 cpc r25, r1 125ec: 11 f4 brne .+4 ; 0x125f2 125ee: 0c 94 4a 9b jmp 0x13694 ; 0x13694 125f2: 0c f0 brlt .+2 ; 0x125f6 125f4: 47 c0 rjmp .+142 ; 0x12684 125f6: 8d 34 cpi r24, 0x4D ; 77 125f8: 91 05 cpc r25, r1 125fa: 11 f4 brne .+4 ; 0x12600 125fc: 0c 94 15 9b jmp 0x1362a ; 0x1362a 12600: 8e 34 cpi r24, 0x4E ; 78 12602: 91 05 cpc r25, r1 12604: 09 f0 breq .+2 ; 0x12608 12606: 18 ce rjmp .-976 ; 0x12238 const char *_m_fil; const char *_m_time; uint32_t _cm = 0; uint32_t _min = 0; if (printJobOngoing()) { 12608: 0e 94 c8 60 call 0xc190 ; 0xc190 1260c: 88 23 and r24, r24 1260e: 11 f4 brne .+4 ; 0x12614 12610: 0c 94 1a 9b jmp 0x13634 ; 0x13634 _m_fil = _O(MSG_FILAMENT_USED); _m_time = _O(MSG_PRINT_TIME); _cm = (uint32_t)total_filament_used / 1000; 12614: 60 91 84 06 lds r22, 0x0684 ; 0x800684 12618: 70 91 85 06 lds r23, 0x0685 ; 0x800685 1261c: 80 91 86 06 lds r24, 0x0686 ; 0x800686 12620: 90 91 87 06 lds r25, 0x0687 ; 0x800687 12624: 28 ee ldi r18, 0xE8 ; 232 12626: 33 e0 ldi r19, 0x03 ; 3 12628: 40 e0 ldi r20, 0x00 ; 0 1262a: 50 e0 ldi r21, 0x00 ; 0 1262c: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> 12630: 12 2f mov r17, r18 12632: 03 2f mov r16, r19 12634: f4 2e mov r15, r20 12636: e5 2e mov r14, r21 _min = print_job_timer.duration() / 60; 12638: 0f 94 66 1c call 0x238cc ; 0x238cc 1263c: 2c e3 ldi r18, 0x3C ; 60 1263e: 30 e0 ldi r19, 0x00 ; 0 12640: 40 e0 ldi r20, 0x00 ; 0 12642: 50 e0 ldi r21, 0x00 ; 0 12644: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> 12648: b9 01 movw r22, r18 1264a: ca 01 movw r24, r20 uint32_t _cm = 0; uint32_t _min = 0; if (printJobOngoing()) { _m_fil = _O(MSG_FILAMENT_USED); _m_time = _O(MSG_PRINT_TIME); 1264c: 45 e1 ldi r20, 0x15 ; 21 1264e: 5b e4 ldi r21, 0x4B ; 75 const char *_m_time; uint32_t _cm = 0; uint32_t _min = 0; if (printJobOngoing()) { _m_fil = _O(MSG_FILAMENT_USED); 12650: 25 e0 ldi r18, 0x05 ; 5 12652: 3b e4 ldi r19, 0x4B ; 75 _m_fil = _O(MSG_TOTAL_FILAMENT); _m_time = _O(MSG_TOTAL_PRINT_TIME); _cm = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); _min = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); } printf_P(_N("%S:%lu cm\n%S:%lu min\n"),_m_fil,_cm,_m_time,_min); 12654: 9f 93 push r25 12656: 8f 93 push r24 12658: 7f 93 push r23 1265a: 6f 93 push r22 1265c: 5f 93 push r21 1265e: 4f 93 push r20 12660: ef 92 push r14 12662: ff 92 push r15 12664: 0f 93 push r16 12666: 1f 93 push r17 12668: 3f 93 push r19 1266a: 2f 93 push r18 1266c: 81 ea ldi r24, 0xA1 ; 161 1266e: 95 e6 ldi r25, 0x65 ; 101 12670: 9f 93 push r25 12672: 8f 93 push r24 12674: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 12678: 0f b6 in r0, 0x3f ; 63 1267a: f8 94 cli 1267c: de bf out 0x3e, r29 ; 62 1267e: 0f be out 0x3f, r0 ; 63 12680: cd bf out 0x3d, r28 ; 61 12682: d0 c4 rjmp .+2464 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12684: 82 35 cpi r24, 0x52 ; 82 12686: 91 05 cpc r25, r1 12688: 11 f4 brne .+4 ; 0x1268e 1268a: 0c 94 be 9c jmp 0x1397c ; 0x1397c 1268e: 83 35 cpi r24, 0x53 ; 83 12690: 91 05 cpc r25, r1 12692: 09 f0 breq .+2 ; 0x12696 12694: d1 cd rjmp .-1118 ; 0x12238 /*! ### M83 - Set E axis to relative mode M83: Set extruder to relative mode Makes the extruder interpret extrusion values as relative positions. */ case 83: axis_relative_modes |= E_AXIS_MASK; 12696: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb 1269a: 88 60 ori r24, 0x08 ; 8 1269c: 80 93 eb 11 sts 0x11EB, r24 ; 0x8011eb 126a0: c1 c4 rjmp .+2434 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 126a2: 8c 35 cpi r24, 0x5C ; 92 126a4: 91 05 cpc r25, r1 126a6: 11 f4 brne .+4 ; 0x126ac 126a8: 0c 94 2d 9d jmp 0x13a5a ; 0x13a5a 126ac: 34 f5 brge .+76 ; 0x126fa 126ae: 85 35 cpi r24, 0x55 ; 85 126b0: 91 05 cpc r25, r1 126b2: 11 f4 brne .+4 ; 0x126b8 126b4: 0c 94 14 9d jmp 0x13a28 ; 0x13a28 126b8: 86 35 cpi r24, 0x56 ; 86 126ba: 91 05 cpc r25, r1 126bc: 09 f0 breq .+2 ; 0x126c0 126be: bc cd rjmp .-1160 ; 0x12238 #### Parameters - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled. */ case 86: if (code_seen('S')) { 126c0: 83 e5 ldi r24, 0x53 ; 83 126c2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 126c6: 88 23 and r24, r24 126c8: 09 f4 brne .+2 ; 0x126cc 126ca: ac c4 rjmp .+2392 ; 0x13024 safetytimer_inactive_time = code_value() * 1000; 126cc: 0e 94 03 5a call 0xb406 ; 0xb406 126d0: 20 e0 ldi r18, 0x00 ; 0 126d2: 30 e0 ldi r19, 0x00 ; 0 126d4: 4a e7 ldi r20, 0x7A ; 122 126d6: 54 e4 ldi r21, 0x44 ; 68 126d8: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 126dc: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 126e0: 60 93 33 02 sts 0x0233, r22 ; 0x800233 126e4: 70 93 34 02 sts 0x0234, r23 ; 0x800234 126e8: 80 93 35 02 sts 0x0235, r24 ; 0x800235 126ec: 90 93 36 02 sts 0x0236, r25 ; 0x800236 safetyTimer.start(); 126f0: 8a e1 ldi r24, 0x1A ; 26 126f2: 96 e0 ldi r25, 0x06 ; 6 126f4: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> 126f8: 95 c4 rjmp .+2346 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 126fa: 89 36 cpi r24, 0x69 ; 105 126fc: 91 05 cpc r25, r1 126fe: 11 f4 brne .+4 ; 0x12704 12700: 0c 94 9d 9b jmp 0x1373a ; 0x1373a 12704: 14 f0 brlt .+4 ; 0x1270a 12706: 0c 94 ad 9c jmp 0x1395a ; 0x1395a 1270a: 88 36 cpi r24, 0x68 ; 104 1270c: 91 05 cpc r25, r1 1270e: 09 f0 breq .+2 ; 0x12712 12710: 93 cd rjmp .-1242 ; 0x12238 #### Parameters - `S` - Target temperature */ case 104: // M104 { if (code_seen('S')) 12712: 83 e5 ldi r24, 0x53 ; 83 12714: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12718: 88 23 and r24, r24 1271a: 09 f4 brne .+2 ; 0x1271e 1271c: 83 c4 rjmp .+2310 ; 0x13024 { setTargetHotend(code_value()); 1271e: 0e 94 03 5a call 0xb406 ; 0xb406 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 12722: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 12726: 70 93 f2 11 sts 0x11F2, r23 ; 0x8011f2 1272a: 60 93 f1 11 sts 0x11F1, r22 ; 0x8011f1 1272e: 7a c4 rjmp .+2292 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12730: 85 37 cpi r24, 0x75 ; 117 12732: 91 05 cpc r25, r1 12734: 11 f4 brne .+4 ; 0x1273a 12736: 0c 94 ab 9e jmp 0x13d56 ; 0x13d56 1273a: bc f5 brge .+110 ; 0x127aa 1273c: 80 37 cpi r24, 0x70 ; 112 1273e: 91 05 cpc r25, r1 12740: 09 f4 brne .+2 ; 0x12744 12742: e8 c7 rjmp .+4048 ; 0x13714 12744: d4 f4 brge .+52 ; 0x1277a 12746: 8d 36 cpi r24, 0x6D ; 109 12748: 91 05 cpc r25, r1 1274a: 11 f4 brne .+4 ; 0x12750 1274c: 0c 94 c9 9b jmp 0x13792 ; 0x13792 12750: 8e 36 cpi r24, 0x6E ; 110 12752: 91 05 cpc r25, r1 12754: 09 f0 breq .+2 ; 0x12758 12756: 70 cd rjmp .-1312 ; 0x12238 #### Parameters - `N` - Line number */ case 110: if (code_seen('N')) 12758: 8e e4 ldi r24, 0x4E ; 78 1275a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1275e: 88 23 and r24, r24 12760: 09 f4 brne .+2 ; 0x12764 12762: 60 c4 rjmp .+2240 ; 0x13024 gcode_LastN = code_value_long(); 12764: 0e 94 93 55 call 0xab26 ; 0xab26 12768: 60 93 d1 11 sts 0x11D1, r22 ; 0x8011d1 1276c: 70 93 d2 11 sts 0x11D2, r23 ; 0x8011d2 12770: 80 93 d3 11 sts 0x11D3, r24 ; 0x8011d3 12774: 90 93 d4 11 sts 0x11D4, r25 ; 0x8011d4 12778: 55 c4 rjmp .+2218 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1277a: 82 37 cpi r24, 0x72 ; 114 1277c: 91 05 cpc r25, r1 1277e: 11 f4 brne .+4 ; 0x12784 12780: 0c 94 a8 9e jmp 0x13d50 ; 0x13d50 12784: 14 f4 brge .+4 ; 0x1278a 12786: 0c 94 b5 9d jmp 0x13b6a ; 0x13b6a 1278a: 83 37 cpi r24, 0x73 ; 115 1278c: 91 05 cpc r25, r1 1278e: 09 f0 breq .+2 ; 0x12792 12790: 53 cd rjmp .-1370 ; 0x12238 #### Parameters - V - Report current installed firmware version - U - Firmware version provided by G-code to be compared to current one. */ case 115: // M115 if (code_seen('V')) { 12792: 86 e5 ldi r24, 0x56 ; 86 12794: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12798: 88 23 and r24, r24 1279a: 11 f4 brne .+4 ; 0x127a0 1279c: 0c 94 d4 9d jmp 0x13ba8 ; 0x13ba8 // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); 127a0: 83 ec ldi r24, 0xC3 ; 195 127a2: 9e e9 ldi r25, 0x9E ; 158 127a4: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 127a8: 3d c4 rjmp .+2170 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 127aa: 8b 37 cpi r24, 0x7B ; 123 127ac: 91 05 cpc r25, r1 127ae: 11 f4 brne .+4 ; 0x127b4 127b0: 0c 94 03 9f jmp 0x13e06 ; 0x13e06 127b4: 0c f0 brlt .+2 ; 0x127b8 127b6: 48 c0 rjmp .+144 ; 0x12848 127b8: 86 37 cpi r24, 0x76 ; 118 127ba: 91 05 cpc r25, r1 127bc: 11 f4 brne .+4 ; 0x127c2 127be: 0c 94 bb 9e jmp 0x13d76 ; 0x13d76 127c2: 87 37 cpi r24, 0x77 ; 119 127c4: 91 05 cpc r25, r1 127c6: 09 f0 breq .+2 ; 0x127ca 127c8: 37 cd rjmp .-1426 ; 0x12238 /*! ### M119 - Get endstop states M119: Get Endstop Status Returns the current state of the configured X, Y, Z endstops. Takes into account any 'inverted endstop' settings, so one can confirm that the machine is interpreting the endstops correctly. */ case 119: SERIAL_PROTOCOLRPGM(_N("Reporting endstop status"));////MSG_M119_REPORT 127ca: 8e e4 ldi r24, 0x4E ; 78 127cc: 95 e6 ldi r25, 0x65 ; 101 127ce: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_PROTOCOLLN(); 127d2: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_min: "));////MSG_X_MIN 127d6: 86 e4 ldi r24, 0x46 ; 70 127d8: 95 e6 ldi r25, 0x65 ; 101 127da: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 if(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){ 127de: 1e 9b sbis 0x03, 6 ; 3 127e0: 02 c0 rjmp .+4 ; 0x127e6 127e2: 0c 94 f3 9e jmp 0x13de6 ; 0x13de6 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 127e6: 81 e4 ldi r24, 0x41 ; 65 127e8: 95 e6 ldi r25, 0x65 ; 101 SERIAL_PROTOCOLRPGM(_N("Reporting endstop status"));////MSG_M119_REPORT SERIAL_PROTOCOLLN(); #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_min: "));////MSG_X_MIN if(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); 127ea: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 127ee: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_min: "));////MSG_Y_MIN 127f2: 8f e2 ldi r24, 0x2F ; 47 127f4: 95 e6 ldi r25, 0x65 ; 101 127f6: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 if(READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ 127fa: 1d 9b sbis 0x03, 5 ; 3 127fc: 02 c0 rjmp .+4 ; 0x12802 127fe: 0c 94 f7 9e jmp 0x13dee ; 0x13dee SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 12802: 81 e4 ldi r24, 0x41 ; 65 12804: 95 e6 ldi r25, 0x65 ; 101 SERIAL_PROTOCOLLN(); #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_min: "));////MSG_Y_MIN if(READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); 12806: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 1280a: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MIN); 1280e: 87 e2 ldi r24, 0x27 ; 39 12810: 95 e6 ldi r25, 0x65 ; 101 12812: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 if(READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ 12816: 1c 9b sbis 0x03, 4 ; 3 12818: 02 c0 rjmp .+4 ; 0x1281e 1281a: 0c 94 fb 9e jmp 0x13df6 ; 0x13df6 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 1281e: 81 e4 ldi r24, 0x41 ; 65 12820: 95 e6 ldi r25, 0x65 ; 101 SERIAL_PROTOCOLLN(); #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MIN); if(READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); 12822: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 12826: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MAX); 1282a: 8f e1 ldi r24, 0x1F ; 31 1282c: 95 e6 ldi r25, 0x65 ; 101 1282e: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 if(READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ 12832: 01 99 sbic 0x00, 1 ; 0 12834: 02 c0 rjmp .+4 ; 0x1283a 12836: 0c 94 ff 9e jmp 0x13dfe ; 0x13dfe SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 1283a: 81 e4 ldi r24, 0x41 ; 65 1283c: 95 e6 ldi r25, 0x65 ; 101 SERIAL_PROTOCOLLN(); #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MAX); if(READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); 1283e: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 12842: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 12846: ee c3 rjmp .+2012 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12848: 8c 38 cpi r24, 0x8C ; 140 1284a: 91 05 cpc r25, r1 1284c: 09 f4 brne .+2 ; 0x12850 1284e: 66 c7 rjmp .+3788 ; 0x1371c 12850: 8b 39 cpi r24, 0x9B ; 155 12852: 91 05 cpc r25, r1 12854: 09 f4 brne .+2 ; 0x12858 12856: 7d c7 rjmp .+3834 ; 0x13752 12858: 8d 37 cpi r24, 0x7D ; 125 1285a: 91 05 cpc r25, r1 1285c: 09 f0 breq .+2 ; 0x12860 1285e: ec cc rjmp .-1576 ; 0x12238 12860: 58 cd rjmp .-1360 ; 0x12312 12862: 84 3a cpi r24, 0xA4 ; 164 12864: 41 e0 ldi r20, 0x01 ; 1 12866: 94 07 cpc r25, r20 12868: 11 f4 brne .+4 ; 0x1286e 1286a: 0c 94 26 a2 jmp 0x1444c ; 0x1444c 1286e: 0c f0 brlt .+2 ; 0x12872 12870: 44 c2 rjmp .+1160 ; 0x12cfa 12872: 82 3e cpi r24, 0xE2 ; 226 12874: 91 05 cpc r25, r1 12876: 11 f4 brne .+4 ; 0x1287c 12878: 0c 94 b0 a0 jmp 0x14160 ; 0x14160 1287c: 0c f0 brlt .+2 ; 0x12880 1287e: 6b c1 rjmp .+726 ; 0x12b56 12880: 8e 3c cpi r24, 0xCE ; 206 12882: 91 05 cpc r25, r1 12884: 11 f4 brne .+4 ; 0x1288a 12886: 0c 94 bf 9f jmp 0x13f7e ; 0x13f7e 1288a: 0c f0 brlt .+2 ; 0x1288e 1288c: b1 c0 rjmp .+354 ; 0x129f0 1288e: 8b 3c cpi r24, 0xCB ; 203 12890: 91 05 cpc r25, r1 12892: 11 f4 brne .+4 ; 0x12898 12894: 0c 94 49 9f jmp 0x13e92 ; 0x13e92 12898: 5c f5 brge .+86 ; 0x128f0 1289a: 88 3c cpi r24, 0xC8 ; 200 1289c: 91 05 cpc r25, r1 1289e: 11 f4 brne .+4 ; 0x128a4 128a0: 0c 94 06 9f jmp 0x13e0c ; 0x13e0c 128a4: 04 ec ldi r16, 0xC4 ; 196 128a6: 12 e0 ldi r17, 0x02 ; 2 128a8: a2 e3 ldi r26, 0x32 ; 50 128aa: ea 2e mov r14, r26 128ac: a4 e0 ldi r26, 0x04 ; 4 128ae: fa 2e mov r15, r26 128b0: b8 ec ldi r27, 0xC8 ; 200 128b2: cb 2e mov r12, r27 128b4: b2 e0 ldi r27, 0x02 ; 2 128b6: db 2e mov r13, r27 128b8: 89 3c cpi r24, 0xC9 ; 201 128ba: 91 05 cpc r25, r1 128bc: 09 f0 breq .+2 ; 0x128c0 128be: bc cc rjmp .-1672 ; 0x12238 - `E` - Acceleration for the active or specified extruder in units/s^2 */ case 201: for (int8_t i = 0; i < NUM_AXIS; i++) { if (code_seen(axis_codes[i])) 128c0: d8 01 movw r26, r16 128c2: 8d 91 ld r24, X+ 128c4: 8d 01 movw r16, r26 128c6: 0e 94 2b 55 call 0xaa56 ; 0xaa56 128ca: 88 23 and r24, r24 128cc: 49 f0 breq .+18 ; 0x128e0 { unsigned long val = code_value(); 128ce: 0e 94 03 5a call 0xb406 ; 0xb406 128d2: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 128d6: f7 01 movw r30, r14 128d8: 64 a3 std Z+36, r22 ; 0x24 128da: 75 a3 std Z+37, r23 ; 0x25 128dc: 86 a3 std Z+38, r24 ; 0x26 128de: 97 a3 std Z+39, r25 ; 0x27 128e0: f4 e0 ldi r31, 0x04 ; 4 128e2: ef 0e add r14, r31 128e4: f1 1c adc r15, r1 - `Y` - Acceleration for Y axis in units/s^2 - `Z` - Acceleration for Z axis in units/s^2 - `E` - Acceleration for the active or specified extruder in units/s^2 */ case 201: for (int8_t i = 0; i < NUM_AXIS; i++) 128e6: c0 16 cp r12, r16 128e8: d1 06 cpc r13, r17 128ea: 51 f7 brne .-44 ; 0x128c0 128ec: 0c 94 aa 9d jmp 0x13b54 ; 0x13b54 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 128f0: 8c 3c cpi r24, 0xCC ; 204 128f2: 91 05 cpc r25, r1 128f4: 11 f4 brne .+4 ; 0x128fa 128f6: 0c 94 68 9f jmp 0x13ed0 ; 0x13ed0 128fa: 8d 3c cpi r24, 0xCD ; 205 128fc: 91 05 cpc r25, r1 128fe: 09 f0 breq .+2 ; 0x12902 12900: 9b cc rjmp .-1738 ; 0x12238 - `Z` - Maximum Z jerk (units/s) - `E` - Maximum E jerk (units/s) */ case 205: { if(code_seen('S')) cs.minimumfeedrate = code_value(); 12902: 83 e5 ldi r24, 0x53 ; 83 12904: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12908: 88 23 and r24, r24 1290a: 51 f0 breq .+20 ; 0x12920 1290c: 0e 94 03 5a call 0xb406 ; 0xb406 12910: 60 93 6e 04 sts 0x046E, r22 ; 0x80046e 12914: 70 93 6f 04 sts 0x046F, r23 ; 0x80046f 12918: 80 93 70 04 sts 0x0470, r24 ; 0x800470 1291c: 90 93 71 04 sts 0x0471, r25 ; 0x800471 if(code_seen('T')) cs.mintravelfeedrate = code_value(); 12920: 84 e5 ldi r24, 0x54 ; 84 12922: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12926: 88 23 and r24, r24 12928: 51 f0 breq .+20 ; 0x1293e 1292a: 0e 94 03 5a call 0xb406 ; 0xb406 1292e: 60 93 72 04 sts 0x0472, r22 ; 0x800472 12932: 70 93 73 04 sts 0x0473, r23 ; 0x800473 12936: 80 93 74 04 sts 0x0474, r24 ; 0x800474 1293a: 90 93 75 04 sts 0x0475, r25 ; 0x800475 if(code_seen('B')) cs.min_segment_time_us = (uint32_t)code_value(); 1293e: 82 e4 ldi r24, 0x42 ; 66 12940: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12944: 88 23 and r24, r24 12946: 61 f0 breq .+24 ; 0x12960 12948: 0e 94 03 5a call 0xb406 ; 0xb406 1294c: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 12950: 60 93 76 04 sts 0x0476, r22 ; 0x800476 12954: 70 93 77 04 sts 0x0477, r23 ; 0x800477 12958: 80 93 78 04 sts 0x0478, r24 ; 0x800478 1295c: 90 93 79 04 sts 0x0479, r25 ; 0x800479 if(code_seen('X')) cs.max_jerk[X_AXIS] = cs.max_jerk[Y_AXIS] = code_value(); 12960: 88 e5 ldi r24, 0x58 ; 88 12962: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12966: 88 23 and r24, r24 12968: 91 f0 breq .+36 ; 0x1298e 1296a: 0e 94 03 5a call 0xb406 ; 0xb406 1296e: 60 93 7e 04 sts 0x047E, r22 ; 0x80047e 12972: 70 93 7f 04 sts 0x047F, r23 ; 0x80047f 12976: 80 93 80 04 sts 0x0480, r24 ; 0x800480 1297a: 90 93 81 04 sts 0x0481, r25 ; 0x800481 1297e: 60 93 7a 04 sts 0x047A, r22 ; 0x80047a 12982: 70 93 7b 04 sts 0x047B, r23 ; 0x80047b 12986: 80 93 7c 04 sts 0x047C, r24 ; 0x80047c 1298a: 90 93 7d 04 sts 0x047D, r25 ; 0x80047d if(code_seen('Y')) cs.max_jerk[Y_AXIS] = code_value(); 1298e: 89 e5 ldi r24, 0x59 ; 89 12990: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12994: 88 23 and r24, r24 12996: 51 f0 breq .+20 ; 0x129ac 12998: 0e 94 03 5a call 0xb406 ; 0xb406 1299c: 60 93 7e 04 sts 0x047E, r22 ; 0x80047e 129a0: 70 93 7f 04 sts 0x047F, r23 ; 0x80047f 129a4: 80 93 80 04 sts 0x0480, r24 ; 0x800480 129a8: 90 93 81 04 sts 0x0481, r25 ; 0x800481 if(code_seen('Z')) cs.max_jerk[Z_AXIS] = code_value(); 129ac: 8a e5 ldi r24, 0x5A ; 90 129ae: 0e 94 2b 55 call 0xaa56 ; 0xaa56 129b2: 88 23 and r24, r24 129b4: 51 f0 breq .+20 ; 0x129ca 129b6: 0e 94 03 5a call 0xb406 ; 0xb406 129ba: 60 93 82 04 sts 0x0482, r22 ; 0x800482 129be: 70 93 83 04 sts 0x0483, r23 ; 0x800483 129c2: 80 93 84 04 sts 0x0484, r24 ; 0x800484 129c6: 90 93 85 04 sts 0x0485, r25 ; 0x800485 if(code_seen('E')) 129ca: 85 e4 ldi r24, 0x45 ; 69 129cc: 0e 94 2b 55 call 0xaa56 ; 0xaa56 129d0: 88 23 and r24, r24 129d2: 09 f4 brne .+2 ; 0x129d6 129d4: 27 c3 rjmp .+1614 ; 0x13024 { float e = code_value(); 129d6: 0e 94 03 5a call 0xb406 ; 0xb406 #ifndef LA_NOCOMPAT e = la10c_jerk(e); 129da: 0e 94 83 73 call 0xe706 ; 0xe706 #endif cs.max_jerk[E_AXIS] = e; 129de: 60 93 86 04 sts 0x0486, r22 ; 0x800486 129e2: 70 93 87 04 sts 0x0487, r23 ; 0x800487 129e6: 80 93 88 04 sts 0x0488, r24 ; 0x800488 129ea: 90 93 89 04 sts 0x0489, r25 ; 0x800489 129ee: 1a c3 rjmp .+1588 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 129f0: 81 3d cpi r24, 0xD1 ; 209 129f2: 91 05 cpc r25, r1 129f4: 11 f4 brne .+4 ; 0x129fa 129f6: 0c 94 0d a0 jmp 0x1401a ; 0x1401a 129fa: 5c f5 brge .+86 ; 0x12a52 129fc: 8f 3c cpi r24, 0xCF ; 207 129fe: 91 05 cpc r25, r1 12a00: 11 f4 brne .+4 ; 0x12a06 12a02: 0c 94 db 9f jmp 0x13fb6 ; 0x13fb6 12a06: 80 3d cpi r24, 0xD0 ; 208 12a08: 91 05 cpc r25, r1 12a0a: 09 f0 breq .+2 ; 0x12a0e 12a0c: 15 cc rjmp .-2006 ; 0x12238 - `S` - positive length surplus to the M207 Snnn, in mm - `F` - feedrate, in mm/sec */ case 208: // M208 - set retract recover length S[positive mm surplus to the M207 S*] F[feedrate mm/min] { if(code_seen('S')) 12a0e: 83 e5 ldi r24, 0x53 ; 83 12a10: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12a14: 88 23 and r24, r24 12a16: 51 f0 breq .+20 ; 0x12a2c { cs.retract_recover_length = code_value() ; 12a18: 0e 94 03 5a call 0xb406 ; 0xb406 12a1c: 60 93 c1 04 sts 0x04C1, r22 ; 0x8004c1 12a20: 70 93 c2 04 sts 0x04C2, r23 ; 0x8004c2 12a24: 80 93 c3 04 sts 0x04C3, r24 ; 0x8004c3 12a28: 90 93 c4 04 sts 0x04C4, r25 ; 0x8004c4 } if(code_seen('F')) 12a2c: 86 e4 ldi r24, 0x46 ; 70 12a2e: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12a32: 88 23 and r24, r24 12a34: 09 f4 brne .+2 ; 0x12a38 12a36: f6 c2 rjmp .+1516 ; 0x13024 { cs.retract_recover_feedrate = get_feedrate_mm_s(code_value()); 12a38: 0e 94 03 5a call 0xb406 ; 0xb406 12a3c: 0e 94 cd 5f call 0xbf9a ; 0xbf9a 12a40: 60 93 c5 04 sts 0x04C5, r22 ; 0x8004c5 12a44: 70 93 c6 04 sts 0x04C6, r23 ; 0x8004c6 12a48: 80 93 c7 04 sts 0x04C7, r24 ; 0x8004c7 12a4c: 90 93 c8 04 sts 0x04C8, r25 ; 0x8004c8 12a50: e9 c2 rjmp .+1490 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12a52: 8c 3d cpi r24, 0xDC ; 220 12a54: 91 05 cpc r25, r1 12a56: 11 f4 brne .+4 ; 0x12a5c 12a58: 0c 94 50 a0 jmp 0x140a0 ; 0x140a0 12a5c: 8d 3d cpi r24, 0xDD ; 221 12a5e: 91 05 cpc r25, r1 12a60: 11 f4 brne .+4 ; 0x12a66 12a62: 0c 94 8f a0 jmp 0x1411e ; 0x1411e 12a66: 86 3d cpi r24, 0xD6 ; 214 12a68: 91 05 cpc r25, r1 12a6a: 09 f0 breq .+2 ; 0x12a6e 12a6c: e5 cb rjmp .-2102 ; 0x12238 greater than or less than the minimum and maximum segment length. Set to 0 to disable. */ case 214: { // Extract all possible parameters if they appear float p = code_seen('P') ? code_value() : cs.mm_per_arc_segment; 12a6e: 80 e5 ldi r24, 0x50 ; 80 12a70: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12a74: 88 23 and r24, r24 12a76: 11 f4 brne .+4 ; 0x12a7c 12a78: 0c 94 3c a0 jmp 0x14078 ; 0x14078 12a7c: 0e 94 03 5a call 0xb406 ; 0xb406 12a80: 2b 01 movw r4, r22 12a82: 3c 01 movw r6, r24 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 12a84: 83 e5 ldi r24, 0x53 ; 83 12a86: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12a8a: 88 23 and r24, r24 12a8c: 11 f4 brne .+4 ; 0x12a92 12a8e: 0c 94 46 a0 jmp 0x1408c ; 0x1408c 12a92: 0e 94 03 5a call 0xb406 ; 0xb406 12a96: 4b 01 movw r8, r22 12a98: 5c 01 movw r10, r24 unsigned char n = code_seen('N') ? code_value() : cs.n_arc_correction; 12a9a: 8e e4 ldi r24, 0x4E ; 78 12a9c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12aa0: d0 90 fe 04 lds r13, 0x04FE ; 0x8004fe 12aa4: 88 23 and r24, r24 12aa6: 29 f0 breq .+10 ; 0x12ab2 12aa8: 0e 94 03 5a call 0xb406 ; 0xb406 12aac: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 12ab0: d6 2e mov r13, r22 unsigned short r = code_seen('R') ? code_value() : cs.min_arc_segments; 12ab2: 82 e5 ldi r24, 0x52 ; 82 12ab4: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12ab8: e0 90 ff 04 lds r14, 0x04FF ; 0x8004ff 12abc: f0 90 00 05 lds r15, 0x0500 ; 0x800500 12ac0: 88 23 and r24, r24 12ac2: 29 f0 breq .+10 ; 0x12ace 12ac4: 0e 94 03 5a call 0xb406 ; 0xb406 12ac8: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 12acc: 7b 01 movw r14, r22 unsigned short f = code_seen('F') ? code_value() : cs.arc_segments_per_sec; 12ace: 86 e4 ldi r24, 0x46 ; 70 12ad0: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12ad4: 00 91 01 05 lds r16, 0x0501 ; 0x800501 12ad8: 10 91 02 05 lds r17, 0x0502 ; 0x800502 12adc: 88 23 and r24, r24 12ade: 29 f0 breq .+10 ; 0x12aea 12ae0: 0e 94 03 5a call 0xb406 ; 0xb406 12ae4: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 12ae8: 8b 01 movw r16, r22 // Ensure mm_per_arc_segment is greater than 0, and that min_mm_per_arc_segment is sero or greater than or equal to mm_per_arc_segment if (p <=0 || s < 0 || p < s) 12aea: 20 e0 ldi r18, 0x00 ; 0 12aec: 30 e0 ldi r19, 0x00 ; 0 12aee: a9 01 movw r20, r18 12af0: c3 01 movw r24, r6 12af2: b2 01 movw r22, r4 12af4: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 12af8: 18 16 cp r1, r24 12afa: 0c f0 brlt .+2 ; 0x12afe 12afc: 93 c2 rjmp .+1318 ; 0x13024 12afe: 20 e0 ldi r18, 0x00 ; 0 12b00: 30 e0 ldi r19, 0x00 ; 0 12b02: a9 01 movw r20, r18 12b04: c5 01 movw r24, r10 12b06: b4 01 movw r22, r8 12b08: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 12b0c: 87 fd sbrc r24, 7 12b0e: 8a c2 rjmp .+1300 ; 0x13024 12b10: a5 01 movw r20, r10 12b12: 94 01 movw r18, r8 12b14: c3 01 movw r24, r6 12b16: b2 01 movw r22, r4 12b18: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 12b1c: 87 fd sbrc r24, 7 12b1e: 82 c2 rjmp .+1284 ; 0x13024 { // Should we display some error here? break; } cs.mm_per_arc_segment = p; 12b20: 40 92 f6 04 sts 0x04F6, r4 ; 0x8004f6 12b24: 50 92 f7 04 sts 0x04F7, r5 ; 0x8004f7 12b28: 60 92 f8 04 sts 0x04F8, r6 ; 0x8004f8 12b2c: 70 92 f9 04 sts 0x04F9, r7 ; 0x8004f9 cs.min_mm_per_arc_segment = s; 12b30: 80 92 fa 04 sts 0x04FA, r8 ; 0x8004fa 12b34: 90 92 fb 04 sts 0x04FB, r9 ; 0x8004fb 12b38: a0 92 fc 04 sts 0x04FC, r10 ; 0x8004fc 12b3c: b0 92 fd 04 sts 0x04FD, r11 ; 0x8004fd cs.n_arc_correction = n; 12b40: d0 92 fe 04 sts 0x04FE, r13 ; 0x8004fe cs.min_arc_segments = r; 12b44: f0 92 00 05 sts 0x0500, r15 ; 0x800500 12b48: e0 92 ff 04 sts 0x04FF, r14 ; 0x8004ff cs.arc_segments_per_sec = f; 12b4c: 10 93 02 05 sts 0x0502, r17 ; 0x800502 12b50: 00 93 01 05 sts 0x0501, r16 ; 0x800501 12b54: 67 c2 rjmp .+1230 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12b56: 80 33 cpi r24, 0x30 ; 48 12b58: a1 e0 ldi r26, 0x01 ; 1 12b5a: 9a 07 cpc r25, r26 12b5c: 11 f4 brne .+4 ; 0x12b62 12b5e: 0c 94 8b a1 jmp 0x14316 ; 0x14316 12b62: 0c f0 brlt .+2 ; 0x12b66 12b64: 78 c0 rjmp .+240 ; 0x12c56 12b66: 8d 32 cpi r24, 0x2D ; 45 12b68: e1 e0 ldi r30, 0x01 ; 1 12b6a: 9e 07 cpc r25, r30 12b6c: 11 f4 brne .+4 ; 0x12b72 12b6e: 0c 94 12 a1 jmp 0x14224 ; 0x14224 12b72: b4 f5 brge .+108 ; 0x12be0 12b74: 80 3f cpi r24, 0xF0 ; 240 12b76: 91 05 cpc r25, r1 12b78: 09 f4 brne .+2 ; 0x12b7c 12b7a: 54 c2 rjmp .+1192 ; 0x13024 12b7c: 8c 32 cpi r24, 0x2C ; 44 12b7e: 91 40 sbci r25, 0x01 ; 1 12b80: 09 f0 breq .+2 ; 0x12b84 12b82: 5a cb rjmp .-2380 ; 0x12238 - `S` - frequency in Hz. Not all firmware versions support this parameter - `P` - duration in milliseconds max 3500ms */ case 300: // M300 { uint16_t beepP = code_seen('P') ? min(code_value(), 3500) : 1000; 12b84: 80 e5 ldi r24, 0x50 ; 80 12b86: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12b8a: 08 ee ldi r16, 0xE8 ; 232 12b8c: 13 e0 ldi r17, 0x03 ; 3 12b8e: 88 23 and r24, r24 12b90: 89 f0 breq .+34 ; 0x12bb4 12b92: 0e 94 03 5a call 0xb406 ; 0xb406 12b96: 20 e0 ldi r18, 0x00 ; 0 12b98: 30 ec ldi r19, 0xC0 ; 192 12b9a: 4a e5 ldi r20, 0x5A ; 90 12b9c: 55 e4 ldi r21, 0x45 ; 69 12b9e: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 12ba2: 0c ea ldi r16, 0xAC ; 172 12ba4: 1d e0 ldi r17, 0x0D ; 13 12ba6: 87 ff sbrs r24, 7 12ba8: 05 c0 rjmp .+10 ; 0x12bb4 12baa: 0e 94 03 5a call 0xb406 ; 0xb406 12bae: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 12bb2: 8b 01 movw r16, r22 uint16_t beepS; if (!code_seen('S')) 12bb4: 83 e5 ldi r24, 0x53 ; 83 12bb6: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12bba: 88 23 and r24, r24 12bbc: 11 f4 brne .+4 ; 0x12bc2 12bbe: 0c 94 0a a1 jmp 0x14214 ; 0x14214 beepS = 0; else { beepS = code_value(); 12bc2: 0e 94 03 5a call 0xb406 ; 0xb406 12bc6: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> if (!beepS) { 12bca: 61 15 cp r22, r1 12bcc: 71 05 cpc r23, r1 12bce: 11 f0 breq .+4 ; 0x12bd4 12bd0: 0c 94 0c a1 jmp 0x14218 ; 0x14218 // handle S0 as a pause _delay(beepP); 12bd4: b8 01 movw r22, r16 12bd6: 90 e0 ldi r25, 0x00 ; 0 12bd8: 80 e0 ldi r24, 0x00 ; 0 12bda: 0f 94 7b 0d call 0x21af6 ; 0x21af6 12bde: 22 c2 rjmp .+1092 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12be0: 8e 32 cpi r24, 0x2E ; 46 12be2: 31 e0 ldi r19, 0x01 ; 1 12be4: 93 07 cpc r25, r19 12be6: 11 f4 brne .+4 ; 0x12bec 12be8: 0c 94 04 a2 jmp 0x14408 ; 0x14408 12bec: 8f 32 cpi r24, 0x2F ; 47 12bee: 91 40 sbci r25, 0x01 ; 1 12bf0: 09 f0 breq .+2 ; 0x12bf4 12bf2: 22 cb rjmp .-2492 ; 0x12238 case 303: { float temp = 150.0; int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); 12bf4: 85 e4 ldi r24, 0x45 ; 69 12bf6: 0e 94 2b 55 call 0xaa56 ; 0xaa56 - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; int e = 0; 12bfa: 10 e0 ldi r17, 0x00 ; 0 12bfc: 00 e0 ldi r16, 0x00 ; 0 int c = 5; if (code_seen('E')) e = code_value_short(); 12bfe: 88 23 and r24, r24 12c00: 59 f0 breq .+22 ; 0x12c18 12c02: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 12c06: 8c 01 movw r16, r24 if (e < 0) temp = 70; 12c08: c1 2c mov r12, r1 12c0a: d1 2c mov r13, r1 12c0c: 5c e8 ldi r21, 0x8C ; 140 12c0e: e5 2e mov r14, r21 12c10: 52 e4 ldi r21, 0x42 ; 66 12c12: f5 2e mov r15, r21 { float temp = 150.0; int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); if (e < 0) 12c14: 97 fd sbrc r25, 7 12c16: 06 c0 rjmp .+12 ; 0x12c24 - `S` - Target temperature, default `210°C` for hotend, 70 for bed - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; 12c18: c1 2c mov r12, r1 12c1a: d1 2c mov r13, r1 12c1c: 66 e1 ldi r22, 0x16 ; 22 12c1e: e6 2e mov r14, r22 12c20: 63 e4 ldi r22, 0x43 ; 67 12c22: f6 2e mov r15, r22 int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); if (e < 0) temp = 70; if (code_seen('S')) temp = code_value(); 12c24: 83 e5 ldi r24, 0x53 ; 83 12c26: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12c2a: 88 23 and r24, r24 12c2c: 21 f0 breq .+8 ; 0x12c36 12c2e: 0e 94 03 5a call 0xb406 ; 0xb406 12c32: 6b 01 movw r12, r22 12c34: 7c 01 movw r14, r24 if (code_seen('C')) c = code_value_short(); 12c36: 83 e4 ldi r24, 0x43 ; 67 12c38: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12c3c: 88 23 and r24, r24 12c3e: 11 f4 brne .+4 ; 0x12c44 12c40: 0c 94 14 a2 jmp 0x14428 ; 0x14428 12c44: 0e 94 4d 55 call 0xaa9a ; 0xaa9a PID_autotune(temp, e, c); 12c48: 9c 01 movw r18, r24 12c4a: a8 01 movw r20, r16 12c4c: c7 01 movw r24, r14 12c4e: b6 01 movw r22, r12 12c50: 0f 94 c3 18 call 0x23186 ; 0x23186 12c54: e7 c1 rjmp .+974 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12c56: 80 39 cpi r24, 0x90 ; 144 12c58: 51 e0 ldi r21, 0x01 ; 1 12c5a: 95 07 cpc r25, r21 12c5c: 11 f4 brne .+4 ; 0x12c62 12c5e: 0c 94 18 a2 jmp 0x14430 ; 0x14430 12c62: 04 f5 brge .+64 ; 0x12ca4 12c64: 8e 35 cpi r24, 0x5E ; 94 12c66: b1 e0 ldi r27, 0x01 ; 1 12c68: 9b 07 cpc r25, r27 12c6a: 11 f4 brne .+4 ; 0x12c70 12c6c: 0c 94 5a ad jmp 0x15ab4 ; 0x15ab4 12c70: 8f 35 cpi r24, 0x5F ; 95 12c72: 91 40 sbci r25, 0x01 ; 1 12c74: 09 f0 breq .+2 ; 0x12c78 12c76: e0 ca rjmp .-2624 ; 0x12238 - `B` - new pin value */ case 351: { #if defined(X_MS1_PIN) && X_MS1_PIN > -1 if(code_seen('S')) switch((int)code_value()) 12c78: 83 e5 ldi r24, 0x53 ; 83 12c7a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12c7e: 88 23 and r24, r24 12c80: 71 f0 breq .+28 ; 0x12c9e 12c82: 0e 94 03 5a call 0xb406 ; 0xb406 12c86: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 12c8a: 61 30 cpi r22, 0x01 ; 1 12c8c: 71 05 cpc r23, r1 12c8e: 11 f4 brne .+4 ; 0x12c94 12c90: 0c 94 90 ad jmp 0x15b20 ; 0x15b20 12c94: 62 30 cpi r22, 0x02 ; 2 12c96: 71 05 cpc r23, r1 12c98: 11 f4 brne .+4 ; 0x12c9e 12c9a: 0c 94 b2 ad jmp 0x15b64 ; 0x15b64 case 2: for(int i=0;i 12ca2: c0 c1 rjmp .+896 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12ca4: 85 39 cpi r24, 0x95 ; 149 12ca6: f1 e0 ldi r31, 0x01 ; 1 12ca8: 9f 07 cpc r25, r31 12caa: 11 f4 brne .+4 ; 0x12cb0 12cac: 0c 94 1c a2 jmp 0x14438 ; 0x14438 12cb0: 86 39 cpi r24, 0x96 ; 150 12cb2: 21 e0 ldi r18, 0x01 ; 1 12cb4: 92 07 cpc r25, r18 12cb6: 11 f4 brne .+4 ; 0x12cbc 12cb8: 0c 94 21 a2 jmp 0x14442 ; 0x14442 12cbc: 83 39 cpi r24, 0x93 ; 147 12cbe: 91 40 sbci r25, 0x01 ; 1 12cc0: 09 f0 breq .+2 ; 0x12cc4 12cc2: ba ca rjmp .-2700 ; 0x12238 */ case 403: { // currently three different materials are needed (default, flex and PVA) // add storing this information for different load/unload profiles etc. in the future if (MMU2::mmu2.Enabled()) 12cc4: 80 91 94 12 lds r24, 0x1294 ; 0x801294 12cc8: 81 30 cpi r24, 0x01 ; 1 12cca: 09 f0 breq .+2 ; 0x12cce 12ccc: ab c1 rjmp .+854 ; 0x13024 { uint8_t extruder = 255; uint8_t filament = FILAMENT_UNDEFINED; if(code_seen('E')) extruder = code_value_uint8(); 12cce: 85 e4 ldi r24, 0x45 ; 69 12cd0: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12cd4: 81 11 cpse r24, r1 12cd6: 0e 94 40 55 call 0xaa80 ; 0xaa80 if(code_seen('F')) filament = code_value_uint8(); 12cda: 86 e4 ldi r24, 0x46 ; 70 12cdc: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12ce0: 81 11 cpse r24, r1 12ce2: 0e 94 40 55 call 0xaa80 ; 0xaa80 MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); } bool MMU2::set_filament_type(uint8_t /*slot*/, uint8_t /*type*/) { if (!WaitForMMUReady()) { 12ce6: 0f 94 b4 53 call 0x2a768 ; 0x2a768 12cea: 88 23 and r24, r24 12cec: 09 f4 brne .+2 ; 0x12cf0 12cee: 9a c1 rjmp .+820 ; 0x13024 // slot = slot; // @@TODO // type = type; // @@TODO // cmd_arg = filamentType; // command(MMU_CMD_F0 + index); if (!manage_response(false, false)) { 12cf0: 60 e0 ldi r22, 0x00 ; 0 12cf2: 80 e0 ldi r24, 0x00 ; 0 12cf4: 0f 94 c8 69 call 0x2d390 ; 0x2d390 12cf8: 95 c1 rjmp .+810 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12cfa: 80 3c cpi r24, 0xC0 ; 192 12cfc: 42 e0 ldi r20, 0x02 ; 2 12cfe: 94 07 cpc r25, r20 12d00: 11 f4 brne .+4 ; 0x12d06 12d02: 0c 94 a1 ae jmp 0x15d42 ; 0x15d42 12d06: 0c f0 brlt .+2 ; 0x12d0a 12d08: 57 c0 rjmp .+174 ; 0x12db8 12d0a: 88 32 cpi r24, 0x28 ; 40 12d0c: a2 e0 ldi r26, 0x02 ; 2 12d0e: 9a 07 cpc r25, r26 12d10: 11 f4 brne .+4 ; 0x12d16 12d12: 0c 94 e5 a4 jmp 0x149ca ; 0x149ca 12d16: 4c f5 brge .+82 ; 0x12d6a 12d18: 86 3f cpi r24, 0xF6 ; 246 12d1a: e1 e0 ldi r30, 0x01 ; 1 12d1c: 9e 07 cpc r25, r30 12d1e: 11 f4 brne .+4 ; 0x12d24 12d20: 0c 94 2e a2 jmp 0x1445c ; 0x1445c 12d24: 6c f4 brge .+26 ; 0x12d40 12d26: 84 3f cpi r24, 0xF4 ; 244 12d28: 21 e0 ldi r18, 0x01 ; 1 12d2a: 92 07 cpc r25, r18 12d2c: 11 f4 brne .+4 ; 0x12d32 12d2e: 0c 94 2a a2 jmp 0x14454 ; 0x14454 12d32: 85 3f cpi r24, 0xF5 ; 245 12d34: 91 40 sbci r25, 0x01 ; 1 12d36: 09 f0 breq .+2 ; 0x12d3a 12d38: 7f ca rjmp .-2818 ; 0x12238 M501 */ case 501: { Config_RetrieveSettings(); 12d3a: 0e 94 e1 74 call 0xe9c2 ; 0xe9c2 12d3e: 72 c1 rjmp .+740 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12d40: 87 3f cpi r24, 0xF7 ; 247 12d42: 41 e0 ldi r20, 0x01 ; 1 12d44: 94 07 cpc r25, r20 12d46: 11 f4 brne .+4 ; 0x12d4c 12d48: 0c 94 32 a2 jmp 0x14464 ; 0x14464 12d4c: 8d 3f cpi r24, 0xFD ; 253 12d4e: 91 40 sbci r25, 0x01 ; 1 12d50: 09 f0 breq .+2 ; 0x12d54 12d52: 72 ca rjmp .-2844 ; 0x12238 M509 */ case 509: { lang_reset(); 12d54: 0e 94 b4 6b call 0xd768 ; 0xd768 SERIAL_ECHO_START; 12d58: 81 e6 ldi r24, 0x61 ; 97 12d5a: 9d e9 ldi r25, 0x9D ; 157 12d5c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_PROTOCOLPGM("LANG SEL FORCED"); 12d60: 87 e1 ldi r24, 0x17 ; 23 12d62: 9f e7 ldi r25, 0x7F ; 127 12d64: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 12d68: 5d c1 rjmp .+698 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12d6a: 8a 35 cpi r24, 0x5A ; 90 12d6c: a2 e0 ldi r26, 0x02 ; 2 12d6e: 9a 07 cpc r25, r26 12d70: 11 f4 brne .+4 ; 0x12d76 12d72: 0c 94 13 a9 jmp 0x15226 ; 0x15226 12d76: 5c f4 brge .+22 ; 0x12d8e 12d78: 88 35 cpi r24, 0x58 ; 88 12d7a: e2 e0 ldi r30, 0x02 ; 2 12d7c: 9e 07 cpc r25, r30 12d7e: 11 f4 brne .+4 ; 0x12d84 12d80: 0c 94 1a a5 jmp 0x14a34 ; 0x14a34 12d84: 89 35 cpi r24, 0x59 ; 89 12d86: 92 40 sbci r25, 0x02 ; 2 12d88: 09 f4 brne .+2 ; 0x12d8c 12d8a: c3 ca rjmp .-2682 ; 0x12312 12d8c: 55 ca rjmp .-2902 ; 0x12238 12d8e: 8d 3b cpi r24, 0xBD ; 189 12d90: 22 e0 ldi r18, 0x02 ; 2 12d92: 92 07 cpc r25, r18 12d94: 11 f4 brne .+4 ; 0x12d9a 12d96: 0c 94 cb ad jmp 0x15b96 ; 0x15b96 12d9a: 8e 3b cpi r24, 0xBE ; 190 12d9c: 32 e0 ldi r19, 0x02 ; 2 12d9e: 93 07 cpc r25, r19 12da0: 11 f4 brne .+4 ; 0x12da6 12da2: 0c 94 6d ae jmp 0x15cda ; 0x15cda 12da6: 8b 35 cpi r24, 0x5B ; 91 12da8: 92 40 sbci r25, 0x02 ; 2 12daa: 09 f0 breq .+2 ; 0x12dae 12dac: 45 ca rjmp .-2934 ; 0x12238 /*! ### M603 - Stop print M603: Stop print */ case 603: { print_stop(); 12dae: 60 e0 ldi r22, 0x00 ; 0 12db0: 80 e0 ldi r24, 0x00 ; 0 12db2: 0e 94 92 ef call 0x1df24 ; 0x1df24 12db6: 36 c1 rjmp .+620 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12db8: 8c 35 cpi r24, 0x5C ; 92 12dba: 53 e0 ldi r21, 0x03 ; 3 12dbc: 95 07 cpc r25, r21 12dbe: 11 f4 brne .+4 ; 0x12dc4 12dc0: 0c 94 35 aa jmp 0x1546a ; 0x1546a 12dc4: 0c f0 brlt .+2 ; 0x12dc8 12dc6: 42 c0 rjmp .+132 ; 0x12e4c 12dc8: 83 3c cpi r24, 0xC3 ; 195 12dca: b2 e0 ldi r27, 0x02 ; 2 12dcc: 9b 07 cpc r25, r27 12dce: 11 f4 brne .+4 ; 0x12dd4 12dd0: 0c 94 ad ae jmp 0x15d5a ; 0x15d5a 12dd4: 7c f4 brge .+30 ; 0x12df4 12dd6: 81 3c cpi r24, 0xC1 ; 193 12dd8: f2 e0 ldi r31, 0x02 ; 2 12dda: 9f 07 cpc r25, r31 12ddc: 11 f4 brne .+4 ; 0x12de2 12dde: 0c 94 a7 ae jmp 0x15d4e ; 0x15d4e 12de2: 82 3c cpi r24, 0xC2 ; 194 12de4: 92 40 sbci r25, 0x02 ; 2 12de6: 09 f0 breq .+2 ; 0x12dea 12de8: 27 ca rjmp .-2994 ; 0x12238 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 706: { gcodes_M704_M705_M706(706); 12dea: 82 ec ldi r24, 0xC2 ; 194 12dec: 92 e0 ldi r25, 0x02 ; 2 12dee: 0e 94 c9 59 call 0xb392 ; 0xb392 12df2: 18 c1 rjmp .+560 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12df4: 85 3c cpi r24, 0xC5 ; 197 12df6: 32 e0 ldi r19, 0x02 ; 2 12df8: 93 07 cpc r25, r19 12dfa: 11 f4 brne .+4 ; 0x12e00 12dfc: 0c 94 f6 ae jmp 0x15dec ; 0x15dec 12e00: 14 f4 brge .+4 ; 0x12e06 12e02: 0c 94 ca ae jmp 0x15d94 ; 0x15d94 12e06: 82 35 cpi r24, 0x52 ; 82 12e08: 93 40 sbci r25, 0x03 ; 3 12e0a: 09 f0 breq .+2 ; 0x12e0e 12e0c: 15 ca rjmp .-3030 ; 0x12238 float z_val = 0; char strLabel[8]; uint8_t iBedC = 0; uint8_t iPindaC = 0; bool bIsActive=false; strLabel[7] = '\0'; // null terminate. 12e0e: 18 86 std Y+8, r1 ; 0x08 size_t max_sheets = sizeof(EEPROM_Sheets_base->s)/sizeof(EEPROM_Sheets_base->s[0]); if (code_seen('S')) { 12e10: 83 e5 ldi r24, 0x53 ; 83 12e12: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12e16: 88 23 and r24, r24 12e18: 11 f4 brne .+4 ; 0x12e1e 12e1a: 0c 94 1b a9 jmp 0x15236 ; 0x15236 iSel = code_value_uint8(); 12e1e: 0e 94 40 55 call 0xaa80 ; 0xaa80 12e22: 18 2f mov r17, r24 if (iSel>=max_sheets) 12e24: 88 30 cpi r24, 0x08 ; 8 12e26: 10 f4 brcc .+4 ; 0x12e2c 12e28: 0c 94 20 a9 jmp 0x15240 ; 0x15240 { SERIAL_PROTOCOLPGM("Invalid sheet ID. Allowed: 0.."); 12e2c: 83 ef ldi r24, 0xF3 ; 243 12e2e: 9e e7 ldi r25, 0x7E ; 126 12e30: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 12e34: 4a e0 ldi r20, 0x0A ; 10 12e36: 67 e0 ldi r22, 0x07 ; 7 12e38: 70 e0 ldi r23, 0x00 ; 0 12e3a: 80 e0 ldi r24, 0x00 ; 0 12e3c: 90 e0 ldi r25, 0x00 ; 0 12e3e: 0f 94 2c 96 call 0x32c58 ; 0x32c58 SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); 12e42: 8a ed ldi r24, 0xDA ; 218 12e44: 92 e0 ldi r25, 0x02 ; 2 12e46: 0f 94 fd 98 call 0x331fa ; 0x331fa 12e4a: ec c0 rjmp .+472 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12e4c: 84 38 cpi r24, 0x84 ; 132 12e4e: a3 e0 ldi r26, 0x03 ; 3 12e50: 9a 07 cpc r25, r26 12e52: 11 f4 brne .+4 ; 0x12e58 12e54: 0c 94 ab ac jmp 0x15956 ; 0x15956 12e58: 0c f0 brlt .+2 ; 0x12e5c 12e5a: 4d c0 rjmp .+154 ; 0x12ef6 12e5c: 8d 35 cpi r24, 0x5D ; 93 12e5e: e3 e0 ldi r30, 0x03 ; 3 12e60: 9e 07 cpc r25, r30 12e62: 11 f4 brne .+4 ; 0x12e68 12e64: 0c 94 bf aa jmp 0x1557e ; 0x1557e 12e68: 8e 35 cpi r24, 0x5E ; 94 12e6a: 93 40 sbci r25, 0x03 ; 3 12e6c: 09 f0 breq .+2 ; 0x12e70 12e6e: e4 c9 rjmp .-3128 ; 0x12238 */ case 862: // M862: print checking { // Read the decimal by multiplying the float value by 10 e.g. 862.1 becomes 8621 // This method consumes less flash memory compared to checking the string length. ClPrintChecking nCommand = static_cast((uint16_t)(code_value()*10) - 8620u); 12e70: 0e 94 03 5a call 0xb406 ; 0xb406 12e74: 20 e0 ldi r18, 0x00 ; 0 12e76: 30 e0 ldi r19, 0x00 ; 0 12e78: 40 e2 ldi r20, 0x20 ; 32 12e7a: 51 e4 ldi r21, 0x41 ; 65 12e7c: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 12e80: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 12e84: 6c 5a subi r22, 0xAC ; 172 switch(nCommand) 12e86: 63 30 cpi r22, 0x03 ; 3 12e88: 11 f4 brne .+4 ; 0x12e8e 12e8a: 0c 94 c5 ab jmp 0x1578a ; 0x1578a 12e8e: 10 f0 brcs .+4 ; 0x12e94 12e90: 0c 94 57 ab jmp 0x156ae ; 0x156ae 12e94: 61 30 cpi r22, 0x01 ; 1 12e96: 11 f4 brne .+4 ; 0x12e9c 12e98: 0c 94 80 ab jmp 0x15700 ; 0x15700 12e9c: 62 30 cpi r22, 0x02 ; 2 12e9e: 09 f0 breq .+2 ; 0x12ea2 12ea0: c1 c0 rjmp .+386 ; 0x13024 ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 12ea2: 80 91 94 12 lds r24, 0x1294 ; 0x801294 return pgm_read_word(&_nPrinterMmuType); 12ea6: e7 e0 ldi r30, 0x07 ; 7 12ea8: f9 e7 ldi r31, 0x79 ; 121 ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 12eaa: 81 30 cpi r24, 0x01 ; 1 12eac: 11 f0 breq .+4 ; 0x12eb2 return pgm_read_word(&_nPrinterMmuType); } else { return pgm_read_word(&_nPrinterType); 12eae: e9 e0 ldi r30, 0x09 ; 9 12eb0: f9 e7 ldi r31, 0x79 ; 121 12eb2: 05 91 lpm r16, Z+ 12eb4: 14 91 lpm r17, Z else if(code_seen('Q')) SERIAL_PROTOCOLLN((float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); break; case ClPrintChecking::_Model: { // ~ .2 uint16_t type = nPrinterType(MMU2::mmu2.Enabled()); if(code_seen('P')) 12eb6: 80 e5 ldi r24, 0x50 ; 80 12eb8: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12ebc: 88 23 and r24, r24 12ebe: 11 f4 brne .+4 ; 0x12ec4 12ec0: 0c 94 b4 ab jmp 0x15768 ; 0x15768 { uint16_t nPrinterModel; nPrinterModel=(uint16_t)code_value_long(); 12ec4: 0e 94 93 55 call 0xab26 ; 0xab26 menu_submenu(lcd_hw_setup_menu); } } void printer_model_check(uint16_t nPrinterModel, uint16_t actualPrinterModel) { if (oCheckModel == ClCheckMode::_None) 12ec8: f0 90 b8 03 lds r15, 0x03B8 ; 0x8003b8 12ecc: ff 20 and r15, r15 12ece: 09 f4 brne .+2 ; 0x12ed2 12ed0: a9 c0 rjmp .+338 ; 0x13024 return; if (nPrinterModel == actualPrinterModel) 12ed2: 60 17 cp r22, r16 12ed4: 71 07 cpc r23, r17 12ed6: 09 f4 brne .+2 ; 0x12eda 12ed8: a5 c0 rjmp .+330 ; 0x13024 // SERIAL_ECHOLNPGM("Printer model differs from the G-code ..."); // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(actualPrinterModel); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nPrinterModel); render_M862_warnings( 12eda: 89 e8 ldi r24, 0x89 ; 137 12edc: 97 e3 ldi r25, 0x37 ; 55 12ede: 0e 94 b1 6c call 0xd962 ; 0xd962 12ee2: 8c 01 movw r16, r24 12ee4: 8b e5 ldi r24, 0x5B ; 91 12ee6: 97 e3 ldi r25, 0x37 ; 55 12ee8: 0e 94 b1 6c call 0xd962 ; 0xd962 12eec: 4f 2d mov r20, r15 12eee: b8 01 movw r22, r16 12ef0: 0e 94 df ef call 0x1dfbe ; 0x1dfbe 12ef4: 97 c0 rjmp .+302 ; 0x13024 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12ef6: 8c 38 cpi r24, 0x8C ; 140 12ef8: 23 e0 ldi r18, 0x03 ; 3 12efa: 92 07 cpc r25, r18 12efc: 09 f4 brne .+2 ; 0x12f00 12efe: 92 c0 rjmp .+292 ; 0x13024 12f00: 80 3a cpi r24, 0xA0 ; 160 12f02: 33 e0 ldi r19, 0x03 ; 3 12f04: 93 07 cpc r25, r19 12f06: 09 f4 brne .+2 ; 0x12f0a 12f08: 50 c2 rjmp .+1184 ; 0x133aa 12f0a: 8b 38 cpi r24, 0x8B ; 139 12f0c: 93 40 sbci r25, 0x03 ; 3 12f0e: 09 f0 breq .+2 ; 0x12f12 12f10: 93 c9 rjmp .-3290 ; 0x12238 for(int i=0;i 12f18: 88 23 and r24, r24 12f1a: 39 f0 breq .+14 ; 0x12f2a 12f1c: 0e 94 03 5a call 0xb406 ; 0xb406 12f20: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 12f24: 80 e0 ldi r24, 0x00 ; 0 12f26: 0f 94 8f 21 call 0x2431e ; 0x2431e #endif #ifdef MOTOR_CURRENT_PWM_Z_PIN if(code_seen('Z')) st_current_set(1, code_value()); 12f2a: 8a e5 ldi r24, 0x5A ; 90 12f2c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12f30: 88 23 and r24, r24 12f32: 39 f0 breq .+14 ; 0x12f42 12f34: 0e 94 03 5a call 0xb406 ; 0xb406 12f38: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 12f3c: 81 e0 ldi r24, 0x01 ; 1 12f3e: 0f 94 8f 21 call 0x2431e ; 0x2431e #endif #ifdef MOTOR_CURRENT_PWM_E_PIN if(code_seen('E')) st_current_set(2, code_value()); 12f42: 85 e4 ldi r24, 0x45 ; 69 12f44: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12f48: 88 23 and r24, r24 12f4a: 09 f4 brne .+2 ; 0x12f4e 12f4c: 6b c0 rjmp .+214 ; 0x13024 12f4e: 0e 94 03 5a call 0xb406 ; 0xb406 12f52: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 12f56: cb 01 movw r24, r22 12f58: 0f 94 8f 20 call 0x2411e ; 0x2411e 12f5c: 63 c0 rjmp .+198 ; 0x13024 - `string` - Must for M1 and optional for M0 message to display on the LCD */ case 0: case 1: { const char *src = strchr_pointer + 2; 12f5e: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 12f62: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 12f66: 0e 5f subi r16, 0xFE ; 254 12f68: 1f 4f sbci r17, 0xFF ; 255 codenum = 0; if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 12f6a: 80 e5 ldi r24, 0x50 ; 80 12f6c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 */ case 0: case 1: { const char *src = strchr_pointer + 2; codenum = 0; 12f70: c1 2c mov r12, r1 12f72: d1 2c mov r13, r1 12f74: 76 01 movw r14, r12 if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 12f76: 88 23 and r24, r24 12f78: 21 f0 breq .+8 ; 0x12f82 12f7a: 0e 94 93 55 call 0xab26 ; 0xab26 12f7e: 6b 01 movw r12, r22 12f80: 7c 01 movw r14, r24 if (code_seen('S')) codenum = code_value_long() * 1000; // seconds to wait 12f82: 83 e5 ldi r24, 0x53 ; 83 12f84: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12f88: 88 23 and r24, r24 12f8a: 51 f0 breq .+20 ; 0x12fa0 12f8c: 0e 94 93 55 call 0xab26 ; 0xab26 12f90: 9b 01 movw r18, r22 12f92: ac 01 movw r20, r24 12f94: a8 ee ldi r26, 0xE8 ; 232 12f96: b3 e0 ldi r27, 0x03 ; 3 12f98: 0f 94 71 a0 call 0x340e2 ; 0x340e2 <__muluhisi3> 12f9c: 6b 01 movw r12, r22 12f9e: 7c 01 movw r14, r24 12fa0: c8 01 movw r24, r16 12fa2: 0f 5f subi r16, 0xFF ; 255 12fa4: 1f 4f sbci r17, 0xFF ; 255 bool expiration_time_set = bool(codenum); while (*src == ' ') ++src; 12fa6: dc 01 movw r26, r24 12fa8: 4c 91 ld r20, X 12faa: 40 32 cpi r20, 0x20 ; 32 12fac: c9 f3 breq .-14 ; 0x12fa0 custom_message_type = CustomMsg::M0Wait; 12fae: 26 e0 ldi r18, 0x06 ; 6 12fb0: 20 93 c7 06 sts 0x06C7, r18 ; 0x8006c7 if (!expiration_time_set && *src != '\0') { 12fb4: c1 14 cp r12, r1 12fb6: d1 04 cpc r13, r1 12fb8: e1 04 cpc r14, r1 12fba: f1 04 cpc r15, r1 12fbc: c9 f5 brne .+114 ; 0x13030 12fbe: 2c 91 ld r18, X 12fc0: 22 23 and r18, r18 12fc2: b1 f1 breq .+108 ; 0x13030 lcd_setstatus(src); 12fc4: 0e 94 81 ef call 0x1df02 ; 0x1df02 LCD_MESSAGERPGM(_T(MSG_USERWAIT)); } else { custom_message_type = CustomMsg::Status; // let the lcd display the name of the printed G-code file in farm mode } } st_synchronize(); 12fc8: 0f 94 42 22 call 0x24484 ; 0x24484 menu_set_block(MENU_BLOCK_STATUS_SCREEN_M0); 12fcc: 80 91 cd 11 lds r24, 0x11CD ; 0x8011cd 12fd0: 84 60 ori r24, 0x04 ; 4 12fd2: 80 93 cd 11 sts 0x11CD, r24 ; 0x8011cd previous_millis_cmd.start(); 12fd6: 8a e4 ldi r24, 0x4A ; 74 12fd8: 93 e0 ldi r25, 0x03 ; 3 12fda: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> if (expiration_time_set) { 12fde: c1 14 cp r12, r1 12fe0: d1 04 cpc r13, r1 12fe2: e1 04 cpc r14, r1 12fe4: f1 04 cpc r15, r1 12fe6: d9 f1 breq .+118 ; 0x1305e codenum += _millis(); // keep track of when we started waiting 12fe8: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 12fec: c6 0e add r12, r22 12fee: d7 1e adc r13, r23 12ff0: e8 1e adc r14, r24 12ff2: f9 1e adc r15, r25 KEEPALIVE_STATE(PAUSED_FOR_USER); 12ff4: 84 e0 ldi r24, 0x04 ; 4 12ff6: 80 93 78 02 sts 0x0278, r24 ; 0x800278 while(_millis() < codenum && !lcd_clicked()) { 12ffa: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 12ffe: 6c 15 cp r22, r12 13000: 7d 05 cpc r23, r13 13002: 8e 05 cpc r24, r14 13004: 9f 05 cpc r25, r15 13006: 10 f1 brcs .+68 ; 0x1304c delay_keep_alive(0); } KEEPALIVE_STATE(IN_HANDLER); 13008: 82 e0 ldi r24, 0x02 ; 2 1300a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 } else { marlin_wait_for_click(); } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); 1300e: 80 91 cd 11 lds r24, 0x11CD ; 0x8011cd 13012: 8b 7f andi r24, 0xFB ; 251 13014: 80 93 cd 11 sts 0x11CD, r24 ; 0x8011cd if (IS_SD_PRINTING) 13018: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 1301c: 88 23 and r24, r24 1301e: 91 f1 breq .+100 ; 0x13084 custom_message_type = CustomMsg::Status; 13020: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 */ default: printf_P(MSG_UNKNOWN_CODE, 'M', cmdbuffer + bufindr + CMDHDRSIZE); } // printf_P(_N("END M-CODE=%u\n"), mcode_in_progress); mcode_in_progress = 0; 13024: 10 92 ab 0d sts 0x0DAB, r1 ; 0x800dab <_ZL17mcode_in_progress.lto_priv.493+0x1> 13028: 10 92 aa 0d sts 0x0DAA, r1 ; 0x800daa <_ZL17mcode_in_progress.lto_priv.493> 1302c: 0c 94 37 84 jmp 0x1086e ; 0x1086e lcd_setstatus(src); } else { // farmers want to abuse a bug from the previous firmware releases // - they need to see the filename on the status screen instead of "Wait for user..." // So we won't update the message in farm mode... if( ! farm_mode){ 13030: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 13034: 81 11 cpse r24, r1 13036: 07 c0 rjmp .+14 ; 0x13046 LCD_MESSAGERPGM(_T(MSG_USERWAIT)); 13038: 8e e7 ldi r24, 0x7E ; 126 1303a: 99 e3 ldi r25, 0x39 ; 57 1303c: 0e 94 b1 6c call 0xd962 ; 0xd962 13040: 0e 94 65 e6 call 0x1ccca ; 0x1ccca 13044: c1 cf rjmp .-126 ; 0x12fc8 } else { custom_message_type = CustomMsg::Status; // let the lcd display the name of the printed G-code file in farm mode 13046: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 1304a: be cf rjmp .-132 ; 0x12fc8 menu_set_block(MENU_BLOCK_STATUS_SCREEN_M0); previous_millis_cmd.start(); if (expiration_time_set) { codenum += _millis(); // keep track of when we started waiting KEEPALIVE_STATE(PAUSED_FOR_USER); while(_millis() < codenum && !lcd_clicked()) { 1304c: 0e 94 98 6b call 0xd730 ; 0xd730 13050: 81 11 cpse r24, r1 13052: da cf rjmp .-76 ; 0x13008 delay_keep_alive(0); 13054: 90 e0 ldi r25, 0x00 ; 0 13056: 80 e0 ldi r24, 0x00 ; 0 13058: 0e 94 48 7c call 0xf890 ; 0xf890 1305c: ce cf rjmp .-100 ; 0x12ffa //! @brief Wait for click //! //! Set void marlin_wait_for_click() { int8_t busy_state_backup = busy_state; 1305e: 10 91 78 02 lds r17, 0x0278 ; 0x800278 KEEPALIVE_STATE(PAUSED_FOR_USER); 13062: 84 e0 ldi r24, 0x04 ; 4 13064: 80 93 78 02 sts 0x0278, r24 ; 0x800278 lcd_consume_click(); 13068: 0e 94 93 6b call 0xd726 ; 0xd726 while(!lcd_clicked()) 1306c: 0e 94 98 6b call 0xd730 ; 0xd730 13070: 81 11 cpse r24, r1 13072: 05 c0 rjmp .+10 ; 0x1307e { delay_keep_alive(0); 13074: 90 e0 ldi r25, 0x00 ; 0 13076: 80 e0 ldi r24, 0x00 ; 0 13078: 0e 94 48 7c call 0xf890 ; 0xf890 1307c: f7 cf rjmp .-18 ; 0x1306c } KEEPALIVE_STATE(busy_state_backup); 1307e: 10 93 78 02 sts 0x0278, r17 ; 0x800278 13082: c5 cf rjmp .-118 ; 0x1300e } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); if (IS_SD_PRINTING) custom_message_type = CustomMsg::Status; else LCD_MESSAGERPGM(MSG_WELCOME); 13084: 87 e6 ldi r24, 0x67 ; 103 13086: 9b e6 ldi r25, 0x6B ; 107 13088: 0e 94 65 e6 call 0x1ccca ; 0x1ccca 1308c: cb cf rjmp .-106 ; 0x13024 /*! ### M17 - Enable all axes M17: Enable/Power all stepper motors */ case 17: LCD_MESSAGERPGM(_T(MSG_NO_MOVE)); 1308e: 83 e7 ldi r24, 0x73 ; 115 13090: 99 e3 ldi r25, 0x39 ; 57 13092: 0e 94 b1 6c call 0xd962 ; 0xd962 13096: 0e 94 65 e6 call 0x1ccca ; 0x1ccca enable_x(); 1309a: 17 98 cbi 0x02, 7 ; 2 enable_y(); 1309c: 16 98 cbi 0x02, 6 ; 2 enable_z(); 1309e: 15 98 cbi 0x02, 5 ; 2 enable_e0(); 130a0: 14 98 cbi 0x02, 4 ; 2 130a2: c0 cf rjmp .-128 ; 0x13024 /*! ### M21 - Init SD card M21: Initialize SD card */ case 21: card.mount(); 130a4: 81 e0 ldi r24, 0x01 ; 1 130a6: 0f 94 7d 4d call 0x29afa ; 0x29afa 130aa: bc cf rjmp .-136 ; 0x13024 presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 130ac: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a mounted = false; 130b0: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b SERIAL_ECHO_START; 130b4: 81 e6 ldi r24, 0x61 ; 97 130b6: 9d e9 ldi r25, 0x9D ; 157 130b8: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 130bc: 89 ee ldi r24, 0xE9 ; 233 130be: 97 e6 ldi r25, 0x67 ; 103 130c0: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 130c4: af cf rjmp .-162 ; 0x13024 /*! ### M24 - Start SD print M24: Start/resume SD print */ case 24: if (printingIsPaused()) 130c6: 0e 94 bd 60 call 0xc17a ; 0xc17a 130ca: 88 23 and r24, r24 130cc: 19 f0 breq .+6 ; 0x130d4 lcd_resume_print(); 130ce: 0e 94 52 ef call 0x1dea4 ; 0x1dea4 130d2: a8 cf rjmp .-176 ; 0x13024 else { if (!filament_presence_check()) { 130d4: 0e 94 f0 ef call 0x1dfe0 ; 0x1dfe0 130d8: 88 23 and r24, r24 130da: 09 f4 brne .+2 ; 0x130de 130dc: a3 cf rjmp .-186 ; 0x13024 return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; FORCE_INLINE uint8_t percentDone(){if(!isFileOpen()) return 0; if(filesize) return sdpos/((filesize+99)/100); else return 0;}; FORCE_INLINE char* getWorkDirName(){workDir.getFilename(filename);return filename;}; FORCE_INLINE uint32_t get_sdpos() { if (!isFileOpen()) return 0; else return(sdpos); }; 130de: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 130e2: 88 23 and r24, r24 130e4: 61 f0 breq .+24 ; 0x130fe // Print was aborted break; } if (!card.get_sdpos()) 130e6: 80 91 7e 16 lds r24, 0x167E ; 0x80167e 130ea: 90 91 7f 16 lds r25, 0x167F ; 0x80167f 130ee: a0 91 80 16 lds r26, 0x1680 ; 0x801680 130f2: b0 91 81 16 lds r27, 0x1681 ; 0x801681 130f6: 89 2b or r24, r25 130f8: 8a 2b or r24, r26 130fa: 8b 2b or r24, r27 130fc: 69 f4 brne .+26 ; 0x13118 { // A new print has started from scratch, reset stats failstats_reset_print(); 130fe: 0e 94 9e 55 call 0xab3c ; 0xab3c sdpos_atomic = 0; 13102: 10 92 dc 11 sts 0x11DC, r1 ; 0x8011dc 13106: 10 92 dd 11 sts 0x11DD, r1 ; 0x8011dd 1310a: 10 92 de 11 sts 0x11DE, r1 ; 0x8011de 1310e: 10 92 df 11 sts 0x11DF, r1 ; 0x8011df 13112: 80 e0 ldi r24, 0x00 ; 0 13114: 0e 94 e8 73 call 0xe7d0 ; 0xe7d0 } void CardReader::startFileprint() { if(mounted) 13118: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1311c: 88 23 and r24, r24 1311e: 31 f0 breq .+12 ; 0x1312c { sdprinting = true; 13120: 81 e0 ldi r24, 0x01 ; 1 13122: 80 93 6a 13 sts 0x136A, r24 ; 0x80136a 13126: 85 e0 ldi r24, 0x05 ; 5 13128: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.367> la10c_reset(); #endif } card.startFileprint(); print_job_timer.start(); 1312c: 0f 94 56 20 call 0x240ac ; 0x240ac if (MMU2::mmu2.Enabled()) 13130: 80 91 94 12 lds r24, 0x1294 ; 0x801294 13134: 81 30 cpi r24, 0x01 ; 1 13136: 09 f0 breq .+2 ; 0x1313a 13138: 75 cf rjmp .-278 ; 0x13024 { if (MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) 1313a: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 1313e: 88 23 and r24, r24 13140: 09 f4 brne .+2 ; 0x13144 13142: 70 cf rjmp .-288 ; 0x13024 13144: 0e 94 fc c3 call 0x187f8 ; 0x187f8 13148: 81 11 cpse r24, r1 1314a: 6c cf rjmp .-296 ; 0x13024 { // Filament only half way into the PTFE. Unload the filament. MMU2::mmu2.unload(); 1314c: 0f 94 93 6a call 0x2d526 ; 0x2d526 13150: 69 cf rjmp .-302 ; 0x13024 #### Parameters - `S` - Index in bytes */ case 26: if(card.mounted && code_seen('S')) { 13152: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 13156: 88 23 and r24, r24 13158: 09 f4 brne .+2 ; 0x1315c 1315a: 64 cf rjmp .-312 ; 0x13024 1315c: 83 e5 ldi r24, 0x53 ; 83 1315e: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13162: 88 23 and r24, r24 13164: 09 f4 brne .+2 ; 0x13168 13166: 5e cf rjmp .-324 ; 0x13024 long index = code_value_long(); 13168: 0e 94 93 55 call 0xab26 ; 0xab26 1316c: 6b 01 movw r12, r22 1316e: 7c 01 movw r14, r24 { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; 13170: c0 92 7e 16 sts 0x167E, r12 ; 0x80167e 13174: d0 92 7f 16 sts 0x167F, r13 ; 0x80167f 13178: e0 92 80 16 sts 0x1680, r14 ; 0x801680 1317c: f0 92 81 16 sts 0x1681, r15 ; 0x801681 13180: 0f 94 f6 43 call 0x287ec ; 0x287ec card.setIndex(index); // We don't disable interrupt during update of sdpos_atomic // as we expect, that SD card print is not active in this moment sdpos_atomic = index; 13184: c0 92 dc 11 sts 0x11DC, r12 ; 0x8011dc 13188: d0 92 dd 11 sts 0x11DD, r13 ; 0x8011dd 1318c: e0 92 de 11 sts 0x11DE, r14 ; 0x8011de 13190: f0 92 df 11 sts 0x11DF, r15 ; 0x8011df 13194: 47 cf rjmp .-370 ; 0x13024 #### Parameters - `P` - Show full SFN path instead of LFN only. */ case 27: card.getStatus(code_seen('P')); 13196: 80 e5 ldi r24, 0x50 ; 80 13198: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1319c: 18 2f mov r17, r24 return filesize; } void CardReader::getStatus(bool arg_P) { if (printingIsPaused()) 1319e: 0e 94 bd 60 call 0xc17a ; 0xc17a 131a2: 88 23 and r24, r24 131a4: 91 f0 breq .+36 ; 0x131ca { if (saved_printing && (saved_printing_type == PowerPanic::PRINT_TYPE_SD)) 131a6: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 131aa: 88 23 and r24, r24 131ac: 49 f0 breq .+18 ; 0x131c0 131ae: 80 91 79 02 lds r24, 0x0279 ; 0x800279 131b2: 81 11 cpse r24, r1 131b4: 05 c0 rjmp .+10 ; 0x131c0 SERIAL_PROTOCOLLNPGM("SD print paused"); 131b6: 8f e0 ldi r24, 0x0F ; 15 131b8: 9e e7 ldi r25, 0x7E ; 126 131ba: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 131be: 32 cf rjmp .-412 ; 0x13024 else SERIAL_PROTOCOLLNPGM("Print saved"); 131c0: 83 e0 ldi r24, 0x03 ; 3 131c2: 9e e7 ldi r25, 0x7E ; 126 131c4: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 131c8: 2d cf rjmp .-422 ; 0x13024 } else if (sdprinting) 131ca: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 131ce: 88 23 and r24, r24 131d0: 09 f4 brne .+2 ; 0x131d4 131d2: 4a c0 rjmp .+148 ; 0x13268 { if (arg_P) 131d4: 11 23 and r17, r17 131d6: e1 f1 breq .+120 ; 0x13250 { printAbsFilenameFast(); 131d8: 0f 94 7b 48 call 0x290f6 ; 0x290f6 SERIAL_PROTOCOLLN(); 131dc: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); SERIAL_PROTOCOLRPGM(_N("SD printing byte "));////MSG_SD_PRINTING_BYTE 131e0: 80 ee ldi r24, 0xE0 ; 224 131e2: 94 e6 ldi r25, 0x64 ; 100 131e4: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 131e8: 60 91 7e 16 lds r22, 0x167E ; 0x80167e 131ec: 70 91 7f 16 lds r23, 0x167F ; 0x80167f 131f0: 80 91 80 16 lds r24, 0x1680 ; 0x801680 131f4: 90 91 81 16 lds r25, 0x1681 ; 0x801681 131f8: 4a e0 ldi r20, 0x0A ; 10 131fa: 0f 94 2c 96 call 0x32c58 ; 0x32c58 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 131fe: 8f e2 ldi r24, 0x2F ; 47 13200: 0e 94 41 70 call 0xe082 ; 0xe082 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 13204: 60 91 77 16 lds r22, 0x1677 ; 0x801677 13208: 70 91 78 16 lds r23, 0x1678 ; 0x801678 1320c: 80 91 79 16 lds r24, 0x1679 ; 0x801679 13210: 90 91 7a 16 lds r25, 0x167A ; 0x80167a 13214: 4a e0 ldi r20, 0x0A ; 10 13216: 0f 94 2c 96 call 0x32c58 ; 0x32c58 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 1321a: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 SERIAL_PROTOCOL(sdpos); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(filesize); uint16_t time = print_job_timer.duration() / 60; 1321e: 0f 94 66 1c call 0x238cc ; 0x238cc 13222: 2c e3 ldi r18, 0x3C ; 60 13224: 30 e0 ldi r19, 0x00 ; 0 13226: 40 e0 ldi r20, 0x00 ; 0 13228: 50 e0 ldi r21, 0x00 ; 0 1322a: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> SERIAL_PROTOCOL((int)(time / 60)); 1322e: c9 01 movw r24, r18 13230: 6c e3 ldi r22, 0x3C ; 60 13232: 70 e0 ldi r23, 0x00 ; 0 13234: 0f 94 a5 a0 call 0x3414a ; 0x3414a <__udivmodhi4> 13238: 8c 01 movw r16, r24 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1323a: 90 e0 ldi r25, 0x00 ; 0 1323c: 80 e0 ldi r24, 0x00 ; 0 1323e: 0f 94 a2 96 call 0x32d44 ; 0x32d44 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 13242: 8a e3 ldi r24, 0x3A ; 58 13244: 0e 94 41 70 call 0xe082 ; 0xe082 SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); 13248: c8 01 movw r24, r16 1324a: 0f 94 aa 41 call 0x28354 ; 0x28354 1324e: ea ce rjmp .-556 ; 0x13024 { printAbsFilenameFast(); SERIAL_PROTOCOLLN(); } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); 13250: 80 91 81 13 lds r24, 0x1381 ; 0x801381 13254: 88 23 and r24, r24 13256: 29 f0 breq .+10 ; 0x13262 13258: 81 e8 ldi r24, 0x81 ; 129 1325a: 93 e1 ldi r25, 0x13 ; 19 1325c: 0f 94 fd 98 call 0x331fa ; 0x331fa 13260: bf cf rjmp .-130 ; 0x131e0 13262: 8c e6 ldi r24, 0x6C ; 108 13264: 93 e1 ldi r25, 0x13 ; 19 13266: fa cf rjmp .-12 ; 0x1325c SERIAL_PROTOCOL((int)(time / 60)); SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); } else SERIAL_PROTOCOLLNPGM("Not SD printing"); 13268: 83 ef ldi r24, 0xF3 ; 243 1326a: 9d e7 ldi r25, 0x7D ; 125 1326c: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 13270: d9 ce rjmp .-590 ; 0x13024 /*! ### M28 - Start SD write M28: Begin write to SD card */ case 28: card.openFileWrite(strchr_pointer+4); 13272: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 13276: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 1327a: 04 96 adiw r24, 0x04 ; 4 1327c: 0f 94 22 52 call 0x2a444 ; 0x2a444 13280: d1 ce rjmp .-606 ; 0x13024 * or an I/O error occurred. */ bool SdBaseFile::remove() { dir_t* d; // free any clusters - will fail if read-only or directory if (!truncate(0)) goto fail; 13282: ce 01 movw r24, r28 13284: 01 96 adiw r24, 0x01 ; 1 13286: 0f 94 d7 44 call 0x289ae ; 0x289ae 1328a: 88 23 and r24, r24 1328c: 09 f4 brne .+2 ; 0x13290 1328e: fe c8 rjmp .-3588 ; 0x1248c // cache directory entry d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 13290: 61 e0 ldi r22, 0x01 ; 1 13292: ce 01 movw r24, r28 13294: 01 96 adiw r24, 0x01 ; 1 13296: 0f 94 9b 6e call 0x2dd36 ; 0x2dd36 if (!d) goto fail; 1329a: 00 97 sbiw r24, 0x00 ; 0 1329c: 09 f4 brne .+2 ; 0x132a0 1329e: f6 c8 rjmp .-3604 ; 0x1248c // mark entry deleted d->name[0] = DIR_NAME_DELETED; 132a0: 25 ee ldi r18, 0xE5 ; 229 132a2: fc 01 movw r30, r24 132a4: 20 83 st Z, r18 // set this file closed type_ = FAT_FILE_TYPE_CLOSED; 132a6: 1c 82 std Y+4, r1 ; 0x04 // write entry to SD return vol_->cacheFlush(); 132a8: 0f 94 2e 36 call 0x26c5c ; 0x26c5c 132ac: 18 2f mov r17, r24 132ae: ef c8 rjmp .-3618 ; 0x1248e presort(); #endif } else { SERIAL_PROTOCOLPGM("Deletion failed, File: "); 132b0: 8d ec ldi r24, 0xCD ; 205 132b2: 9d e7 ldi r25, 0x7D ; 125 132b4: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 132b8: 8c a1 ldd r24, Y+36 ; 0x24 132ba: 9d a1 ldd r25, Y+37 ; 0x25 132bc: 0e 94 a3 7c call 0xf946 ; 0xf946 132c0: 8e e2 ldi r24, 0x2E ; 46 132c2: 0e 94 41 70 call 0xe082 ; 0xe082 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 132c6: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 132ca: ac ce rjmp .-680 ; 0x13024 - `S` - Starting file offset */ case 32: { if(card.sdprinting) { 132cc: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 132d0: 81 11 cpse r24, r1 st_synchronize(); 132d2: 0f 94 42 22 call 0x24484 ; 0x24484 } const char* namestartpos = (strchr(strchr_pointer + 4,'!')); //find ! to indicate filename string start. 132d6: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 132da: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 132de: 0c 5f subi r16, 0xFC ; 252 132e0: 1f 4f sbci r17, 0xFF ; 255 132e2: 61 e2 ldi r22, 0x21 ; 33 132e4: 70 e0 ldi r23, 0x00 ; 0 132e6: c8 01 movw r24, r16 132e8: 0f 94 33 a6 call 0x34c66 ; 0x34c66 if(namestartpos==NULL) 132ec: 00 97 sbiw r24, 0x00 ; 0 132ee: 19 f0 breq .+6 ; 0x132f6 { namestartpos=strchr_pointer + 4; //default name position, 4 letters after the M } else namestartpos++; //to skip the '!' 132f0: 8c 01 movw r16, r24 132f2: 0f 5f subi r16, 0xFF ; 255 132f4: 1f 4f sbci r17, 0xFF ; 255 bool call_procedure=(code_seen('P')); 132f6: 80 e5 ldi r24, 0x50 ; 80 132f8: 0e 94 2b 55 call 0xaa56 ; 0xaa56 132fc: f8 2e mov r15, r24 if(strchr_pointer>namestartpos) 132fe: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 13302: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 13306: 08 17 cp r16, r24 13308: 19 07 cpc r17, r25 1330a: 08 f4 brcc .+2 ; 0x1330e call_procedure=false; //false alert, 'P' found within filename 1330c: f1 2c mov r15, r1 if( card.mounted ) 1330e: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 13312: 88 23 and r24, r24 13314: 09 f4 brne .+2 ; 0x13318 13316: 86 ce rjmp .-756 ; 0x13024 { card.openFileReadFilteredGcode(namestartpos,!call_procedure); 13318: 61 e0 ldi r22, 0x01 ; 1 1331a: 6f 25 eor r22, r15 1331c: c8 01 movw r24, r16 1331e: 0f 94 06 4c call 0x2980c ; 0x2980c if(code_seen('S')) 13322: 83 e5 ldi r24, 0x53 ; 83 13324: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13328: 88 23 and r24, r24 1332a: 99 f0 breq .+38 ; 0x13352 if(strchr_pointer 13330: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 13334: 80 17 cp r24, r16 13336: 91 07 cpc r25, r17 13338: 60 f4 brcc .+24 ; 0x13352 card.setIndex(code_value_long()); 1333a: 0e 94 93 55 call 0xab26 ; 0xab26 1333e: 60 93 7e 16 sts 0x167E, r22 ; 0x80167e 13342: 70 93 7f 16 sts 0x167F, r23 ; 0x80167f 13346: 80 93 80 16 sts 0x1680, r24 ; 0x801680 1334a: 90 93 81 16 sts 0x1681, r25 ; 0x801681 1334e: 0f 94 f6 43 call 0x287ec ; 0x287ec SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 13352: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 13356: 88 23 and r24, r24 13358: 31 f0 breq .+12 ; 0x13366 { sdprinting = true; 1335a: 81 e0 ldi r24, 0x01 ; 1 1335c: 80 93 6a 13 sts 0x136A, r24 ; 0x80136a 13360: 85 e0 ldi r24, 0x05 ; 5 13362: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.367> card.startFileprint(); if(!call_procedure) 13366: f1 10 cpse r15, r1 13368: 5d ce rjmp .-838 ; 0x13024 FORCE_INLINE uint8_t percentDone(){if(!isFileOpen()) return 0; if(filesize) return sdpos/((filesize+99)/100); else return 0;}; FORCE_INLINE char* getWorkDirName(){workDir.getFilename(filename);return filename;}; FORCE_INLINE uint32_t get_sdpos() { if (!isFileOpen()) return 0; else return(sdpos); }; 1336a: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 1336e: 88 23 and r24, r24 13370: 61 f0 breq .+24 ; 0x1338a { if(!card.get_sdpos()) 13372: 80 91 7e 16 lds r24, 0x167E ; 0x80167e 13376: 90 91 7f 16 lds r25, 0x167F ; 0x80167f 1337a: a0 91 80 16 lds r26, 0x1680 ; 0x801680 1337e: b0 91 81 16 lds r27, 0x1681 ; 0x801681 13382: 89 2b or r24, r25 13384: 8a 2b or r24, r26 13386: 8b 2b or r24, r27 13388: 69 f4 brne .+26 ; 0x133a4 { // A new print has started from scratch, reset stats failstats_reset_print(); 1338a: 0e 94 9e 55 call 0xab3c ; 0xab3c sdpos_atomic = 0; 1338e: 10 92 dc 11 sts 0x11DC, r1 ; 0x8011dc 13392: 10 92 dd 11 sts 0x11DD, r1 ; 0x8011dd 13396: 10 92 de 11 sts 0x11DE, r1 ; 0x8011de 1339a: 10 92 df 11 sts 0x11DF, r1 ; 0x8011df 1339e: 80 e0 ldi r24, 0x00 ; 0 133a0: 0e 94 e8 73 call 0xe7d0 ; 0xe7d0 #ifndef LA_NOCOMPAT la10c_reset(); #endif } print_job_timer.start(); // procedure calls count as normal print time. 133a4: 0f 94 56 20 call 0x240ac ; 0x240ac 133a8: 3d ce rjmp .-902 ; 0x13024 M928 [filename] */ case 928: card.openLogFile(strchr_pointer+5); 133aa: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 133ae: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 } } void CardReader::openLogFile(const char* name) { logging = true; 133b2: 21 e0 ldi r18, 0x01 ; 1 133b4: 20 93 69 13 sts 0x1369, r18 ; 0x801369 openFileWrite(name); 133b8: 05 96 adiw r24, 0x05 ; 5 133ba: 0f 94 22 52 call 0x2a444 ; 0x2a444 133be: 32 ce rjmp .-924 ; 0x13024 ### M31 - Report current print time M31: Output time since last M109 or SD card start to serial */ case 31: //M31 take time since the start of the SD print or an M109 command { char time[30]; uint32_t t = print_job_timer.duration(); 133c0: 0f 94 66 1c call 0x238cc ; 0x238cc int16_t sec, min; min = t / 60; sec = t % 60; 133c4: 2c e3 ldi r18, 0x3C ; 60 133c6: 30 e0 ldi r19, 0x00 ; 0 133c8: 40 e0 ldi r20, 0x00 ; 0 133ca: 50 e0 ldi r21, 0x00 ; 0 133cc: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> sprintf_P(time, PSTR("%i min, %i sec"), min, sec); 133d0: 7f 93 push r23 133d2: 6f 93 push r22 133d4: 3f 93 push r19 133d6: 2f 93 push r18 133d8: 8f e4 ldi r24, 0x4F ; 79 133da: 90 e8 ldi r25, 0x80 ; 128 133dc: 9f 93 push r25 133de: 8f 93 push r24 133e0: 8e 01 movw r16, r28 133e2: 0f 5f subi r16, 0xFF ; 255 133e4: 1f 4f sbci r17, 0xFF ; 255 133e6: 1f 93 push r17 133e8: 0f 93 push r16 133ea: 0f 94 f3 9e call 0x33de6 ; 0x33de6 SERIAL_ECHO_START; 133ee: 81 e6 ldi r24, 0x61 ; 97 133f0: 9d e9 ldi r25, 0x9D ; 157 133f2: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLN(time); 133f6: c8 01 movw r24, r16 133f8: 0f 94 fd 98 call 0x331fa ; 0x331fa lcd_setstatus(time); 133fc: c8 01 movw r24, r16 133fe: 0e 94 81 ef call 0x1df02 ; 0x1df02 autotempShutdown(); 13402: 0f b6 in r0, 0x3f ; 63 13404: f8 94 cli 13406: de bf out 0x3e, r29 ; 62 13408: 0f be out 0x3f, r0 ; 63 1340a: cd bf out 0x3d, r28 ; 61 1340c: 0b ce rjmp .-1002 ; 0x13024 } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) fanSpeed = pin_status; #endif if (pin_number > -1) 1340e: 17 fd sbrc r17, 7 13410: 09 ce rjmp .-1006 ; 0x13024 13412: 80 c8 rjmp .-3840 ; 0x12514 ### M44 - Reset the bed skew and offset calibration M44: Reset the bed skew and offset calibration */ case 44: // M44: Prusa3D: Reset the bed skew and offset calibration. // Reset the baby step value and the baby step applied flag. calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 13414: 80 e1 ldi r24, 0x10 ; 16 13416: 0e 94 31 c6 call 0x18c62 ; 0x18c62 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 1341a: 81 ea ldi r24, 0xA1 ; 161 1341c: 9d e0 ldi r25, 0x0D ; 13 1341e: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 13422: 4b e0 ldi r20, 0x0B ; 11 13424: 84 9f mul r24, r20 13426: c0 01 movw r24, r0 13428: 11 24 eor r1, r1 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 1342a: 70 e0 ldi r23, 0x00 ; 0 1342c: 60 e0 ldi r22, 0x00 ; 0 1342e: 80 5b subi r24, 0xB0 ; 176 13430: 92 4f sbci r25, 0xF2 ; 242 13432: 0f 94 1e a0 call 0x3403c ; 0x3403c // Reset the skew and offset in both RAM and EEPROM. calibration_status_clear(CALIBRATION_STATUS_XYZ); 13436: 82 e0 ldi r24, 0x02 ; 2 13438: 0e 94 31 c6 call 0x18c62 ; 0x18c62 reset_bed_offset_and_skew(); 1343c: 0f 94 7b 8f call 0x31ef6 ; 0x31ef6 // Reset world2machine_rotation_and_skew and world2machine_shift, therefore // the planner will not perform any adjustments in the XY plane. // Wait for the motors to stop and update the current position with the absolute values. world2machine_revert_to_uncorrected(); 13440: 0f 94 5c 8f call 0x31eb8 ; 0x31eb8 13444: ef cd rjmp .-1058 ; 0x13024 */ case 45: // M45: Prusa3D: bed skew and offset with manual Z up { int8_t verbosity_level = 0; bool only_Z = code_seen('Z'); 13446: 8a e5 ldi r24, 0x5A ; 90 13448: 0e 94 2b 55 call 0xaa56 ; 0xaa56 // Just 'V' without a number counts as V1. char c = strchr_pointer[1]; verbosity_level = (c == ' ' || c == '\t' || c == 0) ? 1 : code_value_short(); } #endif //SUPPORT_VERBOSITY gcode_M45(only_Z, verbosity_level); 1344c: 0e 94 93 c6 call 0x18d26 ; 0x18d26 13450: e9 cd rjmp .-1070 ; 0x13024 SERIAL_PROTOCOL('.'); SERIAL_PROTOCOL(uint8_t(ip[2])); SERIAL_PROTOCOL('.'); SERIAL_PROTOCOLLN(uint8_t(ip[3])); } else { SERIAL_PROTOCOLPGM("?Toshiba FlashAir GetIP failed\n"); 13452: 83 e1 ldi r24, 0x13 ; 19 13454: 90 e8 ldi r25, 0x80 ; 128 13456: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 1345a: e4 cd rjmp .-1080 ; 0x13024 } } else { SERIAL_PROTOCOLLNPGM("n/a"); 1345c: 8f e0 ldi r24, 0x0F ; 15 1345e: 90 e8 ldi r25, 0x80 ; 128 13460: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 13464: df cd rjmp .-1090 ; 0x13024 /*! ### M47 - Show end stops dialog on the display M47: Show end stops dialog on the display */ #ifndef TMC2130 case 47: KEEPALIVE_STATE(PAUSED_FOR_USER); 13466: 84 e0 ldi r24, 0x04 ; 4 13468: 80 93 78 02 sts 0x0278, r24 ; 0x800278 menu_back_if_clicked(); } void lcd_diag_show_end_stops() { lcd_clear(); 1346c: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_consume_click(); 13470: 0e 94 93 6b call 0xd726 ; 0xd726 for (;;) { manage_heater(); 13474: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(true); 13478: 81 e0 ldi r24, 0x01 ; 1 1347a: 0e 94 01 7a call 0xf402 ; 0xf402 lcd_show_end_stops(); 1347e: 0f 94 44 0a call 0x21488 ; 0x21488 if (lcd_clicked()) { 13482: 0e 94 98 6b call 0xd730 ; 0xd730 13486: 88 23 and r24, r24 13488: a9 f3 breq .-22 ; 0x13474 break; } } lcd_clear(); 1348a: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_return_to_status(); 1348e: 0e 94 17 fe call 0x1fc2e ; 0x1fc2e 13492: c8 cd rjmp .-1136 ; 0x13024 13494: 10 92 cb 0d sts 0x0DCB, r1 ; 0x800dcb <_ZL13printer_state.lto_priv.367> 13498: c5 cd rjmp .-1142 ; 0x13024 break; default: break; } } else { printf_P(_N("PrinterState: %d\n"),uint8_t(GetPrinterState())); 1349a: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.367> 1349e: 1f 92 push r1 134a0: 8f 93 push r24 134a2: 88 e1 ldi r24, 0x18 ; 24 134a4: 96 e6 ldi r25, 0x66 ; 102 134a6: 9f 93 push r25 134a8: 8f 93 push r24 134aa: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 134ae: 0f 90 pop r0 134b0: 0f 90 pop r0 134b2: 0f 90 pop r0 134b4: 0f 90 pop r0 134b6: b6 cd rjmp .-1172 ; 0x13024 - `C` - Time to change/pause/user interaction in normal mode - `D` - Time to change/pause/user interaction in silent mode */ case 73: //M73 show percent done, time remaining and time to change/pause { if(code_seen('P')) print_percent_done_normal = code_value_uint8(); 134b8: 80 e5 ldi r24, 0x50 ; 80 134ba: 0e 94 2b 55 call 0xaa56 ; 0xaa56 134be: 88 23 and r24, r24 134c0: 21 f0 breq .+8 ; 0x134ca 134c2: 0e 94 40 55 call 0xaa80 ; 0xaa80 134c6: 80 93 71 02 sts 0x0271, r24 ; 0x800271 if(code_seen('R')) print_time_remaining_normal = code_value(); 134ca: 82 e5 ldi r24, 0x52 ; 82 134cc: 0e 94 2b 55 call 0xaa56 ; 0xaa56 134d0: 88 23 and r24, r24 134d2: 41 f0 breq .+16 ; 0x134e4 134d4: 0e 94 03 5a call 0xb406 ; 0xb406 134d8: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 134dc: 70 93 75 02 sts 0x0275, r23 ; 0x800275 134e0: 60 93 74 02 sts 0x0274, r22 ; 0x800274 if(code_seen('Q')) print_percent_done_silent = code_value_uint8(); 134e4: 81 e5 ldi r24, 0x51 ; 81 134e6: 0e 94 2b 55 call 0xaa56 ; 0xaa56 134ea: 88 23 and r24, r24 134ec: 21 f0 breq .+8 ; 0x134f6 134ee: 0e 94 40 55 call 0xaa80 ; 0xaa80 134f2: 80 93 3f 02 sts 0x023F, r24 ; 0x80023f if(code_seen('S')) print_time_remaining_silent = code_value(); 134f6: 83 e5 ldi r24, 0x53 ; 83 134f8: 0e 94 2b 55 call 0xaa56 ; 0xaa56 134fc: 88 23 and r24, r24 134fe: 41 f0 breq .+16 ; 0x13510 13500: 0e 94 03 5a call 0xb406 ; 0xb406 13504: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 13508: 70 93 3e 02 sts 0x023E, r23 ; 0x80023e 1350c: 60 93 3d 02 sts 0x023D, r22 ; 0x80023d if(code_seen('C')){ 13510: 83 e4 ldi r24, 0x43 ; 67 13512: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13516: 88 23 and r24, r24 13518: a9 f0 breq .+42 ; 0x13544 float print_time_to_change_normal_f = code_value(); 1351a: 0e 94 03 5a call 0xb406 ; 0xb406 1351e: 6b 01 movw r12, r22 13520: 7c 01 movw r14, r24 print_time_to_change_normal = ( print_time_to_change_normal_f <= 0 ) ? PRINT_TIME_REMAINING_INIT : print_time_to_change_normal_f; 13522: 20 e0 ldi r18, 0x00 ; 0 13524: 30 e0 ldi r19, 0x00 ; 0 13526: a9 01 movw r20, r18 13528: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1352c: 6f ef ldi r22, 0xFF ; 255 1352e: 7f ef ldi r23, 0xFF ; 255 13530: 18 16 cp r1, r24 13532: 24 f4 brge .+8 ; 0x1353c 13534: c7 01 movw r24, r14 13536: b6 01 movw r22, r12 13538: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 1353c: 70 93 73 02 sts 0x0273, r23 ; 0x800273 13540: 60 93 72 02 sts 0x0272, r22 ; 0x800272 } if(code_seen('D')){ 13544: 84 e4 ldi r24, 0x44 ; 68 13546: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1354a: 88 23 and r24, r24 1354c: a9 f0 breq .+42 ; 0x13578 float print_time_to_change_silent_f = code_value(); 1354e: 0e 94 03 5a call 0xb406 ; 0xb406 13552: 6b 01 movw r12, r22 13554: 7c 01 movw r14, r24 print_time_to_change_silent = ( print_time_to_change_silent_f <= 0 ) ? PRINT_TIME_REMAINING_INIT : print_time_to_change_silent_f; 13556: 20 e0 ldi r18, 0x00 ; 0 13558: 30 e0 ldi r19, 0x00 ; 0 1355a: a9 01 movw r20, r18 1355c: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 13560: 6f ef ldi r22, 0xFF ; 255 13562: 7f ef ldi r23, 0xFF ; 255 13564: 18 16 cp r1, r24 13566: 24 f4 brge .+8 ; 0x13570 13568: c7 01 movw r24, r14 1356a: b6 01 movw r22, r12 1356c: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 13570: 70 93 3c 02 sts 0x023C, r23 ; 0x80023c 13574: 60 93 3b 02 sts 0x023B, r22 ; 0x80023b } { const char* _msg_mode_done_remain = _N("%S MODE: Percent done: %hhd; print time remaining in mins: %d; Change in mins: %d\n"); printf_P(_msg_mode_done_remain, _N("NORMAL"), int8_t(print_percent_done_normal), print_time_remaining_normal, print_time_to_change_normal); 13578: 80 91 73 02 lds r24, 0x0273 ; 0x800273 1357c: 8f 93 push r24 1357e: 80 91 72 02 lds r24, 0x0272 ; 0x800272 13582: 8f 93 push r24 13584: 80 91 75 02 lds r24, 0x0275 ; 0x800275 13588: 8f 93 push r24 1358a: 80 91 74 02 lds r24, 0x0274 ; 0x800274 1358e: 8f 93 push r24 13590: 80 91 71 02 lds r24, 0x0271 ; 0x800271 13594: 28 2f mov r18, r24 13596: 08 2e mov r0, r24 13598: 00 0c add r0, r0 1359a: 33 0b sbc r19, r19 1359c: 3f 93 push r19 1359e: 8f 93 push r24 135a0: 8e eb ldi r24, 0xBE ; 190 135a2: 95 e6 ldi r25, 0x65 ; 101 135a4: 9f 93 push r25 135a6: 8f 93 push r24 135a8: 05 ec ldi r16, 0xC5 ; 197 135aa: 15 e6 ldi r17, 0x65 ; 101 135ac: 1f 93 push r17 135ae: 0f 93 push r16 135b0: 0f 94 9e 9e call 0x33d3c ; 0x33d3c printf_P(_msg_mode_done_remain, _N("SILENT"), int8_t(print_percent_done_silent), print_time_remaining_silent, print_time_to_change_silent); 135b4: 80 91 3c 02 lds r24, 0x023C ; 0x80023c 135b8: 8f 93 push r24 135ba: 80 91 3b 02 lds r24, 0x023B ; 0x80023b 135be: 8f 93 push r24 135c0: 80 91 3e 02 lds r24, 0x023E ; 0x80023e 135c4: 8f 93 push r24 135c6: 80 91 3d 02 lds r24, 0x023D ; 0x80023d 135ca: 8f 93 push r24 135cc: 80 91 3f 02 lds r24, 0x023F ; 0x80023f 135d0: 28 2f mov r18, r24 135d2: 08 2e mov r0, r24 135d4: 00 0c add r0, r0 135d6: 33 0b sbc r19, r19 135d8: 3f 93 push r19 135da: 8f 93 push r24 135dc: 87 eb ldi r24, 0xB7 ; 183 135de: 95 e6 ldi r25, 0x65 ; 101 135e0: 9f 93 push r25 135e2: 8f 93 push r24 135e4: 1f 93 push r17 135e6: 0f 93 push r16 135e8: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 135ec: 0f b6 in r0, 0x3f ; 63 135ee: f8 94 cli 135f0: de bf out 0x3e, r29 ; 62 135f2: 0f be out 0x3f, r0 ; 63 135f4: cd bf out 0x3d, r28 ; 61 135f6: 16 cd rjmp .-1492 ; 0x13024 /*! ### M75 - Start the print job timer M75: Start the print job timer */ case 75: { if (!filament_presence_check()) { 135f8: 0e 94 f0 ef call 0x1dfe0 ; 0x1dfe0 135fc: 88 23 and r24, r24 135fe: 09 f4 brne .+2 ; 0x13602 13600: 11 cd rjmp .-1502 ; 0x13024 13602: d0 ce rjmp .-608 ; 0x133a4 } else return false; } bool Stopwatch::pause() { if (isRunning()) { 13604: 80 91 59 03 lds r24, 0x0359 ; 0x800359 13608: 81 30 cpi r24, 0x01 ; 1 1360a: 09 f0 breq .+2 ; 0x1360e 1360c: 0b cd rjmp .-1514 ; 0x13024 state = PAUSED; 1360e: 82 e0 ldi r24, 0x02 ; 2 13610: 80 93 59 03 sts 0x0359, r24 ; 0x800359 stopTimestamp = _millis(); 13614: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 13618: 60 93 78 06 sts 0x0678, r22 ; 0x800678 1361c: 70 93 79 06 sts 0x0679, r23 ; 0x800679 13620: 80 93 7a 06 sts 0x067A, r24 ; 0x80067a 13624: 90 93 7b 06 sts 0x067B, r25 ; 0x80067b 13628: fd cc rjmp .-1542 ; 0x13024 /*! ### M77 - Stop the print job timer M77: Stop the print job timer */ case 77: { print_job_timer.stop(); 1362a: 0f 94 7a 20 call 0x240f4 ; 0x240f4 save_statistics(); 1362e: 0e 94 38 5f call 0xbe70 ; 0xbe70 13632: f8 cc rjmp .-1552 ; 0x13024 _m_fil = _O(MSG_FILAMENT_USED); _m_time = _O(MSG_PRINT_TIME); _cm = (uint32_t)total_filament_used / 1000; _min = print_job_timer.duration() / 60; } else { if (code_seen('S')) { 13634: 83 e5 ldi r24, 0x53 ; 83 13636: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1363a: 88 23 and r24, r24 1363c: 51 f0 breq .+20 ; 0x13652 eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, code_value()); 1363e: 0e 94 03 5a call 0xb406 ; 0xb406 13642: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 13646: ab 01 movw r20, r22 13648: bc 01 movw r22, r24 if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 1364a: 81 ef ldi r24, 0xF1 ; 241 1364c: 9f e0 ldi r25, 0x0F ; 15 1364e: 0f 94 12 a0 call 0x34024 ; 0x34024 } if (code_seen('T')) { 13652: 84 e5 ldi r24, 0x54 ; 84 13654: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13658: 88 23 and r24, r24 1365a: 51 f0 breq .+20 ; 0x13670 eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, code_value()); 1365c: 0e 94 03 5a call 0xb406 ; 0xb406 13660: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 13664: ab 01 movw r20, r22 13666: bc 01 movw r22, r24 13668: 8d ee ldi r24, 0xED ; 237 1366a: 9f e0 ldi r25, 0x0F ; 15 1366c: 0f 94 12 a0 call 0x34024 ; 0x34024 } _m_fil = _O(MSG_TOTAL_FILAMENT); _m_time = _O(MSG_TOTAL_PRINT_TIME); _cm = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); 13670: 81 ef ldi r24, 0xF1 ; 241 13672: 9f e0 ldi r25, 0x0F ; 15 13674: 0f 94 e4 9f call 0x33fc8 ; 0x33fc8 13678: 16 2f mov r17, r22 1367a: 07 2f mov r16, r23 1367c: f8 2e mov r15, r24 1367e: e9 2e mov r14, r25 _min = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); 13680: 8d ee ldi r24, 0xED ; 237 13682: 9f e0 ldi r25, 0x0F ; 15 13684: 0f 94 e4 9f call 0x33fc8 ; 0x33fc8 } if (code_seen('T')) { eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, code_value()); } _m_fil = _O(MSG_TOTAL_FILAMENT); _m_time = _O(MSG_TOTAL_PRINT_TIME); 13688: 42 ef ldi r20, 0xF2 ; 242 1368a: 5a e4 ldi r21, 0x4A ; 74 eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, code_value()); } if (code_seen('T')) { eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, code_value()); } _m_fil = _O(MSG_TOTAL_FILAMENT); 1368c: 21 ee ldi r18, 0xE1 ; 225 1368e: 3a e4 ldi r19, 0x4A ; 74 13690: 0c 94 2a 93 jmp 0x12654 ; 0x12654 void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); } void M79_timer_restart() { M79_timer.start(); 13694: 8a e5 ldi r24, 0x5A ; 90 13696: 93 e0 ldi r25, 0x03 ; 3 13698: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> - `S` - Quoted string containing two characters e.g. "PL" */ case 79: M79_timer_restart(); if (code_seen('S')) 1369c: 83 e5 ldi r24, 0x53 ; 83 1369e: 0e 94 2b 55 call 0xaa56 ; 0xaa56 136a2: 88 23 and r24, r24 136a4: 09 f1 breq .+66 ; 0x136e8 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 136a6: 62 e2 ldi r22, 0x22 ; 34 136a8: 70 e0 ldi r23, 0x00 ; 0 136aa: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 136ae: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 136b2: 0f 94 33 a6 call 0x34c66 ; 0x34c66 136b6: 8c 01 movw r16, r24 if (!this->ptr) { 136b8: 89 2b or r24, r25 136ba: b1 f0 breq .+44 ; 0x136e8 // First quote not found return; } // Skip the leading quote this->ptr++; 136bc: 0f 5f subi r16, 0xFF ; 255 136be: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 136c0: 62 e2 ldi r22, 0x22 ; 34 136c2: 70 e0 ldi r23, 0x00 ; 0 136c4: c8 01 movw r24, r16 136c6: 0f 94 33 a6 call 0x34c66 ; 0x34c66 if(!pStrEnd) { 136ca: 89 2b or r24, r25 136cc: 69 f0 breq .+26 ; 0x136e8 char * GetHostStatusScreenName() { return host_status_screen_name; } void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); 136ce: e2 e7 ldi r30, 0x72 ; 114 136d0: f6 e0 ldi r31, 0x06 ; 6 136d2: 83 e0 ldi r24, 0x03 ; 3 136d4: df 01 movw r26, r30 136d6: 1d 92 st X+, r1 136d8: 8a 95 dec r24 136da: e9 f7 brne .-6 ; 0x136d6 static LongTimer M79_timer; static char host_status_screen_name[3]; void SetHostStatusScreenName(const char * name) { strncpy(host_status_screen_name, name, 2); 136dc: 42 e0 ldi r20, 0x02 ; 2 136de: 50 e0 ldi r21, 0x00 ; 0 136e0: b8 01 movw r22, r16 136e2: cf 01 movw r24, r30 136e4: 0f 94 5c a6 call 0x34cb8 ; 0x34cb8 } #ifdef DEBUG_PRINTER_STATES debug_printer_states(); #endif //DEBUG_PRINTER_STATES if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_HOST 136e8: 8c e8 ldi r24, 0x8C ; 140 136ea: 9f e0 ldi r25, 0x0F ; 15 136ec: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 && printer_recovering() && printingIsPaused()) { 136f0: 81 30 cpi r24, 0x01 ; 1 136f2: 09 f0 breq .+2 ; 0x136f6 136f4: 97 cc rjmp .-1746 ; 0x13024 #ifdef DEBUG_PRINTER_STATES debug_printer_states(); #endif //DEBUG_PRINTER_STATES if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_HOST && printer_recovering() 136f6: 0e 94 b3 60 call 0xc166 ; 0xc166 136fa: 88 23 and r24, r24 136fc: 09 f4 brne .+2 ; 0x13700 136fe: 92 cc rjmp .-1756 ; 0x13024 && printingIsPaused()) { 13700: 0e 94 bd 60 call 0xc17a ; 0xc17a 13704: 88 23 and r24, r24 13706: 09 f4 brne .+2 ; 0x1370a 13708: 8d cc rjmp .-1766 ; 0x13024 // Send action to the host, so the host can resume the print. It is up to the host // to resume the print correctly. if (uvlo_auto_recovery_ready) { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_AUTO_RECOVERY_READY); } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_RECOVERY_READY); 1370a: 84 e8 ldi r24, 0x84 ; 132 1370c: 95 e6 ldi r25, 0x65 ; 101 1370e: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 13712: 88 cc rjmp .-1776 ; 0x13024 /*! ### M112 - Emergency stop M112: Full (Emergency) Stop It is processed much earlier as to bypass the cmdqueue. */ case 112: kill(MSG_M112_KILL); 13714: 87 e6 ldi r24, 0x67 ; 103 13716: 95 e6 ldi r25, 0x65 ; 101 13718: 0e 94 df 72 call 0xe5be ; 0xe5be #### Parameters - `S` - Target temperature */ case 140: if (code_seen('S')) setTargetBed(code_value()); 1371c: 83 e5 ldi r24, 0x53 ; 83 1371e: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13722: 88 23 and r24, r24 13724: 09 f4 brne .+2 ; 0x13728 13726: 7e cc rjmp .-1796 ; 0x13024 13728: 0e 94 03 5a call 0xb406 ; 0xb406 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1372c: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 13730: 70 93 ee 11 sts 0x11EE, r23 ; 0x8011ee 13734: 60 93 ed 11 sts 0x11ED, r22 ; 0x8011ed 13738: 75 cc rjmp .-1814 ; 0x13024 ok T:20.2 /0.0 B:19.1 /0.0 T0:20.2 /0.0 @:0 B@:0 P:19.8 A:26.4 */ case 105: { SERIAL_PROTOCOLPGM("ok "); 1373a: 8b e0 ldi r24, 0x0B ; 11 1373c: 90 e8 ldi r25, 0x80 ; 128 1373e: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 gcode_M105(); 13742: 0e 94 cc 71 call 0xe398 ; 0xe398 cmdqueue_pop_front(); //prevent an ok after the command since this command uses an ok at the beginning. 13746: 0e 94 d3 6f call 0xdfa6 ; 0xdfa6 cmdbuffer_front_already_processed = true; 1374a: 81 e0 ldi r24, 0x01 ; 1 1374c: 80 93 e6 11 sts 0x11E6, r24 ; 0x8011e6 13750: 69 cc rjmp .-1838 ; 0x13024 bit 6 = free bit 7 = free */ case 155: { if (code_seen('S')){ 13752: 83 e5 ldi r24, 0x53 ; 83 13754: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13758: 88 23 and r24, r24 1375a: 51 f0 breq .+20 ; 0x13770 autoReportFeatures.SetPeriod( code_value_uint8() ); 1375c: 0e 94 40 55 call 0xaa80 ; 0xaa80 inline void SetMask(uint8_t mask){ arFunctionsActive.byte = mask; } /// sets the autoreporting timer's period /// setting it to zero stops the timer void SetPeriod(uint8_t p){ auto_report_period = p; 13760: 80 93 62 13 sts 0x1362, r24 ; 0x801362 if (auto_report_period != 0){ 13764: 88 23 and r24, r24 13766: 71 f0 breq .+28 ; 0x13784 auto_report_timer.start(); 13768: 83 e6 ldi r24, 0x63 ; 99 1376a: 93 e1 ldi r25, 0x13 ; 19 1376c: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> case 155: { if (code_seen('S')){ autoReportFeatures.SetPeriod( code_value_uint8() ); } if (code_seen('C')){ 13770: 83 e4 ldi r24, 0x43 ; 67 13772: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13776: 88 23 and r24, r24 13778: 41 f0 breq .+16 ; 0x1378a autoReportFeatures.SetMask(code_value_uint8()); 1377a: 0e 94 40 55 call 0xaa80 ; 0xaa80 inline void SetFans(uint8_t v){ arFunctionsActive.bits.fans = v; } inline bool Pos()const { return arFunctionsActive.bits.pos != 0; } inline void SetPos(uint8_t v){ arFunctionsActive.bits.pos = v; } inline void SetMask(uint8_t mask){ arFunctionsActive.byte = mask; } 1377e: 80 93 61 13 sts 0x1361, r24 ; 0x801361 13782: 50 cc rjmp .-1888 ; 0x13024 13784: 10 92 63 13 sts 0x1363, r1 ; 0x801363 13788: f3 cf rjmp .-26 ; 0x13770 1378a: 81 e0 ldi r24, 0x01 ; 1 1378c: 80 93 61 13 sts 0x1361, r24 ; 0x801361 13790: 49 cc rjmp .-1902 ; 0x13024 Command always waits for both cool down and heat up. If no parameters are supplied waits for previously set extruder temperature. */ case 109: { LCD_MESSAGERPGM(_T(MSG_HEATING)); 13792: 89 eb ldi r24, 0xB9 ; 185 13794: 98 e4 ldi r25, 0x48 ; 72 13796: 0e 94 b1 6c call 0xd962 ; 0xd962 1379a: 0e 94 65 e6 call 0x1ccca ; 0x1ccca heating_status = HeatingStatus::EXTRUDER_HEATING; 1379e: 81 e0 ldi r24, 0x01 ; 1 137a0: 80 93 99 03 sts 0x0399, r24 ; 0x800399 prusa_statistics(1); 137a4: 0f 94 ff 97 call 0x32ffe ; 0x32ffe #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { 137a8: 83 e5 ldi r24, 0x53 ; 83 137aa: 0e 94 2b 55 call 0xaa56 ; 0xaa56 137ae: 88 23 and r24, r24 137b0: 49 f0 breq .+18 ; 0x137c4 setTargetHotend(code_value()); } else if (code_seen('R')) { setTargetHotend(code_value()); 137b2: 0e 94 03 5a call 0xb406 ; 0xb406 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 137b6: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 137ba: 70 93 f2 11 sts 0x11F2, r23 ; 0x8011f2 137be: 60 93 f1 11 sts 0x11F1, r22 ; 0x8011f1 137c2: 05 c0 rjmp .+10 ; 0x137ce #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { setTargetHotend(code_value()); } else if (code_seen('R')) { 137c4: 82 e5 ldi r24, 0x52 ; 82 137c6: 0e 94 2b 55 call 0xaa56 ; 0xaa56 137ca: 81 11 cpse r24, r1 137cc: f2 cf rjmp .-28 ; 0x137b2 autotemp_factor=code_value(); autotemp_enabled=true; } #endif codenum = _millis(); 137ce: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 137d2: 6b 01 movw r12, r22 137d4: 7c 01 movw r14, r24 FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; }; FORCE_INLINE bool isHeatingHotend(uint8_t extruder){ return target_temperature[extruder] > current_temperature[extruder]; 137d6: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 137da: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 137de: 07 2e mov r0, r23 137e0: 00 0c add r0, r0 137e2: 88 0b sbc r24, r24 137e4: 99 0b sbc r25, r25 137e6: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 137ea: 11 e0 ldi r17, 0x01 ; 1 137ec: 20 91 c4 0d lds r18, 0x0DC4 ; 0x800dc4 137f0: 30 91 c5 0d lds r19, 0x0DC5 ; 0x800dc5 137f4: 40 91 c6 0d lds r20, 0x0DC6 ; 0x800dc6 137f8: 50 91 c7 0d lds r21, 0x0DC7 ; 0x800dc7 137fc: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 13800: 18 16 cp r1, r24 13802: 0c f0 brlt .+2 ; 0x13806 13804: 10 e0 ldi r17, 0x00 ; 0 /* See if we are heating up or cooling down */ target_direction = isHeatingHotend(active_extruder); // true if heating, false if cooling 13806: 10 93 c3 0d sts 0x0DC3, r17 ; 0x800dc3 <_ZL16target_direction.lto_priv.494> wait_for_heater(codenum, active_extruder); //loops until target temperature is reached 1380a: c7 01 movw r24, r14 1380c: b6 01 movw r22, r12 1380e: 0f 94 98 4e call 0x29d30 ; 0x29d30 LCD_MESSAGERPGM(_T(MSG_HEATING_COMPLETE)); 13812: 89 ea ldi r24, 0xA9 ; 169 13814: 98 e4 ldi r25, 0x48 ; 72 13816: 0e 94 b1 6c call 0xd962 ; 0xd962 1381a: 0e 94 65 e6 call 0x1ccca ; 0x1ccca heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; 1381e: 82 e0 ldi r24, 0x02 ; 2 13820: 80 93 99 03 sts 0x0399, r24 ; 0x800399 prusa_statistics(2); 13824: 0f 94 ff 97 call 0x32ffe ; 0x32ffe previous_millis_cmd.start(); 13828: 8a e4 ldi r24, 0x4A ; 74 1382a: 93 e0 ldi r25, 0x03 ; 3 1382c: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> 13830: f9 cb rjmp .-2062 ; 0x13024 */ case 190: #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 { bool CooldownNoWait = false; LCD_MESSAGERPGM(_T(MSG_BED_HEATING)); 13832: 8b e9 ldi r24, 0x9B ; 155 13834: 98 e4 ldi r25, 0x48 ; 72 13836: 0e 94 b1 6c call 0xd962 ; 0xd962 1383a: 0e 94 65 e6 call 0x1ccca ; 0x1ccca heating_status = HeatingStatus::BED_HEATING; 1383e: 83 e0 ldi r24, 0x03 ; 3 13840: 80 93 99 03 sts 0x0399, r24 ; 0x800399 prusa_statistics(1); 13844: 81 e0 ldi r24, 0x01 ; 1 13846: 0f 94 ff 97 call 0x32ffe ; 0x32ffe if (code_seen('S')) 1384a: 83 e5 ldi r24, 0x53 ; 83 1384c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13850: 18 2f mov r17, r24 13852: 88 23 and r24, r24 13854: 49 f0 breq .+18 ; 0x13868 setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) { setTargetBed(code_value()); 13856: 0e 94 03 5a call 0xb406 ; 0xb406 target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1385a: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 1385e: 70 93 ee 11 sts 0x11EE, r23 ; 0x8011ee 13862: 60 93 ed 11 sts 0x11ED, r22 ; 0x8011ed 13866: 05 c0 rjmp .+10 ; 0x13872 if (code_seen('S')) { setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) 13868: 82 e5 ldi r24, 0x52 ; 82 1386a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1386e: 81 11 cpse r24, r1 13870: f2 cf rjmp .-28 ; 0x13856 { setTargetBed(code_value()); } codenum = _millis(); 13872: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 13876: 6b 01 movw r12, r22 13878: 7c 01 movw r14, r24 cancel_heatup = false; 1387a: 10 92 c9 0d sts 0x0DC9, r1 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.377> FORCE_INLINE bool isHeatingHotend(uint8_t extruder){ return target_temperature[extruder] > current_temperature[extruder]; }; FORCE_INLINE bool isHeatingBed() { return target_temperature_bed > current_temperature_bed; 1387e: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 13882: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee 13886: 07 2e mov r0, r23 13888: 00 0c add r0, r0 1388a: 88 0b sbc r24, r24 1388c: 99 0b sbc r25, r25 1388e: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 13892: 01 e0 ldi r16, 0x01 ; 1 13894: 20 91 8a 03 lds r18, 0x038A ; 0x80038a 13898: 30 91 8b 03 lds r19, 0x038B ; 0x80038b 1389c: 40 91 8c 03 lds r20, 0x038C ; 0x80038c 138a0: 50 91 8d 03 lds r21, 0x038D ; 0x80038d 138a4: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 138a8: 18 16 cp r1, r24 138aa: 0c f0 brlt .+2 ; 0x138ae 138ac: 00 e0 ldi r16, 0x00 ; 0 target_direction = isHeatingBed(); // true if heating, false if cooling 138ae: 00 93 c3 0d sts 0x0DC3, r16 ; 0x800dc3 <_ZL16target_direction.lto_priv.494> while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 138b2: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.377> 138b6: 81 11 cpse r24, r1 138b8: 1a c0 rjmp .+52 ; 0x138ee 138ba: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 138be: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee 138c2: 07 2e mov r0, r23 138c4: 00 0c add r0, r0 138c6: 88 0b sbc r24, r24 138c8: 99 0b sbc r25, r25 138ca: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 138ce: 20 91 8a 03 lds r18, 0x038A ; 0x80038a 138d2: 30 91 8b 03 lds r19, 0x038B ; 0x80038b 138d6: 40 91 8c 03 lds r20, 0x038C ; 0x80038c 138da: 50 91 8d 03 lds r21, 0x038D ; 0x80038d 138de: e0 91 c3 0d lds r30, 0x0DC3 ; 0x800dc3 <_ZL16target_direction.lto_priv.494> 138e2: ee 23 and r30, r30 138e4: 91 f0 breq .+36 ; 0x1390a 138e6: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 138ea: 18 16 cp r1, r24 138ec: a4 f0 brlt .+40 ; 0x13916 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(_T(MSG_BED_DONE)); 138ee: 80 e9 ldi r24, 0x90 ; 144 138f0: 98 e4 ldi r25, 0x48 ; 72 138f2: 0e 94 b1 6c call 0xd962 ; 0xd962 138f6: 0e 94 65 e6 call 0x1ccca ; 0x1ccca heating_status = HeatingStatus::BED_HEATING_COMPLETE; 138fa: 84 e0 ldi r24, 0x04 ; 4 138fc: 80 93 99 03 sts 0x0399, r24 ; 0x800399 previous_millis_cmd.start(); 13900: 8a e4 ldi r24, 0x4A ; 74 13902: 93 e0 ldi r25, 0x03 ; 3 13904: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> 13908: 8d cb rjmp .-2278 ; 0x13024 codenum = _millis(); cancel_heatup = false; target_direction = isHeatingBed(); // true if heating, false if cooling while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 1390a: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1390e: 87 ff sbrs r24, 7 13910: ee cf rjmp .-36 ; 0x138ee 13912: 11 11 cpse r17, r1 13914: ec cf rjmp .-40 ; 0x138ee { if (lcd_commands_type == LcdCommands::LongPause) { 13916: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1391a: 82 30 cpi r24, 0x02 ; 2 1391c: 41 f3 breq .-48 ; 0x138ee // Print was suddenly paused, break out of the loop // This can happen when the firmware report a fan error break; } if(( _millis() - codenum) > 1000 ) //Print Temp Reading every 1 second while heating up. 1391e: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 13922: 6c 19 sub r22, r12 13924: 7d 09 sbc r23, r13 13926: 8e 09 sbc r24, r14 13928: 9f 09 sbc r25, r15 1392a: 69 3e cpi r22, 0xE9 ; 233 1392c: 73 40 sbci r23, 0x03 ; 3 1392e: 81 05 cpc r24, r1 13930: 91 05 cpc r25, r1 13932: 50 f0 brcs .+20 ; 0x13948 { if (!farm_mode) { 13934: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 13938: 81 11 cpse r24, r1 1393a: 02 c0 rjmp .+4 ; 0x13940 serialecho_temperatures(); 1393c: 0e 94 68 70 call 0xe0d0 ; 0xe0d0 } codenum = _millis(); 13940: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 13944: 6b 01 movw r12, r22 13946: 7c 01 movw r14, r24 } manage_heater(); 13948: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(); 1394c: 80 e0 ldi r24, 0x00 ; 0 1394e: 0e 94 01 7a call 0xf402 ; 0xf402 lcd_update(0); 13952: 80 e0 ldi r24, 0x00 ; 0 13954: 0e 94 42 69 call 0xd284 ; 0xd284 13958: ac cf rjmp .-168 ; 0x138b2 #### Parameters - `S` - Specifies the duty cycle of the print fan. Allowed values are 0-255. If it's omitted, a value of 255 is used. */ case 106: // M106 Sxxx Fan On S 0 .. 255 if (code_seen('S')){ 1395a: 83 e5 ldi r24, 0x53 ; 83 1395c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13960: 88 23 and r24, r24 13962: 29 f0 breq .+10 ; 0x1396e fanSpeed = code_value_uint8(); 13964: 0e 94 40 55 call 0xaa80 ; 0xaa80 13968: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 1396c: 5b cb rjmp .-2378 ; 0x13024 } else { fanSpeed = 255; 1396e: 8f ef ldi r24, 0xFF ; 255 13970: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 13974: 57 cb rjmp .-2386 ; 0x13024 /*! ### M107 - Fan off M107: Fan Off */ case 107: fanSpeed = 0; 13976: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 1397a: 54 cb rjmp .-2392 ; 0x13024 /*! ### M82 - Set E axis to absolute mode M82: Set extruder to absolute mode Makes the extruder interpret extrusion as absolute positions. */ case 82: axis_relative_modes &= ~E_AXIS_MASK; 1397c: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb 13980: 87 7f andi r24, 0xF7 ; 247 13982: 80 93 eb 11 sts 0x11EB, r24 ; 0x8011eb 13986: 4e cb rjmp .-2404 ; 0x13024 ### M18 - Disable steppers M18: Disable all stepper motors Equal to M84 (compatibility) */ case 18: //compatibility case 84: // M84 if(code_seen('S')){ 13988: 83 e5 ldi r24, 0x53 ; 83 1398a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1398e: 88 23 and r24, r24 13990: 99 f0 breq .+38 ; 0x139b8 stepper_inactive_time = code_value() * 1000; 13992: 0e 94 03 5a call 0xb406 ; 0xb406 13996: 20 e0 ldi r18, 0x00 ; 0 13998: 30 e0 ldi r19, 0x00 ; 0 1399a: 4a e7 ldi r20, 0x7A ; 122 1399c: 54 e4 ldi r21, 0x44 ; 68 1399e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 139a2: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 139a6: 60 93 37 02 sts 0x0237, r22 ; 0x800237 139aa: 70 93 38 02 sts 0x0238, r23 ; 0x800238 139ae: 80 93 39 02 sts 0x0239, r24 ; 0x800239 139b2: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 139b6: 36 cb rjmp .-2452 ; 0x13024 } else { bool all_axis = !((code_seen(axis_codes[X_AXIS])) || (code_seen(axis_codes[Y_AXIS])) || (code_seen(axis_codes[Z_AXIS]))|| (code_seen(axis_codes[E_AXIS]))); 139b8: 88 e5 ldi r24, 0x58 ; 88 139ba: 0e 94 2b 55 call 0xaa56 ; 0xaa56 139be: 88 23 and r24, r24 139c0: d1 f0 breq .+52 ; 0x139f6 disable_e0(); finishAndDisableSteppers(); } else { st_synchronize(); 139c2: 0f 94 42 22 call 0x24484 ; 0x24484 if (code_seen('X')) disable_x(); 139c6: 88 e5 ldi r24, 0x58 ; 88 139c8: 0e 94 2b 55 call 0xaa56 ; 0xaa56 139cc: 81 11 cpse r24, r1 139ce: 28 c0 rjmp .+80 ; 0x13a20 if (code_seen('Y')) disable_y(); 139d0: 89 e5 ldi r24, 0x59 ; 89 139d2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 139d6: 88 23 and r24, r24 139d8: 19 f0 breq .+6 ; 0x139e0 139da: 16 9a sbi 0x02, 6 ; 2 139dc: 10 92 a4 06 sts 0x06A4, r1 ; 0x8006a4 if (code_seen('Z')) disable_z(); 139e0: 8a e5 ldi r24, 0x5A ; 90 139e2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 #if (E0_ENABLE_PIN != X_ENABLE_PIN) // Only enable on boards that have seperate ENABLE_PINS if (code_seen('E')) disable_e0(); 139e6: 85 e4 ldi r24, 0x45 ; 69 139e8: 0e 94 2b 55 call 0xaa56 ; 0xaa56 139ec: 88 23 and r24, r24 139ee: 09 f4 brne .+2 ; 0x139f2 139f0: 19 cb rjmp .-2510 ; 0x13024 139f2: 14 9a sbi 0x02, 4 ; 2 139f4: 17 cb rjmp .-2514 ; 0x13024 if(code_seen('S')){ stepper_inactive_time = code_value() * 1000; } else { bool all_axis = !((code_seen(axis_codes[X_AXIS])) || (code_seen(axis_codes[Y_AXIS])) || (code_seen(axis_codes[Z_AXIS]))|| (code_seen(axis_codes[E_AXIS]))); 139f6: 89 e5 ldi r24, 0x59 ; 89 139f8: 0e 94 2b 55 call 0xaa56 ; 0xaa56 139fc: 81 11 cpse r24, r1 139fe: e1 cf rjmp .-62 ; 0x139c2 13a00: 8a e5 ldi r24, 0x5A ; 90 13a02: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13a06: 81 11 cpse r24, r1 13a08: dc cf rjmp .-72 ; 0x139c2 13a0a: 85 e4 ldi r24, 0x45 ; 69 13a0c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13a10: 81 11 cpse r24, r1 13a12: d7 cf rjmp .-82 ; 0x139c2 if(all_axis) { st_synchronize(); 13a14: 0f 94 42 22 call 0x24484 ; 0x24484 disable_e0(); 13a18: 14 9a sbi 0x02, 4 ; 2 finishAndDisableSteppers(); 13a1a: 0e 94 39 74 call 0xe872 ; 0xe872 13a1e: 02 cb rjmp .-2556 ; 0x13024 } else { st_synchronize(); if (code_seen('X')) disable_x(); 13a20: 17 9a sbi 0x02, 7 ; 2 13a22: 10 92 a3 06 sts 0x06A3, r1 ; 0x8006a3 13a26: d4 cf rjmp .-88 ; 0x139d0 #### Parameters - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled. */ case 85: // M85 if(code_seen('S')) { 13a28: 83 e5 ldi r24, 0x53 ; 83 13a2a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13a2e: 88 23 and r24, r24 13a30: 09 f4 brne .+2 ; 0x13a34 13a32: f8 ca rjmp .-2576 ; 0x13024 max_inactive_time = code_value() * 1000; 13a34: 0e 94 03 5a call 0xb406 ; 0xb406 13a38: 20 e0 ldi r18, 0x00 ; 0 13a3a: 30 e0 ldi r19, 0x00 ; 0 13a3c: 4a e7 ldi r20, 0x7A ; 122 13a3e: 54 e4 ldi r21, 0x44 ; 68 13a40: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 13a44: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 13a48: 60 93 46 03 sts 0x0346, r22 ; 0x800346 13a4c: 70 93 47 03 sts 0x0347, r23 ; 0x800347 13a50: 80 93 48 03 sts 0x0348, r24 ; 0x800348 13a54: 90 93 49 03 sts 0x0349, r25 ; 0x800349 13a58: e5 ca rjmp .-2614 ; 0x13024 13a5a: 84 ec ldi r24, 0xC4 ; 196 13a5c: 88 2e mov r8, r24 13a5e: 82 e0 ldi r24, 0x02 ; 2 13a60: 98 2e mov r9, r24 13a62: 92 e3 ldi r25, 0x32 ; 50 13a64: a9 2e mov r10, r25 13a66: 94 e0 ldi r25, 0x04 ; 4 13a68: b9 2e mov r11, r25 - `Y` - Steps per mm for the Y drive - `Z` - Steps per mm for the Z drive - `E` - Steps per mm for the extruder drive */ case 92: for(int8_t i=0; i < NUM_AXIS; i++) 13a6a: 10 e0 ldi r17, 0x00 ; 0 { if(code_seen(axis_codes[i])) 13a6c: f4 01 movw r30, r8 13a6e: 81 91 ld r24, Z+ 13a70: 4f 01 movw r8, r30 13a72: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13a76: 88 23 and r24, r24 13a78: 09 f4 brne .+2 ; 0x13a7c 13a7a: 65 c0 rjmp .+202 ; 0x13b46 { float value = code_value(); 13a7c: 0e 94 03 5a call 0xb406 ; 0xb406 13a80: 6b 01 movw r12, r22 13a82: 7c 01 movw r14, r24 if(i == E_AXIS) { // E 13a84: 13 30 cpi r17, 0x03 ; 3 13a86: 09 f0 breq .+2 ; 0x13a8a 13a88: 68 c0 rjmp .+208 ; 0x13b5a if(value < 20.0) { 13a8a: 20 e0 ldi r18, 0x00 ; 0 13a8c: 30 e0 ldi r19, 0x00 ; 0 13a8e: 40 ea ldi r20, 0xA0 ; 160 13a90: 51 e4 ldi r21, 0x41 ; 65 13a92: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 13a96: 87 ff sbrs r24, 7 13a98: 4e c0 rjmp .+156 ; 0x13b36 const float factor = cs.axis_steps_per_mm[E_AXIS] / value; // increase e constants if M92 E14 is given for netfab. 13a9a: a7 01 movw r20, r14 13a9c: 96 01 movw r18, r12 13a9e: 60 91 42 04 lds r22, 0x0442 ; 0x800442 13aa2: 70 91 43 04 lds r23, 0x0443 ; 0x800443 13aa6: 80 91 44 04 lds r24, 0x0444 ; 0x800444 13aaa: 90 91 45 04 lds r25, 0x0445 ; 0x800445 13aae: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 13ab2: 2b 01 movw r4, r22 13ab4: 3c 01 movw r6, r24 cs.max_jerk[E_AXIS] *= factor; 13ab6: ac 01 movw r20, r24 13ab8: 9b 01 movw r18, r22 13aba: 60 91 86 04 lds r22, 0x0486 ; 0x800486 13abe: 70 91 87 04 lds r23, 0x0487 ; 0x800487 13ac2: 80 91 88 04 lds r24, 0x0488 ; 0x800488 13ac6: 90 91 89 04 lds r25, 0x0489 ; 0x800489 13aca: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 13ace: 60 93 86 04 sts 0x0486, r22 ; 0x800486 13ad2: 70 93 87 04 sts 0x0487, r23 ; 0x800487 13ad6: 80 93 88 04 sts 0x0488, r24 ; 0x800488 13ada: 90 93 89 04 sts 0x0489, r25 ; 0x800489 max_feedrate[E_AXIS] *= factor; 13ade: a3 01 movw r20, r6 13ae0: 92 01 movw r18, r4 13ae2: 60 91 52 04 lds r22, 0x0452 ; 0x800452 13ae6: 70 91 53 04 lds r23, 0x0453 ; 0x800453 13aea: 80 91 54 04 lds r24, 0x0454 ; 0x800454 13aee: 90 91 55 04 lds r25, 0x0455 ; 0x800455 13af2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 13af6: 60 93 52 04 sts 0x0452, r22 ; 0x800452 13afa: 70 93 53 04 sts 0x0453, r23 ; 0x800453 13afe: 80 93 54 04 sts 0x0454, r24 ; 0x800454 13b02: 90 93 55 04 sts 0x0455, r25 ; 0x800455 max_acceleration_steps_per_s2[E_AXIS] *= factor; 13b06: 60 91 f1 16 lds r22, 0x16F1 ; 0x8016f1 13b0a: 70 91 f2 16 lds r23, 0x16F2 ; 0x8016f2 13b0e: 80 91 f3 16 lds r24, 0x16F3 ; 0x8016f3 13b12: 90 91 f4 16 lds r25, 0x16F4 ; 0x8016f4 13b16: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 13b1a: a3 01 movw r20, r6 13b1c: 92 01 movw r18, r4 13b1e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 13b22: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 13b26: 60 93 f1 16 sts 0x16F1, r22 ; 0x8016f1 13b2a: 70 93 f2 16 sts 0x16F2, r23 ; 0x8016f2 13b2e: 80 93 f3 16 sts 0x16F3, r24 ; 0x8016f3 13b32: 90 93 f4 16 sts 0x16F4, r25 ; 0x8016f4 } cs.axis_steps_per_mm[E_AXIS] = value; 13b36: c0 92 42 04 sts 0x0442, r12 ; 0x800442 13b3a: d0 92 43 04 sts 0x0443, r13 ; 0x800443 13b3e: e0 92 44 04 sts 0x0444, r14 ; 0x800444 13b42: f0 92 45 04 sts 0x0445, r15 ; 0x800445 13b46: b4 e0 ldi r27, 0x04 ; 4 13b48: ab 0e add r10, r27 13b4a: b1 1c adc r11, r1 13b4c: 1f 5f subi r17, 0xFF ; 255 - `Y` - Steps per mm for the Y drive - `Z` - Steps per mm for the Z drive - `E` - Steps per mm for the extruder drive */ case 92: for(int8_t i=0; i < NUM_AXIS; i++) 13b4e: 14 30 cpi r17, 0x04 ; 4 13b50: 09 f0 breq .+2 ; 0x13b54 13b52: 8c cf rjmp .-232 ; 0x13a6c } else { cs.axis_steps_per_mm[i] = value; } } } reset_acceleration_rates(); 13b54: 0f 94 95 74 call 0x2e92a ; 0x2e92a 13b58: 65 ca rjmp .-2870 ; 0x13024 cs.axis_steps_per_mm[E_AXIS] = value; #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) fsensor.init(); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } else { cs.axis_steps_per_mm[i] = value; 13b5a: d5 01 movw r26, r10 13b5c: 14 96 adiw r26, 0x04 ; 4 13b5e: cd 92 st X+, r12 13b60: dd 92 st X+, r13 13b62: ed 92 st X+, r14 13b64: fc 92 st X, r15 13b66: 17 97 sbiw r26, 0x07 ; 7 13b68: ee cf rjmp .-36 ; 0x13b46 #### Parameters - `S` - Seconds. Default is 2 seconds between "busy" messages */ case 113: if (code_seen('S')) { 13b6a: 83 e5 ldi r24, 0x53 ; 83 13b6c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13b70: 88 23 and r24, r24 13b72: 29 f0 breq .+10 ; 0x13b7e host_keepalive_interval = code_value_uint8(); 13b74: 0e 94 40 55 call 0xaa80 ; 0xaa80 13b78: 80 93 32 02 sts 0x0232, r24 ; 0x800232 13b7c: 53 ca rjmp .-2906 ; 0x13024 } else { SERIAL_ECHO_START; 13b7e: 81 e6 ldi r24, 0x61 ; 97 13b80: 9d e9 ldi r25, 0x9D ; 157 13b82: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); 13b86: c0 90 32 02 lds r12, 0x0232 ; 0x800232 13b8a: d1 2c mov r13, r1 13b8c: f1 2c mov r15, r1 13b8e: e1 2c mov r14, r1 void serial_echopair_P(const char *s_P, float v) { serialprintPGM(s_P); SERIAL_ECHO(v); } void serial_echopair_P(const char *s_P, double v) { serialprintPGM(s_P); SERIAL_ECHO(v); } void serial_echopair_P(const char *s_P, unsigned long v) { serialprintPGM(s_P); SERIAL_ECHO(v); } 13b90: 84 e0 ldi r24, 0x04 ; 4 13b92: 90 e8 ldi r25, 0x80 ; 128 13b94: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 13b98: 4a e0 ldi r20, 0x0A ; 10 13b9a: c7 01 movw r24, r14 13b9c: b6 01 movw r22, r12 13b9e: 0f 94 2c 96 call 0x32c58 ; 0x32c58 host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); SERIAL_PROTOCOLLN(); 13ba2: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 13ba6: 3e ca rjmp .-2948 ; 0x13024 */ case 115: // M115 if (code_seen('V')) { // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); } else if (code_seen('U')) { 13ba8: 85 e5 ldi r24, 0x55 ; 85 13baa: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13bae: 88 23 and r24, r24 13bb0: 09 f4 brne .+2 ; 0x13bb4 13bb2: 5a c0 rjmp .+180 ; 0x13c68 // Check the firmware version provided. If the firmware version provided by the U code is higher than the currently running firmware, // pause the print for 30s and ask the user to upgrade the firmware. show_upgrade_dialog_if_version_newer(++ strchr_pointer); 13bb4: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 13bb8: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 13bbc: 0f 5f subi r16, 0xFF ; 255 13bbe: 1f 4f sbci r17, 0xFF ; 255 13bc0: 10 93 f6 16 sts 0x16F6, r17 ; 0x8016f6 13bc4: 00 93 f5 16 sts 0x16F5, r16 ; 0x8016f5 return false; } bool show_upgrade_dialog_if_version_newer(const char *version_string) { if(oCheckVersion == ClCheckMode::_None) 13bc8: 80 91 b7 03 lds r24, 0x03B7 ; 0x8003b7 13bcc: 88 23 and r24, r24 13bce: 09 f4 brne .+2 ; 0x13bd2 13bd0: 29 ca rjmp .-2990 ; 0x13024 // 1 - yes, 0 - false, -1 - error; inline int8_t is_provided_version_newer(const char *version_string) { uint16_t ver_gcode[4]; if (! parse_version(version_string, ver_gcode)) 13bd2: be 01 movw r22, r28 13bd4: 6f 5f subi r22, 0xFF ; 255 13bd6: 7f 4f sbci r23, 0xFF ; 255 13bd8: c8 01 movw r24, r16 13bda: 0e 94 17 e1 call 0x1c22e ; 0x1c22e 13bde: 88 23 and r24, r24 13be0: 09 f4 brne .+2 ; 0x13be4 13be2: 20 ca rjmp .-3008 ; 0x13024 13be4: 8f e4 ldi r24, 0x4F ; 79 13be6: 96 e8 ldi r25, 0x86 ; 134 13be8: de 01 movw r26, r28 13bea: 11 96 adiw r26, 0x01 ; 1 13bec: be 01 movw r22, r28 13bee: 67 5f subi r22, 0xF7 ; 247 13bf0: 7f 4f sbci r23, 0xFF ; 255 return -1; for (uint8_t i = 0; i < 4; ++ i) { uint16_t v = (uint16_t)pgm_read_word(&FW_VERSION_NR[i]); 13bf2: fc 01 movw r30, r24 13bf4: 45 91 lpm r20, Z+ 13bf6: 54 91 lpm r21, Z if (ver_gcode[i] > v) 13bf8: 2d 91 ld r18, X+ 13bfa: 3d 91 ld r19, X+ 13bfc: 42 17 cp r20, r18 13bfe: 53 07 cpc r21, r19 13c00: 10 f4 brcc .+4 ; 0x13c06 13c02: 0c 94 41 b0 jmp 0x16082 ; 0x16082 return 1; else if (ver_gcode[i] < v) 13c06: 24 17 cp r18, r20 13c08: 35 07 cpc r19, r21 13c0a: 08 f4 brcc .+2 ; 0x13c0e 13c0c: 0b ca rjmp .-3050 ; 0x13024 13c0e: 02 96 adiw r24, 0x02 ; 2 inline int8_t is_provided_version_newer(const char *version_string) { uint16_t ver_gcode[4]; if (! parse_version(version_string, ver_gcode)) return -1; for (uint8_t i = 0; i < 4; ++ i) 13c10: a6 17 cp r26, r22 13c12: b7 07 cpc r27, r23 13c14: 71 f7 brne .-36 ; 0x13bf2 13c16: 06 ca rjmp .-3060 ; 0x13024 if (upgrade) { lcd_display_message_fullscreen_P(_T(MSG_NEW_FIRMWARE_AVAILABLE)); lcd_puts_at_P(0, 2, PSTR("")); for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c) lcd_putc(*c); lcd_puts_at_P(0, 3, _T(MSG_NEW_FIRMWARE_PLEASE_UPGRADE)); 13c18: 8f e0 ldi r24, 0x0F ; 15 13c1a: 99 e3 ldi r25, 0x39 ; 57 13c1c: 0e 94 b1 6c call 0xd962 ; 0xd962 13c20: ac 01 movw r20, r24 13c22: 63 e0 ldi r22, 0x03 ; 3 13c24: 80 e0 ldi r24, 0x00 ; 0 13c26: 0e 94 8f 69 call 0xd31e ; 0xd31e Sound_MakeCustom(50,1000,false); 13c2a: 40 e0 ldi r20, 0x00 ; 0 13c2c: 68 ee ldi r22, 0xE8 ; 232 13c2e: 73 e0 ldi r23, 0x03 ; 3 13c30: 82 e3 ldi r24, 0x32 ; 50 13c32: 90 e0 ldi r25, 0x00 ; 0 13c34: 0f 94 c5 31 call 0x2638a ; 0x2638a delay_keep_alive(500); 13c38: 84 ef ldi r24, 0xF4 ; 244 13c3a: 91 e0 ldi r25, 0x01 ; 1 13c3c: 0e 94 48 7c call 0xf890 ; 0xf890 Sound_MakeCustom(50,1000,false); 13c40: 40 e0 ldi r20, 0x00 ; 0 13c42: 68 ee ldi r22, 0xE8 ; 232 13c44: 73 e0 ldi r23, 0x03 ; 3 13c46: 82 e3 ldi r24, 0x32 ; 50 13c48: 90 e0 ldi r25, 0x00 ; 0 13c4a: 0f 94 c5 31 call 0x2638a ; 0x2638a lcd_wait_for_click_delay(30); 13c4e: 8e e1 ldi r24, 0x1E ; 30 13c50: 90 e0 ldi r25, 0x00 ; 0 13c52: 0f 94 a1 34 call 0x26942 ; 0x26942 lcd_update_enable(true); 13c56: 81 e0 ldi r24, 0x01 ; 1 13c58: 0e 94 c0 69 call 0xd380 ; 0xd380 lcd_clear(); 13c5c: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_update(0); 13c60: 80 e0 ldi r24, 0x00 ; 0 13c62: 0e 94 42 69 call 0xd284 ; 0xd284 13c66: de c9 rjmp .-3140 ; 0x13024 } else { char custom_mendel_name[MAX_CUSTOM_MENDEL_NAME_LENGTH]; eeprom_read_block(custom_mendel_name,(char*)EEPROM_CUSTOM_MENDEL_NAME,MAX_CUSTOM_MENDEL_NAME_LENGTH); 13c68: 41 e1 ldi r20, 0x11 ; 17 13c6a: 50 e0 ldi r21, 0x00 ; 0 13c6c: 60 e8 ldi r22, 0x80 ; 128 13c6e: 7c e0 ldi r23, 0x0C ; 12 13c70: ce 01 movw r24, r28 13c72: 01 96 adiw r24, 0x01 ; 1 13c74: 0f 94 cc 9f call 0x33f98 ; 0x33f98 SERIAL_ECHOPGM("FIRMWARE_NAME:Prusa-Firmware "); 13c78: 86 ee ldi r24, 0xE6 ; 230 13c7a: 9f e7 ldi r25, 0x7F ; 127 13c7c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHORPGM(FW_VERSION_STR_P()); 13c80: 83 ec ldi r24, 0xC3 ; 195 13c82: 9e e9 ldi r25, 0x9E ; 158 13c84: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOPGM("+"); 13c88: 84 ee ldi r24, 0xE4 ; 228 13c8a: 9f e7 ldi r25, 0x7F ; 127 13c8c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOPGM(STR(FW_COMMITNR)); 13c90: 8f ed ldi r24, 0xDF ; 223 13c92: 9f e7 ldi r25, 0x7F ; 127 13c94: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOPGM("_"); 13c98: 8d ed ldi r24, 0xDD ; 221 13c9a: 9f e7 ldi r25, 0x7F ; 127 13c9c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOPGM(FW_COMMIT_HASH); 13ca0: 83 ed ldi r24, 0xD3 ; 211 13ca2: 9f e7 ldi r25, 0x7F ; 127 13ca4: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOPGM(" based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:"); 13ca8: 89 e7 ldi r24, 0x79 ; 121 13caa: 9f e7 ldi r25, 0x7F ; 127 13cac: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOPGM(PROTOCOL_VERSION); 13cb0: 85 e7 ldi r24, 0x75 ; 117 13cb2: 9f e7 ldi r25, 0x7F ; 127 13cb4: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOPGM(" MACHINE_TYPE:"); 13cb8: 86 e6 ldi r24, 0x66 ; 102 13cba: 9f e7 ldi r25, 0x7F ; 127 13cbc: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 13cc0: ce 01 movw r24, r28 13cc2: 01 96 adiw r24, 0x01 ; 1 13cc4: 0e 94 a3 7c call 0xf946 ; 0xf946 SERIAL_PROTOCOL(custom_mendel_name); SERIAL_ECHOPGM(" EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)); 13cc8: 84 e5 ldi r24, 0x54 ; 84 13cca: 9f e7 ldi r25, 0x7F ; 127 13ccc: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 #ifdef MACHINE_UUID SERIAL_ECHOPGM(" UUID:"); SERIAL_ECHOPGM(MACHINE_UUID); #endif //MACHINE_UUID SERIAL_ECHOLNPGM(""); 13cd0: 83 e5 ldi r24, 0x53 ; 83 13cd2: 9f e7 ldi r25, 0x7F ; 127 13cd4: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 } #ifdef EXTENDED_CAPABILITIES_REPORT static void cap_line(const char* name, bool ena = false) { printf_P(PSTR("Cap:%S:%c\n"), name, (char)ena + '0'); 13cd8: 1f 92 push r1 13cda: 01 e3 ldi r16, 0x31 ; 49 13cdc: f0 2e mov r15, r16 13cde: ff 92 push r15 13ce0: 8c eb ldi r24, 0xBC ; 188 13ce2: 9d e7 ldi r25, 0x7D ; 125 13ce4: 9f 93 push r25 13ce6: 8f 93 push r24 13ce8: 05 e7 ldi r16, 0x75 ; 117 13cea: 1d e7 ldi r17, 0x7D ; 125 13cec: 1f 93 push r17 13cee: 0f 93 push r16 13cf0: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 13cf4: 1f 92 push r1 13cf6: ff 92 push r15 13cf8: 8c ea ldi r24, 0xAC ; 172 13cfa: 9d e7 ldi r25, 0x7D ; 125 13cfc: 9f 93 push r25 13cfe: 8f 93 push r24 13d00: 1f 93 push r17 13d02: 0f 93 push r16 13d04: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 13d08: 1f 92 push r1 13d0a: ff 92 push r15 13d0c: 88 e9 ldi r24, 0x98 ; 152 13d0e: 9d e7 ldi r25, 0x7D ; 125 13d10: 9f 93 push r25 13d12: 8f 93 push r24 13d14: 1f 93 push r17 13d16: 0f 93 push r16 13d18: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 13d1c: 1f 92 push r1 13d1e: ff 92 push r15 13d20: 8b e8 ldi r24, 0x8B ; 139 13d22: 9d e7 ldi r25, 0x7D ; 125 13d24: 9f 93 push r25 13d26: 8f 93 push r24 13d28: 1f 93 push r17 13d2a: 0f 93 push r16 13d2c: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 13d30: 1f 92 push r1 13d32: ff 92 push r15 13d34: 80 e8 ldi r24, 0x80 ; 128 13d36: 9d e7 ldi r25, 0x7D ; 125 13d38: 9f 93 push r25 13d3a: 8f 93 push r24 13d3c: 1f 93 push r17 13d3e: 0f 93 push r16 13d40: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 13d44: 0f b6 in r0, 0x3f ; 63 13d46: f8 94 cli 13d48: de bf out 0x3e, r29 ; 62 13d4a: 0f be out 0x3f, r0 ; 63 13d4c: cd bf out 0x3d, r28 ; 61 13d4e: 6a c9 rjmp .-3372 ; 0x13024 /*! ### M114 - Get current position M114: Get Current Position */ case 114: gcode_M114(); 13d50: 0e 94 51 71 call 0xe2a2 ; 0xe2a2 13d54: 67 c9 rjmp .-3378 ; 0x13024 /*! ### M117 - Display Message M117: Display Message */ case 117: { const char *src = strchr_pointer + 4; // "M117" 13d56: e0 91 f5 16 lds r30, 0x16F5 ; 0x8016f5 13d5a: f0 91 f6 16 lds r31, 0x16F6 ; 0x8016f6 13d5e: cf 01 movw r24, r30 13d60: 04 96 adiw r24, 0x04 ; 4 lcd_setstatus(*src == ' '? src + 1: src); 13d62: 24 81 ldd r18, Z+4 ; 0x04 13d64: 20 32 cpi r18, 0x20 ; 32 13d66: 09 f4 brne .+2 ; 0x13d6a 13d68: 01 96 adiw r24, 0x01 ; 1 13d6a: 0e 94 81 ef call 0x1df02 ; 0x1df02 custom_message_type = CustomMsg::M117; 13d6e: 87 e0 ldi r24, 0x07 ; 7 13d70: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 13d74: 57 c9 rjmp .-3410 ; 0x13024 - `E1` - Prepend echo: to the message. Some hosts will display echo messages differently when preceded by echo:. - `String` - Message string. If omitted, a blank line will be sent. */ case 118: { bool hasE = false, hasA = false; char *p = strchr_pointer + 5; 13d76: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 13d7a: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 13d7e: 0b 5f subi r16, 0xFB ; 251 13d80: 1f 4f sbci r17, 0xFF ; 255 13d82: 83 e0 ldi r24, 0x03 ; 3 - `A1` - Prepend // to denote a comment or action command. Hosts like OctoPrint can interpret such commands to perform special actions. See your host’s documentation. - `E1` - Prepend echo: to the message. Some hosts will display echo messages differently when preceded by echo:. - `String` - Message string. If omitted, a blank line will be sent. */ case 118: { bool hasE = false, hasA = false; 13d84: f1 2c mov r15, r1 13d86: 40 e0 ldi r20, 0x00 ; 0 13d88: 81 50 subi r24, 0x01 ; 1 char *p = strchr_pointer + 5; for (uint8_t i = 2; i--;) { 13d8a: e9 f0 breq .+58 ; 0x13dc6 // A1, E1, and Pn are always parsed out if (!((p[0] == 'A' || p[0] == 'E') && p[1] == '1')) break; 13d8c: d8 01 movw r26, r16 13d8e: 9c 91 ld r25, X 13d90: 29 2f mov r18, r25 13d92: 2b 7f andi r18, 0xFB ; 251 13d94: 21 34 cpi r18, 0x41 ; 65 13d96: b9 f4 brne .+46 ; 0x13dc6 13d98: 11 96 adiw r26, 0x01 ; 1 13d9a: 2c 91 ld r18, X 13d9c: 21 33 cpi r18, 0x31 ; 49 13d9e: 99 f4 brne .+38 ; 0x13dc6 switch (p[0]) { 13da0: 91 34 cpi r25, 0x41 ; 65 13da2: 71 f0 breq .+28 ; 0x13dc0 13da4: 95 34 cpi r25, 0x45 ; 69 13da6: 09 f4 brne .+2 ; 0x13daa case 'A': hasA = true; break; case 'E': hasE = true; break; 13da8: 41 e0 ldi r20, 0x01 ; 1 } p += 2; 13daa: 98 01 movw r18, r16 13dac: 2e 5f subi r18, 0xFE ; 254 13dae: 3f 4f sbci r19, 0xFF ; 255 13db0: 89 01 movw r16, r18 13db2: 2f 5f subi r18, 0xFF ; 255 13db4: 3f 4f sbci r19, 0xFF ; 255 while (*p == ' ') ++p; 13db6: f8 01 movw r30, r16 13db8: 90 81 ld r25, Z 13dba: 90 32 cpi r25, 0x20 ; 32 13dbc: c9 f3 breq .-14 ; 0x13db0 13dbe: e4 cf rjmp .-56 ; 0x13d88 for (uint8_t i = 2; i--;) { // A1, E1, and Pn are always parsed out if (!((p[0] == 'A' || p[0] == 'E') && p[1] == '1')) break; switch (p[0]) { case 'A': hasA = true; break; 13dc0: ff 24 eor r15, r15 13dc2: f3 94 inc r15 13dc4: f2 cf rjmp .-28 ; 0x13daa } p += 2; while (*p == ' ') ++p; } if (hasE) SERIAL_ECHO_START; 13dc6: 44 23 and r20, r20 13dc8: 21 f0 breq .+8 ; 0x13dd2 13dca: 81 e6 ldi r24, 0x61 ; 97 13dcc: 9d e9 ldi r25, 0x9D ; 157 13dce: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 if (hasA) SERIAL_ECHOPGM("//"); 13dd2: ff 20 and r15, r15 13dd4: 21 f0 breq .+8 ; 0x13dde 13dd6: 80 e5 ldi r24, 0x50 ; 80 13dd8: 9f e7 ldi r25, 0x7F ; 127 13dda: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLN(p); 13dde: c8 01 movw r24, r16 13de0: 0f 94 fd 98 call 0x331fa ; 0x331fa 13de4: 1f c9 rjmp .-3522 ; 0x13024 SERIAL_PROTOCOLRPGM(_N("Reporting endstop status"));////MSG_M119_REPORT SERIAL_PROTOCOLLN(); #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_min: "));////MSG_X_MIN if(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); 13de6: 87 e3 ldi r24, 0x37 ; 55 13de8: 95 e6 ldi r25, 0x65 ; 101 13dea: 0c 94 f5 93 jmp 0x127ea ; 0x127ea SERIAL_PROTOCOLLN(); #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_min: "));////MSG_Y_MIN if(READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); 13dee: 87 e3 ldi r24, 0x37 ; 55 13df0: 95 e6 ldi r25, 0x65 ; 101 13df2: 0c 94 03 94 jmp 0x12806 ; 0x12806 SERIAL_PROTOCOLLN(); #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MIN); if(READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); 13df6: 87 e3 ldi r24, 0x37 ; 55 13df8: 95 e6 ldi r25, 0x65 ; 101 13dfa: 0c 94 11 94 jmp 0x12822 ; 0x12822 SERIAL_PROTOCOLLN(); #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MAX); if(READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); 13dfe: 87 e3 ldi r24, 0x37 ; 55 13e00: 95 e6 ldi r25, 0x65 ; 101 13e02: 0c 94 1f 94 jmp 0x1283e ; 0x1283e E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255 */ case 123: gcode_M123(); 13e06: 0e 94 9d 5f call 0xbf3a ; 0xbf3a 13e0a: 0c c9 rjmp .-3560 ; 0x13024 */ case 200: // M200 D set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters). { uint8_t extruder = active_extruder; if(code_seen('T')) { 13e0c: 84 e5 ldi r24, 0x54 ; 84 13e0e: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13e12: 88 23 and r24, r24 13e14: 69 f0 breq .+26 ; 0x13e30 extruder = code_value_uint8(); 13e16: 0e 94 40 55 call 0xaa80 ; 0xaa80 if(extruder >= EXTRUDERS) { 13e1a: 88 23 and r24, r24 13e1c: 49 f0 breq .+18 ; 0x13e30 SERIAL_ECHO_START; 13e1e: 81 e6 ldi r24, 0x61 ; 97 13e20: 9d e9 ldi r25, 0x9D ; 157 13e22: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 13e26: 88 e0 ldi r24, 0x08 ; 8 13e28: 95 e6 ldi r25, 0x65 ; 101 13e2a: 0e 94 a3 7c call 0xf946 ; 0xf946 13e2e: fa c8 rjmp .-3596 ; 0x13024 SERIAL_ECHO(_n("M200 Invalid extruder "));////MSG_M200_INVALID_EXTRUDER break; } } if(code_seen('D')) { 13e30: 84 e4 ldi r24, 0x44 ; 68 13e32: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13e36: 88 23 and r24, r24 13e38: 09 f4 brne .+2 ; 0x13e3c 13e3a: f4 c8 rjmp .-3608 ; 0x13024 float diameter = code_value(); 13e3c: 0e 94 03 5a call 0xb406 ; 0xb406 if (diameter == 0.0) { 13e40: 20 e0 ldi r18, 0x00 ; 0 13e42: 30 e0 ldi r19, 0x00 ; 0 13e44: a9 01 movw r20, r18 13e46: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 13e4a: 81 11 cpse r24, r1 13e4c: 05 c0 rjmp .+10 ; 0x13e58 // setting any extruder filament size disables volumetric on the assumption that // slicers either generate in extruder values as cubic mm or as as filament feeds // for all extruders cs.volumetric_enabled = false; 13e4e: 10 92 c9 04 sts 0x04C9, r1 ; 0x8004c9 } } else { //reserved for setting filament diameter via UFID or filament measuring device break; } calculate_extruder_multipliers(); 13e52: 0e 94 d2 5e call 0xbda4 ; 0xbda4 13e56: e6 c8 rjmp .-3636 ; 0x13024 // setting any extruder filament size disables volumetric on the assumption that // slicers either generate in extruder values as cubic mm or as as filament feeds // for all extruders cs.volumetric_enabled = false; } else { cs.filament_size[extruder] = code_value(); 13e58: 0e 94 03 5a call 0xb406 ; 0xb406 13e5c: 6b 01 movw r12, r22 13e5e: 7c 01 movw r14, r24 // make sure all extruders have some sane value for the filament size cs.filament_size[0] = (cs.filament_size[0] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : cs.filament_size[0]); 13e60: 20 e0 ldi r18, 0x00 ; 0 13e62: 30 e0 ldi r19, 0x00 ; 0 13e64: a9 01 movw r20, r18 13e66: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 13e6a: 81 11 cpse r24, r1 13e6c: 06 c0 rjmp .+12 ; 0x13e7a 13e6e: c1 2c mov r12, r1 13e70: d1 2c mov r13, r1 13e72: 10 ee ldi r17, 0xE0 ; 224 13e74: e1 2e mov r14, r17 13e76: 1f e3 ldi r17, 0x3F ; 63 13e78: f1 2e mov r15, r17 13e7a: c0 92 ca 04 sts 0x04CA, r12 ; 0x8004ca 13e7e: d0 92 cb 04 sts 0x04CB, r13 ; 0x8004cb 13e82: e0 92 cc 04 sts 0x04CC, r14 ; 0x8004cc 13e86: f0 92 cd 04 sts 0x04CD, r15 ; 0x8004cd cs.filament_size[1] = (cs.filament_size[1] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : cs.filament_size[1]); #if EXTRUDERS > 2 cs.filament_size[2] = (cs.filament_size[2] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : cs.filament_size[2]); #endif #endif cs.volumetric_enabled = true; 13e8a: 81 e0 ldi r24, 0x01 ; 1 13e8c: 80 93 c9 04 sts 0x04C9, r24 ; 0x8004c9 13e90: e0 cf rjmp .-64 ; 0x13e52 13e92: 04 ec ldi r16, 0xC4 ; 196 13e94: 12 e0 ldi r17, 0x02 ; 2 13e96: e2 e3 ldi r30, 0x32 ; 50 13e98: ee 2e mov r14, r30 13e9a: e4 e0 ldi r30, 0x04 ; 4 13e9c: fe 2e mov r15, r30 13e9e: f8 ec ldi r31, 0xC8 ; 200 13ea0: cf 2e mov r12, r31 13ea2: f2 e0 ldi r31, 0x02 ; 2 13ea4: df 2e mov r13, r31 - `E` - Maximum feedrate for extruder drives */ case 203: // M203 max feedrate mm/sec for (uint8_t i = 0; i < NUM_AXIS; i++) { if (code_seen(axis_codes[i])) 13ea6: d8 01 movw r26, r16 13ea8: 8d 91 ld r24, X+ 13eaa: 8d 01 movw r16, r26 13eac: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13eb0: 88 23 and r24, r24 13eb2: 39 f0 breq .+14 ; 0x13ec2 { float val = code_value(); 13eb4: 0e 94 03 5a call 0xb406 ; 0xb406 val_silent = SILENT_MAX_FEEDRATE_XY; } cs.max_feedrate_normal[i] = val; cs.max_feedrate_silent[i] = val_silent; #else //TMC2130 max_feedrate[i] = val; 13eb8: f7 01 movw r30, r14 13eba: 64 8b std Z+20, r22 ; 0x14 13ebc: 75 8b std Z+21, r23 ; 0x15 13ebe: 86 8b std Z+22, r24 ; 0x16 13ec0: 97 8b std Z+23, r25 ; 0x17 13ec2: f4 e0 ldi r31, 0x04 ; 4 13ec4: ef 0e add r14, r31 13ec6: f1 1c adc r15, r1 - `Y` - Maximum feedrate for Y axis - `Z` - Maximum feedrate for Z axis - `E` - Maximum feedrate for extruder drives */ case 203: // M203 max feedrate mm/sec for (uint8_t i = 0; i < NUM_AXIS; i++) 13ec8: c0 16 cp r12, r16 13eca: d1 06 cpc r13, r17 13ecc: 61 f7 brne .-40 ; 0x13ea6 13ece: aa c8 rjmp .-3756 ; 0x13024 - `R` - filmanent only moves - `T` - travel moves (as of now T is ignored) */ case 204: { if(code_seen('S')) { 13ed0: 83 e5 ldi r24, 0x53 ; 83 13ed2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13ed6: 88 23 and r24, r24 13ed8: 19 f1 breq .+70 ; 0x13f20 // Legacy acceleration format. This format is used by the legacy Marlin, MK2 or MK3 firmware, // and it is also generated by Slic3r to control acceleration per extrusion type // (there is a separate acceleration settings in Slicer for perimeter, first layer etc). cs.acceleration = cs.travel_acceleration = code_value(); 13eda: 0e 94 03 5a call 0xb406 ; 0xb406 13ede: 60 93 f2 04 sts 0x04F2, r22 ; 0x8004f2 13ee2: 70 93 f3 04 sts 0x04F3, r23 ; 0x8004f3 13ee6: 80 93 f4 04 sts 0x04F4, r24 ; 0x8004f4 13eea: 90 93 f5 04 sts 0x04F5, r25 ; 0x8004f5 13eee: 60 93 66 04 sts 0x0466, r22 ; 0x800466 13ef2: 70 93 67 04 sts 0x0467, r23 ; 0x800467 13ef6: 80 93 68 04 sts 0x0468, r24 ; 0x800468 13efa: 90 93 69 04 sts 0x0469, r25 ; 0x800469 // Interpret the T value as retract acceleration in the old Marlin format. if(code_seen('T')) 13efe: 84 e5 ldi r24, 0x54 ; 84 13f00: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13f04: 88 23 and r24, r24 13f06: 09 f4 brne .+2 ; 0x13f0a 13f08: 8d c8 rjmp .-3814 ; 0x13024 cs.retract_acceleration = code_value(); 13f0a: 0e 94 03 5a call 0xb406 ; 0xb406 13f0e: 60 93 6a 04 sts 0x046A, r22 ; 0x80046a 13f12: 70 93 6b 04 sts 0x046B, r23 ; 0x80046b 13f16: 80 93 6c 04 sts 0x046C, r24 ; 0x80046c 13f1a: 90 93 6d 04 sts 0x046D, r25 ; 0x80046d 13f1e: 82 c8 rjmp .-3836 ; 0x13024 } else { // New acceleration format, compatible with the upstream Marlin. if(code_seen('P')) 13f20: 80 e5 ldi r24, 0x50 ; 80 13f22: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13f26: 88 23 and r24, r24 13f28: 51 f0 breq .+20 ; 0x13f3e cs.acceleration = code_value(); 13f2a: 0e 94 03 5a call 0xb406 ; 0xb406 13f2e: 60 93 66 04 sts 0x0466, r22 ; 0x800466 13f32: 70 93 67 04 sts 0x0467, r23 ; 0x800467 13f36: 80 93 68 04 sts 0x0468, r24 ; 0x800468 13f3a: 90 93 69 04 sts 0x0469, r25 ; 0x800469 if(code_seen('R')) 13f3e: 82 e5 ldi r24, 0x52 ; 82 13f40: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13f44: 88 23 and r24, r24 13f46: 51 f0 breq .+20 ; 0x13f5c cs.retract_acceleration = code_value(); 13f48: 0e 94 03 5a call 0xb406 ; 0xb406 13f4c: 60 93 6a 04 sts 0x046A, r22 ; 0x80046a 13f50: 70 93 6b 04 sts 0x046B, r23 ; 0x80046b 13f54: 80 93 6c 04 sts 0x046C, r24 ; 0x80046c 13f58: 90 93 6d 04 sts 0x046D, r25 ; 0x80046d if(code_seen('T')) 13f5c: 84 e5 ldi r24, 0x54 ; 84 13f5e: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13f62: 88 23 and r24, r24 13f64: 09 f4 brne .+2 ; 0x13f68 13f66: 5e c8 rjmp .-3908 ; 0x13024 cs.travel_acceleration = code_value(); 13f68: 0e 94 03 5a call 0xb406 ; 0xb406 13f6c: 60 93 f2 04 sts 0x04F2, r22 ; 0x8004f2 13f70: 70 93 f3 04 sts 0x04F3, r23 ; 0x8004f3 13f74: 80 93 f4 04 sts 0x04F4, r24 ; 0x8004f4 13f78: 90 93 f5 04 sts 0x04F5, r25 ; 0x8004f5 13f7c: 53 c8 rjmp .-3930 ; 0x13024 13f7e: 04 ec ldi r16, 0xC4 ; 196 13f80: 12 e0 ldi r17, 0x02 ; 2 13f82: 7a e8 ldi r23, 0x8A ; 138 13f84: e7 2e mov r14, r23 13f86: 74 e0 ldi r23, 0x04 ; 4 13f88: f7 2e mov r15, r23 - `Z` - Z axis offset */ case 206: for(uint8_t i=0; i < 3; i++) { if(code_seen(axis_codes[i])) cs.add_homing[i] = code_value(); 13f8a: d8 01 movw r26, r16 13f8c: 8d 91 ld r24, X+ 13f8e: 8d 01 movw r16, r26 13f90: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13f94: 88 23 and r24, r24 13f96: 39 f0 breq .+14 ; 0x13fa6 13f98: 0e 94 03 5a call 0xb406 ; 0xb406 13f9c: f7 01 movw r30, r14 13f9e: 60 83 st Z, r22 13fa0: 71 83 std Z+1, r23 ; 0x01 13fa2: 82 83 std Z+2, r24 ; 0x02 13fa4: 93 83 std Z+3, r25 ; 0x03 13fa6: f4 e0 ldi r31, 0x04 ; 4 13fa8: ef 0e add r14, r31 13faa: f1 1c adc r15, r1 - `X` - X axis offset - `Y` - Y axis offset - `Z` - Z axis offset */ case 206: for(uint8_t i=0; i < 3; i++) 13fac: 22 e0 ldi r18, 0x02 ; 2 13fae: 07 3c cpi r16, 0xC7 ; 199 13fb0: 12 07 cpc r17, r18 13fb2: 59 f7 brne .-42 ; 0x13f8a 13fb4: 37 c8 rjmp .-3986 ; 0x13024 - `F` - retraction feedrate, in mm/min - `Z` - additional zlift/hop */ case 207: //M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop] { if(code_seen('S')) 13fb6: 83 e5 ldi r24, 0x53 ; 83 13fb8: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13fbc: 88 23 and r24, r24 13fbe: 51 f0 breq .+20 ; 0x13fd4 { cs.retract_length = code_value() ; 13fc0: 0e 94 03 5a call 0xb406 ; 0xb406 13fc4: 60 93 b5 04 sts 0x04B5, r22 ; 0x8004b5 13fc8: 70 93 b6 04 sts 0x04B6, r23 ; 0x8004b6 13fcc: 80 93 b7 04 sts 0x04B7, r24 ; 0x8004b7 13fd0: 90 93 b8 04 sts 0x04B8, r25 ; 0x8004b8 } if(code_seen('F')) 13fd4: 86 e4 ldi r24, 0x46 ; 70 13fd6: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13fda: 88 23 and r24, r24 13fdc: 61 f0 breq .+24 ; 0x13ff6 { cs.retract_feedrate = get_feedrate_mm_s(code_value()); 13fde: 0e 94 03 5a call 0xb406 ; 0xb406 13fe2: 0e 94 cd 5f call 0xbf9a ; 0xbf9a 13fe6: 60 93 b9 04 sts 0x04B9, r22 ; 0x8004b9 13fea: 70 93 ba 04 sts 0x04BA, r23 ; 0x8004ba 13fee: 80 93 bb 04 sts 0x04BB, r24 ; 0x8004bb 13ff2: 90 93 bc 04 sts 0x04BC, r25 ; 0x8004bc } if(code_seen('Z')) 13ff6: 8a e5 ldi r24, 0x5A ; 90 13ff8: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13ffc: 88 23 and r24, r24 13ffe: 09 f4 brne .+2 ; 0x14002 14000: 11 c8 rjmp .-4062 ; 0x13024 { cs.retract_zlift = code_value() ; 14002: 0e 94 03 5a call 0xb406 ; 0xb406 14006: 60 93 bd 04 sts 0x04BD, r22 ; 0x8004bd 1400a: 70 93 be 04 sts 0x04BE, r23 ; 0x8004be 1400e: 80 93 bf 04 sts 0x04BF, r24 ; 0x8004bf 14012: 90 93 c0 04 sts 0x04C0, r25 ; 0x8004c0 14016: 0c 94 12 98 jmp 0x13024 ; 0x13024 #### Parameters - `S` - 1=true or 0=false */ case 209: // M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction. { if(code_seen('S')) 1401a: 83 e5 ldi r24, 0x53 ; 83 1401c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 14020: 88 23 and r24, r24 14022: 11 f4 brne .+4 ; 0x14028 14024: 0c 94 12 98 jmp 0x13024 ; 0x13024 { switch(code_value_uint8()) 14028: 0e 94 40 55 call 0xaa80 ; 0xaa80 1402c: 88 23 and r24, r24 1402e: c1 f0 breq .+48 ; 0x14060 14030: 81 30 cpi r24, 0x01 ; 1 14032: e1 f0 breq .+56 ; 0x1406c #if EXTRUDERS > 2 retracted[2]=false; #endif }break; default: SERIAL_ECHO_START; 14034: 81 e6 ldi r24, 0x61 ; 97 14036: 9d e9 ldi r25, 0x9D ; 157 14038: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 1403c: 85 ef ldi r24, 0xF5 ; 245 1403e: 94 e6 ldi r25, 0x64 ; 100 14040: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 14044: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 14048: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 1404c: 8f 51 subi r24, 0x1F ; 31 1404e: 90 4f sbci r25, 0xF0 ; 240 14050: 0e 94 a3 7c call 0xf946 ; 0xf946 SERIAL_ECHOLNPGM("\"(1)"); 14054: 8b e4 ldi r24, 0x4B ; 75 14056: 9f e7 ldi r25, 0x7F ; 127 14058: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 1405c: 0c 94 12 98 jmp 0x13024 ; 0x13024 { switch(code_value_uint8()) { case 0: { cs.autoretract_enabled=false; 14060: 10 92 b4 04 sts 0x04B4, r1 ; 0x8004b4 retracted[0]=false; 14064: 10 92 03 05 sts 0x0503, r1 ; 0x800503 14068: 0c 94 12 98 jmp 0x13024 ; 0x13024 retracted[2]=false; #endif }break; case 1: { cs.autoretract_enabled=true; 1406c: 80 93 b4 04 sts 0x04B4, r24 ; 0x8004b4 retracted[0]=false; 14070: 10 92 03 05 sts 0x0503, r1 ; 0x800503 14074: 0c 94 12 98 jmp 0x13024 ; 0x13024 greater than or less than the minimum and maximum segment length. Set to 0 to disable. */ case 214: { // Extract all possible parameters if they appear float p = code_seen('P') ? code_value() : cs.mm_per_arc_segment; 14078: 40 90 f6 04 lds r4, 0x04F6 ; 0x8004f6 1407c: 50 90 f7 04 lds r5, 0x04F7 ; 0x8004f7 14080: 60 90 f8 04 lds r6, 0x04F8 ; 0x8004f8 14084: 70 90 f9 04 lds r7, 0x04F9 ; 0x8004f9 14088: 0c 94 42 95 jmp 0x12a84 ; 0x12a84 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 1408c: 80 90 fa 04 lds r8, 0x04FA ; 0x8004fa 14090: 90 90 fb 04 lds r9, 0x04FB ; 0x8004fb 14094: a0 90 fc 04 lds r10, 0x04FC ; 0x8004fc 14098: b0 90 fd 04 lds r11, 0x04FD ; 0x8004fd 1409c: 0c 94 4d 95 jmp 0x12a9a ; 0x12a9a - `R` - Restore previous speed factor */ case 220: { bool codesWereSeen = false; if (code_seen('B')) //backup current speed factor 140a0: 82 e4 ldi r24, 0x42 ; 66 140a2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 140a6: 18 2f mov r17, r24 140a8: 88 23 and r24, r24 140aa: 41 f0 breq .+16 ; 0x140bc { saved_feedmultiply_mm = feedmultiply; 140ac: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 140b0: 90 91 8f 02 lds r25, 0x028F ; 0x80028f 140b4: 90 93 31 02 sts 0x0231, r25 ; 0x800231 140b8: 80 93 30 02 sts 0x0230, r24 ; 0x800230 codesWereSeen = true; } if (code_seen('S')) 140bc: 83 e5 ldi r24, 0x53 ; 83 140be: 0e 94 2b 55 call 0xaa56 ; 0xaa56 140c2: 08 2f mov r16, r24 140c4: 88 23 and r24, r24 140c6: 39 f0 breq .+14 ; 0x140d6 { feedmultiply = code_value_short(); 140c8: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 140cc: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 140d0: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e codesWereSeen = true; 140d4: 10 2f mov r17, r16 } if (code_seen('R')) //restore previous feedmultiply 140d6: 82 e5 ldi r24, 0x52 ; 82 140d8: 0e 94 2b 55 call 0xaa56 ; 0xaa56 140dc: 88 23 and r24, r24 140de: 51 f0 breq .+20 ; 0x140f4 { feedmultiply = saved_feedmultiply_mm; 140e0: 80 91 30 02 lds r24, 0x0230 ; 0x800230 140e4: 90 91 31 02 lds r25, 0x0231 ; 0x800231 140e8: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 140ec: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e 140f0: 0c 94 12 98 jmp 0x13024 ; 0x13024 codesWereSeen = true; } if (!codesWereSeen) 140f4: 11 11 cpse r17, r1 140f6: 0c 94 12 98 jmp 0x13024 ; 0x13024 { printf_P(PSTR("%i%%\n"), feedmultiply); 140fa: 80 91 8f 02 lds r24, 0x028F ; 0x80028f 140fe: 8f 93 push r24 14100: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 14104: 8f 93 push r24 14106: 85 e4 ldi r24, 0x45 ; 69 14108: 9f e7 ldi r25, 0x7F ; 127 1410a: 9f 93 push r25 1410c: 8f 93 push r24 1410e: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 14112: 0f 90 pop r0 14114: 0f 90 pop r0 14116: 0f 90 pop r0 14118: 0f 90 pop r0 1411a: 0c 94 12 98 jmp 0x13024 ; 0x13024 #### Parameters - `S` - Extrude factor override percentage (0..100 or higher), default 100% */ case 221: { if (code_seen('S')) 1411e: 83 e5 ldi r24, 0x53 ; 83 14120: 0e 94 2b 55 call 0xaa56 ; 0xaa56 14124: 88 23 and r24, r24 14126: 51 f0 breq .+20 ; 0x1413c { extrudemultiply = code_value_short(); 14128: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 1412c: 90 93 5a 02 sts 0x025A, r25 ; 0x80025a 14130: 80 93 59 02 sts 0x0259, r24 ; 0x800259 calculate_extruder_multipliers(); 14134: 0e 94 d2 5e call 0xbda4 ; 0xbda4 14138: 0c 94 12 98 jmp 0x13024 ; 0x13024 } else { printf_P(PSTR("%i%%\n"), extrudemultiply); 1413c: 80 91 5a 02 lds r24, 0x025A ; 0x80025a 14140: 8f 93 push r24 14142: 80 91 59 02 lds r24, 0x0259 ; 0x800259 14146: 8f 93 push r24 14148: 8f e3 ldi r24, 0x3F ; 63 1414a: 9f e7 ldi r25, 0x7F ; 127 1414c: 9f 93 push r25 1414e: 8f 93 push r24 14150: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 14154: 0f 90 pop r0 14156: 0f 90 pop r0 14158: 0f 90 pop r0 1415a: 0f 90 pop r0 1415c: 0c 94 12 98 jmp 0x13024 ; 0x13024 - `P` - pin number - `S` - pin state */ case 226: { if(code_seen('P')){ 14160: 80 e5 ldi r24, 0x50 ; 80 14162: 0e 94 2b 55 call 0xaa56 ; 0xaa56 14166: 88 23 and r24, r24 14168: 11 f4 brne .+4 ; 0x1416e 1416a: 0c 94 12 98 jmp 0x13024 ; 0x13024 int pin_number = code_value_short(); // pin number 1416e: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 14172: 7c 01 movw r14, r24 int pin_state = -1; // required pin state - default is inverted if(code_seen('S')) pin_state = code_value_short(); // required pin state 14174: 83 e5 ldi r24, 0x53 ; 83 14176: 0e 94 2b 55 call 0xaa56 ; 0xaa56 */ case 226: { if(code_seen('P')){ int pin_number = code_value_short(); // pin number int pin_state = -1; // required pin state - default is inverted 1417a: 0f ef ldi r16, 0xFF ; 255 1417c: 1f ef ldi r17, 0xFF ; 255 if(code_seen('S')) pin_state = code_value_short(); // required pin state 1417e: 88 23 and r24, r24 14180: 19 f0 breq .+6 ; 0x14188 14182: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 14186: 8c 01 movw r16, r24 if(pin_state >= -1 && pin_state <= 1){ 14188: c8 01 movw r24, r16 1418a: 01 96 adiw r24, 0x01 ; 1 1418c: 03 97 sbiw r24, 0x03 ; 3 1418e: 10 f0 brcs .+4 ; 0x14194 14190: 0c 94 12 98 jmp 0x13024 ; 0x13024 14194: e3 e3 ldi r30, 0x33 ; 51 14196: f0 e8 ldi r31, 0x80 ; 128 14198: 2f e4 ldi r18, 0x4F ; 79 1419a: 30 e8 ldi r19, 0x80 ; 128 for(int8_t i = 0; i < (int8_t)(sizeof(sensitive_pins)/sizeof(sensitive_pins[0])); i++) { if (((int8_t)pgm_read_byte(&sensitive_pins[i]) == pin_number)) 1419c: 84 91 lpm r24, Z 1419e: 08 2e mov r0, r24 141a0: 00 0c add r0, r0 141a2: 99 0b sbc r25, r25 141a4: e8 16 cp r14, r24 141a6: f9 06 cpc r15, r25 141a8: 11 f4 brne .+4 ; 0x141ae 141aa: 0c 94 12 98 jmp 0x13024 ; 0x13024 141ae: 31 96 adiw r30, 0x01 ; 1 if(code_seen('S')) pin_state = code_value_short(); // required pin state if(pin_state >= -1 && pin_state <= 1){ for(int8_t i = 0; i < (int8_t)(sizeof(sensitive_pins)/sizeof(sensitive_pins[0])); i++) 141b0: 2e 17 cp r18, r30 141b2: 3f 07 cpc r19, r31 141b4: 99 f7 brne .-26 ; 0x1419c pin_number = -1; break; } } if (pin_number > -1) 141b6: f7 fe sbrs r15, 7 141b8: 02 c0 rjmp .+4 ; 0x141be 141ba: 0c 94 12 98 jmp 0x13024 ; 0x13024 { int target = LOW; st_synchronize(); 141be: 0f 94 42 22 call 0x24484 ; 0x24484 pinMode(pin_number, INPUT); 141c2: de 2c mov r13, r14 141c4: 60 e0 ldi r22, 0x00 ; 0 141c6: 8e 2d mov r24, r14 141c8: 0e 94 40 c0 call 0x18080 ; 0x18080 switch(pin_state){ 141cc: 0f 3f cpi r16, 0xFF ; 255 141ce: 10 07 cpc r17, r16 141d0: b1 f0 breq .+44 ; 0x141fe 141d2: 01 30 cpi r16, 0x01 ; 1 141d4: 11 05 cpc r17, r1 141d6: 11 f0 breq .+4 ; 0x141dc } } if (pin_number > -1) { int target = LOW; 141d8: 10 e0 ldi r17, 0x00 ; 0 141da: 00 e0 ldi r16, 0x00 ; 0 case -1: target = !digitalRead(pin_number); break; } while(digitalRead(pin_number) != target){ 141dc: 8d 2d mov r24, r13 141de: 0e 94 e9 bf call 0x17fd2 ; 0x17fd2 141e2: 80 17 cp r24, r16 141e4: 91 07 cpc r25, r17 141e6: 11 f4 brne .+4 ; 0x141ec 141e8: 0c 94 12 98 jmp 0x13024 ; 0x13024 manage_heater(); 141ec: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(); 141f0: 80 e0 ldi r24, 0x00 ; 0 141f2: 0e 94 01 7a call 0xf402 ; 0xf402 lcd_update(0); 141f6: 80 e0 ldi r24, 0x00 ; 0 141f8: 0e 94 42 69 call 0xd284 ; 0xd284 141fc: ef cf rjmp .-34 ; 0x141dc case 0: target = LOW; break; case -1: target = !digitalRead(pin_number); 141fe: 8e 2d mov r24, r14 14200: 0e 94 e9 bf call 0x17fd2 ; 0x17fd2 14204: 31 e0 ldi r19, 0x01 ; 1 14206: 20 e0 ldi r18, 0x00 ; 0 14208: 89 2b or r24, r25 1420a: 09 f0 breq .+2 ; 0x1420e 1420c: 30 e0 ldi r19, 0x00 ; 0 1420e: 03 2f mov r16, r19 14210: 12 2f mov r17, r18 14212: e4 cf rjmp .-56 ; 0x141dc case 300: // M300 { uint16_t beepP = code_seen('P') ? min(code_value(), 3500) : 1000; uint16_t beepS; if (!code_seen('S')) beepS = 0; 14214: 70 e0 ldi r23, 0x00 ; 0 14216: 60 e0 ldi r22, 0x00 ; 0 // handle S0 as a pause _delay(beepP); break; } } Sound_MakeCustom(beepP, beepS, false); 14218: 40 e0 ldi r20, 0x00 ; 0 1421a: c8 01 movw r24, r16 1421c: 0f 94 c5 31 call 0x2638a ; 0x2638a 14220: 0c 94 12 98 jmp 0x13024 ; 0x13024 - `I` - integral (Ki) - `D` - derivative (Kd) */ case 301: { if(code_seen('P')) cs.Kp = code_value(); 14224: 80 e5 ldi r24, 0x50 ; 80 14226: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1422a: 88 23 and r24, r24 1422c: 51 f0 breq .+20 ; 0x14242 1422e: 0e 94 03 5a call 0xb406 ; 0xb406 14232: 60 93 9a 04 sts 0x049A, r22 ; 0x80049a 14236: 70 93 9b 04 sts 0x049B, r23 ; 0x80049b 1423a: 80 93 9c 04 sts 0x049C, r24 ; 0x80049c 1423e: 90 93 9d 04 sts 0x049D, r25 ; 0x80049d if(code_seen('I')) cs.Ki = scalePID_i(code_value()); 14242: 89 e4 ldi r24, 0x49 ; 73 14244: 0e 94 2b 55 call 0xaa56 ; 0xaa56 14248: 88 23 and r24, r24 1424a: 81 f0 breq .+32 ; 0x1426c 1424c: 0e 94 03 5a call 0xb406 ; 0xb406 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 14250: 2c ea ldi r18, 0xAC ; 172 14252: 35 ec ldi r19, 0xC5 ; 197 14254: 47 e2 ldi r20, 0x27 ; 39 14256: 5e e3 ldi r21, 0x3E ; 62 14258: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1425c: 60 93 9e 04 sts 0x049E, r22 ; 0x80049e 14260: 70 93 9f 04 sts 0x049F, r23 ; 0x80049f 14264: 80 93 a0 04 sts 0x04A0, r24 ; 0x8004a0 14268: 90 93 a1 04 sts 0x04A1, r25 ; 0x8004a1 if(code_seen('D')) cs.Kd = scalePID_d(code_value()); 1426c: 84 e4 ldi r24, 0x44 ; 68 1426e: 0e 94 2b 55 call 0xaa56 ; 0xaa56 14272: 88 23 and r24, r24 14274: 81 f0 breq .+32 ; 0x14296 14276: 0e 94 03 5a call 0xb406 ; 0xb406 } float unscalePID_i(float i) { return i/PID_dT; 1427a: 2c ea ldi r18, 0xAC ; 172 1427c: 35 ec ldi r19, 0xC5 ; 197 1427e: 47 e2 ldi r20, 0x27 ; 39 14280: 5e e3 ldi r21, 0x3E ; 62 14282: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 14286: 60 93 a2 04 sts 0x04A2, r22 ; 0x8004a2 1428a: 70 93 a3 04 sts 0x04A3, r23 ; 0x8004a3 1428e: 80 93 a4 04 sts 0x04A4, r24 ; 0x8004a4 14292: 90 93 a5 04 sts 0x04A5, r25 ; 0x8004a5 updatePID(); 14296: 0f 94 96 18 call 0x2312c ; 0x2312c SERIAL_PROTOCOLRPGM(MSG_OK); 1429a: 81 e3 ldi r24, 0x31 ; 49 1429c: 99 e6 ldi r25, 0x69 ; 105 1429e: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_PROTOCOLPGM(" p:"); 142a2: 8b e3 ldi r24, 0x3B ; 59 142a4: 9f e7 ldi r25, 0x7F ; 127 142a6: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 142aa: 60 91 9a 04 lds r22, 0x049A ; 0x80049a 142ae: 70 91 9b 04 lds r23, 0x049B ; 0x80049b 142b2: 80 91 9c 04 lds r24, 0x049C ; 0x80049c 142b6: 90 91 9d 04 lds r25, 0x049D ; 0x80049d 142ba: 42 e0 ldi r20, 0x02 ; 2 142bc: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOL(cs.Kp); SERIAL_PROTOCOLPGM(" i:"); 142c0: 87 e3 ldi r24, 0x37 ; 55 142c2: 9f e7 ldi r25, 0x7F ; 127 142c4: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 142c8: 2c ea ldi r18, 0xAC ; 172 142ca: 35 ec ldi r19, 0xC5 ; 197 142cc: 47 e2 ldi r20, 0x27 ; 39 142ce: 5e e3 ldi r21, 0x3E ; 62 142d0: 60 91 9e 04 lds r22, 0x049E ; 0x80049e 142d4: 70 91 9f 04 lds r23, 0x049F ; 0x80049f 142d8: 80 91 a0 04 lds r24, 0x04A0 ; 0x8004a0 142dc: 90 91 a1 04 lds r25, 0x04A1 ; 0x8004a1 142e0: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 142e4: 42 e0 ldi r20, 0x02 ; 2 142e6: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOL(unscalePID_i(cs.Ki)); SERIAL_PROTOCOLPGM(" d:"); 142ea: 83 e3 ldi r24, 0x33 ; 51 142ec: 9f e7 ldi r25, 0x7F ; 127 142ee: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 142f2: 2c ea ldi r18, 0xAC ; 172 142f4: 35 ec ldi r19, 0xC5 ; 197 142f6: 47 e2 ldi r20, 0x27 ; 39 142f8: 5e e3 ldi r21, 0x3E ; 62 142fa: 60 91 a2 04 lds r22, 0x04A2 ; 0x8004a2 142fe: 70 91 a3 04 lds r23, 0x04A3 ; 0x8004a3 14302: 80 91 a4 04 lds r24, 0x04A4 ; 0x8004a4 14306: 90 91 a5 04 lds r25, 0x04A5 ; 0x8004a5 1430a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.Kd)); 1430e: 0f 94 8d 41 call 0x2831a ; 0x2831a 14312: 0c 94 12 98 jmp 0x13024 ; 0x13024 - `I` - integral (Ki) - `D` - derivative (Kd) */ case 304: { if(code_seen('P')) cs.bedKp = code_value(); 14316: 80 e5 ldi r24, 0x50 ; 80 14318: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1431c: 88 23 and r24, r24 1431e: 51 f0 breq .+20 ; 0x14334 14320: 0e 94 03 5a call 0xb406 ; 0xb406 14324: 60 93 a6 04 sts 0x04A6, r22 ; 0x8004a6 14328: 70 93 a7 04 sts 0x04A7, r23 ; 0x8004a7 1432c: 80 93 a8 04 sts 0x04A8, r24 ; 0x8004a8 14330: 90 93 a9 04 sts 0x04A9, r25 ; 0x8004a9 if(code_seen('I')) cs.bedKi = scalePID_i(code_value()); 14334: 89 e4 ldi r24, 0x49 ; 73 14336: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1433a: 88 23 and r24, r24 1433c: 81 f0 breq .+32 ; 0x1435e 1433e: 0e 94 03 5a call 0xb406 ; 0xb406 14342: 2c ea ldi r18, 0xAC ; 172 14344: 35 ec ldi r19, 0xC5 ; 197 14346: 47 e2 ldi r20, 0x27 ; 39 14348: 5e e3 ldi r21, 0x3E ; 62 1434a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1434e: 60 93 aa 04 sts 0x04AA, r22 ; 0x8004aa 14352: 70 93 ab 04 sts 0x04AB, r23 ; 0x8004ab 14356: 80 93 ac 04 sts 0x04AC, r24 ; 0x8004ac 1435a: 90 93 ad 04 sts 0x04AD, r25 ; 0x8004ad if(code_seen('D')) cs.bedKd = scalePID_d(code_value()); 1435e: 84 e4 ldi r24, 0x44 ; 68 14360: 0e 94 2b 55 call 0xaa56 ; 0xaa56 14364: 88 23 and r24, r24 14366: 81 f0 breq .+32 ; 0x14388 14368: 0e 94 03 5a call 0xb406 ; 0xb406 } float unscalePID_i(float i) { return i/PID_dT; 1436c: 2c ea ldi r18, 0xAC ; 172 1436e: 35 ec ldi r19, 0xC5 ; 197 14370: 47 e2 ldi r20, 0x27 ; 39 14372: 5e e3 ldi r21, 0x3E ; 62 14374: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 14378: 60 93 ae 04 sts 0x04AE, r22 ; 0x8004ae 1437c: 70 93 af 04 sts 0x04AF, r23 ; 0x8004af 14380: 80 93 b0 04 sts 0x04B0, r24 ; 0x8004b0 14384: 90 93 b1 04 sts 0x04B1, r25 ; 0x8004b1 updatePID(); 14388: 0f 94 96 18 call 0x2312c ; 0x2312c SERIAL_PROTOCOLRPGM(MSG_OK); 1438c: 81 e3 ldi r24, 0x31 ; 49 1438e: 99 e6 ldi r25, 0x69 ; 105 14390: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_PROTOCOLPGM(" p:"); 14394: 8f e2 ldi r24, 0x2F ; 47 14396: 9f e7 ldi r25, 0x7F ; 127 14398: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 1439c: 60 91 a6 04 lds r22, 0x04A6 ; 0x8004a6 143a0: 70 91 a7 04 lds r23, 0x04A7 ; 0x8004a7 143a4: 80 91 a8 04 lds r24, 0x04A8 ; 0x8004a8 143a8: 90 91 a9 04 lds r25, 0x04A9 ; 0x8004a9 143ac: 42 e0 ldi r20, 0x02 ; 2 143ae: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOL(cs.bedKp); SERIAL_PROTOCOLPGM(" i:"); 143b2: 8b e2 ldi r24, 0x2B ; 43 143b4: 9f e7 ldi r25, 0x7F ; 127 143b6: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 143ba: 2c ea ldi r18, 0xAC ; 172 143bc: 35 ec ldi r19, 0xC5 ; 197 143be: 47 e2 ldi r20, 0x27 ; 39 143c0: 5e e3 ldi r21, 0x3E ; 62 143c2: 60 91 aa 04 lds r22, 0x04AA ; 0x8004aa 143c6: 70 91 ab 04 lds r23, 0x04AB ; 0x8004ab 143ca: 80 91 ac 04 lds r24, 0x04AC ; 0x8004ac 143ce: 90 91 ad 04 lds r25, 0x04AD ; 0x8004ad 143d2: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 143d6: 42 e0 ldi r20, 0x02 ; 2 143d8: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOL(unscalePID_i(cs.bedKi)); SERIAL_PROTOCOLPGM(" d:"); 143dc: 87 e2 ldi r24, 0x27 ; 39 143de: 9f e7 ldi r25, 0x7F ; 127 143e0: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 143e4: 2c ea ldi r18, 0xAC ; 172 143e6: 35 ec ldi r19, 0xC5 ; 197 143e8: 47 e2 ldi r20, 0x27 ; 39 143ea: 5e e3 ldi r21, 0x3E ; 62 143ec: 60 91 ae 04 lds r22, 0x04AE ; 0x8004ae 143f0: 70 91 af 04 lds r23, 0x04AF ; 0x8004af 143f4: 80 91 b0 04 lds r24, 0x04B0 ; 0x8004b0 143f8: 90 91 b1 04 lds r25, 0x04B1 ; 0x8004b1 143fc: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.bedKd)); 14400: 0f 94 8d 41 call 0x2831a ; 0x2831a 14404: 0c 94 12 98 jmp 0x13024 ; 0x13024 - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; if (code_seen('S')) temp=code_value_short(); 14408: 83 e5 ldi r24, 0x53 ; 83 1440a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1440e: 88 23 and r24, r24 14410: 41 f0 breq .+16 ; 0x14422 14412: 0e 94 4d 55 call 0xaa9a ; 0xaa9a } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 14416: 90 93 58 02 sts 0x0258, r25 ; 0x800258 1441a: 80 93 57 02 sts 0x0257, r24 ; 0x800257 1441e: 0c 94 12 98 jmp 0x13024 ; 0x13024 #### Parameters - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; 14422: 90 e0 ldi r25, 0x00 ; 0 14424: 80 e0 ldi r24, 0x00 ; 0 14426: f7 cf rjmp .-18 ; 0x14416 */ case 303: { float temp = 150.0; int e = 0; int c = 5; 14428: 85 e0 ldi r24, 0x05 ; 5 1442a: 90 e0 ldi r25, 0x00 ; 0 1442c: 0c 94 24 96 jmp 0x12c48 ; 0x12c48 M400 */ case 400: { st_synchronize(); 14430: 0f 94 42 22 call 0x24484 ; 0x24484 14434: 0c 94 12 98 jmp 0x13024 ; 0x13024 */ case 405: // M405 Enable Filament Sensor { fsensor.setEnabled(1); 14438: 81 e0 ldi r24, 0x01 ; 1 1443a: 0e 94 20 6e call 0xdc40 ; 0xdc40 1443e: 0c 94 12 98 jmp 0x13024 ; 0x13024 */ case 406: // M406 Disable Filament Sensor { fsensor.setEnabled(0); 14442: 80 e0 ldi r24, 0x00 ; 0 14444: 0e 94 20 6e call 0xdc40 ; 0xdc40 14448: 0c 94 12 98 jmp 0x13024 ; 0x13024 M420 */ case 420: // M420 Mesh bed leveling status { gcode_G81_M420(); 1444c: 0e 94 37 73 call 0xe66e ; 0xe66e 14450: 0c 94 12 98 jmp 0x13024 ; 0x13024 M500 */ case 500: { Config_StoreSettings(); 14454: 0e 94 5c 75 call 0xeab8 ; 0xeab8 14458: 0c 94 12 98 jmp 0x13024 ; 0x13024 M502 */ case 502: { Config_ResetDefault(); 1445c: 0e 94 cb 74 call 0xe996 ; 0xe996 14460: 0c 94 12 98 jmp 0x13024 ; 0x13024 echomagic, echomagic, cs.max_acceleration_mm_per_s2_silent[X_AXIS], cs.max_acceleration_mm_per_s2_silent[Y_AXIS], cs.max_acceleration_mm_per_s2_silent[Z_AXIS], cs.max_acceleration_mm_per_s2_silent[E_AXIS], echomagic, echomagic, cs.acceleration, cs.retract_acceleration, cs.travel_acceleration, echomagic, echomagic, cs.minimumfeedrate, cs.mintravelfeedrate, cs.min_segment_time_us, cs.max_jerk[X_AXIS], cs.max_jerk[Y_AXIS], cs.max_jerk[Z_AXIS], cs.max_jerk[E_AXIS], echomagic, echomagic, cs.add_homing[X_AXIS], cs.add_homing[Y_AXIS], cs.add_homing[Z_AXIS] #else //TMC2130 printf_P(PSTR( 14464: 80 91 95 04 lds r24, 0x0495 ; 0x800495 14468: 8f 93 push r24 1446a: 80 91 94 04 lds r24, 0x0494 ; 0x800494 1446e: 8f 93 push r24 14470: 80 91 93 04 lds r24, 0x0493 ; 0x800493 14474: 8f 93 push r24 14476: 80 91 92 04 lds r24, 0x0492 ; 0x800492 1447a: 8f 93 push r24 1447c: 80 91 91 04 lds r24, 0x0491 ; 0x800491 14480: 8f 93 push r24 14482: 80 91 90 04 lds r24, 0x0490 ; 0x800490 14486: 8f 93 push r24 14488: 80 91 8f 04 lds r24, 0x048F ; 0x80048f 1448c: 8f 93 push r24 1448e: 80 91 8e 04 lds r24, 0x048E ; 0x80048e 14492: 8f 93 push r24 14494: 80 91 8d 04 lds r24, 0x048D ; 0x80048d 14498: 8f 93 push r24 1449a: 80 91 8c 04 lds r24, 0x048C ; 0x80048c 1449e: 8f 93 push r24 144a0: 80 91 8b 04 lds r24, 0x048B ; 0x80048b 144a4: 8f 93 push r24 144a6: 80 91 8a 04 lds r24, 0x048A ; 0x80048a 144aa: 8f 93 push r24 144ac: 01 e6 ldi r16, 0x61 ; 97 144ae: 1d e9 ldi r17, 0x9D ; 157 144b0: 1f 93 push r17 144b2: 0f 93 push r16 144b4: 1f 93 push r17 144b6: 0f 93 push r16 144b8: 80 91 89 04 lds r24, 0x0489 ; 0x800489 144bc: 8f 93 push r24 144be: 80 91 88 04 lds r24, 0x0488 ; 0x800488 144c2: 8f 93 push r24 144c4: 80 91 87 04 lds r24, 0x0487 ; 0x800487 144c8: 8f 93 push r24 144ca: 80 91 86 04 lds r24, 0x0486 ; 0x800486 144ce: 8f 93 push r24 144d0: 80 91 85 04 lds r24, 0x0485 ; 0x800485 144d4: 8f 93 push r24 144d6: 80 91 84 04 lds r24, 0x0484 ; 0x800484 144da: 8f 93 push r24 144dc: 80 91 83 04 lds r24, 0x0483 ; 0x800483 144e0: 8f 93 push r24 144e2: 80 91 82 04 lds r24, 0x0482 ; 0x800482 144e6: 8f 93 push r24 144e8: 80 91 81 04 lds r24, 0x0481 ; 0x800481 144ec: 8f 93 push r24 144ee: 80 91 80 04 lds r24, 0x0480 ; 0x800480 144f2: 8f 93 push r24 144f4: 80 91 7f 04 lds r24, 0x047F ; 0x80047f 144f8: 8f 93 push r24 144fa: 80 91 7e 04 lds r24, 0x047E ; 0x80047e 144fe: 8f 93 push r24 14500: 80 91 7d 04 lds r24, 0x047D ; 0x80047d 14504: 8f 93 push r24 14506: 80 91 7c 04 lds r24, 0x047C ; 0x80047c 1450a: 8f 93 push r24 1450c: 80 91 7b 04 lds r24, 0x047B ; 0x80047b 14510: 8f 93 push r24 14512: 80 91 7a 04 lds r24, 0x047A ; 0x80047a 14516: 8f 93 push r24 14518: 80 91 79 04 lds r24, 0x0479 ; 0x800479 1451c: 8f 93 push r24 1451e: 80 91 78 04 lds r24, 0x0478 ; 0x800478 14522: 8f 93 push r24 14524: 80 91 77 04 lds r24, 0x0477 ; 0x800477 14528: 8f 93 push r24 1452a: 80 91 76 04 lds r24, 0x0476 ; 0x800476 1452e: 8f 93 push r24 14530: 80 91 75 04 lds r24, 0x0475 ; 0x800475 14534: 8f 93 push r24 14536: 80 91 74 04 lds r24, 0x0474 ; 0x800474 1453a: 8f 93 push r24 1453c: 80 91 73 04 lds r24, 0x0473 ; 0x800473 14540: 8f 93 push r24 14542: 80 91 72 04 lds r24, 0x0472 ; 0x800472 14546: 8f 93 push r24 14548: 80 91 71 04 lds r24, 0x0471 ; 0x800471 1454c: 8f 93 push r24 1454e: 80 91 70 04 lds r24, 0x0470 ; 0x800470 14552: 8f 93 push r24 14554: 80 91 6f 04 lds r24, 0x046F ; 0x80046f 14558: 8f 93 push r24 1455a: 80 91 6e 04 lds r24, 0x046E ; 0x80046e 1455e: 8f 93 push r24 14560: 1f 93 push r17 14562: 0f 93 push r16 14564: 1f 93 push r17 14566: 0f 93 push r16 14568: 80 91 f5 04 lds r24, 0x04F5 ; 0x8004f5 1456c: 8f 93 push r24 1456e: 80 91 f4 04 lds r24, 0x04F4 ; 0x8004f4 14572: 8f 93 push r24 14574: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 14578: 8f 93 push r24 1457a: 80 91 f2 04 lds r24, 0x04F2 ; 0x8004f2 1457e: 8f 93 push r24 14580: 80 91 6d 04 lds r24, 0x046D ; 0x80046d 14584: 8f 93 push r24 14586: 80 91 6c 04 lds r24, 0x046C ; 0x80046c 1458a: 8f 93 push r24 1458c: 80 91 6b 04 lds r24, 0x046B ; 0x80046b 14590: 8f 93 push r24 14592: 80 91 6a 04 lds r24, 0x046A ; 0x80046a 14596: 8f 93 push r24 14598: 80 91 69 04 lds r24, 0x0469 ; 0x800469 1459c: 8f 93 push r24 1459e: 80 91 68 04 lds r24, 0x0468 ; 0x800468 145a2: 8f 93 push r24 145a4: 80 91 67 04 lds r24, 0x0467 ; 0x800467 145a8: 8f 93 push r24 145aa: 80 91 66 04 lds r24, 0x0466 ; 0x800466 145ae: 8f 93 push r24 145b0: 1f 93 push r17 145b2: 0f 93 push r16 145b4: 1f 93 push r17 145b6: 0f 93 push r16 145b8: 80 91 65 04 lds r24, 0x0465 ; 0x800465 145bc: 8f 93 push r24 145be: 80 91 64 04 lds r24, 0x0464 ; 0x800464 145c2: 8f 93 push r24 145c4: 80 91 63 04 lds r24, 0x0463 ; 0x800463 145c8: 8f 93 push r24 145ca: 80 91 62 04 lds r24, 0x0462 ; 0x800462 145ce: 8f 93 push r24 145d0: 80 91 61 04 lds r24, 0x0461 ; 0x800461 145d4: 8f 93 push r24 145d6: 80 91 60 04 lds r24, 0x0460 ; 0x800460 145da: 8f 93 push r24 145dc: 80 91 5f 04 lds r24, 0x045F ; 0x80045f 145e0: 8f 93 push r24 145e2: 80 91 5e 04 lds r24, 0x045E ; 0x80045e 145e6: 8f 93 push r24 145e8: 80 91 5d 04 lds r24, 0x045D ; 0x80045d 145ec: 8f 93 push r24 145ee: 80 91 5c 04 lds r24, 0x045C ; 0x80045c 145f2: 8f 93 push r24 145f4: 80 91 5b 04 lds r24, 0x045B ; 0x80045b 145f8: 8f 93 push r24 145fa: 80 91 5a 04 lds r24, 0x045A ; 0x80045a 145fe: 8f 93 push r24 14600: 80 91 59 04 lds r24, 0x0459 ; 0x800459 14604: 8f 93 push r24 14606: 80 91 58 04 lds r24, 0x0458 ; 0x800458 1460a: 8f 93 push r24 1460c: 80 91 57 04 lds r24, 0x0457 ; 0x800457 14610: 8f 93 push r24 14612: 80 91 56 04 lds r24, 0x0456 ; 0x800456 14616: 8f 93 push r24 14618: 1f 93 push r17 1461a: 0f 93 push r16 1461c: 1f 93 push r17 1461e: 0f 93 push r16 14620: 80 91 55 04 lds r24, 0x0455 ; 0x800455 14624: 8f 93 push r24 14626: 80 91 54 04 lds r24, 0x0454 ; 0x800454 1462a: 8f 93 push r24 1462c: 80 91 53 04 lds r24, 0x0453 ; 0x800453 14630: 8f 93 push r24 14632: 80 91 52 04 lds r24, 0x0452 ; 0x800452 14636: 8f 93 push r24 14638: 80 91 51 04 lds r24, 0x0451 ; 0x800451 1463c: 8f 93 push r24 1463e: 80 91 50 04 lds r24, 0x0450 ; 0x800450 14642: 8f 93 push r24 14644: 80 91 4f 04 lds r24, 0x044F ; 0x80044f 14648: 8f 93 push r24 1464a: 80 91 4e 04 lds r24, 0x044E ; 0x80044e 1464e: 8f 93 push r24 14650: 80 91 4d 04 lds r24, 0x044D ; 0x80044d 14654: 8f 93 push r24 14656: 80 91 4c 04 lds r24, 0x044C ; 0x80044c 1465a: 8f 93 push r24 1465c: 80 91 4b 04 lds r24, 0x044B ; 0x80044b 14660: 8f 93 push r24 14662: 80 91 4a 04 lds r24, 0x044A ; 0x80044a 14666: 8f 93 push r24 14668: 80 91 49 04 lds r24, 0x0449 ; 0x800449 1466c: 8f 93 push r24 1466e: 80 91 48 04 lds r24, 0x0448 ; 0x800448 14672: 8f 93 push r24 14674: 80 91 47 04 lds r24, 0x0447 ; 0x800447 14678: 8f 93 push r24 1467a: 80 91 46 04 lds r24, 0x0446 ; 0x800446 1467e: 8f 93 push r24 14680: 1f 93 push r17 14682: 0f 93 push r16 14684: 1f 93 push r17 14686: 0f 93 push r16 14688: 80 91 45 04 lds r24, 0x0445 ; 0x800445 1468c: 8f 93 push r24 1468e: 80 91 44 04 lds r24, 0x0444 ; 0x800444 14692: 8f 93 push r24 14694: 80 91 43 04 lds r24, 0x0443 ; 0x800443 14698: 8f 93 push r24 1469a: 80 91 42 04 lds r24, 0x0442 ; 0x800442 1469e: 8f 93 push r24 146a0: 80 91 41 04 lds r24, 0x0441 ; 0x800441 146a4: 8f 93 push r24 146a6: 80 91 40 04 lds r24, 0x0440 ; 0x800440 146aa: 8f 93 push r24 146ac: 80 91 3f 04 lds r24, 0x043F ; 0x80043f 146b0: 8f 93 push r24 146b2: 80 91 3e 04 lds r24, 0x043E ; 0x80043e 146b6: 8f 93 push r24 146b8: 80 91 3d 04 lds r24, 0x043D ; 0x80043d 146bc: 8f 93 push r24 146be: 80 91 3c 04 lds r24, 0x043C ; 0x80043c 146c2: 8f 93 push r24 146c4: 80 91 3b 04 lds r24, 0x043B ; 0x80043b 146c8: 8f 93 push r24 146ca: 80 91 3a 04 lds r24, 0x043A ; 0x80043a 146ce: 8f 93 push r24 146d0: 80 91 39 04 lds r24, 0x0439 ; 0x800439 146d4: 8f 93 push r24 146d6: 80 91 38 04 lds r24, 0x0438 ; 0x800438 146da: 8f 93 push r24 146dc: 80 91 37 04 lds r24, 0x0437 ; 0x800437 146e0: 8f 93 push r24 146e2: 80 91 36 04 lds r24, 0x0436 ; 0x800436 146e6: 8f 93 push r24 146e8: 1f 93 push r17 146ea: 0f 93 push r16 146ec: 1f 93 push r17 146ee: 0f 93 push r16 146f0: 8a e6 ldi r24, 0x6A ; 106 146f2: 9b e7 ldi r25, 0x7B ; 123 146f4: 9f 93 push r25 146f6: 8f 93 push r24 146f8: 0f 94 9e 9e call 0x33d3c ; 0x33d3c echomagic, echomagic, cs.minimumfeedrate, cs.mintravelfeedrate, cs.min_segment_time_us, cs.max_jerk[X_AXIS], cs.max_jerk[Y_AXIS], cs.max_jerk[Z_AXIS], cs.max_jerk[E_AXIS], echomagic, echomagic, cs.add_homing[X_AXIS], cs.add_homing[Y_AXIS], cs.add_homing[Z_AXIS] #endif //TMC2130 ); #ifdef PIDTEMP printf_P(PSTR("%SPID settings:\n%S M301 P%.2f I%.2f D%.2f\n"), 146fc: 0f b6 in r0, 0x3f ; 63 146fe: f8 94 cli 14700: de bf out 0x3e, r29 ; 62 14702: 0f be out 0x3f, r0 ; 63 14704: cd bf out 0x3d, r28 ; 61 14706: 2c ea ldi r18, 0xAC ; 172 14708: 35 ec ldi r19, 0xC5 ; 197 1470a: 47 e2 ldi r20, 0x27 ; 39 1470c: 5e e3 ldi r21, 0x3E ; 62 1470e: 60 91 a2 04 lds r22, 0x04A2 ; 0x8004a2 14712: 70 91 a3 04 lds r23, 0x04A3 ; 0x8004a3 14716: 80 91 a4 04 lds r24, 0x04A4 ; 0x8004a4 1471a: 90 91 a5 04 lds r25, 0x04A5 ; 0x8004a5 1471e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 14722: 9f 93 push r25 14724: 8f 93 push r24 14726: 7f 93 push r23 14728: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 1472a: 2c ea ldi r18, 0xAC ; 172 1472c: 35 ec ldi r19, 0xC5 ; 197 1472e: 47 e2 ldi r20, 0x27 ; 39 14730: 5e e3 ldi r21, 0x3E ; 62 14732: 60 91 9e 04 lds r22, 0x049E ; 0x80049e 14736: 70 91 9f 04 lds r23, 0x049F ; 0x80049f 1473a: 80 91 a0 04 lds r24, 0x04A0 ; 0x8004a0 1473e: 90 91 a1 04 lds r25, 0x04A1 ; 0x8004a1 14742: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 14746: 9f 93 push r25 14748: 8f 93 push r24 1474a: 7f 93 push r23 1474c: 6f 93 push r22 1474e: 80 91 9d 04 lds r24, 0x049D ; 0x80049d 14752: 8f 93 push r24 14754: 80 91 9c 04 lds r24, 0x049C ; 0x80049c 14758: 8f 93 push r24 1475a: 80 91 9b 04 lds r24, 0x049B ; 0x80049b 1475e: 8f 93 push r24 14760: 80 91 9a 04 lds r24, 0x049A ; 0x80049a 14764: 8f 93 push r24 14766: 1f 93 push r17 14768: 0f 93 push r16 1476a: 1f 93 push r17 1476c: 0f 93 push r16 1476e: 8d e3 ldi r24, 0x3D ; 61 14770: 9b e7 ldi r25, 0x7B ; 123 14772: 9f 93 push r25 14774: 8f 93 push r24 14776: 0f 94 9e 9e call 0x33d3c ; 0x33d3c #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 1477a: 2c ea ldi r18, 0xAC ; 172 1477c: 35 ec ldi r19, 0xC5 ; 197 1477e: 47 e2 ldi r20, 0x27 ; 39 14780: 5e e3 ldi r21, 0x3E ; 62 14782: 60 91 ae 04 lds r22, 0x04AE ; 0x8004ae 14786: 70 91 af 04 lds r23, 0x04AF ; 0x8004af 1478a: 80 91 b0 04 lds r24, 0x04B0 ; 0x8004b0 1478e: 90 91 b1 04 lds r25, 0x04B1 ; 0x8004b1 14792: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> echomagic, echomagic, cs.Kp, unscalePID_i(cs.Ki), unscalePID_d(cs.Kd)); #endif #ifdef PIDTEMPBED printf_P(PSTR("%SPID heatbed settings:\n%S M304 P%.2f I%.2f D%.2f\n"), 14796: 9f 93 push r25 14798: 8f 93 push r24 1479a: 7f 93 push r23 1479c: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 1479e: 2c ea ldi r18, 0xAC ; 172 147a0: 35 ec ldi r19, 0xC5 ; 197 147a2: 47 e2 ldi r20, 0x27 ; 39 147a4: 5e e3 ldi r21, 0x3E ; 62 147a6: 60 91 aa 04 lds r22, 0x04AA ; 0x8004aa 147aa: 70 91 ab 04 lds r23, 0x04AB ; 0x8004ab 147ae: 80 91 ac 04 lds r24, 0x04AC ; 0x8004ac 147b2: 90 91 ad 04 lds r25, 0x04AD ; 0x8004ad 147b6: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 147ba: 9f 93 push r25 147bc: 8f 93 push r24 147be: 7f 93 push r23 147c0: 6f 93 push r22 147c2: 80 91 a9 04 lds r24, 0x04A9 ; 0x8004a9 147c6: 8f 93 push r24 147c8: 80 91 a8 04 lds r24, 0x04A8 ; 0x8004a8 147cc: 8f 93 push r24 147ce: 80 91 a7 04 lds r24, 0x04A7 ; 0x8004a7 147d2: 8f 93 push r24 147d4: 80 91 a6 04 lds r24, 0x04A6 ; 0x8004a6 147d8: 8f 93 push r24 147da: 1f 93 push r17 147dc: 0f 93 push r16 147de: 1f 93 push r17 147e0: 0f 93 push r16 147e2: 88 e0 ldi r24, 0x08 ; 8 147e4: 9b e7 ldi r25, 0x7B ; 123 147e6: 9f 93 push r25 147e8: 8f 93 push r24 147ea: 0f 94 9e 9e call 0x33d3c ; 0x33d3c echomagic, echomagic, cs.bedKp, unscalePID_i(cs.bedKi), unscalePID_d(cs.bedKd)); #endif #ifdef FWRETRACT printf_P(PSTR( 147ee: 0f b6 in r0, 0x3f ; 63 147f0: f8 94 cli 147f2: de bf out 0x3e, r29 ; 62 147f4: 0f be out 0x3f, r0 ; 63 147f6: cd bf out 0x3d, r28 ; 61 147f8: 80 91 b4 04 lds r24, 0x04B4 ; 0x8004b4 147fc: 1f 92 push r1 147fe: 8f 93 push r24 14800: 1f 93 push r17 14802: 0f 93 push r16 14804: 1f 93 push r17 14806: 0f 93 push r16 14808: 20 e0 ldi r18, 0x00 ; 0 1480a: 30 e0 ldi r19, 0x00 ; 0 1480c: 40 e7 ldi r20, 0x70 ; 112 1480e: 52 e4 ldi r21, 0x42 ; 66 14810: 60 91 c5 04 lds r22, 0x04C5 ; 0x8004c5 14814: 70 91 c6 04 lds r23, 0x04C6 ; 0x8004c6 14818: 80 91 c7 04 lds r24, 0x04C7 ; 0x8004c7 1481c: 90 91 c8 04 lds r25, 0x04C8 ; 0x8004c8 14820: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 14824: 9f 93 push r25 14826: 8f 93 push r24 14828: 7f 93 push r23 1482a: 6f 93 push r22 1482c: 80 91 c4 04 lds r24, 0x04C4 ; 0x8004c4 14830: 8f 93 push r24 14832: 80 91 c3 04 lds r24, 0x04C3 ; 0x8004c3 14836: 8f 93 push r24 14838: 80 91 c2 04 lds r24, 0x04C2 ; 0x8004c2 1483c: 8f 93 push r24 1483e: 80 91 c1 04 lds r24, 0x04C1 ; 0x8004c1 14842: 8f 93 push r24 14844: 1f 93 push r17 14846: 0f 93 push r16 14848: 1f 93 push r17 1484a: 0f 93 push r16 1484c: 80 91 c0 04 lds r24, 0x04C0 ; 0x8004c0 14850: 8f 93 push r24 14852: 80 91 bf 04 lds r24, 0x04BF ; 0x8004bf 14856: 8f 93 push r24 14858: 80 91 be 04 lds r24, 0x04BE ; 0x8004be 1485c: 8f 93 push r24 1485e: 80 91 bd 04 lds r24, 0x04BD ; 0x8004bd 14862: 8f 93 push r24 14864: 20 e0 ldi r18, 0x00 ; 0 14866: 30 e0 ldi r19, 0x00 ; 0 14868: 40 e7 ldi r20, 0x70 ; 112 1486a: 52 e4 ldi r21, 0x42 ; 66 1486c: 60 91 b9 04 lds r22, 0x04B9 ; 0x8004b9 14870: 70 91 ba 04 lds r23, 0x04BA ; 0x8004ba 14874: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 14878: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 1487c: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 14880: 9f 93 push r25 14882: 8f 93 push r24 14884: 7f 93 push r23 14886: 6f 93 push r22 14888: 80 91 b8 04 lds r24, 0x04B8 ; 0x8004b8 1488c: 8f 93 push r24 1488e: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 14892: 8f 93 push r24 14894: 80 91 b6 04 lds r24, 0x04B6 ; 0x8004b6 14898: 8f 93 push r24 1489a: 80 91 b5 04 lds r24, 0x04B5 ; 0x8004b5 1489e: 8f 93 push r24 148a0: 1f 93 push r17 148a2: 0f 93 push r16 148a4: 1f 93 push r17 148a6: 0f 93 push r16 148a8: 87 e0 ldi r24, 0x07 ; 7 148aa: 9a e7 ldi r25, 0x7A ; 122 148ac: 9f 93 push r25 148ae: 8f 93 push r24 148b0: 0f 94 9e 9e call 0x33d3c ; 0x33d3c ); #if EXTRUDERS > 1 printf_P(PSTR("%SMulti-extruder settings:\n%S Swap retract length (mm): %.2f\n%S Swap rec. addl. length (mm): %.2f\n"), echomagic, echomagic, retract_length_swap, echomagic, retract_recover_length_swap); #endif if (cs.volumetric_enabled) { 148b4: 0f b6 in r0, 0x3f ; 63 148b6: f8 94 cli 148b8: de bf out 0x3e, r29 ; 62 148ba: 0f be out 0x3f, r0 ; 63 148bc: cd bf out 0x3d, r28 ; 61 148be: 80 91 c9 04 lds r24, 0x04C9 ; 0x8004c9 148c2: 88 23 and r24, r24 148c4: 09 f4 brne .+2 ; 0x148c8 148c6: 74 c0 rjmp .+232 ; 0x149b0 printf_P(PSTR("%SFilament settings:\n%S M200 D%.2f\n"), 148c8: 80 91 cd 04 lds r24, 0x04CD ; 0x8004cd 148cc: 8f 93 push r24 148ce: 80 91 cc 04 lds r24, 0x04CC ; 0x8004cc 148d2: 8f 93 push r24 148d4: 80 91 cb 04 lds r24, 0x04CB ; 0x8004cb 148d8: 8f 93 push r24 148da: 80 91 ca 04 lds r24, 0x04CA ; 0x8004ca 148de: 8f 93 push r24 148e0: 1f 93 push r17 148e2: 0f 93 push r16 148e4: 1f 93 push r17 148e6: 0f 93 push r16 148e8: 81 ee ldi r24, 0xE1 ; 225 148ea: 99 e7 ldi r25, 0x79 ; 121 148ec: 9f 93 push r25 148ee: 8f 93 push r24 148f0: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 148f4: 0f b6 in r0, 0x3f ; 63 148f6: f8 94 cli 148f8: de bf out 0x3e, r29 ; 62 148fa: 0f be out 0x3f, r0 ; 63 148fc: cd bf out 0x3d, r28 ; 61 printf_P(PSTR("%SLinear advance settings:%S M900 K%.2f\n"), echomagic, echomagic, extruder_advance_K); #endif //LIN_ADVANCE } // Arc Interpolation Settings printf_P(PSTR( 148fe: 80 91 02 05 lds r24, 0x0502 ; 0x800502 14902: 8f 93 push r24 14904: 80 91 01 05 lds r24, 0x0501 ; 0x800501 14908: 8f 93 push r24 1490a: 80 91 00 05 lds r24, 0x0500 ; 0x800500 1490e: 8f 93 push r24 14910: 80 91 ff 04 lds r24, 0x04FF ; 0x8004ff 14914: 8f 93 push r24 14916: 80 91 fe 04 lds r24, 0x04FE ; 0x8004fe 1491a: 1f 92 push r1 1491c: 8f 93 push r24 1491e: 80 91 fd 04 lds r24, 0x04FD ; 0x8004fd 14922: 8f 93 push r24 14924: 80 91 fc 04 lds r24, 0x04FC ; 0x8004fc 14928: 8f 93 push r24 1492a: 80 91 fb 04 lds r24, 0x04FB ; 0x8004fb 1492e: 8f 93 push r24 14930: 80 91 fa 04 lds r24, 0x04FA ; 0x8004fa 14934: 8f 93 push r24 14936: 80 91 f9 04 lds r24, 0x04F9 ; 0x8004f9 1493a: 8f 93 push r24 1493c: 80 91 f8 04 lds r24, 0x04F8 ; 0x8004f8 14940: 8f 93 push r24 14942: 80 91 f7 04 lds r24, 0x04F7 ; 0x8004f7 14946: 8f 93 push r24 14948: 80 91 f6 04 lds r24, 0x04F6 ; 0x8004f6 1494c: 8f 93 push r24 1494e: 01 e6 ldi r16, 0x61 ; 97 14950: 1d e9 ldi r17, 0x9D ; 157 14952: 1f 93 push r17 14954: 0f 93 push r16 14956: 1f 93 push r17 14958: 0f 93 push r16 1495a: 80 e4 ldi r24, 0x40 ; 64 1495c: 99 e7 ldi r25, 0x79 ; 121 1495e: 9f 93 push r25 14960: 8f 93 push r24 14962: 0f 94 9e 9e call 0x33d3c ; 0x33d3c "%SArc Settings: P:Max length(mm) S:Min length (mm) N:Corrections R:Min segments F:Segments/sec.\n%S M214 P%.2f S%.2f N%d R%d F%d\n"), echomagic, echomagic, cs.mm_per_arc_segment, cs.min_mm_per_arc_segment, cs.n_arc_correction, cs.min_arc_segments, cs.arc_segments_per_sec); #ifdef THERMAL_MODEL thermal_model_report_settings(); #endif printf_P(PSTR( 14966: 8d ee ldi r24, 0xED ; 237 14968: 9f e0 ldi r25, 0x0F ; 15 1496a: 0f 94 e4 9f call 0x33fc8 ; 0x33fc8 1496e: f6 2e mov r15, r22 14970: e7 2e mov r14, r23 14972: d8 2e mov r13, r24 14974: c9 2e mov r12, r25 14976: 81 ef ldi r24, 0xF1 ; 241 14978: 9f e0 ldi r25, 0x0F ; 15 1497a: 0f 94 e4 9f call 0x33fc8 ; 0x33fc8 1497e: cf 92 push r12 14980: df 92 push r13 14982: ef 92 push r14 14984: ff 92 push r15 14986: 9f 93 push r25 14988: 8f 93 push r24 1498a: 7f 93 push r23 1498c: 6f 93 push r22 1498e: 1f 93 push r17 14990: 0f 93 push r16 14992: 1f 93 push r17 14994: 0f 93 push r16 14996: 8f e1 ldi r24, 0x1F ; 31 14998: 99 e7 ldi r25, 0x79 ; 121 1499a: 9f 93 push r25 1499c: 8f 93 push r24 1499e: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 149a2: 0f b6 in r0, 0x3f ; 63 149a4: f8 94 cli 149a6: de bf out 0x3e, r29 ; 62 149a8: 0f be out 0x3f, r0 ; 63 149aa: cd bf out 0x3d, r28 ; 61 149ac: 0c 94 12 98 jmp 0x13024 ; 0x13024 printf_P(PSTR("%S M200 T1 D%.2f\n"), echomagic, echomagic, cs.filament_size[2]); #endif #endif } else { printf_P(PSTR("%SFilament settings: Disabled\n"), echomagic); 149b0: 1f 93 push r17 149b2: 0f 93 push r16 149b4: 82 ec ldi r24, 0xC2 ; 194 149b6: 99 e7 ldi r25, 0x79 ; 121 149b8: 9f 93 push r25 149ba: 8f 93 push r24 149bc: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 149c0: 0f 90 pop r0 149c2: 0f 90 pop r0 149c4: 0f 90 pop r0 149c6: 0f 90 pop r0 149c8: 9a cf rjmp .-204 ; 0x148fe #### Parameters - `P` - The IP address in xxx.xxx.xxx.xxx format. Eg: P192.168.1.14 */ case 552: { if (code_seen('P')) 149ca: 80 e5 ldi r24, 0x50 ; 80 149cc: 0e 94 2b 55 call 0xaa56 ; 0xaa56 149d0: 88 23 and r24, r24 149d2: 11 f4 brne .+4 ; 0x149d8 149d4: 0c 94 12 98 jmp 0x13024 ; 0x13024 { uint8_t valCnt = 0; IP_address = 0; 149d8: 10 92 7d 06 sts 0x067D, r1 ; 0x80067d 149dc: 10 92 7e 06 sts 0x067E, r1 ; 0x80067e 149e0: 10 92 7f 06 sts 0x067F, r1 ; 0x80067f 149e4: 10 92 80 06 sts 0x0680, r1 ; 0x800680 149e8: 0d e7 ldi r16, 0x7D ; 125 149ea: 16 e0 ldi r17, 0x06 ; 6 149ec: 31 e8 ldi r19, 0x81 ; 129 149ee: e3 2e mov r14, r19 149f0: 36 e0 ldi r19, 0x06 ; 6 149f2: f3 2e mov r15, r19 do { *strchr_pointer = '*'; 149f4: 4a e2 ldi r20, 0x2A ; 42 149f6: d4 2e mov r13, r20 149f8: e0 91 f5 16 lds r30, 0x16F5 ; 0x8016f5 149fc: f0 91 f6 16 lds r31, 0x16F6 ; 0x8016f6 14a00: d0 82 st Z, r13 ((uint8_t*)&IP_address)[valCnt] = code_value_short(); 14a02: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 14a06: d8 01 movw r26, r16 14a08: 8d 93 st X+, r24 14a0a: 8d 01 movw r16, r26 valCnt++; } while ((valCnt < 4) && code_seen('.')); 14a0c: ea 16 cp r14, r26 14a0e: fb 06 cpc r15, r27 14a10: 11 f4 brne .+4 ; 0x14a16 14a12: 0c 94 12 98 jmp 0x13024 ; 0x13024 14a16: 8e e2 ldi r24, 0x2E ; 46 14a18: 0e 94 2b 55 call 0xaa56 ; 0xaa56 14a1c: 81 11 cpse r24, r1 14a1e: ec cf rjmp .-40 ; 0x149f8 if (valCnt != 4) IP_address = 0; 14a20: 10 92 7d 06 sts 0x067D, r1 ; 0x80067d 14a24: 10 92 7e 06 sts 0x067E, r1 ; 0x80067e 14a28: 10 92 7f 06 sts 0x067F, r1 ; 0x80067f 14a2c: 10 92 80 06 sts 0x0680, r1 ; 0x800680 14a30: 0c 94 12 98 jmp 0x13024 ; 0x13024 - `C` - filament name to show during loading - `AUTO` - Automatically (only with MMU) */ case 600: //Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal] C"[filament name to show during loading]" { st_synchronize(); 14a34: 0f 94 42 22 call 0x24484 ; 0x24484 /// e.g. feedrate, Z-axis position etc. /// This function should backup variables which may be lost /// For example a power panic in M600 or during MMU error void refresh_print_state_in_ram() { if (saved_printing) return; 14a38: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 14a3c: 81 11 cpse r24, r1 14a3e: 02 c0 rjmp .+4 ; 0x14a44 14a40: 0e 94 2e 5e call 0xbc5c ; 0xbc5c float e_shift_init = FILAMENTCHANGE_FIRSTRETRACT; float e_shift_late = FILAMENTCHANGE_FINALRETRACT; bool automatic = false; //Retract extruder if (code_seen('E')) e_shift_init = code_value(); 14a44: 85 e4 ldi r24, 0x45 ; 69 14a46: 0e 94 2b 55 call 0xaa56 ; 0xaa56 refresh_print_state_in_ram(); float x_position = FILAMENTCHANGE_XPOS; float y_position = FILAMENTCHANGE_YPOS; float z_shift = MIN_Z_FOR_SWAP; float e_shift_init = FILAMENTCHANGE_FIRSTRETRACT; 14a4a: 81 2c mov r8, r1 14a4c: 91 2c mov r9, r1 14a4e: a1 2c mov r10, r1 14a50: 20 ec ldi r18, 0xC0 ; 192 14a52: b2 2e mov r11, r18 float e_shift_late = FILAMENTCHANGE_FINALRETRACT; bool automatic = false; //Retract extruder if (code_seen('E')) e_shift_init = code_value(); 14a54: 88 23 and r24, r24 14a56: 21 f0 breq .+8 ; 0x14a60 14a58: 0e 94 03 5a call 0xb406 ; 0xb406 14a5c: 4b 01 movw r8, r22 14a5e: 5c 01 movw r10, r24 if (code_seen('L')) e_shift_late = code_value(); 14a60: 8c e4 ldi r24, 0x4C ; 76 14a62: 0e 94 2b 55 call 0xaa56 ; 0xaa56 float x_position = FILAMENTCHANGE_XPOS; float y_position = FILAMENTCHANGE_YPOS; float z_shift = MIN_Z_FOR_SWAP; float e_shift_init = FILAMENTCHANGE_FIRSTRETRACT; float e_shift_late = FILAMENTCHANGE_FINALRETRACT; 14a66: c1 2c mov r12, r1 14a68: d1 2c mov r13, r1 14a6a: 76 01 movw r14, r12 bool automatic = false; //Retract extruder if (code_seen('E')) e_shift_init = code_value(); if (code_seen('L')) e_shift_late = code_value(); 14a6c: 88 23 and r24, r24 14a6e: 21 f0 breq .+8 ; 0x14a78 14a70: 0e 94 03 5a call 0xb406 ; 0xb406 14a74: 6b 01 movw r12, r22 14a76: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_shift = fabs(code_value()); 14a78: 8a e5 ldi r24, 0x5A ; 90 14a7a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 // take a partial back up of print state into RAM (current position, etc.) refresh_print_state_in_ram(); float x_position = FILAMENTCHANGE_XPOS; float y_position = FILAMENTCHANGE_YPOS; float z_shift = MIN_Z_FOR_SWAP; 14a7e: 41 2c mov r4, r1 14a80: 51 2c mov r5, r1 14a82: 98 ed ldi r25, 0xD8 ; 216 14a84: 69 2e mov r6, r25 14a86: 91 e4 ldi r25, 0x41 ; 65 14a88: 79 2e mov r7, r25 //Retract extruder if (code_seen('E')) e_shift_init = code_value(); if (code_seen('L')) e_shift_late = code_value(); // Z lift. For safety only allow positive values if (code_seen('Z')) z_shift = fabs(code_value()); 14a8a: 88 23 and r24, r24 14a8c: 31 f0 breq .+12 ; 0x14a9a 14a8e: 0e 94 03 5a call 0xb406 ; 0xb406 14a92: 2b 01 movw r4, r22 14a94: 3c 01 movw r6, r24 14a96: e8 94 clt 14a98: 77 f8 bld r7, 7 //Move XY to side if (code_seen('X')) x_position = code_value(); 14a9a: 88 e5 ldi r24, 0x58 ; 88 14a9c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 14aa0: 88 23 and r24, r24 14aa2: 09 f4 brne .+2 ; 0x14aa6 14aa4: b5 c1 rjmp .+874 ; 0x14e10 14aa6: 0e 94 03 5a call 0xb406 ; 0xb406 14aaa: 68 a7 std Y+40, r22 ; 0x28 14aac: 79 a7 std Y+41, r23 ; 0x29 14aae: 8a a7 std Y+42, r24 ; 0x2a 14ab0: 9b a7 std Y+43, r25 ; 0x2b if (code_seen('Y')) y_position = code_value(); 14ab2: 89 e5 ldi r24, 0x59 ; 89 14ab4: 0e 94 2b 55 call 0xaa56 ; 0xaa56 14ab8: 88 23 and r24, r24 14aba: 09 f4 brne .+2 ; 0x14abe 14abc: b2 c1 rjmp .+868 ; 0x14e22 14abe: 0e 94 03 5a call 0xb406 ; 0xb406 14ac2: 6c a7 std Y+44, r22 ; 0x2c 14ac4: 7d a7 std Y+45, r23 ; 0x2d 14ac6: 8e a7 std Y+46, r24 ; 0x2e 14ac8: 9f a7 std Y+47, r25 ; 0x2f // Filament name to show during the loading char filament_name[LCD_WIDTH + 1] = ""; 14aca: 1a 82 std Y+2, r1 ; 0x02 14acc: 19 82 std Y+1, r1 ; 0x01 14ace: fe 01 movw r30, r28 14ad0: 33 96 adiw r30, 0x03 ; 3 14ad2: 83 e1 ldi r24, 0x13 ; 19 14ad4: df 01 movw r26, r30 14ad6: 1d 92 st X+, r1 14ad8: 8a 95 dec r24 14ada: e9 f7 brne .-6 ; 0x14ad6 if (code_seen('C')) { 14adc: 83 e4 ldi r24, 0x43 ; 67 14ade: 0e 94 2b 55 call 0xaa56 ; 0xaa56 14ae2: 88 23 and r24, r24 14ae4: f9 f0 breq .+62 ; 0x14b24 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 14ae6: 62 e2 ldi r22, 0x22 ; 34 14ae8: 70 e0 ldi r23, 0x00 ; 0 14aea: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 14aee: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 14af2: 0f 94 33 a6 call 0x34c66 ; 0x34c66 14af6: 8c 01 movw r16, r24 if (!this->ptr) { 14af8: 89 2b or r24, r25 14afa: a1 f0 breq .+40 ; 0x14b24 // First quote not found return; } // Skip the leading quote this->ptr++; 14afc: 0f 5f subi r16, 0xFF ; 255 14afe: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 14b00: 62 e2 ldi r22, 0x22 ; 34 14b02: 70 e0 ldi r23, 0x00 ; 0 14b04: c8 01 movw r24, r16 14b06: 0f 94 33 a6 call 0x34c66 ; 0x34c66 if(!pStrEnd) { 14b0a: 00 97 sbiw r24, 0x00 ; 0 14b0c: 59 f0 breq .+22 ; 0x14b24 // Second quote not found return; } this->len = pStrEnd - this->ptr; 14b0e: 80 1b sub r24, r16 unquoted_string str = unquoted_string(strchr_pointer); if (str.WasFound()) { const uint8_t len = min(str.GetLength(), LCD_WIDTH); 14b10: 84 31 cpi r24, 0x14 ; 20 14b12: 08 f0 brcs .+2 ; 0x14b16 14b14: 84 e1 ldi r24, 0x14 ; 20 memcpy(filament_name, str.GetUnquotedString(), len); 14b16: 48 2f mov r20, r24 14b18: 50 e0 ldi r21, 0x00 ; 0 14b1a: b8 01 movw r22, r16 14b1c: ce 01 movw r24, r28 14b1e: 01 96 adiw r24, 0x01 ; 1 14b20: 0f 94 05 a6 call 0x34c0a ; 0x34c0a } } if (MMU2::mmu2.Enabled() && code_seen_P(PSTR("AUTO"))) 14b24: 80 91 94 12 lds r24, 0x1294 ; 0x801294 float x_position = FILAMENTCHANGE_XPOS; float y_position = FILAMENTCHANGE_YPOS; float z_shift = MIN_Z_FOR_SWAP; float e_shift_init = FILAMENTCHANGE_FIRSTRETRACT; float e_shift_late = FILAMENTCHANGE_FINALRETRACT; bool automatic = false; 14b28: 10 e0 ldi r17, 0x00 ; 0 const uint8_t len = min(str.GetLength(), LCD_WIDTH); memcpy(filament_name, str.GetUnquotedString(), len); } } if (MMU2::mmu2.Enabled() && code_seen_P(PSTR("AUTO"))) 14b2a: 81 30 cpi r24, 0x01 ; 1 14b2c: 29 f4 brne .+10 ; 0x14b38 14b2e: 82 e1 ldi r24, 0x12 ; 18 14b30: 9f e7 ldi r25, 0x7F ; 127 14b32: 0f 94 51 74 call 0x2e8a2 ; 0x2e8a2 14b36: 18 2f mov r17, r24 load_filament_final_feed(); // @@TODO verify st_synchronize(); } static void gcode_M600(const bool automatic, const float x_position, const float y_position, const float z_shift, const float e_shift, const float e_shift_late, const char* filament_name) { st_synchronize(); 14b38: 0f 94 42 22 call 0x24484 ; 0x24484 // When using an MMU, save the currently use slot number // so the firmware can know which slot to eject after the filament // is unloaded. uint8_t eject_slot = 0; prusa_statistics(22); 14b3c: 86 e1 ldi r24, 0x16 ; 22 14b3e: 0f 94 ff 97 call 0x32ffe ; 0x32ffe // Turn off the fan fanSpeed = 0; 14b42: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 // Retract E if (!printingIsPaused()) 14b46: 0e 94 bd 60 call 0xc17a ; 0xc17a 14b4a: 81 11 cpse r24, r1 14b4c: 6f c1 rjmp .+734 ; 0x14e2c { current_position[E_AXIS] += e_shift; 14b4e: a5 01 movw r20, r10 14b50: 94 01 movw r18, r8 14b52: 60 91 01 12 lds r22, 0x1201 ; 0x801201 14b56: 70 91 02 12 lds r23, 0x1202 ; 0x801202 14b5a: 80 91 03 12 lds r24, 0x1203 ; 0x801203 14b5e: 90 91 04 12 lds r25, 0x1204 ; 0x801204 14b62: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 14b66: 60 93 01 12 sts 0x1201, r22 ; 0x801201 14b6a: 70 93 02 12 sts 0x1202, r23 ; 0x801202 14b6e: 80 93 03 12 sts 0x1203, r24 ; 0x801203 14b72: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 14b76: 60 e0 ldi r22, 0x00 ; 0 14b78: 70 e0 ldi r23, 0x00 ; 0 14b7a: 88 ee ldi r24, 0xE8 ; 232 14b7c: 92 e4 ldi r25, 0x42 ; 66 14b7e: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 14b82: 0f 94 42 22 call 0x24484 ; 0x24484 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 14b86: 86 e3 ldi r24, 0x36 ; 54 14b88: 9a e6 ldi r25, 0x6A ; 106 14b8a: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 // Filament change can be issued via the Tune menu restore_extruder_temperature_from_ram(); } // Raise the Z axis raise_z(z_shift); 14b8e: c3 01 movw r24, r6 14b90: b2 01 movw r22, r4 14b92: 0e 94 dd 66 call 0xcdba ; 0xcdba // Move XY to side current_position[X_AXIS] = x_position; 14b96: 28 a5 ldd r18, Y+40 ; 0x28 14b98: 39 a5 ldd r19, Y+41 ; 0x29 14b9a: 4a a5 ldd r20, Y+42 ; 0x2a 14b9c: 5b a5 ldd r21, Y+43 ; 0x2b 14b9e: 20 93 f5 11 sts 0x11F5, r18 ; 0x8011f5 14ba2: 30 93 f6 11 sts 0x11F6, r19 ; 0x8011f6 14ba6: 40 93 f7 11 sts 0x11F7, r20 ; 0x8011f7 14baa: 50 93 f8 11 sts 0x11F8, r21 ; 0x8011f8 current_position[Y_AXIS] = y_position; 14bae: 8c a5 ldd r24, Y+44 ; 0x2c 14bb0: 9d a5 ldd r25, Y+45 ; 0x2d 14bb2: ae a5 ldd r26, Y+46 ; 0x2e 14bb4: bf a5 ldd r27, Y+47 ; 0x2f 14bb6: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 14bba: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 14bbe: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 14bc2: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 14bc6: 60 e0 ldi r22, 0x00 ; 0 14bc8: 70 e0 ldi r23, 0x00 ; 0 14bca: 88 e4 ldi r24, 0x48 ; 72 14bcc: 92 e4 ldi r25, 0x42 ; 66 14bce: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 14bd2: 0f 94 42 22 call 0x24484 ; 0x24484 bool repeat = false; 14bd6: b1 2c mov r11, r1 st_synchronize(); // When using an MMU, save the currently use slot number // so the firmware can know which slot to eject after the filament // is unloaded. uint8_t eject_slot = 0; 14bd8: a1 2c mov r10, r1 #endif //PINDA_THERMISTOR void lcd_wait_for_heater() { lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); lcd_printf_P(PSTR("%3d/%3d"), (int16_t)degHotend(active_extruder), (int16_t) degTargetHotend(active_extruder)); 14bda: 0b e0 ldi r16, 0x0B ; 11 14bdc: 20 2e mov r2, r16 14bde: 09 e7 ldi r16, 0x79 ; 121 14be0: 30 2e mov r3, r16 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); waiting_start_time = _millis(); wait_for_user_state = 0; } else { lcd_set_cursor(1, 4); lcd_printf_P(PSTR("%3d"), (int16_t)degHotend(active_extruder)); 14be2: 83 e1 ldi r24, 0x13 ; 19 14be4: 88 2e mov r8, r24 14be6: 89 e7 ldi r24, 0x79 ; 121 14be8: 98 2e mov r9, r24 st_synchronize(); bool repeat = false; do { // Unload filament if (MMU2::mmu2.Enabled()) { 14bea: 80 91 94 12 lds r24, 0x1294 ; 0x801294 14bee: 81 30 cpi r24, 0x01 ; 1 14bf0: 09 f0 breq .+2 ; 0x14bf4 14bf2: 1f c1 rjmp .+574 ; 0x14e32 eject_slot = MMU2::mmu2.get_current_tool(); 14bf4: 0f 94 92 41 call 0x28324 ; 0x28324 14bf8: a8 2e mov r10, r24 mmu_M600_unload_filament(); 14bfa: 0e 94 1c 6d call 0xda38 ; 0xda38 } else { // Beep, manage nozzle heater and wait for user to start unload filament M600_wait_for_user(); unload_filament(e_shift_late); } st_synchronize(); // finish moves 14bfe: 0f 94 42 22 call 0x24484 ; 0x24484 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 14c02: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 14c06: 10 92 85 16 sts 0x1685, r1 ; 0x801685 FSensorBlockRunout fsBlockRunout; if (!MMU2::mmu2.Enabled()) 14c0a: 80 91 94 12 lds r24, 0x1294 ; 0x801294 14c0e: 81 30 cpi r24, 0x01 ; 1 14c10: 09 f4 brne .+2 ; 0x14c14 14c12: d9 c1 rjmp .+946 ; 0x14fc6 { KEEPALIVE_STATE(PAUSED_FOR_USER); 14c14: 84 e0 ldi r24, 0x04 ; 4 14c16: 80 93 78 02 sts 0x0278, r24 ; 0x800278 uint8_t choice = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_UNLOAD_SUCCESSFUL), false, LCD_LEFT_BUTTON_CHOICE); 14c1a: 8d ee ldi r24, 0xED ; 237 14c1c: 98 e3 ldi r25, 0x38 ; 56 14c1e: 0e 94 b1 6c call 0xd962 ; 0xd962 14c22: 40 e0 ldi r20, 0x00 ; 0 14c24: 60 e0 ldi r22, 0x00 ; 0 14c26: 0f 94 e0 2d call 0x25bc0 ; 0x25bc0 14c2a: 08 2f mov r16, r24 lcd_update_enable(false); 14c2c: 80 e0 ldi r24, 0x00 ; 0 14c2e: 0e 94 c0 69 call 0xd380 ; 0xd380 if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 14c32: 01 30 cpi r16, 0x01 ; 1 14c34: 29 f5 brne .+74 ; 0x14c80 lcd_clear(); 14c36: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 14c3a: 85 e6 ldi r24, 0x65 ; 101 14c3c: 99 e3 ldi r25, 0x39 ; 57 14c3e: 0e 94 b1 6c call 0xd962 ; 0xd962 14c42: ac 01 movw r20, r24 14c44: 62 e0 ldi r22, 0x02 ; 2 14c46: 80 e0 ldi r24, 0x00 ; 0 14c48: 0e 94 8f 69 call 0xd31e ; 0xd31e current_position[X_AXIS] = 100; 14c4c: 80 e0 ldi r24, 0x00 ; 0 14c4e: 90 e0 ldi r25, 0x00 ; 0 14c50: a8 ec ldi r26, 0xC8 ; 200 14c52: b2 e4 ldi r27, 0x42 ; 66 14c54: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 14c58: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 14c5c: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 14c60: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 14c64: 60 e0 ldi r22, 0x00 ; 0 14c66: 70 e0 ldi r23, 0x00 ; 0 14c68: 88 e4 ldi r24, 0x48 ; 72 14c6a: 92 e4 ldi r25, 0x42 ; 66 14c6c: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 14c70: 0f 94 42 22 call 0x24484 ; 0x24484 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHECK_IDLER)); 14c74: 8b eb ldi r24, 0xBB ; 187 14c76: 98 e3 ldi r25, 0x38 ; 56 14c78: 0e 94 b1 6c call 0xd962 ; 0xd962 14c7c: 0f 94 47 0b call 0x2168e ; 0x2168e preheat_or_continue(FilamentAction::UnLoad); } void lcd_wait_interact(const char* filament_name) { lcd_clear(); 14c80: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_puts_at_P(0, 0, _T(MSG_INSERT_FILAMENT)); 14c84: 89 e4 ldi r24, 0x49 ; 73 14c86: 98 e3 ldi r25, 0x38 ; 56 14c88: 0e 94 b1 6c call 0xd962 ; 0xd962 14c8c: ac 01 movw r20, r24 14c8e: 60 e0 ldi r22, 0x00 ; 0 14c90: 80 e0 ldi r24, 0x00 ; 0 14c92: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_set_cursor(0, 1); 14c96: 61 e0 ldi r22, 0x01 ; 1 14c98: 80 e0 ldi r24, 0x00 ; 0 14c9a: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 if (filament_name[0]) { 14c9e: 89 81 ldd r24, Y+1 ; 0x01 14ca0: 88 23 and r24, r24 14ca2: 41 f0 breq .+16 ; 0x14cb4 lcd_print(filament_name); 14ca4: ce 01 movw r24, r28 14ca6: 01 96 adiw r24, 0x01 ; 1 14ca8: 0e 94 82 6b call 0xd704 ; 0xd704 lcd_set_cursor(0, 2); 14cac: 62 e0 ldi r22, 0x02 ; 2 14cae: 80 e0 ldi r24, 0x00 ; 0 14cb0: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 } #ifdef FILAMENT_SENSOR if (!fsensor.getAutoLoadEnabled()) 14cb4: 80 91 85 16 lds r24, 0x1685 ; 0x801685 14cb8: 81 11 cpse r24, r1 14cba: 06 c0 rjmp .+12 ; 0x14cc8 #endif //FILAMENT_SENSOR { lcd_puts_P(_T(MSG_PRESS)); 14cbc: 84 e3 ldi r24, 0x34 ; 52 14cbe: 98 e3 ldi r25, 0x38 ; 56 14cc0: 0e 94 b1 6c call 0xd962 ; 0xd962 14cc4: 0e 94 66 69 call 0xd2cc ; 0xd2cc void M600_load_filament(const char* filament_name) { //load filament for single material and MMU lcd_wait_interact(filament_name); KEEPALIVE_STATE(PAUSED_FOR_USER); 14cc8: 84 e0 ldi r24, 0x04 ; 4 14cca: 80 93 78 02 sts 0x0278, r24 ; 0x800278 while(!lcd_clicked()) 14cce: 0e 94 98 6b call 0xd730 ; 0xd730 14cd2: 81 11 cpse r24, r1 14cd4: 10 c0 rjmp .+32 ; 0x14cf6 { manage_heater(); 14cd6: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(true); 14cda: 81 e0 ldi r24, 0x01 ; 1 14cdc: 0e 94 01 7a call 0xf402 ; 0xf402 #ifdef FILAMENT_SENSOR if (fsensor.getFilamentLoadEvent()) { 14ce0: 80 91 88 16 lds r24, 0x1688 ; 0x801688 14ce4: 88 23 and r24, r24 14ce6: 99 f3 breq .-26 ; 0x14cce Sound_MakeCustom(50,1000,false); 14ce8: 40 e0 ldi r20, 0x00 ; 0 14cea: 68 ee ldi r22, 0xE8 ; 232 14cec: 73 e0 ldi r23, 0x03 ; 3 14cee: 82 e3 ldi r24, 0x32 ; 50 14cf0: 90 e0 ldi r25, 0x00 ; 0 14cf2: 0f 94 c5 31 call 0x2638a ; 0x2638a break; } #endif //FILAMENT_SENSOR } KEEPALIVE_STATE(IN_HANDLER); 14cf6: 32 e0 ldi r19, 0x02 ; 2 14cf8: 30 93 78 02 sts 0x0278, r19 ; 0x800278 M600_load_filament_movements(filament_name); 14cfc: ce 01 movw r24, r28 14cfe: 01 96 adiw r24, 0x01 ; 1 14d00: 0e 94 d5 6c call 0xd9aa ; 0xd9aa Sound_MakeCustom(50,1000,false); 14d04: 40 e0 ldi r20, 0x00 ; 0 14d06: 68 ee ldi r22, 0xE8 ; 232 14d08: 73 e0 ldi r23, 0x03 ; 3 14d0a: 82 e3 ldi r24, 0x32 ; 50 14d0c: 90 e0 ldi r25, 0x00 ; 0 14d0e: 0f 94 c5 31 call 0x2638a ; 0x2638a else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); mmu_M600_load_filament(automatic); } if (!automatic) 14d12: 11 11 cpse r17, r1 14d14: 9e c1 rjmp .+828 ; 0x15052 bool M600_check_state_and_repeat(const char* filament_name) { uint8_t lcd_change_filament_state = 10; while (lcd_change_filament_state != 0 && lcd_change_filament_state != 3) { KEEPALIVE_STATE(PAUSED_FOR_USER); 14d16: b4 e0 ldi r27, 0x04 ; 4 14d18: bb 2e mov r11, r27 14d1a: b0 92 78 02 sts 0x0278, r11 ; 0x800278 uint8_t lcd_alright() { uint8_t cursor_pos = 0; lcd_clear(); 14d1e: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_puts_at_P(1, 0, _T(MSG_CORRECTLY)); 14d22: 85 e8 ldi r24, 0x85 ; 133 14d24: 98 e3 ldi r25, 0x38 ; 56 14d26: 0e 94 b1 6c call 0xd962 ; 0xd962 14d2a: ac 01 movw r20, r24 14d2c: 60 e0 ldi r22, 0x00 ; 0 14d2e: 81 e0 ldi r24, 0x01 ; 1 14d30: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_puts_at_P(1, 1, _T(MSG_NOT_LOADED)); 14d34: 8f e6 ldi r24, 0x6F ; 111 14d36: 98 e3 ldi r25, 0x38 ; 56 14d38: 0e 94 b1 6c call 0xd962 ; 0xd962 14d3c: ac 01 movw r20, r24 14d3e: 61 e0 ldi r22, 0x01 ; 1 14d40: 81 e0 ldi r24, 0x01 ; 1 14d42: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_puts_at_P(1, 2, _T(MSG_NOT_COLOR)); 14d46: 8b e5 ldi r24, 0x5B ; 91 14d48: 98 e3 ldi r25, 0x38 ; 56 14d4a: 0e 94 b1 6c call 0xd962 ; 0xd962 14d4e: ac 01 movw r20, r24 14d50: 62 e0 ldi r22, 0x02 ; 2 14d52: 81 e0 ldi r24, 0x01 ; 1 14d54: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_puts_at_P(1, 3, _T(MSG_UNLOAD_FILAMENT)); 14d58: 8b e6 ldi r24, 0x6B ; 107 14d5a: 9c e3 ldi r25, 0x3C ; 60 14d5c: 0e 94 b1 6c call 0xd962 ; 0xd962 14d60: ac 01 movw r20, r24 14d62: 63 e0 ldi r22, 0x03 ; 3 14d64: 81 e0 ldi r24, 0x01 ; 1 14d66: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_putc_at(0, cursor_pos, '>'); 14d6a: 4e e3 ldi r20, 0x3E ; 62 14d6c: 60 e0 ldi r22, 0x00 ; 0 14d6e: 80 e0 ldi r24, 0x00 ; 0 14d70: 0e 94 9b 69 call 0xd336 ; 0xd336 lcd_consume_click(); 14d74: 0e 94 93 6b call 0xd726 ; 0xd726 uint8_t lcd_alright() { uint8_t cursor_pos = 0; 14d78: 00 e0 ldi r16, 0x00 ; 0 lcd_putc_at(0, cursor_pos, '>'); lcd_consume_click(); while (1) { manage_heater(); 14d7a: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(true); 14d7e: 81 e0 ldi r24, 0x01 ; 1 14d80: 0e 94 01 7a call 0xf402 ; 0xf402 if (lcd_encoder) 14d84: 80 91 06 05 lds r24, 0x0506 ; 0x800506 14d88: 90 91 07 05 lds r25, 0x0507 ; 0x800507 14d8c: 00 97 sbiw r24, 0x00 ; 0 14d8e: d9 f0 breq .+54 ; 0x14dc6 { if (lcd_encoder < 0 ) { 14d90: 97 ff sbrs r25, 7 14d92: 22 c1 rjmp .+580 ; 0x14fd8 // Rotating knob counter clockwise if (cursor_pos > 0) 14d94: 00 23 and r16, r16 14d96: 09 f4 brne .+2 ; 0x14d9a 14d98: 23 c1 rjmp .+582 ; 0x14fe0 cursor_pos--; 14d9a: 01 50 subi r16, 0x01 ; 1 else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); } // Update '>' render only lcd_puts_at_P(0, 0, PSTR(" \n \n \n ")); 14d9c: 47 e1 ldi r20, 0x17 ; 23 14d9e: 59 e7 ldi r21, 0x79 ; 121 14da0: 60 e0 ldi r22, 0x00 ; 0 14da2: 80 e0 ldi r24, 0x00 ; 0 14da4: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_putc_at(0, cursor_pos, '>'); 14da8: 4e e3 ldi r20, 0x3E ; 62 14daa: 60 2f mov r22, r16 14dac: 80 e0 ldi r24, 0x00 ; 0 14dae: 0e 94 9b 69 call 0xd336 ; 0xd336 // Consume rotation event and make feedback sound lcd_encoder = 0; 14db2: 10 92 07 05 sts 0x0507, r1 ; 0x800507 14db6: 10 92 06 05 sts 0x0506, r1 ; 0x800506 _delay(100); 14dba: 64 e6 ldi r22, 0x64 ; 100 14dbc: 70 e0 ldi r23, 0x00 ; 0 14dbe: 80 e0 ldi r24, 0x00 ; 0 14dc0: 90 e0 ldi r25, 0x00 ; 0 14dc2: 0f 94 7b 0d call 0x21af6 ; 0x21af6 } if (lcd_clicked()) 14dc6: 0e 94 98 6b call 0xd730 ; 0xd730 14dca: 88 23 and r24, r24 14dcc: b1 f2 breq .-84 ; 0x14d7a { lcd_clear(); 14dce: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_return_to_status(); 14dd2: 0e 94 17 fe call 0x1fc2e ; 0x1fc2e lcd_change_filament_state = lcd_alright(); KEEPALIVE_STATE(IN_HANDLER); 14dd6: 42 e0 ldi r20, 0x02 ; 2 14dd8: 40 93 78 02 sts 0x0278, r20 ; 0x800278 switch(lcd_change_filament_state) 14ddc: 02 30 cpi r16, 0x02 ; 2 14dde: 09 f4 brne .+2 ; 0x14de2 14de0: 08 c1 rjmp .+528 ; 0x14ff2 14de2: 03 30 cpi r16, 0x03 ; 3 14de4: 09 f4 brne .+2 ; 0x14de8 14de6: ed c1 rjmp .+986 ; 0x151c2 14de8: 01 30 cpi r16, 0x01 ; 1 14dea: 09 f0 breq .+2 ; 0x14dee 14dec: 21 c1 rjmp .+578 ; 0x15030 { // Filament failed to load so load it again case 1: if (MMU2::mmu2.Enabled()) { 14dee: 80 91 94 12 lds r24, 0x1294 ; 0x801294 14df2: 81 30 cpi r24, 0x01 ; 1 14df4: 09 f0 breq .+2 ; 0x14df8 14df6: f8 c0 rjmp .+496 ; 0x14fe8 uint8_t eject_slot = MMU2::mmu2.get_current_tool(); 14df8: 0f 94 92 41 call 0x28324 ; 0x28324 14dfc: 08 2f mov r16, r24 // Unload filament mmu_M600_unload_filament(); 14dfe: 0e 94 1c 6d call 0xda38 ; 0xda38 // Ask to remove any old filament and load new mmu_M600_filament_change_screen(eject_slot); 14e02: 80 2f mov r24, r16 14e04: 0e 94 6b 7c call 0xf8d6 ; 0xf8d6 // After user clicks knob, MMU will load the filament mmu_M600_load_filament(false); 14e08: 80 e0 ldi r24, 0x00 ; 0 14e0a: 0e 94 18 71 call 0xe230 ; 0xe230 14e0e: 85 cf rjmp .-246 ; 0x14d1a // In case a power panic happens while waiting for the user // take a partial back up of print state into RAM (current position, etc.) refresh_print_state_in_ram(); float x_position = FILAMENTCHANGE_XPOS; 14e10: 20 e0 ldi r18, 0x00 ; 0 14e12: 30 e0 ldi r19, 0x00 ; 0 14e14: 43 e5 ldi r20, 0x53 ; 83 14e16: 53 e4 ldi r21, 0x43 ; 67 14e18: 28 a7 std Y+40, r18 ; 0x28 14e1a: 39 a7 std Y+41, r19 ; 0x29 14e1c: 4a a7 std Y+42, r20 ; 0x2a 14e1e: 5b a7 std Y+43, r21 ; 0x2b 14e20: 48 ce rjmp .-880 ; 0x14ab2 float y_position = FILAMENTCHANGE_YPOS; 14e22: 1c a6 std Y+44, r1 ; 0x2c 14e24: 1d a6 std Y+45, r1 ; 0x2d 14e26: 1e a6 std Y+46, r1 ; 0x2e 14e28: 1f a6 std Y+47, r1 ; 0x2f 14e2a: 4f ce rjmp .-866 ; 0x14aca st_synchronize(); SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); } else { // Print is paused and the extruder may be cold // Filament change can be issued via the Tune menu restore_extruder_temperature_from_ram(); 14e2c: 0e 94 ab 5e call 0xbd56 ; 0xbd56 14e30: ae ce rjmp .-676 ; 0x14b8e //! //! Beep, manage nozzle heater and wait for user to start unload filament //! If times out, active extruder temperature is set to 0. void M600_wait_for_user() { KEEPALIVE_STATE(PAUSED_FOR_USER); 14e32: 84 e0 ldi r24, 0x04 ; 4 14e34: 80 93 78 02 sts 0x0278, r24 ; 0x800278 unsigned long waiting_start_time = _millis(); 14e38: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 14e3c: 2b 01 movw r4, r22 14e3e: 3c 01 movw r6, r24 uint8_t wait_for_user_state = 0; lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 14e40: 89 e0 ldi r24, 0x09 ; 9 14e42: 98 e3 ldi r25, 0x38 ; 56 14e44: 0e 94 b1 6c call 0xd962 ; 0xd962 14e48: 0f 94 c0 0a call 0x21580 ; 0x21580 while (!(wait_for_user_state == 0 && lcd_clicked())){ 14e4c: 0e 94 98 6b call 0xd730 ; 0xd730 14e50: 08 2f mov r16, r24 14e52: 81 11 cpse r24, r1 14e54: 34 c0 rjmp .+104 ; 0x14ebe switch (wait_for_user_state) { case 0: //nozzle is hot, waiting for user to press the knob to unload filament delay_keep_alive(4); if (_millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) { 14e56: a3 01 movw r20, r6 14e58: 92 01 movw r18, r4 14e5a: 20 54 subi r18, 0x40 ; 64 14e5c: 38 4d sbci r19, 0xD8 ; 216 14e5e: 46 4f sbci r20, 0xF6 ; 246 14e60: 5f 4f sbci r21, 0xFF ; 255 14e62: 28 a7 std Y+40, r18 ; 0x28 14e64: 39 a7 std Y+41, r19 ; 0x29 14e66: 4a a7 std Y+42, r20 ; 0x2a 14e68: 5b a7 std Y+43, r21 ; 0x2b unsigned long waiting_start_time = _millis(); uint8_t wait_for_user_state = 0; lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); while (!(wait_for_user_state == 0 && lcd_clicked())){ manage_heater(); 14e6a: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(true); 14e6e: 81 e0 ldi r24, 0x01 ; 1 14e70: 0e 94 01 7a call 0xf402 ; 0xf402 if (wait_for_user_state != 2) sound_wait_for_user(); 14e74: 02 30 cpi r16, 0x02 ; 2 14e76: 09 f4 brne .+2 ; 0x14e7a 14e78: 65 c0 rjmp .+202 ; 0x14f44 14e7a: 0f 94 cb 35 call 0x26b96 ; 0x26b96 st_synchronize(); disable_e0(); } break; case 1: //nozzle target temperature is set to zero, waiting for user to start nozzle preheat delay_keep_alive(4); 14e7e: 84 e0 ldi r24, 0x04 ; 4 14e80: 90 e0 ldi r25, 0x00 ; 0 while (!(wait_for_user_state == 0 && lcd_clicked())){ manage_heater(); manage_inactivity(true); if (wait_for_user_state != 2) sound_wait_for_user(); switch (wait_for_user_state) { 14e82: 01 30 cpi r16, 0x01 ; 1 14e84: 29 f1 breq .+74 ; 0x14ed0 case 0: //nozzle is hot, waiting for user to press the knob to unload filament delay_keep_alive(4); 14e86: 0e 94 48 7c call 0xf890 ; 0xf890 if (_millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) { 14e8a: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 14e8e: 28 a5 ldd r18, Y+40 ; 0x28 14e90: 39 a5 ldd r19, Y+41 ; 0x29 14e92: 4a a5 ldd r20, Y+42 ; 0x2a 14e94: 5b a5 ldd r21, Y+43 ; 0x2b 14e96: 26 17 cp r18, r22 14e98: 37 07 cpc r19, r23 14e9a: 48 07 cpc r20, r24 14e9c: 59 07 cpc r21, r25 14e9e: b0 f6 brcc .-84 ; 0x14e4c lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_PREHEAT)); 14ea0: 88 ed ldi r24, 0xD8 ; 216 14ea2: 97 e3 ldi r25, 0x37 ; 55 14ea4: 0e 94 b1 6c call 0xd962 ; 0xd962 14ea8: 0f 94 c0 0a call 0x21580 ; 0x21580 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 14eac: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 14eb0: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 wait_for_user_state = 1; setTargetHotend(0); st_synchronize(); 14eb4: 0f 94 42 22 call 0x24484 ; 0x24484 disable_e0(); 14eb8: 14 9a sbi 0x02, 4 ; 2 case 0: //nozzle is hot, waiting for user to press the knob to unload filament delay_keep_alive(4); if (_millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) { lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_PREHEAT)); wait_for_user_state = 1; 14eba: 01 e0 ldi r16, 0x01 ; 1 14ebc: d6 cf rjmp .-84 ; 0x14e6a 14ebe: 10 92 2b 05 sts 0x052B, r1 ; 0x80052b <_ZL10beep_timer.lto_priv.456> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 14ec2: 10 92 2e 05 sts 0x052E, r1 ; 0x80052e <_ZL6bFirst.lto_priv.457> eject_slot = MMU2::mmu2.get_current_tool(); mmu_M600_unload_filament(); } else { // Beep, manage nozzle heater and wait for user to start unload filament M600_wait_for_user(); unload_filament(e_shift_late); 14ec6: c7 01 movw r24, r14 14ec8: b6 01 movw r22, r12 14eca: 0e 94 4c f0 call 0x1e098 ; 0x1e098 14ece: 97 ce rjmp .-722 ; 0x14bfe st_synchronize(); disable_e0(); } break; case 1: //nozzle target temperature is set to zero, waiting for user to start nozzle preheat delay_keep_alive(4); 14ed0: 0e 94 48 7c call 0xf890 ; 0xf890 if (lcd_clicked()) { 14ed4: 0e 94 98 6b call 0xd730 ; 0xd730 14ed8: 88 23 and r24, r24 14eda: 39 f2 breq .-114 ; 0x14e6a 14edc: 80 91 ef 11 lds r24, 0x11EF ; 0x8011ef 14ee0: 90 91 f0 11 lds r25, 0x11F0 ; 0x8011f0 14ee4: 90 93 f2 11 sts 0x11F2, r25 ; 0x8011f2 14ee8: 80 93 f1 11 sts 0x11F1, r24 ; 0x8011f1 return target_temp_reached; } #endif //PINDA_THERMISTOR void lcd_wait_for_heater() { lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 14eec: 85 e4 ldi r24, 0x45 ; 69 14eee: 9e e4 ldi r25, 0x4E ; 78 14ef0: 0e 94 b1 6c call 0xd962 ; 0xd962 14ef4: 0f 94 c0 0a call 0x21580 ; 0x21580 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 14ef8: 42 e8 ldi r20, 0x82 ; 130 14efa: 64 e0 ldi r22, 0x04 ; 4 14efc: 80 e0 ldi r24, 0x00 ; 0 14efe: 0e 94 9b 69 call 0xd336 ; 0xd336 lcd_printf_P(PSTR("%3d/%3d"), (int16_t)degHotend(active_extruder), (int16_t) degTargetHotend(active_extruder)); 14f02: 80 91 f2 11 lds r24, 0x11F2 ; 0x8011f2 14f06: 8f 93 push r24 14f08: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 14f0c: 8f 93 push r24 14f0e: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 14f12: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 14f16: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 14f1a: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 14f1e: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 14f22: 7f 93 push r23 14f24: 6f 93 push r22 14f26: 3f 92 push r3 14f28: 2f 92 push r2 14f2a: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 lcd_putc(LCD_STR_DEGREE[0]); 14f2e: 81 e8 ldi r24, 0x81 ; 129 14f30: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 14f34: 0f 90 pop r0 14f36: 0f 90 pop r0 14f38: 0f 90 pop r0 14f3a: 0f 90 pop r0 14f3c: 0f 90 pop r0 14f3e: 0f 90 pop r0 setTargetHotend(saved_extruder_temperature); lcd_wait_for_heater(); wait_for_user_state = 2; 14f40: 02 e0 ldi r16, 0x02 ; 2 14f42: 93 cf rjmp .-218 ; 0x14e6a return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 14f44: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 14f48: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 14f4c: 07 2e mov r0, r23 14f4e: 00 0c add r0, r0 14f50: 88 0b sbc r24, r24 14f52: 99 0b sbc r25, r25 14f54: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> } break; case 2: //waiting for nozzle to reach target temperature if (fabs(degTargetHotend(active_extruder) - degHotend(active_extruder)) < TEMP_HYSTERESIS) { 14f58: 20 91 c4 0d lds r18, 0x0DC4 ; 0x800dc4 14f5c: 30 91 c5 0d lds r19, 0x0DC5 ; 0x800dc5 14f60: 40 91 c6 0d lds r20, 0x0DC6 ; 0x800dc6 14f64: 50 91 c7 0d lds r21, 0x0DC7 ; 0x800dc7 14f68: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 14f6c: 9f 77 andi r25, 0x7F ; 127 14f6e: 20 e0 ldi r18, 0x00 ; 0 14f70: 30 e0 ldi r19, 0x00 ; 0 14f72: 40 ea ldi r20, 0xA0 ; 160 14f74: 50 e4 ldi r21, 0x40 ; 64 14f76: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 14f7a: 87 ff sbrs r24, 7 14f7c: 0b c0 rjmp .+22 ; 0x14f94 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 14f7e: 89 e0 ldi r24, 0x09 ; 9 14f80: 98 e3 ldi r25, 0x38 ; 56 14f82: 0e 94 b1 6c call 0xd962 ; 0xd962 14f86: 0f 94 c0 0a call 0x21580 ; 0x21580 waiting_start_time = _millis(); 14f8a: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 14f8e: 2b 01 movw r4, r22 14f90: 3c 01 movw r6, r24 14f92: 5c cf rjmp .-328 ; 0x14e4c wait_for_user_state = 0; } else { lcd_set_cursor(1, 4); 14f94: 64 e0 ldi r22, 0x04 ; 4 14f96: 81 e0 ldi r24, 0x01 ; 1 14f98: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_printf_P(PSTR("%3d"), (int16_t)degHotend(active_extruder)); 14f9c: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 14fa0: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 14fa4: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 14fa8: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 14fac: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 14fb0: 7f 93 push r23 14fb2: 6f 93 push r22 14fb4: 9f 92 push r9 14fb6: 8f 92 push r8 14fb8: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 14fbc: 0f 90 pop r0 14fbe: 0f 90 pop r0 14fc0: 0f 90 pop r0 14fc2: 0f 90 pop r0 14fc4: 52 cf rjmp .-348 ; 0x14e6a } M600_load_filament(filament_name); } else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); 14fc6: 11 11 cpse r17, r1 14fc8: 03 c0 rjmp .+6 ; 0x14fd0 14fca: 8a 2d mov r24, r10 14fcc: 0e 94 6b 7c call 0xf8d6 ; 0xf8d6 mmu_M600_load_filament(automatic); 14fd0: 81 2f mov r24, r17 14fd2: 0e 94 18 71 call 0xe230 ; 0xe230 14fd6: 9d ce rjmp .-710 ; 0x14d12 cursor_pos--; else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); } else if (lcd_encoder > 0) { // Rotating knob clockwise if (cursor_pos < 3) 14fd8: 03 30 cpi r16, 0x03 ; 3 14fda: 10 f4 brcc .+4 ; 0x14fe0 cursor_pos++; 14fdc: 0f 5f subi r16, 0xFF ; 255 14fde: de ce rjmp .-580 ; 0x14d9c else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 14fe0: 87 e0 ldi r24, 0x07 ; 7 14fe2: 0f 94 9f 2c call 0x2593e ; 0x2593e 14fe6: da ce rjmp .-588 ; 0x14d9c mmu_M600_filament_change_screen(eject_slot); // After user clicks knob, MMU will load the filament mmu_M600_load_filament(false); } else { M600_load_filament_movements(filament_name); 14fe8: ce 01 movw r24, r28 14fea: 01 96 adiw r24, 0x01 ; 1 14fec: 0e 94 d5 6c call 0xd9aa ; 0xd9aa 14ff0: 94 ce rjmp .-728 ; 0x14d1a } break; // Filament loaded properly but color is not clear case 2: st_synchronize(); 14ff2: 0f 94 42 22 call 0x24484 ; 0x24484 load_filament_final_feed(); 14ff6: 0e 94 75 5e call 0xbcea ; 0xbcea void lcd_loading_color() { //we are extruding 25mm with feedrate 200mm/min -> 7.5 seconds for whole action, 0.375 s for one character lcd_clear(); 14ffa: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_puts_at_P(0, 0, _T(MSG_LOADING_COLOR)); 14ffe: 89 e9 ldi r24, 0x99 ; 153 15000: 98 e3 ldi r25, 0x38 ; 56 15002: 0e 94 b1 6c call 0xd962 ; 0xd962 15006: ac 01 movw r20, r24 15008: 60 e0 ldi r22, 0x00 ; 0 1500a: 80 e0 ldi r24, 0x00 ; 0 1500c: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 15010: 85 e6 ldi r24, 0x65 ; 101 15012: 99 e3 ldi r25, 0x39 ; 57 15014: 0e 94 b1 6c call 0xd962 ; 0xd962 15018: ac 01 movw r20, r24 1501a: 62 e0 ldi r22, 0x02 ; 2 1501c: 80 e0 ldi r24, 0x00 ; 0 1501e: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_loading_progress_bar((FILAMENTCHANGE_FINALFEED * 1000ul) / FILAMENTCHANGE_EFEED_FINAL); //show progress bar during filament loading slow sequence 15022: 87 e9 ldi r24, 0x97 ; 151 15024: 9d e1 ldi r25, 0x1D ; 29 15026: 0f 94 0b 0c call 0x21816 ; 0x21816 lcd_loading_color(); st_synchronize(); 1502a: 0f 94 42 22 call 0x24484 ; 0x24484 1502e: 75 ce rjmp .-790 ; 0x14d1a } void lcd_change_success() { lcd_clear(); 15030: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); 15034: 89 ea ldi r24, 0xA9 ; 169 15036: 98 e3 ldi r25, 0x38 ; 56 15038: 0e 94 b1 6c call 0xd962 ; 0xd962 1503c: ac 01 movw r20, r24 1503e: 62 e0 ldi r22, 0x02 ; 2 15040: 80 e0 ldi r24, 0x00 ; 0 15042: 0e 94 8f 69 call 0xd31e ; 0xd31e //! @brief Wait for user to check the state bool M600_check_state_and_repeat(const char* filament_name) { uint8_t lcd_change_filament_state = 10; while (lcd_change_filament_state != 0 && lcd_change_filament_state != 3) 15046: 00 23 and r16, r16 15048: 19 f0 breq .+6 ; 0x15050 1504a: 03 30 cpi r16, 0x03 ; 3 1504c: 09 f0 breq .+2 ; 0x15050 1504e: 65 ce rjmp .-822 ; 0x14d1a default: lcd_change_success(); break; } } return false; 15050: b1 2c mov r11, r1 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 15052: 84 e8 ldi r24, 0x84 ; 132 15054: 96 e1 ldi r25, 0x16 ; 22 15056: 0e 94 f0 6d call 0xdbe0 ; 0xdbe0 current_position[Y_AXIS] = y_position; plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); st_synchronize(); bool repeat = false; do { 1505a: b1 10 cpse r11, r1 1505c: c6 cd rjmp .-1140 ; 0x14bea if (!automatic) repeat = M600_check_state_and_repeat(filament_name); } while (repeat); lcd_update_enable(true); 1505e: 81 e0 ldi r24, 0x01 ; 1 15060: 0e 94 c0 69 call 0xd380 ; 0xd380 // Not let's go back to print fanSpeed = saved_fan_speed; 15064: 80 91 e8 11 lds r24, 0x11E8 ; 0x8011e8 15068: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 // Feed a little of filament to stabilize pressure if (!automatic) { 1506c: 11 11 cpse r17, r1 1506e: 27 c0 rjmp .+78 ; 0x150be if (printingIsPaused()) 15070: 0e 94 bd 60 call 0xc17a ; 0xc17a 15074: c0 90 01 12 lds r12, 0x1201 ; 0x801201 15078: d0 90 02 12 lds r13, 0x1202 ; 0x801202 1507c: e0 90 03 12 lds r14, 0x1203 ; 0x801203 15080: f0 90 04 12 lds r15, 0x1204 ; 0x801204 15084: 88 23 and r24, r24 15086: 09 f4 brne .+2 ; 0x1508a 15088: 9f c0 rjmp .+318 ; 0x151c8 { // Return to retracted state during a pause // @todo is retraction really needed? E-position is reverted a few lines below current_position[E_AXIS] -= default_retraction; 1508a: 20 e0 ldi r18, 0x00 ; 0 1508c: 30 e0 ldi r19, 0x00 ; 0 1508e: 40 e8 ldi r20, 0x80 ; 128 15090: 5f e3 ldi r21, 0x3F ; 63 15092: c7 01 movw r24, r14 15094: b6 01 movw r22, r12 15096: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1509a: 60 93 01 12 sts 0x1201, r22 ; 0x801201 1509e: 70 93 02 12 sts 0x1202, r23 ; 0x801202 150a2: 80 93 03 12 sts 0x1203, r24 ; 0x801203 150a6: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 150aa: 60 e0 ldi r22, 0x00 ; 0 150ac: 70 e0 ldi r23, 0x00 ; 0 150ae: 88 ee ldi r24, 0xE8 ; 232 150b0: 92 e4 ldi r25, 0x42 ; 66 150b2: 0f 94 70 84 call 0x308e0 ; 0x308e0 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 150b6: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 150ba: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED); } } // Move XY back plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_XYFEED); 150be: e0 90 fd 11 lds r14, 0x11FD ; 0x8011fd 150c2: f0 90 fe 11 lds r15, 0x11FE ; 0x8011fe 150c6: 00 91 ff 11 lds r16, 0x11FF ; 0x8011ff 150ca: 10 91 00 12 lds r17, 0x1200 ; 0x801200 150ce: 20 91 94 02 lds r18, 0x0294 ; 0x800294 150d2: 30 91 95 02 lds r19, 0x0295 ; 0x800295 150d6: 40 91 96 02 lds r20, 0x0296 ; 0x800296 150da: 50 91 97 02 lds r21, 0x0297 ; 0x800297 150de: 60 91 90 02 lds r22, 0x0290 ; 0x800290 150e2: 70 91 91 02 lds r23, 0x0291 ; 0x800291 150e6: 80 91 92 02 lds r24, 0x0292 ; 0x800292 150ea: 90 91 93 02 lds r25, 0x0293 ; 0x800293 150ee: 1f 92 push r1 150f0: 1f 92 push r1 150f2: 1f 92 push r1 150f4: 1f 92 push r1 150f6: 81 2c mov r8, r1 150f8: 91 2c mov r9, r1 150fa: e8 e4 ldi r30, 0x48 ; 72 150fc: ae 2e mov r10, r30 150fe: e2 e4 ldi r30, 0x42 ; 66 15100: be 2e mov r11, r30 15102: f1 e0 ldi r31, 0x01 ; 1 15104: cf 2e mov r12, r31 15106: f2 e1 ldi r31, 0x12 ; 18 15108: df 2e mov r13, r31 1510a: 0f 94 22 75 call 0x2ea44 ; 0x2ea44 st_synchronize(); 1510e: 0f 94 42 22 call 0x24484 ; 0x24484 // Move Z back plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_ZFEED); 15112: e0 90 98 02 lds r14, 0x0298 ; 0x800298 15116: f0 90 99 02 lds r15, 0x0299 ; 0x800299 1511a: 00 91 9a 02 lds r16, 0x029A ; 0x80029a 1511e: 10 91 9b 02 lds r17, 0x029B ; 0x80029b 15122: 20 91 94 02 lds r18, 0x0294 ; 0x800294 15126: 30 91 95 02 lds r19, 0x0295 ; 0x800295 1512a: 40 91 96 02 lds r20, 0x0296 ; 0x800296 1512e: 50 91 97 02 lds r21, 0x0297 ; 0x800297 15132: 60 91 90 02 lds r22, 0x0290 ; 0x800290 15136: 70 91 91 02 lds r23, 0x0291 ; 0x800291 1513a: 80 91 92 02 lds r24, 0x0292 ; 0x800292 1513e: 90 91 93 02 lds r25, 0x0293 ; 0x800293 15142: 1f 92 push r1 15144: 1f 92 push r1 15146: 1f 92 push r1 15148: 1f 92 push r1 1514a: 81 2c mov r8, r1 1514c: 91 2c mov r9, r1 1514e: a0 e7 ldi r26, 0x70 ; 112 15150: aa 2e mov r10, r26 15152: a1 e4 ldi r26, 0x41 ; 65 15154: ba 2e mov r11, r26 15156: 0f 94 22 75 call 0x2ea44 ; 0x2ea44 st_synchronize(); 1515a: 0f 94 42 22 call 0x24484 ; 0x24484 // Set E position to original plan_set_e_position(saved_pos[E_AXIS]); 1515e: 8c e9 ldi r24, 0x9C ; 156 15160: 92 e0 ldi r25, 0x02 ; 2 15162: 0f 94 c8 74 call 0x2e990 ; 0x2e990 memcpy(current_position, saved_pos, sizeof(saved_pos)); 15166: 80 e1 ldi r24, 0x10 ; 16 15168: e0 e9 ldi r30, 0x90 ; 144 1516a: f2 e0 ldi r31, 0x02 ; 2 1516c: a5 ef ldi r26, 0xF5 ; 245 1516e: b1 e1 ldi r27, 0x11 ; 17 15170: 01 90 ld r0, Z+ 15172: 0d 92 st X+, r0 15174: 8a 95 dec r24 15176: e1 f7 brne .-8 ; 0x15170 set_destination_to_current(); 15178: 0e 94 36 61 call 0xc26c ; 0xc26c // Recover feed rate feedmultiply = saved_feedmultiply2; 1517c: 80 91 f3 11 lds r24, 0x11F3 ; 0x8011f3 <_ZL19saved_feedmultiply2.lto_priv.502> 15180: 90 91 f4 11 lds r25, 0x11F4 ; 0x8011f4 <_ZL19saved_feedmultiply2.lto_priv.502+0x1> 15184: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e 15188: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f enquecommandf_P(MSG_M220, saved_feedmultiply2); 1518c: 9f 93 push r25 1518e: 8f 93 push r24 15190: 87 ed ldi r24, 0xD7 ; 215 15192: 94 e6 ldi r25, 0x64 ; 100 15194: 9f 93 push r25 15196: 8f 93 push r24 15198: 0e 94 4d 7d call 0xfa9a ; 0xfa9a if (printingIsPaused()) { 1519c: 0e 94 bd 60 call 0xc17a ; 0xc17a 151a0: 0f b6 in r0, 0x3f ; 63 151a2: f8 94 cli 151a4: de bf out 0x3e, r29 ; 62 151a6: 0f be out 0x3f, r0 ; 63 151a8: cd bf out 0x3d, r28 ; 61 151aa: 88 23 and r24, r24 151ac: 21 f1 breq .+72 ; 0x151f6 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 151ae: 8b ee ldi r24, 0xEB ; 235 151b0: 90 e4 ldi r25, 0x40 ; 64 151b2: 0e 94 b1 6c call 0xd962 ; 0xd962 151b6: 0e 94 65 e6 call 0x1ccca ; 0x1ccca } else { lcd_setstatuspgm(MSG_WELCOME); SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); } custom_message_type = CustomMsg::Status; 151ba: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 151be: 0c 94 12 98 jmp 0x13024 ; 0x13024 st_synchronize(); break; // Unload filament case 3: return true; 151c2: bb 24 eor r11, r11 151c4: b3 94 inc r11 151c6: 45 cf rjmp .-374 ; 0x15052 setTargetHotend(0); } else { // Feed a little of filament to stabilize pressure current_position[E_AXIS] += FILAMENTCHANGE_RECFEED; 151c8: 20 e0 ldi r18, 0x00 ; 0 151ca: 30 e0 ldi r19, 0x00 ; 0 151cc: 40 ea ldi r20, 0xA0 ; 160 151ce: 50 e4 ldi r21, 0x40 ; 64 151d0: c7 01 movw r24, r14 151d2: b6 01 movw r22, r12 151d4: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 151d8: 60 93 01 12 sts 0x1201, r22 ; 0x801201 151dc: 70 93 02 12 sts 0x1202, r23 ; 0x801202 151e0: 80 93 03 12 sts 0x1203, r24 ; 0x801203 151e4: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED); 151e8: 60 e0 ldi r22, 0x00 ; 0 151ea: 70 e0 ldi r23, 0x00 ; 0 151ec: 80 e0 ldi r24, 0x00 ; 0 151ee: 90 e4 ldi r25, 0x40 ; 64 151f0: 0f 94 70 84 call 0x308e0 ; 0x308e0 151f4: 64 cf rjmp .-312 ; 0x150be if (printingIsPaused()) { lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); } else { lcd_setstatuspgm(MSG_WELCOME); 151f6: 87 e6 ldi r24, 0x67 ; 103 151f8: 9b e6 ldi r25, 0x6B ; 107 151fa: 0e 94 65 e6 call 0x1ccca ; 0x1ccca SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); 151fe: 8c e7 ldi r24, 0x7C ; 124 15200: 97 e6 ldi r25, 0x67 ; 103 15202: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 15206: d9 cf rjmp .-78 ; 0x151ba SERIAL_ECHOPGM("Y:"); SERIAL_ECHOLN(pause_position[Y_AXIS]); SERIAL_ECHOPGM("Z:"); SERIAL_ECHOLN(pause_position[Z_AXIS]); */ if (!printingIsPaused()) { 15208: 0e 94 bd 60 call 0xc17a ; 0xc17a 1520c: 81 11 cpse r24, r1 1520e: 0c 94 12 98 jmp 0x13024 ; 0x13024 st_synchronize(); 15212: 0f 94 42 22 call 0x24484 ; 0x24484 ClearToSend(); //send OK even before the command finishes executing because we want to make sure it is not skipped because of cmdqueue_pop_front(); 15216: 0e 94 06 73 call 0xe60c ; 0xe60c cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore 1521a: 0e 94 d3 6f call 0xdfa6 ; 0xdfa6 lcd_pause_print(); 1521e: 0f 94 80 0f call 0x21f00 ; 0x21f00 15222: 0c 94 12 98 jmp 0x13024 ; 0x13024 /*! ### M602 - Resume print M602: Resume print */ case 602: { if (printingIsPaused()) lcd_resume_print(); 15226: 0e 94 bd 60 call 0xc17a ; 0xc17a 1522a: 88 23 and r24, r24 1522c: 11 f4 brne .+4 ; 0x15232 1522e: 0c 94 12 98 jmp 0x13024 ; 0x13024 15232: 0c 94 67 98 jmp 0x130ce ; 0x130ce SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); break; // invalid sheet ID } } else { iSel = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 15236: 81 ea ldi r24, 0xA1 ; 161 15238: 9d e0 ldi r25, 0x0D ; 13 1523a: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1523e: 18 2f mov r17, r24 } if (code_seen('Z')){ 15240: 8a e5 ldi r24, 0x5A ; 90 15242: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15246: 88 23 and r24, r24 15248: 09 f4 brne .+2 ; 0x1524c 1524a: d7 c0 rjmp .+430 ; 0x153fa z_val = code_value(); 1524c: 0e 94 03 5a call 0xb406 ; 0xb406 15250: 2b 01 movw r4, r22 15252: 3c 01 movw r6, r24 zraw = z_val*cs.axis_steps_per_mm[Z_AXIS]; 15254: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 15258: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 1525c: 40 91 40 04 lds r20, 0x0440 ; 0x800440 15260: 50 91 41 04 lds r21, 0x0441 ; 0x800441 15264: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 15268: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 1526c: 6b 01 movw r12, r22 if ((zraw < Z_BABYSTEP_MIN) || (zraw > Z_BABYSTEP_MAX)) 1526e: 9b 01 movw r18, r22 15270: 21 56 subi r18, 0x61 ; 97 15272: 30 4f sbci r19, 0xF0 ; 240 15274: 20 3a cpi r18, 0xA0 ; 160 15276: 3f 40 sbci r19, 0x0F ; 15 15278: 30 f0 brcs .+12 ; 0x15286 { SERIAL_PROTOCOLLNPGM(" Z VALUE OUT OF RANGE"); 1527a: 8d ed ldi r24, 0xDD ; 221 1527c: 9e e7 ldi r25, 0x7E ; 126 1527e: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 15282: 0c 94 12 98 jmp 0x13024 ; 0x13024 break; } eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[iSel].z_offset)),zraw); 15286: 5b e0 ldi r21, 0x0B ; 11 15288: 15 9f mul r17, r21 1528a: 90 01 movw r18, r0 1528c: 11 24 eor r1, r1 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 1528e: c9 01 movw r24, r18 15290: 80 5b subi r24, 0xB0 ; 176 15292: 92 4f sbci r25, 0xF2 ; 242 15294: 0f 94 1e a0 call 0x3403c ; 0x3403c { zraw = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base->s[iSel].z_offset))); z_val = ((float)zraw/cs.axis_steps_per_mm[Z_AXIS]); } if (code_seen('L')) 15298: 8c e4 ldi r24, 0x4C ; 76 1529a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1529e: bb e0 ldi r27, 0x0B ; 11 152a0: 1b 9f mul r17, r27 152a2: 70 01 movw r14, r0 152a4: 11 24 eor r1, r1 152a6: 57 01 movw r10, r14 152a8: e7 eb ldi r30, 0xB7 ; 183 152aa: ae 1a sub r10, r30 152ac: e2 ef ldi r30, 0xF2 ; 242 152ae: be 0a sbc r11, r30 152b0: 88 23 and r24, r24 152b2: 09 f4 brne .+2 ; 0x152b6 152b4: be c0 rjmp .+380 ; 0x15432 { char *src = strchr_pointer + 1; 152b6: e0 91 f5 16 lds r30, 0x16F5 ; 0x8016f5 152ba: f0 91 f6 16 lds r31, 0x16F6 ; 0x8016f6 152be: 31 96 adiw r30, 0x01 ; 1 152c0: bf 01 movw r22, r30 while (*src == ' ') ++src; 152c2: 81 91 ld r24, Z+ 152c4: 80 32 cpi r24, 0x20 ; 32 152c6: e1 f3 breq .-8 ; 0x152c0 if (*src != '\0') 152c8: 88 23 and r24, r24 152ca: 31 f0 breq .+12 ; 0x152d8 { strncpy(strLabel,src,7); 152cc: 47 e0 ldi r20, 0x07 ; 7 152ce: 50 e0 ldi r21, 0x00 ; 0 152d0: ce 01 movw r24, r28 152d2: 01 96 adiw r24, 0x01 ; 1 152d4: 0f 94 5c a6 call 0x34cb8 ; 0x34cb8 #endif //DEBUG_EEPROM_CHANGES } #ifndef DEBUG_EEPROM_CHANGES void eeprom_update_block_notify(const void *__src, void *__dst, size_t __n){ eeprom_update_block(__src, __dst, __n); 152d8: 47 e0 ldi r20, 0x07 ; 7 152da: 50 e0 ldi r21, 0x00 ; 0 152dc: b5 01 movw r22, r10 152de: ce 01 movw r24, r28 152e0: 01 96 adiw r24, 0x01 ; 1 152e2: 0f 94 f0 9f call 0x33fe0 ; 0x33fe0 else { eeprom_read_block(strLabel, EEPROM_Sheets_base->s[iSel].name, sizeof(Sheet::name)); } if (code_seen('B')) 152e6: 82 e4 ldi r24, 0x42 ; 66 152e8: 0e 94 2b 55 call 0xaa56 ; 0xaa56 152ec: 57 01 movw r10, r14 152ee: fe ea ldi r31, 0xAE ; 174 152f0: af 1a sub r10, r31 152f2: f2 ef ldi r31, 0xF2 ; 242 152f4: bf 0a sbc r11, r31 152f6: 88 23 and r24, r24 152f8: 09 f4 brne .+2 ; 0x152fc 152fa: a3 c0 rjmp .+326 ; 0x15442 { iBedC = code_value_uint8(); 152fc: 0e 94 40 55 call 0xaa80 ; 0xaa80 15300: 98 2e mov r9, r24 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 15302: 68 2f mov r22, r24 15304: c5 01 movw r24, r10 15306: 0f 94 00 a0 call 0x34000 ; 0x34000 else { iBedC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].bed_temp); } if (code_seen('P')) 1530a: 80 e5 ldi r24, 0x50 ; 80 1530c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15310: 2d ea ldi r18, 0xAD ; 173 15312: e2 1a sub r14, r18 15314: 22 ef ldi r18, 0xF2 ; 242 15316: f2 0a sbc r15, r18 15318: 88 23 and r24, r24 1531a: 09 f4 brne .+2 ; 0x1531e 1531c: 97 c0 rjmp .+302 ; 0x1544c { iPindaC = code_value_uint8(); 1531e: 0e 94 40 55 call 0xaa80 ; 0xaa80 15322: b8 2e mov r11, r24 15324: 68 2f mov r22, r24 15326: c7 01 movw r24, r14 15328: 0f 94 00 a0 call 0x34000 ; 0x34000 else { iPindaC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].pinda_temp); } if (code_seen('A')) 1532c: 81 e4 ldi r24, 0x41 ; 65 1532e: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15332: 88 23 and r24, r24 15334: 09 f4 brne .+2 ; 0x15338 15336: 8f c0 rjmp .+286 ; 0x15456 { bIsActive |= code_value_uint8() || (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 15338: 0e 94 40 55 call 0xaa80 ; 0xaa80 1533c: 81 11 cpse r24, r1 1533e: 06 c0 rjmp .+12 ; 0x1534c 15340: 81 ea ldi r24, 0xA1 ; 161 15342: 9d e0 ldi r25, 0x0D ; 13 15344: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 15348: 18 13 cpse r17, r24 1534a: 8d c0 rjmp .+282 ; 0x15466 if(bIsActive && eeprom_is_sheet_initialized(iSel)) { 1534c: 81 2f mov r24, r17 1534e: 0e 94 18 6f call 0xde30 ; 0xde30 15352: 08 2f mov r16, r24 15354: 88 23 and r24, r24 15356: 29 f0 breq .+10 ; 0x15362 15358: 61 2f mov r22, r17 1535a: 81 ea ldi r24, 0xA1 ; 161 1535c: 9d e0 ldi r25, 0x0D ; 13 1535e: 0f 94 00 a0 call 0x34000 ; 0x34000 else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); } SERIAL_PROTOCOLPGM("Sheet "); 15362: 86 ed ldi r24, 0xD6 ; 214 15364: 9e e7 ldi r25, 0x7E ; 126 15366: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1536a: 61 2f mov r22, r17 1536c: 70 e0 ldi r23, 0x00 ; 0 1536e: 90 e0 ldi r25, 0x00 ; 0 15370: 80 e0 ldi r24, 0x00 ; 0 15372: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_PROTOCOL((int)iSel); if (!eeprom_is_sheet_initialized(iSel)) 15376: 81 2f mov r24, r17 15378: 0e 94 18 6f call 0xde30 ; 0xde30 1537c: 81 11 cpse r24, r1 1537e: 04 c0 rjmp .+8 ; 0x15388 SERIAL_PROTOCOLLNPGM(" NOT INITIALIZED"); 15380: 85 ec ldi r24, 0xC5 ; 197 15382: 9e e7 ldi r25, 0x7E ; 126 15384: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 SERIAL_PROTOCOLPGM(" Z"); 15388: 82 ec ldi r24, 0xC2 ; 194 1538a: 9e e7 ldi r25, 0x7E ; 126 1538c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 15390: 44 e0 ldi r20, 0x04 ; 4 15392: c3 01 movw r24, r6 15394: b2 01 movw r22, r4 15396: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOL_F(z_val,4); SERIAL_PROTOCOLPGM(" R"); 1539a: 8f eb ldi r24, 0xBF ; 191 1539c: 9e e7 ldi r25, 0x7E ; 126 1539e: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 153a2: b6 01 movw r22, r12 153a4: dd 0c add r13, r13 153a6: 88 0b sbc r24, r24 153a8: 99 0b sbc r25, r25 153aa: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_PROTOCOL((int)zraw); SERIAL_PROTOCOLPGM(" L"); 153ae: 8c eb ldi r24, 0xBC ; 188 153b0: 9e e7 ldi r25, 0x7E ; 126 153b2: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 153b6: ce 01 movw r24, r28 153b8: 01 96 adiw r24, 0x01 ; 1 153ba: 0e 94 a3 7c call 0xf946 ; 0xf946 SERIAL_PROTOCOL(strLabel); SERIAL_PROTOCOLPGM(" B"); 153be: 89 eb ldi r24, 0xB9 ; 185 153c0: 9e e7 ldi r25, 0x7E ; 126 153c2: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 153c6: 69 2d mov r22, r9 153c8: 70 e0 ldi r23, 0x00 ; 0 153ca: 90 e0 ldi r25, 0x00 ; 0 153cc: 80 e0 ldi r24, 0x00 ; 0 153ce: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_PROTOCOL((int)iBedC); SERIAL_PROTOCOLPGM(" P"); 153d2: 86 eb ldi r24, 0xB6 ; 182 153d4: 9e e7 ldi r25, 0x7E ; 126 153d6: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 153da: 6b 2d mov r22, r11 153dc: 70 e0 ldi r23, 0x00 ; 0 153de: 90 e0 ldi r25, 0x00 ; 0 153e0: 80 e0 ldi r24, 0x00 ; 0 153e2: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_PROTOCOL((int)iPindaC); SERIAL_PROTOCOLPGM(" A"); 153e6: 83 eb ldi r24, 0xB3 ; 179 153e8: 9e e7 ldi r25, 0x7E ; 126 153ea: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_PROTOCOLLN((int)bIsActive); 153ee: 80 2f mov r24, r16 153f0: 90 e0 ldi r25, 0x00 ; 0 153f2: 0f 94 aa 41 call 0x28354 ; 0x28354 153f6: 0c 94 12 98 jmp 0x13024 ; 0x13024 } eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[iSel].z_offset)),zraw); } else { zraw = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base->s[iSel].z_offset))); 153fa: ab e0 ldi r26, 0x0B ; 11 153fc: 1a 9f mul r17, r26 153fe: c0 01 movw r24, r0 15400: 11 24 eor r1, r1 15402: 80 5b subi r24, 0xB0 ; 176 15404: 92 4f sbci r25, 0xF2 ; 242 15406: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 1540a: 6c 01 movw r12, r24 z_val = ((float)zraw/cs.axis_steps_per_mm[Z_AXIS]); 1540c: bc 01 movw r22, r24 1540e: 99 0f add r25, r25 15410: 88 0b sbc r24, r24 15412: 99 0b sbc r25, r25 15414: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 15418: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 1541c: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 15420: 40 91 40 04 lds r20, 0x0440 ; 0x800440 15424: 50 91 41 04 lds r21, 0x0441 ; 0x800441 15428: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1542c: 2b 01 movw r4, r22 1542e: 3c 01 movw r6, r24 15430: 33 cf rjmp .-410 ; 0x15298 } eeprom_update_block_notify(strLabel,EEPROM_Sheets_base->s[iSel].name,sizeof(Sheet::name)); } else { eeprom_read_block(strLabel, EEPROM_Sheets_base->s[iSel].name, sizeof(Sheet::name)); 15432: 47 e0 ldi r20, 0x07 ; 7 15434: 50 e0 ldi r21, 0x00 ; 0 15436: b5 01 movw r22, r10 15438: ce 01 movw r24, r28 1543a: 01 96 adiw r24, 0x01 ; 1 1543c: 0f 94 cc 9f call 0x33f98 ; 0x33f98 15440: 52 cf rjmp .-348 ; 0x152e6 iBedC = code_value_uint8(); eeprom_update_byte_notify(&EEPROM_Sheets_base->s[iSel].bed_temp, iBedC); } else { iBedC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].bed_temp); 15442: c5 01 movw r24, r10 15444: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 15448: 98 2e mov r9, r24 1544a: 5f cf rjmp .-322 ; 0x1530a iPindaC = code_value_uint8(); eeprom_update_byte_notify(&EEPROM_Sheets_base->s[iSel].pinda_temp, iPindaC); } else { iPindaC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].pinda_temp); 1544c: c7 01 movw r24, r14 1544e: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 15452: b8 2e mov r11, r24 15454: 6b cf rjmp .-298 ; 0x1532c bIsActive = 0; } } else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 15456: 81 ea ldi r24, 0xA1 ; 161 15458: 9d e0 ldi r25, 0x0D ; 13 1545a: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1545e: 01 e0 ldi r16, 0x01 ; 1 15460: 18 17 cp r17, r24 15462: 09 f4 brne .+2 ; 0x15466 15464: 7e cf rjmp .-260 ; 0x15362 { bIsActive |= code_value_uint8() || (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); if(bIsActive && eeprom_is_sheet_initialized(iSel)) { eeprom_update_byte_notify(&EEPROM_Sheets_base->active_sheet, iSel); } else { bIsActive = 0; 15466: 00 e0 ldi r16, 0x00 ; 0 15468: 7c cf rjmp .-264 ; 0x15362 */ case 860: { int set_target_pinda = 0; if (code_seen('S')) { 1546a: 83 e5 ldi r24, 0x53 ; 83 1546c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15470: 88 23 and r24, r24 15472: 11 f4 brne .+4 ; 0x15478 15474: 0c 94 12 98 jmp 0x13024 ; 0x13024 set_target_pinda = code_value_short(); 15478: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 1547c: 8c 01 movw r16, r24 } else { break; } LCD_MESSAGERPGM(_T(MSG_PLEASE_WAIT)); 1547e: 85 e6 ldi r24, 0x65 ; 101 15480: 99 e3 ldi r25, 0x39 ; 57 15482: 0e 94 b1 6c call 0xd962 ; 0xd962 15486: 0e 94 65 e6 call 0x1ccca ; 0x1ccca SERIAL_PROTOCOLPGM("Wait for PINDA target temperature:"); 1548a: 80 e9 ldi r24, 0x90 ; 144 1548c: 9e e7 ldi r25, 0x7E ; 126 1548e: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_PROTOCOLLN(set_target_pinda); 15492: c8 01 movw r24, r16 15494: 0f 94 aa 41 call 0x28354 ; 0x28354 codenum = _millis(); 15498: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 1549c: 4b 01 movw r8, r22 1549e: 5c 01 movw r10, r24 cancel_heatup = false; 154a0: 10 92 c9 0d sts 0x0DC9, r1 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.377> bool is_pinda_cooling = false; if (!(CHECK_ALL_HEATERS)) is_pinda_cooling = true; 154a4: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 154a8: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 154ac: 89 2b or r24, r25 154ae: 41 f4 brne .+16 ; 0x154c0 154b0: ff 24 eor r15, r15 154b2: f3 94 inc r15 154b4: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed 154b8: 90 91 ee 11 lds r25, 0x11EE ; 0x8011ee 154bc: 89 2b or r24, r25 154be: 09 f0 breq .+2 ; 0x154c2 SERIAL_PROTOCOLLN(set_target_pinda); codenum = _millis(); cancel_heatup = false; bool is_pinda_cooling = false; 154c0: f1 2c mov r15, r1 if (!(CHECK_ALL_HEATERS)) is_pinda_cooling = true; while ( ((!is_pinda_cooling) && (!cancel_heatup) && (current_temperature_pinda < set_target_pinda)) || (is_pinda_cooling && (current_temperature_pinda > set_target_pinda)) ) { 154c2: 28 01 movw r4, r16 154c4: 01 2e mov r0, r17 154c6: 00 0c add r0, r0 154c8: 66 08 sbc r6, r6 154ca: 77 08 sbc r7, r7 154cc: f1 10 cpse r15, r1 154ce: 1a c0 rjmp .+52 ; 0x15504 154d0: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.377> 154d4: 81 11 cpse r24, r1 154d6: 10 c0 rjmp .+32 ; 0x154f8 154d8: c3 01 movw r24, r6 154da: b2 01 movw r22, r4 154dc: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 154e0: 20 91 8e 06 lds r18, 0x068E ; 0x80068e 154e4: 30 91 8f 06 lds r19, 0x068F ; 0x80068f 154e8: 40 91 90 06 lds r20, 0x0690 ; 0x800690 154ec: 50 91 91 06 lds r21, 0x0691 ; 0x800691 154f0: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 154f4: 18 16 cp r1, r24 154f6: b4 f0 brlt .+44 ; 0x15524 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(MSG_OK); 154f8: 81 e3 ldi r24, 0x31 ; 49 154fa: 99 e6 ldi r25, 0x69 ; 105 154fc: 0e 94 65 e6 call 0x1ccca ; 0x1ccca 15500: 0c 94 12 98 jmp 0x13024 ; 0x13024 cancel_heatup = false; bool is_pinda_cooling = false; if (!(CHECK_ALL_HEATERS)) is_pinda_cooling = true; while ( ((!is_pinda_cooling) && (!cancel_heatup) && (current_temperature_pinda < set_target_pinda)) || (is_pinda_cooling && (current_temperature_pinda > set_target_pinda)) ) { 15504: c3 01 movw r24, r6 15506: b2 01 movw r22, r4 15508: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 1550c: 20 91 8e 06 lds r18, 0x068E ; 0x80068e 15510: 30 91 8f 06 lds r19, 0x068F ; 0x80068f 15514: 40 91 90 06 lds r20, 0x0690 ; 0x800690 15518: 50 91 91 06 lds r21, 0x0691 ; 0x800691 1551c: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 15520: 87 ff sbrs r24, 7 15522: ea cf rjmp .-44 ; 0x154f8 if ((_millis() - codenum) > 1000) //Print Temp Reading every 1 second while waiting. 15524: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 15528: 68 19 sub r22, r8 1552a: 79 09 sbc r23, r9 1552c: 8a 09 sbc r24, r10 1552e: 9b 09 sbc r25, r11 15530: 69 3e cpi r22, 0xE9 ; 233 15532: 73 40 sbci r23, 0x03 ; 3 15534: 81 05 cpc r24, r1 15536: 91 05 cpc r25, r1 15538: c8 f0 brcs .+50 ; 0x1556c { SERIAL_PROTOCOLPGM("P:"); 1553a: 8d e8 ldi r24, 0x8D ; 141 1553c: 9e e7 ldi r25, 0x7E ; 126 1553e: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 15542: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 15546: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 1554a: 80 91 90 06 lds r24, 0x0690 ; 0x800690 1554e: 90 91 91 06 lds r25, 0x0691 ; 0x800691 15552: 41 e0 ldi r20, 0x01 ; 1 15554: 0f 94 49 97 call 0x32e92 ; 0x32e92 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15558: 8f e2 ldi r24, 0x2F ; 47 1555a: 0e 94 41 70 call 0xe082 ; 0xe082 SERIAL_PROTOCOL_F(current_temperature_pinda, 1); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(set_target_pinda); 1555e: c8 01 movw r24, r16 15560: 0f 94 aa 41 call 0x28354 ; 0x28354 codenum = _millis(); 15564: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 15568: 4b 01 movw r8, r22 1556a: 5c 01 movw r10, r24 } manage_heater(); 1556c: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(); 15570: 80 e0 ldi r24, 0x00 ; 0 15572: 0e 94 01 7a call 0xf402 ; 0xf402 lcd_update(0); 15576: 80 e0 ldi r24, 0x00 ; 0 15578: 0e 94 42 69 call 0xd284 ; 0xd284 1557c: a7 cf rjmp .-178 ; 0x154cc - `S` - Microsteps - `I` - Table index */ case 861: { const char * const _header = PSTR("index, temp, ustep, um"); if (code_seen('?')) { // ? - Print out current EEPROM offset values 1557e: 8f e3 ldi r24, 0x3F ; 63 15580: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15584: 88 23 and r24, r24 15586: c9 f0 breq .+50 ; 0x155ba SERIAL_PROTOCOLPGM("PINDA cal status: "); 15588: 8a e7 ldi r24, 0x7A ; 122 1558a: 9e e7 ldi r25, 0x7E ; 126 1558c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 bool calibration_status_get(CalibrationStatus components); void calibration_status_set(CalibrationStatus components); void calibration_status_clear(CalibrationStatus components); // PINDA has an independent calibration flag inline bool calibration_status_pinda() { return eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA); } 15590: 86 ea ldi r24, 0xA6 ; 166 15592: 9f e0 ldi r25, 0x0F ; 15 15594: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 15598: 21 e0 ldi r18, 0x01 ; 1 1559a: 30 e0 ldi r19, 0x00 ; 0 1559c: 81 11 cpse r24, r1 1559e: 02 c0 rjmp .+4 ; 0x155a4 155a0: 30 e0 ldi r19, 0x00 ; 0 155a2: 20 e0 ldi r18, 0x00 ; 0 SERIAL_PROTOCOLLN(calibration_status_pinda()); 155a4: c9 01 movw r24, r18 155a6: 0f 94 aa 41 call 0x28354 ; 0x28354 SERIAL_PROTOCOLLNRPGM(_header); 155aa: 83 e6 ldi r24, 0x63 ; 99 155ac: 9e e7 ldi r25, 0x7E ; 126 155ae: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 gcode_M861_print_pinda_cal_eeprom(); 155b2: 0e 94 92 70 call 0xe124 ; 0xe124 155b6: 0c 94 12 98 jmp 0x13024 ; 0x13024 } else if (code_seen('!')) { // ! - Set factory default values 155ba: 81 e2 ldi r24, 0x21 ; 33 155bc: 0e 94 2b 55 call 0xaa56 ; 0xaa56 155c0: 88 23 and r24, r24 155c2: 49 f1 breq .+82 ; 0x15616 155c4: 61 e0 ldi r22, 0x01 ; 1 155c6: 86 ea ldi r24, 0xA6 ; 166 155c8: 9f e0 ldi r25, 0x0F ; 15 155ca: 0f 94 00 a0 call 0x34000 ; 0x34000 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 155ce: 68 e0 ldi r22, 0x08 ; 8 155d0: 70 e0 ldi r23, 0x00 ; 0 155d2: 80 eb ldi r24, 0xB0 ; 176 155d4: 9f e0 ldi r25, 0x0F ; 15 155d6: 0f 94 1e a0 call 0x3403c ; 0x3403c 155da: 68 e1 ldi r22, 0x18 ; 24 155dc: 70 e0 ldi r23, 0x00 ; 0 155de: 82 eb ldi r24, 0xB2 ; 178 155e0: 9f e0 ldi r25, 0x0F ; 15 155e2: 0f 94 1e a0 call 0x3403c ; 0x3403c 155e6: 60 e3 ldi r22, 0x30 ; 48 155e8: 70 e0 ldi r23, 0x00 ; 0 155ea: 84 eb ldi r24, 0xB4 ; 180 155ec: 9f e0 ldi r25, 0x0F ; 15 155ee: 0f 94 1e a0 call 0x3403c ; 0x3403c 155f2: 60 e5 ldi r22, 0x50 ; 80 155f4: 70 e0 ldi r23, 0x00 ; 0 155f6: 86 eb ldi r24, 0xB6 ; 182 155f8: 9f e0 ldi r25, 0x0F ; 15 155fa: 0f 94 1e a0 call 0x3403c ; 0x3403c 155fe: 68 e7 ldi r22, 0x78 ; 120 15600: 70 e0 ldi r23, 0x00 ; 0 15602: 88 eb ldi r24, 0xB8 ; 184 15604: 9f e0 ldi r25, 0x0F ; 15 15606: 0f 94 1e a0 call 0x3403c ; 0x3403c eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + 2, z_shift); z_shift = 80; //55C - 200um - 80usteps eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + 3, z_shift); z_shift = 120; //60C - 300um - 120usteps eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + 4, z_shift); SERIAL_PROTOCOLLNPGM("factory restored"); 1560a: 82 e5 ldi r24, 0x52 ; 82 1560c: 9e e7 ldi r25, 0x7E ; 126 1560e: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 15612: 0c 94 12 98 jmp 0x13024 ; 0x13024 } else if (code_seen('Z')) { // Z - Set all values to 0 (effectively disabling PINDA temperature compensation) 15616: 8a e5 ldi r24, 0x5A ; 90 15618: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1561c: 88 23 and r24, r24 1561e: c1 f0 breq .+48 ; 0x15650 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 15620: 61 e0 ldi r22, 0x01 ; 1 15622: 86 ea ldi r24, 0xA6 ; 166 15624: 9f e0 ldi r25, 0x0F ; 15 15626: 0f 94 00 a0 call 0x34000 ; 0x34000 1562a: 00 eb ldi r16, 0xB0 ; 176 1562c: 1f e0 ldi r17, 0x0F ; 15 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 1562e: 70 e0 ldi r23, 0x00 ; 0 15630: 60 e0 ldi r22, 0x00 ; 0 15632: c8 01 movw r24, r16 15634: 0f 94 1e a0 call 0x3403c ; 0x3403c 15638: 0e 5f subi r16, 0xFE ; 254 1563a: 1f 4f sbci r17, 0xFF ; 255 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 1); int16_t z_shift = 0; for (uint8_t i = 0; i < 5; i++) { 1563c: 0a 3b cpi r16, 0xBA ; 186 1563e: 4f e0 ldi r20, 0x0F ; 15 15640: 14 07 cpc r17, r20 15642: a9 f7 brne .-22 ; 0x1562e eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } SERIAL_PROTOCOLLNPGM("zerorized"); 15644: 88 e4 ldi r24, 0x48 ; 72 15646: 9e e7 ldi r25, 0x7E ; 126 15648: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 1564c: 0c 94 12 98 jmp 0x13024 ; 0x13024 } else if (code_seen('S')) { // Sxxx Iyyy - Set compensation ustep value S for compensation table index I 15650: 83 e5 ldi r24, 0x53 ; 83 15652: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15656: 88 23 and r24, r24 15658: 21 f1 breq .+72 ; 0x156a2 int16_t usteps = code_value_short(); 1565a: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 1565e: 8c 01 movw r16, r24 if (code_seen('I')) { 15660: 89 e4 ldi r24, 0x49 ; 73 15662: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15666: 88 23 and r24, r24 15668: 11 f4 brne .+4 ; 0x1566e 1566a: 0c 94 12 98 jmp 0x13024 ; 0x13024 uint8_t index = code_value_uint8(); 1566e: 0e 94 40 55 call 0xaa80 ; 0xaa80 if (index < 5) { 15672: 85 30 cpi r24, 0x05 ; 5 15674: 10 f0 brcs .+4 ; 0x1567a 15676: 0c 94 12 98 jmp 0x13024 ; 0x13024 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + index, usteps); 1567a: 90 e0 ldi r25, 0x00 ; 0 1567c: 88 52 subi r24, 0x28 ; 40 1567e: 98 4f sbci r25, 0xF8 ; 248 15680: b8 01 movw r22, r16 15682: 88 0f add r24, r24 15684: 99 1f adc r25, r25 15686: 0f 94 1e a0 call 0x3403c ; 0x3403c SERIAL_PROTOCOLLNRPGM(MSG_OK); 1568a: 81 e3 ldi r24, 0x31 ; 49 1568c: 99 e6 ldi r25, 0x69 ; 105 1568e: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 SERIAL_PROTOCOLLNRPGM(_header); 15692: 83 e6 ldi r24, 0x63 ; 99 15694: 9e e7 ldi r25, 0x7E ; 126 15696: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 gcode_M861_print_pinda_cal_eeprom(); 1569a: 0e 94 92 70 call 0xe124 ; 0xe124 1569e: 0c 94 12 98 jmp 0x13024 ; 0x13024 } } } else { SERIAL_PROTOCOLLNPGM("no valid command"); 156a2: 87 e3 ldi r24, 0x37 ; 55 156a4: 9e e7 ldi r25, 0x7E ; 126 156a6: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 156aa: 0c 94 12 98 jmp 0x13024 ; 0x13024 case 862: // M862: print checking { // Read the decimal by multiplying the float value by 10 e.g. 862.1 becomes 8621 // This method consumes less flash memory compared to checking the string length. ClPrintChecking nCommand = static_cast((uint16_t)(code_value()*10) - 8620u); switch(nCommand) 156ae: 64 30 cpi r22, 0x04 ; 4 156b0: 09 f4 brne .+2 ; 0x156b4 156b2: be c0 rjmp .+380 ; 0x15830 156b4: 65 30 cpi r22, 0x05 ; 5 156b6: 11 f0 breq .+4 ; 0x156bc 156b8: 0c 94 12 98 jmp 0x13024 ; 0x13024 fw_version_check(++strchr_pointer); else if(code_seen('Q')) SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); break; case ClPrintChecking::_Gcode: // ~ .5 if(code_seen('P')) 156bc: 80 e5 ldi r24, 0x50 ; 80 156be: 0e 94 2b 55 call 0xaa56 ; 0xaa56 156c2: 88 23 and r24, r24 156c4: 09 f4 brne .+2 ; 0x156c8 156c6: 3a c1 rjmp .+628 ; 0x1593c { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); 156c8: 0e 94 93 55 call 0xab26 ; 0xab26 done: return true; } void gcode_level_check(uint16_t nGcodeLevel) { if (oCheckGcode == ClCheckMode::_None) 156cc: 10 91 b6 03 lds r17, 0x03B6 ; 0x8003b6 156d0: 11 23 and r17, r17 156d2: 11 f4 brne .+4 ; 0x156d8 156d4: 0c 94 12 98 jmp 0x13024 ; 0x13024 return; if (nGcodeLevel <= (uint16_t)GCODE_LEVEL) 156d8: 62 30 cpi r22, 0x02 ; 2 156da: 71 05 cpc r23, r1 156dc: 10 f4 brcc .+4 ; 0x156e2 156de: 0c 94 12 98 jmp 0x13024 ; 0x13024 // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(GCODE_LEVEL); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nGcodeLevel); render_M862_warnings( 156e2: 8b ea ldi r24, 0xAB ; 171 156e4: 96 e3 ldi r25, 0x36 ; 54 156e6: 0e 94 b1 6c call 0xd962 ; 0xd962 156ea: 7c 01 movw r14, r24 156ec: 84 e8 ldi r24, 0x84 ; 132 156ee: 96 e3 ldi r25, 0x36 ; 54 156f0: 0e 94 b1 6c call 0xd962 ; 0xd962 156f4: 41 2f mov r20, r17 156f6: b7 01 movw r22, r14 156f8: 0e 94 df ef call 0x1dfbe ; 0x1dfbe 156fc: 0c 94 12 98 jmp 0x13024 ; 0x13024 ClPrintChecking nCommand = static_cast((uint16_t)(code_value()*10) - 8620u); switch(nCommand) { case ClPrintChecking::_Nozzle: // ~ .1 uint16_t nDiameter; if(code_seen('P')) 15700: 80 e5 ldi r24, 0x50 ; 80 15702: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15706: 88 23 and r24, r24 15708: a9 f0 breq .+42 ; 0x15734 { nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 1570a: 0e 94 03 5a call 0xb406 ; 0xb406 1570e: 20 e0 ldi r18, 0x00 ; 0 15710: 30 e0 ldi r19, 0x00 ; 0 15712: 4a e7 ldi r20, 0x7A ; 122 15714: 54 e4 ldi r21, 0x44 ; 68 15716: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1571a: 20 e0 ldi r18, 0x00 ; 0 1571c: 30 e0 ldi r19, 0x00 ; 0 1571e: 40 e0 ldi r20, 0x00 ; 0 15720: 5f e3 ldi r21, 0x3F ; 63 15722: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 15726: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> nozzle_diameter_check(nDiameter); 1572a: cb 01 movw r24, r22 1572c: 0e 94 1e f0 call 0x1e03c ; 0x1e03c 15730: 0c 94 12 98 jmp 0x13024 ; 0x13024 } else if(code_seen('Q')) 15734: 81 e5 ldi r24, 0x51 ; 81 15736: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1573a: 88 23 and r24, r24 1573c: 11 f4 brne .+4 ; 0x15742 1573e: 0c 94 12 98 jmp 0x13024 ; 0x13024 SERIAL_PROTOCOLLN((float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); 15742: 85 ea ldi r24, 0xA5 ; 165 15744: 9d e0 ldi r25, 0x0D ; 13 15746: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 1574a: bc 01 movw r22, r24 1574c: 90 e0 ldi r25, 0x00 ; 0 1574e: 80 e0 ldi r24, 0x00 ; 0 15750: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 15754: 20 e0 ldi r18, 0x00 ; 0 15756: 30 e0 ldi r19, 0x00 ; 0 15758: 4a e7 ldi r20, 0x7A ; 122 1575a: 54 e4 ldi r21, 0x44 ; 68 1575c: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 15760: 0f 94 8d 41 call 0x2831a ; 0x2831a 15764: 0c 94 12 98 jmp 0x13024 ; 0x13024 uint16_t nPrinterModel; nPrinterModel=(uint16_t)code_value_long(); // based on current state of MMU (active/stopped/connecting) perform a runtime update of the printer type printer_model_check(nPrinterModel, type); } else if(code_seen('Q')) 15768: 81 e5 ldi r24, 0x51 ; 81 1576a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1576e: 88 23 and r24, r24 15770: 11 f4 brne .+4 ; 0x15776 15772: 0c 94 12 98 jmp 0x13024 ; 0x13024 print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 15776: b8 01 movw r22, r16 15778: 90 e0 ldi r25, 0x00 ; 0 1577a: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 1577c: 4a e0 ldi r20, 0x0A ; 10 1577e: 0f 94 2c 96 call 0x32c58 ; 0x32c58 } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); 15782: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 15786: 0c 94 12 98 jmp 0x13024 ; 0x13024 return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 1578a: 80 91 94 12 lds r24, 0x1294 ; 0x801294 return _sPrinterMmuName; 1578e: 7b ef ldi r23, 0xFB ; 251 15790: e7 2e mov r14, r23 15792: 78 e7 ldi r23, 0x78 ; 120 15794: f7 2e mov r15, r23 return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 15796: 81 30 cpi r24, 0x01 ; 1 15798: 21 f0 breq .+8 ; 0x157a2 return _sPrinterMmuName; } else { return _sPrinterName; 1579a: 64 ef ldi r22, 0xF4 ; 244 1579c: e6 2e mov r14, r22 1579e: 68 e7 ldi r22, 0x78 ; 120 157a0: f6 2e mov r15, r22 SERIAL_PROTOCOLLN(type); } break; case ClPrintChecking::_Smodel: { // ~ .3 const char *type = sPrinterType(MMU2::mmu2.Enabled()); if(code_seen('P')) 157a2: 80 e5 ldi r24, 0x50 ; 80 157a4: 0e 94 2b 55 call 0xaa56 ; 0xaa56 157a8: 88 23 and r24, r24 157aa: b1 f1 breq .+108 ; 0x15818 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 157ac: 62 e2 ldi r22, 0x22 ; 34 157ae: 70 e0 ldi r23, 0x00 ; 0 157b0: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 157b4: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 157b8: 0f 94 33 a6 call 0x34c66 ; 0x34c66 157bc: 8c 01 movw r16, r24 if (!this->ptr) { 157be: 89 2b or r24, r25 157c0: d1 f0 breq .+52 ; 0x157f6 // First quote not found return; } // Skip the leading quote this->ptr++; 157c2: 0f 5f subi r16, 0xFF ; 255 157c4: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 157c6: 62 e2 ldi r22, 0x22 ; 34 157c8: 70 e0 ldi r23, 0x00 ; 0 157ca: c8 01 movw r24, r16 157cc: 0f 94 33 a6 call 0x34c66 ; 0x34c66 if(!pStrEnd) { 157d0: 00 97 sbiw r24, 0x00 ; 0 157d2: 89 f0 breq .+34 ; 0x157f6 // Second quote not found return; } this->len = pStrEnd - this->ptr; 157d4: d8 2e mov r13, r24 157d6: d0 1a sub r13, r16 157d8: c7 01 movw r24, r14 157da: 0f 94 9a 9d call 0x33b34 ; 0x33b34 <__strlen_P> unquoted_string smodel = unquoted_string(pStrPos); if(smodel.WasFound()) { const uint8_t compareLength = strlen_P(actualPrinterSModel); if(compareLength == smodel.GetLength()) { 157de: d8 12 cpse r13, r24 157e0: 0a c0 rjmp .+20 ; 0x157f6 if (strncmp_P(smodel.GetUnquotedString(), actualPrinterSModel, compareLength) == 0) return; 157e2: ac 01 movw r20, r24 157e4: 55 27 eor r21, r21 157e6: b7 01 movw r22, r14 157e8: c8 01 movw r24, r16 157ea: 0f 94 bb 9d call 0x33b76 ; 0x33b76 157ee: 89 2b or r24, r25 157f0: 11 f4 brne .+4 ; 0x157f6 157f2: 0c 94 12 98 jmp 0x13024 ; 0x13024 } } render_M862_warnings( 157f6: f0 90 b8 03 lds r15, 0x03B8 ; 0x8003b8 157fa: 89 e8 ldi r24, 0x89 ; 137 157fc: 97 e3 ldi r25, 0x37 ; 55 157fe: 0e 94 b1 6c call 0xd962 ; 0xd962 15802: 8c 01 movw r16, r24 15804: 8b e5 ldi r24, 0x5B ; 91 15806: 97 e3 ldi r25, 0x37 ; 55 15808: 0e 94 b1 6c call 0xd962 ; 0xd962 1580c: 4f 2d mov r20, r15 1580e: b8 01 movw r22, r16 15810: 0e 94 df ef call 0x1dfbe ; 0x1dfbe 15814: 0c 94 12 98 jmp 0x13024 ; 0x13024 { printer_smodel_check(strchr_pointer, type); } else if(code_seen('Q')) 15818: 81 e5 ldi r24, 0x51 ; 81 1581a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1581e: 88 23 and r24, r24 15820: 11 f4 brne .+4 ; 0x15826 15822: 0c 94 12 98 jmp 0x13024 ; 0x13024 SERIAL_PROTOCOLLNRPGM(type); 15826: c7 01 movw r24, r14 15828: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 1582c: 0c 94 12 98 jmp 0x13024 ; 0x13024 } break; case ClPrintChecking::_Version: // ~ .4 if(code_seen('P')) 15830: 80 e5 ldi r24, 0x50 ; 80 15832: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15836: 88 23 and r24, r24 15838: 09 f4 brne .+2 ; 0x1583c 1583a: 77 c0 rjmp .+238 ; 0x1592a fw_version_check(++strchr_pointer); 1583c: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 15840: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 15844: 01 96 adiw r24, 0x01 ; 1 15846: 90 93 f6 16 sts 0x16F6, r25 ; 0x8016f6 1584a: 80 93 f5 16 sts 0x16F5, r24 ; 0x8016f5 return ((uint8_t)ClCompareValue::_Less); return ((uint8_t)ClCompareValue::_Equal); } void fw_version_check(const char *pVersion) { if (oCheckVersion == ClCheckMode::_None) 1584e: 20 91 b7 03 lds r18, 0x03B7 ; 0x8003b7 15852: 22 23 and r18, r18 15854: 11 f4 brne .+4 ; 0x1585a 15856: 0c 94 12 98 jmp 0x13024 ; 0x13024 return; uint16_t aVersion[4]; uint8_t nCompareValueResult; parse_version(pVersion, aVersion); 1585a: be 01 movw r22, r28 1585c: 6f 5f subi r22, 0xFF ; 255 1585e: 7f 4f sbci r23, 0xFF ; 255 15860: 0e 94 17 e1 call 0x1c22e ; 0x1c22e nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6; 15864: 8a e0 ldi r24, 0x0A ; 10 15866: 90 e0 ldi r25, 0x00 ; 0 15868: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 1586c: 29 81 ldd r18, Y+1 ; 0x01 1586e: 3a 81 ldd r19, Y+2 ; 0x02 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 15870: 12 e0 ldi r17, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 15872: 82 17 cp r24, r18 15874: 93 07 cpc r25, r19 15876: 28 f0 brcs .+10 ; 0x15882 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 15878: 11 e0 ldi r17, 0x01 ; 1 1587a: 28 17 cp r18, r24 1587c: 39 07 cpc r19, r25 1587e: 08 f4 brcc .+2 ; 0x15882 15880: 10 e0 ldi r17, 0x00 ; 0 return; uint16_t aVersion[4]; uint8_t nCompareValueResult; parse_version(pVersion, aVersion); nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6; 15882: 12 95 swap r17 15884: 11 0f add r17, r17 15886: 11 0f add r17, r17 15888: 10 7c andi r17, 0xC0 ; 192 nCompareValueResult += mCompareValue(aVersion[1], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR)) << 4; 1588a: 8c e0 ldi r24, 0x0C ; 12 1588c: 90 e0 ldi r25, 0x00 ; 0 1588e: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 15892: ac 01 movw r20, r24 15894: 2b 81 ldd r18, Y+3 ; 0x03 15896: 3c 81 ldd r19, Y+4 ; 0x04 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 15898: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 1589a: 42 17 cp r20, r18 1589c: 53 07 cpc r21, r19 1589e: 28 f0 brcs .+10 ; 0x158aa return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 158a0: 81 e0 ldi r24, 0x01 ; 1 158a2: 24 17 cp r18, r20 158a4: 35 07 cpc r19, r21 158a6: 08 f4 brcc .+2 ; 0x158aa 158a8: 80 e0 ldi r24, 0x00 ; 0 uint16_t aVersion[4]; uint8_t nCompareValueResult; parse_version(pVersion, aVersion); nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6; nCompareValueResult += mCompareValue(aVersion[1], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR)) << 4; 158aa: 50 e1 ldi r21, 0x10 ; 16 158ac: 85 9f mul r24, r21 158ae: c0 01 movw r24, r0 158b0: 11 24 eor r1, r1 158b2: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[2], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_REVISION)) << 2; 158b4: 8e e0 ldi r24, 0x0E ; 14 158b6: 90 e0 ldi r25, 0x00 ; 0 158b8: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 158bc: ac 01 movw r20, r24 158be: 2d 81 ldd r18, Y+5 ; 0x05 158c0: 3e 81 ldd r19, Y+6 ; 0x06 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 158c2: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 158c4: 42 17 cp r20, r18 158c6: 53 07 cpc r21, r19 158c8: 28 f0 brcs .+10 ; 0x158d4 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 158ca: 81 e0 ldi r24, 0x01 ; 1 158cc: 24 17 cp r18, r20 158ce: 35 07 cpc r19, r21 158d0: 08 f4 brcc .+2 ; 0x158d4 158d2: 80 e0 ldi r24, 0x00 ; 0 uint16_t aVersion[4]; uint8_t nCompareValueResult; parse_version(pVersion, aVersion); nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6; nCompareValueResult += mCompareValue(aVersion[1], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR)) << 4; nCompareValueResult += mCompareValue(aVersion[2], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_REVISION)) << 2; 158d4: a4 e0 ldi r26, 0x04 ; 4 158d6: 8a 9f mul r24, r26 158d8: c0 01 movw r24, r0 158da: 11 24 eor r1, r1 158dc: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[3], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_FLAVOR)); 158de: 80 e1 ldi r24, 0x10 ; 16 158e0: 90 e0 ldi r25, 0x00 ; 0 158e2: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 158e6: ac 01 movw r20, r24 158e8: 2f 81 ldd r18, Y+7 ; 0x07 158ea: 38 85 ldd r19, Y+8 ; 0x08 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 158ec: 92 e0 ldi r25, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 158ee: 42 17 cp r20, r18 158f0: 53 07 cpc r21, r19 158f2: 28 f0 brcs .+10 ; 0x158fe return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 158f4: 91 e0 ldi r25, 0x01 ; 1 158f6: 24 17 cp r18, r20 158f8: 35 07 cpc r19, r21 158fa: 08 f4 brcc .+2 ; 0x158fe 158fc: 90 e0 ldi r25, 0x00 ; 0 uint8_t nCompareValueResult; parse_version(pVersion, aVersion); nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6; nCompareValueResult += mCompareValue(aVersion[1], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR)) << 4; nCompareValueResult += mCompareValue(aVersion[2], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_REVISION)) << 2; nCompareValueResult += mCompareValue(aVersion[3], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_FLAVOR)); 158fe: 19 0f add r17, r25 if (nCompareValueResult <= COMPARE_VALUE_EQUAL) 15900: 16 35 cpi r17, 0x56 ; 86 15902: 10 f4 brcc .+4 ; 0x15908 15904: 0c 94 12 98 jmp 0x13024 ; 0x13024 SERIAL_ECHO(aVersion[2]); SERIAL_ECHO('.'); SERIAL_ECHOLN(aVersion[3]); */ render_M862_warnings( 15908: f0 90 b7 03 lds r15, 0x03B7 ; 0x8003b7 1590c: 89 e1 ldi r24, 0x19 ; 25 1590e: 97 e3 ldi r25, 0x37 ; 55 15910: 0e 94 b1 6c call 0xd962 ; 0xd962 15914: 8c 01 movw r16, r24 15916: 83 ef ldi r24, 0xF3 ; 243 15918: 96 e3 ldi r25, 0x36 ; 54 1591a: 0e 94 b1 6c call 0xd962 ; 0xd962 1591e: 4f 2d mov r20, r15 15920: b8 01 movw r22, r16 15922: 0e 94 df ef call 0x1dfbe ; 0x1dfbe 15926: 0c 94 12 98 jmp 0x13024 ; 0x13024 else if(code_seen('Q')) 1592a: 81 e5 ldi r24, 0x51 ; 81 1592c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15930: 88 23 and r24, r24 15932: 11 f4 brne .+4 ; 0x15938 15934: 0c 94 12 98 jmp 0x13024 ; 0x13024 15938: 0c 94 d0 93 jmp 0x127a0 ; 0x127a0 { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); gcode_level_check(nGcodeLevel); } else if(code_seen('Q')) 1593c: 81 e5 ldi r24, 0x51 ; 81 1593e: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15942: 88 23 and r24, r24 15944: 11 f4 brne .+4 ; 0x1594a 15946: 0c 94 12 98 jmp 0x13024 ; 0x13024 SERIAL_PROTOCOLLN(GCODE_LEVEL); 1594a: 81 e0 ldi r24, 0x01 ; 1 1594c: 90 e0 ldi r25, 0x00 ; 0 1594e: 0f 94 aa 41 call 0x28354 ; 0x28354 15952: 0c 94 12 98 jmp 0x13024 ; 0x13024 * M900: Set and/or Get advance K factor * * K Set advance K factor */ inline void gcode_M900() { float newK = code_seen('K') ? code_value() : -2; 15956: 8b e4 ldi r24, 0x4B ; 75 15958: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1595c: c1 2c mov r12, r1 1595e: d1 2c mov r13, r1 15960: e1 2c mov r14, r1 15962: 50 ec ldi r21, 0xC0 ; 192 15964: f5 2e mov r15, r21 15966: 88 23 and r24, r24 15968: 49 f1 breq .+82 ; 0x159bc 1596a: 0e 94 03 5a call 0xb406 ; 0xb406 1596e: 6b 01 movw r12, r22 15970: 7c 01 movw r14, r24 if (newK >= 0 && newK < LA_K_MAX) extruder_advance_K = newK; else SERIAL_ECHOLNPGM("K out of allowed range!"); #else if (newK == 0) 15972: 20 e0 ldi r18, 0x00 ; 0 15974: 30 e0 ldi r19, 0x00 ; 0 15976: a9 01 movw r20, r18 15978: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1597c: 81 11 cpse r24, r1 1597e: 1e c0 rjmp .+60 ; 0x159bc { extruder_advance_K = 0; 15980: 10 92 e1 16 sts 0x16E1, r1 ; 0x8016e1 15984: 10 92 e2 16 sts 0x16E2, r1 ; 0x8016e2 15988: 10 92 e3 16 sts 0x16E3, r1 ; 0x8016e3 1598c: 10 92 e4 16 sts 0x16E4, r1 ; 0x8016e4 15990: 0e 94 e8 73 call 0xe7d0 ; 0xe7d0 else extruder_advance_K = newK; } #endif SERIAL_ECHO_START; 15994: 81 e6 ldi r24, 0x61 ; 97 15996: 9d e9 ldi r25, 0x9D ; 157 15998: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOPGM("Advance K="); 1599c: 81 ed ldi r24, 0xD1 ; 209 1599e: 98 e7 ldi r25, 0x78 ; 120 159a0: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLN(extruder_advance_K); 159a4: 60 91 e1 16 lds r22, 0x16E1 ; 0x8016e1 159a8: 70 91 e2 16 lds r23, 0x16E2 ; 0x8016e2 159ac: 80 91 e3 16 lds r24, 0x16E3 ; 0x8016e3 159b0: 90 91 e4 16 lds r25, 0x16E4 ; 0x8016e4 159b4: 0f 94 8d 41 call 0x2831a ; 0x2831a 159b8: 0c 94 12 98 jmp 0x13024 ; 0x13024 } float la10c_value(float k) { if(la10c_mode == LA10C_UNKNOWN) 159bc: 80 91 45 03 lds r24, 0x0345 ; 0x800345 159c0: 81 11 cpse r24, r1 159c2: 1b c0 rjmp .+54 ; 0x159fa { // do not autodetect until a valid value is seen if(k == 0) return 0; else if(k < 0) 159c4: 20 e0 ldi r18, 0x00 ; 0 159c6: 30 e0 ldi r19, 0x00 ; 0 159c8: a9 01 movw r20, r18 159ca: c7 01 movw r24, r14 159cc: b6 01 movw r22, r12 159ce: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 159d2: 87 ff sbrs r24, 7 159d4: 05 c0 rjmp .+10 ; 0x159e0 } else { newK = la10c_value(newK); if (newK < 0) SERIAL_ECHOLNPGM("K out of allowed range!"); 159d6: 8c ed ldi r24, 0xDC ; 220 159d8: 98 e7 ldi r25, 0x78 ; 120 159da: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 159de: da cf rjmp .-76 ; 0x15994 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 159e0: 20 e0 ldi r18, 0x00 ; 0 159e2: 30 e0 ldi r19, 0x00 ; 0 159e4: 40 e2 ldi r20, 0x20 ; 32 159e6: 51 e4 ldi r21, 0x41 ; 65 159e8: c7 01 movw r24, r14 159ea: b6 01 movw r22, r12 159ec: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 159f0: 87 ff sbrs r24, 7 159f2: 2c c0 rjmp .+88 ; 0x15a4c 159f4: 81 e0 ldi r24, 0x01 ; 1 159f6: 0e 94 e8 73 call 0xe7d0 ; 0xe7d0 } if(la10c_mode == LA10C_LA15) 159fa: 80 91 45 03 lds r24, 0x0345 ; 0x800345 return (k >= 0 && k < LA_K_MAX? k: -1); 159fe: 20 e0 ldi r18, 0x00 ; 0 15a00: 30 e0 ldi r19, 0x00 ; 0 15a02: a9 01 movw r20, r18 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); } if(la10c_mode == LA10C_LA15) 15a04: 81 30 cpi r24, 0x01 ; 1 15a06: 21 f5 brne .+72 ; 0x15a50 return (k >= 0 && k < LA_K_MAX? k: -1); 15a08: c7 01 movw r24, r14 15a0a: b6 01 movw r22, r12 15a0c: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 15a10: 87 fd sbrc r24, 7 15a12: e1 cf rjmp .-62 ; 0x159d6 15a14: 20 e0 ldi r18, 0x00 ; 0 15a16: 30 e0 ldi r19, 0x00 ; 0 15a18: 40 e2 ldi r20, 0x20 ; 32 15a1a: 51 e4 ldi r21, 0x41 ; 65 15a1c: c7 01 movw r24, r14 15a1e: b6 01 movw r22, r12 15a20: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 15a24: 87 ff sbrs r24, 7 15a26: d7 cf rjmp .-82 ; 0x159d6 la10c_reset(); } else { newK = la10c_value(newK); if (newK < 0) 15a28: 20 e0 ldi r18, 0x00 ; 0 15a2a: 30 e0 ldi r19, 0x00 ; 0 15a2c: a9 01 movw r20, r18 15a2e: c7 01 movw r24, r14 15a30: b6 01 movw r22, r12 15a32: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 15a36: 87 fd sbrc r24, 7 15a38: ce cf rjmp .-100 ; 0x159d6 SERIAL_ECHOLNPGM("K out of allowed range!"); else extruder_advance_K = newK; 15a3a: c0 92 e1 16 sts 0x16E1, r12 ; 0x8016e1 15a3e: d0 92 e2 16 sts 0x16E2, r13 ; 0x8016e2 15a42: e0 92 e3 16 sts 0x16E3, r14 ; 0x8016e3 15a46: f0 92 e4 16 sts 0x16E4, r15 ; 0x8016e4 15a4a: a4 cf rjmp .-184 ; 0x15994 if(k == 0) return 0; else if(k < 0) return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 15a4c: 82 e0 ldi r24, 0x02 ; 2 15a4e: d3 cf rjmp .-90 ; 0x159f6 } if(la10c_mode == LA10C_LA15) return (k >= 0 && k < LA_K_MAX? k: -1); else return (k >= 0? la10c_convert(k): -1); 15a50: c7 01 movw r24, r14 15a52: b6 01 movw r22, r12 15a54: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 15a58: 87 fd sbrc r24, 7 15a5a: bd cf rjmp .-134 ; 0x159d6 // Approximate a LA10 value to a LA15 equivalent. static float la10c_convert(float k) { float new_K = k * 0.002 - 0.01; 15a5c: 2f e6 ldi r18, 0x6F ; 111 15a5e: 32 e1 ldi r19, 0x12 ; 18 15a60: 43 e0 ldi r20, 0x03 ; 3 15a62: 5b e3 ldi r21, 0x3B ; 59 15a64: c7 01 movw r24, r14 15a66: b6 01 movw r22, r12 15a68: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 15a6c: 2a e0 ldi r18, 0x0A ; 10 15a6e: 37 ed ldi r19, 0xD7 ; 215 15a70: 43 e2 ldi r20, 0x23 ; 35 15a72: 5c e3 ldi r21, 0x3C ; 60 15a74: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 15a78: 6b 01 movw r12, r22 15a7a: 7c 01 movw r14, r24 return new_K < 0? 0: 15a7c: 20 e0 ldi r18, 0x00 ; 0 15a7e: 30 e0 ldi r19, 0x00 ; 0 15a80: a9 01 movw r20, r18 15a82: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 15a86: 87 fd sbrc r24, 7 15a88: 11 c0 rjmp .+34 ; 0x15aac new_K > (LA_K_MAX - FLT_EPSILON)? (LA_K_MAX - FLT_EPSILON): 15a8a: 20 e0 ldi r18, 0x00 ; 0 15a8c: 30 e0 ldi r19, 0x00 ; 0 15a8e: 40 e2 ldi r20, 0x20 ; 32 15a90: 51 e4 ldi r21, 0x41 ; 65 15a92: c7 01 movw r24, r14 15a94: b6 01 movw r22, r12 15a96: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 15a9a: 18 16 cp r1, r24 15a9c: 2c f6 brge .-118 ; 0x15a28 15a9e: c1 2c mov r12, r1 15aa0: d1 2c mov r13, r1 15aa2: 40 e2 ldi r20, 0x20 ; 32 15aa4: e4 2e mov r14, r20 15aa6: 41 e4 ldi r20, 0x41 ; 65 15aa8: f4 2e mov r15, r20 15aaa: c7 cf rjmp .-114 ; 0x15a3a // Approximate a LA10 value to a LA15 equivalent. static float la10c_convert(float k) { float new_K = k * 0.002 - 0.01; return new_K < 0? 0: 15aac: c1 2c mov r12, r1 15aae: d1 2c mov r13, r1 15ab0: 76 01 movw r14, r12 15ab2: c3 cf rjmp .-122 ; 0x15a3a } } reset_acceleration_rates(); #else //TMC2130 #if defined(X_MS1_PIN) && X_MS1_PIN > -1 if(code_seen('S')) for(int i=0;i<=4;i++) microstep_mode(i,code_value()); 15ab4: 83 e5 ldi r24, 0x53 ; 83 15ab6: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15aba: 88 23 and r24, r24 15abc: 59 f0 breq .+22 ; 0x15ad4 15abe: 10 e0 ldi r17, 0x00 ; 0 15ac0: 0e 94 03 5a call 0xb406 ; 0xb406 15ac4: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 15ac8: 81 2f mov r24, r17 15aca: 0f 94 78 21 call 0x242f0 ; 0x242f0 15ace: 1f 5f subi r17, 0xFF ; 255 15ad0: 15 30 cpi r17, 0x05 ; 5 15ad2: b1 f7 brne .-20 ; 0x15ac0 15ad4: 34 ec ldi r19, 0xC4 ; 196 15ad6: e3 2e mov r14, r19 15ad8: 32 e0 ldi r19, 0x02 ; 2 15ada: f3 2e mov r15, r19 15adc: 10 e0 ldi r17, 0x00 ; 0 for(int i=0;i 15ae8: 88 23 and r24, r24 15aea: 39 f0 breq .+14 ; 0x15afa 15aec: 0e 94 03 5a call 0xb406 ; 0xb406 15af0: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 15af4: 81 2f mov r24, r17 15af6: 0f 94 78 21 call 0x242f0 ; 0x242f0 15afa: 1f 5f subi r17, 0xFF ; 255 15afc: 14 30 cpi r17, 0x04 ; 4 15afe: 79 f7 brne .-34 ; 0x15ade if(code_seen('B')) microstep_mode(4,code_value()); 15b00: 82 e4 ldi r24, 0x42 ; 66 15b02: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15b06: 88 23 and r24, r24 15b08: 39 f0 breq .+14 ; 0x15b18 15b0a: 0e 94 03 5a call 0xb406 ; 0xb406 15b0e: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 15b12: 84 e0 ldi r24, 0x04 ; 4 15b14: 0f 94 78 21 call 0x242f0 ; 0x242f0 microstep_readings(); 15b18: 0f 94 9e 20 call 0x2413c ; 0x2413c 15b1c: 0c 94 12 98 jmp 0x13024 ; 0x13024 15b20: 24 ec ldi r18, 0xC4 ; 196 15b22: e2 2e mov r14, r18 15b24: 22 e0 ldi r18, 0x02 ; 2 15b26: f2 2e mov r15, r18 - `B` - new pin value */ case 351: { #if defined(X_MS1_PIN) && X_MS1_PIN > -1 if(code_seen('S')) switch((int)code_value()) 15b28: 10 e0 ldi r17, 0x00 ; 0 { case 1: for(int i=0;i 15b34: 88 23 and r24, r24 15b36: 41 f0 breq .+16 ; 0x15b48 15b38: 0e 94 03 5a call 0xb406 ; 0xb406 15b3c: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 15b40: 4f ef ldi r20, 0xFF ; 255 15b42: 81 2f mov r24, r17 15b44: 0f 94 f9 20 call 0x241f2 ; 0x241f2 15b48: 1f 5f subi r17, 0xFF ; 255 15b4a: 14 30 cpi r17, 0x04 ; 4 15b4c: 71 f7 brne .-36 ; 0x15b2a if(code_seen('B')) microstep_ms(4,code_value(),-1); 15b4e: 82 e4 ldi r24, 0x42 ; 66 15b50: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15b54: 88 23 and r24, r24 15b56: 11 f4 brne .+4 ; 0x15b5c 15b58: 0c 94 4f 96 jmp 0x12c9e ; 0x12c9e 15b5c: 0e 94 03 5a call 0xb406 ; 0xb406 15b60: 0c 94 4f 96 jmp 0x12c9e ; 0x12c9e 15b64: 94 ec ldi r25, 0xC4 ; 196 15b66: e9 2e mov r14, r25 15b68: 92 e0 ldi r25, 0x02 ; 2 15b6a: f9 2e mov r15, r25 - `B` - new pin value */ case 351: { #if defined(X_MS1_PIN) && X_MS1_PIN > -1 if(code_seen('S')) switch((int)code_value()) 15b6c: 10 e0 ldi r17, 0x00 ; 0 case 1: for(int i=0;i 15b78: 88 23 and r24, r24 15b7a: 49 f0 breq .+18 ; 0x15b8e 15b7c: 0e 94 03 5a call 0xb406 ; 0xb406 15b80: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 15b84: 46 2f mov r20, r22 15b86: 6f ef ldi r22, 0xFF ; 255 15b88: 81 2f mov r24, r17 15b8a: 0f 94 f9 20 call 0x241f2 ; 0x241f2 15b8e: 1f 5f subi r17, 0xFF ; 255 15b90: 14 30 cpi r17, 0x04 ; 4 15b92: 69 f7 brne .-38 ; 0x15b6e 15b94: dc cf rjmp .-72 ; 0x15b4e case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; if( MMU2::mmu2.Enabled() ) 15b96: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15b9a: 81 30 cpi r24, 0x01 ; 1 15b9c: c1 f1 breq .+112 ; 0x15c0e - `L` - Extrude distance for insertion (positive value)(manual reload) - `Z` - Move the Z axis by this distance. Default value is 0 to maintain backwards compatibility with older gcodes. */ case 701: { uint8_t mmuSlotIndex = 0xffU; 15b9e: 1f ef ldi r17, 0xFF ; 255 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 15ba0: 8c e4 ldi r24, 0x4C ; 76 15ba2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15ba6: 88 23 and r24, r24 15ba8: 09 f4 brne .+2 ; 0x15bac 15baa: 40 c0 rjmp .+128 ; 0x15c2c 15bac: 0e 94 03 5a call 0xb406 ; 0xb406 15bb0: 6b 01 movw r12, r22 15bb2: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 15bb4: 8a e5 ldi r24, 0x5A ; 90 15bb6: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15bba: 88 23 and r24, r24 15bbc: f1 f1 breq .+124 ; 0x15c3a 15bbe: 0e 94 03 5a call 0xb406 ; 0xb406 15bc2: 9f 77 andi r25, 0x7F ; 127 // Raise the Z axis float delta = raise_z(z_target); 15bc4: 0e 94 dd 66 call 0xcdba ; 0xcdba 15bc8: 4b 01 movw r8, r22 15bca: 5c 01 movw r10, r24 // Load filament gcode_M701(fastLoadLength, mmuSlotIndex, !code_seen('Z')); // if no z -> trigger MIN_Z_FOR_LOAD for backwards compatibility on 3.12 and older FW 15bcc: 8a e5 ldi r24, 0x5A ; 90 15bce: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15bd2: 08 2f mov r16, r24 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 15bd4: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 15bd8: 10 92 85 16 sts 0x1685, r1 ; 0x801685 } void gcode_M701(float fastLoadLength, uint8_t mmuSlotIndex, bool raise_z_axis = false){ FSensorBlockRunout fsBlockRunout; prusa_statistics(22); 15bdc: 86 e1 ldi r24, 0x16 ; 22 15bde: 0f 94 ff 97 call 0x32ffe ; 0x32ffe if (MMU2::mmu2.Enabled()) { 15be2: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15be6: 81 30 cpi r24, 0x01 ; 1 15be8: 61 f5 brne .+88 ; 0x15c42 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { 15bea: 15 30 cpi r17, 0x05 ; 5 15bec: 18 f4 brcc .+6 ; 0x15bf4 MMU2::mmu2.load_filament_to_nozzle(mmuSlotIndex); 15bee: 81 2f mov r24, r17 15bf0: 0e 94 f9 f6 call 0x1edf2 ; 0x1edf2 lcd_update(2); lcd_setstatuspgm(MSG_WELCOME); custom_message_type = CustomMsg::Status; } eFilamentAction = FilamentAction::None; 15bf4: 10 92 62 03 sts 0x0362, r1 ; 0x800362 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 15bf8: 84 e8 ldi r24, 0x84 ; 132 15bfa: 96 e1 ldi r25, 0x16 ; 22 15bfc: 0e 94 f0 6d call 0xdbe0 ; 0xdbe0 // Load filament gcode_M701(fastLoadLength, mmuSlotIndex, !code_seen('Z')); // if no z -> trigger MIN_Z_FOR_LOAD for backwards compatibility on 3.12 and older FW // Restore Z axis raise_z(-delta); 15c00: c5 01 movw r24, r10 15c02: b4 01 movw r22, r8 15c04: 90 58 subi r25, 0x80 ; 128 15c06: 0e 94 dd 66 call 0xcdba ; 0xcdba 15c0a: 0c 94 12 98 jmp 0x13024 ; 0x13024 uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; if( MMU2::mmu2.Enabled() ) { if( code_seen('P') || code_seen('T') ) { 15c0e: 80 e5 ldi r24, 0x50 ; 80 15c10: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15c14: 88 23 and r24, r24 15c16: 21 f0 breq .+8 ; 0x15c20 mmuSlotIndex = code_value_uint8(); 15c18: 0e 94 40 55 call 0xaa80 ; 0xaa80 15c1c: 18 2f mov r17, r24 15c1e: c0 cf rjmp .-128 ; 0x15ba0 uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; if( MMU2::mmu2.Enabled() ) { if( code_seen('P') || code_seen('T') ) { 15c20: 84 e5 ldi r24, 0x54 ; 84 15c22: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15c26: 81 11 cpse r24, r1 15c28: f7 cf rjmp .-18 ; 0x15c18 15c2a: b9 cf rjmp .-142 ; 0x15b9e - `Z` - Move the Z axis by this distance. Default value is 0 to maintain backwards compatibility with older gcodes. */ case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU 15c2c: c1 2c mov r12, r1 15c2e: d1 2c mov r13, r1 15c30: 8c e8 ldi r24, 0x8C ; 140 15c32: e8 2e mov r14, r24 15c34: 82 e4 ldi r24, 0x42 ; 66 15c36: f8 2e mov r15, r24 15c38: bd cf rjmp .-134 ; 0x15bb4 float z_target = 0; 15c3a: 60 e0 ldi r22, 0x00 ; 0 15c3c: 70 e0 ldi r23, 0x00 ; 0 15c3e: cb 01 movw r24, r22 15c40: c1 cf rjmp .-126 ; 0x15bc4 if (MMU2::mmu2.Enabled()) { if (mmuSlotIndex < MMU_FILAMENT_COUNT) { MMU2::mmu2.load_filament_to_nozzle(mmuSlotIndex); } // else do nothing } else { custom_message_type = CustomMsg::FilamentLoading; 15c42: 82 e0 ldi r24, 0x02 ; 2 15c44: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT)); 15c48: 82 e0 ldi r24, 0x02 ; 2 15c4a: 9a e5 ldi r25, 0x5A ; 90 15c4c: 0e 94 b1 6c call 0xd962 ; 0xd962 15c50: 0e 94 65 e6 call 0x1ccca ; 0x1ccca current_position[E_AXIS] += fastLoadLength; 15c54: a7 01 movw r20, r14 15c56: 96 01 movw r18, r12 15c58: 60 91 01 12 lds r22, 0x1201 ; 0x801201 15c5c: 70 91 02 12 lds r23, 0x1202 ; 0x801202 15c60: 80 91 03 12 lds r24, 0x1203 ; 0x801203 15c64: 90 91 04 12 lds r25, 0x1204 ; 0x801204 15c68: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 15c6c: 60 93 01 12 sts 0x1201, r22 ; 0x801201 15c70: 70 93 02 12 sts 0x1202, r23 ; 0x801202 15c74: 80 93 03 12 sts 0x1203, r24 ; 0x801203 15c78: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); //fast sequence 15c7c: 60 e0 ldi r22, 0x00 ; 0 15c7e: 70 e0 ldi r23, 0x00 ; 0 15c80: 80 ea ldi r24, 0xA0 ; 160 15c82: 91 e4 ldi r25, 0x41 ; 65 15c84: 0f 94 70 84 call 0x308e0 ; 0x308e0 if (raise_z_axis) { // backwards compatibility for 3.12 and older FW 15c88: 01 11 cpse r16, r1 15c8a: 06 c0 rjmp .+12 ; 0x15c98 raise_z_above(MIN_Z_FOR_LOAD); 15c8c: 60 e0 ldi r22, 0x00 ; 0 15c8e: 70 e0 ldi r23, 0x00 ; 0 15c90: 8c e0 ldi r24, 0x0C ; 12 15c92: 92 e4 ldi r25, 0x42 ; 66 15c94: 0e 94 3f 67 call 0xce7e ; 0xce7e } load_filament_final_feed(); // slow sequence 15c98: 0e 94 75 5e call 0xbcea ; 0xbcea st_synchronize(); 15c9c: 0f 94 42 22 call 0x24484 ; 0x24484 Sound_MakeCustom(50, 500, false); 15ca0: 40 e0 ldi r20, 0x00 ; 0 15ca2: 64 ef ldi r22, 0xF4 ; 244 15ca4: 71 e0 ldi r23, 0x01 ; 1 15ca6: 82 e3 ldi r24, 0x32 ; 50 15ca8: 90 e0 ldi r25, 0x00 ; 0 15caa: 0f 94 c5 31 call 0x2638a ; 0x2638a if (!farm_mode && (eFilamentAction != FilamentAction::None)) { 15cae: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 15cb2: 81 11 cpse r24, r1 15cb4: 05 c0 rjmp .+10 ; 0x15cc0 15cb6: 80 91 62 03 lds r24, 0x0362 ; 0x800362 15cba: 81 11 cpse r24, r1 lcd_load_filament_color_check(); 15cbc: 0f 94 d2 2f call 0x25fa4 ; 0x25fa4 #ifdef COMMUNITY_PREVENT_OOZE // Retract filament to prevent oozing retract_for_ooze_prevention(); #endif //COMMUNITY_PREVENT_OOZE lcd_update_enable(true); 15cc0: 81 e0 ldi r24, 0x01 ; 1 15cc2: 0e 94 c0 69 call 0xd380 ; 0xd380 lcd_update(2); 15cc6: 82 e0 ldi r24, 0x02 ; 2 15cc8: 0e 94 42 69 call 0xd284 ; 0xd284 lcd_setstatuspgm(MSG_WELCOME); 15ccc: 87 e6 ldi r24, 0x67 ; 103 15cce: 9b e6 ldi r25, 0x6B ; 107 15cd0: 0e 94 65 e6 call 0x1ccca ; 0x1ccca custom_message_type = CustomMsg::Status; 15cd4: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 15cd8: 8d cf rjmp .-230 ; 0x15bf4 */ case 702: { float z_target = 0; float unloadLength = FILAMENTCHANGE_FINALRETRACT; if (code_seen('U')) unloadLength = code_value(); 15cda: 85 e5 ldi r24, 0x55 ; 85 15cdc: 0e 94 2b 55 call 0xaa56 ; 0xaa56 - `Z` - Move the Z axis by this distance. Default value is 0 to maintain backwards compatibility with older gcodes. */ case 702: { float z_target = 0; float unloadLength = FILAMENTCHANGE_FINALRETRACT; 15ce0: c1 2c mov r12, r1 15ce2: d1 2c mov r13, r1 15ce4: 76 01 movw r14, r12 if (code_seen('U')) unloadLength = code_value(); 15ce6: 88 23 and r24, r24 15ce8: 21 f0 breq .+8 ; 0x15cf2 15cea: 0e 94 03 5a call 0xb406 ; 0xb406 15cee: 6b 01 movw r12, r22 15cf0: 7c 01 movw r14, r24 // For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 15cf2: 8a e5 ldi r24, 0x5A ; 90 15cf4: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15cf8: 88 23 and r24, r24 15cfa: a1 f0 breq .+40 ; 0x15d24 15cfc: 0e 94 03 5a call 0xb406 ; 0xb406 15d00: 9f 77 andi r25, 0x7F ; 127 else raise_z_above(MIN_Z_FOR_UNLOAD); // backwards compatibility for 3.12 and older FW // Raise the Z axis float delta = raise_z(z_target); 15d02: 0e 94 dd 66 call 0xcdba ; 0xcdba 15d06: 4b 01 movw r8, r22 15d08: 5c 01 movw r10, r24 // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); 15d0a: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15d0e: 81 30 cpi r24, 0x01 ; 1 15d10: 99 f4 brne .+38 ; 0x15d38 15d12: 0f 94 93 6a call 0x2d526 ; 0x2d526 else unload_filament(unloadLength); // Restore Z axis raise_z(-delta); 15d16: c5 01 movw r24, r10 15d18: b4 01 movw r22, r8 15d1a: 90 58 subi r25, 0x80 ; 128 15d1c: 0e 94 dd 66 call 0xcdba ; 0xcdba 15d20: 0c 94 12 98 jmp 0x13024 ; 0x13024 float unloadLength = FILAMENTCHANGE_FINALRETRACT; if (code_seen('U')) unloadLength = code_value(); // For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); else raise_z_above(MIN_Z_FOR_UNLOAD); // backwards compatibility for 3.12 and older FW 15d24: 60 e0 ldi r22, 0x00 ; 0 15d26: 70 e0 ldi r23, 0x00 ; 0 15d28: 8c e0 ldi r24, 0x0C ; 12 15d2a: 92 e4 ldi r25, 0x42 ; 66 15d2c: 0e 94 3f 67 call 0xce7e ; 0xce7e - `U` - Retract distance for removal (manual reload). Default value is FILAMENTCHANGE_FINALRETRACT. - `Z` - Move the Z axis by this distance. Default value is 0 to maintain backwards compatibility with older gcodes. */ case 702: { float z_target = 0; 15d30: 60 e0 ldi r22, 0x00 ; 0 15d32: 70 e0 ldi r23, 0x00 ; 0 15d34: cb 01 movw r24, r22 15d36: e5 cf rjmp .-54 ; 0x15d02 // Raise the Z axis float delta = raise_z(z_target); // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); else unload_filament(unloadLength); 15d38: c7 01 movw r24, r14 15d3a: b6 01 movw r22, r12 15d3c: 0e 94 4c f0 call 0x1e098 ; 0x1e098 15d40: ea cf rjmp .-44 ; 0x15d16 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 704: { gcodes_M704_M705_M706(704); 15d42: 80 ec ldi r24, 0xC0 ; 192 15d44: 92 e0 ldi r25, 0x02 ; 2 15d46: 0e 94 c9 59 call 0xb392 ; 0xb392 15d4a: 0c 94 12 98 jmp 0x13024 ; 0x13024 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 705: { gcodes_M704_M705_M706(705); 15d4e: 81 ec ldi r24, 0xC1 ; 193 15d50: 92 e0 ldi r25, 0x02 ; 2 15d52: 0e 94 c9 59 call 0xb392 ; 0xb392 15d56: 0c 94 12 98 jmp 0x13024 ; 0x13024 M707 A0x1b - Read a 8bit integer from register 0x1b and prints the result onto the serial line. Does nothing if the A parameter is not present or if MMU is not enabled. */ case 707: { if ( MMU2::mmu2.Enabled() ) { 15d5a: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15d5e: 81 30 cpi r24, 0x01 ; 1 15d60: 11 f0 breq .+4 ; 0x15d66 15d62: 0c 94 12 98 jmp 0x13024 ; 0x13024 if( code_seen('A') ) { 15d66: 81 e4 ldi r24, 0x41 ; 65 15d68: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15d6c: 88 23 and r24, r24 15d6e: 11 f4 brne .+4 ; 0x15d74 15d70: 0c 94 12 98 jmp 0x13024 ; 0x13024 MMU2::mmu2.ReadRegister(uint8_t(strtol(strchr_pointer+1, NULL, 16))); 15d74: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 15d78: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 15d7c: 40 e1 ldi r20, 0x10 ; 16 15d7e: 50 e0 ldi r21, 0x00 ; 0 15d80: 70 e0 ldi r23, 0x00 ; 0 15d82: 60 e0 ldi r22, 0x00 ; 0 15d84: 01 96 adiw r24, 0x01 ; 1 15d86: 0f 94 67 9b call 0x336ce ; 0x336ce 15d8a: 86 2f mov r24, r22 15d8c: 0e 94 7d f7 call 0x1eefa ; 0x1eefa 15d90: 0c 94 12 98 jmp 0x13024 ; 0x13024 M708 A0x1b X05 - Write to register 0x1b the value 05. Does nothing if A parameter is missing or if MMU is not enabled. */ case 708: { if ( MMU2::mmu2.Enabled() ){ 15d94: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15d98: 81 30 cpi r24, 0x01 ; 1 15d9a: 11 f0 breq .+4 ; 0x15da0 15d9c: 0c 94 12 98 jmp 0x13024 ; 0x13024 uint8_t addr = 0; if( code_seen('A') ) { 15da0: 81 e4 ldi r24, 0x41 ; 65 15da2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 Does nothing if A parameter is missing or if MMU is not enabled. */ case 708: { if ( MMU2::mmu2.Enabled() ){ uint8_t addr = 0; 15da6: 10 e0 ldi r17, 0x00 ; 0 if( code_seen('A') ) { 15da8: 88 23 and r24, r24 15daa: 61 f0 breq .+24 ; 0x15dc4 addr = uint8_t(strtol(strchr_pointer+1, NULL, 16)); 15dac: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 15db0: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 15db4: 40 e1 ldi r20, 0x10 ; 16 15db6: 50 e0 ldi r21, 0x00 ; 0 15db8: 70 e0 ldi r23, 0x00 ; 0 15dba: 60 e0 ldi r22, 0x00 ; 0 15dbc: 01 96 adiw r24, 0x01 ; 1 15dbe: 0f 94 67 9b call 0x336ce ; 0x336ce 15dc2: 16 2f mov r17, r22 } uint16_t data = 0; if( code_seen('X') ) { 15dc4: 88 e5 ldi r24, 0x58 ; 88 15dc6: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15dca: 88 23 and r24, r24 15dcc: 61 f0 breq .+24 ; 0x15de6 data = code_value_short(); 15dce: 0e 94 4d 55 call 0xaa9a ; 0xaa9a } if(addr){ 15dd2: 11 23 and r17, r17 15dd4: 11 f4 brne .+4 ; 0x15dda 15dd6: 0c 94 12 98 jmp 0x13024 ; 0x13024 MMU2::mmu2.WriteRegister(addr, data); 15dda: bc 01 movw r22, r24 15ddc: 81 2f mov r24, r17 15dde: 0e 94 9f bf call 0x17f3e ; 0x17f3e 15de2: 0c 94 12 98 jmp 0x13024 ; 0x13024 if ( MMU2::mmu2.Enabled() ){ uint8_t addr = 0; if( code_seen('A') ) { addr = uint8_t(strtol(strchr_pointer+1, NULL, 16)); } uint16_t data = 0; 15de6: 90 e0 ldi r25, 0x00 ; 0 15de8: 80 e0 ldi r24, 0x00 ; 0 15dea: f3 cf rjmp .-26 ; 0x15dd2 M709 - Serial message if en- or disabled */ case 709: { if (code_seen('S')) 15dec: 83 e5 ldi r24, 0x53 ; 83 15dee: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15df2: 88 23 and r24, r24 15df4: 31 f0 breq .+12 ; 0x15e02 { switch (code_value_uint8()) 15df6: 0e 94 40 55 call 0xaa80 ; 0xaa80 15dfa: 88 23 and r24, r24 15dfc: a9 f0 breq .+42 ; 0x15e28 15dfe: 81 30 cpi r24, 0x01 ; 1 15e00: f9 f0 breq .+62 ; 0x15e40 break; default: break; } } if (MMU2::mmu2.Enabled() && code_seen('X')) 15e02: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15e06: 81 30 cpi r24, 0x01 ; 1 15e08: 59 f4 brne .+22 ; 0x15e20 15e0a: 88 e5 ldi r24, 0x58 ; 88 15e0c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15e10: 88 23 and r24, r24 15e12: 31 f0 breq .+12 ; 0x15e20 { switch (code_value_uint8()) 15e14: 0e 94 40 55 call 0xaa80 ; 0xaa80 15e18: 82 30 cpi r24, 0x02 ; 2 15e1a: d0 f0 brcs .+52 ; 0x15e50 15e1c: 8a 32 cpi r24, 0x2A ; 42 15e1e: e1 f0 breq .+56 ; 0x15e58 break; default: break; } } MMU2::mmu2.Status(); 15e20: 0f 94 98 41 call 0x28330 ; 0x28330 15e24: 0c 94 12 98 jmp 0x13024 ; 0x13024 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 15e28: 60 e0 ldi r22, 0x00 ; 0 15e2a: 8c ea ldi r24, 0xAC ; 172 15e2c: 9c e0 ldi r25, 0x0C ; 12 15e2e: 0f 94 00 a0 call 0x34000 ; 0x34000 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 15e32: 10 92 94 12 sts 0x1294, r1 ; 0x801294 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 15e36: 10 92 42 12 sts 0x1242, r1 ; 0x801242 currentScope = Scope::Stopped; 15e3a: 10 92 27 12 sts 0x1227, r1 ; 0x801227 15e3e: e1 cf rjmp .-62 ; 0x15e02 15e40: 61 e0 ldi r22, 0x01 ; 1 15e42: 8c ea ldi r24, 0xAC ; 172 15e44: 9c e0 ldi r25, 0x0C ; 12 15e46: 0f 94 00 a0 call 0x34000 ; 0x34000 eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); MMU2::mmu2.Stop(); break; case 1: eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, true); MMU2::mmu2.Start(); 15e4a: 0f 94 9a 62 call 0x2c534 ; 0x2c534 15e4e: d9 cf rjmp .-78 ; 0x15e02 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 15e50: 80 e0 ldi r24, 0x00 ; 0 } void MMU2::ResetX42() { logic.ResetMMU(42); 15e52: 0f 94 5d 62 call 0x2c4ba ; 0x2c4ba 15e56: e4 cf rjmp .-56 ; 0x15e20 15e58: 8a e2 ldi r24, 0x2A ; 42 15e5a: fb cf rjmp .-10 ; 0x15e52 T - Selects the filament position. A Gcode to load a filament to the nozzle must follow. Tx - Printer asks user to select a filament position. Then loads the filament from the MMU unit into the extruder wheels only. G-code to heat up the nozzle follows. Tc - Loads the filament tip from the extruder wheels into the nozzle. T? - acts the same as Tx followed by Tc */ else if(*CMDBUFFER_CURRENT_STRING == 'T') { 15e5c: 84 35 cpi r24, 0x54 ; 84 15e5e: 09 f0 breq .+2 ; 0x15e62 15e60: 79 c0 rjmp .+242 ; 0x15f54 strchr_pointer = CMDBUFFER_CURRENT_STRING; 15e62: 10 93 f6 16 sts 0x16F6, r17 ; 0x8016f6 15e66: 00 93 f5 16 sts 0x16F5, r16 ; 0x8016f5 processing_tcode = true; 15e6a: 81 e0 ldi r24, 0x01 ; 1 15e6c: 80 93 5f 03 sts 0x035F, r24 ; 0x80035f TCodes(strchr_pointer, code_value_uint8()); 15e70: 0e 94 40 55 call 0xaa80 ; 0xaa80 15e74: 18 2f mov r17, r24 15e76: 20 91 f5 16 lds r18, 0x16F5 ; 0x8016f5 15e7a: 30 91 f6 16 lds r19, 0x16F6 ; 0x8016f6 inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); } void TCodes(char *const strchr_pointer, const uint8_t codeValue) { uint8_t index = 1; 15e7e: 91 e0 ldi r25, 0x01 ; 1 for ( /*nothing*/ ; strchr_pointer[index] == ' ' || strchr_pointer[index] == '\t'; index++) 15e80: 79 01 movw r14, r18 15e82: e9 0e add r14, r25 15e84: f1 1c adc r15, r1 15e86: d7 01 movw r26, r14 15e88: 8c 91 ld r24, X 15e8a: 80 32 cpi r24, 0x20 ; 32 15e8c: 11 f0 breq .+4 ; 0x15e92 15e8e: 89 30 cpi r24, 0x09 ; 9 15e90: 11 f4 brne .+4 ; 0x15e96 15e92: 9f 5f subi r25, 0xFF ; 255 15e94: f5 cf rjmp .-22 ; 0x15e80 ; strchr_pointer[index] = tolower(strchr_pointer[index]); 15e96: 08 2e mov r0, r24 15e98: 00 0c add r0, r0 15e9a: 99 0b sbc r25, r25 15e9c: 0f 94 f0 a5 call 0x34be0 ; 0x34be0 15ea0: f7 01 movw r30, r14 15ea2: 80 83 st Z, r24 #include static const char duplicate_Tcode_ignored[] PROGMEM = "Duplicate T-code ignored."; inline bool IsInvalidTCode(char *const s, uint8_t i) { return ((s[i] < '0' || s[i] > '4') && s[i] != '?' && s[i] != 'x' && s[i] != 'c'); 15ea4: 90 ed ldi r25, 0xD0 ; 208 15ea6: 98 0f add r25, r24 15ea8: 95 30 cpi r25, 0x05 ; 5 15eaa: 58 f0 brcs .+22 ; 0x15ec2 15eac: 8f 33 cpi r24, 0x3F ; 63 15eae: 69 f0 breq .+26 ; 0x15eca 15eb0: 88 37 cpi r24, 0x78 ; 120 15eb2: 59 f0 breq .+22 ; 0x15eca 15eb4: 83 36 cpi r24, 0x63 ; 99 15eb6: 01 f1 breq .+64 ; 0x15ef8 } inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); 15eb8: 87 ea ldi r24, 0xA7 ; 167 15eba: 98 e7 ldi r25, 0x78 ; 120 } else { SERIAL_ECHO_START; if (codeValue >= EXTRUDERS) { SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 15ebc: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 15ec0: 15 c0 rjmp .+42 ; 0x15eec 15ec2: 90 91 94 12 lds r25, 0x1294 ; 0x801294 strchr_pointer[index] = tolower(strchr_pointer[index]); if (IsInvalidTCode(strchr_pointer, index)){ TCodeInvalid(); } else if (strchr_pointer[index] == 'x' || strchr_pointer[index] == '?'){ 15ec6: 8f 33 cpi r24, 0x3F ; 63 15ec8: a9 f4 brne .+42 ; 0x15ef4 // load to extruder gears; if mmu is not present do nothing if (MMU2::mmu2.Enabled()) { 15eca: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15ece: 81 30 cpi r24, 0x01 ; 1 15ed0: 69 f4 brne .+26 ; 0x15eec MMU2::mmu2.tool_change(strchr_pointer[index], choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT)); 15ed2: 84 e2 ldi r24, 0x24 ; 36 15ed4: 9e e3 ldi r25, 0x3E ; 62 15ed6: 0e 94 b1 6c call 0xd962 ; 0xd962 15eda: 70 e0 ldi r23, 0x00 ; 0 15edc: 60 e0 ldi r22, 0x00 ; 0 15ede: 0e 94 ea bc call 0x179d4 ; 0x179d4 15ee2: 68 2f mov r22, r24 15ee4: d7 01 movw r26, r14 15ee6: 8c 91 ld r24, X } } else if (strchr_pointer[index] == 'c'){ // load from extruder gears to nozzle (nozzle should be preheated) if (MMU2::mmu2.Enabled()) { MMU2::mmu2.tool_change(strchr_pointer[index], MMU2::mmu2.get_current_tool()); 15ee8: 0e 94 32 f7 call 0x1ee64 ; 0x1ee64 processing_tcode = false; 15eec: 10 92 5f 03 sts 0x035F, r1 ; 0x80035f 15ef0: 0c 94 37 84 jmp 0x1086e ; 0x1086e } else if (strchr_pointer[index] == 'x' || strchr_pointer[index] == '?'){ // load to extruder gears; if mmu is not present do nothing if (MMU2::mmu2.Enabled()) { MMU2::mmu2.tool_change(strchr_pointer[index], choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT)); } } else if (strchr_pointer[index] == 'c'){ 15ef4: 83 36 cpi r24, 0x63 ; 99 15ef6: 49 f4 brne .+18 ; 0x15f0a // load from extruder gears to nozzle (nozzle should be preheated) if (MMU2::mmu2.Enabled()) { 15ef8: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15efc: 81 30 cpi r24, 0x01 ; 1 15efe: b1 f7 brne .-20 ; 0x15eec MMU2::mmu2.tool_change(strchr_pointer[index], MMU2::mmu2.get_current_tool()); 15f00: 0f 94 92 41 call 0x28324 ; 0x28324 15f04: 68 2f mov r22, r24 15f06: 83 e6 ldi r24, 0x63 ; 99 15f08: ef cf rjmp .-34 ; 0x15ee8 } } else { // Process T0 ... T4 if (MMU2::mmu2.Enabled()) { 15f0a: 91 30 cpi r25, 0x01 ; 1 15f0c: 69 f4 brne .+26 ; 0x15f28 if (codeValue == MMU2::mmu2.get_current_tool()){ 15f0e: 0f 94 92 41 call 0x28324 ; 0x28324 15f12: 18 13 cpse r17, r24 15f14: 05 c0 rjmp .+10 ; 0x15f20 // don't execute the same T-code twice in a row puts_P(duplicate_Tcode_ignored); 15f16: 87 eb ldi r24, 0xB7 ; 183 15f18: 98 e7 ldi r25, 0x78 ; 120 15f1a: 0f 94 c5 9e call 0x33d8a ; 0x33d8a 15f1e: e6 cf rjmp .-52 ; 0x15eec #if defined(MMU_HAS_CUTTER) && defined(MMU_ALWAYS_CUT) if (EEPROM_MMU_CUTTER_ENABLED_always == eeprom_read_byte((uint8_t *)EEPROM_MMU_CUTTER_ENABLED)) { MMU2::mmu2.cut_filament(codeValue); } #endif // defined(MMU_HAS_CUTTER) && defined(MMU_ALWAYS_CUT) MMU2::mmu2.tool_change(codeValue); 15f20: 81 2f mov r24, r17 15f22: 0e 94 ca f3 call 0x1e794 ; 0x1e794 15f26: e2 cf rjmp .-60 ; 0x15eec } } else { SERIAL_ECHO_START; 15f28: 81 e6 ldi r24, 0x61 ; 97 15f2a: 9d e9 ldi r25, 0x9D ; 157 15f2c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 if (codeValue >= EXTRUDERS) { 15f30: 11 23 and r17, r17 15f32: 59 f0 breq .+22 ; 0x15f4a } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15f34: 84 e5 ldi r24, 0x54 ; 84 15f36: 0e 94 41 70 call 0xe082 ; 0xe082 SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); 15f3a: 81 2f mov r24, r17 15f3c: 90 e0 ldi r25, 0x00 ; 0 15f3e: c0 96 adiw r24, 0x30 ; 48 15f40: 0f 94 aa 41 call 0x28354 ; 0x28354 SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 15f44: 86 ec ldi r24, 0xC6 ; 198 15f46: 94 e6 ldi r25, 0x64 ; 100 15f48: b9 cf rjmp .-142 ; 0x15ebc // next_feedrate = code_value(); // if (next_feedrate > 0.0) { // feedrate = next_feedrate; // } // } SERIAL_ECHORPGM(_n("Active Extruder: 0")); ////MSG_ACTIVE_EXTRUDER 15f4a: 83 eb ldi r24, 0xB3 ; 179 15f4c: 94 e6 ldi r25, 0x64 ; 100 15f4e: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 15f52: cc cf rjmp .-104 ; 0x15eec /** *--------------------------------------------------------------------------------- *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) 15f54: 84 34 cpi r24, 0x44 ; 68 15f56: 09 f0 breq .+2 ; 0x15f5a 15f58: 5d c0 rjmp .+186 ; 0x16014 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 15f5a: 10 93 f6 16 sts 0x16F6, r17 ; 0x8016f6 15f5e: 00 93 f5 16 sts 0x16F5, r16 ; 0x8016f5 switch(code_value_short()) 15f62: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 15f66: 82 30 cpi r24, 0x02 ; 2 15f68: 91 05 cpc r25, r1 15f6a: 41 f1 breq .+80 ; 0x15fbc 15f6c: 8c f4 brge .+34 ; 0x15f90 15f6e: 01 96 adiw r24, 0x01 ; 1 15f70: e1 f0 breq .+56 ; 0x15faa #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 15f72: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 15f76: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 15f7a: 8f 51 subi r24, 0x1F ; 31 15f7c: 90 4f sbci r25, 0xF0 ; 240 15f7e: 9f 93 push r25 15f80: 8f 93 push r24 15f82: 1f 92 push r1 15f84: 84 e4 ldi r24, 0x44 ; 68 15f86: 8f 93 push r24 15f88: 88 e4 ldi r24, 0x48 ; 72 15f8a: 96 e6 ldi r25, 0x66 ; 102 15f8c: 0c 94 8c 84 jmp 0x10918 ; 0x10918 *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) { strchr_pointer = CMDBUFFER_CURRENT_STRING; switch(code_value_short()) 15f90: 83 30 cpi r24, 0x03 ; 3 15f92: 91 05 cpc r25, r1 15f94: f9 f0 breq .+62 ; 0x15fd4 15f96: 47 97 sbiw r24, 0x17 ; 23 15f98: 61 f7 brne .-40 ; 0x15f72 bool emergency_serial_dump = false; void dcode_23() { if(code_seen('E')) 15f9a: 85 e4 ldi r24, 0x45 ; 69 15f9c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15fa0: 88 23 and r24, r24 15fa2: 09 f1 breq .+66 ; 0x15fe6 serial_dump_and_reset(dump_crash_reason::manual); 15fa4: 80 e0 ldi r24, 0x00 ; 0 15fa6: 0e 94 5d 74 call 0xe8ba ; 0xe8ba * */ void dcode__1() { DBG(_N("D-1 - Endless loop\n")); 15faa: 8f e9 ldi r24, 0x9F ; 159 15fac: 94 e6 ldi r25, 0x64 ; 100 15fae: 9f 93 push r25 15fb0: 8f 93 push r24 15fb2: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 15fb6: 0f 90 pop r0 15fb8: 0f 90 pop r0 15fba: ff cf rjmp .-2 ; 0x15fba - The hex data needs to be lowercase */ void dcode_2() { dcode_core(RAMSTART, RAMEND+1, dcode_mem_t::sram, 2, _N("SRAM")); 15fbc: 0a e9 ldi r16, 0x9A ; 154 15fbe: 14 e6 ldi r17, 0x64 ; 100 15fc0: 22 e0 ldi r18, 0x02 ; 2 15fc2: 40 e0 ldi r20, 0x00 ; 0 15fc4: 60 e0 ldi r22, 0x00 ; 0 15fc6: 72 e2 ldi r23, 0x22 ; 34 15fc8: 80 e0 ldi r24, 0x00 ; 0 15fca: 92 e0 ldi r25, 0x02 ; 2 - The hex data needs to be lowercase */ void dcode_3() { dcode_core(0, EEPROM_SIZE, dcode_mem_t::eeprom, 3, _N("EEPROM")); 15fcc: 0e 94 44 5d call 0xba88 ; 0xba88 15fd0: 0c 94 37 84 jmp 0x1086e ; 0x1086e 15fd4: 03 e9 ldi r16, 0x93 ; 147 15fd6: 14 e6 ldi r17, 0x64 ; 100 15fd8: 23 e0 ldi r18, 0x03 ; 3 15fda: 41 e0 ldi r20, 0x01 ; 1 15fdc: 60 e0 ldi r22, 0x00 ; 0 15fde: 70 e1 ldi r23, 0x10 ; 16 15fe0: 90 e0 ldi r25, 0x00 ; 0 15fe2: 80 e0 ldi r24, 0x00 ; 0 15fe4: f3 cf rjmp .-26 ; 0x15fcc { if(code_seen('E')) serial_dump_and_reset(dump_crash_reason::manual); else { emergency_serial_dump = !code_seen('R'); 15fe6: 82 e5 ldi r24, 0x52 ; 82 15fe8: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15fec: 91 e0 ldi r25, 0x01 ; 1 15fee: 89 27 eor r24, r25 15ff0: 80 93 7c 06 sts 0x067C, r24 ; 0x80067c SERIAL_ECHOPGM("serial dump "); 15ff4: 8a e9 ldi r24, 0x9A ; 154 15ff6: 98 e7 ldi r25, 0x78 ; 120 15ff8: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLNRPGM(emergency_serial_dump? _N("enabled"): _N("disabled")); 15ffc: 80 91 7c 06 lds r24, 0x067C ; 0x80067c 16000: 88 23 and r24, r24 16002: 21 f0 breq .+8 ; 0x1600c 16004: 8b e8 ldi r24, 0x8B ; 139 16006: 94 e6 ldi r25, 0x64 ; 100 16008: 0c 94 f3 84 jmp 0x109e6 ; 0x109e6 1600c: 82 e8 ldi r24, 0x82 ; 130 1600e: 94 e6 ldi r25, 0x64 ; 100 16010: 0c 94 f3 84 jmp 0x109e6 ; 0x109e6 } } else { SERIAL_ECHO_START; 16014: 81 e6 ldi r24, 0x61 ; 97 16016: 9d e9 ldi r25, 0x9D ; 157 16018: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 1601c: 85 ef ldi r24, 0xF5 ; 245 1601e: 94 e6 ldi r25, 0x64 ; 100 16020: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 16024: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 16028: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 1602c: 8f 51 subi r24, 0x1F ; 31 1602e: 90 4f sbci r25, 0xF0 ; 240 16030: 0e 94 a3 7c call 0xf946 ; 0xf946 SERIAL_ECHOLNPGM("\"(2)"); 16034: 82 e3 ldi r24, 0x32 ; 50 16036: 9e e7 ldi r25, 0x7E ; 126 16038: 0c 94 f3 84 jmp 0x109e6 ; 0x109e6 #ifdef FWRETRACT if(cs.autoretract_enabled) { if( !(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) { float echange=destination[E_AXIS]-current_position[E_AXIS]; if((echange<-MIN_RETRACT && !retracted[active_extruder]) || (echange>MIN_RETRACT && retracted[active_extruder])) { //move appears to be an attempt to retract or recover 1603c: 2d ec ldi r18, 0xCD ; 205 1603e: 3c ec ldi r19, 0xCC ; 204 16040: 4c ec ldi r20, 0xCC ; 204 16042: 5d e3 ldi r21, 0x3D ; 61 16044: c7 01 movw r24, r14 16046: b6 01 movw r22, r12 16048: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 1604c: 18 16 cp r1, r24 1604e: 14 f4 brge .+4 ; 0x16054 16050: 0c 94 5b 86 jmp 0x10cb6 ; 0x10cb6 16054: 0c 94 6b 87 jmp 0x10ed6 ; 0x10ed6 float temp = (40 + i * 5); printf_P(_N("\nStep: %d/6 (skipped)\nPINDA temperature: %d Z shift (mm):0\n"), i + 2, (40 + i*5)); if (i >= 0) { eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; 16058: a3 01 movw r20, r6 1605a: 92 01 movw r18, r4 1605c: 62 2d mov r22, r2 1605e: 73 2d mov r23, r3 16060: 8e 2d mov r24, r14 16062: 9f 2d mov r25, r15 16064: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 16068: 18 16 cp r1, r24 1606a: 14 f0 brlt .+4 ; 0x16070 1606c: 0c 94 dd 8e jmp 0x11dba ; 0x11dba 16070: e5 e0 ldi r30, 0x05 ; 5 16072: ce 0e add r12, r30 16074: d1 1c adc r13, r1 16076: f2 e0 ldi r31, 0x02 ; 2 16078: 8f 0e add r8, r31 1607a: 91 1c adc r9, r1 SERIAL_ECHOLNPGM("PINDA probe calibration start"); float zero_z; int z_shift = 0; //unit: steps float start_temp = 5 * (int)(current_temperature_pinda / 5); if (start_temp < 35) start_temp = 35; 1607c: 85 01 movw r16, r10 1607e: 0c 94 a4 8e jmp 0x11d48 ; 0x11d48 int8_t upgrade = is_provided_version_newer(version_string); if (upgrade < 0) return false; if (upgrade) { lcd_display_message_fullscreen_P(_T(MSG_NEW_FIRMWARE_AVAILABLE)); 16082: 81 e2 ldi r24, 0x21 ; 33 16084: 99 e3 ldi r25, 0x39 ; 57 16086: 0e 94 b1 6c call 0xd962 ; 0xd962 1608a: 0f 94 c0 0a call 0x21580 ; 0x21580 lcd_puts_at_P(0, 2, PSTR("")); 1608e: 4c ec ldi r20, 0xCC ; 204 16090: 5d e7 ldi r21, 0x7D ; 125 16092: 62 e0 ldi r22, 0x02 ; 2 16094: 80 e0 ldi r24, 0x00 ; 0 16096: 0e 94 8f 69 call 0xd31e ; 0xd31e for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c) 1609a: f8 01 movw r30, r16 1609c: 81 91 ld r24, Z+ 1609e: 8f 01 movw r16, r30 return c == ' ' || c == '\t' || c == '\n' || c == '\r'; } inline bool is_whitespace_or_nl_or_eol(char c) { return c == 0 || c == ' ' || c == '\t' || c == '\n' || c == '\r'; 160a0: 98 2f mov r25, r24 160a2: 9f 7d andi r25, 0xDF ; 223 160a4: 11 f4 brne .+4 ; 0x160aa 160a6: 0c 94 0c 9e jmp 0x13c18 ; 0x13c18 160aa: 97 ef ldi r25, 0xF7 ; 247 160ac: 98 0f add r25, r24 160ae: 92 30 cpi r25, 0x02 ; 2 160b0: 10 f4 brcc .+4 ; 0x160b6 160b2: 0c 94 0c 9e jmp 0x13c18 ; 0x13c18 160b6: 8d 30 cpi r24, 0x0D ; 13 160b8: 11 f4 brne .+4 ; 0x160be 160ba: 0c 94 0c 9e jmp 0x13c18 ; 0x13c18 if (upgrade) { lcd_display_message_fullscreen_P(_T(MSG_NEW_FIRMWARE_AVAILABLE)); lcd_puts_at_P(0, 2, PSTR("")); for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c) lcd_putc(*c); 160be: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 160c2: eb cf rjmp .-42 ; 0x1609a 000160c4 : uint8_t check_pinda_0() { return _PINDA?0:1; } 160c4: 80 91 bd 03 lds r24, 0x03BD ; 0x8003bd 160c8: 90 91 be 03 lds r25, 0x03BE ; 0x8003be 160cc: 08 95 ret 000160ce : 160ce: 22 e0 ldi r18, 0x02 ; 2 160d0: 20 93 c0 00 sts 0x00C0, r18 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 160d4: 10 92 c5 00 sts 0x00C5, r1 ; 0x8000c5 <__TEXT_REGION_LENGTH__+0x7c20c5> 160d8: 90 e1 ldi r25, 0x10 ; 16 160da: 90 93 c4 00 sts 0x00C4, r25 ; 0x8000c4 <__TEXT_REGION_LENGTH__+0x7c20c4> 160de: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160e2: 80 61 ori r24, 0x10 ; 16 160e4: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160e8: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160ec: 88 60 ori r24, 0x08 ; 8 160ee: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160f2: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160f6: 80 68 ori r24, 0x80 ; 128 160f8: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160fc: 80 91 04 05 lds r24, 0x0504 ; 0x800504 16100: 81 30 cpi r24, 0x01 ; 1 16102: a9 f4 brne .+42 ; 0x1612e 16104: 20 93 c8 00 sts 0x00C8, r18 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> 16108: 10 92 cd 00 sts 0x00CD, r1 ; 0x8000cd <__TEXT_REGION_LENGTH__+0x7c20cd> 1610c: 90 93 cc 00 sts 0x00CC, r25 ; 0x8000cc <__TEXT_REGION_LENGTH__+0x7c20cc> 16110: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 16114: 80 61 ori r24, 0x10 ; 16 16116: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1611a: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1611e: 88 60 ori r24, 0x08 ; 8 16120: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 16124: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 16128: 80 68 ori r24, 0x80 ; 128 1612a: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1612e: 08 95 ret 00016130 : 16130: 81 50 subi r24, 0x01 ; 1 16132: 82 31 cpi r24, 0x12 ; 18 16134: 08 f0 brcs .+2 ; 0x16138 16136: 5a c0 rjmp .+180 ; 0x161ec 16138: e8 2f mov r30, r24 1613a: f0 e0 ldi r31, 0x00 ; 0 1613c: 88 27 eor r24, r24 1613e: ec 55 subi r30, 0x5C ; 92 16140: ff 44 sbci r31, 0x4F ; 79 16142: 8f 4f sbci r24, 0xFF ; 255 16144: 0d 94 ec a0 jmp 0x341d8 ; 0x341d8 <__tablejump2__> 16148: c4 b0 in r12, 0x04 ; 4 1614a: c8 b0 in r12, 0x08 ; 8 1614c: b6 b0 in r11, 0x06 ; 6 1614e: bc b0 in r11, 0x0c ; 12 16150: c0 b0 in r12, 0x00 ; 0 16152: f6 b0 in r15, 0x06 ; 6 16154: cb b0 in r12, 0x0b ; 11 16156: d1 b0 in r13, 0x01 ; 1 16158: d5 b0 in r13, 0x05 ; 5 1615a: db b0 in r13, 0x0b ; 11 1615c: df b0 in r13, 0x0f ; 15 1615e: e3 b0 in r14, 0x03 ; 3 16160: e9 b0 in r14, 0x09 ; 9 16162: ed b0 in r14, 0x0d ; 13 16164: f6 b0 in r15, 0x06 ; 6 16166: f1 b0 in r15, 0x01 ; 1 16168: f7 b0 in r15, 0x07 ; 7 1616a: fb b0 in r15, 0x0b ; 11 1616c: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 16170: 8f 77 andi r24, 0x7F ; 127 16172: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 16176: 08 95 ret 16178: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1617c: 8f 7d andi r24, 0xDF ; 223 1617e: f9 cf rjmp .-14 ; 0x16172 16180: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 16184: 87 7f andi r24, 0xF7 ; 247 16186: f5 cf rjmp .-22 ; 0x16172 16188: 84 b5 in r24, 0x24 ; 36 1618a: 8f 77 andi r24, 0x7F ; 127 1618c: 84 bd out 0x24, r24 ; 36 1618e: 08 95 ret 16190: 84 b5 in r24, 0x24 ; 36 16192: 8f 7d andi r24, 0xDF ; 223 16194: fb cf rjmp .-10 ; 0x1618c 16196: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1619a: 8f 77 andi r24, 0x7F ; 127 1619c: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 161a0: 08 95 ret 161a2: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 161a6: 8f 7d andi r24, 0xDF ; 223 161a8: f9 cf rjmp .-14 ; 0x1619c 161aa: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 161ae: 8f 77 andi r24, 0x7F ; 127 161b0: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 161b4: 08 95 ret 161b6: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 161ba: 8f 7d andi r24, 0xDF ; 223 161bc: f9 cf rjmp .-14 ; 0x161b0 161be: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 161c2: 87 7f andi r24, 0xF7 ; 247 161c4: f5 cf rjmp .-22 ; 0x161b0 161c6: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 161ca: 8f 77 andi r24, 0x7F ; 127 161cc: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 161d0: 08 95 ret 161d2: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 161d6: 8f 7d andi r24, 0xDF ; 223 161d8: f9 cf rjmp .-14 ; 0x161cc 161da: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 161de: 87 7f andi r24, 0xF7 ; 247 161e0: f5 cf rjmp .-22 ; 0x161cc 161e2: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 161e6: 8f 77 andi r24, 0x7F ; 127 161e8: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 161ec: 08 95 ret 161ee: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 161f2: 8f 7d andi r24, 0xDF ; 223 161f4: f9 cf rjmp .-14 ; 0x161e8 161f6: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 161fa: 87 7f andi r24, 0xF7 ; 247 161fc: f5 cf rjmp .-22 ; 0x161e8 000161fe : 161fe: 83 b1 in r24, 0x03 ; 3 16200: 82 95 swap r24 16202: 81 70 andi r24, 0x01 ; 1 16204: 08 95 ret 00016206 : } uint8_t xyzcal_dm = 0; void xyzcal_update_pos(uint16_t dx, uint16_t dy, uint16_t dz, uint16_t) { 16206: cf 92 push r12 16208: df 92 push r13 1620a: ef 92 push r14 1620c: ff 92 push r15 // DBG(_n("xyzcal_update_pos dx=%d dy=%d dz=%d dir=%02x\n"), dx, dy, dz, xyzcal_dm); if (xyzcal_dm&1) count_position[0] -= dx; else count_position[0] += dx; 1620e: 20 91 bf 03 lds r18, 0x03BF ; 0x8003bf 16212: b0 e0 ldi r27, 0x00 ; 0 16214: a0 e0 ldi r26, 0x00 ; 0 16216: c0 90 b6 06 lds r12, 0x06B6 ; 0x8006b6 1621a: d0 90 b7 06 lds r13, 0x06B7 ; 0x8006b7 1621e: e0 90 b8 06 lds r14, 0x06B8 ; 0x8006b8 16222: f0 90 b9 06 lds r15, 0x06B9 ; 0x8006b9 16226: 20 ff sbrs r18, 0 16228: 42 c0 rjmp .+132 ; 0x162ae 1622a: c8 1a sub r12, r24 1622c: d9 0a sbc r13, r25 1622e: ea 0a sbc r14, r26 16230: fb 0a sbc r15, r27 16232: c0 92 b6 06 sts 0x06B6, r12 ; 0x8006b6 16236: d0 92 b7 06 sts 0x06B7, r13 ; 0x8006b7 1623a: e0 92 b8 06 sts 0x06B8, r14 ; 0x8006b8 1623e: f0 92 b9 06 sts 0x06B9, r15 ; 0x8006b9 16242: cb 01 movw r24, r22 16244: b0 e0 ldi r27, 0x00 ; 0 16246: a0 e0 ldi r26, 0x00 ; 0 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 16248: c0 90 ba 06 lds r12, 0x06BA ; 0x8006ba 1624c: d0 90 bb 06 lds r13, 0x06BB ; 0x8006bb 16250: e0 90 bc 06 lds r14, 0x06BC ; 0x8006bc 16254: f0 90 bd 06 lds r15, 0x06BD ; 0x8006bd 16258: 21 ff sbrs r18, 1 1625a: 36 c0 rjmp .+108 ; 0x162c8 1625c: c8 1a sub r12, r24 1625e: d9 0a sbc r13, r25 16260: ea 0a sbc r14, r26 16262: fb 0a sbc r15, r27 16264: c0 92 ba 06 sts 0x06BA, r12 ; 0x8006ba 16268: d0 92 bb 06 sts 0x06BB, r13 ; 0x8006bb 1626c: e0 92 bc 06 sts 0x06BC, r14 ; 0x8006bc 16270: f0 92 bd 06 sts 0x06BD, r15 ; 0x8006bd 16274: 70 e0 ldi r23, 0x00 ; 0 16276: 60 e0 ldi r22, 0x00 ; 0 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 16278: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 1627c: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 16280: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 16284: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 16288: 22 ff sbrs r18, 2 1628a: 2b c0 rjmp .+86 ; 0x162e2 1628c: 84 1b sub r24, r20 1628e: 95 0b sbc r25, r21 16290: a6 0b sbc r26, r22 16292: b7 0b sbc r27, r23 16294: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 16298: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 1629c: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 162a0: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 // DBG(_n(" after xyzcal_update_pos x=%ld y=%ld z=%ld\n"), count_position[0], count_position[1], count_position[2]); } 162a4: ff 90 pop r15 162a6: ef 90 pop r14 162a8: df 90 pop r13 162aa: cf 90 pop r12 162ac: 08 95 ret uint8_t xyzcal_dm = 0; void xyzcal_update_pos(uint16_t dx, uint16_t dy, uint16_t dz, uint16_t) { // DBG(_n("xyzcal_update_pos dx=%d dy=%d dz=%d dir=%02x\n"), dx, dy, dz, xyzcal_dm); if (xyzcal_dm&1) count_position[0] -= dx; else count_position[0] += dx; 162ae: 8c 0d add r24, r12 162b0: 9d 1d adc r25, r13 162b2: ae 1d adc r26, r14 162b4: bf 1d adc r27, r15 162b6: 80 93 b6 06 sts 0x06B6, r24 ; 0x8006b6 162ba: 90 93 b7 06 sts 0x06B7, r25 ; 0x8006b7 162be: a0 93 b8 06 sts 0x06B8, r26 ; 0x8006b8 162c2: b0 93 b9 06 sts 0x06B9, r27 ; 0x8006b9 162c6: bd cf rjmp .-134 ; 0x16242 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 162c8: 8c 0d add r24, r12 162ca: 9d 1d adc r25, r13 162cc: ae 1d adc r26, r14 162ce: bf 1d adc r27, r15 162d0: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 162d4: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb 162d8: a0 93 bc 06 sts 0x06BC, r26 ; 0x8006bc 162dc: b0 93 bd 06 sts 0x06BD, r27 ; 0x8006bd 162e0: c9 cf rjmp .-110 ; 0x16274 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 162e2: 84 0f add r24, r20 162e4: 95 1f adc r25, r21 162e6: a6 1f adc r26, r22 162e8: b7 1f adc r27, r23 162ea: d4 cf rjmp .-88 ; 0x16294 000162ec : inline bool is_digit(char c) { return c >= '0' && c <= '9'; } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ 162ec: fb 01 movw r30, r22 *v = 0; 162ee: 11 82 std Z+1, r1 ; 0x01 162f0: 10 82 st Z, r1 while(is_digit(*str)){ *v *= 10; 162f2: 6a e0 ldi r22, 0x0A ; 10 return c == 0 || c == ' ' || c == '\t' || c == '\n' || c == '\r'; } inline bool is_digit(char c) { return c >= '0' && c <= '9'; 162f4: dc 01 movw r26, r24 162f6: 2c 91 ld r18, X 162f8: 20 53 subi r18, 0x30 ; 48 } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ *v = 0; while(is_digit(*str)){ 162fa: 2a 30 cpi r18, 0x0A ; 10 162fc: a0 f4 brcc .+40 ; 0x16326 *v *= 10; 162fe: 40 81 ld r20, Z 16300: 51 81 ldd r21, Z+1 ; 0x01 16302: 64 9f mul r22, r20 16304: 90 01 movw r18, r0 16306: 65 9f mul r22, r21 16308: 30 0d add r19, r0 1630a: 11 24 eor r1, r1 1630c: 31 83 std Z+1, r19 ; 0x01 1630e: 20 83 st Z, r18 *v += *str - '0'; 16310: 4d 91 ld r20, X+ 16312: cd 01 movw r24, r26 16314: 20 53 subi r18, 0x30 ; 48 16316: 31 09 sbc r19, r1 16318: 24 0f add r18, r20 1631a: 31 1d adc r19, r1 1631c: 47 fd sbrc r20, 7 1631e: 3a 95 dec r19 16320: 31 83 std Z+1, r19 ; 0x01 16322: 20 83 st Z, r18 16324: e7 cf rjmp .-50 ; 0x162f4 ++str; } return str; } 16326: 08 95 ret 00016328 : } //! @brief Send host action "start" void lcd_send_action_start() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_START); 16328: 8a ef ldi r24, 0xFA ; 250 1632a: 97 e6 ldi r25, 0x67 ; 103 1632c: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 lcd_return_to_status(); 16330: 0c 94 17 fe jmp 0x1fc2e ; 0x1fc2e 00016334 : //! Sends the printer state for next print via LCD menu to host //! The host has to set the printer ready state with `M72` to keep printer in sync with the host //! @endcode static void lcd_printer_ready_state_toggle() { if (GetPrinterState() == PrinterState::IsReady) { 16334: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.367> 16338: 81 30 cpi r24, 0x01 ; 1 1633a: 21 f4 brne .+8 ; 0x16344 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_NOT_READY); 1633c: 8c ea ldi r24, 0xAC ; 172 1633e: 97 e6 ldi r25, 0x67 ; 103 } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_READY); 16340: 0c 94 53 72 jmp 0xe4a6 ; 0xe4a6 16344: 8d e9 ldi r24, 0x9D ; 157 16346: 97 e6 ldi r25, 0x67 ; 103 16348: fb cf rjmp .-10 ; 0x16340 0001634a : return true; } #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) #endif //FILAMENT_SENSOR static bool lcd_selftest_manual_fan_check(const uint8_t _fan, const bool check_opposite, 1634a: 1f 93 push r17 1634c: cf 93 push r28 1634e: df 93 push r29 16350: c8 2f mov r28, r24 16352: d6 2f mov r29, r22 const bool _default) { bool _result = check_opposite; lcd_clear(); 16354: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_FAN)); 16358: 8c ee ldi r24, 0xEC ; 236 1635a: 93 e4 ldi r25, 0x43 ; 67 1635c: 0e 94 b1 6c call 0xd962 ; 0xd962 16360: ac 01 movw r20, r24 16362: 60 e0 ldi r22, 0x00 ; 0 16364: 80 e0 ldi r24, 0x00 ; 0 16366: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_puts_at_P(0, 1, check_opposite ? _T(MSG_SELFTEST_PART_FAN) : _T(MSG_SELFTEST_HOTEND_FAN)); setExtruderAutoFanState(3); break; case 1: // object cooling fan lcd_puts_at_P(0, 1, check_opposite ? _T(MSG_SELFTEST_HOTEND_FAN) : _T(MSG_SELFTEST_PART_FAN)); 1636a: 86 ec ldi r24, 0xC6 ; 198 1636c: 93 e4 ldi r25, 0x43 ; 67 1636e: c1 11 cpse r28, r1 16370: 02 c0 rjmp .+4 ; 0x16376 16372: 89 ed ldi r24, 0xD9 ; 217 16374: 93 e4 ldi r25, 0x43 ; 67 16376: 0e 94 b1 6c call 0xd962 ; 0xd962 1637a: ac 01 movw r20, r24 1637c: 61 e0 ldi r22, 0x01 ; 1 1637e: 80 e0 ldi r24, 0x00 ; 0 16380: 0e 94 8f 69 call 0xd31e ; 0xd31e } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 16384: 8f ef ldi r24, 0xFF ; 255 16386: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1638a: 80 93 05 05 sts 0x0505, r24 ; 0x800505 #endif manage_heater(); 1638e: 0f 94 5b 32 call 0x264b6 ; 0x264b6 // object cooling fan lcd_puts_at_P(0, 1, check_opposite ? _T(MSG_SELFTEST_HOTEND_FAN) : _T(MSG_SELFTEST_PART_FAN)); lcd_selftest_setfan(255); break; } _delay(500); 16392: 64 ef ldi r22, 0xF4 ; 244 16394: 71 e0 ldi r23, 0x01 ; 1 16396: 80 e0 ldi r24, 0x00 ; 0 16398: 90 e0 ldi r25, 0x00 ; 0 1639a: 0f 94 7b 0d call 0x21af6 ; 0x21af6 lcd_puts_at_P(1, 2, _T(MSG_SELFTEST_FAN_YES)); 1639e: 8b eb ldi r24, 0xBB ; 187 163a0: 93 e4 ldi r25, 0x43 ; 67 163a2: 0e 94 b1 6c call 0xd962 ; 0xd962 163a6: ac 01 movw r20, r24 163a8: 62 e0 ldi r22, 0x02 ; 2 163aa: 81 e0 ldi r24, 0x01 ; 1 163ac: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_putc_at(0, 3, '>'); 163b0: 4e e3 ldi r20, 0x3E ; 62 163b2: 63 e0 ldi r22, 0x03 ; 3 163b4: 80 e0 ldi r24, 0x00 ; 0 163b6: 0e 94 9b 69 call 0xd336 ; 0xd336 lcd_puts_P(_T(MSG_SELFTEST_FAN_NO)); 163ba: 8c ea ldi r24, 0xAC ; 172 163bc: 93 e4 ldi r25, 0x43 ; 67 163be: 0e 94 b1 6c call 0xd962 ; 0xd962 163c2: 0e 94 66 69 call 0xd2cc ; 0xd2cc lcd_encoder = _default; 163c6: 6d 2f mov r22, r29 163c8: 70 e0 ldi r23, 0x00 ; 0 163ca: 70 93 07 05 sts 0x0507, r23 ; 0x800507 163ce: 60 93 06 05 sts 0x0506, r22 ; 0x800506 KEEPALIVE_STATE(PAUSED_FOR_USER); 163d2: 84 e0 ldi r24, 0x04 ; 4 163d4: 80 93 78 02 sts 0x0278, r24 ; 0x800278 lcd_consume_click(); 163d8: 0e 94 93 6b call 0xd726 ; 0xd726 163dc: dc 2f mov r29, r28 do { if (lcd_encoder) { if (lcd_encoder < 0) { _result = !check_opposite; 163de: 11 e0 ldi r17, 0x01 ; 1 163e0: 1c 27 eor r17, r28 KEEPALIVE_STATE(PAUSED_FOR_USER); lcd_consume_click(); do { if (lcd_encoder) { 163e2: 80 91 06 05 lds r24, 0x0506 ; 0x800506 163e6: 90 91 07 05 lds r25, 0x0507 ; 0x800507 163ea: 00 97 sbiw r24, 0x00 ; 0 163ec: 19 f1 breq .+70 ; 0x16434 if (lcd_encoder < 0) { 163ee: 97 ff sbrs r25, 7 163f0: 0b c0 rjmp .+22 ; 0x16408 _result = !check_opposite; 163f2: d1 2f mov r29, r17 lcd_putc_at(0, 2, '>'); 163f4: 4e e3 ldi r20, 0x3E ; 62 163f6: 62 e0 ldi r22, 0x02 ; 2 163f8: 80 e0 ldi r24, 0x00 ; 0 163fa: 0e 94 9b 69 call 0xd336 ; 0xd336 lcd_putc_at(0, 3, ' '); 163fe: 40 e2 ldi r20, 0x20 ; 32 16400: 63 e0 ldi r22, 0x03 ; 3 16402: 80 e0 ldi r24, 0x00 ; 0 16404: 0e 94 9b 69 call 0xd336 ; 0xd336 } if (lcd_encoder > 0) { 16408: 80 91 06 05 lds r24, 0x0506 ; 0x800506 1640c: 90 91 07 05 lds r25, 0x0507 ; 0x800507 16410: 18 16 cp r1, r24 16412: 19 06 cpc r1, r25 16414: 5c f4 brge .+22 ; 0x1642c _result = check_opposite; lcd_putc_at(0, 2, ' '); 16416: 40 e2 ldi r20, 0x20 ; 32 16418: 62 e0 ldi r22, 0x02 ; 2 1641a: 80 e0 ldi r24, 0x00 ; 0 1641c: 0e 94 9b 69 call 0xd336 ; 0xd336 lcd_putc_at(0, 3, '>'); 16420: 4e e3 ldi r20, 0x3E ; 62 16422: 63 e0 ldi r22, 0x03 ; 3 16424: 80 e0 ldi r24, 0x00 ; 0 16426: 0e 94 9b 69 call 0xd336 ; 0xd336 1642a: dc 2f mov r29, r28 } lcd_encoder = 0; 1642c: 10 92 07 05 sts 0x0507, r1 ; 0x800507 16430: 10 92 06 05 sts 0x0506, r1 ; 0x800506 } manage_heater(); 16434: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(true); 16438: 81 e0 ldi r24, 0x01 ; 1 1643a: 0e 94 01 7a call 0xf402 ; 0xf402 _delay(100); 1643e: 64 e6 ldi r22, 0x64 ; 100 16440: 70 e0 ldi r23, 0x00 ; 0 16442: 80 e0 ldi r24, 0x00 ; 0 16444: 90 e0 ldi r25, 0x00 ; 0 16446: 0f 94 7b 0d call 0x21af6 ; 0x21af6 } while (!lcd_clicked()); 1644a: 0e 94 98 6b call 0xd730 ; 0xd730 1644e: 88 23 and r24, r24 16450: 41 f2 breq .-112 ; 0x163e2 KEEPALIVE_STATE(IN_HANDLER); 16452: 82 e0 ldi r24, 0x02 ; 2 16454: 80 93 78 02 sts 0x0278, r24 ; 0x800278 setExtruderAutoFanState(0); // Turn off hotend fan 16458: 80 e0 ldi r24, 0x00 ; 0 1645a: 0e 94 3f 6e call 0xdc7e ; 0xdc7e } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1645e: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 16462: 10 92 05 05 sts 0x0505, r1 ; 0x800505 #endif manage_heater(); 16466: 0f 94 5b 32 call 0x264b6 ; 0x264b6 KEEPALIVE_STATE(IN_HANDLER); setExtruderAutoFanState(0); // Turn off hotend fan lcd_selftest_setfan(0); // Turn off print fan return _result; } 1646a: 8d 2f mov r24, r29 1646c: df 91 pop r29 1646e: cf 91 pop r28 16470: 1f 91 pop r17 16472: 08 95 ret 00016474 : planner_synchronize(); Disable_E0(); } void MMU2::execute_load_to_nozzle_sequence() { 16474: cf 93 push r28 16476: df 93 push r29 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 16478: 0f 94 42 22 call 0x24484 ; 0x24484 float planner_get_current_position_E() { return current_position[E_AXIS]; } void planner_set_current_position_E(float e) { current_position[E_AXIS] = e; 1647c: c5 ef ldi r28, 0xF5 ; 245 1647e: d1 e1 ldi r29, 0x11 ; 17 planner_synchronize(); // Compensate for configurable Extra Loading Distance planner_set_current_position_E(planner_get_current_position_E() - (logic.ExtraLoadDistance() - MMU2_FILAMENT_SENSOR_POSITION)); 16480: 60 91 71 12 lds r22, 0x1271 ; 0x801271 16484: 70 e0 ldi r23, 0x00 ; 0 16486: 90 e0 ldi r25, 0x00 ; 0 16488: 80 e0 ldi r24, 0x00 ; 0 1648a: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 1648e: 9b 01 movw r18, r22 16490: ac 01 movw r20, r24 16492: 6c 85 ldd r22, Y+12 ; 0x0c 16494: 7d 85 ldd r23, Y+13 ; 0x0d 16496: 8e 85 ldd r24, Y+14 ; 0x0e 16498: 9f 85 ldd r25, Y+15 ; 0x0f 1649a: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1649e: 6c 87 std Y+12, r22 ; 0x0c 164a0: 7d 87 std Y+13, r23 ; 0x0d 164a2: 8e 87 std Y+14, r24 ; 0x0e 164a4: 9f 87 std Y+15, r25 ; 0x0f execute_extruder_sequence(load_to_nozzle_sequence, sizeof(load_to_nozzle_sequence) / sizeof(load_to_nozzle_sequence[0])); 164a6: 62 e0 ldi r22, 0x02 ; 2 164a8: 84 ea ldi r24, 0xA4 ; 164 164aa: 96 e8 ldi r25, 0x86 ; 134 } 164ac: df 91 pop r29 164ae: cf 91 pop r28 void MMU2::execute_load_to_nozzle_sequence() { planner_synchronize(); // Compensate for configurable Extra Loading Distance planner_set_current_position_E(planner_get_current_position_E() - (logic.ExtraLoadDistance() - MMU2_FILAMENT_SENSOR_POSITION)); execute_extruder_sequence(load_to_nozzle_sequence, sizeof(load_to_nozzle_sequence) / sizeof(load_to_nozzle_sequence[0])); 164b0: 0d 94 8b 53 jmp 0x2a716 ; 0x2a716 000164b4 : return (_progress >= _progress_scale * 2) ? 0 : _progress; } static void lcd_selftest_screen_step(const uint8_t _row, const uint8_t _col, const uint8_t _state, const char *_name_PROGMEM, const char _indicator) { 164b4: 0f 93 push r16 164b6: 1f 93 push r17 164b8: cf 93 push r28 164ba: df 93 push r29 164bc: 98 2f mov r25, r24 164be: 86 2f mov r24, r22 164c0: 14 2f mov r17, r20 164c2: e9 01 movw r28, r18 lcd_set_cursor(_col, _row); 164c4: 69 2f mov r22, r25 164c6: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 switch (_state) 164ca: 11 30 cpi r17, 0x01 ; 1 164cc: 21 f0 breq .+8 ; 0x164d6 164ce: 12 30 cpi r17, 0x02 ; 2 164d0: 79 f0 breq .+30 ; 0x164f0 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 164d2: ce 01 movw r24, r28 164d4: 15 c0 rjmp .+42 ; 0x16500 { lcd_set_cursor(_col, _row); switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); 164d6: ce 01 movw r24, r28 164d8: 0e 94 66 69 call 0xd2cc ; 0xd2cc lcd_putc(':'); 164dc: 8a e3 ldi r24, 0x3A ; 58 164de: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 lcd_putc(_indicator); 164e2: 80 2f mov r24, r16 lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); } } 164e4: df 91 pop r29 164e6: cf 91 pop r28 164e8: 1f 91 pop r17 164ea: 0f 91 pop r16 switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_putc(_indicator); 164ec: 0c 94 6a 69 jmp 0xd2d4 ; 0xd2d4 break; case 2: lcd_puts_P(_name_PROGMEM); 164f0: ce 01 movw r24, r28 164f2: 0e 94 66 69 call 0xd2cc ; 0xd2cc lcd_putc(':'); 164f6: 8a e3 ldi r24, 0x3A ; 58 164f8: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 lcd_puts_P(MSG_OK_CAPS); 164fc: 83 ed ldi r24, 0xD3 ; 211 164fe: 97 e6 ldi r25, 0x67 ; 103 break; default: lcd_puts_P(_name_PROGMEM); } } 16500: df 91 pop r29 16502: cf 91 pop r28 16504: 1f 91 pop r17 16506: 0f 91 pop r16 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 16508: 0c 94 66 69 jmp 0xd2cc ; 0xd2cc 0001650c : } } menu_item++; } void __attribute__((noinline)) menu_item_function_E(const Sheet &sheet, menu_func_t func) 1650c: df 92 push r13 1650e: ef 92 push r14 16510: ff 92 push r15 16512: 0f 93 push r16 16514: 1f 93 push r17 16516: cf 93 push r28 16518: df 93 push r29 1651a: cd b7 in r28, 0x3d ; 61 1651c: de b7 in r29, 0x3e ; 62 1651e: 63 97 sbiw r28, 0x13 ; 19 16520: 0f b6 in r0, 0x3f ; 63 16522: f8 94 cli 16524: de bf out 0x3e, r29 ; 62 16526: 0f be out 0x3f, r0 ; 63 16528: cd bf out 0x3d, r28 ; 61 { if (menu_item == menu_line) 1652a: 30 91 31 04 lds r19, 0x0431 ; 0x800431 1652e: 20 91 30 04 lds r18, 0x0430 ; 0x800430 16532: 32 13 cpse r19, r18 16534: 73 c0 rjmp .+230 ; 0x1661c 16536: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_select_sheet_E(' ', sheet); 16538: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1653c: 88 23 and r24, r24 1653e: 09 f4 brne .+2 ; 0x16542 16540: 45 c0 rjmp .+138 ; 0x165cc //! //! @param[in] sheet_E Sheet in EEPROM //! @param[out] buffer for formatted output void menu_format_sheet_select_E(const Sheet &sheet_E, SheetFormatBuffer &buffer) { uint_least8_t index = sprintf_P(buffer.c,PSTR("%-9.9S["), _T(MSG_SHEET)); 16542: 84 ea ldi r24, 0xA4 ; 164 16544: 93 e4 ldi r25, 0x43 ; 67 16546: 0e 94 b1 6c call 0xd962 ; 0xd962 1654a: 9f 93 push r25 1654c: 8f 93 push r24 1654e: 8c e9 ldi r24, 0x9C ; 156 16550: 96 e8 ldi r25, 0x86 ; 134 16552: 9f 93 push r25 16554: 8f 93 push r24 16556: 8e 01 movw r16, r28 16558: 0f 5f subi r16, 0xFF ; 255 1655a: 1f 4f sbci r17, 0xFF ; 255 1655c: 1f 93 push r17 1655e: 0f 93 push r16 16560: 0f 94 f3 9e call 0x33de6 ; 0x33de6 16564: d8 2e mov r13, r24 eeprom_read_block(&(buffer.c[index]), sheet_E.name, sizeof(sheet_E.name)/sizeof(sheet_E.name[0])); 16566: 47 e0 ldi r20, 0x07 ; 7 16568: 50 e0 ldi r21, 0x00 ; 0 1656a: b7 01 movw r22, r14 1656c: 80 0f add r24, r16 1656e: 91 2f mov r25, r17 16570: 91 1d adc r25, r1 16572: 0f 94 cc 9f call 0x33f98 ; 0x33f98 16576: 0f 90 pop r0 16578: 0f 90 pop r0 1657a: 0f 90 pop r0 1657c: 0f 90 pop r0 1657e: 0f 90 pop r0 16580: 0f 90 pop r0 16582: 20 e0 ldi r18, 0x00 ; 0 16584: 82 2f mov r24, r18 16586: 8d 0d add r24, r13 16588: 90 e0 ldi r25, 0x00 ; 0 for (const uint_least8_t start = index; static_cast(index - start) < sizeof(sheet_E.name)/sizeof(sheet_E.name[0]); ++index) 1658a: 27 30 cpi r18, 0x07 ; 7 1658c: 39 f0 breq .+14 ; 0x1659c 1658e: 2f 5f subi r18, 0xFF ; 255 { if (buffer.c[index] == '\0') break; 16590: f8 01 movw r30, r16 16592: e8 0f add r30, r24 16594: f9 1f adc r31, r25 16596: 30 81 ld r19, Z 16598: 31 11 cpse r19, r1 1659a: f4 cf rjmp .-24 ; 0x16584 } buffer.c[index] = ']'; 1659c: f8 01 movw r30, r16 1659e: e8 0f add r30, r24 165a0: f9 1f adc r31, r25 165a2: 2d e5 ldi r18, 0x5D ; 93 165a4: 20 83 st Z, r18 buffer.c[index + 1] = '\0'; 165a6: 8c 0f add r24, r28 165a8: 9d 1f adc r25, r29 165aa: fc 01 movw r30, r24 165ac: 12 82 std Z+2, r1 ; 0x02 static void menu_draw_item_select_sheet_E(char type_char, const Sheet &sheet) { SheetFormatBuffer buffer; menu_format_sheet_select_E(sheet, buffer); lcd_putc_at(0, menu_row, menu_selection_mark()); 165ae: 0f 94 7e 91 call 0x322fc ; 0x322fc 165b2: 48 2f mov r20, r24 165b4: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 165b8: 80 e0 ldi r24, 0x00 ; 0 165ba: 0e 94 9b 69 call 0xd336 ; 0xd336 lcd_print_pad(buffer.c, LCD_WIDTH - 2); 165be: 62 e1 ldi r22, 0x12 ; 18 165c0: c8 01 movw r24, r16 165c2: 0e 94 6a 6b call 0xd6d4 ; 0xd6d4 lcd_putc(type_char); 165c6: 80 e2 ldi r24, 0x20 ; 32 165c8: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 void __attribute__((noinline)) menu_item_function_E(const Sheet &sheet, menu_func_t func) { if (menu_item == menu_line) { if (lcd_draw_update) menu_draw_item_select_sheet_E(' ', sheet); if (menu_clicked && (lcd_encoder == menu_item)) 165cc: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 165d0: 88 23 and r24, r24 165d2: 21 f1 breq .+72 ; 0x1661c 165d4: 20 91 31 04 lds r18, 0x0431 ; 0x800431 165d8: 80 91 06 05 lds r24, 0x0506 ; 0x800506 165dc: 90 91 07 05 lds r25, 0x0507 ; 0x800507 165e0: 28 17 cp r18, r24 165e2: 19 06 cpc r1, r25 165e4: d9 f4 brne .+54 ; 0x1661c { lcd_update_enabled = 0; 165e6: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c if (func) func(); 165ea: 8a e3 ldi r24, 0x3A ; 58 165ec: 9f e6 ldi r25, 0x6F ; 111 165ee: 89 2b or r24, r25 165f0: 11 f0 breq .+4 ; 0x165f6 165f2: 0e 94 3a 6f call 0xde74 ; 0xde74 lcd_update_enabled = 1; 165f6: 81 e0 ldi r24, 0x01 ; 1 165f8: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c menu_item_ret(); 165fc: 0f 94 a2 91 call 0x32344 ; 0x32344 return; } } menu_item++; } 16600: 63 96 adiw r28, 0x13 ; 19 16602: 0f b6 in r0, 0x3f ; 63 16604: f8 94 cli 16606: de bf out 0x3e, r29 ; 62 16608: 0f be out 0x3f, r0 ; 63 1660a: cd bf out 0x3d, r28 ; 61 1660c: df 91 pop r29 1660e: cf 91 pop r28 16610: 1f 91 pop r17 16612: 0f 91 pop r16 16614: ff 90 pop r15 16616: ef 90 pop r14 16618: df 90 pop r13 1661a: 08 95 ret lcd_update_enabled = 1; menu_item_ret(); return; } } menu_item++; 1661c: 80 91 31 04 lds r24, 0x0431 ; 0x800431 16620: 8f 5f subi r24, 0xFF ; 255 16622: 80 93 31 04 sts 0x0431, r24 ; 0x800431 16626: ec cf rjmp .-40 ; 0x16600 00016628 : } #endif //PINDA_TEMP_COMP void lcd_heat_bed_on_load_toggle() { uint8_t value = eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT); 16628: 87 ea ldi r24, 0xA7 ; 167 1662a: 9c e0 ldi r25, 0x0C ; 12 1662c: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 if (value > 1) value = 1; 16630: 61 e0 ldi r22, 0x01 ; 1 #endif //PINDA_TEMP_COMP void lcd_heat_bed_on_load_toggle() { uint8_t value = eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT); if (value > 1) 16632: 82 30 cpi r24, 0x02 ; 2 16634: 08 f4 brcc .+2 ; 0x16638 16636: 68 27 eor r22, r24 16638: 87 ea ldi r24, 0xA7 ; 167 1663a: 9c e0 ldi r25, 0x0C ; 12 1663c: 0d 94 00 a0 jmp 0x34000 ; 0x34000 00016640 : else mesh_nr = 3; eeprom_update_byte_notify((uint8_t*)EEPROM_MBL_POINTS_NR, mesh_nr); } static void mbl_probe_nr_toggle() { uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 16640: 8a ea ldi r24, 0xAA ; 170 16642: 9d e0 ldi r25, 0x0D ; 13 16644: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 switch (mbl_z_probe_nr) { case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; 16648: 65 e0 ldi r22, 0x05 ; 5 eeprom_update_byte_notify((uint8_t*)EEPROM_MBL_POINTS_NR, mesh_nr); } static void mbl_probe_nr_toggle() { uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); switch (mbl_z_probe_nr) { 1664a: 83 30 cpi r24, 0x03 ; 3 1664c: 21 f0 breq .+8 ; 0x16656 case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; case 5: mbl_z_probe_nr = 1; break; 1664e: 61 e0 ldi r22, 0x01 ; 1 eeprom_update_byte_notify((uint8_t*)EEPROM_MBL_POINTS_NR, mesh_nr); } static void mbl_probe_nr_toggle() { uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); switch (mbl_z_probe_nr) { 16650: 85 30 cpi r24, 0x05 ; 5 16652: 09 f0 breq .+2 ; 0x16656 case 1: mbl_z_probe_nr = 3; break; 16654: 63 e0 ldi r22, 0x03 ; 3 16656: 8a ea ldi r24, 0xAA ; 170 16658: 9d e0 ldi r25, 0x0D ; 13 1665a: 0d 94 00 a0 jmp 0x34000 ; 0x34000 0001665e : magnet_elimination = !magnet_elimination; eeprom_update_byte_notify((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION, (uint8_t)magnet_elimination); } static void mbl_mesh_toggle() { uint8_t mesh_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 1665e: 8b ea ldi r24, 0xAB ; 171 16660: 9d e0 ldi r25, 0x0D ; 13 16662: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 if(mesh_nr == 3) mesh_nr = 7; else mesh_nr = 3; 16666: 63 e0 ldi r22, 0x03 ; 3 eeprom_update_byte_notify((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION, (uint8_t)magnet_elimination); } static void mbl_mesh_toggle() { uint8_t mesh_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); if(mesh_nr == 3) mesh_nr = 7; 16668: 83 30 cpi r24, 0x03 ; 3 1666a: 09 f4 brne .+2 ; 0x1666e 1666c: 67 e0 ldi r22, 0x07 ; 7 1666e: 8b ea ldi r24, 0xAB ; 171 16670: 9d e0 ldi r25, 0x0D ; 13 16672: 0d 94 00 a0 jmp 0x34000 ; 0x34000 00016676 : #endif //LCD_BL_PIN MENU_END(); } static void mbl_magnets_elimination_toggle() { bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); 16676: 8c ea ldi r24, 0xAC ; 172 16678: 9d e0 ldi r25, 0x0D ; 13 1667a: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 magnet_elimination = !magnet_elimination; 1667e: 61 e0 ldi r22, 0x01 ; 1 16680: 81 11 cpse r24, r1 16682: 60 e0 ldi r22, 0x00 ; 0 16684: 8c ea ldi r24, 0xAC ; 172 16686: 9d e0 ldi r25, 0x0D ; 13 16688: 0d 94 00 a0 jmp 0x34000 ; 0x34000 0001668c : 1668c: 60 91 98 03 lds r22, 0x0398 ; 0x800398 16690: 81 ea ldi r24, 0xA1 ; 161 16692: 9d e0 ldi r25, 0x0D ; 13 16694: 0f 94 00 a0 call 0x34000 ; 0x34000 //! @brief Activate selected_sheet and run first layer calibration static void activate_calibrate_sheet() { eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), selected_sheet); lcd_first_layer_calibration_reset(); 16698: 0d 94 27 00 jmp 0x2004e ; 0x2004e 0001669c : } return 0; } bool eeprom_fw_version_older_than_p(const uint16_t (&ver_req)[4]) { 1669c: 0f 93 push r16 1669e: 1f 93 push r17 166a0: cf 93 push r28 166a2: df 93 push r29 166a4: 00 d0 rcall .+0 ; 0x166a6 166a6: 00 d0 rcall .+0 ; 0x166a8 166a8: 1f 92 push r1 166aa: 1f 92 push r1 166ac: cd b7 in r28, 0x3d ; 61 166ae: de b7 in r29, 0x3e ; 62 166b0: 8c 01 movw r16, r24 uint16_t ver_eeprom[4]; ver_eeprom[0] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR); 166b2: 8a e0 ldi r24, 0x0A ; 10 166b4: 90 e0 ldi r25, 0x00 ; 0 166b6: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 166ba: 9a 83 std Y+2, r25 ; 0x02 166bc: 89 83 std Y+1, r24 ; 0x01 ver_eeprom[1] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR); 166be: 8c e0 ldi r24, 0x0C ; 12 166c0: 90 e0 ldi r25, 0x00 ; 0 166c2: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 166c6: 9c 83 std Y+4, r25 ; 0x04 166c8: 8b 83 std Y+3, r24 ; 0x03 ver_eeprom[2] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION); 166ca: 8e e0 ldi r24, 0x0E ; 14 166cc: 90 e0 ldi r25, 0x00 ; 0 166ce: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 166d2: 9e 83 std Y+6, r25 ; 0x06 166d4: 8d 83 std Y+5, r24 ; 0x05 ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR); 166d6: 80 e1 ldi r24, 0x10 ; 16 166d8: 90 e0 ldi r25, 0x00 ; 0 166da: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 166de: 98 87 std Y+8, r25 ; 0x08 166e0: 8f 83 std Y+7, r24 ; 0x07 166e2: c8 01 movw r24, r16 166e4: de 01 movw r26, r28 166e6: 11 96 adiw r26, 0x01 ; 1 166e8: be 01 movw r22, r28 166ea: 67 5f subi r22, 0xF7 ; 247 166ec: 7f 4f sbci r23, 0xFF ; 255 for (uint8_t i = 0; i < 4; ++i) { uint16_t v = pgm_read_word(&ver_req[i]); 166ee: fc 01 movw r30, r24 166f0: 25 91 lpm r18, Z+ 166f2: 34 91 lpm r19, Z if (v > ver_eeprom[i]) 166f4: 4d 91 ld r20, X+ 166f6: 5d 91 ld r21, X+ 166f8: 42 17 cp r20, r18 166fa: 53 07 cpc r21, r19 166fc: 48 f0 brcs .+18 ; 0x16710 return true; else if (v < ver_eeprom[i]) 166fe: 24 17 cp r18, r20 16700: 35 07 cpc r19, r21 16702: 20 f0 brcs .+8 ; 0x1670c 16704: 02 96 adiw r24, 0x02 ; 2 ver_eeprom[0] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR); ver_eeprom[1] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR); ver_eeprom[2] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION); ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR); for (uint8_t i = 0; i < 4; ++i) { 16706: a6 17 cp r26, r22 16708: b7 07 cpc r27, r23 1670a: 89 f7 brne .-30 ; 0x166ee return true; else if (v < ver_eeprom[i]) break; } return false; 1670c: 80 e0 ldi r24, 0x00 ; 0 1670e: 01 c0 rjmp .+2 ; 0x16712 ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR); for (uint8_t i = 0; i < 4; ++i) { uint16_t v = pgm_read_word(&ver_req[i]); if (v > ver_eeprom[i]) return true; 16710: 81 e0 ldi r24, 0x01 ; 1 else if (v < ver_eeprom[i]) break; } return false; } 16712: 28 96 adiw r28, 0x08 ; 8 16714: 0f b6 in r0, 0x3f ; 63 16716: f8 94 cli 16718: de bf out 0x3e, r29 ; 62 1671a: 0f be out 0x3f, r0 ; 63 1671c: cd bf out 0x3d, r28 ; 61 1671e: df 91 pop r29 16720: cf 91 pop r28 16722: 1f 91 pop r17 16724: 0f 91 pop r16 16726: 08 95 ret 00016728 : eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() 16728: cf 93 push r28 1672a: df 93 push r29 MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_STEALTH), lcd_silent_mode_set); } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), NULL, lcd_crash_mode_info); } #else // TMC2130 switch (eeprom_read_byte((uint8_t *)EEPROM_SILENT)) 1672c: 8f ef ldi r24, 0xFF ; 255 1672e: 9f e0 ldi r25, 0x0F ; 15 16730: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 16734: 81 30 cpi r24, 0x01 ; 1 16736: 99 f0 breq .+38 ; 0x1675e 16738: 82 30 cpi r24, 0x02 ; 2 1673a: a1 f0 breq .+40 ; 0x16764 { case SILENT_MODE_POWER: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_HIGH_POWER), lcd_silent_mode_set); 1673c: 88 e3 ldi r24, 0x38 ; 56 1673e: 90 e4 ldi r25, 0x40 ; 64 break; case SILENT_MODE_SILENT: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_SILENT), lcd_silent_mode_set); break; case SILENT_MODE_AUTO: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_AUTO_POWER), lcd_silent_mode_set); 16740: 0e 94 b1 6c call 0xd962 ; 0xd962 16744: ec 01 movw r28, r24 16746: 81 e3 ldi r24, 0x31 ; 49 16748: 90 e4 ldi r25, 0x40 ; 64 1674a: 0e 94 b1 6c call 0xd962 ; 0xd962 1674e: 22 e0 ldi r18, 0x02 ; 2 16750: 43 e5 ldi r20, 0x53 ; 83 16752: 57 e3 ldi r21, 0x37 ; 55 16754: be 01 movw r22, r28 MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_HIGH_POWER), lcd_silent_mode_set); break; // (probably) not needed } #endif // TMC2130 } } 16756: df 91 pop r29 16758: cf 91 pop r28 break; case SILENT_MODE_SILENT: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_SILENT), lcd_silent_mode_set); break; case SILENT_MODE_AUTO: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_AUTO_POWER), lcd_silent_mode_set); 1675a: 0d 94 4b 94 jmp 0x32896 ; 0x32896 { case SILENT_MODE_POWER: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_HIGH_POWER), lcd_silent_mode_set); break; case SILENT_MODE_SILENT: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_SILENT), lcd_silent_mode_set); 1675e: 88 e2 ldi r24, 0x28 ; 40 16760: 90 e4 ldi r25, 0x40 ; 64 16762: ee cf rjmp .-36 ; 0x16740 break; case SILENT_MODE_AUTO: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_AUTO_POWER), lcd_silent_mode_set); 16764: 8b e1 ldi r24, 0x1B ; 27 16766: 90 e4 ldi r25, 0x40 ; 64 16768: eb cf rjmp .-42 ; 0x16740 0001676a : uint8_t experimental_menu_visibility; } _menu_data_t; static_assert(sizeof(menu_data)>= sizeof(_menu_data_t),"_menu_data_t doesn't fit into menu_data"); _menu_data_t* _md = (_menu_data_t*)&(menu_data[0]); if (_md->status == 0 || lcd_draw_update) 1676a: 80 91 64 03 lds r24, 0x0364 ; 0x800364 1676e: 88 23 and r24, r24 16770: 21 f0 breq .+8 ; 0x1677a 16772: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 16776: 88 23 and r24, r24 16778: 51 f0 breq .+20 ; 0x1678e { _md->status = 1; 1677a: 81 e0 ldi r24, 0x01 ; 1 1677c: 80 93 64 03 sts 0x0364, r24 ; 0x800364 _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); 16780: 60 e0 ldi r22, 0x00 ; 0 16782: 8a e2 ldi r24, 0x2A ; 42 16784: 9d e0 ldi r25, 0x0D ; 13 16786: 0e 94 ed 6e call 0xddda ; 0xddda 1678a: 80 93 65 03 sts 0x0365, r24 ; 0x800365 } MENU_BEGIN(); 1678e: 0f 94 bc 92 call 0x32578 ; 0x32578 16792: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 16796: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1679a: 84 30 cpi r24, 0x04 ; 4 1679c: 08 f0 brcs .+2 ; 0x167a0 1679e: 90 c0 rjmp .+288 ; 0x168c0 167a0: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 167a4: 80 91 ba 03 lds r24, 0x03BA ; 0x8003ba 167a8: 81 11 cpse r24, r1 167aa: 55 c0 rjmp .+170 ; 0x16856 167ac: 84 e1 ldi r24, 0x14 ; 20 167ae: 90 e4 ldi r25, 0x40 ; 64 167b0: 0e 94 b1 6c call 0xd962 ; 0xd962 167b4: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); 167b8: 85 ef ldi r24, 0xF5 ; 245 167ba: 9b e3 ldi r25, 0x3B ; 59 167bc: 0e 94 b1 6c call 0xd962 ; 0xd962 167c0: 6b e9 ldi r22, 0x9B ; 155 167c2: 7c eb ldi r23, 0xBC ; 188 167c4: 0f 94 ea 94 call 0x329d4 ; 0x329d4 SETTINGS_NOZZLE; 167c8: 80 91 b9 03 lds r24, 0x03B9 ; 0x8003b9 167cc: 8c 33 cpi r24, 0x3C ; 60 167ce: 09 f4 brne .+2 ; 0x167d2 167d0: 60 c0 rjmp .+192 ; 0x16892 167d2: 08 f0 brcs .+2 ; 0x167d6 167d4: 43 c0 rjmp .+134 ; 0x1685c 167d6: 89 31 cpi r24, 0x19 ; 25 167d8: 09 f4 brne .+2 ; 0x167dc 167da: 4f c0 rjmp .+158 ; 0x1687a 167dc: 88 32 cpi r24, 0x28 ; 40 167de: 09 f4 brne .+2 ; 0x167e2 167e0: 42 c0 rjmp .+132 ; 0x16866 MENU_ITEM_FUNCTION_P(_T(MSG_NOZZLE_CNG_MENU),nozzle_change); 167e2: 8e e8 ldi r24, 0x8E ; 142 167e4: 9a e3 ldi r25, 0x3A ; 58 167e6: 0e 94 b1 6c call 0xd962 ; 0xd962 167ea: 6d e1 ldi r22, 0x1D ; 29 167ec: 76 ec ldi r23, 0xC6 ; 198 167ee: 0f 94 39 92 call 0x32472 ; 0x32472 MENU_ITEM_SUBMENU_P(_T(MSG_CHECKS), lcd_checking_menu); 167f2: 8b e3 ldi r24, 0x3B ; 59 167f4: 9a e3 ldi r25, 0x3A ; 58 167f6: 0e 94 b1 6c call 0xd962 ; 0xd962 167fa: 6d e1 ldi r22, 0x1D ; 29 167fc: 7c ef ldi r23, 0xFC ; 252 167fe: 0f 94 ea 94 call 0x329d4 ; 0x329d4 //! Fsensor Detection isn't ready for mmu yet it is temporarily disabled. //! @todo Don't forget to remove this as soon Fsensor Detection works with mmu if(!MMU2::mmu2.Enabled()) MENU_ITEM_FUNCTION_P(PSTR("Fsensor Detection"), lcd_detect_IRsensor); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) if (_md->experimental_menu_visibility) 16802: 80 91 65 03 lds r24, 0x0365 ; 0x800365 16806: 88 23 and r24, r24 16808: 31 f0 breq .+12 ; 0x16816 { MENU_ITEM_SUBMENU_P(PSTR("Experimental"), lcd_experimental_menu);////MSG_MENU_EXPERIMENTAL c=18 1680a: 61 e6 ldi r22, 0x61 ; 97 1680c: 74 eb ldi r23, 0xB4 ; 180 1680e: 87 e7 ldi r24, 0x77 ; 119 16810: 92 e8 ldi r25, 0x82 ; 130 16812: 0f 94 ea 94 call 0x329d4 ; 0x329d4 //! The SuperPINDA is detected when the PINDA temp is below its defined limit. //! This works well on the EINSY board but not on the miniRAMBo board as //! as a disconnected SuperPINDA will show higher temps compared to an EINSY board. //! //! This menu allows the user to en-/disable the SuperPINDA manualy MENU_ITEM_TOGGLE_P(_N("SuperPINDA"), eeprom_read_byte((uint8_t *)EEPROM_PINDA_TEMP_COMPENSATION) ? _T(MSG_YES) : _T(MSG_NO), lcd_pinda_temp_compensation_toggle); 16816: 89 e2 ldi r24, 0x29 ; 41 16818: 9d e0 ldi r25, 0x0D ; 13 1681a: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1681e: 88 23 and r24, r24 16820: 09 f4 brne .+2 ; 0x16824 16822: 4b c0 rjmp .+150 ; 0x168ba 16824: 82 eb ldi r24, 0xB2 ; 178 16826: 9d e3 ldi r25, 0x3D ; 61 16828: 0e 94 b1 6c call 0xd962 ; 0xd962 1682c: 22 e0 ldi r18, 0x02 ; 2 1682e: 4f ec ldi r20, 0xCF ; 207 16830: 55 eb ldi r21, 0xB5 ; 181 16832: bc 01 movw r22, r24 16834: 86 e4 ldi r24, 0x46 ; 70 16836: 97 e6 ldi r25, 0x67 ; 103 16838: 0f 94 4b 94 call 0x32896 ; 0x32896 #endif //PINDA_TEMP_COMP MENU_END(); 1683c: 0f 94 90 92 call 0x32520 ; 0x32520 _md->status = 1; _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); } MENU_BEGIN(); 16840: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16844: 8f 5f subi r24, 0xFF ; 255 16846: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1684a: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1684e: 8f 5f subi r24, 0xFF ; 255 16850: 80 93 30 04 sts 0x0430, r24 ; 0x800430 16854: a0 cf rjmp .-192 ; 0x16796 MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 16856: 87 ea ldi r24, 0xA7 ; 167 16858: 9d e3 ldi r25, 0x3D ; 61 1685a: aa cf rjmp .-172 ; 0x167b0 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); SETTINGS_NOZZLE; 1685c: 80 35 cpi r24, 0x50 ; 80 1685e: 19 f1 breq .+70 ; 0x168a6 16860: 8f 3f cpi r24, 0xFF ; 255 16862: 09 f0 breq .+2 ; 0x16866 16864: be cf rjmp .-132 ; 0x167e2 16866: 84 e4 ldi r24, 0x44 ; 68 16868: 9a e3 ldi r25, 0x3A ; 58 1686a: 0e 94 b1 6c call 0xd962 ; 0xd962 1686e: 22 e0 ldi r18, 0x02 ; 2 16870: 4b ed ldi r20, 0xDB ; 219 16872: 5c ef ldi r21, 0xFC ; 252 16874: 6e e8 ldi r22, 0x8E ; 142 16876: 72 e8 ldi r23, 0x82 ; 130 16878: 09 c0 rjmp .+18 ; 0x1688c 1687a: 84 e4 ldi r24, 0x44 ; 68 1687c: 9a e3 ldi r25, 0x3A ; 58 1687e: 0e 94 b1 6c call 0xd962 ; 0xd962 16882: 22 e0 ldi r18, 0x02 ; 2 16884: 4b ed ldi r20, 0xDB ; 219 16886: 5c ef ldi r21, 0xFC ; 252 16888: 63 e9 ldi r22, 0x93 ; 147 1688a: 72 e8 ldi r23, 0x82 ; 130 1688c: 0f 94 4b 94 call 0x32896 ; 0x32896 16890: a8 cf rjmp .-176 ; 0x167e2 16892: 84 e4 ldi r24, 0x44 ; 68 16894: 9a e3 ldi r25, 0x3A ; 58 16896: 0e 94 b1 6c call 0xd962 ; 0xd962 1689a: 22 e0 ldi r18, 0x02 ; 2 1689c: 4b ed ldi r20, 0xDB ; 219 1689e: 5c ef ldi r21, 0xFC ; 252 168a0: 69 e8 ldi r22, 0x89 ; 137 168a2: 72 e8 ldi r23, 0x82 ; 130 168a4: f3 cf rjmp .-26 ; 0x1688c 168a6: 84 e4 ldi r24, 0x44 ; 68 168a8: 9a e3 ldi r25, 0x3A ; 58 168aa: 0e 94 b1 6c call 0xd962 ; 0xd962 168ae: 22 e0 ldi r18, 0x02 ; 2 168b0: 4b ed ldi r20, 0xDB ; 219 168b2: 5c ef ldi r21, 0xFC ; 252 168b4: 64 e8 ldi r22, 0x84 ; 132 168b6: 72 e8 ldi r23, 0x82 ; 130 168b8: e9 cf rjmp .-46 ; 0x1688c //! The SuperPINDA is detected when the PINDA temp is below its defined limit. //! This works well on the EINSY board but not on the miniRAMBo board as //! as a disconnected SuperPINDA will show higher temps compared to an EINSY board. //! //! This menu allows the user to en-/disable the SuperPINDA manualy MENU_ITEM_TOGGLE_P(_N("SuperPINDA"), eeprom_read_byte((uint8_t *)EEPROM_PINDA_TEMP_COMPENSATION) ? _T(MSG_YES) : _T(MSG_NO), lcd_pinda_temp_compensation_toggle); 168ba: 88 eb ldi r24, 0xB8 ; 184 168bc: 9d e3 ldi r25, 0x3D ; 61 168be: b4 cf rjmp .-152 ; 0x16828 #endif //PINDA_TEMP_COMP MENU_END(); } 168c0: 08 95 ret 000168c2 : } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 168c2: 0f 94 bc 92 call 0x32578 ; 0x32578 168c6: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 168ca: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 168ce: 84 30 cpi r24, 0x04 ; 4 168d0: a8 f4 brcc .+42 ; 0x168fc 168d2: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_BACK)); 168d6: 84 e1 ldi r24, 0x14 ; 20 168d8: 90 e4 ldi r25, 0x40 ; 64 168da: 0e 94 b1 6c call 0xd962 ; 0xd962 168de: 0f 94 87 95 call 0x32b0e ; 0x32b0e #endif // DEBUG_PULLUP_CRASH #ifdef PRUSA_SN_SUPPORT MENU_ITEM_FUNCTION_P(_N("Fake serial number"), WorkaroundPrusaSN);////MSG_WORKAROUND_PRUSA_SN c=18 #endif //PRUSA_SN_SUPPORT MENU_END(); 168e2: 0f 94 90 92 call 0x32520 ; 0x32520 } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 168e6: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 168ea: 8f 5f subi r24, 0xFF ; 255 168ec: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 168f0: 80 91 30 04 lds r24, 0x0430 ; 0x800430 168f4: 8f 5f subi r24, 0xFF ; 255 168f6: 80 93 30 04 sts 0x0430, r24 ; 0x800430 168fa: e7 cf rjmp .-50 ; 0x168ca #ifdef PRUSA_SN_SUPPORT MENU_ITEM_FUNCTION_P(_N("Fake serial number"), WorkaroundPrusaSN);////MSG_WORKAROUND_PRUSA_SN c=18 #endif //PRUSA_SN_SUPPORT MENU_END(); } 168fc: 08 95 ret 000168fe : lcd_return_to_status(); } #endif //THERMAL_MODEL void lcd_sdcard_stop() { 168fe: cf 93 push r28 // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); 16900: 8d eb ldi r24, 0xBD ; 189 16902: 9d e3 ldi r25, 0x3D ; 61 16904: 0e 94 b1 6c call 0xd962 ; 0xd962 16908: ac 01 movw r20, r24 1690a: 60 e0 ldi r22, 0x00 ; 0 1690c: 80 e0 ldi r24, 0x00 ; 0 1690e: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_putc_at(0, 1, '\n'); 16912: 4a e0 ldi r20, 0x0A ; 10 16914: 61 e0 ldi r22, 0x01 ; 1 16916: 80 e0 ldi r24, 0x00 ; 0 16918: 0e 94 9b 69 call 0xd336 ; 0xd336 MENU_BEGIN(); 1691c: 0f 94 bc 92 call 0x32578 ; 0x32578 16920: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 16924: c2 e0 ldi r28, 0x02 ; 2 { // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); lcd_putc_at(0, 1, '\n'); MENU_BEGIN(); 16926: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1692a: 84 30 cpi r24, 0x04 ; 4 1692c: 18 f5 brcc .+70 ; 0x16974 1692e: 10 92 31 04 sts 0x0431, r1 ; 0x800431 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 16932: 81 11 cpse r24, r1 16934: 02 c0 rjmp .+4 ; 0x1693a 16936: c0 93 2e 04 sts 0x042E, r28 ; 0x80042e // Show No options first, the default selection MENU_ITEM_FUNCTION_P(_T(MSG_NO), lcd_return_to_status); 1693a: 88 eb ldi r24, 0xB8 ; 184 1693c: 9d e3 ldi r25, 0x3D ; 61 1693e: 0e 94 b1 6c call 0xd962 ; 0xd962 16942: 67 e1 ldi r22, 0x17 ; 23 16944: 7e ef ldi r23, 0xFE ; 254 16946: 0f 94 39 92 call 0x32472 ; 0x32472 MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); 1694a: 82 eb ldi r24, 0xB2 ; 178 1694c: 9d e3 ldi r25, 0x3D ; 61 1694e: 0e 94 b1 6c call 0xd962 ; 0xd962 16952: 6b ed ldi r22, 0xDB ; 219 16954: 7f ee ldi r23, 0xEF ; 239 16956: 0f 94 39 92 call 0x32472 ; 0x32472 MENU_END(); 1695a: 0f 94 90 92 call 0x32520 ; 0x32520 { // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); lcd_putc_at(0, 1, '\n'); MENU_BEGIN(); 1695e: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16962: 8f 5f subi r24, 0xFF ; 255 16964: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 16968: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1696c: 8f 5f subi r24, 0xFF ; 255 1696e: 80 93 30 04 sts 0x0430, r24 ; 0x800430 16972: d9 cf rjmp .-78 ; 0x16926 // Show No options first, the default selection MENU_ITEM_FUNCTION_P(_T(MSG_NO), lcd_return_to_status); MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); MENU_END(); } 16974: cf 91 pop r28 16976: 08 95 ret 00016978 : lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 16978: 0f 94 bc 92 call 0x32578 ; 0x32578 1697c: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 16980: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16984: 84 30 cpi r24, 0x04 ; 4 16986: 08 f0 brcs .+2 ; 0x1698a 16988: 3f c0 rjmp .+126 ; 0x16a08 1698a: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_STEEL_SHEETS)); 1698e: 85 ef ldi r24, 0xF5 ; 245 16990: 9b e3 ldi r25, 0x3B ; 59 16992: 0e 94 b1 6c call 0xd962 ; 0xd962 16996: 0f 94 87 95 call 0x32b0e ; 0x32b0e if(eeprom_is_sheet_initialized(selected_sheet)){ 1699a: 80 91 98 03 lds r24, 0x0398 ; 0x800398 1699e: 0e 94 18 6f call 0xde30 ; 0xde30 169a2: 88 23 and r24, r24 169a4: 41 f0 breq .+16 ; 0x169b6 MENU_ITEM_SUBMENU_P(_T(MSG_SELECT), change_sheet); 169a6: 8c ee ldi r24, 0xEC ; 236 169a8: 9b e3 ldi r25, 0x3B ; 59 169aa: 0e 94 b1 6c call 0xd962 ; 0xd962 169ae: 69 ed ldi r22, 0xD9 ; 217 169b0: 7b eb ldi r23, 0xBB ; 187 169b2: 0f 94 ea 94 call 0x329d4 ; 0x329d4 } if (lcd_commands_type == LcdCommands::Idle) 169b6: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 169ba: 81 11 cpse r24, r1 169bc: 08 c0 rjmp .+16 ; 0x169ce { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), activate_calibrate_sheet); 169be: 89 ed ldi r24, 0xD9 ; 217 169c0: 9b e3 ldi r25, 0x3B ; 59 169c2: 0e 94 b1 6c call 0xd962 ; 0xd962 169c6: 66 e4 ldi r22, 0x46 ; 70 169c8: 73 eb ldi r23, 0xB3 ; 179 169ca: 0f 94 ea 94 call 0x329d4 ; 0x329d4 } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); 169ce: 80 ed ldi r24, 0xD0 ; 208 169d0: 9b e3 ldi r25, 0x3B ; 59 169d2: 0e 94 b1 6c call 0xd962 ; 0xd962 169d6: 67 e4 ldi r22, 0x47 ; 71 169d8: 7a eb ldi r23, 0xBA ; 186 169da: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); 169de: 88 ec ldi r24, 0xC8 ; 200 169e0: 9b e3 ldi r25, 0x3B ; 59 169e2: 0e 94 b1 6c call 0xd962 ; 0xd962 169e6: 6f e3 ldi r22, 0x3F ; 63 169e8: 76 ec ldi r23, 0xC6 ; 198 169ea: 0f 94 39 92 call 0x32472 ; 0x32472 MENU_END(); 169ee: 0f 94 90 92 call 0x32520 ; 0x32520 lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 169f2: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 169f6: 8f 5f subi r24, 0xFF ; 255 169f8: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 169fc: 80 91 30 04 lds r24, 0x0430 ; 0x800430 16a00: 8f 5f subi r24, 0xFF ; 255 16a02: 80 93 30 04 sts 0x0430, r24 ; 0x800430 16a06: bc cf rjmp .-136 ; 0x16980 } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); MENU_END(); } 16a08: 08 95 ret 00016a0a ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a0a: 87 e0 ldi r24, 0x07 ; 7 16a0c: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a10: 0c 94 bc b4 jmp 0x16978 ; 0x16978 00016a14 ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a14: 86 e0 ldi r24, 0x06 ; 6 16a16: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a1a: 0c 94 bc b4 jmp 0x16978 ; 0x16978 00016a1e ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a1e: 85 e0 ldi r24, 0x05 ; 5 16a20: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a24: 0c 94 bc b4 jmp 0x16978 ; 0x16978 00016a28 ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a28: 84 e0 ldi r24, 0x04 ; 4 16a2a: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a2e: 0c 94 bc b4 jmp 0x16978 ; 0x16978 00016a32 ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a32: 83 e0 ldi r24, 0x03 ; 3 16a34: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a38: 0c 94 bc b4 jmp 0x16978 ; 0x16978 00016a3c ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a3c: 82 e0 ldi r24, 0x02 ; 2 16a3e: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a42: 0c 94 bc b4 jmp 0x16978 ; 0x16978 00016a46 ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a46: 81 e0 ldi r24, 0x01 ; 1 16a48: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a4c: 0c 94 bc b4 jmp 0x16978 ; 0x16978 00016a50 ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a50: 10 92 98 03 sts 0x0398, r1 ; 0x800398 lcd_sheet_menu(); 16a54: 0c 94 bc b4 jmp 0x16978 ; 0x16978 00016a58 : ++str; } return str; } bool __attribute__((noinline)) Tag(const char *str, const char *tag_P, uint8_t tagSize, uint16_t tagMask, uint16_t *v){ 16a58: cf 92 push r12 16a5a: df 92 push r13 16a5c: ef 92 push r14 16a5e: ff 92 push r15 16a60: 0f 93 push r16 16a62: 1f 93 push r17 16a64: cf 93 push r28 16a66: df 93 push r29 16a68: 6c 01 movw r12, r24 16a6a: 79 01 movw r14, r18 if( ! strncmp_P(str, tag_P, tagSize) ){ 16a6c: c4 2f mov r28, r20 16a6e: d0 e0 ldi r29, 0x00 ; 0 16a70: ae 01 movw r20, r28 16a72: 0f 94 bb 9d call 0x33b76 ; 0x33b76 16a76: 89 2b or r24, r25 16a78: b9 f4 brne .+46 ; 0x16aa8 Number(str + tagSize, v); 16a7a: b8 01 movw r22, r16 16a7c: c6 01 movw r24, r12 16a7e: 8c 0f add r24, r28 16a80: 9d 1f adc r25, r29 16a82: 0e 94 76 b1 call 0x162ec ; 0x162ec *v |= tagMask; 16a86: f8 01 movw r30, r16 16a88: 20 81 ld r18, Z 16a8a: 31 81 ldd r19, Z+1 ; 0x01 16a8c: 2e 29 or r18, r14 16a8e: 3f 29 or r19, r15 16a90: 31 83 std Z+1, r19 ; 0x01 16a92: 20 83 st Z, r18 return true; 16a94: 81 e0 ldi r24, 0x01 ; 1 } return false; } 16a96: df 91 pop r29 16a98: cf 91 pop r28 16a9a: 1f 91 pop r17 16a9c: 0f 91 pop r16 16a9e: ff 90 pop r15 16aa0: ef 90 pop r14 16aa2: df 90 pop r13 16aa4: cf 90 pop r12 16aa6: 08 95 ret if( ! strncmp_P(str, tag_P, tagSize) ){ Number(str + tagSize, v); *v |= tagMask; return true; } return false; 16aa8: 80 e0 ldi r24, 0x00 ; 0 16aaa: f5 cf rjmp .-22 ; 0x16a96 00016aac : } static void lcd_disable_farm_mode() { uint8_t disable = lcd_show_multiscreen_message_yes_no_and_wait_P(PSTR("Disable farm mode?"), true); //allow timeouting, default no 16aac: 41 e0 ldi r20, 0x01 ; 1 16aae: 61 e0 ldi r22, 0x01 ; 1 16ab0: 80 ec ldi r24, 0xC0 ; 192 16ab2: 92 e8 ldi r25, 0x82 ; 130 16ab4: 0f 94 e0 2d call 0x25bc0 ; 0x25bc0 if (disable == LCD_LEFT_BUTTON_CHOICE) 16ab8: 81 11 cpse r24, r1 16aba: 07 c0 rjmp .+14 ; 0x16aca { enquecommand_P(PSTR("G99")); 16abc: 61 e0 ldi r22, 0x01 ; 1 16abe: 8c eb ldi r24, 0xBC ; 188 16ac0: 92 e8 ldi r25, 0x82 ; 130 16ac2: 0e 94 af 7c call 0xf95e ; 0xf95e lcd_return_to_status(); 16ac6: 0e 94 17 fe call 0x1fc2e ; 0x1fc2e } lcd_update_enable(true); 16aca: 81 e0 ldi r24, 0x01 ; 1 16acc: 0e 94 c0 69 call 0xd380 ; 0xd380 lcd_draw_update = 2; 16ad0: 82 e0 ldi r24, 0x02 ; 2 16ad2: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } 16ad6: 08 95 ret 00016ad8 : else value = !value; eeprom_update_byte_notify((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, value); } void lcd_reprint_from_eeprom() { 16ad8: ef 92 push r14 16ada: ff 92 push r15 16adc: 0f 93 push r16 16ade: 1f 93 push r17 16ae0: cf 93 push r28 16ae2: df 93 push r29 16ae4: cd b7 in r28, 0x3d ; 61 16ae6: de b7 in r29, 0x3e ; 62 16ae8: 6b 97 sbiw r28, 0x1b ; 27 16aea: 0f b6 in r0, 0x3f ; 63 16aec: f8 94 cli 16aee: de bf out 0x3e, r29 ; 62 16af0: 0f be out 0x3f, r0 ; 63 16af2: cd bf out 0x3d, r28 ; 61 void restore_file_from_sd() { char filename[FILENAME_LENGTH]; char dir_name[9]; char extension_ptr[5]; uint8_t depth = eeprom_read_byte((uint8_t*)EEPROM_DIR_DEPTH); 16af4: 8a e5 ldi r24, 0x5A ; 90 16af6: 9f e0 ldi r25, 0x0F ; 15 16af8: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 16afc: e8 2e mov r14, r24 16afe: 0a e0 ldi r16, 0x0A ; 10 16b00: 1f e0 ldi r17, 0x0F ; 15 for (uint8_t i = 0; i < depth; i++) { 16b02: f1 2c mov r15, r1 card.chdir(dir_name, false); } // Recover DOS 8.3 filename without extension. // Short filenames are always null terminated. eeprom_read_block(filename, (const char *)EEPROM_FILENAME, 8); 16b04: 48 e0 ldi r20, 0x08 ; 8 16b06: 50 e0 ldi r21, 0x00 ; 0 char filename[FILENAME_LENGTH]; char dir_name[9]; char extension_ptr[5]; uint8_t depth = eeprom_read_byte((uint8_t*)EEPROM_DIR_DEPTH); for (uint8_t i = 0; i < depth; i++) { 16b08: ef 14 cp r14, r15 16b0a: 79 f0 breq .+30 ; 0x16b2a eeprom_read_block(dir_name, (const char *)EEPROM_DIRS + 8 * i, 8); 16b0c: b8 01 movw r22, r16 16b0e: ce 01 movw r24, r28 16b10: 0e 96 adiw r24, 0x0e ; 14 16b12: 0f 94 cc 9f call 0x33f98 ; 0x33f98 dir_name[8] = '\0'; 16b16: 1e 8a std Y+22, r1 ; 0x16 card.chdir(dir_name, false); 16b18: 60 e0 ldi r22, 0x00 ; 0 16b1a: ce 01 movw r24, r28 16b1c: 0e 96 adiw r24, 0x0e ; 14 16b1e: 0f 94 cf 4a call 0x2959e ; 0x2959e char filename[FILENAME_LENGTH]; char dir_name[9]; char extension_ptr[5]; uint8_t depth = eeprom_read_byte((uint8_t*)EEPROM_DIR_DEPTH); for (uint8_t i = 0; i < depth; i++) { 16b22: f3 94 inc r15 16b24: 08 5f subi r16, 0xF8 ; 248 16b26: 1f 4f sbci r17, 0xFF ; 255 16b28: ed cf rjmp .-38 ; 0x16b04 card.chdir(dir_name, false); } // Recover DOS 8.3 filename without extension. // Short filenames are always null terminated. eeprom_read_block(filename, (const char *)EEPROM_FILENAME, 8); 16b2a: 65 e9 ldi r22, 0x95 ; 149 16b2c: 7f e0 ldi r23, 0x0F ; 15 16b2e: 8e 01 movw r16, r28 16b30: 0f 5f subi r16, 0xFF ; 255 16b32: 1f 4f sbci r17, 0xFF ; 255 16b34: c8 01 movw r24, r16 16b36: 0f 94 cc 9f call 0x33f98 ; 0x33f98 // Add null delimiter in case all 8 characters were not NULL filename[8] = '\0'; 16b3a: 19 86 std Y+9, r1 ; 0x09 // Add extension to complete the DOS 8.3 filename e.g. ".gco" or ".g" extension_ptr[0] = '.'; 16b3c: 8e e2 ldi r24, 0x2E ; 46 16b3e: 8f 8b std Y+23, r24 ; 0x17 eeprom_read_block(&extension_ptr[1], (const char *)EEPROM_FILENAME_EXTENSION, 3); 16b40: 43 e0 ldi r20, 0x03 ; 3 16b42: 50 e0 ldi r21, 0x00 ; 0 16b44: 61 e9 ldi r22, 0x91 ; 145 16b46: 7c e0 ldi r23, 0x0C ; 12 16b48: ce 01 movw r24, r28 16b4a: 48 96 adiw r24, 0x18 ; 24 16b4c: 0f 94 cc 9f call 0x33f98 ; 0x33f98 extension_ptr[4] = '\0'; 16b50: 1b 8e std Y+27, r1 ; 0x1b strcat(filename, extension_ptr); 16b52: be 01 movw r22, r28 16b54: 69 5e subi r22, 0xE9 ; 233 16b56: 7f 4f sbci r23, 0xFF ; 255 16b58: c8 01 movw r24, r16 16b5a: 0f 94 28 a6 call 0x34c50 ; 0x34c50 enquecommandf_P(MSG_M23, filename); 16b5e: 1f 93 push r17 16b60: 0f 93 push r16 16b62: 89 ee ldi r24, 0xE9 ; 233 16b64: 9b e6 ldi r25, 0x6B ; 107 16b66: 9f 93 push r25 16b68: 8f 93 push r24 16b6a: 0e 94 4d 7d call 0xfa9a ; 0xfa9a restore_file_from_sd(); // M24: Start/resume SD print enquecommand_P(MSG_M24); 16b6e: 61 e0 ldi r22, 0x01 ; 1 16b70: 85 ee ldi r24, 0xE5 ; 229 16b72: 9b e6 ldi r25, 0x6B ; 107 16b74: 0e 94 af 7c call 0xf95e ; 0xf95e lcd_return_to_status(); 16b78: 0e 94 17 fe call 0x1fc2e ; 0x1fc2e 16b7c: 0f 90 pop r0 16b7e: 0f 90 pop r0 16b80: 0f 90 pop r0 16b82: 0f 90 pop r0 } 16b84: 6b 96 adiw r28, 0x1b ; 27 16b86: 0f b6 in r0, 0x3f ; 63 16b88: f8 94 cli 16b8a: de bf out 0x3e, r29 ; 62 16b8c: 0f be out 0x3f, r0 ; 63 16b8e: cd bf out 0x3d, r28 ; 61 16b90: df 91 pop r29 16b92: cf 91 pop r28 16b94: 1f 91 pop r17 16b96: 0f 91 pop r16 16b98: ff 90 pop r15 16b9a: ef 90 pop r14 16b9c: 08 95 ret 00016b9e : MENU_END(); } #ifdef PINDA_TEMP_COMP void lcd_pinda_temp_compensation_toggle() { 16b9e: cf 93 push r28 uint8_t pinda_temp_compensation = eeprom_read_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION); 16ba0: 89 e2 ldi r24, 0x29 ; 41 16ba2: 9d e0 ldi r25, 0x0D ; 13 16ba4: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 if (pinda_temp_compensation == EEPROM_EMPTY_VALUE) // On MK2.5/S the EEPROM_EMPTY_VALUE will be set to 0 during eeprom_init. pinda_temp_compensation = 1; // But for MK3/S it should be 1 so SuperPINDA is "active" else pinda_temp_compensation = !pinda_temp_compensation; 16ba8: 81 50 subi r24, 0x01 ; 1 16baa: c1 e0 ldi r28, 0x01 ; 1 16bac: 8e 3f cpi r24, 0xFE ; 254 16bae: 08 f4 brcc .+2 ; 0x16bb2 16bb0: c0 e0 ldi r28, 0x00 ; 0 16bb2: 6c 2f mov r22, r28 16bb4: 89 e2 ldi r24, 0x29 ; 41 16bb6: 9d e0 ldi r25, 0x0D ; 13 16bb8: 0f 94 00 a0 call 0x34000 ; 0x34000 eeprom_update_byte_notify((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION, pinda_temp_compensation); SERIAL_ECHOLNPGM("SuperPINDA:"); 16bbc: 80 e3 ldi r24, 0x30 ; 48 16bbe: 93 e8 ldi r25, 0x83 ; 131 16bc0: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 16bc4: 8c 2f mov r24, r28 16bc6: 0e 94 41 70 call 0xe082 ; 0xe082 SERIAL_ECHOLN(pinda_temp_compensation); } 16bca: cf 91 pop r28 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 16bcc: 0d 94 fc 97 jmp 0x32ff8 ; 0x32ff8 00016bd0 : { return lcd_status_message_level; } void menu_lcd_longpress_func(void) { 16bd0: cf 93 push r28 16bd2: df 93 push r29 // Wake up the LCD backlight and, // start LCD inactivity timer lcd_timeoutToStatus.start(); 16bd4: 81 eb ldi r24, 0xB1 ; 177 16bd6: 93 e0 ldi r25, 0x03 ; 3 16bd8: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> if (homing_flag || mesh_bed_leveling_flag || menu_menu == lcd_babystep_z || menu_menu == lcd_move_z || menu_is_any_block() || Stopped) 16bdc: 80 91 05 12 lds r24, 0x1205 ; 0x801205 16be0: 81 11 cpse r24, r1 16be2: 18 c0 rjmp .+48 ; 0x16c14 16be4: 80 91 06 12 lds r24, 0x1206 ; 0x801206 16be8: 81 11 cpse r24, r1 16bea: 14 c0 rjmp .+40 ; 0x16c14 16bec: c0 91 d0 03 lds r28, 0x03D0 ; 0x8003d0 16bf0: d0 91 d1 03 lds r29, 0x03D1 ; 0x8003d1 16bf4: 86 e3 ldi r24, 0x36 ; 54 16bf6: c3 3e cpi r28, 0xE3 ; 227 16bf8: d8 07 cpc r29, r24 16bfa: 61 f0 breq .+24 ; 0x16c14 16bfc: 88 e3 ldi r24, 0x38 ; 56 16bfe: cb 31 cpi r28, 0x1B ; 27 16c00: d8 07 cpc r29, r24 16c02: 41 f0 breq .+16 ; 0x16c14 16c04: 80 91 cd 11 lds r24, 0x11CD ; 0x8011cd 16c08: 81 11 cpse r24, r1 16c0a: 04 c0 rjmp .+8 ; 0x16c14 16c0c: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 16c10: 88 23 and r24, r24 16c12: 31 f0 breq .+12 ; 0x16c20 { // disable longpress during re-entry, while homing, calibration or if a serious error lcd_draw_update = 2; 16c14: 82 e0 ldi r24, 0x02 ; 2 16c16: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 16c1a: df 91 pop r29 16c1c: cf 91 pop r28 16c1e: 08 95 ret { // disable longpress during re-entry, while homing, calibration or if a serious error lcd_draw_update = 2; return; } if (menu_menu == lcd_hw_setup_menu) 16c20: 83 eb ldi r24, 0xB3 ; 179 16c22: c5 3b cpi r28, 0xB5 ; 181 16c24: d8 07 cpc r29, r24 16c26: 81 f4 brne .+32 ; 0x16c48 { // only toggle the experimental menu visibility flag lcd_draw_update = 2; 16c28: 82 e0 ldi r24, 0x02 ; 2 16c2a: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b eeprom_update_byte_notify(dst++, pgm_read_byte(src++)); } } void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); 16c2e: 8a e2 ldi r24, 0x2A ; 42 16c30: 9d e0 ldi r25, 0x0D ; 13 16c32: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 16c36: 61 e0 ldi r22, 0x01 ; 1 16c38: 81 11 cpse r24, r1 16c3a: 60 e0 ldi r22, 0x00 ; 0 if (active) { uint8_t previous_value = eeprom_read_byte(dst); eeprom_byte_notify(dst, previous_value, value, true); } #endif //DEBUG_EEPROM_CHANGES eeprom_write_byte(dst, value); 16c3c: 8a e2 ldi r24, 0x2A ; 42 16c3e: 9d e0 ldi r25, 0x0D ; 13 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 16c40: df 91 pop r29 16c42: cf 91 pop r28 16c44: 0d 94 24 a0 jmp 0x34048 ; 0x34048 16c48: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 16c4c: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 return; } // explicitely listed menus which are allowed to rise the move-z or live-adj-z functions // The lists are not the same for both functions, so first decide which function is to be performed if (blocks_queued() || printJobOngoing()){ // long press as live-adj-z 16c50: 98 13 cpse r25, r24 16c52: 04 c0 rjmp .+8 ; 0x16c5c 16c54: 0e 94 c8 60 call 0xc190 ; 0xc190 16c58: 88 23 and r24, r24 16c5a: 61 f0 breq .+24 ; 0x16c74 if ( babystep_allowed_strict() 16c5c: 0e 94 03 61 call 0xc206 ; 0xc206 && (menu_menu == lcd_status_screen // and in listed menus... 16c60: 81 11 cpse r24, r1 16c62: 10 c0 rjmp .+32 ; 0x16c84 Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } void lcd_quick_feedback(void) { lcd_draw_update = 2; 16c64: 82 e0 ldi r24, 0x02 ; 2 16c66: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 16c6a: 80 e0 ldi r24, 0x00 ; 0 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 16c6c: df 91 pop r29 16c6e: cf 91 pop r28 16c70: 0d 94 9f 2c jmp 0x2593e ; 0x2593e menu_submenu(lcd_babystep_z); } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen 16c74: 87 e3 ldi r24, 0x37 ; 55 16c76: c1 3b cpi r28, 0xB1 ; 177 16c78: d8 07 cpc r29, r24 16c7a: e1 f4 brne .+56 ; 0x16cb4 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 16c7c: 60 e0 ldi r22, 0x00 ; 0 16c7e: 8b e1 ldi r24, 0x1B ; 27 16c80: 98 e3 ldi r25, 0x38 ; 56 16c82: 14 c0 rjmp .+40 ; 0x16cac // explicitely listed menus which are allowed to rise the move-z or live-adj-z functions // The lists are not the same for both functions, so first decide which function is to be performed if (blocks_queued() || printJobOngoing()){ // long press as live-adj-z if ( babystep_allowed_strict() && (menu_menu == lcd_status_screen // and in listed menus... 16c84: 87 e3 ldi r24, 0x37 ; 55 16c86: c1 3b cpi r28, 0xB1 ; 177 16c88: d8 07 cpc r29, r24 16c8a: 59 f0 breq .+22 ; 0x16ca2 || menu_menu == lcd_main_menu 16c8c: 84 ec ldi r24, 0xC4 ; 196 16c8e: c2 30 cpi r28, 0x02 ; 2 16c90: d8 07 cpc r29, r24 16c92: 39 f0 breq .+14 ; 0x16ca2 || menu_menu == lcd_tune_menu 16c94: 86 eb ldi r24, 0xB6 ; 182 16c96: c7 39 cpi r28, 0x97 ; 151 16c98: d8 07 cpc r29, r24 16c9a: 19 f0 breq .+6 ; 0x16ca2 || menu_menu == lcd_support_menu 16c9c: cd 53 subi r28, 0x3D ; 61 16c9e: d8 43 sbci r29, 0x38 ; 56 16ca0: 09 f7 brne .-62 ; 0x16c64 ) ){ lcd_clear(); 16ca2: 0e 94 ae 69 call 0xd35c ; 0xd35c menu_submenu(lcd_babystep_z); 16ca6: 60 e0 ldi r22, 0x00 ; 0 16ca8: 83 ee ldi r24, 0xE3 ; 227 16caa: 96 e3 ldi r25, 0x36 ; 54 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 16cac: df 91 pop r29 16cae: cf 91 pop r28 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 16cb0: 0d 94 29 94 jmp 0x32852 ; 0x32852 } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen || menu_menu == lcd_main_menu 16cb4: 84 ec ldi r24, 0xC4 ; 196 16cb6: c2 30 cpi r28, 0x02 ; 2 16cb8: d8 07 cpc r29, r24 16cba: 01 f3 breq .-64 ; 0x16c7c || menu_menu == lcd_preheat_menu 16cbc: 88 e3 ldi r24, 0x38 ; 56 16cbe: c3 37 cpi r28, 0x73 ; 115 16cc0: d8 07 cpc r29, r24 16cc2: e1 f2 breq .-72 ; 0x16c7c || menu_menu == lcd_sdcard_menu 16cc4: 8c ee ldi r24, 0xEC ; 236 16cc6: cc 32 cpi r28, 0x2C ; 44 16cc8: d8 07 cpc r29, r24 16cca: c1 f2 breq .-80 ; 0x16c7c || menu_menu == lcd_settings_menu 16ccc: 87 eb ldi r24, 0xB7 ; 183 16cce: c5 35 cpi r28, 0x55 ; 85 16cd0: d8 07 cpc r29, r24 16cd2: a1 f2 breq .-88 ; 0x16c7c || menu_menu == lcd_control_temperature_menu 16cd4: 86 eb ldi r24, 0xB6 ; 182 16cd6: c7 37 cpi r28, 0x77 ; 119 16cd8: d8 07 cpc r29, r24 16cda: 81 f2 breq .-96 ; 0x16c7c #if (LANG_MODE != 0) || menu_menu == lcd_language 16cdc: 8e ef ldi r24, 0xFE ; 254 16cde: c8 32 cpi r28, 0x28 ; 40 16ce0: d8 07 cpc r29, r24 16ce2: 61 f2 breq .-104 ; 0x16c7c #endif || menu_menu == lcd_support_menu 16ce4: cd 53 subi r28, 0x3D ; 61 16ce6: d8 43 sbci r29, 0x38 ; 56 16ce8: 09 f0 breq .+2 ; 0x16cec 16cea: bc cf rjmp .-136 ; 0x16c64 16cec: c7 cf rjmp .-114 ; 0x16c7c 00016cee : } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 16cee: 0f 94 bc 92 call 0x32578 ; 0x32578 16cf2: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 16cf6: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16cfa: 84 30 cpi r24, 0x04 ; 4 16cfc: b8 f4 brcc .+46 ; 0x16d2c 16cfe: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 16d02: 87 ea ldi r24, 0xA7 ; 167 16d04: 9d e3 ldi r25, 0x3D ; 61 16d06: 0e 94 b1 6c call 0xd962 ; 0xd962 16d0a: 0f 94 87 95 call 0x32b0e ; 0x32b0e menuitems_temperature_common(); 16d0e: 0f 94 da 09 call 0x213b4 ; 0x213b4 MENU_END(); 16d12: 0f 94 90 92 call 0x32520 ; 0x32520 } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 16d16: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16d1a: 8f 5f subi r24, 0xFF ; 255 16d1c: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 16d20: 80 91 30 04 lds r24, 0x0430 ; 0x800430 16d24: 8f 5f subi r24, 0xFF ; 255 16d26: 80 93 30 04 sts 0x0430, r24 ; 0x800430 16d2a: e5 cf rjmp .-54 ; 0x16cf6 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); menuitems_temperature_common(); MENU_END(); } 16d2c: 08 95 ret 00016d2e : #define MENU_ITEM_EDIT_advance_K() do { lcd_advance_K(); } while (0) #endif static void lcd_tune_menu() { 16d2e: ef 92 push r14 16d30: ff 92 push r15 16d32: 0f 93 push r16 16d34: 1f 93 push r17 16d36: cf 93 push r28 16d38: df 93 push r29 16d3a: 80 91 59 02 lds r24, 0x0259 ; 0x800259 16d3e: 90 91 5a 02 lds r25, 0x025A ; 0x80025a //! it needs to be applied. int16_t extrudemultiply; } _menu_data_t; static_assert(sizeof(menu_data)>= sizeof(_menu_data_t),"_menu_data_t doesn't fit into menu_data"); _menu_data_t* _md = (_menu_data_t*)&(menu_data[0]); if (_md->status == 0) 16d42: 20 91 71 03 lds r18, 0x0371 ; 0x800371 16d46: 21 11 cpse r18, r1 16d48: 91 c0 rjmp .+290 ; 0x16e6c { // Menu was entered. Mark the menu as entered and save the current extrudemultiply value. _md->status = 1; 16d4a: 21 e0 ldi r18, 0x01 ; 1 16d4c: 20 93 71 03 sts 0x0371, r18 ; 0x800371 _md->extrudemultiply = extrudemultiply; 16d50: 90 93 73 03 sts 0x0373, r25 ; 0x800373 16d54: 80 93 72 03 sts 0x0372, r24 ; 0x800372 // extrudemultiply has been changed from the child menu. Apply the new value. _md->extrudemultiply = extrudemultiply; calculate_extruder_multipliers(); } SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); 16d58: 8f ef ldi r24, 0xFF ; 255 16d5a: 9f e0 ldi r25, 0x0F ; 15 16d5c: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 16d60: 80 93 89 03 sts 0x0389, r24 ; 0x800389 MENU_BEGIN(); 16d64: 0f 94 bc 92 call 0x32578 ; 0x32578 16d68: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 16d6c: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16d70: 84 30 cpi r24, 0x04 ; 4 16d72: 08 f0 brcs .+2 ; 0x16d76 16d74: 93 c0 rjmp .+294 ; 0x16e9c 16d76: 10 92 31 04 sts 0x0431, r1 ; 0x800431 ON_MENU_LEAVE( 16d7a: 0f 94 3c 91 call 0x32278 ; 0x32278 16d7e: 81 11 cpse r24, r1 16d80: 0e 94 c5 5e call 0xbd8a ; 0xbd8a refresh_saved_feedrate_multiplier_in_ram(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 16d84: 88 ef ldi r24, 0xF8 ; 248 16d86: 9d e3 ldi r25, 0x3D ; 61 16d88: 0e 94 b1 6c call 0xd962 ; 0xd962 16d8c: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_EDIT_int3_P(_T(MSG_SPEED), &feedmultiply, 10, 999); 16d90: 84 e7 ldi r24, 0x74 ; 116 16d92: 9d e3 ldi r25, 0x3D ; 61 16d94: 0e 94 b1 6c call 0xd962 ; 0xd962 16d98: f1 2c mov r15, r1 16d9a: e1 2c mov r14, r1 16d9c: 07 ee ldi r16, 0xE7 ; 231 16d9e: 13 e0 ldi r17, 0x03 ; 3 16da0: 2a e0 ldi r18, 0x0A ; 10 16da2: 30 e0 ldi r19, 0x00 ; 0 16da4: 40 e1 ldi r20, 0x10 ; 16 16da6: 6e e8 ldi r22, 0x8E ; 142 16da8: 72 e0 ldi r23, 0x02 ; 2 16daa: 0f 94 0c 93 call 0x32618 ; 0x32618 menuitems_temperature_common(); 16dae: 0f 94 da 09 call 0x213b4 ; 0x213b4 MENU_ITEM_EDIT_int3_P(_T(MSG_FLOW), &extrudemultiply, 10, 999); 16db2: 8d e6 ldi r24, 0x6D ; 109 16db4: 9d e3 ldi r25, 0x3D ; 61 16db6: 0e 94 b1 6c call 0xd962 ; 0xd962 16dba: 2a e0 ldi r18, 0x0A ; 10 16dbc: 30 e0 ldi r19, 0x00 ; 0 16dbe: 40 e1 ldi r20, 0x10 ; 16 16dc0: 69 e5 ldi r22, 0x59 ; 89 16dc2: 72 e0 ldi r23, 0x02 ; 2 16dc4: 0f 94 0c 93 call 0x32618 ; 0x32618 #ifdef LA_LIVE_K MENU_ITEM_EDIT_advance_K(); #endif #ifdef FILAMENTCHANGEENABLE if (!farm_mode) 16dc8: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 16dcc: 81 11 cpse r24, r1 16dce: 08 c0 rjmp .+16 ; 0x16de0 MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change); 16dd0: 8b e5 ldi r24, 0x5B ; 91 16dd2: 9d e3 ldi r25, 0x3D ; 61 16dd4: 0e 94 b1 6c call 0xd962 ; 0xd962 16dd8: 6e e3 ldi r22, 0x3E ; 62 16dda: 7f ee ldi r23, 0xEF ; 239 16ddc: 0f 94 39 92 call 0x32472 ; 0x32472 #endif if (printingIsPaused()) {// Don't allow rehome if actively printing. Maaaaybe it could work to insert on the fly, seems too risky. 16de0: 0e 94 bd 60 call 0xc17a ; 0xc17a 16de4: 88 23 and r24, r24 16de6: 41 f0 breq .+16 ; 0x16df8 MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME),PSTR("G28 XY")); 16de8: 80 e4 ldi r24, 0x40 ; 64 16dea: 98 e4 ldi r25, 0x48 ; 72 16dec: 0e 94 b1 6c call 0xd962 ; 0xd962 16df0: 63 ed ldi r22, 0xD3 ; 211 16df2: 72 e8 ldi r23, 0x82 ; 130 16df4: 0f 94 b2 91 call 0x32364 ; 0x32364 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 16df8: 8d e4 ldi r24, 0x4D ; 77 16dfa: 9d e3 ldi r25, 0x3D ; 61 16dfc: 0e 94 b1 6c call 0xd962 ; 0xd962 16e00: 69 e0 ldi r22, 0x09 ; 9 16e02: 7d ef ldi r23, 0xFD ; 253 16e04: 0f 94 ea 94 call 0x329d4 ; 0x329d4 #endif //FILAMENT_SENSOR if (MMU2::mmu2.Enabled()) 16e08: 80 91 94 12 lds r24, 0x1294 ; 0x801294 16e0c: 81 30 cpi r24, 0x01 ; 1 16e0e: 11 f4 brne .+4 ; 0x16e14 { menuitems_MMU_settings_common(); 16e10: 0f 94 13 0a call 0x21426 ; 0x21426 } SETTINGS_FANS_CHECK(); 16e14: 0f 94 c0 09 call 0x21380 ; 0x21380 MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { if (!farm_mode) 16e18: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 16e1c: 81 11 cpse r24, r1 16e1e: 02 c0 rjmp .+4 ; 0x16e24 16e20: 0e 94 94 b3 call 0x16728 ; 0x16728 menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 16e24: 80 91 15 04 lds r24, 0x0415 ; 0x800415 16e28: 82 30 cpi r24, 0x02 ; 2 16e2a: 91 f1 breq .+100 ; 0x16e90 16e2c: 83 30 cpi r24, 0x03 ; 3 16e2e: 99 f1 breq .+102 ; 0x16e96 16e30: 81 30 cpi r24, 0x01 ; 1 16e32: 59 f1 breq .+86 ; 0x16e8a 16e34: 86 e4 ldi r24, 0x46 ; 70 16e36: 9d e3 ldi r25, 0x3D ; 61 16e38: 0e 94 b1 6c call 0xd962 ; 0xd962 16e3c: ec 01 movw r28, r24 16e3e: 8e e3 ldi r24, 0x3E ; 62 16e40: 9d e3 ldi r25, 0x3D ; 61 16e42: 0e 94 b1 6c call 0xd962 ; 0xd962 16e46: 22 e0 ldi r18, 0x02 ; 2 16e48: 43 eb ldi r20, 0xB3 ; 179 16e4a: 5c ef ldi r21, 0xFC ; 252 16e4c: be 01 movw r22, r28 16e4e: 0f 94 4b 94 call 0x32896 ; 0x32896 if (backlightSupport) { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); 16e52: 0f 94 90 92 call 0x32520 ; 0x32520 calculate_extruder_multipliers(); } SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 16e56: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16e5a: 8f 5f subi r24, 0xFF ; 255 16e5c: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 16e60: 80 91 30 04 lds r24, 0x0430 ; 0x800430 16e64: 8f 5f subi r24, 0xFF ; 255 16e66: 80 93 30 04 sts 0x0430, r24 ; 0x800430 16e6a: 80 cf rjmp .-256 ; 0x16d6c { // Menu was entered. Mark the menu as entered and save the current extrudemultiply value. _md->status = 1; _md->extrudemultiply = extrudemultiply; } else if (_md->extrudemultiply != extrudemultiply) 16e6c: 20 91 72 03 lds r18, 0x0372 ; 0x800372 16e70: 30 91 73 03 lds r19, 0x0373 ; 0x800373 16e74: 28 17 cp r18, r24 16e76: 39 07 cpc r19, r25 16e78: 09 f4 brne .+2 ; 0x16e7c 16e7a: 6e cf rjmp .-292 ; 0x16d58 { // extrudemultiply has been changed from the child menu. Apply the new value. _md->extrudemultiply = extrudemultiply; 16e7c: 90 93 73 03 sts 0x0373, r25 ; 0x800373 16e80: 80 93 72 03 sts 0x0372, r24 ; 0x800372 calculate_extruder_multipliers(); 16e84: 0e 94 d2 5e call 0xbda4 ; 0xbda4 16e88: 67 cf rjmp .-306 ; 0x16d58 menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 16e8a: 87 e3 ldi r24, 0x37 ; 55 16e8c: 9d e3 ldi r25, 0x3D ; 61 16e8e: d4 cf rjmp .-88 ; 0x16e38 16e90: 88 e2 ldi r24, 0x28 ; 40 16e92: 90 e4 ldi r25, 0x40 ; 64 16e94: d1 cf rjmp .-94 ; 0x16e38 16e96: 8e e2 ldi r24, 0x2E ; 46 16e98: 9d e3 ldi r25, 0x3D ; 61 16e9a: ce cf rjmp .-100 ; 0x16e38 { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); } 16e9c: df 91 pop r29 16e9e: cf 91 pop r28 16ea0: 1f 91 pop r17 16ea2: 0f 91 pop r16 16ea4: ff 90 pop r15 16ea6: ef 90 pop r14 16ea8: 08 95 ret 00016eaa : MENU_END(); } static void lcd_settings_menu() { 16eaa: 1f 93 push r17 16eac: cf 93 push r28 16eae: df 93 push r29 SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); 16eb0: 8f ef ldi r24, 0xFF ; 255 16eb2: 9f e0 ldi r25, 0x0F ; 15 16eb4: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 16eb8: 80 93 89 03 sts 0x0389, r24 ; 0x800389 MENU_BEGIN(); 16ebc: 0f 94 bc 92 call 0x32578 ; 0x32578 16ec0: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); if(!farm_mode) { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 16ec4: 11 e0 ldi r17, 0x01 ; 1 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 16ec6: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16eca: 84 30 cpi r24, 0x04 ; 4 16ecc: 08 f0 brcs .+2 ; 0x16ed0 16ece: 45 c1 rjmp .+650 ; 0x1715a 16ed0: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 16ed4: 88 ef ldi r24, 0xF8 ; 248 16ed6: 9d e3 ldi r25, 0x3D ; 61 16ed8: 0e 94 b1 6c call 0xd962 ; 0xd962 16edc: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_SUBMENU_P(_T(MSG_TEMPERATURE), lcd_control_temperature_menu); 16ee0: 87 ed ldi r24, 0xD7 ; 215 16ee2: 9a e3 ldi r25, 0x3A ; 58 16ee4: 0e 94 b1 6c call 0xd962 ; 0xd962 16ee8: 67 e7 ldi r22, 0x77 ; 119 16eea: 76 eb ldi r23, 0xB6 ; 182 16eec: 0f 94 ea 94 call 0x329d4 ; 0x329d4 if (!printer_active() || printingIsPaused()) 16ef0: 0e 94 19 61 call 0xc232 ; 0xc232 16ef4: 88 23 and r24, r24 16ef6: 21 f0 breq .+8 ; 0x16f00 16ef8: 0e 94 bd 60 call 0xc17a ; 0xc17a 16efc: 88 23 and r24, r24 16efe: 81 f0 breq .+32 ; 0x16f20 { MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_AXIS), lcd_move_menu_axis); 16f00: 8b ec ldi r24, 0xCB ; 203 16f02: 9a e3 ldi r25, 0x3A ; 58 16f04: 0e 94 b1 6c call 0xd962 ; 0xd962 16f08: 6e e6 ldi r22, 0x6E ; 110 16f0a: 7e ef ldi r23, 0xFE ; 254 16f0c: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_GCODE_P(_T(MSG_DISABLE_STEPPERS), MSG_M84); 16f10: 88 eb ldi r24, 0xB8 ; 184 16f12: 9a e3 ldi r25, 0x3A ; 58 16f14: 0e 94 b1 6c call 0xd962 ; 0xd962 16f18: 6f ec ldi r22, 0xCF ; 207 16f1a: 77 e6 ldi r23, 0x67 ; 103 16f1c: 0f 94 b2 91 call 0x32364 ; 0x32364 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 16f20: 8d e4 ldi r24, 0x4D ; 77 16f22: 9d e3 ldi r25, 0x3D ; 61 16f24: 0e 94 b1 6c call 0xd962 ; 0xd962 16f28: 69 e0 ldi r22, 0x09 ; 9 16f2a: 7d ef ldi r23, 0xFD ; 253 16f2c: 0f 94 ea 94 call 0x329d4 ; 0x329d4 #endif //FILAMENT_SENSOR MENU_ITEM_TOGGLE_P(PSTR("MMU"), eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED) ? _T(MSG_ON) : _T(MSG_OFF), mmu_enable_switch); 16f30: 8c ea ldi r24, 0xAC ; 172 16f32: 9c e0 ldi r25, 0x0C ; 12 16f34: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 16f38: 88 23 and r24, r24 16f3a: 09 f4 brne .+2 ; 0x16f3e 16f3c: 91 c0 rjmp .+290 ; 0x17060 16f3e: 8f ea ldi r24, 0xAF ; 175 16f40: 9a e5 ldi r25, 0x5A ; 90 16f42: 0e 94 b1 6c call 0xd962 ; 0xd962 16f46: 22 e0 ldi r18, 0x02 ; 2 16f48: 42 ef ldi r20, 0xF2 ; 242 16f4a: 5d ef ldi r21, 0xFD ; 253 16f4c: bc 01 movw r22, r24 16f4e: 84 eb ldi r24, 0xB4 ; 180 16f50: 92 e8 ldi r25, 0x82 ; 130 16f52: 0f 94 4b 94 call 0x32896 ; 0x32896 if (eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED)) 16f56: 8c ea ldi r24, 0xAC ; 172 16f58: 9c e0 ldi r25, 0x0C ; 12 16f5a: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 16f5e: 88 23 and r24, r24 16f60: 31 f0 breq .+12 ; 0x16f6e { // Communication with MMU not required to reset MMU MENU_ITEM_FUNCTION_P(PSTR("Reset MMU"), []() { MMU2::mmu2.Reset(MMU2::MMU2::ResetForm::Software); }); 16f62: 68 e9 ldi r22, 0x98 ; 152 16f64: 7c eb ldi r23, 0xBC ; 188 16f66: 8a ea ldi r24, 0xAA ; 170 16f68: 92 e8 ldi r25, 0x82 ; 130 16f6a: 0f 94 39 92 call 0x32472 ; 0x32472 } if (MMU2::mmu2.Enabled()) 16f6e: 80 91 94 12 lds r24, 0x1294 ; 0x801294 16f72: 81 30 cpi r24, 0x01 ; 1 16f74: 51 f4 brne .+20 ; 0x16f8a { // Only show menus when communicating with MMU menuitems_MMU_settings_common(); 16f76: 0f 94 13 0a call 0x21426 ; 0x21426 MENU_ITEM_SUBMENU_P(_T(MSG_LOADING_TEST), lcd_mmuLoadingTest); 16f7a: 89 ea ldi r24, 0xA9 ; 169 16f7c: 9a e3 ldi r25, 0x3A ; 58 16f7e: 0e 94 b1 6c call 0xd962 ; 0xd962 16f82: 66 ed ldi r22, 0xD6 ; 214 16f84: 7b eb ldi r23, 0xBB ; 187 16f86: 0f 94 ea 94 call 0x329d4 ; 0x329d4 } SETTINGS_FANS_CHECK(); 16f8a: 0f 94 c0 09 call 0x21380 ; 0x21380 MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { if (!farm_mode) 16f8e: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 16f92: 81 11 cpse r24, r1 16f94: 02 c0 rjmp .+4 ; 0x16f9a 16f96: 0e 94 94 b3 call 0x16728 ; 0x16728 } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); if(!farm_mode) 16f9a: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 16f9e: 81 11 cpse r24, r1 16fa0: 62 c0 rjmp .+196 ; 0x17066 { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 16fa2: 10 93 ba 03 sts 0x03BA, r17 ; 0x8003ba MENU_ITEM_SUBMENU_P(_T(MSG_HW_SETUP), lcd_hw_setup_menu); 16fa6: 8e e9 ldi r24, 0x9E ; 158 16fa8: 9a e3 ldi r25, 0x3A ; 58 16faa: 0e 94 b1 6c call 0xd962 ; 0xd962 16fae: 65 eb ldi r22, 0xB5 ; 181 16fb0: 73 eb ldi r23, 0xB3 ; 179 16fb2: 0f 94 ea 94 call 0x329d4 ; 0x329d4 } else MENU_ITEM_FUNCTION_P(_T(MSG_NOZZLE_CNG_MENU),nozzle_change); MENU_ITEM_SUBMENU_P(_T(MSG_MESH_BED_LEVELING), lcd_mesh_bed_leveling_settings); 16fb6: 8d e3 ldi r24, 0x3D ; 61 16fb8: 9b e3 ldi r25, 0x3B ; 59 16fba: 0e 94 b1 6c call 0xd962 ; 0xd962 16fbe: 62 e0 ldi r22, 0x02 ; 2 16fc0: 7b eb ldi r23, 0xBB ; 187 16fc2: 0f 94 ea 94 call 0x329d4 ; 0x329d4 #if defined (TMC2130) && defined (LINEARITY_CORRECTION) MENU_ITEM_SUBMENU_P(_T(MSG_LIN_CORRECTION), lcd_settings_linearity_correction_menu); #endif //LINEARITY_CORRECTION && TMC2130 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 16fc6: 0f 94 b2 14 call 0x22964 ; 0x22964 16fca: 88 23 and r24, r24 16fcc: b1 f0 breq .+44 ; 0x16ffa MENU_ITEM_TOGGLE_P(_T(MSG_PINDA_CALIBRATION), eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE) ? _T(MSG_ON) : _T(MSG_OFF), lcd_temp_calibration_set); 16fce: 8f ea ldi r24, 0xAF ; 175 16fd0: 9f e0 ldi r25, 0x0F ; 15 16fd2: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 16fd6: 88 23 and r24, r24 16fd8: 09 f4 brne .+2 ; 0x16fdc 16fda: 4e c0 rjmp .+156 ; 0x17078 16fdc: 8f ea ldi r24, 0xAF ; 175 16fde: 9a e5 ldi r25, 0x5A ; 90 16fe0: 0e 94 b1 6c call 0xd962 ; 0xd962 16fe4: ec 01 movw r28, r24 16fe6: 85 ee ldi r24, 0xE5 ; 229 16fe8: 9a e3 ldi r25, 0x3A ; 58 16fea: 0e 94 b1 6c call 0xd962 ; 0xd962 16fee: 22 e0 ldi r18, 0x02 ; 2 16ff0: 45 ec ldi r20, 0xC5 ; 197 16ff2: 5d ef ldi r21, 0xFD ; 253 16ff4: be 01 movw r22, r28 16ff6: 0f 94 4b 94 call 0x32896 ; 0x32896 #endif #ifdef HAS_SECOND_SERIAL_PORT MENU_ITEM_TOGGLE_P(_T(MSG_RPI_PORT), (selectedSerialPort == 0) ? _T(MSG_OFF) : _T(MSG_ON), lcd_second_serial_set); #endif //HAS_SECOND_SERIAL if (!printingIsPaused()) MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z); 16ffa: 0e 94 bd 60 call 0xc17a ; 0xc17a 16ffe: 81 11 cpse r24, r1 17000: 08 c0 rjmp .+16 ; 0x17012 17002: 86 e0 ldi r24, 0x06 ; 6 17004: 9d e3 ldi r25, 0x3D ; 61 17006: 0e 94 b1 6c call 0xd962 ; 0xd962 1700a: 63 ee ldi r22, 0xE3 ; 227 1700c: 76 e3 ldi r23, 0x36 ; 54 1700e: 0f 94 ea 94 call 0x329d4 ; 0x329d4 #if (LANG_MODE != 0) MENU_ITEM_SUBMENU_P(_T(MSG_SELECT_LANGUAGE), lcd_language_menu); 17012: 8c e7 ldi r24, 0x7C ; 124 17014: 9a e3 ldi r25, 0x3A ; 58 17016: 0e 94 b1 6c call 0xd962 ; 0xd962 1701a: 6d e1 ldi r22, 0x1D ; 29 1701c: 78 e3 ldi r23, 0x38 ; 56 1701e: 0f 94 ea 94 call 0x329d4 ; 0x329d4 #endif //(LANG_MODE != 0) if (!farm_mode) { //SD related settings are not available in farm mode 17022: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 17026: 81 11 cpse r24, r1 17028: 47 c0 rjmp .+142 ; 0x170b8 if (card.ToshibaFlashAir_isEnabled()) 1702a: 80 91 db 15 lds r24, 0x15DB ; 0x8015db 1702e: 88 23 and r24, r24 17030: 31 f1 breq .+76 ; 0x1707e MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY, lcd_toshiba_flash_air_compatibility_toggle); 17032: 82 e7 ldi r24, 0x72 ; 114 17034: 9a e3 ldi r25, 0x3A ; 58 17036: 0e 94 b1 6c call 0xd962 ; 0xd962 1703a: 22 e0 ldi r18, 0x02 ; 2 1703c: 49 ea ldi r20, 0xA9 ; 169 1703e: 5c ef ldi r21, 0xFC ; 252 17040: 6e e5 ldi r22, 0x5E ; 94 17042: 77 e6 ldi r23, 0x67 ; 103 else MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle); 17044: 0f 94 4b 94 call 0x32896 ; 0x32896 #ifdef SDCARD_SORT_ALPHA switch (eeprom_read_byte((uint8_t*) EEPROM_SD_SORT)) { 17048: 89 e0 ldi r24, 0x09 ; 9 1704a: 9f e0 ldi r25, 0x0F ; 15 1704c: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 17050: 88 23 and r24, r24 17052: 19 f1 breq .+70 ; 0x1709a 17054: 81 30 cpi r24, 0x01 ; 1 17056: 09 f4 brne .+2 ; 0x1705a 17058: 71 c0 rjmp .+226 ; 0x1713c case SD_SORT_TIME: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_SORT_TIME), lcd_sort_type_set); break; case SD_SORT_ALPHA: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_SORT_ALPHA), lcd_sort_type_set); break; default: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_NONE), lcd_sort_type_set); 1705a: 85 e5 ldi r24, 0x55 ; 85 1705c: 90 e4 ldi r25, 0x40 ; 64 1705e: 1f c0 rjmp .+62 ; 0x1709e #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); #endif //FILAMENT_SENSOR MENU_ITEM_TOGGLE_P(PSTR("MMU"), eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED) ? _T(MSG_ON) : _T(MSG_OFF), mmu_enable_switch); 17060: 89 ea ldi r24, 0xA9 ; 169 17062: 9a e5 ldi r25, 0x5A ; 90 17064: 6e cf rjmp .-292 ; 0x16f42 if(!farm_mode) { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function MENU_ITEM_SUBMENU_P(_T(MSG_HW_SETUP), lcd_hw_setup_menu); } else MENU_ITEM_FUNCTION_P(_T(MSG_NOZZLE_CNG_MENU),nozzle_change); 17066: 8e e8 ldi r24, 0x8E ; 142 17068: 9a e3 ldi r25, 0x3A ; 58 1706a: 0e 94 b1 6c call 0xd962 ; 0xd962 1706e: 6d e1 ldi r22, 0x1D ; 29 17070: 76 ec ldi r23, 0xC6 ; 198 17072: 0f 94 39 92 call 0x32472 ; 0x32472 17076: 9f cf rjmp .-194 ; 0x16fb6 #if defined (TMC2130) && defined (LINEARITY_CORRECTION) MENU_ITEM_SUBMENU_P(_T(MSG_LIN_CORRECTION), lcd_settings_linearity_correction_menu); #endif //LINEARITY_CORRECTION && TMC2130 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) MENU_ITEM_TOGGLE_P(_T(MSG_PINDA_CALIBRATION), eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE) ? _T(MSG_ON) : _T(MSG_OFF), lcd_temp_calibration_set); 17078: 89 ea ldi r24, 0xA9 ; 169 1707a: 9a e5 ldi r25, 0x5A ; 90 1707c: b1 cf rjmp .-158 ; 0x16fe0 if (!farm_mode) { //SD related settings are not available in farm mode if (card.ToshibaFlashAir_isEnabled()) MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY, lcd_toshiba_flash_air_compatibility_toggle); else MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle); 1707e: 89 e6 ldi r24, 0x69 ; 105 17080: 9a e3 ldi r25, 0x3A ; 58 17082: 0e 94 b1 6c call 0xd962 ; 0xd962 17086: ec 01 movw r28, r24 17088: 82 e7 ldi r24, 0x72 ; 114 1708a: 9a e3 ldi r25, 0x3A ; 58 1708c: 0e 94 b1 6c call 0xd962 ; 0xd962 17090: 22 e0 ldi r18, 0x02 ; 2 17092: 49 ea ldi r20, 0xA9 ; 169 17094: 5c ef ldi r21, 0xFC ; 252 17096: be 01 movw r22, r28 17098: d5 cf rjmp .-86 ; 0x17044 #ifdef SDCARD_SORT_ALPHA switch (eeprom_read_byte((uint8_t*) EEPROM_SD_SORT)) { case SD_SORT_TIME: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_SORT_TIME), lcd_sort_type_set); break; 1709a: 82 e6 ldi r24, 0x62 ; 98 1709c: 9a e3 ldi r25, 0x3A ; 58 case SD_SORT_ALPHA: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_SORT_ALPHA), lcd_sort_type_set); break; default: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_NONE), lcd_sort_type_set); 1709e: 0e 94 b1 6c call 0xd962 ; 0xd962 170a2: ec 01 movw r28, r24 170a4: 8b e5 ldi r24, 0x5B ; 91 170a6: 9a e3 ldi r25, 0x3A ; 58 170a8: 0e 94 b1 6c call 0xd962 ; 0xd962 170ac: 22 e0 ldi r18, 0x02 ; 2 170ae: 40 ed ldi r20, 0xD0 ; 208 170b0: 5d ef ldi r21, 0xFD ; 253 170b2: be 01 movw r22, r28 170b4: 0f 94 4b 94 call 0x32896 ; 0x32896 } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 170b8: 80 91 15 04 lds r24, 0x0415 ; 0x800415 170bc: 82 30 cpi r24, 0x02 ; 2 170be: 09 f4 brne .+2 ; 0x170c2 170c0: 43 c0 rjmp .+134 ; 0x17148 170c2: 83 30 cpi r24, 0x03 ; 3 170c4: 09 f4 brne .+2 ; 0x170c8 170c6: 43 c0 rjmp .+134 ; 0x1714e 170c8: 81 30 cpi r24, 0x01 ; 1 170ca: d9 f1 breq .+118 ; 0x17142 170cc: 86 e4 ldi r24, 0x46 ; 70 170ce: 9d e3 ldi r25, 0x3D ; 61 170d0: 0e 94 b1 6c call 0xd962 ; 0xd962 170d4: ec 01 movw r28, r24 170d6: 8e e3 ldi r24, 0x3E ; 62 170d8: 9d e3 ldi r25, 0x3D ; 61 170da: 0e 94 b1 6c call 0xd962 ; 0xd962 170de: 22 e0 ldi r18, 0x02 ; 2 170e0: 43 eb ldi r20, 0xB3 ; 179 170e2: 5c ef ldi r21, 0xFC ; 252 170e4: be 01 movw r22, r28 170e6: 0f 94 4b 94 call 0x32896 ; 0x32896 MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN //! Enables/disables the bed heating while heating the nozzle for loading/unloading filament MENU_ITEM_TOGGLE_P(_N("HBed on load"), eeprom_read_byte((uint8_t *)EEPROM_HEAT_BED_ON_LOAD_FILAMENT) ? _T(MSG_YES) : _T(MSG_NO), lcd_heat_bed_on_load_toggle); ////MSG_HEAT_BED_ON_LOAD c=12 170ea: 87 ea ldi r24, 0xA7 ; 167 170ec: 9c e0 ldi r25, 0x0C ; 12 170ee: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 170f2: 88 23 and r24, r24 170f4: 79 f1 breq .+94 ; 0x17154 170f6: 82 eb ldi r24, 0xB2 ; 178 170f8: 9d e3 ldi r25, 0x3D ; 61 170fa: 0e 94 b1 6c call 0xd962 ; 0xd962 170fe: 22 e0 ldi r18, 0x02 ; 2 17100: 44 e1 ldi r20, 0x14 ; 20 17102: 53 eb ldi r21, 0xB3 ; 179 17104: bc 01 movw r22, r24 17106: 81 e5 ldi r24, 0x51 ; 81 17108: 97 e6 ldi r25, 0x67 ; 103 1710a: 0f 94 4b 94 call 0x32896 ; 0x32896 if (farm_mode) 1710e: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 17112: 88 23 and r24, r24 17114: 31 f0 breq .+12 ; 0x17122 { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); 17116: 66 e5 ldi r22, 0x56 ; 86 17118: 75 eb ldi r23, 0xB5 ; 181 1711a: 88 e9 ldi r24, 0x98 ; 152 1711c: 92 e8 ldi r25, 0x82 ; 130 1711e: 0f 94 39 92 call 0x32472 ; 0x32472 } MENU_END(); 17122: 0f 94 90 92 call 0x32520 ; 0x32520 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 17126: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1712a: 8f 5f subi r24, 0xFF ; 255 1712c: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 17130: 80 91 30 04 lds r24, 0x0430 ; 0x800430 17134: 8f 5f subi r24, 0xFF ; 255 17136: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1713a: c5 ce rjmp .-630 ; 0x16ec6 else MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle); #ifdef SDCARD_SORT_ALPHA switch (eeprom_read_byte((uint8_t*) EEPROM_SD_SORT)) { case SD_SORT_TIME: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_SORT_TIME), lcd_sort_type_set); break; case SD_SORT_ALPHA: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_SORT_ALPHA), lcd_sort_type_set); break; 1713c: 80 e5 ldi r24, 0x50 ; 80 1713e: 9a e3 ldi r25, 0x3A ; 58 17140: ae cf rjmp .-164 ; 0x1709e default: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_NONE), lcd_sort_type_set); } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 17142: 87 e3 ldi r24, 0x37 ; 55 17144: 9d e3 ldi r25, 0x3D ; 61 17146: c4 cf rjmp .-120 ; 0x170d0 17148: 88 e2 ldi r24, 0x28 ; 40 1714a: 90 e4 ldi r25, 0x40 ; 64 1714c: c1 cf rjmp .-126 ; 0x170d0 1714e: 8e e2 ldi r24, 0x2E ; 46 17150: 9d e3 ldi r25, 0x3D ; 61 17152: be cf rjmp .-132 ; 0x170d0 MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN //! Enables/disables the bed heating while heating the nozzle for loading/unloading filament MENU_ITEM_TOGGLE_P(_N("HBed on load"), eeprom_read_byte((uint8_t *)EEPROM_HEAT_BED_ON_LOAD_FILAMENT) ? _T(MSG_YES) : _T(MSG_NO), lcd_heat_bed_on_load_toggle); ////MSG_HEAT_BED_ON_LOAD c=12 17154: 88 eb ldi r24, 0xB8 ; 184 17156: 9d e3 ldi r25, 0x3D ; 61 17158: d0 cf rjmp .-96 ; 0x170fa { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); } 1715a: df 91 pop r29 1715c: cf 91 pop r28 1715e: 1f 91 pop r17 17160: 08 95 ret 00017162 : } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 17162: 0f 94 bc 92 call 0x32578 ; 0x32578 17166: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1716a: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1716e: 84 30 cpi r24, 0x04 ; 4 17170: 08 f0 brcs .+2 ; 0x17174 17172: 7d c0 rjmp .+250 ; 0x1726e 17174: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 17178: 88 ef ldi r24, 0xF8 ; 248 1717a: 9d e3 ldi r25, 0x3D ; 61 1717c: 0e 94 b1 6c call 0xd962 ; 0xd962 17180: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_FUNCTION_P(_T(MSG_WIZARD), lcd_wizard); 17184: 8a e7 ldi r24, 0x7A ; 122 17186: 9b e3 ldi r25, 0x3B ; 59 17188: 0e 94 b1 6c call 0xd962 ; 0xd962 1718c: 61 ea ldi r22, 0xA1 ; 161 1718e: 77 e3 ldi r23, 0x37 ; 55 17190: 0f 94 39 92 call 0x32472 ; 0x32472 if (lcd_commands_type == LcdCommands::Idle) 17194: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 17198: 81 11 cpse r24, r1 1719a: 08 c0 rjmp .+16 ; 0x171ac { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_first_layer_calibration_reset); 1719c: 89 ed ldi r24, 0xD9 ; 217 1719e: 9b e3 ldi r25, 0x3B ; 59 171a0: 0e 94 b1 6c call 0xd962 ; 0xd962 171a4: 67 ee ldi r22, 0xE7 ; 231 171a6: 77 e3 ldi r23, 0x37 ; 55 171a8: 0f 94 ea 94 call 0x329d4 ; 0x329d4 } MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME), G28W); 171ac: 80 e4 ldi r24, 0x40 ; 64 171ae: 98 e4 ldi r25, 0x48 ; 72 171b0: 0e 94 b1 6c call 0xd962 ; 0xd962 171b4: 62 e1 ldi r22, 0x12 ; 18 171b6: 78 e6 ldi r23, 0x68 ; 104 171b8: 0f 94 b2 91 call 0x32364 ; 0x32364 #ifdef TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_BELTTEST), lcd_belttest_v); #endif //TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_SELFTEST), lcd_selftest_v); 171bc: 8f e6 ldi r24, 0x6F ; 111 171be: 9b e3 ldi r25, 0x3B ; 59 171c0: 0e 94 b1 6c call 0xd962 ; 0xd962 171c4: 6a ec ldi r22, 0xCA ; 202 171c6: 76 ef ldi r23, 0xF6 ; 246 171c8: 0f 94 39 92 call 0x32472 ; 0x32472 // MK2 MENU_ITEM_FUNCTION_P(_T(MSG_CALIBRATE_BED), lcd_mesh_calibration); 171cc: 8f e5 ldi r24, 0x5F ; 95 171ce: 9b e3 ldi r25, 0x3B ; 59 171d0: 0e 94 b1 6c call 0xd962 ; 0xd962 171d4: 60 e6 ldi r22, 0x60 ; 96 171d6: 7e ef ldi r23, 0xFE ; 254 171d8: 0f 94 39 92 call 0x32472 ; 0x32472 // "Calibrate Z" with storing the reference values to EEPROM. MENU_ITEM_FUNCTION_P(_T(MSG_HOMEYZ), lcd_mesh_calibration_z); 171dc: 81 e5 ldi r24, 0x51 ; 81 171de: 9b e3 ldi r25, 0x3B ; 59 171e0: 0e 94 b1 6c call 0xd962 ; 0xd962 171e4: 69 e5 ldi r22, 0x59 ; 89 171e6: 7e ef ldi r23, 0xFE ; 254 171e8: 0f 94 39 92 call 0x32472 ; 0x32472 MENU_ITEM_SUBMENU_P(_T(MSG_MESH_BED_LEVELING), lcd_mesh_bedleveling); ////MSG_MESH_BED_LEVELING c=18 171ec: 8d e3 ldi r24, 0x3D ; 61 171ee: 9b e3 ldi r25, 0x3B ; 59 171f0: 0e 94 b1 6c call 0xd962 ; 0xd962 171f4: 67 e6 ldi r22, 0x67 ; 103 171f6: 7e ef ldi r23, 0xFE ; 254 171f8: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(_T(MSG_BED_CORRECTION_MENU), lcd_adjust_bed); 171fc: 89 e2 ldi r24, 0x29 ; 41 171fe: 9b e3 ldi r25, 0x3B ; 59 17200: 0e 94 b1 6c call 0xd962 ; 0xd962 17204: 62 ee ldi r22, 0xE2 ; 226 17206: 7e ef ldi r23, 0xFE ; 254 17208: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(_T(MSG_PID_EXTRUDER), pid_extruder); 1720c: 87 e1 ldi r24, 0x17 ; 23 1720e: 9b e3 ldi r25, 0x3B ; 59 17210: 0e 94 b1 6c call 0xd962 ; 0xd962 17214: 6b e9 ldi r22, 0x9B ; 155 17216: 7f ef ldi r23, 0xFF ; 255 17218: 0f 94 ea 94 call 0x329d4 ; 0x329d4 #ifndef TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_SHOW_END_STOPS), menu_show_end_stops); 1721c: 86 e0 ldi r24, 0x06 ; 6 1721e: 9b e3 ldi r25, 0x3B ; 59 17220: 0e 94 b1 6c call 0xd962 ; 0xd962 17224: 65 e7 ldi r22, 0x75 ; 117 17226: 78 e3 ldi r23, 0x38 ; 56 17228: 0f 94 ea 94 call 0x329d4 ; 0x329d4 #endif MENU_ITEM_GCODE_P(_T(MSG_CALIBRATE_BED_RESET), PSTR("M44")); 1722c: 82 ef ldi r24, 0xF2 ; 242 1722e: 9a e3 ldi r25, 0x3A ; 58 17230: 0e 94 b1 6c call 0xd962 ; 0xd962 17234: 68 eb ldi r22, 0xB8 ; 184 17236: 72 e8 ldi r23, 0x82 ; 130 17238: 0f 94 b2 91 call 0x32364 ; 0x32364 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 1723c: 0f 94 b2 14 call 0x22964 ; 0x22964 17240: 88 23 and r24, r24 17242: 41 f0 breq .+16 ; 0x17254 MENU_ITEM_FUNCTION_P(_T(MSG_PINDA_CALIBRATION), lcd_calibrate_pinda); 17244: 85 ee ldi r24, 0xE5 ; 229 17246: 9a e3 ldi r25, 0x3A ; 58 17248: 0e 94 b1 6c call 0xd962 ; 0xd962 1724c: 62 e5 ldi r22, 0x52 ; 82 1724e: 7e ef ldi r23, 0xFE ; 254 17250: 0f 94 39 92 call 0x32472 ; 0x32472 #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); 17254: 0f 94 90 92 call 0x32520 ; 0x32520 } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 17258: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1725c: 8f 5f subi r24, 0xFF ; 255 1725e: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 17262: 80 91 30 04 lds r24, 0x0430 ; 0x800430 17266: 8f 5f subi r24, 0xFF ; 255 17268: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1726c: 7e cf rjmp .-260 ; 0x1716a #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); } 1726e: 08 95 ret 00017270 : } #endif //FANCHECK static uint8_t lcd_selftest_screen(TestScreen screen, uint8_t _progress, uint8_t _progress_scale, bool _clear, uint16_t _delay) { 17270: bf 92 push r11 17272: cf 92 push r12 17274: df 92 push r13 17276: ef 92 push r14 17278: ff 92 push r15 1727a: 0f 93 push r16 1727c: 1f 93 push r17 1727e: cf 93 push r28 17280: df 93 push r29 17282: c8 2f mov r28, r24 17284: f6 2e mov r15, r22 17286: e4 2e mov r14, r20 17288: b2 2e mov r11, r18 1728a: 68 01 movw r12, r16 lcd_update_enable(false); 1728c: 80 e0 ldi r24, 0x00 ; 0 1728e: 0e 94 c0 69 call 0xd380 ; 0xd380 const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; 17292: dc e7 ldi r29, 0x7C ; 124 17294: fe 14 cp r15, r14 17296: 08 f0 brcs .+2 ; 0x1729a 17298: dd e2 ldi r29, 0x2D ; 45 if (_clear) 1729a: bb 20 and r11, r11 1729c: 09 f1 breq .+66 ; 0x172e0 lcd_clear(); 1729e: 0e 94 ae 69 call 0xd35c ; 0xd35c else lcd_home(); if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 172a2: c1 11 cpse r28, r1 172a4: 20 c0 rjmp .+64 ; 0x172e6 if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 172a6: 8c ee ldi r24, 0xEC ; 236 172a8: 93 e4 ldi r25, 0x43 ; 67 if (screen == TestScreen::EndStops) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ENDSTOPS)); if (screen == TestScreen::AxisX) lcd_puts_P(_T(MSG_CHECKING_X)); if (screen == TestScreen::AxisY) lcd_puts_P(_T(MSG_CHECKING_Y)); if (screen == TestScreen::AxisZ) lcd_puts_P(_T(MSG_SELFTEST_CHECK_Z)); if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED)); 172aa: 0e 94 b1 6c call 0xd962 ; 0xd962 172ae: 0e 94 66 69 call 0xd2cc ; 0xd2cc if (screen == TestScreen::Hotend || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 172b2: 88 ef ldi r24, 0xF8 ; 248 172b4: 8c 0f add r24, r28 if (screen == TestScreen::EndStops) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ENDSTOPS)); if (screen == TestScreen::AxisX) lcd_puts_P(_T(MSG_CHECKING_X)); if (screen == TestScreen::AxisY) lcd_puts_P(_T(MSG_CHECKING_Y)); if (screen == TestScreen::AxisZ) lcd_puts_P(_T(MSG_SELFTEST_CHECK_Z)); if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED)); if (screen == TestScreen::Hotend 172b6: 82 30 cpi r24, 0x02 ; 2 172b8: 78 f5 brcc .+94 ; 0x17318 || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 172ba: 8a e9 ldi r24, 0x9A ; 154 172bc: 9f e3 ldi r25, 0x3F ; 63 172be: 0e 94 b1 6c call 0xd962 ; 0xd962 172c2: 0e 94 66 69 call 0xd2cc ; 0xd2cc if (screen == TestScreen::Fsensor) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); if (screen == TestScreen::FsensorOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); if (screen == TestScreen::AllCorrect) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ALLCORRECT)); 172c6: 89 e7 ldi r24, 0x79 ; 121 172c8: 9f e3 ldi r25, 0x3F ; 63 172ca: cc 30 cpi r28, 0x0C ; 12 172cc: 49 f1 breq .+82 ; 0x17320 if (screen == TestScreen::Failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED)); 172ce: 87 e6 ldi r24, 0x67 ; 103 172d0: 9f e3 ldi r25, 0x3F ; 63 172d2: cd 30 cpi r28, 0x0D ; 13 172d4: 29 f1 breq .+74 ; 0x17320 if (screen == TestScreen::Home) lcd_puts_P(_T(MSG_CALIBRATING_HOME)); 172d6: ce 30 cpi r28, 0x0E ; 14 172d8: 39 f5 brne .+78 ; 0x17328 172da: 84 e5 ldi r24, 0x54 ; 84 172dc: 9f e3 ldi r25, 0x3F ; 63 172de: 20 c0 rjmp .+64 ; 0x17320 lcd_update_enable(false); const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; if (_clear) lcd_clear(); else lcd_home(); 172e0: 0e 94 a7 69 call 0xd34e ; 0xd34e 172e4: de cf rjmp .-68 ; 0x172a2 if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 172e6: c1 30 cpi r28, 0x01 ; 1 172e8: f1 f2 breq .-68 ; 0x172a6 if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 172ea: c2 30 cpi r28, 0x02 ; 2 172ec: e1 f2 breq .-72 ; 0x172a6 if (screen == TestScreen::EndStops) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ENDSTOPS)); 172ee: 81 ef ldi r24, 0xF1 ; 241 172f0: 9f e3 ldi r25, 0x3F ; 63 172f2: c3 30 cpi r28, 0x03 ; 3 172f4: d1 f2 breq .-76 ; 0x172aa if (screen == TestScreen::AxisX) lcd_puts_P(_T(MSG_CHECKING_X)); 172f6: 8f ed ldi r24, 0xDF ; 223 172f8: 9f e3 ldi r25, 0x3F ; 63 172fa: c4 30 cpi r28, 0x04 ; 4 172fc: b1 f2 breq .-84 ; 0x172aa if (screen == TestScreen::AxisY) lcd_puts_P(_T(MSG_CHECKING_Y)); 172fe: 8d ec ldi r24, 0xCD ; 205 17300: 9f e3 ldi r25, 0x3F ; 63 17302: c5 30 cpi r28, 0x05 ; 5 17304: 91 f2 breq .-92 ; 0x172aa if (screen == TestScreen::AxisZ) lcd_puts_P(_T(MSG_SELFTEST_CHECK_Z)); 17306: 8b eb ldi r24, 0xBB ; 187 17308: 9f e3 ldi r25, 0x3F ; 63 1730a: c6 30 cpi r28, 0x06 ; 6 1730c: 71 f2 breq .-100 ; 0x172aa if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED)); 1730e: c7 30 cpi r28, 0x07 ; 7 17310: 81 f6 brne .-96 ; 0x172b2 17312: 8c ea ldi r24, 0xAC ; 172 17314: 9f e3 ldi r25, 0x3F ; 63 17316: c9 cf rjmp .-110 ; 0x172aa if (screen == TestScreen::Hotend || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); if (screen == TestScreen::Fsensor) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); 17318: ca 30 cpi r28, 0x0A ; 10 1731a: 99 f5 brne .+102 ; 0x17382 if (screen == TestScreen::FsensorOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); 1731c: 87 e8 ldi r24, 0x87 ; 135 1731e: 9f e3 ldi r25, 0x3F ; 63 if (screen == TestScreen::AllCorrect) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ALLCORRECT)); if (screen == TestScreen::Failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED)); if (screen == TestScreen::Home) lcd_puts_P(_T(MSG_CALIBRATING_HOME)); 17320: 0e 94 b1 6c call 0xd962 ; 0xd962 17324: 0e 94 66 69 call 0xd2cc ; 0xd2cc lcd_puts_at_P(0, 1, STR_SEPARATOR); 17328: 4b e1 ldi r20, 0x1B ; 27 1732a: 53 e8 ldi r21, 0x83 ; 131 1732c: 61 e0 ldi r22, 0x01 ; 1 1732e: 80 e0 ldi r24, 0x00 ; 0 17330: 0e 94 8f 69 call 0xd31e ; 0xd31e if ((screen >= TestScreen::ExtruderFan) && (screen <= TestScreen::FansOk)) 17334: c3 30 cpi r28, 0x03 ; 3 17336: 70 f5 brcc .+92 ; 0x17394 { //SERIAL_ECHOLNPGM("Fan test"); lcd_puts_at_P(0, 2, _T(MSG_HOTEND_FAN_SPEED)); 17338: 86 e4 ldi r24, 0x46 ; 70 1733a: 9f e3 ldi r25, 0x3F ; 63 1733c: 0e 94 b1 6c call 0xd962 ; 0xd962 17340: ac 01 movw r20, r24 17342: 62 e0 ldi r22, 0x02 ; 2 17344: 80 e0 ldi r24, 0x00 ; 0 17346: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_set_cursor(18, 2); 1734a: 62 e0 ldi r22, 0x02 ; 2 1734c: 82 e1 ldi r24, 0x12 ; 18 1734e: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 (screen < TestScreen::PrintFan) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 17352: c1 11 cpse r28, r1 17354: 1a c0 rjmp .+52 ; 0x1738a 17356: 8d 2f mov r24, r29 17358: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 lcd_puts_at_P(0, 3, _T(MSG_PRINT_FAN_SPEED)); 1735c: 89 e3 ldi r24, 0x39 ; 57 1735e: 9f e3 ldi r25, 0x3F ; 63 17360: 0e 94 b1 6c call 0xd962 ; 0xd962 17364: ac 01 movw r20, r24 17366: 63 e0 ldi r22, 0x03 ; 3 17368: 80 e0 ldi r24, 0x00 ; 0 1736a: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_set_cursor(18, 3); 1736e: 63 e0 ldi r22, 0x03 ; 3 17370: 82 e1 ldi r24, 0x12 ; 18 17372: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 (screen < TestScreen::FansOk) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 17376: c2 30 cpi r28, 0x02 ; 2 17378: 19 f1 breq .+70 ; 0x173c0 else if (screen >= TestScreen::Fsensor && screen <= TestScreen::FsensorOk) { lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); lcd_putc(':'); lcd_set_cursor(18, 2); (screen == TestScreen::Fsensor) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1737a: 8d 2f mov r24, r29 1737c: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 17380: 23 c0 rjmp .+70 ; 0x173c8 if (screen == TestScreen::AxisZ) lcd_puts_P(_T(MSG_SELFTEST_CHECK_Z)); if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED)); if (screen == TestScreen::Hotend || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); if (screen == TestScreen::Fsensor) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); if (screen == TestScreen::FsensorOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); 17382: cb 30 cpi r28, 0x0B ; 11 17384: 09 f0 breq .+2 ; 0x17388 17386: 9f cf rjmp .-194 ; 0x172c6 17388: c9 cf rjmp .-110 ; 0x1731c if ((screen >= TestScreen::ExtruderFan) && (screen <= TestScreen::FansOk)) { //SERIAL_ECHOLNPGM("Fan test"); lcd_puts_at_P(0, 2, _T(MSG_HOTEND_FAN_SPEED)); lcd_set_cursor(18, 2); (screen < TestScreen::PrintFan) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1738a: 83 ed ldi r24, 0xD3 ; 211 1738c: 97 e6 ldi r25, 0x67 ; 103 1738e: 0e 94 66 69 call 0xd2cc ; 0xd2cc 17392: e4 cf rjmp .-56 ; 0x1735c lcd_puts_at_P(0, 3, _T(MSG_PRINT_FAN_SPEED)); lcd_set_cursor(18, 3); (screen < TestScreen::FansOk) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); } else if (screen >= TestScreen::Fsensor && screen <= TestScreen::FsensorOk) 17394: 86 ef ldi r24, 0xF6 ; 246 17396: 8c 0f add r24, r28 17398: 82 30 cpi r24, 0x02 ; 2 1739a: 80 f5 brcc .+96 ; 0x173fc { lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 1739c: 87 e2 ldi r24, 0x27 ; 39 1739e: 9f e3 ldi r25, 0x3F ; 63 173a0: 0e 94 b1 6c call 0xd962 ; 0xd962 173a4: ac 01 movw r20, r24 173a6: 62 e0 ldi r22, 0x02 ; 2 173a8: 80 e0 ldi r24, 0x00 ; 0 173aa: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_putc(':'); 173ae: 8a e3 ldi r24, 0x3A ; 58 173b0: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 lcd_set_cursor(18, 2); 173b4: 62 e0 ldi r22, 0x02 ; 2 173b6: 82 e1 ldi r24, 0x12 ; 18 173b8: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 (screen == TestScreen::Fsensor) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 173bc: ca 30 cpi r28, 0x0A ; 10 173be: e9 f2 breq .-70 ; 0x1737a lcd_puts_at_P(0, 2, _T(MSG_HOTEND_FAN_SPEED)); lcd_set_cursor(18, 2); (screen < TestScreen::PrintFan) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); lcd_puts_at_P(0, 3, _T(MSG_PRINT_FAN_SPEED)); lcd_set_cursor(18, 3); (screen < TestScreen::FansOk) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 173c0: 83 ed ldi r24, 0xD3 ; 211 173c2: 97 e6 ldi r25, 0x67 ; 103 173c4: 0e 94 66 69 call 0xd2cc ; 0xd2cc _step_block = TestScreen::Hotend; lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Hotend"), _indicator); } if (_delay > 0) delay_keep_alive(_delay); 173c8: c1 14 cp r12, r1 173ca: d1 04 cpc r13, r1 173cc: 19 f0 breq .+6 ; 0x173d4 173ce: c6 01 movw r24, r12 173d0: 0e 94 48 7c call 0xf890 ; 0xf890 _progress++; 173d4: 81 e0 ldi r24, 0x01 ; 1 173d6: 8f 0d add r24, r15 return (_progress >= _progress_scale * 2) ? 0 : _progress; 173d8: 4e 2d mov r20, r14 173da: 50 e0 ldi r21, 0x00 ; 0 173dc: 44 0f add r20, r20 173de: 55 1f adc r21, r21 173e0: 84 17 cp r24, r20 173e2: 15 06 cpc r1, r21 173e4: 0c f0 brlt .+2 ; 0x173e8 173e6: 80 e0 ldi r24, 0x00 ; 0 } 173e8: df 91 pop r29 173ea: cf 91 pop r28 173ec: 1f 91 pop r17 173ee: 0f 91 pop r16 173f0: ff 90 pop r15 173f2: ef 90 pop r14 173f4: df 90 pop r13 173f6: cf 90 pop r12 173f8: bf 90 pop r11 173fa: 08 95 ret lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); lcd_putc(':'); lcd_set_cursor(18, 2); (screen == TestScreen::Fsensor) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); } else if (screen < TestScreen::Fsensor) 173fc: ca 30 cpi r28, 0x0A ; 10 173fe: 20 f7 brcc .-56 ; 0x173c8 { //SERIAL_ECHOLNPGM("Other tests"); TestScreen _step_block = TestScreen::AxisX; lcd_selftest_screen_step(2, 2, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("X"), _indicator); 17400: 41 e0 ldi r20, 0x01 ; 1 17402: c4 30 cpi r28, 0x04 ; 4 17404: 21 f0 breq .+8 ; 0x1740e 17406: 42 e0 ldi r20, 0x02 ; 2 17408: c3 30 cpi r28, 0x03 ; 3 1740a: 09 f4 brne .+2 ; 0x1740e 1740c: 40 e0 ldi r20, 0x00 ; 0 1740e: 0d 2f mov r16, r29 17410: 29 e1 ldi r18, 0x19 ; 25 17412: 33 e8 ldi r19, 0x83 ; 131 17414: 62 e0 ldi r22, 0x02 ; 2 17416: 82 e0 ldi r24, 0x02 ; 2 17418: 0e 94 5a b2 call 0x164b4 ; 0x164b4 _step_block = TestScreen::AxisY; lcd_selftest_screen_step(2, 8, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Y"), _indicator); 1741c: 41 e0 ldi r20, 0x01 ; 1 1741e: c5 30 cpi r28, 0x05 ; 5 17420: 21 f0 breq .+8 ; 0x1742a 17422: 42 e0 ldi r20, 0x02 ; 2 17424: c5 30 cpi r28, 0x05 ; 5 17426: 08 f4 brcc .+2 ; 0x1742a 17428: 40 e0 ldi r20, 0x00 ; 0 1742a: 0d 2f mov r16, r29 1742c: 27 e1 ldi r18, 0x17 ; 23 1742e: 33 e8 ldi r19, 0x83 ; 131 17430: 68 e0 ldi r22, 0x08 ; 8 17432: 82 e0 ldi r24, 0x02 ; 2 17434: 0e 94 5a b2 call 0x164b4 ; 0x164b4 _step_block = TestScreen::AxisZ; lcd_selftest_screen_step(2, 14, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Z"), _indicator); 17438: 41 e0 ldi r20, 0x01 ; 1 1743a: c6 30 cpi r28, 0x06 ; 6 1743c: 21 f0 breq .+8 ; 0x17446 1743e: 42 e0 ldi r20, 0x02 ; 2 17440: c6 30 cpi r28, 0x06 ; 6 17442: 08 f4 brcc .+2 ; 0x17446 17444: 40 e0 ldi r20, 0x00 ; 0 17446: 0d 2f mov r16, r29 17448: 25 e1 ldi r18, 0x15 ; 21 1744a: 33 e8 ldi r19, 0x83 ; 131 1744c: 6e e0 ldi r22, 0x0E ; 14 1744e: 82 e0 ldi r24, 0x02 ; 2 17450: 0e 94 5a b2 call 0x164b4 ; 0x164b4 _step_block = TestScreen::Bed; lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Bed"), _indicator); 17454: 41 e0 ldi r20, 0x01 ; 1 17456: c7 30 cpi r28, 0x07 ; 7 17458: 21 f0 breq .+8 ; 0x17462 1745a: 42 e0 ldi r20, 0x02 ; 2 1745c: c7 30 cpi r28, 0x07 ; 7 1745e: 08 f4 brcc .+2 ; 0x17462 17460: 40 e0 ldi r20, 0x00 ; 0 17462: 0d 2f mov r16, r29 17464: 21 e1 ldi r18, 0x11 ; 17 17466: 33 e8 ldi r19, 0x83 ; 131 17468: 60 e0 ldi r22, 0x00 ; 0 1746a: 83 e0 ldi r24, 0x03 ; 3 1746c: 0e 94 5a b2 call 0x164b4 ; 0x164b4 _step_block = TestScreen::Hotend; lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Hotend"), _indicator); 17470: 41 e0 ldi r20, 0x01 ; 1 17472: c8 30 cpi r28, 0x08 ; 8 17474: 21 f0 breq .+8 ; 0x1747e 17476: 42 e0 ldi r20, 0x02 ; 2 17478: c8 30 cpi r28, 0x08 ; 8 1747a: 08 f4 brcc .+2 ; 0x1747e 1747c: 40 e0 ldi r20, 0x00 ; 0 1747e: 0d 2f mov r16, r29 17480: 2a e0 ldi r18, 0x0A ; 10 17482: 33 e8 ldi r19, 0x83 ; 131 17484: 69 e0 ldi r22, 0x09 ; 9 17486: 83 e0 ldi r24, 0x03 ; 3 17488: 0e 94 5a b2 call 0x164b4 ; 0x164b4 1748c: 9d cf rjmp .-198 ; 0x173c8 0001748e : { printf_P(MSG_HOST_ACTION_NOTIFICATION, message); } static void lcd_rename_sheet_menu() { 1748e: cf 93 push r28 17490: df 93 push r29 unsigned char name[sizeof(Sheet::name)]; }; static_assert(sizeof(menu_data)>= sizeof(MenuData),"MenuData doesn't fit into menu_data"); MenuData* menuData = (MenuData*)&(menu_data[0]); if (!menuData->initialized) 17492: 80 91 64 03 lds r24, 0x0364 ; 0x800364 17496: 81 11 cpse r24, r1 17498: 18 c0 rjmp .+48 ; 0x174ca { eeprom_read_block(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); 1749a: 60 91 98 03 lds r22, 0x0398 ; 0x800398 1749e: 8b e0 ldi r24, 0x0B ; 11 174a0: 68 9f mul r22, r24 174a2: b0 01 movw r22, r0 174a4: 11 24 eor r1, r1 174a6: 67 5b subi r22, 0xB7 ; 183 174a8: 72 4f sbci r23, 0xF2 ; 242 174aa: 47 e0 ldi r20, 0x07 ; 7 174ac: 50 e0 ldi r21, 0x00 ; 0 174ae: 86 e6 ldi r24, 0x66 ; 102 174b0: 93 e0 ldi r25, 0x03 ; 3 174b2: 0f 94 cc 9f call 0x33f98 ; 0x33f98 lcd_encoder = menuData->name[0]; 174b6: 80 91 66 03 lds r24, 0x0366 ; 0x800366 174ba: 90 e0 ldi r25, 0x00 ; 0 174bc: 90 93 07 05 sts 0x0507, r25 ; 0x800507 174c0: 80 93 06 05 sts 0x0506, r24 ; 0x800506 menuData->initialized = true; 174c4: 81 e0 ldi r24, 0x01 ; 1 174c6: 80 93 64 03 sts 0x0364, r24 ; 0x800364 } if (lcd_encoder < 0x20) lcd_encoder = 0x20; 174ca: 80 91 06 05 lds r24, 0x0506 ; 0x800506 174ce: 90 91 07 05 lds r25, 0x0507 ; 0x800507 174d2: 80 97 sbiw r24, 0x20 ; 32 174d4: 34 f4 brge .+12 ; 0x174e2 174d6: 80 e2 ldi r24, 0x20 ; 32 174d8: 90 e0 ldi r25, 0x00 ; 0 174da: 90 93 07 05 sts 0x0507, r25 ; 0x800507 174de: 80 93 06 05 sts 0x0506, r24 ; 0x800506 if (lcd_encoder > 0xFF) lcd_encoder = 0xFF; 174e2: 80 91 06 05 lds r24, 0x0506 ; 0x800506 174e6: 90 91 07 05 lds r25, 0x0507 ; 0x800507 174ea: 8f 3f cpi r24, 0xFF ; 255 174ec: 91 05 cpc r25, r1 174ee: 39 f0 breq .+14 ; 0x174fe 174f0: 34 f0 brlt .+12 ; 0x174fe 174f2: 8f ef ldi r24, 0xFF ; 255 174f4: 90 e0 ldi r25, 0x00 ; 0 174f6: 90 93 07 05 sts 0x0507, r25 ; 0x800507 174fa: 80 93 06 05 sts 0x0506, r24 ; 0x800506 menuData->name[menuData->selected] = lcd_encoder; 174fe: e0 91 65 03 lds r30, 0x0365 ; 0x800365 17502: f0 e0 ldi r31, 0x00 ; 0 17504: ec 59 subi r30, 0x9C ; 156 17506: fc 4f sbci r31, 0xFC ; 252 17508: 80 91 06 05 lds r24, 0x0506 ; 0x800506 1750c: 82 83 std Z+2, r24 ; 0x02 lcd_home(); 1750e: 0e 94 a7 69 call 0xd34e ; 0xd34e 17512: c6 e6 ldi r28, 0x66 ; 102 17514: d3 e0 ldi r29, 0x03 ; 3 for (uint_least8_t i = 0; i < sizeof(Sheet::name); ++i) { lcd_putc(menuData->name[i]); 17516: 89 91 ld r24, Y+ 17518: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 if (lcd_encoder < 0x20) lcd_encoder = 0x20; if (lcd_encoder > 0xFF) lcd_encoder = 0xFF; menuData->name[menuData->selected] = lcd_encoder; lcd_home(); for (uint_least8_t i = 0; i < sizeof(Sheet::name); ++i) 1751c: 83 e0 ldi r24, 0x03 ; 3 1751e: cd 36 cpi r28, 0x6D ; 109 17520: d8 07 cpc r29, r24 17522: c9 f7 brne .-14 ; 0x17516 { lcd_putc(menuData->name[i]); } lcd_putc_at(menuData->selected, 1, '^'); 17524: 4e e5 ldi r20, 0x5E ; 94 17526: 61 e0 ldi r22, 0x01 ; 1 17528: 80 91 65 03 lds r24, 0x0365 ; 0x800365 1752c: 0e 94 9b 69 call 0xd336 ; 0xd336 if (menuData->selected > 0) 17530: 80 91 65 03 lds r24, 0x0365 ; 0x800365 17534: 88 23 and r24, r24 17536: 29 f0 breq .+10 ; 0x17542 { lcd_putc_at(menuData->selected-1, 1, ' '); 17538: 40 e2 ldi r20, 0x20 ; 32 1753a: 61 e0 ldi r22, 0x01 ; 1 1753c: 81 50 subi r24, 0x01 ; 1 1753e: 0e 94 9b 69 call 0xd336 ; 0xd336 } if (lcd_clicked()) 17542: 0e 94 98 6b call 0xd730 ; 0xd730 17546: 88 23 and r24, r24 17548: 99 f0 breq .+38 ; 0x17570 { if ((menuData->selected + 1u) < sizeof(Sheet::name)) 1754a: e0 91 65 03 lds r30, 0x0365 ; 0x800365 1754e: 8e 2f mov r24, r30 17550: 90 e0 ldi r25, 0x00 ; 0 17552: 01 96 adiw r24, 0x01 ; 1 17554: 07 97 sbiw r24, 0x07 ; 7 17556: 78 f4 brcc .+30 ; 0x17576 { lcd_encoder = menuData->name[++(menuData->selected)]; 17558: ef 5f subi r30, 0xFF ; 255 1755a: e0 93 65 03 sts 0x0365, r30 ; 0x800365 1755e: f0 e0 ldi r31, 0x00 ; 0 17560: ec 59 subi r30, 0x9C ; 156 17562: fc 4f sbci r31, 0xFC ; 252 17564: 82 81 ldd r24, Z+2 ; 0x02 17566: 90 e0 ldi r25, 0x00 ; 0 17568: 90 93 07 05 sts 0x0507, r25 ; 0x800507 1756c: 80 93 06 05 sts 0x0506, r24 ; 0x800506 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 17570: df 91 pop r29 17572: cf 91 pop r28 17574: 08 95 ret { lcd_encoder = menuData->name[++(menuData->selected)]; } else { eeprom_update_block_notify(menuData->name, 17576: 60 91 98 03 lds r22, 0x0398 ; 0x800398 1757a: 8b e0 ldi r24, 0x0B ; 11 1757c: 68 9f mul r22, r24 1757e: b0 01 movw r22, r0 17580: 11 24 eor r1, r1 17582: 67 5b subi r22, 0xB7 ; 183 17584: 72 4f sbci r23, 0xF2 ; 242 #endif //DEBUG_EEPROM_CHANGES } #ifndef DEBUG_EEPROM_CHANGES void eeprom_update_block_notify(const void *__src, void *__dst, size_t __n){ eeprom_update_block(__src, __dst, __n); 17586: 47 e0 ldi r20, 0x07 ; 7 17588: 50 e0 ldi r21, 0x00 ; 0 1758a: 86 e6 ldi r24, 0x66 ; 102 1758c: 93 e0 ldi r25, 0x03 ; 3 1758e: 0f 94 f0 9f call 0x33fe0 ; 0x33fe0 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 17592: df 91 pop r29 17594: cf 91 pop r28 else { eeprom_update_block_notify(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); 17596: 0d 94 84 95 jmp 0x32b08 ; 0x32b08 0001759a : static void lcd_sd_refresh() { #if SDCARDDETECT == -1 card.mount(); #else card.presort(); 1759a: 0f 94 45 49 call 0x2928a ; 0x2928a #endif menu_top = 0; 1759e: 10 92 60 03 sts 0x0360, r1 ; 0x800360 lcd_encoder = 0; 175a2: 10 92 07 05 sts 0x0507, r1 ; 0x800507 175a6: 10 92 06 05 sts 0x0506, r1 ; 0x800506 menu_data_reset(); //Forces reloading of cached variables. 175aa: 0d 94 de 92 jmp 0x325bc ; 0x325bc 000175ae : } } void CardReader::updir() { if(workDirDepth > 0) 175ae: 80 91 0a 15 lds r24, 0x150A ; 0x80150a 175b2: 88 23 and r24, r24 175b4: f9 f0 breq .+62 ; 0x175f4 { --workDirDepth; 175b6: 81 50 subi r24, 0x01 ; 1 175b8: 80 93 0a 15 sts 0x150A, r24 ; 0x80150a workDir = workDirParents[0]; 175bc: 93 e2 ldi r25, 0x23 ; 35 175be: e8 e3 ldi r30, 0x38 ; 56 175c0: f4 e1 ldi r31, 0x14 ; 20 175c2: a5 e1 ldi r26, 0x15 ; 21 175c4: b4 e1 ldi r27, 0x14 ; 20 175c6: 01 90 ld r0, Z+ 175c8: 0d 92 st X+, r0 175ca: 9a 95 dec r25 175cc: e1 f7 brne .-8 ; 0x175c6 175ce: 28 e3 ldi r18, 0x38 ; 56 175d0: 34 e1 ldi r19, 0x14 ; 20 for (uint8_t d = 0; d < workDirDepth; d++) 175d2: 90 e0 ldi r25, 0x00 ; 0 175d4: 98 17 cp r25, r24 175d6: 60 f4 brcc .+24 ; 0x175f0 { workDirParents[d] = workDirParents[d+1]; 175d8: 43 e2 ldi r20, 0x23 ; 35 175da: f9 01 movw r30, r18 175dc: b3 96 adiw r30, 0x23 ; 35 175de: d9 01 movw r26, r18 175e0: 01 90 ld r0, Z+ 175e2: 0d 92 st X+, r0 175e4: 4a 95 dec r20 175e6: e1 f7 brne .-8 ; 0x175e0 { if(workDirDepth > 0) { --workDirDepth; workDir = workDirParents[0]; for (uint8_t d = 0; d < workDirDepth; d++) 175e8: 9f 5f subi r25, 0xFF ; 255 175ea: 2d 5d subi r18, 0xDD ; 221 175ec: 3f 4f sbci r19, 0xFF ; 255 175ee: f2 cf rjmp .-28 ; 0x175d4 { workDirParents[d] = workDirParents[d+1]; } #ifdef SDCARD_SORT_ALPHA presort(); 175f0: 0f 94 45 49 call 0x2928a ; 0x2928a } static void lcd_sd_updir() { card.updir(); menu_top = 0; 175f4: 10 92 60 03 sts 0x0360, r1 ; 0x800360 lcd_encoder = 0; 175f8: 10 92 07 05 sts 0x0507, r1 ; 0x800507 175fc: 10 92 06 05 sts 0x0506, r1 ; 0x800506 menu_data_reset(); //Forces reloading of cached variables. 17600: 0d 94 de 92 jmp 0x325bc ; 0x325bc 00017604 : } eeprom_update_byte_notify((uint8_t*)EEPROM_MBL_PROBE_NR, mbl_z_probe_nr); } static void lcd_mesh_bed_leveling_settings() { 17604: bf 92 push r11 17606: cf 92 push r12 17608: df 92 push r13 1760a: ef 92 push r14 1760c: ff 92 push r15 1760e: 0f 93 push r16 17610: 1f 93 push r17 17612: cf 93 push r28 17614: df 93 push r29 17616: 00 d0 rcall .+0 ; 0x17618 17618: 1f 92 push r1 1761a: cd b7 in r28, 0x3d ; 61 1761c: de b7 in r29, 0x3e ; 62 bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); 1761e: 8c ea ldi r24, 0xAC ; 172 17620: 9d e0 ldi r25, 0x0D ; 13 17622: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 17626: c8 2e mov r12, r24 uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 17628: 8b ea ldi r24, 0xAB ; 171 1762a: 9d e0 ldi r25, 0x0D ; 13 1762c: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 17630: f8 2e mov r15, r24 uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 17632: 8a ea ldi r24, 0xAA ; 170 17634: 9d e0 ldi r25, 0x0D ; 13 17636: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1763a: 18 2f mov r17, r24 char sToggle[4]; //enough for nxn format MENU_BEGIN(); 1763c: 0f 94 bc 92 call 0x32578 ; 0x32578 17640: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e if (points_nr == 7) { lcd_z_calibration_prompt(true); } ); MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); sToggle[0] = points_nr + '0'; 17644: 80 e3 ldi r24, 0x30 ; 48 17646: d8 2e mov r13, r24 17648: df 0c add r13, r15 sToggle[1] = 'x'; 1764a: 98 e7 ldi r25, 0x78 ; 120 1764c: b9 2e mov r11, r25 sToggle[2] = points_nr + '0'; sToggle[3] = 0; MENU_ITEM_TOGGLE(_T(MSG_MESH), sToggle, mbl_mesh_toggle); sToggle[0] = mbl_z_probe_nr + '0'; 1764e: 20 e3 ldi r18, 0x30 ; 48 17650: e2 2e mov r14, r18 17652: e1 0e add r14, r17 bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); char sToggle[4]; //enough for nxn format MENU_BEGIN(); 17654: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17658: 84 30 cpi r24, 0x04 ; 4 1765a: 08 f0 brcs .+2 ; 0x1765e 1765c: 56 c0 rjmp .+172 ; 0x1770a 1765e: 10 92 31 04 sts 0x0431, r1 ; 0x800431 ON_MENU_LEAVE( 17662: 0f 94 3c 91 call 0x32278 ; 0x32278 17666: 88 23 and r24, r24 17668: 31 f0 breq .+12 ; 0x17676 1766a: 87 e0 ldi r24, 0x07 ; 7 1766c: f8 12 cpse r15, r24 1766e: 03 c0 rjmp .+6 ; 0x17676 17670: 81 e0 ldi r24, 0x01 ; 1 17672: 0f 94 c1 2f call 0x25f82 ; 0x25f82 // Prompt user to run Z calibration for best results with region MBL. if (points_nr == 7) { lcd_z_calibration_prompt(true); } ); MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 17676: 87 ea ldi r24, 0xA7 ; 167 17678: 9d e3 ldi r25, 0x3D ; 61 1767a: 0e 94 b1 6c call 0xd962 ; 0xd962 1767e: 0f 94 87 95 call 0x32b0e ; 0x32b0e sToggle[0] = points_nr + '0'; 17682: d9 82 std Y+1, r13 ; 0x01 sToggle[1] = 'x'; 17684: ba 82 std Y+2, r11 ; 0x02 sToggle[2] = points_nr + '0'; 17686: db 82 std Y+3, r13 ; 0x03 sToggle[3] = 0; 17688: 1c 82 std Y+4, r1 ; 0x04 MENU_ITEM_TOGGLE(_T(MSG_MESH), sToggle, mbl_mesh_toggle); 1768a: 80 ea ldi r24, 0xA0 ; 160 1768c: 9d e3 ldi r25, 0x3D ; 61 1768e: 0e 94 b1 6c call 0xd962 ; 0xd962 17692: 20 e0 ldi r18, 0x00 ; 0 17694: 4f e2 ldi r20, 0x2F ; 47 17696: 53 eb ldi r21, 0xB3 ; 179 17698: be 01 movw r22, r28 1769a: 6f 5f subi r22, 0xFF ; 255 1769c: 7f 4f sbci r23, 0xFF ; 255 1769e: 0f 94 4b 94 call 0x32896 ; 0x32896 sToggle[0] = mbl_z_probe_nr + '0'; 176a2: e9 82 std Y+1, r14 ; 0x01 sToggle[1] = 0; 176a4: 1a 82 std Y+2, r1 ; 0x02 MENU_ITEM_TOGGLE(_T(MSG_Z_PROBE_NR), sToggle, mbl_probe_nr_toggle); 176a6: 82 e9 ldi r24, 0x92 ; 146 176a8: 9d e3 ldi r25, 0x3D ; 61 176aa: 0e 94 b1 6c call 0xd962 ; 0xd962 176ae: 20 e0 ldi r18, 0x00 ; 0 176b0: 40 e2 ldi r20, 0x20 ; 32 176b2: 53 eb ldi r21, 0xB3 ; 179 176b4: be 01 movw r22, r28 176b6: 6f 5f subi r22, 0xFF ; 255 176b8: 7f 4f sbci r23, 0xFF ; 255 176ba: 0f 94 4b 94 call 0x32896 ; 0x32896 MENU_ITEM_TOGGLE_P(_T(MSG_MAGNETS_COMP), (points_nr == 7) ? (magnet_elimination ? _T(MSG_ON): _T(MSG_OFF)) : _T(MSG_NA), mbl_magnets_elimination_toggle); 176be: 87 e0 ldi r24, 0x07 ; 7 176c0: f8 12 cpse r15, r24 176c2: 20 c0 rjmp .+64 ; 0x17704 176c4: 8f ea ldi r24, 0xAF ; 175 176c6: 9a e5 ldi r25, 0x5A ; 90 176c8: c1 10 cpse r12, r1 176ca: 02 c0 rjmp .+4 ; 0x176d0 176cc: 89 ea ldi r24, 0xA9 ; 169 176ce: 9a e5 ldi r25, 0x5A ; 90 176d0: 0e 94 b1 6c call 0xd962 ; 0xd962 176d4: 8c 01 movw r16, r24 176d6: 8c e7 ldi r24, 0x7C ; 124 176d8: 9d e3 ldi r25, 0x3D ; 61 176da: 0e 94 b1 6c call 0xd962 ; 0xd962 176de: 22 e0 ldi r18, 0x02 ; 2 176e0: 4b e3 ldi r20, 0x3B ; 59 176e2: 53 eb ldi r21, 0xB3 ; 179 176e4: b8 01 movw r22, r16 176e6: 0f 94 4b 94 call 0x32896 ; 0x32896 MENU_END(); 176ea: 0f 94 90 92 call 0x32520 ; 0x32520 bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); char sToggle[4]; //enough for nxn format MENU_BEGIN(); 176ee: 90 91 2e 04 lds r25, 0x042E ; 0x80042e 176f2: 9f 5f subi r25, 0xFF ; 255 176f4: 90 93 2e 04 sts 0x042E, r25 ; 0x80042e 176f8: 90 91 30 04 lds r25, 0x0430 ; 0x800430 176fc: 9f 5f subi r25, 0xFF ; 255 176fe: 90 93 30 04 sts 0x0430, r25 ; 0x800430 17702: a8 cf rjmp .-176 ; 0x17654 sToggle[3] = 0; MENU_ITEM_TOGGLE(_T(MSG_MESH), sToggle, mbl_mesh_toggle); sToggle[0] = mbl_z_probe_nr + '0'; sToggle[1] = 0; MENU_ITEM_TOGGLE(_T(MSG_Z_PROBE_NR), sToggle, mbl_probe_nr_toggle); MENU_ITEM_TOGGLE_P(_T(MSG_MAGNETS_COMP), (points_nr == 7) ? (magnet_elimination ? _T(MSG_ON): _T(MSG_OFF)) : _T(MSG_NA), mbl_magnets_elimination_toggle); 17704: 8c e8 ldi r24, 0x8C ; 140 17706: 9d e3 ldi r25, 0x3D ; 61 17708: e3 cf rjmp .-58 ; 0x176d0 MENU_END(); } 1770a: 0f 90 pop r0 1770c: 0f 90 pop r0 1770e: 0f 90 pop r0 17710: 0f 90 pop r0 17712: df 91 pop r29 17714: cf 91 pop r28 17716: 1f 91 pop r17 17718: 0f 91 pop r16 1771a: ff 90 pop r15 1771c: ef 90 pop r14 1771e: df 90 pop r13 17720: cf 90 pop r12 17722: bf 90 pop r11 17724: 08 95 ret 00017726 : static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { 17726: cf 93 push r28 MENU_BEGIN(); 17728: 0f 94 bc 92 call 0x32578 ; 0x32578 1772c: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 17730: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17734: 84 30 cpi r24, 0x04 ; 4 17736: 60 f5 brcc .+88 ; 0x17790 17738: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1773c: 88 ef ldi r24, 0xF8 ; 248 1773e: 9d e3 ldi r25, 0x3D ; 61 17740: 0e 94 b1 6c call 0xd962 ; 0xd962 17744: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), load_all_wrapper); 17748: 86 e9 ldi r24, 0x96 ; 150 1774a: 9b e3 ldi r25, 0x3B ; 59 1774c: 0e 94 b1 6c call 0xd962 ; 0xd962 17750: 67 e8 ldi r22, 0x87 ; 135 17752: 7c eb ldi r23, 0xBC ; 188 17754: 0f 94 39 92 call 0x32472 ; 0x32472 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 17758: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); 1775a: 8b e5 ldi r24, 0x5B ; 91 1775c: 9c e3 ldi r25, 0x3C ; 60 1775e: 0e 94 b1 6c call 0xd962 ; 0xd962 17762: 61 e3 ldi r22, 0x31 ; 49 17764: 6c 0f add r22, r28 17766: 2c 2f mov r18, r28 17768: 46 e9 ldi r20, 0x96 ; 150 1776a: 5c eb ldi r21, 0xBC ; 188 1776c: 0f 94 e2 91 call 0x323c4 ; 0x323c4 static void mmu_preload_filament_menu() { MENU_BEGIN(); MENU_ITEM_BACK_P(_T(MSG_MAIN)); MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), load_all_wrapper); for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 17770: cf 5f subi r28, 0xFF ; 255 17772: c5 30 cpi r28, 0x05 ; 5 17774: 91 f7 brne .-28 ; 0x1775a MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); MENU_END(); 17776: 0f 94 90 92 call 0x32520 ; 0x32520 static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { MENU_BEGIN(); 1777a: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1777e: 8f 5f subi r24, 0xFF ; 255 17780: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 17784: 80 91 30 04 lds r24, 0x0430 ; 0x800430 17788: 8f 5f subi r24, 0xFF ; 255 1778a: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1778e: d0 cf rjmp .-96 ; 0x17730 MENU_ITEM_BACK_P(_T(MSG_MAIN)); MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), load_all_wrapper); for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); MENU_END(); } 17790: cf 91 pop r28 17792: 08 95 ret 00017794 : static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); } static void lcd_mmuLoadFilament() { preheat_or_continue(FilamentAction::MmuLoad); 17794: 84 e0 ldi r24, 0x04 ; 4 17796: 0d 94 31 31 jmp 0x26262 ; 0x26262 0001779a : } static void lcd_mmuUnloadFilament() { preheat_or_continue(FilamentAction::MmuUnLoad); 1779a: 85 e0 ldi r24, 0x05 ; 5 1779c: 0d 94 31 31 jmp 0x26262 ; 0x26262 000177a0 : } static void lcd_mmuEjectFilament() { preheat_or_continue(FilamentAction::MmuEject); 177a0: 86 e0 ldi r24, 0x06 ; 6 177a2: 0d 94 31 31 jmp 0x26262 ; 0x26262 000177a6 : static void lcd_mmuLoadingTest() { preheat_or_continue(FilamentAction::MmuLoadingTest); } static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); 177a6: 87 e0 ldi r24, 0x07 ; 7 177a8: 0d 94 31 31 jmp 0x26262 ; 0x26262 000177ac : MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); MENU_END(); } static void lcd_mmuLoadingTest() { preheat_or_continue(FilamentAction::MmuLoadingTest); 177ac: 88 e0 ldi r24, 0x08 ; 8 177ae: 0d 94 31 31 jmp 0x26262 ; 0x26262 000177b2 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 177b2: 60 91 98 03 lds r22, 0x0398 ; 0x800398 177b6: 81 ea ldi r24, 0xA1 ; 161 177b8: 9d e0 ldi r25, 0x0D ; 13 177ba: 0f 94 00 a0 call 0x34000 ; 0x34000 } static void change_sheet() { eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), selected_sheet); menu_back(3); 177be: 83 e0 ldi r24, 0x03 ; 3 177c0: 0d 94 68 95 jmp 0x32ad0 ; 0x32ad0 000177c4 : // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { 177c4: cf 93 push r28 MENU_BEGIN(); 177c6: 0f 94 bc 92 call 0x32578 ; 0x32578 177ca: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 177ce: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 177d2: 84 30 cpi r24, 0x04 ; 4 177d4: 88 f5 brcc .+98 ; 0x17838 177d6: 10 92 31 04 sts 0x0431, r1 ; 0x800431 ON_MENU_LEAVE( 177da: 0f 94 3c 91 call 0x32278 ; 0x32278 177de: 81 11 cpse r24, r1 177e0: 0f 94 2f 0c call 0x2185e ; 0x2185e clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 177e4: 88 ef ldi r24, 0xF8 ; 248 177e6: 9d e3 ldi r25, 0x3D ; 61 177e8: 0e 94 b1 6c call 0xd962 ; 0xd962 177ec: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), loading_test_all_wrapper); 177f0: 86 e9 ldi r24, 0x96 ; 150 177f2: 9b e3 ldi r25, 0x3B ; 59 177f4: 0e 94 b1 6c call 0xd962 ; 0xd962 177f8: 61 ee ldi r22, 0xE1 ; 225 177fa: 76 ef ldi r23, 0xF6 ; 246 177fc: 0f 94 39 92 call 0x32472 ; 0x32472 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 17800: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); 17802: 8b e5 ldi r24, 0x5B ; 91 17804: 9c e3 ldi r25, 0x3C ; 60 17806: 0e 94 b1 6c call 0xd962 ; 0xd962 1780a: 61 e3 ldi r22, 0x31 ; 49 1780c: 6c 0f add r22, r28 1780e: 2c 2f mov r18, r28 17810: 4c ec ldi r20, 0xCC ; 204 17812: 56 ef ldi r21, 0xF6 ; 246 17814: 0f 94 e2 91 call 0x323c4 ; 0x323c4 ON_MENU_LEAVE( clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), loading_test_all_wrapper); for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 17818: cf 5f subi r28, 0xFF ; 255 1781a: c5 30 cpi r28, 0x05 ; 5 1781c: 91 f7 brne .-28 ; 0x17802 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); MENU_END(); 1781e: 0f 94 90 92 call 0x32520 ; 0x32520 // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { MENU_BEGIN(); 17822: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17826: 8f 5f subi r24, 0xFF ; 255 17828: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1782c: 80 91 30 04 lds r24, 0x0430 ; 0x800430 17830: 8f 5f subi r24, 0xFF ; 255 17832: 80 93 30 04 sts 0x0430, r24 ; 0x800430 17836: cb cf rjmp .-106 ; 0x177ce MENU_ITEM_BACK_P(_T(MSG_MAIN)); MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), loading_test_all_wrapper); for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); MENU_END(); } 17838: cf 91 pop r28 1783a: 08 95 ret 0001783c : } // Helper function to save code size by reducing duplicated code // These menus are not time critical static void mmu_common_choose_filament_menu(const char * label, void (*menuAction)(uint8_t)) { 1783c: ef 92 push r14 1783e: ff 92 push r15 17840: 0f 93 push r16 17842: 1f 93 push r17 17844: cf 93 push r28 17846: 8c 01 movw r16, r24 17848: 7b 01 movw r14, r22 MENU_BEGIN(); 1784a: 0f 94 bc 92 call 0x32578 ; 0x32578 1784e: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 17852: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17856: 84 30 cpi r24, 0x04 ; 4 17858: 28 f5 brcc .+74 ; 0x178a4 1785a: 10 92 31 04 sts 0x0431, r1 ; 0x800431 ON_MENU_LEAVE( 1785e: 0f 94 3c 91 call 0x32278 ; 0x32278 17862: 81 11 cpse r24, r1 17864: 0f 94 2f 0c call 0x2185e ; 0x2185e clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 17868: 88 ef ldi r24, 0xF8 ; 248 1786a: 9d e3 ldi r25, 0x3D ; 61 1786c: 0e 94 b1 6c call 0xd962 ; 0xd962 17870: 0f 94 87 95 call 0x32b0e ; 0x32b0e for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 17874: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); 17876: 61 e3 ldi r22, 0x31 ; 49 17878: 6c 0f add r22, r28 1787a: 2c 2f mov r18, r28 1787c: a7 01 movw r20, r14 1787e: c8 01 movw r24, r16 17880: 0f 94 e2 91 call 0x323c4 ; 0x323c4 MENU_BEGIN(); ON_MENU_LEAVE( clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 17884: cf 5f subi r28, 0xFF ; 255 17886: c5 30 cpi r28, 0x05 ; 5 17888: b1 f7 brne .-20 ; 0x17876 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); MENU_END(); 1788a: 0f 94 90 92 call 0x32520 ; 0x32520 // Helper function to save code size by reducing duplicated code // These menus are not time critical static void mmu_common_choose_filament_menu(const char * label, void (*menuAction)(uint8_t)) { MENU_BEGIN(); 1788e: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17892: 8f 5f subi r24, 0xFF ; 255 17894: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 17898: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1789c: 8f 5f subi r24, 0xFF ; 255 1789e: 80 93 30 04 sts 0x0430, r24 ; 0x800430 178a2: d7 cf rjmp .-82 ; 0x17852 ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); MENU_END(); } 178a4: cf 91 pop r28 178a6: 1f 91 pop r17 178a8: 0f 91 pop r16 178aa: ff 90 pop r15 178ac: ef 90 pop r14 178ae: 08 95 ret 000178b0 : static inline void mmu_cut_filament_wrapper(uint8_t index){ MMU2::mmu2.cut_filament(index); } static void mmu_cut_filament_menu() { mmu_common_choose_filament_menu(_T(MSG_CUT_FILAMENT), mmu_cut_filament_wrapper); 178b0: 82 ee ldi r24, 0xE2 ; 226 178b2: 99 e5 ldi r25, 0x59 ; 89 178b4: 0e 94 b1 6c call 0xd962 ; 0xd962 178b8: 60 e7 ldi r22, 0x70 ; 112 178ba: 7c eb ldi r23, 0xBC ; 188 178bc: 0c 94 1e bc jmp 0x1783c ; 0x1783c 000178c0 : // Clear the filament action clearFilamentAction(); } static void mmu_fil_eject_menu() { mmu_common_choose_filament_menu(_T(MSG_EJECT_FROM_MMU), mmu_eject_filament); 178c0: 81 ef ldi r24, 0xF1 ; 241 178c2: 99 e5 ldi r25, 0x59 ; 89 178c4: 0e 94 b1 6c call 0xd962 ; 0xd962 178c8: 6c e7 ldi r22, 0x7C ; 124 178ca: 7c eb ldi r23, 0xBC ; 188 178cc: 0c 94 1e bc jmp 0x1783c ; 0x1783c 000178d0 : MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); MENU_END(); } static void mmu_load_to_nozzle_menu() { mmu_common_choose_filament_menu(_T(MSG_LOAD_FILAMENT), lcd_mmu_load_to_nozzle_wrapper); 178d0: 8b e5 ldi r24, 0x5B ; 91 178d2: 9c e3 ldi r25, 0x3C ; 60 178d4: 0e 94 b1 6c call 0xd962 ; 0xd962 178d8: 6b e6 ldi r22, 0x6B ; 107 178da: 77 ef ldi r23, 0xF7 ; 247 178dc: 0c 94 1e bc jmp 0x1783c ; 0x1783c 000178e0 : static void mmu_fil_eject_menu() { mmu_common_choose_filament_menu(_T(MSG_EJECT_FROM_MMU), mmu_eject_filament); } #ifdef MMU_HAS_CUTTER static inline void mmu_cut_filament_wrapper(uint8_t index){ 178e0: cf 93 push r28 178e2: c8 2f mov r28, r24 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { 178e4: 0f 94 b4 53 call 0x2a768 ; 0x2a768 178e8: 88 23 and r24, r24 178ea: 21 f0 breq .+8 ; 0x178f4 178ec: 8c 2f mov r24, r28 MMU2::mmu2.cut_filament(index); } 178ee: cf 91 pop r28 178f0: 0d 94 6b 6b jmp 0x2d6d6 ; 0x2d6d6 178f4: cf 91 pop r28 178f6: 08 95 ret 000178f8 : static void mmu_load_to_nozzle_menu() { mmu_common_choose_filament_menu(_T(MSG_LOAD_FILAMENT), lcd_mmu_load_to_nozzle_wrapper); } static void mmu_eject_filament(uint8_t filament) { 178f8: cf 93 push r28 178fa: c8 2f mov r28, r24 menu_back(); 178fc: 0f 94 84 95 call 0x32b08 ; 0x32b08 MMU2::mmu2.eject_filament(filament, true); 17900: 61 e0 ldi r22, 0x01 ; 1 17902: 8c 2f mov r24, r28 17904: 0f 94 ee 6a call 0x2d5dc ; 0x2d5dc // Clear the filament action clearFilamentAction(); } 17908: cf 91 pop r28 static void mmu_eject_filament(uint8_t filament) { menu_back(); MMU2::mmu2.eject_filament(filament, true); // Clear the filament action clearFilamentAction(); 1790a: 0d 94 2f 0c jmp 0x2185e ; 0x2185e 0001790e : } static inline void load_all_wrapper(){ for(uint8_t i = 0; i < MMU_FILAMENT_COUNT; ++i){ MMU2::mmu2.load_filament(i); 1790e: 80 e0 ldi r24, 0x00 ; 0 17910: 0f 94 ab 6a call 0x2d556 ; 0x2d556 17914: 81 e0 ldi r24, 0x01 ; 1 17916: 0f 94 ab 6a call 0x2d556 ; 0x2d556 1791a: 82 e0 ldi r24, 0x02 ; 2 1791c: 0f 94 ab 6a call 0x2d556 ; 0x2d556 17920: 83 e0 ldi r24, 0x03 ; 3 17922: 0f 94 ab 6a call 0x2d556 ; 0x2d556 17926: 84 e0 ldi r24, 0x04 ; 4 17928: 0d 94 ab 6a jmp 0x2d556 ; 0x2d556 0001792c : } } static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); 1792c: 0d 94 ab 6a jmp 0x2d556 ; 0x2d556 00017930 : break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 17930: 80 e0 ldi r24, 0x00 ; 0 17932: 0d 94 5d 62 jmp 0x2c4ba ; 0x2c4ba 00017936 : lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 17936: 0f 94 bc 92 call 0x32578 ; 0x32578 1793a: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1793e: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17942: 84 30 cpi r24, 0x04 ; 4 17944: 08 f0 brcs .+2 ; 0x17948 17946: 45 c0 rjmp .+138 ; 0x179d2 17948: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 1794c: 8e e9 ldi r24, 0x9E ; 158 1794e: 9a e3 ldi r25, 0x3A ; 58 17950: 0e 94 b1 6c call 0xd962 ; 0xd962 17954: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[0], select_sheet_menu<0>); 17958: 68 e2 ldi r22, 0x28 ; 40 1795a: 75 eb ldi r23, 0xB5 ; 181 1795c: 89 e4 ldi r24, 0x49 ; 73 1795e: 9d e0 ldi r25, 0x0D ; 13 17960: 0f 94 18 95 call 0x32a30 ; 0x32a30 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[1], select_sheet_menu<1>); 17964: 63 e2 ldi r22, 0x23 ; 35 17966: 75 eb ldi r23, 0xB5 ; 181 17968: 84 e5 ldi r24, 0x54 ; 84 1796a: 9d e0 ldi r25, 0x0D ; 13 1796c: 0f 94 18 95 call 0x32a30 ; 0x32a30 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[2], select_sheet_menu<2>); 17970: 6e e1 ldi r22, 0x1E ; 30 17972: 75 eb ldi r23, 0xB5 ; 181 17974: 8f e5 ldi r24, 0x5F ; 95 17976: 9d e0 ldi r25, 0x0D ; 13 17978: 0f 94 18 95 call 0x32a30 ; 0x32a30 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[3], select_sheet_menu<3>); 1797c: 69 e1 ldi r22, 0x19 ; 25 1797e: 75 eb ldi r23, 0xB5 ; 181 17980: 8a e6 ldi r24, 0x6A ; 106 17982: 9d e0 ldi r25, 0x0D ; 13 17984: 0f 94 18 95 call 0x32a30 ; 0x32a30 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[4], select_sheet_menu<4>); 17988: 64 e1 ldi r22, 0x14 ; 20 1798a: 75 eb ldi r23, 0xB5 ; 181 1798c: 85 e7 ldi r24, 0x75 ; 117 1798e: 9d e0 ldi r25, 0x0D ; 13 17990: 0f 94 18 95 call 0x32a30 ; 0x32a30 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[5], select_sheet_menu<5>); 17994: 6f e0 ldi r22, 0x0F ; 15 17996: 75 eb ldi r23, 0xB5 ; 181 17998: 80 e8 ldi r24, 0x80 ; 128 1799a: 9d e0 ldi r25, 0x0D ; 13 1799c: 0f 94 18 95 call 0x32a30 ; 0x32a30 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[6], select_sheet_menu<6>); 179a0: 6a e0 ldi r22, 0x0A ; 10 179a2: 75 eb ldi r23, 0xB5 ; 181 179a4: 8b e8 ldi r24, 0x8B ; 139 179a6: 9d e0 ldi r25, 0x0D ; 13 179a8: 0f 94 18 95 call 0x32a30 ; 0x32a30 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[7], select_sheet_menu<7>); 179ac: 65 e0 ldi r22, 0x05 ; 5 179ae: 75 eb ldi r23, 0xB5 ; 181 179b0: 86 e9 ldi r24, 0x96 ; 150 179b2: 9d e0 ldi r25, 0x0D ; 13 179b4: 0f 94 18 95 call 0x32a30 ; 0x32a30 MENU_END(); 179b8: 0f 94 90 92 call 0x32520 ; 0x32520 lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 179bc: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 179c0: 8f 5f subi r24, 0xFF ; 255 179c2: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 179c6: 80 91 30 04 lds r24, 0x0430 ; 0x800430 179ca: 8f 5f subi r24, 0xFF ; 255 179cc: 80 93 30 04 sts 0x0430, r24 ; 0x800430 179d0: b6 cf rjmp .-148 ; 0x1793e MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[4], select_sheet_menu<4>); MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[5], select_sheet_menu<5>); MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[6], select_sheet_menu<6>); MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[7], select_sheet_menu<7>); MENU_END(); } 179d2: 08 95 ret 000179d4 : //! //! @param header Header text //! @param item Item text //! @param last_item Last item text, or nullptr if there is no Last item //! @return selected item index, first item index is 0 uint8_t choose_menu_P(const char *header, const char *item, const char *last_item) 179d4: 4f 92 push r4 179d6: 5f 92 push r5 179d8: 6f 92 push r6 179da: 7f 92 push r7 179dc: 8f 92 push r8 179de: 9f 92 push r9 179e0: af 92 push r10 179e2: bf 92 push r11 179e4: cf 92 push r12 179e6: df 92 push r13 179e8: ef 92 push r14 179ea: ff 92 push r15 179ec: 0f 93 push r16 179ee: 1f 93 push r17 179f0: cf 93 push r28 179f2: df 93 push r29 179f4: 6c 01 movw r12, r24 179f6: 7b 01 movw r14, r22 179f8: 80 91 94 12 lds r24, 0x1294 ; 0x801294 { //following code should handle 3 to 127 number of items well const int8_t items_no = last_item?(MMU2::mmu2.Enabled()?6:5):(MMU2::mmu2.Enabled()?5:4); 179fc: 67 2b or r22, r23 179fe: 29 f0 breq .+10 ; 0x17a0a 17a00: 06 e0 ldi r16, 0x06 ; 6 17a02: 81 30 cpi r24, 0x01 ; 1 17a04: 29 f0 breq .+10 ; 0x17a10 17a06: 05 e0 ldi r16, 0x05 ; 5 17a08: 03 c0 rjmp .+6 ; 0x17a10 17a0a: 04 e0 ldi r16, 0x04 ; 4 17a0c: 81 30 cpi r24, 0x01 ; 1 17a0e: d9 f3 breq .-10 ; 0x17a06 const uint8_t item_len = item?strlen_P(item):0; int8_t first = 0; int8_t cursor_pos = 1; lcd_clear(); 17a10: 0e 94 ae 69 call 0xd35c ; 0xd35c KEEPALIVE_STATE(PAUSED_FOR_USER); 17a14: 84 e0 ldi r24, 0x04 ; 4 17a16: 80 93 78 02 sts 0x0278, r24 ; 0x800278 { //following code should handle 3 to 127 number of items well const int8_t items_no = last_item?(MMU2::mmu2.Enabled()?6:5):(MMU2::mmu2.Enabled()?5:4); const uint8_t item_len = item?strlen_P(item):0; int8_t first = 0; int8_t cursor_pos = 1; 17a1a: c1 e0 ldi r28, 0x01 ; 1 uint8_t choose_menu_P(const char *header, const char *item, const char *last_item) { //following code should handle 3 to 127 number of items well const int8_t items_no = last_item?(MMU2::mmu2.Enabled()?6:5):(MMU2::mmu2.Enabled()?5:4); const uint8_t item_len = item?strlen_P(item):0; int8_t first = 0; 17a1c: 81 2c mov r8, r1 } if (cursor_pos > 3) { cursor_pos = 3; if (first < items_no - 3) 17a1e: 03 50 subi r16, 0x03 ; 3 17a20: 11 0b sbc r17, r17 lcd_clear(); KEEPALIVE_STATE(PAUSED_FOR_USER); while (1) { manage_heater(); 17a22: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(true); 17a26: 81 e0 ldi r24, 0x01 ; 1 17a28: 0e 94 01 7a call 0xf402 ; 0xf402 if (lcd_encoder) 17a2c: 80 91 06 05 lds r24, 0x0506 ; 0x800506 17a30: 90 91 07 05 lds r25, 0x0507 ; 0x800507 17a34: 00 97 sbiw r24, 0x00 ; 0 17a36: 09 f4 brne .+2 ; 0x17a3a 17a38: 9d c0 rjmp .+314 ; 0x17b74 { if (lcd_encoder < 0) 17a3a: 97 ff sbrs r25, 7 17a3c: 88 c0 rjmp .+272 ; 0x17b4e { cursor_pos--; 17a3e: c1 50 subi r28, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } lcd_encoder = 0; 17a40: 10 92 07 05 sts 0x0507, r1 ; 0x800507 17a44: 10 92 06 05 sts 0x0506, r1 ; 0x800506 } if (cursor_pos > 3) 17a48: c4 30 cpi r28, 0x04 ; 4 17a4a: 0c f4 brge .+2 ; 0x17a4e 17a4c: 86 c0 rjmp .+268 ; 0x17b5a { cursor_pos = 3; if (first < items_no - 3) 17a4e: 88 2d mov r24, r8 17a50: 08 2c mov r0, r8 17a52: 00 0c add r0, r0 17a54: 99 0b sbc r25, r25 17a56: 80 17 cp r24, r16 17a58: 91 07 cpc r25, r17 17a5a: 0c f0 brlt .+2 ; 0x17a5e 17a5c: 7a c0 rjmp .+244 ; 0x17b52 { first++; 17a5e: 83 94 inc r8 lcd_clear(); 17a60: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_encoder = 0; } if (cursor_pos > 3) { cursor_pos = 3; 17a64: c3 e0 ldi r28, 0x03 ; 3 } else { // here we are at the very end of the list Sound_MakeSound(e_SOUND_TYPE_BlindAlert); } } if (header) lcd_puts_at_P(0,0,header); 17a66: c1 14 cp r12, r1 17a68: d1 04 cpc r13, r1 17a6a: 29 f0 breq .+10 ; 0x17a76 17a6c: a6 01 movw r20, r12 17a6e: 60 e0 ldi r22, 0x00 ; 0 17a70: 80 e0 ldi r24, 0x00 ; 0 17a72: 0e 94 8f 69 call 0xd31e ; 0xd31e const bool last_visible = (first == items_no - 3); 17a76: a8 2c mov r10, r8 17a78: 08 2c mov r0, r8 17a7a: 00 0c add r0, r0 17a7c: bb 08 sbc r11, r11 const uint_least8_t ordinary_items = (last_item&&last_visible)?2:3; 17a7e: e1 14 cp r14, r1 17a80: f1 04 cpc r15, r1 17a82: 29 f0 breq .+10 ; 0x17a8e 17a84: 82 e0 ldi r24, 0x02 ; 2 17a86: 98 2e mov r9, r24 17a88: a0 16 cp r10, r16 17a8a: b1 06 cpc r11, r17 17a8c: 11 f0 breq .+4 ; 0x17a92 17a8e: 93 e0 ldi r25, 0x03 ; 3 17a90: 99 2e mov r9, r25 for (uint_least8_t i = 0; i < ordinary_items; i++) 17a92: d0 e0 ldi r29, 0x00 ; 0 { if (item) lcd_puts_at_P(1, i + 1, item); 17a94: df 5f subi r29, 0xFF ; 255 17a96: 44 e3 ldi r20, 0x34 ; 52 17a98: 59 e6 ldi r21, 0x69 ; 105 17a9a: 6d 2f mov r22, r29 17a9c: 81 e0 ldi r24, 0x01 ; 1 17a9e: 0e 94 8f 69 call 0xd31e ; 0xd31e if (header) lcd_puts_at_P(0,0,header); const bool last_visible = (first == items_no - 3); const uint_least8_t ordinary_items = (last_item&&last_visible)?2:3; for (uint_least8_t i = 0; i < ordinary_items; i++) 17aa2: 9d 12 cpse r9, r29 17aa4: f7 cf rjmp .-18 ; 0x17a94 17aa6: 48 2c mov r4, r8 17aa8: 08 2c mov r0, r8 17aaa: 00 0c add r0, r0 17aac: 55 08 sbc r5, r5 17aae: 66 08 sbc r6, r6 17ab0: 77 08 sbc r7, r7 17ab2: 8f ef ldi r24, 0xFF ; 255 17ab4: 48 1a sub r4, r24 17ab6: 58 0a sbc r5, r24 17ab8: 68 0a sbc r6, r24 17aba: 78 0a sbc r7, r24 { if (item) lcd_puts_at_P(1, i + 1, item); } for (uint_least8_t i = 0; i < ordinary_items; i++) 17abc: 91 2c mov r9, r1 { lcd_set_cursor(2 + item_len, i+1); 17abe: 93 94 inc r9 17ac0: 69 2d mov r22, r9 17ac2: 8a e0 ldi r24, 0x0A ; 10 17ac4: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 17ac8: c3 01 movw r24, r6 17aca: b2 01 movw r22, r4 17acc: 0e 94 34 6b call 0xd668 ; 0xd668 17ad0: 8f ef ldi r24, 0xFF ; 255 17ad2: 48 1a sub r4, r24 17ad4: 58 0a sbc r5, r24 17ad6: 68 0a sbc r6, r24 17ad8: 78 0a sbc r7, r24 for (uint_least8_t i = 0; i < ordinary_items; i++) { if (item) lcd_puts_at_P(1, i + 1, item); } for (uint_least8_t i = 0; i < ordinary_items; i++) 17ada: d9 11 cpse r29, r9 17adc: f0 cf rjmp .-32 ; 0x17abe { lcd_set_cursor(2 + item_len, i+1); lcd_print(first + i + 1); } if (last_item&&last_visible) lcd_puts_at_P(1, 3, last_item); 17ade: e1 14 cp r14, r1 17ae0: f1 04 cpc r15, r1 17ae2: 41 f0 breq .+16 ; 0x17af4 17ae4: a0 16 cp r10, r16 17ae6: b1 06 cpc r11, r17 17ae8: 29 f4 brne .+10 ; 0x17af4 17aea: a7 01 movw r20, r14 17aec: 63 e0 ldi r22, 0x03 ; 3 17aee: 81 e0 ldi r24, 0x01 ; 1 17af0: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_puts_at_P(0, 1, PSTR(" \n \n ")); 17af4: 44 eb ldi r20, 0xB4 ; 180 17af6: 56 e8 ldi r21, 0x86 ; 134 17af8: 61 e0 ldi r22, 0x01 ; 1 17afa: 80 e0 ldi r24, 0x00 ; 0 17afc: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_putc_at(0, cursor_pos, '>'); 17b00: 4e e3 ldi r20, 0x3E ; 62 17b02: 6c 2f mov r22, r28 17b04: 80 e0 ldi r24, 0x00 ; 0 17b06: 0e 94 9b 69 call 0xd336 ; 0xd336 _delay(100); 17b0a: 64 e6 ldi r22, 0x64 ; 100 17b0c: 70 e0 ldi r23, 0x00 ; 0 17b0e: 80 e0 ldi r24, 0x00 ; 0 17b10: 90 e0 ldi r25, 0x00 ; 0 17b12: 0f 94 7b 0d call 0x21af6 ; 0x21af6 if (lcd_clicked()) 17b16: 0e 94 98 6b call 0xd730 ; 0xd730 17b1a: 88 23 and r24, r24 17b1c: 09 f4 brne .+2 ; 0x17b20 17b1e: 81 cf rjmp .-254 ; 0x17a22 { KEEPALIVE_STATE(IN_HANDLER); 17b20: 82 e0 ldi r24, 0x02 ; 2 17b22: 80 93 78 02 sts 0x0278, r24 ; 0x800278 return(cursor_pos + first - 1); 17b26: 8f ef ldi r24, 0xFF ; 255 17b28: 8c 0f add r24, r28 17b2a: 88 0d add r24, r8 } } } 17b2c: df 91 pop r29 17b2e: cf 91 pop r28 17b30: 1f 91 pop r17 17b32: 0f 91 pop r16 17b34: ff 90 pop r15 17b36: ef 90 pop r14 17b38: df 90 pop r13 17b3a: cf 90 pop r12 17b3c: bf 90 pop r11 17b3e: af 90 pop r10 17b40: 9f 90 pop r9 17b42: 8f 90 pop r8 17b44: 7f 90 pop r7 17b46: 6f 90 pop r6 17b48: 5f 90 pop r5 17b4a: 4f 90 pop r4 17b4c: 08 95 ret cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 17b4e: cf 5f subi r28, 0xFF ; 255 17b50: 77 cf rjmp .-274 ; 0x17a40 if (first < items_no - 3) { first++; lcd_clear(); } else { // here we are at the very end of the list Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 17b52: 87 e0 ldi r24, 0x07 ; 7 17b54: 0f 94 9f 2c call 0x2593e ; 0x2593e 17b58: 85 cf rjmp .-246 ; 0x17a64 } } if (cursor_pos < 1) 17b5a: c1 11 cpse r28, r1 17b5c: 84 cf rjmp .-248 ; 0x17a66 { cursor_pos = 1; if (first > 0) 17b5e: 18 14 cp r1, r8 17b60: 2c f4 brge .+10 ; 0x17b6c { first--; 17b62: 8a 94 dec r8 lcd_clear(); 17b64: 0e 94 ae 69 call 0xd35c ; 0xd35c } } if (cursor_pos < 1) { cursor_pos = 1; 17b68: c1 e0 ldi r28, 0x01 ; 1 17b6a: 7d cf rjmp .-262 ; 0x17a66 if (first > 0) { first--; lcd_clear(); } else { // here we are at the very end of the list Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 17b6c: 87 e0 ldi r24, 0x07 ; 7 17b6e: 0f 94 9f 2c call 0x2593e ; 0x2593e 17b72: fa cf rjmp .-12 ; 0x17b68 cursor_pos++; } lcd_encoder = 0; } if (cursor_pos > 3) 17b74: c4 30 cpi r28, 0x04 ; 4 17b76: 0c f0 brlt .+2 ; 0x17b7a 17b78: 6a cf rjmp .-300 ; 0x17a4e 17b7a: 75 cf rjmp .-278 ; 0x17a66 00017b7c : } #define PGM_RD_W(x) (short)pgm_read_word(&x) // Derived from RepRap FiveD extruder::getTemperature() // For hot end temperature measurement. static float analog2temp(int raw, uint8_t e) { 17b7c: 4f 92 push r4 17b7e: 5f 92 push r5 17b80: 6f 92 push r6 17b82: 7f 92 push r7 17b84: af 92 push r10 17b86: bf 92 push r11 17b88: cf 92 push r12 17b8a: df 92 push r13 17b8c: ef 92 push r14 17b8e: ff 92 push r15 17b90: 0f 93 push r16 17b92: 1f 93 push r17 17b94: cf 93 push r28 17b96: df 93 push r29 17b98: 24 e0 ldi r18, 0x04 ; 4 17b9a: 30 e0 ldi r19, 0x00 ; 0 17b9c: 41 e0 ldi r20, 0x01 ; 1 17b9e: 50 e0 ldi r21, 0x00 ; 0 17ba0: d9 01 movw r26, r18 17ba2: a9 50 subi r26, 0x09 ; 9 17ba4: be 47 sbci r27, 0x7E ; 126 uint8_t i; short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]); for (i=1; i raw) 17ba6: fd 01 movw r30, r26 17ba8: 65 91 lpm r22, Z+ 17baa: 74 91 lpm r23, Z 17bac: 86 17 cp r24, r22 17bae: 97 07 cpc r25, r23 17bb0: 0c f0 brlt .+2 ; 0x17bb4 17bb2: 66 c0 rjmp .+204 ; 0x17c80 { celsius = PGM_RD_W((*tt)[i-1][1]) + 17bb4: 41 50 subi r20, 0x01 ; 1 17bb6: 51 09 sbc r21, r1 17bb8: 44 0f add r20, r20 17bba: 55 1f adc r21, r21 17bbc: 44 0f add r20, r20 17bbe: 55 1f adc r21, r21 17bc0: ea 01 movw r28, r20 17bc2: c7 50 subi r28, 0x07 ; 7 17bc4: de 47 sbci r29, 0x7E ; 126 17bc6: fe 01 movw r30, r28 17bc8: 05 91 lpm r16, Z+ 17bca: 14 91 lpm r17, Z (raw - PGM_RD_W((*tt)[i-1][0])) * 17bcc: 49 50 subi r20, 0x09 ; 9 17bce: 5e 47 sbci r21, 0x7E ; 126 17bd0: fa 01 movw r30, r20 17bd2: 65 91 lpm r22, Z+ 17bd4: 74 91 lpm r23, Z (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 17bd6: f9 01 movw r30, r18 17bd8: e7 50 subi r30, 0x07 ; 7 17bda: fe 47 sbci r31, 0x7E ; 126 17bdc: e5 90 lpm r14, Z+ 17bde: f4 90 lpm r15, Z 17be0: fe 01 movw r30, r28 17be2: c5 90 lpm r12, Z+ 17be4: d4 90 lpm r13, Z (float)(PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i-1][0])); 17be6: fd 01 movw r30, r26 17be8: c5 91 lpm r28, Z+ 17bea: d4 91 lpm r29, Z 17bec: fa 01 movw r30, r20 17bee: a5 90 lpm r10, Z+ 17bf0: b4 90 lpm r11, Z for (i=1; i raw) { celsius = PGM_RD_W((*tt)[i-1][1]) + (raw - PGM_RD_W((*tt)[i-1][0])) * 17bf2: 86 1b sub r24, r22 17bf4: 97 0b sbc r25, r23 17bf6: bc 01 movw r22, r24 17bf8: 99 0f add r25, r25 17bfa: 88 0b sbc r24, r24 17bfc: 99 0b sbc r25, r25 17bfe: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 17c02: 2b 01 movw r4, r22 17c04: 3c 01 movw r6, r24 (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 17c06: b7 01 movw r22, r14 17c08: 6c 19 sub r22, r12 17c0a: 7d 09 sbc r23, r13 17c0c: 07 2e mov r0, r23 17c0e: 00 0c add r0, r0 17c10: 88 0b sbc r24, r24 17c12: 99 0b sbc r25, r25 17c14: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 17c18: 9b 01 movw r18, r22 17c1a: ac 01 movw r20, r24 for (i=1; i raw) { celsius = PGM_RD_W((*tt)[i-1][1]) + (raw - PGM_RD_W((*tt)[i-1][0])) * 17c1c: c3 01 movw r24, r6 17c1e: b2 01 movw r22, r4 17c20: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 17c24: 6b 01 movw r12, r22 17c26: 7c 01 movw r14, r24 (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / (float)(PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i-1][0])); 17c28: be 01 movw r22, r28 17c2a: 6a 19 sub r22, r10 17c2c: 7b 09 sbc r23, r11 17c2e: 07 2e mov r0, r23 17c30: 00 0c add r0, r0 17c32: 88 0b sbc r24, r24 17c34: 99 0b sbc r25, r25 17c36: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 17c3a: 9b 01 movw r18, r22 17c3c: ac 01 movw r20, r24 { if (PGM_RD_W((*tt)[i][0]) > raw) { celsius = PGM_RD_W((*tt)[i-1][1]) + (raw - PGM_RD_W((*tt)[i-1][0])) * (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 17c3e: c7 01 movw r24, r14 17c40: b6 01 movw r22, r12 17c42: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 17c46: 6b 01 movw r12, r22 17c48: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W((*tt)[i-1][1]) + 17c4a: b8 01 movw r22, r16 17c4c: 11 0f add r17, r17 17c4e: 88 0b sbc r24, r24 17c50: 99 0b sbc r25, r25 17c52: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 17c56: 9b 01 movw r18, r22 17c58: ac 01 movw r20, r24 17c5a: c7 01 movw r24, r14 17c5c: b6 01 movw r22, r12 17c5e: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> if (i == heater_ttbllen_map[e]) celsius = PGM_RD_W((*tt)[i-1][1]); return celsius; } return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET; } 17c62: df 91 pop r29 17c64: cf 91 pop r28 17c66: 1f 91 pop r17 17c68: 0f 91 pop r16 17c6a: ff 90 pop r15 17c6c: ef 90 pop r14 17c6e: df 90 pop r13 17c70: cf 90 pop r12 17c72: bf 90 pop r11 17c74: af 90 pop r10 17c76: 7f 90 pop r7 17c78: 6f 90 pop r6 17c7a: 5f 90 pop r5 17c7c: 4f 90 pop r4 17c7e: 08 95 ret 17c80: 4f 5f subi r20, 0xFF ; 255 17c82: 5f 4f sbci r21, 0xFF ; 255 17c84: 2c 5f subi r18, 0xFC ; 252 17c86: 3f 4f sbci r19, 0xFF ; 255 { float celsius = 0; uint8_t i; short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]); for (i=1; i 17c8e: 88 cf rjmp .-240 ; 0x17ba0 break; } } // Overflow: Set to last value in the table if (i == heater_ttbllen_map[e]) celsius = PGM_RD_W((*tt)[i-1][1]); 17c90: e5 e7 ldi r30, 0x75 ; 117 17c92: f2 e8 ldi r31, 0x82 ; 130 17c94: 65 91 lpm r22, Z+ 17c96: 74 91 lpm r23, Z 17c98: 07 2e mov r0, r23 17c9a: 00 0c add r0, r0 17c9c: 88 0b sbc r24, r24 17c9e: 99 0b sbc r25, r25 17ca0: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 17ca4: de cf rjmp .-68 ; 0x17c62 00017ca6 : { previous_millis_cmd.start(); } #ifdef FWRETRACT void retract(bool retracting, bool swapretract = false) { 17ca6: 8f 92 push r8 17ca8: 9f 92 push r9 17caa: af 92 push r10 17cac: bf 92 push r11 17cae: cf 92 push r12 17cb0: df 92 push r13 17cb2: ef 92 push r14 17cb4: ff 92 push r15 17cb6: 90 91 03 05 lds r25, 0x0503 ; 0x800503 // Perform FW retraction, just if needed, but behave as if the move has never took place in // order to keep E/Z coordinates unchanged. This is done by manipulating the internal planner // position, which requires a sync if(retracting && !retracted[active_extruder]) { 17cba: 88 23 and r24, r24 17cbc: 09 f4 brne .+2 ; 0x17cc0 17cbe: 9d c0 rjmp .+314 ; 0x17dfa 17cc0: 91 11 cpse r25, r1 17cc2: 92 c0 rjmp .+292 ; 0x17de8 st_synchronize(); 17cc4: 0f 94 42 22 call 0x24484 ; 0x24484 set_destination_to_current(); 17cc8: 0e 94 36 61 call 0xc26c ; 0xc26c current_position[E_AXIS]+=(swapretract?retract_length_swap:cs.retract_length)*float(extrudemultiply)*0.01f; 17ccc: 60 91 59 02 lds r22, 0x0259 ; 0x800259 17cd0: 70 91 5a 02 lds r23, 0x025A ; 0x80025a 17cd4: 07 2e mov r0, r23 17cd6: 00 0c add r0, r0 17cd8: 88 0b sbc r24, r24 17cda: 99 0b sbc r25, r25 17cdc: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 17ce0: 20 91 b5 04 lds r18, 0x04B5 ; 0x8004b5 17ce4: 30 91 b6 04 lds r19, 0x04B6 ; 0x8004b6 17ce8: 40 91 b7 04 lds r20, 0x04B7 ; 0x8004b7 17cec: 50 91 b8 04 lds r21, 0x04B8 ; 0x8004b8 17cf0: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 17cf4: 2a e0 ldi r18, 0x0A ; 10 17cf6: 37 ed ldi r19, 0xD7 ; 215 17cf8: 43 e2 ldi r20, 0x23 ; 35 17cfa: 5c e3 ldi r21, 0x3C ; 60 17cfc: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 17d00: 20 91 01 12 lds r18, 0x1201 ; 0x801201 17d04: 30 91 02 12 lds r19, 0x1202 ; 0x801202 17d08: 40 91 03 12 lds r20, 0x1203 ; 0x801203 17d0c: 50 91 04 12 lds r21, 0x1204 ; 0x801204 17d10: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 17d14: 60 93 01 12 sts 0x1201, r22 ; 0x801201 17d18: 70 93 02 12 sts 0x1202, r23 ; 0x801202 17d1c: 80 93 03 12 sts 0x1203, r24 ; 0x801203 17d20: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_set_e_position(current_position[E_AXIS]); 17d24: 81 e0 ldi r24, 0x01 ; 1 17d26: 92 e1 ldi r25, 0x12 ; 18 17d28: 0f 94 c8 74 call 0x2e990 ; 0x2e990 float oldFeedrate = feedrate; 17d2c: c0 90 7a 02 lds r12, 0x027A ; 0x80027a 17d30: d0 90 7b 02 lds r13, 0x027B ; 0x80027b 17d34: e0 90 7c 02 lds r14, 0x027C ; 0x80027c 17d38: f0 90 7d 02 lds r15, 0x027D ; 0x80027d feedrate=cs.retract_feedrate*60; 17d3c: 20 e0 ldi r18, 0x00 ; 0 17d3e: 30 e0 ldi r19, 0x00 ; 0 17d40: 40 e7 ldi r20, 0x70 ; 112 17d42: 52 e4 ldi r21, 0x42 ; 66 17d44: 60 91 b9 04 lds r22, 0x04B9 ; 0x8004b9 17d48: 70 91 ba 04 lds r23, 0x04BA ; 0x8004ba 17d4c: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 17d50: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 17d54: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 17d58: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a 17d5c: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b 17d60: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 17d64: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d retracted[active_extruder]=true; 17d68: 81 e0 ldi r24, 0x01 ; 1 17d6a: 80 93 03 05 sts 0x0503, r24 ; 0x800503 prepare_move(); 17d6e: 90 e0 ldi r25, 0x00 ; 0 17d70: 80 e0 ldi r24, 0x00 ; 0 17d72: 0e 94 04 65 call 0xca08 ; 0xca08 if(cs.retract_zlift) { 17d76: 20 e0 ldi r18, 0x00 ; 0 17d78: 30 e0 ldi r19, 0x00 ; 0 17d7a: a9 01 movw r20, r18 17d7c: 60 91 bd 04 lds r22, 0x04BD ; 0x8004bd 17d80: 70 91 be 04 lds r23, 0x04BE ; 0x8004be 17d84: 80 91 bf 04 lds r24, 0x04BF ; 0x8004bf 17d88: 90 91 c0 04 lds r25, 0x04C0 ; 0x8004c0 17d8c: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 17d90: 88 23 and r24, r24 17d92: 11 f1 breq .+68 ; 0x17dd8 st_synchronize(); 17d94: 0f 94 42 22 call 0x24484 ; 0x24484 current_position[Z_AXIS]-=cs.retract_zlift; 17d98: 20 91 bd 04 lds r18, 0x04BD ; 0x8004bd 17d9c: 30 91 be 04 lds r19, 0x04BE ; 0x8004be 17da0: 40 91 bf 04 lds r20, 0x04BF ; 0x8004bf 17da4: 50 91 c0 04 lds r21, 0x04C0 ; 0x8004c0 17da8: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 17dac: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 17db0: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 17db4: 90 91 00 12 lds r25, 0x1200 ; 0x801200 17db8: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 17dbc: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 17dc0: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 17dc4: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 17dc8: 90 93 00 12 sts 0x1200, r25 ; 0x801200 plan_set_position_curposXYZE(); 17dcc: 0f 94 30 83 call 0x30660 ; 0x30660 prepare_move(); 17dd0: 90 e0 ldi r25, 0x00 ; 0 17dd2: 80 e0 ldi r24, 0x00 ; 0 17dd4: 0e 94 04 65 call 0xca08 ; 0xca08 } feedrate = oldFeedrate; 17dd8: c0 92 7a 02 sts 0x027A, r12 ; 0x80027a 17ddc: d0 92 7b 02 sts 0x027B, r13 ; 0x80027b 17de0: e0 92 7c 02 sts 0x027C, r14 ; 0x80027c 17de4: f0 92 7d 02 sts 0x027D, r15 ; 0x80027d plan_set_e_position(current_position[E_AXIS]); retracted[active_extruder]=false; prepare_move(); feedrate = oldFeedrate; } } //retract 17de8: ff 90 pop r15 17dea: ef 90 pop r14 17dec: df 90 pop r13 17dee: cf 90 pop r12 17df0: bf 90 pop r11 17df2: af 90 pop r10 17df4: 9f 90 pop r9 17df6: 8f 90 pop r8 17df8: 08 95 ret current_position[Z_AXIS]-=cs.retract_zlift; plan_set_position_curposXYZE(); prepare_move(); } feedrate = oldFeedrate; } else if(!retracting && retracted[active_extruder]) { 17dfa: 99 23 and r25, r25 17dfc: a9 f3 breq .-22 ; 0x17de8 st_synchronize(); 17dfe: 0f 94 42 22 call 0x24484 ; 0x24484 set_destination_to_current(); 17e02: 0e 94 36 61 call 0xc26c ; 0xc26c float oldFeedrate = feedrate; 17e06: 80 90 7a 02 lds r8, 0x027A ; 0x80027a 17e0a: 90 90 7b 02 lds r9, 0x027B ; 0x80027b 17e0e: a0 90 7c 02 lds r10, 0x027C ; 0x80027c 17e12: b0 90 7d 02 lds r11, 0x027D ; 0x80027d feedrate=cs.retract_recover_feedrate*60; 17e16: 20 e0 ldi r18, 0x00 ; 0 17e18: 30 e0 ldi r19, 0x00 ; 0 17e1a: 40 e7 ldi r20, 0x70 ; 112 17e1c: 52 e4 ldi r21, 0x42 ; 66 17e1e: 60 91 c5 04 lds r22, 0x04C5 ; 0x8004c5 17e22: 70 91 c6 04 lds r23, 0x04C6 ; 0x8004c6 17e26: 80 91 c7 04 lds r24, 0x04C7 ; 0x8004c7 17e2a: 90 91 c8 04 lds r25, 0x04C8 ; 0x8004c8 17e2e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 17e32: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a 17e36: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b 17e3a: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 17e3e: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d if(cs.retract_zlift) { 17e42: c0 90 bd 04 lds r12, 0x04BD ; 0x8004bd 17e46: d0 90 be 04 lds r13, 0x04BE ; 0x8004be 17e4a: e0 90 bf 04 lds r14, 0x04BF ; 0x8004bf 17e4e: f0 90 c0 04 lds r15, 0x04C0 ; 0x8004c0 17e52: 20 e0 ldi r18, 0x00 ; 0 17e54: 30 e0 ldi r19, 0x00 ; 0 17e56: a9 01 movw r20, r18 17e58: c7 01 movw r24, r14 17e5a: b6 01 movw r22, r12 17e5c: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 17e60: 88 23 and r24, r24 17e62: e1 f0 breq .+56 ; 0x17e9c current_position[Z_AXIS]+=cs.retract_zlift; 17e64: a7 01 movw r20, r14 17e66: 96 01 movw r18, r12 17e68: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 17e6c: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 17e70: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 17e74: 90 91 00 12 lds r25, 0x1200 ; 0x801200 17e78: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 17e7c: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 17e80: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 17e84: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 17e88: 90 93 00 12 sts 0x1200, r25 ; 0x801200 plan_set_position_curposXYZE(); 17e8c: 0f 94 30 83 call 0x30660 ; 0x30660 prepare_move(); 17e90: 90 e0 ldi r25, 0x00 ; 0 17e92: 80 e0 ldi r24, 0x00 ; 0 17e94: 0e 94 04 65 call 0xca08 ; 0xca08 st_synchronize(); 17e98: 0f 94 42 22 call 0x24484 ; 0x24484 } current_position[E_AXIS]-=(swapretract?(retract_length_swap+retract_recover_length_swap):(cs.retract_length+cs.retract_recover_length))*float(extrudemultiply)*0.01f; 17e9c: 20 91 c1 04 lds r18, 0x04C1 ; 0x8004c1 17ea0: 30 91 c2 04 lds r19, 0x04C2 ; 0x8004c2 17ea4: 40 91 c3 04 lds r20, 0x04C3 ; 0x8004c3 17ea8: 50 91 c4 04 lds r21, 0x04C4 ; 0x8004c4 17eac: 60 91 b5 04 lds r22, 0x04B5 ; 0x8004b5 17eb0: 70 91 b6 04 lds r23, 0x04B6 ; 0x8004b6 17eb4: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 17eb8: 90 91 b8 04 lds r25, 0x04B8 ; 0x8004b8 17ebc: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 17ec0: 6b 01 movw r12, r22 17ec2: 7c 01 movw r14, r24 17ec4: 60 91 59 02 lds r22, 0x0259 ; 0x800259 17ec8: 70 91 5a 02 lds r23, 0x025A ; 0x80025a 17ecc: 07 2e mov r0, r23 17ece: 00 0c add r0, r0 17ed0: 88 0b sbc r24, r24 17ed2: 99 0b sbc r25, r25 17ed4: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 17ed8: 9b 01 movw r18, r22 17eda: ac 01 movw r20, r24 17edc: c7 01 movw r24, r14 17ede: b6 01 movw r22, r12 17ee0: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 17ee4: 2a e0 ldi r18, 0x0A ; 10 17ee6: 37 ed ldi r19, 0xD7 ; 215 17ee8: 43 e2 ldi r20, 0x23 ; 35 17eea: 5c e3 ldi r21, 0x3C ; 60 17eec: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 17ef0: 9b 01 movw r18, r22 17ef2: ac 01 movw r20, r24 17ef4: 60 91 01 12 lds r22, 0x1201 ; 0x801201 17ef8: 70 91 02 12 lds r23, 0x1202 ; 0x801202 17efc: 80 91 03 12 lds r24, 0x1203 ; 0x801203 17f00: 90 91 04 12 lds r25, 0x1204 ; 0x801204 17f04: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 17f08: 60 93 01 12 sts 0x1201, r22 ; 0x801201 17f0c: 70 93 02 12 sts 0x1202, r23 ; 0x801202 17f10: 80 93 03 12 sts 0x1203, r24 ; 0x801203 17f14: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_set_e_position(current_position[E_AXIS]); 17f18: 81 e0 ldi r24, 0x01 ; 1 17f1a: 92 e1 ldi r25, 0x12 ; 18 17f1c: 0f 94 c8 74 call 0x2e990 ; 0x2e990 retracted[active_extruder]=false; 17f20: 10 92 03 05 sts 0x0503, r1 ; 0x800503 prepare_move(); 17f24: 90 e0 ldi r25, 0x00 ; 0 17f26: 80 e0 ldi r24, 0x00 ; 0 17f28: 0e 94 04 65 call 0xca08 ; 0xca08 feedrate = oldFeedrate; 17f2c: 80 92 7a 02 sts 0x027A, r8 ; 0x80027a 17f30: 90 92 7b 02 sts 0x027B, r9 ; 0x80027b 17f34: a0 92 7c 02 sts 0x027C, r10 ; 0x80027c 17f38: b0 92 7d 02 sts 0x027D, r11 ; 0x80027d 17f3c: 55 cf rjmp .-342 ; 0x17de8 00017f3e : // Update cached value lastReadRegisterValue = logic.rsp.paramValue; return true; } bool __attribute__((noinline)) MMU2::WriteRegister(uint8_t address, uint16_t data) { 17f3e: ef 92 push r14 17f40: ff 92 push r15 17f42: 0f 93 push r16 17f44: 1f 93 push r17 17f46: cf 93 push r28 17f48: df 93 push r29 17f4a: 00 d0 rcall .+0 ; 0x17f4c 17f4c: 1f 92 push r1 17f4e: 1f 92 push r1 17f50: cd b7 in r28, 0x3d ; 61 17f52: de b7 in r29, 0x3e ; 62 17f54: 08 2f mov r16, r24 17f56: 16 2f mov r17, r22 17f58: f7 2e mov r15, r23 if (!WaitForMMUReady()) { 17f5a: 0f 94 b4 53 call 0x2a768 ; 0x2a768 17f5e: 88 23 and r24, r24 17f60: d9 f0 breq .+54 ; 0x17f98 return false; } // special cases - intercept requests of registers which influence the printer's behaviour too + perform the change even on the printer's side switch (address) { 17f62: 0b 30 cpi r16, 0x0B ; 11 17f64: 29 f1 breq .+74 ; 0x17fb0 17f66: 04 31 cpi r16, 0x14 ; 20 17f68: 31 f1 breq .+76 ; 0x17fb6 /// @param value to write into the register inline constexpr RequestMsg(RequestMsgCodes code, uint8_t address, uint16_t value) : code(code) , value(address) , value2(value) , crc8(ComputeCRC8()) { 17f6a: 87 e5 ldi r24, 0x57 ; 87 17f6c: e8 2e mov r14, r24 17f6e: e9 82 std Y+1, r14 ; 0x01 17f70: 0a 83 std Y+2, r16 ; 0x02 17f72: 1b 83 std Y+3, r17 ; 0x03 17f74: fc 82 std Y+4, r15 ; 0x04 17f76: ce 01 movw r24, r28 17f78: 01 96 adiw r24, 0x01 ; 1 17f7a: 0f 94 cf 86 call 0x30d9e ; 0x30d9e 17f7e: 8d 83 std Y+5, r24 ; 0x05 void ProtocolLogic::ReadRegister(uint8_t address) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Read, address)); } void ProtocolLogic::WriteRegister(uint8_t address, uint16_t data) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Write, address, data)); 17f80: 47 e5 ldi r20, 0x57 ; 87 17f82: 50 2f mov r21, r16 17f84: 61 2f mov r22, r17 17f86: 7f 2d mov r23, r15 17f88: 0f 94 33 62 call 0x2c466 ; 0x2c466 break; // do not intercept any other register writes } do { logic.WriteRegister(address, data); // we may signal the accepted/rejected status of the response as return value of this function } while (!manage_response(false, false)); 17f8c: 60 e0 ldi r22, 0x00 ; 0 17f8e: 80 e0 ldi r24, 0x00 ; 0 17f90: 0f 94 c8 69 call 0x2d390 ; 0x2d390 17f94: 88 23 and r24, r24 17f96: 59 f3 breq .-42 ; 0x17f6e return true; } 17f98: 0f 90 pop r0 17f9a: 0f 90 pop r0 17f9c: 0f 90 pop r0 17f9e: 0f 90 pop r0 17fa0: 0f 90 pop r0 17fa2: df 91 pop r29 17fa4: cf 91 pop r28 17fa6: 1f 91 pop r17 17fa8: 0f 91 pop r16 17faa: ff 90 pop r15 17fac: ef 90 pop r14 17fae: 08 95 ret } // special cases - intercept requests of registers which influence the printer's behaviour too + perform the change even on the printer's side switch (address) { case (uint8_t)Register::Extra_Load_Distance: logic.PlanExtraLoadDistance(data); 17fb0: 10 93 71 12 sts 0x1271, r17 ; 0x801271 17fb4: da cf rjmp .-76 ; 0x17f6a break; case (uint8_t)Register::Pulley_Slow_Feedrate: logic.PlanPulleySlowFeedRate(data); 17fb6: 10 93 72 12 sts 0x1272, r17 ; 0x801272 17fba: d7 cf rjmp .-82 ; 0x17f6a 00017fbc : #elif F_CPU >= 16000000L // for the 16 MHz clock on most Arduino boards // for a one-microsecond delay, simply return. the overhead // of the function call takes 14 (16) cycles, which is 1us if (us <= 1) return; // = 3 cycles, (4 when true) 17fbc: 82 30 cpi r24, 0x02 ; 2 17fbe: 91 05 cpc r25, r1 17fc0: 38 f0 brcs .+14 ; 0x17fd0 // the following loop takes 1/4 of a microsecond (4 cycles) // per iteration, so execute it four times for each microsecond of // delay requested. us <<= 2; // x4 us, = 4 cycles 17fc2: 88 0f add r24, r24 17fc4: 99 1f adc r25, r25 17fc6: 88 0f add r24, r24 17fc8: 99 1f adc r25, r25 // account for the time taken in the preceeding commands. // we just burned 19 (21) cycles above, remove 5, (5*4=20) // us is at least 8 so we can substract 5 us -= 5; // = 2 cycles, 17fca: 05 97 sbiw r24, 0x05 ; 5 #endif // busy wait __asm__ __volatile__ ( 17fcc: 01 97 sbiw r24, 0x01 ; 1 17fce: f1 f7 brne .-4 ; 0x17fcc "1: sbiw %0,1" "\n\t" // 2 cycles "brne 1b" : "=w" (us) : "0" (us) // 2 cycles ); // return = 4 cycles } 17fd0: 08 95 ret 00017fd2 : SREG = oldSREG; } int digitalRead(uint8_t pin) { 17fd2: cf 93 push r28 17fd4: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 17fd6: 28 2f mov r18, r24 17fd8: 30 e0 ldi r19, 0x00 ; 0 17fda: f9 01 movw r30, r18 17fdc: ec 5b subi r30, 0xBC ; 188 17fde: fa 47 sbci r31, 0x7A ; 122 17fe0: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 17fe2: f9 01 movw r30, r18 17fe4: e2 51 subi r30, 0x12 ; 18 17fe6: fb 47 sbci r31, 0x7B ; 123 17fe8: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 17fea: f9 01 movw r30, r18 17fec: e8 56 subi r30, 0x68 ; 104 17fee: fb 47 sbci r31, 0x7B ; 123 17ff0: c4 91 lpm r28, Z if (port == NOT_A_PIN) return LOW; 17ff2: cc 23 and r28, r28 17ff4: a1 f0 breq .+40 ; 0x1801e // If the pin that support PWM output, we need to turn it off // before getting a digital reading. if (timer != NOT_ON_TIMER) turnOffPWM(timer); 17ff6: 81 11 cpse r24, r1 17ff8: 0e 94 98 b0 call 0x16130 ; 0x16130 if (*portInputRegister(port) & bit) return HIGH; 17ffc: ec 2f mov r30, r28 17ffe: f0 e0 ldi r31, 0x00 ; 0 18000: ee 0f add r30, r30 18002: ff 1f adc r31, r31 18004: e2 58 subi r30, 0x82 ; 130 18006: fb 47 sbci r31, 0x7B ; 123 18008: a5 91 lpm r26, Z+ 1800a: b4 91 lpm r27, Z 1800c: ec 91 ld r30, X 1800e: ed 23 and r30, r29 18010: 81 e0 ldi r24, 0x01 ; 1 18012: 90 e0 ldi r25, 0x00 ; 0 18014: 09 f4 brne .+2 ; 0x18018 18016: 80 e0 ldi r24, 0x00 ; 0 return LOW; } 18018: df 91 pop r29 1801a: cf 91 pop r28 1801c: 08 95 ret { uint8_t timer = digitalPinToTimer(pin); uint8_t bit = digitalPinToBitMask(pin); uint8_t port = digitalPinToPort(pin); if (port == NOT_A_PIN) return LOW; 1801e: 80 e0 ldi r24, 0x00 ; 0 18020: 90 e0 ldi r25, 0x00 ; 0 18022: fa cf rjmp .-12 ; 0x18018 00018024 : #endif } } void digitalWrite(uint8_t pin, uint8_t val) { 18024: 1f 93 push r17 18026: cf 93 push r28 18028: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1802a: 28 2f mov r18, r24 1802c: 30 e0 ldi r19, 0x00 ; 0 1802e: f9 01 movw r30, r18 18030: ec 5b subi r30, 0xBC ; 188 18032: fa 47 sbci r31, 0x7A ; 122 18034: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 18036: f9 01 movw r30, r18 18038: e2 51 subi r30, 0x12 ; 18 1803a: fb 47 sbci r31, 0x7B ; 123 1803c: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1803e: f9 01 movw r30, r18 18040: e8 56 subi r30, 0x68 ; 104 18042: fb 47 sbci r31, 0x7B ; 123 18044: c4 91 lpm r28, Z volatile uint8_t *out; if (port == NOT_A_PIN) return; 18046: cc 23 and r28, r28 18048: a9 f0 breq .+42 ; 0x18074 1804a: 16 2f mov r17, r22 // If the pin that support PWM output, we need to turn it off // before doing a digital write. if (timer != NOT_ON_TIMER) turnOffPWM(timer); 1804c: 81 11 cpse r24, r1 1804e: 0e 94 98 b0 call 0x16130 ; 0x16130 out = portOutputRegister(port); 18052: ec 2f mov r30, r28 18054: f0 e0 ldi r31, 0x00 ; 0 18056: ee 0f add r30, r30 18058: ff 1f adc r31, r31 1805a: ec 59 subi r30, 0x9C ; 156 1805c: fb 47 sbci r31, 0x7B ; 123 1805e: a5 91 lpm r26, Z+ 18060: b4 91 lpm r27, Z uint8_t oldSREG = SREG; 18062: 8f b7 in r24, 0x3f ; 63 cli(); 18064: f8 94 cli if (val == LOW) { *out &= ~bit; 18066: ec 91 ld r30, X out = portOutputRegister(port); uint8_t oldSREG = SREG; cli(); if (val == LOW) { 18068: 11 11 cpse r17, r1 1806a: 08 c0 rjmp .+16 ; 0x1807c *out &= ~bit; 1806c: d0 95 com r29 1806e: de 23 and r29, r30 } else { *out |= bit; 18070: dc 93 st X, r29 } SREG = oldSREG; 18072: 8f bf out 0x3f, r24 ; 63 } 18074: df 91 pop r29 18076: cf 91 pop r28 18078: 1f 91 pop r17 1807a: 08 95 ret cli(); if (val == LOW) { *out &= ~bit; } else { *out |= bit; 1807c: de 2b or r29, r30 1807e: f8 cf rjmp .-16 ; 0x18070 00018080 : #define ARDUINO_MAIN #include "wiring_private.h" #include "pins_arduino.h" void pinMode(uint8_t pin, uint8_t mode) { 18080: cf 93 push r28 18082: df 93 push r29 uint8_t bit = digitalPinToBitMask(pin); 18084: 90 e0 ldi r25, 0x00 ; 0 18086: fc 01 movw r30, r24 18088: e2 51 subi r30, 0x12 ; 18 1808a: fb 47 sbci r31, 0x7B ; 123 1808c: 24 91 lpm r18, Z uint8_t port = digitalPinToPort(pin); 1808e: 88 56 subi r24, 0x68 ; 104 18090: 9b 47 sbci r25, 0x7B ; 123 18092: fc 01 movw r30, r24 18094: 84 91 lpm r24, Z volatile uint8_t *reg, *out; if (port == NOT_A_PIN) return; 18096: 88 23 and r24, r24 18098: d1 f0 breq .+52 ; 0x180ce // JWS: can I let the optimizer do this? reg = portModeRegister(port); 1809a: 90 e0 ldi r25, 0x00 ; 0 1809c: 88 0f add r24, r24 1809e: 99 1f adc r25, r25 180a0: fc 01 movw r30, r24 180a2: e6 5b subi r30, 0xB6 ; 182 180a4: fb 47 sbci r31, 0x7B ; 123 180a6: a5 91 lpm r26, Z+ 180a8: b4 91 lpm r27, Z out = portOutputRegister(port); 180aa: fc 01 movw r30, r24 180ac: ec 59 subi r30, 0x9C ; 156 180ae: fb 47 sbci r31, 0x7B ; 123 180b0: c5 91 lpm r28, Z+ 180b2: d4 91 lpm r29, Z if (mode == INPUT) { 180b4: 61 11 cpse r22, r1 180b6: 0e c0 rjmp .+28 ; 0x180d4 uint8_t oldSREG = SREG; 180b8: 9f b7 in r25, 0x3f ; 63 cli(); 180ba: f8 94 cli *reg &= ~bit; 180bc: 8c 91 ld r24, X 180be: e2 2f mov r30, r18 180c0: e0 95 com r30 180c2: 8e 23 and r24, r30 180c4: 8c 93 st X, r24 *out &= ~bit; 180c6: 28 81 ld r18, Y 180c8: e2 23 and r30, r18 180ca: e8 83 st Y, r30 SREG = oldSREG; 180cc: 9f bf out 0x3f, r25 ; 63 uint8_t oldSREG = SREG; cli(); *reg |= bit; SREG = oldSREG; } } 180ce: df 91 pop r29 180d0: cf 91 pop r28 180d2: 08 95 ret cli(); *reg &= ~bit; *out |= bit; SREG = oldSREG; } else { uint8_t oldSREG = SREG; 180d4: 8f b7 in r24, 0x3f ; 63 cli(); 180d6: f8 94 cli *reg |= bit; 180d8: ec 91 ld r30, X 180da: e2 2b or r30, r18 180dc: ec 93 st X, r30 SREG = oldSREG; 180de: 8f bf out 0x3f, r24 ; 63 180e0: f6 cf rjmp .-20 ; 0x180ce 000180e2 : // Right now, PWM output only works on the pins with // hardware support. These are defined in the appropriate // pins_*.c file. For the rest of the pins, we default // to digital output. void analogWrite(uint8_t pin, int val) { 180e2: 1f 93 push r17 180e4: cf 93 push r28 180e6: df 93 push r29 180e8: 18 2f mov r17, r24 180ea: eb 01 movw r28, r22 // We need to make sure the PWM output is enabled for those pins // that support it, as we turn it off when digitally reading or // writing with them. Also, make sure the pin is in output mode // for consistenty with Wiring, which doesn't require a pinMode // call for the analog output pins. pinMode(pin, OUTPUT); 180ec: 61 e0 ldi r22, 0x01 ; 1 180ee: 0e 94 40 c0 call 0x18080 ; 0x18080 if (val == 0) 180f2: 20 97 sbiw r28, 0x00 ; 0 180f4: 39 f4 brne .+14 ; 0x18104 { digitalWrite(pin, LOW); 180f6: 60 e0 ldi r22, 0x00 ; 0 } else if (val == 255) { digitalWrite(pin, HIGH); 180f8: 81 2f mov r24, r17 } else { digitalWrite(pin, HIGH); } } } } 180fa: df 91 pop r29 180fc: cf 91 pop r28 180fe: 1f 91 pop r17 { digitalWrite(pin, LOW); } else if (val == 255) { digitalWrite(pin, HIGH); 18100: 0c 94 12 c0 jmp 0x18024 ; 0x18024 pinMode(pin, OUTPUT); if (val == 0) { digitalWrite(pin, LOW); } else if (val == 255) 18104: cf 3f cpi r28, 0xFF ; 255 18106: d1 05 cpc r29, r1 18108: 11 f4 brne .+4 ; 0x1810e { digitalWrite(pin, HIGH); 1810a: 61 e0 ldi r22, 0x01 ; 1 1810c: f5 cf rjmp .-22 ; 0x180f8 } else { switch(digitalPinToTimer(pin)) 1810e: e1 2f mov r30, r17 18110: f0 e0 ldi r31, 0x00 ; 0 18112: ec 5b subi r30, 0xBC ; 188 18114: fa 47 sbci r31, 0x7A ; 122 18116: e4 91 lpm r30, Z 18118: e1 50 subi r30, 0x01 ; 1 1811a: e2 31 cpi r30, 0x12 ; 18 1811c: 08 f0 brcs .+2 ; 0x18120 1811e: b3 c0 rjmp .+358 ; 0x18286 18120: f0 e0 ldi r31, 0x00 ; 0 18122: 88 27 eor r24, r24 18124: e9 56 subi r30, 0x69 ; 105 18126: ff 43 sbci r31, 0x3F ; 63 18128: 8f 4f sbci r24, 0xFF ; 255 1812a: 0d 94 ec a0 jmp 0x341d8 ; 0x341d8 <__tablejump2__> 1812e: a9 c0 rjmp .+338 ; 0x18282 18130: b1 c0 rjmp .+354 ; 0x18294 18132: b6 c0 rjmp .+364 ; 0x182a0 18134: c0 c0 rjmp .+384 ; 0x182b6 18136: ca c0 rjmp .+404 ; 0x182cc 18138: 43 c1 rjmp .+646 ; 0x183c0 1813a: d4 c0 rjmp .+424 ; 0x182e4 1813c: dc c0 rjmp .+440 ; 0x182f6 1813e: e4 c0 rjmp .+456 ; 0x18308 18140: ee c0 rjmp .+476 ; 0x1831e 18142: f8 c0 rjmp .+496 ; 0x18334 18144: 02 c1 rjmp .+516 ; 0x1834a 18146: 11 c1 rjmp .+546 ; 0x1836a 18148: 1b c1 rjmp .+566 ; 0x18380 1814a: 43 c1 rjmp .+646 ; 0x183d2 1814c: 25 c1 rjmp .+586 ; 0x18398 1814e: 2f c1 rjmp .+606 ; 0x183ae 18150: 39 c1 rjmp .+626 ; 0x183c4 #endif #if defined(TCCR0A) && defined(COM0A1) case TIMER0A: // connect pwm to pin on timer 0, channel A sbi(TCCR0A, COM0A1); 18152: 84 b5 in r24, 0x24 ; 36 18154: 80 68 ori r24, 0x80 ; 128 18156: 84 bd out 0x24, r24 ; 36 OCR0A = val; // set pwm duty 18158: c7 bd out 0x27, r28 ; 39 } else { digitalWrite(pin, HIGH); } } } } 1815a: df 91 pop r29 1815c: cf 91 pop r28 1815e: 1f 91 pop r17 18160: 08 95 ret #endif #if defined(TCCR0A) && defined(COM0B1) case TIMER0B: // connect pwm to pin on timer 0, channel B sbi(TCCR0A, COM0B1); 18162: 84 b5 in r24, 0x24 ; 36 18164: 80 62 ori r24, 0x20 ; 32 18166: 84 bd out 0x24, r24 ; 36 OCR0B = val; // set pwm duty 18168: c8 bd out 0x28, r28 ; 40 1816a: f7 cf rjmp .-18 ; 0x1815a #endif #if defined(TCCR1A) && defined(COM1A1) case TIMER1A: // connect pwm to pin on timer 1, channel A sbi(TCCR1A, COM1A1); 1816c: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 18170: 80 68 ori r24, 0x80 ; 128 18172: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1A = val; // set pwm duty 18176: d0 93 89 00 sts 0x0089, r29 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 1817a: c0 93 88 00 sts 0x0088, r28 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 1817e: ed cf rjmp .-38 ; 0x1815a #endif #if defined(TCCR1A) && defined(COM1B1) case TIMER1B: // connect pwm to pin on timer 1, channel B sbi(TCCR1A, COM1B1); 18180: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 18184: 80 62 ori r24, 0x20 ; 32 18186: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1B = val; // set pwm duty 1818a: d0 93 8b 00 sts 0x008B, r29 ; 0x80008b <__TEXT_REGION_LENGTH__+0x7c208b> 1818e: c0 93 8a 00 sts 0x008A, r28 ; 0x80008a <__TEXT_REGION_LENGTH__+0x7c208a> 18192: e3 cf rjmp .-58 ; 0x1815a #endif #if defined(TCCR1A) && defined(COM1C1) case TIMER1C: // connect pwm to pin on timer 1, channel C sbi(TCCR1A, COM1C1); 18194: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 18198: 88 60 ori r24, 0x08 ; 8 1819a: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1C = val; // set pwm duty 1819e: d0 93 8d 00 sts 0x008D, r29 ; 0x80008d <__TEXT_REGION_LENGTH__+0x7c208d> 181a2: c0 93 8c 00 sts 0x008C, r28 ; 0x80008c <__TEXT_REGION_LENGTH__+0x7c208c> 181a6: d9 cf rjmp .-78 ; 0x1815a #endif #if defined(TCCR2A) && defined(COM2A1) case TIMER2A: // connect pwm to pin on timer 2, channel A sbi(TCCR2A, COM2A1); 181a8: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 181ac: 80 68 ori r24, 0x80 ; 128 181ae: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2A = val; // set pwm duty 181b2: c0 93 b3 00 sts 0x00B3, r28 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> 181b6: d1 cf rjmp .-94 ; 0x1815a #endif #if defined(TCCR2A) && defined(COM2B1) case TIMER2B: // connect pwm to pin on timer 2, channel B sbi(TCCR2A, COM2B1); 181b8: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 181bc: 80 62 ori r24, 0x20 ; 32 181be: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2B = val; // set pwm duty 181c2: c0 93 b4 00 sts 0x00B4, r28 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> 181c6: c9 cf rjmp .-110 ; 0x1815a #endif #if defined(TCCR3A) && defined(COM3A1) case TIMER3A: // connect pwm to pin on timer 3, channel A sbi(TCCR3A, COM3A1); 181c8: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 181cc: 80 68 ori r24, 0x80 ; 128 181ce: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3A = val; // set pwm duty 181d2: d0 93 99 00 sts 0x0099, r29 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 181d6: c0 93 98 00 sts 0x0098, r28 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> 181da: bf cf rjmp .-130 ; 0x1815a #endif #if defined(TCCR3A) && defined(COM3B1) case TIMER3B: // connect pwm to pin on timer 3, channel B sbi(TCCR3A, COM3B1); 181dc: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 181e0: 80 62 ori r24, 0x20 ; 32 181e2: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3B = val; // set pwm duty 181e6: d0 93 9b 00 sts 0x009B, r29 ; 0x80009b <__TEXT_REGION_LENGTH__+0x7c209b> 181ea: c0 93 9a 00 sts 0x009A, r28 ; 0x80009a <__TEXT_REGION_LENGTH__+0x7c209a> 181ee: b5 cf rjmp .-150 ; 0x1815a #endif #if defined(TCCR3A) && defined(COM3C1) case TIMER3C: // connect pwm to pin on timer 3, channel C sbi(TCCR3A, COM3C1); 181f0: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 181f4: 88 60 ori r24, 0x08 ; 8 181f6: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3C = val; // set pwm duty 181fa: d0 93 9d 00 sts 0x009D, r29 ; 0x80009d <__TEXT_REGION_LENGTH__+0x7c209d> 181fe: c0 93 9c 00 sts 0x009C, r28 ; 0x80009c <__TEXT_REGION_LENGTH__+0x7c209c> 18202: ab cf rjmp .-170 ; 0x1815a #endif #if defined(TCCR4A) case TIMER4A: //connect pwm to pin on timer 4, channel A sbi(TCCR4A, COM4A1); 18204: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 18208: 80 68 ori r24, 0x80 ; 128 1820a: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #if defined(COM4A0) // only used on 32U4 cbi(TCCR4A, COM4A0); 1820e: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 18212: 8f 7b andi r24, 0xBF ; 191 18214: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #endif OCR4A = val; // set pwm duty 18218: d0 93 a9 00 sts 0x00A9, r29 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1821c: c0 93 a8 00 sts 0x00A8, r28 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 18220: 9c cf rjmp .-200 ; 0x1815a #endif #if defined(TCCR4A) && defined(COM4B1) case TIMER4B: // connect pwm to pin on timer 4, channel B sbi(TCCR4A, COM4B1); 18222: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 18226: 80 62 ori r24, 0x20 ; 32 18228: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4B = val; // set pwm duty 1822c: d0 93 ab 00 sts 0x00AB, r29 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 18230: c0 93 aa 00 sts 0x00AA, r28 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> 18234: 92 cf rjmp .-220 ; 0x1815a #endif #if defined(TCCR4A) && defined(COM4C1) case TIMER4C: // connect pwm to pin on timer 4, channel C sbi(TCCR4A, COM4C1); 18236: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1823a: 88 60 ori r24, 0x08 ; 8 1823c: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = val; // set pwm duty 18240: d0 93 ad 00 sts 0x00AD, r29 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 18244: c0 93 ac 00 sts 0x00AC, r28 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 18248: 88 cf rjmp .-240 ; 0x1815a #if defined(TCCR5A) && defined(COM5A1) case TIMER5A: // connect pwm to pin on timer 5, channel A sbi(TCCR5A, COM5A1); 1824a: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1824e: 80 68 ori r24, 0x80 ; 128 18250: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5A = val; // set pwm duty 18254: d0 93 29 01 sts 0x0129, r29 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 18258: c0 93 28 01 sts 0x0128, r28 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> 1825c: 7e cf rjmp .-260 ; 0x1815a #endif #if defined(TCCR5A) && defined(COM5B1) case TIMER5B: // connect pwm to pin on timer 5, channel B sbi(TCCR5A, COM5B1); 1825e: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 18262: 80 62 ori r24, 0x20 ; 32 18264: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5B = val; // set pwm duty 18268: d0 93 2b 01 sts 0x012B, r29 ; 0x80012b <__TEXT_REGION_LENGTH__+0x7c212b> 1826c: c0 93 2a 01 sts 0x012A, r28 ; 0x80012a <__TEXT_REGION_LENGTH__+0x7c212a> 18270: 74 cf rjmp .-280 ; 0x1815a #endif #if defined(TCCR5A) && defined(COM5C1) case TIMER5C: // connect pwm to pin on timer 5, channel C sbi(TCCR5A, COM5C1); 18272: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 18276: 88 60 ori r24, 0x08 ; 8 18278: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5C = val; // set pwm duty 1827c: d0 93 2d 01 sts 0x012D, r29 ; 0x80012d <__TEXT_REGION_LENGTH__+0x7c212d> 18280: c0 93 2c 01 sts 0x012C, r28 ; 0x80012c <__TEXT_REGION_LENGTH__+0x7c212c> 18284: 6a cf rjmp .-300 ; 0x1815a break; #endif case NOT_ON_TIMER: default: if (val < 128) { 18286: c0 38 cpi r28, 0x80 ; 128 18288: d1 05 cpc r29, r1 1828a: 0c f0 brlt .+2 ; 0x1828e 1828c: 3e cf rjmp .-388 ; 0x1810a 1828e: 33 cf rjmp .-410 ; 0x180f6 00018290 : } } /// Accelerate up to max.speed (defined by @min_delay_us) /// does not update global positions void accelerate_1_step(uint8_t axes, int16_t acc, uint16_t &delay_us, uint16_t min_delay_us){ 18290: 4f 92 push r4 18292: 5f 92 push r5 18294: 6f 92 push r6 18296: 7f 92 push r7 18298: 8f 92 push r8 1829a: 9f 92 push r9 1829c: af 92 push r10 1829e: bf 92 push r11 182a0: cf 92 push r12 182a2: df 92 push r13 182a4: ef 92 push r14 182a6: ff 92 push r15 182a8: 0f 93 push r16 182aa: 1f 93 push r17 182ac: cf 93 push r28 182ae: df 93 push r29 182b0: eb 01 movw r28, r22 182b2: 6a 01 movw r12, r20 182b4: 79 01 movw r14, r18 sm4_do_step(axes); 182b6: 0f 94 fd 35 call 0x26bfa ; 0x26bfa 182ba: f6 01 movw r30, r12 182bc: 00 81 ld r16, Z 182be: 11 81 ldd r17, Z+1 ; 0x01 /// keep max speed (avoid extra computation) if (acc > 0 && delay_us == min_delay_us){ 182c0: 1c 16 cp r1, r28 182c2: 1d 06 cpc r1, r29 182c4: b4 f4 brge .+44 ; 0x182f2 182c6: 0e 15 cp r16, r14 182c8: 1f 05 cpc r17, r15 182ca: 99 f4 brne .+38 ; 0x182f2 delayMicroseconds(delay_us); 182cc: c8 01 movw r24, r16 //DBG(_n("%d "), t1); delayMicroseconds(t1); delay_us = t1; } 182ce: df 91 pop r29 182d0: cf 91 pop r28 182d2: 1f 91 pop r17 182d4: 0f 91 pop r16 182d6: ff 90 pop r15 182d8: ef 90 pop r14 182da: df 90 pop r13 182dc: cf 90 pop r12 182de: bf 90 pop r11 182e0: af 90 pop r10 182e2: 9f 90 pop r9 182e4: 8f 90 pop r8 182e6: 7f 90 pop r7 182e8: 6f 90 pop r6 182ea: 5f 90 pop r5 182ec: 4f 90 pop r4 void accelerate_1_step(uint8_t axes, int16_t acc, uint16_t &delay_us, uint16_t min_delay_us){ sm4_do_step(axes); /// keep max speed (avoid extra computation) if (acc > 0 && delay_us == min_delay_us){ delayMicroseconds(delay_us); 182ee: 0c 94 de bf jmp 0x17fbc ; 0x17fbc return; } // v1 = v0 + a * t // 0.01 = length of a step const float t0 = delay_us * 0.000001f; 182f2: b8 01 movw r22, r16 182f4: 90 e0 ldi r25, 0x00 ; 0 182f6: 80 e0 ldi r24, 0x00 ; 0 182f8: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 182fc: 2d eb ldi r18, 0xBD ; 189 182fe: 37 e3 ldi r19, 0x37 ; 55 18300: 46 e8 ldi r20, 0x86 ; 134 18302: 55 e3 ldi r21, 0x35 ; 53 18304: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 18308: 4b 01 movw r8, r22 1830a: 5c 01 movw r10, r24 const float v1 = (0.01f / t0 + acc * t0); 1830c: be 01 movw r22, r28 1830e: 0d 2e mov r0, r29 18310: 00 0c add r0, r0 18312: 88 0b sbc r24, r24 18314: 99 0b sbc r25, r25 18316: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 1831a: a5 01 movw r20, r10 1831c: 94 01 movw r18, r8 1831e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 18322: 2b 01 movw r4, r22 18324: 3c 01 movw r6, r24 18326: a5 01 movw r20, r10 18328: 94 01 movw r18, r8 1832a: 6a e0 ldi r22, 0x0A ; 10 1832c: 77 ed ldi r23, 0xD7 ; 215 1832e: 83 e2 ldi r24, 0x23 ; 35 18330: 9c e3 ldi r25, 0x3C ; 60 18332: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 18336: 9b 01 movw r18, r22 18338: ac 01 movw r20, r24 1833a: c3 01 movw r24, r6 1833c: b2 01 movw r22, r4 1833e: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 18342: 4b 01 movw r8, r22 18344: 5c 01 movw r10, r24 uint16_t t1; if (v1 <= 0.16f){ ///< slowest speed convertible to uint16_t delay 18346: 2a e0 ldi r18, 0x0A ; 10 18348: 37 ed ldi r19, 0xD7 ; 215 1834a: 43 e2 ldi r20, 0x23 ; 35 1834c: 5e e3 ldi r21, 0x3E ; 62 1834e: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 18352: 18 16 cp r1, r24 18354: dc f5 brge .+118 ; 0x183cc t1 = MAX_DELAY; ///< already too slow so it wants to move back } else { /// don't exceed max.speed t1 = MAX(min_delay_us, round_to_u16(0.01f / v1 * 1000000.f)); 18356: a5 01 movw r20, r10 18358: 94 01 movw r18, r8 1835a: 6a e0 ldi r22, 0x0A ; 10 1835c: 77 ed ldi r23, 0xD7 ; 215 1835e: 83 e2 ldi r24, 0x23 ; 35 18360: 9c e3 ldi r25, 0x3C ; 60 18362: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 18366: 20 e0 ldi r18, 0x00 ; 0 18368: 34 e2 ldi r19, 0x24 ; 36 1836a: 44 e7 ldi r20, 0x74 ; 116 1836c: 59 e4 ldi r21, 0x49 ; 73 1836e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> uint8_t round_to_u8(float f){ return (uint8_t)(f + .5f); } uint16_t round_to_u16(float f){ return (uint16_t)(f + .5f); 18372: 20 e0 ldi r18, 0x00 ; 0 18374: 30 e0 ldi r19, 0x00 ; 0 18376: 40 e0 ldi r20, 0x00 ; 0 18378: 5f e3 ldi r21, 0x3F ; 63 1837a: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1837e: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 18382: 5b 01 movw r10, r22 18384: 6e 15 cp r22, r14 18386: 7f 05 cpc r23, r15 18388: 08 f4 brcc .+2 ; 0x1838c 1838a: 57 01 movw r10, r14 /// don't exceed max.speed t1 = MAX(min_delay_us, round_to_u16(0.01f / v1 * 1000000.f)); } /// make sure delay has changed a bit at least if (t1 == delay_us && acc != 0){ 1838c: 0a 15 cp r16, r10 1838e: 1b 05 cpc r17, r11 18390: 31 f4 brne .+12 ; 0x1839e 18392: 20 97 sbiw r28, 0x00 ; 0 18394: 21 f0 breq .+8 ; 0x1839e if (acc > 0) 18396: fc f0 brlt .+62 ; 0x183d6 t1--; 18398: f1 e0 ldi r31, 0x01 ; 1 1839a: af 1a sub r10, r31 1839c: b1 08 sbc r11, r1 t1++; } //DBG(_n("%d "), t1); delayMicroseconds(t1); 1839e: c5 01 movw r24, r10 183a0: 0e 94 de bf call 0x17fbc ; 0x17fbc delay_us = t1; 183a4: f6 01 movw r30, r12 183a6: b1 82 std Z+1, r11 ; 0x01 183a8: a0 82 st Z, r10 } 183aa: df 91 pop r29 183ac: cf 91 pop r28 183ae: 1f 91 pop r17 183b0: 0f 91 pop r16 183b2: ff 90 pop r15 183b4: ef 90 pop r14 183b6: df 90 pop r13 183b8: cf 90 pop r12 183ba: bf 90 pop r11 183bc: af 90 pop r10 183be: 9f 90 pop r9 183c0: 8f 90 pop r8 183c2: 7f 90 pop r7 183c4: 6f 90 pop r6 183c6: 5f 90 pop r5 183c8: 4f 90 pop r4 183ca: 08 95 ret // 0.01 = length of a step const float t0 = delay_us * 0.000001f; const float v1 = (0.01f / t0 + acc * t0); uint16_t t1; if (v1 <= 0.16f){ ///< slowest speed convertible to uint16_t delay t1 = MAX_DELAY; ///< already too slow so it wants to move back 183cc: 80 e1 ldi r24, 0x10 ; 16 183ce: a8 2e mov r10, r24 183d0: 87 e2 ldi r24, 0x27 ; 39 183d2: b8 2e mov r11, r24 183d4: db cf rjmp .-74 ; 0x1838c /// make sure delay has changed a bit at least if (t1 == delay_us && acc != 0){ if (acc > 0) t1--; else t1++; 183d6: 8f ef ldi r24, 0xFF ; 255 183d8: a8 1a sub r10, r24 183da: b8 0a sbc r11, r24 183dc: e0 cf rjmp .-64 ; 0x1839e 000183de : /// keeps speed and then it decelerates to a complete stop (if possible) /// it goes defined number of steps /// returns after each step /// \returns true if step was done /// does not update global positions bool go_and_stop_1_step(uint8_t axes, int16_t dec, uint16_t &delay_us, uint16_t &steps){ 183de: 2f 92 push r2 183e0: 3f 92 push r3 183e2: 4f 92 push r4 183e4: 5f 92 push r5 183e6: 6f 92 push r6 183e8: 7f 92 push r7 183ea: 8f 92 push r8 183ec: 9f 92 push r9 183ee: af 92 push r10 183f0: bf 92 push r11 183f2: cf 92 push r12 183f4: df 92 push r13 183f6: ef 92 push r14 183f8: ff 92 push r15 183fa: 0f 93 push r16 183fc: 1f 93 push r17 183fe: cf 93 push r28 18400: df 93 push r29 18402: 00 d0 rcall .+0 ; 0x18404 18404: cd b7 in r28, 0x3d ; 61 18406: de b7 in r29, 0x3e ; 62 if (steps <= 0 || dec <= 0) 18408: f9 01 movw r30, r18 1840a: e0 80 ld r14, Z 1840c: f1 80 ldd r15, Z+1 ; 0x01 1840e: e1 14 cp r14, r1 18410: f1 04 cpc r15, r1 18412: 09 f4 brne .+2 ; 0x18416 18414: 6c c0 rjmp .+216 ; 0x184ee 18416: 16 16 cp r1, r22 18418: 17 06 cpc r1, r23 1841a: 0c f0 brlt .+2 ; 0x1841e 1841c: 68 c0 rjmp .+208 ; 0x184ee 1841e: 19 01 movw r2, r18 18420: 5b 83 std Y+3, r21 ; 0x03 18422: 4a 83 std Y+2, r20 ; 0x02 18424: 6b 01 movw r12, r22 18426: 89 83 std Y+1, r24 ; 0x01 return false; /// deceleration distance in steps, s = 1/2 v^2 / a uint16_t s = round_to_u16(100 * 0.5f * SQR(0.01f) / (SQR((float)delay_us) * dec)); 18428: fa 01 movw r30, r20 1842a: 00 81 ld r16, Z 1842c: 11 81 ldd r17, Z+1 ; 0x01 1842e: b8 01 movw r22, r16 18430: 90 e0 ldi r25, 0x00 ; 0 18432: 80 e0 ldi r24, 0x00 ; 0 18434: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 18438: 4b 01 movw r8, r22 1843a: 5c 01 movw r10, r24 1843c: b6 01 movw r22, r12 1843e: 0d 2c mov r0, r13 18440: 00 0c add r0, r0 18442: 88 0b sbc r24, r24 18444: 99 0b sbc r25, r25 18446: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 1844a: 2b 01 movw r4, r22 1844c: 3c 01 movw r6, r24 1844e: a5 01 movw r20, r10 18450: 94 01 movw r18, r8 18452: c5 01 movw r24, r10 18454: b4 01 movw r22, r8 18456: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1845a: 9b 01 movw r18, r22 1845c: ac 01 movw r20, r24 1845e: c3 01 movw r24, r6 18460: b2 01 movw r22, r4 18462: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 18466: 9b 01 movw r18, r22 18468: ac 01 movw r20, r24 1846a: 6a e0 ldi r22, 0x0A ; 10 1846c: 77 ed ldi r23, 0xD7 ; 215 1846e: 83 ea ldi r24, 0xA3 ; 163 18470: 9b e3 ldi r25, 0x3B ; 59 18472: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> uint8_t round_to_u8(float f){ return (uint8_t)(f + .5f); } uint16_t round_to_u16(float f){ return (uint16_t)(f + .5f); 18476: 20 e0 ldi r18, 0x00 ; 0 18478: 30 e0 ldi r19, 0x00 ; 0 1847a: 40 e0 ldi r20, 0x00 ; 0 1847c: 5f e3 ldi r21, 0x3F ; 63 1847e: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 18482: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> if (steps <= 0 || dec <= 0) return false; /// deceleration distance in steps, s = 1/2 v^2 / a uint16_t s = round_to_u16(100 * 0.5f * SQR(0.01f) / (SQR((float)delay_us) * dec)); if (steps > s){ 18486: 6e 15 cp r22, r14 18488: 7f 05 cpc r23, r15 1848a: 30 f5 brcc .+76 ; 0x184d8 /// go steady sm4_do_step(axes); 1848c: 89 81 ldd r24, Y+1 ; 0x01 1848e: 0f 94 fd 35 call 0x26bfa ; 0x26bfa delayMicroseconds(delay_us); 18492: ea 81 ldd r30, Y+2 ; 0x02 18494: fb 81 ldd r31, Y+3 ; 0x03 18496: 80 81 ld r24, Z 18498: 91 81 ldd r25, Z+1 ; 0x01 1849a: 0e 94 de bf call 0x17fbc ; 0x17fbc } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); } --steps; 1849e: f1 01 movw r30, r2 184a0: 80 81 ld r24, Z 184a2: 91 81 ldd r25, Z+1 ; 0x01 184a4: 01 97 sbiw r24, 0x01 ; 1 184a6: 91 83 std Z+1, r25 ; 0x01 184a8: 80 83 st Z, r24 return true; 184aa: 81 e0 ldi r24, 0x01 ; 1 } 184ac: 0f 90 pop r0 184ae: 0f 90 pop r0 184b0: 0f 90 pop r0 184b2: df 91 pop r29 184b4: cf 91 pop r28 184b6: 1f 91 pop r17 184b8: 0f 91 pop r16 184ba: ff 90 pop r15 184bc: ef 90 pop r14 184be: df 90 pop r13 184c0: cf 90 pop r12 184c2: bf 90 pop r11 184c4: af 90 pop r10 184c6: 9f 90 pop r9 184c8: 8f 90 pop r8 184ca: 7f 90 pop r7 184cc: 6f 90 pop r6 184ce: 5f 90 pop r5 184d0: 4f 90 pop r4 184d2: 3f 90 pop r3 184d4: 2f 90 pop r2 184d6: 08 95 ret /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); 184d8: 66 27 eor r22, r22 184da: 77 27 eor r23, r23 184dc: 6c 19 sub r22, r12 184de: 7d 09 sbc r23, r13 184e0: 98 01 movw r18, r16 184e2: 4a 81 ldd r20, Y+2 ; 0x02 184e4: 5b 81 ldd r21, Y+3 ; 0x03 184e6: 89 81 ldd r24, Y+1 ; 0x01 184e8: 0e 94 48 c1 call 0x18290 ; 0x18290 184ec: d8 cf rjmp .-80 ; 0x1849e /// returns after each step /// \returns true if step was done /// does not update global positions bool go_and_stop_1_step(uint8_t axes, int16_t dec, uint16_t &delay_us, uint16_t &steps){ if (steps <= 0 || dec <= 0) return false; 184ee: 80 e0 ldi r24, 0x00 ; 0 184f0: dd cf rjmp .-70 ; 0x184ac 000184f2 : count_position[i] += dir & mask ? -1L : 1L; } } } static void __attribute__((noinline)) set_axes_dir(const uint8_t axis, const uint8_t dir) { 184f2: 0f 93 push r16 184f4: 1f 93 push r17 184f6: cf 93 push r28 184f8: df 93 push r29 184fa: 18 2f mov r17, r24 184fc: 06 2f mov r16, r22 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 184fe: d1 e0 ldi r29, 0x01 ; 1 18500: c0 e0 ldi r28, 0x00 ; 0 if (axis & mask) { 18502: 81 2f mov r24, r17 18504: 8d 23 and r24, r29 18506: 29 f0 breq .+10 ; 0x18512 sm4_set_dir(i, dir & mask); 18508: 60 2f mov r22, r16 1850a: 6d 23 and r22, r29 1850c: 8c 2f mov r24, r28 1850e: 0f 94 05 36 call 0x26c0a ; 0x26c0a } } } static void __attribute__((noinline)) set_axes_dir(const uint8_t axis, const uint8_t dir) { for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 18512: cf 5f subi r28, 0xFF ; 255 18514: dd 0f add r29, r29 18516: c3 30 cpi r28, 0x03 ; 3 18518: a1 f7 brne .-24 ; 0x18502 if (axis & mask) { sm4_set_dir(i, dir & mask); } } } 1851a: df 91 pop r29 1851c: cf 91 pop r28 1851e: 1f 91 pop r17 18520: 0f 91 pop r16 18522: 08 95 ret 00018524 : //@size=114 DBG(_n("min, trigger, untrigger, max: [%d %d %d %d]\n"), _Z, trigger, untrigger, z); } } static void update_position_1_step(const uint8_t axis, const uint8_t dir) { 18524: 8f 92 push r8 18526: 9f 92 push r9 18528: af 92 push r10 1852a: bf 92 push r11 1852c: cf 92 push r12 1852e: df 92 push r13 18530: ef 92 push r14 18532: ff 92 push r15 18534: 30 e0 ldi r19, 0x00 ; 0 18536: 20 e0 ldi r18, 0x00 ; 0 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 18538: 91 e0 ldi r25, 0x01 ; 1 if (axis & mask) { 1853a: 48 2f mov r20, r24 1853c: 49 23 and r20, r25 1853e: 19 f1 breq .+70 ; 0x18586 count_position[i] += dir & mask ? -1L : 1L; 18540: a9 01 movw r20, r18 18542: 44 0f add r20, r20 18544: 55 1f adc r21, r21 18546: 44 0f add r20, r20 18548: 55 1f adc r21, r21 1854a: fa 01 movw r30, r20 1854c: ea 54 subi r30, 0x4A ; 74 1854e: f9 4f sbci r31, 0xF9 ; 249 18550: c0 80 ld r12, Z 18552: d1 80 ldd r13, Z+1 ; 0x01 18554: e2 80 ldd r14, Z+2 ; 0x02 18556: f3 80 ldd r15, Z+3 ; 0x03 18558: 76 2f mov r23, r22 1855a: 79 23 and r23, r25 1855c: 81 2c mov r8, r1 1855e: 91 2c mov r9, r1 18560: 54 01 movw r10, r8 18562: 83 94 inc r8 18564: 77 23 and r23, r23 18566: 21 f0 breq .+8 ; 0x18570 18568: 88 24 eor r8, r8 1856a: 8a 94 dec r8 1856c: 98 2c mov r9, r8 1856e: 54 01 movw r10, r8 18570: c8 0c add r12, r8 18572: d9 1c adc r13, r9 18574: ea 1c adc r14, r10 18576: fb 1c adc r15, r11 18578: 4a 54 subi r20, 0x4A ; 74 1857a: 59 4f sbci r21, 0xF9 ; 249 1857c: fa 01 movw r30, r20 1857e: c0 82 st Z, r12 18580: d1 82 std Z+1, r13 ; 0x01 18582: e2 82 std Z+2, r14 ; 0x02 18584: f3 82 std Z+3, r15 ; 0x03 DBG(_n("min, trigger, untrigger, max: [%d %d %d %d]\n"), _Z, trigger, untrigger, z); } } static void update_position_1_step(const uint8_t axis, const uint8_t dir) { for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 18586: 99 0f add r25, r25 18588: 2f 5f subi r18, 0xFF ; 255 1858a: 3f 4f sbci r19, 0xFF ; 255 1858c: 23 30 cpi r18, 0x03 ; 3 1858e: 31 05 cpc r19, r1 18590: a1 f6 brne .-88 ; 0x1853a if (axis & mask) { count_position[i] += dir & mask ? -1L : 1L; } } } 18592: ff 90 pop r15 18594: ef 90 pop r14 18596: df 90 pop r13 18598: cf 90 pop r12 1859a: bf 90 pop r11 1859c: af 90 pop r10 1859e: 9f 90 pop r9 185a0: 8f 90 pop r8 185a2: 08 95 ret 000185a4 : /// Moves printer to absolute position [x,y,z] defined in integer position system /// check_pinda == 0: ordinary move /// check_pinda == 1: stop when PINDA triggered /// check_pinda == -1: stop when PINDA untriggered bool xyzcal_lineXYZ_to(int16_t x, int16_t y, int16_t z, uint16_t delay_us, int8_t check_pinda) { 185a4: 2f 92 push r2 185a6: 3f 92 push r3 185a8: 4f 92 push r4 185aa: 5f 92 push r5 185ac: 6f 92 push r6 185ae: 7f 92 push r7 185b0: 8f 92 push r8 185b2: 9f 92 push r9 185b4: af 92 push r10 185b6: bf 92 push r11 185b8: cf 92 push r12 185ba: df 92 push r13 185bc: ef 92 push r14 185be: ff 92 push r15 185c0: 0f 93 push r16 185c2: 1f 93 push r17 185c4: cf 93 push r28 185c6: df 93 push r29 185c8: 00 d0 rcall .+0 ; 0x185ca 185ca: 00 d0 rcall .+0 ; 0x185cc 185cc: cd b7 in r28, 0x3d ; 61 185ce: de b7 in r29, 0x3e ; 62 // DBG(_n("xyzcal_lineXYZ_to x=%d y=%d z=%d check=%d\n"), x, y, z, check_pinda); x -= (int16_t)count_position[0]; 185d0: c0 90 b6 06 lds r12, 0x06B6 ; 0x8006b6 185d4: d0 90 b7 06 lds r13, 0x06B7 ; 0x8006b7 185d8: e0 90 b8 06 lds r14, 0x06B8 ; 0x8006b8 185dc: f0 90 b9 06 lds r15, 0x06B9 ; 0x8006b9 185e0: 7c 01 movw r14, r24 185e2: ec 18 sub r14, r12 185e4: fd 08 sbc r15, r13 y -= (int16_t)count_position[1]; 185e6: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 185ea: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 185ee: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 185f2: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 185f6: 68 1b sub r22, r24 185f8: 79 0b sbc r23, r25 z -= (int16_t)count_position[2]; 185fa: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 185fe: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 18602: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 18606: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 1860a: fa 01 movw r30, r20 1860c: e8 1b sub r30, r24 1860e: f9 0b sbc r31, r25 18610: fa 83 std Y+2, r31 ; 0x02 18612: e9 83 std Y+1, r30 ; 0x01 xyzcal_dm = ((x<0)?1:0) | ((y<0)?2:0) | ((z<0)?4:0); 18614: fb 01 movw r30, r22 18616: ff 0f add r31, r31 18618: ee 0b sbc r30, r30 1861a: ff 0f add r31, r31 1861c: fe 2f mov r31, r30 1861e: ee 1f adc r30, r30 18620: e2 70 andi r30, 0x02 ; 2 18622: 89 81 ldd r24, Y+1 ; 0x01 18624: 9a 81 ldd r25, Y+2 ; 0x02 18626: 88 e0 ldi r24, 0x08 ; 8 18628: 98 02 muls r25, r24 1862a: 81 2d mov r24, r1 1862c: 99 0b sbc r25, r25 1862e: 11 24 eor r1, r1 18630: 84 70 andi r24, 0x04 ; 4 18632: e8 2b or r30, r24 18634: 8f 2d mov r24, r15 18636: 88 1f adc r24, r24 18638: 88 27 eor r24, r24 1863a: 88 1f adc r24, r24 1863c: e8 2b or r30, r24 1863e: e0 93 bf 03 sts 0x03BF, r30 ; 0x8003bf asm("nop"); } void sm4_set_dir_bits(uint8_t dir_bits) { uint8_t portL = PORTL; 18642: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> portL &= 0xb8; //set direction bits to zero 18646: 98 7b andi r25, 0xB8 ; 184 //TODO -optimize in asm #if ((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3)) dir_bits ^= dir_mask; 18648: 87 e0 ldi r24, 0x07 ; 7 1864a: e8 27 eor r30, r24 if (dir_bits & 1) portL |= 2; //set X direction bit 1864c: e0 fd sbrc r30, 0 1864e: 92 60 ori r25, 0x02 ; 2 if (dir_bits & 2) portL |= 1; //set Y direction bit 18650: e1 fd sbrc r30, 1 18652: 91 60 ori r25, 0x01 ; 1 if (dir_bits & 4) portL |= 4; //set Z direction bit 18654: e4 70 andi r30, 0x04 ; 4 18656: 09 f0 breq .+2 ; 0x1865a 18658: 94 60 ori r25, 0x04 ; 4 if (dir_bits & 1) portL |= 1; //set X direction bit if (dir_bits & 2) portL |= 2; //set Y direction bit if (dir_bits & 4) portL |= 4; //set Z direction bit if (dir_bits & 8) portL |= 64; //set E direction bit #endif PORTL = portL; 1865a: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> asm("nop"); 1865e: 00 00 nop sm4_set_dir_bits(xyzcal_dm); sm4_stop_cb = check_pinda?((check_pinda<0)?check_pinda_0:check_pinda_1):0; 18660: 8f ef ldi r24, 0xFF ; 255 18662: 90 eb ldi r25, 0xB0 ; 176 18664: 01 11 cpse r16, r1 18666: 02 c0 rjmp .+4 ; 0x1866c 18668: 90 e0 ldi r25, 0x00 ; 0 1866a: 80 e0 ldi r24, 0x00 ; 0 1866c: 90 93 28 05 sts 0x0528, r25 ; 0x800528 18670: 80 93 27 05 sts 0x0527, r24 ; 0x800527 xyzcal_sm4_delay = delay_us; 18674: 30 93 be 03 sts 0x03BE, r19 ; 0x8003be 18678: 20 93 bd 03 sts 0x03BD, r18 ; 0x8003bd // uint32_t u = _micros(); bool ret = sm4_line_xyz_ui(abs(x), abs(y), abs(z)) ? true : false; 1867c: 29 81 ldd r18, Y+1 ; 0x01 1867e: 3a 81 ldd r19, Y+2 ; 0x02 18680: 3e 83 std Y+6, r19 ; 0x06 18682: 2d 83 std Y+5, r18 ; 0x05 18684: 37 ff sbrs r19, 7 18686: 05 c0 rjmp .+10 ; 0x18692 18688: 31 95 neg r19 1868a: 21 95 neg r18 1868c: 31 09 sbc r19, r1 1868e: 3e 83 std Y+6, r19 ; 0x06 18690: 2d 83 std Y+5, r18 ; 0x05 18692: 8b 01 movw r16, r22 18694: 77 ff sbrs r23, 7 18696: 03 c0 rjmp .+6 ; 0x1869e 18698: 11 95 neg r17 1869a: 01 95 neg r16 1869c: 11 09 sbc r17, r1 1869e: f7 fe sbrs r15, 7 186a0: 03 c0 rjmp .+6 ; 0x186a8 186a2: f1 94 neg r15 186a4: e1 94 neg r14 186a6: f1 08 sbc r15, r1 #endif #endif //((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3) || (MOTHERBOARD == BOARD_EINSY_1_0a)) } uint16_t sm4_line_xyz_ui(uint16_t dx, uint16_t dy, uint16_t dz){ uint16_t dd = (uint16_t)(sqrt((float)(((uint32_t)dx)*dx + ((uint32_t)dy*dy) + ((uint32_t)dz*dz))) + 0.5); 186a8: 98 01 movw r18, r16 186aa: d8 01 movw r26, r16 186ac: 0f 94 f4 a0 call 0x341e8 ; 0x341e8 <__mulhisi3> 186b0: 4b 01 movw r8, r22 186b2: 5c 01 movw r10, r24 186b4: 2d 81 ldd r18, Y+5 ; 0x05 186b6: 3e 81 ldd r19, Y+6 ; 0x06 186b8: d9 01 movw r26, r18 186ba: 0f 94 f4 a0 call 0x341e8 ; 0x341e8 <__mulhisi3> 186be: 86 0e add r8, r22 186c0: 97 1e adc r9, r23 186c2: a8 1e adc r10, r24 186c4: b9 1e adc r11, r25 186c6: 97 01 movw r18, r14 186c8: d7 01 movw r26, r14 186ca: 0f 94 f4 a0 call 0x341e8 ; 0x341e8 <__mulhisi3> 186ce: 68 0d add r22, r8 186d0: 79 1d adc r23, r9 186d2: 8a 1d adc r24, r10 186d4: 9b 1d adc r25, r11 186d6: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 186da: 0f 94 d2 a4 call 0x349a4 ; 0x349a4 186de: 20 e0 ldi r18, 0x00 ; 0 186e0: 30 e0 ldi r19, 0x00 ; 0 186e2: 40 e0 ldi r20, 0x00 ; 0 186e4: 5f e3 ldi r21, 0x3F ; 63 186e6: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 186ea: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 186ee: 2b 01 movw r4, r22 uint16_t nd = dd; uint16_t cx = dd; uint16_t cy = dd; uint16_t cz = dd; 186f0: 4b 01 movw r8, r22 uint16_t sm4_line_xyz_ui(uint16_t dx, uint16_t dy, uint16_t dz){ uint16_t dd = (uint16_t)(sqrt((float)(((uint32_t)dx)*dx + ((uint32_t)dy*dy) + ((uint32_t)dz*dz))) + 0.5); uint16_t nd = dd; uint16_t cx = dd; uint16_t cy = dd; 186f2: 5b 01 movw r10, r22 } uint16_t sm4_line_xyz_ui(uint16_t dx, uint16_t dy, uint16_t dz){ uint16_t dd = (uint16_t)(sqrt((float)(((uint32_t)dx)*dx + ((uint32_t)dy*dy) + ((uint32_t)dz*dz))) + 0.5); uint16_t nd = dd; uint16_t cx = dd; 186f4: 6b 01 movw r12, r22 #endif //((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3) || (MOTHERBOARD == BOARD_EINSY_1_0a)) } uint16_t sm4_line_xyz_ui(uint16_t dx, uint16_t dy, uint16_t dz){ uint16_t dd = (uint16_t)(sqrt((float)(((uint32_t)dx)*dx + ((uint32_t)dy*dy) + ((uint32_t)dz*dz))) + 0.5); uint16_t nd = dd; 186f6: 3b 01 movw r6, r22 uint16_t cx = dd; uint16_t cy = dd; uint16_t cz = dd; uint16_t x = 0; uint16_t y = 0; uint16_t z = 0; 186f8: 1c 82 std Y+4, r1 ; 0x04 186fa: 1b 82 std Y+3, r1 ; 0x03 uint16_t nd = dd; uint16_t cx = dd; uint16_t cy = dd; uint16_t cz = dd; uint16_t x = 0; uint16_t y = 0; 186fc: 31 2c mov r3, r1 186fe: 21 2c mov r2, r1 uint16_t dd = (uint16_t)(sqrt((float)(((uint32_t)dx)*dx + ((uint32_t)dy*dy) + ((uint32_t)dz*dz))) + 0.5); uint16_t nd = dd; uint16_t cx = dd; uint16_t cy = dd; uint16_t cz = dd; uint16_t x = 0; 18700: 1a 82 std Y+2, r1 ; 0x02 18702: 19 82 std Y+1, r1 ; 0x01 uint16_t y = 0; uint16_t z = 0; while (nd){ 18704: 61 14 cp r6, r1 18706: 71 04 cpc r7, r1 18708: 09 f4 brne .+2 ; 0x1870c 1870a: 48 c0 rjmp .+144 ; 0x1879c if (sm4_stop_cb && (*sm4_stop_cb)()) break; 1870c: e0 91 27 05 lds r30, 0x0527 ; 0x800527 18710: f0 91 28 05 lds r31, 0x0528 ; 0x800528 18714: 30 97 sbiw r30, 0x00 ; 0 18716: f1 f5 brne .+124 ; 0x18794 uint8_t sm = 0; //step mask 18718: 80 e0 ldi r24, 0x00 ; 0 if (cx <= dx){ 1871a: ec 14 cp r14, r12 1871c: fd 04 cpc r15, r13 1871e: 40 f0 brcs .+16 ; 0x18730 sm |= 1; cx += dd; 18720: c4 0c add r12, r4 18722: d5 1c adc r13, r5 x++; 18724: 89 81 ldd r24, Y+1 ; 0x01 18726: 9a 81 ldd r25, Y+2 ; 0x02 18728: 01 96 adiw r24, 0x01 ; 1 1872a: 9a 83 std Y+2, r25 ; 0x02 1872c: 89 83 std Y+1, r24 ; 0x01 uint16_t z = 0; while (nd){ if (sm4_stop_cb && (*sm4_stop_cb)()) break; uint8_t sm = 0; //step mask if (cx <= dx){ sm |= 1; 1872e: 81 e0 ldi r24, 0x01 ; 1 cx += dd; x++; } if (cy <= dy){ 18730: 0a 15 cp r16, r10 18732: 1b 05 cpc r17, r11 18734: 30 f0 brcs .+12 ; 0x18742 sm |= 2; 18736: 82 60 ori r24, 0x02 ; 2 cy += dd; 18738: a4 0c add r10, r4 1873a: b5 1c adc r11, r5 y++; 1873c: 9f ef ldi r25, 0xFF ; 255 1873e: 29 1a sub r2, r25 18740: 39 0a sbc r3, r25 } if (cz <= dz){ 18742: ed 81 ldd r30, Y+5 ; 0x05 18744: fe 81 ldd r31, Y+6 ; 0x06 18746: e8 15 cp r30, r8 18748: f9 05 cpc r31, r9 1874a: 48 f0 brcs .+18 ; 0x1875e sm |= 4; 1874c: 84 60 ori r24, 0x04 ; 4 cz += dd; 1874e: 84 0c add r8, r4 18750: 95 1c adc r9, r5 z++; 18752: 2b 81 ldd r18, Y+3 ; 0x03 18754: 3c 81 ldd r19, Y+4 ; 0x04 18756: 2f 5f subi r18, 0xFF ; 255 18758: 3f 4f sbci r19, 0xFF ; 255 1875a: 3c 83 std Y+4, r19 ; 0x04 1875c: 2b 83 std Y+3, r18 ; 0x03 } cx -= dx; 1875e: ce 18 sub r12, r14 18760: df 08 sbc r13, r15 cy -= dy; 18762: a0 1a sub r10, r16 18764: b1 0a sbc r11, r17 cz -= dz; 18766: ed 81 ldd r30, Y+5 ; 0x05 18768: fe 81 ldd r31, Y+6 ; 0x06 1876a: 8e 1a sub r8, r30 1876c: 9f 0a sbc r9, r31 sm4_do_step(sm); 1876e: 0f 94 fd 35 call 0x26bfa ; 0x26bfa uint16_t delay = SM4_DEFDELAY; if (sm4_calc_delay_cb) delay = (*sm4_calc_delay_cb)(nd, dd); 18772: e0 91 23 05 lds r30, 0x0523 ; 0x800523 18776: f0 91 24 05 lds r31, 0x0524 ; 0x800524 1877a: 30 97 sbiw r30, 0x00 ; 0 1877c: d1 f1 breq .+116 ; 0x187f2 1877e: b2 01 movw r22, r4 18780: c3 01 movw r24, r6 18782: 19 95 eicall if (delay) delayMicroseconds(delay); 18784: 00 97 sbiw r24, 0x00 ; 0 18786: 11 f0 breq .+4 ; 0x1878c 18788: 0e 94 de bf call 0x17fbc ; 0x17fbc nd--; 1878c: f1 e0 ldi r31, 0x01 ; 1 1878e: 6f 1a sub r6, r31 18790: 71 08 sbc r7, r1 18792: b8 cf rjmp .-144 ; 0x18704 uint16_t cz = dd; uint16_t x = 0; uint16_t y = 0; uint16_t z = 0; while (nd){ if (sm4_stop_cb && (*sm4_stop_cb)()) break; 18794: 19 95 eicall 18796: 88 23 and r24, r24 18798: 09 f4 brne .+2 ; 0x1879c 1879a: be cf rjmp .-132 ; 0x18718 uint16_t delay = SM4_DEFDELAY; if (sm4_calc_delay_cb) delay = (*sm4_calc_delay_cb)(nd, dd); if (delay) delayMicroseconds(delay); nd--; } if (sm4_update_pos_cb) 1879c: e0 91 25 05 lds r30, 0x0525 ; 0x800525 187a0: f0 91 26 05 lds r31, 0x0526 ; 0x800526 187a4: 30 97 sbiw r30, 0x00 ; 0 187a6: 41 f0 breq .+16 ; 0x187b8 (*sm4_update_pos_cb)(x, y, z, 0); 187a8: 30 e0 ldi r19, 0x00 ; 0 187aa: 20 e0 ldi r18, 0x00 ; 0 187ac: 4b 81 ldd r20, Y+3 ; 0x03 187ae: 5c 81 ldd r21, Y+4 ; 0x04 187b0: b1 01 movw r22, r2 187b2: 89 81 ldd r24, Y+1 ; 0x01 187b4: 9a 81 ldd r25, Y+2 ; 0x02 187b6: 19 95 eicall 187b8: 81 e0 ldi r24, 0x01 ; 1 187ba: 67 28 or r6, r7 187bc: 09 f4 brne .+2 ; 0x187c0 187be: 80 e0 ldi r24, 0x00 ; 0 // u = _micros() - u; return ret; } 187c0: 26 96 adiw r28, 0x06 ; 6 187c2: 0f b6 in r0, 0x3f ; 63 187c4: f8 94 cli 187c6: de bf out 0x3e, r29 ; 62 187c8: 0f be out 0x3f, r0 ; 63 187ca: cd bf out 0x3d, r28 ; 61 187cc: df 91 pop r29 187ce: cf 91 pop r28 187d0: 1f 91 pop r17 187d2: 0f 91 pop r16 187d4: ff 90 pop r15 187d6: ef 90 pop r14 187d8: df 90 pop r13 187da: cf 90 pop r12 187dc: bf 90 pop r11 187de: af 90 pop r10 187e0: 9f 90 pop r9 187e2: 8f 90 pop r8 187e4: 7f 90 pop r7 187e6: 6f 90 pop r6 187e8: 5f 90 pop r5 187ea: 4f 90 pop r4 187ec: 3f 90 pop r3 187ee: 2f 90 pop r2 187f0: 08 95 ret } cx -= dx; cy -= dy; cz -= dz; sm4_do_step(sm); uint16_t delay = SM4_DEFDELAY; 187f2: 84 ef ldi r24, 0xF4 ; 244 187f4: 91 e0 ldi r25, 0x01 ; 1 187f6: c8 cf rjmp .-112 ; 0x18788 000187f8 : class IR_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return !READ(IR_SENSOR_PIN); } 187f8: 89 b1 in r24, 0x09 ; 9 187fa: 86 95 lsr r24 187fc: 81 70 andi r24, 0x01 ; 1 187fe: 91 e0 ldi r25, 0x01 ; 1 18800: 89 27 eor r24, r25 18802: 08 95 ret 00018804 : //! | Fail stats | allways //! | Fail stats MMU | mmu //! | Support | allways //! @endcode static void lcd_main_menu() { 18804: 1f 93 push r17 18806: cf 93 push r28 18808: df 93 push r29 MENU_BEGIN(); 1880a: 0f 94 bc 92 call 0x32578 ; 0x32578 1880e: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e #endif //SDSUPPORT if(!farm_mode) { const int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); 18812: 1b e0 ldi r17, 0x0B ; 11 #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code if (card.mounted || lcd_commands_type != LcdCommands::Idle) { if (!card.isFileOpen()) { if (!usb_timer.running() && (lcd_commands_type == LcdCommands::Idle)) { bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function 18814: d1 e0 ldi r29, 0x01 ; 1 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 18816: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1881a: 84 30 cpi r24, 0x04 ; 4 1881c: 08 f0 brcs .+2 ; 0x18820 1881e: 09 c2 rjmp .+1042 ; 0x18c32 18820: 10 92 31 04 sts 0x0431, r1 ; 0x800431 // Majkl superawesome menu MENU_ITEM_BACK_P(_T(MSG_INFO_SCREEN)); 18824: 80 e2 ldi r24, 0x20 ; 32 18826: 9d e3 ldi r25, 0x3D ; 61 18828: 0e 94 b1 6c call 0xd962 ; 0xd962 1882c: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_FUNCTION_P(PSTR("recover print"), recover_print); MENU_ITEM_FUNCTION_P(PSTR("power panic"), uvlo_); #endif //TMC2130_DEBUG // Menu item for reprint if (!printer_active() && !printer_recovering() && (heating_status == HeatingStatus::NO_HEATING)) { 18830: 0e 94 19 61 call 0xc232 ; 0xc232 18834: 81 11 cpse r24, r1 18836: 19 c0 rjmp .+50 ; 0x1886a 18838: 0e 94 b3 60 call 0xc166 ; 0xc166 1883c: 81 11 cpse r24, r1 1883e: 15 c0 rjmp .+42 ; 0x1886a 18840: 80 91 99 03 lds r24, 0x0399 ; 0x800399 18844: 81 11 cpse r24, r1 18846: 11 c0 rjmp .+34 ; 0x1886a #include "printer_state.h" static PrinterState printer_state; PrinterState GetPrinterState() { return printer_state; 18848: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.367> if ((GetPrinterState() == PrinterState::SDPrintingFinished) && card.mounted) { 1884c: 83 30 cpi r24, 0x03 ; 3 1884e: 09 f0 breq .+2 ; 0x18852 18850: 5d c0 rjmp .+186 ; 0x1890c 18852: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 18856: 88 23 and r24, r24 18858: 41 f0 breq .+16 ; 0x1886a MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_reprint_from_eeprom); 1885a: 86 e1 ldi r24, 0x16 ; 22 1885c: 9d e3 ldi r25, 0x3D ; 61 1885e: 0e 94 b1 6c call 0xd962 ; 0xd962 18862: 6c e6 ldi r22, 0x6C ; 108 18864: 75 eb ldi r23, 0xB5 ; 181 } else if ((GetPrinterState() == PrinterState::HostPrintingFinished) && M79_timer_get_status()) { MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 18866: 0f 94 39 92 call 0x32472 ; 0x32472 } } // Menu is never shown when idle if (babystep_allowed_strict() && (printJobOngoing() || lcd_commands_type == LcdCommands::Layer1Cal)) 1886a: 0e 94 03 61 call 0xc206 ; 0xc206 1886e: 88 23 and r24, r24 18870: 81 f0 breq .+32 ; 0x18892 18872: 0e 94 c8 60 call 0xc190 ; 0xc190 18876: 81 11 cpse r24, r1 18878: 04 c0 rjmp .+8 ; 0x18882 1887a: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1887e: 84 30 cpi r24, 0x04 ; 4 18880: 41 f4 brne .+16 ; 0x18892 MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 18882: 86 e0 ldi r24, 0x06 ; 6 18884: 9d e3 ldi r25, 0x3D ; 61 18886: 0e 94 b1 6c call 0xd962 ; 0xd962 1888a: 63 ee ldi r22, 0xE3 ; 227 1888c: 76 e3 ldi r23, 0x36 ; 54 1888e: 0f 94 ea 94 call 0x329d4 ; 0x329d4 if (farm_mode) 18892: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 18896: 88 23 and r24, r24 18898: 41 f0 breq .+16 ; 0x188aa MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 1889a: 8b e5 ldi r24, 0x5B ; 91 1889c: 9d e3 ldi r25, 0x3D ; 61 1889e: 0e 94 b1 6c call 0xd962 ; 0xd962 188a2: 6e e3 ldi r22, 0x3E ; 62 188a4: 7f ee ldi r23, 0xEF ; 239 188a6: 0f 94 39 92 call 0x32472 ; 0x32472 if (!printer_recovering()) { 188aa: 0e 94 b3 60 call 0xc166 ; 0xc166 188ae: 81 11 cpse r24, r1 188b0: 61 c0 rjmp .+194 ; 0x18974 } //return the nr of buffered moves FORCE_INLINE uint8_t moves_planned() { return (block_buffer_head + BLOCK_BUFFER_SIZE - block_buffer_tail) & (BLOCK_BUFFER_SIZE - 1); 188b2: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 188b6: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 188ba: 89 1b sub r24, r25 188bc: 8f 70 andi r24, 0x0F ; 15 if ( moves_planned() || printer_active() #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 188be: a9 f5 brne .+106 ; 0x1892a if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { if ( moves_planned() || printer_active() 188c0: 0e 94 19 61 call 0xc232 ; 0xc232 188c4: 81 11 cpse r24, r1 188c6: 31 c0 rjmp .+98 ; 0x1892a #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 188c8: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 188cc: 82 30 cpi r24, 0x02 ; 2 188ce: 69 f1 breq .+90 ; 0x1892a #endif //End FANCHECK ) { MENU_ITEM_SUBMENU_P(_T(MSG_TUNE), lcd_tune_menu); } else if (!Stopped) { 188d0: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 188d4: 81 11 cpse r24, r1 188d6: 31 c0 rjmp .+98 ; 0x1893a MENU_ITEM_SUBMENU_P(_T(MSG_PREHEAT), lcd_preheat_menu); 188d8: 85 ef ldi r24, 0xF5 ; 245 188da: 9c e3 ldi r25, 0x3C ; 60 188dc: 0e 94 b1 6c call 0xd962 ; 0xd962 188e0: 63 e7 ldi r22, 0x73 ; 115 188e2: 78 e3 ldi r23, 0x38 ; 56 188e4: 0f 94 ea 94 call 0x329d4 ; 0x329d4 if (M79_timer_get_status()) { 188e8: 80 91 5a 03 lds r24, 0x035A ; 0x80035a <_ZL9M79_timer.lto_priv.419> 188ec: 88 23 and r24, r24 188ee: 29 f1 breq .+74 ; 0x1893a #ifndef REPLACE_SETREADY if(GetPrinterState() == PrinterState::IsReady) { 188f0: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.367> 188f4: 81 30 cpi r24, 0x01 ; 1 188f6: 09 f0 breq .+2 ; 0x188fa 188f8: 45 c1 rjmp .+650 ; 0x18b84 MENU_ITEM_FUNCTION_P(_T(MSG_SET_NOT_READY), lcd_printer_ready_state_toggle); 188fa: 85 ee ldi r24, 0xE5 ; 229 188fc: 9c e3 ldi r25, 0x3C ; 60 } else { MENU_ITEM_FUNCTION_P(_T(MSG_SET_READY), lcd_printer_ready_state_toggle); 188fe: 0e 94 b1 6c call 0xd962 ; 0xd962 18902: 6a e9 ldi r22, 0x9A ; 154 18904: 71 eb ldi r23, 0xB1 ; 177 18906: 0f 94 39 92 call 0x32472 ; 0x32472 1890a: 17 c0 rjmp .+46 ; 0x1893a // Menu item for reprint if (!printer_active() && !printer_recovering() && (heating_status == HeatingStatus::NO_HEATING)) { if ((GetPrinterState() == PrinterState::SDPrintingFinished) && card.mounted) { MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_reprint_from_eeprom); } else if ((GetPrinterState() == PrinterState::HostPrintingFinished) && M79_timer_get_status()) { 1890c: 84 30 cpi r24, 0x04 ; 4 1890e: 09 f0 breq .+2 ; 0x18912 18910: ac cf rjmp .-168 ; 0x1886a 18912: 80 91 5a 03 lds r24, 0x035A ; 0x80035a <_ZL9M79_timer.lto_priv.419> 18916: 88 23 and r24, r24 18918: 09 f4 brne .+2 ; 0x1891c 1891a: a7 cf rjmp .-178 ; 0x1886a MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 1891c: 86 e1 ldi r24, 0x16 ; 22 1891e: 9d e3 ldi r25, 0x3D ; 61 18920: 0e 94 b1 6c call 0xd962 ; 0xd962 18924: 64 e9 ldi r22, 0x94 ; 148 18926: 71 eb ldi r23, 0xB1 ; 177 18928: 9e cf rjmp .-196 ; 0x18866 if ( moves_planned() || printer_active() #ifdef FANCHECK || fan_check_error == EFCE_REPORTED #endif //End FANCHECK ) { MENU_ITEM_SUBMENU_P(_T(MSG_TUNE), lcd_tune_menu); 1892a: 8f ef ldi r24, 0xFF ; 255 1892c: 9c e3 ldi r25, 0x3C ; 60 1892e: 0e 94 b1 6c call 0xd962 ; 0xd962 18932: 67 e9 ldi r22, 0x97 ; 151 18934: 76 eb ldi r23, 0xB6 ; 182 18936: 0f 94 ea 94 call 0x329d4 ; 0x329d4 #else MENU_ITEM_FUNCTION_P(_T(MSG_HOSTPRINT), lcd_send_action_start); #endif //REPLACE_SETREADY } } if (mesh_bed_leveling_flag == false && homing_flag == false && !printingIsPaused() && !processing_tcode) { 1893a: c0 91 06 12 lds r28, 0x1206 ; 0x801206 1893e: 0e 94 bd 60 call 0xc17a ; 0xc17a 18942: c1 11 cpse r28, r1 18944: 17 c0 rjmp .+46 ; 0x18974 18946: 90 91 05 12 lds r25, 0x1205 ; 0x801205 1894a: 91 11 cpse r25, r1 1894c: 13 c0 rjmp .+38 ; 0x18974 1894e: 81 11 cpse r24, r1 18950: 15 c0 rjmp .+42 ; 0x1897c 18952: 80 91 5f 03 lds r24, 0x035F ; 0x80035f 18956: 81 11 cpse r24, r1 18958: 0d c0 rjmp .+26 ; 0x18974 if (usb_timer.running()) { 1895a: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 1895e: 88 23 and r24, r24 18960: 09 f4 brne .+2 ; 0x18964 18962: 13 c1 rjmp .+550 ; 0x18b8a MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print); 18964: 8b ec ldi r24, 0xCB ; 203 18966: 9c e3 ldi r25, 0x3C ; 60 18968: 0e 94 b1 6c call 0xd962 ; 0xd962 1896c: 63 e2 ldi r22, 0x23 ; 35 1896e: 77 e3 ldi r23, 0x37 ; 55 } else if (IS_SD_PRINTING) { MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 18970: 0f 94 39 92 call 0x32472 ; 0x32472 } } } if (printingIsPaused() 18974: 0e 94 bd 60 call 0xc17a ; 0xc17a && !get_temp_error() #ifdef FANCHECK && fan_check_error != EFCE_REPORTED #endif //FANCHECK && (saved_printing_type != PowerPanic::PRINT_TYPE_NONE || saved_printing) && custom_message_type != CustomMsg::Resuming) { 18978: 88 23 and r24, r24 1897a: f1 f0 breq .+60 ; 0x189b8 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 1897c: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> } } } if (printingIsPaused() // only allow resuming if hardware errors (temperature or fan) are cleared && !get_temp_error() 18980: 81 11 cpse r24, r1 18982: 1a c0 rjmp .+52 ; 0x189b8 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 18984: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 18988: 82 30 cpi r24, 0x02 ; 2 1898a: b1 f0 breq .+44 ; 0x189b8 #endif //FANCHECK && (saved_printing_type != PowerPanic::PRINT_TYPE_NONE || saved_printing) 1898c: 80 91 79 02 lds r24, 0x0279 ; 0x800279 18990: 82 30 cpi r24, 0x02 ; 2 18992: 21 f4 brne .+8 ; 0x1899c 18994: 90 91 e7 11 lds r25, 0x11E7 ; 0x8011e7 18998: 99 23 and r25, r25 1899a: 71 f0 breq .+28 ; 0x189b8 && custom_message_type != CustomMsg::Resuming) { 1899c: 90 91 c7 06 lds r25, 0x06C7 ; 0x8006c7 189a0: 98 30 cpi r25, 0x08 ; 8 189a2: 51 f0 breq .+20 ; 0x189b8 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { 189a4: 81 11 cpse r24, r1 189a6: fd c0 rjmp .+506 ; 0x18ba2 MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print); 189a8: 8c eb ldi r24, 0xBC ; 188 189aa: 9c e3 ldi r25, 0x3C ; 60 189ac: 0e 94 b1 6c call 0xd962 ; 0xd962 189b0: 62 e5 ldi r22, 0x52 ; 82 189b2: 7f ee ldi r23, 0xEF ; 239 } else if ((saved_printing_type == PowerPanic::PRINT_TYPE_HOST) && (M79_timer_get_status())) { MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print); 189b4: 0f 94 ea 94 call 0x329d4 ; 0x329d4 } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) 189b8: 0e 94 c8 60 call 0xc190 ; 0xc190 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 189bc: 81 11 cpse r24, r1 189be: 08 c0 rjmp .+16 ; 0x189d0 MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print); } else if ((saved_printing_type == PowerPanic::PRINT_TYPE_HOST) && (M79_timer_get_status())) { MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print); } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) 189c0: 0e 94 bd 60 call 0xc17a ; 0xc17a 189c4: 81 11 cpse r24, r1 189c6: 04 c0 rjmp .+8 ; 0x189d0 189c8: 0e 94 b3 60 call 0xc166 ; 0xc166 189cc: 88 23 and r24, r24 189ce: 81 f0 breq .+32 ; 0x189f0 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 189d0: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 189d4: 81 30 cpi r24, 0x01 ; 1 189d6: 61 f0 breq .+24 ; 0x189f0 189d8: 80 91 5f 03 lds r24, 0x035F ; 0x80035f 189dc: 81 11 cpse r24, r1 189de: 08 c0 rjmp .+16 ; 0x189f0 MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); 189e0: 8d eb ldi r24, 0xBD ; 189 189e2: 9d e3 ldi r25, 0x3D ; 61 189e4: 0e 94 b1 6c call 0xd962 ; 0xd962 189e8: 6f e7 ldi r22, 0x7F ; 127 189ea: 74 eb ldi r23, 0xB4 ; 180 189ec: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); } #endif // only allow starting SD print if hardware errors (temperature or fan) are cleared if (!printer_recovering() && !printer_active() && !get_temp_error() 189f0: 0e 94 b3 60 call 0xc166 ; 0xc166 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 189f4: 81 11 cpse r24, r1 189f6: 95 c0 rjmp .+298 ; 0x18b22 MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); } #endif // only allow starting SD print if hardware errors (temperature or fan) are cleared if (!printer_recovering() && !printer_active() && !get_temp_error() 189f8: 0e 94 19 61 call 0xc232 ; 0xc232 189fc: 81 11 cpse r24, r1 189fe: 91 c0 rjmp .+290 ; 0x18b22 18a00: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 18a04: 81 11 cpse r24, r1 18a06: 8d c0 rjmp .+282 ; 0x18b22 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 18a08: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 18a0c: 82 30 cpi r24, 0x02 ; 2 18a0e: 09 f4 brne .+2 ; 0x18a12 18a10: 88 c0 rjmp .+272 ; 0x18b22 #endif //FANCHECK ) { #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code if (card.mounted 18a12: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 18a16: 81 11 cpse r24, r1 18a18: 05 c0 rjmp .+10 ; 0x18a24 || lcd_commands_type != LcdCommands::Idle) { 18a1a: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 18a1e: 88 23 and r24, r24 18a20: 09 f4 brne .+2 ; 0x18a24 18a22: ce c0 rjmp .+412 ; 0x18bc0 if (!card.isFileOpen()) { 18a24: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 18a28: 81 11 cpse r24, r1 18a2a: 12 c0 rjmp .+36 ; 0x18a50 if (!usb_timer.running() && (lcd_commands_type == LcdCommands::Idle)) { 18a2c: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 18a30: 81 11 cpse r24, r1 18a32: 0e c0 rjmp .+28 ; 0x18a50 18a34: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 18a38: 81 11 cpse r24, r1 18a3a: 0a c0 rjmp .+20 ; 0x18a50 bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function 18a3c: d0 93 97 03 sts 0x0397, r29 ; 0x800397 MENU_ITEM_SUBMENU_P(_T(MSG_CARD_MENU), lcd_sdcard_menu); 18a40: 8c ea ldi r24, 0xAC ; 172 18a42: 9c e3 ldi r25, 0x3C ; 60 18a44: 0e 94 b1 6c call 0xd962 ; 0xd962 18a48: 6c e2 ldi r22, 0x2C ; 44 18a4a: 7c ee ldi r23, 0xEC ; 236 18a4c: 0f 94 ea 94 call 0x329d4 ; 0x329d4 #if SDCARDDETECT < 1 MENU_ITEM_GCODE_P(_T(MSG_INIT_SDCARD), PSTR("M21")); // Manually initialize the SD-card via user interface #endif //SDCARDDETECT } #endif //SDSUPPORT if(!farm_mode) { 18a50: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 18a54: 81 11 cpse r24, r1 18a56: 12 c0 rjmp .+36 ; 0x18a7c const int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 18a58: 81 ea ldi r24, 0xA1 ; 161 18a5a: 9d e0 ldi r25, 0x0D ; 13 18a5c: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 18a60: c8 2f mov r28, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); 18a62: 0e 94 26 6f call 0xde4c ; 0xde4c if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized 18a66: 87 fd sbrc r24, 7 18a68: 09 c0 rjmp .+18 ; 0x18a7c 18a6a: c8 17 cp r28, r24 18a6c: 39 f0 breq .+14 ; 0x18a7c MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); 18a6e: c1 02 muls r28, r17 18a70: c0 01 movw r24, r0 18a72: 11 24 eor r1, r1 18a74: 87 5b subi r24, 0xB7 ; 183 18a76: 92 4f sbci r25, 0xF2 ; 242 18a78: 0e 94 86 b2 call 0x1650c ; 0x1650c SETTINGS_NOZZLE; #endif //QUICK_NOZZLE_CHANGE } if (!((eFilamentAction != FilamentAction::None) || Stopped )) { 18a7c: 80 91 62 03 lds r24, 0x0362 ; 0x800362 18a80: 81 11 cpse r24, r1 18a82: 4f c0 rjmp .+158 ; 0x18b22 18a84: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 18a88: 81 11 cpse r24, r1 18a8a: 4b c0 rjmp .+150 ; 0x18b22 if (MMU2::mmu2.Enabled()) { 18a8c: 80 91 94 12 lds r24, 0x1294 ; 0x801294 18a90: 81 30 cpi r24, 0x01 ; 1 18a92: 09 f0 breq .+2 ; 0x18a96 18a94: 9e c0 rjmp .+316 ; 0x18bd2 if(!MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) { 18a96: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 18a9a: 81 11 cpse r24, r1 18a9c: 0c c0 rjmp .+24 ; 0x18ab6 18a9e: 0e 94 fc c3 call 0x187f8 ; 0x187f8 18aa2: 81 11 cpse r24, r1 18aa4: 08 c0 rjmp .+16 ; 0x18ab6 // The MMU 'Load filament' state machine will reject the command if any // filament sensor is reporting a detected filament MENU_ITEM_SUBMENU_P(_T(MSG_PRELOAD_TO_MMU), mmu_preload_filament_menu); 18aa6: 8e e8 ldi r24, 0x8E ; 142 18aa8: 9c e3 ldi r25, 0x3C ; 60 18aaa: 0e 94 b1 6c call 0xd962 ; 0xd962 18aae: 63 e9 ldi r22, 0x93 ; 147 18ab0: 7b eb ldi r23, 0xBB ; 187 18ab2: 0f 94 ea 94 call 0x329d4 ; 0x329d4 } MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_TO_NOZZLE), lcd_mmuLoadFilament); 18ab6: 8d e7 ldi r24, 0x7D ; 125 18ab8: 9c e3 ldi r25, 0x3C ; 60 18aba: 0e 94 b1 6c call 0xd962 ; 0xd962 18abe: 6a ec ldi r22, 0xCA ; 202 18ac0: 7b eb ldi r23, 0xBB ; 187 18ac2: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_mmuUnloadFilament); 18ac6: 8b e6 ldi r24, 0x6B ; 107 18ac8: 9c e3 ldi r25, 0x3C ; 60 18aca: 0e 94 b1 6c call 0xd962 ; 0xd962 18ace: 6d ec ldi r22, 0xCD ; 205 18ad0: 7b eb ldi r23, 0xBB ; 187 18ad2: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(_T(MSG_EJECT_FROM_MMU), lcd_mmuEjectFilament); 18ad6: 81 ef ldi r24, 0xF1 ; 241 18ad8: 99 e5 ldi r25, 0x59 ; 89 18ada: 0e 94 b1 6c call 0xd962 ; 0xd962 18ade: 60 ed ldi r22, 0xD0 ; 208 18ae0: 7b eb ldi r23, 0xBB ; 187 18ae2: 0f 94 ea 94 call 0x329d4 ; 0x329d4 #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0) { 18ae6: 8e ec ldi r24, 0xCE ; 206 18ae8: 9e e0 ldi r25, 0x0E ; 14 18aea: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 18aee: 88 23 and r24, r24 18af0: 41 f0 breq .+16 ; 0x18b02 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); 18af2: 82 ee ldi r24, 0xE2 ; 226 18af4: 99 e5 ldi r25, 0x59 ; 89 18af6: 0e 94 b1 6c call 0xd962 ; 0xd962 18afa: 63 ed ldi r22, 0xD3 ; 211 18afc: 7b eb ldi r23, 0xBB ; 187 } #endif //REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY } else { #endif //FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); 18afe: 0f 94 ea 94 call 0x329d4 ; 0x329d4 #ifdef FILAMENT_SENSOR } #endif //FILAMENT_SENSOR } MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); 18b02: 87 ea ldi r24, 0xA7 ; 167 18b04: 9d e3 ldi r25, 0x3D ; 61 18b06: 0e 94 b1 6c call 0xd962 ; 0xd962 18b0a: 65 e5 ldi r22, 0x55 ; 85 18b0c: 77 eb ldi r23, 0xB7 ; 183 18b0e: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(_T(MSG_CALIBRATION), lcd_calibration_menu); 18b12: 89 e3 ldi r24, 0x39 ; 57 18b14: 9c e3 ldi r25, 0x3C ; 60 18b16: 0e 94 b1 6c call 0xd962 ; 0xd962 18b1a: 61 eb ldi r22, 0xB1 ; 177 18b1c: 78 eb ldi r23, 0xB8 ; 184 18b1e: 0f 94 ea 94 call 0x329d4 ; 0x329d4 } } MENU_ITEM_SUBMENU_P(_T(MSG_STATISTICS), lcd_menu_statistics); 18b22: 8c e2 ldi r24, 0x2C ; 44 18b24: 9c e3 ldi r25, 0x3C ; 60 18b26: 0e 94 b1 6c call 0xd962 ; 0xd962 18b2a: 67 e8 ldi r22, 0x87 ; 135 18b2c: 78 e3 ldi r23, 0x38 ; 56 18b2e: 0f 94 ea 94 call 0x329d4 ; 0x329d4 #if defined(TMC2130) || defined(FILAMENT_SENSOR) MENU_ITEM_SUBMENU_P(_T(MSG_FAIL_STATS), lcd_menu_fails_stats); 18b32: 8f e1 ldi r24, 0x1F ; 31 18b34: 9c e3 ldi r25, 0x3C ; 60 18b36: 0e 94 b1 6c call 0xd962 ; 0xd962 18b3a: 6b eb ldi r22, 0xBB ; 187 18b3c: 76 e3 ldi r23, 0x36 ; 54 18b3e: 0f 94 ea 94 call 0x329d4 ; 0x329d4 #endif if (MMU2::mmu2.Enabled()) { 18b42: 80 91 94 12 lds r24, 0x1294 ; 0x801294 18b46: 81 30 cpi r24, 0x01 ; 1 18b48: 41 f4 brne .+16 ; 0x18b5a MENU_ITEM_SUBMENU_P(_T(MSG_MMU_FAIL_STATS), lcd_menu_fails_stats_mmu); 18b4a: 8e e0 ldi r24, 0x0E ; 14 18b4c: 9c e3 ldi r25, 0x3C ; 60 18b4e: 0e 94 b1 6c call 0xd962 ; 0xd962 18b52: 6c ea ldi r22, 0xAC ; 172 18b54: 7e ef ldi r23, 0xFE ; 254 18b56: 0f 94 ea 94 call 0x329d4 ; 0x329d4 if (!printer_active() && M79_timer_get_status()) { MENU_ITEM_FUNCTION_P(_T(MSG_SHUTDOWN_HOST), lcd_shutdown_menu); } #endif //HOST_SHUTOWN MENU_ITEM_SUBMENU_P(_T(MSG_SUPPORT), lcd_support_menu); 18b5a: 84 e0 ldi r24, 0x04 ; 4 18b5c: 9c e3 ldi r25, 0x3C ; 60 18b5e: 0e 94 b1 6c call 0xd962 ; 0xd962 18b62: 6d e3 ldi r22, 0x3D ; 61 18b64: 78 e3 ldi r23, 0x38 ; 56 18b66: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_END(); 18b6a: 0f 94 90 92 call 0x32520 ; 0x32520 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 18b6e: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 18b72: 8f 5f subi r24, 0xFF ; 255 18b74: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 18b78: 80 91 30 04 lds r24, 0x0430 ; 0x800430 18b7c: 8f 5f subi r24, 0xFF ; 255 18b7e: 80 93 30 04 sts 0x0430, r24 ; 0x800430 18b82: 49 ce rjmp .-878 ; 0x18816 if (M79_timer_get_status()) { #ifndef REPLACE_SETREADY if(GetPrinterState() == PrinterState::IsReady) { MENU_ITEM_FUNCTION_P(_T(MSG_SET_NOT_READY), lcd_printer_ready_state_toggle); } else { MENU_ITEM_FUNCTION_P(_T(MSG_SET_READY), lcd_printer_ready_state_toggle); 18b84: 89 ed ldi r24, 0xD9 ; 217 18b86: 9c e3 ldi r25, 0x3C ; 60 18b88: ba ce rjmp .-652 ; 0x188fe } } if (mesh_bed_leveling_flag == false && homing_flag == false && !printingIsPaused() && !processing_tcode) { if (usb_timer.running()) { MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print); } else if (IS_SD_PRINTING) { 18b8a: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 18b8e: 88 23 and r24, r24 18b90: 09 f4 brne .+2 ; 0x18b94 18b92: f0 ce rjmp .-544 ; 0x18974 MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 18b94: 8b ec ldi r24, 0xCB ; 203 18b96: 9c e3 ldi r25, 0x3C ; 60 18b98: 0e 94 b1 6c call 0xd962 ; 0xd962 18b9c: 65 e4 ldi r22, 0x45 ; 69 18b9e: 78 e3 ldi r23, 0x38 ; 56 18ba0: e7 ce rjmp .-562 ; 0x18970 #endif //FANCHECK && (saved_printing_type != PowerPanic::PRINT_TYPE_NONE || saved_printing) && custom_message_type != CustomMsg::Resuming) { if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print); } else if ((saved_printing_type == PowerPanic::PRINT_TYPE_HOST) && (M79_timer_get_status())) { 18ba2: 81 30 cpi r24, 0x01 ; 1 18ba4: 09 f0 breq .+2 ; 0x18ba8 18ba6: 08 cf rjmp .-496 ; 0x189b8 18ba8: 80 91 5a 03 lds r24, 0x035A ; 0x80035a <_ZL9M79_timer.lto_priv.419> 18bac: 88 23 and r24, r24 18bae: 09 f4 brne .+2 ; 0x18bb2 18bb0: 03 cf rjmp .-506 ; 0x189b8 MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print); 18bb2: 8c eb ldi r24, 0xBC ; 188 18bb4: 9c e3 ldi r25, 0x3C ; 60 18bb6: 0e 94 b1 6c call 0xd962 ; 0xd962 18bba: 6c e5 ldi r22, 0x5C ; 92 18bbc: 76 ee ldi r23, 0xE6 ; 230 18bbe: fa ce rjmp .-524 ; 0x189b4 #if SDCARDDETECT < 1 MENU_ITEM_GCODE_P(_T(MSG_CNG_SDCARD), PSTR("M21")); // SD-card changed by user #endif //SDCARDDETECT } } else { bMain=true; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function 18bc0: d0 93 97 03 sts 0x0397, r29 ; 0x800397 MENU_ITEM_BACK_P(_T(MSG_NO_CARD)); 18bc4: 8f e9 ldi r24, 0x9F ; 159 18bc6: 9c e3 ldi r25, 0x3C ; 60 18bc8: 0e 94 b1 6c call 0xd962 ; 0xd962 18bcc: 0f 94 87 95 call 0x32b0e ; 0x32b0e 18bd0: 3f cf rjmp .-386 ; 0x18a50 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); } #endif //MMU_HAS_CUTTER } else { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled()) { 18bd2: 80 91 84 16 lds r24, 0x1684 ; 0x801684 18bd6: 88 23 and r24, r24 18bd8: 19 f1 breq .+70 ; 0x18c20 if (!fsensor.getAutoLoadEnabled()) { 18bda: 80 91 85 16 lds r24, 0x1685 ; 0x801685 18bde: 81 11 cpse r24, r1 18be0: 08 c0 rjmp .+16 ; 0x18bf2 MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 18be2: 8b e5 ldi r24, 0x5B ; 91 18be4: 9c e3 ldi r25, 0x3C ; 60 18be6: 0e 94 b1 6c call 0xd962 ; 0xd962 18bea: 61 e1 ldi r22, 0x11 ; 17 18bec: 77 e3 ldi r23, 0x37 ; 55 18bee: 0f 94 ea 94 call 0x329d4 ; 0x329d4 } if (fsensor.getFilamentPresent()) { 18bf2: 0e 94 fc c3 call 0x187f8 ; 0x187f8 18bf6: 88 23 and r24, r24 18bf8: 39 f0 breq .+14 ; 0x18c08 } #endif //REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY } else { #endif //FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); 18bfa: 8b e6 ldi r24, 0x6B ; 107 18bfc: 9c e3 ldi r25, 0x3C ; 60 18bfe: 0e 94 b1 6c call 0xd962 ; 0xd962 18c02: 63 e9 ldi r22, 0x93 ; 147 18c04: 77 e3 ldi r23, 0x37 ; 55 18c06: 7b cf rjmp .-266 ; 0x18afe if (fsensor.getFilamentPresent()) { MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); } #ifndef REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY else { if (fsensor.getAutoLoadEnabled()) { 18c08: 80 91 85 16 lds r24, 0x1685 ; 0x801685 18c0c: 88 23 and r24, r24 18c0e: 09 f4 brne .+2 ; 0x18c12 18c10: 78 cf rjmp .-272 ; 0x18b02 MENU_ITEM_SUBMENU_P(_T(MSG_AUTOLOAD_FILAMENT), lcd_menu_AutoLoadFilament); 18c12: 87 e4 ldi r24, 0x47 ; 71 18c14: 9c e3 ldi r25, 0x3C ; 60 18c16: 0e 94 b1 6c call 0xd962 ; 0xd962 18c1a: 61 ed ldi r22, 0xD1 ; 209 18c1c: 76 e3 ldi r23, 0x36 ; 54 18c1e: 6f cf rjmp .-290 ; 0x18afe } } #endif //REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY } else { #endif //FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 18c20: 8b e5 ldi r24, 0x5B ; 91 18c22: 9c e3 ldi r25, 0x3C ; 60 18c24: 0e 94 b1 6c call 0xd962 ; 0xd962 18c28: 61 e1 ldi r22, 0x11 ; 17 18c2a: 77 e3 ldi r23, 0x37 ; 55 18c2c: 0f 94 ea 94 call 0x329d4 ; 0x329d4 18c30: e4 cf rjmp .-56 ; 0x18bfa #endif //HOST_SHUTOWN MENU_ITEM_SUBMENU_P(_T(MSG_SUPPORT), lcd_support_menu); MENU_END(); } 18c32: df 91 pop r29 18c34: cf 91 pop r28 18c36: 1f 91 pop r17 18c38: 08 95 ret 00018c3a : } static void nozzle_change() { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled() && fsensor.getFilamentPresent()) { 18c3a: 80 91 84 16 lds r24, 0x1684 ; 0x801684 18c3e: 88 23 and r24, r24 18c40: 61 f0 breq .+24 ; 0x18c5a 18c42: 0e 94 fc c3 call 0x187f8 ; 0x187f8 18c46: 88 23 and r24, r24 18c48: 41 f0 breq .+16 ; 0x18c5a lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); 18c4a: 8e ef ldi r24, 0xFE ; 254 18c4c: 99 e3 ldi r25, 0x39 ; 57 18c4e: 0e 94 b1 6c call 0xd962 ; 0xd962 18c52: 0f 94 47 0b call 0x2168e ; 0x2168e lcd_return_to_status(); return; } #endif //FILAMENT_SENSOR lcd_commands_type = LcdCommands::NozzleCNG; lcd_return_to_status(); 18c56: 0c 94 17 fe jmp 0x1fc2e ; 0x1fc2e lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); lcd_return_to_status(); return; } #endif //FILAMENT_SENSOR lcd_commands_type = LcdCommands::NozzleCNG; 18c5a: 85 e0 ldi r24, 0x05 ; 5 18c5c: 80 93 c8 0d sts 0x0DC8, r24 ; 0x800dc8 18c60: fa cf rjmp .-12 ; 0x18c56 00018c62 : status |= components; eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } void calibration_status_clear(CalibrationStatus components) { 18c62: cf 93 push r28 18c64: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 18c66: 86 ea ldi r24, 0xA6 ; 166 18c68: 9c e0 ldi r25, 0x0C ; 12 18c6a: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 status &= ~components; 18c6e: c0 95 com r28 18c70: 6c 2f mov r22, r28 18c72: 68 23 and r22, r24 18c74: 86 ea ldi r24, 0xA6 ; 166 18c76: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 18c78: cf 91 pop r28 18c7a: 0d 94 00 a0 jmp 0x34000 ; 0x34000 00018c7e : } } } static void lcd_reset_sheet() { 18c7e: 1f 93 push r17 18c80: cf 93 push r28 18c82: df 93 push r29 18c84: 00 d0 rcall .+0 ; 0x18c86 18c86: 00 d0 rcall .+0 ; 0x18c88 18c88: 1f 92 push r1 18c8a: 1f 92 push r1 18c8c: cd b7 in r28, 0x3d ; 61 18c8e: de b7 in r29, 0x3e ; 62 SheetName sheetName; eeprom_default_sheet_name(selected_sheet, sheetName); 18c90: be 01 movw r22, r28 18c92: 6f 5f subi r22, 0xFF ; 255 18c94: 7f 4f sbci r23, 0xFF ; 255 18c96: 80 91 98 03 lds r24, 0x0398 ; 0x800398 18c9a: 0e 94 48 6f call 0xde90 ; 0xde90 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[selected_sheet].z_offset)),EEPROM_EMPTY_VALUE16); 18c9e: 80 91 98 03 lds r24, 0x0398 ; 0x800398 18ca2: 1b e0 ldi r17, 0x0B ; 11 18ca4: 81 9f mul r24, r17 18ca6: c0 01 movw r24, r0 18ca8: 11 24 eor r1, r1 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 18caa: 6f ef ldi r22, 0xFF ; 255 18cac: 7f ef ldi r23, 0xFF ; 255 18cae: 80 5b subi r24, 0xB0 ; 176 18cb0: 92 4f sbci r25, 0xF2 ; 242 18cb2: 0f 94 1e a0 call 0x3403c ; 0x3403c eeprom_update_block_notify(sheetName.c,EEPROM_Sheets_base->s[selected_sheet].name,sizeof(Sheet::name)); 18cb6: 60 91 98 03 lds r22, 0x0398 ; 0x800398 18cba: 61 9f mul r22, r17 18cbc: b0 01 movw r22, r0 18cbe: 11 24 eor r1, r1 18cc0: 67 5b subi r22, 0xB7 ; 183 18cc2: 72 4f sbci r23, 0xF2 ; 242 #endif //DEBUG_EEPROM_CHANGES } #ifndef DEBUG_EEPROM_CHANGES void eeprom_update_block_notify(const void *__src, void *__dst, size_t __n){ eeprom_update_block(__src, __dst, __n); 18cc4: 47 e0 ldi r20, 0x07 ; 7 18cc6: 50 e0 ldi r21, 0x00 ; 0 18cc8: ce 01 movw r24, r28 18cca: 01 96 adiw r24, 0x01 ; 1 18ccc: 0f 94 f0 9f call 0x33fe0 ; 0x33fe0 if (selected_sheet == eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) 18cd0: 81 ea ldi r24, 0xA1 ; 161 18cd2: 9d e0 ldi r25, 0x0D ; 13 18cd4: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 18cd8: 90 91 98 03 lds r25, 0x0398 ; 0x800398 18cdc: 89 13 cpse r24, r25 18cde: 0a c0 rjmp .+20 ; 0x18cf4 { eeprom_switch_to_next_sheet(); 18ce0: 0e 94 3a 6f call 0xde74 ; 0xde74 if (-1 == eeprom_next_initialized_sheet(0)) 18ce4: 80 e0 ldi r24, 0x00 ; 0 18ce6: 0e 94 26 6f call 0xde4c ; 0xde4c 18cea: 8f 3f cpi r24, 0xFF ; 255 18cec: 19 f4 brne .+6 ; 0x18cf4 calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 18cee: 80 e1 ldi r24, 0x10 ; 16 18cf0: 0e 94 31 c6 call 0x18c62 ; 0x18c62 } menu_back(); 18cf4: 0f 94 84 95 call 0x32b08 ; 0x32b08 } 18cf8: 28 96 adiw r28, 0x08 ; 8 18cfa: 0f b6 in r0, 0x3f ; 63 18cfc: f8 94 cli 18cfe: de bf out 0x3e, r29 ; 62 18d00: 0f be out 0x3f, r0 ; 63 18d02: cd bf out 0x3d, r28 ; 61 18d04: df 91 pop r29 18d06: cf 91 pop r28 18d08: 1f 91 pop r17 18d0a: 08 95 ret 00018d0c : CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); return ((status & components) == components); } void calibration_status_set(CalibrationStatus components) { 18d0c: cf 93 push r28 18d0e: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 18d10: 86 ea ldi r24, 0xA6 ; 166 18d12: 9c e0 ldi r25, 0x0C ; 12 18d14: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 status |= components; 18d18: 68 2f mov r22, r24 18d1a: 6c 2b or r22, r28 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 18d1c: 86 ea ldi r24, 0xA6 ; 166 18d1e: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 18d20: cf 91 pop r28 18d22: 0d 94 00 a0 jmp 0x34000 ; 0x34000 00018d26 : //! @brief Calibrate XYZ //! @param onlyZ if true, calibrate only Z axis //! @param verbosity_level //! @retval true Succeeded //! @retval false Failed bool gcode_M45(bool onlyZ, int8_t verbosity_level) 18d26: 2f 92 push r2 18d28: 3f 92 push r3 18d2a: 4f 92 push r4 18d2c: 5f 92 push r5 18d2e: 6f 92 push r6 18d30: 7f 92 push r7 18d32: 8f 92 push r8 18d34: 9f 92 push r9 18d36: af 92 push r10 18d38: bf 92 push r11 18d3a: cf 92 push r12 18d3c: df 92 push r13 18d3e: ef 92 push r14 18d40: ff 92 push r15 18d42: 0f 93 push r16 18d44: 1f 93 push r17 18d46: cf 93 push r28 18d48: df 93 push r29 18d4a: cd b7 in r28, 0x3d ; 61 18d4c: de b7 in r29, 0x3e ; 62 18d4e: ce 5c subi r28, 0xCE ; 206 18d50: d1 09 sbc r29, r1 18d52: 0f b6 in r0, 0x3f ; 63 18d54: f8 94 cli 18d56: de bf out 0x3e, r29 ; 62 18d58: 0f be out 0x3f, r0 ; 63 18d5a: cd bf out 0x3d, r28 ; 61 18d5c: 18 2f mov r17, r24 #endif // TMC2130 FORCE_BL_ON_START; // Only Z calibration? if (!onlyZ) 18d5e: 81 11 cpse r24, r1 18d60: 04 c0 rjmp .+8 ; 0x18d6a { disable_heater(); 18d62: 0f 94 5f 12 call 0x224be ; 0x224be eeprom_adjust_bed_reset(); //reset bed level correction 18d66: 0e 94 6f 6f call 0xdede ; 0xdede } // Disable the default update procedure of the display. We will do a modal dialog. lcd_update_enable(false); 18d6a: 80 e0 ldi r24, 0x00 ; 0 18d6c: 0e 94 c0 69 call 0xd380 ; 0xd380 // Let the planner use the uncorrected coordinates. mbl.reset(); 18d70: 0f 94 f1 55 call 0x2abe2 ; 0x2abe2 // Reset world2machine_rotation_and_skew and world2machine_shift, therefore // the planner will not perform any adjustments in the XY plane. // Wait for the motors to stop and update the current position with the absolute values. world2machine_revert_to_uncorrected(); 18d74: 0f 94 5c 8f call 0x31eb8 ; 0x31eb8 babystepLoadZ = 0; } void babystep_reset() { babystepLoadZ = 0; 18d78: 10 92 2a 05 sts 0x052A, r1 ; 0x80052a <_ZL13babystepLoadZ.lto_priv.459+0x1> 18d7c: 10 92 29 05 sts 0x0529, r1 ; 0x800529 <_ZL13babystepLoadZ.lto_priv.459> // Reset the baby step value applied without moving the axes. babystep_reset(); // Mark all axes as in a need for homing. memset(axis_known_position, 0, sizeof(axis_known_position)); 18d80: e3 ea ldi r30, 0xA3 ; 163 18d82: f6 e0 ldi r31, 0x06 ; 6 18d84: 83 e0 ldi r24, 0x03 ; 3 18d86: df 01 movw r26, r30 18d88: 1d 92 st X+, r1 18d8a: 8a 95 dec r24 18d8c: e9 f7 brne .-6 ; 0x18d88 // Home in the XY plane. //set_destination_to_current(); int l_feedmultiply = setup_for_endstop_move(); 18d8e: 81 e0 ldi r24, 0x01 ; 1 18d90: 0e 94 ee 5f call 0xbfdc ; 0xbfdc 18d94: c7 55 subi r28, 0x57 ; 87 18d96: df 4f sbci r29, 0xFF ; 255 18d98: 99 83 std Y+1, r25 ; 0x01 18d9a: 88 83 st Y, r24 18d9c: c9 5a subi r28, 0xA9 ; 169 18d9e: d0 40 sbci r29, 0x00 ; 0 lcd_display_message_fullscreen_P(_T(MSG_AUTO_HOME)); 18da0: 80 e4 ldi r24, 0x40 ; 64 18da2: 98 e4 ldi r25, 0x48 ; 72 18da4: 0e 94 b1 6c call 0xd962 ; 0xd962 18da8: 0f 94 c0 0a call 0x21580 ; 0x21580 raise_z_above(MESH_HOME_Z_SEARCH); 18dac: 60 e0 ldi r22, 0x00 ; 0 18dae: 70 e0 ldi r23, 0x00 ; 0 18db0: 80 ea ldi r24, 0xA0 ; 160 18db2: 90 e4 ldi r25, 0x40 ; 64 18db4: 0e 94 3f 67 call 0xce7e ; 0xce7e } /**/ void home_xy() { set_destination_to_current(); 18db8: 0e 94 36 61 call 0xc26c ; 0xc26c homeaxis(X_AXIS); 18dbc: 80 e0 ldi r24, 0x00 ; 0 18dbe: 0f 94 bc 53 call 0x2a778 ; 0x2a778 homeaxis(Y_AXIS); 18dc2: 81 e0 ldi r24, 0x01 ; 1 18dc4: 0f 94 bc 53 call 0x2a778 ; 0x2a778 plan_set_position_curposXYZE(); 18dc8: 0f 94 30 83 call 0x30660 ; 0x30660 endstops_hit_on_purpose(); 18dcc: 0f 94 96 2c call 0x2592c ; 0x2592c 18dd0: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.364> lcd_display_message_fullscreen_P(_T(MSG_AUTO_HOME)); raise_z_above(MESH_HOME_Z_SEARCH); home_xy(); enable_endstops(false); current_position[X_AXIS] += 5; 18dd4: 20 e0 ldi r18, 0x00 ; 0 18dd6: 30 e0 ldi r19, 0x00 ; 0 18dd8: 40 ea ldi r20, 0xA0 ; 160 18dda: 50 e4 ldi r21, 0x40 ; 64 18ddc: 60 91 f5 11 lds r22, 0x11F5 ; 0x8011f5 18de0: 70 91 f6 11 lds r23, 0x11F6 ; 0x8011f6 18de4: 80 91 f7 11 lds r24, 0x11F7 ; 0x8011f7 18de8: 90 91 f8 11 lds r25, 0x11F8 ; 0x8011f8 18dec: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 18df0: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 18df4: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 18df8: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 18dfc: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 current_position[Y_AXIS] += 5; 18e00: 20 e0 ldi r18, 0x00 ; 0 18e02: 30 e0 ldi r19, 0x00 ; 0 18e04: 40 ea ldi r20, 0xA0 ; 160 18e06: 50 e4 ldi r21, 0x40 ; 64 18e08: 60 91 f9 11 lds r22, 0x11F9 ; 0x8011f9 18e0c: 70 91 fa 11 lds r23, 0x11FA ; 0x8011fa 18e10: 80 91 fb 11 lds r24, 0x11FB ; 0x8011fb 18e14: 90 91 fc 11 lds r25, 0x11FC ; 0x8011fc 18e18: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 18e1c: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 18e20: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 18e24: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 18e28: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 18e2c: 60 e0 ldi r22, 0x00 ; 0 18e2e: 70 e0 ldi r23, 0x00 ; 0 18e30: 80 ea ldi r24, 0xA0 ; 160 18e32: 91 e4 ldi r25, 0x41 ; 65 18e34: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 18e38: 0f 94 42 22 call 0x24484 ; 0x24484 // Let the user move the Z axes up to the end stoppers. #ifdef TMC2130 if (calibrate_z_auto()) { #else //TMC2130 if (lcd_calibrate_z_end_stop_manual(onlyZ)) 18e3c: 81 2f mov r24, r17 18e3e: 0f 94 fd 34 call 0x269fa ; 0x269fa 18e42: e5 96 adiw r28, 0x35 ; 53 18e44: 8f af std Y+63, r24 ; 0x3f 18e46: e5 97 sbiw r28, 0x35 ; 53 18e48: 81 11 cpse r24, r1 18e4a: 04 c0 rjmp .+8 ; 0x18e54 //! @param verbosity_level //! @retval true Succeeded //! @retval false Failed bool gcode_M45(bool onlyZ, int8_t verbosity_level) { bool final_result = false; 18e4c: e5 96 adiw r28, 0x35 ; 53 18e4e: 1f ae std Y+63, r1 ; 0x3f 18e50: e5 97 sbiw r28, 0x35 ; 53 18e52: 08 c3 rjmp .+1552 ; 0x19464 { #else //TMC2130 if (lcd_calibrate_z_end_stop_manual(onlyZ)) { #endif //TMC2130 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CONFIRM_NOZZLE_CLEAN)); 18e54: 84 e0 ldi r24, 0x04 ; 4 18e56: 98 e4 ldi r25, 0x48 ; 72 18e58: 0e 94 b1 6c call 0xd962 ; 0xd962 18e5c: 0f 94 47 0b call 0x2168e ; 0x2168e if(onlyZ){ 18e60: 11 23 and r17, r17 18e62: 09 f4 brne .+2 ; 0x18e66 18e64: da c2 rjmp .+1460 ; 0x1941a prompt_steel_sheet_on_bed(true); 18e66: 81 e0 ldi r24, 0x01 ; 1 18e68: 0f 94 a4 2f call 0x25f48 ; 0x25f48 lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 18e6c: 82 ed ldi r24, 0xD2 ; 210 18e6e: 97 e4 ldi r25, 0x47 ; 71 18e70: 0e 94 b1 6c call 0xd962 ; 0xd962 18e74: 0f 94 c0 0a call 0x21580 ; 0x21580 lcd_puts_at_P(0,3,_n("1/9")); 18e78: 4a eb ldi r20, 0xBA ; 186 18e7a: 59 e6 ldi r21, 0x69 ; 105 }else{ //lcd_show_fullscreen_message_and_wait_P(_T(MSG_PAPER)); lcd_display_message_fullscreen_P(_T(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1)); lcd_puts_at_P(0,3,_n("1/4")); 18e7c: 63 e0 ldi r22, 0x03 ; 3 18e7e: 80 e0 ldi r24, 0x00 ; 0 18e80: 0e 94 8f 69 call 0xd31e ; 0xd31e } refresh_cmd_timeout(); 18e84: 0e 94 c9 5f call 0xbf92 ; 0xbf92 if (((degHotend(0) > MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) && (!onlyZ)) { lcd_wait_for_cool_down(); } #endif //STEEL_SHEET if(!onlyZ) 18e88: 11 11 cpse r17, r1 18e8a: 1b c0 rjmp .+54 ; 0x18ec2 { KEEPALIVE_STATE(PAUSED_FOR_USER); 18e8c: 84 e0 ldi r24, 0x04 ; 4 18e8e: 80 93 78 02 sts 0x0278, r24 ; 0x800278 prompt_steel_sheet_on_bed(false); 18e92: 80 e0 ldi r24, 0x00 ; 0 18e94: 0f 94 a4 2f call 0x25f48 ; 0x25f48 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PAPER)); 18e98: 88 e1 ldi r24, 0x18 ; 24 18e9a: 97 e4 ldi r25, 0x47 ; 71 18e9c: 0e 94 b1 6c call 0xd962 ; 0xd962 18ea0: 0f 94 47 0b call 0x2168e ; 0x2168e KEEPALIVE_STATE(IN_HANDLER); 18ea4: 82 e0 ldi r24, 0x02 ; 2 18ea6: 80 93 78 02 sts 0x0278, r24 ; 0x800278 lcd_display_message_fullscreen_P(_T(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1)); 18eaa: 80 eb ldi r24, 0xB0 ; 176 18eac: 97 e4 ldi r25, 0x47 ; 71 18eae: 0e 94 b1 6c call 0xd962 ; 0xd962 18eb2: 0f 94 c0 0a call 0x21580 ; 0x21580 lcd_puts_at_P(0,3,_n("1/4")); 18eb6: 42 eb ldi r20, 0xB2 ; 178 18eb8: 59 e6 ldi r21, 0x69 ; 105 18eba: 63 e0 ldi r22, 0x03 ; 3 18ebc: 80 e0 ldi r24, 0x00 ; 0 18ebe: 0e 94 8f 69 call 0xd31e ; 0xd31e return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 18ec2: 00 91 77 02 lds r16, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.364> check_endstops = check; 18ec6: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.364> } bool endstops_enabled = enable_endstops(false); raise_z(-1); 18eca: 60 e0 ldi r22, 0x00 ; 0 18ecc: 70 e0 ldi r23, 0x00 ; 0 18ece: 80 e8 ldi r24, 0x80 ; 128 18ed0: 9f eb ldi r25, 0xBF ; 191 18ed2: 0e 94 dd 66 call 0xcdba ; 0xcdba // Move the print head close to the bed. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 18ed6: c1 2c mov r12, r1 18ed8: d1 2c mov r13, r1 18eda: b0 ea ldi r27, 0xA0 ; 160 18edc: eb 2e mov r14, r27 18ede: b0 e4 ldi r27, 0x40 ; 64 18ee0: fb 2e mov r15, r27 18ee2: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 18ee6: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 18eea: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 18eee: f0 92 00 12 sts 0x1200, r15 ; 0x801200 18ef2: 81 e0 ldi r24, 0x01 ; 1 18ef4: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.364> enable_endstops(true); #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 18ef8: 60 e0 ldi r22, 0x00 ; 0 18efa: 70 e0 ldi r23, 0x00 ; 0 18efc: 80 ea ldi r24, 0xA0 ; 160 18efe: 91 e4 ldi r25, 0x41 ; 65 18f00: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 18f04: 0f 94 42 22 call 0x24484 ; 0x24484 18f08: 00 93 77 02 sts 0x0277, r16 ; 0x800277 <_ZL14check_endstops.lto_priv.364> #ifdef TMC2130 tmc2130_home_exit(); #endif //TMC2130 enable_endstops(endstops_enabled); if ((st_get_position_mm(Z_AXIS) <= (MESH_HOME_Z_SEARCH + HOME_Z_SEARCH_THRESHOLD)) && 18f0c: 82 e0 ldi r24, 0x02 ; 2 18f0e: 0f 94 2e 22 call 0x2445c ; 0x2445c 18f12: 2d ec ldi r18, 0xCD ; 205 18f14: 3c ec ldi r19, 0xCC ; 204 18f16: 44 ea ldi r20, 0xA4 ; 164 18f18: 50 e4 ldi r21, 0x40 ; 64 18f1a: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 18f1e: 18 16 cp r1, r24 18f20: 0c f4 brge .+2 ; 0x18f24 18f22: 84 c2 rjmp .+1288 ; 0x1942c (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) 18f24: 82 e0 ldi r24, 0x02 ; 2 18f26: 0f 94 2e 22 call 0x2445c ; 0x2445c #ifdef TMC2130 tmc2130_home_exit(); #endif //TMC2130 enable_endstops(endstops_enabled); if ((st_get_position_mm(Z_AXIS) <= (MESH_HOME_Z_SEARCH + HOME_Z_SEARCH_THRESHOLD)) && 18f2a: 23 e3 ldi r18, 0x33 ; 51 18f2c: 33 e3 ldi r19, 0x33 ; 51 18f2e: 4b e9 ldi r20, 0x9B ; 155 18f30: 50 e4 ldi r21, 0x40 ; 64 18f32: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 18f36: 87 fd sbrc r24, 7 18f38: 79 c2 rjmp .+1266 ; 0x1942c (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) { if (onlyZ) 18f3a: 11 11 cpse r17, r1 18f3c: 7c c2 rjmp .+1272 ; 0x19436 } } else { // Reset the baby step value and the baby step applied flag. calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 18f3e: 80 e1 ldi r24, 0x10 ; 16 18f40: 0e 94 31 c6 call 0x18c62 ; 0x18c62 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 18f44: 81 ea ldi r24, 0xA1 ; 161 18f46: 9d e0 ldi r25, 0x0D ; 13 18f48: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 18f4c: bb e0 ldi r27, 0x0B ; 11 18f4e: 8b 9f mul r24, r27 18f50: c0 01 movw r24, r0 18f52: 11 24 eor r1, r1 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 18f54: 70 e0 ldi r23, 0x00 ; 0 18f56: 60 e0 ldi r22, 0x00 ; 0 18f58: 80 5b subi r24, 0xB0 ; 176 18f5a: 92 4f sbci r25, 0xF2 ; 242 18f5c: 0f 94 1e a0 call 0x3403c ; 0x3403c } BedSkewOffsetDetectionResultType find_bed_offset_and_skew(int8_t verbosity_level, uint8_t &too_far_mask) { // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 18f60: 0e 94 c9 5f call 0xbf92 ; 0xbf92 // 7x7=49 floats, good for 16 (x,y,z) vectors. float *pts = &mbl.z_values[0][0]; float *vec_x = pts + 2 * 4; float *vec_y = vec_x + 2; float *cntr = vec_y + 2; memset(pts, 0, sizeof(float) * 7 * 7); 18f64: ed e9 ldi r30, 0x9D ; 157 18f66: f2 e1 ldi r31, 0x12 ; 18 18f68: 84 ec ldi r24, 0xC4 ; 196 18f6a: df 01 movw r26, r30 18f6c: 1d 92 st X+, r1 18f6e: 8a 95 dec r24 18f70: e9 f7 brne .-6 ; 0x18f6c { #else //NEW_XYZCAL while (iteration < 3) { #endif //NEW_XYZCAL SERIAL_ECHOPGM("Iteration: "); 18f72: 81 e7 ldi r24, 0x71 ; 113 18f74: 98 e8 ldi r25, 0x88 ; 136 18f76: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 MYSERIAL.println(int(iteration + 1)); 18f7a: 81 e0 ldi r24, 0x01 ; 1 18f7c: 90 e0 ldi r25, 0x00 ; 0 18f7e: 0f 94 aa 41 call 0x28354 ; 0x28354 MYSERIAL.print(cntr[1], 5); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_display_message_fullscreen_P(_T(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1)); 18f82: 80 eb ldi r24, 0xB0 ; 176 18f84: 97 e4 ldi r25, 0x47 ; 71 18f86: 0e 94 b1 6c call 0xd962 ; 0xd962 18f8a: 0f 94 c0 0a call 0x21580 ; 0x21580 #endif /* MESH_BED_CALIBRATION_SHOW_LCD */ // Collect the rear 2x3 points. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH + FIND_BED_INDUCTION_SENSOR_POINT_Z_STEP * iteration * 0.3; 18f8e: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 18f92: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 18f96: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 18f9a: f0 92 00 12 sts 0x1200, r15 ; 0x801200 18f9e: b2 e0 ldi r27, 0x02 ; 2 18fa0: e1 96 adiw r28, 0x31 ; 49 18fa2: bf af std Y+63, r27 ; 0x3f 18fa4: e1 97 sbiw r28, 0x31 ; 49 18fa6: 2c e4 ldi r18, 0x4C ; 76 18fa8: 38 e8 ldi r19, 0x88 ; 136 18faa: cd 56 subi r28, 0x6D ; 109 18fac: df 4f sbci r29, 0xFF ; 255 18fae: 39 83 std Y+1, r19 ; 0x01 18fb0: 28 83 st Y, r18 18fb2: c3 59 subi r28, 0x93 ; 147 18fb4: d0 40 sbci r29, 0x00 ; 0 18fb6: 4c e9 ldi r20, 0x9C ; 156 18fb8: 52 e1 ldi r21, 0x12 ; 18 18fba: cf 56 subi r28, 0x6F ; 111 18fbc: df 4f sbci r29, 0xFF ; 255 18fbe: 59 83 std Y+1, r21 ; 0x01 18fc0: 48 83 st Y, r20 18fc2: c1 59 subi r28, 0x91 ; 145 18fc4: d0 40 sbci r29, 0x00 ; 0 18fc6: a0 96 adiw r28, 0x20 ; 32 18fc8: 5f af std Y+63, r21 ; 0x3f 18fca: 4e af std Y+62, r20 ; 0x3e 18fcc: a0 97 sbiw r28, 0x20 ; 32 18fce: e0 96 adiw r28, 0x30 ; 48 18fd0: 3f af std Y+63, r19 ; 0x3f 18fd2: 2e af std Y+62, r18 ; 0x3e 18fd4: e0 97 sbiw r28, 0x30 ; 48 /// Retry point scanning if a point with bad data appears. /// Bad data could be cause by "cold" sensor. /// This behavior vanishes after few point scans so retry will help. for (uint8_t retries = 0; retries <= 1; ++retries) { bool retry = false; 18fd6: a7 96 adiw r28, 0x27 ; 39 18fd8: 1f ae std Y+63, r1 ; 0x3f 18fda: a7 97 sbiw r28, 0x27 ; 39 for (int k = 0; k < 4; ++k) { 18fdc: 31 2c mov r3, r1 18fde: 21 2c mov r2, r1 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 18fe0: 0e 94 c9 5f call 0xbf92 ; 0xbf92 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_set_cursor(0, 3); 18fe4: 63 e0 ldi r22, 0x03 ; 3 18fe6: 80 e0 ldi r24, 0x00 ; 0 18fe8: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_printf_P(PSTR("%d/4"),(k+1)); 18fec: bf ef ldi r27, 0xFF ; 255 18fee: 2b 1a sub r2, r27 18ff0: 3b 0a sbc r3, r27 18ff2: 3f 92 push r3 18ff4: 2f 92 push r2 18ff6: ec e6 ldi r30, 0x6C ; 108 18ff8: f8 e8 ldi r31, 0x88 ; 136 18ffa: ff 93 push r31 18ffc: ef 93 push r30 18ffe: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 } #endif /* MESH_BED_CALIBRATION_SHOW_LCD */ float *pt = pts + k * 2; // Go up to z_initial. go_to_current(homing_feedrate[Z_AXIS] / 60.f); 19002: 65 e5 ldi r22, 0x55 ; 85 19004: 75 e5 ldi r23, 0x55 ; 85 19006: 85 e5 ldi r24, 0x55 ; 85 19008: 91 e4 ldi r25, 0x41 ; 65 1900a: 0f 94 22 87 call 0x30e44 ; 0x30e44 delay_keep_alive(5000); } #endif // SUPPORT_VERBOSITY // Go to the measurement point position. //if (iteration == 0) { current_position[X_AXIS] = pgm_read_float(bed_ref_points_4 + k * 2); 1900e: e0 96 adiw r28, 0x30 ; 48 19010: ee ad ldd r30, Y+62 ; 0x3e 19012: ff ad ldd r31, Y+63 ; 0x3f 19014: e0 97 sbiw r28, 0x30 ; 48 19016: 85 91 lpm r24, Z+ 19018: 95 91 lpm r25, Z+ 1901a: a5 91 lpm r26, Z+ 1901c: b4 91 lpm r27, Z 1901e: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 19022: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 19026: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 1902a: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + k * 2 + 1); 1902e: e0 96 adiw r28, 0x30 ; 48 19030: ee ad ldd r30, Y+62 ; 0x3e 19032: ff ad ldd r31, Y+63 ; 0x3f 19034: e0 97 sbiw r28, 0x30 ; 48 19036: 34 96 adiw r30, 0x04 ; 4 19038: 85 91 lpm r24, Z+ 1903a: 95 91 lpm r25, Z+ 1903c: a5 91 lpm r26, Z+ 1903e: b4 91 lpm r27, Z 19040: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 19044: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 19048: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 1904c: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc MYSERIAL.print(current_position[Z_AXIS], 5); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY go_to_current(homing_feedrate[X_AXIS] / 60.f); 19050: 60 e0 ldi r22, 0x00 ; 0 19052: 70 e0 ldi r23, 0x00 ; 0 19054: 88 e4 ldi r24, 0x48 ; 72 19056: 92 e4 ldi r25, 0x42 ; 66 19058: 0f 94 22 87 call 0x30e44 ; 0x30e44 return pos * 0.01f; } void xyzcal_measure_enter(void) { DBG(_n("xyzcal_measure_enter\n")); 1905c: 41 ed ldi r20, 0xD1 ; 209 1905e: 56 e8 ldi r21, 0x86 ; 134 19060: 5f 93 push r21 19062: 4f 93 push r20 19064: 0f 94 9e 9e call 0x33d3c ; 0x33d3c lcd_puts_at_P(4,3,PSTR("Measure center ")); ////MSG_MEASURE_CENTER c=16 19068: 40 ec ldi r20, 0xC0 ; 192 1906a: 56 e8 ldi r21, 0x86 ; 134 1906c: 63 e0 ldi r22, 0x03 ; 3 1906e: 84 e0 ldi r24, 0x04 ; 4 19070: 0e 94 8f 69 call 0xd31e ; 0xd31e // disable heaters and stop motion before we initialize sm4 disable_heater(); 19074: 0f 94 5f 12 call 0x224be ; 0x224be st_synchronize(); 19078: 0f 94 42 22 call 0x24484 ; 0x24484 // disable incompatible interrupts DISABLE_STEPPER_DRIVER_INTERRUPT(); 1907c: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 19080: 8d 7f andi r24, 0xFD ; 253 19082: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> "out __SREG__,__tmp_reg__" "\n\t" : [TEMPREG] "=d" (temp_reg) : [WDTREG] "n" (_SFR_MEM_ADDR(_WD_CONTROL_REG)), [WDCE_WDE] "n" ((uint8_t)(_BV(_WD_CHANGE_BIT) | _BV(WDE))) : "r0" ); 19086: 0f b6 in r0, 0x3f ; 63 19088: f8 94 cli 1908a: a8 95 wdr 1908c: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 19090: 88 61 ori r24, 0x18 ; 24 19092: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 19096: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1909a: 0f be out 0x3f, r0 ; 63 #ifdef WATCHDOG wdt_disable(); #endif //WATCHDOG // setup internal callbacks sm4_stop_cb = 0; 1909c: 10 92 28 05 sts 0x0528, r1 ; 0x800528 190a0: 10 92 27 05 sts 0x0527, r1 ; 0x800527 sm4_update_pos_cb = xyzcal_update_pos; 190a4: 83 e0 ldi r24, 0x03 ; 3 190a6: 91 eb ldi r25, 0xB1 ; 177 190a8: 90 93 26 05 sts 0x0526, r25 ; 0x800526 190ac: 80 93 25 05 sts 0x0525, r24 ; 0x800525 sm4_calc_delay_cb = xyzcal_calc_delay; 190b0: a2 e6 ldi r26, 0x62 ; 98 190b2: b0 eb ldi r27, 0xB0 ; 176 190b4: b0 93 24 05 sts 0x0524, r27 ; 0x800524 190b8: a0 93 23 05 sts 0x0523, r26 ; 0x800523 const uint16_t xyzcal_point_pattern_10[12] PROGMEM = {0x000, 0x0f0, 0x1f8, 0x3fc, 0x7fe, 0x7fe, 0x7fe, 0x7fe, 0x3fc, 0x1f8, 0x0f0, 0x000}; const uint16_t xyzcal_point_pattern_08[12] PROGMEM = {0x000, 0x000, 0x0f0, 0x1f8, 0x3fc, 0x3fc, 0x3fc, 0x3fc, 0x1f8, 0x0f0, 0x000, 0x000}; bool xyzcal_searchZ(void) { //@size=118 DBG(_n("xyzcal_searchZ x=%ld y=%ld z=%ld\n"), count_position[X_AXIS], count_position[Y_AXIS], count_position[Z_AXIS]); 190bc: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 190c0: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 190c4: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 190c8: 30 91 c1 06 lds r19, 0x06C1 ; 0x8006c1 190cc: 40 91 ba 06 lds r20, 0x06BA ; 0x8006ba 190d0: 50 91 bb 06 lds r21, 0x06BB ; 0x8006bb 190d4: 60 91 bc 06 lds r22, 0x06BC ; 0x8006bc 190d8: 70 91 bd 06 lds r23, 0x06BD ; 0x8006bd 190dc: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 190e0: 90 91 b7 06 lds r25, 0x06B7 ; 0x8006b7 190e4: a0 91 b8 06 lds r26, 0x06B8 ; 0x8006b8 190e8: b0 91 b9 06 lds r27, 0x06B9 ; 0x8006b9 190ec: 3f 93 push r19 190ee: 2f 93 push r18 190f0: 1f 93 push r17 190f2: 0f 93 push r16 190f4: 7f 93 push r23 190f6: 6f 93 push r22 190f8: 5f 93 push r21 190fa: 4f 93 push r20 190fc: bf 93 push r27 190fe: af 93 push r26 19100: 9f 93 push r25 19102: 8f 93 push r24 19104: e0 e7 ldi r30, 0x70 ; 112 19106: f7 e8 ldi r31, 0x87 ; 135 19108: ff 93 push r31 1910a: ef 93 push r30 1910c: 0f 94 9e 9e call 0x33d3c ; 0x33d3c int16_t x0 = _X; 19110: 40 90 b6 06 lds r4, 0x06B6 ; 0x8006b6 19114: 50 90 b7 06 lds r5, 0x06B7 ; 0x8006b7 19118: 60 90 b8 06 lds r6, 0x06B8 ; 0x8006b8 1911c: 70 90 b9 06 lds r7, 0x06B9 ; 0x8006b9 19120: b4 2c mov r11, r4 19122: a5 2c mov r10, r5 int16_t y0 = _Y; 19124: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 19128: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 1912c: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 19130: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 19134: a6 96 adiw r28, 0x26 ; 38 19136: 8c af std Y+60, r24 ; 0x3c 19138: 9d af std Y+61, r25 ; 0x3d 1913a: ae af std Y+62, r26 ; 0x3e 1913c: bf af std Y+63, r27 ; 0x3f 1913e: a6 97 sbiw r28, 0x26 ; 38 19140: a3 96 adiw r28, 0x23 ; 35 19142: 9f ac ldd r9, Y+63 ; 0x3f 19144: a3 97 sbiw r28, 0x23 ; 35 19146: a4 96 adiw r28, 0x24 ; 36 19148: 8f ac ldd r8, Y+63 ; 0x3f 1914a: a4 97 sbiw r28, 0x24 ; 36 int16_t z = _Z; 1914c: c0 90 be 06 lds r12, 0x06BE ; 0x8006be 19150: d0 90 bf 06 lds r13, 0x06BF ; 0x8006bf 19154: e0 90 c0 06 lds r14, 0x06C0 ; 0x8006c0 19158: f0 90 c1 06 lds r15, 0x06C1 ; 0x8006c1 1915c: 0f b6 in r0, 0x3f ; 63 1915e: f8 94 cli 19160: de bf out 0x3e, r29 ; 62 19162: 0f be out 0x3f, r0 ; 63 19164: cd bf out 0x3d, r28 ; 61 // int16_t min_z = -6000; // int16_t dz = 100; while (z > -2300) { //-6mm + 0.25mm 19166: b5 e0 ldi r27, 0x05 ; 5 19168: cb 16 cp r12, r27 1916a: b7 ef ldi r27, 0xF7 ; 247 1916c: db 06 cpc r13, r27 1916e: 0c f4 brge .+2 ; 0x19172 19170: d3 c1 rjmp .+934 ; 0x19518 } bool xyzcal_spiral8(int16_t cx, int16_t cy, int16_t z0, int16_t dz, int16_t radius, uint16_t delay_us, int8_t check_pinda, uint16_t* pad) { bool ret = false; uint16_t ad = 0; 19172: 1a 82 std Y+2, r1 ; 0x02 19174: 19 82 std Y+1, r1 ; 0x01 if (pad) ad = *pad; //@size=274 DBG(_n("xyzcal_spiral8 cx=%d cy=%d z0=%d dz=%d radius=%d ad=%d\n"), cx, cy, z0, dz, radius, ad); 19176: 1f 92 push r1 19178: 1f 92 push r1 1917a: e3 e0 ldi r30, 0x03 ; 3 1917c: ef 93 push r30 1917e: f4 e8 ldi r31, 0x84 ; 132 19180: ff 93 push r31 19182: 1f 92 push r1 19184: 24 e6 ldi r18, 0x64 ; 100 19186: 2f 93 push r18 19188: df 92 push r13 1918a: cf 92 push r12 1918c: 8f 92 push r8 1918e: 9f 92 push r9 19190: af 92 push r10 19192: bf 92 push r11 19194: 47 ee ldi r20, 0xE7 ; 231 19196: 56 e8 ldi r21, 0x86 ; 134 19198: 5f 93 push r21 1919a: 4f 93 push r20 1919c: 0f 94 9e 9e call 0x33d3c ; 0x33d3c if (!ret && (ad < 720)) 191a0: 0f b6 in r0, 0x3f ; 63 191a2: f8 94 cli 191a4: de bf out 0x3e, r29 ; 62 191a6: 0f be out 0x3f, r0 ; 63 191a8: cd bf out 0x3d, r28 ; 61 191aa: 89 81 ldd r24, Y+1 ; 0x01 191ac: 9a 81 ldd r25, Y+2 ; 0x02 191ae: 80 3d cpi r24, 0xD0 ; 208 191b0: 92 40 sbci r25, 0x02 ; 2 191b2: 08 f4 brcc .+2 ; 0x191b6 191b4: 7c c1 rjmp .+760 ; 0x194ae if ((ret = xyzcal_spiral2(cx, cy, z0 - 0*dz, dz, radius, 0, delay_us, check_pinda, &ad)) != 0) ad += 0; if (!ret && (ad < 1440)) 191b6: 89 81 ldd r24, Y+1 ; 0x01 191b8: 9a 81 ldd r25, Y+2 ; 0x02 191ba: 80 3a cpi r24, 0xA0 ; 160 191bc: 95 40 sbci r25, 0x05 ; 5 191be: 10 f0 brcs .+4 ; 0x191c4 191c0: 0c 94 d7 d7 jmp 0x1afae ; 0x1afae if ((ret = xyzcal_spiral2(cx, cy, z0 - 1*dz, dz, -radius, 0, delay_us, check_pinda, &ad)) != 0) 191c4: 9e 01 movw r18, r28 191c6: 2f 5f subi r18, 0xFF ; 255 191c8: 3f 4f sbci r19, 0xFF ; 255 191ca: 79 01 movw r14, r18 191cc: 10 e0 ldi r17, 0x00 ; 0 191ce: 00 e0 ldi r16, 0x00 ; 0 191d0: 2c e7 ldi r18, 0x7C ; 124 191d2: 3c ef ldi r19, 0xFC ; 252 191d4: a6 01 movw r20, r12 191d6: 44 56 subi r20, 0x64 ; 100 191d8: 51 09 sbc r21, r1 191da: 69 2d mov r22, r9 191dc: 78 2d mov r23, r8 191de: 8b 2d mov r24, r11 191e0: 9a 2d mov r25, r10 191e2: 0f 94 cc 5e call 0x2bd98 ; 0x2bd98 191e6: 88 23 and r24, r24 191e8: 11 f4 brne .+4 ; 0x191ee 191ea: 0c 94 d7 d7 jmp 0x1afae ; 0x1afae ad += 720; 191ee: 89 81 ldd r24, Y+1 ; 0x01 191f0: 9a 81 ldd r25, Y+2 ; 0x02 191f2: 80 53 subi r24, 0x30 ; 48 191f4: 9d 4f sbci r25, 0xFD ; 253 // int16_t dz = 100; while (z > -2300) { //-6mm + 0.25mm uint16_t ad = 0; if (xyzcal_spiral8(x0, y0, z, 100, 900, 320, 1, &ad)) { //dz=100 radius=900 delay=400 //@size=82 DBG(_n(" ON-SIGNAL at x=%d y=%d z=%d ad=%d\n"), _X, _Y, _Z, ad); 191f6: c0 90 be 06 lds r12, 0x06BE ; 0x8006be 191fa: d0 90 bf 06 lds r13, 0x06BF ; 0x8006bf 191fe: e0 90 c0 06 lds r14, 0x06C0 ; 0x8006c0 19202: f0 90 c1 06 lds r15, 0x06C1 ; 0x8006c1 19206: 00 91 ba 06 lds r16, 0x06BA ; 0x8006ba 1920a: 10 91 bb 06 lds r17, 0x06BB ; 0x8006bb 1920e: 20 91 bc 06 lds r18, 0x06BC ; 0x8006bc 19212: 30 91 bd 06 lds r19, 0x06BD ; 0x8006bd 19216: 40 91 b6 06 lds r20, 0x06B6 ; 0x8006b6 1921a: 50 91 b7 06 lds r21, 0x06B7 ; 0x8006b7 1921e: 60 91 b8 06 lds r22, 0x06B8 ; 0x8006b8 19222: 70 91 b9 06 lds r23, 0x06B9 ; 0x8006b9 19226: 9f 93 push r25 19228: 8f 93 push r24 1922a: df 92 push r13 1922c: cf 92 push r12 1922e: 1f 93 push r17 19230: 0f 93 push r16 19232: 5f 93 push r21 19234: 4f 93 push r20 19236: 8c e4 ldi r24, 0x4C ; 76 19238: 97 e8 ldi r25, 0x87 ; 135 1923a: 9f 93 push r25 1923c: 8f 93 push r24 1923e: 0f 94 9e 9e call 0x33d3c ; 0x33d3c /// return to starting XY position /// magic constant, lowers min_z after searchZ to obtain more dense data in scan const pos_i16_t lower_z = 72; xyzcal_lineXYZ_to(x0, y0, _Z - lower_z, 200, 0); 19242: 40 91 be 06 lds r20, 0x06BE ; 0x8006be 19246: 50 91 bf 06 lds r21, 0x06BF ; 0x8006bf 1924a: 60 91 c0 06 lds r22, 0x06C0 ; 0x8006c0 1924e: 70 91 c1 06 lds r23, 0x06C1 ; 0x8006c1 19252: 48 54 subi r20, 0x48 ; 72 19254: 51 09 sbc r21, r1 19256: 00 e0 ldi r16, 0x00 ; 0 19258: 28 ec ldi r18, 0xC8 ; 200 1925a: 30 e0 ldi r19, 0x00 ; 0 1925c: a3 96 adiw r28, 0x23 ; 35 1925e: 6f ad ldd r22, Y+63 ; 0x3f 19260: a3 97 sbiw r28, 0x23 ; 35 19262: a4 96 adiw r28, 0x24 ; 36 19264: 7f ad ldd r23, Y+63 ; 0x3f 19266: a4 97 sbiw r28, 0x24 ; 36 19268: c2 01 movw r24, r4 1926a: 0e 94 d2 c2 call 0x185a4 ; 0x185a4 /// searches for the center of the calibration pin BedSkewOffsetDetectionResultType xyzcal_scan_and_process(){ //@size=44 // DBG(_n("sizeof(block_buffer)=%d\n"), sizeof(block_t)*BLOCK_BUFFER_SIZE); BedSkewOffsetDetectionResultType ret = BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND; int16_t x = _X; 1926e: 20 91 b6 06 lds r18, 0x06B6 ; 0x8006b6 19272: 30 91 b7 06 lds r19, 0x06B7 ; 0x8006b7 19276: 40 91 b8 06 lds r20, 0x06B8 ; 0x8006b8 1927a: 50 91 b9 06 lds r21, 0x06B9 ; 0x8006b9 1927e: 6e 96 adiw r28, 0x1e ; 30 19280: 2c af std Y+60, r18 ; 0x3c 19282: 3d af std Y+61, r19 ; 0x3d 19284: 4e af std Y+62, r20 ; 0x3e 19286: 5f af std Y+63, r21 ; 0x3f 19288: 6e 97 sbiw r28, 0x1e ; 30 int16_t y = _Y; 1928a: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 1928e: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 19292: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 19296: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 1929a: ae 96 adiw r28, 0x2e ; 46 1929c: 8c af std Y+60, r24 ; 0x3c 1929e: 9d af std Y+61, r25 ; 0x3d 192a0: ae af std Y+62, r26 ; 0x3e 192a2: bf af std Y+63, r27 ; 0x3f 192a4: ae 97 sbiw r28, 0x2e ; 46 const int16_t z = _Z; 192a6: 20 91 be 06 lds r18, 0x06BE ; 0x8006be 192aa: 30 91 bf 06 lds r19, 0x06BF ; 0x8006bf 192ae: 40 91 c0 06 lds r20, 0x06C0 ; 0x8006c0 192b2: 50 91 c1 06 lds r21, 0x06C1 ; 0x8006c1 192b6: e9 96 adiw r28, 0x39 ; 57 192b8: 2c af std Y+60, r18 ; 0x3c 192ba: 3d af std Y+61, r19 ; 0x3d 192bc: 4e af std Y+62, r20 ; 0x3e 192be: 5f af std Y+63, r21 ; 0x3f 192c0: e9 97 sbiw r28, 0x39 ; 57 192c2: a8 ec ldi r26, 0xC8 ; 200 192c4: ba e0 ldi r27, 0x0A ; 10 192c6: 0f b6 in r0, 0x3f ; 63 192c8: f8 94 cli 192ca: de bf out 0x3e, r29 ; 62 192cc: 0f be out 0x3f, r0 ; 63 192ce: cd bf out 0x3d, r28 ; 61 192d0: 90 e0 ldi r25, 0x00 ; 0 192d2: 80 e0 ldi r24, 0x00 ; 0 uint8_t *matrix32 = (uint8_t *)block_buffer; uint16_t *pattern08 = (uint16_t *)(matrix32 + 32 * 32); uint16_t *pattern10 = (uint16_t *)(pattern08 + 12); for (uint8_t i = 0; i < 12; i++){ pattern08[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_08 + i)); 192d4: fc 01 movw r30, r24 192d6: e9 51 subi r30, 0x19 ; 25 192d8: f8 47 sbci r31, 0x78 ; 120 192da: 25 91 lpm r18, Z+ 192dc: 34 91 lpm r19, Z 192de: 2d 93 st X+, r18 192e0: 3d 93 st X+, r19 pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); 192e2: fc 01 movw r30, r24 192e4: e1 53 subi r30, 0x31 ; 49 192e6: f8 47 sbci r31, 0x78 ; 120 192e8: 25 91 lpm r18, Z+ 192ea: 34 91 lpm r19, Z 192ec: 57 96 adiw r26, 0x17 ; 23 192ee: 3c 93 st X, r19 192f0: 2e 93 st -X, r18 192f2: 56 97 sbiw r26, 0x16 ; 22 192f4: 02 96 adiw r24, 0x02 ; 2 uint8_t *matrix32 = (uint8_t *)block_buffer; uint16_t *pattern08 = (uint16_t *)(matrix32 + 32 * 32); uint16_t *pattern10 = (uint16_t *)(pattern08 + 12); for (uint8_t i = 0; i < 12; i++){ 192f6: 88 31 cpi r24, 0x18 ; 24 192f8: 91 05 cpc r25, r1 192fa: 61 f7 brne .-40 ; 0x192d4 pattern08[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_08 + i)); pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); } xyzcal_scan_pixels_32x32_Zhop(x, y, z, 2400, 200, matrix32); 192fc: e7 96 adiw r28, 0x37 ; 55 192fe: 4e ad ldd r20, Y+62 ; 0x3e 19300: 5f ad ldd r21, Y+63 ; 0x3f 19302: e7 97 sbiw r28, 0x37 ; 55 19304: ac 96 adiw r28, 0x2c ; 44 19306: 6e ad ldd r22, Y+62 ; 0x3e 19308: 7f ad ldd r23, Y+63 ; 0x3f 1930a: ac 97 sbiw r28, 0x2c ; 44 1930c: 6c 96 adiw r28, 0x1c ; 28 1930e: 8e ad ldd r24, Y+62 ; 0x3e 19310: 9f ad ldd r25, Y+63 ; 0x3f 19312: 6c 97 sbiw r28, 0x1c ; 28 19314: 0f 94 54 5b call 0x2b6a8 ; 0x2b6a8 19318: 28 ec ldi r18, 0xC8 ; 200 1931a: 36 e0 ldi r19, 0x06 ; 6 1931c: a4 96 adiw r28, 0x24 ; 36 1931e: 3f af std Y+63, r19 ; 0x3f 19320: 2e af std Y+62, r18 ; 0x3e 19322: a4 97 sbiw r28, 0x24 ; 36 19324: 79 01 movw r14, r18 19326: f0 e2 ldi r31, 0x20 ; 32 19328: 9f 2e mov r9, r31 /// Prints matrix in hex to debug output (serial line) void print_image(const uint8_t *matrix_32x32){ for (uint8_t y = 0; y < 32; ++y){ const uint16_t idx_y = y * 32; for (uint8_t x = 0; x < 32; ++x){ DBG(_n("%02x"), matrix_32x32[idx_y + x]); 1932a: a2 e9 ldi r26, 0x92 ; 146 1932c: ca 2e mov r12, r26 1932e: a7 e8 ldi r26, 0x87 ; 135 19330: da 2e mov r13, r26 } DBG(endl); 19332: 02 e7 ldi r16, 0x72 ; 114 19334: 18 e9 ldi r17, 0x98 ; 152 for (uint8_t i = 0; i < 12; i++){ pattern08[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_08 + i)); pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); } xyzcal_scan_pixels_32x32_Zhop(x, y, z, 2400, 200, matrix32); 19336: 57 01 movw r10, r14 19338: e0 e2 ldi r30, 0x20 ; 32 1933a: 8e 2e mov r8, r30 /// Prints matrix in hex to debug output (serial line) void print_image(const uint8_t *matrix_32x32){ for (uint8_t y = 0; y < 32; ++y){ const uint16_t idx_y = y * 32; for (uint8_t x = 0; x < 32; ++x){ DBG(_n("%02x"), matrix_32x32[idx_y + x]); 1933c: d5 01 movw r26, r10 1933e: 8d 91 ld r24, X+ 19340: 5d 01 movw r10, r26 19342: 1f 92 push r1 19344: 8f 93 push r24 19346: df 92 push r13 19348: cf 92 push r12 1934a: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 1934e: 8a 94 dec r8 /// Prints matrix in hex to debug output (serial line) void print_image(const uint8_t *matrix_32x32){ for (uint8_t y = 0; y < 32; ++y){ const uint16_t idx_y = y * 32; for (uint8_t x = 0; x < 32; ++x){ 19350: 0f 90 pop r0 19352: 0f 90 pop r0 19354: 0f 90 pop r0 19356: 0f 90 pop r0 19358: 81 10 cpse r8, r1 1935a: f0 cf rjmp .-32 ; 0x1933c DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); 1935c: 1f 93 push r17 1935e: 0f 93 push r16 19360: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 19364: 9a 94 dec r9 19366: b0 e2 ldi r27, 0x20 ; 32 19368: eb 0e add r14, r27 1936a: f1 1c adc r15, r1 DBG(_n(" [%f, %f][%f] final circle\n"), x, y, r); } /// Prints matrix in hex to debug output (serial line) void print_image(const uint8_t *matrix_32x32){ for (uint8_t y = 0; y < 32; ++y){ 1936c: 0f 90 pop r0 1936e: 0f 90 pop r0 19370: 91 10 cpse r9, r1 19372: e1 cf rjmp .-62 ; 0x19336 for (uint8_t x = 0; x < 32; ++x){ DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); } DBG(endl); 19374: 1f 93 push r17 19376: 0f 93 push r16 19378: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 1937c: 68 ec ldi r22, 0xC8 ; 200 1937e: 7a e0 ldi r23, 0x0A ; 10 19380: 0f 90 pop r0 19382: 0f 90 pop r0 19384: e8 ec ldi r30, 0xC8 ; 200 19386: f6 e0 ldi r31, 0x06 ; 6 /// magic constants that define normality const int16_t threshold_total = 900; const int threshold_extreme = 50; int16_t mins = 0; int16_t maxs = 0; 19388: 90 e0 ldi r25, 0x00 ; 0 1938a: 80 e0 ldi r24, 0x00 ; 0 bool check_scan(uint8_t *matrix32){ /// magic constants that define normality const int16_t threshold_total = 900; const int threshold_extreme = 50; int16_t mins = 0; 1938c: 50 e0 ldi r21, 0x00 ; 0 1938e: 40 e0 ldi r20, 0x00 ; 0 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { 19390: 21 91 ld r18, Z+ 19392: 21 11 cpse r18, r1 19394: 01 c3 rjmp .+1538 ; 0x19998 ++mins; 19396: 4f 5f subi r20, 0xFF ; 255 19398: 5f 4f sbci r21, 0xFF ; 255 const int threshold_extreme = 50; int16_t mins = 0; int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ 1939a: 6e 17 cp r22, r30 1939c: 7f 07 cpc r23, r31 1939e: c1 f7 brne .-16 ; 0x19390 ++maxs; } } const int16_t rest = 1024 - mins - maxs; if (mins + maxs > threshold_total 193a0: 9a 01 movw r18, r20 193a2: 28 0f add r18, r24 193a4: 39 1f adc r19, r25 193a6: 25 38 cpi r18, 0x85 ; 133 193a8: 33 40 sbci r19, 0x03 ; 3 193aa: a4 f0 brlt .+40 ; 0x193d4 && mins > threshold_extreme 193ac: 43 33 cpi r20, 0x33 ; 51 193ae: 51 05 cpc r21, r1 193b0: 8c f0 brlt .+34 ; 0x193d4 && maxs > threshold_extreme 193b2: 83 33 cpi r24, 0x33 ; 51 193b4: 91 05 cpc r25, r1 193b6: 74 f0 brlt .+28 ; 0x193d4 ++mins; } else if (matrix32[i] == 0xFF){ ++maxs; } } const int16_t rest = 1024 - mins - maxs; 193b8: 20 e0 ldi r18, 0x00 ; 0 193ba: 34 e0 ldi r19, 0x04 ; 4 193bc: 24 1b sub r18, r20 193be: 35 0b sbc r19, r21 193c0: 28 1b sub r18, r24 193c2: 39 0b sbc r19, r25 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest 193c4: 24 17 cp r18, r20 193c6: 35 07 cpc r19, r21 193c8: 2c f4 brge .+10 ; 0x193d4 } xyzcal_scan_pixels_32x32_Zhop(x, y, z, 2400, 200, matrix32); print_image(matrix32); if (!check_scan(matrix32)) return BED_SKEW_OFFSET_DETECTION_POINT_SCAN_FAILED; 193ca: 1d ef ldi r17, 0xFD ; 253 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest && maxs > rest) 193cc: 28 17 cp r18, r24 193ce: 39 07 cpc r19, r25 193d0: 0c f4 brge .+2 ; 0x193d4 193d2: d2 c0 rjmp .+420 ; 0x19578 } /// Takes two patterns and searches them in matrix32 /// \returns best match uint8_t find_patterns(uint8_t *matrix32, uint16_t *pattern08, uint16_t *pattern10, uint8_t &col, uint8_t &row){ uint8_t c08 = 0; 193d4: 66 96 adiw r28, 0x16 ; 22 193d6: 1f ae std Y+63, r1 ; 0x3f 193d8: 66 97 sbiw r28, 0x16 ; 22 uint8_t r08 = 0; 193da: 62 96 adiw r28, 0x12 ; 18 193dc: 1f ae std Y+63, r1 ; 0x3f 193de: 62 97 sbiw r28, 0x12 ; 18 uint8_t match08 = 0; uint8_t c10 = 0; 193e0: 22 96 adiw r28, 0x02 ; 2 193e2: 1f ae std Y+63, r1 ; 0x3f 193e4: 22 97 sbiw r28, 0x02 ; 2 uint8_t r10 = 0; 193e6: 19 82 std Y+1, r1 ; 0x01 /// Searches for best match of pattern by shifting it /// Returns rate of match and the best location /// max match = 132, min match = 0 uint8_t xyzcal_find_pattern_12x12_in_32x32(uint8_t* pixels, uint16_t* pattern, uint8_t* pc, uint8_t* pr){ if (!pixels || !pattern || !pc || !pr) 193e8: 88 ec ldi r24, 0xC8 ; 200 193ea: 96 e0 ldi r25, 0x06 ; 6 193ec: 89 2b or r24, r25 193ee: 99 f0 breq .+38 ; 0x19416 193f0: 88 ec ldi r24, 0xC8 ; 200 193f2: 9a e0 ldi r25, 0x0A ; 10 return -1; 193f4: 0f ef ldi r16, 0xFF ; 255 /// Searches for best match of pattern by shifting it /// Returns rate of match and the best location /// max match = 132, min match = 0 uint8_t xyzcal_find_pattern_12x12_in_32x32(uint8_t* pixels, uint16_t* pattern, uint8_t* pc, uint8_t* pr){ if (!pixels || !pattern || !pc || !pr) 193f6: 00 97 sbiw r24, 0x00 ; 0 193f8: 49 f0 breq .+18 ; 0x1940c 193fa: ae 01 movw r20, r28 193fc: 4f 5a subi r20, 0xAF ; 175 193fe: 5f 4f sbci r21, 0xFF ; 255 19400: be 01 movw r22, r28 19402: 6b 5a subi r22, 0xAB ; 171 19404: 7f 4f sbci r23, 0xFF ; 255 19406: 0f 94 77 5a call 0x2b4ee ; 0x2b4ee 1940a: 08 2f mov r16, r24 1940c: 80 ee ldi r24, 0xE0 ; 224 1940e: 9a e0 ldi r25, 0x0A ; 10 19410: 89 2b or r24, r25 19412: 09 f0 breq .+2 ; 0x19416 19414: c6 c2 rjmp .+1420 ; 0x199a2 bool check_scan(uint8_t *matrix32){ /// magic constants that define normality const int16_t threshold_total = 900; const int threshold_extreme = 50; int16_t mins = 0; 19416: 8f ef ldi r24, 0xFF ; 255 19418: d6 c2 rjmp .+1452 ; 0x199c6 prompt_steel_sheet_on_bed(true); lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); lcd_puts_at_P(0,3,_n("1/9")); }else{ //lcd_show_fullscreen_message_and_wait_P(_T(MSG_PAPER)); lcd_display_message_fullscreen_P(_T(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1)); 1941a: 80 eb ldi r24, 0xB0 ; 176 1941c: 97 e4 ldi r25, 0x47 ; 71 1941e: 0e 94 b1 6c call 0xd962 ; 0xd962 19422: 0f 94 c0 0a call 0x21580 ; 0x21580 lcd_puts_at_P(0,3,_n("1/4")); 19426: 46 eb ldi r20, 0xB6 ; 182 19428: 59 e6 ldi r21, 0x69 ; 105 1942a: 28 cd rjmp .-1456 ; 0x18e7c } } } else { lcd_show_fullscreen_message_and_wait_P(PSTR("Calibration failed! Check the axes and run again.")); 1942c: 8d e7 ldi r24, 0x7D ; 125 1942e: 98 e8 ldi r25, 0x88 ; 136 // The right and maybe the center point out of reach. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_RIGHT_FAR); else // The left and maybe the center point out of reach. //@todo Why isn't it found in the firmware.map msg = _n("XYZ calibration failed. Left front calibration point not reachable.");////MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_LEFT_FAR c=20 r=8 lcd_show_fullscreen_message_and_wait_P(msg); 19430: 0f 94 47 0b call 0x2168e ; 0x2168e 19434: 0b cd rjmp .-1514 ; 0x18e4c if ((st_get_position_mm(Z_AXIS) <= (MESH_HOME_Z_SEARCH + HOME_Z_SEARCH_THRESHOLD)) && (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) { if (onlyZ) { clean_up_after_endstop_move(l_feedmultiply); 19436: c7 55 subi r28, 0x57 ; 87 19438: df 4f sbci r29, 0xFF ; 255 1943a: 88 81 ld r24, Y 1943c: 99 81 ldd r25, Y+1 ; 0x01 1943e: c9 5a subi r28, 0xA9 ; 169 19440: d0 40 sbci r29, 0x00 ; 0 19442: 0e 94 d4 5f call 0xbfa8 ; 0xbfa8 // Z only calibration. // Load the machine correction matrix world2machine_initialize(); 19446: 0f 94 c1 8f call 0x31f82 ; 0x31f82 // and correct the current_position to match the transformed coordinate system. world2machine_update_current(); 1944a: 0f 94 5f 8d call 0x31abe ; 0x31abe //FIXME bool result = sample_mesh_and_store_reference(); 1944e: 0f 94 78 8b call 0x316f0 ; 0x316f0 19452: e5 96 adiw r28, 0x35 ; 53 19454: 8f af std Y+63, r24 ; 0x3f 19456: e5 97 sbiw r28, 0x35 ; 53 if (result) 19458: 88 23 and r24, r24 1945a: 09 f4 brne .+2 ; 0x1945e 1945c: f7 cc rjmp .-1554 ; 0x18e4c { calibration_status_set(CALIBRATION_STATUS_Z); 1945e: 84 e0 ldi r24, 0x04 ; 4 19460: 0e 94 86 c6 call 0x18d0c ; 0x18d0c } else { // Timeouted. } lcd_update_enable(true); 19464: 81 e0 ldi r24, 0x01 ; 1 19466: 0e 94 c0 69 call 0xd380 ; 0xd380 #endif // TMC2130 FORCE_BL_ON_END; return final_result; } 1946a: e5 96 adiw r28, 0x35 ; 53 1946c: 8f ad ldd r24, Y+63 ; 0x3f 1946e: e5 97 sbiw r28, 0x35 ; 53 19470: c2 53 subi r28, 0x32 ; 50 19472: df 4f sbci r29, 0xFF ; 255 19474: 0f b6 in r0, 0x3f ; 63 19476: f8 94 cli 19478: de bf out 0x3e, r29 ; 62 1947a: 0f be out 0x3f, r0 ; 63 1947c: cd bf out 0x3d, r28 ; 61 1947e: df 91 pop r29 19480: cf 91 pop r28 19482: 1f 91 pop r17 19484: 0f 91 pop r16 19486: ff 90 pop r15 19488: ef 90 pop r14 1948a: df 90 pop r13 1948c: cf 90 pop r12 1948e: bf 90 pop r11 19490: af 90 pop r10 19492: 9f 90 pop r9 19494: 8f 90 pop r8 19496: 7f 90 pop r7 19498: 6f 90 pop r6 1949a: 5f 90 pop r5 1949c: 4f 90 pop r4 1949e: 3f 90 pop r3 194a0: 2f 90 pop r2 194a2: 08 95 ret current_position[Z_AXIS] = MESH_HOME_Z_SEARCH + FIND_BED_INDUCTION_SENSOR_POINT_Z_STEP * iteration * 0.3; /// Retry point scanning if a point with bad data appears. /// Bad data could be cause by "cold" sensor. /// This behavior vanishes after few point scans so retry will help. for (uint8_t retries = 0; retries <= 1; ++retries) { 194a4: e1 e0 ldi r30, 0x01 ; 1 194a6: e1 96 adiw r28, 0x31 ; 49 194a8: ef af std Y+63, r30 ; 0x3f 194aa: e1 97 sbiw r28, 0x31 ; 49 194ac: 7c cd rjmp .-1288 ; 0x18fa6 uint16_t ad = 0; if (pad) ad = *pad; //@size=274 DBG(_n("xyzcal_spiral8 cx=%d cy=%d z0=%d dz=%d radius=%d ad=%d\n"), cx, cy, z0, dz, radius, ad); if (!ret && (ad < 720)) if ((ret = xyzcal_spiral2(cx, cy, z0 - 0*dz, dz, radius, 0, delay_us, check_pinda, &ad)) != 0) 194ae: fe 01 movw r30, r28 194b0: 31 96 adiw r30, 0x01 ; 1 194b2: 7f 01 movw r14, r30 194b4: 10 e0 ldi r17, 0x00 ; 0 194b6: 00 e0 ldi r16, 0x00 ; 0 194b8: 24 e8 ldi r18, 0x84 ; 132 194ba: 33 e0 ldi r19, 0x03 ; 3 194bc: a6 01 movw r20, r12 194be: 69 2d mov r22, r9 194c0: 78 2d mov r23, r8 194c2: 8b 2d mov r24, r11 194c4: 9a 2d mov r25, r10 194c6: 0f 94 cc 5e call 0x2bd98 ; 0x2bd98 ad += 0; if (!ret && (ad < 1440)) 194ca: 88 23 and r24, r24 194cc: 09 f4 brne .+2 ; 0x194d0 194ce: 73 ce rjmp .-794 ; 0x191b6 if ((ret = xyzcal_spiral2(cx, cy, z0 - 2*dz, dz, radius, 180, delay_us, check_pinda, &ad)) != 0) ad += 1440; if (!ret && (ad < 2880)) if ((ret = xyzcal_spiral2(cx, cy, z0 - 3*dz, dz, -radius, 180, delay_us, check_pinda, &ad)) != 0) ad += 2160; if (pad) *pad = ad; 194d0: 89 81 ldd r24, Y+1 ; 0x01 194d2: 9a 81 ldd r25, Y+2 ; 0x02 194d4: 90 ce rjmp .-736 ; 0x191f6 if ((ret = xyzcal_spiral2(cx, cy, z0 - 1*dz, dz, -radius, 0, delay_us, check_pinda, &ad)) != 0) ad += 720; if (!ret && (ad < 2160)) if ((ret = xyzcal_spiral2(cx, cy, z0 - 2*dz, dz, radius, 180, delay_us, check_pinda, &ad)) != 0) ad += 1440; if (!ret && (ad < 2880)) 194d6: 89 81 ldd r24, Y+1 ; 0x01 194d8: 9a 81 ldd r25, Y+2 ; 0x02 194da: 80 34 cpi r24, 0x40 ; 64 194dc: 9b 40 sbci r25, 0x0B ; 11 194de: b8 f4 brcc .+46 ; 0x1950e if ((ret = xyzcal_spiral2(cx, cy, z0 - 3*dz, dz, -radius, 180, delay_us, check_pinda, &ad)) != 0) 194e0: ce 01 movw r24, r28 194e2: 01 96 adiw r24, 0x01 ; 1 194e4: 7c 01 movw r14, r24 194e6: 04 eb ldi r16, 0xB4 ; 180 194e8: 10 e0 ldi r17, 0x00 ; 0 194ea: 2c e7 ldi r18, 0x7C ; 124 194ec: 3c ef ldi r19, 0xFC ; 252 194ee: a6 01 movw r20, r12 194f0: 4c 52 subi r20, 0x2C ; 44 194f2: 51 40 sbci r21, 0x01 ; 1 194f4: 69 2d mov r22, r9 194f6: 78 2d mov r23, r8 194f8: 8b 2d mov r24, r11 194fa: 9a 2d mov r25, r10 194fc: 0f 94 cc 5e call 0x2bd98 ; 0x2bd98 19500: 88 23 and r24, r24 19502: 29 f0 breq .+10 ; 0x1950e ad += 2160; 19504: 89 81 ldd r24, Y+1 ; 0x01 19506: 9a 81 ldd r25, Y+2 ; 0x02 19508: 80 59 subi r24, 0x90 ; 144 1950a: 97 4f sbci r25, 0xF7 ; 247 1950c: 74 ce rjmp .-792 ; 0x191f6 /// magic constant, lowers min_z after searchZ to obtain more dense data in scan const pos_i16_t lower_z = 72; xyzcal_lineXYZ_to(x0, y0, _Z - lower_z, 200, 0); return true; } z -= 400; 1950e: 90 e9 ldi r25, 0x90 ; 144 19510: c9 1a sub r12, r25 19512: 91 e0 ldi r25, 0x01 ; 1 19514: d9 0a sbc r13, r25 19516: 27 ce rjmp .-946 ; 0x19166 } //@size=138 DBG(_n("xyzcal_searchZ no signal\n x=%ld y=%ld z=%ld\n"), count_position[X_AXIS], count_position[Y_AXIS], count_position[Z_AXIS]); 19518: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 1951c: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 19520: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 19524: 30 91 c1 06 lds r19, 0x06C1 ; 0x8006c1 19528: 40 91 ba 06 lds r20, 0x06BA ; 0x8006ba 1952c: 50 91 bb 06 lds r21, 0x06BB ; 0x8006bb 19530: 60 91 bc 06 lds r22, 0x06BC ; 0x8006bc 19534: 70 91 bd 06 lds r23, 0x06BD ; 0x8006bd 19538: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 1953c: 90 91 b7 06 lds r25, 0x06B7 ; 0x8006b7 19540: a0 91 b8 06 lds r26, 0x06B8 ; 0x8006b8 19544: b0 91 b9 06 lds r27, 0x06B9 ; 0x8006b9 19548: 3f 93 push r19 1954a: 2f 93 push r18 1954c: 1f 93 push r17 1954e: 0f 93 push r16 19550: 7f 93 push r23 19552: 6f 93 push r22 19554: 5f 93 push r21 19556: 4f 93 push r20 19558: bf 93 push r27 1955a: af 93 push r26 1955c: 9f 93 push r25 1955e: 8f 93 push r24 19560: 8f e1 ldi r24, 0x1F ; 31 19562: 97 e8 ldi r25, 0x87 ; 135 19564: 9f 93 push r25 19566: 8f 93 push r24 19568: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 1956c: 0f b6 in r0, 0x3f ; 63 1956e: f8 94 cli 19570: de bf out 0x3e, r29 ; 62 19572: 0f be out 0x3f, r0 ; 63 19574: cd bf out 0x3d, r28 ; 61 return ret; } BedSkewOffsetDetectionResultType xyzcal_find_bed_induction_sensor_point_xy(void) { // DBG(_n("xyzcal_find_bed_induction_sensor_point_xy x=%ld y=%ld z=%ld\n"), count_position[X_AXIS], count_position[Y_AXIS], count_position[Z_AXIS]); BedSkewOffsetDetectionResultType ret = BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND; 19576: 1f ef ldi r17, 0xFF ; 255 sm4_calc_delay_cb = xyzcal_calc_delay; } void xyzcal_measure_leave(void) { DBG(_n("xyzcal_measure_leave\n")); 19578: 8f ef ldi r24, 0xFF ; 255 1957a: 97 e8 ldi r25, 0x87 ; 135 1957c: 9f 93 push r25 1957e: 8f 93 push r24 19580: 0f 94 9e 9e call 0x33d3c ; 0x33d3c lcd_set_cursor(4,3); 19584: 63 e0 ldi r22, 0x03 ; 3 19586: 84 e0 ldi r24, 0x04 ; 4 19588: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_space(16); 1958c: 80 e1 ldi r24, 0x10 ; 16 1958e: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 // resync planner position from counters (changed by xyzcal_update_pos) planner_reset_position(); 19592: 0f 94 a3 84 call 0x30946 ; 0x30946 : "n" (_SFR_MEM_ADDR(_WD_CONTROL_REG)), "r" ((uint8_t)(_BV(_WD_CHANGE_BIT) | _BV(WDE))), "r" ((uint8_t) ((value & 0x08 ? _WD_PS3_MASK : 0x00) | _BV(WDE) | (value & 0x07)) ) : "r0" ); 19596: 88 e1 ldi r24, 0x18 ; 24 19598: 98 e2 ldi r25, 0x28 ; 40 1959a: 0f b6 in r0, 0x3f ; 63 1959c: f8 94 cli 1959e: a8 95 wdr 195a0: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 195a4: 0f be out 0x3f, r0 ; 63 195a6: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> // re-enable interrupts #ifdef WATCHDOG wdt_enable(WDTO_4S); #ifdef EMERGENCY_HANDLERS WDTCSR |= (1 << WDIE); 195aa: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 195ae: 80 64 ori r24, 0x40 ; 64 195b0: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #endif //EMERGENCY_HANDLERS #endif //WATCHDOG ENABLE_STEPPER_DRIVER_INTERRUPT(); 195b4: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 195b8: 82 60 ori r24, 0x02 ; 2 195ba: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> delay_keep_alive(3000); #endif // SUPPORT_VERBOSITY BedSkewOffsetDetectionResultType result; result = find_bed_induction_sensor_point_xy(verbosity_level); switch(result){ 195be: 0f 90 pop r0 195c0: 0f 90 pop r0 195c2: 1d 3f cpi r17, 0xFD ; 253 195c4: 09 f4 brne .+2 ; 0x195c8 195c6: 64 c3 rjmp .+1736 ; 0x19c90 195c8: 1f 3f cpi r17, 0xFF ; 255 195ca: 11 f4 brne .+4 ; 0x195d0 195cc: 0c 94 93 d7 jmp 0x1af26 ; 0x1af26 SERIAL_ECHOLNPGM("Measured:"); MYSERIAL.println(current_position[X_AXIS]); MYSERIAL.println(current_position[Y_AXIS]); } #endif // SUPPORT_VERBOSITY pt[0] = (pt[0] * iteration) / (iteration + 1); 195d0: 20 e0 ldi r18, 0x00 ; 0 195d2: 30 e0 ldi r19, 0x00 ; 0 195d4: a9 01 movw r20, r18 195d6: a0 96 adiw r28, 0x20 ; 32 195d8: ee ad ldd r30, Y+62 ; 0x3e 195da: ff ad ldd r31, Y+63 ; 0x3f 195dc: a0 97 sbiw r28, 0x20 ; 32 195de: 61 81 ldd r22, Z+1 ; 0x01 195e0: 72 81 ldd r23, Z+2 ; 0x02 195e2: 83 81 ldd r24, Z+3 ; 0x03 195e4: 94 81 ldd r25, Z+4 ; 0x04 195e6: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> pt[0] += (current_position[X_AXIS]/(iteration + 1)); //count average 195ea: 20 91 f5 11 lds r18, 0x11F5 ; 0x8011f5 195ee: 30 91 f6 11 lds r19, 0x11F6 ; 0x8011f6 195f2: 40 91 f7 11 lds r20, 0x11F7 ; 0x8011f7 195f6: 50 91 f8 11 lds r21, 0x11F8 ; 0x8011f8 195fa: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 195fe: a0 96 adiw r28, 0x20 ; 32 19600: ae ad ldd r26, Y+62 ; 0x3e 19602: bf ad ldd r27, Y+63 ; 0x3f 19604: a0 97 sbiw r28, 0x20 ; 32 19606: 11 96 adiw r26, 0x01 ; 1 19608: 6d 93 st X+, r22 1960a: 7d 93 st X+, r23 1960c: 8d 93 st X+, r24 1960e: 9c 93 st X, r25 19610: 14 97 sbiw r26, 0x04 ; 4 pt[1] = (pt[1] * iteration) / (iteration + 1); pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 19612: c0 90 f9 11 lds r12, 0x11F9 ; 0x8011f9 19616: d0 90 fa 11 lds r13, 0x11FA ; 0x8011fa 1961a: e0 90 fb 11 lds r14, 0x11FB ; 0x8011fb 1961e: f0 90 fc 11 lds r15, 0x11FC ; 0x8011fc MYSERIAL.println(current_position[Y_AXIS]); } #endif // SUPPORT_VERBOSITY pt[0] = (pt[0] * iteration) / (iteration + 1); pt[0] += (current_position[X_AXIS]/(iteration + 1)); //count average pt[1] = (pt[1] * iteration) / (iteration + 1); 19622: 20 e0 ldi r18, 0x00 ; 0 19624: 30 e0 ldi r19, 0x00 ; 0 19626: a9 01 movw r20, r18 19628: 15 96 adiw r26, 0x05 ; 5 1962a: 6d 91 ld r22, X+ 1962c: 7d 91 ld r23, X+ 1962e: 8d 91 ld r24, X+ 19630: 9c 91 ld r25, X 19632: 18 97 sbiw r26, 0x08 ; 8 19634: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 19638: a7 01 movw r20, r14 1963a: 96 01 movw r18, r12 1963c: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 19640: a0 96 adiw r28, 0x20 ; 32 19642: ee ad ldd r30, Y+62 ; 0x3e 19644: ff ad ldd r31, Y+63 ; 0x3f 19646: a0 97 sbiw r28, 0x20 ; 32 19648: 65 83 std Z+5, r22 ; 0x05 1964a: 76 83 std Z+6, r23 ; 0x06 1964c: 87 83 std Z+7, r24 ; 0x07 1964e: 90 87 std Z+8, r25 ; 0x08 SERIAL_ECHOPGM("pt[1]:"); MYSERIAL.println(pt[1]); } #endif // SUPPORT_VERBOSITY if (current_position[Y_AXIS] < Y_MIN_POS) 19650: 20 e0 ldi r18, 0x00 ; 0 19652: 30 e0 ldi r19, 0x00 ; 0 19654: 40 e8 ldi r20, 0x80 ; 128 19656: 50 ec ldi r21, 0xC0 ; 192 19658: c7 01 movw r24, r14 1965a: b6 01 movw r22, r12 1965c: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 19660: 87 ff sbrs r24, 7 19662: 0c c0 rjmp .+24 ; 0x1967c current_position[Y_AXIS] = Y_MIN_POS; 19664: 80 e0 ldi r24, 0x00 ; 0 19666: 90 e0 ldi r25, 0x00 ; 0 19668: a0 e8 ldi r26, 0x80 ; 128 1966a: b0 ec ldi r27, 0xC0 ; 192 1966c: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 19670: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 19674: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 19678: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc // Start searching for the other points at 3mm above the last point. current_position[Z_AXIS] += 3.f + FIND_BED_INDUCTION_SENSOR_POINT_Z_STEP * iteration * 0.3; 1967c: 20 e0 ldi r18, 0x00 ; 0 1967e: 30 e0 ldi r19, 0x00 ; 0 19680: 40 e4 ldi r20, 0x40 ; 64 19682: 50 e4 ldi r21, 0x40 ; 64 19684: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 19688: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 1968c: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 19690: 90 91 00 12 lds r25, 0x1200 ; 0x801200 19694: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 19698: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 1969c: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 196a0: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 196a4: 90 93 00 12 sts 0x1200, r25 ; 0x801200 196a8: e0 96 adiw r28, 0x30 ; 48 196aa: 2e ad ldd r18, Y+62 ; 0x3e 196ac: 3f ad ldd r19, Y+63 ; 0x3f 196ae: e0 97 sbiw r28, 0x30 ; 48 196b0: 28 5f subi r18, 0xF8 ; 248 196b2: 3f 4f sbci r19, 0xFF ; 255 196b4: e0 96 adiw r28, 0x30 ; 48 196b6: 3f af std Y+63, r19 ; 0x3f 196b8: 2e af std Y+62, r18 ; 0x3e 196ba: e0 97 sbiw r28, 0x30 ; 48 196bc: a0 96 adiw r28, 0x20 ; 32 196be: 4e ad ldd r20, Y+62 ; 0x3e 196c0: 5f ad ldd r21, Y+63 ; 0x3f 196c2: a0 97 sbiw r28, 0x20 ; 32 196c4: 48 5f subi r20, 0xF8 ; 248 196c6: 5f 4f sbci r21, 0xFF ; 255 196c8: a0 96 adiw r28, 0x20 ; 32 196ca: 5f af std Y+63, r21 ; 0x3f 196cc: 4e af std Y+62, r20 ; 0x3e 196ce: a0 97 sbiw r28, 0x20 ; 32 /// Retry point scanning if a point with bad data appears. /// Bad data could be cause by "cold" sensor. /// This behavior vanishes after few point scans so retry will help. for (uint8_t retries = 0; retries <= 1; ++retries) { bool retry = false; for (int k = 0; k < 4; ++k) { 196d0: 54 e0 ldi r21, 0x04 ; 4 196d2: 25 16 cp r2, r21 196d4: 31 04 cpc r3, r1 196d6: 09 f0 breq .+2 ; 0x196da 196d8: 83 cc rjmp .-1786 ; 0x18fe0 go_to_current(homing_feedrate[X_AXIS] / 60.f); delay_keep_alive(3000); } #endif // SUPPORT_VERBOSITY } if (!retry) 196da: a7 96 adiw r28, 0x27 ; 39 196dc: 6f ad ldd r22, Y+63 ; 0x3f 196de: a7 97 sbiw r28, 0x27 ; 39 196e0: 66 23 and r22, r22 196e2: 31 f0 breq .+12 ; 0x196f0 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH + FIND_BED_INDUCTION_SENSOR_POINT_Z_STEP * iteration * 0.3; /// Retry point scanning if a point with bad data appears. /// Bad data could be cause by "cold" sensor. /// This behavior vanishes after few point scans so retry will help. for (uint8_t retries = 0; retries <= 1; ++retries) { 196e4: e1 96 adiw r28, 0x31 ; 49 196e6: 8f ad ldd r24, Y+63 ; 0x3f 196e8: e1 97 sbiw r28, 0x31 ; 49 196ea: 81 30 cpi r24, 0x01 ; 1 196ec: 09 f0 breq .+2 ; 0x196f0 196ee: da ce rjmp .-588 ; 0x194a4 #endif // SUPPORT_VERBOSITY } if (!retry) break; } DBG(_n("All 4 calibration points found.\n")); 196f0: 81 e9 ldi r24, 0x91 ; 145 196f2: 99 e6 ldi r25, 0x69 ; 105 196f4: 9f 93 push r25 196f6: 8f 93 push r24 196f8: 0f 94 9e 9e call 0x33d3c ; 0x33d3c delay_keep_alive(0); //manage_heater, reset watchdog, manage inactivity 196fc: 90 e0 ldi r25, 0x00 ; 0 196fe: 80 e0 ldi r24, 0x00 ; 0 19700: 0e 94 48 7c call 0xf890 ; 0xf890 go_to_current(homing_feedrate[X_AXIS] / 60); delay_keep_alive(3000); } } #endif // SUPPORT_VERBOSITY if (pts[1] < Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH) { 19704: 0f 90 pop r0 19706: 0f 90 pop r0 19708: 20 e0 ldi r18, 0x00 ; 0 1970a: 30 e0 ldi r19, 0x00 ; 0 1970c: 40 e9 ldi r20, 0x90 ; 144 1970e: 50 ec ldi r21, 0xC0 ; 192 19710: 60 91 a1 12 lds r22, 0x12A1 ; 0x8012a1 19714: 70 91 a2 12 lds r23, 0x12A2 ; 0x8012a2 19718: 80 91 a3 12 lds r24, 0x12A3 ; 0x8012a3 1971c: 90 91 a4 12 lds r25, 0x12A4 ; 0x8012a4 19720: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 19724: 87 ff sbrs r24, 7 19726: bb c2 rjmp .+1398 ; 0x19c9e too_far_mask |= 1 << 1; //front center point is out of reach SERIAL_ECHOLNPGM(""); 19728: 8b e4 ldi r24, 0x4B ; 75 1972a: 98 e8 ldi r25, 0x88 ; 136 1972c: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 SERIAL_ECHOPGM("WARNING: Front point not reachable. Y coordinate:"); 19730: 89 e1 ldi r24, 0x19 ; 25 19732: 98 e8 ldi r25, 0x88 ; 136 19734: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 19738: 60 91 a1 12 lds r22, 0x12A1 ; 0x8012a1 1973c: 70 91 a2 12 lds r23, 0x12A2 ; 0x8012a2 19740: 80 91 a3 12 lds r24, 0x12A3 ; 0x8012a3 19744: 90 91 a4 12 lds r25, 0x12A4 ; 0x8012a4 19748: 42 e0 ldi r20, 0x02 ; 2 1974a: 0f 94 49 97 call 0x32e92 ; 0x32e92 MYSERIAL.print(pts[1]); SERIAL_ECHOPGM(" < "); 1974e: 85 e1 ldi r24, 0x15 ; 21 19750: 98 e8 ldi r25, 0x88 ; 136 19752: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 MYSERIAL.println(Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 19756: 60 e0 ldi r22, 0x00 ; 0 19758: 70 e0 ldi r23, 0x00 ; 0 1975a: 80 e9 ldi r24, 0x90 ; 144 1975c: 90 ec ldi r25, 0xC0 ; 192 1975e: 0f 94 8d 41 call 0x2831a ; 0x2831a delay_keep_alive(3000); } } #endif // SUPPORT_VERBOSITY if (pts[1] < Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH) { too_far_mask |= 1 << 1; //front center point is out of reach 19762: 92 e0 ldi r25, 0x02 ; 2 19764: af 96 adiw r28, 0x2f ; 47 19766: 9f af std Y+63, r25 ; 0x3f 19768: af 97 sbiw r28, 0x2f ; 47 #endif // SUPPORT_VERBOSITY // Run some iterations of the Gauss-Newton method of non-linear least squares. // Initial set of parameters: // X,Y offset cntr[0] = 0.f; 1976a: 10 92 cd 12 sts 0x12CD, r1 ; 0x8012cd 1976e: 10 92 ce 12 sts 0x12CE, r1 ; 0x8012ce 19772: 10 92 cf 12 sts 0x12CF, r1 ; 0x8012cf 19776: 10 92 d0 12 sts 0x12D0, r1 ; 0x8012d0 cntr[1] = 0.f; 1977a: 10 92 d1 12 sts 0x12D1, r1 ; 0x8012d1 1977e: 10 92 d2 12 sts 0x12D2, r1 ; 0x8012d2 19782: 10 92 d3 12 sts 0x12D3, r1 ; 0x8012d3 19786: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 1978a: a4 e6 ldi r26, 0x64 ; 100 1978c: e6 96 adiw r28, 0x36 ; 54 1978e: af af std Y+63, r26 ; 0x3f 19790: e6 97 sbiw r28, 0x36 ; 54 // Rotation of the machine X axis from the bed X axis. float a1 = 0; // Rotation of the machine Y axis from the bed Y axis. float a2 = 0; 19792: a2 96 adiw r28, 0x22 ; 34 19794: 1c ae std Y+60, r1 ; 0x3c 19796: 1d ae std Y+61, r1 ; 0x3d 19798: 1e ae std Y+62, r1 ; 0x3e 1979a: 1f ae std Y+63, r1 ; 0x3f 1979c: a2 97 sbiw r28, 0x22 ; 34 // Initial set of parameters: // X,Y offset cntr[0] = 0.f; cntr[1] = 0.f; // Rotation of the machine X axis from the bed X axis. float a1 = 0; 1979e: a6 96 adiw r28, 0x26 ; 38 197a0: 1c ae std Y+60, r1 ; 0x3c 197a2: 1d ae std Y+61, r1 ; 0x3d 197a4: 1e ae std Y+62, r1 ; 0x3e 197a6: 1f ae std Y+63, r1 ; 0x3f 197a8: a6 97 sbiw r28, 0x26 ; 38 float c1 = cos(a1) * MACHINE_AXIS_SCALE_X; float s1 = sin(a1) * MACHINE_AXIS_SCALE_X; float c2 = cos(a2) * MACHINE_AXIS_SCALE_Y; float s2 = sin(a2) * MACHINE_AXIS_SCALE_Y; // Prepare the Normal equation for the Gauss-Newton method. float A[4][4] = { 0.f }; 197aa: fe 01 movw r30, r28 197ac: 31 96 adiw r30, 0x01 ; 1 197ae: 68 96 adiw r28, 0x18 ; 24 197b0: ff af std Y+63, r31 ; 0x3f 197b2: ee af std Y+62, r30 ; 0x3e 197b4: 68 97 sbiw r28, 0x18 ; 24 float b[4] = { 0.f }; 197b6: 9e 01 movw r18, r28 197b8: 2f 5b subi r18, 0xBF ; 191 197ba: 3f 4f sbci r19, 0xFF ; 255 197bc: 6a 96 adiw r28, 0x1a ; 26 197be: 3f af std Y+63, r19 ; 0x3f 197c0: 2e af std Y+62, r18 ; 0x3e 197c2: 6a 97 sbiw r28, 0x1a ; 26 // Rotation of the machine X axis from the bed X axis. float a1 = 0; // Rotation of the machine Y axis from the bed Y axis. float a2 = 0; for (int8_t iter = 0; iter < 100; ++iter) { float c1 = cos(a1) * MACHINE_AXIS_SCALE_X; 197c4: a6 96 adiw r28, 0x26 ; 38 197c6: 6c ad ldd r22, Y+60 ; 0x3c 197c8: 7d ad ldd r23, Y+61 ; 0x3d 197ca: 8e ad ldd r24, Y+62 ; 0x3e 197cc: 9f ad ldd r25, Y+63 ; 0x3f 197ce: a6 97 sbiw r28, 0x26 ; 38 197d0: 0f 94 fe a1 call 0x343fc ; 0x343fc 197d4: 6e 96 adiw r28, 0x1e ; 30 197d6: 6c af std Y+60, r22 ; 0x3c 197d8: 7d af std Y+61, r23 ; 0x3d 197da: 8e af std Y+62, r24 ; 0x3e 197dc: 9f af std Y+63, r25 ; 0x3f 197de: 6e 97 sbiw r28, 0x1e ; 30 float s1 = sin(a1) * MACHINE_AXIS_SCALE_X; 197e0: a6 96 adiw r28, 0x26 ; 38 197e2: 6c ad ldd r22, Y+60 ; 0x3c 197e4: 7d ad ldd r23, Y+61 ; 0x3d 197e6: 8e ad ldd r24, Y+62 ; 0x3e 197e8: 9f ad ldd r25, Y+63 ; 0x3f 197ea: a6 97 sbiw r28, 0x26 ; 38 197ec: 0f 94 c4 a4 call 0x34988 ; 0x34988 197f0: cb 57 subi r28, 0x7B ; 123 197f2: df 4f sbci r29, 0xFF ; 255 197f4: 68 83 st Y, r22 197f6: 79 83 std Y+1, r23 ; 0x01 197f8: 8a 83 std Y+2, r24 ; 0x02 197fa: 9b 83 std Y+3, r25 ; 0x03 197fc: c5 58 subi r28, 0x85 ; 133 197fe: d0 40 sbci r29, 0x00 ; 0 float c2 = cos(a2) * MACHINE_AXIS_SCALE_Y; 19800: a2 96 adiw r28, 0x22 ; 34 19802: 6c ad ldd r22, Y+60 ; 0x3c 19804: 7d ad ldd r23, Y+61 ; 0x3d 19806: 8e ad ldd r24, Y+62 ; 0x3e 19808: 9f ad ldd r25, Y+63 ; 0x3f 1980a: a2 97 sbiw r28, 0x22 ; 34 1980c: 0f 94 fe a1 call 0x343fc ; 0x343fc 19810: c7 57 subi r28, 0x77 ; 119 19812: df 4f sbci r29, 0xFF ; 255 19814: 68 83 st Y, r22 19816: 79 83 std Y+1, r23 ; 0x01 19818: 8a 83 std Y+2, r24 ; 0x02 1981a: 9b 83 std Y+3, r25 ; 0x03 1981c: c9 58 subi r28, 0x89 ; 137 1981e: d0 40 sbci r29, 0x00 ; 0 float s2 = sin(a2) * MACHINE_AXIS_SCALE_Y; 19820: a2 96 adiw r28, 0x22 ; 34 19822: 6c ad ldd r22, Y+60 ; 0x3c 19824: 7d ad ldd r23, Y+61 ; 0x3d 19826: 8e ad ldd r24, Y+62 ; 0x3e 19828: 9f ad ldd r25, Y+63 ; 0x3f 1982a: a2 97 sbiw r28, 0x22 ; 34 1982c: 0f 94 c4 a4 call 0x34988 ; 0x34988 19830: cb 56 subi r28, 0x6B ; 107 19832: df 4f sbci r29, 0xFF ; 255 19834: 68 83 st Y, r22 19836: 79 83 std Y+1, r23 ; 0x01 19838: 8a 83 std Y+2, r24 ; 0x02 1983a: 9b 83 std Y+3, r25 ; 0x03 1983c: c5 59 subi r28, 0x95 ; 149 1983e: d0 40 sbci r29, 0x00 ; 0 // Prepare the Normal equation for the Gauss-Newton method. float A[4][4] = { 0.f }; 19840: 68 96 adiw r28, 0x18 ; 24 19842: ae ad ldd r26, Y+62 ; 0x3e 19844: bf ad ldd r27, Y+63 ; 0x3f 19846: 68 97 sbiw r28, 0x18 ; 24 19848: e0 e4 ldi r30, 0x40 ; 64 1984a: 1d 92 st X+, r1 1984c: ea 95 dec r30 1984e: e9 f7 brne .-6 ; 0x1984a float b[4] = { 0.f }; 19850: 80 e1 ldi r24, 0x10 ; 16 19852: 6a 96 adiw r28, 0x1a ; 26 19854: ae ad ldd r26, Y+62 ; 0x3e 19856: bf ad ldd r27, Y+63 ; 0x3f 19858: 6a 97 sbiw r28, 0x1a ; 26 1985a: 1d 92 st X+, r1 1985c: 8a 95 dec r24 1985e: e9 f7 brne .-6 ; 0x1985a float acc; delay_keep_alive(0); //manage heater, reset watchdog, manage inactivity 19860: 90 e0 ldi r25, 0x00 ; 0 19862: 80 e0 ldi r24, 0x00 ; 0 19864: 0e 94 48 7c call 0xf890 ; 0xf890 float j = (r == 0) ? 1.f : ((r == 1) ? 0.f : ((r == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1]))); float fx = c1 * measured_pts[2 * i] - s2 * measured_pts[2 * i + 1] + cntr[0] - pgm_read_float(true_pts + i * 2); 19868: 20 91 cd 12 lds r18, 0x12CD ; 0x8012cd 1986c: 30 91 ce 12 lds r19, 0x12CE ; 0x8012ce 19870: 40 91 cf 12 lds r20, 0x12CF ; 0x8012cf 19874: 50 91 d0 12 lds r21, 0x12D0 ; 0x8012d0 19878: c5 55 subi r28, 0x55 ; 85 1987a: df 4f sbci r29, 0xFF ; 255 1987c: 28 83 st Y, r18 1987e: 39 83 std Y+1, r19 ; 0x01 19880: 4a 83 std Y+2, r20 ; 0x02 19882: 5b 83 std Y+3, r21 ; 0x03 19884: cb 5a subi r28, 0xAB ; 171 19886: d0 40 sbci r29, 0x00 ; 0 float j = (r == 0) ? 0.f : ((r == 1) ? 1.f : ((r == 2) ? ( c1 * measured_pts[2 * i]) : (-s2 * measured_pts[2 * i + 1]))); float fy = s1 * measured_pts[2 * i] + c2 * measured_pts[2 * i + 1] + cntr[1] - pgm_read_float(true_pts + i * 2 + 1); 19888: 80 91 d1 12 lds r24, 0x12D1 ; 0x8012d1 1988c: 90 91 d2 12 lds r25, 0x12D2 ; 0x8012d2 19890: a0 91 d3 12 lds r26, 0x12D3 ; 0x8012d3 19894: b0 91 d4 12 lds r27, 0x12D4 ; 0x8012d4 19898: c1 55 subi r28, 0x51 ; 81 1989a: df 4f sbci r29, 0xFF ; 255 1989c: 88 83 st Y, r24 1989e: 99 83 std Y+1, r25 ; 0x01 198a0: aa 83 std Y+2, r26 ; 0x02 198a2: bb 83 std Y+3, r27 ; 0x03 198a4: cf 5a subi r28, 0xAF ; 175 198a6: d0 40 sbci r29, 0x00 ; 0 198a8: de 01 movw r26, r28 198aa: af 5b subi r26, 0xBF ; 191 198ac: bf 4f sbci r27, 0xFF ; 255 198ae: c7 56 subi r28, 0x67 ; 103 198b0: df 4f sbci r29, 0xFF ; 255 198b2: b9 83 std Y+1, r27 ; 0x01 198b4: a8 83 st Y, r26 198b6: c9 59 subi r28, 0x99 ; 153 198b8: d0 40 sbci r29, 0x00 ; 0 198ba: fe 01 movw r30, r28 198bc: 31 96 adiw r30, 0x01 ; 1 198be: ac 96 adiw r28, 0x2c ; 44 198c0: ff af std Y+63, r31 ; 0x3f 198c2: ee af std Y+62, r30 ; 0x3e 198c4: ac 97 sbiw r28, 0x2c ; 44 // Prepare the Normal equation for the Gauss-Newton method. float A[4][4] = { 0.f }; float b[4] = { 0.f }; float acc; delay_keep_alive(0); //manage heater, reset watchdog, manage inactivity for (uint8_t r = 0; r < 4; ++r) { 198c6: 00 e0 ldi r16, 0x00 ; 0 ((r == 2) ? ( c1 * measured_pts[2 * i]) : (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : ((c == 2) ? ( c1 * measured_pts[2 * i]) : (-s2 * measured_pts[2 * i + 1])); 198c8: cb 56 subi r28, 0x6B ; 107 198ca: df 4f sbci r29, 0xFF ; 255 198cc: 28 81 ld r18, Y 198ce: 39 81 ldd r19, Y+1 ; 0x01 198d0: 4a 81 ldd r20, Y+2 ; 0x02 198d2: 5b 81 ldd r21, Y+3 ; 0x03 198d4: c5 59 subi r28, 0x95 ; 149 198d6: d0 40 sbci r29, 0x00 ; 0 198d8: 50 58 subi r21, 0x80 ; 128 198da: ed 96 adiw r28, 0x3d ; 61 198dc: 2c af std Y+60, r18 ; 0x3c 198de: 3d af std Y+61, r19 ; 0x3d 198e0: 4e af std Y+62, r20 ; 0x3e 198e2: 5f af std Y+63, r21 ; 0x3f 198e4: ed 97 sbiw r28, 0x3d ; 61 ((r == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : ((c == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1])); 198e6: c7 57 subi r28, 0x77 ; 119 198e8: df 4f sbci r29, 0xFF ; 255 198ea: 88 81 ld r24, Y 198ec: 99 81 ldd r25, Y+1 ; 0x01 198ee: aa 81 ldd r26, Y+2 ; 0x02 198f0: bb 81 ldd r27, Y+3 ; 0x03 198f2: c9 58 subi r28, 0x89 ; 137 198f4: d0 40 sbci r29, 0x00 ; 0 198f6: b0 58 subi r27, 0x80 ; 128 198f8: c3 58 subi r28, 0x83 ; 131 198fa: df 4f sbci r29, 0xFF ; 255 198fc: 88 83 st Y, r24 198fe: 99 83 std Y+1, r25 ; 0x01 19900: aa 83 std Y+2, r26 ; 0x02 19902: bb 83 std Y+3, r27 ; 0x03 19904: cd 57 subi r28, 0x7D ; 125 19906: d0 40 sbci r29, 0x00 ; 0 (r == 0) ? 1.f : ((r == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : ((c == 2) ? (-s1 * measured_pts[2 * i]) : 19908: cb 57 subi r28, 0x7B ; 123 1990a: df 4f sbci r29, 0xFF ; 255 1990c: 28 81 ld r18, Y 1990e: 39 81 ldd r19, Y+1 ; 0x01 19910: 4a 81 ldd r20, Y+2 ; 0x02 19912: 5b 81 ldd r21, Y+3 ; 0x03 19914: c5 58 subi r28, 0x85 ; 133 19916: d0 40 sbci r29, 0x00 ; 0 19918: 50 58 subi r21, 0x80 ; 128 1991a: cf 57 subi r28, 0x7F ; 127 1991c: df 4f sbci r29, 0xFF ; 255 1991e: 28 83 st Y, r18 19920: 39 83 std Y+1, r19 ; 0x01 19922: 4a 83 std Y+2, r20 ; 0x02 19924: 5b 83 std Y+3, r21 ; 0x03 19926: c1 58 subi r28, 0x81 ; 129 19928: d0 40 sbci r29, 0x00 ; 0 // Prepare the Normal equation for the Gauss-Newton method. float A[4][4] = { 0.f }; float b[4] = { 0.f }; float acc; delay_keep_alive(0); //manage heater, reset watchdog, manage inactivity for (uint8_t r = 0; r < 4; ++r) { 1992a: ac 96 adiw r28, 0x2c ; 44 1992c: 2e ac ldd r2, Y+62 ; 0x3e 1992e: 3f ac ldd r3, Y+63 ; 0x3f 19930: ac 97 sbiw r28, 0x2c ; 44 for (uint8_t c = 0; c < 4; ++c) { 19932: 10 e0 ldi r17, 0x00 ; 0 19934: 6c e9 ldi r22, 0x9C ; 156 19936: 46 2e mov r4, r22 19938: 62 e1 ldi r22, 0x12 ; 18 1993a: 56 2e mov r5, r22 1993c: 74 e0 ldi r23, 0x04 ; 4 1993e: 77 2e mov r7, r23 acc = 0; 19940: c1 2c mov r12, r1 19942: d1 2c mov r13, r1 19944: 76 01 movw r14, r12 // J^T times J for (uint8_t i = 0; i < npts; ++i) { // First for the residuum in the x axis: if (r != 1 && c != 1) { 19946: 01 30 cpi r16, 0x01 ; 1 19948: 11 f4 brne .+4 ; 0x1994e 1994a: 0c 94 4b d8 jmp 0x1b096 ; 0x1b096 1994e: 11 30 cpi r17, 0x01 ; 1 19950: 11 f4 brne .+4 ; 0x19956 19952: 0c 94 f9 d7 jmp 0x1aff2 ; 0x1aff2 float a = (r == 0) ? 1.f : 19956: 00 23 and r16, r16 19958: 11 f4 brne .+4 ; 0x1995e 1995a: 0c 94 39 d8 jmp 0x1b072 ; 0x1b072 ((r == 2) ? (-s1 * measured_pts[2 * i]) : 1995e: 02 30 cpi r16, 0x02 ; 2 19960: 09 f0 breq .+2 ; 0x19964 19962: a1 c1 rjmp .+834 ; 0x19ca6 19964: d2 01 movw r26, r4 19966: 11 96 adiw r26, 0x01 ; 1 19968: 2d 91 ld r18, X+ 1996a: 3d 91 ld r19, X+ 1996c: 4d 91 ld r20, X+ 1996e: 5c 91 ld r21, X 19970: 14 97 sbiw r26, 0x04 ; 4 19972: cf 57 subi r28, 0x7F ; 127 19974: df 4f sbci r29, 0xFF ; 255 19976: 68 81 ld r22, Y 19978: 79 81 ldd r23, Y+1 ; 0x01 1997a: 8a 81 ldd r24, Y+2 ; 0x02 1997c: 9b 81 ldd r25, Y+3 ; 0x03 1997e: c1 58 subi r28, 0x81 ; 129 19980: d0 40 sbci r29, 0x00 ; 0 19982: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 19986: 4b 01 movw r8, r22 19988: 5c 01 movw r10, r24 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 1998a: 11 11 cpse r17, r1 1998c: 9a c1 rjmp .+820 ; 0x19cc2 1998e: 60 e0 ldi r22, 0x00 ; 0 19990: 70 e0 ldi r23, 0x00 ; 0 19992: 80 e8 ldi r24, 0x80 ; 128 19994: 9f e3 ldi r25, 0x3F ; 63 19996: aa c1 rjmp .+852 ; 0x19cec int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { ++mins; } else if (matrix32[i] == 0xFF){ 19998: 2f 3f cpi r18, 0xFF ; 255 1999a: 09 f0 breq .+2 ; 0x1999e 1999c: fe cc rjmp .-1540 ; 0x1939a ++maxs; 1999e: 01 96 adiw r24, 0x01 ; 1 199a0: fc cc rjmp .-1544 ; 0x1939a 199a2: ae 01 movw r20, r28 199a4: 4f 5f subi r20, 0xFF ; 255 199a6: 5f 4f sbci r21, 0xFF ; 255 199a8: be 01 movw r22, r28 199aa: 6f 5b subi r22, 0xBF ; 191 199ac: 7f 4f sbci r23, 0xFF ; 255 199ae: 80 ee ldi r24, 0xE0 ; 224 199b0: 9a e0 ldi r25, 0x0A ; 10 199b2: 0f 94 77 5a call 0x2b4ee ; 0x2b4ee match08 = xyzcal_find_pattern_12x12_in_32x32(matrix32, pattern08, &c08, &r08); match10 = xyzcal_find_pattern_12x12_in_32x32(matrix32, pattern10, &c10, &r10); if (match08 > match10){ col = c08; 199b6: 66 96 adiw r28, 0x16 ; 22 199b8: 6f ad ldd r22, Y+63 ; 0x3f 199ba: 66 97 sbiw r28, 0x16 ; 22 row = r08; 199bc: 62 96 adiw r28, 0x12 ; 18 199be: 1f ad ldd r17, Y+63 ; 0x3f 199c0: 62 97 sbiw r28, 0x12 ; 18 uint8_t match10 = 0; match08 = xyzcal_find_pattern_12x12_in_32x32(matrix32, pattern08, &c08, &r08); match10 = xyzcal_find_pattern_12x12_in_32x32(matrix32, pattern10, &c10, &r10); if (match08 > match10){ 199c2: 80 17 cp r24, r16 199c4: 28 f0 brcs .+10 ; 0x199d0 col = c08; row = r08; return match08; } col = c10; 199c6: 22 96 adiw r28, 0x02 ; 2 199c8: 6f ad ldd r22, Y+63 ; 0x3f 199ca: 22 97 sbiw r28, 0x02 ; 2 row = r10; 199cc: 19 81 ldd r17, Y+1 ; 0x01 199ce: 08 2f mov r16, r24 /// SEARCH FOR BINARY CIRCLE uint8_t uc = 0; uint8_t ur = 0; /// max match = 132, 1/2 good = 66, 2/3 good = 88 if (find_patterns(matrix32, pattern08, pattern10, uc, ur) >= 88){ 199d0: 08 35 cpi r16, 0x58 ; 88 199d2: 08 f4 brcc .+2 ; 0x199d6 199d4: 5b c1 rjmp .+694 ; 0x19c8c /// find precise circle /// move to the center of the pattern (+5.5) float xf = uc + 5.5f; 199d6: 70 e0 ldi r23, 0x00 ; 0 199d8: 90 e0 ldi r25, 0x00 ; 0 199da: 80 e0 ldi r24, 0x00 ; 0 199dc: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 199e0: 20 e0 ldi r18, 0x00 ; 0 199e2: 30 e0 ldi r19, 0x00 ; 0 199e4: 40 eb ldi r20, 0xB0 ; 176 199e6: 50 e4 ldi r21, 0x40 ; 64 199e8: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 199ec: 2b 01 movw r4, r22 199ee: 3c 01 movw r6, r24 199f0: 65 96 adiw r28, 0x15 ; 21 199f2: 4c ae std Y+60, r4 ; 0x3c 199f4: 5d ae std Y+61, r5 ; 0x3d 199f6: 6e ae std Y+62, r6 ; 0x3e 199f8: 7f ae std Y+63, r7 ; 0x3f 199fa: 65 97 sbiw r28, 0x15 ; 21 float yf = ur + 5.5f; 199fc: 61 2f mov r22, r17 199fe: 70 e0 ldi r23, 0x00 ; 0 19a00: 90 e0 ldi r25, 0x00 ; 0 19a02: 80 e0 ldi r24, 0x00 ; 0 19a04: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 19a08: 20 e0 ldi r18, 0x00 ; 0 19a0a: 30 e0 ldi r19, 0x00 ; 0 19a0c: 40 eb ldi r20, 0xB0 ; 176 19a0e: 50 e4 ldi r21, 0x40 ; 64 19a10: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 19a14: 4b 01 movw r8, r22 19a16: 5c 01 movw r10, r24 19a18: 25 96 adiw r28, 0x05 ; 5 19a1a: 8c ae std Y+60, r8 ; 0x3c 19a1c: 9d ae std Y+61, r9 ; 0x3d 19a1e: ae ae std Y+62, r10 ; 0x3e 19a20: bf ae std Y+63, r11 ; 0x3f 19a22: 25 97 sbiw r28, 0x05 ; 5 float radius = 4.5f; ///< default radius 19a24: 20 e0 ldi r18, 0x00 ; 0 19a26: 30 e0 ldi r19, 0x00 ; 0 19a28: 40 e9 ldi r20, 0x90 ; 144 19a2a: 50 e4 ldi r21, 0x40 ; 64 19a2c: 29 83 std Y+1, r18 ; 0x01 19a2e: 3a 83 std Y+2, r19 ; 0x02 19a30: 4b 83 std Y+3, r20 ; 0x03 19a32: 5c 83 std Y+4, r21 ; 0x04 constexpr const uint8_t iterations = 20; dynamic_circle(matrix32, xf, yf, radius, iterations); 19a34: ae 01 movw r20, r28 19a36: 4f 5f subi r20, 0xFF ; 255 19a38: 5f 4f sbci r21, 0xFF ; 255 19a3a: be 01 movw r22, r28 19a3c: 6f 5b subi r22, 0xBF ; 191 19a3e: 7f 4f sbci r23, 0xFF ; 255 19a40: ce 01 movw r24, r28 19a42: 8f 5a subi r24, 0xAF ; 175 19a44: 9f 4f sbci r25, 0xFF ; 255 19a46: 0f 94 2c 57 call 0x2ae58 ; 0x2ae58 if (fabs(xf - (uc + 5.5f)) > 3 || fabs(yf - (ur + 5.5f)) > 3 || fabs(radius - 5) > 3){ 19a4a: a3 01 movw r20, r6 19a4c: 92 01 movw r18, r4 19a4e: 65 96 adiw r28, 0x15 ; 21 19a50: 6c ad ldd r22, Y+60 ; 0x3c 19a52: 7d ad ldd r23, Y+61 ; 0x3d 19a54: 8e ad ldd r24, Y+62 ; 0x3e 19a56: 9f ad ldd r25, Y+63 ; 0x3f 19a58: 65 97 sbiw r28, 0x15 ; 21 19a5a: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 19a5e: 6b 01 movw r12, r22 19a60: 7c 01 movw r14, r24 19a62: 9f 77 andi r25, 0x7F ; 127 19a64: 20 e0 ldi r18, 0x00 ; 0 19a66: 30 e0 ldi r19, 0x00 ; 0 19a68: 40 e4 ldi r20, 0x40 ; 64 19a6a: 50 e4 ldi r21, 0x40 ; 64 19a6c: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 19a70: 18 16 cp r1, r24 19a72: 34 f1 brlt .+76 ; 0x19ac0 19a74: a5 01 movw r20, r10 19a76: 94 01 movw r18, r8 19a78: 25 96 adiw r28, 0x05 ; 5 19a7a: 6c ad ldd r22, Y+60 ; 0x3c 19a7c: 7d ad ldd r23, Y+61 ; 0x3d 19a7e: 8e ad ldd r24, Y+62 ; 0x3e 19a80: 9f ad ldd r25, Y+63 ; 0x3f 19a82: 25 97 sbiw r28, 0x05 ; 5 19a84: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 19a88: 9f 77 andi r25, 0x7F ; 127 19a8a: 20 e0 ldi r18, 0x00 ; 0 19a8c: 30 e0 ldi r19, 0x00 ; 0 19a8e: 40 e4 ldi r20, 0x40 ; 64 19a90: 50 e4 ldi r21, 0x40 ; 64 19a92: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 19a96: 18 16 cp r1, r24 19a98: 9c f0 brlt .+38 ; 0x19ac0 19a9a: 20 e0 ldi r18, 0x00 ; 0 19a9c: 30 e0 ldi r19, 0x00 ; 0 19a9e: 40 ea ldi r20, 0xA0 ; 160 19aa0: 50 e4 ldi r21, 0x40 ; 64 19aa2: 69 81 ldd r22, Y+1 ; 0x01 19aa4: 7a 81 ldd r23, Y+2 ; 0x02 19aa6: 8b 81 ldd r24, Y+3 ; 0x03 19aa8: 9c 81 ldd r25, Y+4 ; 0x04 19aaa: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 19aae: 9f 77 andi r25, 0x7F ; 127 19ab0: 20 e0 ldi r18, 0x00 ; 0 19ab2: 30 e0 ldi r19, 0x00 ; 0 19ab4: 40 e4 ldi r20, 0x40 ; 64 19ab6: 50 e4 ldi r21, 0x40 ; 64 19ab8: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 19abc: 18 16 cp r1, r24 19abe: bc f5 brge .+110 ; 0x19b2e //@size=88 DBG(_n(" [%f %f][%f] mm divergence\n"), xf - (uc + 5.5f), yf - (ur + 5.5f), radius - 5); 19ac0: 20 e0 ldi r18, 0x00 ; 0 19ac2: 30 e0 ldi r19, 0x00 ; 0 19ac4: 40 ea ldi r20, 0xA0 ; 160 19ac6: 50 e4 ldi r21, 0x40 ; 64 19ac8: 69 81 ldd r22, Y+1 ; 0x01 19aca: 7a 81 ldd r23, Y+2 ; 0x02 19acc: 8b 81 ldd r24, Y+3 ; 0x03 19ace: 9c 81 ldd r25, Y+4 ; 0x04 19ad0: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 19ad4: 9f 93 push r25 19ad6: 8f 93 push r24 19ad8: 7f 93 push r23 19ada: 6f 93 push r22 19adc: a5 01 movw r20, r10 19ade: 94 01 movw r18, r8 19ae0: 25 96 adiw r28, 0x05 ; 5 19ae2: 6c ad ldd r22, Y+60 ; 0x3c 19ae4: 7d ad ldd r23, Y+61 ; 0x3d 19ae6: 8e ad ldd r24, Y+62 ; 0x3e 19ae8: 9f ad ldd r25, Y+63 ; 0x3f 19aea: 25 97 sbiw r28, 0x05 ; 5 19aec: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 19af0: 9f 93 push r25 19af2: 8f 93 push r24 19af4: 7f 93 push r23 19af6: 6f 93 push r22 19af8: ff 92 push r15 19afa: ef 92 push r14 19afc: df 92 push r13 19afe: cf 92 push r12 19b00: 83 eb ldi r24, 0xB3 ; 179 19b02: 97 e8 ldi r25, 0x87 ; 135 19b04: 9f 93 push r25 19b06: 8f 93 push r24 19b08: 0f 94 9e 9e call 0x33d3c ; 0x33d3c /// dynamic algorithm diverged, use original position instead xf = uc + 5.5f; 19b0c: 65 96 adiw r28, 0x15 ; 21 19b0e: 4c ae std Y+60, r4 ; 0x3c 19b10: 5d ae std Y+61, r5 ; 0x3d 19b12: 6e ae std Y+62, r6 ; 0x3e 19b14: 7f ae std Y+63, r7 ; 0x3f 19b16: 65 97 sbiw r28, 0x15 ; 21 yf = ur + 5.5f; 19b18: 25 96 adiw r28, 0x05 ; 5 19b1a: 8c ae std Y+60, r8 ; 0x3c 19b1c: 9d ae std Y+61, r9 ; 0x3d 19b1e: ae ae std Y+62, r10 ; 0x3e 19b20: bf ae std Y+63, r11 ; 0x3f 19b22: 25 97 sbiw r28, 0x05 ; 5 19b24: 0f b6 in r0, 0x3f ; 63 19b26: f8 94 cli 19b28: de bf out 0x3e, r29 ; 62 19b2a: 0f be out 0x3f, r0 ; 63 19b2c: cd bf out 0x3d, r28 ; 61 } /// move to the center of area and convert to position xf = (float)x + (xf - 15.5f) * 64; 19b2e: 20 e0 ldi r18, 0x00 ; 0 19b30: 30 e0 ldi r19, 0x00 ; 0 19b32: 48 e7 ldi r20, 0x78 ; 120 19b34: 51 e4 ldi r21, 0x41 ; 65 19b36: 65 96 adiw r28, 0x15 ; 21 19b38: 6c ad ldd r22, Y+60 ; 0x3c 19b3a: 7d ad ldd r23, Y+61 ; 0x3d 19b3c: 8e ad ldd r24, Y+62 ; 0x3e 19b3e: 9f ad ldd r25, Y+63 ; 0x3f 19b40: 65 97 sbiw r28, 0x15 ; 21 19b42: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 19b46: 20 e0 ldi r18, 0x00 ; 0 19b48: 30 e0 ldi r19, 0x00 ; 0 19b4a: 40 e8 ldi r20, 0x80 ; 128 19b4c: 52 e4 ldi r21, 0x42 ; 66 19b4e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 19b52: 6b 01 movw r12, r22 19b54: 7c 01 movw r14, r24 19b56: 6c 96 adiw r28, 0x1c ; 28 19b58: ae ad ldd r26, Y+62 ; 0x3e 19b5a: bf ad ldd r27, Y+63 ; 0x3f 19b5c: 6c 97 sbiw r28, 0x1c ; 28 19b5e: bd 01 movw r22, r26 19b60: bb 0f add r27, r27 19b62: 88 0b sbc r24, r24 19b64: 99 0b sbc r25, r25 19b66: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 19b6a: 9b 01 movw r18, r22 19b6c: ac 01 movw r20, r24 19b6e: c7 01 movw r24, r14 19b70: b6 01 movw r22, r12 19b72: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 19b76: 6b 01 movw r12, r22 19b78: 7c 01 movw r14, r24 19b7a: 65 96 adiw r28, 0x15 ; 21 19b7c: cc ae std Y+60, r12 ; 0x3c 19b7e: dd ae std Y+61, r13 ; 0x3d 19b80: ee ae std Y+62, r14 ; 0x3e 19b82: ff ae std Y+63, r15 ; 0x3f 19b84: 65 97 sbiw r28, 0x15 ; 21 yf = (float)y + (yf - 15.5f) * 64; 19b86: 20 e0 ldi r18, 0x00 ; 0 19b88: 30 e0 ldi r19, 0x00 ; 0 19b8a: 48 e7 ldi r20, 0x78 ; 120 19b8c: 51 e4 ldi r21, 0x41 ; 65 19b8e: 25 96 adiw r28, 0x05 ; 5 19b90: 6c ad ldd r22, Y+60 ; 0x3c 19b92: 7d ad ldd r23, Y+61 ; 0x3d 19b94: 8e ad ldd r24, Y+62 ; 0x3e 19b96: 9f ad ldd r25, Y+63 ; 0x3f 19b98: 25 97 sbiw r28, 0x05 ; 5 19b9a: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 19b9e: 20 e0 ldi r18, 0x00 ; 0 19ba0: 30 e0 ldi r19, 0x00 ; 0 19ba2: 40 e8 ldi r20, 0x80 ; 128 19ba4: 52 e4 ldi r21, 0x42 ; 66 19ba6: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 19baa: 4b 01 movw r8, r22 19bac: 5c 01 movw r10, r24 19bae: ac 96 adiw r28, 0x2c ; 44 19bb0: ee ad ldd r30, Y+62 ; 0x3e 19bb2: ff ad ldd r31, Y+63 ; 0x3f 19bb4: ac 97 sbiw r28, 0x2c ; 44 19bb6: bf 01 movw r22, r30 19bb8: ff 0f add r31, r31 19bba: 88 0b sbc r24, r24 19bbc: 99 0b sbc r25, r25 19bbe: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 19bc2: 9b 01 movw r18, r22 19bc4: ac 01 movw r20, r24 19bc6: c5 01 movw r24, r10 19bc8: b4 01 movw r22, r8 19bca: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 19bce: 25 96 adiw r28, 0x05 ; 5 19bd0: 6c af std Y+60, r22 ; 0x3c 19bd2: 7d af std Y+61, r23 ; 0x3d 19bd4: 8e af std Y+62, r24 ; 0x3e 19bd6: 9f af std Y+63, r25 ; 0x3f 19bd8: 25 97 sbiw r28, 0x05 ; 5 /// converts integer position to millimeters pos_mm_t pos_2_mm(pos_i16_t pos){ return pos * 0.01f; } pos_mm_t pos_2_mm(float pos){ return pos * 0.01f; 19bda: 2a e0 ldi r18, 0x0A ; 10 19bdc: 37 ed ldi r19, 0xD7 ; 215 19bde: 43 e2 ldi r20, 0x23 ; 35 19be0: 5c e3 ldi r21, 0x3C ; 60 19be2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> /// move to the center of area and convert to position xf = (float)x + (xf - 15.5f) * 64; yf = (float)y + (yf - 15.5f) * 64; //@size=114 DBG(_n(" [%f %f] mm pattern center\n"), pos_2_mm(xf), pos_2_mm(yf)); 19be6: 9f 93 push r25 19be8: 8f 93 push r24 19bea: 7f 93 push r23 19bec: 6f 93 push r22 /// converts integer position to millimeters pos_mm_t pos_2_mm(pos_i16_t pos){ return pos * 0.01f; } pos_mm_t pos_2_mm(float pos){ return pos * 0.01f; 19bee: 2a e0 ldi r18, 0x0A ; 10 19bf0: 37 ed ldi r19, 0xD7 ; 215 19bf2: 43 e2 ldi r20, 0x23 ; 35 19bf4: 5c e3 ldi r21, 0x3C ; 60 19bf6: c7 01 movw r24, r14 19bf8: b6 01 movw r22, r12 19bfa: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> /// move to the center of area and convert to position xf = (float)x + (xf - 15.5f) * 64; yf = (float)y + (yf - 15.5f) * 64; //@size=114 DBG(_n(" [%f %f] mm pattern center\n"), pos_2_mm(xf), pos_2_mm(yf)); 19bfe: 9f 93 push r25 19c00: 8f 93 push r24 19c02: 7f 93 push r23 19c04: 6f 93 push r22 19c06: 87 e9 ldi r24, 0x97 ; 151 19c08: 97 e8 ldi r25, 0x87 ; 135 19c0a: 9f 93 push r25 19c0c: 8f 93 push r24 19c0e: 0f 94 9e 9e call 0x33d3c ; 0x33d3c uint16_t round_to_u16(float f){ return (uint16_t)(f + .5f); } int16_t round_to_i16(float f){ return (int16_t)(f + .5f); 19c12: 20 e0 ldi r18, 0x00 ; 0 19c14: 30 e0 ldi r19, 0x00 ; 0 19c16: 40 e0 ldi r20, 0x00 ; 0 19c18: 5f e3 ldi r21, 0x3F ; 63 19c1a: 25 96 adiw r28, 0x05 ; 5 19c1c: 6c ad ldd r22, Y+60 ; 0x3c 19c1e: 7d ad ldd r23, Y+61 ; 0x3d 19c20: 8e ad ldd r24, Y+62 ; 0x3e 19c22: 9f ad ldd r25, Y+63 ; 0x3f 19c24: 25 97 sbiw r28, 0x05 ; 5 19c26: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 19c2a: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 19c2e: 6b 01 movw r12, r22 19c30: 20 e0 ldi r18, 0x00 ; 0 19c32: 30 e0 ldi r19, 0x00 ; 0 19c34: 40 e0 ldi r20, 0x00 ; 0 19c36: 5f e3 ldi r21, 0x3F ; 63 19c38: 65 96 adiw r28, 0x15 ; 21 19c3a: 6c ad ldd r22, Y+60 ; 0x3c 19c3c: 7d ad ldd r23, Y+61 ; 0x3d 19c3e: 8e ad ldd r24, Y+62 ; 0x3e 19c40: 9f ad ldd r25, Y+63 ; 0x3f 19c42: 65 97 sbiw r28, 0x15 ; 21 19c44: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 19c48: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 19c4c: cb 01 movw r24, r22 yf = (float)y + (yf - 15.5f) * 64; //@size=114 DBG(_n(" [%f %f] mm pattern center\n"), pos_2_mm(xf), pos_2_mm(yf)); x = round_to_i16(xf); y = round_to_i16(yf); xyzcal_lineXYZ_to(x, y, z, 200, 0); 19c4e: 00 e0 ldi r16, 0x00 ; 0 19c50: 28 ec ldi r18, 0xC8 ; 200 19c52: 30 e0 ldi r19, 0x00 ; 0 19c54: e7 96 adiw r28, 0x37 ; 55 19c56: 4e ad ldd r20, Y+62 ; 0x3e 19c58: 5f ad ldd r21, Y+63 ; 0x3f 19c5a: e7 97 sbiw r28, 0x37 ; 55 19c5c: b6 01 movw r22, r12 19c5e: 0e 94 d2 c2 call 0x185a4 ; 0x185a4 19c62: 0f b6 in r0, 0x3f ; 63 19c64: f8 94 cli 19c66: de bf out 0x3e, r29 ; 62 19c68: 0f be out 0x3f, r0 ; 63 19c6a: cd bf out 0x3d, r28 ; 61 ret = BED_SKEW_OFFSET_DETECTION_POINT_FOUND; 19c6c: 10 e0 ldi r17, 0x00 ; 0 19c6e: 88 ea ldi r24, 0xA8 ; 168 19c70: 9d e0 ldi r25, 0x0D ; 13 } /// wipe buffer for (uint16_t i = 0; i < sizeof(block_t)*BLOCK_BUFFER_SIZE; i++) matrix32[i] = 0; 19c72: a4 96 adiw r28, 0x24 ; 36 19c74: ae ad ldd r26, Y+62 ; 0x3e 19c76: bf ad ldd r27, Y+63 ; 0x3f 19c78: a4 97 sbiw r28, 0x24 ; 36 19c7a: 1d 92 st X+, r1 19c7c: a4 96 adiw r28, 0x24 ; 36 19c7e: bf af std Y+63, r27 ; 0x3f 19c80: ae af std Y+62, r26 ; 0x3e 19c82: a4 97 sbiw r28, 0x24 ; 36 xyzcal_lineXYZ_to(x, y, z, 200, 0); ret = BED_SKEW_OFFSET_DETECTION_POINT_FOUND; } /// wipe buffer for (uint16_t i = 0; i < sizeof(block_t)*BLOCK_BUFFER_SIZE; i++) 19c84: 8a 17 cp r24, r26 19c86: 9b 07 cpc r25, r27 19c88: a1 f7 brne .-24 ; 0x19c72 19c8a: 76 cc rjmp .-1812 ; 0x19578 /// scans area around the current head location and /// searches for the center of the calibration pin BedSkewOffsetDetectionResultType xyzcal_scan_and_process(){ //@size=44 // DBG(_n("sizeof(block_buffer)=%d\n"), sizeof(block_t)*BLOCK_BUFFER_SIZE); BedSkewOffsetDetectionResultType ret = BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND; 19c8c: 1f ef ldi r17, 0xFF ; 255 19c8e: ef cf rjmp .-34 ; 0x19c6e result = find_bed_induction_sensor_point_xy(verbosity_level); switch(result){ case BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND: return BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND; case BED_SKEW_OFFSET_DETECTION_POINT_SCAN_FAILED: retry = true; 19c90: e5 96 adiw r28, 0x35 ; 53 19c92: bf ad ldd r27, Y+63 ; 0x3f 19c94: e5 97 sbiw r28, 0x35 ; 53 19c96: a7 96 adiw r28, 0x27 ; 39 19c98: bf af std Y+63, r27 ; 0x3f 19c9a: a7 97 sbiw r28, 0x27 ; 39 19c9c: 99 cc rjmp .-1742 ; 0x195d0 // Reset the baby step value and the baby step applied flag. calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); // Complete XYZ calibration. uint8_t point_too_far_mask = 0; 19c9e: af 96 adiw r28, 0x2f ; 47 19ca0: 1f ae std Y+63, r1 ; 0x3f 19ca2: af 97 sbiw r28, 0x2f ; 47 19ca4: 62 cd rjmp .-1340 ; 0x1976a for (uint8_t i = 0; i < npts; ++i) { // First for the residuum in the x axis: if (r != 1 && c != 1) { float a = (r == 0) ? 1.f : ((r == 2) ? (-s1 * measured_pts[2 * i]) : 19ca6: f2 01 movw r30, r4 19ca8: 25 81 ldd r18, Z+5 ; 0x05 19caa: 36 81 ldd r19, Z+6 ; 0x06 19cac: 47 81 ldd r20, Z+7 ; 0x07 19cae: 50 85 ldd r21, Z+8 ; 0x08 19cb0: c3 58 subi r28, 0x83 ; 131 19cb2: df 4f sbci r29, 0xFF ; 255 19cb4: 68 81 ld r22, Y 19cb6: 79 81 ldd r23, Y+1 ; 0x01 19cb8: 8a 81 ldd r24, Y+2 ; 0x02 19cba: 9b 81 ldd r25, Y+3 ; 0x03 19cbc: cd 57 subi r28, 0x7D ; 125 19cbe: d0 40 sbci r29, 0x00 ; 0 19cc0: 60 ce rjmp .-832 ; 0x19982 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : ((c == 2) ? (-s1 * measured_pts[2 * i]) : 19cc2: 12 30 cpi r17, 0x02 ; 2 19cc4: 11 f0 breq .+4 ; 0x19cca 19cc6: 0c 94 3a d7 jmp 0x1ae74 ; 0x1ae74 19cca: d2 01 movw r26, r4 19ccc: 11 96 adiw r26, 0x01 ; 1 19cce: 2d 91 ld r18, X+ 19cd0: 3d 91 ld r19, X+ 19cd2: 4d 91 ld r20, X+ 19cd4: 5c 91 ld r21, X 19cd6: 14 97 sbiw r26, 0x04 ; 4 19cd8: cf 57 subi r28, 0x7F ; 127 19cda: df 4f sbci r29, 0xFF ; 255 19cdc: 68 81 ld r22, Y 19cde: 79 81 ldd r23, Y+1 ; 0x01 19ce0: 8a 81 ldd r24, Y+2 ; 0x02 19ce2: 9b 81 ldd r25, Y+3 ; 0x03 19ce4: c1 58 subi r28, 0x81 ; 129 19ce6: d0 40 sbci r29, 0x00 ; 0 19ce8: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> (-c2 * measured_pts[2 * i + 1])); float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += a * b * w; 19cec: 9b 01 movw r18, r22 19cee: ac 01 movw r20, r24 19cf0: c5 01 movw r24, r10 19cf2: b4 01 movw r22, r8 19cf4: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 19cf8: 9b 01 movw r18, r22 19cfa: ac 01 movw r20, r24 19cfc: c7 01 movw r24, r14 19cfe: b6 01 movw r22, r12 19d00: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 19d04: 6b 01 movw r12, r22 19d06: 7c 01 movw r14, r24 } // Second for the residuum in the y axis. // The first row of the points have a low weight, because their position may not be known // with a sufficient accuracy. if (r != 0 && c != 0) { 19d08: 01 11 cpse r16, r1 19d0a: 0c 94 47 d8 jmp 0x1b08e ; 0x1b08e 19d0e: 7a 94 dec r7 19d10: f8 e0 ldi r31, 0x08 ; 8 19d12: 4f 0e add r4, r31 19d14: 51 1c adc r5, r1 delay_keep_alive(0); //manage heater, reset watchdog, manage inactivity for (uint8_t r = 0; r < 4; ++r) { for (uint8_t c = 0; c < 4; ++c) { acc = 0; // J^T times J for (uint8_t i = 0; i < npts; ++i) { 19d16: 71 10 cpse r7, r1 19d18: 16 ce rjmp .-980 ; 0x19946 (-s2 * measured_pts[2 * i + 1])); float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += a * b * w; } } A[r][c] = acc; 19d1a: d1 01 movw r26, r2 19d1c: cd 92 st X+, r12 19d1e: dd 92 st X+, r13 19d20: ed 92 st X+, r14 19d22: fd 92 st X+, r15 19d24: 1d 01 movw r2, r26 float A[4][4] = { 0.f }; float b[4] = { 0.f }; float acc; delay_keep_alive(0); //manage heater, reset watchdog, manage inactivity for (uint8_t r = 0; r < 4; ++r) { for (uint8_t c = 0; c < 4; ++c) { 19d26: 1f 5f subi r17, 0xFF ; 255 19d28: 14 30 cpi r17, 0x04 ; 4 19d2a: 09 f0 breq .+2 ; 0x19d2e 19d2c: 03 ce rjmp .-1018 ; 0x19934 19d2e: 3c e4 ldi r19, 0x4C ; 76 19d30: 23 2e mov r2, r19 19d32: 38 e8 ldi r19, 0x88 ; 136 19d34: 33 2e mov r3, r19 19d36: ec e9 ldi r30, 0x9C ; 156 19d38: f2 e1 ldi r31, 0x12 ; 18 19d3a: a8 96 adiw r28, 0x28 ; 40 19d3c: ff af std Y+63, r31 ; 0x3f 19d3e: ee af std Y+62, r30 ; 0x3e 19d40: a8 97 sbiw r28, 0x28 ; 40 } } A[r][c] = acc; } // J^T times f(x) acc = 0.f; 19d42: c3 57 subi r28, 0x73 ; 115 19d44: df 4f sbci r29, 0xFF ; 255 19d46: 18 82 st Y, r1 19d48: cd 58 subi r28, 0x8D ; 141 19d4a: d0 40 sbci r29, 0x00 ; 0 19d4c: c3 56 subi r28, 0x63 ; 99 19d4e: df 4f sbci r29, 0xFF ; 255 19d50: 18 82 st Y, r1 19d52: cd 59 subi r28, 0x9D ; 157 19d54: d0 40 sbci r29, 0x00 ; 0 19d56: cf 55 subi r28, 0x5F ; 95 19d58: df 4f sbci r29, 0xFF ; 255 19d5a: 18 82 st Y, r1 19d5c: c1 5a subi r28, 0xA1 ; 161 19d5e: d0 40 sbci r29, 0x00 ; 0 19d60: 10 e0 ldi r17, 0x00 ; 0 19d62: a8 96 adiw r28, 0x28 ; 40 19d64: ae ad ldd r26, Y+62 ; 0x3e 19d66: bf ad ldd r27, Y+63 ; 0x3f 19d68: a8 97 sbiw r28, 0x28 ; 40 19d6a: 11 96 adiw r26, 0x01 ; 1 19d6c: 2d 91 ld r18, X+ 19d6e: 3d 91 ld r19, X+ 19d70: 4d 91 ld r20, X+ 19d72: 5c 91 ld r21, X 19d74: 14 97 sbiw r26, 0x04 ; 4 19d76: e4 96 adiw r28, 0x34 ; 52 19d78: 2c af std Y+60, r18 ; 0x3c 19d7a: 3d af std Y+61, r19 ; 0x3d 19d7c: 4e af std Y+62, r20 ; 0x3e 19d7e: 5f af std Y+63, r21 ; 0x3f 19d80: e4 97 sbiw r28, 0x34 ; 52 19d82: 15 96 adiw r26, 0x05 ; 5 19d84: 4d 90 ld r4, X+ 19d86: 5d 90 ld r5, X+ 19d88: 6d 90 ld r6, X+ 19d8a: 7c 90 ld r7, X 19d8c: 18 97 sbiw r26, 0x08 ; 8 for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 19d8e: 00 23 and r16, r16 19d90: 11 f4 brne .+4 ; 0x19d96 19d92: 0c 94 6d d7 jmp 0x1aeda ; 0x1aeda ((r == 1) ? 0.f : 19d96: 81 2c mov r8, r1 19d98: 91 2c mov r9, r1 19d9a: 54 01 movw r10, r8 19d9c: 01 30 cpi r16, 0x01 ; 1 19d9e: 81 f0 breq .+32 ; 0x19dc0 ((r == 2) ? (-s1 * measured_pts[2 * i]) : 19da0: 02 30 cpi r16, 0x02 ; 2 19da2: 11 f0 breq .+4 ; 0x19da8 19da4: 0c 94 61 d7 jmp 0x1aec2 ; 0x1aec2 19da8: cf 57 subi r28, 0x7F ; 127 19daa: df 4f sbci r29, 0xFF ; 255 19dac: 68 81 ld r22, Y 19dae: 79 81 ldd r23, Y+1 ; 0x01 19db0: 8a 81 ldd r24, Y+2 ; 0x02 19db2: 9b 81 ldd r25, Y+3 ; 0x03 19db4: c1 58 subi r28, 0x81 ; 129 19db6: d0 40 sbci r29, 0x00 ; 0 19db8: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 19dbc: 4b 01 movw r8, r22 19dbe: 5c 01 movw r10, r24 (-c2 * measured_pts[2 * i + 1]))); float fx = c1 * measured_pts[2 * i] - s2 * measured_pts[2 * i + 1] + cntr[0] - pgm_read_float(true_pts + i * 2); 19dc0: e4 96 adiw r28, 0x34 ; 52 19dc2: 2c ad ldd r18, Y+60 ; 0x3c 19dc4: 3d ad ldd r19, Y+61 ; 0x3d 19dc6: 4e ad ldd r20, Y+62 ; 0x3e 19dc8: 5f ad ldd r21, Y+63 ; 0x3f 19dca: e4 97 sbiw r28, 0x34 ; 52 19dcc: 6e 96 adiw r28, 0x1e ; 30 19dce: 6c ad ldd r22, Y+60 ; 0x3c 19dd0: 7d ad ldd r23, Y+61 ; 0x3d 19dd2: 8e ad ldd r24, Y+62 ; 0x3e 19dd4: 9f ad ldd r25, Y+63 ; 0x3f 19dd6: 6e 97 sbiw r28, 0x1e ; 30 19dd8: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 19ddc: 6b 01 movw r12, r22 19dde: 7c 01 movw r14, r24 19de0: f1 01 movw r30, r2 19de2: 25 91 lpm r18, Z+ 19de4: 35 91 lpm r19, Z+ 19de6: 45 91 lpm r20, Z+ 19de8: 54 91 lpm r21, Z 19dea: cb 55 subi r28, 0x5B ; 91 19dec: df 4f sbci r29, 0xFF ; 255 19dee: 28 83 st Y, r18 19df0: 39 83 std Y+1, r19 ; 0x01 19df2: 4a 83 std Y+2, r20 ; 0x02 19df4: 5b 83 std Y+3, r21 ; 0x03 19df6: c5 5a subi r28, 0xA5 ; 165 19df8: d0 40 sbci r29, 0x00 ; 0 19dfa: a3 01 movw r20, r6 19dfc: 92 01 movw r18, r4 19dfe: cb 56 subi r28, 0x6B ; 107 19e00: df 4f sbci r29, 0xFF ; 255 19e02: 68 81 ld r22, Y 19e04: 79 81 ldd r23, Y+1 ; 0x01 19e06: 8a 81 ldd r24, Y+2 ; 0x02 19e08: 9b 81 ldd r25, Y+3 ; 0x03 19e0a: c5 59 subi r28, 0x95 ; 149 19e0c: d0 40 sbci r29, 0x00 ; 0 19e0e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 19e12: 9b 01 movw r18, r22 19e14: ac 01 movw r20, r24 19e16: c7 01 movw r24, r14 19e18: b6 01 movw r22, r12 19e1a: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 19e1e: c5 55 subi r28, 0x55 ; 85 19e20: df 4f sbci r29, 0xFF ; 255 19e22: 28 81 ld r18, Y 19e24: 39 81 ldd r19, Y+1 ; 0x01 19e26: 4a 81 ldd r20, Y+2 ; 0x02 19e28: 5b 81 ldd r21, Y+3 ; 0x03 19e2a: cb 5a subi r28, 0xAB ; 171 19e2c: d0 40 sbci r29, 0x00 ; 0 19e2e: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 19e32: cb 55 subi r28, 0x5B ; 91 19e34: df 4f sbci r29, 0xFF ; 255 19e36: 28 81 ld r18, Y 19e38: 39 81 ldd r19, Y+1 ; 0x01 19e3a: 4a 81 ldd r20, Y+2 ; 0x02 19e3c: 5b 81 ldd r21, Y+3 ; 0x03 19e3e: c5 5a subi r28, 0xA5 ; 165 19e40: d0 40 sbci r29, 0x00 ; 0 19e42: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; 19e46: a5 01 movw r20, r10 19e48: 94 01 movw r18, r8 19e4a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 19e4e: c3 57 subi r28, 0x73 ; 115 19e50: df 4f sbci r29, 0xFF ; 255 19e52: 28 81 ld r18, Y 19e54: cd 58 subi r28, 0x8D ; 141 19e56: d0 40 sbci r29, 0x00 ; 0 19e58: c3 56 subi r28, 0x63 ; 99 19e5a: df 4f sbci r29, 0xFF ; 255 19e5c: 38 81 ld r19, Y 19e5e: cd 59 subi r28, 0x9D ; 157 19e60: d0 40 sbci r29, 0x00 ; 0 19e62: cf 55 subi r28, 0x5F ; 95 19e64: df 4f sbci r29, 0xFF ; 255 19e66: 48 81 ld r20, Y 19e68: c1 5a subi r28, 0xA1 ; 161 19e6a: d0 40 sbci r29, 0x00 ; 0 19e6c: 51 2f mov r21, r17 19e6e: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 19e72: c3 57 subi r28, 0x73 ; 115 19e74: df 4f sbci r29, 0xFF ; 255 19e76: 68 83 st Y, r22 19e78: 79 83 std Y+1, r23 ; 0x01 19e7a: 8a 83 std Y+2, r24 ; 0x02 19e7c: 9b 83 std Y+3, r25 ; 0x03 19e7e: cd 58 subi r28, 0x8D ; 141 19e80: d0 40 sbci r29, 0x00 ; 0 } { float j = (r == 0) ? 0.f : 19e82: 00 23 and r16, r16 19e84: 11 f4 brne .+4 ; 0x19e8a 19e86: 0c 94 75 d7 jmp 0x1aeea ; 0x1aeea ((r == 1) ? 1.f : 19e8a: 01 30 cpi r16, 0x01 ; 1 19e8c: 11 f4 brne .+4 ; 0x19e92 19e8e: 0c 94 7a d7 jmp 0x1aef4 ; 0x1aef4 ((r == 2) ? ( c1 * measured_pts[2 * i]) : 19e92: 02 30 cpi r16, 0x02 ; 2 19e94: 61 f0 breq .+24 ; 0x19eae 19e96: a3 01 movw r20, r6 19e98: 92 01 movw r18, r4 19e9a: ed 96 adiw r28, 0x3d ; 61 19e9c: 6c ad ldd r22, Y+60 ; 0x3c 19e9e: 7d ad ldd r23, Y+61 ; 0x3d 19ea0: 8e ad ldd r24, Y+62 ; 0x3e 19ea2: 9f ad ldd r25, Y+63 ; 0x3f 19ea4: ed 97 sbiw r28, 0x3d ; 61 19ea6: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 19eaa: 6b 01 movw r12, r22 19eac: 7c 01 movw r14, r24 (-s2 * measured_pts[2 * i + 1]))); float fy = s1 * measured_pts[2 * i] + c2 * measured_pts[2 * i + 1] + cntr[1] - pgm_read_float(true_pts + i * 2 + 1); 19eae: f1 01 movw r30, r2 19eb0: 34 96 adiw r30, 0x04 ; 4 19eb2: 85 90 lpm r8, Z+ 19eb4: 95 90 lpm r9, Z+ 19eb6: a5 90 lpm r10, Z+ 19eb8: b4 90 lpm r11, Z 19eba: e4 96 adiw r28, 0x34 ; 52 19ebc: 2c ad ldd r18, Y+60 ; 0x3c 19ebe: 3d ad ldd r19, Y+61 ; 0x3d 19ec0: 4e ad ldd r20, Y+62 ; 0x3e 19ec2: 5f ad ldd r21, Y+63 ; 0x3f 19ec4: e4 97 sbiw r28, 0x34 ; 52 19ec6: cb 57 subi r28, 0x7B ; 123 19ec8: df 4f sbci r29, 0xFF ; 255 19eca: 68 81 ld r22, Y 19ecc: 79 81 ldd r23, Y+1 ; 0x01 19ece: 8a 81 ldd r24, Y+2 ; 0x02 19ed0: 9b 81 ldd r25, Y+3 ; 0x03 19ed2: c5 58 subi r28, 0x85 ; 133 19ed4: d0 40 sbci r29, 0x00 ; 0 19ed6: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 19eda: e4 96 adiw r28, 0x34 ; 52 19edc: 6c af std Y+60, r22 ; 0x3c 19ede: 7d af std Y+61, r23 ; 0x3d 19ee0: 8e af std Y+62, r24 ; 0x3e 19ee2: 9f af std Y+63, r25 ; 0x3f 19ee4: e4 97 sbiw r28, 0x34 ; 52 19ee6: a3 01 movw r20, r6 19ee8: 92 01 movw r18, r4 19eea: c7 57 subi r28, 0x77 ; 119 19eec: df 4f sbci r29, 0xFF ; 255 19eee: 68 81 ld r22, Y 19ef0: 79 81 ldd r23, Y+1 ; 0x01 19ef2: 8a 81 ldd r24, Y+2 ; 0x02 19ef4: 9b 81 ldd r25, Y+3 ; 0x03 19ef6: c9 58 subi r28, 0x89 ; 137 19ef8: d0 40 sbci r29, 0x00 ; 0 19efa: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 19efe: 9b 01 movw r18, r22 19f00: ac 01 movw r20, r24 19f02: e4 96 adiw r28, 0x34 ; 52 19f04: 6c ad ldd r22, Y+60 ; 0x3c 19f06: 7d ad ldd r23, Y+61 ; 0x3d 19f08: 8e ad ldd r24, Y+62 ; 0x3e 19f0a: 9f ad ldd r25, Y+63 ; 0x3f 19f0c: e4 97 sbiw r28, 0x34 ; 52 19f0e: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 19f12: c1 55 subi r28, 0x51 ; 81 19f14: df 4f sbci r29, 0xFF ; 255 19f16: 28 81 ld r18, Y 19f18: 39 81 ldd r19, Y+1 ; 0x01 19f1a: 4a 81 ldd r20, Y+2 ; 0x02 19f1c: 5b 81 ldd r21, Y+3 ; 0x03 19f1e: cf 5a subi r28, 0xAF ; 175 19f20: d0 40 sbci r29, 0x00 ; 0 19f22: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 19f26: a5 01 movw r20, r10 19f28: 94 01 movw r18, r8 19f2a: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += j * fy * w; 19f2e: a7 01 movw r20, r14 19f30: 96 01 movw r18, r12 19f32: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 19f36: c3 57 subi r28, 0x73 ; 115 19f38: df 4f sbci r29, 0xFF ; 255 19f3a: 28 81 ld r18, Y 19f3c: 39 81 ldd r19, Y+1 ; 0x01 19f3e: 4a 81 ldd r20, Y+2 ; 0x02 19f40: 5b 81 ldd r21, Y+3 ; 0x03 19f42: cd 58 subi r28, 0x8D ; 141 19f44: d0 40 sbci r29, 0x00 ; 0 19f46: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 19f4a: c3 57 subi r28, 0x73 ; 115 19f4c: df 4f sbci r29, 0xFF ; 255 19f4e: 68 83 st Y, r22 19f50: cd 58 subi r28, 0x8D ; 141 19f52: d0 40 sbci r29, 0x00 ; 0 19f54: c3 56 subi r28, 0x63 ; 99 19f56: df 4f sbci r29, 0xFF ; 255 19f58: 78 83 st Y, r23 19f5a: cd 59 subi r28, 0x9D ; 157 19f5c: d0 40 sbci r29, 0x00 ; 0 19f5e: cf 55 subi r28, 0x5F ; 95 19f60: df 4f sbci r29, 0xFF ; 255 19f62: 88 83 st Y, r24 19f64: c1 5a subi r28, 0xA1 ; 161 19f66: d0 40 sbci r29, 0x00 ; 0 19f68: 19 2f mov r17, r25 19f6a: a8 96 adiw r28, 0x28 ; 40 19f6c: 4e ad ldd r20, Y+62 ; 0x3e 19f6e: 5f ad ldd r21, Y+63 ; 0x3f 19f70: a8 97 sbiw r28, 0x28 ; 40 19f72: 48 5f subi r20, 0xF8 ; 248 19f74: 5f 4f sbci r21, 0xFF ; 255 19f76: a8 96 adiw r28, 0x28 ; 40 19f78: 5f af std Y+63, r21 ; 0x3f 19f7a: 4e af std Y+62, r20 ; 0x3e 19f7c: a8 97 sbiw r28, 0x28 ; 40 19f7e: 58 e0 ldi r21, 0x08 ; 8 19f80: 25 0e add r2, r21 19f82: 31 1c adc r3, r1 } A[r][c] = acc; } // J^T times f(x) acc = 0.f; for (uint8_t i = 0; i < npts; ++i) { 19f84: ac eb ldi r26, 0xBC ; 188 19f86: b2 e1 ldi r27, 0x12 ; 18 19f88: a8 96 adiw r28, 0x28 ; 40 19f8a: ee ad ldd r30, Y+62 ; 0x3e 19f8c: ff ad ldd r31, Y+63 ; 0x3f 19f8e: a8 97 sbiw r28, 0x28 ; 40 19f90: ae 17 cp r26, r30 19f92: bf 07 cpc r27, r31 19f94: 09 f0 breq .+2 ; 0x19f98 19f96: e5 ce rjmp .-566 ; 0x19d62 float fy = s1 * measured_pts[2 * i] + c2 * measured_pts[2 * i + 1] + cntr[1] - pgm_read_float(true_pts + i * 2 + 1); float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += j * fy * w; } } b[r] = -acc; 19f98: 90 58 subi r25, 0x80 ; 128 19f9a: c7 56 subi r28, 0x67 ; 103 19f9c: df 4f sbci r29, 0xFF ; 255 19f9e: a8 81 ld r26, Y 19fa0: b9 81 ldd r27, Y+1 ; 0x01 19fa2: c9 59 subi r28, 0x99 ; 153 19fa4: d0 40 sbci r29, 0x00 ; 0 19fa6: 6d 93 st X+, r22 19fa8: 7d 93 st X+, r23 19faa: 8d 93 st X+, r24 19fac: 9d 93 st X+, r25 19fae: c7 56 subi r28, 0x67 ; 103 19fb0: df 4f sbci r29, 0xFF ; 255 19fb2: b9 83 std Y+1, r27 ; 0x01 19fb4: a8 83 st Y, r26 19fb6: c9 59 subi r28, 0x99 ; 153 19fb8: d0 40 sbci r29, 0x00 ; 0 // Prepare the Normal equation for the Gauss-Newton method. float A[4][4] = { 0.f }; float b[4] = { 0.f }; float acc; delay_keep_alive(0); //manage heater, reset watchdog, manage inactivity for (uint8_t r = 0; r < 4; ++r) { 19fba: 0f 5f subi r16, 0xFF ; 255 19fbc: ac 96 adiw r28, 0x2c ; 44 19fbe: ee ad ldd r30, Y+62 ; 0x3e 19fc0: ff ad ldd r31, Y+63 ; 0x3f 19fc2: ac 97 sbiw r28, 0x2c ; 44 19fc4: 70 96 adiw r30, 0x10 ; 16 19fc6: ac 96 adiw r28, 0x2c ; 44 19fc8: ff af std Y+63, r31 ; 0x3f 19fca: ee af std Y+62, r30 ; 0x3e 19fcc: ac 97 sbiw r28, 0x2c ; 44 19fce: 04 30 cpi r16, 0x04 ; 4 19fd0: 09 f0 breq .+2 ; 0x19fd4 19fd2: ab cc rjmp .-1706 ; 0x1992a } // Solve for h by a Gauss iteration method. float h[4] = { 0.f }; for (uint8_t gauss_iter = 0; gauss_iter < 100; ++gauss_iter) { h[0] = (b[0] - A[0][1] * h[1] - A[0][2] * h[2] - A[0][3] * h[3]) / A[0][0]; 19fd4: 25 96 adiw r28, 0x05 ; 5 19fd6: 2c ad ldd r18, Y+60 ; 0x3c 19fd8: 3d ad ldd r19, Y+61 ; 0x3d 19fda: 4e ad ldd r20, Y+62 ; 0x3e 19fdc: 5f ad ldd r21, Y+63 ; 0x3f 19fde: 25 97 sbiw r28, 0x05 ; 5 19fe0: ae 96 adiw r28, 0x2e ; 46 19fe2: 2c af std Y+60, r18 ; 0x3c 19fe4: 3d af std Y+61, r19 ; 0x3d 19fe6: 4e af std Y+62, r20 ; 0x3e 19fe8: 5f af std Y+63, r21 ; 0x3f 19fea: ae 97 sbiw r28, 0x2e ; 46 19fec: 8d 81 ldd r24, Y+5 ; 0x05 19fee: 9e 81 ldd r25, Y+6 ; 0x06 19ff0: af 81 ldd r26, Y+7 ; 0x07 19ff2: b8 85 ldd r27, Y+8 ; 0x08 19ff4: e4 96 adiw r28, 0x34 ; 52 19ff6: 8c af std Y+60, r24 ; 0x3c 19ff8: 9d af std Y+61, r25 ; 0x3d 19ffa: ae af std Y+62, r26 ; 0x3e 19ffc: bf af std Y+63, r27 ; 0x3f 19ffe: e4 97 sbiw r28, 0x34 ; 52 1a000: 29 85 ldd r18, Y+9 ; 0x09 1a002: 3a 85 ldd r19, Y+10 ; 0x0a 1a004: 4b 85 ldd r20, Y+11 ; 0x0b 1a006: 5c 85 ldd r21, Y+12 ; 0x0c 1a008: ed 96 adiw r28, 0x3d ; 61 1a00a: 2c af std Y+60, r18 ; 0x3c 1a00c: 3d af std Y+61, r19 ; 0x3d 1a00e: 4e af std Y+62, r20 ; 0x3e 1a010: 5f af std Y+63, r21 ; 0x3f 1a012: ed 97 sbiw r28, 0x3d ; 61 1a014: 8d 85 ldd r24, Y+13 ; 0x0d 1a016: 9e 85 ldd r25, Y+14 ; 0x0e 1a018: af 85 ldd r26, Y+15 ; 0x0f 1a01a: b8 89 ldd r27, Y+16 ; 0x10 1a01c: c3 58 subi r28, 0x83 ; 131 1a01e: df 4f sbci r29, 0xFF ; 255 1a020: 88 83 st Y, r24 1a022: 99 83 std Y+1, r25 ; 0x01 1a024: aa 83 std Y+2, r26 ; 0x02 1a026: bb 83 std Y+3, r27 ; 0x03 1a028: cd 57 subi r28, 0x7D ; 125 1a02a: d0 40 sbci r29, 0x00 ; 0 1a02c: 29 81 ldd r18, Y+1 ; 0x01 1a02e: 3a 81 ldd r19, Y+2 ; 0x02 1a030: 4b 81 ldd r20, Y+3 ; 0x03 1a032: 5c 81 ldd r21, Y+4 ; 0x04 1a034: cf 57 subi r28, 0x7F ; 127 1a036: df 4f sbci r29, 0xFF ; 255 1a038: 28 83 st Y, r18 1a03a: 39 83 std Y+1, r19 ; 0x01 1a03c: 4a 83 std Y+2, r20 ; 0x02 1a03e: 5b 83 std Y+3, r21 ; 0x03 1a040: c1 58 subi r28, 0x81 ; 129 1a042: d0 40 sbci r29, 0x00 ; 0 h[1] = (b[1] - A[1][0] * h[0] - A[1][2] * h[2] - A[1][3] * h[3]) / A[1][1]; 1a044: 29 96 adiw r28, 0x09 ; 9 1a046: 8c ad ldd r24, Y+60 ; 0x3c 1a048: 9d ad ldd r25, Y+61 ; 0x3d 1a04a: ae ad ldd r26, Y+62 ; 0x3e 1a04c: bf ad ldd r27, Y+63 ; 0x3f 1a04e: 29 97 sbiw r28, 0x09 ; 9 1a050: cb 57 subi r28, 0x7B ; 123 1a052: df 4f sbci r29, 0xFF ; 255 1a054: 88 83 st Y, r24 1a056: 99 83 std Y+1, r25 ; 0x01 1a058: aa 83 std Y+2, r26 ; 0x02 1a05a: bb 83 std Y+3, r27 ; 0x03 1a05c: c5 58 subi r28, 0x85 ; 133 1a05e: d0 40 sbci r29, 0x00 ; 0 1a060: 29 89 ldd r18, Y+17 ; 0x11 1a062: 3a 89 ldd r19, Y+18 ; 0x12 1a064: 4b 89 ldd r20, Y+19 ; 0x13 1a066: 5c 89 ldd r21, Y+20 ; 0x14 1a068: c7 57 subi r28, 0x77 ; 119 1a06a: df 4f sbci r29, 0xFF ; 255 1a06c: 28 83 st Y, r18 1a06e: 39 83 std Y+1, r19 ; 0x01 1a070: 4a 83 std Y+2, r20 ; 0x02 1a072: 5b 83 std Y+3, r21 ; 0x03 1a074: c9 58 subi r28, 0x89 ; 137 1a076: d0 40 sbci r29, 0x00 ; 0 1a078: 89 8d ldd r24, Y+25 ; 0x19 1a07a: 9a 8d ldd r25, Y+26 ; 0x1a 1a07c: ab 8d ldd r26, Y+27 ; 0x1b 1a07e: bc 8d ldd r27, Y+28 ; 0x1c 1a080: cb 56 subi r28, 0x6B ; 107 1a082: df 4f sbci r29, 0xFF ; 255 1a084: 88 83 st Y, r24 1a086: 99 83 std Y+1, r25 ; 0x01 1a088: aa 83 std Y+2, r26 ; 0x02 1a08a: bb 83 std Y+3, r27 ; 0x03 1a08c: c5 59 subi r28, 0x95 ; 149 1a08e: d0 40 sbci r29, 0x00 ; 0 1a090: 2d 8d ldd r18, Y+29 ; 0x1d 1a092: 3e 8d ldd r19, Y+30 ; 0x1e 1a094: 4f 8d ldd r20, Y+31 ; 0x1f 1a096: 58 a1 ldd r21, Y+32 ; 0x20 1a098: c7 56 subi r28, 0x67 ; 103 1a09a: df 4f sbci r29, 0xFF ; 255 1a09c: 28 83 st Y, r18 1a09e: 39 83 std Y+1, r19 ; 0x01 1a0a0: 4a 83 std Y+2, r20 ; 0x02 1a0a2: 5b 83 std Y+3, r21 ; 0x03 1a0a4: c9 59 subi r28, 0x99 ; 153 1a0a6: d0 40 sbci r29, 0x00 ; 0 1a0a8: 8d 89 ldd r24, Y+21 ; 0x15 1a0aa: 9e 89 ldd r25, Y+22 ; 0x16 1a0ac: af 89 ldd r26, Y+23 ; 0x17 1a0ae: b8 8d ldd r27, Y+24 ; 0x18 1a0b0: c3 57 subi r28, 0x73 ; 115 1a0b2: df 4f sbci r29, 0xFF ; 255 1a0b4: 88 83 st Y, r24 1a0b6: 99 83 std Y+1, r25 ; 0x01 1a0b8: aa 83 std Y+2, r26 ; 0x02 1a0ba: bb 83 std Y+3, r27 ; 0x03 1a0bc: cd 58 subi r28, 0x8D ; 141 1a0be: d0 40 sbci r29, 0x00 ; 0 h[2] = (b[2] - A[2][0] * h[0] - A[2][1] * h[1] - A[2][3] * h[3]) / A[2][2]; 1a0c0: 2d 96 adiw r28, 0x0d ; 13 1a0c2: 2c ad ldd r18, Y+60 ; 0x3c 1a0c4: 3d ad ldd r19, Y+61 ; 0x3d 1a0c6: 4e ad ldd r20, Y+62 ; 0x3e 1a0c8: 5f ad ldd r21, Y+63 ; 0x3f 1a0ca: 2d 97 sbiw r28, 0x0d ; 13 1a0cc: c3 56 subi r28, 0x63 ; 99 1a0ce: df 4f sbci r29, 0xFF ; 255 1a0d0: 28 83 st Y, r18 1a0d2: 39 83 std Y+1, r19 ; 0x01 1a0d4: 4a 83 std Y+2, r20 ; 0x02 1a0d6: 5b 83 std Y+3, r21 ; 0x03 1a0d8: cd 59 subi r28, 0x9D ; 157 1a0da: d0 40 sbci r29, 0x00 ; 0 1a0dc: 89 a1 ldd r24, Y+33 ; 0x21 1a0de: 9a a1 ldd r25, Y+34 ; 0x22 1a0e0: ab a1 ldd r26, Y+35 ; 0x23 1a0e2: bc a1 ldd r27, Y+36 ; 0x24 1a0e4: cf 55 subi r28, 0x5F ; 95 1a0e6: df 4f sbci r29, 0xFF ; 255 1a0e8: 88 83 st Y, r24 1a0ea: 99 83 std Y+1, r25 ; 0x01 1a0ec: aa 83 std Y+2, r26 ; 0x02 1a0ee: bb 83 std Y+3, r27 ; 0x03 1a0f0: c1 5a subi r28, 0xA1 ; 161 1a0f2: d0 40 sbci r29, 0x00 ; 0 1a0f4: 2d a1 ldd r18, Y+37 ; 0x25 1a0f6: 3e a1 ldd r19, Y+38 ; 0x26 1a0f8: 4f a1 ldd r20, Y+39 ; 0x27 1a0fa: 58 a5 ldd r21, Y+40 ; 0x28 1a0fc: cb 55 subi r28, 0x5B ; 91 1a0fe: df 4f sbci r29, 0xFF ; 255 1a100: 28 83 st Y, r18 1a102: 39 83 std Y+1, r19 ; 0x01 1a104: 4a 83 std Y+2, r20 ; 0x02 1a106: 5b 83 std Y+3, r21 ; 0x03 1a108: c5 5a subi r28, 0xA5 ; 165 1a10a: d0 40 sbci r29, 0x00 ; 0 1a10c: 8d a5 ldd r24, Y+45 ; 0x2d 1a10e: 9e a5 ldd r25, Y+46 ; 0x2e 1a110: af a5 ldd r26, Y+47 ; 0x2f 1a112: b8 a9 ldd r27, Y+48 ; 0x30 1a114: cd 54 subi r28, 0x4D ; 77 1a116: df 4f sbci r29, 0xFF ; 255 1a118: 88 83 st Y, r24 1a11a: 99 83 std Y+1, r25 ; 0x01 1a11c: aa 83 std Y+2, r26 ; 0x02 1a11e: bb 83 std Y+3, r27 ; 0x03 1a120: c3 5b subi r28, 0xB3 ; 179 1a122: d0 40 sbci r29, 0x00 ; 0 1a124: 29 a5 ldd r18, Y+41 ; 0x29 1a126: 3a a5 ldd r19, Y+42 ; 0x2a 1a128: 4b a5 ldd r20, Y+43 ; 0x2b 1a12a: 5c a5 ldd r21, Y+44 ; 0x2c 1a12c: c9 54 subi r28, 0x49 ; 73 1a12e: df 4f sbci r29, 0xFF ; 255 1a130: 28 83 st Y, r18 1a132: 39 83 std Y+1, r19 ; 0x01 1a134: 4a 83 std Y+2, r20 ; 0x02 1a136: 5b 83 std Y+3, r21 ; 0x03 1a138: c7 5b subi r28, 0xB7 ; 183 1a13a: d0 40 sbci r29, 0x00 ; 0 h[3] = (b[3] - A[3][0] * h[0] - A[3][1] * h[1] - A[3][2] * h[2]) / A[3][3]; 1a13c: 61 96 adiw r28, 0x11 ; 17 1a13e: 8c ad ldd r24, Y+60 ; 0x3c 1a140: 9d ad ldd r25, Y+61 ; 0x3d 1a142: ae ad ldd r26, Y+62 ; 0x3e 1a144: bf ad ldd r27, Y+63 ; 0x3f 1a146: 61 97 sbiw r28, 0x11 ; 17 1a148: c5 54 subi r28, 0x45 ; 69 1a14a: df 4f sbci r29, 0xFF ; 255 1a14c: 88 83 st Y, r24 1a14e: 99 83 std Y+1, r25 ; 0x01 1a150: aa 83 std Y+2, r26 ; 0x02 1a152: bb 83 std Y+3, r27 ; 0x03 1a154: cb 5b subi r28, 0xBB ; 187 1a156: d0 40 sbci r29, 0x00 ; 0 1a158: 29 a9 ldd r18, Y+49 ; 0x31 1a15a: 3a a9 ldd r19, Y+50 ; 0x32 1a15c: 4b a9 ldd r20, Y+51 ; 0x33 1a15e: 5c a9 ldd r21, Y+52 ; 0x34 1a160: c1 54 subi r28, 0x41 ; 65 1a162: df 4f sbci r29, 0xFF ; 255 1a164: 28 83 st Y, r18 1a166: 39 83 std Y+1, r19 ; 0x01 1a168: 4a 83 std Y+2, r20 ; 0x02 1a16a: 5b 83 std Y+3, r21 ; 0x03 1a16c: cf 5b subi r28, 0xBF ; 191 1a16e: d0 40 sbci r29, 0x00 ; 0 1a170: 8d a9 ldd r24, Y+53 ; 0x35 1a172: 9e a9 ldd r25, Y+54 ; 0x36 1a174: af a9 ldd r26, Y+55 ; 0x37 1a176: b8 ad ldd r27, Y+56 ; 0x38 1a178: cd 53 subi r28, 0x3D ; 61 1a17a: df 4f sbci r29, 0xFF ; 255 1a17c: 88 83 st Y, r24 1a17e: 99 83 std Y+1, r25 ; 0x01 1a180: aa 83 std Y+2, r26 ; 0x02 1a182: bb 83 std Y+3, r27 ; 0x03 1a184: c3 5c subi r28, 0xC3 ; 195 1a186: d0 40 sbci r29, 0x00 ; 0 1a188: 29 ad ldd r18, Y+57 ; 0x39 1a18a: 3a ad ldd r19, Y+58 ; 0x3a 1a18c: 4b ad ldd r20, Y+59 ; 0x3b 1a18e: 5c ad ldd r21, Y+60 ; 0x3c 1a190: c9 53 subi r28, 0x39 ; 57 1a192: df 4f sbci r29, 0xFF ; 255 1a194: 28 83 st Y, r18 1a196: 39 83 std Y+1, r19 ; 0x01 1a198: 4a 83 std Y+2, r20 ; 0x02 1a19a: 5b 83 std Y+3, r21 ; 0x03 1a19c: c7 5c subi r28, 0xC7 ; 199 1a19e: d0 40 sbci r29, 0x00 ; 0 1a1a0: 21 96 adiw r28, 0x01 ; 1 1a1a2: 8c ad ldd r24, Y+60 ; 0x3c 1a1a4: 9d ad ldd r25, Y+61 ; 0x3d 1a1a6: ae ad ldd r26, Y+62 ; 0x3e 1a1a8: bf ad ldd r27, Y+63 ; 0x3f 1a1aa: 21 97 sbiw r28, 0x01 ; 1 1a1ac: c5 53 subi r28, 0x35 ; 53 1a1ae: df 4f sbci r29, 0xFF ; 255 1a1b0: 88 83 st Y, r24 1a1b2: 99 83 std Y+1, r25 ; 0x01 1a1b4: aa 83 std Y+2, r26 ; 0x02 1a1b6: bb 83 std Y+3, r27 ; 0x03 1a1b8: cb 5c subi r28, 0xCB ; 203 1a1ba: d0 40 sbci r29, 0x00 ; 0 1a1bc: 14 e6 ldi r17, 0x64 ; 100 } b[r] = -acc; } // Solve for h by a Gauss iteration method. float h[4] = { 0.f }; 1a1be: c1 2c mov r12, r1 1a1c0: d1 2c mov r13, r1 1a1c2: 76 01 movw r14, r12 1a1c4: 46 01 movw r8, r12 1a1c6: 57 01 movw r10, r14 1a1c8: 26 01 movw r4, r12 1a1ca: 37 01 movw r6, r14 for (uint8_t gauss_iter = 0; gauss_iter < 100; ++gauss_iter) { h[0] = (b[0] - A[0][1] * h[1] - A[0][2] * h[2] - A[0][3] * h[3]) / A[0][0]; 1a1cc: a3 01 movw r20, r6 1a1ce: 92 01 movw r18, r4 1a1d0: e4 96 adiw r28, 0x34 ; 52 1a1d2: 6c ad ldd r22, Y+60 ; 0x3c 1a1d4: 7d ad ldd r23, Y+61 ; 0x3d 1a1d6: 8e ad ldd r24, Y+62 ; 0x3e 1a1d8: 9f ad ldd r25, Y+63 ; 0x3f 1a1da: e4 97 sbiw r28, 0x34 ; 52 1a1dc: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1a1e0: 9b 01 movw r18, r22 1a1e2: ac 01 movw r20, r24 1a1e4: ae 96 adiw r28, 0x2e ; 46 1a1e6: 6c ad ldd r22, Y+60 ; 0x3c 1a1e8: 7d ad ldd r23, Y+61 ; 0x3d 1a1ea: 8e ad ldd r24, Y+62 ; 0x3e 1a1ec: 9f ad ldd r25, Y+63 ; 0x3f 1a1ee: ae 97 sbiw r28, 0x2e ; 46 1a1f0: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1a1f4: 2b 01 movw r4, r22 1a1f6: 3c 01 movw r6, r24 1a1f8: a5 01 movw r20, r10 1a1fa: 94 01 movw r18, r8 1a1fc: ed 96 adiw r28, 0x3d ; 61 1a1fe: 6c ad ldd r22, Y+60 ; 0x3c 1a200: 7d ad ldd r23, Y+61 ; 0x3d 1a202: 8e ad ldd r24, Y+62 ; 0x3e 1a204: 9f ad ldd r25, Y+63 ; 0x3f 1a206: ed 97 sbiw r28, 0x3d ; 61 1a208: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1a20c: 9b 01 movw r18, r22 1a20e: ac 01 movw r20, r24 1a210: c3 01 movw r24, r6 1a212: b2 01 movw r22, r4 1a214: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1a218: 2b 01 movw r4, r22 1a21a: 3c 01 movw r6, r24 1a21c: a7 01 movw r20, r14 1a21e: 96 01 movw r18, r12 1a220: c3 58 subi r28, 0x83 ; 131 1a222: df 4f sbci r29, 0xFF ; 255 1a224: 68 81 ld r22, Y 1a226: 79 81 ldd r23, Y+1 ; 0x01 1a228: 8a 81 ldd r24, Y+2 ; 0x02 1a22a: 9b 81 ldd r25, Y+3 ; 0x03 1a22c: cd 57 subi r28, 0x7D ; 125 1a22e: d0 40 sbci r29, 0x00 ; 0 1a230: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1a234: 9b 01 movw r18, r22 1a236: ac 01 movw r20, r24 1a238: c3 01 movw r24, r6 1a23a: b2 01 movw r22, r4 1a23c: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1a240: cf 57 subi r28, 0x7F ; 127 1a242: df 4f sbci r29, 0xFF ; 255 1a244: 28 81 ld r18, Y 1a246: 39 81 ldd r19, Y+1 ; 0x01 1a248: 4a 81 ldd r20, Y+2 ; 0x02 1a24a: 5b 81 ldd r21, Y+3 ; 0x03 1a24c: c1 58 subi r28, 0x81 ; 129 1a24e: d0 40 sbci r29, 0x00 ; 0 1a250: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1a254: 6e 96 adiw r28, 0x1e ; 30 1a256: 6c af std Y+60, r22 ; 0x3c 1a258: 7d af std Y+61, r23 ; 0x3d 1a25a: 8e af std Y+62, r24 ; 0x3e 1a25c: 9f af std Y+63, r25 ; 0x3f 1a25e: 6e 97 sbiw r28, 0x1e ; 30 h[1] = (b[1] - A[1][0] * h[0] - A[1][2] * h[2] - A[1][3] * h[3]) / A[1][1]; 1a260: c7 57 subi r28, 0x77 ; 119 1a262: df 4f sbci r29, 0xFF ; 255 1a264: 28 81 ld r18, Y 1a266: 39 81 ldd r19, Y+1 ; 0x01 1a268: 4a 81 ldd r20, Y+2 ; 0x02 1a26a: 5b 81 ldd r21, Y+3 ; 0x03 1a26c: c9 58 subi r28, 0x89 ; 137 1a26e: d0 40 sbci r29, 0x00 ; 0 1a270: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1a274: 9b 01 movw r18, r22 1a276: ac 01 movw r20, r24 1a278: cb 57 subi r28, 0x7B ; 123 1a27a: df 4f sbci r29, 0xFF ; 255 1a27c: 68 81 ld r22, Y 1a27e: 79 81 ldd r23, Y+1 ; 0x01 1a280: 8a 81 ldd r24, Y+2 ; 0x02 1a282: 9b 81 ldd r25, Y+3 ; 0x03 1a284: c5 58 subi r28, 0x85 ; 133 1a286: d0 40 sbci r29, 0x00 ; 0 1a288: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1a28c: 2b 01 movw r4, r22 1a28e: 3c 01 movw r6, r24 1a290: a5 01 movw r20, r10 1a292: 94 01 movw r18, r8 1a294: cb 56 subi r28, 0x6B ; 107 1a296: df 4f sbci r29, 0xFF ; 255 1a298: 68 81 ld r22, Y 1a29a: 79 81 ldd r23, Y+1 ; 0x01 1a29c: 8a 81 ldd r24, Y+2 ; 0x02 1a29e: 9b 81 ldd r25, Y+3 ; 0x03 1a2a0: c5 59 subi r28, 0x95 ; 149 1a2a2: d0 40 sbci r29, 0x00 ; 0 1a2a4: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1a2a8: 9b 01 movw r18, r22 1a2aa: ac 01 movw r20, r24 1a2ac: c3 01 movw r24, r6 1a2ae: b2 01 movw r22, r4 1a2b0: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1a2b4: 4b 01 movw r8, r22 1a2b6: 5c 01 movw r10, r24 1a2b8: a7 01 movw r20, r14 1a2ba: 96 01 movw r18, r12 1a2bc: c7 56 subi r28, 0x67 ; 103 1a2be: df 4f sbci r29, 0xFF ; 255 1a2c0: 68 81 ld r22, Y 1a2c2: 79 81 ldd r23, Y+1 ; 0x01 1a2c4: 8a 81 ldd r24, Y+2 ; 0x02 1a2c6: 9b 81 ldd r25, Y+3 ; 0x03 1a2c8: c9 59 subi r28, 0x99 ; 153 1a2ca: d0 40 sbci r29, 0x00 ; 0 1a2cc: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1a2d0: 9b 01 movw r18, r22 1a2d2: ac 01 movw r20, r24 1a2d4: c5 01 movw r24, r10 1a2d6: b4 01 movw r22, r8 1a2d8: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1a2dc: c3 57 subi r28, 0x73 ; 115 1a2de: df 4f sbci r29, 0xFF ; 255 1a2e0: 28 81 ld r18, Y 1a2e2: 39 81 ldd r19, Y+1 ; 0x01 1a2e4: 4a 81 ldd r20, Y+2 ; 0x02 1a2e6: 5b 81 ldd r21, Y+3 ; 0x03 1a2e8: cd 58 subi r28, 0x8D ; 141 1a2ea: d0 40 sbci r29, 0x00 ; 0 1a2ec: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1a2f0: 2b 01 movw r4, r22 1a2f2: 3c 01 movw r6, r24 h[2] = (b[2] - A[2][0] * h[0] - A[2][1] * h[1] - A[2][3] * h[3]) / A[2][2]; 1a2f4: cf 55 subi r28, 0x5F ; 95 1a2f6: df 4f sbci r29, 0xFF ; 255 1a2f8: 28 81 ld r18, Y 1a2fa: 39 81 ldd r19, Y+1 ; 0x01 1a2fc: 4a 81 ldd r20, Y+2 ; 0x02 1a2fe: 5b 81 ldd r21, Y+3 ; 0x03 1a300: c1 5a subi r28, 0xA1 ; 161 1a302: d0 40 sbci r29, 0x00 ; 0 1a304: 6e 96 adiw r28, 0x1e ; 30 1a306: 6c ad ldd r22, Y+60 ; 0x3c 1a308: 7d ad ldd r23, Y+61 ; 0x3d 1a30a: 8e ad ldd r24, Y+62 ; 0x3e 1a30c: 9f ad ldd r25, Y+63 ; 0x3f 1a30e: 6e 97 sbiw r28, 0x1e ; 30 1a310: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1a314: 9b 01 movw r18, r22 1a316: ac 01 movw r20, r24 1a318: c3 56 subi r28, 0x63 ; 99 1a31a: df 4f sbci r29, 0xFF ; 255 1a31c: 68 81 ld r22, Y 1a31e: 79 81 ldd r23, Y+1 ; 0x01 1a320: 8a 81 ldd r24, Y+2 ; 0x02 1a322: 9b 81 ldd r25, Y+3 ; 0x03 1a324: cd 59 subi r28, 0x9D ; 157 1a326: d0 40 sbci r29, 0x00 ; 0 1a328: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1a32c: 4b 01 movw r8, r22 1a32e: 5c 01 movw r10, r24 1a330: cb 55 subi r28, 0x5B ; 91 1a332: df 4f sbci r29, 0xFF ; 255 1a334: 28 81 ld r18, Y 1a336: 39 81 ldd r19, Y+1 ; 0x01 1a338: 4a 81 ldd r20, Y+2 ; 0x02 1a33a: 5b 81 ldd r21, Y+3 ; 0x03 1a33c: c5 5a subi r28, 0xA5 ; 165 1a33e: d0 40 sbci r29, 0x00 ; 0 1a340: c3 01 movw r24, r6 1a342: b2 01 movw r22, r4 1a344: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1a348: 9b 01 movw r18, r22 1a34a: ac 01 movw r20, r24 1a34c: c5 01 movw r24, r10 1a34e: b4 01 movw r22, r8 1a350: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1a354: 4b 01 movw r8, r22 1a356: 5c 01 movw r10, r24 1a358: a7 01 movw r20, r14 1a35a: 96 01 movw r18, r12 1a35c: cd 54 subi r28, 0x4D ; 77 1a35e: df 4f sbci r29, 0xFF ; 255 1a360: 68 81 ld r22, Y 1a362: 79 81 ldd r23, Y+1 ; 0x01 1a364: 8a 81 ldd r24, Y+2 ; 0x02 1a366: 9b 81 ldd r25, Y+3 ; 0x03 1a368: c3 5b subi r28, 0xB3 ; 179 1a36a: d0 40 sbci r29, 0x00 ; 0 1a36c: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1a370: 9b 01 movw r18, r22 1a372: ac 01 movw r20, r24 1a374: c5 01 movw r24, r10 1a376: b4 01 movw r22, r8 1a378: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1a37c: c9 54 subi r28, 0x49 ; 73 1a37e: df 4f sbci r29, 0xFF ; 255 1a380: 28 81 ld r18, Y 1a382: 39 81 ldd r19, Y+1 ; 0x01 1a384: 4a 81 ldd r20, Y+2 ; 0x02 1a386: 5b 81 ldd r21, Y+3 ; 0x03 1a388: c7 5b subi r28, 0xB7 ; 183 1a38a: d0 40 sbci r29, 0x00 ; 0 1a38c: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1a390: 4b 01 movw r8, r22 1a392: 5c 01 movw r10, r24 h[3] = (b[3] - A[3][0] * h[0] - A[3][1] * h[1] - A[3][2] * h[2]) / A[3][3]; 1a394: c1 54 subi r28, 0x41 ; 65 1a396: df 4f sbci r29, 0xFF ; 255 1a398: 28 81 ld r18, Y 1a39a: 39 81 ldd r19, Y+1 ; 0x01 1a39c: 4a 81 ldd r20, Y+2 ; 0x02 1a39e: 5b 81 ldd r21, Y+3 ; 0x03 1a3a0: cf 5b subi r28, 0xBF ; 191 1a3a2: d0 40 sbci r29, 0x00 ; 0 1a3a4: 6e 96 adiw r28, 0x1e ; 30 1a3a6: 6c ad ldd r22, Y+60 ; 0x3c 1a3a8: 7d ad ldd r23, Y+61 ; 0x3d 1a3aa: 8e ad ldd r24, Y+62 ; 0x3e 1a3ac: 9f ad ldd r25, Y+63 ; 0x3f 1a3ae: 6e 97 sbiw r28, 0x1e ; 30 1a3b0: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1a3b4: 9b 01 movw r18, r22 1a3b6: ac 01 movw r20, r24 1a3b8: c5 54 subi r28, 0x45 ; 69 1a3ba: df 4f sbci r29, 0xFF ; 255 1a3bc: 68 81 ld r22, Y 1a3be: 79 81 ldd r23, Y+1 ; 0x01 1a3c0: 8a 81 ldd r24, Y+2 ; 0x02 1a3c2: 9b 81 ldd r25, Y+3 ; 0x03 1a3c4: cb 5b subi r28, 0xBB ; 187 1a3c6: d0 40 sbci r29, 0x00 ; 0 1a3c8: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1a3cc: 6b 01 movw r12, r22 1a3ce: 7c 01 movw r14, r24 1a3d0: cd 53 subi r28, 0x3D ; 61 1a3d2: df 4f sbci r29, 0xFF ; 255 1a3d4: 28 81 ld r18, Y 1a3d6: 39 81 ldd r19, Y+1 ; 0x01 1a3d8: 4a 81 ldd r20, Y+2 ; 0x02 1a3da: 5b 81 ldd r21, Y+3 ; 0x03 1a3dc: c3 5c subi r28, 0xC3 ; 195 1a3de: d0 40 sbci r29, 0x00 ; 0 1a3e0: c3 01 movw r24, r6 1a3e2: b2 01 movw r22, r4 1a3e4: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1a3e8: 9b 01 movw r18, r22 1a3ea: ac 01 movw r20, r24 1a3ec: c7 01 movw r24, r14 1a3ee: b6 01 movw r22, r12 1a3f0: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1a3f4: 6b 01 movw r12, r22 1a3f6: 7c 01 movw r14, r24 1a3f8: c9 53 subi r28, 0x39 ; 57 1a3fa: df 4f sbci r29, 0xFF ; 255 1a3fc: 28 81 ld r18, Y 1a3fe: 39 81 ldd r19, Y+1 ; 0x01 1a400: 4a 81 ldd r20, Y+2 ; 0x02 1a402: 5b 81 ldd r21, Y+3 ; 0x03 1a404: c7 5c subi r28, 0xC7 ; 199 1a406: d0 40 sbci r29, 0x00 ; 0 1a408: c5 01 movw r24, r10 1a40a: b4 01 movw r22, r8 1a40c: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1a410: 9b 01 movw r18, r22 1a412: ac 01 movw r20, r24 1a414: c7 01 movw r24, r14 1a416: b6 01 movw r22, r12 1a418: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1a41c: c5 53 subi r28, 0x35 ; 53 1a41e: df 4f sbci r29, 0xFF ; 255 1a420: 28 81 ld r18, Y 1a422: 39 81 ldd r19, Y+1 ; 0x01 1a424: 4a 81 ldd r20, Y+2 ; 0x02 1a426: 5b 81 ldd r21, Y+3 ; 0x03 1a428: cb 5c subi r28, 0xCB ; 203 1a42a: d0 40 sbci r29, 0x00 ; 0 1a42c: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1a430: 6b 01 movw r12, r22 1a432: 7c 01 movw r14, r24 1a434: 11 50 subi r17, 0x01 ; 1 b[r] = -acc; } // Solve for h by a Gauss iteration method. float h[4] = { 0.f }; for (uint8_t gauss_iter = 0; gauss_iter < 100; ++gauss_iter) { 1a436: 09 f0 breq .+2 ; 0x1a43a 1a438: c9 ce rjmp .-622 ; 0x1a1cc // and update the current position with h. // It may be better to use the Levenberg-Marquart method here, // but because we are very close to the solution alread, // the simple Gauss-Newton non-linear Least Squares method works well enough. cntr[0] += h[0]; 1a43a: 6e 96 adiw r28, 0x1e ; 30 1a43c: 2c ad ldd r18, Y+60 ; 0x3c 1a43e: 3d ad ldd r19, Y+61 ; 0x3d 1a440: 4e ad ldd r20, Y+62 ; 0x3e 1a442: 5f ad ldd r21, Y+63 ; 0x3f 1a444: 6e 97 sbiw r28, 0x1e ; 30 1a446: c5 55 subi r28, 0x55 ; 85 1a448: df 4f sbci r29, 0xFF ; 255 1a44a: 68 81 ld r22, Y 1a44c: 79 81 ldd r23, Y+1 ; 0x01 1a44e: 8a 81 ldd r24, Y+2 ; 0x02 1a450: 9b 81 ldd r25, Y+3 ; 0x03 1a452: cb 5a subi r28, 0xAB ; 171 1a454: d0 40 sbci r29, 0x00 ; 0 1a456: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1a45a: 60 93 cd 12 sts 0x12CD, r22 ; 0x8012cd 1a45e: 70 93 ce 12 sts 0x12CE, r23 ; 0x8012ce 1a462: 80 93 cf 12 sts 0x12CF, r24 ; 0x8012cf 1a466: 90 93 d0 12 sts 0x12D0, r25 ; 0x8012d0 cntr[1] += h[1]; 1a46a: a3 01 movw r20, r6 1a46c: 92 01 movw r18, r4 1a46e: c1 55 subi r28, 0x51 ; 81 1a470: df 4f sbci r29, 0xFF ; 255 1a472: 68 81 ld r22, Y 1a474: 79 81 ldd r23, Y+1 ; 0x01 1a476: 8a 81 ldd r24, Y+2 ; 0x02 1a478: 9b 81 ldd r25, Y+3 ; 0x03 1a47a: cf 5a subi r28, 0xAF ; 175 1a47c: d0 40 sbci r29, 0x00 ; 0 1a47e: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1a482: 60 93 d1 12 sts 0x12D1, r22 ; 0x8012d1 1a486: 70 93 d2 12 sts 0x12D2, r23 ; 0x8012d2 1a48a: 80 93 d3 12 sts 0x12D3, r24 ; 0x8012d3 1a48e: 90 93 d4 12 sts 0x12D4, r25 ; 0x8012d4 a1 += h[2]; 1a492: a5 01 movw r20, r10 1a494: 94 01 movw r18, r8 1a496: a6 96 adiw r28, 0x26 ; 38 1a498: 6c ad ldd r22, Y+60 ; 0x3c 1a49a: 7d ad ldd r23, Y+61 ; 0x3d 1a49c: 8e ad ldd r24, Y+62 ; 0x3e 1a49e: 9f ad ldd r25, Y+63 ; 0x3f 1a4a0: a6 97 sbiw r28, 0x26 ; 38 1a4a2: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1a4a6: a6 96 adiw r28, 0x26 ; 38 1a4a8: 6c af std Y+60, r22 ; 0x3c 1a4aa: 7d af std Y+61, r23 ; 0x3d 1a4ac: 8e af std Y+62, r24 ; 0x3e 1a4ae: 9f af std Y+63, r25 ; 0x3f 1a4b0: a6 97 sbiw r28, 0x26 ; 38 a2 += h[3]; 1a4b2: a7 01 movw r20, r14 1a4b4: 96 01 movw r18, r12 1a4b6: a2 96 adiw r28, 0x22 ; 34 1a4b8: 6c ad ldd r22, Y+60 ; 0x3c 1a4ba: 7d ad ldd r23, Y+61 ; 0x3d 1a4bc: 8e ad ldd r24, Y+62 ; 0x3e 1a4be: 9f ad ldd r25, Y+63 ; 0x3f 1a4c0: a2 97 sbiw r28, 0x22 ; 34 1a4c2: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1a4c6: a2 96 adiw r28, 0x22 ; 34 1a4c8: 6c af std Y+60, r22 ; 0x3c 1a4ca: 7d af std Y+61, r23 ; 0x3d 1a4cc: 8e af std Y+62, r24 ; 0x3e 1a4ce: 9f af std Y+63, r25 ; 0x3f 1a4d0: a2 97 sbiw r28, 0x22 ; 34 1a4d2: e6 96 adiw r28, 0x36 ; 54 1a4d4: 9f ad ldd r25, Y+63 ; 0x3f 1a4d6: e6 97 sbiw r28, 0x36 ; 54 1a4d8: 91 50 subi r25, 0x01 ; 1 1a4da: e6 96 adiw r28, 0x36 ; 54 1a4dc: 9f af std Y+63, r25 ; 0x3f 1a4de: e6 97 sbiw r28, 0x36 ; 54 cntr[1] = 0.f; // Rotation of the machine X axis from the bed X axis. float a1 = 0; // Rotation of the machine Y axis from the bed Y axis. float a2 = 0; for (int8_t iter = 0; iter < 100; ++iter) { 1a4e0: 91 11 cpse r25, r1 1a4e2: 70 c9 rjmp .-3360 ; 0x197c4 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 1a4e4: a6 96 adiw r28, 0x26 ; 38 1a4e6: 6c ad ldd r22, Y+60 ; 0x3c 1a4e8: 7d ad ldd r23, Y+61 ; 0x3d 1a4ea: 8e ad ldd r24, Y+62 ; 0x3e 1a4ec: 9f ad ldd r25, Y+63 ; 0x3f 1a4ee: a6 97 sbiw r28, 0x26 ; 38 1a4f0: 0f 94 fe a1 call 0x343fc ; 0x343fc 1a4f4: 60 93 bd 12 sts 0x12BD, r22 ; 0x8012bd 1a4f8: 70 93 be 12 sts 0x12BE, r23 ; 0x8012be 1a4fc: 80 93 bf 12 sts 0x12BF, r24 ; 0x8012bf 1a500: 90 93 c0 12 sts 0x12C0, r25 ; 0x8012c0 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 1a504: a6 96 adiw r28, 0x26 ; 38 1a506: 6c ad ldd r22, Y+60 ; 0x3c 1a508: 7d ad ldd r23, Y+61 ; 0x3d 1a50a: 8e ad ldd r24, Y+62 ; 0x3e 1a50c: 9f ad ldd r25, Y+63 ; 0x3f 1a50e: a6 97 sbiw r28, 0x26 ; 38 1a510: 0f 94 c4 a4 call 0x34988 ; 0x34988 1a514: 60 93 c1 12 sts 0x12C1, r22 ; 0x8012c1 1a518: 70 93 c2 12 sts 0x12C2, r23 ; 0x8012c2 1a51c: 80 93 c3 12 sts 0x12C3, r24 ; 0x8012c3 1a520: 90 93 c4 12 sts 0x12C4, r25 ; 0x8012c4 vec_y[0] = -sin(a2) * MACHINE_AXIS_SCALE_Y; 1a524: a2 96 adiw r28, 0x22 ; 34 1a526: 6c ad ldd r22, Y+60 ; 0x3c 1a528: 7d ad ldd r23, Y+61 ; 0x3d 1a52a: 8e ad ldd r24, Y+62 ; 0x3e 1a52c: 9f ad ldd r25, Y+63 ; 0x3f 1a52e: a2 97 sbiw r28, 0x22 ; 34 1a530: 0f 94 c4 a4 call 0x34988 ; 0x34988 1a534: 90 58 subi r25, 0x80 ; 128 1a536: 60 93 c5 12 sts 0x12C5, r22 ; 0x8012c5 1a53a: 70 93 c6 12 sts 0x12C6, r23 ; 0x8012c6 1a53e: 80 93 c7 12 sts 0x12C7, r24 ; 0x8012c7 1a542: 90 93 c8 12 sts 0x12C8, r25 ; 0x8012c8 vec_y[1] = cos(a2) * MACHINE_AXIS_SCALE_Y; 1a546: a2 96 adiw r28, 0x22 ; 34 1a548: 6c ad ldd r22, Y+60 ; 0x3c 1a54a: 7d ad ldd r23, Y+61 ; 0x3d 1a54c: 8e ad ldd r24, Y+62 ; 0x3e 1a54e: 9f ad ldd r25, Y+63 ; 0x3f 1a550: a2 97 sbiw r28, 0x22 ; 34 1a552: 0f 94 fe a1 call 0x343fc ; 0x343fc 1a556: 60 93 c9 12 sts 0x12C9, r22 ; 0x8012c9 1a55a: 70 93 ca 12 sts 0x12CA, r23 ; 0x8012ca 1a55e: 80 93 cb 12 sts 0x12CB, r24 ; 0x8012cb 1a562: 90 93 cc 12 sts 0x12CC, r25 ; 0x8012cc BedSkewOffsetDetectionResultType result = BED_SKEW_OFFSET_DETECTION_PERFECT; { angleDiff = fabs(a2 - a1); 1a566: a6 96 adiw r28, 0x26 ; 38 1a568: 2c ad ldd r18, Y+60 ; 0x3c 1a56a: 3d ad ldd r19, Y+61 ; 0x3d 1a56c: 4e ad ldd r20, Y+62 ; 0x3e 1a56e: 5f ad ldd r21, Y+63 ; 0x3f 1a570: a6 97 sbiw r28, 0x26 ; 38 1a572: a2 96 adiw r28, 0x22 ; 34 1a574: 6c ad ldd r22, Y+60 ; 0x3c 1a576: 7d ad ldd r23, Y+61 ; 0x3d 1a578: 8e ad ldd r24, Y+62 ; 0x3e 1a57a: 9f ad ldd r25, Y+63 ; 0x3f 1a57c: a2 97 sbiw r28, 0x22 ; 34 1a57e: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1a582: 4b 01 movw r8, r22 1a584: 5c 01 movw r10, r24 1a586: 7c 01 movw r14, r24 1a588: 6b 01 movw r12, r22 1a58a: e8 94 clt 1a58c: f7 f8 bld r15, 7 /// XY skew and Y-bed skew DBG(_n("Measured skews: %f %f\n"), degrees(a2 - a1), degrees(a2)); 1a58e: 21 ee ldi r18, 0xE1 ; 225 1a590: 3e e2 ldi r19, 0x2E ; 46 1a592: 45 e6 ldi r20, 0x65 ; 101 1a594: 52 e4 ldi r21, 0x42 ; 66 1a596: a2 96 adiw r28, 0x22 ; 34 1a598: 6c ad ldd r22, Y+60 ; 0x3c 1a59a: 7d ad ldd r23, Y+61 ; 0x3d 1a59c: 8e ad ldd r24, Y+62 ; 0x3e 1a59e: 9f ad ldd r25, Y+63 ; 0x3f 1a5a0: a2 97 sbiw r28, 0x22 ; 34 1a5a2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1a5a6: 9f 93 push r25 1a5a8: 8f 93 push r24 1a5aa: 7f 93 push r23 1a5ac: 6f 93 push r22 1a5ae: 21 ee ldi r18, 0xE1 ; 225 1a5b0: 3e e2 ldi r19, 0x2E ; 46 1a5b2: 45 e6 ldi r20, 0x65 ; 101 1a5b4: 52 e4 ldi r21, 0x42 ; 66 1a5b6: c5 01 movw r24, r10 1a5b8: b4 01 movw r22, r8 1a5ba: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1a5be: 9f 93 push r25 1a5c0: 8f 93 push r24 1a5c2: 7f 93 push r23 1a5c4: 6f 93 push r22 1a5c6: 8d e3 ldi r24, 0x3D ; 61 1a5c8: 99 e6 ldi r25, 0x69 ; 105 1a5ca: 9f 93 push r25 1a5cc: 8f 93 push r24 1a5ce: 0f 94 9e 9e call 0x33d3c ; 0x33d3c if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 1a5d2: b7 01 movw r22, r14 1a5d4: a6 01 movw r20, r12 1a5d6: 80 e6 ldi r24, 0x60 ; 96 1a5d8: 9f e0 ldi r25, 0x0F ; 15 1a5da: 0f 94 12 a0 call 0x34024 ; 0x34024 eeprom_update_float_notify((float *)(EEPROM_XYZ_CAL_SKEW), angleDiff); //storing xyz cal. skew to be able to show in support menu later if (angleDiff > bed_skew_angle_mild) 1a5de: 0f b6 in r0, 0x3f ; 63 1a5e0: f8 94 cli 1a5e2: de bf out 0x3e, r29 ; 62 1a5e4: 0f be out 0x3f, r0 ; 63 1a5e6: cd bf out 0x3d, r28 ; 61 1a5e8: 2f e1 ldi r18, 0x1F ; 31 1a5ea: 32 e4 ldi r19, 0x42 ; 66 1a5ec: 49 e0 ldi r20, 0x09 ; 9 1a5ee: 5b e3 ldi r21, 0x3B ; 59 1a5f0: c7 01 movw r24, r14 1a5f2: b6 01 movw r22, r12 1a5f4: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; vec_y[0] = -sin(a2) * MACHINE_AXIS_SCALE_Y; vec_y[1] = cos(a2) * MACHINE_AXIS_SCALE_Y; BedSkewOffsetDetectionResultType result = BED_SKEW_OFFSET_DETECTION_PERFECT; 1a5f8: 10 e0 ldi r17, 0x00 ; 0 { angleDiff = fabs(a2 - a1); /// XY skew and Y-bed skew DBG(_n("Measured skews: %f %f\n"), degrees(a2 - a1), degrees(a2)); eeprom_update_float_notify((float *)(EEPROM_XYZ_CAL_SKEW), angleDiff); //storing xyz cal. skew to be able to show in support menu later if (angleDiff > bed_skew_angle_mild) 1a5fa: 18 16 cp r1, r24 1a5fc: 64 f4 brge .+24 ; 0x1a616 result = (angleDiff > bed_skew_angle_extreme) ? 1a5fe: 25 e3 ldi r18, 0x35 ; 53 1a600: 3a ef ldi r19, 0xFA ; 250 1a602: 4e e8 ldi r20, 0x8E ; 142 1a604: 5b e3 ldi r21, 0x3B ; 59 1a606: c7 01 movw r24, r14 1a608: b6 01 movw r22, r12 1a60a: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 1a60e: 12 e0 ldi r17, 0x02 ; 2 1a610: 18 16 cp r1, r24 1a612: 0c f0 brlt .+2 ; 0x1a616 1a614: 11 e0 ldi r17, 0x01 ; 1 BED_SKEW_OFFSET_DETECTION_SKEW_EXTREME : BED_SKEW_OFFSET_DETECTION_SKEW_MILD; if (fabs(a1) > bed_skew_angle_extreme || 1a616: 25 e3 ldi r18, 0x35 ; 53 1a618: 3a ef ldi r19, 0xFA ; 250 1a61a: 4e e8 ldi r20, 0x8E ; 142 1a61c: 5b e3 ldi r21, 0x3B ; 59 1a61e: a6 96 adiw r28, 0x26 ; 38 1a620: 6c ad ldd r22, Y+60 ; 0x3c 1a622: 7d ad ldd r23, Y+61 ; 0x3d 1a624: 8e ad ldd r24, Y+62 ; 0x3e 1a626: 9f ad ldd r25, Y+63 ; 0x3f 1a628: a6 97 sbiw r28, 0x26 ; 38 1a62a: 9f 77 andi r25, 0x7F ; 127 1a62c: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 1a630: 18 16 cp r1, r24 1a632: 0c f4 brge .+2 ; 0x1a636 1a634: 67 c4 rjmp .+2254 ; 0x1af04 1a636: 25 e3 ldi r18, 0x35 ; 53 1a638: 3a ef ldi r19, 0xFA ; 250 1a63a: 4e e8 ldi r20, 0x8E ; 142 1a63c: 5b e3 ldi r21, 0x3B ; 59 1a63e: a2 96 adiw r28, 0x22 ; 34 1a640: 6c ad ldd r22, Y+60 ; 0x3c 1a642: 7d ad ldd r23, Y+61 ; 0x3d 1a644: 8e ad ldd r24, Y+62 ; 0x3e 1a646: 9f ad ldd r25, Y+63 ; 0x3f 1a648: a2 97 sbiw r28, 0x22 ; 34 1a64a: 9f 77 andi r25, 0x7F ; 127 1a64c: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 1a650: 18 16 cp r1, r24 1a652: 0c f4 brge .+2 ; 0x1a656 1a654: 57 c4 rjmp .+2222 ; 0x1af04 SERIAL_ECHOLNPGM("Error after correction: "); } #endif // SUPPORT_VERBOSITY // Measure the error after correction. for (uint8_t i = 0; i < npts; ++i) { float x = vec_x[0] * measured_pts[i * 2] + vec_y[0] * measured_pts[i * 2 + 1] + cntr[0]; 1a656: 20 91 bd 12 lds r18, 0x12BD ; 0x8012bd 1a65a: 30 91 be 12 lds r19, 0x12BE ; 0x8012be 1a65e: 40 91 bf 12 lds r20, 0x12BF ; 0x8012bf 1a662: 50 91 c0 12 lds r21, 0x12C0 ; 0x8012c0 1a666: ae 96 adiw r28, 0x2e ; 46 1a668: 2c af std Y+60, r18 ; 0x3c 1a66a: 3d af std Y+61, r19 ; 0x3d 1a66c: 4e af std Y+62, r20 ; 0x3e 1a66e: 5f af std Y+63, r21 ; 0x3f 1a670: ae 97 sbiw r28, 0x2e ; 46 1a672: 80 91 c5 12 lds r24, 0x12C5 ; 0x8012c5 1a676: 90 91 c6 12 lds r25, 0x12C6 ; 0x8012c6 1a67a: a0 91 c7 12 lds r26, 0x12C7 ; 0x8012c7 1a67e: b0 91 c8 12 lds r27, 0x12C8 ; 0x8012c8 1a682: e9 96 adiw r28, 0x39 ; 57 1a684: 8c af std Y+60, r24 ; 0x3c 1a686: 9d af std Y+61, r25 ; 0x3d 1a688: ae af std Y+62, r26 ; 0x3e 1a68a: bf af std Y+63, r27 ; 0x3f 1a68c: e9 97 sbiw r28, 0x39 ; 57 1a68e: 20 91 cd 12 lds r18, 0x12CD ; 0x8012cd 1a692: 30 91 ce 12 lds r19, 0x12CE ; 0x8012ce 1a696: 40 91 cf 12 lds r20, 0x12CF ; 0x8012cf 1a69a: 50 91 d0 12 lds r21, 0x12D0 ; 0x8012d0 1a69e: e4 96 adiw r28, 0x34 ; 52 1a6a0: 2c af std Y+60, r18 ; 0x3c 1a6a2: 3d af std Y+61, r19 ; 0x3d 1a6a4: 4e af std Y+62, r20 ; 0x3e 1a6a6: 5f af std Y+63, r21 ; 0x3f 1a6a8: e4 97 sbiw r28, 0x34 ; 52 float y = vec_x[1] * measured_pts[i * 2] + vec_y[1] * measured_pts[i * 2 + 1] + cntr[1]; 1a6aa: 80 91 c1 12 lds r24, 0x12C1 ; 0x8012c1 1a6ae: 90 91 c2 12 lds r25, 0x12C2 ; 0x8012c2 1a6b2: a0 91 c3 12 lds r26, 0x12C3 ; 0x8012c3 1a6b6: b0 91 c4 12 lds r27, 0x12C4 ; 0x8012c4 1a6ba: ed 96 adiw r28, 0x3d ; 61 1a6bc: 8c af std Y+60, r24 ; 0x3c 1a6be: 9d af std Y+61, r25 ; 0x3d 1a6c0: ae af std Y+62, r26 ; 0x3e 1a6c2: bf af std Y+63, r27 ; 0x3f 1a6c4: ed 97 sbiw r28, 0x3d ; 61 1a6c6: 20 91 c9 12 lds r18, 0x12C9 ; 0x8012c9 1a6ca: 30 91 ca 12 lds r19, 0x12CA ; 0x8012ca 1a6ce: 40 91 cb 12 lds r20, 0x12CB ; 0x8012cb 1a6d2: 50 91 cc 12 lds r21, 0x12CC ; 0x8012cc 1a6d6: c3 58 subi r28, 0x83 ; 131 1a6d8: df 4f sbci r29, 0xFF ; 255 1a6da: 28 83 st Y, r18 1a6dc: 39 83 std Y+1, r19 ; 0x01 1a6de: 4a 83 std Y+2, r20 ; 0x02 1a6e0: 5b 83 std Y+3, r21 ; 0x03 1a6e2: cd 57 subi r28, 0x7D ; 125 1a6e4: d0 40 sbci r29, 0x00 ; 0 1a6e6: 80 91 d1 12 lds r24, 0x12D1 ; 0x8012d1 1a6ea: 90 91 d2 12 lds r25, 0x12D2 ; 0x8012d2 1a6ee: a0 91 d3 12 lds r26, 0x12D3 ; 0x8012d3 1a6f2: b0 91 d4 12 lds r27, 0x12D4 ; 0x8012d4 1a6f6: cf 57 subi r28, 0x7F ; 127 1a6f8: df 4f sbci r29, 0xFF ; 255 1a6fa: 88 83 st Y, r24 1a6fc: 99 83 std Y+1, r25 ; 0x01 1a6fe: aa 83 std Y+2, r26 ; 0x02 1a700: bb 83 std Y+3, r27 ; 0x03 1a702: c1 58 subi r28, 0x81 ; 129 1a704: d0 40 sbci r29, 0x00 ; 0 1a706: ac e4 ldi r26, 0x4C ; 76 1a708: b8 e8 ldi r27, 0x88 ; 136 1a70a: 6c 96 adiw r28, 0x1c ; 28 1a70c: bf af std Y+63, r27 ; 0x3f 1a70e: ae af std Y+62, r26 ; 0x3e 1a710: 6c 97 sbiw r28, 0x1c ; 28 1a712: 8c e9 ldi r24, 0x9C ; 156 1a714: 28 2e mov r2, r24 1a716: 82 e1 ldi r24, 0x12 ; 18 1a718: 38 2e mov r3, r24 SERIAL_ECHOLNPGM("Error after correction: "); } #endif // SUPPORT_VERBOSITY // Measure the error after correction. for (uint8_t i = 0; i < npts; ++i) { float x = vec_x[0] * measured_pts[i * 2] + vec_y[0] * measured_pts[i * 2 + 1] + cntr[0]; 1a71a: f1 01 movw r30, r2 1a71c: c1 80 ldd r12, Z+1 ; 0x01 1a71e: d2 80 ldd r13, Z+2 ; 0x02 1a720: e3 80 ldd r14, Z+3 ; 0x03 1a722: f4 80 ldd r15, Z+4 ; 0x04 1a724: 45 80 ldd r4, Z+5 ; 0x05 1a726: 56 80 ldd r5, Z+6 ; 0x06 1a728: 67 80 ldd r6, Z+7 ; 0x07 1a72a: 70 84 ldd r7, Z+8 ; 0x08 float y = vec_x[1] * measured_pts[i * 2] + vec_y[1] * measured_pts[i * 2 + 1] + cntr[1]; float errX = pgm_read_float(true_pts + i * 2) - x; 1a72c: 6c 96 adiw r28, 0x1c ; 28 1a72e: ee ad ldd r30, Y+62 ; 0x3e 1a730: ff ad ldd r31, Y+63 ; 0x3f 1a732: 6c 97 sbiw r28, 0x1c ; 28 1a734: 25 91 lpm r18, Z+ 1a736: 35 91 lpm r19, Z+ 1a738: 45 91 lpm r20, Z+ 1a73a: 54 91 lpm r21, Z 1a73c: cb 57 subi r28, 0x7B ; 123 1a73e: df 4f sbci r29, 0xFF ; 255 1a740: 28 83 st Y, r18 1a742: 39 83 std Y+1, r19 ; 0x01 1a744: 4a 83 std Y+2, r20 ; 0x02 1a746: 5b 83 std Y+3, r21 ; 0x03 1a748: c5 58 subi r28, 0x85 ; 133 1a74a: d0 40 sbci r29, 0x00 ; 0 float errY = pgm_read_float(true_pts + i * 2 + 1) - y; 1a74c: 6c 96 adiw r28, 0x1c ; 28 1a74e: ee ad ldd r30, Y+62 ; 0x3e 1a750: ff ad ldd r31, Y+63 ; 0x3f 1a752: 6c 97 sbiw r28, 0x1c ; 28 1a754: 34 96 adiw r30, 0x04 ; 4 1a756: 85 90 lpm r8, Z+ 1a758: 95 90 lpm r9, Z+ 1a75a: a5 90 lpm r10, Z+ 1a75c: b4 90 lpm r11, Z } #endif // SUPPORT_VERBOSITY // Measure the error after correction. for (uint8_t i = 0; i < npts; ++i) { float x = vec_x[0] * measured_pts[i * 2] + vec_y[0] * measured_pts[i * 2 + 1] + cntr[0]; float y = vec_x[1] * measured_pts[i * 2] + vec_y[1] * measured_pts[i * 2 + 1] + cntr[1]; 1a75e: ed 96 adiw r28, 0x3d ; 61 1a760: 2c ad ldd r18, Y+60 ; 0x3c 1a762: 3d ad ldd r19, Y+61 ; 0x3d 1a764: 4e ad ldd r20, Y+62 ; 0x3e 1a766: 5f ad ldd r21, Y+63 ; 0x3f 1a768: ed 97 sbiw r28, 0x3d ; 61 1a76a: c7 01 movw r24, r14 1a76c: b6 01 movw r22, r12 1a76e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1a772: c7 57 subi r28, 0x77 ; 119 1a774: df 4f sbci r29, 0xFF ; 255 1a776: 68 83 st Y, r22 1a778: 79 83 std Y+1, r23 ; 0x01 1a77a: 8a 83 std Y+2, r24 ; 0x02 1a77c: 9b 83 std Y+3, r25 ; 0x03 1a77e: c9 58 subi r28, 0x89 ; 137 1a780: d0 40 sbci r29, 0x00 ; 0 1a782: c3 58 subi r28, 0x83 ; 131 1a784: df 4f sbci r29, 0xFF ; 255 1a786: 28 81 ld r18, Y 1a788: 39 81 ldd r19, Y+1 ; 0x01 1a78a: 4a 81 ldd r20, Y+2 ; 0x02 1a78c: 5b 81 ldd r21, Y+3 ; 0x03 1a78e: cd 57 subi r28, 0x7D ; 125 1a790: d0 40 sbci r29, 0x00 ; 0 1a792: c3 01 movw r24, r6 1a794: b2 01 movw r22, r4 1a796: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1a79a: 9b 01 movw r18, r22 1a79c: ac 01 movw r20, r24 1a79e: c7 57 subi r28, 0x77 ; 119 1a7a0: df 4f sbci r29, 0xFF ; 255 1a7a2: 68 81 ld r22, Y 1a7a4: 79 81 ldd r23, Y+1 ; 0x01 1a7a6: 8a 81 ldd r24, Y+2 ; 0x02 1a7a8: 9b 81 ldd r25, Y+3 ; 0x03 1a7aa: c9 58 subi r28, 0x89 ; 137 1a7ac: d0 40 sbci r29, 0x00 ; 0 1a7ae: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1a7b2: cf 57 subi r28, 0x7F ; 127 1a7b4: df 4f sbci r29, 0xFF ; 255 1a7b6: 28 81 ld r18, Y 1a7b8: 39 81 ldd r19, Y+1 ; 0x01 1a7ba: 4a 81 ldd r20, Y+2 ; 0x02 1a7bc: 5b 81 ldd r21, Y+3 ; 0x03 1a7be: c1 58 subi r28, 0x81 ; 129 1a7c0: d0 40 sbci r29, 0x00 ; 0 1a7c2: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1a7c6: 9b 01 movw r18, r22 1a7c8: ac 01 movw r20, r24 float errX = pgm_read_float(true_pts + i * 2) - x; float errY = pgm_read_float(true_pts + i * 2 + 1) - y; 1a7ca: c5 01 movw r24, r10 1a7cc: b4 01 movw r22, r8 1a7ce: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1a7d2: 4b 01 movw r8, r22 1a7d4: 5c 01 movw r10, r24 SERIAL_ECHOLNPGM("Error after correction: "); } #endif // SUPPORT_VERBOSITY // Measure the error after correction. for (uint8_t i = 0; i < npts; ++i) { float x = vec_x[0] * measured_pts[i * 2] + vec_y[0] * measured_pts[i * 2 + 1] + cntr[0]; 1a7d6: a7 01 movw r20, r14 1a7d8: 96 01 movw r18, r12 1a7da: ae 96 adiw r28, 0x2e ; 46 1a7dc: 6c ad ldd r22, Y+60 ; 0x3c 1a7de: 7d ad ldd r23, Y+61 ; 0x3d 1a7e0: 8e ad ldd r24, Y+62 ; 0x3e 1a7e2: 9f ad ldd r25, Y+63 ; 0x3f 1a7e4: ae 97 sbiw r28, 0x2e ; 46 1a7e6: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1a7ea: 6b 01 movw r12, r22 1a7ec: 7c 01 movw r14, r24 1a7ee: a3 01 movw r20, r6 1a7f0: 92 01 movw r18, r4 1a7f2: e9 96 adiw r28, 0x39 ; 57 1a7f4: 6c ad ldd r22, Y+60 ; 0x3c 1a7f6: 7d ad ldd r23, Y+61 ; 0x3d 1a7f8: 8e ad ldd r24, Y+62 ; 0x3e 1a7fa: 9f ad ldd r25, Y+63 ; 0x3f 1a7fc: e9 97 sbiw r28, 0x39 ; 57 1a7fe: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1a802: 9b 01 movw r18, r22 1a804: ac 01 movw r20, r24 1a806: c7 01 movw r24, r14 1a808: b6 01 movw r22, r12 1a80a: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1a80e: e4 96 adiw r28, 0x34 ; 52 1a810: 2c ad ldd r18, Y+60 ; 0x3c 1a812: 3d ad ldd r19, Y+61 ; 0x3d 1a814: 4e ad ldd r20, Y+62 ; 0x3e 1a816: 5f ad ldd r21, Y+63 ; 0x3f 1a818: e4 97 sbiw r28, 0x34 ; 52 1a81a: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1a81e: 9b 01 movw r18, r22 1a820: ac 01 movw r20, r24 float y = vec_x[1] * measured_pts[i * 2] + vec_y[1] * measured_pts[i * 2 + 1] + cntr[1]; float errX = pgm_read_float(true_pts + i * 2) - x; 1a822: cb 57 subi r28, 0x7B ; 123 1a824: df 4f sbci r29, 0xFF ; 255 1a826: 68 81 ld r22, Y 1a828: 79 81 ldd r23, Y+1 ; 0x01 1a82a: 8a 81 ldd r24, Y+2 ; 0x02 1a82c: 9b 81 ldd r25, Y+3 ; 0x03 1a82e: c5 58 subi r28, 0x85 ; 133 1a830: d0 40 sbci r29, 0x00 ; 0 1a832: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> float errY = pgm_read_float(true_pts + i * 2 + 1) - y; float err = hypot(errX, errY); 1a836: a5 01 movw r20, r10 1a838: 94 01 movw r18, r8 1a83a: 0f 94 a0 a3 call 0x34740 ; 0x34740 } else { #ifdef SUPPORT_VERBOSITY if(verbosity_level >=20 ) SERIAL_ECHOPGM("Point not on first row"); #endif // SUPPORT_VERBOSITY if (err > BED_CALIBRATION_POINT_OFFSET_MAX_EUCLIDIAN) { 1a83e: 2d ec ldi r18, 0xCD ; 205 1a840: 3c ec ldi r19, 0xCC ; 204 1a842: 4c e4 ldi r20, 0x4C ; 76 1a844: 5f e3 ldi r21, 0x3F ; 63 1a846: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 1a84a: 18 16 cp r1, r24 1a84c: 0c f4 brge .+2 ; 0x1a850 result = BED_SKEW_OFFSET_DETECTION_FITTING_FAILED; 1a84e: 1e ef ldi r17, 0xFE ; 254 1a850: 38 e0 ldi r19, 0x08 ; 8 1a852: 23 0e add r2, r19 1a854: 31 1c adc r3, r1 1a856: 6c 96 adiw r28, 0x1c ; 28 1a858: 4e ad ldd r20, Y+62 ; 0x3e 1a85a: 5f ad ldd r21, Y+63 ; 0x3f 1a85c: 6c 97 sbiw r28, 0x1c ; 28 1a85e: 48 5f subi r20, 0xF8 ; 248 1a860: 5f 4f sbci r21, 0xFF ; 255 1a862: 6c 96 adiw r28, 0x1c ; 28 1a864: 5f af std Y+63, r21 ; 0x3f 1a866: 4e af std Y+62, r20 ; 0x3e 1a868: 6c 97 sbiw r28, 0x1c ; 28 SERIAL_ECHOLNPGM("Error after correction: "); } #endif // SUPPORT_VERBOSITY // Measure the error after correction. for (uint8_t i = 0; i < npts; ++i) { 1a86a: a8 96 adiw r28, 0x28 ; 40 1a86c: 8e ad ldd r24, Y+62 ; 0x3e 1a86e: 9f ad ldd r25, Y+63 ; 0x3f 1a870: a8 97 sbiw r28, 0x28 ; 40 1a872: 82 15 cp r24, r2 1a874: 93 05 cpc r25, r3 1a876: 09 f0 breq .+2 ; 0x1a87a 1a878: 50 cf rjmp .-352 ; 0x1a71a MYSERIAL.println(BED_CALIBRATION_POINT_OFFSET_MAX_EUCLIDIAN); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY if (result == BED_SKEW_OFFSET_DETECTION_PERFECT) { 1a87a: 11 11 cpse r17, r1 1a87c: 62 c1 rjmp .+708 ; 0x1ab42 #ifdef SUPPORT_VERBOSITY if (verbosity_level > 0) SERIAL_ECHOLNPGM("Very little skew detected. Orthogonalizing the axes."); #endif // SUPPORT_VERBOSITY // Orthogonalize the axes. a1 = 0.5f * (a1 + a2); 1a87e: a2 96 adiw r28, 0x22 ; 34 1a880: 2c ad ldd r18, Y+60 ; 0x3c 1a882: 3d ad ldd r19, Y+61 ; 0x3d 1a884: 4e ad ldd r20, Y+62 ; 0x3e 1a886: 5f ad ldd r21, Y+63 ; 0x3f 1a888: a2 97 sbiw r28, 0x22 ; 34 1a88a: a6 96 adiw r28, 0x26 ; 38 1a88c: 6c ad ldd r22, Y+60 ; 0x3c 1a88e: 7d ad ldd r23, Y+61 ; 0x3d 1a890: 8e ad ldd r24, Y+62 ; 0x3e 1a892: 9f ad ldd r25, Y+63 ; 0x3f 1a894: a6 97 sbiw r28, 0x26 ; 38 1a896: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1a89a: 20 e0 ldi r18, 0x00 ; 0 1a89c: 30 e0 ldi r19, 0x00 ; 0 1a89e: 40 e0 ldi r20, 0x00 ; 0 1a8a0: 5f e3 ldi r21, 0x3F ; 63 1a8a2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1a8a6: 6b 01 movw r12, r22 1a8a8: 7c 01 movw r14, r24 vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 1a8aa: 0f 94 fe a1 call 0x343fc ; 0x343fc 1a8ae: a2 96 adiw r28, 0x22 ; 34 1a8b0: 6c af std Y+60, r22 ; 0x3c 1a8b2: 7d af std Y+61, r23 ; 0x3d 1a8b4: 8e af std Y+62, r24 ; 0x3e 1a8b6: 9f af std Y+63, r25 ; 0x3f 1a8b8: a2 97 sbiw r28, 0x22 ; 34 1a8ba: 60 93 bd 12 sts 0x12BD, r22 ; 0x8012bd 1a8be: 70 93 be 12 sts 0x12BE, r23 ; 0x8012be 1a8c2: 80 93 bf 12 sts 0x12BF, r24 ; 0x8012bf 1a8c6: 90 93 c0 12 sts 0x12C0, r25 ; 0x8012c0 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 1a8ca: c7 01 movw r24, r14 1a8cc: b6 01 movw r22, r12 1a8ce: 0f 94 c4 a4 call 0x34988 ; 0x34988 1a8d2: a6 96 adiw r28, 0x26 ; 38 1a8d4: 6c af std Y+60, r22 ; 0x3c 1a8d6: 7d af std Y+61, r23 ; 0x3d 1a8d8: 8e af std Y+62, r24 ; 0x3e 1a8da: 9f af std Y+63, r25 ; 0x3f 1a8dc: a6 97 sbiw r28, 0x26 ; 38 1a8de: 60 93 c1 12 sts 0x12C1, r22 ; 0x8012c1 1a8e2: 70 93 c2 12 sts 0x12C2, r23 ; 0x8012c2 1a8e6: 80 93 c3 12 sts 0x12C3, r24 ; 0x8012c3 1a8ea: 90 93 c4 12 sts 0x12C4, r25 ; 0x8012c4 vec_y[0] = -sin(a1) * MACHINE_AXIS_SCALE_Y; 1a8ee: 9b 01 movw r18, r22 1a8f0: ac 01 movw r20, r24 1a8f2: 50 58 subi r21, 0x80 ; 128 1a8f4: aa 96 adiw r28, 0x2a ; 42 1a8f6: 2c af std Y+60, r18 ; 0x3c 1a8f8: 3d af std Y+61, r19 ; 0x3d 1a8fa: 4e af std Y+62, r20 ; 0x3e 1a8fc: 5f af std Y+63, r21 ; 0x3f 1a8fe: aa 97 sbiw r28, 0x2a ; 42 1a900: 20 93 c5 12 sts 0x12C5, r18 ; 0x8012c5 1a904: 30 93 c6 12 sts 0x12C6, r19 ; 0x8012c6 1a908: 40 93 c7 12 sts 0x12C7, r20 ; 0x8012c7 1a90c: 50 93 c8 12 sts 0x12C8, r21 ; 0x8012c8 vec_y[1] = cos(a1) * MACHINE_AXIS_SCALE_Y; 1a910: a2 96 adiw r28, 0x22 ; 34 1a912: 8c ad ldd r24, Y+60 ; 0x3c 1a914: 9d ad ldd r25, Y+61 ; 0x3d 1a916: ae ad ldd r26, Y+62 ; 0x3e 1a918: bf ad ldd r27, Y+63 ; 0x3f 1a91a: a2 97 sbiw r28, 0x22 ; 34 1a91c: 80 93 c9 12 sts 0x12C9, r24 ; 0x8012c9 1a920: 90 93 ca 12 sts 0x12CA, r25 ; 0x8012ca 1a924: a0 93 cb 12 sts 0x12CB, r26 ; 0x8012cb 1a928: b0 93 cc 12 sts 0x12CC, r27 ; 0x8012cc // Refresh the offset. cntr[0] = 0.f; 1a92c: 10 92 cd 12 sts 0x12CD, r1 ; 0x8012cd 1a930: 10 92 ce 12 sts 0x12CE, r1 ; 0x8012ce 1a934: 10 92 cf 12 sts 0x12CF, r1 ; 0x8012cf 1a938: 10 92 d0 12 sts 0x12D0, r1 ; 0x8012d0 cntr[1] = 0.f; 1a93c: 10 92 d1 12 sts 0x12D1, r1 ; 0x8012d1 1a940: 10 92 d2 12 sts 0x12D2, r1 ; 0x8012d2 1a944: 10 92 d3 12 sts 0x12D3, r1 ; 0x8012d3 1a948: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 float wx = 0.f; 1a94c: 41 2c mov r4, r1 1a94e: 51 2c mov r5, r1 1a950: 32 01 movw r6, r4 float wy = 0.f; for (int8_t i = 0; i < npts; ++ i) { float x = vec_x[0] * measured_pts[i * 2] + vec_y[0] * measured_pts[i * 2 + 1]; 1a952: cf 56 subi r28, 0x6F ; 111 1a954: df 4f sbci r29, 0xFF ; 255 1a956: a8 81 ld r26, Y 1a958: b9 81 ldd r27, Y+1 ; 0x01 1a95a: c1 59 subi r28, 0x91 ; 145 1a95c: d0 40 sbci r29, 0x00 ; 0 1a95e: 11 96 adiw r26, 0x01 ; 1 1a960: 8d 90 ld r8, X+ 1a962: 9d 90 ld r9, X+ 1a964: ad 90 ld r10, X+ 1a966: bc 90 ld r11, X 1a968: 14 97 sbiw r26, 0x04 ; 4 1a96a: 15 96 adiw r26, 0x05 ; 5 1a96c: 2d 91 ld r18, X+ 1a96e: 3d 91 ld r19, X+ 1a970: 4d 91 ld r20, X+ 1a972: 5c 91 ld r21, X 1a974: 18 97 sbiw r26, 0x08 ; 8 1a976: 6e 96 adiw r28, 0x1e ; 30 1a978: 2c af std Y+60, r18 ; 0x3c 1a97a: 3d af std Y+61, r19 ; 0x3d 1a97c: 4e af std Y+62, r20 ; 0x3e 1a97e: 5f af std Y+63, r21 ; 0x3f 1a980: 6e 97 sbiw r28, 0x1e ; 30 float y = vec_x[1] * measured_pts[i * 2] + vec_y[1] * measured_pts[i * 2 + 1]; float w = point_weight_x(i, y); cntr[0] += w * (pgm_read_float(true_pts + i * 2) - x); 1a982: cd 56 subi r28, 0x6D ; 109 1a984: df 4f sbci r29, 0xFF ; 255 1a986: e8 81 ld r30, Y 1a988: f9 81 ldd r31, Y+1 ; 0x01 1a98a: c3 59 subi r28, 0x93 ; 147 1a98c: d0 40 sbci r29, 0x00 ; 0 1a98e: c5 90 lpm r12, Z+ 1a990: d5 90 lpm r13, Z+ 1a992: e5 90 lpm r14, Z+ 1a994: f4 90 lpm r15, Z cntr[0] = 0.f; cntr[1] = 0.f; float wx = 0.f; float wy = 0.f; for (int8_t i = 0; i < npts; ++ i) { float x = vec_x[0] * measured_pts[i * 2] + vec_y[0] * measured_pts[i * 2 + 1]; 1a996: a5 01 movw r20, r10 1a998: 94 01 movw r18, r8 1a99a: a2 96 adiw r28, 0x22 ; 34 1a99c: 6c ad ldd r22, Y+60 ; 0x3c 1a99e: 7d ad ldd r23, Y+61 ; 0x3d 1a9a0: 8e ad ldd r24, Y+62 ; 0x3e 1a9a2: 9f ad ldd r25, Y+63 ; 0x3f 1a9a4: a2 97 sbiw r28, 0x22 ; 34 1a9a6: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1a9aa: ae 96 adiw r28, 0x2e ; 46 1a9ac: 6c af std Y+60, r22 ; 0x3c 1a9ae: 7d af std Y+61, r23 ; 0x3d 1a9b0: 8e af std Y+62, r24 ; 0x3e 1a9b2: 9f af std Y+63, r25 ; 0x3f 1a9b4: ae 97 sbiw r28, 0x2e ; 46 1a9b6: 6e 96 adiw r28, 0x1e ; 30 1a9b8: 2c ad ldd r18, Y+60 ; 0x3c 1a9ba: 3d ad ldd r19, Y+61 ; 0x3d 1a9bc: 4e ad ldd r20, Y+62 ; 0x3e 1a9be: 5f ad ldd r21, Y+63 ; 0x3f 1a9c0: 6e 97 sbiw r28, 0x1e ; 30 1a9c2: aa 96 adiw r28, 0x2a ; 42 1a9c4: 6c ad ldd r22, Y+60 ; 0x3c 1a9c6: 7d ad ldd r23, Y+61 ; 0x3d 1a9c8: 8e ad ldd r24, Y+62 ; 0x3e 1a9ca: 9f ad ldd r25, Y+63 ; 0x3f 1a9cc: aa 97 sbiw r28, 0x2a ; 42 1a9ce: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1a9d2: 9b 01 movw r18, r22 1a9d4: ac 01 movw r20, r24 1a9d6: ae 96 adiw r28, 0x2e ; 46 1a9d8: 6c ad ldd r22, Y+60 ; 0x3c 1a9da: 7d ad ldd r23, Y+61 ; 0x3d 1a9dc: 8e ad ldd r24, Y+62 ; 0x3e 1a9de: 9f ad ldd r25, Y+63 ; 0x3f 1a9e0: ae 97 sbiw r28, 0x2e ; 46 1a9e2: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1a9e6: 9b 01 movw r18, r22 1a9e8: ac 01 movw r20, r24 float y = vec_x[1] * measured_pts[i * 2] + vec_y[1] * measured_pts[i * 2 + 1]; float w = point_weight_x(i, y); cntr[0] += w * (pgm_read_float(true_pts + i * 2) - x); 1a9ea: c7 01 movw r24, r14 1a9ec: b6 01 movw r22, r12 1a9ee: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1a9f2: 20 91 cd 12 lds r18, 0x12CD ; 0x8012cd 1a9f6: 30 91 ce 12 lds r19, 0x12CE ; 0x8012ce 1a9fa: 40 91 cf 12 lds r20, 0x12CF ; 0x8012cf 1a9fe: 50 91 d0 12 lds r21, 0x12D0 ; 0x8012d0 1aa02: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1aa06: 6b 01 movw r12, r22 1aa08: 7c 01 movw r14, r24 1aa0a: c0 92 cd 12 sts 0x12CD, r12 ; 0x8012cd 1aa0e: d0 92 ce 12 sts 0x12CE, r13 ; 0x8012ce 1aa12: e0 92 cf 12 sts 0x12CF, r14 ; 0x8012cf 1aa16: f0 92 d0 12 sts 0x12D0, r15 ; 0x8012d0 wx += w; 1aa1a: 20 e0 ldi r18, 0x00 ; 0 1aa1c: 30 e0 ldi r19, 0x00 ; 0 1aa1e: 40 e8 ldi r20, 0x80 ; 128 1aa20: 5f e3 ldi r21, 0x3F ; 63 1aa22: c3 01 movw r24, r6 1aa24: b2 01 movw r22, r4 1aa26: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1aa2a: 2b 01 movw r4, r22 1aa2c: 3c 01 movw r6, r24 SERIAL_ECHOLNPGM("wx:"); MYSERIAL.print(wx); } #endif // SUPPORT_VERBOSITY w = point_weight_y(i, y); cntr[1] += w * (pgm_read_float(true_pts + i * 2 + 1) - y); 1aa2e: cd 56 subi r28, 0x6D ; 109 1aa30: df 4f sbci r29, 0xFF ; 255 1aa32: e8 81 ld r30, Y 1aa34: f9 81 ldd r31, Y+1 ; 0x01 1aa36: c3 59 subi r28, 0x93 ; 147 1aa38: d0 40 sbci r29, 0x00 ; 0 1aa3a: 34 96 adiw r30, 0x04 ; 4 1aa3c: 25 91 lpm r18, Z+ 1aa3e: 35 91 lpm r19, Z+ 1aa40: 45 91 lpm r20, Z+ 1aa42: 54 91 lpm r21, Z 1aa44: ae 96 adiw r28, 0x2e ; 46 1aa46: 2c af std Y+60, r18 ; 0x3c 1aa48: 3d af std Y+61, r19 ; 0x3d 1aa4a: 4e af std Y+62, r20 ; 0x3e 1aa4c: 5f af std Y+63, r21 ; 0x3f 1aa4e: ae 97 sbiw r28, 0x2e ; 46 cntr[1] = 0.f; float wx = 0.f; float wy = 0.f; for (int8_t i = 0; i < npts; ++ i) { float x = vec_x[0] * measured_pts[i * 2] + vec_y[0] * measured_pts[i * 2 + 1]; float y = vec_x[1] * measured_pts[i * 2] + vec_y[1] * measured_pts[i * 2 + 1]; 1aa50: a5 01 movw r20, r10 1aa52: 94 01 movw r18, r8 1aa54: a6 96 adiw r28, 0x26 ; 38 1aa56: 6c ad ldd r22, Y+60 ; 0x3c 1aa58: 7d ad ldd r23, Y+61 ; 0x3d 1aa5a: 8e ad ldd r24, Y+62 ; 0x3e 1aa5c: 9f ad ldd r25, Y+63 ; 0x3f 1aa5e: a6 97 sbiw r28, 0x26 ; 38 1aa60: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1aa64: 4b 01 movw r8, r22 1aa66: 5c 01 movw r10, r24 1aa68: 6e 96 adiw r28, 0x1e ; 30 1aa6a: 2c ad ldd r18, Y+60 ; 0x3c 1aa6c: 3d ad ldd r19, Y+61 ; 0x3d 1aa6e: 4e ad ldd r20, Y+62 ; 0x3e 1aa70: 5f ad ldd r21, Y+63 ; 0x3f 1aa72: 6e 97 sbiw r28, 0x1e ; 30 1aa74: a2 96 adiw r28, 0x22 ; 34 1aa76: 6c ad ldd r22, Y+60 ; 0x3c 1aa78: 7d ad ldd r23, Y+61 ; 0x3d 1aa7a: 8e ad ldd r24, Y+62 ; 0x3e 1aa7c: 9f ad ldd r25, Y+63 ; 0x3f 1aa7e: a2 97 sbiw r28, 0x22 ; 34 1aa80: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1aa84: 9b 01 movw r18, r22 1aa86: ac 01 movw r20, r24 1aa88: c5 01 movw r24, r10 1aa8a: b4 01 movw r22, r8 1aa8c: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1aa90: 9b 01 movw r18, r22 1aa92: ac 01 movw r20, r24 SERIAL_ECHOLNPGM("wx:"); MYSERIAL.print(wx); } #endif // SUPPORT_VERBOSITY w = point_weight_y(i, y); cntr[1] += w * (pgm_read_float(true_pts + i * 2 + 1) - y); 1aa94: ae 96 adiw r28, 0x2e ; 46 1aa96: 6c ad ldd r22, Y+60 ; 0x3c 1aa98: 7d ad ldd r23, Y+61 ; 0x3d 1aa9a: 8e ad ldd r24, Y+62 ; 0x3e 1aa9c: 9f ad ldd r25, Y+63 ; 0x3f 1aa9e: ae 97 sbiw r28, 0x2e ; 46 1aaa0: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1aaa4: 20 91 d1 12 lds r18, 0x12D1 ; 0x8012d1 1aaa8: 30 91 d2 12 lds r19, 0x12D2 ; 0x8012d2 1aaac: 40 91 d3 12 lds r20, 0x12D3 ; 0x8012d3 1aab0: 50 91 d4 12 lds r21, 0x12D4 ; 0x8012d4 1aab4: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1aab8: 4b 01 movw r8, r22 1aaba: 5c 01 movw r10, r24 1aabc: 80 92 d1 12 sts 0x12D1, r8 ; 0x8012d1 1aac0: 90 92 d2 12 sts 0x12D2, r9 ; 0x8012d2 1aac4: a0 92 d3 12 sts 0x12D3, r10 ; 0x8012d3 1aac8: b0 92 d4 12 sts 0x12D4, r11 ; 0x8012d4 1aacc: cf 56 subi r28, 0x6F ; 111 1aace: df 4f sbci r29, 0xFF ; 255 1aad0: 48 81 ld r20, Y 1aad2: 59 81 ldd r21, Y+1 ; 0x01 1aad4: c1 59 subi r28, 0x91 ; 145 1aad6: d0 40 sbci r29, 0x00 ; 0 1aad8: 48 5f subi r20, 0xF8 ; 248 1aada: 5f 4f sbci r21, 0xFF ; 255 1aadc: cf 56 subi r28, 0x6F ; 111 1aade: df 4f sbci r29, 0xFF ; 255 1aae0: 59 83 std Y+1, r21 ; 0x01 1aae2: 48 83 st Y, r20 1aae4: c1 59 subi r28, 0x91 ; 145 1aae6: d0 40 sbci r29, 0x00 ; 0 1aae8: cd 56 subi r28, 0x6D ; 109 1aaea: df 4f sbci r29, 0xFF ; 255 1aaec: 88 81 ld r24, Y 1aaee: 99 81 ldd r25, Y+1 ; 0x01 1aaf0: c3 59 subi r28, 0x93 ; 147 1aaf2: d0 40 sbci r29, 0x00 ; 0 1aaf4: 08 96 adiw r24, 0x08 ; 8 1aaf6: cd 56 subi r28, 0x6D ; 109 1aaf8: df 4f sbci r29, 0xFF ; 255 1aafa: 99 83 std Y+1, r25 ; 0x01 1aafc: 88 83 st Y, r24 1aafe: c3 59 subi r28, 0x93 ; 147 1ab00: d0 40 sbci r29, 0x00 ; 0 // Refresh the offset. cntr[0] = 0.f; cntr[1] = 0.f; float wx = 0.f; float wy = 0.f; for (int8_t i = 0; i < npts; ++ i) { 1ab02: 24 16 cp r2, r20 1ab04: 35 06 cpc r3, r21 1ab06: 09 f0 breq .+2 ; 0x1ab0a 1ab08: 24 cf rjmp .-440 ; 0x1a952 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } cntr[0] /= wx; 1ab0a: a3 01 movw r20, r6 1ab0c: 92 01 movw r18, r4 1ab0e: c7 01 movw r24, r14 1ab10: b6 01 movw r22, r12 1ab12: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1ab16: 60 93 cd 12 sts 0x12CD, r22 ; 0x8012cd 1ab1a: 70 93 ce 12 sts 0x12CE, r23 ; 0x8012ce 1ab1e: 80 93 cf 12 sts 0x12CF, r24 ; 0x8012cf 1ab22: 90 93 d0 12 sts 0x12D0, r25 ; 0x8012d0 cntr[1] /= wy; 1ab26: a3 01 movw r20, r6 1ab28: 92 01 movw r18, r4 1ab2a: c5 01 movw r24, r10 1ab2c: b4 01 movw r22, r8 1ab2e: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1ab32: 60 93 d1 12 sts 0x12D1, r22 ; 0x8012d1 1ab36: 70 93 d2 12 sts 0x12D2, r23 ; 0x8012d2 1ab3a: 80 93 d3 12 sts 0x12D3, r24 ; 0x8012d3 1ab3e: 90 93 d4 12 sts 0x12D4, r25 ; 0x8012d4 #endif // SUPPORT_VERBOSITY } // Invert the transformation matrix made of vec_x, vec_y and cntr. { float d = vec_x[0] * vec_y[1] - vec_x[1] * vec_y[0]; 1ab42: 40 90 bd 12 lds r4, 0x12BD ; 0x8012bd 1ab46: 50 90 be 12 lds r5, 0x12BE ; 0x8012be 1ab4a: 60 90 bf 12 lds r6, 0x12BF ; 0x8012bf 1ab4e: 70 90 c0 12 lds r7, 0x12C0 ; 0x8012c0 1ab52: c0 90 c9 12 lds r12, 0x12C9 ; 0x8012c9 1ab56: d0 90 ca 12 lds r13, 0x12CA ; 0x8012ca 1ab5a: e0 90 cb 12 lds r14, 0x12CB ; 0x8012cb 1ab5e: f0 90 cc 12 lds r15, 0x12CC ; 0x8012cc 1ab62: 20 91 c1 12 lds r18, 0x12C1 ; 0x8012c1 1ab66: 30 91 c2 12 lds r19, 0x12C2 ; 0x8012c2 1ab6a: 40 91 c3 12 lds r20, 0x12C3 ; 0x8012c3 1ab6e: 50 91 c4 12 lds r21, 0x12C4 ; 0x8012c4 1ab72: a2 96 adiw r28, 0x22 ; 34 1ab74: 2c af std Y+60, r18 ; 0x3c 1ab76: 3d af std Y+61, r19 ; 0x3d 1ab78: 4e af std Y+62, r20 ; 0x3e 1ab7a: 5f af std Y+63, r21 ; 0x3f 1ab7c: a2 97 sbiw r28, 0x22 ; 34 1ab7e: 80 91 c5 12 lds r24, 0x12C5 ; 0x8012c5 1ab82: 90 91 c6 12 lds r25, 0x12C6 ; 0x8012c6 1ab86: a0 91 c7 12 lds r26, 0x12C7 ; 0x8012c7 1ab8a: b0 91 c8 12 lds r27, 0x12C8 ; 0x8012c8 1ab8e: a6 96 adiw r28, 0x26 ; 38 1ab90: 8c af std Y+60, r24 ; 0x3c 1ab92: 9d af std Y+61, r25 ; 0x3d 1ab94: ae af std Y+62, r26 ; 0x3e 1ab96: bf af std Y+63, r27 ; 0x3f 1ab98: a6 97 sbiw r28, 0x26 ; 38 1ab9a: a7 01 movw r20, r14 1ab9c: 96 01 movw r18, r12 1ab9e: c3 01 movw r24, r6 1aba0: b2 01 movw r22, r4 1aba2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1aba6: 4b 01 movw r8, r22 1aba8: 5c 01 movw r10, r24 1abaa: a6 96 adiw r28, 0x26 ; 38 1abac: 2c ad ldd r18, Y+60 ; 0x3c 1abae: 3d ad ldd r19, Y+61 ; 0x3d 1abb0: 4e ad ldd r20, Y+62 ; 0x3e 1abb2: 5f ad ldd r21, Y+63 ; 0x3f 1abb4: a6 97 sbiw r28, 0x26 ; 38 1abb6: a2 96 adiw r28, 0x22 ; 34 1abb8: 6c ad ldd r22, Y+60 ; 0x3c 1abba: 7d ad ldd r23, Y+61 ; 0x3d 1abbc: 8e ad ldd r24, Y+62 ; 0x3e 1abbe: 9f ad ldd r25, Y+63 ; 0x3f 1abc0: a2 97 sbiw r28, 0x22 ; 34 1abc2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1abc6: 9b 01 movw r18, r22 1abc8: ac 01 movw r20, r24 1abca: c5 01 movw r24, r10 1abcc: b4 01 movw r22, r8 1abce: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1abd2: 4b 01 movw r8, r22 1abd4: 5c 01 movw r10, r24 float Ainv[2][2] = { { vec_y[1] / d, -vec_y[0] / d }, 1abd6: ac 01 movw r20, r24 1abd8: 9b 01 movw r18, r22 1abda: c7 01 movw r24, r14 1abdc: b6 01 movw r22, r12 1abde: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1abe2: 6b 01 movw r12, r22 1abe4: 7c 01 movw r14, r24 1abe6: a6 96 adiw r28, 0x26 ; 38 1abe8: 6c ad ldd r22, Y+60 ; 0x3c 1abea: 7d ad ldd r23, Y+61 ; 0x3d 1abec: 8e ad ldd r24, Y+62 ; 0x3e 1abee: 9f ad ldd r25, Y+63 ; 0x3f 1abf0: a6 97 sbiw r28, 0x26 ; 38 1abf2: 90 58 subi r25, 0x80 ; 128 1abf4: a5 01 movw r20, r10 1abf6: 94 01 movw r18, r8 1abf8: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1abfc: a6 96 adiw r28, 0x26 ; 38 1abfe: 6c af std Y+60, r22 ; 0x3c 1ac00: 7d af std Y+61, r23 ; 0x3d 1ac02: 8e af std Y+62, r24 ; 0x3e 1ac04: 9f af std Y+63, r25 ; 0x3f 1ac06: a6 97 sbiw r28, 0x26 ; 38 { -vec_x[1] / d, vec_x[0] / d } 1ac08: a2 96 adiw r28, 0x22 ; 34 1ac0a: 6c ad ldd r22, Y+60 ; 0x3c 1ac0c: 7d ad ldd r23, Y+61 ; 0x3d 1ac0e: 8e ad ldd r24, Y+62 ; 0x3e 1ac10: 9f ad ldd r25, Y+63 ; 0x3f 1ac12: a2 97 sbiw r28, 0x22 ; 34 1ac14: 90 58 subi r25, 0x80 ; 128 1ac16: a5 01 movw r20, r10 1ac18: 94 01 movw r18, r8 1ac1a: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1ac1e: aa 96 adiw r28, 0x2a ; 42 1ac20: 6c af std Y+60, r22 ; 0x3c 1ac22: 7d af std Y+61, r23 ; 0x3d 1ac24: 8e af std Y+62, r24 ; 0x3e 1ac26: 9f af std Y+63, r25 ; 0x3f 1ac28: aa 97 sbiw r28, 0x2a ; 42 1ac2a: a5 01 movw r20, r10 1ac2c: 94 01 movw r18, r8 1ac2e: c3 01 movw r24, r6 1ac30: b2 01 movw r22, r4 1ac32: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1ac36: 4b 01 movw r8, r22 1ac38: 5c 01 movw r10, r24 }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], 1ac3a: 40 90 cd 12 lds r4, 0x12CD ; 0x8012cd 1ac3e: 50 90 ce 12 lds r5, 0x12CE ; 0x8012ce 1ac42: 60 90 cf 12 lds r6, 0x12CF ; 0x8012cf 1ac46: 70 90 d0 12 lds r7, 0x12D0 ; 0x8012d0 1ac4a: 20 91 d1 12 lds r18, 0x12D1 ; 0x8012d1 1ac4e: 30 91 d2 12 lds r19, 0x12D2 ; 0x8012d2 1ac52: 40 91 d3 12 lds r20, 0x12D3 ; 0x8012d3 1ac56: 50 91 d4 12 lds r21, 0x12D4 ; 0x8012d4 1ac5a: a2 96 adiw r28, 0x22 ; 34 1ac5c: 2c af std Y+60, r18 ; 0x3c 1ac5e: 3d af std Y+61, r19 ; 0x3d 1ac60: 4e af std Y+62, r20 ; 0x3e 1ac62: 5f af std Y+63, r21 ; 0x3f 1ac64: a2 97 sbiw r28, 0x22 ; 34 -Ainv[1][0] * cntr[0] - Ainv[1][1] * cntr[1] }; vec_x[0] = Ainv[0][0]; 1ac66: c0 92 bd 12 sts 0x12BD, r12 ; 0x8012bd 1ac6a: d0 92 be 12 sts 0x12BE, r13 ; 0x8012be 1ac6e: e0 92 bf 12 sts 0x12BF, r14 ; 0x8012bf 1ac72: f0 92 c0 12 sts 0x12C0, r15 ; 0x8012c0 vec_x[1] = Ainv[1][0]; 1ac76: aa 96 adiw r28, 0x2a ; 42 1ac78: 8c ad ldd r24, Y+60 ; 0x3c 1ac7a: 9d ad ldd r25, Y+61 ; 0x3d 1ac7c: ae ad ldd r26, Y+62 ; 0x3e 1ac7e: bf ad ldd r27, Y+63 ; 0x3f 1ac80: aa 97 sbiw r28, 0x2a ; 42 1ac82: 80 93 c1 12 sts 0x12C1, r24 ; 0x8012c1 1ac86: 90 93 c2 12 sts 0x12C2, r25 ; 0x8012c2 1ac8a: a0 93 c3 12 sts 0x12C3, r26 ; 0x8012c3 1ac8e: b0 93 c4 12 sts 0x12C4, r27 ; 0x8012c4 vec_y[0] = Ainv[0][1]; 1ac92: a6 96 adiw r28, 0x26 ; 38 1ac94: 2c ad ldd r18, Y+60 ; 0x3c 1ac96: 3d ad ldd r19, Y+61 ; 0x3d 1ac98: 4e ad ldd r20, Y+62 ; 0x3e 1ac9a: 5f ad ldd r21, Y+63 ; 0x3f 1ac9c: a6 97 sbiw r28, 0x26 ; 38 1ac9e: 20 93 c5 12 sts 0x12C5, r18 ; 0x8012c5 1aca2: 30 93 c6 12 sts 0x12C6, r19 ; 0x8012c6 1aca6: 40 93 c7 12 sts 0x12C7, r20 ; 0x8012c7 1acaa: 50 93 c8 12 sts 0x12C8, r21 ; 0x8012c8 vec_y[1] = Ainv[1][1]; 1acae: 80 92 c9 12 sts 0x12C9, r8 ; 0x8012c9 1acb2: 90 92 ca 12 sts 0x12CA, r9 ; 0x8012ca 1acb6: a0 92 cb 12 sts 0x12CB, r10 ; 0x8012cb 1acba: b0 92 cc 12 sts 0x12CC, r11 ; 0x8012cc float Ainv[2][2] = { { vec_y[1] / d, -vec_y[0] / d }, { -vec_x[1] / d, vec_x[0] / d } }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], 1acbe: c7 01 movw r24, r14 1acc0: b6 01 movw r22, r12 1acc2: 90 58 subi r25, 0x80 ; 128 1acc4: a3 01 movw r20, r6 1acc6: 92 01 movw r18, r4 1acc8: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1accc: 6b 01 movw r12, r22 1acce: 7c 01 movw r14, r24 1acd0: a2 96 adiw r28, 0x22 ; 34 1acd2: 2c ad ldd r18, Y+60 ; 0x3c 1acd4: 3d ad ldd r19, Y+61 ; 0x3d 1acd6: 4e ad ldd r20, Y+62 ; 0x3e 1acd8: 5f ad ldd r21, Y+63 ; 0x3f 1acda: a2 97 sbiw r28, 0x22 ; 34 1acdc: a6 96 adiw r28, 0x26 ; 38 1acde: 6c ad ldd r22, Y+60 ; 0x3c 1ace0: 7d ad ldd r23, Y+61 ; 0x3d 1ace2: 8e ad ldd r24, Y+62 ; 0x3e 1ace4: 9f ad ldd r25, Y+63 ; 0x3f 1ace6: a6 97 sbiw r28, 0x26 ; 38 1ace8: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1acec: 9b 01 movw r18, r22 1acee: ac 01 movw r20, r24 1acf0: c7 01 movw r24, r14 1acf2: b6 01 movw r22, r12 1acf4: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> }; vec_x[0] = Ainv[0][0]; vec_x[1] = Ainv[1][0]; vec_y[0] = Ainv[0][1]; vec_y[1] = Ainv[1][1]; cntr[0] = cntrInv[0]; 1acf8: 60 93 cd 12 sts 0x12CD, r22 ; 0x8012cd 1acfc: 70 93 ce 12 sts 0x12CE, r23 ; 0x8012ce 1ad00: 80 93 cf 12 sts 0x12CF, r24 ; 0x8012cf 1ad04: 90 93 d0 12 sts 0x12D0, r25 ; 0x8012d0 { vec_y[1] / d, -vec_y[0] / d }, { -vec_x[1] / d, vec_x[0] / d } }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], -Ainv[1][0] * cntr[0] - Ainv[1][1] * cntr[1] 1ad08: aa 96 adiw r28, 0x2a ; 42 1ad0a: 6c ad ldd r22, Y+60 ; 0x3c 1ad0c: 7d ad ldd r23, Y+61 ; 0x3d 1ad0e: 8e ad ldd r24, Y+62 ; 0x3e 1ad10: 9f ad ldd r25, Y+63 ; 0x3f 1ad12: aa 97 sbiw r28, 0x2a ; 42 1ad14: 90 58 subi r25, 0x80 ; 128 1ad16: a3 01 movw r20, r6 1ad18: 92 01 movw r18, r4 1ad1a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1ad1e: 6b 01 movw r12, r22 1ad20: 7c 01 movw r14, r24 1ad22: a2 96 adiw r28, 0x22 ; 34 1ad24: 2c ad ldd r18, Y+60 ; 0x3c 1ad26: 3d ad ldd r19, Y+61 ; 0x3d 1ad28: 4e ad ldd r20, Y+62 ; 0x3e 1ad2a: 5f ad ldd r21, Y+63 ; 0x3f 1ad2c: a2 97 sbiw r28, 0x22 ; 34 1ad2e: c5 01 movw r24, r10 1ad30: b4 01 movw r22, r8 1ad32: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1ad36: 9b 01 movw r18, r22 1ad38: ac 01 movw r20, r24 1ad3a: c7 01 movw r24, r14 1ad3c: b6 01 movw r22, r12 1ad3e: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> vec_x[0] = Ainv[0][0]; vec_x[1] = Ainv[1][0]; vec_y[0] = Ainv[0][1]; vec_y[1] = Ainv[1][1]; cntr[0] = cntrInv[0]; cntr[1] = cntrInv[1]; 1ad42: 60 93 d1 12 sts 0x12D1, r22 ; 0x8012d1 1ad46: 70 93 d2 12 sts 0x12D2, r23 ; 0x8012d2 1ad4a: 80 93 d3 12 sts 0x12D3, r24 ; 0x8012d3 1ad4e: 90 93 d4 12 sts 0x12D4, r25 ; 0x8012d4 MYSERIAL.print(pts[1]); SERIAL_ECHOPGM(" < "); MYSERIAL.println(Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); } result = calculate_machine_skew_and_offset_LS(pts, 4, bed_ref_points_4, vec_x, vec_y, cntr, verbosity_level); delay_keep_alive(0); //manage_heater, reset watchdog, manage inactivity 1ad52: 90 e0 ldi r25, 0x00 ; 0 1ad54: 80 e0 ldi r24, 0x00 ; 0 1ad56: 0e 94 48 7c call 0xf890 ; 0xf890 if (result >= 0) { 1ad5a: 17 fd sbrc r17, 7 1ad5c: d5 c0 rjmp .+426 ; 0x1af08 DBG(_n("Calibration success.\n")); 1ad5e: 8b e7 ldi r24, 0x7B ; 123 1ad60: 99 e6 ldi r25, 0x69 ; 105 1ad62: 9f 93 push r25 1ad64: 8f 93 push r24 1ad66: 0f 94 9e 9e call 0x33d3c ; 0x33d3c world2machine_update(vec_x, vec_y, cntr); 1ad6a: 4d ec ldi r20, 0xCD ; 205 1ad6c: 52 e1 ldi r21, 0x12 ; 18 1ad6e: 65 ec ldi r22, 0xC5 ; 197 1ad70: 72 e1 ldi r23, 0x12 ; 18 1ad72: 8d eb ldi r24, 0xBD ; 189 1ad74: 92 e1 ldi r25, 0x12 ; 18 1ad76: 0f 94 da 8d call 0x31bb4 ; 0x31bb4 #endif //DEBUG_EEPROM_CHANGES } #ifndef DEBUG_EEPROM_CHANGES void eeprom_update_block_notify(const void *__src, void *__dst, size_t __n){ eeprom_update_block(__src, __dst, __n); 1ad7a: 48 e0 ldi r20, 0x08 ; 8 1ad7c: 50 e0 ldi r21, 0x00 ; 0 1ad7e: 65 ee ldi r22, 0xE5 ; 229 1ad80: 7f e0 ldi r23, 0x0F ; 15 1ad82: 8d ec ldi r24, 0xCD ; 205 1ad84: 92 e1 ldi r25, 0x12 ; 18 1ad86: 0f 94 f0 9f call 0x33fe0 ; 0x33fe0 1ad8a: 48 e0 ldi r20, 0x08 ; 8 1ad8c: 50 e0 ldi r21, 0x00 ; 0 1ad8e: 6d ed ldi r22, 0xDD ; 221 1ad90: 7f e0 ldi r23, 0x0F ; 15 1ad92: 8d eb ldi r24, 0xBD ; 189 1ad94: 92 e1 ldi r25, 0x12 ; 18 1ad96: 0f 94 f0 9f call 0x33fe0 ; 0x33fe0 1ad9a: 48 e0 ldi r20, 0x08 ; 8 1ad9c: 50 e0 ldi r21, 0x00 ; 0 1ad9e: 65 ed ldi r22, 0xD5 ; 213 1ada0: 7f e0 ldi r23, 0x0F ; 15 1ada2: 85 ec ldi r24, 0xC5 ; 197 1ada4: 92 e1 ldi r25, 0x12 ; 18 1ada6: 0f 94 f0 9f call 0x33fe0 ; 0x33fe0 MYSERIAL.println(fabs(l)); SERIAL_ECHOLNPGM("Saving bed calibration vectors to EEPROM"); } #endif // SUPPORT_VERBOSITY // Correct the current_position to match the transformed coordinate system after world2machine_rotation_and_skew and world2machine_shift were set. world2machine_update_current(); 1adaa: 0f 94 5f 8d call 0x31abe ; 0x31abe } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ DBG(_n("Fitting failed => calibration failed.\n")); 1adae: 0f 90 pop r0 1adb0: 0f 90 pop r0 BedSkewOffsetDetectionResultType result = find_bed_offset_and_skew(verbosity_level, point_too_far_mask); clean_up_after_endstop_move(l_feedmultiply); 1adb2: c7 55 subi r28, 0x57 ; 87 1adb4: df 4f sbci r29, 0xFF ; 255 1adb6: 88 81 ld r24, Y 1adb8: 99 81 ldd r25, Y+1 ; 0x01 1adba: c9 5a subi r28, 0xA9 ; 169 1adbc: d0 40 sbci r29, 0x00 ; 0 1adbe: 0e 94 d4 5f call 0xbfa8 ; 0xbfa8 // Print head up. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1adc2: 80 e0 ldi r24, 0x00 ; 0 1adc4: 90 e0 ldi r25, 0x00 ; 0 1adc6: a0 ea ldi r26, 0xA0 ; 160 1adc8: b0 e4 ldi r27, 0x40 ; 64 1adca: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 1adce: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 1add2: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 1add6: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 1adda: 60 e0 ldi r22, 0x00 ; 0 1addc: 70 e0 ldi r23, 0x00 ; 0 1adde: 80 ea ldi r24, 0xA0 ; 160 1ade0: 91 e4 ldi r25, 0x41 ; 65 1ade2: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 1ade6: 0f 94 42 22 call 0x24484 ; 0x24484 //#ifndef NEW_XYZCAL if (result >= 0) 1adea: 17 fd sbrc r17, 7 1adec: 22 c0 rjmp .+68 ; 0x1ae32 bool sample_z() { bool sampled = true; // make some space for the sheet // Avoid calling raise_z(), because a false triggering stallguard may prevent the Z from moving. // The extruder then may ram the sheet hard if not going down from some ~150mm height current_position[Z_AXIS] = 0.F; 1adee: 10 92 fd 11 sts 0x11FD, r1 ; 0x8011fd 1adf2: 10 92 fe 11 sts 0x11FE, r1 ; 0x8011fe 1adf6: 10 92 ff 11 sts 0x11FF, r1 ; 0x8011ff 1adfa: 10 92 00 12 sts 0x1200, r1 ; 0x801200 destination[Z_AXIS] = 150.F; 1adfe: 80 e0 ldi r24, 0x00 ; 0 1ae00: 90 e0 ldi r25, 0x00 ; 0 1ae02: a6 e1 ldi r26, 0x16 ; 22 1ae04: b3 e4 ldi r27, 0x43 ; 67 1ae06: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b 1ae0a: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c 1ae0e: a0 93 9d 06 sts 0x069D, r26 ; 0x80069d 1ae12: b0 93 9e 06 sts 0x069E, r27 ; 0x80069e plan_buffer_line_destinationXYZE(homing_feedrate[Z_AXIS] / 60); 1ae16: 65 e5 ldi r22, 0x55 ; 85 1ae18: 75 e5 ldi r23, 0x55 ; 85 1ae1a: 85 e5 ldi r24, 0x55 ; 85 1ae1c: 91 e4 ldi r25, 0x41 ; 65 1ae1e: 0f 94 3d 84 call 0x3087a ; 0x3087a lcd_show_fullscreen_message_and_wait_P(_T(MSG_PLACE_STEEL_SHEET)); 1ae22: 82 e5 ldi r24, 0x52 ; 82 1ae24: 96 e4 ldi r25, 0x46 ; 70 1ae26: 0e 94 b1 6c call 0xd962 ; 0xd962 1ae2a: 0f 94 47 0b call 0x2168e ; 0x2168e // Sample Z heights for the mesh bed leveling. // In addition, store the results into an eeprom, to be used later for verification of the bed leveling process. if (!sample_mesh_and_store_reference()) 1ae2e: 0f 94 78 8b call 0x316f0 ; 0x316f0 st_synchronize(); // if (result >= 0) babystep_apply(); #endif //HEATBED_V2 } //#endif //NEW_XYZCAL lcd_update_enable(true); 1ae32: 81 e0 ldi r24, 0x01 ; 1 1ae34: 0e 94 c0 69 call 0xd380 ; 0xd380 lcd_update(2); 1ae38: 82 e0 ldi r24, 0x02 ; 2 1ae3a: 0e 94 42 69 call 0xd284 ; 0xd284 void lcd_bed_calibration_show_result(BedSkewOffsetDetectionResultType result, uint8_t point_too_far_mask) { const char *msg = NULL; if (result == BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND) { lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND)); 1ae3e: 83 e1 ldi r24, 0x13 ; 19 1ae40: 96 e4 ldi r25, 0x46 ; 70 } void lcd_bed_calibration_show_result(BedSkewOffsetDetectionResultType result, uint8_t point_too_far_mask) { const char *msg = NULL; if (result == BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND) { 1ae42: 1f 3f cpi r17, 0xFF ; 255 1ae44: 99 f0 breq .+38 ; 0x1ae6c lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND)); } else if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED) { 1ae46: 1e 3f cpi r17, 0xFE ; 254 1ae48: 09 f0 breq .+2 ; 0x1ae4c 1ae4a: 73 c0 rjmp .+230 ; 0x1af32 if (point_too_far_mask == 0) 1ae4c: af 96 adiw r28, 0x2f ; 47 1ae4e: 4f ad ldd r20, Y+63 ; 0x3f 1ae50: af 97 sbiw r28, 0x2f ; 47 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 1ae52: 8e ed ldi r24, 0xDE ; 222 1ae54: 95 e4 ldi r25, 0x45 ; 69 { const char *msg = NULL; if (result == BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND) { lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND)); } else if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED) { if (point_too_far_mask == 0) 1ae56: 44 23 and r20, r20 1ae58: 49 f0 breq .+18 ; 0x1ae6c msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); else if (point_too_far_mask == 2 || point_too_far_mask == 7) 1ae5a: af 96 adiw r28, 0x2f ; 47 1ae5c: 5f ad ldd r21, Y+63 ; 0x3f 1ae5e: af 97 sbiw r28, 0x2f ; 47 // Only the center point or all the three front points. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_BOTH_FAR); 1ae60: 8c e9 ldi r24, 0x9C ; 156 1ae62: 95 e4 ldi r25, 0x45 ; 69 if (result == BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND) { lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND)); } else if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED) { if (point_too_far_mask == 0) msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); else if (point_too_far_mask == 2 || point_too_far_mask == 7) 1ae64: 52 30 cpi r21, 0x02 ; 2 1ae66: 11 f0 breq .+4 ; 0x1ae6c // Only the center point or all the three front points. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_BOTH_FAR); else if ((point_too_far_mask & 1) == 0) // The right and maybe the center point out of reach. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_RIGHT_FAR); 1ae68: 85 e5 ldi r24, 0x55 ; 85 1ae6a: 95 e4 ldi r25, 0x45 ; 69 1ae6c: 0e 94 b1 6c call 0xd962 ; 0xd962 1ae70: 0c 94 18 ca jmp 0x19430 ; 0x19430 (r == 0) ? 1.f : ((r == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : ((c == 2) ? (-s1 * measured_pts[2 * i]) : 1ae74: f2 01 movw r30, r4 1ae76: 25 81 ldd r18, Z+5 ; 0x05 1ae78: 36 81 ldd r19, Z+6 ; 0x06 1ae7a: 47 81 ldd r20, Z+7 ; 0x07 1ae7c: 50 85 ldd r21, Z+8 ; 0x08 1ae7e: c3 58 subi r28, 0x83 ; 131 1ae80: df 4f sbci r29, 0xFF ; 255 1ae82: 68 81 ld r22, Y 1ae84: 79 81 ldd r23, Y+1 ; 0x01 1ae86: 8a 81 ldd r24, Y+2 ; 0x02 1ae88: 9b 81 ldd r25, Y+3 ; 0x03 1ae8a: cd 57 subi r28, 0x7D ; 125 1ae8c: d0 40 sbci r29, 0x00 ; 0 1ae8e: 0c 94 74 ce jmp 0x19ce8 ; 0x19ce8 // The first row of the points have a low weight, because their position may not be known // with a sufficient accuracy. if (r != 0 && c != 0) { float a = (r == 1) ? 1.f : ((r == 2) ? ( c1 * measured_pts[2 * i]) : 1ae92: f2 01 movw r30, r4 1ae94: 25 81 ldd r18, Z+5 ; 0x05 1ae96: 36 81 ldd r19, Z+6 ; 0x06 1ae98: 47 81 ldd r20, Z+7 ; 0x07 1ae9a: 50 85 ldd r21, Z+8 ; 0x08 1ae9c: ed 96 adiw r28, 0x3d ; 61 1ae9e: 6c ad ldd r22, Y+60 ; 0x3c 1aea0: 7d ad ldd r23, Y+61 ; 0x3d 1aea2: 8e ad ldd r24, Y+62 ; 0x3e 1aea4: 9f ad ldd r25, Y+63 ; 0x3f 1aea6: ed 97 sbiw r28, 0x3d ; 61 1aea8: b8 c0 rjmp .+368 ; 0x1b01a (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : ((c == 2) ? ( c1 * measured_pts[2 * i]) : 1aeaa: f2 01 movw r30, r4 1aeac: 25 81 ldd r18, Z+5 ; 0x05 1aeae: 36 81 ldd r19, Z+6 ; 0x06 1aeb0: 47 81 ldd r20, Z+7 ; 0x07 1aeb2: 50 85 ldd r21, Z+8 ; 0x08 1aeb4: ed 96 adiw r28, 0x3d ; 61 1aeb6: 6c ad ldd r22, Y+60 ; 0x3c 1aeb8: 7d ad ldd r23, Y+61 ; 0x3d 1aeba: 8e ad ldd r24, Y+62 ; 0x3e 1aebc: 9f ad ldd r25, Y+63 ; 0x3f 1aebe: ed 97 sbiw r28, 0x3d ; 61 1aec0: c6 c0 rjmp .+396 ; 0x1b04e for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : ((r == 1) ? 0.f : ((r == 2) ? (-s1 * measured_pts[2 * i]) : 1aec2: a3 01 movw r20, r6 1aec4: 92 01 movw r18, r4 1aec6: c3 58 subi r28, 0x83 ; 131 1aec8: df 4f sbci r29, 0xFF ; 255 1aeca: 68 81 ld r22, Y 1aecc: 79 81 ldd r23, Y+1 ; 0x01 1aece: 8a 81 ldd r24, Y+2 ; 0x02 1aed0: 9b 81 ldd r25, Y+3 ; 0x03 1aed2: cd 57 subi r28, 0x7D ; 125 1aed4: d0 40 sbci r29, 0x00 ; 0 1aed6: 0c 94 dc ce jmp 0x19db8 ; 0x19db8 // J^T times f(x) acc = 0.f; for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 1aeda: 81 2c mov r8, r1 1aedc: 91 2c mov r9, r1 1aede: 20 e8 ldi r18, 0x80 ; 128 1aee0: a2 2e mov r10, r18 1aee2: 2f e3 ldi r18, 0x3F ; 63 1aee4: b2 2e mov r11, r18 1aee6: 0c 94 e0 ce jmp 0x19dc0 ; 0x19dc0 float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; } { float j = (r == 0) ? 0.f : 1aeea: c1 2c mov r12, r1 1aeec: d1 2c mov r13, r1 1aeee: 76 01 movw r14, r12 1aef0: 0c 94 57 cf jmp 0x19eae ; 0x19eae ((r == 1) ? 1.f : 1aef4: c1 2c mov r12, r1 1aef6: d1 2c mov r13, r1 1aef8: 90 e8 ldi r25, 0x80 ; 128 1aefa: e9 2e mov r14, r25 1aefc: 9f e3 ldi r25, 0x3F ; 63 1aefe: f9 2e mov r15, r25 1af00: 0c 94 57 cf jmp 0x19eae ; 0x19eae result = (angleDiff > bed_skew_angle_extreme) ? BED_SKEW_OFFSET_DETECTION_SKEW_EXTREME : BED_SKEW_OFFSET_DETECTION_SKEW_MILD; if (fabs(a1) > bed_skew_angle_extreme || fabs(a2) > bed_skew_angle_extreme) result = BED_SKEW_OFFSET_DETECTION_SKEW_EXTREME; 1af04: 12 e0 ldi r17, 0x02 ; 2 1af06: a7 cb rjmp .-2226 ; 0x1a656 } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 1af08: 1e 3f cpi r17, 0xFE ; 254 1af0a: 89 f4 brne .+34 ; 0x1af2e 1af0c: af 96 adiw r28, 0x2f ; 47 1af0e: 3f ad ldd r19, Y+63 ; 0x3f 1af10: af 97 sbiw r28, 0x2f ; 47 1af12: 32 30 cpi r19, 0x02 ; 2 1af14: 09 f0 breq .+2 ; 0x1af18 1af16: 4d cf rjmp .-358 ; 0x1adb2 DBG(_n("Fitting failed => calibration failed.\n")); 1af18: 84 e5 ldi r24, 0x54 ; 84 1af1a: 99 e6 ldi r25, 0x69 ; 105 1af1c: 9f 93 push r25 1af1e: 8f 93 push r24 1af20: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 1af24: 44 cf rjmp .-376 ; 0x1adae // Reset the baby step value and the baby step applied flag. calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); // Complete XYZ calibration. uint8_t point_too_far_mask = 0; 1af26: af 96 adiw r28, 0x2f ; 47 1af28: 1f ae std Y+63, r1 ; 0x3f 1af2a: af 97 sbiw r28, 0x2f ; 47 1af2c: 42 cf rjmp .-380 ; 0x1adb2 } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 1af2e: 1f ef ldi r17, 0xFF ; 255 1af30: 40 cf rjmp .-384 ; 0x1adb2 else // The left and maybe the center point out of reach. //@todo Why isn't it found in the firmware.map msg = _n("XYZ calibration failed. Left front calibration point not reachable.");////MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_LEFT_FAR c=20 r=8 lcd_show_fullscreen_message_and_wait_P(msg); } else { if (point_too_far_mask != 0) { 1af32: af 96 adiw r28, 0x2f ; 47 1af34: 6f ad ldd r22, Y+63 ; 0x3f 1af36: af 97 sbiw r28, 0x2f ; 47 1af38: 61 11 cpse r22, r1 1af3a: 13 c0 rjmp .+38 ; 0x1af62 break; case BED_SKEW_OFFSET_DETECTION_PERFECT: msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_PERFECT); break; case BED_SKEW_OFFSET_DETECTION_SKEW_MILD: msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_SKEW_MILD); 1af3c: 8a e3 ldi r24, 0x3A ; 58 1af3e: 94 e4 ldi r25, 0x44 ; 68 // The left and maybe the center point out of reach. //@todo Why isn't it found in the firmware.map msg = _n("XYZ calibration compromised. Left front calibration point not reachable.");////MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_LEFT_FAR c=20 r=8 lcd_show_fullscreen_message_and_wait_P(msg); } if (point_too_far_mask == 0 || result > 0) { switch (result) { 1af40: 11 30 cpi r17, 0x01 ; 1 1af42: 51 f0 breq .+20 ; 0x1af58 break; case BED_SKEW_OFFSET_DETECTION_SKEW_MILD: msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_SKEW_MILD); break; case BED_SKEW_OFFSET_DETECTION_SKEW_EXTREME: msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_SKEW_EXTREME); 1af44: 87 ef ldi r24, 0xF7 ; 247 1af46: 93 e4 ldi r25, 0x43 ; 67 // The left and maybe the center point out of reach. //@todo Why isn't it found in the firmware.map msg = _n("XYZ calibration compromised. Left front calibration point not reachable.");////MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_LEFT_FAR c=20 r=8 lcd_show_fullscreen_message_and_wait_P(msg); } if (point_too_far_mask == 0 || result > 0) { switch (result) { 1af48: 12 30 cpi r17, 0x02 ; 2 1af4a: 31 f0 breq .+12 ; 0x1af58 default: // should not happen msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 1af4c: 8e ed ldi r24, 0xDE ; 222 1af4e: 95 e4 ldi r25, 0x45 ; 69 // The left and maybe the center point out of reach. //@todo Why isn't it found in the firmware.map msg = _n("XYZ calibration compromised. Left front calibration point not reachable.");////MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_LEFT_FAR c=20 r=8 lcd_show_fullscreen_message_and_wait_P(msg); } if (point_too_far_mask == 0 || result > 0) { switch (result) { 1af50: 11 11 cpse r17, r1 1af52: 02 c0 rjmp .+4 ; 0x1af58 default: // should not happen msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); break; case BED_SKEW_OFFSET_DETECTION_PERFECT: msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_PERFECT); 1af54: 8f e7 ldi r24, 0x7F ; 127 1af56: 94 e4 ldi r25, 0x44 ; 68 break; case BED_SKEW_OFFSET_DETECTION_SKEW_MILD: msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_SKEW_MILD); break; case BED_SKEW_OFFSET_DETECTION_SKEW_EXTREME: msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_SKEW_EXTREME); 1af58: 0e 94 b1 6c call 0xd962 ; 0xd962 break; } lcd_show_fullscreen_message_and_wait_P(msg); 1af5c: 0f 94 47 0b call 0x2168e ; 0x2168e 1af60: 0d c0 rjmp .+26 ; 0x1af7c // The left and maybe the center point out of reach. //@todo Why isn't it found in the firmware.map msg = _n("XYZ calibration failed. Left front calibration point not reachable.");////MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_LEFT_FAR c=20 r=8 lcd_show_fullscreen_message_and_wait_P(msg); } else { if (point_too_far_mask != 0) { if (point_too_far_mask == 2 || point_too_far_mask == 7) 1af62: af 96 adiw r28, 0x2f ; 47 1af64: 8f ad ldd r24, Y+63 ; 0x3f 1af66: af 97 sbiw r28, 0x2f ; 47 1af68: 82 30 cpi r24, 0x02 ; 2 1af6a: f1 f4 brne .+60 ; 0x1afa8 // Only the center point or all the three front points. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR); 1af6c: 8e e0 ldi r24, 0x0E ; 14 1af6e: 95 e4 ldi r25, 0x45 ; 69 else if ((point_too_far_mask & 1) == 0) // The right and maybe the center point out of reach. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_RIGHT_FAR); 1af70: 0e 94 b1 6c call 0xd962 ; 0xd962 else // The left and maybe the center point out of reach. //@todo Why isn't it found in the firmware.map msg = _n("XYZ calibration compromised. Left front calibration point not reachable.");////MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_LEFT_FAR c=20 r=8 lcd_show_fullscreen_message_and_wait_P(msg); 1af74: 0f 94 47 0b call 0x2168e ; 0x2168e } if (point_too_far_mask == 0 || result > 0) { 1af78: 11 16 cp r1, r17 1af7a: 04 f3 brlt .-64 ; 0x1af3c //#endif //NEW_XYZCAL lcd_update_enable(true); lcd_update(2); lcd_bed_calibration_show_result(result, point_too_far_mask); if (result >= 0) 1af7c: 1f 3f cpi r17, 0xFF ; 255 1af7e: 11 f4 brne .+4 ; 0x1af84 1af80: 0c 94 26 c7 jmp 0x18e4c ; 0x18e4c { // Calibration valid, the machine should be able to print. Advise the user to run the V2Calibration.gcode. calibration_status_set(CALIBRATION_STATUS_XYZ | CALIBRATION_STATUS_Z); 1af84: 86 e0 ldi r24, 0x06 ; 6 1af86: 0e 94 86 c6 call 0x18d0c ; 0x18d0c if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 1af8a: 8f e5 ldi r24, 0x5F ; 95 1af8c: 9f e0 ldi r25, 0x0F ; 15 1af8e: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1af92: 81 11 cpse r24, r1 1af94: 0c 94 32 ca jmp 0x19464 ; 0x19464 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 1af98: 89 e7 ldi r24, 0x79 ; 121 1af9a: 96 e4 ldi r25, 0x46 ; 70 1af9c: 0e 94 b1 6c call 0xd962 ; 0xd962 1afa0: 0f 94 47 0b call 0x2168e ; 0x2168e 1afa4: 0c 94 32 ca jmp 0x19464 ; 0x19464 if (point_too_far_mask == 2 || point_too_far_mask == 7) // Only the center point or all the three front points. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR); else if ((point_too_far_mask & 1) == 0) // The right and maybe the center point out of reach. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_RIGHT_FAR); 1afa8: 82 ec ldi r24, 0xC2 ; 194 1afaa: 94 e4 ldi r25, 0x44 ; 68 1afac: e1 cf rjmp .-62 ; 0x1af70 if ((ret = xyzcal_spiral2(cx, cy, z0 - 0*dz, dz, radius, 0, delay_us, check_pinda, &ad)) != 0) ad += 0; if (!ret && (ad < 1440)) if ((ret = xyzcal_spiral2(cx, cy, z0 - 1*dz, dz, -radius, 0, delay_us, check_pinda, &ad)) != 0) ad += 720; if (!ret && (ad < 2160)) 1afae: 89 81 ldd r24, Y+1 ; 0x01 1afb0: 9a 81 ldd r25, Y+2 ; 0x02 1afb2: 80 37 cpi r24, 0x70 ; 112 1afb4: 98 40 sbci r25, 0x08 ; 8 1afb6: 10 f0 brcs .+4 ; 0x1afbc 1afb8: 0c 94 6b ca jmp 0x194d6 ; 0x194d6 if ((ret = xyzcal_spiral2(cx, cy, z0 - 2*dz, dz, radius, 180, delay_us, check_pinda, &ad)) != 0) 1afbc: ae 01 movw r20, r28 1afbe: 4f 5f subi r20, 0xFF ; 255 1afc0: 5f 4f sbci r21, 0xFF ; 255 1afc2: 7a 01 movw r14, r20 1afc4: 04 eb ldi r16, 0xB4 ; 180 1afc6: 10 e0 ldi r17, 0x00 ; 0 1afc8: 24 e8 ldi r18, 0x84 ; 132 1afca: 33 e0 ldi r19, 0x03 ; 3 1afcc: a6 01 movw r20, r12 1afce: 48 5c subi r20, 0xC8 ; 200 1afd0: 51 09 sbc r21, r1 1afd2: 69 2d mov r22, r9 1afd4: 78 2d mov r23, r8 1afd6: 8b 2d mov r24, r11 1afd8: 9a 2d mov r25, r10 1afda: 0f 94 cc 5e call 0x2bd98 ; 0x2bd98 1afde: 88 23 and r24, r24 1afe0: 11 f4 brne .+4 ; 0x1afe6 1afe2: 0c 94 6b ca jmp 0x194d6 ; 0x194d6 ad += 1440; 1afe6: 89 81 ldd r24, Y+1 ; 0x01 1afe8: 9a 81 ldd r25, Y+2 ; 0x02 1afea: 80 56 subi r24, 0x60 ; 96 1afec: 9a 4f sbci r25, 0xFA ; 250 1afee: 0c 94 fb c8 jmp 0x191f6 ; 0x191f6 acc += a * b * w; } // Second for the residuum in the y axis. // The first row of the points have a low weight, because their position may not be known // with a sufficient accuracy. if (r != 0 && c != 0) { 1aff2: 00 23 and r16, r16 1aff4: 11 f4 brne .+4 ; 0x1affa 1aff6: 0c 94 87 ce jmp 0x19d0e ; 0x19d0e float a = (r == 1) ? 1.f : ((r == 2) ? ( c1 * measured_pts[2 * i]) : 1affa: 02 30 cpi r16, 0x02 ; 2 1affc: 09 f0 breq .+2 ; 0x1b000 1affe: 49 cf rjmp .-366 ; 0x1ae92 1b000: d2 01 movw r26, r4 1b002: 11 96 adiw r26, 0x01 ; 1 1b004: 2d 91 ld r18, X+ 1b006: 3d 91 ld r19, X+ 1b008: 4d 91 ld r20, X+ 1b00a: 5c 91 ld r21, X 1b00c: 14 97 sbiw r26, 0x04 ; 4 1b00e: 6e 96 adiw r28, 0x1e ; 30 1b010: 6c ad ldd r22, Y+60 ; 0x3c 1b012: 7d ad ldd r23, Y+61 ; 0x3d 1b014: 8e ad ldd r24, Y+62 ; 0x3e 1b016: 9f ad ldd r25, Y+63 ; 0x3f 1b018: 6e 97 sbiw r28, 0x1e ; 30 1b01a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1b01e: 4b 01 movw r8, r22 1b020: 5c 01 movw r10, r24 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : 1b022: 60 e0 ldi r22, 0x00 ; 0 1b024: 70 e0 ldi r23, 0x00 ; 0 1b026: 80 e8 ldi r24, 0x80 ; 128 1b028: 9f e3 ldi r25, 0x3F ; 63 1b02a: 11 30 cpi r17, 0x01 ; 1 1b02c: 91 f0 breq .+36 ; 0x1b052 ((c == 2) ? ( c1 * measured_pts[2 * i]) : 1b02e: 12 30 cpi r17, 0x02 ; 2 1b030: 09 f0 breq .+2 ; 0x1b034 1b032: 3b cf rjmp .-394 ; 0x1aeaa 1b034: d2 01 movw r26, r4 1b036: 11 96 adiw r26, 0x01 ; 1 1b038: 2d 91 ld r18, X+ 1b03a: 3d 91 ld r19, X+ 1b03c: 4d 91 ld r20, X+ 1b03e: 5c 91 ld r21, X 1b040: 14 97 sbiw r26, 0x04 ; 4 1b042: 6e 96 adiw r28, 0x1e ; 30 1b044: 6c ad ldd r22, Y+60 ; 0x3c 1b046: 7d ad ldd r23, Y+61 ; 0x3d 1b048: 8e ad ldd r24, Y+62 ; 0x3e 1b04a: 9f ad ldd r25, Y+63 ; 0x3f 1b04c: 6e 97 sbiw r28, 0x1e ; 30 1b04e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> (-s2 * measured_pts[2 * i + 1])); float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += a * b * w; 1b052: 9b 01 movw r18, r22 1b054: ac 01 movw r20, r24 1b056: c5 01 movw r24, r10 1b058: b4 01 movw r22, r8 1b05a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1b05e: 9b 01 movw r18, r22 1b060: ac 01 movw r20, r24 1b062: c7 01 movw r24, r14 1b064: b6 01 movw r22, r12 1b066: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1b06a: 6b 01 movw r12, r22 1b06c: 7c 01 movw r14, r24 1b06e: 0c 94 87 ce jmp 0x19d0e ; 0x19d0e // J^T times J for (uint8_t i = 0; i < npts; ++i) { // First for the residuum in the x axis: if (r != 1 && c != 1) { float a = (r == 0) ? 1.f : 1b072: 81 2c mov r8, r1 1b074: 91 2c mov r9, r1 1b076: 50 e8 ldi r21, 0x80 ; 128 1b078: a5 2e mov r10, r21 1b07a: 5f e3 ldi r21, 0x3F ; 63 1b07c: b5 2e mov r11, r21 ((r == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 1b07e: 11 11 cpse r17, r1 1b080: 0c 94 61 ce jmp 0x19cc2 ; 0x19cc2 ((c == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1])); float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += a * b * w; 1b084: 20 e0 ldi r18, 0x00 ; 0 1b086: 30 e0 ldi r19, 0x00 ; 0 1b088: 40 e8 ldi r20, 0x80 ; 128 1b08a: 5f e3 ldi r21, 0x3F ; 63 1b08c: ea cf rjmp .-44 ; 0x1b062 } // Second for the residuum in the y axis. // The first row of the points have a low weight, because their position may not be known // with a sufficient accuracy. if (r != 0 && c != 0) { 1b08e: 11 11 cpse r17, r1 1b090: b4 cf rjmp .-152 ; 0x1affa 1b092: 0c 94 87 ce jmp 0x19d0e ; 0x19d0e float a = (r == 1) ? 1.f : 1b096: 81 2c mov r8, r1 1b098: 91 2c mov r9, r1 1b09a: 40 e8 ldi r20, 0x80 ; 128 1b09c: a4 2e mov r10, r20 1b09e: 4f e3 ldi r20, 0x3F ; 63 1b0a0: b4 2e mov r11, r20 acc += a * b * w; } // Second for the residuum in the y axis. // The first row of the points have a low weight, because their position may not be known // with a sufficient accuracy. if (r != 0 && c != 0) { 1b0a2: 11 11 cpse r17, r1 1b0a4: be cf rjmp .-132 ; 0x1b022 1b0a6: 0c 94 87 ce jmp 0x19d0e ; 0x19d0e 0001b0aa : sprintf_P(dest, PSTR("%u.%u.%u.%u"), IP[0], IP[1], IP[2], IP[3]); } bool calibration_status_get(CalibrationStatus components) { 1b0aa: cf 93 push r28 1b0ac: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1b0ae: 86 ea ldi r24, 0xA6 ; 166 1b0b0: 9c e0 ldi r25, 0x0C ; 12 1b0b2: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 return ((status & components) == components); 1b0b6: 98 2f mov r25, r24 1b0b8: 9c 23 and r25, r28 1b0ba: 81 e0 ldi r24, 0x01 ; 1 1b0bc: 9c 13 cpse r25, r28 1b0be: 80 e0 ldi r24, 0x00 ; 0 } 1b0c0: cf 91 pop r28 1b0c2: 08 95 ret 0001b0c4 : ClCheckMode oCheckVersion; ClCheckMode oCheckGcode; ClCheckMode oCheckFilament; void fCheckModeInit() { oCheckMode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Warn); 1b0c4: 61 e0 ldi r22, 0x01 ; 1 1b0c6: 88 ea ldi r24, 0xA8 ; 168 1b0c8: 9d e0 ldi r25, 0x0D ; 13 1b0ca: 0e 94 ed 6e call 0xddda ; 0xddda 1b0ce: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb if (farm_mode) { 1b0d2: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1b0d6: 88 23 and r24, r24 1b0d8: 41 f0 breq .+16 ; 0x1b0ea oCheckMode = ClCheckMode::_Strict; 1b0da: 82 e0 ldi r24, 0x02 ; 2 1b0dc: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1b0e0: 62 e0 ldi r22, 0x02 ; 2 1b0e2: 88 ea ldi r24, 0xA8 ; 168 1b0e4: 9d e0 ldi r25, 0x0D ; 13 1b0e6: 0f 94 00 a0 call 0x34000 ; 0x34000 eeprom_update_byte_notify((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Strict); } oNozzleDiameter = (ClNozzleDiameter)eeprom_init_default_byte((uint8_t *)EEPROM_NOZZLE_DIAMETER, (uint8_t)ClNozzleDiameter::_Diameter_400); 1b0ea: 68 e2 ldi r22, 0x28 ; 40 1b0ec: 87 ea ldi r24, 0xA7 ; 167 1b0ee: 9d e0 ldi r25, 0x0D ; 13 1b0f0: 0e 94 ed 6e call 0xddda ; 0xddda 1b0f4: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 eeprom_init_default_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM, EEPROM_NOZZLE_DIAMETER_uM_DEFAULT); 1b0f8: 60 e9 ldi r22, 0x90 ; 144 1b0fa: 71 e0 ldi r23, 0x01 ; 1 1b0fc: 85 ea ldi r24, 0xA5 ; 165 1b0fe: 9d e0 ldi r25, 0x0D ; 13 1b100: 0e 94 d5 6e call 0xddaa ; 0xddaa oCheckModel = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODEL, (uint8_t)ClCheckMode::_Warn); 1b104: 61 e0 ldi r22, 0x01 ; 1 1b106: 84 ea ldi r24, 0xA4 ; 164 1b108: 9d e0 ldi r25, 0x0D ; 13 1b10a: 0e 94 ed 6e call 0xddda ; 0xddda 1b10e: 80 93 b8 03 sts 0x03B8, r24 ; 0x8003b8 oCheckVersion = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_VERSION, (uint8_t)ClCheckMode::_Warn); 1b112: 61 e0 ldi r22, 0x01 ; 1 1b114: 83 ea ldi r24, 0xA3 ; 163 1b116: 9d e0 ldi r25, 0x0D ; 13 1b118: 0e 94 ed 6e call 0xddda ; 0xddda 1b11c: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 oCheckGcode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_GCODE, (uint8_t)ClCheckMode::_Warn); 1b120: 61 e0 ldi r22, 0x01 ; 1 1b122: 82 ea ldi r24, 0xA2 ; 162 1b124: 9d e0 ldi r25, 0x0D ; 13 1b126: 0e 94 ed 6e call 0xddda ; 0xddda 1b12a: 80 93 b6 03 sts 0x03B6, r24 ; 0x8003b6 oCheckFilament = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_FILAMENT, (uint8_t)ClCheckMode::_Warn); 1b12e: 61 e0 ldi r22, 0x01 ; 1 1b130: 80 e2 ldi r24, 0x20 ; 32 1b132: 9c e0 ldi r25, 0x0C ; 12 1b134: 0e 94 ed 6e call 0xddda ; 0xddda 1b138: 80 93 bc 03 sts 0x03BC, r24 ; 0x8003bc } 1b13c: 08 95 ret 0001b13e
: void setupUSB() __attribute__((weak)); void setupUSB() { } int main(void) { 1b13e: cf 93 push r28 1b140: df 93 push r29 1b142: 00 d0 rcall .+0 ; 0x1b144 1b144: 00 d0 rcall .+0 ; 0x1b146 1b146: 00 d0 rcall .+0 ; 0x1b148 1b148: 1f 92 push r1 1b14a: cd b7 in r28, 0x3d ; 61 1b14c: de b7 in r29, 0x3e ; 62 void init() { // this needs to be called before setup() or some functions won't // work there sei(); 1b14e: 78 94 sei // on the ATmega168, timer 0 is also used for fast hardware pwm // (using phase-correct PWM would mean that timer 0 overflowed half as often // resulting in different millis() behavior on the ATmega8 and ATmega168) #if defined(TCCR0A) && defined(WGM01) sbi(TCCR0A, WGM01); 1b150: 84 b5 in r24, 0x24 ; 36 1b152: 82 60 ori r24, 0x02 ; 2 1b154: 84 bd out 0x24, r24 ; 36 sbi(TCCR0A, WGM00); 1b156: 84 b5 in r24, 0x24 ; 36 1b158: 81 60 ori r24, 0x01 ; 1 1b15a: 84 bd out 0x24, r24 ; 36 // this combination is for the standard atmega8 sbi(TCCR0, CS01); sbi(TCCR0, CS00); #elif defined(TCCR0B) && defined(CS01) && defined(CS00) // this combination is for the standard 168/328/1280/2560 sbi(TCCR0B, CS01); 1b15c: 85 b5 in r24, 0x25 ; 37 1b15e: 82 60 ori r24, 0x02 ; 2 1b160: 85 bd out 0x25, r24 ; 37 sbi(TCCR0B, CS00); 1b162: 85 b5 in r24, 0x25 ; 37 1b164: 81 60 ori r24, 0x01 ; 1 1b166: 85 bd out 0x25, r24 ; 37 // enable timer 0 overflow interrupt #if defined(TIMSK) && defined(TOIE0) sbi(TIMSK, TOIE0); #elif defined(TIMSK0) && defined(TOIE0) sbi(TIMSK0, TOIE0); 1b168: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1b16c: 81 60 ori r24, 0x01 ; 1 1b16e: 80 93 6e 00 sts 0x006E, r24 ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> // this is better for motors as it ensures an even waveform // note, however, that fast pwm mode can achieve a frequency of up // 8 MHz (with a 16 MHz clock) at 50% duty cycle #if defined(TCCR1B) && defined(CS11) && defined(CS10) TCCR1B = 0; 1b172: 10 92 81 00 sts 0x0081, r1 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // set timer 1 prescale factor to 64 sbi(TCCR1B, CS11); 1b176: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1b17a: 82 60 ori r24, 0x02 ; 2 1b17c: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> #if F_CPU >= 8000000L sbi(TCCR1B, CS10); 1b180: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1b184: 81 60 ori r24, 0x01 ; 1 1b186: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> sbi(TCCR1, CS10); #endif #endif // put timer 1 in 8-bit phase correct pwm mode #if defined(TCCR1A) && defined(WGM10) sbi(TCCR1A, WGM10); 1b18a: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1b18e: 81 60 ori r24, 0x01 ; 1 1b190: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> // set timer 2 prescale factor to 64 #if defined(TCCR2) && defined(CS22) sbi(TCCR2, CS22); #elif defined(TCCR2B) && defined(CS22) sbi(TCCR2B, CS22); 1b194: 80 91 b1 00 lds r24, 0x00B1 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> 1b198: 84 60 ori r24, 0x04 ; 4 1b19a: 80 93 b1 00 sts 0x00B1, r24 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> // configure timer 2 for phase correct pwm (8-bit) #if defined(TCCR2) && defined(WGM20) sbi(TCCR2, WGM20); #elif defined(TCCR2A) && defined(WGM20) sbi(TCCR2A, WGM20); 1b19e: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1b1a2: 81 60 ori r24, 0x01 ; 1 1b1a4: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> //#else // Timer 2 not finished (may not be present on this CPU) #endif #if defined(TCCR3B) && defined(CS31) && defined(WGM30) sbi(TCCR3B, CS31); // set timer 3 prescale factor to 64 1b1a8: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1b1ac: 82 60 ori r24, 0x02 ; 2 1b1ae: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> sbi(TCCR3B, CS30); 1b1b2: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1b1b6: 81 60 ori r24, 0x01 ; 1 1b1b8: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> sbi(TCCR3A, WGM30); // put timer 3 in 8-bit phase correct pwm mode 1b1bc: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1b1c0: 81 60 ori r24, 0x01 ; 1 1b1c2: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> sbi(TCCR4D, WGM40); // put timer 4 in phase- and frequency-correct PWM mode sbi(TCCR4A, PWM4A); // enable PWM mode for comparator OCR4A sbi(TCCR4C, PWM4D); // enable PWM mode for comparator OCR4D #else /* beginning of timer4 block for ATMEGA1280 and ATMEGA2560 */ #if defined(TCCR4B) && defined(CS41) && defined(WGM40) sbi(TCCR4B, CS41); // set timer 4 prescale factor to 64 1b1c6: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1b1ca: 82 60 ori r24, 0x02 ; 2 1b1cc: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> sbi(TCCR4B, CS40); 1b1d0: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1b1d4: 81 60 ori r24, 0x01 ; 1 1b1d6: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> sbi(TCCR4A, WGM40); // put timer 4 in 8-bit phase correct pwm mode 1b1da: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1b1de: 81 60 ori r24, 0x01 ; 1 1b1e0: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #endif #endif /* end timer4 block for ATMEGA1280/2560 and similar */ #if defined(TCCR5B) && defined(CS51) && defined(WGM50) sbi(TCCR5B, CS51); // set timer 5 prescale factor to 64 1b1e4: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1b1e8: 82 60 ori r24, 0x02 ; 2 1b1ea: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> sbi(TCCR5B, CS50); 1b1ee: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1b1f2: 81 60 ori r24, 0x01 ; 1 1b1f4: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> sbi(TCCR5A, WGM50); // put timer 5 in 8-bit phase correct pwm mode 1b1f8: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1b1fc: 81 60 ori r24, 0x01 ; 1 1b1fe: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> #endif #if defined(ADCSRA) // set a2d prescaler so we are inside the desired 50-200 KHz range. #if F_CPU >= 16000000 // 16 MHz / 128 = 125 KHz sbi(ADCSRA, ADPS2); 1b202: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1b206: 84 60 ori r24, 0x04 ; 4 1b208: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS1); 1b20c: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1b210: 82 60 ori r24, 0x02 ; 2 1b212: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS0); 1b216: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1b21a: 81 60 ori r24, 0x01 ; 1 1b21c: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> cbi(ADCSRA, ADPS2); cbi(ADCSRA, ADPS1); sbi(ADCSRA, ADPS0); #endif // enable a2d conversions sbi(ADCSRA, ADEN); 1b220: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1b224: 80 68 ori r24, 0x80 ; 128 1b226: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> // here so they can be used as normal digital i/o; they will be // reconnected in Serial.begin() #if defined(UCSRB) UCSRB = 0; #elif defined(UCSR0B) UCSR0B = 0; 1b22a: 10 92 c1 00 sts 0x00C1, r1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> // after the program starts since there's no danger in doing this. // The reason for this is because old bootloaders might not handle the watchdog timer at all, // leaving it enabled when jumping to the program. This could cause another watchdog reset // during setup() if not handled properly. So to avoid any issue of this kind, stop the // watchdog timer manually. ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1b22e: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1b230: f8 94 cli wdt_reset(); 1b232: a8 95 wdr MCUSR &= ~_BV(WDRF); 1b234: 84 b7 in r24, 0x34 ; 52 1b236: 87 7f andi r24, 0xF7 ; 247 1b238: 84 bf out 0x34, r24 ; 52 "out __SREG__,__tmp_reg__" "\n\t" : [TEMPREG] "=d" (temp_reg) : [WDTREG] "n" (_SFR_MEM_ADDR(_WD_CONTROL_REG)), [WDCE_WDE] "n" ((uint8_t)(_BV(_WD_CHANGE_BIT) | _BV(WDE))) : "r0" ); 1b23a: 0f b6 in r0, 0x3f ; 63 1b23c: f8 94 cli 1b23e: a8 95 wdr 1b240: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1b244: 88 61 ori r24, 0x18 ; 24 1b246: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1b24a: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1b24e: 0f be out 0x3f, r0 ; 63 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1b250: 9f bf out 0x3f, r25 ; 63 CRITICAL_SECTION_END; } void timer2_init(void) { CRITICAL_SECTION_START; 1b252: 9f b7 in r25, 0x3f ; 63 1b254: f8 94 cli // Everything, that used to be on timer0 was moved to timer2 (delay, beeping, millis etc.) //setup timer2 TCCR2A = 0x00; //COM_A-B=00, WGM_0-1=00 1b256: 10 92 b0 00 sts 0x00B0, r1 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> TCCR2B = (4 << CS20); //WGM_2=0, CS_0-2=011 1b25a: 84 e0 ldi r24, 0x04 ; 4 1b25c: 80 93 b1 00 sts 0x00B1, r24 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> //mask timer2 interrupts - enable OVF, disable others TIMSK2 |= (1< 1b264: 81 60 ori r24, 0x01 ; 1 1b266: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1b26e: 8d 7f andi r24, 0xFD ; 253 1b270: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1b278: 8b 7f andi r24, 0xFB ; 251 1b27a: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> //set timer2 OCR registers (OCRB interrupt generated 0.5ms after OVF interrupt) OCR2A = 0; 1b27e: 10 92 b3 00 sts 0x00B3, r1 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> CRITICAL_SECTION_END; 1b282: 9f bf out 0x3f, r25 ; 63 return 0; } void lcd_init(void) { WRITE(LCD_PINS_ENABLE,LOW); 1b284: 73 98 cbi 0x0e, 3 ; 14 SET_OUTPUT(LCD_PINS_RS); 1b286: 57 9a sbi 0x0a, 7 ; 10 SET_OUTPUT(LCD_PINS_ENABLE); 1b288: 6b 9a sbi 0x0d, 3 ; 13 SET_OUTPUT(LCD_PINS_D0); SET_OUTPUT(LCD_PINS_D1); SET_OUTPUT(LCD_PINS_D2); SET_OUTPUT(LCD_PINS_D3); #endif SET_OUTPUT(LCD_PINS_D4); 1b28a: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1b28e: 82 60 ori r24, 0x02 ; 2 1b290: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_OUTPUT(LCD_PINS_D5); 1b294: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1b298: 81 60 ori r24, 0x01 ; 1 1b29a: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_OUTPUT(LCD_PINS_D6); 1b29e: 3d 9a sbi 0x07, 5 ; 7 SET_OUTPUT(LCD_PINS_D7); 1b2a0: 3e 9a sbi 0x07, 6 ; 7 #ifdef LCD_8BIT lcd_displayfunction |= LCD_8BITMODE; #endif lcd_displayfunction |= LCD_2LINE; 1b2a2: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce <_ZL19lcd_displayfunction.lto_priv.515> 1b2a6: 88 60 ori r24, 0x08 ; 8 1b2a8: 80 93 ce 03 sts 0x03CE, r24 ; 0x8003ce <_ZL19lcd_displayfunction.lto_priv.515> 1b2ac: 2f ef ldi r18, 0xFF ; 255 1b2ae: 30 e7 ldi r19, 0x70 ; 112 1b2b0: 82 e0 ldi r24, 0x02 ; 2 1b2b2: 21 50 subi r18, 0x01 ; 1 1b2b4: 30 40 sbci r19, 0x00 ; 0 1b2b6: 80 40 sbci r24, 0x00 ; 0 1b2b8: e1 f7 brne .-8 ; 0x1b2b2 1b2ba: 00 c0 rjmp .+0 ; 0x1b2bc 1b2bc: 00 00 nop _delay_us(50000); lcd_begin(1); //first time init 1b2be: 81 e0 ldi r24, 0x01 ; 1 1b2c0: 0e 94 e6 69 call 0xd3cc ; 0xd3cc fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream 1b2c4: 8e e8 ldi r24, 0x8E ; 142 1b2c6: 9b e6 ldi r25, 0x6B ; 107 1b2c8: 90 93 c9 03 sts 0x03C9, r25 ; 0x8003c9 <_lcdout+0x9> 1b2cc: 80 93 c8 03 sts 0x03C8, r24 ; 0x8003c8 <_lcdout+0x8> 1b2d0: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb <_lcdout+0xb> 1b2d4: 10 92 ca 03 sts 0x03CA, r1 ; 0x8003ca <_lcdout+0xa> 1b2d8: 12 e0 ldi r17, 0x02 ; 2 1b2da: 10 93 c3 03 sts 0x03C3, r17 ; 0x8003c3 <_lcdout+0x3> 1b2de: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd <_lcdout+0xd> 1b2e2: 10 92 cc 03 sts 0x03CC, r1 ; 0x8003cc <_lcdout+0xc> void ultralcd_init() { backlight_init(); lcd_init(); lcd_refresh(); 1b2e6: 0e 94 27 6a call 0xd44e ; 0xd44e lcd_longpress_func = menu_lcd_longpress_func; 1b2ea: 88 ee ldi r24, 0xE8 ; 232 1b2ec: 95 eb ldi r25, 0xB5 ; 181 1b2ee: 90 93 d5 03 sts 0x03D5, r25 ; 0x8003d5 1b2f2: 80 93 d4 03 sts 0x03D4, r24 ; 0x8003d4 lcd_lcdupdate_func = menu_lcd_lcdupdate_func; 1b2f6: 8b e2 ldi r24, 0x2B ; 43 1b2f8: 9b ee ldi r25, 0xEB ; 235 1b2fa: 90 93 d3 03 sts 0x03D3, r25 ; 0x8003d3 1b2fe: 80 93 d2 03 sts 0x03D2, r24 ; 0x8003d2 menu_menu = lcd_status_screen; 1b302: 81 eb ldi r24, 0xB1 ; 177 1b304: 97 e3 ldi r25, 0x37 ; 55 1b306: 90 93 d1 03 sts 0x03D1, r25 ; 0x8003d1 1b30a: 80 93 d0 03 sts 0x03D0, r24 ; 0x8003d0 SET_INPUT(BTN_EN1); 1b30e: 6f 98 cbi 0x0d, 7 ; 13 SET_INPUT(BTN_EN2); 1b310: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1b314: 87 7f andi r24, 0xF7 ; 247 1b316: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(BTN_EN1, HIGH); 1b31a: 77 9a sbi 0x0e, 7 ; 14 WRITE(BTN_EN2, HIGH); 1b31c: 9f b7 in r25, 0x3f ; 63 1b31e: f8 94 cli 1b320: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1b324: 88 60 ori r24, 0x08 ; 8 1b326: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1b32a: 9f bf out 0x3f, r25 ; 63 #if BTN_ENC > 0 SET_INPUT(BTN_ENC); 1b32c: 50 98 cbi 0x0a, 0 ; 10 WRITE(BTN_ENC, HIGH); 1b32e: 58 9a sbi 0x0b, 0 ; 11 #endif #if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0) SET_INPUT(SDCARDDETECT); 1b330: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1b334: 8b 7f andi r24, 0xFB ; 251 1b336: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(SDCARDDETECT, HIGH); 1b33a: 9f b7 in r25, 0x3f ; 63 1b33c: f8 94 cli 1b33e: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1b342: 84 60 ori r24, 0x04 ; 4 1b344: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1b348: 9f bf out 0x3f, r25 ; 63 #else //round up by default __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); #endif __builtin_avr_delay_cycles(__ticks_dc); 1b34a: af e9 ldi r26, 0x9F ; 159 1b34c: bf e0 ldi r27, 0x0F ; 15 1b34e: 11 97 sbiw r26, 0x01 ; 1 1b350: f1 f7 brne .-4 ; 0x1b34e 1b352: 00 c0 rjmp .+0 ; 0x1b354 1b354: 00 00 nop _delay_ms(1); //wait for the pullups to raise the line lcd_oldcardstatus = IS_SD_INSERTED; 1b356: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1b35a: 01 e0 ldi r16, 0x01 ; 1 1b35c: 82 fb bst r24, 2 1b35e: 88 27 eor r24, r24 1b360: 80 f9 bld r24, 0 1b362: 80 27 eor r24, r16 1b364: 80 93 cf 03 sts 0x03CF, r24 ; 0x8003cf #endif//(SDCARDDETECT > 0) // Initialise status line strncpy_P(lcd_status_message, MSG_WELCOME, LCD_WIDTH); 1b368: 44 e1 ldi r20, 0x14 ; 20 1b36a: 50 e0 ldi r21, 0x00 ; 0 1b36c: 67 e6 ldi r22, 0x67 ; 103 1b36e: 7b e6 ldi r23, 0x6B ; 107 1b370: 89 e0 ldi r24, 0x09 ; 9 1b372: 95 e0 ldi r25, 0x05 ; 5 1b374: 0f 94 c9 9d call 0x33b92 ; 0x33b92 extern "C" { #endif //defined(__cplusplus) static inline void spi_init() { DDRB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 1b378: 84 b1 in r24, 0x04 ; 4 1b37a: 81 7f andi r24, 0xF1 ; 241 1b37c: 84 b9 out 0x04, r24 ; 4 DDRB |= (1 << DD_SS) | (1 << DD_SCK) | (1 << DD_MOSI); 1b37e: 84 b1 in r24, 0x04 ; 4 1b380: 87 60 ori r24, 0x07 ; 7 1b382: 84 b9 out 0x04, r24 ; 4 PORTB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 1b384: 85 b1 in r24, 0x05 ; 5 1b386: 81 7f andi r24, 0xF1 ; 241 1b388: 85 b9 out 0x05, r24 ; 5 PORTB |= (1 << DD_SS); 1b38a: 28 9a sbi 0x05, 0 ; 5 SPCR = SPI_SPCR(0, 0, 0, 1, 0); //SPE=1, MSTR=1 (0x50) 1b38c: 80 e5 ldi r24, 0x50 ; 80 1b38e: 8c bd out 0x2c, r24 ; 44 SPSR = 0x00; 1b390: 1d bc out 0x2d, r1 ; 45 } void lcd_splash() { lcd_clear(); // clears display and homes screen 1b392: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_printf_P(PSTR("\n Original Prusa i3\n Prusa Research\n%20.20S"), PSTR(FW_VERSION)); 1b396: 8a e9 ldi r24, 0x9A ; 154 1b398: 95 e8 ldi r25, 0x85 ; 133 1b39a: 9f 93 push r25 1b39c: 8f 93 push r24 1b39e: 81 ea ldi r24, 0xA1 ; 161 1b3a0: 95 e8 ldi r25, 0x85 ; 133 1b3a2: 9f 93 push r25 1b3a4: 8f 93 push r24 1b3a6: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 static void Sound_DoSound_Encoder_Move(void); static void Sound_DoSound_Blind_Alert(void); void Sound_Init(void) { SET_OUTPUT(BEEPER); 1b3aa: 6a 9a sbi 0x0d, 2 ; 13 eSoundMode = static_cast(eeprom_init_default_byte((uint8_t*)EEPROM_SOUND_MODE, e_SOUND_MODE_DEFAULT)); 1b3ac: 60 e0 ldi r22, 0x00 ; 0 1b3ae: 87 ed ldi r24, 0xD7 ; 215 1b3b0: 9e e0 ldi r25, 0x0E ; 14 1b3b2: 0e 94 ed 6e call 0xddda ; 0xddda 1b3b6: 80 93 15 04 sts 0x0415, r24 ; 0x800415 spi_init(); lcd_splash(); Sound_Init(); // also guarantee "SET_OUTPUT(BEEPER)" selectedSerialPort = eeprom_init_default_byte((uint8_t *)EEPROM_SECOND_SERIAL_ACTIVE, 0); 1b3ba: 60 e0 ldi r22, 0x00 ; 0 1b3bc: 88 e0 ldi r24, 0x08 ; 8 1b3be: 9f e0 ldi r25, 0x0F ; 15 1b3c0: 0e 94 ed 6e call 0xddda ; 0xddda 1b3c4: 80 93 04 05 sts 0x0504, r24 ; 0x800504 MYSERIAL.begin(BAUDRATE); 1b3c8: 0e 94 67 b0 call 0x160ce ; 0x160ce fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream 1b3cc: 85 e5 ldi r24, 0x55 ; 85 1b3ce: 90 e7 ldi r25, 0x70 ; 112 1b3d0: 90 93 27 04 sts 0x0427, r25 ; 0x800427 <_uartout+0x9> 1b3d4: 80 93 26 04 sts 0x0426, r24 ; 0x800426 <_uartout+0x8> 1b3d8: 10 92 29 04 sts 0x0429, r1 ; 0x800429 <_uartout+0xb> 1b3dc: 10 92 28 04 sts 0x0428, r1 ; 0x800428 <_uartout+0xa> 1b3e0: 10 93 21 04 sts 0x0421, r17 ; 0x800421 <_uartout+0x3> 1b3e4: 10 92 2b 04 sts 0x042B, r1 ; 0x80042b <_uartout+0xd> 1b3e8: 10 92 2a 04 sts 0x042A, r1 ; 0x80042a <_uartout+0xc> stdout = uartout; 1b3ec: 8e e1 ldi r24, 0x1E ; 30 1b3ee: 94 e0 ldi r25, 0x04 ; 4 1b3f0: 90 93 01 17 sts 0x1701, r25 ; 0x801701 <__iob+0x3> 1b3f4: 80 93 00 17 sts 0x1700, r24 ; 0x801700 <__iob+0x2> void prusa_statistics_update_from_lcd_update() { lcd_send_status(); } void farm_mode_init() { farm_mode = eeprom_init_default_byte((uint8_t*)EEPROM_FARM_MODE, 0); 1b3f8: 60 e0 ldi r22, 0x00 ; 0 1b3fa: 84 ec ldi r24, 0xC4 ; 196 1b3fc: 9f e0 ldi r25, 0x0F ; 15 1b3fe: 0e 94 ed 6e call 0xddda ; 0xddda 1b402: 80 93 ca 0d sts 0x0DCA, r24 ; 0x800dca if (farm_mode) { 1b406: 0f 90 pop r0 1b408: 0f 90 pop r0 1b40a: 0f 90 pop r0 1b40c: 0f 90 pop r0 1b40e: 88 23 and r24, r24 1b410: 71 f0 breq .+28 ; 0x1b42e no_response = true; //we need confirmation by recieving PRUSA thx 1b412: 00 93 d6 03 sts 0x03D6, r16 ; 0x8003d6 <_ZL11no_response.lto_priv.497> prusa_statistics(8); 1b416: 88 e0 ldi r24, 0x08 ; 8 1b418: 0f 94 ff 97 call 0x32ffe ; 0x32ffe #ifdef HAS_SECOND_SERIAL_PORT selectedSerialPort = 1; #endif //HAS_SECOND_SERIAL_PORT MYSERIAL.begin(BAUDRATE); 1b41c: 0e 94 67 b0 call 0x160ce ; 0x160ce fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1b420: 10 92 85 16 sts 0x1685, r1 ; 0x801685 1b424: 61 e0 ldi r22, 0x01 ; 1 1b426: 87 e8 ldi r24, 0x87 ; 135 1b428: 9f e0 ldi r25, 0x0F ; 15 1b42a: 0f 94 00 a0 call 0x34000 ; 0x34000 } #endif //PRUSA_SN_SUPPORT #ifndef XFLASH SERIAL_PROTOCOLLNPGM("start"); 1b42e: 82 e9 ldi r24, 0x92 ; 146 1b430: 96 e8 ldi r25, 0x86 ; 134 1b432: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 #else if ((optiboot_status != 0) || (selectedSerialPort != 0)) SERIAL_PROTOCOLLNPGM("start"); #endif SERIAL_ECHO_START; 1b436: 81 e6 ldi r24, 0x61 ; 97 1b438: 9d e9 ldi r25, 0x9D ; 157 1b43a: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 puts_P(PSTR(" " FW_VERSION_FULL "_" FW_COMMIT_HASH)); 1b43e: 8b e7 ldi r24, 0x7B ; 123 1b440: 96 e8 ldi r25, 0x86 ; 134 1b442: 0f 94 c5 9e call 0x33d8a ; 0x33d8a // by default the MMU shall remain disabled - PFW-1418 if (eeprom_init_default_byte((uint8_t *)EEPROM_MMU_ENABLED, 0)) { 1b446: 60 e0 ldi r22, 0x00 ; 0 1b448: 8c ea ldi r24, 0xAC ; 172 1b44a: 9c e0 ldi r25, 0x0C ; 12 1b44c: 0e 94 ed 6e call 0xddda ; 0xddda 1b450: 81 11 cpse r24, r1 MMU2::mmu2.Start(); 1b452: 0f 94 9a 62 call 0x2c534 ; 0x2c534 } MMU2::mmu2.Status(); 1b456: 0f 94 98 41 call 0x28330 ; 0x28330 } void SpoolJoin::initSpoolJoinStatus() { // Useful information to see during bootup SERIAL_ECHOPGM("SpoolJoin is "); 1b45a: 8f ec ldi r24, 0xCF ; 207 1b45c: 95 e8 ldi r25, 0x85 ; 133 1b45e: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_SPOOL_JOIN, (uint8_t)EEPROM::Disabled); 1b462: 62 e0 ldi r22, 0x02 ; 2 1b464: 86 ed ldi r24, 0xD6 ; 214 1b466: 9e e0 ldi r25, 0x0E ; 14 1b468: 0e 94 ed 6e call 0xddda ; 0xddda if (status == (uint8_t)EEPROM::Enabled) 1b46c: 81 30 cpi r24, 0x01 ; 1 1b46e: 09 f0 breq .+2 ; 0x1b472 1b470: 74 c0 rjmp .+232 ; 0x1b55a { SERIAL_ECHOLNRPGM(_O(MSG_ON)); 1b472: 81 eb ldi r24, 0xB1 ; 177 1b474: 9a e5 ldi r25, 0x5A ; 90 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 1b476: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 #endif #endif //DEBUG_SEC_LANG // Check startup - does nothing if bootloader sets MCUSR to 0 byte mcu = MCUSR; 1b47a: 14 b7 in r17, 0x34 ; 52 /* if (mcu & 1) SERIAL_ECHOLNRPGM(MSG_POWERUP); if (mcu & 2) SERIAL_ECHOLNRPGM(MSG_EXTERNAL_RESET); if (mcu & 4) SERIAL_ECHOLNRPGM(MSG_BROWNOUT_RESET); if (mcu & 8) SERIAL_ECHOLNRPGM(MSG_WATCHDOG_RESET); if (mcu & 32) SERIAL_ECHOLNRPGM(MSG_SOFTWARE_RESET);*/ if (mcu & 1) puts_P(MSG_POWERUP); 1b47c: 10 ff sbrs r17, 0 1b47e: 04 c0 rjmp .+8 ; 0x1b488 1b480: 81 e0 ldi r24, 0x01 ; 1 1b482: 99 e6 ldi r25, 0x69 ; 105 1b484: 0f 94 c5 9e call 0x33d8a ; 0x33d8a if (mcu & 2) puts_P(MSG_EXTERNAL_RESET); 1b488: 11 ff sbrs r17, 1 1b48a: 04 c0 rjmp .+8 ; 0x1b494 1b48c: 81 ef ldi r24, 0xF1 ; 241 1b48e: 98 e6 ldi r25, 0x68 ; 104 1b490: 0f 94 c5 9e call 0x33d8a ; 0x33d8a if (mcu & 4) puts_P(MSG_BROWNOUT_RESET); 1b494: 12 ff sbrs r17, 2 1b496: 04 c0 rjmp .+8 ; 0x1b4a0 1b498: 80 ee ldi r24, 0xE0 ; 224 1b49a: 98 e6 ldi r25, 0x68 ; 104 1b49c: 0f 94 c5 9e call 0x33d8a ; 0x33d8a if (mcu & 8) puts_P(MSG_WATCHDOG_RESET); 1b4a0: 13 ff sbrs r17, 3 1b4a2: 04 c0 rjmp .+8 ; 0x1b4ac 1b4a4: 80 ed ldi r24, 0xD0 ; 208 1b4a6: 98 e6 ldi r25, 0x68 ; 104 1b4a8: 0f 94 c5 9e call 0x33d8a ; 0x33d8a if (mcu & 32) puts_P(MSG_SOFTWARE_RESET); 1b4ac: 15 ff sbrs r17, 5 1b4ae: 04 c0 rjmp .+8 ; 0x1b4b8 1b4b0: 80 ec ldi r24, 0xC0 ; 192 1b4b2: 98 e6 ldi r25, 0x68 ; 104 1b4b4: 0f 94 c5 9e call 0x33d8a ; 0x33d8a MCUSR = 0; 1b4b8: 14 be out 0x34, r1 ; 52 //SERIAL_ECHORPGM(MSG_MARLIN); //SERIAL_ECHOLNRPGM(VERSION_STRING); #ifdef STRING_VERSION_CONFIG_H #ifdef STRING_CONFIG_H_AUTHOR SERIAL_ECHO_START; 1b4ba: 81 e6 ldi r24, 0x61 ; 97 1b4bc: 9d e9 ldi r25, 0x9D ; 157 1b4be: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHORPGM(_n(" Last Updated: "));////MSG_CONFIGURATION_VER 1b4c2: 80 eb ldi r24, 0xB0 ; 176 1b4c4: 98 e6 ldi r25, 0x68 ; 104 1b4c6: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOPGM(STRING_VERSION_CONFIG_H); 1b4ca: 87 e6 ldi r24, 0x67 ; 103 1b4cc: 96 e8 ldi r25, 0x86 ; 134 1b4ce: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHORPGM(_n(" | Author: "));////MSG_AUTHOR 1b4d2: 84 ea ldi r24, 0xA4 ; 164 1b4d4: 98 e6 ldi r25, 0x68 ; 104 1b4d6: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLNPGM(STRING_CONFIG_H_AUTHOR); 1b4da: 8f e5 ldi r24, 0x5F ; 95 1b4dc: 96 e8 ldi r25, 0x86 ; 134 1b4de: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 #endif #endif SERIAL_ECHO_START; 1b4e2: 81 e6 ldi r24, 0x61 ; 97 1b4e4: 9d e9 ldi r25, 0x9D ; 157 1b4e6: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHORPGM(_n(" Free Memory: "));////MSG_FREE_MEMORY 1b4ea: 85 e9 ldi r24, 0x95 ; 149 1b4ec: 98 e6 ldi r25, 0x68 ; 104 1b4ee: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 /** Amount of free RAM * \return The number of free bytes. */ int SdFatUtil::FreeRam() { char top; return __brkval ? &top - __brkval : &top - &__bss_end; 1b4f2: 80 91 fa 16 lds r24, 0x16FA ; 0x8016fa <__brkval> 1b4f6: 90 91 fb 16 lds r25, 0x16FB ; 0x8016fb <__brkval+0x1> 1b4fa: fe 01 movw r30, r28 1b4fc: 31 96 adiw r30, 0x01 ; 1 1b4fe: 7f 01 movw r14, r30 1b500: bf 01 movw r22, r30 1b502: 00 97 sbiw r24, 0x00 ; 0 1b504: 69 f1 breq .+90 ; 0x1b560 1b506: 68 1b sub r22, r24 1b508: 79 0b sbc r23, r25 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1b50a: 07 2e mov r0, r23 1b50c: 00 0c add r0, r0 1b50e: 88 0b sbc r24, r24 1b510: 99 0b sbc r25, r25 1b512: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_ECHO(freeMemory()); SERIAL_ECHORPGM(_n(" PlannerBufferBytes: "));////MSG_PLANNER_BUFFER_BYTES 1b516: 8e e7 ldi r24, 0x7E ; 126 1b518: 98 e6 ldi r25, 0x68 ; 104 1b51a: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); 1b51e: 80 ee ldi r24, 0xE0 ; 224 1b520: 96 e0 ldi r25, 0x06 ; 6 1b522: 0f 94 aa 41 call 0x28354 ; 0x28354 #endif //defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) uint8_t check_printer_version() { uint8_t version_changed = 0; uint16_t printer_type = eeprom_init_default_word((uint16_t*)EEPROM_PRINTER_TYPE, PRINTER_TYPE); 1b526: 6c ef ldi r22, 0xFC ; 252 1b528: 70 e0 ldi r23, 0x00 ; 0 1b52a: 8e ee ldi r24, 0xEE ; 238 1b52c: 9e e0 ldi r25, 0x0E ; 14 1b52e: 0e 94 d5 6e call 0xddaa ; 0xddaa 1b532: 8c 01 movw r16, r24 uint16_t motherboard = eeprom_init_default_word((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); 1b534: 68 ec ldi r22, 0xC8 ; 200 1b536: 70 e0 ldi r23, 0x00 ; 0 1b538: 8c ee ldi r24, 0xEC ; 236 1b53a: 9e e0 ldi r25, 0x0E ; 14 1b53c: 0e 94 d5 6e call 0xddaa ; 0xddaa if (printer_type != PRINTER_TYPE) version_changed |= 0b10; 1b540: 0c 3f cpi r16, 0xFC ; 252 1b542: 11 05 cpc r17, r1 1b544: 09 f0 breq .+2 ; 0x1b548 1b546: f5 c5 rjmp .+3050 ; 0x1c132 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1b548: 01 e0 ldi r16, 0x01 ; 1 1b54a: 88 3c cpi r24, 0xC8 ; 200 1b54c: 91 05 cpc r25, r1 1b54e: 09 f4 brne .+2 ; 0x1b552 1b550: 00 e0 ldi r16, 0x00 ; 0 // loads data from EEPROM if available else uses defaults (and resets step acceleration rate) bool previous_settings_retrieved = false; uint8_t hw_changed = check_printer_version(); if (!(hw_changed & 0b10)) { //if printer version wasn't changed, check for eeprom version and retrieve settings from eeprom in case that version wasn't changed previous_settings_retrieved = Config_RetrieveSettings(); 1b552: 0e 94 e1 74 call 0xe9c2 ; 0xe9c2 1b556: b8 2e mov r11, r24 1b558: f4 c5 rjmp .+3048 ; 0x1c142 1b55a: 8b ea ldi r24, 0xAB ; 171 1b55c: 9a e5 ldi r25, 0x5A ; 90 1b55e: 8b cf rjmp .-234 ; 0x1b476 1b560: 64 50 subi r22, 0x04 ; 4 1b562: 77 41 sbci r23, 0x17 ; 23 1b564: d2 cf rjmp .-92 ; 0x1b50a minttemp_raw[0] -= OVERSAMPLENR; #endif } #endif //MINTEMP #ifdef HEATER_0_MAXTEMP maxttemp[0] = HEATER_0_MAXTEMP; 1b566: 81 e3 ldi r24, 0x31 ; 49 1b568: 91 e0 ldi r25, 0x01 ; 1 1b56a: 90 93 55 02 sts 0x0255, r25 ; 0x800255 <_ZL8maxttemp.lto_priv.433+0x1> 1b56e: 80 93 54 02 sts 0x0254, r24 ; 0x800254 <_ZL8maxttemp.lto_priv.433> while(analog2temp(maxttemp_raw[0], 0) > HEATER_0_MAXTEMP) { 1b572: c0 90 d9 03 lds r12, 0x03D9 ; 0x8003d9 <_ZL12maxttemp_raw.lto_priv.427> 1b576: d0 90 da 03 lds r13, 0x03DA ; 0x8003da <_ZL12maxttemp_raw.lto_priv.427+0x1> 1b57a: c6 01 movw r24, r12 1b57c: 0e 94 be bd call 0x17b7c ; 0x17b7c 1b580: 20 e0 ldi r18, 0x00 ; 0 1b582: 30 e8 ldi r19, 0x80 ; 128 1b584: 48 e9 ldi r20, 0x98 ; 152 1b586: 53 e4 ldi r21, 0x43 ; 67 1b588: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 1b58c: 18 16 cp r1, r24 1b58e: 44 f4 brge .+16 ; 0x1b5a0 #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP maxttemp_raw[0] -= OVERSAMPLENR; #else maxttemp_raw[0] += OVERSAMPLENR; 1b590: 20 e1 ldi r18, 0x10 ; 16 1b592: c2 0e add r12, r18 1b594: d1 1c adc r13, r1 1b596: d0 92 da 03 sts 0x03DA, r13 ; 0x8003da <_ZL12maxttemp_raw.lto_priv.427+0x1> 1b59a: c0 92 d9 03 sts 0x03D9, r12 ; 0x8003d9 <_ZL12maxttemp_raw.lto_priv.427> 1b59e: e9 cf rjmp .-46 ; 0x1b572 #endif } #endif //MAXTEMP #ifdef BED_MINTEMP while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { 1b5a0: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.425> 1b5a4: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.425+0x1> 1b5a8: 0f 94 18 16 call 0x22c30 ; 0x22c30 1b5ac: 20 e0 ldi r18, 0x00 ; 0 1b5ae: 30 e0 ldi r19, 0x00 ; 0 1b5b0: 40 ef ldi r20, 0xF0 ; 240 1b5b2: 51 e4 ldi r21, 0x41 ; 65 1b5b4: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1b5b8: 87 ff sbrs r24, 7 1b5ba: 0a c0 rjmp .+20 ; 0x1b5d0 #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_minttemp_raw += OVERSAMPLENR; #else bed_minttemp_raw -= OVERSAMPLENR; 1b5bc: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.425> 1b5c0: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.425+0x1> 1b5c4: 40 97 sbiw r24, 0x10 ; 16 1b5c6: 90 93 51 02 sts 0x0251, r25 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.425+0x1> 1b5ca: 80 93 50 02 sts 0x0250, r24 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.425> 1b5ce: e8 cf rjmp .-48 ; 0x1b5a0 #endif } #endif //BED_MINTEMP #ifdef BED_MAXTEMP while(analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) { 1b5d0: 80 91 d7 03 lds r24, 0x03D7 ; 0x8003d7 <_ZL16bed_maxttemp_raw.lto_priv.428> 1b5d4: 90 91 d8 03 lds r25, 0x03D8 ; 0x8003d8 <_ZL16bed_maxttemp_raw.lto_priv.428+0x1> 1b5d8: 0f 94 18 16 call 0x22c30 ; 0x22c30 1b5dc: 20 e0 ldi r18, 0x00 ; 0 1b5de: 30 e0 ldi r19, 0x00 ; 0 1b5e0: 4a ef ldi r20, 0xFA ; 250 1b5e2: 52 e4 ldi r21, 0x42 ; 66 1b5e4: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 1b5e8: 18 16 cp r1, r24 1b5ea: 54 f4 brge .+20 ; 0x1b600 #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_maxttemp_raw -= OVERSAMPLENR; #else bed_maxttemp_raw += OVERSAMPLENR; 1b5ec: 80 91 d7 03 lds r24, 0x03D7 ; 0x8003d7 <_ZL16bed_maxttemp_raw.lto_priv.428> 1b5f0: 90 91 d8 03 lds r25, 0x03D8 ; 0x8003d8 <_ZL16bed_maxttemp_raw.lto_priv.428+0x1> 1b5f4: 40 96 adiw r24, 0x10 ; 16 1b5f6: 90 93 d8 03 sts 0x03D8, r25 ; 0x8003d8 <_ZL16bed_maxttemp_raw.lto_priv.428+0x1> 1b5fa: 80 93 d7 03 sts 0x03D7, r24 ; 0x8003d7 <_ZL16bed_maxttemp_raw.lto_priv.428> 1b5fe: e8 cf rjmp .-48 ; 0x1b5d0 #include #include "macros.h" void timer0_init(void) { CRITICAL_SECTION_START; 1b600: 9f b7 in r25, 0x3f ; 63 1b602: f8 94 cli TCNT0 = 0; 1b604: 16 bc out 0x26, r1 ; 38 // Fast PWM duty (0-255). // Due to invert mode (following rows) the duty is set to 255, which means zero all the time (bed not heating) OCR0B = 255; 1b606: 8f ef ldi r24, 0xFF ; 255 1b608: 88 bd out 0x28, r24 ; 40 // Set fast PWM mode and inverting mode. TCCR0A = (1 << WGM01) | (1 << WGM00) | (1 << COM0B1) | (1 << COM0B0); 1b60a: 83 e3 ldi r24, 0x33 ; 51 1b60c: 84 bd out 0x24, r24 ; 36 TCCR0B = (1 << CS01); // CLK/8 prescaling 1b60e: 12 e0 ldi r17, 0x02 ; 2 1b610: 15 bd out 0x25, r17 ; 37 TIMSK0 |= (1 << TOIE0); // enable timer overflow interrupt 1b612: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1b616: 81 60 ori r24, 0x01 ; 1 1b618: 80 93 6e 00 sts 0x006E, r24 ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> CRITICAL_SECTION_END; 1b61c: 9f bf out 0x3f, r25 ; 63 timer0_init(); //enables the heatbed timer. // timer2 already enabled earlier in the code // now enable the COMPB temperature interrupt OCR2B = 128; 1b61e: 80 e8 ldi r24, 0x80 ; 128 1b620: 80 93 b4 00 sts 0x00B4, r24 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> ENABLE_SOFT_PWM_INTERRUPT(); 1b624: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 1b628: 84 60 ori r24, 0x04 ; 4 1b62a: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> #include "fastio.h" #include "macros.h" void timer4_init(void) { CRITICAL_SECTION_START; 1b62e: 2f b7 in r18, 0x3f ; 63 1b630: f8 94 cli SET_OUTPUT(BEEPER); 1b632: 6a 9a sbi 0x0d, 2 ; 13 WRITE(BEEPER, LOW); 1b634: 72 98 cbi 0x0e, 2 ; 14 SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN); 1b636: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1b63a: 80 62 ori r24, 0x20 ; 32 1b63c: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> // Set timer mode 9 (PWM,Phase and Frequency Correct) // Prescaler is CLK/1024 // Output compare is disabled on all timer pins // Input capture is disabled // All interrupts are disabled TCCR4A = _BV(WGM40); 1b640: 81 e0 ldi r24, 0x01 ; 1 1b642: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> TCCR4B = _BV(WGM43) | _BV(CS42) | _BV(CS40); 1b646: 85 e1 ldi r24, 0x15 ; 21 1b648: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> OCR4A = 255U; 1b64c: 8f ef ldi r24, 0xFF ; 255 1b64e: 90 e0 ldi r25, 0x00 ; 0 1b650: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1b654: 80 93 a8 00 sts 0x00A8, r24 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> OCR4B = 255U; 1b658: 90 93 ab 00 sts 0x00AB, r25 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1b65c: 80 93 aa 00 sts 0x00AA, r24 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> OCR4C = 255U; 1b660: 90 93 ad 00 sts 0x00AD, r25 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1b664: 80 93 ac 00 sts 0x00AC, r24 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> TIMSK4 = 0; 1b668: 10 92 72 00 sts 0x0072, r1 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 1b66c: 2f bf out 0x3f, r18 ; 63 static void adc_reset(); static void adc_setmux(uint8_t ch); void adc_init() { puts_P(PSTR("adc_init")); 1b66e: 8d ed ldi r24, 0xDD ; 221 1b670: 95 e8 ldi r25, 0x85 ; 133 1b672: 0f 94 c5 9e call 0x33d8a ; 0x33d8a DIDR0 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) & 0xff); //disable digital inputs PORTF 1b676: 8f e5 ldi r24, 0x5F ; 95 1b678: 80 93 7e 00 sts 0x007E, r24 ; 0x80007e <__TEXT_REGION_LENGTH__+0x7c207e> DIDR2 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) >> 8); //disable digital inputs PORTK 1b67c: 10 93 7d 00 sts 0x007D, r17 ; 0x80007d <__TEXT_REGION_LENGTH__+0x7c207d> ADMUX |= (1 << REFS0); //use AVCC as reference 1b680: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> 1b684: 80 64 ori r24, 0x40 ; 64 1b686: 80 93 7c 00 sts 0x007C, r24 ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> //enable ADC, set prescaler/128, enable interrupt ADCSRA = (1 << ADEN) | (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0) | (1 << ADIF) | (1 << ADIE); 1b68a: 8f e9 ldi r24, 0x9F ; 159 1b68c: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> void temp_mgr_init() { // initialize the ADC and start a conversion adc_init(); adc_start_cycle(); 1b690: 0e 94 f0 7d call 0xfbe0 ; 0xfbe0 // initialize temperature timer ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1b694: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1b696: f8 94 cli // CTC TCCRxB &= ~(1< 1b69c: 8f 7e andi r24, 0xEF ; 239 1b69e: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxB |= (1< 1b6a6: 88 60 ori r24, 0x08 ; 8 1b6a8: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxA &= ~(1< 1b6b0: 8d 7f andi r24, 0xFD ; 253 1b6b2: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> TCCRxA &= ~(1< 1b6ba: 8e 7f andi r24, 0xFE ; 254 1b6bc: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> // output mode = 00 (disconnected) TCCRxA &= ~(3< 1b6c4: 8f 73 andi r24, 0x3F ; 63 1b6c6: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> TCCRxA &= ~(3< 1b6ce: 8f 7c andi r24, 0xCF ; 207 1b6d0: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> // x/256 prescaler TCCRxB |= (1< 1b6d8: 84 60 ori r24, 0x04 ; 4 1b6da: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxB &= ~(1< 1b6e2: 8d 7f andi r24, 0xFD ; 253 1b6e4: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxB &= ~(1< 1b6ec: 8e 7f andi r24, 0xFE ; 254 1b6ee: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> // reset counter TCNTx = 0; 1b6f2: 10 92 95 00 sts 0x0095, r1 ; 0x800095 <__TEXT_REGION_LENGTH__+0x7c2095> 1b6f6: 10 92 94 00 sts 0x0094, r1 ; 0x800094 <__TEXT_REGION_LENGTH__+0x7c2094> OCRxA = TEMP_TIM_OCRA_OVF; 1b6fa: 2b ee ldi r18, 0xEB ; 235 1b6fc: 31 e4 ldi r19, 0x41 ; 65 1b6fe: 30 93 99 00 sts 0x0099, r19 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 1b702: 20 93 98 00 sts 0x0098, r18 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> // clear pending interrupts, enable COMPA TEMP_MGR_INT_FLAG_CLEAR(); 1b706: c1 9a sbi 0x18, 1 ; 24 ENABLE_TEMP_MGR_INTERRUPT(); 1b708: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1b70c: 82 60 ori r24, 0x02 ; 2 1b70e: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1b712: 9f bf out 0x3f, r25 ; 63 // SERIAL_ECHOLNPGM("planner_recalculate - 4"); } void plan_init() { block_buffer_head = 0; 1b714: 10 92 a8 0d sts 0x0DA8, r1 ; 0x800da8 block_buffer_tail = 0; 1b718: 10 92 a9 0d sts 0x0DA9, r1 ; 0x800da9 memset(position, 0, sizeof(position)); // clear position 1b71c: 80 e1 ldi r24, 0x10 ; 16 1b71e: e6 ea ldi r30, 0xA6 ; 166 1b720: f6 e0 ldi r31, 0x06 ; 6 1b722: df 01 movw r26, r30 1b724: 28 2f mov r18, r24 1b726: 1d 92 st X+, r1 1b728: 2a 95 dec r18 1b72a: e9 f7 brne .-6 ; 0x1b726 #ifdef LIN_ADVANCE memset(position_float, 0, sizeof(position_float)); // clear position 1b72c: e4 e0 ldi r30, 0x04 ; 4 1b72e: f4 e0 ldi r31, 0x04 ; 4 1b730: df 01 movw r26, r30 1b732: 28 2f mov r18, r24 1b734: 1d 92 st X+, r1 1b736: 2a 95 dec r18 1b738: e9 f7 brne .-6 ; 0x1b734 #endif memset(previous_speed, 0, sizeof(previous_speed)); 1b73a: e4 ef ldi r30, 0xF4 ; 244 1b73c: f3 e0 ldi r31, 0x03 ; 3 1b73e: df 01 movw r26, r30 1b740: 1d 92 st X+, r1 1b742: 8a 95 dec r24 1b744: e9 f7 brne .-6 ; 0x1b740 previous_nominal_speed = 0.0; 1b746: 10 92 f0 03 sts 0x03F0, r1 ; 0x8003f0 <_ZL22previous_nominal_speed.lto_priv.450> 1b74a: 10 92 f1 03 sts 0x03F1, r1 ; 0x8003f1 <_ZL22previous_nominal_speed.lto_priv.450+0x1> 1b74e: 10 92 f2 03 sts 0x03F2, r1 ; 0x8003f2 <_ZL22previous_nominal_speed.lto_priv.450+0x2> 1b752: 10 92 f3 03 sts 0x03F3, r1 ; 0x8003f3 <_ZL22previous_nominal_speed.lto_priv.450+0x3> plan_reset_next_e_queue = false; 1b756: 10 92 ef 03 sts 0x03EF, r1 ; 0x8003ef <_ZL23plan_reset_next_e_queue.lto_priv.448> plan_reset_next_e_sched = false; 1b75a: 10 92 ee 03 sts 0x03EE, r1 ; 0x8003ee <_ZL23plan_reset_next_e_sched.lto_priv.449> } void factory_reset() { KEEPALIVE_STATE(PAUSED_FOR_USER); 1b75e: 84 e0 ldi r24, 0x04 ; 4 1b760: 80 93 78 02 sts 0x0278, r24 ; 0x800278 if (!READ(BTN_ENC)) 1b764: 48 99 sbic 0x09, 0 ; 9 1b766: b0 c0 rjmp .+352 ; 0x1b8c8 1b768: bf ef ldi r27, 0xFF ; 255 1b76a: e3 ed ldi r30, 0xD3 ; 211 1b76c: f0 e3 ldi r31, 0x30 ; 48 1b76e: b1 50 subi r27, 0x01 ; 1 1b770: e0 40 sbci r30, 0x00 ; 0 1b772: f0 40 sbci r31, 0x00 ; 0 1b774: e1 f7 brne .-8 ; 0x1b76e 1b776: 00 c0 rjmp .+0 ; 0x1b778 1b778: 00 00 nop { _delay_ms(1000); if (!READ(BTN_ENC)) 1b77a: 48 99 sbic 0x09, 0 ; 9 1b77c: a5 c0 rjmp .+330 ; 0x1b8c8 { lcd_clear(); 1b77e: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_puts_P(PSTR("Factory RESET")); 1b782: 87 e3 ldi r24, 0x37 ; 55 1b784: 96 e8 ldi r25, 0x86 ; 134 1b786: 0e 94 66 69 call 0xd2cc ; 0xd2cc SET_OUTPUT(BEEPER); 1b78a: 6a 9a sbi 0x0d, 2 ; 13 if(eSoundMode!=e_SOUND_MODE_SILENT) 1b78c: 80 91 15 04 lds r24, 0x0415 ; 0x800415 1b790: 82 30 cpi r24, 0x02 ; 2 1b792: 09 f0 breq .+2 ; 0x1b796 WRITE(BEEPER, HIGH); 1b794: 72 9a sbi 0x0e, 2 ; 14 while (!READ(BTN_ENC)); 1b796: 48 9b sbis 0x09, 0 ; 9 1b798: fe cf rjmp .-4 ; 0x1b796 WRITE(BEEPER, LOW); 1b79a: 72 98 cbi 0x0e, 2 ; 14 1b79c: 2f ef ldi r18, 0xFF ; 255 1b79e: 37 ea ldi r19, 0xA7 ; 167 1b7a0: 81 e6 ldi r24, 0x61 ; 97 1b7a2: 21 50 subi r18, 0x01 ; 1 1b7a4: 30 40 sbci r19, 0x00 ; 0 1b7a6: 80 40 sbci r24, 0x00 ; 0 1b7a8: e1 f7 brne .-8 ; 0x1b7a2 1b7aa: 00 c0 rjmp .+0 ; 0x1b7ac 1b7ac: 00 00 nop PSTR("Language"), PSTR("Statistics"), PSTR("Shipping prep"), PSTR("Service prep"), PSTR("All Data"), }; 1b7ae: 8d e1 ldi r24, 0x1D ; 29 1b7b0: 96 e8 ldi r25, 0x86 ; 134 1b7b2: 9a 83 std Y+2, r25 ; 0x02 1b7b4: 89 83 std Y+1, r24 ; 0x01 1b7b6: 82 e1 ldi r24, 0x12 ; 18 1b7b8: 96 e8 ldi r25, 0x86 ; 134 1b7ba: 9c 83 std Y+4, r25 ; 0x04 1b7bc: 8b 83 std Y+3, r24 ; 0x03 1b7be: 84 e0 ldi r24, 0x04 ; 4 1b7c0: 96 e8 ldi r25, 0x86 ; 134 1b7c2: 9e 83 std Y+6, r25 ; 0x06 1b7c4: 8d 83 std Y+5, r24 ; 0x05 1b7c6: 87 ef ldi r24, 0xF7 ; 247 1b7c8: 95 e8 ldi r25, 0x85 ; 133 1b7ca: 98 87 std Y+8, r25 ; 0x08 1b7cc: 8f 83 std Y+7, r24 ; 0x07 1b7ce: 8e ee ldi r24, 0xEE ; 238 1b7d0: 95 e8 ldi r25, 0x85 ; 133 1b7d2: 9a 87 std Y+10, r25 ; 0x0a 1b7d4: 89 87 std Y+9, r24 ; 0x09 lcd_clear(); 1b7d6: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_putc_at(0, 0, '>'); 1b7da: 4e e3 ldi r20, 0x3E ; 62 1b7dc: 60 e0 ldi r22, 0x00 ; 0 1b7de: 80 e0 ldi r24, 0x00 ; 0 1b7e0: 0e 94 9b 69 call 0xd336 ; 0xd336 lcd_consume_click(); 1b7e4: 0e 94 93 6b call 0xd726 ; 0xd726 } } char reset_menu() { static int8_t first = 0; char cursor_pos = 0; 1b7e8: 10 e0 ldi r17, 0x00 ; 0 1b7ea: d1 2c mov r13, r1 1b7ec: c1 2c mov r12, r1 lcd_putc_at(0, 0, '>'); lcd_consume_click(); while (1) { for (uint_least8_t i = 0; i < 4; i++) { lcd_puts_at_P(1, i, item[first + i]); 1b7ee: 80 91 14 04 lds r24, 0x0414 ; 0x800414 1b7f2: f6 01 movw r30, r12 1b7f4: e8 0f add r30, r24 1b7f6: f1 1d adc r31, r1 1b7f8: 87 fd sbrc r24, 7 1b7fa: fa 95 dec r31 1b7fc: ee 0f add r30, r30 1b7fe: ff 1f adc r31, r31 1b800: ee 0d add r30, r14 1b802: ff 1d adc r31, r15 1b804: 40 81 ld r20, Z 1b806: 51 81 ldd r21, Z+1 ; 0x01 1b808: 6c 2d mov r22, r12 1b80a: 81 e0 ldi r24, 0x01 ; 1 1b80c: 0e 94 8f 69 call 0xd31e ; 0xd31e 1b810: 9f ef ldi r25, 0xFF ; 255 1b812: c9 1a sub r12, r25 1b814: d9 0a sbc r13, r25 lcd_clear(); lcd_putc_at(0, 0, '>'); lcd_consume_click(); while (1) { for (uint_least8_t i = 0; i < 4; i++) { 1b816: a4 e0 ldi r26, 0x04 ; 4 1b818: ca 16 cp r12, r26 1b81a: d1 04 cpc r13, r1 1b81c: 41 f7 brne .-48 ; 0x1b7ee lcd_puts_at_P(1, i, item[first + i]); } manage_heater(); 1b81e: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(true); 1b822: 81 e0 ldi r24, 0x01 ; 1 1b824: 0e 94 01 7a call 0xf402 ; 0xf402 if (lcd_encoder) { 1b828: 80 91 06 05 lds r24, 0x0506 ; 0x800506 1b82c: 90 91 07 05 lds r25, 0x0507 ; 0x800507 1b830: 00 97 sbiw r24, 0x00 ; 0 1b832: 71 f1 breq .+92 ; 0x1b890 if (lcd_encoder < 0) { 1b834: 97 ff sbrs r25, 7 1b836: 12 c0 rjmp .+36 ; 0x1b85c cursor_pos--; 1b838: 11 50 subi r17, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { 1b83a: 14 30 cpi r17, 0x04 ; 4 1b83c: 0c f4 brge .+2 ; 0x1b840 1b83e: 3a c2 rjmp .+1140 ; 0x1bcb4 cursor_pos = 3; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1b840: 87 e0 ldi r24, 0x07 ; 7 1b842: 0f 94 9f 2c call 0x2593e ; 0x2593e if (first < (uint8_t)(sizeof(item) / sizeof(item[0])) - 4) { 1b846: 80 91 14 04 lds r24, 0x0414 ; 0x800414 1b84a: 18 16 cp r1, r24 1b84c: 2c f0 brlt .+10 ; 0x1b858 first++; 1b84e: 8f 5f subi r24, 0xFF ; 255 1b850: 80 93 14 04 sts 0x0414, r24 ; 0x800414 lcd_clear(); 1b854: 0e 94 ae 69 call 0xd35c ; 0xd35c if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { cursor_pos = 3; 1b858: 13 e0 ldi r17, 0x03 ; 3 1b85a: 03 c0 rjmp .+6 ; 0x1b862 if (lcd_encoder < 0) { cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1b85c: 1f 5f subi r17, 0xFF ; 255 } if (cursor_pos > 3) { 1b85e: 14 30 cpi r17, 0x04 ; 4 1b860: 78 f7 brcc .-34 ; 0x1b840 if (first > 0) { first--; lcd_clear(); } } lcd_puts_at_P(0, 0, PSTR(" \n \n \n ")); 1b862: 46 ee ldi r20, 0xE6 ; 230 1b864: 55 e8 ldi r21, 0x85 ; 133 1b866: 60 e0 ldi r22, 0x00 ; 0 1b868: 80 e0 ldi r24, 0x00 ; 0 1b86a: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_set_cursor(0, cursor_pos); 1b86e: 61 2f mov r22, r17 1b870: 80 e0 ldi r24, 0x00 ; 0 1b872: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_putc('>'); 1b876: 8e e3 ldi r24, 0x3E ; 62 1b878: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 lcd_encoder = 0; 1b87c: 10 92 07 05 sts 0x0507, r1 ; 0x800507 1b880: 10 92 06 05 sts 0x0506, r1 ; 0x800506 _delay(100); 1b884: 64 e6 ldi r22, 0x64 ; 100 1b886: 70 e0 ldi r23, 0x00 ; 0 1b888: 80 e0 ldi r24, 0x00 ; 0 1b88a: 90 e0 ldi r25, 0x00 ; 0 1b88c: 0f 94 7b 0d call 0x21af6 ; 0x21af6 } if (lcd_clicked()) { 1b890: 0e 94 98 6b call 0xd730 ; 0xd730 1b894: 88 23 and r24, r24 1b896: 09 f4 brne .+2 ; 0x1b89a 1b898: a8 cf rjmp .-176 ; 0x1b7ea return(cursor_pos + first); 1b89a: 80 91 14 04 lds r24, 0x0414 ; 0x800414 1b89e: 18 0f add r17, r24 // Factory reset function // This function is used to erase parts or whole EEPROM memory which is used for storing calibration and and so on. // Level input parameter sets depth of reset static void factory_reset(char level) { lcd_clear(); 1b8a0: 0e 94 ae 69 call 0xd35c ; 0xd35c Sound_MakeCustom(100,0,false); 1b8a4: 40 e0 ldi r20, 0x00 ; 0 1b8a6: 70 e0 ldi r23, 0x00 ; 0 1b8a8: 60 e0 ldi r22, 0x00 ; 0 1b8aa: 84 e6 ldi r24, 0x64 ; 100 1b8ac: 90 e0 ldi r25, 0x00 ; 0 1b8ae: 0f 94 c5 31 call 0x2638a ; 0x2638a switch (level) { 1b8b2: 12 30 cpi r17, 0x02 ; 2 1b8b4: 09 f4 brne .+2 ; 0x1b8b8 1b8b6: 35 c2 rjmp .+1130 ; 0x1bd22 1b8b8: 08 f0 brcs .+2 ; 0x1b8bc 1b8ba: 0d c2 rjmp .+1050 ; 0x1bcd6 1b8bc: 11 23 and r17, r17 1b8be: 09 f4 brne .+2 ; 0x1b8c2 1b8c0: 28 c2 rjmp .+1104 ; 0x1bd12 1b8c2: 11 30 cpi r17, 0x01 ; 1 1b8c4: 09 f4 brne .+2 ; 0x1b8c8 1b8c6: 28 c2 rjmp .+1104 ; 0x1bd18 case 4: _delay_ms(0); break; } } } KEEPALIVE_STATE(IN_HANDLER); 1b8c8: 82 e0 ldi r24, 0x02 ; 2 1b8ca: 80 93 78 02 sts 0x0278, r24 ; 0x800278 plan_init(); // Initialize planner; factory_reset(); eeprom_init_default_byte((uint8_t*)EEPROM_SILENT, SILENT_MODE_OFF); 1b8ce: 60 e0 ldi r22, 0x00 ; 0 1b8d0: 8f ef ldi r24, 0xFF ; 255 1b8d2: 9f e0 ldi r25, 0x0F ; 15 1b8d4: 0e 94 ed 6e call 0xddda ; 0xddda eeprom_init_default_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard if uninitialized 1b8d8: 61 e0 ldi r22, 0x01 ; 1 1b8da: 8f e5 ldi r24, 0x5F ; 95 1b8dc: 9f e0 ldi r25, 0x0F ; 15 1b8de: 0e 94 ed 6e call 0xddda ; 0xddda void st_init() { #ifdef TMC2130 tmc2130_init(TMCInitParams(false, FarmOrUserECool())); #else st_current_init(); //Initialize Digipot Motor Current 1b8e2: 0f 94 b5 21 call 0x2436a ; 0x2436a SET_OUTPUT(E1_MS1_PIN); SET_OUTPUT(E1_MS2_PIN); #endif #if defined(X_MS1_PIN) && X_MS1_PIN > -1 const uint8_t microstep_modes[] = MICROSTEP_MODES; 1b8e6: 85 e0 ldi r24, 0x05 ; 5 1b8e8: e8 eb ldi r30, 0xB8 ; 184 1b8ea: f2 e0 ldi r31, 0x02 ; 2 1b8ec: d7 01 movw r26, r14 1b8ee: 01 90 ld r0, Z+ 1b8f0: 0d 92 st X+, r0 1b8f2: 8a 95 dec r24 1b8f4: e1 f7 brne .-8 ; 0x1b8ee SET_OUTPUT(X_MS1_PIN); 1b8f6: 99 9a sbi 0x13, 1 ; 19 SET_OUTPUT(X_MS2_PIN); 1b8f8: 98 9a sbi 0x13, 0 ; 19 SET_OUTPUT(Y_MS1_PIN); 1b8fa: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b8fe: 80 68 ori r24, 0x80 ; 128 1b900: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(Y_MS2_PIN); 1b904: 9a 9a sbi 0x13, 2 ; 19 SET_OUTPUT(Z_MS1_PIN); 1b906: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b90a: 80 64 ori r24, 0x40 ; 64 1b90c: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(Z_MS2_PIN); 1b910: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b914: 80 62 ori r24, 0x20 ; 32 1b916: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_MS1_PIN); 1b91a: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b91e: 88 60 ori r24, 0x08 ; 8 1b920: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_MS2_PIN); 1b924: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b928: 80 61 ori r24, 0x10 ; 16 1b92a: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b92e: 67 01 movw r12, r14 1b930: 10 e0 ldi r17, 0x00 ; 0 for(int i=0;i<=4;i++) microstep_mode(i,microstep_modes[i]); 1b932: f6 01 movw r30, r12 1b934: 61 91 ld r22, Z+ 1b936: 6f 01 movw r12, r30 1b938: 81 2f mov r24, r17 1b93a: 0f 94 78 21 call 0x242f0 ; 0x242f0 1b93e: 1f 5f subi r17, 0xFF ; 255 1b940: 15 30 cpi r17, 0x05 ; 5 1b942: b9 f7 brne .-18 ; 0x1b932 microstep_init(); //Initialize Microstepping Pins #endif //TMC2130 //Initialize Dir Pins #if defined(X_DIR_PIN) && X_DIR_PIN > -1 SET_OUTPUT(X_DIR_PIN); 1b944: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1b948: 82 60 ori r24, 0x02 ; 2 1b94a: 80 93 0a 01 sts 0x010A, r24 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> #endif #if defined(X2_DIR_PIN) && X2_DIR_PIN > -1 SET_OUTPUT(X2_DIR_PIN); #endif #if defined(Y_DIR_PIN) && Y_DIR_PIN > -1 SET_OUTPUT(Y_DIR_PIN); 1b94e: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1b952: 81 60 ori r24, 0x01 ; 1 1b954: 80 93 0a 01 sts 0x010A, r24 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> #endif #if defined(Z_DIR_PIN) && Z_DIR_PIN > -1 SET_OUTPUT(Z_DIR_PIN); 1b958: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1b95c: 84 60 ori r24, 0x04 ; 4 1b95e: 80 93 0a 01 sts 0x010A, r24 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> #endif #if defined(E0_DIR_PIN) && E0_DIR_PIN > -1 SET_OUTPUT(E0_DIR_PIN); 1b962: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1b966: 80 64 ori r24, 0x40 ; 64 1b968: 80 93 0a 01 sts 0x010A, r24 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> #endif //Initialize Enable Pins - steppers default to disabled. #if defined(X_ENABLE_PIN) && X_ENABLE_PIN > -1 SET_OUTPUT(X_ENABLE_PIN); 1b96c: 0f 9a sbi 0x01, 7 ; 1 if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH); 1b96e: 17 9a sbi 0x02, 7 ; 2 #if defined(X2_ENABLE_PIN) && X2_ENABLE_PIN > -1 SET_OUTPUT(X2_ENABLE_PIN); if(!X_ENABLE_ON) WRITE(X2_ENABLE_PIN,HIGH); #endif #if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN > -1 SET_OUTPUT(Y_ENABLE_PIN); 1b970: 0e 9a sbi 0x01, 6 ; 1 if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH); 1b972: 16 9a sbi 0x02, 6 ; 2 #endif #if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN > -1 SET_OUTPUT(Z_ENABLE_PIN); 1b974: 0d 9a sbi 0x01, 5 ; 1 if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH); 1b976: 15 9a sbi 0x02, 5 ; 2 #endif #if defined(E0_ENABLE_PIN) && (E0_ENABLE_PIN > -1) SET_OUTPUT(E0_ENABLE_PIN); 1b978: 0c 9a sbi 0x01, 4 ; 1 if(!E_ENABLE_ON) WRITE(E0_ENABLE_PIN,HIGH); 1b97a: 14 9a sbi 0x02, 4 ; 2 #endif //endstops and pullups #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SET_INPUT(X_MIN_PIN); 1b97c: 26 98 cbi 0x04, 6 ; 4 #ifdef ENDSTOPPULLUP_XMIN WRITE(X_MIN_PIN,HIGH); 1b97e: 2e 9a sbi 0x05, 6 ; 5 #endif #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SET_INPUT(Y_MIN_PIN); 1b980: 25 98 cbi 0x04, 5 ; 4 #ifdef ENDSTOPPULLUP_YMIN WRITE(Y_MIN_PIN,HIGH); 1b982: 2d 9a sbi 0x05, 5 ; 5 #endif #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SET_INPUT(Z_MIN_PIN); 1b984: 24 98 cbi 0x04, 4 ; 4 #ifdef ENDSTOPPULLUP_ZMIN WRITE(Z_MIN_PIN,HIGH); 1b986: 2c 9a sbi 0x05, 4 ; 5 WRITE(Y_MAX_PIN,HIGH); #endif #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SET_INPUT(Z_MAX_PIN); 1b988: 09 98 cbi 0x01, 1 ; 1 #ifdef ENDSTOPPULLUP_ZMAX WRITE(Z_MAX_PIN,HIGH); 1b98a: 11 9a sbi 0x02, 1 ; 2 #endif #endif #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1)) SET_INPUT(TACH_0); 1b98c: 3f 98 cbi 0x07, 7 ; 7 #ifdef TACH0PULLUP WRITE(TACH_0, HIGH); 1b98e: 47 9a sbi 0x08, 7 ; 8 #endif //Initialize Step Pins #if defined(X_STEP_PIN) && (X_STEP_PIN > -1) SET_OUTPUT(X_STEP_PIN); 1b990: 38 9a sbi 0x07, 0 ; 7 WRITE(X_STEP_PIN,INVERT_X_STEP_PIN); 1b992: 40 98 cbi 0x08, 0 ; 8 #ifdef DEBUG_XSTEP_DUP_PIN SET_OUTPUT(DEBUG_XSTEP_DUP_PIN); WRITE(DEBUG_XSTEP_DUP_PIN,INVERT_X_STEP_PIN); #endif //DEBUG_XSTEP_DUP_PIN disable_x(); 1b994: 17 9a sbi 0x02, 7 ; 2 1b996: 10 92 a3 06 sts 0x06A3, r1 ; 0x8006a3 SET_OUTPUT(X2_STEP_PIN); WRITE(X2_STEP_PIN,INVERT_X_STEP_PIN); disable_x(); #endif #if defined(Y_STEP_PIN) && (Y_STEP_PIN > -1) SET_OUTPUT(Y_STEP_PIN); 1b99a: 39 9a sbi 0x07, 1 ; 7 WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN); 1b99c: 41 98 cbi 0x08, 1 ; 8 #ifdef DEBUG_YSTEP_DUP_PIN SET_OUTPUT(DEBUG_YSTEP_DUP_PIN); WRITE(DEBUG_YSTEP_DUP_PIN,INVERT_Y_STEP_PIN); #endif //DEBUG_YSTEP_DUP_PIN disable_y(); 1b99e: 16 9a sbi 0x02, 6 ; 2 1b9a0: 10 92 a4 06 sts 0x06A4, r1 ; 0x8006a4 #endif #if defined(Z_STEP_PIN) && (Z_STEP_PIN > -1) SET_OUTPUT(Z_STEP_PIN); 1b9a4: 3a 9a sbi 0x07, 2 ; 7 WRITE(Z_STEP_PIN,INVERT_Z_STEP_PIN); 1b9a6: 42 98 cbi 0x08, 2 ; 8 init_force_z(); #endif // PSU_Delta disable_z(); #endif #if defined(E0_STEP_PIN) && (E0_STEP_PIN > -1) SET_OUTPUT(E0_STEP_PIN); 1b9a8: 3b 9a sbi 0x07, 3 ; 7 WRITE(E0_STEP_PIN,INVERT_E_STEP_PIN); 1b9aa: 43 98 cbi 0x08, 3 ; 8 disable_e0(); 1b9ac: 14 9a sbi 0x02, 4 ; 2 #endif // waveform generation = 0100 = CTC TCCR1B &= ~(1< 1b9b2: 8f 7e andi r24, 0xEF ; 239 1b9b4: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1B |= (1< 1b9bc: 88 60 ori r24, 0x08 ; 8 1b9be: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1A &= ~(1< 1b9c6: 8d 7f andi r24, 0xFD ; 253 1b9c8: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(1< 1b9d0: 8e 7f andi r24, 0xFE ; 254 1b9d2: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> // output mode = 00 (disconnected) TCCR1A &= ~(3< 1b9da: 8f 73 andi r24, 0x3F ; 63 1b9dc: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(3< 1b9e4: 8f 7c andi r24, 0xCF ; 207 1b9e6: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> // Set the timer pre-scaler // Generally we use a divider of 8, resulting in a 2MHz timer // frequency on a 16MHz MCU. If you are going to change this, be // sure to regenerate speed_lookuptable.h with // create_speed_lookuptable.py TCCR1B = (TCCR1B & ~(0x07< 1b9ee: 88 7f andi r24, 0xF8 ; 248 1b9f0: 82 60 ori r24, 0x02 ; 2 1b9f2: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // Plan the first interrupt after 8ms from now. OCR1A = 0x4000; 1b9f6: 80 e0 ldi r24, 0x00 ; 0 1b9f8: 90 e4 ldi r25, 0x40 ; 64 1b9fa: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 1b9fe: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> TCNT1 = 0; 1ba02: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 1ba06: 10 92 84 00 sts 0x0084, r1 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> WRITE_NC(LOGIC_ANALYZER_CH0, false); WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif // Initialize state for the linear advance scheduler nextMainISR = 0; 1ba0a: 10 92 1d 04 sts 0x041D, r1 ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 1ba0e: 10 92 1c 04 sts 0x041C, r1 ; 0x80041c <_ZL11nextMainISR.lto_priv.435> nextAdvanceISR = ADV_NEVER; 1ba12: 8f ef ldi r24, 0xFF ; 255 1ba14: 9f ef ldi r25, 0xFF ; 255 1ba16: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 1ba1a: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> main_Rate = ADV_NEVER; 1ba1e: 90 93 19 04 sts 0x0419, r25 ; 0x800419 <_ZL9main_Rate.lto_priv.437+0x1> 1ba22: 80 93 18 04 sts 0x0418, r24 ; 0x800418 <_ZL9main_Rate.lto_priv.437> current_adv_steps = 0; 1ba26: 10 92 17 04 sts 0x0417, r1 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 1ba2a: 10 92 16 04 sts 0x0416, r1 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; 1ba2e: 81 e0 ldi r24, 0x01 ; 1 1ba30: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.364> current_adv_steps = 0; #endif enable_endstops(true); // Start with endstops active. After homing they can be disabled ENABLE_STEPPER_DRIVER_INTERRUPT(); 1ba34: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 1ba38: 82 60 ori r24, 0x02 ; 2 1ba3a: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> sei(); 1ba3e: 78 94 sei setup_photpin(); // Reset the machine correction matrix. // It does not make sense to load the correction matrix until the machine is homed. world2machine_reset(); 1ba40: 0f 94 23 8f call 0x31e46 ; 0x31e46 // Initialize current_position accounting for software endstops to // avoid unexpected initial shifts on the first move clamp_to_software_endstops(current_position); 1ba44: 85 ef ldi r24, 0xF5 ; 245 1ba46: 91 e1 ldi r25, 0x11 ; 17 1ba48: 0e 94 c5 64 call 0xc98a ; 0xc98a plan_set_position_curposXYZE(); 1ba4c: 0f 94 30 83 call 0x30660 ; 0x30660 } #define KILL_PENDING_FLAG 0x42 static void fw_kill_init() { if (eeprom_read_byte((uint8_t*)EEPROM_KILL_PENDING_FLAG) == KILL_PENDING_FLAG) { 1ba50: 84 e9 ldi r24, 0x94 ; 148 1ba52: 9c e0 ldi r25, 0x0C ; 12 1ba54: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1ba58: 82 34 cpi r24, 0x42 ; 66 1ba5a: 59 f4 brne .+22 ; 0x1ba72 if (active) { uint8_t previous_value = eeprom_read_byte(dst); eeprom_byte_notify(dst, previous_value, value, true); } #endif //DEBUG_EEPROM_CHANGES eeprom_write_byte(dst, value); 1ba5c: 6f ef ldi r22, 0xFF ; 255 1ba5e: 84 e9 ldi r24, 0x94 ; 148 1ba60: 9c e0 ldi r25, 0x0C ; 12 1ba62: 0f 94 24 a0 call 0x34048 ; 0x34048 // clear pending message event eeprom_write_byte_notify((uint8_t*)EEPROM_KILL_PENDING_FLAG, EEPROM_EMPTY_VALUE); // display the kill message PGM_P kill_msg = (PGM_P)eeprom_read_word((uint16_t*)EEPROM_KILL_MESSAGE); 1ba66: 85 e9 ldi r24, 0x95 ; 149 1ba68: 9c e0 ldi r25, 0x0C ; 12 1ba6a: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 lcd_show_fullscreen_message_and_wait_P(kill_msg); 1ba6e: 0f 94 47 0b call 0x2168e ; 0x2168e // report kill() events fw_kill_init(); #ifdef FILAMENT_SENSOR fsensor.init(); 1ba72: 0f 94 3e 53 call 0x2a67c ; 0x2a67c #endif setup_homepin(); #if defined(Z_AXIS_ALWAYS_ON) enable_z(); 1ba76: 15 98 cbi 0x02, 5 ; 2 #endif // The farm monitoring SW may accidentally expect // 2 messages of "printer started" to consider a printer working. prusa_statistics(8); 1ba78: 88 e0 ldi r24, 0x08 ; 8 1ba7a: 0f 94 ff 97 call 0x32ffe ; 0x32ffe // Enable Toshiba FlashAir SD card / WiFi enahanced card. card.ToshibaFlashAir_enable(eeprom_read_byte((unsigned char*)EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY) == 1); 1ba7e: 8b eb ldi r24, 0xBB ; 187 1ba80: 9f e0 ldi r25, 0x0F ; 15 1ba82: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1ba86: 91 e0 ldi r25, 0x01 ; 1 1ba88: 81 30 cpi r24, 0x01 ; 1 1ba8a: 09 f0 breq .+2 ; 0x1ba8e 1ba8c: 90 e0 ldi r25, 0x00 ; 0 bool writeStop(); // Toshiba FlashAir support uint8_t readExtMemory(uint8_t mio, uint8_t func, uint32_t addr, uint16_t count, uint8_t* dst); void setFlashAirCompatible(bool flashAirCompatible) { flash_air_compatible_ = flashAirCompatible; } 1ba8e: 90 93 db 15 sts 0x15DB, r25 ; 0x8015db // Force SD card update. Otherwise the SD card update is done from loop() on card.checkautostart(false), // but this times out if a blocking dialog is shown in setup(). card.mount(); 1ba92: 81 e0 ldi r24, 0x01 ; 1 1ba94: 0f 94 7d 4d call 0x29afa ; 0x29afa #include #include void eeprom_init() { eeprom_init_default_byte((uint8_t*)EEPROM_POWER_COUNT, 0); 1ba98: 60 e0 ldi r22, 0x00 ; 0 1ba9a: 84 e6 ldi r24, 0x64 ; 100 1ba9c: 9f e0 ldi r25, 0x0F ; 15 1ba9e: 0e 94 ed 6e call 0xddda ; 0xddda eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_X, 0); 1baa2: 60 e0 ldi r22, 0x00 ; 0 1baa4: 86 e6 ldi r24, 0x66 ; 102 1baa6: 9f e0 ldi r25, 0x0F ; 15 1baa8: 0e 94 ed 6e call 0xddda ; 0xddda eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_Y, 0); 1baac: 60 e0 ldi r22, 0x00 ; 0 1baae: 88 e6 ldi r24, 0x68 ; 104 1bab0: 9f e0 ldi r25, 0x0F ; 15 1bab2: 0e 94 ed 6e call 0xddda ; 0xddda eeprom_init_default_byte((uint8_t*)EEPROM_FERROR_COUNT, 0); 1bab6: 60 e0 ldi r22, 0x00 ; 0 1bab8: 85 e6 ldi r24, 0x65 ; 101 1baba: 9f e0 ldi r25, 0x0F ; 15 1babc: 0e 94 ed 6e call 0xddda ; 0xddda eeprom_init_default_word((uint16_t*)EEPROM_POWER_COUNT_TOT, 0); 1bac0: 70 e0 ldi r23, 0x00 ; 0 1bac2: 60 e0 ldi r22, 0x00 ; 0 1bac4: 8f ef ldi r24, 0xFF ; 255 1bac6: 9e e0 ldi r25, 0x0E ; 14 1bac8: 0e 94 d5 6e call 0xddaa ; 0xddaa eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT, 0); 1bacc: 70 e0 ldi r23, 0x00 ; 0 1bace: 60 e0 ldi r22, 0x00 ; 0 1bad0: 85 e0 ldi r24, 0x05 ; 5 1bad2: 9f e0 ldi r25, 0x0F ; 15 1bad4: 0e 94 d5 6e call 0xddaa ; 0xddaa eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT, 0); 1bad8: 70 e0 ldi r23, 0x00 ; 0 1bada: 60 e0 ldi r22, 0x00 ; 0 1badc: 83 e0 ldi r24, 0x03 ; 3 1bade: 9f e0 ldi r25, 0x0F ; 15 1bae0: 0e 94 d5 6e call 0xddaa ; 0xddaa eeprom_init_default_word((uint16_t*)EEPROM_FERROR_COUNT_TOT, 0); 1bae4: 70 e0 ldi r23, 0x00 ; 0 1bae6: 60 e0 ldi r22, 0x00 ; 0 1bae8: 81 e0 ldi r24, 0x01 ; 1 1baea: 9f e0 ldi r25, 0x0F ; 15 1baec: 0e 94 d5 6e call 0xddaa ; 0xddaa eeprom_init_default_word((uint16_t*)EEPROM_MMU_FAIL_TOT, 0); 1baf0: 70 e0 ldi r23, 0x00 ; 0 1baf2: 60 e0 ldi r22, 0x00 ; 0 1baf4: 83 ed ldi r24, 0xD3 ; 211 1baf6: 9e e0 ldi r25, 0x0E ; 14 1baf8: 0e 94 d5 6e call 0xddaa ; 0xddaa eeprom_init_default_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT, 0); 1bafc: 70 e0 ldi r23, 0x00 ; 0 1bafe: 60 e0 ldi r22, 0x00 ; 0 1bb00: 80 ed ldi r24, 0xD0 ; 208 1bb02: 9e e0 ldi r25, 0x0E ; 14 1bb04: 0e 94 d5 6e call 0xddaa ; 0xddaa eeprom_init_default_byte((uint8_t*)EEPROM_MMU_FAIL, 0); 1bb08: 60 e0 ldi r22, 0x00 ; 0 1bb0a: 82 ed ldi r24, 0xD2 ; 210 1bb0c: 9e e0 ldi r25, 0x0E ; 14 1bb0e: 0e 94 ed 6e call 0xddda ; 0xddda eeprom_init_default_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL, 0); 1bb12: 60 e0 ldi r22, 0x00 ; 0 1bb14: 8f ec ldi r24, 0xCF ; 207 1bb16: 9e e0 ldi r25, 0x0E ; 14 1bb18: 0e 94 ed 6e call 0xddda ; 0xddda eeprom_init_default_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES, 0); 1bb1c: 88 ea ldi r24, 0xA8 ; 168 1bb1e: 9c e0 ldi r25, 0x0C ; 12 1bb20: 0f 94 b7 48 call 0x2916e ; 0x2916e if (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == EEPROM_EMPTY_VALUE) 1bb24: 81 ea ldi r24, 0xA1 ; 161 1bb26: 9d e0 ldi r25, 0x0D ; 13 1bb28: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1bb2c: 8f 3f cpi r24, 0xFF ; 255 1bb2e: 71 f4 brne .+28 ; 0x1bb4c if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1bb30: 60 e0 ldi r22, 0x00 ; 0 1bb32: 81 ea ldi r24, 0xA1 ; 161 1bb34: 9d e0 ldi r25, 0x0D ; 13 1bb36: 0f 94 00 a0 call 0x34000 ; 0x34000 if (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == EEPROM_EMPTY_VALUE) { eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), 0); // When upgrading from version older version (before multiple sheets were implemented in v3.8.0) // Sheet 1 uses the previous Live adjust Z (@EEPROM_BABYSTEP_Z) int last_babystep = eeprom_read_word((uint16_t *)EEPROM_BABYSTEP_Z); 1bb3a: 88 ef ldi r24, 0xF8 ; 248 1bb3c: 9f e0 ldi r25, 0x0F ; 15 1bb3e: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 eeprom_update_word(reinterpret_cast(&(EEPROM_Sheets_base->s[0].z_offset)), last_babystep); 1bb42: bc 01 movw r22, r24 1bb44: 80 e5 ldi r24, 0x50 ; 80 1bb46: 9d e0 ldi r25, 0x0D ; 13 1bb48: 0f 94 1e a0 call 0x3403c ; 0x3403c SET_OUTPUT(Y_MS1_PIN); SET_OUTPUT(Y_MS2_PIN); SET_OUTPUT(Z_MS1_PIN); SET_OUTPUT(Z_MS2_PIN); SET_OUTPUT(E0_MS1_PIN); SET_OUTPUT(E0_MS2_PIN); 1bb4c: 49 e4 ldi r20, 0x49 ; 73 1bb4e: c4 2e mov r12, r20 1bb50: 4d e0 ldi r20, 0x0D ; 13 1bb52: d4 2e mov r13, r20 1bb54: 10 e0 ldi r17, 0x00 ; 0 } // initialize the sheet names in eeprom for (uint_least8_t i = 0; i < (sizeof(Sheets::s)/sizeof(Sheets::s[0])); i++) { SheetName sheetName; eeprom_default_sheet_name(i, sheetName); 1bb56: b7 01 movw r22, r14 1bb58: 81 2f mov r24, r17 1bb5a: 0e 94 48 6f call 0xde90 ; 0xde90 eeprom_init_default_block(EEPROM_Sheets_base->s[i].name, (sizeof(Sheet::name)/sizeof(Sheet::name[0])), sheetName.c); 1bb5e: a7 01 movw r20, r14 1bb60: 67 e0 ldi r22, 0x07 ; 7 1bb62: 70 e0 ldi r23, 0x00 ; 0 1bb64: c6 01 movw r24, r12 1bb66: 0e 94 b6 6e call 0xdd6c ; 0xdd6c int last_babystep = eeprom_read_word((uint16_t *)EEPROM_BABYSTEP_Z); eeprom_update_word(reinterpret_cast(&(EEPROM_Sheets_base->s[0].z_offset)), last_babystep); } // initialize the sheet names in eeprom for (uint_least8_t i = 0; i < (sizeof(Sheets::s)/sizeof(Sheets::s[0])); i++) { 1bb6a: 1f 5f subi r17, 0xFF ; 255 1bb6c: fb e0 ldi r31, 0x0B ; 11 1bb6e: cf 0e add r12, r31 1bb70: d1 1c adc r13, r1 1bb72: 18 30 cpi r17, 0x08 ; 8 1bb74: 81 f7 brne .-32 ; 0x1bb56 SheetName sheetName; eeprom_default_sheet_name(i, sheetName); eeprom_init_default_block(EEPROM_Sheets_base->s[i].name, (sizeof(Sheet::name)/sizeof(Sheet::name[0])), sheetName.c); } if(!eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))) 1bb76: 81 ea ldi r24, 0xA1 ; 161 1bb78: 9d e0 ldi r25, 0x0D ; 13 1bb7a: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1bb7e: 0e 94 18 6f call 0xde30 ; 0xde30 1bb82: 81 11 cpse r24, r1 1bb84: 02 c0 rjmp .+4 ; 0x1bb8a { eeprom_switch_to_next_sheet(); 1bb86: 0e 94 3a 6f call 0xde74 ; 0xde74 } check_babystep(); 1bb8a: 0e 94 b2 72 call 0xe564 ; 0xe564 // initialize custom mendel name in eeprom if (eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_MENDEL_NAME) == EEPROM_EMPTY_VALUE) { 1bb8e: 80 e8 ldi r24, 0x80 ; 128 1bb90: 9c e0 ldi r25, 0x0C ; 12 1bb92: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1bb96: 8f 3f cpi r24, 0xFF ; 255 1bb98: 41 f4 brne .+16 ; 0x1bbaa #endif //DEBUG_EEPROM_CHANGES } #ifndef DEBUG_EEPROM_CHANGES void eeprom_update_block_notify(const void *__src, void *__dst, size_t __n){ eeprom_update_block(__src, __dst, __n); 1bb9a: 40 e1 ldi r20, 0x10 ; 16 1bb9c: 50 e0 ldi r21, 0x00 ; 0 1bb9e: 60 e8 ldi r22, 0x80 ; 128 1bba0: 7c e0 ldi r23, 0x0C ; 12 1bba2: 88 ec ldi r24, 0xC8 ; 200 1bba4: 92 e0 ldi r25, 0x02 ; 2 1bba6: 0f 94 f0 9f call 0x33fe0 ; 0x33fe0 //SERIAL_ECHOLN("Init Custom Mendel Name"); eeprom_update_block_notify(CUSTOM_MENDEL_NAME, (uint8_t*)EEPROM_CUSTOM_MENDEL_NAME, sizeof(CUSTOM_MENDEL_NAME)); } //else SERIAL_ECHOLN("Found Custom Mendel Name"); #ifdef PINDA_TEMP_COMP eeprom_init_default_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION, 0); 1bbaa: 60 e0 ldi r22, 0x00 ; 0 1bbac: 89 e2 ldi r24, 0x29 ; 41 1bbae: 9d e0 ldi r25, 0x0D ; 13 1bbb0: 0e 94 ed 6e call 0xddda ; 0xddda #endif //PINDA_TEMP_COMP eeprom_init_default_dword((uint32_t*)EEPROM_JOB_ID, 0); 1bbb4: 85 e0 ldi r24, 0x05 ; 5 1bbb6: 9d e0 ldi r25, 0x0D ; 13 1bbb8: 0f 94 b7 48 call 0x2916e ; 0x2916e eeprom_init_default_dword((uint32_t*)EEPROM_TOTALTIME, 0); 1bbbc: 8d ee ldi r24, 0xED ; 237 1bbbe: 9f e0 ldi r25, 0x0F ; 15 1bbc0: 0f 94 b7 48 call 0x2916e ; 0x2916e eeprom_init_default_dword((uint32_t*)EEPROM_FILAMENTUSED, 0); 1bbc4: 81 ef ldi r24, 0xF1 ; 241 1bbc6: 9f e0 ldi r25, 0x0F ; 15 1bbc8: 0f 94 b7 48 call 0x2916e ; 0x2916e eeprom_init_default_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 0); 1bbcc: 60 e0 ldi r22, 0x00 ; 0 1bbce: 8e ec ldi r24, 0xCE ; 206 1bbd0: 9e e0 ldi r25, 0x0E ; 14 1bbd2: 0e 94 ed 6e call 0xddda ; 0xddda eeprom_init_default_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, 1); 1bbd6: 61 e0 ldi r22, 0x01 ; 1 1bbd8: 87 ea ldi r24, 0xA7 ; 167 1bbda: 9c e0 ldi r25, 0x0C ; 12 1bbdc: 0e 94 ed 6e call 0xddda ; 0xddda putchar('\n'); list_sec_lang_from_external_flash(); #endif //DEBUG_XFLASH // lang_reset(); if (!lang_select(eeprom_read_byte((uint8_t*)EEPROM_LANG))) 1bbe0: 8e ef ldi r24, 0xFE ; 254 1bbe2: 9f e0 ldi r25, 0x0F ; 15 1bbe4: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1bbe8: 0e 94 45 6c call 0xd88a ; 0xd88a 1bbec: 81 11 cpse r24, r1 1bbee: 02 c0 rjmp .+4 ; 0x1bbf4 lcd_language(); 1bbf0: 0e 94 28 fe call 0x1fc50 ; 0x1fc50 lang_print_sec_lang(); #endif //DEBUG_SEC_LANG #endif //(LANG_MODE != 0) eeprom_init_default_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0); 1bbf4: 60 e0 ldi r22, 0x00 ; 0 1bbf6: 8f ea ldi r24, 0xAF ; 175 1bbf8: 9f e0 ldi r25, 0x0F ; 15 1bbfa: 0e 94 ed 6e call 0xddda ; 0xddda if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA) == 255) { 1bbfe: 86 ea ldi r24, 0xA6 ; 166 1bc00: 9f e0 ldi r25, 0x0F ; 15 1bc02: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1bc06: 8f 3f cpi r24, 0xFF ; 255 1bc08: d9 f4 brne .+54 ; 0x1bc40 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1bc0a: 61 e0 ldi r22, 0x01 ; 1 1bc0c: 86 ea ldi r24, 0xA6 ; 166 1bc0e: 9f e0 ldi r25, 0x0F ; 15 1bc10: 0f 94 00 a0 call 0x34000 ; 0x34000 1bc14: 30 eb ldi r19, 0xB0 ; 176 1bc16: e3 2e mov r14, r19 1bc18: 3f e0 ldi r19, 0x0F ; 15 1bc1a: f3 2e mov r15, r19 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 1bc1c: 70 e0 ldi r23, 0x00 ; 0 1bc1e: 60 e0 ldi r22, 0x00 ; 0 1bc20: c7 01 movw r24, r14 1bc22: 0f 94 1e a0 call 0x3403c ; 0x3403c 1bc26: 22 e0 ldi r18, 0x02 ; 2 1bc28: e2 0e add r14, r18 1bc2a: f1 1c adc r15, r1 //eeprom_write_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0); eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 1); int16_t z_shift = 0; for (uint8_t i = 0; i < 5; i++) { 1bc2c: 3a eb ldi r19, 0xBA ; 186 1bc2e: e3 16 cp r14, r19 1bc30: 3f e0 ldi r19, 0x0F ; 15 1bc32: f3 06 cpc r15, r19 1bc34: 99 f7 brne .-26 ; 0x1bc1c if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1bc36: 60 e0 ldi r22, 0x00 ; 0 1bc38: 8f ea ldi r24, 0xAF ; 175 1bc3a: 9f e0 ldi r25, 0x0F ; 15 1bc3c: 0f 94 00 a0 call 0x34000 ; 0x34000 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } eeprom_update_byte_notify((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0); } eeprom_init_default_byte((uint8_t*)EEPROM_UVLO, PowerPanic::NO_PENDING_RECOVERY); 1bc40: 60 e0 ldi r22, 0x00 ; 0 1bc42: 85 ea ldi r24, 0xA5 ; 165 1bc44: 9f e0 ldi r25, 0x0F ; 15 1bc46: 0e 94 ed 6e call 0xddda ; 0xddda eeprom_init_default_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED, 0); 1bc4a: 60 e0 ldi r22, 0x00 ; 0 1bc4c: 8f e7 ldi r24, 0x7F ; 127 1bc4e: 9c e0 ldi r25, 0x0C ; 12 1bc50: 0e 94 ed 6e call 0xddda ; 0xddda eeprom_init_default_byte((uint8_t*)EEPROM_SD_SORT, 0); 1bc54: 60 e0 ldi r22, 0x00 ; 0 1bc56: 89 e0 ldi r24, 0x09 ; 9 1bc58: 9f e0 ldi r25, 0x0F ; 15 1bc5a: 0e 94 ed 6e call 0xddda ; 0xddda } void mbl_settings_init() { //3x3 mesh; 3 Z-probes on each point, magnet elimination on //magnet elimination: use aaproximate Z-coordinate instead of measured values for points which are near magnets eeprom_init_default_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION, 1); 1bc5e: 61 e0 ldi r22, 0x01 ; 1 1bc60: 8c ea ldi r24, 0xAC ; 172 1bc62: 9d e0 ldi r25, 0x0D ; 13 1bc64: 0e 94 ed 6e call 0xddda ; 0xddda eeprom_init_default_byte((uint8_t*)EEPROM_MBL_POINTS_NR, 3); 1bc68: 63 e0 ldi r22, 0x03 ; 3 1bc6a: 8b ea ldi r24, 0xAB ; 171 1bc6c: 9d e0 ldi r25, 0x0D ; 13 1bc6e: 0e 94 ed 6e call 0xddda ; 0xddda eeprom_init_default_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3); 1bc72: 63 e0 ldi r22, 0x03 ; 3 1bc74: 8a ea ldi r24, 0xAA ; 170 1bc76: 9d e0 ldi r25, 0x0D ; 13 1bc78: 0e 94 ed 6e call 0xddda ; 0xddda //mbl_mode_init(); mbl_settings_init(); eeprom_init_default_byte((uint8_t*)EEPROM_MMU_STEALTH, 1); 1bc7c: 61 e0 ldi r22, 0x01 ; 1 1bc7e: 89 ea ldi r24, 0xA9 ; 169 1bc80: 9d e0 ldi r25, 0x0D ; 13 1bc82: 0e 94 ed 6e call 0xddda ; 0xddda #if (!defined(DEBUG_DISABLE_FANCHECK) && defined(FANCHECK) && defined(TACH_1) && (TACH_1 >-1)) setup_fan_interrupt(); #endif //DEBUG_DISABLE_FANCHECK #ifndef DEBUG_DISABLE_STARTMSGS KEEPALIVE_STATE(PAUSED_FOR_USER); 1bc86: 84 e0 ldi r24, 0x04 ; 4 1bc88: 80 93 78 02 sts 0x0278, r24 ; 0x800278 #if defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) check_if_fw_is_on_right_printer(); #endif //defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) } switch (hw_changed) { 1bc8c: 02 30 cpi r16, 0x02 ; 2 1bc8e: 09 f4 brne .+2 ; 0x1bc92 1bc90: 6e c0 rjmp .+220 ; 0x1bd6e 1bc92: 03 30 cpi r16, 0x03 ; 3 1bc94: 09 f4 brne .+2 ; 0x1bc98 1bc96: 0f c1 rjmp .+542 ; 0x1beb6 1bc98: 01 30 cpi r16, 0x01 ; 1 1bc9a: 09 f0 breq .+2 ; 0x1bc9e 1bc9c: 74 c0 rjmp .+232 ; 0x1bd86 //if motherboard or printer type was changed inform user as it can indicate flashing wrong firmware version //if user confirms with knob, new hw version (printer and/or motherboard) is written to eeprom and message will be not shown next time case(0b01): lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHANGED_MOTHERBOARD)); 1bc9e: 8f e7 ldi r24, 0x7F ; 127 1bca0: 93 e4 ldi r25, 0x43 ; 67 1bca2: 0e 94 b1 6c call 0xd962 ; 0xd962 1bca6: 0f 94 47 0b call 0x2168e ; 0x2168e if (active) { uint16_t previous_value = eeprom_read_word(dst); eeprom_word_notify(dst, previous_value, value, true); } #endif //DEBUG_EEPROM_CHANGES eeprom_write_word(dst, value); 1bcaa: 68 ec ldi r22, 0xC8 ; 200 1bcac: 70 e0 ldi r23, 0x00 ; 0 1bcae: 8c ee ldi r24, 0xEC ; 236 1bcb0: 9e e0 ldi r25, 0x0E ; 14 1bcb2: 67 c0 rjmp .+206 ; 0x1bd82 first++; lcd_clear(); } } if (cursor_pos < 0) { 1bcb4: 1f 3f cpi r17, 0xFF ; 255 1bcb6: 09 f0 breq .+2 ; 0x1bcba 1bcb8: d4 cd rjmp .-1112 ; 0x1b862 cursor_pos = 0; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1bcba: 87 e0 ldi r24, 0x07 ; 7 1bcbc: 0f 94 9f 2c call 0x2593e ; 0x2593e if (first > 0) { 1bcc0: 80 91 14 04 lds r24, 0x0414 ; 0x800414 1bcc4: 18 16 cp r1, r24 1bcc6: 2c f4 brge .+10 ; 0x1bcd2 first--; 1bcc8: 81 50 subi r24, 0x01 ; 1 1bcca: 80 93 14 04 sts 0x0414, r24 ; 0x800414 lcd_clear(); 1bcce: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_clear(); } } if (cursor_pos < 0) { cursor_pos = 0; 1bcd2: 10 e0 ldi r17, 0x00 ; 0 1bcd4: c6 cd rjmp .-1140 ; 0x1b862 // Level input parameter sets depth of reset static void factory_reset(char level) { lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { 1bcd6: 13 30 cpi r17, 0x03 ; 3 1bcd8: 31 f1 breq .+76 ; 0x1bd26 1bcda: 14 30 cpi r17, 0x04 ; 4 1bcdc: 09 f0 breq .+2 ; 0x1bce0 1bcde: f4 cd rjmp .-1048 ; 0x1b8c8 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //FILAMENT_SENSOR break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); 1bce0: 66 e2 ldi r22, 0x26 ; 38 1bce2: 76 e8 ldi r23, 0x86 ; 134 1bce4: 80 e0 ldi r24, 0x00 ; 0 1bce6: 90 e1 ldi r25, 0x10 ; 16 1bce8: 0f 94 1e 91 call 0x3223c ; 0x3223c // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 1bcec: 10 e0 ldi r17, 0x00 ; 0 1bcee: 00 e0 ldi r16, 0x00 ; 0 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1bcf0: 6f ef ldi r22, 0xFF ; 255 1bcf2: c8 01 movw r24, r16 1bcf4: 0f 94 00 a0 call 0x34000 ; 0x34000 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); 1bcf8: c8 01 movw r24, r16 1bcfa: 0f 94 ef 90 call 0x321de ; 0x321de break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 1bcfe: 0f 5f subi r16, 0xFF ; 255 1bd00: 1f 4f sbci r17, 0xFF ; 255 1bd02: 01 15 cp r16, r1 1bd04: b0 e1 ldi r27, 0x10 ; 16 1bd06: 1b 07 cpc r17, r27 1bd08: 99 f7 brne .-26 ; 0x1bcf0 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); } menu_progressbar_finish(); 1bd0a: 0f 94 10 91 call 0x32220 ; 0x32220 softReset(); 1bd0e: 0e 94 a7 60 call 0xc14e ; 0xc14e lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 1bd12: 0e 94 b4 6b call 0xd768 ; 0xd768 1bd16: d8 cd rjmp .-1104 ; 0x1b8c8 break; case 1: //Level 1: Reset statistics factory_reset_stats(); 1bd18: 0e 94 6c 60 call 0xc0d8 ; 0xc0d8 lcd_menu_statistics(); 1bd1c: 0f 94 98 1c call 0x23930 ; 0x23930 1bd20: d3 cd rjmp .-1114 ; 0x1b8c8 break; case 2: // Level 2: Prepare for shipping factory_reset_stats(); 1bd22: 0e 94 6c 60 call 0xc0d8 ; 0xc0d8 // FALLTHRU case 3: // Level 3: Preparation after being serviced // Force language selection at the next boot up. lang_reset(); 1bd26: 0e 94 b4 6b call 0xd768 ; 0xd768 // Force the wizard in "Follow calibration flow" mode at the next boot up calibration_status_clear(CALIBRATION_FORCE_PREP); 1bd2a: 84 e0 ldi r24, 0x04 ; 4 1bd2c: 0e 94 31 c6 call 0x18c62 ; 0x18c62 if (active) { uint8_t previous_value = eeprom_read_byte(dst); eeprom_byte_notify(dst, previous_value, value, true); } #endif //DEBUG_EEPROM_CHANGES eeprom_write_byte(dst, value); 1bd30: 62 e0 ldi r22, 0x02 ; 2 1bd32: 8f e5 ldi r24, 0x5F ; 95 1bd34: 9f e0 ldi r25, 0x0F ; 15 1bd36: 0f 94 24 a0 call 0x34048 ; 0x34048 lcd_update(2); fCheckModeInit(); // alternatively invoke printer reset } void farm_disable() { farm_mode = false; 1bd3a: 10 92 ca 0d sts 0x0DCA, r1 ; 0x800dca if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1bd3e: 60 e0 ldi r22, 0x00 ; 0 1bd40: 84 ec ldi r24, 0xC4 ; 196 1bd42: 9f e0 ldi r25, 0x0F ; 15 1bd44: 0f 94 00 a0 call 0x34000 ; 0x34000 eeprom_write_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 2); farm_disable(); #ifdef FILAMENT_SENSOR fsensor.setEnabled(true); 1bd48: 81 e0 ldi r24, 0x01 ; 1 1bd4a: 0e 94 20 6e call 0xdc40 ; 0xdc40 1bd4e: 11 e0 ldi r17, 0x01 ; 1 1bd50: 10 93 85 16 sts 0x1685, r17 ; 0x801685 1bd54: 61 e0 ldi r22, 0x01 ; 1 1bd56: 87 e0 ldi r24, 0x07 ; 7 1bd58: 9f e0 ldi r25, 0x0F ; 15 1bd5a: 0f 94 00 a0 call 0x34000 ; 0x34000 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1bd5e: 10 93 86 16 sts 0x1686, r17 ; 0x801686 1bd62: 61 e0 ldi r22, 0x01 ; 1 1bd64: 85 ed ldi r24, 0xD5 ; 213 1bd66: 9e e0 ldi r25, 0x0E ; 14 1bd68: 0f 94 00 a0 call 0x34000 ; 0x34000 1bd6c: ad cd rjmp .-1190 ; 0x1b8c8 case(0b01): lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHANGED_MOTHERBOARD)); eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; case(0b10): lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHANGED_PRINTER)); 1bd6e: 8e e5 ldi r24, 0x5E ; 94 1bd70: 93 e4 ldi r25, 0x43 ; 67 1bd72: 0e 94 b1 6c call 0xd962 ; 0xd962 1bd76: 0f 94 47 0b call 0x2168e ; 0x2168e if (active) { uint16_t previous_value = eeprom_read_word(dst); eeprom_word_notify(dst, previous_value, value, true); } #endif //DEBUG_EEPROM_CHANGES eeprom_write_word(dst, value); 1bd7a: 6c ef ldi r22, 0xFC ; 252 1bd7c: 70 e0 ldi r23, 0x00 ; 0 1bd7e: 8e ee ldi r24, 0xEE ; 238 1bd80: 9e e0 ldi r25, 0x0E ; 14 1bd82: 0f 94 3a a0 call 0x34074 ; 0x34074 eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; default: break; //no change, show no message } if (!previous_settings_retrieved) { 1bd86: b1 10 cpse r11, r1 1bd88: 08 c0 rjmp .+16 ; 0x1bd9a lcd_show_fullscreen_message_and_wait_P(_T(MSG_DEFAULT_SETTINGS_LOADED)); //if EEPROM version or printer type was changed, inform user that default setting were loaded 1bd8a: 87 ee ldi r24, 0xE7 ; 231 1bd8c: 92 e4 ldi r25, 0x42 ; 66 1bd8e: 0e 94 b1 6c call 0xd962 ; 0xd962 1bd92: 0f 94 47 0b call 0x2168e ; 0x2168e Config_StoreSettings(); 1bd96: 0e 94 5c 75 call 0xeab8 ; 0xeab8 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { 1bd9a: 80 e8 ldi r24, 0x80 ; 128 1bd9c: 0e 94 55 d8 call 0x1b0aa ; 0x1b0aa 1bda0: 88 23 and r24, r24 1bda2: c9 f0 breq .+50 ; 0x1bdd6 CalibrationStatus calibration_status = 0; if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 1bda4: 87 ef ldi r24, 0xF7 ; 247 1bda6: 9f e0 ldi r25, 0x0F ; 15 1bda8: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { CalibrationStatus calibration_status = 0; 1bdac: 60 e0 ldi r22, 0x00 ; 0 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 1bdae: 81 30 cpi r24, 0x01 ; 1 1bdb0: 71 f4 brne .+28 ; 0x1bdce // calibrated printer upgraded from FW<3.12 calibration_status |= (CALIBRATION_STATUS_SELFTEST | CALIBRATION_STATUS_XYZ | CALIBRATION_STATUS_Z | CALIBRATION_STATUS_LIVE_ADJUST); static const uint16_t v3_2_0_4[] PROGMEM = {3, 2, 0, 4}; if (eeprom_fw_version_older_than_p(v3_2_0_4)) { 1bdb2: 87 e5 ldi r24, 0x57 ; 87 1bdb4: 96 e8 ldi r25, 0x86 ; 134 1bdb6: 0e 94 4e b3 call 0x1669c ; 0x1669c bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { CalibrationStatus calibration_status = 0; if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { // calibrated printer upgraded from FW<3.12 calibration_status |= (CALIBRATION_STATUS_SELFTEST | CALIBRATION_STATUS_XYZ | CALIBRATION_STATUS_Z | CALIBRATION_STATUS_LIVE_ADJUST); 1bdba: 67 e1 ldi r22, 0x17 ; 23 static const uint16_t v3_2_0_4[] PROGMEM = {3, 2, 0, 4}; if (eeprom_fw_version_older_than_p(v3_2_0_4)) { 1bdbc: 88 23 and r24, r24 1bdbe: 39 f0 breq .+14 ; 0x1bdce // printer upgraded from FW<3.2.0.4 and requires re-running selftest lcd_show_fullscreen_message_and_wait_P(_T(MSG_FORCE_SELFTEST)); 1bdc0: 85 ea ldi r24, 0xA5 ; 165 1bdc2: 92 e4 ldi r25, 0x42 ; 66 1bdc4: 0e 94 b1 6c call 0xd962 ; 0xd962 1bdc8: 0f 94 47 0b call 0x2168e ; 0x2168e calibration_status &= ~CALIBRATION_STATUS_SELFTEST; 1bdcc: 66 e1 ldi r22, 0x16 ; 22 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1bdce: 86 ea ldi r24, 0xA6 ; 166 1bdd0: 9c e0 ldi r25, 0x0C ; 12 1bdd2: 0f 94 00 a0 call 0x34000 ; 0x34000 } } eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, calibration_status); } if (eeprom_fw_version_older_than_p(FW_VERSION_NR)) { 1bdd6: 8f e4 ldi r24, 0x4F ; 79 1bdd8: 96 e8 ldi r25, 0x86 ; 134 1bdda: 0e 94 4e b3 call 0x1669c ; 0x1669c 1bdde: 18 2f mov r17, r24 1bde0: 88 23 and r24, r24 1bde2: 29 f0 breq .+10 ; 0x1bdee if (!calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 1bde4: 87 e1 ldi r24, 0x17 ; 23 1bde6: 0e 94 55 d8 call 0x1b0aa ; 0x1b0aa 1bdea: 11 e0 ldi r17, 0x01 ; 1 1bdec: 18 27 eor r17, r24 static const uint16_t v3_2_0_4[] PROGMEM = {3, 2, 0, 4}; if (eeprom_fw_version_older_than_p(v3_2_0_4)) { // printer upgraded from FW<3.2.0.4 and requires re-running selftest lcd_show_fullscreen_message_and_wait_P(_T(MSG_FORCE_SELFTEST)); calibration_status &= ~CALIBRATION_STATUS_SELFTEST; 1bdee: f1 2c mov r15, r1 1bdf0: e1 2c mov r14, r1 } void update_current_firmware_version_to_eeprom() { for (int8_t i = 0; i < FW_PRUSA3D_MAGIC_LEN; ++ i){ eeprom_update_byte_notify((uint8_t*)(EEPROM_FIRMWARE_PRUSA_MAGIC+i), pgm_read_byte(FW_PRUSA3D_MAGIC_STR+i)); 1bdf2: f7 01 movw r30, r14 1bdf4: eb 5b subi r30, 0xBB ; 187 1bdf6: f9 47 sbci r31, 0x79 ; 121 1bdf8: 64 91 lpm r22, Z 1bdfa: c7 01 movw r24, r14 1bdfc: 0f 94 00 a0 call 0x34000 ; 0x34000 1be00: 8f ef ldi r24, 0xFF ; 255 1be02: e8 1a sub r14, r24 1be04: f8 0a sbc r15, r24 return true; } void update_current_firmware_version_to_eeprom() { for (int8_t i = 0; i < FW_PRUSA3D_MAGIC_LEN; ++ i){ 1be06: 9a e0 ldi r25, 0x0A ; 10 1be08: e9 16 cp r14, r25 1be0a: f1 04 cpc r15, r1 1be0c: 91 f7 brne .-28 ; 0x1bdf2 eeprom_update_byte_notify((uint8_t*)(EEPROM_FIRMWARE_PRUSA_MAGIC+i), pgm_read_byte(FW_PRUSA3D_MAGIC_STR+i)); } eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[0])); 1be0e: ef e4 ldi r30, 0x4F ; 79 1be10: f6 e8 ldi r31, 0x86 ; 134 1be12: 65 91 lpm r22, Z+ 1be14: 74 91 lpm r23, Z if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 1be16: 8a e0 ldi r24, 0x0A ; 10 1be18: 90 e0 ldi r25, 0x00 ; 0 1be1a: 0f 94 1e a0 call 0x3403c ; 0x3403c eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[1])); 1be1e: e1 e5 ldi r30, 0x51 ; 81 1be20: f6 e8 ldi r31, 0x86 ; 134 1be22: 65 91 lpm r22, Z+ 1be24: 74 91 lpm r23, Z 1be26: 8c e0 ldi r24, 0x0C ; 12 1be28: 90 e0 ldi r25, 0x00 ; 0 1be2a: 0f 94 1e a0 call 0x3403c ; 0x3403c eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION, (uint16_t)pgm_read_word(&FW_VERSION_NR[2])); 1be2e: e3 e5 ldi r30, 0x53 ; 83 1be30: f6 e8 ldi r31, 0x86 ; 134 1be32: 65 91 lpm r22, Z+ 1be34: 74 91 lpm r23, Z 1be36: 8e e0 ldi r24, 0x0E ; 14 1be38: 90 e0 ldi r25, 0x00 ; 0 1be3a: 0f 94 1e a0 call 0x3403c ; 0x3403c // See FirmwareRevisionFlavorType for the definition of firmware flavors. eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[3])); 1be3e: e5 e5 ldi r30, 0x55 ; 85 1be40: f6 e8 ldi r31, 0x86 ; 134 1be42: 65 91 lpm r22, Z+ 1be44: 74 91 lpm r23, Z 1be46: 80 e1 ldi r24, 0x10 ; 16 1be48: 90 e0 ldi r25, 0x00 ; 0 1be4a: 0f 94 1e a0 call 0x3403c ; 0x3403c run_wizard = true; } } update_current_firmware_version_to_eeprom(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 1be4e: 8f e5 ldi r24, 0x5F ; 95 1be50: 9f e0 ldi r25, 0x0F ; 15 1be52: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1be56: 88 23 and r24, r24 1be58: d9 f1 breq .+118 ; 0x1bed0 // first time run of wizard or service prep lcd_wizard(WizState::Run); 1be5a: 80 e0 ldi r24, 0x00 ; 0 } else if (run_wizard) { // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); 1be5c: 0f 94 09 2e call 0x25c12 ; 0x25c12 lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); #endif //THERMAL_MODEL } } KEEPALIVE_STATE(IN_PROCESS); 1be60: 83 e0 ldi r24, 0x03 ; 3 1be62: 80 93 78 02 sts 0x0278, r24 ; 0x800278 #endif //DEBUG_DISABLE_STARTMSGS lcd_update_enable(true); 1be66: 81 e0 ldi r24, 0x01 ; 1 1be68: 0e 94 c0 69 call 0xd380 ; 0xd380 lcd_clear(); 1be6c: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_update(2); 1be70: 82 e0 ldi r24, 0x02 ; 2 1be72: 0e 94 42 69 call 0xd284 ; 0xd284 "Contact support to submit details.")); } #endif } #else //XFLASH_DUMP dump_crash_reason crash_reason = (dump_crash_reason)eeprom_read_byte((uint8_t*)EEPROM_FW_CRASH_FLAG); 1be76: 83 e0 ldi r24, 0x03 ; 3 1be78: 9d e0 ldi r25, 0x0D ; 13 1be7a: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1be7e: 18 2f mov r17, r24 if(crash_reason != dump_crash_reason::manual && (uint8_t)crash_reason != 0xFF) 1be80: 8f ef ldi r24, 0xFF ; 255 1be82: 81 0f add r24, r17 1be84: 8e 3f cpi r24, 0xFE ; 254 1be86: 08 f0 brcs .+2 ; 0x1be8a 1be88: 49 c0 rjmp .+146 ; 0x1bf1c } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 1be8a: 80 e0 ldi r24, 0x00 ; 0 1be8c: 0f 94 9f 2c call 0x2593e ; 0x2593e { lcd_beeper_quick_feedback(); lcd_clear(); 1be90: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_puts_P(_n("FIRMWARE CRASH!\nCrash reason:\n")); 1be94: 8f e5 ldi r24, 0x5F ; 95 1be96: 98 e6 ldi r25, 0x68 ; 104 1be98: 0e 94 66 69 call 0xd2cc ; 0xd2cc switch(crash_reason) 1be9c: 12 30 cpi r17, 0x02 ; 2 1be9e: b1 f1 breq .+108 ; 0x1bf0c 1bea0: 13 30 cpi r17, 0x03 ; 3 1bea2: 09 f4 brne .+2 ; 0x1bea6 1bea4: 16 c1 rjmp .+556 ; 0x1c0d2 { case dump_crash_reason::stack_error: lcd_puts_P(_n("Static memory has\nbeen overwritten")); 1bea6: 8c e3 ldi r24, 0x3C ; 60 1bea8: 98 e6 ldi r25, 0x68 ; 104 { lcd_beeper_quick_feedback(); lcd_clear(); lcd_puts_P(_n("FIRMWARE CRASH!\nCrash reason:\n")); switch(crash_reason) 1beaa: 11 30 cpi r17, 0x01 ; 1 1beac: 89 f1 breq .+98 ; 0x1bf10 } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 1beae: 81 2f mov r24, r17 1beb0: 0e 94 2a 6a call 0xd454 ; 0xd454 1beb4: 2f c0 rjmp .+94 ; 0x1bf14 case(0b10): lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHANGED_PRINTER)); eeprom_write_word_notify((uint16_t*)EEPROM_PRINTER_TYPE, PRINTER_TYPE); break; case(0b11): lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHANGED_BOTH)); 1beb6: 83 e2 ldi r24, 0x23 ; 35 1beb8: 93 e4 ldi r25, 0x43 ; 67 1beba: 0e 94 b1 6c call 0xd962 ; 0xd962 1bebe: 0f 94 47 0b call 0x2168e ; 0x2168e if (active) { uint16_t previous_value = eeprom_read_word(dst); eeprom_word_notify(dst, previous_value, value, true); } #endif //DEBUG_EEPROM_CHANGES eeprom_write_word(dst, value); 1bec2: 6c ef ldi r22, 0xFC ; 252 1bec4: 70 e0 ldi r23, 0x00 ; 0 1bec6: 8e ee ldi r24, 0xEE ; 238 1bec8: 9e e0 ldi r25, 0x0E ; 14 1beca: 0f 94 3a a0 call 0x34074 ; 0x34074 1bece: ed ce rjmp .-550 ; 0x1bcaa // first time run of wizard or service prep lcd_wizard(WizState::Run); } else if (run_wizard) { // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); 1bed0: 81 e0 ldi r24, 0x01 ; 1 if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { // first time run of wizard or service prep lcd_wizard(WizState::Run); } else if (run_wizard) { 1bed2: 11 11 cpse r17, r1 1bed4: c3 cf rjmp .-122 ; 0x1be5c // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); } else { if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { 1bed6: 0e 94 55 d8 call 0x1b0aa ; 0x1b0aa 1beda: 81 11 cpse r24, r1 1bedc: 07 c0 rjmp .+14 ; 0x1beec // aborted or missing wizard: show a single warning lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW)); 1bede: 85 e3 ldi r24, 0x35 ; 53 1bee0: 92 e4 ldi r25, 0x42 ; 66 // wizard reset after service prep lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_Z_CALIBRATION_FLOW)); } else { // warn about other important steps individually if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 1bee2: 0e 94 b1 6c call 0xd962 ; 0xd962 1bee6: 0f 94 47 0b call 0x2168e ; 0x2168e 1beea: ba cf rjmp .-140 ; 0x1be60 else { if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { // aborted or missing wizard: show a single warning lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW)); } else if (!calibration_status_get(CALIBRATION_STATUS_Z)) { 1beec: 84 e0 ldi r24, 0x04 ; 4 1beee: 0e 94 55 d8 call 0x1b0aa ; 0x1b0aa 1bef2: 81 11 cpse r24, r1 1bef4: 03 c0 rjmp .+6 ; 0x1befc // wizard reset after service prep lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_Z_CALIBRATION_FLOW)); 1bef6: 8d eb ldi r24, 0xBD ; 189 1bef8: 91 e4 ldi r25, 0x41 ; 65 1befa: f3 cf rjmp .-26 ; 0x1bee2 } else { // warn about other important steps individually if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 1befc: 80 e1 ldi r24, 0x10 ; 16 1befe: 0e 94 55 d8 call 0x1b0aa ; 0x1b0aa 1bf02: 81 11 cpse r24, r1 1bf04: ad cf rjmp .-166 ; 0x1be60 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 1bf06: 89 e7 ldi r24, 0x79 ; 121 1bf08: 96 e4 ldi r25, 0x46 ; 70 1bf0a: eb cf rjmp .-42 ; 0x1bee2 { case dump_crash_reason::stack_error: lcd_puts_P(_n("Static memory has\nbeen overwritten")); break; case dump_crash_reason::watchdog: lcd_puts_P(_n("Watchdog timeout")); 1bf0c: 8b e2 ldi r24, 0x2B ; 43 1bf0e: 98 e6 ldi r25, 0x68 ; 104 1bf10: 0e 94 66 69 call 0xd2cc ; 0xd2cc } } void lcd_wait_for_click() { lcd_wait_for_click_delay(0); 1bf14: 90 e0 ldi r25, 0x00 ; 0 1bf16: 80 e0 ldi r24, 0x00 ; 0 1bf18: 0f 94 a1 34 call 0x26942 ; 0x26942 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1bf1c: 6f ef ldi r22, 0xFF ; 255 1bf1e: 83 e0 ldi r24, 0x03 ; 3 1bf20: 9d e0 ldi r25, 0x0D ; 13 1bf22: 0f 94 00 a0 call 0x34000 ; 0x34000 // Only arm the uvlo interrupt _after_ a recovering print has been initialized and // the entire state machine initialized. setup_uvlo_interrupt(); #endif //UVLO_SUPPORT fCheckModeInit(); 1bf26: 0e 94 62 d8 call 0x1b0c4 ; 0x1b0c4 KEEPALIVE_STATE(NOT_BUSY); 1bf2a: 81 e0 ldi r24, 0x01 ; 1 1bf2c: 80 93 78 02 sts 0x0278, r24 ; 0x800278 : "n" (_SFR_MEM_ADDR(_WD_CONTROL_REG)), "r" ((uint8_t)(_BV(_WD_CHANGE_BIT) | _BV(WDE))), "r" ((uint8_t) ((value & 0x08 ? _WD_PS3_MASK : 0x00) | _BV(WDE) | (value & 0x07)) ) : "r0" ); 1bf30: 88 e1 ldi r24, 0x18 ; 24 1bf32: 98 e2 ldi r25, 0x28 ; 40 1bf34: 0f b6 in r0, 0x3f ; 63 1bf36: f8 94 cli 1bf38: a8 95 wdr 1bf3a: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1bf3e: 0f be out 0x3f, r0 ; 63 1bf40: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #ifdef WATCHDOG wdt_enable(WDTO_4S); #ifdef EMERGENCY_HANDLERS WDTCSR |= (1 << WDIE); 1bf44: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1bf48: 80 64 ori r24, 0x40 ; 64 1bf4a: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> sei(); } } else if((*ptr == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR) && !IS_SD_PRINTING){ cli(); *ptr ++ = CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED; 1bf4e: 85 e0 ldi r24, 0x05 ; 5 1bf50: d8 2e mov r13, r24 setup(); for (;;) { loop(); if (serialEventRun) serialEventRun(); 1bf52: 90 e0 ldi r25, 0x00 ; 0 1bf54: e9 2e mov r14, r25 1bf56: 90 e0 ldi r25, 0x00 ; 0 1bf58: f9 2e mov r15, r25 // Currently Stopped (possibly due to an error) and not accepting new serial commands. // Signal to the host that we're currently busy waiting for supervision. KEEPALIVE_STATE(PAUSED_FOR_USER); } else { // Printer is available for processing, reset state KEEPALIVE_STATE(NOT_BUSY); 1bf5a: cc 24 eor r12, r12 1bf5c: c3 94 inc r12 planner_aborted = false; if(Stopped) { // Currently Stopped (possibly due to an error) and not accepting new serial commands. // Signal to the host that we're currently busy waiting for supervision. KEEPALIVE_STATE(PAUSED_FOR_USER); 1bf5e: 24 e0 ldi r18, 0x04 ; 4 1bf60: b2 2e mov r11, r18 // The loop() function is called in an endless loop by the Arduino framework from the default main() routine. // Before loop(), the setup() function is called by the main() routine. void loop() { // Reset a previously aborted command, we can now start processing motion again planner_aborted = false; 1bf62: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac if(Stopped) { 1bf66: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 1bf6a: 88 23 and r24, r24 1bf6c: 09 f4 brne .+2 ; 0x1bf70 1bf6e: b4 c0 rjmp .+360 ; 0x1c0d8 // Currently Stopped (possibly due to an error) and not accepting new serial commands. // Signal to the host that we're currently busy waiting for supervision. KEEPALIVE_STATE(PAUSED_FOR_USER); 1bf70: b0 92 78 02 sts 0x0278, r11 ; 0x800278 } else { // Printer is available for processing, reset state KEEPALIVE_STATE(NOT_BUSY); } if (printingIsPaused() && saved_printing_type == PowerPanic::PRINT_TYPE_HOST) { //keep believing that usb is being printed. Prevents accessing dangerous menus while pausing. 1bf74: 0e 94 bd 60 call 0xc17a ; 0xc17a 1bf78: 88 23 and r24, r24 1bf7a: 09 f4 brne .+2 ; 0x1bf7e 1bf7c: b0 c0 rjmp .+352 ; 0x1c0de 1bf7e: 80 91 79 02 lds r24, 0x0279 ; 0x800279 1bf82: 81 30 cpi r24, 0x01 ; 1 1bf84: 09 f0 breq .+2 ; 0x1bf88 1bf86: ab c0 rjmp .+342 ; 0x1c0de usb_timer.start(); 1bf88: 85 ed ldi r24, 0xD5 ; 213 1bf8a: 91 e1 ldi r25, 0x11 ; 17 1bf8c: 0f 94 d6 0f call 0x21fac ; 0x21fac ::start()> } else #endif { get_command(); 1bf90: 0e 94 72 75 call 0xeae4 ; 0xeae4 // The SD start is delayed because otherwise the serial cannot answer // fast enough to make contact with the host software. static bool autostart_stilltocheck = true; if(!force) { if(!autostart_stilltocheck) 1bf94: 80 91 56 02 lds r24, 0x0256 ; 0x800256 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.517> 1bf98: 88 23 and r24, r24 1bf9a: 89 f0 breq .+34 ; 0x1bfbe return; if(autostart_atmillis.expired(5000)) 1bf9c: 68 e8 ldi r22, 0x88 ; 136 1bf9e: 73 e1 ldi r23, 0x13 ; 19 1bfa0: 8b e7 ldi r24, 0x7B ; 123 1bfa2: 96 e1 ldi r25, 0x16 ; 22 1bfa4: 0f 94 a7 0f call 0x21f4e ; 0x21f4e ::expired(unsigned short)> 1bfa8: 81 11 cpse r24, r1 1bfaa: 09 c0 rjmp .+18 ; 0x1bfbe return; } autostart_stilltocheck = false; 1bfac: 10 92 56 02 sts 0x0256, r1 ; 0x800256 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.517> if(!mounted) 1bfb0: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1bfb4: 88 23 and r24, r24 1bfb6: 09 f4 brne .+2 ; 0x1bfba 1bfb8: 9e c0 rjmp .+316 ; 0x1c0f6 1bfba: 0f 94 11 44 call 0x28822 ; 0x28822 #ifdef SDSUPPORT card.checkautostart(false); #endif if(buflen) 1bfbe: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 1bfc2: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 1bfc6: 89 2b or r24, r25 1bfc8: 09 f4 brne .+2 ; 0x1bfcc 1bfca: 63 c0 rjmp .+198 ; 0x1c092 { cmdbuffer_front_already_processed = false; 1bfcc: 10 92 e6 11 sts 0x11E6, r1 ; 0x8011e6 #ifdef SDSUPPORT if(card.saving) 1bfd0: 80 91 68 13 lds r24, 0x1368 ; 0x801368 1bfd4: 88 23 and r24, r24 1bfd6: c1 f1 breq .+112 ; 0x1c048 { // Saving a G-code file onto an SD-card is in progress. // Saving starts with M28, saving until M29 is seen. if(strstr_P(CMDBUFFER_CURRENT_STRING, PSTR("M29")) == NULL) { 1bfd8: 00 91 cb 11 lds r16, 0x11CB ; 0x8011cb 1bfdc: 10 91 cc 11 lds r17, 0x11CC ; 0x8011cc 1bfe0: 0f 51 subi r16, 0x1F ; 31 1bfe2: 10 4f sbci r17, 0xF0 ; 240 1bfe4: 68 e9 ldi r22, 0x98 ; 152 1bfe6: 76 e8 ldi r23, 0x86 ; 134 1bfe8: c8 01 movw r24, r16 1bfea: 0f 94 e3 9d call 0x33bc6 ; 0x33bc6 1bfee: 89 2b or r24, r25 1bff0: 09 f0 breq .+2 ; 0x1bff4 1bff2: 8e c0 rjmp .+284 ; 0x1c110 else SERIAL_PROTOCOLLNPGM("Not SD printing"); } void CardReader::write_command(char *buf) { file.writeError = false; 1bff4: 10 92 fa 15 sts 0x15FA, r1 ; 0x8015fa /** Write a string to a file. Used by the Arduino Print class. * \param[in] str Pointer to the string. * Use writeError to check for errors. */ void SdFile::write(const char* str) { SdBaseFile::write(str, strlen(str)); 1bff8: f8 01 movw r30, r16 1bffa: 01 90 ld r0, Z+ 1bffc: 00 20 and r0, r0 1bffe: e9 f7 brne .-6 ; 0x1bffa 1c000: 31 97 sbiw r30, 0x01 ; 1 1c002: bf 01 movw r22, r30 1c004: 60 1b sub r22, r16 1c006: 71 0b sbc r23, r17 1c008: c8 01 movw r24, r16 1c00a: 0f 94 1c 50 call 0x2a038 ; 0x2a038 1c00e: 62 e0 ldi r22, 0x02 ; 2 1c010: 70 e0 ldi r23, 0x00 ; 0 1c012: 88 ed ldi r24, 0xD8 ; 216 1c014: 92 e0 ldi r25, 0x02 ; 2 1c016: 0f 94 1c 50 call 0x2a038 ; 0x2a038 file.write(buf); //write command file.write("\r\n"); //write line termination if (file.writeError) 1c01a: 80 91 fa 15 lds r24, 0x15FA ; 0x8015fa 1c01e: 88 23 and r24, r24 1c020: 41 f0 breq .+16 ; 0x1c032 { SERIAL_ERROR_START; 1c022: 84 e4 ldi r24, 0x44 ; 68 1c024: 9d e9 ldi r25, 0x9D ; 157 1c026: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ERRORLNRPGM(MSG_SD_ERR_WRITE_TO_FILE); 1c02a: 89 e0 ldi r24, 0x09 ; 9 1c02c: 99 e6 ldi r25, 0x69 ; 105 1c02e: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 card.write_command(CMDBUFFER_CURRENT_STRING); if(card.logging) 1c032: 80 91 69 13 lds r24, 0x1369 ; 0x801369 1c036: 88 23 and r24, r24 1c038: 09 f4 brne .+2 ; 0x1c03c 1c03a: 65 c0 rjmp .+202 ; 0x1c106 */ void process_commands() { if (!buflen) return; //empty command 1c03c: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 1c040: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 1c044: 89 2b or r24, r25 1c046: 11 f0 breq .+4 ; 0x1c04c 1c048: 0e 94 e7 83 call 0x107ce ; 0x107ce } #else process_commands(); #endif //SDSUPPORT if (! cmdbuffer_front_already_processed && buflen) 1c04c: 80 91 e6 11 lds r24, 0x11E6 ; 0x8011e6 1c050: 81 11 cpse r24, r1 1c052: 19 c0 rjmp .+50 ; 0x1c086 1c054: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 1c058: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 1c05c: 89 2b or r24, r25 1c05e: 99 f0 breq .+38 ; 0x1c086 { // ptr points to the start of the block currently being processed. // The first character in the block is the block type. char *ptr = cmdbuffer + bufindr; 1c060: e0 91 cb 11 lds r30, 0x11CB ; 0x8011cb 1c064: f0 91 cc 11 lds r31, 0x11CC ; 0x8011cc 1c068: e2 52 subi r30, 0x22 ; 34 1c06a: f0 4f sbci r31, 0xF0 ; 240 if (*ptr == CMDBUFFER_CURRENT_TYPE_SDCARD) { 1c06c: 80 81 ld r24, Z 1c06e: 82 30 cpi r24, 0x02 ; 2 1c070: 09 f0 breq .+2 ; 0x1c074 1c072: 53 c0 rjmp .+166 ; 0x1c11a { // This block locks the interrupts globally for 3.25 us, // which corresponds to a maximum repeat frequency of 307.69 kHz. // This blocking is safe in the context of a 10kHz stepper driver interrupt // or a 115200 Bd serial line receive interrupt, which will not trigger faster than 12kHz. cli(); 1c074: f8 94 cli // Reset the command to something, which will be ignored by the power panic routine, // so this buffer length will not be counted twice. *ptr ++ = CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED; 1c076: d0 82 st Z, r13 // Extract the current buffer length. sdlen.lohi.lo = *ptr ++; sdlen.lohi.hi = *ptr; // and pass it to the planner queue. planner_add_sd_length(sdlen.value); 1c078: 81 81 ldd r24, Z+1 ; 0x01 1c07a: 92 81 ldd r25, Z+2 ; 0x02 } else if((*ptr == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR) && !IS_SD_PRINTING){ cli(); *ptr ++ = CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED; // and one for each command to previous block in the planner queue. planner_add_sd_length(1); 1c07c: 0f 94 7c 74 call 0x2e8f8 ; 0x2e8f8 sei(); 1c080: 78 94 sei } // Now it is safe to release the already processed command block. If interrupted by the power panic now, // this block's SD card length will not be counted twice as its command type has been replaced // by CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED. cmdqueue_pop_front(); 1c082: 0e 94 d3 6f call 0xdfa6 ; 0xdfa6 */ void host_keepalive() { #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; 1c086: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1c08a: 81 11 cpse r24, r1 1c08c: 02 c0 rjmp .+4 ; 0x1c092 1c08e: 0e 94 57 72 call 0xe4ae ; 0xe4ae } host_keepalive(); } } //check heater every n milliseconds manage_heater(); 1c092: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(printingIsPaused()); 1c096: 0e 94 bd 60 call 0xc17a ; 0xc17a 1c09a: 0e 94 01 7a call 0xf402 ; 0xf402 //=============================functions ============================ //=========================================================================== void checkHitEndstops() { if(endstop_hit) { 1c09e: 80 91 2c 04 lds r24, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.439> 1c0a2: 81 11 cpse r24, r1 SERIAL_ECHO(float(endstops_trigsteps[axis]) / cs.axis_steps_per_mm[axis]); } } SERIAL_ECHOLN(""); #endif //VERBOSE_CHECK_HIT_ENDSTOPS endstop_hit = 0; 1c0a4: 10 92 2c 04 sts 0x042C, r1 ; 0x80042c <_ZL11endstop_hit.lto_priv.439> checkHitEndstops(); lcd_update(0); 1c0a8: 80 e0 ldi r24, 0x00 ; 0 1c0aa: 0e 94 42 69 call 0xd284 ; 0xd284 void MMU2::mmu_loop() { // We only leave this method if the current command was successfully completed - that's the Marlin's way of blocking operation // Atomic compare_exchange would have been the most appropriate solution here, but this gets called only in Marlin's task, // so thread safety should be kept static bool avoidRecursion = false; if (avoidRecursion) { 1c0ae: 80 91 2d 04 lds r24, 0x042D ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.505> 1c0b2: 81 11 cpse r24, r1 1c0b4: 07 c0 rjmp .+14 ; 0x1c0c4 return; } avoidRecursion = true; 1c0b6: c0 92 2d 04 sts 0x042D, r12 ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.505> mmu_loop_inner(true); 1c0ba: 81 e0 ldi r24, 0x01 ; 1 1c0bc: 0f 94 52 64 call 0x2c8a4 ; 0x2c8a4 avoidRecursion = false; 1c0c0: 10 92 2d 04 sts 0x042D, r1 ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.505> 1c0c4: e1 14 cp r14, r1 1c0c6: f1 04 cpc r15, r1 1c0c8: 09 f4 brne .+2 ; 0x1c0cc 1c0ca: 4b cf rjmp .-362 ; 0x1bf62 1c0cc: 0e 94 00 00 call 0 ; 0x0 <__vectors> 1c0d0: 48 cf rjmp .-368 ; 0x1bf62 break; case dump_crash_reason::watchdog: lcd_puts_P(_n("Watchdog timeout")); break; case dump_crash_reason::bad_isr: lcd_puts_P(_n("Bad interrupt")); 1c0d2: 8d e1 ldi r24, 0x1D ; 29 1c0d4: 98 e6 ldi r25, 0x68 ; 104 1c0d6: 1c cf rjmp .-456 ; 0x1bf10 // Currently Stopped (possibly due to an error) and not accepting new serial commands. // Signal to the host that we're currently busy waiting for supervision. KEEPALIVE_STATE(PAUSED_FOR_USER); } else { // Printer is available for processing, reset state KEEPALIVE_STATE(NOT_BUSY); 1c0d8: c0 92 78 02 sts 0x0278, r12 ; 0x800278 1c0dc: 4b cf rjmp .-362 ; 0x1bf74 } if (printingIsPaused() && saved_printing_type == PowerPanic::PRINT_TYPE_HOST) { //keep believing that usb is being printed. Prevents accessing dangerous menus while pausing. usb_timer.start(); } else if (usb_timer.expired(USB_TIMER_TIMEOUT)) { //just need to check if it expired. Nothing else is needed to be done. 1c0de: 60 e1 ldi r22, 0x10 ; 16 1c0e0: 77 e2 ldi r23, 0x27 ; 39 1c0e2: 85 ed ldi r24, 0xD5 ; 213 1c0e4: 91 e1 ldi r25, 0x11 ; 17 1c0e6: 0f 94 a7 0f call 0x21f4e ; 0x21f4e ::expired(unsigned short)> 1c0ea: 88 23 and r24, r24 1c0ec: 09 f4 brne .+2 ; 0x1c0f0 1c0ee: 50 cf rjmp .-352 ; 0x1bf90 } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 1c0f0: b0 92 cb 0d sts 0x0DCB, r11 ; 0x800dcb <_ZL13printer_state.lto_priv.367> 1c0f4: 4d cf rjmp .-358 ; 0x1bf90 return; } autostart_stilltocheck = false; if(!mounted) { mount(); 1c0f6: 81 e0 ldi r24, 0x01 ; 1 1c0f8: 0f 94 7d 4d call 0x29afa ; 0x29afa if(!mounted) //fail 1c0fc: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1c100: 81 11 cpse r24, r1 1c102: 5b cf rjmp .-330 ; 0x1bfba 1c104: 5c cf rjmp .-328 ; 0x1bfbe if(strstr_P(CMDBUFFER_CURRENT_STRING, PSTR("M29")) == NULL) { card.write_command(CMDBUFFER_CURRENT_STRING); if(card.logging) process_commands(); else SERIAL_PROTOCOLLNRPGM(MSG_OK); 1c106: 81 e3 ldi r24, 0x31 ; 49 1c108: 99 e6 ldi r25, 0x69 ; 105 } else { card.closefile(); SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 1c10a: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 1c10e: 9e cf rjmp .-196 ; 0x1c04c if(card.logging) process_commands(); else SERIAL_PROTOCOLLNRPGM(MSG_OK); } else { card.closefile(); 1c110: 0f 94 e4 41 call 0x283c8 ; 0x283c8 SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 1c114: 8f e1 ldi r24, 0x1F ; 31 1c116: 99 e6 ldi r25, 0x69 ; 105 1c118: f8 cf rjmp .-16 ; 0x1c10a // and pass it to the planner queue. planner_add_sd_length(sdlen.value); sei(); } } else if((*ptr == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR) && !IS_SD_PRINTING){ 1c11a: 86 30 cpi r24, 0x06 ; 6 1c11c: 09 f0 breq .+2 ; 0x1c120 1c11e: b1 cf rjmp .-158 ; 0x1c082 1c120: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 1c124: 81 11 cpse r24, r1 1c126: ad cf rjmp .-166 ; 0x1c082 cli(); 1c128: f8 94 cli *ptr ++ = CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED; 1c12a: d0 82 st Z, r13 // and one for each command to previous block in the planner queue. planner_add_sd_length(1); 1c12c: 81 e0 ldi r24, 0x01 ; 1 1c12e: 90 e0 ldi r25, 0x00 ; 0 1c130: a5 cf rjmp .-182 ; 0x1c07c { uint8_t version_changed = 0; uint16_t printer_type = eeprom_init_default_word((uint16_t*)EEPROM_PRINTER_TYPE, PRINTER_TYPE); uint16_t motherboard = eeprom_init_default_word((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); if (printer_type != PRINTER_TYPE) version_changed |= 0b10; 1c132: 02 e0 ldi r16, 0x02 ; 2 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1c134: 88 3c cpi r24, 0xC8 ; 200 1c136: 91 05 cpc r25, r1 1c138: 09 f0 breq .+2 ; 0x1c13c 1c13a: 03 e0 ldi r16, 0x03 ; 3 uint8_t hw_changed = check_printer_version(); if (!(hw_changed & 0b10)) { //if printer version wasn't changed, check for eeprom version and retrieve settings from eeprom in case that version wasn't changed previous_settings_retrieved = Config_RetrieveSettings(); } else { //printer version was changed so use default settings Config_ResetDefault(); 1c13c: 0e 94 cb 74 call 0xe996 ; 0xe996 SERIAL_ECHORPGM(_n(" PlannerBufferBytes: "));////MSG_PLANNER_BUFFER_BYTES SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); //lcd_update_enable(false); // why do we need this?? - andre // loads data from EEPROM if available else uses defaults (and resets step acceleration rate) bool previous_settings_retrieved = false; 1c140: b1 2c mov r11, r1 void SdFatUtil::set_stack_guard() { uint32_t *stack_guard; stack_guard = (uint32_t*)(&__bss_end + STACK_GUARD_MARGIN); *stack_guard = STACK_GUARD_TEST_VALUE; 1c142: 82 ea ldi r24, 0xA2 ; 162 1c144: 92 ea ldi r25, 0xA2 ; 162 1c146: a0 e0 ldi r26, 0x00 ; 0 1c148: b0 e0 ldi r27, 0x00 ; 0 1c14a: 80 93 24 17 sts 0x1724, r24 ; 0x801724 <__bss_end+0x20> 1c14e: 90 93 25 17 sts 0x1725, r25 ; 0x801725 <__bss_end+0x21> 1c152: a0 93 26 17 sts 0x1726, r26 ; 0x801726 <__bss_end+0x22> 1c156: b0 93 27 17 sts 0x1727, r27 ; 0x801727 <__bss_end+0x23> // Finish init of mult extruder arrays for(int e = 0; e < EXTRUDERS; e++) { // populate with the first value maxttemp[e] = maxttemp[0]; #ifdef PIDTEMP iState_sum_min[e] = 0.0; 1c15a: 10 92 ea 03 sts 0x03EA, r1 ; 0x8003ea <_ZL14iState_sum_min.lto_priv.431> 1c15e: 10 92 eb 03 sts 0x03EB, r1 ; 0x8003eb <_ZL14iState_sum_min.lto_priv.431+0x1> 1c162: 10 92 ec 03 sts 0x03EC, r1 ; 0x8003ec <_ZL14iState_sum_min.lto_priv.431+0x2> 1c166: 10 92 ed 03 sts 0x03ED, r1 ; 0x8003ed <_ZL14iState_sum_min.lto_priv.431+0x3> iState_sum_max[e] = PID_INTEGRAL_DRIVE_MAX / cs.Ki; 1c16a: 20 91 9e 04 lds r18, 0x049E ; 0x80049e 1c16e: 30 91 9f 04 lds r19, 0x049F ; 0x80049f 1c172: 40 91 a0 04 lds r20, 0x04A0 ; 0x8004a0 1c176: 50 91 a1 04 lds r21, 0x04A1 ; 0x8004a1 1c17a: 60 e0 ldi r22, 0x00 ; 0 1c17c: 70 e0 ldi r23, 0x00 ; 0 1c17e: 8f e7 ldi r24, 0x7F ; 127 1c180: 93 e4 ldi r25, 0x43 ; 67 1c182: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1c186: 60 93 e6 03 sts 0x03E6, r22 ; 0x8003e6 <_ZL14iState_sum_max.lto_priv.432> 1c18a: 70 93 e7 03 sts 0x03E7, r23 ; 0x8003e7 <_ZL14iState_sum_max.lto_priv.432+0x1> 1c18e: 80 93 e8 03 sts 0x03E8, r24 ; 0x8003e8 <_ZL14iState_sum_max.lto_priv.432+0x2> 1c192: 90 93 e9 03 sts 0x03E9, r25 ; 0x8003e9 <_ZL14iState_sum_max.lto_priv.432+0x3> #endif //PIDTEMP #ifdef PIDTEMPBED temp_iState_min_bed = 0.0; 1c196: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 <_ZL19temp_iState_min_bed.lto_priv.429> 1c19a: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 <_ZL19temp_iState_min_bed.lto_priv.429+0x1> 1c19e: 10 92 e4 03 sts 0x03E4, r1 ; 0x8003e4 <_ZL19temp_iState_min_bed.lto_priv.429+0x2> 1c1a2: 10 92 e5 03 sts 0x03E5, r1 ; 0x8003e5 <_ZL19temp_iState_min_bed.lto_priv.429+0x3> temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 1c1a6: 20 91 aa 04 lds r18, 0x04AA ; 0x8004aa 1c1aa: 30 91 ab 04 lds r19, 0x04AB ; 0x8004ab 1c1ae: 40 91 ac 04 lds r20, 0x04AC ; 0x8004ac 1c1b2: 50 91 ad 04 lds r21, 0x04AD ; 0x8004ad 1c1b6: 60 e0 ldi r22, 0x00 ; 0 1c1b8: 70 e0 ldi r23, 0x00 ; 0 1c1ba: 8f e7 ldi r24, 0x7F ; 127 1c1bc: 93 e4 ldi r25, 0x43 ; 67 1c1be: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1c1c2: 60 93 de 03 sts 0x03DE, r22 ; 0x8003de <_ZL19temp_iState_max_bed.lto_priv.430> 1c1c6: 70 93 df 03 sts 0x03DF, r23 ; 0x8003df <_ZL19temp_iState_max_bed.lto_priv.430+0x1> 1c1ca: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 <_ZL19temp_iState_max_bed.lto_priv.430+0x2> 1c1ce: 90 93 e1 03 sts 0x03E1, r25 ; 0x8003e1 <_ZL19temp_iState_max_bed.lto_priv.430+0x3> #endif //PIDTEMPBED } #if defined(HEATER_0_PIN) && (HEATER_0_PIN > -1) SET_OUTPUT(HEATER_0_PIN); 1c1d2: 6d 9a sbi 0x0d, 5 ; 13 #endif #if defined(HEATER_BED_PIN) && (HEATER_BED_PIN > -1) SET_OUTPUT(HEATER_BED_PIN); 1c1d4: 9d 9a sbi 0x13, 5 ; 19 #endif #if defined(FAN_PIN) && (FAN_PIN > -1) SET_OUTPUT(FAN_PIN); 1c1d6: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1c1da: 88 60 ori r24, 0x08 ; 8 1c1dc: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> #ifdef FAST_PWM_FAN setPwmFrequency(FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 #endif #ifdef FAN_SOFT_PWM soft_pwm_fan = fanSpeedSoftPwm / (1 << (8 - FAN_SOFT_PWM_BITS)); 1c1e0: 80 91 05 05 lds r24, 0x0505 ; 0x800505 1c1e4: 90 e0 ldi r25, 0x00 ; 0 1c1e6: 64 e0 ldi r22, 0x04 ; 4 1c1e8: 95 95 asr r25 1c1ea: 87 95 ror r24 1c1ec: 6a 95 dec r22 1c1ee: e1 f7 brne .-8 ; 0x1c1e8 1c1f0: 80 93 dd 03 sts 0x03DD, r24 ; 0x8003dd <_ZL12soft_pwm_fan.lto_priv.434> pinMode(MAX6675_SS, OUTPUT); digitalWrite(MAX6675_SS,1); #endif #ifdef HEATER_0_MINTEMP minttemp[0] = HEATER_0_MINTEMP; 1c1f4: 8e e1 ldi r24, 0x1E ; 30 1c1f6: 90 e0 ldi r25, 0x00 ; 0 1c1f8: 90 93 dc 03 sts 0x03DC, r25 ; 0x8003dc <_ZL8minttemp.lto_priv.424+0x1> 1c1fc: 80 93 db 03 sts 0x03DB, r24 ; 0x8003db <_ZL8minttemp.lto_priv.424> while(analog2temp(minttemp_raw[0], 0) < HEATER_0_MINTEMP) { 1c200: c0 90 52 02 lds r12, 0x0252 ; 0x800252 <_ZL12minttemp_raw.lto_priv.426> 1c204: d0 90 53 02 lds r13, 0x0253 ; 0x800253 <_ZL12minttemp_raw.lto_priv.426+0x1> 1c208: c6 01 movw r24, r12 1c20a: 0e 94 be bd call 0x17b7c ; 0x17b7c 1c20e: 20 e0 ldi r18, 0x00 ; 0 1c210: 30 e0 ldi r19, 0x00 ; 0 1c212: 40 ef ldi r20, 0xF0 ; 240 1c214: 51 e4 ldi r21, 0x41 ; 65 1c216: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1c21a: 87 ff sbrs r24, 7 1c21c: a4 c9 rjmp .-3256 ; 0x1b566 #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP minttemp_raw[0] += OVERSAMPLENR; #else minttemp_raw[0] -= OVERSAMPLENR; 1c21e: f0 e1 ldi r31, 0x10 ; 16 1c220: cf 1a sub r12, r31 1c222: d1 08 sbc r13, r1 1c224: d0 92 53 02 sts 0x0253, r13 ; 0x800253 <_ZL12minttemp_raw.lto_priv.426+0x1> 1c228: c0 92 52 02 sts 0x0252, r12 ; 0x800252 <_ZL12minttemp_raw.lto_priv.426> 1c22c: e9 cf rjmp .-46 ; 0x1c200 0001c22e : return false; } // Parse a major.minor.revision version number. // Return true if valid. bool parse_version(const char *str, uint16_t version[4]) { 1c22e: 0f 93 push r16 1c230: 1f 93 push r17 1c232: 8b 01 movw r16, r22 for(uint8_t i = 0; i < 2; ++i){ str = Number(str, version + i); 1c234: 0e 94 76 b1 call 0x162ec ; 0x162ec if (*str != '.') 1c238: fc 01 movw r30, r24 1c23a: 20 81 ld r18, Z 1c23c: 2e 32 cpi r18, 0x2E ; 46 1c23e: 11 f0 breq .+4 ; 0x1c244 static_assert(sizeof(STR_REVISION_DEV) == 4); return Tag( str, STR_REVISION_DEV, sizeof(STR_REVISION_DEV) - 1, FIRMWARE_REVISION_DEV, version + 3); case 'R': // expect RC static_assert(sizeof(STR_REVISION_RC) == 3); return Tag( str, STR_REVISION_RC, sizeof(STR_REVISION_RC) - 1, FIRMWARE_REVISION_RC, version + 3); default: return false; // fail everything else 1c240: 80 e0 ldi r24, 0x00 ; 0 1c242: 34 c0 rjmp .+104 ; 0x1c2ac // Parse a major.minor.revision version number. // Return true if valid. bool parse_version(const char *str, uint16_t version[4]) { for(uint8_t i = 0; i < 2; ++i){ str = Number(str, version + i); 1c244: b8 01 movw r22, r16 1c246: 6e 5f subi r22, 0xFE ; 254 1c248: 7f 4f sbci r23, 0xFF ; 255 1c24a: 01 96 adiw r24, 0x01 ; 1 1c24c: 0e 94 76 b1 call 0x162ec ; 0x162ec if (*str != '.') 1c250: fc 01 movw r30, r24 1c252: 20 81 ld r18, Z 1c254: 2e 32 cpi r18, 0x2E ; 46 1c256: a1 f7 brne .-24 ; 0x1c240 return false; ++str; } str = Number(str, version + 2); 1c258: b8 01 movw r22, r16 1c25a: 6c 5f subi r22, 0xFC ; 252 1c25c: 7f 4f sbci r23, 0xFF ; 255 1c25e: 01 96 adiw r24, 0x01 ; 1 1c260: 0e 94 76 b1 call 0x162ec ; 0x162ec version[3] = FIRMWARE_REVISION_RELEASED; 1c264: 20 e4 ldi r18, 0x40 ; 64 1c266: 30 e0 ldi r19, 0x00 ; 0 1c268: f8 01 movw r30, r16 1c26a: 37 83 std Z+7, r19 ; 0x07 1c26c: 26 83 std Z+6, r18 ; 0x06 1c26e: fc 01 movw r30, r24 1c270: df 01 movw r26, r30 // skip everything else until eol or '-' for(;;){ if(is_whitespace_or_nl_or_eol(*str)){ 1c272: 91 91 ld r25, Z+ return c == ' ' || c == '\t' || c == '\n' || c == '\r'; } inline bool is_whitespace_or_nl_or_eol(char c) { return c == 0 || c == ' ' || c == '\t' || c == '\n' || c == '\r'; 1c274: 89 2f mov r24, r25 1c276: 8f 7d andi r24, 0xDF ; 223 1c278: c1 f1 breq .+112 ; 0x1c2ea 1c27a: 87 ef ldi r24, 0xF7 ; 247 1c27c: 89 0f add r24, r25 1c27e: 82 30 cpi r24, 0x02 ; 2 1c280: a0 f1 brcs .+104 ; 0x1c2ea 1c282: 9d 30 cpi r25, 0x0D ; 13 1c284: 91 f1 breq .+100 ; 0x1c2ea for(;;){ if(is_whitespace_or_nl_or_eol(*str)){ // speculatively reached the end of line, silently ignoring anything which is not a '-' return true; } if( *str == '-'){ 1c286: 9d 32 cpi r25, 0x2D ; 45 1c288: 99 f7 brne .-26 ; 0x1c270 // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1c28a: 11 96 adiw r26, 0x01 ; 1 1c28c: 9c 91 ld r25, X 1c28e: 92 34 cpi r25, 0x42 ; 66 1c290: e1 f0 breq .+56 ; 0x1c2ca 1c292: 7c f4 brge .+30 ; 0x1c2b2 1c294: 91 34 cpi r25, 0x41 ; 65 1c296: a1 f6 brne .-88 ; 0x1c240 case 'A': // expect ALPHA static_assert(sizeof(STR_REVISION_ALPHA) == 6); return Tag( str, STR_REVISION_ALPHA, sizeof(STR_REVISION_ALPHA) - 1, FIRMWARE_REVISION_ALPHA, version + 3); 1c298: 0a 5f subi r16, 0xFA ; 250 1c29a: 1f 4f sbci r17, 0xFF ; 255 1c29c: 28 e0 ldi r18, 0x08 ; 8 1c29e: 30 e0 ldi r19, 0x00 ; 0 1c2a0: 45 e0 ldi r20, 0x05 ; 5 1c2a2: 64 e4 ldi r22, 0x44 ; 68 1c2a4: 74 e8 ldi r23, 0x84 ; 132 case 'D': // expect DEV static_assert(sizeof(STR_REVISION_DEV) == 4); return Tag( str, STR_REVISION_DEV, sizeof(STR_REVISION_DEV) - 1, FIRMWARE_REVISION_DEV, version + 3); case 'R': // expect RC static_assert(sizeof(STR_REVISION_RC) == 3); return Tag( str, STR_REVISION_RC, sizeof(STR_REVISION_RC) - 1, FIRMWARE_REVISION_RC, version + 3); 1c2a6: cf 01 movw r24, r30 1c2a8: 0e 94 2c b5 call 0x16a58 ; 0x16a58 // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); return false; } 1c2ac: 1f 91 pop r17 1c2ae: 0f 91 pop r16 1c2b0: 08 95 ret // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1c2b2: 94 34 cpi r25, 0x44 ; 68 1c2b4: 91 f0 breq .+36 ; 0x1c2da 1c2b6: 92 35 cpi r25, 0x52 ; 82 1c2b8: 19 f6 brne .-122 ; 0x1c240 case 'D': // expect DEV static_assert(sizeof(STR_REVISION_DEV) == 4); return Tag( str, STR_REVISION_DEV, sizeof(STR_REVISION_DEV) - 1, FIRMWARE_REVISION_DEV, version + 3); case 'R': // expect RC static_assert(sizeof(STR_REVISION_RC) == 3); return Tag( str, STR_REVISION_RC, sizeof(STR_REVISION_RC) - 1, FIRMWARE_REVISION_RC, version + 3); 1c2ba: 0a 5f subi r16, 0xFA ; 250 1c2bc: 1f 4f sbci r17, 0xFF ; 255 1c2be: 20 e2 ldi r18, 0x20 ; 32 1c2c0: 30 e0 ldi r19, 0x00 ; 0 1c2c2: 42 e0 ldi r20, 0x02 ; 2 1c2c4: 68 e3 ldi r22, 0x38 ; 56 1c2c6: 74 e8 ldi r23, 0x84 ; 132 1c2c8: ee cf rjmp .-36 ; 0x1c2a6 case 'A': // expect ALPHA static_assert(sizeof(STR_REVISION_ALPHA) == 6); return Tag( str, STR_REVISION_ALPHA, sizeof(STR_REVISION_ALPHA) - 1, FIRMWARE_REVISION_ALPHA, version + 3); case 'B': // expect BETA static_assert(sizeof(STR_REVISION_BETA) == 5); return Tag( str, STR_REVISION_BETA, sizeof(STR_REVISION_BETA) - 1, FIRMWARE_REVISION_BETA, version + 3); 1c2ca: 0a 5f subi r16, 0xFA ; 250 1c2cc: 1f 4f sbci r17, 0xFF ; 255 1c2ce: 20 e1 ldi r18, 0x10 ; 16 1c2d0: 30 e0 ldi r19, 0x00 ; 0 1c2d2: 44 e0 ldi r20, 0x04 ; 4 1c2d4: 6f e3 ldi r22, 0x3F ; 63 1c2d6: 74 e8 ldi r23, 0x84 ; 132 1c2d8: e6 cf rjmp .-52 ; 0x1c2a6 case 'D': // expect DEV static_assert(sizeof(STR_REVISION_DEV) == 4); return Tag( str, STR_REVISION_DEV, sizeof(STR_REVISION_DEV) - 1, FIRMWARE_REVISION_DEV, version + 3); 1c2da: 0a 5f subi r16, 0xFA ; 250 1c2dc: 1f 4f sbci r17, 0xFF ; 255 1c2de: 30 e0 ldi r19, 0x00 ; 0 1c2e0: 20 e0 ldi r18, 0x00 ; 0 1c2e2: 43 e0 ldi r20, 0x03 ; 3 1c2e4: 6b e3 ldi r22, 0x3B ; 59 1c2e6: 74 e8 ldi r23, 0x84 ; 132 1c2e8: de cf rjmp .-68 ; 0x1c2a6 // skip everything else until eol or '-' for(;;){ if(is_whitespace_or_nl_or_eol(*str)){ // speculatively reached the end of line, silently ignoring anything which is not a '-' return true; 1c2ea: 81 e0 ldi r24, 0x01 ; 1 1c2ec: df cf rjmp .-66 ; 0x1c2ac 0001c2ee : crashdet_use_eeprom_setting(); } #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) 1c2ee: cf 93 push r28 1c2f0: c8 2f mov r28, r24 { if (!lang_select(lang)) { if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_COPY_SEL_LANG), false, LCD_LEFT_BUTTON_CHOICE) == LCD_LEFT_BUTTON_CHOICE) 1c2f2: 8a e0 ldi r24, 0x0A ; 10 1c2f4: 91 e4 ldi r25, 0x41 ; 65 1c2f6: 0e 94 b1 6c call 0xd962 ; 0xd962 1c2fa: 40 e0 ldi r20, 0x00 ; 0 1c2fc: 60 e0 ldi r22, 0x00 ; 0 1c2fe: 0f 94 e0 2d call 0x25bc0 ; 0x25bc0 1c302: 81 11 cpse r24, r1 1c304: 20 c0 rjmp .+64 ; 0x1c346 #endif //(LANG_MODE == 0) void lang_boot_update_start(uint8_t lang) { uint8_t cnt = lang_get_count(); 1c306: 0e 94 22 6c call 0xd844 ; 0xd844 if ((lang < 2) || (lang > cnt)) return; //only languages from xflash can be selected 1c30a: c2 30 cpi r28, 0x02 ; 2 1c30c: e0 f0 brcs .+56 ; 0x1c346 1c30e: 8c 17 cp r24, r28 1c310: d0 f0 brcs .+52 ; 0x1c346 softReset(); } void bootapp_reboot_user0(uint8_t reserved) { cli(); 1c312: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 1c314: 8a ea ldi r24, 0xAA ; 170 1c316: 95 e5 ldi r25, 0x55 ; 85 1c318: dc 01 movw r26, r24 1c31a: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x8f8> 1c31e: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x8f9> 1c322: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x8fa> 1c326: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x8fb> boot_app_flags = BOOT_APP_FLG_USER0; 1c32a: 80 e8 ldi r24, 0x80 ; 128 1c32c: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x8f7> boot_copy_size = 0; 1c330: 10 92 f9 1f sts 0x1FF9, r1 ; 0x801ff9 <__bss_end+0x8f5> 1c334: 10 92 f8 1f sts 0x1FF8, r1 ; 0x801ff8 <__bss_end+0x8f4> bootapp_reboot_user0(lang << 3); 1c338: cc 0f add r28, r28 1c33a: cc 0f add r28, r28 1c33c: cc 0f add r28, r28 boot_reserved = reserved; 1c33e: c0 93 fa 1f sts 0x1FFA, r28 ; 0x801ffa <__bss_end+0x8f6> // bootapp_print_vars(); softReset(); 1c342: 0e 94 a7 60 call 0xc14e ; 0xc14e lang_boot_update_start(lang); lcd_update_enable(true); 1c346: 81 e0 ldi r24, 0x01 ; 1 1c348: 0e 94 c0 69 call 0xd380 ; 0xd380 menu_goto(lcd_language_menu, 0, true, true); 1c34c: 21 e0 ldi r18, 0x01 ; 1 1c34e: 41 e0 ldi r20, 0x01 ; 1 1c350: 70 e0 ldi r23, 0x00 ; 0 1c352: 60 e0 ldi r22, 0x00 ; 0 1c354: 8d e1 ldi r24, 0x1D ; 29 1c356: 98 e3 ldi r25, 0x38 ; 56 1c358: 0f 94 e6 92 call 0x325cc ; 0x325cc 1c35c: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout } } 1c360: cf 91 pop r28 1c362: 08 95 ret 0001c364 : static void lcd_check_filament_set() { lcd_check_update_RAM(&oCheckFilament); eeprom_update_byte_notify((uint8_t*)EEPROM_CHECK_FILAMENT,(uint8_t)oCheckFilament); } static void settings_check_toggle(ClCheckMode * oCheckSetting, const char* msg, void (*func)(void)) { 1c364: 0f 93 push r16 1c366: 1f 93 push r17 1c368: cf 93 push r28 1c36a: df 93 push r29 1c36c: eb 01 movw r28, r22 1c36e: 8a 01 movw r16, r20 switch(*oCheckSetting) { 1c370: 81 30 cpi r24, 0x01 ; 1 1c372: 81 f0 breq .+32 ; 0x1c394 1c374: 82 30 cpi r24, 0x02 ; 2 1c376: 89 f0 breq .+34 ; 0x1c39a case ClCheckMode::_None: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); 1c378: 85 e5 ldi r24, 0x55 ; 85 1c37a: 90 e4 ldi r25, 0x40 ; 64 break; case ClCheckMode::_Warn: MENU_ITEM_TOGGLE_P(msg, _T(MSG_WARN), func); break; case ClCheckMode::_Strict: MENU_ITEM_TOGGLE_P(msg, _T(MSG_STRICT), func); 1c37c: 0e 94 b1 6c call 0xd962 ; 0xd962 1c380: 22 e0 ldi r18, 0x02 ; 2 1c382: a8 01 movw r20, r16 1c384: bc 01 movw r22, r24 1c386: ce 01 movw r24, r28 break; default: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); } } 1c388: df 91 pop r29 1c38a: cf 91 pop r28 1c38c: 1f 91 pop r17 1c38e: 0f 91 pop r16 break; case ClCheckMode::_Warn: MENU_ITEM_TOGGLE_P(msg, _T(MSG_WARN), func); break; case ClCheckMode::_Strict: MENU_ITEM_TOGGLE_P(msg, _T(MSG_STRICT), func); 1c390: 0d 94 4b 94 jmp 0x32896 ; 0x32896 switch(*oCheckSetting) { case ClCheckMode::_None: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); break; case ClCheckMode::_Warn: MENU_ITEM_TOGGLE_P(msg, _T(MSG_WARN), func); 1c394: 8e e4 ldi r24, 0x4E ; 78 1c396: 90 e4 ldi r25, 0x40 ; 64 1c398: f1 cf rjmp .-30 ; 0x1c37c break; case ClCheckMode::_Strict: MENU_ITEM_TOGGLE_P(msg, _T(MSG_STRICT), func); 1c39a: 85 e4 ldi r24, 0x45 ; 69 1c39c: 90 e4 ldi r25, 0x40 ; 64 1c39e: ee cf rjmp .-36 ; 0x1c37c 0001c3a0 : } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) strncpy_P(lcd_status_message, message, LCD_WIDTH); 1c3a0: 44 e1 ldi r20, 0x14 ; 20 1c3a2: 50 e0 ldi r21, 0x00 ; 0 return false; } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) 1c3a4: 66 23 and r22, r22 1c3a6: 89 f0 breq .+34 ; 0x1c3ca strncpy_P(lcd_status_message, message, LCD_WIDTH); 1c3a8: bc 01 movw r22, r24 1c3aa: 89 e0 ldi r24, 0x09 ; 9 1c3ac: 95 e0 ldi r25, 0x05 ; 5 1c3ae: 0f 94 c9 9d call 0x33b92 ; 0x33b92 else strncpy(lcd_status_message, message, LCD_WIDTH); lcd_status_message[LCD_WIDTH] = 0; 1c3b2: 10 92 1d 05 sts 0x051D, r1 ; 0x80051d <_ZL18lcd_status_message.lto_priv.421+0x14> lcd_status_message_idx = 0; // Print message from beginning 1c3b6: 10 92 08 05 sts 0x0508, r1 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.417> SERIAL_PROTOCOLLNRPGM(MSG_LCD_STATUS_CHANGED); 1c3ba: 86 ed ldi r24, 0xD6 ; 214 1c3bc: 97 e6 ldi r25, 0x67 ; 103 1c3be: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; 1c3c2: 81 e0 ldi r24, 0x01 ; 1 1c3c4: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } 1c3c8: 08 95 ret static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) strncpy_P(lcd_status_message, message, LCD_WIDTH); else strncpy(lcd_status_message, message, LCD_WIDTH); 1c3ca: bc 01 movw r22, r24 1c3cc: 89 e0 ldi r24, 0x09 ; 9 1c3ce: 95 e0 ldi r25, 0x05 ; 5 1c3d0: 0f 94 5c a6 call 0x34cb8 ; 0x34cb8 1c3d4: ee cf rjmp .-36 ; 0x1c3b2 0001c3d6 : } static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) 1c3d6: 90 91 8e 03 lds r25, 0x038E ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.408> 1c3da: 89 17 cp r24, r25 1c3dc: 80 f4 brcc .+32 ; 0x1c3fe return true; // check if we can override an info message yet if (lcd_status_message_level == LCD_STATUS_INFO) { 1c3de: 91 30 cpi r25, 0x01 ; 1 1c3e0: 61 f4 brne .+24 ; 0x1c3fa } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 1c3e2: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL26lcd_status_message_timeout.lto_priv.420> 1c3e6: 88 23 and r24, r24 1c3e8: 51 f0 breq .+20 ; 0x1c3fe 1c3ea: 40 e2 ldi r20, 0x20 ; 32 1c3ec: 5e e4 ldi r21, 0x4E ; 78 1c3ee: 60 e0 ldi r22, 0x00 ; 0 1c3f0: 70 e0 ldi r23, 0x00 ; 0 1c3f2: 8e e1 ldi r24, 0x1E ; 30 1c3f4: 95 e0 ldi r25, 0x05 ; 5 1c3f6: 0d 94 e2 0f jmp 0x21fc4 ; 0x21fc4 ::expired(unsigned long)> return lcd_status_message_timeout.expired_cont(LCD_STATUS_INFO_TIMEOUT); } return false; 1c3fa: 80 e0 ldi r24, 0x00 ; 0 1c3fc: 08 95 ret static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) return true; 1c3fe: 81 e0 ldi r24, 0x01 ; 1 if (lcd_status_message_level == LCD_STATUS_INFO) { return lcd_status_message_timeout.expired_cont(LCD_STATUS_INFO_TIMEOUT); } return false; } 1c400: 08 95 ret 0001c402 : { lcd_setalertstatus_(message, severity, false); } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { 1c402: ef 92 push r14 1c404: ff 92 push r15 1c406: 1f 93 push r17 1c408: cf 93 push r28 1c40a: df 93 push r29 1c40c: ec 01 movw r28, r24 1c40e: 16 2f mov r17, r22 lcd_status_message_timeout.start(); } void lcd_setalertstatus_(const char* message, uint8_t severity, bool progmem) { if (lcd_message_check(severity)) { 1c410: 86 2f mov r24, r22 1c412: 0e 94 eb e1 call 0x1c3d6 ; 0x1c3d6 1c416: 88 23 and r24, r24 1c418: e9 f0 breq .+58 ; 0x1c454 bool same = !(progmem? strcmp_P(lcd_status_message, message): 1c41a: be 01 movw r22, r28 1c41c: 89 e0 ldi r24, 0x09 ; 9 1c41e: 95 e0 ldi r25, 0x05 ; 5 1c420: 0f 94 8a 9d call 0x33b14 ; 0x33b14 1c424: 7c 01 movw r14, r24 strcmp(lcd_status_message, message)); lcd_status_message_timeout.start(); 1c426: 8e e1 ldi r24, 0x1E ; 30 1c428: 95 e0 ldi r25, 0x05 ; 5 1c42a: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> lcd_status_message_level = severity; 1c42e: 10 93 8e 03 sts 0x038E, r17 ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.408> custom_message_type = CustomMsg::Status; 1c432: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 custom_message_state = 0; 1c436: 10 92 ac 03 sts 0x03AC, r1 ; 0x8003ac if (!same) { 1c43a: ef 28 or r14, r15 1c43c: 59 f0 breq .+22 ; 0x1c454 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 1c43e: 61 e0 ldi r22, 0x01 ; 1 1c440: ce 01 movw r24, r28 1c442: 0e 94 d0 e1 call 0x1c3a0 ; 0x1c3a0 } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 1c446: df 91 pop r29 1c448: cf 91 pop r28 1c44a: 1f 91 pop r17 1c44c: ff 90 pop r15 1c44e: ef 90 pop r14 custom_message_type = CustomMsg::Status; custom_message_state = 0; if (!same) { // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); lcd_return_to_status(); 1c450: 0c 94 17 fe jmp 0x1fc2e ; 0x1fc2e } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 1c454: df 91 pop r29 1c456: cf 91 pop r28 1c458: 1f 91 pop r17 1c45a: ff 90 pop r15 1c45c: ef 90 pop r14 1c45e: 08 95 ret 0001c460 : manage_inactivity(true); return _stepresult; } static void lcd_selftest_error(TestError testError, const char *_error_1, const char *_error_2) { 1c460: ef 92 push r14 1c462: ff 92 push r15 1c464: 1f 93 push r17 1c466: cf 93 push r28 1c468: df 93 push r29 1c46a: 18 2f mov r17, r24 1c46c: eb 01 movw r28, r22 1c46e: 7a 01 movw r14, r20 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 1c470: 80 e0 ldi r24, 0x00 ; 0 1c472: 0f 94 9f 2c call 0x2593e ; 0x2593e lcd_beeper_quick_feedback(); FORCE_BL_ON_END; target_temperature[0] = 0; 1c476: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 1c47a: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 target_temperature_bed = 0; 1c47e: 10 92 ee 11 sts 0x11EE, r1 ; 0x8011ee 1c482: 10 92 ed 11 sts 0x11ED, r1 ; 0x8011ed manage_heater(); 1c486: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(); 1c48a: 80 e0 ldi r24, 0x00 ; 0 1c48c: 0e 94 01 7a call 0xf402 ; 0xf402 lcd_clear(); 1c490: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_ERROR)); 1c494: 85 e1 ldi r24, 0x15 ; 21 1c496: 9f e3 ldi r25, 0x3F ; 63 1c498: 0e 94 b1 6c call 0xd962 ; 0xd962 1c49c: ac 01 movw r20, r24 1c49e: 60 e0 ldi r22, 0x00 ; 0 1c4a0: 80 e0 ldi r24, 0x00 ; 0 1c4a2: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_puts_at_P(0, 1, _T(MSG_SELFTEST_PLEASECHECK)); 1c4a6: 85 e0 ldi r24, 0x05 ; 5 1c4a8: 9f e3 ldi r25, 0x3F ; 63 1c4aa: 0e 94 b1 6c call 0xd962 ; 0xd962 1c4ae: ac 01 movw r20, r24 1c4b0: 61 e0 ldi r22, 0x01 ; 1 1c4b2: 80 e0 ldi r24, 0x00 ; 0 1c4b4: 0e 94 8f 69 call 0xd31e ; 0xd31e switch (testError) 1c4b8: 11 50 subi r17, 0x01 ; 1 1c4ba: 19 30 cpi r17, 0x09 ; 9 1c4bc: 88 f4 brcc .+34 ; 0x1c4e0 1c4be: e1 2f mov r30, r17 1c4c0: f0 e0 ldi r31, 0x00 ; 0 1c4c2: 88 27 eor r24, r24 1c4c4: e9 59 subi r30, 0x99 ; 153 1c4c6: fd 41 sbci r31, 0x1D ; 29 1c4c8: 8f 4f sbci r24, 0xFF ; 255 1c4ca: 0d 94 ec a0 jmp 0x341d8 ; 0x341d8 <__tablejump2__> 1c4ce: a8 e2 ldi r26, 0x28 ; 40 1c4d0: b4 e2 ldi r27, 0x24 ; 36 1c4d2: cc e2 ldi r28, 0x2C ; 44 1c4d4: ed e2 ldi r30, 0x2D ; 45 1c4d6: f9 e2 ldi r31, 0x29 ; 41 1c4d8: fc e2 ldi r31, 0x2C ; 44 1c4da: ff e2 ldi r31, 0x2F ; 47 1c4dc: 02 e3 ldi r16, 0x32 ; 50 1c4de: 0e e3 ldi r16, 0x3E ; 62 { case TestError::Heater: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_HEATERTHERMISTOR)); 1c4e0: 81 ef ldi r24, 0xF1 ; 241 1c4e2: 9e e3 ldi r25, 0x3E ; 62 1c4e4: 0e 94 b1 6c call 0xd962 ; 0xd962 1c4e8: ac 01 movw r20, r24 1c4ea: 62 e0 ldi r22, 0x02 ; 2 1c4ec: 80 e0 ldi r24, 0x00 ; 0 1c4ee: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_NOTCONNECTED)); 1c4f2: 81 ee ldi r24, 0xE1 ; 225 1c4f4: 9e e3 ldi r25, 0x3E ; 62 break; case TestError::Bed: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_BEDHEATER)); lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 1c4f6: 0e 94 b1 6c call 0xd962 ; 0xd962 1c4fa: ac 01 movw r20, r24 1c4fc: 63 e0 ldi r22, 0x03 ; 3 1c4fe: 80 e0 ldi r24, 0x00 ; 0 1c500: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_set_cursor(0, 3); lcd_printf_P(_T(MSG_SELFTEST_FS_LEVEL),_error_1); break; } _delay(1000); 1c504: 68 ee ldi r22, 0xE8 ; 232 1c506: 73 e0 ldi r23, 0x03 ; 3 1c508: 80 e0 ldi r24, 0x00 ; 0 1c50a: 90 e0 ldi r25, 0x00 ; 0 1c50c: 0f 94 7b 0d call 0x21af6 ; 0x21af6 1c510: 80 e0 ldi r24, 0x00 ; 0 1c512: 0f 94 9f 2c call 0x2593e ; 0x2593e lcd_beeper_quick_feedback(); do { _delay(100); 1c516: 64 e6 ldi r22, 0x64 ; 100 1c518: 70 e0 ldi r23, 0x00 ; 0 1c51a: 80 e0 ldi r24, 0x00 ; 0 1c51c: 90 e0 ldi r25, 0x00 ; 0 1c51e: 0f 94 7b 0d call 0x21af6 ; 0x21af6 manage_heater(); 1c522: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(); 1c526: 80 e0 ldi r24, 0x00 ; 0 1c528: 0e 94 01 7a call 0xf402 ; 0xf402 } while (!lcd_clicked()); 1c52c: 0e 94 98 6b call 0xd730 ; 0xd730 1c530: 88 23 and r24, r24 1c532: 89 f3 breq .-30 ; 0x1c516 LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 1c534: 87 e6 ldi r24, 0x67 ; 103 1c536: 9f e3 ldi r25, 0x3F ; 63 1c538: 0e 94 b1 6c call 0xd962 ; 0xd962 1c53c: 62 e0 ldi r22, 0x02 ; 2 1c53e: 0e 94 01 e2 call 0x1c402 ; 0x1c402 lcd_return_to_status(); } 1c542: df 91 pop r29 1c544: cf 91 pop r28 1c546: 1f 91 pop r17 1c548: ff 90 pop r15 1c54a: ef 90 pop r14 manage_heater(); manage_inactivity(); } while (!lcd_clicked()); LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); lcd_return_to_status(); 1c54c: 0c 94 17 fe jmp 0x1fc2e ; 0x1fc2e case TestError::Heater: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_HEATERTHERMISTOR)); lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_NOTCONNECTED)); break; case TestError::Bed: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_BEDHEATER)); 1c550: 84 ed ldi r24, 0xD4 ; 212 1c552: 9e e3 ldi r25, 0x3E ; 62 1c554: 0e 94 b1 6c call 0xd962 ; 0xd962 1c558: ac 01 movw r20, r24 1c55a: 62 e0 ldi r22, 0x02 ; 2 1c55c: 80 e0 ldi r24, 0x00 ; 0 1c55e: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 1c562: 85 ec ldi r24, 0xC5 ; 197 1c564: 9e e3 ldi r25, 0x3E ; 62 1c566: c7 cf rjmp .-114 ; 0x1c4f6 break; case TestError::Endstops: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_ENDSTOPS)); 1c568: 8a eb ldi r24, 0xBA ; 186 1c56a: 9e e3 ldi r25, 0x3E ; 62 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::ExtruderFan: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_HOTEND_FAN)); 1c56c: 0e 94 b1 6c call 0xd962 ; 0xd962 1c570: ac 01 movw r20, r24 1c572: 62 e0 ldi r22, 0x02 ; 2 1c574: 80 e0 ldi r24, 0x00 ; 0 1c576: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 1c57a: 85 ec ldi r24, 0xC5 ; 197 1c57c: 9e e3 ldi r25, 0x3E ; 62 lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::SwappedFan: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FANS)); lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_SWAPPED)); 1c57e: 0e 94 b1 6c call 0xd962 ; 0xd962 1c582: ac 01 movw r20, r24 1c584: 63 e0 ldi r22, 0x03 ; 3 1c586: 80 e0 ldi r24, 0x00 ; 0 1c588: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_set_cursor(18, 3); 1c58c: 63 e0 ldi r22, 0x03 ; 3 1c58e: 82 e1 ldi r24, 0x12 ; 18 1c590: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_print(_error_1); 1c594: ce 01 movw r24, r28 1c596: 1e c0 rjmp .+60 ; 0x1c5d4 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::Motor: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_MOTOR)); 1c598: 82 eb ldi r24, 0xB2 ; 178 1c59a: 9e e3 ldi r25, 0x3E ; 62 1c59c: 0e 94 b1 6c call 0xd962 ; 0xd962 1c5a0: ac 01 movw r20, r24 1c5a2: 62 e0 ldi r22, 0x02 ; 2 1c5a4: 80 e0 ldi r24, 0x00 ; 0 1c5a6: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_set_cursor(18, 2); 1c5aa: 62 e0 ldi r22, 0x02 ; 2 1c5ac: 82 e1 ldi r24, 0x12 ; 18 1c5ae: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_print(_error_1); 1c5b2: ce 01 movw r24, r28 1c5b4: 0e 94 82 6b call 0xd704 ; 0xd704 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_ENDSTOP)); 1c5b8: 88 ea ldi r24, 0xA8 ; 168 1c5ba: 9e e3 ldi r25, 0x3E ; 62 1c5bc: 0e 94 b1 6c call 0xd962 ; 0xd962 1c5c0: ac 01 movw r20, r24 1c5c2: 63 e0 ldi r22, 0x03 ; 3 1c5c4: 80 e0 ldi r24, 0x00 ; 0 1c5c6: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_set_cursor(18, 3); 1c5ca: 63 e0 ldi r22, 0x03 ; 3 1c5cc: 82 e1 ldi r24, 0x12 ; 18 1c5ce: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_print(_error_2); 1c5d2: c7 01 movw r24, r14 break; case TestError::SwappedFan: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FANS)); lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_SWAPPED)); lcd_set_cursor(18, 3); lcd_print(_error_1); 1c5d4: 0e 94 82 6b call 0xd704 ; 0xd704 1c5d8: 95 cf rjmp .-214 ; 0x1c504 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_ENDSTOP)); lcd_set_cursor(18, 3); lcd_print(_error_2); break; case TestError::Endstop: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_ENDSTOP_NOTHIT)); 1c5da: 86 e9 ldi r24, 0x96 ; 150 1c5dc: 9e e3 ldi r25, 0x3E ; 62 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::Pulley: lcd_puts_at_P(0, 2, _T(MSG_LOOSE_PULLEY)); 1c5de: 0e 94 b1 6c call 0xd962 ; 0xd962 1c5e2: ac 01 movw r20, r24 1c5e4: 62 e0 ldi r22, 0x02 ; 2 1c5e6: 80 e0 ldi r24, 0x00 ; 0 1c5e8: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_MOTOR)); 1c5ec: 82 eb ldi r24, 0xB2 ; 178 1c5ee: 9e e3 ldi r25, 0x3E ; 62 1c5f0: c6 cf rjmp .-116 ; 0x1c57e lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_MOTOR)); lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::PrintFan: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_PART_FAN)); 1c5f2: 89 ed ldi r24, 0xD9 ; 217 1c5f4: 93 e4 ldi r25, 0x43 ; 67 1c5f6: ba cf rjmp .-140 ; 0x1c56c lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::ExtruderFan: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_HOTEND_FAN)); 1c5f8: 86 ec ldi r24, 0xC6 ; 198 1c5fa: 93 e4 ldi r25, 0x43 ; 67 1c5fc: b7 cf rjmp .-146 ; 0x1c56c lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::Pulley: lcd_puts_at_P(0, 2, _T(MSG_LOOSE_PULLEY)); 1c5fe: 87 e8 ldi r24, 0x87 ; 135 1c600: 9e e3 ldi r25, 0x3E ; 62 1c602: ed cf rjmp .-38 ; 0x1c5de lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_MOTOR)); lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::Axis: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_AXIS_LENGTH)); 1c604: 89 e7 ldi r24, 0x79 ; 121 1c606: 9e e3 ldi r25, 0x3E ; 62 1c608: 0e 94 b1 6c call 0xd962 ; 0xd962 1c60c: ac 01 movw r20, r24 1c60e: 62 e0 ldi r22, 0x02 ; 2 1c610: 80 e0 ldi r24, 0x00 ; 0 1c612: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_AXIS)); 1c616: 82 e7 ldi r24, 0x72 ; 114 1c618: 9e e3 ldi r25, 0x3E ; 62 1c61a: b1 cf rjmp .-158 ; 0x1c57e lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::SwappedFan: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FANS)); 1c61c: 80 e6 ldi r24, 0x60 ; 96 1c61e: 9e e3 ldi r25, 0x3E ; 62 1c620: 0e 94 b1 6c call 0xd962 ; 0xd962 1c624: ac 01 movw r20, r24 1c626: 62 e0 ldi r22, 0x02 ; 2 1c628: 80 e0 ldi r24, 0x00 ; 0 1c62a: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_SWAPPED)); 1c62e: 86 e5 ldi r24, 0x56 ; 86 1c630: 9e e3 ldi r25, 0x3E ; 62 1c632: a5 cf rjmp .-182 ; 0x1c57e 0001c634 : manage_inactivity(true); return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { 1c634: 8f 92 push r8 1c636: 9f 92 push r9 1c638: af 92 push r10 1c63a: bf 92 push r11 1c63c: cf 92 push r12 1c63e: df 92 push r13 1c640: ef 92 push r14 1c642: ff 92 push r15 1c644: 0f 93 push r16 1c646: 1f 93 push r17 1c648: cf 93 push r28 1c64a: df 93 push r29 1c64c: f8 2e mov r15, r24 1c64e: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 1c652: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 1c656: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 1c65a: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 1c65e: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 1c662: 4b 01 movw r8, r22 1c664: 6b 01 movw r12, r22 1c666: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 1c66a: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 1c66e: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 1c672: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 1c676: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 1c67a: eb 01 movw r28, r22 uint8_t _progress = 0; int _checked_snapshot = (_isbed) ? degBed() : degHotend(0); int _opposite_snapshot = (_isbed) ? degHotend(0) : degBed(); uint8_t _cycles = (_isbed) ? 180 : 60; //~ 90s / 30s 1c67c: 9c e3 ldi r25, 0x3C ; 60 1c67e: a9 2e mov r10, r25 target_temperature[0] = (_isbed) ? 0 : 200; 1c680: 88 ec ldi r24, 0xC8 ; 200 1c682: 90 e0 ldi r25, 0x00 ; 0 } static bool lcd_selfcheck_check_heater(bool _isbed) { uint8_t _progress = 0; int _checked_snapshot = (_isbed) ? degBed() : degHotend(0); 1c684: ff 20 and r15, r15 1c686: 31 f0 breq .+12 ; 0x1c694 1c688: 6b 01 movw r12, r22 int _opposite_snapshot = (_isbed) ? degHotend(0) : degBed(); 1c68a: e4 01 movw r28, r8 uint8_t _cycles = (_isbed) ? 180 : 60; //~ 90s / 30s 1c68c: 24 eb ldi r18, 0xB4 ; 180 1c68e: a2 2e mov r10, r18 target_temperature[0] = (_isbed) ? 0 : 200; 1c690: 90 e0 ldi r25, 0x00 ; 0 1c692: 80 e0 ldi r24, 0x00 ; 0 1c694: 90 93 f2 11 sts 0x11F2, r25 ; 0x8011f2 1c698: 80 93 f1 11 sts 0x11F1, r24 ; 0x8011f1 target_temperature_bed = (_isbed) ? 100 : 0; 1c69c: 84 e6 ldi r24, 0x64 ; 100 1c69e: 90 e0 ldi r25, 0x00 ; 0 1c6a0: f1 10 cpse r15, r1 1c6a2: 02 c0 rjmp .+4 ; 0x1c6a8 1c6a4: 90 e0 ldi r25, 0x00 ; 0 1c6a6: 80 e0 ldi r24, 0x00 ; 0 1c6a8: 90 93 ee 11 sts 0x11EE, r25 ; 0x8011ee 1c6ac: 80 93 ed 11 sts 0x11ED, r24 ; 0x8011ed #ifdef THERMAL_MODEL bool tm_was_enabled = thermal_model_enabled(); thermal_model_set_enabled(false); #endif //THERMAL_MODEL manage_heater(); 1c6b0: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(true); 1c6b4: 81 e0 ldi r24, 0x01 ; 1 1c6b6: 0e 94 01 7a call 0xf402 ; 0xf402 for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1c6ba: e1 2c mov r14, r1 return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { uint8_t _progress = 0; 1c6bc: b1 2c mov r11, r1 } else { MYSERIAL.print("Hotend temp:"); MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds 1c6be: 85 e0 ldi r24, 0x05 ; 5 1c6c0: 98 2e mov r9, r24 thermal_model_set_enabled(false); #endif //THERMAL_MODEL manage_heater(); manage_inactivity(true); for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1c6c2: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 1c6c6: 81 11 cpse r24, r1 1c6c8: 1c c0 rjmp .+56 ; 0x1c702 { manage_heater(); 1c6ca: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(true); 1c6ce: 81 e0 ldi r24, 0x01 ; 1 1c6d0: 0e 94 01 7a call 0xf402 ; 0xf402 _progress = (_isbed? 1c6d4: 00 e9 ldi r16, 0x90 ; 144 1c6d6: 11 e0 ldi r17, 0x01 ; 1 1c6d8: 20 e0 ldi r18, 0x00 ; 0 1c6da: 42 e0 ldi r20, 0x02 ; 2 1c6dc: 6b 2d mov r22, r11 1c6de: 87 e0 ldi r24, 0x07 ; 7 1c6e0: f1 10 cpse r15, r1 1c6e2: 01 c0 rjmp .+2 ; 0x1c6e6 1c6e4: 88 e0 ldi r24, 0x08 ; 8 1c6e6: 0e 94 38 b9 call 0x17270 ; 0x17270 1c6ea: b8 2e mov r11, r24 } else { MYSERIAL.print("Hotend temp:"); MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds 1c6ec: 8e 2d mov r24, r14 1c6ee: 69 2d mov r22, r9 1c6f0: 0f 94 8b a0 call 0x34116 ; 0x34116 <__udivmodqi4> 1c6f4: 91 11 cpse r25, r1 1c6f6: 02 c0 rjmp .+4 ; 0x1c6fc 1c6f8: 0e 94 68 70 call 0xe0d0 ; 0xe0d0 thermal_model_set_enabled(false); #endif //THERMAL_MODEL manage_heater(); manage_inactivity(true); for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1c6fc: e3 94 inc r14 1c6fe: ea 10 cpse r14, r10 1c700: e0 cf rjmp .-64 ; 0x1c6c2 MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds } target_temperature[0] = 0; 1c702: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 1c706: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 target_temperature_bed = 0; 1c70a: 10 92 ee 11 sts 0x11EE, r1 ; 0x8011ee 1c70e: 10 92 ed 11 sts 0x11ED, r1 ; 0x8011ed manage_heater(); 1c712: 0f 94 5b 32 call 0x264b6 ; 0x264b6 1c716: b6 01 movw r22, r12 1c718: dd 0c add r13, r13 1c71a: 88 0b sbc r24, r24 1c71c: 99 0b sbc r25, r25 1c71e: 4e 01 movw r8, r28 1c720: dd 0f add r29, r29 1c722: aa 08 sbc r10, r10 1c724: bb 08 sbc r11, r11 int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1c726: ff 20 and r15, r15 1c728: 09 f4 brne .+2 ; 0x1c72c 1c72a: 4d c0 rjmp .+154 ; 0x1c7c6 1c72c: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 1c730: 9b 01 movw r18, r22 1c732: ac 01 movw r20, r24 1c734: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 1c738: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 1c73c: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 1c740: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 1c744: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1c748: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 1c74c: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1c74e: c5 01 movw r24, r10 1c750: b4 01 movw r22, r8 1c752: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 1c756: 9b 01 movw r18, r22 1c758: ac 01 movw r20, r24 1c75a: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 1c75e: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 1c762: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 1c766: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 1c76a: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1c76e: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1c772: 10 91 ce 11 lds r17, 0x11CE ; 0x8011ce 1c776: 11 11 cpse r17, r1 1c778: 0c c0 rjmp .+24 ; 0x1c792 1c77a: f1 10 cpse r15, r1 1c77c: 44 c0 rjmp .+136 ; 0x1c806 1c77e: 69 30 cpi r22, 0x09 ; 9 1c780: 71 05 cpc r23, r1 1c782: 0c f0 brlt .+2 ; 0x1c786 1c784: 46 c0 rjmp .+140 ; 0x1c812 { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1c786: 8e e1 ldi r24, 0x1E ; 30 1c788: 90 e0 ldi r25, 0x00 ; 0 _stepresult = true; 1c78a: 11 e0 ldi r17, 0x01 ; 1 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1c78c: c8 17 cp r28, r24 1c78e: d9 07 cpc r29, r25 1c790: 3c f4 brge .+14 ; 0x1c7a0 _stepresult = true; else lcd_selftest_error(TestError::Heater, "", ""); 1c792: 4a ed ldi r20, 0xDA ; 218 1c794: 52 e0 ldi r21, 0x02 ; 2 1c796: ba 01 movw r22, r20 1c798: 80 e0 ldi r24, 0x00 ; 0 1c79a: 0e 94 30 e2 call 0x1c460 ; 0x1c460 MYSERIAL.println(_checked_result); MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; 1c79e: 10 e0 ldi r17, 0x00 ; 0 } #ifdef THERMAL_MODEL thermal_model_set_enabled(tm_was_enabled); #endif //THERMAL_MODEL manage_heater(); 1c7a0: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(true); 1c7a4: 81 e0 ldi r24, 0x01 ; 1 1c7a6: 0e 94 01 7a call 0xf402 ; 0xf402 return _stepresult; } 1c7aa: 81 2f mov r24, r17 1c7ac: df 91 pop r29 1c7ae: cf 91 pop r28 1c7b0: 1f 91 pop r17 1c7b2: 0f 91 pop r16 1c7b4: ff 90 pop r15 1c7b6: ef 90 pop r14 1c7b8: df 90 pop r13 1c7ba: cf 90 pop r12 1c7bc: bf 90 pop r11 1c7be: af 90 pop r10 1c7c0: 9f 90 pop r9 1c7c2: 8f 90 pop r8 1c7c4: 08 95 ret target_temperature[0] = 0; target_temperature_bed = 0; manage_heater(); int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1c7c6: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 1c7ca: 9b 01 movw r18, r22 1c7cc: ac 01 movw r20, r24 1c7ce: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 1c7d2: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 1c7d6: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 1c7da: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 1c7de: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1c7e2: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 1c7e6: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1c7e8: c5 01 movw r24, r10 1c7ea: b4 01 movw r22, r8 1c7ec: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 1c7f0: 9b 01 movw r18, r22 1c7f2: ac 01 movw r20, r24 1c7f4: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 1c7f8: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 1c7fc: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 1c800: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 1c804: b2 cf rjmp .-156 ; 0x1c76a */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1c806: 89 e0 ldi r24, 0x09 ; 9 1c808: 90 e0 ldi r25, 0x00 ; 0 MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1c80a: 6e 31 cpi r22, 0x1E ; 30 1c80c: 71 05 cpc r23, r1 1c80e: 0c f4 brge .+2 ; 0x1c812 1c810: bc cf rjmp .-136 ; 0x1c78a else lcd_selftest_error(TestError::Heater, "", ""); } else { lcd_selftest_error(TestError::Bed, "", ""); 1c812: 4a ed ldi r20, 0xDA ; 218 1c814: 52 e0 ldi r21, 0x02 ; 2 1c816: ba 01 movw r22, r20 1c818: 81 e0 ldi r24, 0x01 ; 1 1c81a: 0e 94 30 e2 call 0x1c460 ; 0x1c460 1c81e: c0 cf rjmp .-128 ; 0x1c7a0 0001c820 : return _stepresult; } static bool lcd_selfcheck_pulleys(int axis) { 1c820: 2f 92 push r2 1c822: 3f 92 push r3 1c824: 4f 92 push r4 1c826: 5f 92 push r5 1c828: 6f 92 push r6 1c82a: 7f 92 push r7 1c82c: 8f 92 push r8 1c82e: 9f 92 push r9 1c830: af 92 push r10 1c832: bf 92 push r11 1c834: cf 92 push r12 1c836: df 92 push r13 1c838: ef 92 push r14 1c83a: ff 92 push r15 1c83c: 0f 93 push r16 1c83e: 1f 93 push r17 1c840: cf 93 push r28 1c842: df 93 push r29 1c844: 8c 01 movw r16, r24 float current_position_init; float move; bool endstop_triggered = false; int i; unsigned long timeout_counter; refresh_cmd_timeout(); 1c846: 0e 94 c9 5f call 0xbf92 ; 0xbf92 manage_inactivity(true); 1c84a: 81 e0 ldi r24, 0x01 ; 1 1c84c: 0e 94 01 7a call 0xf402 ; 0xf402 if (axis == 0) move = 50; //X_AXIS else move = 50; //Y_AXIS current_position_init = current_position[axis]; 1c850: 18 01 movw r2, r16 1c852: 22 0c add r2, r2 1c854: 33 1c adc r3, r3 1c856: 22 0c add r2, r2 1c858: 33 1c adc r3, r3 1c85a: e1 01 movw r28, r2 1c85c: cb 50 subi r28, 0x0B ; 11 1c85e: de 4e sbci r29, 0xEE ; 238 1c860: 88 80 ld r8, Y 1c862: 99 80 ldd r9, Y+1 ; 0x01 1c864: aa 80 ldd r10, Y+2 ; 0x02 1c866: bb 80 ldd r11, Y+3 ; 0x03 current_position[axis] += 2; 1c868: 20 e0 ldi r18, 0x00 ; 0 1c86a: 30 e0 ldi r19, 0x00 ; 0 1c86c: 40 e0 ldi r20, 0x00 ; 0 1c86e: 50 e4 ldi r21, 0x40 ; 64 1c870: c5 01 movw r24, r10 1c872: b4 01 movw r22, r8 1c874: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1c878: 68 83 st Y, r22 1c87a: 79 83 std Y+1, r23 ; 0x01 1c87c: 8a 83 std Y+2, r24 ; 0x02 1c87e: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1c880: 60 e0 ldi r22, 0x00 ; 0 1c882: 70 e0 ldi r23, 0x00 ; 0 1c884: 84 e3 ldi r24, 0x34 ; 52 1c886: 92 e4 ldi r25, 0x42 ; 66 1c888: 0f 94 70 84 call 0x308e0 ; 0x308e0 1c88c: 95 e0 ldi r25, 0x05 ; 5 1c88e: e9 2e mov r14, r25 1c890: f1 2c mov r15, r1 for (i = 0; i < 5; i++) { refresh_cmd_timeout(); 1c892: 0e 94 c9 5f call 0xbf92 ; 0xbf92 current_position[axis] = current_position[axis] + move; 1c896: 20 e0 ldi r18, 0x00 ; 0 1c898: 30 e0 ldi r19, 0x00 ; 0 1c89a: 48 e4 ldi r20, 0x48 ; 72 1c89c: 52 e4 ldi r21, 0x42 ; 66 1c89e: 68 81 ld r22, Y 1c8a0: 79 81 ldd r23, Y+1 ; 0x01 1c8a2: 8a 81 ldd r24, Y+2 ; 0x02 1c8a4: 9b 81 ldd r25, Y+3 ; 0x03 1c8a6: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1c8aa: 68 83 st Y, r22 1c8ac: 79 83 std Y+1, r23 ; 0x01 1c8ae: 8a 83 std Y+2, r24 ; 0x02 1c8b0: 9b 83 std Y+3, r25 ; 0x03 } #ifdef MOTOR_CURRENT_PWM_XY_PIN void st_current_set(uint8_t driver, int current) { if (driver == 0) analogWrite(MOTOR_CURRENT_PWM_XY_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 1c8b2: 6c e6 ldi r22, 0x6C ; 108 1c8b4: 70 e0 ldi r23, 0x00 ; 0 1c8b6: 8e e2 ldi r24, 0x2E ; 46 1c8b8: 0e 94 71 c0 call 0x180e2 ; 0x180e2 st_current_set(0, 850); //set motor current higher plan_buffer_line_curposXYZE(200); 1c8bc: 60 e0 ldi r22, 0x00 ; 0 1c8be: 70 e0 ldi r23, 0x00 ; 0 1c8c0: 88 e4 ldi r24, 0x48 ; 72 1c8c2: 93 e4 ldi r25, 0x43 ; 67 1c8c4: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 1c8c8: 0f 94 42 22 call 0x24484 ; 0x24484 if (SilentModeMenu != SILENT_MODE_OFF) st_current_set(0, tmp_motor[0]); //set back to normal operation currents 1c8cc: 80 91 89 03 lds r24, 0x0389 ; 0x800389 1c8d0: 62 e2 ldi r22, 0x22 ; 34 1c8d2: 70 e0 ldi r23, 0x00 ; 0 1c8d4: 81 11 cpse r24, r1 1c8d6: 02 c0 rjmp .+4 ; 0x1c8dc 1c8d8: 64 e4 ldi r22, 0x44 ; 68 1c8da: 70 e0 ldi r23, 0x00 ; 0 1c8dc: 8e e2 ldi r24, 0x2E ; 46 1c8de: 0e 94 71 c0 call 0x180e2 ; 0x180e2 else st_current_set(0, tmp_motor_loud[0]); //set motor current back current_position[axis] = current_position[axis] - move; 1c8e2: 20 e0 ldi r18, 0x00 ; 0 1c8e4: 30 e0 ldi r19, 0x00 ; 0 1c8e6: 48 e4 ldi r20, 0x48 ; 72 1c8e8: 52 e4 ldi r21, 0x42 ; 66 1c8ea: 68 81 ld r22, Y 1c8ec: 79 81 ldd r23, Y+1 ; 0x01 1c8ee: 8a 81 ldd r24, Y+2 ; 0x02 1c8f0: 9b 81 ldd r25, Y+3 ; 0x03 1c8f2: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1c8f6: 68 83 st Y, r22 1c8f8: 79 83 std Y+1, r23 ; 0x01 1c8fa: 8a 83 std Y+2, r24 ; 0x02 1c8fc: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(50); 1c8fe: 60 e0 ldi r22, 0x00 ; 0 1c900: 70 e0 ldi r23, 0x00 ; 0 1c902: 88 e4 ldi r24, 0x48 ; 72 1c904: 92 e4 ldi r25, 0x42 ; 66 1c906: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 1c90a: 0f 94 42 22 call 0x24484 ; 0x24484 if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1c90e: 1e 99 sbic 0x03, 6 ; 3 1c910: 3a c0 rjmp .+116 ; 0x1c986 1c912: 1d 99 sbic 0x03, 5 ; 3 1c914: 38 c0 rjmp .+112 ; 0x1c986 1c916: 21 e0 ldi r18, 0x01 ; 1 1c918: e2 1a sub r14, r18 1c91a: f1 08 sbc r15, r1 current_position_init = current_position[axis]; current_position[axis] += 2; plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); for (i = 0; i < 5; i++) { 1c91c: 09 f0 breq .+2 ; 0x1c920 1c91e: b9 cf rjmp .-142 ; 0x1c892 ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) { lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", ""); return(false); } } timeout_counter = _millis() + 2500; 1c920: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 1c924: 2b 01 movw r4, r22 1c926: 3c 01 movw r6, r24 1c928: 24 ec ldi r18, 0xC4 ; 196 1c92a: 42 0e add r4, r18 1c92c: 29 e0 ldi r18, 0x09 ; 9 1c92e: 52 1e adc r5, r18 1c930: 61 1c adc r6, r1 1c932: 71 1c adc r7, r1 endstop_triggered = false; manage_inactivity(true); 1c934: 81 e0 ldi r24, 0x01 ; 1 1c936: 0e 94 01 7a call 0xf402 ; 0xf402 1c93a: e1 01 movw r28, r2 1c93c: cb 50 subi r28, 0x0B ; 11 1c93e: de 4e sbci r29, 0xEE ; 238 1c940: c8 80 ld r12, Y 1c942: d9 80 ldd r13, Y+1 ; 0x01 1c944: ea 80 ldd r14, Y+2 ; 0x02 1c946: fb 80 ldd r15, Y+3 ; 0x03 while (!endstop_triggered) { if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) { endstop_triggered = true; if (current_position_init - 1 <= current_position[axis] && current_position_init + 1 >= current_position[axis]) { 1c948: 20 e0 ldi r18, 0x00 ; 0 1c94a: 30 e0 ldi r19, 0x00 ; 0 1c94c: 40 e8 ldi r20, 0x80 ; 128 1c94e: 5f e3 ldi r21, 0x3F ; 63 } timeout_counter = _millis() + 2500; endstop_triggered = false; manage_inactivity(true); while (!endstop_triggered) { if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1c950: 1e 99 sbic 0x03, 6 ; 3 1c952: 26 c0 rjmp .+76 ; 0x1c9a0 1c954: 1d 99 sbic 0x03, 5 ; 3 1c956: 24 c0 rjmp .+72 ; 0x1c9a0 lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", ""); return(false); } } else { current_position[axis] -= 1; 1c958: c7 01 movw r24, r14 1c95a: b6 01 movw r22, r12 1c95c: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1c960: 68 83 st Y, r22 1c962: 79 83 std Y+1, r23 ; 0x01 1c964: 8a 83 std Y+2, r24 ; 0x02 1c966: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1c968: 60 e0 ldi r22, 0x00 ; 0 1c96a: 70 e0 ldi r23, 0x00 ; 0 1c96c: 84 e3 ldi r24, 0x34 ; 52 1c96e: 92 e4 ldi r25, 0x42 ; 66 1c970: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 1c974: 0f 94 42 22 call 0x24484 ; 0x24484 if (_millis() > timeout_counter) { 1c978: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 1c97c: 46 16 cp r4, r22 1c97e: 57 06 cpc r5, r23 1c980: 68 06 cpc r6, r24 1c982: 79 06 cpc r7, r25 1c984: e8 f6 brcc .-70 ; 0x1c940 lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", ""); 1c986: 6b ed ldi r22, 0xDB ; 219 1c988: 72 e0 ldi r23, 0x02 ; 2 1c98a: 01 2b or r16, r17 1c98c: 11 f0 breq .+4 ; 0x1c992 1c98e: 6d ed ldi r22, 0xDD ; 221 1c990: 72 e0 ldi r23, 0x02 ; 2 1c992: 4a ed ldi r20, 0xDA ; 218 1c994: 52 e0 ldi r21, 0x02 ; 2 1c996: 87 e0 ldi r24, 0x07 ; 7 1c998: 0e 94 30 e2 call 0x1c460 ; 0x1c460 return(false); 1c99c: 80 e0 ldi r24, 0x00 ; 0 1c99e: 30 c0 rjmp .+96 ; 0x1ca00 manage_inactivity(true); while (!endstop_triggered) { if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) { endstop_triggered = true; if (current_position_init - 1 <= current_position[axis] && current_position_init + 1 >= current_position[axis]) { 1c9a0: c5 01 movw r24, r10 1c9a2: b4 01 movw r22, r8 1c9a4: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1c9a8: a7 01 movw r20, r14 1c9aa: 96 01 movw r18, r12 1c9ac: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1c9b0: 18 16 cp r1, r24 1c9b2: 4c f3 brlt .-46 ; 0x1c986 1c9b4: 20 e0 ldi r18, 0x00 ; 0 1c9b6: 30 e0 ldi r19, 0x00 ; 0 1c9b8: 40 e8 ldi r20, 0x80 ; 128 1c9ba: 5f e3 ldi r21, 0x3F ; 63 1c9bc: c5 01 movw r24, r10 1c9be: b4 01 movw r22, r8 1c9c0: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1c9c4: a7 01 movw r20, r14 1c9c6: 96 01 movw r18, r12 1c9c8: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 1c9cc: 87 fd sbrc r24, 7 1c9ce: db cf rjmp .-74 ; 0x1c986 current_position[axis] += 10; 1c9d0: e1 01 movw r28, r2 1c9d2: cb 50 subi r28, 0x0B ; 11 1c9d4: de 4e sbci r29, 0xEE ; 238 1c9d6: 20 e0 ldi r18, 0x00 ; 0 1c9d8: 30 e0 ldi r19, 0x00 ; 0 1c9da: 40 e2 ldi r20, 0x20 ; 32 1c9dc: 51 e4 ldi r21, 0x41 ; 65 1c9de: c7 01 movw r24, r14 1c9e0: b6 01 movw r22, r12 1c9e2: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1c9e6: 68 83 st Y, r22 1c9e8: 79 83 std Y+1, r23 ; 0x01 1c9ea: 8a 83 std Y+2, r24 ; 0x02 1c9ec: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1c9ee: 60 e0 ldi r22, 0x00 ; 0 1c9f0: 70 e0 ldi r23, 0x00 ; 0 1c9f2: 84 e3 ldi r24, 0x34 ; 52 1c9f4: 92 e4 ldi r25, 0x42 ; 66 1c9f6: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 1c9fa: 0f 94 42 22 call 0x24484 ; 0x24484 return(true); 1c9fe: 81 e0 ldi r24, 0x01 ; 1 return(false); } } } return(true); } 1ca00: df 91 pop r29 1ca02: cf 91 pop r28 1ca04: 1f 91 pop r17 1ca06: 0f 91 pop r16 1ca08: ff 90 pop r15 1ca0a: ef 90 pop r14 1ca0c: df 90 pop r13 1ca0e: cf 90 pop r12 1ca10: bf 90 pop r11 1ca12: af 90 pop r10 1ca14: 9f 90 pop r9 1ca16: 8f 90 pop r8 1ca18: 7f 90 pop r7 1ca1a: 6f 90 pop r6 1ca1c: 5f 90 pop r5 1ca1e: 4f 90 pop r4 1ca20: 3f 90 pop r3 1ca22: 2f 90 pop r2 1ca24: 08 95 ret 0001ca26 : } #endif //TMC2130 #ifndef TMC2130 static bool lcd_selfcheck_axis(int _axis, int _travel) { 1ca26: 2f 92 push r2 1ca28: 3f 92 push r3 1ca2a: 4f 92 push r4 1ca2c: 5f 92 push r5 1ca2e: 6f 92 push r6 1ca30: 7f 92 push r7 1ca32: 8f 92 push r8 1ca34: 9f 92 push r9 1ca36: af 92 push r10 1ca38: bf 92 push r11 1ca3a: cf 92 push r12 1ca3c: df 92 push r13 1ca3e: ef 92 push r14 1ca40: ff 92 push r15 1ca42: 0f 93 push r16 1ca44: 1f 93 push r17 1ca46: cf 93 push r28 1ca48: df 93 push r29 1ca4a: 7c 01 movw r14, r24 1ca4c: 3b 01 movw r6, r22 bool _stepresult = false; uint8_t _progress = 0; int _travel_done = 0; int _err_endstop = 0; int _lcd_refresh = 0; _travel = _travel + (_travel / 10); 1ca4e: cb 01 movw r24, r22 1ca50: 6a e0 ldi r22, 0x0A ; 10 1ca52: 70 e0 ldi r23, 0x00 ; 0 1ca54: 0f 94 b9 a0 call 0x34172 ; 0x34172 <__divmodhi4> 1ca58: 66 0e add r6, r22 1ca5a: 77 1e adc r7, r23 if (_axis == X_AXIS) { 1ca5c: e1 14 cp r14, r1 1ca5e: f1 04 cpc r15, r1 1ca60: e1 f4 brne .+56 ; 0x1ca9a current_position[Z_AXIS] += 17; 1ca62: 20 e0 ldi r18, 0x00 ; 0 1ca64: 30 e0 ldi r19, 0x00 ; 0 1ca66: 48 e8 ldi r20, 0x88 ; 136 1ca68: 51 e4 ldi r21, 0x41 ; 65 1ca6a: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 1ca6e: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 1ca72: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 1ca76: 90 91 00 12 lds r25, 0x1200 ; 0x801200 1ca7a: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1ca7e: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 1ca82: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 1ca86: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 1ca8a: 90 93 00 12 sts 0x1200, r25 ; 0x801200 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1ca8e: 60 e0 ldi r22, 0x00 ; 0 1ca90: 70 e0 ldi r23, 0x00 ; 0 1ca92: 84 e3 ldi r24, 0x34 ; 52 1ca94: 92 e4 ldi r25, 0x42 ; 66 1ca96: 0f 94 70 84 call 0x308e0 ; 0x308e0 } #endif //TMC2130 #ifndef TMC2130 static bool lcd_selfcheck_axis(int _axis, int _travel) { 1ca9a: 10 e0 ldi r17, 0x00 ; 0 1ca9c: 00 e0 ldi r16, 0x00 ; 0 1ca9e: d0 e0 ldi r29, 0x00 ; 0 1caa0: c0 e0 ldi r28, 0x00 ; 0 1caa2: d1 2c mov r13, r1 1caa4: c1 2c mov r12, r1 1caa6: 31 2c mov r3, r1 1caa8: 51 2c mov r5, r1 current_position[Z_AXIS] += 17; plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); } do { current_position[_axis] = current_position[_axis] - 1; 1caaa: 57 01 movw r10, r14 1caac: aa 0c add r10, r10 1caae: bb 1c adc r11, r11 1cab0: aa 0c add r10, r10 1cab2: bb 1c adc r11, r11 1cab4: c5 01 movw r24, r10 1cab6: 8b 50 subi r24, 0x0B ; 11 1cab8: 9e 4e sbci r25, 0xEE ; 238 1caba: 4c 01 movw r8, r24 { _lcd_refresh++; } else { _progress = lcd_selftest_screen(static_cast(static_cast(TestScreen::AxisX) + _axis), _progress, 3, false, 0); 1cabc: 94 e0 ldi r25, 0x04 ; 4 1cabe: 29 2e mov r2, r25 1cac0: 2e 0c add r2, r14 current_position[Z_AXIS] += 17; plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); } do { current_position[_axis] = current_position[_axis] - 1; 1cac2: 20 e0 ldi r18, 0x00 ; 0 1cac4: 30 e0 ldi r19, 0x00 ; 0 1cac6: 40 e8 ldi r20, 0x80 ; 128 1cac8: 5f e3 ldi r21, 0x3F ; 63 1caca: f4 01 movw r30, r8 1cacc: 60 81 ld r22, Z 1cace: 71 81 ldd r23, Z+1 ; 0x01 1cad0: 82 81 ldd r24, Z+2 ; 0x02 1cad2: 93 81 ldd r25, Z+3 ; 0x03 1cad4: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1cad8: f4 01 movw r30, r8 1cada: 60 83 st Z, r22 1cadc: 71 83 std Z+1, r23 ; 0x01 1cade: 82 83 std Z+2, r24 ; 0x02 1cae0: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1cae2: 60 e0 ldi r22, 0x00 ; 0 1cae4: 70 e0 ldi r23, 0x00 ; 0 1cae6: 84 e3 ldi r24, 0x34 ; 52 1cae8: 92 e4 ldi r25, 0x42 ; 66 1caea: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 1caee: 0f 94 42 22 call 0x24484 ; 0x24484 if ((READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) || (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) || 1caf2: 1e 99 sbic 0x03, 6 ; 3 1caf4: 04 c0 rjmp .+8 ; 0x1cafe 1caf6: 1d 99 sbic 0x03, 5 ; 3 1caf8: 02 c0 rjmp .+4 ; 0x1cafe 1cafa: 1c 9b sbis 0x03, 4 ; 3 1cafc: 39 c0 rjmp .+114 ; 0x1cb70 (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING)) { if (_axis == 0) { _stepresult = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1cafe: 53 b0 in r5, 0x03 ; 3 st_synchronize(); if ((READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) || (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) || (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING)) { if (_axis == 0) 1cb00: e1 14 cp r14, r1 1cb02: f1 04 cpc r15, r1 1cb04: 51 f4 brne .+20 ; 0x1cb1a { _stepresult = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1cb06: 56 fa bst r5, 6 1cb08: 55 24 eor r5, r5 1cb0a: 50 f8 bld r5, 0 _err_endstop = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? 1 : 2; 1cb0c: 1d 99 sbic 0x03, 5 ; 3 1cb0e: 8e c0 rjmp .+284 ; 0x1cc2c } if (_axis == 1) { _stepresult = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? true : false; _err_endstop = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? 0 : 2; 1cb10: c2 e0 ldi r28, 0x02 ; 2 1cb12: d0 e0 ldi r29, 0x00 ; 0 { _stepresult = ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) ? true : false; _err_endstop = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? 0 : 1; printf_P(PSTR("lcd_selfcheck_axis %d, %d\n"), _stepresult, _err_endstop); } _stepdone = true; 1cb14: 44 24 eor r4, r4 1cb16: 43 94 inc r4 1cb18: 2c c0 rjmp .+88 ; 0x1cb72 { _stepresult = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? true : false; _err_endstop = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? 1 : 2; } if (_axis == 1) 1cb1a: f1 e0 ldi r31, 0x01 ; 1 1cb1c: ef 16 cp r14, r31 1cb1e: f1 04 cpc r15, r1 1cb20: 41 f4 brne .+16 ; 0x1cb32 { _stepresult = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1cb22: 55 fa bst r5, 5 1cb24: 55 24 eor r5, r5 1cb26: 50 f8 bld r5, 0 _err_endstop = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? 0 : 2; 1cb28: 1e 9b sbis 0x03, 6 ; 3 1cb2a: f2 cf rjmp .-28 ; 0x1cb10 1cb2c: d0 e0 ldi r29, 0x00 ; 0 1cb2e: c0 e0 ldi r28, 0x00 ; 0 1cb30: f1 cf rjmp .-30 ; 0x1cb14 } if (_axis == 2) { _stepresult = ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1cb32: 54 fa bst r5, 4 1cb34: 55 24 eor r5, r5 1cb36: 50 f8 bld r5, 0 _err_endstop = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? 0 : 1; 1cb38: 83 b1 in r24, 0x03 ; 3 1cb3a: 82 95 swap r24 1cb3c: 86 95 lsr r24 1cb3e: 86 95 lsr r24 1cb40: 83 70 andi r24, 0x03 ; 3 1cb42: 21 e0 ldi r18, 0x01 ; 1 1cb44: 82 27 eor r24, r18 1cb46: 81 70 andi r24, 0x01 ; 1 1cb48: c8 2f mov r28, r24 1cb4a: 80 e0 ldi r24, 0x00 ; 0 1cb4c: d8 2f mov r29, r24 printf_P(PSTR("lcd_selfcheck_axis %d, %d\n"), _stepresult, _err_endstop); 1cb4e: 8f 93 push r24 1cb50: cf 93 push r28 1cb52: 1f 92 push r1 1cb54: 5f 92 push r5 1cb56: ef ee ldi r30, 0xEF ; 239 1cb58: f2 e8 ldi r31, 0x82 ; 130 1cb5a: ff 93 push r31 1cb5c: ef 93 push r30 1cb5e: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 1cb62: 0f 90 pop r0 1cb64: 0f 90 pop r0 1cb66: 0f 90 pop r0 1cb68: 0f 90 pop r0 1cb6a: 0f 90 pop r0 1cb6c: 0f 90 pop r0 1cb6e: d2 cf rjmp .-92 ; 0x1cb14 current_position[_axis] = current_position[_axis] - 1; plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); st_synchronize(); if ((READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) || (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) || 1cb70: 41 2c mov r4, r1 printf_P(PSTR("lcd_selfcheck_axis %d, %d\n"), _stepresult, _err_endstop); } _stepdone = true; } if (_lcd_refresh < 6) 1cb72: 06 30 cpi r16, 0x06 ; 6 1cb74: 11 05 cpc r17, r1 1cb76: 0c f0 brlt .+2 ; 0x1cb7a 1cb78: 4f c0 rjmp .+158 ; 0x1cc18 { _lcd_refresh++; 1cb7a: 0f 5f subi r16, 0xFF ; 255 1cb7c: 1f 4f sbci r17, 0xFF ; 255 { _progress = lcd_selftest_screen(static_cast(static_cast(TestScreen::AxisX) + _axis), _progress, 3, false, 0); _lcd_refresh = 0; } manage_heater(); 1cb7e: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(true); 1cb82: 81 e0 ldi r24, 0x01 ; 1 1cb84: 0e 94 01 7a call 0xf402 ; 0xf402 (_travel_done <= _travel) ? _travel_done++ : _stepdone = true; 1cb88: 6c 14 cp r6, r12 1cb8a: 7d 04 cpc r7, r13 1cb8c: 34 f0 brlt .+12 ; 0x1cb9a 1cb8e: 8f ef ldi r24, 0xFF ; 255 1cb90: c8 1a sub r12, r24 1cb92: d8 0a sbc r13, r24 } while (!_stepdone); 1cb94: 44 20 and r4, r4 1cb96: 09 f4 brne .+2 ; 0x1cb9a 1cb98: 94 cf rjmp .-216 ; 0x1cac2 if (!_stepresult) 1cb9a: 51 10 cpse r5, r1 1cb9c: 20 c0 rjmp .+64 ; 0x1cbde { const char *_error_1; const char *_error_2; if (_axis == X_AXIS) _error_1 = "X"; if (_axis == Y_AXIS) _error_1 = "Y"; 1cb9e: 6d ed ldi r22, 0xDD ; 221 1cba0: 72 e0 ldi r23, 0x02 ; 2 1cba2: 91 e0 ldi r25, 0x01 ; 1 1cba4: e9 16 cp r14, r25 1cba6: f1 04 cpc r15, r1 1cba8: 41 f0 breq .+16 ; 0x1cbba if (_axis == Z_AXIS) _error_1 = "Z"; 1cbaa: 6f ed ldi r22, 0xDF ; 223 1cbac: 72 e0 ldi r23, 0x02 ; 2 1cbae: e2 e0 ldi r30, 0x02 ; 2 1cbb0: ee 16 cp r14, r30 1cbb2: f1 04 cpc r15, r1 1cbb4: 11 f0 breq .+4 ; 0x1cbba 1cbb6: 6b ed ldi r22, 0xDB ; 219 1cbb8: 72 e0 ldi r23, 0x02 ; 2 if (_err_endstop == 0) _error_2 = "X"; if (_err_endstop == 1) _error_2 = "Y"; 1cbba: 4d ed ldi r20, 0xDD ; 221 1cbbc: 52 e0 ldi r21, 0x02 ; 2 1cbbe: c1 30 cpi r28, 0x01 ; 1 1cbc0: d1 05 cpc r29, r1 1cbc2: 31 f0 breq .+12 ; 0x1cbd0 if (_err_endstop == 2) _error_2 = "Z"; 1cbc4: 4f ed ldi r20, 0xDF ; 223 1cbc6: 52 e0 ldi r21, 0x02 ; 2 1cbc8: 22 97 sbiw r28, 0x02 ; 2 1cbca: 11 f0 breq .+4 ; 0x1cbd0 1cbcc: 4b ed ldi r20, 0xDB ; 219 1cbce: 52 e0 ldi r21, 0x02 ; 2 if (_travel_done >= _travel) { lcd_selftest_error(TestError::Endstop, _error_1, _error_2); 1cbd0: 84 e0 ldi r24, 0x04 ; 4 if (_err_endstop == 0) _error_2 = "X"; if (_err_endstop == 1) _error_2 = "Y"; if (_err_endstop == 2) _error_2 = "Z"; if (_travel_done >= _travel) 1cbd2: c6 14 cp r12, r6 1cbd4: d7 04 cpc r13, r7 1cbd6: 0c f4 brge .+2 ; 0x1cbda { lcd_selftest_error(TestError::Endstop, _error_1, _error_2); } else { lcd_selftest_error(TestError::Motor, _error_1, _error_2); 1cbd8: 83 e0 ldi r24, 0x03 ; 3 1cbda: 0e 94 30 e2 call 0x1c460 ; 0x1c460 } } current_position[_axis] = 0; //simulate axis home to avoid negative numbers for axis position, especially Z. 1cbde: f5 01 movw r30, r10 1cbe0: eb 50 subi r30, 0x0B ; 11 1cbe2: fe 4e sbci r31, 0xEE ; 238 1cbe4: 10 82 st Z, r1 1cbe6: 11 82 std Z+1, r1 ; 0x01 1cbe8: 12 82 std Z+2, r1 ; 0x02 1cbea: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 1cbec: 0f 94 30 83 call 0x30660 ; 0x30660 return _stepresult; } 1cbf0: 85 2d mov r24, r5 1cbf2: df 91 pop r29 1cbf4: cf 91 pop r28 1cbf6: 1f 91 pop r17 1cbf8: 0f 91 pop r16 1cbfa: ff 90 pop r15 1cbfc: ef 90 pop r14 1cbfe: df 90 pop r13 1cc00: cf 90 pop r12 1cc02: bf 90 pop r11 1cc04: af 90 pop r10 1cc06: 9f 90 pop r9 1cc08: 8f 90 pop r8 1cc0a: 7f 90 pop r7 1cc0c: 6f 90 pop r6 1cc0e: 5f 90 pop r5 1cc10: 4f 90 pop r4 1cc12: 3f 90 pop r3 1cc14: 2f 90 pop r2 1cc16: 08 95 ret { _lcd_refresh++; } else { _progress = lcd_selftest_screen(static_cast(static_cast(TestScreen::AxisX) + _axis), _progress, 3, false, 0); 1cc18: 10 e0 ldi r17, 0x00 ; 0 1cc1a: 00 e0 ldi r16, 0x00 ; 0 1cc1c: 20 e0 ldi r18, 0x00 ; 0 1cc1e: 43 e0 ldi r20, 0x03 ; 3 1cc20: 63 2d mov r22, r3 1cc22: 82 2d mov r24, r2 1cc24: 0e 94 38 b9 call 0x17270 ; 0x17270 1cc28: 38 2e mov r3, r24 1cc2a: a9 cf rjmp .-174 ; 0x1cb7e (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING)) { if (_axis == 0) { _stepresult = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? true : false; _err_endstop = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? 1 : 2; 1cc2c: c1 e0 ldi r28, 0x01 ; 1 1cc2e: d0 e0 ldi r29, 0x00 ; 0 1cc30: 71 cf rjmp .-286 ; 0x1cb14 0001cc32 : return 0; } bool resume_print_checks() { // reset the lcd status so that a newer error will be shown lcd_return_to_status(); 1cc32: 0e 94 17 fe call 0x1fc2e ; 0x1fc2e lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1cc36: 10 92 8e 03 sts 0x038E, r1 ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.408> temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 1cc3a: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> lcd_reset_alert_level(); // ensure thermal issues (temp or fan) are resolved before we allow to resume if (get_temp_error() #ifdef FANCHECK || fan_error_selftest() 1cc3e: 81 11 cpse r24, r1 1cc40: 39 c0 rjmp .+114 ; 0x1ccb4 } static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; 1cc42: 80 91 40 02 lds r24, 0x0240 ; 0x800240 1cc46: 81 11 cpse r24, r1 1cc48: 02 c0 rjmp .+4 ; 0x1cc4e #endif ) { return false; // abort if error persists } return true; 1cc4a: 81 e0 ldi r24, 0x01 ; 1 1cc4c: 08 95 ret } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1cc4e: 8f ef ldi r24, 0xFF ; 255 1cc50: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1cc54: 80 93 05 05 sts 0x0505, r24 ; 0x800505 #endif manage_heater(); 1cc58: 0f 94 5b 32 call 0x264b6 ; 0x264b6 { #ifdef FANCHECK if (!fans_check_enabled) return 0; lcd_selftest_setfan(255); setExtruderAutoFanState(3); //force enables the hotend fan 1cc5c: 83 e0 ldi r24, 0x03 ; 3 1cc5e: 0e 94 3f 6e call 0xdc7e ; 0xdc7e #ifdef FAN_SOFT_PWM extruder_autofan_last_check = _millis(); 1cc62: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 1cc66: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d 1cc6a: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e 1cc6e: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f 1cc72: 90 93 90 16 sts 0x1690, r25 ; 0x801690 fan_measuring = true; 1cc76: 81 e0 ldi r24, 0x01 ; 1 1cc78: 80 93 84 03 sts 0x0384, r24 ; 0x800384 #endif //FAN_SOFT_PWM _delay(1000); //delay_keep_alive would turn off hotend fan, because temerature is too low (maybe) 1cc7c: 68 ee ldi r22, 0xE8 ; 232 1cc7e: 73 e0 ldi r23, 0x03 ; 3 1cc80: 80 e0 ldi r24, 0x00 ; 0 1cc82: 90 e0 ldi r25, 0x00 ; 0 1cc84: 0f 94 7b 0d call 0x21af6 ; 0x21af6 manage_heater(); 1cc88: 0f 94 5b 32 call 0x264b6 ; 0x264b6 setExtruderAutoFanState(1); //releases lock on the hotend fan 1cc8c: 81 e0 ldi r24, 0x01 ; 1 1cc8e: 0e 94 3f 6e call 0xdc7e ; 0xdc7e } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1cc92: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1cc96: 10 92 05 05 sts 0x0505, r1 ; 0x800505 #endif manage_heater(); 1cc9a: 0f 94 5b 32 call 0x264b6 ; 0x264b6 _delay(1000); //delay_keep_alive would turn off hotend fan, because temerature is too low (maybe) manage_heater(); setExtruderAutoFanState(1); //releases lock on the hotend fan lcd_selftest_setfan(0); #ifdef TACH_0 if (fan_speed[0] <= 20) { //hotend fan error 1cc9e: 80 91 85 03 lds r24, 0x0385 ; 0x800385 1cca2: 90 91 86 03 lds r25, 0x0386 ; 0x800386 1cca6: 45 97 sbiw r24, 0x15 ; 21 1cca8: 84 f6 brge .-96 ; 0x1cc4a LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); 1ccaa: 62 e0 ldi r22, 0x02 ; 2 1ccac: 87 e6 ldi r24, 0x67 ; 103 1ccae: 97 e6 ldi r25, 0x67 ; 103 1ccb0: 0e 94 01 e2 call 0x1c402 ; 0x1c402 if (get_temp_error() #ifdef FANCHECK || fan_error_selftest() #endif ) { return false; // abort if error persists 1ccb4: 80 e0 ldi r24, 0x00 ; 0 } return true; } 1ccb6: 08 95 ret 0001ccb8 : //! @brief Resume paused USB/host print, send host action "resume" void lcd_resume_usb_print() { // reset lcd and ensure we can resume first if (!resume_print_checks()) return; 1ccb8: 0e 94 19 e6 call 0x1cc32 ; 0x1cc32 1ccbc: 88 23 and r24, r24 1ccbe: 21 f0 breq .+8 ; 0x1ccc8 // resume the usb host SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_RESUME); 1ccc0: 8d e8 ldi r24, 0x8D ; 141 1ccc2: 97 e6 ldi r25, 0x67 ; 103 1ccc4: 0c 94 53 72 jmp 0xe4a6 ; 0xe4a6 } 1ccc8: 08 95 ret 0001ccca : void lcd_getstatus(char buf[LCD_WIDTH]) { strncpy(buf, lcd_status_message, LCD_WIDTH); } void lcd_setstatuspgm(const char* message) { 1ccca: cf 93 push r28 1cccc: df 93 push r29 1ccce: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1ccd0: 80 e0 ldi r24, 0x00 ; 0 1ccd2: 0e 94 eb e1 call 0x1c3d6 ; 0x1c3d6 1ccd6: 88 23 and r24, r24 1ccd8: 31 f0 breq .+12 ; 0x1cce6 lcd_updatestatus(message, true); 1ccda: 61 e0 ldi r22, 0x01 ; 1 1ccdc: ce 01 movw r24, r28 } 1ccde: df 91 pop r29 1cce0: cf 91 pop r28 } void lcd_setstatuspgm(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); 1cce2: 0c 94 d0 e1 jmp 0x1c3a0 ; 0x1c3a0 } 1cce6: df 91 pop r29 1cce8: cf 91 pop r28 1ccea: 08 95 ret 0001ccec : } } void lcd_print_stop_finish(); void lcd_commands() 1ccec: 2f 92 push r2 1ccee: 3f 92 push r3 1ccf0: 4f 92 push r4 1ccf2: 5f 92 push r5 1ccf4: 6f 92 push r6 1ccf6: 7f 92 push r7 1ccf8: 8f 92 push r8 1ccfa: 9f 92 push r9 1ccfc: af 92 push r10 1ccfe: bf 92 push r11 1cd00: cf 92 push r12 1cd02: df 92 push r13 1cd04: ef 92 push r14 1cd06: ff 92 push r15 1cd08: 0f 93 push r16 1cd0a: 1f 93 push r17 1cd0c: cf 93 push r28 1cd0e: df 93 push r29 if (planner_aborted) { // we are still within an aborted command. do not process any LCD command until we return return; } if (lcd_commands_type == LcdCommands::StopPrint) 1cd10: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1cd14: 81 30 cpi r24, 0x01 ; 1 1cd16: 09 f0 breq .+2 ; 0x1cd1a 1cd18: 5a c0 rjmp .+180 ; 0x1cdce return(block); } // Returns true if the buffer has a queued block, false otherwise FORCE_INLINE bool blocks_queued() { return (block_buffer_head != block_buffer_tail); 1cd1a: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 1cd1e: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 { if (!blocks_queued() && !homing_flag) 1cd22: 98 13 cpse r25, r24 1cd24: 54 c0 rjmp .+168 ; 0x1cdce 1cd26: 80 91 05 12 lds r24, 0x1205 ; 0x801205 1cd2a: 81 11 cpse r24, r1 1cd2c: 50 c0 rjmp .+160 ; 0x1cdce { custom_message_type = CustomMsg::Status; 1cd2e: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 lcd_setstatuspgm(_T(MSG_PRINT_ABORTED)); 1cd32: 8a ef ldi r24, 0xFA ; 250 1cd34: 90 e4 ldi r25, 0x40 ; 64 1cd36: 0e 94 b1 6c call 0xd962 ; 0xd962 1cd3a: 0e 94 65 e6 call 0x1ccca ; 0x1ccca lcd_commands_type = LcdCommands::Idle; 1cd3e: 10 92 c8 0d sts 0x0DC8, r1 ; 0x800dc8 1cd42: 82 e0 ldi r24, 0x02 ; 2 1cd44: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.367> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 1cd48: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 #endif //COMMUNITY_PREVENT_OOZE // continue stopping the print from the main loop after lcd_print_stop() is called void lcd_print_stop_finish() { print_job_timer.stop(); 1cd4c: 0f 94 7a 20 call 0x240f4 ; 0x240f4 save_statistics(); 1cd50: 0e 94 38 5f call 0xbe70 ; 0xbe70 // lift Z raise_z(10); 1cd54: 60 e0 ldi r22, 0x00 ; 0 1cd56: 70 e0 ldi r23, 0x00 ; 0 1cd58: 80 e2 ldi r24, 0x20 ; 32 1cd5a: 91 e4 ldi r25, 0x41 ; 65 1cd5c: 0e 94 dd 66 call 0xcdba ; 0xcdba // if axis are homed, move to parking position. if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 1cd60: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 1cd64: 88 23 and r24, r24 1cd66: 21 f1 breq .+72 ; 0x1cdb0 1cd68: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 1cd6c: 88 23 and r24, r24 1cd6e: 01 f1 breq .+64 ; 0x1cdb0 current_position[X_AXIS] = X_CANCEL_POS; 1cd70: 80 e0 ldi r24, 0x00 ; 0 1cd72: 90 e0 ldi r25, 0x00 ; 0 1cd74: a8 e4 ldi r26, 0x48 ; 72 1cd76: b2 e4 ldi r27, 0x42 ; 66 1cd78: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 1cd7c: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 1cd80: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 1cd84: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = Y_CANCEL_POS; 1cd88: 80 e0 ldi r24, 0x00 ; 0 1cd8a: 90 e0 ldi r25, 0x00 ; 0 1cd8c: ae e3 ldi r26, 0x3E ; 62 1cd8e: b3 e4 ldi r27, 0x43 ; 67 1cd90: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 1cd94: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 1cd98: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 1cd9c: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1cda0: 60 e0 ldi r22, 0x00 ; 0 1cda2: 70 e0 ldi r23, 0x00 ; 0 1cda4: 84 e3 ldi r24, 0x34 ; 52 1cda6: 92 e4 ldi r25, 0x42 ; 66 1cda8: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 1cdac: 0f 94 42 22 call 0x24484 ; 0x24484 1cdb0: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> // Retract filament to prevent oozing retract_for_ooze_prevention(); #endif //COMMUNITY_PREVENT_OOZE // did we come here from a thermal error? if(get_temp_error()) { 1cdb4: 88 23 and r24, r24 1cdb6: 09 f4 brne .+2 ; 0x1cdba 1cdb8: ba c0 rjmp .+372 ; 0x1cf2e // time to stop the error beep WRITE(BEEPER, LOW); 1cdba: 72 98 cbi 0x0e, 2 ; 14 MMU2::mmu2.unload(); // M702 } } } lcd_cooldown(); //turns off heaters and fan; goes to status screen. 1cdbc: 0f 94 74 12 call 0x224e8 ; 0x224e8 finishAndDisableSteppers(); //M84 1cdc0: 0e 94 39 74 call 0xe872 ; 0xe872 axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative 1cdc4: 88 e0 ldi r24, 0x08 ; 8 1cdc6: 80 93 eb 11 sts 0x11EB, r24 ; 0x8011eb did_pause_print = false; // Clear pause state in case the print was aborted while paused 1cdca: 10 92 9b 03 sts 0x039B, r1 ; 0x80039b lcd_commands_step = 0; lcd_print_stop_finish(); } } if (lcd_commands_type == LcdCommands::LongPause) 1cdce: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1cdd2: 82 30 cpi r24, 0x02 ; 2 1cdd4: 09 f0 breq .+2 ; 0x1cdd8 1cdd6: 63 c0 rjmp .+198 ; 0x1ce9e 1cdd8: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 1cddc: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 { if (!blocks_queued() && !homing_flag) 1cde0: 98 13 cpse r25, r24 1cde2: 5d c0 rjmp .+186 ; 0x1ce9e 1cde4: 80 91 05 12 lds r24, 0x1205 ; 0x801205 1cde8: 81 11 cpse r24, r1 1cdea: 59 c0 rjmp .+178 ; 0x1ce9e { if (custom_message_type != CustomMsg::M117) 1cdec: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 1cdf0: 87 30 cpi r24, 0x07 ; 7 1cdf2: 41 f0 breq .+16 ; 0x1ce04 { custom_message_type = CustomMsg::Status; 1cdf4: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 1cdf8: 8b ee ldi r24, 0xEB ; 235 1cdfa: 90 e4 ldi r25, 0x40 ; 64 1cdfc: 0e 94 b1 6c call 0xd962 ; 0xd962 1ce00: 0e 94 65 e6 call 0x1ccca ; 0x1ccca } lcd_commands_type = LcdCommands::Idle; 1ce04: 10 92 c8 0d sts 0x0DC8, r1 ; 0x800dc8 1ce08: 82 e0 ldi r24, 0x02 ; 2 1ce0a: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.367> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 1ce0e: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 } #endif //PINDA_THERMISTOR void long_pause() //long pause print { st_synchronize(); 1ce12: 0f 94 42 22 call 0x24484 ; 0x24484 // Stop heaters heating_status = HeatingStatus::NO_HEATING; 1ce16: 10 92 99 03 sts 0x0399, r1 ; 0x800399 1ce1a: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 1ce1e: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 setTargetHotend(0); // Lift z raise_z(pause_position[Z_AXIS]); 1ce22: 60 91 4a 02 lds r22, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.495+0x8> 1ce26: 70 91 4b 02 lds r23, 0x024B ; 0x80024b <_ZL14pause_position.lto_priv.495+0x9> 1ce2a: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL14pause_position.lto_priv.495+0xa> 1ce2e: 90 91 4d 02 lds r25, 0x024D ; 0x80024d <_ZL14pause_position.lto_priv.495+0xb> 1ce32: 0e 94 dd 66 call 0xcdba ; 0xcdba // Move XY to side if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 1ce36: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 1ce3a: 88 23 and r24, r24 1ce3c: 51 f1 breq .+84 ; 0x1ce92 1ce3e: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 1ce42: 88 23 and r24, r24 1ce44: 31 f1 breq .+76 ; 0x1ce92 current_position[X_AXIS] = pause_position[X_AXIS]; 1ce46: 80 91 42 02 lds r24, 0x0242 ; 0x800242 <_ZL14pause_position.lto_priv.495> 1ce4a: 90 91 43 02 lds r25, 0x0243 ; 0x800243 <_ZL14pause_position.lto_priv.495+0x1> 1ce4e: a0 91 44 02 lds r26, 0x0244 ; 0x800244 <_ZL14pause_position.lto_priv.495+0x2> 1ce52: b0 91 45 02 lds r27, 0x0245 ; 0x800245 <_ZL14pause_position.lto_priv.495+0x3> 1ce56: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 1ce5a: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 1ce5e: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 1ce62: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = pause_position[Y_AXIS]; 1ce66: 80 91 46 02 lds r24, 0x0246 ; 0x800246 <_ZL14pause_position.lto_priv.495+0x4> 1ce6a: 90 91 47 02 lds r25, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.495+0x5> 1ce6e: a0 91 48 02 lds r26, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.495+0x6> 1ce72: b0 91 49 02 lds r27, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.495+0x7> 1ce76: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 1ce7a: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 1ce7e: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 1ce82: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(50); 1ce86: 60 e0 ldi r22, 0x00 ; 0 1ce88: 70 e0 ldi r23, 0x00 ; 0 1ce8a: 88 e4 ldi r24, 0x48 ; 72 1ce8c: 92 e4 ldi r25, 0x42 ; 66 1ce8e: 0f 94 70 84 call 0x308e0 ; 0x308e0 1ce92: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> } // did we come here from a thermal error? if(get_temp_error()) { 1ce96: 88 23 and r24, r24 1ce98: 09 f4 brne .+2 ; 0x1ce9c 1ce9a: 73 c0 rjmp .+230 ; 0x1cf82 // time to stop the error beep WRITE(BEEPER, LOW); 1ce9c: 72 98 cbi 0x0e, 2 ; 14 long_pause(); } } if (lcd_commands_type == LcdCommands::Layer1Cal) 1ce9e: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1cea2: 84 30 cpi r24, 0x04 ; 4 1cea4: 09 f0 breq .+2 ; 0x1cea8 1cea6: a7 c0 rjmp .+334 ; 0x1cff6 { const uint16_t nozzle_dia = eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM); 1cea8: 85 ea ldi r24, 0xA5 ; 165 1ceaa: 9d e0 ldi r25, 0x0D ; 13 1ceac: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 1ceb0: 30 91 a8 0d lds r19, 0x0DA8 ; 0x800da8 1ceb4: 20 91 a9 0d lds r18, 0x0DA9 ; 0x800da9 const float extrusion_width = (nozzle_dia + 20)/1000.0f; const float layer_height = 0.2f; if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 1ceb8: 32 13 cpse r19, r18 1ceba: 74 c1 rjmp .+744 ; 0x1d1a4 1cebc: 20 91 cf 11 lds r18, 0x11CF ; 0x8011cf 1cec0: 30 91 d0 11 lds r19, 0x11D0 ; 0x8011d0 1cec4: 23 2b or r18, r19 1cec6: 09 f0 breq .+2 ; 0x1ceca 1cec8: 6d c1 rjmp .+730 ; 0x1d1a4 1ceca: c0 91 e7 11 lds r28, 0x11E7 ; 0x8011e7 1cece: c1 11 cpse r28, r1 1ced0: 69 c1 rjmp .+722 ; 0x1d1a4 { if (lcd_commands_step == 0) 1ced2: 20 91 b0 03 lds r18, 0x03B0 ; 0x8003b0 1ced6: 21 11 cpse r18, r1 1ced8: 57 c0 rjmp .+174 ; 0x1cf88 lcd_commands_step = 12; 1ceda: 2c e0 ldi r18, 0x0C ; 12 else lcd_commands_step--; 1cedc: 20 93 b0 03 sts 0x03B0, r18 ; 0x8003b0 } if (lcd_commands_type == LcdCommands::Layer1Cal) { const uint16_t nozzle_dia = eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM); const float extrusion_width = (nozzle_dia + 20)/1000.0f; 1cee0: 44 96 adiw r24, 0x14 ; 20 1cee2: bc 01 movw r22, r24 1cee4: 90 e0 ldi r25, 0x00 ; 0 1cee6: 80 e0 ldi r24, 0x00 ; 0 1cee8: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 1ceec: 20 e0 ldi r18, 0x00 ; 0 1ceee: 30 e0 ldi r19, 0x00 ; 0 1cef0: 4a e7 ldi r20, 0x7A ; 122 1cef2: 54 e4 ldi r21, 0x44 ; 68 1cef4: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1cef8: 4b 01 movw r8, r22 1cefa: 5c 01 movw r10, r24 if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; switch(lcd_commands_step) 1cefc: e0 91 b0 03 lds r30, 0x03B0 ; 0x8003b0 1cf00: e1 50 subi r30, 0x01 ; 1 1cf02: ec 30 cpi r30, 0x0C ; 12 1cf04: 08 f0 brcs .+2 ; 0x1cf08 1cf06: 77 c0 rjmp .+238 ; 0x1cff6 1cf08: f0 e0 ldi r31, 0x00 ; 0 1cf0a: 88 27 eor r24, r24 1cf0c: e5 57 subi r30, 0x75 ; 117 1cf0e: f8 41 sbci r31, 0x18 ; 24 1cf10: 8f 4f sbci r24, 0xFF ; 255 1cf12: 0d 94 ec a0 jmp 0x341d8 ; 0x341d8 <__tablejump2__> 1cf16: cd ea ldi r28, 0xAD ; 173 1cf18: c9 ea ldi r28, 0xA9 ; 169 1cf1a: 5f ea ldi r21, 0xAF ; 175 1cf1c: 5f ea ldi r21, 0xAF ; 175 1cf1e: 5f ea ldi r21, 0xAF ; 175 1cf20: 5f ea ldi r21, 0xAF ; 175 1cf22: 08 ea ldi r16, 0xA8 ; 168 1cf24: 77 e9 ldi r23, 0x97 ; 151 1cf26: 73 e9 ldi r23, 0x93 ; 147 1cf28: 06 e9 ldi r16, 0x96 ; 150 1cf2a: cc e7 ldi r28, 0x7C ; 124 1cf2c: c6 e7 ldi r28, 0x76 ; 118 if(get_temp_error()) { // time to stop the error beep WRITE(BEEPER, LOW); } else { // Turn off the print fan fanSpeed = 0; 1cf2e: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 { #if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) #ifdef EXTRUDER_ALTFAN_DETECT altfanStatus.altfanOverride = eeprom_read_byte((uint8_t*)EEPROM_ALTFAN_OVERRIDE); #endif resetFanCheck(); 1cf32: 0e 94 32 6e call 0xdc64 ; 0xdc64 setExtruderAutoFanState(1); 1cf36: 81 e0 ldi r24, 0x01 ; 1 1cf38: 0e 94 3f 6e call 0xdc7e ; 0xdc7e // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1cf3c: 80 91 94 12 lds r24, 0x1294 ; 0x801294 1cf40: 81 30 cpi r24, 0x01 ; 1 1cf42: 09 f0 breq .+2 ; 0x1cf46 1cf44: 3b cf rjmp .-394 ; 0x1cdbc fanSpeed = 0; // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() 1cf46: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 1cf4a: 88 23 and r24, r24 1cf4c: 09 f4 brne .+2 ; 0x1cf50 1cf4e: 36 cf rjmp .-404 ; 0x1cdbc #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1cf50: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 1cf54: 82 30 cpi r24, 0x02 ; 2 1cf56: 09 f4 brne .+2 ; 0x1cf5a 1cf58: 31 cf rjmp .-414 ; 0x1cdbc #endif //FANCHECK ) { // The print was aborted while when the nozzle was cold: // 1. in a paused state => a partial backup in RAM is always available // 2. after a recoverable thermal/fan error had paused the print => only extruder temperature is saved to RAM if (printingIsPaused()) 1cf5a: 0e 94 bd 60 call 0xc17a ; 0xc17a 1cf5e: 81 11 cpse r24, r1 { // Restore temperature saved in ram after pausing print restore_extruder_temperature_from_ram(); 1cf60: 0e 94 ab 5e call 0xbd56 ; 0xbd56 } // If the pause state was cleared previously or the target temperature is 0°C in the case // of an unconditional stop. In that scenario we do not want to unload. if (target_temperature[0] >= extrude_min_temp) { 1cf64: 20 91 f1 11 lds r18, 0x11F1 ; 0x8011f1 1cf68: 30 91 f2 11 lds r19, 0x11F2 ; 0x8011f2 1cf6c: 80 91 57 02 lds r24, 0x0257 ; 0x800257 1cf70: 90 91 58 02 lds r25, 0x0258 ; 0x800258 1cf74: 28 17 cp r18, r24 1cf76: 39 07 cpc r19, r25 1cf78: 0c f4 brge .+2 ; 0x1cf7c 1cf7a: 20 cf rjmp .-448 ; 0x1cdbc MMU2::mmu2.unload(); // M702 1cf7c: 0f 94 93 6a call 0x2d526 ; 0x2d526 1cf80: 1d cf rjmp .-454 ; 0x1cdbc } else { // Turn off the print fan fanSpeed = 0; 1cf82: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 1cf86: 8b cf rjmp .-234 ; 0x1ce9e if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) { if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; 1cf88: 21 50 subi r18, 0x01 ; 1 1cf8a: a8 cf rjmp .-176 ; 0x1cedc preheat_cmd_3, preheat_cmd_4, zero_extrusion }; lay1cal_common_enqueue_loop(preheat_cmd, sizeof(preheat_cmd)/sizeof(preheat_cmd[0])); 1cf8c: 65 e0 ldi r22, 0x05 ; 5 1cf8e: 86 eb ldi r24, 0xB6 ; 182 1cf90: 93 e8 ldi r25, 0x83 ; 131 MSG_M702, // Unload filament (MMU only) cmd_cal_finish_8, // Turn off hotend heater MSG_M84 // Disable stepper motors }; lay1cal_common_enqueue_loop(cmd_cal_finish, (sizeof(cmd_cal_finish)/sizeof(cmd_cal_finish[0]))); 1cf92: 0e 94 2e 7d call 0xfa5c ; 0xfa5c 1cf96: 2f c0 rjmp .+94 ; 0x1cff6 //! @param cmd_buffer character buffer needed to format gcodes //! @param filament filament to use (applies for MMU only) //! @returns true if extra purge distance is needed in case of MMU prints (after a toolchange), otherwise false bool lay1cal_load_filament(uint8_t filament) { if (MMU2::mmu2.Enabled()) 1cf98: 80 91 94 12 lds r24, 0x1294 ; 0x801294 1cf9c: 81 30 cpi r24, 0x01 ; 1 1cf9e: 49 f5 brne .+82 ; 0x1cff2 { case 12: lay1cal_wait_preheat(); break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); 1cfa0: d0 91 af 03 lds r29, 0x03AF ; 0x8003af <_ZL16lay1cal_filament.lto_priv.409> { enquecommand_P(MSG_M83); 1cfa4: 61 e0 ldi r22, 0x01 ; 1 1cfa6: 85 e3 ldi r24, 0x35 ; 53 1cfa8: 9c e6 ldi r25, 0x6C ; 108 1cfaa: 0e 94 af 7c call 0xf95e ; 0xf95e enquecommand_P(PSTR("G1Y-3F1000")); 1cfae: 61 e0 ldi r22, 0x01 ; 1 1cfb0: 8b ea ldi r24, 0xAB ; 171 1cfb2: 93 e8 ldi r25, 0x83 ; 131 1cfb4: 0e 94 af 7c call 0xf95e ; 0xf95e enquecommand_P(PSTR("G1Z0.4")); 1cfb8: 61 e0 ldi r22, 0x01 ; 1 1cfba: 84 ea ldi r24, 0xA4 ; 164 1cfbc: 93 e8 ldi r25, 0x83 ; 131 1cfbe: 0e 94 af 7c call 0xf95e ; 0xf95e uint8_t currentTool = MMU2::mmu2.get_current_tool(); 1cfc2: 0f 94 92 41 call 0x28324 ; 0x28324 if(currentTool == filament ){ 1cfc6: d8 17 cp r29, r24 1cfc8: a1 f0 breq .+40 ; 0x1cff2 // already have the correct tool loaded - do nothing return false; } else if( currentTool != (uint8_t)MMU2::FILAMENT_UNKNOWN){ 1cfca: 8f 3f cpi r24, 0xFF ; 255 1cfcc: 29 f0 breq .+10 ; 0x1cfd8 // some other slot is loaded, perform an unload first enquecommand_P(MSG_M702); 1cfce: 61 e0 ldi r22, 0x01 ; 1 1cfd0: 8d e0 ldi r24, 0x0D ; 13 1cfd2: 98 e6 ldi r25, 0x68 ; 104 1cfd4: 0e 94 af 7c call 0xf95e ; 0xf95e } // perform a toolchange enquecommandf_P(PSTR("T%d"), filament); 1cfd8: 1f 92 push r1 1cfda: df 93 push r29 1cfdc: 80 ea ldi r24, 0xA0 ; 160 1cfde: 93 e8 ldi r25, 0x83 ; 131 1cfe0: 9f 93 push r25 1cfe2: 8f 93 push r24 1cfe4: 0e 94 4d 7d call 0xfa9a ; 0xfa9a 1cfe8: 0f 90 pop r0 1cfea: 0f 90 pop r0 1cfec: 0f 90 pop r0 1cfee: 0f 90 pop r0 return true; 1cff0: c1 e0 ldi r28, 0x01 ; 1 1cff2: c0 93 ae 03 sts 0x03AE, r28 ; 0x8003ae break; } } } if (lcd_commands_type == LcdCommands::PidExtruder) { 1cff6: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1cffa: 83 30 cpi r24, 0x03 ; 3 1cffc: 09 f0 breq .+2 ; 0x1d000 1cffe: d2 c0 rjmp .+420 ; 0x1d1a4 if (lcd_commands_step == 0) { 1d000: 90 91 b0 03 lds r25, 0x03B0 ; 0x8003b0 1d004: 91 11 cpse r25, r1 1d006: 09 c0 rjmp .+18 ; 0x1d01a custom_message_type = CustomMsg::PidCal; 1d008: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 custom_message_state = 1; 1d00c: 91 e0 ldi r25, 0x01 ; 1 1d00e: 90 93 ac 03 sts 0x03AC, r25 ; 0x8003ac lcd_draw_update = 3; 1d012: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b lcd_commands_step = 3; 1d016: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 } if (lcd_commands_step == 3 && !blocks_queued()) { //PID calibration 1d01a: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 1d01e: 83 30 cpi r24, 0x03 ; 3 1d020: 19 f5 brne .+70 ; 0x1d068 1d022: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 1d026: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 1d02a: 98 13 cpse r25, r24 1d02c: 1d c0 rjmp .+58 ; 0x1d068 return !pid_tuning_finished; } void preparePidTuning() { // ensure heaters are disabled before we switch off PID management! disable_heater(); 1d02e: 0f 94 5f 12 call 0x224be ; 0x224be pid_tuning_finished = false; 1d032: 10 92 41 02 sts 0x0241, r1 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.423> preparePidTuning(); // ensure we don't move to the next step early // setting the correct target temperature (for visualization) is done in PID_autotune enquecommandf_P(PSTR("M303 E0 S%3u"), pid_temp); 1d036: 80 91 4f 02 lds r24, 0x024F ; 0x80024f <_ZL8pid_temp.lto_priv.411+0x1> 1d03a: 8f 93 push r24 1d03c: 80 91 4e 02 lds r24, 0x024E ; 0x80024e <_ZL8pid_temp.lto_priv.411> 1d040: 8f 93 push r24 1d042: 8b e2 ldi r24, 0x2B ; 43 1d044: 94 e8 ldi r25, 0x84 ; 132 1d046: 9f 93 push r25 1d048: 8f 93 push r24 1d04a: 0e 94 4d 7d call 0xfa9a ; 0xfa9a lcd_setstatuspgm(_T(MSG_PID_RUNNING)); 1d04e: 80 ee ldi r24, 0xE0 ; 224 1d050: 90 e4 ldi r25, 0x40 ; 64 1d052: 0e 94 b1 6c call 0xd962 ; 0xd962 1d056: 0e 94 65 e6 call 0x1ccca ; 0x1ccca lcd_commands_step = 2; 1d05a: 82 e0 ldi r24, 0x02 ; 2 1d05c: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 1d060: 0f 90 pop r0 1d062: 0f 90 pop r0 1d064: 0f 90 pop r0 1d066: 0f 90 pop r0 } if (lcd_commands_step == 2 && !pidTuningRunning()) { //saving to eeprom 1d068: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 1d06c: 82 30 cpi r24, 0x02 ; 2 1d06e: 09 f0 breq .+2 ; 0x1d072 1d070: 7a c0 rjmp .+244 ; 0x1d166 1d072: 80 91 41 02 lds r24, 0x0241 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.423> 1d076: 88 23 and r24, r24 1d078: 09 f4 brne .+2 ; 0x1d07c 1d07a: 75 c0 rjmp .+234 ; 0x1d166 custom_message_state = 0; 1d07c: 10 92 ac 03 sts 0x03AC, r1 ; 0x8003ac lcd_setstatuspgm(_T(MSG_PID_FINISHED)); 1d080: 8c ec ldi r24, 0xCC ; 204 1d082: 90 e4 ldi r25, 0x40 ; 64 1d084: 0e 94 b1 6c call 0xd962 ; 0xd962 1d088: 0e 94 65 e6 call 0x1ccca ; 0x1ccca 1d08c: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 1d090: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 setTargetHotend(0); if (_Kp != 0 || _Ki != 0 || _Kd != 0) { 1d094: c0 91 a8 03 lds r28, 0x03A8 ; 0x8003a8 <_Kp> 1d098: d0 91 a9 03 lds r29, 0x03A9 ; 0x8003a9 <_Kp+0x1> 1d09c: 10 91 aa 03 lds r17, 0x03AA ; 0x8003aa <_Kp+0x2> 1d0a0: 00 91 ab 03 lds r16, 0x03AB ; 0x8003ab <_Kp+0x3> 1d0a4: 20 e0 ldi r18, 0x00 ; 0 1d0a6: 30 e0 ldi r19, 0x00 ; 0 1d0a8: a9 01 movw r20, r18 1d0aa: f8 01 movw r30, r16 1d0ac: 6c 2f mov r22, r28 1d0ae: 7d 2f mov r23, r29 1d0b0: 8f 2f mov r24, r31 1d0b2: 9e 2f mov r25, r30 1d0b4: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1d0b8: 81 11 cpse r24, r1 1d0ba: 1f c0 rjmp .+62 ; 0x1d0fa 1d0bc: 20 e0 ldi r18, 0x00 ; 0 1d0be: 30 e0 ldi r19, 0x00 ; 0 1d0c0: a9 01 movw r20, r18 1d0c2: 60 91 a4 03 lds r22, 0x03A4 ; 0x8003a4 <_Ki> 1d0c6: 70 91 a5 03 lds r23, 0x03A5 ; 0x8003a5 <_Ki+0x1> 1d0ca: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 <_Ki+0x2> 1d0ce: 90 91 a7 03 lds r25, 0x03A7 ; 0x8003a7 <_Ki+0x3> 1d0d2: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1d0d6: 81 11 cpse r24, r1 1d0d8: 10 c0 rjmp .+32 ; 0x1d0fa 1d0da: 20 e0 ldi r18, 0x00 ; 0 1d0dc: 30 e0 ldi r19, 0x00 ; 0 1d0de: a9 01 movw r20, r18 1d0e0: 60 91 a0 03 lds r22, 0x03A0 ; 0x8003a0 <_Kd> 1d0e4: 70 91 a1 03 lds r23, 0x03A1 ; 0x8003a1 <_Kd+0x1> 1d0e8: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 <_Kd+0x2> 1d0ec: 90 91 a3 03 lds r25, 0x03A3 ; 0x8003a3 <_Kd+0x3> 1d0f0: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1d0f4: 88 23 and r24, r24 1d0f6: 09 f4 brne .+2 ; 0x1d0fa 1d0f8: 66 c2 rjmp .+1228 ; 0x1d5c6 enquecommandf_P(PSTR("M301 P%.2f I%.2f D%.2f"), _Kp, _Ki, _Kd); 1d0fa: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 <_Kd+0x3> 1d0fe: 8f 93 push r24 1d100: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 <_Kd+0x2> 1d104: 8f 93 push r24 1d106: 80 91 a1 03 lds r24, 0x03A1 ; 0x8003a1 <_Kd+0x1> 1d10a: 8f 93 push r24 1d10c: 80 91 a0 03 lds r24, 0x03A0 ; 0x8003a0 <_Kd> 1d110: 8f 93 push r24 1d112: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 <_Ki+0x3> 1d116: 8f 93 push r24 1d118: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 <_Ki+0x2> 1d11c: 8f 93 push r24 1d11e: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 <_Ki+0x1> 1d122: 8f 93 push r24 1d124: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 <_Ki> 1d128: 8f 93 push r24 1d12a: 0f 93 push r16 1d12c: 1f 93 push r17 1d12e: df 93 push r29 1d130: cf 93 push r28 1d132: 84 e1 ldi r24, 0x14 ; 20 1d134: 94 e8 ldi r25, 0x84 ; 132 1d136: 9f 93 push r25 1d138: 8f 93 push r24 1d13a: 0e 94 4d 7d call 0xfa9a ; 0xfa9a enquecommand_P(MSG_M500); 1d13e: 61 e0 ldi r22, 0x01 ; 1 1d140: 88 e1 ldi r24, 0x18 ; 24 1d142: 98 e6 ldi r25, 0x68 ; 104 1d144: 0e 94 af 7c call 0xf95e ; 0xf95e 1d148: 8d b7 in r24, 0x3d ; 61 1d14a: 9e b7 in r25, 0x3e ; 62 1d14c: 0e 96 adiw r24, 0x0e ; 14 1d14e: 0f b6 in r0, 0x3f ; 63 1d150: f8 94 cli 1d152: 9e bf out 0x3e, r25 ; 62 1d154: 0f be out 0x3f, r0 ; 63 1d156: 8d bf out 0x3d, r24 ; 61 } else { SERIAL_ECHOPGM("Invalid PID cal. results. Not stored to EEPROM."); } display_time.start(); 1d158: 8d e9 ldi r24, 0x9D ; 157 1d15a: 93 e0 ldi r25, 0x03 ; 3 1d15c: 0f 94 d6 0f call 0x21fac ; 0x21fac ::start()> lcd_commands_step = 1; 1d160: 81 e0 ldi r24, 0x01 ; 1 1d162: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 } if ((lcd_commands_step == 1) && display_time.expired(2000)) { //calibration finished message 1d166: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 1d16a: 81 30 cpi r24, 0x01 ; 1 1d16c: d9 f4 brne .+54 ; 0x1d1a4 1d16e: 60 ed ldi r22, 0xD0 ; 208 1d170: 77 e0 ldi r23, 0x07 ; 7 1d172: 8d e9 ldi r24, 0x9D ; 157 1d174: 93 e0 ldi r25, 0x03 ; 3 1d176: 0f 94 a7 0f call 0x21f4e ; 0x21f4e ::expired(unsigned short)> 1d17a: 88 23 and r24, r24 1d17c: 99 f0 breq .+38 ; 0x1d1a4 lcd_setstatuspgm(MSG_WELCOME); 1d17e: 87 e6 ldi r24, 0x67 ; 103 1d180: 9b e6 ldi r25, 0x6B ; 107 1d182: 0e 94 65 e6 call 0x1ccca ; 0x1ccca custom_message_type = CustomMsg::Status; 1d186: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 pid_temp = DEFAULT_PID_TEMP; 1d18a: 82 ed ldi r24, 0xD2 ; 210 1d18c: 90 e0 ldi r25, 0x00 ; 0 1d18e: 90 93 4f 02 sts 0x024F, r25 ; 0x80024f <_ZL8pid_temp.lto_priv.411+0x1> 1d192: 80 93 4e 02 sts 0x024E, r24 ; 0x80024e <_ZL8pid_temp.lto_priv.411> lcd_commands_step = 0; 1d196: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 lcd_commands_type = LcdCommands::Idle; 1d19a: 10 92 c8 0d sts 0x0DC8, r1 ; 0x800dc8 1d19e: 82 e0 ldi r24, 0x02 ; 2 1d1a0: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.367> break; } } #endif //THERMAL_MODEL if (lcd_commands_type == LcdCommands::NozzleCNG) 1d1a4: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1d1a8: 85 30 cpi r24, 0x05 ; 5 1d1aa: e9 f4 brne .+58 ; 0x1d1e6 1d1ac: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 1d1b0: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 { if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 1d1b4: 98 13 cpse r25, r24 1d1b6: 17 c0 rjmp .+46 ; 0x1d1e6 1d1b8: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 1d1bc: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 1d1c0: 89 2b or r24, r25 1d1c2: 89 f4 brne .+34 ; 0x1d1e6 1d1c4: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 1d1c8: 81 11 cpse r24, r1 1d1ca: 0d c0 rjmp .+26 ; 0x1d1e6 #ifndef QUICK_NOZZLE_CHANGE //thermal model can be ignored if a quickchange nozzle is in use, no heatup necessary #ifdef THERMAL_MODEL static bool was_enabled; #endif //THERMAL_MODEL #endif //QUICK_NOZZLE_CHANGE switch(lcd_commands_step) 1d1cc: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 1d1d0: 81 30 cpi r24, 0x01 ; 1 1d1d2: 09 f4 brne .+2 ; 0x1d1d6 1d1d4: 2d c2 rjmp .+1114 ; 0x1d630 1d1d6: 08 f4 brcc .+2 ; 0x1d1da 1d1d8: fb c1 rjmp .+1014 ; 0x1d5d0 1d1da: 82 30 cpi r24, 0x02 ; 2 1d1dc: 09 f4 brne .+2 ; 0x1d1e0 1d1de: 13 c2 rjmp .+1062 ; 0x1d606 1d1e0: 83 30 cpi r24, 0x03 ; 3 1d1e2: 09 f4 brne .+2 ; 0x1d1e6 1d1e4: f9 c1 rjmp .+1010 ; 0x1d5d8 menu_depth = 3; break; } } } } 1d1e6: df 91 pop r29 1d1e8: cf 91 pop r28 1d1ea: 1f 91 pop r17 1d1ec: 0f 91 pop r16 1d1ee: ff 90 pop r15 1d1f0: ef 90 pop r14 1d1f2: df 90 pop r13 1d1f4: cf 90 pop r12 1d1f6: bf 90 pop r11 1d1f8: af 90 pop r10 1d1fa: 9f 90 pop r9 1d1fc: 8f 90 pop r8 1d1fe: 7f 90 pop r7 1d200: 6f 90 pop r6 1d202: 5f 90 pop r5 1d204: 4f 90 pop r4 1d206: 3f 90 pop r3 1d208: 2f 90 pop r2 1d20a: 08 95 ret break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); break; case 10: lcd_clear(); 1d20c: 0e 94 ae 69 call 0xd35c ; 0xd35c menu_depth = 0; 1d210: 10 92 ad 03 sts 0x03AD, r1 ; 0x8003ad menu_submenu(lcd_babystep_z, true); 1d214: 61 e0 ldi r22, 0x01 ; 1 1d216: 83 ee ldi r24, 0xE3 ; 227 1d218: 96 e3 ldi r25, 0x36 ; 54 1d21a: 0f 94 29 94 call 0x32852 ; 0x32852 cmd_intro_mmu_9, cmd_intro_mmu_10, cmd_intro_mmu_11, }; if (MMU2::mmu2.Enabled()) 1d21e: 80 91 94 12 lds r24, 0x1294 ; 0x801294 1d222: 81 30 cpi r24, 0x01 ; 1 1d224: b9 f4 brne .+46 ; 0x1d254 { for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(cmd_intro_mmu)/sizeof(cmd_intro_mmu[0])); ++i) 1d226: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 1d22a: 10 e0 ldi r17, 0x00 ; 0 1d22c: 81 11 cpse r24, r1 1d22e: 01 c0 rjmp .+2 ; 0x1d232 1d230: 12 e0 ldi r17, 0x02 ; 2 1d232: c1 2f mov r28, r17 1d234: d0 e0 ldi r29, 0x00 ; 0 1d236: cc 0f add r28, r28 1d238: dd 1f adc r29, r29 1d23a: c2 57 subi r28, 0x72 ; 114 1d23c: dc 47 sbci r29, 0x7C ; 124 { enquecommand_P(static_cast(pgm_read_ptr(&cmd_intro_mmu[i]))); 1d23e: fe 01 movw r30, r28 1d240: 85 91 lpm r24, Z+ 1d242: 94 91 lpm r25, Z 1d244: 61 e0 ldi r22, 0x01 ; 1 1d246: 0e 94 af 7c call 0xf95e ; 0xf95e cmd_intro_mmu_11, }; if (MMU2::mmu2.Enabled()) { for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(cmd_intro_mmu)/sizeof(cmd_intro_mmu[0])); ++i) 1d24a: 1f 5f subi r17, 0xFF ; 255 1d24c: 22 96 adiw r28, 0x02 ; 2 1d24e: 19 30 cpi r17, 0x09 ; 9 1d250: b1 f7 brne .-20 ; 0x1d23e 1d252: d1 ce rjmp .-606 ; 0x1cff6 enquecommand_P(static_cast(pgm_read_ptr(&cmd_intro_mmu[i]))); } } else { enquecommand_P(feedrate_F1080); //fixed velocity for the intro line 1d254: 61 e0 ldi r22, 0x01 ; 1 1d256: 86 e8 ldi r24, 0x86 ; 134 1d258: 93 e8 ldi r25, 0x83 ; 131 1d25a: 0e 94 af 7c call 0xf95e ; 0xf95e enquecommandf_P(extrude_fmt_X, 60.f, count_e(layer_height, extrusion_width * 4.f, 60)); 1d25e: 20 e0 ldi r18, 0x00 ; 0 1d260: 30 e0 ldi r19, 0x00 ; 0 1d262: 40 e8 ldi r20, 0x80 ; 128 1d264: 50 e4 ldi r21, 0x40 ; 64 1d266: c5 01 movw r24, r10 1d268: b4 01 movw r22, r8 1d26a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1d26e: 20 e0 ldi r18, 0x00 ; 0 1d270: 30 e0 ldi r19, 0x00 ; 0 1d272: 40 e7 ldi r20, 0x70 ; 112 1d274: 52 e4 ldi r21, 0x42 ; 66 1d276: 0f 94 4c 53 call 0x2a698 ; 0x2a698 1d27a: 9f 93 push r25 1d27c: 8f 93 push r24 1d27e: 7f 93 push r23 1d280: 6f 93 push r22 1d282: 82 e4 ldi r24, 0x42 ; 66 1d284: 8f 93 push r24 1d286: 80 e7 ldi r24, 0x70 ; 112 1d288: 8f 93 push r24 1d28a: 1f 92 push r1 1d28c: 1f 92 push r1 1d28e: c9 e7 ldi r28, 0x79 ; 121 1d290: d3 e8 ldi r29, 0x83 ; 131 1d292: df 93 push r29 1d294: cf 93 push r28 1d296: 0e 94 4d 7d call 0xfa9a ; 0xfa9a enquecommandf_P(extrude_fmt_X, 202.5f, count_e(layer_height, extrusion_width * 8.f, 142.5)); 1d29a: 20 e0 ldi r18, 0x00 ; 0 1d29c: 30 e0 ldi r19, 0x00 ; 0 1d29e: 40 e0 ldi r20, 0x00 ; 0 1d2a0: 51 e4 ldi r21, 0x41 ; 65 1d2a2: c5 01 movw r24, r10 1d2a4: b4 01 movw r22, r8 1d2a6: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1d2aa: 20 e0 ldi r18, 0x00 ; 0 1d2ac: 30 e8 ldi r19, 0x80 ; 128 1d2ae: 4e e0 ldi r20, 0x0E ; 14 1d2b0: 53 e4 ldi r21, 0x43 ; 67 1d2b2: 0f 94 4c 53 call 0x2a698 ; 0x2a698 1d2b6: 9f 93 push r25 1d2b8: 8f 93 push r24 1d2ba: 7f 93 push r23 1d2bc: 6f 93 push r22 1d2be: 83 e4 ldi r24, 0x43 ; 67 1d2c0: 8f 93 push r24 1d2c2: 8a e4 ldi r24, 0x4A ; 74 1d2c4: 8f 93 push r24 1d2c6: 80 e8 ldi r24, 0x80 ; 128 1d2c8: 8f 93 push r24 1d2ca: 1f 92 push r1 1d2cc: df 93 push r29 1d2ce: cf 93 push r28 1d2d0: 0e 94 4d 7d call 0xfa9a ; 0xfa9a 1d2d4: 8d b7 in r24, 0x3d ; 61 1d2d6: 9e b7 in r25, 0x3e ; 62 1d2d8: 44 96 adiw r24, 0x14 ; 20 1d2da: 0f b6 in r0, 0x3f ; 63 1d2dc: f8 94 cli 1d2de: 9e bf out 0x3e, r25 ; 62 1d2e0: 0f be out 0x3f, r0 ; 63 1d2e2: 8d bf out 0x3d, r24 ; 61 1d2e4: 88 ce rjmp .-752 ; 0x1cff6 cmd_pre_meander_5, #endif //NEW_FIRST_LAYER_CAL cmd_pre_meander_6, }; lay1cal_common_enqueue_loop(cmd_pre_meander, (sizeof(cmd_pre_meander)/sizeof(cmd_pre_meander[0]))); 1d2e6: 66 e0 ldi r22, 0x06 ; 6 1d2e8: 8d e6 ldi r24, 0x6D ; 109 1d2ea: 93 e8 ldi r25, 0x83 ; 131 1d2ec: 52 ce rjmp .-860 ; 0x1cf92 //! @brief Print meander start void lay1cal_meander_start(float layer_height, float extrusion_width) { #ifndef NEW_FIRST_LAYER_CAL enquecommand_P(PSTR("G1X50Y155")); 1d2ee: 61 e0 ldi r22, 0x01 ; 1 1d2f0: 83 e6 ldi r24, 0x63 ; 99 1d2f2: 93 e8 ldi r25, 0x83 ; 131 1d2f4: 0e 94 af 7c call 0xf95e ; 0xf95e #endif //_NEW_FIRST_LAYER_CAL static const char fmt1[] PROGMEM = "G1Z%.2f"; enquecommandf_P(fmt1, layer_height); 1d2f8: 8e e3 ldi r24, 0x3E ; 62 1d2fa: 8f 93 push r24 1d2fc: 8c e4 ldi r24, 0x4C ; 76 1d2fe: 8f 93 push r24 1d300: 8c ec ldi r24, 0xCC ; 204 1d302: 8f 93 push r24 1d304: 8d ec ldi r24, 0xCD ; 205 1d306: 8f 93 push r24 1d308: 8b e5 ldi r24, 0x5B ; 91 1d30a: 93 e8 ldi r25, 0x83 ; 131 1d30c: 9f 93 push r25 1d30e: 8f 93 push r24 1d310: 0e 94 4d 7d call 0xfa9a ; 0xfa9a enquecommand_P(feedrate_F1080); 1d314: 61 e0 ldi r22, 0x01 ; 1 1d316: 86 e8 ldi r24, 0x86 ; 134 1d318: 93 e8 ldi r25, 0x83 ; 131 1d31a: 0e 94 af 7c call 0xf95e ; 0xf95e enquecommand_P(MSG_G91); //enable relative XYZ 1d31e: 61 e0 ldi r22, 0x01 ; 1 1d320: 89 e0 ldi r24, 0x09 ; 9 1d322: 98 e6 ldi r25, 0x68 ; 104 1d324: 0e 94 af 7c call 0xf95e ; 0xf95e #ifdef NEW_FIRST_LAYER_CAL enquecommandf_P(extrude_fmt_Y, short_length, count_e(layer_height, extrusion_width, short_length)); enquecommandf_P(extrude_fmt_X, long_length*invert, count_e(layer_height, extrusion_width, long_length)); enquecommandf_P(extrude_fmt_Y, -short_length*invert, count_e(layer_height, extrusion_width, short_length)); #else enquecommandf_P(extrude_fmt_X, 25.f*invert, count_e(layer_height, extrusion_width * 4.f, 25)); 1d328: 20 e0 ldi r18, 0x00 ; 0 1d32a: 30 e0 ldi r19, 0x00 ; 0 1d32c: 40 e8 ldi r20, 0x80 ; 128 1d32e: 50 e4 ldi r21, 0x40 ; 64 1d330: c5 01 movw r24, r10 1d332: b4 01 movw r22, r8 1d334: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1d338: 20 e0 ldi r18, 0x00 ; 0 1d33a: 30 e0 ldi r19, 0x00 ; 0 1d33c: 48 ec ldi r20, 0xC8 ; 200 1d33e: 51 e4 ldi r21, 0x41 ; 65 1d340: 0f 94 4c 53 call 0x2a698 ; 0x2a698 1d344: 9f 93 push r25 1d346: 8f 93 push r24 1d348: 7f 93 push r23 1d34a: 6f 93 push r22 1d34c: 01 e4 ldi r16, 0x41 ; 65 1d34e: 0f 93 push r16 1d350: 18 ec ldi r17, 0xC8 ; 200 1d352: 1f 93 push r17 1d354: 1f 92 push r1 1d356: 1f 92 push r1 1d358: c9 e7 ldi r28, 0x79 ; 121 1d35a: d3 e8 ldi r29, 0x83 ; 131 1d35c: df 93 push r29 1d35e: cf 93 push r28 1d360: 0e 94 4d 7d call 0xfa9a ; 0xfa9a enquecommandf_P(extrude_fmt_X, 25.f*invert, count_e(layer_height, extrusion_width * 2.f, 25)); 1d364: a5 01 movw r20, r10 1d366: 94 01 movw r18, r8 1d368: c5 01 movw r24, r10 1d36a: b4 01 movw r22, r8 1d36c: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1d370: 20 e0 ldi r18, 0x00 ; 0 1d372: 30 e0 ldi r19, 0x00 ; 0 1d374: 48 ec ldi r20, 0xC8 ; 200 1d376: 51 e4 ldi r21, 0x41 ; 65 1d378: 0f 94 4c 53 call 0x2a698 ; 0x2a698 1d37c: 9f 93 push r25 1d37e: 8f 93 push r24 1d380: 7f 93 push r23 1d382: 6f 93 push r22 1d384: 0f 93 push r16 1d386: 1f 93 push r17 1d388: 1f 92 push r1 1d38a: 1f 92 push r1 1d38c: df 93 push r29 1d38e: cf 93 push r28 1d390: 0e 94 4d 7d call 0xfa9a ; 0xfa9a enquecommandf_P(extrude_fmt_X, 100.f*invert, count_e(layer_height, extrusion_width, 100)); 1d394: 20 e0 ldi r18, 0x00 ; 0 1d396: 30 e0 ldi r19, 0x00 ; 0 1d398: 48 ec ldi r20, 0xC8 ; 200 1d39a: 52 e4 ldi r21, 0x42 ; 66 1d39c: c5 01 movw r24, r10 1d39e: b4 01 movw r22, r8 1d3a0: 0f 94 4c 53 call 0x2a698 ; 0x2a698 1d3a4: 9f 93 push r25 1d3a6: 8f 93 push r24 1d3a8: 7f 93 push r23 1d3aa: 6f 93 push r22 1d3ac: 82 e4 ldi r24, 0x42 ; 66 1d3ae: 8f 93 push r24 1d3b0: 1f 93 push r17 1d3b2: 1f 92 push r1 1d3b4: 1f 92 push r1 1d3b6: df 93 push r29 1d3b8: cf 93 push r28 1d3ba: 0e 94 4d 7d call 0xfa9a ; 0xfa9a enquecommandf_P(extrude_fmt_Y, -20.f*invert, count_e(layer_height, extrusion_width, 20)); 1d3be: 8d b7 in r24, 0x3d ; 61 1d3c0: 9e b7 in r25, 0x3e ; 62 1d3c2: 84 96 adiw r24, 0x24 ; 36 1d3c4: 0f b6 in r0, 0x3f ; 63 1d3c6: f8 94 cli 1d3c8: 9e bf out 0x3e, r25 ; 62 1d3ca: 0f be out 0x3f, r0 ; 63 1d3cc: 8d bf out 0x3d, r24 ; 61 1d3ce: 20 e0 ldi r18, 0x00 ; 0 1d3d0: 30 e0 ldi r19, 0x00 ; 0 1d3d2: 40 ea ldi r20, 0xA0 ; 160 1d3d4: 51 e4 ldi r21, 0x41 ; 65 1d3d6: c5 01 movw r24, r10 1d3d8: b4 01 movw r22, r8 1d3da: 0f 94 4c 53 call 0x2a698 ; 0x2a698 1d3de: 9f 93 push r25 1d3e0: 8f 93 push r24 1d3e2: 7f 93 push r23 1d3e4: 6f 93 push r22 1d3e6: 81 ec ldi r24, 0xC1 ; 193 1d3e8: 8f 93 push r24 1d3ea: 80 ea ldi r24, 0xA0 ; 160 1d3ec: 8f 93 push r24 1d3ee: 1f 92 push r1 1d3f0: 1f 92 push r1 1d3f2: 8e e4 ldi r24, 0x4E ; 78 1d3f4: 93 e8 ldi r25, 0x83 ; 131 1d3f6: 9f 93 push r25 1d3f8: 8f 93 push r24 1d3fa: 0e 94 4d 7d call 0xfa9a ; 0xfa9a 1d3fe: 8d b7 in r24, 0x3d ; 61 1d400: 9e b7 in r25, 0x3e ; 62 1d402: 0a 96 adiw r24, 0x0a ; 10 1d404: 0f b6 in r0, 0x3f ; 63 1d406: f8 94 cli 1d408: 9e bf out 0x3e, r25 ; 62 1d40a: 0f be out 0x3f, r0 ; 63 1d40c: 8d bf out 0x3d, r24 ; 61 1d40e: f3 cd rjmp .-1050 ; 0x1cff6 //! @brief Print meander //! @param cmd_buffer character buffer needed to format gcodes void lay1cal_meander(float layer_height, float extrusion_width) { const float long_extrusion = count_e(layer_height, extrusion_width, long_length); 1d410: 20 e0 ldi r18, 0x00 ; 0 1d412: 30 e0 ldi r19, 0x00 ; 0 1d414: 46 e1 ldi r20, 0x16 ; 22 1d416: 53 e4 ldi r21, 0x43 ; 67 1d418: c5 01 movw r24, r10 1d41a: b4 01 movw r22, r8 1d41c: 0f 94 4c 53 call 0x2a698 ; 0x2a698 1d420: 76 2e mov r7, r22 1d422: 67 2e mov r6, r23 1d424: 58 2e mov r5, r24 1d426: 49 2e mov r4, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 1d428: 20 e0 ldi r18, 0x00 ; 0 1d42a: 30 e0 ldi r19, 0x00 ; 0 1d42c: 40 ea ldi r20, 0xA0 ; 160 1d42e: 51 e4 ldi r21, 0x41 ; 65 1d430: c5 01 movw r24, r10 1d432: b4 01 movw r22, r8 1d434: 0f 94 4c 53 call 0x2a698 ; 0x2a698 1d438: b6 2e mov r11, r22 1d43a: a7 2e mov r10, r23 1d43c: 98 2e mov r9, r24 1d43e: 89 2e mov r8, r25 1d440: c5 e0 ldi r28, 0x05 ; 5 for(int8_t i = 0, xdir = -invert; i <= 4; i++, xdir = -xdir) 1d442: df ef ldi r29, 0xFF ; 255 { enquecommandf_P(extrude_fmt_X, xdir * long_length, long_extrusion); 1d444: 29 e7 ldi r18, 0x79 ; 121 1d446: e2 2e mov r14, r18 1d448: 23 e8 ldi r18, 0x83 ; 131 1d44a: f2 2e mov r15, r18 enquecommandf_P(extrude_fmt_Y, invert * -short_length, short_extrusion); 1d44c: 31 ec ldi r19, 0xC1 ; 193 1d44e: c3 2e mov r12, r19 1d450: 40 ea ldi r20, 0xA0 ; 160 1d452: d4 2e mov r13, r20 1d454: 0e e4 ldi r16, 0x4E ; 78 1d456: 13 e8 ldi r17, 0x83 ; 131 const float long_extrusion = count_e(layer_height, extrusion_width, long_length); const float short_extrusion = count_e(layer_height, extrusion_width, short_length); for(int8_t i = 0, xdir = -invert; i <= 4; i++, xdir = -xdir) { enquecommandf_P(extrude_fmt_X, xdir * long_length, long_extrusion); 1d458: 4f 92 push r4 1d45a: 5f 92 push r5 1d45c: 6f 92 push r6 1d45e: 7f 92 push r7 1d460: 6d 2f mov r22, r29 1d462: 0d 2e mov r0, r29 1d464: 00 0c add r0, r0 1d466: 77 0b sbc r23, r23 1d468: 88 0b sbc r24, r24 1d46a: 99 0b sbc r25, r25 1d46c: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 1d470: 20 e0 ldi r18, 0x00 ; 0 1d472: 30 e0 ldi r19, 0x00 ; 0 1d474: 46 e1 ldi r20, 0x16 ; 22 1d476: 53 e4 ldi r21, 0x43 ; 67 1d478: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1d47c: 9f 93 push r25 1d47e: 8f 93 push r24 1d480: 7f 93 push r23 1d482: 6f 93 push r22 1d484: ff 92 push r15 1d486: ef 92 push r14 1d488: 0e 94 4d 7d call 0xfa9a ; 0xfa9a enquecommandf_P(extrude_fmt_Y, invert * -short_length, short_extrusion); 1d48c: 8f 92 push r8 1d48e: 9f 92 push r9 1d490: af 92 push r10 1d492: bf 92 push r11 1d494: cf 92 push r12 1d496: df 92 push r13 1d498: 1f 92 push r1 1d49a: 1f 92 push r1 1d49c: 1f 93 push r17 1d49e: 0f 93 push r16 1d4a0: 0e 94 4d 7d call 0xfa9a ; 0xfa9a void lay1cal_meander(float layer_height, float extrusion_width) { const float long_extrusion = count_e(layer_height, extrusion_width, long_length); const float short_extrusion = count_e(layer_height, extrusion_width, short_length); for(int8_t i = 0, xdir = -invert; i <= 4; i++, xdir = -xdir) 1d4a4: d1 95 neg r29 1d4a6: c1 50 subi r28, 0x01 ; 1 1d4a8: 8d b7 in r24, 0x3d ; 61 1d4aa: 9e b7 in r25, 0x3e ; 62 1d4ac: 44 96 adiw r24, 0x14 ; 20 1d4ae: 0f b6 in r0, 0x3f ; 63 1d4b0: f8 94 cli 1d4b2: 9e bf out 0x3e, r25 ; 62 1d4b4: 0f be out 0x3f, r0 ; 63 1d4b6: 8d bf out 0x3d, r24 ; 61 1d4b8: c1 11 cpse r28, r1 1d4ba: ce cf rjmp .-100 ; 0x1d458 1d4bc: 9c cd rjmp .-1224 ; 0x1cff6 //! @param layer_height layer height in mm //! @param extrusion_width extrusion width in mm //! @return filament length in mm which needs to be extruded to form line static constexpr float spacing(float layer_height, float extrusion_width, float overlap_factor=1.f) { return extrusion_width - layer_height * (overlap_factor - M_PI/4); 1d4be: 23 e4 ldi r18, 0x43 ; 67 1d4c0: 3d ec ldi r19, 0xCD ; 205 1d4c2: 4f e2 ldi r20, 0x2F ; 47 1d4c4: 5d e3 ldi r21, 0x3D ; 61 1d4c6: c5 01 movw r24, r10 1d4c8: b4 01 movw r22, r8 1d4ca: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1d4ce: 6b 01 movw r12, r22 1d4d0: 7c 01 movw r14, r24 //! //! @param cmd_buffer character buffer needed to format gcodes void lay1cal_square(float layer_height, float extrusion_width) { const float Y_spacing = spacing(layer_height, extrusion_width); const float long_extrusion = count_e(layer_height, extrusion_width, square_width); 1d4d2: 20 e0 ldi r18, 0x00 ; 0 1d4d4: 30 e0 ldi r19, 0x00 ; 0 1d4d6: 40 ea ldi r20, 0xA0 ; 160 1d4d8: 51 e4 ldi r21, 0x41 ; 65 1d4da: c5 01 movw r24, r10 1d4dc: b4 01 movw r22, r8 1d4de: 0f 94 4c 53 call 0x2a698 ; 0x2a698 1d4e2: 66 2e mov r6, r22 1d4e4: 57 2e mov r5, r23 1d4e6: 48 2e mov r4, r24 1d4e8: 39 2e mov r3, r25 const float short_extrusion = count_e(layer_height, extrusion_width, Y_spacing); 1d4ea: a7 01 movw r20, r14 1d4ec: 96 01 movw r18, r12 1d4ee: c5 01 movw r24, r10 1d4f0: b4 01 movw r22, r8 1d4f2: 0f 94 4c 53 call 0x2a698 ; 0x2a698 1d4f6: 26 2e mov r2, r22 1d4f8: a7 2e mov r10, r23 1d4fa: 98 2e mov r9, r24 1d4fc: 89 2e mov r8, r25 1d4fe: 84 e0 ldi r24, 0x04 ; 4 1d500: b8 2e mov r11, r24 for (uint8_t i = 0; i < 4; i++) { enquecommandf_P(extrude_fmt_X, square_width*invert, long_extrusion); 1d502: 90 ea ldi r25, 0xA0 ; 160 1d504: 79 2e mov r7, r25 1d506: 09 e7 ldi r16, 0x79 ; 121 1d508: 13 e8 ldi r17, 0x83 ; 131 enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion); 1d50a: f7 fa bst r15, 7 1d50c: f0 94 com r15 1d50e: f7 f8 bld r15, 7 1d510: f0 94 com r15 1d512: ce e4 ldi r28, 0x4E ; 78 1d514: d3 e8 ldi r29, 0x83 ; 131 const float long_extrusion = count_e(layer_height, extrusion_width, square_width); const float short_extrusion = count_e(layer_height, extrusion_width, Y_spacing); for (uint8_t i = 0; i < 4; i++) { enquecommandf_P(extrude_fmt_X, square_width*invert, long_extrusion); 1d516: 3f 92 push r3 1d518: 4f 92 push r4 1d51a: 5f 92 push r5 1d51c: 6f 92 push r6 1d51e: 91 e4 ldi r25, 0x41 ; 65 1d520: 9f 93 push r25 1d522: 7f 92 push r7 1d524: 1f 92 push r1 1d526: 1f 92 push r1 1d528: 1f 93 push r17 1d52a: 0f 93 push r16 1d52c: 0e 94 4d 7d call 0xfa9a ; 0xfa9a enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion); 1d530: 8f 92 push r8 1d532: 9f 92 push r9 1d534: af 92 push r10 1d536: 2f 92 push r2 1d538: ff 92 push r15 1d53a: ef 92 push r14 1d53c: df 92 push r13 1d53e: cf 92 push r12 1d540: df 93 push r29 1d542: cf 93 push r28 1d544: 0e 94 4d 7d call 0xfa9a ; 0xfa9a enquecommandf_P(extrude_fmt_X, -square_width*invert, long_extrusion); 1d548: 3f 92 push r3 1d54a: 4f 92 push r4 1d54c: 5f 92 push r5 1d54e: 6f 92 push r6 1d550: 81 ec ldi r24, 0xC1 ; 193 1d552: 8f 93 push r24 1d554: 7f 92 push r7 1d556: 1f 92 push r1 1d558: 1f 92 push r1 1d55a: 1f 93 push r17 1d55c: 0f 93 push r16 1d55e: 0e 94 4d 7d call 0xfa9a ; 0xfa9a enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion); 1d562: 8f 92 push r8 1d564: 9f 92 push r9 1d566: af 92 push r10 1d568: 2f 92 push r2 1d56a: ff 92 push r15 1d56c: ef 92 push r14 1d56e: df 92 push r13 1d570: cf 92 push r12 1d572: df 93 push r29 1d574: cf 93 push r28 1d576: 0e 94 4d 7d call 0xfa9a ; 0xfa9a 1d57a: ba 94 dec r11 { const float Y_spacing = spacing(layer_height, extrusion_width); const float long_extrusion = count_e(layer_height, extrusion_width, square_width); const float short_extrusion = count_e(layer_height, extrusion_width, Y_spacing); for (uint8_t i = 0; i < 4; i++) 1d57c: 8d b7 in r24, 0x3d ; 61 1d57e: 9e b7 in r25, 0x3e ; 62 1d580: 88 96 adiw r24, 0x28 ; 40 1d582: 0f b6 in r0, 0x3f ; 63 1d584: f8 94 cli 1d586: 9e bf out 0x3e, r25 ; 62 1d588: 0f be out 0x3f, r0 ; 63 1d58a: 8d bf out 0x3d, r24 ; 61 1d58c: b1 10 cpse r11, r1 1d58e: c3 cf rjmp .-122 ; 0x1d516 1d590: 32 cd rjmp .-1436 ; 0x1cff6 MSG_M702, // Unload filament (MMU only) cmd_cal_finish_8, // Turn off hotend heater MSG_M84 // Disable stepper motors }; lay1cal_common_enqueue_loop(cmd_cal_finish, (sizeof(cmd_cal_finish)/sizeof(cmd_cal_finish[0]))); 1d592: 69 e0 ldi r22, 0x09 ; 9 1d594: 8c e3 ldi r24, 0x3C ; 60 1d596: 93 e8 ldi r25, 0x83 ; 131 1d598: fc cc rjmp .-1544 ; 0x1cf92 break; case 2: lay1cal_finish(); break; case 1: lcd_setstatuspgm(MSG_WELCOME); 1d59a: 87 e6 ldi r24, 0x67 ; 103 1d59c: 9b e6 ldi r25, 0x6B ; 107 1d59e: 0e 94 65 e6 call 0x1ccca ; 0x1ccca lcd_commands_step = 0; 1d5a2: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 lcd_commands_type = LcdCommands::Idle; 1d5a6: 10 92 c8 0d sts 0x0DC8, r1 ; 0x800dc8 1d5aa: 82 e0 ldi r24, 0x02 ; 2 1d5ac: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.367> SetPrinterState(PrinterState::Idle); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 1d5b0: 8f e5 ldi r24, 0x5F ; 95 1d5b2: 9f e0 ldi r25, 0x0F ; 15 1d5b4: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1d5b8: 88 23 and r24, r24 1d5ba: 09 f4 brne .+2 ; 0x1d5be 1d5bc: f3 cd rjmp .-1050 ; 0x1d1a4 lcd_wizard(WizState::RepeatLay1Cal); 1d5be: 8b e0 ldi r24, 0x0B ; 11 1d5c0: 0f 94 09 2e call 0x25c12 ; 0x25c12 1d5c4: 18 cd rjmp .-1488 ; 0x1cff6 if (_Kp != 0 || _Ki != 0 || _Kd != 0) { enquecommandf_P(PSTR("M301 P%.2f I%.2f D%.2f"), _Kp, _Ki, _Kd); enquecommand_P(MSG_M500); } else { SERIAL_ECHOPGM("Invalid PID cal. results. Not stored to EEPROM."); 1d5c6: 84 ee ldi r24, 0xE4 ; 228 1d5c8: 93 e8 ldi r25, 0x83 ; 131 1d5ca: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 1d5ce: c4 cd rjmp .-1144 ; 0x1d158 #endif //THERMAL_MODEL #endif //QUICK_NOZZLE_CHANGE switch(lcd_commands_step) { case 0: lcd_commands_step = 3; 1d5d0: 83 e0 ldi r24, 0x03 ; 3 thermal_model_set_enabled(was_enabled); #endif //THERMAL_MODEL #else fanSpeed = 0; //turn off fan #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 1; 1d5d2: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 1d5d6: 07 ce rjmp .-1010 ; 0x1d1e6 case 0: lcd_commands_step = 3; break; case 3: #ifndef QUICK_NOZZLE_CHANGE lcd_show_fullscreen_message_and_wait_P(_T(MSG_NOZZLE_CNG_READ_HELP)); 1d5d8: 85 e9 ldi r24, 0x95 ; 149 1d5da: 90 e4 ldi r25, 0x40 ; 64 1d5dc: 0e 94 b1 6c call 0xd962 ; 0xd962 1d5e0: 0f 94 47 0b call 0x2168e ; 0x2168e enquecommand_P(G28W); 1d5e4: 61 e0 ldi r22, 0x01 ; 1 1d5e6: 82 e1 ldi r24, 0x12 ; 18 1d5e8: 98 e6 ldi r25, 0x68 ; 104 1d5ea: 0e 94 af 7c call 0xf95e ; 0xf95e enquecommand_P(PSTR("G1 X125 Z200 F1000")); 1d5ee: 61 e0 ldi r22, 0x01 ; 1 1d5f0: 81 ed ldi r24, 0xD1 ; 209 1d5f2: 93 e8 ldi r25, 0x83 ; 131 1d5f4: 0e 94 af 7c call 0xf95e ; 0xf95e enquecommand_P(PSTR("M109 S280")); 1d5f8: 61 e0 ldi r22, 0x01 ; 1 1d5fa: 87 ec ldi r24, 0xC7 ; 199 1d5fc: 93 e8 ldi r25, 0x83 ; 131 1d5fe: 0e 94 af 7c call 0xf95e ; 0xf95e } } enquecommand_P(G28W); //home enquecommand_P(PSTR("G1 X125 Z200 F1000")); //move to top center #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 2; 1d602: 82 e0 ldi r24, 0x02 ; 2 1d604: e6 cf rjmp .-52 ; 0x1d5d2 break; case 2: enquecommand_P(PSTR("M84 XY")); 1d606: 61 e0 ldi r22, 0x01 ; 1 1d608: 80 ec ldi r24, 0xC0 ; 192 1d60a: 93 e8 ldi r25, 0x83 ; 131 1d60c: 0e 94 af 7c call 0xf95e ; 0xf95e if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_CHANGED), false) == LCD_LEFT_BUTTON_CHOICE) { 1d610: 8c e5 ldi r24, 0x5C ; 92 1d612: 90 e4 ldi r25, 0x40 ; 64 1d614: 0e 94 b1 6c call 0xd962 ; 0xd962 1d618: 41 e0 ldi r20, 0x01 ; 1 1d61a: 60 e0 ldi r22, 0x00 ; 0 1d61c: 0f 94 e0 2d call 0x25bc0 ; 0x25bc0 1d620: 81 11 cpse r24, r1 1d622: e1 cd rjmp .-1086 ; 0x1d1e6 1d624: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 1d628: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 thermal_model_set_enabled(was_enabled); #endif //THERMAL_MODEL #else fanSpeed = 0; //turn off fan #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 1; 1d62c: 81 e0 ldi r24, 0x01 ; 1 1d62e: d1 cf rjmp .-94 ; 0x1d5d2 } break; case 1: lcd_commands_step = 0; 1d630: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 lcd_commands_type = LcdCommands::Idle; 1d634: 10 92 c8 0d sts 0x0DC8, r1 ; 0x800dc8 1d638: 82 e0 ldi r24, 0x02 ; 2 1d63a: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.367> SetPrinterState(PrinterState::Idle); menu_goto(lcd_hw_setup_menu, 2, true); 1d63e: 20 e0 ldi r18, 0x00 ; 0 1d640: 41 e0 ldi r20, 0x01 ; 1 1d642: 62 e0 ldi r22, 0x02 ; 2 1d644: 70 e0 ldi r23, 0x00 ; 0 1d646: 85 eb ldi r24, 0xB5 ; 181 1d648: 93 eb ldi r25, 0xB3 ; 179 1d64a: 0f 94 e6 92 call 0x325cc ; 0x325cc menu_depth = 3; 1d64e: 83 e0 ldi r24, 0x03 ; 3 1d650: 80 93 ad 03 sts 0x03AD, r24 ; 0x8003ad 1d654: c8 cd rjmp .-1136 ; 0x1d1e6 0001d656 : && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); } void menu_lcd_lcdupdate_func(void) { 1d656: 0f 93 push r16 1d658: 1f 93 push r17 1d65a: cf 93 push r28 #if (SDCARDDETECT > 0) if ((IS_SD_INSERTED != lcd_oldcardstatus)) 1d65c: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1d660: 82 fb bst r24, 2 1d662: 88 27 eor r24, r24 1d664: 80 f9 bld r24, 0 1d666: 91 e0 ldi r25, 0x01 ; 1 1d668: 89 27 eor r24, r25 1d66a: 90 91 cf 03 lds r25, 0x03CF ; 0x8003cf 1d66e: 89 17 cp r24, r25 1d670: 99 f1 breq .+102 ; 0x1d6d8 { if(menu_menu == lcd_sdcard_menu) { 1d672: 80 91 d0 03 lds r24, 0x03D0 ; 0x8003d0 1d676: 90 91 d1 03 lds r25, 0x03D1 ; 0x8003d1 1d67a: 8c 52 subi r24, 0x2C ; 44 1d67c: 9c 4e sbci r25, 0xEC ; 236 1d67e: 11 f4 brne .+4 ; 0x1d684 // to back out of this submenu. Not only to show // 'Print from SD' submenu title but also because the user // will be prompted with another menu with the sorted list of files. // Without backing out of the menu, the list will appear empty and // The user will need to back out of two nested submenus. menu_back(); 1d680: 0f 94 84 95 call 0x32b08 ; 0x32b08 } lcd_draw_update = 2; 1d684: 82 e0 ldi r24, 0x02 ; 2 1d686: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b lcd_oldcardstatus = IS_SD_INSERTED; 1d68a: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1d68e: c1 e0 ldi r28, 0x01 ; 1 1d690: 82 fb bst r24, 2 1d692: 88 27 eor r24, r24 1d694: 80 f9 bld r24, 0 1d696: 8c 27 eor r24, r28 1d698: 80 93 cf 03 sts 0x03CF, r24 ; 0x8003cf lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 1d69c: 0e 94 27 6a call 0xd44e ; 0xd44e backlight_wake(); if (lcd_oldcardstatus) 1d6a0: 80 91 cf 03 lds r24, 0x03CF ; 0x8003cf 1d6a4: 88 23 and r24, r24 1d6a6: 09 f4 brne .+2 ; 0x1d6aa 1d6a8: 88 c0 rjmp .+272 ; 0x1d7ba { if (!card.mounted) 1d6aa: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1d6ae: 81 11 cpse r24, r1 1d6b0: 04 c0 rjmp .+8 ; 0x1d6ba { card.mount(false); //delay the sorting to the sd menu. Otherwise, removing the SD card while sorting will not menu_back() 1d6b2: 0f 94 7d 4d call 0x29afa ; 0x29afa card.presort_flag = true; //force sorting of the SD menu 1d6b6: c0 93 b9 13 sts 0x13B9, r28 ; 0x8013b9 } LCD_MESSAGERPGM(MSG_WELCOME); 1d6ba: 87 e6 ldi r24, 0x67 ; 103 1d6bc: 9b e6 ldi r25, 0x6B ; 107 1d6be: 0e 94 65 e6 call 0x1ccca ; 0x1ccca bMain=false; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function 1d6c2: 10 92 97 03 sts 0x0397, r1 ; 0x800397 menu_submenu(lcd_sdcard_menu, true); 1d6c6: 61 e0 ldi r22, 0x01 ; 1 1d6c8: 8c e2 ldi r24, 0x2C ; 44 1d6ca: 9c ee ldi r25, 0xEC ; 236 1d6cc: 0f 94 29 94 call 0x32852 ; 0x32852 lcd_timeoutToStatus.start(); 1d6d0: 81 eb ldi r24, 0xB1 ; 177 1d6d2: 93 e0 ldi r25, 0x03 ; 3 1d6d4: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); } } #endif//CARDINSERTED if (lcd_next_update_millis < _millis()) 1d6d8: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 1d6dc: 00 91 93 03 lds r16, 0x0393 ; 0x800393 1d6e0: 10 91 94 03 lds r17, 0x0394 ; 0x800394 1d6e4: 20 91 95 03 lds r18, 0x0395 ; 0x800395 1d6e8: 30 91 96 03 lds r19, 0x0396 ; 0x800396 1d6ec: 06 17 cp r16, r22 1d6ee: 17 07 cpc r17, r23 1d6f0: 28 07 cpc r18, r24 1d6f2: 39 07 cpc r19, r25 1d6f4: e8 f5 brcc .+122 ; 0x1d770 { if (lcd_draw_update) { 1d6f6: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1d6fa: 88 23 and r24, r24 1d6fc: 31 f0 breq .+12 ; 0x1d70a lcd_timeoutToStatus.start(); 1d6fe: 81 eb ldi r24, 0xB1 ; 177 1d700: 93 e0 ldi r25, 0x03 ; 3 1d702: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> lcd_frame_start(); 1d706: 0e 94 2f 69 call 0xd25e ; 0xd25e } (*menu_menu)(); 1d70a: e0 91 d0 03 lds r30, 0x03D0 ; 0x8003d0 1d70e: f0 91 d1 03 lds r31, 0x03D1 ; 0x8003d1 1d712: 19 95 eicall // we should ignore lcd_timeoutToStatus. Example use case is // when running first layer calibration. static inline bool z_menu_expired() { return (menu_menu == lcd_babystep_z && (!babystep_allowed() || (lcd_commands_type == LcdCommands::Idle && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS_BABYSTEP_Z)))); 1d714: 80 91 d0 03 lds r24, 0x03D0 ; 0x8003d0 1d718: 90 91 d1 03 lds r25, 0x03D1 ; 0x8003d1 1d71c: 83 5e subi r24, 0xE3 ; 227 1d71e: 96 43 sbci r25, 0x36 ; 54 1d720: 09 f4 brne .+2 ; 0x1d724 1d722: 5e c0 rjmp .+188 ; 0x1d7e0 } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen 1d724: 80 91 d0 03 lds r24, 0x03D0 ; 0x8003d0 1d728: 90 91 d1 03 lds r25, 0x03D1 ; 0x8003d1 && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 1d72c: 27 e3 ldi r18, 0x37 ; 55 1d72e: 81 3b cpi r24, 0xB1 ; 177 1d730: 92 07 cpc r25, r18 1d732: 09 f0 breq .+2 ; 0x1d736 1d734: 76 c0 rjmp .+236 ; 0x1d822 } lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); 1d736: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1d73a: 82 30 cpi r24, 0x02 ; 2 1d73c: 21 f4 brne .+8 ; 0x1d746 #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 1d73e: 0e 94 27 6a call 0xd44e ; 0xd44e lcd_status_message_idx = 0; // Re-draw message from beginning 1d742: 10 92 08 05 sts 0x0508, r1 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.417> lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); if (lcd_draw_update) lcd_draw_update--; 1d746: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1d74a: 88 23 and r24, r24 1d74c: 19 f0 breq .+6 ; 0x1d754 1d74e: 81 50 subi r24, 0x01 ; 1 1d750: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b lcd_next_update_millis = _millis() + LCD_UPDATE_INTERVAL; 1d754: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 1d758: 6c 59 subi r22, 0x9C ; 156 1d75a: 7f 4f sbci r23, 0xFF ; 255 1d75c: 8f 4f sbci r24, 0xFF ; 255 1d75e: 9f 4f sbci r25, 0xFF ; 255 1d760: 60 93 93 03 sts 0x0393, r22 ; 0x800393 1d764: 70 93 94 03 sts 0x0394, r23 ; 0x800394 1d768: 80 93 95 03 sts 0x0395, r24 ; 0x800395 1d76c: 90 93 96 03 sts 0x0396, r25 ; 0x800396 SERIAL_ECHO(']'); prusa_stat_diameter(); } static void lcd_send_status() { if (farm_mode && no_response && (NcTime.expired(NC_TIME * 1000))) { 1d770: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1d774: 88 23 and r24, r24 1d776: 99 f0 breq .+38 ; 0x1d79e 1d778: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 <_ZL11no_response.lto_priv.497> 1d77c: 88 23 and r24, r24 1d77e: 79 f0 breq .+30 ; 0x1d79e 1d780: 60 e1 ldi r22, 0x10 ; 16 1d782: 77 e2 ldi r23, 0x27 ; 39 1d784: 8f e8 ldi r24, 0x8F ; 143 1d786: 93 e0 ldi r25, 0x03 ; 3 1d788: 0f 94 a7 0f call 0x21f4e ; 0x21f4e ::expired(unsigned short)> 1d78c: 88 23 and r24, r24 1d78e: 39 f0 breq .+14 ; 0x1d79e //send important status messages periodicaly prusa_statistics(8); 1d790: 88 e0 ldi r24, 0x08 ; 8 1d792: 0f 94 ff 97 call 0x32ffe ; 0x32ffe NcTime.start(); 1d796: 8f e8 ldi r24, 0x8F ; 143 1d798: 93 e0 ldi r25, 0x03 ; 3 1d79a: 0f 94 d6 0f call 0x21fac ; 0x21fac ::start()> } prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); 1d79e: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1d7a2: 84 30 cpi r24, 0x04 ; 4 1d7a4: 09 f0 breq .+2 ; 0x1d7a8 1d7a6: 54 c0 rjmp .+168 ; 0x1d850 void lcd_print_stop_finish(); void lcd_commands() { // printf_P(PSTR("lcd_commands begin, lcd_commands_type=%u, lcd_commands_step=%u\n"), (uint8_t)lcd_commands_type, lcd_commands_step); if (planner_aborted) { 1d7a8: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 1d7ac: 81 11 cpse r24, r1 1d7ae: 50 c0 rjmp .+160 ; 0x1d850 if (lcd_draw_update) lcd_draw_update--; lcd_next_update_millis = _millis() + LCD_UPDATE_INTERVAL; } prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); } 1d7b0: cf 91 pop r28 1d7b2: 1f 91 pop r17 1d7b4: 0f 91 pop r16 1d7b6: 0c 94 76 e6 jmp 0x1ccec ; 0x1ccec presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 1d7ba: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a mounted = false; 1d7be: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b SERIAL_ECHO_START; 1d7c2: 81 e6 ldi r24, 0x61 ; 97 1d7c4: 9d e9 ldi r25, 0x9D ; 157 1d7c6: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 1d7ca: 89 ee ldi r24, 0xE9 ; 233 1d7cc: 97 e6 ldi r25, 0x67 ; 103 1d7ce: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 lcd_timeoutToStatus.start(); } else { card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); 1d7d2: 85 e0 ldi r24, 0x05 ; 5 1d7d4: 90 e4 ldi r25, 0x40 ; 64 1d7d6: 0e 94 b1 6c call 0xd962 ; 0xd962 1d7da: 0e 94 65 e6 call 0x1ccca ; 0x1ccca 1d7de: 7c cf rjmp .-264 ; 0x1d6d8 // we should ignore lcd_timeoutToStatus. Example use case is // when running first layer calibration. static inline bool z_menu_expired() { return (menu_menu == lcd_babystep_z && (!babystep_allowed() || (lcd_commands_type == LcdCommands::Idle && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS_BABYSTEP_Z)))); 1d7e0: 0e 94 d7 60 call 0xc1ae ; 0xc1ae 1d7e4: 81 11 cpse r24, r1 1d7e6: 0e c0 rjmp .+28 ; 0x1d804 if (z_menu_expired() || other_menu_expired()) { // Exiting a menu. Let's call the menu function the last time with menu_leaving flag set to true // to give it a chance to save its state. // This is useful for example, when the babystep value has to be written into EEPROM. if (menu_menu != NULL) 1d7e8: e0 91 d0 03 lds r30, 0x03D0 ; 0x8003d0 1d7ec: f0 91 d1 03 lds r31, 0x03D1 ; 0x8003d1 1d7f0: 30 97 sbiw r30, 0x00 ; 0 1d7f2: 39 f5 brne .+78 ; 0x1d842 { menu_leaving = 1; (*menu_menu)(); menu_leaving = 0; } lcd_clear(); 1d7f4: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_return_to_status(); 1d7f8: 0e 94 17 fe call 0x1fc2e ; 0x1fc2e lcd_draw_update = 2; 1d7fc: 82 e0 ldi r24, 0x02 ; 2 1d7fe: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b 1d802: 99 cf rjmp .-206 ; 0x1d736 // we should ignore lcd_timeoutToStatus. Example use case is // when running first layer calibration. static inline bool z_menu_expired() { return (menu_menu == lcd_babystep_z && (!babystep_allowed() || (lcd_commands_type == LcdCommands::Idle && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS_BABYSTEP_Z)))); 1d804: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1d808: 81 11 cpse r24, r1 1d80a: 8c cf rjmp .-232 ; 0x1d724 1d80c: 40 e9 ldi r20, 0x90 ; 144 1d80e: 5f e5 ldi r21, 0x5F ; 95 1d810: 61 e0 ldi r22, 0x01 ; 1 1d812: 70 e0 ldi r23, 0x00 ; 0 1d814: 81 eb ldi r24, 0xB1 ; 177 1d816: 93 e0 ldi r25, 0x03 ; 3 1d818: 0f 94 e2 0f call 0x21fc4 ; 0x21fc4 ::expired(unsigned long)> 1d81c: 81 11 cpse r24, r1 1d81e: e4 cf rjmp .-56 ; 0x1d7e8 1d820: 81 cf rjmp .-254 ; 0x1d724 } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen && menu_menu != lcd_babystep_z 1d822: 83 5e subi r24, 0xE3 ; 227 1d824: 96 43 sbci r25, 0x36 ; 54 1d826: 09 f4 brne .+2 ; 0x1d82a 1d828: 86 cf rjmp .-244 ; 0x1d736 && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 1d82a: 40 e3 ldi r20, 0x30 ; 48 1d82c: 55 e7 ldi r21, 0x75 ; 117 1d82e: 60 e0 ldi r22, 0x00 ; 0 1d830: 70 e0 ldi r23, 0x00 ; 0 1d832: 81 eb ldi r24, 0xB1 ; 177 1d834: 93 e0 ldi r25, 0x03 ; 3 1d836: 0f 94 e2 0f call 0x21fc4 ; 0x21fc4 ::expired(unsigned long)> 1d83a: 88 23 and r24, r24 1d83c: 09 f4 brne .+2 ; 0x1d840 1d83e: 7b cf rjmp .-266 ; 0x1d736 1d840: d3 cf rjmp .-90 ; 0x1d7e8 // Exiting a menu. Let's call the menu function the last time with menu_leaving flag set to true // to give it a chance to save its state. // This is useful for example, when the babystep value has to be written into EEPROM. if (menu_menu != NULL) { menu_leaving = 1; 1d842: 81 e0 ldi r24, 0x01 ; 1 1d844: 80 93 92 03 sts 0x0392, r24 ; 0x800392 (*menu_menu)(); 1d848: 19 95 eicall menu_leaving = 0; 1d84a: 10 92 92 03 sts 0x0392, r1 ; 0x800392 1d84e: d2 cf rjmp .-92 ; 0x1d7f4 if (lcd_draw_update) lcd_draw_update--; lcd_next_update_millis = _millis() + LCD_UPDATE_INTERVAL; } prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); } 1d850: cf 91 pop r28 1d852: 1f 91 pop r17 1d854: 0f 91 pop r16 1d856: 08 95 ret 0001d858 : MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); MENU_END(); } void lcd_sdcard_menu() { 1d858: 2f 92 push r2 1d85a: 3f 92 push r3 1d85c: 4f 92 push r4 1d85e: 5f 92 push r5 1d860: 6f 92 push r6 1d862: 7f 92 push r7 1d864: 8f 92 push r8 1d866: 9f 92 push r9 1d868: af 92 push r10 1d86a: bf 92 push r11 1d86c: cf 92 push r12 1d86e: df 92 push r13 1d870: ef 92 push r14 1d872: ff 92 push r15 1d874: 0f 93 push r16 1d876: 1f 93 push r17 1d878: cf 93 push r28 1d87a: df 93 push r29 1d87c: cd b7 in r28, 0x3d ; 61 1d87e: de b7 in r29, 0x3e ; 62 1d880: 2d 97 sbiw r28, 0x0d ; 13 1d882: 0f b6 in r0, 0x3f ; 63 1d884: f8 94 cli 1d886: de bf out 0x3e, r29 ; 62 1d888: 0f be out 0x3f, r0 ; 63 1d88a: cd bf out 0x3d, r28 ; 61 ShortTimer lcd_scrollTimer; } _menu_data_sdcard_t; static_assert(sizeof(menu_data)>= sizeof(_menu_data_sdcard_t),"_menu_data_sdcard_t doesn't fit into menu_data"); _menu_data_sdcard_t* _md = (_menu_data_sdcard_t*)&(menu_data[0]); switch(_md->menuState) 1d88c: 80 91 64 03 lds r24, 0x0364 ; 0x800364 1d890: 81 30 cpi r24, 0x01 ; 1 1d892: 51 f1 breq .+84 ; 0x1d8e8 1d894: 30 f0 brcs .+12 ; 0x1d8a2 1d896: 82 30 cpi r24, 0x02 ; 2 1d898: 09 f4 brne .+2 ; 0x1d89c 1d89a: 88 c2 rjmp .+1296 ; 0x1ddac { _md->lcd_scrollTimer.stop(); //forces redraw in _standard state _md->menuState = _standard; } } break; default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. 1d89c: 10 92 64 03 sts 0x0364, r1 ; 0x800364 1d8a0: 04 c1 rjmp .+520 ; 0x1daaa switch(_md->menuState) { case _uninitialized: //Initialize menu data { if (card.presort_flag == true) //used to force resorting if sorting type is changed. 1d8a2: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 1d8a6: 88 23 and r24, r24 1d8a8: 49 f0 breq .+18 ; 0x1d8bc { card.presort_flag = false; 1d8aa: 10 92 b9 13 sts 0x13B9, r1 ; 0x8013b9 lcd_update_enabled = false; 1d8ae: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c card.presort(); 1d8b2: 0f 94 45 49 call 0x2928a ; 0x2928a lcd_update_enabled = true; 1d8b6: 81 e0 ldi r24, 0x01 ; 1 1d8b8: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c } _md->fileCnt = card.getnrfilenames(); 1d8bc: 0f 94 2e 48 call 0x2905c ; 0x2905c 1d8c0: 90 93 6c 03 sts 0x036C, r25 ; 0x80036c 1d8c4: 80 93 6b 03 sts 0x036B, r24 ; 0x80036b _md->sdSort = farm_mode ? SD_SORT_NONE : eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 1d8c8: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1d8cc: 81 11 cpse r24, r1 1d8ce: e7 c0 rjmp .+462 ; 0x1da9e 1d8d0: 89 e0 ldi r24, 0x09 ; 9 1d8d2: 9f e0 ldi r25, 0x0F ; 15 1d8d4: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1d8d8: 80 93 6e 03 sts 0x036E, r24 ; 0x80036e _md->menuState = _standard; 1d8dc: 81 e0 ldi r24, 0x01 ; 1 1d8de: 80 93 64 03 sts 0x0364, r24 ; 0x800364 _md->row = -1; // assume that no SD file/dir is currently selected. Once they are rendered, it will be changed to the correct row for the _scrolling state. 1d8e2: 8f ef ldi r24, 0xFF ; 255 1d8e4: 80 93 6d 03 sts 0x036D, r24 ; 0x80036d } // FALLTHRU case _standard: //normal menu structure. { if (!_md->lcd_scrollTimer.running()) //if the timer is not running, then the menu state was just switched, so redraw the screen. 1d8e8: 80 91 6f 03 lds r24, 0x036F ; 0x80036f 1d8ec: 81 11 cpse r24, r1 1d8ee: 07 c0 rjmp .+14 ; 0x1d8fe { _md->lcd_scrollTimer.start(); 1d8f0: 8f e6 ldi r24, 0x6F ; 111 1d8f2: 93 e0 ldi r25, 0x03 ; 3 1d8f4: 0f 94 d6 0f call 0x21fac ; 0x21fac ::start()> lcd_draw_update = 1; 1d8f8: 81 e0 ldi r24, 0x01 ; 1 1d8fa: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } if ((lcd_draw_update == 0) && _md->lcd_scrollTimer.expired(500) && (_md->row != -1)) //switch to the scrolling state on timeout if a file/dir is selected. 1d8fe: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1d902: 81 11 cpse r24, r1 1d904: 21 c0 rjmp .+66 ; 0x1d948 1d906: 64 ef ldi r22, 0xF4 ; 244 1d908: 71 e0 ldi r23, 0x01 ; 1 1d90a: 8f e6 ldi r24, 0x6F ; 111 1d90c: 93 e0 ldi r25, 0x03 ; 3 1d90e: 0f 94 a7 0f call 0x21f4e ; 0x21f4e ::expired(unsigned short)> 1d912: 88 23 and r24, r24 1d914: a1 f0 breq .+40 ; 0x1d93e 1d916: 80 91 6d 03 lds r24, 0x036D ; 0x80036d 1d91a: 8f 3f cpi r24, 0xFF ; 255 1d91c: 81 f0 breq .+32 ; 0x1d93e { _md->menuState = _scrolling; 1d91e: 82 e0 ldi r24, 0x02 ; 2 1d920: 80 93 64 03 sts 0x0364, r24 ; 0x800364 _md->offset = 0; 1d924: 10 92 65 03 sts 0x0365, r1 ; 0x800365 _md->scrollPointer = NULL; 1d928: 10 92 68 03 sts 0x0368, r1 ; 0x800368 1d92c: 10 92 67 03 sts 0x0367, r1 ; 0x800367 _md->lcd_scrollTimer.start(); 1d930: 8f e6 ldi r24, 0x6F ; 111 1d932: 93 e0 ldi r25, 0x03 ; 3 1d934: 0f 94 d6 0f call 0x21fac ; 0x21fac ::start()> lcd_draw_update = 1; //forces last load before switching to scrolling. 1d938: 81 e0 ldi r24, 0x01 ; 1 1d93a: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } if (lcd_draw_update == 0 && !lcd_clicked()) 1d93e: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1d942: 88 23 and r24, r24 1d944: 09 f4 brne .+2 ; 0x1d948 1d946: ad c0 rjmp .+346 ; 0x1daa2 return; // nothing to do (so don't thrash the SD card) _md->row = -1; // assume that no SD file/dir is currently selected. Once they are rendered, it will be changed to the correct row for the _scrolling state. 1d948: 8f ef ldi r24, 0xFF ; 255 1d94a: 80 93 6d 03 sts 0x036D, r24 ; 0x80036d //if we reached this point it means that the encoder moved or clicked or the state is being switched. Reset the scrollTimer. _md->lcd_scrollTimer.start(); 1d94e: 8f e6 ldi r24, 0x6F ; 111 1d950: 93 e0 ldi r25, 0x03 ; 3 1d952: 0f 94 d6 0f call 0x21fac ; 0x21fac ::start()> MENU_BEGIN(); 1d956: 0f 94 bc 92 call 0x32578 ; 0x32578 1d95a: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e if(eFilamentAction != FilamentAction::None) return; // Create a copy of card.filename on the stack since card.filename pointer // will be modified by the SD card library when searching for the file char selected_filename[FILENAME_LENGTH]; strcpy(selected_filename, filename); 1d95e: ce 01 movw r24, r28 1d960: 01 96 adiw r24, 0x01 ; 1 1d962: 7c 01 movw r14, r24 if (!check_file(selected_filename)) { result = !lcd_show_multiscreen_message_cont_cancel_and_wait_P(_T(MSG_FILE_INCOMPLETE), false); lcd_update_enable(true); } if (result) { enquecommandf_P(MSG_M23, selected_filename); 1d964: f9 ee ldi r31, 0xE9 ; 233 1d966: 2f 2e mov r2, r31 1d968: fb e6 ldi r31, 0x6B ; 107 1d96a: 3f 2e mov r3, r31 _md->row = -1; // assume that no SD file/dir is currently selected. Once they are rendered, it will be changed to the correct row for the _scrolling state. //if we reached this point it means that the encoder moved or clicked or the state is being switched. Reset the scrollTimer. _md->lcd_scrollTimer.start(); MENU_BEGIN(); 1d96c: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1d970: 84 30 cpi r24, 0x04 ; 4 1d972: 08 f0 brcs .+2 ; 0x1d976 1d974: 9a c0 rjmp .+308 ; 0x1daaa 1d976: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(bMain?MSG_MAIN:MSG_BACK)); // i.e. default menu-item / menu-item after card insertion 1d97a: 80 91 97 03 lds r24, 0x0397 ; 0x800397 1d97e: 88 23 and r24, r24 1d980: 09 f4 brne .+2 ; 0x1d984 1d982: ac c0 rjmp .+344 ; 0x1dadc 1d984: 88 ef ldi r24, 0xF8 ; 248 1d986: 9d e3 ldi r25, 0x3D ; 61 1d988: 0e 94 b1 6c call 0xd962 ; 0xd962 1d98c: 0f 94 87 95 call 0x32b0e ; 0x32b0e sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; FORCE_INLINE uint8_t percentDone(){if(!isFileOpen()) return 0; if(filesize) return sdpos/((filesize+99)/100); else return 0;}; FORCE_INLINE char* getWorkDirName(){workDir.getFilename(filename);return filename;}; 1d990: 6c e6 ldi r22, 0x6C ; 108 1d992: 73 e1 ldi r23, 0x13 ; 19 1d994: 85 e1 ldi r24, 0x15 ; 21 1d996: 94 e1 ldi r25, 0x14 ; 20 1d998: 0f 94 b5 6e call 0x2dd6a ; 0x2dd6a card.getWorkDirName(); if (card.filename[0] == '/') 1d99c: 80 91 6c 13 lds r24, 0x136C ; 0x80136c 1d9a0: 8f 32 cpi r24, 0x2F ; 47 1d9a2: 09 f0 breq .+2 ; 0x1d9a6 1d9a4: 9e c0 rjmp .+316 ; 0x1dae2 { #if SDCARDDETECT == -1 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); #else if (card.ToshibaFlashAir_isEnabled()) 1d9a6: 80 91 db 15 lds r24, 0x15DB ; 0x8015db 1d9aa: 88 23 and r24, r24 1d9ac: 41 f0 breq .+16 ; 0x1d9be MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); //show the refresh option if in flashAir mode. 1d9ae: 8d ee ldi r24, 0xED ; 237 1d9b0: 9d e3 ldi r25, 0x3D ; 61 1d9b2: 0e 94 b1 6c call 0xd962 ; 0xd962 1d9b6: 6d ec ldi r22, 0xCD ; 205 1d9b8: 7a eb ldi r23, 0xBA ; 186 #endif } else MENU_ITEM_FUNCTION_P(PSTR(LCD_STR_FOLDER ".."), lcd_sd_updir); //Show the updir button if in a subdir. 1d9ba: 0f 94 39 92 call 0x32472 ; 0x32472 for (uint16_t i = _md->fileCnt; i-- > 0;) // Every file, from top to bottom. 1d9be: c0 90 6b 03 lds r12, 0x036B ; 0x80036b 1d9c2: d0 90 6c 03 lds r13, 0x036C ; 0x80036c } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 1d9c6: 01 e0 ldi r16, 0x01 ; 1 #endif } else MENU_ITEM_FUNCTION_P(PSTR(LCD_STR_FOLDER ".."), lcd_sd_updir); //Show the updir button if in a subdir. for (uint16_t i = _md->fileCnt; i-- > 0;) // Every file, from top to bottom. 1d9c8: 91 e0 ldi r25, 0x01 ; 1 1d9ca: c9 1a sub r12, r25 1d9cc: d1 08 sbc r13, r1 1d9ce: 08 f4 brcc .+2 ; 0x1d9d2 1d9d0: e0 c1 rjmp .+960 ; 0x1dd92 { if (menu_item == menu_line) //If the file is on the screen. 1d9d2: 80 91 31 04 lds r24, 0x0431 ; 0x800431 1d9d6: 90 91 30 04 lds r25, 0x0430 ; 0x800430 1d9da: 89 13 cpse r24, r25 1d9dc: d6 c1 rjmp .+940 ; 0x1dd8a { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(i, _md->sdSort); 1d9de: 60 91 6e 03 lds r22, 0x036E ; 0x80036e 1d9e2: c6 01 movw r24, r12 1d9e4: 0f 94 bc 51 call 0x2a378 ; 0x2a378 #else card.getfilename(i); #endif if (lcd_encoder == menu_item) //If the file is selected. 1d9e8: 80 91 31 04 lds r24, 0x0431 ; 0x800431 1d9ec: 90 e0 ldi r25, 0x00 ; 0 1d9ee: 20 91 06 05 lds r18, 0x0506 ; 0x800506 1d9f2: 30 91 07 05 lds r19, 0x0507 ; 0x800507 1d9f6: 10 91 b6 13 lds r17, 0x13B6 ; 0x8013b6 1d9fa: 82 17 cp r24, r18 1d9fc: 93 07 cpc r25, r19 1d9fe: 51 f4 brne .+20 ; 0x1da14 { _md->selectedFileID = i; 1da00: d0 92 6a 03 sts 0x036A, r13 ; 0x80036a 1da04: c0 92 69 03 sts 0x0369, r12 ; 0x800369 _md->isDir = card.filenameIsDir; 1da08: 10 93 66 03 sts 0x0366, r17 ; 0x800366 _md->row = menu_row; 1da0c: 40 91 2e 04 lds r20, 0x042E ; 0x80042e 1da10: 40 93 6d 03 sts 0x036D, r20 ; 0x80036d 1da14: 40 91 5b 02 lds r20, 0x025B ; 0x80025b } if (card.filenameIsDir) 1da18: 11 23 and r17, r17 1da1a: 09 f4 brne .+2 ; 0x1da1e 1da1c: 67 c0 rjmp .+206 ; 0x1daec #define MENU_ITEM_SDFILE(str_fn, str_fnl) do { menu_item_sdfile(str_fn, str_fnl); } while (0) static void menu_item_sddir(const char* str_fn, char* str_fnl) { if (lcd_draw_update) 1da1e: 44 23 and r20, r20 1da20: e9 f0 breq .+58 ; 0x1da5c { lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1da22: 40 91 81 13 lds r20, 0x1381 ; 0x801381 1da26: ec e6 ldi r30, 0x6C ; 108 1da28: ae 2e mov r10, r30 1da2a: e3 e1 ldi r30, 0x13 ; 19 1da2c: be 2e mov r11, r30 1da2e: 44 23 and r20, r20 1da30: 21 f0 breq .+8 ; 0x1da3a 1da32: 71 e8 ldi r23, 0x81 ; 129 1da34: a7 2e mov r10, r23 1da36: 73 e1 ldi r23, 0x13 ; 19 1da38: b7 2e mov r11, r23 1da3a: 60 91 2e 04 lds r22, 0x042E ; 0x80042e } static void lcd_implementation_drawmenu_sddirectory(uint8_t row, const char* longFilename) { uint8_t len = LCD_WIDTH - 2; lcd_putc_at(0, row, (lcd_encoder == menu_item)?'>':' '); 1da3e: 4e e3 ldi r20, 0x3E ; 62 1da40: 82 17 cp r24, r18 1da42: 93 07 cpc r25, r19 1da44: 09 f0 breq .+2 ; 0x1da48 1da46: 40 e2 ldi r20, 0x20 ; 32 1da48: 80 e0 ldi r24, 0x00 ; 0 1da4a: 0e 94 9b 69 call 0xd336 ; 0xd336 lcd_putc(LCD_STR_FOLDER[0]); 1da4e: 85 e8 ldi r24, 0x85 ; 133 1da50: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 lcd_print_pad(longFilename, len); 1da54: 62 e1 ldi r22, 0x12 ; 18 1da56: c5 01 movw r24, r10 1da58: 0e 94 6a 6b call 0xd6d4 ; 0xd6d4 1da5c: 80 91 31 04 lds r24, 0x0431 ; 0x800431 { if (lcd_draw_update) { lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); } if (menu_clicked && (lcd_encoder == menu_item)) 1da60: 90 91 2f 04 lds r25, 0x042F ; 0x80042f 1da64: 99 23 and r25, r25 1da66: 09 f4 brne .+2 ; 0x1da6a 1da68: 90 c1 rjmp .+800 ; 0x1dd8a 1da6a: 20 91 06 05 lds r18, 0x0506 ; 0x800506 1da6e: 30 91 07 05 lds r19, 0x0507 ; 0x800507 1da72: 82 17 cp r24, r18 1da74: 13 06 cpc r1, r19 1da76: 09 f0 breq .+2 ; 0x1da7a 1da78: 88 c1 rjmp .+784 ; 0x1dd8a { lcd_update_enabled = false; 1da7a: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c lcd_return_to_status(); } void menu_action_sddirectory(const char* filename) { card.chdir(filename, true); 1da7e: 61 e0 ldi r22, 0x01 ; 1 1da80: 8c e6 ldi r24, 0x6C ; 108 1da82: 93 e1 ldi r25, 0x13 ; 19 1da84: 0f 94 cf 4a call 0x2959e ; 0x2959e lcd_encoder = 0; 1da88: 10 92 07 05 sts 0x0507, r1 ; 0x800507 1da8c: 10 92 06 05 sts 0x0506, r1 ; 0x800506 menu_data_reset(); //Forces reloading of cached variables. 1da90: 0f 94 de 92 call 0x325bc ; 0x325bc } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 1da94: 00 93 5c 02 sts 0x025C, r16 ; 0x80025c menu_item_ret(); 1da98: 0f 94 a2 91 call 0x32344 ; 0x32344 1da9c: 95 cf rjmp .-214 ; 0x1d9c8 lcd_update_enabled = false; card.presort(); lcd_update_enabled = true; } _md->fileCnt = card.getnrfilenames(); _md->sdSort = farm_mode ? SD_SORT_NONE : eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 1da9e: 82 e0 ldi r24, 0x02 ; 2 1daa0: 1b cf rjmp .-458 ; 0x1d8d8 _md->offset = 0; _md->scrollPointer = NULL; _md->lcd_scrollTimer.start(); lcd_draw_update = 1; //forces last load before switching to scrolling. } if (lcd_draw_update == 0 && !lcd_clicked()) 1daa2: 0e 94 98 6b call 0xd730 ; 0xd730 1daa6: 81 11 cpse r24, r1 1daa8: 4f cf rjmp .-354 ; 0x1d948 _md->menuState = _standard; } } break; default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } 1daaa: 2d 96 adiw r28, 0x0d ; 13 1daac: 0f b6 in r0, 0x3f ; 63 1daae: f8 94 cli 1dab0: de bf out 0x3e, r29 ; 62 1dab2: 0f be out 0x3f, r0 ; 63 1dab4: cd bf out 0x3d, r28 ; 61 1dab6: df 91 pop r29 1dab8: cf 91 pop r28 1daba: 1f 91 pop r17 1dabc: 0f 91 pop r16 1dabe: ff 90 pop r15 1dac0: ef 90 pop r14 1dac2: df 90 pop r13 1dac4: cf 90 pop r12 1dac6: bf 90 pop r11 1dac8: af 90 pop r10 1daca: 9f 90 pop r9 1dacc: 8f 90 pop r8 1dace: 7f 90 pop r7 1dad0: 6f 90 pop r6 1dad2: 5f 90 pop r5 1dad4: 4f 90 pop r4 1dad6: 3f 90 pop r3 1dad8: 2f 90 pop r2 1dada: 08 95 ret //if we reached this point it means that the encoder moved or clicked or the state is being switched. Reset the scrollTimer. _md->lcd_scrollTimer.start(); MENU_BEGIN(); MENU_ITEM_BACK_P(_T(bMain?MSG_MAIN:MSG_BACK)); // i.e. default menu-item / menu-item after card insertion 1dadc: 84 e1 ldi r24, 0x14 ; 20 1dade: 90 e4 ldi r25, 0x40 ; 64 1dae0: 53 cf rjmp .-346 ; 0x1d988 if (card.ToshibaFlashAir_isEnabled()) MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); //show the refresh option if in flashAir mode. #endif } else MENU_ITEM_FUNCTION_P(PSTR(LCD_STR_FOLDER ".."), lcd_sd_updir); //Show the updir button if in a subdir. 1dae2: 67 ed ldi r22, 0xD7 ; 215 1dae4: 7a eb ldi r23, 0xBA ; 186 1dae6: 8f ed ldi r24, 0xDF ; 223 1dae8: 92 e8 ldi r25, 0x82 ; 130 1daea: 67 cf rjmp .-306 ; 0x1d9ba menu_item++; } static void menu_item_sdfile(const char* str_fn, char* str_fnl) { if (lcd_draw_update) 1daec: 44 23 and r20, r20 1daee: d1 f0 breq .+52 ; 0x1db24 { lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1daf0: 40 91 81 13 lds r20, 0x1381 ; 0x801381 1daf4: 6c e6 ldi r22, 0x6C ; 108 1daf6: a6 2e mov r10, r22 1daf8: 63 e1 ldi r22, 0x13 ; 19 1dafa: b6 2e mov r11, r22 1dafc: 44 23 and r20, r20 1dafe: 21 f0 breq .+8 ; 0x1db08 1db00: 51 e8 ldi r21, 0x81 ; 129 1db02: a5 2e mov r10, r21 1db04: 53 e1 ldi r21, 0x13 ; 19 1db06: b5 2e mov r11, r21 1db08: 60 91 2e 04 lds r22, 0x042E ; 0x80042e bool bSettings; // flag (i.e. 'fake parameter') for 'lcd_hw_setup_menu()' function static void lcd_implementation_drawmenu_sdfile(uint8_t row, const char* longFilename) { uint8_t len = LCD_WIDTH - 1; lcd_putc_at(0, row, (lcd_encoder == menu_item)?'>':' '); 1db0c: 4e e3 ldi r20, 0x3E ; 62 1db0e: 82 17 cp r24, r18 1db10: 93 07 cpc r25, r19 1db12: 09 f0 breq .+2 ; 0x1db16 1db14: 40 e2 ldi r20, 0x20 ; 32 1db16: 80 e0 ldi r24, 0x00 ; 0 1db18: 0e 94 9b 69 call 0xd336 ; 0xd336 lcd_print_pad(longFilename, len); 1db1c: 63 e1 ldi r22, 0x13 ; 19 1db1e: c5 01 movw r24, r10 1db20: 0e 94 6a 6b call 0xd6d4 ; 0xd6d4 1db24: 80 91 31 04 lds r24, 0x0431 ; 0x800431 { if (lcd_draw_update) { lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); } if (menu_clicked && (lcd_encoder == menu_item)) 1db28: 90 91 2f 04 lds r25, 0x042F ; 0x80042f 1db2c: 99 23 and r25, r25 1db2e: 09 f4 brne .+2 ; 0x1db32 1db30: 2c c1 rjmp .+600 ; 0x1dd8a 1db32: 20 91 06 05 lds r18, 0x0506 ; 0x800506 1db36: 30 91 07 05 lds r19, 0x0507 ; 0x800507 1db3a: 82 17 cp r24, r18 1db3c: 13 06 cpc r1, r19 1db3e: 09 f0 breq .+2 ; 0x1db42 1db40: 24 c1 rjmp .+584 ; 0x1dd8a { lcd_update_enabled = false; 1db42: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c return result; } static void menu_action_sdfile(const char* filename) { if(eFilamentAction != FilamentAction::None) return; 1db46: 80 91 62 03 lds r24, 0x0362 ; 0x800362 1db4a: 81 11 cpse r24, r1 1db4c: a3 cf rjmp .-186 ; 0x1da94 // Create a copy of card.filename on the stack since card.filename pointer // will be modified by the SD card library when searching for the file char selected_filename[FILENAME_LENGTH]; strcpy(selected_filename, filename); 1db4e: 6c e6 ldi r22, 0x6C ; 108 1db50: 73 e1 ldi r23, 0x13 ; 19 1db52: c7 01 movw r24, r14 1db54: 0f 94 47 a6 call 0x34c8e ; 0x34c8e 1db58: 47 01 movw r8, r14 1db5a: 45 e9 ldi r20, 0x95 ; 149 1db5c: a4 2e mov r10, r20 1db5e: 4f e0 ldi r20, 0x0F ; 15 1db60: b4 2e mov r11, r20 bool result = true; //we are storing just first 8 characters of 8.3 filename assuming that extension is always ".gco" for (uint_least8_t i = 0; i < 8; i++) { if (selected_filename[i] == '\0' || selected_filename[i] == '.') { 1db62: f4 01 movw r30, r8 1db64: 61 91 ld r22, Z+ 1db66: 4f 01 movw r8, r30 1db68: 66 23 and r22, r22 1db6a: 19 f0 breq .+6 ; 0x1db72 1db6c: 6e 32 cpi r22, 0x2E ; 46 1db6e: 09 f0 breq .+2 ; 0x1db72 1db70: 4b c0 rjmp .+150 ; 0x1dc08 1db72: 60 e0 ldi r22, 0x00 ; 0 1db74: c5 01 movw r24, r10 1db76: 0f 94 00 a0 call 0x34000 ; 0x34000 eeprom_update_byte_notify((uint8_t*)EEPROM_FILENAME + i, selected_filename[i]); } } // Write the DOS 8.3 file extension into EEPROM char * extension_ptr = strchr(selected_filename, '.'); 1db7a: 6e e2 ldi r22, 0x2E ; 46 1db7c: 70 e0 ldi r23, 0x00 ; 0 1db7e: c7 01 movw r24, r14 1db80: 0f 94 33 a6 call 0x34c66 ; 0x34c66 1db84: 3c 01 movw r6, r24 if (extension_ptr) { 1db86: 89 2b or r24, r25 1db88: 19 f0 breq .+6 ; 0x1db90 extension_ptr++; // skip the '.' 1db8a: 8f ef ldi r24, 0xFF ; 255 1db8c: 68 1a sub r6, r24 1db8e: 78 0a sbc r7, r24 1db90: 43 01 movw r8, r6 if(eFilamentAction != FilamentAction::None) return; // Create a copy of card.filename on the stack since card.filename pointer // will be modified by the SD card library when searching for the file char selected_filename[FILENAME_LENGTH]; strcpy(selected_filename, filename); 1db92: 31 e9 ldi r19, 0x91 ; 145 1db94: a3 2e mov r10, r19 1db96: 3c e0 ldi r19, 0x0C ; 12 1db98: b3 2e mov r11, r19 extension_ptr++; // skip the '.' } for (uint_least8_t i = 0; i < 3; i++) { if (extension_ptr == NULL || extension_ptr[i] == '\0') { 1db9a: 61 14 cp r6, r1 1db9c: 71 04 cpc r7, r1 1db9e: 21 f0 breq .+8 ; 0x1dba8 1dba0: f4 01 movw r30, r8 1dba2: 60 81 ld r22, Z 1dba4: 61 11 cpse r22, r1 1dba6: 01 c0 rjmp .+2 ; 0x1dbaa 1dba8: 60 e0 ldi r22, 0x00 ; 0 1dbaa: c5 01 movw r24, r10 1dbac: 0f 94 00 a0 call 0x34000 ; 0x34000 1dbb0: ff ef ldi r31, 0xFF ; 255 1dbb2: af 1a sub r10, r31 1dbb4: bf 0a sbc r11, r31 1dbb6: 2f ef ldi r18, 0xFF ; 255 1dbb8: 82 1a sub r8, r18 1dbba: 92 0a sbc r9, r18 if (extension_ptr) { extension_ptr++; // skip the '.' } for (uint_least8_t i = 0; i < 3; i++) 1dbbc: 84 e9 ldi r24, 0x94 ; 148 1dbbe: a8 16 cp r10, r24 1dbc0: 8c e0 ldi r24, 0x0C ; 12 1dbc2: b8 06 cpc r11, r24 1dbc4: 51 f7 brne .-44 ; 0x1db9a { workDirParents[level].getFilename(name); } uint8_t CardReader::getWorkDirDepth() { return workDirDepth; 1dbc6: 60 90 0a 15 lds r6, 0x150A ; 0x80150a 1dbca: 66 2d mov r22, r6 1dbcc: 8a e5 ldi r24, 0x5A ; 90 1dbce: 9f e0 ldi r25, 0x0F ; 15 1dbd0: 0f 94 00 a0 call 0x34000 ; 0x34000 1dbd4: 88 e6 ldi r24, 0x68 ; 104 1dbd6: 93 e1 ldi r25, 0x13 ; 19 1dbd8: 2a e0 ldi r18, 0x0A ; 10 1dbda: a2 2e mov r10, r18 1dbdc: 2f e0 ldi r18, 0x0F ; 15 1dbde: b2 2e mov r11, r18 } const uint8_t depth = card.getWorkDirDepth(); eeprom_update_byte_notify((uint8_t*)EEPROM_DIR_DEPTH, depth); for (uint_least8_t i = 0; i < depth; i++) { 1dbe0: 71 2c mov r7, r1 1dbe2: 4c 01 movw r8, r24 1dbe4: e9 e0 ldi r30, 0x09 ; 9 1dbe6: 8e 0e add r8, r30 1dbe8: 91 1c adc r9, r1 1dbea: 76 14 cp r7, r6 1dbec: d1 f0 breq .+52 ; 0x1dc22 #endif //DEBUG_EEPROM_CHANGES } #ifndef DEBUG_EEPROM_CHANGES void eeprom_update_block_notify(const void *__src, void *__dst, size_t __n){ eeprom_update_block(__src, __dst, __n); 1dbee: 48 e0 ldi r20, 0x08 ; 8 1dbf0: 50 e0 ldi r21, 0x00 ; 0 1dbf2: b5 01 movw r22, r10 1dbf4: 8e 5a subi r24, 0xAE ; 174 1dbf6: 9f 4f sbci r25, 0xFF ; 255 1dbf8: 0f 94 f0 9f call 0x33fe0 ; 0x33fe0 1dbfc: 73 94 inc r7 1dbfe: f8 e0 ldi r31, 0x08 ; 8 1dc00: af 0e add r10, r31 1dc02: b1 1c adc r11, r1 1dc04: c4 01 movw r24, r8 1dc06: ed cf rjmp .-38 ; 0x1dbe2 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1dc08: c5 01 movw r24, r10 1dc0a: 0f 94 00 a0 call 0x34000 ; 0x34000 1dc0e: ff ef ldi r31, 0xFF ; 255 1dc10: af 1a sub r10, r31 1dc12: bf 0a sbc r11, r31 strcpy(selected_filename, filename); bool result = true; //we are storing just first 8 characters of 8.3 filename assuming that extension is always ".gco" for (uint_least8_t i = 0; i < 8; i++) { 1dc14: 2d e9 ldi r18, 0x9D ; 157 1dc16: a2 16 cp r10, r18 1dc18: 2f e0 ldi r18, 0x0F ; 15 1dc1a: b2 06 cpc r11, r18 1dc1c: 09 f0 breq .+2 ; 0x1dc20 1dc1e: a1 cf rjmp .-190 ; 0x1db62 1dc20: ac cf rjmp .-168 ; 0x1db7a /** End of menus **/ /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; 1dc22: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1dc26: 88 23 and r24, r24 1dc28: 91 f0 breq .+36 ; 0x1dc4e if (!check_file(selected_filename)) { result = !lcd_show_multiscreen_message_cont_cancel_and_wait_P(_T(MSG_FILE_INCOMPLETE), false); lcd_update_enable(true); } if (result) { enquecommandf_P(MSG_M23, selected_filename); 1dc2a: ff 92 push r15 1dc2c: ef 92 push r14 1dc2e: 3f 92 push r3 1dc30: 2f 92 push r2 1dc32: 0e 94 4d 7d call 0xfa9a ; 0xfa9a enquecommand_P(MSG_M24); 1dc36: 61 e0 ldi r22, 0x01 ; 1 1dc38: 85 ee ldi r24, 0xE5 ; 229 1dc3a: 9b e6 ldi r25, 0x6B ; 107 1dc3c: 0e 94 af 7c call 0xf95e ; 0xf95e 1dc40: 0f 90 pop r0 1dc42: 0f 90 pop r0 1dc44: 0f 90 pop r0 1dc46: 0f 90 pop r0 } lcd_return_to_status(); 1dc48: 0e 94 17 fe call 0x1fc2e ; 0x1fc2e 1dc4c: 23 cf rjmp .-442 ; 0x1da94 /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; card.openFileReadFilteredGcode(filename, true); 1dc4e: 61 e0 ldi r22, 0x01 ; 1 1dc50: c7 01 movw r24, r14 1dc52: 0f 94 06 4c call 0x2980c ; 0x2980c } uint32_t CardReader::getFileSize() { return filesize; 1dc56: 40 90 77 16 lds r4, 0x1677 ; 0x801677 1dc5a: 50 90 78 16 lds r5, 0x1678 ; 0x801678 1dc5e: 60 90 79 16 lds r6, 0x1679 ; 0x801679 1dc62: 70 90 7a 16 lds r7, 0x167A ; 0x80167a bool result = false; const uint32_t filesize = card.getFileSize(); uint32_t startPos = 0; const uint16_t bytesToCheck = min(END_FILE_SECTION, filesize); 1dc66: 94 2d mov r25, r4 1dc68: 85 2d mov r24, r5 1dc6a: 21 e0 ldi r18, 0x01 ; 1 1dc6c: 42 16 cp r4, r18 1dc6e: 28 e7 ldi r18, 0x78 ; 120 1dc70: 52 06 cpc r5, r18 1dc72: 61 04 cpc r6, r1 1dc74: 71 04 cpc r7, r1 1dc76: 10 f0 brcs .+4 ; 0x1dc7c 1dc78: 90 e0 ldi r25, 0x00 ; 0 1dc7a: 88 e7 ldi r24, 0x78 ; 120 1dc7c: a9 2e mov r10, r25 1dc7e: b8 2e mov r11, r24 if (filesize > END_FILE_SECTION) { 1dc80: 81 e0 ldi r24, 0x01 ; 1 1dc82: 48 16 cp r4, r24 1dc84: 88 e7 ldi r24, 0x78 ; 120 1dc86: 58 06 cpc r5, r24 1dc88: 61 04 cpc r6, r1 1dc8a: 71 04 cpc r7, r1 1dc8c: 08 f4 brcc .+2 ; 0x1dc90 1dc8e: 5d c0 rjmp .+186 ; 0x1dd4a startPos = filesize - END_FILE_SECTION; 1dc90: 98 e7 ldi r25, 0x78 ; 120 1dc92: 59 1a sub r5, r25 1dc94: 61 08 sbc r6, r1 1dc96: 71 08 sbc r7, r1 { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; 1dc98: 40 92 7e 16 sts 0x167E, r4 ; 0x80167e 1dc9c: 50 92 7f 16 sts 0x167F, r5 ; 0x80167f 1dca0: 60 92 80 16 sts 0x1680, r6 ; 0x801680 1dca4: 70 92 81 16 sts 0x1681, r7 ; 0x801681 1dca8: c3 01 movw r24, r6 1dcaa: b2 01 movw r22, r4 1dcac: 0f 94 f6 43 call 0x287ec ; 0x287ec card.setIndex(startPos); } cmdqueue_reset(); 1dcb0: 0e 94 20 73 call 0xe640 ; 0xe640 cmdqueue_serial_disabled = true; 1dcb4: 00 93 61 03 sts 0x0361, r16 ; 0x800361 menu_progressbar_init(bytesToCheck, _T(MSG_CHECKING_FILE)); 1dcb8: 8a ec ldi r24, 0xCA ; 202 1dcba: 9d e3 ldi r25, 0x3D ; 61 1dcbc: 0e 94 b1 6c call 0xd962 ; 0xd962 1dcc0: bc 01 movw r22, r24 1dcc2: c5 01 movw r24, r10 1dcc4: 0f 94 1e 91 call 0x3223c ; 0x3223c void getfilename_sorted(const uint16_t nr, uint8_t sdSort); void getfilename_afterMaxSorting(uint16_t entry, const char * const match = NULL); #endif FORCE_INLINE bool isFileOpen() { return file.isOpen(); } bool eof() { return sdpos>=filesize; } 1dcc8: 80 91 7e 16 lds r24, 0x167E ; 0x80167e 1dccc: 90 91 7f 16 lds r25, 0x167F ; 0x80167f 1dcd0: a0 91 80 16 lds r26, 0x1680 ; 0x801680 1dcd4: b0 91 81 16 lds r27, 0x1681 ; 0x801681 while (!card.eof() && !result) { 1dcd8: 40 91 77 16 lds r20, 0x1677 ; 0x801677 1dcdc: 50 91 78 16 lds r21, 0x1678 ; 0x801678 1dce0: 60 91 79 16 lds r22, 0x1679 ; 0x801679 1dce4: 70 91 7a 16 lds r23, 0x167A ; 0x80167a 1dce8: 84 17 cp r24, r20 1dcea: 95 07 cpc r25, r21 1dcec: a6 07 cpc r26, r22 1dcee: b7 07 cpc r27, r23 1dcf0: 80 f5 brcc .+96 ; 0x1dd52 1dcf2: 11 11 cpse r17, r1 1dcf4: 2e c0 rjmp .+92 ; 0x1dd52 return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; FORCE_INLINE uint8_t percentDone(){if(!isFileOpen()) return 0; if(filesize) return sdpos/((filesize+99)/100); else return 0;}; FORCE_INLINE char* getWorkDirName(){workDir.getFilename(filename);return filename;}; FORCE_INLINE uint32_t get_sdpos() { if (!isFileOpen()) return 0; else return(sdpos); }; 1dcf6: 20 91 fd 15 lds r18, 0x15FD ; 0x8015fd 1dcfa: 21 11 cpse r18, r1 1dcfc: 03 c0 rjmp .+6 ; 0x1dd04 1dcfe: 80 e0 ldi r24, 0x00 ; 0 1dd00: 90 e0 ldi r25, 0x00 ; 0 1dd02: dc 01 movw r26, r24 menu_progressbar_update(card.get_sdpos() - startPos); 1dd04: 84 19 sub r24, r4 1dd06: 95 09 sbc r25, r5 1dd08: 0f 94 ef 90 call 0x321de ; 0x321de card.sdprinting = true; 1dd0c: 00 93 6a 13 sts 0x136A, r16 ; 0x80136a get_command(); 1dd10: 0e 94 72 75 call 0xeae4 ; 0xeae4 #endif // LIN_ADVANCE bool check_commands() { bool end_command_found = false; while (buflen) 1dd14: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 1dd18: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 1dd1c: 89 2b or r24, r25 1dd1e: a1 f2 breq .-88 ; 0x1dcc8 { if ((code_seen_P(MSG_M84)) || (code_seen_P(PSTR("M 84")))) end_command_found = true; 1dd20: 8f ec ldi r24, 0xCF ; 207 1dd22: 97 e6 ldi r25, 0x67 ; 103 1dd24: 0f 94 51 74 call 0x2e8a2 ; 0x2e8a2 1dd28: 81 11 cpse r24, r1 1dd2a: 05 c0 rjmp .+10 ; 0x1dd36 1dd2c: 8a ed ldi r24, 0xDA ; 218 1dd2e: 92 e8 ldi r25, 0x82 ; 130 1dd30: 0f 94 51 74 call 0x2e8a2 ; 0x2e8a2 1dd34: 81 11 cpse r24, r1 1dd36: 11 e0 ldi r17, 0x01 ; 1 if (!cmdbuffer_front_already_processed) 1dd38: 80 91 e6 11 lds r24, 0x11E6 ; 0x8011e6 1dd3c: 81 11 cpse r24, r1 1dd3e: 02 c0 rjmp .+4 ; 0x1dd44 cmdqueue_pop_front(); 1dd40: 0e 94 d3 6f call 0xdfa6 ; 0xdfa6 cmdbuffer_front_already_processed = false; 1dd44: 10 92 e6 11 sts 0x11E6, r1 ; 0x8011e6 1dd48: e5 cf rjmp .-54 ; 0x1dd14 static bool check_file(const char* filename) { if (farm_mode) return true; card.openFileReadFilteredGcode(filename, true); bool result = false; const uint32_t filesize = card.getFileSize(); uint32_t startPos = 0; 1dd4a: 41 2c mov r4, r1 1dd4c: 51 2c mov r5, r1 1dd4e: 32 01 movw r6, r4 1dd50: af cf rjmp .-162 ; 0x1dcb0 // with the CMDBUFFER_DEBUG enabled manage_heater(); #endif // CMDBUFFER_DEBUG } menu_progressbar_finish(); 1dd52: 0f 94 10 91 call 0x32220 ; 0x32220 cmdqueue_serial_disabled = false; 1dd56: 10 92 61 03 sts 0x0361, r1 ; 0x800361 card.printingHasFinished(); 1dd5a: 0f 94 3e 4d call 0x29a7c ; 0x29a7c lcd_setstatuspgm(MSG_WELCOME); 1dd5e: 87 e6 ldi r24, 0x67 ; 103 1dd60: 9b e6 ldi r25, 0x6B ; 107 1dd62: 0e 94 65 e6 call 0x1ccca ; 0x1ccca for (uint_least8_t i = 0; i < depth; i++) { eeprom_update_block_notify(card.dir_names[i], (uint8_t*)EEPROM_DIRS + 8 * i, 8); } if (!check_file(selected_filename)) { 1dd66: 11 11 cpse r17, r1 1dd68: 60 cf rjmp .-320 ; 0x1dc2a result = !lcd_show_multiscreen_message_cont_cancel_and_wait_P(_T(MSG_FILE_INCOMPLETE), false); 1dd6a: 8a ed ldi r24, 0xDA ; 218 1dd6c: 9d e3 ldi r25, 0x3D ; 61 1dd6e: 0e 94 b1 6c call 0xd962 ; 0xd962 1dd72: 41 e0 ldi r20, 0x01 ; 1 1dd74: 60 e0 ldi r22, 0x00 ; 0 1dd76: 0f 94 b7 2d call 0x25b6e ; 0x25b6e 1dd7a: 18 2f mov r17, r24 lcd_update_enable(true); 1dd7c: 81 e0 ldi r24, 0x01 ; 1 1dd7e: 0e 94 c0 69 call 0xd380 ; 0xd380 } if (result) { 1dd82: 11 23 and r17, r17 1dd84: 09 f4 brne .+2 ; 0x1dd88 1dd86: 51 cf rjmp .-350 ; 0x1dc2a 1dd88: 5f cf rjmp .-322 ; 0x1dc48 lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); } void menu_item_dummy(void) { menu_item++; 1dd8a: 8f 5f subi r24, 0xFF ; 255 1dd8c: 80 93 31 04 sts 0x0431, r24 ; 0x800431 1dd90: 1b ce rjmp .-970 ; 0x1d9c8 else MENU_ITEM_SDFILE(card.filename, card.longFilename); } else MENU_ITEM_DUMMY(); //dummy item that just increments the internal menu counters. } MENU_END(); 1dd92: 0f 94 90 92 call 0x32520 ; 0x32520 _md->row = -1; // assume that no SD file/dir is currently selected. Once they are rendered, it will be changed to the correct row for the _scrolling state. //if we reached this point it means that the encoder moved or clicked or the state is being switched. Reset the scrollTimer. _md->lcd_scrollTimer.start(); MENU_BEGIN(); 1dd96: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1dd9a: 8f 5f subi r24, 0xFF ; 255 1dd9c: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1dda0: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1dda4: 8f 5f subi r24, 0xFF ; 255 1dda6: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1ddaa: e0 cd rjmp .-1088 ; 0x1d96c MENU_END(); } break; case _scrolling: //scrolling filename { // LCD_CLICKED is used so that the click event is later consumed by the _standard state. const bool rewindFlag = LCD_CLICKED || lcd_draw_update; //flag that says whether the menu should return to _standard state. 1ddac: 80 91 63 03 lds r24, 0x0363 ; 0x800363 1ddb0: 11 e0 ldi r17, 0x01 ; 1 1ddb2: 81 11 cpse r24, r1 1ddb4: 05 c0 rjmp .+10 ; 0x1ddc0 1ddb6: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1ddba: 81 11 cpse r24, r1 1ddbc: 01 c0 rjmp .+2 ; 0x1ddc0 1ddbe: 10 e0 ldi r17, 0x00 ; 0 if (_md->scrollPointer == NULL) 1ddc0: 80 91 67 03 lds r24, 0x0367 ; 0x800367 1ddc4: 90 91 68 03 lds r25, 0x0368 ; 0x800368 1ddc8: 89 2b or r24, r25 1ddca: 91 f4 brne .+36 ; 0x1ddf0 { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(_md->selectedFileID, _md->sdSort); 1ddcc: 60 91 6e 03 lds r22, 0x036E ; 0x80036e 1ddd0: 80 91 69 03 lds r24, 0x0369 ; 0x800369 1ddd4: 90 91 6a 03 lds r25, 0x036A ; 0x80036a 1ddd8: 0f 94 bc 51 call 0x2a378 ; 0x2a378 #else card.getfilename(_md->selectedFileID); #endif _md->scrollPointer = (card.longFilename[0] == '\0') ? card.filename : card.longFilename; 1dddc: 80 91 81 13 lds r24, 0x1381 ; 0x801381 1dde0: 81 11 cpse r24, r1 1dde2: 46 c0 rjmp .+140 ; 0x1de70 1dde4: 8c e6 ldi r24, 0x6C ; 108 1dde6: 93 e1 ldi r25, 0x13 ; 19 1dde8: 90 93 68 03 sts 0x0368, r25 ; 0x800368 1ddec: 80 93 67 03 sts 0x0367, r24 ; 0x800367 } if (rewindFlag) 1ddf0: 11 11 cpse r17, r1 _md->offset = 0; //redraw once again from the beginning. 1ddf2: 10 92 65 03 sts 0x0365, r1 ; 0x800365 if (_md->lcd_scrollTimer.expired(300) || rewindFlag) 1ddf6: 6c e2 ldi r22, 0x2C ; 44 1ddf8: 71 e0 ldi r23, 0x01 ; 1 1ddfa: 8f e6 ldi r24, 0x6F ; 111 1ddfc: 93 e0 ldi r25, 0x03 ; 3 1ddfe: 0f 94 a7 0f call 0x21f4e ; 0x21f4e ::expired(unsigned short)> 1de02: 81 11 cpse r24, r1 1de04: 03 c0 rjmp .+6 ; 0x1de0c 1de06: 11 23 and r17, r17 1de08: 09 f4 brne .+2 ; 0x1de0c 1de0a: 4f ce rjmp .-866 ; 0x1daaa { uint8_t len = LCD_WIDTH - ((_md->isDir)? 2 : 1); 1de0c: 80 91 66 03 lds r24, 0x0366 ; 0x800366 1de10: 02 e1 ldi r16, 0x12 ; 18 1de12: 81 11 cpse r24, r1 1de14: 01 c0 rjmp .+2 ; 0x1de18 1de16: 03 e1 ldi r16, 0x13 ; 19 lcd_putc_at(0, _md->row, '>'); 1de18: 4e e3 ldi r20, 0x3E ; 62 1de1a: 60 91 6d 03 lds r22, 0x036D ; 0x80036d 1de1e: 80 e0 ldi r24, 0x00 ; 0 1de20: 0e 94 9b 69 call 0xd336 ; 0xd336 if (_md->isDir) 1de24: 80 91 66 03 lds r24, 0x0366 ; 0x800366 1de28: 88 23 and r24, r24 1de2a: 19 f0 breq .+6 ; 0x1de32 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 1de2c: 85 e8 ldi r24, 0x85 ; 133 1de2e: 0e 94 2a 6a call 0xd454 ; 0xd454 lcd_print(LCD_STR_FOLDER[0]); if( lcd_print_pad(&_md->scrollPointer[_md->offset], len) == 0) 1de32: 20 91 65 03 lds r18, 0x0365 ; 0x800365 1de36: 80 91 67 03 lds r24, 0x0367 ; 0x800367 1de3a: 90 91 68 03 lds r25, 0x0368 ; 0x800368 1de3e: 60 2f mov r22, r16 1de40: 82 0f add r24, r18 1de42: 91 1d adc r25, r1 1de44: 0e 94 6a 6b call 0xd6d4 ; 0xd6d4 1de48: 81 11 cpse r24, r1 1de4a: 15 c0 rjmp .+42 ; 0x1de76 { _md->lcd_scrollTimer.start(); 1de4c: 8f e6 ldi r24, 0x6F ; 111 1de4e: 93 e0 ldi r25, 0x03 ; 3 1de50: 0f 94 d6 0f call 0x21fac ; 0x21fac ::start()> _md->offset++; 1de54: 80 91 65 03 lds r24, 0x0365 ; 0x800365 1de58: 8f 5f subi r24, 0xFF ; 255 1de5a: 80 93 65 03 sts 0x0365, r24 ; 0x800365 } else { // stop at the end of the string _md->lcd_scrollTimer.stop(); } } if (rewindFlag) //go back to sd_menu. 1de5e: 11 23 and r17, r17 1de60: 09 f4 brne .+2 ; 0x1de64 1de62: 23 ce rjmp .-954 ; 0x1daaa 1de64: 10 92 6f 03 sts 0x036F, r1 ; 0x80036f { _md->lcd_scrollTimer.stop(); //forces redraw in _standard state _md->menuState = _standard; 1de68: 81 e0 ldi r24, 0x01 ; 1 1de6a: 80 93 64 03 sts 0x0364, r24 ; 0x800364 1de6e: 1d ce rjmp .-966 ; 0x1daaa #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(_md->selectedFileID, _md->sdSort); #else card.getfilename(_md->selectedFileID); #endif _md->scrollPointer = (card.longFilename[0] == '\0') ? card.filename : card.longFilename; 1de70: 81 e8 ldi r24, 0x81 ; 129 1de72: 93 e1 ldi r25, 0x13 ; 19 1de74: b9 cf rjmp .-142 ; 0x1dde8 1de76: 10 92 6f 03 sts 0x036F, r1 ; 0x80036f 1de7a: f1 cf rjmp .-30 ; 0x1de5e 0001de7c : } #endif /* DEBUG_STEPPER_TIMER_MISSED */ static void lcd_colorprint_change() { enquecommand_P(MSG_M600); 1de7c: 61 e0 ldi r22, 0x01 ; 1 1de7e: 8b e7 ldi r24, 0x7B ; 123 1de80: 9b e6 ldi r25, 0x6B ; 107 1de82: 0e 94 af 7c call 0xf95e ; 0xf95e custom_message_type = CustomMsg::FilamentLoading; //just print status message 1de86: 82 e0 ldi r24, 0x02 ; 2 1de88: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1de8c: 8b eb ldi r24, 0xBB ; 187 1de8e: 96 e5 ldi r25, 0x56 ; 86 1de90: 0e 94 b1 6c call 0xd962 ; 0xd962 1de94: 0e 94 65 e6 call 0x1ccca ; 0x1ccca lcd_return_to_status(); 1de98: 0e 94 17 fe call 0x1fc2e ; 0x1fc2e lcd_draw_update = 3; 1de9c: 83 e0 ldi r24, 0x03 ; 3 1de9e: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } 1dea2: 08 95 ret 0001dea4 : //! @todo It is not good to call restore_print_from_ram_and_continue() from function called by lcd_update(), //! as restore_print_from_ram_and_continue() calls lcd_update() internally. void lcd_resume_print() { // reset lcd and ensure we can resume first if (!resume_print_checks()) return; 1dea4: 0e 94 19 e6 call 0x1cc32 ; 0x1cc32 1dea8: 88 23 and r24, r24 1deaa: 51 f1 breq .+84 ; 0x1df00 cmdqueue_serial_disabled = false; 1deac: 10 92 61 03 sts 0x0361, r1 ; 0x800361 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1deb0: 8b eb ldi r24, 0xBB ; 187 1deb2: 96 e5 ldi r25, 0x56 ; 86 1deb4: 0e 94 b1 6c call 0xd962 ; 0xd962 1deb8: 0e 94 65 e6 call 0x1ccca ; 0x1ccca st_synchronize(); 1debc: 0f 94 42 22 call 0x24484 ; 0x24484 custom_message_type = CustomMsg::Resuming; 1dec0: 88 e0 ldi r24, 0x08 ; 8 1dec2: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 { #if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) #ifdef EXTRUDER_ALTFAN_DETECT altfanStatus.altfanOverride = eeprom_read_byte((uint8_t*)EEPROM_ALTFAN_OVERRIDE); #endif resetFanCheck(); 1dec6: 0e 94 32 6e call 0xdc64 ; 0xdc64 setExtruderAutoFanState(1); 1deca: 81 e0 ldi r24, 0x01 ; 1 1decc: 0e 94 3f 6e call 0xdc7e ; 0xdc7e // resume processing USB commands again and restore hotend fan state (in case the print was // stopped due to a thermal error) hotendDefaultAutoFanState(); Stopped = false; 1ded0: 10 92 ce 11 sts 0x11CE, r1 ; 0x8011ce restore_print_from_ram_and_continue(default_retraction); 1ded4: 60 e0 ldi r22, 0x00 ; 0 1ded6: 70 e0 ldi r23, 0x00 ; 0 1ded8: 80 e8 ldi r24, 0x80 ; 128 1deda: 9f e3 ldi r25, 0x3F ; 63 1dedc: 0e 94 40 61 call 0xc280 ; 0xc280 did_pause_print = false; 1dee0: 10 92 9b 03 sts 0x039B, r1 ; 0x80039b // Resume the print job timer if it was running if (print_job_timer.isPaused()) print_job_timer.start(); 1dee4: 80 91 59 03 lds r24, 0x0359 ; 0x800359 1dee8: 82 30 cpi r24, 0x02 ; 2 1deea: 11 f4 brne .+4 ; 0x1def0 1deec: 0f 94 56 20 call 0x240ac ; 0x240ac refresh_cmd_timeout(); 1def0: 0e 94 c9 5f call 0xbf92 ; 0xbf92 SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_RESUMED); 1def4: 8c e7 ldi r24, 0x7C ; 124 1def6: 97 e6 ldi r25, 0x67 ; 103 1def8: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 custom_message_type = CustomMsg::Status; 1defc: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 } 1df00: 08 95 ret 0001df02 : // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; } void lcd_setstatus(const char* message) { 1df02: cf 93 push r28 1df04: df 93 push r29 1df06: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1df08: 80 e0 ldi r24, 0x00 ; 0 1df0a: 0e 94 eb e1 call 0x1c3d6 ; 0x1c3d6 1df0e: 88 23 and r24, r24 1df10: 31 f0 breq .+12 ; 0x1df1e lcd_updatestatus(message); 1df12: 60 e0 ldi r22, 0x00 ; 0 1df14: ce 01 movw r24, r28 } 1df16: df 91 pop r29 1df18: cf 91 pop r28 } void lcd_setstatus(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); 1df1a: 0c 94 d0 e1 jmp 0x1c3a0 ; 0x1c3a0 } 1df1e: df 91 pop r29 1df20: cf 91 pop r28 1df22: 08 95 ret 0001df24 : axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative did_pause_print = false; // Clear pause state in case the print was aborted while paused } void print_stop(bool interactive, bool unconditional_stop) { 1df24: cf 93 push r28 1df26: df 93 push r29 1df28: c8 2f mov r28, r24 softReset(); } void UnconditionalStop() { CRITICAL_SECTION_START; 1df2a: df b7 in r29, 0x3f ; 63 // UnconditionalStop() will internally cause planner_abort_hard(), meaning we _cannot_ plan any // more move in this call! Any further move must happen inside lcd_print_stop_finish(), which is // called by the main loop one iteration later. if (unconditional_stop) { 1df2c: 66 23 and r22, r22 1df2e: 89 f1 breq .+98 ; 0x1df92 1df30: f8 94 cli // Disable all heaters and unroll the temperature wait loop stack disable_heater(); 1df32: 0f 94 5f 12 call 0x224be ; 0x224be cancel_heatup = true; 1df36: 81 e0 ldi r24, 0x01 ; 1 1df38: 80 93 c9 0d sts 0x0DC9, r24 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.377> heating_status = HeatingStatus::NO_HEATING; 1df3c: 10 92 99 03 sts 0x0399, r1 ; 0x800399 // Clear any saved printing state cancel_saved_printing(); 1df40: 0e 94 8f 5e call 0xbd1e ; 0xbd1e // Abort the planner planner_abort_hard(); 1df44: 0f 94 ea 85 call 0x30bd4 ; 0x30bd4 // Reset the queue cmdqueue_reset(); 1df48: 0e 94 20 73 call 0xe640 ; 0xe640 cmdqueue_serial_disabled = false; 1df4c: 10 92 61 03 sts 0x0361, r1 ; 0x800361 st_reset_timer(); 1df50: 0f 94 4e 22 call 0x2449c ; 0x2449c CRITICAL_SECTION_END; 1df54: df bf out 0x3f, r29 ; 63 // clear paused state immediately did_pause_print = false; 1df56: 10 92 9b 03 sts 0x039B, r1 ; 0x80039b print_job_timer.stop(); 1df5a: 0f 94 7a 20 call 0x240f4 ; 0x240f4 } else { // Allow lcd_print_stop_finish() to use the heaters when it is safe ConditionalStop(); } if (card.isFileOpen()) { 1df5e: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 1df62: 88 23 and r24, r24 1df64: 21 f0 breq .+8 ; 0x1df6e // Reset the sd status card.sdprinting = false; 1df66: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a card.closefile(); 1df6a: 0f 94 e4 41 call 0x283c8 ; 0x283c8 } SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_CANCEL); 1df6e: 8f eb ldi r24, 0xBF ; 191 1df70: 97 e6 ldi r25, 0x67 ; 103 1df72: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 #ifdef MESH_BED_LEVELING mbl.active = false; 1df76: 10 92 9c 12 sts 0x129C, r1 ; 0x80129c #endif if (interactive) { 1df7a: c1 11 cpse r28, r1 // acknowledged by the user from the LCD: resume processing USB commands again Stopped = false; 1df7c: 10 92 ce 11 sts 0x11CE, r1 ; 0x8011ce } // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::StopPrint; 1df80: 81 e0 ldi r24, 0x01 ; 1 1df82: 80 93 c8 0d sts 0x0DC8, r24 ; 0x800dc8 1df86: 10 92 cb 0d sts 0x0DCB, r1 ; 0x800dcb <_ZL13printer_state.lto_priv.367> SetPrinterState(PrinterState::NotReady); //set printer state to show LCD menu after print has been stopped lcd_return_to_status(); } 1df8a: df 91 pop r29 1df8c: cf 91 pop r28 } // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::StopPrint; SetPrinterState(PrinterState::NotReady); //set printer state to show LCD menu after print has been stopped lcd_return_to_status(); 1df8e: 0c 94 17 fe jmp 0x1fc2e ; 0x1fc2e } void ConditionalStop() { CRITICAL_SECTION_START; 1df92: f8 94 cli // // However, the firmware must take into account the edge case when the firmware // is running M109 or M190 G-codes. These G-codes execute a blocking while loop // which waits for the bed or nozzle to reach their target temperature. // To exit the loop, the firmware must set cancel_heatup to true. cancel_heatup = true; 1df94: 81 e0 ldi r24, 0x01 ; 1 1df96: 80 93 c9 0d sts 0x0DC9, r24 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.377> heating_status = HeatingStatus::NO_HEATING; 1df9a: 10 92 99 03 sts 0x0399, r1 ; 0x800399 // Clear any saved printing state cancel_saved_printing(); 1df9e: 0e 94 8f 5e call 0xbd1e ; 0xbd1e // Abort the planner planner_abort_hard(); 1dfa2: 0f 94 ea 85 call 0x30bd4 ; 0x30bd4 // Reset the queue cmdqueue_reset(); 1dfa6: 0e 94 20 73 call 0xe640 ; 0xe640 cmdqueue_serial_disabled = false; 1dfaa: 10 92 61 03 sts 0x0361, r1 ; 0x800361 st_reset_timer(); 1dfae: 0f 94 4e 22 call 0x2449c ; 0x2449c CRITICAL_SECTION_END; 1dfb2: df bf out 0x3f, r29 ; 63 1dfb4: d4 cf rjmp .-88 ; 0x1df5e 0001dfb6 : } void lcd_print_stop() { print_stop(true); 1dfb6: 60 e0 ldi r22, 0x00 ; 0 1dfb8: 81 e0 ldi r24, 0x01 ; 1 1dfba: 0c 94 92 ef jmp 0x1df24 ; 0x1df24 0001dfbe : oCheckFilament = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_FILAMENT, (uint8_t)ClCheckMode::_Warn); } static void render_M862_warnings(const char* warning, const char* strict, uint8_t check) { if (check == 1) { // Warning, stop print if user selects 'No' 1dfbe: 41 30 cpi r20, 0x01 ; 1 1dfc0: 41 f4 brne .+16 ; 0x1dfd2 if (lcd_show_multiscreen_message_cont_cancel_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) { 1dfc2: 40 e0 ldi r20, 0x00 ; 0 1dfc4: 61 e0 ldi r22, 0x01 ; 1 1dfc6: 0f 94 b7 2d call 0x25b6e ; 0x25b6e 1dfca: 81 30 cpi r24, 0x01 ; 1 1dfcc: 41 f4 brne .+16 ; 0x1dfde lcd_print_stop(); } } else if (check == 2) { // Strict, always stop print lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); 1dfce: 0c 94 db ef jmp 0x1dfb6 ; 0x1dfb6 { if (check == 1) { // Warning, stop print if user selects 'No' if (lcd_show_multiscreen_message_cont_cancel_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) { lcd_print_stop(); } } else if (check == 2) { // Strict, always stop print 1dfd2: 42 30 cpi r20, 0x02 ; 2 1dfd4: 21 f4 brne .+8 ; 0x1dfde lcd_show_fullscreen_message_and_wait_P(strict); 1dfd6: cb 01 movw r24, r22 1dfd8: 0f 94 47 0b call 0x2168e ; 0x2168e 1dfdc: f8 cf rjmp .-16 ; 0x1dfce lcd_print_stop(); } } 1dfde: 08 95 ret 0001dfe0 : ,_T(MSG_GCODE_NEWER_FIRMWARE_CANCELLED) ,(uint8_t)oCheckVersion ); } bool filament_presence_check() { 1dfe0: 0f 93 push r16 1dfe2: 1f 93 push r17 1dfe4: cf 93 push r28 // When MMU is enabled, this is not necessary and the G-code file // should always tell the MMU which filament to load. if (eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED)) { 1dfe6: 8c ea ldi r24, 0xAC ; 172 1dfe8: 9c e0 ldi r25, 0x0C ; 12 1dfea: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1dfee: 88 23 and r24, r24 1dff0: 29 f0 breq .+10 ; 0x1dffc return false; } } done: return true; 1dff2: 81 e0 ldi r24, 0x01 ; 1 } 1dff4: cf 91 pop r28 1dff6: 1f 91 pop r17 1dff8: 0f 91 pop r16 1dffa: 08 95 ret // should always tell the MMU which filament to load. if (eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED)) { goto done; } if (fsensor.isEnabled() && !fsensor.getFilamentPresent()) { 1dffc: 80 91 84 16 lds r24, 0x1684 ; 0x801684 1e000: 88 23 and r24, r24 1e002: b9 f3 breq .-18 ; 0x1dff2 1e004: 0e 94 fc c3 call 0x187f8 ; 0x187f8 1e008: 81 11 cpse r24, r1 1e00a: f3 cf rjmp .-26 ; 0x1dff2 if (oCheckFilament == ClCheckMode::_None) { 1e00c: c0 91 bc 03 lds r28, 0x03BC ; 0x8003bc 1e010: cc 23 and r28, r28 1e012: 79 f3 breq .-34 ; 0x1dff2 goto done; } render_M862_warnings( 1e014: 8e e9 ldi r24, 0x9E ; 158 1e016: 91 e4 ldi r25, 0x41 ; 65 1e018: 0e 94 b1 6c call 0xd962 ; 0xd962 1e01c: 8c 01 movw r16, r24 1e01e: 8e e9 ldi r24, 0x9E ; 158 1e020: 91 e4 ldi r25, 0x41 ; 65 1e022: 0e 94 b1 6c call 0xd962 ; 0xd962 1e026: 4c 2f mov r20, r28 1e028: b8 01 movw r22, r16 1e02a: 0e 94 df ef call 0x1dfbe ; 0x1dfbe _T(MSG_MISSING_FILAMENT) ,_T(MSG_MISSING_FILAMENT) //Identical messages ,(uint8_t)oCheckFilament ); if (lcd_commands_type == LcdCommands::StopPrint) { 1e02e: 81 e0 ldi r24, 0x01 ; 1 1e030: 90 91 c8 0d lds r25, 0x0DC8 ; 0x800dc8 1e034: 91 30 cpi r25, 0x01 ; 1 1e036: f1 f6 brne .-68 ; 0x1dff4 1e038: 80 e0 ldi r24, 0x00 ; 0 1e03a: dc cf rjmp .-72 ; 0x1dff4 0001e03c : lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); } } void nozzle_diameter_check(uint16_t nDiameter) { 1e03c: 1f 93 push r17 1e03e: cf 93 push r28 1e040: df 93 push r29 uint16_t nDiameter_um; if (oCheckMode == ClCheckMode::_None) 1e042: 10 91 bb 03 lds r17, 0x03BB ; 0x8003bb 1e046: 11 23 and r17, r17 1e048: 19 f1 breq .+70 ; 0x1e090 1e04a: ec 01 movw r28, r24 return; nDiameter_um = eeprom_read_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM); 1e04c: 85 ea ldi r24, 0xA5 ; 165 1e04e: 9d e0 ldi r25, 0x0D ; 13 1e050: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 if (nDiameter == nDiameter_um) 1e054: 8c 17 cp r24, r28 1e056: 9d 07 cpc r25, r29 1e058: d9 f0 breq .+54 ; 0x1e090 // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN((float)(nDiameter_um/1000.0)); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN((float)(nDiameter/1000.0)); render_M862_warnings( 1e05a: 8f e4 ldi r24, 0x4F ; 79 1e05c: 91 e4 ldi r25, 0x41 ; 65 1e05e: 0e 94 b1 6c call 0xd962 ; 0xd962 1e062: ec 01 movw r28, r24 1e064: 84 e2 ldi r24, 0x24 ; 36 1e066: 91 e4 ldi r25, 0x41 ; 65 1e068: 0e 94 b1 6c call 0xd962 ; 0xd962 1e06c: 41 2f mov r20, r17 1e06e: be 01 movw r22, r28 1e070: 0e 94 df ef call 0x1dfbe ; 0x1dfbe _T(MSG_NOZZLE_DIFFERS_CONTINUE) ,_T(MSG_NOZZLE_DIFFERS_CANCELLED) ,(uint8_t)oCheckMode ); if (!farm_mode) { 1e074: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1e078: 81 11 cpse r24, r1 1e07a: 0a c0 rjmp .+20 ; 0x1e090 bSettings = false; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 1e07c: 10 92 ba 03 sts 0x03BA, r1 ; 0x8003ba menu_submenu(lcd_hw_setup_menu); 1e080: 60 e0 ldi r22, 0x00 ; 0 1e082: 85 eb ldi r24, 0xB5 ; 181 1e084: 93 eb ldi r25, 0xB3 ; 179 } } 1e086: df 91 pop r29 1e088: cf 91 pop r28 1e08a: 1f 91 pop r17 ,(uint8_t)oCheckMode ); if (!farm_mode) { bSettings = false; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function menu_submenu(lcd_hw_setup_menu); 1e08c: 0d 94 29 94 jmp 0x32852 ; 0x32852 } } 1e090: df 91 pop r29 1e092: cf 91 pop r28 1e094: 1f 91 pop r17 1e096: 08 95 ret 0001e098 : } /// @brief unload filament for single material printer (used in M600 and M702) /// @param unloadLength Retract distance for removal (manual reload) void unload_filament(float unloadLength) { 1e098: cf 92 push r12 1e09a: df 92 push r13 1e09c: ef 92 push r14 1e09e: ff 92 push r15 1e0a0: cf 93 push r28 1e0a2: 6b 01 movw r12, r22 1e0a4: 7c 01 movw r14, r24 custom_message_type = CustomMsg::FilamentLoading; 1e0a6: 82 e0 ldi r24, 0x02 ; 2 1e0a8: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 lcd_setstatuspgm(_T(MSG_UNLOADING_FILAMENT)); 1e0ac: 8e e5 ldi r24, 0x5E ; 94 1e0ae: 96 e5 ldi r25, 0x56 ; 86 1e0b0: 0e 94 b1 6c call 0xd962 ; 0xd962 1e0b4: 0e 94 65 e6 call 0x1ccca ; 0x1ccca 1e0b8: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1e0bc: 10 92 85 16 sts 0x1685, r1 ; 0x801685 FSensorBlockRunout fsBlockRunout; current_position[E_AXIS] -= FILAMENT_UNLOAD_FAST_RETRACT_LENGTH; 1e0c0: 20 e0 ldi r18, 0x00 ; 0 1e0c2: 30 e0 ldi r19, 0x00 ; 0 1e0c4: 44 e3 ldi r20, 0x34 ; 52 1e0c6: 52 e4 ldi r21, 0x42 ; 66 1e0c8: 60 91 01 12 lds r22, 0x1201 ; 0x801201 1e0cc: 70 91 02 12 lds r23, 0x1202 ; 0x801202 1e0d0: 80 91 03 12 lds r24, 0x1203 ; 0x801203 1e0d4: 90 91 04 12 lds r25, 0x1204 ; 0x801204 1e0d8: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1e0dc: 60 93 01 12 sts 0x1201, r22 ; 0x801201 1e0e0: 70 93 02 12 sts 0x1202, r23 ; 0x801202 1e0e4: 80 93 03 12 sts 0x1203, r24 ; 0x801203 1e0e8: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_FAST_RETRACT_FEEDRATE); 1e0ec: 6a e0 ldi r22, 0x0A ; 10 1e0ee: 77 e5 ldi r23, 0x57 ; 87 1e0f0: 8d ea ldi r24, 0xAD ; 173 1e0f2: 92 e4 ldi r25, 0x42 ; 66 1e0f4: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 1e0f8: 0f 94 42 22 call 0x24484 ; 0x24484 current_position[E_AXIS] -= FILAMENT_UNLOAD_SLOW_RETRACT_LENGTH; 1e0fc: 20 e0 ldi r18, 0x00 ; 0 1e0fe: 30 e0 ldi r19, 0x00 ; 0 1e100: 4c e0 ldi r20, 0x0C ; 12 1e102: 52 e4 ldi r21, 0x42 ; 66 1e104: 60 91 01 12 lds r22, 0x1201 ; 0x801201 1e108: 70 91 02 12 lds r23, 0x1202 ; 0x801202 1e10c: 80 91 03 12 lds r24, 0x1203 ; 0x801203 1e110: 90 91 04 12 lds r25, 0x1204 ; 0x801204 1e114: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1e118: 60 93 01 12 sts 0x1201, r22 ; 0x801201 1e11c: 70 93 02 12 sts 0x1202, r23 ; 0x801202 1e120: 80 93 03 12 sts 0x1203, r24 ; 0x801203 1e124: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_SLOW_RETRACT_FEEDRATE); 1e128: 69 e2 ldi r22, 0x29 ; 41 1e12a: 7c e5 ldi r23, 0x5C ; 92 1e12c: 85 e8 ldi r24, 0x85 ; 133 1e12e: 91 e4 ldi r25, 0x41 ; 65 1e130: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 1e134: 0f 94 42 22 call 0x24484 ; 0x24484 // Configurable length, by default it's 0. // only plan the move if the length is set to a non-zero value if (unloadLength) 1e138: 20 e0 ldi r18, 0x00 ; 0 1e13a: 30 e0 ldi r19, 0x00 ; 0 1e13c: a9 01 movw r20, r18 1e13e: c7 01 movw r24, r14 1e140: b6 01 movw r22, r12 1e142: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1e146: 88 23 and r24, r24 1e148: e1 f0 breq .+56 ; 0x1e182 { current_position[E_AXIS] += unloadLength; 1e14a: a7 01 movw r20, r14 1e14c: 96 01 movw r18, r12 1e14e: 60 91 01 12 lds r22, 0x1201 ; 0x801201 1e152: 70 91 02 12 lds r23, 0x1202 ; 0x801202 1e156: 80 91 03 12 lds r24, 0x1203 ; 0x801203 1e15a: 90 91 04 12 lds r25, 0x1204 ; 0x801204 1e15e: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1e162: 60 93 01 12 sts 0x1201, r22 ; 0x801201 1e166: 70 93 02 12 sts 0x1202, r23 ; 0x801202 1e16a: 80 93 03 12 sts 0x1203, r24 ; 0x801203 1e16e: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENT_CHANGE_UNLOAD_FEEDRATE); 1e172: 60 e0 ldi r22, 0x00 ; 0 1e174: 70 e0 ldi r23, 0x00 ; 0 1e176: 80 e2 ldi r24, 0x20 ; 32 1e178: 91 e4 ldi r25, 0x41 ; 65 1e17a: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 1e17e: 0f 94 42 22 call 0x24484 ; 0x24484 } lcd_display_message_fullscreen_P(_T(MSG_PULL_OUT_FILAMENT)); 1e182: 81 ea ldi r24, 0xA1 ; 161 1e184: 9b e3 ldi r25, 0x3B ; 59 1e186: 0e 94 b1 6c call 0xd962 ; 0xd962 1e18a: 0f 94 c0 0a call 0x21580 ; 0x21580 //disable extruder steppers so filament can be removed disable_e0(); 1e18e: 14 9a sbi 0x02, 4 ; 2 _delay(100); 1e190: 64 e6 ldi r22, 0x64 ; 100 1e192: 70 e0 ldi r23, 0x00 ; 0 1e194: 80 e0 ldi r24, 0x00 ; 0 1e196: 90 e0 ldi r25, 0x00 ; 0 1e198: 0f 94 7b 0d call 0x21af6 ; 0x21af6 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 1e19c: 82 e0 ldi r24, 0x02 ; 2 1e19e: 0f 94 9f 2c call 0x2593e ; 0x2593e 1e1a2: c3 e3 ldi r28, 0x33 ; 51 uint8_t counterBeep = 0; while (!lcd_clicked() && (counterBeep < 50)) { 1e1a4: 0e 94 98 6b call 0xd730 ; 0xd730 1e1a8: 81 11 cpse r24, r1 1e1aa: 07 c0 rjmp .+14 ; 0x1e1ba 1e1ac: c1 50 subi r28, 0x01 ; 1 1e1ae: 29 f0 breq .+10 ; 0x1e1ba delay_keep_alive(100); 1e1b0: 84 e6 ldi r24, 0x64 ; 100 1e1b2: 90 e0 ldi r25, 0x00 ; 0 1e1b4: 0e 94 48 7c call 0xf890 ; 0xf890 1e1b8: f5 cf rjmp .-22 ; 0x1e1a4 counterBeep++; } st_synchronize(); 1e1ba: 0f 94 42 22 call 0x24484 ; 0x24484 while (lcd_clicked()) delay_keep_alive(100); 1e1be: 0e 94 98 6b call 0xd730 ; 0xd730 1e1c2: 88 23 and r24, r24 1e1c4: 29 f0 breq .+10 ; 0x1e1d0 1e1c6: 84 e6 ldi r24, 0x64 ; 100 1e1c8: 90 e0 ldi r25, 0x00 ; 0 1e1ca: 0e 94 48 7c call 0xf890 ; 0xf890 1e1ce: f7 cf rjmp .-18 ; 0x1e1be lcd_update_enable(true); 1e1d0: 81 e0 ldi r24, 0x01 ; 1 1e1d2: 0e 94 c0 69 call 0xd380 ; 0xd380 lcd_setstatuspgm(MSG_WELCOME); 1e1d6: 87 e6 ldi r24, 0x67 ; 103 1e1d8: 9b e6 ldi r25, 0x6B ; 107 1e1da: 0e 94 65 e6 call 0x1ccca ; 0x1ccca custom_message_type = CustomMsg::Status; 1e1de: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 clearFilamentAction(); 1e1e2: 0f 94 2f 0c call 0x2185e ; 0x2185e #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 1e1e6: 84 e8 ldi r24, 0x84 ; 132 1e1e8: 96 e1 ldi r25, 0x16 ; 22 } 1e1ea: cf 91 pop r28 1e1ec: ff 90 pop r15 1e1ee: ef 90 pop r14 1e1f0: df 90 pop r13 1e1f2: cf 90 pop r12 1e1f4: 0c 94 f0 6d jmp 0xdbe0 ; 0xdbe0 0001e1f8 : float z1 = si * z_values[j+1][i] + s * z_values[j+1][i+1]; return (1.f-t) * z0 + t * z1; } // Works for an odd number of MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS void mesh_bed_leveling::upsample_3x3() 1e1f8: 2f 92 push r2 1e1fa: 3f 92 push r3 1e1fc: 4f 92 push r4 1e1fe: 5f 92 push r5 1e200: 6f 92 push r6 1e202: 7f 92 push r7 1e204: 8f 92 push r8 1e206: 9f 92 push r9 1e208: af 92 push r10 1e20a: bf 92 push r11 1e20c: cf 92 push r12 1e20e: df 92 push r13 1e210: ef 92 push r14 1e212: ff 92 push r15 1e214: 0f 93 push r16 1e216: 1f 93 push r17 1e218: cf 93 push r28 1e21a: df 93 push r29 1e21c: 00 d0 rcall .+0 ; 0x1e21e 1e21e: 00 d0 rcall .+0 ; 0x1e220 1e220: 00 d0 rcall .+0 ; 0x1e222 1e222: cd b7 in r28, 0x3d ; 61 1e224: de b7 in r29, 0x3e ; 62 1e226: 0c e9 ldi r16, 0x9C ; 156 1e228: 12 e1 ldi r17, 0x12 ; 18 1e22a: 1f 83 std Y+7, r17 ; 0x07 1e22c: 0e 83 std Y+6, r16 ; 0x06 1e22e: 2e 80 ldd r2, Y+6 ; 0x06 1e230: 3f 80 ldd r3, Y+7 ; 0x07 1e232: 19 82 std Y+1, r1 ; 0x01 static const float x1 = 0.5f * float(BED_X0 + BED_Xn) + X_PROBE_OFFSET_FROM_EXTRUDER; static const float x2 = BED_Xn + X_PROBE_OFFSET_FROM_EXTRUDER; for (int j = 0; j < MESH_NUM_Y_POINTS; ++ j) { // Interpolate the remaining values by Largrangian polynomials. for (int i = 0; i < MESH_NUM_X_POINTS; ++ i) { if (!isnan(z_values[j][i])) 1e234: f1 01 movw r30, r2 1e236: 61 81 ldd r22, Z+1 ; 0x01 1e238: 72 81 ldd r23, Z+2 ; 0x02 1e23a: 83 81 ldd r24, Z+3 ; 0x03 1e23c: 94 81 ldd r25, Z+4 ; 0x04 1e23e: 9b 01 movw r18, r22 1e240: ac 01 movw r20, r24 1e242: 0f 94 12 a5 call 0x34a24 ; 0x34a24 <__unordsf2> 1e246: 88 23 and r24, r24 1e248: 09 f4 brne .+2 ; 0x1e24c 1e24a: 7c c0 rjmp .+248 ; 0x1e344 mesh_bed_leveling() { reset(); } void reset(); static float get_x(int i) { return BED_X(i) + X_PROBE_OFFSET_FROM_EXTRUDER; } 1e24c: 89 81 ldd r24, Y+1 ; 0x01 1e24e: 0f 94 65 8b call 0x316ca ; 0x316ca 1e252: 20 e0 ldi r18, 0x00 ; 0 1e254: 30 e0 ldi r19, 0x00 ; 0 1e256: 48 eb ldi r20, 0xB8 ; 184 1e258: 51 e4 ldi r21, 0x41 ; 65 1e25a: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1e25e: 6b 01 movw r12, r22 1e260: 7c 01 movw r14, r24 continue; float x = get_x(i); z_values[j][i] = z_values[j][idx0] * (x - x1) * (x - x2) / ((x0 - x1) * (x0 - x2)) + 1e262: 20 e0 ldi r18, 0x00 ; 0 1e264: 30 e0 ldi r19, 0x00 ; 0 1e266: 4c ef ldi r20, 0xFC ; 252 1e268: 52 e4 ldi r21, 0x42 ; 66 1e26a: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1e26e: 2b 01 movw r4, r22 1e270: 3c 01 movw r6, r24 1e272: 20 e0 ldi r18, 0x00 ; 0 1e274: 30 e0 ldi r19, 0x00 ; 0 1e276: 44 e6 ldi r20, 0x64 ; 100 1e278: 53 e4 ldi r21, 0x43 ; 67 1e27a: c7 01 movw r24, r14 1e27c: b6 01 movw r22, r12 1e27e: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1e282: 4b 01 movw r8, r22 1e284: 5c 01 movw r10, r24 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 1e286: 20 e0 ldi r18, 0x00 ; 0 1e288: 30 e0 ldi r19, 0x00 ; 0 1e28a: 40 ec ldi r20, 0xC0 ; 192 1e28c: 51 e4 ldi r21, 0x41 ; 65 1e28e: c7 01 movw r24, r14 1e290: b6 01 movw r22, r12 1e292: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1e296: 6b 01 movw r12, r22 1e298: 7c 01 movw r14, r24 for (int i = 0; i < MESH_NUM_X_POINTS; ++ i) { if (!isnan(z_values[j][i])) continue; float x = get_x(i); z_values[j][i] = z_values[j][idx0] * (x - x1) * (x - x2) / ((x0 - x1) * (x0 - x2)) + 1e29a: ee 81 ldd r30, Y+6 ; 0x06 1e29c: ff 81 ldd r31, Y+7 ; 0x07 1e29e: 21 81 ldd r18, Z+1 ; 0x01 1e2a0: 32 81 ldd r19, Z+2 ; 0x02 1e2a2: 43 81 ldd r20, Z+3 ; 0x03 1e2a4: 54 81 ldd r21, Z+4 ; 0x04 1e2a6: c3 01 movw r24, r6 1e2a8: b2 01 movw r22, r4 1e2aa: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1e2ae: a5 01 movw r20, r10 1e2b0: 94 01 movw r18, r8 1e2b2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1e2b6: 20 e0 ldi r18, 0x00 ; 0 1e2b8: 30 e9 ldi r19, 0x90 ; 144 1e2ba: 42 ea ldi r20, 0xA2 ; 162 1e2bc: 56 e4 ldi r21, 0x46 ; 70 1e2be: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1e2c2: 6a 83 std Y+2, r22 ; 0x02 1e2c4: 7b 83 std Y+3, r23 ; 0x03 1e2c6: 8c 83 std Y+4, r24 ; 0x04 1e2c8: 9d 83 std Y+5, r25 ; 0x05 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 1e2ca: ee 81 ldd r30, Y+6 ; 0x06 1e2cc: ff 81 ldd r31, Y+7 ; 0x07 1e2ce: 25 85 ldd r18, Z+13 ; 0x0d 1e2d0: 36 85 ldd r19, Z+14 ; 0x0e 1e2d2: 47 85 ldd r20, Z+15 ; 0x0f 1e2d4: 50 89 ldd r21, Z+16 ; 0x10 1e2d6: c7 01 movw r24, r14 1e2d8: b6 01 movw r22, r12 1e2da: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1e2de: a5 01 movw r20, r10 1e2e0: 94 01 movw r18, r8 1e2e2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1e2e6: 20 e0 ldi r18, 0x00 ; 0 1e2e8: 30 e9 ldi r19, 0x90 ; 144 1e2ea: 42 e2 ldi r20, 0x22 ; 34 1e2ec: 56 ec ldi r21, 0xC6 ; 198 1e2ee: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1e2f2: 9b 01 movw r18, r22 1e2f4: ac 01 movw r20, r24 for (int i = 0; i < MESH_NUM_X_POINTS; ++ i) { if (!isnan(z_values[j][i])) continue; float x = get_x(i); z_values[j][i] = z_values[j][idx0] * (x - x1) * (x - x2) / ((x0 - x1) * (x0 - x2)) + 1e2f6: 6a 81 ldd r22, Y+2 ; 0x02 1e2f8: 7b 81 ldd r23, Y+3 ; 0x03 1e2fa: 8c 81 ldd r24, Y+4 ; 0x04 1e2fc: 9d 81 ldd r25, Y+5 ; 0x05 1e2fe: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1e302: 4b 01 movw r8, r22 1e304: 5c 01 movw r10, r24 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + z_values[j][idx2] * (x - x0) * (x - x1) / ((x2 - x0) * (x2 - x1)); 1e306: ee 81 ldd r30, Y+6 ; 0x06 1e308: ff 81 ldd r31, Y+7 ; 0x07 1e30a: 21 8d ldd r18, Z+25 ; 0x19 1e30c: 32 8d ldd r19, Z+26 ; 0x1a 1e30e: 43 8d ldd r20, Z+27 ; 0x1b 1e310: 54 8d ldd r21, Z+28 ; 0x1c 1e312: c7 01 movw r24, r14 1e314: b6 01 movw r22, r12 1e316: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1e31a: a3 01 movw r20, r6 1e31c: 92 01 movw r18, r4 1e31e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1e322: 20 e0 ldi r18, 0x00 ; 0 1e324: 30 e9 ldi r19, 0x90 ; 144 1e326: 42 ea ldi r20, 0xA2 ; 162 1e328: 56 e4 ldi r21, 0x46 ; 70 1e32a: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1e32e: 9b 01 movw r18, r22 1e330: ac 01 movw r20, r24 if (!isnan(z_values[j][i])) continue; float x = get_x(i); z_values[j][i] = z_values[j][idx0] * (x - x1) * (x - x2) / ((x0 - x1) * (x0 - x2)) + z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 1e332: c5 01 movw r24, r10 1e334: b4 01 movw r22, r8 1e336: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> // Interpolate the remaining values by Largrangian polynomials. for (int i = 0; i < MESH_NUM_X_POINTS; ++ i) { if (!isnan(z_values[j][i])) continue; float x = get_x(i); z_values[j][i] = 1e33a: f1 01 movw r30, r2 1e33c: 61 83 std Z+1, r22 ; 0x01 1e33e: 72 83 std Z+2, r23 ; 0x02 1e340: 83 83 std Z+3, r24 ; 0x03 1e342: 94 83 std Z+4, r25 ; 0x04 1e344: f4 e0 ldi r31, 0x04 ; 4 1e346: 2f 0e add r2, r31 1e348: 31 1c adc r3, r1 1e34a: 29 81 ldd r18, Y+1 ; 0x01 1e34c: 2f 5f subi r18, 0xFF ; 255 1e34e: 29 83 std Y+1, r18 ; 0x01 static const float x0 = (BED_X0 + X_PROBE_OFFSET_FROM_EXTRUDER); static const float x1 = 0.5f * float(BED_X0 + BED_Xn) + X_PROBE_OFFSET_FROM_EXTRUDER; static const float x2 = BED_Xn + X_PROBE_OFFSET_FROM_EXTRUDER; for (int j = 0; j < MESH_NUM_Y_POINTS; ++ j) { // Interpolate the remaining values by Largrangian polynomials. for (int i = 0; i < MESH_NUM_X_POINTS; ++ i) { 1e350: 27 30 cpi r18, 0x07 ; 7 1e352: 09 f0 breq .+2 ; 0x1e356 1e354: 6f cf rjmp .-290 ; 0x1e234 1e356: 8e 81 ldd r24, Y+6 ; 0x06 1e358: 9f 81 ldd r25, Y+7 ; 0x07 1e35a: 4c 96 adiw r24, 0x1c ; 28 1e35c: 9f 83 std Y+7, r25 ; 0x07 1e35e: 8e 83 std Y+6, r24 ; 0x06 { // First interpolate the points in X axis. static const float x0 = (BED_X0 + X_PROBE_OFFSET_FROM_EXTRUDER); static const float x1 = 0.5f * float(BED_X0 + BED_Xn) + X_PROBE_OFFSET_FROM_EXTRUDER; static const float x2 = BED_Xn + X_PROBE_OFFSET_FROM_EXTRUDER; for (int j = 0; j < MESH_NUM_Y_POINTS; ++ j) { 1e360: 80 56 subi r24, 0x60 ; 96 1e362: 93 41 sbci r25, 0x13 ; 19 1e364: 09 f0 breq .+2 ; 0x1e368 1e366: 63 cf rjmp .-314 ; 0x1e22e float z1 = si * z_values[j+1][i] + s * z_values[j+1][i+1]; return (1.f-t) * z0 + t * z1; } // Works for an odd number of MESH_NUM_X_POINTS and MESH_NUM_Y_POINTS void mesh_bed_leveling::upsample_3x3() 1e368: 19 87 std Y+9, r17 ; 0x09 1e36a: 08 87 std Y+8, r16 ; 0x08 1e36c: f1 e0 ldi r31, 0x01 ; 1 1e36e: f9 83 std Y+1, r31 ; 0x01 if (!isnan(z_values[j][i])) continue; float y = get_y(j); z_values[j][i] = z_values[idx0][i] * (y - y1) * (y - y2) / ((y0 - y1) * (y0 - y2)) + z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + 1e370: c8 01 movw r24, r16 1e372: 8b 5a subi r24, 0xAB ; 171 1e374: 9f 4f sbci r25, 0xFF ; 255 1e376: 9f 83 std Y+7, r25 ; 0x07 1e378: 8e 83 std Y+6, r24 ; 0x06 z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); 1e37a: 18 01 movw r2, r16 1e37c: 99 ea ldi r25, 0xA9 ; 169 1e37e: 29 0e add r2, r25 1e380: 31 1c adc r3, r1 static const float y1 = 0.5f * float(BED_Y0 + BED_Yn) + Y_PROBE_OFFSET_FROM_EXTRUDER; static const float y2 = BED_Yn + Y_PROBE_OFFSET_FROM_EXTRUDER; for (int i = 0; i < MESH_NUM_X_POINTS; ++ i) { // Interpolate the remaining values by Largrangian polynomials. for (int j = 1; j + 1 < MESH_NUM_Y_POINTS; ++ j) { if (!isnan(z_values[j][i])) 1e382: e8 85 ldd r30, Y+8 ; 0x08 1e384: f9 85 ldd r31, Y+9 ; 0x09 1e386: 65 8d ldd r22, Z+29 ; 0x1d 1e388: 76 8d ldd r23, Z+30 ; 0x1e 1e38a: 87 8d ldd r24, Z+31 ; 0x1f 1e38c: 90 a1 ldd r25, Z+32 ; 0x20 1e38e: 9b 01 movw r18, r22 1e390: ac 01 movw r20, r24 1e392: 0f 94 12 a5 call 0x34a24 ; 0x34a24 <__unordsf2> 1e396: 88 23 and r24, r24 1e398: 09 f4 brne .+2 ; 0x1e39c 1e39a: 79 c0 rjmp .+242 ; 0x1e48e static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 1e39c: 89 81 ldd r24, Y+1 ; 0x01 1e39e: 0f 94 65 8b call 0x316ca ; 0x316ca 1e3a2: 20 e0 ldi r18, 0x00 ; 0 1e3a4: 30 e0 ldi r19, 0x00 ; 0 1e3a6: 40 ea ldi r20, 0xA0 ; 160 1e3a8: 50 e4 ldi r21, 0x40 ; 64 1e3aa: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1e3ae: 6b 01 movw r12, r22 1e3b0: 7c 01 movw r14, r24 continue; float y = get_y(j); z_values[j][i] = z_values[idx0][i] * (y - y1) * (y - y2) / ((y0 - y1) * (y0 - y2)) + 1e3b2: 20 e0 ldi r18, 0x00 ; 0 1e3b4: 30 e0 ldi r19, 0x00 ; 0 1e3b6: 48 ed ldi r20, 0xD8 ; 216 1e3b8: 52 e4 ldi r21, 0x42 ; 66 1e3ba: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1e3be: 2b 01 movw r4, r22 1e3c0: 3c 01 movw r6, r24 1e3c2: 20 e0 ldi r18, 0x00 ; 0 1e3c4: 30 e0 ldi r19, 0x00 ; 0 1e3c6: 42 e5 ldi r20, 0x52 ; 82 1e3c8: 53 e4 ldi r21, 0x43 ; 67 1e3ca: c7 01 movw r24, r14 1e3cc: b6 01 movw r22, r12 1e3ce: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1e3d2: 4b 01 movw r8, r22 1e3d4: 5c 01 movw r10, r24 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + 1e3d6: 20 e0 ldi r18, 0x00 ; 0 1e3d8: 30 e0 ldi r19, 0x00 ; 0 1e3da: 40 ec ldi r20, 0xC0 ; 192 1e3dc: 50 e4 ldi r21, 0x40 ; 64 1e3de: c7 01 movw r24, r14 1e3e0: b6 01 movw r22, r12 1e3e2: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1e3e6: 6b 01 movw r12, r22 1e3e8: 7c 01 movw r14, r24 1e3ea: ee 81 ldd r30, Y+6 ; 0x06 1e3ec: ff 81 ldd r31, Y+7 ; 0x07 1e3ee: 20 81 ld r18, Z 1e3f0: 31 81 ldd r19, Z+1 ; 0x01 1e3f2: 42 81 ldd r20, Z+2 ; 0x02 1e3f4: 53 81 ldd r21, Z+3 ; 0x03 1e3f6: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1e3fa: a5 01 movw r20, r10 1e3fc: 94 01 movw r18, r8 1e3fe: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1e402: 20 e0 ldi r18, 0x00 ; 0 1e404: 30 e9 ldi r19, 0x90 ; 144 1e406: 42 e2 ldi r20, 0x22 ; 34 1e408: 56 ec ldi r21, 0xC6 ; 198 1e40a: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1e40e: 6a 83 std Y+2, r22 ; 0x02 1e410: 7b 83 std Y+3, r23 ; 0x03 1e412: 8c 83 std Y+4, r24 ; 0x04 1e414: 9d 83 std Y+5, r25 ; 0x05 for (int j = 1; j + 1 < MESH_NUM_Y_POINTS; ++ j) { if (!isnan(z_values[j][i])) continue; float y = get_y(j); z_values[j][i] = z_values[idx0][i] * (y - y1) * (y - y2) / ((y0 - y1) * (y0 - y2)) + 1e416: f8 01 movw r30, r16 1e418: 21 81 ldd r18, Z+1 ; 0x01 1e41a: 32 81 ldd r19, Z+2 ; 0x02 1e41c: 43 81 ldd r20, Z+3 ; 0x03 1e41e: 54 81 ldd r21, Z+4 ; 0x04 1e420: c3 01 movw r24, r6 1e422: b2 01 movw r22, r4 1e424: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1e428: a5 01 movw r20, r10 1e42a: 94 01 movw r18, r8 1e42c: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1e430: 20 e0 ldi r18, 0x00 ; 0 1e432: 30 e9 ldi r19, 0x90 ; 144 1e434: 42 ea ldi r20, 0xA2 ; 162 1e436: 56 e4 ldi r21, 0x46 ; 70 1e438: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1e43c: 9b 01 movw r18, r22 1e43e: ac 01 movw r20, r24 1e440: 6a 81 ldd r22, Y+2 ; 0x02 1e442: 7b 81 ldd r23, Y+3 ; 0x03 1e444: 8c 81 ldd r24, Y+4 ; 0x04 1e446: 9d 81 ldd r25, Y+5 ; 0x05 1e448: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1e44c: 4b 01 movw r8, r22 1e44e: 5c 01 movw r10, r24 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); 1e450: f1 01 movw r30, r2 1e452: 20 81 ld r18, Z 1e454: 31 81 ldd r19, Z+1 ; 0x01 1e456: 42 81 ldd r20, Z+2 ; 0x02 1e458: 53 81 ldd r21, Z+3 ; 0x03 1e45a: c7 01 movw r24, r14 1e45c: b6 01 movw r22, r12 1e45e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1e462: a3 01 movw r20, r6 1e464: 92 01 movw r18, r4 1e466: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1e46a: 20 e0 ldi r18, 0x00 ; 0 1e46c: 30 e9 ldi r19, 0x90 ; 144 1e46e: 42 ea ldi r20, 0xA2 ; 162 1e470: 56 e4 ldi r21, 0x46 ; 70 1e472: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1e476: 9b 01 movw r18, r22 1e478: ac 01 movw r20, r24 if (!isnan(z_values[j][i])) continue; float y = get_y(j); z_values[j][i] = z_values[idx0][i] * (y - y1) * (y - y2) / ((y0 - y1) * (y0 - y2)) + z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + 1e47a: c5 01 movw r24, r10 1e47c: b4 01 movw r22, r8 1e47e: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> // Interpolate the remaining values by Largrangian polynomials. for (int j = 1; j + 1 < MESH_NUM_Y_POINTS; ++ j) { if (!isnan(z_values[j][i])) continue; float y = get_y(j); z_values[j][i] = 1e482: e8 85 ldd r30, Y+8 ; 0x08 1e484: f9 85 ldd r31, Y+9 ; 0x09 1e486: 65 8f std Z+29, r22 ; 0x1d 1e488: 76 8f std Z+30, r23 ; 0x1e 1e48a: 87 8f std Z+31, r24 ; 0x1f 1e48c: 90 a3 std Z+32, r25 ; 0x20 1e48e: 88 85 ldd r24, Y+8 ; 0x08 1e490: 99 85 ldd r25, Y+9 ; 0x09 1e492: 4c 96 adiw r24, 0x1c ; 28 1e494: 99 87 std Y+9, r25 ; 0x09 1e496: 88 87 std Y+8, r24 ; 0x08 1e498: 99 81 ldd r25, Y+1 ; 0x01 1e49a: 9f 5f subi r25, 0xFF ; 255 1e49c: 99 83 std Y+1, r25 ; 0x01 static const float y0 = (BED_Y0 + Y_PROBE_OFFSET_FROM_EXTRUDER); static const float y1 = 0.5f * float(BED_Y0 + BED_Yn) + Y_PROBE_OFFSET_FROM_EXTRUDER; static const float y2 = BED_Yn + Y_PROBE_OFFSET_FROM_EXTRUDER; for (int i = 0; i < MESH_NUM_X_POINTS; ++ i) { // Interpolate the remaining values by Largrangian polynomials. for (int j = 1; j + 1 < MESH_NUM_Y_POINTS; ++ j) { 1e49e: 96 30 cpi r25, 0x06 ; 6 1e4a0: 09 f0 breq .+2 ; 0x1e4a4 1e4a2: 6f cf rjmp .-290 ; 0x1e382 1e4a4: 0c 5f subi r16, 0xFC ; 252 1e4a6: 1f 4f sbci r17, 0xFF ; 255 { // Second interpolate the points in Y axis. static const float y0 = (BED_Y0 + Y_PROBE_OFFSET_FROM_EXTRUDER); static const float y1 = 0.5f * float(BED_Y0 + BED_Yn) + Y_PROBE_OFFSET_FROM_EXTRUDER; static const float y2 = BED_Yn + Y_PROBE_OFFSET_FROM_EXTRUDER; for (int i = 0; i < MESH_NUM_X_POINTS; ++ i) { 1e4a8: e2 e1 ldi r30, 0x12 ; 18 1e4aa: 08 3b cpi r16, 0xB8 ; 184 1e4ac: 1e 07 cpc r17, r30 1e4ae: 09 f0 breq .+2 ; 0x1e4b2 1e4b0: 5b cf rjmp .-330 ; 0x1e368 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); } } } } 1e4b2: 29 96 adiw r28, 0x09 ; 9 1e4b4: 0f b6 in r0, 0x3f ; 63 1e4b6: f8 94 cli 1e4b8: de bf out 0x3e, r29 ; 62 1e4ba: 0f be out 0x3f, r0 ; 63 1e4bc: cd bf out 0x3d, r28 ; 61 1e4be: df 91 pop r29 1e4c0: cf 91 pop r28 1e4c2: 1f 91 pop r17 1e4c4: 0f 91 pop r16 1e4c6: ff 90 pop r15 1e4c8: ef 90 pop r14 1e4ca: df 90 pop r13 1e4cc: cf 90 pop r12 1e4ce: bf 90 pop r11 1e4d0: af 90 pop r10 1e4d2: 9f 90 pop r9 1e4d4: 8f 90 pop r8 1e4d6: 7f 90 pop r7 1e4d8: 6f 90 pop r6 1e4da: 5f 90 pop r5 1e4dc: 4f 90 pop r4 1e4de: 3f 90 pop r3 1e4e0: 2f 90 pop r2 1e4e2: 08 95 ret 0001e4e4 : } } return false; // couldn't accomplish the task } void MMU2::ToolChangeCommon(uint8_t slot) { 1e4e4: 2f 92 push r2 1e4e6: 3f 92 push r3 1e4e8: 4f 92 push r4 1e4ea: 5f 92 push r5 1e4ec: 6f 92 push r6 1e4ee: 7f 92 push r7 1e4f0: 8f 92 push r8 1e4f2: 9f 92 push r9 1e4f4: af 92 push r10 1e4f6: bf 92 push r11 1e4f8: cf 92 push r12 1e4fa: df 92 push r13 1e4fc: ef 92 push r14 1e4fe: ff 92 push r15 1e500: 0f 93 push r16 1e502: 1f 93 push r17 1e504: cf 93 push r28 1e506: df 93 push r29 1e508: cd b7 in r28, 0x3d ; 61 1e50a: de b7 in r29, 0x3e ; 62 1e50c: 67 97 sbiw r28, 0x17 ; 23 1e50e: 0f b6 in r0, 0x3f ; 63 1e510: f8 94 cli 1e512: de bf out 0x3e, r29 ; 62 1e514: 0f be out 0x3f, r0 ; 63 1e516: cd bf out 0x3d, r28 ; 61 1e518: 08 2f mov r16, r24 1e51a: ce 01 movw r24, r28 1e51c: 46 96 adiw r24, 0x16 ; 22 1e51e: 9f 8b std Y+23, r25 ; 0x17 1e520: 8e 8b std Y+22, r24 ; 0x16 1e522: 83 e0 ldi r24, 0x03 ; 3 1e524: f8 2e mov r15, r24 lcd_draw_update = 1; // force redraw } void lcd_clearstatus() { memset(lcd_status_message, 0, sizeof(lcd_status_message)); 1e526: 95 e1 ldi r25, 0x15 ; 21 1e528: 29 2e mov r2, r25 bool MMU2::ToolChangeCommonOnce(uint8_t slot) { static_assert(MAX_RETRIES > 1); // need >1 retries to do the cut in the last attempt for (uint8_t retries = MAX_RETRIES; retries; --retries) { for (;;) { Disable_E0(); // it may seem counterintuitive to disable the E-motor, but it gets enabled in the planner whenever the E-motor is to move 1e52a: 0f 94 00 87 call 0x30e00 ; 0x30e00 tool_change_extruder = slot; 1e52e: 00 93 7c 12 sts 0x127C, r16 ; 0x80127c state = State::Stopped; currentScope = Scope::Stopped; } void ProtocolLogic::ToolChange(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Tool, slot)); 1e532: 40 2f mov r20, r16 1e534: 64 e5 ldi r22, 0x54 ; 84 1e536: ce 01 movw r24, r28 1e538: 01 96 adiw r24, 0x01 ; 1 1e53a: 0f 94 f3 86 call 0x30de6 ; 0x30de6 1e53e: 49 81 ldd r20, Y+1 ; 0x01 1e540: 5a 81 ldd r21, Y+2 ; 0x02 1e542: 6b 81 ldd r22, Y+3 ; 0x03 1e544: 7c 81 ldd r23, Y+4 ; 0x04 1e546: 8d 81 ldd r24, Y+5 ; 0x05 1e548: 0f 94 33 62 call 0x2c466 ; 0x2c466 logic.ToolChange(slot); // let the MMU pull the filament out and push a new one in if (manage_response(true, true)) { 1e54c: 61 e0 ldi r22, 0x01 ; 1 1e54e: 81 e0 ldi r24, 0x01 ; 1 1e550: 0f 94 c8 69 call 0x2d390 ; 0x2d390 1e554: 18 2f mov r17, r24 1e556: 81 11 cpse r24, r1 1e558: 07 c0 rjmp .+14 ; 0x1e568 break; } // otherwise: failed to perform the command - unload first and then let it run again IncrementMMUFails(); 1e55a: 0f 94 57 86 call 0x30cae ; 0x30cae // just in case we stood in an error screen for too long and the hotend got cold ResumeHotendTemp(); 1e55e: 0f 94 66 69 call 0x2d2cc ; 0x2d2cc // if the extruder has been parked, it will get unparked once the ToolChange command finishes OK // - so no ResumeUnpark() at this spot UnloadInner(); 1e562: 0f 94 56 6a call 0x2d4ac ; 0x2d4ac 1e566: e1 cf rjmp .-62 ; 0x1e52a bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 1e568: 0f 94 42 22 call 0x24484 ; 0x24484 } bool MMU2::VerifyFilamentEnteredPTFE() { planner_synchronize(); if (WhereIsFilament() != FilamentState::AT_FSENSOR) 1e56c: 0f 94 36 87 call 0x30e6c ; 0x30e6c 1e570: 81 30 cpi r24, 0x01 ; 1 1e572: 79 f1 breq .+94 ; 0x1e5d2 // something else is seriously broken and stopping a print is probably our best option. } if (VerifyFilamentEnteredPTFE()) { return true; // success } else { // Prepare a retry attempt UnloadInner(); 1e574: 0f 94 56 6a call 0x2d4ac ; 0x2d4ac if (retries == 2 && cutter_enabled()) { 1e578: 92 e0 ldi r25, 0x02 ; 2 1e57a: f9 12 cpse r15, r25 1e57c: 09 c0 rjmp .+18 ; 0x1e590 eeprom_increment_byte((uint8_t *)EEPROM_MMU_FAIL); eeprom_increment_word((uint16_t *)EEPROM_MMU_FAIL_TOT); } bool cutter_enabled(){ return eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) == EEPROM_MMU_CUTTER_ENABLED_enabled; 1e57e: 8e ec ldi r24, 0xCE ; 206 1e580: 9e e0 ldi r25, 0x0E ; 14 1e582: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1e586: 81 30 cpi r24, 0x01 ; 1 1e588: 19 f4 brne .+6 ; 0x1e590 CutFilamentInner(slot); // try cutting filament tip at the last attempt 1e58a: 80 2f mov r24, r16 1e58c: 0f 94 41 6b call 0x2d682 ; 0x2d682 1e590: fa 94 dec r15 return filament_inserted; } bool MMU2::ToolChangeCommonOnce(uint8_t slot) { static_assert(MAX_RETRIES > 1); // need >1 retries to do the cut in the last attempt for (uint8_t retries = MAX_RETRIES; retries; --retries) { 1e592: f1 10 cpse r15, r1 1e594: ca cf rjmp .-108 ; 0x1e52a return false; // couldn't accomplish the task } void MMU2::ToolChangeCommon(uint8_t slot) { while (!ToolChangeCommonOnce(slot)) { // while not successfully fed into extruder's PTFE tube if (planner_draining()) { 1e596: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 1e59a: 88 23 and r24, r24 1e59c: 09 f4 brne .+2 ; 0x1e5a0 1e59e: ef c0 rjmp .+478 ; 0x1e77e SetCurrentTool(slot); // filament change is finished SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } 1e5a0: 67 96 adiw r28, 0x17 ; 23 1e5a2: 0f b6 in r0, 0x3f ; 63 1e5a4: f8 94 cli 1e5a6: de bf out 0x3e, r29 ; 62 1e5a8: 0f be out 0x3f, r0 ; 63 1e5aa: cd bf out 0x3d, r28 ; 61 1e5ac: df 91 pop r29 1e5ae: cf 91 pop r28 1e5b0: 1f 91 pop r17 1e5b2: 0f 91 pop r16 1e5b4: ff 90 pop r15 1e5b6: ef 90 pop r14 1e5b8: df 90 pop r13 1e5ba: cf 90 pop r12 1e5bc: bf 90 pop r11 1e5be: af 90 pop r10 1e5c0: 9f 90 pop r9 1e5c2: 8f 90 pop r8 1e5c4: 7f 90 pop r7 1e5c6: 6f 90 pop r6 1e5c8: 5f 90 pop r5 1e5ca: 4f 90 pop r4 1e5cc: 3f 90 pop r3 1e5ce: 2f 90 pop r2 1e5d0: 08 95 ret if (WhereIsFilament() != FilamentState::AT_FSENSOR) return false; // MMU has finished its load, push the filament further by some defined constant length // If the filament sensor reads 0 at any moment, then report FAILURE const float tryload_length = MMU2_CHECK_FILAMENT_PRESENCE_EXTRUSION_LENGTH - logic.ExtraLoadDistance(); 1e5d2: 60 91 71 12 lds r22, 0x1271 ; 0x801271 1e5d6: 70 e0 ldi r23, 0x00 ; 0 1e5d8: 90 e0 ldi r25, 0x00 ; 0 1e5da: 80 e0 ldi r24, 0x00 ; 0 1e5dc: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 1e5e0: 9b 01 movw r18, r22 1e5e2: ac 01 movw r20, r24 1e5e4: 60 e0 ldi r22, 0x00 ; 0 1e5e6: 70 e0 ldi r23, 0x00 ; 0 1e5e8: 8c e5 ldi r24, 0x5C ; 92 1e5ea: 92 e4 ldi r25, 0x42 ; 66 1e5ec: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1e5f0: 36 2e mov r3, r22 1e5f2: 87 2e mov r8, r23 1e5f4: 98 2e mov r9, r24 1e5f6: e9 2e mov r14, r25 TryLoadUnloadReporter::TryLoadUnloadReporter(float delta_mm) : dpixel0(0) , dpixel1(0) , lcd_cursor_col(0) , pixel_per_mm(0.5F * float(LCD_WIDTH) / (delta_mm)) 1e5f8: 26 2f mov r18, r22 1e5fa: 37 2f mov r19, r23 1e5fc: 48 2f mov r20, r24 1e5fe: 59 2f mov r21, r25 1e600: 60 e0 ldi r22, 0x00 ; 0 1e602: 70 e0 ldi r23, 0x00 ; 0 1e604: 80 e2 ldi r24, 0x20 ; 32 1e606: 91 e4 ldi r25, 0x41 ; 65 1e608: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 1e60c: 2b 01 movw r4, r22 1e60e: 3c 01 movw r6, r24 1e610: e9 e0 ldi r30, 0x09 ; 9 1e612: f5 e0 ldi r31, 0x05 ; 5 1e614: 82 2d mov r24, r2 1e616: 11 92 st Z+, r1 1e618: 8a 95 dec r24 1e61a: e9 f7 brne .-6 ; 0x1e616 lcd_status_message_idx = 0; 1e61c: 10 92 08 05 sts 0x0508, r1 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.417> bool filament_inserted = true; // expect success // Pixel index will go from 0 to 10, then back from 10 to 0 // The change in this number is used to indicate a new pixel // should be drawn on the display for (uint8_t move = 0; move < 2; move++) { extruder_move(move == 0 ? tryload_length : -tryload_length, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE); 1e620: 83 2d mov r24, r3 1e622: 98 2d mov r25, r8 1e624: a9 2d mov r26, r9 1e626: be 2d mov r27, r14 1e628: bc 01 movw r22, r24 1e62a: cd 01 movw r24, r26 bool filament_inserted = true; // expect success // Pixel index will go from 0 to 10, then back from 10 to 0 // The change in this number is used to indicate a new pixel // should be drawn on the display for (uint8_t move = 0; move < 2; move++) { 1e62c: 91 2c mov r9, r1 1e62e: 31 2c mov r3, r1 1e630: e1 2c mov r14, r1 extruder_move(move == 0 ? tryload_length : -tryload_length, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE); 1e632: 5b 01 movw r10, r22 1e634: 6c 01 movw r12, r24 1e636: d7 fa bst r13, 7 1e638: d0 94 com r13 1e63a: d7 f8 bld r13, 7 1e63c: d0 94 com r13 1e63e: 20 e0 ldi r18, 0x00 ; 0 1e640: 30 e0 ldi r19, 0x00 ; 0 1e642: 48 e4 ldi r20, 0x48 ; 72 1e644: 52 e4 ldi r21, 0x42 ; 66 1e646: 0f 94 02 87 call 0x30e04 ; 0x30e04 1e64a: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 1e64e: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 while (planner_any_moves()) { 1e652: 98 17 cp r25, r24 1e654: 09 f4 brne .+2 ; 0x1e658 1e656: 49 c0 rjmp .+146 ; 0x1e6ea filament_inserted = filament_inserted && (WhereIsFilament() == FilamentState::AT_FSENSOR); 1e658: 11 23 and r17, r17 1e65a: 31 f0 breq .+12 ; 0x1e668 1e65c: 0f 94 36 87 call 0x30e6c ; 0x30e6c 1e660: 11 e0 ldi r17, 0x01 ; 1 1e662: 81 30 cpi r24, 0x01 ; 1 1e664: 09 f0 breq .+2 ; 0x1e668 1e666: 10 e0 ldi r17, 0x00 ; 0 float planner_get_machine_position_E_mm() { return current_position[E_AXIS]; } float stepper_get_machine_position_E_mm() { return st_get_position_mm(E_AXIS); 1e668: 83 e0 ldi r24, 0x03 ; 3 1e66a: 0f 94 2e 22 call 0x2445c ; 0x2445c if (!lcd_update_enabled) lcdui_print_status_line(); } void TryLoadUnloadReporter::Progress(bool sensorState){ // Always round up, you can only have 'whole' pixels. (floor is also an option) dpixel1 = ceil((stepper_get_machine_position_E_mm() - planner_get_current_position_E()) * pixel_per_mm); 1e66e: 20 91 01 12 lds r18, 0x1201 ; 0x801201 1e672: 30 91 02 12 lds r19, 0x1202 ; 0x801202 1e676: 40 91 03 12 lds r20, 0x1203 ; 0x801203 1e67a: 50 91 04 12 lds r21, 0x1204 ; 0x801204 1e67e: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1e682: a3 01 movw r20, r6 1e684: 92 01 movw r18, r4 1e686: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1e68a: 0f 94 e2 a1 call 0x343c4 ; 0x343c4 1e68e: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 1e692: 86 2e mov r8, r22 if (dpixel1 - dpixel0) { 1e694: e6 16 cp r14, r22 1e696: c1 f0 breq .+48 ; 0x1e6c8 1e698: e3 2d mov r30, r3 1e69a: e4 31 cpi r30, 0x14 ; 20 1e69c: 08 f0 brcs .+2 ; 0x1e6a0 1e69e: e3 e1 ldi r30, 0x13 ; 19 dpixel0 = dpixel1; if (lcd_cursor_col > (LCD_WIDTH - 1)) lcd_cursor_col = LCD_WIDTH - 1; Render(lcd_cursor_col++, sensorState); 1e6a0: 33 24 eor r3, r3 1e6a2: 33 94 inc r3 1e6a4: 3e 0e add r3, r30 } void TryLoadUnloadReporter::Render(uint8_t col, bool sensorState) { // Set the cursor position each time in case some other // part of the firmware changes the cursor position lcd_insert_char_into_status(col, sensorState ? LCD_STR_SOLID_BLOCK[0] : '-'); 1e6a6: 8f ef ldi r24, 0xFF ; 255 1e6a8: 11 11 cpse r17, r1 1e6aa: 01 c0 rjmp .+2 ; 0x1e6ae 1e6ac: 8d e2 ldi r24, 0x2D ; 45 } void lcd_insert_char_into_status(uint8_t position, const char message) { if (position > LCD_WIDTH - 1) return; lcd_status_message[position] = message; 1e6ae: f0 e0 ldi r31, 0x00 ; 0 1e6b0: e7 5f subi r30, 0xF7 ; 247 1e6b2: fa 4f sbci r31, 0xFA ; 250 1e6b4: 80 83 st Z, r24 lcd_draw_update = 1; // force redraw 1e6b6: 91 e0 ldi r25, 0x01 ; 1 1e6b8: 90 93 5b 02 sts 0x025B, r25 ; 0x80025b if (!lcd_update_enabled) lcdui_print_status_line(); 1e6bc: 80 91 5c 02 lds r24, 0x025C ; 0x80025c 1e6c0: 81 11 cpse r24, r1 1e6c2: 02 c0 rjmp .+4 ; 0x1e6c8 1e6c4: 0f 94 25 10 call 0x2204a ; 0x2204a void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 1e6c8: 90 e0 ldi r25, 0x00 ; 0 1e6ca: 80 e0 ldi r24, 0x00 ; 0 1e6cc: 0e 94 48 7c call 0xf890 ; 0xf890 } void TryLoadUnloadReporter::Progress(bool sensorState){ // Always round up, you can only have 'whole' pixels. (floor is also an option) dpixel1 = ceil((stepper_get_machine_position_E_mm() - planner_get_current_position_E()) * pixel_per_mm); 1e6d0: e8 2c mov r14, r8 tlur.Progress(filament_inserted); safe_delay_keep_alive(0); if (planner_draining()) { 1e6d2: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 1e6d6: 88 23 and r24, r24 1e6d8: 09 f4 brne .+2 ; 0x1e6dc 1e6da: b7 cf rjmp .-146 ; 0x1e64a return false; // power panic or a similar issue happened, bail out fast 1e6dc: 10 e0 ldi r17, 0x00 ; 0 1e6de: 37 c0 rjmp .+110 ; 0x1e74e bool filament_inserted = true; // expect success // Pixel index will go from 0 to 10, then back from 10 to 0 // The change in this number is used to indicate a new pixel // should be drawn on the display for (uint8_t move = 0; move < 2; move++) { extruder_move(move == 0 ? tryload_length : -tryload_length, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE); 1e6e0: c6 01 movw r24, r12 1e6e2: b5 01 movw r22, r10 1e6e4: 99 24 eor r9, r9 1e6e6: 93 94 inc r9 1e6e8: aa cf rjmp .-172 ; 0x1e63e bool filament_inserted = true; // expect success // Pixel index will go from 0 to 10, then back from 10 to 0 // The change in this number is used to indicate a new pixel // should be drawn on the display for (uint8_t move = 0; move < 2; move++) { 1e6ea: 91 e0 ldi r25, 0x01 ; 1 1e6ec: 99 12 cpse r9, r25 1e6ee: f8 cf rjmp .-16 ; 0x1e6e0 return false; // power panic or a similar issue happened, bail out fast } } } Disable_E0(); 1e6f0: 0f 94 00 87 call 0x30e00 ; 0x30e00 if (!filament_inserted) { 1e6f4: 11 11 cpse r17, r1 1e6f6: 08 c0 rjmp .+16 ; 0x1e708 eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); } void IncrementLoadFails(){ eeprom_increment_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL); 1e6f8: 8f ec ldi r24, 0xCF ; 207 1e6fa: 9e e0 ldi r25, 0x0E ; 14 1e6fc: 0e 94 0c 6f call 0xde18 ; 0xde18 eeprom_increment_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT); 1e700: 80 ed ldi r24, 0xD0 ; 208 1e702: 9e e0 ldi r25, 0x0E ; 14 1e704: 0e 94 ff 6e call 0xddfe ; 0xddfe memset(lcd_status_message, 0, sizeof(lcd_status_message)); lcd_status_message_idx = 0; } void lcd_getstatus(char buf[LCD_WIDTH]) { strncpy(buf, lcd_status_message, LCD_WIDTH); 1e708: 44 e1 ldi r20, 0x14 ; 20 1e70a: 50 e0 ldi r21, 0x00 ; 0 1e70c: 69 e0 ldi r22, 0x09 ; 9 1e70e: 75 e0 ldi r23, 0x05 ; 5 1e710: ce 01 movw r24, r28 1e712: 01 96 adiw r24, 0x01 ; 1 1e714: 0f 94 5c a6 call 0x34cb8 ; 0x34cb8 1e718: fe 01 movw r30, r28 1e71a: 31 96 adiw r30, 0x01 ; 1 char buf[LCD_WIDTH + 1]; lcd_getstatus(buf); for (uint8_t i = 0; i < sizeof(buf); i++) { // 0xFF is -1 when converting from unsigned to signed char // If the number is negative, that means filament is present buf[i] = (buf[i] < 0) ? '1' : '0'; 1e71c: 81 91 ld r24, Z+ 1e71e: 87 fd sbrc r24, 7 1e720: 2c c0 rjmp .+88 ; 0x1e77a 1e722: 80 e3 ldi r24, 0x30 ; 48 1e724: df 01 movw r26, r30 1e726: 11 97 sbiw r26, 0x01 ; 1 1e728: 8c 93 st X, r24 } void TryLoadUnloadReporter::DumpToSerial(){ char buf[LCD_WIDTH + 1]; lcd_getstatus(buf); for (uint8_t i = 0; i < sizeof(buf); i++) { 1e72a: 8e 89 ldd r24, Y+22 ; 0x16 1e72c: 9f 89 ldd r25, Y+23 ; 0x17 1e72e: 8e 17 cp r24, r30 1e730: 9f 07 cpc r25, r31 1e732: a1 f7 brne .-24 ; 0x1e71c // 0xFF is -1 when converting from unsigned to signed char // If the number is negative, that means filament is present buf[i] = (buf[i] < 0) ? '1' : '0'; } buf[LCD_WIDTH] = 0; 1e734: 1d 8a std Y+21, r1 ; 0x15 MMU2_ECHO_MSGLN(buf); 1e736: 81 e6 ldi r24, 0x61 ; 97 1e738: 9d e9 ldi r25, 0x9D ; 157 1e73a: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 1e73e: 8a eb ldi r24, 0xBA ; 186 1e740: 96 e8 ldi r25, 0x86 ; 134 1e742: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 1e746: ce 01 movw r24, r28 1e748: 01 96 adiw r24, 0x01 ; 1 1e74a: 0f 94 fd 98 call 0x331fa ; 0x331fa SERIAL_ECHOLN(message); } void lcd_reset_status_message_timeout() { lcd_status_message_timeout.start(); 1e74e: 8e e1 ldi r24, 0x1E ; 30 1e750: 95 e0 ldi r25, 0x05 ; 5 1e752: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> UnloadInner(); // if we run out of retries, we must do something ... may be raise an error screen and allow the user to do something // but honestly - if the MMU restarts during every toolchange, // something else is seriously broken and stopping a print is probably our best option. } if (VerifyFilamentEnteredPTFE()) { 1e756: 11 23 and r17, r17 1e758: 09 f4 brne .+2 ; 0x1e75c 1e75a: 0c cf rjmp .-488 ; 0x1e574 // If manage_response returns false at this spot (MMU operation interrupted aka MMU reset) // we can safely continue because the MMU is not doing an operation now. static_cast(manage_response(true, true)); // yes, I'd like to silence [[nodiscard]] warning at this spot by casting to void } SetCurrentTool(slot); // filament change is finished 1e75c: 80 2f mov r24, r16 1e75e: 0f 94 b2 41 call 0x28364 ; 0x28364 } } void SpoolJoin::setSlot(uint8_t slot) { currentMMUSlot = slot; 1e762: 00 93 23 12 sts 0x1223, r16 ; 0x801223 SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; 1e766: 80 91 98 12 lds r24, 0x1298 ; 0x801298 1e76a: 90 91 99 12 lds r25, 0x1299 ; 0x801299 1e76e: 01 96 adiw r24, 0x01 ; 1 1e770: 90 93 99 12 sts 0x1299, r25 ; 0x801299 1e774: 80 93 98 12 sts 0x1298, r24 ; 0x801298 1e778: 13 cf rjmp .-474 ; 0x1e5a0 char buf[LCD_WIDTH + 1]; lcd_getstatus(buf); for (uint8_t i = 0; i < sizeof(buf); i++) { // 0xFF is -1 when converting from unsigned to signed char // If the number is negative, that means filament is present buf[i] = (buf[i] < 0) ? '1' : '0'; 1e77a: 81 e3 ldi r24, 0x31 ; 49 1e77c: d3 cf rjmp .-90 ; 0x1e724 void SetInAutoRetry(bool iar) { inAutoRetry = iar; } inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; 1e77e: 8a e2 ldi r24, 0x2A ; 42 1e780: 90 e8 ldi r25, 0x80 ; 128 1e782: 90 93 26 12 sts 0x1226, r25 ; 0x801226 1e786: 80 93 25 12 sts 0x1225, r24 ; 0x801225 logic.SetPrinterError(ErrorCode::LOAD_TO_EXTRUDER_FAILED); // We only have to wait for the user to fix the issue and press "Retry". // Please see CheckUserInput() for details how we "leave" manage_response. // If manage_response returns false at this spot (MMU operation interrupted aka MMU reset) // we can safely continue because the MMU is not doing an operation now. static_cast(manage_response(true, true)); // yes, I'd like to silence [[nodiscard]] warning at this spot by casting to void 1e78a: 61 e0 ldi r22, 0x01 ; 1 1e78c: 81 e0 ldi r24, 0x01 ; 1 1e78e: 0f 94 c8 69 call 0x2d390 ; 0x2d390 1e792: c7 ce rjmp .-626 ; 0x1e522 0001e794 : SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } bool MMU2::tool_change(uint8_t slot) { 1e794: cf 93 push r28 1e796: df 93 push r29 1e798: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 1e79a: 0f 94 b4 53 call 0x2a768 ; 0x2a768 1e79e: c8 2f mov r28, r24 1e7a0: 88 23 and r24, r24 1e7a2: d9 f0 breq .+54 ; 0x1e7da return false; } if (slot != extruder) { 1e7a4: 80 91 7b 12 lds r24, 0x127B ; 0x80127b 1e7a8: 8d 17 cp r24, r29 1e7aa: b9 f0 breq .+46 ; 0x1e7da current_position[Y_AXIS] = MMU_ERR_Y_PAUSE_POS; planner_line_to_current_position_sync(NOZZLE_PARK_XY_FEEDRATE); } bool marlin_printingIsActive() { return printer_active(); 1e7ac: 0e 94 19 61 call 0xc232 ; 0xc232 if (/*FindaDetectsFilament()*/ 1e7b0: 81 11 cpse r24, r1 1e7b2: 02 c0 rjmp .+4 ; 0x1e7b8 /*!IS_SD_PRINTING && !usb_timer.running()*/ !marlin_printingIsActive()) { // If Tcodes are used manually through the serial // we need to unload manually as well -- but only if FINDA detects filament unload(); 1e7b4: 0f 94 93 6a call 0x2d526 ; 0x2d526 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 1e7b8: 0f 94 80 53 call 0x2a700 ; 0x2a700 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1e7bc: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1e7c0: 10 92 85 16 sts 0x1685, r1 ; 0x801685 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 1e7c4: 0f 94 42 22 call 0x24484 ; 0x24484 } ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); 1e7c8: 8d 2f mov r24, r29 1e7ca: 0e 94 72 f2 call 0x1e4e4 ; 0x1e4e4 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 1e7ce: 84 e8 ldi r24, 0x84 ; 132 1e7d0: 96 e1 ldi r25, 0x16 ; 22 1e7d2: 0e 94 f0 6d call 0xdbe0 ; 0xdbe0 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 1e7d6: 0f 94 a9 53 call 0x2a752 ; 0x2a752 FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); } return true; } 1e7da: 8c 2f mov r24, r28 1e7dc: df 91 pop r29 1e7de: cf 91 pop r28 1e7e0: 08 95 ret 0001e7e2 : { (void)lcd_selftest(); } bool lcd_selftest() { 1e7e2: cf 92 push r12 1e7e4: df 92 push r13 1e7e6: ef 92 push r14 1e7e8: ff 92 push r15 1e7ea: 0f 93 push r16 1e7ec: 1f 93 push r17 1e7ee: cf 93 push r28 1e7f0: df 93 push r29 1e7f2: 00 d0 rcall .+0 ; 0x1e7f4 1e7f4: 1f 92 push r1 1e7f6: cd b7 in r28, 0x3d ; 61 1e7f8: de b7 in r29, 0x3e ; 62 lcd_printf_P(PSTR("%3d/%3d"), (int16_t)degHotend(active_extruder), (int16_t) degTargetHotend(active_extruder)); lcd_putc(LCD_STR_DEGREE[0]); } void lcd_wait_for_cool_down() { disable_heater(); 1e7fa: 0f 94 5f 12 call 0x224be ; 0x224be uint8_t fanSpeedBckp = fanSpeed; 1e7fe: d0 90 e9 11 lds r13, 0x11E9 ; 0x8011e9 fanSpeed = 255; 1e802: 8f ef ldi r24, 0xFF ; 255 1e804: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 while ((degHotend(0)>MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) { lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP)); lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); lcd_printf_P(PSTR("%3d/0"), (int16_t)degHotend(0)); 1e808: 89 ee ldi r24, 0xE9 ; 233 1e80a: e8 2e mov r14, r24 1e80c: 82 e8 ldi r24, 0x82 ; 130 1e80e: f8 2e mov r15, r24 lcd_putc(LCD_STR_DEGREE[0]); lcd_putc_at(9, 4, LCD_STR_BEDTEMP[0]); lcd_printf_P(PSTR("%3d/0"), (int16_t)degBed()); 1e810: 03 ee ldi r16, 0xE3 ; 227 1e812: 12 e8 ldi r17, 0x82 ; 130 void lcd_wait_for_cool_down() { disable_heater(); uint8_t fanSpeedBckp = fanSpeed; fanSpeed = 255; while ((degHotend(0)>MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) { 1e814: 20 e0 ldi r18, 0x00 ; 0 1e816: 30 e0 ldi r19, 0x00 ; 0 1e818: 48 e4 ldi r20, 0x48 ; 72 1e81a: 52 e4 ldi r21, 0x42 ; 66 1e81c: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 1e820: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 1e824: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 1e828: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 1e82c: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 1e830: 18 16 cp r1, r24 1e832: 8c f0 brlt .+34 ; 0x1e856 1e834: 20 e0 ldi r18, 0x00 ; 0 1e836: 30 e0 ldi r19, 0x00 ; 0 1e838: 48 e4 ldi r20, 0x48 ; 72 1e83a: 52 e4 ldi r21, 0x42 ; 66 1e83c: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 1e840: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 1e844: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 1e848: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 1e84c: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 1e850: 18 16 cp r1, r24 1e852: 0c f0 brlt .+2 ; 0x1e856 1e854: 42 c0 rjmp .+132 ; 0x1e8da lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP)); 1e856: 8f ef ldi r24, 0xFF ; 255 1e858: 9d e3 ldi r25, 0x3D ; 61 1e85a: 0e 94 b1 6c call 0xd962 ; 0xd962 1e85e: 0f 94 c0 0a call 0x21580 ; 0x21580 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 1e862: 42 e8 ldi r20, 0x82 ; 130 1e864: 64 e0 ldi r22, 0x04 ; 4 1e866: 80 e0 ldi r24, 0x00 ; 0 1e868: 0e 94 9b 69 call 0xd336 ; 0xd336 lcd_printf_P(PSTR("%3d/0"), (int16_t)degHotend(0)); 1e86c: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 1e870: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 1e874: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 1e878: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 1e87c: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 1e880: 7f 93 push r23 1e882: 6f 93 push r22 1e884: ff 92 push r15 1e886: ef 92 push r14 1e888: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 lcd_putc(LCD_STR_DEGREE[0]); 1e88c: 81 e8 ldi r24, 0x81 ; 129 1e88e: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 lcd_putc_at(9, 4, LCD_STR_BEDTEMP[0]); 1e892: 40 e8 ldi r20, 0x80 ; 128 1e894: 64 e0 ldi r22, 0x04 ; 4 1e896: 89 e0 ldi r24, 0x09 ; 9 1e898: 0e 94 9b 69 call 0xd336 ; 0xd336 lcd_printf_P(PSTR("%3d/0"), (int16_t)degBed()); 1e89c: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 1e8a0: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 1e8a4: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 1e8a8: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 1e8ac: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 1e8b0: 7f 93 push r23 1e8b2: 6f 93 push r22 1e8b4: 1f 93 push r17 1e8b6: 0f 93 push r16 1e8b8: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 lcd_putc(LCD_STR_DEGREE[0]); 1e8bc: 81 e8 ldi r24, 0x81 ; 129 1e8be: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 delay_keep_alive(1000); 1e8c2: 88 ee ldi r24, 0xE8 ; 232 1e8c4: 93 e0 ldi r25, 0x03 ; 3 1e8c6: 0e 94 48 7c call 0xf890 ; 0xf890 serialecho_temperatures(); 1e8ca: 0e 94 68 70 call 0xe0d0 ; 0xe0d0 1e8ce: 0f b6 in r0, 0x3f ; 63 1e8d0: f8 94 cli 1e8d2: de bf out 0x3e, r29 ; 62 1e8d4: 0f be out 0x3f, r0 ; 63 1e8d6: cd bf out 0x3d, r28 ; 61 1e8d8: 9d cf rjmp .-198 ; 0x1e814 } fanSpeed = fanSpeedBckp; 1e8da: d0 92 e9 11 sts 0x11E9, r13 ; 0x8011e9 lcd_update_enable(true); 1e8de: 81 e0 ldi r24, 0x01 ; 1 1e8e0: 0e 94 c0 69 call 0xd380 ; 0xd380 lcd_detect_IRsensor(); } } #endif lcd_wait_for_cool_down(); lcd_clear(); 1e8e4: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_START)); 1e8e8: 85 e4 ldi r24, 0x45 ; 69 1e8ea: 9e e3 ldi r25, 0x3E ; 62 1e8ec: 0e 94 b1 6c call 0xd962 ; 0xd962 1e8f0: ac 01 movw r20, r24 1e8f2: 60 e0 ldi r22, 0x00 ; 0 1e8f4: 80 e0 ldi r24, 0x00 ; 0 1e8f6: 0e 94 8f 69 call 0xd31e ; 0xd31e #ifdef TMC2130 FORCE_HIGH_POWER_START; #endif // TMC2130 FORCE_BL_ON_START; _delay(2000); 1e8fa: 60 ed ldi r22, 0xD0 ; 208 1e8fc: 77 e0 ldi r23, 0x07 ; 7 1e8fe: 80 e0 ldi r24, 0x00 ; 0 1e900: 90 e0 ldi r25, 0x00 ; 0 1e902: 0f 94 7b 0d call 0x21af6 ; 0x21af6 KEEPALIVE_STATE(IN_HANDLER); 1e906: 82 e0 ldi r24, 0x02 ; 2 1e908: 80 93 78 02 sts 0x0278, r24 ; 0x800278 _progress = lcd_selftest_screen(TestScreen::ExtruderFan, _progress, 3, true, 2000); 1e90c: 00 ed ldi r16, 0xD0 ; 208 1e90e: 17 e0 ldi r17, 0x07 ; 7 1e910: 21 e0 ldi r18, 0x01 ; 1 1e912: 43 e0 ldi r20, 0x03 ; 3 1e914: 60 e0 ldi r22, 0x00 ; 0 1e916: 80 e0 ldi r24, 0x00 ; 0 1e918: 0e 94 38 b9 call 0x17270 ; 0x17270 1e91c: f8 2e mov r15, r24 // speed threshold to mark a fan as failed static const int failThr = FANCHECK_AUTO_FAIL_THRS; // < FANCHECK_AUTO_FAIL_THRS RPM would mean either a faulty Noctua, Altfan or print fan switch (_fan) { case 0: setExtruderAutoFanState(3); // hotend fan 1e91e: 83 e0 ldi r24, 0x03 ; 3 1e920: 0e 94 3f 6e call 0xdc7e ; 0xdc7e } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1e924: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1e928: 10 92 05 05 sts 0x0505, r1 ; 0x800505 #endif manage_heater(); 1e92c: 0f 94 5b 32 call 0x264b6 ; 0x264b6 // spin-up delay static char symbols[] = {'-', '|'}; static_assert(1000 / sizeof(symbols) * sizeof(symbols) == 1000); while(delay--) { for(uint8_t i = 0; i != sizeof(symbols); ++i) { lcd_putc_at(col, row, symbols[i]); 1e930: 4d e2 ldi r20, 0x2D ; 45 1e932: 62 e0 ldi r22, 0x02 ; 2 1e934: 82 e1 ldi r24, 0x12 ; 18 1e936: 0e 94 9b 69 call 0xd336 ; 0xd336 delay_keep_alive(1000 / sizeof(symbols)); 1e93a: 84 ef ldi r24, 0xF4 ; 244 1e93c: 91 e0 ldi r25, 0x01 ; 1 1e93e: 0e 94 48 7c call 0xf890 ; 0xf890 // spin-up delay static char symbols[] = {'-', '|'}; static_assert(1000 / sizeof(symbols) * sizeof(symbols) == 1000); while(delay--) { for(uint8_t i = 0; i != sizeof(symbols); ++i) { lcd_putc_at(col, row, symbols[i]); 1e942: 4c e7 ldi r20, 0x7C ; 124 1e944: 62 e0 ldi r22, 0x02 ; 2 1e946: 82 e1 ldi r24, 0x12 ; 18 1e948: 0e 94 9b 69 call 0xd336 ; 0xd336 delay_keep_alive(1000 / sizeof(symbols)); 1e94c: 84 ef ldi r24, 0xF4 ; 244 1e94e: 91 e0 ldi r25, 0x01 ; 1 1e950: 0e 94 48 7c call 0xf890 ; 0xf890 // spin-up delay static char symbols[] = {'-', '|'}; static_assert(1000 / sizeof(symbols) * sizeof(symbols) == 1000); while(delay--) { for(uint8_t i = 0; i != sizeof(symbols); ++i) { lcd_putc_at(col, row, symbols[i]); 1e954: 4d e2 ldi r20, 0x2D ; 45 1e956: 62 e0 ldi r22, 0x02 ; 2 1e958: 82 e1 ldi r24, 0x12 ; 18 1e95a: 0e 94 9b 69 call 0xd336 ; 0xd336 delay_keep_alive(1000 / sizeof(symbols)); 1e95e: 84 ef ldi r24, 0xF4 ; 244 1e960: 91 e0 ldi r25, 0x01 ; 1 1e962: 0e 94 48 7c call 0xf890 ; 0xf890 // spin-up delay static char symbols[] = {'-', '|'}; static_assert(1000 / sizeof(symbols) * sizeof(symbols) == 1000); while(delay--) { for(uint8_t i = 0; i != sizeof(symbols); ++i) { lcd_putc_at(col, row, symbols[i]); 1e966: 4c e7 ldi r20, 0x7C ; 124 1e968: 62 e0 ldi r22, 0x02 ; 2 1e96a: 82 e1 ldi r24, 0x12 ; 18 1e96c: 0e 94 9b 69 call 0xd336 ; 0xd336 delay_keep_alive(1000 / sizeof(symbols)); 1e970: 84 ef ldi r24, 0xF4 ; 244 1e972: 91 e0 ldi r25, 0x01 ; 1 1e974: 0e 94 48 7c call 0xf890 ; 0xf890 } } #ifdef FANCHECK extruder_autofan_last_check = _millis(); 1e978: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 1e97c: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d 1e980: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e 1e984: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f 1e988: 90 93 90 16 sts 0x1690, r25 ; 0x801690 #endif fan_measuring = true; 1e98c: 81 e0 ldi r24, 0x01 ; 1 1e98e: 80 93 84 03 sts 0x0384, r24 ; 0x800384 while(fan_measuring) { 1e992: 80 91 84 03 lds r24, 0x0384 ; 0x800384 1e996: 88 23 and r24, r24 1e998: 29 f0 breq .+10 ; 0x1e9a4 delay_keep_alive(100); 1e99a: 84 e6 ldi r24, 0x64 ; 100 1e99c: 90 e0 ldi r25, 0x00 ; 0 1e99e: 0e 94 48 7c call 0xf890 ; 0xf890 1e9a2: f7 cf rjmp .-18 ; 0x1e992 } gcode_M123(); 1e9a4: 0e 94 9d 5f call 0xbf3a ; 0xbf3a switch (_fan) { case 0: setExtruderAutoFanState(3); // hotend fan lcd_selftest_setfan(0); // print fan off lcd_selftest_measure_fans(2, 18, 2); setExtruderAutoFanState(0); // hotend fan off 1e9a8: 80 e0 ldi r24, 0x00 ; 0 1e9aa: 0e 94 3f 6e call 0xdc7e ; 0xdc7e if (fan_speed[0] < failThr) { 1e9ae: c0 90 85 03 lds r12, 0x0385 ; 0x800385 1e9b2: d0 90 86 03 lds r13, 0x0386 ; 0x800386 1e9b6: 94 e1 ldi r25, 0x14 ; 20 1e9b8: c9 16 cp r12, r25 1e9ba: d1 04 cpc r13, r1 1e9bc: 54 f1 brlt .+84 ; 0x1ea12 lcd_selftest_error(TestError::ExtruderFan, "", ""); } if (_result) { _progress = lcd_selftest_screen(TestScreen::PrintFan, _progress, 3, true, 2000); 1e9be: 00 ed ldi r16, 0xD0 ; 208 1e9c0: 17 e0 ldi r17, 0x07 ; 7 1e9c2: 21 e0 ldi r18, 0x01 ; 1 1e9c4: 43 e0 ldi r20, 0x03 ; 3 1e9c6: 6f 2d mov r22, r15 1e9c8: 81 e0 ldi r24, 0x01 ; 1 1e9ca: 0e 94 38 b9 call 0x17270 ; 0x17270 1e9ce: f8 2e mov r15, r24 default: _result = false; break; } #else //defined(TACH_1) _result = lcd_selftest_manual_fan_check(1, false); 1e9d0: 60 e0 ldi r22, 0x00 ; 0 1e9d2: 80 e0 ldi r24, 0x00 ; 0 1e9d4: 0e 94 a5 b1 call 0x1634a ; 0x1634a #endif //defined(TACH_1) if (!_result) 1e9d8: 81 11 cpse r24, r1 1e9da: 3a c0 rjmp .+116 ; 0x1ea50 { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning 1e9dc: 4a ed ldi r20, 0xDA ; 218 1e9de: 52 e0 ldi r21, 0x02 ; 2 1e9e0: ba 01 movw r22, r20 1e9e2: 85 e0 ldi r24, 0x05 ; 5 1e9e4: 0e 94 30 e2 call 0x1c460 ; 0x1c460 } } if (_swapped_fan) { 1e9e8: 86 e4 ldi r24, 0x46 ; 70 1e9ea: c8 16 cp r12, r24 1e9ec: d1 04 cpc r13, r1 1e9ee: bc f0 brlt .+46 ; 0x1ea1e //turn on print fan and check that left hotend fan is not spinning _result = lcd_selftest_manual_fan_check(1, true); 1e9f0: 60 e0 ldi r22, 0x00 ; 0 1e9f2: 81 e0 ldi r24, 0x01 ; 1 1e9f4: 0e 94 a5 b1 call 0x1634a ; 0x1634a if (_result) { 1e9f8: 88 23 and r24, r24 1e9fa: d9 f0 breq .+54 ; 0x1ea32 //print fan is stil turned on; check that it is spinning _result = lcd_selftest_manual_fan_check(1, false, true); 1e9fc: 61 e0 ldi r22, 0x01 ; 1 1e9fe: 80 e0 ldi r24, 0x00 ; 0 1ea00: 0e 94 a5 b1 call 0x1634a ; 0x1634a if (!_result){ 1ea04: 81 11 cpse r24, r1 1ea06: 28 c0 rjmp .+80 ; 0x1ea58 lcd_selftest_error(TestError::PrintFan, "", ""); 1ea08: 4a ed ldi r20, 0xDA ; 218 1ea0a: 52 e0 ldi r21, 0x02 ; 2 1ea0c: ba 01 movw r22, r20 1ea0e: 85 e0 ldi r24, 0x05 ; 5 1ea10: 04 c0 rjmp .+8 ; 0x1ea1a #else //defined(TACH_0) _result = lcd_selftest_manual_fan_check(0, false); #endif //defined(TACH_0) if (!_result) { lcd_selftest_error(TestError::ExtruderFan, "", ""); 1ea12: 4a ed ldi r20, 0xDA ; 218 1ea14: 52 e0 ldi r21, 0x02 ; 2 1ea16: ba 01 movw r22, r20 1ea18: 86 e0 ldi r24, 0x06 ; 6 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1ea1a: 0e 94 30 e2 call 0x1c460 ; 0x1c460 { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct } else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); 1ea1e: 08 e8 ldi r16, 0x88 ; 136 1ea20: 13 e1 ldi r17, 0x13 ; 19 1ea22: 21 e0 ldi r18, 0x01 ; 1 1ea24: 43 e0 ldi r20, 0x03 ; 3 1ea26: 6f 2d mov r22, r15 1ea28: 8d e0 ldi r24, 0x0D ; 13 1ea2a: 0e 94 38 b9 call 0x17270 ; 0x17270 1ea2e: e1 2c mov r14, r1 1ea30: 88 c1 rjmp .+784 ; 0x1ed42 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1ea32: 4a ed ldi r20, 0xDA ; 218 1ea34: 52 e0 ldi r21, 0x02 ; 2 1ea36: ba 01 movw r22, r20 1ea38: 89 e0 ldi r24, 0x09 ; 9 1ea3a: ef cf rjmp .-34 ; 0x1ea1a #endif //not defined TMC2130 static bool lcd_selfcheck_endstops() { bool _result = true; 1ea3c: 11 e0 ldi r17, 0x01 ; 1 1ea3e: 96 c0 rjmp .+300 ; 0x1eb6c lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); lcd_return_to_status(); } else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 1ea40: 87 e6 ldi r24, 0x67 ; 103 1ea42: 9f e3 ldi r25, 0x3F ; 63 1ea44: 0e 94 b1 6c call 0xd962 ; 0xd962 1ea48: 62 e0 ldi r22, 0x02 ; 2 1ea4a: 0e 94 01 e2 call 0x1c402 ; 0x1c402 1ea4e: 91 c1 rjmp .+802 ; 0x1ed72 { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning } } if (_swapped_fan) { 1ea50: 96 e4 ldi r25, 0x46 ; 70 1ea52: c9 16 cp r12, r25 1ea54: d1 04 cpc r13, r1 1ea56: 64 f6 brge .-104 ; 0x1e9f0 } } if (_result) { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); 1ea58: 00 ed ldi r16, 0xD0 ; 208 1ea5a: 17 e0 ldi r17, 0x07 ; 7 1ea5c: 21 e0 ldi r18, 0x01 ; 1 1ea5e: 43 e0 ldi r20, 0x03 ; 3 1ea60: 6f 2d mov r22, r15 1ea62: 82 e0 ldi r24, 0x02 ; 2 1ea64: 0e 94 38 b9 call 0x17270 ; 0x17270 1ea68: f8 2e mov r15, r24 bool _result = true; if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1ea6a: 1e 99 sbic 0x03, 6 ; 3 1ea6c: 04 c0 rjmp .+8 ; 0x1ea76 { bool _result = true; if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1ea6e: 1d 99 sbic 0x03, 5 ; 3 1ea70: 02 c0 rjmp .+4 ; 0x1ea76 ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1ea72: 1c 9b sbis 0x03, 4 ; 3 1ea74: 48 c0 rjmp .+144 ; 0x1eb06 #endif //!TMC2130 ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1)) { #ifndef TMC2130 if ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) current_position[0] += 10; 1ea76: 1e 9b sbis 0x03, 6 ; 3 1ea78: 16 c0 rjmp .+44 ; 0x1eaa6 1ea7a: 20 e0 ldi r18, 0x00 ; 0 1ea7c: 30 e0 ldi r19, 0x00 ; 0 1ea7e: 40 e2 ldi r20, 0x20 ; 32 1ea80: 51 e4 ldi r21, 0x41 ; 65 1ea82: 60 91 f5 11 lds r22, 0x11F5 ; 0x8011f5 1ea86: 70 91 f6 11 lds r23, 0x11F6 ; 0x8011f6 1ea8a: 80 91 f7 11 lds r24, 0x11F7 ; 0x8011f7 1ea8e: 90 91 f8 11 lds r25, 0x11F8 ; 0x8011f8 1ea92: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1ea96: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 1ea9a: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 1ea9e: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 1eaa2: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) current_position[1] += 10; 1eaa6: 1d 9b sbis 0x03, 5 ; 3 1eaa8: 16 c0 rjmp .+44 ; 0x1ead6 1eaaa: 20 e0 ldi r18, 0x00 ; 0 1eaac: 30 e0 ldi r19, 0x00 ; 0 1eaae: 40 e2 ldi r20, 0x20 ; 32 1eab0: 51 e4 ldi r21, 0x41 ; 65 1eab2: 60 91 f9 11 lds r22, 0x11F9 ; 0x8011f9 1eab6: 70 91 fa 11 lds r23, 0x11FA ; 0x8011fa 1eaba: 80 91 fb 11 lds r24, 0x11FB ; 0x8011fb 1eabe: 90 91 fc 11 lds r25, 0x11FC ; 0x8011fc 1eac2: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1eac6: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 1eaca: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 1eace: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 1ead2: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc #endif //!TMC2130 if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) current_position[2] += 10; 1ead6: 1c 9b sbis 0x03, 4 ; 3 1ead8: 16 c0 rjmp .+44 ; 0x1eb06 1eada: 20 e0 ldi r18, 0x00 ; 0 1eadc: 30 e0 ldi r19, 0x00 ; 0 1eade: 40 e2 ldi r20, 0x20 ; 32 1eae0: 51 e4 ldi r21, 0x41 ; 65 1eae2: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 1eae6: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 1eaea: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 1eaee: 90 91 00 12 lds r25, 0x1200 ; 0x801200 1eaf2: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1eaf6: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 1eafa: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 1eafe: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 1eb02: 90 93 00 12 sts 0x1200, r25 ; 0x801200 } plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1eb06: 60 e0 ldi r22, 0x00 ; 0 1eb08: 70 e0 ldi r23, 0x00 ; 0 1eb0a: 84 e3 ldi r24, 0x34 ; 52 1eb0c: 92 e4 ldi r25, 0x42 ; 66 1eb0e: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 1eb12: 0f 94 42 22 call 0x24484 ; 0x24484 if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1eb16: 1e 99 sbic 0x03, 6 ; 3 1eb18: 04 c0 rjmp .+8 ; 0x1eb22 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); st_synchronize(); if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1eb1a: 1d 99 sbic 0x03, 5 ; 3 1eb1c: 02 c0 rjmp .+4 ; 0x1eb22 ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1eb1e: 1c 9b sbis 0x03, 4 ; 3 1eb20: 8d cf rjmp .-230 ; 0x1ea3c #endif //!TMC2130 ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1)) { _result = false; char _error[4] = ""; 1eb22: 1a 82 std Y+2, r1 ; 0x02 1eb24: 19 82 std Y+1, r1 ; 0x01 1eb26: 1c 82 std Y+4, r1 ; 0x04 1eb28: 1b 82 std Y+3, r1 ; 0x03 #ifndef TMC2130 if ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "X"); 1eb2a: 1e 9b sbis 0x03, 6 ; 3 1eb2c: 06 c0 rjmp .+12 ; 0x1eb3a 1eb2e: 6b ed ldi r22, 0xDB ; 219 1eb30: 72 e0 ldi r23, 0x02 ; 2 1eb32: ce 01 movw r24, r28 1eb34: 01 96 adiw r24, 0x01 ; 1 1eb36: 0f 94 28 a6 call 0x34c50 ; 0x34c50 if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Y"); 1eb3a: 1d 9b sbis 0x03, 5 ; 3 1eb3c: 06 c0 rjmp .+12 ; 0x1eb4a 1eb3e: 6d ed ldi r22, 0xDD ; 221 1eb40: 72 e0 ldi r23, 0x02 ; 2 1eb42: ce 01 movw r24, r28 1eb44: 01 96 adiw r24, 0x01 ; 1 1eb46: 0f 94 28 a6 call 0x34c50 ; 0x34c50 #endif //!TMC2130 if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Z"); 1eb4a: 1c 9b sbis 0x03, 4 ; 3 1eb4c: 06 c0 rjmp .+12 ; 0x1eb5a 1eb4e: 6f ed ldi r22, 0xDF ; 223 1eb50: 72 e0 ldi r23, 0x02 ; 2 1eb52: ce 01 movw r24, r28 1eb54: 01 96 adiw r24, 0x01 ; 1 1eb56: 0f 94 28 a6 call 0x34c50 ; 0x34c50 lcd_selftest_error(TestError::Endstops, _error, ""); 1eb5a: 4a ed ldi r20, 0xDA ; 218 1eb5c: 52 e0 ldi r21, 0x02 ; 2 1eb5e: be 01 movw r22, r28 1eb60: 6f 5f subi r22, 0xFF ; 255 1eb62: 7f 4f sbci r23, 0xFF ; 255 1eb64: 82 e0 ldi r24, 0x02 ; 2 1eb66: 0e 94 30 e2 call 0x1c460 ; 0x1c460 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || #endif //!TMC2130 ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1)) { _result = false; 1eb6a: 10 e0 ldi r17, 0x00 ; 0 if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Y"); #endif //!TMC2130 if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Z"); lcd_selftest_error(TestError::Endstops, _error, ""); } manage_heater(); 1eb6c: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(true); 1eb70: 81 e0 ldi r24, 0x01 ; 1 1eb72: 0e 94 01 7a call 0xf402 ; 0xf402 { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); _result = lcd_selfcheck_endstops(); //With TMC2130, only the Z probe is tested. } if (_result) 1eb76: 11 23 and r17, r17 1eb78: 09 f4 brne .+2 ; 0x1eb7c 1eb7a: 51 cf rjmp .-350 ; 0x1ea1e { //current_position[Z_AXIS] += 15; //move Z axis higher to avoid false triggering of Z end stop in case that we are very low - just above heatbed _progress = lcd_selftest_screen(TestScreen::AxisX, _progress, 3, true, 2000); 1eb7c: 00 ed ldi r16, 0xD0 ; 208 1eb7e: 17 e0 ldi r17, 0x07 ; 7 1eb80: 21 e0 ldi r18, 0x01 ; 1 1eb82: 43 e0 ldi r20, 0x03 ; 3 1eb84: 6f 2d mov r22, r15 1eb86: 84 e0 ldi r24, 0x04 ; 4 1eb88: 0e 94 38 b9 call 0x17270 ; 0x17270 1eb8c: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(X_AXIS); #else _result = lcd_selfcheck_axis(X_AXIS, X_MAX_POS); 1eb8e: 6a ef ldi r22, 0xFA ; 250 1eb90: 70 e0 ldi r23, 0x00 ; 0 1eb92: 90 e0 ldi r25, 0x00 ; 0 1eb94: 80 e0 ldi r24, 0x00 ; 0 1eb96: 0e 94 13 e5 call 0x1ca26 ; 0x1ca26 } if (_result) 1eb9a: 88 23 and r24, r24 1eb9c: 09 f4 brne .+2 ; 0x1eba0 1eb9e: 3f cf rjmp .-386 ; 0x1ea1e { _progress = lcd_selftest_screen(TestScreen::AxisX, _progress, 3, true, 0); 1eba0: 10 e0 ldi r17, 0x00 ; 0 1eba2: 00 e0 ldi r16, 0x00 ; 0 1eba4: 21 e0 ldi r18, 0x01 ; 1 1eba6: 43 e0 ldi r20, 0x03 ; 3 1eba8: 6f 2d mov r22, r15 1ebaa: 84 e0 ldi r24, 0x04 ; 4 1ebac: 0e 94 38 b9 call 0x17270 ; 0x17270 1ebb0: f8 2e mov r15, r24 #ifndef TMC2130 _result = lcd_selfcheck_pulleys(X_AXIS); 1ebb2: 90 e0 ldi r25, 0x00 ; 0 1ebb4: 80 e0 ldi r24, 0x00 ; 0 1ebb6: 0e 94 10 e4 call 0x1c820 ; 0x1c820 #endif } if (_result) 1ebba: 88 23 and r24, r24 1ebbc: 09 f4 brne .+2 ; 0x1ebc0 1ebbe: 2f cf rjmp .-418 ; 0x1ea1e { _progress = lcd_selftest_screen(TestScreen::AxisY, _progress, 3, true, 1500); 1ebc0: 0c ed ldi r16, 0xDC ; 220 1ebc2: 15 e0 ldi r17, 0x05 ; 5 1ebc4: 21 e0 ldi r18, 0x01 ; 1 1ebc6: 43 e0 ldi r20, 0x03 ; 3 1ebc8: 6f 2d mov r22, r15 1ebca: 85 e0 ldi r24, 0x05 ; 5 1ebcc: 0e 94 38 b9 call 0x17270 ; 0x17270 1ebd0: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(Y_AXIS); #else _result = lcd_selfcheck_axis(Y_AXIS, Y_MAX_POS); 1ebd2: 62 ed ldi r22, 0xD2 ; 210 1ebd4: 70 e0 ldi r23, 0x00 ; 0 1ebd6: 81 e0 ldi r24, 0x01 ; 1 1ebd8: 90 e0 ldi r25, 0x00 ; 0 1ebda: 0e 94 13 e5 call 0x1ca26 ; 0x1ca26 #endif // TMC2130 } if (_result) 1ebde: 88 23 and r24, r24 1ebe0: 09 f4 brne .+2 ; 0x1ebe4 1ebe2: 1d cf rjmp .-454 ; 0x1ea1e { _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 0); 1ebe4: 10 e0 ldi r17, 0x00 ; 0 1ebe6: 00 e0 ldi r16, 0x00 ; 0 1ebe8: 21 e0 ldi r18, 0x01 ; 1 1ebea: 43 e0 ldi r20, 0x03 ; 3 1ebec: 6f 2d mov r22, r15 1ebee: 86 e0 ldi r24, 0x06 ; 6 1ebf0: 0e 94 38 b9 call 0x17270 ; 0x17270 1ebf4: f8 2e mov r15, r24 #ifndef TMC2130 _result = lcd_selfcheck_pulleys(Y_AXIS); 1ebf6: 81 e0 ldi r24, 0x01 ; 1 1ebf8: 90 e0 ldi r25, 0x00 ; 0 1ebfa: 0e 94 10 e4 call 0x1c820 ; 0x1c820 #endif // TMC2130 } if (_result) 1ebfe: 88 23 and r24, r24 1ec00: 09 f4 brne .+2 ; 0x1ec04 1ec02: 0d cf rjmp .-486 ; 0x1ea1e enable_endstops(false); #endif //homeaxis(X_AXIS); //homeaxis(Y_AXIS); current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 1ec04: ec e4 ldi r30, 0x4C ; 76 1ec06: f8 e8 ldi r31, 0x88 ; 136 1ec08: 85 91 lpm r24, Z+ 1ec0a: 95 91 lpm r25, Z+ 1ec0c: a5 91 lpm r26, Z+ 1ec0e: b4 91 lpm r27, Z 1ec10: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 1ec14: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 1ec18: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 1ec1c: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4+1); 1ec20: e0 e5 ldi r30, 0x50 ; 80 1ec22: f8 e8 ldi r31, 0x88 ; 136 1ec24: 85 91 lpm r24, Z+ 1ec26: 95 91 lpm r25, Z+ 1ec28: a5 91 lpm r26, Z+ 1ec2a: b4 91 lpm r27, Z 1ec2c: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 1ec30: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 1ec34: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 1ec38: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc #ifdef TMC2130 //current_position[X_AXIS] += 0; current_position[Y_AXIS] += 4; #endif //TMC2130 raise_z(10); 1ec3c: 60 e0 ldi r22, 0x00 ; 0 1ec3e: 70 e0 ldi r23, 0x00 ; 0 1ec40: 80 e2 ldi r24, 0x20 ; 32 1ec42: 91 e4 ldi r25, 0x41 ; 65 1ec44: 0e 94 dd 66 call 0xcdba ; 0xcdba set_destination_to_current(); 1ec48: 0e 94 36 61 call 0xc26c ; 0xc26c _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 1500); 1ec4c: 0c ed ldi r16, 0xDC ; 220 1ec4e: 15 e0 ldi r17, 0x05 ; 5 1ec50: 21 e0 ldi r18, 0x01 ; 1 1ec52: 43 e0 ldi r20, 0x03 ; 3 1ec54: 6f 2d mov r22, r15 1ec56: 86 e0 ldi r24, 0x06 ; 6 1ec58: 0e 94 38 b9 call 0x17270 ; 0x17270 1ec5c: f8 2e mov r15, r24 #ifdef TMC2130 homeaxis(Z_AXIS); //In case of failure, the code gets stuck in this function. #else _result = lcd_selfcheck_axis(Z_AXIS, Z_MAX_POS); 1ec5e: 62 ed ldi r22, 0xD2 ; 210 1ec60: 70 e0 ldi r23, 0x00 ; 0 1ec62: 82 e0 ldi r24, 0x02 ; 2 1ec64: 90 e0 ldi r25, 0x00 ; 0 1ec66: 0e 94 13 e5 call 0x1ca26 ; 0x1ca26 1ec6a: 18 2f mov r17, r24 #endif //TMC2130 //raise Z to not damage the bed during and hotend testing raise_z(20); 1ec6c: 60 e0 ldi r22, 0x00 ; 0 1ec6e: 70 e0 ldi r23, 0x00 ; 0 1ec70: 80 ea ldi r24, 0xA0 ; 160 1ec72: 91 e4 ldi r25, 0x41 ; 65 1ec74: 0e 94 dd 66 call 0xcdba ; 0xcdba eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_ENABLED, 1); _result = bres; } #endif //TMC2130 if (_result) 1ec78: 11 23 and r17, r17 1ec7a: 09 f4 brne .+2 ; 0x1ec7e 1ec7c: d0 ce rjmp .-608 ; 0x1ea1e { _progress = lcd_selftest_screen(TestScreen::Bed, _progress, 3, true, 2000); 1ec7e: 00 ed ldi r16, 0xD0 ; 208 1ec80: 17 e0 ldi r17, 0x07 ; 7 1ec82: 21 e0 ldi r18, 0x01 ; 1 1ec84: 43 e0 ldi r20, 0x03 ; 3 1ec86: 6f 2d mov r22, r15 1ec88: 87 e0 ldi r24, 0x07 ; 7 1ec8a: 0e 94 38 b9 call 0x17270 ; 0x17270 1ec8e: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(true); 1ec90: 81 e0 ldi r24, 0x01 ; 1 1ec92: 0e 94 1a e3 call 0x1c634 ; 0x1c634 } if (_result) 1ec96: 88 23 and r24, r24 1ec98: 09 f4 brne .+2 ; 0x1ec9c 1ec9a: c1 ce rjmp .-638 ; 0x1ea1e { _progress = lcd_selftest_screen(TestScreen::Hotend, _progress, 3, true, 1000); 1ec9c: 08 ee ldi r16, 0xE8 ; 232 1ec9e: 13 e0 ldi r17, 0x03 ; 3 1eca0: 21 e0 ldi r18, 0x01 ; 1 1eca2: 43 e0 ldi r20, 0x03 ; 3 1eca4: 6f 2d mov r22, r15 1eca6: 88 e0 ldi r24, 0x08 ; 8 1eca8: 0e 94 38 b9 call 0x17270 ; 0x17270 1ecac: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(false); 1ecae: 80 e0 ldi r24, 0x00 ; 0 1ecb0: 0e 94 1a e3 call 0x1c634 ; 0x1c634 1ecb4: e8 2e mov r14, r24 } if (_result) 1ecb6: 88 23 and r24, r24 1ecb8: 09 f4 brne .+2 ; 0x1ecbc 1ecba: b1 ce rjmp .-670 ; 0x1ea1e { _progress = lcd_selftest_screen(TestScreen::HotendOk, _progress, 3, true, 2000); //nozzle ok 1ecbc: 00 ed ldi r16, 0xD0 ; 208 1ecbe: 17 e0 ldi r17, 0x07 ; 7 1ecc0: 21 e0 ldi r18, 0x01 ; 1 1ecc2: 43 e0 ldi r20, 0x03 ; 3 1ecc4: 6f 2d mov r22, r15 1ecc6: 89 e0 ldi r24, 0x09 ; 9 1ecc8: 0e 94 38 b9 call 0x17270 ; 0x17270 } #ifdef FILAMENT_SENSOR if (_result) { #if (FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) if (MMU2::mmu2.Enabled()) 1eccc: 90 91 94 12 lds r25, 0x1294 ; 0x801294 1ecd0: 91 30 cpi r25, 0x01 ; 1 1ecd2: 79 f5 brne .+94 ; 0x1ed32 { _progress = lcd_selftest_screen(TestScreen::Fsensor, _progress, 3, true, 2000); //check filaments sensor 1ecd4: 21 e0 ldi r18, 0x01 ; 1 1ecd6: 43 e0 ldi r20, 0x03 ; 3 1ecd8: 68 2f mov r22, r24 1ecda: 8a e0 ldi r24, 0x0A ; 10 1ecdc: 0e 94 38 b9 call 0x17270 ; 0x17270 1ece0: f8 2e mov r15, r24 //! @retval true passed //! @retval false failed static bool selftest_irsensor() { // Ask user which slot to load filament from uint8_t slot = choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT); 1ece2: 84 e2 ldi r24, 0x24 ; 36 1ece4: 9e e3 ldi r25, 0x3E ; 62 1ece6: 0e 94 b1 6c call 0xd962 ; 0xd962 1ecea: 70 e0 ldi r23, 0x00 ; 0 1ecec: 60 e0 ldi r22, 0x00 ; 0 1ecee: 0e 94 ea bc call 0x179d4 ; 0x179d4 1ecf2: d8 2e mov r13, r24 // Render self-test screen lcd_selftest_screen(TestScreen::Fsensor, 0, 1, true, 0); 1ecf4: 10 e0 ldi r17, 0x00 ; 0 1ecf6: 00 e0 ldi r16, 0x00 ; 0 1ecf8: 21 e0 ldi r18, 0x01 ; 1 1ecfa: 41 e0 ldi r20, 0x01 ; 1 1ecfc: 60 e0 ldi r22, 0x00 ; 0 1ecfe: 8a e0 ldi r24, 0x0A ; 10 1ed00: 0e 94 38 b9 call 0x17270 ; 0x17270 } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 1ed04: 10 92 58 02 sts 0x0258, r1 ; 0x800258 1ed08: 10 92 57 02 sts 0x0257, r1 ; 0x800257 // Run self-test set_extrude_min_temp(0); MMU2::mmu2.tool_change(slot); 1ed0c: 8d 2d mov r24, r13 1ed0e: 0e 94 ca f3 call 0x1e794 ; 0x1e794 MMU2::mmu2.unload(); //Unload filament 1ed12: 0f 94 93 6a call 0x2d526 ; 0x2d526 1ed16: 8f ea ldi r24, 0xAF ; 175 1ed18: 90 e0 ldi r25, 0x00 ; 0 1ed1a: 90 93 58 02 sts 0x0258, r25 ; 0x800258 1ed1e: 80 93 57 02 sts 0x0257, r24 ; 0x800257 { _progress = lcd_selftest_screen(TestScreen::Fsensor, _progress, 3, true, 2000); //check filaments sensor _result = selftest_irsensor(); if (_result) { _progress = lcd_selftest_screen(TestScreen::FsensorOk, _progress, 3, true, 2000); //fil sensor OK 1ed22: 00 ed ldi r16, 0xD0 ; 208 1ed24: 17 e0 ldi r17, 0x07 ; 7 1ed26: 21 e0 ldi r18, 0x01 ; 1 1ed28: 43 e0 ldi r20, 0x03 ; 3 1ed2a: 6f 2d mov r22, r15 1ed2c: 8b e0 ldi r24, 0x0B ; 11 1ed2e: 0e 94 38 b9 call 0x17270 ; 0x17270 } } #endif //FILAMENT_SENSOR if (_result) { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct 1ed32: 08 e8 ldi r16, 0x88 ; 136 1ed34: 13 e1 ldi r17, 0x13 ; 19 1ed36: 21 e0 ldi r18, 0x01 ; 1 1ed38: 43 e0 ldi r20, 0x03 ; 3 1ed3a: 68 2f mov r22, r24 1ed3c: 8c e0 ldi r24, 0x0C ; 12 1ed3e: 0e 94 38 b9 call 0x17270 ; 0x17270 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1ed42: 10 92 8e 03 sts 0x038E, r1 ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.408> else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); } lcd_reset_alert_level(); enquecommand_P(MSG_M84); 1ed46: 61 e0 ldi r22, 0x01 ; 1 1ed48: 8f ec ldi r24, 0xCF ; 207 1ed4a: 97 e6 ldi r25, 0x67 ; 103 1ed4c: 0e 94 af 7c call 0xf95e ; 0xf95e lcd_update_enable(true); 1ed50: 81 e0 ldi r24, 0x01 ; 1 1ed52: 0e 94 c0 69 call 0xd380 ; 0xd380 if (_result) 1ed56: ee 20 and r14, r14 1ed58: 09 f4 brne .+2 ; 0x1ed5c 1ed5a: 72 ce rjmp .-796 ; 0x1ea40 { calibration_status_set(CALIBRATION_STATUS_SELFTEST); 1ed5c: 81 e0 ldi r24, 0x01 ; 1 1ed5e: 0e 94 86 c6 call 0x18d0c ; 0x18d0c lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); 1ed62: 87 e3 ldi r24, 0x37 ; 55 1ed64: 9e e3 ldi r25, 0x3E ; 62 1ed66: 0e 94 b1 6c call 0xd962 ; 0xd962 1ed6a: 0e 94 65 e6 call 0x1ccca ; 0x1ccca lcd_return_to_status(); 1ed6e: 0e 94 17 fe call 0x1fc2e ; 0x1fc2e FORCE_HIGH_POWER_END; #endif // TMC2130 FORCE_BL_ON_END; KEEPALIVE_STATE(NOT_BUSY); 1ed72: 81 e0 ldi r24, 0x01 ; 1 1ed74: 80 93 78 02 sts 0x0278, r24 ; 0x800278 return(_result); } 1ed78: 8e 2d mov r24, r14 1ed7a: 0f 90 pop r0 1ed7c: 0f 90 pop r0 1ed7e: 0f 90 pop r0 1ed80: 0f 90 pop r0 1ed82: df 91 pop r29 1ed84: cf 91 pop r28 1ed86: 1f 91 pop r17 1ed88: 0f 91 pop r16 1ed8a: ff 90 pop r15 1ed8c: ef 90 pop r14 1ed8e: df 90 pop r13 1ed90: cf 90 pop r12 1ed92: 08 95 ret 0001ed94 : } #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) static void lcd_selftest_v() { (void)lcd_selftest(); 1ed94: 0c 94 f1 f3 jmp 0x1e7e2 ; 0x1e7e2 0001ed98 : // Clear the filament action clearFilamentAction(); } static inline void loading_test_wrapper(uint8_t i){ 1ed98: cf 93 push r28 1ed9a: c8 2f mov r28, r24 void FullScreenMsgEject(uint8_t slot){ FullScreenMsg(_T(MSG_EJECT_FROM_MMU), slot); } void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); 1ed9c: 83 e8 ldi r24, 0x83 ; 131 1ed9e: 9b e3 ldi r25, 0x3B ; 59 1eda0: 0e 94 b1 6c call 0xd962 ; 0xd962 1eda4: 6c 2f mov r22, r28 1eda6: 0f 94 38 86 call 0x30c70 ; 0x30c70 return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 1edaa: 8c 2f mov r24, r28 1edac: 0e 94 ca f3 call 0x1e794 ; 0x1e794 1edb0: 0f 94 42 22 call 0x24484 ; 0x24484 planner_synchronize(); unload(); 1edb4: 0f 94 93 6a call 0x2d526 ; 0x2d526 ScreenUpdateEnable(); 1edb8: 0f 94 35 86 call 0x30c6a ; 0x30c6a MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); } 1edbc: cf 91 pop r28 static inline void loading_test_wrapper(uint8_t i){ MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); 1edbe: 0d 94 2f 0c jmp 0x2185e ; 0x2185e 0001edc2 : static void mmu_cut_filament_menu() { mmu_common_choose_filament_menu(_T(MSG_CUT_FILAMENT), mmu_cut_filament_wrapper); } #endif //MMU_HAS_CUTTER static inline void loading_test_all_wrapper(){ 1edc2: cf 93 push r28 for(uint8_t i = 0; i < MMU_FILAMENT_COUNT; ++i){ 1edc4: c0 e0 ldi r28, 0x00 ; 0 1edc6: 83 e8 ldi r24, 0x83 ; 131 1edc8: 9b e3 ldi r25, 0x3B ; 59 1edca: 0e 94 b1 6c call 0xd962 ; 0xd962 1edce: 6c 2f mov r22, r28 1edd0: 0f 94 38 86 call 0x30c70 ; 0x30c70 return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 1edd4: 8c 2f mov r24, r28 1edd6: 0e 94 ca f3 call 0x1e794 ; 0x1e794 1edda: 0f 94 42 22 call 0x24484 ; 0x24484 planner_synchronize(); unload(); 1edde: 0f 94 93 6a call 0x2d526 ; 0x2d526 ScreenUpdateEnable(); 1ede2: 0f 94 35 86 call 0x30c6a ; 0x30c6a 1ede6: cf 5f subi r28, 0xFF ; 255 1ede8: c5 30 cpi r28, 0x05 ; 5 1edea: 69 f7 brne .-38 ; 0x1edc6 MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); } 1edec: cf 91 pop r28 for(uint8_t i = 0; i < MMU_FILAMENT_COUNT; ++i){ MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); 1edee: 0d 94 2f 0c jmp 0x2185e ; 0x2185e 0001edf2 : } ScreenUpdateEnable(); return true; } bool MMU2::load_filament_to_nozzle(uint8_t slot) { 1edf2: cf 93 push r28 1edf4: df 93 push r29 1edf6: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 1edf8: 0f 94 b4 53 call 0x2a768 ; 0x2a768 1edfc: c8 2f mov r28, r24 1edfe: 88 23 and r24, r24 1ee00: 69 f1 breq .+90 ; 0x1ee5c safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 1ee02: 88 ec ldi r24, 0xC8 ; 200 1ee04: 90 e0 ldi r25, 0x00 ; 0 1ee06: 0f 94 7f 8a call 0x314fe ; 0x314fe (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.356]> bool cutter_enabled(){ return eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) == EEPROM_MMU_CUTTER_ENABLED_enabled; } void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); 1ee0a: 82 e0 ldi r24, 0x02 ; 2 1ee0c: 0f 94 9f 2c call 0x2593e ; 0x2593e void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 1ee10: 82 e0 ldi r24, 0x02 ; 2 1ee12: 9a e5 ldi r25, 0x5A ; 90 1ee14: 0e 94 b1 6c call 0xd962 ; 0xd962 1ee18: 6d 2f mov r22, r29 1ee1a: 0f 94 38 86 call 0x30c70 ; 0x30c70 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 1ee1e: 0f 94 80 53 call 0x2a700 ; 0x2a700 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1ee22: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1ee26: 10 92 85 16 sts 0x1685, r1 ; 0x801685 { // used for MMU-menu operation "Load to Nozzle" ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly 1ee2a: 80 91 7b 12 lds r24, 0x127B ; 0x80127b 1ee2e: 83 36 cpi r24, 0x63 ; 99 1ee30: 29 f0 breq .+10 ; 0x1ee3c return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 1ee32: 62 e1 ldi r22, 0x12 ; 18 1ee34: 83 ef ldi r24, 0xF3 ; 243 1ee36: 98 e9 ldi r25, 0x98 ; 152 1ee38: 0f 94 8b 53 call 0x2a716 ; 0x2a716 if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly filament_ramming(); } ToolChangeCommon(slot); 1ee3c: 8d 2f mov r24, r29 1ee3e: 0e 94 72 f2 call 0x1e4e4 ; 0x1e4e4 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); 1ee42: 0e 94 3a b2 call 0x16474 ; 0x16474 bool cutter_enabled(){ return eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) == EEPROM_MMU_CUTTER_ENABLED_enabled; } void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); 1ee46: 83 e0 ldi r24, 0x03 ; 3 1ee48: 0f 94 9f 2c call 0x2593e ; 0x2593e #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 1ee4c: 84 e8 ldi r24, 0x84 ; 132 1ee4e: 96 e1 ldi r25, 0x16 ; 22 1ee50: 0e 94 f0 6d call 0xdbe0 ; 0xdbe0 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 1ee54: 0f 94 a9 53 call 0x2a752 ; 0x2a752 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); MakeSound(Confirm); } ScreenUpdateEnable(); 1ee58: 0f 94 35 86 call 0x30c6a ; 0x30c6a return true; } 1ee5c: 8c 2f mov r24, r28 1ee5e: df 91 pop r29 1ee60: cf 91 pop r28 1ee62: 08 95 ret 0001ee64 : /// Handle special T?/Tx/Tc commands /// ///- T? Gcode to extrude shouldn't have to follow, load to extruder wheels is done automatically ///- Tx Same as T?, except nozzle doesn't have to be preheated. Tc must be placed after extruder nozzle is preheated to finish filament load. ///- Tc Load to nozzle after filament was prepared by Tx and extruder nozzle is already heated. bool MMU2::tool_change(char code, uint8_t slot) { 1ee64: 1f 93 push r17 1ee66: cf 93 push r28 1ee68: df 93 push r29 1ee6a: c8 2f mov r28, r24 1ee6c: 16 2f mov r17, r22 if (!WaitForMMUReady()) { 1ee6e: 0f 94 b4 53 call 0x2a768 ; 0x2a768 1ee72: d8 2f mov r29, r24 1ee74: 88 23 and r24, r24 1ee76: a9 f0 breq .+42 ; 0x1eea2 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1ee78: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1ee7c: 10 92 85 16 sts 0x1685, r1 ; 0x801685 return false; } FSensorBlockRunout blockRunout; switch (code) { 1ee80: c3 36 cpi r28, 0x63 ; 99 1ee82: 11 f1 breq .+68 ; 0x1eec8 1ee84: c8 37 cpi r28, 0x78 ; 120 1ee86: 91 f0 breq .+36 ; 0x1eeac 1ee88: cf 33 cpi r28, 0x3F ; 63 1ee8a: 39 f4 brne .+14 ; 0x1ee9a case '?': { waitForHotendTargetTemp(100, [] {}); 1ee8c: 84 e6 ldi r24, 0x64 ; 100 1ee8e: 90 e0 ldi r25, 0x00 ; 0 1ee90: 0f 94 7f 8a call 0x314fe ; 0x314fe (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.356]> load_filament_to_nozzle(slot); 1ee94: 81 2f mov r24, r17 1ee96: 0e 94 f9 f6 call 0x1edf2 ; 0x1edf2 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 1ee9a: 84 e8 ldi r24, 0x84 ; 132 1ee9c: 96 e1 ldi r25, 0x16 ; 22 1ee9e: 0e 94 f0 6d call 0xdbe0 ; 0xdbe0 execute_load_to_nozzle_sequence(); } break; } return true; } 1eea2: 8d 2f mov r24, r29 1eea4: df 91 pop r29 1eea6: cf 91 pop r28 1eea8: 1f 91 pop r17 1eeaa: 08 95 ret 1eeac: 10 92 58 02 sts 0x0258, r1 ; 0x800258 1eeb0: 10 92 57 02 sts 0x0257, r1 ; 0x800257 load_filament_to_nozzle(slot); } break; case 'x': { thermal_setExtrudeMintemp(0); // Allow cold extrusion since Tx only loads to the gears not nozzle tool_change(slot); 1eeb4: 81 2f mov r24, r17 1eeb6: 0e 94 ca f3 call 0x1e794 ; 0x1e794 1eeba: 8f ea ldi r24, 0xAF ; 175 1eebc: 90 e0 ldi r25, 0x00 ; 0 1eebe: 90 93 58 02 sts 0x0258, r25 ; 0x800258 1eec2: 80 93 57 02 sts 0x0257, r24 ; 0x800257 1eec6: e9 cf rjmp .-46 ; 0x1ee9a thermal_setExtrudeMintemp(EXTRUDE_MINTEMP); } break; case 'c': { waitForHotendTargetTemp(100, [] {}); 1eec8: 84 e6 ldi r24, 0x64 ; 100 1eeca: 90 e0 ldi r25, 0x00 ; 0 1eecc: 0f 94 7f 8a call 0x314fe ; 0x314fe (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.356]> execute_load_to_nozzle_sequence(); 1eed0: 0e 94 3a b2 call 0x16474 ; 0x16474 1eed4: e2 cf rjmp .-60 ; 0x1ee9a 0001eed6 : MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); MENU_END(); } static inline void lcd_mmu_load_to_nozzle_wrapper(uint8_t index){ MMU2::mmu2.load_filament_to_nozzle(index); 1eed6: 0e 94 f9 f6 call 0x1edf2 ; 0x1edf2 // Extrude a little bit of filament so the user // can see the color is correct load_filament_final_feed(); 1eeda: 0e 94 75 5e call 0xbcea ; 0xbcea st_synchronize(); 1eede: 0f 94 42 22 call 0x24484 ; 0x24484 // Ask user if the extruded color is correct: lcd_return_to_status(); 1eee2: 0e 94 17 fe call 0x1fc2e ; 0x1fc2e lcd_load_filament_color_check(); 1eee6: 0f 94 d2 2f call 0x25fa4 ; 0x25fa4 lcd_setstatuspgm(MSG_WELCOME); 1eeea: 87 e6 ldi r24, 0x67 ; 103 1eeec: 9b e6 ldi r25, 0x6B ; 107 1eeee: 0e 94 65 e6 call 0x1ccca ; 0x1ccca custom_message_type = CustomMsg::Status; 1eef2: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 // Clear the filament action clearFilamentAction(); 1eef6: 0d 94 2f 0c jmp 0x2185e ; 0x2185e 0001eefa : void MMU2::PowerOn() { power_on(); } bool MMU2::ReadRegister(uint8_t address) { 1eefa: 1f 93 push r17 1eefc: cf 93 push r28 1eefe: df 93 push r29 1ef00: 00 d0 rcall .+0 ; 0x1ef02 1ef02: 1f 92 push r1 1ef04: 1f 92 push r1 1ef06: cd b7 in r28, 0x3d ; 61 1ef08: de b7 in r29, 0x3e ; 62 1ef0a: 18 2f mov r17, r24 if (!WaitForMMUReady()) { 1ef0c: 0f 94 b4 53 call 0x2a768 ; 0x2a768 1ef10: 88 23 and r24, r24 1ef12: d9 f0 breq .+54 ; 0x1ef4a void ProtocolLogic::Home(uint8_t mode) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Home, mode)); } void ProtocolLogic::ReadRegister(uint8_t address) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Read, address)); 1ef14: 41 2f mov r20, r17 1ef16: 62 e5 ldi r22, 0x52 ; 82 1ef18: ce 01 movw r24, r28 1ef1a: 01 96 adiw r24, 0x01 ; 1 1ef1c: 0f 94 f3 86 call 0x30de6 ; 0x30de6 1ef20: 49 81 ldd r20, Y+1 ; 0x01 1ef22: 5a 81 ldd r21, Y+2 ; 0x02 1ef24: 6b 81 ldd r22, Y+3 ; 0x03 1ef26: 7c 81 ldd r23, Y+4 ; 0x04 1ef28: 8d 81 ldd r24, Y+5 ; 0x05 1ef2a: 0f 94 33 62 call 0x2c466 ; 0x2c466 return false; } do { logic.ReadRegister(address); // we may signal the accepted/rejected status of the response as return value of this function } while (!manage_response(false, false)); 1ef2e: 60 e0 ldi r22, 0x00 ; 0 1ef30: 80 e0 ldi r24, 0x00 ; 0 1ef32: 0f 94 c8 69 call 0x2d390 ; 0x2d390 1ef36: 88 23 and r24, r24 1ef38: 69 f3 breq .-38 ; 0x1ef14 // Update cached value lastReadRegisterValue = logic.rsp.paramValue; 1ef3a: 20 91 40 12 lds r18, 0x1240 ; 0x801240 1ef3e: 30 91 41 12 lds r19, 0x1241 ; 0x801241 1ef42: 30 93 91 12 sts 0x1291, r19 ; 0x801291 1ef46: 20 93 90 12 sts 0x1290, r18 ; 0x801290 return true; } 1ef4a: 0f 90 pop r0 1ef4c: 0f 90 pop r0 1ef4e: 0f 90 pop r0 1ef50: 0f 90 pop r0 1ef52: 0f 90 pop r0 1ef54: df 91 pop r29 1ef56: cf 91 pop r28 1ef58: 1f 91 pop r17 1ef5a: 08 95 ret 0001ef5c : case ClNozzleDiameter::_Diameter_800: MENU_ITEM_TOGGLE_P(_T(MSG_NOZZLE_DIAMETER), PSTR("0.80"), lcd_nozzle_diameter_cycle); break;\ }\ }\ while (0) static void lcd_check_update_RAM(ClCheckMode * oCheckSetting) { 1ef5c: fc 01 movw r30, r24 switch(*oCheckSetting) { 1ef5e: 80 81 ld r24, Z 1ef60: 88 23 and r24, r24 1ef62: 21 f0 breq .+8 ; 0x1ef6c 1ef64: 81 30 cpi r24, 0x01 ; 1 1ef66: 29 f4 brne .+10 ; 0x1ef72 case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 1ef68: 82 e0 ldi r24, 0x02 ; 2 1ef6a: 01 c0 rjmp .+2 ; 0x1ef6e while (0) static void lcd_check_update_RAM(ClCheckMode * oCheckSetting) { switch(*oCheckSetting) { case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; 1ef6c: 81 e0 ldi r24, 0x01 ; 1 break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 1ef6e: 80 83 st Z, r24 1ef70: 08 95 ret break; case ClCheckMode::_Strict: *oCheckSetting = ClCheckMode::_None; 1ef72: 10 82 st Z, r1 break; default: *oCheckSetting = ClCheckMode::_None; } } 1ef74: 08 95 ret 0001ef76 : #endif // TMC2130 static inline bool pgm_is_whitespace(const char *c_addr) { const char c = pgm_read_byte(c_addr); 1ef76: fc 01 movw r30, r24 1ef78: 94 91 lpm r25, Z return c == ' ' || c == '\t' || c == '\r' || c == '\n'; 1ef7a: 90 32 cpi r25, 0x20 ; 32 1ef7c: 49 f0 breq .+18 ; 0x1ef90 1ef7e: 87 ef ldi r24, 0xF7 ; 247 1ef80: 89 0f add r24, r25 1ef82: 82 30 cpi r24, 0x02 ; 2 1ef84: 28 f0 brcs .+10 ; 0x1ef90 1ef86: 81 e0 ldi r24, 0x01 ; 1 1ef88: 9d 30 cpi r25, 0x0D ; 13 1ef8a: 19 f0 breq .+6 ; 0x1ef92 1ef8c: 80 e0 ldi r24, 0x00 ; 0 1ef8e: 08 95 ret 1ef90: 81 e0 ldi r24, 0x01 ; 1 } 1ef92: 08 95 ret 0001ef94 : lcd_printf_P(PSTR("%-15.15S%-5d\n" "%-15.15S%-5d\n"), _T(MSG_HOTEND_FAN_SPEED), 60*fan_speed[0], _T(MSG_PRINT_FAN_SPEED), 60*fan_speed[1] ); menu_back_if_clicked(); } static uint16_t __attribute__((noinline)) clamp999(uint16_t v){ return v > 999 ? 999 : v; 1ef94: 88 3e cpi r24, 0xE8 ; 232 1ef96: 23 e0 ldi r18, 0x03 ; 3 1ef98: 92 07 cpc r25, r18 1ef9a: 10 f0 brcs .+4 ; 0x1efa0 1ef9c: 87 ee ldi r24, 0xE7 ; 231 1ef9e: 93 e0 ldi r25, 0x03 ; 3 } 1efa0: 08 95 ret 0001efa2 : return 0; } static int uart2_getchar(_UNUSED FILE *stream) { if (rbuf_empty(uart2_ibuf)) return -1; 1efa2: 90 91 b1 0d lds r25, 0x0DB1 ; 0x800db1 1efa6: 80 91 b0 0d lds r24, 0x0DB0 ; 0x800db0 1efaa: 2f ef ldi r18, 0xFF ; 255 1efac: 3f ef ldi r19, 0xFF ; 255 1efae: 89 17 cp r24, r25 1efb0: 71 f0 breq .+28 ; 0x1efce _lock(); //lock uint8_t buf_w = ptr[1]; //get write index uint8_t buf_r = ptr[2]; //get read index _unlock(); //unlock if (buf_r == buf_w) return -1; //return -1 to signal buffer empty int ret = ptr[4 + buf_r]; //get byte from buffer 1efb2: e9 2f mov r30, r25 1efb4: f0 e0 ldi r31, 0x00 ; 0 1efb6: ed 54 subi r30, 0x4D ; 77 1efb8: f2 4f sbci r31, 0xF2 ; 242 1efba: 20 81 ld r18, Z 1efbc: 30 e0 ldi r19, 0x00 ; 0 buf_r++; //increment read index 1efbe: 9f 5f subi r25, 0xFF ; 255 uint8_t buf_l = ptr[0]; //get length if (buf_r >= buf_l) buf_r = 0; //rotate read index 1efc0: 80 91 af 0d lds r24, 0x0DAF ; 0x800daf 1efc4: 98 17 cp r25, r24 1efc6: 08 f0 brcs .+2 ; 0x1efca 1efc8: 90 e0 ldi r25, 0x00 ; 0 ptr[2] = buf_r; //store read index 1efca: 90 93 b1 0d sts 0x0DB1, r25 ; 0x800db1 return rbuf_get(uart2_ibuf); } 1efce: c9 01 movw r24, r18 1efd0: 08 95 ret 0001efd2 : uint8_t uart2_ibuf[20] = {0, 0}; FILE _uart2io; static int uart2_putchar(char c, _UNUSED FILE *stream) { while (!uart2_txready); 1efd2: 90 91 d0 00 lds r25, 0x00D0 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7c20d0> 1efd6: 95 ff sbrs r25, 5 1efd8: fc cf rjmp .-8 ; 0x1efd2 UDR2 = c; // transmit byte 1efda: 80 93 d6 00 sts 0x00D6, r24 ; 0x8000d6 <__TEXT_REGION_LENGTH__+0x7c20d6> return 0; } 1efde: 90 e0 ldi r25, 0x00 ; 0 1efe0: 80 e0 ldi r24, 0x00 ; 0 1efe2: 08 95 ret 0001efe4 : } unsigned long micros2(void) { unsigned long m; uint8_t oldSREG = SREG, t; 1efe4: 3f b7 in r19, 0x3f ; 63 cli(); 1efe6: f8 94 cli m = timer2_overflow_count; 1efe8: 80 91 69 06 lds r24, 0x0669 ; 0x800669 1efec: 90 91 6a 06 lds r25, 0x066A ; 0x80066a 1eff0: a0 91 6b 06 lds r26, 0x066B ; 0x80066b 1eff4: b0 91 6c 06 lds r27, 0x066C ; 0x80066c #if defined(TCNT2) t = TCNT2; 1eff8: 20 91 b2 00 lds r18, 0x00B2 ; 0x8000b2 <__TEXT_REGION_LENGTH__+0x7c20b2> t = TCNT2L; #else #error TIMER 2 not defined #endif #ifdef TIFR2 if ((TIFR2 & _BV(TOV2)) && (t < 255)) 1effc: b8 9b sbis 0x17, 0 ; 23 1effe: 05 c0 rjmp .+10 ; 0x1f00a 1f000: 2f 3f cpi r18, 0xFF ; 255 1f002: 19 f0 breq .+6 ; 0x1f00a m++; 1f004: 01 96 adiw r24, 0x01 ; 1 1f006: a1 1d adc r26, r1 1f008: b1 1d adc r27, r1 #else if ((TIFR & _BV(TOV2)) && (t < 255)) m++; #endif SREG = oldSREG; 1f00a: 3f bf out 0x3f, r19 ; 63 return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond()); 1f00c: ba 2f mov r27, r26 1f00e: a9 2f mov r26, r25 1f010: 98 2f mov r25, r24 1f012: 88 27 eor r24, r24 1f014: bc 01 movw r22, r24 1f016: cd 01 movw r24, r26 1f018: 62 0f add r22, r18 1f01a: 71 1d adc r23, r1 1f01c: 81 1d adc r24, r1 1f01e: 91 1d adc r25, r1 1f020: 42 e0 ldi r20, 0x02 ; 2 1f022: 66 0f add r22, r22 1f024: 77 1f adc r23, r23 1f026: 88 1f adc r24, r24 1f028: 99 1f adc r25, r25 1f02a: 4a 95 dec r20 1f02c: d1 f7 brne .-12 ; 0x1f022 } 1f02e: 08 95 ret 0001f030 : #endif temp_meas_ready = true; } static void temp_mgr_pid() { 1f030: 2f 92 push r2 1f032: 3f 92 push r3 1f034: 4f 92 push r4 1f036: 5f 92 push r5 1f038: 6f 92 push r6 1f03a: 7f 92 push r7 1f03c: 8f 92 push r8 1f03e: 9f 92 push r9 1f040: af 92 push r10 1f042: bf 92 push r11 1f044: cf 92 push r12 1f046: df 92 push r13 1f048: ef 92 push r14 1f04a: ff 92 push r15 1f04c: 0f 93 push r16 1f04e: 1f 93 push r17 1f050: cf 93 push r28 1f052: df 93 push r29 1f054: cd b7 in r28, 0x3d ; 61 1f056: de b7 in r29, 0x3e ; 62 1f058: 2e 97 sbiw r28, 0x0e ; 14 1f05a: 0f b6 in r0, 0x3f ; 63 1f05c: f8 94 cli 1f05e: de bf out 0x3e, r29 ; 62 1f060: 0f be out 0x3f, r0 ; 63 1f062: cd bf out 0x3d, r28 ; 61 for(uint8_t e = 0; e < EXTRUDERS; e++) pid_heater(e, current_temperature_isr[e], target_temperature_isr[e]); 1f064: 20 90 5c 06 lds r2, 0x065C ; 0x80065c 1f068: 30 90 5d 06 lds r3, 0x065D ; 0x80065d 1f06c: 40 90 5e 06 lds r4, 0x065E ; 0x80065e 1f070: 50 90 5f 06 lds r5, 0x065F ; 0x80065f 1f074: 60 90 60 06 lds r6, 0x0660 ; 0x800660 1f078: 70 90 61 06 lds r7, 0x0661 ; 0x800661 #ifdef PIDTEMP pid_input = current; #ifndef PID_OPENLOOP if(target == 0) { 1f07c: 21 14 cp r2, r1 1f07e: 31 04 cpc r3, r1 1f080: 39 f4 brne .+14 ; 0x1f090 pid_output = 0; pid_reset[e] = true; 1f082: 81 e0 ldi r24, 0x01 ; 1 1f084: 80 93 35 06 sts 0x0635, r24 ; 0x800635 if (pid_output > PID_MAX) { if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration pid_output=PID_MAX; } else if (pid_output < 0) { if (pid_error[e] < 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration pid_output=0; 1f088: 81 2c mov r8, r1 1f08a: 91 2c mov r9, r1 1f08c: 54 01 movw r10, r8 1f08e: f9 c0 rjmp .+498 ; 0x1f282 #ifndef PID_OPENLOOP if(target == 0) { pid_output = 0; pid_reset[e] = true; } else { pid_error[e] = target - pid_input; 1f090: b1 01 movw r22, r2 1f092: 03 2c mov r0, r3 1f094: 00 0c add r0, r0 1f096: 88 0b sbc r24, r24 1f098: 99 0b sbc r25, r25 1f09a: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 1f09e: a3 01 movw r20, r6 1f0a0: 92 01 movw r18, r4 1f0a2: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1f0a6: 6b 01 movw r12, r22 1f0a8: 7c 01 movw r14, r24 if(pid_reset[e]) { 1f0aa: 80 91 35 06 lds r24, 0x0635 ; 0x800635 1f0ae: 88 23 and r24, r24 1f0b0: 91 f0 breq .+36 ; 0x1f0d6 iState_sum[e] = 0.0; 1f0b2: 10 92 31 06 sts 0x0631, r1 ; 0x800631 1f0b6: 10 92 32 06 sts 0x0632, r1 ; 0x800632 1f0ba: 10 92 33 06 sts 0x0633, r1 ; 0x800633 1f0be: 10 92 34 06 sts 0x0634, r1 ; 0x800634 dTerm[e] = 0.0; // 'dState_last[e]' initial setting is not necessary (see end of if-statement) 1f0c2: 10 92 2d 06 sts 0x062D, r1 ; 0x80062d 1f0c6: 10 92 2e 06 sts 0x062E, r1 ; 0x80062e 1f0ca: 10 92 2f 06 sts 0x062F, r1 ; 0x80062f 1f0ce: 10 92 30 06 sts 0x0630, r1 ; 0x800630 pid_reset[e] = false; 1f0d2: 10 92 35 06 sts 0x0635, r1 ; 0x800635 } #ifndef PonM pTerm[e] = cs.Kp * pid_error[e]; 1f0d6: 20 91 9a 04 lds r18, 0x049A ; 0x80049a 1f0da: 30 91 9b 04 lds r19, 0x049B ; 0x80049b 1f0de: 40 91 9c 04 lds r20, 0x049C ; 0x80049c 1f0e2: 50 91 9d 04 lds r21, 0x049D ; 0x80049d 1f0e6: c7 01 movw r24, r14 1f0e8: b6 01 movw r22, r12 1f0ea: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1f0ee: 69 83 std Y+1, r22 ; 0x01 1f0f0: 7a 83 std Y+2, r23 ; 0x02 1f0f2: 8b 83 std Y+3, r24 ; 0x03 1f0f4: 9c 83 std Y+4, r25 ; 0x04 iState_sum[e] += pid_error[e]; 1f0f6: 20 91 31 06 lds r18, 0x0631 ; 0x800631 1f0fa: 30 91 32 06 lds r19, 0x0632 ; 0x800632 1f0fe: 40 91 33 06 lds r20, 0x0633 ; 0x800633 1f102: 50 91 34 06 lds r21, 0x0634 ; 0x800634 1f106: c7 01 movw r24, r14 1f108: b6 01 movw r22, r12 1f10a: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1f10e: 4b 01 movw r8, r22 1f110: 5c 01 movw r10, r24 iState_sum[e] = constrain(iState_sum[e], iState_sum_min[e], iState_sum_max[e]); 1f112: 20 91 ea 03 lds r18, 0x03EA ; 0x8003ea <_ZL14iState_sum_min.lto_priv.431> 1f116: 2d 87 std Y+13, r18 ; 0x0d 1f118: 30 91 eb 03 lds r19, 0x03EB ; 0x8003eb <_ZL14iState_sum_min.lto_priv.431+0x1> 1f11c: 39 87 std Y+9, r19 ; 0x09 1f11e: 10 91 ec 03 lds r17, 0x03EC ; 0x8003ec <_ZL14iState_sum_min.lto_priv.431+0x2> 1f122: 00 91 ed 03 lds r16, 0x03ED ; 0x8003ed <_ZL14iState_sum_min.lto_priv.431+0x3> 1f126: 41 2f mov r20, r17 1f128: 50 2f mov r21, r16 1f12a: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1f12e: 87 fd sbrc r24, 7 1f130: 17 c0 rjmp .+46 ; 0x1f160 1f132: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 <_ZL14iState_sum_max.lto_priv.432> 1f136: 8d 87 std Y+13, r24 ; 0x0d 1f138: 90 91 e7 03 lds r25, 0x03E7 ; 0x8003e7 <_ZL14iState_sum_max.lto_priv.432+0x1> 1f13c: 99 87 std Y+9, r25 ; 0x09 1f13e: 10 91 e8 03 lds r17, 0x03E8 ; 0x8003e8 <_ZL14iState_sum_max.lto_priv.432+0x2> 1f142: 00 91 e9 03 lds r16, 0x03E9 ; 0x8003e9 <_ZL14iState_sum_max.lto_priv.432+0x3> 1f146: 9c 01 movw r18, r24 1f148: 41 2f mov r20, r17 1f14a: 50 2f mov r21, r16 1f14c: b4 01 movw r22, r8 1f14e: c5 01 movw r24, r10 1f150: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 1f154: 18 16 cp r1, r24 1f156: 24 f0 brlt .+8 ; 0x1f160 1f158: 8d 86 std Y+13, r8 ; 0x0d 1f15a: 99 86 std Y+9, r9 ; 0x09 1f15c: 1a 2d mov r17, r10 1f15e: 0b 2d mov r16, r11 1f160: 8d 85 ldd r24, Y+13 ; 0x0d 1f162: 99 85 ldd r25, Y+9 ; 0x09 1f164: a1 2f mov r26, r17 1f166: b0 2f mov r27, r16 1f168: 80 93 31 06 sts 0x0631, r24 ; 0x800631 1f16c: 90 93 32 06 sts 0x0632, r25 ; 0x800632 1f170: a0 93 33 06 sts 0x0633, r26 ; 0x800633 1f174: b0 93 34 06 sts 0x0634, r27 ; 0x800634 iTerm[e] = cs.Ki * iState_sum[e]; 1f178: 20 91 9e 04 lds r18, 0x049E ; 0x80049e 1f17c: 30 91 9f 04 lds r19, 0x049F ; 0x80049f 1f180: 40 91 a0 04 lds r20, 0x04A0 ; 0x8004a0 1f184: 50 91 a1 04 lds r21, 0x04A1 ; 0x8004a1 1f188: bc 01 movw r22, r24 1f18a: 81 2f mov r24, r17 1f18c: 90 2f mov r25, r16 1f18e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1f192: 6d 83 std Y+5, r22 ; 0x05 1f194: 7e 83 std Y+6, r23 ; 0x06 1f196: 8f 83 std Y+7, r24 ; 0x07 1f198: 98 87 std Y+8, r25 ; 0x08 // PID_K1 defined in Configuration.h in the PID settings #define K2 (1.0-PID_K1) dTerm[e] = (cs.Kd * (pid_input - dState_last[e]))*K2 + (PID_K1 * dTerm[e]); // e.g. digital filtration of derivative term changes 1f19a: 20 91 29 06 lds r18, 0x0629 ; 0x800629 1f19e: 30 91 2a 06 lds r19, 0x062A ; 0x80062a 1f1a2: 40 91 2b 06 lds r20, 0x062B ; 0x80062b 1f1a6: 50 91 2c 06 lds r21, 0x062C ; 0x80062c 1f1aa: c3 01 movw r24, r6 1f1ac: b2 01 movw r22, r4 1f1ae: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1f1b2: 20 91 a2 04 lds r18, 0x04A2 ; 0x8004a2 1f1b6: 30 91 a3 04 lds r19, 0x04A3 ; 0x8004a3 1f1ba: 40 91 a4 04 lds r20, 0x04A4 ; 0x8004a4 1f1be: 50 91 a5 04 lds r21, 0x04A5 ; 0x8004a5 1f1c2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1f1c6: 20 ed ldi r18, 0xD0 ; 208 1f1c8: 3c ec ldi r19, 0xCC ; 204 1f1ca: 4c e4 ldi r20, 0x4C ; 76 1f1cc: 5d e3 ldi r21, 0x3D ; 61 1f1ce: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1f1d2: 4b 01 movw r8, r22 1f1d4: 5c 01 movw r10, r24 1f1d6: 23 e3 ldi r18, 0x33 ; 51 1f1d8: 33 e3 ldi r19, 0x33 ; 51 1f1da: 43 e7 ldi r20, 0x73 ; 115 1f1dc: 5f e3 ldi r21, 0x3F ; 63 1f1de: 60 91 2d 06 lds r22, 0x062D ; 0x80062d 1f1e2: 70 91 2e 06 lds r23, 0x062E ; 0x80062e 1f1e6: 80 91 2f 06 lds r24, 0x062F ; 0x80062f 1f1ea: 90 91 30 06 lds r25, 0x0630 ; 0x800630 1f1ee: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1f1f2: 9b 01 movw r18, r22 1f1f4: ac 01 movw r20, r24 1f1f6: c5 01 movw r24, r10 1f1f8: b4 01 movw r22, r8 1f1fa: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1f1fe: 4b 01 movw r8, r22 1f200: 5c 01 movw r10, r24 1f202: 80 92 2d 06 sts 0x062D, r8 ; 0x80062d 1f206: 90 92 2e 06 sts 0x062E, r9 ; 0x80062e 1f20a: a0 92 2f 06 sts 0x062F, r10 ; 0x80062f 1f20e: b0 92 30 06 sts 0x0630, r11 ; 0x800630 pid_output = pTerm[e] + iTerm[e] - dTerm[e]; // subtraction due to "Derivative on Measurement" method (i.e. derivative of input instead derivative of error is used) 1f212: 2d 81 ldd r18, Y+5 ; 0x05 1f214: 3e 81 ldd r19, Y+6 ; 0x06 1f216: 4f 81 ldd r20, Y+7 ; 0x07 1f218: 58 85 ldd r21, Y+8 ; 0x08 1f21a: 69 81 ldd r22, Y+1 ; 0x01 1f21c: 7a 81 ldd r23, Y+2 ; 0x02 1f21e: 8b 81 ldd r24, Y+3 ; 0x03 1f220: 9c 81 ldd r25, Y+4 ; 0x04 1f222: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1f226: a5 01 movw r20, r10 1f228: 94 01 movw r18, r8 1f22a: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1f22e: 4b 01 movw r8, r22 1f230: 5c 01 movw r10, r24 if (pid_output > PID_MAX) { 1f232: 20 e0 ldi r18, 0x00 ; 0 1f234: 30 e0 ldi r19, 0x00 ; 0 1f236: 4f e7 ldi r20, 0x7F ; 127 1f238: 53 e4 ldi r21, 0x43 ; 67 1f23a: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 1f23e: 20 e0 ldi r18, 0x00 ; 0 1f240: 30 e0 ldi r19, 0x00 ; 0 1f242: a9 01 movw r20, r18 iTerm[e] = cs.Ki * iState_sum[e]; // PID_K1 defined in Configuration.h in the PID settings #define K2 (1.0-PID_K1) dTerm[e] = (cs.Kd * (pid_input - dState_last[e]))*K2 + (PID_K1 * dTerm[e]); // e.g. digital filtration of derivative term changes pid_output = pTerm[e] + iTerm[e] - dTerm[e]; // subtraction due to "Derivative on Measurement" method (i.e. derivative of input instead derivative of error is used) if (pid_output > PID_MAX) { 1f244: 18 16 cp r1, r24 1f246: 0c f0 brlt .+2 ; 0x1f24a 1f248: 6d c1 rjmp .+730 ; 0x1f524 if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 1f24a: c7 01 movw r24, r14 1f24c: b6 01 movw r22, r12 1f24e: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 1f252: 18 16 cp r1, r24 1f254: 84 f4 brge .+32 ; 0x1f276 1f256: a7 01 movw r20, r14 1f258: 96 01 movw r18, r12 1f25a: 6d 85 ldd r22, Y+13 ; 0x0d 1f25c: 79 85 ldd r23, Y+9 ; 0x09 1f25e: 81 2f mov r24, r17 1f260: 90 2f mov r25, r16 1f262: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1f266: 60 93 31 06 sts 0x0631, r22 ; 0x800631 1f26a: 70 93 32 06 sts 0x0632, r23 ; 0x800632 1f26e: 80 93 33 06 sts 0x0633, r24 ; 0x800633 1f272: 90 93 34 06 sts 0x0634, r25 ; 0x800634 pid_output=PID_MAX; 1f276: 81 2c mov r8, r1 1f278: 91 2c mov r9, r1 1f27a: 3f e7 ldi r19, 0x7F ; 127 1f27c: a3 2e mov r10, r19 1f27e: 33 e4 ldi r19, 0x43 ; 67 1f280: b3 2e mov r11, r19 dTerm[e] = cs.Kd * (pid_input - dState_last[e]); pid_output = iState_sum[e] - dTerm[e]; // subtraction due to "Derivative on Measurement" method (i.e. derivative of input instead derivative of error is used) pid_output = constrain(pid_output, 0, PID_MAX); #endif // PonM } dState_last[e] = pid_input; 1f282: 40 92 29 06 sts 0x0629, r4 ; 0x800629 1f286: 50 92 2a 06 sts 0x062A, r5 ; 0x80062a 1f28a: 60 92 2b 06 sts 0x062B, r6 ; 0x80062b 1f28e: 70 92 2c 06 sts 0x062C, r7 ; 0x80062c pid_output = PID_MAX; } #endif // Check if temperature is within the correct range if((current < maxttemp[e]) && (target != 0)) 1f292: 60 91 54 02 lds r22, 0x0254 ; 0x800254 <_ZL8maxttemp.lto_priv.433> 1f296: 70 91 55 02 lds r23, 0x0255 ; 0x800255 <_ZL8maxttemp.lto_priv.433+0x1> 1f29a: 07 2e mov r0, r23 1f29c: 00 0c add r0, r0 1f29e: 88 0b sbc r24, r24 1f2a0: 99 0b sbc r25, r25 1f2a2: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 1f2a6: 9b 01 movw r18, r22 1f2a8: ac 01 movw r20, r24 1f2aa: c3 01 movw r24, r6 1f2ac: b2 01 movw r22, r4 1f2ae: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1f2b2: 87 ff sbrs r24, 7 1f2b4: 57 c1 rjmp .+686 ; 0x1f564 1f2b6: 23 28 or r2, r3 1f2b8: 09 f4 brne .+2 ; 0x1f2bc 1f2ba: 54 c1 rjmp .+680 ; 0x1f564 soft_pwm[e] = (int)pid_output >> 1; 1f2bc: c5 01 movw r24, r10 1f2be: b4 01 movw r22, r8 1f2c0: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 1f2c4: 75 95 asr r23 1f2c6: 67 95 ror r22 1f2c8: 60 93 62 06 sts 0x0662, r22 ; 0x800662 <_ZL8soft_pwm.lto_priv.506> static void temp_mgr_pid() { for(uint8_t e = 0; e < EXTRUDERS; e++) pid_heater(e, current_temperature_isr[e], target_temperature_isr[e]); pid_bed(current_temperature_bed_isr, target_temperature_bed_isr); 1f2cc: 20 91 55 06 lds r18, 0x0655 ; 0x800655 1f2d0: 30 91 56 06 lds r19, 0x0656 ; 0x800656 1f2d4: 3a 83 std Y+2, r19 ; 0x02 1f2d6: 29 83 std Y+1, r18 ; 0x01 1f2d8: 40 90 57 06 lds r4, 0x0657 ; 0x800657 1f2dc: 50 90 58 06 lds r5, 0x0658 ; 0x800658 1f2e0: 60 90 59 06 lds r6, 0x0659 ; 0x800659 1f2e4: 70 90 5a 06 lds r7, 0x065A ; 0x80065a #ifdef PIDTEMPBED pid_input = current; #ifndef PID_OPENLOOP pid_error_bed = target - pid_input; 1f2e8: b9 01 movw r22, r18 1f2ea: 33 0f add r19, r19 1f2ec: 88 0b sbc r24, r24 1f2ee: 99 0b sbc r25, r25 1f2f0: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 1f2f4: a3 01 movw r20, r6 1f2f6: 92 01 movw r18, r4 1f2f8: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1f2fc: 6b 01 movw r12, r22 1f2fe: 7c 01 movw r14, r24 pTerm_bed = cs.bedKp * pid_error_bed; 1f300: 20 91 a6 04 lds r18, 0x04A6 ; 0x8004a6 1f304: 30 91 a7 04 lds r19, 0x04A7 ; 0x8004a7 1f308: 40 91 a8 04 lds r20, 0x04A8 ; 0x8004a8 1f30c: 50 91 a9 04 lds r21, 0x04A9 ; 0x8004a9 1f310: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1f314: 6d 83 std Y+5, r22 ; 0x05 1f316: 7e 83 std Y+6, r23 ; 0x06 1f318: 8f 83 std Y+7, r24 ; 0x07 1f31a: 98 87 std Y+8, r25 ; 0x08 temp_iState_bed += pid_error_bed; 1f31c: 20 91 3e 06 lds r18, 0x063E ; 0x80063e 1f320: 30 91 3f 06 lds r19, 0x063F ; 0x80063f 1f324: 40 91 40 06 lds r20, 0x0640 ; 0x800640 1f328: 50 91 41 06 lds r21, 0x0641 ; 0x800641 1f32c: c7 01 movw r24, r14 1f32e: b6 01 movw r22, r12 1f330: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1f334: 5b 01 movw r10, r22 1f336: 8c 01 movw r16, r24 temp_iState_bed = constrain(temp_iState_bed, temp_iState_min_bed, temp_iState_max_bed); 1f338: 30 91 e2 03 lds r19, 0x03E2 ; 0x8003e2 <_ZL19temp_iState_min_bed.lto_priv.429> 1f33c: 3e 87 std Y+14, r19 ; 0x0e 1f33e: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 <_ZL19temp_iState_min_bed.lto_priv.429+0x1> 1f342: 8d 87 std Y+13, r24 ; 0x0d 1f344: 30 90 e4 03 lds r3, 0x03E4 ; 0x8003e4 <_ZL19temp_iState_min_bed.lto_priv.429+0x2> 1f348: 20 90 e5 03 lds r2, 0x03E5 ; 0x8003e5 <_ZL19temp_iState_min_bed.lto_priv.429+0x3> 1f34c: 23 2f mov r18, r19 1f34e: 38 2f mov r19, r24 1f350: 43 2d mov r20, r3 1f352: 52 2d mov r21, r2 1f354: b5 01 movw r22, r10 1f356: c8 01 movw r24, r16 1f358: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1f35c: 87 fd sbrc r24, 7 1f35e: 18 c0 rjmp .+48 ; 0x1f390 1f360: 90 91 de 03 lds r25, 0x03DE ; 0x8003de <_ZL19temp_iState_max_bed.lto_priv.430> 1f364: 9e 87 std Y+14, r25 ; 0x0e 1f366: 20 91 df 03 lds r18, 0x03DF ; 0x8003df <_ZL19temp_iState_max_bed.lto_priv.430+0x1> 1f36a: 2d 87 std Y+13, r18 ; 0x0d 1f36c: 30 90 e0 03 lds r3, 0x03E0 ; 0x8003e0 <_ZL19temp_iState_max_bed.lto_priv.430+0x2> 1f370: 20 90 e1 03 lds r2, 0x03E1 ; 0x8003e1 <_ZL19temp_iState_max_bed.lto_priv.430+0x3> 1f374: 29 2f mov r18, r25 1f376: 3d 85 ldd r19, Y+13 ; 0x0d 1f378: 43 2d mov r20, r3 1f37a: 52 2d mov r21, r2 1f37c: b5 01 movw r22, r10 1f37e: c8 01 movw r24, r16 1f380: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 1f384: 18 16 cp r1, r24 1f386: 24 f0 brlt .+8 ; 0x1f390 1f388: ae 86 std Y+14, r10 ; 0x0e 1f38a: bd 86 std Y+13, r11 ; 0x0d 1f38c: 30 2e mov r3, r16 1f38e: 21 2e mov r2, r17 1f390: 8e 85 ldd r24, Y+14 ; 0x0e 1f392: 9d 85 ldd r25, Y+13 ; 0x0d 1f394: a3 2d mov r26, r3 1f396: b2 2d mov r27, r2 1f398: 80 93 3e 06 sts 0x063E, r24 ; 0x80063e 1f39c: 90 93 3f 06 sts 0x063F, r25 ; 0x80063f 1f3a0: a0 93 40 06 sts 0x0640, r26 ; 0x800640 1f3a4: b0 93 41 06 sts 0x0641, r27 ; 0x800641 iTerm_bed = cs.bedKi * temp_iState_bed; 1f3a8: 20 91 aa 04 lds r18, 0x04AA ; 0x8004aa 1f3ac: 30 91 ab 04 lds r19, 0x04AB ; 0x8004ab 1f3b0: 40 91 ac 04 lds r20, 0x04AC ; 0x8004ac 1f3b4: 50 91 ad 04 lds r21, 0x04AD ; 0x8004ad 1f3b8: bc 01 movw r22, r24 1f3ba: 83 2d mov r24, r3 1f3bc: 92 2d mov r25, r2 1f3be: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1f3c2: 69 87 std Y+9, r22 ; 0x09 1f3c4: 7a 87 std Y+10, r23 ; 0x0a 1f3c6: 8b 87 std Y+11, r24 ; 0x0b 1f3c8: 9c 87 std Y+12, r25 ; 0x0c //PID_K1 defined in Configuration.h in the PID settings #define K2 (1.0-PID_K1) dTerm_bed= (cs.bedKd * (pid_input - temp_dState_bed))*K2 + (PID_K1 * dTerm_bed); 1f3ca: 20 91 3a 06 lds r18, 0x063A ; 0x80063a 1f3ce: 30 91 3b 06 lds r19, 0x063B ; 0x80063b 1f3d2: 40 91 3c 06 lds r20, 0x063C ; 0x80063c 1f3d6: 50 91 3d 06 lds r21, 0x063D ; 0x80063d 1f3da: c3 01 movw r24, r6 1f3dc: b2 01 movw r22, r4 1f3de: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1f3e2: 20 91 ae 04 lds r18, 0x04AE ; 0x8004ae 1f3e6: 30 91 af 04 lds r19, 0x04AF ; 0x8004af 1f3ea: 40 91 b0 04 lds r20, 0x04B0 ; 0x8004b0 1f3ee: 50 91 b1 04 lds r21, 0x04B1 ; 0x8004b1 1f3f2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1f3f6: 20 ed ldi r18, 0xD0 ; 208 1f3f8: 3c ec ldi r19, 0xCC ; 204 1f3fa: 4c e4 ldi r20, 0x4C ; 76 1f3fc: 5d e3 ldi r21, 0x3D ; 61 1f3fe: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1f402: 4b 01 movw r8, r22 1f404: 5c 01 movw r10, r24 1f406: 23 e3 ldi r18, 0x33 ; 51 1f408: 33 e3 ldi r19, 0x33 ; 51 1f40a: 43 e7 ldi r20, 0x73 ; 115 1f40c: 5f e3 ldi r21, 0x3F ; 63 1f40e: 60 91 36 06 lds r22, 0x0636 ; 0x800636 1f412: 70 91 37 06 lds r23, 0x0637 ; 0x800637 1f416: 80 91 38 06 lds r24, 0x0638 ; 0x800638 1f41a: 90 91 39 06 lds r25, 0x0639 ; 0x800639 1f41e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 1f422: 9b 01 movw r18, r22 1f424: ac 01 movw r20, r24 1f426: c5 01 movw r24, r10 1f428: b4 01 movw r22, r8 1f42a: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1f42e: 4b 01 movw r8, r22 1f430: 5c 01 movw r10, r24 1f432: 80 92 36 06 sts 0x0636, r8 ; 0x800636 1f436: 90 92 37 06 sts 0x0637, r9 ; 0x800637 1f43a: a0 92 38 06 sts 0x0638, r10 ; 0x800638 1f43e: b0 92 39 06 sts 0x0639, r11 ; 0x800639 temp_dState_bed = pid_input; 1f442: 40 92 3a 06 sts 0x063A, r4 ; 0x80063a 1f446: 50 92 3b 06 sts 0x063B, r5 ; 0x80063b 1f44a: 60 92 3c 06 sts 0x063C, r6 ; 0x80063c 1f44e: 70 92 3d 06 sts 0x063D, r7 ; 0x80063d pid_output = pTerm_bed + iTerm_bed - dTerm_bed; 1f452: 29 85 ldd r18, Y+9 ; 0x09 1f454: 3a 85 ldd r19, Y+10 ; 0x0a 1f456: 4b 85 ldd r20, Y+11 ; 0x0b 1f458: 5c 85 ldd r21, Y+12 ; 0x0c 1f45a: 6d 81 ldd r22, Y+5 ; 0x05 1f45c: 7e 81 ldd r23, Y+6 ; 0x06 1f45e: 8f 81 ldd r24, Y+7 ; 0x07 1f460: 98 85 ldd r25, Y+8 ; 0x08 1f462: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 1f466: a5 01 movw r20, r10 1f468: 94 01 movw r18, r8 1f46a: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1f46e: 4b 01 movw r8, r22 1f470: 5c 01 movw r10, r24 if (pid_output > MAX_BED_POWER) { 1f472: 20 e0 ldi r18, 0x00 ; 0 1f474: 30 e0 ldi r19, 0x00 ; 0 1f476: 4f e7 ldi r20, 0x7F ; 127 1f478: 53 e4 ldi r21, 0x43 ; 67 1f47a: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 1f47e: 20 e0 ldi r18, 0x00 ; 0 1f480: 30 e0 ldi r19, 0x00 ; 0 1f482: a9 01 movw r20, r18 #define K2 (1.0-PID_K1) dTerm_bed= (cs.bedKd * (pid_input - temp_dState_bed))*K2 + (PID_K1 * dTerm_bed); temp_dState_bed = pid_input; pid_output = pTerm_bed + iTerm_bed - dTerm_bed; if (pid_output > MAX_BED_POWER) { 1f484: 18 16 cp r1, r24 1f486: 0c f0 brlt .+2 ; 0x1f48a 1f488: 70 c0 rjmp .+224 ; 0x1f56a if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 1f48a: c7 01 movw r24, r14 1f48c: b6 01 movw r22, r12 1f48e: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 1f492: 18 16 cp r1, r24 1f494: 84 f4 brge .+32 ; 0x1f4b6 1f496: a7 01 movw r20, r14 1f498: 96 01 movw r18, r12 1f49a: 6e 85 ldd r22, Y+14 ; 0x0e 1f49c: 7d 85 ldd r23, Y+13 ; 0x0d 1f49e: 83 2d mov r24, r3 1f4a0: 92 2d mov r25, r2 1f4a2: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1f4a6: 60 93 3e 06 sts 0x063E, r22 ; 0x80063e 1f4aa: 70 93 3f 06 sts 0x063F, r23 ; 0x80063f 1f4ae: 80 93 40 06 sts 0x0640, r24 ; 0x800640 1f4b2: 90 93 41 06 sts 0x0641, r25 ; 0x800641 pid_output=MAX_BED_POWER; 1f4b6: 81 2c mov r8, r1 1f4b8: 91 2c mov r9, r1 1f4ba: 9f e7 ldi r25, 0x7F ; 127 1f4bc: a9 2e mov r10, r25 1f4be: 93 e4 ldi r25, 0x43 ; 67 1f4c0: b9 2e mov r11, r25 #else pid_output = constrain(target, 0, MAX_BED_POWER); #endif //PID_OPENLOOP if(current < BED_MAXTEMP) 1f4c2: 20 e0 ldi r18, 0x00 ; 0 1f4c4: 30 e0 ldi r19, 0x00 ; 0 1f4c6: 4a ef ldi r20, 0xFA ; 250 1f4c8: 52 e4 ldi r21, 0x42 ; 66 1f4ca: c3 01 movw r24, r6 1f4cc: b2 01 movw r22, r4 1f4ce: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1f4d2: 87 ff sbrs r24, 7 1f4d4: 6d c0 rjmp .+218 ; 0x1f5b0 { soft_pwm_bed = (int)pid_output >> 1; 1f4d6: c5 01 movw r24, r10 1f4d8: b4 01 movw r22, r8 1f4da: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 1f4de: 75 95 asr r23 1f4e0: 67 95 ror r22 1f4e2: 60 93 5b 06 sts 0x065B, r22 ; 0x80065b soft_pwm_bed = 0; WRITE(HEATER_BED_PIN,LOW); } #endif //BED_LIMIT_SWITCHING if(target==0) 1f4e6: 89 81 ldd r24, Y+1 ; 0x01 1f4e8: 9a 81 ldd r25, Y+2 ; 0x02 1f4ea: 89 2b or r24, r25 1f4ec: 11 f4 brne .+4 ; 0x1f4f2 { soft_pwm_bed = 0; 1f4ee: 10 92 5b 06 sts 0x065B, r1 ; 0x80065b static void temp_mgr_pid() { for(uint8_t e = 0; e < EXTRUDERS; e++) pid_heater(e, current_temperature_isr[e], target_temperature_isr[e]); pid_bed(current_temperature_bed_isr, target_temperature_bed_isr); } 1f4f2: 2e 96 adiw r28, 0x0e ; 14 1f4f4: 0f b6 in r0, 0x3f ; 63 1f4f6: f8 94 cli 1f4f8: de bf out 0x3e, r29 ; 62 1f4fa: 0f be out 0x3f, r0 ; 63 1f4fc: cd bf out 0x3d, r28 ; 61 1f4fe: df 91 pop r29 1f500: cf 91 pop r28 1f502: 1f 91 pop r17 1f504: 0f 91 pop r16 1f506: ff 90 pop r15 1f508: ef 90 pop r14 1f50a: df 90 pop r13 1f50c: cf 90 pop r12 1f50e: bf 90 pop r11 1f510: af 90 pop r10 1f512: 9f 90 pop r9 1f514: 8f 90 pop r8 1f516: 7f 90 pop r7 1f518: 6f 90 pop r6 1f51a: 5f 90 pop r5 1f51c: 4f 90 pop r4 1f51e: 3f 90 pop r3 1f520: 2f 90 pop r2 1f522: 08 95 ret dTerm[e] = (cs.Kd * (pid_input - dState_last[e]))*K2 + (PID_K1 * dTerm[e]); // e.g. digital filtration of derivative term changes pid_output = pTerm[e] + iTerm[e] - dTerm[e]; // subtraction due to "Derivative on Measurement" method (i.e. derivative of input instead derivative of error is used) if (pid_output > PID_MAX) { if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration pid_output=PID_MAX; } else if (pid_output < 0) { 1f524: c5 01 movw r24, r10 1f526: b4 01 movw r22, r8 1f528: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1f52c: 87 ff sbrs r24, 7 1f52e: a9 ce rjmp .-686 ; 0x1f282 if (pid_error[e] < 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 1f530: 20 e0 ldi r18, 0x00 ; 0 1f532: 30 e0 ldi r19, 0x00 ; 0 1f534: a9 01 movw r20, r18 1f536: c7 01 movw r24, r14 1f538: b6 01 movw r22, r12 1f53a: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1f53e: 87 ff sbrs r24, 7 1f540: a3 cd rjmp .-1210 ; 0x1f088 1f542: a7 01 movw r20, r14 1f544: 96 01 movw r18, r12 1f546: 6d 85 ldd r22, Y+13 ; 0x0d 1f548: 79 85 ldd r23, Y+9 ; 0x09 1f54a: 81 2f mov r24, r17 1f54c: 90 2f mov r25, r16 1f54e: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1f552: 60 93 31 06 sts 0x0631, r22 ; 0x800631 1f556: 70 93 32 06 sts 0x0632, r23 ; 0x800632 1f55a: 80 93 33 06 sts 0x0633, r24 ; 0x800633 1f55e: 90 93 34 06 sts 0x0634, r25 ; 0x800634 1f562: 92 cd rjmp .-1244 ; 0x1f088 // Check if temperature is within the correct range if((current < maxttemp[e]) && (target != 0)) soft_pwm[e] = (int)pid_output >> 1; else soft_pwm[e] = 0; 1f564: 10 92 62 06 sts 0x0662, r1 ; 0x800662 <_ZL8soft_pwm.lto_priv.506> 1f568: b1 ce rjmp .-670 ; 0x1f2cc pid_output = pTerm_bed + iTerm_bed - dTerm_bed; if (pid_output > MAX_BED_POWER) { if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration pid_output=MAX_BED_POWER; } else if (pid_output < 0){ 1f56a: c5 01 movw r24, r10 1f56c: b4 01 movw r22, r8 1f56e: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1f572: 87 ff sbrs r24, 7 1f574: a6 cf rjmp .-180 ; 0x1f4c2 if (pid_error_bed < 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 1f576: 20 e0 ldi r18, 0x00 ; 0 1f578: 30 e0 ldi r19, 0x00 ; 0 1f57a: a9 01 movw r20, r18 1f57c: c7 01 movw r24, r14 1f57e: b6 01 movw r22, r12 1f580: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 1f584: 87 ff sbrs r24, 7 1f586: 10 c0 rjmp .+32 ; 0x1f5a8 1f588: a7 01 movw r20, r14 1f58a: 96 01 movw r18, r12 1f58c: 6e 85 ldd r22, Y+14 ; 0x0e 1f58e: 7d 85 ldd r23, Y+13 ; 0x0d 1f590: 83 2d mov r24, r3 1f592: 92 2d mov r25, r2 1f594: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 1f598: 60 93 3e 06 sts 0x063E, r22 ; 0x80063e 1f59c: 70 93 3f 06 sts 0x063F, r23 ; 0x80063f 1f5a0: 80 93 40 06 sts 0x0640, r24 ; 0x800640 1f5a4: 90 93 41 06 sts 0x0641, r25 ; 0x800641 pid_output=0; 1f5a8: 81 2c mov r8, r1 1f5aa: 91 2c mov r9, r1 1f5ac: 54 01 movw r10, r8 1f5ae: 89 cf rjmp .-238 ; 0x1f4c2 { soft_pwm_bed = (int)pid_output >> 1; } else { soft_pwm_bed = 0; 1f5b0: 10 92 5b 06 sts 0x065B, r1 ; 0x80065b 1f5b4: 98 cf rjmp .-208 ; 0x1f4e6 0001f5b6 : } static void setIsrTargetTemperatures() { for(uint8_t e=0;e 1f5ba: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 1f5be: 90 93 5d 06 sts 0x065D, r25 ; 0x80065d 1f5c2: 80 93 5c 06 sts 0x065C, r24 ; 0x80065c target_temperature_bed_isr = target_temperature_bed; 1f5c6: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed 1f5ca: 90 91 ee 11 lds r25, 0x11EE ; 0x8011ee 1f5ce: 90 93 56 06 sts 0x0656, r25 ; 0x800656 1f5d2: 80 93 55 06 sts 0x0655, r24 ; 0x800655 } 1f5d6: 08 95 ret 0001f5d8 : /* Synchronize temperatures: - fetch updated values from temp_mgr_isr to current values - update target temperatures for temp_mgr_isr regulation *if* no temperature error is set This function is blocking: check temp_meas_ready before calling! */ static void updateTemperatures() { 1f5d8: cf 93 push r28 { bool temp_mgr_state; public: TempMgrGuard() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1f5da: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1f5dc: f8 94 cli temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); 1f5de: c0 91 71 00 lds r28, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1f5e2: c2 70 andi r28, 0x02 ; 2 DISABLE_TEMP_MGR_INTERRUPT(); 1f5e4: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1f5e8: 8d 7f andi r24, 0xFD ; 253 1f5ea: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1f5ee: 9f bf out 0x3f, r25 ; 63 } static void setCurrentTemperaturesFromIsr() { for(uint8_t e=0;e 1f5f4: 90 91 5f 06 lds r25, 0x065F ; 0x80065f 1f5f8: a0 91 60 06 lds r26, 0x0660 ; 0x800660 1f5fc: b0 91 61 06 lds r27, 0x0661 ; 0x800661 1f600: 80 93 c4 0d sts 0x0DC4, r24 ; 0x800dc4 1f604: 90 93 c5 0d sts 0x0DC5, r25 ; 0x800dc5 1f608: a0 93 c6 0d sts 0x0DC6, r26 ; 0x800dc6 1f60c: b0 93 c7 0d sts 0x0DC7, r27 ; 0x800dc7 current_temperature_bed = current_temperature_bed_isr; 1f610: 80 91 57 06 lds r24, 0x0657 ; 0x800657 1f614: 90 91 58 06 lds r25, 0x0658 ; 0x800658 1f618: a0 91 59 06 lds r26, 0x0659 ; 0x800659 1f61c: b0 91 5a 06 lds r27, 0x065A ; 0x80065a 1f620: 80 93 8a 03 sts 0x038A, r24 ; 0x80038a 1f624: 90 93 8b 03 sts 0x038B, r25 ; 0x80038b 1f628: a0 93 8c 03 sts 0x038C, r26 ; 0x80038c 1f62c: b0 93 8d 03 sts 0x038D, r27 ; 0x80038d #ifdef PINDA_THERMISTOR current_temperature_pinda = current_temperature_pinda_isr; 1f630: 80 91 43 06 lds r24, 0x0643 ; 0x800643 1f634: 90 91 44 06 lds r25, 0x0644 ; 0x800644 1f638: a0 91 45 06 lds r26, 0x0645 ; 0x800645 1f63c: b0 91 46 06 lds r27, 0x0646 ; 0x800646 1f640: 80 93 8e 06 sts 0x068E, r24 ; 0x80068e 1f644: 90 93 8f 06 sts 0x068F, r25 ; 0x80068f 1f648: a0 93 90 06 sts 0x0690, r26 ; 0x800690 1f64c: b0 93 91 06 sts 0x0691, r27 ; 0x800691 This function is blocking: check temp_meas_ready before calling! */ static void updateTemperatures() { TempMgrGuard temp_mgr_guard; setCurrentTemperaturesFromIsr(); if(!temp_error_state.v) { 1f650: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 1f654: 81 11 cpse r24, r1 1f656: 02 c0 rjmp .+4 ; 0x1f65c // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); 1f658: 0e 94 db fa call 0x1f5b6 ; 0x1f5b6 } temp_meas_ready = false; 1f65c: 10 92 42 06 sts 0x0642, r1 ; 0x800642 DISABLE_TEMP_MGR_INTERRUPT(); } } ~TempMgrGuard() throw() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1f660: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1f662: f8 94 cli if(temp_mgr_state) ENABLE_TEMP_MGR_INTERRUPT(); 1f664: cc 23 and r28, r28 1f666: 29 f0 breq .+10 ; 0x1f672 1f668: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1f66c: 82 60 ori r24, 0x02 ; 2 1f66e: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1f672: 9f bf out 0x3f, r25 ; 63 if(!temp_error_state.v) { // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); } temp_meas_ready = false; } 1f674: cf 91 pop r28 1f676: 08 95 ret 0001f678 : { // MUST ONLY BE CALLED BY A ISR as stepper pins are manipulated directly. // note: when switching direction no delay is inserted at the end when the // original is restored. We assume enough time passes as the function // returns and the stepper is manipulated again (to avoid dead times) switch(axis) 1f678: 81 30 cpi r24, 0x01 ; 1 1f67a: 61 f1 breq .+88 ; 0x1f6d4 1f67c: 20 f0 brcs .+8 ; 0x1f686 1f67e: 82 30 cpi r24, 0x02 ; 2 1f680: 09 f4 brne .+2 ; 0x1f684 1f682: 4b c0 rjmp .+150 ; 0x1f71a 1f684: 08 95 ret { case X_AXIS: { enable_x(); 1f686: 17 98 cbi 0x02, 7 ; 2 uint8_t old_x_dir_pin = READ(X_DIR_PIN); 1f688: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 1f68c: 81 e0 ldi r24, 0x01 ; 1 1f68e: 29 2f mov r18, r25 1f690: 22 70 andi r18, 0x02 ; 2 1f692: 91 ff sbrs r25, 1 1f694: 80 e0 ldi r24, 0x00 ; 0 uint8_t new_x_dir_pin = (INVERT_X_DIR)^direction; //setup new step if (new_x_dir_pin != old_x_dir_pin) { 1f696: 86 17 cp r24, r22 1f698: 59 f0 breq .+22 ; 0x1f6b0 WRITE_NC(X_DIR_PIN, new_x_dir_pin); 1f69a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f69e: 66 23 and r22, r22 1f6a0: a9 f0 breq .+42 ; 0x1f6cc 1f6a2: 82 60 ori r24, 0x02 ; 2 1f6a4: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif // busy wait __asm__ __volatile__ ( 1f6a8: 8b e8 ldi r24, 0x8B ; 139 1f6aa: 91 e0 ldi r25, 0x01 ; 1 1f6ac: 01 97 sbiw r24, 0x01 ; 1 1f6ae: f1 f7 brne .-4 ; 0x1f6ac delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(X_AXIS); 1f6b0: 40 9a sbi 0x08, 0 ; 8 1f6b2: 83 e0 ldi r24, 0x03 ; 3 1f6b4: 90 e0 ldi r25, 0x00 ; 0 1f6b6: 01 97 sbiw r24, 0x01 ; 1 1f6b8: f1 f7 brne .-4 ; 0x1f6b6 #ifdef DEBUG_XSTEP_DUP_PIN STEP_NC_HI(X_DUP_AXIS); #endif STEPPER_MINIMUM_DELAY; STEP_NC_LO(X_AXIS); 1f6ba: 40 98 cbi 0x08, 0 ; 8 #ifdef DEBUG_XSTEP_DUP_PIN STEP_NC_LO(X_DUP_AXIS); #endif //get old pin state back. WRITE_NC(X_DIR_PIN, old_x_dir_pin); 1f6bc: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f6c0: 22 23 and r18, r18 1f6c2: 31 f0 breq .+12 ; 0x1f6d0 1f6c4: 82 60 ori r24, 0x02 ; 2 STEPPER_MINIMUM_DELAY; STEP_NC_LO(Z_AXIS); //get old pin state back. if (new_z_dir_pin != old_z_dir_pin) { WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 1f6c6: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> } break; default: break; } } 1f6ca: 08 95 ret uint8_t old_x_dir_pin = READ(X_DIR_PIN); uint8_t new_x_dir_pin = (INVERT_X_DIR)^direction; //setup new step if (new_x_dir_pin != old_x_dir_pin) { WRITE_NC(X_DIR_PIN, new_x_dir_pin); 1f6cc: 8d 7f andi r24, 0xFD ; 253 1f6ce: ea cf rjmp .-44 ; 0x1f6a4 #ifdef DEBUG_XSTEP_DUP_PIN STEP_NC_LO(X_DUP_AXIS); #endif //get old pin state back. WRITE_NC(X_DIR_PIN, old_x_dir_pin); 1f6d0: 8d 7f andi r24, 0xFD ; 253 1f6d2: f9 cf rjmp .-14 ; 0x1f6c6 } break; case Y_AXIS: { enable_y(); 1f6d4: 16 98 cbi 0x02, 6 ; 2 uint8_t old_y_dir_pin = READ(Y_DIR_PIN); 1f6d6: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 1f6da: 81 70 andi r24, 0x01 ; 1 uint8_t new_y_dir_pin = (INVERT_Y_DIR)^direction; //setup new step if (new_y_dir_pin != old_y_dir_pin) { 1f6dc: 86 17 cp r24, r22 1f6de: 59 f0 breq .+22 ; 0x1f6f6 WRITE_NC(Y_DIR_PIN, new_y_dir_pin); 1f6e0: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f6e4: 66 23 and r22, r22 1f6e6: 99 f0 breq .+38 ; 0x1f70e 1f6e8: 91 60 ori r25, 0x01 ; 1 1f6ea: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f6ee: eb e8 ldi r30, 0x8B ; 139 1f6f0: f1 e0 ldi r31, 0x01 ; 1 1f6f2: 31 97 sbiw r30, 0x01 ; 1 1f6f4: f1 f7 brne .-4 ; 0x1f6f2 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Y_AXIS); 1f6f6: 41 9a sbi 0x08, 1 ; 8 1f6f8: e3 e0 ldi r30, 0x03 ; 3 1f6fa: f0 e0 ldi r31, 0x00 ; 0 1f6fc: 31 97 sbiw r30, 0x01 ; 1 1f6fe: f1 f7 brne .-4 ; 0x1f6fc #ifdef DEBUG_YSTEP_DUP_PIN STEP_NC_HI(Y_DUP_AXIS); #endif STEPPER_MINIMUM_DELAY; STEP_NC_LO(Y_AXIS); 1f700: 41 98 cbi 0x08, 1 ; 8 #ifdef DEBUG_YSTEP_DUP_PIN STEP_NC_LO(Y_DUP_AXIS); #endif //get old pin state back. WRITE_NC(Y_DIR_PIN, old_y_dir_pin); 1f702: 88 23 and r24, r24 1f704: 31 f0 breq .+12 ; 0x1f712 1f706: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f70a: 81 60 ori r24, 0x01 ; 1 1f70c: dc cf rjmp .-72 ; 0x1f6c6 uint8_t old_y_dir_pin = READ(Y_DIR_PIN); uint8_t new_y_dir_pin = (INVERT_Y_DIR)^direction; //setup new step if (new_y_dir_pin != old_y_dir_pin) { WRITE_NC(Y_DIR_PIN, new_y_dir_pin); 1f70e: 9e 7f andi r25, 0xFE ; 254 1f710: ec cf rjmp .-40 ; 0x1f6ea #ifdef DEBUG_YSTEP_DUP_PIN STEP_NC_LO(Y_DUP_AXIS); #endif //get old pin state back. WRITE_NC(Y_DIR_PIN, old_y_dir_pin); 1f712: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f716: 8e 7f andi r24, 0xFE ; 254 1f718: d6 cf rjmp .-84 ; 0x1f6c6 } break; case Z_AXIS: { enable_z(); 1f71a: 15 98 cbi 0x02, 5 ; 2 uint8_t old_z_dir_pin = READ(Z_DIR_PIN); 1f71c: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 1f720: 81 e0 ldi r24, 0x01 ; 1 1f722: 29 2f mov r18, r25 1f724: 24 70 andi r18, 0x04 ; 4 1f726: 92 ff sbrs r25, 2 1f728: 80 e0 ldi r24, 0x00 ; 0 uint8_t new_z_dir_pin = (INVERT_Z_DIR)^direction^BABYSTEP_INVERT_Z; //setup new step if (new_z_dir_pin != old_z_dir_pin) { 1f72a: 68 17 cp r22, r24 1f72c: 59 f0 breq .+22 ; 0x1f744 WRITE_NC(Z_DIR_PIN, new_z_dir_pin); 1f72e: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f732: 66 23 and r22, r22 1f734: b1 f0 breq .+44 ; 0x1f762 1f736: 94 60 ori r25, 0x04 ; 4 1f738: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f73c: eb e8 ldi r30, 0x8B ; 139 1f73e: f1 e0 ldi r31, 0x01 ; 1 1f740: 31 97 sbiw r30, 0x01 ; 1 1f742: f1 f7 brne .-4 ; 0x1f740 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Z_AXIS); 1f744: 42 9a sbi 0x08, 2 ; 8 1f746: e3 e0 ldi r30, 0x03 ; 3 1f748: f0 e0 ldi r31, 0x00 ; 0 1f74a: 31 97 sbiw r30, 0x01 ; 1 1f74c: f1 f7 brne .-4 ; 0x1f74a STEPPER_MINIMUM_DELAY; STEP_NC_LO(Z_AXIS); 1f74e: 42 98 cbi 0x08, 2 ; 8 //get old pin state back. if (new_z_dir_pin != old_z_dir_pin) { 1f750: 68 17 cp r22, r24 1f752: 09 f4 brne .+2 ; 0x1f756 1f754: ba cf rjmp .-140 ; 0x1f6ca WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 1f756: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f75a: 22 23 and r18, r18 1f75c: 21 f0 breq .+8 ; 0x1f766 1f75e: 84 60 ori r24, 0x04 ; 4 1f760: b2 cf rjmp .-156 ; 0x1f6c6 uint8_t old_z_dir_pin = READ(Z_DIR_PIN); uint8_t new_z_dir_pin = (INVERT_Z_DIR)^direction^BABYSTEP_INVERT_Z; //setup new step if (new_z_dir_pin != old_z_dir_pin) { WRITE_NC(Z_DIR_PIN, new_z_dir_pin); 1f762: 9b 7f andi r25, 0xFB ; 251 1f764: e9 cf rjmp .-46 ; 0x1f738 STEPPER_MINIMUM_DELAY; STEP_NC_LO(Z_AXIS); //get old pin state back. if (new_z_dir_pin != old_z_dir_pin) { WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 1f766: 8b 7f andi r24, 0xFB ; 251 1f768: ae cf rjmp .-164 ; 0x1f6c6 0001f76a : } } static void checkRx(void) { if (selectedSerialPort == 0) { 1f76a: 80 91 04 05 lds r24, 0x0504 ; 0x800504 1f76e: 81 11 cpse r24, r1 1f770: 25 c0 rjmp .+74 ; 0x1f7bc if((M_UCSRxA & (1< 1f776: 87 ff sbrs r24, 7 1f778: 3d c0 rjmp .+122 ; 0x1f7f4 // Test for a framing error. if (M_UCSRxA & (1< 1f77e: 84 ff sbrs r24, 4 1f780: 03 c0 rjmp .+6 ; 0x1f788 // Characters received with the framing errors will be ignored. // The temporary variable "c" was made volatile, so the compiler does not optimize this out. (void)(*(char *)M_UDRx); 1f782: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 1f786: 08 95 ret } else { unsigned char c = M_UDRx; 1f788: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 1f78c: 20 91 af 05 lds r18, 0x05AF ; 0x8005af 1f790: 30 91 b0 05 lds r19, 0x05B0 ; 0x8005b0 1f794: c9 01 movw r24, r18 1f796: 01 96 adiw r24, 0x01 ; 1 1f798: 8f 77 andi r24, 0x7F ; 127 1f79a: 99 27 eor r25, r25 // if we should be storing the received character into the location // just before the tail (meaning that the head would advance to the // current location of the tail), we're about to overflow the buffer // and so we don't write the character or advance the head. if (i != rx_buffer.tail) { 1f79c: 60 91 b1 05 lds r22, 0x05B1 ; 0x8005b1 1f7a0: 70 91 b2 05 lds r23, 0x05B2 ; 0x8005b2 1f7a4: 86 17 cp r24, r22 1f7a6: 97 07 cpc r25, r23 1f7a8: 29 f1 breq .+74 ; 0x1f7f4 // if we should be storing the received character into the location // just before the tail (meaning that the head would advance to the // current location of the tail), we're about to overflow the buffer // and so we don't write the character or advance the head. if (i != rx_buffer.tail) { rx_buffer.buffer[rx_buffer.head] = c; 1f7aa: 21 5d subi r18, 0xD1 ; 209 1f7ac: 3a 4f sbci r19, 0xFA ; 250 1f7ae: f9 01 movw r30, r18 1f7b0: 40 83 st Z, r20 rx_buffer.head = i; 1f7b2: 90 93 b0 05 sts 0x05B0, r25 ; 0x8005b0 1f7b6: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af 1f7ba: 1c c0 rjmp .+56 ; 0x1f7f4 UDR1 = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } else { // if(selectedSerialPort == 1) { if((UCSR1A & (1< 1f7c0: 87 ff sbrs r24, 7 1f7c2: 18 c0 rjmp .+48 ; 0x1f7f4 // Test for a framing error. if (UCSR1A & (1< 1f7c8: 84 ff sbrs r24, 4 1f7ca: 03 c0 rjmp .+6 ; 0x1f7d2 // Characters received with the framing errors will be ignored. // The temporary variable "c" was made volatile, so the compiler does not optimize this out. (void)(*(char *)UDR1); 1f7cc: 80 91 ce 00 lds r24, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> 1f7d0: 08 95 ret } else { unsigned char c = UDR1; 1f7d2: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 1f7d6: 20 91 af 05 lds r18, 0x05AF ; 0x8005af 1f7da: 30 91 b0 05 lds r19, 0x05B0 ; 0x8005b0 1f7de: c9 01 movw r24, r18 1f7e0: 01 96 adiw r24, 0x01 ; 1 1f7e2: 8f 77 andi r24, 0x7F ; 127 1f7e4: 99 27 eor r25, r25 // if we should be storing the received character into the location // just before the tail (meaning that the head would advance to the // current location of the tail), we're about to overflow the buffer // and so we don't write the character or advance the head. if (i != rx_buffer.tail) { 1f7e6: 60 91 b1 05 lds r22, 0x05B1 ; 0x8005b1 1f7ea: 70 91 b2 05 lds r23, 0x05B2 ; 0x8005b2 1f7ee: 68 17 cp r22, r24 1f7f0: 79 07 cpc r23, r25 1f7f2: d9 f6 brne .-74 ; 0x1f7aa M_UDRx = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } } 1f7f4: 08 95 ret 0001f7f6 : static void Sound_DoSound_Alert(bool bOnce) { uint8_t nI,nMax; nMax=bOnce?1:3; 1f7f6: 93 e0 ldi r25, 0x03 ; 3 1f7f8: 81 11 cpse r24, r1 1f7fa: 91 e0 ldi r25, 0x01 ; 1 for(nI=0;nI delayMicroseconds(200); WRITE(BEEPER,LOW); 1f80e: 72 98 cbi 0x0e, 2 ; 14 1f810: f9 01 movw r30, r18 1f812: 31 97 sbiw r30, 0x01 ; 1 1f814: f1 f7 brne .-4 ; 0x1f812 static void Sound_DoSound_Alert(bool bOnce) { uint8_t nI,nMax; nMax=bOnce?1:3; for(nI=0;nI WRITE(BEEPER,HIGH); delayMicroseconds(200); WRITE(BEEPER,LOW); delayMicroseconds(500); } } 1f81c: 08 95 ret 0001f81e : delayMicroseconds(75); } } static void Sound_DoSound_Echo(void) { 1f81e: 8a e0 ldi r24, 0x0A ; 10 1f820: 2b e8 ldi r18, 0x8B ; 139 1f822: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0;nI<10;nI++) { WRITE(BEEPER,HIGH); 1f824: 72 9a sbi 0x0e, 2 ; 14 1f826: f9 01 movw r30, r18 1f828: 31 97 sbiw r30, 0x01 ; 1 1f82a: f1 f7 brne .-4 ; 0x1f828 delayMicroseconds(100); WRITE(BEEPER,LOW); 1f82c: 72 98 cbi 0x0e, 2 ; 14 1f82e: f9 01 movw r30, r18 1f830: 31 97 sbiw r30, 0x01 ; 1 1f832: f1 f7 brne .-4 ; 0x1f830 1f834: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Echo(void) { uint8_t nI; for(nI=0;nI<10;nI++) 1f836: b1 f7 brne .-20 ; 0x1f824 WRITE(BEEPER,HIGH); delayMicroseconds(100); WRITE(BEEPER,LOW); delayMicroseconds(100); } } 1f838: 08 95 ret 0001f83a : } } static void lcd_checking_menu(void) { MENU_BEGIN(); 1f83a: 0f 94 bc 92 call 0x32578 ; 0x32578 1f83e: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1f842: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1f846: 84 30 cpi r24, 0x04 ; 4 1f848: d8 f5 brcc .+118 ; 0x1f8c0 1f84a: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 1f84e: 8e e9 ldi r24, 0x9E ; 158 1f850: 9a e3 ldi r25, 0x3A ; 58 1f852: 0e 94 b1 6c call 0xd962 ; 0xd962 1f856: 0f 94 87 95 call 0x32b0e ; 0x32b0e settings_check_toggle(&oCheckMode, _T(MSG_NOZZLE), lcd_check_mode_set); 1f85a: 88 e8 ldi r24, 0x88 ; 136 1f85c: 95 e5 ldi r25, 0x55 ; 85 1f85e: 0e 94 b1 6c call 0xd962 ; 0xd962 1f862: 4f e7 ldi r20, 0x7F ; 127 1f864: 5c ef ldi r21, 0xFC ; 252 1f866: bc 01 movw r22, r24 1f868: 80 91 bb 03 lds r24, 0x03BB ; 0x8003bb 1f86c: 0e 94 b2 e1 call 0x1c364 ; 0x1c364 settings_check_toggle(&oCheckModel, _T(MSG_MODEL), lcd_check_model_set); 1f870: 80 e8 ldi r24, 0x80 ; 128 1f872: 95 e5 ldi r25, 0x55 ; 85 1f874: 0e 94 b1 6c call 0xd962 ; 0xd962 1f878: 45 e7 ldi r20, 0x75 ; 117 1f87a: 5c ef ldi r21, 0xFC ; 252 1f87c: bc 01 movw r22, r24 1f87e: 80 91 b8 03 lds r24, 0x03B8 ; 0x8003b8 1f882: 0e 94 b2 e1 call 0x1c364 ; 0x1c364 settings_check_toggle(&oCheckVersion, MSG_FIRMWARE, lcd_check_version_set); 1f886: 4b e6 ldi r20, 0x6B ; 107 1f888: 5c ef ldi r21, 0xFC ; 252 1f88a: 6e e5 ldi r22, 0x5E ; 94 1f88c: 7b e6 ldi r23, 0x6B ; 107 1f88e: 80 91 b7 03 lds r24, 0x03B7 ; 0x8003b7 1f892: 0e 94 b2 e1 call 0x1c364 ; 0x1c364 settings_check_toggle(&oCheckFilament, MSG_FILAMENT, lcd_check_filament_set); 1f896: 41 e6 ldi r20, 0x61 ; 97 1f898: 5c ef ldi r21, 0xFC ; 252 1f89a: 64 e3 ldi r22, 0x34 ; 52 1f89c: 79 e6 ldi r23, 0x69 ; 105 1f89e: 80 91 bc 03 lds r24, 0x03BC ; 0x8003bc 1f8a2: 0e 94 b2 e1 call 0x1c364 ; 0x1c364 MENU_END(); 1f8a6: 0f 94 90 92 call 0x32520 ; 0x32520 } } static void lcd_checking_menu(void) { MENU_BEGIN(); 1f8aa: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1f8ae: 8f 5f subi r24, 0xFF ; 255 1f8b0: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1f8b4: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1f8b8: 8f 5f subi r24, 0xFF ; 255 1f8ba: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1f8be: c1 cf rjmp .-126 ; 0x1f842 settings_check_toggle(&oCheckMode, _T(MSG_NOZZLE), lcd_check_mode_set); settings_check_toggle(&oCheckModel, _T(MSG_MODEL), lcd_check_model_set); settings_check_toggle(&oCheckVersion, MSG_FIRMWARE, lcd_check_version_set); settings_check_toggle(&oCheckFilament, MSG_FILAMENT, lcd_check_filament_set); MENU_END(); } 1f8c0: 08 95 ret 0001f8c2 : lcd_check_update_RAM(&oCheckVersion); eeprom_update_byte_notify((uint8_t*)EEPROM_CHECK_VERSION,(uint8_t)oCheckVersion); } static void lcd_check_filament_set() { lcd_check_update_RAM(&oCheckFilament); 1f8c2: 8c eb ldi r24, 0xBC ; 188 1f8c4: 93 e0 ldi r25, 0x03 ; 3 1f8c6: 0e 94 ae f7 call 0x1ef5c ; 0x1ef5c 1f8ca: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 1f8ce: 80 e2 ldi r24, 0x20 ; 32 1f8d0: 9c e0 ldi r25, 0x0C ; 12 1f8d2: 0d 94 00 a0 jmp 0x34000 ; 0x34000 0001f8d6 : lcd_check_update_RAM(&oCheckModel); eeprom_update_byte_notify((uint8_t*)EEPROM_CHECK_MODEL,(uint8_t)oCheckModel); } static void lcd_check_version_set() { lcd_check_update_RAM(&oCheckVersion); 1f8d6: 87 eb ldi r24, 0xB7 ; 183 1f8d8: 93 e0 ldi r25, 0x03 ; 3 1f8da: 0e 94 ae f7 call 0x1ef5c ; 0x1ef5c 1f8de: 60 91 b7 03 lds r22, 0x03B7 ; 0x8003b7 1f8e2: 83 ea ldi r24, 0xA3 ; 163 1f8e4: 9d e0 ldi r25, 0x0D ; 13 1f8e6: 0d 94 00 a0 jmp 0x34000 ; 0x34000 0001f8ea : lcd_check_update_RAM(&oCheckMode); eeprom_update_byte_notify((uint8_t*)EEPROM_CHECK_MODE,(uint8_t)oCheckMode); } static void lcd_check_model_set() { lcd_check_update_RAM(&oCheckModel); 1f8ea: 88 eb ldi r24, 0xB8 ; 184 1f8ec: 93 e0 ldi r25, 0x03 ; 3 1f8ee: 0e 94 ae f7 call 0x1ef5c ; 0x1ef5c 1f8f2: 60 91 b8 03 lds r22, 0x03B8 ; 0x8003b8 1f8f6: 84 ea ldi r24, 0xA4 ; 164 1f8f8: 9d e0 ldi r25, 0x0D ; 13 1f8fa: 0d 94 00 a0 jmp 0x34000 ; 0x34000 0001f8fe : *oCheckSetting = ClCheckMode::_None; } } static void lcd_check_mode_set() { lcd_check_update_RAM(&oCheckMode); 1f8fe: 8b eb ldi r24, 0xBB ; 187 1f900: 93 e0 ldi r25, 0x03 ; 3 1f902: 0e 94 ae f7 call 0x1ef5c ; 0x1ef5c 1f906: 60 91 bb 03 lds r22, 0x03BB ; 0x8003bb 1f90a: 88 ea ldi r24, 0xA8 ; 168 1f90c: 9d e0 ldi r25, 0x0D ; 13 1f90e: 0d 94 00 a0 jmp 0x34000 ; 0x34000 0001f912 : #endif //FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_actionNA_set(void) { Filament_sensor::SensorActionOnError act = fsensor.getActionOnError(); switch(act) { 1f912: 80 91 8c 16 lds r24, 0x168C ; 0x80168c case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; break; case Filament_sensor::SensorActionOnError::_Pause: act = Filament_sensor::SensorActionOnError::_Continue; 1f916: 60 e0 ldi r22, 0x00 ; 0 #endif //FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_actionNA_set(void) { Filament_sensor::SensorActionOnError act = fsensor.getActionOnError(); switch(act) { 1f918: 81 11 cpse r24, r1 1f91a: 01 c0 rjmp .+2 ; 0x1f91e case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; 1f91c: 61 e0 ldi r22, 0x01 ; 1 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_RUNOUT_ENABLED, state); } } void Filament_sensor::setActionOnError(SensorActionOnError state, bool updateEEPROM) { sensorActionOnError = state; 1f91e: 60 93 8c 16 sts 0x168C, r22 ; 0x80168c 1f922: 87 e4 ldi r24, 0x47 ; 71 1f924: 9d e0 ldi r25, 0x0D ; 13 1f926: 0d 94 00 a0 jmp 0x34000 ; 0x34000 0001f92a : static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); } static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); 1f92a: e4 e8 ldi r30, 0x84 ; 132 1f92c: f6 e1 ldi r31, 0x16 ; 22 1f92e: 61 81 ldd r22, Z+1 ; 0x01 1f930: 81 e0 ldi r24, 0x01 ; 1 1f932: 68 27 eor r22, r24 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1f934: 61 83 std Z+1, r22 ; 0x01 1f936: 87 e0 ldi r24, 0x07 ; 7 1f938: 9f e0 ldi r25, 0x0F ; 15 1f93a: 0d 94 00 a0 jmp 0x34000 ; 0x34000 0001f93e : static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); } static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); 1f93e: e4 e8 ldi r30, 0x84 ; 132 1f940: f6 e1 ldi r31, 0x16 ; 22 1f942: 62 81 ldd r22, Z+2 ; 0x02 1f944: 81 e0 ldi r24, 0x01 ; 1 1f946: 68 27 eor r22, r24 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1f948: 62 83 std Z+2, r22 ; 0x02 1f94a: 85 ed ldi r24, 0xD5 ; 213 1f94c: 9e e0 ldi r25, 0x0E ; 14 1f94e: 0d 94 00 a0 jmp 0x34000 ; 0x34000 0001f952 : lcd_return_to_status(); } void lcd_toshiba_flash_air_compatibility_toggle() { card.ToshibaFlashAir_enable(! card.ToshibaFlashAir_isEnabled()); 1f952: eb ed ldi r30, 0xDB ; 219 1f954: f5 e1 ldi r31, 0x15 ; 21 1f956: 60 81 ld r22, Z 1f958: 81 e0 ldi r24, 0x01 ; 1 1f95a: 68 27 eor r22, r24 1f95c: 60 83 st Z, r22 1f95e: 8b eb ldi r24, 0xBB ; 187 1f960: 9f e0 ldi r25, 0x0F ; 15 1f962: 0d 94 00 a0 jmp 0x34000 ; 0x34000 0001f966 : eeprom_update_byte_notify((uint8_t*)EEPROM_SOUND_MODE,(uint8_t)eSoundMode); } void Sound_CycleState(void) { switch(eSoundMode) 1f966: 80 91 15 04 lds r24, 0x0415 ; 0x800415 1f96a: 81 30 cpi r24, 0x01 ; 1 1f96c: 71 f0 breq .+28 ; 0x1f98a 1f96e: 20 f0 brcs .+8 ; 0x1f978 1f970: 82 30 cpi r24, 0x02 ; 2 1f972: 69 f4 brne .+26 ; 0x1f98e break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; 1f974: 83 e0 ldi r24, 0x03 ; 3 1f976: 01 c0 rjmp .+2 ; 0x1f97a void Sound_CycleState(void) { switch(eSoundMode) { case e_SOUND_MODE_LOUD: eSoundMode=e_SOUND_MODE_ONCE; 1f978: 81 e0 ldi r24, 0x01 ; 1 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; 1f97a: 80 93 15 04 sts 0x0415, r24 ; 0x800415 1f97e: 60 91 15 04 lds r22, 0x0415 ; 0x800415 1f982: 87 ed ldi r24, 0xD7 ; 215 1f984: 9e e0 ldi r25, 0x0E ; 14 1f986: 0d 94 00 a0 jmp 0x34000 ; 0x34000 1f98a: 82 e0 ldi r24, 0x02 ; 2 1f98c: f6 cf rjmp .-20 ; 0x1f97a break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; break; case e_SOUND_MODE_BLIND: eSoundMode=e_SOUND_MODE_LOUD; 1f98e: 10 92 15 04 sts 0x0415, r1 ; 0x800415 1f992: f5 cf rjmp .-22 ; 0x1f97e 0001f994 : MENU_END(); } void lcd_set_fan_check() { fans_check_enabled = !fans_check_enabled; 1f994: 60 91 40 02 lds r22, 0x0240 ; 0x800240 1f998: 81 e0 ldi r24, 0x01 ; 1 1f99a: 68 27 eor r22, r24 1f99c: 60 93 40 02 sts 0x0240, r22 ; 0x800240 1f9a0: 87 e8 ldi r24, 0x87 ; 135 1f9a2: 9f e0 ldi r25, 0x0F ; 15 1f9a4: 0f 94 00 a0 call 0x34000 ; 0x34000 eeprom_update_byte_notify((unsigned char *)EEPROM_FAN_CHECK_ENABLED, fans_check_enabled); #ifdef FANCHECK if (fans_check_enabled == false) fan_check_error = EFCE_OK; //reset error if fanCheck is disabled during error. Allows resuming print. 1f9a8: 80 91 40 02 lds r24, 0x0240 ; 0x800240 1f9ac: 81 11 cpse r24, r1 1f9ae: 02 c0 rjmp .+4 ; 0x1f9b4 1f9b0: 10 92 9c 03 sts 0x039C, r1 ; 0x80039c #endif //FANCHECK } 1f9b4: 08 95 ret 0001f9b6 : MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\ }\ }\ while (0) static void lcd_nozzle_diameter_cycle(void) { 1f9b6: cf 93 push r28 1f9b8: df 93 push r29 uint16_t nDiameter; switch(oNozzleDiameter){ 1f9ba: 80 91 b9 03 lds r24, 0x03B9 ; 0x8003b9 1f9be: 8c 33 cpi r24, 0x3C ; 60 1f9c0: e1 f0 breq .+56 ; 0x1f9fa 1f9c2: 80 35 cpi r24, 0x50 ; 80 1f9c4: 01 f1 breq .+64 ; 0x1fa06 1f9c6: 88 32 cpi r24, 0x28 ; 40 1f9c8: 91 f0 breq .+36 ; 0x1f9ee case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; 1f9ca: 88 e2 ldi r24, 0x28 ; 40 1f9cc: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 nDiameter=400; 1f9d0: c0 e9 ldi r28, 0x90 ; 144 1f9d2: d1 e0 ldi r29, 0x01 ; 1 1f9d4: 60 91 b9 03 lds r22, 0x03B9 ; 0x8003b9 1f9d8: 87 ea ldi r24, 0xA7 ; 167 1f9da: 9d e0 ldi r25, 0x0D ; 13 1f9dc: 0f 94 00 a0 call 0x34000 ; 0x34000 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 1f9e0: be 01 movw r22, r28 1f9e2: 85 ea ldi r24, 0xA5 ; 165 1f9e4: 9d e0 ldi r25, 0x0D ; 13 oNozzleDiameter=ClNozzleDiameter::_Diameter_400; nDiameter=400; } eeprom_update_byte_notify((uint8_t*)EEPROM_NOZZLE_DIAMETER,(uint8_t)oNozzleDiameter); eeprom_update_word_notify((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,nDiameter); } 1f9e6: df 91 pop r29 1f9e8: cf 91 pop r28 1f9ea: 0d 94 1e a0 jmp 0x3403c ; 0x3403c case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; nDiameter=400; break; case ClNozzleDiameter::_Diameter_400: oNozzleDiameter=ClNozzleDiameter::_Diameter_600; 1f9ee: 8c e3 ldi r24, 0x3C ; 60 1f9f0: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 nDiameter=600; 1f9f4: c8 e5 ldi r28, 0x58 ; 88 1f9f6: d2 e0 ldi r29, 0x02 ; 2 1f9f8: ed cf rjmp .-38 ; 0x1f9d4 break; case ClNozzleDiameter::_Diameter_600: oNozzleDiameter=ClNozzleDiameter::_Diameter_800; 1f9fa: 80 e5 ldi r24, 0x50 ; 80 1f9fc: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 nDiameter=800; 1fa00: c0 e2 ldi r28, 0x20 ; 32 1fa02: d3 e0 ldi r29, 0x03 ; 3 1fa04: e7 cf rjmp .-50 ; 0x1f9d4 break; case ClNozzleDiameter::_Diameter_800: oNozzleDiameter=ClNozzleDiameter::_Diameter_250; 1fa06: 89 e1 ldi r24, 0x19 ; 25 1fa08: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 nDiameter=250; 1fa0c: ca ef ldi r28, 0xFA ; 250 1fa0e: d0 e0 ldi r29, 0x00 ; 0 1fa10: e1 cf rjmp .-62 ; 0x1f9d4 0001fa12 : act = Filament_sensor::SensorActionOnError::_Continue; } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { 1fa12: cf 93 push r28 1fa14: df 93 push r29 MENU_BEGIN(); 1fa16: 0f 94 bc 92 call 0x32578 ; 0x32578 1fa1a: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1fa1e: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fa22: 84 30 cpi r24, 0x04 ; 4 1fa24: 08 f0 brcs .+2 ; 0x1fa28 1fa26: 96 c0 rjmp .+300 ; 0x1fb54 1fa28: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_BACK)); 1fa2c: 84 e1 ldi r24, 0x14 ; 20 1fa2e: 90 e4 ldi r25, 0x40 ; 64 1fa30: 0e 94 b1 6c call 0xd962 ; 0xd962 1fa34: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), fsensor.isEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_enabled_set); 1fa38: 80 91 84 16 lds r24, 0x1684 ; 0x801684 1fa3c: 88 23 and r24, r24 1fa3e: f1 f1 breq .+124 ; 0x1fabc 1fa40: 8f ea ldi r24, 0xAF ; 175 1fa42: 9a e5 ldi r25, 0x5A ; 90 1fa44: 0e 94 b1 6c call 0xd962 ; 0xd962 1fa48: ec 01 movw r28, r24 1fa4a: 8d e4 ldi r24, 0x4D ; 77 1fa4c: 9d e3 ldi r25, 0x3D ; 61 1fa4e: 0e 94 b1 6c call 0xd962 ; 0xd962 1fa52: 22 e0 ldi r18, 0x02 ; 2 1fa54: 4e e0 ldi r20, 0x0E ; 14 1fa56: 5e ef ldi r21, 0xFE ; 254 1fa58: be 01 movw r22, r28 1fa5a: 0f 94 4b 94 call 0x32896 ; 0x32896 1fa5e: 80 91 84 16 lds r24, 0x1684 ; 0x801684 if (fsensor.isEnabled()) { 1fa62: 88 23 and r24, r24 1fa64: 09 f4 brne .+2 ; 0x1fa68 1fa66: 66 c0 rjmp .+204 ; 0x1fb34 if (fsensor.isError()) { 1fa68: 83 30 cpi r24, 0x03 ; 3 1fa6a: 59 f5 brne .+86 ; 0x1fac2 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), _T(MSG_NA), fsensor_reinit); 1fa6c: 8c e8 ldi r24, 0x8C ; 140 1fa6e: 9d e3 ldi r25, 0x3D ; 61 1fa70: 0e 94 b1 6c call 0xd962 ; 0xd962 1fa74: ec 01 movw r28, r24 1fa76: 8c e4 ldi r24, 0x4C ; 76 1fa78: 95 e5 ldi r25, 0x55 ; 85 1fa7a: 0e 94 b1 6c call 0xd962 ; 0xd962 1fa7e: 22 e0 ldi r18, 0x02 ; 2 1fa80: 45 e1 ldi r20, 0x15 ; 21 1fa82: 5e ef ldi r21, 0xFE ; 254 1fa84: be 01 movw r22, r28 1fa86: 0f 94 4b 94 call 0x32896 ; 0x32896 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), _T(MSG_NA), fsensor_reinit); 1fa8a: 8c e8 ldi r24, 0x8C ; 140 1fa8c: 9d e3 ldi r25, 0x3D ; 61 1fa8e: 0e 94 b1 6c call 0xd962 ; 0xd962 1fa92: ec 01 movw r28, r24 1fa94: 8e e3 ldi r24, 0x3E ; 62 1fa96: 95 e5 ldi r25, 0x55 ; 85 1fa98: 0e 94 b1 6c call 0xd962 ; 0xd962 1fa9c: 22 e0 ldi r18, 0x02 ; 2 1fa9e: 45 e1 ldi r20, 0x15 ; 21 1faa0: 5e ef ldi r21, 0xFE ; 254 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_JAM_DETECTION), _T(MSG_NA), fsensor_reinit); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } else { MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), fsensor.getRunoutEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_runout_set); MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 1faa2: be 01 movw r22, r28 1faa4: 0f 94 4b 94 call 0x32896 ; 0x32896 #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_JAM_DETECTION), fsensor.getJamDetectionEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_jam_detection_set); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } switch(fsensor.getActionOnError()) { 1faa8: 80 91 8c 16 lds r24, 0x168C ; 0x80168c 1faac: 88 23 and r24, r24 1faae: 99 f1 breq .+102 ; 0x1fb16 1fab0: 81 30 cpi r24, 0x01 ; 1 1fab2: 09 f4 brne .+2 ; 0x1fab6 1fab4: 4c c0 rjmp .+152 ; 0x1fb4e break; case Filament_sensor::SensorActionOnError::_Pause: MENU_ITEM_TOGGLE_P(_T(MSG_FS_ACTION), _T(MSG_PAUSE), lcd_fsensor_actionNA_set); break; default: lcd_fsensor_actionNA_set(); 1fab6: 0e 94 89 fc call 0x1f912 ; 0x1f912 1faba: 3c c0 rjmp .+120 ; 0x1fb34 static void lcd_fsensor_settings_menu() { MENU_BEGIN(); MENU_ITEM_BACK_P(_T(MSG_BACK)); MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), fsensor.isEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_enabled_set); 1fabc: 89 ea ldi r24, 0xA9 ; 169 1fabe: 9a e5 ldi r25, 0x5A ; 90 1fac0: c1 cf rjmp .-126 ; 0x1fa44 #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_JAM_DETECTION), _T(MSG_NA), fsensor_reinit); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } else { MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), fsensor.getRunoutEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_runout_set); 1fac2: 80 91 86 16 lds r24, 0x1686 ; 0x801686 1fac6: 88 23 and r24, r24 1fac8: 01 f1 breq .+64 ; 0x1fb0a 1faca: 8f ea ldi r24, 0xAF ; 175 1facc: 9a e5 ldi r25, 0x5A ; 90 1face: 0e 94 b1 6c call 0xd962 ; 0xd962 1fad2: ec 01 movw r28, r24 1fad4: 8c e4 ldi r24, 0x4C ; 76 1fad6: 95 e5 ldi r25, 0x55 ; 85 1fad8: 0e 94 b1 6c call 0xd962 ; 0xd962 1fadc: 22 e0 ldi r18, 0x02 ; 2 1fade: 4f e9 ldi r20, 0x9F ; 159 1fae0: 5c ef ldi r21, 0xFC ; 252 1fae2: be 01 movw r22, r28 1fae4: 0f 94 4b 94 call 0x32896 ; 0x32896 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 1fae8: 80 91 85 16 lds r24, 0x1685 ; 0x801685 1faec: 88 23 and r24, r24 1faee: 81 f0 breq .+32 ; 0x1fb10 1faf0: 8f ea ldi r24, 0xAF ; 175 1faf2: 9a e5 ldi r25, 0x5A ; 90 1faf4: 0e 94 b1 6c call 0xd962 ; 0xd962 1faf8: ec 01 movw r28, r24 1fafa: 8e e3 ldi r24, 0x3E ; 62 1fafc: 95 e5 ldi r25, 0x55 ; 85 1fafe: 0e 94 b1 6c call 0xd962 ; 0xd962 1fb02: 22 e0 ldi r18, 0x02 ; 2 1fb04: 45 e9 ldi r20, 0x95 ; 149 1fb06: 5c ef ldi r21, 0xFC ; 252 1fb08: cc cf rjmp .-104 ; 0x1faa2 #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_JAM_DETECTION), _T(MSG_NA), fsensor_reinit); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } else { MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), fsensor.getRunoutEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_runout_set); 1fb0a: 89 ea ldi r24, 0xA9 ; 169 1fb0c: 9a e5 ldi r25, 0x5A ; 90 1fb0e: df cf rjmp .-66 ; 0x1face MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 1fb10: 89 ea ldi r24, 0xA9 ; 169 1fb12: 9a e5 ldi r25, 0x5A ; 90 1fb14: ef cf rjmp .-34 ; 0x1faf4 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } switch(fsensor.getActionOnError()) { case Filament_sensor::SensorActionOnError::_Continue: MENU_ITEM_TOGGLE_P(_T(MSG_FS_ACTION), _T(MSG_CONTINUE_SHORT), lcd_fsensor_actionNA_set); 1fb16: 86 e3 ldi r24, 0x36 ; 54 1fb18: 95 e5 ldi r25, 0x55 ; 85 break; case Filament_sensor::SensorActionOnError::_Pause: MENU_ITEM_TOGGLE_P(_T(MSG_FS_ACTION), _T(MSG_PAUSE), lcd_fsensor_actionNA_set); 1fb1a: 0e 94 b1 6c call 0xd962 ; 0xd962 1fb1e: ec 01 movw r28, r24 1fb20: 8a e2 ldi r24, 0x2A ; 42 1fb22: 95 e5 ldi r25, 0x55 ; 85 1fb24: 0e 94 b1 6c call 0xd962 ; 0xd962 1fb28: 22 e0 ldi r18, 0x02 ; 2 1fb2a: 49 e8 ldi r20, 0x89 ; 137 1fb2c: 5c ef ldi r21, 0xFC ; 252 1fb2e: be 01 movw r22, r28 1fb30: 0f 94 4b 94 call 0x32896 ; 0x32896 default: lcd_fsensor_actionNA_set(); } } MENU_END(); 1fb34: 0f 94 90 92 call 0x32520 ; 0x32520 } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { MENU_BEGIN(); 1fb38: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fb3c: 8f 5f subi r24, 0xFF ; 255 1fb3e: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1fb42: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1fb46: 8f 5f subi r24, 0xFF ; 255 1fb48: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1fb4c: 68 cf rjmp .-304 ; 0x1fa1e switch(fsensor.getActionOnError()) { case Filament_sensor::SensorActionOnError::_Continue: MENU_ITEM_TOGGLE_P(_T(MSG_FS_ACTION), _T(MSG_CONTINUE_SHORT), lcd_fsensor_actionNA_set); break; case Filament_sensor::SensorActionOnError::_Pause: MENU_ITEM_TOGGLE_P(_T(MSG_FS_ACTION), _T(MSG_PAUSE), lcd_fsensor_actionNA_set); 1fb4e: 82 e2 ldi r24, 0x22 ; 34 1fb50: 95 e5 ldi r25, 0x55 ; 85 1fb52: e3 cf rjmp .-58 ; 0x1fb1a lcd_fsensor_actionNA_set(); } } MENU_END(); } 1fb54: df 91 pop r29 1fb56: cf 91 pop r28 1fb58: 08 95 ret 0001fb5a : } } void SpoolJoin::toggleSpoolJoin() { if (eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Disabled) 1fb5a: 86 ed ldi r24, 0xD6 ; 214 1fb5c: 9e e0 ldi r25, 0x0E ; 14 1fb5e: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1fb62: 61 e0 ldi r22, 0x01 ; 1 1fb64: 82 30 cpi r24, 0x02 ; 2 1fb66: 09 f0 breq .+2 ; 0x1fb6a 1fb68: 62 e0 ldi r22, 0x02 ; 2 1fb6a: 86 ed ldi r24, 0xD6 ; 214 1fb6c: 9e e0 ldi r25, 0x0E ; 14 1fb6e: 0d 94 00 a0 jmp 0x34000 ; 0x34000 0001fb72 : } #ifdef MMU_HAS_CUTTER void lcd_cutter_enabled() { if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED)) 1fb72: 8e ec ldi r24, 0xCE ; 206 1fb74: 9e e0 ldi r25, 0x0E ; 14 1fb76: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1fb7a: 60 e0 ldi r22, 0x00 ; 0 1fb7c: 81 30 cpi r24, 0x01 ; 1 1fb7e: 09 f0 breq .+2 ; 0x1fb82 1fb80: 61 e0 ldi r22, 0x01 ; 1 1fb82: 8e ec ldi r24, 0xCE ; 206 1fb84: 9e e0 ldi r25, 0x0E ; 14 1fb86: 0d 94 00 a0 jmp 0x34000 ; 0x34000 0001fb8a : enquecommand_P(PSTR("M45 Z")); lcd_return_to_status(); } void lcd_temp_calibration_set() { bool temp_cal_active = eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE); 1fb8a: 8f ea ldi r24, 0xAF ; 175 1fb8c: 9f e0 ldi r25, 0x0F ; 15 1fb8e: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 temp_cal_active = !temp_cal_active; 1fb92: 61 e0 ldi r22, 0x01 ; 1 1fb94: 81 11 cpse r24, r1 1fb96: 60 e0 ldi r22, 0x00 ; 0 1fb98: 8f ea ldi r24, 0xAF ; 175 1fb9a: 9f e0 ldi r25, 0x0F ; 15 1fb9c: 0d 94 00 a0 jmp 0x34000 ; 0x34000 0001fba0 : } #ifdef SDCARD_SORT_ALPHA static void lcd_sort_type_set() { uint8_t sdSort; sdSort = eeprom_read_byte((uint8_t*) EEPROM_SD_SORT); 1fba0: 89 e0 ldi r24, 0x09 ; 9 1fba2: 9f e0 ldi r25, 0x0F ; 15 1fba4: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 switch (sdSort) { case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; 1fba8: 61 e0 ldi r22, 0x01 ; 1 #ifdef SDCARD_SORT_ALPHA static void lcd_sort_type_set() { uint8_t sdSort; sdSort = eeprom_read_byte((uint8_t*) EEPROM_SD_SORT); switch (sdSort) { 1fbaa: 88 23 and r24, r24 1fbac: 21 f0 breq .+8 ; 0x1fbb6 case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; 1fbae: 62 e0 ldi r22, 0x02 ; 2 #ifdef SDCARD_SORT_ALPHA static void lcd_sort_type_set() { uint8_t sdSort; sdSort = eeprom_read_byte((uint8_t*) EEPROM_SD_SORT); switch (sdSort) { 1fbb0: 81 30 cpi r24, 0x01 ; 1 1fbb2: 09 f0 breq .+2 ; 0x1fbb6 case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; default: sdSort = SD_SORT_TIME; 1fbb4: 60 e0 ldi r22, 0x00 ; 0 1fbb6: 89 e0 ldi r24, 0x09 ; 9 1fbb8: 9f e0 ldi r25, 0x0F ; 15 1fbba: 0f 94 00 a0 call 0x34000 ; 0x34000 } eeprom_update_byte_notify((uint8_t*)EEPROM_SD_SORT, sdSort); card.presort_flag = true; 1fbbe: 81 e0 ldi r24, 0x01 ; 1 1fbc0: 80 93 b9 13 sts 0x13B9, r24 ; 0x8013b9 } 1fbc4: 08 95 ret 0001fbc6 : } } #endif //MMU_HAS_CUTTER bool shouldPreheatOnlyNozzle() { uint8_t eeprom_setting = eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT); 1fbc6: 87 ea ldi r24, 0xA7 ; 167 1fbc8: 9c e0 ldi r25, 0x0C ; 12 1fbca: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 if (eeprom_setting != 0) 1fbce: 81 11 cpse r24, r1 1fbd0: 05 c0 rjmp .+10 ; 0x1fbdc return false; switch(eFilamentAction) { 1fbd2: 80 91 62 03 lds r24, 0x0362 ; 0x800362 1fbd6: 81 50 subi r24, 0x01 ; 1 1fbd8: 88 30 cpi r24, 0x08 ; 8 1fbda: 10 f0 brcs .+4 ; 0x1fbe0 #endif //MMU_HAS_CUTTER bool shouldPreheatOnlyNozzle() { uint8_t eeprom_setting = eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT); if (eeprom_setting != 0) return false; 1fbdc: 80 e0 ldi r24, 0x00 ; 0 1fbde: 08 95 ret case FilamentAction::MmuLoad: case FilamentAction::MmuUnLoad: case FilamentAction::MmuLoadingTest: case FilamentAction::MmuEject: case FilamentAction::MmuCut: return true; 1fbe0: 81 e0 ldi r24, 0x01 ; 1 default: return false; } } 1fbe2: 08 95 ret 0001fbe4 : #endif // MMU_FORCE_STEALTH_MODE } static void mmu_enable_switch() { uint8_t current_state = eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED); 1fbe4: 8c ea ldi r24, 0xAC ; 172 1fbe6: 9c e0 ldi r25, 0x0C ; 12 1fbe8: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 if (current_state) 1fbec: 88 23 and r24, r24 1fbee: 99 f0 breq .+38 ; 0x1fc16 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 1fbf0: 10 92 94 12 sts 0x1294, r1 ; 0x801294 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 1fbf4: 10 92 42 12 sts 0x1242, r1 ; 0x801242 currentScope = Scope::Stopped; 1fbf8: 10 92 27 12 sts 0x1227, r1 ; 0x801227 eeprom_update_byte_notify(dst++, pgm_read_byte(src++)); } } void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); 1fbfc: 8c ea ldi r24, 0xAC ; 172 1fbfe: 9c e0 ldi r25, 0x0C ; 12 1fc00: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1fc04: 61 e0 ldi r22, 0x01 ; 1 1fc06: 81 11 cpse r24, r1 1fc08: 60 e0 ldi r22, 0x00 ; 0 if (active) { uint8_t previous_value = eeprom_read_byte(dst); eeprom_byte_notify(dst, previous_value, value, true); } #endif //DEBUG_EEPROM_CHANGES eeprom_write_byte(dst, value); 1fc0a: 8c ea ldi r24, 0xAC ; 172 1fc0c: 9c e0 ldi r25, 0x0C ; 12 1fc0e: 0f 94 24 a0 call 0x34048 ; 0x34048 { MMU2::mmu2.Start(); } eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); 1fc12: 0d 94 98 41 jmp 0x28330 ; 0x28330 { MMU2::mmu2.Stop(); } else { MMU2::mmu2.Start(); 1fc16: 0f 94 9a 62 call 0x2c534 ; 0x2c534 1fc1a: f0 cf rjmp .-32 ; 0x1fbfc 0001fc1c : static void fsensor_reinit() { fsensor.init(); } static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); 1fc1c: 81 e0 ldi r24, 0x01 ; 1 1fc1e: 90 91 84 16 lds r25, 0x1684 ; 0x801684 1fc22: 91 11 cpse r25, r1 1fc24: 80 e0 ldi r24, 0x00 ; 0 1fc26: 0c 94 20 6e jmp 0xdc40 ; 0xdc40 0001fc2a : #endif // TMC2130 #ifdef FILAMENT_SENSOR static void fsensor_reinit() { fsensor.init(); 1fc2a: 0d 94 3e 53 jmp 0x2a67c ; 0x2a67c 0001fc2e : #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 1fc2e: 0e 94 27 6a call 0xd44e ; 0xd44e lcd_status_message_idx = 0; // Re-draw message from beginning 1fc32: 10 92 08 05 sts 0x0508, r1 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.417> } void lcd_return_to_status() { lcdui_refresh(); // to maybe revive the LCD if static electricity killed it. menu_goto(lcd_status_screen, 0, true); 1fc36: 20 e0 ldi r18, 0x00 ; 0 1fc38: 41 e0 ldi r20, 0x01 ; 1 1fc3a: 70 e0 ldi r23, 0x00 ; 0 1fc3c: 60 e0 ldi r22, 0x00 ; 0 1fc3e: 81 eb ldi r24, 0xB1 ; 177 1fc40: 97 e3 ldi r25, 0x37 ; 55 1fc42: 0f 94 e6 92 call 0x325cc ; 0x325cc menu_depth = 0; 1fc46: 10 92 ad 03 sts 0x03AD, r1 ; 0x8003ad eFilamentAction = FilamentAction::None; // i.e. non-autoLoad 1fc4a: 10 92 62 03 sts 0x0362, r1 ; 0x800362 } 1fc4e: 08 95 ret 0001fc50 : } } #if (LANG_MODE != 0) void lcd_language() { 1fc50: cf 93 push r28 1fc52: df 93 push r29 lcd_update_enable(true); 1fc54: 81 e0 ldi r24, 0x01 ; 1 1fc56: 0e 94 c0 69 call 0xd380 ; 0xd380 menu_goto(lcd_language_menu, 0, true, true); 1fc5a: 21 e0 ldi r18, 0x01 ; 1 1fc5c: 41 e0 ldi r20, 0x01 ; 1 1fc5e: 70 e0 ldi r23, 0x00 ; 0 1fc60: 60 e0 ldi r22, 0x00 ; 0 1fc62: 8d e1 ldi r24, 0x1D ; 29 1fc64: 98 e3 ldi r25, 0x38 ; 56 1fc66: 0f 94 e6 92 call 0x325cc ; 0x325cc 1fc6a: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout while ((menu_menu != lcd_status_screen) && (!lang_is_selected())) 1fc6e: c0 91 d0 03 lds r28, 0x03D0 ; 0x8003d0 1fc72: d0 91 d1 03 lds r29, 0x03D1 ; 0x8003d1 1fc76: 0e 94 a5 6b call 0xd74a ; 0xd74a 1fc7a: c1 5b subi r28, 0xB1 ; 177 1fc7c: d7 43 sbci r29, 0x37 ; 55 1fc7e: 39 f0 breq .+14 ; 0x1fc8e 1fc80: 81 11 cpse r24, r1 1fc82: 07 c0 rjmp .+14 ; 0x1fc92 { delay_keep_alive(50); 1fc84: 82 e3 ldi r24, 0x32 ; 50 1fc86: 90 e0 ldi r25, 0x00 ; 0 1fc88: 0e 94 48 7c call 0xf890 ; 0xf890 1fc8c: f0 cf rjmp .-32 ; 0x1fc6e } if (lang_is_selected()) 1fc8e: 88 23 and r24, r24 1fc90: 21 f0 breq .+8 ; 0x1fc9a lcd_return_to_status(); else lang_select(LANG_ID_PRI); } 1fc92: df 91 pop r29 1fc94: cf 91 pop r28 while ((menu_menu != lcd_status_screen) && (!lang_is_selected())) { delay_keep_alive(50); } if (lang_is_selected()) lcd_return_to_status(); 1fc96: 0c 94 17 fe jmp 0x1fc2e ; 0x1fc2e else lang_select(LANG_ID_PRI); 1fc9a: 80 e0 ldi r24, 0x00 ; 0 } 1fc9c: df 91 pop r29 1fc9e: cf 91 pop r28 delay_keep_alive(50); } if (lang_is_selected()) lcd_return_to_status(); else lang_select(LANG_ID_PRI); 1fca0: 0c 94 45 6c jmp 0xd88a ; 0xd88a 0001fca4 : MYSERIAL.begin(BAUDRATE); } #endif //HAS_SECOND_SERIAL_PORT void lcd_calibrate_pinda() { enquecommand_P(PSTR("G76")); 1fca4: 61 e0 ldi r22, 0x01 ; 1 1fca6: 8c e1 ldi r24, 0x1C ; 28 1fca8: 98 e9 ldi r25, 0x98 ; 152 1fcaa: 0e 94 af 7c call 0xf95e ; 0xf95e lcd_return_to_status(); 1fcae: 0c 94 17 fe jmp 0x1fc2e ; 0x1fc2e 0001fcb2 : lcd_return_to_status(); } void lcd_mesh_calibration_z() { enquecommand_P(PSTR("M45 Z")); 1fcb2: 61 e0 ldi r22, 0x01 ; 1 1fcb4: 86 e1 ldi r24, 0x16 ; 22 1fcb6: 98 e9 ldi r25, 0x98 ; 152 1fcb8: 0e 94 af 7c call 0xf95e ; 0xf95e lcd_return_to_status(); 1fcbc: 0c 94 17 fe jmp 0x1fc2e ; 0x1fc2e 0001fcc0 : lcd_return_to_status(); } void lcd_mesh_calibration() { enquecommand_P(PSTR("M45")); 1fcc0: 61 e0 ldi r22, 0x01 ; 1 1fcc2: 82 e1 ldi r24, 0x12 ; 18 1fcc4: 98 e9 ldi r25, 0x98 ; 152 1fcc6: 0e 94 af 7c call 0xf95e ; 0xf95e lcd_return_to_status(); 1fcca: 0c 94 17 fe jmp 0x1fc2e ; 0x1fc2e 0001fcce : } #endif //(LANG_MODE != 0) void lcd_mesh_bedleveling() { enquecommand_P(PSTR("G80")); 1fcce: 61 e0 ldi r22, 0x01 ; 1 1fcd0: 8e e0 ldi r24, 0x0E ; 14 1fcd2: 98 e9 ldi r25, 0x98 ; 152 1fcd4: 0e 94 af 7c call 0xf95e ; 0xf95e lcd_return_to_status(); 1fcd8: 0c 94 17 fe jmp 0x1fc2e ; 0x1fc2e 0001fcdc : menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 1fcdc: 0f 94 bc 92 call 0x32578 ; 0x32578 1fce0: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1fce4: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fce8: 84 30 cpi r24, 0x04 ; 4 1fcea: a8 f5 brcc .+106 ; 0x1fd56 1fcec: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 1fcf0: 87 ea ldi r24, 0xA7 ; 167 1fcf2: 9d e3 ldi r25, 0x3D ; 61 1fcf4: 0e 94 b1 6c call 0xd962 ; 0xd962 1fcf8: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_X), lcd_move_x); 1fcfc: 8b e8 ldi r24, 0x8B ; 139 1fcfe: 9d e4 ldi r25, 0x4D ; 77 1fd00: 0e 94 b1 6c call 0xd962 ; 0xd962 1fd04: 67 ec ldi r22, 0xC7 ; 199 1fd06: 76 e3 ldi r23, 0x36 ; 54 1fd08: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Y), lcd_move_y); 1fd0c: 82 e8 ldi r24, 0x82 ; 130 1fd0e: 9d e4 ldi r25, 0x4D ; 77 1fd10: 0e 94 b1 6c call 0xd962 ; 0xd962 1fd14: 6b ed ldi r22, 0xDB ; 219 1fd16: 76 e3 ldi r23, 0x36 ; 54 1fd18: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Z), lcd_move_z); 1fd1c: 89 e7 ldi r24, 0x79 ; 121 1fd1e: 9d e4 ldi r25, 0x4D ; 77 1fd20: 0e 94 b1 6c call 0xd962 ; 0xd962 1fd24: 6b e1 ldi r22, 0x1B ; 27 1fd26: 78 e3 ldi r23, 0x38 ; 56 1fd28: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(_T(MSG_EXTRUDER), lcd_move_e); 1fd2c: 8e e6 ldi r24, 0x6E ; 110 1fd2e: 9d e4 ldi r25, 0x4D ; 77 1fd30: 0e 94 b1 6c call 0xd962 ; 0xd962 1fd34: 67 ef ldi r22, 0xF7 ; 247 1fd36: 77 e3 ldi r23, 0x37 ; 55 1fd38: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_END(); 1fd3c: 0f 94 90 92 call 0x32520 ; 0x32520 menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 1fd40: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fd44: 8f 5f subi r24, 0xFF ; 255 1fd46: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1fd4a: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1fd4e: 8f 5f subi r24, 0xFF ; 255 1fd50: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1fd54: c7 cf rjmp .-114 ; 0x1fce4 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_X), lcd_move_x); MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Y), lcd_move_y); MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Z), lcd_move_z); MENU_ITEM_SUBMENU_P(_T(MSG_EXTRUDER), lcd_move_e); MENU_END(); } 1fd56: 08 95 ret 0001fd58 : //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 1fd58: 0f 94 bc 92 call 0x32578 ; 0x32578 1fd5c: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1fd60: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fd64: 84 30 cpi r24, 0x04 ; 4 1fd66: 68 f5 brcc .+90 ; 0x1fdc2 1fd68: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1fd6c: 88 ef ldi r24, 0xF8 ; 248 1fd6e: 9d e3 ldi r25, 0x3D ; 61 1fd70: 0e 94 b1 6c call 0xd962 ; 0xd962 1fd74: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_mmu_print); 1fd78: 8b ec ldi r24, 0xCB ; 203 1fd7a: 98 e4 ldi r25, 0x48 ; 72 1fd7c: 0e 94 b1 6c call 0xd962 ; 0xd962 1fd80: 6d ec ldi r22, 0xCD ; 205 1fd82: 77 e3 ldi r23, 0x37 ; 55 1fd84: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_mmu_total); 1fd88: 83 ec ldi r24, 0xC3 ; 195 1fd8a: 98 e4 ldi r25, 0x48 ; 72 1fd8c: 0e 94 b1 6c call 0xd962 ; 0xd962 1fd90: 6d ec ldi r22, 0xCD ; 205 1fd92: 76 e3 ldi r23, 0x36 ; 54 1fd94: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(_T(MSG_MATERIAL_CHANGES), lcd_menu_toolchange_stats_mmu_total); 1fd98: 87 e0 ldi r24, 0x07 ; 7 1fd9a: 99 e4 ldi r25, 0x49 ; 73 1fd9c: 0e 94 b1 6c call 0xd962 ; 0xd962 1fda0: 6d ed ldi r22, 0xDD ; 221 1fda2: 77 e3 ldi r23, 0x37 ; 55 1fda4: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_END(); 1fda8: 0f 94 90 92 call 0x32520 ; 0x32520 //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 1fdac: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fdb0: 8f 5f subi r24, 0xFF ; 255 1fdb2: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1fdb6: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1fdba: 8f 5f subi r24, 0xFF ; 255 1fdbc: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1fdc0: cf cf rjmp .-98 ; 0x1fd60 MENU_ITEM_BACK_P(_T(MSG_MAIN)); MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_mmu_print); MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_mmu_total); MENU_ITEM_SUBMENU_P(_T(MSG_MATERIAL_CHANGES), lcd_menu_toolchange_stats_mmu_total); MENU_END(); } 1fdc2: 08 95 ret 0001fdc4 : //! |Rear side [µm]: | MSG_BED_CORRECTION_REAR //! |Reset | MSG_BED_CORRECTION_RESET //! ---------------------- //! @endcode void lcd_adjust_bed(void) { 1fdc4: ef 92 push r14 1fdc6: ff 92 push r15 1fdc8: 0f 93 push r16 1fdca: 1f 93 push r17 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); if (_md->status == 0) 1fdcc: 80 91 71 03 lds r24, 0x0371 ; 0x800371 1fdd0: 81 11 cpse r24, r1 1fdd2: 35 c0 rjmp .+106 ; 0x1fe3e { // Menu was entered. if (eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1) 1fdd4: 80 ec ldi r24, 0xC0 ; 192 1fdd6: 9f e0 ldi r25, 0x0F ; 15 1fdd8: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1fddc: 81 30 cpi r24, 0x01 ; 1 1fdde: 61 f5 brne .+88 ; 0x1fe38 { _md->left = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_LEFT); 1fde0: 8f eb ldi r24, 0xBF ; 191 1fde2: 9f e0 ldi r25, 0x0F ; 15 1fde4: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1fde8: 08 2e mov r0, r24 1fdea: 00 0c add r0, r0 1fdec: 99 0b sbc r25, r25 1fdee: 90 93 73 03 sts 0x0373, r25 ; 0x800373 1fdf2: 80 93 72 03 sts 0x0372, r24 ; 0x800372 _md->right = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_RIGHT); 1fdf6: 8e eb ldi r24, 0xBE ; 190 1fdf8: 9f e0 ldi r25, 0x0F ; 15 1fdfa: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1fdfe: 08 2e mov r0, r24 1fe00: 00 0c add r0, r0 1fe02: 99 0b sbc r25, r25 1fe04: 90 93 75 03 sts 0x0375, r25 ; 0x800375 1fe08: 80 93 74 03 sts 0x0374, r24 ; 0x800374 _md->front = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_FRONT); 1fe0c: 8d eb ldi r24, 0xBD ; 189 1fe0e: 9f e0 ldi r25, 0x0F ; 15 1fe10: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1fe14: 08 2e mov r0, r24 1fe16: 00 0c add r0, r0 1fe18: 99 0b sbc r25, r25 1fe1a: 90 93 77 03 sts 0x0377, r25 ; 0x800377 1fe1e: 80 93 76 03 sts 0x0376, r24 ; 0x800376 _md->rear = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_REAR); 1fe22: 8c eb ldi r24, 0xBC ; 188 1fe24: 9f e0 ldi r25, 0x0F ; 15 1fe26: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 1fe2a: 08 2e mov r0, r24 1fe2c: 00 0c add r0, r0 1fe2e: 99 0b sbc r25, r25 1fe30: 90 93 79 03 sts 0x0379, r25 ; 0x800379 1fe34: 80 93 78 03 sts 0x0378, r24 ; 0x800378 } _md->status = 1; 1fe38: 81 e0 ldi r24, 0x01 ; 1 1fe3a: 80 93 71 03 sts 0x0371, r24 ; 0x800371 } MENU_BEGIN(); 1fe3e: 0f 94 bc 92 call 0x32578 ; 0x32578 1fe42: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1fe46: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fe4a: 84 30 cpi r24, 0x04 ; 4 1fe4c: 08 f0 brcs .+2 ; 0x1fe50 1fe4e: 6e c0 rjmp .+220 ; 0x1ff2c 1fe50: 10 92 31 04 sts 0x0431, r1 ; 0x800431 // leaving menu - this condition must be immediately before MENU_ITEM_BACK_P ON_MENU_LEAVE( 1fe54: 0f 94 3c 91 call 0x32278 ; 0x32278 1fe58: 88 23 and r24, r24 1fe5a: e9 f0 breq .+58 ; 0x1fe96 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1fe5c: 60 91 72 03 lds r22, 0x0372 ; 0x800372 1fe60: 8f eb ldi r24, 0xBF ; 191 1fe62: 9f e0 ldi r25, 0x0F ; 15 1fe64: 0f 94 00 a0 call 0x34000 ; 0x34000 1fe68: 60 91 76 03 lds r22, 0x0376 ; 0x800376 1fe6c: 8d eb ldi r24, 0xBD ; 189 1fe6e: 9f e0 ldi r25, 0x0F ; 15 1fe70: 0f 94 00 a0 call 0x34000 ; 0x34000 1fe74: 60 91 78 03 lds r22, 0x0378 ; 0x800378 1fe78: 8c eb ldi r24, 0xBC ; 188 1fe7a: 9f e0 ldi r25, 0x0F ; 15 1fe7c: 0f 94 00 a0 call 0x34000 ; 0x34000 1fe80: 60 91 74 03 lds r22, 0x0374 ; 0x800374 1fe84: 8e eb ldi r24, 0xBE ; 190 1fe86: 9f e0 ldi r25, 0x0F ; 15 1fe88: 0f 94 00 a0 call 0x34000 ; 0x34000 1fe8c: 61 e0 ldi r22, 0x01 ; 1 1fe8e: 80 ec ldi r24, 0xC0 ; 192 1fe90: 9f e0 ldi r25, 0x0F ; 15 1fe92: 0f 94 00 a0 call 0x34000 ; 0x34000 eeprom_update_byte_notify((uint8_t*)EEPROM_BED_CORRECTION_FRONT, (uint8_t)_md->front); eeprom_update_byte_notify((uint8_t*)EEPROM_BED_CORRECTION_REAR, (uint8_t)_md->rear); eeprom_update_byte_notify((uint8_t*)EEPROM_BED_CORRECTION_RIGHT, (uint8_t)_md->right); eeprom_update_byte_notify((uint8_t*)EEPROM_BED_CORRECTION_VALID, 1); ); MENU_ITEM_BACK_P(_T(MSG_BACK)); 1fe96: 84 e1 ldi r24, 0x14 ; 20 1fe98: 90 e4 ldi r25, 0x40 ; 64 1fe9a: 0e 94 b1 6c call 0xd962 ; 0xd962 1fe9e: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_LEFT), &_md->left, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 1fea2: 86 ee ldi r24, 0xE6 ; 230 1fea4: 9b e4 ldi r25, 0x4B ; 75 1fea6: 0e 94 b1 6c call 0xd962 ; 0xd962 1feaa: f1 2c mov r15, r1 1feac: e1 2c mov r14, r1 1feae: 04 e6 ldi r16, 0x64 ; 100 1feb0: 10 e0 ldi r17, 0x00 ; 0 1feb2: 2c e9 ldi r18, 0x9C ; 156 1feb4: 3f ef ldi r19, 0xFF ; 255 1feb6: 40 e1 ldi r20, 0x10 ; 16 1feb8: 62 e7 ldi r22, 0x72 ; 114 1feba: 73 e0 ldi r23, 0x03 ; 3 1febc: 0f 94 0c 93 call 0x32618 ; 0x32618 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_RIGHT), &_md->right, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 1fec0: 85 ed ldi r24, 0xD5 ; 213 1fec2: 9b e4 ldi r25, 0x4B ; 75 1fec4: 0e 94 b1 6c call 0xd962 ; 0xd962 1fec8: 2c e9 ldi r18, 0x9C ; 156 1feca: 3f ef ldi r19, 0xFF ; 255 1fecc: 40 e1 ldi r20, 0x10 ; 16 1fece: 64 e7 ldi r22, 0x74 ; 116 1fed0: 73 e0 ldi r23, 0x03 ; 3 1fed2: 0f 94 0c 93 call 0x32618 ; 0x32618 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_FRONT), &_md->front, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 1fed6: 84 ec ldi r24, 0xC4 ; 196 1fed8: 9b e4 ldi r25, 0x4B ; 75 1feda: 0e 94 b1 6c call 0xd962 ; 0xd962 1fede: 2c e9 ldi r18, 0x9C ; 156 1fee0: 3f ef ldi r19, 0xFF ; 255 1fee2: 40 e1 ldi r20, 0x10 ; 16 1fee4: 66 e7 ldi r22, 0x76 ; 118 1fee6: 73 e0 ldi r23, 0x03 ; 3 1fee8: 0f 94 0c 93 call 0x32618 ; 0x32618 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_REAR), &_md->rear, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 1feec: 83 eb ldi r24, 0xB3 ; 179 1feee: 9b e4 ldi r25, 0x4B ; 75 1fef0: 0e 94 b1 6c call 0xd962 ; 0xd962 1fef4: 2c e9 ldi r18, 0x9C ; 156 1fef6: 3f ef ldi r19, 0xFF ; 255 1fef8: 40 e1 ldi r20, 0x10 ; 16 1fefa: 68 e7 ldi r22, 0x78 ; 120 1fefc: 73 e0 ldi r23, 0x03 ; 3 1fefe: 0f 94 0c 93 call 0x32618 ; 0x32618 MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_adjust_bed_reset); 1ff02: 88 ec ldi r24, 0xC8 ; 200 1ff04: 9b e3 ldi r25, 0x3B ; 59 1ff06: 0e 94 b1 6c call 0xd962 ; 0xd962 1ff0a: 65 e3 ldi r22, 0x35 ; 53 1ff0c: 78 e3 ldi r23, 0x38 ; 56 1ff0e: 0f 94 39 92 call 0x32472 ; 0x32472 MENU_END(); 1ff12: 0f 94 90 92 call 0x32520 ; 0x32520 _md->front = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_FRONT); _md->rear = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_REAR); } _md->status = 1; } MENU_BEGIN(); 1ff16: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1ff1a: 8f 5f subi r24, 0xFF ; 255 1ff1c: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1ff20: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1ff24: 8f 5f subi r24, 0xFF ; 255 1ff26: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1ff2a: 8d cf rjmp .-230 ; 0x1fe46 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_RIGHT), &_md->right, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_FRONT), &_md->front, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_REAR), &_md->rear, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_adjust_bed_reset); MENU_END(); } 1ff2c: 1f 91 pop r17 1ff2e: 0f 91 pop r16 1ff30: ff 90 pop r15 1ff32: ef 90 pop r14 1ff34: 08 95 ret 0001ff36 : //! | | //! ---------------------- //! @endcode void pid_extruder() { lcd_clear(); 1ff36: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_puts_at_P(0, 0, _T(MSG_SET_TEMPERATURE)); 1ff3a: 87 ef ldi r24, 0xF7 ; 247 1ff3c: 9b e4 ldi r25, 0x4B ; 75 1ff3e: 0e 94 b1 6c call 0xd962 ; 0xd962 1ff42: ac 01 movw r20, r24 1ff44: 60 e0 ldi r22, 0x00 ; 0 1ff46: 80 e0 ldi r24, 0x00 ; 0 1ff48: 0e 94 8f 69 call 0xd31e ; 0xd31e pid_temp += lcd_encoder; 1ff4c: 80 91 4e 02 lds r24, 0x024E ; 0x80024e <_ZL8pid_temp.lto_priv.411> 1ff50: 90 91 4f 02 lds r25, 0x024F ; 0x80024f <_ZL8pid_temp.lto_priv.411+0x1> 1ff54: 20 91 06 05 lds r18, 0x0506 ; 0x800506 1ff58: 30 91 07 05 lds r19, 0x0507 ; 0x800507 1ff5c: 82 0f add r24, r18 1ff5e: 93 1f adc r25, r19 if (pid_temp > HEATER_0_MAXTEMP) pid_temp = HEATER_0_MAXTEMP; 1ff60: 82 33 cpi r24, 0x32 ; 50 1ff62: 21 e0 ldi r18, 0x01 ; 1 1ff64: 92 07 cpc r25, r18 1ff66: 50 f1 brcs .+84 ; 0x1ffbc 1ff68: 81 e3 ldi r24, 0x31 ; 49 1ff6a: 91 e0 ldi r25, 0x01 ; 1 else if (pid_temp < HEATER_0_MINTEMP) pid_temp = HEATER_0_MINTEMP; 1ff6c: 90 93 4f 02 sts 0x024F, r25 ; 0x80024f <_ZL8pid_temp.lto_priv.411+0x1> 1ff70: 80 93 4e 02 sts 0x024E, r24 ; 0x80024e <_ZL8pid_temp.lto_priv.411> lcd_encoder = 0; 1ff74: 10 92 07 05 sts 0x0507, r1 ; 0x800507 1ff78: 10 92 06 05 sts 0x0506, r1 ; 0x800506 lcd_set_cursor(1, 2); 1ff7c: 62 e0 ldi r22, 0x02 ; 2 1ff7e: 81 e0 ldi r24, 0x01 ; 1 1ff80: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_printf_P(PSTR("%3u"), pid_temp); 1ff84: 80 91 4f 02 lds r24, 0x024F ; 0x80024f <_ZL8pid_temp.lto_priv.411+0x1> 1ff88: 8f 93 push r24 1ff8a: 80 91 4e 02 lds r24, 0x024E ; 0x80024e <_ZL8pid_temp.lto_priv.411> 1ff8e: 8f 93 push r24 1ff90: 85 e7 ldi r24, 0x75 ; 117 1ff92: 97 e9 ldi r25, 0x97 ; 151 1ff94: 9f 93 push r25 1ff96: 8f 93 push r24 1ff98: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 if (lcd_clicked()) { 1ff9c: 0e 94 98 6b call 0xd730 ; 0xd730 1ffa0: 0f 90 pop r0 1ffa2: 0f 90 pop r0 1ffa4: 0f 90 pop r0 1ffa6: 0f 90 pop r0 1ffa8: 88 23 and r24, r24 1ffaa: 71 f0 breq .+28 ; 0x1ffc8 lcd_commands_type = LcdCommands::PidExtruder; 1ffac: 83 e0 ldi r24, 0x03 ; 3 1ffae: 80 93 c8 0d sts 0x0DC8, r24 ; 0x800dc8 lcd_return_to_status(); 1ffb2: 0e 94 17 fe call 0x1fc2e ; 0x1fc2e lcd_update(2); 1ffb6: 82 e0 ldi r24, 0x02 ; 2 1ffb8: 0c 94 42 69 jmp 0xd284 ; 0xd284 { lcd_clear(); lcd_puts_at_P(0, 0, _T(MSG_SET_TEMPERATURE)); pid_temp += lcd_encoder; if (pid_temp > HEATER_0_MAXTEMP) pid_temp = HEATER_0_MAXTEMP; else if (pid_temp < HEATER_0_MINTEMP) pid_temp = HEATER_0_MINTEMP; 1ffbc: 8e 31 cpi r24, 0x1E ; 30 1ffbe: 91 05 cpc r25, r1 1ffc0: a8 f6 brcc .-86 ; 0x1ff6c 1ffc2: 8e e1 ldi r24, 0x1E ; 30 1ffc4: 90 e0 ldi r25, 0x00 ; 0 1ffc6: d2 cf rjmp .-92 ; 0x1ff6c lcd_commands_type = LcdCommands::PidExtruder; lcd_return_to_status(); lcd_update(2); } } 1ffc8: 08 95 ret 0001ffca : #endif /* DEBUG_BUILD */ //! @brief common line print for lcd_menu_temperatures //! @param [in] ipgmLabel pointer to string in PROGMEM //! @param [in] value to be printed behind the label static void lcd_menu_temperatures_line(const char *ipgmLabel, int value){ 1ffca: cf 93 push r28 1ffcc: df 93 push r29 1ffce: cd b7 in r28, 0x3d ; 61 1ffd0: de b7 in r29, 0x3e ; 62 1ffd2: 2f 97 sbiw r28, 0x0f ; 15 1ffd4: 0f b6 in r0, 0x3f ; 63 1ffd6: f8 94 cli 1ffd8: de bf out 0x3e, r29 ; 62 1ffda: 0f be out 0x3f, r0 ; 63 1ffdc: cd bf out 0x3d, r28 ; 61 1ffde: fc 01 movw r30, r24 1ffe0: de 01 movw r26, r28 1ffe2: 11 96 adiw r26, 0x01 ; 1 //! it is better to reuse these texts even though it requires some extra formatting code. //! @param [in] ipgmLabel pointer to string in PROGMEM //! @param [out] pointer to string in RAM which will receive the formatted text. Must be allocated to appropriate size //! @param [in] dstSize allocated length of dst static void pgmtext_with_colon(const char *ipgmLabel, char *dst, uint8_t dstSize){ uint8_t i = 0; 1ffe4: 90 e0 ldi r25, 0x00 ; 0 1ffe6: 9d 01 movw r18, r26 for(; i < dstSize - 2; ++i){ // 2 byte less than buffer, we'd be adding a ':' to the end uint8_t b = pgm_read_byte(ipgmLabel + i); 1ffe8: 84 91 lpm r24, Z 1ffea: 41 e0 ldi r20, 0x01 ; 1 1ffec: 49 0f add r20, r25 if( ! b ) 1ffee: 88 23 and r24, r24 1fff0: 29 f0 breq .+10 ; 0x1fffc break; dst[i] = b; 1fff2: 8d 93 st X+, r24 1fff4: 31 96 adiw r30, 0x01 ; 1 1fff6: 94 2f mov r25, r20 //! @param [in] ipgmLabel pointer to string in PROGMEM //! @param [out] pointer to string in RAM which will receive the formatted text. Must be allocated to appropriate size //! @param [in] dstSize allocated length of dst static void pgmtext_with_colon(const char *ipgmLabel, char *dst, uint8_t dstSize){ uint8_t i = 0; for(; i < dstSize - 2; ++i){ // 2 byte less than buffer, we'd be adding a ':' to the end 1fff8: 4d 30 cpi r20, 0x0D ; 13 1fffa: b1 f7 brne .-20 ; 0x1ffe8 uint8_t b = pgm_read_byte(ipgmLabel + i); if( ! b ) break; dst[i] = b; } dst[i] = ':'; // append the colon 1fffc: f9 01 movw r30, r18 1fffe: e9 0f add r30, r25 20000: f1 1d adc r31, r1 20002: 8a e3 ldi r24, 0x3A ; 58 20004: 80 83 st Z, r24 ++i; 20006: 9f 5f subi r25, 0xFF ; 255 20008: f9 01 movw r30, r18 2000a: e9 0f add r30, r25 2000c: f1 1d adc r31, r1 for(; i < dstSize - 1; ++i) // fill the rest with spaces dst[i] = ' '; 2000e: 80 e2 ldi r24, 0x20 ; 32 break; dst[i] = b; } dst[i] = ':'; // append the colon ++i; for(; i < dstSize - 1; ++i) // fill the rest with spaces 20010: 9e 30 cpi r25, 0x0E ; 14 20012: 19 f0 breq .+6 ; 0x2001a dst[i] = ' '; 20014: 81 93 st Z+, r24 break; dst[i] = b; } dst[i] = ':'; // append the colon ++i; for(; i < dstSize - 1; ++i) // fill the rest with spaces 20016: 9f 5f subi r25, 0xFF ; 255 20018: fb cf rjmp .-10 ; 0x20010 dst[i] = ' '; dst[dstSize-1] = '\0'; // terminate the string properly 2001a: 1f 86 std Y+15, r1 ; 0x0f //! @param [in] value to be printed behind the label static void lcd_menu_temperatures_line(const char *ipgmLabel, int value){ static const size_t maxChars = 15; char tmp[maxChars]; pgmtext_with_colon(ipgmLabel, tmp, maxChars); lcd_printf_P(PSTR(" %s%3d" LCD_STR_DEGREE " \n"), tmp, value); // no need to add -14.14 to string alignment 2001c: 7f 93 push r23 2001e: 6f 93 push r22 20020: 3f 93 push r19 20022: 2f 93 push r18 20024: 88 e5 ldi r24, 0x58 ; 88 20026: 95 e9 ldi r25, 0x95 ; 149 20028: 9f 93 push r25 2002a: 8f 93 push r24 2002c: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 20030: 0f 90 pop r0 20032: 0f 90 pop r0 20034: 0f 90 pop r0 20036: 0f 90 pop r0 20038: 0f 90 pop r0 2003a: 0f 90 pop r0 } 2003c: 2f 96 adiw r28, 0x0f ; 15 2003e: 0f b6 in r0, 0x3f ; 63 20040: f8 94 cli 20042: de bf out 0x3e, r29 ; 62 20044: 0f be out 0x3f, r0 ; 63 20046: cd bf out 0x3d, r28 ; 61 20048: df 91 pop r29 2004a: cf 91 pop r28 2004c: 08 95 ret 0002004e : //! |>Continue | MSG_CONTINUE //! | Reset | MSG_RESET //! ---------------------- //! @endcode void lcd_first_layer_calibration_reset() { 2004e: af 92 push r10 20050: bf 92 push r11 20052: cf 92 push r12 20054: df 92 push r13 20056: ef 92 push r14 20058: ff 92 push r15 2005a: 0f 93 push r16 2005c: 1f 93 push r17 2005e: cf 93 push r28 20060: df 93 push r29 20062: 00 d0 rcall .+0 ; 0x20064 20064: 00 d0 rcall .+0 ; 0x20066 20066: 1f 92 push r1 20068: cd b7 in r28, 0x3d ; 61 2006a: de b7 in r29, 0x3e ; 62 } MenuData; static_assert(sizeof(menu_data)>= sizeof(MenuData),"_menu_data_t doesn't fit into menu_data"); MenuData* menuData = (MenuData*)&(menu_data[0]); if(LCD_CLICKED || !eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) || (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) || 2006c: 80 91 63 03 lds r24, 0x0363 ; 0x800363 20070: 81 11 cpse r24, r1 20072: 18 c0 rjmp .+48 ; 0x200a4 bool reset; } MenuData; static_assert(sizeof(menu_data)>= sizeof(MenuData),"_menu_data_t doesn't fit into menu_data"); MenuData* menuData = (MenuData*)&(menu_data[0]); if(LCD_CLICKED || !eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) || 20074: 81 ea ldi r24, 0xA1 ; 161 20076: 9d e0 ldi r25, 0x0D ; 13 20078: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 2007c: 18 2f mov r17, r24 2007e: 0e 94 18 6f call 0xde30 ; 0xde30 20082: 88 23 and r24, r24 20084: 79 f0 breq .+30 ; 0x200a4 (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) || 20086: 80 e1 ldi r24, 0x10 ; 16 20088: 0e 94 55 d8 call 0x1b0aa ; 0x1b0aa bool reset; } MenuData; static_assert(sizeof(menu_data)>= sizeof(MenuData),"_menu_data_t doesn't fit into menu_data"); MenuData* menuData = (MenuData*)&(menu_data[0]); if(LCD_CLICKED || !eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) || 2008c: 88 23 and r24, r24 2008e: 51 f0 breq .+20 ; 0x200a4 (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) || (0 == static_cast(eeprom_read_word(reinterpret_cast (&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))))) 20090: 2b e0 ldi r18, 0x0B ; 11 20092: 12 9f mul r17, r18 20094: c0 01 movw r24, r0 20096: 11 24 eor r1, r1 static_assert(sizeof(menu_data)>= sizeof(MenuData),"_menu_data_t doesn't fit into menu_data"); MenuData* menuData = (MenuData*)&(menu_data[0]); if(LCD_CLICKED || !eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) || (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) || (0 == static_cast(eeprom_read_word(reinterpret_cast 20098: 80 5b subi r24, 0xB0 ; 176 2009a: 92 4f sbci r25, 0xF2 ; 242 2009c: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 } MenuData; static_assert(sizeof(menu_data)>= sizeof(MenuData),"_menu_data_t doesn't fit into menu_data"); MenuData* menuData = (MenuData*)&(menu_data[0]); if(LCD_CLICKED || !eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) || (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) || 200a0: 89 2b or r24, r25 200a2: f1 f4 brne .+60 ; 0x200e0 (0 == static_cast(eeprom_read_word(reinterpret_cast (&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))))) { if (menuData->reset) 200a4: 80 91 64 03 lds r24, 0x0364 ; 0x800364 200a8: 88 23 and r24, r24 200aa: 71 f0 breq .+28 ; 0x200c8 { eeprom_update_word_notify(reinterpret_cast(&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset), 0xffff); 200ac: 81 ea ldi r24, 0xA1 ; 161 200ae: 9d e0 ldi r25, 0x0D ; 13 200b0: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 200b4: 2b e0 ldi r18, 0x0B ; 11 200b6: 82 9f mul r24, r18 200b8: c0 01 movw r24, r0 200ba: 11 24 eor r1, r1 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 200bc: 6f ef ldi r22, 0xFF ; 255 200be: 7f ef ldi r23, 0xFF ; 255 200c0: 80 5b subi r24, 0xB0 ; 176 200c2: 92 4f sbci r25, 0xF2 ; 242 200c4: 0f 94 1e a0 call 0x3403c ; 0x3403c } // If the knob was clicked, don't produce feedback // It should only be done when the firmware changes the menu // on its own (silently) menu_goto(lcd_v2_calibration, 0, true, !lcd_clicked()); 200c8: 0e 94 98 6b call 0xd730 ; 0xd730 200cc: 21 e0 ldi r18, 0x01 ; 1 200ce: 81 11 cpse r24, r1 200d0: 20 e0 ldi r18, 0x00 ; 0 200d2: 41 e0 ldi r20, 0x01 ; 1 200d4: 70 e0 ldi r23, 0x00 ; 0 200d6: 60 e0 ldi r22, 0x00 ; 0 200d8: 8f ef ldi r24, 0xFF ; 255 200da: 96 e3 ldi r25, 0x36 ; 54 200dc: 0f 94 e6 92 call 0x325cc ; 0x325cc } if (lcd_encoder) { 200e0: 20 91 06 05 lds r18, 0x0506 ; 0x800506 200e4: 30 91 07 05 lds r19, 0x0507 ; 0x800507 200e8: 21 15 cp r18, r1 200ea: 31 05 cpc r19, r1 200ec: 59 f0 breq .+22 ; 0x20104 menuData->reset = lcd_encoder > 0; 200ee: 81 e0 ldi r24, 0x01 ; 1 200f0: 12 16 cp r1, r18 200f2: 13 06 cpc r1, r19 200f4: 0c f0 brlt .+2 ; 0x200f8 200f6: 80 e0 ldi r24, 0x00 ; 0 200f8: 80 93 64 03 sts 0x0364, r24 ; 0x800364 lcd_encoder = 0; // Reset 200fc: 10 92 07 05 sts 0x0507, r1 ; 0x800507 20100: 10 92 06 05 sts 0x0506, r1 ; 0x800506 } char sheet_name[sizeof(Sheet::name)]; eeprom_read_block(sheet_name, &EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].name, sizeof(Sheet::name)); 20104: 81 ea ldi r24, 0xA1 ; 161 20106: 9d e0 ldi r25, 0x0D ; 13 20108: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 2010c: 1b e0 ldi r17, 0x0B ; 11 2010e: 81 9f mul r24, r17 20110: b0 01 movw r22, r0 20112: 11 24 eor r1, r1 20114: 67 5b subi r22, 0xB7 ; 183 20116: 72 4f sbci r23, 0xF2 ; 242 20118: 47 e0 ldi r20, 0x07 ; 7 2011a: 50 e0 ldi r21, 0x00 ; 0 2011c: ce 01 movw r24, r28 2011e: 01 96 adiw r24, 0x01 ; 1 20120: 7c 01 movw r14, r24 20122: 0f 94 cc 9f call 0x33f98 ; 0x33f98 lcd_home(); 20126: 0e 94 a7 69 call 0xd34e ; 0xd34e float offset = static_cast(eeprom_read_word(reinterpret_cast(&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)))/cs.axis_steps_per_mm[Z_AXIS]; 2012a: 81 ea ldi r24, 0xA1 ; 161 2012c: 9d e0 ldi r25, 0x0D ; 13 2012e: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 20132: 81 9f mul r24, r17 20134: c0 01 movw r24, r0 20136: 11 24 eor r1, r1 20138: 80 5b subi r24, 0xB0 ; 176 2013a: 92 4f sbci r25, 0xF2 ; 242 2013c: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 20140: bc 01 movw r22, r24 20142: 99 0f add r25, r25 20144: 88 0b sbc r24, r24 20146: 99 0b sbc r25, r25 20148: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2014c: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 20150: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 20154: 40 91 40 04 lds r20, 0x0440 ; 0x800440 20158: 50 91 41 04 lds r21, 0x0441 ; 0x800441 2015c: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 20160: d6 2e mov r13, r22 20162: c7 2e mov r12, r23 20164: b8 2e mov r11, r24 20166: a9 2e mov r10, r25 lcd_printf_P(_T(MSG_SHEET_OFFSET), 20168: 80 91 64 03 lds r24, 0x0364 ; 0x800364 2016c: 0e e3 ldi r16, 0x3E ; 62 2016e: 10 e2 ldi r17, 0x20 ; 32 20170: 81 11 cpse r24, r1 20172: 02 c0 rjmp .+4 ; 0x20178 20174: 00 e2 ldi r16, 0x20 ; 32 20176: 1e e3 ldi r17, 0x3E ; 62 20178: 84 e9 ldi r24, 0x94 ; 148 2017a: 9d e4 ldi r25, 0x4D ; 77 2017c: 0e 94 b1 6c call 0xd962 ; 0xd962 20180: 1f 92 push r1 20182: 0f 93 push r16 20184: 1f 92 push r1 20186: 1f 93 push r17 20188: af 92 push r10 2018a: bf 92 push r11 2018c: cf 92 push r12 2018e: df 92 push r13 20190: ff 92 push r15 20192: ef 92 push r14 20194: 9f 93 push r25 20196: 8f 93 push r24 20198: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 2019c: 0f b6 in r0, 0x3f ; 63 2019e: f8 94 cli 201a0: de bf out 0x3e, r29 ; 62 201a2: 0f be out 0x3f, r0 ; 63 201a4: cd bf out 0x3d, r28 ; 61 sheet_name, offset, menuData->reset ? ' ' : '>', menuData->reset ? '>' : ' ');// \n denotes line break, %.7s is replaced by 7 character long sheet name, %+1.3f is replaced by 6 character long floating point number, %c is replaced by > or white space (one character) based on whether first or second option is selected. % denoted place holders can not be reordered. } 201a6: 27 96 adiw r28, 0x07 ; 7 201a8: 0f b6 in r0, 0x3f ; 63 201aa: f8 94 cli 201ac: de bf out 0x3e, r29 ; 62 201ae: 0f be out 0x3f, r0 ; 63 201b0: cd bf out 0x3d, r28 ; 61 201b2: df 91 pop r29 201b4: cf 91 pop r28 201b6: 1f 91 pop r17 201b8: 0f 91 pop r16 201ba: ff 90 pop r15 201bc: ef 90 pop r14 201be: df 90 pop r13 201c0: cf 90 pop r12 201c2: bf 90 pop r11 201c4: af 90 pop r10 201c6: 08 95 ret 000201c8 : } #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { 201c8: cf 93 push r28 201ca: df 93 push r29 MENU_BEGIN(); 201cc: 0f 94 bc 92 call 0x32578 ; 0x32578 201d0: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 201d4: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 201d8: 84 30 cpi r24, 0x04 ; 4 201da: 08 f0 brcs .+2 ; 0x201de 201dc: 5c c0 rjmp .+184 ; 0x20296 201de: 10 92 31 04 sts 0x0431, r1 ; 0x800431 if (lang_is_selected()) MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); // 201e2: 0e 94 a5 6b call 0xd74a ; 0xd74a 201e6: 88 23 and r24, r24 201e8: 31 f0 breq .+12 ; 0x201f6 201ea: 87 ea ldi r24, 0xA7 ; 167 201ec: 9d e3 ldi r25, 0x3D ; 61 201ee: 0e 94 b1 6c call 0xd962 ; 0xd962 201f2: 0f 94 87 95 call 0x32b0e ; 0x32b0e if (menu_item_text_P(lang_get_name_by_code(lang_get_code(0)))) //primary language 201f6: 8e e6 ldi r24, 0x6E ; 110 201f8: 95 e6 ldi r25, 0x65 ; 101 201fa: 0e 94 bb 6b call 0xd776 ; 0xd776 201fe: 0f 94 6a 92 call 0x324d4 ; 0x324d4 20202: 88 23 and r24, r24 20204: 49 f0 breq .+18 ; 0x20218 #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { if (!lang_select(lang)) 20206: 80 e0 ldi r24, 0x00 ; 0 20208: 0e 94 45 6c call 0xd88a ; 0xd88a 2020c: 81 11 cpse r24, r1 2020e: 43 c0 rjmp .+134 ; 0x20296 MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 20210: df 91 pop r29 20212: cf 91 pop r28 20214: 0c 94 77 e1 jmp 0x1c2ee ; 0x1c2ee if (menu_item_text_P(lang_get_name_by_code(lang_get_code(0)))) //primary language { menu_setlang(0); return; } uint8_t cnt = lang_get_count(); 20218: 0e 94 22 6c call 0xd844 ; 0xd844 2021c: d8 2f mov r29, r24 } } else for (uint8_t i = 2; i < 8; i++) //skip seconday language - solved in lang_select (MK3) 'i < 8' for 7 official languages #else //XFLASH for (uint8_t i = 1; i < cnt; i++) //all seconday languages (MK2/25) 2021e: c1 e0 ldi r28, 0x01 ; 1 20220: cd 17 cp r28, r29 20222: 60 f5 brcc .+88 ; 0x2027c if (header.magic != LANG_MAGIC) break; //break if not valid if (--lang == 0) return header.code; addr += header.size; //calc address of next table } #else //XFLASH uint16_t table = _SEC_LANG_TABLE; 20224: 80 e0 ldi r24, 0x00 ; 0 20226: 91 e0 ldi r25, 0x01 ; 1 uint8_t count = 1; //count = 1 (primary) 20228: 21 e0 ldi r18, 0x01 ; 1 while (pgm_read_dword((uint32_t*)table) == LANG_MAGIC) //magic valid 2022a: fc 01 movw r30, r24 2022c: 45 91 lpm r20, Z+ 2022e: 55 91 lpm r21, Z+ 20230: 65 91 lpm r22, Z+ 20232: 74 91 lpm r23, Z 20234: 45 3a cpi r20, 0xA5 ; 165 20236: 5a 45 sbci r21, 0x5A ; 90 20238: 64 4b sbci r22, 0xB4 ; 180 2023a: 7b 44 sbci r23, 0x4B ; 75 2023c: 19 f0 breq .+6 ; 0x20244 if (count == lang) return pgm_read_word(((uint16_t*)(table + 10))); //read language code table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return LANG_CODE_XX; 2023e: 8f e3 ldi r24, 0x3F ; 63 20240: 9f e3 ldi r25, 0x3F ; 63 20242: 06 c0 rjmp .+12 ; 0x20250 #else //XFLASH uint16_t table = _SEC_LANG_TABLE; uint8_t count = 1; //count = 1 (primary) while (pgm_read_dword((uint32_t*)table) == LANG_MAGIC) //magic valid { if (count == lang) return pgm_read_word(((uint16_t*)(table + 10))); //read language code 20244: fc 01 movw r30, r24 20246: c2 13 cpse r28, r18 20248: 10 c0 rjmp .+32 ; 0x2026a 2024a: 3a 96 adiw r30, 0x0a ; 10 2024c: 85 91 lpm r24, Z+ 2024e: 94 91 lpm r25, Z #endif //XFLASH if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) 20250: 0e 94 bb 6b call 0xd776 ; 0xd776 20254: 0f 94 6a 92 call 0x324d4 ; 0x324d4 20258: 88 23 and r24, r24 2025a: 71 f0 breq .+28 ; 0x20278 #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { if (!lang_select(lang)) 2025c: 8c 2f mov r24, r28 2025e: 0e 94 45 6c call 0xd88a ; 0xd88a 20262: 81 11 cpse r24, r1 20264: 18 c0 rjmp .+48 ; 0x20296 20266: 8c 2f mov r24, r28 20268: d3 cf rjmp .-90 ; 0x20210 table += pgm_read_word((uint16_t*)(table + 4)); 2026a: 34 96 adiw r30, 0x04 ; 4 2026c: 45 91 lpm r20, Z+ 2026e: 54 91 lpm r21, Z 20270: 84 0f add r24, r20 20272: 95 1f adc r25, r21 count++; 20274: 2f 5f subi r18, 0xFF ; 255 20276: d9 cf rjmp .-78 ; 0x2022a } } else for (uint8_t i = 2; i < 8; i++) //skip seconday language - solved in lang_select (MK3) 'i < 8' for 7 official languages #else //XFLASH for (uint8_t i = 1; i < cnt; i++) //all seconday languages (MK2/25) 20278: cf 5f subi r28, 0xFF ; 255 2027a: d2 cf rjmp .-92 ; 0x20220 #ifdef XFLASH MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); 2027c: 0f 94 90 92 call 0x32520 ; 0x32520 #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { MENU_BEGIN(); 20280: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 20284: 8f 5f subi r24, 0xFF ; 255 20286: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 2028a: 80 91 30 04 lds r24, 0x0430 ; 0x800430 2028e: 8f 5f subi r24, 0xFF ; 255 20290: 80 93 30 04 sts 0x0430, r24 ; 0x800430 20294: 9f cf rjmp .-194 ; 0x201d4 MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 20296: df 91 pop r29 20298: cf 91 pop r28 2029a: 08 95 ret 0002029c : //! | | //! | | //! ---------------------- //! @endcode void lcd_menu_extruder_info() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") { 2029c: df 92 push r13 2029e: ef 92 push r14 202a0: ff 92 push r15 202a2: 0f 93 push r16 202a4: 1f 93 push r17 202a6: cf 93 push r28 202a8: df 93 push r29 202aa: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 202ae: 0e 94 a7 69 call 0xd34e ; 0xd34e lcd_printf_P(PSTR("%-15.15S%-5d\n" "%-15.15S%-5d\n"), _T(MSG_HOTEND_FAN_SPEED), 60*fan_speed[0], _T(MSG_PRINT_FAN_SPEED), 60*fan_speed[1] ); 202b2: c5 e8 ldi r28, 0x85 ; 133 202b4: d3 e0 ldi r29, 0x03 ; 3 202b6: 8a 81 ldd r24, Y+2 ; 0x02 202b8: 9b 81 ldd r25, Y+3 ; 0x03 202ba: 2c e3 ldi r18, 0x3C ; 60 202bc: f2 2e mov r15, r18 202be: f8 9e mul r15, r24 202c0: 80 01 movw r16, r0 202c2: f9 9e mul r15, r25 202c4: 10 0d add r17, r0 202c6: 11 24 eor r1, r1 202c8: 89 e3 ldi r24, 0x39 ; 57 202ca: 9f e3 ldi r25, 0x3F ; 63 202cc: 0e 94 b1 6c call 0xd962 ; 0xd962 202d0: e8 2e mov r14, r24 202d2: d9 2e mov r13, r25 202d4: 88 81 ld r24, Y 202d6: 99 81 ldd r25, Y+1 ; 0x01 202d8: f8 9e mul r15, r24 202da: e0 01 movw r28, r0 202dc: f9 9e mul r15, r25 202de: d0 0d add r29, r0 202e0: 11 24 eor r1, r1 202e2: 86 e4 ldi r24, 0x46 ; 70 202e4: 9f e3 ldi r25, 0x3F ; 63 202e6: 0e 94 b1 6c call 0xd962 ; 0xd962 202ea: 1f 93 push r17 202ec: 0f 93 push r16 202ee: df 92 push r13 202f0: ef 92 push r14 202f2: df 93 push r29 202f4: cf 93 push r28 202f6: 9f 93 push r25 202f8: 8f 93 push r24 202fa: 8e ec ldi r24, 0xCE ; 206 202fc: 94 e9 ldi r25, 0x94 ; 148 202fe: 9f 93 push r25 20300: 8f 93 push r24 20302: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 menu_back_if_clicked(); 20306: 8d b7 in r24, 0x3d ; 61 20308: 9e b7 in r25, 0x3e ; 62 2030a: 0a 96 adiw r24, 0x0a ; 10 2030c: 0f b6 in r0, 0x3f ; 63 2030e: f8 94 cli 20310: 9e bf out 0x3e, r25 ; 62 20312: 0f be out 0x3f, r0 ; 63 20314: 8d bf out 0x3d, r24 ; 61 } 20316: df 91 pop r29 20318: cf 91 pop r28 2031a: 1f 91 pop r17 2031c: 0f 91 pop r16 2031e: ff 90 pop r15 20320: ef 90 pop r14 20322: df 90 pop r13 { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P(PSTR("%-15.15S%-5d\n" "%-15.15S%-5d\n"), _T(MSG_HOTEND_FAN_SPEED), 60*fan_speed[0], _T(MSG_PRINT_FAN_SPEED), 60*fan_speed[1] ); menu_back_if_clicked(); 20324: 0d 94 26 96 jmp 0x32c4c ; 0x32c4c 00020328 : //! | PINDA: 000D| MSG_PINDA c=14 //! ---------------------- //! D - Degree sysmbol LCD_STR_DEGREE //! @endcode static void lcd_menu_temperatures() { 20328: cf 92 push r12 2032a: df 92 push r13 2032c: ef 92 push r14 2032e: ff 92 push r15 20330: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 20334: 0e 94 a7 69 call 0xd34e ; 0xd34e lcd_menu_temperatures_line( _T(MSG_NOZZLE), (int)current_temperature[0] ); 20338: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 2033c: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 20340: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 20344: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 20348: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 2034c: 6b 01 movw r12, r22 2034e: 88 e8 ldi r24, 0x88 ; 136 20350: 95 e5 ldi r25, 0x55 ; 85 20352: 0e 94 b1 6c call 0xd962 ; 0xd962 20356: b6 01 movw r22, r12 20358: 0e 94 e5 ff call 0x1ffca ; 0x1ffca lcd_menu_temperatures_line( _T(MSG_BED), (int)current_temperature_bed ); 2035c: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 20360: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 20364: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 20368: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 2036c: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 20370: 6b 01 movw r12, r22 20372: 8d e6 ldi r24, 0x6D ; 109 20374: 95 e5 ldi r25, 0x55 ; 85 20376: 0e 94 b1 6c call 0xd962 ; 0xd962 2037a: b6 01 movw r22, r12 2037c: 0e 94 e5 ff call 0x1ffca ; 0x1ffca #ifdef AMBIENT_THERMISTOR lcd_menu_temperatures_line( _T(MSG_AMBIENT), (int)current_temperature_ambient ); #endif //AMBIENT_THERMISTOR #ifdef PINDA_THERMISTOR lcd_menu_temperatures_line(MSG_PINDA, (int)current_temperature_pinda ); ////MSG_PINDA 20380: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 20384: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 20388: 80 91 90 06 lds r24, 0x0690 ; 0x800690 2038c: 90 91 91 06 lds r25, 0x0691 ; 0x800691 20390: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 20394: 88 e3 ldi r24, 0x38 ; 56 20396: 9b e6 ldi r25, 0x6B ; 107 20398: 0e 94 e5 ff call 0x1ffca ; 0x1ffca #endif //PINDA_THERMISTOR menu_back_if_clicked(); } 2039c: ff 90 pop r15 2039e: ef 90 pop r14 203a0: df 90 pop r13 203a2: cf 90 pop r12 lcd_menu_temperatures_line( _T(MSG_AMBIENT), (int)current_temperature_ambient ); #endif //AMBIENT_THERMISTOR #ifdef PINDA_THERMISTOR lcd_menu_temperatures_line(MSG_PINDA, (int)current_temperature_pinda ); ////MSG_PINDA #endif //PINDA_THERMISTOR menu_back_if_clicked(); 203a4: 0d 94 26 96 jmp 0x32c4c ; 0x32c4c 000203a8 : //! |Total failures | MSG_TOTAL_FAILURES c=20 //! | Fil. runouts 000| MSG_FIL_RUNOUTS c=15 //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { 203a8: bf 92 push r11 203aa: cf 92 push r12 203ac: df 92 push r13 203ae: ef 92 push r14 203b0: ff 92 push r15 203b2: 0f 93 push r16 203b4: 1f 93 push r17 203b6: cf 93 push r28 203b8: df 93 push r29 203ba: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout uint8_t filamentLast = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT); 203be: 85 e6 ldi r24, 0x65 ; 101 203c0: 9f e0 ldi r25, 0x0F ; 15 203c2: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 203c6: 18 2f mov r17, r24 uint16_t filamentTotal = clamp999( eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT) ); 203c8: 81 e0 ldi r24, 0x01 ; 1 203ca: 9f e0 ldi r25, 0x0F ; 15 203cc: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 203d0: 0e 94 ca f7 call 0x1ef94 ; 0x1ef94 203d4: c8 2e mov r12, r24 203d6: b9 2e mov r11, r25 lcd_home(); 203d8: 0e 94 a7 69 call 0xd34e ; 0xd34e lcd_printf_P(failStatsFmt, 203dc: 81 e4 ldi r24, 0x41 ; 65 203de: 99 e4 ldi r25, 0x49 ; 73 203e0: 0e 94 b1 6c call 0xd962 ; 0xd962 203e4: e8 2e mov r14, r24 203e6: d9 2e mov r13, r25 203e8: 80 e3 ldi r24, 0x30 ; 48 203ea: 99 e4 ldi r25, 0x49 ; 73 203ec: 0e 94 b1 6c call 0xd962 ; 0xd962 203f0: 08 2f mov r16, r24 203f2: f9 2e mov r15, r25 203f4: 81 e4 ldi r24, 0x41 ; 65 203f6: 99 e4 ldi r25, 0x49 ; 73 203f8: 0e 94 b1 6c call 0xd962 ; 0xd962 203fc: ec 01 movw r28, r24 203fe: 8a e1 ldi r24, 0x1A ; 26 20400: 99 e4 ldi r25, 0x49 ; 73 20402: 0e 94 b1 6c call 0xd962 ; 0xd962 20406: bf 92 push r11 20408: cf 92 push r12 2040a: df 92 push r13 2040c: ef 92 push r14 2040e: ff 92 push r15 20410: 0f 93 push r16 20412: 1f 92 push r1 20414: 1f 93 push r17 20416: df 93 push r29 20418: cf 93 push r28 2041a: 9f 93 push r25 2041c: 8f 93 push r24 2041e: 85 e3 ldi r24, 0x35 ; 53 20420: 95 e9 ldi r25, 0x95 ; 149 20422: 9f 93 push r25 20424: 8f 93 push r24 20426: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 _T(MSG_LAST_PRINT_FAILURES), _T(MSG_FIL_RUNOUTS), filamentLast, _T(MSG_TOTAL_FAILURES), _T(MSG_FIL_RUNOUTS), filamentTotal); menu_back_if_clicked(); 2042a: 8d b7 in r24, 0x3d ; 61 2042c: 9e b7 in r25, 0x3e ; 62 2042e: 0e 96 adiw r24, 0x0e ; 14 20430: 0f b6 in r0, 0x3f ; 63 20432: f8 94 cli 20434: 9e bf out 0x3e, r25 ; 62 20436: 0f be out 0x3f, r0 ; 63 20438: 8d bf out 0x3d, r24 ; 61 } 2043a: df 91 pop r29 2043c: cf 91 pop r28 2043e: 1f 91 pop r17 20440: 0f 91 pop r16 20442: ff 90 pop r15 20444: ef 90 pop r14 20446: df 90 pop r13 20448: cf 90 pop r12 2044a: bf 90 pop r11 _T(MSG_LAST_PRINT_FAILURES), _T(MSG_FIL_RUNOUTS), filamentLast, _T(MSG_TOTAL_FAILURES), _T(MSG_FIL_RUNOUTS), filamentTotal); menu_back_if_clicked(); 2044c: 0d 94 26 96 jmp 0x32c4c ; 0x32c4c 00020450 : //! | MMU fails 000| MSG_MMU_FAILS c=15 //! | MMU load fails 000| MSG_MMU_LOAD_FAILS c=15 //! | MMU power fails 000| MSG_MMU_POWER_FAILS c=15 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_total() { 20450: 8f 92 push r8 20452: 9f 92 push r9 20454: af 92 push r10 20456: bf 92 push r11 20458: cf 92 push r12 2045a: df 92 push r13 2045c: ef 92 push r14 2045e: ff 92 push r15 20460: 0f 93 push r16 20462: 1f 93 push r17 20464: cf 93 push r28 20466: df 93 push r29 20468: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 2046c: 0e 94 a7 69 call 0xd34e ; 0xd34e lcd_printf_P( 20470: 80 91 9a 12 lds r24, 0x129A ; 0x80129a 20474: 90 91 9b 12 lds r25, 0x129B ; 0x80129b 20478: 0e 94 ca f7 call 0x1ef94 ; 0x1ef94 2047c: 98 2e mov r9, r24 2047e: 89 2e mov r8, r25 20480: 85 ef ldi r24, 0xF5 ; 245 20482: 98 e4 ldi r25, 0x48 ; 72 20484: 0e 94 b1 6c call 0xd962 ; 0xd962 20488: b8 2e mov r11, r24 2048a: a9 2e mov r10, r25 2048c: 80 ed ldi r24, 0xD0 ; 208 2048e: 9e e0 ldi r25, 0x0E ; 14 20490: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 20494: 0e 94 ca f7 call 0x1ef94 ; 0x1ef94 20498: d8 2e mov r13, r24 2049a: c9 2e mov r12, r25 2049c: 84 ee ldi r24, 0xE4 ; 228 2049e: 98 e4 ldi r25, 0x48 ; 72 204a0: 0e 94 b1 6c call 0xd962 ; 0xd962 204a4: f8 2e mov r15, r24 204a6: e9 2e mov r14, r25 204a8: 83 ed ldi r24, 0xD3 ; 211 204aa: 9e e0 ldi r25, 0x0E ; 14 204ac: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 204b0: 0e 94 ca f7 call 0x1ef94 ; 0x1ef94 204b4: 18 2f mov r17, r24 204b6: 09 2f mov r16, r25 204b8: 88 ed ldi r24, 0xD8 ; 216 204ba: 98 e4 ldi r25, 0x48 ; 72 204bc: 0e 94 b1 6c call 0xd962 ; 0xd962 204c0: ec 01 movw r28, r24 204c2: 80 e3 ldi r24, 0x30 ; 48 204c4: 99 e4 ldi r25, 0x49 ; 73 204c6: 0e 94 b1 6c call 0xd962 ; 0xd962 204ca: 8f 92 push r8 204cc: 9f 92 push r9 204ce: af 92 push r10 204d0: bf 92 push r11 204d2: cf 92 push r12 204d4: df 92 push r13 204d6: ef 92 push r14 204d8: ff 92 push r15 204da: 0f 93 push r16 204dc: 1f 93 push r17 204de: df 93 push r29 204e0: cf 93 push r28 204e2: 9f 93 push r25 204e4: 8f 93 push r24 204e6: 88 e0 ldi r24, 0x08 ; 8 204e8: 95 e9 ldi r25, 0x95 ; 149 204ea: 9f 93 push r25 204ec: 8f 93 push r24 204ee: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 ), _T(MSG_TOTAL_FAILURES), _T(MSG_MMU_FAILS), clamp999( eeprom_read_word((uint16_t*)EEPROM_MMU_FAIL_TOT) ), _T(MSG_MMU_LOAD_FAILS), clamp999( eeprom_read_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT) ), _T(MSG_MMU_POWER_FAILS), clamp999( MMU2::mmu2.TMCFailures() )); menu_back_if_clicked(); 204f2: 8d b7 in r24, 0x3d ; 61 204f4: 9e b7 in r25, 0x3e ; 62 204f6: 40 96 adiw r24, 0x10 ; 16 204f8: 0f b6 in r0, 0x3f ; 63 204fa: f8 94 cli 204fc: 9e bf out 0x3e, r25 ; 62 204fe: 0f be out 0x3f, r0 ; 63 20500: 8d bf out 0x3d, r24 ; 61 } 20502: df 91 pop r29 20504: cf 91 pop r28 20506: 1f 91 pop r17 20508: 0f 91 pop r16 2050a: ff 90 pop r15 2050c: ef 90 pop r14 2050e: df 90 pop r13 20510: cf 90 pop r12 20512: bf 90 pop r11 20514: af 90 pop r10 20516: 9f 90 pop r9 20518: 8f 90 pop r8 ), _T(MSG_TOTAL_FAILURES), _T(MSG_MMU_FAILS), clamp999( eeprom_read_word((uint16_t*)EEPROM_MMU_FAIL_TOT) ), _T(MSG_MMU_LOAD_FAILS), clamp999( eeprom_read_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT) ), _T(MSG_MMU_POWER_FAILS), clamp999( MMU2::mmu2.TMCFailures() )); menu_back_if_clicked(); 2051a: 0d 94 26 96 jmp 0x32c4c ; 0x32c4c 0002051e : //! | MMU fails 000| MSG_MMU_FAILS c=15 //! | MMU load fails 000| MSG_MMU_LOAD_FAILS c=15 //! | | //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { 2051e: cf 92 push r12 20520: df 92 push r13 20522: ef 92 push r14 20524: ff 92 push r15 20526: 0f 93 push r16 20528: 1f 93 push r17 2052a: cf 93 push r28 2052c: df 93 push r29 2052e: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 20532: 0e 94 a7 69 call 0xd34e ; 0xd34e " %-16.16S%-3d\n" " %-16.16S%-3d" ), _T(MSG_LAST_PRINT_FAILURES), _T(MSG_MMU_FAILS), clamp999( eeprom_read_byte((uint8_t*)EEPROM_MMU_FAIL) ), _T(MSG_MMU_LOAD_FAILS), clamp999( eeprom_read_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL) )); 20536: 8f ec ldi r24, 0xCF ; 207 20538: 9e e0 ldi r25, 0x0E ; 14 2053a: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 2053e: 90 e0 ldi r25, 0x00 ; 0 20540: 0e 94 ca f7 call 0x1ef94 ; 0x1ef94 20544: d8 2e mov r13, r24 20546: c9 2e mov r12, r25 20548: 84 ee ldi r24, 0xE4 ; 228 2054a: 98 e4 ldi r25, 0x48 ; 72 2054c: 0e 94 b1 6c call 0xd962 ; 0xd962 20550: f8 2e mov r15, r24 20552: e9 2e mov r14, r25 PSTR("%S\n" " %-16.16S%-3d\n" " %-16.16S%-3d" ), _T(MSG_LAST_PRINT_FAILURES), _T(MSG_MMU_FAILS), clamp999( eeprom_read_byte((uint8_t*)EEPROM_MMU_FAIL) ), 20554: 82 ed ldi r24, 0xD2 ; 210 20556: 9e e0 ldi r25, 0x0E ; 14 20558: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 2055c: 90 e0 ldi r25, 0x00 ; 0 2055e: 0e 94 ca f7 call 0x1ef94 ; 0x1ef94 20562: 18 2f mov r17, r24 20564: 09 2f mov r16, r25 20566: 88 ed ldi r24, 0xD8 ; 216 20568: 98 e4 ldi r25, 0x48 ; 72 2056a: 0e 94 b1 6c call 0xd962 ; 0xd962 2056e: ec 01 movw r28, r24 20570: 8a e1 ldi r24, 0x1A ; 26 20572: 99 e4 ldi r25, 0x49 ; 73 20574: 0e 94 b1 6c call 0xd962 ; 0xd962 20578: cf 92 push r12 2057a: df 92 push r13 2057c: ef 92 push r14 2057e: ff 92 push r15 20580: 0f 93 push r16 20582: 1f 93 push r17 20584: df 93 push r29 20586: cf 93 push r28 20588: 9f 93 push r25 2058a: 8f 93 push r24 2058c: 89 ee ldi r24, 0xE9 ; 233 2058e: 94 e9 ldi r25, 0x94 ; 148 20590: 9f 93 push r25 20592: 8f 93 push r24 20594: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 " %-16.16S%-3d" ), _T(MSG_LAST_PRINT_FAILURES), _T(MSG_MMU_FAILS), clamp999( eeprom_read_byte((uint8_t*)EEPROM_MMU_FAIL) ), _T(MSG_MMU_LOAD_FAILS), clamp999( eeprom_read_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL) )); menu_back_if_clicked(); 20598: 8d b7 in r24, 0x3d ; 61 2059a: 9e b7 in r25, 0x3e ; 62 2059c: 0c 96 adiw r24, 0x0c ; 12 2059e: 0f b6 in r0, 0x3f ; 63 205a0: f8 94 cli 205a2: 9e bf out 0x3e, r25 ; 62 205a4: 0f be out 0x3f, r0 ; 63 205a6: 8d bf out 0x3d, r24 ; 61 } 205a8: df 91 pop r29 205aa: cf 91 pop r28 205ac: 1f 91 pop r17 205ae: 0f 91 pop r16 205b0: ff 90 pop r15 205b2: ef 90 pop r14 205b4: df 90 pop r13 205b6: cf 90 pop r12 " %-16.16S%-3d" ), _T(MSG_LAST_PRINT_FAILURES), _T(MSG_MMU_FAILS), clamp999( eeprom_read_byte((uint8_t*)EEPROM_MMU_FAIL) ), _T(MSG_MMU_LOAD_FAILS), clamp999( eeprom_read_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL) )); menu_back_if_clicked(); 205b8: 0d 94 26 96 jmp 0x32c4c ; 0x32c4c 000205bc : } #endif // not defined TMC2130 static void lcd_print_state(uint8_t state) { switch (state) { 205bc: 81 30 cpi r24, 0x01 ; 1 205be: 21 f4 brne .+8 ; 0x205c8 case STATE_ON: lcd_puts_P(_N(" 1")); 205c0: 8e e2 ldi r24, 0x2E ; 46 205c2: 9b e6 ldi r25, 0x6B ; 107 break; case STATE_OFF: lcd_puts_P(_N(" 0")); 205c4: 0c 94 66 69 jmp 0xd2cc ; 0xd2cc 205c8: 8a e2 ldi r24, 0x2A ; 42 205ca: 9b e6 ldi r25, 0x6B ; 107 205cc: fb cf rjmp .-10 ; 0x205c4 000205ce : //! |Right: 00.00mm| MSG_RIGHT c=10, c=8 //! ---------------------- //! @endcode //! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations. static void lcd_menu_xyz_y_min() { 205ce: 2f 92 push r2 205d0: 3f 92 push r3 205d2: 4f 92 push r4 205d4: 5f 92 push r5 205d6: 6f 92 push r6 205d8: 7f 92 push r7 205da: 8f 92 push r8 205dc: 9f 92 push r9 205de: af 92 push r10 205e0: bf 92 push r11 205e2: cf 92 push r12 205e4: df 92 push r13 205e6: ef 92 push r14 205e8: ff 92 push r15 205ea: 0f 93 push r16 205ec: 1f 93 push r17 205ee: cf 93 push r28 205f0: df 93 push r29 205f2: cd b7 in r28, 0x3d ; 61 205f4: de b7 in r29, 0x3e ; 62 205f6: a8 97 sbiw r28, 0x28 ; 40 205f8: 0f b6 in r0, 0x3f ; 63 205fa: f8 94 cli 205fc: de bf out 0x3e, r29 ; 62 205fe: 0f be out 0x3f, r0 ; 63 20600: cd bf out 0x3d, r28 ; 61 void count_xyz_details(float (&distanceMin)[2]) { float cntr[2]; float vec_x[2]; float vec_y[2]; eeprom_read_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8); 20602: 48 e0 ldi r20, 0x08 ; 8 20604: 50 e0 ldi r21, 0x00 ; 0 20606: 65 ee ldi r22, 0xE5 ; 229 20608: 7f e0 ldi r23, 0x0F ; 15 2060a: ce 01 movw r24, r28 2060c: 41 96 adiw r24, 0x11 ; 17 2060e: 0f 94 cc 9f call 0x33f98 ; 0x33f98 eeprom_read_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8); 20612: 48 e0 ldi r20, 0x08 ; 8 20614: 50 e0 ldi r21, 0x00 ; 0 20616: 6d ed ldi r22, 0xDD ; 221 20618: 7f e0 ldi r23, 0x0F ; 15 2061a: ce 01 movw r24, r28 2061c: 09 96 adiw r24, 0x09 ; 9 2061e: 0f 94 cc 9f call 0x33f98 ; 0x33f98 eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 20622: 48 e0 ldi r20, 0x08 ; 8 20624: 50 e0 ldi r21, 0x00 ; 0 20626: 65 ed ldi r22, 0xD5 ; 213 20628: 7f e0 ldi r23, 0x0F ; 15 2062a: ce 01 movw r24, r28 2062c: 01 96 adiw r24, 0x01 ; 1 2062e: 0f 94 cc 9f call 0x33f98 ; 0x33f98 for (uint8_t mesh_point = 0; mesh_point < 2; ++mesh_point) { float y = vec_x[1] * pgm_read_float(bed_ref_points_4 + mesh_point * 2) + vec_y[1] * pgm_read_float(bed_ref_points_4 + mesh_point * 2 + 1) + cntr[1]; 20632: 8d 84 ldd r8, Y+13 ; 0x0d 20634: 9e 84 ldd r9, Y+14 ; 0x0e 20636: af 84 ldd r10, Y+15 ; 0x0f 20638: b8 88 ldd r11, Y+16 ; 0x10 2063a: ec e4 ldi r30, 0x4C ; 76 2063c: f8 e8 ldi r31, 0x88 ; 136 2063e: 25 91 lpm r18, Z+ 20640: 35 91 lpm r19, Z+ 20642: 45 91 lpm r20, Z+ 20644: 54 91 lpm r21, Z 20646: cd 80 ldd r12, Y+5 ; 0x05 20648: de 80 ldd r13, Y+6 ; 0x06 2064a: ef 80 ldd r14, Y+7 ; 0x07 2064c: f8 84 ldd r15, Y+8 ; 0x08 2064e: e0 e5 ldi r30, 0x50 ; 80 20650: f8 e8 ldi r31, 0x88 ; 136 20652: 85 91 lpm r24, Z+ 20654: 95 91 lpm r25, Z+ 20656: a5 91 lpm r26, Z+ 20658: b4 91 lpm r27, Z 2065a: 8d a3 std Y+37, r24 ; 0x25 2065c: 9e a3 std Y+38, r25 ; 0x26 2065e: af a3 std Y+39, r26 ; 0x27 20660: b8 a7 std Y+40, r27 ; 0x28 20662: 8d 89 ldd r24, Y+21 ; 0x15 20664: 9e 89 ldd r25, Y+22 ; 0x16 20666: af 89 ldd r26, Y+23 ; 0x17 20668: b8 8d ldd r27, Y+24 ; 0x18 2066a: 89 a3 std Y+33, r24 ; 0x21 2066c: 9a a3 std Y+34, r25 ; 0x22 2066e: ab a3 std Y+35, r26 ; 0x23 20670: bc a3 std Y+36, r27 ; 0x24 20672: c5 01 movw r24, r10 20674: b4 01 movw r22, r8 20676: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2067a: 2b 01 movw r4, r22 2067c: 3c 01 movw r6, r24 2067e: 2d a1 ldd r18, Y+37 ; 0x25 20680: 3e a1 ldd r19, Y+38 ; 0x26 20682: 4f a1 ldd r20, Y+39 ; 0x27 20684: 58 a5 ldd r21, Y+40 ; 0x28 20686: c7 01 movw r24, r14 20688: b6 01 movw r22, r12 2068a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2068e: 9b 01 movw r18, r22 20690: ac 01 movw r20, r24 20692: c3 01 movw r24, r6 20694: b2 01 movw r22, r4 20696: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2069a: 29 a1 ldd r18, Y+33 ; 0x21 2069c: 3a a1 ldd r19, Y+34 ; 0x22 2069e: 4b a1 ldd r20, Y+35 ; 0x23 206a0: 5c a1 ldd r21, Y+36 ; 0x24 206a2: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 206a6: 20 e0 ldi r18, 0x00 ; 0 206a8: 30 e0 ldi r19, 0x00 ; 0 206aa: 40 e9 ldi r20, 0x90 ; 144 206ac: 50 e4 ldi r21, 0x40 ; 64 206ae: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 206b2: 1b 01 movw r2, r22 206b4: 8c 01 movw r16, r24 eeprom_read_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8); eeprom_read_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8); eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); for (uint8_t mesh_point = 0; mesh_point < 2; ++mesh_point) { float y = vec_x[1] * pgm_read_float(bed_ref_points_4 + mesh_point * 2) + vec_y[1] * pgm_read_float(bed_ref_points_4 + mesh_point * 2 + 1) + cntr[1]; 206b6: e4 e5 ldi r30, 0x54 ; 84 206b8: f8 e8 ldi r31, 0x88 ; 136 206ba: 25 91 lpm r18, Z+ 206bc: 35 91 lpm r19, Z+ 206be: 45 91 lpm r20, Z+ 206c0: 54 91 lpm r21, Z 206c2: e8 e5 ldi r30, 0x58 ; 88 206c4: f8 e8 ldi r31, 0x88 ; 136 206c6: 45 90 lpm r4, Z+ 206c8: 55 90 lpm r5, Z+ 206ca: 65 90 lpm r6, Z+ 206cc: 74 90 lpm r7, Z 206ce: c5 01 movw r24, r10 206d0: b4 01 movw r22, r8 206d2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 206d6: 4b 01 movw r8, r22 206d8: 5c 01 movw r10, r24 206da: a3 01 movw r20, r6 206dc: 92 01 movw r18, r4 206de: c7 01 movw r24, r14 206e0: b6 01 movw r22, r12 206e2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 206e6: 9b 01 movw r18, r22 206e8: ac 01 movw r20, r24 206ea: c5 01 movw r24, r10 206ec: b4 01 movw r22, r8 206ee: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 206f2: 29 a1 ldd r18, Y+33 ; 0x21 206f4: 3a a1 ldd r19, Y+34 ; 0x22 206f6: 4b a1 ldd r20, Y+35 ; 0x23 206f8: 5c a1 ldd r21, Y+36 ; 0x24 206fa: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 206fe: 20 e0 ldi r18, 0x00 ; 0 20700: 30 e0 ldi r19, 0x00 ; 0 20702: 40 e9 ldi r20, 0x90 ; 144 20704: 50 e4 ldi r21, 0x40 ; 64 20706: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2070a: 6d 8f std Y+29, r22 ; 0x1d 2070c: 7e 8f std Y+30, r23 ; 0x1e 2070e: 8f 8f std Y+31, r24 ; 0x1f 20710: 98 a3 std Y+32, r25 ; 0x20 float distanceMin[2]; count_xyz_details(distanceMin); lcd_home(); 20712: 0e 94 a7 69 call 0xd34e ; 0xd34e lcd_printf_P(_N( 20716: 8c e5 ldi r24, 0x5C ; 92 20718: 9b e4 ldi r25, 0x4B ; 75 2071a: 0e 94 b1 6c call 0xd962 ; 0xd962 2071e: d8 2e mov r13, r24 20720: c9 2e mov r12, r25 20722: 85 e5 ldi r24, 0x55 ; 85 20724: 9b e4 ldi r25, 0x4B ; 75 20726: 0e 94 b1 6c call 0xd962 ; 0xd962 2072a: f8 2e mov r15, r24 2072c: e9 2e mov r14, r25 2072e: 8f e3 ldi r24, 0x3F ; 63 20730: 9b e4 ldi r25, 0x4B ; 75 20732: 0e 94 b1 6c call 0xd962 ; 0xd962 20736: cf 92 push r12 20738: df 92 push r13 2073a: ef 92 push r14 2073c: ff 92 push r15 2073e: 2b e1 ldi r18, 0x1B ; 27 20740: 33 e8 ldi r19, 0x83 ; 131 20742: 3f 93 push r19 20744: 2f 93 push r18 20746: 9f 93 push r25 20748: 8f 93 push r24 2074a: 88 ee ldi r24, 0xE8 ; 232 2074c: 9a e6 ldi r25, 0x6A ; 106 2074e: 9f 93 push r25 20750: 8f 93 push r24 20752: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 20756: 62 e0 ldi r22, 0x02 ; 2 20758: 8b e0 ldi r24, 0x0B ; 11 2075a: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 2075e: 0f b6 in r0, 0x3f ; 63 20760: f8 94 cli 20762: de bf out 0x3e, r29 ; 62 20764: 0f be out 0x3f, r0 ; 63 20766: cd bf out 0x3d, r28 ; 61 20768: 20 e0 ldi r18, 0x00 ; 0 2076a: 30 e0 ldi r19, 0x00 ; 0 2076c: 48 e4 ldi r20, 0x48 ; 72 2076e: 53 e4 ldi r21, 0x43 ; 67 20770: 62 2d mov r22, r2 20772: 73 2d mov r23, r3 20774: 80 2f mov r24, r16 20776: 91 2f mov r25, r17 20778: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 2077c: 87 ff sbrs r24, 7 2077e: 51 c0 rjmp .+162 ; 0x20822 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 20780: 1f 93 push r17 20782: 0f 93 push r16 20784: 3f 92 push r3 20786: 2f 92 push r2 20788: 80 ee ldi r24, 0xE0 ; 224 2078a: 9a e6 ldi r25, 0x6A ; 106 2078c: 9f 93 push r25 2078e: 8f 93 push r24 20790: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 20794: 0f 90 pop r0 20796: 0f 90 pop r0 20798: 0f 90 pop r0 2079a: 0f 90 pop r0 2079c: 0f 90 pop r0 2079e: 0f 90 pop r0 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 207a0: 63 e0 ldi r22, 0x03 ; 3 207a2: 8b e0 ldi r24, 0x0B ; 11 207a4: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 207a8: 1d 8d ldd r17, Y+29 ; 0x1d 207aa: 0e 8d ldd r16, Y+30 ; 0x1e 207ac: ff 8c ldd r15, Y+31 ; 0x1f 207ae: e8 a0 ldd r14, Y+32 ; 0x20 207b0: 20 e0 ldi r18, 0x00 ; 0 207b2: 30 e0 ldi r19, 0x00 ; 0 207b4: 48 e4 ldi r20, 0x48 ; 72 207b6: 53 e4 ldi r21, 0x43 ; 67 207b8: d8 01 movw r26, r16 207ba: f7 01 movw r30, r14 207bc: 6b 2f mov r22, r27 207be: 7a 2f mov r23, r26 207c0: 8f 2f mov r24, r31 207c2: 9e 2f mov r25, r30 207c4: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 207c8: 87 fd sbrc r24, 7 207ca: 32 c0 rjmp .+100 ; 0x20830 207cc: 8c e8 ldi r24, 0x8C ; 140 207ce: 9d e3 ldi r25, 0x3D ; 61 207d0: 0e 94 b1 6c call 0xd962 ; 0xd962 207d4: 0e 94 66 69 call 0xd2cc ; 0xd2cc else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); } if (lcd_clicked()) 207d8: 0e 94 98 6b call 0xd730 ; 0xd730 207dc: 88 23 and r24, r24 207de: 41 f0 breq .+16 ; 0x207f0 menu_goto(lcd_menu_xyz_skew, 0, true); 207e0: 20 e0 ldi r18, 0x00 ; 0 207e2: 41 e0 ldi r20, 0x01 ; 1 207e4: 70 e0 ldi r23, 0x00 ; 0 207e6: 60 e0 ldi r22, 0x00 ; 0 207e8: 8d ea ldi r24, 0xAD ; 173 207ea: 97 e3 ldi r25, 0x37 ; 55 207ec: 0f 94 e6 92 call 0x325cc ; 0x325cc } 207f0: a8 96 adiw r28, 0x28 ; 40 207f2: 0f b6 in r0, 0x3f ; 63 207f4: f8 94 cli 207f6: de bf out 0x3e, r29 ; 62 207f8: 0f be out 0x3f, r0 ; 63 207fa: cd bf out 0x3d, r28 ; 61 207fc: df 91 pop r29 207fe: cf 91 pop r28 20800: 1f 91 pop r17 20802: 0f 91 pop r16 20804: ff 90 pop r15 20806: ef 90 pop r14 20808: df 90 pop r13 2080a: cf 90 pop r12 2080c: bf 90 pop r11 2080e: af 90 pop r10 20810: 9f 90 pop r9 20812: 8f 90 pop r8 20814: 7f 90 pop r7 20816: 6f 90 pop r6 20818: 5f 90 pop r5 2081a: 4f 90 pop r4 2081c: 3f 90 pop r3 2081e: 2f 90 pop r2 20820: 08 95 ret _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 20822: 8c e8 ldi r24, 0x8C ; 140 20824: 9d e3 ldi r25, 0x3D ; 61 20826: 0e 94 b1 6c call 0xd962 ; 0xd962 2082a: 0e 94 66 69 call 0xd2cc ; 0xd2cc 2082e: b8 cf rjmp .-144 ; 0x207a0 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 20830: ef 92 push r14 20832: ff 92 push r15 20834: 0f 93 push r16 20836: 1f 93 push r17 20838: 80 ee ldi r24, 0xE0 ; 224 2083a: 9a e6 ldi r25, 0x6A ; 106 2083c: 9f 93 push r25 2083e: 8f 93 push r24 20840: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 20844: 0f 90 pop r0 20846: 0f 90 pop r0 20848: 0f 90 pop r0 2084a: 0f 90 pop r0 2084c: 0f 90 pop r0 2084e: 0f 90 pop r0 20850: c3 cf rjmp .-122 ; 0x207d8 00020852 : } //! @brief Send host action "pause" void lcd_pause_usb_print() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_PAUSE); 20852: 86 e4 ldi r24, 0x46 ; 70 20854: 9a e6 ldi r25, 0x6A ; 106 20856: 0c 94 53 72 jmp 0xe4a6 ; 0xe4a6 0002085a : * This function is non-blocking * @param msg message to be displayed from PROGMEM * @return rest of the text (to be displayed on next page) */ static const char* lcd_display_message_fullscreen_nonBlocking_P(const char *msg) { 2085a: af 92 push r10 2085c: bf 92 push r11 2085e: cf 92 push r12 20860: df 92 push r13 20862: ef 92 push r14 20864: ff 92 push r15 20866: 0f 93 push r16 20868: 1f 93 push r17 2086a: cf 93 push r28 2086c: df 93 push r29 2086e: 6c 01 movw r12, r24 const char *msgend = msg; bool multi_screen = false; lcd_frame_start(); 20870: 0e 94 2f 69 call 0xd25e ; 0xd25e * @param msg message to be displayed from PROGMEM * @return rest of the text (to be displayed on next page) */ static const char* lcd_display_message_fullscreen_nonBlocking_P(const char *msg) { const char *msgend = msg; 20874: e6 01 movw r28, r12 bool multi_screen = false; lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { 20876: f1 2c mov r15, r1 * @return rest of the text (to be displayed on next page) */ static const char* lcd_display_message_fullscreen_nonBlocking_P(const char *msg) { const char *msgend = msg; bool multi_screen = false; 20878: e1 2c mov r14, r1 lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { lcd_set_cursor(0, row); 2087a: 6f 2d mov r22, r15 2087c: 80 e0 ldi r24, 0x00 ; 0 2087e: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 // Previous row ended with a complete word, so the first character in the // next row is a whitespace. We can skip the whitespace on a new line. if (pgm_is_whitespace(msg) && ++msg == nullptr) 20882: c6 01 movw r24, r12 20884: 0e 94 bb f7 call 0x1ef76 ; 0x1ef76 20888: 88 23 and r24, r24 2088a: 29 f0 breq .+10 ; 0x20896 2088c: 8f ef ldi r24, 0xFF ; 255 2088e: c8 1a sub r12, r24 20890: d8 0a sbc r13, r24 20892: 09 f4 brne .+2 ; 0x20896 20894: 49 c0 rjmp .+146 ; 0x20928 20896: c6 01 movw r24, r12 20898: 0f 94 9a 9d call 0x33b34 ; 0x33b34 <__strlen_P> { // End of the message. break; } uint8_t linelen = min(strlen_P(msg), LCD_WIDTH); 2089c: 84 31 cpi r24, 0x14 ; 20 2089e: 91 05 cpc r25, r1 208a0: 10 f0 brcs .+4 ; 0x208a6 208a2: 84 e1 ldi r24, 0x14 ; 20 208a4: 90 e0 ldi r25, 0x00 ; 0 const char *msgend2 = msg + linelen; 208a6: e6 01 movw r28, r12 208a8: c8 0f add r28, r24 208aa: d9 1f adc r29, r25 msgend = msgend2; if (row == 3 && linelen == LCD_WIDTH) { 208ac: e3 e0 ldi r30, 0x03 ; 3 208ae: fe 12 cpse r15, r30 208b0: 0a c0 rjmp .+20 ; 0x208c6 208b2: 84 31 cpi r24, 0x14 ; 20 208b4: 41 f4 brne .+16 ; 0x208c6 // Last line of the display, full line shall be displayed. // Find out, whether this message will be split into multiple screens. multi_screen = pgm_read_byte(msgend) != 0; 208b6: fe 01 movw r30, r28 208b8: 84 91 lpm r24, Z 208ba: e1 2c mov r14, r1 if (multi_screen) 208bc: 88 23 and r24, r24 208be: 19 f0 breq .+6 ; 0x208c6 msgend = (msgend2 -= 2); 208c0: 22 97 sbiw r28, 0x02 ; 2 const char *msgend2 = msg + linelen; msgend = msgend2; if (row == 3 && linelen == LCD_WIDTH) { // Last line of the display, full line shall be displayed. // Find out, whether this message will be split into multiple screens. multi_screen = pgm_read_byte(msgend) != 0; 208c2: ee 24 eor r14, r14 208c4: e3 94 inc r14 if (multi_screen) msgend = (msgend2 -= 2); } if (pgm_read_byte(msgend) != 0 && ! pgm_is_whitespace(msgend) && ! pgm_is_interpunction(msgend)) { 208c6: fe 01 movw r30, r28 208c8: 84 91 lpm r24, Z 208ca: 88 23 and r24, r24 208cc: 09 f4 brne .+2 ; 0x208d0 208ce: 40 c0 rjmp .+128 ; 0x20950 208d0: ce 01 movw r24, r28 208d2: 0e 94 bb f7 call 0x1ef76 ; 0x1ef76 208d6: 81 11 cpse r24, r1 208d8: 3b c0 rjmp .+118 ; 0x20950 return c == ' ' || c == '\t' || c == '\r' || c == '\n'; } static inline bool pgm_is_interpunction(const char *c_addr) { const char c = pgm_read_byte(c_addr); 208da: fe 01 movw r30, r28 208dc: 84 91 lpm r24, Z return c == '.' || c == ',' || c == ':'|| c == ';' || c == '?' || c == '!' || c == '/'; 208de: 92 ed ldi r25, 0xD2 ; 210 208e0: 98 0f add r25, r24 208e2: 92 30 cpi r25, 0x02 ; 2 208e4: a8 f1 brcs .+106 ; 0x20950 208e6: 8c 32 cpi r24, 0x2C ; 44 208e8: 99 f1 breq .+102 ; 0x20950 208ea: 96 ec ldi r25, 0xC6 ; 198 208ec: 98 0f add r25, r24 208ee: 92 30 cpi r25, 0x02 ; 2 208f0: 78 f1 brcs .+94 ; 0x20950 208f2: 8f 33 cpi r24, 0x3F ; 63 208f4: 69 f1 breq .+90 ; 0x20950 208f6: 81 32 cpi r24, 0x21 ; 33 208f8: 59 f1 breq .+86 ; 0x20950 208fa: 8e 01 movw r16, r28 if (multi_screen) msgend = (msgend2 -= 2); } if (pgm_read_byte(msgend) != 0 && ! pgm_is_whitespace(msgend) && ! pgm_is_interpunction(msgend)) { // Splitting a word. Find the start of the current word. while (msgend > msg && ! pgm_is_whitespace(msgend - 1)) 208fc: c0 16 cp r12, r16 208fe: d1 06 cpc r13, r17 20900: 58 f4 brcc .+22 ; 0x20918 20902: 58 01 movw r10, r16 20904: f1 e0 ldi r31, 0x01 ; 1 20906: af 1a sub r10, r31 20908: b1 08 sbc r11, r1 2090a: c5 01 movw r24, r10 2090c: 0e 94 bb f7 call 0x1ef76 ; 0x1ef76 20910: 81 11 cpse r24, r1 20912: 1d c0 rjmp .+58 ; 0x2094e -- msgend; 20914: 85 01 movw r16, r10 20916: f2 cf rjmp .-28 ; 0x208fc if (msgend == msg) 20918: c0 16 cp r12, r16 2091a: d1 06 cpc r13, r17 2091c: c9 f0 breq .+50 ; 0x20950 2091e: e8 01 movw r28, r16 static const char* lcd_display_message_fullscreen_nonBlocking_P(const char *msg) { const char *msgend = msg; bool multi_screen = false; lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { 20920: f3 94 inc r15 20922: 84 e0 ldi r24, 0x04 ; 4 20924: f8 12 cpse r15, r24 20926: a9 cf rjmp .-174 ; 0x2087a } lcd_print(c); } } if (multi_screen) { 20928: ee 20 and r14, r14 2092a: f9 f0 breq .+62 ; 0x2096a // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); 2092c: 48 e8 ldi r20, 0x88 ; 136 2092e: 63 e0 ldi r22, 0x03 ; 3 20930: 83 e1 ldi r24, 0x13 ; 19 20932: 0e 94 9b 69 call 0xd336 ; 0xd336 } return multi_screen ? msgend : NULL; } 20936: ce 01 movw r24, r28 20938: df 91 pop r29 2093a: cf 91 pop r28 2093c: 1f 91 pop r17 2093e: 0f 91 pop r16 20940: ff 90 pop r15 20942: ef 90 pop r14 20944: df 90 pop r13 20946: cf 90 pop r12 20948: bf 90 pop r11 2094a: af 90 pop r10 2094c: 08 95 ret if (multi_screen) msgend = (msgend2 -= 2); } if (pgm_read_byte(msgend) != 0 && ! pgm_is_whitespace(msgend) && ! pgm_is_interpunction(msgend)) { // Splitting a word. Find the start of the current word. while (msgend > msg && ! pgm_is_whitespace(msgend - 1)) 2094e: e8 01 movw r28, r16 -- msgend; if (msgend == msg) // Found a single long word, which cannot be split. Just cut it. msgend = msgend2; } for (; msg < msgend; ++ msg) { 20950: cc 16 cp r12, r28 20952: dd 06 cpc r13, r29 20954: 28 f7 brcc .-54 ; 0x20920 char c = char(pgm_read_byte(msg)); 20956: f6 01 movw r30, r12 20958: 84 91 lpm r24, Z if (c == '\n') { 2095a: 8a 30 cpi r24, 0x0A ; 10 2095c: 09 f3 breq .-62 ; 0x20920 2095e: 0e 94 2a 6a call 0xd454 ; 0xd454 -- msgend; if (msgend == msg) // Found a single long word, which cannot be split. Just cut it. msgend = msgend2; } for (; msg < msgend; ++ msg) { 20962: ff ef ldi r31, 0xFF ; 255 20964: cf 1a sub r12, r31 20966: df 0a sbc r13, r31 20968: f3 cf rjmp .-26 ; 0x20950 if (multi_screen) { // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); } return multi_screen ? msgend : NULL; 2096a: d0 e0 ldi r29, 0x00 ; 0 2096c: c0 e0 ldi r28, 0x00 ; 0 2096e: e3 cf rjmp .-58 ; 0x20936 00020970 : } #if defined(FILAMENT_SENSOR) && !defined(REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY) static void lcd_menu_AutoLoadFilament() { lcd_display_message_fullscreen_nonBlocking_P(_T(MSG_AUTOLOADING_ENABLED)); 20970: 82 e9 ldi r24, 0x92 ; 146 20972: 9a e4 ldi r25, 0x4A ; 74 20974: 0e 94 b1 6c call 0xd962 ; 0xd962 20978: 0f 94 2d 04 call 0x2085a ; 0x2085a menu_back_if_clicked(); 2097c: 0d 94 26 96 jmp 0x32c4c ; 0x32c4c 00020980 : } _menu_data_adjust_bed_t; static_assert(sizeof(menu_data)>= sizeof(_menu_data_adjust_bed_t),"_menu_data_adjust_bed_t doesn't fit into menu_data"); void lcd_adjust_bed_reset(void) { eeprom_adjust_bed_reset(); 20980: 0e 94 6f 6f call 0xdede ; 0xdede _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); _md->status = 0; 20984: 10 92 71 03 sts 0x0371, r1 ; 0x800371 } 20988: 08 95 ret 0002098a : //! |Y 00.00mm| c=10 //! ---------------------- //! @endcode //! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations. static void lcd_menu_xyz_offset() { 2098a: cf 93 push r28 2098c: df 93 push r29 lcd_puts_at_P(0, 0, _T(MSG_MEASURED_OFFSET)); 2098e: 80 e9 ldi r24, 0x90 ; 144 20990: 9b e4 ldi r25, 0x4B ; 75 20992: 0e 94 b1 6c call 0xd962 ; 0xd962 20996: ac 01 movw r20, r24 20998: 60 e0 ldi r22, 0x00 ; 0 2099a: 80 e0 ldi r24, 0x00 ; 0 2099c: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_puts_at_P(0, 1, STR_SEPARATOR); 209a0: 4b e1 ldi r20, 0x1B ; 27 209a2: 53 e8 ldi r21, 0x83 ; 131 209a4: 61 e0 ldi r22, 0x01 ; 1 209a6: 80 e0 ldi r24, 0x00 ; 0 209a8: 0e 94 8f 69 call 0xd31e ; 0xd31e for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(0, i + 2); 209ac: 62 e0 ldi r22, 0x02 ; 2 209ae: 80 e0 ldi r24, 0x00 ; 0 209b0: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 209b4: 85 ee ldi r24, 0xE5 ; 229 209b6: 9f e0 ldi r25, 0x0F ; 15 209b8: 0f 94 e4 9f call 0x33fc8 ; 0x33fc8 209bc: 9f 93 push r25 209be: 8f 93 push r24 209c0: 7f 93 push r23 209c2: 6f 93 push r22 209c4: 1f 92 push r1 209c6: 88 e5 ldi r24, 0x58 ; 88 209c8: 8f 93 push r24 209ca: c0 e5 ldi r28, 0x50 ; 80 209cc: d7 e9 ldi r29, 0x97 ; 151 209ce: df 93 push r29 209d0: cf 93 push r28 209d2: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 { lcd_puts_at_P(0, 0, _T(MSG_MEASURED_OFFSET)); lcd_puts_at_P(0, 1, STR_SEPARATOR); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(0, i + 2); 209d6: 63 e0 ldi r22, 0x03 ; 3 209d8: 80 e0 ldi r24, 0x00 ; 0 209da: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 209de: 89 ee ldi r24, 0xE9 ; 233 209e0: 9f e0 ldi r25, 0x0F ; 15 209e2: 0f 94 e4 9f call 0x33fc8 ; 0x33fc8 209e6: 9f 93 push r25 209e8: 8f 93 push r24 209ea: 7f 93 push r23 209ec: 6f 93 push r22 209ee: 1f 92 push r1 209f0: 89 e5 ldi r24, 0x59 ; 89 209f2: 8f 93 push r24 209f4: df 93 push r29 209f6: cf 93 push r28 209f8: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 } menu_back_if_clicked(); 209fc: 8d b7 in r24, 0x3d ; 61 209fe: 9e b7 in r25, 0x3e ; 62 20a00: 40 96 adiw r24, 0x10 ; 16 20a02: 0f b6 in r0, 0x3f ; 63 20a04: f8 94 cli 20a06: 9e bf out 0x3e, r25 ; 62 20a08: 0f be out 0x3f, r0 ; 63 20a0a: 8d bf out 0x3d, r24 ; 61 } 20a0c: df 91 pop r29 20a0e: cf 91 pop r28 for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(0, i + 2); lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); } menu_back_if_clicked(); 20a10: 0d 94 26 96 jmp 0x32c4c ; 0x32c4c 00020a14 : //! ---------------------- //! D - Degree sysmbol LCD_STR_DEGREE //! @endcode //! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations. static void lcd_menu_xyz_skew() { 20a14: cf 92 push r12 20a16: df 92 push r13 20a18: ef 92 push r14 20a1a: ff 92 push r15 20a1c: 0f 93 push r16 20a1e: 1f 93 push r17 20a20: cf 93 push r28 20a22: df 93 push r29 float angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW)); 20a24: 80 e6 ldi r24, 0x60 ; 96 20a26: 9f e0 ldi r25, 0x0F ; 15 20a28: 0f 94 e4 9f call 0x33fc8 ; 0x33fc8 20a2c: 6b 01 movw r12, r22 20a2e: 7c 01 movw r14, r24 lcd_home(); 20a30: 0e 94 a7 69 call 0xd34e ; 0xd34e lcd_printf_P(_N( 20a34: 82 e8 ldi r24, 0x82 ; 130 20a36: 9b e4 ldi r25, 0x4B ; 75 20a38: 0e 94 b1 6c call 0xd962 ; 0xd962 20a3c: 18 2f mov r17, r24 20a3e: 09 2f mov r16, r25 20a40: 84 e7 ldi r24, 0x74 ; 116 20a42: 9b e4 ldi r25, 0x4B ; 75 20a44: 0e 94 b1 6c call 0xd962 ; 0xd962 20a48: ec 01 movw r28, r24 20a4a: 84 e6 ldi r24, 0x64 ; 100 20a4c: 9b e4 ldi r25, 0x4B ; 75 20a4e: 0e 94 b1 6c call 0xd962 ; 0xd962 20a52: 2e e3 ldi r18, 0x3E ; 62 20a54: 2f 93 push r18 20a56: 20 e8 ldi r18, 0x80 ; 128 20a58: 2f 93 push r18 20a5a: 1f 92 push r1 20a5c: 1f 92 push r1 20a5e: 0f 93 push r16 20a60: 1f 93 push r17 20a62: 2d e3 ldi r18, 0x3D ; 61 20a64: 2f 93 push r18 20a66: 25 ef ldi r18, 0xF5 ; 245 20a68: 2f 93 push r18 20a6a: 22 ec ldi r18, 0xC2 ; 194 20a6c: 2f 93 push r18 20a6e: 20 e9 ldi r18, 0x90 ; 144 20a70: 2f 93 push r18 20a72: df 93 push r29 20a74: cf 93 push r28 20a76: 2b e1 ldi r18, 0x1B ; 27 20a78: 33 e8 ldi r19, 0x83 ; 131 20a7a: 3f 93 push r19 20a7c: 2f 93 push r18 20a7e: 9f 93 push r25 20a80: 8f 93 push r24 20a82: 8d ef ldi r24, 0xFD ; 253 20a84: 9a e6 ldi r25, 0x6A ; 106 20a86: 9f 93 push r25 20a88: 8f 93 push r24 20a8a: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 _T(MSG_MEASURED_SKEW), STR_SEPARATOR, _T(MSG_SLIGHT_SKEW), _deg(bed_skew_angle_mild), _T(MSG_SEVERE_SKEW), _deg(bed_skew_angle_extreme) ); lcd_set_cursor(15, 0); 20a8e: 60 e0 ldi r22, 0x00 ; 0 20a90: 8f e0 ldi r24, 0x0F ; 15 20a92: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 if (angleDiff < 100){ 20a96: 8d b7 in r24, 0x3d ; 61 20a98: 9e b7 in r25, 0x3e ; 62 20a9a: 42 96 adiw r24, 0x12 ; 18 20a9c: 0f b6 in r0, 0x3f ; 63 20a9e: f8 94 cli 20aa0: 9e bf out 0x3e, r25 ; 62 20aa2: 0f be out 0x3f, r0 ; 63 20aa4: 8d bf out 0x3d, r24 ; 61 20aa6: 20 e0 ldi r18, 0x00 ; 0 20aa8: 30 e0 ldi r19, 0x00 ; 0 20aaa: 48 ec ldi r20, 0xC8 ; 200 20aac: 52 e4 ldi r21, 0x42 ; 66 20aae: c7 01 movw r24, r14 20ab0: b6 01 movw r22, r12 20ab2: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 20ab6: 87 ff sbrs r24, 7 20ab8: 32 c0 rjmp .+100 ; 0x20b1e } //@brief Show measured axis skewness float _deg(float rad) { return rad * 180 / M_PI; 20aba: 20 e0 ldi r18, 0x00 ; 0 20abc: 30 e0 ldi r19, 0x00 ; 0 20abe: 44 e3 ldi r20, 0x34 ; 52 20ac0: 53 e4 ldi r21, 0x43 ; 67 20ac2: c7 01 movw r24, r14 20ac4: b6 01 movw r22, r12 20ac6: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 20aca: 2b ed ldi r18, 0xDB ; 219 20acc: 3f e0 ldi r19, 0x0F ; 15 20ace: 49 e4 ldi r20, 0x49 ; 73 20ad0: 50 e4 ldi r21, 0x40 ; 64 20ad2: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> _T(MSG_SLIGHT_SKEW), _deg(bed_skew_angle_mild), _T(MSG_SEVERE_SKEW), _deg(bed_skew_angle_extreme) ); lcd_set_cursor(15, 0); if (angleDiff < 100){ lcd_printf_P(_N("%3.2f" LCD_STR_DEGREE), _deg(angleDiff)); 20ad6: 9f 93 push r25 20ad8: 8f 93 push r24 20ada: 7f 93 push r23 20adc: 6f 93 push r22 20ade: 86 ef ldi r24, 0xF6 ; 246 20ae0: 9a e6 ldi r25, 0x6A ; 106 20ae2: 9f 93 push r25 20ae4: 8f 93 push r24 20ae6: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 20aea: 0f 90 pop r0 20aec: 0f 90 pop r0 20aee: 0f 90 pop r0 20af0: 0f 90 pop r0 20af2: 0f 90 pop r0 20af4: 0f 90 pop r0 } else { lcd_puts_P(_T(MSG_NA)); } if (lcd_clicked()) 20af6: 0e 94 98 6b call 0xd730 ; 0xd730 20afa: 88 23 and r24, r24 20afc: b9 f0 breq .+46 ; 0x20b2c menu_goto(lcd_menu_xyz_offset, 0, true); 20afe: 20 e0 ldi r18, 0x00 ; 0 20b00: 41 e0 ldi r20, 0x01 ; 1 20b02: 70 e0 ldi r23, 0x00 ; 0 20b04: 60 e0 ldi r22, 0x00 ; 0 20b06: 8d e5 ldi r24, 0x5D ; 93 20b08: 97 e3 ldi r25, 0x37 ; 55 } 20b0a: df 91 pop r29 20b0c: cf 91 pop r28 20b0e: 1f 91 pop r17 20b10: 0f 91 pop r16 20b12: ff 90 pop r15 20b14: ef 90 pop r14 20b16: df 90 pop r13 20b18: cf 90 pop r12 lcd_printf_P(_N("%3.2f" LCD_STR_DEGREE), _deg(angleDiff)); } else { lcd_puts_P(_T(MSG_NA)); } if (lcd_clicked()) menu_goto(lcd_menu_xyz_offset, 0, true); 20b1a: 0d 94 e6 92 jmp 0x325cc ; 0x325cc ); lcd_set_cursor(15, 0); if (angleDiff < 100){ lcd_printf_P(_N("%3.2f" LCD_STR_DEGREE), _deg(angleDiff)); } else { lcd_puts_P(_T(MSG_NA)); 20b1e: 8c e8 ldi r24, 0x8C ; 140 20b20: 9d e3 ldi r25, 0x3D ; 61 20b22: 0e 94 b1 6c call 0xd962 ; 0xd962 20b26: 0e 94 66 69 call 0xd2cc ; 0xd2cc 20b2a: e5 cf rjmp .-54 ; 0x20af6 } if (lcd_clicked()) menu_goto(lcd_menu_xyz_offset, 0, true); } 20b2c: df 91 pop r29 20b2e: cf 91 pop r28 20b30: 1f 91 pop r17 20b32: 0f 91 pop r16 20b34: ff 90 pop r15 20b36: ef 90 pop r14 20b38: df 90 pop r13 20b3a: cf 90 pop r12 20b3c: 08 95 ret 00020b3e <_lcd_move(char const*, unsigned char, int, int)>: } } static void _lcd_move(const char *name, uint8_t axis, int min, int max) { 20b3e: 2f 92 push r2 20b40: 3f 92 push r3 20b42: 4f 92 push r4 20b44: 5f 92 push r5 20b46: 6f 92 push r6 20b48: 7f 92 push r7 20b4a: 9f 92 push r9 20b4c: af 92 push r10 20b4e: bf 92 push r11 20b50: cf 92 push r12 20b52: df 92 push r13 20b54: ef 92 push r14 20b56: ff 92 push r15 20b58: 0f 93 push r16 20b5a: 1f 93 push r17 20b5c: cf 93 push r28 20b5e: df 93 push r29 if (homing_flag || mesh_bed_leveling_flag) 20b60: 70 91 05 12 lds r23, 0x1205 ; 0x801205 20b64: 71 11 cpse r23, r1 20b66: 04 c0 rjmp .+8 ; 0x20b70 <_lcd_move(char const*, unsigned char, int, int)+0x32> 20b68: 70 91 06 12 lds r23, 0x1206 ; 0x801206 20b6c: 77 23 and r23, r23 20b6e: 99 f0 breq .+38 ; 0x20b96 <_lcd_move(char const*, unsigned char, int, int)+0x58> lcd_set_cursor(0, 1); menu_draw_float31(name, current_position[axis]); } if (menu_leaving || LCD_CLICKED) (void)enable_endstops(_md->endstopsEnabledPrevious); menu_back_if_clicked(); } 20b70: df 91 pop r29 20b72: cf 91 pop r28 20b74: 1f 91 pop r17 20b76: 0f 91 pop r16 20b78: ff 90 pop r15 20b7a: ef 90 pop r14 20b7c: df 90 pop r13 20b7e: cf 90 pop r12 20b80: bf 90 pop r11 20b82: af 90 pop r10 20b84: 9f 90 pop r9 20b86: 7f 90 pop r7 20b88: 6f 90 pop r6 20b8a: 5f 90 pop r5 20b8c: 4f 90 pop r4 20b8e: 3f 90 pop r3 20b90: 2f 90 pop r2 static void _lcd_move(const char *name, uint8_t axis, int min, int max) { if (homing_flag || mesh_bed_leveling_flag) { // printer entered a new state where axis move is forbidden menu_back(); 20b92: 0d 94 84 95 jmp 0x32b08 ; 0x32b08 bool initialized; // 1byte bool endstopsEnabledPrevious; // 1byte } _menu_data_t; static_assert(sizeof(menu_data)>= sizeof(_menu_data_t),"_menu_data_t doesn't fit into menu_data"); _menu_data_t* _md = (_menu_data_t*)&(menu_data[0]); if (!_md->initialized) 20b96: 70 91 64 03 lds r23, 0x0364 ; 0x800364 20b9a: 71 11 cpse r23, r1 20b9c: 09 c0 rjmp .+18 ; 0x20bb0 <_lcd_move(char const*, unsigned char, int, int)+0x72> return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 20b9e: 70 91 77 02 lds r23, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.364> check_endstops = check; 20ba2: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.364> { _md->endstopsEnabledPrevious = enable_endstops(false); 20ba6: 70 93 65 03 sts 0x0365, r23 ; 0x800365 _md->initialized = true; 20baa: 71 e0 ldi r23, 0x01 ; 1 20bac: 70 93 64 03 sts 0x0364, r23 ; 0x800364 20bb0: 19 01 movw r2, r18 20bb2: 6a 01 movw r12, r20 20bb4: c6 2f mov r28, r22 20bb6: d9 2f mov r29, r25 20bb8: 98 2e mov r9, r24 } if (lcd_encoder != 0) 20bba: 80 91 06 05 lds r24, 0x0506 ; 0x800506 20bbe: 90 91 07 05 lds r25, 0x0507 ; 0x800507 20bc2: 89 2b or r24, r25 20bc4: 09 f4 brne .+2 ; 0x20bc8 <_lcd_move(char const*, unsigned char, int, int)+0x8a> 20bc6: 71 c0 rjmp .+226 ; 0x20caa <_lcd_move(char const*, unsigned char, int, int)+0x16c> { refresh_cmd_timeout(); 20bc8: 0e 94 c9 5f call 0xbf92 ; 0xbf92 FORCE_INLINE uint8_t moves_planned() { return (block_buffer_head + BLOCK_BUFFER_SIZE - block_buffer_tail) & (BLOCK_BUFFER_SIZE - 1); } FORCE_INLINE bool planner_queue_full() { uint8_t next_block_index = block_buffer_head; 20bcc: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 if (++ next_block_index == BLOCK_BUFFER_SIZE) 20bd0: 8f 5f subi r24, 0xFF ; 255 20bd2: 80 31 cpi r24, 0x10 ; 16 20bd4: 09 f4 brne .+2 ; 0x20bd8 <_lcd_move(char const*, unsigned char, int, int)+0x9a> next_block_index = 0; 20bd6: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 20bd8: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 if (! planner_queue_full()) 20bdc: 98 17 cp r25, r24 20bde: 09 f4 brne .+2 ; 0x20be2 <_lcd_move(char const*, unsigned char, int, int)+0xa4> 20be0: 64 c0 rjmp .+200 ; 0x20caa <_lcd_move(char const*, unsigned char, int, int)+0x16c> { current_position[axis] += lcd_encoder; 20be2: 84 e0 ldi r24, 0x04 ; 4 20be4: c8 9f mul r28, r24 20be6: 80 01 movw r16, r0 20be8: 11 24 eor r1, r1 20bea: f8 01 movw r30, r16 20bec: eb 50 subi r30, 0x0B ; 11 20bee: fe 4e sbci r31, 0xEE ; 238 20bf0: 5f 01 movw r10, r30 20bf2: 60 91 06 05 lds r22, 0x0506 ; 0x800506 20bf6: 70 91 07 05 lds r23, 0x0507 ; 0x800507 20bfa: 07 2e mov r0, r23 20bfc: 00 0c add r0, r0 20bfe: 88 0b sbc r24, r24 20c00: 99 0b sbc r25, r25 20c02: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 20c06: f5 01 movw r30, r10 20c08: 20 81 ld r18, Z 20c0a: 31 81 ldd r19, Z+1 ; 0x01 20c0c: 42 81 ldd r20, Z+2 ; 0x02 20c0e: 53 81 ldd r21, Z+3 ; 0x03 20c10: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 20c14: 2b 01 movw r4, r22 20c16: 3c 01 movw r6, r24 if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 20c18: b6 01 movw r22, r12 20c1a: dd 0c add r13, r13 20c1c: 88 0b sbc r24, r24 20c1e: 99 0b sbc r25, r25 20c20: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 20c24: 6b 01 movw r12, r22 20c26: 7c 01 movw r14, r24 20c28: ac 01 movw r20, r24 20c2a: 9b 01 movw r18, r22 20c2c: c3 01 movw r24, r6 20c2e: b2 01 movw r22, r4 20c30: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 20c34: f5 01 movw r30, r10 20c36: 87 fd sbrc r24, 7 20c38: 7d c0 rjmp .+250 ; 0x20d34 <_lcd_move(char const*, unsigned char, int, int)+0x1f6> if (lcd_encoder != 0) { refresh_cmd_timeout(); if (! planner_queue_full()) { current_position[axis] += lcd_encoder; 20c3a: 40 82 st Z, r4 20c3c: 51 82 std Z+1, r5 ; 0x01 20c3e: 62 82 std Z+2, r6 ; 0x02 20c40: 73 82 std Z+3, r7 ; 0x03 if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; if (max_software_endstops && current_position[axis] > max) current_position[axis] = max; 20c42: b1 01 movw r22, r2 20c44: 33 0c add r3, r3 20c46: 88 0b sbc r24, r24 20c48: 99 0b sbc r25, r25 20c4a: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 20c4e: 2b 01 movw r4, r22 20c50: 3c 01 movw r6, r24 20c52: c8 01 movw r24, r16 20c54: 8b 50 subi r24, 0x0B ; 11 20c56: 9e 4e sbci r25, 0xEE ; 238 20c58: 7c 01 movw r14, r24 20c5a: a3 01 movw r20, r6 20c5c: 92 01 movw r18, r4 20c5e: fc 01 movw r30, r24 20c60: 60 81 ld r22, Z 20c62: 71 81 ldd r23, Z+1 ; 0x01 20c64: 82 81 ldd r24, Z+2 ; 0x02 20c66: 93 81 ldd r25, Z+3 ; 0x03 20c68: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 20c6c: 18 16 cp r1, r24 20c6e: 2c f4 brge .+10 ; 0x20c7a <_lcd_move(char const*, unsigned char, int, int)+0x13c> 20c70: f7 01 movw r30, r14 20c72: 40 82 st Z, r4 20c74: 51 82 std Z+1, r5 ; 0x01 20c76: 62 82 std Z+2, r6 ; 0x02 20c78: 73 82 std Z+3, r7 ; 0x03 lcd_encoder = 0; 20c7a: 10 92 07 05 sts 0x0507, r1 ; 0x800507 20c7e: 10 92 06 05 sts 0x0506, r1 ; 0x800506 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 20c82: 69 ef ldi r22, 0xF9 ; 249 20c84: 71 e1 ldi r23, 0x11 ; 17 20c86: 85 ef ldi r24, 0xF5 ; 245 20c88: 91 e1 ldi r25, 0x11 ; 17 20c8a: 0e 94 a6 63 call 0xc74c ; 0xc74c plan_buffer_line_curposXYZE(get_feedrate_mm_s(manual_feedrate[axis])); 20c8e: f8 01 movw r30, r16 20c90: ef 51 subi r30, 0x1F ; 31 20c92: fd 4f sbci r31, 0xFD ; 253 20c94: 60 81 ld r22, Z 20c96: 71 81 ldd r23, Z+1 ; 0x01 20c98: 82 81 ldd r24, Z+2 ; 0x02 20c9a: 93 81 ldd r25, Z+3 ; 0x03 20c9c: 0e 94 cd 5f call 0xbf9a ; 0xbf9a 20ca0: 0f 94 70 84 call 0x308e0 ; 0x308e0 lcd_draw_update = 1; 20ca4: 81 e0 ldi r24, 0x01 ; 1 20ca6: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } } if (lcd_draw_update) 20caa: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 20cae: 88 23 and r24, r24 20cb0: 11 f1 breq .+68 ; 0x20cf6 <_lcd_move(char const*, unsigned char, int, int)+0x1b8> { lcd_set_cursor(0, 1); 20cb2: 61 e0 ldi r22, 0x01 ; 1 20cb4: 80 e0 ldi r24, 0x00 ; 0 20cb6: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 menu_draw_float31(name, current_position[axis]); 20cba: 84 e0 ldi r24, 0x04 ; 4 20cbc: c8 9f mul r28, r24 20cbe: f0 01 movw r30, r0 20cc0: 11 24 eor r1, r1 20cc2: eb 50 subi r30, 0x0B ; 11 20cc4: fe 4e sbci r31, 0xEE ; 238 //! The text needs to come with a colon ":", this function does not append it anymore. //! That resulted in a much shorter implementation (234628B -> 234476B) //! There are similar functions around which may be shortened in a similar way void menu_draw_float31(const char* str, float val) { lcd_printf_P(menu_fmt_float31, str, val); 20cc6: 83 81 ldd r24, Z+3 ; 0x03 20cc8: 8f 93 push r24 20cca: 82 81 ldd r24, Z+2 ; 0x02 20ccc: 8f 93 push r24 20cce: 81 81 ldd r24, Z+1 ; 0x01 20cd0: 8f 93 push r24 20cd2: 80 81 ld r24, Z 20cd4: 8f 93 push r24 20cd6: df 93 push r29 20cd8: 9f 92 push r9 20cda: 87 e3 ldi r24, 0x37 ; 55 20cdc: 97 e9 ldi r25, 0x97 ; 151 20cde: 9f 93 push r25 20ce0: 8f 93 push r24 20ce2: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 20ce6: ed b7 in r30, 0x3d ; 61 20ce8: fe b7 in r31, 0x3e ; 62 20cea: 38 96 adiw r30, 0x08 ; 8 20cec: 0f b6 in r0, 0x3f ; 63 20cee: f8 94 cli 20cf0: fe bf out 0x3e, r31 ; 62 20cf2: 0f be out 0x3f, r0 ; 63 20cf4: ed bf out 0x3d, r30 ; 61 } if (menu_leaving || LCD_CLICKED) (void)enable_endstops(_md->endstopsEnabledPrevious); 20cf6: 80 91 92 03 lds r24, 0x0392 ; 0x800392 20cfa: 81 11 cpse r24, r1 20cfc: 04 c0 rjmp .+8 ; 0x20d06 <_lcd_move(char const*, unsigned char, int, int)+0x1c8> 20cfe: 80 91 63 03 lds r24, 0x0363 ; 0x800363 20d02: 88 23 and r24, r24 20d04: 21 f0 breq .+8 ; 0x20d0e <_lcd_move(char const*, unsigned char, int, int)+0x1d0> 20d06: 80 91 65 03 lds r24, 0x0365 ; 0x800365 20d0a: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.364> menu_back_if_clicked(); } 20d0e: df 91 pop r29 20d10: cf 91 pop r28 20d12: 1f 91 pop r17 20d14: 0f 91 pop r16 20d16: ff 90 pop r15 20d18: ef 90 pop r14 20d1a: df 90 pop r13 20d1c: cf 90 pop r12 20d1e: bf 90 pop r11 20d20: af 90 pop r10 20d22: 9f 90 pop r9 20d24: 7f 90 pop r7 20d26: 6f 90 pop r6 20d28: 5f 90 pop r5 20d2a: 4f 90 pop r4 20d2c: 3f 90 pop r3 20d2e: 2f 90 pop r2 { lcd_set_cursor(0, 1); menu_draw_float31(name, current_position[axis]); } if (menu_leaving || LCD_CLICKED) (void)enable_endstops(_md->endstopsEnabledPrevious); menu_back_if_clicked(); 20d30: 0d 94 26 96 jmp 0x32c4c ; 0x32c4c { refresh_cmd_timeout(); if (! planner_queue_full()) { current_position[axis] += lcd_encoder; if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 20d34: c0 82 st Z, r12 20d36: d1 82 std Z+1, r13 ; 0x01 20d38: e2 82 std Z+2, r14 ; 0x02 20d3a: f3 82 std Z+3, r15 ; 0x03 20d3c: 82 cf rjmp .-252 ; 0x20c42 <_lcd_move(char const*, unsigned char, int, int)+0x104> 00020d3e : } // Note: the colon behind the text (X, Y, Z) is necessary to greatly shorten // the implementation of menu_draw_float31 static void lcd_move_x() { _lcd_move(PSTR("X:"), X_AXIS, X_MIN_POS, X_MAX_POS); 20d3e: 2a ef ldi r18, 0xFA ; 250 20d40: 30 e0 ldi r19, 0x00 ; 0 20d42: 50 e0 ldi r21, 0x00 ; 0 20d44: 40 e0 ldi r20, 0x00 ; 0 20d46: 60 e0 ldi r22, 0x00 ; 0 20d48: 8b e5 ldi r24, 0x5B ; 91 20d4a: 97 e9 ldi r25, 0x97 ; 151 20d4c: 0d 94 9f 05 jmp 0x20b3e ; 0x20b3e <_lcd_move(char const*, unsigned char, int, int)> 00020d50 : } static void lcd_move_y() { _lcd_move(PSTR("Y:"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); 20d50: 22 ed ldi r18, 0xD2 ; 210 20d52: 30 e0 ldi r19, 0x00 ; 0 20d54: 4c ef ldi r20, 0xFC ; 252 20d56: 5f ef ldi r21, 0xFF ; 255 20d58: 61 e0 ldi r22, 0x01 ; 1 20d5a: 8e e5 ldi r24, 0x5E ; 94 20d5c: 97 e9 ldi r25, 0x97 ; 151 20d5e: 0d 94 9f 05 jmp 0x20b3e ; 0x20b3e <_lcd_move(char const*, unsigned char, int, int)> 00020d62 : } static void lcd_move_z() { _lcd_move(PSTR("Z:"), Z_AXIS, Z_MIN_POS, Z_MAX_POS); 20d62: 22 ed ldi r18, 0xD2 ; 210 20d64: 30 e0 ldi r19, 0x00 ; 0 20d66: 50 e0 ldi r21, 0x00 ; 0 20d68: 40 e0 ldi r20, 0x00 ; 0 20d6a: 62 e0 ldi r22, 0x02 ; 2 20d6c: 81 e6 ldi r24, 0x61 ; 97 20d6e: 97 e9 ldi r25, 0x97 ; 151 20d70: 0d 94 9f 05 jmp 0x20b3e ; 0x20b3e <_lcd_move(char const*, unsigned char, int, int)> 00020d74 : setFilamentAction(FilamentAction::None); } /// Reset the menu stack and clear the planned filament action flag static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); 20d74: 80 91 82 06 lds r24, 0x0682 ; 0x800682 20d78: 81 11 cpse r24, r1 20d7a: 03 c0 rjmp .+6 ; 0x20d82 20d7c: 82 e0 ldi r24, 0x02 ; 2 20d7e: 0d 94 68 95 jmp 0x32ad0 ; 0x32ad0 20d82: 81 e0 ldi r24, 0x01 ; 1 20d84: fc cf rjmp .-8 ; 0x20d7e 00020d86 : } // Print temperature (nozzle/bed) (9 chars total) void lcdui_print_temp(char type, int val_current, int val_target) { int chars = lcd_printf_P(_N("%c%3d/%d" LCD_STR_DEGREE), type, val_current, val_target); 20d86: 5f 93 push r21 20d88: 4f 93 push r20 20d8a: 7f 93 push r23 20d8c: 6f 93 push r22 20d8e: 28 2f mov r18, r24 20d90: 08 2e mov r0, r24 20d92: 00 0c add r0, r0 20d94: 33 0b sbc r19, r19 20d96: 3f 93 push r19 20d98: 8f 93 push r24 20d9a: 82 ed ldi r24, 0xD2 ; 210 20d9c: 99 e6 ldi r25, 0x69 ; 105 20d9e: 9f 93 push r25 20da0: 8f 93 push r24 20da2: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 lcd_space(9 - chars); 20da6: 2d b7 in r18, 0x3d ; 61 20da8: 3e b7 in r19, 0x3e ; 62 20daa: 28 5f subi r18, 0xF8 ; 248 20dac: 3f 4f sbci r19, 0xFF ; 255 20dae: 0f b6 in r0, 0x3f ; 63 20db0: f8 94 cli 20db2: 3e bf out 0x3e, r19 ; 62 20db4: 0f be out 0x3f, r0 ; 63 20db6: 2d bf out 0x3d, r18 ; 61 20db8: 99 e0 ldi r25, 0x09 ; 9 20dba: 98 1b sub r25, r24 20dbc: 89 2f mov r24, r25 20dbe: 0c 94 71 69 jmp 0xd2e2 ; 0xd2e2 00020dc2 : default: return false; } } void lcd_print_target_temps_first_line() { 20dc2: cf 93 push r28 20dc4: df 93 push r29 lcd_home(); 20dc6: 0e 94 a7 69 call 0xd34e ; 0xd34e lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0)); 20dca: c0 91 f1 11 lds r28, 0x11F1 ; 0x8011f1 20dce: d0 91 f2 11 lds r29, 0x11F2 ; 0x8011f2 20dd2: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 20dd6: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 20dda: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 20dde: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 20de2: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 20de6: ae 01 movw r20, r28 20de8: 82 e8 ldi r24, 0x82 ; 130 20dea: 0f 94 c3 06 call 0x20d86 ; 0x20d86 lcd_set_cursor(10, 0); 20dee: 60 e0 ldi r22, 0x00 ; 0 20df0: 8a e0 ldi r24, 0x0A ; 10 20df2: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 20df6: c0 91 ed 11 lds r28, 0x11ED ; 0x8011ed 20dfa: d0 91 ee 11 lds r29, 0x11EE ; 0x8011ee int targetBedTemp = (int) degTargetBed(); if (targetBedTemp) { 20dfe: 20 97 sbiw r28, 0x00 ; 0 20e00: 81 f0 breq .+32 ; 0x20e22 lcdui_print_temp(LCD_STR_BEDTEMP[0], (int) degBed(), targetBedTemp); 20e02: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 20e06: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 20e0a: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 20e0e: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 20e12: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 20e16: ae 01 movw r20, r28 20e18: 80 e8 ldi r24, 0x80 ; 128 } else { lcd_space(10); } } 20e1a: df 91 pop r29 20e1c: cf 91 pop r28 lcd_home(); lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0)); lcd_set_cursor(10, 0); int targetBedTemp = (int) degTargetBed(); if (targetBedTemp) { lcdui_print_temp(LCD_STR_BEDTEMP[0], (int) degBed(), targetBedTemp); 20e1e: 0d 94 c3 06 jmp 0x20d86 ; 0x20d86 } else { lcd_space(10); 20e22: 8a e0 ldi r24, 0x0A ; 10 } } 20e24: df 91 pop r29 20e26: cf 91 pop r28 lcd_set_cursor(10, 0); int targetBedTemp = (int) degTargetBed(); if (targetBedTemp) { lcdui_print_temp(LCD_STR_BEDTEMP[0], (int) degBed(), targetBedTemp); } else { lcd_space(10); 20e28: 0c 94 71 69 jmp 0xd2e2 ; 0xd2e2 00020e2c : 20e2c: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 } } static void mFilamentPrompt() { lcd_timeoutToStatus.stop(); lcd_print_target_temps_first_line(); 20e30: 0f 94 e1 06 call 0x20dc2 ; 0x20dc2 lcd_puts_at_P(0,1, _T(MSG_PRESS_KNOB)); 20e34: 8d ee ldi r24, 0xED ; 237 20e36: 99 e4 ldi r25, 0x49 ; 73 20e38: 0e 94 b1 6c call 0xd962 ; 0xd962 20e3c: ac 01 movw r20, r24 20e3e: 61 e0 ldi r22, 0x01 ; 1 20e40: 80 e0 ldi r24, 0x00 ; 0 20e42: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_set_cursor(0,2); 20e46: 62 e0 ldi r22, 0x02 ; 2 20e48: 80 e0 ldi r24, 0x00 ; 0 20e4a: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 switch(eFilamentAction) { 20e4e: 80 91 62 03 lds r24, 0x0362 ; 0x800362 20e52: 83 30 cpi r24, 0x03 ; 3 20e54: 81 f1 breq .+96 ; 0x20eb6 20e56: 48 f4 brcc .+18 ; 0x20e6a 20e58: 81 30 cpi r24, 0x01 ; 1 20e5a: 60 f0 brcs .+24 ; 0x20e74 case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_TO_LOAD_FIL)); 20e5c: 8a ed ldi r24, 0xDA ; 218 20e5e: 99 e4 ldi r25, 0x49 ; 73 break; case FilamentAction::UnLoad: case FilamentAction::MmuUnLoad: lcd_puts_P(_T(MSG_TO_UNLOAD_FIL)); 20e60: 0e 94 b1 6c call 0xd962 ; 0xd962 20e64: 0e 94 66 69 call 0xd2cc ; 0xd2cc 20e68: 05 c0 rjmp .+10 ; 0x20e74 static void mFilamentPrompt() { lcd_timeoutToStatus.stop(); lcd_print_target_temps_first_line(); lcd_puts_at_P(0,1, _T(MSG_PRESS_KNOB)); lcd_set_cursor(0,2); switch(eFilamentAction) { 20e6a: 85 30 cpi r24, 0x05 ; 5 20e6c: 21 f1 breq .+72 ; 0x20eb6 20e6e: b0 f3 brcs .-20 ; 0x20e5c 20e70: 88 30 cpi r24, 0x08 ; 8 20e72: a1 f3 breq .-24 ; 0x20e5c case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } if(lcd_clicked() 20e74: 0e 94 98 6b call 0xd730 ; 0xd730 #ifdef FILAMENT_SENSOR /// @todo leptun - add this as a specific retest item || (((eFilamentAction == FilamentAction::Load) || (eFilamentAction == FilamentAction::AutoLoad)) && fsensor.getFilamentLoadEvent()) 20e78: 81 11 cpse r24, r1 20e7a: 09 c0 rjmp .+18 ; 0x20e8e 20e7c: 80 91 62 03 lds r24, 0x0362 ; 0x800362 20e80: 81 50 subi r24, 0x01 ; 1 20e82: 82 30 cpi r24, 0x02 ; 2 20e84: 28 f5 brcc .+74 ; 0x20ed0 20e86: 80 91 88 16 lds r24, 0x1688 ; 0x801688 20e8a: 88 23 and r24, r24 20e8c: 09 f1 breq .+66 ; 0x20ed0 #endif //FILAMENT_SENSOR ) { menu_back(bFilamentPreheatState ? 2 : 3); 20e8e: 80 91 82 06 lds r24, 0x0682 ; 0x800682 20e92: 81 11 cpse r24, r1 20e94: 13 c0 rjmp .+38 ; 0x20ebc 20e96: 83 e0 ldi r24, 0x03 ; 3 20e98: 0f 94 68 95 call 0x32ad0 ; 0x32ad0 switch(eFilamentAction) { 20e9c: 80 91 62 03 lds r24, 0x0362 ; 0x800362 20ea0: 82 30 cpi r24, 0x02 ; 2 20ea2: 71 f0 breq .+28 ; 0x20ec0 20ea4: 83 30 cpi r24, 0x03 ; 3 20ea6: 81 f0 breq .+32 ; 0x20ec8 20ea8: 81 30 cpi r24, 0x01 ; 1 20eaa: 91 f4 brne .+36 ; 0x20ed0 case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament 20eac: 61 e0 ldi r22, 0x01 ; 1 20eae: 83 e9 ldi r24, 0x93 ; 147 20eb0: 9a e6 ldi r25, 0x6A ; 106 break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 20eb2: 0c 94 af 7c jmp 0xf95e ; 0xf95e case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_TO_LOAD_FIL)); break; case FilamentAction::UnLoad: case FilamentAction::MmuUnLoad: lcd_puts_P(_T(MSG_TO_UNLOAD_FIL)); 20eb6: 85 ec ldi r24, 0xC5 ; 197 20eb8: 99 e4 ldi r25, 0x49 ; 73 20eba: d2 cf rjmp .-92 ; 0x20e60 #ifdef FILAMENT_SENSOR /// @todo leptun - add this as a specific retest item || (((eFilamentAction == FilamentAction::Load) || (eFilamentAction == FilamentAction::AutoLoad)) && fsensor.getFilamentLoadEvent()) #endif //FILAMENT_SENSOR ) { menu_back(bFilamentPreheatState ? 2 : 3); 20ebc: 82 e0 ldi r24, 0x02 ; 2 20ebe: ec cf rjmp .-40 ; 0x20e98 switch(eFilamentAction) { case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; 20ec0: 81 e0 ldi r24, 0x01 ; 1 20ec2: 80 93 62 03 sts 0x0362, r24 ; 0x800362 20ec6: f2 cf rjmp .-28 ; 0x20eac [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 20ec8: 61 e0 ldi r22, 0x01 ; 1 20eca: 8d e0 ldi r24, 0x0D ; 13 20ecc: 98 e6 ldi r25, 0x68 ; 104 20ece: f1 cf rjmp .-30 ; 0x20eb2 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } } } 20ed0: 08 95 ret 00020ed2 : #ifdef MENU_SERIAL_DUMP #include "Dcodes.h" static void lcd_serial_dump() { serial_dump_and_reset(dump_crash_reason::manual); 20ed2: 80 e0 ldi r24, 0x00 ; 0 20ed4: 0c 94 5d 74 jmp 0xe8ba ; 0xe8ba 00020ed8 : //! | Debug | c=18 //! @endcode //! ---------------------- //! @endcode static void lcd_support_menu() { 20ed8: ef 92 push r14 20eda: ff 92 push r15 20edc: 0f 93 push r16 20ede: 1f 93 push r17 20ee0: cf 93 push r28 20ee2: df 93 push r29 uint32_t ip; // 4bytes char ip_str[IP4_STR_SIZE]; // 16bytes } _menu_data_t; static_assert(sizeof(menu_data)>= sizeof(_menu_data_t),"_menu_data_t doesn't fit into menu_data"); _menu_data_t* _md = (_menu_data_t*)&(menu_data[0]); if (_md->status == 0 || lcd_draw_update == 2) 20ee4: 80 91 64 03 lds r24, 0x0364 ; 0x800364 20ee8: 88 23 and r24, r24 20eea: 29 f0 breq .+10 ; 0x20ef6 20eec: 90 91 5b 02 lds r25, 0x025B ; 0x80025b 20ef0: 92 30 cpi r25, 0x02 ; 2 20ef2: 09 f0 breq .+2 ; 0x20ef6 20ef4: 74 c1 rjmp .+744 ; 0x211de { // Menu was entered or SD card status has changed (plugged in or removed). // Initialize its status. _md->status = 1; 20ef6: 81 e0 ldi r24, 0x01 ; 1 20ef8: 80 93 64 03 sts 0x0364, r24 ; 0x800364 20efc: 80 91 db 15 lds r24, 0x15DB ; 0x8015db _md->is_flash_air = card.ToshibaFlashAir_isEnabled(); 20f00: 80 93 65 03 sts 0x0365, r24 ; 0x800365 if (_md->is_flash_air) { 20f04: 88 23 and r24, r24 20f06: 21 f0 breq .+8 ; 0x20f10 card.ToshibaFlashAir_GetIP((uint8_t*)(&_md->ip)); // ip == 0 if it failed 20f08: 86 e6 ldi r24, 0x66 ; 102 20f0a: 93 e0 ldi r25, 0x03 ; 3 20f0c: 0f 94 8a 52 call 0x2a514 ; 0x2a514 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 20f10: 0f 94 bc 92 call 0x32578 ; 0x32578 20f14: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e if (((menu_item - 1) == menu_line) && lcd_draw_update) { lcd_set_cursor(6, menu_row); MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); 20f18: 83 e9 ldi r24, 0x93 ; 147 20f1a: e8 2e mov r14, r24 20f1c: 85 e9 ldi r24, 0x95 ; 149 20f1e: f8 2e mov r15, r24 } } void ip4_to_str(char* dest, uint8_t* IP) { sprintf_P(dest, PSTR("%u.%u.%u.%u"), IP[0], IP[1], IP[2], IP[3]); 20f20: c2 e6 ldi r28, 0x62 ; 98 20f22: d5 e9 ldi r29, 0x95 ; 149 20f24: 0a e6 ldi r16, 0x6A ; 106 20f26: 13 e0 ldi r17, 0x03 ; 3 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 20f28: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 20f2c: 84 30 cpi r24, 0x04 ; 4 20f2e: 08 f0 brcs .+2 ; 0x20f32 20f30: 7d c1 rjmp .+762 ; 0x2122c 20f32: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 20f36: 88 ef ldi r24, 0xF8 ; 248 20f38: 9d e3 ldi r25, 0x3D ; 61 20f3a: 0e 94 b1 6c call 0xd962 ; 0xd962 20f3e: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_BACK_P(PSTR("Firmware:")); 20f42: 87 ef ldi r24, 0xF7 ; 247 20f44: 95 e9 ldi r25, 0x95 ; 149 20f46: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_BACK_P(PSTR(" " FW_VERSION_FULL)); 20f4a: 8a ee ldi r24, 0xEA ; 234 20f4c: 95 e9 ldi r25, 0x95 ; 149 20f4e: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_BACK_P(PSTR(" Repo:" FW_REPOSITORY)); 20f52: 8c ed ldi r24, 0xDC ; 220 20f54: 95 e9 ldi r25, 0x95 ; 149 20f56: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_BACK_P(PSTR(" Hash:" FW_COMMIT_HASH)); 20f5a: 8c ec ldi r24, 0xCC ; 204 20f5c: 95 e9 ldi r25, 0x95 ; 149 20f5e: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_BACK_P(_n("prusa3d.com"));////MSG_PRUSA3D c=18 20f62: 87 e8 ldi r24, 0x87 ; 135 20f64: 9a e6 ldi r25, 0x6A ; 106 20f66: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_BACK_P(_n("forum.prusa3d.com"));////MSG_PRUSA3D_FORUM c=18 20f6a: 85 e7 ldi r24, 0x75 ; 117 20f6c: 9a e6 ldi r25, 0x6A ; 106 20f6e: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_BACK_P(_n("help.prusa3d.com"));////MSG_PRUSA3D_HELP c=18 20f72: 84 e6 ldi r24, 0x64 ; 100 20f74: 9a e6 ldi r25, 0x6A ; 106 20f76: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_BACK_P(STR_SEPARATOR); 20f7a: 8b e1 ldi r24, 0x1B ; 27 20f7c: 93 e8 ldi r25, 0x83 ; 131 20f7e: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_BACK_P(PSTR(FILAMENT_SIZE)); 20f82: 8f eb ldi r24, 0xBF ; 191 20f84: 95 e9 ldi r25, 0x95 ; 149 20f86: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_BACK_P(PSTR(ELECTRONICS)); 20f8a: 86 eb ldi r24, 0xB6 ; 182 20f8c: 95 e9 ldi r25, 0x95 ; 149 20f8e: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_BACK_P(PSTR(NOZZLE_TYPE)); 20f92: 8c ea ldi r24, 0xAC ; 172 20f94: 95 e9 ldi r25, 0x95 ; 149 20f96: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_BACK_P(STR_SEPARATOR); 20f9a: 8b e1 ldi r24, 0x1B ; 27 20f9c: 93 e8 ldi r25, 0x83 ; 131 20f9e: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_BACK_P(_T(MSG_DATE)); 20fa2: 8d eb ldi r24, 0xBD ; 189 20fa4: 99 e4 ldi r25, 0x49 ; 73 20fa6: 0e 94 b1 6c call 0xd962 ; 0xd962 20faa: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_BACK_P(PSTR(SOURCE_DATE_EPOCH)); 20fae: 81 ea ldi r24, 0xA1 ; 161 20fb0: 95 e9 ldi r25, 0x95 ; 149 20fb2: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_BACK_P(STR_SEPARATOR); MENU_ITEM_BACK_P(PSTR("Fil. sensor v.:")); MENU_ITEM_BACK_P(fsensor.getIRVersionText()); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) MENU_ITEM_BACK_P(STR_SEPARATOR); 20fb6: 8b e1 ldi r24, 0x1B ; 27 20fb8: 93 e8 ldi r25, 0x83 ; 131 20fba: 0f 94 87 95 call 0x32b0e ; 0x32b0e if (MMU2::mmu2.Enabled()) 20fbe: 80 91 94 12 lds r24, 0x1294 ; 0x801294 20fc2: 81 30 cpi r24, 0x01 ; 1 20fc4: 09 f0 breq .+2 ; 0x20fc8 20fc6: 2d c1 rjmp .+602 ; 0x21222 { MENU_ITEM_BACK_P(_T(MSG_MMU_CONNECTED)); 20fc8: 8d ea ldi r24, 0xAD ; 173 20fca: 99 e4 ldi r25, 0x49 ; 73 20fcc: 0e 94 b1 6c call 0xd962 ; 0xd962 20fd0: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_BACK_P(PSTR(" FW:")); ////c=17 20fd4: 8c e9 ldi r24, 0x9C ; 156 20fd6: 95 e9 ldi r25, 0x95 ; 149 20fd8: 0f 94 87 95 call 0x32b0e ; 0x32b0e if (((menu_item - 1) == menu_line) && lcd_draw_update) 20fdc: 80 91 31 04 lds r24, 0x0431 ; 0x800431 20fe0: 81 50 subi r24, 0x01 ; 1 20fe2: 99 0b sbc r25, r25 20fe4: 20 91 30 04 lds r18, 0x0430 ; 0x800430 20fe8: 28 17 cp r18, r24 20fea: 19 06 cpc r1, r25 20fec: 49 f5 brne .+82 ; 0x21040 20fee: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 20ff2: 88 23 and r24, r24 20ff4: 29 f1 breq .+74 ; 0x21040 { lcd_set_cursor(6, menu_row); 20ff6: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 20ffa: 86 e0 ldi r24, 0x06 ; 6 20ffc: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 inline ErrorCode GetLastErrorCode() const { return lastErrorCode; } /// @returns the version of the connected MMU FW. /// In the future we'll return the trully detected FW version Version GetMMUFWVersion() const { if (State() == xState::Active) { 21000: 80 91 94 12 lds r24, 0x1294 ; 0x801294 21004: 81 30 cpi r24, 0x01 ; 1 21006: 09 f0 breq .+2 ; 0x2100a 21008: 05 c1 rjmp .+522 ; 0x21214 2100a: 80 91 74 12 lds r24, 0x1274 ; 0x801274 2100e: 90 91 75 12 lds r25, 0x1275 ; 0x801275 21012: 20 91 76 12 lds r18, 0x1276 ; 0x801276 MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) 21016: 88 23 and r24, r24 21018: 09 f4 brne .+2 ; 0x2101c 2101a: fc c0 rjmp .+504 ; 0x21214 lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); 2101c: 1f 92 push r1 2101e: 2f 93 push r18 21020: 1f 92 push r1 21022: 9f 93 push r25 21024: 1f 92 push r1 21026: 8f 93 push r24 21028: ff 92 push r15 2102a: ef 92 push r14 2102c: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 21030: 8d b7 in r24, 0x3d ; 61 21032: 9e b7 in r25, 0x3e ; 62 21034: 08 96 adiw r24, 0x08 ; 8 21036: 0f b6 in r0, 0x3f ; 63 21038: f8 94 cli 2103a: 9e bf out 0x3e, r25 ; 62 2103c: 0f be out 0x3f, r0 ; 63 2103e: 8d bf out 0x3d, r24 ; 61 else MENU_ITEM_BACK_P(PSTR("MMU N/A")); // Show the FlashAir IP address, if the card is available. if (_md->is_flash_air) { 21040: 80 91 65 03 lds r24, 0x0365 ; 0x800365 21044: 88 23 and r24, r24 21046: 09 f4 brne .+2 ; 0x2104a 21048: 40 c0 rjmp .+128 ; 0x210ca MENU_ITEM_BACK_P(STR_SEPARATOR); 2104a: 8b e1 ldi r24, 0x1B ; 27 2104c: 93 e8 ldi r25, 0x83 ; 131 2104e: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_BACK_P(PSTR("FlashAir IP Addr:")); ////MSG_FLASHAIR c=18 21052: 82 e7 ldi r24, 0x72 ; 114 21054: 95 e9 ldi r25, 0x95 ; 149 21056: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_BACK_P(PSTR(" ")); 2105a: 80 e7 ldi r24, 0x70 ; 112 2105c: 95 e9 ldi r25, 0x95 ; 149 2105e: 0f 94 87 95 call 0x32b0e ; 0x32b0e if (((menu_item - 1) == menu_line) && lcd_draw_update) { 21062: 80 91 31 04 lds r24, 0x0431 ; 0x800431 21066: 81 50 subi r24, 0x01 ; 1 21068: 99 0b sbc r25, r25 2106a: 20 91 30 04 lds r18, 0x0430 ; 0x800430 2106e: 28 17 cp r18, r24 21070: 19 06 cpc r1, r25 21072: 59 f5 brne .+86 ; 0x210ca 21074: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 21078: 88 23 and r24, r24 2107a: 39 f1 breq .+78 ; 0x210ca lcd_set_cursor(2, menu_row); 2107c: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 21080: 82 e0 ldi r24, 0x02 ; 2 21082: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 21086: 80 91 69 03 lds r24, 0x0369 ; 0x800369 2108a: 1f 92 push r1 2108c: 8f 93 push r24 2108e: 80 91 68 03 lds r24, 0x0368 ; 0x800368 21092: 1f 92 push r1 21094: 8f 93 push r24 21096: 80 91 67 03 lds r24, 0x0367 ; 0x800367 2109a: 1f 92 push r1 2109c: 8f 93 push r24 2109e: 80 91 66 03 lds r24, 0x0366 ; 0x800366 210a2: 1f 92 push r1 210a4: 8f 93 push r24 210a6: df 93 push r29 210a8: cf 93 push r28 210aa: 1f 93 push r17 210ac: 0f 93 push r16 210ae: 0f 94 f3 9e call 0x33de6 ; 0x33de6 ip4_to_str(_md->ip_str, (uint8_t*)(&_md->ip)); lcd_print(_md->ip_str); 210b2: 8a e6 ldi r24, 0x6A ; 106 210b4: 93 e0 ldi r25, 0x03 ; 3 210b6: 0e 94 82 6b call 0xd704 ; 0xd704 210ba: 8d b7 in r24, 0x3d ; 61 210bc: 9e b7 in r25, 0x3e ; 62 210be: 0c 96 adiw r24, 0x0c ; 12 210c0: 0f b6 in r0, 0x3f ; 63 210c2: f8 94 cli 210c4: 9e bf out 0x3e, r25 ; 62 210c6: 0f be out 0x3f, r0 ; 63 210c8: 8d bf out 0x3d, r24 ; 61 } } // Show the printer IP address, if it is available. if (IP_address) { 210ca: 80 91 7d 06 lds r24, 0x067D ; 0x80067d 210ce: 90 91 7e 06 lds r25, 0x067E ; 0x80067e 210d2: a0 91 7f 06 lds r26, 0x067F ; 0x80067f 210d6: b0 91 80 06 lds r27, 0x0680 ; 0x800680 210da: 89 2b or r24, r25 210dc: 8a 2b or r24, r26 210de: 8b 2b or r24, r27 210e0: 09 f4 brne .+2 ; 0x210e4 210e2: 42 c0 rjmp .+132 ; 0x21168 MENU_ITEM_BACK_P(STR_SEPARATOR); 210e4: 8b e1 ldi r24, 0x1B ; 27 210e6: 93 e8 ldi r25, 0x83 ; 131 210e8: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_BACK_P(_T(MSG_PRINTER_IP)); 210ec: 80 e9 ldi r24, 0x90 ; 144 210ee: 99 e4 ldi r25, 0x49 ; 73 210f0: 0e 94 b1 6c call 0xd962 ; 0xd962 210f4: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_BACK_P(PSTR(" ")); 210f8: 8e e6 ldi r24, 0x6E ; 110 210fa: 95 e9 ldi r25, 0x95 ; 149 210fc: 0f 94 87 95 call 0x32b0e ; 0x32b0e if (((menu_item - 1) == menu_line) && lcd_draw_update) { 21100: 80 91 31 04 lds r24, 0x0431 ; 0x800431 21104: 81 50 subi r24, 0x01 ; 1 21106: 99 0b sbc r25, r25 21108: 20 91 30 04 lds r18, 0x0430 ; 0x800430 2110c: 28 17 cp r18, r24 2110e: 19 06 cpc r1, r25 21110: 59 f5 brne .+86 ; 0x21168 21112: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 21116: 88 23 and r24, r24 21118: 39 f1 breq .+78 ; 0x21168 lcd_set_cursor(2, menu_row); 2111a: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 2111e: 82 e0 ldi r24, 0x02 ; 2 21120: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 21124: 80 91 80 06 lds r24, 0x0680 ; 0x800680 21128: 1f 92 push r1 2112a: 8f 93 push r24 2112c: 80 91 7f 06 lds r24, 0x067F ; 0x80067f 21130: 1f 92 push r1 21132: 8f 93 push r24 21134: 80 91 7e 06 lds r24, 0x067E ; 0x80067e 21138: 1f 92 push r1 2113a: 8f 93 push r24 2113c: 80 91 7d 06 lds r24, 0x067D ; 0x80067d 21140: 1f 92 push r1 21142: 8f 93 push r24 21144: df 93 push r29 21146: cf 93 push r28 21148: 1f 93 push r17 2114a: 0f 93 push r16 2114c: 0f 94 f3 9e call 0x33de6 ; 0x33de6 ip4_to_str(_md->ip_str, (uint8_t*)(&IP_address)); lcd_print(_md->ip_str); 21150: 8a e6 ldi r24, 0x6A ; 106 21152: 93 e0 ldi r25, 0x03 ; 3 21154: 0e 94 82 6b call 0xd704 ; 0xd704 21158: 8d b7 in r24, 0x3d ; 61 2115a: 9e b7 in r25, 0x3e ; 62 2115c: 0c 96 adiw r24, 0x0c ; 12 2115e: 0f b6 in r0, 0x3f ; 63 21160: f8 94 cli 21162: 9e bf out 0x3e, r25 ; 62 21164: 0f be out 0x3f, r0 ; 63 21166: 8d bf out 0x3d, r24 ; 61 } } MENU_ITEM_BACK_P(STR_SEPARATOR); 21168: 8b e1 ldi r24, 0x1B ; 27 2116a: 93 e8 ldi r25, 0x83 ; 131 2116c: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_SUBMENU_P(_T(MSG_XYZ_DETAILS), lcd_menu_xyz_y_min); 21170: 8d e7 ldi r24, 0x7D ; 125 21172: 99 e4 ldi r25, 0x49 ; 73 21174: 0e 94 b1 6c call 0xd962 ; 0xd962 21178: 63 eb ldi r22, 0xB3 ; 179 2117a: 76 e3 ldi r23, 0x36 ; 54 2117c: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_EXTRUDER), lcd_menu_extruder_info); 21180: 8d e6 ldi r24, 0x6D ; 109 21182: 99 e4 ldi r25, 0x49 ; 73 21184: 0e 94 b1 6c call 0xd962 ; 0xd962 21188: 61 ed ldi r22, 0xD1 ; 209 2118a: 77 e3 ldi r23, 0x37 ; 55 2118c: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_SENSORS), lcd_menu_show_sensors_state); 21190: 8f e5 ldi r24, 0x5F ; 95 21192: 99 e4 ldi r25, 0x49 ; 73 21194: 0e 94 b1 6c call 0xd962 ; 0xd962 21198: 6f e3 ldi r22, 0x3F ; 63 2119a: 77 e3 ldi r23, 0x37 ; 55 2119c: 0f 94 ea 94 call 0x329d4 ; 0x329d4 #ifdef TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_BELT_STATUS), lcd_menu_belt_status); #endif //TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_MENU_TEMPERATURES), lcd_menu_temperatures); 211a0: 80 e5 ldi r24, 0x50 ; 80 211a2: 99 e4 ldi r25, 0x49 ; 73 211a4: 0e 94 b1 6c call 0xd962 ; 0xd962 211a8: 6b e6 ldi r22, 0x6B ; 107 211aa: 77 e3 ldi r23, 0x37 ; 55 211ac: 0f 94 ea 94 call 0x329d4 ; 0x329d4 #ifdef MENU_DUMP MENU_ITEM_FUNCTION_P(_n("Dump memory"), lcd_dump_memory); #endif //MENU_DUMP #ifdef MENU_SERIAL_DUMP if (emergency_serial_dump) 211b0: 80 91 7c 06 lds r24, 0x067C ; 0x80067c 211b4: 88 23 and r24, r24 211b6: 31 f0 breq .+12 ; 0x211c4 MENU_ITEM_FUNCTION_P(_n("Dump to serial"), lcd_serial_dump); 211b8: 61 e5 ldi r22, 0x51 ; 81 211ba: 77 e3 ldi r23, 0x37 ; 55 211bc: 85 e5 ldi r24, 0x55 ; 85 211be: 9a e6 ldi r25, 0x6A ; 106 211c0: 0f 94 39 92 call 0x32472 ; 0x32472 MENU_ITEM_FUNCTION_P(PSTR("Stack crash"), lcd_stack_crash); #endif //EMERGENCY_HANDLERS MENU_ITEM_SUBMENU_P(PSTR("Debug"), lcd_menu_debug);////MSG_DEBUG c=18 #endif /* DEBUG_BUILD */ MENU_END(); 211c4: 0f 94 90 92 call 0x32520 ; 0x32520 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 211c8: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 211cc: 8f 5f subi r24, 0xFF ; 255 211ce: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 211d2: 80 91 30 04 lds r24, 0x0430 ; 0x800430 211d6: 8f 5f subi r24, 0xFF ; 255 211d8: 80 93 30 04 sts 0x0430, r24 ; 0x800430 211dc: a5 ce rjmp .-694 ; 0x20f28 _md->status = 1; _md->is_flash_air = card.ToshibaFlashAir_isEnabled(); if (_md->is_flash_air) { card.ToshibaFlashAir_GetIP((uint8_t*)(&_md->ip)); // ip == 0 if it failed } } else if (_md->is_flash_air && _md->ip == 0 && ++ _md->status == 16) 211de: 90 91 65 03 lds r25, 0x0365 ; 0x800365 211e2: 99 23 and r25, r25 211e4: 09 f4 brne .+2 ; 0x211e8 211e6: 94 ce rjmp .-728 ; 0x20f10 211e8: 40 91 66 03 lds r20, 0x0366 ; 0x800366 211ec: 50 91 67 03 lds r21, 0x0367 ; 0x800367 211f0: 60 91 68 03 lds r22, 0x0368 ; 0x800368 211f4: 70 91 69 03 lds r23, 0x0369 ; 0x800369 211f8: 45 2b or r20, r21 211fa: 46 2b or r20, r22 211fc: 47 2b or r20, r23 211fe: 09 f0 breq .+2 ; 0x21202 21200: 87 ce rjmp .-754 ; 0x20f10 21202: 8f 5f subi r24, 0xFF ; 255 21204: 80 31 cpi r24, 0x10 ; 16 21206: 19 f0 breq .+6 ; 0x2120e 21208: 80 93 64 03 sts 0x0364, r24 ; 0x800364 2120c: 81 ce rjmp .-766 ; 0x20f10 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; 2120e: 10 92 64 03 sts 0x0364, r1 ; 0x800364 21212: 7e ce rjmp .-772 ; 0x20f10 lcd_set_cursor(6, menu_row); MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); else lcd_puts_P(_T(MSG_UNKNOWN)); 21214: 83 ea ldi r24, 0xA3 ; 163 21216: 99 e4 ldi r25, 0x49 ; 73 21218: 0e 94 b1 6c call 0xd962 ; 0xd962 2121c: 0e 94 66 69 call 0xd2cc ; 0xd2cc 21220: 0f cf rjmp .-482 ; 0x21040 } } else MENU_ITEM_BACK_P(PSTR("MMU N/A")); 21222: 84 e8 ldi r24, 0x84 ; 132 21224: 95 e9 ldi r25, 0x95 ; 149 21226: 0f 94 87 95 call 0x32b0e ; 0x32b0e 2122a: 0a cf rjmp .-492 ; 0x21040 #endif //EMERGENCY_HANDLERS MENU_ITEM_SUBMENU_P(PSTR("Debug"), lcd_menu_debug);////MSG_DEBUG c=18 #endif /* DEBUG_BUILD */ MENU_END(); } 2122c: df 91 pop r29 2122e: cf 91 pop r28 21230: 1f 91 pop r17 21232: 0f 91 pop r16 21234: ff 90 pop r15 21236: ef 90 pop r14 21238: 08 95 ret 0002123a : { bool initialized; // 1byte } _menu_data_t; static_assert(sizeof(menu_data)>= sizeof(_menu_data_t),"_menu_data_t doesn't fit into menu_data"); _menu_data_t* _md = (_menu_data_t*)&(menu_data[0]); if(!_md->initialized) { 2123a: 80 91 64 03 lds r24, 0x0364 ; 0x800364 2123e: 81 11 cpse r24, r1 21240: 19 c0 rjmp .+50 ; 0x21274 lcd_clear(); 21242: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_puts_P(_T(MSG_MATERIAL_CHANGES)); /// MSG_MATERIAL_CHANGES c=18 21246: 87 e0 ldi r24, 0x07 ; 7 21248: 99 e4 ldi r25, 0x49 ; 73 2124a: 0e 94 b1 6c call 0xd962 ; 0xd962 2124e: 0e 94 66 69 call 0xd2cc ; 0xd2cc lcd_putc(':'); 21252: 8a e3 ldi r24, 0x3A ; 58 21254: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 lcd_set_cursor(10, 1); 21258: 61 e0 ldi r22, 0x01 ; 1 2125a: 8a e0 ldi r24, 0x0A ; 10 2125c: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_print(eeprom_read_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES)); 21260: 88 ea ldi r24, 0xA8 ; 168 21262: 9c e0 ldi r25, 0x0C ; 12 21264: 0f 94 e4 9f call 0x33fc8 ; 0x33fc8 void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); else lcd_printNumber(n, base); 21268: 4a e0 ldi r20, 0x0A ; 10 2126a: 0e 94 cf 6a call 0xd59e ; 0xd59e _md->initialized = true; 2126e: 81 e0 ldi r24, 0x01 ; 1 21270: 80 93 64 03 sts 0x0364, r24 ; 0x800364 } menu_back_if_clicked(); 21274: 0d 94 26 96 jmp 0x32c4c ; 0x32c4c 00021278 : } public: //! brief state automaton step routine //! @param current_temp current hotend/bed temperature (for computing simple hysteresis) //! @param mintemp minimal temperature including hysteresis to check current_temp against void step(float current_temp, float mintemp){ 21278: 0f 93 push r16 2127a: 1f 93 push r17 2127c: cf 93 push r28 2127e: df 93 push r29 21280: ec 01 movw r28, r24 21282: cb 01 movw r24, r22 21284: ba 01 movw r22, r20 static const char m1[] PROGMEM = "Please restart"; switch(state){ 21286: 4a 81 ldd r20, Y+2 ; 0x02 21288: 41 30 cpi r20, 0x01 ; 1 2128a: 29 f0 breq .+10 ; 0x21296 2128c: 88 f0 brcs .+34 ; 0x212b0 2128e: 42 30 cpi r20, 0x02 ; 2 21290: 09 f1 breq .+66 ; 0x212d4 21292: 43 30 cpi r20, 0x03 ; 3 21294: d1 f4 brne .+52 ; 0x212ca enum class States : uint8_t { Init = 0, TempAboveMintemp, ShowPleaseRestart, ShowMintemp }; States state = States::Init; uint8_t repeat = ALERT_AUTOMATON_SPEED_DIV; void substep(const char* next_msg, States next_state){ if( repeat == 0 ){ 21296: 8b 81 ldd r24, Y+3 ; 0x03 21298: 81 11 cpse r24, r1 2129a: 25 c0 rjmp .+74 ; 0x212e6 state = next_state; // advance to the next state 2129c: 82 e0 ldi r24, 0x02 ; 2 2129e: 8a 83 std Y+2, r24 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 212a0: 63 e0 ldi r22, 0x03 ; 3 212a2: 86 e8 ldi r24, 0x86 ; 134 212a4: 94 e9 ldi r25, 0x94 ; 148 212a6: 0e 94 01 e2 call 0x1c402 ; 0x1c402 repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too 212aa: 85 e0 ldi r24, 0x05 ; 5 } else { --repeat; 212ac: 8b 83 std Y+3, r24 ; 0x03 212ae: 0d c0 rjmp .+26 ; 0x212ca //! @param mintemp minimal temperature including hysteresis to check current_temp against void step(float current_temp, float mintemp){ static const char m1[] PROGMEM = "Please restart"; switch(state){ case States::Init: // initial state - check hysteresis if( current_temp > mintemp ){ 212b0: a9 01 movw r20, r18 212b2: 98 01 movw r18, r16 212b4: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 212b8: 18 16 cp r1, r24 212ba: 3c f4 brge .+14 ; 0x212ca lcd_setalertstatuspgm(m2, LCD_STATUS_CRITICAL); 212bc: 63 e0 ldi r22, 0x03 ; 3 212be: 88 81 ld r24, Y 212c0: 99 81 ldd r25, Y+1 ; 0x01 212c2: 0e 94 01 e2 call 0x1c402 ; 0x1c402 state = States::TempAboveMintemp; 212c6: 81 e0 ldi r24, 0x01 ; 1 212c8: 8a 83 std Y+2, r24 ; 0x02 break; case States::ShowPleaseRestart: // displaying "Please restart" substep(m2, States::ShowMintemp); break; } } 212ca: df 91 pop r29 212cc: cf 91 pop r28 212ce: 1f 91 pop r17 212d0: 0f 91 pop r16 212d2: 08 95 ret enum class States : uint8_t { Init = 0, TempAboveMintemp, ShowPleaseRestart, ShowMintemp }; States state = States::Init; uint8_t repeat = ALERT_AUTOMATON_SPEED_DIV; void substep(const char* next_msg, States next_state){ if( repeat == 0 ){ 212d4: 8b 81 ldd r24, Y+3 ; 0x03 212d6: 81 11 cpse r24, r1 212d8: 06 c0 rjmp .+12 ; 0x212e6 case States::TempAboveMintemp: // the temperature has risen above the hysteresis check case States::ShowMintemp: // displaying "MINTEMP fixed" substep(m1, States::ShowPleaseRestart); break; case States::ShowPleaseRestart: // displaying "Please restart" substep(m2, States::ShowMintemp); 212da: 88 81 ld r24, Y 212dc: 99 81 ldd r25, Y+1 ; 0x01 States state = States::Init; uint8_t repeat = ALERT_AUTOMATON_SPEED_DIV; void substep(const char* next_msg, States next_state){ if( repeat == 0 ){ state = next_state; // advance to the next state 212de: 23 e0 ldi r18, 0x03 ; 3 212e0: 2a 83 std Y+2, r18 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 212e2: 63 e0 ldi r22, 0x03 ; 3 212e4: e0 cf rjmp .-64 ; 0x212a6 repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too } else { --repeat; 212e6: 81 50 subi r24, 0x01 ; 1 212e8: e1 cf rjmp .-62 ; 0x212ac 000212ea : } } static void temp_runaway_stop(bool isPreheat, bool isBed) { 212ea: cf 93 push r28 212ec: df 93 push r29 if(IsStopped() == false) { 212ee: 90 91 ce 11 lds r25, 0x11CE ; 0x8011ce 212f2: 91 11 cpse r25, r1 212f4: 21 c0 rjmp .+66 ; 0x21338 212f6: c6 2f mov r28, r22 212f8: d8 2f mov r29, r24 if (isPreheat) { 212fa: 88 23 and r24, r24 212fc: 09 f1 breq .+66 ; 0x21340 lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); 212fe: 8a e2 ldi r24, 0x2A ; 42 21300: 94 e9 ldi r25, 0x94 ; 148 21302: 66 23 and r22, r22 21304: 11 f0 breq .+4 ; 0x2130a 21306: 88 e3 ldi r24, 0x38 ; 56 21308: 94 e9 ldi r25, 0x94 ; 148 2130a: 63 e0 ldi r22, 0x03 ; 3 2130c: 0e 94 01 e2 call 0x1c402 ; 0x1c402 SERIAL_ERROR_START; 21310: 84 e4 ldi r24, 0x44 ; 68 21312: 9d e9 ldi r25, 0x9D ; 157 21314: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 if (isBed) { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); 21318: 87 e0 ldi r24, 0x07 ; 7 2131a: 94 e9 ldi r25, 0x94 ; 148 { if(IsStopped() == false) { if (isPreheat) { lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); SERIAL_ERROR_START; if (isBed) { 2131c: c1 11 cpse r28, r1 2131e: 02 c0 rjmp .+4 ; 0x21324 SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); } else { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HOTEND)"); 21320: 85 ee ldi r24, 0xE5 ; 229 21322: 93 e9 ldi r25, 0x93 ; 147 lcd_setalertstatuspgm(isBed? PSTR("BED THERMAL RUNAWAY") : PSTR("THERMAL RUNAWAY"), LCD_STATUS_CRITICAL); SERIAL_ERROR_START; if (isBed) { SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); } else { SERIAL_ERRORLNPGM(" HOTEND THERMAL RUNAWAY"); 21324: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 } } prusa_statistics(0); 21328: 80 e0 ldi r24, 0x00 ; 0 2132a: 0f 94 ff 97 call 0x32ffe ; 0x32ffe prusa_statistics(isPreheat? 91 : 90); 2132e: 8a e5 ldi r24, 0x5A ; 90 21330: d1 11 cpse r29, r1 21332: 8b e5 ldi r24, 0x5B ; 91 21334: 0f 94 ff 97 call 0x32ffe ; 0x32ffe } ThermalStop(); } 21338: df 91 pop r29 2133a: cf 91 pop r28 } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 2133c: 0d 94 35 43 jmp 0x2866a ; 0x2866a SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); } else { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HOTEND)"); } } else { lcd_setalertstatuspgm(isBed? PSTR("BED THERMAL RUNAWAY") : PSTR("THERMAL RUNAWAY"), LCD_STATUS_CRITICAL); 21340: 81 ec ldi r24, 0xC1 ; 193 21342: 93 e9 ldi r25, 0x93 ; 147 21344: 66 23 and r22, r22 21346: 11 f0 breq .+4 ; 0x2134c 21348: 81 ed ldi r24, 0xD1 ; 209 2134a: 93 e9 ldi r25, 0x93 ; 147 2134c: 63 e0 ldi r22, 0x03 ; 3 2134e: 0e 94 01 e2 call 0x1c402 ; 0x1c402 SERIAL_ERROR_START; 21352: 84 e4 ldi r24, 0x44 ; 68 21354: 9d e9 ldi r25, 0x9D ; 157 21356: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 if (isBed) { SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); 2135a: 88 ea ldi r24, 0xA8 ; 168 2135c: 93 e9 ldi r25, 0x93 ; 147 SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HOTEND)"); } } else { lcd_setalertstatuspgm(isBed? PSTR("BED THERMAL RUNAWAY") : PSTR("THERMAL RUNAWAY"), LCD_STATUS_CRITICAL); SERIAL_ERROR_START; if (isBed) { 2135e: c1 11 cpse r28, r1 21360: e1 cf rjmp .-62 ; 0x21324 SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); } else { SERIAL_ERRORLNPGM(" HOTEND THERMAL RUNAWAY"); 21362: 80 e9 ldi r24, 0x90 ; 144 21364: 93 e9 ldi r25, 0x93 ; 147 21366: de cf rjmp .-68 ; 0x21324 00021368 : } static void Sound_DoSound_Prompt(void) { backlight_wake(2); WRITE(BEEPER,HIGH); 21368: 72 9a sbi 0x0e, 2 ; 14 2136a: 2f ef ldi r18, 0xFF ; 255 2136c: 89 e6 ldi r24, 0x69 ; 105 2136e: 98 e1 ldi r25, 0x18 ; 24 21370: 21 50 subi r18, 0x01 ; 1 21372: 80 40 sbci r24, 0x00 ; 0 21374: 90 40 sbci r25, 0x00 ; 0 21376: e1 f7 brne .-8 ; 0x21370 21378: 00 c0 rjmp .+0 ; 0x2137a 2137a: 00 00 nop _delay_ms(500); WRITE(BEEPER,LOW); 2137c: 72 98 cbi 0x0e, 2 ; 14 } 2137e: 08 95 ret 00021380 : MENU_ITEM_EDIT_int3_jmp_P(_T(MSG_BED), &target_temperature_bed, 0, BED_MAXTEMP - 5, LCD_JUMP_BED_TEMP); #endif MENU_ITEM_EDIT_int3_jmp_P(_T(MSG_FAN_SPEED), &fanSpeed, 0, 255, LCD_JUMP_FAN_SPEED); } void SETTINGS_FANS_CHECK() { 21380: cf 93 push r28 21382: df 93 push r29 MENU_ITEM_TOGGLE_P(_T(MSG_FANS_CHECK), fans_check_enabled ? _T(MSG_ON) : _T(MSG_OFF), lcd_set_fan_check); 21384: 80 91 40 02 lds r24, 0x0240 ; 0x800240 21388: 88 23 and r24, r24 2138a: 89 f0 breq .+34 ; 0x213ae 2138c: 8f ea ldi r24, 0xAF ; 175 2138e: 9a e5 ldi r25, 0x5A ; 90 21390: 0e 94 b1 6c call 0xd962 ; 0xd962 21394: ec 01 movw r28, r24 21396: 83 e7 ldi r24, 0x73 ; 115 21398: 95 e5 ldi r25, 0x55 ; 85 2139a: 0e 94 b1 6c call 0xd962 ; 0xd962 2139e: 22 e0 ldi r18, 0x02 ; 2 213a0: 4a ec ldi r20, 0xCA ; 202 213a2: 5c ef ldi r21, 0xFC ; 252 213a4: be 01 movw r22, r28 } 213a6: df 91 pop r29 213a8: cf 91 pop r28 #endif MENU_ITEM_EDIT_int3_jmp_P(_T(MSG_FAN_SPEED), &fanSpeed, 0, 255, LCD_JUMP_FAN_SPEED); } void SETTINGS_FANS_CHECK() { MENU_ITEM_TOGGLE_P(_T(MSG_FANS_CHECK), fans_check_enabled ? _T(MSG_ON) : _T(MSG_OFF), lcd_set_fan_check); 213aa: 0d 94 4b 94 jmp 0x32896 ; 0x32896 213ae: 89 ea ldi r24, 0xA9 ; 169 213b0: 9a e5 ldi r25, 0x5A ; 90 213b2: ee cf rjmp .-36 ; 0x21390 000213b4 : } #endif // TMC2130 } } static void menuitems_temperature_common() { 213b4: ef 92 push r14 213b6: ff 92 push r15 213b8: 0f 93 push r16 213ba: 1f 93 push r17 #if TEMP_SENSOR_0 != 0 MENU_ITEM_EDIT_int3_jmp_P(_T(MSG_NOZZLE), &target_temperature[0], 0, HEATER_0_MAXTEMP - 10, LCD_JUMP_HOTEND_TEMP); 213bc: 88 e8 ldi r24, 0x88 ; 136 213be: 95 e5 ldi r25, 0x55 ; 85 213c0: 0e 94 b1 6c call 0xd962 ; 0xd962 213c4: 28 ec ldi r18, 0xC8 ; 200 213c6: e2 2e mov r14, r18 213c8: f1 2c mov r15, r1 213ca: 07 e2 ldi r16, 0x27 ; 39 213cc: 11 e0 ldi r17, 0x01 ; 1 213ce: 30 e0 ldi r19, 0x00 ; 0 213d0: 20 e0 ldi r18, 0x00 ; 0 213d2: 40 e1 ldi r20, 0x10 ; 16 213d4: 61 ef ldi r22, 0xF1 ; 241 213d6: 71 e1 ldi r23, 0x11 ; 17 213d8: 0f 94 0c 93 call 0x32618 ; 0x32618 #endif #if TEMP_SENSOR_BED != 0 MENU_ITEM_EDIT_int3_jmp_P(_T(MSG_BED), &target_temperature_bed, 0, BED_MAXTEMP - 5, LCD_JUMP_BED_TEMP); 213dc: 8d e6 ldi r24, 0x6D ; 109 213de: 95 e5 ldi r25, 0x55 ; 85 213e0: 0e 94 b1 6c call 0xd962 ; 0xd962 213e4: 32 e3 ldi r19, 0x32 ; 50 213e6: e3 2e mov r14, r19 213e8: f1 2c mov r15, r1 213ea: 08 e7 ldi r16, 0x78 ; 120 213ec: 10 e0 ldi r17, 0x00 ; 0 213ee: 30 e0 ldi r19, 0x00 ; 0 213f0: 20 e0 ldi r18, 0x00 ; 0 213f2: 40 e1 ldi r20, 0x10 ; 16 213f4: 6d ee ldi r22, 0xED ; 237 213f6: 71 e1 ldi r23, 0x11 ; 17 213f8: 0f 94 0c 93 call 0x32618 ; 0x32618 #endif MENU_ITEM_EDIT_int3_jmp_P(_T(MSG_FAN_SPEED), &fanSpeed, 0, 255, LCD_JUMP_FAN_SPEED); 213fc: 81 e6 ldi r24, 0x61 ; 97 213fe: 95 e5 ldi r25, 0x55 ; 85 21400: 0e 94 b1 6c call 0xd962 ; 0xd962 21404: 4f e7 ldi r20, 0x7F ; 127 21406: e4 2e mov r14, r20 21408: f1 2c mov r15, r1 2140a: 0f ef ldi r16, 0xFF ; 255 2140c: 10 e0 ldi r17, 0x00 ; 0 2140e: 30 e0 ldi r19, 0x00 ; 0 21410: 20 e0 ldi r18, 0x00 ; 0 21412: 48 e0 ldi r20, 0x08 ; 8 21414: 69 ee ldi r22, 0xE9 ; 233 21416: 71 e1 ldi r23, 0x11 ; 17 21418: 0f 94 0c 93 call 0x32618 ; 0x32618 } 2141c: 1f 91 pop r17 2141e: 0f 91 pop r16 21420: ff 90 pop r15 21422: ef 90 pop r14 21424: 08 95 ret 00021426 : } #endif //FILAMENT_SENSOR static void menuitems_MMU_settings_common() { 21426: cf 93 push r28 21428: df 93 push r29 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 2142a: 86 ed ldi r24, 0xD6 ; 214 2142c: 9e e0 ldi r25, 0x0E ; 14 2142e: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 21432: 81 30 cpi r24, 0x01 ; 1 21434: 19 f5 brne .+70 ; 0x2147c MENU_ITEM_TOGGLE_P(MSG_SPOOL_JOIN, SpoolJoin::spooljoin.isSpoolJoinEnabled() ? _T(MSG_ON) : _T(MSG_OFF), SpoolJoin::spooljoin.toggleSpoolJoin); 21436: 8f ea ldi r24, 0xAF ; 175 21438: 9a e5 ldi r25, 0x5A ; 90 2143a: 0e 94 b1 6c call 0xd962 ; 0xd962 2143e: 22 e0 ldi r18, 0x02 ; 2 21440: 4d ea ldi r20, 0xAD ; 173 21442: 5d ef ldi r21, 0xFD ; 253 21444: bc 01 movw r22, r24 21446: 84 e5 ldi r24, 0x54 ; 84 21448: 9b e6 ldi r25, 0x6B ; 107 2144a: 0f 94 4b 94 call 0x32896 ; 0x32896 #ifdef MMU_HAS_CUTTER if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t *)EEPROM_MMU_CUTTER_ENABLED)) 2144e: 8e ec ldi r24, 0xCE ; 206 21450: 9e e0 ldi r25, 0x0E ; 14 21452: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 21456: 81 30 cpi r24, 0x01 ; 1 21458: a1 f4 brne .+40 ; 0x21482 { MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_ON), lcd_cutter_enabled); 2145a: 8f ea ldi r24, 0xAF ; 175 2145c: 9a e5 ldi r25, 0x5A ; 90 MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_ALWAYS), lcd_cutter_enabled); } #endif else { MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_OFF), lcd_cutter_enabled); 2145e: 0e 94 b1 6c call 0xd962 ; 0xd962 21462: ec 01 movw r28, r24 21464: 88 e5 ldi r24, 0x58 ; 88 21466: 95 e5 ldi r25, 0x55 ; 85 21468: 0e 94 b1 6c call 0xd962 ; 0xd962 2146c: 22 e0 ldi r18, 0x02 ; 2 2146e: 49 eb ldi r20, 0xB9 ; 185 21470: 5d ef ldi r21, 0xFD ; 253 21472: be 01 movw r22, r28 #endif // MMU_HAS_CUTTER #ifndef MMU_FORCE_STEALTH_MODE MENU_ITEM_TOGGLE_P(_T(MSG_MMU_MODE), eeprom_read_byte((uint8_t *)EEPROM_MMU_STEALTH) ? _T(MSG_STEALTH) : _T(MSG_NORMAL), lcd_mmu_mode_toggle); #endif // MMU_FORCE_STEALTH_MODE } 21474: df 91 pop r29 21476: cf 91 pop r28 MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_ALWAYS), lcd_cutter_enabled); } #endif else { MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_OFF), lcd_cutter_enabled); 21478: 0d 94 4b 94 jmp 0x32896 ; 0x32896 #endif //FILAMENT_SENSOR static void menuitems_MMU_settings_common() { MENU_ITEM_TOGGLE_P(MSG_SPOOL_JOIN, SpoolJoin::spooljoin.isSpoolJoinEnabled() ? _T(MSG_ON) : _T(MSG_OFF), SpoolJoin::spooljoin.toggleSpoolJoin); 2147c: 89 ea ldi r24, 0xA9 ; 169 2147e: 9a e5 ldi r25, 0x5A ; 90 21480: dc cf rjmp .-72 ; 0x2143a MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_ALWAYS), lcd_cutter_enabled); } #endif else { MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_OFF), lcd_cutter_enabled); 21482: 89 ea ldi r24, 0xA9 ; 169 21484: 9a e5 ldi r25, 0x5A ; 90 21486: eb cf rjmp .-42 ; 0x2145e 00021488 : lcd_update(2); } #ifndef TMC2130 static void lcd_show_end_stops() { lcd_puts_at_P(0, 0, (PSTR("End stops diag"))); 21488: 4f ef ldi r20, 0xFF ; 255 2148a: 57 e9 ldi r21, 0x97 ; 151 2148c: 60 e0 ldi r22, 0x00 ; 0 2148e: 80 e0 ldi r24, 0x00 ; 0 21490: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_puts_at_P(0, 1, (READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) ? (PSTR("X1")) : (PSTR("X0"))); 21494: 1e 99 sbic 0x03, 6 ; 3 21496: 16 c0 rjmp .+44 ; 0x214c4 21498: 49 ef ldi r20, 0xF9 ; 249 2149a: 57 e9 ldi r21, 0x97 ; 151 2149c: 61 e0 ldi r22, 0x01 ; 1 2149e: 80 e0 ldi r24, 0x00 ; 0 214a0: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_puts_at_P(0, 2, (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) ? (PSTR("Y1")) : (PSTR("Y0"))); 214a4: 1d 9b sbis 0x03, 5 ; 3 214a6: 11 c0 rjmp .+34 ; 0x214ca 214a8: 46 ef ldi r20, 0xF6 ; 246 214aa: 57 e9 ldi r21, 0x97 ; 151 214ac: 62 e0 ldi r22, 0x02 ; 2 214ae: 80 e0 ldi r24, 0x00 ; 0 214b0: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_puts_at_P(0, 3, (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING) ? (PSTR("Z1")) : (PSTR("Z0"))); 214b4: 1c 9b sbis 0x03, 4 ; 3 214b6: 0c c0 rjmp .+24 ; 0x214d0 214b8: 40 ef ldi r20, 0xF0 ; 240 214ba: 57 e9 ldi r21, 0x97 ; 151 214bc: 63 e0 ldi r22, 0x03 ; 3 214be: 80 e0 ldi r24, 0x00 ; 0 214c0: 0c 94 8f 69 jmp 0xd31e ; 0xd31e } #ifndef TMC2130 static void lcd_show_end_stops() { lcd_puts_at_P(0, 0, (PSTR("End stops diag"))); lcd_puts_at_P(0, 1, (READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) ? (PSTR("X1")) : (PSTR("X0"))); 214c4: 4c ef ldi r20, 0xFC ; 252 214c6: 57 e9 ldi r21, 0x97 ; 151 214c8: e9 cf rjmp .-46 ; 0x2149c lcd_puts_at_P(0, 2, (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) ? (PSTR("Y1")) : (PSTR("Y0"))); 214ca: 43 ef ldi r20, 0xF3 ; 243 214cc: 57 e9 ldi r21, 0x97 ; 151 214ce: ee cf rjmp .-36 ; 0x214ac lcd_puts_at_P(0, 3, (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING) ? (PSTR("Z1")) : (PSTR("Z0"))); 214d0: 4d ee ldi r20, 0xED ; 237 214d2: 57 e9 ldi r21, 0x97 ; 151 214d4: f3 cf rjmp .-26 ; 0x214bc 000214d6 : } static void menu_show_end_stops() { lcd_show_end_stops(); 214d6: 0f 94 44 0a call 0x21488 ; 0x21488 menu_back_if_clicked(); 214da: 0d 94 26 96 jmp 0x32c4c ; 0x32c4c 000214de : //! @param first_choice text caption of first possible choice //! @param second_choice text caption of second possible choice //! @param second_col column on LCD where second choice is rendered. //! @param third_choice text caption of third, optional, choice. void lcd_show_choices_prompt_P(uint8_t selected, const char *first_choice, const char *second_choice, uint8_t second_col, const char *third_choice) { 214de: cf 92 push r12 214e0: df 92 push r13 214e2: ef 92 push r14 214e4: ff 92 push r15 214e6: 0f 93 push r16 214e8: 1f 93 push r17 214ea: cf 93 push r28 214ec: df 93 push r29 214ee: d8 2f mov r29, r24 214f0: 6b 01 movw r12, r22 214f2: 7a 01 movw r14, r20 214f4: c2 2f mov r28, r18 lcd_putc_at(0, 3, selected == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 214f6: 40 e2 ldi r20, 0x20 ; 32 214f8: 81 11 cpse r24, r1 214fa: 01 c0 rjmp .+2 ; 0x214fe 214fc: 4e e3 ldi r20, 0x3E ; 62 214fe: 63 e0 ldi r22, 0x03 ; 3 21500: 80 e0 ldi r24, 0x00 ; 0 21502: 0e 94 9b 69 call 0xd336 ; 0xd336 lcd_puts_P(first_choice); 21506: c6 01 movw r24, r12 21508: 0e 94 66 69 call 0xd2cc ; 0xd2cc lcd_putc_at(second_col, 3, selected == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 2150c: 40 e2 ldi r20, 0x20 ; 32 2150e: d1 30 cpi r29, 0x01 ; 1 21510: 09 f4 brne .+2 ; 0x21514 21512: 4e e3 ldi r20, 0x3E ; 62 21514: 63 e0 ldi r22, 0x03 ; 3 21516: 8c 2f mov r24, r28 21518: 0e 94 9b 69 call 0xd336 ; 0xd336 lcd_puts_P(second_choice); 2151c: c7 01 movw r24, r14 2151e: 0e 94 66 69 call 0xd2cc ; 0xd2cc if (third_choice) { 21522: 01 15 cp r16, r1 21524: 11 05 cpc r17, r1 21526: 19 f1 breq .+70 ; 0x2156e 21528: c8 01 movw r24, r16 2152a: 0f 94 9a 9d call 0x33b34 ; 0x33b34 <__strlen_P> 2152e: d8 2e mov r13, r24 21530: c7 01 movw r24, r14 21532: 0f 94 9a 9d call 0x33b34 ; 0x33b34 <__strlen_P> ////get size of third_choice, offset to the left. Make sure it doesn't overlap second_choice. size_t third_choice_len = strlen_P(third_choice); uint8_t second_col_end = second_col + strlen_P(second_choice) + 2; 21536: ce 5f subi r28, 0xFE ; 254 uint8_t third_col; if (uint8_t pos = 19 - third_choice_len; pos > second_col_end) {third_col = pos;} else {third_col = second_col_end;} 21538: 93 e1 ldi r25, 0x13 ; 19 2153a: 9d 19 sub r25, r13 2153c: 8c 0f add r24, r28 2153e: 89 17 cp r24, r25 21540: 08 f4 brcc .+2 ; 0x21544 21542: 89 2f mov r24, r25 21544: 83 31 cpi r24, 0x13 ; 19 21546: 08 f0 brcs .+2 ; 0x2154a 21548: 82 e1 ldi r24, 0x12 ; 18 if (third_col > 18) {third_col = 18;} //backwards compatability - make sure at least one character of the third selection is shown lcd_putc_at(third_col, 3, selected == LCD_RIGHT_BUTTON_CHOICE ? '>': ' '); 2154a: 40 e2 ldi r20, 0x20 ; 32 2154c: d2 30 cpi r29, 0x02 ; 2 2154e: 09 f4 brne .+2 ; 0x21552 21550: 4e e3 ldi r20, 0x3E ; 62 21552: 63 e0 ldi r22, 0x03 ; 3 21554: 0e 94 9b 69 call 0xd336 ; 0xd336 lcd_puts_P(third_choice); 21558: c8 01 movw r24, r16 } } 2155a: df 91 pop r29 2155c: cf 91 pop r28 2155e: 1f 91 pop r17 21560: 0f 91 pop r16 21562: ff 90 pop r15 21564: ef 90 pop r14 21566: df 90 pop r13 21568: cf 90 pop r12 uint8_t second_col_end = second_col + strlen_P(second_choice) + 2; uint8_t third_col; if (uint8_t pos = 19 - third_choice_len; pos > second_col_end) {third_col = pos;} else {third_col = second_col_end;} if (third_col > 18) {third_col = 18;} //backwards compatability - make sure at least one character of the third selection is shown lcd_putc_at(third_col, 3, selected == LCD_RIGHT_BUTTON_CHOICE ? '>': ' '); lcd_puts_P(third_choice); 2156a: 0c 94 66 69 jmp 0xd2cc ; 0xd2cc } } 2156e: df 91 pop r29 21570: cf 91 pop r28 21572: 1f 91 pop r17 21574: 0f 91 pop r16 21576: ff 90 pop r15 21578: ef 90 pop r14 2157a: df 90 pop r13 2157c: cf 90 pop r12 2157e: 08 95 ret 00021580 : return multi_screen ? msgend : NULL; } const char* lcd_display_message_fullscreen_P(const char *msg) { 21580: cf 93 push r28 21582: df 93 push r29 21584: ec 01 movw r28, r24 // Disable update of the screen by the usual lcd_update(0) routine. lcd_update_enable(false); 21586: 80 e0 ldi r24, 0x00 ; 0 21588: 0e 94 c0 69 call 0xd380 ; 0xd380 lcd_clear(); 2158c: 0e 94 ae 69 call 0xd35c ; 0xd35c return lcd_display_message_fullscreen_nonBlocking_P(msg); 21590: ce 01 movw r24, r28 } 21592: df 91 pop r29 21594: cf 91 pop r28 const char* lcd_display_message_fullscreen_P(const char *msg) { // Disable update of the screen by the usual lcd_update(0) routine. lcd_update_enable(false); lcd_clear(); return lcd_display_message_fullscreen_nonBlocking_P(msg); 21596: 0d 94 2d 04 jmp 0x2085a ; 0x2085a 0002159a : lang_select(LANG_ID_PRI); } #endif static void wait_preheat() { 2159a: cf 92 push r12 2159c: df 92 push r13 2159e: ef 92 push r14 215a0: ff 92 push r15 current_position[Z_AXIS] = 100; //move in z axis to make space for loading filament 215a2: 80 e0 ldi r24, 0x00 ; 0 215a4: 90 e0 ldi r25, 0x00 ; 0 215a6: a8 ec ldi r26, 0xC8 ; 200 215a8: b2 e4 ldi r27, 0x42 ; 66 215aa: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 215ae: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 215b2: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 215b6: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 215ba: 65 e5 ldi r22, 0x55 ; 85 215bc: 75 e5 ldi r23, 0x55 ; 85 215be: 85 e5 ldi r24, 0x55 ; 85 215c0: 91 e4 ldi r25, 0x41 ; 65 215c2: 0f 94 70 84 call 0x308e0 ; 0x308e0 delay_keep_alive(2000); 215c6: 80 ed ldi r24, 0xD0 ; 208 215c8: 97 e0 ldi r25, 0x07 ; 7 215ca: 0e 94 48 7c call 0xf890 ; 0xf890 lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 215ce: 85 e4 ldi r24, 0x45 ; 69 215d0: 9e e4 ldi r25, 0x4E ; 78 215d2: 0e 94 b1 6c call 0xd962 ; 0xd962 215d6: 0f 94 c0 0a call 0x21580 ; 0x21580 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 215da: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 215de: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 215e2: 07 2e mov r0, r23 215e4: 00 0c add r0, r0 215e6: 88 0b sbc r24, r24 215e8: 99 0b sbc r25, r25 215ea: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 215ee: 9b 01 movw r18, r22 215f0: ac 01 movw r20, r24 while (fabs(degHotend(0) - degTargetHotend(0)) > TEMP_HYSTERESIS) { 215f2: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 215f6: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 215fa: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 215fe: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 21602: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 21606: 9f 77 andi r25, 0x7F ; 127 21608: 20 e0 ldi r18, 0x00 ; 0 2160a: 30 e0 ldi r19, 0x00 ; 0 2160c: 40 ea ldi r20, 0xA0 ; 160 2160e: 50 e4 ldi r21, 0x40 ; 64 21610: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 21614: 18 16 cp r1, r24 21616: b4 f5 brge .+108 ; 0x21684 lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 21618: 85 e4 ldi r24, 0x45 ; 69 2161a: 9e e4 ldi r25, 0x4E ; 78 2161c: 0e 94 b1 6c call 0xd962 ; 0xd962 21620: 0f 94 c0 0a call 0x21580 ; 0x21580 lcd_set_cursor(0, 4); 21624: 64 e0 ldi r22, 0x04 ; 4 21626: 80 e0 ldi r24, 0x00 ; 0 21628: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 2162c: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 21630: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 21634: 07 2e mov r0, r23 21636: 00 0c add r0, r0 21638: 88 0b sbc r24, r24 2163a: 99 0b sbc r25, r25 2163c: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> //Print the hotend temperature (9 chars total) lcdui_print_temp(LCD_STR_THERMOMETER[0], (int)(degHotend(0) + 0.5), (int)(degTargetHotend(0) + 0.5)); 21640: 20 e0 ldi r18, 0x00 ; 0 21642: 30 e0 ldi r19, 0x00 ; 0 21644: 40 e0 ldi r20, 0x00 ; 0 21646: 5f e3 ldi r21, 0x3F ; 63 21648: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2164c: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 21650: 6b 01 movw r12, r22 21652: 20 e0 ldi r18, 0x00 ; 0 21654: 30 e0 ldi r19, 0x00 ; 0 21656: 40 e0 ldi r20, 0x00 ; 0 21658: 5f e3 ldi r21, 0x3F ; 63 2165a: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 2165e: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 21662: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 21666: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 2166a: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2166e: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 21672: a6 01 movw r20, r12 21674: 82 e8 ldi r24, 0x82 ; 130 21676: 0f 94 c3 06 call 0x20d86 ; 0x20d86 delay_keep_alive(1000); 2167a: 88 ee ldi r24, 0xE8 ; 232 2167c: 93 e0 ldi r25, 0x03 ; 3 2167e: 0e 94 48 7c call 0xf890 ; 0xf890 21682: ab cf rjmp .-170 ; 0x215da } } 21684: ff 90 pop r15 21686: ef 90 pop r14 21688: df 90 pop r13 2168a: cf 90 pop r12 2168c: 08 95 ret 0002168e : * * This function is blocking. * @param msg message to be displayed from PROGMEM */ void lcd_show_fullscreen_message_and_wait_P(const char *msg) { 2168e: cf 92 push r12 21690: df 92 push r13 21692: ef 92 push r14 21694: ff 92 push r15 21696: 0f 93 push r16 21698: 1f 93 push r17 2169a: cf 93 push r28 2169c: df 93 push r29 2169e: d8 2e mov r13, r24 216a0: c9 2e mov r12, r25 //! Do not call lcd_update_enable() to prevent calling lcd_update() in sensitive code. //! in certain scenarios it will cause recursion e.g. in the menus. class LcdUpdateDisabler { public: LcdUpdateDisabler(): m_updateEnabled(lcd_update_enabled) 216a2: 01 e0 ldi r16, 0x01 ; 1 216a4: 80 91 5c 02 lds r24, 0x025C ; 0x80025c 216a8: 81 11 cpse r24, r1 216aa: 01 c0 rjmp .+2 ; 0x216ae 216ac: 00 e0 ldi r16, 0x00 ; 0 { lcd_update_enabled = false; 216ae: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c LcdUpdateDisabler lcdUpdateDisabler; const char *msg_next = lcd_display_message_fullscreen_P(msg); 216b2: 8d 2d mov r24, r13 216b4: 9c 2d mov r25, r12 216b6: 0f 94 c0 0a call 0x21580 ; 0x21580 216ba: 7c 01 movw r14, r24 bool multi_screen = msg_next != NULL; lcd_consume_click(); 216bc: 0e 94 93 6b call 0xd726 ; 0xd726 KEEPALIVE_STATE(PAUSED_FOR_USER); 216c0: 84 e0 ldi r24, 0x04 ; 4 216c2: 80 93 78 02 sts 0x0278, r24 ; 0x800278 * @param msg message to be displayed from PROGMEM */ void lcd_show_fullscreen_message_and_wait_P(const char *msg) { LcdUpdateDisabler lcdUpdateDisabler; const char *msg_next = lcd_display_message_fullscreen_P(msg); 216c6: e7 01 movw r28, r14 bool multi_screen = msg_next != NULL; lcd_consume_click(); KEEPALIVE_STATE(PAUSED_FOR_USER); // Until confirmed by a button click. for (;;) { if (msg_next == NULL) { 216c8: 20 97 sbiw r28, 0x00 ; 0 216ca: 29 f4 brne .+10 ; 0x216d6 // Display the confirm char. lcd_putc_at(19, 3, LCD_STR_CONFIRM[0]); 216cc: 49 e8 ldi r20, 0x89 ; 137 216ce: 63 e0 ldi r22, 0x03 ; 3 216d0: 83 e1 ldi r24, 0x13 ; 19 216d2: 0e 94 9b 69 call 0xd336 ; 0xd336 * @param msg message to be displayed from PROGMEM */ void lcd_show_fullscreen_message_and_wait_P(const char *msg) { LcdUpdateDisabler lcdUpdateDisabler; const char *msg_next = lcd_display_message_fullscreen_P(msg); 216d6: 14 e6 ldi r17, 0x64 ; 100 // Display the confirm char. lcd_putc_at(19, 3, LCD_STR_CONFIRM[0]); } // Wait for 5 seconds before displaying the next text. for (uint8_t i = 0; i < 100; ++ i) { delay_keep_alive(50); 216d8: 82 e3 ldi r24, 0x32 ; 50 216da: 90 e0 ldi r25, 0x00 ; 0 216dc: 0e 94 48 7c call 0xf890 ; 0xf890 if (lcd_clicked()) { 216e0: 0e 94 98 6b call 0xd730 ; 0xd730 216e4: 88 23 and r24, r24 216e6: 81 f0 breq .+32 ; 0x21708 if (msg_next == NULL) { 216e8: 20 97 sbiw r28, 0x00 ; 0 216ea: 81 f4 brne .+32 ; 0x2170c KEEPALIVE_STATE(IN_HANDLER); 216ec: 82 e0 ldi r24, 0x02 ; 2 216ee: 80 93 78 02 sts 0x0278, r24 ; 0x800278 } ~LcdUpdateDisabler() { lcd_update_enabled = m_updateEnabled; 216f2: 00 93 5c 02 sts 0x025C, r16 ; 0x80025c if (msg_next == NULL) msg_next = msg; msg_next = lcd_display_message_fullscreen_P(msg_next); } } } 216f6: df 91 pop r29 216f8: cf 91 pop r28 216fa: 1f 91 pop r17 216fc: 0f 91 pop r16 216fe: ff 90 pop r15 21700: ef 90 pop r14 21702: df 90 pop r13 21704: cf 90 pop r12 21706: 08 95 ret 21708: 11 50 subi r17, 0x01 ; 1 if (msg_next == NULL) { // Display the confirm char. lcd_putc_at(19, 3, LCD_STR_CONFIRM[0]); } // Wait for 5 seconds before displaying the next text. for (uint8_t i = 0; i < 100; ++ i) { 2170a: 31 f7 brne .-52 ; 0x216d8 else { break; } } } if (multi_screen) { 2170c: e1 14 cp r14, r1 2170e: f1 04 cpc r15, r1 21710: d9 f2 breq .-74 ; 0x216c8 if (msg_next == NULL) 21712: 20 97 sbiw r28, 0x00 ; 0 21714: 11 f4 brne .+4 ; 0x2171a msg_next = msg; 21716: cd 2d mov r28, r13 21718: dc 2d mov r29, r12 msg_next = lcd_display_message_fullscreen_P(msg_next); 2171a: ce 01 movw r24, r28 2171c: 0f 94 c0 0a call 0x21580 ; 0x21580 21720: ec 01 movw r28, r24 21722: d2 cf rjmp .-92 ; 0x216c8 00021724 : // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); } static void wizard_lay1cal_message(bool cold) { 21724: cf 93 push r28 21726: c8 2f mov r28, r24 lcd_show_fullscreen_message_and_wait_P( 21728: 87 e3 ldi r24, 0x37 ; 55 2172a: 90 e5 ldi r25, 0x50 ; 80 2172c: 0e 94 b1 6c call 0xd962 ; 0xd962 21730: 0f 94 47 0b call 0x2168e ; 0x2168e _T(MSG_WIZARD_V2_CAL)); if (MMU2::mmu2.Enabled()) 21734: 80 91 94 12 lds r24, 0x1294 ; 0x801294 21738: 81 30 cpi r24, 0x01 ; 1 2173a: 69 f4 brne .+26 ; 0x21756 { lcd_show_fullscreen_message_and_wait_P( 2173c: 8e ed ldi r24, 0xDE ; 222 2173e: 9f e4 ldi r25, 0x4F ; 79 _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) { lcd_show_fullscreen_message_and_wait_P( 21740: 0e 94 b1 6c call 0xd962 ; 0xd962 21744: 0f 94 47 0b call 0x2168e ; 0x2168e _T(MSG_SELECT_TEMP_MATCHES_MATERIAL)); } lcd_show_fullscreen_message_and_wait_P( 21748: 8c e0 ldi r24, 0x0C ; 12 2174a: 9f e4 ldi r25, 0x4F ; 79 2174c: 0e 94 b1 6c call 0xd962 ; 0xd962 _T(MSG_WIZARD_V2_CAL_2)); } 21750: cf 91 pop r28 else if (cold) { lcd_show_fullscreen_message_and_wait_P( _T(MSG_SELECT_TEMP_MATCHES_MATERIAL)); } lcd_show_fullscreen_message_and_wait_P( 21752: 0d 94 47 0b jmp 0x2168e ; 0x2168e if (MMU2::mmu2.Enabled()) { lcd_show_fullscreen_message_and_wait_P( _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) 21756: cc 23 and r28, r28 21758: b9 f3 breq .-18 ; 0x21748 { lcd_show_fullscreen_message_and_wait_P( 2175a: 8c ea ldi r24, 0xAC ; 172 2175c: 9f e4 ldi r25, 0x4F ; 79 2175e: f0 cf rjmp .-32 ; 0x21740 00021760 : } } static void lcd_wizard_load() { if (MMU2::mmu2.Enabled()) { 21760: 80 91 94 12 lds r24, 0x1294 ; 0x801294 21764: 81 30 cpi r24, 0x01 ; 1 21766: 71 f4 brne .+28 ; 0x21784 lcd_show_fullscreen_message_and_wait_P( 21768: 83 eb ldi r24, 0xB3 ; 179 2176a: 9e e4 ldi r25, 0x4E ; 78 2176c: 0e 94 b1 6c call 0xd962 ; 0xd962 21770: 0f 94 47 0b call 0x2168e ; 0x2168e _T(MSG_MMU_INSERT_FILAMENT_FIRST_TUBE)); // NOTE: a full screen message showing which filament is being inserted // is performed by M701. For this reason MSG_LOADING_FILAMENT is not // used here when a MMU is used. eFilamentAction = FilamentAction::MmuLoad; 21774: 84 e0 ldi r24, 0x04 ; 4 lcd_show_fullscreen_message_and_wait_P( _T(MSG_WIZARD_LOAD_FILAMENT)); lcd_update_enable(false); lcd_clear(); lcd_puts_at_P(0, 2, _T(MSG_LOADING_FILAMENT)); eFilamentAction = FilamentAction::Load; 21776: 80 93 62 03 sts 0x0362, r24 ; 0x800362 } // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); 2177a: 61 e0 ldi r22, 0x01 ; 1 2177c: 80 e2 ldi r24, 0x20 ; 32 2177e: 98 e9 ldi r25, 0x98 ; 152 21780: 0c 94 af 7c jmp 0xf95e ; 0xf95e // NOTE: a full screen message showing which filament is being inserted // is performed by M701. For this reason MSG_LOADING_FILAMENT is not // used here when a MMU is used. eFilamentAction = FilamentAction::MmuLoad; } else { lcd_show_fullscreen_message_and_wait_P( 21784: 87 e6 ldi r24, 0x67 ; 103 21786: 9e e4 ldi r25, 0x4E ; 78 21788: 0e 94 b1 6c call 0xd962 ; 0xd962 2178c: 0f 94 47 0b call 0x2168e ; 0x2168e _T(MSG_WIZARD_LOAD_FILAMENT)); lcd_update_enable(false); 21790: 80 e0 ldi r24, 0x00 ; 0 21792: 0e 94 c0 69 call 0xd380 ; 0xd380 lcd_clear(); 21796: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_puts_at_P(0, 2, _T(MSG_LOADING_FILAMENT)); 2179a: 82 e0 ldi r24, 0x02 ; 2 2179c: 9a e5 ldi r25, 0x5A ; 90 2179e: 0e 94 b1 6c call 0xd962 ; 0xd962 217a2: ac 01 movw r20, r24 217a4: 62 e0 ldi r22, 0x02 ; 2 217a6: 80 e0 ldi r24, 0x00 ; 0 217a8: 0e 94 8f 69 call 0xd31e ; 0xd31e eFilamentAction = FilamentAction::Load; 217ac: 81 e0 ldi r24, 0x01 ; 1 217ae: e3 cf rjmp .-58 ; 0x21776 000217b0 : lcd_show_fullscreen_message_and_wait_P(msg); } } } void lcd_temp_cal_show_result(bool result) { 217b0: cf 93 push r28 217b2: c8 2f mov r28, r24 custom_message_type = CustomMsg::Status; 217b4: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 disable_x(); 217b8: 17 9a sbi 0x02, 7 ; 2 217ba: 10 92 a3 06 sts 0x06A3, r1 ; 0x8006a3 disable_y(); 217be: 16 9a sbi 0x02, 6 ; 2 217c0: 10 92 a4 06 sts 0x06A4, r1 ; 0x8006a4 disable_z(); disable_e0(); 217c4: 14 9a sbi 0x02, 4 ; 2 target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 217c6: 10 92 ee 11 sts 0x11EE, r1 ; 0x8011ee 217ca: 10 92 ed 11 sts 0x11ED, r1 ; 0x8011ed if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 217ce: 68 2f mov r22, r24 217d0: 86 ea ldi r24, 0xA6 ; 166 217d2: 9f e0 ldi r25, 0x0F ; 15 217d4: 0f 94 00 a0 call 0x34000 ; 0x34000 217d8: 6c 2f mov r22, r28 217da: 8f ea ldi r24, 0xAF ; 175 217dc: 9f e0 ldi r25, 0x0F ; 15 217de: 0f 94 00 a0 call 0x34000 ; 0x34000 // Store boolean result eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, result); eeprom_update_byte_notify((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, result); if (result) { 217e2: cc 23 and r28, r28 217e4: 89 f0 breq .+34 ; 0x21808 SERIAL_ECHOLNPGM("PINDA calibration done. Continue with pressing the knob."); 217e6: 84 eb ldi r24, 0xB4 ; 180 217e8: 97 e9 ldi r25, 0x97 ; 151 217ea: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CALIBRATION_DONE)); 217ee: 82 e1 ldi r24, 0x12 ; 18 217f0: 9d e4 ldi r25, 0x4D ; 77 } else { SERIAL_ECHOLNPGM("PINDA calibration failed. Continue with pressing the knob."); lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 217f2: 0e 94 b1 6c call 0xd962 ; 0xd962 217f6: 0f 94 47 0b call 0x2168e ; 0x2168e } lcd_update_enable(true); 217fa: 81 e0 ldi r24, 0x01 ; 1 217fc: 0e 94 c0 69 call 0xd380 ; 0xd380 lcd_update(2); 21800: 82 e0 ldi r24, 0x02 ; 2 } 21802: cf 91 pop r28 } else { SERIAL_ECHOLNPGM("PINDA calibration failed. Continue with pressing the knob."); lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); } lcd_update_enable(true); lcd_update(2); 21804: 0c 94 42 69 jmp 0xd284 ; 0xd284 if (result) { SERIAL_ECHOLNPGM("PINDA calibration done. Continue with pressing the knob."); lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CALIBRATION_DONE)); } else { SERIAL_ECHOLNPGM("PINDA calibration failed. Continue with pressing the knob."); 21808: 89 e7 ldi r24, 0x79 ; 121 2180a: 97 e9 ldi r25, 0x97 ; 151 2180c: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 21810: 87 ef ldi r24, 0xF7 ; 247 21812: 9c e4 ldi r25, 0x4C ; 76 21814: ee cf rjmp .-36 ; 0x217f2 00021816 : lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { 21816: 1f 93 push r17 21818: cf 93 push r28 2181a: df 93 push r29 for (uint_least8_t i = 0; i < LCD_WIDTH; i++) { lcd_putc_at(i, 3, '.'); //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); 2181c: 64 e6 ldi r22, 0x64 ; 100 2181e: 70 e0 ldi r23, 0x00 ; 0 21820: 0f 94 a5 a0 call 0x3414a ; 0x3414a <__udivmodhi4> 21824: eb 01 movw r28, r22 } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { for (uint_least8_t i = 0; i < LCD_WIDTH; i++) { 21826: 10 e0 ldi r17, 0x00 ; 0 lcd_putc_at(i, 3, '.'); 21828: 4e e2 ldi r20, 0x2E ; 46 2182a: 63 e0 ldi r22, 0x03 ; 3 2182c: 81 2f mov r24, r17 2182e: 0e 94 9b 69 call 0xd336 ; 0xd336 //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); 21832: ce 01 movw r24, r28 21834: 0e 94 48 7c call 0xf890 ; 0xf890 21838: ce 01 movw r24, r28 2183a: 0e 94 48 7c call 0xf890 ; 0xf890 2183e: ce 01 movw r24, r28 21840: 0e 94 48 7c call 0xf890 ; 0xf890 21844: ce 01 movw r24, r28 21846: 0e 94 48 7c call 0xf890 ; 0xf890 2184a: ce 01 movw r24, r28 2184c: 0e 94 48 7c call 0xf890 ; 0xf890 } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { for (uint_least8_t i = 0; i < LCD_WIDTH; i++) { 21850: 1f 5f subi r17, 0xFF ; 255 21852: 14 31 cpi r17, 0x14 ; 20 21854: 49 f7 brne .-46 ; 0x21828 //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); } } } 21856: df 91 pop r29 21858: cf 91 pop r28 2185a: 1f 91 pop r17 2185c: 08 95 ret 0002185e : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 2185e: 10 92 62 03 sts 0x0362, r1 ; 0x800362 static void __attribute__((noinline)) clearFilamentAction() { // filament action has been cancelled or completed setFilamentAction(FilamentAction::None); } 21862: 08 95 ret 00021864 : bFilamentPreheatState = false; mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { 21864: cf 93 push r28 MENU_BEGIN(); 21866: 0f 94 bc 92 call 0x32578 ; 0x32578 2186a: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 2186e: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 21872: 84 30 cpi r24, 0x04 ; 4 21874: 08 f0 brcs .+2 ; 0x21878 21876: b1 c0 rjmp .+354 ; 0x219da 21878: 10 92 31 04 sts 0x0431, r1 ; 0x800431 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 2187c: 8f e5 ldi r24, 0x5F ; 95 2187e: 9f e0 ldi r25, 0x0F ; 15 21880: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 21884: 81 11 cpse r24, r1 21886: 0f c0 rjmp .+30 ; 0x218a6 { ON_MENU_LEAVE( 21888: 0f 94 3c 91 call 0x32278 ; 0x32278 2188c: 81 11 cpse r24, r1 2188e: 0f 94 2f 0c call 0x2185e ; 0x2185e clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(eFilamentAction == FilamentAction::Lay1Cal ? MSG_BACK : MSG_MAIN)); 21892: 80 91 62 03 lds r24, 0x0362 ; 0x800362 21896: 8a 30 cpi r24, 0x0A ; 10 21898: a9 f1 breq .+106 ; 0x21904 2189a: 88 ef ldi r24, 0xF8 ; 248 2189c: 9d e3 ldi r25, 0x3D ; 61 2189e: 0e 94 b1 6c call 0xd962 ; 0xd962 218a2: 0f 94 87 95 call 0x32b0e ; 0x32b0e } if (farm_mode) 218a6: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 218aa: 88 23 and r24, r24 218ac: 71 f1 breq .+92 ; 0x2190a { MENU_ITEM_FUNCTION_P(PSTR("farm - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FARM_PREHEAT_HPB_TEMP)), mFilamentItem_farm); 218ae: 65 e1 ldi r22, 0x15 ; 21 218b0: 77 e3 ldi r23, 0x37 ; 55 218b2: 86 e2 ldi r24, 0x26 ; 38 218b4: 97 e9 ldi r25, 0x97 ; 151 218b6: 0f 94 39 92 call 0x32472 ; 0x32472 MENU_ITEM_FUNCTION_P(PSTR("nozzle - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/0"), mFilamentItem_farm_nozzle); 218ba: 65 e5 ldi r22, 0x55 ; 85 218bc: 77 e3 ldi r23, 0x37 ; 55 218be: 86 e1 ldi r24, 0x16 ; 22 218c0: 97 e9 ldi r25, 0x97 ; 151 218c2: 0f 94 39 92 call 0x32472 ; 0x32472 MENU_ITEM_SUBMENU_P(bPreheatOnlyNozzle ? PSTR("ABS - " STRINGIFY(ABS_PREHEAT_HOTEND_TEMP)) : PSTR("ABS - " STRINGIFY(ABS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(ABS_PREHEAT_HPB_TEMP)) , mFilamentItem_ABS); MENU_ITEM_SUBMENU_P(bPreheatOnlyNozzle ? PSTR("HIPS - " STRINGIFY(HIPS_PREHEAT_HOTEND_TEMP)): PSTR("HIPS - " STRINGIFY(HIPS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(HIPS_PREHEAT_HPB_TEMP)), mFilamentItem_HIPS); MENU_ITEM_SUBMENU_P(bPreheatOnlyNozzle ? PSTR("PP - " STRINGIFY(PP_PREHEAT_HOTEND_TEMP)) : PSTR("PP - " STRINGIFY(PP_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PP_PREHEAT_HPB_TEMP)) , mFilamentItem_PP); MENU_ITEM_SUBMENU_P(bPreheatOnlyNozzle ? PSTR("FLEX - " STRINGIFY(FLEX_PREHEAT_HOTEND_TEMP)): PSTR("FLEX - " STRINGIFY(FLEX_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FLEX_PREHEAT_HPB_TEMP)), mFilamentItem_FLEX); } if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) && eFilamentAction == FilamentAction::Preheat) MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown); 218c6: 8f e5 ldi r24, 0x5F ; 95 218c8: 9f e0 ldi r25, 0x0F ; 15 218ca: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 218ce: 81 11 cpse r24, r1 218d0: 0c c0 rjmp .+24 ; 0x218ea 218d2: 80 91 62 03 lds r24, 0x0362 ; 0x800362 218d6: 89 30 cpi r24, 0x09 ; 9 218d8: 41 f4 brne .+16 ; 0x218ea 218da: 84 e5 ldi r24, 0x54 ; 84 218dc: 9a e4 ldi r25, 0x4A ; 74 218de: 0e 94 b1 6c call 0xd962 ; 0xd962 218e2: 65 e2 ldi r22, 0x25 ; 37 218e4: 78 e3 ldi r23, 0x38 ; 56 218e6: 0f 94 39 92 call 0x32472 ; 0x32472 MENU_END(); 218ea: 0f 94 90 92 call 0x32520 ; 0x32520 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { MENU_BEGIN(); 218ee: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 218f2: 8f 5f subi r24, 0xFF ; 255 218f4: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 218f8: 80 91 30 04 lds r24, 0x0430 ; 0x800430 218fc: 8f 5f subi r24, 0xFF ; 255 218fe: 80 93 30 04 sts 0x0430, r24 ; 0x800430 21902: b5 cf rjmp .-150 ; 0x2186e if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { ON_MENU_LEAVE( clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(eFilamentAction == FilamentAction::Lay1Cal ? MSG_BACK : MSG_MAIN)); 21904: 84 e1 ldi r24, 0x14 ; 20 21906: 90 e4 ldi r25, 0x40 ; 64 21908: ca cf rjmp .-108 ; 0x2189e MENU_ITEM_FUNCTION_P(PSTR("farm - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FARM_PREHEAT_HPB_TEMP)), mFilamentItem_farm); MENU_ITEM_FUNCTION_P(PSTR("nozzle - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/0"), mFilamentItem_farm_nozzle); } else { bool bPreheatOnlyNozzle = shouldPreheatOnlyNozzle(); 2190a: 0e 94 e3 fd call 0x1fbc6 ; 0x1fbc6 2190e: c8 2f mov r28, r24 MENU_ITEM_SUBMENU_P(bPreheatOnlyNozzle ? PSTR("PLA - " STRINGIFY(PLA_PREHEAT_HOTEND_TEMP)) : PSTR("PLA - " STRINGIFY(PLA_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PLA_PREHEAT_HPB_TEMP)) , mFilamentItem_PLA); 21910: 8b ef ldi r24, 0xFB ; 251 21912: 96 e9 ldi r25, 0x96 ; 150 21914: cc 23 and r28, r28 21916: 11 f0 breq .+4 ; 0x2191c 21918: 8a e0 ldi r24, 0x0A ; 10 2191a: 97 e9 ldi r25, 0x97 ; 151 2191c: 6f ed ldi r22, 0xDF ; 223 2191e: 76 e3 ldi r23, 0x36 ; 54 21920: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(bPreheatOnlyNozzle ? PSTR("PET - " STRINGIFY(PET_PREHEAT_HOTEND_TEMP)) : PSTR("PET - " STRINGIFY(PET_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PET_PREHEAT_HPB_TEMP)) , mFilamentItem_PET); 21924: 80 ee ldi r24, 0xE0 ; 224 21926: 96 e9 ldi r25, 0x96 ; 150 21928: cc 23 and r28, r28 2192a: 11 f0 breq .+4 ; 0x21930 2192c: 8f ee ldi r24, 0xEF ; 239 2192e: 96 e9 ldi r25, 0x96 ; 150 21930: 6b ee ldi r22, 0xEB ; 235 21932: 77 e3 ldi r23, 0x37 ; 55 21934: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(bPreheatOnlyNozzle ? PSTR("ASA - " STRINGIFY(ASA_PREHEAT_HOTEND_TEMP)) : PSTR("ASA - " STRINGIFY(ASA_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(ASA_PREHEAT_HPB_TEMP)) , mFilamentItem_ASA); 21938: 84 ec ldi r24, 0xC4 ; 196 2193a: 96 e9 ldi r25, 0x96 ; 150 2193c: cc 23 and r28, r28 2193e: 11 f0 breq .+4 ; 0x21944 21940: 84 ed ldi r24, 0xD4 ; 212 21942: 96 e9 ldi r25, 0x96 ; 150 21944: 6f ed ldi r22, 0xDF ; 223 21946: 77 e3 ldi r23, 0x37 ; 55 21948: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(bPreheatOnlyNozzle ? PSTR("PC - " STRINGIFY(PC_PREHEAT_HOTEND_TEMP)) : PSTR("PC - " STRINGIFY(PC_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PC_PREHEAT_HPB_TEMP)) , mFilamentItem_PC); 2194c: 88 ea ldi r24, 0xA8 ; 168 2194e: 96 e9 ldi r25, 0x96 ; 150 21950: cc 23 and r28, r28 21952: 11 f0 breq .+4 ; 0x21958 21954: 88 eb ldi r24, 0xB8 ; 184 21956: 96 e9 ldi r25, 0x96 ; 150 21958: 6f e8 ldi r22, 0x8F ; 143 2195a: 77 e3 ldi r23, 0x37 ; 55 2195c: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(bPreheatOnlyNozzle ? PSTR("PVB - " STRINGIFY(PVB_PREHEAT_HOTEND_TEMP)) : PSTR("PVB - " STRINGIFY(PVB_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PVB_PREHEAT_HPB_TEMP)) , mFilamentItem_PVB); 21960: 8d e8 ldi r24, 0x8D ; 141 21962: 96 e9 ldi r25, 0x96 ; 150 21964: cc 23 and r28, r28 21966: 11 f0 breq .+4 ; 0x2196c 21968: 8c e9 ldi r24, 0x9C ; 156 2196a: 96 e9 ldi r25, 0x96 ; 150 2196c: 63 e3 ldi r22, 0x33 ; 51 2196e: 78 e3 ldi r23, 0x38 ; 56 21970: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(bPreheatOnlyNozzle ? PSTR("PA - " STRINGIFY(PA_PREHEAT_HOTEND_TEMP)) : PSTR("PA - " STRINGIFY(PA_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PA_PREHEAT_HPB_TEMP)) , mFilamentItem_PA); 21974: 82 e7 ldi r24, 0x72 ; 114 21976: 96 e9 ldi r25, 0x96 ; 150 21978: cc 23 and r28, r28 2197a: 11 f0 breq .+4 ; 0x21980 2197c: 81 e8 ldi r24, 0x81 ; 129 2197e: 96 e9 ldi r25, 0x96 ; 150 21980: 69 e7 ldi r22, 0x79 ; 121 21982: 78 e3 ldi r23, 0x38 ; 56 21984: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(bPreheatOnlyNozzle ? PSTR("ABS - " STRINGIFY(ABS_PREHEAT_HOTEND_TEMP)) : PSTR("ABS - " STRINGIFY(ABS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(ABS_PREHEAT_HPB_TEMP)) , mFilamentItem_ABS); 21988: 86 e5 ldi r24, 0x56 ; 86 2198a: 96 e9 ldi r25, 0x96 ; 150 2198c: cc 23 and r28, r28 2198e: 11 f0 breq .+4 ; 0x21994 21990: 86 e6 ldi r24, 0x66 ; 102 21992: 96 e9 ldi r25, 0x96 ; 150 21994: 65 ee ldi r22, 0xE5 ; 229 21996: 76 e3 ldi r23, 0x36 ; 54 21998: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(bPreheatOnlyNozzle ? PSTR("HIPS - " STRINGIFY(HIPS_PREHEAT_HOTEND_TEMP)): PSTR("HIPS - " STRINGIFY(HIPS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(HIPS_PREHEAT_HPB_TEMP)), mFilamentItem_HIPS); 2199c: 8a e3 ldi r24, 0x3A ; 58 2199e: 96 e9 ldi r25, 0x96 ; 150 219a0: cc 23 and r28, r28 219a2: 11 f0 breq .+4 ; 0x219a8 219a4: 8a e4 ldi r24, 0x4A ; 74 219a6: 96 e9 ldi r25, 0x96 ; 150 219a8: 6d e9 ldi r22, 0x9D ; 157 219aa: 77 e3 ldi r23, 0x37 ; 55 219ac: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(bPreheatOnlyNozzle ? PSTR("PP - " STRINGIFY(PP_PREHEAT_HOTEND_TEMP)) : PSTR("PP - " STRINGIFY(PP_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PP_PREHEAT_HPB_TEMP)) , mFilamentItem_PP); 219b0: 8e e1 ldi r24, 0x1E ; 30 219b2: 96 e9 ldi r25, 0x96 ; 150 219b4: cc 23 and r28, r28 219b6: 11 f0 breq .+4 ; 0x219bc 219b8: 8e e2 ldi r24, 0x2E ; 46 219ba: 96 e9 ldi r25, 0x96 ; 150 219bc: 61 e6 ldi r22, 0x61 ; 97 219be: 77 e3 ldi r23, 0x37 ; 55 219c0: 0f 94 ea 94 call 0x329d4 ; 0x329d4 MENU_ITEM_SUBMENU_P(bPreheatOnlyNozzle ? PSTR("FLEX - " STRINGIFY(FLEX_PREHEAT_HOTEND_TEMP)): PSTR("FLEX - " STRINGIFY(FLEX_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FLEX_PREHEAT_HPB_TEMP)), mFilamentItem_FLEX); 219c4: 83 e0 ldi r24, 0x03 ; 3 219c6: 96 e9 ldi r25, 0x96 ; 150 219c8: cc 23 and r28, r28 219ca: 11 f0 breq .+4 ; 0x219d0 219cc: 82 e1 ldi r24, 0x12 ; 18 219ce: 96 e9 ldi r25, 0x96 ; 150 219d0: 63 ed ldi r22, 0xD3 ; 211 219d2: 77 e3 ldi r23, 0x37 ; 55 219d4: 0f 94 ea 94 call 0x329d4 ; 0x329d4 219d8: 76 cf rjmp .-276 ; 0x218c6 } if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) && eFilamentAction == FilamentAction::Preheat) MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown); MENU_END(); } 219da: cf 91 pop r28 219dc: 08 95 ret 000219de : #endif //RESUME_DEBUG //! @brief Show Preheat Menu static void lcd_preheat_menu() { eFilamentAction = FilamentAction::Preheat; 219de: 89 e0 ldi r24, 0x09 ; 9 219e0: 80 93 62 03 sts 0x0362, r24 ; 0x800362 lcd_generic_preheat_menu(); 219e4: 0d 94 32 0c jmp 0x21864 ; 0x21864 000219e8 : // Filament [nr1.] was loaded, but [nr2.] is currently being loaded via tool change // Scenario 6: "?>?" // This scenario should not be possible and indicates a bug in the firmware uint8_t lcdui_print_extruder(void) { uint8_t chars = 1; lcd_space(1); 219e8: 81 e0 ldi r24, 0x01 ; 1 219ea: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 if (MMU2::mmu2.get_current_tool() == MMU2::mmu2.get_tool_change_tool()) { 219ee: 0f 94 92 41 call 0x28324 ; 0x28324 uint8_t __attribute__((noinline)) MMU2::get_current_tool() const { return extruder == MMU2_NO_TOOL ? (uint8_t)FILAMENT_UNKNOWN : extruder; } uint8_t MMU2::get_tool_change_tool() const { return tool_change_extruder == MMU2_NO_TOOL ? (uint8_t)FILAMENT_UNKNOWN : tool_change_extruder; 219f2: 90 91 7c 12 lds r25, 0x127C ; 0x80127c 219f6: 93 36 cpi r25, 0x63 ; 99 219f8: 09 f4 brne .+2 ; 0x219fc 219fa: 9f ef ldi r25, 0xFF ; 255 219fc: 89 13 cpse r24, r25 219fe: 0e c0 rjmp .+28 ; 0x21a1c lcd_putc('F'); 21a00: 86 e4 ldi r24, 0x46 ; 70 21a02: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 21a06: 0f 94 92 41 call 0x28324 ; 0x28324 21a0a: 8f 3f cpi r24, 0xFF ; 255 21a0c: 29 f0 breq .+10 ; 0x21a18 21a0e: 8f 5c subi r24, 0xCF ; 207 21a10: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 21a14: 83 e0 ldi r24, 0x03 ; 3 21a16: 08 95 ret 21a18: 8f e3 ldi r24, 0x3F ; 63 21a1a: fa cf rjmp .-12 ; 0x21a10 chars += 2; } else { lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 21a1c: 8f 3f cpi r24, 0xFF ; 255 21a1e: 89 f0 breq .+34 ; 0x21a42 21a20: 8f 5c subi r24, 0xCF ; 207 21a22: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 lcd_putc('>'); 21a26: 8e e3 ldi r24, 0x3E ; 62 21a28: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 21a2c: 80 91 7c 12 lds r24, 0x127C ; 0x80127c 21a30: 83 36 cpi r24, 0x63 ; 99 21a32: 49 f0 breq .+18 ; 0x21a46 lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 21a34: 8f 3f cpi r24, 0xFF ; 255 21a36: 39 f0 breq .+14 ; 0x21a46 21a38: 8f 5c subi r24, 0xCF ; 207 21a3a: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 chars += 3; 21a3e: 84 e0 ldi r24, 0x04 ; 4 } return chars; } 21a40: 08 95 ret if (MMU2::mmu2.get_current_tool() == MMU2::mmu2.get_tool_change_tool()) { lcd_putc('F'); lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); chars += 2; } else { lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 21a42: 8f e3 ldi r24, 0x3F ; 63 21a44: ee cf rjmp .-36 ; 0x21a22 lcd_putc('>'); lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 21a46: 8f e3 ldi r24, 0x3F ; 63 21a48: f8 cf rjmp .-16 ; 0x21a3a 00021a4a <__vector_51>: UCSR2B |= (1 << RXCIE2); // enable rx interrupt fdev_setup_stream(uart2io, uart2_putchar, uart2_getchar, _FDEV_SETUP_WRITE | _FDEV_SETUP_READ); //setup uart2 i/o stream } ISR(USART2_RX_vect) { 21a4a: 1f 92 push r1 21a4c: 0f 92 push r0 21a4e: 0f b6 in r0, 0x3f ; 63 21a50: 0f 92 push r0 21a52: 11 24 eor r1, r1 21a54: 0b b6 in r0, 0x3b ; 59 21a56: 0f 92 push r0 21a58: 2f 93 push r18 21a5a: 3f 93 push r19 21a5c: 4f 93 push r20 21a5e: 5f 93 push r21 21a60: 6f 93 push r22 21a62: 7f 93 push r23 21a64: 8f 93 push r24 21a66: 9f 93 push r25 21a68: af 93 push r26 21a6a: bf 93 push r27 21a6c: ef 93 push r30 21a6e: ff 93 push r31 if (rbuf_put(uart2_ibuf, UDR2) < 0) // put received byte to buffer 21a70: 20 91 d6 00 lds r18, 0x00D6 ; 0x8000d6 <__TEXT_REGION_LENGTH__+0x7c20d6> //put single byte to buffer int rbuf_put(uint8_t* ptr, uint8_t b) { //#ifdef _NO_ASM _lock(); //lock uint8_t buf_w = ptr[1]; //get write index 21a74: 80 91 b0 0d lds r24, 0x0DB0 ; 0x800db0 uint8_t buf_r = ptr[2]; //get read index 21a78: 90 91 b1 0d lds r25, 0x0DB1 ; 0x800db1 _unlock(); //unlock ptr[4 + buf_w] = b; //store byte to buffer 21a7c: e8 2f mov r30, r24 21a7e: f0 e0 ldi r31, 0x00 ; 0 21a80: ed 54 subi r30, 0x4D ; 77 21a82: f2 4f sbci r31, 0xF2 ; 242 21a84: 20 83 st Z, r18 buf_w++; //incerment write index 21a86: 8f 5f subi r24, 0xFF ; 255 uint8_t buf_l = ptr[0]; //get length if (buf_w >= buf_l) buf_w = 0; //rotate write index 21a88: 20 91 af 0d lds r18, 0x0DAF ; 0x800daf 21a8c: 82 17 cp r24, r18 21a8e: 08 f0 brcs .+2 ; 0x21a92 <__vector_51+0x48> 21a90: 80 e0 ldi r24, 0x00 ; 0 if (buf_w == buf_r) return -1; //return -1 to signal buffer full 21a92: 98 13 cpse r25, r24 21a94: 17 c0 rjmp .+46 ; 0x21ac4 <__vector_51+0x7a> { //rx buffer full puts_P(PSTR("USART2 rx Full!!!")); 21a96: 85 e9 ldi r24, 0x95 ; 149 21a98: 94 e9 ldi r25, 0x94 ; 148 21a9a: 0f 94 c5 9e call 0x33d8a ; 0x33d8a } } 21a9e: ff 91 pop r31 21aa0: ef 91 pop r30 21aa2: bf 91 pop r27 21aa4: af 91 pop r26 21aa6: 9f 91 pop r25 21aa8: 8f 91 pop r24 21aaa: 7f 91 pop r23 21aac: 6f 91 pop r22 21aae: 5f 91 pop r21 21ab0: 4f 91 pop r20 21ab2: 3f 91 pop r19 21ab4: 2f 91 pop r18 21ab6: 0f 90 pop r0 21ab8: 0b be out 0x3b, r0 ; 59 21aba: 0f 90 pop r0 21abc: 0f be out 0x3f, r0 ; 63 21abe: 0f 90 pop r0 21ac0: 1f 90 pop r1 21ac2: 18 95 reti ptr[1] = buf_w; //store write index 21ac4: 80 93 b0 0d sts 0x0DB0, r24 ; 0x800db0 21ac8: ea cf rjmp .-44 ; 0x21a9e <__vector_51+0x54> 00021aca <__vector_45>: { WRITE(BEEPER, 1); } ISR(TIMER4_OVF_vect) { 21aca: 1f 92 push r1 21acc: 0f 92 push r0 21ace: 0f b6 in r0, 0x3f ; 63 21ad0: 0f 92 push r0 21ad2: 11 24 eor r1, r1 WRITE(BEEPER, 0); 21ad4: 72 98 cbi 0x0e, 2 ; 14 } 21ad6: 0f 90 pop r0 21ad8: 0f be out 0x3f, r0 ; 63 21ada: 0f 90 pop r0 21adc: 1f 90 pop r1 21ade: 18 95 reti 00021ae0 <__vector_42>: #endif //EXTRUDER_0_AUTO_FAN_PIN // Because of the timer mode change, we need two interrupts. We could also try to assume that the frequency is x2 // and use a TOGGLE(), but this seems to work well enough so I left it as it is now. ISR(TIMER4_COMPA_vect) { 21ae0: 1f 92 push r1 21ae2: 0f 92 push r0 21ae4: 0f b6 in r0, 0x3f ; 63 21ae6: 0f 92 push r0 21ae8: 11 24 eor r1, r1 WRITE(BEEPER, 1); 21aea: 72 9a sbi 0x0e, 2 ; 14 } 21aec: 0f 90 pop r0 21aee: 0f be out 0x3f, r0 ; 63 21af0: 0f 90 pop r0 21af2: 1f 90 pop r1 21af4: 18 95 reti 00021af6 : void delay2(unsigned long ms) { 21af6: 8f 92 push r8 21af8: 9f 92 push r9 21afa: af 92 push r10 21afc: bf 92 push r11 21afe: cf 92 push r12 21b00: df 92 push r13 21b02: ef 92 push r14 21b04: ff 92 push r15 21b06: 6b 01 movw r12, r22 21b08: 7c 01 movw r14, r24 uint32_t start = micros2(); 21b0a: 0e 94 f2 f7 call 0x1efe4 ; 0x1efe4 21b0e: 4b 01 movw r8, r22 21b10: 5c 01 movw r10, r24 while (ms > 0) { yield(); while ( ms > 0 && (micros2() - start) >= 1000) 21b12: c1 14 cp r12, r1 21b14: d1 04 cpc r13, r1 21b16: e1 04 cpc r14, r1 21b18: f1 04 cpc r15, r1 21b1a: b9 f0 breq .+46 ; 0x21b4a 21b1c: 0e 94 f2 f7 call 0x1efe4 ; 0x1efe4 21b20: 68 19 sub r22, r8 21b22: 79 09 sbc r23, r9 21b24: 8a 09 sbc r24, r10 21b26: 9b 09 sbc r25, r11 21b28: 68 3e cpi r22, 0xE8 ; 232 21b2a: 73 40 sbci r23, 0x03 ; 3 21b2c: 81 05 cpc r24, r1 21b2e: 91 05 cpc r25, r1 21b30: 80 f3 brcs .-32 ; 0x21b12 { ms--; 21b32: 21 e0 ldi r18, 0x01 ; 1 21b34: c2 1a sub r12, r18 21b36: d1 08 sbc r13, r1 21b38: e1 08 sbc r14, r1 21b3a: f1 08 sbc r15, r1 start += 1000; 21b3c: 88 ee ldi r24, 0xE8 ; 232 21b3e: 88 0e add r8, r24 21b40: 83 e0 ldi r24, 0x03 ; 3 21b42: 98 1e adc r9, r24 21b44: a1 1c adc r10, r1 21b46: b1 1c adc r11, r1 21b48: e4 cf rjmp .-56 ; 0x21b12 } } } 21b4a: ff 90 pop r15 21b4c: ef 90 pop r14 21b4e: df 90 pop r13 21b50: cf 90 pop r12 21b52: bf 90 pop r11 21b54: af 90 pop r10 21b56: 9f 90 pop r9 21b58: 8f 90 pop r8 21b5a: 08 95 ret 00021b5c : * @param axis AxisEnum X_AXIS Y_AXIS Z_AXIS * other value leads to storing Z_AXIS * @param msg text to be displayed */ static void lcd_babystep_z() { 21b5c: ef 92 push r14 21b5e: ff 92 push r15 21b60: 0f 93 push r16 21b62: 1f 93 push r17 21b64: cf 93 push r28 21b66: df 93 push r29 21b68: cd b7 in r28, 0x3d ; 61 21b6a: de b7 in r29, 0x3e ; 62 21b6c: 63 97 sbiw r28, 0x13 ; 19 21b6e: 0f b6 in r0, 0x3f ; 63 21b70: f8 94 cli 21b72: de bf out 0x3e, r29 ; 62 21b74: 0f be out 0x3f, r0 ; 63 21b76: cd bf out 0x3d, r28 ; 61 int16_t babystepMemZ; float babystepMemMMZ; } _menu_data_t; static_assert(sizeof(menu_data)>= sizeof(_menu_data_t),"_menu_data_t doesn't fit into menu_data"); _menu_data_t* _md = (_menu_data_t*)&(menu_data[0]); if (_md->status == 0) 21b78: 80 91 64 03 lds r24, 0x0364 ; 0x800364 21b7c: 81 11 cpse r24, r1 21b7e: 3a c0 rjmp .+116 ; 0x21bf4 { // Menu was entered. // Initialize its status. _md->status = 1; 21b80: 81 e0 ldi r24, 0x01 ; 1 21b82: 80 93 64 03 sts 0x0364, r24 ; 0x800364 check_babystep(); 21b86: 0e 94 b2 72 call 0xe564 ; 0xe564 if(!eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))){ 21b8a: 81 ea ldi r24, 0xA1 ; 161 21b8c: 9d e0 ldi r25, 0x0D ; 13 21b8e: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 21b92: 18 2f mov r17, r24 21b94: 0e 94 18 6f call 0xde30 ; 0xde30 21b98: 81 11 cpse r24, r1 21b9a: ee c0 rjmp .+476 ; 0x21d78 _md->babystepMemZ = 0; 21b9c: 10 92 66 03 sts 0x0366, r1 ; 0x800366 21ba0: 10 92 65 03 sts 0x0365, r1 ; 0x800365 _md->babystepMemZ = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); } // same logic as in babystep_load if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 21ba4: 80 e1 ldi r24, 0x10 ; 16 21ba6: 0e 94 55 d8 call 0x1b0aa ; 0x1b0aa 21baa: 81 11 cpse r24, r1 21bac: 04 c0 rjmp .+8 ; 0x21bb6 _md->babystepMemZ = 0; 21bae: 10 92 66 03 sts 0x0366, r1 ; 0x800366 21bb2: 10 92 65 03 sts 0x0365, r1 ; 0x800365 _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_mm[Z_AXIS]; 21bb6: 60 91 65 03 lds r22, 0x0365 ; 0x800365 21bba: 70 91 66 03 lds r23, 0x0366 ; 0x800366 21bbe: 07 2e mov r0, r23 21bc0: 00 0c add r0, r0 21bc2: 88 0b sbc r24, r24 21bc4: 99 0b sbc r25, r25 21bc6: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 21bca: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 21bce: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 21bd2: 40 91 40 04 lds r20, 0x0440 ; 0x800440 21bd6: 50 91 41 04 lds r21, 0x0441 ; 0x800441 21bda: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 21bde: 60 93 67 03 sts 0x0367, r22 ; 0x800367 21be2: 70 93 68 03 sts 0x0368, r23 ; 0x800368 21be6: 80 93 69 03 sts 0x0369, r24 ; 0x800369 21bea: 90 93 6a 03 sts 0x036A, r25 ; 0x80036a lcd_draw_update = 1; 21bee: 81 e0 ldi r24, 0x01 ; 1 21bf0: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b //SERIAL_ECHO("Z baby step: "); //SERIAL_ECHO(_md->babystepMem[2]); } if (lcd_encoder != 0) 21bf4: 80 91 06 05 lds r24, 0x0506 ; 0x800506 21bf8: 90 91 07 05 lds r25, 0x0507 ; 0x800507 21bfc: 00 97 sbiw r24, 0x00 ; 0 21bfe: f1 f1 breq .+124 ; 0x21c7c { _md->babystepMemZ += lcd_encoder; 21c00: 20 91 65 03 lds r18, 0x0365 ; 0x800365 21c04: 30 91 66 03 lds r19, 0x0366 ; 0x800366 21c08: 28 0f add r18, r24 21c0a: 39 1f adc r19, r25 21c0c: 30 93 66 03 sts 0x0366, r19 ; 0x800366 21c10: 20 93 65 03 sts 0x0365, r18 ; 0x800365 if (_md->babystepMemZ < Z_BABYSTEP_MIN) _md->babystepMemZ = Z_BABYSTEP_MIN; //-3999 -> -9.99 mm 21c14: 21 36 cpi r18, 0x61 ; 97 21c16: 40 ef ldi r20, 0xF0 ; 240 21c18: 34 07 cpc r19, r20 21c1a: 0c f0 brlt .+2 ; 0x21c1e 21c1c: ba c0 rjmp .+372 ; 0x21d92 21c1e: 81 e6 ldi r24, 0x61 ; 97 21c20: 90 ef ldi r25, 0xF0 ; 240 21c22: 90 93 66 03 sts 0x0366, r25 ; 0x800366 21c26: 80 93 65 03 sts 0x0365, r24 ; 0x800365 else if (_md->babystepMemZ > Z_BABYSTEP_MAX) _md->babystepMemZ = Z_BABYSTEP_MAX; //0 else babystepsTodoZadd(lcd_encoder); _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_mm[Z_AXIS]; 21c2a: 60 91 65 03 lds r22, 0x0365 ; 0x800365 21c2e: 70 91 66 03 lds r23, 0x0366 ; 0x800366 21c32: 07 2e mov r0, r23 21c34: 00 0c add r0, r0 21c36: 88 0b sbc r24, r24 21c38: 99 0b sbc r25, r25 21c3a: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 21c3e: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 21c42: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 21c46: 40 91 40 04 lds r20, 0x0440 ; 0x800440 21c4a: 50 91 41 04 lds r21, 0x0441 ; 0x800441 21c4e: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 21c52: 60 93 67 03 sts 0x0367, r22 ; 0x800367 21c56: 70 93 68 03 sts 0x0368, r23 ; 0x800368 21c5a: 80 93 69 03 sts 0x0369, r24 ; 0x800369 21c5e: 90 93 6a 03 sts 0x036A, r25 ; 0x80036a _delay(50); 21c62: 62 e3 ldi r22, 0x32 ; 50 21c64: 70 e0 ldi r23, 0x00 ; 0 21c66: 80 e0 ldi r24, 0x00 ; 0 21c68: 90 e0 ldi r25, 0x00 ; 0 21c6a: 0f 94 7b 0d call 0x21af6 ; 0x21af6 lcd_encoder = 0; 21c6e: 10 92 07 05 sts 0x0507, r1 ; 0x800507 21c72: 10 92 06 05 sts 0x0506, r1 ; 0x800506 lcd_draw_update = 1; 21c76: 81 e0 ldi r24, 0x01 ; 1 21c78: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } if (lcd_draw_update) 21c7c: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 21c80: 88 23 and r24, r24 21c82: c9 f1 breq .+114 ; 0x21cf6 { SheetFormatBuffer buffer; menu_format_sheet_E(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))], buffer); 21c84: 81 ea ldi r24, 0xA1 ; 161 21c86: 9d e0 ldi r25, 0x0D ; 13 21c88: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 21c8c: 2b e0 ldi r18, 0x0B ; 11 21c8e: 82 9f mul r24, r18 21c90: c0 01 movw r24, r0 21c92: 11 24 eor r1, r1 21c94: be 01 movw r22, r28 21c96: 6f 5f subi r22, 0xFF ; 255 21c98: 7f 4f sbci r23, 0xFF ; 255 21c9a: 87 5b subi r24, 0xB7 ; 183 21c9c: 92 4f sbci r25, 0xF2 ; 242 21c9e: 0f 94 56 91 call 0x322ac ; 0x322ac lcd_home(); 21ca2: 0e 94 a7 69 call 0xd34e ; 0xd34e lcd_print(buffer.c); 21ca6: ce 01 movw r24, r28 21ca8: 01 96 adiw r24, 0x01 ; 1 21caa: 0e 94 82 6b call 0xd704 ; 0xd704 lcd_set_cursor(0, 1); 21cae: 61 e0 ldi r22, 0x01 ; 1 21cb0: 80 e0 ldi r24, 0x00 ; 0 21cb2: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 menu_draw_float13(_T(MSG_BABYSTEPPING_Z), _md->babystepMemMMZ); 21cb6: 10 91 67 03 lds r17, 0x0367 ; 0x800367 21cba: 00 91 68 03 lds r16, 0x0368 ; 0x800368 21cbe: f0 90 69 03 lds r15, 0x0369 ; 0x800369 21cc2: e0 90 6a 03 lds r14, 0x036A ; 0x80036a 21cc6: 85 ea ldi r24, 0xA5 ; 165 21cc8: 9b e4 ldi r25, 0x4B ; 75 21cca: 0e 94 b1 6c call 0xd962 ; 0xd962 //! (i.e. str must include a ':' at its end) //! FLASH usage dropped 234476B -> 234392B //! Moreover, this function gets inlined in the final code, so removing it doesn't really help ;) void menu_draw_float13(const char* str, float val) { lcd_printf_P(menu_fmt_float13, ' ', str, val); 21cce: ef 92 push r14 21cd0: ff 92 push r15 21cd2: 0f 93 push r16 21cd4: 1f 93 push r17 21cd6: 9f 93 push r25 21cd8: 8f 93 push r24 21cda: 1f 92 push r1 21cdc: 80 e2 ldi r24, 0x20 ; 32 21cde: 8f 93 push r24 21ce0: 84 e6 ldi r24, 0x64 ; 100 21ce2: 97 e9 ldi r25, 0x97 ; 151 21ce4: 9f 93 push r25 21ce6: 8f 93 push r24 21ce8: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 21cec: 0f b6 in r0, 0x3f ; 63 21cee: f8 94 cli 21cf0: de bf out 0x3e, r29 ; 62 21cf2: 0f be out 0x3f, r0 ; 63 21cf4: cd bf out 0x3d, r28 ; 61 } if (LCD_CLICKED || menu_leaving) 21cf6: 80 91 63 03 lds r24, 0x0363 ; 0x800363 21cfa: 81 11 cpse r24, r1 21cfc: 04 c0 rjmp .+8 ; 0x21d06 21cfe: 80 91 92 03 lds r24, 0x0392 ; 0x800392 21d02: 88 23 and r24, r24 21d04: 51 f1 breq .+84 ; 0x21d5a { // Only update the EEPROM when leaving the menu. uint8_t active_sheet=eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 21d06: 81 ea ldi r24, 0xA1 ; 161 21d08: 9d e0 ldi r25, 0x0D ; 13 21d0a: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 21d0e: 9b e0 ldi r25, 0x0B ; 11 21d10: 89 9f mul r24, r25 21d12: 80 01 movw r16, r0 21d14: 11 24 eor r1, r1 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 21d16: 60 91 65 03 lds r22, 0x0365 ; 0x800365 21d1a: 70 91 66 03 lds r23, 0x0366 ; 0x800366 21d1e: c8 01 movw r24, r16 21d20: 80 5b subi r24, 0xB0 ; 176 21d22: 92 4f sbci r25, 0xF2 ; 242 21d24: 0f 94 1e a0 call 0x3403c ; 0x3403c if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 21d28: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 21d2c: c8 01 movw r24, r16 21d2e: 8e 5a subi r24, 0xAE ; 174 21d30: 92 4f sbci r25, 0xF2 ; 242 21d32: 0f 94 00 a0 call 0x34000 ; 0x34000 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[active_sheet].z_offset)),_md->babystepMemZ); // NOTE: bed_temp and pinda_temp are not currently read/used anywhere. eeprom_update_byte_notify(&(EEPROM_Sheets_base->s[active_sheet].bed_temp),target_temperature_bed); #ifdef PINDA_THERMISTOR eeprom_update_byte_notify(&(EEPROM_Sheets_base->s[active_sheet].pinda_temp),current_temperature_pinda); 21d36: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 21d3a: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 21d3e: 80 91 90 06 lds r24, 0x0690 ; 0x800690 21d42: 90 91 91 06 lds r25, 0x0691 ; 0x800691 21d46: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 21d4a: c8 01 movw r24, r16 21d4c: 8d 5a subi r24, 0xAD ; 173 21d4e: 92 4f sbci r25, 0xF2 ; 242 21d50: 0f 94 00 a0 call 0x34000 ; 0x34000 #endif //PINDA_THERMISTOR calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 21d54: 80 e1 ldi r24, 0x10 ; 16 21d56: 0e 94 86 c6 call 0x18d0c ; 0x18d0c } menu_back_if_clicked(); 21d5a: 0f 94 26 96 call 0x32c4c ; 0x32c4c } 21d5e: 63 96 adiw r28, 0x13 ; 19 21d60: 0f b6 in r0, 0x3f ; 63 21d62: f8 94 cli 21d64: de bf out 0x3e, r29 ; 62 21d66: 0f be out 0x3f, r0 ; 63 21d68: cd bf out 0x3d, r28 ; 61 21d6a: df 91 pop r29 21d6c: cf 91 pop r28 21d6e: 1f 91 pop r17 21d70: 0f 91 pop r16 21d72: ff 90 pop r15 21d74: ef 90 pop r14 21d76: 08 95 ret if(!eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))){ _md->babystepMemZ = 0; } else{ _md->babystepMemZ = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> 21d78: 2b e0 ldi r18, 0x0B ; 11 21d7a: 12 9f mul r17, r18 21d7c: c0 01 movw r24, r0 21d7e: 11 24 eor r1, r1 21d80: 80 5b subi r24, 0xB0 ; 176 21d82: 92 4f sbci r25, 0xF2 ; 242 21d84: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 21d88: 90 93 66 03 sts 0x0366, r25 ; 0x800366 21d8c: 80 93 65 03 sts 0x0365, r24 ; 0x800365 21d90: 09 cf rjmp .-494 ; 0x21ba4 if (lcd_encoder != 0) { _md->babystepMemZ += lcd_encoder; if (_md->babystepMemZ < Z_BABYSTEP_MIN) _md->babystepMemZ = Z_BABYSTEP_MIN; //-3999 -> -9.99 mm else if (_md->babystepMemZ > Z_BABYSTEP_MAX) _md->babystepMemZ = Z_BABYSTEP_MAX; //0 21d92: 12 16 cp r1, r18 21d94: 13 06 cpc r1, r19 21d96: 2c f4 brge .+10 ; 0x21da2 21d98: 10 92 66 03 sts 0x0366, r1 ; 0x800366 21d9c: 10 92 65 03 sts 0x0365, r1 ; 0x800365 21da0: 44 cf rjmp .-376 ; 0x21c2a extern volatile int babystepsTodo[3]; inline void babystepsTodoZadd(int n) { if (n != 0) { CRITICAL_SECTION_START 21da2: 2f b7 in r18, 0x3f ; 63 21da4: f8 94 cli babystepsTodo[Z_AXIS] += n; 21da6: 40 91 8c 06 lds r20, 0x068C ; 0x80068c 21daa: 50 91 8d 06 lds r21, 0x068D ; 0x80068d 21dae: 84 0f add r24, r20 21db0: 95 1f adc r25, r21 21db2: 90 93 8d 06 sts 0x068D, r25 ; 0x80068d 21db6: 80 93 8c 06 sts 0x068C, r24 ; 0x80068c CRITICAL_SECTION_END 21dba: 2f bf out 0x3f, r18 ; 63 21dbc: 36 cf rjmp .-404 ; 0x21c2a 00021dbe : } void lcd_move_e() { if ((int)degHotend0() > extrude_min_temp) 21dbe: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 21dc2: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 21dc6: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 21dca: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 21dce: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 21dd2: 20 91 57 02 lds r18, 0x0257 ; 0x800257 21dd6: 30 91 58 02 lds r19, 0x0258 ; 0x800258 21dda: 26 17 cp r18, r22 21ddc: 37 07 cpc r19, r23 21dde: 0c f0 brlt .+2 ; 0x21de2 21de0: 65 c0 rjmp .+202 ; 0x21eac { if (lcd_encoder != 0) 21de2: 80 91 06 05 lds r24, 0x0506 ; 0x800506 21de6: 90 91 07 05 lds r25, 0x0507 ; 0x800507 21dea: 89 2b or r24, r25 21dec: b9 f1 breq .+110 ; 0x21e5c { refresh_cmd_timeout(); 21dee: 0e 94 c9 5f call 0xbf92 ; 0xbf92 FORCE_INLINE uint8_t moves_planned() { return (block_buffer_head + BLOCK_BUFFER_SIZE - block_buffer_tail) & (BLOCK_BUFFER_SIZE - 1); } FORCE_INLINE bool planner_queue_full() { uint8_t next_block_index = block_buffer_head; 21df2: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 if (++ next_block_index == BLOCK_BUFFER_SIZE) 21df6: 8f 5f subi r24, 0xFF ; 255 21df8: 80 31 cpi r24, 0x10 ; 16 21dfa: 09 f4 brne .+2 ; 0x21dfe next_block_index = 0; 21dfc: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 21dfe: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 if (! planner_queue_full()) 21e02: 98 17 cp r25, r24 21e04: 59 f1 breq .+86 ; 0x21e5c { current_position[E_AXIS] += lcd_encoder; 21e06: 60 91 06 05 lds r22, 0x0506 ; 0x800506 21e0a: 70 91 07 05 lds r23, 0x0507 ; 0x800507 21e0e: 07 2e mov r0, r23 21e10: 00 0c add r0, r0 21e12: 88 0b sbc r24, r24 21e14: 99 0b sbc r25, r25 21e16: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 21e1a: 9b 01 movw r18, r22 21e1c: ac 01 movw r20, r24 21e1e: 60 91 01 12 lds r22, 0x1201 ; 0x801201 21e22: 70 91 02 12 lds r23, 0x1202 ; 0x801202 21e26: 80 91 03 12 lds r24, 0x1203 ; 0x801203 21e2a: 90 91 04 12 lds r25, 0x1204 ; 0x801204 21e2e: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 21e32: 60 93 01 12 sts 0x1201, r22 ; 0x801201 21e36: 70 93 02 12 sts 0x1202, r23 ; 0x801202 21e3a: 80 93 03 12 sts 0x1203, r24 ; 0x801203 21e3e: 90 93 04 12 sts 0x1204, r25 ; 0x801204 lcd_encoder = 0; 21e42: 10 92 07 05 sts 0x0507, r1 ; 0x800507 21e46: 10 92 06 05 sts 0x0506, r1 ; 0x800506 plan_buffer_line_curposXYZE(manual_feedrate[E_AXIS] / 60); 21e4a: 65 e5 ldi r22, 0x55 ; 85 21e4c: 75 e5 ldi r23, 0x55 ; 85 21e4e: 85 ed ldi r24, 0xD5 ; 213 21e50: 9f e3 ldi r25, 0x3F ; 63 21e52: 0f 94 70 84 call 0x308e0 ; 0x308e0 lcd_draw_update = 1; 21e56: 81 e0 ldi r24, 0x01 ; 1 21e58: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } } if (lcd_draw_update) 21e5c: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 21e60: 88 23 and r24, r24 21e62: 11 f1 breq .+68 ; 0x21ea8 { lcd_set_cursor(0, 1); 21e64: 61 e0 ldi r22, 0x01 ; 1 21e66: 80 e0 ldi r24, 0x00 ; 0 21e68: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 //! The text needs to come with a colon ":", this function does not append it anymore. //! That resulted in a much shorter implementation (234628B -> 234476B) //! There are similar functions around which may be shortened in a similar way void menu_draw_float31(const char* str, float val) { lcd_printf_P(menu_fmt_float31, str, val); 21e6c: 80 91 04 12 lds r24, 0x1204 ; 0x801204 21e70: 8f 93 push r24 21e72: 80 91 03 12 lds r24, 0x1203 ; 0x801203 21e76: 8f 93 push r24 21e78: 80 91 02 12 lds r24, 0x1202 ; 0x801202 21e7c: 8f 93 push r24 21e7e: 80 91 01 12 lds r24, 0x1201 ; 0x801201 21e82: 8f 93 push r24 21e84: 86 e4 ldi r24, 0x46 ; 70 21e86: 97 e9 ldi r25, 0x97 ; 151 21e88: 9f 93 push r25 21e8a: 8f 93 push r24 21e8c: 87 e3 ldi r24, 0x37 ; 55 21e8e: 97 e9 ldi r25, 0x97 ; 151 21e90: 9f 93 push r25 21e92: 8f 93 push r24 21e94: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 21e98: 8d b7 in r24, 0x3d ; 61 21e9a: 9e b7 in r25, 0x3e ; 62 21e9c: 08 96 adiw r24, 0x08 ; 8 21e9e: 0f b6 in r0, 0x3f ; 63 21ea0: f8 94 cli 21ea2: 9e bf out 0x3e, r25 ; 62 21ea4: 0f be out 0x3f, r0 ; 63 21ea6: 8d bf out 0x3d, r24 ; 61 // Note: the colon behind the text is necessary to greatly shorten // the implementation of menu_draw_float31 menu_draw_float31(PSTR("Extruder:"), current_position[E_AXIS]); } menu_back_if_clicked(); 21ea8: 0d 94 26 96 jmp 0x32c4c ; 0x32c4c }; } void show_preheat_nozzle_warning() { lcd_clear(); 21eac: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_puts_at_P(0, 0, _T(MSG_ERROR)); 21eb0: 86 e3 ldi r24, 0x36 ; 54 21eb2: 9b e4 ldi r25, 0x4B ; 75 21eb4: 0e 94 b1 6c call 0xd962 ; 0xd962 21eb8: ac 01 movw r20, r24 21eba: 60 e0 ldi r22, 0x00 ; 0 21ebc: 80 e0 ldi r24, 0x00 ; 0 21ebe: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_puts_at_P(0, 2, _T(MSG_PREHEAT_NOZZLE)); 21ec2: 80 e2 ldi r24, 0x20 ; 32 21ec4: 9b e4 ldi r25, 0x4B ; 75 21ec6: 0e 94 b1 6c call 0xd962 ; 0xd962 21eca: ac 01 movw r20, r24 21ecc: 62 e0 ldi r22, 0x02 ; 2 21ece: 80 e0 ldi r24, 0x00 ; 0 21ed0: 0e 94 8f 69 call 0xd31e ; 0xd31e _delay(2000); 21ed4: 60 ed ldi r22, 0xD0 ; 208 21ed6: 77 e0 ldi r23, 0x07 ; 7 21ed8: 80 e0 ldi r24, 0x00 ; 0 21eda: 90 e0 ldi r25, 0x00 ; 0 21edc: 0f 94 7b 0d call 0x21af6 ; 0x21af6 lcd_clear(); 21ee0: 0e 94 ae 69 call 0xd35c ; 0xd35c menu_back_if_clicked(); } else { show_preheat_nozzle_warning(); lcd_return_to_status(); 21ee4: 0c 94 17 fe jmp 0x1fc2e ; 0x1fc2e 00021ee8 : } unsigned long millis2(void) { unsigned long m; uint8_t oldSREG = SREG; 21ee8: 2f b7 in r18, 0x3f ; 63 // disable interrupts while we read timer0_millis or we might get an // inconsistent value (e.g. in the middle of a write to timer0_millis) cli(); 21eea: f8 94 cli m = timer2_millis; 21eec: 60 91 65 06 lds r22, 0x0665 ; 0x800665 21ef0: 70 91 66 06 lds r23, 0x0666 ; 0x800666 21ef4: 80 91 67 06 lds r24, 0x0667 ; 0x800667 21ef8: 90 91 68 06 lds r25, 0x0668 ; 0x800668 SREG = oldSREG; 21efc: 2f bf out 0x3f, r18 ; 63 return m; } 21efe: 08 95 ret 00021f00 : //! //! @param z_move //! @param e_move void stop_and_save_print_to_ram(float z_move, float e_move) { if (saved_printing) return; 21f00: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 21f04: 81 11 cpse r24, r1 21f06: 06 c0 rjmp .+12 ; 0x21f14 21f08: 60 e0 ldi r22, 0x00 ; 0 21f0a: 70 e0 ldi r23, 0x00 ; 0 21f0c: 80 e8 ldi r24, 0x80 ; 128 21f0e: 9f eb ldi r25, 0xBF ; 191 21f10: 0f 94 f1 41 call 0x283e2 ; 0x283e2 //! @brief Pause print, disable nozzle heater, move to park position, send host action "paused" void lcd_pause_print() { stop_and_save_print_to_ram(0.0, -default_retraction); SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 21f14: 86 e3 ldi r24, 0x36 ; 54 21f16: 9a e6 ldi r25, 0x6A ; 106 21f18: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 // Indicate that the printer is paused did_pause_print = true; 21f1c: 81 e0 ldi r24, 0x01 ; 1 21f1e: 80 93 9b 03 sts 0x039B, r24 ; 0x80039b } else return false; } bool Stopwatch::pause() { if (isRunning()) { 21f22: 80 91 59 03 lds r24, 0x0359 ; 0x800359 21f26: 81 30 cpi r24, 0x01 ; 1 21f28: 69 f4 brne .+26 ; 0x21f44 state = PAUSED; 21f2a: 82 e0 ldi r24, 0x02 ; 2 21f2c: 80 93 59 03 sts 0x0359, r24 ; 0x800359 stopTimestamp = _millis(); 21f30: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 21f34: 60 93 78 06 sts 0x0678, r22 ; 0x800678 21f38: 70 93 79 06 sts 0x0679, r23 ; 0x800679 21f3c: 80 93 7a 06 sts 0x067A, r24 ; 0x80067a 21f40: 90 93 7b 06 sts 0x067B, r25 ; 0x80067b print_job_timer.pause(); // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::LongPause; 21f44: 82 e0 ldi r24, 0x02 ; 2 21f46: 80 93 c8 0d sts 0x0DC8, r24 ; 0x800dc8 lcd_return_to_status(); 21f4a: 0c 94 17 fe jmp 0x1fc2e ; 0x1fc2e 00021f4e ::expired(unsigned short)>: * @param msPeriod Time interval in milliseconds. Do not omit "ul" when using constant literal with LongTimer. * @retval true Timer has expired * @retval false Timer not expired yet, or is not running, or time window in which is timer considered expired passed. */ template bool Timer::expired(T msPeriod) 21f4e: ff 92 push r15 21f50: 0f 93 push r16 21f52: 1f 93 push r17 21f54: cf 93 push r28 21f56: df 93 push r29 { if (!m_isRunning) return false; 21f58: fc 01 movw r30, r24 21f5a: f0 80 ld r15, Z 21f5c: f1 10 cpse r15, r1 21f5e: 08 c0 rjmp .+16 ; 0x21f70 ::expired(unsigned short)+0x22> 21f60: f1 2c mov r15, r1 expired = true; } } if (expired) m_isRunning = false; return expired; } 21f62: 8f 2d mov r24, r15 21f64: df 91 pop r29 21f66: cf 91 pop r28 21f68: 1f 91 pop r17 21f6a: 0f 91 pop r16 21f6c: ff 90 pop r15 21f6e: 08 95 ret 21f70: 8b 01 movw r16, r22 21f72: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 21f74: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 if (m_started <= m_started + msPeriod) 21f78: 89 81 ldd r24, Y+1 ; 0x01 21f7a: 9a 81 ldd r25, Y+2 ; 0x02 21f7c: 08 0f add r16, r24 21f7e: 19 1f adc r17, r25 21f80: 08 17 cp r16, r24 21f82: 19 07 cpc r17, r25 21f84: 40 f0 brcs .+16 ; 0x21f96 ::expired(unsigned short)+0x48> { if ((now >= m_started + msPeriod) || (now < m_started)) 21f86: 60 17 cp r22, r16 21f88: 71 07 cpc r23, r17 21f8a: 18 f4 brcc .+6 ; 0x21f92 ::expired(unsigned short)+0x44> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 21f8c: 68 17 cp r22, r24 21f8e: 79 07 cpc r23, r25 21f90: 38 f7 brcc .-50 ; 0x21f60 ::expired(unsigned short)+0x12> { expired = true; } } if (expired) m_isRunning = false; 21f92: 18 82 st Y, r1 21f94: e6 cf rjmp .-52 ; 0x21f62 ::expired(unsigned short)+0x14> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 21f96: 60 17 cp r22, r16 21f98: 71 07 cpc r23, r17 21f9a: c0 f7 brcc .-16 ; 0x21f8c ::expired(unsigned short)+0x3e> 21f9c: e1 cf rjmp .-62 ; 0x21f60 ::expired(unsigned short)+0x12> 00021f9e ::expired_cont(unsigned short)>: } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 21f9e: fc 01 movw r30, r24 21fa0: 20 81 ld r18, Z 21fa2: 21 11 cpse r18, r1 21fa4: 0d 94 a7 0f jmp 0x21f4e ; 0x21f4e ::expired(unsigned short)> } 21fa8: 81 e0 ldi r24, 0x01 ; 1 21faa: 08 95 ret 00021fac ::start()>: /** * @brief Start timer */ template void Timer::start() 21fac: cf 93 push r28 21fae: df 93 push r29 21fb0: ec 01 movw r28, r24 { m_started = _millis(); 21fb2: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 21fb6: 7a 83 std Y+2, r23 ; 0x02 21fb8: 69 83 std Y+1, r22 ; 0x01 m_isRunning = true; 21fba: 81 e0 ldi r24, 0x01 ; 1 21fbc: 88 83 st Y, r24 } 21fbe: df 91 pop r29 21fc0: cf 91 pop r28 21fc2: 08 95 ret 00021fc4 ::expired(unsigned long)>: * @param msPeriod Time interval in milliseconds. Do not omit "ul" when using constant literal with LongTimer. * @retval true Timer has expired * @retval false Timer not expired yet, or is not running, or time window in which is timer considered expired passed. */ template bool Timer::expired(T msPeriod) 21fc4: 8f 92 push r8 21fc6: 9f 92 push r9 21fc8: af 92 push r10 21fca: bf 92 push r11 21fcc: cf 92 push r12 21fce: df 92 push r13 21fd0: ef 92 push r14 21fd2: ff 92 push r15 21fd4: 1f 93 push r17 21fd6: cf 93 push r28 21fd8: df 93 push r29 { if (!m_isRunning) return false; 21fda: fc 01 movw r30, r24 21fdc: 10 81 ld r17, Z 21fde: 11 11 cpse r17, r1 21fe0: 0e c0 rjmp .+28 ; 0x21ffe ::expired(unsigned long)+0x3a> 21fe2: 10 e0 ldi r17, 0x00 ; 0 expired = true; } } if (expired) m_isRunning = false; return expired; } 21fe4: 81 2f mov r24, r17 21fe6: df 91 pop r29 21fe8: cf 91 pop r28 21fea: 1f 91 pop r17 21fec: ff 90 pop r15 21fee: ef 90 pop r14 21ff0: df 90 pop r13 21ff2: cf 90 pop r12 21ff4: bf 90 pop r11 21ff6: af 90 pop r10 21ff8: 9f 90 pop r9 21ffa: 8f 90 pop r8 21ffc: 08 95 ret 21ffe: 6a 01 movw r12, r20 22000: 7b 01 movw r14, r22 22002: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 22004: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 22008: 4b 01 movw r8, r22 2200a: 5c 01 movw r10, r24 if (m_started <= m_started + msPeriod) 2200c: 89 81 ldd r24, Y+1 ; 0x01 2200e: 9a 81 ldd r25, Y+2 ; 0x02 22010: ab 81 ldd r26, Y+3 ; 0x03 22012: bc 81 ldd r27, Y+4 ; 0x04 22014: c8 0e add r12, r24 22016: d9 1e adc r13, r25 22018: ea 1e adc r14, r26 2201a: fb 1e adc r15, r27 2201c: c8 16 cp r12, r24 2201e: d9 06 cpc r13, r25 22020: ea 06 cpc r14, r26 22022: fb 06 cpc r15, r27 22024: 60 f0 brcs .+24 ; 0x2203e ::expired(unsigned long)+0x7a> { if ((now >= m_started + msPeriod) || (now < m_started)) 22026: 8c 14 cp r8, r12 22028: 9d 04 cpc r9, r13 2202a: ae 04 cpc r10, r14 2202c: bf 04 cpc r11, r15 2202e: 28 f4 brcc .+10 ; 0x2203a ::expired(unsigned long)+0x76> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 22030: 88 16 cp r8, r24 22032: 99 06 cpc r9, r25 22034: aa 06 cpc r10, r26 22036: bb 06 cpc r11, r27 22038: a0 f6 brcc .-88 ; 0x21fe2 ::expired(unsigned long)+0x1e> { expired = true; } } if (expired) m_isRunning = false; 2203a: 18 82 st Y, r1 2203c: d3 cf rjmp .-90 ; 0x21fe4 ::expired(unsigned long)+0x20> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 2203e: 8c 14 cp r8, r12 22040: 9d 04 cpc r9, r13 22042: ae 04 cpc r10, r14 22044: bf 04 cpc r11, r15 22046: a0 f7 brcc .-24 ; 0x22030 ::expired(unsigned long)+0x6c> 22048: cc cf rjmp .-104 ; 0x21fe2 ::expired(unsigned long)+0x1e> 0002204a : } lcd_space(8 - chars); } //! @Brief Print status line on status screen void lcdui_print_status_line(void) { 2204a: 0f 93 push r16 2204c: 1f 93 push r17 2204e: cf 93 push r28 static uint8_t heating_status_counter; if (heating_status != HeatingStatus::NO_HEATING) { // If heating flag, show progress of heating 22050: 80 91 99 03 lds r24, 0x0399 ; 0x800399 22054: 88 23 and r24, r24 22056: 09 f4 brne .+2 ; 0x2205a 22058: 4d c0 rjmp .+154 ; 0x220f4 heating_status_counter++; 2205a: 80 91 71 06 lds r24, 0x0671 ; 0x800671 2205e: 8f 5f subi r24, 0xFF ; 255 if (heating_status_counter > 13) { 22060: 8e 30 cpi r24, 0x0E ; 14 22062: b0 f4 brcc .+44 ; 0x22090 //! @Brief Print status line on status screen void lcdui_print_status_line(void) { static uint8_t heating_status_counter; if (heating_status != HeatingStatus::NO_HEATING) { // If heating flag, show progress of heating heating_status_counter++; 22064: 80 93 71 06 sts 0x0671, r24 ; 0x800671 if (heating_status_counter > 13) { heating_status_counter = 0; } lcd_set_cursor(7, 3); 22068: 63 e0 ldi r22, 0x03 ; 3 2206a: 87 e0 ldi r24, 0x07 ; 7 2206c: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_space(13); 22070: 8d e0 ldi r24, 0x0D ; 13 22072: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 22076: c0 e0 ldi r28, 0x00 ; 0 22078: 80 91 71 06 lds r24, 0x0671 ; 0x800671 2207c: c8 17 cp r28, r24 2207e: 58 f4 brcc .+22 ; 0x22096 lcd_putc_at(7 + dots, 3, '.'); 22080: 4e e2 ldi r20, 0x2E ; 46 22082: 63 e0 ldi r22, 0x03 ; 3 22084: 87 e0 ldi r24, 0x07 ; 7 22086: 8c 0f add r24, r28 22088: 0e 94 9b 69 call 0xd336 ; 0xd336 heating_status_counter = 0; } lcd_set_cursor(7, 3); lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 2208c: cf 5f subi r28, 0xFF ; 255 2208e: f4 cf rjmp .-24 ; 0x22078 void lcdui_print_status_line(void) { static uint8_t heating_status_counter; if (heating_status != HeatingStatus::NO_HEATING) { // If heating flag, show progress of heating heating_status_counter++; if (heating_status_counter > 13) { heating_status_counter = 0; 22090: 10 92 71 06 sts 0x0671, r1 ; 0x800671 22094: e9 cf rjmp .-46 ; 0x22068 lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { lcd_putc_at(7 + dots, 3, '.'); } switch (heating_status) { 22096: 80 91 99 03 lds r24, 0x0399 ; 0x800399 2209a: 82 30 cpi r24, 0x02 ; 2 2209c: d1 f0 breq .+52 ; 0x220d2 2209e: 30 f4 brcc .+12 ; 0x220ac 220a0: 81 30 cpi r24, 0x01 ; 1 220a2: 59 f0 breq .+22 ; 0x220ba case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 220a4: cf 91 pop r28 220a6: 1f 91 pop r17 220a8: 0f 91 pop r16 220aa: 08 95 ret lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { lcd_putc_at(7 + dots, 3, '.'); } switch (heating_status) { 220ac: 83 30 cpi r24, 0x03 ; 3 220ae: f9 f0 breq .+62 ; 0x220ee 220b0: 84 30 cpi r24, 0x04 ; 4 220b2: c1 f7 brne .-16 ; 0x220a4 break; case HeatingStatus::BED_HEATING: lcd_puts_at_P(0, 3, _T(MSG_BED_HEATING)); break; case HeatingStatus::BED_HEATING_COMPLETE: lcd_puts_at_P(0, 3, _T(MSG_BED_DONE)); 220b4: 80 e9 ldi r24, 0x90 ; 144 220b6: 98 e4 ldi r25, 0x48 ; 72 220b8: 0e c0 rjmp .+28 ; 0x220d6 for (uint8_t dots = 0; dots < heating_status_counter; dots++) { lcd_putc_at(7 + dots, 3, '.'); } switch (heating_status) { case HeatingStatus::EXTRUDER_HEATING: lcd_puts_at_P(0, 3, _T(MSG_HEATING)); 220ba: 89 eb ldi r24, 0xB9 ; 185 220bc: 98 e4 ldi r25, 0x48 ; 72 lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 220be: 0e 94 b1 6c call 0xd962 ; 0xd962 220c2: ac 01 movw r20, r24 220c4: 63 e0 ldi r22, 0x03 ; 3 220c6: 80 e0 ldi r24, 0x00 ; 0 break; } } } 220c8: cf 91 pop r28 220ca: 1f 91 pop r17 220cc: 0f 91 pop r16 lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 220ce: 0c 94 8f 69 jmp 0xd31e ; 0xd31e switch (heating_status) { case HeatingStatus::EXTRUDER_HEATING: lcd_puts_at_P(0, 3, _T(MSG_HEATING)); break; case HeatingStatus::EXTRUDER_HEATING_COMPLETE: lcd_puts_at_P(0, 3, _T(MSG_HEATING_COMPLETE)); 220d2: 89 ea ldi r24, 0xA9 ; 169 220d4: 98 e4 ldi r25, 0x48 ; 72 break; case HeatingStatus::BED_HEATING: lcd_puts_at_P(0, 3, _T(MSG_BED_HEATING)); break; case HeatingStatus::BED_HEATING_COMPLETE: lcd_puts_at_P(0, 3, _T(MSG_BED_DONE)); 220d6: 0e 94 b1 6c call 0xd962 ; 0xd962 220da: ac 01 movw r20, r24 220dc: 63 e0 ldi r22, 0x03 ; 3 220de: 80 e0 ldi r24, 0x00 ; 0 220e0: 0e 94 8f 69 call 0xd31e ; 0xd31e heating_status = HeatingStatus::NO_HEATING; 220e4: 10 92 99 03 sts 0x0399, r1 ; 0x800399 heating_status_counter = 0; 220e8: 10 92 71 06 sts 0x0671, r1 ; 0x800671 220ec: db cf rjmp .-74 ; 0x220a4 lcd_puts_at_P(0, 3, _T(MSG_HEATING_COMPLETE)); heating_status = HeatingStatus::NO_HEATING; heating_status_counter = 0; break; case HeatingStatus::BED_HEATING: lcd_puts_at_P(0, 3, _T(MSG_BED_HEATING)); 220ee: 8b e9 ldi r24, 0x9B ; 155 220f0: 98 e4 ldi r25, 0x48 ; 72 220f2: e5 cf rjmp .-54 ; 0x220be #ifdef SHOW_FILENAME_AFTER_FINISH || (GetPrinterState() == PrinterState::SDPrintingFinished) #endif //SHOW_FILENAME_AFTER_FINISH ) && (custom_message_type == CustomMsg::Status) && (lcd_status_message_level <= LCD_STATUS_INFO) && 220f4: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 220f8: 88 23 and r24, r24 220fa: 61 f1 breq .+88 ; 0x22154 } else if (((IS_SD_PRINTING) #ifdef SHOW_FILENAME_AFTER_FINISH || (GetPrinterState() == PrinterState::SDPrintingFinished) #endif //SHOW_FILENAME_AFTER_FINISH ) && 220fc: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 22100: 81 11 cpse r24, r1 22102: 28 c0 rjmp .+80 ; 0x22154 (custom_message_type == CustomMsg::Status) && 22104: 80 91 8e 03 lds r24, 0x038E ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.408> 22108: 82 30 cpi r24, 0x02 ; 2 2210a: 20 f5 brcc .+72 ; 0x22154 } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 2210c: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL26lcd_status_message_timeout.lto_priv.420> 22110: 81 11 cpse r24, r1 22112: 16 c0 rjmp .+44 ; 0x22140 (lcd_status_message_level <= LCD_STATUS_INFO) && lcd_status_message_timeout.expired_cont(LCD_STATUS_INFO_TIMEOUT)) { // If printing from SD, show what we are printing const char* longFilenameOLD = (card.longFilename[0] ? card.longFilename : card.filename); 22114: 80 91 81 13 lds r24, 0x1381 ; 0x801381 22118: 88 23 and r24, r24 2211a: 09 f4 brne .+2 ; 0x2211e 2211c: 35 c0 rjmp .+106 ; 0x22188 2211e: 81 e8 ldi r24, 0x81 ; 129 22120: 93 e1 ldi r25, 0x13 ; 19 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) 22122: 20 91 cc 0d lds r18, 0x0DCC ; 0x800dcc 22126: 64 e1 ldi r22, 0x14 ; 20 22128: 82 0f add r24, r18 2212a: 91 1d adc r25, r1 2212c: 0e 94 6a 6b call 0xd6d4 ; 0xd6d4 22130: 81 11 cpse r24, r1 22132: 2d c0 rjmp .+90 ; 0x2218e { scrollstuff++; 22134: 80 91 cc 0d lds r24, 0x0DCC ; 0x800dcc 22138: 8f 5f subi r24, 0xFF ; 255 2213a: 80 93 cc 0d sts 0x0DCC, r24 ; 0x800dcc 2213e: b2 cf rjmp .-156 ; 0x220a4 22140: 40 e2 ldi r20, 0x20 ; 32 22142: 5e e4 ldi r21, 0x4E ; 78 22144: 60 e0 ldi r22, 0x00 ; 0 22146: 70 e0 ldi r23, 0x00 ; 0 22148: 8e e1 ldi r24, 0x1E ; 30 2214a: 95 e0 ldi r25, 0x05 ; 5 2214c: 0f 94 e2 0f call 0x21fc4 ; 0x21fc4 ::expired(unsigned long)> 22150: 81 11 cpse r24, r1 22152: e0 cf rjmp .-64 ; 0x22114 scrollstuff = 0; } } else { // Otherwise check for other special events if ( custom_message_type != CustomMsg::Status && lcd_status_message_timeout.running() && lcd_status_message_timeout.elapsed() < LCD_STATUS_DELAYED_TIMEOUT) 22154: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 22158: 81 11 cpse r24, r1 2215a: 1c c0 rjmp .+56 ; 0x22194 { return; // Nothing to do, waiting for delay to expire } switch (custom_message_type) { 2215c: e0 91 c7 06 lds r30, 0x06C7 ; 0x8006c7 22160: ea 30 cpi r30, 0x0A ; 10 22162: 08 f0 brcs .+2 ; 0x22166 22164: 9f cf rjmp .-194 ; 0x220a4 22166: f0 e0 ldi r31, 0x00 ; 0 22168: 88 27 eor r24, r24 2216a: e6 54 subi r30, 0x46 ; 70 2216c: ff 4e sbci r31, 0xEF ; 239 2216e: 8e 4f sbci r24, 0xFE ; 254 22170: 0d 94 ec a0 jmp 0x341d8 ; 0x341d8 <__tablejump2__> 22174: 05 37 cpi r16, 0x75 ; 117 22176: cb 36 cpi r28, 0x6B ; 107 22178: 05 37 cpi r16, 0x75 ; 117 2217a: 47 37 cpi r20, 0x77 ; 119 2217c: 5b 38 cpi r21, 0x8B ; 139 2217e: 43 37 cpi r20, 0x73 ; 115 22180: 05 37 cpi r16, 0x75 ; 117 22182: 05 37 cpi r16, 0x75 ; 117 22184: 8d 37 cpi r24, 0x7D ; 125 22186: 05 37 cpi r16, 0x75 ; 117 (custom_message_type == CustomMsg::Status) && (lcd_status_message_level <= LCD_STATUS_INFO) && lcd_status_message_timeout.expired_cont(LCD_STATUS_INFO_TIMEOUT)) { // If printing from SD, show what we are printing const char* longFilenameOLD = (card.longFilename[0] ? card.longFilename : card.filename); 22188: 8c e6 ldi r24, 0x6C ; 108 2218a: 93 e1 ldi r25, 0x13 ; 19 2218c: ca cf rjmp .-108 ; 0x22122 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) { scrollstuff++; } else { scrollstuff = 0; 2218e: 10 92 cc 0d sts 0x0DCC, r1 ; 0x800dcc 22192: 88 cf rjmp .-240 ; 0x220a4 } } else { // Otherwise check for other special events if ( custom_message_type != CustomMsg::Status && lcd_status_message_timeout.running() 22194: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL26lcd_status_message_timeout.lto_priv.420> 22198: 88 23 and r24, r24 2219a: 01 f3 breq .-64 ; 0x2215c * This function is expected to handle wrap around of time register well. * The maximum elapsed time is dictated by the template type */ template T Timer::elapsed() { return m_isRunning ? (_millis() - m_started) : 0; 2219c: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 221a0: 00 91 1f 05 lds r16, 0x051F ; 0x80051f <_ZL26lcd_status_message_timeout.lto_priv.420+0x1> 221a4: 10 91 20 05 lds r17, 0x0520 ; 0x800520 <_ZL26lcd_status_message_timeout.lto_priv.420+0x2> 221a8: 20 91 21 05 lds r18, 0x0521 ; 0x800521 <_ZL26lcd_status_message_timeout.lto_priv.420+0x3> 221ac: 30 91 22 05 lds r19, 0x0522 ; 0x800522 <_ZL26lcd_status_message_timeout.lto_priv.420+0x4> 221b0: 60 1b sub r22, r16 221b2: 71 0b sbc r23, r17 221b4: 82 0b sbc r24, r18 221b6: 93 0b sbc r25, r19 && lcd_status_message_timeout.elapsed() < LCD_STATUS_DELAYED_TIMEOUT) 221b8: 60 3a cpi r22, 0xA0 ; 160 221ba: 7f 40 sbci r23, 0x0F ; 15 221bc: 81 05 cpc r24, r1 221be: 91 05 cpc r25, r1 221c0: 68 f6 brcc .-102 ; 0x2215c 221c2: 70 cf rjmp .-288 ; 0x220a4 case CustomMsg::Status: // Nothing special, print status message normally case CustomMsg::M0Wait: // M0/M1 Wait command working even from SD case CustomMsg::FilamentLoading: // If loading filament, print status case CustomMsg::MMUProgress: // MMU Progress Codes { lcd_set_cursor(lcd_status_message_idx, 3); 221c4: 63 e0 ldi r22, 0x03 ; 3 221c6: 80 91 08 05 lds r24, 0x0508 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.417> 221ca: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 const uint8_t padding = lcd_print_pad(&lcd_status_message[lcd_status_message_idx], LCD_WIDTH - lcd_status_message_idx); 221ce: 80 91 08 05 lds r24, 0x0508 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.417> 221d2: c4 e1 ldi r28, 0x14 ; 20 221d4: 6c 2f mov r22, r28 221d6: 68 1b sub r22, r24 221d8: 90 e0 ldi r25, 0x00 ; 0 221da: 87 5f subi r24, 0xF7 ; 247 221dc: 9a 4f sbci r25, 0xFA ; 250 221de: 0e 94 6a 6b call 0xd6d4 ; 0xd6d4 lcd_status_message_idx = LCD_WIDTH - padding; 221e2: c8 1b sub r28, r24 221e4: c0 93 08 05 sts 0x0508, r28 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.417> 221e8: 5d cf rjmp .-326 ; 0x220a4 } break; case CustomMsg::MeshBedLeveling: // If mesh bed leveling in progress, show the status if (custom_message_state > 10) { 221ea: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 221ee: 8b 30 cpi r24, 0x0B ; 11 221f0: 08 f1 brcs .+66 ; 0x22234 lcd_set_cursor(0, 3); 221f2: 63 e0 ldi r22, 0x03 ; 3 221f4: 80 e0 ldi r24, 0x00 ; 0 221f6: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_space(LCD_WIDTH); 221fa: 84 e1 ldi r24, 0x14 ; 20 221fc: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_puts_at_P(0, 3, _T(MSG_CALIBRATE_Z_AUTO)); 22200: 80 e8 ldi r24, 0x80 ; 128 22202: 98 e4 ldi r25, 0x48 ; 72 22204: 0e 94 b1 6c call 0xd962 ; 0xd962 22208: ac 01 movw r20, r24 2220a: 63 e0 ldi r22, 0x03 ; 3 2220c: 80 e0 ldi r24, 0x00 ; 0 2220e: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_puts_P(PSTR(" : ")); 22212: 81 ec ldi r24, 0xC1 ; 193 22214: 94 e9 ldi r25, 0x94 ; 148 22216: 0e 94 66 69 call 0xd2cc ; 0xd2cc lcd_print(custom_message_state - 10); 2221a: 60 91 ac 03 lds r22, 0x03AC ; 0x8003ac 2221e: 6a 50 subi r22, 0x0A ; 10 22220: 77 0b sbc r23, r23 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 22222: 07 2e mov r0, r23 22224: 00 0c add r0, r0 22226: 88 0b sbc r24, r24 22228: 99 0b sbc r25, r25 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 2222a: cf 91 pop r28 2222c: 1f 91 pop r17 2222e: 0f 91 pop r16 22230: 0c 94 34 6b jmp 0xd668 ; 0xd668 lcd_space(LCD_WIDTH); lcd_puts_at_P(0, 3, _T(MSG_CALIBRATE_Z_AUTO)); lcd_puts_P(PSTR(" : ")); lcd_print(custom_message_state - 10); } else { if (custom_message_state == 3) { 22234: 83 30 cpi r24, 0x03 ; 3 22236: 31 f4 brne .+12 ; 0x22244 lcd_setstatuspgm(MSG_WELCOME); 22238: 87 e6 ldi r24, 0x67 ; 103 2223a: 9b e6 ldi r25, 0x6B ; 107 2223c: 0e 94 65 e6 call 0x1ccca ; 0x1ccca custom_message_type = CustomMsg::Status; 22240: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 } if (custom_message_state > 3 && custom_message_state <= 10) { 22244: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 22248: 84 50 subi r24, 0x04 ; 4 2224a: 87 30 cpi r24, 0x07 ; 7 2224c: 08 f0 brcs .+2 ; 0x22250 2224e: 2a cf rjmp .-428 ; 0x220a4 lcd_set_cursor(0, 3); 22250: 63 e0 ldi r22, 0x03 ; 3 22252: 80 e0 ldi r24, 0x00 ; 0 22254: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_space(19); 22258: 83 e1 ldi r24, 0x13 ; 19 2225a: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_puts_at_P(0, 3, _T(MSG_HOMEYZ_DONE)); 2225e: 8d e6 ldi r24, 0x6D ; 109 22260: 98 e4 ldi r25, 0x48 ; 72 22262: 0e 94 b1 6c call 0xd962 ; 0xd962 22266: ac 01 movw r20, r24 22268: 63 e0 ldi r22, 0x03 ; 3 2226a: 80 e0 ldi r24, 0x00 ; 0 2226c: 0e 94 8f 69 call 0xd31e ; 0xd31e custom_message_state--; 22270: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 22274: 81 50 subi r24, 0x01 ; 1 22276: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac 2227a: 14 cf rjmp .-472 ; 0x220a4 } } break; case CustomMsg::PidCal: // PID tuning in progress lcd_print_pad(lcd_status_message, LCD_WIDTH); 2227c: 64 e1 ldi r22, 0x14 ; 20 2227e: 89 e0 ldi r24, 0x09 ; 9 22280: 95 e0 ldi r25, 0x05 ; 5 22282: 0e 94 6a 6b call 0xd6d4 ; 0xd6d4 if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0) { 22286: 20 91 6f 06 lds r18, 0x066F ; 0x80066f 2228a: 30 91 70 06 lds r19, 0x0670 ; 0x800670 2228e: 80 91 6d 06 lds r24, 0x066D ; 0x80066d 22292: 90 91 6e 06 lds r25, 0x066E ; 0x80066e 22296: 82 17 cp r24, r18 22298: 93 07 cpc r25, r19 2229a: 0c f4 brge .+2 ; 0x2229e 2229c: 03 cf rjmp .-506 ; 0x220a4 2229e: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 222a2: 88 23 and r24, r24 222a4: 09 f4 brne .+2 ; 0x222a8 222a6: fe ce rjmp .-516 ; 0x220a4 lcd_set_cursor(10, 3); 222a8: 63 e0 ldi r22, 0x03 ; 3 222aa: 8a e0 ldi r24, 0x0A ; 10 222ac: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_printf_P(PSTR("%3d/%-3d"), pid_cycle, pid_number_of_cycles); 222b0: 80 91 6e 06 lds r24, 0x066E ; 0x80066e 222b4: 8f 93 push r24 222b6: 80 91 6d 06 lds r24, 0x066D ; 0x80066d 222ba: 8f 93 push r24 222bc: 80 91 70 06 lds r24, 0x0670 ; 0x800670 222c0: 8f 93 push r24 222c2: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 222c6: 8f 93 push r24 222c8: 88 eb ldi r24, 0xB8 ; 184 222ca: 94 e9 ldi r25, 0x94 ; 148 } break; case CustomMsg::TempCal: // PINDA temp calibration in progress lcd_set_cursor(0, 3); lcd_printf_P(PSTR("%-12.12S%-d/6"), _T(MSG_PINDA_CALIBRATION), custom_message_state); 222cc: 9f 93 push r25 222ce: 8f 93 push r24 222d0: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 222d4: 0f 90 pop r0 222d6: 0f 90 pop r0 222d8: 0f 90 pop r0 222da: 0f 90 pop r0 222dc: 0f 90 pop r0 222de: 0f 90 pop r0 222e0: e1 ce rjmp .-574 ; 0x220a4 lcd_set_cursor(10, 3); lcd_printf_P(PSTR("%3d/%-3d"), pid_cycle, pid_number_of_cycles); } break; case CustomMsg::TempCal: // PINDA temp calibration in progress lcd_set_cursor(0, 3); 222e2: 63 e0 ldi r22, 0x03 ; 3 222e4: 80 e0 ldi r24, 0x00 ; 0 222e6: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_printf_P(PSTR("%-12.12S%-d/6"), _T(MSG_PINDA_CALIBRATION), custom_message_state); 222ea: c0 91 ac 03 lds r28, 0x03AC ; 0x8003ac 222ee: 85 ee ldi r24, 0xE5 ; 229 222f0: 9a e3 ldi r25, 0x3A ; 58 222f2: 0e 94 b1 6c call 0xd962 ; 0xd962 222f6: 1f 92 push r1 222f8: cf 93 push r28 222fa: 9f 93 push r25 222fc: 8f 93 push r24 222fe: 8a ea ldi r24, 0xAA ; 170 22300: 94 e9 ldi r25, 0x94 ; 148 22302: e4 cf rjmp .-56 ; 0x222cc break; case CustomMsg::TempCompPreheat: // temp compensation preheat lcd_puts_at_P(0, 3, _T(MSG_PINDA_PREHEAT)); 22304: 8d e5 ldi r24, 0x5D ; 93 22306: 98 e4 ldi r25, 0x48 ; 72 22308: 0e 94 b1 6c call 0xd962 ; 0xd962 2230c: ac 01 movw r20, r24 2230e: 63 e0 ldi r22, 0x03 ; 3 22310: 80 e0 ldi r24, 0x00 ; 0 22312: 0e 94 8f 69 call 0xd31e ; 0xd31e if (custom_message_state <= PINDA_HEAT_T) { 22316: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 2231a: 89 37 cpi r24, 0x79 ; 121 2231c: 08 f0 brcs .+2 ; 0x22320 2231e: c2 ce rjmp .-636 ; 0x220a4 lcd_puts_P(PSTR(": ")); 22320: 87 ea ldi r24, 0xA7 ; 167 22322: 94 e9 ldi r25, 0x94 ; 148 22324: 0e 94 66 69 call 0xd2cc ; 0xd2cc } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 22328: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 2232c: 0e 94 2a 6a call 0xd454 ; 0xd454 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 22330: 80 e2 ldi r24, 0x20 ; 32 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 22332: cf 91 pop r28 22334: 1f 91 pop r17 22336: 0f 91 pop r16 22338: 0c 94 2a 6a jmp 0xd454 ; 0xd454 lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 2233c: 8c e4 ldi r24, 0x4C ; 76 2233e: 98 e4 ldi r25, 0x48 ; 72 22340: be ce rjmp .-644 ; 0x220be 00022342 ::start()>: /** * @brief Start timer */ template void Timer::start() 22342: cf 93 push r28 22344: df 93 push r29 22346: ec 01 movw r28, r24 { m_started = _millis(); 22348: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 2234c: 69 83 std Y+1, r22 ; 0x01 2234e: 7a 83 std Y+2, r23 ; 0x02 22350: 8b 83 std Y+3, r24 ; 0x03 22352: 9c 83 std Y+4, r25 ; 0x04 m_isRunning = true; 22354: 81 e0 ldi r24, 0x01 ; 1 22356: 88 83 st Y, r24 } 22358: df 91 pop r29 2235a: cf 91 pop r28 2235c: 08 95 ret 0002235e : //! signal a temperature error on both the lcd and serial //! @param type short error abbreviation (PROGMEM) //! @param e optional extruder index for hotend errors static void temp_error_messagepgm(const char* PROGMEM type, uint8_t e = EXTRUDERS) { 2235e: cf 92 push r12 22360: df 92 push r13 22362: ef 92 push r14 22364: ff 92 push r15 22366: 1f 93 push r17 22368: cf 93 push r28 2236a: df 93 push r29 2236c: cd b7 in r28, 0x3d ; 61 2236e: de b7 in r29, 0x3e ; 62 22370: 64 97 sbiw r28, 0x14 ; 20 22372: 0f b6 in r0, 0x3f ; 63 22374: f8 94 cli 22376: de bf out 0x3e, r29 ; 62 22378: 0f be out 0x3f, r0 ; 63 2237a: cd bf out 0x3d, r28 ; 61 2237c: 7c 01 movw r14, r24 2237e: 16 2f mov r17, r22 char msg[LCD_WIDTH]; strcpy_P(msg, PSTR("Err: ")); 22380: 60 e7 ldi r22, 0x70 ; 112 22382: 74 e9 ldi r23, 0x94 ; 148 22384: ce 01 movw r24, r28 22386: 01 96 adiw r24, 0x01 ; 1 22388: 0f 94 93 9d call 0x33b26 ; 0x33b26 strcat_P(msg, type); 2238c: b7 01 movw r22, r14 2238e: ce 01 movw r24, r28 22390: 01 96 adiw r24, 0x01 ; 1 22392: 0f 94 7f 9d call 0x33afe ; 0x33afe lcd_status_message_timeout.start(); } void lcd_setalertstatus_(const char* message, uint8_t severity, bool progmem) { if (lcd_message_check(severity)) { 22396: 83 e0 ldi r24, 0x03 ; 3 22398: 0e 94 eb e1 call 0x1c3d6 ; 0x1c3d6 2239c: 88 23 and r24, r24 2239e: e1 f0 breq .+56 ; 0x223d8 bool same = !(progmem? strcmp_P(lcd_status_message, message): strcmp(lcd_status_message, message)); 223a0: be 01 movw r22, r28 223a2: 6f 5f subi r22, 0xFF ; 255 223a4: 7f 4f sbci r23, 0xFF ; 255 223a6: 89 e0 ldi r24, 0x09 ; 9 223a8: 95 e0 ldi r25, 0x05 ; 5 223aa: 0f 94 3e a6 call 0x34c7c ; 0x34c7c 223ae: 6c 01 movw r12, r24 lcd_status_message_timeout.start(); 223b0: 8e e1 ldi r24, 0x1E ; 30 223b2: 95 e0 ldi r25, 0x05 ; 5 223b4: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> lcd_status_message_level = severity; 223b8: 83 e0 ldi r24, 0x03 ; 3 223ba: 80 93 8e 03 sts 0x038E, r24 ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.408> custom_message_type = CustomMsg::Status; 223be: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 custom_message_state = 0; 223c2: 10 92 ac 03 sts 0x03AC, r1 ; 0x8003ac if (!same) { 223c6: cd 28 or r12, r13 223c8: 39 f0 breq .+14 ; 0x223d8 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 223ca: 60 e0 ldi r22, 0x00 ; 0 223cc: ce 01 movw r24, r28 223ce: 01 96 adiw r24, 0x01 ; 1 223d0: 0e 94 d0 e1 call 0x1c3a0 ; 0x1c3a0 lcd_return_to_status(); 223d4: 0e 94 17 fe call 0x1fc2e ; 0x1fc2e lcd_setalertstatus(msg, LCD_STATUS_CRITICAL); SERIAL_ERROR_START; 223d8: 84 e4 ldi r24, 0x44 ; 68 223da: 9d e9 ldi r25, 0x9D ; 157 223dc: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 if(e != EXTRUDERS) { 223e0: 11 30 cpi r17, 0x01 ; 1 223e2: 51 f0 breq .+20 ; 0x223f8 223e4: 61 2f mov r22, r17 223e6: 70 e0 ldi r23, 0x00 ; 0 223e8: 90 e0 ldi r25, 0x00 ; 0 223ea: 80 e0 ldi r24, 0x00 ; 0 223ec: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_ERROR((int)e); SERIAL_ERRORPGM(": "); 223f0: 8d e6 ldi r24, 0x6D ; 109 223f2: 94 e9 ldi r25, 0x94 ; 148 223f4: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 } SERIAL_ERRORPGM("Heaters switched off. "); 223f8: 86 e5 ldi r24, 0x56 ; 86 223fa: 94 e9 ldi r25, 0x94 ; 148 223fc: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ERRORRPGM(type); 22400: c7 01 movw r24, r14 22402: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ERRORLNPGM(" triggered!"); 22406: 8a e4 ldi r24, 0x4A ; 74 22408: 94 e9 ldi r25, 0x94 ; 148 2240a: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 } 2240e: 64 96 adiw r28, 0x14 ; 20 22410: 0f b6 in r0, 0x3f ; 63 22412: f8 94 cli 22414: de bf out 0x3e, r29 ; 62 22416: 0f be out 0x3f, r0 ; 63 22418: cd bf out 0x3d, r28 ; 61 2241a: df 91 pop r29 2241c: cf 91 pop r28 2241e: 1f 91 pop r17 22420: ff 90 pop r15 22422: ef 90 pop r14 22424: df 90 pop r13 22426: cf 90 pop r12 22428: 08 95 ret 0002242a <__vector_15>: volatile unsigned long timer2_overflow_count; volatile unsigned long timer2_millis; unsigned char timer2_fract = 0; ISR(TIMER2_OVF_vect) { 2242a: 1f 92 push r1 2242c: 0f 92 push r0 2242e: 0f b6 in r0, 0x3f ; 63 22430: 0f 92 push r0 22432: 11 24 eor r1, r1 22434: 2f 93 push r18 22436: 3f 93 push r19 22438: 8f 93 push r24 2243a: 9f 93 push r25 2243c: af 93 push r26 2243e: bf 93 push r27 // copy these to local variables so they can be stored in registers // (volatile variables must be read from memory on every access) unsigned long m = timer2_millis; 22440: 80 91 65 06 lds r24, 0x0665 ; 0x800665 22444: 90 91 66 06 lds r25, 0x0666 ; 0x800666 22448: a0 91 67 06 lds r26, 0x0667 ; 0x800667 2244c: b0 91 68 06 lds r27, 0x0668 ; 0x800668 unsigned char f = timer2_fract; 22450: 30 91 64 06 lds r19, 0x0664 ; 0x800664 m += MILLIS_INC; f += FRACT_INC; 22454: 23 e0 ldi r18, 0x03 ; 3 22456: 23 0f add r18, r19 if (f >= FRACT_MAX) 22458: 2d 37 cpi r18, 0x7D ; 125 2245a: 58 f5 brcc .+86 ; 0x224b2 <__vector_15+0x88> { // copy these to local variables so they can be stored in registers // (volatile variables must be read from memory on every access) unsigned long m = timer2_millis; unsigned char f = timer2_fract; m += MILLIS_INC; 2245c: 01 96 adiw r24, 0x01 ; 1 2245e: a1 1d adc r26, r1 22460: b1 1d adc r27, r1 if (f >= FRACT_MAX) { f -= FRACT_MAX; m += 1; } timer2_fract = f; 22462: 20 93 64 06 sts 0x0664, r18 ; 0x800664 timer2_millis = m; 22466: 80 93 65 06 sts 0x0665, r24 ; 0x800665 2246a: 90 93 66 06 sts 0x0666, r25 ; 0x800666 2246e: a0 93 67 06 sts 0x0667, r26 ; 0x800667 22472: b0 93 68 06 sts 0x0668, r27 ; 0x800668 timer2_overflow_count++; 22476: 80 91 69 06 lds r24, 0x0669 ; 0x800669 2247a: 90 91 6a 06 lds r25, 0x066A ; 0x80066a 2247e: a0 91 6b 06 lds r26, 0x066B ; 0x80066b 22482: b0 91 6c 06 lds r27, 0x066C ; 0x80066c 22486: 01 96 adiw r24, 0x01 ; 1 22488: a1 1d adc r26, r1 2248a: b1 1d adc r27, r1 2248c: 80 93 69 06 sts 0x0669, r24 ; 0x800669 22490: 90 93 6a 06 sts 0x066A, r25 ; 0x80066a 22494: a0 93 6b 06 sts 0x066B, r26 ; 0x80066b 22498: b0 93 6c 06 sts 0x066C, r27 ; 0x80066c } 2249c: bf 91 pop r27 2249e: af 91 pop r26 224a0: 9f 91 pop r25 224a2: 8f 91 pop r24 224a4: 3f 91 pop r19 224a6: 2f 91 pop r18 224a8: 0f 90 pop r0 224aa: 0f be out 0x3f, r0 ; 63 224ac: 0f 90 pop r0 224ae: 1f 90 pop r1 224b0: 18 95 reti unsigned char f = timer2_fract; m += MILLIS_INC; f += FRACT_INC; if (f >= FRACT_MAX) { f -= FRACT_MAX; 224b2: 26 e8 ldi r18, 0x86 ; 134 224b4: 23 0f add r18, r19 m += 1; 224b6: 02 96 adiw r24, 0x02 ; 2 224b8: a1 1d adc r26, r1 224ba: b1 1d adc r27, r1 224bc: d2 cf rjmp .-92 ; 0x22462 <__vector_15+0x38> 000224be : } ENABLE_TEMP_MGR_INTERRUPT(); } void disable_heater() { 224be: cf 93 push r28 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 224c0: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 224c4: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 224c8: 10 92 ee 11 sts 0x11EE, r1 ; 0x8011ee 224cc: 10 92 ed 11 sts 0x11ED, r1 ; 0x8011ed setTargetHotend(0); setTargetBed(0); ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 224d0: cf b7 in r28, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 224d2: f8 94 cli // propagate all values down the chain setIsrTargetTemperatures(); 224d4: 0e 94 db fa call 0x1f5b6 ; 0x1f5b6 temp_mgr_pid(); 224d8: 0e 94 18 f8 call 0x1f030 ; 0x1f030 // we can't call soft_pwm_core directly to toggle the pins as it would require removing the inline // attribute, so disable each pin individually #if defined(HEATER_0_PIN) && HEATER_0_PIN > -1 && EXTRUDERS > 0 WRITE(HEATER_0_PIN,LOW); 224dc: 75 98 cbi 0x0e, 5 ; 14 #endif #if defined(HEATER_BED_PIN) && HEATER_BED_PIN > -1 // TODO: this doesn't take immediate effect! bedPWMDisabled = 0; 224de: 10 92 92 06 sts 0x0692, r1 ; 0x800692 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 224e2: cf bf out 0x3f, r28 ; 63 #endif } } 224e4: cf 91 pop r28 224e6: 08 95 ret 000224e8 : /* Menu implementation */ static void lcd_cooldown() { disable_heater(); 224e8: 0f 94 5f 12 call 0x224be ; 0x224be fanSpeed = 0; 224ec: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 lcd_return_to_status(); 224f0: 0c 94 17 fe jmp 0x1fc2e ; 0x1fc2e 000224f4 : // set the error type from within the temp_mgr isr to be handled in manager_heater // - immediately disable all heaters and turn on all fans at full speed // - prevent the user to set temperatures until all errors are cleared void set_temp_error(TempErrorSource source, uint8_t index, TempErrorType type) { 224f4: 1f 93 push r17 224f6: cf 93 push r28 224f8: df 93 push r29 224fa: c8 2f mov r28, r24 224fc: 16 2f mov r17, r22 224fe: d4 2f mov r29, r20 // save the original target temperatures for recovery before disabling heaters if(!temp_error_state.error && !saved_printing) { 22500: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 22504: 80 fd sbrc r24, 0 22506: 18 c0 rjmp .+48 ; 0x22538 22508: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 2250c: 81 11 cpse r24, r1 2250e: 14 c0 rjmp .+40 ; 0x22538 saved_bed_temperature = target_temperature_bed; 22510: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed 22514: 80 93 ec 11 sts 0x11EC, r24 ; 0x8011ec saved_extruder_temperature = target_temperature[index]; 22518: e6 2f mov r30, r22 2251a: f0 e0 ldi r31, 0x00 ; 0 2251c: ee 0f add r30, r30 2251e: ff 1f adc r31, r31 22520: ef 50 subi r30, 0x0F ; 15 22522: fe 4e sbci r31, 0xEE ; 238 22524: 80 81 ld r24, Z 22526: 91 81 ldd r25, Z+1 ; 0x01 22528: 90 93 f0 11 sts 0x11F0, r25 ; 0x8011f0 2252c: 80 93 ef 11 sts 0x11EF, r24 ; 0x8011ef saved_fan_speed = fanSpeed; 22530: 80 91 e9 11 lds r24, 0x11E9 ; 0x8011e9 22534: 80 93 e8 11 sts 0x11E8, r24 ; 0x8011e8 } // keep disabling heaters and keep fans on as long as the condition is asserted disable_heater(); 22538: 0f 94 5f 12 call 0x224be ; 0x224be void hotendFanSetFullSpeed() { #ifdef EXTRUDER_ALTFAN_DETECT altfanStatus.altfanOverride = 1; //full speed #endif //EXTRUDER_ALTFAN_DETECT resetFanCheck(); 2253c: 0e 94 32 6e call 0xdc64 ; 0xdc64 setExtruderAutoFanState(3); 22540: 83 e0 ldi r24, 0x03 ; 3 22542: 0e 94 3f 6e call 0xdc7e ; 0xdc7e SET_OUTPUT(FAN_PIN); 22546: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 2254a: 88 60 ori r24, 0x08 ; 8 2254c: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = 255; 22550: 8f ef ldi r24, 0xFF ; 255 22552: 80 93 05 05 sts 0x0505, r24 ; 0x800505 #else //FAN_SOFT_PWM analogWrite(FAN_PIN, 255); #endif //FAN_SOFT_PWM fanSpeed = 255; 22556: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 hotendFanSetFullSpeed(); // set the initial error source to the highest priority error if(!temp_error_state.error || (uint8_t)type < temp_error_state.type) { 2255a: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 2255e: 80 ff sbrs r24, 0 22560: 07 c0 rjmp .+14 ; 0x22570 22562: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 22566: 82 95 swap r24 22568: 86 95 lsr r24 2256a: 87 70 andi r24, 0x07 ; 7 2256c: d8 17 cp r29, r24 2256e: c0 f4 brcc .+48 ; 0x225a0 temp_error_state.source = (uint8_t)source; 22570: c3 70 andi r28, 0x03 ; 3 22572: cc 0f add r28, r28 22574: cc 0f add r28, r28 22576: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 2257a: 83 7f andi r24, 0xF3 ; 243 2257c: 8c 2b or r24, r28 2257e: 80 93 9a 03 sts 0x039A, r24 ; 0x80039a <_ZL16temp_error_state.lto_priv.422> temp_error_state.index = index; 22582: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 22586: 10 fb bst r17, 0 22588: 84 f9 bld r24, 4 2258a: 80 93 9a 03 sts 0x039A, r24 ; 0x80039a <_ZL16temp_error_state.lto_priv.422> temp_error_state.type = (uint8_t)type; 2258e: d2 95 swap r29 22590: dd 0f add r29, r29 22592: d0 7e andi r29, 0xE0 ; 224 22594: 40 91 9a 03 lds r20, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 22598: 4f 71 andi r20, 0x1F ; 31 2259a: 4d 2b or r20, r29 2259c: 40 93 9a 03 sts 0x039A, r20 ; 0x80039a <_ZL16temp_error_state.lto_priv.422> } // always set the error state temp_error_state.error = true; 225a0: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 225a4: 81 60 ori r24, 0x01 ; 1 225a6: 80 93 9a 03 sts 0x039A, r24 ; 0x80039a <_ZL16temp_error_state.lto_priv.422> temp_error_state.assert = true; 225aa: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 225ae: 82 60 ori r24, 0x02 ; 2 225b0: 80 93 9a 03 sts 0x039A, r24 ; 0x80039a <_ZL16temp_error_state.lto_priv.422> } 225b4: df 91 pop r29 225b6: cf 91 pop r28 225b8: 1f 91 pop r17 225ba: 08 95 ret 000225bc : timer4_init(); //for tone and Hotend fan PWM } #if (defined (TEMP_RUNAWAY_BED_HYSTERESIS) && TEMP_RUNAWAY_BED_TIMEOUT > 0) || (defined (TEMP_RUNAWAY_EXTRUDER_HYSTERESIS) && TEMP_RUNAWAY_EXTRUDER_TIMEOUT > 0) static void temp_runaway_check(uint8_t _heater_id, float _target_temperature, float _current_temperature, float _output, bool _isbed) { 225bc: 2f 92 push r2 225be: 3f 92 push r3 225c0: 4f 92 push r4 225c2: 5f 92 push r5 225c4: 6f 92 push r6 225c6: 7f 92 push r7 225c8: 8f 92 push r8 225ca: 9f 92 push r9 225cc: af 92 push r10 225ce: bf 92 push r11 225d0: cf 92 push r12 225d2: df 92 push r13 225d4: ef 92 push r14 225d6: ff 92 push r15 225d8: 0f 93 push r16 225da: 1f 93 push r17 225dc: cf 93 push r28 225de: df 93 push r29 225e0: cd b7 in r28, 0x3d ; 61 225e2: de b7 in r29, 0x3e ; 62 225e4: 2c 97 sbiw r28, 0x0c ; 12 225e6: 0f b6 in r0, 0x3f ; 63 225e8: f8 94 cli 225ea: de bf out 0x3e, r29 ; 62 225ec: 0f be out 0x3f, r0 ; 63 225ee: cd bf out 0x3d, r28 ; 61 225f0: 28 2e mov r2, r24 225f2: 49 83 std Y+1, r20 ; 0x01 225f4: 5a 83 std Y+2, r21 ; 0x02 225f6: 6b 83 std Y+3, r22 ; 0x03 225f8: 7c 83 std Y+4, r23 ; 0x04 225fa: 28 01 movw r4, r16 225fc: 39 01 movw r6, r18 225fe: 3a 2c mov r3, r10 bool temp_runaway_check_active = false; static float __preheat_start[2] = { 0,0}; //currently just bed and one extruder static uint8_t __preheat_counter[2] = { 0,0}; static uint8_t __preheat_errors[2] = { 0,0}; if (_millis() - temp_runaway_timer[_heater_id] > 2000) 22600: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 22604: 02 2d mov r16, r2 22606: 10 e0 ldi r17, 0x00 ; 0 22608: 98 01 movw r18, r16 2260a: 22 0f add r18, r18 2260c: 33 1f adc r19, r19 2260e: 22 0f add r18, r18 22610: 33 1f adc r19, r19 22612: 3c 87 std Y+12, r19 ; 0x0c 22614: 2b 87 std Y+11, r18 ; 0x0b 22616: f9 01 movw r30, r18 22618: e7 5f subi r30, 0xF7 ; 247 2261a: f9 4f sbci r31, 0xF9 ; 249 2261c: 80 80 ld r8, Z 2261e: 91 80 ldd r9, Z+1 ; 0x01 22620: a2 80 ldd r10, Z+2 ; 0x02 22622: b3 80 ldd r11, Z+3 ; 0x03 22624: 68 19 sub r22, r8 22626: 79 09 sbc r23, r9 22628: 8a 09 sbc r24, r10 2262a: 9b 09 sbc r25, r11 2262c: 61 3d cpi r22, 0xD1 ; 209 2262e: 77 40 sbci r23, 0x07 ; 7 22630: 81 05 cpc r24, r1 22632: 91 05 cpc r25, r1 22634: 08 f4 brcc .+2 ; 0x22638 22636: ea c0 rjmp .+468 ; 0x2280c { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) 22638: 33 20 and r3, r3 2263a: 09 f4 brne .+2 ; 0x2263e 2263c: 75 c0 rjmp .+234 ; 0x22728 { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; __timeout = TEMP_RUNAWAY_BED_TIMEOUT; 2263e: 88 e6 ldi r24, 0x68 ; 104 22640: 91 e0 ldi r25, 0x01 ; 1 22642: 9a 87 std Y+10, r25 ; 0x0a 22644: 89 87 std Y+9, r24 ; 0x09 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; 22646: 80 e0 ldi r24, 0x00 ; 0 22648: 90 e0 ldi r25, 0x00 ; 0 2264a: a0 ea ldi r26, 0xA0 ; 160 2264c: b0 e4 ldi r27, 0x40 ; 64 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 2264e: 8d 83 std Y+5, r24 ; 0x05 22650: 9e 83 std Y+6, r25 ; 0x06 22652: af 83 std Y+7, r26 ; 0x07 22654: b8 87 std Y+8, r27 ; 0x08 __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; } #endif temp_runaway_timer[_heater_id] = _millis(); 22656: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 2265a: eb 85 ldd r30, Y+11 ; 0x0b 2265c: fc 85 ldd r31, Y+12 ; 0x0c 2265e: e7 5f subi r30, 0xF7 ; 247 22660: f9 4f sbci r31, 0xF9 ; 249 22662: 60 83 st Z, r22 22664: 71 83 std Z+1, r23 ; 0x01 22666: 82 83 std Z+2, r24 ; 0x02 22668: 93 83 std Z+3, r25 ; 0x03 if (_output == 0) 2266a: 20 e0 ldi r18, 0x00 ; 0 2266c: 30 e0 ldi r19, 0x00 ; 0 2266e: a9 01 movw r20, r18 22670: c7 01 movw r24, r14 22672: b6 01 movw r22, r12 22674: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 22678: 81 11 cpse r24, r1 2267a: 07 c0 rjmp .+14 ; 0x2268a { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 2267c: f8 01 movw r30, r16 2267e: ee 0f add r30, r30 22680: ff 1f adc r31, r31 22682: eb 5f subi r30, 0xFB ; 251 22684: f9 4f sbci r31, 0xF9 ; 249 22686: 11 82 std Z+1, r1 ; 0x01 22688: 10 82 st Z, r1 } if (temp_runaway_target[_heater_id] != _target_temperature) 2268a: ab 85 ldd r26, Y+11 ; 0x0b 2268c: bc 85 ldd r27, Y+12 ; 0x0c 2268e: a3 50 subi r26, 0x03 ; 3 22690: ba 4f sbci r27, 0xFA ; 250 22692: 5d 01 movw r10, r26 22694: 29 81 ldd r18, Y+1 ; 0x01 22696: 3a 81 ldd r19, Y+2 ; 0x02 22698: 4b 81 ldd r20, Y+3 ; 0x03 2269a: 5c 81 ldd r21, Y+4 ; 0x04 2269c: 6d 91 ld r22, X+ 2269e: 7d 91 ld r23, X+ 226a0: 8d 91 ld r24, X+ 226a2: 9c 91 ld r25, X 226a4: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 226a8: 88 23 and r24, r24 226aa: 09 f4 brne .+2 ; 0x226ae 226ac: 91 c0 rjmp .+290 ; 0x227d0 { if (_target_temperature > 0) 226ae: 20 e0 ldi r18, 0x00 ; 0 226b0: 30 e0 ldi r19, 0x00 ; 0 226b2: a9 01 movw r20, r18 226b4: 69 81 ldd r22, Y+1 ; 0x01 226b6: 7a 81 ldd r23, Y+2 ; 0x02 226b8: 8b 81 ldd r24, Y+3 ; 0x03 226ba: 9c 81 ldd r25, Y+4 ; 0x04 226bc: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 226c0: f8 01 movw r30, r16 226c2: e5 50 subi r30, 0x05 ; 5 226c4: fa 4f sbci r31, 0xFA ; 250 226c6: 18 16 cp r1, r24 226c8: c4 f5 brge .+112 ; 0x2273a { temp_runaway_status[_heater_id] = TempRunaway_PREHEAT; 226ca: 81 e0 ldi r24, 0x01 ; 1 226cc: 80 83 st Z, r24 temp_runaway_target[_heater_id] = _target_temperature; 226ce: 89 81 ldd r24, Y+1 ; 0x01 226d0: 9a 81 ldd r25, Y+2 ; 0x02 226d2: ab 81 ldd r26, Y+3 ; 0x03 226d4: bc 81 ldd r27, Y+4 ; 0x04 226d6: f5 01 movw r30, r10 226d8: 80 83 st Z, r24 226da: 91 83 std Z+1, r25 ; 0x01 226dc: a2 83 std Z+2, r26 ; 0x02 226de: b3 83 std Z+3, r27 ; 0x03 __preheat_start[_heater_id] = _current_temperature; 226e0: eb 85 ldd r30, Y+11 ; 0x0b 226e2: fc 85 ldd r31, Y+12 ; 0x0c 226e4: ed 50 subi r30, 0x0D ; 13 226e6: fa 4f sbci r31, 0xFA ; 250 226e8: 40 82 st Z, r4 226ea: 51 82 std Z+1, r5 ; 0x01 226ec: 62 82 std Z+2, r6 ; 0x02 226ee: 73 82 std Z+3, r7 ; 0x03 __preheat_counter[_heater_id] = 0; 226f0: f8 01 movw r30, r16 226f2: ef 50 subi r30, 0x0F ; 15 226f4: fa 4f sbci r31, 0xFA ; 250 226f6: 10 82 st Z, r1 temp_runaway_status[_heater_id] = TempRunaway_INACTIVE; temp_runaway_target[_heater_id] = _target_temperature; } } if ((_current_temperature < _target_temperature) && (temp_runaway_status[_heater_id] == TempRunaway_PREHEAT)) 226f8: a3 01 movw r20, r6 226fa: 92 01 movw r18, r4 226fc: bc 01 movw r22, r24 226fe: cd 01 movw r24, r26 22700: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 22704: 18 16 cp r1, r24 22706: 1c f5 brge .+70 ; 0x2274e { __preheat_counter[_heater_id]++; 22708: f8 01 movw r30, r16 2270a: ef 50 subi r30, 0x0F ; 15 2270c: fa 4f sbci r31, 0xFA ; 250 2270e: 80 81 ld r24, Z 22710: 8f 5f subi r24, 0xFF ; 255 22712: 80 83 st Z, r24 if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes 22714: 31 10 cpse r3, r1 22716: c7 c0 rjmp .+398 ; 0x228a6 22718: 89 30 cpi r24, 0x09 ; 9 2271a: c8 f0 brcs .+50 ; 0x2274e { __delta=2.0; 2271c: 81 2c mov r8, r1 2271e: 91 2c mov r9, r1 22720: a1 2c mov r10, r1 22722: 50 e4 ldi r21, 0x40 ; 64 22724: b5 2e mov r11, r21 22726: e8 c0 rjmp .+464 ; 0x228f8 #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; 22728: ad e2 ldi r26, 0x2D ; 45 2272a: b0 e0 ldi r27, 0x00 ; 0 2272c: ba 87 std Y+10, r27 ; 0x0a 2272e: a9 87 std Y+9, r26 ; 0x09 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 22730: 80 e0 ldi r24, 0x00 ; 0 22732: 90 e0 ldi r25, 0x00 ; 0 22734: a0 e7 ldi r26, 0x70 ; 112 22736: b1 e4 ldi r27, 0x41 ; 65 22738: 8a cf rjmp .-236 ; 0x2264e __preheat_start[_heater_id] = _current_temperature; __preheat_counter[_heater_id] = 0; } else { temp_runaway_status[_heater_id] = TempRunaway_INACTIVE; 2273a: 10 82 st Z, r1 temp_runaway_target[_heater_id] = _target_temperature; 2273c: 89 81 ldd r24, Y+1 ; 0x01 2273e: 9a 81 ldd r25, Y+2 ; 0x02 22740: ab 81 ldd r26, Y+3 ; 0x03 22742: bc 81 ldd r27, Y+4 ; 0x04 22744: f5 01 movw r30, r10 22746: 80 83 st Z, r24 22748: 91 83 std Z+1, r25 ; 0x01 2274a: a2 83 std Z+2, r26 ; 0x02 2274c: b3 83 std Z+3, r27 ; 0x03 __preheat_start[_heater_id] = _current_temperature; __preheat_counter[_heater_id] = 0; } } if ((_current_temperature > (_target_temperature - __hysteresis)) && temp_runaway_status[_heater_id] == TempRunaway_PREHEAT) 2274e: 2d 81 ldd r18, Y+5 ; 0x05 22750: 3e 81 ldd r19, Y+6 ; 0x06 22752: 4f 81 ldd r20, Y+7 ; 0x07 22754: 58 85 ldd r21, Y+8 ; 0x08 22756: 69 81 ldd r22, Y+1 ; 0x01 22758: 7a 81 ldd r23, Y+2 ; 0x02 2275a: 8b 81 ldd r24, Y+3 ; 0x03 2275c: 9c 81 ldd r25, Y+4 ; 0x04 2275e: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 22762: a3 01 movw r20, r6 22764: 92 01 movw r18, r4 22766: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 2276a: 87 ff sbrs r24, 7 2276c: 46 c0 rjmp .+140 ; 0x227fa 2276e: f8 01 movw r30, r16 22770: e5 50 subi r30, 0x05 ; 5 22772: fa 4f sbci r31, 0xFA ; 250 22774: 80 81 ld r24, Z 22776: 81 30 cpi r24, 0x01 ; 1 22778: 49 f4 brne .+18 ; 0x2278c { temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; 2277a: 82 e0 ldi r24, 0x02 ; 2 2277c: 80 83 st Z, r24 temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 2277e: f8 01 movw r30, r16 22780: ee 0f add r30, r30 22782: ff 1f adc r31, r31 22784: eb 5f subi r30, 0xFB ; 251 22786: f9 4f sbci r31, 0xF9 ; 249 22788: 11 82 std Z+1, r1 ; 0x01 2278a: 10 82 st Z, r1 } if (_output > 0) 2278c: 20 e0 ldi r18, 0x00 ; 0 2278e: 30 e0 ldi r19, 0x00 ; 0 22790: a9 01 movw r20, r18 22792: c7 01 movw r24, r14 22794: b6 01 movw r22, r12 22796: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 2279a: 18 16 cp r1, r24 2279c: bc f5 brge .+110 ; 0x2280c if (temp_runaway_check_active) { // we are in range if ((_current_temperature > (_target_temperature - __hysteresis)) && (_current_temperature < (_target_temperature + __hysteresis))) 2279e: 29 81 ldd r18, Y+1 ; 0x01 227a0: 3a 81 ldd r19, Y+2 ; 0x02 227a2: 4b 81 ldd r20, Y+3 ; 0x03 227a4: 5c 81 ldd r21, Y+4 ; 0x04 227a6: 6d 81 ldd r22, Y+5 ; 0x05 227a8: 7e 81 ldd r23, Y+6 ; 0x06 227aa: 8f 81 ldd r24, Y+7 ; 0x07 227ac: 98 85 ldd r25, Y+8 ; 0x08 227ae: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 227b2: a3 01 movw r20, r6 227b4: 92 01 movw r18, r4 227b6: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 227ba: 18 16 cp r1, r24 227bc: 0c f0 brlt .+2 ; 0x227c0 227be: 3f c0 rjmp .+126 ; 0x2283e { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 227c0: 00 0f add r16, r16 227c2: 11 1f adc r17, r17 227c4: f8 01 movw r30, r16 227c6: eb 5f subi r30, 0xFB ; 251 227c8: f9 4f sbci r31, 0xF9 ; 249 227ca: 11 82 std Z+1, r1 ; 0x01 227cc: 10 82 st Z, r1 227ce: 1e c0 rjmp .+60 ; 0x2280c temp_runaway_status[_heater_id] = TempRunaway_INACTIVE; temp_runaway_target[_heater_id] = _target_temperature; } } if ((_current_temperature < _target_temperature) && (temp_runaway_status[_heater_id] == TempRunaway_PREHEAT)) 227d0: a3 01 movw r20, r6 227d2: 92 01 movw r18, r4 227d4: 69 81 ldd r22, Y+1 ; 0x01 227d6: 7a 81 ldd r23, Y+2 ; 0x02 227d8: 8b 81 ldd r24, Y+3 ; 0x03 227da: 9c 81 ldd r25, Y+4 ; 0x04 227dc: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 227e0: 18 16 cp r1, r24 227e2: 0c f0 brlt .+2 ; 0x227e6 227e4: b4 cf rjmp .-152 ; 0x2274e 227e6: f8 01 movw r30, r16 227e8: e5 50 subi r30, 0x05 ; 5 227ea: fa 4f sbci r31, 0xFA ; 250 227ec: 80 81 ld r24, Z 227ee: 81 30 cpi r24, 0x01 ; 1 227f0: 09 f0 breq .+2 ; 0x227f4 227f2: ad cf rjmp .-166 ; 0x2274e 227f4: 89 cf rjmp .-238 ; 0x22708 if(_current_temperature>105.0) __delta=0.6; } if (_current_temperature - __preheat_start[_heater_id] < __delta) { __preheat_errors[_heater_id]++; } else { __preheat_errors[_heater_id] = 0; 227f6: 10 82 st Z, r1 227f8: 97 c0 rjmp .+302 ; 0x22928 temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } if (_output > 0) 227fa: 20 e0 ldi r18, 0x00 ; 0 227fc: 30 e0 ldi r19, 0x00 ; 0 227fe: a9 01 movw r20, r18 22800: c7 01 movw r24, r14 22802: b6 01 movw r22, r12 22804: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 22808: 18 16 cp r1, r24 2280a: cc f0 brlt .+50 ; 0x2283e } } } } } 2280c: 2c 96 adiw r28, 0x0c ; 12 2280e: 0f b6 in r0, 0x3f ; 63 22810: f8 94 cli 22812: de bf out 0x3e, r29 ; 62 22814: 0f be out 0x3f, r0 ; 63 22816: cd bf out 0x3d, r28 ; 61 22818: df 91 pop r29 2281a: cf 91 pop r28 2281c: 1f 91 pop r17 2281e: 0f 91 pop r16 22820: ff 90 pop r15 22822: ef 90 pop r14 22824: df 90 pop r13 22826: cf 90 pop r12 22828: bf 90 pop r11 2282a: af 90 pop r10 2282c: 9f 90 pop r9 2282e: 8f 90 pop r8 22830: 7f 90 pop r7 22832: 6f 90 pop r6 22834: 5f 90 pop r5 22836: 4f 90 pop r4 22838: 3f 90 pop r3 2283a: 2f 90 pop r2 2283c: 08 95 ret temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } else { if (temp_runaway_status[_heater_id] > TempRunaway_PREHEAT) 2283e: f8 01 movw r30, r16 22840: e5 50 subi r30, 0x05 ; 5 22842: fa 4f sbci r31, 0xFA ; 250 22844: 80 81 ld r24, Z 22846: 82 30 cpi r24, 0x02 ; 2 22848: 08 f3 brcs .-62 ; 0x2280c { temp_runaway_error_counter[_heater_id]++; 2284a: 00 0f add r16, r16 2284c: 11 1f adc r17, r17 2284e: f8 01 movw r30, r16 22850: eb 5f subi r30, 0xFB ; 251 22852: f9 4f sbci r31, 0xF9 ; 249 22854: 80 81 ld r24, Z 22856: 91 81 ldd r25, Z+1 ; 0x01 22858: 01 96 adiw r24, 0x01 ; 1 2285a: 91 83 std Z+1, r25 ; 0x01 2285c: 80 83 st Z, r24 if (temp_runaway_error_counter[_heater_id] * 2 > __timeout) 2285e: 88 0f add r24, r24 22860: 99 1f adc r25, r25 22862: e9 85 ldd r30, Y+9 ; 0x09 22864: fa 85 ldd r31, Y+10 ; 0x0a 22866: e8 17 cp r30, r24 22868: f9 07 cpc r31, r25 2286a: 80 f6 brcc .-96 ; 0x2280c set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::runaway); 2286c: 43 e0 ldi r20, 0x03 ; 3 2286e: 62 2d mov r22, r2 22870: 83 2d mov r24, r3 } } } } } 22872: 2c 96 adiw r28, 0x0c ; 12 22874: 0f b6 in r0, 0x3f ; 63 22876: f8 94 cli 22878: de bf out 0x3e, r29 ; 62 2287a: 0f be out 0x3f, r0 ; 63 2287c: cd bf out 0x3d, r28 ; 61 2287e: df 91 pop r29 22880: cf 91 pop r28 22882: 1f 91 pop r17 22884: 0f 91 pop r16 22886: ff 90 pop r15 22888: ef 90 pop r14 2288a: df 90 pop r13 2288c: cf 90 pop r12 2288e: bf 90 pop r11 22890: af 90 pop r10 22892: 9f 90 pop r9 22894: 8f 90 pop r8 22896: 7f 90 pop r7 22898: 6f 90 pop r6 2289a: 5f 90 pop r5 2289c: 4f 90 pop r4 2289e: 3f 90 pop r3 228a0: 2f 90 pop r2 { if (temp_runaway_status[_heater_id] > TempRunaway_PREHEAT) { temp_runaway_error_counter[_heater_id]++; if (temp_runaway_error_counter[_heater_id] * 2 > __timeout) set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::runaway); 228a2: 0d 94 7a 12 jmp 0x224f4 ; 0x224f4 } if ((_current_temperature < _target_temperature) && (temp_runaway_status[_heater_id] == TempRunaway_PREHEAT)) { __preheat_counter[_heater_id]++; if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes 228a6: 81 31 cpi r24, 0x11 ; 17 228a8: 08 f4 brcc .+2 ; 0x228ac 228aa: 51 cf rjmp .-350 ; 0x2274e { __delta=2.0; if(_isbed) { __delta=3.0; if(_current_temperature>90.0) __delta=2.0; 228ac: 20 e0 ldi r18, 0x00 ; 0 228ae: 30 e0 ldi r19, 0x00 ; 0 228b0: 44 eb ldi r20, 0xB4 ; 180 228b2: 52 e4 ldi r21, 0x42 ; 66 228b4: c3 01 movw r24, r6 228b6: b2 01 movw r22, r4 228b8: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes { __delta=2.0; if(_isbed) { __delta=3.0; 228bc: 81 2c mov r8, r1 228be: 91 2c mov r9, r1 228c0: e0 e4 ldi r30, 0x40 ; 64 228c2: ae 2e mov r10, r30 228c4: ba 2c mov r11, r10 if(_current_temperature>90.0) __delta=2.0; 228c6: 18 16 cp r1, r24 228c8: 2c f4 brge .+10 ; 0x228d4 228ca: 81 2c mov r8, r1 228cc: 91 2c mov r9, r1 228ce: a1 2c mov r10, r1 228d0: 70 e4 ldi r23, 0x40 ; 64 228d2: b7 2e mov r11, r23 if(_current_temperature>105.0) __delta=0.6; 228d4: 20 e0 ldi r18, 0x00 ; 0 228d6: 30 e0 ldi r19, 0x00 ; 0 228d8: 42 ed ldi r20, 0xD2 ; 210 228da: 52 e4 ldi r21, 0x42 ; 66 228dc: c3 01 movw r24, r6 228de: b2 01 movw r22, r4 228e0: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 228e4: 18 16 cp r1, r24 228e6: 44 f4 brge .+16 ; 0x228f8 228e8: 6a e9 ldi r22, 0x9A ; 154 228ea: 86 2e mov r8, r22 228ec: 69 e9 ldi r22, 0x99 ; 153 228ee: 96 2e mov r9, r22 228f0: 69 e1 ldi r22, 0x19 ; 25 228f2: a6 2e mov r10, r22 228f4: 6f e3 ldi r22, 0x3F ; 63 228f6: b6 2e mov r11, r22 } if (_current_temperature - __preheat_start[_heater_id] < __delta) { 228f8: eb 85 ldd r30, Y+11 ; 0x0b 228fa: fc 85 ldd r31, Y+12 ; 0x0c 228fc: ed 50 subi r30, 0x0D ; 13 228fe: fa 4f sbci r31, 0xFA ; 250 22900: 20 81 ld r18, Z 22902: 31 81 ldd r19, Z+1 ; 0x01 22904: 42 81 ldd r20, Z+2 ; 0x02 22906: 53 81 ldd r21, Z+3 ; 0x03 22908: c3 01 movw r24, r6 2290a: b2 01 movw r22, r4 2290c: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 22910: a5 01 movw r20, r10 22912: 94 01 movw r18, r8 22914: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 22918: f8 01 movw r30, r16 2291a: e1 51 subi r30, 0x11 ; 17 2291c: fa 4f sbci r31, 0xFA ; 250 2291e: 87 ff sbrs r24, 7 22920: 6a cf rjmp .-300 ; 0x227f6 __preheat_errors[_heater_id]++; 22922: 80 81 ld r24, Z 22924: 8f 5f subi r24, 0xFF ; 255 22926: 80 83 st Z, r24 } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 22928: 80 81 ld r24, Z 2292a: 90 e0 ldi r25, 0x00 ; 0 2292c: 31 10 cpse r3, r1 2292e: 04 c0 rjmp .+8 ; 0x22938 22930: 06 97 sbiw r24, 0x06 ; 6 22932: 4c f0 brlt .+18 ; 0x22946 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 22934: 80 e0 ldi r24, 0x00 ; 0 22936: 03 c0 rjmp .+6 ; 0x2293e __preheat_errors[_heater_id]++; } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 22938: 04 97 sbiw r24, 0x04 ; 4 2293a: 2c f0 brlt .+10 ; 0x22946 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 2293c: 81 e0 ldi r24, 0x01 ; 1 2293e: 42 e0 ldi r20, 0x02 ; 2 22940: 62 2d mov r22, r2 22942: 0f 94 7a 12 call 0x224f4 ; 0x224f4 __preheat_start[_heater_id] = _current_temperature; 22946: 2b 85 ldd r18, Y+11 ; 0x0b 22948: 3c 85 ldd r19, Y+12 ; 0x0c 2294a: 2d 50 subi r18, 0x0D ; 13 2294c: 3a 4f sbci r19, 0xFA ; 250 2294e: d9 01 movw r26, r18 22950: 4d 92 st X+, r4 22952: 5d 92 st X+, r5 22954: 6d 92 st X+, r6 22956: 7c 92 st X, r7 22958: 13 97 sbiw r26, 0x03 ; 3 __preheat_counter[_heater_id] = 0; 2295a: f8 01 movw r30, r16 2295c: ef 50 subi r30, 0x0F ; 15 2295e: fa 4f sbci r31, 0xFA ; 250 22960: 10 82 st Z, r1 22962: f5 ce rjmp .-534 ; 0x2274e 00022964 : //! @retval true firmware should do temperature compensation and allow calibration //! @retval false PINDA thermistor is not detected, disable temperature compensation and calibration //! @retval true/false when forced via LCD menu Settings->HW Setup->SuperPINDA //! bool has_temperature_compensation() { 22964: cf 93 push r28 #ifdef SUPERPINDA_SUPPORT #ifdef PINDA_TEMP_COMP uint8_t pinda_temp_compensation = eeprom_read_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION); 22966: 89 e2 ldi r24, 0x29 ; 41 22968: 9d e0 ldi r25, 0x0D ; 13 2296a: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 if (pinda_temp_compensation == EEPROM_EMPTY_VALUE) //Unkown PINDA temp compenstation, so check it. { #endif //PINDA_TEMP_COMP return (current_temperature_pinda >= PINDA_MINTEMP) ? true : false; 2296e: c1 e0 ldi r28, 0x01 ; 1 bool has_temperature_compensation() { #ifdef SUPERPINDA_SUPPORT #ifdef PINDA_TEMP_COMP uint8_t pinda_temp_compensation = eeprom_read_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION); if (pinda_temp_compensation == EEPROM_EMPTY_VALUE) //Unkown PINDA temp compenstation, so check it. 22970: 8f 3f cpi r24, 0xFF ; 255 22972: 91 f4 brne .+36 ; 0x22998 { #endif //PINDA_TEMP_COMP return (current_temperature_pinda >= PINDA_MINTEMP) ? true : false; 22974: 20 e0 ldi r18, 0x00 ; 0 22976: 30 e0 ldi r19, 0x00 ; 0 22978: 40 ef ldi r20, 0xF0 ; 240 2297a: 51 e4 ldi r21, 0x41 ; 65 2297c: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 22980: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 22984: 80 91 90 06 lds r24, 0x0690 ; 0x800690 22988: 90 91 91 06 lds r25, 0x0691 ; 0x800691 2298c: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 22990: 87 ff sbrs r24, 7 22992: 04 c0 rjmp .+8 ; 0x2299c #ifdef PINDA_TEMP_COMP } else if (pinda_temp_compensation == 0) return true; //Overwritten via LCD menu SuperPINDA [No] 22994: c0 e0 ldi r28, 0x00 ; 0 22996: 02 c0 rjmp .+4 ; 0x2299c 22998: 81 11 cpse r24, r1 2299a: fc cf rjmp .-8 ; 0x22994 else return false; //Overwritten via LCD menu SuperPINDA [YES] #endif //PINDA_TEMP_COMP #else return true; #endif } 2299c: 8c 2f mov r24, r28 2299e: cf 91 pop r28 229a0: 08 95 ret 000229a2 <__vector_14>: #ifdef SYSTEM_TIMER_2 ISR(TIMER2_COMPB_vect) #else //SYSTEM_TIMER_2 ISR(TIMER0_COMPB_vect) #endif //SYSTEM_TIMER_2 { 229a2: 1f 92 push r1 229a4: 0f 92 push r0 229a6: 0f b6 in r0, 0x3f ; 63 229a8: 0f 92 push r0 229aa: 11 24 eor r1, r1 229ac: 0b b6 in r0, 0x3b ; 59 229ae: 0f 92 push r0 229b0: ff 92 push r15 229b2: 0f 93 push r16 229b4: 1f 93 push r17 229b6: 2f 93 push r18 229b8: 3f 93 push r19 229ba: 4f 93 push r20 229bc: 5f 93 push r21 229be: 6f 93 push r22 229c0: 7f 93 push r23 229c2: 8f 93 push r24 229c4: 9f 93 push r25 229c6: af 93 push r26 229c8: bf 93 push r27 229ca: cf 93 push r28 229cc: df 93 push r29 229ce: ef 93 push r30 229d0: ff 93 push r31 DISABLE_SOFT_PWM_INTERRUPT(); 229d2: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 229d6: 8b 7f andi r24, 0xFB ; 251 229d8: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> #if !defined(__DOXYGEN__) /* Internal helper functions. */ static __inline__ uint8_t __iSeiRetVal(void) { sei(); 229dc: 78 94 sei // Only update flags, but do not perform any menu/lcd operation! void lcd_buttons_update(void) { static uint8_t lcd_long_press_active = 0; static uint8_t lcd_button_pressed = 0; if (READ(BTN_ENC) == 0) 229de: 48 99 sbic 0x09, 0 ; 9 229e0: c6 c0 rjmp .+396 ; 0x22b6e <__vector_14+0x1cc> { //button is pressed if (buttonBlanking.expired_cont(BUTTON_BLANKING_TIME)) { 229e2: 68 ec ldi r22, 0xC8 ; 200 229e4: 70 e0 ldi r23, 0x00 ; 0 229e6: 8f e1 ldi r24, 0x1F ; 31 229e8: 96 e0 ldi r25, 0x06 ; 6 229ea: 0f 94 cf 0f call 0x21f9e ; 0x21f9e ::expired_cont(unsigned short)> 229ee: 88 23 and r24, r24 229f0: b9 f0 breq .+46 ; 0x22a20 <__vector_14+0x7e> buttonBlanking.start(); 229f2: 8f e1 ldi r24, 0x1F ; 31 229f4: 96 e0 ldi r25, 0x06 ; 6 229f6: 0f 94 d6 0f call 0x21fac ; 0x21fac ::start()> safetyTimer.start(); 229fa: 8a e1 ldi r24, 0x1A ; 26 229fc: 96 e0 ldi r25, 0x06 ; 6 229fe: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) 22a02: 80 91 19 06 lds r24, 0x0619 ; 0x800619 22a06: 81 11 cpse r24, r1 22a08: a3 c0 rjmp .+326 ; 0x22b50 <__vector_14+0x1ae> 22a0a: 80 91 18 06 lds r24, 0x0618 ; 0x800618 22a0e: 81 11 cpse r24, r1 22a10: 9f c0 rjmp .+318 ; 0x22b50 <__vector_14+0x1ae> { longPressTimer.start(); 22a12: 85 e1 ldi r24, 0x15 ; 21 22a14: 96 e0 ldi r25, 0x06 ; 6 22a16: 0f 94 d6 0f call 0x21fac ; 0x21fac ::start()> lcd_button_pressed = 1; 22a1a: 81 e0 ldi r24, 0x01 ; 1 22a1c: 80 93 19 06 sts 0x0619, r24 ; 0x800619 -2, 1, -1, 0, }; static uint8_t enc_bits_old = 0; uint8_t enc_bits = 0; if (!READ(BTN_EN1)) enc_bits |= _BV(0); 22a20: 8c b1 in r24, 0x0c ; 12 22a22: 80 95 com r24 22a24: 88 1f adc r24, r24 22a26: 88 27 eor r24, r24 22a28: 88 1f adc r24, r24 if (!READ(BTN_EN2)) enc_bits |= _BV(1); 22a2a: 90 91 03 01 lds r25, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 22a2e: 93 ff sbrs r25, 3 22a30: 82 60 ori r24, 0x02 ; 2 if (enc_bits != enc_bits_old) 22a32: e0 91 12 06 lds r30, 0x0612 ; 0x800612 22a36: e8 17 cp r30, r24 22a38: e1 f0 breq .+56 ; 0x22a72 <__vector_14+0xd0> { int8_t newDiff = pgm_read_byte(&encrot_table[(enc_bits_old << 2) | enc_bits]); 22a3a: 24 e0 ldi r18, 0x04 ; 4 22a3c: e2 9f mul r30, r18 22a3e: f0 01 movw r30, r0 22a40: 11 24 eor r1, r1 22a42: e8 2b or r30, r24 22a44: ea 58 subi r30, 0x8A ; 138 22a46: fb 46 sbci r31, 0x6B ; 107 22a48: e4 91 lpm r30, Z lcd_encoder_diff += newDiff; 22a4a: 90 91 11 06 lds r25, 0x0611 ; 0x800611 <_ZL16lcd_encoder_diff.lto_priv.504> 22a4e: e9 0f add r30, r25 22a50: e0 93 11 06 sts 0x0611, r30 ; 0x800611 <_ZL16lcd_encoder_diff.lto_priv.504> if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 22a54: 0e 2e mov r0, r30 22a56: 00 0c add r0, r0 22a58: ff 0b sbc r31, r31 22a5a: f7 ff sbrs r31, 7 22a5c: 03 c0 rjmp .+6 ; 0x22a64 <__vector_14+0xc2> 22a5e: f1 95 neg r31 22a60: e1 95 neg r30 22a62: f1 09 sbc r31, r1 22a64: 34 97 sbiw r30, 0x04 ; 4 22a66: 1c f0 brlt .+6 ; 0x22a6e <__vector_14+0xcc> lcd_backlight_wake_trigger = true; // flag event, knob rotated 22a68: 91 e0 ldi r25, 0x01 ; 1 22a6a: 90 93 13 06 sts 0x0613, r25 ; 0x800613 <_ZL26lcd_backlight_wake_trigger.lto_priv.503> } enc_bits_old = enc_bits; 22a6e: 80 93 12 06 sts 0x0612, r24 ; 0x800612 #ifndef SLOW_PWM_HEATERS /* * standard PWM modulation */ if (pwm_count == 0) 22a72: 80 91 70 02 lds r24, 0x0270 ; 0x800270 22a76: 81 11 cpse r24, r1 22a78: 08 c0 rjmp .+16 ; 0x22a8a <__vector_14+0xe8> { soft_pwm_0 = soft_pwm[0]; 22a7a: 80 91 62 06 lds r24, 0x0662 ; 0x800662 <_ZL8soft_pwm.lto_priv.506> 22a7e: 80 93 28 06 sts 0x0628, r24 ; 0x800628 if(soft_pwm_0 > 0) 22a82: 88 23 and r24, r24 22a84: 09 f4 brne .+2 ; 0x22a88 <__vector_14+0xe6> 22a86: 87 c0 rjmp .+270 ; 0x22b96 <__vector_14+0x1f4> { WRITE(HEATER_0_PIN,1); 22a88: 75 9a sbi 0x0e, 5 ; 14 #endif } else WRITE(HEATER_0_PIN,0); } #ifdef FAN_SOFT_PWM if ((pwm_count & ((1 << FAN_SOFT_PWM_BITS) - 1)) == 0) 22a8a: 80 91 70 02 lds r24, 0x0270 ; 0x800270 22a8e: 8f 70 andi r24, 0x0F ; 15 22a90: a9 f4 brne .+42 ; 0x22abc <__vector_14+0x11a> { soft_pwm_fan = fanSpeedSoftPwm / (1 << (8 - FAN_SOFT_PWM_BITS)); 22a92: 80 91 05 05 lds r24, 0x0505 ; 0x800505 22a96: 90 e0 ldi r25, 0x00 ; 0 22a98: 24 e0 ldi r18, 0x04 ; 4 22a9a: 95 95 asr r25 22a9c: 87 95 ror r24 22a9e: 2a 95 dec r18 22aa0: e1 f7 brne .-8 ; 0x22a9a <__vector_14+0xf8> 22aa2: 80 93 dd 03 sts 0x03DD, r24 ; 0x8003dd <_ZL12soft_pwm_fan.lto_priv.434> if(soft_pwm_fan > 0) WRITE(FAN_PIN,1); else WRITE(FAN_PIN,0); 22aa6: 89 2b or r24, r25 22aa8: 09 f4 brne .+2 ; 0x22aac <__vector_14+0x10a> 22aaa: 77 c0 rjmp .+238 ; 0x22b9a <__vector_14+0x1f8> 22aac: 9f b7 in r25, 0x3f ; 63 22aae: f8 94 cli 22ab0: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22ab4: 88 60 ori r24, 0x08 ; 8 22ab6: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22aba: 9f bf out 0x3f, r25 ; 63 } #endif if(soft_pwm_0 < pwm_count) 22abc: 90 91 28 06 lds r25, 0x0628 ; 0x800628 22ac0: 80 91 70 02 lds r24, 0x0270 ; 0x800270 22ac4: 98 17 cp r25, r24 22ac6: 08 f4 brcc .+2 ; 0x22aca <__vector_14+0x128> { WRITE(HEATER_0_PIN,0); 22ac8: 75 98 cbi 0x0e, 5 ; 14 WRITE(HEATER_1_PIN,0); #endif } #ifdef FAN_SOFT_PWM if (soft_pwm_fan < (pwm_count & ((1 << FAN_SOFT_PWM_BITS) - 1))) WRITE(FAN_PIN,0); 22aca: 80 91 70 02 lds r24, 0x0270 ; 0x800270 22ace: 8f 70 andi r24, 0x0F ; 15 22ad0: 90 91 dd 03 lds r25, 0x03DD ; 0x8003dd <_ZL12soft_pwm_fan.lto_priv.434> 22ad4: 98 17 cp r25, r24 22ad6: 40 f4 brcc .+16 ; 0x22ae8 <__vector_14+0x146> 22ad8: 9f b7 in r25, 0x3f ; 63 22ada: f8 94 cli 22adc: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22ae0: 87 7f andi r24, 0xF7 ; 247 22ae2: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22ae6: 9f bf out 0x3f, r25 ; 63 #endif pwm_count += (1 << SOFT_PWM_SCALE); 22ae8: 80 91 70 02 lds r24, 0x0270 ; 0x800270 22aec: 8f 5f subi r24, 0xFF ; 255 pwm_count &= 0x7f; 22aee: 8f 77 andi r24, 0x7F ; 127 22af0: 80 93 70 02 sts 0x0270, r24 ; 0x800270 22af4: 10 e0 ldi r17, 0x00 ; 0 22af6: 00 e0 ldi r16, 0x00 ; 0 #ifdef BABYSTEPPING FORCE_INLINE static void applyBabysteps() { for(uint8_t axis=0;axis<3;axis++) { int curTodo=babystepsTodo[axis]; //get rid of volatile for performance 22af8: e8 01 movw r28, r16 22afa: cc 0f add r28, r28 22afc: dd 1f adc r29, r29 22afe: c8 57 subi r28, 0x78 ; 120 22b00: d9 4f sbci r29, 0xF9 ; 249 22b02: 88 81 ld r24, Y 22b04: 99 81 ldd r25, Y+1 ; 0x01 if(curTodo>0) 22b06: 18 16 cp r1, r24 22b08: 19 06 cpc r1, r25 22b0a: 0c f0 brlt .+2 ; 0x22b0e <__vector_14+0x16c> 22b0c: 4c c0 rjmp .+152 ; 0x22ba6 <__vector_14+0x204> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 22b0e: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 22b10: f8 94 cli babystep(axis,/*fwd*/true); 22b12: 61 e0 ldi r22, 0x01 ; 1 22b14: 80 2f mov r24, r16 22b16: 0e 94 3c fb call 0x1f678 ; 0x1f678 babystepsTodo[axis]--; //less to do next time 22b1a: 88 81 ld r24, Y 22b1c: 99 81 ldd r25, Y+1 ; 0x01 22b1e: 01 97 sbiw r24, 0x01 ; 1 else if(curTodo<0) { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { babystep(axis,/*fwd*/false); babystepsTodo[axis]++; //less to do next time 22b20: 99 83 std Y+1, r25 ; 0x01 22b22: 88 83 st Y, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 22b24: ff be out 0x3f, r15 ; 63 __asm__ volatile ("" ::: "memory"); 22b26: 0f 5f subi r16, 0xFF ; 255 22b28: 1f 4f sbci r17, 0xFF ; 255 } #endif #ifdef BABYSTEPPING FORCE_INLINE static void applyBabysteps() { for(uint8_t axis=0;axis<3;axis++) 22b2a: 03 30 cpi r16, 0x03 ; 3 22b2c: 11 05 cpc r17, r1 22b2e: 21 f7 brne .-56 ; 0x22af8 <__vector_14+0x156> #ifdef BABYSTEPPING applyBabysteps(); #endif //BABYSTEPPING // Check if a stack overflow happened if (!SdFatUtil::test_stack_integrity()) stack_error(); 22b30: 80 91 24 17 lds r24, 0x1724 ; 0x801724 <__bss_end+0x20> 22b34: 90 91 25 17 lds r25, 0x1725 ; 0x801725 <__bss_end+0x21> 22b38: a0 91 26 17 lds r26, 0x1726 ; 0x801726 <__bss_end+0x22> 22b3c: b0 91 27 17 lds r27, 0x1727 ; 0x801727 <__bss_end+0x23> 22b40: 82 3a cpi r24, 0xA2 ; 162 22b42: 92 4a sbci r25, 0xA2 ; 162 22b44: a1 05 cpc r26, r1 22b46: b1 05 cpc r27, r1 22b48: d9 f1 breq .+118 ; 0x22bc0 <__vector_14+0x21e> crash_and_burn(dump_crash_reason::bad_isr); } #endif //EMERGENCY_HANDLERS void stack_error() { crash_and_burn(dump_crash_reason::stack_error); 22b4a: 81 e0 ldi r24, 0x01 ; 1 22b4c: 0e 94 ab 74 call 0xe956 ; 0xe956 if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) { longPressTimer.start(); lcd_button_pressed = 1; } else if (longPressTimer.expired(LONG_PRESS_TIME)) 22b50: 68 ee ldi r22, 0xE8 ; 232 22b52: 73 e0 ldi r23, 0x03 ; 3 22b54: 85 e1 ldi r24, 0x15 ; 21 22b56: 96 e0 ldi r25, 0x06 ; 6 22b58: 0f 94 a7 0f call 0x21f4e ; 0x21f4e ::expired(unsigned short)> 22b5c: 88 23 and r24, r24 22b5e: 09 f4 brne .+2 ; 0x22b62 <__vector_14+0x1c0> 22b60: 5f cf rjmp .-322 ; 0x22a20 <__vector_14+0x7e> { lcd_long_press_active = 1; 22b62: 81 e0 ldi r24, 0x01 ; 1 22b64: 80 93 18 06 sts 0x0618, r24 ; 0x800618 lcd_longpress_trigger = 1; 22b68: 80 93 14 06 sts 0x0614, r24 ; 0x800614 22b6c: 59 cf rjmp .-334 ; 0x22a20 <__vector_14+0x7e> } } } else { //button not pressed if (lcd_button_pressed) 22b6e: 80 91 19 06 lds r24, 0x0619 ; 0x800619 22b72: 88 23 and r24, r24 22b74: 09 f4 brne .+2 ; 0x22b78 <__vector_14+0x1d6> 22b76: 54 cf rjmp .-344 ; 0x22a20 <__vector_14+0x7e> { //button was released lcd_button_pressed = 0; // Reset to prevent double triggering 22b78: 10 92 19 06 sts 0x0619, r1 ; 0x800619 if (!lcd_long_press_active) 22b7c: 80 91 18 06 lds r24, 0x0618 ; 0x800618 22b80: 81 11 cpse r24, r1 22b82: 03 c0 rjmp .+6 ; 0x22b8a <__vector_14+0x1e8> { //button released before long press gets activated lcd_click_trigger = 1; // This flag is reset when the event is consumed 22b84: 81 e0 ldi r24, 0x01 ; 1 22b86: 80 93 63 03 sts 0x0363, r24 ; 0x800363 } lcd_backlight_wake_trigger = true; // flag event, knob pressed 22b8a: 81 e0 ldi r24, 0x01 ; 1 22b8c: 80 93 13 06 sts 0x0613, r24 ; 0x800613 <_ZL26lcd_backlight_wake_trigger.lto_priv.503> lcd_long_press_active = 0; 22b90: 10 92 18 06 sts 0x0618, r1 ; 0x800618 22b94: 45 cf rjmp .-374 ; 0x22a20 <__vector_14+0x7e> { WRITE(HEATER_0_PIN,1); #ifdef HEATERS_PARALLEL WRITE(HEATER_1_PIN,1); #endif } else WRITE(HEATER_0_PIN,0); 22b96: 75 98 cbi 0x0e, 5 ; 14 22b98: 78 cf rjmp .-272 ; 0x22a8a <__vector_14+0xe8> #ifdef FAN_SOFT_PWM if ((pwm_count & ((1 << FAN_SOFT_PWM_BITS) - 1)) == 0) { soft_pwm_fan = fanSpeedSoftPwm / (1 << (8 - FAN_SOFT_PWM_BITS)); if(soft_pwm_fan > 0) WRITE(FAN_PIN,1); else WRITE(FAN_PIN,0); 22b9a: 9f b7 in r25, 0x3f ; 63 22b9c: f8 94 cli 22b9e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22ba2: 87 7f andi r24, 0xF7 ; 247 22ba4: 88 cf rjmp .-240 ; 0x22ab6 <__vector_14+0x114> babystep(axis,/*fwd*/true); babystepsTodo[axis]--; //less to do next time } } else if(curTodo<0) 22ba6: 89 2b or r24, r25 22ba8: 09 f4 brne .+2 ; 0x22bac <__vector_14+0x20a> 22baa: bd cf rjmp .-134 ; 0x22b26 <__vector_14+0x184> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 22bac: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 22bae: f8 94 cli babystep(axis,/*fwd*/false); 22bb0: 60 e0 ldi r22, 0x00 ; 0 22bb2: 80 2f mov r24, r16 22bb4: 0e 94 3c fb call 0x1f678 ; 0x1f678 babystepsTodo[axis]++; //less to do next time 22bb8: 88 81 ld r24, Y 22bba: 99 81 ldd r25, Y+1 ; 0x01 22bbc: 01 96 adiw r24, 0x01 ; 1 22bbe: b0 cf rjmp .-160 ; 0x22b20 <__vector_14+0x17e> #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1)) void readFanTach() { static bool fan_state[2]; #ifdef FAN_SOFT_PWM if (READ(TACH_0) != fan_state[0]) { 22bc0: 96 b1 in r25, 0x06 ; 6 22bc2: 80 91 26 06 lds r24, 0x0626 ; 0x800626 22bc6: 99 1f adc r25, r25 22bc8: 99 27 eor r25, r25 22bca: 99 1f adc r25, r25 22bcc: 98 17 cp r25, r24 22bce: 91 f0 breq .+36 ; 0x22bf4 <__vector_14+0x252> if(fan_measuring) fan_edge_counter[0] ++; 22bd0: 90 91 84 03 lds r25, 0x0384 ; 0x800384 22bd4: 99 23 and r25, r25 22bd6: 51 f0 breq .+20 ; 0x22bec <__vector_14+0x24a> 22bd8: 20 91 22 06 lds r18, 0x0622 ; 0x800622 22bdc: 30 91 23 06 lds r19, 0x0623 ; 0x800623 22be0: 2f 5f subi r18, 0xFF ; 255 22be2: 3f 4f sbci r19, 0xFF ; 255 22be4: 30 93 23 06 sts 0x0623, r19 ; 0x800623 22be8: 20 93 22 06 sts 0x0622, r18 ; 0x800622 fan_state[0] = !fan_state[0]; 22bec: 91 e0 ldi r25, 0x01 ; 1 22bee: 89 27 eor r24, r25 22bf0: 80 93 26 06 sts 0x0626, r24 ; 0x800626 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 22bf4: f8 94 cli { DISABLE_SOFT_PWM_INTERRUPT(); NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { soft_pwm_isr(); } ENABLE_SOFT_PWM_INTERRUPT(); 22bf6: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 22bfa: 84 60 ori r24, 0x04 ; 4 22bfc: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> } 22c00: ff 91 pop r31 22c02: ef 91 pop r30 22c04: df 91 pop r29 22c06: cf 91 pop r28 22c08: bf 91 pop r27 22c0a: af 91 pop r26 22c0c: 9f 91 pop r25 22c0e: 8f 91 pop r24 22c10: 7f 91 pop r23 22c12: 6f 91 pop r22 22c14: 5f 91 pop r21 22c16: 4f 91 pop r20 22c18: 3f 91 pop r19 22c1a: 2f 91 pop r18 22c1c: 1f 91 pop r17 22c1e: 0f 91 pop r16 22c20: ff 90 pop r15 22c22: 0f 90 pop r0 22c24: 0b be out 0x3b, r0 ; 59 22c26: 0f 90 pop r0 22c28: 0f be out 0x3f, r0 ; 63 22c2a: 0f 90 pop r0 22c2c: 1f 90 pop r1 22c2e: 18 95 reti 00022c30 : return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET; } // Derived from RepRap FiveD extruder::getTemperature() // For bed temperature measurement. static float analog2tempBed(int raw) { 22c30: 4f 92 push r4 22c32: 5f 92 push r5 22c34: 6f 92 push r6 22c36: 7f 92 push r7 22c38: af 92 push r10 22c3a: bf 92 push r11 22c3c: cf 92 push r12 22c3e: df 92 push r13 22c40: ef 92 push r14 22c42: ff 92 push r15 22c44: 0f 93 push r16 22c46: 1f 93 push r17 22c48: cf 93 push r28 22c4a: df 93 push r29 22c4c: 24 e0 ldi r18, 0x04 ; 4 22c4e: 30 e0 ldi r19, 0x00 ; 0 22c50: 41 e0 ldi r20, 0x01 ; 1 22c52: 50 e0 ldi r21, 0x00 ; 0 22c54: d9 01 movw r26, r18 22c56: a4 56 subi r26, 0x64 ; 100 22c58: bd 46 sbci r27, 0x6D ; 109 float celsius = 0; byte i; for (i=1; i raw) 22c5a: fd 01 movw r30, r26 22c5c: 65 91 lpm r22, Z+ 22c5e: 74 91 lpm r23, Z 22c60: 86 17 cp r24, r22 22c62: 97 07 cpc r25, r23 22c64: 0c f0 brlt .+2 ; 0x22c68 22c66: 80 c0 rjmp .+256 ; 0x22d68 { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 22c68: 41 50 subi r20, 0x01 ; 1 22c6a: 51 09 sbc r21, r1 22c6c: 44 0f add r20, r20 22c6e: 55 1f adc r21, r21 22c70: 44 0f add r20, r20 22c72: 55 1f adc r21, r21 22c74: 8a 01 movw r16, r20 22c76: 02 56 subi r16, 0x62 ; 98 22c78: 1d 46 sbci r17, 0x6D ; 109 22c7a: f8 01 movw r30, r16 22c7c: c5 90 lpm r12, Z+ 22c7e: d4 90 lpm r13, Z (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * 22c80: 44 56 subi r20, 0x64 ; 100 22c82: 5d 46 sbci r21, 0x6D ; 109 22c84: fa 01 movw r30, r20 22c86: 65 91 lpm r22, Z+ 22c88: 74 91 lpm r23, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 22c8a: f9 01 movw r30, r18 22c8c: e2 56 subi r30, 0x62 ; 98 22c8e: fd 46 sbci r31, 0x6D ; 109 22c90: c5 91 lpm r28, Z+ 22c92: d4 91 lpm r29, Z 22c94: f8 01 movw r30, r16 22c96: 05 91 lpm r16, Z+ 22c98: 14 91 lpm r17, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][0]) - PGM_RD_W(BEDTEMPTABLE[i-1][0])); 22c9a: fd 01 movw r30, r26 22c9c: e5 90 lpm r14, Z+ 22c9e: f4 90 lpm r15, Z 22ca0: fa 01 movw r30, r20 22ca2: a5 90 lpm r10, Z+ 22ca4: b4 90 lpm r11, Z for (i=1; i raw) { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * 22ca6: 86 1b sub r24, r22 22ca8: 97 0b sbc r25, r23 22caa: bc 01 movw r22, r24 22cac: 99 0f add r25, r25 22cae: 88 0b sbc r24, r24 22cb0: 99 0b sbc r25, r25 22cb2: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 22cb6: 2b 01 movw r4, r22 22cb8: 3c 01 movw r6, r24 (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 22cba: be 01 movw r22, r28 22cbc: 60 1b sub r22, r16 22cbe: 71 0b sbc r23, r17 22cc0: 07 2e mov r0, r23 22cc2: 00 0c add r0, r0 22cc4: 88 0b sbc r24, r24 22cc6: 99 0b sbc r25, r25 22cc8: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 22ccc: 9b 01 movw r18, r22 22cce: ac 01 movw r20, r24 for (i=1; i raw) { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * 22cd0: c3 01 movw r24, r6 22cd2: b2 01 movw r22, r4 22cd4: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 22cd8: 2b 01 movw r4, r22 22cda: 3c 01 movw r6, r24 (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / (float)(PGM_RD_W(BEDTEMPTABLE[i][0]) - PGM_RD_W(BEDTEMPTABLE[i-1][0])); 22cdc: b7 01 movw r22, r14 22cde: 6a 19 sub r22, r10 22ce0: 7b 09 sbc r23, r11 22ce2: 07 2e mov r0, r23 22ce4: 00 0c add r0, r0 22ce6: 88 0b sbc r24, r24 22ce8: 99 0b sbc r25, r25 22cea: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 22cee: 9b 01 movw r18, r22 22cf0: ac 01 movw r20, r24 { if (PGM_RD_W(BEDTEMPTABLE[i][0]) > raw) { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 22cf2: c3 01 movw r24, r6 22cf4: b2 01 movw r22, r4 22cf6: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 22cfa: 2b 01 movw r4, r22 22cfc: 3c 01 movw r6, r24 for (i=1; i raw) { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 22cfe: b6 01 movw r22, r12 22d00: dd 0c add r13, r13 22d02: 88 0b sbc r24, r24 22d04: 99 0b sbc r25, r25 22d06: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 22d0a: 9b 01 movw r18, r22 22d0c: ac 01 movw r20, r24 22d0e: c3 01 movw r24, r6 22d10: b2 01 movw r22, r4 22d12: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 22d16: 6b 01 movw r12, r22 22d18: 7c 01 movw r14, r24 float _offset_start = BED_OFFSET_START; float _first_koef = (_offset / 2) / (_offset_center - _offset_start); float _second_koef = (_offset / 2) / (100 - _offset_center); if (celsius >= _offset_start && celsius <= _offset_center) 22d1a: 20 e0 ldi r18, 0x00 ; 0 22d1c: 30 e0 ldi r19, 0x00 ; 0 22d1e: 40 e2 ldi r20, 0x20 ; 32 22d20: 52 e4 ldi r21, 0x42 ; 66 22d22: c7 01 movw r24, r14 22d24: b6 01 movw r22, r12 22d26: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 22d2a: 87 fd sbrc r24, 7 22d2c: 30 c0 rjmp .+96 ; 0x22d8e 22d2e: 20 e0 ldi r18, 0x00 ; 0 22d30: 30 e0 ldi r19, 0x00 ; 0 22d32: 48 e4 ldi r20, 0x48 ; 72 22d34: 52 e4 ldi r21, 0x42 ; 66 22d36: c7 01 movw r24, r14 22d38: b6 01 movw r22, r12 22d3a: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 22d3e: 18 16 cp r1, r24 22d40: 34 f1 brlt .+76 ; 0x22d8e { celsius = celsius + (_first_koef * (celsius - _offset_start)); 22d42: 20 e0 ldi r18, 0x00 ; 0 22d44: 30 e0 ldi r19, 0x00 ; 0 22d46: 40 e2 ldi r20, 0x20 ; 32 22d48: 52 e4 ldi r21, 0x42 ; 66 22d4a: c7 01 movw r24, r14 22d4c: b6 01 movw r22, r12 22d4e: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 22d52: 20 e0 ldi r18, 0x00 ; 0 22d54: 30 e0 ldi r19, 0x00 ; 0 22d56: 40 e0 ldi r20, 0x00 ; 0 22d58: 5f e3 ldi r21, 0x3F ; 63 22d5a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 22d5e: 9b 01 movw r18, r22 22d60: ac 01 movw r20, r24 { celsius = celsius + (_first_koef * (_offset_center - _offset_start)) + ( _second_koef * ( celsius - ( 100 - _offset_center ) )) ; } else if (celsius > 100) { celsius = celsius + _offset; 22d62: c7 01 movw r24, r14 22d64: b6 01 movw r22, r12 22d66: 43 c0 rjmp .+134 ; 0x22dee 22d68: 4f 5f subi r20, 0xFF ; 255 22d6a: 5f 4f sbci r21, 0xFF ; 255 22d6c: 2c 5f subi r18, 0xFC ; 252 22d6e: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempBed(int raw) { #ifdef BED_USES_THERMISTOR float celsius = 0; byte i; for (i=1; i 22d76: 6e cf rjmp .-292 ; 0x22c54 break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 22d78: ee e8 ldi r30, 0x8E ; 142 22d7a: f3 e9 ldi r31, 0x93 ; 147 22d7c: 65 91 lpm r22, Z+ 22d7e: 74 91 lpm r23, Z 22d80: 07 2e mov r0, r23 22d82: 00 0c add r0, r0 22d84: 88 0b sbc r24, r24 22d86: 99 0b sbc r25, r25 22d88: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 22d8c: c4 cf rjmp .-120 ; 0x22d16 if (celsius >= _offset_start && celsius <= _offset_center) { celsius = celsius + (_first_koef * (celsius - _offset_start)); } else if (celsius > _offset_center && celsius <= 100) 22d8e: 20 e0 ldi r18, 0x00 ; 0 22d90: 30 e0 ldi r19, 0x00 ; 0 22d92: 48 e4 ldi r20, 0x48 ; 72 22d94: 52 e4 ldi r21, 0x42 ; 66 22d96: c7 01 movw r24, r14 22d98: b6 01 movw r22, r12 22d9a: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 22d9e: 18 16 cp r1, r24 22da0: dc f5 brge .+118 ; 0x22e18 22da2: 20 e0 ldi r18, 0x00 ; 0 22da4: 30 e0 ldi r19, 0x00 ; 0 22da6: 48 ec ldi r20, 0xC8 ; 200 22da8: 52 e4 ldi r21, 0x42 ; 66 22daa: c7 01 movw r24, r14 22dac: b6 01 movw r22, r12 22dae: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 22db2: 18 16 cp r1, r24 22db4: 8c f1 brlt .+98 ; 0x22e18 { celsius = celsius + (_first_koef * (_offset_center - _offset_start)) + ( _second_koef * ( celsius - ( 100 - _offset_center ) )) ; 22db6: 20 e0 ldi r18, 0x00 ; 0 22db8: 30 e0 ldi r19, 0x00 ; 0 22dba: 40 ea ldi r20, 0xA0 ; 160 22dbc: 50 e4 ldi r21, 0x40 ; 64 22dbe: c7 01 movw r24, r14 22dc0: b6 01 movw r22, r12 22dc2: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 22dc6: 2b 01 movw r4, r22 22dc8: 3c 01 movw r6, r24 22dca: 20 e0 ldi r18, 0x00 ; 0 22dcc: 30 e0 ldi r19, 0x00 ; 0 22dce: 48 e4 ldi r20, 0x48 ; 72 22dd0: 52 e4 ldi r21, 0x42 ; 66 22dd2: c7 01 movw r24, r14 22dd4: b6 01 movw r22, r12 22dd6: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 22dda: 2d ec ldi r18, 0xCD ; 205 22ddc: 3c ec ldi r19, 0xCC ; 204 22dde: 4c ec ldi r20, 0xCC ; 204 22de0: 5d e3 ldi r21, 0x3D ; 61 22de2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 22de6: 9b 01 movw r18, r22 22de8: ac 01 movw r20, r24 22dea: c3 01 movw r24, r6 22dec: b2 01 movw r22, r4 } else if (celsius > 100) { celsius = celsius + _offset; 22dee: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 22df2: 6b 01 movw r12, r22 22df4: 7c 01 movw r14, r24 #elif defined BED_USES_AD595 return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET; #else return 0; #endif } 22df6: c7 01 movw r24, r14 22df8: b6 01 movw r22, r12 22dfa: df 91 pop r29 22dfc: cf 91 pop r28 22dfe: 1f 91 pop r17 22e00: 0f 91 pop r16 22e02: ff 90 pop r15 22e04: ef 90 pop r14 22e06: df 90 pop r13 22e08: cf 90 pop r12 22e0a: bf 90 pop r11 22e0c: af 90 pop r10 22e0e: 7f 90 pop r7 22e10: 6f 90 pop r6 22e12: 5f 90 pop r5 22e14: 4f 90 pop r4 22e16: 08 95 ret } else if (celsius > _offset_center && celsius <= 100) { celsius = celsius + (_first_koef * (_offset_center - _offset_start)) + ( _second_koef * ( celsius - ( 100 - _offset_center ) )) ; } else if (celsius > 100) 22e18: 20 e0 ldi r18, 0x00 ; 0 22e1a: 30 e0 ldi r19, 0x00 ; 0 22e1c: 48 ec ldi r20, 0xC8 ; 200 22e1e: 52 e4 ldi r21, 0x42 ; 66 22e20: c7 01 movw r24, r14 22e22: b6 01 movw r22, r12 22e24: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 22e28: 18 16 cp r1, r24 22e2a: 2c f7 brge .-54 ; 0x22df6 { celsius = celsius + _offset; 22e2c: 20 e0 ldi r18, 0x00 ; 0 22e2e: 30 e0 ldi r19, 0x00 ; 0 22e30: 40 e2 ldi r20, 0x20 ; 32 22e32: 51 e4 ldi r21, 0x41 ; 65 22e34: 96 cf rjmp .-212 ; 0x22d62 00022e36 <__vector_32>: if (pid_tuning_finished) temp_mgr_pid(); } ISR(TIMERx_COMPA_vect) { 22e36: 1f 92 push r1 22e38: 0f 92 push r0 22e3a: 0f b6 in r0, 0x3f ; 63 22e3c: 0f 92 push r0 22e3e: 11 24 eor r1, r1 22e40: 0b b6 in r0, 0x3b ; 59 22e42: 0f 92 push r0 22e44: 4f 92 push r4 22e46: 5f 92 push r5 22e48: 6f 92 push r6 22e4a: 7f 92 push r7 22e4c: 8f 92 push r8 22e4e: 9f 92 push r9 22e50: af 92 push r10 22e52: bf 92 push r11 22e54: cf 92 push r12 22e56: df 92 push r13 22e58: ef 92 push r14 22e5a: ff 92 push r15 22e5c: 0f 93 push r16 22e5e: 1f 93 push r17 22e60: 2f 93 push r18 22e62: 3f 93 push r19 22e64: 4f 93 push r20 22e66: 5f 93 push r21 22e68: 6f 93 push r22 22e6a: 7f 93 push r23 22e6c: 8f 93 push r24 22e6e: 9f 93 push r25 22e70: af 93 push r26 22e72: bf 93 push r27 22e74: cf 93 push r28 22e76: df 93 push r29 22e78: ef 93 push r30 22e7a: ff 93 push r31 // immediately schedule a new conversion if(adc_values_ready != true) return; 22e7c: 80 91 63 06 lds r24, 0x0663 ; 0x800663 <_ZL16adc_values_ready.lto_priv.519> 22e80: 88 23 and r24, r24 22e82: 09 f4 brne .+2 ; 0x22e86 <__vector_32+0x50> 22e84: 22 c1 rjmp .+580 ; 0x230ca <__vector_32+0x294> adc_values_ready = false; 22e86: 10 92 63 06 sts 0x0663, r1 ; 0x800663 <_ZL16adc_values_ready.lto_priv.519> adc_start_cycle(); 22e8a: 0e 94 f0 7d call 0xfbe0 ; 0xfbe0 // run temperature management with interrupts enabled to reduce latency DISABLE_TEMP_MGR_INTERRUPT(); 22e8e: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 22e92: 8d 7f andi r24, 0xFD ; 253 22e94: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> #if !defined(__DOXYGEN__) /* Internal helper functions. */ static __inline__ uint8_t __iSeiRetVal(void) { sei(); 22e98: 78 94 sei interrupt context, while this function runs from temp_mgr_isr which *is* preemptible as analog2temp is relatively slow */ static void setIsrTemperaturesFromRawValues() { for(uint8_t e=0;e 22e9e: 90 91 4a 06 lds r25, 0x064A ; 0x80064a 22ea2: 0e 94 be bd call 0x17b7c ; 0x17b7c 22ea6: 4b 01 movw r8, r22 22ea8: 5c 01 movw r10, r24 22eaa: 80 92 5e 06 sts 0x065E, r8 ; 0x80065e 22eae: 90 92 5f 06 sts 0x065F, r9 ; 0x80065f 22eb2: a0 92 60 06 sts 0x0660, r10 ; 0x800660 22eb6: b0 92 61 06 sts 0x0661, r11 ; 0x800661 current_temperature_bed_isr = analog2tempBed(current_temperature_bed_raw); 22eba: 00 91 4b 06 lds r16, 0x064B ; 0x80064b 22ebe: 10 91 4c 06 lds r17, 0x064C ; 0x80064c 22ec2: c8 01 movw r24, r16 22ec4: 0f 94 18 16 call 0x22c30 ; 0x22c30 22ec8: 6b 01 movw r12, r22 22eca: 7c 01 movw r14, r24 22ecc: c0 92 57 06 sts 0x0657, r12 ; 0x800657 22ed0: d0 92 58 06 sts 0x0658, r13 ; 0x800658 22ed4: e0 92 59 06 sts 0x0659, r14 ; 0x800659 22ed8: f0 92 5a 06 sts 0x065A, r15 ; 0x80065a #ifdef PINDA_THERMISTOR current_temperature_pinda_isr = analog2tempBed(current_temperature_raw_pinda); 22edc: 80 91 47 06 lds r24, 0x0647 ; 0x800647 22ee0: 90 91 48 06 lds r25, 0x0648 ; 0x800648 22ee4: 0f 94 18 16 call 0x22c30 ; 0x22c30 22ee8: 60 93 43 06 sts 0x0643, r22 ; 0x800643 22eec: 70 93 44 06 sts 0x0644, r23 ; 0x800644 22ef0: 80 93 45 06 sts 0x0645, r24 ; 0x800645 22ef4: 90 93 46 06 sts 0x0646, r25 ; 0x800646 #endif #ifdef AMBIENT_THERMISTOR current_temperature_ambient_isr = analog2tempAmbient(current_temperature_raw_ambient); //thermistor for ambient is NTCG104LH104JT1 (2000) #endif temp_meas_ready = true; 22ef8: 81 e0 ldi r24, 0x01 ; 1 22efa: 80 93 42 06 sts 0x0642, r24 ; 0x800642 { // update *_isr temperatures from raw values for PID regulation setIsrTemperaturesFromRawValues(); // clear the error assertion flag before checking again temp_error_state.assert = false; 22efe: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 22f02: 8d 7f andi r24, 0xFD ; 253 22f04: 80 93 9a 03 sts 0x039A, r24 ; 0x80039a <_ZL16temp_error_state.lto_priv.422> void check_max_temp_raw() { //heater #if HEATER_0_RAW_LO_TEMP > HEATER_0_RAW_HI_TEMP if (current_temperature_raw[0] <= maxttemp_raw[0]) { 22f08: c0 91 49 06 lds r28, 0x0649 ; 0x800649 22f0c: d0 91 4a 06 lds r29, 0x064A ; 0x80064a 22f10: 80 91 d9 03 lds r24, 0x03D9 ; 0x8003d9 <_ZL12maxttemp_raw.lto_priv.427> 22f14: 90 91 da 03 lds r25, 0x03DA ; 0x8003da <_ZL12maxttemp_raw.lto_priv.427+0x1> 22f18: 8c 17 cp r24, r28 22f1a: 9d 07 cpc r25, r29 22f1c: 2c f0 brlt .+10 ; 0x22f28 <__vector_32+0xf2> #else if (current_temperature_raw[0] >= maxttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::max); 22f1e: 40 e0 ldi r20, 0x00 ; 0 22f20: 60 e0 ldi r22, 0x00 ; 0 22f22: 80 e0 ldi r24, 0x00 ; 0 22f24: 0f 94 7a 12 call 0x224f4 ; 0x224f4 } //bed #if defined(BED_MAXTEMP) && (TEMP_SENSOR_BED != 0) #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP if (current_temperature_bed_raw <= bed_maxttemp_raw) { 22f28: 80 91 d7 03 lds r24, 0x03D7 ; 0x8003d7 <_ZL16bed_maxttemp_raw.lto_priv.428> 22f2c: 90 91 d8 03 lds r25, 0x03D8 ; 0x8003d8 <_ZL16bed_maxttemp_raw.lto_priv.428+0x1> 22f30: 80 17 cp r24, r16 22f32: 91 07 cpc r25, r17 22f34: 2c f0 brlt .+10 ; 0x22f40 <__vector_32+0x10a> #else if (current_temperature_bed_raw >= bed_maxttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::max); 22f36: 40 e0 ldi r20, 0x00 ; 0 22f38: 60 e0 ldi r22, 0x00 ; 0 22f3a: 81 e0 ldi r24, 0x01 ; 1 22f3c: 0f 94 7a 12 call 0x224f4 ; 0x224f4 { // ambient temperature is low #endif //AMBIENT_THERMISTOR // *** 'common' part of code for MK2.5 & MK3 // * nozzle checking if(target_temperature_isr[active_extruder]>minttemp[active_extruder]) { 22f40: 60 91 db 03 lds r22, 0x03DB ; 0x8003db <_ZL8minttemp.lto_priv.424> 22f44: 70 91 dc 03 lds r23, 0x03DC ; 0x8003dc <_ZL8minttemp.lto_priv.424+0x1> 22f48: 80 91 5c 06 lds r24, 0x065C ; 0x80065c 22f4c: 90 91 5d 06 lds r25, 0x065D ; 0x80065d 22f50: 68 17 cp r22, r24 22f52: 79 07 cpc r23, r25 22f54: 0c f0 brlt .+2 ; 0x22f58 <__vector_32+0x122> 22f56: dc c0 rjmp .+440 ; 0x23110 <__vector_32+0x2da> // ~ nozzle heating is on bCheckingOnHeater=bCheckingOnHeater||(current_temperature_isr[active_extruder]>(minttemp[active_extruder]+TEMP_HYSTERESIS)); // for eventually delay cutting 22f58: 10 91 54 06 lds r17, 0x0654 ; 0x800654 22f5c: 11 11 cpse r17, r1 22f5e: 12 c0 rjmp .+36 ; 0x22f84 <__vector_32+0x14e> 22f60: 6b 5f subi r22, 0xFB ; 251 22f62: 7f 4f sbci r23, 0xFF ; 255 22f64: 07 2e mov r0, r23 22f66: 00 0c add r0, r0 22f68: 88 0b sbc r24, r24 22f6a: 99 0b sbc r25, r25 22f6c: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 22f70: 9b 01 movw r18, r22 22f72: ac 01 movw r20, r24 22f74: 11 e0 ldi r17, 0x01 ; 1 22f76: c5 01 movw r24, r10 22f78: b4 01 movw r22, r8 22f7a: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 22f7e: 18 16 cp r1, r24 22f80: 0c f0 brlt .+2 ; 0x22f84 <__vector_32+0x14e> 22f82: 10 e0 ldi r17, 0x00 ; 0 22f84: 10 93 54 06 sts 0x0654, r17 ; 0x800654 if(oTimer4minTempHeater.expired_cont(HEATER_MINTEMP_DELAY) || bCheckingOnHeater) { 22f88: 68 e9 ldi r22, 0x98 ; 152 22f8a: 7a e3 ldi r23, 0x3A ; 58 22f8c: 81 e5 ldi r24, 0x51 ; 81 22f8e: 96 e0 ldi r25, 0x06 ; 6 22f90: 0f 94 cf 0f call 0x21f9e ; 0x21f9e ::expired_cont(unsigned short)> 22f94: 81 11 cpse r24, r1 22f96: 02 c0 rjmp .+4 ; 0x22f9c <__vector_32+0x166> 22f98: 11 23 and r17, r17 22f9a: 79 f0 breq .+30 ; 0x22fba <__vector_32+0x184> bCheckingOnHeater=true; // not necessary 22f9c: 81 e0 ldi r24, 0x01 ; 1 22f9e: 80 93 54 06 sts 0x0654, r24 ; 0x800654 static alert_automaton_mintemp alert_automaton_hotend(m2hotend), alert_automaton_bed(m2bed); void check_min_temp_heater0() { #if HEATER_0_RAW_LO_TEMP > HEATER_0_RAW_HI_TEMP if (current_temperature_raw[0] >= minttemp_raw[0]) { 22fa2: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL12minttemp_raw.lto_priv.426> 22fa6: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL12minttemp_raw.lto_priv.426+0x1> 22faa: c8 17 cp r28, r24 22fac: d9 07 cpc r29, r25 22fae: 2c f0 brlt .+10 ; 0x22fba <__vector_32+0x184> #else if (current_temperature_raw[0] <= minttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::min); 22fb0: 41 e0 ldi r20, 0x01 ; 1 22fb2: 60 e0 ldi r22, 0x00 ; 0 22fb4: 80 e0 ldi r24, 0x00 ; 0 22fb6: 0f 94 7a 12 call 0x224f4 ; 0x224f4 // ~ nozzle heating is off oTimer4minTempHeater.start(); bCheckingOnHeater=false; } // * bed checking if(target_temperature_bed_isr>BED_MINTEMP) { 22fba: 80 91 55 06 lds r24, 0x0655 ; 0x800655 22fbe: 90 91 56 06 lds r25, 0x0656 ; 0x800656 22fc2: 4f 97 sbiw r24, 0x1f ; 31 22fc4: 0c f4 brge .+2 ; 0x22fc8 <__vector_32+0x192> 22fc6: ab c0 rjmp .+342 ; 0x2311e <__vector_32+0x2e8> // ~ bed heating is on bCheckingOnBed=bCheckingOnBed||(current_temperature_bed_isr>(BED_MINTEMP+TEMP_HYSTERESIS)); // for eventually delay cutting 22fc8: c0 91 50 06 lds r28, 0x0650 ; 0x800650 22fcc: c1 11 cpse r28, r1 22fce: 0c c0 rjmp .+24 ; 0x22fe8 <__vector_32+0x1b2> 22fd0: c1 e0 ldi r28, 0x01 ; 1 22fd2: 20 e0 ldi r18, 0x00 ; 0 22fd4: 30 e0 ldi r19, 0x00 ; 0 22fd6: 4c e0 ldi r20, 0x0C ; 12 22fd8: 52 e4 ldi r21, 0x42 ; 66 22fda: c7 01 movw r24, r14 22fdc: b6 01 movw r22, r12 22fde: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 22fe2: 18 16 cp r1, r24 22fe4: 0c f0 brlt .+2 ; 0x22fe8 <__vector_32+0x1b2> 22fe6: c0 e0 ldi r28, 0x00 ; 0 22fe8: c0 93 50 06 sts 0x0650, r28 ; 0x800650 if(oTimer4minTempBed.expired_cont(BED_MINTEMP_DELAY) || bCheckingOnBed) { 22fec: 60 e5 ldi r22, 0x50 ; 80 22fee: 73 ec ldi r23, 0xC3 ; 195 22ff0: 8d e4 ldi r24, 0x4D ; 77 22ff2: 96 e0 ldi r25, 0x06 ; 6 22ff4: 0f 94 cf 0f call 0x21f9e ; 0x21f9e ::expired_cont(unsigned short)> 22ff8: 81 11 cpse r24, r1 22ffa: 02 c0 rjmp .+4 ; 0x23000 <__vector_32+0x1ca> 22ffc: cc 23 and r28, r28 22ffe: 99 f0 breq .+38 ; 0x23026 <__vector_32+0x1f0> bCheckingOnBed=true; // not necessary 23000: 81 e0 ldi r24, 0x01 ; 1 23002: 80 93 50 06 sts 0x0650, r24 ; 0x800650 } void check_min_temp_bed() { #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP if (current_temperature_bed_raw >= bed_minttemp_raw) { 23006: 20 91 4b 06 lds r18, 0x064B ; 0x80064b 2300a: 30 91 4c 06 lds r19, 0x064C ; 0x80064c 2300e: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.425> 23012: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.425+0x1> 23016: 28 17 cp r18, r24 23018: 39 07 cpc r19, r25 2301a: 2c f0 brlt .+10 ; 0x23026 <__vector_32+0x1f0> #else if (current_temperature_bed_raw <= bed_minttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::min); 2301c: 41 e0 ldi r20, 0x01 ; 1 2301e: 60 e0 ldi r22, 0x00 ; 0 23020: 81 e0 ldi r24, 0x01 ; 1 23022: 0f 94 7a 12 call 0x224f4 ; 0x224f4 static void check_temp_runaway() { #ifdef TEMP_RUNAWAY_EXTRUDER_HYSTERESIS for(uint8_t e = 0; e < EXTRUDERS; e++) temp_runaway_check(e+1, target_temperature_isr[e], current_temperature_isr[e], soft_pwm[e], false); 23026: 60 91 62 06 lds r22, 0x0662 ; 0x800662 <_ZL8soft_pwm.lto_priv.506> 2302a: 70 e0 ldi r23, 0x00 ; 0 2302c: 90 e0 ldi r25, 0x00 ; 0 2302e: 80 e0 ldi r24, 0x00 ; 0 23030: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 23034: 6b 01 movw r12, r22 23036: 7c 01 movw r14, r24 23038: 40 90 5e 06 lds r4, 0x065E ; 0x80065e 2303c: 50 90 5f 06 lds r5, 0x065F ; 0x80065f 23040: 60 90 60 06 lds r6, 0x0660 ; 0x800660 23044: 70 90 61 06 lds r7, 0x0661 ; 0x800661 23048: 60 91 5c 06 lds r22, 0x065C ; 0x80065c 2304c: 70 91 5d 06 lds r23, 0x065D ; 0x80065d 23050: 07 2e mov r0, r23 23052: 00 0c add r0, r0 23054: 88 0b sbc r24, r24 23056: 99 0b sbc r25, r25 23058: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2305c: ab 01 movw r20, r22 2305e: bc 01 movw r22, r24 23060: a1 2c mov r10, r1 23062: 93 01 movw r18, r6 23064: 82 01 movw r16, r4 23066: 81 e0 ldi r24, 0x01 ; 1 23068: 0f 94 de 12 call 0x225bc ; 0x225bc #endif #ifdef TEMP_RUNAWAY_BED_HYSTERESIS temp_runaway_check(0, target_temperature_bed_isr, current_temperature_bed_isr, soft_pwm_bed, true); 2306c: 60 91 5b 06 lds r22, 0x065B ; 0x80065b 23070: 70 e0 ldi r23, 0x00 ; 0 23072: 90 e0 ldi r25, 0x00 ; 0 23074: 80 e0 ldi r24, 0x00 ; 0 23076: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 2307a: 6b 01 movw r12, r22 2307c: 7c 01 movw r14, r24 2307e: 40 90 57 06 lds r4, 0x0657 ; 0x800657 23082: 50 90 58 06 lds r5, 0x0658 ; 0x800658 23086: 60 90 59 06 lds r6, 0x0659 ; 0x800659 2308a: 70 90 5a 06 lds r7, 0x065A ; 0x80065a 2308e: 60 91 55 06 lds r22, 0x0655 ; 0x800655 23092: 70 91 56 06 lds r23, 0x0656 ; 0x800656 23096: 07 2e mov r0, r23 23098: 00 0c add r0, r0 2309a: 88 0b sbc r24, r24 2309c: 99 0b sbc r25, r25 2309e: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 230a2: ab 01 movw r20, r22 230a4: bc 01 movw r22, r24 230a6: aa 24 eor r10, r10 230a8: a3 94 inc r10 230aa: 93 01 movw r18, r6 230ac: 82 01 movw r16, r4 230ae: 80 e0 ldi r24, 0x00 ; 0 230b0: 0f 94 de 12 call 0x225bc ; 0x225bc thermal_model::log_isr(); #endif #endif // PID regulation if (pid_tuning_finished) 230b4: 80 91 41 02 lds r24, 0x0241 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.423> 230b8: 81 11 cpse r24, r1 temp_mgr_pid(); 230ba: 0e 94 18 f8 call 0x1f030 ; 0x1f030 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 230be: f8 94 cli // run temperature management with interrupts enabled to reduce latency DISABLE_TEMP_MGR_INTERRUPT(); NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { temp_mgr_isr(); } ENABLE_TEMP_MGR_INTERRUPT(); 230c0: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 230c4: 82 60 ori r24, 0x02 ; 2 230c6: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> } 230ca: ff 91 pop r31 230cc: ef 91 pop r30 230ce: df 91 pop r29 230d0: cf 91 pop r28 230d2: bf 91 pop r27 230d4: af 91 pop r26 230d6: 9f 91 pop r25 230d8: 8f 91 pop r24 230da: 7f 91 pop r23 230dc: 6f 91 pop r22 230de: 5f 91 pop r21 230e0: 4f 91 pop r20 230e2: 3f 91 pop r19 230e4: 2f 91 pop r18 230e6: 1f 91 pop r17 230e8: 0f 91 pop r16 230ea: ff 90 pop r15 230ec: ef 90 pop r14 230ee: df 90 pop r13 230f0: cf 90 pop r12 230f2: bf 90 pop r11 230f4: af 90 pop r10 230f6: 9f 90 pop r9 230f8: 8f 90 pop r8 230fa: 7f 90 pop r7 230fc: 6f 90 pop r6 230fe: 5f 90 pop r5 23100: 4f 90 pop r4 23102: 0f 90 pop r0 23104: 0b be out 0x3b, r0 ; 59 23106: 0f 90 pop r0 23108: 0f be out 0x3f, r0 ; 63 2310a: 0f 90 pop r0 2310c: 1f 90 pop r1 2310e: 18 95 reti check_min_temp_heater0(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ nozzle heating is off oTimer4minTempHeater.start(); 23110: 81 e5 ldi r24, 0x51 ; 81 23112: 96 e0 ldi r25, 0x06 ; 6 23114: 0f 94 d6 0f call 0x21fac ; 0x21fac ::start()> bCheckingOnHeater=false; 23118: 10 92 54 06 sts 0x0654, r1 ; 0x800654 2311c: 4e cf rjmp .-356 ; 0x22fba <__vector_32+0x184> check_min_temp_bed(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ bed heating is off oTimer4minTempBed.start(); 2311e: 8d e4 ldi r24, 0x4D ; 77 23120: 96 e0 ldi r25, 0x06 ; 6 23122: 0f 94 d6 0f call 0x21fac ; 0x21fac ::start()> bCheckingOnBed=false; 23126: 10 92 50 06 sts 0x0650, r1 ; 0x800650 2312a: 7d cf rjmp .-262 ; 0x23026 <__vector_32+0x1f0> 0002312c : void updatePID() { // TODO: iState_sum_max and PID values should be synchronized for temp_mgr_isr #ifdef PIDTEMP for(uint_least8_t e = 0; e < EXTRUDERS; e++) { iState_sum_max[e] = PID_INTEGRAL_DRIVE_MAX / cs.Ki; 2312c: 20 91 9e 04 lds r18, 0x049E ; 0x80049e 23130: 30 91 9f 04 lds r19, 0x049F ; 0x80049f 23134: 40 91 a0 04 lds r20, 0x04A0 ; 0x8004a0 23138: 50 91 a1 04 lds r21, 0x04A1 ; 0x8004a1 2313c: 60 e0 ldi r22, 0x00 ; 0 2313e: 70 e0 ldi r23, 0x00 ; 0 23140: 8f e7 ldi r24, 0x7F ; 127 23142: 93 e4 ldi r25, 0x43 ; 67 23144: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 23148: 60 93 e6 03 sts 0x03E6, r22 ; 0x8003e6 <_ZL14iState_sum_max.lto_priv.432> 2314c: 70 93 e7 03 sts 0x03E7, r23 ; 0x8003e7 <_ZL14iState_sum_max.lto_priv.432+0x1> 23150: 80 93 e8 03 sts 0x03E8, r24 ; 0x8003e8 <_ZL14iState_sum_max.lto_priv.432+0x2> 23154: 90 93 e9 03 sts 0x03E9, r25 ; 0x8003e9 <_ZL14iState_sum_max.lto_priv.432+0x3> } #endif #ifdef PIDTEMPBED temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 23158: 20 91 aa 04 lds r18, 0x04AA ; 0x8004aa 2315c: 30 91 ab 04 lds r19, 0x04AB ; 0x8004ab 23160: 40 91 ac 04 lds r20, 0x04AC ; 0x8004ac 23164: 50 91 ad 04 lds r21, 0x04AD ; 0x8004ad 23168: 60 e0 ldi r22, 0x00 ; 0 2316a: 70 e0 ldi r23, 0x00 ; 0 2316c: 8f e7 ldi r24, 0x7F ; 127 2316e: 93 e4 ldi r25, 0x43 ; 67 23170: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 23174: 60 93 de 03 sts 0x03DE, r22 ; 0x8003de <_ZL19temp_iState_max_bed.lto_priv.430> 23178: 70 93 df 03 sts 0x03DF, r23 ; 0x8003df <_ZL19temp_iState_max_bed.lto_priv.430+0x1> 2317c: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 <_ZL19temp_iState_max_bed.lto_priv.430+0x2> 23180: 90 93 e1 03 sts 0x03E1, r25 ; 0x8003e1 <_ZL19temp_iState_max_bed.lto_priv.430+0x3> #endif } 23184: 08 95 ret 00023186 : #endif // WARNING: the following function has been marked noinline to avoid a GCC 4.9.2 LTO // codegen bug causing a stack overwrite issue in process_commands() void __attribute__((noinline)) PID_autotune(float temp, int extruder, int ncycles) { 23186: 2f 92 push r2 23188: 3f 92 push r3 2318a: 4f 92 push r4 2318c: 5f 92 push r5 2318e: 6f 92 push r6 23190: 7f 92 push r7 23192: 8f 92 push r8 23194: 9f 92 push r9 23196: af 92 push r10 23198: bf 92 push r11 2319a: cf 92 push r12 2319c: df 92 push r13 2319e: ef 92 push r14 231a0: ff 92 push r15 231a2: 0f 93 push r16 231a4: 1f 93 push r17 231a6: cf 93 push r28 231a8: df 93 push r29 231aa: cd b7 in r28, 0x3d ; 61 231ac: de b7 in r29, 0x3e ; 62 231ae: e0 97 sbiw r28, 0x30 ; 48 231b0: 0f b6 in r0, 0x3f ; 63 231b2: f8 94 cli 231b4: de bf out 0x3e, r29 ; 62 231b6: 0f be out 0x3f, r0 ; 63 231b8: cd bf out 0x3d, r28 ; 61 231ba: 6a 87 std Y+10, r22 ; 0x0a 231bc: 7b 87 std Y+11, r23 ; 0x0b 231be: 8c 87 std Y+12, r24 ; 0x0c 231c0: 9d 87 std Y+13, r25 ; 0x0d 231c2: 1a 01 movw r2, r20 231c4: 3a a7 std Y+42, r19 ; 0x2a 231c6: 29 a7 std Y+41, r18 ; 0x29 return !pid_tuning_finished; } void preparePidTuning() { // ensure heaters are disabled before we switch off PID management! disable_heater(); 231c8: 0f 94 5f 12 call 0x224be ; 0x224be pid_tuning_finished = false; 231cc: 10 92 41 02 sts 0x0241, r1 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.423> // codegen bug causing a stack overwrite issue in process_commands() void __attribute__((noinline)) PID_autotune(float temp, int extruder, int ncycles) { preparePidTuning(); pid_number_of_cycles = ncycles; 231d0: 29 a5 ldd r18, Y+41 ; 0x29 231d2: 3a a5 ldd r19, Y+42 ; 0x2a 231d4: 30 93 6e 06 sts 0x066E, r19 ; 0x80066e 231d8: 20 93 6d 06 sts 0x066D, r18 ; 0x80066d float input = 0.0; pid_cycle=0; 231dc: 10 92 70 06 sts 0x0670, r1 ; 0x800670 231e0: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f bool heating = true; unsigned long temp_millis = _millis(); 231e4: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 231e8: 6e 83 std Y+6, r22 ; 0x06 231ea: 7f 83 std Y+7, r23 ; 0x07 231ec: 88 87 std Y+8, r24 ; 0x08 231ee: 99 87 std Y+9, r25 ; 0x09 long bias, d; float Ku, Tu; float max = 0, min = 10000; uint8_t safety_check_cycles = 0; const uint8_t safety_check_cycles_count = (extruder < 0) ? 45 : 10; //10 cycles / 20s delay for extruder and 45 cycles / 90s for heatbed 231f0: 37 fe sbrs r3, 7 231f2: ff c0 rjmp .+510 ; 0x233f2 231f4: 3d e2 ldi r19, 0x2D ; 45 231f6: 3f 8f std Y+31, r19 ; 0x1f float temp_ambient; #if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) unsigned long extruder_autofan_last_check = _millis(); 231f8: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 231fc: 6c a3 std Y+36, r22 ; 0x24 231fe: 7d a3 std Y+37, r23 ; 0x25 23200: 8e a3 std Y+38, r24 ; 0x26 23202: 9f a3 std Y+39, r25 ; 0x27 if ((extruder >= EXTRUDERS) #if (TEMP_BED_PIN <= -1) ||(extruder < 0) #endif ){ SERIAL_ECHOLNPGM("PID Autotune failed. Bad extruder number."); 23204: 8b ef ldi r24, 0xFB ; 251 23206: 91 e9 ldi r25, 0x91 ; 145 #if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) unsigned long extruder_autofan_last_check = _millis(); #endif if ((extruder >= EXTRUDERS) 23208: 12 14 cp r1, r2 2320a: 13 04 cpc r1, r3 2320c: 0c f4 brge .+2 ; 0x23210 2320e: 8a c2 rjmp .+1300 ; 0x23724 pid_tuning_finished = true; pid_cycle = 0; return; } SERIAL_ECHOLNPGM("PID Autotune start"); 23210: 88 ee ldi r24, 0xE8 ; 232 23212: 91 e9 ldi r25, 0x91 ; 145 23214: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 23218: 6a 85 ldd r22, Y+10 ; 0x0a 2321a: 7b 85 ldd r23, Y+11 ; 0x0b 2321c: 8c 85 ldd r24, Y+12 ; 0x0c 2321e: 9d 85 ldd r25, Y+13 ; 0x0d 23220: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> if (extruder<0) { soft_pwm_bed = (MAX_BED_POWER)/2; 23224: 2f e7 ldi r18, 0x7F ; 127 return; } SERIAL_ECHOLNPGM("PID Autotune start"); if (extruder<0) 23226: 21 14 cp r2, r1 23228: 31 04 cpc r3, r1 2322a: 09 f4 brne .+2 ; 0x2322e 2322c: e5 c0 rjmp .+458 ; 0x233f8 { soft_pwm_bed = (MAX_BED_POWER)/2; 2322e: 20 93 5b 06 sts 0x065B, r18 ; 0x80065b bias = d = (MAX_BED_POWER)/2; target_temperature_bed = (int)temp; // to display the requested target bed temperature properly on the main screen 23232: 70 93 ee 11 sts 0x11EE, r23 ; 0x8011ee 23236: 60 93 ed 11 sts 0x11ED, r22 ; 0x8011ed long bias, d; float Ku, Tu; float max = 0, min = 10000; uint8_t safety_check_cycles = 0; const uint8_t safety_check_cycles_count = (extruder < 0) ? 45 : 10; //10 cycles / 20s delay for extruder and 45 cycles / 90s for heatbed 2323a: 8e 81 ldd r24, Y+6 ; 0x06 2323c: 9f 81 ldd r25, Y+7 ; 0x07 2323e: a8 85 ldd r26, Y+8 ; 0x08 23240: b9 85 ldd r27, Y+9 ; 0x09 23242: 8e 87 std Y+14, r24 ; 0x0e 23244: 9f 87 std Y+15, r25 ; 0x0f 23246: a8 8b std Y+16, r26 ; 0x10 23248: b9 8b std Y+17, r27 ; 0x11 2324a: 88 a3 std Y+32, r24 ; 0x20 2324c: 99 a3 std Y+33, r25 ; 0x21 2324e: aa a3 std Y+34, r26 ; 0x22 23250: bb a3 std Y+35, r27 ; 0x23 23252: 1a 8a std Y+18, r1 ; 0x12 23254: 90 e4 ldi r25, 0x40 ; 64 23256: 9b 8b std Y+19, r25 ; 0x13 23258: ac e1 ldi r26, 0x1C ; 28 2325a: ac 8b std Y+20, r26 ; 0x14 2325c: b6 e4 ldi r27, 0x46 ; 70 2325e: bd 8b std Y+21, r27 ; 0x15 23260: 1e 8a std Y+22, r1 ; 0x16 23262: 1f 8a std Y+23, r1 ; 0x17 23264: 18 8e std Y+24, r1 ; 0x18 23266: 19 8e std Y+25, r1 ; 0x19 23268: 6f e7 ldi r22, 0x7F ; 127 2326a: c6 2e mov r12, r22 2326c: d1 2c mov r13, r1 2326e: e1 2c mov r14, r1 23270: f1 2c mov r15, r1 23272: 00 e0 ldi r16, 0x00 ; 0 23274: 10 e0 ldi r17, 0x00 ; 0 23276: 18 aa std Y+48, r1 ; 0x30 23278: 1f a6 std Y+47, r1 ; 0x2f 2327a: 1d 82 std Y+5, r1 ; 0x05 2327c: 2f e7 ldi r18, 0x7F ; 127 2327e: 30 e0 ldi r19, 0x00 ; 0 23280: 40 e0 ldi r20, 0x00 ; 0 23282: 50 e0 ldi r21, 0x00 ; 0 23284: 29 83 std Y+1, r18 ; 0x01 23286: 3a 83 std Y+2, r19 ; 0x02 23288: 4b 83 std Y+3, r20 ; 0x03 2328a: 5c 83 std Y+4, r21 ; 0x04 2328c: 1b 8e std Y+27, r1 ; 0x1b 2328e: 1c 8e std Y+28, r1 ; 0x1c 23290: 1d 8e std Y+29, r1 ; 0x1d 23292: 1e 8e std Y+30, r1 ; 0x1e 23294: 31 e0 ldi r19, 0x01 ; 1 23296: 3a 8f std Y+26, r19 ; 0x1a target_temperature[extruder] = (int)temp; // to display the requested target extruder temperature properly on the main screen } for(;;) { #ifdef WATCHDOG wdt_reset(); 23298: a8 95 wdr #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready 2329a: 40 91 42 06 lds r20, 0x0642 ; 0x800642 2329e: 48 a7 std Y+40, r20 ; 0x28 232a0: 44 23 and r20, r20 232a2: 09 f4 brne .+2 ; 0x232a6 232a4: 2c c2 rjmp .+1112 ; 0x236fe updateTemperatures(); 232a6: 0e 94 ec fa call 0x1f5d8 ; 0x1f5d8 input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 232aa: 21 14 cp r2, r1 232ac: 31 04 cpc r3, r1 232ae: 09 f0 breq .+2 ; 0x232b2 232b0: aa c0 rjmp .+340 ; 0x23406 232b2: 00 91 c4 0d lds r16, 0x0DC4 ; 0x800dc4 232b6: 10 91 c5 0d lds r17, 0x0DC5 ; 0x800dc5 232ba: 50 91 c6 0d lds r21, 0x0DC6 ; 0x800dc6 232be: 58 ab std Y+48, r21 ; 0x30 232c0: 80 91 c7 0d lds r24, 0x0DC7 ; 0x800dc7 232c4: 8f a7 std Y+47, r24 ; 0x2f max=max(max,input); 232c6: 2e 89 ldd r18, Y+22 ; 0x16 232c8: 3f 89 ldd r19, Y+23 ; 0x17 232ca: 48 8d ldd r20, Y+24 ; 0x18 232cc: 59 8d ldd r21, Y+25 ; 0x19 232ce: b8 01 movw r22, r16 232d0: 88 a9 ldd r24, Y+48 ; 0x30 232d2: 9f a5 ldd r25, Y+47 ; 0x2f 232d4: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 232d8: 87 fd sbrc r24, 7 232da: 06 c0 rjmp .+12 ; 0x232e8 232dc: 0e 8b std Y+22, r16 ; 0x16 232de: 1f 8b std Y+23, r17 ; 0x17 232e0: b8 a9 ldd r27, Y+48 ; 0x30 232e2: b8 8f std Y+24, r27 ; 0x18 232e4: 2f a5 ldd r18, Y+47 ; 0x2f 232e6: 29 8f std Y+25, r18 ; 0x19 min=min(min,input); 232e8: 2a 89 ldd r18, Y+18 ; 0x12 232ea: 3b 89 ldd r19, Y+19 ; 0x13 232ec: 4c 89 ldd r20, Y+20 ; 0x14 232ee: 5d 89 ldd r21, Y+21 ; 0x15 232f0: b8 01 movw r22, r16 232f2: 88 a9 ldd r24, Y+48 ; 0x30 232f4: 9f a5 ldd r25, Y+47 ; 0x2f 232f6: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 232fa: 18 16 cp r1, r24 232fc: 34 f0 brlt .+12 ; 0x2330a 232fe: 0a 8b std Y+18, r16 ; 0x12 23300: 1b 8b std Y+19, r17 ; 0x13 23302: 38 a9 ldd r19, Y+48 ; 0x30 23304: 3c 8b std Y+20, r19 ; 0x14 23306: 4f a5 ldd r20, Y+47 ; 0x2f 23308: 4d 8b std Y+21, r20 ; 0x15 #if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) if(_millis() - extruder_autofan_last_check > 2500) { 2330a: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 2330e: 2c a1 ldd r18, Y+36 ; 0x24 23310: 3d a1 ldd r19, Y+37 ; 0x25 23312: 4e a1 ldd r20, Y+38 ; 0x26 23314: 5f a1 ldd r21, Y+39 ; 0x27 23316: 62 1b sub r22, r18 23318: 73 0b sbc r23, r19 2331a: 84 0b sbc r24, r20 2331c: 95 0b sbc r25, r21 2331e: 65 3c cpi r22, 0xC5 ; 197 23320: 79 40 sbci r23, 0x09 ; 9 23322: 81 05 cpc r24, r1 23324: 91 05 cpc r25, r1 23326: 40 f0 brcs .+16 ; 0x23338 checkExtruderAutoFans(); 23328: 0e 94 8b 6e call 0xdd16 ; 0xdd16 extruder_autofan_last_check = _millis(); 2332c: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 23330: 6c a3 std Y+36, r22 ; 0x24 23332: 7d a3 std Y+37, r23 ; 0x25 23334: 8e a3 std Y+38, r24 ; 0x26 23336: 9f a3 std Y+39, r25 ; 0x27 } #endif if(heating == true && input > temp) { 23338: 4a 8d ldd r20, Y+26 ; 0x1a 2333a: 44 23 and r20, r20 2333c: 09 f4 brne .+2 ; 0x23340 2333e: 4c c0 rjmp .+152 ; 0x233d8 23340: 2a 85 ldd r18, Y+10 ; 0x0a 23342: 3b 85 ldd r19, Y+11 ; 0x0b 23344: 4c 85 ldd r20, Y+12 ; 0x0c 23346: 5d 85 ldd r21, Y+13 ; 0x0d 23348: b8 01 movw r22, r16 2334a: 88 a9 ldd r24, Y+48 ; 0x30 2334c: 9f a5 ldd r25, Y+47 ; 0x2f 2334e: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 23352: 18 16 cp r1, r24 23354: 0c f0 brlt .+2 ; 0x23358 23356: d3 c1 rjmp .+934 ; 0x236fe if(_millis() - t2 > 5000) { 23358: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 2335c: 2e 85 ldd r18, Y+14 ; 0x0e 2335e: 3f 85 ldd r19, Y+15 ; 0x0f 23360: 48 89 ldd r20, Y+16 ; 0x10 23362: 59 89 ldd r21, Y+17 ; 0x11 23364: 62 1b sub r22, r18 23366: 73 0b sbc r23, r19 23368: 84 0b sbc r24, r20 2336a: 95 0b sbc r25, r21 2336c: 69 38 cpi r22, 0x89 ; 137 2336e: 73 41 sbci r23, 0x13 ; 19 23370: 81 05 cpc r24, r1 23372: 91 05 cpc r25, r1 23374: 08 f4 brcc .+2 ; 0x23378 23376: c3 c1 rjmp .+902 ; 0x236fe 23378: d7 01 movw r26, r14 2337a: c6 01 movw r24, r12 2337c: 29 81 ldd r18, Y+1 ; 0x01 2337e: 3a 81 ldd r19, Y+2 ; 0x02 23380: 4b 81 ldd r20, Y+3 ; 0x03 23382: 5c 81 ldd r21, Y+4 ; 0x04 23384: 82 1b sub r24, r18 23386: 93 0b sbc r25, r19 23388: a4 0b sbc r26, r20 2338a: b5 0b sbc r27, r21 2338c: b5 95 asr r27 2338e: a7 95 ror r26 23390: 97 95 ror r25 23392: 87 95 ror r24 heating=false; if (extruder<0) { 23394: 21 14 cp r2, r1 23396: 31 04 cpc r3, r1 23398: 09 f4 brne .+2 ; 0x2339c 2339a: 40 c0 rjmp .+128 ; 0x2341c soft_pwm_bed = (bias - d) >> 1; 2339c: 80 93 5b 06 sts 0x065B, r24 ; 0x80065b } else soft_pwm[extruder] = (bias - d) >> 1; t1=_millis(); 233a0: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 233a4: 6e 83 std Y+6, r22 ; 0x06 233a6: 7f 83 std Y+7, r23 ; 0x07 233a8: 88 87 std Y+8, r24 ; 0x08 233aa: 99 87 std Y+9, r25 ; 0x09 t_high=t1 - t2; 233ac: dc 01 movw r26, r24 233ae: cb 01 movw r24, r22 233b0: 2e 85 ldd r18, Y+14 ; 0x0e 233b2: 3f 85 ldd r19, Y+15 ; 0x0f 233b4: 48 89 ldd r20, Y+16 ; 0x10 233b6: 59 89 ldd r21, Y+17 ; 0x11 233b8: 82 1b sub r24, r18 233ba: 93 0b sbc r25, r19 233bc: a4 0b sbc r26, r20 233be: b5 0b sbc r27, r21 233c0: 8b 8f std Y+27, r24 ; 0x1b 233c2: 9c 8f std Y+28, r25 ; 0x1c 233c4: ad 8f std Y+29, r26 ; 0x1d 233c6: be 8f std Y+30, r27 ; 0x1e max=temp; 233c8: 3a 85 ldd r19, Y+10 ; 0x0a 233ca: 3e 8b std Y+22, r19 ; 0x16 233cc: 4b 85 ldd r20, Y+11 ; 0x0b 233ce: 4f 8b std Y+23, r20 ; 0x17 233d0: 5c 85 ldd r21, Y+12 ; 0x0c 233d2: 58 8f std Y+24, r21 ; 0x18 233d4: 8d 85 ldd r24, Y+13 ; 0x0d 233d6: 89 8f std Y+25, r24 ; 0x19 } } if(heating == false && input < temp) { 233d8: 2a 85 ldd r18, Y+10 ; 0x0a 233da: 3b 85 ldd r19, Y+11 ; 0x0b 233dc: 4c 85 ldd r20, Y+12 ; 0x0c 233de: 5d 85 ldd r21, Y+13 ; 0x0d 233e0: b8 01 movw r22, r16 233e2: 88 a9 ldd r24, Y+48 ; 0x30 233e4: 9f a5 ldd r25, Y+47 ; 0x2f 233e6: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 233ea: 87 fd sbrc r24, 7 233ec: 1a c0 rjmp .+52 ; 0x23422 if(_millis() - t1 > 5000) { 233ee: 1a 8e std Y+26, r1 ; 0x1a 233f0: 86 c1 rjmp .+780 ; 0x236fe long bias, d; float Ku, Tu; float max = 0, min = 10000; uint8_t safety_check_cycles = 0; const uint8_t safety_check_cycles_count = (extruder < 0) ? 45 : 10; //10 cycles / 20s delay for extruder and 45 cycles / 90s for heatbed 233f2: 4a e0 ldi r20, 0x0A ; 10 233f4: 4f 8f std Y+31, r20 ; 0x1f 233f6: 00 cf rjmp .-512 ; 0x231f8 bias = d = (MAX_BED_POWER)/2; target_temperature_bed = (int)temp; // to display the requested target bed temperature properly on the main screen } else { soft_pwm[extruder] = (PID_MAX)/2; 233f8: 20 93 62 06 sts 0x0662, r18 ; 0x800662 <_ZL8soft_pwm.lto_priv.506> bias = d = (PID_MAX)/2; target_temperature[extruder] = (int)temp; // to display the requested target extruder temperature properly on the main screen 233fc: 70 93 f2 11 sts 0x11F2, r23 ; 0x8011f2 23400: 60 93 f1 11 sts 0x11F1, r22 ; 0x8011f1 23404: 1a cf rjmp .-460 ; 0x2323a wdt_reset(); #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready updateTemperatures(); input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 23406: 00 91 8a 03 lds r16, 0x038A ; 0x80038a 2340a: 10 91 8b 03 lds r17, 0x038B ; 0x80038b 2340e: 90 91 8c 03 lds r25, 0x038C ; 0x80038c 23412: 98 ab std Y+48, r25 ; 0x30 23414: a0 91 8d 03 lds r26, 0x038D ; 0x80038d 23418: af a7 std Y+47, r26 ; 0x2f 2341a: 55 cf rjmp .-342 ; 0x232c6 heating=false; if (extruder<0) { soft_pwm_bed = (bias - d) >> 1; } else soft_pwm[extruder] = (bias - d) >> 1; 2341c: 80 93 62 06 sts 0x0662, r24 ; 0x800662 <_ZL8soft_pwm.lto_priv.506> 23420: bf cf rjmp .-130 ; 0x233a0 t_high=t1 - t2; max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { 23422: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 23426: 2e 81 ldd r18, Y+6 ; 0x06 23428: 3f 81 ldd r19, Y+7 ; 0x07 2342a: 48 85 ldd r20, Y+8 ; 0x08 2342c: 59 85 ldd r21, Y+9 ; 0x09 2342e: 62 1b sub r22, r18 23430: 73 0b sbc r23, r19 23432: 84 0b sbc r24, r20 23434: 95 0b sbc r25, r21 23436: 69 38 cpi r22, 0x89 ; 137 23438: 73 41 sbci r23, 0x13 ; 19 2343a: 81 05 cpc r24, r1 2343c: 91 05 cpc r25, r1 2343e: b8 f2 brcs .-82 ; 0x233ee heating=true; t2=_millis(); 23440: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 23444: 6e 87 std Y+14, r22 ; 0x0e 23446: 7f 87 std Y+15, r23 ; 0x0f 23448: 88 8b std Y+16, r24 ; 0x10 2344a: 99 8b std Y+17, r25 ; 0x11 t_low=t2 - t1; if(pid_cycle > 0) { 2344c: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 23450: 90 91 70 06 lds r25, 0x0670 ; 0x800670 23454: 18 16 cp r1, r24 23456: 19 06 cpc r1, r25 23458: 0c f0 brlt .+2 ; 0x2345c 2345a: 2c c1 rjmp .+600 ; 0x236b4 } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; t2=_millis(); t_low=t2 - t1; 2345c: 8e 85 ldd r24, Y+14 ; 0x0e 2345e: 9f 85 ldd r25, Y+15 ; 0x0f 23460: a8 89 ldd r26, Y+16 ; 0x10 23462: b9 89 ldd r27, Y+17 ; 0x11 23464: 2e 81 ldd r18, Y+6 ; 0x06 23466: 3f 81 ldd r19, Y+7 ; 0x07 23468: 48 85 ldd r20, Y+8 ; 0x08 2346a: 59 85 ldd r21, Y+9 ; 0x09 2346c: 82 1b sub r24, r18 2346e: 93 0b sbc r25, r19 23470: a4 0b sbc r26, r20 23472: b5 0b sbc r27, r21 if(pid_cycle > 0) { bias += (d*(t_high - t_low))/(t_low + t_high); 23474: 4b 8c ldd r4, Y+27 ; 0x1b 23476: 5c 8c ldd r5, Y+28 ; 0x1c 23478: 6d 8c ldd r6, Y+29 ; 0x1d 2347a: 7e 8c ldd r7, Y+30 ; 0x1e 2347c: 48 0e add r4, r24 2347e: 59 1e adc r5, r25 23480: 6a 1e adc r6, r26 23482: 7b 1e adc r7, r27 23484: 2b 8d ldd r18, Y+27 ; 0x1b 23486: 3c 8d ldd r19, Y+28 ; 0x1c 23488: 4d 8d ldd r20, Y+29 ; 0x1d 2348a: 5e 8d ldd r21, Y+30 ; 0x1e 2348c: 28 1b sub r18, r24 2348e: 39 0b sbc r19, r25 23490: 4a 0b sbc r20, r26 23492: 5b 0b sbc r21, r27 23494: 69 81 ldd r22, Y+1 ; 0x01 23496: 7a 81 ldd r23, Y+2 ; 0x02 23498: 8b 81 ldd r24, Y+3 ; 0x03 2349a: 9c 81 ldd r25, Y+4 ; 0x04 2349c: 0f 94 3f a0 call 0x3407e ; 0x3407e <__mulsi3> 234a0: a3 01 movw r20, r6 234a2: 92 01 movw r18, r4 234a4: 0f 94 cd a0 call 0x3419a ; 0x3419a <__divmodsi4> 234a8: da 01 movw r26, r20 234aa: c9 01 movw r24, r18 234ac: 8c 0d add r24, r12 234ae: 9d 1d adc r25, r13 234b0: ae 1d adc r26, r14 234b2: bf 1d adc r27, r15 bias = constrain(bias, 20 ,(extruder<0?(MAX_BED_POWER):(PID_MAX))-20); 234b4: 84 31 cpi r24, 0x14 ; 20 234b6: 91 05 cpc r25, r1 234b8: a1 05 cpc r26, r1 234ba: b1 05 cpc r27, r1 234bc: 0c f4 brge .+2 ; 0x234c0 234be: 3c c1 rjmp .+632 ; 0x23738 234c0: 6c 01 movw r12, r24 234c2: 7d 01 movw r14, r26 234c4: 3c ee ldi r19, 0xEC ; 236 234c6: c3 16 cp r12, r19 234c8: d1 04 cpc r13, r1 234ca: e1 04 cpc r14, r1 234cc: f1 04 cpc r15, r1 234ce: 2c f0 brlt .+10 ; 0x234da 234d0: 4b ee ldi r20, 0xEB ; 235 234d2: c4 2e mov r12, r20 234d4: d1 2c mov r13, r1 234d6: e1 2c mov r14, r1 234d8: f1 2c mov r15, r1 if(bias > (extruder<0?(MAX_BED_POWER):(PID_MAX))/2) d = (extruder<0?(MAX_BED_POWER):(PID_MAX)) - 1 - bias; 234da: 80 38 cpi r24, 0x80 ; 128 234dc: 91 05 cpc r25, r1 234de: a1 05 cpc r26, r1 234e0: b1 05 cpc r27, r1 234e2: 0c f4 brge .+2 ; 0x234e6 234e4: 37 c1 rjmp .+622 ; 0x23754 234e6: 8e ef ldi r24, 0xFE ; 254 234e8: 90 e0 ldi r25, 0x00 ; 0 234ea: a0 e0 ldi r26, 0x00 ; 0 234ec: b0 e0 ldi r27, 0x00 ; 0 234ee: 8c 19 sub r24, r12 234f0: 9d 09 sbc r25, r13 234f2: ae 09 sbc r26, r14 234f4: bf 09 sbc r27, r15 234f6: 89 83 std Y+1, r24 ; 0x01 234f8: 9a 83 std Y+2, r25 ; 0x02 234fa: ab 83 std Y+3, r26 ; 0x03 234fc: bc 83 std Y+4, r27 ; 0x04 else d = bias; SERIAL_PROTOCOLPGM(" bias: "); SERIAL_PROTOCOL(bias); 234fe: 80 ee ldi r24, 0xE0 ; 224 23500: 91 e9 ldi r25, 0x91 ; 145 23502: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 23506: c7 01 movw r24, r14 23508: b6 01 movw r22, r12 2350a: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_PROTOCOLPGM(" d: "); SERIAL_PROTOCOL(d); 2350e: 8b ed ldi r24, 0xDB ; 219 23510: 91 e9 ldi r25, 0x91 ; 145 23512: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 23516: 69 81 ldd r22, Y+1 ; 0x01 23518: 7a 81 ldd r23, Y+2 ; 0x02 2351a: 8b 81 ldd r24, Y+3 ; 0x03 2351c: 9c 81 ldd r25, Y+4 ; 0x04 2351e: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_PROTOCOLPGM(" min: "); SERIAL_PROTOCOL(min); 23522: 84 ed ldi r24, 0xD4 ; 212 23524: 91 e9 ldi r25, 0x91 ; 145 23526: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 2352a: 42 e0 ldi r20, 0x02 ; 2 2352c: 6a 89 ldd r22, Y+18 ; 0x12 2352e: 7b 89 ldd r23, Y+19 ; 0x13 23530: 8c 89 ldd r24, Y+20 ; 0x14 23532: 9d 89 ldd r25, Y+21 ; 0x15 23534: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOLPGM(" max: "); SERIAL_PROTOCOLLN(max); 23538: 8d ec ldi r24, 0xCD ; 205 2353a: 91 e9 ldi r25, 0x91 ; 145 2353c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 23540: 6e 89 ldd r22, Y+22 ; 0x16 23542: 7f 89 ldd r23, Y+23 ; 0x17 23544: 88 8d ldd r24, Y+24 ; 0x18 23546: 99 8d ldd r25, Y+25 ; 0x19 23548: 0f 94 8d 41 call 0x2831a ; 0x2831a if(pid_cycle > 2) { 2354c: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 23550: 90 91 70 06 lds r25, 0x0670 ; 0x800670 23554: 03 97 sbiw r24, 0x03 ; 3 23556: 0c f4 brge .+2 ; 0x2355a 23558: ad c0 rjmp .+346 ; 0x236b4 Ku = (4.0*d)/(3.14159*(max-min)/2.0); 2355a: 69 81 ldd r22, Y+1 ; 0x01 2355c: 7a 81 ldd r23, Y+2 ; 0x02 2355e: 8b 81 ldd r24, Y+3 ; 0x03 23560: 9c 81 ldd r25, Y+4 ; 0x04 23562: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 23566: 20 e0 ldi r18, 0x00 ; 0 23568: 30 e0 ldi r19, 0x00 ; 0 2356a: 40 e8 ldi r20, 0x80 ; 128 2356c: 50 e4 ldi r21, 0x40 ; 64 2356e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 23572: 4b 01 movw r8, r22 23574: 5c 01 movw r10, r24 23576: 2a 89 ldd r18, Y+18 ; 0x12 23578: 3b 89 ldd r19, Y+19 ; 0x13 2357a: 4c 89 ldd r20, Y+20 ; 0x14 2357c: 5d 89 ldd r21, Y+21 ; 0x15 2357e: 6e 89 ldd r22, Y+22 ; 0x16 23580: 7f 89 ldd r23, Y+23 ; 0x17 23582: 88 8d ldd r24, Y+24 ; 0x18 23584: 99 8d ldd r25, Y+25 ; 0x19 23586: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 2358a: 20 ed ldi r18, 0xD0 ; 208 2358c: 3f e0 ldi r19, 0x0F ; 15 2358e: 49 e4 ldi r20, 0x49 ; 73 23590: 50 e4 ldi r21, 0x40 ; 64 23592: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 23596: 20 e0 ldi r18, 0x00 ; 0 23598: 30 e0 ldi r19, 0x00 ; 0 2359a: 40 e0 ldi r20, 0x00 ; 0 2359c: 5f e3 ldi r21, 0x3F ; 63 2359e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 235a2: 9b 01 movw r18, r22 235a4: ac 01 movw r20, r24 235a6: c5 01 movw r24, r10 235a8: b4 01 movw r22, r8 235aa: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 235ae: 4b 01 movw r8, r22 235b0: 5c 01 movw r10, r24 Tu = ((float)(t_low + t_high)/1000.0); 235b2: c3 01 movw r24, r6 235b4: b2 01 movw r22, r4 235b6: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 235ba: 20 e0 ldi r18, 0x00 ; 0 235bc: 30 e0 ldi r19, 0x00 ; 0 235be: 4a e7 ldi r20, 0x7A ; 122 235c0: 54 e4 ldi r21, 0x44 ; 68 235c2: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 235c6: 2b 01 movw r4, r22 235c8: 3c 01 movw r6, r24 SERIAL_PROTOCOLPGM(" Ku: "); SERIAL_PROTOCOL(Ku); 235ca: 87 ec ldi r24, 0xC7 ; 199 235cc: 91 e9 ldi r25, 0x91 ; 145 235ce: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 235d2: 42 e0 ldi r20, 0x02 ; 2 235d4: c5 01 movw r24, r10 235d6: b4 01 movw r22, r8 235d8: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOLPGM(" Tu: "); SERIAL_PROTOCOLLN(Tu); 235dc: 81 ec ldi r24, 0xC1 ; 193 235de: 91 e9 ldi r25, 0x91 ; 145 235e0: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 235e4: c3 01 movw r24, r6 235e6: b2 01 movw r22, r4 235e8: 0f 94 8d 41 call 0x2831a ; 0x2831a _Kp = 0.6*Ku; 235ec: 2a e9 ldi r18, 0x9A ; 154 235ee: 39 e9 ldi r19, 0x99 ; 153 235f0: 49 e1 ldi r20, 0x19 ; 25 235f2: 5f e3 ldi r21, 0x3F ; 63 235f4: c5 01 movw r24, r10 235f6: b4 01 movw r22, r8 235f8: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 235fc: 4b 01 movw r8, r22 235fe: 5c 01 movw r10, r24 23600: 80 92 a8 03 sts 0x03A8, r8 ; 0x8003a8 <_Kp> 23604: 90 92 a9 03 sts 0x03A9, r9 ; 0x8003a9 <_Kp+0x1> 23608: a0 92 aa 03 sts 0x03AA, r10 ; 0x8003aa <_Kp+0x2> 2360c: b0 92 ab 03 sts 0x03AB, r11 ; 0x8003ab <_Kp+0x3> _Ki = 2*_Kp/Tu; 23610: ac 01 movw r20, r24 23612: 9b 01 movw r18, r22 23614: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 23618: a3 01 movw r20, r6 2361a: 92 01 movw r18, r4 2361c: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 23620: 60 93 a4 03 sts 0x03A4, r22 ; 0x8003a4 <_Ki> 23624: 70 93 a5 03 sts 0x03A5, r23 ; 0x8003a5 <_Ki+0x1> 23628: 80 93 a6 03 sts 0x03A6, r24 ; 0x8003a6 <_Ki+0x2> 2362c: 90 93 a7 03 sts 0x03A7, r25 ; 0x8003a7 <_Ki+0x3> _Kd = _Kp*Tu/8; 23630: a3 01 movw r20, r6 23632: 92 01 movw r18, r4 23634: c5 01 movw r24, r10 23636: b4 01 movw r22, r8 23638: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2363c: 20 e0 ldi r18, 0x00 ; 0 2363e: 30 e0 ldi r19, 0x00 ; 0 23640: 40 e0 ldi r20, 0x00 ; 0 23642: 5e e3 ldi r21, 0x3E ; 62 23644: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 23648: 60 93 a0 03 sts 0x03A0, r22 ; 0x8003a0 <_Kd> 2364c: 70 93 a1 03 sts 0x03A1, r23 ; 0x8003a1 <_Kd+0x1> 23650: 80 93 a2 03 sts 0x03A2, r24 ; 0x8003a2 <_Kd+0x2> 23654: 90 93 a3 03 sts 0x03A3, r25 ; 0x8003a3 <_Kd+0x3> SERIAL_PROTOCOLLNPGM(" Classic PID "); 23658: 83 eb ldi r24, 0xB3 ; 179 2365a: 91 e9 ldi r25, 0x91 ; 145 2365c: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(_Kp); 23660: 8d ea ldi r24, 0xAD ; 173 23662: 91 e9 ldi r25, 0x91 ; 145 23664: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 23668: 60 91 a8 03 lds r22, 0x03A8 ; 0x8003a8 <_Kp> 2366c: 70 91 a9 03 lds r23, 0x03A9 ; 0x8003a9 <_Kp+0x1> 23670: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa <_Kp+0x2> 23674: 90 91 ab 03 lds r25, 0x03AB ; 0x8003ab <_Kp+0x3> 23678: 0f 94 8d 41 call 0x2831a ; 0x2831a SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); 2367c: 87 ea ldi r24, 0xA7 ; 167 2367e: 91 e9 ldi r25, 0x91 ; 145 23680: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 23684: 60 91 a4 03 lds r22, 0x03A4 ; 0x8003a4 <_Ki> 23688: 70 91 a5 03 lds r23, 0x03A5 ; 0x8003a5 <_Ki+0x1> 2368c: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 <_Ki+0x2> 23690: 90 91 a7 03 lds r25, 0x03A7 ; 0x8003a7 <_Ki+0x3> 23694: 0f 94 8d 41 call 0x2831a ; 0x2831a SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); 23698: 81 ea ldi r24, 0xA1 ; 161 2369a: 91 e9 ldi r25, 0x91 ; 145 2369c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 236a0: 60 91 a0 03 lds r22, 0x03A0 ; 0x8003a0 <_Kd> 236a4: 70 91 a1 03 lds r23, 0x03A1 ; 0x8003a1 <_Kd+0x1> 236a8: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 <_Kd+0x2> 236ac: 90 91 a3 03 lds r25, 0x03A3 ; 0x8003a3 <_Kd+0x3> 236b0: 0f 94 8d 41 call 0x2831a ; 0x2831a 236b4: 89 81 ldd r24, Y+1 ; 0x01 236b6: 9a 81 ldd r25, Y+2 ; 0x02 236b8: ab 81 ldd r26, Y+3 ; 0x03 236ba: bc 81 ldd r27, Y+4 ; 0x04 236bc: 8c 0d add r24, r12 236be: 9d 1d adc r25, r13 236c0: ae 1d adc r26, r14 236c2: bf 1d adc r27, r15 236c4: b5 95 asr r27 236c6: a7 95 ror r26 236c8: 97 95 ror r25 236ca: 87 95 ror r24 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); */ } } if (extruder<0) 236cc: 21 14 cp r2, r1 236ce: 31 04 cpc r3, r1 236d0: 09 f4 brne .+2 ; 0x236d4 236d2: 45 c0 rjmp .+138 ; 0x2375e { soft_pwm_bed = (bias + d) >> 1; 236d4: 80 93 5b 06 sts 0x065B, r24 ; 0x80065b } else soft_pwm[extruder] = (bias + d) >> 1; pid_cycle++; 236d8: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 236dc: 90 91 70 06 lds r25, 0x0670 ; 0x800670 236e0: 01 96 adiw r24, 0x01 ; 1 236e2: 90 93 70 06 sts 0x0670, r25 ; 0x800670 236e6: 80 93 6f 06 sts 0x066F, r24 ; 0x80066f min=temp; 236ea: 3a 85 ldd r19, Y+10 ; 0x0a 236ec: 3a 8b std Y+18, r19 ; 0x12 236ee: 4b 85 ldd r20, Y+11 ; 0x0b 236f0: 4b 8b std Y+19, r20 ; 0x13 236f2: 5c 85 ldd r21, Y+12 ; 0x0c 236f4: 5c 8b std Y+20, r21 ; 0x14 236f6: 8d 85 ldd r24, Y+13 ; 0x0d 236f8: 8d 8b std Y+21, r24 ; 0x15 max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; 236fa: 98 a5 ldd r25, Y+40 ; 0x28 236fc: 9a 8f std Y+26, r25 ; 0x1a } } #ifndef MAX_OVERSHOOT_PID_AUTOTUNE #define MAX_OVERSHOOT_PID_AUTOTUNE 20 #endif if(input > (temp + MAX_OVERSHOOT_PID_AUTOTUNE)) { 236fe: 20 e0 ldi r18, 0x00 ; 0 23700: 30 e0 ldi r19, 0x00 ; 0 23702: 40 ea ldi r20, 0xA0 ; 160 23704: 51 e4 ldi r21, 0x41 ; 65 23706: 6a 85 ldd r22, Y+10 ; 0x0a 23708: 7b 85 ldd r23, Y+11 ; 0x0b 2370a: 8c 85 ldd r24, Y+12 ; 0x0c 2370c: 9d 85 ldd r25, Y+13 ; 0x0d 2370e: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 23712: 98 01 movw r18, r16 23714: 48 a9 ldd r20, Y+48 ; 0x30 23716: 5f a5 ldd r21, Y+47 ; 0x2f 23718: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 2371c: 87 ff sbrs r24, 7 2371e: 22 c0 rjmp .+68 ; 0x23764 SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); 23720: 87 e7 ldi r24, 0x77 ; 119 23722: 91 e9 ldi r25, 0x91 ; 145 pid_tuning_finished = true; pid_cycle = 0; return; } if(pid_cycle > ncycles) { SERIAL_PROTOCOLLNPGM("PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"); 23724: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 pid_tuning_finished = true; 23728: 81 e0 ldi r24, 0x01 ; 1 2372a: 80 93 41 02 sts 0x0241, r24 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.423> pid_cycle = 0; 2372e: 10 92 70 06 sts 0x0670, r1 ; 0x800670 23732: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f 23736: 98 c0 rjmp .+304 ; 0x23868 heating=true; t2=_millis(); t_low=t2 - t1; if(pid_cycle > 0) { bias += (d*(t_high - t_low))/(t_low + t_high); bias = constrain(bias, 20 ,(extruder<0?(MAX_BED_POWER):(PID_MAX))-20); 23738: 34 e1 ldi r19, 0x14 ; 20 2373a: c3 2e mov r12, r19 2373c: d1 2c mov r13, r1 2373e: e1 2c mov r14, r1 23740: f1 2c mov r15, r1 23742: 24 e1 ldi r18, 0x14 ; 20 23744: 30 e0 ldi r19, 0x00 ; 0 23746: 40 e0 ldi r20, 0x00 ; 0 23748: 50 e0 ldi r21, 0x00 ; 0 2374a: 29 83 std Y+1, r18 ; 0x01 2374c: 3a 83 std Y+2, r19 ; 0x02 2374e: 4b 83 std Y+3, r20 ; 0x03 23750: 5c 83 std Y+4, r21 ; 0x04 23752: d5 ce rjmp .-598 ; 0x234fe 23754: c9 82 std Y+1, r12 ; 0x01 23756: da 82 std Y+2, r13 ; 0x02 23758: eb 82 std Y+3, r14 ; 0x03 2375a: fc 82 std Y+4, r15 ; 0x04 2375c: d0 ce rjmp .-608 ; 0x234fe if (extruder<0) { soft_pwm_bed = (bias + d) >> 1; } else soft_pwm[extruder] = (bias + d) >> 1; 2375e: 80 93 62 06 sts 0x0662, r24 ; 0x800662 <_ZL8soft_pwm.lto_priv.506> 23762: ba cf rjmp .-140 ; 0x236d8 SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); pid_tuning_finished = true; pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { 23764: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 23768: 28 a1 ldd r18, Y+32 ; 0x20 2376a: 39 a1 ldd r19, Y+33 ; 0x21 2376c: 4a a1 ldd r20, Y+34 ; 0x22 2376e: 5b a1 ldd r21, Y+35 ; 0x23 23770: 62 1b sub r22, r18 23772: 73 0b sbc r23, r19 23774: 84 0b sbc r24, r20 23776: 95 0b sbc r25, r21 23778: 61 3d cpi r22, 0xD1 ; 209 2377a: 77 40 sbci r23, 0x07 ; 7 2377c: 81 05 cpc r24, r1 2377e: 91 05 cpc r25, r1 23780: 58 f1 brcs .+86 ; 0x237d8 int p; if (extruder<0){ p=soft_pwm_bed; 23782: a0 90 5b 06 lds r10, 0x065B ; 0x80065b 23786: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("B:"); 23788: 84 e7 ldi r24, 0x74 ; 116 2378a: 91 e9 ldi r25, 0x91 ; 145 pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { int p; if (extruder<0){ 2378c: 21 14 cp r2, r1 2378e: 31 04 cpc r3, r1 23790: 29 f4 brne .+10 ; 0x2379c p=soft_pwm_bed; SERIAL_PROTOCOLPGM("B:"); }else{ p=soft_pwm[extruder]; 23792: a0 90 62 06 lds r10, 0x0662 ; 0x800662 <_ZL8soft_pwm.lto_priv.506> 23796: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("T:"); 23798: 81 e7 ldi r24, 0x71 ; 113 2379a: 91 e9 ldi r25, 0x91 ; 145 2379c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 237a0: 42 e0 ldi r20, 0x02 ; 2 237a2: b8 01 movw r22, r16 237a4: 88 a9 ldd r24, Y+48 ; 0x30 237a6: 9f a5 ldd r25, Y+47 ; 0x2f 237a8: 0f 94 49 97 call 0x32e92 ; 0x32e92 } SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); 237ac: 8d e6 ldi r24, 0x6D ; 109 237ae: 91 e9 ldi r25, 0x91 ; 145 237b0: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_PROTOCOLLN(p); 237b4: c5 01 movw r24, r10 237b6: 0f 94 aa 41 call 0x28354 ; 0x28354 if (safety_check_cycles == 0) { //save ambient temp 237ba: 4d 81 ldd r20, Y+5 ; 0x05 237bc: 44 23 and r20, r20 237be: 09 f4 brne .+2 ; 0x237c2 237c0: 6c c0 rjmp .+216 ; 0x2389a temp_ambient = input; //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; } else if (safety_check_cycles < safety_check_cycles_count) { //delay 237c2: 5f 8d ldd r21, Y+31 ; 0x1f 237c4: 45 17 cp r20, r21 237c6: 70 f5 brcc .+92 ; 0x23824 safety_check_cycles++; 237c8: 4f 5f subi r20, 0xFF ; 255 237ca: 4d 83 std Y+5, r20 ; 0x05 temp_runaway_stop(false, (extruder<0)); pid_tuning_finished = true; return; } } temp_millis = _millis(); 237cc: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 237d0: 68 a3 std Y+32, r22 ; 0x20 237d2: 79 a3 std Y+33, r23 ; 0x21 237d4: 8a a3 std Y+34, r24 ; 0x22 237d6: 9b a3 std Y+35, r25 ; 0x23 } if(((_millis() - t1) + (_millis() - t2)) > (10L*60L*1000L*2L)) { 237d8: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 237dc: 4b 01 movw r8, r22 237de: 5c 01 movw r10, r24 237e0: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 237e4: 4e 80 ldd r4, Y+6 ; 0x06 237e6: 5f 80 ldd r5, Y+7 ; 0x07 237e8: 68 84 ldd r6, Y+8 ; 0x08 237ea: 79 84 ldd r7, Y+9 ; 0x09 237ec: 2e 85 ldd r18, Y+14 ; 0x0e 237ee: 3f 85 ldd r19, Y+15 ; 0x0f 237f0: 48 89 ldd r20, Y+16 ; 0x10 237f2: 59 89 ldd r21, Y+17 ; 0x11 237f4: 42 0e add r4, r18 237f6: 53 1e adc r5, r19 237f8: 64 1e adc r6, r20 237fa: 75 1e adc r7, r21 237fc: 84 18 sub r8, r4 237fe: 95 08 sbc r9, r5 23800: a6 08 sbc r10, r6 23802: b7 08 sbc r11, r7 23804: 86 0e add r8, r22 23806: 97 1e adc r9, r23 23808: a8 1e adc r10, r24 2380a: b9 1e adc r11, r25 2380c: 31 e8 ldi r19, 0x81 ; 129 2380e: 83 16 cp r8, r19 23810: 3f e4 ldi r19, 0x4F ; 79 23812: 93 06 cpc r9, r19 23814: 32 e1 ldi r19, 0x12 ; 18 23816: a3 06 cpc r10, r19 23818: b1 04 cpc r11, r1 2381a: 08 f4 brcc .+2 ; 0x2381e 2381c: 47 c0 rjmp .+142 ; 0x238ac SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); 2381e: 80 e5 ldi r24, 0x50 ; 80 23820: 91 e9 ldi r25, 0x91 ; 145 23822: 80 cf rjmp .-256 ; 0x23724 safety_check_cycles++; } else if (safety_check_cycles < safety_check_cycles_count) { //delay safety_check_cycles++; } else if (safety_check_cycles == safety_check_cycles_count){ //check that temperature is rising 23824: 8d 81 ldd r24, Y+5 ; 0x05 23826: 9f 8d ldd r25, Y+31 ; 0x1f 23828: 89 13 cpse r24, r25 2382a: d0 cf rjmp .-96 ; 0x237cc safety_check_cycles++; 2382c: 8f 5f subi r24, 0xFF ; 255 2382e: 8d 83 std Y+5, r24 ; 0x05 //SERIAL_ECHOPGM("Time from beginning: "); //MYSERIAL.print(safety_check_cycles_count * 2); //SERIAL_ECHOPGM("s. Difference between current and ambient T: "); //MYSERIAL.println(input - temp_ambient); if (fabs(input - temp_ambient) < 5.0) { 23830: 2b a5 ldd r18, Y+43 ; 0x2b 23832: 3c a5 ldd r19, Y+44 ; 0x2c 23834: 4d a5 ldd r20, Y+45 ; 0x2d 23836: 5e a5 ldd r21, Y+46 ; 0x2e 23838: b8 01 movw r22, r16 2383a: 88 a9 ldd r24, Y+48 ; 0x30 2383c: 9f a5 ldd r25, Y+47 ; 0x2f 2383e: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 23842: 9f 77 andi r25, 0x7F ; 127 23844: 20 e0 ldi r18, 0x00 ; 0 23846: 30 e0 ldi r19, 0x00 ; 0 23848: 40 ea ldi r20, 0xA0 ; 160 2384a: 50 e4 ldi r21, 0x40 ; 64 2384c: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 23850: 87 ff sbrs r24, 7 23852: bc cf rjmp .-136 ; 0x237cc temp_runaway_stop(false, (extruder<0)); 23854: 63 2d mov r22, r3 23856: 66 1f adc r22, r22 23858: 66 27 eor r22, r22 2385a: 66 1f adc r22, r22 2385c: 80 e0 ldi r24, 0x00 ; 0 2385e: 0f 94 75 09 call 0x212ea ; 0x212ea pid_tuning_finished = true; 23862: 81 e0 ldi r24, 0x01 ; 1 23864: 80 93 41 02 sts 0x0241, r24 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.423> pid_cycle = 0; return; } lcd_update(0); } } 23868: e0 96 adiw r28, 0x30 ; 48 2386a: 0f b6 in r0, 0x3f ; 63 2386c: f8 94 cli 2386e: de bf out 0x3e, r29 ; 62 23870: 0f be out 0x3f, r0 ; 63 23872: cd bf out 0x3d, r28 ; 61 23874: df 91 pop r29 23876: cf 91 pop r28 23878: 1f 91 pop r17 2387a: 0f 91 pop r16 2387c: ff 90 pop r15 2387e: ef 90 pop r14 23880: df 90 pop r13 23882: cf 90 pop r12 23884: bf 90 pop r11 23886: af 90 pop r10 23888: 9f 90 pop r9 2388a: 8f 90 pop r8 2388c: 7f 90 pop r7 2388e: 6f 90 pop r6 23890: 5f 90 pop r5 23892: 4f 90 pop r4 23894: 3f 90 pop r3 23896: 2f 90 pop r2 23898: 08 95 ret SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); SERIAL_PROTOCOLLN(p); if (safety_check_cycles == 0) { //save ambient temp temp_ambient = input; 2389a: 0b a7 std Y+43, r16 ; 0x2b 2389c: 1c a7 std Y+44, r17 ; 0x2c 2389e: a8 a9 ldd r26, Y+48 ; 0x30 238a0: ad a7 std Y+45, r26 ; 0x2d 238a2: bf a5 ldd r27, Y+47 ; 0x2f 238a4: be a7 std Y+46, r27 ; 0x2e //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; 238a6: 21 e0 ldi r18, 0x01 ; 1 238a8: 2d 83 std Y+5, r18 ; 0x05 238aa: 90 cf rjmp .-224 ; 0x237cc SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); pid_tuning_finished = true; pid_cycle = 0; return; } if(pid_cycle > ncycles) { 238ac: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 238b0: 90 91 70 06 lds r25, 0x0670 ; 0x800670 238b4: 49 a5 ldd r20, Y+41 ; 0x29 238b6: 5a a5 ldd r21, Y+42 ; 0x2a 238b8: 48 17 cp r20, r24 238ba: 59 07 cpc r21, r25 238bc: 1c f4 brge .+6 ; 0x238c4 SERIAL_PROTOCOLLNPGM("PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"); 238be: 84 ef ldi r24, 0xF4 ; 244 238c0: 90 e9 ldi r25, 0x90 ; 144 238c2: 30 cf rjmp .-416 ; 0x23724 pid_tuning_finished = true; pid_cycle = 0; return; } lcd_update(0); 238c4: 80 e0 ldi r24, 0x00 ; 0 238c6: 0e 94 42 69 call 0xd284 ; 0xd284 238ca: e6 cc rjmp .-1588 ; 0x23298 000238cc : startTimestamp = 0; stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { 238cc: 0f 93 push r16 238ce: 1f 93 push r17 return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 238d0: 80 91 59 03 lds r24, 0x0359 ; 0x800359 238d4: 81 30 cpi r24, 0x01 ; 1 238d6: 19 f5 brne .+70 ; 0x2391e 238d8: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 238dc: 00 91 e9 05 lds r16, 0x05E9 ; 0x8005e9 238e0: 10 91 ea 05 lds r17, 0x05EA ; 0x8005ea 238e4: 20 91 eb 05 lds r18, 0x05EB ; 0x8005eb 238e8: 30 91 ec 05 lds r19, 0x05EC ; 0x8005ec 238ec: 60 1b sub r22, r16 238ee: 71 0b sbc r23, r17 238f0: 82 0b sbc r24, r18 238f2: 93 0b sbc r25, r19 238f4: 28 ee ldi r18, 0xE8 ; 232 238f6: 33 e0 ldi r19, 0x03 ; 3 238f8: 40 e0 ldi r20, 0x00 ; 0 238fa: 50 e0 ldi r21, 0x00 ; 0 238fc: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> 23900: 60 91 e5 05 lds r22, 0x05E5 ; 0x8005e5 23904: 70 91 e6 05 lds r23, 0x05E6 ; 0x8005e6 23908: 80 91 e7 05 lds r24, 0x05E7 ; 0x8005e7 2390c: 90 91 e8 05 lds r25, 0x05E8 ; 0x8005e8 23910: 62 0f add r22, r18 23912: 73 1f adc r23, r19 23914: 84 1f adc r24, r20 23916: 95 1f adc r25, r21 } 23918: 1f 91 pop r17 2391a: 0f 91 pop r16 2391c: 08 95 ret stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 2391e: 60 91 78 06 lds r22, 0x0678 ; 0x800678 23922: 70 91 79 06 lds r23, 0x0679 ; 0x800679 23926: 80 91 7a 06 lds r24, 0x067A ; 0x80067a 2392a: 90 91 7b 06 lds r25, 0x067B ; 0x80067b 2392e: d6 cf rjmp .-84 ; 0x238dc 00023930 : //! |Total print time: | MSG_TOTAL_PRINT_TIME c=19 //! | 00d 00h 00m | //! ---------------------- //! @endcode void lcd_menu_statistics() { 23930: 4f 92 push r4 23932: 5f 92 push r5 23934: 6f 92 push r6 23936: 7f 92 push r7 23938: 8f 92 push r8 2393a: 9f 92 push r9 2393c: af 92 push r10 2393e: bf 92 push r11 23940: cf 92 push r12 23942: df 92 push r13 23944: ef 92 push r14 23946: ff 92 push r15 23948: 0f 93 push r16 2394a: 1f 93 push r17 2394c: cf 93 push r28 2394e: df 93 push r29 23950: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout if (printJobOngoing()) 23954: 0e 94 c8 60 call 0xc190 ; 0xc190 23958: 88 23 and r24, r24 2395a: 09 f4 brne .+2 ; 0x2395e 2395c: 6e c0 rjmp .+220 ; 0x23a3a { const float _met = ((float)total_filament_used) / (100000.f); 2395e: 60 91 84 06 lds r22, 0x0684 ; 0x800684 23962: 70 91 85 06 lds r23, 0x0685 ; 0x800685 23966: 80 91 86 06 lds r24, 0x0686 ; 0x800686 2396a: 90 91 87 06 lds r25, 0x0687 ; 0x800687 2396e: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 23972: 20 e0 ldi r18, 0x00 ; 0 23974: 30 e5 ldi r19, 0x50 ; 80 23976: 43 ec ldi r20, 0xC3 ; 195 23978: 57 e4 ldi r21, 0x47 ; 71 2397a: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2397e: 56 2e mov r5, r22 23980: 47 2e mov r4, r23 23982: ec 01 movw r28, r24 const uint32_t _t = print_job_timer.duration(); 23984: 0f 94 66 1c call 0x238cc ; 0x238cc 23988: 6b 01 movw r12, r22 2398a: 7c 01 movw r14, r24 const uint32_t _h = (_t / 60) / 60; const uint8_t _m = (_t / 60) % 60; const uint8_t _s = _t % 60; lcd_home(); 2398c: 0e 94 a7 69 call 0xd34e ; 0xd34e lcd_printf_P(_N( 23990: 83 e1 ldi r24, 0x13 ; 19 23992: 9b e4 ldi r25, 0x4B ; 75 23994: 0e 94 b1 6c call 0xd962 ; 0xd962 23998: 18 2f mov r17, r24 2399a: 09 2f mov r16, r25 2399c: 83 e0 ldi r24, 0x03 ; 3 2399e: 9b e4 ldi r25, 0x4B ; 75 239a0: 0e 94 b1 6c call 0xd962 ; 0xd962 239a4: 78 2e mov r7, r24 239a6: 69 2e mov r6, r25 const float _met = ((float)total_filament_used) / (100000.f); const uint32_t _t = print_job_timer.duration(); const uint32_t _h = (_t / 60) / 60; const uint8_t _m = (_t / 60) % 60; const uint8_t _s = _t % 60; 239a8: 8c e3 ldi r24, 0x3C ; 60 239aa: 88 2e mov r8, r24 239ac: 91 2c mov r9, r1 239ae: a1 2c mov r10, r1 239b0: b1 2c mov r11, r1 239b2: c7 01 movw r24, r14 239b4: b6 01 movw r22, r12 239b6: a5 01 movw r20, r10 239b8: 94 01 movw r18, r8 239ba: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 239be: 7f 93 push r23 239c0: 6f 93 push r22 { const float _met = ((float)total_filament_used) / (100000.f); const uint32_t _t = print_job_timer.duration(); const uint32_t _h = (_t / 60) / 60; const uint8_t _m = (_t / 60) % 60; 239c2: ca 01 movw r24, r20 239c4: b9 01 movw r22, r18 239c6: a5 01 movw r20, r10 239c8: 94 01 movw r18, r8 239ca: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 239ce: 7f 93 push r23 239d0: 6f 93 push r22 if (printJobOngoing()) { const float _met = ((float)total_filament_used) / (100000.f); const uint32_t _t = print_job_timer.duration(); const uint32_t _h = (_t / 60) / 60; 239d2: c7 01 movw r24, r14 239d4: b6 01 movw r22, r12 239d6: 20 e1 ldi r18, 0x10 ; 16 239d8: 3e e0 ldi r19, 0x0E ; 14 239da: 40 e0 ldi r20, 0x00 ; 0 239dc: 50 e0 ldi r21, 0x00 ; 0 239de: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> const uint8_t _m = (_t / 60) % 60; const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 239e2: 5f 93 push r21 239e4: 4f 93 push r20 239e6: 3f 93 push r19 239e8: 2f 93 push r18 239ea: 0f 93 push r16 239ec: 1f 93 push r17 239ee: df 93 push r29 239f0: cf 93 push r28 239f2: 4f 92 push r4 239f4: 5f 92 push r5 239f6: 6f 92 push r6 239f8: 7f 92 push r7 239fa: 8c eb ldi r24, 0xBC ; 188 239fc: 9a e6 ldi r25, 0x6A ; 106 239fe: 9f 93 push r25 23a00: 8f 93 push r24 23a02: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 "%S:\n" "%10ldh %02dm %02ds" ), _T(MSG_FILAMENT_USED), _met, _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); 23a06: 8d b7 in r24, 0x3d ; 61 23a08: 9e b7 in r25, 0x3e ; 62 23a0a: 42 96 adiw r24, 0x12 ; 18 23a0c: 0f b6 in r0, 0x3f ; 63 23a0e: f8 94 cli 23a10: 9e bf out 0x3e, r25 ; 62 23a12: 0f be out 0x3f, r0 ; 63 23a14: 8d bf out 0x3d, r24 ; 61 ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); } } 23a16: df 91 pop r29 23a18: cf 91 pop r28 23a1a: 1f 91 pop r17 23a1c: 0f 91 pop r16 23a1e: ff 90 pop r15 23a20: ef 90 pop r14 23a22: df 90 pop r13 23a24: cf 90 pop r12 23a26: bf 90 pop r11 23a28: af 90 pop r10 23a2a: 9f 90 pop r9 23a2c: 8f 90 pop r8 23a2e: 7f 90 pop r7 23a30: 6f 90 pop r6 23a32: 5f 90 pop r5 23a34: 4f 90 pop r4 "%S:\n" "%10ldd %02dh %02dm" ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); 23a36: 0d 94 26 96 jmp 0x32c4c ; 0x32c4c _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); } else { uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in centimeters 23a3a: 81 ef ldi r24, 0xF1 ; 241 23a3c: 9f e0 ldi r25, 0x0F ; 15 23a3e: 0f 94 e4 9f call 0x33fc8 ; 0x33fc8 23a42: 2b 01 movw r4, r22 23a44: 3c 01 movw r6, r24 uint32_t _time = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); // in minutes 23a46: 8d ee ldi r24, 0xED ; 237 23a48: 9f e0 ldi r25, 0x0F ; 15 23a4a: 0f 94 e4 9f call 0x33fc8 ; 0x33fc8 23a4e: 6b 01 movw r12, r22 23a50: 7c 01 movw r14, r24 float _filament_m = (float)_filament/100; _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); 23a52: 0e 94 a7 69 call 0xd34e ; 0xd34e lcd_printf_P(_N( 23a56: 80 ef ldi r24, 0xF0 ; 240 23a58: 9a e4 ldi r25, 0x4A ; 74 23a5a: 0e 94 b1 6c call 0xd962 ; 0xd962 23a5e: 98 2e mov r9, r24 23a60: 89 2e mov r8, r25 23a62: 8f ed ldi r24, 0xDF ; 223 23a64: 9a e4 ldi r25, 0x4A ; 74 23a66: 0e 94 b1 6c call 0xd962 ; 0xd962 23a6a: b8 2e mov r11, r24 23a6c: a9 2e mov r10, r25 uint8_t _hours, _minutes; uint32_t _days; float _filament_m = (float)_filament/100; _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; 23a6e: c7 01 movw r24, r14 23a70: b6 01 movw r22, r12 23a72: 2c e3 ldi r18, 0x3C ; 60 23a74: 30 e0 ldi r19, 0x00 ; 0 23a76: 40 e0 ldi r20, 0x00 ; 0 23a78: 50 e0 ldi r21, 0x00 ; 0 23a7a: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 23a7e: 7f 93 push r23 23a80: 6f 93 push r22 uint32_t _time = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); // in minutes uint8_t _hours, _minutes; uint32_t _days; float _filament_m = (float)_filament/100; _days = (_time / 60) / 24; _hours = (_time / 60) % 24; 23a82: ca 01 movw r24, r20 23a84: b9 01 movw r22, r18 23a86: 28 e1 ldi r18, 0x18 ; 24 23a88: 30 e0 ldi r19, 0x00 ; 0 23a8a: 40 e0 ldi r20, 0x00 ; 0 23a8c: 50 e0 ldi r21, 0x00 ; 0 23a8e: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 23a92: 7f 93 push r23 23a94: 6f 93 push r22 uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in centimeters uint32_t _time = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); // in minutes uint8_t _hours, _minutes; uint32_t _days; float _filament_m = (float)_filament/100; _days = (_time / 60) / 24; 23a96: c7 01 movw r24, r14 23a98: b6 01 movw r22, r12 23a9a: 20 ea ldi r18, 0xA0 ; 160 23a9c: 35 e0 ldi r19, 0x05 ; 5 23a9e: 40 e0 ldi r20, 0x00 ; 0 23aa0: 50 e0 ldi r21, 0x00 ; 0 23aa2: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 23aa6: 5f 93 push r21 23aa8: 4f 93 push r20 23aaa: 3f 93 push r19 23aac: 2f 93 push r18 23aae: 8f 92 push r8 23ab0: 9f 92 push r9 { uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in centimeters uint32_t _time = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); // in minutes uint8_t _hours, _minutes; uint32_t _days; float _filament_m = (float)_filament/100; 23ab2: c3 01 movw r24, r6 23ab4: b2 01 movw r22, r4 23ab6: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 23aba: 20 e0 ldi r18, 0x00 ; 0 23abc: 30 e0 ldi r19, 0x00 ; 0 23abe: 48 ec ldi r20, 0xC8 ; 200 23ac0: 52 e4 ldi r21, 0x42 ; 66 23ac2: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 23ac6: 9f 93 push r25 23ac8: 8f 93 push r24 23aca: 7f 93 push r23 23acc: 6f 93 push r22 23ace: af 92 push r10 23ad0: bf 92 push r11 23ad2: 88 e9 ldi r24, 0x98 ; 152 23ad4: 9a e6 ldi r25, 0x6A ; 106 23ad6: 9f 93 push r25 23ad8: 8f 93 push r24 23ada: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 "%S:\n" "%10ldd %02dh %02dm" ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); 23ade: 8d b7 in r24, 0x3d ; 61 23ae0: 9e b7 in r25, 0x3e ; 62 23ae2: 42 96 adiw r24, 0x12 ; 18 23ae4: 0f b6 in r0, 0x3f ; 63 23ae6: f8 94 cli 23ae8: 9e bf out 0x3e, r25 ; 62 23aea: 0f be out 0x3f, r0 ; 63 23aec: 8d bf out 0x3d, r24 ; 61 23aee: 93 cf rjmp .-218 ; 0x23a16 00023af0 : lcd_status_message_idx = 0; // Re-draw message from beginning } // Main status screen. It's up to the implementation specific part to show what is needed. As this is very display dependent void lcd_status_screen() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") { 23af0: cf 92 push r12 23af2: df 92 push r13 23af4: ef 92 push r14 23af6: ff 92 push r15 23af8: 0f 93 push r16 23afa: 1f 93 push r17 23afc: cf 93 push r28 23afe: df 93 push r29 23b00: 00 d0 rcall .+0 ; 0x23b02 23b02: 00 d0 rcall .+0 ; 0x23b04 23b04: 1f 92 push r1 23b06: 1f 92 push r1 23b08: cd b7 in r28, 0x3d ; 61 23b0a: de b7 in r29, 0x3e ; 62 static uint8_t lcd_status_update_delay = 0; #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) 23b0c: 80 91 06 05 lds r24, 0x0506 ; 0x800506 23b10: 90 91 07 05 lds r25, 0x0507 ; 0x800507 23b14: 00 97 sbiw r24, 0x00 ; 0 23b16: e1 f1 breq .+120 ; 0x23b90 { const int16_t initial_feedmultiply = feedmultiply; 23b18: 20 91 8e 02 lds r18, 0x028E ; 0x80028e 23b1c: 30 91 8f 02 lds r19, 0x028F ; 0x80028f // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 23b20: 24 36 cpi r18, 0x64 ; 100 23b22: 31 05 cpc r19, r1 23b24: 4c f4 brge .+18 ; 0x23b38 23b26: ac 01 movw r20, r24 23b28: 42 0f add r20, r18 23b2a: 53 1f adc r21, r19 23b2c: 45 36 cpi r20, 0x65 ; 101 23b2e: 51 05 cpc r21, r1 23b30: 6c f4 brge .+26 ; 0x23b4c feedmultiply += lcd_encoder - ENCODER_FEEDRATE_DEADZONE; } else if (feedmultiply == 100 && lcd_encoder < -ENCODER_FEEDRATE_DEADZONE) { feedmultiply += lcd_encoder + ENCODER_FEEDRATE_DEADZONE; } else if (feedmultiply != 100) feedmultiply += lcd_encoder; 23b32: 82 0f add r24, r18 23b34: 93 1f adc r25, r19 23b36: 0c c0 rjmp .+24 ; 0x23b50 #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) { const int16_t initial_feedmultiply = feedmultiply; // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 23b38: 24 36 cpi r18, 0x64 ; 100 23b3a: 31 05 cpc r19, r1 23b3c: 09 f4 brne .+2 ; 0x23b40 23b3e: 55 c0 rjmp .+170 ; 0x23bea (feedmultiply > 100 && (feedmultiply + lcd_encoder) < 100)) 23b40: ac 01 movw r20, r24 23b42: 42 0f add r20, r18 23b44: 53 1f adc r21, r19 23b46: 44 36 cpi r20, 0x64 ; 100 23b48: 51 05 cpc r21, r1 23b4a: 9c f7 brge .-26 ; 0x23b32 { feedmultiply = 100; 23b4c: 84 e6 ldi r24, 0x64 ; 100 23b4e: 90 e0 ldi r25, 0x00 ; 0 feedmultiply += lcd_encoder - ENCODER_FEEDRATE_DEADZONE; } else if (feedmultiply == 100 && lcd_encoder < -ENCODER_FEEDRATE_DEADZONE) { feedmultiply += lcd_encoder + ENCODER_FEEDRATE_DEADZONE; } else if (feedmultiply != 100) feedmultiply += lcd_encoder; 23b50: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 23b54: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e if (initial_feedmultiply != feedmultiply) { 23b58: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 23b5c: 90 91 8f 02 lds r25, 0x028F ; 0x80028f 23b60: 82 17 cp r24, r18 23b62: 93 07 cpc r25, r19 23b64: a9 f0 breq .+42 ; 0x23b90 feedmultiply = constrain(feedmultiply, 10, 999); 23b66: 88 3e cpi r24, 0xE8 ; 232 23b68: 53 e0 ldi r21, 0x03 ; 3 23b6a: 95 07 cpc r25, r21 23b6c: 14 f0 brlt .+4 ; 0x23b72 23b6e: 87 ee ldi r24, 0xE7 ; 231 23b70: 93 e0 ldi r25, 0x03 ; 3 23b72: 8a 30 cpi r24, 0x0A ; 10 23b74: 91 05 cpc r25, r1 23b76: 14 f4 brge .+4 ; 0x23b7c 23b78: 8a e0 ldi r24, 0x0A ; 10 23b7a: 90 e0 ldi r25, 0x00 ; 0 23b7c: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 23b80: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e lcd_encoder = 0; // Consume rotation event 23b84: 10 92 07 05 sts 0x0507, r1 ; 0x800507 23b88: 10 92 06 05 sts 0x0506, r1 ; 0x800506 refresh_saved_feedrate_multiplier_in_ram(); 23b8c: 0e 94 c5 5e call 0xbd8a ; 0xbd8a } } #endif //ULTIPANEL_FEEDMULTIPLY if (lcd_draw_update) { 23b90: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 23b94: 81 11 cpse r24, r1 // Update the status screen immediately lcd_status_update_delay = 0; 23b96: 10 92 77 06 sts 0x0677, r1 ; 0x800677 } if (lcd_status_update_delay) 23b9a: 10 91 77 06 lds r17, 0x0677 ; 0x800677 23b9e: 11 23 and r17, r17 23ba0: 91 f1 breq .+100 ; 0x23c06 lcd_status_update_delay--; 23ba2: 2f ef ldi r18, 0xFF ; 255 23ba4: 21 0f add r18, r17 23ba6: 20 93 77 06 sts 0x0677, r18 ; 0x800677 if (lcd_commands_type != LcdCommands::Idle) lcd_commands(); } if (!menu_is_any_block() && lcd_clicked()) { 23baa: 80 91 cd 11 lds r24, 0x11CD ; 0x8011cd 23bae: 81 11 cpse r24, r1 23bb0: 0d c0 rjmp .+26 ; 0x23bcc 23bb2: 0e 94 98 6b call 0xd730 ; 0xd730 23bb6: 88 23 and r24, r24 23bb8: 49 f0 breq .+18 ; 0x23bcc menu_depth = 0; //redundant, as already done in lcd_return_to_status(), just to be sure 23bba: 10 92 ad 03 sts 0x03AD, r1 ; 0x8003ad menu_submenu(lcd_main_menu); 23bbe: 60 e0 ldi r22, 0x00 ; 0 23bc0: 82 e0 ldi r24, 0x02 ; 2 23bc2: 94 ec ldi r25, 0xC4 ; 196 23bc4: 0f 94 29 94 call 0x32852 ; 0x32852 lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 23bc8: 0e 94 27 6a call 0xd44e ; 0xd44e } } 23bcc: 28 96 adiw r28, 0x08 ; 8 23bce: 0f b6 in r0, 0x3f ; 63 23bd0: f8 94 cli 23bd2: de bf out 0x3e, r29 ; 62 23bd4: 0f be out 0x3f, r0 ; 63 23bd6: cd bf out 0x3d, r28 ; 61 23bd8: df 91 pop r29 23bda: cf 91 pop r28 23bdc: 1f 91 pop r17 23bde: 0f 91 pop r16 23be0: ff 90 pop r15 23be2: ef 90 pop r14 23be4: df 90 pop r13 23be6: cf 90 pop r12 23be8: 08 95 ret if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || (feedmultiply > 100 && (feedmultiply + lcd_encoder) < 100)) { feedmultiply = 100; } else if (feedmultiply == 100 && lcd_encoder > ENCODER_FEEDRATE_DEADZONE) { 23bea: 8b 30 cpi r24, 0x0B ; 11 23bec: 91 05 cpc r25, r1 23bee: 1c f0 brlt .+6 ; 0x23bf6 feedmultiply += lcd_encoder - ENCODER_FEEDRATE_DEADZONE; 23bf0: 86 5a subi r24, 0xA6 ; 166 23bf2: 9f 4f sbci r25, 0xFF ; 255 23bf4: ad cf rjmp .-166 ; 0x23b50 } else if (feedmultiply == 100 && lcd_encoder < -ENCODER_FEEDRATE_DEADZONE) { 23bf6: 86 3f cpi r24, 0xF6 ; 246 23bf8: 4f ef ldi r20, 0xFF ; 255 23bfa: 94 07 cpc r25, r20 23bfc: 0c f0 brlt .+2 ; 0x23c00 23bfe: ac cf rjmp .-168 ; 0x23b58 feedmultiply += lcd_encoder + ENCODER_FEEDRATE_DEADZONE; 23c00: 82 59 subi r24, 0x92 ; 146 23c02: 9f 4f sbci r25, 0xFF ; 255 23c04: a5 cf rjmp .-182 ; 0x23b50 if (lcd_status_update_delay) lcd_status_update_delay--; else { // Redraw the main screen every second (see LCD_UPDATE_INTERVAL). // This is easier then trying keep track of all things that change on the screen lcd_status_update_delay = 10; 23c06: 6a e0 ldi r22, 0x0A ; 10 23c08: 60 93 77 06 sts 0x0677, r22 ; 0x800677 ReInitLCD++; 23c0c: 80 91 76 06 lds r24, 0x0676 ; 0x800676 23c10: 8f 5f subi r24, 0xFF ; 255 23c12: 80 93 76 06 sts 0x0676, r24 ; 0x800676 if (ReInitLCD == 30) 23c16: 8e 31 cpi r24, 0x1E ; 30 23c18: 09 f0 breq .+2 ; 0x23c1c 23c1a: 9f c0 rjmp .+318 ; 0x23d5a { ReInitLCD = 0 ; 23c1c: 10 92 76 06 sts 0x0676, r1 ; 0x800676 #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 23c20: 0e 94 27 6a call 0xd44e ; 0xd44e lcd_status_message_idx = 0; // Re-draw message from beginning 23c24: 10 92 08 05 sts 0x0508, r1 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.417> //! F - feedrate symbol LCD_STR_FEEDRATE //! t - clock symbol LCD_STR_THERMOMETER //! @endcode void lcdui_print_status_screen(void) { lcd_frame_start(); 23c28: 0e 94 2f 69 call 0xd25e ; 0xd25e lcd_home(); //line 0 23c2c: 0e 94 a7 69 call 0xd34e ; 0xd34e return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 23c30: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 23c34: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 23c38: 07 2e mov r0, r23 23c3a: 00 0c add r0, r0 23c3c: 88 0b sbc r24, r24 23c3e: 99 0b sbc r25, r25 23c40: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> //Print the hotend temperature (9 chars total) lcdui_print_temp(LCD_STR_THERMOMETER[0], (int)(degHotend(0) + 0.5), (int)(degTargetHotend(0) + 0.5)); 23c44: 20 e0 ldi r18, 0x00 ; 0 23c46: 30 e0 ldi r19, 0x00 ; 0 23c48: 40 e0 ldi r20, 0x00 ; 0 23c4a: 5f e3 ldi r21, 0x3F ; 63 23c4c: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 23c50: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 23c54: 6b 01 movw r12, r22 23c56: 20 e0 ldi r18, 0x00 ; 0 23c58: 30 e0 ldi r19, 0x00 ; 0 23c5a: 40 e0 ldi r20, 0x00 ; 0 23c5c: 5f e3 ldi r21, 0x3F ; 63 23c5e: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 23c62: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 23c66: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 23c6a: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 23c6e: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 23c72: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 23c76: a6 01 movw r20, r12 23c78: 82 e8 ldi r24, 0x82 ; 130 23c7a: 0f 94 c3 06 call 0x20d86 ; 0x20d86 lcd_space(3); //3 spaces 23c7e: 83 e0 ldi r24, 0x03 ; 3 23c80: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 } // Print Z-coordinate (8 chars total) void lcdui_print_Z_coord(void) { if (custom_message_type == CustomMsg::MeshBedLeveling) 23c84: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 23c88: 81 30 cpi r24, 0x01 ; 1 23c8a: 09 f0 breq .+2 ; 0x23c8e 23c8c: 6e c0 rjmp .+220 ; 0x23d6a lcd_puts_P(_N("Z --- ")); 23c8e: 85 ee ldi r24, 0xE5 ; 229 23c90: 99 e6 ldi r25, 0x69 ; 105 23c92: 0e 94 66 69 call 0xd2cc ; 0xd2cc lcd_space(3); //3 spaces //Print Z-coordinate (8 chars total) lcdui_print_Z_coord(); lcd_set_cursor(0, 1); //line 1 23c96: 61 e0 ldi r22, 0x01 ; 1 23c98: 80 e0 ldi r24, 0x00 ; 0 23c9a: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 23c9e: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 23ca2: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee 23ca6: 07 2e mov r0, r23 23ca8: 00 0c add r0, r0 23caa: 88 0b sbc r24, r24 23cac: 99 0b sbc r25, r25 23cae: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> //Print the Bed temperature (9 chars total) lcdui_print_temp(LCD_STR_BEDTEMP[0], (int)(degBed() + 0.5), (int)(degTargetBed() + 0.5)); 23cb2: 20 e0 ldi r18, 0x00 ; 0 23cb4: 30 e0 ldi r19, 0x00 ; 0 23cb6: 40 e0 ldi r20, 0x00 ; 0 23cb8: 5f e3 ldi r21, 0x3F ; 63 23cba: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 23cbe: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 23cc2: 6b 01 movw r12, r22 23cc4: 20 e0 ldi r18, 0x00 ; 0 23cc6: 30 e0 ldi r19, 0x00 ; 0 23cc8: 40 e0 ldi r20, 0x00 ; 0 23cca: 5f e3 ldi r21, 0x3F ; 63 23ccc: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 23cd0: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 23cd4: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 23cd8: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 23cdc: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 23ce0: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 23ce4: a6 01 movw r20, r12 23ce6: 80 e8 ldi r24, 0x80 ; 128 23ce8: 0f 94 c3 06 call 0x20d86 ; 0x20d86 lcd_space(3); //3 spaces 23cec: 83 e0 ldi r24, 0x03 ; 3 23cee: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 #endif // PLANNER_DIAGNOSTICS // Print feedrate (8 chars total) void lcdui_print_feedrate(void) { int chars = lcd_printf_P(_N(LCD_STR_FEEDRATE "%3d%%"), feedmultiply); 23cf2: 80 91 8f 02 lds r24, 0x028F ; 0x80028f 23cf6: 8f 93 push r24 23cf8: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 23cfc: 8f 93 push r24 23cfe: 8e ee ldi r24, 0xEE ; 238 23d00: 99 e6 ldi r25, 0x69 ; 105 23d02: 9f 93 push r25 23d04: 8f 93 push r24 23d06: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 lcd_space(8 - chars); 23d0a: 98 e0 ldi r25, 0x08 ; 8 23d0c: 98 1b sub r25, r24 23d0e: 89 2f mov r24, r25 23d10: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 #else // PLANNER_DIAGNOSTICS //Print Feedrate (8 chars) lcdui_print_feedrate(); #endif // PLANNER_DIAGNOSTICS lcd_set_cursor(0, 2); //line 2 23d14: 62 e0 ldi r22, 0x02 ; 2 23d16: 80 e0 ldi r24, 0x00 ; 0 23d18: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 } // Print percent done in form "USB---%", " SD---%", " ---%" (7 chars total) void lcdui_print_percent_done(void) { const char* src = usb_timer.running()?_N(" HO"):(IS_SD_PRINTING?_N(" SD"):_N(" ")); 23d1c: 0f 90 pop r0 23d1e: 0f 90 pop r0 23d20: 0f 90 pop r0 23d22: 0f 90 pop r0 23d24: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 23d28: e0 90 6a 13 lds r14, 0x136A ; 0x80136a 23d2c: 81 11 cpse r24, r1 23d2e: 3e c0 rjmp .+124 ; 0x23dac 23d30: 21 e0 ldi r18, 0x01 ; 1 23d32: c2 2e mov r12, r18 23d34: 2a e6 ldi r18, 0x6A ; 106 23d36: d2 2e mov r13, r18 23d38: e1 10 cpse r14, r1 23d3a: 3c c0 rjmp .+120 ; 0x23db4 23d3c: 85 e0 ldi r24, 0x05 ; 5 23d3e: c8 2e mov r12, r24 23d40: 8a e6 ldi r24, 0x6A ; 106 23d42: d8 2e mov r13, r24 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 23d44: 0e 94 19 61 call 0xc232 ; 0xc232 23d48: f8 2e mov r15, r24 23d4a: 88 23 and r24, r24 23d4c: d9 f1 breq .+118 ; 0x23dc4 23d4e: 80 91 71 02 lds r24, 0x0271 ; 0x800271 23d52: 8f 3f cpi r24, 0xFF ; 255 23d54: 89 f5 brne .+98 ; 0x23db8 23d56: f1 2c mov r15, r1 23d58: 35 c0 rjmp .+106 ; 0x23dc4 ReInitLCD = 0 ; lcdui_refresh(); } else { if ((ReInitLCD % 10) == 0) 23d5a: 0f 94 97 a0 call 0x3412e ; 0x3412e <__divmodqi4> 23d5e: 91 11 cpse r25, r1 23d60: 63 cf rjmp .-314 ; 0x23c28 lcd_begin(1); } void lcd_refresh_noclear(void) { lcd_begin(0); 23d62: 80 e0 ldi r24, 0x00 ; 0 23d64: 0e 94 e6 69 call 0xd3cc ; 0xd3cc 23d68: 5d cf rjmp .-326 ; 0x23c24 void lcdui_print_Z_coord(void) { if (custom_message_type == CustomMsg::MeshBedLeveling) lcd_puts_P(_N("Z --- ")); else lcd_printf_P(_N("Z%6.2f%c"), current_position[Z_AXIS], axis_known_position[Z_AXIS]?' ':'?'); 23d6a: 80 91 a5 06 lds r24, 0x06A5 ; 0x8006a5 23d6e: 88 23 and r24, r24 23d70: d9 f0 breq .+54 ; 0x23da8 23d72: 80 e2 ldi r24, 0x20 ; 32 23d74: 1f 92 push r1 23d76: 8f 93 push r24 23d78: 80 91 00 12 lds r24, 0x1200 ; 0x801200 23d7c: 8f 93 push r24 23d7e: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 23d82: 8f 93 push r24 23d84: 80 91 fe 11 lds r24, 0x11FE ; 0x8011fe 23d88: 8f 93 push r24 23d8a: 80 91 fd 11 lds r24, 0x11FD ; 0x8011fd 23d8e: 8f 93 push r24 23d90: 8c ed ldi r24, 0xDC ; 220 23d92: 99 e6 ldi r25, 0x69 ; 105 23d94: 9f 93 push r25 23d96: 8f 93 push r24 23d98: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 23d9c: 0f b6 in r0, 0x3f ; 63 23d9e: f8 94 cli 23da0: de bf out 0x3e, r29 ; 62 23da2: 0f be out 0x3f, r0 ; 63 23da4: cd bf out 0x3d, r28 ; 61 23da6: 77 cf rjmp .-274 ; 0x23c96 23da8: 8f e3 ldi r24, 0x3F ; 63 23daa: e4 cf rjmp .-56 ; 0x23d74 } // Print percent done in form "USB---%", " SD---%", " ---%" (7 chars total) void lcdui_print_percent_done(void) { const char* src = usb_timer.running()?_N(" HO"):(IS_SD_PRINTING?_N(" SD"):_N(" ")); 23dac: 99 e0 ldi r25, 0x09 ; 9 23dae: c9 2e mov r12, r25 23db0: 9a e6 ldi r25, 0x6A ; 106 23db2: d9 2e mov r13, r25 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 23db4: ee 20 and r14, r14 23db6: 31 f2 breq .-116 ; 0x23d44 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 23db8: 80 91 99 03 lds r24, 0x0399 ; 0x800399 // Print percent done in form "USB---%", " SD---%", " ---%" (7 chars total) void lcdui_print_percent_done(void) { const char* src = usb_timer.running()?_N(" HO"):(IS_SD_PRINTING?_N(" SD"):_N(" ")); bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 23dbc: ff 24 eor r15, r15 23dbe: f3 94 inc r15 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 23dc0: 88 23 and r24, r24 23dc2: 99 f1 breq .+102 ; 0x23e2a { const int8_t sheetNR = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 23dc4: 81 ea ldi r24, 0xA1 ; 161 23dc6: 9d e0 ldi r25, 0x0D ; 13 23dc8: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 23dcc: 08 2f mov r16, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheetNR); 23dce: 0e 94 26 6f call 0xde4c ; 0xde4c if ((nextSheet >= 0) && (sheetNR != nextSheet)) 23dd2: 87 fd sbrc r24, 7 23dd4: 2a c0 rjmp .+84 ; 0x23e2a 23dd6: 08 17 cp r16, r24 23dd8: 41 f1 breq .+80 ; 0x23e2a { char sheet[8]; eeprom_read_block(sheet, EEPROM_Sheets_base->s[sheetNR].name, 7); 23dda: 9b e0 ldi r25, 0x0B ; 11 23ddc: 09 02 muls r16, r25 23dde: b0 01 movw r22, r0 23de0: 11 24 eor r1, r1 23de2: 67 5b subi r22, 0xB7 ; 183 23de4: 72 4f sbci r23, 0xF2 ; 242 23de6: 47 e0 ldi r20, 0x07 ; 7 23de8: 50 e0 ldi r21, 0x00 ; 0 23dea: 8e 01 movw r16, r28 23dec: 0f 5f subi r16, 0xFF ; 255 23dee: 1f 4f sbci r17, 0xFF ; 255 23df0: c8 01 movw r24, r16 23df2: 0f 94 cc 9f call 0x33f98 ; 0x33f98 sheet[7] = '\0'; 23df6: 18 86 std Y+8, r1 ; 0x08 lcd_printf_P(PSTR("%-7s"),sheet); 23df8: 1f 93 push r17 23dfa: 0f 93 push r16 23dfc: 89 ec ldi r24, 0xC9 ; 201 23dfe: 94 e9 ldi r25, 0x94 ; 148 lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 23e00: 9f 93 push r25 23e02: 8f 93 push r24 23e04: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 23e08: 0f 90 pop r0 23e0a: 0f 90 pop r0 23e0c: 0f 90 pop r0 23e0e: 0f 90 pop r0 lcd_set_cursor(0, 2); //line 2 //Print SD status (7 chars) lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { 23e10: 80 91 94 12 lds r24, 0x1294 ; 0x801294 23e14: 81 30 cpi r24, 0x01 ; 1 23e16: 09 f0 breq .+2 ; 0x23e1a 23e18: 5a c0 rjmp .+180 ; 0x23ece // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); 23e1a: 0f 94 f4 0c call 0x219e8 ; 0x219e8 23e1e: 95 e0 ldi r25, 0x05 ; 5 23e20: 98 1b sub r25, r24 23e22: 89 2f mov r24, r25 } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 23e24: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 23e28: 5f c0 rjmp .+190 ; 0x23ee8 lcd_printf_P(PSTR("%-7s"),sheet); return; //do not also print the percentage } } if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) 23e2a: e1 10 cpse r14, r1 23e2c: 04 c0 rjmp .+8 ; 0x23e36 23e2e: 80 91 5a 03 lds r24, 0x035A ; 0x80035a <_ZL9M79_timer.lto_priv.419> 23e32: 81 11 cpse r24, r1 23e34: 42 c0 rjmp .+132 ; 0x23eba // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); 23e36: df 92 push r13 23e38: cf 92 push r12 23e3a: 85 ec ldi r24, 0xC5 ; 197 23e3c: 94 e9 ldi r25, 0x94 ; 148 23e3e: 9f 93 push r25 23e40: 8f 93 push r24 23e42: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 23e46: 0f 90 pop r0 23e48: 0f 90 pop r0 23e4a: 0f 90 pop r0 23e4c: 0f 90 pop r0 else if (print_percent_done_silent <= 100) { percent_done = print_percent_done_silent; } #else if (print_percent_done_normal <= 100) 23e4e: 80 91 71 02 lds r24, 0x0271 ; 0x800271 23e52: 85 36 cpi r24, 0x65 ; 101 23e54: d0 f1 brcs .+116 ; 0x23eca int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; FORCE_INLINE uint8_t percentDone(){if(!isFileOpen()) return 0; if(filesize) return sdpos/((filesize+99)/100); else return 0;}; 23e56: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 23e5a: 88 23 and r24, r24 23e5c: 19 f1 breq .+70 ; 0x23ea4 23e5e: 80 91 77 16 lds r24, 0x1677 ; 0x801677 23e62: 90 91 78 16 lds r25, 0x1678 ; 0x801678 23e66: a0 91 79 16 lds r26, 0x1679 ; 0x801679 23e6a: b0 91 7a 16 lds r27, 0x167A ; 0x80167a 23e6e: 00 97 sbiw r24, 0x00 ; 0 23e70: a1 05 cpc r26, r1 23e72: b1 05 cpc r27, r1 23e74: b9 f0 breq .+46 ; 0x23ea4 23e76: bc 01 movw r22, r24 23e78: cd 01 movw r24, r26 23e7a: 6d 59 subi r22, 0x9D ; 157 23e7c: 7f 4f sbci r23, 0xFF ; 255 23e7e: 8f 4f sbci r24, 0xFF ; 255 23e80: 9f 4f sbci r25, 0xFF ; 255 23e82: 24 e6 ldi r18, 0x64 ; 100 23e84: 30 e0 ldi r19, 0x00 ; 0 23e86: 40 e0 ldi r20, 0x00 ; 0 23e88: 50 e0 ldi r21, 0x00 ; 0 23e8a: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> 23e8e: 60 91 7e 16 lds r22, 0x167E ; 0x80167e 23e92: 70 91 7f 16 lds r23, 0x167F ; 0x80167f 23e96: 80 91 80 16 lds r24, 0x1680 ; 0x801680 23e9a: 90 91 81 16 lds r25, 0x1681 ; 0x801681 23e9e: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> 23ea2: 12 2f mov r17, r18 } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 23ea4: 21 2f mov r18, r17 23ea6: 30 e0 ldi r19, 0x00 ; 0 23ea8: 8b ef ldi r24, 0xFB ; 251 23eaa: 99 e6 ldi r25, 0x69 ; 105 23eac: f1 10 cpse r15, r1 23eae: 02 c0 rjmp .+4 ; 0x23eb4 23eb0: 85 ef ldi r24, 0xF5 ; 245 23eb2: 99 e6 ldi r25, 0x69 ; 105 23eb4: 3f 93 push r19 23eb6: 2f 93 push r18 23eb8: a3 cf rjmp .-186 ; 0x23e00 if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) { // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space 23eba: 81 e0 ldi r24, 0x01 ; 1 23ebc: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_print(hostName); // Two characters 23ec0: 82 e7 ldi r24, 0x72 ; 114 23ec2: 96 e0 ldi r25, 0x06 ; 6 23ec4: 0e 94 82 6b call 0xd704 ; 0xd704 23ec8: c2 cf rjmp .-124 ; 0x23e4e 23eca: 18 2f mov r17, r24 23ecc: eb cf rjmp .-42 ; 0x23ea4 lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { 23ece: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 23ed2: 88 23 and r24, r24 23ed4: 09 f4 brne .+2 ; 0x23ed8 23ed6: a5 c0 rjmp .+330 ; 0x24022 } // Print farm number (5 chars total) static void lcdui_print_farm(void) { lcd_printf_P(_N(" FRM ")); 23ed8: 8d e0 ldi r24, 0x0D ; 13 23eda: 9a e6 ldi r25, 0x6A ; 106 23edc: 9f 93 push r25 23ede: 8f 93 push r24 23ee0: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 23ee4: 0f 90 pop r0 23ee6: 0f 90 pop r0 void lcdui_print_time(void) { static uint8_t clock_interval; // max value is 10: CLOCK_INTERVAL_TIME * 2 //if remaining print time estimation is available print it else print elapsed time int chars = 0; if (printer_active()) { 23ee8: 0e 94 19 61 call 0xc232 ; 0xc232 23eec: 88 23 and r24, r24 23eee: 09 f4 brne .+2 ; 0x23ef2 23ef0: ac c0 rjmp .+344 ; 0x2404a if (print_time_to_change_silent != PRINT_TIME_REMAINING_INIT) print_tc = print_time_to_change_silent; //#endif //CLOCK_INTERVAL_TIME } else { #endif //TMC2130 if (print_time_remaining_normal != PRINT_TIME_REMAINING_INIT) 23ef2: c0 90 74 02 lds r12, 0x0274 ; 0x800274 23ef6: d0 90 75 02 lds r13, 0x0275 ; 0x800275 print_tr = print_time_remaining_normal; //#ifdef CLOCK_INTERVAL_TIME if (print_time_to_change_normal != PRINT_TIME_REMAINING_INIT) 23efa: e0 90 72 02 lds r14, 0x0272 ; 0x800272 23efe: f0 90 73 02 lds r15, 0x0273 ; 0x800273 #ifdef TMC2130 } #endif //TMC2130 //#ifdef CLOCK_INTERVAL_TIME if (clock_interval == CLOCK_INTERVAL_TIME*2) 23f02: 80 91 75 06 lds r24, 0x0675 ; 0x800675 23f06: 8a 30 cpi r24, 0x0A ; 10 23f08: 11 f4 brne .+4 ; 0x23f0e clock_interval = 0; 23f0a: 10 92 75 06 sts 0x0675, r1 ; 0x800675 clock_interval++; 23f0e: 80 91 75 06 lds r24, 0x0675 ; 0x800675 23f12: 8f 5f subi r24, 0xFF ; 255 23f14: 80 93 75 06 sts 0x0675, r24 ; 0x800675 if (print_tc != PRINT_TIME_REMAINING_INIT && clock_interval > CLOCK_INTERVAL_TIME) { 23f18: 2f ef ldi r18, 0xFF ; 255 23f1a: e2 16 cp r14, r18 23f1c: f2 06 cpc r15, r18 23f1e: 21 f0 breq .+8 ; 0x23f28 23f20: 97 01 movw r18, r14 print_t = print_tc; suff = 'C'; 23f22: 13 e4 ldi r17, 0x43 ; 67 if (clock_interval == CLOCK_INTERVAL_TIME*2) clock_interval = 0; clock_interval++; if (print_tc != PRINT_TIME_REMAINING_INIT && clock_interval > CLOCK_INTERVAL_TIME) { 23f24: 86 30 cpi r24, 0x06 ; 6 23f26: 70 f4 brcc .+28 ; 0x23f44 print_t = print_tc; suff = 'C'; } else //#endif //CLOCK_INTERVAL_TIME if (print_tr != PRINT_TIME_REMAINING_INIT) { 23f28: 3f ef ldi r19, 0xFF ; 255 23f2a: c3 16 cp r12, r19 23f2c: d3 06 cpc r13, r19 23f2e: 09 f0 breq .+2 ; 0x23f32 23f30: 7a c0 rjmp .+244 ; 0x24026 print_t = print_tr; suff = 'R'; } else print_t = print_job_timer.duration() / 60; 23f32: 0f 94 66 1c call 0x238cc ; 0x238cc 23f36: 2c e3 ldi r18, 0x3C ; 60 23f38: 30 e0 ldi r19, 0x00 ; 0 23f3a: 40 e0 ldi r20, 0x00 ; 0 23f3c: 50 e0 ldi r21, 0x00 ; 0 23f3e: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> int chars = 0; if (printer_active()) { uint16_t print_t = PRINT_TIME_REMAINING_INIT; // unit: minutes uint16_t print_tr = PRINT_TIME_REMAINING_INIT; // unit: minutes uint16_t print_tc = PRINT_TIME_REMAINING_INIT; // unit: minutes char suff = ' '; 23f42: 10 e2 ldi r17, 0x20 ; 32 print_t = print_tr; suff = 'R'; } else print_t = print_job_timer.duration() / 60; if (feedmultiply != 100 && (print_t == print_tr || print_t == print_tc)) { 23f44: 40 91 8e 02 lds r20, 0x028E ; 0x80028e 23f48: 50 91 8f 02 lds r21, 0x028F ; 0x80028f 23f4c: 44 36 cpi r20, 0x64 ; 100 23f4e: 51 05 cpc r21, r1 23f50: 09 f4 brne .+2 ; 0x23f54 23f52: 6c c0 rjmp .+216 ; 0x2402c 23f54: c2 16 cp r12, r18 23f56: d3 06 cpc r13, r19 23f58: 21 f0 breq .+8 ; 0x23f62 23f5a: e2 16 cp r14, r18 23f5c: f3 06 cpc r15, r19 23f5e: 09 f0 breq .+2 ; 0x23f62 23f60: 65 c0 rjmp .+202 ; 0x2402c suff_doubt = '?'; // (print_t * 100) overflows uint16_t at 10.9 hours, uint32_t is required print_t = (uint16_t)((100UL * (uint32_t)print_t) / feedmultiply); 23f62: a4 e6 ldi r26, 0x64 ; 100 23f64: b0 e0 ldi r27, 0x00 ; 0 23f66: 0f 94 7c a0 call 0x340f8 ; 0x340f8 <__umulhisi3> 23f6a: 9a 01 movw r18, r20 23f6c: 55 0f add r21, r21 23f6e: 44 0b sbc r20, r20 23f70: 55 0b sbc r21, r21 23f72: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> suff = 'R'; } else print_t = print_job_timer.duration() / 60; if (feedmultiply != 100 && (print_t == print_tr || print_t == print_tc)) { suff_doubt = '?'; 23f76: 4f e3 ldi r20, 0x3F ; 63 23f78: e4 2e mov r14, r20 23f7a: 04 2e mov r0, r20 23f7c: 00 0c add r0, r0 23f7e: ff 08 sbc r15, r15 23f80: e1 2f mov r30, r17 23f82: 01 2e mov r0, r17 23f84: 00 0c add r0, r0 23f86: ff 0b sbc r31, r31 23f88: c9 01 movw r24, r18 23f8a: 6c e3 ldi r22, 0x3C ; 60 23f8c: 70 e0 ldi r23, 0x00 ; 0 23f8e: 0f 94 a5 a0 call 0x3414a ; 0x3414a <__udivmodhi4> // (print_t * 100) overflows uint16_t at 10.9 hours, uint32_t is required print_t = (uint16_t)((100UL * (uint32_t)print_t) / feedmultiply); } if (print_t < 6000) //time<100h 23f92: 20 37 cpi r18, 0x70 ; 112 23f94: 37 41 sbci r19, 0x17 ; 23 23f96: 08 f0 brcs .+2 ; 0x23f9a 23f98: 4b c0 rjmp .+150 ; 0x24030 chars = lcd_printf_P(_N(LCD_STR_CLOCK "%02u:%02u%c%c"), print_t / 60, print_t % 60, suff, suff_doubt); 23f9a: ff 92 push r15 23f9c: 4f 93 push r20 23f9e: ff 93 push r31 23fa0: 1f 93 push r17 23fa2: 9f 93 push r25 23fa4: 8f 93 push r24 23fa6: 7f 93 push r23 23fa8: 6f 93 push r22 23faa: 87 e2 ldi r24, 0x27 ; 39 23fac: 9a e6 ldi r25, 0x6A ; 106 23fae: 9f 93 push r25 23fb0: 8f 93 push r24 23fb2: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 else //time>=100h chars = lcd_printf_P(_N(LCD_STR_CLOCK "%3uh %c%c"), print_t / 60, suff, suff_doubt); 23fb6: 0f b6 in r0, 0x3f ; 63 23fb8: f8 94 cli 23fba: de bf out 0x3e, r29 ; 62 23fbc: 0f be out 0x3f, r0 ; 63 23fbe: cd bf out 0x3d, r28 ; 61 chars = lcd_printf_P(PSTR("Nd %4.2f "),(float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); #else chars = lcd_printf_P(_N(LCD_STR_CLOCK "--:-- ")); #endif //QUICK_NOZZLE_CHANGE } lcd_space(8 - chars); 23fc0: 98 e0 ldi r25, 0x08 ; 8 23fc2: 98 1b sub r25, r24 23fc4: 89 2f mov r24, r25 23fc6: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 #else //Print time (8chars) lcdui_print_time(); #endif //CMD_DIAGNOSTICS lcd_set_cursor(0, 3); //line 3 23fca: 63 e0 ldi r22, 0x03 ; 3 23fcc: 80 e0 ldi r24, 0x00 ; 0 23fce: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 #ifndef DEBUG_DISABLE_LCD_STATUS_LINE lcdui_print_status_line(); 23fd2: 0f 94 25 10 call 0x2204a ; 0x2204a } SERIAL_ECHOLN('}'); } void prusa_statistics_update_from_status_screen() { if (farm_mode) { 23fd6: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 23fda: 88 23 and r24, r24 23fdc: b1 f0 breq .+44 ; 0x2400a farm_timer--; 23fde: 80 91 76 02 lds r24, 0x0276 ; 0x800276 <_ZL10farm_timer.lto_priv.447> 23fe2: 81 50 subi r24, 0x01 ; 1 if (farm_timer < 1) { 23fe4: d9 f1 breq .+118 ; 0x2405c SERIAL_ECHOLN('}'); } void prusa_statistics_update_from_status_screen() { if (farm_mode) { farm_timer--; 23fe6: 80 93 76 02 sts 0x0276, r24 ; 0x800276 <_ZL10farm_timer.lto_priv.447> if (farm_timer < 1) { farm_timer = 10; prusa_statistics(0); } switch (farm_timer) { 23fea: 80 91 76 02 lds r24, 0x0276 ; 0x800276 <_ZL10farm_timer.lto_priv.447> 23fee: 85 30 cpi r24, 0x05 ; 5 23ff0: e1 f1 breq .+120 ; 0x2406a 23ff2: 88 30 cpi r24, 0x08 ; 8 23ff4: 51 f4 brne .+20 ; 0x2400a case 8: prusa_statistics(21); 23ff6: 85 e1 ldi r24, 0x15 ; 21 23ff8: 0f 94 ff 97 call 0x32ffe ; 0x32ffe if(eFilamentAction != FilamentAction::None) 23ffc: 80 91 62 03 lds r24, 0x0362 ; 0x800362 24000: 88 23 and r24, r24 24002: 19 f0 breq .+6 ; 0x2400a prusa_statistics(22); 24004: 86 e1 ldi r24, 0x16 ; 22 break; case 5: if (IS_SD_PRINTING) prusa_statistics(20); 24006: 0f 94 ff 97 call 0x32ffe ; 0x32ffe lcdui_print_status_screen(); prusa_statistics_update_from_status_screen(); if (lcd_commands_type != LcdCommands::Idle) 2400a: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 2400e: 88 23 and r24, r24 24010: 09 f4 brne .+2 ; 0x24014 24012: cb cd rjmp .-1130 ; 0x23baa void lcd_print_stop_finish(); void lcd_commands() { // printf_P(PSTR("lcd_commands begin, lcd_commands_type=%u, lcd_commands_step=%u\n"), (uint8_t)lcd_commands_type, lcd_commands_step); if (planner_aborted) { 24014: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 24018: 81 11 cpse r24, r1 2401a: c7 cd rjmp .-1138 ; 0x23baa 2401c: 0e 94 76 e6 call 0x1ccec ; 0x1ccec 24020: c4 cd rjmp .-1144 ; 0x23baa lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 24022: 85 e0 ldi r24, 0x05 ; 5 24024: ff ce rjmp .-514 ; 0x23e24 if (print_tc != PRINT_TIME_REMAINING_INIT && clock_interval > CLOCK_INTERVAL_TIME) { print_t = print_tc; suff = 'C'; } else //#endif //CLOCK_INTERVAL_TIME if (print_tr != PRINT_TIME_REMAINING_INIT) { 24026: 96 01 movw r18, r12 print_t = print_tr; suff = 'R'; 24028: 12 e5 ldi r17, 0x52 ; 82 2402a: 8c cf rjmp .-232 ; 0x23f44 if (printer_active()) { uint16_t print_t = PRINT_TIME_REMAINING_INIT; // unit: minutes uint16_t print_tr = PRINT_TIME_REMAINING_INIT; // unit: minutes uint16_t print_tc = PRINT_TIME_REMAINING_INIT; // unit: minutes char suff = ' '; char suff_doubt = ' '; 2402c: 40 e2 ldi r20, 0x20 ; 32 2402e: a4 cf rjmp .-184 ; 0x23f78 } if (print_t < 6000) //time<100h chars = lcd_printf_P(_N(LCD_STR_CLOCK "%02u:%02u%c%c"), print_t / 60, print_t % 60, suff, suff_doubt); else //time>=100h chars = lcd_printf_P(_N(LCD_STR_CLOCK "%3uh %c%c"), print_t / 60, suff, suff_doubt); 24030: ff 92 push r15 24032: 4f 93 push r20 24034: ff 93 push r31 24036: 1f 93 push r17 24038: 7f 93 push r23 2403a: 6f 93 push r22 2403c: 8c e1 ldi r24, 0x1C ; 28 2403e: 9a e6 ldi r25, 0x6A ; 106 24040: 9f 93 push r25 24042: 8f 93 push r24 24044: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 24048: b6 cf rjmp .-148 ; 0x23fb6 } else { #ifdef QUICK_NOZZLE_CHANGE chars = lcd_printf_P(PSTR("Nd %4.2f "),(float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); #else chars = lcd_printf_P(_N(LCD_STR_CLOCK "--:-- ")); 2404a: 83 e1 ldi r24, 0x13 ; 19 2404c: 9a e6 ldi r25, 0x6A ; 106 2404e: 9f 93 push r25 24050: 8f 93 push r24 24052: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 24056: 0f 90 pop r0 24058: 0f 90 pop r0 2405a: b2 cf rjmp .-156 ; 0x23fc0 void prusa_statistics_update_from_status_screen() { if (farm_mode) { farm_timer--; if (farm_timer < 1) { farm_timer = 10; 2405c: 8a e0 ldi r24, 0x0A ; 10 2405e: 80 93 76 02 sts 0x0276, r24 ; 0x800276 <_ZL10farm_timer.lto_priv.447> prusa_statistics(0); 24062: 80 e0 ldi r24, 0x00 ; 0 24064: 0f 94 ff 97 call 0x32ffe ; 0x32ffe 24068: c0 cf rjmp .-128 ; 0x23fea prusa_statistics(21); if(eFilamentAction != FilamentAction::None) prusa_statistics(22); break; case 5: if (IS_SD_PRINTING) 2406a: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 2406e: 88 23 and r24, r24 24070: 61 f2 breq .-104 ; 0x2400a prusa_statistics(20); 24072: 84 e1 ldi r24, 0x14 ; 20 24074: c8 cf rjmp .-112 ; 0x24006 00024076 : reset(); if ((accumulator = with_time)) state = RUNNING; } void Stopwatch::reset() { state = STOPPED; 24076: 10 92 59 03 sts 0x0359, r1 ; 0x800359 startTimestamp = 0; 2407a: 10 92 e9 05 sts 0x05E9, r1 ; 0x8005e9 2407e: 10 92 ea 05 sts 0x05EA, r1 ; 0x8005ea 24082: 10 92 eb 05 sts 0x05EB, r1 ; 0x8005eb 24086: 10 92 ec 05 sts 0x05EC, r1 ; 0x8005ec stopTimestamp = 0; 2408a: 10 92 78 06 sts 0x0678, r1 ; 0x800678 2408e: 10 92 79 06 sts 0x0679, r1 ; 0x800679 24092: 10 92 7a 06 sts 0x067A, r1 ; 0x80067a 24096: 10 92 7b 06 sts 0x067B, r1 ; 0x80067b accumulator = 0; 2409a: 10 92 e5 05 sts 0x05E5, r1 ; 0x8005e5 2409e: 10 92 e6 05 sts 0x05E6, r1 ; 0x8005e6 240a2: 10 92 e7 05 sts 0x05E7, r1 ; 0x8005e7 240a6: 10 92 e8 05 sts 0x05E8, r1 ; 0x8005e8 } 240aa: 08 95 ret 000240ac : /** * @brief Check if the timer is running * @details Return true if the timer is currently running, false otherwise. * @return true if stopwatch is running */ FORCE_INLINE static bool isRunning() { return state == RUNNING; } 240ac: 80 91 59 03 lds r24, 0x0359 ; 0x800359 } else return false; } bool Stopwatch::start() { if (!isRunning()) { 240b0: 81 30 cpi r24, 0x01 ; 1 240b2: f1 f0 breq .+60 ; 0x240f0 if (isPaused()) accumulator = duration(); 240b4: 82 30 cpi r24, 0x02 ; 2 240b6: c9 f4 brne .+50 ; 0x240ea 240b8: 0f 94 66 1c call 0x238cc ; 0x238cc 240bc: 60 93 e5 05 sts 0x05E5, r22 ; 0x8005e5 240c0: 70 93 e6 05 sts 0x05E6, r23 ; 0x8005e6 240c4: 80 93 e7 05 sts 0x05E7, r24 ; 0x8005e7 240c8: 90 93 e8 05 sts 0x05E8, r25 ; 0x8005e8 else reset(); state = RUNNING; 240cc: 81 e0 ldi r24, 0x01 ; 1 240ce: 80 93 59 03 sts 0x0359, r24 ; 0x800359 startTimestamp = _millis(); 240d2: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 240d6: 60 93 e9 05 sts 0x05E9, r22 ; 0x8005e9 240da: 70 93 ea 05 sts 0x05EA, r23 ; 0x8005ea 240de: 80 93 eb 05 sts 0x05EB, r24 ; 0x8005eb 240e2: 90 93 ec 05 sts 0x05EC, r25 ; 0x8005ec 240e6: 81 e0 ldi r24, 0x01 ; 1 240e8: 08 95 ret } bool Stopwatch::start() { if (!isRunning()) { if (isPaused()) accumulator = duration(); else reset(); 240ea: 0f 94 3b 20 call 0x24076 ; 0x24076 240ee: ee cf rjmp .-36 ; 0x240cc state = RUNNING; startTimestamp = _millis(); return true; } else return false; 240f0: 80 e0 ldi r24, 0x00 ; 0 } 240f2: 08 95 ret 000240f4 : uint32_t Stopwatch::accumulator; uint32_t Stopwatch::startTimestamp; uint32_t Stopwatch::stopTimestamp; bool Stopwatch::stop() { if (isRunning() || isPaused()) { 240f4: 80 91 59 03 lds r24, 0x0359 ; 0x800359 240f8: 81 50 subi r24, 0x01 ; 1 240fa: 82 30 cpi r24, 0x02 ; 2 240fc: 70 f4 brcc .+28 ; 0x2411a state = STOPPED; 240fe: 10 92 59 03 sts 0x0359, r1 ; 0x800359 stopTimestamp = _millis(); 24102: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 24106: 60 93 78 06 sts 0x0678, r22 ; 0x800678 2410a: 70 93 79 06 sts 0x0679, r23 ; 0x800679 2410e: 80 93 7a 06 sts 0x067A, r24 ; 0x80067a 24112: 90 93 7b 06 sts 0x067B, r25 ; 0x80067b 24116: 81 e0 ldi r24, 0x01 ; 1 24118: 08 95 ret return true; } else return false; 2411a: 80 e0 ldi r24, 0x00 ; 0 } 2411c: 08 95 ret 0002411e : #ifdef MOTOR_CURRENT_PWM_XY_PIN void st_current_set(uint8_t driver, int current) { if (driver == 0) analogWrite(MOTOR_CURRENT_PWM_XY_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); if (driver == 1) analogWrite(MOTOR_CURRENT_PWM_Z_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); if (driver == 2) analogWrite(MOTOR_CURRENT_PWM_E_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 2411e: 2f ef ldi r18, 0xFF ; 255 24120: 30 e0 ldi r19, 0x00 ; 0 24122: dc 01 movw r26, r24 24124: 0f 94 fc a0 call 0x341f8 ; 0x341f8 <__usmulhisi3> 24128: 20 ed ldi r18, 0xD0 ; 208 2412a: 37 e0 ldi r19, 0x07 ; 7 2412c: 40 e0 ldi r20, 0x00 ; 0 2412e: 50 e0 ldi r21, 0x00 ; 0 24130: 0f 94 cd a0 call 0x3419a ; 0x3419a <__divmodsi4> 24134: b9 01 movw r22, r18 24136: 8c e2 ldi r24, 0x2C ; 44 24138: 0c 94 71 c0 jmp 0x180e2 ; 0x180e2 0002413c : case 16: microstep_ms(driver,MICROSTEP16); break; } } void microstep_readings() { 2413c: cf 93 push r28 2413e: df 93 push r29 SERIAL_PROTOCOLLNPGM("MS1,MS2 Pins"); 24140: 87 ee ldi r24, 0xE7 ; 231 24142: 90 e9 ldi r25, 0x90 ; 144 24144: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 SERIAL_PROTOCOLPGM("X: "); 24148: 83 ee ldi r24, 0xE3 ; 227 2414a: 90 e9 ldi r25, 0x90 ; 144 2414c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_PROTOCOL( READ(X_MS1_PIN)); 24150: 62 b3 in r22, 0x12 ; 18 24152: 66 95 lsr r22 24154: 61 70 andi r22, 0x01 ; 1 24156: 70 e0 ldi r23, 0x00 ; 0 24158: 90 e0 ldi r25, 0x00 ; 0 2415a: 80 e0 ldi r24, 0x00 ; 0 2415c: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_PROTOCOLLN( READ(X_MS2_PIN)); 24160: 82 b3 in r24, 0x12 ; 18 24162: 81 70 andi r24, 0x01 ; 1 24164: 90 e0 ldi r25, 0x00 ; 0 24166: 0f 94 aa 41 call 0x28354 ; 0x28354 SERIAL_PROTOCOLPGM("Y: "); 2416a: 8f ed ldi r24, 0xDF ; 223 2416c: 90 e9 ldi r25, 0x90 ; 144 2416e: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_PROTOCOL( READ(Y_MS1_PIN)); 24172: c6 e0 ldi r28, 0x06 ; 6 24174: d1 e0 ldi r29, 0x01 ; 1 24176: 68 81 ld r22, Y 24178: 06 2e mov r0, r22 2417a: 00 0c add r0, r0 2417c: 77 0b sbc r23, r23 2417e: 88 0b sbc r24, r24 24180: 99 0b sbc r25, r25 24182: 66 27 eor r22, r22 24184: 97 fd sbrc r25, 7 24186: 63 95 inc r22 24188: 77 27 eor r23, r23 2418a: 88 27 eor r24, r24 2418c: 99 27 eor r25, r25 2418e: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_PROTOCOLLN( READ(Y_MS2_PIN)); 24192: 82 b3 in r24, 0x12 ; 18 24194: 82 fb bst r24, 2 24196: 88 27 eor r24, r24 24198: 80 f9 bld r24, 0 2419a: 90 e0 ldi r25, 0x00 ; 0 2419c: 0f 94 aa 41 call 0x28354 ; 0x28354 SERIAL_PROTOCOLPGM("Z: "); 241a0: 8b ed ldi r24, 0xDB ; 219 241a2: 90 e9 ldi r25, 0x90 ; 144 241a4: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_PROTOCOL( READ(Z_MS1_PIN)); 241a8: 68 81 ld r22, Y 241aa: 66 fb bst r22, 6 241ac: 66 27 eor r22, r22 241ae: 60 f9 bld r22, 0 241b0: 70 e0 ldi r23, 0x00 ; 0 241b2: 90 e0 ldi r25, 0x00 ; 0 241b4: 80 e0 ldi r24, 0x00 ; 0 241b6: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_PROTOCOLLN( READ(Z_MS2_PIN)); 241ba: 88 81 ld r24, Y 241bc: 85 fb bst r24, 5 241be: 88 27 eor r24, r24 241c0: 80 f9 bld r24, 0 241c2: 90 e0 ldi r25, 0x00 ; 0 241c4: 0f 94 aa 41 call 0x28354 ; 0x28354 SERIAL_PROTOCOLPGM("E0: "); 241c8: 86 ed ldi r24, 0xD6 ; 214 241ca: 90 e9 ldi r25, 0x90 ; 144 241cc: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_PROTOCOL( READ(E0_MS1_PIN)); 241d0: 68 81 ld r22, Y 241d2: 63 fb bst r22, 3 241d4: 66 27 eor r22, r22 241d6: 60 f9 bld r22, 0 241d8: 70 e0 ldi r23, 0x00 ; 0 241da: 90 e0 ldi r25, 0x00 ; 0 241dc: 80 e0 ldi r24, 0x00 ; 0 241de: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_PROTOCOLLN( READ(E0_MS2_PIN)); 241e2: 88 81 ld r24, Y 241e4: 82 95 swap r24 241e6: 81 70 andi r24, 0x01 ; 1 241e8: 90 e0 ldi r25, 0x00 ; 0 #if defined(E1_MS1_PIN) && E1_MS1_PIN > -1 SERIAL_PROTOCOLPGM("E1: "); SERIAL_PROTOCOL( READ(E1_MS1_PIN)); SERIAL_PROTOCOLLN( READ(E1_MS2_PIN)); #endif } 241ea: df 91 pop r29 241ec: cf 91 pop r28 SERIAL_PROTOCOLPGM("Z: "); SERIAL_PROTOCOL( READ(Z_MS1_PIN)); SERIAL_PROTOCOLLN( READ(Z_MS2_PIN)); SERIAL_PROTOCOLPGM("E0: "); SERIAL_PROTOCOL( READ(E0_MS1_PIN)); SERIAL_PROTOCOLLN( READ(E0_MS2_PIN)); 241ee: 0d 94 aa 41 jmp 0x28354 ; 0x28354 000241f2 : #endif } void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2) { if(ms1 > -1) switch(driver) 241f2: 67 fd sbrc r22, 7 241f4: 08 c0 rjmp .+16 ; 0x24206 241f6: 81 30 cpi r24, 0x01 ; 1 241f8: 21 f1 breq .+72 ; 0x24242 241fa: d8 f0 brcs .+54 ; 0x24232 241fc: 82 30 cpi r24, 0x02 ; 2 241fe: 99 f1 breq .+102 ; 0x24266 24200: 83 30 cpi r24, 0x03 ; 3 24202: 09 f4 brne .+2 ; 0x24206 24204: 42 c0 rjmp .+132 ; 0x2428a case 3: WRITE(E0_MS1_PIN,ms1); break; #if defined(E1_MS1_PIN) && E1_MS1_PIN > -1 case 4: WRITE(E1_MS1_PIN,ms1); break; #endif } if(ms2 > -1) switch(driver) 24206: 47 fd sbrc r20, 7 24208: 4c c0 rjmp .+152 ; 0x242a2 2420a: 81 30 cpi r24, 0x01 ; 1 2420c: 09 f4 brne .+2 ; 0x24210 2420e: 55 c0 rjmp .+170 ; 0x242ba 24210: 08 f4 brcc .+2 ; 0x24214 24212: 4d c0 rjmp .+154 ; 0x242ae 24214: 82 30 cpi r24, 0x02 ; 2 24216: 09 f4 brne .+2 ; 0x2421a 24218: 56 c0 rjmp .+172 ; 0x242c6 2421a: 83 30 cpi r24, 0x03 ; 3 2421c: 09 f0 breq .+2 ; 0x24220 2421e: 41 c0 rjmp .+130 ; 0x242a2 { case 0: WRITE( X_MS2_PIN,ms2); break; case 1: WRITE( Y_MS2_PIN,ms2); break; case 2: WRITE( Z_MS2_PIN,ms2); break; case 3: WRITE(E0_MS2_PIN,ms2); break; 24220: 9f b7 in r25, 0x3f ; 63 24222: 44 23 and r20, r20 24224: 09 f4 brne .+2 ; 0x24228 24226: 5f c0 rjmp .+190 ; 0x242e6 24228: f8 94 cli 2422a: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2422e: 80 61 ori r24, 0x10 ; 16 24230: 51 c0 rjmp .+162 ; 0x242d4 void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2) { if(ms1 > -1) switch(driver) { case 0: WRITE( X_MS1_PIN,ms1); break; 24232: 66 23 and r22, r22 24234: 21 f0 breq .+8 ; 0x2423e 24236: a1 9a sbi 0x14, 1 ; 20 case 3: WRITE(E0_MS1_PIN,ms1); break; #if defined(E1_MS1_PIN) && E1_MS1_PIN > -1 case 4: WRITE(E1_MS1_PIN,ms1); break; #endif } if(ms2 > -1) switch(driver) 24238: 47 ff sbrs r20, 7 2423a: 39 c0 rjmp .+114 ; 0x242ae 2423c: 08 95 ret void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2) { if(ms1 > -1) switch(driver) { case 0: WRITE( X_MS1_PIN,ms1); break; 2423e: a1 98 cbi 0x14, 1 ; 20 24240: fb cf rjmp .-10 ; 0x24238 case 1: WRITE( Y_MS1_PIN,ms1); break; 24242: 9f b7 in r25, 0x3f ; 63 24244: 66 23 and r22, r22 24246: 51 f0 breq .+20 ; 0x2425c 24248: f8 94 cli 2424a: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2424e: 80 68 ori r24, 0x80 ; 128 24250: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24254: 9f bf out 0x3f, r25 ; 63 case 3: WRITE(E0_MS1_PIN,ms1); break; #if defined(E1_MS1_PIN) && E1_MS1_PIN > -1 case 4: WRITE(E1_MS1_PIN,ms1); break; #endif } if(ms2 > -1) switch(driver) 24256: 47 ff sbrs r20, 7 24258: 30 c0 rjmp .+96 ; 0x242ba 2425a: 08 95 ret void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2) { if(ms1 > -1) switch(driver) { case 0: WRITE( X_MS1_PIN,ms1); break; case 1: WRITE( Y_MS1_PIN,ms1); break; 2425c: f8 94 cli 2425e: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24262: 8f 77 andi r24, 0x7F ; 127 24264: f5 cf rjmp .-22 ; 0x24250 case 2: WRITE( Z_MS1_PIN,ms1); break; 24266: 9f b7 in r25, 0x3f ; 63 24268: 66 23 and r22, r22 2426a: 51 f0 breq .+20 ; 0x24280 2426c: f8 94 cli 2426e: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24272: 80 64 ori r24, 0x40 ; 64 24274: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24278: 9f bf out 0x3f, r25 ; 63 case 3: WRITE(E0_MS1_PIN,ms1); break; #if defined(E1_MS1_PIN) && E1_MS1_PIN > -1 case 4: WRITE(E1_MS1_PIN,ms1); break; #endif } if(ms2 > -1) switch(driver) 2427a: 47 ff sbrs r20, 7 2427c: 24 c0 rjmp .+72 ; 0x242c6 2427e: 08 95 ret { if(ms1 > -1) switch(driver) { case 0: WRITE( X_MS1_PIN,ms1); break; case 1: WRITE( Y_MS1_PIN,ms1); break; case 2: WRITE( Z_MS1_PIN,ms1); break; 24280: f8 94 cli 24282: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24286: 8f 7b andi r24, 0xBF ; 191 24288: f5 cf rjmp .-22 ; 0x24274 case 3: WRITE(E0_MS1_PIN,ms1); break; 2428a: 9f b7 in r25, 0x3f ; 63 2428c: 66 23 and r22, r22 2428e: 51 f0 breq .+20 ; 0x242a4 24290: f8 94 cli 24292: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24296: 88 60 ori r24, 0x08 ; 8 24298: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2429c: 9f bf out 0x3f, r25 ; 63 #if defined(E1_MS1_PIN) && E1_MS1_PIN > -1 case 4: WRITE(E1_MS1_PIN,ms1); break; #endif } if(ms2 > -1) switch(driver) 2429e: 47 ff sbrs r20, 7 242a0: bf cf rjmp .-130 ; 0x24220 case 3: WRITE(E0_MS2_PIN,ms2); break; #if defined(E1_MS2_PIN) && E1_MS2_PIN > -1 case 4: WRITE(E1_MS2_PIN,ms2); break; #endif } } 242a2: 08 95 ret if(ms1 > -1) switch(driver) { case 0: WRITE( X_MS1_PIN,ms1); break; case 1: WRITE( Y_MS1_PIN,ms1); break; case 2: WRITE( Z_MS1_PIN,ms1); break; case 3: WRITE(E0_MS1_PIN,ms1); break; 242a4: f8 94 cli 242a6: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 242aa: 87 7f andi r24, 0xF7 ; 247 242ac: f5 cf rjmp .-22 ; 0x24298 case 4: WRITE(E1_MS1_PIN,ms1); break; #endif } if(ms2 > -1) switch(driver) { case 0: WRITE( X_MS2_PIN,ms2); break; 242ae: 44 23 and r20, r20 242b0: 11 f0 breq .+4 ; 0x242b6 242b2: a0 9a sbi 0x14, 0 ; 20 242b4: 08 95 ret 242b6: a0 98 cbi 0x14, 0 ; 20 242b8: 08 95 ret case 1: WRITE( Y_MS2_PIN,ms2); break; 242ba: 44 23 and r20, r20 242bc: 11 f0 breq .+4 ; 0x242c2 242be: a2 9a sbi 0x14, 2 ; 20 242c0: 08 95 ret 242c2: a2 98 cbi 0x14, 2 ; 20 242c4: 08 95 ret case 2: WRITE( Z_MS2_PIN,ms2); break; 242c6: 9f b7 in r25, 0x3f ; 63 242c8: 44 23 and r20, r20 242ca: 41 f0 breq .+16 ; 0x242dc 242cc: f8 94 cli 242ce: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 242d2: 80 62 ori r24, 0x20 ; 32 242d4: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 242d8: 9f bf out 0x3f, r25 ; 63 242da: 08 95 ret 242dc: f8 94 cli 242de: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 242e2: 8f 7d andi r24, 0xDF ; 223 242e4: f7 cf rjmp .-18 ; 0x242d4 case 3: WRITE(E0_MS2_PIN,ms2); break; 242e6: f8 94 cli 242e8: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 242ec: 8f 7e andi r24, 0xEF ; 239 242ee: f2 cf rjmp .-28 ; 0x242d4 000242f0 : } } void microstep_mode(uint8_t driver, uint8_t stepping_mode) { switch(stepping_mode) 242f0: 64 30 cpi r22, 0x04 ; 4 242f2: 81 f0 breq .+32 ; 0x24314 242f4: 30 f4 brcc .+12 ; 0x24302 242f6: 61 30 cpi r22, 0x01 ; 1 242f8: 49 f0 breq .+18 ; 0x2430c { case 1: microstep_ms(driver,MICROSTEP1); break; case 2: microstep_ms(driver,MICROSTEP2); break; 242fa: 40 e0 ldi r20, 0x00 ; 0 } } void microstep_mode(uint8_t driver, uint8_t stepping_mode) { switch(stepping_mode) 242fc: 62 30 cpi r22, 0x02 ; 2 242fe: 69 f0 breq .+26 ; 0x2431a 24300: 08 95 ret 24302: 68 30 cpi r22, 0x08 ; 8 24304: 49 f0 breq .+18 ; 0x24318 24306: 60 31 cpi r22, 0x10 ; 16 24308: 39 f0 breq .+14 ; 0x24318 2430a: 08 95 ret { case 1: microstep_ms(driver,MICROSTEP1); break; 2430c: 40 e0 ldi r20, 0x00 ; 0 case 2: microstep_ms(driver,MICROSTEP2); break; case 4: microstep_ms(driver,MICROSTEP4); break; 2430e: 60 e0 ldi r22, 0x00 ; 0 case 8: microstep_ms(driver,MICROSTEP8); break; 24310: 0d 94 f9 20 jmp 0x241f2 ; 0x241f2 { switch(stepping_mode) { case 1: microstep_ms(driver,MICROSTEP1); break; case 2: microstep_ms(driver,MICROSTEP2); break; case 4: microstep_ms(driver,MICROSTEP4); break; 24314: 41 e0 ldi r20, 0x01 ; 1 24316: fb cf rjmp .-10 ; 0x2430e case 8: microstep_ms(driver,MICROSTEP8); break; 24318: 41 e0 ldi r20, 0x01 ; 1 2431a: 61 e0 ldi r22, 0x01 ; 1 2431c: f9 cf rjmp .-14 ; 0x24310 0002431e : #endif } #ifdef MOTOR_CURRENT_PWM_XY_PIN void st_current_set(uint8_t driver, int current) { 2431e: db 01 movw r26, r22 if (driver == 0) analogWrite(MOTOR_CURRENT_PWM_XY_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 24320: 81 11 cpse r24, r1 24322: 0e c0 rjmp .+28 ; 0x24340 24324: 2f ef ldi r18, 0xFF ; 255 24326: 30 e0 ldi r19, 0x00 ; 0 24328: 0f 94 fc a0 call 0x341f8 ; 0x341f8 <__usmulhisi3> 2432c: 20 ed ldi r18, 0xD0 ; 208 2432e: 37 e0 ldi r19, 0x07 ; 7 24330: 40 e0 ldi r20, 0x00 ; 0 24332: 50 e0 ldi r21, 0x00 ; 0 24334: 0f 94 cd a0 call 0x3419a ; 0x3419a <__divmodsi4> 24338: b9 01 movw r22, r18 2433a: 8e e2 ldi r24, 0x2E ; 46 if (driver == 1) analogWrite(MOTOR_CURRENT_PWM_Z_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 2433c: 0c 94 71 c0 jmp 0x180e2 ; 0x180e2 24340: 81 30 cpi r24, 0x01 ; 1 24342: 69 f4 brne .+26 ; 0x2435e 24344: 2f ef ldi r18, 0xFF ; 255 24346: 30 e0 ldi r19, 0x00 ; 0 24348: 0f 94 fc a0 call 0x341f8 ; 0x341f8 <__usmulhisi3> 2434c: 20 ed ldi r18, 0xD0 ; 208 2434e: 37 e0 ldi r19, 0x07 ; 7 24350: 40 e0 ldi r20, 0x00 ; 0 24352: 50 e0 ldi r21, 0x00 ; 0 24354: 0f 94 cd a0 call 0x3419a ; 0x3419a <__divmodsi4> 24358: b9 01 movw r22, r18 2435a: 8d e2 ldi r24, 0x2D ; 45 2435c: ef cf rjmp .-34 ; 0x2433c if (driver == 2) analogWrite(MOTOR_CURRENT_PWM_E_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 2435e: 82 30 cpi r24, 0x02 ; 2 24360: 19 f4 brne .+6 ; 0x24368 24362: cb 01 movw r24, r22 24364: 0d 94 8f 20 jmp 0x2411e ; 0x2411e } 24368: 08 95 ret 0002436a : #ifndef TMC2130 void st_current_init() //Initialize Digipot Motor Current { #ifdef MOTOR_CURRENT_PWM_XY_PIN uint8_t SilentMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); 2436a: 8f ef ldi r24, 0xFF ; 255 2436c: 9f e0 ldi r25, 0x0F ; 15 2436e: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 SilentModeMenu = SilentMode; 24372: 80 93 89 03 sts 0x0389, r24 ; 0x800389 SET_OUTPUT(MOTOR_CURRENT_PWM_XY_PIN); 24376: 90 91 0a 01 lds r25, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 2437a: 98 60 ori r25, 0x08 ; 8 2437c: 90 93 0a 01 sts 0x010A, r25 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> SET_OUTPUT(MOTOR_CURRENT_PWM_Z_PIN); 24380: 90 91 0a 01 lds r25, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 24384: 90 61 ori r25, 0x10 ; 16 24386: 90 93 0a 01 sts 0x010A, r25 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> SET_OUTPUT(MOTOR_CURRENT_PWM_E_PIN); 2438a: 90 91 0a 01 lds r25, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 2438e: 90 62 ori r25, 0x20 ; 32 24390: 90 93 0a 01 sts 0x010A, r25 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> if((SilentMode == SILENT_MODE_OFF) || (farm_mode) ){ 24394: 88 23 and r24, r24 24396: 21 f0 breq .+8 ; 0x243a0 24398: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 2439c: 88 23 and r24, r24 2439e: 59 f1 breq .+86 ; 0x243f6 motor_current_setting[0] = motor_current_setting_loud[0]; 243a0: 8c e1 ldi r24, 0x1C ; 28 243a2: 92 e0 ldi r25, 0x02 ; 2 243a4: 90 93 62 02 sts 0x0262, r25 ; 0x800262 243a8: 80 93 61 02 sts 0x0261, r24 ; 0x800261 motor_current_setting[1] = motor_current_setting_loud[1]; 243ac: 8e e3 ldi r24, 0x3E ; 62 243ae: 93 e0 ldi r25, 0x03 ; 3 243b0: 90 93 64 02 sts 0x0264, r25 ; 0x800264 243b4: 80 93 63 02 sts 0x0263, r24 ; 0x800263 motor_current_setting[2] = motor_current_setting_loud[2]; 243b8: 84 ef ldi r24, 0xF4 ; 244 243ba: 91 e0 ldi r25, 0x01 ; 1 }else{ motor_current_setting[0] = motor_current_setting_silent[0]; motor_current_setting[1] = motor_current_setting_silent[1]; motor_current_setting[2] = motor_current_setting_silent[2]; 243bc: 90 93 66 02 sts 0x0266, r25 ; 0x800266 243c0: 80 93 65 02 sts 0x0265, r24 ; 0x800265 } st_current_set(0, motor_current_setting[0]); 243c4: 60 91 61 02 lds r22, 0x0261 ; 0x800261 243c8: 70 91 62 02 lds r23, 0x0262 ; 0x800262 243cc: 80 e0 ldi r24, 0x00 ; 0 243ce: 0f 94 8f 21 call 0x2431e ; 0x2431e st_current_set(1, motor_current_setting[1]); 243d2: 6e e3 ldi r22, 0x3E ; 62 243d4: 73 e0 ldi r23, 0x03 ; 3 243d6: 81 e0 ldi r24, 0x01 ; 1 243d8: 0f 94 8f 21 call 0x2431e ; 0x2431e 243dc: 80 91 65 02 lds r24, 0x0265 ; 0x800265 243e0: 90 91 66 02 lds r25, 0x0266 ; 0x800266 243e4: 0f 94 8f 20 call 0x2411e ; 0x2411e st_current_set(2, motor_current_setting[2]); //Set timer5 to 31khz so the PWM of the motor power is as constant as possible. (removes a buzzing noise) TCCR5B = (TCCR5B & ~(_BV(CS50) | _BV(CS51) | _BV(CS52))) | _BV(CS50); 243e8: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 243ec: 88 7f andi r24, 0xF8 ; 248 243ee: 81 60 ori r24, 0x01 ; 1 243f0: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> #endif } 243f4: 08 95 ret motor_current_setting[1] = motor_current_setting_loud[1]; motor_current_setting[2] = motor_current_setting_loud[2]; }else{ motor_current_setting[0] = motor_current_setting_silent[0]; 243f6: 8e e0 ldi r24, 0x0E ; 14 243f8: 91 e0 ldi r25, 0x01 ; 1 243fa: 90 93 62 02 sts 0x0262, r25 ; 0x800262 243fe: 80 93 61 02 sts 0x0261, r24 ; 0x800261 motor_current_setting[1] = motor_current_setting_silent[1]; 24402: 8e e3 ldi r24, 0x3E ; 62 24404: 93 e0 ldi r25, 0x03 ; 3 24406: 90 93 64 02 sts 0x0264, r25 ; 0x800264 2440a: 80 93 63 02 sts 0x0263, r24 ; 0x800263 motor_current_setting[2] = motor_current_setting_silent[2]; 2440e: 82 ec ldi r24, 0xC2 ; 194 24410: 91 e0 ldi r25, 0x01 ; 1 24412: d4 cf rjmp .-88 ; 0x243bc 00024414 : eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); } #endif //MMU_FORCE_STEALTH_MODE static void lcd_silent_mode_set() { switch (SilentModeMenu) { 24414: 80 91 89 03 lds r24, 0x0389 ; 0x800389 24418: 88 23 and r24, r24 2441a: 21 f0 breq .+8 ; 0x24424 2441c: 81 30 cpi r24, 0x01 ; 1 2441e: 69 f4 brne .+26 ; 0x2443a case SILENT_MODE_NORMAL: SilentModeMenu = SILENT_MODE_STEALTH; break; case SILENT_MODE_STEALTH: SilentModeMenu = SILENT_MODE_NORMAL; break; default: SilentModeMenu = SILENT_MODE_NORMAL; break; // (probably) not needed #else case SILENT_MODE_POWER: SilentModeMenu = SILENT_MODE_SILENT; break; case SILENT_MODE_SILENT: SilentModeMenu = SILENT_MODE_AUTO; break; 24420: 82 e0 ldi r24, 0x02 ; 2 24422: 01 c0 rjmp .+2 ; 0x24426 #ifdef TMC2130 case SILENT_MODE_NORMAL: SilentModeMenu = SILENT_MODE_STEALTH; break; case SILENT_MODE_STEALTH: SilentModeMenu = SILENT_MODE_NORMAL; break; default: SilentModeMenu = SILENT_MODE_NORMAL; break; // (probably) not needed #else case SILENT_MODE_POWER: SilentModeMenu = SILENT_MODE_SILENT; break; 24424: 81 e0 ldi r24, 0x01 ; 1 case SILENT_MODE_SILENT: SilentModeMenu = SILENT_MODE_AUTO; break; 24426: 80 93 89 03 sts 0x0389, r24 ; 0x800389 2442a: 60 91 89 03 lds r22, 0x0389 ; 0x800389 2442e: 8f ef ldi r24, 0xFF ; 255 24430: 9f e0 ldi r25, 0x0F ; 15 24432: 0f 94 00 a0 call 0x34000 ; 0x34000 // We may have missed a stepper timer interrupt due to the time spent in tmc2130_init. // Be safe than sorry, reset the stepper timer before re-enabling interrupts. st_reset_timer(); sei(); #else st_current_init(); 24436: 0d 94 b5 21 jmp 0x2436a ; 0x2436a case SILENT_MODE_STEALTH: SilentModeMenu = SILENT_MODE_NORMAL; break; default: SilentModeMenu = SILENT_MODE_NORMAL; break; // (probably) not needed #else case SILENT_MODE_POWER: SilentModeMenu = SILENT_MODE_SILENT; break; case SILENT_MODE_SILENT: SilentModeMenu = SILENT_MODE_AUTO; break; case SILENT_MODE_AUTO: SilentModeMenu = SILENT_MODE_POWER; break; 2443a: 10 92 89 03 sts 0x0389, r1 ; 0x800389 2443e: f5 cf rjmp .-22 ; 0x2442a 00024440 : } long st_get_position(uint8_t axis) { long count_pos; CRITICAL_SECTION_START; 24440: 2f b7 in r18, 0x3f ; 63 24442: f8 94 cli count_pos = count_position[axis]; 24444: 94 e0 ldi r25, 0x04 ; 4 24446: 89 9f mul r24, r25 24448: f0 01 movw r30, r0 2444a: 11 24 eor r1, r1 2444c: ea 54 subi r30, 0x4A ; 74 2444e: f9 4f sbci r31, 0xF9 ; 249 24450: 60 81 ld r22, Z 24452: 71 81 ldd r23, Z+1 ; 0x01 24454: 82 81 ldd r24, Z+2 ; 0x02 24456: 93 81 ldd r25, Z+3 ; 0x03 CRITICAL_SECTION_END; 24458: 2f bf out 0x3f, r18 ; 63 return count_pos; } 2445a: 08 95 ret 0002445c : y = count_position[Y_AXIS]; CRITICAL_SECTION_END; } float st_get_position_mm(uint8_t axis) { 2445c: cf 93 push r28 2445e: c8 2f mov r28, r24 float steper_position_in_steps = st_get_position(axis); 24460: 0f 94 20 22 call 0x24440 ; 0x24440 24464: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> return steper_position_in_steps / cs.axis_steps_per_mm[axis]; 24468: 24 e0 ldi r18, 0x04 ; 4 2446a: c2 9f mul r28, r18 2446c: f0 01 movw r30, r0 2446e: 11 24 eor r1, r1 24470: ea 5c subi r30, 0xCA ; 202 24472: fb 4f sbci r31, 0xFB ; 251 24474: 20 81 ld r18, Z 24476: 31 81 ldd r19, Z+1 ; 0x01 24478: 42 81 ldd r20, Z+2 ; 0x02 2447a: 53 81 ldd r21, Z+3 ; 0x03 2447c: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> } 24480: cf 91 pop r28 24482: 08 95 ret 00024484 : return(block); } // Returns true if the buffer has a queued block, false otherwise FORCE_INLINE bool blocks_queued() { return (block_buffer_head != block_buffer_tail); 24484: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 24488: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 // Block until all buffered steps are executed void st_synchronize() { while(blocks_queued()) 2448c: 98 17 cp r25, r24 2448e: 29 f0 breq .+10 ; 0x2449a manage_inactivity(true); lcd_update(0); } #else //TMC2130 // Vojtech: Don't disable motors inside the planner! delay_keep_alive(0); 24490: 90 e0 ldi r25, 0x00 ; 0 24492: 80 e0 ldi r24, 0x00 ; 0 24494: 0e 94 48 7c call 0xf890 ; 0xf890 24498: f5 cf rjmp .-22 ; 0x24484 #endif //TMC2130 } } 2449a: 08 95 ret 0002449c : void st_reset_timer() { // Clear a possible pending interrupt on OCR1A overflow. TIFR1 |= 1 << OCF1A; 2449c: b1 9a sbi 0x16, 1 ; 22 // Reset the counter. TCNT1 = 0; 2449e: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 244a2: 10 92 84 00 sts 0x0084, r1 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> // Wake up after 1ms from now. OCR1A = 2000; 244a6: 80 ed ldi r24, 0xD0 ; 208 244a8: 97 e0 ldi r25, 0x07 ; 7 244aa: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 244ae: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> #ifdef LIN_ADVANCE nextMainISR = 0; 244b2: 10 92 1d 04 sts 0x041D, r1 ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 244b6: 10 92 1c 04 sts 0x041C, r1 ; 0x80041c <_ZL11nextMainISR.lto_priv.435> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 244ba: 80 91 1a 04 lds r24, 0x041A ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> 244be: 90 91 1b 04 lds r25, 0x041B ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 244c2: 01 97 sbiw r24, 0x01 ; 1 244c4: 8e 3f cpi r24, 0xFE ; 254 244c6: 9f 4f sbci r25, 0xFF ; 255 244c8: 20 f4 brcc .+8 ; 0x244d2 nextAdvanceISR = 0; 244ca: 10 92 1b 04 sts 0x041B, r1 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 244ce: 10 92 1a 04 sts 0x041A, r1 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> #endif } 244d2: 08 95 ret 000244d4 <__vector_17>: // step_events_completed reaches block->decelerate_after after which it decelerates until the trapezoid generator is reset. // The slope of acceleration is calculated using v = u + at where t is the accumulated timer values of the steps so far. // "The Stepper Driver Interrupt" - This timer interrupt is the workhorse. // It pops blocks from the block_buffer and executes them by pulsing the stepper pins appropriately. ISR(TIMER1_COMPA_vect) { 244d4: 1f 92 push r1 244d6: 0f 92 push r0 244d8: 0f b6 in r0, 0x3f ; 63 244da: 0f 92 push r0 244dc: 11 24 eor r1, r1 244de: 0b b6 in r0, 0x3b ; 59 244e0: 0f 92 push r0 244e2: 4f 92 push r4 244e4: 5f 92 push r5 244e6: 6f 92 push r6 244e8: 7f 92 push r7 244ea: 8f 92 push r8 244ec: cf 92 push r12 244ee: df 92 push r13 244f0: ef 92 push r14 244f2: ff 92 push r15 244f4: 1f 93 push r17 244f6: 2f 93 push r18 244f8: 3f 93 push r19 244fa: 4f 93 push r20 244fc: 5f 93 push r21 244fe: 6f 93 push r22 24500: 7f 93 push r23 24502: 8f 93 push r24 24504: 9f 93 push r25 24506: af 93 push r26 24508: bf 93 push r27 2450a: cf 93 push r28 2450c: df 93 push r29 2450e: ef 93 push r30 24510: ff 93 push r31 } } FORCE_INLINE void advance_isr_scheduler() { // Integrate the final timer value, accounting for scheduling adjustments if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 24512: 80 91 1a 04 lds r24, 0x041A ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> 24516: 90 91 1b 04 lds r25, 0x041B ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 2451a: 9c 01 movw r18, r24 2451c: 21 50 subi r18, 0x01 ; 1 2451e: 31 09 sbc r19, r1 24520: 2e 3f cpi r18, 0xFE ; 254 24522: 3f 4f sbci r19, 0xFF ; 255 24524: 90 f4 brcc .+36 ; 0x2454a <__vector_17+0x76> { if(nextAdvanceISR > OCR1A) 24526: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2452a: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2452e: 28 17 cp r18, r24 24530: 39 07 cpc r19, r25 24532: 08 f0 brcs .+2 ; 0x24536 <__vector_17+0x62> 24534: f9 c0 rjmp .+498 ; 0x24728 <__vector_17+0x254> nextAdvanceISR -= OCR1A; 24536: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2453a: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2453e: 82 1b sub r24, r18 24540: 93 0b sbc r25, r19 24542: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 24546: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> else nextAdvanceISR = 0; } if(nextMainISR > OCR1A) 2454a: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2454e: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 24552: 80 91 1c 04 lds r24, 0x041C ; 0x80041c <_ZL11nextMainISR.lto_priv.435> 24556: 90 91 1d 04 lds r25, 0x041D ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 2455a: 28 17 cp r18, r24 2455c: 39 07 cpc r19, r25 2455e: 08 f0 brcs .+2 ; 0x24562 <__vector_17+0x8e> 24560: e8 c0 rjmp .+464 ; 0x24732 <__vector_17+0x25e> nextMainISR -= OCR1A; 24562: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 24566: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2456a: 82 1b sub r24, r18 2456c: 93 0b sbc r25, r19 2456e: 90 93 1d 04 sts 0x041D, r25 ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 24572: 80 93 1c 04 sts 0x041C, r24 ; 0x80041c <_ZL11nextMainISR.lto_priv.435> else nextMainISR = 0; // Run main stepping ISR if flagged if (!nextMainISR) 24576: 80 91 1c 04 lds r24, 0x041C ; 0x80041c <_ZL11nextMainISR.lto_priv.435> 2457a: 90 91 1d 04 lds r25, 0x041D ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 2457e: 89 2b or r24, r25 24580: 11 f0 breq .+4 ; 0x24586 <__vector_17+0xb2> 24582: 0d 94 55 2b jmp 0x256aa ; 0x256aa <__vector_17+0x11d6> FORCE_INLINE void isr() { //WRITE_NC(LOGIC_ANALYZER_CH0, true); //if (UVLO) uvlo(); // If there is no current block, attempt to pop one from the buffer if (current_block == NULL) 24586: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 2458a: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 2458e: 30 97 sbiw r30, 0x00 ; 0 24590: 09 f0 breq .+2 ; 0x24594 <__vector_17+0xc0> 24592: 82 c1 rjmp .+772 ; 0x24898 <__vector_17+0x3c4> // Mark this block as busy, so its velocities and acceperations will be no more recalculated // by the planner routine. // Returns NULL if buffer empty FORCE_INLINE block_t *plan_get_current_block() { if (block_buffer_head == block_buffer_tail) { 24594: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 24598: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 2459c: 98 17 cp r25, r24 2459e: 09 f4 brne .+2 ; 0x245a2 <__vector_17+0xce> 245a0: 35 c3 rjmp .+1642 ; 0x24c0c <__vector_17+0x738> return(NULL); } block_t *block = &block_buffer[block_buffer_tail]; 245a2: c0 91 a9 0d lds r28, 0x0DA9 ; 0x800da9 245a6: 2c 2f mov r18, r28 245a8: 30 e0 ldi r19, 0x00 ; 0 245aa: 5e e6 ldi r21, 0x6E ; 110 245ac: c5 9f mul r28, r21 245ae: e0 01 movw r28, r0 245b0: 11 24 eor r1, r1 245b2: c8 53 subi r28, 0x38 ; 56 245b4: d9 4f sbci r29, 0xF9 ; 249 block->busy = true; 245b6: fe 01 movw r30, r28 245b8: e9 5b subi r30, 0xB9 ; 185 245ba: ff 4f sbci r31, 0xFF ; 255 245bc: 41 e0 ldi r20, 0x01 ; 1 245be: 40 83 st Z, r20 FORCE_INLINE void stepper_next_block() { // Anything in the buffer? //WRITE_NC(LOGIC_ANALYZER_CH2, true); current_block = plan_get_current_block(); 245c0: d0 93 e5 11 sts 0x11E5, r29 ; 0x8011e5 245c4: c0 93 e4 11 sts 0x11E4, r28 ; 0x8011e4 if (current_block != NULL) { 245c8: 20 97 sbiw r28, 0x00 ; 0 245ca: 09 f4 brne .+2 ; 0x245ce <__vector_17+0xfa> 245cc: 1f c3 rjmp .+1598 ; 0x24c0c <__vector_17+0x738> // The busy flag is set by the plan_get_current_block() call. // current_block->busy = true; // Initializes the trapezoid generator from the current block. Called whenever a new // block begins. deceleration_time = 0; 245ce: 10 92 e1 05 sts 0x05E1, r1 ; 0x8005e1 245d2: 10 92 e2 05 sts 0x05E2, r1 ; 0x8005e2 245d6: 10 92 e3 05 sts 0x05E3, r1 ; 0x8005e3 245da: 10 92 e4 05 sts 0x05E4, r1 ; 0x8005e4 // Set the nominal step loops to zero to indicate, that the timer value is not known yet. // That means, delay the initialization of nominal step rate and step loops until the steady // state is reached. step_loops_nominal = 0; 245de: 10 92 e0 05 sts 0x05E0, r1 ; 0x8005e0 acc_step_rate = uint16_t(current_block->initial_rate); 245e2: 8a ad ldd r24, Y+58 ; 0x3a 245e4: 9b ad ldd r25, Y+59 ; 0x3b 245e6: 90 93 df 05 sts 0x05DF, r25 ; 0x8005df 245ea: 80 93 de 05 sts 0x05DE, r24 ; 0x8005de #endif //_NO_ASM FORCE_INLINE unsigned short calc_timer(uint16_t step_rate, uint8_t& step_loops) { uint16_t timer; if(step_rate > MAX_STEP_FREQUENCY) step_rate = MAX_STEP_FREQUENCY; 245ee: 81 34 cpi r24, 0x41 ; 65 245f0: ac e9 ldi r26, 0x9C ; 156 245f2: 9a 07 cpc r25, r26 245f4: 08 f0 brcs .+2 ; 0x245f8 <__vector_17+0x124> 245f6: a2 c0 rjmp .+324 ; 0x2473c <__vector_17+0x268> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 245f8: 81 32 cpi r24, 0x21 ; 33 245fa: be e4 ldi r27, 0x4E ; 78 245fc: 9b 07 cpc r25, r27 245fe: 08 f4 brcc .+2 ; 0x24602 <__vector_17+0x12e> 24600: a0 c0 rjmp .+320 ; 0x24742 <__vector_17+0x26e> step_rate = (step_rate >> 2)&0x3fff; 24602: 96 95 lsr r25 24604: 87 95 ror r24 24606: 96 95 lsr r25 24608: 87 95 ror r24 step_loops = 4; 2460a: 44 e0 ldi r20, 0x04 ; 4 } else if(step_rate > 10000) { // If steprate > 10kHz >> step 2 times step_rate = (step_rate >> 1)&0x7fff; step_loops = 2; 2460c: 40 93 dd 05 sts 0x05DD, r20 ; 0x8005dd else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 24610: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 24612: 81 15 cp r24, r1 24614: f8 e0 ldi r31, 0x08 ; 8 24616: 9f 07 cpc r25, r31 24618: 08 f4 brcc .+2 ; 0x2461c <__vector_17+0x148> 2461a: a4 c0 rjmp .+328 ; 0x24764 <__vector_17+0x290> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2461c: e9 2f mov r30, r25 2461e: ff 27 eor r31, r31 24620: ee 0f add r30, r30 24622: ff 1f adc r31, r31 24624: ee 0f add r30, r30 24626: ff 1f adc r31, r31 24628: af 01 movw r20, r30 2462a: 4a 52 subi r20, 0x2A ; 42 2462c: 53 47 sbci r21, 0x73 ; 115 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 2462e: fa 01 movw r30, r20 24630: 32 96 adiw r30, 0x02 ; 2 24632: a5 91 lpm r26, Z+ 24634: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 24636: fa 01 movw r30, r20 24638: 45 91 lpm r20, Z+ 2463a: 54 91 lpm r21, Z "clr r1" "\n\t" //make r1 __zero_reg__ again "adc %B0, r1" "\n\t" //propagate carry of addition (add 0 with carry) : "=&r" (out) : "r" (x), "r" (y) : "r0", "r1" //clobbers: Technically these are either scratch registers or always 0 registers, but I'm making sure the compiler knows just in case. ); 2463c: b8 9f mul r27, r24 2463e: b0 01 movw r22, r0 24640: a8 9f mul r26, r24 24642: 00 0c add r0, r0 24644: 61 1d adc r22, r1 24646: 11 24 eor r1, r1 24648: 71 1d adc r23, r1 } else { // lower step rates unsigned short table_address = (unsigned short)&speed_lookuptable_slow[0][0]; table_address += ((step_rate)>>1) & 0xfffc; timer = (unsigned short)pgm_read_word_near(table_address); timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2464a: 46 1b sub r20, r22 2464c: 57 0b sbc r21, r23 acceleration_time = calc_timer(acc_step_rate, step_loops); 2464e: ca 01 movw r24, r20 24650: 44 36 cpi r20, 0x64 ; 100 24652: 51 05 cpc r21, r1 24654: 10 f4 brcc .+4 ; 0x2465a <__vector_17+0x186> 24656: 84 e6 ldi r24, 0x64 ; 100 24658: 90 e0 ldi r25, 0x00 ; 0 2465a: b0 e0 ldi r27, 0x00 ; 0 2465c: a0 e0 ldi r26, 0x00 ; 0 2465e: 80 93 d9 05 sts 0x05D9, r24 ; 0x8005d9 24662: 90 93 da 05 sts 0x05DA, r25 ; 0x8005da 24666: a0 93 db 05 sts 0x05DB, r26 ; 0x8005db 2466a: b0 93 dc 05 sts 0x05DC, r27 ; 0x8005dc #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2466e: 4e e6 ldi r20, 0x6E ; 110 24670: 42 9f mul r20, r18 24672: c0 01 movw r24, r0 24674: 43 9f mul r20, r19 24676: 90 0d add r25, r0 24678: 11 24 eor r1, r1 2467a: 88 53 subi r24, 0x38 ; 56 2467c: 99 4f sbci r25, 0xF9 ; 249 2467e: fc 01 movw r30, r24 24680: e4 5b subi r30, 0xB4 ; 180 24682: ff 4f sbci r31, 0xFF ; 255 24684: 40 81 ld r20, Z 24686: 44 23 and r20, r20 24688: 49 f0 breq .+18 ; 0x2469c <__vector_17+0x1c8> target_adv_steps = current_block->max_adv_steps; 2468a: 81 5b subi r24, 0xB1 ; 177 2468c: 9f 4f sbci r25, 0xFF ; 255 2468e: dc 01 movw r26, r24 24690: 8d 91 ld r24, X+ 24692: 9c 91 ld r25, X 24694: 90 93 d8 05 sts 0x05D8, r25 ; 0x8005d8 24698: 80 93 d7 05 sts 0x05D7, r24 ; 0x8005d7 } e_steps = 0; 2469c: 10 92 d6 05 sts 0x05D6, r1 ; 0x8005d6 nextAdvanceISR = ADV_NEVER; 246a0: 8f ef ldi r24, 0xFF ; 255 246a2: 9f ef ldi r25, 0xFF ; 255 246a4: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 246a8: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> LA_phase = -1; 246ac: 80 93 d5 05 sts 0x05D5, r24 ; 0x8005d5 #endif if (current_block->flag & BLOCK_FLAG_E_RESET) { 246b0: 8e e6 ldi r24, 0x6E ; 110 246b2: 82 9f mul r24, r18 246b4: f0 01 movw r30, r0 246b6: 83 9f mul r24, r19 246b8: f0 0d add r31, r0 246ba: 11 24 eor r1, r1 246bc: e8 53 subi r30, 0x38 ; 56 246be: f9 4f sbci r31, 0xF9 ; 249 246c0: 85 a9 ldd r24, Z+53 ; 0x35 246c2: 84 ff sbrs r24, 4 246c4: 08 c0 rjmp .+16 ; 0x246d6 <__vector_17+0x202> count_position[E_AXIS] = 0; 246c6: 10 92 c2 06 sts 0x06C2, r1 ; 0x8006c2 246ca: 10 92 c3 06 sts 0x06C3, r1 ; 0x8006c3 246ce: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 246d2: 10 92 c5 06 sts 0x06C5, r1 ; 0x8006c5 } if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) { 246d6: 83 ff sbrs r24, 3 246d8: 61 c0 rjmp .+194 ; 0x2479c <__vector_17+0x2c8> const int16_t value = -(current_block->step_event_count.lo >> 1); 246da: 8e e6 ldi r24, 0x6E ; 110 246dc: 82 9f mul r24, r18 246de: f0 01 movw r30, r0 246e0: 83 9f mul r24, r19 246e2: f0 0d add r31, r0 246e4: 11 24 eor r1, r1 246e6: e8 53 subi r30, 0x38 ; 56 246e8: f9 4f sbci r31, 0xF9 ; 249 246ea: 80 89 ldd r24, Z+16 ; 0x10 246ec: 91 89 ldd r25, Z+17 ; 0x11 246ee: 96 95 lsr r25 246f0: 87 95 ror r24 246f2: 91 95 neg r25 246f4: 81 95 neg r24 246f6: 91 09 sbc r25, r1 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].lo = value; 246f8: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 246fc: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 24700: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 24704: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 24708: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 2470c: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd 24710: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 24714: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].lo != 0; 24718: 81 e0 ldi r24, 0x01 ; 1 2471a: 24 85 ldd r18, Z+12 ; 0x0c 2471c: 35 85 ldd r19, Z+13 ; 0x0d 2471e: 23 2b or r18, r19 24720: 09 f0 breq .+2 ; 0x24724 <__vector_17+0x250> 24722: 7d c0 rjmp .+250 ; 0x2481e <__vector_17+0x34a> for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].wide = value; } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].wide != 0; 24724: 80 e0 ldi r24, 0x00 ; 0 24726: 7b c0 rjmp .+246 ; 0x2481e <__vector_17+0x34a> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) { if(nextAdvanceISR > OCR1A) nextAdvanceISR -= OCR1A; else nextAdvanceISR = 0; 24728: 10 92 1b 04 sts 0x041B, r1 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 2472c: 10 92 1a 04 sts 0x041A, r1 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> 24730: 0c cf rjmp .-488 ; 0x2454a <__vector_17+0x76> } if(nextMainISR > OCR1A) nextMainISR -= OCR1A; else nextMainISR = 0; 24732: 10 92 1d 04 sts 0x041D, r1 ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 24736: 10 92 1c 04 sts 0x041C, r1 ; 0x80041c <_ZL11nextMainISR.lto_priv.435> 2473a: 1d cf rjmp .-454 ; 0x24576 <__vector_17+0xa2> #endif //_NO_ASM FORCE_INLINE unsigned short calc_timer(uint16_t step_rate, uint8_t& step_loops) { uint16_t timer; if(step_rate > MAX_STEP_FREQUENCY) step_rate = MAX_STEP_FREQUENCY; 2473c: 80 e4 ldi r24, 0x40 ; 64 2473e: 9c e9 ldi r25, 0x9C ; 156 24740: 60 cf rjmp .-320 ; 0x24602 <__vector_17+0x12e> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times step_rate = (step_rate >> 2)&0x3fff; step_loops = 4; } else if(step_rate > 10000) { // If steprate > 10kHz >> step 2 times 24742: 81 31 cpi r24, 0x11 ; 17 24744: e7 e2 ldi r30, 0x27 ; 39 24746: 9e 07 cpc r25, r30 24748: 20 f0 brcs .+8 ; 0x24752 <__vector_17+0x27e> step_rate = (step_rate >> 1)&0x7fff; 2474a: 96 95 lsr r25 2474c: 87 95 ror r24 step_loops = 2; 2474e: 42 e0 ldi r20, 0x02 ; 2 24750: 5d cf rjmp .-326 ; 0x2460c <__vector_17+0x138> } else { step_loops = 1; 24752: 40 93 dd 05 sts 0x05DD, r20 ; 0x8005dd 24756: 80 32 cpi r24, 0x20 ; 32 24758: 91 05 cpc r25, r1 2475a: 08 f0 brcs .+2 ; 0x2475e <__vector_17+0x28a> 2475c: 59 cf rjmp .-334 ; 0x24610 <__vector_17+0x13c> 2475e: 80 e2 ldi r24, 0x20 ; 32 24760: 90 e0 ldi r25, 0x00 ; 0 24762: 56 cf rjmp .-340 ; 0x24610 <__vector_17+0x13c> uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); } else { // lower step rates unsigned short table_address = (unsigned short)&speed_lookuptable_slow[0][0]; table_address += ((step_rate)>>1) & 0xfffc; 24764: bc 01 movw r22, r24 24766: 76 95 lsr r23 24768: 67 95 ror r22 2476a: 6c 7f andi r22, 0xFC ; 252 2476c: 6a 52 subi r22, 0x2A ; 42 2476e: 77 47 sbci r23, 0x77 ; 119 timer = (unsigned short)pgm_read_word_near(table_address); 24770: fb 01 movw r30, r22 24772: 45 91 lpm r20, Z+ 24774: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 24776: fb 01 movw r30, r22 24778: 32 96 adiw r30, 0x02 ; 2 2477a: a5 91 lpm r26, Z+ 2477c: b4 91 lpm r27, Z 2477e: 87 70 andi r24, 0x07 ; 7 24780: 99 27 eor r25, r25 24782: 8a 9f mul r24, r26 24784: b0 01 movw r22, r0 24786: 8b 9f mul r24, r27 24788: 70 0d add r23, r0 2478a: 9a 9f mul r25, r26 2478c: 70 0d add r23, r0 2478e: 11 24 eor r1, r1 24790: e3 e0 ldi r30, 0x03 ; 3 24792: 76 95 lsr r23 24794: 67 95 ror r22 24796: ea 95 dec r30 24798: e1 f7 brne .-8 ; 0x24792 <__vector_17+0x2be> 2479a: 57 cf rjmp .-338 ; 0x2464a <__vector_17+0x176> } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].lo != 0; #endif } else { const int32_t value = -(current_block->step_event_count.wide >> 1); 2479c: 8e e6 ldi r24, 0x6E ; 110 2479e: 82 9f mul r24, r18 247a0: f0 01 movw r30, r0 247a2: 83 9f mul r24, r19 247a4: f0 0d add r31, r0 247a6: 11 24 eor r1, r1 247a8: e8 53 subi r30, 0x38 ; 56 247aa: f9 4f sbci r31, 0xF9 ; 249 247ac: 80 89 ldd r24, Z+16 ; 0x10 247ae: 91 89 ldd r25, Z+17 ; 0x11 247b0: a2 89 ldd r26, Z+18 ; 0x12 247b2: b3 89 ldd r27, Z+19 ; 0x13 247b4: b6 95 lsr r27 247b6: a7 95 ror r26 247b8: 97 95 ror r25 247ba: 87 95 ror r24 247bc: b0 95 com r27 247be: a0 95 com r26 247c0: 90 95 com r25 247c2: 81 95 neg r24 247c4: 9f 4f sbci r25, 0xFF ; 255 247c6: af 4f sbci r26, 0xFF ; 255 247c8: bf 4f sbci r27, 0xFF ; 255 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].wide = value; 247ca: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 247ce: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 247d2: a0 93 c7 05 sts 0x05C7, r26 ; 0x8005c7 247d6: b0 93 c8 05 sts 0x05C8, r27 ; 0x8005c8 247da: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 247de: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 247e2: a0 93 cb 05 sts 0x05CB, r26 ; 0x8005cb 247e6: b0 93 cc 05 sts 0x05CC, r27 ; 0x8005cc 247ea: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd 247ee: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 247f2: a0 93 cf 05 sts 0x05CF, r26 ; 0x8005cf 247f6: b0 93 d0 05 sts 0x05D0, r27 ; 0x8005d0 247fa: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 247fe: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 24802: a0 93 d3 05 sts 0x05D3, r26 ; 0x8005d3 24806: b0 93 d4 05 sts 0x05D4, r27 ; 0x8005d4 } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].wide != 0; 2480a: 81 e0 ldi r24, 0x01 ; 1 2480c: 44 85 ldd r20, Z+12 ; 0x0c 2480e: 55 85 ldd r21, Z+13 ; 0x0d 24810: 66 85 ldd r22, Z+14 ; 0x0e 24812: 77 85 ldd r23, Z+15 ; 0x0f 24814: 45 2b or r20, r21 24816: 46 2b or r20, r22 24818: 47 2b or r20, r23 2481a: 09 f4 brne .+2 ; 0x2481e <__vector_17+0x34a> 2481c: 83 cf rjmp .-250 ; 0x24724 <__vector_17+0x250> 2481e: 80 93 c4 05 sts 0x05C4, r24 ; 0x8005c4 #endif } step_events_completed.wide = 0; 24822: 10 92 c0 05 sts 0x05C0, r1 ; 0x8005c0 24826: 10 92 c1 05 sts 0x05C1, r1 ; 0x8005c1 2482a: 10 92 c2 05 sts 0x05C2, r1 ; 0x8005c2 2482e: 10 92 c3 05 sts 0x05C3, r1 ; 0x8005c3 // Set directions. out_bits = current_block->direction_bits; 24832: 88 8d ldd r24, Y+24 ; 0x18 24834: 80 93 bf 05 sts 0x05BF, r24 ; 0x8005bf // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY) if((out_bits & (1< WRITE_NC(X_DIR_PIN, INVERT_X_DIR); 2483c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24840: 8d 7f andi r24, 0xFD ; 253 24842: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=-1; 24846: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(X_DIR_PIN, !INVERT_X_DIR); count_direction[X_AXIS]=1; 24848: 80 93 5d 02 sts 0x025D, r24 ; 0x80025d } if((out_bits & (1< 24850: 81 ff sbrs r24, 1 24852: cc c1 rjmp .+920 ; 0x24bec <__vector_17+0x718> WRITE_NC(Y_DIR_PIN, INVERT_Y_DIR); 24854: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24858: 8e 7f andi r24, 0xFE ; 254 2485a: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=-1; 2485e: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(Y_DIR_PIN, !INVERT_Y_DIR); count_direction[Y_AXIS]=1; 24860: 80 93 5e 02 sts 0x025E, r24 ; 0x80025e } if ((out_bits & (1< 24868: 82 ff sbrs r24, 2 2486a: c7 c1 rjmp .+910 ; 0x24bfa <__vector_17+0x726> WRITE_NC(Z_DIR_PIN,INVERT_Z_DIR); 2486c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24870: 8b 7f andi r24, 0xFB ; 251 24872: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=-1; 24876: 8f ef ldi r24, 0xFF ; 255 } else { // +direction WRITE_NC(Z_DIR_PIN,!INVERT_Z_DIR); count_direction[Z_AXIS]=1; 24878: 80 93 5f 02 sts 0x025F, r24 ; 0x80025f } if ((out_bits & (1 << E_AXIS)) != 0) { // -direction 2487c: 80 91 bf 05 lds r24, 0x05BF ; 0x8005bf 24880: 83 ff sbrs r24, 3 24882: c2 c1 rjmp .+900 ; 0x24c08 <__vector_17+0x734> #ifndef LIN_ADVANCE WRITE(E0_DIR_PIN, INVERT_E0_DIR); #endif /* LIN_ADVANCE */ count_direction[E_AXIS] = -1; 24884: 8f ef ldi r24, 0xFF ; 255 } else { // +direction #ifndef LIN_ADVANCE WRITE(E0_DIR_PIN, !INVERT_E0_DIR); #endif /* LIN_ADVANCE */ count_direction[E_AXIS] = 1; 24886: 80 93 60 02 sts 0x0260, r24 ; 0x800260 //if (UVLO) uvlo(); // If there is no current block, attempt to pop one from the buffer if (current_block == NULL) stepper_next_block(); if (current_block != NULL) 2488a: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 2488e: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24892: 30 97 sbiw r30, 0x00 ; 0 24894: 09 f4 brne .+2 ; 0x24898 <__vector_17+0x3c4> 24896: 09 c7 rjmp .+3602 ; 0x256aa <__vector_17+0x11d6> } // Check limit switches. FORCE_INLINE void stepper_check_endstops() { if(check_endstops) 24898: 80 91 77 02 lds r24, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.364> 2489c: 50 91 bc 05 lds r21, 0x05BC ; 0x8005bc 248a0: 88 23 and r24, r24 248a2: 09 f4 brne .+2 ; 0x248a6 <__vector_17+0x3d2> 248a4: 6c c0 rjmp .+216 ; 0x2497e <__vector_17+0x4aa> { uint8_t _endstop_hit = endstop_hit; 248a6: 20 91 2c 04 lds r18, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.439> uint8_t _endstop = endstop; 248aa: 80 91 be 05 lds r24, 0x05BE ; 0x8005be uint8_t _old_endstop = old_endstop; 248ae: 90 91 bd 05 lds r25, 0x05BD ; 0x8005bd #ifndef COREXY if ((out_bits & (1< 248b6: 30 ff sbrs r19, 0 248b8: 1d c0 rjmp .+58 ; 0x248f4 <__vector_17+0x420> #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, X_AXIS, (!READ(X_TMC2130_DIAG))); #else // Normal homing SET_BIT_TO(_endstop, X_AXIS, (READ(X_MIN_PIN) != X_MIN_ENDSTOP_INVERTING)); 248ba: 1e 9b sbis 0x03, 6 ; 3 248bc: c6 c1 rjmp .+908 ; 0x24c4a <__vector_17+0x776> 248be: 81 60 ori r24, 0x01 ; 1 #endif if((_endstop & _old_endstop & _BV(X_AXIS)) && (current_block->steps[X_AXIS].wide > 0)) { 248c0: 49 2f mov r20, r25 248c2: 41 70 andi r20, 0x01 ; 1 248c4: 48 23 and r20, r24 248c6: b1 f0 breq .+44 ; 0x248f4 <__vector_17+0x420> 248c8: c0 80 ld r12, Z 248ca: d1 80 ldd r13, Z+1 ; 0x01 248cc: e2 80 ldd r14, Z+2 ; 0x02 248ce: f3 80 ldd r15, Z+3 ; 0x03 248d0: 1c 14 cp r1, r12 248d2: 1d 04 cpc r1, r13 248d4: 1e 04 cpc r1, r14 248d6: 1f 04 cpc r1, r15 248d8: 6c f4 brge .+26 ; 0x248f4 <__vector_17+0x420> #ifdef VERBOSE_CHECK_HIT_ENDSTOPS endstops_trigsteps[X_AXIS] = count_position[X_AXIS]; #endif //VERBOSE_CHECK_HIT_ENDSTOPS _endstop_hit |= _BV(X_AXIS); 248da: 21 60 ori r18, 0x01 ; 1 step_events_completed.wide = current_block->step_event_count.wide; 248dc: c0 88 ldd r12, Z+16 ; 0x10 248de: d1 88 ldd r13, Z+17 ; 0x11 248e0: e2 88 ldd r14, Z+18 ; 0x12 248e2: f3 88 ldd r15, Z+19 ; 0x13 248e4: c0 92 c0 05 sts 0x05C0, r12 ; 0x8005c0 248e8: d0 92 c1 05 sts 0x05C1, r13 ; 0x8005c1 248ec: e0 92 c2 05 sts 0x05C2, r14 ; 0x8005c2 248f0: f0 92 c3 05 sts 0x05C3, r15 ; 0x8005c3 } #endif } #ifndef COREXY if ((out_bits & (1< #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, Y_AXIS, (!READ(Y_TMC2130_DIAG))); #else // Normal homing SET_BIT_TO(_endstop, Y_AXIS, (READ(Y_MIN_PIN) != Y_MIN_ENDSTOP_INVERTING)); 248f8: 1d 9b sbis 0x03, 5 ; 3 248fa: a9 c1 rjmp .+850 ; 0x24c4e <__vector_17+0x77a> 248fc: 82 60 ori r24, 0x02 ; 2 #endif if((_endstop & _old_endstop & _BV(Y_AXIS)) && (current_block->steps[Y_AXIS].wide > 0)) { 248fe: 49 2f mov r20, r25 24900: 42 70 andi r20, 0x02 ; 2 24902: 48 23 and r20, r24 24904: b1 f0 breq .+44 ; 0x24932 <__vector_17+0x45e> 24906: c4 80 ldd r12, Z+4 ; 0x04 24908: d5 80 ldd r13, Z+5 ; 0x05 2490a: e6 80 ldd r14, Z+6 ; 0x06 2490c: f7 80 ldd r15, Z+7 ; 0x07 2490e: 1c 14 cp r1, r12 24910: 1d 04 cpc r1, r13 24912: 1e 04 cpc r1, r14 24914: 1f 04 cpc r1, r15 24916: 6c f4 brge .+26 ; 0x24932 <__vector_17+0x45e> #ifdef VERBOSE_CHECK_HIT_ENDSTOPS endstops_trigsteps[Y_AXIS] = count_position[Y_AXIS]; #endif //VERBOSE_CHECK_HIT_ENDSTOPS _endstop_hit |= _BV(Y_AXIS); 24918: 22 60 ori r18, 0x02 ; 2 step_events_completed.wide = current_block->step_event_count.wide; 2491a: c0 88 ldd r12, Z+16 ; 0x10 2491c: d1 88 ldd r13, Z+17 ; 0x11 2491e: e2 88 ldd r14, Z+18 ; 0x12 24920: f3 88 ldd r15, Z+19 ; 0x13 24922: c0 92 c0 05 sts 0x05C0, r12 ; 0x8005c0 24926: d0 92 c1 05 sts 0x05C1, r13 ; 0x8005c1 2492a: e0 92 c2 05 sts 0x05C2, r14 ; 0x8005c2 2492e: f0 92 c3 05 sts 0x05C3, r15 ; 0x8005c3 step_events_completed.wide = current_block->step_event_count.wide; } #endif } if ((out_bits & (1< { #if defined(Z_MIN_PIN) && (Z_MIN_PIN > -1) && !defined(DEBUG_DISABLE_ZMINLIMIT) if (! check_z_endstop) { 24936: 51 11 cpse r21, r1 24938: 1c c0 rjmp .+56 ; 0x24972 <__vector_17+0x49e> SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); else #endif //TMC2130_STEALTH_Z SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING) || (!READ(Z_TMC2130_DIAG))); #else SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 2493a: 1c 9b sbis 0x03, 4 ; 3 2493c: 8a c1 rjmp .+788 ; 0x24c52 <__vector_17+0x77e> 2493e: 84 60 ori r24, 0x04 ; 4 #endif //TMC2130_SG_HOMING if((_endstop & _old_endstop & _BV(Z_AXIS)) && (current_block->steps[Z_AXIS].wide > 0)) { 24940: 94 70 andi r25, 0x04 ; 4 #endif //TMC2130_STEALTH_Z SET_BIT_TO(_endstop, Z_AXIS + 4, (!READ(Z_TMC2130_DIAG))); #else SET_BIT_TO(_endstop, Z_AXIS + 4, (READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING)); #endif //TMC2130_SG_HOMING if((_endstop & _old_endstop & _BV(Z_AXIS + 4)) && (current_block->steps[Z_AXIS].wide > 0)) { 24942: 98 23 and r25, r24 24944: b1 f0 breq .+44 ; 0x24972 <__vector_17+0x49e> 24946: c0 84 ldd r12, Z+8 ; 0x08 24948: d1 84 ldd r13, Z+9 ; 0x09 2494a: e2 84 ldd r14, Z+10 ; 0x0a 2494c: f3 84 ldd r15, Z+11 ; 0x0b 2494e: 1c 14 cp r1, r12 24950: 1d 04 cpc r1, r13 24952: 1e 04 cpc r1, r14 24954: 1f 04 cpc r1, r15 24956: 6c f4 brge .+26 ; 0x24972 <__vector_17+0x49e> #ifdef VERBOSE_CHECK_HIT_ENDSTOPS endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; #endif //VERBOSE_CHECK_HIT_ENDSTOPS _endstop_hit |= _BV(Z_AXIS); 24958: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 2495a: c0 88 ldd r12, Z+16 ; 0x10 2495c: d1 88 ldd r13, Z+17 ; 0x11 2495e: e2 88 ldd r14, Z+18 ; 0x12 24960: f3 88 ldd r15, Z+19 ; 0x13 24962: c0 92 c0 05 sts 0x05C0, r12 ; 0x8005c0 24966: d0 92 c1 05 sts 0x05C1, r13 ; 0x8005c1 2496a: e0 92 c2 05 sts 0x05C2, r14 ; 0x8005c2 2496e: f0 92 c3 05 sts 0x05C3, r15 ; 0x8005c3 } #endif } endstop = _endstop; 24972: 80 93 be 05 sts 0x05BE, r24 ; 0x8005be old_endstop = _endstop; //apply current endstop state to the old endstop 24976: 80 93 bd 05 sts 0x05BD, r24 ; 0x8005bd endstop_hit = _endstop_hit; 2497a: 20 93 2c 04 sts 0x042C, r18 ; 0x80042c <_ZL11endstop_hit.lto_priv.439> } // Supporting stopping on a trigger of the Z-stop induction sensor, not only for the Z-minus movements. #if defined(Z_MIN_PIN) && (Z_MIN_PIN > -1) && !defined(DEBUG_DISABLE_ZMINLIMIT) if (check_z_endstop) { 2497e: 55 23 and r21, r21 24980: f9 f0 breq .+62 ; 0x249c0 <__vector_17+0x4ec> uint8_t _endstop_hit = endstop_hit; 24982: 20 91 2c 04 lds r18, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.439> uint8_t _endstop = endstop; 24986: 80 91 be 05 lds r24, 0x05BE ; 0x8005be uint8_t _old_endstop = old_endstop; 2498a: 90 91 bd 05 lds r25, 0x05BD ; 0x8005bd SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); else #endif //TMC2130_STEALTH_Z SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING) || (!READ(Z_TMC2130_DIAG))); #else SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 2498e: 1c 9b sbis 0x03, 4 ; 3 24990: 69 c1 rjmp .+722 ; 0x24c64 <__vector_17+0x790> 24992: 84 60 ori r24, 0x04 ; 4 #endif //TMC2130_SG_HOMING if(_endstop & _old_endstop & _BV(Z_AXIS)) { 24994: 94 70 andi r25, 0x04 ; 4 24996: 98 23 and r25, r24 24998: 69 f0 breq .+26 ; 0x249b4 <__vector_17+0x4e0> #ifdef VERBOSE_CHECK_HIT_ENDSTOPS endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; #endif //VERBOSE_CHECK_HIT_ENDSTOPS _endstop_hit |= _BV(Z_AXIS); 2499a: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 2499c: 40 89 ldd r20, Z+16 ; 0x10 2499e: 51 89 ldd r21, Z+17 ; 0x11 249a0: 62 89 ldd r22, Z+18 ; 0x12 249a2: 73 89 ldd r23, Z+19 ; 0x13 249a4: 40 93 c0 05 sts 0x05C0, r20 ; 0x8005c0 249a8: 50 93 c1 05 sts 0x05C1, r21 ; 0x8005c1 249ac: 60 93 c2 05 sts 0x05C2, r22 ; 0x8005c2 249b0: 70 93 c3 05 sts 0x05C3, r23 ; 0x8005c3 } endstop = _endstop; 249b4: 80 93 be 05 sts 0x05BE, r24 ; 0x8005be old_endstop = _endstop; //apply current endstop state to the old endstop 249b8: 80 93 bd 05 sts 0x05BD, r24 ; 0x8005bd endstop_hit = _endstop_hit; 249bc: 20 93 2c 04 sts 0x042C, r18 ; 0x80042c <_ZL11endstop_hit.lto_priv.439> stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 249c0: 85 a9 ldd r24, Z+53 ; 0x35 } FORCE_INLINE void stepper_tick_lowres() { for (uint8_t i=0; i < step_loops; ++ i) { // Take multiple steps per interrupt (For high speed moves) 249c2: c0 e0 ldi r28, 0x00 ; 0 stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 249c4: 83 ff sbrs r24, 3 249c6: 50 c1 rjmp .+672 ; 0x24c68 <__vector_17+0x794> } FORCE_INLINE void stepper_tick_lowres() { for (uint8_t i=0; i < step_loops; ++ i) { // Take multiple steps per interrupt (For high speed moves) 249c8: 80 91 dd 05 lds r24, 0x05DD ; 0x8005dd 249cc: c8 17 cp r28, r24 249ce: 08 f0 brcs .+2 ; 0x249d2 <__vector_17+0x4fe> 249d0: bd c2 rjmp .+1402 ; 0x24f4c <__vector_17+0xa78> MSerial.checkRx(); // Check for serial chars. 249d2: 0e 94 b5 fb call 0x1f76a ; 0x1f76a // Step in X axis counter[X_AXIS].lo += current_block->steps[X_AXIS].lo; 249d6: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 249da: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 249de: 80 81 ld r24, Z 249e0: 91 81 ldd r25, Z+1 ; 0x01 249e2: 20 91 c5 05 lds r18, 0x05C5 ; 0x8005c5 249e6: 30 91 c6 05 lds r19, 0x05C6 ; 0x8005c6 249ea: 82 0f add r24, r18 249ec: 93 1f adc r25, r19 249ee: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 249f2: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 if (counter[X_AXIS].lo > 0) { 249f6: 18 16 cp r1, r24 249f8: 19 06 cpc r1, r25 249fa: 6c f5 brge .+90 ; 0x24a56 <__vector_17+0x582> STEP_NC_HI(X_AXIS); 249fc: 40 9a sbi 0x08, 0 ; 8 #ifdef DEBUG_XSTEP_DUP_PIN STEP_NC_HI(X_DUP_AXIS); #endif //DEBUG_XSTEP_DUP_PIN counter[X_AXIS].lo -= current_block->step_event_count.lo; 249fe: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24a02: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24a06: 80 91 c5 05 lds r24, 0x05C5 ; 0x8005c5 24a0a: 90 91 c6 05 lds r25, 0x05C6 ; 0x8005c6 24a0e: 20 89 ldd r18, Z+16 ; 0x10 24a10: 31 89 ldd r19, Z+17 ; 0x11 24a12: 82 1b sub r24, r18 24a14: 93 0b sbc r25, r19 24a16: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 24a1a: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 count_position[X_AXIS]+=count_direction[X_AXIS]; 24a1e: 90 91 5d 02 lds r25, 0x025D ; 0x80025d 24a22: 40 91 b6 06 lds r20, 0x06B6 ; 0x8006b6 24a26: 50 91 b7 06 lds r21, 0x06B7 ; 0x8006b7 24a2a: 60 91 b8 06 lds r22, 0x06B8 ; 0x8006b8 24a2e: 70 91 b9 06 lds r23, 0x06B9 ; 0x8006b9 24a32: 89 2f mov r24, r25 24a34: 99 0f add r25, r25 24a36: 99 0b sbc r25, r25 24a38: aa 0b sbc r26, r26 24a3a: bb 0b sbc r27, r27 24a3c: 84 0f add r24, r20 24a3e: 95 1f adc r25, r21 24a40: a6 1f adc r26, r22 24a42: b7 1f adc r27, r23 24a44: 80 93 b6 06 sts 0x06B6, r24 ; 0x8006b6 24a48: 90 93 b7 06 sts 0x06B7, r25 ; 0x8006b7 24a4c: a0 93 b8 06 sts 0x06B8, r26 ; 0x8006b8 24a50: b0 93 b9 06 sts 0x06B9, r27 ; 0x8006b9 STEP_NC_LO(X_AXIS); 24a54: 40 98 cbi 0x08, 0 ; 8 #ifdef DEBUG_XSTEP_DUP_PIN STEP_NC_LO(X_DUP_AXIS); #endif //DEBUG_XSTEP_DUP_PIN } // Step in Y axis counter[Y_AXIS].lo += current_block->steps[Y_AXIS].lo; 24a56: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24a5a: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24a5e: 84 81 ldd r24, Z+4 ; 0x04 24a60: 95 81 ldd r25, Z+5 ; 0x05 24a62: 20 91 c9 05 lds r18, 0x05C9 ; 0x8005c9 24a66: 30 91 ca 05 lds r19, 0x05CA ; 0x8005ca 24a6a: 82 0f add r24, r18 24a6c: 93 1f adc r25, r19 24a6e: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 24a72: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 if (counter[Y_AXIS].lo > 0) { 24a76: 18 16 cp r1, r24 24a78: 19 06 cpc r1, r25 24a7a: 4c f5 brge .+82 ; 0x24ace <__vector_17+0x5fa> STEP_NC_HI(Y_AXIS); 24a7c: 41 9a sbi 0x08, 1 ; 8 #ifdef DEBUG_YSTEP_DUP_PIN STEP_NC_HI(Y_DUP_AXIS); #endif //DEBUG_YSTEP_DUP_PIN counter[Y_AXIS].lo -= current_block->step_event_count.lo; 24a7e: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24a82: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24a86: 20 89 ldd r18, Z+16 ; 0x10 24a88: 31 89 ldd r19, Z+17 ; 0x11 24a8a: 82 1b sub r24, r18 24a8c: 93 0b sbc r25, r19 24a8e: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 24a92: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 24a96: 90 91 5e 02 lds r25, 0x025E ; 0x80025e 24a9a: 40 91 ba 06 lds r20, 0x06BA ; 0x8006ba 24a9e: 50 91 bb 06 lds r21, 0x06BB ; 0x8006bb 24aa2: 60 91 bc 06 lds r22, 0x06BC ; 0x8006bc 24aa6: 70 91 bd 06 lds r23, 0x06BD ; 0x8006bd 24aaa: 89 2f mov r24, r25 24aac: 99 0f add r25, r25 24aae: 99 0b sbc r25, r25 24ab0: aa 0b sbc r26, r26 24ab2: bb 0b sbc r27, r27 24ab4: 84 0f add r24, r20 24ab6: 95 1f adc r25, r21 24ab8: a6 1f adc r26, r22 24aba: b7 1f adc r27, r23 24abc: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 24ac0: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb 24ac4: a0 93 bc 06 sts 0x06BC, r26 ; 0x8006bc 24ac8: b0 93 bd 06 sts 0x06BD, r27 ; 0x8006bd STEP_NC_LO(Y_AXIS); 24acc: 41 98 cbi 0x08, 1 ; 8 #ifdef DEBUG_YSTEP_DUP_PIN STEP_NC_LO(Y_DUP_AXIS); #endif //DEBUG_YSTEP_DUP_PIN } // Step in Z axis counter[Z_AXIS].lo += current_block->steps[Z_AXIS].lo; 24ace: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24ad2: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24ad6: 80 85 ldd r24, Z+8 ; 0x08 24ad8: 91 85 ldd r25, Z+9 ; 0x09 24ada: 20 91 cd 05 lds r18, 0x05CD ; 0x8005cd 24ade: 30 91 ce 05 lds r19, 0x05CE ; 0x8005ce 24ae2: 82 0f add r24, r18 24ae4: 93 1f adc r25, r19 24ae6: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 24aea: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd if (counter[Z_AXIS].lo > 0) { 24aee: 18 16 cp r1, r24 24af0: 19 06 cpc r1, r25 24af2: 4c f5 brge .+82 ; 0x24b46 <__vector_17+0x672> STEP_NC_HI(Z_AXIS); 24af4: 42 9a sbi 0x08, 2 ; 8 counter[Z_AXIS].lo -= current_block->step_event_count.lo; 24af6: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24afa: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24afe: 20 89 ldd r18, Z+16 ; 0x10 24b00: 31 89 ldd r19, Z+17 ; 0x11 24b02: 82 1b sub r24, r18 24b04: 93 0b sbc r25, r19 24b06: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 24b0a: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd count_position[Z_AXIS]+=count_direction[Z_AXIS]; 24b0e: 90 91 5f 02 lds r25, 0x025F ; 0x80025f 24b12: 40 91 be 06 lds r20, 0x06BE ; 0x8006be 24b16: 50 91 bf 06 lds r21, 0x06BF ; 0x8006bf 24b1a: 60 91 c0 06 lds r22, 0x06C0 ; 0x8006c0 24b1e: 70 91 c1 06 lds r23, 0x06C1 ; 0x8006c1 24b22: 89 2f mov r24, r25 24b24: 99 0f add r25, r25 24b26: 99 0b sbc r25, r25 24b28: aa 0b sbc r26, r26 24b2a: bb 0b sbc r27, r27 24b2c: 84 0f add r24, r20 24b2e: 95 1f adc r25, r21 24b30: a6 1f adc r26, r22 24b32: b7 1f adc r27, r23 24b34: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 24b38: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 24b3c: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 24b40: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 STEP_NC_LO(Z_AXIS); 24b44: 42 98 cbi 0x08, 2 ; 8 } // Step in E axis counter[E_AXIS].lo += current_block->steps[E_AXIS].lo; 24b46: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24b4a: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24b4e: 80 91 d1 05 lds r24, 0x05D1 ; 0x8005d1 24b52: 90 91 d2 05 lds r25, 0x05D2 ; 0x8005d2 24b56: 24 85 ldd r18, Z+12 ; 0x0c 24b58: 35 85 ldd r19, Z+13 ; 0x0d 24b5a: 82 0f add r24, r18 24b5c: 93 1f adc r25, r19 24b5e: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 24b62: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 24b66: 20 89 ldd r18, Z+16 ; 0x10 24b68: 31 89 ldd r19, Z+17 ; 0x11 if (counter[E_AXIS].lo > 0) { 24b6a: 18 16 cp r1, r24 24b6c: 19 06 cpc r1, r25 24b6e: 44 f5 brge .+80 ; 0x24bc0 <__vector_17+0x6ec> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].lo -= current_block->step_event_count.lo; 24b70: 82 1b sub r24, r18 24b72: 93 0b sbc r25, r19 24b74: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 24b78: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 count_position[E_AXIS] += count_direction[E_AXIS]; 24b7c: 90 91 60 02 lds r25, 0x0260 ; 0x800260 24b80: 40 91 c2 06 lds r20, 0x06C2 ; 0x8006c2 24b84: 50 91 c3 06 lds r21, 0x06C3 ; 0x8006c3 24b88: 60 91 c4 06 lds r22, 0x06C4 ; 0x8006c4 24b8c: 70 91 c5 06 lds r23, 0x06C5 ; 0x8006c5 24b90: 89 2f mov r24, r25 24b92: 99 0f add r25, r25 24b94: 99 0b sbc r25, r25 24b96: aa 0b sbc r26, r26 24b98: bb 0b sbc r27, r27 24b9a: 84 0f add r24, r20 24b9c: 95 1f adc r25, r21 24b9e: a6 1f adc r26, r22 24ba0: b7 1f adc r27, r23 24ba2: 80 93 c2 06 sts 0x06C2, r24 ; 0x8006c2 24ba6: 90 93 c3 06 sts 0x06C3, r25 ; 0x8006c3 24baa: a0 93 c4 06 sts 0x06C4, r26 ; 0x8006c4 24bae: b0 93 c5 06 sts 0x06C5, r27 ; 0x8006c5 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 24bb2: 90 91 60 02 lds r25, 0x0260 ; 0x800260 24bb6: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 24bba: 89 0f add r24, r25 24bbc: 80 93 d6 05 sts 0x05D6, r24 ; 0x8005d6 fsensor.stStep(count_direction[E_AXIS] < 0); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) STEP_NC_LO(E_AXIS); #endif } if(++ step_events_completed.lo >= current_block->step_event_count.lo) 24bc0: 80 91 c0 05 lds r24, 0x05C0 ; 0x8005c0 24bc4: 90 91 c1 05 lds r25, 0x05C1 ; 0x8005c1 24bc8: 01 96 adiw r24, 0x01 ; 1 24bca: 90 93 c1 05 sts 0x05C1, r25 ; 0x8005c1 24bce: 80 93 c0 05 sts 0x05C0, r24 ; 0x8005c0 24bd2: 82 17 cp r24, r18 24bd4: 93 07 cpc r25, r19 24bd6: 08 f0 brcs .+2 ; 0x24bda <__vector_17+0x706> 24bd8: b9 c1 rjmp .+882 ; 0x24f4c <__vector_17+0xa78> } FORCE_INLINE void stepper_tick_lowres() { for (uint8_t i=0; i < step_loops; ++ i) { // Take multiple steps per interrupt (For high speed moves) 24bda: cf 5f subi r28, 0xFF ; 255 24bdc: f5 ce rjmp .-534 ; 0x249c8 <__vector_17+0x4f4> // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY) if((out_bits & (1< 24be2: 82 60 ori r24, 0x02 ; 2 24be4: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=1; 24be8: 81 e0 ldi r24, 0x01 ; 1 24bea: 2e ce rjmp .-932 ; 0x24848 <__vector_17+0x374> } if((out_bits & (1< 24bf0: 81 60 ori r24, 0x01 ; 1 24bf2: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=1; 24bf6: 81 e0 ldi r24, 0x01 ; 1 24bf8: 33 ce rjmp .-922 ; 0x24860 <__vector_17+0x38c> } if ((out_bits & (1< 24bfe: 84 60 ori r24, 0x04 ; 4 24c00: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=1; 24c04: 81 e0 ldi r24, 0x01 ; 1 24c06: 38 ce rjmp .-912 ; 0x24878 <__vector_17+0x3a4> count_direction[E_AXIS] = -1; } else { // +direction #ifndef LIN_ADVANCE WRITE(E0_DIR_PIN, !INVERT_E0_DIR); #endif /* LIN_ADVANCE */ count_direction[E_AXIS] = 1; 24c08: 81 e0 ldi r24, 0x01 ; 1 24c0a: 3d ce rjmp .-902 ; 0x24886 <__vector_17+0x3b2> } } else { _NEXT_ISR(2000); // 1kHz. 24c0c: 80 ed ldi r24, 0xD0 ; 208 24c0e: 97 e0 ldi r25, 0x07 ; 7 24c10: 90 93 1d 04 sts 0x041D, r25 ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 24c14: 80 93 1c 04 sts 0x041C, r24 ; 0x80041c <_ZL11nextMainISR.lto_priv.435> 24c18: 90 93 19 04 sts 0x0419, r25 ; 0x800419 <_ZL9main_Rate.lto_priv.437+0x1> 24c1c: 80 93 18 04 sts 0x0418, r24 ; 0x800418 <_ZL9main_Rate.lto_priv.437> #ifdef LIN_ADVANCE // reset LA state when there's no block nextAdvanceISR = ADV_NEVER; 24c20: 8f ef ldi r24, 0xFF ; 255 24c22: 9f ef ldi r25, 0xFF ; 255 24c24: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 24c28: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> e_steps = 0; 24c2c: 10 92 d6 05 sts 0x05D6, r1 ; 0x8005d6 // incrementally lose pressure to give a chance for // a new LA block to be scheduled and recover if(current_adv_steps) 24c30: 80 91 16 04 lds r24, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> 24c34: 90 91 17 04 lds r25, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 24c38: 00 97 sbiw r24, 0x00 ; 0 24c3a: 09 f4 brne .+2 ; 0x24c3e <__vector_17+0x76a> 24c3c: 26 ce rjmp .-948 ; 0x2488a <__vector_17+0x3b6> --current_adv_steps; 24c3e: 01 97 sbiw r24, 0x01 ; 1 24c40: 90 93 17 04 sts 0x0417, r25 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 24c44: 80 93 16 04 sts 0x0416, r24 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> 24c48: 20 ce rjmp .-960 ; 0x2488a <__vector_17+0x3b6> #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, X_AXIS, (!READ(X_TMC2130_DIAG))); #else // Normal homing SET_BIT_TO(_endstop, X_AXIS, (READ(X_MIN_PIN) != X_MIN_ENDSTOP_INVERTING)); 24c4a: 8e 7f andi r24, 0xFE ; 254 24c4c: 39 ce rjmp .-910 ; 0x248c0 <__vector_17+0x3ec> #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, Y_AXIS, (!READ(Y_TMC2130_DIAG))); #else // Normal homing SET_BIT_TO(_endstop, Y_AXIS, (READ(Y_MIN_PIN) != Y_MIN_ENDSTOP_INVERTING)); 24c4e: 8d 7f andi r24, 0xFD ; 253 24c50: 56 ce rjmp .-852 ; 0x248fe <__vector_17+0x42a> SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); else #endif //TMC2130_STEALTH_Z SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING) || (!READ(Z_TMC2130_DIAG))); #else SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 24c52: 8b 7f andi r24, 0xFB ; 251 24c54: 75 ce rjmp .-790 ; 0x24940 <__vector_17+0x46c> SET_BIT_TO(_endstop, Z_AXIS + 4, 0); else #endif //TMC2130_STEALTH_Z SET_BIT_TO(_endstop, Z_AXIS + 4, (!READ(Z_TMC2130_DIAG))); #else SET_BIT_TO(_endstop, Z_AXIS + 4, (READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING)); 24c56: 01 99 sbic 0x00, 1 ; 0 24c58: 03 c0 rjmp .+6 ; 0x24c60 <__vector_17+0x78c> 24c5a: 80 64 ori r24, 0x40 ; 64 #endif //TMC2130_SG_HOMING if((_endstop & _old_endstop & _BV(Z_AXIS + 4)) && (current_block->steps[Z_AXIS].wide > 0)) { 24c5c: 90 74 andi r25, 0x40 ; 64 24c5e: 71 ce rjmp .-798 ; 0x24942 <__vector_17+0x46e> SET_BIT_TO(_endstop, Z_AXIS + 4, 0); else #endif //TMC2130_STEALTH_Z SET_BIT_TO(_endstop, Z_AXIS + 4, (!READ(Z_TMC2130_DIAG))); #else SET_BIT_TO(_endstop, Z_AXIS + 4, (READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING)); 24c60: 8f 7b andi r24, 0xBF ; 191 24c62: fc cf rjmp .-8 ; 0x24c5c <__vector_17+0x788> SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); else #endif //TMC2130_STEALTH_Z SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING) || (!READ(Z_TMC2130_DIAG))); #else SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 24c64: 8b 7f andi r24, 0xFB ; 251 24c66: 96 ce rjmp .-724 ; 0x24994 <__vector_17+0x4c0> } } FORCE_INLINE void stepper_tick_highres() { for (uint8_t i=0; i < step_loops; ++ i) { // Take multiple steps per interrupt (For high speed moves) 24c68: 80 91 dd 05 lds r24, 0x05DD ; 0x8005dd 24c6c: c8 17 cp r28, r24 24c6e: 08 f0 brcs .+2 ; 0x24c72 <__vector_17+0x79e> 24c70: 6d c1 rjmp .+730 ; 0x24f4c <__vector_17+0xa78> MSerial.checkRx(); // Check for serial chars. 24c72: 0e 94 b5 fb call 0x1f76a ; 0x1f76a // Step in X axis counter[X_AXIS].wide += current_block->steps[X_AXIS].wide; 24c76: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24c7a: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24c7e: 80 81 ld r24, Z 24c80: 91 81 ldd r25, Z+1 ; 0x01 24c82: a2 81 ldd r26, Z+2 ; 0x02 24c84: b3 81 ldd r27, Z+3 ; 0x03 24c86: 40 91 c5 05 lds r20, 0x05C5 ; 0x8005c5 24c8a: 50 91 c6 05 lds r21, 0x05C6 ; 0x8005c6 24c8e: 60 91 c7 05 lds r22, 0x05C7 ; 0x8005c7 24c92: 70 91 c8 05 lds r23, 0x05C8 ; 0x8005c8 24c96: 84 0f add r24, r20 24c98: 95 1f adc r25, r21 24c9a: a6 1f adc r26, r22 24c9c: b7 1f adc r27, r23 24c9e: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 24ca2: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 24ca6: a0 93 c7 05 sts 0x05C7, r26 ; 0x8005c7 24caa: b0 93 c8 05 sts 0x05C8, r27 ; 0x8005c8 if (counter[X_AXIS].wide > 0) { 24cae: 18 16 cp r1, r24 24cb0: 19 06 cpc r1, r25 24cb2: 1a 06 cpc r1, r26 24cb4: 1b 06 cpc r1, r27 24cb6: cc f5 brge .+114 ; 0x24d2a <__vector_17+0x856> STEP_NC_HI(X_AXIS); 24cb8: 40 9a sbi 0x08, 0 ; 8 #ifdef DEBUG_XSTEP_DUP_PIN STEP_NC_HI(X_DUP_AXIS); #endif //DEBUG_XSTEP_DUP_PIN counter[X_AXIS].wide -= current_block->step_event_count.wide; 24cba: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24cbe: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24cc2: 80 91 c5 05 lds r24, 0x05C5 ; 0x8005c5 24cc6: 90 91 c6 05 lds r25, 0x05C6 ; 0x8005c6 24cca: a0 91 c7 05 lds r26, 0x05C7 ; 0x8005c7 24cce: b0 91 c8 05 lds r27, 0x05C8 ; 0x8005c8 24cd2: 40 89 ldd r20, Z+16 ; 0x10 24cd4: 51 89 ldd r21, Z+17 ; 0x11 24cd6: 62 89 ldd r22, Z+18 ; 0x12 24cd8: 73 89 ldd r23, Z+19 ; 0x13 24cda: 84 1b sub r24, r20 24cdc: 95 0b sbc r25, r21 24cde: a6 0b sbc r26, r22 24ce0: b7 0b sbc r27, r23 24ce2: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 24ce6: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 24cea: a0 93 c7 05 sts 0x05C7, r26 ; 0x8005c7 24cee: b0 93 c8 05 sts 0x05C8, r27 ; 0x8005c8 count_position[X_AXIS]+=count_direction[X_AXIS]; 24cf2: 90 91 5d 02 lds r25, 0x025D ; 0x80025d 24cf6: 40 91 b6 06 lds r20, 0x06B6 ; 0x8006b6 24cfa: 50 91 b7 06 lds r21, 0x06B7 ; 0x8006b7 24cfe: 60 91 b8 06 lds r22, 0x06B8 ; 0x8006b8 24d02: 70 91 b9 06 lds r23, 0x06B9 ; 0x8006b9 24d06: 89 2f mov r24, r25 24d08: 99 0f add r25, r25 24d0a: 99 0b sbc r25, r25 24d0c: aa 0b sbc r26, r26 24d0e: bb 0b sbc r27, r27 24d10: 84 0f add r24, r20 24d12: 95 1f adc r25, r21 24d14: a6 1f adc r26, r22 24d16: b7 1f adc r27, r23 24d18: 80 93 b6 06 sts 0x06B6, r24 ; 0x8006b6 24d1c: 90 93 b7 06 sts 0x06B7, r25 ; 0x8006b7 24d20: a0 93 b8 06 sts 0x06B8, r26 ; 0x8006b8 24d24: b0 93 b9 06 sts 0x06B9, r27 ; 0x8006b9 STEP_NC_LO(X_AXIS); 24d28: 40 98 cbi 0x08, 0 ; 8 #ifdef DEBUG_XSTEP_DUP_PIN STEP_NC_LO(X_DUP_AXIS); #endif //DEBUG_XSTEP_DUP_PIN } // Step in Y axis counter[Y_AXIS].wide += current_block->steps[Y_AXIS].wide; 24d2a: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24d2e: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24d32: 84 81 ldd r24, Z+4 ; 0x04 24d34: 95 81 ldd r25, Z+5 ; 0x05 24d36: a6 81 ldd r26, Z+6 ; 0x06 24d38: b7 81 ldd r27, Z+7 ; 0x07 24d3a: 40 91 c9 05 lds r20, 0x05C9 ; 0x8005c9 24d3e: 50 91 ca 05 lds r21, 0x05CA ; 0x8005ca 24d42: 60 91 cb 05 lds r22, 0x05CB ; 0x8005cb 24d46: 70 91 cc 05 lds r23, 0x05CC ; 0x8005cc 24d4a: 84 0f add r24, r20 24d4c: 95 1f adc r25, r21 24d4e: a6 1f adc r26, r22 24d50: b7 1f adc r27, r23 24d52: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 24d56: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 24d5a: a0 93 cb 05 sts 0x05CB, r26 ; 0x8005cb 24d5e: b0 93 cc 05 sts 0x05CC, r27 ; 0x8005cc if (counter[Y_AXIS].wide > 0) { 24d62: 18 16 cp r1, r24 24d64: 19 06 cpc r1, r25 24d66: 1a 06 cpc r1, r26 24d68: 1b 06 cpc r1, r27 24d6a: 8c f5 brge .+98 ; 0x24dce <__vector_17+0x8fa> STEP_NC_HI(Y_AXIS); 24d6c: 41 9a sbi 0x08, 1 ; 8 #ifdef DEBUG_YSTEP_DUP_PIN STEP_NC_HI(Y_DUP_AXIS); #endif //DEBUG_YSTEP_DUP_PIN counter[Y_AXIS].wide -= current_block->step_event_count.wide; 24d6e: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24d72: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24d76: 40 89 ldd r20, Z+16 ; 0x10 24d78: 51 89 ldd r21, Z+17 ; 0x11 24d7a: 62 89 ldd r22, Z+18 ; 0x12 24d7c: 73 89 ldd r23, Z+19 ; 0x13 24d7e: 84 1b sub r24, r20 24d80: 95 0b sbc r25, r21 24d82: a6 0b sbc r26, r22 24d84: b7 0b sbc r27, r23 24d86: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 24d8a: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 24d8e: a0 93 cb 05 sts 0x05CB, r26 ; 0x8005cb 24d92: b0 93 cc 05 sts 0x05CC, r27 ; 0x8005cc count_position[Y_AXIS]+=count_direction[Y_AXIS]; 24d96: 90 91 5e 02 lds r25, 0x025E ; 0x80025e 24d9a: 40 91 ba 06 lds r20, 0x06BA ; 0x8006ba 24d9e: 50 91 bb 06 lds r21, 0x06BB ; 0x8006bb 24da2: 60 91 bc 06 lds r22, 0x06BC ; 0x8006bc 24da6: 70 91 bd 06 lds r23, 0x06BD ; 0x8006bd 24daa: 89 2f mov r24, r25 24dac: 99 0f add r25, r25 24dae: 99 0b sbc r25, r25 24db0: aa 0b sbc r26, r26 24db2: bb 0b sbc r27, r27 24db4: 84 0f add r24, r20 24db6: 95 1f adc r25, r21 24db8: a6 1f adc r26, r22 24dba: b7 1f adc r27, r23 24dbc: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 24dc0: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb 24dc4: a0 93 bc 06 sts 0x06BC, r26 ; 0x8006bc 24dc8: b0 93 bd 06 sts 0x06BD, r27 ; 0x8006bd STEP_NC_LO(Y_AXIS); 24dcc: 41 98 cbi 0x08, 1 ; 8 #ifdef DEBUG_YSTEP_DUP_PIN STEP_NC_LO(Y_DUP_AXIS); #endif //DEBUG_YSTEP_DUP_PIN } // Step in Z axis counter[Z_AXIS].wide += current_block->steps[Z_AXIS].wide; 24dce: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24dd2: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24dd6: 80 85 ldd r24, Z+8 ; 0x08 24dd8: 91 85 ldd r25, Z+9 ; 0x09 24dda: a2 85 ldd r26, Z+10 ; 0x0a 24ddc: b3 85 ldd r27, Z+11 ; 0x0b 24dde: 40 91 cd 05 lds r20, 0x05CD ; 0x8005cd 24de2: 50 91 ce 05 lds r21, 0x05CE ; 0x8005ce 24de6: 60 91 cf 05 lds r22, 0x05CF ; 0x8005cf 24dea: 70 91 d0 05 lds r23, 0x05D0 ; 0x8005d0 24dee: 84 0f add r24, r20 24df0: 95 1f adc r25, r21 24df2: a6 1f adc r26, r22 24df4: b7 1f adc r27, r23 24df6: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd 24dfa: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 24dfe: a0 93 cf 05 sts 0x05CF, r26 ; 0x8005cf 24e02: b0 93 d0 05 sts 0x05D0, r27 ; 0x8005d0 if (counter[Z_AXIS].wide > 0) { 24e06: 18 16 cp r1, r24 24e08: 19 06 cpc r1, r25 24e0a: 1a 06 cpc r1, r26 24e0c: 1b 06 cpc r1, r27 24e0e: 8c f5 brge .+98 ; 0x24e72 <__vector_17+0x99e> STEP_NC_HI(Z_AXIS); 24e10: 42 9a sbi 0x08, 2 ; 8 counter[Z_AXIS].wide -= current_block->step_event_count.wide; 24e12: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24e16: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24e1a: 40 89 ldd r20, Z+16 ; 0x10 24e1c: 51 89 ldd r21, Z+17 ; 0x11 24e1e: 62 89 ldd r22, Z+18 ; 0x12 24e20: 73 89 ldd r23, Z+19 ; 0x13 24e22: 84 1b sub r24, r20 24e24: 95 0b sbc r25, r21 24e26: a6 0b sbc r26, r22 24e28: b7 0b sbc r27, r23 24e2a: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd 24e2e: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 24e32: a0 93 cf 05 sts 0x05CF, r26 ; 0x8005cf 24e36: b0 93 d0 05 sts 0x05D0, r27 ; 0x8005d0 count_position[Z_AXIS]+=count_direction[Z_AXIS]; 24e3a: 90 91 5f 02 lds r25, 0x025F ; 0x80025f 24e3e: 40 91 be 06 lds r20, 0x06BE ; 0x8006be 24e42: 50 91 bf 06 lds r21, 0x06BF ; 0x8006bf 24e46: 60 91 c0 06 lds r22, 0x06C0 ; 0x8006c0 24e4a: 70 91 c1 06 lds r23, 0x06C1 ; 0x8006c1 24e4e: 89 2f mov r24, r25 24e50: 99 0f add r25, r25 24e52: 99 0b sbc r25, r25 24e54: aa 0b sbc r26, r26 24e56: bb 0b sbc r27, r27 24e58: 84 0f add r24, r20 24e5a: 95 1f adc r25, r21 24e5c: a6 1f adc r26, r22 24e5e: b7 1f adc r27, r23 24e60: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 24e64: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 24e68: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 24e6c: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 STEP_NC_LO(Z_AXIS); 24e70: 42 98 cbi 0x08, 2 ; 8 } // Step in E axis counter[E_AXIS].wide += current_block->steps[E_AXIS].wide; 24e72: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24e76: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24e7a: 80 91 d1 05 lds r24, 0x05D1 ; 0x8005d1 24e7e: 90 91 d2 05 lds r25, 0x05D2 ; 0x8005d2 24e82: a0 91 d3 05 lds r26, 0x05D3 ; 0x8005d3 24e86: b0 91 d4 05 lds r27, 0x05D4 ; 0x8005d4 24e8a: 44 85 ldd r20, Z+12 ; 0x0c 24e8c: 55 85 ldd r21, Z+13 ; 0x0d 24e8e: 66 85 ldd r22, Z+14 ; 0x0e 24e90: 77 85 ldd r23, Z+15 ; 0x0f 24e92: 84 0f add r24, r20 24e94: 95 1f adc r25, r21 24e96: a6 1f adc r26, r22 24e98: b7 1f adc r27, r23 24e9a: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 24e9e: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 24ea2: a0 93 d3 05 sts 0x05D3, r26 ; 0x8005d3 24ea6: b0 93 d4 05 sts 0x05D4, r27 ; 0x8005d4 24eaa: 40 89 ldd r20, Z+16 ; 0x10 24eac: 51 89 ldd r21, Z+17 ; 0x11 24eae: 62 89 ldd r22, Z+18 ; 0x12 24eb0: 73 89 ldd r23, Z+19 ; 0x13 if (counter[E_AXIS].wide > 0) { 24eb2: 18 16 cp r1, r24 24eb4: 19 06 cpc r1, r25 24eb6: 1a 06 cpc r1, r26 24eb8: 1b 06 cpc r1, r27 24eba: 74 f5 brge .+92 ; 0x24f18 <__vector_17+0xa44> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].wide -= current_block->step_event_count.wide; 24ebc: 84 1b sub r24, r20 24ebe: 95 0b sbc r25, r21 24ec0: a6 0b sbc r26, r22 24ec2: b7 0b sbc r27, r23 24ec4: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 24ec8: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 24ecc: a0 93 d3 05 sts 0x05D3, r26 ; 0x8005d3 24ed0: b0 93 d4 05 sts 0x05D4, r27 ; 0x8005d4 count_position[E_AXIS] += count_direction[E_AXIS]; 24ed4: 90 91 60 02 lds r25, 0x0260 ; 0x800260 24ed8: c0 90 c2 06 lds r12, 0x06C2 ; 0x8006c2 24edc: d0 90 c3 06 lds r13, 0x06C3 ; 0x8006c3 24ee0: e0 90 c4 06 lds r14, 0x06C4 ; 0x8006c4 24ee4: f0 90 c5 06 lds r15, 0x06C5 ; 0x8006c5 24ee8: 89 2f mov r24, r25 24eea: 99 0f add r25, r25 24eec: 99 0b sbc r25, r25 24eee: aa 0b sbc r26, r26 24ef0: bb 0b sbc r27, r27 24ef2: 8c 0d add r24, r12 24ef4: 9d 1d adc r25, r13 24ef6: ae 1d adc r26, r14 24ef8: bf 1d adc r27, r15 24efa: 80 93 c2 06 sts 0x06C2, r24 ; 0x8006c2 24efe: 90 93 c3 06 sts 0x06C3, r25 ; 0x8006c3 24f02: a0 93 c4 06 sts 0x06C4, r26 ; 0x8006c4 24f06: b0 93 c5 06 sts 0x06C5, r27 ; 0x8006c5 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 24f0a: 90 91 60 02 lds r25, 0x0260 ; 0x800260 24f0e: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 24f12: 89 0f add r24, r25 24f14: 80 93 d6 05 sts 0x05D6, r24 ; 0x8005d6 fsensor.stStep(count_direction[E_AXIS] < 0); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) STEP_NC_LO(E_AXIS); #endif } if(++ step_events_completed.wide >= current_block->step_event_count.wide) 24f18: 80 91 c0 05 lds r24, 0x05C0 ; 0x8005c0 24f1c: 90 91 c1 05 lds r25, 0x05C1 ; 0x8005c1 24f20: a0 91 c2 05 lds r26, 0x05C2 ; 0x8005c2 24f24: b0 91 c3 05 lds r27, 0x05C3 ; 0x8005c3 24f28: 01 96 adiw r24, 0x01 ; 1 24f2a: a1 1d adc r26, r1 24f2c: b1 1d adc r27, r1 24f2e: 80 93 c0 05 sts 0x05C0, r24 ; 0x8005c0 24f32: 90 93 c1 05 sts 0x05C1, r25 ; 0x8005c1 24f36: a0 93 c2 05 sts 0x05C2, r26 ; 0x8005c2 24f3a: b0 93 c3 05 sts 0x05C3, r27 ; 0x8005c3 24f3e: 84 17 cp r24, r20 24f40: 95 07 cpc r25, r21 24f42: a6 07 cpc r26, r22 24f44: b7 07 cpc r27, r23 24f46: 10 f4 brcc .+4 ; 0x24f4c <__vector_17+0xa78> } } FORCE_INLINE void stepper_tick_highres() { for (uint8_t i=0; i < step_loops; ++ i) { // Take multiple steps per interrupt (For high speed moves) 24f48: cf 5f subi r28, 0xFF ; 255 24f4a: 8e ce rjmp .-740 ; 0x24c68 <__vector_17+0x794> else stepper_tick_highres(); #ifdef LIN_ADVANCE if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 24f4c: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 24f50: 88 23 and r24, r24 24f52: 39 f0 breq .+14 ; 0x24f62 <__vector_17+0xa8e> 24f54: 87 ff sbrs r24, 7 24f56: f2 c0 rjmp .+484 ; 0x2513c <__vector_17+0xc68> 24f58: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24f5c: 80 64 ori r24, 0x40 ; 64 24f5e: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> // Calculate new timer value // 13.38-14.63us for steady state, // 25.12us for acceleration / deceleration. { //WRITE_NC(LOGIC_ANALYZER_CH1, true); if (step_events_completed.wide <= current_block->accelerate_until) { 24f62: 40 91 c0 05 lds r20, 0x05C0 ; 0x8005c0 24f66: 50 91 c1 05 lds r21, 0x05C1 ; 0x8005c1 24f6a: 60 91 c2 05 lds r22, 0x05C2 ; 0x8005c2 24f6e: 70 91 c3 05 lds r23, 0x05C3 ; 0x8005c3 24f72: c0 91 e4 11 lds r28, 0x11E4 ; 0x8011e4 24f76: d0 91 e5 11 lds r29, 0x11E5 ; 0x8011e5 24f7a: 89 8d ldd r24, Y+25 ; 0x19 24f7c: 9a 8d ldd r25, Y+26 ; 0x1a 24f7e: ab 8d ldd r26, Y+27 ; 0x1b 24f80: bc 8d ldd r27, Y+28 ; 0x1c 24f82: 84 17 cp r24, r20 24f84: 95 07 cpc r25, r21 24f86: a6 07 cpc r26, r22 24f88: b7 07 cpc r27, r23 24f8a: 08 f4 brcc .+2 ; 0x24f8e <__vector_17+0xaba> 24f8c: 37 c1 rjmp .+622 ; 0x251fc <__vector_17+0xd28> // v = t * a -> acc_step_rate = acceleration_time * current_block->acceleration_rate acc_step_rate = MUL24x24R24(acceleration_time, current_block->acceleration_rate); 24f8e: c0 90 d9 05 lds r12, 0x05D9 ; 0x8005d9 24f92: d0 90 da 05 lds r13, 0x05DA ; 0x8005da 24f96: e0 90 db 05 lds r14, 0x05DB ; 0x8005db 24f9a: f0 90 dc 05 lds r15, 0x05DC ; 0x8005dc "adc %B0, r26 \n\t" "clr r1 \n\t" : "=&r" (out) : "r" (x), "r" (y) : "r0", "r1", "r26" , "r27" //clobbers: Technically these are either scratch registers or always 0 registers, but I'm making sure the compiler knows just in case. R26 is __zero_reg__, R27 is a temporary register. ); 24f9e: 2c 89 ldd r18, Y+20 ; 0x14 24fa0: 3d 89 ldd r19, Y+21 ; 0x15 24fa2: 4e 89 ldd r20, Y+22 ; 0x16 24fa4: aa 27 eor r26, r26 24fa6: c3 9e mul r12, r19 24fa8: b1 2d mov r27, r1 24faa: d4 9e mul r13, r20 24fac: c0 01 movw r24, r0 24fae: e4 9e mul r14, r20 24fb0: 90 0d add r25, r0 24fb2: e3 9e mul r14, r19 24fb4: 80 0d add r24, r0 24fb6: 91 1d adc r25, r1 24fb8: c4 9e mul r12, r20 24fba: b0 0d add r27, r0 24fbc: 81 1d adc r24, r1 24fbe: 9a 1f adc r25, r26 24fc0: d3 9e mul r13, r19 24fc2: b0 0d add r27, r0 24fc4: 81 1d adc r24, r1 24fc6: 9a 1f adc r25, r26 24fc8: e2 9e mul r14, r18 24fca: b0 0d add r27, r0 24fcc: 81 1d adc r24, r1 24fce: 9a 1f adc r25, r26 24fd0: d2 9e mul r13, r18 24fd2: b1 0d add r27, r1 24fd4: 8a 1f adc r24, r26 24fd6: 9a 1f adc r25, r26 24fd8: bb 0f add r27, r27 24fda: 8a 1f adc r24, r26 24fdc: 9a 1f adc r25, r26 24fde: 11 24 eor r1, r1 acc_step_rate += uint16_t(current_block->initial_rate); 24fe0: 2a ad ldd r18, Y+58 ; 0x3a 24fe2: 3b ad ldd r19, Y+59 ; 0x3b 24fe4: 82 0f add r24, r18 24fe6: 93 1f adc r25, r19 24fe8: 90 93 df 05 sts 0x05DF, r25 ; 0x8005df 24fec: 80 93 de 05 sts 0x05DE, r24 ; 0x8005de // upper limit if(acc_step_rate > uint16_t(current_block->nominal_rate)) 24ff0: 2e a9 ldd r18, Y+54 ; 0x36 24ff2: 3f a9 ldd r19, Y+55 ; 0x37 24ff4: 28 17 cp r18, r24 24ff6: 39 07 cpc r19, r25 24ff8: 20 f4 brcc .+8 ; 0x25002 <__vector_17+0xb2e> acc_step_rate = current_block->nominal_rate; 24ffa: 30 93 df 05 sts 0x05DF, r19 ; 0x8005df 24ffe: 20 93 de 05 sts 0x05DE, r18 ; 0x8005de // step_rate to timer interval uint16_t timer = calc_timer(acc_step_rate, step_loops); 25002: 80 91 de 05 lds r24, 0x05DE ; 0x8005de 25006: 90 91 df 05 lds r25, 0x05DF ; 0x8005df #endif //_NO_ASM FORCE_INLINE unsigned short calc_timer(uint16_t step_rate, uint8_t& step_loops) { uint16_t timer; if(step_rate > MAX_STEP_FREQUENCY) step_rate = MAX_STEP_FREQUENCY; 2500a: 81 34 cpi r24, 0x41 ; 65 2500c: bc e9 ldi r27, 0x9C ; 156 2500e: 9b 07 cpc r25, r27 25010: 08 f0 brcs .+2 ; 0x25014 <__vector_17+0xb40> 25012: 98 c0 rjmp .+304 ; 0x25144 <__vector_17+0xc70> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 25014: 81 32 cpi r24, 0x21 ; 33 25016: ee e4 ldi r30, 0x4E ; 78 25018: 9e 07 cpc r25, r30 2501a: 08 f4 brcc .+2 ; 0x2501e <__vector_17+0xb4a> 2501c: 96 c0 rjmp .+300 ; 0x2514a <__vector_17+0xc76> step_rate = (step_rate >> 2)&0x3fff; 2501e: 96 95 lsr r25 25020: 87 95 ror r24 25022: 96 95 lsr r25 25024: 87 95 ror r24 step_loops = 4; 25026: 24 e0 ldi r18, 0x04 ; 4 } else if(step_rate > 10000) { // If steprate > 10kHz >> step 2 times step_rate = (step_rate >> 1)&0x7fff; step_loops = 2; 25028: 20 93 dd 05 sts 0x05DD, r18 ; 0x8005dd else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2502c: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2502e: 81 15 cp r24, r1 25030: 28 e0 ldi r18, 0x08 ; 8 25032: 92 07 cpc r25, r18 25034: 08 f4 brcc .+2 ; 0x25038 <__vector_17+0xb64> 25036: 9b c0 rjmp .+310 ; 0x2516e <__vector_17+0xc9a> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 25038: e9 2f mov r30, r25 2503a: ff 27 eor r31, r31 2503c: ee 0f add r30, r30 2503e: ff 1f adc r31, r31 25040: ee 0f add r30, r30 25042: ff 1f adc r31, r31 25044: 9f 01 movw r18, r30 25046: 2a 52 subi r18, 0x2A ; 42 25048: 33 47 sbci r19, 0x73 ; 115 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 2504a: f9 01 movw r30, r18 2504c: 32 96 adiw r30, 0x02 ; 2 2504e: 45 91 lpm r20, Z+ 25050: 54 91 lpm r21, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 25052: f9 01 movw r30, r18 25054: 25 91 lpm r18, Z+ 25056: 34 91 lpm r19, Z "clr r1" "\n\t" //make r1 __zero_reg__ again "adc %B0, r1" "\n\t" //propagate carry of addition (add 0 with carry) : "=&r" (out) : "r" (x), "r" (y) : "r0", "r1" //clobbers: Technically these are either scratch registers or always 0 registers, but I'm making sure the compiler knows just in case. ); 25058: 58 9f mul r21, r24 2505a: b0 01 movw r22, r0 2505c: 48 9f mul r20, r24 2505e: 00 0c add r0, r0 25060: 61 1d adc r22, r1 25062: 11 24 eor r1, r1 25064: 71 1d adc r23, r1 step_rate -= (F_CPU/500000); // Correct for minimal speed if(step_rate >= (8*256)){ // higher step rate unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 25066: 26 1b sub r18, r22 25068: 37 0b sbc r19, r23 2506a: c9 01 movw r24, r18 2506c: 24 36 cpi r18, 0x64 ; 100 2506e: 31 05 cpc r19, r1 25070: 10 f4 brcc .+4 ; 0x25076 <__vector_17+0xba2> 25072: 84 e6 ldi r24, 0x64 ; 100 25074: 90 e0 ldi r25, 0x00 ; 0 _NEXT_ISR(timer); 25076: 90 93 1d 04 sts 0x041D, r25 ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 2507a: 80 93 1c 04 sts 0x041C, r24 ; 0x80041c <_ZL11nextMainISR.lto_priv.435> 2507e: 90 93 19 04 sts 0x0419, r25 ; 0x800419 <_ZL9main_Rate.lto_priv.437+0x1> 25082: 80 93 18 04 sts 0x0418, r24 ; 0x800418 <_ZL9main_Rate.lto_priv.437> acceleration_time += timer; 25086: c8 0e add r12, r24 25088: d9 1e adc r13, r25 2508a: e1 1c adc r14, r1 2508c: f1 1c adc r15, r1 2508e: c0 92 d9 05 sts 0x05D9, r12 ; 0x8005d9 25092: d0 92 da 05 sts 0x05DA, r13 ; 0x8005da 25096: e0 92 db 05 sts 0x05DB, r14 ; 0x8005db 2509a: f0 92 dc 05 sts 0x05DC, r15 ; 0x8005dc #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2509e: fe 01 movw r30, r28 250a0: e4 5b subi r30, 0xB4 ; 180 250a2: ff 4f sbci r31, 0xFF ; 255 250a4: 80 81 ld r24, Z 250a6: 81 11 cpse r24, r1 250a8: 80 c0 rjmp .+256 ; 0x251aa <__vector_17+0xcd6> stepper_tick_highres(); #ifdef LIN_ADVANCE if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); uint8_t la_state = 0; 250aa: 80 e0 ldi r24, 0x00 ; 0 //WRITE_NC(LOGIC_ANALYZER_CH1, false); } #ifdef LIN_ADVANCE // avoid multiple instances or function calls to advance_spread if (la_state & ADV_INIT) { 250ac: 80 ff sbrs r24, 0 250ae: 16 c0 rjmp .+44 ; 0x250dc <__vector_17+0xc08> LA_phase = -1; 250b0: 9f ef ldi r25, 0xFF ; 255 250b2: 90 93 d5 05 sts 0x05D5, r25 ; 0x8005d5 if (current_adv_steps == target_adv_steps) { 250b6: e0 91 16 04 lds r30, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> 250ba: f0 91 17 04 lds r31, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 250be: 20 91 d7 05 lds r18, 0x05D7 ; 0x8005d7 250c2: 30 91 d8 05 lds r19, 0x05D8 ; 0x8005d8 250c6: e2 17 cp r30, r18 250c8: f3 07 cpc r31, r19 250ca: 09 f0 breq .+2 ; 0x250ce <__vector_17+0xbfa> 250cc: 27 c2 rjmp .+1102 ; 0x2551c <__vector_17+0x1048> // nothing to be done in this phase, cancel any pending eisr la_state = 0; nextAdvanceISR = ADV_NEVER; 250ce: 8f ef ldi r24, 0xFF ; 255 250d0: 9f ef ldi r25, 0xFF ; 255 250d2: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 250d6: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> if (la_state & ADV_INIT) { LA_phase = -1; if (current_adv_steps == target_adv_steps) { // nothing to be done in this phase, cancel any pending eisr la_state = 0; 250da: 80 e0 ldi r24, 0x00 ; 0 eISR_Err += current_block->advance_rate; LA_phase = 0; } } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { 250dc: 80 fd sbrc r24, 0 250de: 07 c0 rjmp .+14 ; 0x250ee <__vector_17+0xc1a> 250e0: 80 91 1a 04 lds r24, 0x041A ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> 250e4: 90 91 1b 04 lds r25, 0x041B ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 250e8: 01 96 adiw r24, 0x01 ; 1 250ea: 09 f4 brne .+2 ; 0x250ee <__vector_17+0xc1a> 250ec: b7 c2 rjmp .+1390 ; 0x2565c <__vector_17+0x1188> // update timers & phase for the next iteration advance_spread(main_Rate); 250ee: e0 91 18 04 lds r30, 0x0418 ; 0x800418 <_ZL9main_Rate.lto_priv.437> 250f2: f0 91 19 04 lds r31, 0x0419 ; 0x800419 <_ZL9main_Rate.lto_priv.437+0x1> else return ((uint32_t)0xAAAB * q) >> 17; } FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; 250f6: 80 91 b6 05 lds r24, 0x05B6 ; 0x8005b6 250fa: 90 91 b7 05 lds r25, 0x05B7 ; 0x8005b7 250fe: a0 91 b8 05 lds r26, 0x05B8 ; 0x8005b8 25102: b0 91 b9 05 lds r27, 0x05B9 ; 0x8005b9 25106: 2c 01 movw r4, r24 25108: 3d 01 movw r6, r26 2510a: 4e 0e add r4, r30 2510c: 5f 1e adc r5, r31 2510e: 61 1c adc r6, r1 25110: 71 1c adc r7, r1 uint8_t ticks = 0; while(eISR_Err >= current_block->advance_rate) 25112: 9e 01 movw r18, r28 25114: 23 5b subi r18, 0xB3 ; 179 25116: 3f 4f sbci r19, 0xFF ; 255 25118: d9 01 movw r26, r18 2511a: cd 90 ld r12, X+ 2511c: dc 90 ld r13, X 2511e: f1 2c mov r15, r1 25120: e1 2c mov r14, r1 FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; uint8_t ticks = 0; 25122: 60 e0 ldi r22, 0x00 ; 0 while(eISR_Err >= current_block->advance_rate) 25124: 4c 14 cp r4, r12 25126: 5d 04 cpc r5, r13 25128: 6e 04 cpc r6, r14 2512a: 7f 04 cpc r7, r15 2512c: 08 f4 brcc .+2 ; 0x25130 <__vector_17+0xc5c> 2512e: 26 c2 rjmp .+1100 ; 0x2557c <__vector_17+0x10a8> { ++ticks; 25130: 6f 5f subi r22, 0xFF ; 255 eISR_Err -= current_block->advance_rate; 25132: 4c 18 sub r4, r12 25134: 5d 08 sbc r5, r13 25136: 6e 08 sbc r6, r14 25138: 7f 08 sbc r7, r15 2513a: f4 cf rjmp .-24 ; 0x25124 <__vector_17+0xc50> else stepper_tick_highres(); #ifdef LIN_ADVANCE if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 2513c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 25140: 8f 7b andi r24, 0xBF ; 191 25142: 0d cf rjmp .-486 ; 0x24f5e <__vector_17+0xa8a> #endif //_NO_ASM FORCE_INLINE unsigned short calc_timer(uint16_t step_rate, uint8_t& step_loops) { uint16_t timer; if(step_rate > MAX_STEP_FREQUENCY) step_rate = MAX_STEP_FREQUENCY; 25144: 80 e4 ldi r24, 0x40 ; 64 25146: 9c e9 ldi r25, 0x9C ; 156 25148: 6a cf rjmp .-300 ; 0x2501e <__vector_17+0xb4a> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times step_rate = (step_rate >> 2)&0x3fff; step_loops = 4; } else if(step_rate > 10000) { // If steprate > 10kHz >> step 2 times 2514a: 81 31 cpi r24, 0x11 ; 17 2514c: f7 e2 ldi r31, 0x27 ; 39 2514e: 9f 07 cpc r25, r31 25150: 20 f0 brcs .+8 ; 0x2515a <__vector_17+0xc86> step_rate = (step_rate >> 1)&0x7fff; 25152: 96 95 lsr r25 25154: 87 95 ror r24 step_loops = 2; 25156: 22 e0 ldi r18, 0x02 ; 2 25158: 67 cf rjmp .-306 ; 0x25028 <__vector_17+0xb54> } else { step_loops = 1; 2515a: 21 e0 ldi r18, 0x01 ; 1 2515c: 20 93 dd 05 sts 0x05DD, r18 ; 0x8005dd 25160: 80 32 cpi r24, 0x20 ; 32 25162: 91 05 cpc r25, r1 25164: 08 f0 brcs .+2 ; 0x25168 <__vector_17+0xc94> 25166: 62 cf rjmp .-316 ; 0x2502c <__vector_17+0xb58> 25168: 80 e2 ldi r24, 0x20 ; 32 2516a: 90 e0 ldi r25, 0x00 ; 0 2516c: 5f cf rjmp .-322 ; 0x2502c <__vector_17+0xb58> uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); } else { // lower step rates unsigned short table_address = (unsigned short)&speed_lookuptable_slow[0][0]; table_address += ((step_rate)>>1) & 0xfffc; 2516e: ac 01 movw r20, r24 25170: 56 95 lsr r21 25172: 47 95 ror r20 25174: 4c 7f andi r20, 0xFC ; 252 25176: 4a 52 subi r20, 0x2A ; 42 25178: 57 47 sbci r21, 0x77 ; 119 timer = (unsigned short)pgm_read_word_near(table_address); 2517a: fa 01 movw r30, r20 2517c: 25 91 lpm r18, Z+ 2517e: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 25180: fa 01 movw r30, r20 25182: 32 96 adiw r30, 0x02 ; 2 25184: 65 91 lpm r22, Z+ 25186: 74 91 lpm r23, Z 25188: 87 70 andi r24, 0x07 ; 7 2518a: 99 27 eor r25, r25 2518c: 86 9f mul r24, r22 2518e: a0 01 movw r20, r0 25190: 87 9f mul r24, r23 25192: 50 0d add r21, r0 25194: 96 9f mul r25, r22 25196: 50 0d add r21, r0 25198: 11 24 eor r1, r1 2519a: 73 e0 ldi r23, 0x03 ; 3 2519c: 56 95 lsr r21 2519e: 47 95 ror r20 251a0: 7a 95 dec r23 251a2: e1 f7 brne .-8 ; 0x2519c <__vector_17+0xcc8> 251a4: 24 1b sub r18, r20 251a6: 35 0b sbc r19, r21 251a8: 60 cf rjmp .-320 ; 0x2506a <__vector_17+0xb96> uint16_t timer = calc_timer(acc_step_rate, step_loops); _NEXT_ISR(timer); acceleration_time += timer; #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { if (step_events_completed.wide <= (unsigned long int)step_loops) { 251aa: 40 91 c0 05 lds r20, 0x05C0 ; 0x8005c0 251ae: 50 91 c1 05 lds r21, 0x05C1 ; 0x8005c1 251b2: 60 91 c2 05 lds r22, 0x05C2 ; 0x8005c2 251b6: 70 91 c3 05 lds r23, 0x05C3 ; 0x8005c3 251ba: 80 91 dd 05 lds r24, 0x05DD ; 0x8005dd 251be: 90 e0 ldi r25, 0x00 ; 0 251c0: b0 e0 ldi r27, 0x00 ; 0 251c2: a0 e0 ldi r26, 0x00 ; 0 251c4: 84 17 cp r24, r20 251c6: 95 07 cpc r25, r21 251c8: a6 07 cpc r26, r22 251ca: b7 07 cpc r27, r23 251cc: 08 f4 brcc .+2 ; 0x251d0 <__vector_17+0xcfc> 251ce: 6d cf rjmp .-294 ; 0x250aa <__vector_17+0xbd6> la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps > target_adv_steps) 251d0: 80 91 c4 05 lds r24, 0x05C4 ; 0x8005c4 251d4: 81 11 cpse r24, r1 251d6: 02 c0 rjmp .+4 ; 0x251dc <__vector_17+0xd08> _NEXT_ISR(timer); acceleration_time += timer; #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { if (step_events_completed.wide <= (unsigned long int)step_loops) { la_state = ADV_INIT | ADV_ACC_VARY; 251d8: 83 e0 ldi r24, 0x03 ; 3 251da: 68 cf rjmp .-304 ; 0x250ac <__vector_17+0xbd8> if (e_extruding && current_adv_steps > target_adv_steps) 251dc: 80 91 16 04 lds r24, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> 251e0: 90 91 17 04 lds r25, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 251e4: 20 91 d7 05 lds r18, 0x05D7 ; 0x8005d7 251e8: 30 91 d8 05 lds r19, 0x05D8 ; 0x8005d8 251ec: 28 17 cp r18, r24 251ee: 39 07 cpc r19, r25 251f0: 98 f7 brcc .-26 ; 0x251d8 <__vector_17+0xd04> target_adv_steps = current_adv_steps; 251f2: 90 93 d8 05 sts 0x05D8, r25 ; 0x8005d8 251f6: 80 93 d7 05 sts 0x05D7, r24 ; 0x8005d7 251fa: ee cf rjmp .-36 ; 0x251d8 <__vector_17+0xd04> } } #endif } else if (step_events_completed.wide > current_block->decelerate_after) { 251fc: 80 91 c0 05 lds r24, 0x05C0 ; 0x8005c0 25200: 90 91 c1 05 lds r25, 0x05C1 ; 0x8005c1 25204: a0 91 c2 05 lds r26, 0x05C2 ; 0x8005c2 25208: b0 91 c3 05 lds r27, 0x05C3 ; 0x8005c3 2520c: 4d 8d ldd r20, Y+29 ; 0x1d 2520e: 5e 8d ldd r21, Y+30 ; 0x1e 25210: 6f 8d ldd r22, Y+31 ; 0x1f 25212: 78 a1 ldd r23, Y+32 ; 0x20 25214: 48 17 cp r20, r24 25216: 59 07 cpc r21, r25 25218: 6a 07 cpc r22, r26 2521a: 7b 07 cpc r23, r27 2521c: 08 f0 brcs .+2 ; 0x25220 <__vector_17+0xd4c> 2521e: e3 c0 rjmp .+454 ; 0x253e6 <__vector_17+0xf12> uint16_t step_rate = MUL24x24R24(deceleration_time, current_block->acceleration_rate); 25220: c0 90 e1 05 lds r12, 0x05E1 ; 0x8005e1 25224: d0 90 e2 05 lds r13, 0x05E2 ; 0x8005e2 25228: e0 90 e3 05 lds r14, 0x05E3 ; 0x8005e3 2522c: f0 90 e4 05 lds r15, 0x05E4 ; 0x8005e4 "adc %B0, r26 \n\t" "clr r1 \n\t" : "=&r" (out) : "r" (x), "r" (y) : "r0", "r1", "r26" , "r27" //clobbers: Technically these are either scratch registers or always 0 registers, but I'm making sure the compiler knows just in case. R26 is __zero_reg__, R27 is a temporary register. ); 25230: 6c 88 ldd r6, Y+20 ; 0x14 25232: 7d 88 ldd r7, Y+21 ; 0x15 25234: 8e 88 ldd r8, Y+22 ; 0x16 25236: aa 27 eor r26, r26 25238: c7 9c mul r12, r7 2523a: b1 2d mov r27, r1 2523c: d8 9c mul r13, r8 2523e: f0 01 movw r30, r0 25240: e8 9c mul r14, r8 25242: f0 0d add r31, r0 25244: e7 9c mul r14, r7 25246: e0 0d add r30, r0 25248: f1 1d adc r31, r1 2524a: c8 9c mul r12, r8 2524c: b0 0d add r27, r0 2524e: e1 1d adc r30, r1 25250: fa 1f adc r31, r26 25252: d7 9c mul r13, r7 25254: b0 0d add r27, r0 25256: e1 1d adc r30, r1 25258: fa 1f adc r31, r26 2525a: e6 9c mul r14, r6 2525c: b0 0d add r27, r0 2525e: e1 1d adc r30, r1 25260: fa 1f adc r31, r26 25262: d6 9c mul r13, r6 25264: b1 0d add r27, r1 25266: ea 1f adc r30, r26 25268: fa 1f adc r31, r26 2526a: bb 0f add r27, r27 2526c: ea 1f adc r30, r26 2526e: fa 1f adc r31, r26 25270: 11 24 eor r1, r1 if (step_rate > acc_step_rate) { // Check step_rate stays positive 25272: 20 91 de 05 lds r18, 0x05DE ; 0x8005de 25276: 30 91 df 05 lds r19, 0x05DF ; 0x8005df 2527a: 8e ad ldd r24, Y+62 ; 0x3e 2527c: 9f ad ldd r25, Y+63 ; 0x3f 2527e: 2e 17 cp r18, r30 25280: 3f 07 cpc r19, r31 25282: 30 f0 brcs .+12 ; 0x25290 <__vector_17+0xdbc> step_rate = uint16_t(current_block->final_rate); } else { step_rate = acc_step_rate - step_rate; // Decelerate from acceleration end point. 25284: 2e 1b sub r18, r30 25286: 3f 0b sbc r19, r31 25288: 82 17 cp r24, r18 2528a: 93 07 cpc r25, r19 2528c: 08 f4 brcc .+2 ; 0x25290 <__vector_17+0xdbc> 2528e: c9 01 movw r24, r18 #endif //_NO_ASM FORCE_INLINE unsigned short calc_timer(uint16_t step_rate, uint8_t& step_loops) { uint16_t timer; if(step_rate > MAX_STEP_FREQUENCY) step_rate = MAX_STEP_FREQUENCY; 25290: 81 34 cpi r24, 0x41 ; 65 25292: ac e9 ldi r26, 0x9C ; 156 25294: 9a 07 cpc r25, r26 25296: 08 f0 brcs .+2 ; 0x2529a <__vector_17+0xdc6> 25298: 75 c0 rjmp .+234 ; 0x25384 <__vector_17+0xeb0> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2529a: 81 32 cpi r24, 0x21 ; 33 2529c: be e4 ldi r27, 0x4E ; 78 2529e: 9b 07 cpc r25, r27 252a0: 08 f4 brcc .+2 ; 0x252a4 <__vector_17+0xdd0> 252a2: 73 c0 rjmp .+230 ; 0x2538a <__vector_17+0xeb6> step_rate = (step_rate >> 2)&0x3fff; 252a4: 96 95 lsr r25 252a6: 87 95 ror r24 252a8: 96 95 lsr r25 252aa: 87 95 ror r24 step_loops = 4; 252ac: 24 e0 ldi r18, 0x04 ; 4 } else if(step_rate > 10000) { // If steprate > 10kHz >> step 2 times step_rate = (step_rate >> 1)&0x7fff; step_loops = 2; 252ae: 20 93 dd 05 sts 0x05DD, r18 ; 0x8005dd else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 252b2: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 252b4: 81 15 cp r24, r1 252b6: f8 e0 ldi r31, 0x08 ; 8 252b8: 9f 07 cpc r25, r31 252ba: 08 f4 brcc .+2 ; 0x252be <__vector_17+0xdea> 252bc: 78 c0 rjmp .+240 ; 0x253ae <__vector_17+0xeda> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 252be: e9 2f mov r30, r25 252c0: ff 27 eor r31, r31 252c2: ee 0f add r30, r30 252c4: ff 1f adc r31, r31 252c6: ee 0f add r30, r30 252c8: ff 1f adc r31, r31 252ca: 9f 01 movw r18, r30 252cc: 2a 52 subi r18, 0x2A ; 42 252ce: 33 47 sbci r19, 0x73 ; 115 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 252d0: f9 01 movw r30, r18 252d2: 32 96 adiw r30, 0x02 ; 2 252d4: a5 91 lpm r26, Z+ 252d6: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 252d8: f9 01 movw r30, r18 252da: 25 91 lpm r18, Z+ 252dc: 34 91 lpm r19, Z "clr r1" "\n\t" //make r1 __zero_reg__ again "adc %B0, r1" "\n\t" //propagate carry of addition (add 0 with carry) : "=&r" (out) : "r" (x), "r" (y) : "r0", "r1" //clobbers: Technically these are either scratch registers or always 0 registers, but I'm making sure the compiler knows just in case. ); 252de: b8 9f mul r27, r24 252e0: f0 01 movw r30, r0 252e2: a8 9f mul r26, r24 252e4: 00 0c add r0, r0 252e6: e1 1d adc r30, r1 252e8: 11 24 eor r1, r1 252ea: f1 1d adc r31, r1 } else { // lower step rates unsigned short table_address = (unsigned short)&speed_lookuptable_slow[0][0]; table_address += ((step_rate)>>1) & 0xfffc; timer = (unsigned short)pgm_read_word_near(table_address); timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 252ec: 2e 1b sub r18, r30 252ee: 3f 0b sbc r19, r31 252f0: c9 01 movw r24, r18 252f2: 24 36 cpi r18, 0x64 ; 100 252f4: 31 05 cpc r19, r1 252f6: 10 f4 brcc .+4 ; 0x252fc <__vector_17+0xe28> 252f8: 84 e6 ldi r24, 0x64 ; 100 252fa: 90 e0 ldi r25, 0x00 ; 0 step_rate = uint16_t(current_block->final_rate); } // Step_rate to timer interval. uint16_t timer = calc_timer(step_rate, step_loops); _NEXT_ISR(timer); 252fc: 90 93 1d 04 sts 0x041D, r25 ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 25300: 80 93 1c 04 sts 0x041C, r24 ; 0x80041c <_ZL11nextMainISR.lto_priv.435> 25304: 90 93 19 04 sts 0x0419, r25 ; 0x800419 <_ZL9main_Rate.lto_priv.437+0x1> 25308: 80 93 18 04 sts 0x0418, r24 ; 0x800418 <_ZL9main_Rate.lto_priv.437> deceleration_time += timer; 2530c: c8 0e add r12, r24 2530e: d9 1e adc r13, r25 25310: e1 1c adc r14, r1 25312: f1 1c adc r15, r1 25314: c0 92 e1 05 sts 0x05E1, r12 ; 0x8005e1 25318: d0 92 e2 05 sts 0x05E2, r13 ; 0x8005e2 2531c: e0 92 e3 05 sts 0x05E3, r14 ; 0x8005e3 25320: f0 92 e4 05 sts 0x05E4, r15 ; 0x8005e4 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 25324: fe 01 movw r30, r28 25326: e4 5b subi r30, 0xB4 ; 180 25328: ff 4f sbci r31, 0xFF ; 255 2532a: 80 81 ld r24, Z 2532c: 88 23 and r24, r24 2532e: 09 f4 brne .+2 ; 0x25332 <__vector_17+0xe5e> 25330: bc ce rjmp .-648 ; 0x250aa <__vector_17+0xbd6> if (step_events_completed.wide <= current_block->decelerate_after + step_loops) { 25332: 80 91 c0 05 lds r24, 0x05C0 ; 0x8005c0 25336: 90 91 c1 05 lds r25, 0x05C1 ; 0x8005c1 2533a: a0 91 c2 05 lds r26, 0x05C2 ; 0x8005c2 2533e: b0 91 c3 05 lds r27, 0x05C3 ; 0x8005c3 25342: 20 91 dd 05 lds r18, 0x05DD ; 0x8005dd 25346: 42 0f add r20, r18 25348: 51 1d adc r21, r1 2534a: 61 1d adc r22, r1 2534c: 71 1d adc r23, r1 2534e: 48 17 cp r20, r24 25350: 59 07 cpc r21, r25 25352: 6a 07 cpc r22, r26 25354: 7b 07 cpc r23, r27 25356: 08 f4 brcc .+2 ; 0x2535a <__vector_17+0xe86> 25358: a8 ce rjmp .-688 ; 0x250aa <__vector_17+0xbd6> target_adv_steps = current_block->final_adv_steps; 2535a: 35 96 adiw r30, 0x05 ; 5 2535c: 20 81 ld r18, Z 2535e: 31 81 ldd r19, Z+1 ; 0x01 25360: 30 93 d8 05 sts 0x05D8, r19 ; 0x8005d8 25364: 20 93 d7 05 sts 0x05D7, r18 ; 0x8005d7 la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps < target_adv_steps) 25368: 80 91 c4 05 lds r24, 0x05C4 ; 0x8005c4 2536c: 88 23 and r24, r24 2536e: 09 f4 brne .+2 ; 0x25372 <__vector_17+0xe9e> 25370: 33 cf rjmp .-410 ; 0x251d8 <__vector_17+0xd04> 25372: 80 91 16 04 lds r24, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> 25376: 90 91 17 04 lds r25, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 2537a: 82 17 cp r24, r18 2537c: 93 07 cpc r25, r19 2537e: 08 f0 brcs .+2 ; 0x25382 <__vector_17+0xeae> 25380: 2b cf rjmp .-426 ; 0x251d8 <__vector_17+0xd04> 25382: 37 cf rjmp .-402 ; 0x251f2 <__vector_17+0xd1e> #endif //_NO_ASM FORCE_INLINE unsigned short calc_timer(uint16_t step_rate, uint8_t& step_loops) { uint16_t timer; if(step_rate > MAX_STEP_FREQUENCY) step_rate = MAX_STEP_FREQUENCY; 25384: 80 e4 ldi r24, 0x40 ; 64 25386: 9c e9 ldi r25, 0x9C ; 156 25388: 8d cf rjmp .-230 ; 0x252a4 <__vector_17+0xdd0> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times step_rate = (step_rate >> 2)&0x3fff; step_loops = 4; } else if(step_rate > 10000) { // If steprate > 10kHz >> step 2 times 2538a: 81 31 cpi r24, 0x11 ; 17 2538c: e7 e2 ldi r30, 0x27 ; 39 2538e: 9e 07 cpc r25, r30 25390: 20 f0 brcs .+8 ; 0x2539a <__vector_17+0xec6> step_rate = (step_rate >> 1)&0x7fff; 25392: 96 95 lsr r25 25394: 87 95 ror r24 step_loops = 2; 25396: 22 e0 ldi r18, 0x02 ; 2 25398: 8a cf rjmp .-236 ; 0x252ae <__vector_17+0xdda> } else { step_loops = 1; 2539a: 21 e0 ldi r18, 0x01 ; 1 2539c: 20 93 dd 05 sts 0x05DD, r18 ; 0x8005dd 253a0: 80 32 cpi r24, 0x20 ; 32 253a2: 91 05 cpc r25, r1 253a4: 08 f0 brcs .+2 ; 0x253a8 <__vector_17+0xed4> 253a6: 85 cf rjmp .-246 ; 0x252b2 <__vector_17+0xdde> 253a8: 80 e2 ldi r24, 0x20 ; 32 253aa: 90 e0 ldi r25, 0x00 ; 0 253ac: 82 cf rjmp .-252 ; 0x252b2 <__vector_17+0xdde> uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); } else { // lower step rates unsigned short table_address = (unsigned short)&speed_lookuptable_slow[0][0]; table_address += ((step_rate)>>1) & 0xfffc; 253ae: dc 01 movw r26, r24 253b0: b6 95 lsr r27 253b2: a7 95 ror r26 253b4: ac 7f andi r26, 0xFC ; 252 253b6: aa 52 subi r26, 0x2A ; 42 253b8: b7 47 sbci r27, 0x77 ; 119 timer = (unsigned short)pgm_read_word_near(table_address); 253ba: fd 01 movw r30, r26 253bc: 25 91 lpm r18, Z+ 253be: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 253c0: fd 01 movw r30, r26 253c2: 32 96 adiw r30, 0x02 ; 2 253c4: a5 91 lpm r26, Z+ 253c6: b4 91 lpm r27, Z 253c8: 87 70 andi r24, 0x07 ; 7 253ca: 99 27 eor r25, r25 253cc: 8a 9f mul r24, r26 253ce: f0 01 movw r30, r0 253d0: 8b 9f mul r24, r27 253d2: f0 0d add r31, r0 253d4: 9a 9f mul r25, r26 253d6: f0 0d add r31, r0 253d8: 11 24 eor r1, r1 253da: a3 e0 ldi r26, 0x03 ; 3 253dc: f6 95 lsr r31 253de: e7 95 ror r30 253e0: aa 95 dec r26 253e2: e1 f7 brne .-8 ; 0x253dc <__vector_17+0xf08> 253e4: 83 cf rjmp .-250 ; 0x252ec <__vector_17+0xe18> } } #endif } else { if (! step_loops_nominal) { 253e6: 80 91 e0 05 lds r24, 0x05E0 ; 0x8005e0 253ea: 88 23 and r24, r24 253ec: 71 f0 breq .+28 ; 0x2540a <__vector_17+0xf36> stepper_tick_highres(); #ifdef LIN_ADVANCE if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); uint8_t la_state = 0; 253ee: 80 e0 ldi r24, 0x00 ; 0 if (e_extruding) target_adv_steps = current_adv_steps; } #endif } _NEXT_ISR(OCR1A_nominal); 253f0: 20 91 ba 05 lds r18, 0x05BA ; 0x8005ba 253f4: 30 91 bb 05 lds r19, 0x05BB ; 0x8005bb 253f8: 30 93 1d 04 sts 0x041D, r19 ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 253fc: 20 93 1c 04 sts 0x041C, r18 ; 0x80041c <_ZL11nextMainISR.lto_priv.435> 25400: 30 93 19 04 sts 0x0419, r19 ; 0x800419 <_ZL9main_Rate.lto_priv.437+0x1> 25404: 20 93 18 04 sts 0x0418, r18 ; 0x800418 <_ZL9main_Rate.lto_priv.437> 25408: 51 ce rjmp .-862 ; 0x250ac <__vector_17+0xbd8> } else { if (! step_loops_nominal) { // Calculation of the steady state timer rate has been delayed to the 1st tick of the steady state to lower // the initial interrupt blocking. OCR1A_nominal = calc_timer(uint16_t(current_block->nominal_rate), step_loops); 2540a: 8e a9 ldd r24, Y+54 ; 0x36 2540c: 9f a9 ldd r25, Y+55 ; 0x37 #endif //_NO_ASM FORCE_INLINE unsigned short calc_timer(uint16_t step_rate, uint8_t& step_loops) { uint16_t timer; if(step_rate > MAX_STEP_FREQUENCY) step_rate = MAX_STEP_FREQUENCY; 2540e: 81 34 cpi r24, 0x41 ; 65 25410: 2c e9 ldi r18, 0x9C ; 156 25412: 92 07 cpc r25, r18 25414: 08 f0 brcs .+2 ; 0x25418 <__vector_17+0xf44> 25416: 4e c0 rjmp .+156 ; 0x254b4 <__vector_17+0xfe0> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 25418: 81 32 cpi r24, 0x21 ; 33 2541a: 4e e4 ldi r20, 0x4E ; 78 2541c: 94 07 cpc r25, r20 2541e: 08 f4 brcc .+2 ; 0x25422 <__vector_17+0xf4e> 25420: 4c c0 rjmp .+152 ; 0x254ba <__vector_17+0xfe6> step_rate = (step_rate >> 2)&0x3fff; 25422: 96 95 lsr r25 25424: 87 95 ror r24 25426: 96 95 lsr r25 25428: 87 95 ror r24 step_loops = 4; 2542a: 24 e0 ldi r18, 0x04 ; 4 } else if(step_rate > 10000) { // If steprate > 10kHz >> step 2 times step_rate = (step_rate >> 1)&0x7fff; step_loops = 2; 2542c: 20 93 dd 05 sts 0x05DD, r18 ; 0x8005dd else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 25430: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 25432: 81 15 cp r24, r1 25434: a8 e0 ldi r26, 0x08 ; 8 25436: 9a 07 cpc r25, r26 25438: 08 f4 brcc .+2 ; 0x2543c <__vector_17+0xf68> 2543a: 51 c0 rjmp .+162 ; 0x254de <__vector_17+0x100a> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2543c: e9 2f mov r30, r25 2543e: ff 27 eor r31, r31 25440: ee 0f add r30, r30 25442: ff 1f adc r31, r31 25444: ee 0f add r30, r30 25446: ff 1f adc r31, r31 25448: 9f 01 movw r18, r30 2544a: 2a 52 subi r18, 0x2A ; 42 2544c: 33 47 sbci r19, 0x73 ; 115 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 2544e: f9 01 movw r30, r18 25450: 32 96 adiw r30, 0x02 ; 2 25452: 65 91 lpm r22, Z+ 25454: 74 91 lpm r23, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 25456: f9 01 movw r30, r18 25458: 25 91 lpm r18, Z+ 2545a: 34 91 lpm r19, Z "clr r1" "\n\t" //make r1 __zero_reg__ again "adc %B0, r1" "\n\t" //propagate carry of addition (add 0 with carry) : "=&r" (out) : "r" (x), "r" (y) : "r0", "r1" //clobbers: Technically these are either scratch registers or always 0 registers, but I'm making sure the compiler knows just in case. ); 2545c: 78 9f mul r23, r24 2545e: a0 01 movw r20, r0 25460: 68 9f mul r22, r24 25462: 00 0c add r0, r0 25464: 41 1d adc r20, r1 25466: 11 24 eor r1, r1 25468: 51 1d adc r21, r1 step_rate -= (F_CPU/500000); // Correct for minimal speed if(step_rate >= (8*256)){ // higher step rate unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2546a: c9 01 movw r24, r18 2546c: 84 1b sub r24, r20 2546e: 95 0b sbc r25, r21 25470: 84 36 cpi r24, 0x64 ; 100 25472: 91 05 cpc r25, r1 25474: 10 f4 brcc .+4 ; 0x2547a <__vector_17+0xfa6> 25476: 84 e6 ldi r24, 0x64 ; 100 25478: 90 e0 ldi r25, 0x00 ; 0 2547a: 90 93 bb 05 sts 0x05BB, r25 ; 0x8005bb 2547e: 80 93 ba 05 sts 0x05BA, r24 ; 0x8005ba step_loops_nominal = step_loops; 25482: 80 91 dd 05 lds r24, 0x05DD ; 0x8005dd 25486: 80 93 e0 05 sts 0x05E0, r24 ; 0x8005e0 #ifdef LIN_ADVANCE if(current_block->use_advance_lead) { 2548a: fe 01 movw r30, r28 2548c: e4 5b subi r30, 0xB4 ; 180 2548e: ff 4f sbci r31, 0xFF ; 255 25490: 80 81 ld r24, Z 25492: 88 23 and r24, r24 25494: 09 f4 brne .+2 ; 0x25498 <__vector_17+0xfc4> 25496: ab cf rjmp .-170 ; 0x253ee <__vector_17+0xf1a> // Due to E-jerk, there can be discontinuities in pressure state where an // acceleration or deceleration can be skipped or joined with the previous block. // If LA was not previously active, re-check the pressure level la_state = ADV_INIT; if (e_extruding) 25498: 80 91 c4 05 lds r24, 0x05C4 ; 0x8005c4 2549c: 88 23 and r24, r24 2549e: 41 f0 breq .+16 ; 0x254b0 <__vector_17+0xfdc> target_adv_steps = current_adv_steps; 254a0: 80 91 16 04 lds r24, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> 254a4: 90 91 17 04 lds r25, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 254a8: 90 93 d8 05 sts 0x05D8, r25 ; 0x8005d8 254ac: 80 93 d7 05 sts 0x05D7, r24 ; 0x8005d7 #ifdef LIN_ADVANCE if(current_block->use_advance_lead) { // Due to E-jerk, there can be discontinuities in pressure state where an // acceleration or deceleration can be skipped or joined with the previous block. // If LA was not previously active, re-check the pressure level la_state = ADV_INIT; 254b0: 81 e0 ldi r24, 0x01 ; 1 254b2: 9e cf rjmp .-196 ; 0x253f0 <__vector_17+0xf1c> #endif //_NO_ASM FORCE_INLINE unsigned short calc_timer(uint16_t step_rate, uint8_t& step_loops) { uint16_t timer; if(step_rate > MAX_STEP_FREQUENCY) step_rate = MAX_STEP_FREQUENCY; 254b4: 80 e4 ldi r24, 0x40 ; 64 254b6: 9c e9 ldi r25, 0x9C ; 156 254b8: b4 cf rjmp .-152 ; 0x25422 <__vector_17+0xf4e> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times step_rate = (step_rate >> 2)&0x3fff; step_loops = 4; } else if(step_rate > 10000) { // If steprate > 10kHz >> step 2 times 254ba: 81 31 cpi r24, 0x11 ; 17 254bc: 57 e2 ldi r21, 0x27 ; 39 254be: 95 07 cpc r25, r21 254c0: 20 f0 brcs .+8 ; 0x254ca <__vector_17+0xff6> step_rate = (step_rate >> 1)&0x7fff; 254c2: 96 95 lsr r25 254c4: 87 95 ror r24 step_loops = 2; 254c6: 22 e0 ldi r18, 0x02 ; 2 254c8: b1 cf rjmp .-158 ; 0x2542c <__vector_17+0xf58> } else { step_loops = 1; 254ca: 21 e0 ldi r18, 0x01 ; 1 254cc: 20 93 dd 05 sts 0x05DD, r18 ; 0x8005dd 254d0: 80 32 cpi r24, 0x20 ; 32 254d2: 91 05 cpc r25, r1 254d4: 08 f0 brcs .+2 ; 0x254d8 <__vector_17+0x1004> 254d6: ac cf rjmp .-168 ; 0x25430 <__vector_17+0xf5c> 254d8: 80 e2 ldi r24, 0x20 ; 32 254da: 90 e0 ldi r25, 0x00 ; 0 254dc: a9 cf rjmp .-174 ; 0x25430 <__vector_17+0xf5c> uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); } else { // lower step rates unsigned short table_address = (unsigned short)&speed_lookuptable_slow[0][0]; table_address += ((step_rate)>>1) & 0xfffc; 254de: 9c 01 movw r18, r24 254e0: 36 95 lsr r19 254e2: 27 95 ror r18 254e4: 2c 7f andi r18, 0xFC ; 252 254e6: 2a 52 subi r18, 0x2A ; 42 254e8: 37 47 sbci r19, 0x77 ; 119 timer = (unsigned short)pgm_read_word_near(table_address); 254ea: f9 01 movw r30, r18 254ec: 45 91 lpm r20, Z+ 254ee: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 254f0: f9 01 movw r30, r18 254f2: 32 96 adiw r30, 0x02 ; 2 254f4: 65 91 lpm r22, Z+ 254f6: 74 91 lpm r23, Z 254f8: 87 70 andi r24, 0x07 ; 7 254fa: 99 27 eor r25, r25 254fc: 86 9f mul r24, r22 254fe: 90 01 movw r18, r0 25500: 87 9f mul r24, r23 25502: 30 0d add r19, r0 25504: 96 9f mul r25, r22 25506: 30 0d add r19, r0 25508: 11 24 eor r1, r1 2550a: a3 e0 ldi r26, 0x03 ; 3 2550c: 36 95 lsr r19 2550e: 27 95 ror r18 25510: aa 95 dec r26 25512: e1 f7 brne .-8 ; 0x2550c <__vector_17+0x1038> 25514: ca 01 movw r24, r20 25516: 82 1b sub r24, r18 25518: 93 0b sbc r25, r19 2551a: aa cf rjmp .-172 ; 0x25470 <__vector_17+0xf9c> la_state = 0; nextAdvanceISR = ADV_NEVER; } else { // reset error and iterations per loop for this phase eISR_Err = current_block->advance_rate; 2551c: de 01 movw r26, r28 2551e: a3 5b subi r26, 0xB3 ; 179 25520: bf 4f sbci r27, 0xFF ; 255 25522: 4d 91 ld r20, X+ 25524: 5c 91 ld r21, X 25526: 11 97 sbiw r26, 0x01 ; 1 25528: 70 e0 ldi r23, 0x00 ; 0 2552a: 60 e0 ldi r22, 0x00 ; 0 2552c: 40 93 b6 05 sts 0x05B6, r20 ; 0x8005b6 25530: 50 93 b7 05 sts 0x05B7, r21 ; 0x8005b7 25534: 60 93 b8 05 sts 0x05B8, r22 ; 0x8005b8 25538: 70 93 b9 05 sts 0x05B9, r23 ; 0x8005b9 e_step_loops = current_block->advance_step_loops; 2553c: 16 96 adiw r26, 0x06 ; 6 2553e: 9c 91 ld r25, X 25540: 90 93 b5 05 sts 0x05B5, r25 ; 0x8005b5 if ((la_state & ADV_ACC_VARY) && e_extruding && (current_adv_steps > target_adv_steps)) { 25544: 98 2f mov r25, r24 25546: 92 70 andi r25, 0x02 ; 2 25548: 09 f4 brne .+2 ; 0x2554c <__vector_17+0x1078> 2554a: c8 cd rjmp .-1136 ; 0x250dc <__vector_17+0xc08> 2554c: 90 91 c4 05 lds r25, 0x05C4 ; 0x8005c4 25550: 99 23 and r25, r25 25552: 09 f4 brne .+2 ; 0x25556 <__vector_17+0x1082> 25554: c3 cd rjmp .-1146 ; 0x250dc <__vector_17+0xc08> 25556: 2e 17 cp r18, r30 25558: 3f 07 cpc r19, r31 2555a: 08 f0 brcs .+2 ; 0x2555e <__vector_17+0x108a> 2555c: bf cd rjmp .-1154 ; 0x250dc <__vector_17+0xc08> // LA could reverse the direction of extrusion in this phase eISR_Err += current_block->advance_rate; 2555e: 44 0f add r20, r20 25560: 55 1f adc r21, r21 25562: 66 1f adc r22, r22 25564: 77 1f adc r23, r23 25566: 40 93 b6 05 sts 0x05B6, r20 ; 0x8005b6 2556a: 50 93 b7 05 sts 0x05B7, r21 ; 0x8005b7 2556e: 60 93 b8 05 sts 0x05B8, r22 ; 0x8005b8 25572: 70 93 b9 05 sts 0x05B9, r23 ; 0x8005b9 LA_phase = 0; 25576: 10 92 d5 05 sts 0x05D5, r1 ; 0x8005d5 2557a: b0 cd rjmp .-1184 ; 0x250dc <__vector_17+0xc08> 2557c: 40 92 b6 05 sts 0x05B6, r4 ; 0x8005b6 25580: 50 92 b7 05 sts 0x05B7, r5 ; 0x8005b7 25584: 60 92 b8 05 sts 0x05B8, r6 ; 0x8005b8 25588: 70 92 b9 05 sts 0x05B9, r7 ; 0x8005b9 while(eISR_Err >= current_block->advance_rate) { ++ticks; eISR_Err -= current_block->advance_rate; } if(!ticks) 2558c: 61 11 cpse r22, r1 2558e: 1d c0 rjmp .+58 ; 0x255ca <__vector_17+0x10f6> { eISR_Rate = timer; 25590: f0 93 b4 05 sts 0x05B4, r31 ; 0x8005b4 25594: e0 93 b3 05 sts 0x05B3, r30 ; 0x8005b3 nextAdvanceISR = timer; 25598: f0 93 1b 04 sts 0x041B, r31 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 2559c: e0 93 1a 04 sts 0x041A, r30 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { // update timers & phase for the next iteration advance_spread(main_Rate); if (LA_phase >= 0) { 255a0: 80 91 d5 05 lds r24, 0x05D5 ; 0x8005d5 255a4: 87 fd sbrc r24, 7 255a6: 5a c0 rjmp .+180 ; 0x2565c <__vector_17+0x1188> if (step_loops == e_step_loops) 255a8: 80 91 dd 05 lds r24, 0x05DD ; 0x8005dd 255ac: 10 91 b5 05 lds r17, 0x05B5 ; 0x8005b5 255b0: c3 5b subi r28, 0xB3 ; 179 255b2: df 4f sbci r29, 0xFF ; 255 255b4: 28 81 ld r18, Y 255b6: 39 81 ldd r19, Y+1 ; 0x01 255b8: 81 13 cpse r24, r17 255ba: 35 c0 rjmp .+106 ; 0x25626 <__vector_17+0x1152> LA_phase = (current_block->advance_rate < main_Rate); 255bc: 81 e0 ldi r24, 0x01 ; 1 255be: 2e 17 cp r18, r30 255c0: 3f 07 cpc r19, r31 255c2: 08 f4 brcc .+2 ; 0x255c6 <__vector_17+0x10f2> 255c4: 49 c0 rjmp .+146 ; 0x25658 <__vector_17+0x1184> else { // avoid overflow through division. warning: we need to _guarantee_ step_loops // and e_step_loops are <= 4 due to fastdiv's limit auto adv_rate_n = fastdiv(current_block->advance_rate, step_loops); auto main_rate_n = fastdiv(main_Rate, e_step_loops); LA_phase = (adv_rate_n < main_rate_n); 255c6: 80 e0 ldi r24, 0x00 ; 0 255c8: 47 c0 rjmp .+142 ; 0x25658 <__vector_17+0x1184> eISR_Rate = timer; nextAdvanceISR = timer; return; } if (ticks <= 3) 255ca: 64 30 cpi r22, 0x04 ; 4 255cc: 28 f5 brcc .+74 ; 0x25618 <__vector_17+0x1144> eISR_Rate = fastdiv(timer, ticks + 1); 255ce: 6f 5f subi r22, 0xFF ; 255 #ifdef LIN_ADVANCE // @wavexx: fast uint16_t division for small dividends<5 // q/3 based on "Hacker's delight" formula FORCE_INLINE uint16_t fastdiv(uint16_t q, uint8_t d) { if(d != 3) return q >> (d / 2); 255d0: 63 30 cpi r22, 0x03 ; 3 255d2: a9 f0 breq .+42 ; 0x255fe <__vector_17+0x112a> 255d4: 66 95 lsr r22 255d6: af 01 movw r20, r30 255d8: 02 c0 rjmp .+4 ; 0x255de <__vector_17+0x110a> 255da: 56 95 lsr r21 255dc: 47 95 ror r20 255de: 6a 95 dec r22 255e0: e2 f7 brpl .-8 ; 0x255da <__vector_17+0x1106> 255e2: ba 01 movw r22, r20 if (ticks <= 3) eISR_Rate = fastdiv(timer, ticks + 1); else { // >4 ticks are still possible on slow moves eISR_Rate = timer / (ticks + 1); 255e4: 70 93 b4 05 sts 0x05B4, r23 ; 0x8005b4 255e8: 60 93 b3 05 sts 0x05B3, r22 ; 0x8005b3 } nextAdvanceISR = eISR_Rate; 255ec: 80 91 b3 05 lds r24, 0x05B3 ; 0x8005b3 255f0: 90 91 b4 05 lds r25, 0x05B4 ; 0x8005b4 255f4: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 255f8: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> 255fc: d1 cf rjmp .-94 ; 0x255a0 <__vector_17+0x10cc> // @wavexx: fast uint16_t division for small dividends<5 // q/3 based on "Hacker's delight" formula FORCE_INLINE uint16_t fastdiv(uint16_t q, uint8_t d) { if(d != 3) return q >> (d / 2); else return ((uint32_t)0xAAAB * q) >> 17; 255fe: 9f 01 movw r18, r30 25600: ab ea ldi r26, 0xAB ; 171 25602: ba ea ldi r27, 0xAA ; 170 25604: 0f 94 7c a0 call 0x340f8 ; 0x340f8 <__umulhisi3> 25608: 41 e1 ldi r20, 0x11 ; 17 2560a: 96 95 lsr r25 2560c: 87 95 ror r24 2560e: 77 95 ror r23 25610: 67 95 ror r22 25612: 4a 95 dec r20 25614: d1 f7 brne .-12 ; 0x2560a <__vector_17+0x1136> 25616: e6 cf rjmp .-52 ; 0x255e4 <__vector_17+0x1110> if (ticks <= 3) eISR_Rate = fastdiv(timer, ticks + 1); else { // >4 ticks are still possible on slow moves eISR_Rate = timer / (ticks + 1); 25618: 70 e0 ldi r23, 0x00 ; 0 2561a: 6f 5f subi r22, 0xFF ; 255 2561c: 7f 4f sbci r23, 0xFF ; 255 2561e: cf 01 movw r24, r30 25620: 0f 94 a5 a0 call 0x3414a ; 0x3414a <__udivmodhi4> 25624: df cf rjmp .-66 ; 0x255e4 <__vector_17+0x1110> #ifdef LIN_ADVANCE // @wavexx: fast uint16_t division for small dividends<5 // q/3 based on "Hacker's delight" formula FORCE_INLINE uint16_t fastdiv(uint16_t q, uint8_t d) { if(d != 3) return q >> (d / 2); 25626: 83 30 cpi r24, 0x03 ; 3 25628: 09 f4 brne .+2 ; 0x2562c <__vector_17+0x1158> 2562a: a2 c0 rjmp .+324 ; 0x25770 <__vector_17+0x129c> 2562c: 86 95 lsr r24 2562e: a9 01 movw r20, r18 25630: 02 c0 rjmp .+4 ; 0x25636 <__vector_17+0x1162> 25632: 56 95 lsr r21 25634: 47 95 ror r20 25636: 8a 95 dec r24 25638: e2 f7 brpl .-8 ; 0x25632 <__vector_17+0x115e> 2563a: 13 30 cpi r17, 0x03 ; 3 2563c: 09 f4 brne .+2 ; 0x25640 <__vector_17+0x116c> 2563e: a6 c0 rjmp .+332 ; 0x2578c <__vector_17+0x12b8> 25640: 16 95 lsr r17 25642: bf 01 movw r22, r30 25644: 02 c0 rjmp .+4 ; 0x2564a <__vector_17+0x1176> 25646: 76 95 lsr r23 25648: 67 95 ror r22 2564a: 1a 95 dec r17 2564c: e2 f7 brpl .-8 ; 0x25646 <__vector_17+0x1172> else { // avoid overflow through division. warning: we need to _guarantee_ step_loops // and e_step_loops are <= 4 due to fastdiv's limit auto adv_rate_n = fastdiv(current_block->advance_rate, step_loops); auto main_rate_n = fastdiv(main_Rate, e_step_loops); LA_phase = (adv_rate_n < main_rate_n); 2564e: 81 e0 ldi r24, 0x01 ; 1 25650: 46 17 cp r20, r22 25652: 57 07 cpc r21, r23 25654: 08 f0 brcs .+2 ; 0x25658 <__vector_17+0x1184> 25656: b7 cf rjmp .-146 ; 0x255c6 <__vector_17+0x10f2> 25658: 80 93 d5 05 sts 0x05D5, r24 ; 0x8005d5 } } // Check for serial chars. This executes roughtly inbetween 50-60% of the total runtime of the // entire isr, making this spot a much better choice than checking during esteps MSerial.checkRx(); 2565c: 0e 94 b5 fb call 0x1f76a ; 0x1f76a #endif // If current block is finished, reset pointer if (step_events_completed.wide >= current_block->step_event_count.wide) { 25660: 40 91 c0 05 lds r20, 0x05C0 ; 0x8005c0 25664: 50 91 c1 05 lds r21, 0x05C1 ; 0x8005c1 25668: 60 91 c2 05 lds r22, 0x05C2 ; 0x8005c2 2566c: 70 91 c3 05 lds r23, 0x05C3 ; 0x8005c3 25670: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 25674: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 25678: 80 89 ldd r24, Z+16 ; 0x10 2567a: 91 89 ldd r25, Z+17 ; 0x11 2567c: a2 89 ldd r26, Z+18 ; 0x12 2567e: b3 89 ldd r27, Z+19 ; 0x13 25680: 48 17 cp r20, r24 25682: 59 07 cpc r21, r25 25684: 6a 07 cpc r22, r26 25686: 7b 07 cpc r23, r27 25688: 80 f0 brcs .+32 ; 0x256aa <__vector_17+0x11d6> current_block = NULL; 2568a: 10 92 e5 11 sts 0x11E5, r1 ; 0x8011e5 2568e: 10 92 e4 11 sts 0x11E4, r1 ; 0x8011e4 extern volatile uint8_t block_buffer_tail; // Called when the current block is no longer needed. Discards the block and makes the memory // available for new blocks. FORCE_INLINE void plan_discard_current_block() { if (block_buffer_head != block_buffer_tail) { 25692: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 25696: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 2569a: 98 17 cp r25, r24 2569c: 31 f0 breq .+12 ; 0x256aa <__vector_17+0x11d6> block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 2569e: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 256a2: 8f 5f subi r24, 0xFF ; 255 256a4: 8f 70 andi r24, 0x0F ; 15 256a6: 80 93 a9 0d sts 0x0DA9, r24 ; 0x800da9 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 256aa: 60 91 1a 04 lds r22, 0x041A ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> 256ae: 70 91 1b 04 lds r23, 0x041B ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> if (eisr) 256b2: 61 15 cp r22, r1 256b4: 71 05 cpc r23, r1 256b6: 09 f0 breq .+2 ; 0x256ba <__vector_17+0x11e6> 256b8: 46 c0 rjmp .+140 ; 0x25746 <__vector_17+0x1272> #ifdef LIN_ADVANCE // Timer interrupt for E. e_steps is set in the main routine. FORCE_INLINE void advance_isr() { if (current_adv_steps > target_adv_steps) { 256ba: 40 91 16 04 lds r20, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> 256be: 50 91 17 04 lds r21, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 256c2: 20 91 d7 05 lds r18, 0x05D7 ; 0x8005d7 256c6: 30 91 d8 05 lds r19, 0x05D8 ; 0x8005d8 256ca: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 256ce: 24 17 cp r18, r20 256d0: 35 07 cpc r19, r21 256d2: 08 f0 brcs .+2 ; 0x256d6 <__vector_17+0x1202> 256d4: 6c c0 rjmp .+216 ; 0x257ae <__vector_17+0x12da> // decompression if (e_step_loops != 1) { 256d6: 90 91 b5 05 lds r25, 0x05B5 ; 0x8005b5 256da: 91 30 cpi r25, 0x01 ; 1 256dc: 41 f0 breq .+16 ; 0x256ee <__vector_17+0x121a> uint16_t d_steps = current_adv_steps - target_adv_steps; 256de: 42 1b sub r20, r18 256e0: 53 0b sbc r21, r19 if (d_steps < e_step_loops) 256e2: 94 17 cp r25, r20 256e4: 15 06 cpc r1, r21 256e6: 19 f0 breq .+6 ; 0x256ee <__vector_17+0x121a> 256e8: 10 f0 brcs .+4 ; 0x256ee <__vector_17+0x121a> e_step_loops = d_steps; 256ea: 40 93 b5 05 sts 0x05B5, r20 ; 0x8005b5 } e_steps -= e_step_loops; 256ee: 90 91 b5 05 lds r25, 0x05B5 ; 0x8005b5 256f2: 89 1b sub r24, r25 256f4: 80 93 d6 05 sts 0x05D6, r24 ; 0x8005d6 if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 256f8: 88 23 and r24, r24 256fa: 39 f0 breq .+14 ; 0x2570a <__vector_17+0x1236> 256fc: 87 ff sbrs r24, 7 256fe: 53 c0 rjmp .+166 ; 0x257a6 <__vector_17+0x12d2> 25700: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 25704: 80 64 ori r24, 0x40 ; 64 25706: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps -= e_step_loops; 2570a: 20 91 b5 05 lds r18, 0x05B5 ; 0x8005b5 2570e: 80 91 16 04 lds r24, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> 25712: 90 91 17 04 lds r25, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 25716: 82 1b sub r24, r18 25718: 91 09 sbc r25, r1 if (d_steps < e_step_loops) e_step_loops = d_steps; } e_steps += e_step_loops; if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); current_adv_steps += e_step_loops; 2571a: 90 93 17 04 sts 0x0417, r25 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 2571e: 80 93 16 04 sts 0x0416, r24 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> } if (current_adv_steps == target_adv_steps) { 25722: 20 91 16 04 lds r18, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> 25726: 30 91 17 04 lds r19, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 2572a: 80 91 d7 05 lds r24, 0x05D7 ; 0x8005d7 2572e: 90 91 d8 05 lds r25, 0x05D8 ; 0x8005d8 25732: 28 17 cp r18, r24 25734: 39 07 cpc r19, r25 25736: 09 f0 breq .+2 ; 0x2573a <__vector_17+0x1266> 25738: 66 c0 rjmp .+204 ; 0x25806 <__vector_17+0x1332> // advance steps completed nextAdvanceISR = ADV_NEVER; 2573a: 8f ef ldi r24, 0xFF ; 255 2573c: 9f ef ldi r25, 0xFF ; 255 } else { // schedule another tick nextAdvanceISR = eISR_Rate; 2573e: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 25742: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 25746: 40 91 d6 05 lds r20, 0x05D6 ; 0x8005d6 2574a: 41 11 cpse r20, r1 2574c: 61 c0 rjmp .+194 ; 0x25810 <__vector_17+0x133c> while(--max_ticks); } // Schedule the next closest tick, ignoring advance if scheduled too // soon in order to avoid skewing the regular stepper acceleration if (nextAdvanceISR != ADV_NEVER && (nextAdvanceISR + 40) < nextMainISR) 2574e: 80 91 1a 04 lds r24, 0x041A ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> 25752: 90 91 1b 04 lds r25, 0x041B ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 25756: 20 91 1c 04 lds r18, 0x041C ; 0x80041c <_ZL11nextMainISR.lto_priv.435> 2575a: 30 91 1d 04 lds r19, 0x041D ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 2575e: 8f 3f cpi r24, 0xFF ; 255 25760: 98 07 cpc r25, r24 25762: 09 f0 breq .+2 ; 0x25766 <__vector_17+0x1292> 25764: 88 c0 rjmp .+272 ; 0x25876 <__vector_17+0x13a2> OCR1A = nextAdvanceISR; else OCR1A = nextMainISR; 25766: 30 93 89 00 sts 0x0089, r19 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2576a: 20 93 88 00 sts 0x0088, r18 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2576e: 8e c0 rjmp .+284 ; 0x2588c <__vector_17+0x13b8> // @wavexx: fast uint16_t division for small dividends<5 // q/3 based on "Hacker's delight" formula FORCE_INLINE uint16_t fastdiv(uint16_t q, uint8_t d) { if(d != 3) return q >> (d / 2); else return ((uint32_t)0xAAAB * q) >> 17; 25770: ab ea ldi r26, 0xAB ; 171 25772: ba ea ldi r27, 0xAA ; 170 25774: 0f 94 7c a0 call 0x340f8 ; 0x340f8 <__umulhisi3> 25778: ab 01 movw r20, r22 2577a: bc 01 movw r22, r24 2577c: 31 e1 ldi r19, 0x11 ; 17 2577e: 76 95 lsr r23 25780: 67 95 ror r22 25782: 57 95 ror r21 25784: 47 95 ror r20 25786: 3a 95 dec r19 25788: d1 f7 brne .-12 ; 0x2577e <__vector_17+0x12aa> 2578a: 57 cf rjmp .-338 ; 0x2563a <__vector_17+0x1166> 2578c: 9f 01 movw r18, r30 2578e: ab ea ldi r26, 0xAB ; 171 25790: ba ea ldi r27, 0xAA ; 170 25792: 0f 94 7c a0 call 0x340f8 ; 0x340f8 <__umulhisi3> 25796: 21 e1 ldi r18, 0x11 ; 17 25798: 96 95 lsr r25 2579a: 87 95 ror r24 2579c: 77 95 ror r23 2579e: 67 95 ror r22 257a0: 2a 95 dec r18 257a2: d1 f7 brne .-12 ; 0x25798 <__vector_17+0x12c4> 257a4: 54 cf rjmp .-344 ; 0x2564e <__vector_17+0x117a> uint16_t d_steps = current_adv_steps - target_adv_steps; if (d_steps < e_step_loops) e_step_loops = d_steps; } e_steps -= e_step_loops; if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 257a6: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 257aa: 8f 7b andi r24, 0xBF ; 191 257ac: ac cf rjmp .-168 ; 0x25706 <__vector_17+0x1232> current_adv_steps -= e_step_loops; } else if (current_adv_steps < target_adv_steps) { 257ae: 42 17 cp r20, r18 257b0: 53 07 cpc r21, r19 257b2: 08 f0 brcs .+2 ; 0x257b6 <__vector_17+0x12e2> 257b4: b6 cf rjmp .-148 ; 0x25722 <__vector_17+0x124e> // compression if (e_step_loops != 1) { 257b6: 90 91 b5 05 lds r25, 0x05B5 ; 0x8005b5 257ba: 91 30 cpi r25, 0x01 ; 1 257bc: 41 f0 breq .+16 ; 0x257ce <__vector_17+0x12fa> uint16_t d_steps = target_adv_steps - current_adv_steps; 257be: 24 1b sub r18, r20 257c0: 35 0b sbc r19, r21 if (d_steps < e_step_loops) 257c2: 92 17 cp r25, r18 257c4: 13 06 cpc r1, r19 257c6: 19 f0 breq .+6 ; 0x257ce <__vector_17+0x12fa> 257c8: 10 f0 brcs .+4 ; 0x257ce <__vector_17+0x12fa> e_step_loops = d_steps; 257ca: 20 93 b5 05 sts 0x05B5, r18 ; 0x8005b5 } e_steps += e_step_loops; 257ce: 90 91 b5 05 lds r25, 0x05B5 ; 0x8005b5 257d2: 89 0f add r24, r25 257d4: 80 93 d6 05 sts 0x05D6, r24 ; 0x8005d6 if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 257d8: 88 23 and r24, r24 257da: 39 f0 breq .+14 ; 0x257ea <__vector_17+0x1316> 257dc: 87 ff sbrs r24, 7 257de: 0f c0 rjmp .+30 ; 0x257fe <__vector_17+0x132a> 257e0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 257e4: 80 64 ori r24, 0x40 ; 64 257e6: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps += e_step_loops; 257ea: 80 91 b5 05 lds r24, 0x05B5 ; 0x8005b5 257ee: 20 91 16 04 lds r18, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> 257f2: 30 91 17 04 lds r19, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 257f6: 82 0f add r24, r18 257f8: 93 2f mov r25, r19 257fa: 91 1d adc r25, r1 257fc: 8e cf rjmp .-228 ; 0x2571a <__vector_17+0x1246> uint16_t d_steps = target_adv_steps - current_adv_steps; if (d_steps < e_step_loops) e_step_loops = d_steps; } e_steps += e_step_loops; if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 257fe: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 25802: 8f 7b andi r24, 0xBF ; 191 25804: f0 cf rjmp .-32 ; 0x257e6 <__vector_17+0x1312> // advance steps completed nextAdvanceISR = ADV_NEVER; } else { // schedule another tick nextAdvanceISR = eISR_Rate; 25806: 80 91 b3 05 lds r24, 0x05B3 ; 0x8005b3 2580a: 90 91 b4 05 lds r25, 0x05B4 ; 0x8005b4 2580e: 97 cf rjmp .-210 ; 0x2573e <__vector_17+0x126a> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 25810: 80 91 d5 05 lds r24, 0x05D5 ; 0x8005d5 25814: 87 fd sbrc r24, 7 25816: 0e c0 rjmp .+28 ; 0x25834 <__vector_17+0x1360> 25818: 08 2e mov r0, r24 2581a: 00 0c add r0, r0 2581c: 99 0b sbc r25, r25 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 2581e: 21 e0 ldi r18, 0x01 ; 1 25820: 30 e0 ldi r19, 0x00 ; 0 25822: 61 15 cp r22, r1 25824: 71 05 cpc r23, r1 25826: 11 f0 breq .+4 ; 0x2582c <__vector_17+0x1358> 25828: 30 e0 ldi r19, 0x00 ; 0 2582a: 20 e0 ldi r18, 0x00 ; 0 WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 2582c: 82 17 cp r24, r18 2582e: 93 07 cpc r25, r19 25830: 09 f0 breq .+2 ; 0x25834 <__vector_17+0x1360> 25832: 8d cf rjmp .-230 ; 0x2574e <__vector_17+0x127a> uint8_t max_ticks = (eisr? e_step_loops: step_loops); 25834: 20 91 b5 05 lds r18, 0x05B5 ; 0x8005b5 25838: 67 2b or r22, r23 2583a: 11 f0 breq .+4 ; 0x25840 <__vector_17+0x136c> 2583c: 20 91 dd 05 lds r18, 0x05DD ; 0x8005dd max_ticks = min(abs(e_steps), max_ticks); 25840: 84 2f mov r24, r20 25842: 04 2e mov r0, r20 25844: 00 0c add r0, r0 25846: 99 0b sbc r25, r25 25848: 97 ff sbrs r25, 7 2584a: 03 c0 rjmp .+6 ; 0x25852 <__vector_17+0x137e> 2584c: 91 95 neg r25 2584e: 81 95 neg r24 25850: 91 09 sbc r25, r1 25852: 30 e0 ldi r19, 0x00 ; 0 25854: 28 17 cp r18, r24 25856: 39 07 cpc r19, r25 25858: 0c f4 brge .+2 ; 0x2585c <__vector_17+0x1388> 2585a: c9 01 movw r24, r18 2585c: 21 e0 ldi r18, 0x01 ; 1 2585e: 47 ff sbrs r20, 7 25860: 2f ef ldi r18, 0xFF ; 255 bool rev = (e_steps < 0); do { STEP_NC_HI(E_AXIS); 25862: 43 9a sbi 0x08, 3 ; 8 e_steps += (rev? 1: -1); 25864: 90 91 d6 05 lds r25, 0x05D6 ; 0x8005d6 25868: 92 0f add r25, r18 2586a: 90 93 d6 05 sts 0x05D6, r25 ; 0x8005d6 STEP_NC_LO(E_AXIS); 2586e: 43 98 cbi 0x08, 3 ; 8 #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) fsensor.stStep(rev); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } while(--max_ticks); 25870: 81 50 subi r24, 0x01 ; 1 25872: b9 f7 brne .-18 ; 0x25862 <__vector_17+0x138e> 25874: 6c cf rjmp .-296 ; 0x2574e <__vector_17+0x127a> } // Schedule the next closest tick, ignoring advance if scheduled too // soon in order to avoid skewing the regular stepper acceleration if (nextAdvanceISR != ADV_NEVER && (nextAdvanceISR + 40) < nextMainISR) 25876: ac 01 movw r20, r24 25878: 48 5d subi r20, 0xD8 ; 216 2587a: 5f 4f sbci r21, 0xFF ; 255 2587c: 42 17 cp r20, r18 2587e: 53 07 cpc r21, r19 25880: 08 f0 brcs .+2 ; 0x25884 <__vector_17+0x13b0> 25882: 71 cf rjmp .-286 ; 0x25766 <__vector_17+0x1292> OCR1A = nextAdvanceISR; 25884: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 25888: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> isr(); #endif // Don't run the ISR faster than possible // Is there a 8us time left before the next interrupt triggers? if (OCR1A < TCNT1 + 16) { 2588c: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 25890: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 25894: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 25898: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2589c: 40 96 adiw r24, 0x10 ; 16 2589e: 28 17 cp r18, r24 258a0: 39 07 cpc r19, r25 258a2: 48 f4 brcc .+18 ; 0x258b6 <__vector_17+0x13e2> // Beep, the beeper will be cleared at the stepper_timer_overflow() called from the main thread. WRITE(BEEPER, HIGH); } #endif // Fix the next interrupt to be executed after 8us from now. OCR1A = TCNT1 + 16; 258a4: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 258a8: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 258ac: 40 96 adiw r24, 0x10 ; 16 258ae: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 258b2: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> } } 258b6: ff 91 pop r31 258b8: ef 91 pop r30 258ba: df 91 pop r29 258bc: cf 91 pop r28 258be: bf 91 pop r27 258c0: af 91 pop r26 258c2: 9f 91 pop r25 258c4: 8f 91 pop r24 258c6: 7f 91 pop r23 258c8: 6f 91 pop r22 258ca: 5f 91 pop r21 258cc: 4f 91 pop r20 258ce: 3f 91 pop r19 258d0: 2f 91 pop r18 258d2: 1f 91 pop r17 258d4: ff 90 pop r15 258d6: ef 90 pop r14 258d8: df 90 pop r13 258da: cf 90 pop r12 258dc: 8f 90 pop r8 258de: 7f 90 pop r7 258e0: 6f 90 pop r6 258e2: 5f 90 pop r5 258e4: 4f 90 pop r4 258e6: 0f 90 pop r0 258e8: 0b be out 0x3b, r0 ; 59 258ea: 0f 90 pop r0 258ec: 0f be out 0x3f, r0 ; 63 258ee: 0f 90 pop r0 258f0: 1f 90 pop r1 258f2: 18 95 reti 000258f4 : return old; } bool enable_z_endstop(bool check) { bool old = check_z_endstop; 258f4: 90 91 bc 05 lds r25, 0x05BC ; 0x8005bc check_z_endstop = check; 258f8: 80 93 bc 05 sts 0x05BC, r24 ; 0x8005bc CRITICAL_SECTION_START; 258fc: 2f b7 in r18, 0x3f ; 63 258fe: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 25900: 80 91 2c 04 lds r24, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.439> 25904: 8b 7f andi r24, 0xFB ; 251 25906: 80 93 2c 04 sts 0x042C, r24 ; 0x80042c <_ZL11endstop_hit.lto_priv.439> CRITICAL_SECTION_END; 2590a: 2f bf out 0x3f, r18 ; 63 return old; } 2590c: 89 2f mov r24, r25 2590e: 08 95 ret 00025910 : return old; } bool endstop_z_hit_on_purpose() { bool hit = endstop_hit & _BV(Z_AXIS); 25910: 80 91 2c 04 lds r24, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.439> CRITICAL_SECTION_START; 25914: 2f b7 in r18, 0x3f ; 63 25916: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 25918: 90 91 2c 04 lds r25, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.439> 2591c: 9b 7f andi r25, 0xFB ; 251 2591e: 90 93 2c 04 sts 0x042C, r25 ; 0x80042c <_ZL11endstop_hit.lto_priv.439> CRITICAL_SECTION_END; 25922: 2f bf out 0x3f, r18 ; 63 return hit; } 25924: 82 fb bst r24, 2 25926: 88 27 eor r24, r24 25928: 80 f9 bld r24, 0 2592a: 08 95 ret 0002592c : } } bool endstops_hit_on_purpose() { uint8_t old = endstop_hit; 2592c: 90 91 2c 04 lds r25, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.439> endstop_hit = 0; 25930: 10 92 2c 04 sts 0x042C, r1 ; 0x80042c <_ZL11endstop_hit.lto_priv.439> return old; 25934: 81 e0 ldi r24, 0x01 ; 1 25936: 91 11 cpse r25, r1 25938: 01 c0 rjmp .+2 ; 0x2593c 2593a: 80 e0 ldi r24, 0x00 ; 0 } 2593c: 08 95 ret 0002593e : } } void Sound_MakeSound(eSOUND_TYPE eSoundType) { switch(eSoundMode) 2593e: 90 91 15 04 lds r25, 0x0415 ; 0x800415 25942: 91 30 cpi r25, 0x01 ; 1 25944: 99 f0 breq .+38 ; 0x2596c 25946: 28 f0 brcs .+10 ; 0x25952 25948: 92 30 cpi r25, 0x02 ; 2 2594a: a1 f0 breq .+40 ; 0x25974 2594c: 93 30 cpi r25, 0x03 ; 3 2594e: b1 f0 breq .+44 ; 0x2597c 25950: 08 95 ret { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) 25952: 81 11 cpse r24, r1 25954: 02 c0 rjmp .+4 ; 0x2595a if(eSoundType==e_SOUND_TYPE_StandardAlert) Sound_DoSound_Alert(true); break; case e_SOUND_MODE_BLIND: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); 25956: 0c 94 0f fc jmp 0x1f81e ; 0x1f81e switch(eSoundMode) { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 2595a: 82 30 cpi r24, 0x02 ; 2 2595c: 11 f4 brne .+4 ; 0x25962 break; case e_SOUND_MODE_BLIND: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) Sound_DoSound_Prompt(); 2595e: 0d 94 b4 09 jmp 0x21368 ; 0x21368 case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 25962: 85 30 cpi r24, 0x05 ; 5 25964: 81 f5 brne .+96 ; 0x259c6 Sound_DoSound_Alert(false); 25966: 80 e0 ldi r24, 0x00 ; 0 if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) Sound_DoSound_Alert(true); 25968: 0c 94 fb fb jmp 0x1f7f6 ; 0x1f7f6 Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) Sound_DoSound_Alert(false); break; case e_SOUND_MODE_ONCE: if(eSoundType==e_SOUND_TYPE_ButtonEcho) 2596c: 88 23 and r24, r24 2596e: 99 f3 breq .-26 ; 0x25956 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 25970: 82 30 cpi r24, 0x02 ; 2 25972: a9 f3 breq .-22 ; 0x2595e Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 25974: 85 30 cpi r24, 0x05 ; 5 25976: 39 f5 brne .+78 ; 0x259c6 Sound_DoSound_Alert(true); 25978: 81 e0 ldi r24, 0x01 ; 1 2597a: f6 cf rjmp .-20 ; 0x25968 case e_SOUND_MODE_SILENT: if(eSoundType==e_SOUND_TYPE_StandardAlert) Sound_DoSound_Alert(true); break; case e_SOUND_MODE_BLIND: if(eSoundType==e_SOUND_TYPE_ButtonEcho) 2597c: 88 23 and r24, r24 2597e: 59 f3 breq .-42 ; 0x25956 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 25980: 82 30 cpi r24, 0x02 ; 2 25982: 69 f3 breq .-38 ; 0x2595e Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 25984: 85 30 cpi r24, 0x05 ; 5 25986: 79 f3 breq .-34 ; 0x25966 Sound_DoSound_Alert(false); if(eSoundType==e_SOUND_TYPE_EncoderMove) 25988: 86 30 cpi r24, 0x06 ; 6 2598a: 71 f4 brne .+28 ; 0x259a8 2598c: 85 e0 ldi r24, 0x05 ; 5 2598e: 27 e2 ldi r18, 0x27 ; 39 25990: 31 e0 ldi r19, 0x01 ; 1 { uint8_t nI; for(nI=0;nI<5;nI++) { WRITE(BEEPER,HIGH); 25992: 72 9a sbi 0x0e, 2 ; 14 25994: f9 01 movw r30, r18 25996: 31 97 sbiw r30, 0x01 ; 1 25998: f1 f7 brne .-4 ; 0x25996 delayMicroseconds(75); WRITE(BEEPER,LOW); 2599a: 72 98 cbi 0x0e, 2 ; 14 2599c: f9 01 movw r30, r18 2599e: 31 97 sbiw r30, 0x01 ; 1 259a0: f1 f7 brne .-4 ; 0x2599e 259a2: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Encoder_Move(void) { uint8_t nI; for(nI=0;nI<5;nI++) 259a4: b1 f7 brne .-20 ; 0x25992 259a6: 08 95 ret Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) Sound_DoSound_Alert(false); if(eSoundType==e_SOUND_TYPE_EncoderMove) Sound_DoSound_Encoder_Move(); if(eSoundType==e_SOUND_TYPE_BlindAlert) 259a8: 87 30 cpi r24, 0x07 ; 7 259aa: 69 f4 brne .+26 ; 0x259c6 259ac: 84 e1 ldi r24, 0x14 ; 20 259ae: 23 e7 ldi r18, 0x73 ; 115 259b0: 31 e0 ldi r19, 0x01 ; 1 backlight_wake(1); uint8_t nI; for(nI=0; nI<20; nI++) { WRITE(BEEPER,HIGH); 259b2: 72 9a sbi 0x0e, 2 ; 14 259b4: f9 01 movw r30, r18 259b6: 31 97 sbiw r30, 0x01 ; 1 259b8: f1 f7 brne .-4 ; 0x259b6 delayMicroseconds(94); WRITE(BEEPER,LOW); 259ba: 72 98 cbi 0x0e, 2 ; 14 259bc: f9 01 movw r30, r18 259be: 31 97 sbiw r30, 0x01 ; 1 259c0: f1 f7 brne .-4 ; 0x259be 259c2: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Blind_Alert(void) { backlight_wake(1); uint8_t nI; for(nI=0; nI<20; nI++) 259c4: b1 f7 brne .-20 ; 0x259b2 Sound_DoSound_Blind_Alert(); break; default: break; } } 259c6: 08 95 ret 000259c8 : //! @retval 0xFF button timeout (only possible if allow_timeouting is true) uint8_t lcd_show_multiscreen_message_with_choices_and_wait_P( const char *const msg, bool allow_timeouting, uint8_t default_selection, const char *const first_choice, const char *const second_choice, const char *const third_choice, uint8_t second_col ) { 259c8: 2f 92 push r2 259ca: 3f 92 push r3 259cc: 4f 92 push r4 259ce: 5f 92 push r5 259d0: 6f 92 push r6 259d2: 7f 92 push r7 259d4: 8f 92 push r8 259d6: 9f 92 push r9 259d8: af 92 push r10 259da: bf 92 push r11 259dc: cf 92 push r12 259de: df 92 push r13 259e0: ef 92 push r14 259e2: ff 92 push r15 259e4: 0f 93 push r16 259e6: 1f 93 push r17 259e8: cf 93 push r28 259ea: df 93 push r29 259ec: 00 d0 rcall .+0 ; 0x259ee 259ee: 00 d0 rcall .+0 ; 0x259f0 259f0: cd b7 in r28, 0x3d ; 61 259f2: de b7 in r29, 0x3e ; 62 259f4: 5c 01 movw r10, r24 259f6: 6c 83 std Y+4, r22 ; 0x04 259f8: 34 2e mov r3, r20 259fa: 3b 83 std Y+3, r19 ; 0x03 259fc: 2a 83 std Y+2, r18 ; 0x02 259fe: 48 01 movw r8, r16 25a00: 2c 2c mov r2, r12 const char *msg_next = msg ? lcd_display_message_fullscreen_P(msg) : NULL; 25a02: 00 97 sbiw r24, 0x00 ; 0 25a04: 09 f0 breq .+2 ; 0x25a08 25a06: 51 c0 rjmp .+162 ; 0x25aaa bool multi_screen = msg_next != NULL; // Initial status/prompt on single-screen messages uint8_t current_selection = default_selection; if (!msg_next) { lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); 25a08: 87 01 movw r16, r14 25a0a: 22 2d mov r18, r2 25a0c: a4 01 movw r20, r8 25a0e: 6a 81 ldd r22, Y+2 ; 0x02 25a10: 7b 81 ldd r23, Y+3 ; 0x03 25a12: 83 2d mov r24, r3 25a14: 0f 94 6f 0a call 0x214de ; 0x214de 25a18: d1 2c mov r13, r1 25a1a: c1 2c mov r12, r1 } // Wait for user confirmation or a timeout. unsigned long previous_millis_cmd = _millis(); 25a1c: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 25a20: 2b 01 movw r4, r22 25a22: 3c 01 movw r6, r24 lcd_consume_click(); 25a24: 0e 94 93 6b call 0xd726 ; 0xd726 KEEPALIVE_STATE(PAUSED_FOR_USER); 25a28: 84 e0 ldi r24, 0x04 ; 4 25a2a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 25a2e: de 82 std Y+6, r13 ; 0x06 25a30: cd 82 std Y+5, r12 ; 0x05 25a32: 24 e6 ldi r18, 0x64 ; 100 25a34: 29 83 std Y+1, r18 ; 0x01 for (;;) { for (uint8_t i = 0; i < 100; ++i) { delay_keep_alive(50); 25a36: 82 e3 ldi r24, 0x32 ; 50 25a38: 90 e0 ldi r25, 0x00 ; 0 25a3a: 0e 94 48 7c call 0xf890 ; 0xf890 if (allow_timeouting && _millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS) { 25a3e: 3c 81 ldd r19, Y+4 ; 0x04 25a40: 31 11 cpse r19, r1 25a42: 3a c0 rjmp .+116 ; 0x25ab8 current_selection = LCD_BUTTON_TIMEOUT; goto exit; } if (lcd_encoder) { 25a44: 80 91 06 05 lds r24, 0x0506 ; 0x800506 25a48: 90 91 07 05 lds r25, 0x0507 ; 0x800507 25a4c: 00 97 sbiw r24, 0x00 ; 0 25a4e: 09 f0 breq .+2 ; 0x25a52 25a50: 42 c0 rjmp .+132 ; 0x25ad6 } else { Sound_MakeSound(e_SOUND_TYPE_BlindAlert); break; // turning knob skips waiting loop } } if (lcd_clicked()) { 25a52: 0e 94 98 6b call 0xd730 ; 0xd730 25a56: 88 23 and r24, r24 25a58: 09 f4 brne .+2 ; 0x25a5c 25a5a: 67 c0 rjmp .+206 ; 0x25b2a if (msg_next == NULL) { 25a5c: 8d 81 ldd r24, Y+5 ; 0x05 25a5e: 9e 81 ldd r25, Y+6 ; 0x06 25a60: 89 2b or r24, r25 25a62: 09 f0 breq .+2 ; 0x25a66 25a64: 5e c0 rjmp .+188 ; 0x25b22 if (msg_next == NULL) { lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); } } exit: KEEPALIVE_STATE(IN_HANDLER); 25a66: 82 e0 ldi r24, 0x02 ; 2 25a68: 80 93 78 02 sts 0x0278, r24 ; 0x800278 // Enable LCD updates again. We may not call lcd_update_enable(true) // because it may create a recursion scenario when the caller of lcd_show_multiscreen_message_with_choices_and_wait_P // is a submenu lcd_update_enable(true) will cause another call to the submenu immediately // and so won't allow the user to exit the submenu lcd_update_enabled = true; 25a6c: 91 e0 ldi r25, 0x01 ; 1 25a6e: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c lcd_draw_update = 2; 25a72: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b return current_selection; } 25a76: 83 2d mov r24, r3 25a78: 26 96 adiw r28, 0x06 ; 6 25a7a: 0f b6 in r0, 0x3f ; 63 25a7c: f8 94 cli 25a7e: de bf out 0x3e, r29 ; 62 25a80: 0f be out 0x3f, r0 ; 63 25a82: cd bf out 0x3d, r28 ; 61 25a84: df 91 pop r29 25a86: cf 91 pop r28 25a88: 1f 91 pop r17 25a8a: 0f 91 pop r16 25a8c: ff 90 pop r15 25a8e: ef 90 pop r14 25a90: df 90 pop r13 25a92: cf 90 pop r12 25a94: bf 90 pop r11 25a96: af 90 pop r10 25a98: 9f 90 pop r9 25a9a: 8f 90 pop r8 25a9c: 7f 90 pop r7 25a9e: 6f 90 pop r6 25aa0: 5f 90 pop r5 25aa2: 4f 90 pop r4 25aa4: 3f 90 pop r3 25aa6: 2f 90 pop r2 25aa8: 08 95 ret uint8_t lcd_show_multiscreen_message_with_choices_and_wait_P( const char *const msg, bool allow_timeouting, uint8_t default_selection, const char *const first_choice, const char *const second_choice, const char *const third_choice, uint8_t second_col ) { const char *msg_next = msg ? lcd_display_message_fullscreen_P(msg) : NULL; 25aaa: 0f 94 c0 0a call 0x21580 ; 0x21580 25aae: 6c 01 movw r12, r24 bool multi_screen = msg_next != NULL; // Initial status/prompt on single-screen messages uint8_t current_selection = default_selection; if (!msg_next) { 25ab0: 89 2b or r24, r25 25ab2: 09 f0 breq .+2 ; 0x25ab6 25ab4: b3 cf rjmp .-154 ; 0x25a1c 25ab6: a8 cf rjmp .-176 ; 0x25a08 lcd_consume_click(); KEEPALIVE_STATE(PAUSED_FOR_USER); for (;;) { for (uint8_t i = 0; i < 100; ++i) { delay_keep_alive(50); if (allow_timeouting && _millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS) { 25ab8: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 25abc: 64 19 sub r22, r4 25abe: 75 09 sbc r23, r5 25ac0: 86 09 sbc r24, r6 25ac2: 97 09 sbc r25, r7 25ac4: 61 33 cpi r22, 0x31 ; 49 25ac6: 75 47 sbci r23, 0x75 ; 117 25ac8: 81 05 cpc r24, r1 25aca: 91 05 cpc r25, r1 25acc: 08 f4 brcc .+2 ; 0x25ad0 25ace: ba cf rjmp .-140 ; 0x25a44 current_selection = LCD_BUTTON_TIMEOUT; 25ad0: 33 24 eor r3, r3 25ad2: 3a 94 dec r3 25ad4: c8 cf rjmp .-112 ; 0x25a66 goto exit; } if (lcd_encoder) { if (msg_next == NULL) { 25ad6: 2d 81 ldd r18, Y+5 ; 0x05 25ad8: 3e 81 ldd r19, Y+6 ; 0x06 25ada: 23 2b or r18, r19 25adc: f9 f4 brne .+62 ; 0x25b1c if (third_choice) { // third_choice is not nullptr, safe to dereference 25ade: e1 14 cp r14, r1 25ae0: f1 04 cpc r15, r1 25ae2: b1 f0 breq .+44 ; 0x25b10 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 25ae4: 97 ff sbrs r25, 7 25ae6: 0f c0 rjmp .+30 ; 0x25b06 25ae8: 31 10 cpse r3, r1 // Rotating knob counter clockwise current_selection--; 25aea: 3a 94 dec r3 } else if (lcd_encoder > 0 && current_selection != LCD_MIDDLE_BUTTON_CHOICE) { // Rotating knob clockwise current_selection = LCD_MIDDLE_BUTTON_CHOICE; } } lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); 25aec: 87 01 movw r16, r14 25aee: 22 2d mov r18, r2 25af0: a4 01 movw r20, r8 25af2: 6a 81 ldd r22, Y+2 ; 0x02 25af4: 7b 81 ldd r23, Y+3 ; 0x03 25af6: 83 2d mov r24, r3 25af8: 0f 94 6f 0a call 0x214de ; 0x214de lcd_encoder = 0; 25afc: 10 92 07 05 sts 0x0507, r1 ; 0x800507 25b00: 10 92 06 05 sts 0x0506, r1 ; 0x800506 25b04: a6 cf rjmp .-180 ; 0x25a52 if (msg_next == NULL) { if (third_choice) { // third_choice is not nullptr, safe to dereference if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { // Rotating knob counter clockwise current_selection--; } else if (lcd_encoder > 0 && current_selection != LCD_RIGHT_BUTTON_CHOICE) { 25b06: 32 e0 ldi r19, 0x02 ; 2 25b08: 33 16 cp r3, r19 25b0a: 81 f3 breq .-32 ; 0x25aec // Rotating knob clockwise current_selection++; 25b0c: 33 94 inc r3 25b0e: ee cf rjmp .-36 ; 0x25aec } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 25b10: 39 2e mov r3, r25 25b12: 30 94 com r3 25b14: 33 1c adc r3, r3 25b16: 33 24 eor r3, r3 25b18: 33 1c adc r3, r3 25b1a: e8 cf rjmp .-48 ; 0x25aec } } lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); lcd_encoder = 0; } else { Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 25b1c: 87 e0 ldi r24, 0x07 ; 7 25b1e: 0f 94 9f 2c call 0x2593e ; 0x2593e goto exit; } else break; } } if (multi_screen) { 25b22: c1 14 cp r12, r1 25b24: d1 04 cpc r13, r1 25b26: 79 f4 brne .+30 ; 0x25b46 25b28: 84 cf rjmp .-248 ; 0x25a32 25b2a: 99 81 ldd r25, Y+1 ; 0x01 25b2c: 91 50 subi r25, 0x01 ; 1 25b2e: 99 83 std Y+1, r25 ; 0x01 // Wait for user confirmation or a timeout. unsigned long previous_millis_cmd = _millis(); lcd_consume_click(); KEEPALIVE_STATE(PAUSED_FOR_USER); for (;;) { for (uint8_t i = 0; i < 100; ++i) { 25b30: 91 11 cpse r25, r1 25b32: 81 cf rjmp .-254 ; 0x25a36 goto exit; } else break; } } if (multi_screen) { 25b34: c1 14 cp r12, r1 25b36: d1 04 cpc r13, r1 25b38: 61 f0 breq .+24 ; 0x25b52 if (msg_next == NULL) { 25b3a: 2d 81 ldd r18, Y+5 ; 0x05 25b3c: 3e 81 ldd r19, Y+6 ; 0x06 25b3e: 23 2b or r18, r19 25b40: 11 f4 brne .+4 ; 0x25b46 25b42: be 82 std Y+6, r11 ; 0x06 25b44: ad 82 std Y+5, r10 ; 0x05 msg_next = msg; } msg_next = lcd_display_message_fullscreen_P(msg_next); 25b46: 8d 81 ldd r24, Y+5 ; 0x05 25b48: 9e 81 ldd r25, Y+6 ; 0x06 25b4a: 0f 94 c0 0a call 0x21580 ; 0x21580 25b4e: 9e 83 std Y+6, r25 ; 0x06 25b50: 8d 83 std Y+5, r24 ; 0x05 } if (msg_next == NULL) { 25b52: 8d 81 ldd r24, Y+5 ; 0x05 25b54: 9e 81 ldd r25, Y+6 ; 0x06 25b56: 89 2b or r24, r25 25b58: 09 f0 breq .+2 ; 0x25b5c 25b5a: 6b cf rjmp .-298 ; 0x25a32 lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); 25b5c: 87 01 movw r16, r14 25b5e: 22 2d mov r18, r2 25b60: a4 01 movw r20, r8 25b62: 6a 81 ldd r22, Y+2 ; 0x02 25b64: 7b 81 ldd r23, Y+3 ; 0x03 25b66: 83 2d mov r24, r3 25b68: 0f 94 6f 0a call 0x214de ; 0x214de 25b6c: 62 cf rjmp .-316 ; 0x25a32 00025b6e : //! @param default_selection if 0, 'Yes' choice is selected by default, otherwise 'No' choice is preselected //! @retval 0 cont choice selected by user //! @retval 1 cancel choice selected by user //! @retval 0xFF button timeout (only possible if allow_timeouting is true) uint8_t lcd_show_multiscreen_message_cont_cancel_and_wait_P(const char *msg, bool allow_timeouting, uint8_t default_selection) //currently just max. n*4 + 3 lines supported (set in language header files) { 25b6e: bf 92 push r11 25b70: cf 92 push r12 25b72: df 92 push r13 25b74: ef 92 push r14 25b76: ff 92 push r15 25b78: 0f 93 push r16 25b7a: 1f 93 push r17 25b7c: cf 93 push r28 25b7e: df 93 push r29 25b80: ec 01 movw r28, r24 25b82: d6 2e mov r13, r22 25b84: b4 2e mov r11, r20 return lcd_show_multiscreen_message_with_choices_and_wait_P(msg, allow_timeouting, default_selection, _T(MSG_CONTINUE_SHORT), _T(MSG_CANCEL), nullptr, 10); 25b86: 85 ee ldi r24, 0xE5 ; 229 25b88: 9d e4 ldi r25, 0x4D ; 77 25b8a: 0e 94 b1 6c call 0xd962 ; 0xd962 25b8e: 8c 01 movw r16, r24 25b90: 86 e3 ldi r24, 0x36 ; 54 25b92: 95 e5 ldi r25, 0x55 ; 85 25b94: 0e 94 b1 6c call 0xd962 ; 0xd962 25b98: 2a e0 ldi r18, 0x0A ; 10 25b9a: c2 2e mov r12, r18 25b9c: f1 2c mov r15, r1 25b9e: e1 2c mov r14, r1 25ba0: 9c 01 movw r18, r24 25ba2: 4b 2d mov r20, r11 25ba4: 6d 2d mov r22, r13 25ba6: ce 01 movw r24, r28 25ba8: 0f 94 e4 2c call 0x259c8 ; 0x259c8 } 25bac: df 91 pop r29 25bae: cf 91 pop r28 25bb0: 1f 91 pop r17 25bb2: 0f 91 pop r16 25bb4: ff 90 pop r15 25bb6: ef 90 pop r14 25bb8: df 90 pop r13 25bba: cf 90 pop r12 25bbc: bf 90 pop r11 25bbe: 08 95 ret 00025bc0 : //! @param default_selection if 0, 'Yes' choice is selected by default, otherwise 'No' choice is preselected //! @retval 0 yes choice selected by user //! @retval 1 no choice selected by user //! @retval 0xFF button timeout (only possible if allow_timeouting is true) uint8_t lcd_show_multiscreen_message_yes_no_and_wait_P(const char *msg, bool allow_timeouting, uint8_t default_selection) //currently just max. n*4 + 3 lines supported (set in language header files) { 25bc0: bf 92 push r11 25bc2: cf 92 push r12 25bc4: df 92 push r13 25bc6: ef 92 push r14 25bc8: ff 92 push r15 25bca: 0f 93 push r16 25bcc: 1f 93 push r17 25bce: cf 93 push r28 25bd0: df 93 push r29 25bd2: ec 01 movw r28, r24 25bd4: d6 2e mov r13, r22 25bd6: b4 2e mov r11, r20 return lcd_show_multiscreen_message_with_choices_and_wait_P(msg, allow_timeouting, default_selection, _T(MSG_YES), _T(MSG_NO), nullptr, 10); 25bd8: 88 eb ldi r24, 0xB8 ; 184 25bda: 9d e3 ldi r25, 0x3D ; 61 25bdc: 0e 94 b1 6c call 0xd962 ; 0xd962 25be0: 8c 01 movw r16, r24 25be2: 82 eb ldi r24, 0xB2 ; 178 25be4: 9d e3 ldi r25, 0x3D ; 61 25be6: 0e 94 b1 6c call 0xd962 ; 0xd962 25bea: 2a e0 ldi r18, 0x0A ; 10 25bec: c2 2e mov r12, r18 25bee: f1 2c mov r15, r1 25bf0: e1 2c mov r14, r1 25bf2: 9c 01 movw r18, r24 25bf4: 4b 2d mov r20, r11 25bf6: 6d 2d mov r22, r13 25bf8: ce 01 movw r24, r28 25bfa: 0f 94 e4 2c call 0x259c8 ; 0x259c8 } 25bfe: df 91 pop r29 25c00: cf 91 pop r28 25c02: 1f 91 pop r17 25c04: 0f 91 pop r16 25c06: ff 90 pop r15 25c08: ef 90 pop r14 25c0a: df 90 pop r13 25c0c: cf 90 pop r12 25c0e: bf 90 pop r11 25c10: 08 95 ret 00025c12 : //! ---------------------- | ---------------- //! WizState::Run | Main entry point //! WizState::RepeatLay1Cal | Entry point after passing 1st layer calibration //! WizState::LoadFilHot | Entry point after temporarily left for preheat before load filament void lcd_wizard(WizState state) { 25c12: af 92 push r10 25c14: bf 92 push r11 25c16: cf 92 push r12 25c18: df 92 push r13 25c1a: ef 92 push r14 25c1c: ff 92 push r15 25c1e: 0f 93 push r16 25c20: 1f 93 push r17 25c22: cf 93 push r28 25c24: c8 2f mov r28, r24 using S = WizState; bool end = false; uint8_t wizard_event; // Make sure EEPROM_WIZARD_ACTIVE is true if entering using different entry point // other than WizState::Run - it is useful for debugging wizard. if (state != S::Run) eeprom_update_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); 25c26: 88 23 and r24, r24 25c28: 29 f0 breq .+10 ; 0x25c34 25c2a: 61 e0 ldi r22, 0x01 ; 1 25c2c: 8f e5 ldi r24, 0x5F ; 95 25c2e: 9f e0 ldi r25, 0x0F ; 15 25c30: 0f 94 00 a0 call 0x34000 ; 0x34000 FORCE_BL_ON_START; while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 25c34: 88 e2 ldi r24, 0x28 ; 40 25c36: e8 2e mov r14, r24 25c38: 88 e9 ldi r24, 0x98 ; 152 25c3a: f8 2e mov r15, r24 }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 25c3c: 97 ed ldi r25, 0xD7 ; 215 25c3e: c9 2e mov r12, r25 25c40: d1 2c mov r13, r1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 25c42: 2c e3 ldi r18, 0x3C ; 60 25c44: a2 2e mov r10, r18 25c46: b1 2c mov r11, r1 25c48: 0c 2f mov r16, r28 25c4a: 10 e0 ldi r17, 0x00 ; 0 25c4c: 1f 92 push r1 25c4e: cf 93 push r28 25c50: ff 92 push r15 25c52: ef 92 push r14 25c54: 0f 94 9e 9e call 0x33d3c ; 0x33d3c switch (state) { 25c58: 0f 90 pop r0 25c5a: 0f 90 pop r0 25c5c: 0f 90 pop r0 25c5e: 0f 90 pop r0 25c60: ef ef ldi r30, 0xFF ; 255 25c62: ec 0f add r30, r28 25c64: ed 30 cpi r30, 0x0D ; 13 25c66: a0 f4 brcc .+40 ; 0x25c90 25c68: f0 e0 ldi r31, 0x00 ; 0 25c6a: 88 27 eor r24, r24 25c6c: e5 5c subi r30, 0xC5 ; 197 25c6e: f1 4d sbci r31, 0xD1 ; 209 25c70: 8e 4f sbci r24, 0xFE ; 254 25c72: 0d 94 ec a0 jmp 0x341d8 ; 0x341d8 <__tablejump2__> 25c76: 4f 37 cpi r20, 0x7F ; 127 25c78: e9 37 cpi r30, 0x79 ; 121 25c7a: 95 38 cpi r25, 0x85 ; 133 25c7c: 67 38 cpi r22, 0x87 ; 135 25c7e: 4f 38 cpi r20, 0x8F ; 143 25c80: 33 37 cpi r19, 0x73 ; 115 25c82: 31 37 cpi r19, 0x71 ; 113 25c84: cb 37 cpi r28, 0x7B ; 123 25c86: ef 37 cpi r30, 0x7F ; 127 25c88: 09 37 cpi r16, 0x79 ; 121 25c8a: 73 37 cpi r23, 0x73 ; 115 25c8c: f5 36 cpi r31, 0x65 ; 101 25c8e: f5 36 cpi r31, 0x65 ; 101 // which results in distorted print. // This primarily happens when the printer is new and parked in 0,0 // So any new printer will fail the first layer calibration unless being reset or the Stop function gets called. // We really must find a way to prevent the crash from happening before the printer is started - that would be the correct solution. // Btw. the flag may even trigger the viper situation on normal start this way and the user won't be able to find out why. saved_printing = false; 25c90: 10 92 e7 11 sts 0x11E7, r1 ; 0x8011e7 if( eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)==2){ 25c94: 8f e5 ldi r24, 0x5F ; 95 25c96: 9f e0 ldi r25, 0x0F ; 15 25c98: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 25c9c: 82 30 cpi r24, 0x02 ; 2 25c9e: 39 f4 brne .+14 ; 0x25cae // printer pre-assembled: finish remaining steps lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_WELCOME_SHIPPING)); 25ca0: 8d e7 ldi r24, 0x7D ; 125 25ca2: 94 e5 ldi r25, 0x54 ; 84 lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_CLEAN_HEATBED)); state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); 25ca4: 0e 94 b1 6c call 0xd962 ; 0xd962 25ca8: 0f 94 47 0b call 0x2168e ; 0x2168e 25cac: 0f c0 rjmp .+30 ; 0x25ccc // printer pre-assembled: finish remaining steps lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_WELCOME_SHIPPING)); state = S::Restore; } else { // new printer, factory reset or manual invocation wizard_event = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_WIZARD_WELCOME), false, LCD_LEFT_BUTTON_CHOICE); 25cae: 88 e1 ldi r24, 0x18 ; 24 25cb0: 94 e5 ldi r25, 0x54 ; 84 25cb2: 0e 94 b1 6c call 0xd962 ; 0xd962 25cb6: 40 e0 ldi r20, 0x00 ; 0 25cb8: 60 e0 ldi r22, 0x00 ; 0 25cba: 0f 94 e0 2d call 0x25bc0 ; 0x25bc0 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 25cbe: 81 11 cpse r24, r1 25cc0: 07 c0 rjmp .+14 ; 0x25cd0 25cc2: 61 e0 ldi r22, 0x01 ; 1 25cc4: 8f e5 ldi r24, 0x5F ; 95 25cc6: 9f e0 ldi r25, 0x0F ; 15 25cc8: 0f 94 00 a0 call 0x34000 ; 0x34000 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); state = S::Restore; 25ccc: c1 e0 ldi r28, 0x01 ; 1 25cce: bc cf rjmp .-136 ; 0x25c48 25cd0: 60 e0 ldi r22, 0x00 ; 0 25cd2: 8f e5 ldi r24, 0x5F ; 95 25cd4: 9f e0 ldi r25, 0x0F ; 15 25cd6: 0f 94 00 a0 call 0x34000 ; 0x34000 25cda: c0 e0 ldi r28, 0x00 ; 0 if (state != S::Run) eeprom_update_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); FORCE_BL_ON_START; while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 25cdc: 10 e0 ldi r17, 0x00 ; 0 25cde: 00 e0 ldi r16, 0x00 ; 0 } FORCE_BL_ON_END; const char *msg = NULL; printf_P(_N("Wizard end state: %d\n"), (uint8_t)state); 25ce0: 1f 93 push r17 25ce2: 0f 93 push r16 25ce4: 8e e3 ldi r24, 0x3E ; 62 25ce6: 9b e6 ldi r25, 0x6B ; 107 25ce8: 9f 93 push r25 25cea: 8f 93 push r24 25cec: 0f 94 9e 9e call 0x33d3c ; 0x33d3c switch (state) { 25cf0: 0f 90 pop r0 25cf2: 0f 90 pop r0 25cf4: 0f 90 pop r0 25cf6: 0f 90 pop r0 25cf8: cc 30 cpi r28, 0x0C ; 12 25cfa: 09 f4 brne .+2 ; 0x25cfe 25cfc: ed c0 rjmp .+474 ; 0x25ed8 25cfe: cd 30 cpi r28, 0x0D ; 13 25d00: 09 f4 brne .+2 ; 0x25d04 25d02: ff c0 rjmp .+510 ; 0x25f02 case S::Run: // user interrupted msg = _T(MSG_WIZARD_QUIT); 25d04: 87 e7 ldi r24, 0x77 ; 119 25d06: 91 e5 ldi r25, 0x51 ; 81 FORCE_BL_ON_END; const char *msg = NULL; printf_P(_N("Wizard end state: %d\n"), (uint8_t)state); switch (state) { 25d08: cc 23 and r28, r28 25d0a: 09 f4 brne .+2 ; 0x25d0e 25d0c: fc c0 rjmp .+504 ; 0x25f06 break; } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); 25d0e: 81 e0 ldi r24, 0x01 ; 1 25d10: 0e 94 c0 69 call 0xd380 ; 0xd380 lcd_update(2); 25d14: 82 e0 ldi r24, 0x02 ; 2 } 25d16: cf 91 pop r28 25d18: 1f 91 pop r17 25d1a: 0f 91 pop r16 25d1c: ff 90 pop r15 25d1e: ef 90 pop r14 25d20: df 90 pop r13 25d22: cf 90 pop r12 25d24: bf 90 pop r11 25d26: af 90 pop r10 } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); lcd_update(2); 25d28: 0c 94 42 69 jmp 0xd284 ; 0xd284 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 25d2c: 10 92 8e 03 sts 0x038E, r1 ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.408> case S::Restore: // clear any previous error for make _new_ errors visible lcd_reset_alert_level(); // determine the next step in the required order if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { 25d30: 81 e0 ldi r24, 0x01 ; 1 25d32: 0e 94 55 d8 call 0x1b0aa ; 0x1b0aa state = S::Selftest; 25d36: c2 e0 ldi r28, 0x02 ; 2 case S::Restore: // clear any previous error for make _new_ errors visible lcd_reset_alert_level(); // determine the next step in the required order if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { 25d38: 88 23 and r24, r24 25d3a: 09 f4 brne .+2 ; 0x25d3e 25d3c: 85 cf rjmp .-246 ; 0x25c48 state = S::Selftest; } else if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 25d3e: 82 e0 ldi r24, 0x02 ; 2 25d40: 0e 94 55 d8 call 0x1b0aa ; 0x1b0aa // S::Xyz *includes* S::Z so it needs to come before // to avoid repeating Z alignment state = S::Xyz; 25d44: c3 e0 ldi r28, 0x03 ; 3 lcd_reset_alert_level(); // determine the next step in the required order if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { state = S::Selftest; } else if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 25d46: 88 23 and r24, r24 25d48: 09 f4 brne .+2 ; 0x25d4c 25d4a: 7e cf rjmp .-260 ; 0x25c48 // S::Xyz *includes* S::Z so it needs to come before // to avoid repeating Z alignment state = S::Xyz; } else if (!calibration_status_get(CALIBRATION_STATUS_Z)) { 25d4c: 84 e0 ldi r24, 0x04 ; 4 25d4e: 0e 94 55 d8 call 0x1b0aa ; 0x1b0aa state = S::Z; 25d52: c4 e0 ldi r28, 0x04 ; 4 state = S::Selftest; } else if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { // S::Xyz *includes* S::Z so it needs to come before // to avoid repeating Z alignment state = S::Xyz; } else if (!calibration_status_get(CALIBRATION_STATUS_Z)) { 25d54: 88 23 and r24, r24 25d56: 09 f4 brne .+2 ; 0x25d5a 25d58: 77 cf rjmp .-274 ; 0x25c48 state = S::Z; #ifdef THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL)) { state = S::ThermalModel; #endif //THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) { 25d5a: 80 e1 ldi r24, 0x10 ; 16 25d5c: 0e 94 55 d8 call 0x1b0aa ; 0x1b0aa state = S::IsFil; 25d60: c5 e0 ldi r28, 0x05 ; 5 state = S::Z; #ifdef THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL)) { state = S::ThermalModel; #endif //THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) { 25d62: 88 23 and r24, r24 25d64: 09 f4 brne .+2 ; 0x25d68 25d66: 70 cf rjmp .-288 ; 0x25c48 state = S::IsFil; } else { // all required steps completed, finish successfully state = S::Finish; 25d68: cc e0 ldi r28, 0x0C ; 12 25d6a: 6e cf rjmp .-292 ; 0x25c48 } break; case S::Selftest: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_SELFTEST)); 25d6c: 8f ec ldi r24, 0xCF ; 207 25d6e: 93 e5 ldi r25, 0x53 ; 83 25d70: 0e 94 b1 6c call 0xd962 ; 0xd962 25d74: 0f 94 47 0b call 0x2168e ; 0x2168e wizard_event = lcd_selftest(); 25d78: 0e 94 f1 f3 call 0x1e7e2 ; 0x1e7e2 state = (wizard_event ? S::Restore : S::Failed); break; case S::Xyz: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_XYZ_CAL)); wizard_event = gcode_M45(false, 0); state = (wizard_event ? S::Restore : S::Failed); 25d7c: 81 11 cpse r24, r1 25d7e: a6 cf rjmp .-180 ; 0x25ccc } break; case S::Selftest: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_SELFTEST)); wizard_event = lcd_selftest(); state = (wizard_event ? S::Restore : S::Failed); 25d80: cd e0 ldi r28, 0x0D ; 13 25d82: 62 cf rjmp .-316 ; 0x25c48 break; case S::Xyz: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_XYZ_CAL)); 25d84: 81 e9 ldi r24, 0x91 ; 145 25d86: 93 e5 ldi r25, 0x53 ; 83 25d88: 0e 94 b1 6c call 0xd962 ; 0xd962 25d8c: 0f 94 47 0b call 0x2168e ; 0x2168e wizard_event = gcode_M45(false, 0); 25d90: 80 e0 ldi r24, 0x00 ; 0 25d92: 0e 94 93 c6 call 0x18d26 ; 0x18d26 25d96: f2 cf rjmp .-28 ; 0x25d7c state = (wizard_event ? S::Restore : S::Failed); break; case S::Z: lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_SHIPPING_HELPERS)); 25d98: 89 e6 ldi r24, 0x69 ; 105 25d9a: 93 e5 ldi r25, 0x53 ; 83 25d9c: 0e 94 b1 6c call 0xd962 ; 0xd962 25da0: 0f 94 47 0b call 0x2168e ; 0x2168e lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_TEST_PRINT)); 25da4: 8b e3 ldi r24, 0x3B ; 59 25da6: 93 e5 ldi r25, 0x53 ; 83 25da8: 0e 94 b1 6c call 0xd962 ; 0xd962 25dac: 0f 94 47 0b call 0x2168e ; 0x2168e lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_Z_CAL)); 25db0: 8b e1 ldi r24, 0x1B ; 27 25db2: 93 e5 ldi r25, 0x53 ; 83 25db4: 0e 94 b1 6c call 0xd962 ; 0xd962 25db8: 0f 94 47 0b call 0x2168e ; 0x2168e wizard_event = gcode_M45(true, 0); 25dbc: 81 e0 ldi r24, 0x01 ; 1 25dbe: 0e 94 93 c6 call 0x18d26 ; 0x18d26 if (!wizard_event) { 25dc2: 88 23 and r24, r24 25dc4: e9 f2 breq .-70 ; 0x25d80 state = S::Failed; } else { raise_z_above(MIN_Z_FOR_SWAP); 25dc6: 60 e0 ldi r22, 0x00 ; 0 25dc8: 70 e0 ldi r23, 0x00 ; 0 25dca: 88 ed ldi r24, 0xD8 ; 216 25dcc: 91 e4 ldi r25, 0x41 ; 65 25dce: 0e 94 3f 67 call 0xce7e ; 0xce7e if(!MMU2::mmu2.Enabled()) { 25dd2: 80 91 94 12 lds r24, 0x1294 ; 0x801294 25dd6: 81 30 cpi r24, 0x01 ; 1 25dd8: 09 f4 brne .+2 ; 0x25ddc 25dda: 78 cf rjmp .-272 ; 0x25ccc return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 25ddc: d0 92 f2 11 sts 0x11F2, r13 ; 0x8011f2 25de0: c0 92 f1 11 sts 0x11F1, r12 ; 0x8011f1 //current filament needs to be unloaded and then new filament should be loaded //start to preheat nozzle for unloading remaining PLA filament setTargetHotend(PLA_PREHEAT_HOTEND_TEMP); lcd_display_message_fullscreen_P(_T(MSG_WIZARD_WILL_PREHEAT)); 25de4: 86 ef ldi r24, 0xF6 ; 246 25de6: 92 e5 ldi r25, 0x52 ; 82 25de8: 0e 94 b1 6c call 0xd962 ; 0xd962 25dec: 0f 94 c0 0a call 0x21580 ; 0x21580 wait_preheat(); 25df0: 0f 94 cd 0a call 0x2159a ; 0x2159a unload_filament(FILAMENTCHANGE_FINALRETRACT); // unload current filament 25df4: 60 e0 ldi r22, 0x00 ; 0 25df6: 70 e0 ldi r23, 0x00 ; 0 25df8: cb 01 movw r24, r22 25dfa: 0e 94 4c f0 call 0x1e098 ; 0x1e098 lcd_wizard_load(); // load filament 25dfe: 0f 94 b0 0b call 0x21760 ; 0x21760 25e02: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 25e06: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 25e0a: 60 cf rjmp .-320 ; 0x25ccc 25e0c: d0 92 f2 11 sts 0x11F2, r13 ; 0x8011f2 25e10: c0 92 f1 11 sts 0x11F1, r12 ; 0x8011f1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 25e14: b0 92 ee 11 sts 0x11EE, r11 ; 0x8011ee 25e18: a0 92 ed 11 sts 0x11ED, r10 ; 0x8011ed #endif //THERMAL_MODEL case S::IsFil: //start to preheat nozzle and bed to save some time later setTargetHotend(PLA_PREHEAT_HOTEND_TEMP); setTargetBed(PLA_PREHEAT_HPB_TEMP); wizard_event = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_FILAMENT_LOADED), false, LCD_MIDDLE_BUTTON_CHOICE); 25e1c: 80 ee ldi r24, 0xE0 ; 224 25e1e: 92 e5 ldi r25, 0x52 ; 82 25e20: 0e 94 b1 6c call 0xd962 ; 0xd962 25e24: 41 e0 ldi r20, 0x01 ; 1 25e26: 60 e0 ldi r22, 0x00 ; 0 25e28: 0f 94 e0 2d call 0x25bc0 ; 0x25bc0 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 25e2c: 88 23 and r24, r24 25e2e: 09 f1 breq .+66 ; 0x25e72 state = S::Lay1CalCold; } else { // MIDDLE_BUTTON_CHOICE if(MMU2::mmu2.Enabled()) state = S::LoadFilCold; 25e30: 80 91 94 12 lds r24, 0x1294 ; 0x801294 25e34: c7 e0 ldi r28, 0x07 ; 7 25e36: 81 30 cpi r24, 0x01 ; 1 25e38: 09 f4 brne .+2 ; 0x25e3c 25e3a: 06 cf rjmp .-500 ; 0x25c48 else state = S::Preheat; 25e3c: c6 e0 ldi r28, 0x06 ; 6 25e3e: 04 cf rjmp .-504 ; 0x25c48 } break; case S::Preheat: menu_goto(lcd_preheat_menu, 0, true); 25e40: 20 e0 ldi r18, 0x00 ; 0 25e42: 41 e0 ldi r20, 0x01 ; 1 25e44: 70 e0 ldi r23, 0x00 ; 0 25e46: 60 e0 ldi r22, 0x00 ; 0 25e48: 83 e7 ldi r24, 0x73 ; 115 25e4a: 98 e3 ldi r25, 0x38 ; 56 25e4c: 0f 94 e6 92 call 0x325cc ; 0x325cc lcd_show_fullscreen_message_and_wait_P(_T(MSG_SEL_PREHEAT_TEMP)); 25e50: 8f e9 ldi r24, 0x9F ; 159 25e52: 92 e5 ldi r25, 0x52 ; 82 25e54: 0e 94 b1 6c call 0xd962 ; 0xd962 25e58: 0f 94 47 0b call 0x2168e ; 0x2168e if (state != S::Run) eeprom_update_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); FORCE_BL_ON_START; while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 25e5c: 06 e0 ldi r16, 0x06 ; 6 25e5e: 10 e0 ldi r17, 0x00 ; 0 25e60: 3f cf rjmp .-386 ; 0x25ce0 menu_goto(lcd_preheat_menu, 0, true); lcd_show_fullscreen_message_and_wait_P(_T(MSG_SEL_PREHEAT_TEMP)); end = true; // Leave wizard temporarily for lcd_preheat_menu break; case S::LoadFilHot: wait_preheat(); 25e62: 0f 94 cd 0a call 0x2159a ; 0x2159a lcd_wizard_load(); 25e66: 0f 94 b0 0b call 0x21760 ; 0x21760 state = S::Lay1CalHot; 25e6a: ca e0 ldi r28, 0x0A ; 10 25e6c: ed ce rjmp .-550 ; 0x25c48 break; case S::LoadFilCold: lcd_wizard_load(); 25e6e: 0f 94 b0 0b call 0x21760 ; 0x21760 case S::RepeatLay1Cal: wizard_event = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_WIZARD_REPEAT_V2_CAL), false); if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_CLEAN_HEATBED)); state = S::Lay1CalCold; 25e72: c9 e0 ldi r28, 0x09 ; 9 25e74: e9 ce rjmp .-558 ; 0x25c48 case S::LoadFilCold: lcd_wizard_load(); state = S::Lay1CalCold; break; case S::Lay1CalCold: wizard_lay1cal_message(true); 25e76: 81 e0 ldi r24, 0x01 ; 1 25e78: 0f 94 92 0b call 0x21724 ; 0x21724 menu_goto(lcd_v2_calibration, 0, true); 25e7c: 20 e0 ldi r18, 0x00 ; 0 25e7e: 41 e0 ldi r20, 0x01 ; 1 25e80: 70 e0 ldi r23, 0x00 ; 0 25e82: 60 e0 ldi r22, 0x00 ; 0 25e84: 8f ef ldi r24, 0xFF ; 255 25e86: 96 e3 ldi r25, 0x36 ; 54 25e88: 0f 94 e6 92 call 0x325cc ; 0x325cc if (state != S::Run) eeprom_update_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); FORCE_BL_ON_START; while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 25e8c: 09 e0 ldi r16, 0x09 ; 9 25e8e: 10 e0 ldi r17, 0x00 ; 0 25e90: 27 cf rjmp .-434 ; 0x25ce0 wizard_lay1cal_message(true); menu_goto(lcd_v2_calibration, 0, true); end = true; // Leave wizard temporarily for lcd_v2_calibration break; case S::Lay1CalHot: wizard_lay1cal_message(false); 25e92: 80 e0 ldi r24, 0x00 ; 0 25e94: 0f 94 92 0b call 0x21724 ; 0x21724 lcd_commands_type = LcdCommands::Layer1Cal; 25e98: 84 e0 ldi r24, 0x04 ; 4 25e9a: 80 93 c8 0d sts 0x0DC8, r24 ; 0x800dc8 if (state != S::Run) eeprom_update_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); FORCE_BL_ON_START; while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 25e9e: 0a e0 ldi r16, 0x0A ; 10 25ea0: 10 e0 ldi r17, 0x00 ; 0 25ea2: 1e cf rjmp .-452 ; 0x25ce0 wizard_lay1cal_message(false); lcd_commands_type = LcdCommands::Layer1Cal; end = true; // Leave wizard temporarily for lcd_v2_calibration break; case S::RepeatLay1Cal: wizard_event = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_WIZARD_REPEAT_V2_CAL), false); 25ea4: 8c e4 ldi r24, 0x4C ; 76 25ea6: 92 e5 ldi r25, 0x52 ; 82 25ea8: 0e 94 b1 6c call 0xd962 ; 0xd962 25eac: 41 e0 ldi r20, 0x01 ; 1 25eae: 60 e0 ldi r22, 0x00 ; 0 25eb0: 0f 94 e0 2d call 0x25bc0 ; 0x25bc0 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) 25eb4: 81 11 cpse r24, r1 25eb6: 07 c0 rjmp .+14 ; 0x25ec6 { lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_CLEAN_HEATBED)); 25eb8: 8c e1 ldi r24, 0x1C ; 28 25eba: 92 e5 ldi r25, 0x52 ; 82 25ebc: 0e 94 b1 6c call 0xd962 ; 0xd962 25ec0: 0f 94 47 0b call 0x2168e ; 0x2168e 25ec4: d6 cf rjmp .-84 ; 0x25e72 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); 25ec6: 86 eb ldi r24, 0xB6 ; 182 25ec8: 91 e5 ldi r25, 0x51 ; 81 25eca: ec ce rjmp .-552 ; 0x25ca4 25ecc: 60 e0 ldi r22, 0x00 ; 0 25ece: 8f e5 ldi r24, 0x5F ; 95 25ed0: 9f e0 ldi r25, 0x0F ; 15 25ed2: 0f 94 00 a0 call 0x34000 ; 0x34000 25ed6: 04 cf rjmp .-504 ; 0x25ce0 msg = _T(MSG_WIZARD_QUIT); break; case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); 25ed8: 88 e5 ldi r24, 0x58 ; 88 25eda: 91 e5 ldi r25, 0x51 ; 81 25edc: 0e 94 b1 6c call 0xd962 ; 0xd962 25ee0: 8c 01 movw r16, r24 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 25ee2: 10 92 8e 03 sts 0x038E, r1 ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.408> case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); lcd_reset_alert_level(); lcd_setstatuspgm(MSG_WELCOME); 25ee6: 87 e6 ldi r24, 0x67 ; 103 25ee8: 9b e6 ldi r25, 0x6B ; 107 25eea: 0e 94 65 e6 call 0x1ccca ; 0x1ccca lcd_return_to_status(); 25eee: 0e 94 17 fe call 0x1fc2e ; 0x1fc2e default: // exiting for later re-entry break; } if (msg) { 25ef2: 01 15 cp r16, r1 25ef4: 11 05 cpc r17, r1 25ef6: 09 f4 brne .+2 ; 0x25efa 25ef8: 0a cf rjmp .-492 ; 0x25d0e lcd_show_fullscreen_message_and_wait_P(msg); 25efa: c8 01 movw r24, r16 25efc: 0f 94 47 0b call 0x2168e ; 0x2168e 25f00: 06 cf rjmp .-500 ; 0x25d0e lcd_return_to_status(); break; case S::Failed: // aborted due to failure msg = _T(MSG_WIZARD_CALIBRATION_FAILED); 25f02: 86 ef ldi r24, 0xF6 ; 246 25f04: 90 e5 ldi r25, 0x50 ; 80 25f06: 0e 94 b1 6c call 0xd962 ; 0xd962 25f0a: 8c 01 movw r16, r24 25f0c: f2 cf rjmp .-28 ; 0x25ef2 00025f0e : menu_goto(lcd_generic_preheat_menu, 0, true); } void lcd_wizard() { bool result = true; if (calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 25f0e: 87 e1 ldi r24, 0x17 ; 23 25f10: 0e 94 55 d8 call 0x1b0aa ; 0x1b0aa 25f14: 81 11 cpse r24, r1 25f16: 06 c0 rjmp .+12 ; 0x25f24 // calibration already performed: ask before clearing the previous status result = !lcd_show_multiscreen_message_cont_cancel_and_wait_P(_T(MSG_WIZARD_RERUN), false); } if (result) { calibration_status_clear(CALIBRATION_WIZARD_STEPS); 25f18: 87 e1 ldi r24, 0x17 ; 23 25f1a: 0e 94 31 c6 call 0x18c62 ; 0x18c62 lcd_wizard(WizState::Run); 25f1e: 80 e0 ldi r24, 0x00 ; 0 25f20: 0d 94 09 2e jmp 0x25c12 ; 0x25c12 void lcd_wizard() { bool result = true; if (calibration_status_get(CALIBRATION_WIZARD_STEPS)) { // calibration already performed: ask before clearing the previous status result = !lcd_show_multiscreen_message_cont_cancel_and_wait_P(_T(MSG_WIZARD_RERUN), false); 25f24: 8e ee ldi r24, 0xEE ; 238 25f26: 9d e4 ldi r25, 0x4D ; 77 25f28: 0e 94 b1 6c call 0xd962 ; 0xd962 25f2c: 41 e0 ldi r20, 0x01 ; 1 25f2e: 60 e0 ldi r22, 0x00 ; 0 25f30: 0f 94 b7 2d call 0x25b6e ; 0x25b6e } if (result) { 25f34: 88 23 and r24, r24 25f36: 81 f3 breq .-32 ; 0x25f18 calibration_status_clear(CALIBRATION_WIZARD_STEPS); lcd_wizard(WizState::Run); } else { lcd_return_to_status(); 25f38: 0e 94 17 fe call 0x1fc2e ; 0x1fc2e lcd_update_enable(true); 25f3c: 81 e0 ldi r24, 0x01 ; 1 25f3e: 0e 94 c0 69 call 0xd380 ; 0xd380 lcd_update(2); 25f42: 82 e0 ldi r24, 0x02 ; 2 25f44: 0c 94 42 69 jmp 0xd284 ; 0xd284 00025f48 : if (result == LCD_LEFT_BUTTON_CHOICE) { lcd_mesh_calibration_z(); } } void prompt_steel_sheet_on_bed(bool wantedState) { 25f48: cf 93 push r28 25f4a: c8 2f mov r28, r24 #ifdef STEEL_SHEET bool sheetIsOnBed = !lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false, !wantedState); 25f4c: 89 ed ldi r24, 0xD9 ; 217 25f4e: 90 e5 ldi r25, 0x50 ; 80 25f50: 0e 94 b1 6c call 0xd962 ; 0xd962 25f54: 41 e0 ldi r20, 0x01 ; 1 25f56: 4c 27 eor r20, r28 25f58: 60 e0 ldi r22, 0x00 ; 0 25f5a: 0f 94 e0 2d call 0x25bc0 ; 0x25bc0 25f5e: 91 e0 ldi r25, 0x01 ; 1 25f60: 81 11 cpse r24, r1 25f62: 90 e0 ldi r25, 0x00 ; 0 if (sheetIsOnBed != wantedState) { 25f64: c9 17 cp r28, r25 25f66: 59 f0 breq .+22 ; 0x25f7e lcd_show_fullscreen_message_and_wait_P(_T(wantedState ? MSG_PLACE_STEEL_SHEET : MSG_REMOVE_STEEL_SHEET)); 25f68: 8f ea ldi r24, 0xAF ; 175 25f6a: 90 e5 ldi r25, 0x50 ; 80 25f6c: cc 23 and r28, r28 25f6e: 11 f0 breq .+4 ; 0x25f74 25f70: 82 e5 ldi r24, 0x52 ; 82 25f72: 96 e4 ldi r25, 0x46 ; 70 25f74: 0e 94 b1 6c call 0xd962 ; 0xd962 } #endif //STEEL_SHEET } 25f78: cf 91 pop r28 void prompt_steel_sheet_on_bed(bool wantedState) { #ifdef STEEL_SHEET bool sheetIsOnBed = !lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false, !wantedState); if (sheetIsOnBed != wantedState) { lcd_show_fullscreen_message_and_wait_P(_T(wantedState ? MSG_PLACE_STEEL_SHEET : MSG_REMOVE_STEEL_SHEET)); 25f7a: 0d 94 47 0b jmp 0x2168e ; 0x2168e } #endif //STEEL_SHEET } 25f7e: cf 91 pop r28 25f80: 08 95 ret 00025f82 : } lcd_show_fullscreen_message_and_wait_P( _T(MSG_WIZARD_V2_CAL_2)); } void lcd_z_calibration_prompt(bool allowTimeouting) { 25f82: cf 93 push r28 25f84: c8 2f mov r28, r24 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_Z_CALIBRATION_PROMPT), allowTimeouting, 0); 25f86: 86 e8 ldi r24, 0x86 ; 134 25f88: 90 e5 ldi r25, 0x50 ; 80 25f8a: 0e 94 b1 6c call 0xd962 ; 0xd962 25f8e: 40 e0 ldi r20, 0x00 ; 0 25f90: 6c 2f mov r22, r28 25f92: 0f 94 e0 2d call 0x25bc0 ; 0x25bc0 if (result == LCD_LEFT_BUTTON_CHOICE) { 25f96: 81 11 cpse r24, r1 25f98: 03 c0 rjmp .+6 ; 0x25fa0 lcd_mesh_calibration_z(); } } 25f9a: cf 91 pop r28 } void lcd_z_calibration_prompt(bool allowTimeouting) { uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_Z_CALIBRATION_PROMPT), allowTimeouting, 0); if (result == LCD_LEFT_BUTTON_CHOICE) { lcd_mesh_calibration_z(); 25f9c: 0c 94 59 fe jmp 0x1fcb2 ; 0x1fcb2 } } 25fa0: cf 91 pop r28 25fa2: 08 95 ret 00025fa4 : _delay(2000); lcd_clear(); } void lcd_load_filament_color_check() { 25fa4: cf 92 push r12 25fa6: ef 92 push r14 25fa8: ff 92 push r15 25faa: 0f 93 push r16 25fac: 1f 93 push r17 25fae: cf 93 push r28 25fb0: df 93 push r29 // >Ja >Nein >Auswerfen // Hungarian // 01234567890123456789 // >Igen >Nem >Kiadás uint8_t clean = lcd_show_multiscreen_message_with_choices_and_wait_P(_T(MSG_FILAMENT_CLEAN), false, LCD_LEFT_BUTTON_CHOICE, _T(MSG_YES), _T(MSG_NO), _T(MSG_EJECT), strlen_P(_T(MSG_YES))+2); 25fb2: 82 eb ldi r24, 0xB2 ; 178 25fb4: 9d e3 ldi r25, 0x3D ; 61 25fb6: 0e 94 b1 6c call 0xd962 ; 0xd962 25fba: 0f 94 9a 9d call 0x33b34 ; 0x33b34 <__strlen_P> 25fbe: c8 2e mov r12, r24 25fc0: 8a e8 ldi r24, 0x8A ; 138 25fc2: 9a e4 ldi r25, 0x4A ; 74 25fc4: 0e 94 b1 6c call 0xd962 ; 0xd962 25fc8: 7c 01 movw r14, r24 25fca: 88 eb ldi r24, 0xB8 ; 184 25fcc: 9d e3 ldi r25, 0x3D ; 61 25fce: 0e 94 b1 6c call 0xd962 ; 0xd962 25fd2: 8c 01 movw r16, r24 25fd4: 82 eb ldi r24, 0xB2 ; 178 25fd6: 9d e3 ldi r25, 0x3D ; 61 25fd8: 0e 94 b1 6c call 0xd962 ; 0xd962 25fdc: ec 01 movw r28, r24 25fde: 8f e5 ldi r24, 0x5F ; 95 25fe0: 9a e4 ldi r25, 0x4A ; 74 25fe2: 0e 94 b1 6c call 0xd962 ; 0xd962 25fe6: c3 94 inc r12 25fe8: c3 94 inc r12 25fea: 9e 01 movw r18, r28 25fec: 40 e0 ldi r20, 0x00 ; 0 25fee: 60 e0 ldi r22, 0x00 ; 0 25ff0: 0f 94 e4 2c call 0x259c8 ; 0x259c8 while (clean == LCD_MIDDLE_BUTTON_CHOICE) { 25ff4: 81 30 cpi r24, 0x01 ; 1 25ff6: 29 f4 brne .+10 ; 0x26002 load_filament_final_feed(); 25ff8: 0e 94 75 5e call 0xbcea ; 0xbcea st_synchronize(); 25ffc: 0f 94 42 22 call 0x24484 ; 0x24484 26000: d8 cf rjmp .-80 ; 0x25fb2 clean = lcd_show_multiscreen_message_with_choices_and_wait_P(_T(MSG_FILAMENT_CLEAN), false, LCD_LEFT_BUTTON_CHOICE, _T(MSG_YES), _T(MSG_NO), _T(MSG_EJECT), strlen_P(_T(MSG_YES))+2); } if (clean == LCD_RIGHT_BUTTON_CHOICE) { 26002: 82 30 cpi r24, 0x02 ; 2 26004: 61 f4 brne .+24 ; 0x2601e unload_filament(FILAMENTCHANGE_FINALRETRACT); 26006: 60 e0 ldi r22, 0x00 ; 0 26008: 70 e0 ldi r23, 0x00 ; 0 2600a: cb 01 movw r24, r22 } } 2600c: df 91 pop r29 2600e: cf 91 pop r28 26010: 1f 91 pop r17 26012: 0f 91 pop r16 26014: ff 90 pop r15 26016: ef 90 pop r14 26018: cf 90 pop r12 load_filament_final_feed(); st_synchronize(); clean = lcd_show_multiscreen_message_with_choices_and_wait_P(_T(MSG_FILAMENT_CLEAN), false, LCD_LEFT_BUTTON_CHOICE, _T(MSG_YES), _T(MSG_NO), _T(MSG_EJECT), strlen_P(_T(MSG_YES))+2); } if (clean == LCD_RIGHT_BUTTON_CHOICE) { unload_filament(FILAMENTCHANGE_FINALRETRACT); 2601a: 0c 94 4c f0 jmp 0x1e098 ; 0x1e098 } } 2601e: df 91 pop r29 26020: cf 91 pop r28 26022: 1f 91 pop r17 26024: 0f 91 pop r16 26026: ff 90 pop r15 26028: ef 90 pop r14 2602a: cf 90 pop r12 2602c: 08 95 ret 0002602e : static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); } void mFilamentItem(uint16_t nTemp, uint16_t nTempBed) { 2602e: 0f 93 push r16 26030: 1f 93 push r17 26032: cf 93 push r28 26034: df 93 push r29 26036: 8c 01 movw r16, r24 26038: eb 01 movw r28, r22 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2603a: 90 93 f2 11 sts 0x11F2, r25 ; 0x8011f2 2603e: 80 93 f1 11 sts 0x11F1, r24 ; 0x8011f1 setTargetHotend((float)nTemp); if (!shouldPreheatOnlyNozzle()) setTargetBed((float)nTempBed); 26042: 0e 94 e3 fd call 0x1fbc6 ; 0x1fbc6 26046: 81 11 cpse r24, r1 26048: 04 c0 rjmp .+8 ; 0x26052 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2604a: d0 93 ee 11 sts 0x11EE, r29 ; 0x8011ee 2604e: c0 93 ed 11 sts 0x11ED, r28 ; 0x8011ed { const FilamentAction action = eFilamentAction; 26052: c0 91 62 03 lds r28, 0x0362 ; 0x800362 if (action == FilamentAction::Preheat || action == FilamentAction::Lay1Cal) 26056: 87 ef ldi r24, 0xF7 ; 247 26058: 8c 0f add r24, r28 2605a: 82 30 cpi r24, 0x02 ; 2 2605c: f8 f4 brcc .+62 ; 0x2609c { lcd_return_to_status(); 2605e: 0e 94 17 fe call 0x1fc2e ; 0x1fc2e if (action == FilamentAction::Lay1Cal) 26062: ca 30 cpi r28, 0x0A ; 10 26064: 41 f4 brne .+16 ; 0x26076 { lcd_commands_type = LcdCommands::Layer1Cal; 26066: 84 e0 ldi r24, 0x04 ; 4 26068: 80 93 c8 0d sts 0x0DC8, r24 ; 0x800dc8 } menu_back(); clearFilamentAction(); } } } 2606c: df 91 pop r29 2606e: cf 91 pop r28 26070: 1f 91 pop r17 26072: 0f 91 pop r16 26074: 08 95 ret { lcd_commands_type = LcdCommands::Layer1Cal; } else { raise_z_above(MIN_Z_FOR_PREHEAT); 26076: 60 e0 ldi r22, 0x00 ; 0 26078: 70 e0 ldi r23, 0x00 ; 0 2607a: 80 e2 ldi r24, 0x20 ; 32 2607c: 91 e4 ldi r25, 0x41 ; 65 2607e: 0e 94 3f 67 call 0xce7e ; 0xce7e if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 26082: 8f e5 ldi r24, 0x5F ; 95 26084: 9f e0 ldi r25, 0x0F ; 15 26086: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 2608a: 88 23 and r24, r24 2608c: 79 f3 breq .-34 ; 0x2606c lcd_wizard(WizState::LoadFilHot); 2608e: 88 e0 ldi r24, 0x08 ; 8 } menu_back(); clearFilamentAction(); } } } 26090: df 91 pop r29 26092: cf 91 pop r28 26094: 1f 91 pop r17 26096: 0f 91 pop r16 } else { raise_z_above(MIN_Z_FOR_PREHEAT); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) lcd_wizard(WizState::LoadFilHot); 26098: 0d 94 09 2e jmp 0x25c12 ; 0x25c12 2609c: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); // the current temperature is within +-TEMP_HYSTERESIS of the target // then continue with the filament action if any is set if (bFilamentSkipPreheat || abs((int)current_temperature[0] - (int)nTemp) < TEMP_HYSTERESIS) 260a0: 80 91 83 06 lds r24, 0x0683 ; 0x800683 260a4: 81 11 cpse r24, r1 260a6: 12 c0 rjmp .+36 ; 0x260cc 260a8: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 260ac: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 260b0: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 260b4: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 260b8: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 260bc: 60 1b sub r22, r16 260be: 71 0b sbc r23, r17 260c0: 6c 5f subi r22, 0xFC ; 252 260c2: 7f 4f sbci r23, 0xFF ; 255 260c4: 69 30 cpi r22, 0x09 ; 9 260c6: 71 05 cpc r23, r1 260c8: 08 f0 brcs .+2 ; 0x260cc 260ca: 60 c0 rjmp .+192 ; 0x2618c { menu_func_t filamentActionMenu = nullptr; switch (eFilamentAction) 260cc: c1 50 subi r28, 0x01 ; 1 260ce: c8 30 cpi r28, 0x08 ; 8 260d0: 88 f5 brcc .+98 ; 0x26134 260d2: ec 2f mov r30, r28 260d4: f0 e0 ldi r31, 0x00 ; 0 260d6: 88 27 eor r24, r24 260d8: ef 58 subi r30, 0x8F ; 143 260da: ff 4c sbci r31, 0xCF ; 207 260dc: 8e 4f sbci r24, 0xFE ; 254 260de: 0d 94 ec a0 jmp 0x341d8 ; 0x341d8 <__tablejump2__> 260e2: ad 36 cpi r26, 0x6D ; 109 260e4: ad 36 cpi r26, 0x6D ; 109 260e6: ad 36 cpi r26, 0x6D ; 109 260e8: 77 38 cpi r23, 0x87 ; 135 260ea: c1 37 cpi r28, 0x71 ; 113 260ec: fb 36 cpi r31, 0x6B ; 107 260ee: 35 37 cpi r19, 0x75 ; 117 260f0: 79 37 cpi r23, 0x79 ; 121 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament } break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; 260f2: c8 e6 ldi r28, 0x68 ; 104 260f4: dc eb ldi r29, 0xBC ; 188 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: // handled earlier break; } if (bFilamentWaitingFlag) { 260f6: 80 91 81 06 lds r24, 0x0681 ; 0x800681 260fa: 88 23 and r24, r24 260fc: 29 f0 breq .+10 ; 0x26108 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 260fe: 82 e0 ldi r24, 0x02 ; 2 26100: 0f 94 9f 2c call 0x2593e ; 0x2593e bFilamentWaitingFlag = false; 26104: 10 92 81 06 sts 0x0681, r1 ; 0x800681 } if (filamentActionMenu) { 26108: 20 97 sbiw r28, 0x00 ; 0 2610a: 09 f4 brne .+2 ; 0x2610e 2610c: af cf rjmp .-162 ; 0x2606c // Reset the menu stack and filament action before entering action menu mFilamentResetMenuStack(); 2610e: 0f 94 ba 06 call 0x20d74 ; 0x20d74 // The menu should clear eFilamentAction when the // 'action' is done menu_submenu(filamentActionMenu, true); 26112: 61 e0 ldi r22, 0x01 ; 1 26114: ce 01 movw r24, r28 } menu_back(); clearFilamentAction(); } } } 26116: df 91 pop r29 26118: cf 91 pop r28 2611a: 1f 91 pop r17 2611c: 0f 91 pop r16 // Reset the menu stack and filament action before entering action menu mFilamentResetMenuStack(); // The menu should clear eFilamentAction when the // 'action' is done menu_submenu(filamentActionMenu, true); 2611e: 0d 94 29 94 jmp 0x32852 ; 0x32852 switch (eFilamentAction) { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); 26122: 80 91 81 06 lds r24, 0x0681 ; 0x800681 26126: 88 23 and r24, r24 26128: 41 f0 breq .+16 ; 0x2613a 2612a: 61 e0 ldi r22, 0x01 ; 1 2612c: 81 e1 ldi r24, 0x11 ; 17 2612e: 98 e3 ldi r25, 0x38 ; 56 26130: 0f 94 29 94 call 0x32852 ; 0x32852 // the current temperature is within +-TEMP_HYSTERESIS of the target // then continue with the filament action if any is set if (bFilamentSkipPreheat || abs((int)current_temperature[0] - (int)nTemp) < TEMP_HYSTERESIS) { menu_func_t filamentActionMenu = nullptr; 26134: d0 e0 ldi r29, 0x00 ; 0 26136: c0 e0 ldi r28, 0x00 ; 0 26138: de cf rjmp .-68 ; 0x260f6 case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); else { mFilamentResetMenuStack(); 2613a: 0f 94 ba 06 call 0x20d74 ; 0x20d74 if (eFilamentAction == FilamentAction::AutoLoad) { 2613e: 80 91 62 03 lds r24, 0x0362 ; 0x800362 26142: 82 30 cpi r24, 0x02 ; 2 26144: 19 f4 brne .+6 ; 0x2614c // loading no longer cancellable eFilamentAction = FilamentAction::Load; 26146: 81 e0 ldi r24, 0x01 ; 1 26148: 80 93 62 03 sts 0x0362, r24 ; 0x800362 } if (eFilamentAction == FilamentAction::Load) 2614c: 80 91 62 03 lds r24, 0x0362 ; 0x800362 26150: 81 30 cpi r24, 0x01 ; 1 26152: 31 f4 brne .+12 ; 0x26160 enquecommand_P(MSG_M701); // load filament 26154: 61 e0 ldi r22, 0x01 ; 1 26156: 83 e9 ldi r24, 0x93 ; 147 26158: 9a e6 ldi r25, 0x6A ; 106 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament 2615a: 0e 94 af 7c call 0xf95e ; 0xf95e 2615e: ea cf rjmp .-44 ; 0x26134 eFilamentAction = FilamentAction::Load; } if (eFilamentAction == FilamentAction::Load) enquecommand_P(MSG_M701); // load filament else if (eFilamentAction == FilamentAction::UnLoad) 26160: 83 30 cpi r24, 0x03 ; 3 26162: 41 f7 brne .-48 ; 0x26134 enquecommand_P(MSG_M702); // unload filament 26164: 61 e0 ldi r22, 0x01 ; 1 26166: 8d e0 ldi r24, 0x0D ; 13 26168: 98 e6 ldi r25, 0x68 ; 104 2616a: f7 cf rjmp .-18 ; 0x2615a break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; break; case FilamentAction::MmuLoadingTest: filamentActionMenu = mmu_loading_test_menu; 2616c: c2 ee ldi r28, 0xE2 ; 226 2616e: db eb ldi r29, 0xBB ; 187 26170: c2 cf rjmp .-124 ; 0x260f6 break; case FilamentAction::MmuUnLoad: mFilamentResetMenuStack(); 26172: 0f 94 ba 06 call 0x20d74 ; 0x20d74 MMU2::mmu2.unload(); 26176: 0f 94 93 6a call 0x2d526 ; 0x2d526 // Clear the filament action. MMU Unload is currently a special edge // case in that it does not call a submenu. So we must clear the action // flag here for now clearFilamentAction(); 2617a: 0f 94 2f 0c call 0x2185e ; 0x2185e 2617e: da cf rjmp .-76 ; 0x26134 break; case FilamentAction::MmuEject: filamentActionMenu = mmu_fil_eject_menu; 26180: c0 e6 ldi r28, 0x60 ; 96 26182: dc eb ldi r29, 0xBC ; 188 26184: b8 cf rjmp .-144 ; 0x260f6 break; case FilamentAction::MmuCut: #ifdef MMU_HAS_CUTTER filamentActionMenu = mmu_cut_filament_menu; 26186: c8 e5 ldi r28, 0x58 ; 88 26188: dc eb ldi r29, 0xBC ; 188 2618a: b5 cf rjmp .-150 ; 0x260f6 menu_submenu(filamentActionMenu, true); } } else // still preheating, continue updating LCD UI { if (!bFilamentWaitingFlag || lcd_draw_update) 2618c: 80 91 81 06 lds r24, 0x0681 ; 0x800681 26190: 88 23 and r24, r24 26192: 21 f0 breq .+8 ; 0x2619c 26194: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 26198: 88 23 and r24, r24 2619a: a1 f1 breq .+104 ; 0x26204 // bFilamentWaitingFlag to distinguish: this flag is reset exactly once when entering // the menu and is used to raise the carriage *once*. In other cases, the LCD has been // modified elsewhere and needs to be redrawn in full. // reset bFilamentWaitingFlag immediately to avoid re-entry from raise_z_above()! bFilamentWaitingFlag = true; 2619c: 81 e0 ldi r24, 0x01 ; 1 2619e: 80 93 81 06 sts 0x0681, r24 ; 0x800681 // also force-enable lcd_draw_update (might be 0 when called from outside a menu) lcd_draw_update = 1; 261a2: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b lcd_clear(); 261a6: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_puts_at_P(0,3, PSTR(">")); 261aa: 41 e0 ldi r20, 0x01 ; 1 261ac: 56 e9 ldi r21, 0x96 ; 150 261ae: 63 e0 ldi r22, 0x03 ; 3 261b0: 80 e0 ldi r24, 0x00 ; 0 261b2: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_puts_at_P(1, 3, _T(MSG_CANCEL)); 261b6: 85 ee ldi r24, 0xE5 ; 229 261b8: 9d e4 ldi r25, 0x4D ; 77 261ba: 0e 94 b1 6c call 0xd962 ; 0xd962 261be: ac 01 movw r20, r24 261c0: 63 e0 ldi r22, 0x03 ; 3 261c2: 81 e0 ldi r24, 0x01 ; 1 261c4: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_set_cursor(0, 1); 261c8: 61 e0 ldi r22, 0x01 ; 1 261ca: 80 e0 ldi r24, 0x00 ; 0 261cc: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 switch (eFilamentAction) 261d0: e0 91 62 03 lds r30, 0x0362 ; 0x800362 261d4: e1 50 subi r30, 0x01 ; 1 261d6: e8 30 cpi r30, 0x08 ; 8 261d8: a8 f4 brcc .+42 ; 0x26204 261da: f0 e0 ldi r31, 0x00 ; 0 261dc: 88 27 eor r24, r24 261de: ec 50 subi r30, 0x0C ; 12 261e0: ff 4c sbci r31, 0xCF ; 207 261e2: 8e 4f sbci r24, 0xFE ; 254 261e4: 0d 94 ec a0 jmp 0x341d8 ; 0x341d8 <__tablejump2__> 261e8: a3 37 cpi r26, 0x73 ; 115 261ea: a3 37 cpi r26, 0x73 ; 115 261ec: 1f 38 cpi r17, 0x8F ; 143 261ee: a3 37 cpi r26, 0x73 ; 115 261f0: 1f 38 cpi r17, 0x8F ; 143 261f2: a5 37 cpi r26, 0x75 ; 117 261f4: 93 38 cpi r25, 0x83 ; 131 261f6: a3 37 cpi r26, 0x73 ; 115 { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_PREHEATING_TO_LOAD)); 261f8: 8f e3 ldi r24, 0x3F ; 63 261fa: 9a e4 ldi r25, 0x4A ; 74 break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 261fc: 0e 94 b1 6c call 0xd962 ; 0xd962 26200: 0e 94 66 69 call 0xd2cc ; 0xd2cc // handled earlier break; } } if (bFilamentWaitingFlag) { 26204: 80 91 81 06 lds r24, 0x0681 ; 0x800681 26208: 81 11 cpse r24, r1 lcd_print_target_temps_first_line(); 2620a: 0f 94 e1 06 call 0x20dc2 ; 0x20dc2 } if (lcd_clicked()) 2620e: 0e 94 98 6b call 0xd730 ; 0xd730 26212: 88 23 and r24, r24 26214: 09 f4 brne .+2 ; 0x26218 26216: 2a cf rjmp .-428 ; 0x2606c { // Filament action canceled while preheating bFilamentWaitingFlag = false; 26218: 10 92 81 06 sts 0x0681, r1 ; 0x800681 if (!bFilamentPreheatState) 2621c: 80 91 82 06 lds r24, 0x0682 ; 0x800682 26220: 81 11 cpse r24, r1 26222: 0e c0 rjmp .+28 ; 0x26240 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 26224: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 26228: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 { setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); 2622c: 0e 94 bd 60 call 0xc17a ; 0xc17a 26230: 81 11 cpse r24, r1 26232: 04 c0 rjmp .+8 ; 0x2623c resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 26234: 10 92 ee 11 sts 0x11EE, r1 ; 0x8011ee 26238: 10 92 ed 11 sts 0x11ED, r1 ; 0x8011ed menu_back(); 2623c: 0f 94 84 95 call 0x32b08 ; 0x32b08 } menu_back(); 26240: 0f 94 84 95 call 0x32b08 ; 0x32b08 clearFilamentAction(); } } } 26244: df 91 pop r29 26246: cf 91 pop r28 26248: 1f 91 pop r17 2624a: 0f 91 pop r16 setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); menu_back(); } menu_back(); clearFilamentAction(); 2624c: 0d 94 2f 0c jmp 0x2185e ; 0x2185e case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_PREHEATING_TO_LOAD)); break; case FilamentAction::UnLoad: case FilamentAction::MmuUnLoad: lcd_puts_P(_T(MSG_PREHEATING_TO_UNLOAD)); 26250: 88 e2 ldi r24, 0x28 ; 40 26252: 9a e4 ldi r25, 0x4A ; 74 26254: d3 cf rjmp .-90 ; 0x261fc break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); 26256: 82 e1 ldi r24, 0x12 ; 18 26258: 9a e4 ldi r25, 0x4A ; 74 2625a: d0 cf rjmp .-96 ; 0x261fc break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 2625c: 8e ef ldi r24, 0xFE ; 254 2625e: 99 e4 ldi r25, 0x49 ; 73 26260: cd cf rjmp .-102 ; 0x261fc 00026262 : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 26262: 80 93 62 03 sts 0x0362, r24 ; 0x800362 setFilamentAction(action); // For MMU: If FINDA doesn't detect filament on Cut or Eject action, // then preheating is unnecessary bFilamentSkipPreheat = ( MMU2::mmu2.Enabled() && !MMU2::mmu2.FindaDetectsFilament() && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); 26266: 40 91 94 12 lds r20, 0x1294 ; 0x801294 2626a: 20 91 f1 11 lds r18, 0x11F1 ; 0x8011f1 2626e: 30 91 f2 11 lds r19, 0x11F2 ; 0x8011f2 26272: 41 30 cpi r20, 0x01 ; 1 26274: 59 f0 breq .+22 ; 0x2628c setFilamentAction(action); // For MMU: If FINDA doesn't detect filament on Cut or Eject action, // then preheating is unnecessary bFilamentSkipPreheat = ( MMU2::mmu2.Enabled() && !MMU2::mmu2.FindaDetectsFilament() 26276: 10 92 83 06 sts 0x0683, r1 ; 0x800683 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { 2627a: 80 91 57 02 lds r24, 0x0257 ; 0x800257 2627e: 90 91 58 02 lds r25, 0x0258 ; 0x800258 26282: 28 17 cp r18, r24 26284: 39 07 cpc r19, r25 26286: 5c f4 brge .+22 ; 0x2629e bFilamentPreheatState = true; mFilamentItem(target_temperature[0], target_temperature_bed); bFilamentSkipPreheat = false; // Reset flag } else { lcd_generic_preheat_menu(); 26288: 0d 94 32 0c jmp 0x21864 ; 0x21864 setFilamentAction(action); // For MMU: If FINDA doesn't detect filament on Cut or Eject action, // then preheating is unnecessary bFilamentSkipPreheat = ( MMU2::mmu2.Enabled() && !MMU2::mmu2.FindaDetectsFilament() 2628c: 90 91 6a 12 lds r25, 0x126A ; 0x80126a 26290: 91 11 cpse r25, r1 26292: f1 cf rjmp .-30 ; 0x26276 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); 26294: 86 50 subi r24, 0x06 ; 6 26296: 82 30 cpi r24, 0x02 ; 2 26298: 70 f7 brcc .-36 ; 0x26276 setFilamentAction(action); // For MMU: If FINDA doesn't detect filament on Cut or Eject action, // then preheating is unnecessary bFilamentSkipPreheat = ( MMU2::mmu2.Enabled() && !MMU2::mmu2.FindaDetectsFilament() 2629a: 40 93 83 06 sts 0x0683, r20 ; 0x800683 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { bFilamentPreheatState = true; 2629e: 81 e0 ldi r24, 0x01 ; 1 262a0: 80 93 82 06 sts 0x0682, r24 ; 0x800682 mFilamentItem(target_temperature[0], target_temperature_bed); 262a4: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 262a8: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee 262ac: c9 01 movw r24, r18 262ae: 0f 94 17 30 call 0x2602e ; 0x2602e bFilamentSkipPreheat = false; // Reset flag 262b2: 10 92 83 06 sts 0x0683, r1 ; 0x800683 } else { lcd_generic_preheat_menu(); } } 262b6: 08 95 ret 000262b8 : { preheat_or_continue(FilamentAction::Load); } void lcd_AutoLoadFilament() { preheat_or_continue(FilamentAction::AutoLoad); 262b8: 82 e0 ldi r24, 0x02 ; 2 262ba: 0d 94 31 31 jmp 0x26262 ; 0x26262 000262be : } } static void lcd_LoadFilament() { preheat_or_continue(FilamentAction::Load); 262be: 81 e0 ldi r24, 0x01 ; 1 262c0: 0d 94 31 31 jmp 0x26262 ; 0x26262 000262c4 : MENU_END(); } static void lcd_unLoadFilament() { preheat_or_continue(FilamentAction::UnLoad); 262c4: 83 e0 ldi r24, 0x03 ; 3 262c6: 0d 94 31 31 jmp 0x26262 ; 0x26262 000262ca : } } static void mFilamentItem_farm() { bFilamentPreheatState = false; 262ca: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, FARM_PREHEAT_HPB_TEMP); 262ce: 60 e5 ldi r22, 0x50 ; 80 262d0: 70 e0 ldi r23, 0x00 ; 0 262d2: 8a ef ldi r24, 0xFA ; 250 262d4: 90 e0 ldi r25, 0x00 ; 0 262d6: 0d 94 17 30 jmp 0x2602e ; 0x2602e 000262da : } static void mFilamentItem_farm_nozzle() { bFilamentPreheatState = false; 262da: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, 0); 262de: 70 e0 ldi r23, 0x00 ; 0 262e0: 60 e0 ldi r22, 0x00 ; 0 262e2: 8a ef ldi r24, 0xFA ; 250 262e4: 90 e0 ldi r25, 0x00 ; 0 262e6: 0d 94 17 30 jmp 0x2602e ; 0x2602e 000262ea : } static void mFilamentItem_PLA() { bFilamentPreheatState = false; 262ea: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PLA_PREHEAT_HOTEND_TEMP, PLA_PREHEAT_HPB_TEMP); 262ee: 6c e3 ldi r22, 0x3C ; 60 262f0: 70 e0 ldi r23, 0x00 ; 0 262f2: 87 ed ldi r24, 0xD7 ; 215 262f4: 90 e0 ldi r25, 0x00 ; 0 262f6: 0d 94 17 30 jmp 0x2602e ; 0x2602e 000262fa : } static void mFilamentItem_PET() { bFilamentPreheatState = false; 262fa: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PET_PREHEAT_HOTEND_TEMP, PET_PREHEAT_HPB_TEMP); 262fe: 65 e5 ldi r22, 0x55 ; 85 26300: 70 e0 ldi r23, 0x00 ; 0 26302: 86 ee ldi r24, 0xE6 ; 230 26304: 90 e0 ldi r25, 0x00 ; 0 26306: 0d 94 17 30 jmp 0x2602e ; 0x2602e 0002630a : } static void mFilamentItem_ASA() { bFilamentPreheatState = false; 2630a: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(ASA_PREHEAT_HOTEND_TEMP, ASA_PREHEAT_HPB_TEMP); 2630e: 69 e6 ldi r22, 0x69 ; 105 26310: 70 e0 ldi r23, 0x00 ; 0 26312: 84 e0 ldi r24, 0x04 ; 4 26314: 91 e0 ldi r25, 0x01 ; 1 26316: 0d 94 17 30 jmp 0x2602e ; 0x2602e 0002631a : } static void mFilamentItem_PC() { bFilamentPreheatState = false; 2631a: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); 2631e: 69 e6 ldi r22, 0x69 ; 105 26320: 70 e0 ldi r23, 0x00 ; 0 26322: 83 e1 ldi r24, 0x13 ; 19 26324: 91 e0 ldi r25, 0x01 ; 1 26326: 0d 94 17 30 jmp 0x2602e ; 0x2602e 0002632a : mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); } static void mFilamentItem_PVB() { bFilamentPreheatState = false; 2632a: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); 2632e: 6b e4 ldi r22, 0x4B ; 75 26330: 70 e0 ldi r23, 0x00 ; 0 26332: 87 ed ldi r24, 0xD7 ; 215 26334: 90 e0 ldi r25, 0x00 ; 0 26336: 0d 94 17 30 jmp 0x2602e ; 0x2602e 0002633a : mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); } static void mFilamentItem_PA() { bFilamentPreheatState = false; 2633a: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); 2633e: 6a e5 ldi r22, 0x5A ; 90 26340: 70 e0 ldi r23, 0x00 ; 0 26342: 83 e1 ldi r24, 0x13 ; 19 26344: 91 e0 ldi r25, 0x01 ; 1 26346: 0d 94 17 30 jmp 0x2602e ; 0x2602e 0002634a : mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); } static void mFilamentItem_ABS() { bFilamentPreheatState = false; 2634a: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); 2634e: 64 e6 ldi r22, 0x64 ; 100 26350: 70 e0 ldi r23, 0x00 ; 0 26352: 8f ef ldi r24, 0xFF ; 255 26354: 90 e0 ldi r25, 0x00 ; 0 26356: 0d 94 17 30 jmp 0x2602e ; 0x2602e 0002635a : mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); } static void mFilamentItem_HIPS() { bFilamentPreheatState = false; 2635a: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(HIPS_PREHEAT_HOTEND_TEMP, HIPS_PREHEAT_HPB_TEMP); 2635e: 64 e6 ldi r22, 0x64 ; 100 26360: 70 e0 ldi r23, 0x00 ; 0 26362: 8c ed ldi r24, 0xDC ; 220 26364: 90 e0 ldi r25, 0x00 ; 0 26366: 0d 94 17 30 jmp 0x2602e ; 0x2602e 0002636a : } static void mFilamentItem_PP() { bFilamentPreheatState = false; 2636a: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PP_PREHEAT_HOTEND_TEMP, PP_PREHEAT_HPB_TEMP); 2636e: 64 e6 ldi r22, 0x64 ; 100 26370: 70 e0 ldi r23, 0x00 ; 0 26372: 8e ef ldi r24, 0xFE ; 254 26374: 90 e0 ldi r25, 0x00 ; 0 26376: 0d 94 17 30 jmp 0x2602e ; 0x2602e 0002637a : } static void mFilamentItem_FLEX() { bFilamentPreheatState = false; 2637a: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); 2637e: 62 e3 ldi r22, 0x32 ; 50 26380: 70 e0 ldi r23, 0x00 ; 0 26382: 80 ef ldi r24, 0xF0 ; 240 26384: 90 e0 ldi r25, 0x00 ; 0 26386: 0d 94 17 30 jmp 0x2602e ; 0x2602e 0002638a : } Sound_SaveMode(); } //if critical is true then silend and once mode is ignored void __attribute__((noinline)) Sound_MakeCustom(uint16_t ms,uint16_t tone_,bool critical){ 2638a: cf 92 push r12 2638c: df 92 push r13 2638e: ef 92 push r14 26390: ff 92 push r15 if (critical || eSoundMode != e_SOUND_MODE_SILENT) { 26392: 41 11 cpse r20, r1 26394: 04 c0 rjmp .+8 ; 0x2639e 26396: 20 91 15 04 lds r18, 0x0415 ; 0x800415 2639a: 22 30 cpi r18, 0x02 ; 2 2639c: 61 f0 breq .+24 ; 0x263b6 2639e: 9b 01 movw r18, r22 263a0: 6c 01 movw r12, r24 263a2: f1 2c mov r15, r1 263a4: e1 2c mov r14, r1 if(!tone_) { 263a6: 67 2b or r22, r23 263a8: 59 f4 brne .+22 ; 0x263c0 WRITE(BEEPER, HIGH); 263aa: 72 9a sbi 0x0e, 2 ; 14 _delay(ms); 263ac: c7 01 movw r24, r14 263ae: b6 01 movw r22, r12 263b0: 0f 94 7b 0d call 0x21af6 ; 0x21af6 OCR4A = 255U; // Disable Output compare A interrupt and timer overflow interrupt TIMSK4 &= ~(_BV(OCIE4A) | _BV(TOIE4)); CRITICAL_SECTION_END; // Turn beeper off if it was on when noTone was called WRITE(BEEPER, 0); 263b4: 72 98 cbi 0x0e, 2 ; 14 _tone(BEEPER, tone_); _delay(ms); _noTone(BEEPER); } } } 263b6: ff 90 pop r15 263b8: ef 90 pop r14 263ba: df 90 pop r13 263bc: cf 90 pop r12 263be: 08 95 ret void tone4(_UNUSED uint8_t _pin, uint16_t frequency) { //this ocr and prescalarbits calculation is taken from the Arduino core and simplified for one type of timer only uint8_t prescalarbits = 0b001; uint32_t pwm_freq = F_CPU / (2 * frequency); 263c0: 22 0f add r18, r18 263c2: 33 1f adc r19, r19 263c4: 50 e0 ldi r21, 0x00 ; 0 263c6: 40 e0 ldi r20, 0x00 ; 0 263c8: 60 e0 ldi r22, 0x00 ; 0 263ca: 74 e2 ldi r23, 0x24 ; 36 263cc: 84 ef ldi r24, 0xF4 ; 244 263ce: 90 e0 ldi r25, 0x00 ; 0 263d0: 0f 94 cd a0 call 0x3419a ; 0x3419a <__divmodsi4> } void tone4(_UNUSED uint8_t _pin, uint16_t frequency) { //this ocr and prescalarbits calculation is taken from the Arduino core and simplified for one type of timer only uint8_t prescalarbits = 0b001; 263d4: 91 e0 ldi r25, 0x01 ; 1 uint32_t pwm_freq = F_CPU / (2 * frequency); if (pwm_freq > UINT16_MAX) { 263d6: 21 15 cp r18, r1 263d8: 31 05 cpc r19, r1 263da: 81 e0 ldi r24, 0x01 ; 1 263dc: 48 07 cpc r20, r24 263de: 51 05 cpc r21, r1 263e0: 44 f0 brlt .+16 ; 0x263f2 pwm_freq /= 64; // Increase prescaler to 64 263e2: 86 e0 ldi r24, 0x06 ; 6 263e4: 56 95 lsr r21 263e6: 47 95 ror r20 263e8: 37 95 ror r19 263ea: 27 95 ror r18 263ec: 8a 95 dec r24 263ee: d1 f7 brne .-12 ; 0x263e4 prescalarbits = 0b011; 263f0: 93 e0 ldi r25, 0x03 ; 3 } uint16_t ocr = pwm_freq - 1; 263f2: 21 50 subi r18, 0x01 ; 1 263f4: 31 09 sbc r19, r1 CRITICAL_SECTION_START; 263f6: 4f b7 in r20, 0x3f ; 63 263f8: f8 94 cli // Set calcualted prescaler TCCR4B = (TCCR4B & 0b11111000) | prescalarbits; 263fa: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 263fe: 88 7f andi r24, 0xF8 ; 248 26400: 89 2b or r24, r25 26402: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> #ifdef EXTRUDER_0_AUTO_FAN_PIN // Scale the fan PWM duty cycle so that it remains constant, but at the tone frequency OCR4C = (OCR4C * ocr) / (uint16_t)((TIMSK4 & _BV(OCIE4A)) ? OCR4A : 255U); 26406: 60 91 ac 00 lds r22, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 2640a: 70 91 ad 00 lds r23, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2640e: 26 9f mul r18, r22 26410: c0 01 movw r24, r0 26412: 27 9f mul r18, r23 26414: 90 0d add r25, r0 26416: 36 9f mul r19, r22 26418: 90 0d add r25, r0 2641a: 11 24 eor r1, r1 2641c: 50 91 72 00 lds r21, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 26420: 6f ef ldi r22, 0xFF ; 255 26422: 70 e0 ldi r23, 0x00 ; 0 26424: 51 ff sbrs r21, 1 26426: 04 c0 rjmp .+8 ; 0x26430 26428: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 2642c: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 26430: 0f 94 a5 a0 call 0x3414a ; 0x3414a <__udivmodhi4> 26434: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 26438: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN // Set calcualted ocr OCR4A = ocr; 2643c: 30 93 a9 00 sts 0x00A9, r19 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 26440: 20 93 a8 00 sts 0x00A8, r18 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> // Enable Output compare A interrupt and timer overflow interrupt TIMSK4 |= _BV(OCIE4A) | _BV(TOIE4); 26444: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 26448: 83 60 ori r24, 0x03 ; 3 2644a: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 2644e: 4f bf out 0x3f, r20 ; 63 WRITE(BEEPER, HIGH); _delay(ms); WRITE(BEEPER, LOW); } else { _tone(BEEPER, tone_); _delay(ms); 26450: c7 01 movw r24, r14 26452: b6 01 movw r22, r12 26454: 0f 94 7b 0d call 0x21af6 ; 0x21af6 } void noTone4(_UNUSED uint8_t _pin) { CRITICAL_SECTION_START; 26458: 2f b7 in r18, 0x3f ; 63 2645a: f8 94 cli // Revert prescaler to CLK/1024 TCCR4B = (TCCR4B & 0b11111000) | _BV(CS42) | _BV(CS40); 2645c: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 26460: 88 7f andi r24, 0xF8 ; 248 26462: 85 60 ori r24, 0x05 ; 5 26464: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> #ifdef EXTRUDER_0_AUTO_FAN_PIN // Scale the fan OCR back to the original value. OCR4C = (OCR4C * 255U) / (uint16_t)((TIMSK4 & _BV(OCIE4A)) ? OCR4A : 255U); 26468: 40 91 ac 00 lds r20, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 2646c: 50 91 ad 00 lds r21, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 26470: 3f ef ldi r19, 0xFF ; 255 26472: 34 9f mul r19, r20 26474: c0 01 movw r24, r0 26476: 35 9f mul r19, r21 26478: 90 0d add r25, r0 2647a: 11 24 eor r1, r1 2647c: 30 91 72 00 lds r19, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 26480: 6f ef ldi r22, 0xFF ; 255 26482: 70 e0 ldi r23, 0x00 ; 0 26484: 31 ff sbrs r19, 1 26486: 04 c0 rjmp .+8 ; 0x26490 26488: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 2648c: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 26490: 0f 94 a5 a0 call 0x3414a ; 0x3414a <__udivmodhi4> 26494: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 26498: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN OCR4A = 255U; 2649c: 8f ef ldi r24, 0xFF ; 255 2649e: 90 e0 ldi r25, 0x00 ; 0 264a0: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 264a4: 80 93 a8 00 sts 0x00A8, r24 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> // Disable Output compare A interrupt and timer overflow interrupt TIMSK4 &= ~(_BV(OCIE4A) | _BV(TOIE4)); 264a8: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 264ac: 8c 7f andi r24, 0xFC ; 252 264ae: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 264b2: 2f bf out 0x3f, r18 ; 63 264b4: 7f cf rjmp .-258 ; 0x263b4 000264b6 : } void handle_temp_error(); void manage_heater() { 264b6: cf 92 push r12 264b8: df 92 push r13 264ba: ef 92 push r14 264bc: ff 92 push r15 264be: 0f 93 push r16 264c0: 1f 93 push r17 264c2: cf 93 push r28 264c4: df 93 push r29 264c6: 1f 92 push r1 264c8: 1f 92 push r1 264ca: cd b7 in r28, 0x3d ; 61 264cc: de b7 in r29, 0x3e ; 62 #ifdef WATCHDOG wdt_reset(); 264ce: a8 95 wdr #endif //WATCHDOG // limit execution to the same rate as temp_mgr (low-level fault handling is already handled - // any remaining error handling is just user-facing and can wait one extra cycle) if(!temp_meas_ready) 264d0: 80 91 42 06 lds r24, 0x0642 ; 0x800642 264d4: 88 23 and r24, r24 264d6: 09 f4 brne .+2 ; 0x264da 264d8: 29 c2 rjmp .+1106 ; 0x2692c return; // syncronize temperatures with isr updateTemperatures(); 264da: 0e 94 ec fa call 0x1f5d8 ; 0x1f5d8 if(thermal_model::warning_state.warning) thermal_model::handle_warning(); #endif // handle temperature errors if(temp_error_state.v) 264de: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 264e2: 88 23 and r24, r24 264e4: 89 f1 breq .+98 ; 0x26548 #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 264e6: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 264ea: 82 95 swap r24 264ec: 86 95 lsr r24 264ee: 87 70 andi r24, 0x07 ; 7 264f0: 81 30 cpi r24, 0x01 ; 1 264f2: 01 f1 breq .+64 ; 0x26534 264f4: 08 f4 brcc .+2 ; 0x264f8 264f6: be c1 rjmp .+892 ; 0x26874 264f8: 84 30 cpi r24, 0x04 ; 4 264fa: 30 f5 brcc .+76 ; 0x26548 #endif } break; case TempErrorType::preheat: case TempErrorType::runaway: switch((TempErrorSource)temp_error_state.source) { 264fc: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 26500: 86 95 lsr r24 26502: 86 95 lsr r24 26504: 83 70 andi r24, 0x03 ; 3 26506: 82 30 cpi r24, 0x02 ; 2 26508: f8 f4 brcc .+62 ; 0x26548 case TempErrorSource::hotend: case TempErrorSource::bed: temp_runaway_stop( ((TempErrorType)temp_error_state.type == TempErrorType::preheat), ((TempErrorSource)temp_error_state.source == TempErrorSource::bed)); 2650a: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 2650e: 86 95 lsr r24 26510: 86 95 lsr r24 26512: 83 70 andi r24, 0x03 ; 3 case TempErrorType::runaway: switch((TempErrorSource)temp_error_state.source) { case TempErrorSource::hotend: case TempErrorSource::bed: temp_runaway_stop( ((TempErrorType)temp_error_state.type == TempErrorType::preheat), 26514: 90 91 9a 03 lds r25, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 26518: 92 95 swap r25 2651a: 96 95 lsr r25 2651c: 97 70 andi r25, 0x07 ; 7 case TempErrorType::preheat: case TempErrorType::runaway: switch((TempErrorSource)temp_error_state.source) { case TempErrorSource::hotend: case TempErrorSource::bed: temp_runaway_stop( 2651e: 61 e0 ldi r22, 0x01 ; 1 26520: 81 30 cpi r24, 0x01 ; 1 26522: 09 f0 breq .+2 ; 0x26526 26524: 60 e0 ldi r22, 0x00 ; 0 26526: 81 e0 ldi r24, 0x01 ; 1 26528: 92 30 cpi r25, 0x02 ; 2 2652a: 09 f0 breq .+2 ; 0x2652e 2652c: 80 e0 ldi r24, 0x00 ; 0 2652e: 0f 94 75 09 call 0x212ea ; 0x212ea 26532: 0a c0 rjmp .+20 ; 0x26548 void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { case TempErrorType::min: switch((TempErrorSource)temp_error_state.source) { 26534: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 26538: 86 95 lsr r24 2653a: 86 95 lsr r24 2653c: 83 70 andi r24, 0x03 ; 3 2653e: 09 f4 brne .+2 ; 0x26542 26540: 4b c1 rjmp .+662 ; 0x267d8 26542: 81 30 cpi r24, 0x01 ; 1 26544: 09 f4 brne .+2 ; 0x26548 26546: 79 c1 rjmp .+754 ; 0x2683a #ifndef DEBUG_DISABLE_FANCHECK #if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) #ifdef FAN_SOFT_PWM #ifdef FANCHECK if ((_millis() - extruder_autofan_last_check > FAN_CHECK_PERIOD) && (!fan_measuring)) { 26548: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 2654c: 00 91 8d 16 lds r16, 0x168D ; 0x80168d 26550: 10 91 8e 16 lds r17, 0x168E ; 0x80168e 26554: 20 91 8f 16 lds r18, 0x168F ; 0x80168f 26558: 30 91 90 16 lds r19, 0x1690 ; 0x801690 2655c: 60 1b sub r22, r16 2655e: 71 0b sbc r23, r17 26560: 82 0b sbc r24, r18 26562: 93 0b sbc r25, r19 26564: 69 38 cpi r22, 0x89 ; 137 26566: 73 41 sbci r23, 0x13 ; 19 26568: 81 05 cpc r24, r1 2656a: 91 05 cpc r25, r1 2656c: d0 f0 brcs .+52 ; 0x265a2 2656e: 80 91 84 03 lds r24, 0x0384 ; 0x800384 26572: 81 11 cpse r24, r1 26574: 16 c0 rjmp .+44 ; 0x265a2 extruder_autofan_last_check = _millis(); 26576: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 2657a: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d 2657e: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e 26582: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f 26586: 90 93 90 16 sts 0x1690, r25 ; 0x801690 fanSpeedBckp = fanSpeedSoftPwm; 2658a: 80 91 05 05 lds r24, 0x0505 ; 0x800505 2658e: 80 93 67 02 sts 0x0267, r24 ; 0x800267 if (fanSpeedSoftPwm >= MIN_PRINT_FAN_SPEED) { //if we are in rage where we are doing fan check, set full PWM range for a short time to measure fan RPM by reading tacho signal without modulation by PWM signal 26592: 8b 34 cpi r24, 0x4B ; 75 26594: 18 f0 brcs .+6 ; 0x2659c // printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = 255; 26596: 8f ef ldi r24, 0xFF ; 255 26598: 80 93 05 05 sts 0x0505, r24 ; 0x800505 } fan_measuring = true; 2659c: 81 e0 ldi r24, 0x01 ; 1 2659e: 80 93 84 03 sts 0x0384, r24 ; 0x800384 } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { 265a2: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 265a6: 00 91 8d 16 lds r16, 0x168D ; 0x80168d 265aa: 10 91 8e 16 lds r17, 0x168E ; 0x80168e 265ae: 20 91 8f 16 lds r18, 0x168F ; 0x80168f 265b2: 30 91 90 16 lds r19, 0x1690 ; 0x801690 265b6: 60 1b sub r22, r16 265b8: 71 0b sbc r23, r17 265ba: 82 0b sbc r24, r18 265bc: 93 0b sbc r25, r19 265be: 65 36 cpi r22, 0x65 ; 101 265c0: 71 05 cpc r23, r1 265c2: 81 05 cpc r24, r1 265c4: 91 05 cpc r25, r1 265c6: 08 f4 brcc .+2 ; 0x265ca 265c8: a5 c1 rjmp .+842 ; 0x26914 265ca: 80 91 84 03 lds r24, 0x0384 ; 0x800384 265ce: 88 23 and r24, r24 265d0: 09 f4 brne .+2 ; 0x265d4 265d2: a0 c1 rjmp .+832 ; 0x26914 #if (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1))))) void countFanSpeed() { //SERIAL_ECHOPGM("edge counter 1:"); MYSERIAL.println(fan_edge_counter[1]); fan_speed[0] = (fan_edge_counter[0] * (float(250) / (_millis() - extruder_autofan_last_check))); 265d4: 60 91 22 06 lds r22, 0x0622 ; 0x800622 265d8: 70 91 23 06 lds r23, 0x0623 ; 0x800623 265dc: 07 2e mov r0, r23 265de: 00 0c add r0, r0 265e0: 88 0b sbc r24, r24 265e2: 99 0b sbc r25, r25 265e4: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 265e8: 6b 01 movw r12, r22 265ea: 7c 01 movw r14, r24 265ec: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 265f0: 00 91 8d 16 lds r16, 0x168D ; 0x80168d 265f4: 10 91 8e 16 lds r17, 0x168E ; 0x80168e 265f8: 20 91 8f 16 lds r18, 0x168F ; 0x80168f 265fc: 30 91 90 16 lds r19, 0x1690 ; 0x801690 26600: 60 1b sub r22, r16 26602: 71 0b sbc r23, r17 26604: 82 0b sbc r24, r18 26606: 93 0b sbc r25, r19 26608: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 2660c: 9b 01 movw r18, r22 2660e: ac 01 movw r20, r24 26610: 60 e0 ldi r22, 0x00 ; 0 26612: 70 e0 ldi r23, 0x00 ; 0 26614: 8a e7 ldi r24, 0x7A ; 122 26616: 93 e4 ldi r25, 0x43 ; 67 26618: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2661c: a7 01 movw r20, r14 2661e: 96 01 movw r18, r12 26620: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 26624: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 26628: 70 93 86 03 sts 0x0386, r23 ; 0x800386 2662c: 60 93 85 03 sts 0x0385, r22 ; 0x800385 fan_speed[1] = (fan_edge_counter[1] * (float(250) / (_millis() - extruder_autofan_last_check))); 26630: 60 91 24 06 lds r22, 0x0624 ; 0x800624 26634: 70 91 25 06 lds r23, 0x0625 ; 0x800625 26638: 07 2e mov r0, r23 2663a: 00 0c add r0, r0 2663c: 88 0b sbc r24, r24 2663e: 99 0b sbc r25, r25 26640: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 26644: 6b 01 movw r12, r22 26646: 7c 01 movw r14, r24 26648: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 2664c: 00 91 8d 16 lds r16, 0x168D ; 0x80168d 26650: 10 91 8e 16 lds r17, 0x168E ; 0x80168e 26654: 20 91 8f 16 lds r18, 0x168F ; 0x80168f 26658: 30 91 90 16 lds r19, 0x1690 ; 0x801690 2665c: 60 1b sub r22, r16 2665e: 71 0b sbc r23, r17 26660: 82 0b sbc r24, r18 26662: 93 0b sbc r25, r19 26664: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 26668: 9b 01 movw r18, r22 2666a: ac 01 movw r20, r24 2666c: 60 e0 ldi r22, 0x00 ; 0 2666e: 70 e0 ldi r23, 0x00 ; 0 26670: 8a e7 ldi r24, 0x7A ; 122 26672: 93 e4 ldi r25, 0x43 ; 67 26674: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 26678: a7 01 movw r20, r14 2667a: 96 01 movw r18, r12 2667c: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 26680: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 26684: 70 93 88 03 sts 0x0388, r23 ; 0x800388 26688: 60 93 87 03 sts 0x0387, r22 ; 0x800387 /*SERIAL_ECHOPGM("time interval: "); MYSERIAL.println(_millis() - extruder_autofan_last_check); SERIAL_ECHOPGM("hotend fan speed:"); MYSERIAL.print(fan_speed[0]); SERIAL_ECHOPGM("; edge counter:"); MYSERIAL.println(fan_edge_counter[0]); SERIAL_ECHOPGM("print fan speed:"); MYSERIAL.print(fan_speed[1]); SERIAL_ECHOPGM("; edge counter:"); MYSERIAL.println(fan_edge_counter[1]); SERIAL_ECHOLNPGM(" ");*/ fan_edge_counter[0] = 0; 2668c: 10 92 23 06 sts 0x0623, r1 ; 0x800623 26690: 10 92 22 06 sts 0x0622, r1 ; 0x800622 fan_edge_counter[1] = 0; 26694: 10 92 25 06 sts 0x0625, r1 ; 0x800625 26698: 10 92 24 06 sts 0x0624, r1 ; 0x800624 void checkFanSpeed() { uint8_t max_fan_errors[2]; #ifdef FAN_SOFT_PWM max_fan_errors[1] = 3; // 15 seconds (Print fan) 2669c: 83 e0 ldi r24, 0x03 ; 3 2669e: 8a 83 std Y+2, r24 ; 0x02 max_fan_errors[0] = 2; // 10 seconds (Hotend fan) 266a0: 82 e0 ldi r24, 0x02 ; 2 266a2: 89 83 std Y+1, r24 ; 0x01 #else //FAN_SOFT_PWM max_fan_errors[1] = 15; // 15 seconds (Print fan) max_fan_errors[0] = 5; // 5 seconds (Hotend fan) #endif //FAN_SOFT_PWM if(fans_check_enabled) 266a4: 80 91 40 02 lds r24, 0x0240 ; 0x800240 266a8: 88 23 and r24, r24 266aa: 51 f0 breq .+20 ; 0x266c0 fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0); 266ac: 87 e8 ldi r24, 0x87 ; 135 266ae: 9f e0 ldi r25, 0x0F ; 15 266b0: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 266b4: 91 e0 ldi r25, 0x01 ; 1 266b6: 81 11 cpse r24, r1 266b8: 01 c0 rjmp .+2 ; 0x266bc 266ba: 90 e0 ldi r25, 0x00 ; 0 266bc: 90 93 40 02 sts 0x0240, r25 ; 0x800240 static uint8_t fan_speed_errors[2] = { 0,0 }; #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 >-1)) if ((fan_speed[0] < 20) && (current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE)){ fan_speed_errors[0]++;} 266c0: 80 91 85 03 lds r24, 0x0385 ; 0x800385 266c4: 90 91 86 03 lds r25, 0x0386 ; 0x800386 266c8: 44 97 sbiw r24, 0x14 ; 20 266ca: 0c f0 brlt .+2 ; 0x266ce 266cc: f2 c0 rjmp .+484 ; 0x268b2 266ce: 20 e0 ldi r18, 0x00 ; 0 266d0: 30 e0 ldi r19, 0x00 ; 0 266d2: 48 e4 ldi r20, 0x48 ; 72 266d4: 52 e4 ldi r21, 0x42 ; 66 266d6: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 266da: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 266de: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 266e2: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 266e6: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 266ea: 18 16 cp r1, r24 266ec: 0c f0 brlt .+2 ; 0x266f0 266ee: e1 c0 rjmp .+450 ; 0x268b2 266f0: 80 91 ed 05 lds r24, 0x05ED ; 0x8005ed 266f4: 8f 5f subi r24, 0xFF ; 255 266f6: 80 93 ed 05 sts 0x05ED, r24 ; 0x8005ed if ((fan_speed[1] < 5) && ((blocks_queued() ? block_buffer[block_buffer_tail].fan_speed : fanSpeed) > MIN_PRINT_FAN_SPEED)) fan_speed_errors[1]++; else fan_speed_errors[1] = 0; #endif // drop the fan_check_error flag when both fans are ok if( fan_speed_errors[0] == 0 && fan_speed_errors[1] == 0 && fan_check_error == EFCE_REPORTED){ 266fa: 80 91 ed 05 lds r24, 0x05ED ; 0x8005ed 266fe: 81 11 cpse r24, r1 26700: 0b c0 rjmp .+22 ; 0x26718 26702: 80 91 ee 05 lds r24, 0x05EE ; 0x8005ee 26706: 81 11 cpse r24, r1 26708: 07 c0 rjmp .+14 ; 0x26718 2670a: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 2670e: 82 30 cpi r24, 0x02 ; 2 26710: 19 f4 brne .+6 ; 0x26718 // we may even send some info to the LCD from here fan_check_error = EFCE_FIXED; 26712: 81 e0 ldi r24, 0x01 ; 1 26714: 80 93 9c 03 sts 0x039C, r24 ; 0x80039c } if ((fan_check_error == EFCE_FIXED) && !printer_active()){ 26718: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 2671c: 81 30 cpi r24, 0x01 ; 1 2671e: 61 f4 brne .+24 ; 0x26738 26720: 0e 94 19 61 call 0xc232 ; 0xc232 26724: 81 11 cpse r24, r1 26726: 08 c0 rjmp .+16 ; 0x26738 fan_check_error = EFCE_OK; //if the issue is fixed while the printer is doing nothing, reenable processing immediately. 26728: 10 92 9c 03 sts 0x039C, r1 ; 0x80039c lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 2672c: 10 92 8e 03 sts 0x038E, r1 ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.408> lcd_reset_alert_level(); //for another fan speed error lcd_setstatuspgm(MSG_WELCOME); // Reset the status line message to visually show the error is gone 26730: 87 e6 ldi r24, 0x67 ; 103 26732: 9b e6 ldi r25, 0x6B ; 107 26734: 0e 94 65 e6 call 0x1ccca ; 0x1ccca } if (fans_check_enabled && (fan_check_error != EFCE_REPORTED)) 26738: 80 91 40 02 lds r24, 0x0240 ; 0x800240 2673c: 88 23 and r24, r24 2673e: 09 f4 brne .+2 ; 0x26742 26740: d9 c0 rjmp .+434 ; 0x268f4 26742: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 26746: 82 30 cpi r24, 0x02 ; 2 26748: 09 f4 brne .+2 ; 0x2674c 2674a: d4 c0 rjmp .+424 ; 0x268f4 2674c: 8d ee ldi r24, 0xED ; 237 2674e: e8 2e mov r14, r24 26750: 85 e0 ldi r24, 0x05 ; 5 26752: f8 2e mov r15, r24 26754: ce 01 movw r24, r28 26756: 01 96 adiw r24, 0x01 ; 1 26758: 6c 01 movw r12, r24 { for (uint8_t fan = 0; fan < 2; fan++) 2675a: 10 e0 ldi r17, 0x00 ; 0 } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; fan_check_error = EFCE_REPORTED; 2675c: 02 e0 ldi r16, 0x02 ; 2 } if (fans_check_enabled && (fan_check_error != EFCE_REPORTED)) { for (uint8_t fan = 0; fan < 2; fan++) { if (fan_speed_errors[fan] > max_fan_errors[fan]) 2675e: f7 01 movw r30, r14 26760: 91 91 ld r25, Z+ 26762: 7f 01 movw r14, r30 26764: f6 01 movw r30, r12 26766: 81 91 ld r24, Z+ 26768: 6f 01 movw r12, r30 2676a: 89 17 cp r24, r25 2676c: 80 f5 brcc .+96 ; 0x267ce { fan_speed_errors[fan] = 0; 2676e: f7 01 movw r30, r14 26770: 31 97 sbiw r30, 0x01 ; 1 26772: 10 82 st Z, r1 LCD_ALERTMESSAGERPGM(lcdMsg); } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; 26774: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 26778: 82 30 cpi r24, 0x02 ; 2 2677a: 49 f1 breq .+82 ; 0x267ce fan_check_error = EFCE_REPORTED; 2677c: 00 93 9c 03 sts 0x039C, r16 ; 0x80039c if (printJobOngoing()) { 26780: 0e 94 c8 60 call 0xc190 ; 0xc190 26784: 88 23 and r24, r24 26786: 09 f4 brne .+2 ; 0x2678a 26788: 9a c0 rjmp .+308 ; 0x268be // A print is ongoing, pause the print normally if(!printingIsPaused()) { 2678a: 0e 94 bd 60 call 0xc17a ; 0xc17a 2678e: 81 11 cpse r24, r1 26790: 07 c0 rjmp .+14 ; 0x267a0 if (usb_timer.running()) 26792: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 26796: 88 23 and r24, r24 26798: 09 f4 brne .+2 ; 0x2679c 2679a: 8e c0 rjmp .+284 ; 0x268b8 lcd_pause_usb_print(); 2679c: 0f 94 29 04 call 0x20852 ; 0x20852 else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; } switch (_fan) { 267a0: 11 30 cpi r17, 0x01 ; 1 267a2: 09 f4 brne .+2 ; 0x267a6 267a4: 93 c0 rjmp .+294 ; 0x268cc //! Prints serialMsg to serial port, displays lcdMsg onto the LCD and beeps. //! Extracted from fanSpeedError to save some space. //! @param serialMsg pointer into PROGMEM, this text will be printed to the serial port //! @param lcdMsg pointer into PROGMEM, this text will be printed onto the LCD static void fanSpeedErrorBeep(const char *serialMsg, const char *lcdMsg){ SERIAL_ECHOLNRPGM(serialMsg); 267a6: 85 e2 ldi r24, 0x25 ; 37 267a8: 92 e9 ldi r25, 0x92 ; 146 267aa: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 if (get_message_level() == 0) { 267ae: 80 91 8e 03 lds r24, 0x038E ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.408> 267b2: 81 11 cpse r24, r1 267b4: 0c c0 rjmp .+24 ; 0x267ce Sound_MakeCustom(200,0,true); 267b6: 41 e0 ldi r20, 0x01 ; 1 267b8: 70 e0 ldi r23, 0x00 ; 0 267ba: 60 e0 ldi r22, 0x00 ; 0 267bc: 88 ec ldi r24, 0xC8 ; 200 267be: 90 e0 ldi r25, 0x00 ; 0 267c0: 0f 94 c5 31 call 0x2638a ; 0x2638a LCD_ALERTMESSAGERPGM(lcdMsg); 267c4: 62 e0 ldi r22, 0x02 ; 2 267c6: 87 e6 ldi r24, 0x67 ; 103 267c8: 97 e6 ldi r25, 0x67 ; 103 267ca: 0e 94 01 e2 call 0x1c402 ; 0x1c402 lcd_reset_alert_level(); //for another fan speed error lcd_setstatuspgm(MSG_WELCOME); // Reset the status line message to visually show the error is gone } if (fans_check_enabled && (fan_check_error != EFCE_REPORTED)) { for (uint8_t fan = 0; fan < 2; fan++) 267ce: 11 30 cpi r17, 0x01 ; 1 267d0: 09 f4 brne .+2 ; 0x267d4 267d2: 90 c0 rjmp .+288 ; 0x268f4 267d4: 11 e0 ldi r17, 0x01 ; 1 267d6: c3 cf rjmp .-122 ; 0x2675e case TempErrorSource::hotend: if(temp_error_state.assert) { 267d8: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 267dc: 81 ff sbrs r24, 1 267de: 12 c0 rjmp .+36 ; 0x26804 min_temp_error(temp_error_state.index); 267e0: 60 91 9a 03 lds r22, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 267e4: 62 95 swap r22 267e6: 61 70 andi r22, 0x01 ; 1 #endif } static void min_temp_error(uint8_t e) { static const char err[] PROGMEM = "MINTEMP"; if(IsStopped() == false) { 267e8: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 267ec: 81 11 cpse r24, r1 267ee: 07 c0 rjmp .+14 ; 0x267fe temp_error_messagepgm(err, e); 267f0: 80 e8 ldi r24, 0x80 ; 128 267f2: 92 e9 ldi r25, 0x92 ; 146 267f4: 0f 94 af 11 call 0x2235e ; 0x2235e prusa_statistics(92); 267f8: 8c e5 ldi r24, 0x5C ; 92 267fa: 0f 94 ff 97 call 0x32ffe ; 0x32ffe } ThermalStop(); 267fe: 0f 94 35 43 call 0x2866a ; 0x2866a 26802: a2 ce rjmp .-700 ; 0x26548 // which is a safer variant than just continuing printing // The automaton also checks for hysteresis - the temperature must have reached a few degrees above the MINTEMP, before // we shall signalize, that MINTEMP has been fixed // Code notice: normally the alert_automaton instance would have been placed here // as static alert_automaton_mintemp alert_automaton_hotend, but alert_automaton_hotend.step(current_temperature[0], minttemp[0] + TEMP_HYSTERESIS); 26804: 60 91 db 03 lds r22, 0x03DB ; 0x8003db <_ZL8minttemp.lto_priv.424> 26808: 70 91 dc 03 lds r23, 0x03DC ; 0x8003dc <_ZL8minttemp.lto_priv.424+0x1> 2680c: 6b 5f subi r22, 0xFB ; 251 2680e: 7f 4f sbci r23, 0xFF ; 255 26810: 07 2e mov r0, r23 26812: 00 0c add r0, r0 26814: 88 0b sbc r24, r24 26816: 99 0b sbc r25, r25 26818: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2681c: 8b 01 movw r16, r22 2681e: 9c 01 movw r18, r24 26820: 40 91 c4 0d lds r20, 0x0DC4 ; 0x800dc4 26824: 50 91 c5 0d lds r21, 0x0DC5 ; 0x800dc5 26828: 60 91 c6 0d lds r22, 0x0DC6 ; 0x800dc6 2682c: 70 91 c7 0d lds r23, 0x0DC7 ; 0x800dc7 26830: 8c e6 ldi r24, 0x6C ; 108 26832: 92 e0 ldi r25, 0x02 ; 2 if(temp_error_state.assert) { bed_min_temp_error(); } else { // no recovery, just force the user to restart the printer // which is a safer variant than just continuing printing alert_automaton_bed.step(current_temperature_bed, BED_MINTEMP + TEMP_HYSTERESIS); 26834: 0f 94 3c 09 call 0x21278 ; 0x21278 26838: 87 ce rjmp .-754 ; 0x26548 // as static alert_automaton_mintemp alert_automaton_hotend, but alert_automaton_hotend.step(current_temperature[0], minttemp[0] + TEMP_HYSTERESIS); } break; case TempErrorSource::bed: if(temp_error_state.assert) { 2683a: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 2683e: 81 ff sbrs r24, 1 26840: 0a c0 rjmp .+20 ; 0x26856 ThermalStop(); } static void bed_min_temp_error(void) { static const char err[] PROGMEM = "MINTEMP BED"; if(IsStopped() == false) { 26842: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 26846: 81 11 cpse r24, r1 26848: da cf rjmp .-76 ; 0x267fe temp_error_messagepgm(err); 2684a: 61 e0 ldi r22, 0x01 ; 1 2684c: 84 e7 ldi r24, 0x74 ; 116 2684e: 92 e9 ldi r25, 0x92 ; 146 ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { temp_error_messagepgm(PSTR("MAXTEMP BED")); 26850: 0f 94 af 11 call 0x2235e ; 0x2235e 26854: d4 cf rjmp .-88 ; 0x267fe if(temp_error_state.assert) { bed_min_temp_error(); } else { // no recovery, just force the user to restart the printer // which is a safer variant than just continuing printing alert_automaton_bed.step(current_temperature_bed, BED_MINTEMP + TEMP_HYSTERESIS); 26856: 40 91 8a 03 lds r20, 0x038A ; 0x80038a 2685a: 50 91 8b 03 lds r21, 0x038B ; 0x80038b 2685e: 60 91 8c 03 lds r22, 0x038C ; 0x80038c 26862: 70 91 8d 03 lds r23, 0x038D ; 0x80038d 26866: 00 e0 ldi r16, 0x00 ; 0 26868: 10 e0 ldi r17, 0x00 ; 0 2686a: 2c e0 ldi r18, 0x0C ; 12 2686c: 32 e4 ldi r19, 0x42 ; 66 2686e: 88 e6 ldi r24, 0x68 ; 104 26870: 92 e0 ldi r25, 0x02 ; 2 26872: e0 cf rjmp .-64 ; 0x26834 break; #endif } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { 26874: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 26878: 86 95 lsr r24 2687a: 86 95 lsr r24 2687c: 83 70 andi r24, 0x03 ; 3 2687e: 59 f0 breq .+22 ; 0x26896 26880: 81 30 cpi r24, 0x01 ; 1 26882: 09 f0 breq .+2 ; 0x26886 26884: 61 ce rjmp .-830 ; 0x26548 } ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { 26886: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 2688a: 81 11 cpse r24, r1 2688c: b8 cf rjmp .-144 ; 0x267fe temp_error_messagepgm(PSTR("MAXTEMP BED")); 2688e: 61 e0 ldi r22, 0x01 ; 1 26890: 80 e9 ldi r24, 0x90 ; 144 26892: 92 e9 ldi r25, 0x92 ; 146 26894: dd cf rjmp .-70 ; 0x26850 } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { case TempErrorSource::hotend: max_temp_error(temp_error_state.index); 26896: 60 91 9a 03 lds r22, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 2689a: 62 95 swap r22 2689c: 61 70 andi r22, 0x01 ; 1 SERIAL_ERRORLNPGM(" triggered!"); } static void max_temp_error(uint8_t e) { if(IsStopped() == false) { 2689e: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 268a2: 81 11 cpse r24, r1 268a4: ac cf rjmp .-168 ; 0x267fe temp_error_messagepgm(PSTR("MAXTEMP"), e); 268a6: 88 e8 ldi r24, 0x88 ; 136 268a8: 92 e9 ldi r25, 0x92 ; 146 268aa: 0f 94 af 11 call 0x2235e ; 0x2235e prusa_statistics(93); 268ae: 8d e5 ldi r24, 0x5D ; 93 268b0: a4 cf rjmp .-184 ; 0x267fa if(fans_check_enabled) fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0); static uint8_t fan_speed_errors[2] = { 0,0 }; #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 >-1)) if ((fan_speed[0] < 20) && (current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE)){ fan_speed_errors[0]++;} else fan_speed_errors[0] = 0; 268b2: 10 92 ed 05 sts 0x05ED, r1 ; 0x8005ed 268b6: 21 cf rjmp .-446 ; 0x266fa // A print is ongoing, pause the print normally if(!printingIsPaused()) { if (usb_timer.running()) lcd_pause_usb_print(); else lcd_pause_print(); 268b8: 0f 94 80 0f call 0x21f00 ; 0x21f00 268bc: 71 cf rjmp .-286 ; 0x267a0 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 268be: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 268c2: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 } } else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; 268c6: 10 92 99 03 sts 0x0399, r1 ; 0x800399 268ca: 6a cf rjmp .-300 ; 0x267a0 //! Prints serialMsg to serial port, displays lcdMsg onto the LCD and beeps. //! Extracted from fanSpeedError to save some space. //! @param serialMsg pointer into PROGMEM, this text will be printed to the serial port //! @param lcdMsg pointer into PROGMEM, this text will be printed onto the LCD static void fanSpeedErrorBeep(const char *serialMsg, const char *lcdMsg){ SERIAL_ECHOLNRPGM(serialMsg); 268cc: 8d e4 ldi r24, 0x4D ; 77 268ce: 92 e9 ldi r25, 0x92 ; 146 268d0: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 if (get_message_level() == 0) { 268d4: 80 91 8e 03 lds r24, 0x038E ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.408> 268d8: 81 11 cpse r24, r1 268da: 0c c0 rjmp .+24 ; 0x268f4 Sound_MakeCustom(200,0,true); 268dc: 41 e0 ldi r20, 0x01 ; 1 268de: 70 e0 ldi r23, 0x00 ; 0 268e0: 60 e0 ldi r22, 0x00 ; 0 268e2: 88 ec ldi r24, 0xC8 ; 200 268e4: 90 e0 ldi r25, 0x00 ; 0 268e6: 0f 94 c5 31 call 0x2638a ; 0x2638a LCD_ALERTMESSAGERPGM(lcdMsg); 268ea: 62 e0 ldi r22, 0x02 ; 2 268ec: 8e eb ldi r24, 0xBE ; 190 268ee: 99 e6 ldi r25, 0x69 ; 105 268f0: 0e 94 01 e2 call 0x1c402 ; 0x1c402 } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { countFanSpeed(); checkFanSpeed(); //printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = fanSpeedBckp; 268f4: 80 91 67 02 lds r24, 0x0267 ; 0x800267 268f8: 80 93 05 05 sts 0x0505, r24 ; 0x800505 //printf_P(PSTR("fan PWM: %d; extr fanSpeed measured: %d; print fan speed measured: %d \n"), fanSpeedBckp, fan_speed[0], fan_speed[1]); extruder_autofan_last_check = _millis(); 268fc: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 26900: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d 26904: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e 26908: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f 2690c: 90 93 90 16 sts 0x1690, r25 ; 0x801690 fan_measuring = false; 26910: 10 92 84 03 sts 0x0384, r1 ; 0x800384 checkFans(); #ifdef THERMAL_MODEL_DEBUG thermal_model::log_usr(); #endif } 26914: 0f 90 pop r0 26916: 0f 90 pop r0 26918: df 91 pop r29 2691a: cf 91 pop r28 2691c: 1f 91 pop r17 2691e: 0f 91 pop r16 26920: ff 90 pop r15 26922: ef 90 pop r14 26924: df 90 pop r13 26926: cf 90 pop r12 } #endif //FANCHECK checkExtruderAutoFans(); 26928: 0c 94 8b 6e jmp 0xdd16 ; 0xdd16 2692c: 0f 90 pop r0 2692e: 0f 90 pop r0 26930: df 91 pop r29 26932: cf 91 pop r28 26934: 1f 91 pop r17 26936: 0f 91 pop r16 26938: ff 90 pop r15 2693a: ef 90 pop r14 2693c: df 90 pop r13 2693e: cf 90 pop r12 26940: 08 95 ret 00026942 : } bool lcd_wait_for_click_delay(uint16_t nDelay) // nDelay :: timeout [s] (0 ~ no timeout) // true ~ clicked, false ~ delayed { 26942: 4f 92 push r4 26944: 5f 92 push r5 26946: 6f 92 push r6 26948: 7f 92 push r7 2694a: 8f 92 push r8 2694c: 9f 92 push r9 2694e: af 92 push r10 26950: bf 92 push r11 26952: cf 92 push r12 26954: df 92 push r13 26956: ef 92 push r14 26958: ff 92 push r15 2695a: 0f 93 push r16 2695c: 1f 93 push r17 2695e: cf 93 push r28 26960: 8c 01 movw r16, r24 bool bDelayed; long nTime0 = _millis()/1000; 26962: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 26966: 28 ee ldi r18, 0xE8 ; 232 26968: 33 e0 ldi r19, 0x03 ; 3 2696a: 40 e0 ldi r20, 0x00 ; 0 2696c: 50 e0 ldi r21, 0x00 ; 0 2696e: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> 26972: 69 01 movw r12, r18 26974: 7a 01 movw r14, r20 lcd_consume_click(); 26976: 0e 94 93 6b call 0xd726 ; 0xd726 KEEPALIVE_STATE(PAUSED_FOR_USER); 2697a: 84 e0 ldi r24, 0x04 ; 4 2697c: 80 93 78 02 sts 0x0278, r24 ; 0x800278 for (;;) { manage_heater(); manage_inactivity(true); bDelayed = ((_millis()/1000-nTime0) > nDelay); 26980: 88 ee ldi r24, 0xE8 ; 232 26982: 88 2e mov r8, r24 26984: 83 e0 ldi r24, 0x03 ; 3 26986: 98 2e mov r9, r24 26988: a1 2c mov r10, r1 2698a: b1 2c mov r11, r1 2698c: 28 01 movw r4, r16 2698e: 71 2c mov r7, r1 26990: 61 2c mov r6, r1 bool bDelayed; long nTime0 = _millis()/1000; lcd_consume_click(); KEEPALIVE_STATE(PAUSED_FOR_USER); for (;;) { manage_heater(); 26992: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(true); 26996: 81 e0 ldi r24, 0x01 ; 1 26998: 0e 94 01 7a call 0xf402 ; 0xf402 bDelayed = ((_millis()/1000-nTime0) > nDelay); 2699c: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 269a0: a5 01 movw r20, r10 269a2: 94 01 movw r18, r8 269a4: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> 269a8: 2c 19 sub r18, r12 269aa: 3d 09 sbc r19, r13 269ac: 4e 09 sbc r20, r14 269ae: 5f 09 sbc r21, r15 bDelayed = (bDelayed && (nDelay != 0)); // 0 ~ no timeout, always waiting for click 269b0: 42 16 cp r4, r18 269b2: 53 06 cpc r5, r19 269b4: 64 06 cpc r6, r20 269b6: 75 06 cpc r7, r21 269b8: 20 f4 brcc .+8 ; 0x269c2 269ba: c1 e0 ldi r28, 0x01 ; 1 269bc: 01 15 cp r16, r1 269be: 11 05 cpc r17, r1 269c0: 09 f4 brne .+2 ; 0x269c4 269c2: c0 e0 ldi r28, 0x00 ; 0 if (lcd_clicked() || bDelayed) { 269c4: 0e 94 98 6b call 0xd730 ; 0xd730 269c8: 81 11 cpse r24, r1 269ca: 02 c0 rjmp .+4 ; 0x269d0 269cc: cc 23 and r28, r28 269ce: 09 f3 breq .-62 ; 0x26992 KEEPALIVE_STATE(IN_HANDLER); 269d0: 82 e0 ldi r24, 0x02 ; 2 269d2: 80 93 78 02 sts 0x0278, r24 ; 0x800278 return(!bDelayed); } } } 269d6: 81 e0 ldi r24, 0x01 ; 1 269d8: 8c 27 eor r24, r28 269da: cf 91 pop r28 269dc: 1f 91 pop r17 269de: 0f 91 pop r16 269e0: ff 90 pop r15 269e2: ef 90 pop r14 269e4: df 90 pop r13 269e6: cf 90 pop r12 269e8: bf 90 pop r11 269ea: af 90 pop r10 269ec: 9f 90 pop r9 269ee: 8f 90 pop r8 269f0: 7f 90 pop r7 269f2: 6f 90 pop r6 269f4: 5f 90 pop r5 269f6: 4f 90 pop r4 269f8: 08 95 ret 000269fa : // When done, it sets the current Z to Z_MAX_POS and returns true. // Otherwise the Z calibration is not changed and false is returned. #ifndef TMC2130 bool lcd_calibrate_z_end_stop_manual(bool only_z) { 269fa: 9f 92 push r9 269fc: af 92 push r10 269fe: bf 92 push r11 26a00: cf 92 push r12 26a02: df 92 push r13 26a04: ef 92 push r14 26a06: ff 92 push r15 26a08: 0f 93 push r16 26a0a: 1f 93 push r17 26a0c: cf 93 push r28 26a0e: df 93 push r29 26a10: 98 2e mov r9, r24 // Don't know where we are. Let's claim we are Z=0, so the soft end stops will not be triggered when moving up. current_position[Z_AXIS] = 0; 26a12: 10 92 fd 11 sts 0x11FD, r1 ; 0x8011fd 26a16: 10 92 fe 11 sts 0x11FE, r1 ; 0x8011fe 26a1a: 10 92 ff 11 sts 0x11FF, r1 ; 0x8011ff 26a1e: 10 92 00 12 sts 0x1200, r1 ; 0x801200 plan_set_position_curposXYZE(); 26a22: 0f 94 30 83 call 0x30660 ; 0x30660 // Until confirmed by the confirmation dialog. for (;;) { const char *msg = only_z ? _T(MSG_MOVE_CARRIAGE_TO_THE_TOP_Z) 26a26: 86 e9 ldi r24, 0x96 ; 150 26a28: 9c e4 ldi r25, 0x4C ; 76 26a2a: 91 10 cpse r9, r1 26a2c: 02 c0 rjmp .+4 ; 0x26a32 26a2e: 83 e3 ldi r24, 0x33 ; 51 26a30: 9c e4 ldi r25, 0x4C ; 76 26a32: 0e 94 b1 6c call 0xd962 ; 0xd962 26a36: b8 2e mov r11, r24 26a38: a9 2e mov r10, r25 : _T(MSG_MOVE_CARRIAGE_TO_THE_TOP); const char *msg_next = lcd_display_message_fullscreen_P(msg); 26a3a: 0f 94 c0 0a call 0x21580 ; 0x21580 26a3e: 8c 01 movw r16, r24 const bool multi_screen = msg_next != NULL; unsigned long previous_millis_msg = _millis(); 26a40: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 26a44: 6b 01 movw r12, r22 26a46: 7c 01 movw r14, r24 // Until the user finishes the z up movement. lcd_encoder = 0; 26a48: 10 92 07 05 sts 0x0507, r1 ; 0x800507 26a4c: 10 92 06 05 sts 0x0506, r1 ; 0x800506 // Until confirmed by the confirmation dialog. for (;;) { const char *msg = only_z ? _T(MSG_MOVE_CARRIAGE_TO_THE_TOP_Z) : _T(MSG_MOVE_CARRIAGE_TO_THE_TOP); const char *msg_next = lcd_display_message_fullscreen_P(msg); 26a50: e8 01 movw r28, r16 const bool multi_screen = msg_next != NULL; unsigned long previous_millis_msg = _millis(); // Until the user finishes the z up movement. lcd_encoder = 0; for (;;) { manage_heater(); 26a52: 0f 94 5b 32 call 0x264b6 ; 0x264b6 manage_inactivity(true); 26a56: 81 e0 ldi r24, 0x01 ; 1 26a58: 0e 94 01 7a call 0xf402 ; 0xf402 if (lcd_encoder) { 26a5c: 80 91 06 05 lds r24, 0x0506 ; 0x800506 26a60: 90 91 07 05 lds r25, 0x0507 ; 0x800507 26a64: 89 2b or r24, r25 26a66: d9 f1 breq .+118 ; 0x26ade _delay(50); 26a68: 62 e3 ldi r22, 0x32 ; 50 26a6a: 70 e0 ldi r23, 0x00 ; 0 26a6c: 80 e0 ldi r24, 0x00 ; 0 26a6e: 90 e0 ldi r25, 0x00 ; 0 26a70: 0f 94 7b 0d call 0x21af6 ; 0x21af6 FORCE_INLINE uint8_t moves_planned() { return (block_buffer_head + BLOCK_BUFFER_SIZE - block_buffer_tail) & (BLOCK_BUFFER_SIZE - 1); } FORCE_INLINE bool planner_queue_full() { uint8_t next_block_index = block_buffer_head; 26a74: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 if (++ next_block_index == BLOCK_BUFFER_SIZE) 26a78: 8f 5f subi r24, 0xFF ; 255 26a7a: 80 31 cpi r24, 0x10 ; 16 26a7c: 09 f4 brne .+2 ; 0x26a80 next_block_index = 0; 26a7e: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 26a80: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 if (! planner_queue_full()) { 26a84: 98 17 cp r25, r24 26a86: 59 f1 breq .+86 ; 0x26ade // Only move up, whatever direction the user rotates the encoder. current_position[Z_AXIS] += abs(lcd_encoder); 26a88: 60 91 06 05 lds r22, 0x0506 ; 0x800506 26a8c: 70 91 07 05 lds r23, 0x0507 ; 0x800507 26a90: 77 ff sbrs r23, 7 26a92: 03 c0 rjmp .+6 ; 0x26a9a 26a94: 71 95 neg r23 26a96: 61 95 neg r22 26a98: 71 09 sbc r23, r1 26a9a: 07 2e mov r0, r23 26a9c: 00 0c add r0, r0 26a9e: 88 0b sbc r24, r24 26aa0: 99 0b sbc r25, r25 26aa2: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 26aa6: 20 91 fd 11 lds r18, 0x11FD ; 0x8011fd 26aaa: 30 91 fe 11 lds r19, 0x11FE ; 0x8011fe 26aae: 40 91 ff 11 lds r20, 0x11FF ; 0x8011ff 26ab2: 50 91 00 12 lds r21, 0x1200 ; 0x801200 26ab6: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 26aba: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 26abe: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 26ac2: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 26ac6: 90 93 00 12 sts 0x1200, r25 ; 0x801200 lcd_encoder = 0; 26aca: 10 92 07 05 sts 0x0507, r1 ; 0x800507 26ace: 10 92 06 05 sts 0x0506, r1 ; 0x800506 plan_buffer_line_curposXYZE(manual_feedrate[Z_AXIS] / 60); 26ad2: 65 e5 ldi r22, 0x55 ; 85 26ad4: 75 e5 ldi r23, 0x55 ; 85 26ad6: 85 e8 ldi r24, 0x85 ; 133 26ad8: 91 e4 ldi r25, 0x41 ; 65 26ada: 0f 94 70 84 call 0x308e0 ; 0x308e0 } } if (lcd_clicked()) { 26ade: 0e 94 98 6b call 0xd730 ; 0xd730 26ae2: 88 23 and r24, r24 26ae4: c9 f1 breq .+114 ; 0x26b58 // Abort a move if in progress. planner_abort_hard(); 26ae6: 0f 94 ea 85 call 0x30bd4 ; 0x30bd4 planner_aborted = false; 26aea: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac while (lcd_clicked()) ; 26aee: 0e 94 98 6b call 0xd730 ; 0xd730 26af2: 81 11 cpse r24, r1 26af4: fc cf rjmp .-8 ; 0x26aee _delay(10); 26af6: 6a e0 ldi r22, 0x0A ; 10 26af8: 70 e0 ldi r23, 0x00 ; 0 26afa: 80 e0 ldi r24, 0x00 ; 0 26afc: 90 e0 ldi r25, 0x00 ; 0 26afe: 0f 94 7b 0d call 0x21af6 ; 0x21af6 while (lcd_clicked()) ; 26b02: 0e 94 98 6b call 0xd730 ; 0xd730 26b06: 81 11 cpse r24, r1 26b08: fc cf rjmp .-8 ; 0x26b02 msg_next = lcd_display_message_fullscreen_P(msg_next); previous_millis_msg = _millis(); } } // Let the user confirm, that the Z carriage is at the top end stoppers. uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_CONFIRM_CARRIAGE_AT_THE_TOP), false); 26b0a: 8a e0 ldi r24, 0x0A ; 10 26b0c: 9c e4 ldi r25, 0x4C ; 76 26b0e: 0e 94 b1 6c call 0xd962 ; 0xd962 26b12: 41 e0 ldi r20, 0x01 ; 1 26b14: 60 e0 ldi r22, 0x00 ; 0 26b16: 0f 94 e0 2d call 0x25bc0 ; 0x25bc0 if (result == LCD_BUTTON_TIMEOUT) 26b1a: 8f 3f cpi r24, 0xFF ; 255 26b1c: d1 f1 breq .+116 ; 0x26b92 goto canceled; else if (result == LCD_LEFT_BUTTON_CHOICE) 26b1e: 81 11 cpse r24, r1 26b20: 82 cf rjmp .-252 ; 0x26a26 // during the search for the induction points. if ((PRINTER_TYPE == PRINTER_MK25) || (PRINTER_TYPE == PRINTER_MK2) || (PRINTER_TYPE == PRINTER_MK2_SNMM)) { current_position[Z_AXIS] = Z_MAX_POS-3.f; } else { current_position[Z_AXIS] = Z_MAX_POS+4.f; 26b22: 80 e0 ldi r24, 0x00 ; 0 26b24: 90 e0 ldi r25, 0x00 ; 0 26b26: a6 e5 ldi r26, 0x56 ; 86 26b28: b3 e4 ldi r27, 0x43 ; 67 26b2a: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 26b2e: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 26b32: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 26b36: b0 93 00 12 sts 0x1200, r27 ; 0x801200 } plan_set_position_curposXYZE(); 26b3a: 0f 94 30 83 call 0x30660 ; 0x30660 return true; 26b3e: 81 e0 ldi r24, 0x01 ; 1 canceled: return false; } 26b40: df 91 pop r29 26b42: cf 91 pop r28 26b44: 1f 91 pop r17 26b46: 0f 91 pop r16 26b48: ff 90 pop r15 26b4a: ef 90 pop r14 26b4c: df 90 pop r13 26b4e: cf 90 pop r12 26b50: bf 90 pop r11 26b52: af 90 pop r10 26b54: 9f 90 pop r9 26b56: 08 95 ret while (lcd_clicked()) ; _delay(10); while (lcd_clicked()) ; break; } if (multi_screen && _millis() - previous_millis_msg > 5000) { 26b58: 01 15 cp r16, r1 26b5a: 11 05 cpc r17, r1 26b5c: 09 f4 brne .+2 ; 0x26b60 26b5e: 79 cf rjmp .-270 ; 0x26a52 26b60: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 26b64: 6c 19 sub r22, r12 26b66: 7d 09 sbc r23, r13 26b68: 8e 09 sbc r24, r14 26b6a: 9f 09 sbc r25, r15 26b6c: 69 38 cpi r22, 0x89 ; 137 26b6e: 73 41 sbci r23, 0x13 ; 19 26b70: 81 05 cpc r24, r1 26b72: 91 05 cpc r25, r1 26b74: 08 f4 brcc .+2 ; 0x26b78 26b76: 6d cf rjmp .-294 ; 0x26a52 if (msg_next == NULL) 26b78: 20 97 sbiw r28, 0x00 ; 0 26b7a: 11 f4 brne .+4 ; 0x26b80 msg_next = msg; 26b7c: cb 2d mov r28, r11 26b7e: da 2d mov r29, r10 msg_next = lcd_display_message_fullscreen_P(msg_next); 26b80: ce 01 movw r24, r28 26b82: 0f 94 c0 0a call 0x21580 ; 0x21580 26b86: ec 01 movw r28, r24 previous_millis_msg = _millis(); 26b88: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 26b8c: 6b 01 movw r12, r22 26b8e: 7c 01 movw r14, r24 26b90: 60 cf rjmp .-320 ; 0x26a52 } plan_set_position_curposXYZE(); return true; canceled: return false; 26b92: 80 e0 ldi r24, 0x00 ; 0 26b94: d5 cf rjmp .-86 ; 0x26b40 00026b96 : /// Make sure to call sound_wait_for_user_reset() when the user has clicked the knob /// Loud - should continuously beep /// Silent - should be silent /// Once - should beep once /// Assist/Blind - as loud with beep and click on knob rotation and press void sound_wait_for_user() { 26b96: cf 93 push r28 #if BEEPER > 0 if (eSoundMode == e_SOUND_MODE_SILENT) return; 26b98: c0 91 15 04 lds r28, 0x0415 ; 0x800415 26b9c: c2 30 cpi r28, 0x02 ; 2 26b9e: 59 f1 breq .+86 ; 0x26bf6 // Handle case where only one beep is needed if (eSoundMode == e_SOUND_MODE_ONCE) { 26ba0: c1 30 cpi r28, 0x01 ; 1 26ba2: 69 f4 brne .+26 ; 0x26bbe if (bFirst) return; 26ba4: 80 91 2e 05 lds r24, 0x052E ; 0x80052e <_ZL6bFirst.lto_priv.457> 26ba8: 81 11 cpse r24, r1 26baa: 25 c0 rjmp .+74 ; 0x26bf6 Sound_MakeCustom(80, 0, false); 26bac: 40 e0 ldi r20, 0x00 ; 0 26bae: 70 e0 ldi r23, 0x00 ; 0 26bb0: 60 e0 ldi r22, 0x00 ; 0 26bb2: 80 e5 ldi r24, 0x50 ; 80 26bb4: 90 e0 ldi r25, 0x00 ; 0 26bb6: 0f 94 c5 31 call 0x2638a ; 0x2638a bFirst = true; 26bba: c0 93 2e 05 sts 0x052E, r28 ; 0x80052e <_ZL6bFirst.lto_priv.457> } // Handle case where there should be continous beeps if (beep_timer.expired_cont(CONTINOUS_BEEP_PERIOD)) { 26bbe: 60 ed ldi r22, 0xD0 ; 208 26bc0: 77 e0 ldi r23, 0x07 ; 7 26bc2: 8b e2 ldi r24, 0x2B ; 43 26bc4: 95 e0 ldi r25, 0x05 ; 5 26bc6: 0f 94 cf 0f call 0x21f9e ; 0x21f9e ::expired_cont(unsigned short)> 26bca: 88 23 and r24, r24 26bcc: a1 f0 breq .+40 ; 0x26bf6 beep_timer.start(); 26bce: 8b e2 ldi r24, 0x2B ; 43 26bd0: 95 e0 ldi r25, 0x05 ; 5 26bd2: 0f 94 d6 0f call 0x21fac ; 0x21fac ::start()> if (eSoundMode == e_SOUND_MODE_LOUD) { 26bd6: 80 91 15 04 lds r24, 0x0415 ; 0x800415 26bda: 81 11 cpse r24, r1 26bdc: 08 c0 rjmp .+16 ; 0x26bee Sound_MakeCustom(80, 0, false); 26bde: 40 e0 ldi r20, 0x00 ; 0 26be0: 70 e0 ldi r23, 0x00 ; 0 26be2: 60 e0 ldi r22, 0x00 ; 0 26be4: 80 e5 ldi r24, 0x50 ; 80 26be6: 90 e0 ldi r25, 0x00 ; 0 // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } } #endif // BEEPER > 0 } 26be8: cf 91 pop r28 // Handle case where there should be continous beeps if (beep_timer.expired_cont(CONTINOUS_BEEP_PERIOD)) { beep_timer.start(); if (eSoundMode == e_SOUND_MODE_LOUD) { Sound_MakeCustom(80, 0, false); 26bea: 0d 94 c5 31 jmp 0x2638a ; 0x2638a } else { // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 26bee: 80 e0 ldi r24, 0x00 ; 0 } } #endif // BEEPER > 0 } 26bf0: cf 91 pop r28 beep_timer.start(); if (eSoundMode == e_SOUND_MODE_LOUD) { Sound_MakeCustom(80, 0, false); } else { // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 26bf2: 0d 94 9f 2c jmp 0x2593e ; 0x2593e } } #endif // BEEPER > 0 } 26bf6: cf 91 pop r28 26bf8: 08 95 ret 00026bfa : { #if ((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3) || (MOTHERBOARD == BOARD_EINSY_1_0a)) #ifdef TMC2130_DEDGE_STEPPING PINC = (axes_mask & 0x0f); // toggle step signals by mask #else uint8_t portC = PORTC & 0xf0; 26bfa: 98 b1 in r25, 0x08 ; 8 26bfc: 90 7f andi r25, 0xF0 ; 240 PORTC = portC | (axes_mask & 0x0f); //set step signals by mask 26bfe: 89 2b or r24, r25 26c00: 88 b9 out 0x08, r24 ; 8 asm("nop"); 26c02: 00 00 nop PORTC = portC; //set step signals to zero 26c04: 98 b9 out 0x08, r25 ; 8 asm("nop"); 26c06: 00 00 nop #endif #endif //((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3) || (MOTHERBOARD == BOARD_EINSY_1_0a)) } 26c08: 08 95 ret 00026c0a : sm4_calc_delay_cb_t sm4_calc_delay_cb = 0; void sm4_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 26c0a: 82 30 cpi r24, 0x02 ; 2 26c0c: b9 f0 breq .+46 ; 0x26c3c 26c0e: 83 30 cpi r24, 0x03 ; 3 26c10: e9 f0 breq .+58 ; 0x26c4c 26c12: 81 30 cpi r24, 0x01 ; 1 26c14: 59 f0 breq .+22 ; 0x26c2c { #if ((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3)) case 0: if (dir == INVERT_X_DIR) PORTL |= 2; else PORTL &= ~2; break; 26c16: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 26c1a: 61 11 cpse r22, r1 26c1c: 05 c0 rjmp .+10 ; 0x26c28 26c1e: 82 60 ori r24, 0x02 ; 2 case 1: if (dir == INVERT_Y_DIR) PORTL |= 1; else PORTL &= ~1; break; case 2: if (dir == INVERT_Z_DIR) PORTL |= 4; else PORTL &= ~4; break; case 3: if (dir == INVERT_E0_DIR) PORTL |= 64; else PORTL &= ~64; break; 26c20: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> case 1: if (dir == INVERT_Y_DIR) PORTL |= 2; else PORTL &= ~2; break; case 2: if (dir == INVERT_Z_DIR) PORTL |= 4; else PORTL &= ~4; break; case 3: if (dir == INVERT_E0_DIR) PORTL |= 64; else PORTL &= ~64; break; #endif } asm("nop"); 26c24: 00 00 nop } 26c26: 08 95 ret void sm4_set_dir(uint8_t axis, uint8_t dir) { switch (axis) { #if ((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3)) case 0: if (dir == INVERT_X_DIR) PORTL |= 2; else PORTL &= ~2; break; 26c28: 8d 7f andi r24, 0xFD ; 253 26c2a: fa cf rjmp .-12 ; 0x26c20 case 1: if (dir == INVERT_Y_DIR) PORTL |= 1; else PORTL &= ~1; break; 26c2c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 26c30: 61 11 cpse r22, r1 26c32: 02 c0 rjmp .+4 ; 0x26c38 26c34: 81 60 ori r24, 0x01 ; 1 26c36: f4 cf rjmp .-24 ; 0x26c20 26c38: 8e 7f andi r24, 0xFE ; 254 26c3a: f2 cf rjmp .-28 ; 0x26c20 case 2: if (dir == INVERT_Z_DIR) PORTL |= 4; else PORTL &= ~4; break; 26c3c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 26c40: 61 11 cpse r22, r1 26c42: 02 c0 rjmp .+4 ; 0x26c48 26c44: 84 60 ori r24, 0x04 ; 4 26c46: ec cf rjmp .-40 ; 0x26c20 26c48: 8b 7f andi r24, 0xFB ; 251 26c4a: ea cf rjmp .-44 ; 0x26c20 case 3: if (dir == INVERT_E0_DIR) PORTL |= 64; else PORTL &= ~64; break; 26c4c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 26c50: 61 30 cpi r22, 0x01 ; 1 26c52: 11 f4 brne .+4 ; 0x26c58 26c54: 80 64 ori r24, 0x40 ; 64 26c56: e4 cf rjmp .-56 ; 0x26c20 26c58: 8f 7b andi r24, 0xBF ; 191 26c5a: e2 cf rjmp .-60 ; 0x26c20 00026c5c : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { 26c5c: cf 93 push r28 if (cacheDirty_) { 26c5e: 80 91 d5 0d lds r24, 0x0DD5 ; 0x800dd5 } cacheMirrorBlock_ = 0; } cacheDirty_ = 0; } return true; 26c62: c1 e0 ldi r28, 0x01 ; 1 fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { if (cacheDirty_) { 26c64: 88 23 and r24, r24 26c66: a1 f0 breq .+40 ; 0x26c90 if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { 26c68: 40 91 cd 0d lds r20, 0x0DCD ; 0x800dcd 26c6c: 50 91 ce 0d lds r21, 0x0DCE ; 0x800dce 26c70: 60 91 cf 0d lds r22, 0x0DCF ; 0x800dcf 26c74: 70 91 d0 0d lds r23, 0x0DD0 ; 0x800dd0 26c78: 29 ed ldi r18, 0xD9 ; 217 26c7a: 3d e0 ldi r19, 0x0D ; 13 26c7c: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 26c80: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 26c84: 0f 94 4f 70 call 0x2e09e ; 0x2e09e 26c88: c8 2f mov r28, r24 26c8a: 81 11 cpse r24, r1 26c8c: 04 c0 rjmp .+8 ; 0x26c96 cacheDirty_ = 0; } return true; fail: return false; 26c8e: c0 e0 ldi r28, 0x00 ; 0 } 26c90: 8c 2f mov r24, r28 26c92: cf 91 pop r28 26c94: 08 95 ret if (cacheDirty_) { if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { goto fail; } // mirror FAT tables if (cacheMirrorBlock_) { 26c96: 40 91 d1 0d lds r20, 0x0DD1 ; 0x800dd1 26c9a: 50 91 d2 0d lds r21, 0x0DD2 ; 0x800dd2 26c9e: 60 91 d3 0d lds r22, 0x0DD3 ; 0x800dd3 26ca2: 70 91 d4 0d lds r23, 0x0DD4 ; 0x800dd4 26ca6: 41 15 cp r20, r1 26ca8: 51 05 cpc r21, r1 26caa: 61 05 cpc r22, r1 26cac: 71 05 cpc r23, r1 26cae: 91 f0 breq .+36 ; 0x26cd4 if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) { 26cb0: 29 ed ldi r18, 0xD9 ; 217 26cb2: 3d e0 ldi r19, 0x0D ; 13 26cb4: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 26cb8: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 26cbc: 0f 94 4f 70 call 0x2e09e ; 0x2e09e 26cc0: 88 23 and r24, r24 26cc2: 29 f3 breq .-54 ; 0x26c8e goto fail; } cacheMirrorBlock_ = 0; 26cc4: 10 92 d1 0d sts 0x0DD1, r1 ; 0x800dd1 26cc8: 10 92 d2 0d sts 0x0DD2, r1 ; 0x800dd2 26ccc: 10 92 d3 0d sts 0x0DD3, r1 ; 0x800dd3 26cd0: 10 92 d4 0d sts 0x0DD4, r1 ; 0x800dd4 } cacheDirty_ = 0; 26cd4: 10 92 d5 0d sts 0x0DD5, r1 ; 0x800dd5 26cd8: db cf rjmp .-74 ; 0x26c90 00026cda : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) { 26cda: cf 92 push r12 26cdc: df 92 push r13 26cde: ef 92 push r14 26ce0: ff 92 push r15 26ce2: cf 93 push r28 26ce4: 6b 01 movw r12, r22 26ce6: 7c 01 movw r14, r24 26ce8: c4 2f mov r28, r20 if (cacheBlockNumber_ != blockNumber) { 26cea: 80 91 cd 0d lds r24, 0x0DCD ; 0x800dcd 26cee: 90 91 ce 0d lds r25, 0x0DCE ; 0x800dce 26cf2: a0 91 cf 0d lds r26, 0x0DCF ; 0x800dcf 26cf6: b0 91 d0 0d lds r27, 0x0DD0 ; 0x800dd0 26cfa: 8c 15 cp r24, r12 26cfc: 9d 05 cpc r25, r13 26cfe: ae 05 cpc r26, r14 26d00: bf 05 cpc r27, r15 26d02: 01 f1 breq .+64 ; 0x26d44 if (!cacheFlush()) goto fail; 26d04: 0f 94 2e 36 call 0x26c5c ; 0x26c5c 26d08: 81 11 cpse r24, r1 26d0a: 08 c0 rjmp .+16 ; 0x26d1c } if (dirty) cacheDirty_ = true; return true; fail: return false; 26d0c: c0 e0 ldi r28, 0x00 ; 0 } 26d0e: 8c 2f mov r24, r28 26d10: cf 91 pop r28 26d12: ff 90 pop r15 26d14: ef 90 pop r14 26d16: df 90 pop r13 26d18: cf 90 pop r12 26d1a: 08 95 ret } //------------------------------------------------------------------------------ bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) { if (cacheBlockNumber_ != blockNumber) { if (!cacheFlush()) goto fail; if (!sdCard_->readBlock(blockNumber, cacheBuffer_.data)) goto fail; 26d1c: 29 ed ldi r18, 0xD9 ; 217 26d1e: 3d e0 ldi r19, 0x0D ; 13 26d20: b7 01 movw r22, r14 26d22: a6 01 movw r20, r12 26d24: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 26d28: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 26d2c: 0f 94 b3 70 call 0x2e166 ; 0x2e166 26d30: 88 23 and r24, r24 26d32: 61 f3 breq .-40 ; 0x26d0c cacheBlockNumber_ = blockNumber; 26d34: c0 92 cd 0d sts 0x0DCD, r12 ; 0x800dcd 26d38: d0 92 ce 0d sts 0x0DCE, r13 ; 0x800dce 26d3c: e0 92 cf 0d sts 0x0DCF, r14 ; 0x800dcf 26d40: f0 92 d0 0d sts 0x0DD0, r15 ; 0x800dd0 } if (dirty) cacheDirty_ = true; 26d44: cc 23 and r28, r28 26d46: 21 f0 breq .+8 ; 0x26d50 26d48: 81 e0 ldi r24, 0x01 ; 1 26d4a: 80 93 d5 0d sts 0x0DD5, r24 ; 0x800dd5 26d4e: df cf rjmp .-66 ; 0x26d0e return true; 26d50: c1 e0 ldi r28, 0x01 ; 1 26d52: dd cf rjmp .-70 ; 0x26d0e 00026d54 : fail: return false; } //------------------------------------------------------------------------------ // Store a FAT entry bool SdVolume::fatPut(uint32_t cluster, uint32_t value) { 26d54: 4f 92 push r4 26d56: 5f 92 push r5 26d58: 6f 92 push r6 26d5a: 7f 92 push r7 26d5c: 8f 92 push r8 26d5e: 9f 92 push r9 26d60: af 92 push r10 26d62: bf 92 push r11 26d64: cf 92 push r12 26d66: df 92 push r13 26d68: ef 92 push r14 26d6a: ff 92 push r15 26d6c: 0f 93 push r16 26d6e: 1f 93 push r17 26d70: cf 93 push r28 26d72: df 93 push r29 26d74: ec 01 movw r28, r24 uint32_t lba; // error if reserved cluster if (cluster < 2) goto fail; 26d76: 42 30 cpi r20, 0x02 ; 2 26d78: 51 05 cpc r21, r1 26d7a: 61 05 cpc r22, r1 26d7c: 71 05 cpc r23, r1 26d7e: 90 f4 brcc .+36 ; 0x26da4 // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; return true; fail: return false; 26d80: 80 e0 ldi r24, 0x00 ; 0 } 26d82: df 91 pop r29 26d84: cf 91 pop r28 26d86: 1f 91 pop r17 26d88: 0f 91 pop r16 26d8a: ff 90 pop r15 26d8c: ef 90 pop r14 26d8e: df 90 pop r13 26d90: cf 90 pop r12 26d92: bf 90 pop r11 26d94: af 90 pop r10 26d96: 9f 90 pop r9 26d98: 8f 90 pop r8 26d9a: 7f 90 pop r7 26d9c: 6f 90 pop r6 26d9e: 5f 90 pop r5 26da0: 4f 90 pop r4 26da2: 08 95 ret uint32_t lba; // error if reserved cluster if (cluster < 2) goto fail; // error if not in FAT if (cluster > (clusterCount_ + 1)) goto fail; 26da4: 89 85 ldd r24, Y+9 ; 0x09 26da6: 9a 85 ldd r25, Y+10 ; 0x0a 26da8: ab 85 ldd r26, Y+11 ; 0x0b 26daa: bc 85 ldd r27, Y+12 ; 0x0c 26dac: 01 96 adiw r24, 0x01 ; 1 26dae: a1 1d adc r26, r1 26db0: b1 1d adc r27, r1 26db2: 84 17 cp r24, r20 26db4: 95 07 cpc r25, r21 26db6: a6 07 cpc r26, r22 26db8: b7 07 cpc r27, r23 26dba: 10 f3 brcs .-60 ; 0x26d80 tmp = ((cacheBuffer_.data[index] & 0XF0)) | tmp >> 4; } cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { 26dbc: 8f 89 ldd r24, Y+23 ; 0x17 26dbe: 80 31 cpi r24, 0x10 ; 16 26dc0: c9 f5 brne .+114 ; 0x26e34 lba = fatStartBlock_ + (cluster >> 8); 26dc2: 85 2e mov r8, r21 26dc4: 96 2e mov r9, r22 26dc6: a7 2e mov r10, r23 26dc8: bb 24 eor r11, r11 26dca: 8b 89 ldd r24, Y+19 ; 0x13 26dcc: 9c 89 ldd r25, Y+20 ; 0x14 26dce: ad 89 ldd r26, Y+21 ; 0x15 26dd0: be 89 ldd r27, Y+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 26dd2: 88 0e add r8, r24 26dd4: 99 1e adc r9, r25 26dd6: aa 1e adc r10, r26 26dd8: bb 1e adc r11, r27 26dda: 28 01 movw r4, r16 26ddc: 39 01 movw r6, r18 26dde: 6a 01 movw r12, r20 26de0: 7b 01 movw r14, r22 } else { goto fail; } if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; 26de2: 41 e0 ldi r20, 0x01 ; 1 26de4: c5 01 movw r24, r10 26de6: b4 01 movw r22, r8 26de8: 0f 94 6d 36 call 0x26cda ; 0x26cda 26dec: 88 23 and r24, r24 26dee: 41 f2 breq .-112 ; 0x26d80 // store entry if (fatType_ == 16) { 26df0: 9f 89 ldd r25, Y+23 ; 0x17 26df2: 90 31 cpi r25, 0x10 ; 16 26df4: 81 f5 brne .+96 ; 0x26e56 cacheBuffer_.fat16[cluster & 0XFF] = value; 26df6: dd 24 eor r13, r13 26df8: ee 24 eor r14, r14 26dfa: ff 24 eor r15, r15 26dfc: f6 01 movw r30, r12 26dfe: ee 0f add r30, r30 26e00: ff 1f adc r31, r31 26e02: e7 52 subi r30, 0x27 ; 39 26e04: f2 4f sbci r31, 0xF2 ; 242 26e06: 11 83 std Z+1, r17 ; 0x01 26e08: 00 83 st Z, r16 } else { cacheBuffer_.fat32[cluster & 0X7F] = value; } // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; 26e0a: 9a 89 ldd r25, Y+18 ; 0x12 26e0c: 92 30 cpi r25, 0x02 ; 2 26e0e: 08 f4 brcc .+2 ; 0x26e12 26e10: b8 cf rjmp .-144 ; 0x26d82 26e12: 4d 81 ldd r20, Y+5 ; 0x05 26e14: 5e 81 ldd r21, Y+6 ; 0x06 26e16: 6f 81 ldd r22, Y+7 ; 0x07 26e18: 78 85 ldd r23, Y+8 ; 0x08 26e1a: 84 0e add r8, r20 26e1c: 95 1e adc r9, r21 26e1e: a6 1e adc r10, r22 26e20: b7 1e adc r11, r23 26e22: 80 92 d1 0d sts 0x0DD1, r8 ; 0x800dd1 26e26: 90 92 d2 0d sts 0x0DD2, r9 ; 0x800dd2 26e2a: a0 92 d3 0d sts 0x0DD3, r10 ; 0x800dd3 26e2e: b0 92 d4 0d sts 0x0DD4, r11 ; 0x800dd4 26e32: a7 cf rjmp .-178 ; 0x26d82 cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 26e34: 80 32 cpi r24, 0x20 ; 32 26e36: 09 f0 breq .+2 ; 0x26e3a 26e38: a3 cf rjmp .-186 ; 0x26d80 lba = fatStartBlock_ + (cluster >> 7); 26e3a: 8b 89 ldd r24, Y+19 ; 0x13 26e3c: 9c 89 ldd r25, Y+20 ; 0x14 26e3e: ad 89 ldd r26, Y+21 ; 0x15 26e40: be 89 ldd r27, Y+22 ; 0x16 26e42: 4a 01 movw r8, r20 26e44: 5b 01 movw r10, r22 26e46: e7 e0 ldi r30, 0x07 ; 7 26e48: b6 94 lsr r11 26e4a: a7 94 ror r10 26e4c: 97 94 ror r9 26e4e: 87 94 ror r8 26e50: ea 95 dec r30 26e52: d1 f7 brne .-12 ; 0x26e48 26e54: be cf rjmp .-132 ; 0x26dd2 if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; // store entry if (fatType_ == 16) { cacheBuffer_.fat16[cluster & 0XFF] = value; } else { cacheBuffer_.fat32[cluster & 0X7F] = value; 26e56: e8 94 clt 26e58: c7 f8 bld r12, 7 26e5a: dd 24 eor r13, r13 26e5c: ee 24 eor r14, r14 26e5e: ff 24 eor r15, r15 26e60: f6 01 movw r30, r12 26e62: ee 0f add r30, r30 26e64: ff 1f adc r31, r31 26e66: ee 0f add r30, r30 26e68: ff 1f adc r31, r31 26e6a: e7 52 subi r30, 0x27 ; 39 26e6c: f2 4f sbci r31, 0xF2 ; 242 26e6e: 40 82 st Z, r4 26e70: 51 82 std Z+1, r5 ; 0x01 26e72: 62 82 std Z+2, r6 ; 0x02 26e74: 73 82 std Z+3, r7 ; 0x03 26e76: c9 cf rjmp .-110 ; 0x26e0a 00026e78 : fail: return false; } //------------------------------------------------------------------------------ // Fetch a FAT entry bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) { 26e78: cf 92 push r12 26e7a: df 92 push r13 26e7c: ef 92 push r14 26e7e: ff 92 push r15 26e80: 0f 93 push r16 26e82: 1f 93 push r17 26e84: cf 93 push r28 26e86: df 93 push r29 26e88: fc 01 movw r30, r24 uint32_t lba; if (cluster > (clusterCount_ + 1)) goto fail; 26e8a: 81 85 ldd r24, Z+9 ; 0x09 26e8c: 92 85 ldd r25, Z+10 ; 0x0a 26e8e: a3 85 ldd r26, Z+11 ; 0x0b 26e90: b4 85 ldd r27, Z+12 ; 0x0c 26e92: 01 96 adiw r24, 0x01 ; 1 26e94: a1 1d adc r26, r1 26e96: b1 1d adc r27, r1 26e98: 84 17 cp r24, r20 26e9a: 95 07 cpc r25, r21 26e9c: a6 07 cpc r26, r22 26e9e: b7 07 cpc r27, r23 26ea0: 50 f4 brcc .+20 ; 0x26eb6 *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; } return true; fail: return false; 26ea2: 80 e0 ldi r24, 0x00 ; 0 } 26ea4: df 91 pop r29 26ea6: cf 91 pop r28 26ea8: 1f 91 pop r17 26eaa: 0f 91 pop r16 26eac: ff 90 pop r15 26eae: ef 90 pop r14 26eb0: df 90 pop r13 26eb2: cf 90 pop r12 26eb4: 08 95 ret } tmp |= cacheBuffer_.data[index] << 8; *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { 26eb6: 87 89 ldd r24, Z+23 ; 0x17 26eb8: 80 31 cpi r24, 0x10 ; 16 26eba: a9 f5 brne .+106 ; 0x26f26 lba = fatStartBlock_ + (cluster >> 8); 26ebc: bb 27 eor r27, r27 26ebe: a7 2f mov r26, r23 26ec0: 96 2f mov r25, r22 26ec2: 85 2f mov r24, r21 26ec4: c3 88 ldd r12, Z+19 ; 0x13 26ec6: d4 88 ldd r13, Z+20 ; 0x14 26ec8: e5 88 ldd r14, Z+21 ; 0x15 26eca: f6 88 ldd r15, Z+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 26ecc: 8c 0d add r24, r12 26ece: 9d 1d adc r25, r13 26ed0: ae 1d adc r26, r14 26ed2: bf 1d adc r27, r15 26ed4: e9 01 movw r28, r18 26ed6: 6a 01 movw r12, r20 26ed8: 7b 01 movw r14, r22 26eda: 8f 01 movw r16, r30 } else { goto fail; } if (lba != cacheBlockNumber_) { 26edc: 40 91 cd 0d lds r20, 0x0DCD ; 0x800dcd 26ee0: 50 91 ce 0d lds r21, 0x0DCE ; 0x800dce 26ee4: 60 91 cf 0d lds r22, 0x0DCF ; 0x800dcf 26ee8: 70 91 d0 0d lds r23, 0x0DD0 ; 0x800dd0 26eec: 84 17 cp r24, r20 26eee: 95 07 cpc r25, r21 26ef0: a6 07 cpc r26, r22 26ef2: b7 07 cpc r27, r23 26ef4: 49 f5 brne .+82 ; 0x26f48 if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; } if (fatType_ == 16) { 26ef6: f8 01 movw r30, r16 26ef8: 87 89 ldd r24, Z+23 ; 0x17 26efa: 80 31 cpi r24, 0x10 ; 16 26efc: 69 f5 brne .+90 ; 0x26f58 *value = cacheBuffer_.fat16[cluster & 0XFF]; 26efe: b7 01 movw r22, r14 26f00: a6 01 movw r20, r12 26f02: 55 27 eor r21, r21 26f04: 66 27 eor r22, r22 26f06: 77 27 eor r23, r23 26f08: 44 0f add r20, r20 26f0a: 55 1f adc r21, r21 26f0c: 47 52 subi r20, 0x27 ; 39 26f0e: 52 4f sbci r21, 0xF2 ; 242 26f10: fa 01 movw r30, r20 26f12: 80 81 ld r24, Z 26f14: 91 81 ldd r25, Z+1 ; 0x01 26f16: b0 e0 ldi r27, 0x00 ; 0 26f18: a0 e0 ldi r26, 0x00 ; 0 } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 26f1a: 88 83 st Y, r24 26f1c: 99 83 std Y+1, r25 ; 0x01 26f1e: aa 83 std Y+2, r26 ; 0x02 26f20: bb 83 std Y+3, r27 ; 0x03 26f22: 81 e0 ldi r24, 0x01 ; 1 26f24: bf cf rjmp .-130 ; 0x26ea4 *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 26f26: 80 32 cpi r24, 0x20 ; 32 26f28: 09 f0 breq .+2 ; 0x26f2c 26f2a: bb cf rjmp .-138 ; 0x26ea2 lba = fatStartBlock_ + (cluster >> 7); 26f2c: c3 88 ldd r12, Z+19 ; 0x13 26f2e: d4 88 ldd r13, Z+20 ; 0x14 26f30: e5 88 ldd r14, Z+21 ; 0x15 26f32: f6 88 ldd r15, Z+22 ; 0x16 26f34: db 01 movw r26, r22 26f36: ca 01 movw r24, r20 26f38: c7 e0 ldi r28, 0x07 ; 7 26f3a: b6 95 lsr r27 26f3c: a7 95 ror r26 26f3e: 97 95 ror r25 26f40: 87 95 ror r24 26f42: ca 95 dec r28 26f44: d1 f7 brne .-12 ; 0x26f3a 26f46: c2 cf rjmp .-124 ; 0x26ecc } else { goto fail; } if (lba != cacheBlockNumber_) { if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; 26f48: 40 e0 ldi r20, 0x00 ; 0 26f4a: bc 01 movw r22, r24 26f4c: cd 01 movw r24, r26 26f4e: 0f 94 6d 36 call 0x26cda ; 0x26cda 26f52: 81 11 cpse r24, r1 26f54: d0 cf rjmp .-96 ; 0x26ef6 26f56: a5 cf rjmp .-182 ; 0x26ea2 } if (fatType_ == 16) { *value = cacheBuffer_.fat16[cluster & 0XFF]; } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 26f58: b7 01 movw r22, r14 26f5a: a6 01 movw r20, r12 26f5c: 4f 77 andi r20, 0x7F ; 127 26f5e: 55 27 eor r21, r21 26f60: 66 27 eor r22, r22 26f62: 77 27 eor r23, r23 26f64: 44 0f add r20, r20 26f66: 55 1f adc r21, r21 26f68: 44 0f add r20, r20 26f6a: 55 1f adc r21, r21 26f6c: 47 52 subi r20, 0x27 ; 39 26f6e: 52 4f sbci r21, 0xF2 ; 242 26f70: fa 01 movw r30, r20 26f72: 80 81 ld r24, Z 26f74: 91 81 ldd r25, Z+1 ; 0x01 26f76: a2 81 ldd r26, Z+2 ; 0x02 26f78: b3 81 ldd r27, Z+3 ; 0x03 26f7a: bf 70 andi r27, 0x0F ; 15 26f7c: ce cf rjmp .-100 ; 0x26f1a 00026f7e : fail: return false; } //------------------------------------------------------------------------------ // return the size in bytes of a cluster chain bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { 26f7e: 4f 92 push r4 26f80: 5f 92 push r5 26f82: 6f 92 push r6 26f84: 7f 92 push r7 26f86: af 92 push r10 26f88: bf 92 push r11 26f8a: cf 92 push r12 26f8c: df 92 push r13 26f8e: ef 92 push r14 26f90: ff 92 push r15 26f92: 0f 93 push r16 26f94: 1f 93 push r17 26f96: cf 93 push r28 26f98: df 93 push r29 26f9a: 00 d0 rcall .+0 ; 0x26f9c 26f9c: 1f 92 push r1 26f9e: cd b7 in r28, 0x3d ; 61 26fa0: de b7 in r29, 0x3e ; 62 26fa2: 8c 01 movw r16, r24 26fa4: 49 83 std Y+1, r20 ; 0x01 26fa6: 5a 83 std Y+2, r21 ; 0x02 26fa8: 6b 83 std Y+3, r22 ; 0x03 26faa: 7c 83 std Y+4, r23 ; 0x04 26fac: 59 01 movw r10, r18 uint32_t s = 0; 26fae: c1 2c mov r12, r1 26fb0: d1 2c mov r13, r1 26fb2: 76 01 movw r14, r12 do { if (!fatGet(cluster, &cluster)) goto fail; s += 512UL << clusterSizeShift_; 26fb4: 41 2c mov r4, r1 26fb6: 82 e0 ldi r24, 0x02 ; 2 26fb8: 58 2e mov r5, r24 26fba: 61 2c mov r6, r1 26fbc: 71 2c mov r7, r1 //------------------------------------------------------------------------------ // return the size in bytes of a cluster chain bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { uint32_t s = 0; do { if (!fatGet(cluster, &cluster)) goto fail; 26fbe: 49 81 ldd r20, Y+1 ; 0x01 26fc0: 5a 81 ldd r21, Y+2 ; 0x02 26fc2: 6b 81 ldd r22, Y+3 ; 0x03 26fc4: 7c 81 ldd r23, Y+4 ; 0x04 26fc6: 9e 01 movw r18, r28 26fc8: 2f 5f subi r18, 0xFF ; 255 26fca: 3f 4f sbci r19, 0xFF ; 255 26fcc: c8 01 movw r24, r16 26fce: 0f 94 3c 37 call 0x26e78 ; 0x26e78 26fd2: 88 23 and r24, r24 26fd4: 19 f1 breq .+70 ; 0x2701c s += 512UL << clusterSizeShift_; 26fd6: f8 01 movw r30, r16 26fd8: 85 85 ldd r24, Z+13 ; 0x0d 26fda: a3 01 movw r20, r6 26fdc: 92 01 movw r18, r4 26fde: 04 c0 rjmp .+8 ; 0x26fe8 26fe0: 22 0f add r18, r18 26fe2: 33 1f adc r19, r19 26fe4: 44 1f adc r20, r20 26fe6: 55 1f adc r21, r21 26fe8: 8a 95 dec r24 26fea: d2 f7 brpl .-12 ; 0x26fe0 26fec: da 01 movw r26, r20 26fee: c9 01 movw r24, r18 26ff0: c8 0e add r12, r24 26ff2: d9 1e adc r13, r25 26ff4: ea 1e adc r14, r26 26ff6: fb 1e adc r15, r27 } while (!isEOC(cluster)); 26ff8: 49 81 ldd r20, Y+1 ; 0x01 26ffa: 5a 81 ldd r21, Y+2 ; 0x02 26ffc: 6b 81 ldd r22, Y+3 ; 0x03 26ffe: 7c 81 ldd r23, Y+4 ; 0x04 return fatPut(cluster, 0x0FFFFFFF); } bool freeChain(uint32_t cluster); bool isEOC(uint32_t cluster) const { if (FAT12_SUPPORT && fatType_ == 12) return cluster >= FAT12EOC_MIN; if (fatType_ == 16) return cluster >= FAT16EOC_MIN; 27000: 87 89 ldd r24, Z+23 ; 0x17 27002: 80 31 cpi r24, 0x10 ; 16 27004: f1 f4 brne .+60 ; 0x27042 27006: 81 e0 ldi r24, 0x01 ; 1 27008: 48 3f cpi r20, 0xF8 ; 248 2700a: 5f 4f sbci r21, 0xFF ; 255 2700c: 61 05 cpc r22, r1 2700e: 71 05 cpc r23, r1 27010: b0 f2 brcs .-84 ; 0x26fbe *size = s; 27012: f5 01 movw r30, r10 27014: c0 82 st Z, r12 27016: d1 82 std Z+1, r13 ; 0x01 27018: e2 82 std Z+2, r14 ; 0x02 2701a: f3 82 std Z+3, r15 ; 0x03 return true; fail: return false; } 2701c: 0f 90 pop r0 2701e: 0f 90 pop r0 27020: 0f 90 pop r0 27022: 0f 90 pop r0 27024: df 91 pop r29 27026: cf 91 pop r28 27028: 1f 91 pop r17 2702a: 0f 91 pop r16 2702c: ff 90 pop r15 2702e: ef 90 pop r14 27030: df 90 pop r13 27032: cf 90 pop r12 27034: bf 90 pop r11 27036: af 90 pop r10 27038: 7f 90 pop r7 2703a: 6f 90 pop r6 2703c: 5f 90 pop r5 2703e: 4f 90 pop r4 27040: 08 95 ret return cluster >= FAT32EOC_MIN; 27042: 81 e0 ldi r24, 0x01 ; 1 27044: 48 3f cpi r20, 0xF8 ; 248 27046: 5f 4f sbci r21, 0xFF ; 255 27048: 6f 4f sbci r22, 0xFF ; 255 2704a: 7f 40 sbci r23, 0x0F ; 15 2704c: 08 f4 brcc .+2 ; 0x27050 2704e: b7 cf rjmp .-146 ; 0x26fbe 27050: e0 cf rjmp .-64 ; 0x27012 00027052 : vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; } bool SdFile::gfComputeNextFileBlock() { 27052: cf 92 push r12 27054: df 92 push r13 27056: ef 92 push r14 27058: ff 92 push r15 2705a: 1f 93 push r17 2705c: cf 93 push r28 2705e: df 93 push r29 27060: ec 01 movw r28, r24 27062: eb 81 ldd r30, Y+3 ; 0x03 // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 27064: e1 11 cpse r30, r1 27066: 09 c0 rjmp .+18 ; 0x2707a 27068: 80 e0 ldi r24, 0x00 ; 0 } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; } return true; } 2706a: df 91 pop r29 2706c: cf 91 pop r28 2706e: 1f 91 pop r17 27070: ff 90 pop r15 27072: ef 90 pop r14 27074: df 90 pop r13 27076: cf 90 pop r12 27078: 08 95 ret return true; } bool SdFile::gfComputeNextFileBlock() { // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2707a: 89 81 ldd r24, Y+1 ; 0x01 2707c: 80 ff sbrs r24, 0 2707e: f4 cf rjmp .-24 ; 0x27068 gfOffset = curPosition_ & 0X1FF; // offset in block 27080: 48 85 ldd r20, Y+8 ; 0x08 27082: 59 85 ldd r21, Y+9 ; 0x09 27084: 6a 85 ldd r22, Y+10 ; 0x0a 27086: 7b 85 ldd r23, Y+11 ; 0x0b 27088: 9a 01 movw r18, r20 2708a: 31 70 andi r19, 0x01 ; 1 2708c: 3a a3 std Y+34, r19 ; 0x22 2708e: 29 a3 std Y+33, r18 ; 0x21 27090: 89 8d ldd r24, Y+25 ; 0x19 27092: 9a 8d ldd r25, Y+26 ; 0x1a 27094: 6a 01 movw r12, r20 27096: 7b 01 movw r14, r22 27098: f9 e0 ldi r31, 0x09 ; 9 2709a: f6 94 lsr r15 2709c: e7 94 ror r14 2709e: d7 94 ror r13 270a0: c7 94 ror r12 270a2: fa 95 dec r31 270a4: d1 f7 brne .-12 ; 0x2709a if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 270a6: e2 30 cpi r30, 0x02 ; 2 270a8: 79 f4 brne .+30 ; 0x270c8 // SHR by 9 means skip the last byte and shift just 3 bytes by 1 // -> should be 8 instructions... and not the horrible loop shifting 4 bytes at once // still need to get some work on this gfBlock = vol_->rootDirStart() + (curPosition_ >> 9); 270aa: fc 01 movw r30, r24 270ac: 82 8d ldd r24, Z+26 ; 0x1a 270ae: 93 8d ldd r25, Z+27 ; 0x1b 270b0: a4 8d ldd r26, Z+28 ; 0x1c 270b2: b5 8d ldd r27, Z+29 ; 0x1d 270b4: 8c 0d add r24, r12 270b6: 9d 1d adc r25, r13 270b8: ae 1d adc r26, r14 270ba: bf 1d adc r27, r15 } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; 270bc: 8d 8f std Y+29, r24 ; 0x1d 270be: 9e 8f std Y+30, r25 ; 0x1e 270c0: af 8f std Y+31, r26 ; 0x1f 270c2: b8 a3 std Y+32, r27 ; 0x20 } return true; 270c4: 81 e0 ldi r24, 0x01 ; 1 270c6: d1 cf rjmp .-94 ; 0x2706a uint16_t rootDirEntryCount_; // number of entries in FAT16 root dir uint32_t rootDirStart_; // root start block for FAT16, cluster for FAT32 //---------------------------------------------------------------------------- bool allocContiguous(uint32_t count, uint32_t* curCluster); uint8_t blockOfCluster(uint32_t position) const { return (position >> 9) & (blocksPerCluster_ - 1);} 270c8: fc 01 movw r30, r24 270ca: 14 81 ldd r17, Z+4 ; 0x04 270cc: 11 50 subi r17, 0x01 ; 1 270ce: 1c 21 and r17, r12 // -> should be 8 instructions... and not the horrible loop shifting 4 bytes at once // still need to get some work on this gfBlock = vol_->rootDirStart() + (curPosition_ >> 9); } else { uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); if (gfOffset == 0 && blockOfCluster == 0) { 270d0: 23 2b or r18, r19 270d2: 71 f4 brne .+28 ; 0x270f0 270d4: 11 11 cpse r17, r1 270d6: 0c c0 rjmp .+24 ; 0x270f0 // start of new cluster if (curPosition_ == 0) { 270d8: 45 2b or r20, r21 270da: 46 2b or r20, r22 270dc: 47 2b or r20, r23 270de: 31 f5 brne .+76 ; 0x2712c // use first cluster in file curCluster_ = firstCluster_; 270e0: 8d 89 ldd r24, Y+21 ; 0x15 270e2: 9e 89 ldd r25, Y+22 ; 0x16 270e4: af 89 ldd r26, Y+23 ; 0x17 270e6: b8 8d ldd r27, Y+24 ; 0x18 270e8: 8c 83 std Y+4, r24 ; 0x04 270ea: 9d 83 std Y+5, r25 ; 0x05 270ec: ae 83 std Y+6, r26 ; 0x06 270ee: bf 83 std Y+7, r27 ; 0x07 } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; 270f0: e9 8d ldd r30, Y+25 ; 0x19 270f2: fa 8d ldd r31, Y+26 ; 0x1a uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 270f4: 8c 81 ldd r24, Y+4 ; 0x04 270f6: 9d 81 ldd r25, Y+5 ; 0x05 270f8: ae 81 ldd r26, Y+6 ; 0x06 270fa: bf 81 ldd r27, Y+7 ; 0x07 270fc: 02 97 sbiw r24, 0x02 ; 2 270fe: a1 09 sbc r26, r1 27100: b1 09 sbc r27, r1 27102: 25 85 ldd r18, Z+13 ; 0x0d 27104: 04 c0 rjmp .+8 ; 0x2710e 27106: 88 0f add r24, r24 27108: 99 1f adc r25, r25 2710a: aa 1f adc r26, r26 2710c: bb 1f adc r27, r27 2710e: 2a 95 dec r18 27110: d2 f7 brpl .-12 ; 0x27106 27112: 46 85 ldd r20, Z+14 ; 0x0e 27114: 57 85 ldd r21, Z+15 ; 0x0f 27116: 60 89 ldd r22, Z+16 ; 0x10 27118: 71 89 ldd r23, Z+17 ; 0x11 2711a: 84 0f add r24, r20 2711c: 95 1f adc r25, r21 2711e: a6 1f adc r26, r22 27120: b7 1f adc r27, r23 27122: 81 0f add r24, r17 27124: 91 1d adc r25, r1 27126: a1 1d adc r26, r1 27128: b1 1d adc r27, r1 2712a: c8 cf rjmp .-112 ; 0x270bc if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; 2712c: 4c 81 ldd r20, Y+4 ; 0x04 2712e: 5d 81 ldd r21, Y+5 ; 0x05 27130: 6e 81 ldd r22, Y+6 ; 0x06 27132: 7f 81 ldd r23, Y+7 ; 0x07 27134: 9e 01 movw r18, r28 27136: 2c 5f subi r18, 0xFC ; 252 27138: 3f 4f sbci r19, 0xFF ; 255 2713a: 0f 94 3c 37 call 0x26e78 ; 0x26e78 2713e: 81 11 cpse r24, r1 27140: d7 cf rjmp .-82 ; 0x270f0 27142: 92 cf rjmp .-220 ; 0x27068 00027144 : * A value of zero will be returned if end of file is reached. * If an error occurs, readDir() returns -1. Possible errors include * readDir() called before a directory has been opened, this is not * a directory file or an I/O error occurred. */ int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) { 27144: df 92 push r13 27146: ef 92 push r14 27148: ff 92 push r15 2714a: 0f 93 push r16 2714c: 1f 93 push r17 2714e: cf 93 push r28 27150: df 93 push r29 27152: 8c 01 movw r16, r24 27154: eb 01 movw r28, r22 27156: 7a 01 movw r14, r20 vfat_t *VFAT = (vfat_t*)dir; //Sanity check the VFAT entry. The first cluster is always set to zero. And th esequence number should be higher then 0 if (VFAT->firstClusterLow == 0 && (VFAT->sequenceNumber & 0x1F) > 0 && (VFAT->sequenceNumber & 0x1F) <= MAX_VFAT_ENTRIES) { //TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table. n = ((VFAT->sequenceNumber & 0x1F) - 1) * 13; 27158: 8d e0 ldi r24, 0x0D ; 13 2715a: d8 2e mov r13, r24 { longFilename[0] = '\0'; } while (1) { n = read(dir, sizeof(dir_t)); 2715c: 40 e2 ldi r20, 0x20 ; 32 2715e: 50 e0 ldi r21, 0x00 ; 0 27160: be 01 movw r22, r28 27162: c8 01 movw r24, r16 27164: 0f 94 6c 71 call 0x2e2d8 ; 0x2e2d8 if (n != sizeof(dir_t)) return n == 0 ? 0 : -1; 27168: 80 32 cpi r24, 0x20 ; 32 2716a: 91 05 cpc r25, r1 2716c: 71 f0 breq .+28 ; 0x2718a 2716e: 21 e0 ldi r18, 0x01 ; 1 27170: 89 2b or r24, r25 27172: 09 f4 brne .+2 ; 0x27176 27174: 20 e0 ldi r18, 0x00 ; 0 27176: 82 2f mov r24, r18 27178: 81 95 neg r24 } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; } } 2717a: df 91 pop r29 2717c: cf 91 pop r28 2717e: 1f 91 pop r17 27180: 0f 91 pop r16 27182: ff 90 pop r15 27184: ef 90 pop r14 27186: df 90 pop r13 27188: 08 95 ret while (1) { n = read(dir, sizeof(dir_t)); if (n != sizeof(dir_t)) return n == 0 ? 0 : -1; // last entry if DIR_NAME_FREE if (dir->name[0] == DIR_NAME_FREE) return 0; 2718a: 28 81 ld r18, Y 2718c: 22 23 and r18, r18 2718e: 09 f4 brne .+2 ; 0x27192 27190: 3f c0 rjmp .+126 ; 0x27210 // skip empty entries and entry for . and .. if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') continue; 27192: 25 3e cpi r18, 0xE5 ; 229 27194: 19 f3 breq .-58 ; 0x2715c 27196: 2e 32 cpi r18, 0x2E ; 46 27198: 09 f3 breq .-62 ; 0x2715c //Fill the long filename if we have a long filename entry, // long filename entries are stored before the actual filename. if (DIR_IS_LONG_NAME(dir) && longFilename != NULL) 2719a: 3b 85 ldd r19, Y+11 ; 0x0b 2719c: 3f 73 andi r19, 0x3F ; 63 2719e: 3f 30 cpi r19, 0x0F ; 15 271a0: 99 f5 brne .+102 ; 0x27208 271a2: e1 14 cp r14, r1 271a4: f1 04 cpc r15, r1 271a6: 81 f1 breq .+96 ; 0x27208 { vfat_t *VFAT = (vfat_t*)dir; //Sanity check the VFAT entry. The first cluster is always set to zero. And th esequence number should be higher then 0 if (VFAT->firstClusterLow == 0 && (VFAT->sequenceNumber & 0x1F) > 0 && (VFAT->sequenceNumber & 0x1F) <= MAX_VFAT_ENTRIES) 271a8: 4a 8d ldd r20, Y+26 ; 0x1a 271aa: 5b 8d ldd r21, Y+27 ; 0x1b 271ac: 45 2b or r20, r21 271ae: 61 f5 brne .+88 ; 0x27208 271b0: 2f 71 andi r18, 0x1F ; 31 271b2: 3f ef ldi r19, 0xFF ; 255 271b4: 32 0f add r19, r18 271b6: 34 30 cpi r19, 0x04 ; 4 271b8: 38 f5 brcc .+78 ; 0x27208 { //TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table. n = ((VFAT->sequenceNumber & 0x1F) - 1) * 13; 271ba: 21 50 subi r18, 0x01 ; 1 271bc: 33 0b sbc r19, r19 271be: d2 9e mul r13, r18 271c0: c0 01 movw r24, r0 271c2: d3 9e mul r13, r19 271c4: 90 0d add r25, r0 271c6: 11 24 eor r1, r1 longFilename[n+0] = VFAT->name1[0]; 271c8: f7 01 movw r30, r14 271ca: e8 0f add r30, r24 271cc: f9 1f adc r31, r25 271ce: 29 81 ldd r18, Y+1 ; 0x01 271d0: 20 83 st Z, r18 longFilename[n+1] = VFAT->name1[1]; 271d2: 2b 81 ldd r18, Y+3 ; 0x03 271d4: 21 83 std Z+1, r18 ; 0x01 longFilename[n+2] = VFAT->name1[2]; 271d6: 2d 81 ldd r18, Y+5 ; 0x05 271d8: 22 83 std Z+2, r18 ; 0x02 longFilename[n+3] = VFAT->name1[3]; 271da: 2f 81 ldd r18, Y+7 ; 0x07 271dc: 23 83 std Z+3, r18 ; 0x03 longFilename[n+4] = VFAT->name1[4]; 271de: 29 85 ldd r18, Y+9 ; 0x09 271e0: 24 83 std Z+4, r18 ; 0x04 longFilename[n+5] = VFAT->name2[0]; 271e2: 2e 85 ldd r18, Y+14 ; 0x0e 271e4: 25 83 std Z+5, r18 ; 0x05 longFilename[n+6] = VFAT->name2[1]; 271e6: 28 89 ldd r18, Y+16 ; 0x10 271e8: 26 83 std Z+6, r18 ; 0x06 longFilename[n+7] = VFAT->name2[2]; 271ea: 2a 89 ldd r18, Y+18 ; 0x12 271ec: 27 83 std Z+7, r18 ; 0x07 longFilename[n+8] = VFAT->name2[3]; 271ee: 2c 89 ldd r18, Y+20 ; 0x14 271f0: 20 87 std Z+8, r18 ; 0x08 longFilename[n+9] = VFAT->name2[4]; 271f2: 2e 89 ldd r18, Y+22 ; 0x16 271f4: 21 87 std Z+9, r18 ; 0x09 longFilename[n+10] = VFAT->name2[5]; 271f6: 28 8d ldd r18, Y+24 ; 0x18 271f8: 22 87 std Z+10, r18 ; 0x0a longFilename[n+11] = VFAT->name3[0]; 271fa: 2c 8d ldd r18, Y+28 ; 0x1c 271fc: 23 87 std Z+11, r18 ; 0x0b longFilename[n+12] = VFAT->name3[1]; 271fe: 2e 8d ldd r18, Y+30 ; 0x1e 27200: 24 87 std Z+12, r18 ; 0x0c //If this VFAT entry is the last one, add a NUL terminator at the end of the string if (VFAT->sequenceNumber & 0x40) 27202: 28 81 ld r18, Y 27204: 26 fd sbrc r18, 6 longFilename[n+13] = '\0'; 27206: 15 86 std Z+13, r1 ; 0x0d } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; 27208: 2b 85 ldd r18, Y+11 ; 0x0b 2720a: 23 fd sbrc r18, 3 2720c: a7 cf rjmp .-178 ; 0x2715c 2720e: b5 cf rjmp .-150 ; 0x2717a while (1) { n = read(dir, sizeof(dir_t)); if (n != sizeof(dir_t)) return n == 0 ? 0 : -1; // last entry if DIR_NAME_FREE if (dir->name[0] == DIR_NAME_FREE) return 0; 27210: 80 e0 ldi r24, 0x00 ; 0 27212: b3 cf rjmp .-154 ; 0x2717a 00027214 : * \return The value one, true, is returned for success and * the value zero, false, is returned for failure. * Reasons for failure include a call to sync() before a file has been * opened or an I/O error. */ bool SdBaseFile::sync() { 27214: cf 93 push r28 27216: df 93 push r29 27218: ec 01 movw r28, r24 // only allow open files and directories if (!isOpen()) goto fail; 2721a: 8b 81 ldd r24, Y+3 ; 0x03 2721c: 88 23 and r24, r24 2721e: 49 f1 breq .+82 ; 0x27272 if (flags_ & F_FILE_DIR_DIRTY) { 27220: 89 81 ldd r24, Y+1 ; 0x01 27222: 87 ff sbrs r24, 7 27224: 22 c0 rjmp .+68 ; 0x2726a dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 27226: 61 e0 ldi r22, 0x01 ; 1 27228: ce 01 movw r24, r28 2722a: 0f 94 9b 6e call 0x2dd36 ; 0x2dd36 2722e: fc 01 movw r30, r24 // check for deleted by another open file object if (!d || d->name[0] == DIR_NAME_DELETED) goto fail; 27230: 89 2b or r24, r25 27232: f9 f0 breq .+62 ; 0x27272 27234: 80 81 ld r24, Z 27236: 85 3e cpi r24, 0xE5 ; 229 27238: e1 f0 breq .+56 ; 0x27272 // do not set filesize for dir files if (!isDir()) d->fileSize = fileSize_; 2723a: 8b 81 ldd r24, Y+3 ; 0x03 2723c: 82 30 cpi r24, 0x02 ; 2 2723e: 40 f4 brcc .+16 ; 0x27250 27240: 89 89 ldd r24, Y+17 ; 0x11 27242: 9a 89 ldd r25, Y+18 ; 0x12 27244: ab 89 ldd r26, Y+19 ; 0x13 27246: bc 89 ldd r27, Y+20 ; 0x14 27248: 84 8f std Z+28, r24 ; 0x1c 2724a: 95 8f std Z+29, r25 ; 0x1d 2724c: a6 8f std Z+30, r26 ; 0x1e 2724e: b7 8f std Z+31, r27 ; 0x1f // update first cluster fields d->firstClusterLow = firstCluster_ & 0XFFFF; 27250: 8d 89 ldd r24, Y+21 ; 0x15 27252: 9e 89 ldd r25, Y+22 ; 0x16 27254: 93 8f std Z+27, r25 ; 0x1b 27256: 82 8f std Z+26, r24 ; 0x1a d->firstClusterHigh = firstCluster_ >> 16; 27258: 8d 89 ldd r24, Y+21 ; 0x15 2725a: 9e 89 ldd r25, Y+22 ; 0x16 2725c: af 89 ldd r26, Y+23 ; 0x17 2725e: b8 8d ldd r27, Y+24 ; 0x18 27260: b5 8b std Z+21, r27 ; 0x15 27262: a4 8b std Z+20, r26 ; 0x14 if (dateTime_) { dateTime_(&d->lastWriteDate, &d->lastWriteTime); d->lastAccessDate = d->lastWriteDate; } // clear directory dirty flags_ &= ~F_FILE_DIR_DIRTY; 27264: 89 81 ldd r24, Y+1 ; 0x01 27266: 8f 77 andi r24, 0x7F ; 127 27268: 89 83 std Y+1, r24 ; 0x01 return vol_->cacheFlush(); fail: writeError = true; return false; } 2726a: df 91 pop r29 2726c: cf 91 pop r28 d->lastAccessDate = d->lastWriteDate; } // clear directory dirty flags_ &= ~F_FILE_DIR_DIRTY; } return vol_->cacheFlush(); 2726e: 0d 94 2e 36 jmp 0x26c5c ; 0x26c5c fail: writeError = true; 27272: 81 e0 ldi r24, 0x01 ; 1 27274: 88 83 st Y, r24 return false; } 27276: 80 e0 ldi r24, 0x00 ; 0 27278: df 91 pop r29 2727a: cf 91 pop r28 2727c: 08 95 ret 0002727e : * \param[in] pos The new position in bytes from the beginning of the file. * * \return The value one, true, is returned for success and * the value zero, false, is returned for failure. */ bool SdBaseFile::seekSet(uint32_t pos) { 2727e: 8f 92 push r8 27280: 9f 92 push r9 27282: af 92 push r10 27284: bf 92 push r11 27286: cf 92 push r12 27288: df 92 push r13 2728a: ef 92 push r14 2728c: ff 92 push r15 2728e: 0f 93 push r16 27290: 1f 93 push r17 27292: cf 93 push r28 27294: df 93 push r29 27296: ec 01 movw r28, r24 27298: 8b 81 ldd r24, Y+3 ; 0x03 uint32_t nCur; uint32_t nNew; // error if file not open or seek past end of file if (!isOpen() || pos > fileSize_) goto fail; 2729a: 81 11 cpse r24, r1 2729c: 0e c0 rjmp .+28 ; 0x272ba done: return true; fail: return false; 2729e: 80 e0 ldi r24, 0x00 ; 0 } 272a0: df 91 pop r29 272a2: cf 91 pop r28 272a4: 1f 91 pop r17 272a6: 0f 91 pop r16 272a8: ff 90 pop r15 272aa: ef 90 pop r14 272ac: df 90 pop r13 272ae: cf 90 pop r12 272b0: bf 90 pop r11 272b2: af 90 pop r10 272b4: 9f 90 pop r9 272b6: 8f 90 pop r8 272b8: 08 95 ret */ bool SdBaseFile::seekSet(uint32_t pos) { uint32_t nCur; uint32_t nNew; // error if file not open or seek past end of file if (!isOpen() || pos > fileSize_) goto fail; 272ba: 09 89 ldd r16, Y+17 ; 0x11 272bc: 1a 89 ldd r17, Y+18 ; 0x12 272be: 2b 89 ldd r18, Y+19 ; 0x13 272c0: 3c 89 ldd r19, Y+20 ; 0x14 272c2: 04 17 cp r16, r20 272c4: 15 07 cpc r17, r21 272c6: 26 07 cpc r18, r22 272c8: 37 07 cpc r19, r23 272ca: 48 f3 brcs .-46 ; 0x2729e 272cc: 4a 01 movw r8, r20 272ce: 5b 01 movw r10, r22 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 272d0: 82 30 cpi r24, 0x02 ; 2 272d2: 31 f4 brne .+12 ; 0x272e0 curPosition_ = pos; 272d4: 88 86 std Y+8, r8 ; 0x08 272d6: 99 86 std Y+9, r9 ; 0x09 272d8: aa 86 std Y+10, r10 ; 0x0a 272da: bb 86 std Y+11, r11 ; 0x0b if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; } curPosition_ = pos; done: return true; 272dc: 81 e0 ldi r24, 0x01 ; 1 272de: e0 cf rjmp .-64 ; 0x272a0 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { curPosition_ = pos; goto done; } if (pos == 0) { 272e0: 81 14 cp r8, r1 272e2: 91 04 cpc r9, r1 272e4: a1 04 cpc r10, r1 272e6: b1 04 cpc r11, r1 272e8: 49 f4 brne .+18 ; 0x272fc // set position to start of file curCluster_ = 0; 272ea: 1c 82 std Y+4, r1 ; 0x04 272ec: 1d 82 std Y+5, r1 ; 0x05 272ee: 1e 82 std Y+6, r1 ; 0x06 272f0: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 272f2: 18 86 std Y+8, r1 ; 0x08 272f4: 19 86 std Y+9, r1 ; 0x09 272f6: 1a 86 std Y+10, r1 ; 0x0a 272f8: 1b 86 std Y+11, r1 ; 0x0b 272fa: f0 cf rjmp .-32 ; 0x272dc goto done; } // calculate cluster index for cur and new position nCur = (curPosition_ - 1) >> (vol_->clusterSizeShift_ + 9); 272fc: 08 85 ldd r16, Y+8 ; 0x08 272fe: 19 85 ldd r17, Y+9 ; 0x09 27300: 2a 85 ldd r18, Y+10 ; 0x0a 27302: 3b 85 ldd r19, Y+11 ; 0x0b 27304: e9 8d ldd r30, Y+25 ; 0x19 27306: fa 8d ldd r31, Y+26 ; 0x1a 27308: 85 85 ldd r24, Z+13 ; 0x0d 2730a: 90 e0 ldi r25, 0x00 ; 0 2730c: 09 96 adiw r24, 0x09 ; 9 2730e: b9 01 movw r22, r18 27310: a8 01 movw r20, r16 27312: 41 50 subi r20, 0x01 ; 1 27314: 51 09 sbc r21, r1 27316: 61 09 sbc r22, r1 27318: 71 09 sbc r23, r1 2731a: 08 2e mov r0, r24 2731c: 04 c0 rjmp .+8 ; 0x27326 2731e: 76 95 lsr r23 27320: 67 95 ror r22 27322: 57 95 ror r21 27324: 47 95 ror r20 27326: 0a 94 dec r0 27328: d2 f7 brpl .-12 ; 0x2731e nNew = (pos - 1) >> (vol_->clusterSizeShift_ + 9); 2732a: 75 01 movw r14, r10 2732c: 64 01 movw r12, r8 2732e: e1 e0 ldi r30, 0x01 ; 1 27330: ce 1a sub r12, r30 27332: d1 08 sbc r13, r1 27334: e1 08 sbc r14, r1 27336: f1 08 sbc r15, r1 27338: 04 c0 rjmp .+8 ; 0x27342 2733a: f6 94 lsr r15 2733c: e7 94 ror r14 2733e: d7 94 ror r13 27340: c7 94 ror r12 27342: 8a 95 dec r24 27344: d2 f7 brpl .-12 ; 0x2733a if (nNew < nCur || curPosition_ == 0) { 27346: c4 16 cp r12, r20 27348: d5 06 cpc r13, r21 2734a: e6 06 cpc r14, r22 2734c: f7 06 cpc r15, r23 2734e: 20 f0 brcs .+8 ; 0x27358 27350: 01 2b or r16, r17 27352: 02 2b or r16, r18 27354: 03 2b or r16, r19 27356: 11 f5 brne .+68 ; 0x2739c // must follow chain from first cluster curCluster_ = firstCluster_; 27358: 8d 89 ldd r24, Y+21 ; 0x15 2735a: 9e 89 ldd r25, Y+22 ; 0x16 2735c: af 89 ldd r26, Y+23 ; 0x17 2735e: b8 8d ldd r27, Y+24 ; 0x18 27360: 8c 83 std Y+4, r24 ; 0x04 27362: 9d 83 std Y+5, r25 ; 0x05 27364: ae 83 std Y+6, r26 ; 0x06 27366: bf 83 std Y+7, r27 ; 0x07 } else { // advance from curPosition nNew -= nCur; } while (nNew--) { if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 27368: 8e 01 movw r16, r28 2736a: 0c 5f subi r16, 0xFC ; 252 2736c: 1f 4f sbci r17, 0xFF ; 255 curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; } while (nNew--) { 2736e: c1 14 cp r12, r1 27370: d1 04 cpc r13, r1 27372: e1 04 cpc r14, r1 27374: f1 04 cpc r15, r1 27376: 09 f4 brne .+2 ; 0x2737a 27378: ad cf rjmp .-166 ; 0x272d4 if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2737a: 4c 81 ldd r20, Y+4 ; 0x04 2737c: 5d 81 ldd r21, Y+5 ; 0x05 2737e: 6e 81 ldd r22, Y+6 ; 0x06 27380: 7f 81 ldd r23, Y+7 ; 0x07 27382: 98 01 movw r18, r16 27384: 89 8d ldd r24, Y+25 ; 0x19 27386: 9a 8d ldd r25, Y+26 ; 0x1a 27388: 0f 94 3c 37 call 0x26e78 ; 0x26e78 2738c: 91 e0 ldi r25, 0x01 ; 1 2738e: c9 1a sub r12, r25 27390: d1 08 sbc r13, r1 27392: e1 08 sbc r14, r1 27394: f1 08 sbc r15, r1 27396: 81 11 cpse r24, r1 27398: ea cf rjmp .-44 ; 0x2736e 2739a: 81 cf rjmp .-254 ; 0x2729e if (nNew < nCur || curPosition_ == 0) { // must follow chain from first cluster curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; 2739c: c4 1a sub r12, r20 2739e: d5 0a sbc r13, r21 273a0: e6 0a sbc r14, r22 273a2: f7 0a sbc r15, r23 273a4: e1 cf rjmp .-62 ; 0x27368 000273a6 : lcd_printf_P(_T(MSG_SHEET_OFFSET), sheet_name, offset, menuData->reset ? ' ' : '>', menuData->reset ? '>' : ' ');// \n denotes line break, %.7s is replaced by 7 character long sheet name, %+1.3f is replaced by 6 character long floating point number, %c is replaced by > or white space (one character) based on whether first or second option is selected. % denoted place holders can not be reordered. } void lcd_v2_calibration() { 273a6: cf 93 push r28 273a8: df 93 push r29 if (MMU2::mmu2.Enabled()) { 273aa: 80 91 94 12 lds r24, 0x1294 ; 0x801294 273ae: 81 30 cpi r24, 0x01 ; 1 273b0: e9 f4 brne .+58 ; 0x273ec const uint8_t filament = choose_menu_P( 273b2: 85 ee ldi r24, 0xE5 ; 229 273b4: 9d e4 ldi r25, 0x4D ; 77 273b6: 0e 94 b1 6c call 0xd962 ; 0xd962 273ba: ec 01 movw r28, r24 273bc: 84 e2 ldi r24, 0x24 ; 36 273be: 9e e3 ldi r25, 0x3E ; 62 273c0: 0e 94 b1 6c call 0xd962 ; 0xd962 _T(MSG_SELECT_FILAMENT), MSG_FILAMENT,_T(MSG_CANCEL)); 273c4: be 01 movw r22, r28 273c6: 0e 94 ea bc call 0x179d4 ; 0x179d4 if (filament < MMU_FILAMENT_COUNT) { 273ca: 85 30 cpi r24, 0x05 ; 5 273cc: a0 f5 brcc .+104 ; 0x27436 lay1cal_filament = filament; 273ce: 80 93 af 03 sts 0x03AF, r24 ; 0x8003af <_ZL16lay1cal_filament.lto_priv.409> return; } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; 273d2: 8a e0 ldi r24, 0x0A ; 10 273d4: 80 93 62 03 sts 0x0362, r24 ; 0x800362 menu_goto(lcd_generic_preheat_menu, 0, true); 273d8: 20 e0 ldi r18, 0x00 ; 0 273da: 41 e0 ldi r20, 0x01 ; 1 273dc: 70 e0 ldi r23, 0x00 ; 0 273de: 60 e0 ldi r22, 0x00 ; 0 273e0: 85 e1 ldi r24, 0x15 ; 21 273e2: 98 e3 ldi r25, 0x38 ; 56 } 273e4: df 91 pop r29 273e6: cf 91 pop r28 } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); 273e8: 0d 94 e6 92 jmp 0x325cc ; 0x325cc menu_back(); return; } } #ifdef FILAMENT_SENSOR else if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 273ec: 8f e5 ldi r24, 0x5F ; 95 273ee: 9f e0 ldi r25, 0x0F ; 15 273f0: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 273f4: 81 11 cpse r24, r1 273f6: ed cf rjmp .-38 ; 0x273d2 { bool loaded = false; if (fsensor.isReady()) { 273f8: 80 91 84 16 lds r24, 0x1684 ; 0x801684 273fc: 82 30 cpi r24, 0x02 ; 2 273fe: f9 f4 brne .+62 ; 0x2743e loaded = fsensor.getFilamentPresent(); 27400: 0e 94 fc c3 call 0x187f8 ; 0x187f8 27404: 98 2f mov r25, r24 } else { loaded = !lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_FILAMENT_LOADED), false, LCD_MIDDLE_BUTTON_CHOICE); lcd_update_enabled = true; } if (!loaded) { 27406: 91 11 cpse r25, r1 27408: e4 cf rjmp .-56 ; 0x273d2 lcd_display_message_fullscreen_P(_T(MSG_PLEASE_LOAD_PLA)); 2740a: 87 ec ldi r24, 0xC7 ; 199 2740c: 9d e4 ldi r25, 0x4D ; 77 2740e: 0e 94 b1 6c call 0xd962 ; 0xd962 27412: 0f 94 c0 0a call 0x21580 ; 0x21580 lcd_consume_click(); 27416: 0e 94 93 6b call 0xd726 ; 0xd726 2741a: c4 e1 ldi r28, 0x14 ; 20 for (uint_least8_t i = 0; i < 20; i++) { //wait max. 2s delay_keep_alive(100); 2741c: 84 e6 ldi r24, 0x64 ; 100 2741e: 90 e0 ldi r25, 0x00 ; 0 27420: 0e 94 48 7c call 0xf890 ; 0xf890 if (lcd_clicked()) { 27424: 0e 94 98 6b call 0xd730 ; 0xd730 27428: 81 11 cpse r24, r1 2742a: 02 c0 rjmp .+4 ; 0x27430 2742c: c1 50 subi r28, 0x01 ; 1 } if (!loaded) { lcd_display_message_fullscreen_P(_T(MSG_PLEASE_LOAD_PLA)); lcd_consume_click(); for (uint_least8_t i = 0; i < 20; i++) { //wait max. 2s 2742e: b1 f7 brne .-20 ; 0x2741c delay_keep_alive(100); if (lcd_clicked()) { break; } } lcd_update_enabled = true; 27430: 81 e0 ldi r24, 0x01 ; 1 27432: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); } 27436: df 91 pop r29 27438: cf 91 pop r28 if (lcd_clicked()) { break; } } lcd_update_enabled = true; menu_back(); 2743a: 0d 94 84 95 jmp 0x32b08 ; 0x32b08 { bool loaded = false; if (fsensor.isReady()) { loaded = fsensor.getFilamentPresent(); } else { loaded = !lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_FILAMENT_LOADED), false, LCD_MIDDLE_BUTTON_CHOICE); 2743e: 80 ee ldi r24, 0xE0 ; 224 27440: 92 e5 ldi r25, 0x52 ; 82 27442: 0e 94 b1 6c call 0xd962 ; 0xd962 27446: 41 e0 ldi r20, 0x01 ; 1 27448: 60 e0 ldi r22, 0x00 ; 0 2744a: 0f 94 e0 2d call 0x25bc0 ; 0x25bc0 2744e: 91 e0 ldi r25, 0x01 ; 1 27450: 81 11 cpse r24, r1 27452: 90 e0 ldi r25, 0x00 ; 0 lcd_update_enabled = true; 27454: 81 e0 ldi r24, 0x01 ; 1 27456: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c 2745a: d5 cf rjmp .-86 ; 0x27406 0002745c : pat9125_s, pat9125_y); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } void lcd_menu_show_sensors_state() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") { 2745c: cf 93 push r28 2745e: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 { //0: N/A; 1: OFF; 2: ON uint8_t pinda_state = STATE_NA; uint8_t idler_state = STATE_NA; pinda_state = READ(Z_MIN_PIN); 27462: c3 b1 in r28, 0x03 ; 3 lcd_puts_at_P(0, 0, MSG_PINDA); 27464: 48 e3 ldi r20, 0x38 ; 56 27466: 5b e6 ldi r21, 0x6B ; 107 27468: 60 e0 ldi r22, 0x00 ; 0 2746a: 80 e0 ldi r24, 0x00 ; 0 2746c: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_set_cursor(LCD_WIDTH - 14, 0); 27470: 60 e0 ldi r22, 0x00 ; 0 27472: 86 e0 ldi r24, 0x06 ; 6 27474: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_print_state(pinda_state); 27478: c4 fb bst r28, 4 2747a: 88 27 eor r24, r24 2747c: 80 f9 bld r24, 0 2747e: 0f 94 de 02 call 0x205bc ; 0x205bc if (MMU2::mmu2.Enabled()) { 27482: 80 91 94 12 lds r24, 0x1294 ; 0x801294 27486: 81 30 cpi r24, 0x01 ; 1 27488: 99 f4 brne .+38 ; 0x274b0 inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 2748a: c1 e0 ldi r28, 0x01 ; 1 2748c: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 27490: 81 11 cpse r24, r1 27492: 01 c0 rjmp .+2 ; 0x27496 27494: c0 e0 ldi r28, 0x00 ; 0 const uint8_t finda_state = MMU2::mmu2.FindaDetectsFilament(); lcd_puts_at_P(10, 0, _n("FINDA"));////MSG_FINDA c=5 27496: 42 e3 ldi r20, 0x32 ; 50 27498: 5b e6 ldi r21, 0x6B ; 107 2749a: 60 e0 ldi r22, 0x00 ; 0 2749c: 8a e0 ldi r24, 0x0A ; 10 2749e: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_set_cursor(LCD_WIDTH - 3, 0); 274a2: 60 e0 ldi r22, 0x00 ; 0 274a4: 81 e1 ldi r24, 0x11 ; 17 274a6: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_print_state(finda_state); 274aa: 8c 2f mov r24, r28 274ac: 0f 94 de 02 call 0x205bc ; 0x205bc } #ifdef FILAMENT_SENSOR idler_state = fsensor.getFilamentPresent(); 274b0: 0e 94 fc c3 call 0x187f8 ; 0x187f8 274b4: c8 2f mov r28, r24 lcd_puts_at_P(0, 1, _T(MSG_FSENSOR)); 274b6: 8d e4 ldi r24, 0x4D ; 77 274b8: 9d e3 ldi r25, 0x3D ; 61 274ba: 0e 94 b1 6c call 0xd962 ; 0xd962 274be: ac 01 movw r20, r24 274c0: 61 e0 ldi r22, 0x01 ; 1 274c2: 80 e0 ldi r24, 0x00 ; 0 274c4: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_set_cursor(LCD_WIDTH - 3, 1); 274c8: 61 e0 ldi r22, 0x01 ; 1 274ca: 81 e1 ldi r24, 0x11 ; 17 274cc: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_print_state(idler_state); 274d0: 8c 2f mov r24, r28 274d2: 0f 94 de 02 call 0x205bc ; 0x205bc void lcd_menu_show_sensors_state() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") { lcd_timeoutToStatus.stop(); lcd_show_sensors_state(); menu_back_if_clicked(); } 274d6: cf 91 pop r28 void lcd_menu_show_sensors_state() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") { lcd_timeoutToStatus.stop(); lcd_show_sensors_state(); menu_back_if_clicked(); 274d8: 0d 94 26 96 jmp 0x32c4c ; 0x32c4c 000274dc : } // think twice before allowing this to inline - manipulating 4B longs is costly // moreover - this function has its parameters in registers only, so no heavy stack usage besides the call/ret void __attribute__((noinline)) SdFile::gfUpdateCurrentPosition(uint16_t inc){ curPosition_ += inc; 274dc: e2 e0 ldi r30, 0x02 ; 2 274de: f6 e1 ldi r31, 0x16 ; 22 274e0: 40 81 ld r20, Z 274e2: 51 81 ldd r21, Z+1 ; 0x01 274e4: 62 81 ldd r22, Z+2 ; 0x02 274e6: 73 81 ldd r23, Z+3 ; 0x03 274e8: 48 0f add r20, r24 274ea: 59 1f adc r21, r25 274ec: 61 1d adc r22, r1 274ee: 71 1d adc r23, r1 274f0: 40 83 st Z, r20 274f2: 51 83 std Z+1, r21 ; 0x01 274f4: 62 83 std Z+2, r22 ; 0x02 274f6: 73 83 std Z+3, r23 ; 0x03 } 274f8: 08 95 ret 000274fa : float median(float *points, const uint8_t num_points){ sort(points, num_points); return points[num_points / 2]; } float __attribute__ ((noinline)) CLAMP_median(float *shifts, uint8_t blocks, float norm){ 274fa: 2f 92 push r2 274fc: 3f 92 push r3 274fe: 4f 92 push r4 27500: 5f 92 push r5 27502: 6f 92 push r6 27504: 7f 92 push r7 27506: 8f 92 push r8 27508: 9f 92 push r9 2750a: af 92 push r10 2750c: bf 92 push r11 2750e: cf 92 push r12 27510: df 92 push r13 27512: ef 92 push r14 27514: ff 92 push r15 27516: 0f 93 push r16 27518: 1f 93 push r17 2751a: cf 93 push r28 2751c: df 93 push r29 2751e: 00 d0 rcall .+0 ; 0x27520 27520: 1f 92 push r1 27522: 1f 92 push r1 27524: cd b7 in r28, 0x3d ; 61 27526: de b7 in r29, 0x3e ; 62 27528: 1c 01 movw r2, r24 2752a: 2a 01 movw r4, r20 2752c: 3b 01 movw r6, r22 2752e: 00 e2 ldi r16, 0x20 ; 32 27530: 10 e0 ldi r17, 0x00 ; 0 /// slow bubble sort but short void sort(float *points, const uint8_t num_points){ /// one direction bubble sort for (uint8_t i = 0; i < num_points; ++i){ for (uint8_t j = 0; j < num_points - i - 1; ++j){ 27532: 19 82 std Y+1, r1 ; 0x01 27534: 99 81 ldd r25, Y+1 ; 0x01 27536: 89 2f mov r24, r25 27538: 90 e0 ldi r25, 0x00 ; 0 2753a: 9b 83 std Y+3, r25 ; 0x03 2753c: 8a 83 std Y+2, r24 ; 0x02 2753e: 80 17 cp r24, r16 27540: 91 07 cpc r25, r17 27542: 9c f5 brge .+102 ; 0x275aa if (points[j] > points[j + 1]) 27544: 88 0f add r24, r24 27546: 99 1f adc r25, r25 27548: 88 0f add r24, r24 2754a: 99 1f adc r25, r25 2754c: 9d 83 std Y+5, r25 ; 0x05 2754e: 8c 83 std Y+4, r24 ; 0x04 27550: 82 0d add r24, r2 27552: 93 1d adc r25, r3 27554: 9b 83 std Y+3, r25 ; 0x03 27556: 8a 83 std Y+2, r24 ; 0x02 27558: fc 01 movw r30, r24 2755a: c0 80 ld r12, Z 2755c: d1 80 ldd r13, Z+1 ; 0x01 2755e: e2 80 ldd r14, Z+2 ; 0x02 27560: f3 80 ldd r15, Z+3 ; 0x03 27562: 8c 81 ldd r24, Y+4 ; 0x04 27564: 9d 81 ldd r25, Y+5 ; 0x05 27566: 04 96 adiw r24, 0x04 ; 4 27568: 82 0d add r24, r2 2756a: 93 1d adc r25, r3 2756c: 9d 83 std Y+5, r25 ; 0x05 2756e: 8c 83 std Y+4, r24 ; 0x04 27570: fc 01 movw r30, r24 27572: 80 80 ld r8, Z 27574: 91 80 ldd r9, Z+1 ; 0x01 27576: a2 80 ldd r10, Z+2 ; 0x02 27578: b3 80 ldd r11, Z+3 ; 0x03 2757a: a5 01 movw r20, r10 2757c: 94 01 movw r18, r8 2757e: c7 01 movw r24, r14 27580: b6 01 movw r22, r12 27582: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 27586: 18 16 cp r1, r24 27588: 64 f4 brge .+24 ; 0x275a2 SWAP(points[j], points[j + 1]); 2758a: ea 81 ldd r30, Y+2 ; 0x02 2758c: fb 81 ldd r31, Y+3 ; 0x03 2758e: 80 82 st Z, r8 27590: 91 82 std Z+1, r9 ; 0x01 27592: a2 82 std Z+2, r10 ; 0x02 27594: b3 82 std Z+3, r11 ; 0x03 27596: ec 81 ldd r30, Y+4 ; 0x04 27598: fd 81 ldd r31, Y+5 ; 0x05 2759a: c0 82 st Z, r12 2759c: d1 82 std Z+1, r13 ; 0x01 2759e: e2 82 std Z+2, r14 ; 0x02 275a0: f3 82 std Z+3, r15 ; 0x03 /// slow bubble sort but short void sort(float *points, const uint8_t num_points){ /// one direction bubble sort for (uint8_t i = 0; i < num_points; ++i){ for (uint8_t j = 0; j < num_points - i - 1; ++j){ 275a2: f9 81 ldd r31, Y+1 ; 0x01 275a4: ff 5f subi r31, 0xFF ; 255 275a6: f9 83 std Y+1, r31 ; 0x01 275a8: c5 cf rjmp .-118 ; 0x27534 275aa: 01 50 subi r16, 0x01 ; 1 275ac: 11 09 sbc r17, r1 275ae: 08 f6 brcc .-126 ; 0x27532 /// sort array and returns median value /// don't send empty array or nullptr float median(float *points, const uint8_t num_points){ sort(points, num_points); return points[num_points / 2]; 275b0: f1 01 movw r30, r2 275b2: e0 5c subi r30, 0xC0 ; 192 275b4: ff 4f sbci r31, 0xFF ; 255 } float __attribute__ ((noinline)) CLAMP_median(float *shifts, uint8_t blocks, float norm){ const constexpr float max_change = 0.5f; ///< avoids too fast changes (avoid oscillation) return CLAMP( median(shifts, blocks) * norm, -max_change, max_change); 275b6: 20 81 ld r18, Z 275b8: 31 81 ldd r19, Z+1 ; 0x01 275ba: 42 81 ldd r20, Z+2 ; 0x02 275bc: 53 81 ldd r21, Z+3 ; 0x03 275be: c3 01 movw r24, r6 275c0: b2 01 movw r22, r4 275c2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 275c6: 6b 01 movw r12, r22 275c8: 7c 01 movw r14, r24 275ca: 20 e0 ldi r18, 0x00 ; 0 275cc: 30 e0 ldi r19, 0x00 ; 0 275ce: 40 e0 ldi r20, 0x00 ; 0 275d0: 5f eb ldi r21, 0xBF ; 191 275d2: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 275d6: 87 fd sbrc r24, 7 275d8: 10 c0 rjmp .+32 ; 0x275fa 275da: 20 e0 ldi r18, 0x00 ; 0 275dc: 30 e0 ldi r19, 0x00 ; 0 275de: 40 e0 ldi r20, 0x00 ; 0 275e0: 5f e3 ldi r21, 0x3F ; 63 275e2: c7 01 movw r24, r14 275e4: b6 01 movw r22, r12 275e6: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 275ea: 18 16 cp r1, r24 275ec: 5c f4 brge .+22 ; 0x27604 275ee: c1 2c mov r12, r1 275f0: d1 2c mov r13, r1 275f2: e1 2c mov r14, r1 275f4: 8f e3 ldi r24, 0x3F ; 63 275f6: f8 2e mov r15, r24 275f8: 05 c0 rjmp .+10 ; 0x27604 275fa: c1 2c mov r12, r1 275fc: d1 2c mov r13, r1 275fe: e1 2c mov r14, r1 27600: 9f eb ldi r25, 0xBF ; 191 27602: f9 2e mov r15, r25 } 27604: c7 01 movw r24, r14 27606: b6 01 movw r22, r12 27608: 0f 90 pop r0 2760a: 0f 90 pop r0 2760c: 0f 90 pop r0 2760e: 0f 90 pop r0 27610: 0f 90 pop r0 27612: df 91 pop r29 27614: cf 91 pop r28 27616: 1f 91 pop r17 27618: 0f 91 pop r16 2761a: ff 90 pop r15 2761c: ef 90 pop r14 2761e: df 90 pop r13 27620: cf 90 pop r12 27622: bf 90 pop r11 27624: af 90 pop r10 27626: 9f 90 pop r9 27628: 8f 90 pop r8 2762a: 7f 90 pop r7 2762c: 6f 90 pop r6 2762e: 5f 90 pop r5 27630: 4f 90 pop r4 27632: 3f 90 pop r3 27634: 2f 90 pop r2 27636: 08 95 ret 00027638 : bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); } void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); 27638: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 2763c: 60 93 34 12 sts 0x1234, r22 ; 0x801234 27640: 70 93 35 12 sts 0x1235, r23 ; 0x801235 27644: 80 93 36 12 sts 0x1236, r24 ; 0x801236 27648: 90 93 37 12 sts 0x1237, r25 ; 0x801237 } 2764c: 08 95 ret 0002764e : } return (uint8_t)ReqMsg().code; } void ProtocolLogic::DecrementRetryAttempts() { if (inAutoRetry && retryAttempts) { 2764e: 80 91 7a 12 lds r24, 0x127A ; 0x80127a 27652: 88 23 and r24, r24 27654: 69 f0 breq .+26 ; 0x27670 27656: 80 91 79 12 lds r24, 0x1279 ; 0x801279 2765a: 88 23 and r24, r24 2765c: 49 f0 breq .+18 ; 0x27670 SERIAL_ECHOLNPGM("DecrementRetryAttempts"); 2765e: 88 ed ldi r24, 0xD8 ; 216 27660: 9c e9 ldi r25, 0x9C ; 156 27662: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 retryAttempts--; 27666: 80 91 79 12 lds r24, 0x1279 ; 0x801279 2766a: 81 50 subi r24, 0x01 ; 1 2766c: 80 93 79 12 sts 0x1279, r24 ; 0x801279 } } 27670: 08 95 ret 00027672 : MMU2_ECHO_MSGLN(tmp); } strncpy(lastMsg, tmp, rqs); } void ProtocolLogic::LogError(const char *reason_P) { 27672: 9f 92 push r9 27674: af 92 push r10 27676: bf 92 push r11 27678: cf 92 push r12 2767a: df 92 push r13 2767c: ef 92 push r14 2767e: ff 92 push r15 27680: 0f 93 push r16 27682: 1f 93 push r17 27684: cf 93 push r28 27686: df 93 push r29 27688: cd b7 in r28, 0x3d ; 61 2768a: de b7 in r29, 0x3e ; 62 2768c: e0 97 sbiw r28, 0x30 ; 48 2768e: 0f b6 in r0, 0x3f ; 63 27690: f8 94 cli 27692: de bf out 0x3e, r29 ; 62 27694: 0f be out 0x3f, r0 ; 63 27696: cd bf out 0x3d, r28 ; 61 27698: 8c 01 movw r16, r24 } } void ProtocolLogic::FormatLastReceivedBytes(char *dst) { for (uint8_t i = 0; i < lastReceivedBytes.size(); ++i) { uint8_t b = lastReceivedBytes[(lrb - i - 1) % lastReceivedBytes.size()]; 2769a: e0 90 62 12 lds r14, 0x1262 ; 0x801262 2769e: fe 01 movw r30, r28 276a0: 31 96 adiw r30, 0x01 ; 1 276a2: 21 e0 ldi r18, 0x01 ; 1 276a4: 30 e0 ldi r19, 0x00 ; 0 276a6: 5f 01 movw r10, r30 276a8: f1 2c mov r15, r1 276aa: 40 e1 ldi r20, 0x10 ; 16 276ac: c4 2e mov r12, r20 276ae: d1 2c mov r13, r1 dst[i * 3] = NibbleToChar(b >> 4); dst[i * 3 + 1] = NibbleToChar(b & 0xf); dst[i * 3 + 2] = ' '; 276b0: 50 e2 ldi r21, 0x20 ; 32 276b2: 95 2e mov r9, r21 } } void ProtocolLogic::FormatLastReceivedBytes(char *dst) { for (uint8_t i = 0; i < lastReceivedBytes.size(); ++i) { uint8_t b = lastReceivedBytes[(lrb - i - 1) % lastReceivedBytes.size()]; 276b4: c7 01 movw r24, r14 276b6: 82 1b sub r24, r18 276b8: 93 0b sbc r25, r19 276ba: b6 01 movw r22, r12 276bc: 0f 94 b9 a0 call 0x34172 ; 0x34172 <__divmodhi4> 276c0: dc 01 movw r26, r24 276c2: bb 27 eor r27, r27 276c4: ab 5d subi r26, 0xDB ; 219 276c6: bd 4e sbci r27, 0xED ; 237 276c8: 9d 96 adiw r26, 0x2d ; 45 276ca: 8c 91 ld r24, X dst[i * 3] = NibbleToChar(b >> 4); 276cc: 48 2f mov r20, r24 276ce: 50 e0 ldi r21, 0x00 ; 0 276d0: 94 e0 ldi r25, 0x04 ; 4 276d2: 55 95 asr r21 276d4: 47 95 ror r20 276d6: 9a 95 dec r25 276d8: e1 f7 brne .-8 ; 0x276d2 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 276da: 96 ef ldi r25, 0xF6 ; 246 276dc: 94 0f add r25, r20 276de: 96 30 cpi r25, 0x06 ; 6 276e0: a8 f1 brcs .+106 ; 0x2774c case 5: case 6: case 7: case 8: case 9: return c + '0'; 276e2: 40 5d subi r20, 0xD0 ; 208 } void ProtocolLogic::FormatLastReceivedBytes(char *dst) { for (uint8_t i = 0; i < lastReceivedBytes.size(); ++i) { uint8_t b = lastReceivedBytes[(lrb - i - 1) % lastReceivedBytes.size()]; dst[i * 3] = NibbleToChar(b >> 4); 276e4: 40 83 st Z, r20 dst[i * 3 + 1] = NibbleToChar(b & 0xf); 276e6: 8f 70 andi r24, 0x0F ; 15 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 276e8: 96 ef ldi r25, 0xF6 ; 246 276ea: 98 0f add r25, r24 276ec: 96 30 cpi r25, 0x06 ; 6 276ee: 80 f1 brcs .+96 ; 0x27750 case 5: case 6: case 7: case 8: case 9: return c + '0'; 276f0: 80 5d subi r24, 0xD0 ; 208 void ProtocolLogic::FormatLastReceivedBytes(char *dst) { for (uint8_t i = 0; i < lastReceivedBytes.size(); ++i) { uint8_t b = lastReceivedBytes[(lrb - i - 1) % lastReceivedBytes.size()]; dst[i * 3] = NibbleToChar(b >> 4); dst[i * 3 + 1] = NibbleToChar(b & 0xf); 276f2: 81 83 std Z+1, r24 ; 0x01 dst[i * 3 + 2] = ' '; 276f4: 92 82 std Z+2, r9 ; 0x02 276f6: 2f 5f subi r18, 0xFF ; 255 276f8: 3f 4f sbci r19, 0xFF ; 255 276fa: 33 96 adiw r30, 0x03 ; 3 return 0; } } void ProtocolLogic::FormatLastReceivedBytes(char *dst) { for (uint8_t i = 0; i < lastReceivedBytes.size(); ++i) { 276fc: 21 31 cpi r18, 0x11 ; 17 276fe: 31 05 cpc r19, r1 27700: c9 f6 brne .-78 ; 0x276b4 uint8_t b = lastReceivedBytes[(lrb - i - 1) % lastReceivedBytes.size()]; dst[i * 3] = NibbleToChar(b >> 4); dst[i * 3 + 1] = NibbleToChar(b & 0xf); dst[i * 3 + 2] = ' '; } dst[(lastReceivedBytes.size() - 1) * 3 + 2] = 0; // terminate properly 27702: 18 aa std Y+48, r1 ; 0x30 void ProtocolLogic::LogError(const char *reason_P) { char lrb[lastReceivedBytes.size() * 3]; FormatLastReceivedBytes(lrb); MMU2_ERROR_MSGRPGM(reason_P); 27704: 81 e6 ldi r24, 0x61 ; 97 27706: 9d e9 ldi r25, 0x9D ; 157 27708: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 2770c: 8b e5 ldi r24, 0x5B ; 91 2770e: 9d e9 ldi r25, 0x9D ; 157 27710: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 27714: c8 01 movw r24, r16 27716: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOPGM(", last bytes: "); 2771a: 83 e0 ldi r24, 0x03 ; 3 2771c: 9d e9 ldi r25, 0x9D ; 157 2771e: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLN(lrb); 27722: c5 01 movw r24, r10 27724: 0f 94 fd 98 call 0x331fa ; 0x331fa } 27728: e0 96 adiw r28, 0x30 ; 48 2772a: 0f b6 in r0, 0x3f ; 63 2772c: f8 94 cli 2772e: de bf out 0x3e, r29 ; 62 27730: 0f be out 0x3f, r0 ; 63 27732: cd bf out 0x3d, r28 ; 61 27734: df 91 pop r29 27736: cf 91 pop r28 27738: 1f 91 pop r17 2773a: 0f 91 pop r16 2773c: ff 90 pop r15 2773e: ef 90 pop r14 27740: df 90 pop r13 27742: cf 90 pop r12 27744: bf 90 pop r11 27746: af 90 pop r10 27748: 9f 90 pop r9 2774a: 08 95 ret case 11: case 12: case 13: case 14: case 15: return (c - 10) + 'a'; 2774c: 49 5a subi r20, 0xA9 ; 169 2774e: ca cf rjmp .-108 ; 0x276e4 27750: 89 5a subi r24, 0xA9 ; 169 27752: cf cf rjmp .-98 ; 0x276f2 00027754 : char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { 27754: 9c 01 movw r18, r24 SERIAL_ECHOLNPGM("RSTCommTimeout"); dataTO.Reset(); } bool DropOutFilter::Record(StepStatus ss) { if (occurrences == maxOccurrences) { 27756: 90 91 39 12 lds r25, 0x1239 ; 0x801239 2775a: 9a 30 cpi r25, 0x0A ; 10 2775c: 11 f4 brne .+4 ; 0x27762 cause = ss; 2775e: 60 93 38 12 sts 0x1238, r22 ; 0x801238 } --occurrences; 27762: 91 50 subi r25, 0x01 ; 1 27764: 90 93 39 12 sts 0x1239, r25 ; 0x801239 FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { if (dataTO.Record(ss)) { 27768: 91 11 cpse r25, r1 2776a: 0d c0 rjmp .+26 ; 0x27786 2776c: c9 01 movw r24, r18 LogError(msg_P); 2776e: 0f 94 39 3b call 0x27672 ; 0x27672 SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 27772: 84 ef ldi r24, 0xF4 ; 244 27774: 9c e9 ldi r25, 0x9C ; 156 27776: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 /// @returns the initial cause which started this drop out event inline StepStatus InitialCause() const { return cause; } /// Rearms the object for further processing - basically call this once the MMU responds with something meaningful (e.g. S0 A2) inline void Reset() { occurrences = maxOccurrences; } 2777a: 8a e0 ldi r24, 0x0A ; 10 2777c: 80 93 39 12 sts 0x1239, r24 ; 0x801239 27780: 80 91 38 12 lds r24, 0x1238 ; 0x801238 27784: 08 95 ret if (dataTO.Record(ss)) { LogError(msg_P); ResetCommunicationTimeoutAttempts(); // prepare for another run of consecutive retries before firing an error return dataTO.InitialCause(); } else { return Processing; // suppress short drop outs of communication 27786: 80 e0 ldi r24, 0x00 ; 0 } } 27788: 08 95 ret 0002778a : } *dst = 0; // terminate properly lrb = 0; // reset the input buffer index in case of a clean message } void ProtocolLogic::LogRequestMsg(const uint8_t *txbuff, uint8_t size) { 2778a: cf 93 push r28 2778c: df 93 push r29 2778e: cd b7 in r28, 0x3d ; 61 27790: de b7 in r29, 0x3e ; 62 27792: 2e 97 sbiw r28, 0x0e ; 14 27794: 0f b6 in r0, 0x3f ; 63 27796: f8 94 cli 27798: de bf out 0x3e, r29 ; 62 2779a: 0f be out 0x3f, r0 ; 63 2779c: cd bf out 0x3d, r28 ; 61 constexpr uint_fast8_t rqs = modules::protocol::Protocol::MaxRequestSize() + 1; char tmp[rqs] = ">"; 2779e: 2e e3 ldi r18, 0x3E ; 62 277a0: 30 e0 ldi r19, 0x00 ; 0 277a2: 3a 83 std Y+2, r19 ; 0x02 277a4: 29 83 std Y+1, r18 ; 0x01 277a6: fe 01 movw r30, r28 277a8: 33 96 adiw r30, 0x03 ; 3 277aa: 2c e0 ldi r18, 0x0C ; 12 277ac: df 01 movw r26, r30 277ae: 1d 92 st X+, r1 277b0: 2a 95 dec r18 277b2: e9 f7 brne .-6 ; 0x277ae 277b4: de 01 movw r26, r28 277b6: 12 96 adiw r26, 0x02 ; 2 277b8: 48 2f mov r20, r24 277ba: fc 01 movw r30, r24 277bc: 9d 01 movw r18, r26 static char lastMsg[rqs] = ""; for (uint8_t i = 0; i < size; ++i) { 277be: 8e 2f mov r24, r30 277c0: 84 1b sub r24, r20 277c2: 86 17 cp r24, r22 277c4: 40 f4 brcc .+16 ; 0x277d6 uint8_t b = txbuff[i]; 277c6: 81 91 ld r24, Z+ // Check for printable character, including space if (b < 32 || b > 127) { 277c8: 90 ee ldi r25, 0xE0 ; 224 277ca: 98 0f add r25, r24 277cc: 90 36 cpi r25, 0x60 ; 96 277ce: 08 f0 brcs .+2 ; 0x277d2 b = '.'; 277d0: 8e e2 ldi r24, 0x2E ; 46 } tmp[i + 1] = b; 277d2: 8d 93 st X+, r24 277d4: f4 cf rjmp .-24 ; 0x277be } tmp[size + 1] = 0; 277d6: f9 01 movw r30, r18 277d8: e6 0f add r30, r22 277da: f1 1d adc r31, r1 277dc: 10 82 st Z, r1 if (!strncmp_P(tmp, PSTR(">S0*c6."), rqs) && !strncmp(lastMsg, tmp, rqs)) { 277de: 4e e0 ldi r20, 0x0E ; 14 277e0: 50 e0 ldi r21, 0x00 ; 0 277e2: 67 e6 ldi r22, 0x67 ; 103 277e4: 7d e9 ldi r23, 0x9D ; 157 277e6: ce 01 movw r24, r28 277e8: 01 96 adiw r24, 0x01 ; 1 277ea: 0f 94 bb 9d call 0x33b76 ; 0x33b76 277ee: 89 2b or r24, r25 277f0: 59 f4 brne .+22 ; 0x27808 277f2: 4e e0 ldi r20, 0x0E ; 14 277f4: 50 e0 ldi r21, 0x00 ; 0 277f6: be 01 movw r22, r28 277f8: 6f 5f subi r22, 0xFF ; 255 277fa: 7f 4f sbci r23, 0xFF ; 255 277fc: 85 e1 ldi r24, 0x15 ; 21 277fe: 92 e1 ldi r25, 0x12 ; 18 27800: 0f 94 4e a6 call 0x34c9c ; 0x34c9c 27804: 89 2b or r24, r25 27806: 61 f0 breq .+24 ; 0x27820 // especially when the MMU is not connected. // We'll lose the ability to see if the printer is actually // trying to find the MMU, but since it has been reliable in the past // we can live without it for now. } else { MMU2_ECHO_MSGLN(tmp); 27808: 81 e6 ldi r24, 0x61 ; 97 2780a: 9d e9 ldi r25, 0x9D ; 157 2780c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 27810: 8b e5 ldi r24, 0x5B ; 91 27812: 9d e9 ldi r25, 0x9D ; 157 27814: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 27818: ce 01 movw r24, r28 2781a: 01 96 adiw r24, 0x01 ; 1 2781c: 0f 94 fd 98 call 0x331fa ; 0x331fa } strncpy(lastMsg, tmp, rqs); 27820: 4e e0 ldi r20, 0x0E ; 14 27822: 50 e0 ldi r21, 0x00 ; 0 27824: be 01 movw r22, r28 27826: 6f 5f subi r22, 0xFF ; 255 27828: 7f 4f sbci r23, 0xFF ; 255 2782a: 85 e1 ldi r24, 0x15 ; 21 2782c: 92 e1 ldi r25, 0x12 ; 18 2782e: 0f 94 5c a6 call 0x34cb8 ; 0x34cb8 } 27832: 2e 96 adiw r28, 0x0e ; 14 27834: 0f b6 in r0, 0x3f ; 63 27836: f8 94 cli 27838: de bf out 0x3e, r29 ; 62 2783a: 0f be out 0x3f, r0 ; 63 2783c: cd bf out 0x3d, r28 ; 61 2783e: df 91 pop r29 27840: cf 91 pop r28 27842: 08 95 ret 00027844 : return CommunicationTimeout; } return Processing; } void ProtocolLogic::SendMsg(RequestMsg rq) { 27844: cf 92 push r12 27846: df 92 push r13 27848: ef 92 push r14 2784a: ff 92 push r15 2784c: 1f 93 push r17 2784e: cf 93 push r28 27850: df 93 push r29 27852: cd b7 in r28, 0x3d ; 61 27854: de b7 in r29, 0x3e ; 62 27856: 62 97 sbiw r28, 0x12 ; 18 27858: 0f b6 in r0, 0x3f ; 63 2785a: f8 94 cli 2785c: de bf out 0x3e, r29 ; 62 2785e: 0f be out 0x3f, r0 ; 63 27860: cd bf out 0x3d, r28 ; 61 27862: 4e 87 std Y+14, r20 ; 0x0e 27864: 5f 87 std Y+15, r21 ; 0x0f 27866: 68 8b std Y+16, r22 ; 0x10 27868: 79 8b std Y+17, r23 ; 0x11 2786a: 8a 8b std Y+18, r24 ; 0x12 } } } uint8_t Protocol::EncodeRequest(const RequestMsg &msg, uint8_t *txbuff) { txbuff[0] = (uint8_t)msg.code; 2786c: 49 83 std Y+1, r20 ; 0x01 uint8_t i = 1 + UInt8ToHex(msg.value, txbuff + 1); 2786e: 85 2f mov r24, r21 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 27870: 51 11 cpse r21, r1 27872: 31 c0 rjmp .+98 ; 0x278d6 *dst = '0'; 27874: 80 e3 ldi r24, 0x30 ; 48 27876: 8a 83 std Y+2, r24 ; 0x02 return 1; 27878: 11 e0 ldi r17, 0x01 ; 1 uint8_t Protocol::EncodeRequest(const RequestMsg &msg, uint8_t *txbuff) { txbuff[0] = (uint8_t)msg.code; uint8_t i = 1 + UInt8ToHex(msg.value, txbuff + 1); i += AppendCRC(msg.CRC(), txbuff + i); 2787a: e1 e0 ldi r30, 0x01 ; 1 2787c: e1 0f add r30, r17 2787e: 81 e0 ldi r24, 0x01 ; 1 27880: 90 e0 ldi r25, 0x00 ; 0 27882: 8c 0f add r24, r28 27884: 9d 1f adc r25, r29 27886: 8e 0f add r24, r30 27888: 91 1d adc r25, r1 2788a: fc 01 movw r30, r24 2788c: 8a 89 ldd r24, Y+18 ; 0x12 dst[i] = ' '; return i + 1; } uint8_t Protocol::AppendCRC(uint8_t crc, uint8_t *dst) { dst[0] = '*'; // reprap-style separator of CRC 2788e: 9a e2 ldi r25, 0x2A ; 42 27890: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 27892: 81 11 cpse r24, r1 27894: 27 c0 rjmp .+78 ; 0x278e4 *dst = '0'; 27896: 80 e3 ldi r24, 0x30 ; 48 27898: 81 83 std Z+1, r24 ; 0x01 return 1; 2789a: 81 e0 ldi r24, 0x01 ; 1 uint8_t Protocol::EncodeRequest(const RequestMsg &msg, uint8_t *txbuff) { txbuff[0] = (uint8_t)msg.code; uint8_t i = 1 + UInt8ToHex(msg.value, txbuff + 1); i += AppendCRC(msg.CRC(), txbuff + i); 2789c: 1e 5f subi r17, 0xFE ; 254 2789e: 18 0f add r17, r24 txbuff[i] = '\n'; 278a0: e1 e0 ldi r30, 0x01 ; 1 278a2: f0 e0 ldi r31, 0x00 ; 0 278a4: ec 0f add r30, r28 278a6: fd 1f adc r31, r29 278a8: e1 0f add r30, r17 278aa: f1 1d adc r31, r1 278ac: 8a e0 ldi r24, 0x0A ; 10 278ae: 80 83 st Z, r24 ++i; 278b0: 1f 5f subi r17, 0xFF ; 255 // Buddy FW cannot use stack-allocated txbuff - DMA doesn't work with CCMRAM // No restrictions on MK3/S/+ though uint8_t txbuff[Protocol::MaxRequestSize()]; #endif uint8_t len = Protocol::EncodeRequest(rq, txbuff); uart->write(txbuff, len); 278b2: fe 01 movw r30, r28 278b4: 31 96 adiw r30, 0x01 ; 1 278b6: 7f 01 movw r14, r30 void MMU2Serial::flush() { // @@TODO - clear the output buffer } void MMU2Serial::write(const uint8_t *buffer, size_t size) { while(size--){ 278b8: 6f 01 movw r12, r30 278ba: c1 0e add r12, r17 278bc: d1 1c adc r13, r1 278be: ec 14 cp r14, r12 278c0: fd 04 cpc r15, r13 278c2: b1 f0 breq .+44 ; 0x278f0 fputc(*buffer, uart2io); 278c4: f7 01 movw r30, r14 278c6: 81 91 ld r24, Z+ 278c8: 7f 01 movw r14, r30 278ca: 67 e0 ldi r22, 0x07 ; 7 278cc: 72 e1 ldi r23, 0x12 ; 18 278ce: 90 e0 ldi r25, 0x00 ; 0 278d0: 0f 94 44 9e call 0x33c88 ; 0x33c88 278d4: f4 cf rjmp .-24 ; 0x278be 278d6: be 01 movw r22, r28 278d8: 6e 5f subi r22, 0xFE ; 254 278da: 7f 4f sbci r23, 0xFF ; 255 278dc: 0f 94 a3 86 call 0x30d46 ; 0x30d46 278e0: 18 2f mov r17, r24 278e2: cb cf rjmp .-106 ; 0x2787a return i + 1; } uint8_t Protocol::AppendCRC(uint8_t crc, uint8_t *dst) { dst[0] = '*'; // reprap-style separator of CRC return 1 + UInt8ToHex(crc, dst + 1); 278e4: bf 01 movw r22, r30 278e6: 6f 5f subi r22, 0xFF ; 255 278e8: 7f 4f sbci r23, 0xFF ; 255 278ea: 0f 94 a3 86 call 0x30d46 ; 0x30d46 278ee: d6 cf rjmp .-84 ; 0x2789c LogRequestMsg(txbuff, len); 278f0: 61 2f mov r22, r17 278f2: ce 01 movw r24, r28 278f4: 01 96 adiw r24, 0x01 ; 1 278f6: 0f 94 c5 3b call 0x2778a ; 0x2778a RecordUARTActivity(); 278fa: 0f 94 1c 3b call 0x27638 ; 0x27638 } 278fe: 62 96 adiw r28, 0x12 ; 18 27900: 0f b6 in r0, 0x3f ; 63 27902: f8 94 cli 27904: de bf out 0x3e, r29 ; 62 27906: 0f be out 0x3f, r0 ; 63 27908: cd bf out 0x3d, r28 ; 61 2790a: df 91 pop r29 2790c: cf 91 pop r28 2790e: 1f 91 pop r17 27910: ff 90 pop r15 27912: ef 90 pop r14 27914: df 90 pop r13 27916: cf 90 pop r12 27918: 08 95 ret 0002791a : void ProtocolLogic::SendReadRegister(uint8_t index, ScopeState nextState) { SendMsg(RequestMsg(RequestMsgCodes::Read, index)); scopeState = nextState; } void ProtocolLogic::SendWriteRegister(uint8_t index, uint16_t value, ScopeState nextState) { 2791a: 8f 92 push r8 2791c: 9f 92 push r9 2791e: af 92 push r10 27920: bf 92 push r11 27922: df 92 push r13 27924: ef 92 push r14 27926: ff 92 push r15 27928: 0f 93 push r16 2792a: 1f 93 push r17 2792c: cf 93 push r28 2792e: df 93 push r29 27930: cd b7 in r28, 0x3d ; 61 27932: de b7 in r29, 0x3e ; 62 27934: 67 97 sbiw r28, 0x17 ; 23 27936: 0f b6 in r0, 0x3f ; 63 27938: f8 94 cli 2793a: de bf out 0x3e, r29 ; 62 2793c: 0f be out 0x3f, r0 ; 63 2793e: cd bf out 0x3d, r28 ; 61 27940: 18 2f mov r17, r24 27942: 7b 01 movw r14, r22 27944: d4 2e mov r13, r20 27946: 07 e5 ldi r16, 0x57 ; 87 27948: 0b 8b std Y+19, r16 ; 0x13 2794a: 8c 8b std Y+20, r24 ; 0x14 2794c: 7e 8b std Y+22, r23 ; 0x16 2794e: 6d 8b std Y+21, r22 ; 0x15 27950: ce 01 movw r24, r28 27952: 43 96 adiw r24, 0x13 ; 19 27954: 0f 94 cf 86 call 0x30d9e ; 0x30d9e 27958: 8f 8b std Y+23, r24 ; 0x17 2795a: 0e 87 std Y+14, r16 ; 0x0e 2795c: 1f 87 std Y+15, r17 ; 0x0f 2795e: f9 8a std Y+17, r15 ; 0x11 27960: e8 8a std Y+16, r14 ; 0x10 27962: ce 01 movw r24, r28 27964: 0e 96 adiw r24, 0x0e ; 14 27966: 0f 94 cf 86 call 0x30d9e ; 0x30d9e 2796a: 8a 8b std Y+18, r24 ; 0x12 } return charsOut; } uint8_t Protocol::BeginEncodeRequest(const RequestMsg &msg, uint8_t *dst) { dst[0] = (uint8_t)msg.code; 2796c: 09 83 std Y+1, r16 ; 0x01 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2796e: 11 11 cpse r17, r1 27970: 27 c0 rjmp .+78 ; 0x279c0 *dst = '0'; 27972: 80 e3 ldi r24, 0x30 ; 48 27974: 8a 83 std Y+2, r24 ; 0x02 return 1; 27976: 81 e0 ldi r24, 0x01 ; 1 } uint8_t Protocol::BeginEncodeRequest(const RequestMsg &msg, uint8_t *dst) { dst[0] = (uint8_t)msg.code; uint8_t i = 1 + UInt8ToHex(msg.value, dst + 1); 27978: e1 e0 ldi r30, 0x01 ; 1 2797a: e8 0f add r30, r24 dst[i] = ' '; 2797c: 21 e0 ldi r18, 0x01 ; 1 2797e: 30 e0 ldi r19, 0x00 ; 0 27980: 2c 0f add r18, r28 27982: 3d 1f adc r19, r29 27984: 2e 0f add r18, r30 27986: 31 1d adc r19, r1 27988: f9 01 movw r30, r18 2798a: 90 e2 ldi r25, 0x20 ; 32 2798c: 90 83 st Z, r25 return i + 1; 2798e: 02 e0 ldi r16, 0x02 ; 2 27990: 08 0f add r16, r24 uint8_t Protocol::EncodeWriteRequest(uint8_t address, uint16_t value, uint8_t *txbuff) { const RequestMsg msg(RequestMsgCodes::Write, address, value); uint8_t i = BeginEncodeRequest(msg, txbuff); // dump the value i += UInt16ToHex(value, txbuff + i); 27992: aa 24 eor r10, r10 27994: a3 94 inc r10 27996: b1 2c mov r11, r1 27998: ac 0e add r10, r28 2799a: bd 1e adc r11, r29 2799c: a0 0e add r10, r16 2799e: b1 1c adc r11, r1 return charsOut; } uint8_t Protocol::UInt16ToHex(uint16_t value, uint8_t *dst) { constexpr uint16_t topNibbleMask = 0xf000; if (value == 0) { 279a0: e1 14 cp r14, r1 279a2: f1 04 cpc r15, r1 279a4: 39 f1 breq .+78 ; 0x279f4 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; 279a6: 14 e0 ldi r17, 0x04 ; 4 while ((value & topNibbleMask) == 0) { 279a8: c7 01 movw r24, r14 279aa: 88 27 eor r24, r24 279ac: 90 7f andi r25, 0xF0 ; 240 279ae: 89 2b or r24, r25 279b0: 71 f4 brne .+28 ; 0x279ce value <<= 4U; 279b2: 24 e0 ldi r18, 0x04 ; 4 279b4: ee 0c add r14, r14 279b6: ff 1c adc r15, r15 279b8: 2a 95 dec r18 279ba: e1 f7 brne .-8 ; 0x279b4 --charsOut; 279bc: 11 50 subi r17, 0x01 ; 1 279be: f4 cf rjmp .-24 ; 0x279a8 279c0: be 01 movw r22, r28 279c2: 6e 5f subi r22, 0xFE ; 254 279c4: 7f 4f sbci r23, 0xFF ; 255 279c6: 81 2f mov r24, r17 279c8: 0f 94 a3 86 call 0x30d46 ; 0x30d46 279cc: d5 cf rjmp .-86 ; 0x27978 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; while ((value & topNibbleMask) == 0) { 279ce: 45 01 movw r8, r10 value <<= 4U; --charsOut; } for (uint8_t i = 0; i < charsOut; ++i) { 279d0: 88 2d mov r24, r8 279d2: 8a 19 sub r24, r10 279d4: 81 17 cp r24, r17 279d6: 90 f4 brcc .+36 ; 0x279fc uint8_t n = (value & topNibbleMask) >> (8U + 4U); value <<= 4U; *dst = Nibble2Char(n); 279d8: 8f 2d mov r24, r15 279da: 82 95 swap r24 279dc: 8f 70 andi r24, 0x0F ; 15 279de: 94 e0 ldi r25, 0x04 ; 4 279e0: ee 0c add r14, r14 279e2: ff 1c adc r15, r15 279e4: 9a 95 dec r25 279e6: e1 f7 brne .-8 ; 0x279e0 279e8: 0f 94 99 86 call 0x30d32 ; 0x30d32 279ec: f4 01 movw r30, r8 279ee: 81 93 st Z+, r24 279f0: 4f 01 movw r8, r30 279f2: ee cf rjmp .-36 ; 0x279d0 } uint8_t Protocol::UInt16ToHex(uint16_t value, uint8_t *dst) { constexpr uint16_t topNibbleMask = 0xf000; if (value == 0) { *dst = '0'; 279f4: 80 e3 ldi r24, 0x30 ; 48 279f6: f5 01 movw r30, r10 279f8: 80 83 st Z, r24 return 1; 279fa: 11 e0 ldi r17, 0x01 ; 1 uint8_t Protocol::EncodeWriteRequest(uint8_t address, uint16_t value, uint8_t *txbuff) { const RequestMsg msg(RequestMsgCodes::Write, address, value); uint8_t i = BeginEncodeRequest(msg, txbuff); // dump the value i += UInt16ToHex(value, txbuff + i); 279fc: 10 0f add r17, r16 i += AppendCRC(msg.CRC(), txbuff + i); 279fe: e1 e0 ldi r30, 0x01 ; 1 27a00: f0 e0 ldi r31, 0x00 ; 0 27a02: ec 0f add r30, r28 27a04: fd 1f adc r31, r29 27a06: e1 0f add r30, r17 27a08: f1 1d adc r31, r1 27a0a: 8a 89 ldd r24, Y+18 ; 0x12 dst[i] = ' '; return i + 1; } uint8_t Protocol::AppendCRC(uint8_t crc, uint8_t *dst) { dst[0] = '*'; // reprap-style separator of CRC 27a0c: 9a e2 ldi r25, 0x2A ; 42 27a0e: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 27a10: 81 11 cpse r24, r1 27a12: 21 c0 rjmp .+66 ; 0x27a56 *dst = '0'; 27a14: 80 e3 ldi r24, 0x30 ; 48 27a16: 81 83 std Z+1, r24 ; 0x01 return 1; 27a18: 81 e0 ldi r24, 0x01 ; 1 27a1a: 1f 5f subi r17, 0xFF ; 255 const RequestMsg msg(RequestMsgCodes::Write, address, value); uint8_t i = BeginEncodeRequest(msg, txbuff); // dump the value i += UInt16ToHex(value, txbuff + i); i += AppendCRC(msg.CRC(), txbuff + i); 27a1c: 18 0f add r17, r24 txbuff[i] = '\n'; 27a1e: e1 e0 ldi r30, 0x01 ; 1 27a20: f0 e0 ldi r31, 0x00 ; 0 27a22: ec 0f add r30, r28 27a24: fd 1f adc r31, r29 27a26: e1 0f add r30, r17 27a28: f1 1d adc r31, r1 27a2a: 8a e0 ldi r24, 0x0A ; 10 27a2c: 80 83 st Z, r24 ++i; 27a2e: 1f 5f subi r17, 0xFF ; 255 // Buddy FW cannot use stack-allocated txbuff - DMA doesn't work with CCMRAM // No restrictions on MK3/S/+ though uint8_t txbuff[Protocol::MaxRequestSize()]; #endif uint8_t len = Protocol::EncodeWriteRequest(rq.value, rq.value2, txbuff); uart->write(txbuff, len); 27a30: 9e 01 movw r18, r28 27a32: 2f 5f subi r18, 0xFF ; 255 27a34: 3f 4f sbci r19, 0xFF ; 255 27a36: 79 01 movw r14, r18 void MMU2Serial::flush() { // @@TODO - clear the output buffer } void MMU2Serial::write(const uint8_t *buffer, size_t size) { while(size--){ 27a38: 59 01 movw r10, r18 27a3a: a1 0e add r10, r17 27a3c: b1 1c adc r11, r1 27a3e: ea 14 cp r14, r10 27a40: fb 04 cpc r15, r11 27a42: 79 f0 breq .+30 ; 0x27a62 fputc(*buffer, uart2io); 27a44: f7 01 movw r30, r14 27a46: 81 91 ld r24, Z+ 27a48: 7f 01 movw r14, r30 27a4a: 67 e0 ldi r22, 0x07 ; 7 27a4c: 72 e1 ldi r23, 0x12 ; 18 27a4e: 90 e0 ldi r25, 0x00 ; 0 27a50: 0f 94 44 9e call 0x33c88 ; 0x33c88 27a54: f4 cf rjmp .-24 ; 0x27a3e return i + 1; } uint8_t Protocol::AppendCRC(uint8_t crc, uint8_t *dst) { dst[0] = '*'; // reprap-style separator of CRC return 1 + UInt8ToHex(crc, dst + 1); 27a56: bf 01 movw r22, r30 27a58: 6f 5f subi r22, 0xFF ; 255 27a5a: 7f 4f sbci r23, 0xFF ; 255 27a5c: 0f 94 a3 86 call 0x30d46 ; 0x30d46 27a60: dc cf rjmp .-72 ; 0x27a1a LogRequestMsg(txbuff, len); 27a62: 61 2f mov r22, r17 27a64: ce 01 movw r24, r28 27a66: 01 96 adiw r24, 0x01 ; 1 27a68: 0f 94 c5 3b call 0x2778a ; 0x2778a RecordUARTActivity(); 27a6c: 0f 94 1c 3b call 0x27638 ; 0x27638 scopeState = nextState; } void ProtocolLogic::SendWriteRegister(uint8_t index, uint16_t value, ScopeState nextState) { SendWriteMsg(RequestMsg(RequestMsgCodes::Write, index, value)); scopeState = nextState; 27a70: d0 92 28 12 sts 0x1228, r13 ; 0x801228 } 27a74: 67 96 adiw r28, 0x17 ; 23 27a76: 0f b6 in r0, 0x3f ; 63 27a78: f8 94 cli 27a7a: de bf out 0x3e, r29 ; 62 27a7c: 0f be out 0x3f, r0 ; 63 27a7e: cd bf out 0x3d, r28 ; 61 27a80: df 91 pop r29 27a82: cf 91 pop r28 27a84: 1f 91 pop r17 27a86: 0f 91 pop r16 27a88: ff 90 pop r15 27a8a: ef 90 pop r14 27a8c: df 90 pop r13 27a8e: bf 90 pop r11 27a90: af 90 pop r10 27a92: 9f 90 pop r9 27a94: 8f 90 pop r8 27a96: 08 95 ret 00027a98 : regIndex = 0; SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; 27a98: 20 91 73 12 lds r18, 0x1273 ; 0x801273 27a9c: 2f 5f subi r18, 0xFF ; 255 27a9e: 20 93 73 12 sts 0x1273, r18 ; 0x801273 if (regIndex >= initRegs8Count) { 27aa2: 22 30 cpi r18, 0x02 ; 2 27aa4: 78 f4 brcc .+30 ; 0x27ac4 return true; } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 27aa6: 30 e0 ldi r19, 0x00 ; 0 27aa8: f9 01 movw r30, r18 27aaa: ee 50 subi r30, 0x0E ; 14 27aac: f3 46 sbci r31, 0x63 ; 99 27aae: 84 91 lpm r24, Z 27ab0: 2f 58 subi r18, 0x8F ; 143 27ab2: 3d 4e sbci r19, 0xED ; 237 27ab4: f9 01 movw r30, r18 27ab6: 60 81 ld r22, Z 27ab8: 70 e0 ldi r23, 0x00 ; 0 27aba: 49 e0 ldi r20, 0x09 ; 9 27abc: 0f 94 8d 3c call 0x2791a ; 0x2791a } return false; 27ac0: 80 e0 ldi r24, 0x00 ; 0 27ac2: 08 95 ret } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; if (regIndex >= initRegs8Count) { return true; 27ac4: 81 e0 ldi r24, 0x01 ; 1 } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } 27ac6: 08 95 ret 00027ac8 : * \return The value one, true, is returned for success and * the value zero, false, is returned for failure. Reasons for * failure include not finding a valid partition, not finding a valid * FAT file system in the specified partition or an I/O error. */ bool SdVolume::init(Sd2Card* dev, uint8_t part) { 27ac8: 8f 92 push r8 27aca: 9f 92 push r9 27acc: af 92 push r10 27ace: bf 92 push r11 27ad0: cf 92 push r12 27ad2: df 92 push r13 27ad4: ef 92 push r14 27ad6: ff 92 push r15 27ad8: cf 93 push r28 27ada: df 93 push r29 uint32_t totalBlocks; uint32_t volumeStartBlock = 0; fat32_boot_t* fbs; sdCard_ = dev; 27adc: 27 ed ldi r18, 0xD7 ; 215 27ade: 35 e1 ldi r19, 0x15 ; 21 27ae0: 30 93 d7 0d sts 0x0DD7, r19 ; 0x800dd7 27ae4: 20 93 d6 0d sts 0x0DD6, r18 ; 0x800dd6 fatType_ = 0; 27ae8: 10 92 f3 15 sts 0x15F3, r1 ; 0x8015f3 allocSearchStart_ = 2; 27aec: 42 e0 ldi r20, 0x02 ; 2 27aee: 50 e0 ldi r21, 0x00 ; 0 27af0: 60 e0 ldi r22, 0x00 ; 0 27af2: 70 e0 ldi r23, 0x00 ; 0 27af4: 40 93 dc 15 sts 0x15DC, r20 ; 0x8015dc 27af8: 50 93 dd 15 sts 0x15DD, r21 ; 0x8015dd 27afc: 60 93 de 15 sts 0x15DE, r22 ; 0x8015de 27b00: 70 93 df 15 sts 0x15DF, r23 ; 0x8015df cacheDirty_ = 0; // cacheFlush() will write block if true 27b04: 10 92 d5 0d sts 0x0DD5, r1 ; 0x800dd5 cacheMirrorBlock_ = 0; 27b08: 10 92 d1 0d sts 0x0DD1, r1 ; 0x800dd1 27b0c: 10 92 d2 0d sts 0x0DD2, r1 ; 0x800dd2 27b10: 10 92 d3 0d sts 0x0DD3, r1 ; 0x800dd3 27b14: 10 92 d4 0d sts 0x0DD4, r1 ; 0x800dd4 cacheBlockNumber_ = 0XFFFFFFFF; 27b18: 4f ef ldi r20, 0xFF ; 255 27b1a: 5f ef ldi r21, 0xFF ; 255 27b1c: ba 01 movw r22, r20 27b1e: 40 93 cd 0d sts 0x0DCD, r20 ; 0x800dcd 27b22: 50 93 ce 0d sts 0x0DCE, r21 ; 0x800dce 27b26: 60 93 cf 0d sts 0x0DCF, r22 ; 0x800dcf 27b2a: 70 93 d0 0d sts 0x0DD0, r23 ; 0x800dd0 // if part == 0 assume super floppy with FAT boot sector in block zero // if part > 0 assume mbr volume with partition table if (part) { 27b2e: 88 23 and r24, r24 27b30: 09 f4 brne .+2 ; 0x27b34 27b32: 70 c0 rjmp .+224 ; 0x27c14 if (part > 4)goto fail; if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 27b34: 40 e0 ldi r20, 0x00 ; 0 27b36: 60 e0 ldi r22, 0x00 ; 0 27b38: 70 e0 ldi r23, 0x00 ; 0 27b3a: cb 01 movw r24, r22 27b3c: 0f 94 6d 36 call 0x26cda ; 0x26cda 27b40: 81 11 cpse r24, r1 27b42: 0d c0 rjmp .+26 ; 0x27b5e fatType_ = 32; } return true; fail: return false; 27b44: c0 e0 ldi r28, 0x00 ; 0 } 27b46: 8c 2f mov r24, r28 27b48: df 91 pop r29 27b4a: cf 91 pop r28 27b4c: ff 90 pop r15 27b4e: ef 90 pop r14 27b50: df 90 pop r13 27b52: cf 90 pop r12 27b54: bf 90 pop r11 27b56: af 90 pop r10 27b58: 9f 90 pop r9 27b5a: 8f 90 pop r8 27b5c: 08 95 ret // if part > 0 assume mbr volume with partition table if (part) { if (part > 4)goto fail; if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; part_t* p = &cacheBuffer_.mbr.part[part-1]; if ((p->boot & 0X7F) !=0 || 27b5e: 80 91 97 0f lds r24, 0x0F97 ; 0x800f97 27b62: 8f 77 andi r24, 0x7F ; 127 27b64: 79 f7 brne .-34 ; 0x27b44 27b66: 80 91 a3 0f lds r24, 0x0FA3 ; 0x800fa3 27b6a: 90 91 a4 0f lds r25, 0x0FA4 ; 0x800fa4 27b6e: a0 91 a5 0f lds r26, 0x0FA5 ; 0x800fa5 27b72: b0 91 a6 0f lds r27, 0x0FA6 ; 0x800fa6 27b76: 84 36 cpi r24, 0x64 ; 100 27b78: 91 05 cpc r25, r1 27b7a: a1 05 cpc r26, r1 27b7c: b1 05 cpc r27, r1 27b7e: 10 f3 brcs .-60 ; 0x27b44 p->totalSectors < 100 || p->firstSector == 0) { 27b80: c0 90 9f 0f lds r12, 0x0F9F ; 0x800f9f 27b84: d0 90 a0 0f lds r13, 0x0FA0 ; 0x800fa0 27b88: e0 90 a1 0f lds r14, 0x0FA1 ; 0x800fa1 27b8c: f0 90 a2 0f lds r15, 0x0FA2 ; 0x800fa2 if (part) { if (part > 4)goto fail; if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; part_t* p = &cacheBuffer_.mbr.part[part-1]; if ((p->boot & 0X7F) !=0 || p->totalSectors < 100 || 27b90: c1 14 cp r12, r1 27b92: d1 04 cpc r13, r1 27b94: e1 04 cpc r14, r1 27b96: f1 04 cpc r15, r1 27b98: a9 f2 breq .-86 ; 0x27b44 // not a valid partition goto fail; } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 27b9a: 40 e0 ldi r20, 0x00 ; 0 27b9c: c7 01 movw r24, r14 27b9e: b6 01 movw r22, r12 27ba0: 0f 94 6d 36 call 0x26cda ; 0x26cda 27ba4: c8 2f mov r28, r24 27ba6: 88 23 and r24, r24 27ba8: 69 f2 breq .-102 ; 0x27b44 fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 27baa: 80 91 e4 0d lds r24, 0x0DE4 ; 0x800de4 27bae: 90 91 e5 0d lds r25, 0x0DE5 ; 0x800de5 27bb2: 81 15 cp r24, r1 27bb4: 92 40 sbci r25, 0x02 ; 2 27bb6: 31 f6 brne .-116 ; 0x27b44 fbs->fatCount == 0 || 27bb8: a0 91 e9 0d lds r26, 0x0DE9 ; 0x800de9 } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 27bbc: aa 23 and r26, r26 27bbe: 11 f2 breq .-124 ; 0x27b44 fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 27bc0: 60 91 e7 0d lds r22, 0x0DE7 ; 0x800de7 27bc4: 70 91 e8 0d lds r23, 0x0DE8 ; 0x800de8 volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || fbs->fatCount == 0 || 27bc8: 61 15 cp r22, r1 27bca: 71 05 cpc r23, r1 27bcc: 09 f4 brne .+2 ; 0x27bd0 27bce: ba cf rjmp .-140 ; 0x27b44 fbs->reservedSectorCount == 0 || fbs->sectorsPerCluster == 0) { 27bd0: 20 91 e6 0d lds r18, 0x0DE6 ; 0x800de6 } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 27bd4: 22 23 and r18, r18 27bd6: 09 f4 brne .+2 ; 0x27bda 27bd8: b5 cf rjmp .-150 ; 0x27b44 fbs->sectorsPerCluster == 0) { // not valid FAT volume goto fail; } fatCount_ = fbs->fatCount; 27bda: a0 93 ee 15 sts 0x15EE, r26 ; 0x8015ee blocksPerCluster_ = fbs->sectorsPerCluster; 27bde: 20 93 e0 15 sts 0x15E0, r18 ; 0x8015e0 // determine shift that is same as multiply by blocksPerCluster_ clusterSizeShift_ = 0; 27be2: 90 e0 ldi r25, 0x00 ; 0 27be4: 80 e0 ldi r24, 0x00 ; 0 while (blocksPerCluster_ != (1 << clusterSizeShift_)) { 27be6: 30 e0 ldi r19, 0x00 ; 0 27be8: e1 e0 ldi r30, 0x01 ; 1 27bea: f0 e0 ldi r31, 0x00 ; 0 27bec: d8 2f mov r29, r24 27bee: af 01 movw r20, r30 27bf0: 08 2e mov r0, r24 27bf2: 02 c0 rjmp .+4 ; 0x27bf8 27bf4: 44 0f add r20, r20 27bf6: 55 1f adc r21, r21 27bf8: 0a 94 dec r0 27bfa: e2 f7 brpl .-8 ; 0x27bf4 27bfc: 24 17 cp r18, r20 27bfe: 35 07 cpc r19, r21 27c00: 69 f0 breq .+26 ; 0x27c1c 27c02: 41 e0 ldi r20, 0x01 ; 1 27c04: 48 0f add r20, r24 27c06: 01 96 adiw r24, 0x01 ; 1 // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; 27c08: 89 30 cpi r24, 0x09 ; 9 27c0a: 91 05 cpc r25, r1 27c0c: 79 f7 brne .-34 ; 0x27bec 27c0e: 40 93 e9 15 sts 0x15E9, r20 ; 0x8015e9 27c12: 98 cf rjmp .-208 ; 0x27b44 * failure include not finding a valid partition, not finding a valid * FAT file system in the specified partition or an I/O error. */ bool SdVolume::init(Sd2Card* dev, uint8_t part) { uint32_t totalBlocks; uint32_t volumeStartBlock = 0; 27c14: c1 2c mov r12, r1 27c16: d1 2c mov r13, r1 27c18: 76 01 movw r14, r12 27c1a: bf cf rjmp .-130 ; 0x27b9a 27c1c: 80 93 e9 15 sts 0x15E9, r24 ; 0x8015e9 clusterSizeShift_ = 0; while (blocksPerCluster_ != (1 << clusterSizeShift_)) { // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; } blocksPerFat_ = fbs->sectorsPerFat16 ? 27c20: 20 91 ef 0d lds r18, 0x0DEF ; 0x800def 27c24: 30 91 f0 0d lds r19, 0x0DF0 ; 0x800df0 27c28: 50 e0 ldi r21, 0x00 ; 0 27c2a: 40 e0 ldi r20, 0x00 ; 0 27c2c: 21 15 cp r18, r1 27c2e: 31 05 cpc r19, r1 27c30: 41 f4 brne .+16 ; 0x27c42 27c32: 20 91 fd 0d lds r18, 0x0DFD ; 0x800dfd 27c36: 30 91 fe 0d lds r19, 0x0DFE ; 0x800dfe 27c3a: 40 91 ff 0d lds r20, 0x0DFF ; 0x800dff 27c3e: 50 91 00 0e lds r21, 0x0E00 ; 0x800e00 27c42: 20 93 e1 15 sts 0x15E1, r18 ; 0x8015e1 27c46: 30 93 e2 15 sts 0x15E2, r19 ; 0x8015e2 27c4a: 40 93 e3 15 sts 0x15E3, r20 ; 0x8015e3 27c4e: 50 93 e4 15 sts 0x15E4, r21 ; 0x8015e4 fbs->sectorsPerFat16 : fbs->sectorsPerFat32; fatStartBlock_ = volumeStartBlock + fbs->reservedSectorCount; 27c52: 46 01 movw r8, r12 27c54: 57 01 movw r10, r14 27c56: 86 0e add r8, r22 27c58: 97 1e adc r9, r23 27c5a: a1 1c adc r10, r1 27c5c: b1 1c adc r11, r1 27c5e: 80 92 ef 15 sts 0x15EF, r8 ; 0x8015ef 27c62: 90 92 f0 15 sts 0x15F0, r9 ; 0x8015f0 27c66: a0 92 f1 15 sts 0x15F1, r10 ; 0x8015f1 27c6a: b0 92 f2 15 sts 0x15F2, r11 ; 0x8015f2 // count for FAT16 zero for FAT32 rootDirEntryCount_ = fbs->rootDirEntryCount; 27c6e: e0 91 ea 0d lds r30, 0x0DEA ; 0x800dea 27c72: f0 91 eb 0d lds r31, 0x0DEB ; 0x800deb 27c76: f0 93 f5 15 sts 0x15F5, r31 ; 0x8015f5 27c7a: e0 93 f4 15 sts 0x15F4, r30 ; 0x8015f4 // directory start for FAT16 dataStart for FAT32 rootDirStart_ = fatStartBlock_ + fbs->fatCount * blocksPerFat_; 27c7e: b0 e0 ldi r27, 0x00 ; 0 27c80: 0f 94 71 a0 call 0x340e2 ; 0x340e2 <__muluhisi3> 27c84: dc 01 movw r26, r24 27c86: cb 01 movw r24, r22 27c88: 88 0d add r24, r8 27c8a: 99 1d adc r25, r9 27c8c: aa 1d adc r26, r10 27c8e: bb 1d adc r27, r11 27c90: 80 93 f6 15 sts 0x15F6, r24 ; 0x8015f6 27c94: 90 93 f7 15 sts 0x15F7, r25 ; 0x8015f7 27c98: a0 93 f8 15 sts 0x15F8, r26 ; 0x8015f8 27c9c: b0 93 f9 15 sts 0x15F9, r27 ; 0x8015f9 // data start for FAT16 and FAT32 dataStartBlock_ = rootDirStart_ + ((32 * fbs->rootDirEntryCount + 511)/512); 27ca0: 25 e0 ldi r18, 0x05 ; 5 27ca2: ee 0f add r30, r30 27ca4: ff 1f adc r31, r31 27ca6: 2a 95 dec r18 27ca8: e1 f7 brne .-8 ; 0x27ca2 27caa: e1 50 subi r30, 0x01 ; 1 27cac: fe 4f sbci r31, 0xFE ; 254 27cae: ef 2f mov r30, r31 27cb0: ff 27 eor r31, r31 27cb2: e6 95 lsr r30 27cb4: 8e 0f add r24, r30 27cb6: 9f 1f adc r25, r31 27cb8: a1 1d adc r26, r1 27cba: b1 1d adc r27, r1 27cbc: 80 93 ea 15 sts 0x15EA, r24 ; 0x8015ea 27cc0: 90 93 eb 15 sts 0x15EB, r25 ; 0x8015eb 27cc4: a0 93 ec 15 sts 0x15EC, r26 ; 0x8015ec 27cc8: b0 93 ed 15 sts 0x15ED, r27 ; 0x8015ed // total blocks for FAT16 or FAT32 totalBlocks = fbs->totalSectors16 ? 27ccc: 80 90 ec 0d lds r8, 0x0DEC ; 0x800dec 27cd0: 90 90 ed 0d lds r9, 0x0DED ; 0x800ded 27cd4: b1 2c mov r11, r1 27cd6: a1 2c mov r10, r1 27cd8: 81 14 cp r8, r1 27cda: 91 04 cpc r9, r1 27cdc: 41 f4 brne .+16 ; 0x27cee 27cde: 80 90 f9 0d lds r8, 0x0DF9 ; 0x800df9 27ce2: 90 90 fa 0d lds r9, 0x0DFA ; 0x800dfa 27ce6: a0 90 fb 0d lds r10, 0x0DFB ; 0x800dfb 27cea: b0 90 fc 0d lds r11, 0x0DFC ; 0x800dfc fbs->totalSectors16 : fbs->totalSectors32; // total data blocks clusterCount_ = totalBlocks - (dataStartBlock_ - volumeStartBlock); 27cee: c8 1a sub r12, r24 27cf0: d9 0a sbc r13, r25 27cf2: ea 0a sbc r14, r26 27cf4: fb 0a sbc r15, r27 27cf6: c8 0c add r12, r8 27cf8: d9 1c adc r13, r9 27cfa: ea 1c adc r14, r10 27cfc: fb 1c adc r15, r11 // divide by cluster size to get cluster count clusterCount_ >>= clusterSizeShift_; 27cfe: 04 c0 rjmp .+8 ; 0x27d08 27d00: f6 94 lsr r15 27d02: e7 94 ror r14 27d04: d7 94 ror r13 27d06: c7 94 ror r12 27d08: da 95 dec r29 27d0a: d2 f7 brpl .-12 ; 0x27d00 27d0c: c0 92 e5 15 sts 0x15E5, r12 ; 0x8015e5 27d10: d0 92 e6 15 sts 0x15E6, r13 ; 0x8015e6 27d14: e0 92 e7 15 sts 0x15E7, r14 ; 0x8015e7 27d18: f0 92 e8 15 sts 0x15E8, r15 ; 0x8015e8 // FAT type is determined by cluster count if (clusterCount_ < 4085) { 27d1c: 85 ef ldi r24, 0xF5 ; 245 27d1e: c8 16 cp r12, r24 27d20: 8f e0 ldi r24, 0x0F ; 15 27d22: d8 06 cpc r13, r24 27d24: e1 04 cpc r14, r1 27d26: f1 04 cpc r15, r1 27d28: 20 f4 brcc .+8 ; 0x27d32 fatType_ = 12; 27d2a: 8c e0 ldi r24, 0x0C ; 12 27d2c: 80 93 f3 15 sts 0x15F3, r24 ; 0x8015f3 27d30: 09 cf rjmp .-494 ; 0x27b44 if (!FAT12_SUPPORT) goto fail; } else if (clusterCount_ < 65525) { fatType_ = 16; 27d32: 80 e1 ldi r24, 0x10 ; 16 // FAT type is determined by cluster count if (clusterCount_ < 4085) { fatType_ = 12; if (!FAT12_SUPPORT) goto fail; } else if (clusterCount_ < 65525) { 27d34: 25 ef ldi r18, 0xF5 ; 245 27d36: c2 16 cp r12, r18 27d38: 2f ef ldi r18, 0xFF ; 255 27d3a: d2 06 cpc r13, r18 27d3c: e1 04 cpc r14, r1 27d3e: f1 04 cpc r15, r1 27d40: 88 f0 brcs .+34 ; 0x27d64 fatType_ = 16; } else { rootDirStart_ = fbs->fat32RootCluster; 27d42: 80 91 05 0e lds r24, 0x0E05 ; 0x800e05 27d46: 90 91 06 0e lds r25, 0x0E06 ; 0x800e06 27d4a: a0 91 07 0e lds r26, 0x0E07 ; 0x800e07 27d4e: b0 91 08 0e lds r27, 0x0E08 ; 0x800e08 27d52: 80 93 f6 15 sts 0x15F6, r24 ; 0x8015f6 27d56: 90 93 f7 15 sts 0x15F7, r25 ; 0x8015f7 27d5a: a0 93 f8 15 sts 0x15F8, r26 ; 0x8015f8 27d5e: b0 93 f9 15 sts 0x15F9, r27 ; 0x8015f9 fatType_ = 32; 27d62: 80 e2 ldi r24, 0x20 ; 32 27d64: 80 93 f3 15 sts 0x15F3, r24 ; 0x8015f3 27d68: ee ce rjmp .-548 ; 0x27b46 00027d6a : // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; return -1; } bool SdFile::gfEnsureBlock(){ 27d6a: 0f 93 push r16 27d6c: 1f 93 push r17 // this comparison is heavy-weight, especially when there is another one inside cacheRawBlock // but it is necessary to avoid computing of terminateOfs if not needed if( gfBlock != vol_->cacheBlockNumber_ ){ 27d6e: 60 91 17 16 lds r22, 0x1617 ; 0x801617 27d72: 70 91 18 16 lds r23, 0x1618 ; 0x801618 27d76: 80 91 19 16 lds r24, 0x1619 ; 0x801619 27d7a: 90 91 1a 16 lds r25, 0x161A ; 0x80161a 27d7e: 00 91 cd 0d lds r16, 0x0DCD ; 0x800dcd 27d82: 10 91 ce 0d lds r17, 0x0DCE ; 0x800dce 27d86: 20 91 cf 0d lds r18, 0x0DCF ; 0x800dcf 27d8a: 30 91 d0 0d lds r19, 0x0DD0 ; 0x800dd0 27d8e: 60 17 cp r22, r16 27d90: 71 07 cpc r23, r17 27d92: 82 07 cpc r24, r18 27d94: 93 07 cpc r25, r19 27d96: 39 f1 breq .+78 ; 0x27de6 if ( ! vol_->cacheRawBlock(gfBlock, SdVolume::CACHE_FOR_READ)){ 27d98: 40 e0 ldi r20, 0x00 ; 0 27d9a: 0f 94 6d 36 call 0x26cda ; 0x26cda 27d9e: 88 23 and r24, r24 27da0: f9 f0 breq .+62 ; 0x27de0 return false; } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; 27da2: 20 91 1b 16 lds r18, 0x161B ; 0x80161b 27da6: 30 91 1c 16 lds r19, 0x161C ; 0x80161c 27daa: 40 91 0b 16 lds r20, 0x160B ; 0x80160b 27dae: 50 91 0c 16 lds r21, 0x160C ; 0x80160c 27db2: 60 91 0d 16 lds r22, 0x160D ; 0x80160d 27db6: 70 91 0e 16 lds r23, 0x160E ; 0x80160e 27dba: 42 1b sub r20, r18 27dbc: 53 0b sbc r21, r19 27dbe: 61 09 sbc r22, r1 27dc0: 71 09 sbc r23, r1 vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; 27dc2: 41 30 cpi r20, 0x01 ; 1 27dc4: 92 e0 ldi r25, 0x02 ; 2 27dc6: 59 07 cpc r21, r25 27dc8: 61 05 cpc r22, r1 27dca: 71 05 cpc r23, r1 27dcc: 20 f0 brcs .+8 ; 0x27dd6 27dce: 40 e0 ldi r20, 0x00 ; 0 27dd0: 52 e0 ldi r21, 0x02 ; 2 27dd2: 60 e0 ldi r22, 0x00 ; 0 27dd4: 70 e0 ldi r23, 0x00 ; 0 27dd6: 47 52 subi r20, 0x27 ; 39 27dd8: 52 4f sbci r21, 0xF2 ; 242 27dda: 9a e0 ldi r25, 0x0A ; 10 27ddc: fa 01 movw r30, r20 27dde: 90 83 st Z, r25 } return true; } 27de0: 1f 91 pop r17 27de2: 0f 91 pop r16 27de4: 08 95 ret } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; 27de6: 81 e0 ldi r24, 0x01 ; 1 27de8: fb cf rjmp .-10 ; 0x27de0 00027dea : break; } } void __attribute__((noinline)) MMU2::HelpUnloadToFinda() { extruder_move(-MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH, MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE); 27dea: 20 e0 ldi r18, 0x00 ; 0 27dec: 30 e0 ldi r19, 0x00 ; 0 27dee: 40 ea ldi r20, 0xA0 ; 160 27df0: 52 e4 ldi r21, 0x42 ; 66 27df2: 60 e0 ldi r22, 0x00 ; 0 27df4: 70 e0 ldi r23, 0x00 ; 0 27df6: 80 ea ldi r24, 0xA0 ; 160 27df8: 92 ec ldi r25, 0xC2 ; 194 27dfa: 0d 94 02 87 jmp 0x30e04 ; 0x30e04 00027dfe : void MMU2::Home(uint8_t mode) { logic.Home(mode); } void MMU2::SaveHotendTemp(bool turn_off_nozzle) { if (mmu_print_saved & SavedState::Cooldown) { 27dfe: 90 91 95 12 lds r25, 0x1295 ; 0x801295 27e02: 91 fd sbrc r25, 1 27e04: 17 c0 rjmp .+46 ; 0x27e34 return; } if (turn_off_nozzle && !(mmu_print_saved & SavedState::CooldownPending)) { 27e06: 88 23 and r24, r24 27e08: a9 f0 breq .+42 ; 0x27e34 27e0a: 92 fd sbrc r25, 2 27e0c: 13 c0 rjmp .+38 ; 0x27e34 Disable_E0(); 27e0e: 0f 94 00 87 call 0x30e00 ; 0x30e00 resume_hotend_temp = thermal_degTargetHotend(); 27e12: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 27e16: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 27e1a: 90 93 8a 12 sts 0x128A, r25 ; 0x80128a 27e1e: 80 93 89 12 sts 0x1289, r24 ; 0x801289 mmu_print_saved |= SavedState::CooldownPending; 27e22: 80 91 95 12 lds r24, 0x1295 ; 0x801295 27e26: 84 60 ori r24, 0x04 ; 4 27e28: 80 93 95 12 sts 0x1295, r24 ; 0x801295 LogEchoEvent_P(PSTR("Heater cooldown pending")); 27e2c: 84 ed ldi r24, 0xD4 ; 212 27e2e: 99 e9 ldi r25, 0x99 ; 153 27e30: 0d 94 26 87 jmp 0x30e4c ; 0x30e4c } } 27e34: 08 95 ret 00027e36 : ScreenClear(); } } void MMU2::ResumeUnpark() { if (mmu_print_saved & SavedState::ParkExtruder) { 27e36: 80 91 95 12 lds r24, 0x1295 ; 0x801295 27e3a: 80 ff sbrs r24, 0 27e3c: 45 c0 rjmp .+138 ; 0x27ec8 LogEchoEvent_P(PSTR("Resuming XYZ")); 27e3e: 8c ee ldi r24, 0xEC ; 236 27e40: 99 e9 ldi r25, 0x99 ; 153 27e42: 0f 94 26 87 call 0x30e4c ; 0x30e4c // Move XY to starting position, then Z motion_do_blocking_move_to_xy(resume_position.xyz[0], resume_position.xyz[1], feedRate_t(NOZZLE_PARK_XY_FEEDRATE)); 27e46: 80 91 81 12 lds r24, 0x1281 ; 0x801281 27e4a: 90 91 82 12 lds r25, 0x1282 ; 0x801282 27e4e: a0 91 83 12 lds r26, 0x1283 ; 0x801283 27e52: b0 91 84 12 lds r27, 0x1284 ; 0x801284 pos3d planner_current_position() { return pos3d(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]); } void motion_do_blocking_move_to_xy(float rx, float ry, float feedRate_mm_s) { current_position[X_AXIS] = rx; 27e56: 40 91 7d 12 lds r20, 0x127D ; 0x80127d 27e5a: 50 91 7e 12 lds r21, 0x127E ; 0x80127e 27e5e: 60 91 7f 12 lds r22, 0x127F ; 0x80127f 27e62: 70 91 80 12 lds r23, 0x1280 ; 0x801280 27e66: 40 93 f5 11 sts 0x11F5, r20 ; 0x8011f5 27e6a: 50 93 f6 11 sts 0x11F6, r21 ; 0x8011f6 27e6e: 60 93 f7 11 sts 0x11F7, r22 ; 0x8011f7 27e72: 70 93 f8 11 sts 0x11F8, r23 ; 0x8011f8 current_position[Y_AXIS] = ry; 27e76: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 27e7a: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 27e7e: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 27e82: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc planner_line_to_current_position_sync(feedRate_mm_s); 27e86: 60 e0 ldi r22, 0x00 ; 0 27e88: 70 e0 ldi r23, 0x00 ; 0 27e8a: 88 e4 ldi r24, 0x48 ; 72 27e8c: 92 e4 ldi r25, 0x42 ; 66 27e8e: 0f 94 22 87 call 0x30e44 ; 0x30e44 } void motion_do_blocking_move_to_z(float z, float feedRate_mm_s) { current_position[Z_AXIS] = z; 27e92: 80 91 85 12 lds r24, 0x1285 ; 0x801285 27e96: 90 91 86 12 lds r25, 0x1286 ; 0x801286 27e9a: a0 91 87 12 lds r26, 0x1287 ; 0x801287 27e9e: b0 91 88 12 lds r27, 0x1288 ; 0x801288 27ea2: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 27ea6: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 27eaa: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 27eae: b0 93 00 12 sts 0x1200, r27 ; 0x801200 planner_line_to_current_position_sync(feedRate_mm_s); 27eb2: 60 e0 ldi r22, 0x00 ; 0 27eb4: 70 e0 ldi r23, 0x00 ; 0 27eb6: 80 e7 ldi r24, 0x70 ; 112 27eb8: 91 e4 ldi r25, 0x41 ; 65 27eba: 0f 94 22 87 call 0x30e44 ; 0x30e44 // From this point forward, power panic should not use // the partial backup in RAM since the extruder is no // longer in parking position marlin_clear_print_state_in_ram(); mmu_print_saved &= ~(SavedState::ParkExtruder); 27ebe: 80 91 95 12 lds r24, 0x1295 ; 0x801295 27ec2: 8e 7f andi r24, 0xFE ; 254 27ec4: 80 93 95 12 sts 0x1295, r24 ; 0x801295 } } 27ec8: 08 95 ret 00027eca : mmu_print_saved |= SavedState::CooldownPending; LogEchoEvent_P(PSTR("Heater cooldown pending")); } } void MMU2::SaveAndPark(bool move_axes) { 27eca: 0f 93 push r16 27ecc: 1f 93 push r17 27ece: cf 93 push r28 if (mmu_print_saved == SavedState::None) { // First occurrence. Save current position, park print head, disable nozzle heater. 27ed0: 90 91 95 12 lds r25, 0x1295 ; 0x801295 27ed4: 91 11 cpse r25, r1 27ed6: 72 c0 rjmp .+228 ; 0x27fbc 27ed8: c8 2f mov r28, r24 LogEchoEvent_P(PSTR("Saving and parking")); 27eda: 81 ec ldi r24, 0xC1 ; 193 27edc: 99 e9 ldi r25, 0x99 ; 153 27ede: 0f 94 26 87 call 0x30e4c ; 0x30e4c Disable_E0(); 27ee2: 0f 94 00 87 call 0x30e00 ; 0x30e00 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 27ee6: 0f 94 42 22 call 0x24484 ; 0x24484 /// e.g. feedrate, Z-axis position etc. /// This function should backup variables which may be lost /// For example a power panic in M600 or during MMU error void refresh_print_state_in_ram() { if (saved_printing) return; 27eea: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 27eee: 81 11 cpse r24, r1 27ef0: 02 c0 rjmp .+4 ; 0x27ef6 27ef2: 0e 94 2e 5e call 0xbc5c ; 0xbc5c // In case a power panic happens while waiting for the user // take a partial back up of print state into RAM (current position, etc.) marlin_refresh_print_state_in_ram(); if (move_axes) { 27ef6: cc 23 and r28, r28 27ef8: 09 f4 brne .+2 ; 0x27efc 27efa: 60 c0 rjmp .+192 ; 0x27fbc mmu_print_saved |= SavedState::ParkExtruder; 27efc: 80 91 95 12 lds r24, 0x1295 ; 0x801295 27f00: 81 60 ori r24, 0x01 ; 1 27f02: 80 93 95 12 sts 0x1295, r24 ; 0x801295 void planner_set_current_position_E(float e) { current_position[E_AXIS] = e; } pos3d planner_current_position() { return pos3d(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]); 27f06: 80 91 fd 11 lds r24, 0x11FD ; 0x8011fd 27f0a: 90 91 fe 11 lds r25, 0x11FE ; 0x8011fe 27f0e: a0 91 ff 11 lds r26, 0x11FF ; 0x8011ff 27f12: b0 91 00 12 lds r27, 0x1200 ; 0x801200 27f16: 40 91 f9 11 lds r20, 0x11F9 ; 0x8011f9 27f1a: 50 91 fa 11 lds r21, 0x11FA ; 0x8011fa 27f1e: 60 91 fb 11 lds r22, 0x11FB ; 0x8011fb 27f22: 70 91 fc 11 lds r23, 0x11FC ; 0x8011fc resume_position = planner_current_position(); // save current pos 27f26: 00 91 f5 11 lds r16, 0x11F5 ; 0x8011f5 27f2a: 10 91 f6 11 lds r17, 0x11F6 ; 0x8011f6 27f2e: 20 91 f7 11 lds r18, 0x11F7 ; 0x8011f7 27f32: 30 91 f8 11 lds r19, 0x11F8 ; 0x8011f8 27f36: 00 93 7d 12 sts 0x127D, r16 ; 0x80127d 27f3a: 10 93 7e 12 sts 0x127E, r17 ; 0x80127e 27f3e: 20 93 7f 12 sts 0x127F, r18 ; 0x80127f 27f42: 30 93 80 12 sts 0x1280, r19 ; 0x801280 27f46: 40 93 81 12 sts 0x1281, r20 ; 0x801281 27f4a: 50 93 82 12 sts 0x1282, r21 ; 0x801282 27f4e: 60 93 83 12 sts 0x1283, r22 ; 0x801283 27f52: 70 93 84 12 sts 0x1284, r23 ; 0x801284 27f56: 80 93 85 12 sts 0x1285, r24 ; 0x801285 27f5a: 90 93 86 12 sts 0x1286, r25 ; 0x801286 27f5e: a0 93 87 12 sts 0x1287, r26 ; 0x801287 27f62: b0 93 88 12 sts 0x1288, r27 ; 0x801288 current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } float move_raise_z(float delta) { return raise_z(delta); 27f66: 60 e0 ldi r22, 0x00 ; 0 27f68: 70 e0 ldi r23, 0x00 ; 0 27f6a: 80 ea ldi r24, 0xA0 ; 160 27f6c: 91 e4 ldi r25, 0x41 ; 65 27f6e: 0e 94 dd 66 call 0xcdba ; 0xcdba void Disable_E0() { disable_e0(); } bool all_axes_homed() { return axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]; 27f72: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 27f76: 88 23 and r24, r24 27f78: 09 f1 breq .+66 ; 0x27fbc 27f7a: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 27f7e: 88 23 and r24, r24 27f80: e9 f0 breq .+58 ; 0x27fbc current_position[Z_AXIS] = z; planner_line_to_current_position_sync(feedRate_mm_s); } void nozzle_park() { current_position[X_AXIS] = MMU_ERR_X_PAUSE_POS; 27f82: 80 e0 ldi r24, 0x00 ; 0 27f84: 90 e0 ldi r25, 0x00 ; 0 27f86: aa ef ldi r26, 0xFA ; 250 27f88: b2 e4 ldi r27, 0x42 ; 66 27f8a: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 27f8e: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 27f92: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 27f96: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = MMU_ERR_Y_PAUSE_POS; 27f9a: 10 92 f9 11 sts 0x11F9, r1 ; 0x8011f9 27f9e: 10 92 fa 11 sts 0x11FA, r1 ; 0x8011fa 27fa2: 10 92 fb 11 sts 0x11FB, r1 ; 0x8011fb 27fa6: 10 92 fc 11 sts 0x11FC, r1 ; 0x8011fc planner_line_to_current_position_sync(NOZZLE_PARK_XY_FEEDRATE); 27faa: 60 e0 ldi r22, 0x00 ; 0 27fac: 70 e0 ldi r23, 0x00 ; 0 27fae: 88 e4 ldi r24, 0x48 ; 72 27fb0: 92 e4 ldi r25, 0x42 ; 66 if (all_axes_homed()) { nozzle_park(); } } } } 27fb2: cf 91 pop r28 27fb4: 1f 91 pop r17 27fb6: 0f 91 pop r16 27fb8: 0d 94 22 87 jmp 0x30e44 ; 0x30e44 27fbc: cf 91 pop r28 27fbe: 1f 91 pop r17 27fc0: 0f 91 pop r16 27fc2: 08 95 ret 00027fc4 : accelerate_1_step(axes, -dec, delay_us, delay_us); update_position_1_step(axes, dir); } } void go_start_stop(uint8_t axes, uint8_t dir, int16_t acc, uint16_t min_delay_us, uint16_t steps){ 27fc4: ef 92 push r14 27fc6: ff 92 push r15 27fc8: 0f 93 push r16 27fca: 1f 93 push r17 27fcc: cf 93 push r28 27fce: df 93 push r29 27fd0: 1f 92 push r1 27fd2: 1f 92 push r1 27fd4: cd b7 in r28, 0x3d ; 61 27fd6: de b7 in r29, 0x3e ; 62 27fd8: f8 2e mov r15, r24 27fda: e6 2e mov r14, r22 if (steps == 0) return; uint16_t current_delay_us = MAX_DELAY; 27fdc: 80 e1 ldi r24, 0x10 ; 16 27fde: 97 e2 ldi r25, 0x27 ; 39 27fe0: 9a 83 std Y+2, r25 ; 0x02 27fe2: 89 83 std Y+1, r24 ; 0x01 const uint16_t half = steps / 2; 27fe4: 8a 01 movw r16, r20 27fe6: 16 95 lsr r17 27fe8: 07 95 ror r16 } /// Goes defined number of steps while accelerating /// updates global positions void accelerate(uint8_t axes, uint8_t dir, int16_t acc, uint16_t &delay_us, uint16_t min_delay_us, uint16_t steps){ set_axes_dir(axes, dir); 27fea: 8f 2d mov r24, r15 27fec: 0e 94 79 c2 call 0x184f2 ; 0x184f2 while (steps--){ 27ff0: 01 50 subi r16, 0x01 ; 1 27ff2: 11 09 sbc r17, r1 27ff4: 78 f0 brcs .+30 ; 0x28014 accelerate_1_step(axes, acc, delay_us, min_delay_us); 27ff6: 28 ec ldi r18, 0xC8 ; 200 27ff8: 30 e0 ldi r19, 0x00 ; 0 27ffa: ae 01 movw r20, r28 27ffc: 4f 5f subi r20, 0xFF ; 255 27ffe: 5f 4f sbci r21, 0xFF ; 255 28000: 68 ee ldi r22, 0xE8 ; 232 28002: 73 e0 ldi r23, 0x03 ; 3 28004: 8f 2d mov r24, r15 28006: 0e 94 48 c1 call 0x18290 ; 0x18290 update_position_1_step(axes, dir); 2800a: 6e 2d mov r22, r14 2800c: 8f 2d mov r24, r15 2800e: 0e 94 92 c2 call 0x18524 ; 0x18524 28012: ee cf rjmp .-36 ; 0x27ff0 } /// \param dir sets direction of movement /// updates global positions void go_and_stop(uint8_t axes, uint8_t dir, int16_t dec, uint16_t &delay_us, uint16_t steps){ set_axes_dir(axes, dir); 28014: 6e 2d mov r22, r14 28016: 8f 2d mov r24, r15 28018: 0e 94 79 c2 call 0x184f2 ; 0x184f2 return; uint16_t current_delay_us = MAX_DELAY; const uint16_t half = steps / 2; accelerate(axes, dir, acc, current_delay_us, min_delay_us, half); go_and_stop(axes, dir, -acc, current_delay_us, steps - half); } 2801c: 0f 90 pop r0 2801e: 0f 90 pop r0 28020: df 91 pop r29 28022: cf 91 pop r28 28024: 1f 91 pop r17 28026: 0f 91 pop r16 28028: ff 90 pop r15 2802a: ef 90 pop r14 2802c: 08 95 ret 0002802e : 2802e: ef 92 push r14 28030: ff 92 push r15 28032: 0f 93 push r16 28034: 1f 93 push r17 28036: cf 93 push r28 28038: df 93 push r29 2803a: cd b7 in r28, 0x3d ; 61 2803c: de b7 in r29, 0x3e ; 62 2803e: 2f 97 sbiw r28, 0x0f ; 15 28040: 0f b6 in r0, 0x3f ; 63 28042: f8 94 cli 28044: de bf out 0x3e, r29 ; 62 28046: 0f be out 0x3f, r0 ; 63 28048: cd bf out 0x3d, r28 ; 61 2804a: 10 92 23 12 sts 0x1223, r1 ; 0x801223 2804e: 05 e2 ldi r16, 0x25 ; 37 28050: 12 e1 ldi r17, 0x12 ; 18 28052: ee 24 eor r14, r14 28054: e3 94 inc r14 28056: f1 2c mov r15, r1 28058: d8 01 movw r26, r16 2805a: 11 96 adiw r26, 0x01 ; 1 2805c: fc 92 st X, r15 2805e: ee 92 st -X, r14 28060: 12 96 adiw r26, 0x02 ; 2 28062: 1c 92 st X, r1 28064: 12 97 sbiw r26, 0x02 ; 2 28066: 82 e8 ldi r24, 0x82 ; 130 28068: 13 96 adiw r26, 0x03 ; 3 2806a: 8c 93 st X, r24 2806c: 40 e0 ldi r20, 0x00 ; 0 2806e: 60 e0 ldi r22, 0x00 ; 0 28070: 8a e2 ldi r24, 0x2A ; 42 28072: 92 e1 ldi r25, 0x12 ; 18 28074: 0f 94 f3 86 call 0x30de6 ; 0x30de6 28078: 40 e0 ldi r20, 0x00 ; 0 2807a: 60 e0 ldi r22, 0x00 ; 0 2807c: 8f e2 ldi r24, 0x2F ; 47 2807e: 92 e1 ldi r25, 0x12 ; 18 28080: 0f 94 f3 86 call 0x30de6 ; 0x30de6 28084: f8 01 movw r30, r16 28086: 17 86 std Z+15, r1 ; 0x0f 28088: 10 8a std Z+16, r1 ; 0x10 2808a: 11 8a std Z+17, r1 ; 0x11 2808c: 12 8a std Z+18, r1 ; 0x12 2808e: 13 8a std Z+19, r1 ; 0x13 28090: 8a e0 ldi r24, 0x0A ; 10 28092: 84 8b std Z+20, r24 ; 0x14 28094: 40 e0 ldi r20, 0x00 ; 0 28096: 60 e0 ldi r22, 0x00 ; 0 28098: ce 01 movw r24, r28 2809a: 01 96 adiw r24, 0x01 ; 1 2809c: 0f 94 f3 86 call 0x30de6 ; 0x30de6 280a0: 85 e0 ldi r24, 0x05 ; 5 280a2: fe 01 movw r30, r28 280a4: 31 96 adiw r30, 0x01 ; 1 280a6: de 01 movw r26, r28 280a8: 16 96 adiw r26, 0x06 ; 6 280aa: 01 90 ld r0, Z+ 280ac: 0d 92 st X+, r0 280ae: 8a 95 dec r24 280b0: e1 f7 brne .-8 ; 0x280aa 280b2: 85 e0 ldi r24, 0x05 ; 5 280b4: fe 01 movw r30, r28 280b6: 36 96 adiw r30, 0x06 ; 6 280b8: aa e3 ldi r26, 0x3A ; 58 280ba: b2 e1 ldi r27, 0x12 ; 18 280bc: 01 90 ld r0, Z+ 280be: 0d 92 st X+, r0 280c0: 8a 95 dec r24 280c2: e1 f7 brne .-8 ; 0x280bc 280c4: d8 01 movw r26, r16 280c6: 5a 96 adiw r26, 0x1a ; 26 280c8: 1c 92 st X, r1 280ca: 5a 97 sbiw r26, 0x1a ; 26 280cc: 5c 96 adiw r26, 0x1c ; 28 280ce: 1c 92 st X, r1 280d0: 1e 92 st -X, r1 280d2: 5b 97 sbiw r26, 0x1b ; 27 280d4: 8a e3 ldi r24, 0x3A ; 58 280d6: 92 e1 ldi r25, 0x12 ; 18 280d8: 0f 94 e2 86 call 0x30dc4 ; 0x30dc4 280dc: f8 01 movw r30, r16 280de: 81 8f std Z+25, r24 ; 0x19 280e0: 15 8e std Z+29, r1 ; 0x1d 280e2: 16 8e std Z+30, r1 ; 0x1e 280e4: 40 e0 ldi r20, 0x00 ; 0 280e6: 60 e0 ldi r22, 0x00 ; 0 280e8: 84 e4 ldi r24, 0x44 ; 68 280ea: 92 e1 ldi r25, 0x12 ; 18 280ec: 0f 94 f3 86 call 0x30de6 ; 0x30de6 280f0: d8 01 movw r26, r16 280f2: 94 96 adiw r26, 0x24 ; 36 280f4: 1c 92 st X, r1 280f6: 40 e0 ldi r20, 0x00 ; 0 280f8: 60 e0 ldi r22, 0x00 ; 0 280fa: ce 01 movw r24, r28 280fc: 0b 96 adiw r24, 0x0b ; 11 280fe: 0f 94 f3 86 call 0x30de6 ; 0x30de6 28102: 85 e0 ldi r24, 0x05 ; 5 28104: fe 01 movw r30, r28 28106: 3b 96 adiw r30, 0x0b ; 11 28108: de 01 movw r26, r28 2810a: 11 96 adiw r26, 0x01 ; 1 2810c: 01 90 ld r0, Z+ 2810e: 0d 92 st X+, r0 28110: 8a 95 dec r24 28112: e1 f7 brne .-8 ; 0x2810c 28114: 85 e0 ldi r24, 0x05 ; 5 28116: fe 01 movw r30, r28 28118: 31 96 adiw r30, 0x01 ; 1 2811a: aa e4 ldi r26, 0x4A ; 74 2811c: b2 e1 ldi r27, 0x12 ; 18 2811e: 01 90 ld r0, Z+ 28120: 0d 92 st X+, r0 28122: 8a 95 dec r24 28124: e1 f7 brne .-8 ; 0x2811e 28126: f8 01 movw r30, r16 28128: 12 a6 std Z+42, r1 ; 0x2a 2812a: 14 a6 std Z+44, r1 ; 0x2c 2812c: 13 a6 std Z+43, r1 ; 0x2b 2812e: 8a e4 ldi r24, 0x4A ; 74 28130: 92 e1 ldi r25, 0x12 ; 18 28132: 0f 94 e2 86 call 0x30dc4 ; 0x30dc4 28136: d8 01 movw r26, r16 28138: 99 96 adiw r26, 0x29 ; 41 2813a: 8c 93 st X, r24 2813c: 99 97 sbiw r26, 0x29 ; 41 2813e: dd 96 adiw r26, 0x3d ; 61 28140: 1c 92 st X, r1 28142: dd 97 sbiw r26, 0x3d ; 61 28144: 84 e2 ldi r24, 0x24 ; 36 28146: 92 e1 ldi r25, 0x12 ; 18 28148: df 96 adiw r26, 0x3f ; 63 2814a: 9c 93 st X, r25 2814c: 8e 93 st -X, r24 2814e: de 97 sbiw r26, 0x3e ; 62 28150: f0 92 66 12 sts 0x1266, r15 ; 0x801266 28154: e0 92 65 12 sts 0x1265, r14 ; 0x801265 28158: 10 92 67 12 sts 0x1267, r1 ; 0x801267 2815c: 1f ef ldi r17, 0xFF ; 255 2815e: 10 93 68 12 sts 0x1268, r17 ; 0x801268 28162: 0f 94 36 87 call 0x30e6c ; 0x30e6c 28166: 80 93 69 12 sts 0x1269, r24 ; 0x801269 2816a: 10 92 6a 12 sts 0x126A, r1 ; 0x80126a 2816e: 10 92 6b 12 sts 0x126B, r1 ; 0x80126b 28172: 10 92 6c 12 sts 0x126C, r1 ; 0x80126c 28176: 10 92 6e 12 sts 0x126E, r1 ; 0x80126e 2817a: 10 92 6d 12 sts 0x126D, r1 ; 0x80126d 2817e: 10 92 70 12 sts 0x1270, r1 ; 0x801270 28182: 10 92 6f 12 sts 0x126F, r1 ; 0x80126f 28186: 10 92 73 12 sts 0x1273, r1 ; 0x801273 2818a: 10 92 74 12 sts 0x1274, r1 ; 0x801274 2818e: 10 92 75 12 sts 0x1275, r1 ; 0x801275 28192: 10 92 76 12 sts 0x1276, r1 ; 0x801276 28196: 83 e0 ldi r24, 0x03 ; 3 28198: 80 93 79 12 sts 0x1279, r24 ; 0x801279 2819c: 10 92 7a 12 sts 0x127A, r1 ; 0x80127a 281a0: 85 e0 ldi r24, 0x05 ; 5 281a2: 80 93 71 12 sts 0x1271, r24 ; 0x801271 281a6: 84 e1 ldi r24, 0x14 ; 20 281a8: 80 93 72 12 sts 0x1272, r24 ; 0x801272 281ac: 83 e6 ldi r24, 0x63 ; 99 281ae: 80 93 7b 12 sts 0x127B, r24 ; 0x80127b 281b2: 80 93 7c 12 sts 0x127C, r24 ; 0x80127c 281b6: 10 92 7d 12 sts 0x127D, r1 ; 0x80127d 281ba: 10 92 7e 12 sts 0x127E, r1 ; 0x80127e 281be: 10 92 7f 12 sts 0x127F, r1 ; 0x80127f 281c2: 10 92 80 12 sts 0x1280, r1 ; 0x801280 281c6: 10 92 81 12 sts 0x1281, r1 ; 0x801281 281ca: 10 92 82 12 sts 0x1282, r1 ; 0x801282 281ce: 10 92 83 12 sts 0x1283, r1 ; 0x801283 281d2: 10 92 84 12 sts 0x1284, r1 ; 0x801284 281d6: 10 92 85 12 sts 0x1285, r1 ; 0x801285 281da: 10 92 86 12 sts 0x1286, r1 ; 0x801286 281de: 10 92 87 12 sts 0x1287, r1 ; 0x801287 281e2: 10 92 88 12 sts 0x1288, r1 ; 0x801288 281e6: 10 92 8a 12 sts 0x128A, r1 ; 0x80128a 281ea: 10 92 89 12 sts 0x1289, r1 ; 0x801289 281ee: 10 92 8b 12 sts 0x128B, r1 ; 0x80128b 281f2: 8e e2 ldi r24, 0x2E ; 46 281f4: 90 e8 ldi r25, 0x80 ; 128 281f6: 90 93 8d 12 sts 0x128D, r25 ; 0x80128d 281fa: 80 93 8c 12 sts 0x128C, r24 ; 0x80128c 281fe: 10 93 8e 12 sts 0x128E, r17 ; 0x80128e 28202: 10 93 8f 12 sts 0x128F, r17 ; 0x80128f 28206: 10 92 91 12 sts 0x1291, r1 ; 0x801291 2820a: 10 92 90 12 sts 0x1290, r1 ; 0x801290 2820e: 10 93 92 12 sts 0x1292, r17 ; 0x801292 28212: 82 e0 ldi r24, 0x02 ; 2 28214: 80 93 93 12 sts 0x1293, r24 ; 0x801293 28218: 10 92 94 12 sts 0x1294, r1 ; 0x801294 2821c: 10 92 95 12 sts 0x1295, r1 ; 0x801295 28220: 10 92 96 12 sts 0x1296, r1 ; 0x801296 28224: 10 92 97 12 sts 0x1297, r1 ; 0x801297 28228: 10 92 99 12 sts 0x1299, r1 ; 0x801299 2822c: 10 92 98 12 sts 0x1298, r1 ; 0x801298 28230: 10 92 9b 12 sts 0x129B, r1 ; 0x80129b 28234: 10 92 9a 12 sts 0x129A, r1 ; 0x80129a 28238: 0f 94 f1 55 call 0x2abe2 ; 0x2abe2 2823c: e8 e6 ldi r30, 0x68 ; 104 2823e: f3 e1 ldi r31, 0x13 ; 19 28240: 10 92 f0 13 sts 0x13F0, r1 ; 0x8013f0 28244: 10 92 f3 13 sts 0x13F3, r1 ; 0x8013f3 28248: 10 92 15 14 sts 0x1415, r1 ; 0x801415 2824c: 10 92 18 14 sts 0x1418, r1 ; 0x801418 28250: 89 e1 ldi r24, 0x19 ; 25 28252: 80 93 d7 15 sts 0x15D7, r24 ; 0x8015d7 28256: 10 92 da 15 sts 0x15DA, r1 ; 0x8015da 2825a: 10 92 db 15 sts 0x15DB, r1 ; 0x8015db 2825e: 10 92 f3 15 sts 0x15F3, r1 ; 0x8015f3 28262: 10 92 fa 15 sts 0x15FA, r1 ; 0x8015fa 28266: 10 92 fd 15 sts 0x15FD, r1 ; 0x8015fd 2826a: 10 92 7b 16 sts 0x167B, r1 ; 0x80167b 2826e: 10 92 7d 16 sts 0x167D, r1 ; 0x80167d 28272: 10 92 7c 16 sts 0x167C, r1 ; 0x80167c 28276: 10 92 0c 15 sts 0x150C, r1 ; 0x80150c 2827a: 10 92 0b 15 sts 0x150B, r1 ; 0x80150b 2827e: 10 92 77 16 sts 0x1677, r1 ; 0x801677 28282: 10 92 78 16 sts 0x1678, r1 ; 0x801678 28286: 10 92 79 16 sts 0x1679, r1 ; 0x801679 2828a: 10 92 7a 16 sts 0x167A, r1 ; 0x80167a 2828e: 10 92 7e 16 sts 0x167E, r1 ; 0x80167e 28292: 10 92 7f 16 sts 0x167F, r1 ; 0x80167f 28296: 10 92 80 16 sts 0x1680, r1 ; 0x801680 2829a: 10 92 81 16 sts 0x1681, r1 ; 0x801681 2829e: 12 82 std Z+2, r1 ; 0x02 282a0: 13 82 std Z+3, r1 ; 0x03 282a2: 10 82 st Z, r1 282a4: 11 82 std Z+1, r1 ; 0x01 282a6: 10 92 0a 15 sts 0x150A, r1 ; 0x80150a 282aa: 10 92 1d 16 sts 0x161D, r1 ; 0x80161d 282ae: e8 e3 ldi r30, 0x38 ; 56 282b0: f4 e1 ldi r31, 0x14 ; 20 282b2: 82 ed ldi r24, 0xD2 ; 210 282b4: df 01 movw r26, r30 282b6: 1d 92 st X+, r1 282b8: 8a 95 dec r24 282ba: e9 f7 brne .-6 ; 0x282b6 282bc: 10 92 b9 13 sts 0x13B9, r1 ; 0x8013b9 282c0: 10 92 b8 13 sts 0x13B8, r1 ; 0x8013b8 282c4: 10 92 b7 13 sts 0x13B7, r1 ; 0x8013b7 282c8: 8b e7 ldi r24, 0x7B ; 123 282ca: 96 e1 ldi r25, 0x16 ; 22 282cc: 0f 94 d6 0f call 0x21fac ; 0x21fac ::start()> 282d0: e1 e6 ldi r30, 0x61 ; 97 282d2: f3 e1 ldi r31, 0x13 ; 19 282d4: 11 82 std Z+1, r1 ; 0x01 282d6: 12 82 std Z+2, r1 ; 0x02 282d8: 13 82 std Z+3, r1 ; 0x03 282da: 14 82 std Z+4, r1 ; 0x04 282dc: 15 82 std Z+5, r1 ; 0x05 282de: 16 82 std Z+6, r1 ; 0x06 282e0: 10 83 st Z, r17 282e2: e4 e8 ldi r30, 0x84 ; 132 282e4: f6 e1 ldi r31, 0x16 ; 22 282e6: 15 82 std Z+5, r1 ; 0x05 282e8: 17 82 std Z+7, r1 ; 0x07 282ea: 16 82 std Z+6, r1 ; 0x06 282ec: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 282f0: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d 282f4: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e 282f8: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f 282fc: 90 93 90 16 sts 0x1690, r25 ; 0x801690 28300: 2f 96 adiw r28, 0x0f ; 15 28302: 0f b6 in r0, 0x3f ; 63 28304: f8 94 cli 28306: de bf out 0x3e, r29 ; 62 28308: 0f be out 0x3f, r0 ; 63 2830a: cd bf out 0x3d, r28 ; 61 2830c: df 91 pop r29 2830e: cf 91 pop r28 28310: 1f 91 pop r17 28312: 0f 91 pop r16 28314: ff 90 pop r15 28316: ef 90 pop r14 28318: 08 95 ret 0002831a : 2831a: 42 e0 ldi r20, 0x02 ; 2 2831c: 0f 94 49 97 call 0x32e92 ; 0x32e92 } void MarlinSerial::println(double n, int digits) { print(n, digits); println(); 28320: 0d 94 fc 97 jmp 0x32ff8 ; 0x32ff8 00028324 : void MMU2::get_statistics() { logic.Statistics(); } uint8_t __attribute__((noinline)) MMU2::get_current_tool() const { return extruder == MMU2_NO_TOOL ? (uint8_t)FILAMENT_UNKNOWN : extruder; 28324: 80 91 7b 12 lds r24, 0x127B ; 0x80127b 28328: 83 36 cpi r24, 0x63 ; 99 2832a: 09 f4 brne .+2 ; 0x2832e 2832c: 8f ef ldi r24, 0xFF ; 255 } 2832e: 08 95 ret 00028330 : , tmcFailures(0) { } void MMU2::Status() { // Useful information to see during bootup and change state SERIAL_ECHOPGM("MMU is "); 28330: 8f e6 ldi r24, 0x6F ; 111 28332: 9d e9 ldi r25, 0x9D ; 157 28334: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_MMU_ENABLED, 0); 28338: 60 e0 ldi r22, 0x00 ; 0 2833a: 8c ea ldi r24, 0xAC ; 172 2833c: 9c e0 ldi r25, 0x0C ; 12 2833e: 0e 94 ed 6e call 0xddda ; 0xddda if (status == 1) { 28342: 81 30 cpi r24, 0x01 ; 1 28344: 21 f4 brne .+8 ; 0x2834e SERIAL_ECHOLNRPGM(_O(MSG_ON)); 28346: 81 eb ldi r24, 0xB1 ; 177 28348: 9a e5 ldi r25, 0x5A ; 90 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 2834a: 0c 94 53 72 jmp 0xe4a6 ; 0xe4a6 2834e: 8b ea ldi r24, 0xAB ; 171 28350: 9a e5 ldi r25, 0x5A ; 90 28352: fb cf rjmp .-10 ; 0x2834a 00028354 : print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 28354: bc 01 movw r22, r24 28356: 99 0f add r25, r25 28358: 88 0b sbc r24, r24 2835a: 99 0b sbc r25, r25 2835c: 0f 94 a2 96 call 0x32d44 ; 0x32d44 } void MarlinSerial::println(int n, int base) { print(n, base); println(); 28360: 0d 94 fc 97 jmp 0x32ff8 ; 0x32ff8 00028364 : uint8_t MMU2::get_tool_change_tool() const { return tool_change_extruder == MMU2_NO_TOOL ? (uint8_t)FILAMENT_UNKNOWN : tool_change_extruder; } void MMU2::SetCurrentTool(uint8_t ex){ 28364: cf 93 push r28 28366: c8 2f mov r28, r24 extruder = ex; 28368: 80 93 7b 12 sts 0x127B, r24 ; 0x80127b MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); 2836c: 81 e6 ldi r24, 0x61 ; 97 2836e: 9d e9 ldi r25, 0x9D ; 157 28370: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 28374: 85 e5 ldi r24, 0x55 ; 85 28376: 9d e9 ldi r25, 0x9D ; 157 28378: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 2837c: 8b e4 ldi r24, 0x4B ; 75 2837e: 9d e9 ldi r25, 0x9D ; 157 28380: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLN((int)ex); 28384: 8c 2f mov r24, r28 28386: 90 e0 ldi r25, 0x00 ; 0 } 28388: cf 91 pop r28 } void MMU2::SetCurrentTool(uint8_t ex){ extruder = ex; MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); 2838a: 0d 94 aa 41 jmp 0x28354 ; 0x28354 0002838e : return 0; } } //------------------------------------------------------------------------------ void Sd2Card::chipSelectHigh() { WRITE(SDSS, 1); 2838e: 28 9a sbi 0x05, 0 ; 5 } 28390: 08 95 ret 00028392 : spiRate_ = sckRateID; return true; } //------------------------------------------------------------------------------ // wait for card to go not busy bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) { 28392: 0f 93 push r16 28394: 1f 93 push r17 28396: cf 93 push r28 28398: df 93 push r29 2839a: ec 01 movw r28, r24 uint16_t t0 = _millis(); 2839c: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 283a0: 8b 01 movw r16, r22 while (spiRec() != 0XFF) { 283a2: 0f 94 ef 6f call 0x2dfde ; 0x2dfde 283a6: 8f 3f cpi r24, 0xFF ; 255 283a8: 69 f0 breq .+26 ; 0x283c4 if (((uint16_t)_millis() - t0) >= timeoutMillis) goto fail; 283aa: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 283ae: 60 1b sub r22, r16 283b0: 71 0b sbc r23, r17 283b2: 6c 17 cp r22, r28 283b4: 7d 07 cpc r23, r29 283b6: a8 f3 brcs .-22 ; 0x283a2 } return true; fail: return false; 283b8: 80 e0 ldi r24, 0x00 ; 0 } 283ba: df 91 pop r29 283bc: cf 91 pop r28 283be: 1f 91 pop r17 283c0: 0f 91 pop r16 283c2: 08 95 ret bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) { uint16_t t0 = _millis(); while (spiRec() != 0XFF) { if (((uint16_t)_millis() - t0) >= timeoutMillis) goto fail; } return true; 283c4: 81 e0 ldi r24, 0x01 ; 1 283c6: f9 cf rjmp .-14 ; 0x283ba 000283c8 : lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 283c8: 8a ef ldi r24, 0xFA ; 250 283ca: 95 e1 ldi r25, 0x15 ; 21 283cc: 0f 94 0a 39 call 0x27214 ; 0x27214 file.close(); 283d0: 8a ef ldi r24, 0xFA ; 250 283d2: 95 e1 ldi r25, 0x15 ; 21 283d4: 0f 94 92 6e call 0x2dd24 ; 0x2dd24 saving = false; 283d8: e8 e6 ldi r30, 0x68 ; 104 283da: f3 e1 ldi r31, 0x13 ; 19 283dc: 10 82 st Z, r1 logging = false; 283de: 11 82 std Z+1, r1 ; 0x01 // so one can unplug the printer and continue printing the next day. } } 283e0: 08 95 ret 000283e2 : //! If printing from sd card, position in file is saved. //! If printing from USB, line number is saved. //! //! @param z_move //! @param e_move void stop_and_save_print_to_ram(float z_move, float e_move) 283e2: cf 92 push r12 283e4: df 92 push r13 283e6: ef 92 push r14 283e8: ff 92 push r15 283ea: 0f 93 push r16 283ec: 1f 93 push r17 283ee: cf 93 push r28 283f0: df 93 push r29 283f2: eb 01 movw r28, r22 283f4: 18 2f mov r17, r24 283f6: 09 2f mov r16, r25 { if (saved_printing) return; cli(); 283f8: f8 94 cli void save_print_file_state() { uint8_t nlines; uint16_t sdlen_cmdqueue; uint16_t sdlen_planner; if (card.sdprinting) { 283fa: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 283fe: 88 23 and r24, r24 28400: 09 f4 brne .+2 ; 0x28404 28402: d8 c0 rjmp .+432 ; 0x285b4 saved_sdpos = sdpos_atomic; //atomic sd position of last command added in queue 28404: 80 91 dc 11 lds r24, 0x11DC ; 0x8011dc 28408: 90 91 dd 11 lds r25, 0x11DD ; 0x8011dd 2840c: a0 91 de 11 lds r26, 0x11DE ; 0x8011de 28410: b0 91 df 11 lds r27, 0x11DF ; 0x8011df 28414: 80 93 d8 11 sts 0x11D8, r24 ; 0x8011d8 28418: 90 93 d9 11 sts 0x11D9, r25 ; 0x8011d9 2841c: a0 93 da 11 sts 0x11DA, r26 ; 0x8011da 28420: b0 93 db 11 sts 0x11DB, r27 ; 0x8011db sdlen_planner = planner_calc_sd_length(); //length of sd commands in planner 28424: 0f 94 65 74 call 0x2e8ca ; 0x2e8ca saved_sdpos -= sdlen_planner; 28428: c0 90 d8 11 lds r12, 0x11D8 ; 0x8011d8 2842c: d0 90 d9 11 lds r13, 0x11D9 ; 0x8011d9 28430: e0 90 da 11 lds r14, 0x11DA ; 0x8011da 28434: f0 90 db 11 lds r15, 0x11DB ; 0x8011db 28438: c8 1a sub r12, r24 2843a: d9 0a sbc r13, r25 2843c: e1 08 sbc r14, r1 2843e: f1 08 sbc r15, r1 28440: c0 92 d8 11 sts 0x11D8, r12 ; 0x8011d8 28444: d0 92 d9 11 sts 0x11D9, r13 ; 0x8011d9 28448: e0 92 da 11 sts 0x11DA, r14 ; 0x8011da 2844c: f0 92 db 11 sts 0x11DB, r15 ; 0x8011db sdlen_cmdqueue = cmdqueue_calc_sd_length(); //length of sd commands in cmdqueue 28450: 0e 94 93 6f call 0xdf26 ; 0xdf26 saved_sdpos -= sdlen_cmdqueue; 28454: c8 1a sub r12, r24 28456: d9 0a sbc r13, r25 28458: e1 08 sbc r14, r1 2845a: f1 08 sbc r15, r1 2845c: c0 92 d8 11 sts 0x11D8, r12 ; 0x8011d8 28460: d0 92 d9 11 sts 0x11D9, r13 ; 0x8011d9 28464: e0 92 da 11 sts 0x11DA, r14 ; 0x8011da 28468: f0 92 db 11 sts 0x11DB, r15 ; 0x8011db saved_printing_type = PowerPanic::PRINT_TYPE_SD; 2846c: 10 92 79 02 sts 0x0279, r1 ; 0x800279 cli(); save_print_file_state(); // save the global state at planning time const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; 28470: 20 91 06 12 lds r18, 0x1206 ; 0x801206 28474: f0 90 05 12 lds r15, 0x1205 ; 0x801205 28478: 21 11 cpse r18, r1 2847a: f2 2e mov r15, r18 //not sd printing nor usb printing } } void save_planner_global_state() { if (current_block && !(mesh_bed_leveling_flag || homing_flag)) 2847c: 80 91 e4 11 lds r24, 0x11E4 ; 0x8011e4 28480: 90 91 e5 11 lds r25, 0x11E5 ; 0x8011e5 28484: 00 97 sbiw r24, 0x00 ; 0 28486: 09 f4 brne .+2 ; 0x2848a 28488: d1 c0 rjmp .+418 ; 0x2862c 2848a: 21 11 cpse r18, r1 2848c: cf c0 rjmp .+414 ; 0x2862c 2848e: 20 91 05 12 lds r18, 0x1205 ; 0x801205 28492: 21 11 cpse r18, r1 28494: cb c0 rjmp .+406 ; 0x2862c { memcpy(saved_start_position, current_block->gcode_start_position, sizeof(saved_start_position)); 28496: fc 01 movw r30, r24 28498: e8 5a subi r30, 0xA8 ; 168 2849a: ff 4f sbci r31, 0xFF ; 255 2849c: 20 e1 ldi r18, 0x10 ; 16 2849e: ae e7 ldi r26, 0x7E ; 126 284a0: b2 e0 ldi r27, 0x02 ; 2 284a2: 01 90 ld r0, Z+ 284a4: 0d 92 st X+, r0 284a6: 2a 95 dec r18 284a8: e1 f7 brne .-8 ; 0x284a2 saved_feedrate2 = current_block->gcode_feedrate; 284aa: fc 01 movw r30, r24 284ac: e6 59 subi r30, 0x96 ; 150 284ae: ff 4f sbci r31, 0xFF ; 255 284b0: 20 81 ld r18, Z 284b2: 31 81 ldd r19, Z+1 ; 0x01 284b4: 30 93 e3 11 sts 0x11E3, r19 ; 0x8011e3 284b8: 20 93 e2 11 sts 0x11E2, r18 ; 0x8011e2 saved_segment_idx = current_block->segment_idx; 284bc: 88 59 subi r24, 0x98 ; 152 284be: 9f 4f sbci r25, 0xFF ; 255 284c0: fc 01 movw r30, r24 284c2: 80 81 ld r24, Z 284c4: 91 81 ldd r25, Z+1 ; 0x01 284c6: 90 93 e1 11 sts 0x11E1, r25 ; 0x8011e1 284ca: 80 93 e0 11 sts 0x11E0, r24 ; 0x8011e0 // save the global state at planning time const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; save_planner_global_state(); planner_abort_hard(); //abort printing 284ce: 0f 94 ea 85 call 0x30bd4 ; 0x30bd4 memcpy(saved_pos, current_position, sizeof(saved_pos)); 284d2: 80 e1 ldi r24, 0x10 ; 16 284d4: e5 ef ldi r30, 0xF5 ; 245 284d6: f1 e1 ldi r31, 0x11 ; 17 284d8: a0 e9 ldi r26, 0x90 ; 144 284da: b2 e0 ldi r27, 0x02 ; 2 284dc: 01 90 ld r0, Z+ 284de: 0d 92 st X+, r0 284e0: 8a 95 dec r24 284e2: e1 f7 brne .-8 ; 0x284dc if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 284e4: ff 20 and r15, r15 284e6: 61 f0 breq .+24 ; 0x28500 284e8: 80 e0 ldi r24, 0x00 ; 0 284ea: 90 e0 ldi r25, 0x00 ; 0 284ec: a0 e8 ldi r26, 0x80 ; 128 284ee: bf eb ldi r27, 0xBF ; 191 284f0: 80 93 90 02 sts 0x0290, r24 ; 0x800290 284f4: 90 93 91 02 sts 0x0291, r25 ; 0x800291 284f8: a0 93 92 02 sts 0x0292, r26 ; 0x800292 284fc: b0 93 93 02 sts 0x0293, r27 ; 0x800293 saved_feedmultiply2 = feedmultiply; //save feedmultiply 28500: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 28504: 90 91 8f 02 lds r25, 0x028F ; 0x80028f 28508: 90 93 f4 11 sts 0x11F4, r25 ; 0x8011f4 <_ZL19saved_feedmultiply2.lto_priv.502+0x1> 2850c: 80 93 f3 11 sts 0x11F3, r24 ; 0x8011f3 <_ZL19saved_feedmultiply2.lto_priv.502> saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); 28510: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 28514: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 28518: 90 93 f0 11 sts 0x11F0, r25 ; 0x8011f0 2851c: 80 93 ef 11 sts 0x11EF, r24 ; 0x8011ef saved_bed_temperature = (uint8_t)degTargetBed(); 28520: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed 28524: 80 93 ec 11 sts 0x11EC, r24 ; 0x8011ec saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 28528: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb 2852c: 83 fb bst r24, 3 2852e: 88 27 eor r24, r24 28530: 80 f9 bld r24, 0 28532: 80 93 ea 11 sts 0x11EA, r24 ; 0x8011ea saved_fan_speed = fanSpeed; 28536: 80 91 e9 11 lds r24, 0x11E9 ; 0x8011e9 2853a: 80 93 e8 11 sts 0x11E8, r24 ; 0x8011e8 cmdqueue_reset(); //empty cmdqueue 2853e: 0e 94 20 73 call 0xe640 ; 0xe640 card.sdprinting = false; 28542: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a // card.closefile(); saved_printing = true; 28546: 81 e0 ldi r24, 0x01 ; 1 28548: 80 93 e7 11 sts 0x11E7, r24 ; 0x8011e7 // We may have missed a stepper timer interrupt. Be safe than sorry, reset the stepper timer before re-enabling interrupts. st_reset_timer(); 2854c: 0f 94 4e 22 call 0x2449c ; 0x2449c sei(); 28550: 78 94 sei if ((z_move != 0) || (e_move != 0)) { // extruder or z move 28552: 20 e0 ldi r18, 0x00 ; 0 28554: 30 e0 ldi r19, 0x00 ; 0 28556: a9 01 movw r20, r18 28558: f8 01 movw r30, r16 2855a: 6c 2f mov r22, r28 2855c: 7d 2f mov r23, r29 2855e: 8f 2f mov r24, r31 28560: 90 2f mov r25, r16 28562: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 28566: 88 23 and r24, r24 28568: e1 f0 breq .+56 ; 0x285a2 // move away from the print. if(e_move) { // First unretract (relative extrusion) if(!saved_extruder_relative_mode){ 2856a: 80 91 ea 11 lds r24, 0x11EA ; 0x8011ea 2856e: 81 11 cpse r24, r1 28570: 05 c0 rjmp .+10 ; 0x2857c enquecommand_P(MSG_M83); 28572: 61 e0 ldi r22, 0x01 ; 1 28574: 85 e3 ldi r24, 0x35 ; 53 28576: 9c e6 ldi r25, 0x6C ; 108 28578: 0e 94 af 7c call 0xf95e ; 0xf95e // A single sprintf may not be faster, but is definitely 20B shorter // than a sequence of commands building the string piece by piece // A snprintf would have been a safer call, but since it is not used // in the whole program, its implementation would bring more bytes to the total size // The behavior of dtostrf 8,3 should be roughly the same as %-0.3 enquecommandf_P(G1_E_F2700, e_move); 2857c: 0f 93 push r16 2857e: 1f 93 push r17 28580: df 93 push r29 28582: cf 93 push r28 28584: 85 e2 ldi r24, 0x25 ; 37 28586: 9c e6 ldi r25, 0x6C ; 108 28588: 9f 93 push r25 2858a: 8f 93 push r24 2858c: 0e 94 4d 7d call 0xfa9a ; 0xfa9a 28590: 81 e0 ldi r24, 0x01 ; 1 28592: 80 93 e6 11 sts 0x11E6, r24 ; 0x8011e6 28596: 0f 90 pop r0 28598: 0f 90 pop r0 2859a: 0f 90 pop r0 2859c: 0f 90 pop r0 2859e: 0f 90 pop r0 285a0: 0f 90 pop r0 // If this call is invoked from the main Arduino loop() function, let the caller know that the command // in the command queue is not the original command, but a new one, so it should not be removed from the queue. repeatcommand_front(); } } 285a2: df 91 pop r29 285a4: cf 91 pop r28 285a6: 1f 91 pop r17 285a8: 0f 91 pop r16 285aa: ff 90 pop r15 285ac: ef 90 pop r14 285ae: df 90 pop r13 285b0: cf 90 pop r12 285b2: 08 95 ret saved_sdpos -= sdlen_planner; sdlen_cmdqueue = cmdqueue_calc_sd_length(); //length of sd commands in cmdqueue saved_sdpos -= sdlen_cmdqueue; saved_printing_type = PowerPanic::PRINT_TYPE_SD; } else if (usb_timer.running()) { //reuse saved_sdpos for storing line number 285b4: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 285b8: 88 23 and r24, r24 285ba: b1 f1 breq .+108 ; 0x28628 saved_sdpos = gcode_LastN; //start with line number of command added recently to cmd queue 285bc: 80 91 d1 11 lds r24, 0x11D1 ; 0x8011d1 285c0: 90 91 d2 11 lds r25, 0x11D2 ; 0x8011d2 285c4: a0 91 d3 11 lds r26, 0x11D3 ; 0x8011d3 285c8: b0 91 d4 11 lds r27, 0x11D4 ; 0x8011d4 285cc: 80 93 d8 11 sts 0x11D8, r24 ; 0x8011d8 285d0: 90 93 d9 11 sts 0x11D9, r25 ; 0x8011d9 285d4: a0 93 da 11 sts 0x11DA, r26 ; 0x8011da 285d8: b0 93 db 11 sts 0x11DB, r27 ; 0x8011db //reuse planner_calc_sd_length function for getting number of lines of commands in planner: nlines = planner_calc_sd_length(); //number of lines of commands in planner 285dc: 0f 94 65 74 call 0x2e8ca ; 0x2e8ca saved_sdpos -= nlines; 285e0: 40 91 d8 11 lds r20, 0x11D8 ; 0x8011d8 285e4: 50 91 d9 11 lds r21, 0x11D9 ; 0x8011d9 285e8: 60 91 da 11 lds r22, 0x11DA ; 0x8011da 285ec: 70 91 db 11 lds r23, 0x11DB ; 0x8011db 285f0: 48 1b sub r20, r24 285f2: 51 09 sbc r21, r1 285f4: 61 09 sbc r22, r1 285f6: 71 09 sbc r23, r1 saved_sdpos -= buflen; //number of blocks in cmd buffer 285f8: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 285fc: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 28600: 09 2e mov r0, r25 28602: 00 0c add r0, r0 28604: aa 0b sbc r26, r26 28606: bb 0b sbc r27, r27 28608: 48 1b sub r20, r24 2860a: 59 0b sbc r21, r25 2860c: 6a 0b sbc r22, r26 2860e: 7b 0b sbc r23, r27 28610: 40 93 d8 11 sts 0x11D8, r20 ; 0x8011d8 28614: 50 93 d9 11 sts 0x11D9, r21 ; 0x8011d9 28618: 60 93 da 11 sts 0x11DA, r22 ; 0x8011da 2861c: 70 93 db 11 sts 0x11DB, r23 ; 0x8011db saved_printing_type = PowerPanic::PRINT_TYPE_HOST; 28620: 81 e0 ldi r24, 0x01 ; 1 } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; 28622: 80 93 79 02 sts 0x0279, r24 ; 0x800279 28626: 24 cf rjmp .-440 ; 0x28470 28628: 82 e0 ldi r24, 0x02 ; 2 2862a: fb cf rjmp .-10 ; 0x28622 saved_feedrate2 = current_block->gcode_feedrate; saved_segment_idx = current_block->segment_idx; } else { saved_start_position[0] = SAVED_START_POSITION_UNSET; 2862c: 80 e0 ldi r24, 0x00 ; 0 2862e: 90 e0 ldi r25, 0x00 ; 0 28630: a0 e8 ldi r26, 0x80 ; 128 28632: bf eb ldi r27, 0xBF ; 191 28634: 80 93 7e 02 sts 0x027E, r24 ; 0x80027e 28638: 90 93 7f 02 sts 0x027F, r25 ; 0x80027f 2863c: a0 93 80 02 sts 0x0280, r26 ; 0x800280 28640: b0 93 81 02 sts 0x0281, r27 ; 0x800281 saved_feedrate2 = feedrate; 28644: 60 91 7a 02 lds r22, 0x027A ; 0x80027a 28648: 70 91 7b 02 lds r23, 0x027B ; 0x80027b 2864c: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 28650: 90 91 7d 02 lds r25, 0x027D ; 0x80027d 28654: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 28658: 70 93 e3 11 sts 0x11E3, r23 ; 0x8011e3 2865c: 60 93 e2 11 sts 0x11E2, r22 ; 0x8011e2 saved_segment_idx = 0; 28660: 10 92 e1 11 sts 0x11E1, r1 ; 0x8011e1 28664: 10 92 e0 11 sts 0x11E0, r1 ; 0x8011e0 28668: 32 cf rjmp .-412 ; 0x284ce 0002866a : // "allow_recovery". If recovery is allowed, this forces a printer-initiated instantanenous pause // (just like an LCD pause) that bypasses the host pausing functionality. In this state the printer // is kept in busy state and *must* be recovered from the LCD. void ThermalStop(bool allow_recovery) { if(Stopped == false) { 2866a: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 2866e: 81 11 cpse r24, r1 28670: 1d c0 rjmp .+58 ; 0x286ac Stopped = true; 28672: 81 e0 ldi r24, 0x01 ; 1 28674: 80 93 ce 11 sts 0x11CE, r24 ; 0x8011ce saved_extruder_temperature = ext_temp; saved_fan_speed = fan_speed; } } else { // We got a hard thermal error and/or there is no print going on. Just stop. print_stop(false, true); 28678: 61 e0 ldi r22, 0x01 ; 1 2867a: 80 e0 ldi r24, 0x00 ; 0 2867c: 0e 94 92 ef call 0x1df24 ; 0x1df24 } // Report the error on the serial serialprintPGM(allow_recovery ? echomagic : errormagic); 28680: 84 e4 ldi r24, 0x44 ; 68 28682: 9d e9 ldi r25, 0x9D ; 157 28684: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ERRORLNRPGM(MSG_ERR_STOPPED); 28688: 80 ef ldi r24, 0xF0 ; 240 2868a: 9b e6 ldi r25, 0x6B ; 107 2868c: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 // Eventually report the stopped status on the lcd (though this is usually overridden by a // higher-priority alert status message) LCD_MESSAGERPGM(_T(MSG_STOPPED)); 28690: 8e e9 ldi r24, 0x9E ; 158 28692: 9a e5 ldi r25, 0x5A ; 90 28694: 0e 94 b1 6c call 0xd962 ; 0xd962 28698: 0e 94 65 e6 call 0x1ccca ; 0x1ccca // Make a warning sound! We cannot use Sound_MakeCustom as this would stop further moves. // Turn on the speaker here (if not already), and turn it off when back in the main loop. WRITE(BEEPER, HIGH); 2869c: 72 9a sbi 0x0e, 2 ; 14 // Always return to the status screen to ensure the NEW error is immediately shown. lcd_return_to_status(); 2869e: 0e 94 17 fe call 0x1fc2e ; 0x1fc2e if(!allow_recovery) { // prevent menu access for all fatal errors menu_set_block(MENU_BLOCK_THERMAL_ERROR); 286a2: 80 91 cd 11 lds r24, 0x11CD ; 0x8011cd 286a6: 81 60 ori r24, 0x01 ; 1 286a8: 80 93 cd 11 sts 0x11CD, r24 ; 0x8011cd } } } 286ac: 08 95 ret 000286ae : bool cmd_buffer_empty() { return (buflen == 0); } void enquecommand_front(const char *cmd, bool from_progmem) 286ae: 0f 93 push r16 286b0: 1f 93 push r17 286b2: cf 93 push r28 286b4: df 93 push r29 286b6: ec 01 movw r28, r24 286b8: 0f 94 9a 9d call 0x33b34 ; 0x33b34 <__strlen_P> 286bc: 8c 01 movw r16, r24 // If yes, adjust bufindr to the new position, where the new command could be enqued. // len_asked does not contain the zero terminator size. static bool cmdqueue_could_enqueue_front(size_t len_asked) { // MAX_CMD_SIZE has to accommodate the zero terminator. if (len_asked >= MAX_CMD_SIZE) 286be: 80 36 cpi r24, 0x60 ; 96 286c0: 91 05 cpc r25, r1 286c2: 08 f0 brcs .+2 ; 0x286c6 286c4: 85 c0 rjmp .+266 ; 0x287d0 return false; // Remove the currently processed command from the queue. if (! cmdbuffer_front_already_processed) { 286c6: 80 91 e6 11 lds r24, 0x11E6 ; 0x8011e6 286ca: 81 11 cpse r24, r1 286cc: 05 c0 rjmp .+10 ; 0x286d8 cmdqueue_pop_front(); 286ce: 0e 94 d3 6f call 0xdfa6 ; 0xdfa6 cmdbuffer_front_already_processed = true; 286d2: 81 e0 ldi r24, 0x01 ; 1 286d4: 80 93 e6 11 sts 0x11E6, r24 ; 0x8011e6 } if (bufindr == bufindw && buflen > 0) 286d8: 40 91 cb 11 lds r20, 0x11CB ; 0x8011cb 286dc: 50 91 cc 11 lds r21, 0x11CC ; 0x8011cc 286e0: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> 286e4: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> 286e8: 48 17 cp r20, r24 286ea: 59 07 cpc r21, r25 286ec: 41 f4 brne .+16 ; 0x286fe 286ee: 20 91 cf 11 lds r18, 0x11CF ; 0x8011cf 286f2: 30 91 d0 11 lds r19, 0x11D0 ; 0x8011d0 286f6: 12 16 cp r1, r18 286f8: 13 06 cpc r1, r19 286fa: 0c f4 brge .+2 ; 0x286fe 286fc: 69 c0 rjmp .+210 ; 0x287d0 // Full buffer. return false; // Adjust the end of the write buffer based on whether a partial line is in the receive buffer. int endw = (serial_count > 0) ? (bufindw + MAX_CMD_SIZE + 1) : bufindw; 286fe: 20 91 da 0f lds r18, 0x0FDA ; 0x800fda 28702: 30 91 db 0f lds r19, 0x0FDB ; 0x800fdb 28706: 12 16 cp r1, r18 28708: 13 06 cpc r1, r19 2870a: 0c f0 brlt .+2 ; 0x2870e 2870c: 41 c0 rjmp .+130 ; 0x28790 2870e: 9c 01 movw r18, r24 28710: 2f 59 subi r18, 0x9F ; 159 28712: 3f 4f sbci r19, 0xFF ; 255 if (bufindw < bufindr) { 28714: 84 17 cp r24, r20 28716: 95 07 cpc r25, r21 28718: e8 f5 brcc .+122 ; 0x28794 int bufindr_new = bufindr - len_asked - (1 + CMDHDRSIZE); 2871a: 44 50 subi r20, 0x04 ; 4 2871c: 51 09 sbc r21, r1 2871e: 40 1b sub r20, r16 28720: 51 0b sbc r21, r17 // Simple case. There is a contiguous space between the write buffer and the read buffer. if (endw <= bufindr_new) { 28722: 42 17 cp r20, r18 28724: 53 07 cpc r21, r19 28726: 0c f4 brge .+2 ; 0x2872a 28728: 53 c0 rjmp .+166 ; 0x287d0 } } else { // Otherwise the free space is split between the start and end. if (len_asked + (1 + CMDHDRSIZE) <= bufindr) { // Could fit at the start. bufindr -= len_asked + (1 + CMDHDRSIZE); 2872a: 50 93 cc 11 sts 0x11CC, r21 ; 0x8011cc 2872e: 40 93 cb 11 sts 0x11CB, r20 ; 0x8011cb void enquecommand_front(const char *cmd, bool from_progmem) { size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd); // Does cmd fit the queue? This call shall move bufindr, so the command may be copied. if (cmdqueue_could_enqueue_front(len)) { cmdbuffer[bufindr] = CMDBUFFER_CURRENT_TYPE_UI; 28732: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 28736: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 2873a: fc 01 movw r30, r24 2873c: e2 52 subi r30, 0x22 ; 34 2873e: f0 4f sbci r31, 0xF0 ; 240 28740: 23 e0 ldi r18, 0x03 ; 3 28742: 20 83 st Z, r18 if (from_progmem) strcpy_P(cmdbuffer + bufindr + CMDHDRSIZE, cmd); 28744: be 01 movw r22, r28 28746: 8f 51 subi r24, 0x1F ; 31 28748: 90 4f sbci r25, 0xF0 ; 240 2874a: 0f 94 93 9d call 0x33b26 ; 0x33b26 else strcpy(cmdbuffer + bufindr + CMDHDRSIZE, cmd); ++ buflen; 2874e: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 28752: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 28756: 01 96 adiw r24, 0x01 ; 1 28758: 90 93 d0 11 sts 0x11D0, r25 ; 0x8011d0 2875c: 80 93 cf 11 sts 0x11CF, r24 ; 0x8011cf SERIAL_ECHO_START; 28760: 81 e6 ldi r24, 0x61 ; 97 28762: 9d e9 ldi r25, 0x9D ; 157 28764: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHORPGM(enqueingFront); 28768: 8b e2 ldi r24, 0x2B ; 43 2876a: 9d e9 ldi r25, 0x9D ; 157 2876c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHO(cmdbuffer + bufindr + CMDHDRSIZE); 28770: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 28774: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc } }*/ static FORCE_INLINE void print(const char *str) { write(str); 28778: 8f 51 subi r24, 0x1F ; 31 2877a: 90 4f sbci r25, 0xF0 ; 240 2877c: 0e 94 a3 7c call 0xf946 ; 0xf946 SERIAL_ECHOLNPGM("\""); 28780: 89 e2 ldi r24, 0x29 ; 41 28782: 9d e9 ldi r25, 0x9D ; 157 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 28784: df 91 pop r29 28786: cf 91 pop r28 28788: 1f 91 pop r17 2878a: 0f 91 pop r16 SERIAL_ECHORPGM(enqueingFront); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2878c: 0c 94 53 72 jmp 0xe4a6 ; 0xe4a6 // Remove the currently processed command from the queue. if (! cmdbuffer_front_already_processed) { cmdqueue_pop_front(); cmdbuffer_front_already_processed = true; } if (bufindr == bufindw && buflen > 0) 28790: 9c 01 movw r18, r24 28792: c0 cf rjmp .-128 ; 0x28714 bufindr = bufindr_new; return true; } } else { // Otherwise the free space is split between the start and end. if (len_asked + (1 + CMDHDRSIZE) <= bufindr) { 28794: c8 01 movw r24, r16 28796: 04 96 adiw r24, 0x04 ; 4 28798: 48 17 cp r20, r24 2879a: 59 07 cpc r21, r25 2879c: 28 f0 brcs .+10 ; 0x287a8 // Could fit at the start. bufindr -= len_asked + (1 + CMDHDRSIZE); 2879e: 44 50 subi r20, 0x04 ; 4 287a0: 51 09 sbc r21, r1 287a2: 40 1b sub r20, r16 287a4: 51 0b sbc r21, r17 287a6: c1 cf rjmp .-126 ; 0x2872a return true; } int bufindr_new = sizeof(cmdbuffer) - len_asked - (1 + CMDHDRSIZE); 287a8: 89 ee ldi r24, 0xE9 ; 233 287aa: 91 e0 ldi r25, 0x01 ; 1 287ac: bc 01 movw r22, r24 287ae: 60 1b sub r22, r16 287b0: 71 0b sbc r23, r17 287b2: 8b 01 movw r16, r22 if (endw <= bufindr_new) { 287b4: 62 17 cp r22, r18 287b6: 73 07 cpc r23, r19 287b8: 5c f0 brlt .+22 ; 0x287d0 memset(cmdbuffer, 0, bufindr); 287ba: 70 e0 ldi r23, 0x00 ; 0 287bc: 60 e0 ldi r22, 0x00 ; 0 287be: 8e ed ldi r24, 0xDE ; 222 287c0: 9f e0 ldi r25, 0x0F ; 15 287c2: 0f 94 0e a6 call 0x34c1c ; 0x34c1c bufindr = bufindr_new; 287c6: 10 93 cc 11 sts 0x11CC, r17 ; 0x8011cc 287ca: 00 93 cb 11 sts 0x11CB, r16 ; 0x8011cb 287ce: b1 cf rjmp .-158 ; 0x28732 SERIAL_ECHOLNPGM("\""); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 287d0: 84 e4 ldi r24, 0x44 ; 68 287d2: 9d e9 ldi r25, 0x9D ; 157 287d4: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHORPGM(enqueingFront); 287d8: 8b e2 ldi r24, 0x2B ; 43 287da: 9d e9 ldi r25, 0x9D ; 157 287dc: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 287e0: ce 01 movw r24, r28 287e2: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 287e6: 82 e1 ldi r24, 0x12 ; 18 287e8: 9d e9 ldi r25, 0x9D ; 157 287ea: cc cf rjmp .-104 ; 0x28784 000287ec : } else { return false; } } bool SdFile::seekSetFilteredGcode(uint32_t pos){ 287ec: ab 01 movw r20, r22 287ee: bc 01 movw r22, r24 if(! seekSet(pos) )return false; 287f0: 8a ef ldi r24, 0xFA ; 250 287f2: 95 e1 ldi r25, 0x15 ; 21 287f4: 0f 94 3f 39 call 0x2727e ; 0x2727e 287f8: 81 11 cpse r24, r1 287fa: 02 c0 rjmp .+4 ; 0x28800 287fc: 80 e0 ldi r24, 0x00 ; 0 287fe: 08 95 ret } bool SdFile::openFilteredGcode(SdBaseFile* dirFile, const char* path){ if( open(dirFile, path, O_READ) ){ // compute the block to start with if( ! gfComputeNextFileBlock() ) 28800: 8a ef ldi r24, 0xFA ; 250 28802: 95 e1 ldi r25, 0x15 ; 21 28804: 0f 94 29 38 call 0x27052 ; 0x27052 28808: 88 23 and r24, r24 2880a: c1 f3 breq .-16 ; 0x287fc return vol_->cache()->data; // this is constant for the whole time, so it should be fast and sleek } void SdFile::gfReset(){ // reset cache read ptr to its begin gfReadPtr = gfBlockBuffBegin() + gfOffset; 2880c: 20 91 1b 16 lds r18, 0x161B ; 0x80161b 28810: 30 91 1c 16 lds r19, 0x161C ; 0x80161c 28814: 27 52 subi r18, 0x27 ; 39 28816: 32 4f sbci r19, 0xF2 ; 242 28818: 30 93 16 16 sts 0x1616, r19 ; 0x801616 2881c: 20 93 15 16 sts 0x1615, r18 ; 0x801615 bool SdFile::seekSetFilteredGcode(uint32_t pos){ if(! seekSet(pos) )return false; if(! gfComputeNextFileBlock() )return false; gfReset(); return true; } 28820: 08 95 ret 00028822 : SERIAL_PROTOCOLLNPGM("An error while writing to the SD Card."); } } void CardReader::checkautostart(bool force) 28822: 8f 92 push r8 28824: 9f 92 push r9 28826: af 92 push r10 28828: bf 92 push r11 2882a: cf 92 push r12 2882c: df 92 push r13 2882e: ef 92 push r14 28830: ff 92 push r15 28832: 0f 93 push r16 28834: 1f 93 push r17 28836: cf 93 push r28 28838: df 93 push r29 2883a: cd b7 in r28, 0x3d ; 61 2883c: de b7 in r29, 0x3e ; 62 2883e: ee 97 sbiw r28, 0x3e ; 62 28840: 0f b6 in r0, 0x3f ; 63 28842: f8 94 cli 28844: de bf out 0x3e, r29 ; 62 28846: 0f be out 0x3f, r0 ; 63 28848: cd bf out 0x3d, r28 ; 61 if(!mounted) //fail return; } char autoname[30]; sprintf_P(autoname, PSTR("auto%i.g"), lastnr); 2884a: 80 91 b8 13 lds r24, 0x13B8 ; 0x8013b8 2884e: 8f 93 push r24 28850: 80 91 b7 13 lds r24, 0x13B7 ; 0x8013b7 28854: 8f 93 push r24 28856: 8d ec ldi r24, 0xCD ; 205 28858: 9c e9 ldi r25, 0x9C ; 156 2885a: 9f 93 push r25 2885c: 8f 93 push r24 2885e: 8e 01 movw r16, r28 28860: 0f 5d subi r16, 0xDF ; 223 28862: 1f 4f sbci r17, 0xFF ; 255 28864: 1f 93 push r17 28866: 0f 93 push r16 28868: 0f 94 f3 9e call 0x33de6 ; 0x33de6 2886c: 0f 90 pop r0 2886e: 0f 90 pop r0 28870: 0f 90 pop r0 28872: 0f 90 pop r0 28874: 0f 90 pop r0 28876: 0f 90 pop r0 for(int8_t i=0;i<(int8_t)strlen(autoname);i++) 28878: f1 2c mov r15, r1 2887a: f8 01 movw r30, r16 2887c: 01 90 ld r0, Z+ 2887e: 00 20 and r0, r0 28880: e9 f7 brne .-6 ; 0x2887c 28882: 31 97 sbiw r30, 0x01 ; 1 28884: e0 1b sub r30, r16 28886: f1 0b sbc r31, r17 28888: fe 16 cp r15, r30 2888a: 84 f4 brge .+32 ; 0x288ac autoname[i]=tolower(autoname[i]); 2888c: 68 01 movw r12, r16 2888e: cf 0c add r12, r15 28890: d1 1c adc r13, r1 28892: f7 fc sbrc r15, 7 28894: da 94 dec r13 28896: f6 01 movw r30, r12 28898: 80 81 ld r24, Z 2889a: 08 2e mov r0, r24 2889c: 00 0c add r0, r0 2889e: 99 0b sbc r25, r25 288a0: 0f 94 f0 a5 call 0x34be0 ; 0x34be0 288a4: f6 01 movw r30, r12 288a6: 80 83 st Z, r24 288a8: f3 94 inc r15 288aa: e7 cf rjmp .-50 ; 0x2887a dir_t p; root.rewind(); 288ac: 80 ef ldi r24, 0xF0 ; 240 288ae: 93 e1 ldi r25, 0x13 ; 19 288b0: 0e 94 36 70 call 0xe06c ; 0xe06c bool found=false; 288b4: a1 2c mov r10, r1 288b6: ce 01 movw r24, r28 288b8: 01 96 adiw r24, 0x01 ; 1 288ba: 7c 01 movw r14, r24 //Serial.println(autoname); if(p.name[9]!='~') //skip safety copies if(strncmp((char*)p.name,autoname,5)==0) { // M23: Select SD file enquecommandf_P(MSG_M23, autoname); 288bc: 89 ee ldi r24, 0xE9 ; 233 288be: c8 2e mov r12, r24 288c0: 8b e6 ldi r24, 0x6B ; 107 288c2: d8 2e mov r13, r24 * a directory file or an I/O error occurred. */ int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) { int16_t n; // if not a directory file or miss-positioned return an error if (!isDir() || (0X1F & curPosition_)) return -1; 288c4: 80 91 f3 13 lds r24, 0x13F3 ; 0x8013f3 288c8: 82 30 cpi r24, 0x02 ; 2 288ca: 08 f4 brcc .+2 ; 0x288ce 288cc: 50 c0 rjmp .+160 ; 0x2896e 288ce: 80 91 f8 13 lds r24, 0x13F8 ; 0x8013f8 288d2: 90 91 f9 13 lds r25, 0x13F9 ; 0x8013f9 288d6: a0 91 fa 13 lds r26, 0x13FA ; 0x8013fa 288da: b0 91 fb 13 lds r27, 0x13FB ; 0x8013fb 288de: 8f 71 andi r24, 0x1F ; 31 288e0: 99 27 eor r25, r25 288e2: aa 27 eor r26, r26 288e4: bb 27 eor r27, r27 288e6: 89 2b or r24, r25 288e8: 8a 2b or r24, r26 288ea: 8b 2b or r24, r27 288ec: 09 f0 breq .+2 ; 0x288f0 288ee: 3f c0 rjmp .+126 ; 0x2896e 288f0: 50 e0 ldi r21, 0x00 ; 0 288f2: 40 e0 ldi r20, 0x00 ; 0 288f4: b7 01 movw r22, r14 288f6: 80 ef ldi r24, 0xF0 ; 240 288f8: 93 e1 ldi r25, 0x13 ; 19 288fa: 0f 94 a2 38 call 0x27144 ; 0x27144 dir_t p; root.rewind(); bool found=false; while (root.readDir(p, NULL) > 0) 288fe: 18 16 cp r1, r24 28900: b4 f5 brge .+108 ; 0x2896e { for(int8_t i=0;i<(int8_t)strlen((char*)p.name);i++) 28902: b1 2c mov r11, r1 28904: f7 01 movw r30, r14 28906: 01 90 ld r0, Z+ 28908: 00 20 and r0, r0 2890a: e9 f7 brne .-6 ; 0x28906 2890c: 31 97 sbiw r30, 0x01 ; 1 2890e: ee 19 sub r30, r14 28910: ff 09 sbc r31, r15 28912: be 16 cp r11, r30 28914: 74 f4 brge .+28 ; 0x28932 p.name[i]=tolower(p.name[i]); 28916: 47 01 movw r8, r14 28918: 8b 0c add r8, r11 2891a: 91 1c adc r9, r1 2891c: b7 fc sbrc r11, 7 2891e: 9a 94 dec r9 28920: f4 01 movw r30, r8 28922: 80 81 ld r24, Z 28924: 90 e0 ldi r25, 0x00 ; 0 28926: 0f 94 f0 a5 call 0x34be0 ; 0x34be0 2892a: f4 01 movw r30, r8 2892c: 80 83 st Z, r24 2892e: b3 94 inc r11 28930: e9 cf rjmp .-46 ; 0x28904 //Serial.print((char*)p.name); //Serial.print(" "); //Serial.println(autoname); if(p.name[9]!='~') //skip safety copies 28932: 8a 85 ldd r24, Y+10 ; 0x0a 28934: 8e 37 cpi r24, 0x7E ; 126 28936: 31 f2 breq .-116 ; 0x288c4 if(strncmp((char*)p.name,autoname,5)==0) 28938: 45 e0 ldi r20, 0x05 ; 5 2893a: 50 e0 ldi r21, 0x00 ; 0 2893c: b8 01 movw r22, r16 2893e: c7 01 movw r24, r14 28940: 0f 94 4e a6 call 0x34c9c ; 0x34c9c 28944: 89 2b or r24, r25 28946: 09 f0 breq .+2 ; 0x2894a 28948: bd cf rjmp .-134 ; 0x288c4 { // M23: Select SD file enquecommandf_P(MSG_M23, autoname); 2894a: 1f 93 push r17 2894c: 0f 93 push r16 2894e: df 92 push r13 28950: cf 92 push r12 28952: 0e 94 4d 7d call 0xfa9a ; 0xfa9a // M24: Start/resume SD print enquecommand_P(MSG_M24); 28956: 61 e0 ldi r22, 0x01 ; 1 28958: 85 ee ldi r24, 0xE5 ; 229 2895a: 9b e6 ldi r25, 0x6B ; 107 2895c: 0e 94 af 7c call 0xf95e ; 0xf95e 28960: 0f 90 pop r0 28962: 0f 90 pop r0 28964: 0f 90 pop r0 28966: 0f 90 pop r0 found=true; 28968: aa 24 eor r10, r10 2896a: a3 94 inc r10 2896c: ab cf rjmp .-170 ; 0x288c4 } } if(!found) lastnr=-1; 2896e: 8f ef ldi r24, 0xFF ; 255 28970: 9f ef ldi r25, 0xFF ; 255 // M24: Start/resume SD print enquecommand_P(MSG_M24); found=true; } } if(!found) 28972: aa 20 and r10, r10 28974: 29 f0 breq .+10 ; 0x28980 lastnr=-1; else lastnr++; 28976: 80 91 b7 13 lds r24, 0x13B7 ; 0x8013b7 2897a: 90 91 b8 13 lds r25, 0x13B8 ; 0x8013b8 2897e: 01 96 adiw r24, 0x01 ; 1 28980: 90 93 b8 13 sts 0x13B8, r25 ; 0x8013b8 28984: 80 93 b7 13 sts 0x13B7, r24 ; 0x8013b7 } 28988: ee 96 adiw r28, 0x3e ; 62 2898a: 0f b6 in r0, 0x3f ; 63 2898c: f8 94 cli 2898e: de bf out 0x3e, r29 ; 62 28990: 0f be out 0x3f, r0 ; 63 28992: cd bf out 0x3d, r28 ; 61 28994: df 91 pop r29 28996: cf 91 pop r28 28998: 1f 91 pop r17 2899a: 0f 91 pop r16 2899c: ff 90 pop r15 2899e: ef 90 pop r14 289a0: df 90 pop r13 289a2: cf 90 pop r12 289a4: bf 90 pop r11 289a6: af 90 pop r10 289a8: 9f 90 pop r9 289aa: 8f 90 pop r8 289ac: 08 95 ret 000289ae : * \return The value one, true, is returned for success and * the value zero, false, is returned for failure. * Reasons for failure include file is read only, file is a directory, * \a length is greater than the current file size or an I/O error occurs. */ bool SdBaseFile::truncate(uint32_t length) { 289ae: 8f 92 push r8 289b0: 9f 92 push r9 289b2: af 92 push r10 289b4: bf 92 push r11 289b6: cf 92 push r12 289b8: df 92 push r13 289ba: ef 92 push r14 289bc: ff 92 push r15 289be: 0f 93 push r16 289c0: 1f 93 push r17 289c2: cf 93 push r28 289c4: df 93 push r29 289c6: 00 d0 rcall .+0 ; 0x289c8 289c8: 1f 92 push r1 289ca: cd b7 in r28, 0x3d ; 61 289cc: de b7 in r29, 0x3e ; 62 289ce: fc 01 movw r30, r24 uint32_t newPos; // error if not a normal file or read-only if (!isFile() || !(flags_ & O_WRITE)) goto fail; 289d0: 83 81 ldd r24, Z+3 ; 0x03 289d2: 81 30 cpi r24, 0x01 ; 1 289d4: 11 f0 breq .+4 ; 0x289da // set file to correct position return seekSet(newPos); fail: return false; 289d6: 80 e0 ldi r24, 0x00 ; 0 289d8: 60 c0 rjmp .+192 ; 0x28a9a * \a length is greater than the current file size or an I/O error occurs. */ bool SdBaseFile::truncate(uint32_t length) { uint32_t newPos; // error if not a normal file or read-only if (!isFile() || !(flags_ & O_WRITE)) goto fail; 289da: 81 81 ldd r24, Z+1 ; 0x01 289dc: 81 ff sbrs r24, 1 289de: fb cf rjmp .-10 ; 0x289d6 // error if length is greater than current size if (length > fileSize_) goto fail; // fileSize and length are zero - nothing to do if (fileSize_ == 0) return true; 289e0: 81 89 ldd r24, Z+17 ; 0x11 289e2: 92 89 ldd r25, Z+18 ; 0x12 289e4: a3 89 ldd r26, Z+19 ; 0x13 289e6: b4 89 ldd r27, Z+20 ; 0x14 289e8: 89 2b or r24, r25 289ea: 8a 2b or r24, r26 289ec: 8b 2b or r24, r27 289ee: 09 f4 brne .+2 ; 0x289f2 289f0: 6e c0 rjmp .+220 ; 0x28ace 289f2: 7f 01 movw r14, r30 // remember position for seek after truncation newPos = curPosition_ > length ? length : curPosition_; // position to last cluster in truncated file if (!seekSet(length)) goto fail; 289f4: 40 e0 ldi r20, 0x00 ; 0 289f6: 50 e0 ldi r21, 0x00 ; 0 289f8: ba 01 movw r22, r20 289fa: cf 01 movw r24, r30 289fc: 0f 94 3f 39 call 0x2727e ; 0x2727e 28a00: 88 23 and r24, r24 28a02: 49 f3 breq .-46 ; 0x289d6 if (length == 0) { // free all clusters if (!vol_->freeChain(firstCluster_)) goto fail; 28a04: f7 01 movw r30, r14 28a06: c1 8c ldd r12, Z+25 ; 0x19 28a08: d2 8c ldd r13, Z+26 ; 0x1a 28a0a: 85 88 ldd r8, Z+21 ; 0x15 28a0c: 96 88 ldd r9, Z+22 ; 0x16 28a0e: a7 88 ldd r10, Z+23 ; 0x17 28a10: b0 8c ldd r11, Z+24 ; 0x18 // free a cluster chain bool SdVolume::freeChain(uint32_t cluster) { uint32_t next; // clear free cluster location allocSearchStart_ = 2; 28a12: 82 e0 ldi r24, 0x02 ; 2 28a14: 90 e0 ldi r25, 0x00 ; 0 28a16: a0 e0 ldi r26, 0x00 ; 0 28a18: b0 e0 ldi r27, 0x00 ; 0 28a1a: f6 01 movw r30, r12 28a1c: 80 83 st Z, r24 28a1e: 91 83 std Z+1, r25 ; 0x01 28a20: a2 83 std Z+2, r26 ; 0x02 28a22: b3 83 std Z+3, r27 ; 0x03 do { if (!fatGet(cluster, &next)) goto fail; 28a24: 9e 01 movw r18, r28 28a26: 2f 5f subi r18, 0xFF ; 255 28a28: 3f 4f sbci r19, 0xFF ; 255 28a2a: b5 01 movw r22, r10 28a2c: a4 01 movw r20, r8 28a2e: c6 01 movw r24, r12 28a30: 0f 94 3c 37 call 0x26e78 ; 0x26e78 28a34: 88 23 and r24, r24 28a36: 79 f2 breq .-98 ; 0x289d6 // free cluster if (!fatPut(cluster, 0)) goto fail; 28a38: 00 e0 ldi r16, 0x00 ; 0 28a3a: 10 e0 ldi r17, 0x00 ; 0 28a3c: 98 01 movw r18, r16 28a3e: b5 01 movw r22, r10 28a40: a4 01 movw r20, r8 28a42: c6 01 movw r24, r12 28a44: 0f 94 aa 36 call 0x26d54 ; 0x26d54 28a48: 88 23 and r24, r24 28a4a: 29 f2 breq .-118 ; 0x289d6 cluster = next; 28a4c: 89 80 ldd r8, Y+1 ; 0x01 28a4e: 9a 80 ldd r9, Y+2 ; 0x02 28a50: ab 80 ldd r10, Y+3 ; 0x03 28a52: bc 80 ldd r11, Y+4 ; 0x04 return fatPut(cluster, 0x0FFFFFFF); } bool freeChain(uint32_t cluster); bool isEOC(uint32_t cluster) const { if (FAT12_SUPPORT && fatType_ == 12) return cluster >= FAT12EOC_MIN; if (fatType_ == 16) return cluster >= FAT16EOC_MIN; 28a54: f6 01 movw r30, r12 28a56: 87 89 ldd r24, Z+23 ; 0x17 28a58: 80 31 cpi r24, 0x10 ; 16 28a5a: 81 f5 brne .+96 ; 0x28abc 28a5c: f8 ef ldi r31, 0xF8 ; 248 28a5e: 8f 16 cp r8, r31 28a60: ff ef ldi r31, 0xFF ; 255 28a62: 9f 06 cpc r9, r31 28a64: a1 04 cpc r10, r1 28a66: b1 04 cpc r11, r1 28a68: e8 f2 brcs .-70 ; 0x28a24 firstCluster_ = 0; 28a6a: f7 01 movw r30, r14 28a6c: 15 8a std Z+21, r1 ; 0x15 28a6e: 16 8a std Z+22, r1 ; 0x16 28a70: 17 8a std Z+23, r1 ; 0x17 28a72: 10 8e std Z+24, r1 ; 0x18 // current cluster is end of chain if (!vol_->fatPutEOC(curCluster_)) goto fail; } } fileSize_ = length; 28a74: 11 8a std Z+17, r1 ; 0x11 28a76: 12 8a std Z+18, r1 ; 0x12 28a78: 13 8a std Z+19, r1 ; 0x13 28a7a: 14 8a std Z+20, r1 ; 0x14 // need to update directory entry flags_ |= F_FILE_DIR_DIRTY; 28a7c: 81 81 ldd r24, Z+1 ; 0x01 28a7e: 80 68 ori r24, 0x80 ; 128 28a80: 81 83 std Z+1, r24 ; 0x01 if (!sync()) goto fail; 28a82: c7 01 movw r24, r14 28a84: 0f 94 0a 39 call 0x27214 ; 0x27214 28a88: 88 23 and r24, r24 28a8a: 09 f4 brne .+2 ; 0x28a8e 28a8c: a4 cf rjmp .-184 ; 0x289d6 // set file to correct position return seekSet(newPos); 28a8e: 40 e0 ldi r20, 0x00 ; 0 28a90: 50 e0 ldi r21, 0x00 ; 0 28a92: ba 01 movw r22, r20 28a94: c7 01 movw r24, r14 28a96: 0f 94 3f 39 call 0x2727e ; 0x2727e fail: return false; } 28a9a: 0f 90 pop r0 28a9c: 0f 90 pop r0 28a9e: 0f 90 pop r0 28aa0: 0f 90 pop r0 28aa2: df 91 pop r29 28aa4: cf 91 pop r28 28aa6: 1f 91 pop r17 28aa8: 0f 91 pop r16 28aaa: ff 90 pop r15 28aac: ef 90 pop r14 28aae: df 90 pop r13 28ab0: cf 90 pop r12 28ab2: bf 90 pop r11 28ab4: af 90 pop r10 28ab6: 9f 90 pop r9 28ab8: 8f 90 pop r8 28aba: 08 95 ret return cluster >= FAT32EOC_MIN; 28abc: 88 ef ldi r24, 0xF8 ; 248 28abe: 88 16 cp r8, r24 28ac0: 8f ef ldi r24, 0xFF ; 255 28ac2: 98 06 cpc r9, r24 28ac4: a8 06 cpc r10, r24 28ac6: 8f e0 ldi r24, 0x0F ; 15 28ac8: b8 06 cpc r11, r24 28aca: 78 f6 brcc .-98 ; 0x28a6a 28acc: ab cf rjmp .-170 ; 0x28a24 // error if length is greater than current size if (length > fileSize_) goto fail; // fileSize and length are zero - nothing to do if (fileSize_ == 0) return true; 28ace: 81 e0 ldi r24, 0x01 ; 1 28ad0: e4 cf rjmp .-56 ; 0x28a9a 00028ad2 : +* LS_Count - Add +1 to nrFiles for every file within the parent +* LS_GetFilename - Get the filename of the file indexed by nrFiles +* LS_SerialPrint - Print the full path and size of each file to serial output +*/ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const match/*=NULL*/, LsAction lsAction, ls_param lsParams) { 28ad2: 2f 92 push r2 28ad4: 3f 92 push r3 28ad6: 4f 92 push r4 28ad8: 5f 92 push r5 28ada: 6f 92 push r6 28adc: 7f 92 push r7 28ade: 8f 92 push r8 28ae0: 9f 92 push r9 28ae2: af 92 push r10 28ae4: bf 92 push r11 28ae6: cf 92 push r12 28ae8: df 92 push r13 28aea: ef 92 push r14 28aec: ff 92 push r15 28aee: 0f 93 push r16 28af0: 1f 93 push r17 28af2: cf 93 push r28 28af4: df 93 push r29 28af6: cd b7 in r28, 0x3d ; 61 28af8: de b7 in r29, 0x3e ; 62 28afa: c6 57 subi r28, 0x76 ; 118 28afc: d1 09 sbc r29, r1 28afe: 0f b6 in r0, 0x3f ; 63 28b00: f8 94 cli 28b02: de bf out 0x3e, r29 ; 62 28b04: 0f be out 0x3f, r0 ; 63 28b06: cd bf out 0x3d, r28 ; 61 28b08: 4c 01 movw r8, r24 28b0a: 6b 01 movw r12, r22 28b0c: 3a 01 movw r6, r20 28b0e: e5 96 adiw r28, 0x35 ; 53 28b10: 2f af std Y+63, r18 ; 0x3f 28b12: e5 97 sbiw r28, 0x35 ; 53 28b14: 50 2e mov r5, r16 cnt++; break; } } } // while readDir } 28b16: 2d b6 in r2, 0x3d ; 61 28b18: 3e b6 in r3, 0x3e ; 62 28b1a: 10 2f mov r17, r16 28b1c: 11 70 andi r17, 0x01 ; 1 static uint8_t recursionCnt = 0; // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} 28b1e: 80 91 d8 0d lds r24, 0x0DD8 ; 0x800dd8 28b22: 8f 5f subi r24, 0xFF ; 255 28b24: 80 93 d8 0d sts 0x0DD8, r24 ; 0x800dd8 } recursionCntIncrementer; dir_t p; uint8_t cnt = 0; // Read the next entry from a directory for (position = parent.curPosition(); parent.readDir(p, longFilename) > 0; position = parent.curPosition()) { 28b28: fb 01 movw r30, r22 28b2a: 80 85 ldd r24, Z+8 ; 0x08 28b2c: 91 85 ldd r25, Z+9 ; 0x09 28b2e: a2 85 ldd r26, Z+10 ; 0x0a 28b30: b3 85 ldd r27, Z+11 ; 0x0b 28b32: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d 28b36: 90 93 7e 13 sts 0x137E, r25 ; 0x80137e 28b3a: a0 93 7f 13 sts 0x137F, r26 ; 0x80137f 28b3e: b0 93 80 13 sts 0x1380, r27 ; 0x801380 _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} } recursionCntIncrementer; dir_t p; uint8_t cnt = 0; 28b42: 41 2c mov r4, r1 if (longFilename[0] == '.') continue; if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; if (DIR_IS_SUBDIR(&p) && lsAction == LS_SerialPrint) { // If the entry is a directory and the action is LS_SerialPrint // Get the short name for the item, which we know is a folder char lfilename[FILENAME_LENGTH]; createFilename(lfilename, p); 28b44: 5e 01 movw r10, r28 28b46: f7 e6 ldi r31, 0x67 ; 103 28b48: af 0e add r10, r31 28b4a: b1 1c adc r11, r1 * a directory file or an I/O error occurred. */ int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) { int16_t n; // if not a directory file or miss-positioned return an error if (!isDir() || (0X1F & curPosition_)) return -1; 28b4c: f6 01 movw r30, r12 28b4e: 83 81 ldd r24, Z+3 ; 0x03 28b50: 82 30 cpi r24, 0x02 ; 2 28b52: 08 f4 brcc .+2 ; 0x28b56 28b54: c0 c1 rjmp .+896 ; 0x28ed6 28b56: 80 85 ldd r24, Z+8 ; 0x08 28b58: 91 85 ldd r25, Z+9 ; 0x09 28b5a: a2 85 ldd r26, Z+10 ; 0x0a 28b5c: b3 85 ldd r27, Z+11 ; 0x0b 28b5e: 8f 71 andi r24, 0x1F ; 31 28b60: 99 27 eor r25, r25 28b62: aa 27 eor r26, r26 28b64: bb 27 eor r27, r27 28b66: 89 2b or r24, r25 28b68: 8a 2b or r24, r26 28b6a: 8b 2b or r24, r27 28b6c: 09 f0 breq .+2 ; 0x28b70 28b6e: b3 c1 rjmp .+870 ; 0x28ed6 //If we have a longFilename buffer, mark it as invalid. If we find a long filename it will be filled automaticly. if (longFilename != NULL) { longFilename[0] = '\0'; 28b70: 10 92 81 13 sts 0x1381, r1 ; 0x801381 28b74: 41 e8 ldi r20, 0x81 ; 129 28b76: 53 e1 ldi r21, 0x13 ; 19 28b78: be 01 movw r22, r28 28b7a: 69 5b subi r22, 0xB9 ; 185 28b7c: 7f 4f sbci r23, 0xFF ; 255 28b7e: c6 01 movw r24, r12 28b80: 0f 94 a2 38 call 0x27144 ; 0x27144 } recursionCntIncrementer; dir_t p; uint8_t cnt = 0; // Read the next entry from a directory for (position = parent.curPosition(); parent.readDir(p, longFilename) > 0; position = parent.curPosition()) { 28b84: 18 16 cp r1, r24 28b86: 0c f0 brlt .+2 ; 0x28b8a 28b88: a6 c1 rjmp .+844 ; 0x28ed6 if (recursionCnt > MAX_DIR_DEPTH) 28b8a: 80 91 d8 0d lds r24, 0x0DD8 ; 0x800dd8 28b8e: 87 30 cpi r24, 0x07 ; 7 28b90: 08 f0 brcs .+2 ; 0x28b94 28b92: a1 c1 rjmp .+834 ; 0x28ed6 return; uint8_t pn0 = p.name[0]; 28b94: 28 96 adiw r28, 0x08 ; 8 28b96: 8f ad ldd r24, Y+63 ; 0x3f 28b98: 28 97 sbiw r28, 0x08 ; 8 if (pn0 == DIR_NAME_FREE) break; 28b9a: 88 23 and r24, r24 28b9c: 09 f4 brne .+2 ; 0x28ba0 28b9e: 9b c1 rjmp .+822 ; 0x28ed6 if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue; 28ba0: 85 3e cpi r24, 0xE5 ; 229 28ba2: 09 f4 brne .+2 ; 0x28ba6 28ba4: 39 c1 rjmp .+626 ; 0x28e18 28ba6: 8e 32 cpi r24, 0x2E ; 46 28ba8: 09 f4 brne .+2 ; 0x28bac 28baa: 36 c1 rjmp .+620 ; 0x28e18 if (longFilename[0] == '.') continue; 28bac: 80 91 81 13 lds r24, 0x1381 ; 0x801381 28bb0: 8e 32 cpi r24, 0x2E ; 46 28bb2: 09 f4 brne .+2 ; 0x28bb6 28bb4: 31 c1 rjmp .+610 ; 0x28e18 28bb6: 63 96 adiw r28, 0x13 ; 19 28bb8: 8f ad ldd r24, Y+63 ; 0x3f 28bba: 63 97 sbiw r28, 0x13 ; 19 if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; 28bbc: 98 2f mov r25, r24 28bbe: 9a 70 andi r25, 0x0A ; 10 28bc0: 09 f0 breq .+2 ; 0x28bc4 28bc2: 2a c1 rjmp .+596 ; 0x28e18 28bc4: 88 71 andi r24, 0x18 ; 24 * \param[in] dir Pointer to a directory entry. * * \return true if the entry is for a subdirectory else false. */ static inline uint8_t DIR_IS_SUBDIR(const dir_t* dir) { return (dir->attributes & DIR_ATT_FILE_TYPE_MASK) == DIR_ATT_DIRECTORY; 28bc6: 91 e0 ldi r25, 0x01 ; 1 28bc8: 80 31 cpi r24, 0x10 ; 16 28bca: 19 f0 breq .+6 ; 0x28bd2 28bcc: 90 e0 ldi r25, 0x00 ; 0 if (DIR_IS_SUBDIR(&p) && lsAction == LS_SerialPrint) { // If the entry is a directory and the action is LS_SerialPrint 28bce: 80 31 cpi r24, 0x10 ; 16 28bd0: 31 f4 brne .+12 ; 0x28bde 28bd2: e5 96 adiw r28, 0x35 ; 53 28bd4: ff ad ldd r31, Y+63 ; 0x3f 28bd6: e5 97 sbiw r28, 0x35 ; 53 28bd8: ff 23 and r31, r31 28bda: 09 f4 brne .+2 ; 0x28bde 28bdc: 94 c0 rjmp .+296 ; 0x28d06 if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); } else { filenameIsDir = DIR_IS_SUBDIR(&p); 28bde: 90 93 b6 13 sts 0x13B6, r25 ; 0x8013b6 if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; 28be2: 80 31 cpi r24, 0x10 ; 16 28be4: 61 f0 breq .+24 ; 0x28bfe 28be6: 60 96 adiw r28, 0x10 ; 16 28be8: 8f ad ldd r24, Y+63 ; 0x3f 28bea: 60 97 sbiw r28, 0x10 ; 16 28bec: 87 34 cpi r24, 0x47 ; 71 28bee: 09 f0 breq .+2 ; 0x28bf2 28bf0: 13 c1 rjmp .+550 ; 0x28e18 28bf2: 61 96 adiw r28, 0x11 ; 17 28bf4: 8f ad ldd r24, Y+63 ; 0x3f 28bf6: 61 97 sbiw r28, 0x11 ; 17 28bf8: 8e 37 cpi r24, 0x7E ; 126 28bfa: 09 f4 brne .+2 ; 0x28bfe 28bfc: 0d c1 rjmp .+538 ; 0x28e18 switch (lsAction) { 28bfe: e5 96 adiw r28, 0x35 ; 53 28c00: ff ad ldd r31, Y+63 ; 0x3f 28c02: e5 97 sbiw r28, 0x35 ; 53 28c04: f1 30 cpi r31, 0x01 ; 1 28c06: 09 f4 brne .+2 ; 0x28c0a 28c08: 1b c1 rjmp .+566 ; 0x28e40 28c0a: f2 30 cpi r31, 0x02 ; 2 28c0c: 09 f4 brne .+2 ; 0x28c10 28c0e: 25 c1 rjmp .+586 ; 0x28e5a case LS_Count: nrFiles++; break; case LS_SerialPrint: createFilename(filename, p); 28c10: be 01 movw r22, r28 28c12: 69 5b subi r22, 0xB9 ; 185 28c14: 7f 4f sbci r23, 0xFF ; 255 28c16: 8c e6 ldi r24, 0x6C ; 108 28c18: 93 e1 ldi r25, 0x13 ; 19 28c1a: 0e 94 20 70 call 0xe040 ; 0xe040 28c1e: c4 01 movw r24, r8 28c20: 0e 94 a3 7c call 0xf946 ; 0xf946 28c24: 8c e6 ldi r24, 0x6C ; 108 28c26: 93 e1 ldi r25, 0x13 ; 19 28c28: 0e 94 a3 7c call 0xf946 ; 0xf946 SERIAL_PROTOCOL(prepend); SERIAL_PROTOCOL(filename); MYSERIAL.write(' '); 28c2c: 80 e2 ldi r24, 0x20 ; 32 28c2e: 0e 94 41 70 call 0xe082 ; 0xe082 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 28c32: a7 96 adiw r28, 0x27 ; 39 28c34: 6c ad ldd r22, Y+60 ; 0x3c 28c36: 7d ad ldd r23, Y+61 ; 0x3d 28c38: 8e ad ldd r24, Y+62 ; 0x3e 28c3a: 9f ad ldd r25, Y+63 ; 0x3f 28c3c: a7 97 sbiw r28, 0x27 ; 39 28c3e: 4a e0 ldi r20, 0x0A ; 10 28c40: 0f 94 2c 96 call 0x32c58 ; 0x32c58 SERIAL_PROTOCOL(p.fileSize); if (lsParams.timestamp) 28c44: 51 fe sbrs r5, 1 28c46: 45 c0 rjmp .+138 ; 0x28cd2 { crmodDate = p.lastWriteDate; 28c48: a1 96 adiw r28, 0x21 ; 33 28c4a: 2e ad ldd r18, Y+62 ; 0x3e 28c4c: 3f ad ldd r19, Y+63 ; 0x3f 28c4e: a1 97 sbiw r28, 0x21 ; 33 28c50: 30 93 7c 13 sts 0x137C, r19 ; 0x80137c 28c54: 20 93 7b 13 sts 0x137B, r18 ; 0x80137b crmodTime = p.lastWriteTime; 28c58: 6f 96 adiw r28, 0x1f ; 31 28c5a: 4e ad ldd r20, Y+62 ; 0x3e 28c5c: 5f ad ldd r21, Y+63 ; 0x3f 28c5e: 6f 97 sbiw r28, 0x1f ; 31 28c60: 50 93 7a 13 sts 0x137A, r21 ; 0x80137a 28c64: 40 93 79 13 sts 0x1379, r20 ; 0x801379 if( crmodDate < p.creationDate || ( crmodDate == p.creationDate && crmodTime < p.creationTime ) ){ 28c68: 69 96 adiw r28, 0x19 ; 25 28c6a: 8e ad ldd r24, Y+62 ; 0x3e 28c6c: 9f ad ldd r25, Y+63 ; 0x3f 28c6e: 69 97 sbiw r28, 0x19 ; 25 28c70: 28 17 cp r18, r24 28c72: 39 07 cpc r19, r25 28c74: 50 f0 brcs .+20 ; 0x28c8a 28c76: 28 17 cp r18, r24 28c78: 39 07 cpc r19, r25 28c7a: 99 f4 brne .+38 ; 0x28ca2 28c7c: 67 96 adiw r28, 0x17 ; 23 28c7e: 2e ad ldd r18, Y+62 ; 0x3e 28c80: 3f ad ldd r19, Y+63 ; 0x3f 28c82: 67 97 sbiw r28, 0x17 ; 23 28c84: 42 17 cp r20, r18 28c86: 53 07 cpc r21, r19 28c88: 60 f4 brcc .+24 ; 0x28ca2 crmodDate = p.creationDate; 28c8a: 90 93 7c 13 sts 0x137C, r25 ; 0x80137c 28c8e: 80 93 7b 13 sts 0x137B, r24 ; 0x80137b crmodTime = p.creationTime; 28c92: 67 96 adiw r28, 0x17 ; 23 28c94: 8e ad ldd r24, Y+62 ; 0x3e 28c96: 9f ad ldd r25, Y+63 ; 0x3f 28c98: 67 97 sbiw r28, 0x17 ; 23 28c9a: 90 93 7a 13 sts 0x137A, r25 ; 0x80137a 28c9e: 80 93 79 13 sts 0x1379, r24 ; 0x801379 } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); 28ca2: 80 91 7c 13 lds r24, 0x137C ; 0x80137c 28ca6: 8f 93 push r24 28ca8: 80 91 7b 13 lds r24, 0x137B ; 0x80137b 28cac: 8f 93 push r24 28cae: 80 91 7a 13 lds r24, 0x137A ; 0x80137a 28cb2: 8f 93 push r24 28cb4: 80 91 79 13 lds r24, 0x1379 ; 0x801379 28cb8: 8f 93 push r24 28cba: 2a ea ldi r18, 0xAA ; 170 28cbc: 3c e9 ldi r19, 0x9C ; 156 28cbe: 3f 93 push r19 28cc0: 2f 93 push r18 28cc2: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 28cc6: 0f 90 pop r0 28cc8: 0f 90 pop r0 28cca: 0f 90 pop r0 28ccc: 0f 90 pop r0 28cce: 0f 90 pop r0 28cd0: 0f 90 pop r0 } if (lsParams.LFN) 28cd2: 11 23 and r17, r17 28cd4: 99 f0 breq .+38 ; 0x28cfc printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 28cd6: 80 91 81 13 lds r24, 0x1381 ; 0x801381 28cda: 88 23 and r24, r24 28cdc: 09 f4 brne .+2 ; 0x28ce0 28cde: ba c0 rjmp .+372 ; 0x28e54 28ce0: 81 e8 ldi r24, 0x81 ; 129 28ce2: 93 e1 ldi r25, 0x13 ; 19 28ce4: 9f 93 push r25 28ce6: 8f 93 push r24 28ce8: e4 ea ldi r30, 0xA4 ; 164 28cea: fc e9 ldi r31, 0x9C ; 156 28cec: ff 93 push r31 28cee: ef 93 push r30 28cf0: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 28cf4: 0f 90 pop r0 28cf6: 0f 90 pop r0 28cf8: 0f 90 pop r0 28cfa: 0f 90 pop r0 SERIAL_PROTOCOLLN(); 28cfc: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 manage_heater(); 28d00: 0f 94 5b 32 call 0x264b6 ; 0x264b6 28d04: 89 c0 rjmp .+274 ; 0x28e18 } lsDive(path, dir, NULL, lsAction, lsParams); // close() is done automatically by destructor of SdFile if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); 28d06: 2d b7 in r18, 0x3d ; 61 28d08: 3e b7 in r19, 0x3e ; 62 28d0a: e7 96 adiw r28, 0x37 ; 55 28d0c: 3f af std Y+63, r19 ; 0x3f 28d0e: 2e af std Y+62, r18 ; 0x3e 28d10: e7 97 sbiw r28, 0x37 ; 55 if (longFilename[0] == '.') continue; if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; if (DIR_IS_SUBDIR(&p) && lsAction == LS_SerialPrint) { // If the entry is a directory and the action is LS_SerialPrint // Get the short name for the item, which we know is a folder char lfilename[FILENAME_LENGTH]; createFilename(lfilename, p); 28d12: be 01 movw r22, r28 28d14: 69 5b subi r22, 0xB9 ; 185 28d16: 7f 4f sbci r23, 0xFF ; 255 28d18: c5 01 movw r24, r10 28d1a: 0e 94 20 70 call 0xe040 ; 0xe040 // Allocate enough stack space for the full path to a folder, trailing slash, and nul bool prepend_is_empty = (prepend[0] == '\0'); 28d1e: f4 01 movw r30, r8 28d20: 80 81 ld r24, Z int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(lfilename) + 1 + 1; 28d22: 88 23 and r24, r24 28d24: 09 f4 brne .+2 ; 0x28d28 28d26: 86 c0 rjmp .+268 ; 0x28e34 28d28: 01 90 ld r0, Z+ 28d2a: 00 20 and r0, r0 28d2c: e9 f7 brne .-6 ; 0x28d28 28d2e: 31 97 sbiw r30, 0x01 ; 1 28d30: e8 19 sub r30, r8 28d32: f9 09 sbc r31, r9 28d34: d5 01 movw r26, r10 28d36: 0d 90 ld r0, X+ 28d38: 00 20 and r0, r0 28d3a: e9 f7 brne .-6 ; 0x28d36 28d3c: ea 19 sub r30, r10 28d3e: fb 09 sbc r31, r11 char path[len]; 28d40: ea 0f add r30, r26 28d42: fb 1f adc r31, r27 28d44: 31 96 adiw r30, 0x01 ; 1 28d46: 2d b7 in r18, 0x3d ; 61 28d48: 3e b7 in r19, 0x3e ; 62 28d4a: 2e 1b sub r18, r30 28d4c: 3f 0b sbc r19, r31 28d4e: 0f b6 in r0, 0x3f ; 63 28d50: f8 94 cli 28d52: 3e bf out 0x3e, r19 ; 62 28d54: 0f be out 0x3f, r0 ; 63 28d56: 2d bf out 0x3d, r18 ; 61 28d58: ed b7 in r30, 0x3d ; 61 28d5a: fe b7 in r31, 0x3e ; 62 28d5c: 31 96 adiw r30, 0x01 ; 1 28d5e: 7f 01 movw r14, r30 // Append the FOLDERNAME12/ to the passed string. // It contains the full path to the "parent" argument. // We now have the full path to the item in this folder. strcpy(path, prepend_is_empty ? "/" : prepend); // root slash if prepend is empty 28d60: 61 ef ldi r22, 0xF1 ; 241 28d62: 72 e0 ldi r23, 0x02 ; 2 28d64: 81 11 cpse r24, r1 28d66: b4 01 movw r22, r8 28d68: c7 01 movw r24, r14 28d6a: 0f 94 47 a6 call 0x34c8e ; 0x34c8e strcat(path, lfilename); // FILENAME_LENGTH-1 characters maximum 28d6e: b5 01 movw r22, r10 28d70: c7 01 movw r24, r14 28d72: 0f 94 28 a6 call 0x34c50 ; 0x34c50 strcat(path, "/"); // 1 character 28d76: 61 ef ldi r22, 0xF1 ; 241 28d78: 72 e0 ldi r23, 0x02 ; 2 28d7a: c7 01 movw r24, r14 28d7c: 0f 94 28 a6 call 0x34c50 ; 0x34c50 // Serial.print(path); // Get a new directory object using the full path // and dive recursively into it. if (lsParams.LFN) 28d80: 11 23 and r17, r17 28d82: a9 f0 breq .+42 ; 0x28dae printf_P(PSTR("DIR_ENTER: %s \"%s\"\n"), path, longFilename[0] ? longFilename : lfilename); 28d84: 80 91 81 13 lds r24, 0x1381 ; 0x801381 28d88: 81 11 cpse r24, r1 28d8a: 57 c0 rjmp .+174 ; 0x28e3a 28d8c: c5 01 movw r24, r10 28d8e: 9f 93 push r25 28d90: 8f 93 push r24 28d92: ff 92 push r15 28d94: ef 92 push r14 28d96: 29 eb ldi r18, 0xB9 ; 185 28d98: 3c e9 ldi r19, 0x9C ; 156 28d9a: 3f 93 push r19 28d9c: 2f 93 push r18 28d9e: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 28da2: 0f 90 pop r0 28da4: 0f 90 pop r0 28da6: 0f 90 pop r0 28da8: 0f 90 pop r0 28daa: 0f 90 pop r0 28dac: 0f 90 pop r0 28dae: 1c a2 std Y+36, r1 ; 0x24 28db0: 1f a2 std Y+39, r1 ; 0x27 * OR of flags O_READ, O_WRITE, O_TRUNC, and O_SYNC. * \return true for success or false for failure. */ bool open(SdBaseFile& dirFile, // NOLINT const char* path, uint8_t oflag) { return open(&dirFile, path, oflag); 28db2: 21 e0 ldi r18, 0x01 ; 1 28db4: a5 01 movw r20, r10 28db6: b6 01 movw r22, r12 28db8: ce 01 movw r24, r28 28dba: 84 96 adiw r24, 0x24 ; 36 28dbc: 0f 94 89 99 call 0x33312 ; 0x33312 if (!dir.open(parent, lfilename, O_READ)) { //SERIAL_ECHO_START(); //SERIAL_ECHOPGM(_i("Cannot open subdir"));////MSG_SD_CANT_OPEN_SUBDIR //SERIAL_ECHOLN(lfilename); } lsDive(path, dir, NULL, lsAction, lsParams); 28dc0: 83 e2 ldi r24, 0x23 ; 35 28dc2: fe 01 movw r30, r28 28dc4: b4 96 adiw r30, 0x24 ; 36 28dc6: de 01 movw r26, r28 28dc8: 11 96 adiw r26, 0x01 ; 1 28dca: 01 90 ld r0, Z+ 28dcc: 0d 92 st X+, r0 28dce: 8a 95 dec r24 28dd0: e1 f7 brne .-8 ; 0x28dca 28dd2: 10 fb bst r17, 0 28dd4: 50 f8 bld r5, 0 28dd6: 05 2d mov r16, r5 28dd8: 20 e0 ldi r18, 0x00 ; 0 28dda: 50 e0 ldi r21, 0x00 ; 0 28ddc: 40 e0 ldi r20, 0x00 ; 0 28dde: be 01 movw r22, r28 28de0: 6f 5f subi r22, 0xFF ; 255 28de2: 7f 4f sbci r23, 0xFF ; 255 28de4: c7 01 movw r24, r14 28de6: 0f 94 69 45 call 0x28ad2 ; 0x28ad2 28dea: ce 01 movw r24, r28 28dec: 01 96 adiw r24, 0x01 ; 1 28dee: 0e 94 3b 70 call 0xe076 ; 0xe076 // close() is done automatically by destructor of SdFile if (lsParams.LFN) 28df2: 11 23 and r17, r17 28df4: 21 f0 breq .+8 ; 0x28dfe puts_P(PSTR("DIR_EXIT")); 28df6: 80 eb ldi r24, 0xB0 ; 176 28df8: 9c e9 ldi r25, 0x9C ; 156 28dfa: 0f 94 c5 9e call 0x33d8a ; 0x33d8a 28dfe: ce 01 movw r24, r28 28e00: 84 96 adiw r24, 0x24 ; 36 28e02: 0e 94 3b 70 call 0xe076 ; 0xe076 28e06: e7 96 adiw r28, 0x37 ; 55 28e08: ee ad ldd r30, Y+62 ; 0x3e 28e0a: ff ad ldd r31, Y+63 ; 0x3f 28e0c: e7 97 sbiw r28, 0x37 ; 55 28e0e: 0f b6 in r0, 0x3f ; 63 28e10: f8 94 cli 28e12: fe bf out 0x3e, r31 ; 62 28e14: 0f be out 0x3f, r0 ; 63 28e16: ed bf out 0x3d, r30 ; 61 } recursionCntIncrementer; dir_t p; uint8_t cnt = 0; // Read the next entry from a directory for (position = parent.curPosition(); parent.readDir(p, longFilename) > 0; position = parent.curPosition()) { 28e18: f6 01 movw r30, r12 28e1a: 80 85 ldd r24, Z+8 ; 0x08 28e1c: 91 85 ldd r25, Z+9 ; 0x09 28e1e: a2 85 ldd r26, Z+10 ; 0x0a 28e20: b3 85 ldd r27, Z+11 ; 0x0b 28e22: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d 28e26: 90 93 7e 13 sts 0x137E, r25 ; 0x80137e 28e2a: a0 93 7f 13 sts 0x137F, r26 ; 0x80137f 28e2e: b0 93 80 13 sts 0x1380, r27 ; 0x801380 28e32: 8c ce rjmp .-744 ; 0x28b4c // Get the short name for the item, which we know is a folder char lfilename[FILENAME_LENGTH]; createFilename(lfilename, p); // Allocate enough stack space for the full path to a folder, trailing slash, and nul bool prepend_is_empty = (prepend[0] == '\0'); int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(lfilename) + 1 + 1; 28e34: e1 e0 ldi r30, 0x01 ; 1 28e36: f0 e0 ldi r31, 0x00 ; 0 28e38: 7d cf rjmp .-262 ; 0x28d34 // Serial.print(path); // Get a new directory object using the full path // and dive recursively into it. if (lsParams.LFN) printf_P(PSTR("DIR_ENTER: %s \"%s\"\n"), path, longFilename[0] ? longFilename : lfilename); 28e3a: 81 e8 ldi r24, 0x81 ; 129 28e3c: 93 e1 ldi r25, 0x13 ; 19 28e3e: a7 cf rjmp .-178 ; 0x28d8e else { filenameIsDir = DIR_IS_SUBDIR(&p); if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; switch (lsAction) { case LS_Count: nrFiles++; 28e40: 80 91 82 16 lds r24, 0x1682 ; 0x801682 28e44: 90 91 83 16 lds r25, 0x1683 ; 0x801683 28e48: 01 96 adiw r24, 0x01 ; 1 28e4a: 90 93 83 16 sts 0x1683, r25 ; 0x801683 28e4e: 80 93 82 16 sts 0x1682, r24 ; 0x801682 28e52: e2 cf rjmp .-60 ; 0x28e18 } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); } if (lsParams.LFN) printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 28e54: 8c e6 ldi r24, 0x6C ; 108 28e56: 93 e1 ldi r25, 0x13 ; 19 28e58: 45 cf rjmp .-374 ; 0x28ce4 manage_heater(); break; case LS_GetFilename: //SERIAL_ECHOPGM("File: "); createFilename(filename, p); 28e5a: be 01 movw r22, r28 28e5c: 69 5b subi r22, 0xB9 ; 185 28e5e: 7f 4f sbci r23, 0xFF ; 255 28e60: 8c e6 ldi r24, 0x6C ; 108 28e62: 93 e1 ldi r25, 0x13 ; 19 28e64: 0e 94 20 70 call 0xe040 ; 0xe040 SERIAL_ECHOPGM("Creation date: "); MYSERIAL.println(p.creationDate); SERIAL_ECHOPGM("Access date: "); MYSERIAL.println(p.lastAccessDate); SERIAL_ECHOLNPGM("");*/ crmodDate = p.lastWriteDate; 28e68: a1 96 adiw r28, 0x21 ; 33 28e6a: 2e ad ldd r18, Y+62 ; 0x3e 28e6c: 3f ad ldd r19, Y+63 ; 0x3f 28e6e: a1 97 sbiw r28, 0x21 ; 33 28e70: 30 93 7c 13 sts 0x137C, r19 ; 0x80137c 28e74: 20 93 7b 13 sts 0x137B, r18 ; 0x80137b crmodTime = p.lastWriteTime; 28e78: 6f 96 adiw r28, 0x1f ; 31 28e7a: 4e ad ldd r20, Y+62 ; 0x3e 28e7c: 5f ad ldd r21, Y+63 ; 0x3f 28e7e: 6f 97 sbiw r28, 0x1f ; 31 28e80: 50 93 7a 13 sts 0x137A, r21 ; 0x80137a 28e84: 40 93 79 13 sts 0x1379, r20 ; 0x801379 // There are scenarios when simple modification time is not enough (on MS Windows) // For example - extract an old g-code from an archive onto the SD card. // In such case the creation time is current time (which is correct), but the modification time // stays the same - i.e. old. // Therefore let's pick the most recent timestamp from both creation and modification timestamps if( crmodDate < p.creationDate || ( crmodDate == p.creationDate && crmodTime < p.creationTime ) ){ 28e88: 69 96 adiw r28, 0x19 ; 25 28e8a: 8e ad ldd r24, Y+62 ; 0x3e 28e8c: 9f ad ldd r25, Y+63 ; 0x3f 28e8e: 69 97 sbiw r28, 0x19 ; 25 28e90: 28 17 cp r18, r24 28e92: 39 07 cpc r19, r25 28e94: 50 f0 brcs .+20 ; 0x28eaa 28e96: 28 17 cp r18, r24 28e98: 39 07 cpc r19, r25 28e9a: 99 f4 brne .+38 ; 0x28ec2 28e9c: 67 96 adiw r28, 0x17 ; 23 28e9e: 2e ad ldd r18, Y+62 ; 0x3e 28ea0: 3f ad ldd r19, Y+63 ; 0x3f 28ea2: 67 97 sbiw r28, 0x17 ; 23 28ea4: 42 17 cp r20, r18 28ea6: 53 07 cpc r21, r19 28ea8: 60 f4 brcc .+24 ; 0x28ec2 crmodDate = p.creationDate; 28eaa: 90 93 7c 13 sts 0x137C, r25 ; 0x80137c 28eae: 80 93 7b 13 sts 0x137B, r24 ; 0x80137b crmodTime = p.creationTime; 28eb2: 67 96 adiw r28, 0x17 ; 23 28eb4: 8e ad ldd r24, Y+62 ; 0x3e 28eb6: 9f ad ldd r25, Y+63 ; 0x3f 28eb8: 67 97 sbiw r28, 0x17 ; 23 28eba: 90 93 7a 13 sts 0x137A, r25 ; 0x80137a 28ebe: 80 93 79 13 sts 0x1379, r24 ; 0x801379 } //writeDate = p.lastAccessDate; if (match != NULL) { 28ec2: 61 14 cp r6, r1 28ec4: 71 04 cpc r7, r1 28ec6: 59 f1 breq .+86 ; 0x28f1e if (strcasecmp(match, filename) == 0) return; 28ec8: 6c e6 ldi r22, 0x6C ; 108 28eca: 73 e1 ldi r23, 0x13 ; 19 28ecc: c3 01 movw r24, r6 28ece: 0f 94 15 a6 call 0x34c2a ; 0x34c2a 28ed2: 89 2b or r24, r25 28ed4: 59 f5 brne .+86 ; 0x28f2c // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} 28ed6: 80 91 d8 0d lds r24, 0x0DD8 ; 0x800dd8 28eda: 81 50 subi r24, 0x01 ; 1 28edc: 80 93 d8 0d sts 0x0DD8, r24 ; 0x800dd8 cnt++; break; } } } // while readDir } 28ee0: 0f b6 in r0, 0x3f ; 63 28ee2: f8 94 cli 28ee4: 3e be out 0x3e, r3 ; 62 28ee6: 0f be out 0x3f, r0 ; 63 28ee8: 2d be out 0x3d, r2 ; 61 28eea: ca 58 subi r28, 0x8A ; 138 28eec: df 4f sbci r29, 0xFF ; 255 28eee: 0f b6 in r0, 0x3f ; 63 28ef0: f8 94 cli 28ef2: de bf out 0x3e, r29 ; 62 28ef4: 0f be out 0x3f, r0 ; 63 28ef6: cd bf out 0x3d, r28 ; 61 28ef8: df 91 pop r29 28efa: cf 91 pop r28 28efc: 1f 91 pop r17 28efe: 0f 91 pop r16 28f00: ff 90 pop r15 28f02: ef 90 pop r14 28f04: df 90 pop r13 28f06: cf 90 pop r12 28f08: bf 90 pop r11 28f0a: af 90 pop r10 28f0c: 9f 90 pop r9 28f0e: 8f 90 pop r8 28f10: 7f 90 pop r7 28f12: 6f 90 pop r6 28f14: 5f 90 pop r5 28f16: 4f 90 pop r4 28f18: 3f 90 pop r3 28f1a: 2f 90 pop r2 28f1c: 08 95 ret } //writeDate = p.lastAccessDate; if (match != NULL) { if (strcasecmp(match, filename) == 0) return; } else if (cnt == nrFiles) return; 28f1e: 80 91 82 16 lds r24, 0x1682 ; 0x801682 28f22: 90 91 83 16 lds r25, 0x1683 ; 0x801683 28f26: 48 16 cp r4, r24 28f28: 19 06 cpc r1, r25 28f2a: a9 f2 breq .-86 ; 0x28ed6 cnt++; 28f2c: 43 94 inc r4 28f2e: 74 cf rjmp .-280 ; 0x28e18 00028f30 : } } void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) 28f30: cf 92 push r12 28f32: df 92 push r13 28f34: ef 92 push r14 28f36: ff 92 push r15 28f38: 0f 93 push r16 28f3a: cf 93 push r28 28f3c: df 93 push r29 28f3e: cd b7 in r28, 0x3d ; 61 28f40: de b7 in r29, 0x3e ; 62 28f42: a3 97 sbiw r28, 0x23 ; 35 28f44: 0f b6 in r0, 0x3f ; 63 28f46: f8 94 cli 28f48: de bf out 0x3e, r29 ; 62 28f4a: 0f be out 0x3f, r0 ; 63 28f4c: cd bf out 0x3d, r28 ; 61 28f4e: 6c 01 movw r12, r24 { curDir=&workDir; 28f50: 83 e1 ldi r24, 0x13 ; 19 28f52: e8 2e mov r14, r24 28f54: 84 e1 ldi r24, 0x14 ; 20 28f56: f8 2e mov r15, r24 28f58: 85 e1 ldi r24, 0x15 ; 21 28f5a: 94 e1 ldi r25, 0x14 ; 20 28f5c: d7 01 movw r26, r14 28f5e: 8d 93 st X+, r24 28f60: 9c 93 st X, r25 nrFiles=nr; 28f62: 10 92 83 16 sts 0x1683, r1 ; 0x801683 28f66: 10 92 82 16 sts 0x1682, r1 ; 0x801682 curDir->rewind(); 28f6a: 0e 94 36 70 call 0xe06c ; 0xe06c }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 28f6e: 00 e0 ldi r16, 0x00 ; 0 28f70: 0e 7f andi r16, 0xFE ; 254 28f72: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir,match, LS_GetFilename); 28f74: d7 01 movw r26, r14 28f76: ed 91 ld r30, X+ 28f78: fc 91 ld r31, X 28f7a: 83 e2 ldi r24, 0x23 ; 35 28f7c: de 01 movw r26, r28 28f7e: 11 96 adiw r26, 0x01 ; 1 28f80: 01 90 ld r0, Z+ 28f82: 0d 92 st X+, r0 28f84: 8a 95 dec r24 28f86: e1 f7 brne .-8 ; 0x28f80 28f88: 22 e0 ldi r18, 0x02 ; 2 28f8a: a6 01 movw r20, r12 28f8c: be 01 movw r22, r28 28f8e: 6f 5f subi r22, 0xFF ; 255 28f90: 7f 4f sbci r23, 0xFF ; 255 28f92: 8a ed ldi r24, 0xDA ; 218 28f94: 92 e0 ldi r25, 0x02 ; 2 28f96: 0f 94 69 45 call 0x28ad2 ; 0x28ad2 28f9a: ce 01 movw r24, r28 28f9c: 01 96 adiw r24, 0x01 ; 1 28f9e: 0e 94 3b 70 call 0xe076 ; 0xe076 } 28fa2: a3 96 adiw r28, 0x23 ; 35 28fa4: 0f b6 in r0, 0x3f ; 63 28fa6: f8 94 cli 28fa8: de bf out 0x3e, r29 ; 62 28faa: 0f be out 0x3f, r0 ; 63 28fac: cd bf out 0x3d, r28 ; 61 28fae: df 91 pop r29 28fb0: cf 91 pop r28 28fb2: 0f 91 pop r16 28fb4: ff 90 pop r15 28fb6: ef 90 pop r14 28fb8: df 90 pop r13 28fba: cf 90 pop r12 28fbc: 08 95 ret 00028fbe : void CardReader::getfilename_simple(uint16_t entry, const char * const match/*=NULL*/) 28fbe: ef 92 push r14 28fc0: ff 92 push r15 28fc2: 0f 93 push r16 28fc4: cf 93 push r28 28fc6: df 93 push r29 28fc8: cd b7 in r28, 0x3d ; 61 28fca: de b7 in r29, 0x3e ; 62 28fcc: a3 97 sbiw r28, 0x23 ; 35 28fce: 0f b6 in r0, 0x3f ; 63 28fd0: f8 94 cli 28fd2: de bf out 0x3e, r29 ; 62 28fd4: 0f be out 0x3f, r0 ; 63 28fd6: cd bf out 0x3d, r28 ; 61 { curDir = &workDir; 28fd8: 23 e1 ldi r18, 0x13 ; 19 28fda: e2 2e mov r14, r18 28fdc: 24 e1 ldi r18, 0x14 ; 20 28fde: f2 2e mov r15, r18 28fe0: 25 e1 ldi r18, 0x15 ; 21 28fe2: 34 e1 ldi r19, 0x14 ; 20 28fe4: d7 01 movw r26, r14 28fe6: 2d 93 st X+, r18 28fe8: 3c 93 st X, r19 nrFiles = 0; 28fea: 10 92 83 16 sts 0x1683, r1 ; 0x801683 28fee: 10 92 82 16 sts 0x1682, r1 ; 0x801682 curDir->seekSet((uint32_t)entry << 5); 28ff2: b0 e0 ldi r27, 0x00 ; 0 28ff4: a0 e0 ldi r26, 0x00 ; 0 28ff6: ac 01 movw r20, r24 28ff8: bd 01 movw r22, r26 28ffa: e5 e0 ldi r30, 0x05 ; 5 28ffc: 44 0f add r20, r20 28ffe: 55 1f adc r21, r21 29000: 66 1f adc r22, r22 29002: 77 1f adc r23, r23 29004: ea 95 dec r30 29006: d1 f7 brne .-12 ; 0x28ffc 29008: c9 01 movw r24, r18 2900a: 0f 94 3f 39 call 0x2727e ; 0x2727e 2900e: 00 e0 ldi r16, 0x00 ; 0 29010: 0e 7f andi r16, 0xFE ; 254 29012: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 29014: d7 01 movw r26, r14 29016: ed 91 ld r30, X+ 29018: fc 91 ld r31, X 2901a: 83 e2 ldi r24, 0x23 ; 35 2901c: de 01 movw r26, r28 2901e: 11 96 adiw r26, 0x01 ; 1 29020: 01 90 ld r0, Z+ 29022: 0d 92 st X+, r0 29024: 8a 95 dec r24 29026: e1 f7 brne .-8 ; 0x29020 29028: 22 e0 ldi r18, 0x02 ; 2 2902a: 50 e0 ldi r21, 0x00 ; 0 2902c: 40 e0 ldi r20, 0x00 ; 0 2902e: be 01 movw r22, r28 29030: 6f 5f subi r22, 0xFF ; 255 29032: 7f 4f sbci r23, 0xFF ; 255 29034: 8a ed ldi r24, 0xDA ; 218 29036: 92 e0 ldi r25, 0x02 ; 2 29038: 0f 94 69 45 call 0x28ad2 ; 0x28ad2 2903c: ce 01 movw r24, r28 2903e: 01 96 adiw r24, 0x01 ; 1 29040: 0e 94 3b 70 call 0xe076 ; 0xe076 } 29044: a3 96 adiw r28, 0x23 ; 35 29046: 0f b6 in r0, 0x3f ; 63 29048: f8 94 cli 2904a: de bf out 0x3e, r29 ; 62 2904c: 0f be out 0x3f, r0 ; 63 2904e: cd bf out 0x3d, r28 ; 61 29050: df 91 pop r29 29052: cf 91 pop r28 29054: 0f 91 pop r16 29056: ff 90 pop r15 29058: ef 90 pop r14 2905a: 08 95 ret 0002905c : nrFiles = 1; curDir->seekSet(position); lsDive("", *curDir, match, LS_GetFilename); } uint16_t CardReader::getnrfilenames() 2905c: cf 92 push r12 2905e: df 92 push r13 29060: ef 92 push r14 29062: ff 92 push r15 29064: 0f 93 push r16 29066: cf 93 push r28 29068: df 93 push r29 2906a: cd b7 in r28, 0x3d ; 61 2906c: de b7 in r29, 0x3e ; 62 2906e: a3 97 sbiw r28, 0x23 ; 35 29070: 0f b6 in r0, 0x3f ; 63 29072: f8 94 cli 29074: de bf out 0x3e, r29 ; 62 29076: 0f be out 0x3f, r0 ; 63 29078: cd bf out 0x3d, r28 ; 61 { curDir=&workDir; 2907a: 83 e1 ldi r24, 0x13 ; 19 2907c: c8 2e mov r12, r24 2907e: 84 e1 ldi r24, 0x14 ; 20 29080: d8 2e mov r13, r24 29082: 85 e1 ldi r24, 0x15 ; 21 29084: 94 e1 ldi r25, 0x14 ; 20 29086: d6 01 movw r26, r12 29088: 8d 93 st X+, r24 2908a: 9c 93 st X, r25 nrFiles=0; 2908c: 22 e8 ldi r18, 0x82 ; 130 2908e: e2 2e mov r14, r18 29090: 26 e1 ldi r18, 0x16 ; 22 29092: f2 2e mov r15, r18 29094: f7 01 movw r30, r14 29096: 11 82 std Z+1, r1 ; 0x01 29098: 10 82 st Z, r1 curDir->rewind(); 2909a: 0e 94 36 70 call 0xe06c ; 0xe06c 2909e: 00 e0 ldi r16, 0x00 ; 0 290a0: 0e 7f andi r16, 0xFE ; 254 290a2: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir, NULL, LS_Count); 290a4: d6 01 movw r26, r12 290a6: ed 91 ld r30, X+ 290a8: fc 91 ld r31, X 290aa: 83 e2 ldi r24, 0x23 ; 35 290ac: de 01 movw r26, r28 290ae: 11 96 adiw r26, 0x01 ; 1 290b0: 01 90 ld r0, Z+ 290b2: 0d 92 st X+, r0 290b4: 8a 95 dec r24 290b6: e1 f7 brne .-8 ; 0x290b0 290b8: 21 e0 ldi r18, 0x01 ; 1 290ba: 50 e0 ldi r21, 0x00 ; 0 290bc: 40 e0 ldi r20, 0x00 ; 0 290be: be 01 movw r22, r28 290c0: 6f 5f subi r22, 0xFF ; 255 290c2: 7f 4f sbci r23, 0xFF ; 255 290c4: 8a ed ldi r24, 0xDA ; 218 290c6: 92 e0 ldi r25, 0x02 ; 2 290c8: 0f 94 69 45 call 0x28ad2 ; 0x28ad2 290cc: ce 01 movw r24, r28 290ce: 01 96 adiw r24, 0x01 ; 1 290d0: 0e 94 3b 70 call 0xe076 ; 0xe076 //SERIAL_ECHOLN(nrFiles); return nrFiles; } 290d4: f7 01 movw r30, r14 290d6: 80 81 ld r24, Z 290d8: 91 81 ldd r25, Z+1 ; 0x01 290da: a3 96 adiw r28, 0x23 ; 35 290dc: 0f b6 in r0, 0x3f ; 63 290de: f8 94 cli 290e0: de bf out 0x3e, r29 ; 62 290e2: 0f be out 0x3f, r0 ; 63 290e4: cd bf out 0x3d, r28 ; 61 290e6: df 91 pop r29 290e8: cf 91 pop r28 290ea: 0f 91 pop r16 290ec: ff 90 pop r15 290ee: ef 90 pop r14 290f0: df 90 pop r13 290f2: cf 90 pop r12 290f4: 08 95 ret 000290f6 : file.getFilename(t); else t[0]=0; } void CardReader::printAbsFilenameFast() 290f6: cf 93 push r28 290f8: df 93 push r29 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 290fa: 8f e2 ldi r24, 0x2F ; 47 290fc: 0e 94 41 70 call 0xe082 ; 0xe082 { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 29100: c0 e0 ldi r28, 0x00 ; 0 { SERIAL_PROTOCOL(dir_names[i]); 29102: d9 e0 ldi r29, 0x09 ; 9 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 29104: 80 91 0a 15 lds r24, 0x150A ; 0x80150a 29108: c8 17 cp r28, r24 2910a: 60 f4 brcc .+24 ; 0x29124 { SERIAL_PROTOCOL(dir_names[i]); 2910c: cd 9f mul r28, r29 2910e: c0 01 movw r24, r0 29110: 11 24 eor r1, r1 29112: 86 54 subi r24, 0x46 ; 70 29114: 9c 4e sbci r25, 0xEC ; 236 29116: 0e 94 a3 7c call 0xf946 ; 0xf946 2911a: 8f e2 ldi r24, 0x2F ; 47 2911c: 0e 94 41 70 call 0xe082 ; 0xe082 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 29120: cf 5f subi r28, 0xFF ; 255 29122: f0 cf rjmp .-32 ; 0x29104 { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 29124: 80 91 81 13 lds r24, 0x1381 ; 0x801381 29128: 81 11 cpse r24, r1 2912a: 06 c0 rjmp .+12 ; 0x29138 2912c: 8c e6 ldi r24, 0x6C ; 108 2912e: 93 e1 ldi r25, 0x13 ; 19 } 29130: df 91 pop r29 29132: cf 91 pop r28 29134: 0c 94 a3 7c jmp 0xf946 ; 0xf946 for (uint8_t i = 0; i < getWorkDirDepth(); i++) { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 29138: 81 e8 ldi r24, 0x81 ; 129 2913a: 93 e1 ldi r25, 0x13 ; 19 2913c: f9 cf rjmp .-14 ; 0x29130 0002913e : void __attribute__((noinline)) eeprom_add_word(uint16_t *__p, uint16_t add) { eeprom_write_word_notify(__p, eeprom_read_word(__p) + add); } void __attribute__((noinline)) eeprom_add_dword(uint32_t *__p, uint32_t add) { 2913e: cf 92 push r12 29140: df 92 push r13 29142: ef 92 push r14 29144: ff 92 push r15 29146: 6b 01 movw r12, r22 29148: 7c 01 movw r14, r24 eeprom_write_dword_notify(__p, eeprom_read_dword(__p) + add); 2914a: 88 ea ldi r24, 0xA8 ; 168 2914c: 9c e0 ldi r25, 0x0C ; 12 2914e: 0f 94 e4 9f call 0x33fc8 ; 0x33fc8 29152: ab 01 movw r20, r22 29154: bc 01 movw r22, r24 29156: 4c 0d add r20, r12 29158: 5d 1d adc r21, r13 2915a: 6e 1d adc r22, r14 2915c: 7f 1d adc r23, r15 if (active) { uint32_t previous_value = eeprom_read_dword(dst); eeprom_dword_notify(dst, previous_value, value, true); } #endif //DEBUG_EEPROM_CHANGES eeprom_write_dword(dst, value); 2915e: 88 ea ldi r24, 0xA8 ; 168 29160: 9c e0 ldi r25, 0x0C ; 12 eeprom_write_word_notify(__p, eeprom_read_word(__p) + add); } void __attribute__((noinline)) eeprom_add_dword(uint32_t *__p, uint32_t add) { eeprom_write_dword_notify(__p, eeprom_read_dword(__p) + add); } 29162: ff 90 pop r15 29164: ef 90 pop r14 29166: df 90 pop r13 29168: cf 90 pop r12 if (active) { uint32_t previous_value = eeprom_read_dword(dst); eeprom_dword_notify(dst, previous_value, value, true); } #endif //DEBUG_EEPROM_CHANGES eeprom_write_dword(dst, value); 2916a: 0d 94 32 a0 jmp 0x34064 ; 0x34064 0002916e : return def; } return val; } uint32_t __attribute__((noinline)) eeprom_init_default_dword(uint32_t *__p, uint32_t def) { 2916e: cf 93 push r28 29170: df 93 push r29 29172: ec 01 movw r28, r24 uint32_t val = eeprom_read_dword(__p); 29174: 0f 94 e4 9f call 0x33fc8 ; 0x33fc8 if (val == EEPROM_EMPTY_VALUE32) { 29178: 6f 3f cpi r22, 0xFF ; 255 2917a: 2f ef ldi r18, 0xFF ; 255 2917c: 72 07 cpc r23, r18 2917e: 82 07 cpc r24, r18 29180: 92 07 cpc r25, r18 29182: 49 f4 brne .+18 ; 0x29196 if (active) { uint32_t previous_value = eeprom_read_dword(dst); eeprom_dword_notify(dst, previous_value, value, true); } #endif //DEBUG_EEPROM_CHANGES eeprom_write_dword(dst, value); 29184: 40 e0 ldi r20, 0x00 ; 0 29186: 50 e0 ldi r21, 0x00 ; 0 29188: ba 01 movw r22, r20 2918a: ce 01 movw r24, r28 2918c: 0f 94 32 a0 call 0x34064 ; 0x34064 uint32_t __attribute__((noinline)) eeprom_init_default_dword(uint32_t *__p, uint32_t def) { uint32_t val = eeprom_read_dword(__p); if (val == EEPROM_EMPTY_VALUE32) { eeprom_write_dword_notify(__p, def); return def; 29190: 60 e0 ldi r22, 0x00 ; 0 29192: 70 e0 ldi r23, 0x00 ; 0 29194: cb 01 movw r24, r22 } return val; } 29196: df 91 pop r29 29198: cf 91 pop r28 2919a: 08 95 ret 0002919c : : "z" (startP) /* input of the ASM code - in our case the Z register as well (R30:R31) */ \ : "r22" /* modifying register R22 - so that the compiler knows */ \ ) // avoid calling the default heavy-weight read() for just one byte int16_t SdFile::readFilteredGcode(){ 2919c: 0f 93 push r16 2919e: 1f 93 push r17 291a0: cf 93 push r28 291a2: df 93 push r29 if( ! gfEnsureBlock() ){ 291a4: 0f 94 b5 3e call 0x27d6a ; 0x27d6a 291a8: 88 23 and r24, r24 291aa: 39 f1 breq .+78 ; 0x291fa goto eof_or_fail; // this is unfortunate :( ... other calls are using the cache and we can loose the data block of our gcode file } // assume, we have the 512B block cache filled and terminated with a '\n' { const uint8_t *start = gfReadPtr; 291ac: 20 91 15 16 lds r18, 0x1615 ; 0x801615 291b0: 30 91 16 16 lds r19, 0x1616 ; 0x801616 // to gfReadPtr within this method, because it is a class member variable. // The compiler cannot see, if omitting read/write won't have any incorrect side-effects to the rest of the whole FW. // So this trick explicitly states, that rdPtr is a local variable limited to the scope of this method, // therefore the compiler can omit read/write to it (keep it in registers!) as it sees fit. // And it does! Codesize dropped by 68B! const uint8_t *rdPtr = gfReadPtr; 291b4: e9 01 movw r28, r18 if( ! gfEnsureBlock() ){ goto eof_or_fail; // this is unfortunate :( ... other calls are using the cache and we can loose the data block of our gcode file } // assume, we have the 512B block cache filled and terminated with a '\n' { const uint8_t *start = gfReadPtr; 291b6: 1b ef ldi r17, 0xFB ; 251 // the same applies to gfXBegin, codesize dropped another 100B! const uint8_t *blockBuffBegin = gfBlockBuffBegin(); uint8_t consecutiveCommentLines = 0; while( *rdPtr == ';' ){ 291b8: 88 81 ld r24, Y 291ba: 8b 33 cpi r24, 0x3B ; 59 291bc: 51 f5 brne .+84 ; 0x29212 // 11c68: brne .-12 ; 0x11c5e // Still, even that was suboptimal as the compiler seems not to understand the usage of ld r22, Z+ (the plus is important) // aka automatic increment of the Z register (R30:R31 pair) // There is no other way than pure ASM! find_endl(rdPtr, rdPtr); 291be: fe 01 movw r30, r28 000291c0 : 291c0: 61 91 ld r22, Z+ 291c2: 6a 30 cpi r22, 0x0A ; 10 291c4: e9 f7 brne .-6 ; 0x291c0 291c6: ef 01 movw r28, r30 // found a newline, prepare the next block if block cache end reached if( rdPtr - blockBuffBegin > 512 ){ 291c8: cf 01 movw r24, r30 291ca: 89 5d subi r24, 0xD9 ; 217 291cc: 9d 40 sbci r25, 0x0D ; 13 291ce: 81 30 cpi r24, 0x01 ; 1 291d0: 92 40 sbci r25, 0x02 ; 2 291d2: e4 f0 brlt .+56 ; 0x2920c // at the end of block cache, fill new data in gfUpdateCurrentPosition( rdPtr - start - 1 ); 291d4: ce 01 movw r24, r28 291d6: 82 1b sub r24, r18 291d8: 93 0b sbc r25, r19 291da: 01 97 sbiw r24, 0x01 ; 1 291dc: 0f 94 6e 3a call 0x274dc ; 0x274dc if( ! gfComputeNextFileBlock() )goto eof_or_fail; 291e0: 8a ef ldi r24, 0xFA ; 250 291e2: 95 e1 ldi r25, 0x15 ; 21 291e4: 0f 94 29 38 call 0x27052 ; 0x27052 291e8: 88 23 and r24, r24 291ea: 39 f0 breq .+14 ; 0x291fa if( ! gfEnsureBlock() )goto eof_or_fail; // fetch it into RAM 291ec: 0f 94 b5 3e call 0x27d6a ; 0x27d6a rdPtr = start = blockBuffBegin; 291f0: 29 ed ldi r18, 0xD9 ; 217 291f2: 3d e0 ldi r19, 0x0D ; 13 291f4: e9 01 movw r28, r18 // found a newline, prepare the next block if block cache end reached if( rdPtr - blockBuffBegin > 512 ){ // at the end of block cache, fill new data in gfUpdateCurrentPosition( rdPtr - start - 1 ); if( ! gfComputeNextFileBlock() )goto eof_or_fail; if( ! gfEnsureBlock() )goto eof_or_fail; // fetch it into RAM 291f6: 81 11 cpse r24, r1 291f8: e2 cf rjmp .-60 ; 0x291be } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 291fa: 89 ed ldi r24, 0xD9 ; 217 291fc: 9f e0 ldi r25, 0x0F ; 15 291fe: 90 93 16 16 sts 0x1616, r25 ; 0x801616 29202: 80 93 15 16 sts 0x1615, r24 ; 0x801615 return -1; 29206: cf ef ldi r28, 0xFF ; 255 29208: df ef ldi r29, 0xFF ; 255 2920a: 34 c0 rjmp .+104 ; 0x29274 2920c: 11 50 subi r17, 0x01 ; 1 gfUpdateCurrentPosition( rdPtr - start - 1 ); if( ! gfComputeNextFileBlock() )goto eof_or_fail; if( ! gfEnsureBlock() )goto eof_or_fail; // fetch it into RAM rdPtr = start = blockBuffBegin; } else { if(consecutiveCommentLines >= 250){ 2920e: c1 f5 brne .+112 ; 0x29280 // peek the next byte - we are inside the block at least at 511th index - still safe if( *rdPtr == ';' ){ // consecutive comment ++consecutiveCommentLines; } else { --rdPtr; // unget the already consumed newline 29210: 21 97 sbiw r28, 0x01 ; 1 } } } emit_char: { gfUpdateCurrentPosition( rdPtr - start + 1 ); 29212: ce 01 movw r24, r28 29214: 82 1b sub r24, r18 29216: 93 0b sbc r25, r19 29218: 01 96 adiw r24, 0x01 ; 1 2921a: 0f 94 6e 3a call 0x274dc ; 0x274dc int16_t rv = *rdPtr++; 2921e: ce 01 movw r24, r28 29220: 01 96 adiw r24, 0x01 ; 1 29222: c8 81 ld r28, Y 29224: d0 e0 ldi r29, 0x00 ; 0 if( curPosition_ >= fileSize_ ){ 29226: 00 91 02 16 lds r16, 0x1602 ; 0x801602 2922a: 10 91 03 16 lds r17, 0x1603 ; 0x801603 2922e: 20 91 04 16 lds r18, 0x1604 ; 0x801604 29232: 30 91 05 16 lds r19, 0x1605 ; 0x801605 29236: 40 91 0b 16 lds r20, 0x160B ; 0x80160b 2923a: 50 91 0c 16 lds r21, 0x160C ; 0x80160c 2923e: 60 91 0d 16 lds r22, 0x160D ; 0x80160d 29242: 70 91 0e 16 lds r23, 0x160E ; 0x80160e 29246: 04 17 cp r16, r20 29248: 15 07 cpc r17, r21 2924a: 26 07 cpc r18, r22 2924c: 37 07 cpc r19, r23 2924e: a8 f6 brcc .-86 ; 0x291fa // past the end of file goto eof_or_fail; } else if( rdPtr - blockBuffBegin >= 512 ){ 29250: 9c 01 movw r18, r24 29252: 29 5d subi r18, 0xD9 ; 217 29254: 3d 40 sbci r19, 0x0D ; 13 29256: 21 15 cp r18, r1 29258: 32 40 sbci r19, 0x02 ; 2 2925a: 44 f0 brlt .+16 ; 0x2926c // past the end of current bufferred block - prepare the next one... if( ! gfComputeNextFileBlock() )goto eof_or_fail; 2925c: 8a ef ldi r24, 0xFA ; 250 2925e: 95 e1 ldi r25, 0x15 ; 21 29260: 0f 94 29 38 call 0x27052 ; 0x27052 29264: 88 23 and r24, r24 29266: 49 f2 breq .-110 ; 0x291fa // don't need to force fetch the block here, it will get loaded on the next call rdPtr = blockBuffBegin; 29268: 89 ed ldi r24, 0xD9 ; 217 2926a: 9d e0 ldi r25, 0x0D ; 13 } // save the current read ptr for the next run gfReadPtr = rdPtr; 2926c: 90 93 16 16 sts 0x1616, r25 ; 0x801616 29270: 80 93 15 16 sts 0x1615, r24 ; 0x801615 eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; return -1; } 29274: ce 01 movw r24, r28 29276: df 91 pop r29 29278: cf 91 pop r28 2927a: 1f 91 pop r17 2927c: 0f 91 pop r16 2927e: 08 95 ret if(consecutiveCommentLines >= 250){ --rdPtr; // unget the already consumed newline goto emit_char; } // peek the next byte - we are inside the block at least at 511th index - still safe if( *rdPtr == ';' ){ 29280: 88 81 ld r24, Y 29282: 8b 33 cpi r24, 0x3B ; 59 29284: 09 f4 brne .+2 ; 0x29288 29286: 98 cf rjmp .-208 ; 0x291b8 29288: c3 cf rjmp .-122 ; 0x29210 0002928a : * We can do this in 3 ways... * - Minimal RAM: Read two filenames at a time sorting along... * - Some RAM: Buffer the directory just for this sort * - Most RAM: Buffer the directory and return filenames from RAM */ void CardReader::presort() { 2928a: 2f 92 push r2 2928c: 3f 92 push r3 2928e: 4f 92 push r4 29290: 5f 92 push r5 29292: 6f 92 push r6 29294: 7f 92 push r7 29296: 8f 92 push r8 29298: 9f 92 push r9 2929a: af 92 push r10 2929c: bf 92 push r11 2929e: cf 92 push r12 292a0: df 92 push r13 292a2: ef 92 push r14 292a4: ff 92 push r15 292a6: 0f 93 push r16 292a8: 1f 93 push r17 292aa: cf 93 push r28 292ac: df 93 push r29 292ae: cd b7 in r28, 0x3d ; 61 292b0: de b7 in r29, 0x3e ; 62 292b2: ed 97 sbiw r28, 0x3d ; 61 292b4: 0f b6 in r0, 0x3f ; 63 292b6: f8 94 cli 292b8: de bf out 0x3e, r29 ; 62 292ba: 0f be out 0x3f, r0 ; 63 292bc: cd bf out 0x3d, r28 ; 61 KEEPALIVE_STATE(NOT_BUSY); } void CardReader::flush_presort() { sort_count = 0; 292be: 10 92 0c 15 sts 0x150C, r1 ; 0x80150c 292c2: 10 92 0b 15 sts 0x150B, r1 ; 0x80150b lastSortedFilePosition = 0; 292c6: 10 92 d6 15 sts 0x15D6, r1 ; 0x8015d6 292ca: 10 92 d5 15 sts 0x15D5, r1 ; 0x8015d5 */ void CardReader::presort() { // Throw away old sort index flush_presort(); if (IS_SD_INSERTED == false) return; //sorting is not used in farm mode 292ce: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 292d2: 82 fd sbrc r24, 2 292d4: f7 c0 rjmp .+494 ; 0x294c4 uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 292d6: 89 e0 ldi r24, 0x09 ; 9 292d8: 9f e0 ldi r25, 0x0F ; 15 292da: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 292de: 38 2e mov r3, r24 KEEPALIVE_STATE(IN_HANDLER); 292e0: 82 e0 ldi r24, 0x02 ; 2 292e2: 80 93 78 02 sts 0x0278, r24 ; 0x800278 // If there are files, sort up to the limit uint16_t fileCnt = getnrfilenames(); 292e6: 0f 94 2e 48 call 0x2905c ; 0x2905c 292ea: 6c 01 movw r12, r24 if (fileCnt > 0) { 292ec: 00 97 sbiw r24, 0x00 ; 0 292ee: 09 f4 brne .+2 ; 0x292f2 292f0: e6 c0 rjmp .+460 ; 0x294be // Never sort more than the max allowed // If you use folders to organize, 20 may be enough if (fileCnt > SDSORT_LIMIT) { 292f2: 85 36 cpi r24, 0x65 ; 101 292f4: 91 05 cpc r25, r1 292f6: 80 f0 brcs .+32 ; 0x29318 if ((sdSort != SD_SORT_NONE) && !farm_mode) { 292f8: 32 e0 ldi r19, 0x02 ; 2 292fa: 33 16 cp r3, r19 292fc: 51 f0 breq .+20 ; 0x29312 292fe: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 29302: 81 11 cpse r24, r1 29304: 06 c0 rjmp .+12 ; 0x29312 lcd_show_fullscreen_message_and_wait_P(_T(MSG_FILE_CNT)); 29306: 8b e4 ldi r24, 0x4B ; 75 29308: 9a e5 ldi r25, 0x5A ; 90 2930a: 0e 94 b1 6c call 0xd962 ; 0xd962 2930e: 0f 94 47 0b call 0x2168e ; 0x2168e } fileCnt = SDSORT_LIMIT; 29312: f4 e6 ldi r31, 0x64 ; 100 29314: cf 2e mov r12, r31 29316: d1 2c mov r13, r1 } sort_count = fileCnt; 29318: d0 92 0c 15 sts 0x150C, r13 ; 0x80150c 2931c: c0 92 0b 15 sts 0x150B, r12 ; 0x80150b 29320: 6d e0 ldi r22, 0x0D ; 13 29322: 66 2e mov r6, r22 29324: 65 e1 ldi r22, 0x15 ; 21 29326: 76 2e mov r7, r22 // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 29328: f1 2c mov r15, r1 2932a: e1 2c mov r14, r1 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2932c: 75 e1 ldi r23, 0x15 ; 21 2932e: a7 2e mov r10, r23 29330: 74 e1 ldi r23, 0x14 ; 20 29332: b7 2e mov r11, r23 nrFiles = 1; 29334: 88 24 eor r8, r8 29336: 83 94 inc r8 29338: 91 2c mov r9, r1 sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { if (!IS_SD_INSERTED) return; 2933a: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2933e: 82 fd sbrc r24, 2 29340: c1 c0 rjmp .+386 ; 0x294c4 manage_heater(); 29342: 0f 94 5b 32 call 0x264b6 ; 0x264b6 if (i == 0) 29346: e1 14 cp r14, r1 29348: f1 04 cpc r15, r1 2934a: 09 f0 breq .+2 ; 0x2934e 2934c: d4 c0 rjmp .+424 ; 0x294f6 getfilename(0); 2934e: 90 e0 ldi r25, 0x00 ; 0 29350: 80 e0 ldi r24, 0x00 ; 0 29352: 0f 94 98 47 call 0x28f30 ; 0x28f30 else getfilename_next(position); sort_entries[i] = position >> 5; 29356: 80 91 7d 13 lds r24, 0x137D ; 0x80137d 2935a: 90 91 7e 13 lds r25, 0x137E ; 0x80137e 2935e: a0 91 7f 13 lds r26, 0x137F ; 0x80137f 29362: b0 91 80 13 lds r27, 0x1380 ; 0x801380 29366: 55 e0 ldi r21, 0x05 ; 5 29368: b6 95 lsr r27 2936a: a7 95 ror r26 2936c: 97 95 ror r25 2936e: 87 95 ror r24 29370: 5a 95 dec r21 29372: d1 f7 brne .-12 ; 0x29368 29374: f3 01 movw r30, r6 29376: 81 93 st Z+, r24 29378: 91 93 st Z+, r25 2937a: 3f 01 movw r6, r30 } sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2937c: ff ef ldi r31, 0xFF ; 255 2937e: ef 1a sub r14, r31 29380: ff 0a sbc r15, r31 29382: ce 14 cp r12, r14 29384: df 04 cpc r13, r15 29386: c9 f6 brne .-78 ; 0x2933a else getfilename_next(position); sort_entries[i] = position >> 5; } if ((fileCnt > 1) && (sdSort != SD_SORT_NONE) && !farm_mode) { 29388: 21 e0 ldi r18, 0x01 ; 1 2938a: e2 16 cp r14, r18 2938c: f1 04 cpc r15, r1 2938e: 09 f4 brne .+2 ; 0x29392 29390: 96 c0 rjmp .+300 ; 0x294be 29392: 32 e0 ldi r19, 0x02 ; 2 29394: 33 16 cp r3, r19 29396: 09 f4 brne .+2 ; 0x2939a 29398: 92 c0 rjmp .+292 ; 0x294be 2939a: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 2939e: 21 11 cpse r18, r1 293a0: 8e c0 rjmp .+284 ; 0x294be #ifdef SORTING_SPEEDTEST LongTimer sortingSpeedtestTimer; sortingSpeedtestTimer.start(); #endif //SORTING_SPEEDTEST lastSortedFilePosition = position >> 5; 293a2: 90 93 d6 15 sts 0x15D6, r25 ; 0x8015d6 293a6: 80 93 d5 15 sts 0x15D5, r24 ; 0x8015d5 #define _SORT_CMP_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_NODIR() : (fs < 0 ? dir1 : !dir1)) #define _SORT_CMP_TIME_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_TIME_NODIR() : (fs < 0 ? dir1 : !dir1)) #endif uint16_t counter = 0; menu_progressbar_init(fileCnt * fileCnt / 2, _T(MSG_SORTING_FILES)); 293aa: 8b e3 ldi r24, 0x3B ; 59 293ac: 9a e5 ldi r25, 0x5A ; 90 293ae: 0e 94 b1 6c call 0xd962 ; 0xd962 293b2: ee 9c mul r14, r14 293b4: 90 01 movw r18, r0 293b6: ef 9c mul r14, r15 293b8: 30 0d add r19, r0 293ba: 30 0d add r19, r0 293bc: 11 24 eor r1, r1 293be: bc 01 movw r22, r24 293c0: c9 01 movw r24, r18 293c2: 96 95 lsr r25 293c4: 87 95 ror r24 293c6: 0f 94 1e 91 call 0x3223c ; 0x3223c 293ca: 3f e0 ldi r19, 0x0F ; 15 293cc: a3 2e mov r10, r19 293ce: 35 e1 ldi r19, 0x15 ; 21 293d0: b3 2e mov r11, r19 #if HAS_FOLDER_SORTING #define _SORT_CMP_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_NODIR() : (fs < 0 ? dir1 : !dir1)) #define _SORT_CMP_TIME_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_TIME_NODIR() : (fs < 0 ? dir1 : !dir1)) #endif uint16_t counter = 0; 293d2: 91 2c mov r9, r1 293d4: 81 2c mov r8, r1 menu_progressbar_init(fileCnt * fileCnt / 2, _T(MSG_SORTING_FILES)); for (uint16_t i = 1; i < fileCnt; ++i){ 293d6: cc 24 eor r12, r12 293d8: c3 94 inc r12 293da: d1 2c mov r13, r1 // if (!IS_SD_INSERTED) return; menu_progressbar_update(counter); 293dc: c4 01 movw r24, r8 293de: 0f 94 ef 90 call 0x321de ; 0x321de counter += i; 293e2: 8c 0c add r8, r12 293e4: 9d 1c adc r9, r13 /// pop the position const uint16_t o1 = sort_entries[i]; 293e6: f5 01 movw r30, r10 293e8: 01 90 ld r0, Z+ 293ea: f0 81 ld r31, Z 293ec: e0 2d mov r30, r0 293ee: f9 af std Y+57, r31 ; 0x39 293f0: e8 af std Y+56, r30 ; 0x38 getfilename_simple(o1); 293f2: cf 01 movw r24, r30 293f4: 0f 94 df 47 call 0x28fbe ; 0x28fbe strcpy(name1, LONGEST_FILENAME); // save (or getfilename below will trounce it) 293f8: 80 91 81 13 lds r24, 0x1381 ; 0x801381 293fc: 6c e6 ldi r22, 0x6C ; 108 293fe: 73 e1 ldi r23, 0x13 ; 19 29400: 88 23 and r24, r24 29402: 11 f0 breq .+4 ; 0x29408 29404: 61 e8 ldi r22, 0x81 ; 129 29406: 73 e1 ldi r23, 0x13 ; 19 29408: ce 01 movw r24, r28 2940a: 01 96 adiw r24, 0x01 ; 1 2940c: 0f 94 47 a6 call 0x34c8e ; 0x34c8e crmod_date_bckp = crmodDate; 29410: 60 90 7b 13 lds r6, 0x137B ; 0x80137b 29414: 70 90 7c 13 lds r7, 0x137C ; 0x80137c crmod_time_bckp = crmodTime; 29418: 20 91 79 13 lds r18, 0x1379 ; 0x801379 2941c: 30 91 7a 13 lds r19, 0x137A ; 0x80137a 29420: 3b af std Y+59, r19 ; 0x3b 29422: 2a af std Y+58, r18 ; 0x3a #if HAS_FOLDER_SORTING bool dir1 = filenameIsDir; 29424: 20 90 b6 13 lds r2, 0x13B6 ; 0x8013b6 29428: bf aa std Y+55, r11 ; 0x37 2942a: ae aa std Y+54, r10 ; 0x36 2942c: 86 01 movw r16, r12 #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ if (!IS_SD_INSERTED) return; 2942e: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 29432: 82 fd sbrc r24, 2 29434: 47 c0 rjmp .+142 ; 0x294c4 printf_P(PSTR("%2u "), sort_entries[z]); } MYSERIAL.println(); #endif manage_heater(); 29436: 0f 94 5b 32 call 0x264b6 ; 0x264b6 const uint16_t o2 = sort_entries[j - 1]; 2943a: c8 01 movw r24, r16 2943c: 01 97 sbiw r24, 0x01 ; 1 2943e: 9d af std Y+61, r25 ; 0x3d 29440: 8c af std Y+60, r24 ; 0x3c 29442: ee a9 ldd r30, Y+54 ; 0x36 29444: ff a9 ldd r31, Y+55 ; 0x37 29446: 52 90 ld r5, -Z 29448: 42 90 ld r4, -Z 2944a: ff ab std Y+55, r31 ; 0x37 2944c: ee ab std Y+54, r30 ; 0x36 getfilename_simple(o2); 2944e: c2 01 movw r24, r4 29450: 0f 94 df 47 call 0x28fbe ; 0x28fbe char *name2 = LONGEST_FILENAME; // use the string in-place 29454: 80 91 81 13 lds r24, 0x1381 ; 0x801381 29458: 6c e6 ldi r22, 0x6C ; 108 2945a: 73 e1 ldi r23, 0x13 ; 19 2945c: 88 23 and r24, r24 2945e: 11 f0 breq .+4 ; 0x29464 29460: 61 e8 ldi r22, 0x81 ; 129 29462: 73 e1 ldi r23, 0x13 ; 19 // Sort the current pair according to settings. if ( 29464: 31 10 cpse r3, r1 29466: 8a c0 rjmp .+276 ; 0x2957c 29468: 80 91 b6 13 lds r24, 0x13B6 ; 0x8013b6 2946c: 28 12 cpse r2, r24 2946e: 83 c0 rjmp .+262 ; 0x29576 #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 29470: 80 91 7b 13 lds r24, 0x137B ; 0x80137b 29474: 90 91 7c 13 lds r25, 0x137C ; 0x80137c 29478: 68 16 cp r6, r24 2947a: 79 06 cpc r7, r25 2947c: 09 f0 breq .+2 ; 0x29480 2947e: 6c c0 rjmp .+216 ; 0x29558 29480: 80 91 79 13 lds r24, 0x1379 ; 0x801379 29484: 90 91 7a 13 lds r25, 0x137A ; 0x80137a 29488: 2a ad ldd r18, Y+58 ; 0x3a 2948a: 3b ad ldd r19, Y+59 ; 0x3b 2948c: 82 17 cp r24, r18 2948e: 93 07 cpc r25, r19 29490: 08 f0 brcs .+2 ; 0x29494 29492: 66 c0 rjmp .+204 ; 0x29560 #endif sort_entries[j] = o2; } } /// place the position sort_entries[j] = o1; 29494: 00 0f add r16, r16 29496: 11 1f adc r17, r17 29498: f8 01 movw r30, r16 2949a: e3 5f subi r30, 0xF3 ; 243 2949c: fa 4e sbci r31, 0xEA ; 234 2949e: 28 ad ldd r18, Y+56 ; 0x38 294a0: 39 ad ldd r19, Y+57 ; 0x39 294a2: 31 83 std Z+1, r19 ; 0x01 294a4: 20 83 st Z, r18 #endif uint16_t counter = 0; menu_progressbar_init(fileCnt * fileCnt / 2, _T(MSG_SORTING_FILES)); for (uint16_t i = 1; i < fileCnt; ++i){ 294a6: 3f ef ldi r19, 0xFF ; 255 294a8: c3 1a sub r12, r19 294aa: d3 0a sbc r13, r19 294ac: 82 e0 ldi r24, 0x02 ; 2 294ae: a8 0e add r10, r24 294b0: b1 1c adc r11, r1 294b2: ec 14 cp r14, r12 294b4: fd 04 cpc r15, r13 294b6: 09 f0 breq .+2 ; 0x294ba 294b8: 91 cf rjmp .-222 ; 0x293dc for (uint16_t z = 0; z < fileCnt; z++) printf_P(PSTR("%2u "), sort_entries[z]); SERIAL_PROTOCOLLN(); #endif menu_progressbar_finish(); 294ba: 0f 94 10 91 call 0x32220 ; 0x32220 } } KEEPALIVE_STATE(NOT_BUSY); 294be: 81 e0 ldi r24, 0x01 ; 1 294c0: 80 93 78 02 sts 0x0278, r24 ; 0x800278 } 294c4: ed 96 adiw r28, 0x3d ; 61 294c6: 0f b6 in r0, 0x3f ; 63 294c8: f8 94 cli 294ca: de bf out 0x3e, r29 ; 62 294cc: 0f be out 0x3f, r0 ; 63 294ce: cd bf out 0x3d, r28 ; 61 294d0: df 91 pop r29 294d2: cf 91 pop r28 294d4: 1f 91 pop r17 294d6: 0f 91 pop r16 294d8: ff 90 pop r15 294da: ef 90 pop r14 294dc: df 90 pop r13 294de: cf 90 pop r12 294e0: bf 90 pop r11 294e2: af 90 pop r10 294e4: 9f 90 pop r9 294e6: 8f 90 pop r8 294e8: 7f 90 pop r7 294ea: 6f 90 pop r6 294ec: 5f 90 pop r5 294ee: 4f 90 pop r4 294f0: 3f 90 pop r3 294f2: 2f 90 pop r2 294f4: 08 95 ret if (!IS_SD_INSERTED) return; manage_heater(); if (i == 0) getfilename(0); else getfilename_next(position); 294f6: 40 91 7d 13 lds r20, 0x137D ; 0x80137d 294fa: 50 91 7e 13 lds r21, 0x137E ; 0x80137e 294fe: 60 91 7f 13 lds r22, 0x137F ; 0x80137f 29502: 70 91 80 13 lds r23, 0x1380 ; 0x801380 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 29506: b0 92 14 14 sts 0x1414, r11 ; 0x801414 2950a: a0 92 13 14 sts 0x1413, r10 ; 0x801413 nrFiles = 1; 2950e: 90 92 83 16 sts 0x1683, r9 ; 0x801683 29512: 80 92 82 16 sts 0x1682, r8 ; 0x801682 curDir->seekSet(position); 29516: 85 e1 ldi r24, 0x15 ; 21 29518: 94 e1 ldi r25, 0x14 ; 20 2951a: 0f 94 3f 39 call 0x2727e ; 0x2727e 2951e: 1e 7f andi r17, 0xFE ; 254 29520: 1d 7f andi r17, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 29522: e0 91 13 14 lds r30, 0x1413 ; 0x801413 29526: f0 91 14 14 lds r31, 0x1414 ; 0x801414 2952a: 83 e2 ldi r24, 0x23 ; 35 2952c: de 01 movw r26, r28 2952e: 11 96 adiw r26, 0x01 ; 1 29530: 01 90 ld r0, Z+ 29532: 0d 92 st X+, r0 29534: 8a 95 dec r24 29536: e1 f7 brne .-8 ; 0x29530 29538: 01 2f mov r16, r17 2953a: 22 e0 ldi r18, 0x02 ; 2 2953c: 50 e0 ldi r21, 0x00 ; 0 2953e: 40 e0 ldi r20, 0x00 ; 0 29540: be 01 movw r22, r28 29542: 6f 5f subi r22, 0xFF ; 255 29544: 7f 4f sbci r23, 0xFF ; 255 29546: 8a ed ldi r24, 0xDA ; 218 29548: 92 e0 ldi r25, 0x02 ; 2 2954a: 0f 94 69 45 call 0x28ad2 ; 0x28ad2 2954e: ce 01 movw r24, r28 29550: 01 96 adiw r24, 0x01 ; 1 29552: 0e 94 3b 70 call 0xe076 ; 0xe076 29556: ff ce rjmp .-514 ; 0x29356 char *name2 = LONGEST_FILENAME; // use the string in-place // Sort the current pair according to settings. if ( #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 29558: 86 15 cp r24, r6 2955a: 97 05 cpc r25, r7 2955c: 08 f4 brcc .+2 ; 0x29560 2955e: 9a cf rjmp .-204 ; 0x29494 break; } else { #ifdef SORTING_DUMP puts_P(PSTR("shift")); #endif sort_entries[j] = o2; 29560: ee a9 ldd r30, Y+54 ; 0x36 29562: ff a9 ldd r31, Y+55 ; 0x37 29564: 53 82 std Z+3, r5 ; 0x03 29566: 42 82 std Z+2, r4 ; 0x02 29568: 0c ad ldd r16, Y+60 ; 0x3c 2956a: 1d ad ldd r17, Y+61 ; 0x3d bool dir1 = filenameIsDir; #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ 2956c: 01 15 cp r16, r1 2956e: 11 05 cpc r17, r1 29570: 09 f0 breq .+2 ; 0x29574 29572: 5d cf rjmp .-326 ; 0x2942e 29574: 8f cf rjmp .-226 ; 0x29494 char *name2 = LONGEST_FILENAME; // use the string in-place // Sort the current pair according to settings. if ( #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 29576: 22 20 and r2, r2 29578: 99 f3 breq .-26 ; 0x29560 2957a: 8c cf rjmp .-232 ; 0x29494 2957c: 31 e0 ldi r19, 0x01 ; 1 2957e: 33 12 cpse r3, r19 29580: ef cf rjmp .-34 ; 0x29560 getfilename_simple(o2); char *name2 = LONGEST_FILENAME; // use the string in-place // Sort the current pair according to settings. if ( 29582: 80 91 b6 13 lds r24, 0x13B6 ; 0x8013b6 29586: 28 12 cpse r2, r24 29588: 07 c0 rjmp .+14 ; 0x29598 #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2958a: ce 01 movw r24, r28 2958c: 01 96 adiw r24, 0x01 ; 1 2958e: 0f 94 15 a6 call 0x34c2a ; 0x34c2a 29592: 97 fd sbrc r25, 7 29594: e5 cf rjmp .-54 ; 0x29560 29596: 7e cf rjmp .-260 ; 0x29494 29598: 21 10 cpse r2, r1 2959a: e2 cf rjmp .-60 ; 0x29560 2959c: 7b cf rjmp .-266 ; 0x29494 0002959e : lsDive("",*curDir, NULL, LS_Count); //SERIAL_ECHOLN(nrFiles); return nrFiles; } bool CardReader::chdir(const char * relpath, bool doPresort) 2959e: cf 92 push r12 295a0: df 92 push r13 295a2: ef 92 push r14 295a4: ff 92 push r15 295a6: 0f 93 push r16 295a8: 1f 93 push r17 295aa: cf 93 push r28 295ac: df 93 push r29 295ae: cd b7 in r28, 0x3d ; 61 295b0: de b7 in r29, 0x3e ; 62 295b2: a3 97 sbiw r28, 0x23 ; 35 295b4: 0f b6 in r0, 0x3f ; 63 295b6: f8 94 cli 295b8: de bf out 0x3e, r29 ; 62 295ba: 0f be out 0x3f, r0 ; 63 295bc: cd bf out 0x3d, r28 ; 61 295be: 7c 01 movw r14, r24 295c0: 06 2f mov r16, r22 * \brief Base class for SdFile with Print and C++ streams. */ class SdBaseFile { public: /** Create an instance. */ SdBaseFile() : writeError(false), type_(FAT_FILE_TYPE_CLOSED) {} 295c2: 19 82 std Y+1, r1 ; 0x01 295c4: 1c 82 std Y+4, r1 ; 0x04 { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 295c6: 80 91 18 14 lds r24, 0x1418 ; 0x801418 parent=&workDir; 295ca: 95 e1 ldi r25, 0x15 ; 21 295cc: c9 2e mov r12, r25 295ce: 94 e1 ldi r25, 0x14 ; 20 295d0: d9 2e mov r13, r25 bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 295d2: 81 11 cpse r24, r1 295d4: 04 c0 rjmp .+8 ; 0x295de } bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; 295d6: 80 ef ldi r24, 0xF0 ; 240 295d8: c8 2e mov r12, r24 295da: 83 e1 ldi r24, 0x13 ; 19 295dc: d8 2e mov r13, r24 * OR of flags O_READ, O_WRITE, O_TRUNC, and O_SYNC. * \return true for success or false for failure. */ bool open(SdBaseFile& dirFile, // NOLINT const char* path, uint8_t oflag) { return open(&dirFile, path, oflag); 295de: 21 e0 ldi r18, 0x01 ; 1 295e0: a7 01 movw r20, r14 295e2: b6 01 movw r22, r12 295e4: ce 01 movw r24, r28 295e6: 01 96 adiw r24, 0x01 ; 1 295e8: 0f 94 89 99 call 0x33312 ; 0x33312 295ec: 18 2f mov r17, r24 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) 295ee: 88 23 and r24, r24 295f0: 21 f1 breq .+72 ; 0x2963a 295f2: 80 91 0a 15 lds r24, 0x150A ; 0x80150a 295f6: 85 30 cpi r24, 0x05 ; 5 295f8: 00 f5 brcc .+64 ; 0x2963a SERIAL_ECHOLN(relpath); return 0; } else { strcpy(dir_names[workDirDepth], relpath); 295fa: 29 e0 ldi r18, 0x09 ; 9 295fc: 82 9f mul r24, r18 295fe: c0 01 movw r24, r0 29600: 11 24 eor r1, r1 29602: b7 01 movw r22, r14 29604: 86 54 subi r24, 0x46 ; 70 29606: 9c 4e sbci r25, 0xEC ; 236 29608: 0f 94 47 a6 call 0x34c8e ; 0x34c8e puts(relpath); 2960c: c7 01 movw r24, r14 2960e: 0f 94 6b a6 call 0x34cd6 ; 0x34cd6 if (workDirDepth < MAX_DIR_DEPTH) { 29612: 80 91 0a 15 lds r24, 0x150A ; 0x80150a 29616: 86 30 cpi r24, 0x06 ; 6 29618: 80 f1 brcs .+96 ; 0x2967a for (uint8_t d = ++workDirDepth; d--;) workDirParents[d+1] = workDirParents[d]; workDirParents[0]=*parent; } workDir=newfile; 2961a: 83 e2 ldi r24, 0x23 ; 35 2961c: fe 01 movw r30, r28 2961e: 31 96 adiw r30, 0x01 ; 1 29620: a5 e1 ldi r26, 0x15 ; 21 29622: b4 e1 ldi r27, 0x14 ; 20 29624: 01 90 ld r0, Z+ 29626: 0d 92 st X+, r0 29628: 8a 95 dec r24 2962a: e1 f7 brne .-8 ; 0x29624 #ifdef SDCARD_SORT_ALPHA if (doPresort) 2962c: 00 23 and r16, r16 2962e: 09 f4 brne .+2 ; 0x29632 29630: 4c c0 rjmp .+152 ; 0x296ca presort(); 29632: 0f 94 45 49 call 0x2928a ; 0x2928a else presort_flag = true; #endif return 1; 29636: 10 2f mov r17, r16 29638: 0c c0 rjmp .+24 ; 0x29652 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) { SERIAL_ECHO_START; 2963a: 81 e6 ldi r24, 0x61 ; 97 2963c: 9d e9 ldi r25, 0x9D ; 157 2963e: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHORPGM(_n("Cannot enter subdir: "));////MSG_SD_CANT_ENTER_SUBDIR 29642: 8f ec ldi r24, 0xCF ; 207 29644: 9b e6 ldi r25, 0x6B ; 107 29646: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLN(relpath); 2964a: c7 01 movw r24, r14 2964c: 0f 94 fd 98 call 0x331fa ; 0x331fa return 0; 29650: 10 e0 ldi r17, 0x00 ; 0 29652: ce 01 movw r24, r28 29654: 01 96 adiw r24, 0x01 ; 1 29656: 0e 94 3b 70 call 0xe076 ; 0xe076 else presort_flag = true; #endif return 1; } } 2965a: 81 2f mov r24, r17 2965c: a3 96 adiw r28, 0x23 ; 35 2965e: 0f b6 in r0, 0x3f ; 63 29660: f8 94 cli 29662: de bf out 0x3e, r29 ; 62 29664: 0f be out 0x3f, r0 ; 63 29666: cd bf out 0x3d, r28 ; 61 29668: df 91 pop r29 2966a: cf 91 pop r28 2966c: 1f 91 pop r17 2966e: 0f 91 pop r16 29670: ff 90 pop r15 29672: ef 90 pop r14 29674: df 90 pop r13 29676: cf 90 pop r12 29678: 08 95 ret { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2967a: 8f 5f subi r24, 0xFF ; 255 2967c: 80 93 0a 15 sts 0x150A, r24 ; 0x80150a workDirParents[d+1] = workDirParents[d]; 29680: 93 e2 ldi r25, 0x23 ; 35 { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 29682: 81 50 subi r24, 0x01 ; 1 29684: c8 f0 brcs .+50 ; 0x296b8 workDirParents[d+1] = workDirParents[d]; 29686: 28 2f mov r18, r24 29688: 30 e0 ldi r19, 0x00 ; 0 2968a: a9 01 movw r20, r18 2968c: 4f 5f subi r20, 0xFF ; 255 2968e: 5f 4f sbci r21, 0xFF ; 255 29690: 94 9f mul r25, r20 29692: d0 01 movw r26, r0 29694: 95 9f mul r25, r21 29696: b0 0d add r27, r0 29698: 11 24 eor r1, r1 2969a: a8 5c subi r26, 0xC8 ; 200 2969c: bb 4e sbci r27, 0xEB ; 235 2969e: 92 9f mul r25, r18 296a0: f0 01 movw r30, r0 296a2: 93 9f mul r25, r19 296a4: f0 0d add r31, r0 296a6: 11 24 eor r1, r1 296a8: e8 5c subi r30, 0xC8 ; 200 296aa: fb 4e sbci r31, 0xEB ; 235 296ac: 29 2f mov r18, r25 296ae: 01 90 ld r0, Z+ 296b0: 0d 92 st X+, r0 296b2: 2a 95 dec r18 296b4: e1 f7 brne .-8 ; 0x296ae 296b6: e5 cf rjmp .-54 ; 0x29682 workDirParents[0]=*parent; 296b8: 83 e2 ldi r24, 0x23 ; 35 296ba: f6 01 movw r30, r12 296bc: a8 e3 ldi r26, 0x38 ; 56 296be: b4 e1 ldi r27, 0x14 ; 20 296c0: 01 90 ld r0, Z+ 296c2: 0d 92 st X+, r0 296c4: 8a 95 dec r24 296c6: e1 f7 brne .-8 ; 0x296c0 296c8: a8 cf rjmp .-176 ; 0x2961a #ifdef SDCARD_SORT_ALPHA if (doPresort) presort(); else presort_flag = true; 296ca: 81 e0 ldi r24, 0x01 ; 1 296cc: 80 93 b9 13 sts 0x13B9, r24 ; 0x8013b9 296d0: c0 cf rjmp .-128 ; 0x29652 000296d2 : } } void __attribute__((noinline)) CardReader::cdroot(bool doPresort) { workDir=root; 296d2: 93 e2 ldi r25, 0x23 ; 35 296d4: e0 ef ldi r30, 0xF0 ; 240 296d6: f3 e1 ldi r31, 0x13 ; 19 296d8: a5 e1 ldi r26, 0x15 ; 21 296da: b4 e1 ldi r27, 0x14 ; 20 296dc: 01 90 ld r0, Z+ 296de: 0d 92 st X+, r0 296e0: 9a 95 dec r25 296e2: e1 f7 brne .-8 ; 0x296dc workDirDepth = 0; 296e4: 10 92 0a 15 sts 0x150A, r1 ; 0x80150a curDir=&workDir; 296e8: 25 e1 ldi r18, 0x15 ; 21 296ea: 34 e1 ldi r19, 0x14 ; 20 296ec: 30 93 14 14 sts 0x1414, r19 ; 0x801414 296f0: 20 93 13 14 sts 0x1413, r18 ; 0x801413 #ifdef SDCARD_SORT_ALPHA if (doPresort) 296f4: 81 11 cpse r24, r1 presort(); 296f6: 0d 94 45 49 jmp 0x2928a ; 0x2928a else presort_flag = true; 296fa: 81 e0 ldi r24, 0x01 ; 1 296fc: 80 93 b9 13 sts 0x13B9, r24 ; 0x8013b9 #endif } 29700: 08 95 ret 00029702 : * * @param[in,out] fileName * expects file name including path * in case of absolute path, file name without path is returned */ bool CardReader::diveSubfolder (const char *&fileName) 29702: 8f 92 push r8 29704: 9f 92 push r9 29706: af 92 push r10 29708: bf 92 push r11 2970a: cf 92 push r12 2970c: df 92 push r13 2970e: ef 92 push r14 29710: ff 92 push r15 29712: 0f 93 push r16 29714: 1f 93 push r17 29716: cf 93 push r28 29718: df 93 push r29 2971a: cd b7 in r28, 0x3d ; 61 2971c: de b7 in r29, 0x3e ; 62 2971e: 2d 97 sbiw r28, 0x0d ; 13 29720: 0f b6 in r0, 0x3f ; 63 29722: f8 94 cli 29724: de bf out 0x3e, r29 ; 62 29726: 0f be out 0x3f, r0 ; 63 29728: cd bf out 0x3d, r28 ; 61 { curDir=&root; 2972a: 20 ef ldi r18, 0xF0 ; 240 2972c: 33 e1 ldi r19, 0x13 ; 19 2972e: 30 93 14 14 sts 0x1414, r19 ; 0x801414 29732: 20 93 13 14 sts 0x1413, r18 ; 0x801413 if (!fileName) 29736: dc 01 movw r26, r24 29738: ed 91 ld r30, X+ 2973a: fc 91 ld r31, X 2973c: 30 97 sbiw r30, 0x00 ; 0 2973e: a1 f4 brne .+40 ; 0x29768 } else //relative path { curDir = &workDir; } return 1; 29740: 81 e0 ldi r24, 0x01 ; 1 } 29742: 2d 96 adiw r28, 0x0d ; 13 29744: 0f b6 in r0, 0x3f ; 63 29746: f8 94 cli 29748: de bf out 0x3e, r29 ; 62 2974a: 0f be out 0x3f, r0 ; 63 2974c: cd bf out 0x3d, r28 ; 61 2974e: df 91 pop r29 29750: cf 91 pop r28 29752: 1f 91 pop r17 29754: 0f 91 pop r16 29756: ff 90 pop r15 29758: ef 90 pop r14 2975a: df 90 pop r13 2975c: cf 90 pop r12 2975e: bf 90 pop r11 29760: af 90 pop r10 29762: 9f 90 pop r9 29764: 8f 90 pop r8 29766: 08 95 ret curDir=&root; if (!fileName) return 1; const char *dirname_start, *dirname_end; if (fileName[0] == '/') // absolute path 29768: 20 81 ld r18, Z 2976a: 2f 32 cpi r18, 0x2F ; 47 2976c: 09 f0 breq .+2 ; 0x29770 2976e: 47 c0 rjmp .+142 ; 0x297fe 29770: 6c 01 movw r12, r24 { cdroot(false); 29772: 80 e0 ldi r24, 0x00 ; 0 29774: 0f 94 69 4b call 0x296d2 ; 0x296d2 dirname_start = fileName + 1; 29778: f6 01 movw r30, r12 2977a: 00 81 ld r16, Z 2977c: 11 81 ldd r17, Z+1 ; 0x01 2977e: 0f 5f subi r16, 0xFF ; 255 29780: 1f 4f sbci r17, 0xFF ; 255 strncpy(subdirname, dirname_start, len); subdirname[len] = 0; if (!chdir(subdirname, false)) return 0; curDir = &workDir; 29782: 95 e1 ldi r25, 0x15 ; 21 29784: 89 2e mov r8, r25 29786: 94 e1 ldi r25, 0x14 ; 20 29788: 99 2e mov r9, r25 const char *dirname_start, *dirname_end; if (fileName[0] == '/') // absolute path { cdroot(false); dirname_start = fileName + 1; while (*dirname_start) 2978a: d8 01 movw r26, r16 2978c: 8c 91 ld r24, X 2978e: 88 23 and r24, r24 29790: b9 f2 breq .-82 ; 0x29740 { dirname_end = strchr(dirname_start, '/'); 29792: 6f e2 ldi r22, 0x2F ; 47 29794: 70 e0 ldi r23, 0x00 ; 0 29796: c8 01 movw r24, r16 29798: 0f 94 33 a6 call 0x34c66 ; 0x34c66 2979c: 5c 01 movw r10, r24 //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start-name)); //SERIAL_ECHO("end :");SERIAL_ECHOLN((int)(dirname_end-name)); if (dirname_end && dirname_end > dirname_start) 2979e: 00 97 sbiw r24, 0x00 ; 0 297a0: 51 f1 breq .+84 ; 0x297f6 297a2: 08 17 cp r16, r24 297a4: 19 07 cpc r17, r25 297a6: 38 f5 brcc .+78 ; 0x297f6 { const size_t maxLen = 12; char subdirname[maxLen+1]; const size_t len = ((static_cast(dirname_end-dirname_start))>maxLen) ? maxLen : (dirname_end-dirname_start); 297a8: 7c 01 movw r14, r24 297aa: e0 1a sub r14, r16 297ac: f1 0a sbc r15, r17 297ae: bd e0 ldi r27, 0x0D ; 13 297b0: eb 16 cp r14, r27 297b2: f1 04 cpc r15, r1 297b4: 18 f0 brcs .+6 ; 0x297bc 297b6: 8c e0 ldi r24, 0x0C ; 12 297b8: e8 2e mov r14, r24 297ba: f1 2c mov r15, r1 strncpy(subdirname, dirname_start, len); 297bc: a7 01 movw r20, r14 297be: b8 01 movw r22, r16 297c0: ce 01 movw r24, r28 297c2: 01 96 adiw r24, 0x01 ; 1 297c4: 0f 94 5c a6 call 0x34cb8 ; 0x34cb8 subdirname[len] = 0; 297c8: e1 e0 ldi r30, 0x01 ; 1 297ca: f0 e0 ldi r31, 0x00 ; 0 297cc: ec 0f add r30, r28 297ce: fd 1f adc r31, r29 297d0: ee 0d add r30, r14 297d2: ff 1d adc r31, r15 297d4: 10 82 st Z, r1 if (!chdir(subdirname, false)) 297d6: 60 e0 ldi r22, 0x00 ; 0 297d8: ce 01 movw r24, r28 297da: 01 96 adiw r24, 0x01 ; 1 297dc: 0f 94 cf 4a call 0x2959e ; 0x2959e 297e0: 88 23 and r24, r24 297e2: 09 f4 brne .+2 ; 0x297e6 297e4: ae cf rjmp .-164 ; 0x29742 return 0; curDir = &workDir; 297e6: 90 92 14 14 sts 0x1414, r9 ; 0x801414 297ea: 80 92 13 14 sts 0x1413, r8 ; 0x801413 dirname_start = dirname_end + 1; 297ee: 85 01 movw r16, r10 297f0: 0f 5f subi r16, 0xFF ; 255 297f2: 1f 4f sbci r17, 0xFF ; 255 297f4: ca cf rjmp .-108 ; 0x2978a } else // the reminder after all /fsa/fdsa/ is the filename { fileName = dirname_start; 297f6: f6 01 movw r30, r12 297f8: 11 83 std Z+1, r17 ; 0x01 297fa: 00 83 st Z, r16 297fc: a1 cf rjmp .-190 ; 0x29740 } } else //relative path { curDir = &workDir; 297fe: 85 e1 ldi r24, 0x15 ; 21 29800: 94 e1 ldi r25, 0x14 ; 20 29802: 90 93 14 14 sts 0x1414, r25 ; 0x801414 29806: 80 93 13 14 sts 0x1413, r24 ; 0x801413 2980a: 9a cf rjmp .-204 ; 0x29740 0002980c : static const char ofSize[] PROGMEM = " Size: "; static const char ofFileSelected[] PROGMEM = "File selected"; static const char ofSDPrinting[] PROGMEM = "SD-PRINTING"; static const char ofWritingToFile[] PROGMEM = "Writing to file: "; void CardReader::openFileReadFilteredGcode(const char* name, bool replace_current/* = false*/){ 2980c: bf 92 push r11 2980e: cf 92 push r12 29810: df 92 push r13 29812: ef 92 push r14 29814: ff 92 push r15 29816: 0f 93 push r16 29818: 1f 93 push r17 2981a: cf 93 push r28 2981c: df 93 push r29 2981e: 1f 92 push r1 29820: 1f 92 push r1 29822: cd b7 in r28, 0x3d ; 61 29824: de b7 in r29, 0x3e ; 62 if(!mounted) 29826: 20 91 6b 13 lds r18, 0x136B ; 0x80136b 2982a: 22 23 and r18, r18 2982c: 09 f4 brne .+2 ; 0x29830 2982e: ef c0 rjmp .+478 ; 0x29a0e 29830: 7c 01 movw r14, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 29832: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 29836: 88 23 and r24, r24 29838: 09 f4 brne .+2 ; 0x2983c 2983a: 04 c1 rjmp .+520 ; 0x29a44 if(!replace_current){ 2983c: 61 11 cpse r22, r1 2983e: f6 c0 rjmp .+492 ; 0x29a2c if((int)file_subcall_ctr>(int)SD_PROCEDURE_DEPTH-1){ 29840: d0 90 1d 16 lds r13, 0x161D ; 0x80161d 29844: dd 20 and r13, r13 29846: 21 f0 breq .+8 ; 0x29850 // SERIAL_ERROR_START; // SERIAL_ERRORPGM("trying to call sub-gcode files with too many levels. MAX level is:"); // SERIAL_ERRORLN(SD_PROCEDURE_DEPTH); kill(ofKill); 29848: 8f e6 ldi r24, 0x6F ; 111 2984a: 9c e9 ldi r25, 0x9C ; 156 2984c: 0e 94 df 72 call 0xe5be ; 0xe5be return; } SERIAL_ECHO_START; 29850: 81 e6 ldi r24, 0x61 ; 97 29852: 9d e9 ldi r25, 0x9D ; 157 29854: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHORPGM(ofSubroutineCallTgt); 29858: 86 e5 ldi r24, 0x56 ; 86 2985a: 9c e9 ldi r25, 0x9C ; 156 2985c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 29860: c7 01 movw r24, r14 29862: 0e 94 a3 7c call 0xf946 ; 0xf946 SERIAL_ECHO(name); SERIAL_ECHORPGM(ofParent); 29866: 8b e4 ldi r24, 0x4B ; 75 29868: 9c e9 ldi r25, 0x9C ; 156 2986a: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); 2986e: 00 91 1d 16 lds r16, 0x161D ; 0x80161d 29872: 25 e5 ldi r18, 0x55 ; 85 29874: 02 9f mul r16, r18 29876: 80 01 movw r16, r0 29878: 11 24 eor r1, r1 } void CardReader::getAbsFilename(char *t) { uint8_t cnt=0; *t='/';t++;cnt++; 2987a: 0e 5d subi r16, 0xDE ; 222 2987c: 19 4e sbci r17, 0xE9 ; 233 2987e: 8f e2 ldi r24, 0x2F ; 47 29880: f8 01 movw r30, r16 29882: 81 93 st Z+, r24 29884: 8f 01 movw r16, r30 29886: cc 24 eor r12, r12 29888: c3 94 inc r12 for(uint8_t i=0;i 29892: d8 16 cp r13, r24 29894: b0 f4 brcc .+44 ; 0x298c2 { workDirParents[i].getFilename(t); //SDBaseFile.getfilename! 29896: db 9c mul r13, r11 29898: c0 01 movw r24, r0 2989a: 11 24 eor r1, r1 2989c: b8 01 movw r22, r16 2989e: 88 5c subi r24, 0xC8 ; 200 298a0: 9b 4e sbci r25, 0xEB ; 235 298a2: 0f 94 b5 6e call 0x2dd6a ; 0x2dd6a 298a6: c8 01 movw r24, r16 298a8: 8c 01 movw r16, r24 298aa: 01 96 adiw r24, 0x01 ; 1 while(*t!=0 && cnt< MAXPATHNAMELENGTH) 298ac: f8 01 movw r30, r16 298ae: 20 81 ld r18, Z 298b0: 22 23 and r18, r18 298b2: 29 f0 breq .+10 ; 0x298be 298b4: f4 e5 ldi r31, 0x54 ; 84 298b6: fc 15 cp r31, r12 298b8: 10 f0 brcs .+4 ; 0x298be {t++;cnt++;} //crawl counter forward. 298ba: c3 94 inc r12 298bc: f5 cf rjmp .-22 ; 0x298a8 void CardReader::getAbsFilename(char *t) { uint8_t cnt=0; *t='/';t++;cnt++; for(uint8_t i=0;i { workDirParents[i].getFilename(t); //SDBaseFile.getfilename! while(*t!=0 && cnt< MAXPATHNAMELENGTH) {t++;cnt++;} //crawl counter forward. } if(cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH) 298c2: 27 e4 ldi r18, 0x47 ; 71 298c4: 2c 15 cp r18, r12 298c6: 08 f4 brcc .+2 ; 0x298ca 298c8: ae c0 rjmp .+348 ; 0x29a26 file.getFilename(t); 298ca: b8 01 movw r22, r16 298cc: 8a ef ldi r24, 0xFA ; 250 298ce: 95 e1 ldi r25, 0x15 ; 21 298d0: 0f 94 b5 6e call 0x2dd6a ; 0x2dd6a SERIAL_ECHORPGM(ofParent); //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); SERIAL_ECHO(filenames[file_subcall_ctr]); 298d4: 80 91 1d 16 lds r24, 0x161D ; 0x80161d 298d8: f5 e5 ldi r31, 0x55 ; 85 298da: 8f 9f mul r24, r31 298dc: c0 01 movw r24, r0 298de: 11 24 eor r1, r1 298e0: 8e 5d subi r24, 0xDE ; 222 298e2: 99 4e sbci r25, 0xE9 ; 233 298e4: 0e 94 a3 7c call 0xf946 ; 0xf946 SERIAL_ECHORPGM(ofPos); 298e8: 85 e4 ldi r24, 0x45 ; 69 298ea: 9c e9 ldi r25, 0x9C ; 156 298ec: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 298f0: 60 91 7e 16 lds r22, 0x167E ; 0x80167e 298f4: 70 91 7f 16 lds r23, 0x167F ; 0x80167f 298f8: 80 91 80 16 lds r24, 0x1680 ; 0x801680 298fc: 90 91 81 16 lds r25, 0x1681 ; 0x801681 29900: 4a e0 ldi r20, 0x0A ; 10 29902: 0f 94 2c 96 call 0x32c58 ; 0x32c58 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 29906: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; 2990a: 80 91 1d 16 lds r24, 0x161D ; 0x80161d 2990e: 24 e0 ldi r18, 0x04 ; 4 29910: 82 9f mul r24, r18 29912: f0 01 movw r30, r0 29914: 11 24 eor r1, r1 29916: e2 5e subi r30, 0xE2 ; 226 29918: f9 4e sbci r31, 0xE9 ; 233 2991a: 40 91 7e 16 lds r20, 0x167E ; 0x80167e 2991e: 50 91 7f 16 lds r21, 0x167F ; 0x80167f 29922: 60 91 80 16 lds r22, 0x1680 ; 0x801680 29926: 70 91 81 16 lds r23, 0x1681 ; 0x801681 2992a: 40 83 st Z, r20 2992c: 51 83 std Z+1, r21 ; 0x01 2992e: 62 83 std Z+2, r22 ; 0x02 29930: 73 83 std Z+3, r23 ; 0x03 file_subcall_ctr++; 29932: 8f 5f subi r24, 0xFF ; 255 29934: 80 93 1d 16 sts 0x161D, r24 ; 0x80161d } else { SERIAL_ECHO_START; SERIAL_ECHORPGM(ofNowDoingFile); SERIAL_ECHOLN(name); } file.close(); 29938: 8a ef ldi r24, 0xFA ; 250 2993a: 95 e1 ldi r25, 0x15 ; 21 2993c: 0f 94 92 6e call 0x2dd24 ; 0x2dd24 file_subcall_ctr=0; //resetting procedure depth in case user cancels print while in procedure SERIAL_ECHO_START; SERIAL_ECHORPGM(ofNowFreshFile); SERIAL_ECHOLN(name); } sdprinting = false; 29940: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a const char *fname=name; 29944: fa 82 std Y+2, r15 ; 0x02 29946: e9 82 std Y+1, r14 ; 0x01 if (!diveSubfolder(fname)) 29948: ce 01 movw r24, r28 2994a: 01 96 adiw r24, 0x01 ; 1 2994c: 0f 94 81 4b call 0x29702 ; 0x29702 29950: 88 23 and r24, r24 29952: 09 f4 brne .+2 ; 0x29956 29954: 5c c0 rjmp .+184 ; 0x29a0e */ SdFile::SdFile(const char* path, uint8_t oflag) : SdBaseFile(path, oflag) { } bool SdFile::openFilteredGcode(SdBaseFile* dirFile, const char* path){ if( open(dirFile, path, O_READ) ){ 29956: 49 81 ldd r20, Y+1 ; 0x01 29958: 5a 81 ldd r21, Y+2 ; 0x02 2995a: 60 91 13 14 lds r22, 0x1413 ; 0x801413 2995e: 70 91 14 14 lds r23, 0x1414 ; 0x801414 29962: 21 e0 ldi r18, 0x01 ; 1 29964: 8a ef ldi r24, 0xFA ; 250 29966: 95 e1 ldi r25, 0x15 ; 21 29968: 0f 94 89 99 call 0x33312 ; 0x33312 2996c: 88 23 and r24, r24 2996e: 09 f4 brne .+2 ; 0x29972 29970: 77 c0 rjmp .+238 ; 0x29a60 // compute the block to start with if( ! gfComputeNextFileBlock() ) 29972: 8a ef ldi r24, 0xFA ; 250 29974: 95 e1 ldi r25, 0x15 ; 21 29976: 0f 94 29 38 call 0x27052 ; 0x27052 2997a: 88 23 and r24, r24 2997c: 09 f4 brne .+2 ; 0x29980 2997e: 70 c0 rjmp .+224 ; 0x29a60 return vol_->cache()->data; // this is constant for the whole time, so it should be fast and sleek } void SdFile::gfReset(){ // reset cache read ptr to its begin gfReadPtr = gfBlockBuffBegin() + gfOffset; 29980: 80 91 1b 16 lds r24, 0x161B ; 0x80161b 29984: 90 91 1c 16 lds r25, 0x161C ; 0x80161c 29988: 87 52 subi r24, 0x27 ; 39 2998a: 92 4f sbci r25, 0xF2 ; 242 2998c: 90 93 16 16 sts 0x1616, r25 ; 0x801616 29990: 80 93 15 16 sts 0x1615, r24 ; 0x801615 return; if (file.openFilteredGcode(curDir, fname)) { getfilename(0, fname); 29994: 89 81 ldd r24, Y+1 ; 0x01 29996: 9a 81 ldd r25, Y+2 ; 0x02 29998: 0f 94 98 47 call 0x28f30 ; 0x28f30 filesize = file.fileSize(); 2999c: 80 91 0b 16 lds r24, 0x160B ; 0x80160b 299a0: 90 91 0c 16 lds r25, 0x160C ; 0x80160c 299a4: a0 91 0d 16 lds r26, 0x160D ; 0x80160d 299a8: b0 91 0e 16 lds r27, 0x160E ; 0x80160e 299ac: 80 93 77 16 sts 0x1677, r24 ; 0x801677 299b0: 90 93 78 16 sts 0x1678, r25 ; 0x801678 299b4: a0 93 79 16 sts 0x1679, r26 ; 0x801679 299b8: b0 93 7a 16 sts 0x167A, r27 ; 0x80167a SERIAL_PROTOCOLRPGM(ofFileOpened);////MSG_SD_FILE_OPENED 299bc: 85 e1 ldi r24, 0x15 ; 21 299be: 9c e9 ldi r25, 0x9C ; 156 299c0: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 printAbsFilenameFast(); 299c4: 0f 94 7b 48 call 0x290f6 ; 0x290f6 SERIAL_PROTOCOLRPGM(ofSize);////MSG_SD_SIZE 299c8: 8d e0 ldi r24, 0x0D ; 13 299ca: 9c e9 ldi r25, 0x9C ; 156 299cc: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 299d0: 60 91 77 16 lds r22, 0x1677 ; 0x801677 299d4: 70 91 78 16 lds r23, 0x1678 ; 0x801678 299d8: 80 91 79 16 lds r24, 0x1679 ; 0x801679 299dc: 90 91 7a 16 lds r25, 0x167A ; 0x80167a 299e0: 4a e0 ldi r20, 0x0A ; 10 299e2: 0f 94 2c 96 call 0x32c58 ; 0x32c58 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 299e6: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 SERIAL_PROTOCOLLN(filesize); sdpos = 0; 299ea: 10 92 7e 16 sts 0x167E, r1 ; 0x80167e 299ee: 10 92 7f 16 sts 0x167F, r1 ; 0x80167f 299f2: 10 92 80 16 sts 0x1680, r1 ; 0x801680 299f6: 10 92 81 16 sts 0x1681, r1 ; 0x801681 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 299fa: 8f ef ldi r24, 0xFF ; 255 299fc: 9b e9 ldi r25, 0x9B ; 155 299fe: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 lcd_setstatuspgm(ofFileSelected); 29a02: 8f ef ldi r24, 0xFF ; 255 29a04: 9b e9 ldi r25, 0x9B ; 155 29a06: 0e 94 65 e6 call 0x1ccca ; 0x1ccca scrollstuff = 0; 29a0a: 10 92 cc 0d sts 0x0DCC, r1 ; 0x800dcc } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } 29a0e: 0f 90 pop r0 29a10: 0f 90 pop r0 29a12: df 91 pop r29 29a14: cf 91 pop r28 29a16: 1f 91 pop r17 29a18: 0f 91 pop r16 29a1a: ff 90 pop r15 29a1c: ef 90 pop r14 29a1e: df 90 pop r13 29a20: cf 90 pop r12 29a22: bf 90 pop r11 29a24: 08 95 ret {t++;cnt++;} //crawl counter forward. } if(cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH) file.getFilename(t); else t[0]=0; 29a26: f8 01 movw r30, r16 29a28: 10 82 st Z, r1 29a2a: 54 cf rjmp .-344 ; 0x298d4 SERIAL_ECHORPGM(ofPos); SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; } else { SERIAL_ECHO_START; 29a2c: 81 e6 ldi r24, 0x61 ; 97 29a2e: 9d e9 ldi r25, 0x9D ; 157 29a30: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHORPGM(ofNowDoingFile); 29a34: 84 e3 ldi r24, 0x34 ; 52 29a36: 9c e9 ldi r25, 0x9C ; 156 29a38: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLN(name); 29a3c: c7 01 movw r24, r14 29a3e: 0f 94 fd 98 call 0x331fa ; 0x331fa 29a42: 7a cf rjmp .-268 ; 0x29938 } file.close(); } else { //opening fresh file file_subcall_ctr=0; //resetting procedure depth in case user cancels print while in procedure 29a44: 10 92 1d 16 sts 0x161D, r1 ; 0x80161d SERIAL_ECHO_START; 29a48: 81 e6 ldi r24, 0x61 ; 97 29a4a: 9d e9 ldi r25, 0x9D ; 157 29a4c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHORPGM(ofNowFreshFile); 29a50: 83 e2 ldi r24, 0x23 ; 35 29a52: 9c e9 ldi r25, 0x9C ; 156 29a54: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLN(name); 29a58: c7 01 movw r24, r14 29a5a: 0f 94 fd 98 call 0x331fa ; 0x331fa 29a5e: 70 cf rjmp .-288 ; 0x29940 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 29a60: 8b eb ldi r24, 0xBB ; 187 29a62: 9b e6 ldi r25, 0x6B ; 107 29a64: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 29a68: 89 81 ldd r24, Y+1 ; 0x01 29a6a: 9a 81 ldd r25, Y+2 ; 0x02 29a6c: 0e 94 a3 7c call 0xf946 ; 0xf946 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 29a70: 8e e2 ldi r24, 0x2E ; 46 29a72: 0e 94 41 70 call 0xe082 ; 0xe082 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 29a76: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 29a7a: c9 cf rjmp .-110 ; 0x29a0e 00029a7c : void CardReader::printingHasFinished() { st_synchronize(); 29a7c: 0f 94 42 22 call 0x24484 ; 0x24484 file.close(); 29a80: 8a ef ldi r24, 0xFA ; 250 29a82: 95 e1 ldi r25, 0x15 ; 21 29a84: 0f 94 92 6e call 0x2dd24 ; 0x2dd24 if(file_subcall_ctr>0) //heading up to a parent file that called current as a procedure. 29a88: 80 91 1d 16 lds r24, 0x161D ; 0x80161d 29a8c: 88 23 and r24, r24 29a8e: 69 f1 breq .+90 ; 0x29aea { file_subcall_ctr--; 29a90: 81 50 subi r24, 0x01 ; 1 29a92: 80 93 1d 16 sts 0x161D, r24 ; 0x80161d openFileReadFilteredGcode(filenames[file_subcall_ctr],true); 29a96: 25 e5 ldi r18, 0x55 ; 85 29a98: 82 9f mul r24, r18 29a9a: c0 01 movw r24, r0 29a9c: 11 24 eor r1, r1 29a9e: 61 e0 ldi r22, 0x01 ; 1 29aa0: 8e 5d subi r24, 0xDE ; 222 29aa2: 99 4e sbci r25, 0xE9 ; 233 29aa4: 0f 94 06 4c call 0x2980c ; 0x2980c setIndex(filespos[file_subcall_ctr]); 29aa8: e0 91 1d 16 lds r30, 0x161D ; 0x80161d 29aac: 84 e0 ldi r24, 0x04 ; 4 29aae: e8 9f mul r30, r24 29ab0: f0 01 movw r30, r0 29ab2: 11 24 eor r1, r1 29ab4: e2 5e subi r30, 0xE2 ; 226 29ab6: f9 4e sbci r31, 0xE9 ; 233 29ab8: 60 81 ld r22, Z 29aba: 71 81 ldd r23, Z+1 ; 0x01 29abc: 82 81 ldd r24, Z+2 ; 0x02 29abe: 93 81 ldd r25, Z+3 ; 0x03 { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; 29ac0: 60 93 7e 16 sts 0x167E, r22 ; 0x80167e 29ac4: 70 93 7f 16 sts 0x167F, r23 ; 0x80167f 29ac8: 80 93 80 16 sts 0x1680, r24 ; 0x801680 29acc: 90 93 81 16 sts 0x1681, r25 ; 0x801681 29ad0: 0f 94 f6 43 call 0x287ec ; 0x287ec SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 29ad4: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 29ad8: 88 23 and r24, r24 29ada: 71 f0 breq .+28 ; 0x29af8 { sdprinting = true; 29adc: 81 e0 ldi r24, 0x01 ; 1 29ade: 80 93 6a 13 sts 0x136A, r24 ; 0x80136a 29ae2: 85 e0 ldi r24, 0x05 ; 5 29ae4: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.367> 29ae8: 08 95 ret setIndex(filespos[file_subcall_ctr]); startFileprint(); } else { sdprinting = false; 29aea: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a 29aee: 83 e0 ldi r24, 0x03 ; 3 29af0: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.367> SetPrinterState(PrinterState::SDPrintingFinished); //set printer state to show LCD menu after finished SD print if(SD_FINISHED_STEPPERRELEASE) { finishAndDisableSteppers(); 29af4: 0c 94 39 74 jmp 0xe872 ; 0xe872 autotempShutdown(); #ifdef SDCARD_SORT_ALPHA //presort(); #endif } } 29af8: 08 95 ret 00029afa : root.rewind(); lsDive("",root, NULL, LS_SerialPrint, params); } void CardReader::mount(bool doPresort/* = true*/) 29afa: cf 92 push r12 29afc: df 92 push r13 29afe: ef 92 push r14 29b00: ff 92 push r15 29b02: 0f 93 push r16 29b04: 1f 93 push r17 29b06: cf 93 push r28 29b08: df 93 push r29 29b0a: 08 2f mov r16, r24 { mounted = false; 29b0c: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b if(root.isOpen()) 29b10: 80 91 f3 13 lds r24, 0x13F3 ; 0x8013f3 29b14: 88 23 and r24, r24 29b16: 21 f0 breq .+8 ; 0x29b20 root.close(); 29b18: 80 ef ldi r24, 0xF0 ; 240 29b1a: 93 e1 ldi r25, 0x13 ; 19 29b1c: 0f 94 92 6e call 0x2dd24 ; 0x2dd24 * \return The value one, true, is returned for success and * the value zero, false, is returned for failure. The reason for failure * can be determined by calling errorCode() and errorData(). */ bool Sd2Card::init(uint8_t sckRateID) { errorCode_ = type_ = 0; 29b20: 10 92 da 15 sts 0x15DA, r1 ; 0x8015da 29b24: 10 92 d7 15 sts 0x15D7, r1 ; 0x8015d7 // 16-bit init start time allows over a minute uint16_t t0 = (uint16_t)_millis(); 29b28: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 29b2c: eb 01 movw r28, r22 uint32_t arg; // set pin modes chipSelectHigh(); 29b2e: 0f 94 c7 41 call 0x2838e ; 0x2838e SET_OUTPUT(SDSS); 29b32: 20 9a sbi 0x04, 0 ; 4 SET_INPUT(MISO); 29b34: 23 98 cbi 0x04, 3 ; 4 SET_OUTPUT(MOSI); 29b36: 22 9a sbi 0x04, 2 ; 4 SET_OUTPUT(SCK); 29b38: 21 9a sbi 0x04, 1 ; 4 #ifndef SOFTWARE_SPI // SS must be in output mode even it is not chip select SET_OUTPUT(SS); 29b3a: 20 9a sbi 0x04, 0 ; 4 // set SS high - may be chip select for another SPI device #if SET_SPI_SS_HIGH WRITE(SS, 1); 29b3c: 28 9a sbi 0x05, 0 ; 5 #endif // SET_SPI_SS_HIGH // set SCK rate for initialization commands spiRate_ = SPI_SD_INIT_RATE; 29b3e: 85 e0 ldi r24, 0x05 ; 5 29b40: 80 93 d8 15 sts 0x15D8, r24 ; 0x8015d8 * Initialize hardware SPI * Set SCK rate to F_CPU/pow(2, 1 + spiRate) for spiRate [0,6] */ static void spiInit(uint8_t spiRate) { // See avr processor documentation SPCR = (1 << SPE) | (1 << MSTR) | (spiRate >> 1); 29b44: 82 e5 ldi r24, 0x52 ; 82 29b46: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 29b48: 1d bc out 0x2d, r1 ; 45 29b4a: 1a e0 ldi r17, 0x0A ; 10 spiRate_ = SPI_SD_INIT_RATE; spiInit(spiRate_); #endif // SOFTWARE_SPI // must supply min of 74 clock cycles with CS high. for (uint8_t i = 0; i < 10; i++) spiSend(0XFF); 29b4c: 8f ef ldi r24, 0xFF ; 255 29b4e: 0f 94 ea 6f call 0x2dfd4 ; 0x2dfd4 29b52: 11 50 subi r17, 0x01 ; 1 29b54: d9 f7 brne .-10 ; 0x29b4c WRITE(MISO, 1); // temporarily enable the MISO line pullup 29b56: 2b 9a sbi 0x05, 3 ; 5 // command to go idle in SPI mode while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { 29b58: 20 e0 ldi r18, 0x00 ; 0 29b5a: 30 e0 ldi r19, 0x00 ; 0 29b5c: a9 01 movw r20, r18 29b5e: 60 e0 ldi r22, 0x00 ; 0 29b60: 87 ed ldi r24, 0xD7 ; 215 29b62: 95 e1 ldi r25, 0x15 ; 21 29b64: 0f 94 f6 6f call 0x2dfec ; 0x2dfec 29b68: 80 93 d9 15 sts 0x15D9, r24 ; 0x8015d9 29b6c: 81 30 cpi r24, 0x01 ; 1 29b6e: 61 f0 breq .+24 ; 0x29b88 if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 29b70: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 29b74: 6c 1b sub r22, r28 29b76: 7d 0b sbc r23, r29 29b78: 61 3d cpi r22, 0xD1 ; 209 29b7a: 77 40 sbci r23, 0x07 ; 7 29b7c: 68 f3 brcs .-38 ; 0x29b58 WRITE(MISO, 0); // disable the MISO line pullup 29b7e: 2b 98 cbi 0x05, 3 ; 5 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 29b80: 81 e0 ldi r24, 0x01 ; 1 29b82: 80 93 d7 15 sts 0x15D7, r24 ; 0x8015d7 29b86: 22 c0 rjmp .+68 ; 0x29bcc error(SD_CARD_ERROR_CMD0); goto fail; } } WRITE(MISO, 0); // disable the MISO line pullup 29b88: 2b 98 cbi 0x05, 3 ; 5 // send 0xFF until 0xFF received to give card some clock cycles t0 = (uint16_t)_millis(); 29b8a: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 29b8e: eb 01 movw r28, r22 SERIAL_ECHOLNRPGM(PSTR("Sending 0xFF")); 29b90: 82 ef ldi r24, 0xF2 ; 242 29b92: 9b e9 ldi r25, 0x9B ; 155 29b94: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 spiSend(0XFF); 29b98: 8f ef ldi r24, 0xFF ; 255 29b9a: 0f 94 ea 6f call 0x2dfd4 ; 0x2dfd4 while ((status_ = spiRec()) != 0xFF) 29b9e: 0f 94 ef 6f call 0x2dfde ; 0x2dfde 29ba2: 80 93 d9 15 sts 0x15D9, r24 ; 0x8015d9 29ba6: 8f 3f cpi r24, 0xFF ; 255 29ba8: 59 f1 breq .+86 ; 0x29c00 { spiSend(0XFF); 29baa: 8f ef ldi r24, 0xFF ; 255 29bac: 0f 94 ea 6f call 0x2dfd4 ; 0x2dfd4 if (((uint16_t)_millis() - t0) > SD_CARD_ERROR_FF_TIMEOUT) 29bb0: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 29bb4: 6c 1b sub r22, r28 29bb6: 7d 0b sbc r23, r29 29bb8: 62 32 cpi r22, 0x22 ; 34 29bba: 71 05 cpc r23, r1 29bbc: 80 f3 brcs .-32 ; 0x29b9e 29bbe: 82 e0 ldi r24, 0x02 ; 2 29bc0: 80 93 d7 15 sts 0x15D7, r24 ; 0x8015d7 { error(SD_CARD_ERROR_CMD8); SERIAL_ECHOLNRPGM(PSTR("No 0xFF received")); 29bc4: 81 ee ldi r24, 0xE1 ; 225 29bc6: 9b e9 ldi r25, 0x9B ; 155 29bc8: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 #else // SOFTWARE_SPI return true; #endif // SOFTWARE_SPI fail: chipSelectHigh(); 29bcc: 0f 94 c7 41 call 0x2838e ; 0x2838e #else if (!card.init(SPI_FULL_SPEED) ) #endif { SERIAL_ECHO_START; 29bd0: 81 e6 ldi r24, 0x61 ; 97 29bd2: 9d e9 ldi r25, 0x9D ; 157 29bd4: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL 29bd8: 8e ea ldi r24, 0xAE ; 174 29bda: 9b e6 ldi r25, 0x6B ; 107 } else { mounted = true; SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 29bdc: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 } if (mounted) 29be0: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 29be4: 88 23 and r24, r24 29be6: 09 f4 brne .+2 ; 0x29bea 29be8: 9a c0 rjmp .+308 ; 0x29d1e { cdroot(doPresort); 29bea: 80 2f mov r24, r16 } } 29bec: df 91 pop r29 29bee: cf 91 pop r28 29bf0: 1f 91 pop r17 29bf2: 0f 91 pop r16 29bf4: ff 90 pop r15 29bf6: ef 90 pop r14 29bf8: df 90 pop r13 29bfa: cf 90 pop r12 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK } if (mounted) { cdroot(doPresort); 29bfc: 0d 94 69 4b jmp 0x296d2 ; 0x296d2 goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 29c00: 2a ea ldi r18, 0xAA ; 170 29c02: 31 e0 ldi r19, 0x01 ; 1 29c04: 40 e0 ldi r20, 0x00 ; 0 29c06: 50 e0 ldi r21, 0x00 ; 0 29c08: 68 e0 ldi r22, 0x08 ; 8 29c0a: 87 ed ldi r24, 0xD7 ; 215 29c0c: 95 e1 ldi r25, 0x15 ; 21 29c0e: 0f 94 f6 6f call 0x2dfec ; 0x2dfec 29c12: 82 ff sbrs r24, 2 29c14: 2b c0 rjmp .+86 ; 0x29c6c bool readData(uint8_t* dst, uint16_t count); bool readRegister(uint8_t cmd, void* buf); void chipSelectHigh(); void chipSelectLow(); void type(uint8_t value) {type_ = value;} 29c16: 81 e0 ldi r24, 0x01 ; 1 29c18: 80 93 da 15 sts 0x15DA, r24 ; 0x8015da goto fail; } type(SD_CARD_TYPE_SD2); } // initialize card and send host supports SDHC if SD2 arg = type() == SD_CARD_TYPE_SD2 ? 0X40000000 : 0; 29c1c: 80 91 da 15 lds r24, 0x15DA ; 0x8015da 29c20: c1 2c mov r12, r1 29c22: d1 2c mov r13, r1 29c24: 76 01 movw r14, r12 29c26: 82 30 cpi r24, 0x02 ; 2 29c28: 29 f4 brne .+10 ; 0x29c34 29c2a: c1 2c mov r12, r1 29c2c: d1 2c mov r13, r1 29c2e: e1 2c mov r14, r1 29c30: 80 e4 ldi r24, 0x40 ; 64 29c32: f8 2e mov r15, r24 uint8_t status_; uint8_t type_; bool flash_air_compatible_; // private functions uint8_t cardAcmd(uint8_t cmd, uint32_t arg) { cardCommand(CMD55, 0); 29c34: 20 e0 ldi r18, 0x00 ; 0 29c36: 30 e0 ldi r19, 0x00 ; 0 29c38: a9 01 movw r20, r18 29c3a: 67 e3 ldi r22, 0x37 ; 55 29c3c: 87 ed ldi r24, 0xD7 ; 215 29c3e: 95 e1 ldi r25, 0x15 ; 21 29c40: 0f 94 f6 6f call 0x2dfec ; 0x2dfec return cardCommand(cmd, arg); 29c44: a7 01 movw r20, r14 29c46: 96 01 movw r18, r12 29c48: 69 e2 ldi r22, 0x29 ; 41 29c4a: 87 ed ldi r24, 0xD7 ; 215 29c4c: 95 e1 ldi r25, 0x15 ; 21 29c4e: 0f 94 f6 6f call 0x2dfec ; 0x2dfec while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) { 29c52: 80 93 d9 15 sts 0x15D9, r24 ; 0x8015d9 29c56: 88 23 and r24, r24 29c58: b1 f0 breq .+44 ; 0x29c86 // check for timeout if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 29c5a: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 29c5e: 6c 1b sub r22, r28 29c60: 7d 0b sbc r23, r29 29c62: 61 3d cpi r22, 0xD1 ; 209 29c64: 77 40 sbci r23, 0x07 ; 7 29c66: 30 f3 brcs .-52 ; 0x29c34 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 29c68: 8a e0 ldi r24, 0x0A ; 10 29c6a: 8b cf rjmp .-234 ; 0x29b82 goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 29c6c: 14 e0 ldi r17, 0x04 ; 4 type(SD_CARD_TYPE_SD1); } else { // only need last byte of r7 response for (uint8_t i = 0; i < 4; i++) status_ = spiRec(); 29c6e: 0f 94 ef 6f call 0x2dfde ; 0x2dfde 29c72: 80 93 d9 15 sts 0x15D9, r24 ; 0x8015d9 29c76: 11 50 subi r17, 0x01 ; 1 29c78: d1 f7 brne .-12 ; 0x29c6e if (status_ != 0XAA) { 29c7a: 8a 3a cpi r24, 0xAA ; 170 29c7c: 11 f0 breq .+4 ; 0x29c82 29c7e: 82 e0 ldi r24, 0x02 ; 2 29c80: 80 cf rjmp .-256 ; 0x29b82 bool readData(uint8_t* dst, uint16_t count); bool readRegister(uint8_t cmd, void* buf); void chipSelectHigh(); void chipSelectLow(); void type(uint8_t value) {type_ = value;} 29c82: 82 e0 ldi r24, 0x02 ; 2 29c84: c9 cf rjmp .-110 ; 0x29c18 error(SD_CARD_ERROR_ACMD41); goto fail; } } // if SD2 read OCR register to check for SDHC card if (type() == SD_CARD_TYPE_SD2) { 29c86: 80 91 da 15 lds r24, 0x15DA ; 0x8015da 29c8a: 82 30 cpi r24, 0x02 ; 2 29c8c: d1 f4 brne .+52 ; 0x29cc2 if (cardCommand(CMD58, 0)) { 29c8e: 20 e0 ldi r18, 0x00 ; 0 29c90: 30 e0 ldi r19, 0x00 ; 0 29c92: a9 01 movw r20, r18 29c94: 6a e3 ldi r22, 0x3A ; 58 29c96: 87 ed ldi r24, 0xD7 ; 215 29c98: 95 e1 ldi r25, 0x15 ; 21 29c9a: 0f 94 f6 6f call 0x2dfec ; 0x2dfec 29c9e: 88 23 and r24, r24 29ca0: 11 f0 breq .+4 ; 0x29ca6 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 29ca2: 88 e0 ldi r24, 0x08 ; 8 29ca4: 6e cf rjmp .-292 ; 0x29b82 error(SD_CARD_ERROR_CMD58); goto fail; } if ((spiRec() & 0XC0) == 0XC0) type(SD_CARD_TYPE_SDHC); 29ca6: 0f 94 ef 6f call 0x2dfde ; 0x2dfde 29caa: 80 7c andi r24, 0xC0 ; 192 29cac: 80 3c cpi r24, 0xC0 ; 192 29cae: 19 f4 brne .+6 ; 0x29cb6 bool readData(uint8_t* dst, uint16_t count); bool readRegister(uint8_t cmd, void* buf); void chipSelectHigh(); void chipSelectLow(); void type(uint8_t value) {type_ = value;} 29cb0: 83 e0 ldi r24, 0x03 ; 3 29cb2: 80 93 da 15 sts 0x15DA, r24 ; 0x8015da // discard rest of ocr - contains allowed voltage range for (uint8_t i = 0; i < 3; i++) spiRec(); 29cb6: 0f 94 ef 6f call 0x2dfde ; 0x2dfde 29cba: 0f 94 ef 6f call 0x2dfde ; 0x2dfde 29cbe: 0f 94 ef 6f call 0x2dfde ; 0x2dfde } chipSelectHigh(); 29cc2: 0f 94 c7 41 call 0x2838e ; 0x2838e bool Sd2Card::setSckRate(uint8_t sckRateID) { if (sckRateID > 6) { error(SD_CARD_ERROR_SCK_RATE); return false; } spiRate_ = sckRateID; 29cc6: 10 92 d8 15 sts 0x15D8, r1 ; 0x8015d8 * \return The value one, true, is returned for success and * the value zero, false, is returned for failure. Reasons for * failure include not finding a valid partition, not finding a valid * FAT file system or an I/O error. */ bool init(Sd2Card* dev) { return init(dev, 1) ? true : init(dev, 0);} 29cca: 81 e0 ldi r24, 0x01 ; 1 29ccc: 0f 94 64 3d call 0x27ac8 ; 0x27ac8 29cd0: 81 11 cpse r24, r1 29cd2: 0c c0 rjmp .+24 ; 0x29cec 29cd4: 80 e0 ldi r24, 0x00 ; 0 29cd6: 0f 94 64 3d call 0x27ac8 ; 0x27ac8 #endif { SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL } else if (!volume.init(&card)) 29cda: 81 11 cpse r24, r1 29cdc: 07 c0 rjmp .+14 ; 0x29cec { SERIAL_ERROR_START; 29cde: 84 e4 ldi r24, 0x44 ; 68 29ce0: 9d e9 ldi r25, 0x9D ; 157 29ce2: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ERRORLNRPGM(_n("volume.init failed"));////MSG_SD_VOL_INIT_FAIL 29ce6: 8b e9 ldi r24, 0x9B ; 155 29ce8: 9b e6 ldi r25, 0x6B ; 107 29cea: 78 cf rjmp .-272 ; 0x29bdc } else if (!root.openRoot(&volume)) 29cec: 6c ed ldi r22, 0xDC ; 220 29cee: 75 e1 ldi r23, 0x15 ; 21 29cf0: 80 ef ldi r24, 0xF0 ; 240 29cf2: 93 e1 ldi r25, 0x13 ; 19 29cf4: 0f 94 42 6e call 0x2dc84 ; 0x2dc84 29cf8: 81 11 cpse r24, r1 29cfa: 07 c0 rjmp .+14 ; 0x29d0a { SERIAL_ERROR_START; 29cfc: 84 e4 ldi r24, 0x44 ; 68 29cfe: 9d e9 ldi r25, 0x9D ; 157 29d00: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ERRORLNRPGM(_n("openRoot failed"));////MSG_SD_OPENROOT_FAIL 29d04: 8b e8 ldi r24, 0x8B ; 139 29d06: 9b e6 ldi r25, 0x6B ; 107 29d08: 69 cf rjmp .-302 ; 0x29bdc } else { mounted = true; 29d0a: 81 e0 ldi r24, 0x01 ; 1 29d0c: 80 93 6b 13 sts 0x136B, r24 ; 0x80136b SERIAL_ECHO_START; 29d10: 81 e6 ldi r24, 0x61 ; 97 29d12: 9d e9 ldi r25, 0x9D ; 157 29d14: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 29d18: 80 e8 ldi r24, 0x80 ; 128 29d1a: 9b e6 ldi r25, 0x6B ; 107 29d1c: 5f cf rjmp .-322 ; 0x29bdc if (mounted) { cdroot(doPresort); } } 29d1e: df 91 pop r29 29d20: cf 91 pop r28 29d22: 1f 91 pop r17 29d24: 0f 91 pop r16 29d26: ff 90 pop r15 29d28: ef 90 pop r14 29d2a: df 90 pop r13 29d2c: cf 90 pop r12 29d2e: 08 95 ret 00029d30 : ms = 0; } } } static void wait_for_heater(long codenum, uint8_t extruder) { 29d30: 4f 92 push r4 29d32: 5f 92 push r5 29d34: 6f 92 push r6 29d36: 7f 92 push r7 29d38: 8f 92 push r8 29d3a: 9f 92 push r9 29d3c: af 92 push r10 29d3e: bf 92 push r11 29d40: cf 92 push r12 29d42: df 92 push r13 29d44: ef 92 push r14 29d46: ff 92 push r15 29d48: 4b 01 movw r8, r22 29d4a: 5c 01 movw r10, r24 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 29d4c: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 29d50: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 29d54: 07 2e mov r0, r23 29d56: 00 0c add r0, r0 29d58: 88 0b sbc r24, r24 29d5a: 99 0b sbc r25, r25 29d5c: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> if (!degTargetHotend(extruder)) 29d60: 20 e0 ldi r18, 0x00 ; 0 29d62: 30 e0 ldi r19, 0x00 ; 0 29d64: a9 01 movw r20, r18 29d66: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 29d6a: 88 23 and r24, r24 29d6c: d1 f0 breq .+52 ; 0x29da2 #ifdef TEMP_RESIDENCY_TIME long residencyStart; residencyStart = -1; /* continue to loop until we have reached the target temp _and_ until TEMP_RESIDENCY_TIME hasn't passed since we reached it */ cancel_heatup = false; 29d6e: 10 92 c9 0d sts 0x0DC9, r1 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.377> if (!degTargetHotend(extruder)) return; #ifdef TEMP_RESIDENCY_TIME long residencyStart; residencyStart = -1; 29d72: cc 24 eor r12, r12 29d74: ca 94 dec r12 29d76: dc 2c mov r13, r12 29d78: 76 01 movw r14, r12 #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); if (residencyStart > -1) { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 29d7a: 98 ee ldi r25, 0xE8 ; 232 29d7c: 49 2e mov r4, r25 29d7e: 93 e0 ldi r25, 0x03 ; 3 29d80: 59 2e mov r5, r25 29d82: 61 2c mov r6, r1 29d84: 71 2c mov r7, r1 long residencyStart; residencyStart = -1; /* continue to loop until we have reached the target temp _and_ until TEMP_RESIDENCY_TIME hasn't passed since we reached it */ cancel_heatup = false; while ((!cancel_heatup) && ((residencyStart == -1) || 29d86: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.377> 29d8a: 81 11 cpse r24, r1 29d8c: 0a c0 rjmp .+20 ; 0x29da2 29d8e: 2f ef ldi r18, 0xFF ; 255 29d90: c2 16 cp r12, r18 29d92: d2 06 cpc r13, r18 29d94: e2 06 cpc r14, r18 29d96: f2 06 cpc r15, r18 29d98: 89 f4 brne .+34 ; 0x29dbc (residencyStart >= 0 && (((unsigned int)(_millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL))))) { #else while (target_direction ? (isHeatingHotend(tmp_extruder)) : (isCoolingHotend(tmp_extruder) && (CooldownNoWait == false))) { #endif //TEMP_RESIDENCY_TIME if (lcd_commands_type == LcdCommands::LongPause) { 29d9a: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 29d9e: 82 30 cpi r24, 0x02 ; 2 29da0: b9 f4 brne .+46 ; 0x29dd0 { residencyStart = _millis(); } #endif //TEMP_RESIDENCY_TIME } } 29da2: ff 90 pop r15 29da4: ef 90 pop r14 29da6: df 90 pop r13 29da8: cf 90 pop r12 29daa: bf 90 pop r11 29dac: af 90 pop r10 29dae: 9f 90 pop r9 29db0: 8f 90 pop r8 29db2: 7f 90 pop r7 29db4: 6f 90 pop r6 29db6: 5f 90 pop r5 29db8: 4f 90 pop r4 29dba: 08 95 ret long residencyStart; residencyStart = -1; /* continue to loop until we have reached the target temp _and_ until TEMP_RESIDENCY_TIME hasn't passed since we reached it */ cancel_heatup = false; while ((!cancel_heatup) && ((residencyStart == -1) || 29dbc: f7 fc sbrc r15, 7 29dbe: f1 cf rjmp .-30 ; 0x29da2 (residencyStart >= 0 && (((unsigned int)(_millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL))))) { 29dc0: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 29dc4: 6c 19 sub r22, r12 29dc6: 7d 09 sbc r23, r13 29dc8: 68 3b cpi r22, 0xB8 ; 184 29dca: 7b 40 sbci r23, 0x0B ; 11 29dcc: 30 f3 brcs .-52 ; 0x29d9a 29dce: e9 cf rjmp .-46 ; 0x29da2 if (lcd_commands_type == LcdCommands::LongPause) { // Print was suddenly paused, break out of the loop // This can happen when the firmware report a fan error break; } if ((_millis() - codenum) > 1000UL) 29dd0: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 29dd4: 68 19 sub r22, r8 29dd6: 79 09 sbc r23, r9 29dd8: 8a 09 sbc r24, r10 29dda: 9b 09 sbc r25, r11 29ddc: 69 3e cpi r22, 0xE9 ; 233 29dde: 73 40 sbci r23, 0x03 ; 3 29de0: 81 05 cpc r24, r1 29de2: 91 05 cpc r25, r1 29de4: 08 f4 brcc .+2 ; 0x29de8 29de6: 42 c0 rjmp .+132 ; 0x29e6c { //Print Temp Reading and remaining time every 1 second while heating up/cooling down if (!farm_mode) { 29de8: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 29dec: 81 11 cpse r24, r1 29dee: 3a c0 rjmp .+116 ; 0x29e64 SERIAL_PROTOCOLPGM("T:"); 29df0: 8e ed ldi r24, 0xDE ; 222 29df2: 9b e9 ldi r25, 0x9B ; 155 29df4: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 29df8: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 29dfc: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 29e00: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 29e04: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 29e08: 41 e0 ldi r20, 0x01 ; 1 29e0a: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_PROTOCOL_F(degHotend(extruder), 1); SERIAL_PROTOCOLPGM(" E:"); 29e0e: 8a ed ldi r24, 0xDA ; 218 29e10: 9b e9 ldi r25, 0x9B ; 155 29e12: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 29e16: 60 e0 ldi r22, 0x00 ; 0 29e18: 70 e0 ldi r23, 0x00 ; 0 29e1a: cb 01 movw r24, r22 29e1c: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_PROTOCOL((int)extruder); #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); 29e20: 86 ed ldi r24, 0xD6 ; 214 29e22: 9b e9 ldi r25, 0x9B ; 155 29e24: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 if (residencyStart > -1) 29e28: f7 fc sbrc r15, 7 29e2a: 52 c0 rjmp .+164 ; 0x29ed0 { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 29e2c: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 29e30: 46 01 movw r8, r12 29e32: 57 01 movw r10, r14 29e34: 58 eb ldi r21, 0xB8 ; 184 29e36: 85 0e add r8, r21 29e38: 5b e0 ldi r21, 0x0B ; 11 29e3a: 95 1e adc r9, r21 29e3c: a1 1c adc r10, r1 29e3e: b1 1c adc r11, r1 29e40: a5 01 movw r20, r10 29e42: 94 01 movw r18, r8 29e44: 26 1b sub r18, r22 29e46: 37 0b sbc r19, r23 29e48: 48 0b sbc r20, r24 29e4a: 59 0b sbc r21, r25 29e4c: ca 01 movw r24, r20 29e4e: b9 01 movw r22, r18 29e50: a3 01 movw r20, r6 29e52: 92 01 movw r18, r4 29e54: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> 29e58: ca 01 movw r24, r20 29e5a: b9 01 movw r22, r18 29e5c: 0f 94 a2 96 call 0x32d44 ; 0x32d44 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 29e60: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 } } #else SERIAL_PROTOCOLLN(); #endif codenum = _millis(); 29e64: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 29e68: 4b 01 movw r8, r22 29e6a: 5c 01 movw r10, r24 } delay_keep_alive(0); //do not disable steppers 29e6c: 90 e0 ldi r25, 0x00 ; 0 29e6e: 80 e0 ldi r24, 0x00 ; 0 29e70: 0e 94 48 7c call 0xf890 ; 0xf890 #ifdef TEMP_RESIDENCY_TIME /* start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time or when current temp falls outside the hysteresis after target temp was reached */ if ((residencyStart == -1 && target_direction && (degHotend(extruder) >= (degTargetHotend(extruder) - TEMP_WINDOW))) || (residencyStart == -1 && !target_direction && (degHotend(extruder) <= (degTargetHotend(extruder) + TEMP_WINDOW))) || 29e74: 3f ef ldi r19, 0xFF ; 255 29e76: c3 16 cp r12, r19 29e78: d3 06 cpc r13, r19 29e7a: e3 06 cpc r14, r19 29e7c: f3 06 cpc r15, r19 29e7e: 09 f0 breq .+2 ; 0x29e82 29e80: 46 c0 rjmp .+140 ; 0x29f0e } delay_keep_alive(0); //do not disable steppers #ifdef TEMP_RESIDENCY_TIME /* start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time or when current temp falls outside the hysteresis after target temp was reached */ if ((residencyStart == -1 && target_direction && (degHotend(extruder) >= (degTargetHotend(extruder) - TEMP_WINDOW))) || 29e82: 80 91 c3 0d lds r24, 0x0DC3 ; 0x800dc3 <_ZL16target_direction.lto_priv.494> 29e86: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 29e8a: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 29e8e: 88 23 and r24, r24 29e90: 19 f1 breq .+70 ; 0x29ed8 29e92: 07 2e mov r0, r23 29e94: 00 0c add r0, r0 29e96: 88 0b sbc r24, r24 29e98: 99 0b sbc r25, r25 29e9a: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 29e9e: 20 e0 ldi r18, 0x00 ; 0 29ea0: 30 e0 ldi r19, 0x00 ; 0 29ea2: 40 e8 ldi r20, 0x80 ; 128 29ea4: 5f e3 ldi r21, 0x3F ; 63 29ea6: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 29eaa: 9b 01 movw r18, r22 29eac: ac 01 movw r20, r24 29eae: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 29eb2: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 29eb6: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 29eba: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 29ebe: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 29ec2: 87 fd sbrc r24, 7 29ec4: 60 cf rjmp .-320 ; 0x29d86 (residencyStart == -1 && !target_direction && (degHotend(extruder) <= (degTargetHotend(extruder) + TEMP_WINDOW))) || (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) { residencyStart = _millis(); 29ec6: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 29eca: 6b 01 movw r12, r22 29ecc: 7c 01 movw r14, r24 29ece: 5b cf rjmp .-330 ; 0x29d86 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 29ed0: 8f e3 ldi r24, 0x3F ; 63 29ed2: 0e 94 41 70 call 0xe082 ; 0xe082 29ed6: c4 cf rjmp .-120 ; 0x29e60 29ed8: 07 2e mov r0, r23 29eda: 00 0c add r0, r0 29edc: 88 0b sbc r24, r24 29ede: 99 0b sbc r25, r25 29ee0: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> delay_keep_alive(0); //do not disable steppers #ifdef TEMP_RESIDENCY_TIME /* start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time or when current temp falls outside the hysteresis after target temp was reached */ if ((residencyStart == -1 && target_direction && (degHotend(extruder) >= (degTargetHotend(extruder) - TEMP_WINDOW))) || (residencyStart == -1 && !target_direction && (degHotend(extruder) <= (degTargetHotend(extruder) + TEMP_WINDOW))) || 29ee4: 20 e0 ldi r18, 0x00 ; 0 29ee6: 30 e0 ldi r19, 0x00 ; 0 29ee8: 40 e8 ldi r20, 0x80 ; 128 29eea: 5f e3 ldi r21, 0x3F ; 63 29eec: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 29ef0: 9b 01 movw r18, r22 29ef2: ac 01 movw r20, r24 29ef4: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 29ef8: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 29efc: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 29f00: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 29f04: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 29f08: 18 16 cp r1, r24 29f0a: ec f6 brge .-70 ; 0x29ec6 29f0c: 3c cf rjmp .-392 ; 0x29d86 29f0e: f7 fc sbrc r15, 7 29f10: 3a cf rjmp .-396 ; 0x29d86 29f12: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 29f16: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 29f1a: 07 2e mov r0, r23 29f1c: 00 0c add r0, r0 29f1e: 88 0b sbc r24, r24 29f20: 99 0b sbc r25, r25 29f22: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 29f26: 9b 01 movw r18, r22 29f28: ac 01 movw r20, r24 (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) 29f2a: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 29f2e: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 29f32: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 29f36: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 29f3a: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 29f3e: 9f 77 andi r25, 0x7F ; 127 29f40: 20 e0 ldi r18, 0x00 ; 0 29f42: 30 e0 ldi r19, 0x00 ; 0 29f44: 40 ea ldi r20, 0xA0 ; 160 29f46: 50 e4 ldi r21, 0x40 ; 64 29f48: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 29f4c: 18 16 cp r1, r24 29f4e: 0c f0 brlt .+2 ; 0x29f52 29f50: 1a cf rjmp .-460 ; 0x29d86 29f52: b9 cf rjmp .-142 ; 0x29ec6 00029f54 : // Compensate for configurable Extra Loading Distance planner_set_current_position_E(planner_get_current_position_E() - (logic.ExtraLoadDistance() - MMU2_FILAMENT_SENSOR_POSITION)); execute_extruder_sequence(load_to_nozzle_sequence, sizeof(load_to_nozzle_sequence) / sizeof(load_to_nozzle_sequence[0])); } void MMU2::ReportError(ErrorCode ec, ErrorSource res) { 29f54: 1f 93 push r17 29f56: cf 93 push r28 29f58: df 93 push r29 29f5a: ec 01 movw r28, r24 29f5c: 16 2f mov r17, r22 // - report only changes of states (we can miss an error message) // - may be some combination of MMUAvailable + UseMMU flags and decide based on their state // Right now the filtering of MMU_NOT_RESPONDING is done in ReportErrorHook() as it is not a problem if mmu2.cpp // Depending on the Progress code, we may want to do some action when an error occurs switch (logic.Progress()) { 29f5e: 80 91 67 12 lds r24, 0x1267 ; 0x801267 29f62: 83 30 cpi r24, 0x03 ; 3 29f64: 09 f4 brne .+2 ; 0x29f68 29f66: 4e c0 rjmp .+156 ; 0x2a004 29f68: 8c 31 cpi r24, 0x1C ; 28 29f6a: 09 f4 brne .+2 ; 0x29f6e 29f6c: 52 c0 rjmp .+164 ; 0x2a012 break; default: break; } if (ec != lastErrorCode) { // deduplicate: only report changes in error codes into the log 29f6e: 80 91 8c 12 lds r24, 0x128C ; 0x80128c 29f72: 90 91 8d 12 lds r25, 0x128D ; 0x80128d 29f76: 8c 17 cp r24, r28 29f78: 9d 07 cpc r25, r29 29f7a: 79 f1 breq .+94 ; 0x29fda lastErrorCode = ec; 29f7c: d0 93 8d 12 sts 0x128D, r29 ; 0x80128d 29f80: c0 93 8c 12 sts 0x128C, r28 ; 0x80128c lastErrorSource = res; 29f84: 10 93 8e 12 sts 0x128E, r17 ; 0x80128e LogErrorEvent_P(_O(PrusaErrorTitle(PrusaErrorCodeIndex(ec)))); 29f88: ce 01 movw r24, r28 29f8a: 0f 94 38 87 call 0x30e70 ; 0x30e70 uint16_t PrusaErrorCode(uint8_t i) { return pgm_read_word(errorCodes + i); } const char *PrusaErrorTitle(uint8_t i) { return (const char *)pgm_read_ptr(errorTitles + i); 29f8e: e8 2f mov r30, r24 29f90: f0 e0 ldi r31, 0x00 ; 0 29f92: ee 0f add r30, r30 29f94: ff 1f adc r31, r31 29f96: e9 50 subi r30, 0x09 ; 9 29f98: f5 46 sbci r31, 0x65 ; 101 29f9a: 85 91 lpm r24, Z+ 29f9c: 94 91 lpm r25, Z 29f9e: 02 96 adiw r24, 0x02 ; 2 29fa0: 0f 94 26 87 call 0x30e4c ; 0x30e4c if (ec != ErrorCode::OK && ec != ErrorCode::FILAMENT_EJECTED && ec != ErrorCode::FILAMENT_CHANGE) { 29fa4: c1 30 cpi r28, 0x01 ; 1 29fa6: d1 05 cpc r29, r1 29fa8: c1 f0 breq .+48 ; 0x29fda 29faa: cc 30 cpi r28, 0x0C ; 12 29fac: 80 e8 ldi r24, 0x80 ; 128 29fae: d8 07 cpc r29, r24 29fb0: a1 f0 breq .+40 ; 0x29fda 29fb2: c9 32 cpi r28, 0x29 ; 41 29fb4: 80 e8 ldi r24, 0x80 ; 128 29fb6: d8 07 cpc r29, r24 29fb8: 81 f0 breq .+32 ; 0x29fda IncrementMMUFails(); 29fba: 0f 94 57 86 call 0x30cae ; 0x30cae | (uint16_t)ErrorCode::TMC_OVER_TEMPERATURE_ERROR | (uint16_t)ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION ) & 0x7fffU; // skip the top bit // clang-format on static_assert(tmcMask == 0x7e00); // just make sure we fail compilation if any of the TMC error codes change if ((uint16_t)ec & tmcMask) { // @@TODO can be optimized to uint8_t operation 29fbe: ce 01 movw r24, r28 29fc0: 88 27 eor r24, r24 29fc2: 9e 77 andi r25, 0x7E ; 126 29fc4: 89 2b or r24, r25 29fc6: 49 f0 breq .+18 ; 0x29fda /// Set toolchange counter to zero inline void ClearToolChangeCounter() { toolchange_counter = 0; }; inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } 29fc8: 80 91 9a 12 lds r24, 0x129A ; 0x80129a 29fcc: 90 91 9b 12 lds r25, 0x129B ; 0x80129b 29fd0: 01 96 adiw r24, 0x01 ; 1 29fd2: 90 93 9b 12 sts 0x129B, r25 ; 0x80129b 29fd6: 80 93 9a 12 sts 0x129A, r24 ; 0x80129a return true; } } bool MMU2::RetryIfPossible(ErrorCode ec) { if (logic.RetryAttempts()) { 29fda: 80 91 79 12 lds r24, 0x1279 ; 0x801279 29fde: 88 23 and r24, r24 29fe0: d9 f0 breq .+54 ; 0x2a018 return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 29fe2: 11 e0 ldi r17, 0x01 ; 1 29fe4: 10 93 ae 0d sts 0x0DAE, r17 ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> SetButtonResponse(ButtonOperations::Retry); // check, that Retry is actually allowed on that operation if (ButtonAvailable(ec) != Buttons::NoButton) { 29fe8: ce 01 movw r24, r28 29fea: 0f 94 c3 89 call 0x31386 ; 0x31386 29fee: 8f 3f cpi r24, 0xFF ; 255 29ff0: 99 f0 breq .+38 ; 0x2a018 void ResetCommunicationTimeoutAttempts(); constexpr bool InAutoRetry() const { return inAutoRetry; } void SetInAutoRetry(bool iar) { inAutoRetry = iar; 29ff2: 10 93 7a 12 sts 0x127A, r17 ; 0x80127a logic.SetInAutoRetry(true); SERIAL_ECHOLNPGM("RetryButtonPressed"); 29ff6: 84 ee ldi r24, 0xE4 ; 228 29ff8: 9a e9 ldi r25, 0x9A ; 154 && mmu2Magic[2] == 'U' && mmu2Magic[3] == '2' && mmu2Magic[4] == ':' && strlen_constexpr(mmu2Magic) == 5, "MMU2 logging prefix mismatch, must be updated at various spots"); } 29ffa: df 91 pop r29 29ffc: cf 91 pop r28 29ffe: 1f 91 pop r17 if (logic.RetryAttempts()) { SetButtonResponse(ButtonOperations::Retry); // check, that Retry is actually allowed on that operation if (ButtonAvailable(ec) != Buttons::NoButton) { logic.SetInAutoRetry(true); SERIAL_ECHOLNPGM("RetryButtonPressed"); 2a000: 0c 94 53 72 jmp 0xe4a6 ; 0xe4a6 // Right now the filtering of MMU_NOT_RESPONDING is done in ReportErrorHook() as it is not a problem if mmu2.cpp // Depending on the Progress code, we may want to do some action when an error occurs switch (logic.Progress()) { case ProgressCode::UnloadingToFinda: unloadFilamentStarted = false; 2a004: 10 92 97 12 sts 0x1297, r1 ; 0x801297 float move_raise_z(float delta) { return raise_z(delta); } void planner_abort_queued_moves() { planner_abort_hard(); 2a008: 0f 94 ea 85 call 0x30bd4 ; 0x30bd4 // Unblock the planner. This should be safe in the // toolchange context. Currently we are mainly aborting // excess E-moves after detecting filament during toolchange. // If a MMU error is reported, the planner must be unblocked // as well so the extruder can be parked safely. planner_aborted = false; 2a00c: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac 2a010: ae cf rjmp .-164 ; 0x29f6e planner_abort_queued_moves(); // Abort excess E-moves to be safe break; case ProgressCode::FeedingToFSensor: // FSENSOR error during load. Make sure E-motor stops moving. loadFilamentStarted = false; 2a012: 10 92 96 12 sts 0x1296, r1 ; 0x801296 2a016: f8 cf rjmp .-16 ; 0x2a008 2a018: 10 92 7a 12 sts 0x127A, r1 ; 0x80127a bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 2a01c: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.458> 2a020: 81 11 cpse r24, r1 2a022: 06 c0 rjmp .+12 ; 0x2a030 2a024: ce 01 movw r24, r28 && mmu2Magic[2] == 'U' && mmu2Magic[3] == '2' && mmu2Magic[4] == ':' && strlen_constexpr(mmu2Magic) == 5, "MMU2 logging prefix mismatch, must be updated at various spots"); } 2a026: df 91 pop r29 2a028: cf 91 pop r28 2a02a: 1f 91 pop r17 2a02c: 0d 94 89 88 jmp 0x31112 ; 0x31112 2a030: df 91 pop r29 2a032: cf 91 pop r28 2a034: 1f 91 pop r17 2a036: 08 95 ret 0002a038 : * \a nbyte. If an error occurs, write() returns -1. Possible errors * include write() is called before a file has been opened, write is called * for a read-only file, device is full, a corrupt file system or an I/O error. * */ int16_t SdBaseFile::write(const void* buf, uint16_t nbyte) { 2a038: 2f 92 push r2 2a03a: 3f 92 push r3 2a03c: 4f 92 push r4 2a03e: 5f 92 push r5 2a040: 6f 92 push r6 2a042: 7f 92 push r7 2a044: 8f 92 push r8 2a046: 9f 92 push r9 2a048: af 92 push r10 2a04a: bf 92 push r11 2a04c: cf 92 push r12 2a04e: df 92 push r13 2a050: ef 92 push r14 2a052: ff 92 push r15 2a054: 0f 93 push r16 2a056: 1f 93 push r17 2a058: cf 93 push r28 2a05a: df 93 push r29 2a05c: 00 d0 rcall .+0 ; 0x2a05e 2a05e: 1f 92 push r1 2a060: cd b7 in r28, 0x3d ; 61 2a062: de b7 in r29, 0x3e ; 62 2a064: 5c 01 movw r10, r24 2a066: 4b 01 movw r8, r22 // number of bytes left to write - must be before goto statements uint16_t nToWrite = nbyte; // error if not a normal file or is read-only if (!isFile() || !(flags_ & O_WRITE)) goto fail; 2a068: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 2a06c: 81 30 cpi r24, 0x01 ; 1 2a06e: 09 f0 breq .+2 ; 0x2a072 2a070: de c0 rjmp .+444 ; 0x2a22e 2a072: 80 91 fb 15 lds r24, 0x15FB ; 0x8015fb 2a076: 81 ff sbrs r24, 1 2a078: da c0 rjmp .+436 ; 0x2a22e // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { 2a07a: 82 fd sbrc r24, 2 2a07c: bc c0 rjmp .+376 ; 0x2a1f6 * \a nbyte. If an error occurs, write() returns -1. Possible errors * include write() is called before a file has been opened, write is called * for a read-only file, device is full, a corrupt file system or an I/O error. * */ int16_t SdBaseFile::write(const void* buf, uint16_t nbyte) { 2a07e: 74 01 movw r14, r8 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 2a080: 21 2c mov r2, r1 2a082: 32 e0 ldi r19, 0x02 ; 2 2a084: 33 2e mov r3, r19 2a086: 00 91 02 16 lds r16, 0x1602 ; 0x801602 2a08a: 10 91 03 16 lds r17, 0x1603 ; 0x801603 2a08e: 20 91 04 16 lds r18, 0x1604 ; 0x801604 2a092: 30 91 05 16 lds r19, 0x1605 ; 0x801605 // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { if (!seekEnd()) goto fail; } while (nToWrite > 0) { 2a096: e1 14 cp r14, r1 2a098: f1 04 cpc r15, r1 2a09a: 09 f4 brne .+2 ; 0x2a09e 2a09c: 30 c1 rjmp .+608 ; 0x2a2fe uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); 2a09e: 80 91 13 16 lds r24, 0x1613 ; 0x801613 2a0a2: 90 91 14 16 lds r25, 0x1614 ; 0x801614 uint16_t rootDirEntryCount_; // number of entries in FAT16 root dir uint32_t rootDirStart_; // root start block for FAT16, cluster for FAT32 //---------------------------------------------------------------------------- bool allocContiguous(uint32_t count, uint32_t* curCluster); uint8_t blockOfCluster(uint32_t position) const { return (position >> 9) & (blocksPerCluster_ - 1);} 2a0a6: dc 01 movw r26, r24 2a0a8: 14 96 adiw r26, 0x04 ; 4 2a0aa: 7c 90 ld r7, X 2a0ac: 7a 94 dec r7 2a0ae: b9 01 movw r22, r18 2a0b0: a8 01 movw r20, r16 2a0b2: 29 e0 ldi r18, 0x09 ; 9 2a0b4: 76 95 lsr r23 2a0b6: 67 95 ror r22 2a0b8: 57 95 ror r21 2a0ba: 47 95 ror r20 2a0bc: 2a 95 dec r18 2a0be: d1 f7 brne .-12 ; 0x2a0b4 2a0c0: 74 22 and r7, r20 uint16_t blockOffset = curPosition_ & 0X1FF; 2a0c2: 11 70 andi r17, 0x01 ; 1 if (blockOfCluster == 0 && blockOffset == 0) { 2a0c4: 71 10 cpse r7, r1 2a0c6: 25 c0 rjmp .+74 ; 0x2a112 2a0c8: 01 15 cp r16, r1 2a0ca: 11 05 cpc r17, r1 2a0cc: 11 f5 brne .+68 ; 0x2a112 2a0ce: 40 91 fe 15 lds r20, 0x15FE ; 0x8015fe 2a0d2: 50 91 ff 15 lds r21, 0x15FF ; 0x8015ff 2a0d6: 60 91 00 16 lds r22, 0x1600 ; 0x801600 2a0da: 70 91 01 16 lds r23, 0x1601 ; 0x801601 // start of new cluster if (curCluster_ == 0) { 2a0de: 41 15 cp r20, r1 2a0e0: 51 05 cpc r21, r1 2a0e2: 61 05 cpc r22, r1 2a0e4: 71 05 cpc r23, r1 2a0e6: 09 f0 breq .+2 ; 0x2a0ea 2a0e8: a8 c0 rjmp .+336 ; 0x2a23a if (firstCluster_ == 0) { 2a0ea: 80 91 0f 16 lds r24, 0x160F ; 0x80160f 2a0ee: 90 91 10 16 lds r25, 0x1610 ; 0x801610 2a0f2: a0 91 11 16 lds r26, 0x1611 ; 0x801611 2a0f6: b0 91 12 16 lds r27, 0x1612 ; 0x801612 2a0fa: 00 97 sbiw r24, 0x00 ; 0 2a0fc: a1 05 cpc r26, r1 2a0fe: b1 05 cpc r27, r1 2a100: 09 f0 breq .+2 ; 0x2a104 2a102: b4 c0 rjmp .+360 ; 0x2a26c } else { uint32_t next; if (!vol_->fatGet(curCluster_, &next)) goto fail; if (vol_->isEOC(next)) { // add cluster if at end of chain if (!addCluster()) goto fail; 2a104: 8a ef ldi r24, 0xFA ; 250 2a106: 95 e1 ldi r25, 0x15 ; 21 2a108: 0f 94 ef 6e call 0x2ddde ; 0x2ddde 2a10c: 88 23 and r24, r24 2a10e: 09 f4 brne .+2 ; 0x2a112 2a110: 8e c0 rjmp .+284 ; 0x2a22e curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 2a112: c1 01 movw r24, r2 2a114: 80 1b sub r24, r16 2a116: 91 0b sbc r25, r17 2a118: 67 01 movw r12, r14 2a11a: 8e 15 cp r24, r14 2a11c: 9f 05 cpc r25, r15 2a11e: 08 f4 brcc .+2 ; 0x2a122 2a120: 6c 01 movw r12, r24 // lesser of space and amount to write if (n > nToWrite) n = nToWrite; // block for data write uint32_t block = vol_->clusterStartBlock(curCluster_) + blockOfCluster; 2a122: e0 91 13 16 lds r30, 0x1613 ; 0x801613 2a126: f0 91 14 16 lds r31, 0x1614 ; 0x801614 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2a12a: 80 91 fe 15 lds r24, 0x15FE ; 0x8015fe 2a12e: 90 91 ff 15 lds r25, 0x15FF ; 0x8015ff 2a132: a0 91 00 16 lds r26, 0x1600 ; 0x801600 2a136: b0 91 01 16 lds r27, 0x1601 ; 0x801601 2a13a: 02 97 sbiw r24, 0x02 ; 2 2a13c: a1 09 sbc r26, r1 2a13e: b1 09 sbc r27, r1 2a140: 25 85 ldd r18, Z+13 ; 0x0d 2a142: 04 c0 rjmp .+8 ; 0x2a14c 2a144: 88 0f add r24, r24 2a146: 99 1f adc r25, r25 2a148: aa 1f adc r26, r26 2a14a: bb 1f adc r27, r27 2a14c: 2a 95 dec r18 2a14e: d2 f7 brpl .-12 ; 0x2a144 2a150: 46 85 ldd r20, Z+14 ; 0x0e 2a152: 57 85 ldd r21, Z+15 ; 0x0f 2a154: 60 89 ldd r22, Z+16 ; 0x10 2a156: 71 89 ldd r23, Z+17 ; 0x11 2a158: 84 0f add r24, r20 2a15a: 95 1f adc r25, r21 2a15c: a6 1f adc r26, r22 2a15e: b7 1f adc r27, r23 2a160: 9c 01 movw r18, r24 2a162: ad 01 movw r20, r26 2a164: 27 0d add r18, r7 2a166: 31 1d adc r19, r1 2a168: 41 1d adc r20, r1 2a16a: 51 1d adc r21, r1 2a16c: 29 01 movw r4, r18 2a16e: 3a 01 movw r6, r20 if (n == 512) { 2a170: c1 14 cp r12, r1 2a172: 32 e0 ldi r19, 0x02 ; 2 2a174: d3 06 cpc r13, r19 2a176: 09 f0 breq .+2 ; 0x2a17a 2a178: 8a c0 rjmp .+276 ; 0x2a28e // full block - don't need to use cache if (vol_->cacheBlockNumber() == block) { 2a17a: 80 91 cd 0d lds r24, 0x0DCD ; 0x800dcd 2a17e: 90 91 ce 0d lds r25, 0x0DCE ; 0x800dce 2a182: a0 91 cf 0d lds r26, 0x0DCF ; 0x800dcf 2a186: b0 91 d0 0d lds r27, 0x0DD0 ; 0x800dd0 2a18a: 48 16 cp r4, r24 2a18c: 59 06 cpc r5, r25 2a18e: 6a 06 cpc r6, r26 2a190: 7b 06 cpc r7, r27 2a192: 69 f4 brne .+26 ; 0x2a1ae static bool cacheFlush(); static bool cacheRawBlock(uint32_t blockNumber, bool dirty); #endif // USE_MULTIPLE_CARDS // used by SdBaseFile write to assign cache to SD location void cacheSetBlockNumber(uint32_t blockNumber, bool dirty) { cacheDirty_ = dirty; 2a194: 10 92 d5 0d sts 0x0DD5, r1 ; 0x800dd5 cacheBlockNumber_ = blockNumber; 2a198: 8f ef ldi r24, 0xFF ; 255 2a19a: 9f ef ldi r25, 0xFF ; 255 2a19c: dc 01 movw r26, r24 2a19e: 80 93 cd 0d sts 0x0DCD, r24 ; 0x800dcd 2a1a2: 90 93 ce 0d sts 0x0DCE, r25 ; 0x800dce 2a1a6: a0 93 cf 0d sts 0x0DCF, r26 ; 0x800dcf 2a1aa: b0 93 d0 0d sts 0x0DD0, r27 ; 0x800dd0 return cluster >= FAT32EOC_MIN; } bool readBlock(uint32_t block, uint8_t* dst) { return sdCard_->readBlock(block, dst);} bool writeBlock(uint32_t block, const uint8_t* dst) { return sdCard_->writeBlock(block, dst); 2a1ae: 95 01 movw r18, r10 2a1b0: b3 01 movw r22, r6 2a1b2: a2 01 movw r20, r4 2a1b4: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 2a1b8: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 2a1bc: 0f 94 4f 70 call 0x2e09e ; 0x2e09e // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; 2a1c0: 88 23 and r24, r24 2a1c2: a9 f1 breq .+106 ; 0x2a22e if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto fail; } uint8_t* dst = vol_->cache()->data + blockOffset; memcpy(dst, src, n); } curPosition_ += n; 2a1c4: 80 91 02 16 lds r24, 0x1602 ; 0x801602 2a1c8: 90 91 03 16 lds r25, 0x1603 ; 0x801603 2a1cc: a0 91 04 16 lds r26, 0x1604 ; 0x801604 2a1d0: b0 91 05 16 lds r27, 0x1605 ; 0x801605 2a1d4: 8c 0d add r24, r12 2a1d6: 9d 1d adc r25, r13 2a1d8: a1 1d adc r26, r1 2a1da: b1 1d adc r27, r1 2a1dc: 80 93 02 16 sts 0x1602, r24 ; 0x801602 2a1e0: 90 93 03 16 sts 0x1603, r25 ; 0x801603 2a1e4: a0 93 04 16 sts 0x1604, r26 ; 0x801604 2a1e8: b0 93 05 16 sts 0x1605, r27 ; 0x801605 src += n; 2a1ec: ac 0c add r10, r12 2a1ee: bd 1c adc r11, r13 nToWrite -= n; 2a1f0: ec 18 sub r14, r12 2a1f2: fd 08 sbc r15, r13 2a1f4: 48 cf rjmp .-368 ; 0x2a086 // error if not a normal file or is read-only if (!isFile() || !(flags_ & O_WRITE)) goto fail; // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { 2a1f6: 40 91 0b 16 lds r20, 0x160B ; 0x80160b 2a1fa: 50 91 0c 16 lds r21, 0x160C ; 0x80160c 2a1fe: 60 91 0d 16 lds r22, 0x160D ; 0x80160d 2a202: 70 91 0e 16 lds r23, 0x160E ; 0x80160e 2a206: 80 91 02 16 lds r24, 0x1602 ; 0x801602 2a20a: 90 91 03 16 lds r25, 0x1603 ; 0x801603 2a20e: a0 91 04 16 lds r26, 0x1604 ; 0x801604 2a212: b0 91 05 16 lds r27, 0x1605 ; 0x801605 2a216: 48 17 cp r20, r24 2a218: 59 07 cpc r21, r25 2a21a: 6a 07 cpc r22, r26 2a21c: 7b 07 cpc r23, r27 2a21e: 09 f4 brne .+2 ; 0x2a222 2a220: 2e cf rjmp .-420 ; 0x2a07e } /** Set the files position to end-of-file + \a offset. See seekSet(). * \param[in] offset The new position in bytes from end-of-file. * \return true for success or false for failure. */ bool seekEnd(int32_t offset = 0) {return seekSet(fileSize_ + offset);} 2a222: 8a ef ldi r24, 0xFA ; 250 2a224: 95 e1 ldi r25, 0x15 ; 21 2a226: 0f 94 3f 39 call 0x2727e ; 0x2727e if (!seekEnd()) goto fail; 2a22a: 81 11 cpse r24, r1 2a22c: 28 cf rjmp .-432 ; 0x2a07e } return nbyte; fail: // return for write error writeError = true; 2a22e: 81 e0 ldi r24, 0x01 ; 1 2a230: 80 93 fa 15 sts 0x15FA, r24 ; 0x8015fa return -1; 2a234: 8f ef ldi r24, 0xFF ; 255 2a236: 9f ef ldi r25, 0xFF ; 255 2a238: 81 c0 rjmp .+258 ; 0x2a33c } else { curCluster_ = firstCluster_; } } else { uint32_t next; if (!vol_->fatGet(curCluster_, &next)) goto fail; 2a23a: 9e 01 movw r18, r28 2a23c: 2f 5f subi r18, 0xFF ; 255 2a23e: 3f 4f sbci r19, 0xFF ; 255 2a240: 0f 94 3c 37 call 0x26e78 ; 0x26e78 2a244: 88 23 and r24, r24 2a246: 99 f3 breq .-26 ; 0x2a22e if (vol_->isEOC(next)) { 2a248: 89 81 ldd r24, Y+1 ; 0x01 2a24a: 9a 81 ldd r25, Y+2 ; 0x02 2a24c: ab 81 ldd r26, Y+3 ; 0x03 2a24e: bc 81 ldd r27, Y+4 ; 0x04 return fatPut(cluster, 0x0FFFFFFF); } bool freeChain(uint32_t cluster); bool isEOC(uint32_t cluster) const { if (FAT12_SUPPORT && fatType_ == 12) return cluster >= FAT12EOC_MIN; if (fatType_ == 16) return cluster >= FAT16EOC_MIN; 2a250: e0 91 13 16 lds r30, 0x1613 ; 0x801613 2a254: f0 91 14 16 lds r31, 0x1614 ; 0x801614 2a258: 27 89 ldd r18, Z+23 ; 0x17 2a25a: 20 31 cpi r18, 0x10 ; 16 2a25c: 81 f4 brne .+32 ; 0x2a27e 2a25e: 88 3f cpi r24, 0xF8 ; 248 2a260: ef ef ldi r30, 0xFF ; 255 2a262: 9e 07 cpc r25, r30 2a264: a1 05 cpc r26, r1 2a266: b1 05 cpc r27, r1 2a268: 08 f0 brcs .+2 ; 0x2a26c 2a26a: 4c cf rjmp .-360 ; 0x2a104 // add cluster if at end of chain if (!addCluster()) goto fail; } else { curCluster_ = next; 2a26c: 80 93 fe 15 sts 0x15FE, r24 ; 0x8015fe 2a270: 90 93 ff 15 sts 0x15FF, r25 ; 0x8015ff 2a274: a0 93 00 16 sts 0x1600, r26 ; 0x801600 2a278: b0 93 01 16 sts 0x1601, r27 ; 0x801601 2a27c: 4a cf rjmp .-364 ; 0x2a112 return cluster >= FAT32EOC_MIN; 2a27e: 88 3f cpi r24, 0xF8 ; 248 2a280: ff ef ldi r31, 0xFF ; 255 2a282: 9f 07 cpc r25, r31 2a284: af 07 cpc r26, r31 2a286: ff e0 ldi r31, 0x0F ; 15 2a288: bf 07 cpc r27, r31 2a28a: 80 f3 brcs .-32 ; 0x2a26c 2a28c: 3b cf rjmp .-394 ; 0x2a104 // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; } else { if (blockOffset == 0 && curPosition_ >= fileSize_) { 2a28e: 01 15 cp r16, r1 2a290: 11 05 cpc r17, r1 2a292: 69 f5 brne .+90 ; 0x2a2ee 2a294: 40 91 02 16 lds r20, 0x1602 ; 0x801602 2a298: 50 91 03 16 lds r21, 0x1603 ; 0x801603 2a29c: 60 91 04 16 lds r22, 0x1604 ; 0x801604 2a2a0: 70 91 05 16 lds r23, 0x1605 ; 0x801605 2a2a4: 80 91 0b 16 lds r24, 0x160B ; 0x80160b 2a2a8: 90 91 0c 16 lds r25, 0x160C ; 0x80160c 2a2ac: a0 91 0d 16 lds r26, 0x160D ; 0x80160d 2a2b0: b0 91 0e 16 lds r27, 0x160E ; 0x80160e 2a2b4: 48 17 cp r20, r24 2a2b6: 59 07 cpc r21, r25 2a2b8: 6a 07 cpc r22, r26 2a2ba: 7b 07 cpc r23, r27 2a2bc: c0 f0 brcs .+48 ; 0x2a2ee // start of new block don't need to read into cache if (!vol_->cacheFlush()) goto fail; 2a2be: 0f 94 2e 36 call 0x26c5c ; 0x26c5c 2a2c2: 88 23 and r24, r24 2a2c4: 09 f4 brne .+2 ; 0x2a2c8 2a2c6: b3 cf rjmp .-154 ; 0x2a22e static bool cacheFlush(); static bool cacheRawBlock(uint32_t blockNumber, bool dirty); #endif // USE_MULTIPLE_CARDS // used by SdBaseFile write to assign cache to SD location void cacheSetBlockNumber(uint32_t blockNumber, bool dirty) { cacheDirty_ = dirty; 2a2c8: 81 e0 ldi r24, 0x01 ; 1 2a2ca: 80 93 d5 0d sts 0x0DD5, r24 ; 0x800dd5 cacheBlockNumber_ = blockNumber; 2a2ce: 40 92 cd 0d sts 0x0DCD, r4 ; 0x800dcd 2a2d2: 50 92 ce 0d sts 0x0DCE, r5 ; 0x800dce 2a2d6: 60 92 cf 0d sts 0x0DCF, r6 ; 0x800dcf 2a2da: 70 92 d0 0d sts 0x0DD0, r7 ; 0x800dd0 } else { // rewrite part of block if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto fail; } uint8_t* dst = vol_->cache()->data + blockOffset; memcpy(dst, src, n); 2a2de: a6 01 movw r20, r12 2a2e0: b5 01 movw r22, r10 2a2e2: c8 01 movw r24, r16 2a2e4: 87 52 subi r24, 0x27 ; 39 2a2e6: 92 4f sbci r25, 0xF2 ; 242 2a2e8: 0f 94 05 a6 call 0x34c0a ; 0x34c0a 2a2ec: 6b cf rjmp .-298 ; 0x2a1c4 if (!vol_->cacheFlush()) goto fail; // set cache dirty and SD address of block vol_->cacheSetBlockNumber(block, true); } else { // rewrite part of block if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto fail; 2a2ee: 41 e0 ldi r20, 0x01 ; 1 2a2f0: c3 01 movw r24, r6 2a2f2: b2 01 movw r22, r4 2a2f4: 0f 94 6d 36 call 0x26cda ; 0x26cda 2a2f8: 81 11 cpse r24, r1 2a2fa: f1 cf rjmp .-30 ; 0x2a2de 2a2fc: 98 cf rjmp .-208 ; 0x2a22e } curPosition_ += n; src += n; nToWrite -= n; } if (curPosition_ > fileSize_) { 2a2fe: 80 91 0b 16 lds r24, 0x160B ; 0x80160b 2a302: 90 91 0c 16 lds r25, 0x160C ; 0x80160c 2a306: a0 91 0d 16 lds r26, 0x160D ; 0x80160d 2a30a: b0 91 0e 16 lds r27, 0x160E ; 0x80160e 2a30e: 80 17 cp r24, r16 2a310: 91 07 cpc r25, r17 2a312: a2 07 cpc r26, r18 2a314: b3 07 cpc r27, r19 2a316: 68 f4 brcc .+26 ; 0x2a332 2a318: 80 91 fb 15 lds r24, 0x15FB ; 0x8015fb // update fileSize and insure sync will update dir entry fileSize_ = curPosition_; 2a31c: 00 93 0b 16 sts 0x160B, r16 ; 0x80160b 2a320: 10 93 0c 16 sts 0x160C, r17 ; 0x80160c 2a324: 20 93 0d 16 sts 0x160D, r18 ; 0x80160d 2a328: 30 93 0e 16 sts 0x160E, r19 ; 0x80160e flags_ |= F_FILE_DIR_DIRTY; 2a32c: 80 68 ori r24, 0x80 ; 128 2a32e: 80 93 fb 15 sts 0x15FB, r24 ; 0x8015fb } else if (dateTime_ && nbyte) { // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { 2a332: 80 91 fb 15 lds r24, 0x15FB ; 0x8015fb 2a336: 83 fd sbrc r24, 3 2a338: 18 c0 rjmp .+48 ; 0x2a36a if (!sync()) goto fail; } return nbyte; 2a33a: c4 01 movw r24, r8 fail: // return for write error writeError = true; return -1; } 2a33c: 0f 90 pop r0 2a33e: 0f 90 pop r0 2a340: 0f 90 pop r0 2a342: 0f 90 pop r0 2a344: df 91 pop r29 2a346: cf 91 pop r28 2a348: 1f 91 pop r17 2a34a: 0f 91 pop r16 2a34c: ff 90 pop r15 2a34e: ef 90 pop r14 2a350: df 90 pop r13 2a352: cf 90 pop r12 2a354: bf 90 pop r11 2a356: af 90 pop r10 2a358: 9f 90 pop r9 2a35a: 8f 90 pop r8 2a35c: 7f 90 pop r7 2a35e: 6f 90 pop r6 2a360: 5f 90 pop r5 2a362: 4f 90 pop r4 2a364: 3f 90 pop r3 2a366: 2f 90 pop r2 2a368: 08 95 ret // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { if (!sync()) goto fail; 2a36a: 8a ef ldi r24, 0xFA ; 250 2a36c: 95 e1 ldi r25, 0x15 ; 21 2a36e: 0f 94 0a 39 call 0x27214 ; 0x27214 2a372: 81 11 cpse r24, r1 2a374: e2 cf rjmp .-60 ; 0x2a33a 2a376: 5b cf rjmp .-330 ; 0x2a22e 0002a378 : #ifdef SDCARD_SORT_ALPHA /** * Get the name of a file in the current directory by sort-index */ void CardReader::getfilename_sorted(const uint16_t nr, uint8_t sdSort) { 2a378: 0f 93 push r16 2a37a: cf 93 push r28 2a37c: df 93 push r29 2a37e: cd b7 in r28, 0x3d ; 61 2a380: de b7 in r29, 0x3e ; 62 2a382: a3 97 sbiw r28, 0x23 ; 35 2a384: 0f b6 in r0, 0x3f ; 63 2a386: f8 94 cli 2a388: de bf out 0x3e, r29 ; 62 2a38a: 0f be out 0x3f, r0 ; 63 2a38c: cd bf out 0x3d, r28 ; 61 if (nr < sort_count) 2a38e: 20 91 0b 15 lds r18, 0x150B ; 0x80150b 2a392: 30 91 0c 15 lds r19, 0x150C ; 0x80150c 2a396: 82 17 cp r24, r18 2a398: 93 07 cpc r25, r19 2a39a: d8 f4 brcc .+54 ; 0x2a3d2 getfilename_simple(sort_entries[(sdSort == SD_SORT_ALPHA) ? (sort_count - nr - 1) : nr]); 2a39c: 61 30 cpi r22, 0x01 ; 1 2a39e: 31 f4 brne .+12 ; 0x2a3ac 2a3a0: 21 50 subi r18, 0x01 ; 1 2a3a2: 31 09 sbc r19, r1 2a3a4: a9 01 movw r20, r18 2a3a6: 48 1b sub r20, r24 2a3a8: 59 0b sbc r21, r25 2a3aa: ca 01 movw r24, r20 2a3ac: 88 0f add r24, r24 2a3ae: 99 1f adc r25, r25 2a3b0: fc 01 movw r30, r24 2a3b2: e3 5f subi r30, 0xF3 ; 243 2a3b4: fa 4e sbci r31, 0xEA ; 234 2a3b6: 80 81 ld r24, Z 2a3b8: 91 81 ldd r25, Z+1 ; 0x01 2a3ba: 0f 94 df 47 call 0x28fbe ; 0x28fbe else getfilename_afterMaxSorting(nr); } 2a3be: a3 96 adiw r28, 0x23 ; 35 2a3c0: 0f b6 in r0, 0x3f ; 63 2a3c2: f8 94 cli 2a3c4: de bf out 0x3e, r29 ; 62 2a3c6: 0f be out 0x3f, r0 ; 63 2a3c8: cd bf out 0x3d, r28 ; 61 2a3ca: df 91 pop r29 2a3cc: cf 91 pop r28 2a3ce: 0f 91 pop r16 2a3d0: 08 95 ret void CardReader::getfilename_afterMaxSorting(uint16_t entry, const char * const match/*=NULL*/) { curDir = &workDir; 2a3d2: 45 e1 ldi r20, 0x15 ; 21 2a3d4: 54 e1 ldi r21, 0x14 ; 20 2a3d6: 50 93 14 14 sts 0x1414, r21 ; 0x801414 2a3da: 40 93 13 14 sts 0x1413, r20 ; 0x801413 nrFiles = entry - sort_count + 1; 2a3de: 82 1b sub r24, r18 2a3e0: 93 0b sbc r25, r19 2a3e2: 01 96 adiw r24, 0x01 ; 1 2a3e4: 90 93 83 16 sts 0x1683, r25 ; 0x801683 2a3e8: 80 93 82 16 sts 0x1682, r24 ; 0x801682 curDir->seekSet(lastSortedFilePosition << 5); 2a3ec: 40 91 d5 15 lds r20, 0x15D5 ; 0x8015d5 2a3f0: 50 91 d6 15 lds r21, 0x15D6 ; 0x8015d6 2a3f4: 85 e0 ldi r24, 0x05 ; 5 2a3f6: 44 0f add r20, r20 2a3f8: 55 1f adc r21, r21 2a3fa: 8a 95 dec r24 2a3fc: e1 f7 brne .-8 ; 0x2a3f6 2a3fe: 70 e0 ldi r23, 0x00 ; 0 2a400: 60 e0 ldi r22, 0x00 ; 0 2a402: 85 e1 ldi r24, 0x15 ; 21 2a404: 94 e1 ldi r25, 0x14 ; 20 2a406: 0f 94 3f 39 call 0x2727e ; 0x2727e }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 2a40a: 00 e0 ldi r16, 0x00 ; 0 2a40c: 0e 7f andi r16, 0xFE ; 254 2a40e: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2a410: e0 91 13 14 lds r30, 0x1413 ; 0x801413 2a414: f0 91 14 14 lds r31, 0x1414 ; 0x801414 2a418: 83 e2 ldi r24, 0x23 ; 35 2a41a: de 01 movw r26, r28 2a41c: 11 96 adiw r26, 0x01 ; 1 2a41e: 01 90 ld r0, Z+ 2a420: 0d 92 st X+, r0 2a422: 8a 95 dec r24 2a424: e1 f7 brne .-8 ; 0x2a41e 2a426: 22 e0 ldi r18, 0x02 ; 2 2a428: 50 e0 ldi r21, 0x00 ; 0 2a42a: 40 e0 ldi r20, 0x00 ; 0 2a42c: be 01 movw r22, r28 2a42e: 6f 5f subi r22, 0xFF ; 255 2a430: 7f 4f sbci r23, 0xFF ; 255 2a432: 8a ed ldi r24, 0xDA ; 218 2a434: 92 e0 ldi r25, 0x02 ; 2 2a436: 0f 94 69 45 call 0x28ad2 ; 0x28ad2 2a43a: ce 01 movw r24, r28 2a43c: 01 96 adiw r24, 0x01 ; 1 2a43e: 0e 94 3b 70 call 0xe076 ; 0xe076 2a442: bd cf rjmp .-134 ; 0x2a3be 0002a444 : SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } void CardReader::openFileWrite(const char* name) 2a444: 0f 93 push r16 2a446: 1f 93 push r17 2a448: cf 93 push r28 2a44a: df 93 push r29 2a44c: 1f 92 push r1 2a44e: 1f 92 push r1 2a450: cd b7 in r28, 0x3d ; 61 2a452: de b7 in r29, 0x3e ; 62 { if(!mounted) 2a454: 20 91 6b 13 lds r18, 0x136B ; 0x80136b 2a458: 22 23 and r18, r18 2a45a: 69 f1 breq .+90 ; 0x2a4b6 2a45c: 8c 01 movw r16, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 2a45e: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 2a462: 88 23 and r24, r24 2a464: 79 f1 breq .+94 ; 0x2a4c4 SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; file.close(); #else SERIAL_ECHOLNPGM("File already opened"); 2a466: 8b e0 ldi r24, 0x0B ; 11 2a468: 9a e9 ldi r25, 0x9A ; 154 2a46a: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 file_subcall_ctr=0; //resetting procedure depth in case user cancels print while in procedure SERIAL_ECHO_START; SERIAL_ECHORPGM(ofNowFreshFile); SERIAL_ECHOLN(name); } sdprinting = false; 2a46e: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a const char *fname=name; 2a472: 1a 83 std Y+2, r17 ; 0x02 2a474: 09 83 std Y+1, r16 ; 0x01 if (!diveSubfolder(fname)) 2a476: ce 01 movw r24, r28 2a478: 01 96 adiw r24, 0x01 ; 1 2a47a: 0f 94 81 4b call 0x29702 ; 0x29702 2a47e: 88 23 and r24, r24 2a480: d1 f0 breq .+52 ; 0x2a4b6 return; //write if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)){ 2a482: 49 81 ldd r20, Y+1 ; 0x01 2a484: 5a 81 ldd r21, Y+2 ; 0x02 2a486: 60 91 13 14 lds r22, 0x1413 ; 0x801413 2a48a: 70 91 14 14 lds r23, 0x1414 ; 0x801414 2a48e: 26 e5 ldi r18, 0x56 ; 86 2a490: 8a ef ldi r24, 0xFA ; 250 2a492: 95 e1 ldi r25, 0x15 ; 21 2a494: 0f 94 89 99 call 0x33312 ; 0x33312 2a498: 81 11 cpse r24, r1 2a49a: 22 c0 rjmp .+68 ; 0x2a4e0 SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 2a49c: 8b eb ldi r24, 0xBB ; 187 2a49e: 9b e6 ldi r25, 0x6B ; 107 2a4a0: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 2a4a4: 89 81 ldd r24, Y+1 ; 0x01 2a4a6: 9a 81 ldd r25, Y+2 ; 0x02 2a4a8: 0e 94 a3 7c call 0xf946 ; 0xf946 2a4ac: 8e e2 ldi r24, 0x2E ; 46 2a4ae: 0e 94 41 70 call 0xe082 ; 0xe082 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 2a4b2: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } } 2a4b6: 0f 90 pop r0 2a4b8: 0f 90 pop r0 2a4ba: df 91 pop r29 2a4bc: cf 91 pop r28 2a4be: 1f 91 pop r17 2a4c0: 0f 91 pop r16 2a4c2: 08 95 ret file.close(); #else SERIAL_ECHOLNPGM("File already opened"); #endif } else { //opening fresh file file_subcall_ctr=0; //resetting procedure depth in case user cancels print while in procedure 2a4c4: 10 92 1d 16 sts 0x161D, r1 ; 0x80161d SERIAL_ECHO_START; 2a4c8: 81 e6 ldi r24, 0x61 ; 97 2a4ca: 9d e9 ldi r25, 0x9D ; 157 2a4cc: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHORPGM(ofNowFreshFile); 2a4d0: 83 e2 ldi r24, 0x23 ; 35 2a4d2: 9c e9 ldi r25, 0x9C ; 156 2a4d4: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLN(name); 2a4d8: c8 01 movw r24, r16 2a4da: 0f 94 fd 98 call 0x331fa ; 0x331fa 2a4de: c7 cf rjmp .-114 ; 0x2a46e if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)){ SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } else { saving = true; 2a4e0: 81 e0 ldi r24, 0x01 ; 1 2a4e2: 80 93 68 13 sts 0x1368, r24 ; 0x801368 getfilename(0, fname); 2a4e6: 89 81 ldd r24, Y+1 ; 0x01 2a4e8: 9a 81 ldd r25, Y+2 ; 0x02 2a4ea: 0f 94 98 47 call 0x28f30 ; 0x28f30 SERIAL_PROTOCOLRPGM(ofWritingToFile);////MSG_SD_WRITE_TO_FILE 2a4ee: 89 ef ldi r24, 0xF9 ; 249 2a4f0: 99 e9 ldi r25, 0x99 ; 153 2a4f2: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 printAbsFilenameFast(); 2a4f6: 0f 94 7b 48 call 0x290f6 ; 0x290f6 SERIAL_PROTOCOLLN(); 2a4fa: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 2a4fe: 8f ef ldi r24, 0xFF ; 255 2a500: 9b e9 ldi r25, 0x9B ; 155 2a502: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 lcd_setstatuspgm(ofFileSelected); 2a506: 8f ef ldi r24, 0xFF ; 255 2a508: 9b e9 ldi r25, 0x9B ; 155 2a50a: 0e 94 65 e6 call 0x1ccca ; 0x1ccca scrollstuff = 0; 2a50e: 10 92 cc 0d sts 0x0DCC, r1 ; 0x800dcc 2a512: d1 cf rjmp .-94 ; 0x2a4b6 0002a514 : //presort(); #endif } } bool CardReader::ToshibaFlashAir_GetIP(uint8_t *ip) 2a514: 0f 93 push r16 2a516: 1f 93 push r17 2a518: cf 93 push r28 2a51a: df 93 push r29 2a51c: ec 01 movw r28, r24 { memset(ip, 0, 4); 2a51e: 84 e0 ldi r24, 0x04 ; 4 2a520: fe 01 movw r30, r28 2a522: 11 92 st Z+, r1 2a524: 8a 95 dec r24 2a526: e9 f7 brne .-6 ; 0x2a522 /** Perform Extention Read. */ uint8_t Sd2Card::readExt(uint32_t arg, uint8_t* dst, uint16_t count) { uint16_t i; // send command and argument. if (cardCommand(CMD48, arg) && cardCommand(CMD17, arg)) { // CMD48 for W-03, CMD17 for W-04 2a528: 23 e0 ldi r18, 0x03 ; 3 2a52a: 30 ea ldi r19, 0xA0 ; 160 2a52c: 4a e0 ldi r20, 0x0A ; 10 2a52e: 50 e9 ldi r21, 0x90 ; 144 2a530: 60 e3 ldi r22, 0x30 ; 48 2a532: 87 ed ldi r24, 0xD7 ; 215 2a534: 95 e1 ldi r25, 0x15 ; 21 2a536: 0f 94 f6 6f call 0x2dfec ; 0x2dfec 2a53a: 88 23 and r24, r24 2a53c: 91 f0 breq .+36 ; 0x2a562 2a53e: 23 e0 ldi r18, 0x03 ; 3 2a540: 30 ea ldi r19, 0xA0 ; 160 2a542: 4a e0 ldi r20, 0x0A ; 10 2a544: 50 e9 ldi r21, 0x90 ; 144 2a546: 61 e1 ldi r22, 0x11 ; 17 2a548: 87 ed ldi r24, 0xD7 ; 215 2a54a: 95 e1 ldi r25, 0x15 ; 21 2a54c: 0f 94 f6 6f call 0x2dfec ; 0x2dfec 2a550: 88 23 and r24, r24 2a552: 39 f0 breq .+14 ; 0x2a562 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 2a554: 80 e8 ldi r24, 0x80 ; 128 2a556: 80 93 d7 15 sts 0x15D7, r24 ; 0x8015d7 chipSelectHigh(); spiSend(0xFF); // dummy clock to force FlashAir finish the command. return true; fail: chipSelectHigh(); 2a55a: 0f 94 c7 41 call 0x2838e ; 0x2838e return false; 2a55e: 80 e0 ldi r24, 0x00 ; 0 2a560: 2f c0 rjmp .+94 ; 0x2a5c0 //------------------------------------------------------------------------------ /** Wait for start block token */ //FIXME Vojtech: Copied from a current version of Sd2Card Arduino code. // We shall likely upgrade the rest of the Sd2Card. uint8_t Sd2Card::waitStartBlock(void) { uint16_t t0 = _millis(); 2a562: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 2a566: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 2a568: 0f 94 ef 6f call 0x2dfde ; 0x2dfde 2a56c: 80 93 d9 15 sts 0x15D9, r24 ; 0x8015d9 2a570: 8f 3f cpi r24, 0xFF ; 255 2a572: 69 f4 brne .+26 ; 0x2a58e if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 2a574: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 2a578: 60 1b sub r22, r16 2a57a: 71 0b sbc r23, r17 2a57c: 6d 32 cpi r22, 0x2D ; 45 2a57e: 71 40 sbci r23, 0x01 ; 1 2a580: 98 f3 brcs .-26 ; 0x2a568 2a582: 81 e1 ldi r24, 0x11 ; 17 2a584: 80 93 d7 15 sts 0x15D7, r24 ; 0x8015d7 goto fail; } return true; fail: chipSelectHigh(); 2a588: 0f 94 c7 41 call 0x2838e ; 0x2838e 2a58c: e6 cf rjmp .-52 ; 0x2a55a if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 2a58e: 8e 3f cpi r24, 0xFE ; 254 2a590: 11 f0 breq .+4 ; 0x2a596 2a592: 8f e0 ldi r24, 0x0F ; 15 2a594: f7 cf rjmp .-18 ; 0x2a584 2a596: 8e 01 movw r16, r28 2a598: 0c 5f subi r16, 0xFC ; 252 2a59a: 1f 4f sbci r17, 0xFF ; 255 goto fail; } // receive data for (i = 0; i < count; ++i) { dst[i] = spiRec(); 2a59c: 0f 94 ef 6f call 0x2dfde ; 0x2dfde 2a5a0: 89 93 st Y+, r24 if (!waitStartBlock()) { goto fail; } // receive data for (i = 0; i < count; ++i) { 2a5a2: c0 17 cp r28, r16 2a5a4: d1 07 cpc r29, r17 2a5a6: d1 f7 brne .-12 ; 0x2a59c 2a5a8: ce ef ldi r28, 0xFE ; 254 2a5aa: d1 e0 ldi r29, 0x01 ; 1 dst[i] = spiRec(); } // skip dummy bytes and 16-bit crc. for (; i < 514; ++i) { spiRec(); 2a5ac: 0f 94 ef 6f call 0x2dfde ; 0x2dfde 2a5b0: 21 97 sbiw r28, 0x01 ; 1 for (i = 0; i < count; ++i) { dst[i] = spiRec(); } // skip dummy bytes and 16-bit crc. for (; i < 514; ++i) { 2a5b2: e1 f7 brne .-8 ; 0x2a5ac spiRec(); } chipSelectHigh(); 2a5b4: 0f 94 c7 41 call 0x2838e ; 0x2838e spiSend(0xFF); // dummy clock to force FlashAir finish the command. 2a5b8: 8f ef ldi r24, 0xFF ; 255 2a5ba: 0f 94 ea 6f call 0x2dfd4 ; 0x2dfd4 2a5be: 81 e0 ldi r24, 0x01 ; 1 return card.readExtMemory(1, 1, 0x400+0x150, 4, ip); } 2a5c0: df 91 pop r29 2a5c2: cf 91 pop r28 2a5c4: 1f 91 pop r17 2a5c6: 0f 91 pop r16 2a5c8: 08 95 ret 0002a5ca : } enum class dcode_mem_t:uint8_t { sram, eeprom, progmem, xflash }; void print_mem(daddr_t address, daddr_t count, dcode_mem_t type, uint8_t countperline = 16) 2a5ca: cf 92 push r12 2a5cc: df 92 push r13 2a5ce: ef 92 push r14 2a5d0: ff 92 push r15 2a5d2: 0f 93 push r16 2a5d4: 1f 93 push r17 2a5d6: cf 93 push r28 2a5d8: df 93 push r29 2a5da: ec 01 movw r28, r24 2a5dc: 8b 01 movw r16, r22 2a5de: e4 2e mov r14, r20 { #if defined(DEBUG_DCODE6) || defined(DEBUG_DCODES) || defined(XFLASH_DUMP) if(type == dcode_mem_t::xflash) XFLASH_SPI_ENTER(); #endif while (count) 2a5e0: 01 15 cp r16, r1 2a5e2: 11 05 cpc r17, r1 2a5e4: 09 f4 brne .+2 ; 0x2a5e8 2a5e6: 41 c0 rjmp .+130 ; 0x2a66a void print_hex_word(daddr_t val) { #if DADDR_SIZE > 16 print_hex_byte((val >> 16) & 0xFF); #endif print_hex_byte((val >> 8) & 0xFF); 2a5e8: 8d 2f mov r24, r29 2a5ea: 0e 94 88 6f call 0xdf10 ; 0xdf10 print_hex_byte(val & 0xFF); 2a5ee: 8c 2f mov r24, r28 2a5f0: 0e 94 88 6f call 0xdf10 ; 0xdf10 XFLASH_SPI_ENTER(); #endif while (count) { print_hex_word(address); putchar(' '); 2a5f4: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> 2a5f8: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> 2a5fc: 80 e2 ldi r24, 0x20 ; 32 2a5fe: 90 e0 ldi r25, 0x00 ; 0 2a600: 0f 94 44 9e call 0x33c88 ; 0x33c88 2a604: 6e 01 movw r12, r28 2a606: 80 e1 ldi r24, 0x10 ; 16 2a608: c8 0e add r12, r24 2a60a: d1 1c adc r13, r1 uint8_t count_line = countperline; while (count && count_line) { uint8_t data = 0; switch (type) 2a60c: 81 e0 ldi r24, 0x01 ; 1 2a60e: e8 16 cp r14, r24 2a610: 39 f1 breq .+78 ; 0x2a660 { case dcode_mem_t::sram: data = *((uint8_t*)address); break; 2a612: f8 80 ld r15, Y case dcode_mem_t::xflash: xflash_rd_data(address, &data, 1); break; #else case dcode_mem_t::xflash: break; #endif } ++address; 2a614: 21 96 adiw r28, 0x01 ; 1 putchar(' '); 2a616: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> 2a61a: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> 2a61e: 80 e2 ldi r24, 0x20 ; 32 2a620: 90 e0 ldi r25, 0x00 ; 0 2a622: 0f 94 44 9e call 0x33c88 ; 0x33c88 print_hex_byte(data); 2a626: 8f 2d mov r24, r15 2a628: 0e 94 88 6f call 0xdf10 ; 0xdf10 count_line--; count--; 2a62c: 01 50 subi r16, 0x01 ; 1 2a62e: 11 09 sbc r17, r1 // sporadically call manage_heater, but only when interrupts are enabled (meaning // print_mem is called by D2). Don't do anything otherwise: we are inside a crash // handler where memory & stack needs to be preserved! if((SREG & (1 << SREG_I)) && !((uint16_t)count % 8192)) 2a630: 0f b6 in r0, 0x3f ; 63 2a632: 07 fe sbrs r0, 7 2a634: 06 c0 rjmp .+12 ; 0x2a642 2a636: c8 01 movw r24, r16 2a638: 9f 71 andi r25, 0x1F ; 31 2a63a: 89 2b or r24, r25 2a63c: 29 f4 brne .+10 ; 0x2a648 manage_heater(); 2a63e: 0f 94 5b 32 call 0x264b6 ; 0x264b6 while (count) { print_hex_word(address); putchar(' '); uint8_t count_line = countperline; while (count && count_line) 2a642: 01 15 cp r16, r1 2a644: 11 05 cpc r17, r1 2a646: 19 f0 breq .+6 ; 0x2a64e 2a648: cc 15 cp r28, r12 2a64a: dd 05 cpc r29, r13 2a64c: f9 f6 brne .-66 ; 0x2a60c // print_mem is called by D2). Don't do anything otherwise: we are inside a crash // handler where memory & stack needs to be preserved! if((SREG & (1 << SREG_I)) && !((uint16_t)count % 8192)) manage_heater(); } putchar('\n'); 2a64e: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> 2a652: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> 2a656: 8a e0 ldi r24, 0x0A ; 10 2a658: 90 e0 ldi r25, 0x00 ; 0 2a65a: 0f 94 44 9e call 0x33c88 ; 0x33c88 2a65e: c0 cf rjmp .-128 ; 0x2a5e0 { uint8_t data = 0; switch (type) { case dcode_mem_t::sram: data = *((uint8_t*)address); break; case dcode_mem_t::eeprom: data = eeprom_read_byte((uint8_t*)address); break; 2a660: ce 01 movw r24, r28 2a662: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 2a666: f8 2e mov r15, r24 2a668: d5 cf rjmp .-86 ; 0x2a614 if((SREG & (1 << SREG_I)) && !((uint16_t)count % 8192)) manage_heater(); } putchar('\n'); } } 2a66a: df 91 pop r29 2a66c: cf 91 pop r28 2a66e: 1f 91 pop r17 2a670: 0f 91 pop r16 2a672: ff 90 pop r15 2a674: ef 90 pop r14 2a676: df 90 pop r13 2a678: cf 90 pop r12 2a67a: 08 95 ret 0002a67c : ; // } #if (FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) void IR_sensor::init() { if (state == State::error) { 2a67c: 80 91 84 16 lds r24, 0x1684 ; 0x801684 2a680: 83 30 cpi r24, 0x03 ; 3 2a682: 21 f4 brne .+8 ; 0x2a68c settings_init(); // also sets the state to State::initializing } void IR_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); SET_INPUT(IR_SENSOR_PIN); // input mode 2a684: 51 98 cbi 0x0a, 1 ; 10 WRITE(IR_SENSOR_PIN, 0); // no pullup 2a686: 59 98 cbi 0x0b, 1 ; 11 state = State::disabled; 2a688: 10 92 84 16 sts 0x1684, r1 ; 0x801684 void IR_sensor::init() { if (state == State::error) { fsensor.deinit(); // deinit first if there was an error. } // puts_P(PSTR("fsensor::init()")); SET_INPUT(IR_SENSOR_PIN); // input mode 2a68c: 51 98 cbi 0x0a, 1 ; 10 WRITE(IR_SENSOR_PIN, 1); // pullup 2a68e: 59 9a sbi 0x0b, 1 ; 11 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 2a690: 84 e8 ldi r24, 0x84 ; 132 2a692: 96 e1 ldi r25, 0x16 ; 22 2a694: 0c 94 f0 6d jmp 0xdbe0 ; 0xdbe0 0002a698 : //! //! @param layer_height layer height in mm //! @param extrusion_width extrusion width in mm //! @param extrusion_length extrusion length in mm //! @return filament length in mm which needs to be extruded to form line static constexpr float __attribute__((noinline)) count_e(float layer_height, float extrusion_width, float extrusion_length, float filament_diameter=1.75f) 2a698: cf 92 push r12 2a69a: df 92 push r13 2a69c: ef 92 push r14 2a69e: ff 92 push r15 2a6a0: 69 01 movw r12, r18 2a6a2: 7a 01 movw r14, r20 { return (extrusion_length * ((M_PI * pow(layer_height, 2)) / 4 + layer_height * (extrusion_width - layer_height))) / ((M_PI * pow(filament_diameter, 2)) / 4); 2a6a4: 2d ec ldi r18, 0xCD ; 205 2a6a6: 3c ec ldi r19, 0xCC ; 204 2a6a8: 4c e4 ldi r20, 0x4C ; 76 2a6aa: 5e e3 ldi r21, 0x3E ; 62 2a6ac: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 2a6b0: 2d ec ldi r18, 0xCD ; 205 2a6b2: 3c ec ldi r19, 0xCC ; 204 2a6b4: 4c e4 ldi r20, 0x4C ; 76 2a6b6: 5e e3 ldi r21, 0x3E ; 62 2a6b8: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2a6bc: 2d ef ldi r18, 0xFD ; 253 2a6be: 3d ea ldi r19, 0xAD ; 173 2a6c0: 40 e0 ldi r20, 0x00 ; 0 2a6c2: 5d e3 ldi r21, 0x3D ; 61 2a6c4: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2a6c8: a7 01 movw r20, r14 2a6ca: 96 01 movw r18, r12 2a6cc: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2a6d0: 24 e2 ldi r18, 0x24 ; 36 2a6d2: 30 ef ldi r19, 0xF0 ; 240 2a6d4: 49 e1 ldi r20, 0x19 ; 25 2a6d6: 50 e4 ldi r21, 0x40 ; 64 2a6d8: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> } 2a6dc: ff 90 pop r15 2a6de: ef 90 pop r14 2a6e0: df 90 pop r13 2a6e2: cf 90 pop r12 2a6e4: 08 95 ret 0002a6e6 : } } void st_set_position(const long *pos) { CRITICAL_SECTION_START; 2a6e6: 9f b7 in r25, 0x3f ; 63 2a6e8: f8 94 cli // Copy 4x4B. // This block locks the interrupts globally for 2.06 us, // which corresponds to a maximum repeat frequency of ~484kHz. // This blocking is safe in the context of a 10kHz stepper driver interrupt // or a 115200 Bd serial line receive interrupt, which will not trigger faster than 12kHz. memcpy((long *)count_position, pos, sizeof(count_position)); 2a6ea: 80 e1 ldi r24, 0x10 ; 16 2a6ec: e6 ea ldi r30, 0xA6 ; 166 2a6ee: f6 e0 ldi r31, 0x06 ; 6 2a6f0: a6 eb ldi r26, 0xB6 ; 182 2a6f2: b6 e0 ldi r27, 0x06 ; 6 2a6f4: 01 90 ld r0, Z+ 2a6f6: 0d 92 st X+, r0 2a6f8: 8a 95 dec r24 2a6fa: e1 f7 brne .-8 ; 0x2a6f4 CRITICAL_SECTION_END; 2a6fc: 9f bf out 0x3f, r25 ; 63 } 2a6fe: 08 95 ret 0002a700 : #include "sound.h" namespace MMU2 { void BeginReport(CommandInProgress /*cip*/, ProgressCode ec) { custom_message_type = CustomMsg::MMUProgress; 2a700: 89 e0 ldi r24, 0x09 ; 9 2a702: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 }; const char *ProgressCodeToText(ProgressCode pc) { // @@TODO ?? a better fallback option? return ((uint16_t)pc <= (sizeof(progressTexts) / sizeof(progressTexts[0]))) ? static_cast(pgm_read_ptr(&progressTexts[(uint16_t)pc])) 2a706: e1 e2 ldi r30, 0x21 ; 33 2a708: fa e9 ldi r31, 0x9A ; 154 2a70a: 85 91 lpm r24, Z+ 2a70c: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 2a70e: 0e 94 b1 6c call 0xd962 ; 0xd962 2a712: 0c 94 65 e6 jmp 0x1ccca ; 0x1ccca 0002a716 : void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); } void MMU2::execute_extruder_sequence(const E_Step *sequence, uint8_t stepCount) { 2a716: 1f 93 push r17 2a718: cf 93 push r28 2a71a: df 93 push r29 2a71c: ec 01 movw r28, r24 2a71e: 16 2f mov r17, r22 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2a720: 0f 94 42 22 call 0x24484 ; 0x24484 planner_synchronize(); // Plan the moves const E_Step *step = sequence; for (uint8_t i = stepCount; i > 0; --i) { extruder_move(pgm_read_float(&(step->extrude)), pgm_read_float(&(step->feedRate))); 2a724: fe 01 movw r30, r28 2a726: 34 96 adiw r30, 0x04 ; 4 2a728: 25 91 lpm r18, Z+ 2a72a: 35 91 lpm r19, Z+ 2a72c: 45 91 lpm r20, Z+ 2a72e: 54 91 lpm r21, Z 2a730: fe 01 movw r30, r28 2a732: 65 91 lpm r22, Z+ 2a734: 75 91 lpm r23, Z+ 2a736: 85 91 lpm r24, Z+ 2a738: 94 91 lpm r25, Z 2a73a: 0f 94 02 87 call 0x30e04 ; 0x30e04 step++; 2a73e: 28 96 adiw r28, 0x08 ; 8 void MMU2::execute_extruder_sequence(const E_Step *sequence, uint8_t stepCount) { planner_synchronize(); // Plan the moves const E_Step *step = sequence; for (uint8_t i = stepCount; i > 0; --i) { 2a740: 11 50 subi r17, 0x01 ; 1 2a742: 81 f7 brne .-32 ; 0x2a724 2a744: 0f 94 42 22 call 0x24484 ; 0x24484 // Wait for the moves to finish // it looks like it's better to sync the moves at the end - smoother move (if the sequence is not too long). planner_synchronize(); Disable_E0(); } 2a748: df 91 pop r29 2a74a: cf 91 pop r28 2a74c: 1f 91 pop r17 // Wait for the moves to finish // it looks like it's better to sync the moves at the end - smoother move (if the sequence is not too long). planner_synchronize(); Disable_E0(); 2a74e: 0d 94 00 87 jmp 0x30e00 ; 0x30e00 0002a752 : } void EndReport(CommandInProgress /*cip*/, ProgressCode /*ec*/) { // clear the status msg line - let the printed filename get visible again if (!printJobOngoing()) { 2a752: 0e 94 c8 60 call 0xc190 ; 0xc190 2a756: 81 11 cpse r24, r1 2a758: 04 c0 rjmp .+8 ; 0x2a762 lcd_setstatuspgm(MSG_WELCOME); 2a75a: 87 e6 ldi r24, 0x67 ; 103 2a75c: 9b e6 ldi r25, 0x6B ; 107 2a75e: 0e 94 65 e6 call 0x1ccca ; 0x1ccca } custom_message_type = CustomMsg::Status; 2a762: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 } 2a766: 08 95 ret 0002a768 : EndReport(cip, ProgressCode::OK); } }; bool MMU2::WaitForMMUReady() { switch (State()) { 2a768: 80 91 94 12 lds r24, 0x1294 ; 0x801294 2a76c: 88 23 and r24, r24 2a76e: 11 f0 breq .+4 ; 0x2a774 return false; case xState::Connecting: // shall we wait until the MMU reconnects? // fire-up a fsm_dlg and show "MMU not responding"? default: return true; 2a770: 81 e0 ldi r24, 0x01 ; 1 2a772: 08 95 ret }; bool MMU2::WaitForMMUReady() { switch (State()) { case xState::Stopped: return false; 2a774: 80 e0 ldi r24, 0x00 ; 0 // shall we wait until the MMU reconnects? // fire-up a fsm_dlg and show "MMU not responding"? default: return true; } } 2a776: 08 95 ret 0002a778 : } #ifdef TMC2130 void homeaxis(uint8_t axis, uint8_t cnt, uint8_t* pstep) #else void homeaxis(uint8_t axis, uint8_t cnt) 2a778: 2f 92 push r2 2a77a: 3f 92 push r3 2a77c: 4f 92 push r4 2a77e: 5f 92 push r5 2a780: 6f 92 push r6 2a782: 7f 92 push r7 2a784: 8f 92 push r8 2a786: 9f 92 push r9 2a788: af 92 push r10 2a78a: bf 92 push r11 2a78c: cf 92 push r12 2a78e: df 92 push r13 2a790: ef 92 push r14 2a792: ff 92 push r15 2a794: 0f 93 push r16 2a796: 1f 93 push r17 2a798: cf 93 push r28 2a79a: df 93 push r29 2a79c: 00 d0 rcall .+0 ; 0x2a79e 2a79e: 00 d0 rcall .+0 ; 0x2a7a0 2a7a0: 00 d0 rcall .+0 ; 0x2a7a2 2a7a2: 1f 92 push r1 2a7a4: 1f 92 push r1 2a7a6: cd b7 in r28, 0x3d ; 61 2a7a8: de b7 in r29, 0x3e ; 62 2a7aa: 8b 83 std Y+3, r24 ; 0x03 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 2a7ac: 20 91 77 02 lds r18, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.364> 2a7b0: 2d 83 std Y+5, r18 ; 0x05 check_endstops = check; 2a7b2: 81 e0 ldi r24, 0x01 ; 1 2a7b4: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.364> #endif //TMC2130 { bool endstops_enabled = enable_endstops(true); //RP: endstops should be allways enabled durring homing #define HOMEAXIS_DO(LETTER) \ ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1)) if ((axis==X_AXIS)?HOMEAXIS_DO(X):(axis==Y_AXIS)?HOMEAXIS_DO(Y):0) 2a7b8: 9b 81 ldd r25, Y+3 ; 0x03 2a7ba: 92 30 cpi r25, 0x02 ; 2 2a7bc: 09 f4 brne .+2 ; 0x2a7c0 2a7be: 5b c1 rjmp .+694 ; 0x2aa76 XYZ_CONSTS_FROM_CONFIG(float, base_min_pos, MIN_POS); XYZ_CONSTS_FROM_CONFIG(float, base_max_pos, MAX_POS); XYZ_CONSTS_FROM_CONFIG(float, base_home_pos, HOME_POS); XYZ_CONSTS_FROM_CONFIG(float, max_length, MAX_LENGTH); XYZ_CONSTS_FROM_CONFIG(float, home_retract_mm, HOME_RETRACT_MM); XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); 2a7c0: a9 2f mov r26, r25 2a7c2: b0 e0 ldi r27, 0x00 ; 0 2a7c4: ba 83 std Y+2, r27 ; 0x02 2a7c6: a9 83 std Y+1, r26 ; 0x01 2a7c8: fd 01 movw r30, r26 2a7ca: e0 51 subi r30, 0x10 ; 16 2a7cc: f7 46 sbci r31, 0x67 ; 103 #define DEFINE_PGM_READ_ANY(type, reader) \ static inline type pgm_read_any(const type *p) \ { return pgm_read_##reader##_near(p); } DEFINE_PGM_READ_ANY(float, float); DEFINE_PGM_READ_ANY(signed char, byte); 2a7ce: 24 91 lpm r18, Z 2a7d0: 2c 83 std Y+4, r18 ; 0x04 #define HOMEAXIS_DO(LETTER) \ ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1)) if ((axis==X_AXIS)?HOMEAXIS_DO(X):(axis==Y_AXIS)?HOMEAXIS_DO(Y):0) { int axis_home_dir = home_dir(axis); feedrate = homing_feedrate[axis]; 2a7d2: 8d 01 movw r16, r26 2a7d4: 00 0f add r16, r16 2a7d6: 11 1f adc r17, r17 2a7d8: 00 0f add r16, r16 2a7da: 11 1f adc r17, r17 2a7dc: f8 01 movw r30, r16 2a7de: ed 50 subi r30, 0x0D ; 13 2a7e0: fd 4f sbci r31, 0xFD ; 253 2a7e2: 40 80 ld r4, Z 2a7e4: 51 80 ldd r5, Z+1 ; 0x01 2a7e6: 62 80 ldd r6, Z+2 ; 0x02 2a7e8: 73 80 ldd r7, Z+3 ; 0x03 2a7ea: 40 92 7a 02 sts 0x027A, r4 ; 0x80027a 2a7ee: 50 92 7b 02 sts 0x027B, r5 ; 0x80027b 2a7f2: 60 92 7c 02 sts 0x027C, r6 ; 0x80027c 2a7f6: 70 92 7d 02 sts 0x027D, r7 ; 0x80027d float feedrate_mm_s = get_feedrate_mm_s(feedrate); 2a7fa: c3 01 movw r24, r6 2a7fc: b2 01 movw r22, r4 2a7fe: 0e 94 cd 5f call 0xbf9a ; 0xbf9a 2a802: 4b 01 movw r8, r22 2a804: 5c 01 movw r10, r24 // Move away a bit, so that the print head does not touch the end position, // and the following movement to endstop has a chance to achieve the required velocity // for the stall guard to work. current_position[axis] = 0; 2a806: c8 01 movw r24, r16 2a808: 8b 50 subi r24, 0x0B ; 11 2a80a: 9e 4e sbci r25, 0xEE ; 238 2a80c: 1c 01 movw r2, r24 2a80e: dc 01 movw r26, r24 2a810: 1d 92 st X+, r1 2a812: 1d 92 st X+, r1 2a814: 1d 92 st X+, r1 2a816: 1c 92 st X, r1 2a818: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); 2a81a: 0f 94 30 83 call 0x30660 ; 0x30660 set_destination_to_current(); 2a81e: 0e 94 36 61 call 0xc26c ; 0xc26c // destination[axis] = 11.f; destination[axis] = -3.f * axis_home_dir; 2a822: bc 81 ldd r27, Y+4 ; 0x04 2a824: 6b 2f mov r22, r27 2a826: bb 0f add r27, r27 2a828: 77 0b sbc r23, r23 2a82a: 88 0b sbc r24, r24 2a82c: 99 0b sbc r25, r25 2a82e: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2a832: 6b 01 movw r12, r22 2a834: 7c 01 movw r14, r24 2a836: f8 01 movw r30, r16 2a838: ed 56 subi r30, 0x6D ; 109 2a83a: f9 4f sbci r31, 0xF9 ; 249 2a83c: fb 87 std Y+11, r31 ; 0x0b 2a83e: ea 87 std Y+10, r30 ; 0x0a 2a840: 20 e0 ldi r18, 0x00 ; 0 2a842: 30 e0 ldi r19, 0x00 ; 0 2a844: 40 e4 ldi r20, 0x40 ; 64 2a846: 50 ec ldi r21, 0xC0 ; 192 2a848: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2a84c: aa 85 ldd r26, Y+10 ; 0x0a 2a84e: bb 85 ldd r27, Y+11 ; 0x0b 2a850: 6d 93 st X+, r22 2a852: 7d 93 st X+, r23 2a854: 8d 93 st X+, r24 2a856: 9c 93 st X, r25 2a858: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2a85a: c5 01 movw r24, r10 2a85c: b4 01 movw r22, r8 2a85e: 0f 94 3d 84 call 0x3087a ; 0x3087a st_synchronize(); 2a862: 0f 94 42 22 call 0x24484 ; 0x24484 // Move away from the possible collision with opposite endstop with the collision detection disabled. endstops_hit_on_purpose(); 2a866: 0f 94 96 2c call 0x2592c ; 0x2592c 2a86a: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.364> enable_endstops(false); current_position[axis] = 0; 2a86e: f1 01 movw r30, r2 2a870: 10 82 st Z, r1 2a872: 11 82 std Z+1, r1 ; 0x01 2a874: 12 82 std Z+2, r1 ; 0x02 2a876: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 2a878: 0f 94 30 83 call 0x30660 ; 0x30660 destination[axis] = 1. * axis_home_dir; 2a87c: aa 85 ldd r26, Y+10 ; 0x0a 2a87e: bb 85 ldd r27, Y+11 ; 0x0b 2a880: cd 92 st X+, r12 2a882: dd 92 st X+, r13 2a884: ed 92 st X+, r14 2a886: fc 92 st X, r15 2a888: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2a88a: c5 01 movw r24, r10 2a88c: b4 01 movw r22, r8 2a88e: 0f 94 3d 84 call 0x3087a ; 0x3087a st_synchronize(); 2a892: 0f 94 42 22 call 0x24484 ; 0x24484 2a896: b1 e0 ldi r27, 0x01 ; 1 2a898: b0 93 77 02 sts 0x0277, r27 ; 0x800277 <_ZL14check_endstops.lto_priv.364> { return pgm_read_any(&array##_P[axis]); } XYZ_CONSTS_FROM_CONFIG(float, base_min_pos, MIN_POS); XYZ_CONSTS_FROM_CONFIG(float, base_max_pos, MAX_POS); XYZ_CONSTS_FROM_CONFIG(float, base_home_pos, HOME_POS); XYZ_CONSTS_FROM_CONFIG(float, max_length, MAX_LENGTH); 2a89c: f8 01 movw r30, r16 2a89e: ec 51 subi r30, 0x1C ; 28 2a8a0: f7 46 sbci r31, 0x67 ; 103 #define DEFINE_PGM_READ_ANY(type, reader) \ static inline type pgm_read_any(const type *p) \ { return pgm_read_##reader##_near(p); } DEFINE_PGM_READ_ANY(float, float); 2a8a2: 85 91 lpm r24, Z+ 2a8a4: 95 91 lpm r25, Z+ 2a8a6: a5 91 lpm r26, Z+ 2a8a8: b4 91 lpm r27, Z 2a8aa: 8e 83 std Y+6, r24 ; 0x06 2a8ac: 9f 83 std Y+7, r25 ; 0x07 2a8ae: a8 87 std Y+8, r26 ; 0x08 2a8b0: b9 87 std Y+9, r27 ; 0x09 destination[axis] = 1. * axis_home_dir; plan_buffer_line_destinationXYZE(feedrate_mm_s); st_synchronize(); // Now continue to move up to the left end stop with the collision detection enabled. enable_endstops(true); destination[axis] = 1.1 * axis_home_dir * max_length(axis); 2a8b2: 2d ec ldi r18, 0xCD ; 205 2a8b4: 3c ec ldi r19, 0xCC ; 204 2a8b6: 4c e8 ldi r20, 0x8C ; 140 2a8b8: 5f e3 ldi r21, 0x3F ; 63 2a8ba: c7 01 movw r24, r14 2a8bc: b6 01 movw r22, r12 2a8be: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2a8c2: 2e 81 ldd r18, Y+6 ; 0x06 2a8c4: 3f 81 ldd r19, Y+7 ; 0x07 2a8c6: 48 85 ldd r20, Y+8 ; 0x08 2a8c8: 59 85 ldd r21, Y+9 ; 0x09 2a8ca: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2a8ce: aa 85 ldd r26, Y+10 ; 0x0a 2a8d0: bb 85 ldd r27, Y+11 ; 0x0b 2a8d2: 6d 93 st X+, r22 2a8d4: 7d 93 st X+, r23 2a8d6: 8d 93 st X+, r24 2a8d8: 9c 93 st X, r25 2a8da: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2a8dc: c5 01 movw r24, r10 2a8de: b4 01 movw r22, r8 2a8e0: 0f 94 3d 84 call 0x3087a ; 0x3087a st_synchronize(); 2a8e4: 0f 94 42 22 call 0x24484 ; 0x24484 for (uint8_t i = 0; i < cnt; i++) { // Move away from the collision to a known distance from the left end stop with the collision detection disabled. endstops_hit_on_purpose(); 2a8e8: 0f 94 96 2c call 0x2592c ; 0x2592c 2a8ec: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.364> enable_endstops(false); current_position[axis] = 0; 2a8f0: f1 01 movw r30, r2 2a8f2: 10 82 st Z, r1 2a8f4: 11 82 std Z+1, r1 ; 0x01 2a8f6: 12 82 std Z+2, r1 ; 0x02 2a8f8: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 2a8fa: 0f 94 30 83 call 0x30660 ; 0x30660 destination[axis] = -10.f * axis_home_dir; 2a8fe: 20 e0 ldi r18, 0x00 ; 0 2a900: 30 e0 ldi r19, 0x00 ; 0 2a902: 40 e2 ldi r20, 0x20 ; 32 2a904: 51 ec ldi r21, 0xC1 ; 193 2a906: c7 01 movw r24, r14 2a908: b6 01 movw r22, r12 2a90a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2a90e: aa 85 ldd r26, Y+10 ; 0x0a 2a910: bb 85 ldd r27, Y+11 ; 0x0b 2a912: 6d 93 st X+, r22 2a914: 7d 93 st X+, r23 2a916: 8d 93 st X+, r24 2a918: 9c 93 st X, r25 2a91a: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2a91c: c5 01 movw r24, r10 2a91e: b4 01 movw r22, r8 2a920: 0f 94 3d 84 call 0x3087a ; 0x3087a st_synchronize(); 2a924: 0f 94 42 22 call 0x24484 ; 0x24484 endstops_hit_on_purpose(); 2a928: 0f 94 96 2c call 0x2592c ; 0x2592c 2a92c: b1 e0 ldi r27, 0x01 ; 1 2a92e: b0 93 77 02 sts 0x0277, r27 ; 0x800277 <_ZL14check_endstops.lto_priv.364> // Now move left up to the collision, this time with a repeatable velocity. enable_endstops(true); destination[axis] = 11.f * axis_home_dir; 2a932: 20 e0 ldi r18, 0x00 ; 0 2a934: 30 e0 ldi r19, 0x00 ; 0 2a936: 40 e3 ldi r20, 0x30 ; 48 2a938: 51 e4 ldi r21, 0x41 ; 65 2a93a: c7 01 movw r24, r14 2a93c: b6 01 movw r22, r12 2a93e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2a942: ea 85 ldd r30, Y+10 ; 0x0a 2a944: fb 85 ldd r31, Y+11 ; 0x0b 2a946: 60 83 st Z, r22 2a948: 71 83 std Z+1, r23 ; 0x01 2a94a: 82 83 std Z+2, r24 ; 0x02 2a94c: 93 83 std Z+3, r25 ; 0x03 #ifdef TMC2130 feedrate = homing_feedrate[axis]; #else //TMC2130 feedrate = homing_feedrate[axis] / 2; 2a94e: 20 e0 ldi r18, 0x00 ; 0 2a950: 30 e0 ldi r19, 0x00 ; 0 2a952: 40 e0 ldi r20, 0x00 ; 0 2a954: 5f e3 ldi r21, 0x3F ; 63 2a956: c3 01 movw r24, r6 2a958: b2 01 movw r22, r4 2a95a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2a95e: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a 2a962: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b 2a966: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 2a96a: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d feedrate_mm_s = get_feedrate_mm_s(feedrate); 2a96e: 0e 94 cd 5f call 0xbf9a ; 0xbf9a 2a972: 6b 01 movw r12, r22 2a974: 7c 01 movw r14, r24 #endif //TMC2130 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2a976: 0f 94 3d 84 call 0x3087a ; 0x3087a st_synchronize(); 2a97a: 0f 94 42 22 call 0x24484 ; 0x24484 uint16_t mscnt = tmc2130_rd_MSCNT(axis); if (pstep) pstep[i] = mscnt >> 4; printf_P(PSTR("%3d step=%2d mscnt=%4d\n"), i, mscnt >> 4, mscnt); #endif //TMC2130 } endstops_hit_on_purpose(); 2a97e: 0f 94 96 2c call 0x2592c ; 0x2592c 2a982: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.364> else tmc2130_do_steps(axis, 8, -axis_home_dir, 1000); tmc2130_home_exit(); #endif //TMC2130 axis_is_at_home(axis); 2a986: 8b 81 ldd r24, Y+3 ; 0x03 2a988: 0e 94 17 60 call 0xc02e ; 0xc02e axis_known_position[axis] = true; 2a98c: e9 81 ldd r30, Y+1 ; 0x01 2a98e: fa 81 ldd r31, Y+2 ; 0x02 2a990: ed 55 subi r30, 0x5D ; 93 2a992: f9 4f sbci r31, 0xF9 ; 249 2a994: 21 e0 ldi r18, 0x01 ; 1 2a996: 20 83 st Z, r18 // Move from minimum #ifdef TMC2130 float dist = - axis_home_dir * 0.01f * tmc2130_home_fsteps[axis]; #else //TMC2130 float dist = - axis_home_dir * 0.01f * 64; 2a998: 8c 81 ldd r24, Y+4 ; 0x04 2a99a: 99 27 eor r25, r25 2a99c: 81 95 neg r24 2a99e: 0c f4 brge .+2 ; 0x2a9a2 2a9a0: 90 95 com r25 2a9a2: bc 01 movw r22, r24 2a9a4: 07 2e mov r0, r23 2a9a6: 00 0c add r0, r0 2a9a8: 88 0b sbc r24, r24 2a9aa: 99 0b sbc r25, r25 2a9ac: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2a9b0: 2a e0 ldi r18, 0x0A ; 10 2a9b2: 37 ed ldi r19, 0xD7 ; 215 2a9b4: 43 e2 ldi r20, 0x23 ; 35 2a9b6: 5c e3 ldi r21, 0x3C ; 60 2a9b8: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2a9bc: 20 e0 ldi r18, 0x00 ; 0 2a9be: 30 e0 ldi r19, 0x00 ; 0 2a9c0: 40 e8 ldi r20, 0x80 ; 128 2a9c2: 52 e4 ldi r21, 0x42 ; 66 2a9c4: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2a9c8: 4b 01 movw r8, r22 2a9ca: 5c 01 movw r10, r24 #endif //TMC2130 current_position[axis] -= dist; 2a9cc: ac 01 movw r20, r24 2a9ce: 9b 01 movw r18, r22 2a9d0: d1 01 movw r26, r2 2a9d2: 6d 91 ld r22, X+ 2a9d4: 7d 91 ld r23, X+ 2a9d6: 8d 91 ld r24, X+ 2a9d8: 9c 91 ld r25, X 2a9da: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 2a9de: f1 01 movw r30, r2 2a9e0: 60 83 st Z, r22 2a9e2: 71 83 std Z+1, r23 ; 0x01 2a9e4: 82 83 std Z+2, r24 ; 0x02 2a9e6: 93 83 std Z+3, r25 ; 0x03 plan_set_position_curposXYZE(); 2a9e8: 0f 94 30 83 call 0x30660 ; 0x30660 current_position[axis] += dist; 2a9ec: d1 01 movw r26, r2 2a9ee: 2d 91 ld r18, X+ 2a9f0: 3d 91 ld r19, X+ 2a9f2: 4d 91 ld r20, X+ 2a9f4: 5c 91 ld r21, X 2a9f6: c5 01 movw r24, r10 2a9f8: b4 01 movw r22, r8 2a9fa: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2a9fe: f1 01 movw r30, r2 2aa00: 60 83 st Z, r22 2aa02: 71 83 std Z+1, r23 ; 0x01 2aa04: 82 83 std Z+2, r24 ; 0x02 2aa06: 93 83 std Z+3, r25 ; 0x03 destination[axis] = current_position[axis]; 2aa08: aa 85 ldd r26, Y+10 ; 0x0a 2aa0a: bb 85 ldd r27, Y+11 ; 0x0b 2aa0c: 6d 93 st X+, r22 2aa0e: 7d 93 st X+, r23 2aa10: 8d 93 st X+, r24 2aa12: 9c 93 st X, r25 2aa14: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(0.5f*feedrate_mm_s); 2aa16: 20 e0 ldi r18, 0x00 ; 0 2aa18: 30 e0 ldi r19, 0x00 ; 0 2aa1a: 40 e0 ldi r20, 0x00 ; 0 2aa1c: 5f e3 ldi r21, 0x3F ; 63 2aa1e: c7 01 movw r24, r14 2aa20: b6 01 movw r22, r12 2aa22: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2aa26: 0f 94 3d 84 call 0x3087a ; 0x3087a st_synchronize(); 2aa2a: 0f 94 42 22 call 0x24484 ; 0x24484 feedrate = 0.0; 2aa2e: 10 92 7a 02 sts 0x027A, r1 ; 0x80027a 2aa32: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b 2aa36: 10 92 7c 02 sts 0x027C, r1 ; 0x80027c 2aa3a: 10 92 7d 02 sts 0x027D, r1 ; 0x80027d 2aa3e: 2d 81 ldd r18, Y+5 ; 0x05 2aa40: 20 93 77 02 sts 0x0277, r18 ; 0x800277 <_ZL14check_endstops.lto_priv.364> #ifdef TMC2130 FORCE_HIGH_POWER_END; #endif } enable_endstops(endstops_enabled); } 2aa44: 2b 96 adiw r28, 0x0b ; 11 2aa46: 0f b6 in r0, 0x3f ; 63 2aa48: f8 94 cli 2aa4a: de bf out 0x3e, r29 ; 62 2aa4c: 0f be out 0x3f, r0 ; 63 2aa4e: cd bf out 0x3d, r28 ; 61 2aa50: df 91 pop r29 2aa52: cf 91 pop r28 2aa54: 1f 91 pop r17 2aa56: 0f 91 pop r16 2aa58: ff 90 pop r15 2aa5a: ef 90 pop r14 2aa5c: df 90 pop r13 2aa5e: cf 90 pop r12 2aa60: bf 90 pop r11 2aa62: af 90 pop r10 2aa64: 9f 90 pop r9 2aa66: 8f 90 pop r8 2aa68: 7f 90 pop r7 2aa6a: 6f 90 pop r6 2aa6c: 5f 90 pop r5 2aa6e: 4f 90 pop r4 2aa70: 3f 90 pop r3 2aa72: 2f 90 pop r2 2aa74: 08 95 ret #define DEFINE_PGM_READ_ANY(type, reader) \ static inline type pgm_read_any(const type *p) \ { return pgm_read_##reader##_near(p); } DEFINE_PGM_READ_ANY(float, float); DEFINE_PGM_READ_ANY(signed char, byte); 2aa76: e2 ef ldi r30, 0xF2 ; 242 2aa78: f8 e9 ldi r31, 0x98 ; 152 2aa7a: b4 91 lpm r27, Z 2aa7c: b9 83 std Y+1, r27 ; 0x01 { #ifdef TMC2130 FORCE_HIGH_POWER_START; #endif int axis_home_dir = home_dir(axis); current_position[axis] = 0; 2aa7e: 10 92 fd 11 sts 0x11FD, r1 ; 0x8011fd 2aa82: 10 92 fe 11 sts 0x11FE, r1 ; 0x8011fe 2aa86: 10 92 ff 11 sts 0x11FF, r1 ; 0x8011ff 2aa8a: 10 92 00 12 sts 0x1200, r1 ; 0x801200 plan_set_position_curposXYZE(); 2aa8e: 0f 94 30 83 call 0x30660 ; 0x30660 #define DEFINE_PGM_READ_ANY(type, reader) \ static inline type pgm_read_any(const type *p) \ { return pgm_read_##reader##_near(p); } DEFINE_PGM_READ_ANY(float, float); 2aa92: ec ee ldi r30, 0xEC ; 236 2aa94: f8 e9 ldi r31, 0x98 ; 152 2aa96: 85 90 lpm r8, Z+ 2aa98: 95 90 lpm r9, Z+ 2aa9a: a5 90 lpm r10, Z+ 2aa9c: b4 90 lpm r11, Z FORCE_HIGH_POWER_START; #endif int axis_home_dir = home_dir(axis); current_position[axis] = 0; plan_set_position_curposXYZE(); destination[axis] = 1.5 * max_length(axis) * axis_home_dir; 2aa9e: e9 81 ldd r30, Y+1 ; 0x01 2aaa0: 6e 2f mov r22, r30 2aaa2: ee 0f add r30, r30 2aaa4: 77 0b sbc r23, r23 2aaa6: 88 0b sbc r24, r24 2aaa8: 99 0b sbc r25, r25 2aaaa: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2aaae: 6b 01 movw r12, r22 2aab0: 7c 01 movw r14, r24 2aab2: 20 e0 ldi r18, 0x00 ; 0 2aab4: 30 e0 ldi r19, 0x00 ; 0 2aab6: 40 ec ldi r20, 0xC0 ; 192 2aab8: 5f e3 ldi r21, 0x3F ; 63 2aaba: c5 01 movw r24, r10 2aabc: b4 01 movw r22, r8 2aabe: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2aac2: a7 01 movw r20, r14 2aac4: 96 01 movw r18, r12 2aac6: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2aaca: 60 93 9b 06 sts 0x069B, r22 ; 0x80069b 2aace: 70 93 9c 06 sts 0x069C, r23 ; 0x80069c 2aad2: 80 93 9d 06 sts 0x069D, r24 ; 0x80069d 2aad6: 90 93 9e 06 sts 0x069E, r25 ; 0x80069e feedrate = homing_feedrate[axis]; 2aada: 80 e0 ldi r24, 0x00 ; 0 2aadc: 90 e0 ldi r25, 0x00 ; 0 2aade: a8 e4 ldi r26, 0x48 ; 72 2aae0: b4 e4 ldi r27, 0x44 ; 68 2aae2: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a 2aae6: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b 2aaea: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c 2aaee: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d float feedrate_mm_s = get_feedrate_mm_s(feedrate); 2aaf2: bc 01 movw r22, r24 2aaf4: cd 01 movw r24, r26 2aaf6: 0e 94 cd 5f call 0xbf9a ; 0xbf9a 2aafa: 4b 01 movw r8, r22 2aafc: 5c 01 movw r10, r24 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2aafe: 0f 94 3d 84 call 0x3087a ; 0x3087a st_synchronize(); 2ab02: 0f 94 42 22 call 0x24484 ; 0x24484 #ifdef TMC2130 check_Z_crash(); #endif //TMC2130 current_position[axis] = 0; 2ab06: 10 92 fd 11 sts 0x11FD, r1 ; 0x8011fd 2ab0a: 10 92 fe 11 sts 0x11FE, r1 ; 0x8011fe 2ab0e: 10 92 ff 11 sts 0x11FF, r1 ; 0x8011ff 2ab12: 10 92 00 12 sts 0x1200, r1 ; 0x801200 plan_set_position_curposXYZE(); 2ab16: 0f 94 30 83 call 0x30660 ; 0x30660 #define DEFINE_PGM_READ_ANY(type, reader) \ static inline type pgm_read_any(const type *p) \ { return pgm_read_##reader##_near(p); } DEFINE_PGM_READ_ANY(float, float); 2ab1a: 00 ee ldi r16, 0xE0 ; 224 2ab1c: 18 e9 ldi r17, 0x98 ; 152 2ab1e: f8 01 movw r30, r16 2ab20: 65 91 lpm r22, Z+ 2ab22: 75 91 lpm r23, Z+ 2ab24: 85 91 lpm r24, Z+ 2ab26: 94 91 lpm r25, Z #ifdef TMC2130 check_Z_crash(); #endif //TMC2130 current_position[axis] = 0; plan_set_position_curposXYZE(); destination[axis] = -home_retract_mm(axis) * axis_home_dir; 2ab28: 90 58 subi r25, 0x80 ; 128 2ab2a: a7 01 movw r20, r14 2ab2c: 96 01 movw r18, r12 2ab2e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2ab32: 60 93 9b 06 sts 0x069B, r22 ; 0x80069b 2ab36: 70 93 9c 06 sts 0x069C, r23 ; 0x80069c 2ab3a: 80 93 9d 06 sts 0x069D, r24 ; 0x80069d 2ab3e: 90 93 9e 06 sts 0x069E, r25 ; 0x80069e plan_buffer_line_destinationXYZE(feedrate_mm_s); 2ab42: c5 01 movw r24, r10 2ab44: b4 01 movw r22, r8 2ab46: 0f 94 3d 84 call 0x3087a ; 0x3087a st_synchronize(); 2ab4a: 0f 94 42 22 call 0x24484 ; 0x24484 #define DEFINE_PGM_READ_ANY(type, reader) \ static inline type pgm_read_any(const type *p) \ { return pgm_read_##reader##_near(p); } DEFINE_PGM_READ_ANY(float, float); 2ab4e: f8 01 movw r30, r16 2ab50: 65 91 lpm r22, Z+ 2ab52: 75 91 lpm r23, Z+ 2ab54: 85 91 lpm r24, Z+ 2ab56: 94 91 lpm r25, Z current_position[axis] = 0; plan_set_position_curposXYZE(); destination[axis] = -home_retract_mm(axis) * axis_home_dir; plan_buffer_line_destinationXYZE(feedrate_mm_s); st_synchronize(); destination[axis] = 2*home_retract_mm(axis) * axis_home_dir; 2ab58: 9b 01 movw r18, r22 2ab5a: ac 01 movw r20, r24 2ab5c: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2ab60: a7 01 movw r20, r14 2ab62: 96 01 movw r18, r12 2ab64: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2ab68: 60 93 9b 06 sts 0x069B, r22 ; 0x80069b 2ab6c: 70 93 9c 06 sts 0x069C, r23 ; 0x80069c 2ab70: 80 93 9d 06 sts 0x069D, r24 ; 0x80069d 2ab74: 90 93 9e 06 sts 0x069E, r25 ; 0x80069e feedrate = homing_feedrate[axis] / 2; 2ab78: 80 e0 ldi r24, 0x00 ; 0 2ab7a: 90 e0 ldi r25, 0x00 ; 0 2ab7c: a8 ec ldi r26, 0xC8 ; 200 2ab7e: b3 e4 ldi r27, 0x43 ; 67 2ab80: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a 2ab84: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b 2ab88: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c 2ab8c: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d feedrate_mm_s = get_feedrate_mm_s(feedrate); 2ab90: bc 01 movw r22, r24 2ab92: cd 01 movw r24, r26 2ab94: 0e 94 cd 5f call 0xbf9a ; 0xbf9a plan_buffer_line_destinationXYZE(feedrate_mm_s); 2ab98: 0f 94 3d 84 call 0x3087a ; 0x3087a st_synchronize(); 2ab9c: 0f 94 42 22 call 0x24484 ; 0x24484 #ifdef TMC2130 check_Z_crash(); #endif //TMC2130 axis_is_at_home(axis); 2aba0: 82 e0 ldi r24, 0x02 ; 2 2aba2: 0e 94 17 60 call 0xc02e ; 0xc02e destination[axis] = current_position[axis]; 2aba6: 80 91 fd 11 lds r24, 0x11FD ; 0x8011fd 2abaa: 90 91 fe 11 lds r25, 0x11FE ; 0x8011fe 2abae: a0 91 ff 11 lds r26, 0x11FF ; 0x8011ff 2abb2: b0 91 00 12 lds r27, 0x1200 ; 0x801200 2abb6: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b 2abba: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c 2abbe: a0 93 9d 06 sts 0x069D, r26 ; 0x80069d 2abc2: b0 93 9e 06 sts 0x069E, r27 ; 0x80069e feedrate = 0.0; 2abc6: 10 92 7a 02 sts 0x027A, r1 ; 0x80027a 2abca: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b 2abce: 10 92 7c 02 sts 0x027C, r1 ; 0x80027c 2abd2: 10 92 7d 02 sts 0x027D, r1 ; 0x80027d endstops_hit_on_purpose(); 2abd6: 0f 94 96 2c call 0x2592c ; 0x2592c axis_known_position[axis] = true; 2abda: f1 e0 ldi r31, 0x01 ; 1 2abdc: f0 93 a5 06 sts 0x06A5, r31 ; 0x8006a5 2abe0: 2e cf rjmp .-420 ; 0x2aa3e 0002abe2 : #ifdef MESH_BED_LEVELING mesh_bed_leveling mbl; void mesh_bed_leveling::reset() { active = 0; 2abe2: 10 92 9c 12 sts 0x129C, r1 ; 0x80129c memset(z_values, 0, sizeof(z_values)); 2abe6: ed e9 ldi r30, 0x9D ; 157 2abe8: f2 e1 ldi r31, 0x12 ; 18 2abea: 84 ec ldi r24, 0xC4 ; 196 2abec: df 01 movw r26, r30 2abee: 1d 92 st X+, r1 2abf0: 8a 95 dec r24 2abf2: e9 f7 brne .-6 ; 0x2abee } 2abf4: 08 95 ret 0002abf6 : plan_set_z_position(current_position[Z_AXIS]); } // At the current position, find the Z stop. bool find_bed_induction_sensor_point_z(float minimum_z, uint8_t n_iter, int 2abf6: 2f 92 push r2 2abf8: 3f 92 push r3 2abfa: 4f 92 push r4 2abfc: 5f 92 push r5 2abfe: 6f 92 push r6 2ac00: 7f 92 push r7 2ac02: 8f 92 push r8 2ac04: 9f 92 push r9 2ac06: af 92 push r10 2ac08: bf 92 push r11 2ac0a: cf 92 push r12 2ac0c: df 92 push r13 2ac0e: ef 92 push r14 2ac10: ff 92 push r15 2ac12: 0f 93 push r16 2ac14: 1f 93 push r17 2ac16: cf 93 push r28 2ac18: df 93 push r29 2ac1a: 00 d0 rcall .+0 ; 0x2ac1c 2ac1c: cd b7 in r28, 0x3d ; 61 2ac1e: de b7 in r29, 0x3e ; 62 2ac20: 4b 01 movw r8, r22 2ac22: 5c 01 movw r10, r24 2ac24: 04 2f mov r16, r20 verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; bedPWMDisabled = 1; 2ac26: 81 e0 ldi r24, 0x01 ; 1 2ac28: 80 93 92 06 sts 0x0692, r24 ; 0x800692 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 2ac2c: 20 91 77 02 lds r18, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.364> 2ac30: 29 83 std Y+1, r18 ; 0x01 check_endstops = check; 2ac32: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.364> //printf_P(PSTR("Min. Z: %f\n"), minimum_z); #ifdef SUPPORT_VERBOSITY if(verbosity_level >= 10) SERIAL_ECHOLNPGM("find bed induction sensor point z"); #endif // SUPPORT_VERBOSITY bool endstops_enabled = enable_endstops(true); bool endstop_z_enabled = enable_z_endstop(false); 2ac36: 80 e0 ldi r24, 0x00 ; 0 2ac38: 0f 94 7a 2c call 0x258f4 ; 0x258f4 2ac3c: 18 2f mov r17, r24 float z = 0.f; endstop_z_hit_on_purpose(); 2ac3e: 0f 94 88 2c call 0x25910 ; 0x25910 // move down until you find the bed current_position[Z_AXIS] = minimum_z; 2ac42: 80 92 fd 11 sts 0x11FD, r8 ; 0x8011fd 2ac46: 90 92 fe 11 sts 0x11FE, r9 ; 0x8011fe 2ac4a: a0 92 ff 11 sts 0x11FF, r10 ; 0x8011ff 2ac4e: b0 92 00 12 sts 0x1200, r11 ; 0x801200 go_to_current(homing_feedrate[Z_AXIS]/60); 2ac52: 65 e5 ldi r22, 0x55 ; 85 2ac54: 75 e5 ldi r23, 0x55 ; 85 2ac56: 85 e5 ldi r24, 0x55 ; 85 2ac58: 91 e4 ldi r25, 0x41 ; 65 2ac5a: 0f 94 22 87 call 0x30e44 ; 0x30e44 // we have to let the planner know where we are right now as it is not where we said to go. update_current_position_z(); 2ac5e: 0f 94 50 8d call 0x31aa0 ; 0x31aa0 if (! endstop_z_hit_on_purpose()) 2ac62: 0f 94 88 2c call 0x25910 ; 0x25910 2ac66: 8b 83 std Y+3, r24 ; 0x03 2ac68: 88 23 and r24, r24 2ac6a: 09 f4 brne .+2 ; 0x2ac6e 2ac6c: eb c0 rjmp .+470 ; 0x2ae44 { //printf_P(PSTR("crash detected 1, current_pos[Z]: %f \n"), current_position[Z_AXIS]); goto error; //crash Z detected } #endif //TMC2130 for (uint8_t i = 0; i < n_iter; ++ i) 2ac6e: 1a 82 std Y+2, r1 ; 0x02 #ifdef SUPPORT_VERBOSITY if(verbosity_level >= 10) SERIAL_ECHOLNPGM("find bed induction sensor point z"); #endif // SUPPORT_VERBOSITY bool endstops_enabled = enable_endstops(true); bool endstop_z_enabled = enable_z_endstop(false); float z = 0.f; 2ac70: c1 2c mov r12, r1 2ac72: d1 2c mov r13, r1 2ac74: 76 01 movw r14, r12 #ifdef SUPPORT_VERBOSITY verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; 2ac76: 31 2c mov r3, r1 { //printf_P(PSTR("crash detected 1, current_pos[Z]: %f \n"), current_position[Z_AXIS]); goto error; //crash Z detected } #endif //TMC2130 for (uint8_t i = 0; i < n_iter; ++ i) 2ac78: 8a 81 ldd r24, Y+2 ; 0x02 2ac7a: 80 17 cp r24, r16 2ac7c: 08 f0 brcs .+2 ; 0x2ac80 2ac7e: a4 c0 rjmp .+328 ; 0x2adc8 { current_position[Z_AXIS] += high_deviation_occured ? 0.5 : 0.2; 2ac80: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 2ac84: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 2ac88: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 2ac8c: 90 91 00 12 lds r25, 0x1200 ; 0x801200 2ac90: 20 e0 ldi r18, 0x00 ; 0 2ac92: 30 e0 ldi r19, 0x00 ; 0 2ac94: 40 e0 ldi r20, 0x00 ; 0 2ac96: 5f e3 ldi r21, 0x3F ; 63 2ac98: 31 10 cpse r3, r1 2ac9a: 04 c0 rjmp .+8 ; 0x2aca4 2ac9c: 2d ec ldi r18, 0xCD ; 205 2ac9e: 3c ec ldi r19, 0xCC ; 204 2aca0: 4c e4 ldi r20, 0x4C ; 76 2aca2: 5e e3 ldi r21, 0x3E ; 62 2aca4: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2aca8: 2b 01 movw r4, r22 2acaa: 3c 01 movw r6, r24 2acac: 40 92 fd 11 sts 0x11FD, r4 ; 0x8011fd 2acb0: 50 92 fe 11 sts 0x11FE, r5 ; 0x8011fe 2acb4: 60 92 ff 11 sts 0x11FF, r6 ; 0x8011ff 2acb8: 70 92 00 12 sts 0x1200, r7 ; 0x801200 float z_bckp = current_position[Z_AXIS]; go_to_current(homing_feedrate[Z_AXIS]/60); 2acbc: 65 e5 ldi r22, 0x55 ; 85 2acbe: 75 e5 ldi r23, 0x55 ; 85 2acc0: 85 e5 ldi r24, 0x55 ; 85 2acc2: 91 e4 ldi r25, 0x41 ; 65 2acc4: 0f 94 22 87 call 0x30e44 ; 0x30e44 // Move back down slowly to find bed. current_position[Z_AXIS] = minimum_z; 2acc8: 80 92 fd 11 sts 0x11FD, r8 ; 0x8011fd 2accc: 90 92 fe 11 sts 0x11FE, r9 ; 0x8011fe 2acd0: a0 92 ff 11 sts 0x11FF, r10 ; 0x8011ff 2acd4: b0 92 00 12 sts 0x1200, r11 ; 0x801200 //printf_P(PSTR("init Z = %f, min_z = %f, i = %d\n"), z_bckp, minimum_z, i); go_to_current(homing_feedrate[Z_AXIS]/(4*60)); 2acd8: 65 e5 ldi r22, 0x55 ; 85 2acda: 75 e5 ldi r23, 0x55 ; 85 2acdc: 85 e5 ldi r24, 0x55 ; 85 2acde: 90 e4 ldi r25, 0x40 ; 64 2ace0: 0f 94 22 87 call 0x30e44 ; 0x30e44 // we have to let the planner know where we are right now as it is not where we said to go. update_current_position_z(); 2ace4: 0f 94 50 8d call 0x31aa0 ; 0x31aa0 //printf_P(PSTR("Zs: %f, Z: %f, delta Z: %f"), z_bckp, current_position[Z_AXIS], (z_bckp - current_position[Z_AXIS])); if (fabs(current_position[Z_AXIS] - z_bckp) < 0.025) { 2ace8: a3 01 movw r20, r6 2acea: 92 01 movw r18, r4 2acec: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 2acf0: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 2acf4: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 2acf8: 90 91 00 12 lds r25, 0x1200 ; 0x801200 2acfc: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 2ad00: 9f 77 andi r25, 0x7F ; 127 2ad02: 2d ec ldi r18, 0xCD ; 205 2ad04: 3c ec ldi r19, 0xCC ; 204 2ad06: 4c ec ldi r20, 0xCC ; 204 2ad08: 5c e3 ldi r21, 0x3C ; 60 2ad0a: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 2ad0e: 87 ff sbrs r24, 7 2ad10: 16 c0 rjmp .+44 ; 0x2ad3e //printf_P(PSTR("PINDA triggered immediately, move Z higher and repeat measurement\n")); raise_z(0.5); 2ad12: 60 e0 ldi r22, 0x00 ; 0 2ad14: 70 e0 ldi r23, 0x00 ; 0 2ad16: 80 e0 ldi r24, 0x00 ; 0 2ad18: 9f e3 ldi r25, 0x3F ; 63 2ad1a: 0e 94 dd 66 call 0xcdba ; 0xcdba current_position[Z_AXIS] = minimum_z; 2ad1e: 80 92 fd 11 sts 0x11FD, r8 ; 0x8011fd 2ad22: 90 92 fe 11 sts 0x11FE, r9 ; 0x8011fe 2ad26: a0 92 ff 11 sts 0x11FF, r10 ; 0x8011ff 2ad2a: b0 92 00 12 sts 0x1200, r11 ; 0x801200 go_to_current(homing_feedrate[Z_AXIS]/(4*60)); 2ad2e: 65 e5 ldi r22, 0x55 ; 85 2ad30: 75 e5 ldi r23, 0x55 ; 85 2ad32: 85 e5 ldi r24, 0x55 ; 85 2ad34: 90 e4 ldi r25, 0x40 ; 64 2ad36: 0f 94 22 87 call 0x30e44 ; 0x30e44 // we have to let the planner know where we are right now as it is not where we said to go. update_current_position_z(); 2ad3a: 0f 94 50 8d call 0x31aa0 ; 0x31aa0 } if (!endstop_z_hit_on_purpose()) 2ad3e: 0f 94 88 2c call 0x25910 ; 0x25910 2ad42: 28 2e mov r2, r24 2ad44: 88 23 and r24, r24 2ad46: 09 f4 brne .+2 ; 0x2ad4a 2ad48: 7d c0 rjmp .+250 ; 0x2ae44 2ad4a: 40 90 fd 11 lds r4, 0x11FD ; 0x8011fd 2ad4e: 50 90 fe 11 lds r5, 0x11FE ; 0x8011fe 2ad52: 60 90 ff 11 lds r6, 0x11FF ; 0x8011ff 2ad56: 70 90 00 12 lds r7, 0x1200 ; 0x801200 } #endif //TMC2130 // SERIAL_ECHOPGM("Bed find_bed_induction_sensor_point_z low, height: "); // MYSERIAL.print(current_position[Z_AXIS], 5); // SERIAL_ECHOLNPGM(""); float dz = i?fabs(current_position[Z_AXIS] - (z / i)):0; 2ad5a: 9a 81 ldd r25, Y+2 ; 0x02 2ad5c: 99 23 and r25, r25 2ad5e: d9 f0 breq .+54 ; 0x2ad96 2ad60: 69 2f mov r22, r25 2ad62: 70 e0 ldi r23, 0x00 ; 0 2ad64: 90 e0 ldi r25, 0x00 ; 0 2ad66: 80 e0 ldi r24, 0x00 ; 0 2ad68: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2ad6c: 9b 01 movw r18, r22 2ad6e: ac 01 movw r20, r24 2ad70: c7 01 movw r24, r14 2ad72: b6 01 movw r22, r12 2ad74: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2ad78: 9b 01 movw r18, r22 2ad7a: ac 01 movw r20, r24 2ad7c: c3 01 movw r24, r6 2ad7e: b2 01 movw r22, r4 2ad80: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 2ad84: 9f 77 andi r25, 0x7F ; 127 z += current_position[Z_AXIS]; //printf_P(PSTR("Z[%d] = %d, dz=%d\n"), i, (int)(current_position[Z_AXIS] * 1000), (int)(dz * 1000)); //printf_P(PSTR("Z- measurement deviation from avg value %f um\n"), dz); if (dz > 0.05) { //deviation > 50um 2ad86: 2d ec ldi r18, 0xCD ; 205 2ad88: 3c ec ldi r19, 0xCC ; 204 2ad8a: 4c e4 ldi r20, 0x4C ; 76 2ad8c: 5d e3 ldi r21, 0x3D ; 61 2ad8e: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 2ad92: 18 16 cp r1, r24 2ad94: 64 f0 brlt .+24 ; 0x2adae #endif //TMC2130 // SERIAL_ECHOPGM("Bed find_bed_induction_sensor_point_z low, height: "); // MYSERIAL.print(current_position[Z_AXIS], 5); // SERIAL_ECHOLNPGM(""); float dz = i?fabs(current_position[Z_AXIS] - (z / i)):0; z += current_position[Z_AXIS]; 2ad96: a3 01 movw r20, r6 2ad98: 92 01 movw r18, r4 2ad9a: c7 01 movw r24, r14 2ad9c: b6 01 movw r22, r12 2ad9e: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2ada2: 6b 01 movw r12, r22 2ada4: 7c 01 movw r14, r24 { //printf_P(PSTR("crash detected 1, current_pos[Z]: %f \n"), current_position[Z_AXIS]); goto error; //crash Z detected } #endif //TMC2130 for (uint8_t i = 0; i < n_iter; ++ i) 2ada6: 8a 81 ldd r24, Y+2 ; 0x02 2ada8: 8f 5f subi r24, 0xFF ; 255 2adaa: 8a 83 std Y+2, r24 ; 0x02 2adac: 65 cf rjmp .-310 ; 0x2ac78 float dz = i?fabs(current_position[Z_AXIS] - (z / i)):0; z += current_position[Z_AXIS]; //printf_P(PSTR("Z[%d] = %d, dz=%d\n"), i, (int)(current_position[Z_AXIS] * 1000), (int)(dz * 1000)); //printf_P(PSTR("Z- measurement deviation from avg value %f um\n"), dz); if (dz > 0.05) { //deviation > 50um if (high_deviation_occured == false) { //first occurence may be caused in some cases by mechanic resonance probably especially if printer is placed on unstable surface 2adae: 31 10 cpse r3, r1 2adb0: 49 c0 rjmp .+146 ; 0x2ae44 //printf_P(PSTR("high dev. first occurence\n")); delay_keep_alive(500); //damping 2adb2: 84 ef ldi r24, 0xF4 ; 244 2adb4: 91 e0 ldi r25, 0x01 ; 1 2adb6: 0e 94 48 7c call 0xf890 ; 0xf890 //start measurement from the begining, but this time with higher movements in Z axis which should help to reduce mechanical resonance high_deviation_occured = true; 2adba: 32 2c mov r3, r2 i = -1; 2adbc: 2f ef ldi r18, 0xFF ; 255 2adbe: 2a 83 std Y+2, r18 ; 0x02 z = 0; 2adc0: c1 2c mov r12, r1 2adc2: d1 2c mov r13, r1 2adc4: 76 01 movw r14, r12 2adc6: ef cf rjmp .-34 ; 0x2ada6 } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; if (n_iter > 1) 2adc8: 02 30 cpi r16, 0x02 ; 2 2adca: 38 f5 brcc .+78 ; 0x2ae1a goto error; } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; 2adcc: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 2add0: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 2add4: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 2add8: f0 92 00 12 sts 0x1200, r15 ; 0x801200 2addc: 99 81 ldd r25, Y+1 ; 0x01 2adde: 90 93 77 02 sts 0x0277, r25 ; 0x800277 <_ZL14check_endstops.lto_priv.364> if (n_iter > 1) current_position[Z_AXIS] /= float(n_iter); enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 2ade2: 81 2f mov r24, r17 2ade4: 0f 94 7a 2c call 0x258f4 ; 0x258f4 // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 3"); #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; 2ade8: 10 92 92 06 sts 0x0692, r1 ; 0x800692 #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; return false; } 2adec: 8b 81 ldd r24, Y+3 ; 0x03 2adee: 0f 90 pop r0 2adf0: 0f 90 pop r0 2adf2: 0f 90 pop r0 2adf4: df 91 pop r29 2adf6: cf 91 pop r28 2adf8: 1f 91 pop r17 2adfa: 0f 91 pop r16 2adfc: ff 90 pop r15 2adfe: ef 90 pop r14 2ae00: df 90 pop r13 2ae02: cf 90 pop r12 2ae04: bf 90 pop r11 2ae06: af 90 pop r10 2ae08: 9f 90 pop r9 2ae0a: 8f 90 pop r8 2ae0c: 7f 90 pop r7 2ae0e: 6f 90 pop r6 2ae10: 5f 90 pop r5 2ae12: 4f 90 pop r4 2ae14: 3f 90 pop r3 2ae16: 2f 90 pop r2 2ae18: 08 95 ret } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; if (n_iter > 1) current_position[Z_AXIS] /= float(n_iter); 2ae1a: 60 2f mov r22, r16 2ae1c: 70 e0 ldi r23, 0x00 ; 0 2ae1e: 90 e0 ldi r25, 0x00 ; 0 2ae20: 80 e0 ldi r24, 0x00 ; 0 2ae22: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 2ae26: 9b 01 movw r18, r22 2ae28: ac 01 movw r20, r24 2ae2a: c7 01 movw r24, r14 2ae2c: b6 01 movw r22, r12 2ae2e: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2ae32: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 2ae36: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 2ae3a: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 2ae3e: 90 93 00 12 sts 0x1200, r25 ; 0x801200 2ae42: cc cf rjmp .-104 ; 0x2addc 2ae44: 29 81 ldd r18, Y+1 ; 0x01 2ae46: 20 93 77 02 sts 0x0277, r18 ; 0x800277 <_ZL14check_endstops.lto_priv.364> return true; error: // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 4"); enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 2ae4a: 81 2f mov r24, r17 2ae4c: 0f 94 7a 2c call 0x258f4 ; 0x258f4 #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; 2ae50: 10 92 92 06 sts 0x0692, r1 ; 0x800692 return false; 2ae54: 1b 82 std Y+3, r1 ; 0x03 2ae56: ca cf rjmp .-108 ; 0x2adec 0002ae58 : /// Searches for circle iteratively /// Uses points on the perimeter. If point is high it pushes circle out of the center (shift or change of radius), /// otherwise to the center. /// Algorithm is stopped after fixed number of iterations. Move is limited to 0.5 px per iteration. void dynamic_circle(uint8_t *matrix_32x32, float &x, float &y, float &r, uint8_t iterations){ 2ae58: 2f 92 push r2 2ae5a: 3f 92 push r3 2ae5c: 4f 92 push r4 2ae5e: 5f 92 push r5 2ae60: 6f 92 push r6 2ae62: 7f 92 push r7 2ae64: 8f 92 push r8 2ae66: 9f 92 push r9 2ae68: af 92 push r10 2ae6a: bf 92 push r11 2ae6c: cf 92 push r12 2ae6e: df 92 push r13 2ae70: ef 92 push r14 2ae72: ff 92 push r15 2ae74: 0f 93 push r16 2ae76: 1f 93 push r17 2ae78: cf 93 push r28 2ae7a: df 93 push r29 2ae7c: cd b7 in r28, 0x3d ; 61 2ae7e: de b7 in r29, 0x3e ; 62 2ae80: cd 5b subi r28, 0xBD ; 189 2ae82: d1 40 sbci r29, 0x01 ; 1 2ae84: 0f b6 in r0, 0x3f ; 63 2ae86: f8 94 cli 2ae88: de bf out 0x3e, r29 ; 62 2ae8a: 0f be out 0x3f, r0 ; 63 2ae8c: cd bf out 0x3d, r28 ; 61 2ae8e: c3 57 subi r28, 0x73 ; 115 2ae90: de 4f sbci r29, 0xFE ; 254 2ae92: 99 83 std Y+1, r25 ; 0x01 2ae94: 88 83 st Y, r24 2ae96: cd 58 subi r28, 0x8D ; 141 2ae98: d1 40 sbci r29, 0x01 ; 1 2ae9a: c1 57 subi r28, 0x71 ; 113 2ae9c: de 4f sbci r29, 0xFE ; 254 2ae9e: 79 83 std Y+1, r23 ; 0x01 2aea0: 68 83 st Y, r22 2aea2: cf 58 subi r28, 0x8F ; 143 2aea4: d1 40 sbci r29, 0x01 ; 1 2aea6: ce 56 subi r28, 0x6E ; 110 2aea8: de 4f sbci r29, 0xFE ; 254 2aeaa: 59 83 std Y+1, r21 ; 0x01 2aeac: 48 83 st Y, r20 2aeae: c2 59 subi r28, 0x92 ; 146 2aeb0: d1 40 sbci r29, 0x01 ; 1 2aeb2: 84 e1 ldi r24, 0x14 ; 20 2aeb4: cf 56 subi r28, 0x6F ; 111 2aeb6: de 4f sbci r29, 0xFE ; 254 2aeb8: 88 83 st Y, r24 2aeba: c1 59 subi r28, 0x91 ; 145 2aebc: d1 40 sbci r29, 0x01 ; 1 // DBG(_n(" [%f, %f][%f] circle\n"), x, y, r); /// read points on the circle for (uint8_t p = 0; p < num_points; ++p){ const float angle = p * pi_2_div_num_points; const float height = get_value(matrix_32x32, r * cos(angle) + x, r * sin(angle) + y) - target_z; 2aebe: ce 56 subi r28, 0x6E ; 110 2aec0: de 4f sbci r29, 0xFE ; 254 2aec2: a8 81 ld r26, Y 2aec4: b9 81 ldd r27, Y+1 ; 0x01 2aec6: c2 59 subi r28, 0x92 ; 146 2aec8: d1 40 sbci r29, 0x01 ; 1 2aeca: 8d 91 ld r24, X+ 2aecc: 9d 91 ld r25, X+ 2aece: 0d 90 ld r0, X+ 2aed0: bc 91 ld r27, X 2aed2: a0 2d mov r26, r0 2aed4: c6 56 subi r28, 0x66 ; 102 2aed6: de 4f sbci r29, 0xFE ; 254 2aed8: 88 83 st Y, r24 2aeda: 99 83 std Y+1, r25 ; 0x01 2aedc: aa 83 std Y+2, r26 ; 0x02 2aede: bb 83 std Y+3, r27 ; 0x03 2aee0: ca 59 subi r28, 0x9A ; 154 2aee2: d1 40 sbci r29, 0x01 ; 1 2aee4: c1 57 subi r28, 0x71 ; 113 2aee6: de 4f sbci r29, 0xFE ; 254 2aee8: a8 81 ld r26, Y 2aeea: b9 81 ldd r27, Y+1 ; 0x01 2aeec: cf 58 subi r28, 0x8F ; 143 2aeee: d1 40 sbci r29, 0x01 ; 1 2aef0: 8d 91 ld r24, X+ 2aef2: 9d 91 ld r25, X+ 2aef4: 0d 90 ld r0, X+ 2aef6: bc 91 ld r27, X 2aef8: a0 2d mov r26, r0 2aefa: ca 54 subi r28, 0x4A ; 74 2aefc: de 4f sbci r29, 0xFE ; 254 2aefe: 88 83 st Y, r24 2af00: 99 83 std Y+1, r25 ; 0x01 2af02: aa 83 std Y+2, r26 ; 0x02 2af04: bb 83 std Y+3, r27 ; 0x03 2af06: c6 5b subi r28, 0xB6 ; 182 2af08: d1 40 sbci r29, 0x01 ; 1 2af0a: c3 57 subi r28, 0x73 ; 115 2af0c: de 4f sbci r29, 0xFE ; 254 2af0e: a8 81 ld r26, Y 2af10: b9 81 ldd r27, Y+1 ; 0x01 2af12: cd 58 subi r28, 0x8D ; 141 2af14: d1 40 sbci r29, 0x01 ; 1 2af16: 8d 91 ld r24, X+ 2af18: 9d 91 ld r25, X+ 2af1a: 0d 90 ld r0, X+ 2af1c: bc 91 ld r27, X 2af1e: a0 2d mov r26, r0 2af20: c6 54 subi r28, 0x46 ; 70 2af22: de 4f sbci r29, 0xFE ; 254 2af24: 88 83 st Y, r24 2af26: 99 83 std Y+1, r25 ; 0x01 2af28: aa 83 std Y+2, r26 ; 0x02 2af2a: bb 83 std Y+3, r27 ; 0x03 2af2c: ca 5b subi r28, 0xBA ; 186 2af2e: d1 40 sbci r29, 0x01 ; 1 2af30: fe 01 movw r30, r28 2af32: e7 5f subi r30, 0xF7 ; 247 2af34: fe 4f sbci r31, 0xFE ; 254 2af36: c8 55 subi r28, 0x58 ; 88 2af38: de 4f sbci r29, 0xFE ; 254 2af3a: f9 83 std Y+1, r31 ; 0x01 2af3c: e8 83 st Y, r30 2af3e: c8 5a subi r28, 0xA8 ; 168 2af40: d1 40 sbci r29, 0x01 ; 1 2af42: ce 01 movw r24, r28 2af44: 8b 57 subi r24, 0x7B ; 123 2af46: 9f 4f sbci r25, 0xFF ; 255 2af48: ca 55 subi r28, 0x5A ; 90 2af4a: de 4f sbci r29, 0xFE ; 254 2af4c: 99 83 std Y+1, r25 ; 0x01 2af4e: 88 83 st Y, r24 2af50: c6 5a subi r28, 0xA6 ; 166 2af52: d1 40 sbci r29, 0x01 ; 1 2af54: de 01 movw r26, r28 2af56: 11 96 adiw r26, 0x01 ; 1 2af58: c8 56 subi r28, 0x68 ; 104 2af5a: de 4f sbci r29, 0xFE ; 254 2af5c: b9 83 std Y+1, r27 ; 0x01 2af5e: a8 83 st Y, r26 2af60: c8 59 subi r28, 0x98 ; 152 2af62: d1 40 sbci r29, 0x01 ; 1 2af64: 31 2c mov r3, r1 2af66: 21 2c mov r2, r1 //@size=128B // DBG(_n(" [%f, %f][%f] circle\n"), x, y, r); /// read points on the circle for (uint8_t p = 0; p < num_points; ++p){ const float angle = p * pi_2_div_num_points; 2af68: b1 01 movw r22, r2 2af6a: 03 2c mov r0, r3 2af6c: 00 0c add r0, r0 2af6e: 88 0b sbc r24, r24 2af70: 99 0b sbc r25, r25 2af72: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2af76: 2a e1 ldi r18, 0x1A ; 26 2af78: 38 ef ldi r19, 0xF8 ; 248 2af7a: 42 e4 ldi r20, 0x42 ; 66 2af7c: 5e e3 ldi r21, 0x3E ; 62 2af7e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2af82: 6b 01 movw r12, r22 2af84: 7c 01 movw r14, r24 const float height = get_value(matrix_32x32, r * cos(angle) + x, r * sin(angle) + y) - target_z; 2af86: 0f 94 c4 a4 call 0x34988 ; 0x34988 2af8a: c2 56 subi r28, 0x62 ; 98 2af8c: de 4f sbci r29, 0xFE ; 254 2af8e: 68 83 st Y, r22 2af90: 79 83 std Y+1, r23 ; 0x01 2af92: 8a 83 std Y+2, r24 ; 0x02 2af94: 9b 83 std Y+3, r25 ; 0x03 2af96: ce 59 subi r28, 0x9E ; 158 2af98: d1 40 sbci r29, 0x01 ; 1 2af9a: c7 01 movw r24, r14 2af9c: b6 01 movw r22, r12 2af9e: 0f 94 fe a1 call 0x343fc ; 0x343fc 2afa2: ce 55 subi r28, 0x5E ; 94 2afa4: de 4f sbci r29, 0xFE ; 254 2afa6: 68 83 st Y, r22 2afa8: 79 83 std Y+1, r23 ; 0x01 2afaa: 8a 83 std Y+2, r24 ; 0x02 2afac: 9b 83 std Y+3, r25 ; 0x03 2afae: c2 5a subi r28, 0xA2 ; 162 2afb0: d1 40 sbci r29, 0x01 ; 1 2afb2: 9b 01 movw r18, r22 2afb4: ac 01 movw r20, r24 2afb6: c6 56 subi r28, 0x66 ; 102 2afb8: de 4f sbci r29, 0xFE ; 254 2afba: 68 81 ld r22, Y 2afbc: 79 81 ldd r23, Y+1 ; 0x01 2afbe: 8a 81 ldd r24, Y+2 ; 0x02 2afc0: 9b 81 ldd r25, Y+3 ; 0x03 2afc2: ca 59 subi r28, 0x9A ; 154 2afc4: d1 40 sbci r29, 0x01 ; 1 2afc6: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2afca: c6 54 subi r28, 0x46 ; 70 2afcc: de 4f sbci r29, 0xFE ; 254 2afce: 28 81 ld r18, Y 2afd0: 39 81 ldd r19, Y+1 ; 0x01 2afd2: 4a 81 ldd r20, Y+2 ; 0x02 2afd4: 5b 81 ldd r21, Y+3 ; 0x03 2afd6: ca 5b subi r28, 0xBA ; 186 2afd8: d1 40 sbci r29, 0x01 ; 1 2afda: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2afde: 6b 01 movw r12, r22 2afe0: 7c 01 movw r14, r24 } /// returns value of any location within data /// uses bilinear interpolation float get_value(uint8_t * matrix_32x32, float c, float r){ if (c <= 0 || r <= 0 || c >= 31 || r >= 31) 2afe2: 20 e0 ldi r18, 0x00 ; 0 2afe4: 30 e0 ldi r19, 0x00 ; 0 2afe6: a9 01 movw r20, r18 2afe8: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 2afec: 18 16 cp r1, r24 2afee: 0c f0 brlt .+2 ; 0x2aff2 2aff0: 7a c2 rjmp .+1268 ; 0x2b4e6 // DBG(_n(" [%f, %f][%f] circle\n"), x, y, r); /// read points on the circle for (uint8_t p = 0; p < num_points; ++p){ const float angle = p * pi_2_div_num_points; const float height = get_value(matrix_32x32, r * cos(angle) + x, r * sin(angle) + y) - target_z; 2aff2: c2 56 subi r28, 0x62 ; 98 2aff4: de 4f sbci r29, 0xFE ; 254 2aff6: 28 81 ld r18, Y 2aff8: 39 81 ldd r19, Y+1 ; 0x01 2affa: 4a 81 ldd r20, Y+2 ; 0x02 2affc: 5b 81 ldd r21, Y+3 ; 0x03 2affe: ce 59 subi r28, 0x9E ; 158 2b000: d1 40 sbci r29, 0x01 ; 1 2b002: c6 56 subi r28, 0x66 ; 102 2b004: de 4f sbci r29, 0xFE ; 254 2b006: 68 81 ld r22, Y 2b008: 79 81 ldd r23, Y+1 ; 0x01 2b00a: 8a 81 ldd r24, Y+2 ; 0x02 2b00c: 9b 81 ldd r25, Y+3 ; 0x03 2b00e: ca 59 subi r28, 0x9A ; 154 2b010: d1 40 sbci r29, 0x01 ; 1 2b012: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2b016: ca 54 subi r28, 0x4A ; 74 2b018: de 4f sbci r29, 0xFE ; 254 2b01a: 28 81 ld r18, Y 2b01c: 39 81 ldd r19, Y+1 ; 0x01 2b01e: 4a 81 ldd r20, Y+2 ; 0x02 2b020: 5b 81 ldd r21, Y+3 ; 0x03 2b022: c6 5b subi r28, 0xB6 ; 182 2b024: d1 40 sbci r29, 0x01 ; 1 2b026: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2b02a: 4b 01 movw r8, r22 2b02c: 5c 01 movw r10, r24 } /// returns value of any location within data /// uses bilinear interpolation float get_value(uint8_t * matrix_32x32, float c, float r){ if (c <= 0 || r <= 0 || c >= 31 || r >= 31) 2b02e: 20 e0 ldi r18, 0x00 ; 0 2b030: 30 e0 ldi r19, 0x00 ; 0 2b032: a9 01 movw r20, r18 2b034: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 2b038: 18 16 cp r1, r24 2b03a: 0c f0 brlt .+2 ; 0x2b03e 2b03c: 54 c2 rjmp .+1192 ; 0x2b4e6 2b03e: 20 e0 ldi r18, 0x00 ; 0 2b040: 30 e0 ldi r19, 0x00 ; 0 2b042: 48 ef ldi r20, 0xF8 ; 248 2b044: 51 e4 ldi r21, 0x41 ; 65 2b046: c7 01 movw r24, r14 2b048: b6 01 movw r22, r12 2b04a: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 2b04e: 87 ff sbrs r24, 7 2b050: 4a c2 rjmp .+1172 ; 0x2b4e6 2b052: 20 e0 ldi r18, 0x00 ; 0 2b054: 30 e0 ldi r19, 0x00 ; 0 2b056: 48 ef ldi r20, 0xF8 ; 248 2b058: 51 e4 ldi r21, 0x41 ; 65 2b05a: c5 01 movw r24, r10 2b05c: b4 01 movw r22, r8 2b05e: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 2b062: 87 ff sbrs r24, 7 2b064: 40 c2 rjmp .+1152 ; 0x2b4e6 return 0; /// calculate weights of nearby points const float wc1 = c - floor(c); 2b066: c7 01 movw r24, r14 2b068: b6 01 movw r22, r12 2b06a: 0f 94 ab a2 call 0x34556 ; 0x34556 2b06e: 9b 01 movw r18, r22 2b070: ac 01 movw r20, r24 2b072: c7 01 movw r24, r14 2b074: b6 01 movw r22, r12 2b076: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 2b07a: 2b 01 movw r4, r22 2b07c: 3c 01 movw r6, r24 const float wr1 = r - floor(r); 2b07e: c5 01 movw r24, r10 2b080: b4 01 movw r22, r8 2b082: 0f 94 ab a2 call 0x34556 ; 0x34556 2b086: 9b 01 movw r18, r22 2b088: ac 01 movw r20, r24 2b08a: c5 01 movw r24, r10 2b08c: b4 01 movw r22, r8 2b08e: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 2b092: cc 56 subi r28, 0x6C ; 108 2b094: de 4f sbci r29, 0xFE ; 254 2b096: 68 83 st Y, r22 2b098: 79 83 std Y+1, r23 ; 0x01 2b09a: 8a 83 std Y+2, r24 ; 0x02 2b09c: 9b 83 std Y+3, r25 ; 0x03 2b09e: c4 59 subi r28, 0x94 ; 148 2b0a0: d1 40 sbci r29, 0x01 ; 1 const float wc0 = 1 - wc1; 2b0a2: a3 01 movw r20, r6 2b0a4: 92 01 movw r18, r4 2b0a6: 60 e0 ldi r22, 0x00 ; 0 2b0a8: 70 e0 ldi r23, 0x00 ; 0 2b0aa: 80 e8 ldi r24, 0x80 ; 128 2b0ac: 9f e3 ldi r25, 0x3F ; 63 2b0ae: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 2b0b2: c2 55 subi r28, 0x52 ; 82 2b0b4: de 4f sbci r29, 0xFE ; 254 2b0b6: 68 83 st Y, r22 2b0b8: 79 83 std Y+1, r23 ; 0x01 2b0ba: 8a 83 std Y+2, r24 ; 0x02 2b0bc: 9b 83 std Y+3, r25 ; 0x03 2b0be: ce 5a subi r28, 0xAE ; 174 2b0c0: d1 40 sbci r29, 0x01 ; 1 const float wr0 = 1 - wr1; 2b0c2: cc 56 subi r28, 0x6C ; 108 2b0c4: de 4f sbci r29, 0xFE ; 254 2b0c6: 28 81 ld r18, Y 2b0c8: 39 81 ldd r19, Y+1 ; 0x01 2b0ca: 4a 81 ldd r20, Y+2 ; 0x02 2b0cc: 5b 81 ldd r21, Y+3 ; 0x03 2b0ce: c4 59 subi r28, 0x94 ; 148 2b0d0: d1 40 sbci r29, 0x01 ; 1 2b0d2: 60 e0 ldi r22, 0x00 ; 0 2b0d4: 70 e0 ldi r23, 0x00 ; 0 2b0d6: 80 e8 ldi r24, 0x80 ; 128 2b0d8: 9f e3 ldi r25, 0x3F ; 63 2b0da: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 2b0de: ce 54 subi r28, 0x4E ; 78 2b0e0: de 4f sbci r29, 0xFE ; 254 2b0e2: 68 83 st Y, r22 2b0e4: 79 83 std Y+1, r23 ; 0x01 2b0e6: 8a 83 std Y+2, r24 ; 0x02 2b0e8: 9b 83 std Y+3, r25 ; 0x03 2b0ea: c2 5b subi r28, 0xB2 ; 178 2b0ec: d1 40 sbci r29, 0x01 ; 1 const float w00 = wc0 * wr0; const float w01 = wc0 * wr1; const float w10 = wc1 * wr0; const float w11 = wc1 * wr1; const uint16_t c0 = c; 2b0ee: c7 01 movw r24, r14 2b0f0: b6 01 movw r22, r12 2b0f2: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 2b0f6: 6b 01 movw r12, r22 const uint16_t c1 = c0 + 1; 2b0f8: fb 01 movw r30, r22 2b0fa: 31 96 adiw r30, 0x01 ; 1 2b0fc: c6 55 subi r28, 0x56 ; 86 2b0fe: de 4f sbci r29, 0xFE ; 254 2b100: f9 83 std Y+1, r31 ; 0x01 2b102: e8 83 st Y, r30 2b104: ca 5a subi r28, 0xAA ; 170 2b106: d1 40 sbci r29, 0x01 ; 1 const uint16_t r0 = r; 2b108: c5 01 movw r24, r10 2b10a: b4 01 movw r22, r8 2b10c: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> const uint16_t r1 = r0 + 1; const uint16_t idx00 = c0 + 32 * r0; 2b110: 8b 01 movw r16, r22 2b112: 95 e0 ldi r25, 0x05 ; 5 2b114: 00 0f add r16, r16 2b116: 11 1f adc r17, r17 2b118: 9a 95 dec r25 2b11a: e1 f7 brne .-8 ; 0x2b114 const uint16_t idx01 = c0 + 32 * r1; 2b11c: c8 01 movw r24, r16 2b11e: 80 96 adiw r24, 0x20 ; 32 2b120: c4 55 subi r28, 0x54 ; 84 2b122: de 4f sbci r29, 0xFE ; 254 2b124: 99 83 std Y+1, r25 ; 0x01 2b126: 88 83 st Y, r24 2b128: cc 5a subi r28, 0xAC ; 172 2b12a: d1 40 sbci r29, 0x01 ; 1 const uint16_t idx10 = c1 + 32 * r0; const uint16_t idx11 = c1 + 32 * r1; /// bilinear resampling return w00 * matrix_32x32[idx00] + w01 * matrix_32x32[idx01] + w10 * matrix_32x32[idx10] + w11 * matrix_32x32[idx11]; 2b12c: f8 01 movw r30, r16 2b12e: ec 0d add r30, r12 2b130: fd 1d adc r31, r13 2b132: e8 53 subi r30, 0x38 ; 56 2b134: f9 4f sbci r31, 0xF9 ; 249 2b136: 60 81 ld r22, Z 2b138: 70 e0 ldi r23, 0x00 ; 0 2b13a: 90 e0 ldi r25, 0x00 ; 0 2b13c: 80 e0 ldi r24, 0x00 ; 0 2b13e: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2b142: 4b 01 movw r8, r22 2b144: 5c 01 movw r10, r24 const float wc1 = c - floor(c); const float wr1 = r - floor(r); const float wc0 = 1 - wc1; const float wr0 = 1 - wr1; const float w00 = wc0 * wr0; 2b146: ce 54 subi r28, 0x4E ; 78 2b148: de 4f sbci r29, 0xFE ; 254 2b14a: 28 81 ld r18, Y 2b14c: 39 81 ldd r19, Y+1 ; 0x01 2b14e: 4a 81 ldd r20, Y+2 ; 0x02 2b150: 5b 81 ldd r21, Y+3 ; 0x03 2b152: c2 5b subi r28, 0xB2 ; 178 2b154: d1 40 sbci r29, 0x01 ; 1 2b156: c2 55 subi r28, 0x52 ; 82 2b158: de 4f sbci r29, 0xFE ; 254 2b15a: 68 81 ld r22, Y 2b15c: 79 81 ldd r23, Y+1 ; 0x01 2b15e: 8a 81 ldd r24, Y+2 ; 0x02 2b160: 9b 81 ldd r25, Y+3 ; 0x03 2b162: ce 5a subi r28, 0xAE ; 174 2b164: d1 40 sbci r29, 0x01 ; 1 2b166: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2b16a: 9b 01 movw r18, r22 2b16c: ac 01 movw r20, r24 const uint16_t idx01 = c0 + 32 * r1; const uint16_t idx10 = c1 + 32 * r0; const uint16_t idx11 = c1 + 32 * r1; /// bilinear resampling return w00 * matrix_32x32[idx00] + w01 * matrix_32x32[idx01] + w10 * matrix_32x32[idx10] + w11 * matrix_32x32[idx11]; 2b16e: c5 01 movw r24, r10 2b170: b4 01 movw r22, r8 2b172: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2b176: 4b 01 movw r8, r22 2b178: 5c 01 movw r10, r24 2b17a: c4 55 subi r28, 0x54 ; 84 2b17c: de 4f sbci r29, 0xFE ; 254 2b17e: e8 81 ld r30, Y 2b180: f9 81 ldd r31, Y+1 ; 0x01 2b182: cc 5a subi r28, 0xAC ; 172 2b184: d1 40 sbci r29, 0x01 ; 1 2b186: ec 0d add r30, r12 2b188: fd 1d adc r31, r13 2b18a: e8 53 subi r30, 0x38 ; 56 2b18c: f9 4f sbci r31, 0xF9 ; 249 2b18e: 60 81 ld r22, Z 2b190: 70 e0 ldi r23, 0x00 ; 0 2b192: 90 e0 ldi r25, 0x00 ; 0 2b194: 80 e0 ldi r24, 0x00 ; 0 2b196: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2b19a: 6b 01 movw r12, r22 2b19c: 7c 01 movw r14, r24 const float wr1 = r - floor(r); const float wc0 = 1 - wc1; const float wr0 = 1 - wr1; const float w00 = wc0 * wr0; const float w01 = wc0 * wr1; 2b19e: c2 55 subi r28, 0x52 ; 82 2b1a0: de 4f sbci r29, 0xFE ; 254 2b1a2: 28 81 ld r18, Y 2b1a4: 39 81 ldd r19, Y+1 ; 0x01 2b1a6: 4a 81 ldd r20, Y+2 ; 0x02 2b1a8: 5b 81 ldd r21, Y+3 ; 0x03 2b1aa: ce 5a subi r28, 0xAE ; 174 2b1ac: d1 40 sbci r29, 0x01 ; 1 2b1ae: cc 56 subi r28, 0x6C ; 108 2b1b0: de 4f sbci r29, 0xFE ; 254 2b1b2: 68 81 ld r22, Y 2b1b4: 79 81 ldd r23, Y+1 ; 0x01 2b1b6: 8a 81 ldd r24, Y+2 ; 0x02 2b1b8: 9b 81 ldd r25, Y+3 ; 0x03 2b1ba: c4 59 subi r28, 0x94 ; 148 2b1bc: d1 40 sbci r29, 0x01 ; 1 2b1be: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2b1c2: 9b 01 movw r18, r22 2b1c4: ac 01 movw r20, r24 const uint16_t idx01 = c0 + 32 * r1; const uint16_t idx10 = c1 + 32 * r0; const uint16_t idx11 = c1 + 32 * r1; /// bilinear resampling return w00 * matrix_32x32[idx00] + w01 * matrix_32x32[idx01] + w10 * matrix_32x32[idx10] + w11 * matrix_32x32[idx11]; 2b1c6: c7 01 movw r24, r14 2b1c8: b6 01 movw r22, r12 2b1ca: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2b1ce: 9b 01 movw r18, r22 2b1d0: ac 01 movw r20, r24 2b1d2: c5 01 movw r24, r10 2b1d4: b4 01 movw r22, r8 2b1d6: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2b1da: 6b 01 movw r12, r22 2b1dc: 7c 01 movw r14, r24 2b1de: c6 55 subi r28, 0x56 ; 86 2b1e0: de 4f sbci r29, 0xFE ; 254 2b1e2: a8 81 ld r26, Y 2b1e4: b9 81 ldd r27, Y+1 ; 0x01 2b1e6: ca 5a subi r28, 0xAA ; 170 2b1e8: d1 40 sbci r29, 0x01 ; 1 2b1ea: 0a 0f add r16, r26 2b1ec: 1b 1f adc r17, r27 2b1ee: f8 01 movw r30, r16 2b1f0: e8 53 subi r30, 0x38 ; 56 2b1f2: f9 4f sbci r31, 0xF9 ; 249 2b1f4: 60 81 ld r22, Z 2b1f6: 70 e0 ldi r23, 0x00 ; 0 2b1f8: 90 e0 ldi r25, 0x00 ; 0 2b1fa: 80 e0 ldi r24, 0x00 ; 0 2b1fc: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2b200: 4b 01 movw r8, r22 2b202: 5c 01 movw r10, r24 const float wc0 = 1 - wc1; const float wr0 = 1 - wr1; const float w00 = wc0 * wr0; const float w01 = wc0 * wr1; const float w10 = wc1 * wr0; 2b204: ce 54 subi r28, 0x4E ; 78 2b206: de 4f sbci r29, 0xFE ; 254 2b208: 28 81 ld r18, Y 2b20a: 39 81 ldd r19, Y+1 ; 0x01 2b20c: 4a 81 ldd r20, Y+2 ; 0x02 2b20e: 5b 81 ldd r21, Y+3 ; 0x03 2b210: c2 5b subi r28, 0xB2 ; 178 2b212: d1 40 sbci r29, 0x01 ; 1 2b214: c3 01 movw r24, r6 2b216: b2 01 movw r22, r4 2b218: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2b21c: 9b 01 movw r18, r22 2b21e: ac 01 movw r20, r24 const uint16_t idx01 = c0 + 32 * r1; const uint16_t idx10 = c1 + 32 * r0; const uint16_t idx11 = c1 + 32 * r1; /// bilinear resampling return w00 * matrix_32x32[idx00] + w01 * matrix_32x32[idx01] + w10 * matrix_32x32[idx10] + w11 * matrix_32x32[idx11]; 2b220: c5 01 movw r24, r10 2b222: b4 01 movw r22, r8 2b224: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2b228: 9b 01 movw r18, r22 2b22a: ac 01 movw r20, r24 2b22c: c7 01 movw r24, r14 2b22e: b6 01 movw r22, r12 2b230: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2b234: 6b 01 movw r12, r22 2b236: 7c 01 movw r14, r24 2b238: c6 55 subi r28, 0x56 ; 86 2b23a: de 4f sbci r29, 0xFE ; 254 2b23c: e8 81 ld r30, Y 2b23e: f9 81 ldd r31, Y+1 ; 0x01 2b240: ca 5a subi r28, 0xAA ; 170 2b242: d1 40 sbci r29, 0x01 ; 1 2b244: c4 55 subi r28, 0x54 ; 84 2b246: de 4f sbci r29, 0xFE ; 254 2b248: 88 81 ld r24, Y 2b24a: 99 81 ldd r25, Y+1 ; 0x01 2b24c: cc 5a subi r28, 0xAC ; 172 2b24e: d1 40 sbci r29, 0x01 ; 1 2b250: e8 0f add r30, r24 2b252: f9 1f adc r31, r25 2b254: e8 53 subi r30, 0x38 ; 56 2b256: f9 4f sbci r31, 0xF9 ; 249 2b258: 60 81 ld r22, Z 2b25a: 70 e0 ldi r23, 0x00 ; 0 2b25c: 90 e0 ldi r25, 0x00 ; 0 2b25e: 80 e0 ldi r24, 0x00 ; 0 2b260: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2b264: 4b 01 movw r8, r22 2b266: 5c 01 movw r10, r24 const float wr0 = 1 - wr1; const float w00 = wc0 * wr0; const float w01 = wc0 * wr1; const float w10 = wc1 * wr0; const float w11 = wc1 * wr1; 2b268: cc 56 subi r28, 0x6C ; 108 2b26a: de 4f sbci r29, 0xFE ; 254 2b26c: 28 81 ld r18, Y 2b26e: 39 81 ldd r19, Y+1 ; 0x01 2b270: 4a 81 ldd r20, Y+2 ; 0x02 2b272: 5b 81 ldd r21, Y+3 ; 0x03 2b274: c4 59 subi r28, 0x94 ; 148 2b276: d1 40 sbci r29, 0x01 ; 1 2b278: c3 01 movw r24, r6 2b27a: b2 01 movw r22, r4 2b27c: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2b280: 9b 01 movw r18, r22 2b282: ac 01 movw r20, r24 const uint16_t idx01 = c0 + 32 * r1; const uint16_t idx10 = c1 + 32 * r0; const uint16_t idx11 = c1 + 32 * r1; /// bilinear resampling return w00 * matrix_32x32[idx00] + w01 * matrix_32x32[idx01] + w10 * matrix_32x32[idx10] + w11 * matrix_32x32[idx11]; 2b284: c5 01 movw r24, r10 2b286: b4 01 movw r22, r8 2b288: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2b28c: 9b 01 movw r18, r22 2b28e: ac 01 movw r20, r24 2b290: c7 01 movw r24, r14 2b292: b6 01 movw r22, r12 2b294: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> // DBG(_n(" [%f, %f][%f] circle\n"), x, y, r); /// read points on the circle for (uint8_t p = 0; p < num_points; ++p){ const float angle = p * pi_2_div_num_points; const float height = get_value(matrix_32x32, r * cos(angle) + x, r * sin(angle) + y) - target_z; 2b298: 20 e0 ldi r18, 0x00 ; 0 2b29a: 30 e0 ldi r19, 0x00 ; 0 2b29c: 40 e0 ldi r20, 0x00 ; 0 2b29e: 52 e4 ldi r21, 0x42 ; 66 2b2a0: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 2b2a4: 6b 01 movw r12, r22 2b2a6: 7c 01 movw r14, r24 // DBG(_n("%f "), point); shifts_x[p] = cos(angle) * height; 2b2a8: ac 01 movw r20, r24 2b2aa: 9b 01 movw r18, r22 2b2ac: ce 55 subi r28, 0x5E ; 94 2b2ae: de 4f sbci r29, 0xFE ; 254 2b2b0: 68 81 ld r22, Y 2b2b2: 79 81 ldd r23, Y+1 ; 0x01 2b2b4: 8a 81 ldd r24, Y+2 ; 0x02 2b2b6: 9b 81 ldd r25, Y+3 ; 0x03 2b2b8: c2 5a subi r28, 0xA2 ; 162 2b2ba: d1 40 sbci r29, 0x01 ; 1 2b2bc: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2b2c0: c8 55 subi r28, 0x58 ; 88 2b2c2: de 4f sbci r29, 0xFE ; 254 2b2c4: a8 81 ld r26, Y 2b2c6: b9 81 ldd r27, Y+1 ; 0x01 2b2c8: c8 5a subi r28, 0xA8 ; 168 2b2ca: d1 40 sbci r29, 0x01 ; 1 2b2cc: 6d 93 st X+, r22 2b2ce: 7d 93 st X+, r23 2b2d0: 8d 93 st X+, r24 2b2d2: 9d 93 st X+, r25 2b2d4: c8 55 subi r28, 0x58 ; 88 2b2d6: de 4f sbci r29, 0xFE ; 254 2b2d8: b9 83 std Y+1, r27 ; 0x01 2b2da: a8 83 st Y, r26 2b2dc: c8 5a subi r28, 0xA8 ; 168 2b2de: d1 40 sbci r29, 0x01 ; 1 shifts_y[p] = sin(angle) * height; 2b2e0: a7 01 movw r20, r14 2b2e2: 96 01 movw r18, r12 2b2e4: c2 56 subi r28, 0x62 ; 98 2b2e6: de 4f sbci r29, 0xFE ; 254 2b2e8: 68 81 ld r22, Y 2b2ea: 79 81 ldd r23, Y+1 ; 0x01 2b2ec: 8a 81 ldd r24, Y+2 ; 0x02 2b2ee: 9b 81 ldd r25, Y+3 ; 0x03 2b2f0: ce 59 subi r28, 0x9E ; 158 2b2f2: d1 40 sbci r29, 0x01 ; 1 2b2f4: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2b2f8: ca 55 subi r28, 0x5A ; 90 2b2fa: de 4f sbci r29, 0xFE ; 254 2b2fc: e8 81 ld r30, Y 2b2fe: f9 81 ldd r31, Y+1 ; 0x01 2b300: c6 5a subi r28, 0xA6 ; 166 2b302: d1 40 sbci r29, 0x01 ; 1 2b304: 61 93 st Z+, r22 2b306: 71 93 st Z+, r23 2b308: 81 93 st Z+, r24 2b30a: 91 93 st Z+, r25 2b30c: ca 55 subi r28, 0x5A ; 90 2b30e: de 4f sbci r29, 0xFE ; 254 2b310: f9 83 std Y+1, r31 ; 0x01 2b312: e8 83 st Y, r30 2b314: c6 5a subi r28, 0xA6 ; 166 2b316: d1 40 sbci r29, 0x01 ; 1 shifts_r[p] = height; 2b318: c8 56 subi r28, 0x68 ; 104 2b31a: de 4f sbci r29, 0xFE ; 254 2b31c: a8 81 ld r26, Y 2b31e: b9 81 ldd r27, Y+1 ; 0x01 2b320: c8 59 subi r28, 0x98 ; 152 2b322: d1 40 sbci r29, 0x01 ; 1 2b324: cd 92 st X+, r12 2b326: dd 92 st X+, r13 2b328: ed 92 st X+, r14 2b32a: fd 92 st X+, r15 2b32c: c8 56 subi r28, 0x68 ; 104 2b32e: de 4f sbci r29, 0xFE ; 254 2b330: b9 83 std Y+1, r27 ; 0x01 2b332: a8 83 st Y, r26 2b334: c8 59 subi r28, 0x98 ; 152 2b336: d1 40 sbci r29, 0x01 ; 1 2b338: bf ef ldi r27, 0xFF ; 255 2b33a: 2b 1a sub r2, r27 2b33c: 3b 0a sbc r3, r27 //@size=128B // DBG(_n(" [%f, %f][%f] circle\n"), x, y, r); /// read points on the circle for (uint8_t p = 0; p < num_points; ++p){ 2b33e: e1 e2 ldi r30, 0x21 ; 33 2b340: 2e 16 cp r2, r30 2b342: 31 04 cpc r3, r1 2b344: 09 f0 breq .+2 ; 0x2b348 2b346: 10 ce rjmp .-992 ; 0x2af68 const float norm = 1.f / reducer; // x += CLAMP(median(shifts_x, blocks) * norm, -max_change, max_change); // y += CLAMP(median(shifts_y, blocks) * norm, -max_change, max_change); // r += CLAMP(median(shifts_r, blocks) * norm * .5f, -max_change, max_change); //104B down x += CLAMP_median(shifts_x, blocks, norm); 2b348: 40 e0 ldi r20, 0x00 ; 0 2b34a: 50 e0 ldi r21, 0x00 ; 0 2b34c: 60 e0 ldi r22, 0x00 ; 0 2b34e: 7d e3 ldi r23, 0x3D ; 61 2b350: ce 01 movw r24, r28 2b352: 87 5f subi r24, 0xF7 ; 247 2b354: 9e 4f sbci r25, 0xFE ; 254 2b356: 0f 94 7d 3a call 0x274fa ; 0x274fa 2b35a: 9b 01 movw r18, r22 2b35c: ac 01 movw r20, r24 2b35e: c3 57 subi r28, 0x73 ; 115 2b360: de 4f sbci r29, 0xFE ; 254 2b362: a8 81 ld r26, Y 2b364: b9 81 ldd r27, Y+1 ; 0x01 2b366: cd 58 subi r28, 0x8D ; 141 2b368: d1 40 sbci r29, 0x01 ; 1 2b36a: 6d 91 ld r22, X+ 2b36c: 7d 91 ld r23, X+ 2b36e: 8d 91 ld r24, X+ 2b370: 9c 91 ld r25, X 2b372: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2b376: c3 57 subi r28, 0x73 ; 115 2b378: de 4f sbci r29, 0xFE ; 254 2b37a: e8 81 ld r30, Y 2b37c: f9 81 ldd r31, Y+1 ; 0x01 2b37e: cd 58 subi r28, 0x8D ; 141 2b380: d1 40 sbci r29, 0x01 ; 1 2b382: 60 83 st Z, r22 2b384: 71 83 std Z+1, r23 ; 0x01 2b386: 82 83 std Z+2, r24 ; 0x02 2b388: 93 83 std Z+3, r25 ; 0x03 y += CLAMP_median(shifts_y, blocks, norm); 2b38a: 40 e0 ldi r20, 0x00 ; 0 2b38c: 50 e0 ldi r21, 0x00 ; 0 2b38e: 60 e0 ldi r22, 0x00 ; 0 2b390: 7d e3 ldi r23, 0x3D ; 61 2b392: ce 01 movw r24, r28 2b394: 8b 57 subi r24, 0x7B ; 123 2b396: 9f 4f sbci r25, 0xFF ; 255 2b398: 0f 94 7d 3a call 0x274fa ; 0x274fa 2b39c: 9b 01 movw r18, r22 2b39e: ac 01 movw r20, r24 2b3a0: c1 57 subi r28, 0x71 ; 113 2b3a2: de 4f sbci r29, 0xFE ; 254 2b3a4: a8 81 ld r26, Y 2b3a6: b9 81 ldd r27, Y+1 ; 0x01 2b3a8: cf 58 subi r28, 0x8F ; 143 2b3aa: d1 40 sbci r29, 0x01 ; 1 2b3ac: 6d 91 ld r22, X+ 2b3ae: 7d 91 ld r23, X+ 2b3b0: 8d 91 ld r24, X+ 2b3b2: 9c 91 ld r25, X 2b3b4: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2b3b8: c1 57 subi r28, 0x71 ; 113 2b3ba: de 4f sbci r29, 0xFE ; 254 2b3bc: e8 81 ld r30, Y 2b3be: f9 81 ldd r31, Y+1 ; 0x01 2b3c0: cf 58 subi r28, 0x8F ; 143 2b3c2: d1 40 sbci r29, 0x01 ; 1 2b3c4: 60 83 st Z, r22 2b3c6: 71 83 std Z+1, r23 ; 0x01 2b3c8: 82 83 std Z+2, r24 ; 0x02 2b3ca: 93 83 std Z+3, r25 ; 0x03 r += CLAMP_median(shifts_r, blocks, norm * .5f); 2b3cc: 40 e0 ldi r20, 0x00 ; 0 2b3ce: 50 e0 ldi r21, 0x00 ; 0 2b3d0: 60 e8 ldi r22, 0x80 ; 128 2b3d2: 7c e3 ldi r23, 0x3C ; 60 2b3d4: ce 01 movw r24, r28 2b3d6: 01 96 adiw r24, 0x01 ; 1 2b3d8: 0f 94 7d 3a call 0x274fa ; 0x274fa 2b3dc: ce 56 subi r28, 0x6E ; 110 2b3de: de 4f sbci r29, 0xFE ; 254 2b3e0: a8 81 ld r26, Y 2b3e2: b9 81 ldd r27, Y+1 ; 0x01 2b3e4: c2 59 subi r28, 0x92 ; 146 2b3e6: d1 40 sbci r29, 0x01 ; 1 2b3e8: 2d 91 ld r18, X+ 2b3ea: 3d 91 ld r19, X+ 2b3ec: 4d 91 ld r20, X+ 2b3ee: 5c 91 ld r21, X 2b3f0: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2b3f4: 16 2f mov r17, r22 2b3f6: 07 2f mov r16, r23 2b3f8: f8 2e mov r15, r24 2b3fa: e9 2e mov r14, r25 r = MAX(2, r); 2b3fc: 20 e0 ldi r18, 0x00 ; 0 2b3fe: 30 e0 ldi r19, 0x00 ; 0 2b400: 40 e0 ldi r20, 0x00 ; 0 2b402: 50 e4 ldi r21, 0x40 ; 64 2b404: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 2b408: 18 16 cp r1, r24 2b40a: 2c f0 brlt .+10 ; 0x2b416 2b40c: 10 e0 ldi r17, 0x00 ; 0 2b40e: 00 e0 ldi r16, 0x00 ; 0 2b410: f1 2c mov r15, r1 2b412: 80 e4 ldi r24, 0x40 ; 64 2b414: e8 2e mov r14, r24 2b416: a8 01 movw r20, r16 2b418: 97 01 movw r18, r14 2b41a: 85 2f mov r24, r21 2b41c: 90 2f mov r25, r16 2b41e: a3 2f mov r26, r19 2b420: be 2d mov r27, r14 2b422: ce 56 subi r28, 0x6E ; 110 2b424: de 4f sbci r29, 0xFE ; 254 2b426: e8 81 ld r30, Y 2b428: f9 81 ldd r31, Y+1 ; 0x01 2b42a: c2 59 subi r28, 0x92 ; 146 2b42c: d1 40 sbci r29, 0x01 ; 1 2b42e: 80 83 st Z, r24 2b430: 91 83 std Z+1, r25 ; 0x01 2b432: a2 83 std Z+2, r26 ; 0x02 2b434: b3 83 std Z+3, r27 ; 0x03 2b436: cf 56 subi r28, 0x6F ; 111 2b438: de 4f sbci r29, 0xFE ; 254 2b43a: f8 81 ld r31, Y 2b43c: c1 59 subi r28, 0x91 ; 145 2b43e: d1 40 sbci r29, 0x01 ; 1 2b440: f1 50 subi r31, 0x01 ; 1 2b442: cf 56 subi r28, 0x6F ; 111 2b444: de 4f sbci r29, 0xFE ; 254 2b446: f8 83 st Y, r31 2b448: c1 59 subi r28, 0x91 ; 145 2b44a: d1 40 sbci r29, 0x01 ; 1 float shifts_y[blocks]; float shifts_r[blocks]; // DBG(_n(" [%f, %f][%f] start circle\n"), x, y, r); for (int8_t i = iterations; i > 0; --i){ 2b44c: f1 11 cpse r31, r1 2b44e: 37 cd rjmp .-1426 ; 0x2aebe r = MAX(2, r); } //@size=118 DBG(_n(" [%f, %f][%f] final circle\n"), x, y, r); 2b450: ef 92 push r14 2b452: ff 92 push r15 2b454: 0f 93 push r16 2b456: 1f 93 push r17 2b458: c1 57 subi r28, 0x71 ; 113 2b45a: de 4f sbci r29, 0xFE ; 254 2b45c: a8 81 ld r26, Y 2b45e: b9 81 ldd r27, Y+1 ; 0x01 2b460: cf 58 subi r28, 0x8F ; 143 2b462: d1 40 sbci r29, 0x01 ; 1 2b464: 13 96 adiw r26, 0x03 ; 3 2b466: 8c 91 ld r24, X 2b468: 13 97 sbiw r26, 0x03 ; 3 2b46a: 8f 93 push r24 2b46c: 12 96 adiw r26, 0x02 ; 2 2b46e: 8c 91 ld r24, X 2b470: 12 97 sbiw r26, 0x02 ; 2 2b472: 8f 93 push r24 2b474: 11 96 adiw r26, 0x01 ; 1 2b476: 8c 91 ld r24, X 2b478: 11 97 sbiw r26, 0x01 ; 1 2b47a: 8f 93 push r24 2b47c: 8c 91 ld r24, X 2b47e: 8f 93 push r24 2b480: c3 57 subi r28, 0x73 ; 115 2b482: de 4f sbci r29, 0xFE ; 254 2b484: e8 81 ld r30, Y 2b486: f9 81 ldd r31, Y+1 ; 0x01 2b488: cd 58 subi r28, 0x8D ; 141 2b48a: d1 40 sbci r29, 0x01 ; 1 2b48c: 83 81 ldd r24, Z+3 ; 0x03 2b48e: 8f 93 push r24 2b490: 82 81 ldd r24, Z+2 ; 0x02 2b492: 8f 93 push r24 2b494: 81 81 ldd r24, Z+1 ; 0x01 2b496: 8f 93 push r24 2b498: 80 81 ld r24, Z 2b49a: 8f 93 push r24 2b49c: 8c eb ldi r24, 0xBC ; 188 2b49e: 98 e9 ldi r25, 0x98 ; 152 2b4a0: 9f 93 push r25 2b4a2: 8f 93 push r24 2b4a4: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 2b4a8: 0f b6 in r0, 0x3f ; 63 2b4aa: f8 94 cli 2b4ac: de bf out 0x3e, r29 ; 62 2b4ae: 0f be out 0x3f, r0 ; 63 2b4b0: cd bf out 0x3d, r28 ; 61 } 2b4b2: c3 54 subi r28, 0x43 ; 67 2b4b4: de 4f sbci r29, 0xFE ; 254 2b4b6: 0f b6 in r0, 0x3f ; 63 2b4b8: f8 94 cli 2b4ba: de bf out 0x3e, r29 ; 62 2b4bc: 0f be out 0x3f, r0 ; 63 2b4be: cd bf out 0x3d, r28 ; 61 2b4c0: df 91 pop r29 2b4c2: cf 91 pop r28 2b4c4: 1f 91 pop r17 2b4c6: 0f 91 pop r16 2b4c8: ff 90 pop r15 2b4ca: ef 90 pop r14 2b4cc: df 90 pop r13 2b4ce: cf 90 pop r12 2b4d0: bf 90 pop r11 2b4d2: af 90 pop r10 2b4d4: 9f 90 pop r9 2b4d6: 8f 90 pop r8 2b4d8: 7f 90 pop r7 2b4da: 6f 90 pop r6 2b4dc: 5f 90 pop r5 2b4de: 4f 90 pop r4 2b4e0: 3f 90 pop r3 2b4e2: 2f 90 pop r2 2b4e4: 08 95 ret /// returns value of any location within data /// uses bilinear interpolation float get_value(uint8_t * matrix_32x32, float c, float r){ if (c <= 0 || r <= 0 || c >= 31 || r >= 31) return 0; 2b4e6: 60 e0 ldi r22, 0x00 ; 0 2b4e8: 70 e0 ldi r23, 0x00 ; 0 2b4ea: cb 01 movw r24, r22 2b4ec: d5 ce rjmp .-598 ; 0x2b298 0002b4ee : } /// Searches for best match of pattern by shifting it /// Returns rate of match and the best location /// max match = 132, min match = 0 uint8_t xyzcal_find_pattern_12x12_in_32x32(uint8_t* pixels, uint16_t* pattern, uint8_t* pc, uint8_t* pr){ 2b4ee: 2f 92 push r2 2b4f0: 3f 92 push r3 2b4f2: 4f 92 push r4 2b4f4: 5f 92 push r5 2b4f6: 6f 92 push r6 2b4f8: 7f 92 push r7 2b4fa: 8f 92 push r8 2b4fc: 9f 92 push r9 2b4fe: af 92 push r10 2b500: bf 92 push r11 2b502: cf 92 push r12 2b504: df 92 push r13 2b506: ef 92 push r14 2b508: ff 92 push r15 2b50a: 0f 93 push r16 2b50c: 1f 93 push r17 2b50e: cf 93 push r28 2b510: df 93 push r29 2b512: 00 d0 rcall .+0 ; 0x2b514 2b514: 1f 92 push r1 2b516: 1f 92 push r1 2b518: cd b7 in r28, 0x3d ; 61 2b51a: de b7 in r29, 0x3e ; 62 2b51c: 2b 01 movw r4, r22 2b51e: 1a 01 movw r2, r20 2b520: f1 2c mov r15, r1 2b522: e1 2c mov r14, r1 if (!pixels || !pattern || !pc || !pr) return -1; uint8_t max_c = 0; uint8_t max_r = 0; uint8_t max_match = 0; 2b524: 1c 82 std Y+4, r1 ; 0x04 /// max match = 132, min match = 0 uint8_t xyzcal_find_pattern_12x12_in_32x32(uint8_t* pixels, uint16_t* pattern, uint8_t* pc, uint8_t* pr){ if (!pixels || !pattern || !pc || !pr) return -1; uint8_t max_c = 0; uint8_t max_r = 0; 2b526: 1d 82 std Y+5, r1 ; 0x05 /// Returns rate of match and the best location /// max match = 132, min match = 0 uint8_t xyzcal_find_pattern_12x12_in_32x32(uint8_t* pixels, uint16_t* pattern, uint8_t* pc, uint8_t* pr){ if (!pixels || !pattern || !pc || !pr) return -1; uint8_t max_c = 0; 2b528: 10 e0 ldi r17, 0x00 ; 0 uint8_t max_r = 0; uint8_t max_match = 0; // DBG(_n("Matching:\n")); /// pixel precision for (uint8_t r = 0; r < (32 - 12); ++r){ 2b52a: 50 e0 ldi r21, 0x00 ; 0 /// skip corners (3 pixels in each) if (((i == 0) || (i == 11)) && ((j < 2) || (j >= 10))) continue; if (((j == 0) || (j == 11)) && ((i < 2) || (i >= 10))) continue; const uint16_t idx = (c + j) + 32 * ((uint16_t)r + i); const bool high_pix = pixels[idx] > thr; const bool high_pat = pattern[i] & (1 << j); 2b52c: 66 24 eor r6, r6 2b52e: 63 94 inc r6 2b530: 71 2c mov r7, r1 uint8_t max_r = 0; uint8_t max_match = 0; // DBG(_n("Matching:\n")); /// pixel precision for (uint8_t r = 0; r < (32 - 12); ++r){ 2b532: 70 e0 ldi r23, 0x00 ; 0 2b534: 60 e0 ldi r22, 0x00 ; 0 2b536: 97 01 movw r18, r14 2b538: 28 53 subi r18, 0x38 ; 56 2b53a: 39 4f sbci r19, 0xF9 ; 249 2b53c: 3a 83 std Y+2, r19 ; 0x02 2b53e: 29 83 std Y+1, r18 ; 0x01 2b540: 86 2e mov r8, r22 2b542: c9 80 ldd r12, Y+1 ; 0x01 2b544: da 80 ldd r13, Y+2 ; 0x02 2b546: c6 0e add r12, r22 2b548: d7 1e adc r13, r23 2b54a: fc 01 movw r30, r24 /// Returns rate of match /// max match = 132, min match = 0 uint8_t xyzcal_match_pattern_12x12_in_32x32(uint16_t* pattern, uint8_t* pixels, uint8_t c, uint8_t r){ uint8_t thr = 16; uint8_t match = 0; 2b54c: 00 e0 ldi r16, 0x00 ; 0 for (uint8_t i = 0; i < 12; ++i){ 2b54e: 40 e0 ldi r20, 0x00 ; 0 2b550: 30 e0 ldi r19, 0x00 ; 0 2b552: 20 e0 ldi r18, 0x00 ; 0 for (uint8_t j = 0; j < 12; ++j){ /// skip corners (3 pixels in each) if (((i == 0) || (i == 11)) && ((j < 2) || (j >= 10))) continue; if (((j == 0) || (j == 11)) && ((i < 2) || (i >= 10))) continue; 2b554: ae ef ldi r26, 0xFE ; 254 2b556: a4 0f add r26, r20 2b558: ab 83 std Y+3, r26 ; 0x03 uint8_t thr = 16; uint8_t match = 0; for (uint8_t i = 0; i < 12; ++i){ for (uint8_t j = 0; j < 12; ++j){ /// skip corners (3 pixels in each) if (((i == 0) || (i == 11)) && ((j < 2) || (j >= 10))) continue; 2b55a: 44 23 and r20, r20 2b55c: 19 f0 breq .+6 ; 0x2b564 2b55e: 4b 30 cpi r20, 0x0B ; 11 2b560: 09 f0 breq .+2 ; 0x2b564 2b562: 7d c0 rjmp .+250 ; 0x2b65e 2b564: ae ef ldi r26, 0xFE ; 254 2b566: a2 0f add r26, r18 2b568: a8 30 cpi r26, 0x08 ; 8 2b56a: 08 f4 brcc .+2 ; 0x2b56e 2b56c: 7a c0 rjmp .+244 ; 0x2b662 2b56e: 2f 5f subi r18, 0xFF ; 255 2b570: 3f 4f sbci r19, 0xFF ; 255 /// max match = 132, min match = 0 uint8_t xyzcal_match_pattern_12x12_in_32x32(uint16_t* pattern, uint8_t* pixels, uint8_t c, uint8_t r){ uint8_t thr = 16; uint8_t match = 0; for (uint8_t i = 0; i < 12; ++i){ for (uint8_t j = 0; j < 12; ++j){ 2b572: 2c 30 cpi r18, 0x0C ; 12 2b574: 31 05 cpc r19, r1 2b576: 89 f7 brne .-30 ; 0x2b55a /// Returns rate of match /// max match = 132, min match = 0 uint8_t xyzcal_match_pattern_12x12_in_32x32(uint16_t* pattern, uint8_t* pixels, uint8_t c, uint8_t r){ uint8_t thr = 16; uint8_t match = 0; for (uint8_t i = 0; i < 12; ++i){ 2b578: 4f 5f subi r20, 0xFF ; 255 2b57a: 20 e2 ldi r18, 0x20 ; 32 2b57c: c2 0e add r12, r18 2b57e: d1 1c adc r13, r1 2b580: 32 96 adiw r30, 0x02 ; 2 2b582: 4c 30 cpi r20, 0x0C ; 12 2b584: 29 f7 brne .-54 ; 0x2b550 // DBG(_n("Matching:\n")); /// pixel precision for (uint8_t r = 0; r < (32 - 12); ++r){ for (uint8_t c = 0; c < (32 - 12); ++c){ const uint8_t match = xyzcal_match_pattern_12x12_in_32x32(pattern, pixels, c, r); if (max_match < match){ 2b586: 3c 81 ldd r19, Y+4 ; 0x04 2b588: 30 17 cp r19, r16 2b58a: 18 f4 brcc .+6 ; 0x2b592 2b58c: 0c 83 std Y+4, r16 ; 0x04 2b58e: 5d 83 std Y+5, r21 ; 0x05 2b590: 18 2d mov r17, r8 2b592: 6f 5f subi r22, 0xFF ; 255 2b594: 7f 4f sbci r23, 0xFF ; 255 uint8_t max_match = 0; // DBG(_n("Matching:\n")); /// pixel precision for (uint8_t r = 0; r < (32 - 12); ++r){ for (uint8_t c = 0; c < (32 - 12); ++c){ 2b596: 64 31 cpi r22, 0x14 ; 20 2b598: 71 05 cpc r23, r1 2b59a: 91 f6 brne .-92 ; 0x2b540 uint8_t max_r = 0; uint8_t max_match = 0; // DBG(_n("Matching:\n")); /// pixel precision for (uint8_t r = 0; r < (32 - 12); ++r){ 2b59c: 5f 5f subi r21, 0xFF ; 255 2b59e: a0 e2 ldi r26, 0x20 ; 32 2b5a0: ea 0e add r14, r26 2b5a2: f1 1c adc r15, r1 2b5a4: 54 31 cpi r21, 0x14 ; 20 2b5a6: 29 f6 brne .-118 ; 0x2b532 // DBG(_n("%d "), match); } // DBG(_n("\n")); } //@size=278 DBG(_n("Pattern center [%f %f], match %f%%\n"), max_c + 5.5f, max_r + 5.5f, max_match / 1.32f); 2b5a8: ec 81 ldd r30, Y+4 ; 0x04 2b5aa: 6e 2f mov r22, r30 2b5ac: 70 e0 ldi r23, 0x00 ; 0 2b5ae: 90 e0 ldi r25, 0x00 ; 0 2b5b0: 80 e0 ldi r24, 0x00 ; 0 2b5b2: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2b5b6: 23 ec ldi r18, 0xC3 ; 195 2b5b8: 35 ef ldi r19, 0xF5 ; 245 2b5ba: 48 ea ldi r20, 0xA8 ; 168 2b5bc: 5f e3 ldi r21, 0x3F ; 63 2b5be: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2b5c2: 9f 93 push r25 2b5c4: 8f 93 push r24 2b5c6: 7f 93 push r23 2b5c8: 6f 93 push r22 2b5ca: fd 81 ldd r31, Y+5 ; 0x05 2b5cc: 6f 2f mov r22, r31 2b5ce: 70 e0 ldi r23, 0x00 ; 0 2b5d0: 90 e0 ldi r25, 0x00 ; 0 2b5d2: 80 e0 ldi r24, 0x00 ; 0 2b5d4: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2b5d8: 20 e0 ldi r18, 0x00 ; 0 2b5da: 30 e0 ldi r19, 0x00 ; 0 2b5dc: 40 eb ldi r20, 0xB0 ; 176 2b5de: 50 e4 ldi r21, 0x40 ; 64 2b5e0: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2b5e4: 9f 93 push r25 2b5e6: 8f 93 push r24 2b5e8: 7f 93 push r23 2b5ea: 6f 93 push r22 2b5ec: 61 2f mov r22, r17 2b5ee: 70 e0 ldi r23, 0x00 ; 0 2b5f0: 90 e0 ldi r25, 0x00 ; 0 2b5f2: 80 e0 ldi r24, 0x00 ; 0 2b5f4: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2b5f8: 20 e0 ldi r18, 0x00 ; 0 2b5fa: 30 e0 ldi r19, 0x00 ; 0 2b5fc: 40 eb ldi r20, 0xB0 ; 176 2b5fe: 50 e4 ldi r21, 0x40 ; 64 2b600: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2b604: 9f 93 push r25 2b606: 8f 93 push r24 2b608: 7f 93 push r23 2b60a: 6f 93 push r22 2b60c: 88 e9 ldi r24, 0x98 ; 152 2b60e: 98 e9 ldi r25, 0x98 ; 152 2b610: 9f 93 push r25 2b612: 8f 93 push r24 2b614: 0f 94 9e 9e call 0x33d3c ; 0x33d3c *pc = max_c; 2b618: f2 01 movw r30, r4 2b61a: 10 83 st Z, r17 *pr = max_r; 2b61c: 2d 81 ldd r18, Y+5 ; 0x05 2b61e: f1 01 movw r30, r2 2b620: 20 83 st Z, r18 2b622: 0f b6 in r0, 0x3f ; 63 2b624: f8 94 cli 2b626: de bf out 0x3e, r29 ; 62 2b628: 0f be out 0x3f, r0 ; 63 2b62a: cd bf out 0x3d, r28 ; 61 return max_match; } 2b62c: 8c 81 ldd r24, Y+4 ; 0x04 2b62e: 0f 90 pop r0 2b630: 0f 90 pop r0 2b632: 0f 90 pop r0 2b634: 0f 90 pop r0 2b636: 0f 90 pop r0 2b638: df 91 pop r29 2b63a: cf 91 pop r28 2b63c: 1f 91 pop r17 2b63e: 0f 91 pop r16 2b640: ff 90 pop r15 2b642: ef 90 pop r14 2b644: df 90 pop r13 2b646: cf 90 pop r12 2b648: bf 90 pop r11 2b64a: af 90 pop r10 2b64c: 9f 90 pop r9 2b64e: 8f 90 pop r8 2b650: 7f 90 pop r7 2b652: 6f 90 pop r6 2b654: 5f 90 pop r5 2b656: 4f 90 pop r4 2b658: 3f 90 pop r3 2b65a: 2f 90 pop r2 2b65c: 08 95 ret uint8_t match = 0; for (uint8_t i = 0; i < 12; ++i){ for (uint8_t j = 0; j < 12; ++j){ /// skip corners (3 pixels in each) if (((i == 0) || (i == 11)) && ((j < 2) || (j >= 10))) continue; if (((j == 0) || (j == 11)) && ((i < 2) || (i >= 10))) continue; 2b65e: 22 23 and r18, r18 2b660: 11 f0 breq .+4 ; 0x2b666 2b662: 2b 30 cpi r18, 0x0B ; 11 2b664: 21 f4 brne .+8 ; 0x2b66e 2b666: ab 81 ldd r26, Y+3 ; 0x03 2b668: a8 30 cpi r26, 0x08 ; 8 2b66a: 08 f0 brcs .+2 ; 0x2b66e 2b66c: 80 cf rjmp .-256 ; 0x2b56e const uint16_t idx = (c + j) + 32 * ((uint16_t)r + i); const bool high_pix = pixels[idx] > thr; 2b66e: 99 24 eor r9, r9 2b670: 93 94 inc r9 2b672: d6 01 movw r26, r12 2b674: a2 0f add r26, r18 2b676: b3 1f adc r27, r19 2b678: ac 91 ld r26, X 2b67a: a1 31 cpi r26, 0x11 ; 17 2b67c: 08 f4 brcc .+2 ; 0x2b680 2b67e: 91 2c mov r9, r1 const bool high_pat = pattern[i] & (1 << j); 2b680: a0 80 ld r10, Z 2b682: b1 80 ldd r11, Z+1 ; 0x01 2b684: d3 01 movw r26, r6 2b686: 02 2e mov r0, r18 2b688: 02 c0 rjmp .+4 ; 0x2b68e 2b68a: aa 0f add r26, r26 2b68c: bb 1f adc r27, r27 2b68e: 0a 94 dec r0 2b690: e2 f7 brpl .-8 ; 0x2b68a 2b692: aa 21 and r26, r10 2b694: bb 21 and r27, r11 2b696: bb 24 eor r11, r11 2b698: b3 94 inc r11 2b69a: ab 2b or r26, r27 2b69c: 09 f4 brne .+2 ; 0x2b6a0 2b69e: b1 2c mov r11, r1 if (high_pix == high_pat) 2b6a0: 9b 10 cpse r9, r11 2b6a2: 65 cf rjmp .-310 ; 0x2b56e match++; 2b6a4: 0f 5f subi r16, 0xFF ; 255 2b6a6: 63 cf rjmp .-314 ; 0x2b56e 0002b6a8 : length = z - _Z; go_start_stop(Z_AXIS_MASK, length < 0 ? Z_MINUS_MASK : Z_PLUS_MASK, acc, min_delay_us, ABS(length)); // DBG(_n("\n")); } void __attribute__((noinline)) xyzcal_scan_pixels_32x32_Zhop(int16_t cx, int16_t cy, int16_t min_z, int16_t max_z, uint16_t delay_us, uint8_t *pixels){ 2b6a8: 2f 92 push r2 2b6aa: 3f 92 push r3 2b6ac: 4f 92 push r4 2b6ae: 5f 92 push r5 2b6b0: 6f 92 push r6 2b6b2: 7f 92 push r7 2b6b4: 8f 92 push r8 2b6b6: 9f 92 push r9 2b6b8: af 92 push r10 2b6ba: bf 92 push r11 2b6bc: cf 92 push r12 2b6be: df 92 push r13 2b6c0: ef 92 push r14 2b6c2: ff 92 push r15 2b6c4: 0f 93 push r16 2b6c6: 1f 93 push r17 2b6c8: cf 93 push r28 2b6ca: df 93 push r29 2b6cc: cd b7 in r28, 0x3d ; 61 2b6ce: de b7 in r29, 0x3e ; 62 2b6d0: ca 55 subi r28, 0x5A ; 90 2b6d2: d1 09 sbc r29, r1 2b6d4: 0f b6 in r0, 0x3f ; 63 2b6d6: f8 94 cli 2b6d8: de bf out 0x3e, r29 ; 62 2b6da: 0f be out 0x3f, r0 ; 63 2b6dc: cd bf out 0x3d, r28 ; 61 2b6de: 63 96 adiw r28, 0x13 ; 19 2b6e0: 9f af std Y+63, r25 ; 0x3f 2b6e2: 8e af std Y+62, r24 ; 0x3e 2b6e4: 63 97 sbiw r28, 0x13 ; 19 2b6e6: 8b 01 movw r16, r22 2b6e8: 6a 01 movw r12, r20 if (!pixels) return; int16_t z_trig; uint16_t line_buffer[32]; uint16_t current_delay_us = MAX_DELAY; ///< defines current speed 2b6ea: 7e 01 movw r14, r28 2b6ec: 25 e4 ldi r18, 0x45 ; 69 2b6ee: e2 0e add r14, r18 2b6f0: f1 1c adc r15, r1 2b6f2: 80 e1 ldi r24, 0x10 ; 16 2b6f4: 97 e2 ldi r25, 0x27 ; 39 2b6f6: f7 01 movw r30, r14 2b6f8: 91 83 std Z+1, r25 ; 0x01 2b6fa: 80 83 st Z, r24 int16_t start_z; uint16_t steps_to_go; DBG(_n("Scan countdown: ")); 2b6fc: 87 e8 ldi r24, 0x87 ; 135 2b6fe: 98 e9 ldi r25, 0x98 ; 152 2b700: 9f 93 push r25 2b702: 8f 93 push r24 2b704: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 2b708: 28 ec ldi r18, 0xC8 ; 200 2b70a: 36 e0 ldi r19, 0x06 ; 6 2b70c: 61 96 adiw r28, 0x11 ; 17 2b70e: 3f af std Y+63, r19 ; 0x3f 2b710: 2e af std Y+62, r18 ; 0x3e 2b712: 61 97 sbiw r28, 0x11 ; 17 2b714: c8 01 movw r24, r16 2b716: 80 5e subi r24, 0xE0 ; 224 2b718: 93 40 sbci r25, 0x03 ; 3 2b71a: 2b 96 adiw r28, 0x0b ; 11 2b71c: 9f af std Y+63, r25 ; 0x3f 2b71e: 8e af std Y+62, r24 ; 0x3e 2b720: 2b 97 sbiw r28, 0x0b ; 11 2b722: 0f 90 pop r0 2b724: 0f 90 pop r0 2b726: e0 e4 ldi r30, 0x40 ; 64 2b728: f0 e0 ldi r31, 0x00 ; 0 2b72a: 29 96 adiw r28, 0x09 ; 9 2b72c: ff af std Y+63, r31 ; 0x3f 2b72e: ee af std Y+62, r30 ; 0x3e 2b730: 29 97 sbiw r28, 0x09 ; 9 for (uint8_t r = 0; r < 32; r++){ ///< Y axis for (uint8_t d = 0; d < 2; ++d){ go_manhattan((d & 1) ? (cx + 992) : (cx - 992), cy - 992 + r * 64, _Z, Z_ACCEL, Z_MIN_DELAY); 2b732: 63 96 adiw r28, 0x13 ; 19 2b734: 2e ad ldd r18, Y+62 ; 0x3e 2b736: 3f ad ldd r19, Y+63 ; 0x3f 2b738: 63 97 sbiw r28, 0x13 ; 19 2b73a: 20 5e subi r18, 0xE0 ; 224 2b73c: 33 40 sbci r19, 0x03 ; 3 2b73e: 69 96 adiw r28, 0x19 ; 25 2b740: 3f af std Y+63, r19 ; 0x3f 2b742: 2e af std Y+62, r18 ; 0x3e 2b744: 69 97 sbiw r28, 0x19 ; 25 2b746: 29 96 adiw r28, 0x09 ; 9 2b748: 4e ac ldd r4, Y+62 ; 0x3e 2b74a: 5f ac ldd r5, Y+63 ; 0x3f 2b74c: 29 97 sbiw r28, 0x09 ; 9 uint16_t steps_to_go; DBG(_n("Scan countdown: ")); for (uint8_t r = 0; r < 32; r++){ ///< Y axis for (uint8_t d = 0; d < 2; ++d){ 2b74e: 31 2c mov r3, r1 go_manhattan((d & 1) ? (cx + 992) : (cx - 992), cy - 992 + r * 64, _Z, Z_ACCEL, Z_MIN_DELAY); 2b750: 63 96 adiw r28, 0x13 ; 19 2b752: 8e ad ldd r24, Y+62 ; 0x3e 2b754: 9f ad ldd r25, Y+63 ; 0x3f 2b756: 63 97 sbiw r28, 0x13 ; 19 2b758: 80 52 subi r24, 0x20 ; 32 2b75a: 9c 4f sbci r25, 0xFC ; 252 2b75c: 6b 96 adiw r28, 0x1b ; 27 2b75e: 9f af std Y+63, r25 ; 0x3f 2b760: 8e af std Y+62, r24 ; 0x3e 2b762: 6b 97 sbiw r28, 0x1b ; 27 2b764: 60 90 be 06 lds r6, 0x06BE ; 0x8006be 2b768: 70 90 bf 06 lds r7, 0x06BF ; 0x8006bf 2b76c: 80 90 c0 06 lds r8, 0x06C0 ; 0x8006c0 2b770: 90 90 c1 06 lds r9, 0x06C1 ; 0x8006c1 2b774: 6b 96 adiw r28, 0x1b ; 27 2b776: ae ac ldd r10, Y+62 ; 0x3e 2b778: bf ac ldd r11, Y+63 ; 0x3f 2b77a: 6b 97 sbiw r28, 0x1b ; 27 2b77c: 31 10 cpse r3, r1 2b77e: 04 c0 rjmp .+8 ; 0x2b788 2b780: 69 96 adiw r28, 0x19 ; 25 2b782: ae ac ldd r10, Y+62 ; 0x3e 2b784: bf ac ldd r11, Y+63 ; 0x3f 2b786: 69 97 sbiw r28, 0x19 ; 25 /// starts and ends at 0 speed void go_manhattan(int16_t x, int16_t y, int16_t z, int16_t acc, uint16_t min_delay_us){ int16_t length; // DBG(_n("x %d -> %d, "), x, _X); length = x - _X; 2b788: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 2b78c: 90 91 b7 06 lds r25, 0x06B7 ; 0x8006b7 2b790: a0 91 b8 06 lds r26, 0x06B8 ; 0x8006b8 2b794: b0 91 b9 06 lds r27, 0x06B9 ; 0x8006b9 2b798: f5 01 movw r30, r10 2b79a: e8 1b sub r30, r24 2b79c: f9 0b sbc r31, r25 2b79e: cf 01 movw r24, r30 update_position_1_step(axes, dir); } } void go_start_stop(uint8_t axes, uint8_t dir, int16_t acc, uint16_t min_delay_us, uint16_t steps){ if (steps == 0) 2b7a0: 71 f0 breq .+28 ; 0x2b7be void go_manhattan(int16_t x, int16_t y, int16_t z, int16_t acc, uint16_t min_delay_us){ int16_t length; // DBG(_n("x %d -> %d, "), x, _X); length = x - _X; go_start_stop(X_AXIS_MASK, length < 0 ? X_MINUS_MASK : X_PLUS_MASK, acc, min_delay_us, ABS(length)); 2b7a2: af 01 movw r20, r30 2b7a4: f7 ff sbrs r31, 7 2b7a6: 04 c0 rjmp .+8 ; 0x2b7b0 2b7a8: 44 27 eor r20, r20 2b7aa: 55 27 eor r21, r21 2b7ac: 4e 1b sub r20, r30 2b7ae: 5f 0b sbc r21, r31 2b7b0: 69 2f mov r22, r25 2b7b2: 66 1f adc r22, r22 2b7b4: 66 27 eor r22, r22 2b7b6: 66 1f adc r22, r22 2b7b8: 81 e0 ldi r24, 0x01 ; 1 2b7ba: 0f 94 e2 3f call 0x27fc4 ; 0x27fc4 // DBG(_n("y %d -> %d, "), y, _Y); length = y - _Y; 2b7be: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 2b7c2: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 2b7c6: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 2b7ca: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 2b7ce: 2b 96 adiw r28, 0x0b ; 11 2b7d0: 4e ad ldd r20, Y+62 ; 0x3e 2b7d2: 5f ad ldd r21, Y+63 ; 0x3f 2b7d4: 2b 97 sbiw r28, 0x0b ; 11 2b7d6: 48 1b sub r20, r24 2b7d8: 59 0b sbc r21, r25 go_start_stop(Y_AXIS_MASK, length < 0 ? Y_MINUS_MASK : Y_PLUS_MASK, acc, min_delay_us, ABS(length)); 2b7da: 57 fd sbrc r21, 7 2b7dc: b2 c0 rjmp .+356 ; 0x2b942 2b7de: 60 e0 ldi r22, 0x00 ; 0 update_position_1_step(axes, dir); } } void go_start_stop(uint8_t axes, uint8_t dir, int16_t acc, uint16_t min_delay_us, uint16_t steps){ if (steps == 0) 2b7e0: 41 15 cp r20, r1 2b7e2: 51 05 cpc r21, r1 2b7e4: 09 f0 breq .+2 ; 0x2b7e8 2b7e6: ae c0 rjmp .+348 ; 0x2b944 // DBG(_n("y %d -> %d, "), y, _Y); length = y - _Y; go_start_stop(Y_AXIS_MASK, length < 0 ? Y_MINUS_MASK : Y_PLUS_MASK, acc, min_delay_us, ABS(length)); // DBG(_n("z %d -> %d\n"), z, _Z); length = z - _Z; 2b7e8: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2b7ec: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2b7f0: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2b7f4: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2b7f8: 68 1a sub r6, r24 2b7fa: 79 0a sbc r7, r25 go_start_stop(Z_AXIS_MASK, length < 0 ? Z_MINUS_MASK : Z_PLUS_MASK, acc, min_delay_us, ABS(length)); 2b7fc: 77 fc sbrc r7, 7 2b7fe: ab c0 rjmp .+342 ; 0x2b956 2b800: 60 e0 ldi r22, 0x00 ; 0 update_position_1_step(axes, dir); } } void go_start_stop(uint8_t axes, uint8_t dir, int16_t acc, uint16_t min_delay_us, uint16_t steps){ if (steps == 0) 2b802: 61 14 cp r6, r1 2b804: 71 04 cpc r7, r1 2b806: 09 f0 breq .+2 ; 0x2b80a 2b808: a7 c0 rjmp .+334 ; 0x2b958 DBG(_n("Scan countdown: ")); for (uint8_t r = 0; r < 32; r++){ ///< Y axis for (uint8_t d = 0; d < 2; ++d){ go_manhattan((d & 1) ? (cx + 992) : (cx - 992), cy - 992 + r * 64, _Z, Z_ACCEL, Z_MIN_DELAY); xyzcal_lineXYZ_to((d & 1) ? (cx + 992) : (cx - 992), cy - 992 + r * 64, _Z, delay_us, 0); 2b80a: 40 91 be 06 lds r20, 0x06BE ; 0x8006be 2b80e: 50 91 bf 06 lds r21, 0x06BF ; 0x8006bf 2b812: 60 91 c0 06 lds r22, 0x06C0 ; 0x8006c0 2b816: 70 91 c1 06 lds r23, 0x06C1 ; 0x8006c1 2b81a: 00 e0 ldi r16, 0x00 ; 0 2b81c: 28 ec ldi r18, 0xC8 ; 200 2b81e: 30 e0 ldi r19, 0x00 ; 0 2b820: 2b 96 adiw r28, 0x0b ; 11 2b822: 6e ad ldd r22, Y+62 ; 0x3e 2b824: 7f ad ldd r23, Y+63 ; 0x3f 2b826: 2b 97 sbiw r28, 0x0b ; 11 2b828: c5 01 movw r24, r10 2b82a: 0e 94 d2 c2 call 0x185a4 ; 0x185a4 sm4_set_dir(X_AXIS, d); 2b82e: 63 2d mov r22, r3 2b830: 80 e0 ldi r24, 0x00 ; 0 2b832: 0f 94 05 36 call 0x26c0a ; 0x26c0a //@size=242 DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep host connection alive 2b836: 5f 92 push r5 2b838: 4f 92 push r4 2b83a: 83 e8 ldi r24, 0x83 ; 131 2b83c: 98 e9 ldi r25, 0x98 ; 152 2b83e: 9f 93 push r25 2b840: 8f 93 push r24 2b842: 0f 94 9e 9e call 0x33d3c ; 0x33d3c lcd_set_cursor(4,3); 2b846: 63 e0 ldi r22, 0x03 ; 3 2b848: 84 e0 ldi r24, 0x04 ; 4 2b84a: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_printf_P(PSTR("Countdown: %d "),64 - (r * 2 + d)); ////MSG_COUNTDOWN c=12 2b84e: 5f 92 push r5 2b850: 4f 92 push r4 2b852: 84 e7 ldi r24, 0x74 ; 116 2b854: 98 e9 ldi r25, 0x98 ; 152 2b856: 9f 93 push r25 2b858: 8f 93 push r24 2b85a: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 2b85e: 0f b6 in r0, 0x3f ; 63 2b860: f8 94 cli 2b862: de bf out 0x3e, r29 ; 62 2b864: 0f be out 0x3f, r0 ; 63 2b866: cd bf out 0x3d, r28 ; 61 2b868: 21 e0 ldi r18, 0x01 ; 1 2b86a: 30 e0 ldi r19, 0x00 ; 0 2b86c: 31 10 cpse r3, r1 2b86e: 02 c0 rjmp .+4 ; 0x2b874 2b870: 2f ef ldi r18, 0xFF ; 255 2b872: 3f ef ldi r19, 0xFF ; 255 2b874: 40 ec ldi r20, 0xC0 ; 192 2b876: 42 03 mulsu r20, r18 2b878: c0 01 movw r24, r0 2b87a: 43 9f mul r20, r19 2b87c: 90 0d add r25, r0 2b87e: 11 24 eor r1, r1 2b880: 67 96 adiw r28, 0x17 ; 23 2b882: 9f af std Y+63, r25 ; 0x3f 2b884: 8e af std Y+62, r24 ; 0x3e 2b886: 67 97 sbiw r28, 0x17 ; 23 2b888: 40 ee ldi r20, 0xE0 ; 224 2b88a: 53 e0 ldi r21, 0x03 ; 3 2b88c: 24 9f mul r18, r20 2b88e: 40 01 movw r8, r0 2b890: 25 9f mul r18, r21 2b892: 90 0c add r9, r0 2b894: 34 9f mul r19, r20 2b896: 90 0c add r9, r0 2b898: 11 24 eor r1, r1 2b89a: 63 96 adiw r28, 0x13 ; 19 2b89c: ee ad ldd r30, Y+62 ; 0x3e 2b89e: ff ad ldd r31, Y+63 ; 0x3f 2b8a0: 63 97 sbiw r28, 0x13 ; 19 2b8a2: 8e 0e add r8, r30 2b8a4: 9f 1e adc r9, r31 2b8a6: 9e 01 movw r18, r28 2b8a8: 2f 5f subi r18, 0xFF ; 255 2b8aa: 3f 4f sbci r19, 0xFF ; 255 2b8ac: 2d 96 adiw r28, 0x0d ; 13 2b8ae: 3f af std Y+63, r19 ; 0x3f 2b8b0: 2e af std Y+62, r18 ; 0x3e 2b8b2: 2d 97 sbiw r28, 0x0d ; 13 2b8b4: 61 96 adiw r28, 0x11 ; 17 2b8b6: 8e ad ldd r24, Y+62 ; 0x3e 2b8b8: 9f ad ldd r25, Y+63 ; 0x3f 2b8ba: 61 97 sbiw r28, 0x11 ; 17 2b8bc: 2f 96 adiw r28, 0x0f ; 15 2b8be: 9f af std Y+63, r25 ; 0x3f 2b8c0: 8e af std Y+62, r24 ; 0x3e 2b8c2: 2f 97 sbiw r28, 0x0f ; 15 2b8c4: 71 2c mov r7, r1 2b8c6: 61 2c mov r6, r1 for (uint8_t c = 0; c < 32; c++){ ///< X axis /// move to the next point and move Z up diagonally (if needed) current_delay_us = MAX_DELAY; 2b8c8: e0 e1 ldi r30, 0x10 ; 16 2b8ca: f7 e2 ldi r31, 0x27 ; 39 2b8cc: 27 96 adiw r28, 0x07 ; 7 2b8ce: ff af std Y+63, r31 ; 0x3f 2b8d0: ee af std Y+62, r30 ; 0x3e 2b8d2: 27 97 sbiw r28, 0x07 ; 7 const int16_t end_x = ((d & 1) ? 1 : -1) * (64 * (16 - c) - 32) + cx; const int16_t length_x = ABS(end_x - _X); 2b8d4: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 2b8d8: 90 91 b7 06 lds r25, 0x06B7 ; 0x8006b7 2b8dc: a0 91 b8 06 lds r26, 0x06B8 ; 0x8006b8 2b8e0: b0 91 b9 06 lds r27, 0x06B9 ; 0x8006b9 2b8e4: 84 01 movw r16, r8 2b8e6: 08 1b sub r16, r24 2b8e8: 19 0b sbc r17, r25 2b8ea: 17 ff sbrs r17, 7 2b8ec: 03 c0 rjmp .+6 ; 0x2b8f4 2b8ee: 11 95 neg r17 2b8f0: 01 95 neg r16 2b8f2: 11 09 sbc r17, r1 const int16_t half_x = length_x / 2; 2b8f4: 98 01 movw r18, r16 2b8f6: 35 95 asr r19 2b8f8: 27 95 ror r18 2b8fa: 65 96 adiw r28, 0x15 ; 21 2b8fc: 3f af std Y+63, r19 ; 0x3f 2b8fe: 2e af std Y+62, r18 ; 0x3e 2b900: 65 97 sbiw r28, 0x15 ; 21 /// don't go up if PINDA not triggered (optimization) const bool up = _PINDA; const uint8_t axes = up ? X_AXIS_MASK | Z_AXIS_MASK : X_AXIS_MASK; 2b902: 1c 9b sbis 0x03, 4 ; 3 2b904: 33 c0 rjmp .+102 ; 0x2b96c 2b906: 45 e0 ldi r20, 0x05 ; 5 2b908: 24 2e mov r2, r20 const uint8_t dir = Z_PLUS_MASK | (d & 1 ? X_MINUS_MASK : X_PLUS_MASK); accelerate(axes, dir, Z_ACCEL, current_delay_us, Z_MIN_DELAY, half_x); 2b90a: 65 96 adiw r28, 0x15 ; 21 2b90c: ae ac ldd r10, Y+62 ; 0x3e 2b90e: bf ac ldd r11, Y+63 ; 0x3f 2b910: 65 97 sbiw r28, 0x15 ; 21 } /// Goes defined number of steps while accelerating /// updates global positions void accelerate(uint8_t axes, uint8_t dir, int16_t acc, uint16_t &delay_us, uint16_t min_delay_us, uint16_t steps){ set_axes_dir(axes, dir); 2b912: 63 2d mov r22, r3 2b914: 82 2d mov r24, r2 2b916: 0e 94 79 c2 call 0x184f2 ; 0x184f2 while (steps--){ 2b91a: 31 e0 ldi r19, 0x01 ; 1 2b91c: a3 1a sub r10, r19 2b91e: b1 08 sbc r11, r1 2b920: 40 f1 brcs .+80 ; 0x2b972 accelerate_1_step(axes, acc, delay_us, min_delay_us); 2b922: 28 ec ldi r18, 0xC8 ; 200 2b924: 30 e0 ldi r19, 0x00 ; 0 2b926: a7 01 movw r20, r14 2b928: 68 ee ldi r22, 0xE8 ; 232 2b92a: 73 e0 ldi r23, 0x03 ; 3 2b92c: 82 2d mov r24, r2 2b92e: 0e 94 48 c1 call 0x18290 ; 0x18290 update_position_1_step(axes, dir); 2b932: 63 2d mov r22, r3 2b934: 82 2d mov r24, r2 2b936: 0e 94 92 c2 call 0x18524 ; 0x18524 2b93a: ef cf rjmp .-34 ; 0x2b91a uint16_t steps_to_go; DBG(_n("Scan countdown: ")); for (uint8_t r = 0; r < 32; r++){ ///< Y axis for (uint8_t d = 0; d < 2; ++d){ 2b93c: 33 24 eor r3, r3 2b93e: 33 94 inc r3 2b940: 11 cf rjmp .-478 ; 0x2b764 length = x - _X; go_start_stop(X_AXIS_MASK, length < 0 ? X_MINUS_MASK : X_PLUS_MASK, acc, min_delay_us, ABS(length)); // DBG(_n("y %d -> %d, "), y, _Y); length = y - _Y; go_start_stop(Y_AXIS_MASK, length < 0 ? Y_MINUS_MASK : Y_PLUS_MASK, acc, min_delay_us, ABS(length)); 2b942: 62 e0 ldi r22, 0x02 ; 2 2b944: 57 ff sbrs r21, 7 2b946: 03 c0 rjmp .+6 ; 0x2b94e 2b948: 51 95 neg r21 2b94a: 41 95 neg r20 2b94c: 51 09 sbc r21, r1 2b94e: 82 e0 ldi r24, 0x02 ; 2 2b950: 0f 94 e2 3f call 0x27fc4 ; 0x27fc4 2b954: 49 cf rjmp .-366 ; 0x2b7e8 // DBG(_n("z %d -> %d\n"), z, _Z); length = z - _Z; go_start_stop(Z_AXIS_MASK, length < 0 ? Z_MINUS_MASK : Z_PLUS_MASK, acc, min_delay_us, ABS(length)); 2b956: 64 e0 ldi r22, 0x04 ; 4 2b958: a3 01 movw r20, r6 2b95a: 77 fe sbrs r7, 7 2b95c: 03 c0 rjmp .+6 ; 0x2b964 2b95e: 51 95 neg r21 2b960: 41 95 neg r20 2b962: 51 09 sbc r21, r1 2b964: 84 e0 ldi r24, 0x04 ; 4 2b966: 0f 94 e2 3f call 0x27fc4 ; 0x27fc4 2b96a: 4f cf rjmp .-354 ; 0x2b80a const int16_t end_x = ((d & 1) ? 1 : -1) * (64 * (16 - c) - 32) + cx; const int16_t length_x = ABS(end_x - _X); const int16_t half_x = length_x / 2; /// don't go up if PINDA not triggered (optimization) const bool up = _PINDA; const uint8_t axes = up ? X_AXIS_MASK | Z_AXIS_MASK : X_AXIS_MASK; 2b96c: 22 24 eor r2, r2 2b96e: 23 94 inc r2 2b970: cc cf rjmp .-104 ; 0x2b90a const uint8_t dir = Z_PLUS_MASK | (d & 1 ? X_MINUS_MASK : X_PLUS_MASK); accelerate(axes, dir, Z_ACCEL, current_delay_us, Z_MIN_DELAY, half_x); go_and_stop(axes, dir, Z_ACCEL, current_delay_us, length_x - half_x); 2b972: 65 96 adiw r28, 0x15 ; 21 2b974: ee ad ldd r30, Y+62 ; 0x3e 2b976: ff ad ldd r31, Y+63 ; 0x3f 2b978: 65 97 sbiw r28, 0x15 ; 21 2b97a: 0e 1b sub r16, r30 2b97c: 1f 0b sbc r17, r31 2b97e: 23 96 adiw r28, 0x03 ; 3 2b980: 1f af std Y+63, r17 ; 0x3f 2b982: 0e af std Y+62, r16 ; 0x3e 2b984: 23 97 sbiw r28, 0x03 ; 3 } /// \param dir sets direction of movement /// updates global positions void go_and_stop(uint8_t axes, uint8_t dir, int16_t dec, uint16_t &delay_us, uint16_t steps){ set_axes_dir(axes, dir); 2b986: 63 2d mov r22, r3 2b988: 82 2d mov r24, r2 2b98a: 0e 94 79 c2 call 0x184f2 ; 0x184f2 while (go_and_stop_1_step(axes, dec, delay_us, steps)){ 2b98e: 9e 01 movw r18, r28 2b990: 2f 5b subi r18, 0xBF ; 191 2b992: 3f 4f sbci r19, 0xFF ; 255 2b994: a7 01 movw r20, r14 2b996: 68 ee ldi r22, 0xE8 ; 232 2b998: 73 e0 ldi r23, 0x03 ; 3 2b99a: 82 2d mov r24, r2 2b99c: 0e 94 ef c1 call 0x183de ; 0x183de 2b9a0: 88 23 and r24, r24 2b9a2: 29 f0 breq .+10 ; 0x2b9ae update_position_1_step(axes, dir); 2b9a4: 63 2d mov r22, r3 2b9a6: 82 2d mov r24, r2 2b9a8: 0e 94 92 c2 call 0x18524 ; 0x18524 2b9ac: f0 cf rjmp .-32 ; 0x2b98e z_trig = min_z; /// move up to un-trigger (surpress hysteresis) sm4_set_dir(Z_AXIS, Z_PLUS); 2b9ae: 60 e0 ldi r22, 0x00 ; 0 2b9b0: 82 e0 ldi r24, 0x02 ; 2 2b9b2: 0f 94 05 36 call 0x26c0a ; 0x26c0a /// speed up from stop, go half the way current_delay_us = MAX_DELAY; 2b9b6: 20 e1 ldi r18, 0x10 ; 16 2b9b8: 37 e2 ldi r19, 0x27 ; 39 2b9ba: 27 96 adiw r28, 0x07 ; 7 2b9bc: 3f af std Y+63, r19 ; 0x3f 2b9be: 2e af std Y+62, r18 ; 0x3e 2b9c0: 27 97 sbiw r28, 0x07 ; 7 for (start_z = _Z; _Z < (max_z + start_z) / 2; ++_Z_){ 2b9c2: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 2b9c6: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 2b9ca: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 2b9ce: 30 91 c1 06 lds r19, 0x06C1 ; 0x8006c1 2b9d2: 00 5a subi r16, 0xA0 ; 160 2b9d4: 16 4f sbci r17, 0xF6 ; 246 2b9d6: 17 ff sbrs r17, 7 2b9d8: 02 c0 rjmp .+4 ; 0x2b9de 2b9da: 0f 5f subi r16, 0xFF ; 255 2b9dc: 1f 4f sbci r17, 0xFF ; 255 2b9de: 15 95 asr r17 2b9e0: 07 95 ror r16 2b9e2: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2b9e6: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2b9ea: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2b9ee: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2b9f2: 80 17 cp r24, r16 2b9f4: 91 07 cpc r25, r17 2b9f6: f4 f4 brge .+60 ; 0x2ba34 if (!_PINDA){ 2b9f8: 1c 9b sbis 0x03, 4 ; 3 2b9fa: 1c c0 rjmp .+56 ; 0x2ba34 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); 2b9fc: 28 ec ldi r18, 0xC8 ; 200 2b9fe: 30 e0 ldi r19, 0x00 ; 0 2ba00: a7 01 movw r20, r14 2ba02: 68 ee ldi r22, 0xE8 ; 232 2ba04: 73 e0 ldi r23, 0x03 ; 3 2ba06: 84 e0 ldi r24, 0x04 ; 4 2ba08: 0e 94 48 c1 call 0x18290 ; 0x18290 /// move up to un-trigger (surpress hysteresis) sm4_set_dir(Z_AXIS, Z_PLUS); /// speed up from stop, go half the way current_delay_us = MAX_DELAY; for (start_z = _Z; _Z < (max_z + start_z) / 2; ++_Z_){ 2ba0c: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2ba10: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2ba14: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2ba18: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2ba1c: 01 96 adiw r24, 0x01 ; 1 2ba1e: a1 1d adc r26, r1 2ba20: b1 1d adc r27, r1 2ba22: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 2ba26: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 2ba2a: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 2ba2e: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 2ba32: d7 cf rjmp .-82 ; 0x2b9e2 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } if (_PINDA){ 2ba34: 1c 9b sbis 0x03, 4 ; 3 2ba36: 3f c0 rjmp .+126 ; 0x2bab6 steps_to_go = MAX(0, max_z - _Z); 2ba38: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2ba3c: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2ba40: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2ba44: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2ba48: e0 e6 ldi r30, 0x60 ; 96 2ba4a: f9 e0 ldi r31, 0x09 ; 9 2ba4c: e8 1b sub r30, r24 2ba4e: f9 0b sbc r31, r25 2ba50: cf 01 movw r24, r30 2ba52: f7 ff sbrs r31, 7 2ba54: 02 c0 rjmp .+4 ; 0x2ba5a 2ba56: 90 e0 ldi r25, 0x00 ; 0 2ba58: 80 e0 ldi r24, 0x00 ; 0 2ba5a: 25 96 adiw r28, 0x05 ; 5 2ba5c: 9f af std Y+63, r25 ; 0x3f 2ba5e: 8e af std Y+62, r24 ; 0x3e 2ba60: 25 97 sbiw r28, 0x05 ; 5 while (_PINDA && _Z < max_z){ 2ba62: 1c 9b sbis 0x03, 4 ; 3 2ba64: 28 c0 rjmp .+80 ; 0x2bab6 2ba66: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2ba6a: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2ba6e: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2ba72: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2ba76: 80 36 cpi r24, 0x60 ; 96 2ba78: 99 40 sbci r25, 0x09 ; 9 2ba7a: ec f4 brge .+58 ; 0x2bab6 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); 2ba7c: 9e 01 movw r18, r28 2ba7e: 2d 5b subi r18, 0xBD ; 189 2ba80: 3f 4f sbci r19, 0xFF ; 255 2ba82: a7 01 movw r20, r14 2ba84: 68 ee ldi r22, 0xE8 ; 232 2ba86: 73 e0 ldi r23, 0x03 ; 3 2ba88: 84 e0 ldi r24, 0x04 ; 4 2ba8a: 0e 94 ef c1 call 0x183de ; 0x183de ++_Z_; 2ba8e: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2ba92: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2ba96: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2ba9a: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2ba9e: 01 96 adiw r24, 0x01 ; 1 2baa0: a1 1d adc r26, r1 2baa2: b1 1d adc r27, r1 2baa4: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 2baa8: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 2baac: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 2bab0: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 2bab4: d6 cf rjmp .-84 ; 0x2ba62 /// \returns steps done /// updates global positions void stop_smoothly(uint8_t axes, uint8_t dir, int16_t dec, uint16_t &delay_us){ if (dec <= 0) return; set_axes_dir(axes, dir); 2bab6: 60 e0 ldi r22, 0x00 ; 0 2bab8: 84 e0 ldi r24, 0x04 ; 4 2baba: 0e 94 79 c2 call 0x184f2 ; 0x184f2 while (delay_us < MAX_DELAY){ 2babe: f7 01 movw r30, r14 2bac0: 20 81 ld r18, Z 2bac2: 31 81 ldd r19, Z+1 ; 0x01 2bac4: 20 31 cpi r18, 0x10 ; 16 2bac6: f7 e2 ldi r31, 0x27 ; 39 2bac8: 3f 07 cpc r19, r31 2baca: 58 f4 brcc .+22 ; 0x2bae2 accelerate_1_step(axes, -dec, delay_us, delay_us); 2bacc: a7 01 movw r20, r14 2bace: 68 e1 ldi r22, 0x18 ; 24 2bad0: 7c ef ldi r23, 0xFC ; 252 2bad2: 84 e0 ldi r24, 0x04 ; 4 2bad4: 0e 94 48 c1 call 0x18290 ; 0x18290 update_position_1_step(axes, dir); 2bad8: 60 e0 ldi r22, 0x00 ; 0 2bada: 84 e0 ldi r24, 0x04 ; 4 2badc: 0e 94 92 c2 call 0x18524 ; 0x18524 2bae0: ee cf rjmp .-36 ; 0x2babe } } stop_smoothly(Z_AXIS_MASK, Z_PLUS_MASK, Z_ACCEL, current_delay_us); /// move down to trigger sm4_set_dir(Z_AXIS, Z_MINUS); 2bae2: 61 e0 ldi r22, 0x01 ; 1 2bae4: 82 e0 ldi r24, 0x02 ; 2 2bae6: 0f 94 05 36 call 0x26c0a ; 0x26c0a /// speed up current_delay_us = MAX_DELAY; 2baea: 20 e1 ldi r18, 0x10 ; 16 2baec: 37 e2 ldi r19, 0x27 ; 39 2baee: f7 01 movw r30, r14 2baf0: 31 83 std Z+1, r19 ; 0x01 2baf2: 20 83 st Z, r18 for (start_z = _Z; _Z > (min_z + start_z) / 2; --_Z_){ 2baf4: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 2baf8: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 2bafc: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 2bb00: 30 91 c1 06 lds r19, 0x06C1 ; 0x8006c1 2bb04: 0c 0d add r16, r12 2bb06: 1d 1d adc r17, r13 2bb08: 17 ff sbrs r17, 7 2bb0a: 02 c0 rjmp .+4 ; 0x2bb10 2bb0c: 0f 5f subi r16, 0xFF ; 255 2bb0e: 1f 4f sbci r17, 0xFF ; 255 2bb10: 15 95 asr r17 2bb12: 07 95 ror r16 2bb14: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bb18: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bb1c: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bb20: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bb24: 08 17 cp r16, r24 2bb26: 19 07 cpc r17, r25 2bb28: 0c f0 brlt .+2 ; 0x2bb2c 2bb2a: d9 c0 rjmp .+434 ; 0x2bcde if (_PINDA){ 2bb2c: 1c 9b sbis 0x03, 4 ; 3 2bb2e: bb c0 rjmp .+374 ; 0x2bca6 z_trig = _Z; 2bb30: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 2bb34: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 2bb38: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 2bb3c: 30 91 c1 06 lds r19, 0x06C1 ; 0x8006c1 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } /// slow down if (!_PINDA){ 2bb40: 1c 99 sbic 0x03, 4 ; 3 2bb42: 28 c0 rjmp .+80 ; 0x2bb94 steps_to_go = MAX(0, _Z - min_z); 2bb44: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bb48: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bb4c: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bb50: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bb54: 8c 19 sub r24, r12 2bb56: 9d 09 sbc r25, r13 2bb58: 97 ff sbrs r25, 7 2bb5a: 02 c0 rjmp .+4 ; 0x2bb60 2bb5c: 90 e0 ldi r25, 0x00 ; 0 2bb5e: 80 e0 ldi r24, 0x00 ; 0 2bb60: 25 96 adiw r28, 0x05 ; 5 2bb62: 9f af std Y+63, r25 ; 0x3f 2bb64: 8e af std Y+62, r24 ; 0x3e 2bb66: 25 97 sbiw r28, 0x05 ; 5 while (!_PINDA && _Z > min_z){ 2bb68: 1c 99 sbic 0x03, 4 ; 3 2bb6a: 0c c0 rjmp .+24 ; 0x2bb84 2bb6c: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bb70: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bb74: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bb78: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bb7c: c8 16 cp r12, r24 2bb7e: d9 06 cpc r13, r25 2bb80: 0c f4 brge .+2 ; 0x2bb84 2bb82: af c0 rjmp .+350 ; 0x2bce2 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); --_Z_; } z_trig = _Z; 2bb84: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 2bb88: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 2bb8c: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 2bb90: 30 91 c1 06 lds r19, 0x06C1 ; 0x8006c1 } /// slow down to stop but not lower than min_z while (_Z > min_z && current_delay_us < MAX_DELAY){ 2bb94: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bb98: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bb9c: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bba0: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bba4: c8 16 cp r12, r24 2bba6: d9 06 cpc r13, r25 2bba8: 3c f4 brge .+14 ; 0x2bbb8 2bbaa: f7 01 movw r30, r14 2bbac: 80 81 ld r24, Z 2bbae: 91 81 ldd r25, Z+1 ; 0x01 2bbb0: 80 31 cpi r24, 0x10 ; 16 2bbb2: 97 42 sbci r25, 0x27 ; 39 2bbb4: 08 f4 brcc .+2 ; 0x2bbb8 2bbb6: b2 c0 rjmp .+356 ; 0x2bd1c 2bbb8: 0c 19 sub r16, r12 2bbba: 1d 09 sbc r17, r13 accelerate_1_step(Z_AXIS_MASK, -Z_ACCEL, current_delay_us, Z_MIN_DELAY); --_Z_; } if (d == 0){ 2bbbc: 31 10 cpse r3, r1 2bbbe: ca c0 rjmp .+404 ; 0x2bd54 line_buffer[c] = (uint16_t)(z_trig - min_z); 2bbc0: f3 01 movw r30, r6 2bbc2: ee 0f add r30, r30 2bbc4: ff 1f adc r31, r31 2bbc6: 21 e0 ldi r18, 0x01 ; 1 2bbc8: 30 e0 ldi r19, 0x00 ; 0 2bbca: 2c 0f add r18, r28 2bbcc: 3d 1f adc r19, r29 2bbce: e2 0f add r30, r18 2bbd0: f3 1f adc r31, r19 2bbd2: 11 83 std Z+1, r17 ; 0x01 2bbd4: 00 83 st Z, r16 2bbd6: ff ef ldi r31, 0xFF ; 255 2bbd8: 6f 1a sub r6, r31 2bbda: 7f 0a sbc r7, r31 2bbdc: 67 96 adiw r28, 0x17 ; 23 2bbde: 2e ad ldd r18, Y+62 ; 0x3e 2bbe0: 3f ad ldd r19, Y+63 ; 0x3f 2bbe2: 67 97 sbiw r28, 0x17 ; 23 2bbe4: 82 0e add r8, r18 2bbe6: 93 1e adc r9, r19 2bbe8: 2d 96 adiw r28, 0x0d ; 13 2bbea: 8e ad ldd r24, Y+62 ; 0x3e 2bbec: 9f ad ldd r25, Y+63 ; 0x3f 2bbee: 2d 97 sbiw r28, 0x0d ; 13 2bbf0: 02 97 sbiw r24, 0x02 ; 2 2bbf2: 2d 96 adiw r28, 0x0d ; 13 2bbf4: 9f af std Y+63, r25 ; 0x3f 2bbf6: 8e af std Y+62, r24 ; 0x3e 2bbf8: 2d 97 sbiw r28, 0x0d ; 13 2bbfa: 2f 96 adiw r28, 0x0f ; 15 2bbfc: ee ad ldd r30, Y+62 ; 0x3e 2bbfe: ff ad ldd r31, Y+63 ; 0x3f 2bc00: 2f 97 sbiw r28, 0x0f ; 15 2bc02: 31 97 sbiw r30, 0x01 ; 1 2bc04: 2f 96 adiw r28, 0x0f ; 15 2bc06: ff af std Y+63, r31 ; 0x3f 2bc08: ee af std Y+62, r30 ; 0x3e 2bc0a: 2f 97 sbiw r28, 0x0f ; 15 //@size=242 DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep host connection alive lcd_set_cursor(4,3); lcd_printf_P(PSTR("Countdown: %d "),64 - (r * 2 + d)); ////MSG_COUNTDOWN c=12 for (uint8_t c = 0; c < 32; c++){ ///< X axis 2bc0c: f0 e2 ldi r31, 0x20 ; 32 2bc0e: 6f 16 cp r6, r31 2bc10: 71 04 cpc r7, r1 2bc12: 09 f0 breq .+2 ; 0x2bc16 2bc14: 59 ce rjmp .-846 ; 0x2b8c8 2bc16: 21 e0 ldi r18, 0x01 ; 1 2bc18: 42 1a sub r4, r18 2bc1a: 51 08 sbc r5, r1 uint16_t steps_to_go; DBG(_n("Scan countdown: ")); for (uint8_t r = 0; r < 32; r++){ ///< Y axis for (uint8_t d = 0; d < 2; ++d){ 2bc1c: 31 e0 ldi r19, 0x01 ; 1 2bc1e: 33 12 cpse r3, r19 2bc20: 8d ce rjmp .-742 ; 0x2b93c 2bc22: 61 96 adiw r28, 0x11 ; 17 2bc24: 8e ad ldd r24, Y+62 ; 0x3e 2bc26: 9f ad ldd r25, Y+63 ; 0x3f 2bc28: 61 97 sbiw r28, 0x11 ; 17 2bc2a: 80 96 adiw r24, 0x20 ; 32 2bc2c: 61 96 adiw r28, 0x11 ; 17 2bc2e: 9f af std Y+63, r25 ; 0x3f 2bc30: 8e af std Y+62, r24 ; 0x3e 2bc32: 61 97 sbiw r28, 0x11 ; 17 2bc34: 2b 96 adiw r28, 0x0b ; 11 2bc36: ee ad ldd r30, Y+62 ; 0x3e 2bc38: ff ad ldd r31, Y+63 ; 0x3f 2bc3a: 2b 97 sbiw r28, 0x0b ; 11 2bc3c: e0 5c subi r30, 0xC0 ; 192 2bc3e: ff 4f sbci r31, 0xFF ; 255 2bc40: 2b 96 adiw r28, 0x0b ; 11 2bc42: ff af std Y+63, r31 ; 0x3f 2bc44: ee af std Y+62, r30 ; 0x3e 2bc46: 2b 97 sbiw r28, 0x0b ; 11 2bc48: 29 96 adiw r28, 0x09 ; 9 2bc4a: 2e ad ldd r18, Y+62 ; 0x3e 2bc4c: 3f ad ldd r19, Y+63 ; 0x3f 2bc4e: 29 97 sbiw r28, 0x09 ; 9 2bc50: 22 50 subi r18, 0x02 ; 2 2bc52: 31 09 sbc r19, r1 2bc54: 29 96 adiw r28, 0x09 ; 9 2bc56: 3f af std Y+63, r19 ; 0x3f 2bc58: 2e af std Y+62, r18 ; 0x3e 2bc5a: 29 97 sbiw r28, 0x09 ; 9 int16_t start_z; uint16_t steps_to_go; DBG(_n("Scan countdown: ")); for (uint8_t r = 0; r < 32; r++){ ///< Y axis 2bc5c: 23 2b or r18, r19 2bc5e: 09 f0 breq .+2 ; 0x2bc62 2bc60: 72 cd rjmp .-1308 ; 0x2b746 pixels[(uint16_t)r * 32 + (31 - c)] = (uint8_t)MIN((uint32_t)255, ((uint32_t)line_buffer[31 - c] + (z_trig - min_z)) / 2); } } } } DBG(endl); 2bc62: 82 e7 ldi r24, 0x72 ; 114 2bc64: 98 e9 ldi r25, 0x98 ; 152 2bc66: 9f 93 push r25 2bc68: 8f 93 push r24 2bc6a: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 2bc6e: 0f 90 pop r0 2bc70: 0f 90 pop r0 } 2bc72: c6 5a subi r28, 0xA6 ; 166 2bc74: df 4f sbci r29, 0xFF ; 255 2bc76: 0f b6 in r0, 0x3f ; 63 2bc78: f8 94 cli 2bc7a: de bf out 0x3e, r29 ; 62 2bc7c: 0f be out 0x3f, r0 ; 63 2bc7e: cd bf out 0x3d, r28 ; 61 2bc80: df 91 pop r29 2bc82: cf 91 pop r28 2bc84: 1f 91 pop r17 2bc86: 0f 91 pop r16 2bc88: ff 90 pop r15 2bc8a: ef 90 pop r14 2bc8c: df 90 pop r13 2bc8e: cf 90 pop r12 2bc90: bf 90 pop r11 2bc92: af 90 pop r10 2bc94: 9f 90 pop r9 2bc96: 8f 90 pop r8 2bc98: 7f 90 pop r7 2bc9a: 6f 90 pop r6 2bc9c: 5f 90 pop r5 2bc9e: 4f 90 pop r4 2bca0: 3f 90 pop r3 2bca2: 2f 90 pop r2 2bca4: 08 95 ret for (start_z = _Z; _Z > (min_z + start_z) / 2; --_Z_){ if (_PINDA){ z_trig = _Z; break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); 2bca6: 28 ec ldi r18, 0xC8 ; 200 2bca8: 30 e0 ldi r19, 0x00 ; 0 2bcaa: a7 01 movw r20, r14 2bcac: 68 ee ldi r22, 0xE8 ; 232 2bcae: 73 e0 ldi r23, 0x03 ; 3 2bcb0: 84 e0 ldi r24, 0x04 ; 4 2bcb2: 0e 94 48 c1 call 0x18290 ; 0x18290 /// move down to trigger sm4_set_dir(Z_AXIS, Z_MINUS); /// speed up current_delay_us = MAX_DELAY; for (start_z = _Z; _Z > (min_z + start_z) / 2; --_Z_){ 2bcb6: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bcba: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bcbe: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bcc2: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bcc6: 01 97 sbiw r24, 0x01 ; 1 2bcc8: a1 09 sbc r26, r1 2bcca: b1 09 sbc r27, r1 2bccc: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 2bcd0: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 2bcd4: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 2bcd8: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 2bcdc: 1b cf rjmp .-458 ; 0x2bb14 2bcde: 86 01 movw r16, r12 2bce0: 2f cf rjmp .-418 ; 0x2bb40 } /// slow down if (!_PINDA){ steps_to_go = MAX(0, _Z - min_z); while (!_PINDA && _Z > min_z){ go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); 2bce2: 9e 01 movw r18, r28 2bce4: 2d 5b subi r18, 0xBD ; 189 2bce6: 3f 4f sbci r19, 0xFF ; 255 2bce8: a7 01 movw r20, r14 2bcea: 68 ee ldi r22, 0xE8 ; 232 2bcec: 73 e0 ldi r23, 0x03 ; 3 2bcee: 84 e0 ldi r24, 0x04 ; 4 2bcf0: 0e 94 ef c1 call 0x183de ; 0x183de --_Z_; 2bcf4: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bcf8: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bcfc: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bd00: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bd04: 01 97 sbiw r24, 0x01 ; 1 2bd06: a1 09 sbc r26, r1 2bd08: b1 09 sbc r27, r1 2bd0a: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 2bd0e: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 2bd12: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 2bd16: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 2bd1a: 26 cf rjmp .-436 ; 0x2bb68 } z_trig = _Z; } /// slow down to stop but not lower than min_z while (_Z > min_z && current_delay_us < MAX_DELAY){ accelerate_1_step(Z_AXIS_MASK, -Z_ACCEL, current_delay_us, Z_MIN_DELAY); 2bd1c: 28 ec ldi r18, 0xC8 ; 200 2bd1e: 30 e0 ldi r19, 0x00 ; 0 2bd20: a7 01 movw r20, r14 2bd22: 68 e1 ldi r22, 0x18 ; 24 2bd24: 7c ef ldi r23, 0xFC ; 252 2bd26: 84 e0 ldi r24, 0x04 ; 4 2bd28: 0e 94 48 c1 call 0x18290 ; 0x18290 --_Z_; 2bd2c: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bd30: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bd34: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bd38: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bd3c: 01 97 sbiw r24, 0x01 ; 1 2bd3e: a1 09 sbc r26, r1 2bd40: b1 09 sbc r27, r1 2bd42: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 2bd46: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 2bd4a: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 2bd4e: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 2bd52: 20 cf rjmp .-448 ; 0x2bb94 line_buffer[c] = (uint16_t)(z_trig - min_z); } else { /// !!! data reversed in X // DBG(_n("%04x"), ((uint32_t)line_buffer[31 - c] + (z_trig - min_z)) / 2); /// save average of both directions (filters effect of hysteresis) pixels[(uint16_t)r * 32 + (31 - c)] = (uint8_t)MIN((uint32_t)255, ((uint32_t)line_buffer[31 - c] + (z_trig - min_z)) / 2); 2bd54: 2d 96 adiw r28, 0x0d ; 13 2bd56: ee ad ldd r30, Y+62 ; 0x3e 2bd58: ff ad ldd r31, Y+63 ; 0x3f 2bd5a: 2d 97 sbiw r28, 0x0d ; 13 2bd5c: 86 ad ldd r24, Z+62 ; 0x3e 2bd5e: 97 ad ldd r25, Z+63 ; 0x3f 2bd60: 01 2e mov r0, r17 2bd62: 00 0c add r0, r0 2bd64: 22 0b sbc r18, r18 2bd66: 33 0b sbc r19, r19 2bd68: 08 0f add r16, r24 2bd6a: 19 1f adc r17, r25 2bd6c: 21 1d adc r18, r1 2bd6e: 31 1d adc r19, r1 2bd70: 36 95 lsr r19 2bd72: 27 95 ror r18 2bd74: 17 95 ror r17 2bd76: 07 95 ror r16 2bd78: 0f 3f cpi r16, 0xFF ; 255 2bd7a: 11 05 cpc r17, r1 2bd7c: 21 05 cpc r18, r1 2bd7e: 31 05 cpc r19, r1 2bd80: 29 f0 breq .+10 ; 0x2bd8c 2bd82: 20 f0 brcs .+8 ; 0x2bd8c 2bd84: 0f ef ldi r16, 0xFF ; 255 2bd86: 10 e0 ldi r17, 0x00 ; 0 2bd88: 20 e0 ldi r18, 0x00 ; 0 2bd8a: 30 e0 ldi r19, 0x00 ; 0 2bd8c: 2f 96 adiw r28, 0x0f ; 15 2bd8e: ee ad ldd r30, Y+62 ; 0x3e 2bd90: ff ad ldd r31, Y+63 ; 0x3f 2bd92: 2f 97 sbiw r28, 0x0f ; 15 2bd94: 07 8f std Z+31, r16 ; 0x1f 2bd96: 1f cf rjmp .-450 ; 0x2bbd6 0002bd98 : /// Moves printer to absolute position [x,y,z] defined in millimeters bool xyzcal_lineXYZ_to_float(pos_mm_t x, pos_mm_t y, pos_mm_t z, uint16_t delay_us, int8_t check_pinda){ return xyzcal_lineXYZ_to(mm_2_pos(x), mm_2_pos(y), mm_2_pos(z), delay_us, check_pinda); } bool xyzcal_spiral2(int16_t cx, int16_t cy, int16_t z0, int16_t dz, int16_t radius, int16_t rotation, uint16_t delay_us, int8_t check_pinda, uint16_t* pad) 2bd98: 2f 92 push r2 2bd9a: 3f 92 push r3 2bd9c: 4f 92 push r4 2bd9e: 5f 92 push r5 2bda0: 6f 92 push r6 2bda2: 7f 92 push r7 2bda4: 8f 92 push r8 2bda6: 9f 92 push r9 2bda8: af 92 push r10 2bdaa: bf 92 push r11 2bdac: cf 92 push r12 2bdae: df 92 push r13 2bdb0: ef 92 push r14 2bdb2: ff 92 push r15 2bdb4: 0f 93 push r16 2bdb6: 1f 93 push r17 2bdb8: cf 93 push r28 2bdba: df 93 push r29 2bdbc: cd b7 in r28, 0x3d ; 61 2bdbe: de b7 in r29, 0x3e ; 62 2bdc0: 6c 97 sbiw r28, 0x1c ; 28 2bdc2: 0f b6 in r0, 0x3f ; 63 2bdc4: f8 94 cli 2bdc6: de bf out 0x3e, r29 ; 62 2bdc8: 0f be out 0x3f, r0 ; 63 2bdca: cd bf out 0x3d, r28 ; 61 2bdcc: 6c 01 movw r12, r24 2bdce: 5b 01 movw r10, r22 2bdd0: 4a 01 movw r8, r20 2bdd2: 19 01 movw r2, r18 2bdd4: 18 87 std Y+8, r17 ; 0x08 2bdd6: 0f 83 std Y+7, r16 ; 0x07 2bdd8: fa 82 std Y+2, r15 ; 0x02 2bdda: e9 82 std Y+1, r14 ; 0x01 uint8_t dad = 0; //delta angle [deg] uint8_t dad_min = 4; //delta angle min [deg] uint8_t dad_max = 16; //delta angle max [deg] uint8_t k = 720 / (dad_max - dad_min); //delta calculation constant ad = 0; if (pad) ad = *pad % 720; 2bddc: d7 01 movw r26, r14 2bdde: 8d 91 ld r24, X+ 2bde0: 9c 91 ld r25, X 2bde2: 60 ed ldi r22, 0xD0 ; 208 2bde4: 72 e0 ldi r23, 0x02 ; 2 2bde6: 0f 94 a5 a0 call 0x3414a ; 0x3414a <__udivmodhi4> 2bdea: 9c 8f std Y+28, r25 ; 0x1c 2bdec: 8b 8f std Y+27, r24 ; 0x1b //@size=214 DBG(_n("xyzcal_spiral2 cx=%d cy=%d z0=%d dz=%d radius=%d ad=%d\n"), cx, cy, z0, dz, radius, ad); 2bdee: 9f 93 push r25 2bdf0: 8f 93 push r24 2bdf2: 3f 92 push r3 2bdf4: 2f 93 push r18 2bdf6: 1f 92 push r1 2bdf8: 84 e6 ldi r24, 0x64 ; 100 2bdfa: 8f 93 push r24 2bdfc: 9f 92 push r9 2bdfe: 8f 92 push r8 2be00: bf 92 push r11 2be02: af 92 push r10 2be04: df 92 push r13 2be06: cf 92 push r12 2be08: 8a e3 ldi r24, 0x3A ; 58 2be0a: 98 e9 ldi r25, 0x98 ; 152 2be0c: 9f 93 push r25 2be0e: 8f 93 push r24 2be10: 0f 94 9e 9e call 0x33d3c ; 0x33d3c 2be14: 0f b6 in r0, 0x3f ; 63 2be16: f8 94 cli 2be18: de bf out 0x3e, r29 ; 62 2be1a: 0f be out 0x3f, r0 ; 63 2be1c: cd bf out 0x3d, r28 ; 61 r = (float)(((uint32_t)ad) * radius) / 720; } else { dad = dad_max - ((719 - ad) / k); r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2be1e: 22 27 eor r18, r18 2be20: 33 27 eor r19, r19 2be22: 22 19 sub r18, r2 2be24: 33 09 sbc r19, r3 2be26: 3a 8f std Y+26, r19 ; 0x1a 2be28: 29 8f std Y+25, r18 ; 0x19 } ar = radians(ad + rotation); int x = (int)(cx + (cos(ar) * r)); int y = (int)(cy + (sin(ar) * r)); int z = (int)(z0 - ((float)((int32_t)dz * ad) / 720)); 2be2a: c4 01 movw r24, r8 2be2c: 99 0c add r9, r9 2be2e: aa 0b sbc r26, r26 2be30: bb 0b sbc r27, r27 2be32: 89 87 std Y+9, r24 ; 0x09 2be34: 9a 87 std Y+10, r25 ; 0x0a 2be36: ab 87 std Y+11, r26 ; 0x0b 2be38: bc 87 std Y+12, r27 ; 0x0c dad = dad_max - ((719 - ad) / k); r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; } ar = radians(ad + rotation); int x = (int)(cx + (cos(ar) * r)); int y = (int)(cy + (sin(ar) * r)); 2be3a: 95 01 movw r18, r10 2be3c: bb 0c add r11, r11 2be3e: 44 0b sbc r20, r20 2be40: 55 0b sbc r21, r21 2be42: 29 8b std Y+17, r18 ; 0x11 2be44: 3a 8b std Y+18, r19 ; 0x12 2be46: 4b 8b std Y+19, r20 ; 0x13 2be48: 5c 8b std Y+20, r21 ; 0x14 { dad = dad_max - ((719 - ad) / k); r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; } ar = radians(ad + rotation); int x = (int)(cx + (cos(ar) * r)); 2be4a: c6 01 movw r24, r12 2be4c: dd 0c add r13, r13 2be4e: aa 0b sbc r26, r26 2be50: bb 0b sbc r27, r27 2be52: 8d 8b std Y+21, r24 ; 0x15 2be54: 9e 8b std Y+22, r25 ; 0x16 2be56: af 8b std Y+23, r26 ; 0x17 2be58: b8 8f std Y+24, r27 ; 0x18 // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) { if (radius > 0) 2be5a: 12 14 cp r1, r2 2be5c: 13 04 cpc r1, r3 2be5e: 0c f0 brlt .+2 ; 0x2be62 2be60: ba c0 rjmp .+372 ; 0x2bfd6 { dad = dad_max - (ad / k); 2be62: 8b 8d ldd r24, Y+27 ; 0x1b 2be64: 9c 8d ldd r25, Y+28 ; 0x1c 2be66: 6c e3 ldi r22, 0x3C ; 60 2be68: 70 e0 ldi r23, 0x00 ; 0 2be6a: 0f 94 a5 a0 call 0x3414a ; 0x3414a <__udivmodhi4> 2be6e: 10 e1 ldi r17, 0x10 ; 16 2be70: 16 1b sub r17, r22 r = (float)(((uint32_t)ad) * radius) / 720; 2be72: 2b 8d ldd r18, Y+27 ; 0x1b 2be74: 3c 8d ldd r19, Y+28 ; 0x1c 2be76: d1 01 movw r26, r2 } else { dad = dad_max - ((719 - ad) / k); r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2be78: 0f 94 fc a0 call 0x341f8 ; 0x341f8 <__usmulhisi3> 2be7c: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 2be80: 20 e0 ldi r18, 0x00 ; 0 2be82: 30 e0 ldi r19, 0x00 ; 0 2be84: 44 e3 ldi r20, 0x34 ; 52 2be86: 54 e4 ldi r21, 0x44 ; 68 2be88: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2be8c: 6b 01 movw r12, r22 2be8e: 7c 01 movw r14, r24 } ar = radians(ad + rotation); 2be90: 6f 81 ldd r22, Y+7 ; 0x07 2be92: 78 85 ldd r23, Y+8 ; 0x08 2be94: eb 8d ldd r30, Y+27 ; 0x1b 2be96: fc 8d ldd r31, Y+28 ; 0x1c 2be98: 6e 0f add r22, r30 2be9a: 7f 1f adc r23, r31 2be9c: 90 e0 ldi r25, 0x00 ; 0 2be9e: 80 e0 ldi r24, 0x00 ; 0 2bea0: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 2bea4: 25 e3 ldi r18, 0x35 ; 53 2bea6: 3a ef ldi r19, 0xFA ; 250 2bea8: 4e e8 ldi r20, 0x8E ; 142 2beaa: 5c e3 ldi r21, 0x3C ; 60 2beac: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2beb0: 4b 01 movw r8, r22 2beb2: 5c 01 movw r10, r24 int x = (int)(cx + (cos(ar) * r)); 2beb4: 0f 94 fe a1 call 0x343fc ; 0x343fc 2beb8: 6b 83 std Y+3, r22 ; 0x03 2beba: 7c 83 std Y+4, r23 ; 0x04 2bebc: 8d 83 std Y+5, r24 ; 0x05 2bebe: 9e 83 std Y+6, r25 ; 0x06 int y = (int)(cy + (sin(ar) * r)); 2bec0: c5 01 movw r24, r10 2bec2: b4 01 movw r22, r8 2bec4: 0f 94 c4 a4 call 0x34988 ; 0x34988 2bec8: 2b 01 movw r4, r22 2beca: 3c 01 movw r6, r24 int z = (int)(z0 - ((float)((int32_t)dz * ad) / 720)); 2becc: 69 85 ldd r22, Y+9 ; 0x09 2bece: 7a 85 ldd r23, Y+10 ; 0x0a 2bed0: 8b 85 ldd r24, Y+11 ; 0x0b 2bed2: 9c 85 ldd r25, Y+12 ; 0x0c 2bed4: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2bed8: 4b 01 movw r8, r22 2beda: 5c 01 movw r10, r24 2bedc: 2b 8d ldd r18, Y+27 ; 0x1b 2bede: 3c 8d ldd r19, Y+28 ; 0x1c 2bee0: a4 e6 ldi r26, 0x64 ; 100 2bee2: b0 e0 ldi r27, 0x00 ; 0 2bee4: 0f 94 7c a0 call 0x340f8 ; 0x340f8 <__umulhisi3> 2bee8: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2beec: 20 e0 ldi r18, 0x00 ; 0 2beee: 30 e0 ldi r19, 0x00 ; 0 2bef0: 44 e3 ldi r20, 0x34 ; 52 2bef2: 54 e4 ldi r21, 0x44 ; 68 2bef4: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2bef8: 9b 01 movw r18, r22 2befa: ac 01 movw r20, r24 2befc: c5 01 movw r24, r10 2befe: b4 01 movw r22, r8 2bf00: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 2bf04: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 2bf08: 6d 87 std Y+13, r22 ; 0x0d 2bf0a: 7e 87 std Y+14, r23 ; 0x0e 2bf0c: 8f 87 std Y+15, r24 ; 0x0f 2bf0e: 98 8b std Y+16, r25 ; 0x10 dad = dad_max - ((719 - ad) / k); r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; } ar = radians(ad + rotation); int x = (int)(cx + (cos(ar) * r)); int y = (int)(cy + (sin(ar) * r)); 2bf10: 69 89 ldd r22, Y+17 ; 0x11 2bf12: 7a 89 ldd r23, Y+18 ; 0x12 2bf14: 8b 89 ldd r24, Y+19 ; 0x13 2bf16: 9c 89 ldd r25, Y+20 ; 0x14 2bf18: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2bf1c: 4b 01 movw r8, r22 2bf1e: 5c 01 movw r10, r24 2bf20: a3 01 movw r20, r6 2bf22: 92 01 movw r18, r4 2bf24: c7 01 movw r24, r14 2bf26: b6 01 movw r22, r12 2bf28: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2bf2c: 9b 01 movw r18, r22 2bf2e: ac 01 movw r20, r24 2bf30: c5 01 movw r24, r10 2bf32: b4 01 movw r22, r8 2bf34: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2bf38: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 2bf3c: 4b 01 movw r8, r22 { dad = dad_max - ((719 - ad) / k); r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; } ar = radians(ad + rotation); int x = (int)(cx + (cos(ar) * r)); 2bf3e: 6d 89 ldd r22, Y+21 ; 0x15 2bf40: 7e 89 ldd r23, Y+22 ; 0x16 2bf42: 8f 89 ldd r24, Y+23 ; 0x17 2bf44: 98 8d ldd r25, Y+24 ; 0x18 2bf46: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2bf4a: 2b 01 movw r4, r22 2bf4c: 3c 01 movw r6, r24 2bf4e: a7 01 movw r20, r14 2bf50: 96 01 movw r18, r12 2bf52: 6b 81 ldd r22, Y+3 ; 0x03 2bf54: 7c 81 ldd r23, Y+4 ; 0x04 2bf56: 8d 81 ldd r24, Y+5 ; 0x05 2bf58: 9e 81 ldd r25, Y+6 ; 0x06 2bf5a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2bf5e: 9b 01 movw r18, r22 2bf60: ac 01 movw r20, r24 2bf62: c3 01 movw r24, r6 2bf64: b2 01 movw r22, r4 2bf66: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2bf6a: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 2bf6e: cb 01 movw r24, r22 int y = (int)(cy + (sin(ar) * r)); int z = (int)(z0 - ((float)((int32_t)dz * ad) / 720)); if (xyzcal_lineXYZ_to(x, y, z, delay_us, check_pinda)) 2bf70: 01 e0 ldi r16, 0x01 ; 1 2bf72: 20 e4 ldi r18, 0x40 ; 64 2bf74: 31 e0 ldi r19, 0x01 ; 1 2bf76: 4d 85 ldd r20, Y+13 ; 0x0d 2bf78: 5e 85 ldd r21, Y+14 ; 0x0e 2bf7a: b4 01 movw r22, r8 2bf7c: 0e 94 d2 c2 call 0x185a4 ; 0x185a4 2bf80: 21 2f mov r18, r17 2bf82: 30 e0 ldi r19, 0x00 ; 0 2bf84: 88 23 and r24, r24 2bf86: b9 f1 breq .+110 ; 0x2bff6 2bf88: 4b 8d ldd r20, Y+27 ; 0x1b 2bf8a: 5c 8d ldd r21, Y+28 ; 0x1c 2bf8c: 42 0f add r20, r18 2bf8e: 53 1f adc r21, r19 { ad += dad + 1; 2bf90: 4f 5f subi r20, 0xFF ; 255 2bf92: 5f 4f sbci r21, 0xFF ; 255 2bf94: 5c 8f std Y+28, r21 ; 0x1c 2bf96: 4b 8f std Y+27, r20 ; 0x1b ret = true; break; } ad += dad; } if (pad) *pad = ad; 2bf98: eb 8d ldd r30, Y+27 ; 0x1b 2bf9a: fc 8d ldd r31, Y+28 ; 0x1c 2bf9c: a9 81 ldd r26, Y+1 ; 0x01 2bf9e: ba 81 ldd r27, Y+2 ; 0x02 2bfa0: ed 93 st X+, r30 2bfa2: fc 93 st X, r31 // if(ret){ // lcd_set_cursor(0, 4); // lcd_print(" "); // } return ret; } 2bfa4: 6c 96 adiw r28, 0x1c ; 28 2bfa6: 0f b6 in r0, 0x3f ; 63 2bfa8: f8 94 cli 2bfaa: de bf out 0x3e, r29 ; 62 2bfac: 0f be out 0x3f, r0 ; 63 2bfae: cd bf out 0x3d, r28 ; 61 2bfb0: df 91 pop r29 2bfb2: cf 91 pop r28 2bfb4: 1f 91 pop r17 2bfb6: 0f 91 pop r16 2bfb8: ff 90 pop r15 2bfba: ef 90 pop r14 2bfbc: df 90 pop r13 2bfbe: cf 90 pop r12 2bfc0: bf 90 pop r11 2bfc2: af 90 pop r10 2bfc4: 9f 90 pop r9 2bfc6: 8f 90 pop r8 2bfc8: 7f 90 pop r7 2bfca: 6f 90 pop r6 2bfcc: 5f 90 pop r5 2bfce: 4f 90 pop r4 2bfd0: 3f 90 pop r3 2bfd2: 2f 90 pop r2 2bfd4: 08 95 ret dad = dad_max - (ad / k); r = (float)(((uint32_t)ad) * radius) / 720; } else { dad = dad_max - ((719 - ad) / k); 2bfd6: 2f ec ldi r18, 0xCF ; 207 2bfd8: 32 e0 ldi r19, 0x02 ; 2 2bfda: ab 8d ldd r26, Y+27 ; 0x1b 2bfdc: bc 8d ldd r27, Y+28 ; 0x1c 2bfde: 2a 1b sub r18, r26 2bfe0: 3b 0b sbc r19, r27 2bfe2: c9 01 movw r24, r18 2bfe4: 6c e3 ldi r22, 0x3C ; 60 2bfe6: 70 e0 ldi r23, 0x00 ; 0 2bfe8: 0f 94 a5 a0 call 0x3414a ; 0x3414a <__udivmodhi4> 2bfec: 10 e1 ldi r17, 0x10 ; 16 2bfee: 16 1b sub r17, r22 r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2bff0: a9 8d ldd r26, Y+25 ; 0x19 2bff2: ba 8d ldd r27, Y+26 ; 0x1a 2bff4: 41 cf rjmp .-382 ; 0x2be78 // lcd_set_cursor(0, 4); // char text[10]; // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) 2bff6: 2f 5f subi r18, 0xFF ; 255 2bff8: 3f 4f sbci r19, 0xFF ; 255 2bffa: ab 8d ldd r26, Y+27 ; 0x1b 2bffc: bc 8d ldd r27, Y+28 ; 0x1c 2bffe: a2 0f add r26, r18 2c000: b3 1f adc r27, r19 2c002: bc 8f std Y+28, r27 ; 0x1c 2c004: ab 8f std Y+27, r26 ; 0x1b 2c006: a0 3d cpi r26, 0xD0 ; 208 2c008: b2 40 sbci r27, 0x02 ; 2 2c00a: 08 f4 brcc .+2 ; 0x2c00e 2c00c: 26 cf rjmp .-436 ; 0x2be5a 2c00e: c4 cf rjmp .-120 ; 0x2bf98 0002c010 : float mesh_bed_leveling::get_z(float x, float y) { 2c010: 2f 92 push r2 2c012: 3f 92 push r3 2c014: 4f 92 push r4 2c016: 5f 92 push r5 2c018: 6f 92 push r6 2c01a: 7f 92 push r7 2c01c: 8f 92 push r8 2c01e: 9f 92 push r9 2c020: af 92 push r10 2c022: bf 92 push r11 2c024: cf 92 push r12 2c026: df 92 push r13 2c028: ef 92 push r14 2c02a: ff 92 push r15 2c02c: 0f 93 push r16 2c02e: 1f 93 push r17 2c030: cf 93 push r28 2c032: df 93 push r29 2c034: 00 d0 rcall .+0 ; 0x2c036 2c036: 00 d0 rcall .+0 ; 0x2c038 2c038: 00 d0 rcall .+0 ; 0x2c03a 2c03a: 1f 92 push r1 2c03c: cd b7 in r28, 0x3d ; 61 2c03e: de b7 in r29, 0x3e ; 62 2c040: 2b 01 movw r4, r22 2c042: 3c 01 movw r6, r24 2c044: 49 01 movw r8, r18 2c046: 5a 01 movw r10, r20 int i, j; float s, t; i = int(floor((x - (BED_X0 + X_PROBE_OFFSET_FROM_EXTRUDER)) / x_mesh_density)); 2c048: 20 e0 ldi r18, 0x00 ; 0 2c04a: 30 e0 ldi r19, 0x00 ; 0 2c04c: 40 ec ldi r20, 0xC0 ; 192 2c04e: 51 e4 ldi r21, 0x41 ; 65 2c050: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 2c054: 20 e0 ldi r18, 0x00 ; 0 2c056: 30 e0 ldi r19, 0x00 ; 0 2c058: 48 e0 ldi r20, 0x08 ; 8 2c05a: 52 e4 ldi r21, 0x42 ; 66 2c05c: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2c060: 6b 01 movw r12, r22 2c062: 7c 01 movw r14, r24 2c064: 0f 94 ab a2 call 0x34556 ; 0x34556 2c068: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> if (i < 0) { i = 0; 2c06c: 31 2c mov r3, r1 2c06e: 21 2c mov r2, r1 float mesh_bed_leveling::get_z(float x, float y) { int i, j; float s, t; i = int(floor((x - (BED_X0 + X_PROBE_OFFSET_FROM_EXTRUDER)) / x_mesh_density)); if (i < 0) { 2c070: 77 fd sbrc r23, 7 2c072: 1e c0 rjmp .+60 ; 0x2c0b0 2c074: 1b 01 movw r2, r22 2c076: 66 30 cpi r22, 0x06 ; 6 2c078: 71 05 cpc r23, r1 2c07a: 1c f0 brlt .+6 ; 0x2c082 2c07c: 45 e0 ldi r20, 0x05 ; 5 2c07e: 24 2e mov r2, r20 2c080: 31 2c mov r3, r1 mesh_bed_leveling() { reset(); } void reset(); static float get_x(int i) { return BED_X(i) + X_PROBE_OFFSET_FROM_EXTRUDER; } 2c082: 82 2d mov r24, r2 2c084: 0f 94 65 8b call 0x316ca ; 0x316ca 2c088: 20 e0 ldi r18, 0x00 ; 0 2c08a: 30 e0 ldi r19, 0x00 ; 0 2c08c: 48 eb ldi r20, 0xB8 ; 184 2c08e: 51 e4 ldi r21, 0x41 ; 65 2c090: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2c094: 9b 01 movw r18, r22 2c096: ac 01 movw r20, r24 s = (x - (BED_X0 + X_PROBE_OFFSET_FROM_EXTRUDER)) / x_mesh_density; } else { if (i > MESH_NUM_X_POINTS - 2) { i = MESH_NUM_X_POINTS - 2; } s = (x - get_x(i)) / x_mesh_density; 2c098: c3 01 movw r24, r6 2c09a: b2 01 movw r22, r4 2c09c: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 2c0a0: 20 e0 ldi r18, 0x00 ; 0 2c0a2: 30 e0 ldi r19, 0x00 ; 0 2c0a4: 48 e0 ldi r20, 0x08 ; 8 2c0a6: 52 e4 ldi r21, 0x42 ; 66 2c0a8: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2c0ac: 6b 01 movw r12, r22 2c0ae: 7c 01 movw r14, r24 } j = int(floor((y - (BED_Y0 + Y_PROBE_OFFSET_FROM_EXTRUDER)) / y_mesh_density)); 2c0b0: 20 e0 ldi r18, 0x00 ; 0 2c0b2: 30 e0 ldi r19, 0x00 ; 0 2c0b4: 40 ec ldi r20, 0xC0 ; 192 2c0b6: 50 e4 ldi r21, 0x40 ; 64 2c0b8: c5 01 movw r24, r10 2c0ba: b4 01 movw r22, r8 2c0bc: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 2c0c0: 20 e0 ldi r18, 0x00 ; 0 2c0c2: 30 e0 ldi r19, 0x00 ; 0 2c0c4: 48 e0 ldi r20, 0x08 ; 8 2c0c6: 52 e4 ldi r21, 0x42 ; 66 2c0c8: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2c0cc: 69 83 std Y+1, r22 ; 0x01 2c0ce: 7a 83 std Y+2, r23 ; 0x02 2c0d0: 8b 83 std Y+3, r24 ; 0x03 2c0d2: 9c 83 std Y+4, r25 ; 0x04 2c0d4: 0f 94 ab a2 call 0x34556 ; 0x34556 2c0d8: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> if (j < 0) { 2c0dc: 77 fd sbrc r23, 7 2c0de: da c0 rjmp .+436 ; 0x2c294 2c0e0: 7a 87 std Y+10, r23 ; 0x0a 2c0e2: 69 87 std Y+9, r22 ; 0x09 2c0e4: 66 30 cpi r22, 0x06 ; 6 2c0e6: 71 05 cpc r23, r1 2c0e8: 24 f0 brlt .+8 ; 0x2c0f2 2c0ea: e5 e0 ldi r30, 0x05 ; 5 2c0ec: f0 e0 ldi r31, 0x00 ; 0 2c0ee: fa 87 std Y+10, r31 ; 0x0a 2c0f0: e9 87 std Y+9, r30 ; 0x09 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 2c0f2: 89 85 ldd r24, Y+9 ; 0x09 2c0f4: 0f 94 65 8b call 0x316ca ; 0x316ca 2c0f8: 20 e0 ldi r18, 0x00 ; 0 2c0fa: 30 e0 ldi r19, 0x00 ; 0 2c0fc: 40 ea ldi r20, 0xA0 ; 160 2c0fe: 50 e4 ldi r21, 0x40 ; 64 2c100: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2c104: 9b 01 movw r18, r22 2c106: ac 01 movw r20, r24 t = (y - (BED_Y0 + Y_PROBE_OFFSET_FROM_EXTRUDER)) / y_mesh_density; } else { if (j > MESH_NUM_Y_POINTS - 2) { j = MESH_NUM_Y_POINTS - 2; } t = (y - get_y(j)) / y_mesh_density; 2c108: c5 01 movw r24, r10 2c10a: b4 01 movw r22, r8 2c10c: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 2c110: 20 e0 ldi r18, 0x00 ; 0 2c112: 30 e0 ldi r19, 0x00 ; 0 2c114: 48 e0 ldi r20, 0x08 ; 8 2c116: 52 e4 ldi r21, 0x42 ; 66 2c118: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2c11c: 69 83 std Y+1, r22 ; 0x01 2c11e: 7a 83 std Y+2, r23 ; 0x02 2c120: 8b 83 std Y+3, r24 ; 0x03 2c122: 9c 83 std Y+4, r25 ; 0x04 } float si = 1.f-s; 2c124: a7 01 movw r20, r14 2c126: 96 01 movw r18, r12 2c128: 60 e0 ldi r22, 0x00 ; 0 2c12a: 70 e0 ldi r23, 0x00 ; 0 2c12c: 80 e8 ldi r24, 0x80 ; 128 2c12e: 9f e3 ldi r25, 0x3F ; 63 2c130: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 2c134: 2b 01 movw r4, r22 2c136: 3c 01 movw r6, r24 float z0 = si * z_values[j ][i] + s * z_values[j ][i+1]; 2c138: 91 01 movw r18, r2 2c13a: 2f 5f subi r18, 0xFF ; 255 2c13c: 3f 4f sbci r19, 0xFF ; 255 2c13e: 3e 83 std Y+6, r19 ; 0x06 2c140: 2d 83 std Y+5, r18 ; 0x05 float z1 = si * z_values[j+1][i] + s * z_values[j+1][i+1]; 2c142: 89 85 ldd r24, Y+9 ; 0x09 2c144: 9a 85 ldd r25, Y+10 ; 0x0a 2c146: 01 96 adiw r24, 0x01 ; 1 2c148: 98 87 std Y+8, r25 ; 0x08 2c14a: 8f 83 std Y+7, r24 ; 0x07 } t = (y - get_y(j)) / y_mesh_density; } float si = 1.f-s; float z0 = si * z_values[j ][i] + s * z_values[j ][i+1]; 2c14c: 27 e0 ldi r18, 0x07 ; 7 2c14e: e9 85 ldd r30, Y+9 ; 0x09 2c150: fa 85 ldd r31, Y+10 ; 0x0a 2c152: 2e 9f mul r18, r30 2c154: 80 01 movw r16, r0 2c156: 2f 9f mul r18, r31 2c158: 10 0d add r17, r0 2c15a: 11 24 eor r1, r1 2c15c: f8 01 movw r30, r16 2c15e: e2 0d add r30, r2 2c160: f3 1d adc r31, r3 2c162: ee 0f add r30, r30 2c164: ff 1f adc r31, r31 2c166: ee 0f add r30, r30 2c168: ff 1f adc r31, r31 2c16a: e4 56 subi r30, 0x64 ; 100 2c16c: fd 4e sbci r31, 0xED ; 237 2c16e: 21 81 ldd r18, Z+1 ; 0x01 2c170: 32 81 ldd r19, Z+2 ; 0x02 2c172: 43 81 ldd r20, Z+3 ; 0x03 2c174: 54 81 ldd r21, Z+4 ; 0x04 2c176: c3 01 movw r24, r6 2c178: b2 01 movw r22, r4 2c17a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2c17e: 4b 01 movw r8, r22 2c180: 5c 01 movw r10, r24 2c182: ed 81 ldd r30, Y+5 ; 0x05 2c184: fe 81 ldd r31, Y+6 ; 0x06 2c186: e0 0f add r30, r16 2c188: f1 1f adc r31, r17 2c18a: ee 0f add r30, r30 2c18c: ff 1f adc r31, r31 2c18e: ee 0f add r30, r30 2c190: ff 1f adc r31, r31 2c192: e4 56 subi r30, 0x64 ; 100 2c194: fd 4e sbci r31, 0xED ; 237 2c196: 21 81 ldd r18, Z+1 ; 0x01 2c198: 32 81 ldd r19, Z+2 ; 0x02 2c19a: 43 81 ldd r20, Z+3 ; 0x03 2c19c: 54 81 ldd r21, Z+4 ; 0x04 2c19e: c7 01 movw r24, r14 2c1a0: b6 01 movw r22, r12 2c1a2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2c1a6: 9b 01 movw r18, r22 2c1a8: ac 01 movw r20, r24 2c1aa: c5 01 movw r24, r10 2c1ac: b4 01 movw r22, r8 2c1ae: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2c1b2: 4b 01 movw r8, r22 2c1b4: 5c 01 movw r10, r24 float z1 = si * z_values[j+1][i] + s * z_values[j+1][i+1]; return (1.f-t) * z0 + t * z1; 2c1b6: 29 81 ldd r18, Y+1 ; 0x01 2c1b8: 3a 81 ldd r19, Y+2 ; 0x02 2c1ba: 4b 81 ldd r20, Y+3 ; 0x03 2c1bc: 5c 81 ldd r21, Y+4 ; 0x04 2c1be: 60 e0 ldi r22, 0x00 ; 0 2c1c0: 70 e0 ldi r23, 0x00 ; 0 2c1c2: 80 e8 ldi r24, 0x80 ; 128 2c1c4: 9f e3 ldi r25, 0x3F ; 63 2c1c6: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 2c1ca: 9b 01 movw r18, r22 2c1cc: ac 01 movw r20, r24 2c1ce: c5 01 movw r24, r10 2c1d0: b4 01 movw r22, r8 2c1d2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2c1d6: 4b 01 movw r8, r22 2c1d8: 5c 01 movw r10, r24 t = (y - get_y(j)) / y_mesh_density; } float si = 1.f-s; float z0 = si * z_values[j ][i] + s * z_values[j ][i+1]; float z1 = si * z_values[j+1][i] + s * z_values[j+1][i+1]; 2c1da: 27 e0 ldi r18, 0x07 ; 7 2c1dc: ef 81 ldd r30, Y+7 ; 0x07 2c1de: f8 85 ldd r31, Y+8 ; 0x08 2c1e0: 2e 9f mul r18, r30 2c1e2: c0 01 movw r24, r0 2c1e4: 2f 9f mul r18, r31 2c1e6: 90 0d add r25, r0 2c1e8: 11 24 eor r1, r1 2c1ea: 9a 87 std Y+10, r25 ; 0x0a 2c1ec: 89 87 std Y+9, r24 ; 0x09 2c1ee: fc 01 movw r30, r24 2c1f0: e2 0d add r30, r2 2c1f2: f3 1d adc r31, r3 2c1f4: ee 0f add r30, r30 2c1f6: ff 1f adc r31, r31 2c1f8: ee 0f add r30, r30 2c1fa: ff 1f adc r31, r31 2c1fc: e4 56 subi r30, 0x64 ; 100 2c1fe: fd 4e sbci r31, 0xED ; 237 2c200: 21 81 ldd r18, Z+1 ; 0x01 2c202: 32 81 ldd r19, Z+2 ; 0x02 2c204: 43 81 ldd r20, Z+3 ; 0x03 2c206: 54 81 ldd r21, Z+4 ; 0x04 2c208: c3 01 movw r24, r6 2c20a: b2 01 movw r22, r4 2c20c: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2c210: 2b 01 movw r4, r22 2c212: 3c 01 movw r6, r24 2c214: 89 85 ldd r24, Y+9 ; 0x09 2c216: 9a 85 ldd r25, Y+10 ; 0x0a 2c218: ed 81 ldd r30, Y+5 ; 0x05 2c21a: fe 81 ldd r31, Y+6 ; 0x06 2c21c: 8e 0f add r24, r30 2c21e: 9f 1f adc r25, r31 2c220: 88 0f add r24, r24 2c222: 99 1f adc r25, r25 2c224: 88 0f add r24, r24 2c226: 99 1f adc r25, r25 2c228: 84 56 subi r24, 0x64 ; 100 2c22a: 9d 4e sbci r25, 0xED ; 237 2c22c: fc 01 movw r30, r24 2c22e: 21 81 ldd r18, Z+1 ; 0x01 2c230: 32 81 ldd r19, Z+2 ; 0x02 2c232: 43 81 ldd r20, Z+3 ; 0x03 2c234: 54 81 ldd r21, Z+4 ; 0x04 2c236: c7 01 movw r24, r14 2c238: b6 01 movw r22, r12 2c23a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2c23e: 9b 01 movw r18, r22 2c240: ac 01 movw r20, r24 2c242: c3 01 movw r24, r6 2c244: b2 01 movw r22, r4 2c246: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> return (1.f-t) * z0 + t * z1; 2c24a: 29 81 ldd r18, Y+1 ; 0x01 2c24c: 3a 81 ldd r19, Y+2 ; 0x02 2c24e: 4b 81 ldd r20, Y+3 ; 0x03 2c250: 5c 81 ldd r21, Y+4 ; 0x04 2c252: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2c256: 9b 01 movw r18, r22 2c258: ac 01 movw r20, r24 2c25a: c5 01 movw r24, r10 2c25c: b4 01 movw r22, r8 2c25e: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> } 2c262: 2a 96 adiw r28, 0x0a ; 10 2c264: 0f b6 in r0, 0x3f ; 63 2c266: f8 94 cli 2c268: de bf out 0x3e, r29 ; 62 2c26a: 0f be out 0x3f, r0 ; 63 2c26c: cd bf out 0x3d, r28 ; 61 2c26e: df 91 pop r29 2c270: cf 91 pop r28 2c272: 1f 91 pop r17 2c274: 0f 91 pop r16 2c276: ff 90 pop r15 2c278: ef 90 pop r14 2c27a: df 90 pop r13 2c27c: cf 90 pop r12 2c27e: bf 90 pop r11 2c280: af 90 pop r10 2c282: 9f 90 pop r9 2c284: 8f 90 pop r8 2c286: 7f 90 pop r7 2c288: 6f 90 pop r6 2c28a: 5f 90 pop r5 2c28c: 4f 90 pop r4 2c28e: 3f 90 pop r3 2c290: 2f 90 pop r2 2c292: 08 95 ret s = (x - get_x(i)) / x_mesh_density; } j = int(floor((y - (BED_Y0 + Y_PROBE_OFFSET_FROM_EXTRUDER)) / y_mesh_density)); if (j < 0) { j = 0; 2c294: 1a 86 std Y+10, r1 ; 0x0a 2c296: 19 86 std Y+9, r1 ; 0x09 2c298: 45 cf rjmp .-374 ; 0x2c124 0002c29a : void ProtocolLogic::SendVersion(uint8_t stage) { SendMsg(RequestMsg(RequestMsgCodes::Version, stage)); scopeState = (ScopeState)((uint_fast8_t)ScopeState::S0Sent + stage); } void ProtocolLogic::SendReadRegister(uint8_t index, ScopeState nextState) { 2c29a: 1f 93 push r17 2c29c: cf 93 push r28 2c29e: df 93 push r29 2c2a0: 00 d0 rcall .+0 ; 0x2c2a2 2c2a2: 1f 92 push r1 2c2a4: 1f 92 push r1 2c2a6: cd b7 in r28, 0x3d ; 61 2c2a8: de b7 in r29, 0x3e ; 62 2c2aa: 16 2f mov r17, r22 SendMsg(RequestMsg(RequestMsgCodes::Read, index)); 2c2ac: 48 2f mov r20, r24 2c2ae: 62 e5 ldi r22, 0x52 ; 82 2c2b0: ce 01 movw r24, r28 2c2b2: 01 96 adiw r24, 0x01 ; 1 2c2b4: 0f 94 f3 86 call 0x30de6 ; 0x30de6 2c2b8: 49 81 ldd r20, Y+1 ; 0x01 2c2ba: 5a 81 ldd r21, Y+2 ; 0x02 2c2bc: 6b 81 ldd r22, Y+3 ; 0x03 2c2be: 7c 81 ldd r23, Y+4 ; 0x04 2c2c0: 8d 81 ldd r24, Y+5 ; 0x05 2c2c2: 0f 94 22 3c call 0x27844 ; 0x27844 scopeState = nextState; 2c2c6: 10 93 28 12 sts 0x1228, r17 ; 0x801228 } 2c2ca: 0f 90 pop r0 2c2cc: 0f 90 pop r0 2c2ce: 0f 90 pop r0 2c2d0: 0f 90 pop r0 2c2d2: 0f 90 pop r0 2c2d4: df 91 pop r29 2c2d6: cf 91 pop r28 2c2d8: 1f 91 pop r17 2c2da: 08 95 ret 0002c2dc : SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); scopeState = ScopeState::QuerySent; } void ProtocolLogic::StartReading8bitRegisters() { regIndex = 0; 2c2dc: 10 92 73 12 sts 0x1273, r1 ; 0x801273 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); 2c2e0: ef ee ldi r30, 0xEF ; 239 2c2e2: fc e9 ldi r31, 0x9C ; 156 2c2e4: 84 91 lpm r24, Z 2c2e6: 67 e0 ldi r22, 0x07 ; 7 2c2e8: 0d 94 4d 61 jmp 0x2c29a ; 0x2c29a 0002c2ec : regIndex = 0; SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); } ProtocolLogic::ScopeState __attribute__((noinline)) ProtocolLogic::ProcessRead16bitRegister(ProtocolLogic::ScopeState stateAtEnd) { regs16[regIndex] = rsp.paramValue; 2c2ec: e0 91 73 12 lds r30, 0x1273 ; 0x801273 2c2f0: ae 2f mov r26, r30 2c2f2: b0 e0 ldi r27, 0x00 ; 0 2c2f4: aa 0f add r26, r26 2c2f6: bb 1f adc r27, r27 2c2f8: a3 59 subi r26, 0x93 ; 147 2c2fa: bd 4e sbci r27, 0xED ; 237 2c2fc: 20 91 40 12 lds r18, 0x1240 ; 0x801240 2c300: 30 91 41 12 lds r19, 0x1241 ; 0x801241 2c304: 2d 93 st X+, r18 2c306: 3c 93 st X, r19 ++regIndex; 2c308: ef 5f subi r30, 0xFF ; 255 2c30a: e0 93 73 12 sts 0x1273, r30 ; 0x801273 if (regIndex >= regs16Count) { 2c30e: e2 30 cpi r30, 0x02 ; 2 2c310: 40 f4 brcc .+16 ; 0x2c322 return stateAtEnd; } else { SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 2c312: f0 e0 ldi r31, 0x00 ; 0 2c314: ea 52 subi r30, 0x2A ; 42 2c316: f3 46 sbci r31, 0x63 ; 99 2c318: 84 91 lpm r24, Z 2c31a: 68 e0 ldi r22, 0x08 ; 8 2c31c: 0f 94 4d 61 call 0x2c29a ; 0x2c29a } return ScopeState::Reading16bitRegisters; 2c320: 88 e0 ldi r24, 0x08 ; 8 } 2c322: 08 95 ret 0002c324 : regIndex = 0; SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } void ProtocolLogic::ProcessRead8bitRegister() { regs8[regIndex] = rsp.paramValue; 2c324: e0 91 73 12 lds r30, 0x1273 ; 0x801273 2c328: ae 2f mov r26, r30 2c32a: b0 e0 ldi r27, 0x00 ; 0 2c32c: a6 59 subi r26, 0x96 ; 150 2c32e: bd 4e sbci r27, 0xED ; 237 2c330: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2c334: 8c 93 st X, r24 ++regIndex; 2c336: ef 5f subi r30, 0xFF ; 255 2c338: e0 93 73 12 sts 0x1273, r30 ; 0x801273 if (regIndex >= regs8Count) { 2c33c: e3 30 cpi r30, 0x03 ; 3 2c33e: 40 f0 brcs .+16 ; 0x2c350 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } } void ProtocolLogic::StartReading16bitRegisters() { regIndex = 0; 2c340: 10 92 73 12 sts 0x1273, r1 ; 0x801273 SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 2c344: e6 ed ldi r30, 0xD6 ; 214 2c346: fc e9 ldi r31, 0x9C ; 156 2c348: 84 91 lpm r24, Z 2c34a: 68 e0 ldi r22, 0x08 ; 8 ++regIndex; if (regIndex >= regs8Count) { // proceed with reading 16bit registers StartReading16bitRegisters(); } else { SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); 2c34c: 0d 94 4d 61 jmp 0x2c29a ; 0x2c29a 2c350: f0 e0 ldi r31, 0x00 ; 0 2c352: e1 51 subi r30, 0x11 ; 17 2c354: f3 46 sbci r31, 0x63 ; 99 2c356: 84 91 lpm r24, Z 2c358: 67 e0 ldi r22, 0x07 ; 7 2c35a: f8 cf rjmp .-16 ; 0x2c34c 0002c35c : if (!ExpectsResponse()) { ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { 2c35c: cf 93 push r28 2c35e: df 93 push r29 2c360: 00 d0 rcall .+0 ; 0x2c362 2c362: 00 d0 rcall .+0 ; 0x2c364 2c364: 00 d0 rcall .+0 ; 0x2c366 2c366: 1f 92 push r1 2c368: cd b7 in r28, 0x3d ; 61 2c36a: de b7 in r29, 0x3e ; 62 switch (plannedRq.code) { 2c36c: 80 91 2f 12 lds r24, 0x122F ; 0x80122f 2c370: 82 34 cpi r24, 0x42 ; 66 2c372: 09 f4 brne .+2 ; 0x2c376 2c374: 46 c0 rjmp .+140 ; 0x2c402 2c376: b8 f5 brcc .+110 ; 0x2c3e6 2c378: 88 23 and r24, r24 2c37a: 09 f4 brne .+2 ; 0x2c37e 2c37c: 72 c0 rjmp .+228 ; 0x2c462 plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; default: // commands currentScope = Scope::Command; 2c37e: 84 e0 ldi r24, 0x04 ; 4 2c380: 80 93 27 12 sts 0x1227, r24 ; 0x801227 2c384: 85 e0 ldi r24, 0x05 ; 5 2c386: ef e2 ldi r30, 0x2F ; 47 2c388: f2 e1 ldi r31, 0x12 ; 18 2c38a: de 01 movw r26, r28 2c38c: 16 96 adiw r26, 0x06 ; 6 2c38e: 01 90 ld r0, Z+ 2c390: 0d 92 st X+, r0 2c392: 8a 95 dec r24 2c394: e1 f7 brne .-8 ; 0x2c38e StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 2c396: 85 e0 ldi r24, 0x05 ; 5 2c398: fe 01 movw r30, r28 2c39a: 36 96 adiw r30, 0x06 ; 6 2c39c: aa e2 ldi r26, 0x2A ; 42 2c39e: b2 e1 ldi r27, 0x12 ; 18 2c3a0: 01 90 ld r0, Z+ 2c3a2: 0d 92 st X+, r0 2c3a4: 8a 95 dec r24 2c3a6: e1 f7 brne .-8 ; 0x2c3a0 SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); 2c3a8: 40 e0 ldi r20, 0x00 ; 0 2c3aa: 60 e0 ldi r22, 0x00 ; 0 2c3ac: ce 01 movw r24, r28 2c3ae: 01 96 adiw r24, 0x01 ; 1 2c3b0: 0f 94 f3 86 call 0x30de6 ; 0x30de6 2c3b4: 85 e0 ldi r24, 0x05 ; 5 2c3b6: fe 01 movw r30, r28 2c3b8: 31 96 adiw r30, 0x01 ; 1 2c3ba: af e2 ldi r26, 0x2F ; 47 2c3bc: b2 e1 ldi r27, 0x12 ; 18 2c3be: 01 90 ld r0, Z+ 2c3c0: 0d 92 st X+, r0 2c3c2: 8a 95 dec r24 2c3c4: e1 f7 brne .-8 ; 0x2c3be void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 2c3c6: 85 e0 ldi r24, 0x05 ; 5 2c3c8: 80 93 28 12 sts 0x1228, r24 ; 0x801228 SendMsg(rq); 2c3cc: 40 91 2a 12 lds r20, 0x122A ; 0x80122a 2c3d0: 50 91 2b 12 lds r21, 0x122B ; 0x80122b 2c3d4: 60 91 2c 12 lds r22, 0x122C ; 0x80122c 2c3d8: 70 91 2d 12 lds r23, 0x122D ; 0x80122d 2c3dc: 80 91 2e 12 lds r24, 0x122E ; 0x80122e 2c3e0: 0f 94 22 3c call 0x27844 ; 0x27844 2c3e4: 2e c0 rjmp .+92 ; 0x2c442 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { switch (plannedRq.code) { 2c3e6: 82 35 cpi r24, 0x52 ; 82 2c3e8: b1 f1 breq .+108 ; 0x2c456 2c3ea: 87 35 cpi r24, 0x57 ; 87 2c3ec: 41 f6 brne .-112 ; 0x2c37e case RequestMsgCodes::Read: SendReadRegister(plannedRq.value, ScopeState::ReadRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::Write: SendWriteRegister(plannedRq.value, plannedRq.value2, ScopeState::WriteRegisterSent); 2c3ee: 60 91 31 12 lds r22, 0x1231 ; 0x801231 2c3f2: 70 91 32 12 lds r23, 0x1232 ; 0x801232 2c3f6: 4c e0 ldi r20, 0x0C ; 12 2c3f8: 80 91 30 12 lds r24, 0x1230 ; 0x801230 2c3fc: 0f 94 8d 3c call 0x2791a ; 0x2791a 2c400: 11 c0 rjmp .+34 ; 0x2c424 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); scopeState = ScopeState::FilamentSensorStateSent; } void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); 2c402: 40 91 30 12 lds r20, 0x1230 ; 0x801230 2c406: 62 e4 ldi r22, 0x42 ; 66 2c408: ce 01 movw r24, r28 2c40a: 01 96 adiw r24, 0x01 ; 1 2c40c: 0f 94 f3 86 call 0x30de6 ; 0x30de6 2c410: 49 81 ldd r20, Y+1 ; 0x01 2c412: 5a 81 ldd r21, Y+2 ; 0x02 2c414: 6b 81 ldd r22, Y+3 ; 0x03 2c416: 7c 81 ldd r23, Y+4 ; 0x04 2c418: 8d 81 ldd r24, Y+5 ; 0x05 2c41a: 0f 94 22 3c call 0x27844 ; 0x27844 scopeState = ScopeState::ButtonSent; 2c41e: 8a e0 ldi r24, 0x0A ; 10 2c420: 80 93 28 12 sts 0x1228, r24 ; 0x801228 SendReadRegister(plannedRq.value, ScopeState::ReadRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::Write: SendWriteRegister(plannedRq.value, plannedRq.value2, ScopeState::WriteRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); 2c424: 40 e0 ldi r20, 0x00 ; 0 2c426: 60 e0 ldi r22, 0x00 ; 0 2c428: ce 01 movw r24, r28 2c42a: 01 96 adiw r24, 0x01 ; 1 2c42c: 0f 94 f3 86 call 0x30de6 ; 0x30de6 2c430: 85 e0 ldi r24, 0x05 ; 5 2c432: fe 01 movw r30, r28 2c434: 31 96 adiw r30, 0x01 ; 1 2c436: af e2 ldi r26, 0x2F ; 47 2c438: b2 e1 ldi r27, 0x12 ; 18 2c43a: 01 90 ld r0, Z+ 2c43c: 0d 92 st X+, r0 2c43e: 8a 95 dec r24 2c440: e1 f7 brne .-8 ; 0x2c43a default: // commands currentScope = Scope::Command; SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); CommandRestart(); return true; 2c442: 81 e0 ldi r24, 0x01 ; 1 } } 2c444: 2a 96 adiw r28, 0x0a ; 10 2c446: 0f b6 in r0, 0x3f ; 63 2c448: f8 94 cli 2c44a: de bf out 0x3e, r29 ; 62 2c44c: 0f be out 0x3f, r0 ; 63 2c44e: cd bf out 0x3d, r28 ; 61 2c450: df 91 pop r29 2c452: cf 91 pop r28 2c454: 08 95 ret // only issue the button to the MMU and do not restart the state machines SendButton(plannedRq.value); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::Read: SendReadRegister(plannedRq.value, ScopeState::ReadRegisterSent); 2c456: 6b e0 ldi r22, 0x0B ; 11 2c458: 80 91 30 12 lds r24, 0x1230 ; 0x801230 2c45c: 0f 94 4d 61 call 0x2c29a ; 0x2c29a 2c460: e1 cf rjmp .-62 ; 0x2c424 case RequestMsgCodes::Write: SendWriteRegister(plannedRq.value, plannedRq.value2, ScopeState::WriteRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; 2c462: 80 e0 ldi r24, 0x00 ; 0 2c464: ef cf rjmp .-34 ; 0x2c444 0002c466 : void ProtocolLogic::WriteRegister(uint8_t address, uint16_t data) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Write, address, data)); } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { 2c466: cf 93 push r28 2c468: df 93 push r29 2c46a: 00 d0 rcall .+0 ; 0x2c46c 2c46c: 1f 92 push r1 2c46e: 1f 92 push r1 2c470: cd b7 in r28, 0x3d ; 61 2c472: de b7 in r29, 0x3e ; 62 2c474: 49 83 std Y+1, r20 ; 0x01 2c476: 5a 83 std Y+2, r21 ; 0x02 2c478: 6b 83 std Y+3, r22 ; 0x03 2c47a: 7c 83 std Y+4, r23 ; 0x04 2c47c: 8d 83 std Y+5, r24 ; 0x05 plannedRq = rq; 2c47e: 85 e0 ldi r24, 0x05 ; 5 2c480: fe 01 movw r30, r28 2c482: 31 96 adiw r30, 0x01 ; 1 2c484: af e2 ldi r26, 0x2F ; 47 2c486: b2 e1 ldi r27, 0x12 ; 18 2c488: 01 90 ld r0, Z+ 2c48a: 0d 92 st X+, r0 2c48c: 8a 95 dec r24 2c48e: e1 f7 brne .-8 ; 0x2c488 if (!ExpectsResponse()) { 2c490: 80 91 28 12 lds r24, 0x1228 ; 0x801228 2c494: 87 ff sbrs r24, 7 2c496: 09 c0 rjmp .+18 ; 0x2c4aa ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } 2c498: 0f 90 pop r0 2c49a: 0f 90 pop r0 2c49c: 0f 90 pop r0 2c49e: 0f 90 pop r0 2c4a0: 0f 90 pop r0 2c4a2: df 91 pop r29 2c4a4: cf 91 pop r28 } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { plannedRq = rq; if (!ExpectsResponse()) { ActivatePlannedRequest(); 2c4a6: 0d 94 ae 61 jmp 0x2c35c ; 0x2c35c } // otherwise wait for an empty window to activate the request } 2c4aa: 0f 90 pop r0 2c4ac: 0f 90 pop r0 2c4ae: 0f 90 pop r0 2c4b0: 0f 90 pop r0 2c4b2: 0f 90 pop r0 2c4b4: df 91 pop r29 2c4b6: cf 91 pop r28 2c4b8: 08 95 ret 0002c4ba : void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); } void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { 2c4ba: cf 93 push r28 2c4bc: df 93 push r29 2c4be: 00 d0 rcall .+0 ; 0x2c4c0 2c4c0: 1f 92 push r1 2c4c2: 1f 92 push r1 2c4c4: cd b7 in r28, 0x3d ; 61 2c4c6: de b7 in r29, 0x3e ; 62 PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); 2c4c8: 48 2f mov r20, r24 2c4ca: 68 e5 ldi r22, 0x58 ; 88 2c4cc: ce 01 movw r24, r28 2c4ce: 01 96 adiw r24, 0x01 ; 1 2c4d0: 0f 94 f3 86 call 0x30de6 ; 0x30de6 2c4d4: 49 81 ldd r20, Y+1 ; 0x01 2c4d6: 5a 81 ldd r21, Y+2 ; 0x02 2c4d8: 6b 81 ldd r22, Y+3 ; 0x03 2c4da: 7c 81 ldd r23, Y+4 ; 0x04 2c4dc: 8d 81 ldd r24, Y+5 ; 0x05 2c4de: 0f 94 33 62 call 0x2c466 ; 0x2c466 } 2c4e2: 0f 90 pop r0 2c4e4: 0f 90 pop r0 2c4e6: 0f 90 pop r0 2c4e8: 0f 90 pop r0 2c4ea: 0f 90 pop r0 2c4ec: df 91 pop r29 2c4ee: cf 91 pop r28 2c4f0: 08 95 ret 0002c4f2 : void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); scopeState = ScopeState::ButtonSent; } void ProtocolLogic::SendVersion(uint8_t stage) { 2c4f2: 1f 93 push r17 2c4f4: cf 93 push r28 2c4f6: df 93 push r29 2c4f8: 00 d0 rcall .+0 ; 0x2c4fa 2c4fa: 1f 92 push r1 2c4fc: 1f 92 push r1 2c4fe: cd b7 in r28, 0x3d ; 61 2c500: de b7 in r29, 0x3e ; 62 2c502: 18 2f mov r17, r24 SendMsg(RequestMsg(RequestMsgCodes::Version, stage)); 2c504: 48 2f mov r20, r24 2c506: 63 e5 ldi r22, 0x53 ; 83 2c508: ce 01 movw r24, r28 2c50a: 01 96 adiw r24, 0x01 ; 1 2c50c: 0f 94 f3 86 call 0x30de6 ; 0x30de6 2c510: 49 81 ldd r20, Y+1 ; 0x01 2c512: 5a 81 ldd r21, Y+2 ; 0x02 2c514: 6b 81 ldd r22, Y+3 ; 0x03 2c516: 7c 81 ldd r23, Y+4 ; 0x04 2c518: 8d 81 ldd r24, Y+5 ; 0x05 2c51a: 0f 94 22 3c call 0x27844 ; 0x27844 scopeState = (ScopeState)((uint_fast8_t)ScopeState::S0Sent + stage); 2c51e: 10 93 28 12 sts 0x1228, r17 ; 0x801228 } 2c522: 0f 90 pop r0 2c524: 0f 90 pop r0 2c526: 0f 90 pop r0 2c528: 0f 90 pop r0 2c52a: 0f 90 pop r0 2c52c: df 91 pop r29 2c52e: cf 91 pop r28 2c530: 1f 91 pop r17 2c532: 08 95 ret 0002c534 : } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); } } void MMU2::Start() { 2c534: 1f 93 push r17 2c536: cf 93 push r28 2c538: df 93 push r29 } //uart init (io + FILE stream) void uart2_init(uint32_t baudRate) { DDRH &= ~0x01; 2c53a: e1 e0 ldi r30, 0x01 ; 1 2c53c: f1 e0 ldi r31, 0x01 ; 1 2c53e: 80 81 ld r24, Z 2c540: 8e 7f andi r24, 0xFE ; 254 2c542: 80 83 st Z, r24 PORTH |= 0x01; 2c544: e2 e0 ldi r30, 0x02 ; 2 2c546: f1 e0 ldi r31, 0x01 ; 1 2c548: 80 81 ld r24, Z 2c54a: 81 60 ori r24, 0x01 ; 1 2c54c: 80 83 st Z, r24 //#include void rbuf_ini(uint8_t* ptr, uint8_t l) { ptr[0] = l; 2c54e: ef ea ldi r30, 0xAF ; 175 2c550: fd e0 ldi r31, 0x0D ; 13 2c552: 90 e1 ldi r25, 0x10 ; 16 2c554: 90 83 st Z, r25 ptr[1] = 0; 2c556: 11 82 std Z+1, r1 ; 0x01 ptr[2] = 0; 2c558: 12 82 std Z+2, r1 ; 0x02 rbuf_ini(uart2_ibuf, sizeof(uart2_ibuf) - 4); UCSR2A |= (1 << U2X2); // baudrate multiplier 2c55a: e0 ed ldi r30, 0xD0 ; 208 2c55c: f0 e0 ldi r31, 0x00 ; 0 2c55e: 80 81 ld r24, Z 2c560: 82 60 ori r24, 0x02 ; 2 2c562: 80 83 st Z, r24 UBRR2L = UART_BAUD_SELECT(baudRate, F_CPU); // select baudrate 2c564: 90 93 d4 00 sts 0x00D4, r25 ; 0x8000d4 <__TEXT_REGION_LENGTH__+0x7c20d4> UCSR2B = (1 << RXEN2) | (1 << TXEN2); // enable receiver and transmitter 2c568: e1 ed ldi r30, 0xD1 ; 209 2c56a: f0 e0 ldi r31, 0x00 ; 0 2c56c: 88 e1 ldi r24, 0x18 ; 24 2c56e: 80 83 st Z, r24 UCSR2B |= (1 << RXCIE2); // enable rx interrupt 2c570: 80 81 ld r24, Z 2c572: 80 68 ori r24, 0x80 ; 128 2c574: 80 83 st Z, r24 fdev_setup_stream(uart2io, uart2_putchar, uart2_getchar, _FDEV_SETUP_WRITE | _FDEV_SETUP_READ); //setup uart2 i/o stream 2c576: e7 e0 ldi r30, 0x07 ; 7 2c578: f2 e1 ldi r31, 0x12 ; 18 2c57a: 89 ee ldi r24, 0xE9 ; 233 2c57c: 97 ef ldi r25, 0xF7 ; 247 2c57e: 91 87 std Z+9, r25 ; 0x09 2c580: 80 87 std Z+8, r24 ; 0x08 2c582: 81 ed ldi r24, 0xD1 ; 209 2c584: 97 ef ldi r25, 0xF7 ; 247 2c586: 93 87 std Z+11, r25 ; 0x0b 2c588: 82 87 std Z+10, r24 ; 0x0a 2c58a: 13 e0 ldi r17, 0x03 ; 3 2c58c: 13 83 std Z+3, r17 ; 0x03 2c58e: 15 86 std Z+13, r1 ; 0x0d 2c590: 14 86 std Z+12, r1 ; 0x0c break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 2c592: 80 e0 ldi r24, 0x00 ; 0 2c594: 0f 94 5d 62 call 0x2c4ba ; 0x2c4ba mmu2Serial.begin(MMU_BAUD); PowerOn(); mmu2Serial.flush(); // make sure the UART buffer is clear before starting communication SetCurrentTool(MMU2_NO_TOOL); 2c598: 83 e6 ldi r24, 0x63 ; 99 2c59a: 0f 94 b2 41 call 0x28364 ; 0x28364 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 2c59e: 8f e6 ldi r24, 0x6F ; 111 2c5a0: 9b e9 ldi r25, 0x9B ; 155 2c5a2: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 retryAttempts = MAX_RETRIES; 2c5a6: c5 e2 ldi r28, 0x25 ; 37 2c5a8: d2 e1 ldi r29, 0x12 ; 18 2c5aa: 10 93 79 12 sts 0x1279, r17 ; 0x801279 } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 2c5ae: 84 ef ldi r24, 0xF4 ; 244 2c5b0: 9c e9 ldi r25, 0x9C ; 156 2c5b2: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 /// @returns the initial cause which started this drop out event inline StepStatus InitialCause() const { return cause; } /// Rearms the object for further processing - basically call this once the MMU responds with something meaningful (e.g. S0 A2) inline void Reset() { occurrences = maxOccurrences; } 2c5b6: 8a e0 ldi r24, 0x0A ; 10 2c5b8: 8c 8b std Y+20, r24 ; 0x14 // start the communication logic.ResetRetryAttempts(); logic.ResetCommunicationTimeoutAttempts(); state = xState::Connecting; 2c5ba: 82 e0 ldi r24, 0x02 ; 2 2c5bc: 80 93 94 12 sts 0x1294, r24 ; 0x801294 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 2c5c0: 81 e0 ldi r24, 0x01 ; 1 2c5c2: 8d 8f std Y+29, r24 ; 0x1d currentScope = Scope::StartSeq; 2c5c4: 8a 83 std Y+2, r24 ; 0x02 rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 2c5c6: 1c a2 std Y+36, r1 ; 0x24 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 2c5c8: 86 e0 ldi r24, 0x06 ; 6 2c5ca: 8c 83 std Y+4, r24 ; 0x04 SendVersion(0); 2c5cc: 80 e0 ldi r24, 0x00 ; 0 logic.Start(); } 2c5ce: df 91 pop r29 2c5d0: cf 91 pop r28 2c5d2: 1f 91 pop r17 2c5d4: 0d 94 79 62 jmp 0x2c4f2 ; 0x2c4f2 0002c5d8 : if (fs != lastFSensor) { SendAndUpdateFilamentSensor(); } } void ProtocolLogic::SendQuery() { 2c5d8: cf 93 push r28 2c5da: df 93 push r29 2c5dc: 00 d0 rcall .+0 ; 0x2c5de 2c5de: 1f 92 push r1 2c5e0: 1f 92 push r1 2c5e2: cd b7 in r28, 0x3d ; 61 2c5e4: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); 2c5e6: 40 e0 ldi r20, 0x00 ; 0 2c5e8: 61 e5 ldi r22, 0x51 ; 81 2c5ea: ce 01 movw r24, r28 2c5ec: 01 96 adiw r24, 0x01 ; 1 2c5ee: 0f 94 f3 86 call 0x30de6 ; 0x30de6 2c5f2: 49 81 ldd r20, Y+1 ; 0x01 2c5f4: 5a 81 ldd r21, Y+2 ; 0x02 2c5f6: 6b 81 ldd r22, Y+3 ; 0x03 2c5f8: 7c 81 ldd r23, Y+4 ; 0x04 2c5fa: 8d 81 ldd r24, Y+5 ; 0x05 2c5fc: 0f 94 22 3c call 0x27844 ; 0x27844 scopeState = ScopeState::QuerySent; 2c600: 84 e0 ldi r24, 0x04 ; 4 2c602: 80 93 28 12 sts 0x1228, r24 ; 0x801228 } 2c606: 0f 90 pop r0 2c608: 0f 90 pop r0 2c60a: 0f 90 pop r0 2c60c: 0f 90 pop r0 2c60e: 0f 90 pop r0 2c610: df 91 pop r29 2c612: cf 91 pop r28 2c614: 08 95 ret 0002c616 : SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } void ProtocolLogic::SendAndUpdateFilamentSensor() { 2c616: cf 93 push r28 2c618: df 93 push r29 2c61a: 00 d0 rcall .+0 ; 0x2c61c 2c61c: 1f 92 push r1 2c61e: 1f 92 push r1 2c620: cd b7 in r28, 0x3d ; 61 2c622: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); 2c624: 0f 94 36 87 call 0x30e6c ; 0x30e6c 2c628: 80 93 69 12 sts 0x1269, r24 ; 0x801269 2c62c: 48 2f mov r20, r24 2c62e: 66 e6 ldi r22, 0x66 ; 102 2c630: ce 01 movw r24, r28 2c632: 01 96 adiw r24, 0x01 ; 1 2c634: 0f 94 f3 86 call 0x30de6 ; 0x30de6 2c638: 49 81 ldd r20, Y+1 ; 0x01 2c63a: 5a 81 ldd r21, Y+2 ; 0x02 2c63c: 6b 81 ldd r22, Y+3 ; 0x03 2c63e: 7c 81 ldd r23, Y+4 ; 0x04 2c640: 8d 81 ldd r24, Y+5 ; 0x05 2c642: 0f 94 22 3c call 0x27844 ; 0x27844 scopeState = ScopeState::FilamentSensorStateSent; 2c646: 86 e0 ldi r24, 0x06 ; 6 2c648: 80 93 28 12 sts 0x1228, r24 ; 0x801228 } 2c64c: 0f 90 pop r0 2c64e: 0f 90 pop r0 2c650: 0f 90 pop r0 2c652: 0f 90 pop r0 2c654: 0f 90 pop r0 2c656: df 91 pop r29 2c658: cf 91 pop r28 2c65a: 08 95 ret 0002c65c : CheckAndReportAsyncEvents(); } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { 2c65c: cf 93 push r28 2c65e: df 93 push r29 2c660: 00 d0 rcall .+0 ; 0x2c662 2c662: 1f 92 push r1 2c664: 1f 92 push r1 2c666: cd b7 in r28, 0x3d ; 61 2c668: de b7 in r29, 0x3e ; 62 switch (rsp.paramCode) { 2c66a: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2c66e: 85 34 cpi r24, 0x45 ; 69 2c670: f1 f0 breq .+60 ; 0x2c6ae 2c672: 20 f4 brcc .+8 ; 0x2c67c 2c674: 82 34 cpi r24, 0x42 ; 66 2c676: 51 f1 breq .+84 ; 0x2c6cc } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; } default: return ProtocolError; 2c678: 85 e0 ldi r24, 0x05 ; 5 2c67a: 11 c0 rjmp .+34 ; 0x2c69e } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { switch (rsp.paramCode) { 2c67c: 86 34 cpi r24, 0x46 ; 70 2c67e: 71 f1 breq .+92 ; 0x2c6dc 2c680: 80 35 cpi r24, 0x50 ; 80 2c682: d1 f7 brne .-12 ; 0x2c678 case ResponseMsgParamCodes::Processing: progressCode = static_cast(rsp.paramValue); 2c684: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2c688: 80 93 67 12 sts 0x1267, r24 ; 0x801267 errorCode = ErrorCode::OK; 2c68c: 81 e0 ldi r24, 0x01 ; 1 2c68e: 90 e0 ldi r25, 0x00 ; 0 2c690: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2c694: 80 93 65 12 sts 0x1265, r24 ; 0x801265 SendAndUpdateFilamentSensor(); // keep on reporting the state of fsensor regularly 2c698: 0f 94 0b 63 call 0x2c616 ; 0x2c616 return Processing; 2c69c: 80 e0 ldi r24, 0x00 ; 0 return Interrupted; } default: return ProtocolError; } } 2c69e: 0f 90 pop r0 2c6a0: 0f 90 pop r0 2c6a2: 0f 90 pop r0 2c6a4: 0f 90 pop r0 2c6a6: 0f 90 pop r0 2c6a8: df 91 pop r29 2c6aa: cf 91 pop r28 2c6ac: 08 95 ret errorCode = ErrorCode::OK; SendAndUpdateFilamentSensor(); // keep on reporting the state of fsensor regularly return Processing; case ResponseMsgParamCodes::Error: // in case of an error the progress code remains as it has been before progressCode = ProgressCode::ERRWaitingForUser; 2c6ae: 8c e0 ldi r24, 0x0C ; 12 2c6b0: 80 93 67 12 sts 0x1267, r24 ; 0x801267 errorCode = static_cast(rsp.paramValue); 2c6b4: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2c6b8: 90 91 41 12 lds r25, 0x1241 ; 0x801241 2c6bc: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2c6c0: 80 93 65 12 sts 0x1265, r24 ; 0x801265 // keep on reporting the state of fsensor regularly even in command error state // - the MMU checks FINDA and fsensor even while recovering from errors SendAndUpdateFilamentSensor(); 2c6c4: 0f 94 0b 63 call 0x2c616 ; 0x2c616 return CommandError; 2c6c8: 87 e0 ldi r24, 0x07 ; 7 2c6ca: e9 cf rjmp .-46 ; 0x2c69e case ResponseMsgParamCodes::Button: // The user pushed a button on the MMU. Save it, do what we need to do // to prepare, then pass it back to the MMU so it can work its magic. buttonCode = static_cast(rsp.paramValue); 2c6cc: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2c6d0: 80 93 68 12 sts 0x1268, r24 ; 0x801268 SendAndUpdateFilamentSensor(); 2c6d4: 0f 94 0b 63 call 0x2c616 ; 0x2c616 return ButtonPushed; 2c6d8: 8b e0 ldi r24, 0x0B ; 11 2c6da: e1 cf rjmp .-62 ; 0x2c69e case ResponseMsgParamCodes::Finished: // We must check whether the "finished" is actually related to the command issued into the MMU // It can also be an X0 F which means MMU just successfully restarted. if (ReqMsg().code == rsp.request.code && ReqMsg().value == rsp.request.value) { 2c6dc: 90 91 2a 12 lds r25, 0x122A ; 0x80122a 2c6e0: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 2c6e4: 98 13 cpse r25, r24 2c6e6: 22 c0 rjmp .+68 ; 0x2c72c 2c6e8: 90 91 2b 12 lds r25, 0x122B ; 0x80122b 2c6ec: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 2c6f0: 98 13 cpse r25, r24 2c6f2: 1c c0 rjmp .+56 ; 0x2c72c progressCode = ProgressCode::OK; 2c6f4: 10 92 67 12 sts 0x1267, r1 ; 0x801267 errorCode = ErrorCode::OK; 2c6f8: 81 e0 ldi r24, 0x01 ; 1 2c6fa: 90 e0 ldi r25, 0x00 ; 0 2c6fc: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2c700: 80 93 65 12 sts 0x1265, r24 ; 0x801265 scopeState = ScopeState::Ready; 2c704: 82 e8 ldi r24, 0x82 ; 130 2c706: 80 93 28 12 sts 0x1228, r24 ; 0x801228 rq = RequestMsg(RequestMsgCodes::unknown, 0); // clear the successfully finished request 2c70a: 40 e0 ldi r20, 0x00 ; 0 2c70c: 60 e0 ldi r22, 0x00 ; 0 2c70e: ce 01 movw r24, r28 2c710: 01 96 adiw r24, 0x01 ; 1 2c712: 0f 94 f3 86 call 0x30de6 ; 0x30de6 2c716: 85 e0 ldi r24, 0x05 ; 5 2c718: fe 01 movw r30, r28 2c71a: 31 96 adiw r30, 0x01 ; 1 2c71c: aa e2 ldi r26, 0x2A ; 42 2c71e: b2 e1 ldi r27, 0x12 ; 18 2c720: 01 90 ld r0, Z+ 2c722: 0d 92 st X+, r0 2c724: 8a 95 dec r24 2c726: e1 f7 brne .-8 ; 0x2c720 2c728: 82 e0 ldi r24, 0x02 ; 2 2c72a: b9 cf rjmp .-142 ; 0x2c69e return Finished; } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; 2c72c: 83 e0 ldi r24, 0x03 ; 3 2c72e: b7 cf rjmp .-146 ; 0x2c69e 0002c730 : mmu_print_saved &= ~(SavedState::ParkExtruder); } } void MMU2::CheckUserInput() { 2c730: 1f 93 push r17 2c732: cf 93 push r28 2c734: df 93 push r29 2c736: 00 d0 rcall .+0 ; 0x2c738 2c738: 1f 92 push r1 2c73a: 1f 92 push r1 2c73c: cd b7 in r28, 0x3d ; 61 2c73e: de b7 in r29, 0x3e ; 62 const char *PrusaErrorButtonMore() { return MSG_BTN_MORE; } Buttons ButtonPressed(ErrorCode ec) { if (buttonSelectedOperation == ButtonOperations::NoOperation) { 2c740: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> 2c744: 81 11 cpse r24, r1 2c746: 2a c0 rjmp .+84 ; 0x2c79c auto btn = ButtonPressed(lastErrorCode); // Was a button pressed on the MMU itself instead of the LCD? if (btn == Buttons::NoButton && lastButton != Buttons::NoButton) { 2c748: 10 91 8f 12 lds r17, 0x128F ; 0x80128f 2c74c: 1f 3f cpi r17, 0xFF ; 255 2c74e: 91 f5 brne .+100 ; 0x2c7b4 btn = lastButton; lastButton = Buttons::NoButton; // Clear it. } if (mmu2.MMULastErrorSource() == ErrorSourcePrinter && btn != Buttons::NoButton) { 2c750: 80 91 8e 12 lds r24, 0x128E ; 0x80128e 2c754: 81 11 cpse r24, r1 2c756: 60 c0 rjmp .+192 ; 0x2c818 2c758: 1f 3f cpi r17, 0xFF ; 255 2c75a: b9 f0 breq .+46 ; 0x2c78a inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; } inline void ClearPrinterError() { explicitPrinterError = ErrorCode::OK; 2c75c: 81 e0 ldi r24, 0x01 ; 1 2c75e: 90 e0 ldi r25, 0x00 ; 0 2c760: 90 93 26 12 sts 0x1226, r25 ; 0x801226 2c764: 80 93 25 12 sts 0x1225, r24 ; 0x801225 } } void ClearPrinterError() { logic.ClearPrinterError(); lastErrorCode = ErrorCode::OK; 2c768: 90 93 8d 12 sts 0x128D, r25 ; 0x80128d 2c76c: 80 93 8c 12 sts 0x128C, r24 ; 0x80128c lastErrorSource = ErrorSource::ErrorSourceNone; 2c770: 8f ef ldi r24, 0xFF ; 255 2c772: 80 93 8e 12 sts 0x128E, r24 ; 0x80128e // Moreover - if the MMU is currently doing something (like the LoadFilament - see comment above) // we'll actually wait for it automagically in manage_response and after it finishes correctly, // we'll issue another command (like toolchange) } switch (btn) { 2c776: 13 30 cpi r17, 0x03 ; 3 2c778: 09 f4 brne .+2 ; 0x2c77c 2c77a: 82 c0 rjmp .+260 ; 0x2c880 2c77c: f8 f0 brcs .+62 ; 0x2c7bc 2c77e: 16 30 cpi r17, 0x06 ; 6 2c780: 08 f4 brcc .+2 ; 0x2c784 2c782: 7b c0 rjmp .+246 ; 0x2c87a 2c784: 17 30 cpi r17, 0x07 ; 7 2c786: 09 f4 brne .+2 ; 0x2c78a 2c788: 7f c0 rjmp .+254 ; 0x2c888 // @@TODO not sure if we shall handle this high level operation at this spot break; default: break; } } 2c78a: 0f 90 pop r0 2c78c: 0f 90 pop r0 2c78e: 0f 90 pop r0 2c790: 0f 90 pop r0 2c792: 0f 90 pop r0 2c794: df 91 pop r29 2c796: cf 91 pop r28 2c798: 1f 91 pop r17 2c79a: 08 95 ret return Buttons::NoButton; // no button } const auto result = ButtonAvailable(ec); 2c79c: 80 91 8c 12 lds r24, 0x128C ; 0x80128c 2c7a0: 90 91 8d 12 lds r25, 0x128D ; 0x80128d 2c7a4: 0f 94 c3 89 call 0x31386 ; 0x31386 2c7a8: 18 2f mov r17, r24 buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation 2c7aa: 10 92 ae 0d sts 0x0DAE, r1 ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> void MMU2::CheckUserInput() { auto btn = ButtonPressed(lastErrorCode); // Was a button pressed on the MMU itself instead of the LCD? if (btn == Buttons::NoButton && lastButton != Buttons::NoButton) { 2c7ae: 8f 3f cpi r24, 0xFF ; 255 2c7b0: 79 f6 brne .-98 ; 0x2c750 2c7b2: ca cf rjmp .-108 ; 0x2c748 btn = lastButton; lastButton = Buttons::NoButton; // Clear it. 2c7b4: 8f ef ldi r24, 0xFF ; 255 2c7b6: 80 93 8f 12 sts 0x128F, r24 ; 0x80128f 2c7ba: ca cf rjmp .-108 ; 0x2c750 switch (btn) { case Buttons::Left: case Buttons::Middle: case Buttons::Right: SERIAL_ECHOPGM("CheckUserInput-btnLMR "); 2c7bc: 88 e5 ldi r24, 0x58 ; 88 2c7be: 9b e9 ldi r25, 0x9B ; 155 2c7c0: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLN((int)buttons_to_uint8t(btn)); 2c7c4: 81 2f mov r24, r17 2c7c6: 90 e0 ldi r25, 0x00 ; 0 2c7c8: 0f 94 aa 41 call 0x28354 ; 0x28354 ResumeHotendTemp(); // Recover the hotend temp before we attempt to do anything else... 2c7cc: 0f 94 66 69 call 0x2d2cc ; 0x2d2cc if (mmu2.MMULastErrorSource() == ErrorSourceMMU) { 2c7d0: 80 91 8e 12 lds r24, 0x128E ; 0x80128e 2c7d4: 81 30 cpi r24, 0x01 ; 1 2c7d6: 89 f4 brne .+34 ; 0x2c7fa ScreenUpdateEnable(); return true; } void MMU2::Button(uint8_t index) { LogEchoEvent_P(PSTR("Button")); 2c7d8: 81 e5 ldi r24, 0x51 ; 81 2c7da: 9b e9 ldi r25, 0x9B ; 155 2c7dc: 0f 94 26 87 call 0x30e4c ; 0x30e4c void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); } void ProtocolLogic::Button(uint8_t index) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Button, index)); 2c7e0: 41 2f mov r20, r17 2c7e2: 62 e4 ldi r22, 0x42 ; 66 2c7e4: ce 01 movw r24, r28 2c7e6: 01 96 adiw r24, 0x01 ; 1 2c7e8: 0f 94 f3 86 call 0x30de6 ; 0x30de6 2c7ec: 49 81 ldd r20, Y+1 ; 0x01 2c7ee: 5a 81 ldd r21, Y+2 ; 0x02 2c7f0: 6b 81 ldd r22, Y+3 ; 0x03 2c7f2: 7c 81 ldd r23, Y+4 ; 0x04 2c7f4: 8d 81 ldd r24, Y+5 ; 0x05 2c7f6: 0f 94 33 62 call 0x2c466 ; 0x2c466 } // A quick hack: for specific error codes move the E-motor every time. // Not sure if we can rely on the fsensor. // Just plan the move, let the MMU take over when it is ready switch (lastErrorCode) { 2c7fa: 80 91 8c 12 lds r24, 0x128C ; 0x80128c 2c7fe: 90 91 8d 12 lds r25, 0x128D ; 0x80128d 2c802: 84 30 cpi r24, 0x04 ; 4 2c804: 20 e8 ldi r18, 0x80 ; 128 2c806: 92 07 cpc r25, r18 2c808: 21 f0 breq .+8 ; 0x2c812 2c80a: 89 30 cpi r24, 0x09 ; 9 2c80c: 90 48 sbci r25, 0x80 ; 128 2c80e: 09 f0 breq .+2 ; 0x2c812 2c810: bc cf rjmp .-136 ; 0x2c78a case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: case ErrorCode::FSENSOR_TOO_EARLY: HelpUnloadToFinda(); 2c812: 0f 94 f5 3e call 0x27dea ; 0x27dea 2c816: b9 cf rjmp .-142 ; 0x2c78a // Moreover - if the MMU is currently doing something (like the LoadFilament - see comment above) // we'll actually wait for it automagically in manage_response and after it finishes correctly, // we'll issue another command (like toolchange) } switch (btn) { 2c818: 19 30 cpi r17, 0x09 ; 9 2c81a: 08 f0 brcs .+2 ; 0x2c81e 2c81c: b6 cf rjmp .-148 ; 0x2c78a 2c81e: e1 2f mov r30, r17 2c820: f0 e0 ldi r31, 0x00 ; 0 2c822: 88 27 eor r24, r24 2c824: e9 5e subi r30, 0xE9 ; 233 2c826: fb 49 sbci r31, 0x9B ; 155 2c828: 8e 4f sbci r24, 0xFE ; 254 2c82a: 0d 94 ec a0 jmp 0x341d8 ; 0x341d8 <__tablejump2__> 2c82e: b7 37 cpi r27, 0x77 ; 119 2c830: b7 37 cpi r27, 0x77 ; 119 2c832: b7 37 cpi r27, 0x77 ; 119 2c834: af 36 cpi r26, 0x6F ; 111 2c836: 37 38 cpi r19, 0x87 ; 135 2c838: 37 38 cpi r19, 0x87 ; 135 2c83a: 3d 37 cpi r19, 0x7D ; 125 2c83c: 3b 38 cpi r19, 0x8B ; 139 2c83e: e3 37 cpi r30, 0x73 ; 115 logic.Stop(); mmu2Serial.close(); } void MMU2::Tune() { switch (lastErrorCode) { 2c840: 80 91 8c 12 lds r24, 0x128C ; 0x80128c 2c844: 90 91 8d 12 lds r25, 0x128D ; 0x80128d 2c848: 87 38 cpi r24, 0x87 ; 135 2c84a: 20 e8 ldi r18, 0x80 ; 128 2c84c: 92 07 cpc r25, r18 2c84e: 21 f0 breq .+8 ; 0x2c858 2c850: 87 30 cpi r24, 0x07 ; 7 2c852: 91 48 sbci r25, 0x81 ; 129 2c854: 09 f0 breq .+2 ; 0x2c858 2c856: 99 cf rjmp .-206 ; 0x2c78a // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 2c858: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2c85c: 84 30 cpi r24, 0x04 ; 4 2c85e: 21 f4 brne .+8 ; 0x2c868 ); MENU_END(); } void tuneIdlerStallguardThreshold() { if ((CommandInProgress)mmu2.GetCommandInProgress() != NoCommand) 2c860: 80 91 2a 12 lds r24, 0x122A ; 0x80122a 2c864: 81 11 cpse r24, r1 2c866: 91 cf rjmp .-222 ; 0x2c78a // homing fails during toolchange. // To save the print, make the Tune button unresponsive for now. return; } putErrorScreenToSleep = true; 2c868: 81 e0 ldi r24, 0x01 ; 1 2c86a: 80 93 ad 0d sts 0x0DAD, r24 ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.458> menu_submenu(tuneIdlerStallguardThresholdMenu); 2c86e: 60 e0 ldi r22, 0x00 ; 0 2c870: 8b e1 ldi r24, 0x1B ; 27 2c872: 97 e3 ldi r25, 0x37 ; 55 2c874: 0f 94 29 94 call 0x32852 ; 0x32852 2c878: 88 cf rjmp .-240 ; 0x2c78a } /// @brief Queue a button operation which the printer can act upon /// @param btn Button operation inline void SetPrinterButtonOperation(Buttons btn) { printerButtonOperation = btn; 2c87a: 10 93 92 12 sts 0x1292, r17 ; 0x801292 2c87e: 85 cf rjmp .-246 ; 0x2c78a break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 2c880: 80 e0 ldi r24, 0x00 ; 0 2c882: 0f 94 5d 62 call 0x2c4ba ; 0x2c4ba 2c886: 81 cf rjmp .-254 ; 0x2c78a StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 2c888: 10 92 94 12 sts 0x1294, r1 ; 0x801294 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 2c88c: 10 92 42 12 sts 0x1242, r1 ; 0x801242 currentScope = Scope::Stopped; 2c890: 10 92 27 12 sts 0x1227, r1 ; 0x801227 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2c894: 60 e0 ldi r22, 0x00 ; 0 2c896: 8c ea ldi r24, 0xAC ; 172 2c898: 9c e0 ldi r25, 0x0C ; 12 2c89a: 0f 94 00 a0 call 0x34000 ; 0x34000 } /// Disables MMU in EEPROM void DisableMMUInSettings() { eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); 2c89e: 0f 94 98 41 call 0x28330 ; 0x28330 2c8a2: 73 cf rjmp .-282 ; 0x2c78a 0002c8a4 : avoidRecursion = true; mmu_loop_inner(true); avoidRecursion = false; } void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) { 2c8a4: 4f 92 push r4 2c8a6: 5f 92 push r5 2c8a8: 6f 92 push r6 2c8aa: 7f 92 push r7 2c8ac: 8f 92 push r8 2c8ae: 9f 92 push r9 2c8b0: af 92 push r10 2c8b2: bf 92 push r11 2c8b4: cf 92 push r12 2c8b6: df 92 push r13 2c8b8: ef 92 push r14 2c8ba: ff 92 push r15 2c8bc: 0f 93 push r16 2c8be: 1f 93 push r17 2c8c0: cf 93 push r28 2c8c2: df 93 push r29 2c8c4: cd b7 in r28, 0x3d ; 61 2c8c6: de b7 in r29, 0x3e ; 62 2c8c8: a0 97 sbiw r28, 0x20 ; 32 2c8ca: 0f b6 in r0, 0x3f ; 63 2c8cc: f8 94 cli 2c8ce: de bf out 0x3e, r29 ; 62 2c8d0: 0f be out 0x3f, r0 ; 63 2c8d2: cd bf out 0x3d, r28 ; 61 2c8d4: 08 2f mov r16, r24 } } StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); 2c8d6: 0f 94 98 63 call 0x2c730 ; 0x2c730 DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); } StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately 2c8da: 80 91 28 12 lds r24, 0x1228 ; 0x801228 2c8de: 87 fd sbrc r24, 7 ActivatePlannedRequest(); 2c8e0: 0f 94 ae 61 call 0x2c35c ; 0x2c35c 2c8e4: 90 91 28 12 lds r25, 0x1228 ; 0x801228 } return Processing; } StepStatus ProtocolLogic::ScopeStep() { if (!ExpectsResponse()) { 2c8e8: 97 ff sbrs r25, 7 2c8ea: 7d c0 rjmp .+250 ; 0x2c9e6 // we are waiting for something switch (currentScope) { 2c8ec: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2c8f0: 82 30 cpi r24, 0x02 ; 2 2c8f2: b1 f0 breq .+44 ; 0x2c920 2c8f4: 08 f4 brcc .+2 ; 0x2c8f8 2c8f6: 75 c0 rjmp .+234 ; 0x2c9e2 2c8f8: 83 30 cpi r24, 0x03 ; 3 2c8fa: e1 f1 breq .+120 ; 0x2c974 2c8fc: 84 30 cpi r24, 0x04 ; 4 2c8fe: 09 f4 brne .+2 ; 0x2c902 2c900: 54 c0 rjmp .+168 ; 0x2c9aa break; case Finished: { // We are ok, switching to Idle if there is no potential next request planned. // But the trouble is we must report a finished command if the previous command has just been finished // i.e. only try to find some planned command if we just finished the Idle cycle if (!ActivatePlannedRequest()) { // if nothing is planned, switch to Idle 2c902: 0f 94 ae 61 call 0x2c35c ; 0x2c35c 2c906: 81 11 cpse r24, r1 2c908: 6b c3 rjmp .+1750 ; 0x2cfe0 // and we have just received a response to a Q0 message about a command progress return ProcessCommandQueryResponse(); } void ProtocolLogic::SwitchToIdle() { state = State::Running; 2c90a: 82 e0 ldi r24, 0x02 ; 2 2c90c: 80 93 42 12 sts 0x1242, r24 ; 0x801242 currentScope = Scope::Idle; 2c910: 83 e0 ldi r24, 0x03 ; 3 2c912: 80 93 27 12 sts 0x1227, r24 ; 0x801227 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 2c916: 82 e8 ldi r24, 0x82 ; 130 2c918: 80 93 28 12 sts 0x1228, r24 ; 0x801228 // We are ok, switching to Idle if there is no potential next request planned. // But the trouble is we must report a finished command if the previous command has just been finished // i.e. only try to find some planned command if we just finished the Idle cycle if (!ActivatePlannedRequest()) { // if nothing is planned, switch to Idle SwitchToIdle(); } else if (ExpectsResponse()) { 2c91c: 12 e0 ldi r17, 0x02 ; 2 2c91e: db c2 rjmp .+1462 ; 0x2ced6 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 2c920: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 2c924: ab 01 movw r20, r22 2c926: bc 01 movw r22, r24 2c928: 80 91 34 12 lds r24, 0x1234 ; 0x801234 2c92c: 90 91 35 12 lds r25, 0x1235 ; 0x801235 2c930: a0 91 36 12 lds r26, 0x1236 ; 0x801236 2c934: b0 91 37 12 lds r27, 0x1237 ; 0x801237 2c938: 88 51 subi r24, 0x18 ; 24 2c93a: 9c 4f sbci r25, 0xFC ; 252 2c93c: af 4f sbci r26, 0xFF ; 255 2c93e: bf 4f sbci r27, 0xFF ; 255 return VersionMismatch; } } StepStatus ProtocolLogic::DelayedRestartWait() { if (Elapsed(heartBeatPeriod)) { // this basically means, that we are waiting until there is some traffic on 2c940: 48 17 cp r20, r24 2c942: 59 07 cpc r21, r25 2c944: 6a 07 cpc r22, r26 2c946: 7b 07 cpc r23, r27 2c948: 08 f4 brcc .+2 ; 0x2c94c 2c94a: 4b c0 rjmp .+150 ; 0x2c9e2 void MMU2Serial::close() { // @@TODO - probably turn off the UART } int MMU2Serial::read() { return fgetc(uart2io); 2c94c: 87 e0 ldi r24, 0x07 ; 7 2c94e: 92 e1 ldi r25, 0x12 ; 18 2c950: 0f 94 08 9e call 0x33c10 ; 0x33c10 while (uart->read() != -1) 2c954: 01 96 adiw r24, 0x01 ; 1 2c956: d1 f7 brne .-12 ; 0x2c94c initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 2c958: 81 e0 ldi r24, 0x01 ; 1 2c95a: 80 93 42 12 sts 0x1242, r24 ; 0x801242 currentScope = Scope::StartSeq; 2c95e: 80 93 27 12 sts 0x1227, r24 ; 0x801227 2c962: 10 92 49 12 sts 0x1249, r1 ; 0x801249 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 2c966: 86 e0 ldi r24, 0x06 ; 6 2c968: 80 93 29 12 sts 0x1229, r24 ; 0x801229 SendVersion(0); 2c96c: 80 e0 ldi r24, 0x00 ; 0 case ScopeState::S2Sent: // received response to S2 - minor return ProcessVersionResponse((uint8_t)scopeState - (uint8_t)ScopeState::S0Sent); case ScopeState::S3Sent: // received response to S3 - revision if (rsp.request.code != RequestMsgCodes::Version || rsp.request.value != 3) { // got a response to something else - protocol corruption probably, repeat the query OR restart the comm by issuing S0? SendVersion(3); 2c96e: 0f 94 79 62 call 0x2c4f2 ; 0x2c4f2 2c972: 37 c0 rjmp .+110 ; 0x2c9e2 } return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout 2c974: 92 38 cpi r25, 0x82 ; 130 2c976: 29 f6 brne .-118 ; 0x2c902 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 2c978: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 2c97c: ab 01 movw r20, r22 2c97e: bc 01 movw r22, r24 2c980: 80 91 34 12 lds r24, 0x1234 ; 0x801234 2c984: 90 91 35 12 lds r25, 0x1235 ; 0x801235 2c988: a0 91 36 12 lds r26, 0x1236 ; 0x801236 2c98c: b0 91 37 12 lds r27, 0x1237 ; 0x801237 2c990: 88 51 subi r24, 0x18 ; 24 2c992: 9c 4f sbci r25, 0xFC ; 252 2c994: af 4f sbci r26, 0xFF ; 255 2c996: bf 4f sbci r27, 0xFF ; 255 return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout if (Elapsed(heartBeatPeriod)) { 2c998: 48 17 cp r20, r24 2c99a: 59 07 cpc r21, r25 2c99c: 6a 07 cpc r22, r26 2c99e: 7b 07 cpc r23, r27 2c9a0: 08 f4 brcc .+2 ; 0x2c9a4 2c9a2: af cf rjmp .-162 ; 0x2c902 void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; currentScope = Scope::Idle; IdleRestart(); SendQuery(); // force sending Q0 immediately 2c9a4: 0f 94 ec 62 call 0x2c5d8 ; 0x2c5d8 2c9a8: 1c c0 rjmp .+56 ; 0x2c9e2 } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 2c9aa: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 2c9ae: ab 01 movw r20, r22 2c9b0: bc 01 movw r22, r24 2c9b2: 80 91 34 12 lds r24, 0x1234 ; 0x801234 2c9b6: 90 91 35 12 lds r25, 0x1235 ; 0x801235 2c9ba: a0 91 36 12 lds r26, 0x1236 ; 0x801236 2c9be: b0 91 37 12 lds r27, 0x1237 ; 0x801237 2c9c2: 88 51 subi r24, 0x18 ; 24 2c9c4: 9c 4f sbci r25, 0xFC ; 252 2c9c6: af 4f sbci r26, 0xFF ; 255 2c9c8: bf 4f sbci r27, 0xFF ; 255 } return Processing; } StepStatus ProtocolLogic::CommandWait() { if (Elapsed(heartBeatPeriod)) { 2c9ca: 48 17 cp r20, r24 2c9cc: 59 07 cpc r21, r25 2c9ce: 6a 07 cpc r22, r26 2c9d0: 7b 07 cpc r23, r27 2c9d2: 40 f7 brcc .-48 ; 0x2c9a4 }; void ProtocolLogic::CheckAndReportAsyncEvents() { // even when waiting for a query period, we need to report a change in filament sensor's state // - it is vital for a precise synchronization of moves of the printer and the MMU uint8_t fs = (uint8_t)WhereIsFilament(); 2c9d4: 0f 94 36 87 call 0x30e6c ; 0x30e6c if (fs != lastFSensor) { 2c9d8: 90 91 69 12 lds r25, 0x1269 ; 0x801269 2c9dc: 89 13 cpse r24, r25 SendAndUpdateFilamentSensor(); 2c9de: 0f 94 0b 63 call 0x2c616 ; 0x2c616 // i.e. only try to find some planned command if we just finished the Idle cycle if (!ActivatePlannedRequest()) { // if nothing is planned, switch to Idle SwitchToIdle(); } else if (ExpectsResponse()) { // if the previous cycle was Idle and now we have planned a new command -> avoid returning Finished currentStatus = Processing; 2c9e2: 10 e0 ldi r17, 0x00 ; 0 2c9e4: 78 c2 rjmp .+1264 ; 0x2ced6 StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; int c = -1; OldMMUFWDetector oldMMUh4x0r; // old MMU FW hacker ;) 2c9e6: a1 2c mov r10, r1 return State::SomethingElse; } }; StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; 2c9e8: d1 2c mov r13, r1 2c9ea: c1 2c mov r12, r1 /// @returns true when "ok\n" gets detected State Detect(uint8_t c) { // consume old MMU FW's data if any -> avoid confusion of protocol decoder if (ok == 0 && c == 'o') { ++ok; 2c9ec: 99 24 eor r9, r9 2c9ee: 93 94 inc r9 responseMsg.paramCode = (ResponseMsgParamCodes)c; responseMsg.paramValue = 0; return DecodeStatus::NeedMoreData; default: responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 2c9f0: 55 e0 ldi r21, 0x05 ; 5 2c9f2: b5 2e mov r11, r21 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 2c9f4: 63 e0 ldi r22, 0x03 ; 3 2c9f6: 86 2e mov r8, r22 if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; 2c9f8: 74 e0 ldi r23, 0x04 ; 4 2c9fa: 77 2e mov r7, r23 if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (c == ' ') { rspState = ResponseStates::ParamCode; 2c9fc: e2 e0 ldi r30, 0x02 ; 2 2c9fe: 6e 2e mov r6, r30 2ca00: 66 c0 rjmp .+204 ; 0x2cace ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 2ca02: 23 30 cpi r18, 0x03 ; 3 2ca04: 09 f4 brne .+2 ; 0x2ca08 2ca06: e0 c0 rjmp .+448 ; 0x2cbc8 2ca08: 24 30 cpi r18, 0x04 ; 4 2ca0a: 09 f0 breq .+2 ; 0x2ca0e 2ca0c: 83 c0 rjmp .+262 ; 0x2cb14 } static constexpr bool IsCRCSeparator(uint8_t c) { return c == '*'; } static constexpr bool IsHexDigit(uint8_t c) { return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f'); 2ca0e: 20 ed ldi r18, 0xD0 ; 208 2ca10: 28 0f add r18, r24 2ca12: 2a 30 cpi r18, 0x0A ; 10 2ca14: 08 f4 brcc .+2 ; 0x2ca18 2ca16: f8 c0 rjmp .+496 ; 0x2cc08 2ca18: 2f e9 ldi r18, 0x9F ; 159 2ca1a: 28 0f add r18, r24 2ca1c: 26 30 cpi r18, 0x06 ; 6 2ca1e: 08 f4 brcc .+2 ; 0x2ca22 2ca20: f3 c0 rjmp .+486 ; 0x2cc08 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 2ca22: 8a 30 cpi r24, 0x0A ; 10 2ca24: 09 f0 breq .+2 ; 0x2ca28 2ca26: fa c0 rjmp .+500 ; 0x2cc1c responseMsg.request.crc8 <<= 4U; responseMsg.request.crc8 += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (IsNewLine(c)) { // check CRC at this spot if (responseMsg.request.crc8 != responseMsg.ComputeCRC8()) { 2ca28: 40 90 4e 12 lds r4, 0x124E ; 0x80124e 2ca2c: 8a e4 ldi r24, 0x4A ; 74 2ca2e: 92 e1 ldi r25, 0x12 ; 18 2ca30: 0f 94 e2 86 call 0x30dc4 ; 0x30dc4 2ca34: 48 12 cpse r4, r24 2ca36: b8 c0 rjmp .+368 ; 0x2cba8 // CRC mismatch responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; return DecodeStatus::Error; } else { rspState = ResponseStates::RequestCode; 2ca38: 10 92 49 12 sts 0x1249, r1 ; 0x801249 /// @returns the most recently lexed request message inline const RequestMsg GetRequestMsg() const { return requestMsg; } /// @returns the most recently lexed response message inline const ResponseMsg GetResponseMsg() const { return responseMsg; } 2ca3c: 88 e0 ldi r24, 0x08 ; 8 2ca3e: ea e4 ldi r30, 0x4A ; 74 2ca40: f2 e1 ldi r31, 0x12 ; 18 2ca42: de 01 movw r26, r28 2ca44: 51 96 adiw r26, 0x11 ; 17 2ca46: 01 90 ld r0, Z+ 2ca48: 0d 92 st X+, r0 2ca4a: 8a 95 dec r24 2ca4c: e1 f7 brne .-8 ; 0x2ca46 2ca4e: 88 e0 ldi r24, 0x08 ; 8 2ca50: fe 01 movw r30, r28 2ca52: 71 96 adiw r30, 0x11 ; 17 2ca54: de 01 movw r26, r28 2ca56: 59 96 adiw r26, 0x19 ; 25 2ca58: 01 90 ld r0, Z+ 2ca5a: 0d 92 st X+, r0 2ca5c: 8a 95 dec r24 2ca5e: e1 f7 brne .-8 ; 0x2ca58 while ((c = uart->read()) >= 0) { ++bytesConsumed; RecordReceivedByte(c); switch (protocol.DecodeResponse(c)) { case DecodeStatus::MessageCompleted: rsp = protocol.GetResponseMsg(); 2ca60: 88 e0 ldi r24, 0x08 ; 8 2ca62: fe 01 movw r30, r28 2ca64: 79 96 adiw r30, 0x19 ; 25 2ca66: aa e3 ldi r26, 0x3A ; 58 2ca68: b2 e1 ldi r27, 0x12 ; 18 2ca6a: 01 90 ld r0, Z+ 2ca6c: 0d 92 st X+, r0 2ca6e: 8a 95 dec r24 2ca70: e1 f7 brne .-8 ; 0x2ca6a } dst[(lastReceivedBytes.size() - 1) * 3 + 2] = 0; // terminate properly } void ProtocolLogic::FormatLastResponseMsgAndClearLRB(char *dst) { *dst++ = '<'; 2ca72: 8c e3 ldi r24, 0x3C ; 60 2ca74: 89 83 std Y+1, r24 ; 0x01 2ca76: fe 01 movw r30, r28 2ca78: 32 96 adiw r30, 0x02 ; 2 2ca7a: a2 e5 ldi r26, 0x52 ; 82 2ca7c: b2 e1 ldi r27, 0x12 ; 18 for (uint8_t i = 0; i < lrb; ++i) { 2ca7e: 20 e0 ldi r18, 0x00 ; 0 2ca80: cf 01 movw r24, r30 2ca82: 52 16 cp r5, r18 2ca84: 09 f4 brne .+2 ; 0x2ca88 2ca86: cd c0 rjmp .+410 ; 0x2cc22 uint8_t b = lastReceivedBytes[i]; 2ca88: 3d 91 ld r19, X+ // Check for printable character, including space if (b < 32 || b > 127) { 2ca8a: 40 ee ldi r20, 0xE0 ; 224 2ca8c: 43 0f add r20, r19 2ca8e: 40 36 cpi r20, 0x60 ; 96 2ca90: 08 f0 brcs .+2 ; 0x2ca94 b = '.'; 2ca92: 3e e2 ldi r19, 0x2E ; 46 } *dst++ = b; 2ca94: 31 93 st Z+, r19 dst[(lastReceivedBytes.size() - 1) * 3 + 2] = 0; // terminate properly } void ProtocolLogic::FormatLastResponseMsgAndClearLRB(char *dst) { *dst++ = '<'; for (uint8_t i = 0; i < lrb; ++i) { 2ca96: 2f 5f subi r18, 0xFF ; 255 2ca98: f4 cf rjmp .-24 ; 0x2ca82 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 2ca9a: 8e 34 cpi r24, 0x4E ; 78 2ca9c: 08 f0 brcs .+2 ; 0x2caa0 2ca9e: 56 c0 rjmp .+172 ; 0x2cb4c 2caa0: 8b 34 cpi r24, 0x4B ; 75 2caa2: 08 f0 brcs .+2 ; 0x2caa6 2caa4: 46 c0 rjmp .+140 ; 0x2cb32 2caa6: 82 34 cpi r24, 0x42 ; 66 2caa8: 09 f4 brne .+2 ; 0x2caac 2caaa: 43 c0 rjmp .+134 ; 0x2cb32 2caac: e0 f5 brcc .+120 ; 0x2cb26 2caae: 8a 30 cpi r24, 0x0A ; 10 2cab0: 59 f0 breq .+22 ; 0x2cac8 2cab2: 8d 30 cpi r24, 0x0D ; 13 2cab4: 49 f0 breq .+18 ; 0x2cac8 } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 2cab6: b0 92 49 12 sts 0x1249, r11 ; 0x801249 Matched }; /// @returns true when "ok\n" gets detected State Detect(uint8_t c) { // consume old MMU FW's data if any -> avoid confusion of protocol decoder if (ok == 0 && c == 'o') { 2caba: a1 10 cpse r10, r1 2cabc: 05 c1 rjmp .+522 ; 0x2ccc8 2cabe: 1f 36 cpi r17, 0x6F ; 111 2cac0: 09 f0 breq .+2 ; 0x2cac4 2cac2: fe c3 rjmp .+2044 ; 0x2d2c0 ++ok; 2cac4: aa 24 eor r10, r10 2cac6: a3 94 inc r10 OldMMUFWDetector oldMMUh4x0r; // old MMU FW hacker ;) // try to consume as many rx bytes as possible (until a message has been completed) while ((c = uart->read()) >= 0) { ++bytesConsumed; 2cac8: 4f ef ldi r20, 0xFF ; 255 2caca: c4 1a sub r12, r20 2cacc: d4 0a sbc r13, r20 2cace: 87 e0 ldi r24, 0x07 ; 7 2cad0: 92 e1 ldi r25, 0x12 ; 18 2cad2: 0f 94 08 9e call 0x33c10 ; 0x33c10 int c = -1; OldMMUFWDetector oldMMUh4x0r; // old MMU FW hacker ;) // try to consume as many rx bytes as possible (until a message has been completed) while ((c = uart->read()) >= 0) { 2cad6: 97 fd sbrc r25, 7 2cad8: 00 c1 rjmp .+512 ; 0x2ccda ++bytesConsumed; RecordReceivedByte(c); 2cada: 18 2f mov r17, r24 array() = default; inline constexpr T *begin() const { return data; } inline constexpr T *end() const { return data + N; } static constexpr uint8_t size() { return N; } inline T &operator[](uint8_t i) { return data[i]; 2cadc: 20 91 62 12 lds r18, 0x1262 ; 0x801262 2cae0: 30 e0 ldi r19, 0x00 ; 0 void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); } void ProtocolLogic::RecordReceivedByte(uint8_t c) { lastReceivedBytes[lrb] = c; 2cae2: f9 01 movw r30, r18 2cae4: eb 5d subi r30, 0xDB ; 219 2cae6: fd 4e sbci r31, 0xED ; 237 2cae8: 85 a7 std Z+45, r24 ; 0x2d lrb = (lrb + 1) % lastReceivedBytes.size(); 2caea: 79 01 movw r14, r18 2caec: ef ef ldi r30, 0xFF ; 255 2caee: ee 1a sub r14, r30 2caf0: fe 0a sbc r15, r30 2caf2: ff e0 ldi r31, 0x0F ; 15 2caf4: ef 22 and r14, r31 2caf6: ff 24 eor r15, r15 2caf8: 5e 2c mov r5, r14 2cafa: e0 92 62 12 sts 0x1262, r14 ; 0x801262 ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 2cafe: 20 91 49 12 lds r18, 0x1249 ; 0x801249 2cb02: 22 30 cpi r18, 0x02 ; 2 2cb04: 09 f4 brne .+2 ; 0x2cb08 2cb06: 48 c0 rjmp .+144 ; 0x2cb98 2cb08: 08 f0 brcs .+2 ; 0x2cb0c 2cb0a: 7b cf rjmp .-266 ; 0x2ca02 2cb0c: 22 23 and r18, r18 2cb0e: 29 f2 breq .-118 ; 0x2ca9a 2cb10: 21 30 cpi r18, 0x01 ; 1 2cb12: 51 f1 breq .+84 ; 0x2cb68 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 2cb14: 1a 30 cpi r17, 0x0A ; 10 2cb16: 09 f4 brne .+2 ; 0x2cb1a 2cb18: 8f cf rjmp .-226 ; 0x2ca38 2cb1a: 1d 30 cpi r17, 0x0D ; 13 2cb1c: 09 f4 brne .+2 ; 0x2cb20 2cb1e: 8c cf rjmp .-232 ; 0x2ca38 default: //case error: if (IsNewLine(c)) { rspState = ResponseStates::RequestCode; return DecodeStatus::MessageCompleted; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 2cb20: 10 92 4f 12 sts 0x124F, r1 ; 0x80124f 2cb24: ca cf rjmp .-108 ; 0x2caba } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 2cb26: 85 34 cpi r24, 0x45 ; 69 2cb28: 30 f2 brcs .-116 ; 0x2cab6 2cb2a: 87 34 cpi r24, 0x47 ; 71 2cb2c: 10 f0 brcs .+4 ; 0x2cb32 2cb2e: 88 34 cpi r24, 0x48 ; 72 2cb30: 11 f6 brne .-124 ; 0x2cab6 case 'K': case 'F': case 'f': case 'H': case 'R': responseMsg.request.code = (RequestMsgCodes)c; 2cb32: 80 93 4a 12 sts 0x124A, r24 ; 0x80124a responseMsg.request.value = 0; 2cb36: 10 92 4b 12 sts 0x124B, r1 ; 0x80124b responseMsg.request.value2 = 0; 2cb3a: 10 92 4d 12 sts 0x124D, r1 ; 0x80124d 2cb3e: 10 92 4c 12 sts 0x124C, r1 ; 0x80124c responseMsg.request.crc8 = 0; 2cb42: 10 92 4e 12 sts 0x124E, r1 ; 0x80124e rspState = ResponseStates::RequestValue; 2cb46: 90 92 49 12 sts 0x1249, r9 ; 0x801249 2cb4a: be cf rjmp .-132 ; 0x2cac8 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 2cb4c: 89 35 cpi r24, 0x59 ; 89 2cb4e: 40 f4 brcc .+16 ; 0x2cb60 2cb50: 87 35 cpi r24, 0x57 ; 87 2cb52: 78 f7 brcc .-34 ; 0x2cb32 2cb54: 20 eb ldi r18, 0xB0 ; 176 2cb56: 28 0f add r18, r24 2cb58: 26 30 cpi r18, 0x06 ; 6 2cb5a: 08 f0 brcs .+2 ; 0x2cb5e 2cb5c: ac cf rjmp .-168 ; 0x2cab6 2cb5e: e9 cf rjmp .-46 ; 0x2cb32 2cb60: 86 36 cpi r24, 0x66 ; 102 2cb62: 09 f0 breq .+2 ; 0x2cb66 2cb64: a8 cf rjmp .-176 ; 0x2cab6 2cb66: e5 cf rjmp .-54 ; 0x2cb32 } static constexpr bool IsCRCSeparator(uint8_t c) { return c == '*'; } static constexpr bool IsHexDigit(uint8_t c) { return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f'); 2cb68: 20 ed ldi r18, 0xD0 ; 208 2cb6a: 28 0f add r18, r24 2cb6c: 2a 30 cpi r18, 0x0A ; 10 2cb6e: 50 f0 brcs .+20 ; 0x2cb84 2cb70: 2f e9 ldi r18, 0x9F ; 159 2cb72: 28 0f add r18, r24 2cb74: 26 30 cpi r18, 0x06 ; 6 2cb76: 30 f0 brcs .+12 ; 0x2cb84 case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (c == ' ') { 2cb78: 80 32 cpi r24, 0x20 ; 32 2cb7a: 09 f0 breq .+2 ; 0x2cb7e 2cb7c: 9c cf rjmp .-200 ; 0x2cab6 rspState = ResponseStates::ParamCode; 2cb7e: 60 92 49 12 sts 0x1249, r6 ; 0x801249 2cb82: a2 cf rjmp .-188 ; 0x2cac8 return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); 2cb84: 0f 94 c1 86 call 0x30d82 ; 0x30d82 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; 2cb88: 90 91 4b 12 lds r25, 0x124B ; 0x80124b 2cb8c: 92 95 swap r25 2cb8e: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.value += Char2Nibble(c); 2cb90: 89 0f add r24, r25 2cb92: 80 93 4b 12 sts 0x124B, r24 ; 0x80124b 2cb96: 98 cf rjmp .-208 ; 0x2cac8 } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 2cb98: 87 34 cpi r24, 0x47 ; 71 2cb9a: 48 f4 brcc .+18 ; 0x2cbae 2cb9c: 85 34 cpi r24, 0x45 ; 69 2cb9e: 58 f4 brcc .+22 ; 0x2cbb6 2cba0: 2f eb ldi r18, 0xBF ; 191 2cba2: 28 0f add r18, r24 2cba4: 22 30 cpi r18, 0x02 ; 2 2cba6: 38 f0 brcs .+14 ; 0x2cbb6 return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 2cba8: 10 92 4f 12 sts 0x124F, r1 ; 0x80124f 2cbac: 84 cf rjmp .-248 ; 0x2cab6 } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 2cbae: 80 35 cpi r24, 0x50 ; 80 2cbb0: 11 f0 breq .+4 ; 0x2cbb6 2cbb2: 82 35 cpi r24, 0x52 ; 82 2cbb4: c9 f7 brne .-14 ; 0x2cba8 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 2cbb6: 80 92 49 12 sts 0x1249, r8 ; 0x801249 responseMsg.paramCode = (ResponseMsgParamCodes)c; 2cbba: 80 93 4f 12 sts 0x124F, r24 ; 0x80124f responseMsg.paramValue = 0; 2cbbe: 10 92 51 12 sts 0x1251, r1 ; 0x801251 2cbc2: 10 92 50 12 sts 0x1250, r1 ; 0x801250 2cbc6: 80 cf rjmp .-256 ; 0x2cac8 2cbc8: 20 ed ldi r18, 0xD0 ; 208 2cbca: 28 0f add r18, r24 2cbcc: 2a 30 cpi r18, 0x0A ; 10 2cbce: 48 f0 brcs .+18 ; 0x2cbe2 2cbd0: 2f e9 ldi r18, 0x9F ; 159 2cbd2: 28 0f add r18, r24 2cbd4: 26 30 cpi r18, 0x06 ; 6 2cbd6: 28 f0 brcs .+10 ; 0x2cbe2 case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { 2cbd8: 8a 32 cpi r24, 0x2A ; 42 2cbda: 31 f7 brne .-52 ; 0x2cba8 rspState = ResponseStates::CRC; 2cbdc: 70 92 49 12 sts 0x1249, r7 ; 0x801249 2cbe0: 73 cf rjmp .-282 ; 0x2cac8 return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); 2cbe2: 0f 94 c1 86 call 0x30d82 ; 0x30d82 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; 2cbe6: 20 91 50 12 lds r18, 0x1250 ; 0x801250 2cbea: 30 91 51 12 lds r19, 0x1251 ; 0x801251 2cbee: 44 e0 ldi r20, 0x04 ; 4 2cbf0: 22 0f add r18, r18 2cbf2: 33 1f adc r19, r19 2cbf4: 4a 95 dec r20 2cbf6: e1 f7 brne .-8 ; 0x2cbf0 responseMsg.paramValue += Char2Nibble(c); 2cbf8: 82 0f add r24, r18 2cbfa: 93 2f mov r25, r19 2cbfc: 91 1d adc r25, r1 2cbfe: 90 93 51 12 sts 0x1251, r25 ; 0x801251 2cc02: 80 93 50 12 sts 0x1250, r24 ; 0x801250 2cc06: 60 cf rjmp .-320 ; 0x2cac8 return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; responseMsg.request.crc8 += Char2Nibble(c); 2cc08: 0f 94 c1 86 call 0x30d82 ; 0x30d82 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; 2cc0c: 90 91 4e 12 lds r25, 0x124E ; 0x80124e 2cc10: 92 95 swap r25 2cc12: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.crc8 += Char2Nibble(c); 2cc14: 89 0f add r24, r25 2cc16: 80 93 4e 12 sts 0x124E, r24 ; 0x80124e 2cc1a: 56 cf rjmp .-340 ; 0x2cac8 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 2cc1c: 8d 30 cpi r24, 0x0D ; 13 2cc1e: 21 f6 brne .-120 ; 0x2cba8 2cc20: 03 cf rjmp .-506 ; 0x2ca28 if (b < 32 || b > 127) { b = '.'; } *dst++ = b; } *dst = 0; // terminate properly 2cc22: e8 0e add r14, r24 2cc24: f9 1e adc r15, r25 2cc26: f7 01 movw r30, r14 2cc28: 10 82 st Z, r1 lrb = 0; // reset the input buffer index in case of a clean message 2cc2a: 10 92 62 12 sts 0x1262, r1 ; 0x801262 } void ProtocolLogic::LogResponse() { char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); 2cc2e: 81 e6 ldi r24, 0x61 ; 97 2cc30: 9d e9 ldi r25, 0x9D ; 157 2cc32: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 2cc36: 8b e5 ldi r24, 0x5B ; 91 2cc38: 9d e9 ldi r25, 0x9D ; 157 2cc3a: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 2cc3e: ce 01 movw r24, r28 2cc40: 01 96 adiw r24, 0x01 ; 1 2cc42: 0f 94 fd 98 call 0x331fa ; 0x331fa switch (protocol.DecodeResponse(c)) { case DecodeStatus::MessageCompleted: rsp = protocol.GetResponseMsg(); LogResponse(); // @@TODO reset direction of communication RecordUARTActivity(); // something has happened on the UART, update the timeout record 2cc46: 0f 94 1c 3b call 0x27638 ; 0x27638 if (auto expmsg = ExpectingMessage(); expmsg != MessageReady) { // this whole statement takes 12B return expmsg; } // process message switch (currentScope) { 2cc4a: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2cc4e: 81 30 cpi r24, 0x01 ; 1 2cc50: 09 f4 brne .+2 ; 0x2cc54 2cc52: 74 c0 rjmp .+232 ; 0x2cd3c 2cc54: 08 f4 brcc .+2 ; 0x2cc58 2cc56: c5 ce rjmp .-630 ; 0x2c9e2 2cc58: 83 30 cpi r24, 0x03 ; 3 2cc5a: 09 f4 brne .+2 ; 0x2cc5e 2cc5c: d1 c0 rjmp .+418 ; 0x2ce00 2cc5e: 84 30 cpi r24, 0x04 ; 4 2cc60: 09 f0 breq .+2 ; 0x2cc64 2cc62: 4f ce rjmp .-866 ; 0x2c902 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 2cc64: 80 91 28 12 lds r24, 0x1228 ; 0x801228 2cc68: 86 30 cpi r24, 0x06 ; 6 2cc6a: 09 f4 brne .+2 ; 0x2cc6e 2cc6c: 6c c1 rjmp .+728 ; 0x2cf46 2cc6e: 08 f0 brcs .+2 ; 0x2cc72 2cc70: 93 c1 rjmp .+806 ; 0x2cf98 2cc72: 84 30 cpi r24, 0x04 ; 4 2cc74: 09 f4 brne .+2 ; 0x2cc78 2cc76: 09 c1 rjmp .+530 ; 0x2ce8a 2cc78: 85 30 cpi r24, 0x05 ; 5 2cc7a: 09 f0 breq .+2 ; 0x2cc7e 2cc7c: cc c0 rjmp .+408 ; 0x2ce16 case ScopeState::CommandSent: { switch (rsp.paramCode) { // the response should be either accepted or rejected 2cc7e: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2cc82: 81 34 cpi r24, 0x41 ; 65 2cc84: 09 f4 brne .+2 ; 0x2cc88 2cc86: 96 c1 rjmp .+812 ; 0x2cfb4 2cc88: 82 35 cpi r24, 0x52 ; 82 2cc8a: 09 f0 breq .+2 ; 0x2cc8e 2cc8c: c4 c0 rjmp .+392 ; 0x2ce16 errorCode = ErrorCode::RUNNING; scopeState = ScopeState::Wait; break; case ResponseMsgParamCodes::Rejected: // rejected - should normally not happen, but report the error up progressCode = ProgressCode::OK; 2cc8e: 10 92 67 12 sts 0x1267, r1 ; 0x801267 errorCode = ErrorCode::PROTOCOL_ERROR; 2cc92: 8d e2 ldi r24, 0x2D ; 45 2cc94: 90 e8 ldi r25, 0x80 ; 128 2cc96: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2cc9a: 80 93 65 12 sts 0x1265, r24 ; 0x801265 } break; case CommandRejected: // we have to repeat it - that's the only thing we can do // no change in state // @@TODO wait until Q0 returns command in progress finished, then we can send this one LogError(PSTR("Command rejected")); 2cc9e: 81 ec ldi r24, 0xC1 ; 193 2cca0: 9a e9 ldi r25, 0x9A ; 154 2cca2: 0f 94 39 3b call 0x27672 ; 0x27672 void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 2cca6: 85 e0 ldi r24, 0x05 ; 5 2cca8: 80 93 28 12 sts 0x1228, r24 ; 0x801228 SendMsg(rq); 2ccac: 40 91 2a 12 lds r20, 0x122A ; 0x80122a 2ccb0: 50 91 2b 12 lds r21, 0x122B ; 0x80122b 2ccb4: 60 91 2c 12 lds r22, 0x122C ; 0x80122c 2ccb8: 70 91 2d 12 lds r23, 0x122D ; 0x80122d 2ccbc: 80 91 2e 12 lds r24, 0x122E ; 0x80122e 2ccc0: 0f 94 22 3c call 0x27844 ; 0x27844 2ccc4: 16 e0 ldi r17, 0x06 ; 6 2ccc6: 07 c1 rjmp .+526 ; 0x2ced6 State Detect(uint8_t c) { // consume old MMU FW's data if any -> avoid confusion of protocol decoder if (ok == 0 && c == 'o') { ++ok; return State::MatchingPart; } else if (ok == 1 && c == 'k') { 2ccc8: 1b 36 cpi r17, 0x6B ; 107 2ccca: 09 f0 breq .+2 ; 0x2ccce 2cccc: f9 c2 rjmp .+1522 ; 0x2d2c0 LogError(PSTR("Command Error")); // we shall probably transfer into the Idle state and await further instructions from the upper layer // Idle state may solve the problem of keeping up the heart beat running break; case VersionMismatch: LogError(PSTR("Version mismatch")); 2ccce: 82 ea ldi r24, 0xA2 ; 162 2ccd0: 9a e9 ldi r25, 0x9A ; 154 2ccd2: 0f 94 39 3b call 0x27672 ; 0x27672 2ccd6: 18 e0 ldi r17, 0x08 ; 8 2ccd8: fe c0 rjmp .+508 ; 0x2ced6 default: RecordUARTActivity(); // something has happened on the UART, update the timeout record return ProtocolError; } } if (bytesConsumed != 0) { 2ccda: cd 28 or r12, r13 2ccdc: 19 f0 breq .+6 ; 0x2cce4 RecordUARTActivity(); // something has happened on the UART, update the timeout record 2ccde: 0f 94 1c 3b call 0x27638 ; 0x27638 2cce2: 7f ce rjmp .-770 ; 0x2c9e2 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 2cce4: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 2cce8: ab 01 movw r20, r22 2ccea: bc 01 movw r22, r24 2ccec: 80 91 34 12 lds r24, 0x1234 ; 0x801234 2ccf0: 90 91 35 12 lds r25, 0x1235 ; 0x801235 2ccf4: a0 91 36 12 lds r26, 0x1236 ; 0x801236 2ccf8: b0 91 37 12 lds r27, 0x1237 ; 0x801237 2ccfc: 80 53 subi r24, 0x30 ; 48 2ccfe: 98 4f sbci r25, 0xF8 ; 248 2cd00: af 4f sbci r26, 0xFF ; 255 2cd02: bf 4f sbci r27, 0xFF ; 255 } } if (bytesConsumed != 0) { RecordUARTActivity(); // something has happened on the UART, update the timeout record return Processing; // consumed some bytes, but message still not ready } else if (Elapsed(linkLayerTimeout) && currentScope != Scope::Stopped) { 2cd04: 48 17 cp r20, r24 2cd06: 59 07 cpc r21, r25 2cd08: 6a 07 cpc r22, r26 2cd0a: 7b 07 cpc r23, r27 2cd0c: 08 f4 brcc .+2 ; 0x2cd10 2cd0e: 69 ce rjmp .-814 ; 0x2c9e2 2cd10: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2cd14: 88 23 and r24, r24 2cd16: 09 f4 brne .+2 ; 0x2cd1a 2cd18: 64 ce rjmp .-824 ; 0x2c9e2 rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 2cd1a: 10 92 49 12 sts 0x1249, r1 ; 0x801249 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 2cd1e: 81 e0 ldi r24, 0x01 ; 1 2cd20: 80 93 42 12 sts 0x1242, r24 ; 0x801242 currentScope = Scope::StartSeq; 2cd24: 80 93 27 12 sts 0x1227, r24 ; 0x801227 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 2cd28: 86 e0 ldi r24, 0x06 ; 6 2cd2a: 80 93 29 12 sts 0x1229, r24 ; 0x801229 SendVersion(0); 2cd2e: 80 e0 ldi r24, 0x00 ; 0 2cd30: 0f 94 79 62 call 0x2c4f2 ; 0x2c4f2 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 2cd34: 64 e0 ldi r22, 0x04 ; 4 2cd36: 8a e7 ldi r24, 0x7A ; 122 2cd38: 9a e9 ldi r25, 0x9A ; 154 2cd3a: 79 c0 rjmp .+242 ; 0x2ce2e return Finished; } StepStatus ProtocolLogic::StartSeqStep() { // solve initial handshake switch (scopeState) { 2cd3c: 10 91 28 12 lds r17, 0x1228 ; 0x801228 2cd40: 13 30 cpi r17, 0x03 ; 3 2cd42: b1 f1 breq .+108 ; 0x2cdb0 2cd44: 60 f0 brcs .+24 ; 0x2cd5e 2cd46: 16 30 cpi r17, 0x06 ; 6 2cd48: 09 f4 brne .+2 ; 0x2cd4c 2cd4a: 50 c0 rjmp .+160 ; 0x2cdec 2cd4c: 19 30 cpi r17, 0x09 ; 9 2cd4e: 09 f0 breq .+2 ; 0x2cd52 2cd50: be cf rjmp .-132 ; 0x2ccce // Start General Interrogation after line up - initial parametrization is started StartWritingInitRegisters(); } return Processing; case ScopeState::WritingInitRegisters: if (ProcessWritingInitRegister()) { 2cd52: 0f 94 4c 3d call 0x27a98 ; 0x27a98 2cd56: 88 23 and r24, r24 2cd58: 09 f4 brne .+2 ; 0x2cd5c 2cd5a: 43 ce rjmp .-890 ; 0x2c9e2 2cd5c: 40 ce rjmp .-896 ; 0x2c9de void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; } StepStatus ProtocolLogic::ProcessVersionResponse(uint8_t stage) { if (rsp.request.code != RequestMsgCodes::Version || rsp.request.value != stage) { 2cd5e: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 2cd62: 83 35 cpi r24, 0x53 ; 83 2cd64: 21 f4 brne .+8 ; 0x2cd6e 2cd66: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 2cd6a: 18 17 cp r17, r24 2cd6c: 11 f0 breq .+4 ; 0x2cd72 mmuFwVersion[stage] = rsp.paramValue; if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { if (--retries == 0) { return VersionMismatch; } else { SendVersion(stage); 2cd6e: 81 2f mov r24, r17 2cd70: fe cd rjmp .-1028 ; 0x2c96e StepStatus ProtocolLogic::ProcessVersionResponse(uint8_t stage) { if (rsp.request.code != RequestMsgCodes::Version || rsp.request.value != stage) { // got a response to something else - protocol corruption probably, repeat the query OR restart the comm by issuing S0? SendVersion(stage); } else { mmuFwVersion[stage] = rsp.paramValue; 2cd72: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2cd76: e1 2f mov r30, r17 2cd78: f0 e0 ldi r31, 0x00 ; 0 2cd7a: df 01 movw r26, r30 2cd7c: ac 58 subi r26, 0x8C ; 140 2cd7e: bd 4e sbci r27, 0xED ; 237 2cd80: 8c 93 st X, r24 if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { 2cd82: e1 56 subi r30, 0x61 ; 97 2cd84: f5 46 sbci r31, 0x65 ; 101 2cd86: e4 91 lpm r30, Z 2cd88: 8e 17 cp r24, r30 2cd8a: 41 f0 breq .+16 ; 0x2cd9c if (--retries == 0) { 2cd8c: 80 91 29 12 lds r24, 0x1229 ; 0x801229 2cd90: 81 50 subi r24, 0x01 ; 1 2cd92: 80 93 29 12 sts 0x1229, r24 ; 0x801229 2cd96: 81 11 cpse r24, r1 2cd98: ea cf rjmp .-44 ; 0x2cd6e 2cd9a: 99 cf rjmp .-206 ; 0x2ccce SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 2cd9c: 84 ef ldi r24, 0xF4 ; 244 2cd9e: 9c e9 ldi r25, 0x9C ; 156 2cda0: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 /// @returns the initial cause which started this drop out event inline StepStatus InitialCause() const { return cause; } /// Rearms the object for further processing - basically call this once the MMU responds with something meaningful (e.g. S0 A2) inline void Reset() { occurrences = maxOccurrences; } 2cda4: 8a e0 ldi r24, 0x0A ; 10 2cda6: 80 93 39 12 sts 0x1239, r24 ; 0x801239 } else { SendVersion(stage); } } else { ResetCommunicationTimeoutAttempts(); // got a meaningful response from the MMU, stop data layer timeout tracking SendVersion(stage + 1); 2cdaa: 81 e0 ldi r24, 0x01 ; 1 2cdac: 81 0f add r24, r17 2cdae: df cd rjmp .-1090 ; 0x2c96e case ScopeState::S0Sent: // received response to S0 - major case ScopeState::S1Sent: // received response to S1 - minor case ScopeState::S2Sent: // received response to S2 - minor return ProcessVersionResponse((uint8_t)scopeState - (uint8_t)ScopeState::S0Sent); case ScopeState::S3Sent: // received response to S3 - revision if (rsp.request.code != RequestMsgCodes::Version || rsp.request.value != 3) { 2cdb0: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 2cdb4: 83 35 cpi r24, 0x53 ; 83 2cdb6: 21 f4 brne .+8 ; 0x2cdc0 2cdb8: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 2cdbc: 83 30 cpi r24, 0x03 ; 3 2cdbe: 11 f0 breq .+4 ; 0x2cdc4 // got a response to something else - protocol corruption probably, repeat the query OR restart the comm by issuing S0? SendVersion(3); 2cdc0: 83 e0 ldi r24, 0x03 ; 3 2cdc2: d5 cd rjmp .-1110 ; 0x2c96e } else { mmuFwVersionBuild = rsp.paramValue; // just register the build number 2cdc4: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2cdc8: 90 91 41 12 lds r25, 0x1241 ; 0x801241 2cdcc: 90 93 78 12 sts 0x1278, r25 ; 0x801278 2cdd0: 80 93 77 12 sts 0x1277, r24 ; 0x801277 } return ScopeState::Reading16bitRegisters; } void ProtocolLogic::StartWritingInitRegisters() { regIndex = 0; 2cdd4: 10 92 73 12 sts 0x1273, r1 ; 0x801273 SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 2cdd8: e2 ef ldi r30, 0xF2 ; 242 2cdda: fc e9 ldi r31, 0x9C ; 156 2cddc: 84 91 lpm r24, Z 2cdde: 60 91 71 12 lds r22, 0x1271 ; 0x801271 2cde2: 70 e0 ldi r23, 0x00 ; 0 2cde4: 49 e0 ldi r20, 0x09 ; 9 2cde6: 0f 94 8d 3c call 0x2791a ; 0x2791a 2cdea: fb cd rjmp .-1034 ; 0x2c9e2 currentScope = Scope::Idle; IdleRestart(); } void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; 2cdec: 82 e0 ldi r24, 0x02 ; 2 2cdee: 80 93 42 12 sts 0x1242, r24 ; 0x801242 currentScope = Scope::Idle; 2cdf2: 83 e0 ldi r24, 0x03 ; 3 2cdf4: 80 93 27 12 sts 0x1227, r24 ; 0x801227 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 2cdf8: 82 e8 ldi r24, 0x82 ; 130 2cdfa: 80 93 28 12 sts 0x1228, r24 ; 0x801228 2cdfe: d2 cd rjmp .-1116 ; 0x2c9a4 } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 2ce00: 80 91 28 12 lds r24, 0x1228 ; 0x801228 2ce04: 88 30 cpi r24, 0x08 ; 8 2ce06: 09 f4 brne .+2 ; 0x2ce0a 2ce08: b7 c0 rjmp .+366 ; 0x2cf78 2ce0a: a8 f4 brcc .+42 ; 0x2ce36 2ce0c: 84 30 cpi r24, 0x04 ; 4 2ce0e: d9 f0 breq .+54 ; 0x2ce46 2ce10: 87 30 cpi r24, 0x07 ; 7 2ce12: 09 f4 brne .+2 ; 0x2ce16 2ce14: ae c0 rjmp .+348 ; 0x2cf72 return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); } StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; 2ce16: 81 e0 ldi r24, 0x01 ; 1 2ce18: 80 93 42 12 sts 0x1242, r24 ; 0x801242 currentScope = Scope::DelayedRestart; 2ce1c: 82 e0 ldi r24, 0x02 ; 2 2ce1e: 80 93 27 12 sts 0x1227, r24 ; 0x801227 retries = maxRetries; SendVersion(0); } void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; 2ce22: 83 e8 ldi r24, 0x83 ; 131 2ce24: 80 93 28 12 sts 0x1228, r24 ; 0x801228 StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; currentScope = Scope::DelayedRestart; DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); 2ce28: 65 e0 ldi r22, 0x05 ; 5 2ce2a: 80 e9 ldi r24, 0x90 ; 144 2ce2c: 9a e9 ldi r25, 0x9A ; 154 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 2ce2e: 0f 94 aa 3b call 0x27754 ; 0x27754 2ce32: 18 2f mov r17, r24 2ce34: 50 c0 rjmp .+160 ; 0x2ced6 } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 2ce36: 8a 30 cpi r24, 0x0A ; 10 2ce38: 09 f4 brne .+2 ; 0x2ce3c 2ce3a: a7 c0 rjmp .+334 ; 0x2cf8a 2ce3c: 60 f3 brcs .-40 ; 0x2ce16 2ce3e: 8d 30 cpi r24, 0x0D ; 13 2ce40: 08 f4 brcc .+2 ; 0x2ce44 2ce42: 5f cd rjmp .-1346 ; 0x2c902 2ce44: e8 cf rjmp .-48 ; 0x2ce16 case ScopeState::QuerySent: // check UART // If we are accidentally in Idle and we receive something like "T0 P1" - that means the communication dropped out while a command was in progress. // That causes no issues here, we just need to switch to Command processing and continue there from now on. // The usual response in this case should be some command and "F" - finished - that confirms we are in an Idle state even on the MMU side. switch (rsp.request.code) { 2ce46: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 2ce4a: 8e 34 cpi r24, 0x4E ; 78 2ce4c: 60 f5 brcc .+88 ; 0x2cea6 2ce4e: 8b 34 cpi r24, 0x4B ; 75 2ce50: 10 f4 brcc .+4 ; 0x2ce56 2ce52: 85 34 cpi r24, 0x45 ; 69 2ce54: 01 f7 brne .-64 ; 0x2ce16 case RequestMsgCodes::Eject: case RequestMsgCodes::Load: case RequestMsgCodes::Mode: case RequestMsgCodes::Tool: case RequestMsgCodes::Unload: if (rsp.paramCode != ResponseMsgParamCodes::Finished) { 2ce56: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2ce5a: 86 34 cpi r24, 0x46 ; 70 2ce5c: 09 f4 brne .+2 ; 0x2ce60 2ce5e: 73 c0 rjmp .+230 ; 0x2cf46 return true; } } StepStatus ProtocolLogic::SwitchFromIdleToCommand() { currentScope = Scope::Command; 2ce60: 84 e0 ldi r24, 0x04 ; 4 2ce62: 80 93 27 12 sts 0x1227, r24 ; 0x801227 2ce66: 85 e0 ldi r24, 0x05 ; 5 2ce68: ea e3 ldi r30, 0x3A ; 58 2ce6a: f2 e1 ldi r31, 0x12 ; 18 2ce6c: de 01 movw r26, r28 2ce6e: 11 96 adiw r26, 0x01 ; 1 2ce70: 01 90 ld r0, Z+ 2ce72: 0d 92 st X+, r0 2ce74: 8a 95 dec r24 2ce76: e1 f7 brne .-8 ; 0x2ce70 StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 2ce78: 85 e0 ldi r24, 0x05 ; 5 2ce7a: fe 01 movw r30, r28 2ce7c: 31 96 adiw r30, 0x01 ; 1 2ce7e: aa e2 ldi r26, 0x2A ; 42 2ce80: b2 e1 ldi r27, 0x12 ; 18 2ce82: 01 90 ld r0, Z+ 2ce84: 0d 92 st X+, r0 2ce86: 8a 95 dec r24 2ce88: e1 f7 brne .-8 ; 0x2ce82 default: return ProtocolError; } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); 2ce8a: 0f 94 2e 63 call 0x2c65c ; 0x2c65c 2ce8e: 18 2f mov r17, r24 StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately ActivatePlannedRequest(); } auto currentStatus = ScopeStep(); switch (currentStatus) { 2ce90: 85 30 cpi r24, 0x05 ; 5 2ce92: 09 f2 breq .-126 ; 0x2ce16 2ce94: 08 f0 brcs .+2 ; 0x2ce98 2ce96: 9c c0 rjmp .+312 ; 0x2cfd0 2ce98: 82 30 cpi r24, 0x02 ; 2 2ce9a: 09 f4 brne .+2 ; 0x2ce9e 2ce9c: 32 cd rjmp .-1436 ; 0x2c902 2ce9e: 84 30 cpi r24, 0x04 ; 4 2cea0: 09 f4 brne .+2 ; 0x2cea4 2cea2: 3b cf rjmp .-394 ; 0x2cd1a 2cea4: 18 c0 rjmp .+48 ; 0x2ced6 switch (scopeState) { case ScopeState::QuerySent: // check UART // If we are accidentally in Idle and we receive something like "T0 P1" - that means the communication dropped out while a command was in progress. // That causes no issues here, we just need to switch to Command processing and continue there from now on. // The usual response in this case should be some command and "F" - finished - that confirms we are in an Idle state even on the MMU side. switch (rsp.request.code) { 2cea6: 84 35 cpi r24, 0x54 ; 84 2cea8: 08 f4 brcc .+2 ; 0x2ceac 2ceaa: b5 cf rjmp .-150 ; 0x2ce16 2ceac: 86 35 cpi r24, 0x56 ; 86 2ceae: 98 f2 brcs .-90 ; 0x2ce56 2ceb0: 88 35 cpi r24, 0x58 ; 88 2ceb2: 09 f0 breq .+2 ; 0x2ceb6 2ceb4: b0 cf rjmp .-160 ; 0x2ce16 break; case RequestMsgCodes::Reset: // this one is kind of special // we do not transfer to any "running" command (i.e. we stay in Idle), // but in case there is an error reported we must make sure it gets propagated switch (rsp.paramCode) { 2ceb6: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2ceba: 86 34 cpi r24, 0x46 ; 70 2cebc: 89 f1 breq .+98 ; 0x2cf20 2cebe: 80 35 cpi r24, 0x50 ; 80 2cec0: c1 f1 breq .+112 ; 0x2cf32 2cec2: 82 34 cpi r24, 0x42 ; 66 2cec4: 09 f0 breq .+2 ; 0x2cec8 2cec6: 42 c0 rjmp .+132 ; 0x2cf4c case ResponseMsgParamCodes::Button: // The user pushed a button on the MMU. Save it, do what we need to do // to prepare, then pass it back to the MMU so it can work its magic. buttonCode = static_cast(rsp.paramValue); 2cec8: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2cecc: 80 93 68 12 sts 0x1268, r24 ; 0x801268 StartReading8bitRegisters(); 2ced0: 0f 94 6e 61 call 0x2c2dc ; 0x2c2dc return ButtonPushed; 2ced4: 1b e0 ldi r17, 0x0B ; 11 2ced6: 80 91 25 12 lds r24, 0x1225 ; 0x801225 2ceda: 90 91 26 12 lds r25, 0x1226 ; 0x801226 break; default: break; } // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; 2cede: 81 30 cpi r24, 0x01 ; 1 2cee0: 91 05 cpc r25, r1 2cee2: 09 f0 breq .+2 ; 0x2cee6 2cee4: f0 c1 rjmp .+992 ; 0x2d2c6 const StepStatus ss = logic.Step(); switch (ss) { 2cee6: 12 30 cpi r17, 0x02 ; 2 2cee8: 09 f4 brne .+2 ; 0x2ceec 2ceea: 90 c0 rjmp .+288 ; 0x2d00c 2ceec: 08 f0 brcs .+2 ; 0x2cef0 2ceee: 7d c0 rjmp .+250 ; 0x2cfea 2cef0: 11 23 and r17, r17 2cef2: 09 f4 brne .+2 ; 0x2cef6 2cef4: 1a c1 rjmp .+564 ; 0x2d12a case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 2cef6: 00 23 and r16, r16 2cef8: 09 f4 brne .+2 ; 0x2cefc 2cefa: e6 c0 rjmp .+460 ; 0x2d0c8 switch (ss) { 2cefc: 17 30 cpi r17, 0x07 ; 7 2cefe: 09 f4 brne .+2 ; 0x2cf02 2cf00: c6 c1 rjmp .+908 ; 0x2d28e 2cf02: 08 f0 brcs .+2 ; 0x2cf06 2cf04: ba c1 rjmp .+884 ; 0x2d27a 2cf06: 14 30 cpi r17, 0x04 ; 4 2cf08: 09 f4 brne .+2 ; 0x2cf0c 2cf0a: c9 c1 rjmp .+914 ; 0x2d29e 2cf0c: 15 30 cpi r17, 0x05 ; 5 2cf0e: 09 f0 breq .+2 ; 0x2cf12 2cf10: db c0 rjmp .+438 ; 0x2d0c8 state = xState::Connecting; ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); break; case ProtocolError: state = xState::Connecting; 2cf12: 82 e0 ldi r24, 0x02 ; 2 2cf14: 80 93 94 12 sts 0x1294, r24 ; 0x801294 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); 2cf18: 60 e0 ldi r22, 0x00 ; 0 2cf1a: 8d e2 ldi r24, 0x2D ; 45 2cf1c: 90 e8 ldi r25, 0x80 ; 128 2cf1e: bc c1 rjmp .+888 ; 0x2d298 // to prepare, then pass it back to the MMU so it can work its magic. buttonCode = static_cast(rsp.paramValue); StartReading8bitRegisters(); return ButtonPushed; case ResponseMsgParamCodes::Finished: if (ReqMsg().code != RequestMsgCodes::unknown) { 2cf20: 80 91 2a 12 lds r24, 0x122A ; 0x80122a 2cf24: 88 23 and r24, r24 2cf26: 29 f0 breq .+10 ; 0x2cf32 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 2cf28: 82 e8 ldi r24, 0x82 ; 130 2cf2a: 80 93 28 12 sts 0x1228, r24 ; 0x801228 case ResponseMsgParamCodes::Finished: if (ReqMsg().code != RequestMsgCodes::unknown) { // got reset while doing some other command - the originally issued command was interrupted! // this must be solved by the upper layer, protocol logic doesn't have all the context (like unload before trying again) IdleRestart(); return Interrupted; 2cf2e: 13 e0 ldi r17, 0x03 ; 3 2cf30: d2 cf rjmp .-92 ; 0x2ced6 } [[fallthrough]]; case ResponseMsgParamCodes::Processing: // @@TODO we may actually use this branch to report progress of manual operation on the MMU // The MMU sends e.g. X0 P27 after its restart when the user presses an MMU button to move the Selector progressCode = static_cast(rsp.paramValue); 2cf32: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2cf36: 80 93 67 12 sts 0x1267, r24 ; 0x801267 errorCode = ErrorCode::OK; 2cf3a: 81 e0 ldi r24, 0x01 ; 1 2cf3c: 90 e0 ldi r25, 0x00 ; 0 2cf3e: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2cf42: 80 93 65 12 sts 0x1265, r24 ; 0x801265 } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); case ScopeState::FilamentSensorStateSent: StartReading8bitRegisters(); 2cf46: 0f 94 6e 61 call 0x2c2dc ; 0x2c2dc 2cf4a: 4b cd rjmp .-1386 ; 0x2c9e2 // The MMU sends e.g. X0 P27 after its restart when the user presses an MMU button to move the Selector progressCode = static_cast(rsp.paramValue); errorCode = ErrorCode::OK; break; default: progressCode = ProgressCode::ERRWaitingForUser; 2cf4c: 8c e0 ldi r24, 0x0C ; 12 2cf4e: 80 93 67 12 sts 0x1267, r24 ; 0x801267 errorCode = static_cast(rsp.paramValue); 2cf52: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2cf56: 90 91 41 12 lds r25, 0x1241 ; 0x801241 2cf5a: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2cf5e: 80 93 65 12 sts 0x1265, r24 ; 0x801265 StartReading8bitRegisters(); // continue Idle state without restarting the communication 2cf62: 0f 94 6e 61 call 0x2c2dc ; 0x2c2dc // @@TODO wait until Q0 returns command in progress finished, then we can send this one LogError(PSTR("Command rejected")); CommandRestart(); break; case CommandError: LogError(PSTR("Command Error")); 2cf66: 83 eb ldi r24, 0xB3 ; 179 2cf68: 9a e9 ldi r25, 0x9A ; 154 2cf6a: 0f 94 39 3b call 0x27672 ; 0x27672 2cf6e: 17 e0 ldi r17, 0x07 ; 7 2cf70: b2 cf rjmp .-156 ; 0x2ced6 return ProtocolError; } StartReading8bitRegisters(); return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); 2cf72: 0f 94 92 61 call 0x2c324 ; 0x2c324 2cf76: 35 cd rjmp .-1430 ; 0x2c9e2 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Ready); 2cf78: 82 e8 ldi r24, 0x82 ; 130 2cf7a: 0f 94 76 61 call 0x2c2ec ; 0x2c2ec 2cf7e: 80 93 28 12 sts 0x1228, r24 ; 0x801228 return scopeState == ScopeState::Ready ? Finished : Processing; 2cf82: 82 38 cpi r24, 0x82 ; 130 2cf84: 09 f0 breq .+2 ; 0x2cf88 2cf86: 2d cd rjmp .-1446 ; 0x2c9e2 2cf88: bc cc rjmp .-1672 ; 0x2c902 case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 2cf8a: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2cf8e: 81 34 cpi r24, 0x41 ; 65 2cf90: d1 f6 brne .-76 ; 0x2cf46 // Button was accepted, decrement the retry. DecrementRetryAttempts(); 2cf92: 0f 94 27 3b call 0x2764e ; 0x2764e 2cf96: d7 cf rjmp .-82 ; 0x2cf46 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 2cf98: 88 30 cpi r24, 0x08 ; 8 2cf9a: b1 f0 breq .+44 ; 0x2cfc8 2cf9c: 50 f3 brcs .-44 ; 0x2cf72 2cf9e: 8a 30 cpi r24, 0x0A ; 10 2cfa0: 09 f0 breq .+2 ; 0x2cfa4 2cfa2: 39 cf rjmp .-398 ; 0x2ce16 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); return Processing; case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 2cfa4: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2cfa8: 81 34 cpi r24, 0x41 ; 65 2cfaa: 09 f0 breq .+2 ; 0x2cfae 2cfac: 18 cd rjmp .-1488 ; 0x2c9de // Button was accepted, decrement the retry. DecrementRetryAttempts(); 2cfae: 0f 94 27 3b call 0x2764e ; 0x2764e 2cfb2: 15 cd rjmp .-1494 ; 0x2c9de StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { case ScopeState::CommandSent: { switch (rsp.paramCode) { // the response should be either accepted or rejected case ResponseMsgParamCodes::Accepted: progressCode = ProgressCode::OK; 2cfb4: 10 92 67 12 sts 0x1267, r1 ; 0x801267 errorCode = ErrorCode::RUNNING; 2cfb8: 10 92 66 12 sts 0x1266, r1 ; 0x801266 2cfbc: 10 92 65 12 sts 0x1265, r1 ; 0x801265 scopeState = ScopeState::Wait; 2cfc0: 81 e8 ldi r24, 0x81 ; 129 return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); 2cfc2: 80 93 28 12 sts 0x1228, r24 ; 0x801228 2cfc6: 0d cd rjmp .-1510 ; 0x2c9e2 2cfc8: 81 e8 ldi r24, 0x81 ; 129 2cfca: 0f 94 76 61 call 0x2c2ec ; 0x2c2ec 2cfce: f9 cf rjmp .-14 ; 0x2cfc2 StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately ActivatePlannedRequest(); } auto currentStatus = ScopeStep(); switch (currentStatus) { 2cfd0: 87 30 cpi r24, 0x07 ; 7 2cfd2: 49 f2 breq .-110 ; 0x2cf66 2cfd4: 08 f4 brcc .+2 ; 0x2cfd8 2cfd6: 63 ce rjmp .-826 ; 0x2cc9e 2cfd8: 88 30 cpi r24, 0x08 ; 8 2cfda: 09 f4 brne .+2 ; 0x2cfde 2cfdc: 78 ce rjmp .-784 ; 0x2ccce 2cfde: 7b cf rjmp .-266 ; 0x2ced6 // We are ok, switching to Idle if there is no potential next request planned. // But the trouble is we must report a finished command if the previous command has just been finished // i.e. only try to find some planned command if we just finished the Idle cycle if (!ActivatePlannedRequest()) { // if nothing is planned, switch to Idle SwitchToIdle(); } else if (ExpectsResponse()) { 2cfe0: 80 91 28 12 lds r24, 0x1228 ; 0x801228 2cfe4: 87 fd sbrc r24, 7 2cfe6: 9a cc rjmp .-1740 ; 0x2c91c 2cfe8: fc cc rjmp .-1544 ; 0x2c9e2 StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); const StepStatus ss = logic.Step(); switch (ss) { 2cfea: 13 30 cpi r17, 0x03 ; 3 2cfec: 09 f4 brne .+2 ; 0x2cff0 2cfee: 6c c0 rjmp .+216 ; 0x2d0c8 2cff0: 1b 30 cpi r17, 0x0B ; 11 2cff2: 09 f0 breq .+2 ; 0x2cff6 2cff4: 80 cf rjmp .-256 ; 0x2cef6 case Processing: OnMMUProgressMsg(logic.Progress()); break; case ButtonPushed: lastButton = logic.Button(); 2cff6: 80 91 68 12 lds r24, 0x1268 ; 0x801268 2cffa: 80 93 8f 12 sts 0x128F, r24 ; 0x80128f LogEchoEvent_P(PSTR("MMU Button pushed")); 2cffe: 82 ed ldi r24, 0xD2 ; 210 2d000: 9a e9 ldi r25, 0x9A ; 154 2d002: 0f 94 26 87 call 0x30e4c ; 0x30e4c CheckUserInput(); // Process the button immediately 2d006: 0f 94 98 63 call 0x2c730 ; 0x2c730 2d00a: 5e c0 rjmp .+188 ; 0x2d0c8 CheckErrorScreenUserInput(); } void MMU2::CheckFINDARunout() { // Check for FINDA filament runout if (!FindaDetectsFilament() && check_fsensor()) { // Check if we have filament runout detected from sensors 2d00c: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 2d010: 81 11 cpse r24, r1 2d012: 5a c0 rjmp .+180 ; 0x2d0c8 return (eeprom_read_byte((uint8_t*)EEPROM_UVLO) != PowerPanic::NO_PENDING_RECOVERY); } // Currently only used in one place, allowed to be inlined bool check_fsensor() { return printJobOngoing() 2d014: 0e 94 c8 60 call 0xc190 ; 0xc190 && mcode_in_progress != 600 && !saved_printing && !mesh_bed_leveling_flag && !homing_flag && e_active(); 2d018: 88 23 and r24, r24 2d01a: 09 f4 brne .+2 ; 0x2d01e 2d01c: 55 c0 rjmp .+170 ; 0x2d0c8 } // Currently only used in one place, allowed to be inlined bool check_fsensor() { return printJobOngoing() && mcode_in_progress != 600 2d01e: 80 91 aa 0d lds r24, 0x0DAA ; 0x800daa <_ZL17mcode_in_progress.lto_priv.493> 2d022: 90 91 ab 0d lds r25, 0x0DAB ; 0x800dab <_ZL17mcode_in_progress.lto_priv.493+0x1> 2d026: 88 35 cpi r24, 0x58 ; 88 2d028: 92 40 sbci r25, 0x02 ; 2 2d02a: 09 f4 brne .+2 ; 0x2d02e 2d02c: 4d c0 rjmp .+154 ; 0x2d0c8 && !saved_printing 2d02e: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 2d032: 81 11 cpse r24, r1 2d034: 49 c0 rjmp .+146 ; 0x2d0c8 && !mesh_bed_leveling_flag 2d036: 80 91 06 12 lds r24, 0x1206 ; 0x801206 2d03a: 81 11 cpse r24, r1 2d03c: 45 c0 rjmp .+138 ; 0x2d0c8 && !homing_flag 2d03e: 80 91 05 12 lds r24, 0x1205 ; 0x801205 2d042: 81 11 cpse r24, r1 2d044: 41 c0 rjmp .+130 ; 0x2d0c8 bool e_active() { unsigned char e_active = 0; block_t *block; if(block_buffer_tail != block_buffer_head) 2d046: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 2d04a: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 2d04e: 98 17 cp r25, r24 2d050: d9 f1 breq .+118 ; 0x2d0c8 { uint8_t block_index = block_buffer_tail; 2d052: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 } #endif bool e_active() { unsigned char e_active = 0; 2d056: 90 e0 ldi r25, 0x00 ; 0 { uint8_t block_index = block_buffer_tail; while(block_index != block_buffer_head) { block = &block_buffer[block_index]; if(block->steps[E_AXIS].wide != 0) e_active++; 2d058: 2e e6 ldi r18, 0x6E ; 110 unsigned char e_active = 0; block_t *block; if(block_buffer_tail != block_buffer_head) { uint8_t block_index = block_buffer_tail; while(block_index != block_buffer_head) 2d05a: 30 91 a8 0d lds r19, 0x0DA8 ; 0x800da8 2d05e: 38 17 cp r19, r24 2d060: 89 f0 breq .+34 ; 0x2d084 { block = &block_buffer[block_index]; if(block->steps[E_AXIS].wide != 0) e_active++; 2d062: 28 9f mul r18, r24 2d064: f0 01 movw r30, r0 2d066: 11 24 eor r1, r1 2d068: e8 53 subi r30, 0x38 ; 56 2d06a: f9 4f sbci r31, 0xF9 ; 249 2d06c: 44 85 ldd r20, Z+12 ; 0x0c 2d06e: 55 85 ldd r21, Z+13 ; 0x0d 2d070: 66 85 ldd r22, Z+14 ; 0x0e 2d072: 77 85 ldd r23, Z+15 ; 0x0f 2d074: 45 2b or r20, r21 2d076: 46 2b or r20, r22 2d078: 47 2b or r20, r23 2d07a: 09 f0 breq .+2 ; 0x2d07e 2d07c: 9f 5f subi r25, 0xFF ; 255 block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1); 2d07e: 8f 5f subi r24, 0xFF ; 255 2d080: 8f 70 andi r24, 0x0F ; 15 2d082: eb cf rjmp .-42 ; 0x2d05a && e_active(); 2d084: 99 23 and r25, r25 2d086: 01 f1 breq .+64 ; 0x2d0c8 SERIAL_ECHOLNPGM("FINDA filament runout!"); 2d088: 83 e6 ldi r24, 0x63 ; 99 2d08a: 9a e9 ldi r25, 0x9A ; 154 2d08c: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 //! //! @param z_move //! @param e_move void stop_and_save_print_to_ram(float z_move, float e_move) { if (saved_printing) return; 2d090: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 2d094: 81 11 cpse r24, r1 2d096: 05 c0 rjmp .+10 ; 0x2d0a2 2d098: 60 e0 ldi r22, 0x00 ; 0 2d09a: 70 e0 ldi r23, 0x00 ; 0 2d09c: cb 01 movw r24, r22 2d09e: 0f 94 f1 41 call 0x283e2 ; 0x283e2 marlin_stop_and_save_print_to_ram(); restore_print_from_ram_and_continue(0); 2d0a2: 60 e0 ldi r22, 0x00 ; 0 2d0a4: 70 e0 ldi r23, 0x00 ; 0 2d0a6: cb 01 movw r24, r22 2d0a8: 0e 94 40 61 call 0xc280 ; 0xc280 2d0ac: 86 ed ldi r24, 0xD6 ; 214 2d0ae: 9e e0 ldi r25, 0x0E ; 14 2d0b0: 0f 94 dc 9f call 0x33fb8 ; 0x33fb8 2d0b4: 81 30 cpi r24, 0x01 ; 1 2d0b6: 21 f4 brne .+8 ; 0x2d0c0 if (SpoolJoin::spooljoin.isSpoolJoinEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN){ // Can't auto if F=? 2d0b8: 0f 94 92 41 call 0x28324 ; 0x28324 2d0bc: 8f 3f cpi r24, 0xFF ; 255 2d0be: 91 f5 brne .+100 ; 0x2d124 enquecommand_front_P(PSTR("M600 AUTO")); // save print and run M600 command } else { enquecommand_front_P(MSG_M600); // save print and run M600 command 2d0c0: 8b e7 ldi r24, 0x7B ; 123 2d0c2: 9b e6 ldi r25, 0x6B ; 107 if (!FindaDetectsFilament() && check_fsensor()) { // Check if we have filament runout detected from sensors SERIAL_ECHOLNPGM("FINDA filament runout!"); marlin_stop_and_save_print_to_ram(); restore_print_from_ram_and_continue(0); if (SpoolJoin::spooljoin.isSpoolJoinEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN){ // Can't auto if F=? enquecommand_front_P(PSTR("M600 AUTO")); // save print and run M600 command 2d0c4: 0f 94 57 43 call 0x286ae ; 0x286ae break; } } } if (logic.Running()) { 2d0c8: 80 91 42 12 lds r24, 0x1242 ; 0x801242 2d0cc: 82 30 cpi r24, 0x02 ; 2 2d0ce: 19 f4 brne .+6 ; 0x2d0d6 state = xState::Active; 2d0d0: 81 e0 ldi r24, 0x01 ; 1 2d0d2: 80 93 94 12 sts 0x1294, r24 ; 0x801294 mmu_loop_inner(true); avoidRecursion = false; } void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) { logicStepLastStatus = LogicStep(reportErrors); // it looks like the mmu_loop doesn't need to be a blocking call 2d0d6: 10 93 93 12 sts 0x1293, r17 ; 0x801293 // UI to resolve the error screen, for example tuning Idler Stallguard Threshold // Set to false to allow the error screen to render again. static bool putErrorScreenToSleep; void CheckErrorScreenUserInput() { if (is_mmu_error_monitor_active) { 2d0da: 80 91 c6 06 lds r24, 0x06C6 ; 0x8006c6 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.452> 2d0de: 88 23 and r24, r24 2d0e0: 51 f0 breq .+20 ; 0x2d0f6 bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 2d0e2: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.458> 2d0e6: 81 11 cpse r24, r1 2d0e8: 06 c0 rjmp .+12 ; 0x2d0f6 2d0ea: 80 91 8c 12 lds r24, 0x128C ; 0x80128c 2d0ee: 90 91 8d 12 lds r25, 0x128D ; 0x80128d 2d0f2: 0f 94 89 88 call 0x31112 ; 0x31112 CheckErrorScreenUserInput(); } 2d0f6: a0 96 adiw r28, 0x20 ; 32 2d0f8: 0f b6 in r0, 0x3f ; 63 2d0fa: f8 94 cli 2d0fc: de bf out 0x3e, r29 ; 62 2d0fe: 0f be out 0x3f, r0 ; 63 2d100: cd bf out 0x3d, r28 ; 61 2d102: df 91 pop r29 2d104: cf 91 pop r28 2d106: 1f 91 pop r17 2d108: 0f 91 pop r16 2d10a: ff 90 pop r15 2d10c: ef 90 pop r14 2d10e: df 90 pop r13 2d110: cf 90 pop r12 2d112: bf 90 pop r11 2d114: af 90 pop r10 2d116: 9f 90 pop r9 2d118: 8f 90 pop r8 2d11a: 7f 90 pop r7 2d11c: 6f 90 pop r6 2d11e: 5f 90 pop r5 2d120: 4f 90 pop r4 2d122: 08 95 ret if (!FindaDetectsFilament() && check_fsensor()) { // Check if we have filament runout detected from sensors SERIAL_ECHOLNPGM("FINDA filament runout!"); marlin_stop_and_save_print_to_ram(); restore_print_from_ram_and_continue(0); if (SpoolJoin::spooljoin.isSpoolJoinEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN){ // Can't auto if F=? enquecommand_front_P(PSTR("M600 AUTO")); // save print and run M600 command 2d124: 89 e5 ldi r24, 0x59 ; 89 2d126: 9a e9 ldi r25, 0x9A ; 154 2d128: cd cf rjmp .-102 ; 0x2d0c4 2d12a: 00 91 67 12 lds r16, 0x1267 ; 0x801267 ReportProgressHook((CommandInProgress)logic.CommandInProgress(), pc); LogEchoEvent_P(_O(ProgressCodeToText(pc))); } void MMU2::OnMMUProgressMsg(ProgressCode pc) { if (pc != lastProgressCode) { 2d12e: 80 91 8b 12 lds r24, 0x128B ; 0x80128b 2d132: 08 17 cp r16, r24 2d134: 09 f4 brne .+2 ; 0x2d138 2d136: 49 c0 rjmp .+146 ; 0x2d1ca // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 2d138: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2d13c: 84 30 cpi r24, 0x04 ; 4 2d13e: b9 f4 brne .+46 ; 0x2d16e break; } } void ReportProgressHook(CommandInProgress cip, ProgressCode ec) { if (cip != CommandInProgress::NoCommand) { 2d140: 80 91 2a 12 lds r24, 0x122A ; 0x80122a 2d144: 88 23 and r24, r24 2d146: 99 f0 breq .+38 ; 0x2d16e custom_message_type = CustomMsg::MMUProgress; 2d148: 89 e0 ldi r24, 0x09 ; 9 2d14a: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 : static_cast(pgm_read_ptr(&progressTexts[0])); 2d14e: ef e1 ldi r30, 0x1F ; 31 2d150: fa e9 ldi r31, 0x9A ; 154 }; const char *ProgressCodeToText(ProgressCode pc) { // @@TODO ?? a better fallback option? return ((uint16_t)pc <= (sizeof(progressTexts) / sizeof(progressTexts[0]))) ? static_cast(pgm_read_ptr(&progressTexts[(uint16_t)pc])) 2d152: 0e 31 cpi r16, 0x1E ; 30 2d154: 30 f4 brcc .+12 ; 0x2d162 2d156: e0 2f mov r30, r16 2d158: f0 e0 ldi r31, 0x00 ; 0 2d15a: ee 0f add r30, r30 2d15c: ff 1f adc r31, r31 2d15e: e1 5e subi r30, 0xE1 ; 225 2d160: f5 46 sbci r31, 0x65 ; 101 : static_cast(pgm_read_ptr(&progressTexts[0])); 2d162: 85 91 lpm r24, Z+ 2d164: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 2d166: 0e 94 b1 6c call 0xd962 ; 0xd962 2d16a: 0e 94 65 e6 call 0x1ccca ; 0x1ccca 2d16e: ef e1 ldi r30, 0x1F ; 31 2d170: fa e9 ldi r31, 0x9A ; 154 }; const char *ProgressCodeToText(ProgressCode pc) { // @@TODO ?? a better fallback option? return ((uint16_t)pc <= (sizeof(progressTexts) / sizeof(progressTexts[0]))) ? static_cast(pgm_read_ptr(&progressTexts[(uint16_t)pc])) 2d172: 0e 31 cpi r16, 0x1E ; 30 2d174: 30 f4 brcc .+12 ; 0x2d182 2d176: e0 2f mov r30, r16 2d178: f0 e0 ldi r31, 0x00 ; 0 2d17a: ee 0f add r30, r30 2d17c: ff 1f adc r31, r31 2d17e: e1 5e subi r30, 0xE1 ; 225 2d180: f5 46 sbci r31, 0x65 ; 101 : static_cast(pgm_read_ptr(&progressTexts[0])); 2d182: 85 91 lpm r24, Z+ 2d184: 94 91 lpm r25, Z "MMU2 logging prefix mismatch, must be updated at various spots"); } void MMU2::ReportProgress(ProgressCode pc) { ReportProgressHook((CommandInProgress)logic.CommandInProgress(), pc); LogEchoEvent_P(_O(ProgressCodeToText(pc))); 2d186: 02 96 adiw r24, 0x02 ; 2 2d188: 0f 94 26 87 call 0x30e4c ; 0x30e4c } } void MMU2::OnMMUProgressMsgChanged(ProgressCode pc) { ReportProgress(pc); lastProgressCode = pc; 2d18c: 00 93 8b 12 sts 0x128B, r16 ; 0x80128b switch (pc) { 2d190: 03 30 cpi r16, 0x03 ; 3 2d192: 49 f0 breq .+18 ; 0x2d1a6 2d194: 0c 31 cpi r16, 0x1C ; 28 2d196: 09 f0 breq .+2 ; 0x2d19a 2d198: 97 cf rjmp .-210 ; 0x2d0c8 2d19a: 0f 94 42 22 call 0x24484 ; 0x24484 } break; case ProgressCode::FeedingToFSensor: // prepare for the movement of the E-motor planner_synchronize(); loadFilamentStarted = true; 2d19e: 81 e0 ldi r24, 0x01 ; 1 2d1a0: 80 93 96 12 sts 0x1296, r24 ; 0x801296 2d1a4: 91 cf rjmp .-222 ; 0x2d0c8 2d1a6: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2d1aa: 84 30 cpi r24, 0x04 ; 4 2d1ac: 31 f4 brne .+12 ; 0x2d1ba ReportProgress(pc); lastProgressCode = pc; switch (pc) { case ProgressCode::UnloadingToFinda: if ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::UnloadFilament || ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::ToolChange)) { 2d1ae: 80 91 2a 12 lds r24, 0x122A ; 0x80122a 2d1b2: 84 55 subi r24, 0x54 ; 84 2d1b4: 82 30 cpi r24, 0x02 ; 2 2d1b6: 08 f4 brcc .+2 ; 0x2d1ba 2d1b8: 87 cf rjmp .-242 ; 0x2d0c8 2d1ba: 0f 94 42 22 call 0x24484 ; 0x24484 // If printing is not in progress, ToolChange will issue a U0 command. break; } else { // We're likely recovering from an MMU error planner_synchronize(); unloadFilamentStarted = true; 2d1be: 81 e0 ldi r24, 0x01 ; 1 2d1c0: 80 93 97 12 sts 0x1297, r24 ; 0x801297 if (unloadFilamentStarted && !planner_any_moves()) { // Only plan a move if there is no move ongoing switch (WhereIsFilament()) { case FilamentState::AT_FSENSOR: case FilamentState::IN_NOZZLE: case FilamentState::UNAVAILABLE: // actually Unavailable makes sense as well to start the E-move to release the filament from the gears HelpUnloadToFinda(); 2d1c4: 0f 94 f5 3e call 0x27dea ; 0x27dea 2d1c8: 7f cf rjmp .-258 ; 0x2d0c8 void __attribute__((noinline)) MMU2::HelpUnloadToFinda() { extruder_move(-MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH, MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE); } void MMU2::OnMMUProgressMsgSame(ProgressCode pc) { switch (pc) { 2d1ca: 03 30 cpi r16, 0x03 ; 3 2d1cc: 71 f1 breq .+92 ; 0x2d22a 2d1ce: 0c 31 cpi r16, 0x1C ; 28 2d1d0: 09 f0 breq .+2 ; 0x2d1d4 2d1d2: 7a cf rjmp .-268 ; 0x2d0c8 unloadFilamentStarted = false; } } break; case ProgressCode::FeedingToFSensor: if (loadFilamentStarted) { 2d1d4: 80 91 96 12 lds r24, 0x1296 ; 0x801296 2d1d8: 88 23 and r24, r24 2d1da: 09 f4 brne .+2 ; 0x2d1de 2d1dc: 75 cf rjmp .-278 ; 0x2d0c8 switch (WhereIsFilament()) { 2d1de: 0f 94 36 87 call 0x30e6c ; 0x30e6c 2d1e2: 88 23 and r24, r24 2d1e4: b1 f1 breq .+108 ; 0x2d252 2d1e6: 81 30 cpi r24, 0x01 ; 1 2d1e8: 09 f0 breq .+2 ; 0x2d1ec 2d1ea: 6e cf rjmp .-292 ; 0x2d0c8 case FilamentState::AT_FSENSOR: // fsensor triggered, finish FeedingToExtruder state loadFilamentStarted = false; 2d1ec: 10 92 96 12 sts 0x1296, r1 ; 0x801296 float move_raise_z(float delta) { return raise_z(delta); } void planner_abort_queued_moves() { planner_abort_hard(); 2d1f0: 0f 94 ea 85 call 0x30bd4 ; 0x30bd4 // Unblock the planner. This should be safe in the // toolchange context. Currently we are mainly aborting // excess E-moves after detecting filament during toolchange. // If a MMU error is reported, the planner must be unblocked // as well so the extruder can be parked safely. planner_aborted = false; 2d1f4: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac planner_abort_queued_moves(); { extruder_move(logic.ExtraLoadDistance() + 2, logic.PulleySlowFeedRate()); 2d1f8: 60 91 72 12 lds r22, 0x1272 ; 0x801272 2d1fc: 70 e0 ldi r23, 0x00 ; 0 2d1fe: 90 e0 ldi r25, 0x00 ; 0 2d200: 80 e0 ldi r24, 0x00 ; 0 2d202: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 2d206: 6b 01 movw r12, r22 2d208: 7c 01 movw r14, r24 2d20a: 60 91 71 12 lds r22, 0x1271 ; 0x801271 2d20e: 70 e0 ldi r23, 0x00 ; 0 2d210: 6e 5f subi r22, 0xFE ; 254 2d212: 7f 4f sbci r23, 0xFF ; 255 2d214: 07 2e mov r0, r23 2d216: 00 0c add r0, r0 2d218: 88 0b sbc r24, r24 2d21a: 99 0b sbc r25, r25 2d21c: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2d220: a7 01 movw r20, r14 2d222: 96 01 movw r18, r12 // Plan a very long move, where 'very long' is hundreds // of millimeters. Keep in mind though the move can't be much longer // than 450mm because the firmware will ignore too long extrusions // for safety reasons. See PREVENT_LENGTHY_EXTRUDE. // Use 350mm to be safely away from the prevention threshold extruder_move(350.0f, logic.PulleySlowFeedRate()); 2d224: 0f 94 02 87 call 0x30e04 ; 0x30e04 2d228: 4f cf rjmp .-354 ; 0x2d0c8 } void MMU2::OnMMUProgressMsgSame(ProgressCode pc) { switch (pc) { case ProgressCode::UnloadingToFinda: if (unloadFilamentStarted && !planner_any_moves()) { // Only plan a move if there is no move ongoing 2d22a: 80 91 97 12 lds r24, 0x1297 ; 0x801297 2d22e: 88 23 and r24, r24 2d230: 09 f4 brne .+2 ; 0x2d234 2d232: 4a cf rjmp .-364 ; 0x2d0c8 return(block); } // Returns true if the buffer has a queued block, false otherwise FORCE_INLINE bool blocks_queued() { return (block_buffer_head != block_buffer_tail); 2d234: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 2d238: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 2d23c: 98 13 cpse r25, r24 2d23e: 44 cf rjmp .-376 ; 0x2d0c8 switch (WhereIsFilament()) { 2d240: 0f 94 36 87 call 0x30e6c ; 0x30e6c 2d244: 81 50 subi r24, 0x01 ; 1 2d246: 83 30 cpi r24, 0x03 ; 3 2d248: 08 f4 brcc .+2 ; 0x2d24c 2d24a: bc cf rjmp .-136 ; 0x2d1c4 case FilamentState::IN_NOZZLE: case FilamentState::UNAVAILABLE: // actually Unavailable makes sense as well to start the E-move to release the filament from the gears HelpUnloadToFinda(); break; default: unloadFilamentStarted = false; 2d24c: 10 92 97 12 sts 0x1297, r1 ; 0x801297 2d250: 3b cf rjmp .-394 ; 0x2d0c8 2d252: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 2d256: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 extruder_move(logic.ExtraLoadDistance() + 2, logic.PulleySlowFeedRate()); } break; case FilamentState::NOT_PRESENT: // fsensor not triggered, continue moving extruder if (!planner_any_moves()) { // Only plan a move if there is no move ongoing 2d25a: 98 13 cpse r25, r24 2d25c: 35 cf rjmp .-406 ; 0x2d0c8 // Plan a very long move, where 'very long' is hundreds // of millimeters. Keep in mind though the move can't be much longer // than 450mm because the firmware will ignore too long extrusions // for safety reasons. See PREVENT_LENGTHY_EXTRUDE. // Use 350mm to be safely away from the prevention threshold extruder_move(350.0f, logic.PulleySlowFeedRate()); 2d25e: 60 91 72 12 lds r22, 0x1272 ; 0x801272 2d262: 70 e0 ldi r23, 0x00 ; 0 2d264: 90 e0 ldi r25, 0x00 ; 0 2d266: 80 e0 ldi r24, 0x00 ; 0 2d268: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 2d26c: 9b 01 movw r18, r22 2d26e: ac 01 movw r20, r24 2d270: 60 e0 ldi r22, 0x00 ; 0 2d272: 70 e0 ldi r23, 0x00 ; 0 2d274: 8f ea ldi r24, 0xAF ; 175 2d276: 93 e4 ldi r25, 0x43 ; 67 2d278: d5 cf rjmp .-86 ; 0x2d224 // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { switch (ss) { 2d27a: 18 30 cpi r17, 0x08 ; 8 2d27c: b9 f0 breq .+46 ; 0x2d2ac 2d27e: 19 30 cpi r17, 0x09 ; 9 2d280: 09 f0 breq .+2 ; 0x2d284 2d282: 22 cf rjmp .-444 ; 0x2d0c8 StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); break; case PrinterError: ReportError(logic.PrinterError(), ErrorSourcePrinter); 2d284: 60 e0 ldi r22, 0x00 ; 0 2d286: 0f 94 aa 4f call 0x29f54 ; 0x29f54 2d28a: 19 e0 ldi r17, 0x09 ; 9 2d28c: 1d cf rjmp .-454 ; 0x2d0c8 default: if (reportErrors) { switch (ss) { case CommandError: ReportError(logic.Error(), ErrorSourceMMU); 2d28e: 61 e0 ldi r22, 0x01 ; 1 2d290: 80 91 65 12 lds r24, 0x1265 ; 0x801265 2d294: 90 91 66 12 lds r25, 0x1266 ; 0x801266 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 2d298: 0f 94 aa 4f call 0x29f54 ; 0x29f54 2d29c: 15 cf rjmp .-470 ; 0x2d0c8 case CommandError: ReportError(logic.Error(), ErrorSourceMMU); break; case CommunicationTimeout: state = xState::Connecting; 2d29e: 82 e0 ldi r24, 0x02 ; 2 2d2a0: 80 93 94 12 sts 0x1294, r24 ; 0x801294 ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); 2d2a4: 60 e0 ldi r22, 0x00 ; 0 2d2a6: 8e e2 ldi r24, 0x2E ; 46 2d2a8: 90 e8 ldi r25, 0x80 ; 128 2d2aa: f6 cf rjmp .-20 ; 0x2d298 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 2d2ac: 10 92 94 12 sts 0x1294, r1 ; 0x801294 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 2d2b0: 10 92 42 12 sts 0x1242, r1 ; 0x801242 currentScope = Scope::Stopped; 2d2b4: 10 92 27 12 sts 0x1227, r1 ; 0x801227 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 2d2b8: 60 e0 ldi r22, 0x00 ; 0 2d2ba: 8c e2 ldi r24, 0x2C ; 44 2d2bc: 90 e8 ldi r25, 0x80 ; 128 2d2be: ec cf rjmp .-40 ; 0x2d298 break; } } [[fallthrough]]; // otherwise default: RecordUARTActivity(); // something has happened on the UART, update the timeout record 2d2c0: 0f 94 1c 3b call 0x27638 ; 0x27638 2d2c4: a8 cd rjmp .-1200 ; 0x2ce16 case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 2d2c6: 00 23 and r16, r16 2d2c8: 01 f3 breq .-64 ; 0x2d28a 2d2ca: dc cf rjmp .-72 ; 0x2d284 0002d2cc : } } } void MMU2::ResumeHotendTemp() { if ((mmu_print_saved & SavedState::CooldownPending)) { 2d2cc: 80 91 95 12 lds r24, 0x1295 ; 0x801295 2d2d0: 82 ff sbrs r24, 2 2d2d2: 07 c0 rjmp .+14 ; 0x2d2e2 // Clear the "pending" flag if we haven't cooled yet. mmu_print_saved &= ~(SavedState::CooldownPending); 2d2d4: 8b 7f andi r24, 0xFB ; 251 2d2d6: 80 93 95 12 sts 0x1295, r24 ; 0x801295 LogEchoEvent_P(PSTR("Cooldown flag cleared")); 2d2da: 80 ec ldi r24, 0xC0 ; 192 2d2dc: 9b e9 ldi r25, 0x9B ; 155 2d2de: 0f 94 26 87 call 0x30e4c ; 0x30e4c } if ((mmu_print_saved & SavedState::Cooldown) && resume_hotend_temp) { 2d2e2: 80 91 95 12 lds r24, 0x1295 ; 0x801295 2d2e6: 81 ff sbrs r24, 1 2d2e8: 52 c0 rjmp .+164 ; 0x2d38e 2d2ea: 80 91 89 12 lds r24, 0x1289 ; 0x801289 2d2ee: 90 91 8a 12 lds r25, 0x128A ; 0x80128a 2d2f2: 89 2b or r24, r25 2d2f4: 09 f4 brne .+2 ; 0x2d2f8 2d2f6: 4b c0 rjmp .+150 ; 0x2d38e LogEchoEvent_P(PSTR("Resuming Temp")); 2d2f8: 82 eb ldi r24, 0xB2 ; 178 2d2fa: 9b e9 ldi r25, 0x9B ; 155 2d2fc: 0f 94 26 87 call 0x30e4c ; 0x30e4c // @@TODO MMU2_ECHO_MSGRPGM(PSTR("Restoring hotend temperature ")); SERIAL_ECHOLN(resume_hotend_temp); 2d300: 80 91 89 12 lds r24, 0x1289 ; 0x801289 2d304: 90 91 8a 12 lds r25, 0x128A ; 0x80128a 2d308: 0f 94 aa 41 call 0x28354 ; 0x28354 mmu_print_saved &= ~(SavedState::Cooldown); 2d30c: 80 91 95 12 lds r24, 0x1295 ; 0x801295 2d310: 8d 7f andi r24, 0xFD ; 253 2d312: 80 93 95 12 sts 0x1295, r24 ; 0x801295 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2d316: 80 91 89 12 lds r24, 0x1289 ; 0x801289 2d31a: 90 91 8a 12 lds r25, 0x128A ; 0x80128a 2d31e: 90 93 f2 11 sts 0x11F2, r25 ; 0x8011f2 2d322: 80 93 f1 11 sts 0x11F1, r24 ; 0x8011f1 void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); } void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); 2d326: 85 e1 ldi r24, 0x15 ; 21 2d328: 9a e5 ldi r25, 0x5A ; 90 2d32a: 0e 94 b1 6c call 0xd962 ; 0xd962 2d32e: 0f 94 c0 0a call 0x21580 ; 0x21580 lcd_show_choices_prompt_P(two_choices ? LCD_LEFT_BUTTON_CHOICE : LCD_MIDDLE_BUTTON_CHOICE, _T(PrusaErrorButtonTitle(button_op_middle)), two_choices ? PrusaErrorButtonMore() : _T(PrusaErrorButtonTitle(button_op_right)), two_choices ? 18 : 9, two_choices ? nullptr : PrusaErrorButtonMore()); } void ReportErrorHookSensorLineRender(){ // Render static characters in third line lcd_puts_at_P(0, 2, PSTR("FI: FS: > " LCD_STR_THERMOMETER " " LCD_STR_DEGREE)); 2d332: 42 e8 ldi r20, 0x82 ; 130 2d334: 5b e9 ldi r21, 0x9B ; 155 2d336: 62 e0 ldi r22, 0x02 ; 2 2d338: 80 e0 ldi r24, 0x00 ; 0 2d33a: 0e 94 8f 69 call 0xd31e ; 0xd31e int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 2d33e: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 2d342: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 2d346: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 2d34a: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 2d34e: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 2d352: 20 91 f1 11 lds r18, 0x11F1 ; 0x8011f1 2d356: 30 91 f2 11 lds r19, 0x11F2 ; 0x8011f2 2d35a: c9 01 movw r24, r18 2d35c: 86 1b sub r24, r22 2d35e: 97 0b sbc r25, r23 2d360: 06 97 sbiw r24, 0x06 ; 6 2d362: 6c f0 brlt .+26 ; 0x2d37e void marlin_manage_heater() { manage_heater(); } void marlin_manage_inactivity(bool ignore_stepper_queue) { manage_inactivity(ignore_stepper_queue); 2d364: 81 e0 ldi r24, 0x01 ; 1 2d366: 0e 94 01 7a call 0xf402 ; 0xf402 FullScreenMsgRestoringTemperature(); //@todo better report the event and let the GUI do its work somewhere else ReportErrorHookSensorLineRender(); waitForHotendTargetTemp(100, [] { marlin_manage_inactivity(true); mmu2.mmu_loop_inner(false); 2d36a: 80 e0 ldi r24, 0x00 ; 0 2d36c: 0f 94 52 64 call 0x2c8a4 ; 0x2c8a4 ReportErrorHookDynamicRender(); 2d370: 0f 94 5f 86 call 0x30cbe ; 0x30cbe void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 2d374: 84 e6 ldi r24, 0x64 ; 100 2d376: 90 e0 ldi r25, 0x00 ; 0 2d378: 0e 94 48 7c call 0xf890 ; 0xf890 2d37c: e0 cf rjmp .-64 ; 0x2d33e }); ScreenUpdateEnable(); // temporary hack to stop this locking the printer... 2d37e: 0f 94 35 86 call 0x30c6a ; 0x30c6a LogEchoEvent_P(PSTR("Hotend temperature reached")); 2d382: 87 e9 ldi r24, 0x97 ; 151 2d384: 9b e9 ldi r25, 0x9B ; 155 2d386: 0f 94 26 87 call 0x30e4c ; 0x30e4c void ScreenUpdateEnable(){ lcd_update_enable(true); } void ScreenClear(){ lcd_clear(); 2d38a: 0c 94 ae 69 jmp 0xd35c ; 0xd35c ScreenClear(); } } 2d38e: 08 95 ret 0002d390 : /// just to verify the result of an issued command (which was basically the original idea) /// /// It is closely related to mmu_loop() (which corresponds to our ProtocolLogic::Step()), which does NOT perform any blocking wait for a command to finish. /// But - in case of an error, the command is not yet finished, but we must react accordingly - move the printhead elsewhere, stop heating, eat a cat or so. /// That's what's being done here... bool MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) { 2d390: 0f 93 push r16 2d392: 1f 93 push r17 2d394: cf 93 push r28 2d396: df 93 push r29 2d398: 00 d0 rcall .+0 ; 0x2d39a 2d39a: 1f 92 push r1 2d39c: 1f 92 push r1 2d39e: cd b7 in r28, 0x3d ; 61 2d3a0: de b7 in r29, 0x3e ; 62 2d3a2: 18 2f mov r17, r24 2d3a4: 06 2f mov r16, r22 mmu_print_saved = SavedState::None; 2d3a6: 10 92 95 12 sts 0x1295, r1 ; 0x801295 MARLIN_KEEPALIVE_STATE_IN_PROCESS; 2d3aa: 83 e0 ldi r24, 0x03 ; 3 2d3ac: 80 93 78 02 sts 0x0278, r24 ; 0x800278 LongTimer nozzleTimeout; 2d3b0: 19 82 std Y+1, r1 ; 0x01 2d3b2: 1a 82 std Y+2, r1 ; 0x02 2d3b4: 1b 82 std Y+3, r1 ; 0x03 2d3b6: 1c 82 std Y+4, r1 ; 0x04 2d3b8: 1d 82 std Y+5, r1 ; 0x05 2d3ba: 90 e0 ldi r25, 0x00 ; 0 2d3bc: 80 e0 ldi r24, 0x00 ; 0 2d3be: 0e 94 48 7c call 0xf890 ; 0xf890 // - failed -> then do the safety moves on the printer like before // - finished ok -> proceed with reading other commands safe_delay_keep_alive(0); // calls LogicStep() and remembers its return status // also disables stepper motor unlocking if (mmu_print_saved & SavedState::CooldownPending) { 2d3c2: 90 91 95 12 lds r25, 0x1295 ; 0x801295 2d3c6: 89 81 ldd r24, Y+1 ; 0x01 2d3c8: 92 ff sbrs r25, 2 2d3ca: 37 c0 rjmp .+110 ; 0x2d43a if (!nozzleTimeout.running()) { 2d3cc: 81 11 cpse r24, r1 2d3ce: 1e c0 rjmp .+60 ; 0x2d40c nozzleTimeout.start(); 2d3d0: ce 01 movw r24, r28 2d3d2: 01 96 adiw r24, 0x01 ; 1 2d3d4: 0f 94 a1 11 call 0x22342 ; 0x22342 ::start()> LogEchoEvent_P(PSTR("Cooling Timeout started")); 2d3d8: 89 ea ldi r24, 0xA9 ; 169 2d3da: 99 e9 ldi r25, 0x99 ; 153 thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); } } else if (nozzleTimeout.running()) { nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 2d3dc: 0f 94 26 87 call 0x30e4c ; 0x30e4c } switch (logicStepLastStatus) { 2d3e0: e0 91 93 12 lds r30, 0x1293 ; 0x801293 2d3e4: e2 50 subi r30, 0x02 ; 2 2d3e6: ea 30 cpi r30, 0x0A ; 10 2d3e8: 40 f7 brcc .-48 ; 0x2d3ba 2d3ea: f0 e0 ldi r31, 0x00 ; 0 2d3ec: 88 27 eor r24, r24 2d3ee: e4 50 subi r30, 0x04 ; 4 2d3f0: f6 49 sbci r31, 0x96 ; 150 2d3f2: 8e 4f sbci r24, 0xFE ; 254 2d3f4: 0d 94 ec a0 jmp 0x341d8 ; 0x341d8 <__tablejump2__> 2d3f8: 47 38 cpi r20, 0x87 ; 135 2d3fa: 55 38 cpi r21, 0x85 ; 133 2d3fc: 83 38 cpi r24, 0x83 ; 131 2d3fe: 83 38 cpi r24, 0x83 ; 131 2d400: 87 37 cpi r24, 0x77 ; 119 2d402: 83 38 cpi r24, 0x83 ; 131 2d404: 1d 37 cpi r17, 0x7D ; 125 2d406: 63 37 cpi r22, 0x73 ; 115 2d408: 2f 38 cpi r18, 0x8F ; 143 2d40a: 83 38 cpi r24, 0x83 ; 131 if (mmu_print_saved & SavedState::CooldownPending) { if (!nozzleTimeout.running()) { nozzleTimeout.start(); LogEchoEvent_P(PSTR("Cooling Timeout started")); } else if (nozzleTimeout.expired(DEFAULT_SAFETYTIMER_TIME_MINS * 60 * 1000ul)) { // mins->msec. 2d40c: 40 e4 ldi r20, 0x40 ; 64 2d40e: 57 e7 ldi r21, 0x77 ; 119 2d410: 6b e1 ldi r22, 0x1B ; 27 2d412: 70 e0 ldi r23, 0x00 ; 0 2d414: ce 01 movw r24, r28 2d416: 01 96 adiw r24, 0x01 ; 1 2d418: 0f 94 e2 0f call 0x21fc4 ; 0x21fc4 ::expired(unsigned long)> 2d41c: 88 23 and r24, r24 2d41e: 01 f3 breq .-64 ; 0x2d3e0 mmu_print_saved &= ~(SavedState::CooldownPending); 2d420: 80 91 95 12 lds r24, 0x1295 ; 0x801295 2d424: 8b 7f andi r24, 0xFB ; 251 mmu_print_saved |= SavedState::Cooldown; 2d426: 82 60 ori r24, 0x02 ; 2 2d428: 80 93 95 12 sts 0x1295, r24 ; 0x801295 2d42c: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 2d430: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); 2d434: 89 e9 ldi r24, 0x99 ; 153 2d436: 99 e9 ldi r25, 0x99 ; 153 2d438: d1 cf rjmp .-94 ; 0x2d3dc } } else if (nozzleTimeout.running()) { 2d43a: 88 23 and r24, r24 2d43c: 89 f2 breq .-94 ; 0x2d3e0 2d43e: 19 82 std Y+1, r1 ; 0x01 nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 2d440: 83 e8 ldi r24, 0x83 ; 131 2d442: 99 e9 ldi r25, 0x99 ; 153 2d444: cb cf rjmp .-106 ; 0x2d3dc switch (logicStepLastStatus) { case Finished: // command/operation completed, let Marlin continue its work // the E may have some more moves to finish - wait for them ResumeHotendTemp(); 2d446: 0f 94 66 69 call 0x2d2cc ; 0x2d2cc ResumeUnpark(); // We can now travel back to the tower or wherever we were when we saved. 2d44a: 0f 94 1b 3f call 0x27e36 ; 0x27e36 if (!TuneMenuEntered()) { 2d44e: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.458> 2d452: 81 11 cpse r24, r1 2d454: 07 c0 rjmp .+14 ; 0x2d464 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 2d456: 8f e6 ldi r24, 0x6F ; 111 2d458: 9b e9 ldi r25, 0x9B ; 155 2d45a: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 retryAttempts = MAX_RETRIES; 2d45e: 83 e0 ldi r24, 0x03 ; 3 2d460: 80 93 79 12 sts 0x1279, r24 ; 0x801279 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2d464: 0f 94 42 22 call 0x24484 ; 0x24484 case Interrupted: // now what :D ... big bad ... ramming, unload, retry the whole command originally issued return false; case VersionMismatch: // this basically means the MMU will be disabled until reconnected CheckUserInput(); return true; 2d468: 81 e0 ldi r24, 0x01 ; 1 case Processing: // wait for the MMU to respond default: break; } } } 2d46a: 0f 90 pop r0 2d46c: 0f 90 pop r0 2d46e: 0f 90 pop r0 2d470: 0f 90 pop r0 2d472: 0f 90 pop r0 2d474: df 91 pop r29 2d476: cf 91 pop r28 2d478: 1f 91 pop r17 2d47a: 0f 91 pop r16 2d47c: 08 95 ret return true; case Interrupted: // now what :D ... big bad ... ramming, unload, retry the whole command originally issued return false; case VersionMismatch: // this basically means the MMU will be disabled until reconnected CheckUserInput(); 2d47e: 0f 94 98 63 call 0x2c730 ; 0x2c730 2d482: f2 cf rjmp .-28 ; 0x2d468 break; case CommandError: case CommunicationTimeout: case ProtocolError: case ButtonPushed: if (!logic.InAutoRetry()) { 2d484: 80 91 7a 12 lds r24, 0x127A ; 0x80127a 2d488: 81 11 cpse r24, r1 2d48a: 97 cf rjmp .-210 ; 0x2d3ba // Don't proceed to the park/save if we are doing an autoretry. SaveAndPark(move_axes); 2d48c: 81 2f mov r24, r17 2d48e: 0f 94 65 3f call 0x27eca ; 0x27eca SaveHotendTemp(turn_off_nozzle); 2d492: 80 2f mov r24, r16 2d494: 0f 94 ff 3e call 0x27dfe ; 0x27dfe CheckUserInput(); 2d498: 0f 94 98 63 call 0x2c730 ; 0x2c730 2d49c: 8e cf rjmp .-228 ; 0x2d3ba } break; case CommunicationRecovered: // @@TODO communication recovered and may be an error recovered as well // may be the logic layer can detect the change of state a respond with one "Recovered" to be handled here ResumeHotendTemp(); 2d49e: 0f 94 66 69 call 0x2d2cc ; 0x2d2cc ResumeUnpark(); 2d4a2: 0f 94 1b 3f call 0x27e36 ; 0x27e36 2d4a6: 89 cf rjmp .-238 ; 0x2d3ba } planner_synchronize(); return true; case Interrupted: // now what :D ... big bad ... ramming, unload, retry the whole command originally issued return false; 2d4a8: 80 e0 ldi r24, 0x00 ; 0 2d4aa: df cf rjmp .-66 ; 0x2d46a 0002d4ac : } // true, true); -- Comment: how is it possible for a filament type set to fail? return true; } void MMU2::UnloadInner() { 2d4ac: cf 93 push r28 2d4ae: df 93 push r29 2d4b0: 00 d0 rcall .+0 ; 0x2d4b2 2d4b2: 1f 92 push r1 2d4b4: 1f 92 push r1 2d4b6: cd b7 in r28, 0x3d ; 61 2d4b8: de b7 in r29, 0x3e ; 62 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 2d4ba: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 2d4be: 10 92 85 16 sts 0x1685, r1 ; 0x801685 return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 2d4c2: 62 e1 ldi r22, 0x12 ; 18 2d4c4: 83 ef ldi r24, 0xF3 ; 243 2d4c6: 98 e9 ldi r25, 0x98 ; 152 2d4c8: 0f 94 8b 53 call 0x2a716 ; 0x2a716 filament_ramming(); // we assume the printer managed to relieve filament tip from the gears, // so repeating that part in case of an MMU restart is not necessary for (;;) { Disable_E0(); 2d4cc: 0f 94 00 87 call 0x30e00 ; 0x30e00 void ProtocolLogic::Statistics() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Version, 3)); } void ProtocolLogic::UnloadFilament() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Unload, 0)); 2d4d0: 40 e0 ldi r20, 0x00 ; 0 2d4d2: 65 e5 ldi r22, 0x55 ; 85 2d4d4: ce 01 movw r24, r28 2d4d6: 01 96 adiw r24, 0x01 ; 1 2d4d8: 0f 94 f3 86 call 0x30de6 ; 0x30de6 2d4dc: 49 81 ldd r20, Y+1 ; 0x01 2d4de: 5a 81 ldd r21, Y+2 ; 0x02 2d4e0: 6b 81 ldd r22, Y+3 ; 0x03 2d4e2: 7c 81 ldd r23, Y+4 ; 0x04 2d4e4: 8d 81 ldd r24, Y+5 ; 0x05 2d4e6: 0f 94 33 62 call 0x2c466 ; 0x2c466 logic.UnloadFilament(); if (manage_response(false, true)) { 2d4ea: 61 e0 ldi r22, 0x01 ; 1 2d4ec: 80 e0 ldi r24, 0x00 ; 0 2d4ee: 0f 94 c8 69 call 0x2d390 ; 0x2d390 2d4f2: 81 11 cpse r24, r1 2d4f4: 03 c0 rjmp .+6 ; 0x2d4fc break; } IncrementMMUFails(); 2d4f6: 0f 94 57 86 call 0x30cae ; 0x30cae 2d4fa: e8 cf rjmp .-48 ; 0x2d4cc bool cutter_enabled(){ return eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) == EEPROM_MMU_CUTTER_ENABLED_enabled; } void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); 2d4fc: 83 e0 ldi r24, 0x03 ; 3 2d4fe: 0f 94 9f 2c call 0x2593e ; 0x2593e } MakeSound(Confirm); // no active tool SetCurrentTool(MMU2_NO_TOOL); 2d502: 83 e6 ldi r24, 0x63 ; 99 2d504: 0f 94 b2 41 call 0x28364 ; 0x28364 tool_change_extruder = MMU2_NO_TOOL; 2d508: 83 e6 ldi r24, 0x63 ; 99 2d50a: 80 93 7c 12 sts 0x127C, r24 ; 0x80127c #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 2d50e: 84 e8 ldi r24, 0x84 ; 132 2d510: 96 e1 ldi r25, 0x16 ; 22 2d512: 0e 94 f0 6d call 0xdbe0 ; 0xdbe0 } 2d516: 0f 90 pop r0 2d518: 0f 90 pop r0 2d51a: 0f 90 pop r0 2d51c: 0f 90 pop r0 2d51e: 0f 90 pop r0 2d520: df 91 pop r29 2d522: cf 91 pop r28 2d524: 08 95 ret 0002d526 : bool MMU2::unload() { 2d526: cf 93 push r28 if (!WaitForMMUReady()) { 2d528: 0f 94 b4 53 call 0x2a768 ; 0x2a768 2d52c: c8 2f mov r28, r24 2d52e: 88 23 and r24, r24 2d530: 79 f0 breq .+30 ; 0x2d550 safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 2d532: 88 ec ldi r24, 0xC8 ; 200 2d534: 90 e0 ldi r25, 0x00 ; 0 2d536: 0f 94 7f 8a call 0x314fe ; 0x314fe (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.356]> 2d53a: 82 e0 ldi r24, 0x02 ; 2 2d53c: 0f 94 9f 2c call 0x2593e ; 0x2593e struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 2d540: 0f 94 80 53 call 0x2a700 ; 0x2a700 WaitForHotendTargetTempBeep(); { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); 2d544: 0f 94 56 6a call 0x2d4ac ; 0x2d4ac explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 2d548: 0f 94 a9 53 call 0x2a752 ; 0x2a752 { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); } ScreenUpdateEnable(); 2d54c: 0f 94 35 86 call 0x30c6a ; 0x30c6a return true; } 2d550: 8c 2f mov r24, r28 2d552: cf 91 pop r28 2d554: 08 95 ret 0002d556 : unload(); ScreenUpdateEnable(); return true; } bool MMU2::load_filament(uint8_t slot) { 2d556: 0f 93 push r16 2d558: 1f 93 push r17 2d55a: cf 93 push r28 2d55c: df 93 push r29 2d55e: 00 d0 rcall .+0 ; 0x2d560 2d560: 1f 92 push r1 2d562: 1f 92 push r1 2d564: cd b7 in r28, 0x3d ; 61 2d566: de b7 in r29, 0x3e ; 62 2d568: 08 2f mov r16, r24 if (!WaitForMMUReady()) { 2d56a: 0f 94 b4 53 call 0x2a768 ; 0x2a768 2d56e: 18 2f mov r17, r24 2d570: 88 23 and r24, r24 2d572: 49 f1 breq .+82 ; 0x2d5c6 void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 2d574: 82 e0 ldi r24, 0x02 ; 2 2d576: 9a e5 ldi r25, 0x5A ; 90 2d578: 0e 94 b1 6c call 0xd962 ; 0xd962 2d57c: 60 2f mov r22, r16 2d57e: 0f 94 38 86 call 0x30c70 ; 0x30c70 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 2d582: 0f 94 80 53 call 0x2a700 ; 0x2a700 FullScreenMsgLoad(slot); { ReportingRAII rep(CommandInProgress::LoadFilament); for (;;) { Disable_E0(); 2d586: 0f 94 00 87 call 0x30e00 ; 0x30e00 } void ProtocolLogic::LoadFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Load, slot)); 2d58a: 40 2f mov r20, r16 2d58c: 6c e4 ldi r22, 0x4C ; 76 2d58e: ce 01 movw r24, r28 2d590: 01 96 adiw r24, 0x01 ; 1 2d592: 0f 94 f3 86 call 0x30de6 ; 0x30de6 2d596: 49 81 ldd r20, Y+1 ; 0x01 2d598: 5a 81 ldd r21, Y+2 ; 0x02 2d59a: 6b 81 ldd r22, Y+3 ; 0x03 2d59c: 7c 81 ldd r23, Y+4 ; 0x04 2d59e: 8d 81 ldd r24, Y+5 ; 0x05 2d5a0: 0f 94 33 62 call 0x2c466 ; 0x2c466 logic.LoadFilament(slot); if (manage_response(false, false)) { 2d5a4: 60 e0 ldi r22, 0x00 ; 0 2d5a6: 80 e0 ldi r24, 0x00 ; 0 2d5a8: 0f 94 c8 69 call 0x2d390 ; 0x2d390 2d5ac: 18 2f mov r17, r24 2d5ae: 81 11 cpse r24, r1 2d5b0: 03 c0 rjmp .+6 ; 0x2d5b8 break; } IncrementMMUFails(); 2d5b2: 0f 94 57 86 call 0x30cae ; 0x30cae 2d5b6: e7 cf rjmp .-50 ; 0x2d586 bool cutter_enabled(){ return eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) == EEPROM_MMU_CUTTER_ENABLED_enabled; } void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); 2d5b8: 83 e0 ldi r24, 0x03 ; 3 2d5ba: 0f 94 9f 2c call 0x2593e ; 0x2593e explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 2d5be: 0f 94 a9 53 call 0x2a752 ; 0x2a752 } IncrementMMUFails(); } MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 2d5c2: 0f 94 35 86 call 0x30c6a ; 0x30c6a return true; } 2d5c6: 81 2f mov r24, r17 2d5c8: 0f 90 pop r0 2d5ca: 0f 90 pop r0 2d5cc: 0f 90 pop r0 2d5ce: 0f 90 pop r0 2d5d0: 0f 90 pop r0 2d5d2: df 91 pop r29 2d5d4: cf 91 pop r28 2d5d6: 1f 91 pop r17 2d5d8: 0f 91 pop r16 2d5da: 08 95 ret 0002d5dc : } ScreenUpdateEnable(); return true; } bool MMU2::eject_filament(uint8_t slot, bool enableFullScreenMsg /* = true */) { 2d5dc: ff 92 push r15 2d5de: 0f 93 push r16 2d5e0: 1f 93 push r17 2d5e2: cf 93 push r28 2d5e4: df 93 push r29 2d5e6: 00 d0 rcall .+0 ; 0x2d5e8 2d5e8: 1f 92 push r1 2d5ea: 1f 92 push r1 2d5ec: cd b7 in r28, 0x3d ; 61 2d5ee: de b7 in r29, 0x3e ; 62 2d5f0: 08 2f mov r16, r24 2d5f2: f6 2e mov r15, r22 if (!WaitForMMUReady()) { 2d5f4: 0f 94 b4 53 call 0x2a768 ; 0x2a768 2d5f8: 18 2f mov r17, r24 2d5fa: 88 23 and r24, r24 2d5fc: b1 f1 breq .+108 ; 0x2d66a return false; } if (enableFullScreenMsg) { 2d5fe: ff 20 and r15, r15 2d600: 39 f0 breq .+14 ; 0x2d610 void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); } void FullScreenMsgEject(uint8_t slot){ FullScreenMsg(_T(MSG_EJECT_FROM_MMU), slot); 2d602: 81 ef ldi r24, 0xF1 ; 241 2d604: 99 e5 ldi r25, 0x59 ; 89 2d606: 0e 94 b1 6c call 0xd962 ; 0xd962 2d60a: 60 2f mov r22, r16 2d60c: 0f 94 38 86 call 0x30c70 ; 0x30c70 FullScreenMsgEject(slot); } { if (FindaDetectsFilament()) { 2d610: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 2d614: 81 11 cpse r24, r1 unload(); 2d616: 0f 94 93 6a call 0x2d526 ; 0x2d526 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 2d61a: 0f 94 80 53 call 0x2a700 ; 0x2a700 unload(); } ReportingRAII rep(CommandInProgress::EjectFilament); for (;;) { Disable_E0(); 2d61e: 0f 94 00 87 call 0x30e00 ; 0x30e00 } void ProtocolLogic::EjectFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Eject, slot)); 2d622: 40 2f mov r20, r16 2d624: 65 e4 ldi r22, 0x45 ; 69 2d626: ce 01 movw r24, r28 2d628: 01 96 adiw r24, 0x01 ; 1 2d62a: 0f 94 f3 86 call 0x30de6 ; 0x30de6 2d62e: 49 81 ldd r20, Y+1 ; 0x01 2d630: 5a 81 ldd r21, Y+2 ; 0x02 2d632: 6b 81 ldd r22, Y+3 ; 0x03 2d634: 7c 81 ldd r23, Y+4 ; 0x04 2d636: 8d 81 ldd r24, Y+5 ; 0x05 2d638: 0f 94 33 62 call 0x2c466 ; 0x2c466 logic.EjectFilament(slot); if (manage_response(false, true)) { 2d63c: 61 e0 ldi r22, 0x01 ; 1 2d63e: 80 e0 ldi r24, 0x00 ; 0 2d640: 0f 94 c8 69 call 0x2d390 ; 0x2d390 2d644: 18 2f mov r17, r24 2d646: 81 11 cpse r24, r1 2d648: 03 c0 rjmp .+6 ; 0x2d650 break; } IncrementMMUFails(); 2d64a: 0f 94 57 86 call 0x30cae ; 0x30cae 2d64e: e7 cf rjmp .-50 ; 0x2d61e } SetCurrentTool(MMU2_NO_TOOL); 2d650: 83 e6 ldi r24, 0x63 ; 99 2d652: 0f 94 b2 41 call 0x28364 ; 0x28364 tool_change_extruder = MMU2_NO_TOOL; 2d656: 83 e6 ldi r24, 0x63 ; 99 2d658: 80 93 7c 12 sts 0x127C, r24 ; 0x80127c bool cutter_enabled(){ return eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) == EEPROM_MMU_CUTTER_ENABLED_enabled; } void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); 2d65c: 83 e0 ldi r24, 0x03 ; 3 2d65e: 0f 94 9f 2c call 0x2593e ; 0x2593e explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 2d662: 0f 94 a9 53 call 0x2a752 ; 0x2a752 } SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(Confirm); } ScreenUpdateEnable(); 2d666: 0f 94 35 86 call 0x30c6a ; 0x30c6a return true; } 2d66a: 81 2f mov r24, r17 2d66c: 0f 90 pop r0 2d66e: 0f 90 pop r0 2d670: 0f 90 pop r0 2d672: 0f 90 pop r0 2d674: 0f 90 pop r0 2d676: df 91 pop r29 2d678: cf 91 pop r28 2d67a: 1f 91 pop r17 2d67c: 0f 91 pop r16 2d67e: ff 90 pop r15 2d680: 08 95 ret 0002d682 : ScreenUpdateEnable(); return true; } void MMU2::CutFilamentInner(uint8_t slot) { 2d682: 1f 93 push r17 2d684: cf 93 push r28 2d686: df 93 push r29 2d688: 00 d0 rcall .+0 ; 0x2d68a 2d68a: 1f 92 push r1 2d68c: 1f 92 push r1 2d68e: cd b7 in r28, 0x3d ; 61 2d690: de b7 in r29, 0x3e ; 62 2d692: 18 2f mov r17, r24 for (;;) { Disable_E0(); 2d694: 0f 94 00 87 call 0x30e00 ; 0x30e00 } void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); 2d698: 41 2f mov r20, r17 2d69a: 6b e4 ldi r22, 0x4B ; 75 2d69c: ce 01 movw r24, r28 2d69e: 01 96 adiw r24, 0x01 ; 1 2d6a0: 0f 94 f3 86 call 0x30de6 ; 0x30de6 2d6a4: 49 81 ldd r20, Y+1 ; 0x01 2d6a6: 5a 81 ldd r21, Y+2 ; 0x02 2d6a8: 6b 81 ldd r22, Y+3 ; 0x03 2d6aa: 7c 81 ldd r23, Y+4 ; 0x04 2d6ac: 8d 81 ldd r24, Y+5 ; 0x05 2d6ae: 0f 94 33 62 call 0x2c466 ; 0x2c466 logic.CutFilament(slot); if (manage_response(false, true)) { 2d6b2: 61 e0 ldi r22, 0x01 ; 1 2d6b4: 80 e0 ldi r24, 0x00 ; 0 2d6b6: 0f 94 c8 69 call 0x2d390 ; 0x2d390 2d6ba: 81 11 cpse r24, r1 2d6bc: 03 c0 rjmp .+6 ; 0x2d6c4 break; } IncrementMMUFails(); 2d6be: 0f 94 57 86 call 0x30cae ; 0x30cae 2d6c2: e8 cf rjmp .-48 ; 0x2d694 } } 2d6c4: 0f 90 pop r0 2d6c6: 0f 90 pop r0 2d6c8: 0f 90 pop r0 2d6ca: 0f 90 pop r0 2d6cc: 0f 90 pop r0 2d6ce: df 91 pop r29 2d6d0: cf 91 pop r28 2d6d2: 1f 91 pop r17 2d6d4: 08 95 ret 0002d6d6 : bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { 2d6d6: cf 93 push r28 2d6d8: c8 2f mov r28, r24 lcd_print(' '); lcd_print(slot + 1); } void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); 2d6da: 82 ee ldi r24, 0xE2 ; 226 2d6dc: 99 e5 ldi r25, 0x59 ; 89 2d6de: 0e 94 b1 6c call 0xd962 ; 0xd962 2d6e2: 6c 2f mov r22, r28 2d6e4: 0f 94 38 86 call 0x30c70 ; 0x30c70 if (enableFullScreenMsg) { FullScreenMsgCut(slot); } { if (FindaDetectsFilament()) { 2d6e8: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 2d6ec: 81 11 cpse r24, r1 unload(); 2d6ee: 0f 94 93 6a call 0x2d526 ; 0x2d526 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 2d6f2: 0f 94 80 53 call 0x2a700 ; 0x2a700 if (FindaDetectsFilament()) { unload(); } ReportingRAII rep(CommandInProgress::CutFilament); CutFilamentInner(slot); 2d6f6: 8c 2f mov r24, r28 2d6f8: 0f 94 41 6b call 0x2d682 ; 0x2d682 SetCurrentTool(MMU2_NO_TOOL); 2d6fc: 83 e6 ldi r24, 0x63 ; 99 2d6fe: 0f 94 b2 41 call 0x28364 ; 0x28364 tool_change_extruder = MMU2_NO_TOOL; 2d702: 83 e6 ldi r24, 0x63 ; 99 2d704: 80 93 7c 12 sts 0x127C, r24 ; 0x80127c bool cutter_enabled(){ return eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) == EEPROM_MMU_CUTTER_ENABLED_enabled; } void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); 2d708: 83 e0 ldi r24, 0x03 ; 3 2d70a: 0f 94 9f 2c call 0x2593e ; 0x2593e explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 2d70e: 0f 94 a9 53 call 0x2a752 ; 0x2a752 CutFilamentInner(slot); SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 2d712: 0f 94 35 86 call 0x30c6a ; 0x30c6a return true; } 2d716: 81 e0 ldi r24, 0x01 ; 1 2d718: cf 91 pop r28 2d71a: 08 95 ret 0002d71c : /// Compute/update CRC8 CCIIT from 8bits. /// Details: https://www.nongnu.org/avr-libc/user-manual/group__util__crc.html static uint8_t CCITT_update(uint8_t crc, uint8_t b); static constexpr uint8_t CCITT_updateCX(uint8_t crc, uint8_t b) { uint8_t data = crc ^ b; 2d71c: 86 27 eor r24, r22 2d71e: 98 e0 ldi r25, 0x08 ; 8 for (uint8_t i = 0; i < 8; i++) { if ((data & 0x80U) != 0) { data <<= 1U; data ^= 0x07U; 2d720: 27 e0 ldi r18, 0x07 ; 7 static uint8_t CCITT_update(uint8_t crc, uint8_t b); static constexpr uint8_t CCITT_updateCX(uint8_t crc, uint8_t b) { uint8_t data = crc ^ b; for (uint8_t i = 0; i < 8; i++) { if ((data & 0x80U) != 0) { 2d722: 38 2f mov r19, r24 2d724: 88 0f add r24, r24 2d726: 37 fd sbrc r19, 7 data <<= 1U; data ^= 0x07U; 2d728: 82 27 eor r24, r18 2d72a: 91 50 subi r25, 0x01 ; 1 /// Details: https://www.nongnu.org/avr-libc/user-manual/group__util__crc.html static uint8_t CCITT_update(uint8_t crc, uint8_t b); static constexpr uint8_t CCITT_updateCX(uint8_t crc, uint8_t b) { uint8_t data = crc ^ b; for (uint8_t i = 0; i < 8; i++) { 2d72c: d1 f7 brne .-12 ; 0x2d722 } else { data <<= 1U; } } return data; } 2d72e: 08 95 ret 0002d730 : SERIAL_ECHO(_status); SERIAL_ECHO(']'); } static void prusa_stat_farm_number() { SERIAL_ECHOPGM("[PFN:0]"); 2d730: 89 ef ldi r24, 0xF9 ; 249 2d732: 9e e9 ldi r25, 0x9E ; 158 2d734: 0c 94 5a 70 jmp 0xe0b4 ; 0xe0b4 0002d738 : prusa_stat_printerstatus(statnr); prusa_stat_farm_number(); prusa_stat_printinfo(); } static void prusa_stat_printerstatus(uint8_t _status) { 2d738: cf 93 push r28 2d73a: c8 2f mov r28, r24 SERIAL_ECHOPGM("[PRN:"); 2d73c: 83 ef ldi r24, 0xF3 ; 243 2d73e: 9e e9 ldi r25, 0x9E ; 158 2d740: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 2d744: 8c 2f mov r24, r28 2d746: 0e 94 41 70 call 0xe082 ; 0xe082 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2d74a: 8d e5 ldi r24, 0x5D ; 93 SERIAL_ECHO(_status); SERIAL_ECHO(']'); } 2d74c: cf 91 pop r28 2d74e: 0c 94 41 70 jmp 0xe082 ; 0xe082 0002d752 : #ifdef PRUSA_M28 static void trace(); #endif static void prusa_statistics_err(char c) { 2d752: cf 93 push r28 2d754: c8 2f mov r28, r24 SERIAL_ECHOPGM("{[ERR:"); 2d756: 8c eb ldi r24, 0xBC ; 188 2d758: 9e e9 ldi r25, 0x9E ; 158 2d75a: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 2d75e: 8c 2f mov r24, r28 2d760: 0e 94 41 70 call 0xe082 ; 0xe082 2d764: 8d e5 ldi r24, 0x5D ; 93 2d766: 0e 94 41 70 call 0xe082 ; 0xe082 SERIAL_ECHO(c); SERIAL_ECHO(']'); prusa_stat_farm_number(); } 2d76a: cf 91 pop r28 static void prusa_statistics_err(char c) { SERIAL_ECHOPGM("{[ERR:"); SERIAL_ECHO(c); SERIAL_ECHO(']'); prusa_stat_farm_number(); 2d76c: 0d 94 98 6b jmp 0x2d730 ; 0x2d730 0002d770 : // Minimum stepper rate 120Hz. #define MINIMAL_STEP_RATE 120 // Calculates trapezoid parameters so that the entry- and exit-speed is compensated by the provided factors. void calculate_trapezoid_for_block(block_t *block, float entry_speed, float exit_speed) { 2d770: 2f 92 push r2 2d772: 3f 92 push r3 2d774: 4f 92 push r4 2d776: 5f 92 push r5 2d778: 6f 92 push r6 2d77a: 7f 92 push r7 2d77c: 8f 92 push r8 2d77e: 9f 92 push r9 2d780: af 92 push r10 2d782: bf 92 push r11 2d784: cf 92 push r12 2d786: df 92 push r13 2d788: ef 92 push r14 2d78a: ff 92 push r15 2d78c: 0f 93 push r16 2d78e: 1f 93 push r17 2d790: cf 93 push r28 2d792: df 93 push r29 2d794: cd b7 in r28, 0x3d ; 61 2d796: de b7 in r29, 0x3e ; 62 2d798: a1 97 sbiw r28, 0x21 ; 33 2d79a: 0f b6 in r0, 0x3f ; 63 2d79c: f8 94 cli 2d79e: de bf out 0x3e, r29 ; 62 2d7a0: 0f be out 0x3f, r0 ; 63 2d7a2: cd bf out 0x3d, r28 ; 61 2d7a4: 1c 01 movw r2, r24 2d7a6: 48 01 movw r8, r16 2d7a8: 59 01 movw r10, r18 // These two lines are the only floating point calculations performed in this routine. // initial_rate, final_rate in Hz. // Minimum stepper rate 120Hz, maximum 40kHz. If the stepper rate goes above 10kHz, // the stepper interrupt routine groups the pulses by 2 or 4 pulses per interrupt tick. uint32_t initial_rate = ceil(entry_speed * block->speed_factor); // (step/min) 2d7aa: fc 01 movw r30, r24 2d7ac: e8 5b subi r30, 0xB8 ; 184 2d7ae: ff 4f sbci r31, 0xFF ; 255 2d7b0: c0 80 ld r12, Z 2d7b2: d1 80 ldd r13, Z+1 ; 0x01 2d7b4: e2 80 ldd r14, Z+2 ; 0x02 2d7b6: f3 80 ldd r15, Z+3 ; 0x03 2d7b8: 9a 01 movw r18, r20 2d7ba: ab 01 movw r20, r22 2d7bc: c7 01 movw r24, r14 2d7be: b6 01 movw r22, r12 2d7c0: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2d7c4: 0f 94 e2 a1 call 0x343c4 ; 0x343c4 2d7c8: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 2d7cc: 8b 01 movw r16, r22 2d7ce: 8d 83 std Y+5, r24 ; 0x05 2d7d0: 99 83 std Y+1, r25 ; 0x01 uint32_t final_rate = ceil(exit_speed * block->speed_factor); // (step/min) 2d7d2: a5 01 movw r20, r10 2d7d4: 94 01 movw r18, r8 2d7d6: c7 01 movw r24, r14 2d7d8: b6 01 movw r22, r12 2d7da: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2d7de: 0f 94 e2 a1 call 0x343c4 ; 0x343c4 2d7e2: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 2d7e6: 36 2f mov r19, r22 2d7e8: 27 2f mov r18, r23 2d7ea: a8 01 movw r20, r16 2d7ec: 6d 81 ldd r22, Y+5 ; 0x05 2d7ee: 79 81 ldd r23, Y+1 ; 0x01 2d7f0: 48 37 cpi r20, 0x78 ; 120 2d7f2: 51 05 cpc r21, r1 2d7f4: 61 05 cpc r22, r1 2d7f6: 71 05 cpc r23, r1 2d7f8: 20 f4 brcc .+8 ; 0x2d802 2d7fa: 48 e7 ldi r20, 0x78 ; 120 2d7fc: 50 e0 ldi r21, 0x00 ; 0 2d7fe: 60 e0 ldi r22, 0x00 ; 0 2d800: 70 e0 ldi r23, 0x00 ; 0 // Limit minimal step rate (Otherwise the timer will overflow.) if (initial_rate < MINIMAL_STEP_RATE) initial_rate = MINIMAL_STEP_RATE; if (initial_rate > block->nominal_rate) 2d802: d1 01 movw r26, r2 2d804: d6 96 adiw r26, 0x36 ; 54 2d806: 8d 90 ld r8, X+ 2d808: 9d 90 ld r9, X+ 2d80a: ad 90 ld r10, X+ 2d80c: bc 90 ld r11, X 2d80e: d9 97 sbiw r26, 0x39 ; 57 2d810: 8f 8a std Y+23, r8 ; 0x17 2d812: 98 8e std Y+24, r9 ; 0x18 2d814: a9 8e std Y+25, r10 ; 0x19 2d816: ba 8e std Y+26, r11 ; 0x1a 2d818: 48 15 cp r20, r8 2d81a: 59 05 cpc r21, r9 2d81c: 6a 05 cpc r22, r10 2d81e: 7b 05 cpc r23, r11 2d820: 20 f4 brcc .+8 ; 0x2d82a 2d822: 4f 8b std Y+23, r20 ; 0x17 2d824: 58 8f std Y+24, r21 ; 0x18 2d826: 69 8f std Y+25, r22 ; 0x19 2d828: 7a 8f std Y+26, r23 ; 0x1a 2d82a: 43 2f mov r20, r19 2d82c: 52 2f mov r21, r18 2d82e: bc 01 movw r22, r24 2d830: 48 37 cpi r20, 0x78 ; 120 2d832: 51 05 cpc r21, r1 2d834: 61 05 cpc r22, r1 2d836: 71 05 cpc r23, r1 2d838: 20 f4 brcc .+8 ; 0x2d842 2d83a: 48 e7 ldi r20, 0x78 ; 120 2d83c: 50 e0 ldi r21, 0x00 ; 0 2d83e: 60 e0 ldi r22, 0x00 ; 0 2d840: 70 e0 ldi r23, 0x00 ; 0 2d842: 18 2d mov r17, r8 2d844: 09 2d mov r16, r9 2d846: a9 a2 std Y+33, r10 ; 0x21 2d848: b8 a2 std Y+32, r11 ; 0x20 2d84a: 48 15 cp r20, r8 2d84c: 59 05 cpc r21, r9 2d84e: 6a 05 cpc r22, r10 2d850: 7b 05 cpc r23, r11 2d852: 20 f4 brcc .+8 ; 0x2d85c 2d854: 14 2f mov r17, r20 2d856: 05 2f mov r16, r21 2d858: 69 a3 std Y+33, r22 ; 0x21 2d85a: 78 a3 std Y+32, r23 ; 0x20 if (final_rate < MINIMAL_STEP_RATE) final_rate = MINIMAL_STEP_RATE; if (final_rate > block->nominal_rate) final_rate = block->nominal_rate; uint32_t acceleration = block->acceleration_steps_per_s2; 2d85c: f1 01 movw r30, r2 2d85e: ee 5b subi r30, 0xBE ; 190 2d860: ff 4f sbci r31, 0xFF ; 255 2d862: c0 80 ld r12, Z 2d864: d1 80 ldd r13, Z+1 ; 0x01 2d866: e2 80 ldd r14, Z+2 ; 0x02 2d868: f3 80 ldd r15, Z+3 ; 0x03 2d86a: cd 82 std Y+5, r12 ; 0x05 2d86c: de 82 std Y+6, r13 ; 0x06 2d86e: ef 82 std Y+7, r14 ; 0x07 2d870: f8 86 std Y+8, r15 ; 0x08 if (acceleration == 0) 2d872: cd 28 or r12, r13 2d874: ce 28 or r12, r14 2d876: cf 28 or r12, r15 2d878: 41 f4 brne .+16 ; 0x2d88a // Don't allow zero acceleration. acceleration = 1; 2d87a: c1 2c mov r12, r1 2d87c: d1 2c mov r13, r1 2d87e: 76 01 movw r14, r12 2d880: c3 94 inc r12 2d882: cd 82 std Y+5, r12 ; 0x05 2d884: de 82 std Y+6, r13 ; 0x06 2d886: ef 82 std Y+7, r14 ; 0x07 2d888: f8 86 std Y+8, r15 ; 0x08 // estimate_acceleration_distance(float initial_rate, float target_rate, float acceleration) // (target_rate*target_rate-initial_rate*initial_rate)/(2.0*acceleration)); uint32_t initial_rate_sqr = initial_rate*initial_rate; 2d88a: 2f 89 ldd r18, Y+23 ; 0x17 2d88c: 38 8d ldd r19, Y+24 ; 0x18 2d88e: 49 8d ldd r20, Y+25 ; 0x19 2d890: 5a 8d ldd r21, Y+26 ; 0x1a 2d892: b9 01 movw r22, r18 2d894: ca 01 movw r24, r20 2d896: 0f 94 3f a0 call 0x3407e ; 0x3407e <__mulsi3> 2d89a: 6d 87 std Y+13, r22 ; 0x0d 2d89c: 7e 87 std Y+14, r23 ; 0x0e 2d89e: 8f 87 std Y+15, r24 ; 0x0f 2d8a0: 98 8b std Y+16, r25 ; 0x10 //FIXME assert that this result fits a 64bit unsigned int. uint32_t nominal_rate_sqr = block->nominal_rate*block->nominal_rate; 2d8a2: a5 01 movw r20, r10 2d8a4: 94 01 movw r18, r8 2d8a6: c5 01 movw r24, r10 2d8a8: b4 01 movw r22, r8 2d8aa: 0f 94 3f a0 call 0x3407e ; 0x3407e <__mulsi3> 2d8ae: 2b 01 movw r4, r22 2d8b0: 3c 01 movw r6, r24 uint32_t final_rate_sqr = final_rate*final_rate; 2d8b2: 21 2f mov r18, r17 2d8b4: 30 2f mov r19, r16 2d8b6: 49 a1 ldd r20, Y+33 ; 0x21 2d8b8: 58 a1 ldd r21, Y+32 ; 0x20 2d8ba: 61 2f mov r22, r17 2d8bc: 70 2f mov r23, r16 2d8be: ca 01 movw r24, r20 2d8c0: 0f 94 3f a0 call 0x3407e ; 0x3407e <__mulsi3> 2d8c4: 69 8b std Y+17, r22 ; 0x11 2d8c6: 7a 8b std Y+18, r23 ; 0x12 2d8c8: 8b 8b std Y+19, r24 ; 0x13 2d8ca: 9c 8b std Y+20, r25 ; 0x14 uint32_t acceleration_x2 = acceleration << 1; 2d8cc: cd 80 ldd r12, Y+5 ; 0x05 2d8ce: de 80 ldd r13, Y+6 ; 0x06 2d8d0: ef 80 ldd r14, Y+7 ; 0x07 2d8d2: f8 84 ldd r15, Y+8 ; 0x08 2d8d4: cc 0c add r12, r12 2d8d6: dd 1c adc r13, r13 2d8d8: ee 1c adc r14, r14 2d8da: ff 1c adc r15, r15 2d8dc: c9 86 std Y+9, r12 ; 0x09 2d8de: da 86 std Y+10, r13 ; 0x0a 2d8e0: eb 86 std Y+11, r14 ; 0x0b 2d8e2: fc 86 std Y+12, r15 ; 0x0c // ceil(estimate_acceleration_distance(initial_rate, block->nominal_rate, acceleration)); uint32_t accelerate_steps = (nominal_rate_sqr - initial_rate_sqr + acceleration_x2 - 1) / acceleration_x2; 2d8e4: c3 01 movw r24, r6 2d8e6: b2 01 movw r22, r4 2d8e8: 61 50 subi r22, 0x01 ; 1 2d8ea: 71 09 sbc r23, r1 2d8ec: 81 09 sbc r24, r1 2d8ee: 91 09 sbc r25, r1 2d8f0: cd 84 ldd r12, Y+13 ; 0x0d 2d8f2: de 84 ldd r13, Y+14 ; 0x0e 2d8f4: ef 84 ldd r14, Y+15 ; 0x0f 2d8f6: f8 88 ldd r15, Y+16 ; 0x10 2d8f8: 6c 19 sub r22, r12 2d8fa: 7d 09 sbc r23, r13 2d8fc: 8e 09 sbc r24, r14 2d8fe: 9f 09 sbc r25, r15 2d900: c9 84 ldd r12, Y+9 ; 0x09 2d902: da 84 ldd r13, Y+10 ; 0x0a 2d904: eb 84 ldd r14, Y+11 ; 0x0b 2d906: fc 84 ldd r15, Y+12 ; 0x0c 2d908: 6c 0d add r22, r12 2d90a: 7d 1d adc r23, r13 2d90c: 8e 1d adc r24, r14 2d90e: 9f 1d adc r25, r15 2d910: a7 01 movw r20, r14 2d912: 96 01 movw r18, r12 2d914: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> 2d918: 69 01 movw r12, r18 2d91a: 7a 01 movw r14, r20 // floor(estimate_acceleration_distance(block->nominal_rate, final_rate, -acceleration)); uint32_t decelerate_steps = (nominal_rate_sqr - final_rate_sqr) / acceleration_x2; 2d91c: c3 01 movw r24, r6 2d91e: b2 01 movw r22, r4 2d920: 29 89 ldd r18, Y+17 ; 0x11 2d922: 3a 89 ldd r19, Y+18 ; 0x12 2d924: 4b 89 ldd r20, Y+19 ; 0x13 2d926: 5c 89 ldd r21, Y+20 ; 0x14 2d928: 62 1b sub r22, r18 2d92a: 73 0b sbc r23, r19 2d92c: 84 0b sbc r24, r20 2d92e: 95 0b sbc r25, r21 2d930: 29 85 ldd r18, Y+9 ; 0x09 2d932: 3a 85 ldd r19, Y+10 ; 0x0a 2d934: 4b 85 ldd r20, Y+11 ; 0x0b 2d936: 5c 85 ldd r21, Y+12 ; 0x0c 2d938: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> 2d93c: 29 01 movw r4, r18 2d93e: 3a 01 movw r6, r20 uint32_t accel_decel_steps = accelerate_steps + decelerate_steps; 2d940: d7 01 movw r26, r14 2d942: c6 01 movw r24, r12 2d944: 84 0d add r24, r4 2d946: 95 1d adc r25, r5 2d948: a6 1d adc r26, r6 2d94a: b7 1d adc r27, r7 2d94c: 8c 8f std Y+28, r24 ; 0x1c 2d94e: 9d 8f std Y+29, r25 ; 0x1d 2d950: ae 8f std Y+30, r26 ; 0x1e 2d952: bf 8f std Y+31, r27 ; 0x1f uint32_t plateau_steps = 0; #ifdef LIN_ADVANCE uint16_t final_adv_steps = 0; uint16_t max_adv_steps = 0; if (block->use_advance_lead) { 2d954: f1 01 movw r30, r2 2d956: e4 5b subi r30, 0xB4 ; 180 2d958: ff 4f sbci r31, 0xFF ; 255 2d95a: 90 81 ld r25, Z 2d95c: 9b 8f std Y+27, r25 ; 0x1b 2d95e: 99 23 and r25, r25 2d960: 09 f4 brne .+2 ; 0x2d964 2d962: 8d c0 rjmp .+282 ; 0x2da7e final_adv_steps = final_rate * block->adv_comp; 2d964: 61 2f mov r22, r17 2d966: 70 2f mov r23, r16 2d968: 89 a1 ldd r24, Y+33 ; 0x21 2d96a: 98 a1 ldd r25, Y+32 ; 0x20 2d96c: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 2d970: f1 01 movw r30, r2 2d972: ec 5a subi r30, 0xAC ; 172 2d974: ff 4f sbci r31, 0xFF ; 255 2d976: 20 81 ld r18, Z 2d978: 31 81 ldd r19, Z+1 ; 0x01 2d97a: 42 81 ldd r20, Z+2 ; 0x02 2d97c: 53 81 ldd r21, Z+3 ; 0x03 2d97e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2d982: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 2d986: 6d 8b std Y+21, r22 ; 0x15 2d988: 7e 8b std Y+22, r23 ; 0x16 #endif // Is the Plateau of Nominal Rate smaller than nothing? That means no cruising, and we will // have to use intersection_distance() to calculate when to abort acceleration and start braking // in order to reach the final_rate exactly at the end of this block. if (accel_decel_steps < block->step_event_count.wide) { 2d98a: d1 01 movw r26, r2 2d98c: 50 96 adiw r26, 0x10 ; 16 2d98e: 2d 91 ld r18, X+ 2d990: 3d 91 ld r19, X+ 2d992: 4d 91 ld r20, X+ 2d994: 5c 91 ld r21, X 2d996: 53 97 sbiw r26, 0x13 ; 19 2d998: 29 83 std Y+1, r18 ; 0x01 2d99a: 3a 83 std Y+2, r19 ; 0x02 2d99c: 4b 83 std Y+3, r20 ; 0x03 2d99e: 5c 83 std Y+4, r21 ; 0x04 2d9a0: 8c 8d ldd r24, Y+28 ; 0x1c 2d9a2: 9d 8d ldd r25, Y+29 ; 0x1d 2d9a4: ae 8d ldd r26, Y+30 ; 0x1e 2d9a6: bf 8d ldd r27, Y+31 ; 0x1f 2d9a8: 82 17 cp r24, r18 2d9aa: 93 07 cpc r25, r19 2d9ac: a4 07 cpc r26, r20 2d9ae: b5 07 cpc r27, r21 2d9b0: 08 f0 brcs .+2 ; 0x2d9b4 2d9b2: 68 c0 rjmp .+208 ; 0x2da84 plateau_steps = block->step_event_count.wide - accel_decel_steps; 2d9b4: 29 01 movw r4, r18 2d9b6: 3a 01 movw r6, r20 2d9b8: 48 1a sub r4, r24 2d9ba: 59 0a sbc r5, r25 2d9bc: 6a 0a sbc r6, r26 2d9be: 7b 0a sbc r7, r27 #ifdef LIN_ADVANCE if (block->use_advance_lead) 2d9c0: 9b 8d ldd r25, Y+27 ; 0x1b // Size of Plateau of Nominal Rate. uint32_t plateau_steps = 0; #ifdef LIN_ADVANCE uint16_t final_adv_steps = 0; uint16_t max_adv_steps = 0; 2d9c2: 40 e0 ldi r20, 0x00 ; 0 2d9c4: 80 e0 ldi r24, 0x00 ; 0 // have to use intersection_distance() to calculate when to abort acceleration and start braking // in order to reach the final_rate exactly at the end of this block. if (accel_decel_steps < block->step_event_count.wide) { plateau_steps = block->step_event_count.wide - accel_decel_steps; #ifdef LIN_ADVANCE if (block->use_advance_lead) 2d9c6: 99 23 and r25, r25 2d9c8: 89 f0 breq .+34 ; 0x2d9ec max_adv_steps = block->nominal_rate * block->adv_comp; 2d9ca: c5 01 movw r24, r10 2d9cc: b4 01 movw r22, r8 2d9ce: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 2d9d2: f1 01 movw r30, r2 2d9d4: ec 5a subi r30, 0xAC ; 172 2d9d6: ff 4f sbci r31, 0xFF ; 255 2d9d8: 20 81 ld r18, Z 2d9da: 31 81 ldd r19, Z+1 ; 0x01 2d9dc: 42 81 ldd r20, Z+2 ; 0x02 2d9de: 53 81 ldd r21, Z+3 ; 0x03 2d9e0: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2d9e4: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 2d9e8: 46 2f mov r20, r22 2d9ea: 87 2f mov r24, r23 } } #endif } CRITICAL_SECTION_START; // Fill variables used by the stepper in a critical section 2d9ec: 3f b7 in r19, 0x3f ; 63 2d9ee: f8 94 cli // This block locks the interrupts globally for 4.38 us, // which corresponds to a maximum repeat frequency of 228.57 kHz. // This blocking is safe in the context of a 10kHz stepper driver interrupt // or a 115200 Bd serial line receive interrupt, which will not trigger faster than 12kHz. if (! block->busy) { // Don't update variables if block is busy. 2d9f0: f1 01 movw r30, r2 2d9f2: e9 5b subi r30, 0xB9 ; 185 2d9f4: ff 4f sbci r31, 0xFF ; 255 2d9f6: 20 81 ld r18, Z 2d9f8: 21 11 cpse r18, r1 2d9fa: 27 c0 rjmp .+78 ; 0x2da4a block->accelerate_until = accelerate_steps; 2d9fc: d1 01 movw r26, r2 2d9fe: 59 96 adiw r26, 0x19 ; 25 2da00: cd 92 st X+, r12 2da02: dd 92 st X+, r13 2da04: ed 92 st X+, r14 2da06: fc 92 st X, r15 2da08: 5c 97 sbiw r26, 0x1c ; 28 block->decelerate_after = accelerate_steps+plateau_steps; 2da0a: c4 0c add r12, r4 2da0c: d5 1c adc r13, r5 2da0e: e6 1c adc r14, r6 2da10: f7 1c adc r15, r7 2da12: f1 01 movw r30, r2 2da14: c5 8e std Z+29, r12 ; 0x1d 2da16: d6 8e std Z+30, r13 ; 0x1e 2da18: e7 8e std Z+31, r14 ; 0x1f 2da1a: f0 a2 std Z+32, r15 ; 0x20 block->initial_rate = initial_rate; 2da1c: cf 88 ldd r12, Y+23 ; 0x17 2da1e: c2 ae std Z+58, r12 ; 0x3a 2da20: d8 8c ldd r13, Y+24 ; 0x18 2da22: d3 ae std Z+59, r13 ; 0x3b 2da24: e9 8c ldd r14, Y+25 ; 0x19 2da26: e4 ae std Z+60, r14 ; 0x3c 2da28: fa 8c ldd r15, Y+26 ; 0x1a 2da2a: f5 ae std Z+61, r15 ; 0x3d block->final_rate = final_rate; 2da2c: fe 96 adiw r30, 0x3e ; 62 2da2e: 10 83 st Z, r17 2da30: 01 83 std Z+1, r16 ; 0x01 2da32: c9 a0 ldd r12, Y+33 ; 0x21 2da34: c2 82 std Z+2, r12 ; 0x02 2da36: d8 a0 ldd r13, Y+32 ; 0x20 2da38: d3 82 std Z+3, r13 ; 0x03 #ifdef LIN_ADVANCE block->final_adv_steps = final_adv_steps; 2da3a: 73 96 adiw r30, 0x13 ; 19 2da3c: ed 88 ldd r14, Y+21 ; 0x15 2da3e: e0 82 st Z, r14 2da40: fe 88 ldd r15, Y+22 ; 0x16 2da42: f1 82 std Z+1, r15 ; 0x01 block->max_adv_steps = max_adv_steps; 2da44: 32 97 sbiw r30, 0x02 ; 2 2da46: 40 83 st Z, r20 2da48: 81 83 std Z+1, r24 ; 0x01 #endif } CRITICAL_SECTION_END; 2da4a: 3f bf out 0x3f, r19 ; 63 } 2da4c: a1 96 adiw r28, 0x21 ; 33 2da4e: 0f b6 in r0, 0x3f ; 63 2da50: f8 94 cli 2da52: de bf out 0x3e, r29 ; 62 2da54: 0f be out 0x3f, r0 ; 63 2da56: cd bf out 0x3d, r28 ; 61 2da58: df 91 pop r29 2da5a: cf 91 pop r28 2da5c: 1f 91 pop r17 2da5e: 0f 91 pop r16 2da60: ff 90 pop r15 2da62: ef 90 pop r14 2da64: df 90 pop r13 2da66: cf 90 pop r12 2da68: bf 90 pop r11 2da6a: af 90 pop r10 2da6c: 9f 90 pop r9 2da6e: 8f 90 pop r8 2da70: 7f 90 pop r7 2da72: 6f 90 pop r6 2da74: 5f 90 pop r5 2da76: 4f 90 pop r4 2da78: 3f 90 pop r3 2da7a: 2f 90 pop r2 2da7c: 08 95 ret uint32_t accel_decel_steps = accelerate_steps + decelerate_steps; // Size of Plateau of Nominal Rate. uint32_t plateau_steps = 0; #ifdef LIN_ADVANCE uint16_t final_adv_steps = 0; 2da7e: 1d 8a std Y+21, r1 ; 0x15 2da80: 1e 8a std Y+22, r1 ; 0x16 2da82: 83 cf rjmp .-250 ; 0x2d98a #ifdef LIN_ADVANCE if (block->use_advance_lead) max_adv_steps = block->nominal_rate * block->adv_comp; #endif } else { uint32_t acceleration_x4 = acceleration << 2; 2da84: 2d 81 ldd r18, Y+5 ; 0x05 2da86: 3e 81 ldd r19, Y+6 ; 0x06 2da88: 4f 81 ldd r20, Y+7 ; 0x07 2da8a: 58 85 ldd r21, Y+8 ; 0x08 2da8c: 82 e0 ldi r24, 0x02 ; 2 2da8e: 22 0f add r18, r18 2da90: 33 1f adc r19, r19 2da92: 44 1f adc r20, r20 2da94: 55 1f adc r21, r21 2da96: 8a 95 dec r24 2da98: d1 f7 brne .-12 ; 0x2da8e 2da9a: 89 81 ldd r24, Y+1 ; 0x01 2da9c: 9a 81 ldd r25, Y+2 ; 0x02 2da9e: ab 81 ldd r26, Y+3 ; 0x03 2daa0: bc 81 ldd r27, Y+4 ; 0x04 2daa2: 81 70 andi r24, 0x01 ; 1 2daa4: 99 27 eor r25, r25 2daa6: aa 27 eor r26, r26 2daa8: bb 27 eor r27, r27 2daaa: 8d 83 std Y+5, r24 ; 0x05 2daac: 9e 83 std Y+6, r25 ; 0x06 2daae: af 83 std Y+7, r26 ; 0x07 2dab0: b8 87 std Y+8, r27 ; 0x08 2dab2: 89 80 ldd r8, Y+1 ; 0x01 2dab4: 9a 80 ldd r9, Y+2 ; 0x02 2dab6: ab 80 ldd r10, Y+3 ; 0x03 2dab8: bc 80 ldd r11, Y+4 ; 0x04 2daba: b6 94 lsr r11 2dabc: a7 94 ror r10 2dabe: 97 94 ror r9 2dac0: 87 94 ror r8 // Avoid negative numbers if (final_rate_sqr >= initial_rate_sqr) { 2dac2: cd 84 ldd r12, Y+13 ; 0x0d 2dac4: de 84 ldd r13, Y+14 ; 0x0e 2dac6: ef 84 ldd r14, Y+15 ; 0x0f 2dac8: f8 88 ldd r15, Y+16 ; 0x10 2daca: 89 89 ldd r24, Y+17 ; 0x11 2dacc: 9a 89 ldd r25, Y+18 ; 0x12 2dace: ab 89 ldd r26, Y+19 ; 0x13 2dad0: bc 89 ldd r27, Y+20 ; 0x14 2dad2: 8c 15 cp r24, r12 2dad4: 9d 05 cpc r25, r13 2dad6: ae 05 cpc r26, r14 2dad8: bf 05 cpc r27, r15 2dada: 08 f4 brcc .+2 ; 0x2dade 2dadc: 6f c0 rjmp .+222 ; 0x2dbbc // intersection_distance(float initial_rate, float final_rate, float acceleration, float distance) // (2.0*acceleration*distance-initial_rate*initial_rate+final_rate*final_rate)/(4.0*acceleration); #if 0 accelerate_steps = (block->step_event_count >> 1) + (final_rate_sqr - initial_rate_sqr + acceleration_x4 - 1 + (block->step_event_count & 1) * acceleration_x2) / acceleration_x4; #else accelerate_steps = final_rate_sqr - initial_rate_sqr + acceleration_x4 - 1; 2dade: 6c 01 movw r12, r24 2dae0: 7d 01 movw r14, r26 2dae2: 91 e0 ldi r25, 0x01 ; 1 2dae4: c9 1a sub r12, r25 2dae6: d1 08 sbc r13, r1 2dae8: e1 08 sbc r14, r1 2daea: f1 08 sbc r15, r1 2daec: 8d 85 ldd r24, Y+13 ; 0x0d 2daee: 9e 85 ldd r25, Y+14 ; 0x0e 2daf0: af 85 ldd r26, Y+15 ; 0x0f 2daf2: b8 89 ldd r27, Y+16 ; 0x10 2daf4: c8 1a sub r12, r24 2daf6: d9 0a sbc r13, r25 2daf8: ea 0a sbc r14, r26 2dafa: fb 0a sbc r15, r27 2dafc: c7 01 movw r24, r14 2dafe: b6 01 movw r22, r12 2db00: 62 0f add r22, r18 2db02: 73 1f adc r23, r19 2db04: 84 1f adc r24, r20 2db06: 95 1f adc r25, r21 if (block->step_event_count.wide & 1) 2db08: cd 80 ldd r12, Y+5 ; 0x05 2db0a: de 80 ldd r13, Y+6 ; 0x06 2db0c: ef 80 ldd r14, Y+7 ; 0x07 2db0e: f8 84 ldd r15, Y+8 ; 0x08 2db10: cd 28 or r12, r13 2db12: ce 28 or r12, r14 2db14: cf 28 or r12, r15 2db16: 41 f0 breq .+16 ; 0x2db28 accelerate_steps += acceleration_x2; 2db18: c9 84 ldd r12, Y+9 ; 0x09 2db1a: da 84 ldd r13, Y+10 ; 0x0a 2db1c: eb 84 ldd r14, Y+11 ; 0x0b 2db1e: fc 84 ldd r15, Y+12 ; 0x0c 2db20: 6c 0d add r22, r12 2db22: 7d 1d adc r23, r13 2db24: 8e 1d adc r24, r14 2db26: 9f 1d adc r25, r15 accelerate_steps /= acceleration_x4; 2db28: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> 2db2c: 75 01 movw r14, r10 2db2e: 64 01 movw r12, r8 2db30: c2 0e add r12, r18 2db32: d3 1e adc r13, r19 2db34: e4 1e adc r14, r20 2db36: f5 1e adc r15, r21 2db38: 29 81 ldd r18, Y+1 ; 0x01 2db3a: 3a 81 ldd r19, Y+2 ; 0x02 2db3c: 4b 81 ldd r20, Y+3 ; 0x03 2db3e: 5c 81 ldd r21, Y+4 ; 0x04 2db40: 2c 15 cp r18, r12 2db42: 3d 05 cpc r19, r13 2db44: 4e 05 cpc r20, r14 2db46: 5f 05 cpc r21, r15 2db48: 10 f4 brcc .+4 ; 0x2db4e 2db4a: 69 01 movw r12, r18 2db4c: 7a 01 movw r14, r20 decelerate_steps = block->step_event_count.wide; accelerate_steps = block->step_event_count.wide - decelerate_steps; } #ifdef LIN_ADVANCE if (block->use_advance_lead) { 2db4e: 2b 8d ldd r18, Y+27 ; 0x1b 2db50: 22 23 and r18, r18 2db52: 09 f4 brne .+2 ; 0x2db56 2db54: 69 c0 rjmp .+210 ; 0x2dc28 if(!accelerate_steps || !decelerate_steps) { 2db56: c1 14 cp r12, r1 2db58: d1 04 cpc r13, r1 2db5a: e1 04 cpc r14, r1 2db5c: f1 04 cpc r15, r1 2db5e: 09 f4 brne .+2 ; 0x2db62 2db60: 66 c0 rjmp .+204 ; 0x2dc2e // accelerate_steps=0: deceleration-only ramp, max_rate is effectively unused // decelerate_steps=0: acceleration-only ramp, max_rate _is_ final_rate max_adv_steps = final_adv_steps; 2db62: 4d 89 ldd r20, Y+21 ; 0x15 2db64: 8e 89 ldd r24, Y+22 ; 0x16 accelerate_steps = block->step_event_count.wide - decelerate_steps; } #ifdef LIN_ADVANCE if (block->use_advance_lead) { if(!accelerate_steps || !decelerate_steps) { 2db66: 41 14 cp r4, r1 2db68: 51 04 cpc r5, r1 2db6a: 61 04 cpc r6, r1 2db6c: 71 04 cpc r7, r1 2db6e: 09 f4 brne .+2 ; 0x2db72 2db70: 3d cf rjmp .-390 ; 0x2d9ec // accelerate_steps=0: deceleration-only ramp, max_rate is effectively unused // decelerate_steps=0: acceleration-only ramp, max_rate _is_ final_rate max_adv_steps = final_adv_steps; } else { float max_rate = sqrt(acceleration_x2 * accelerate_steps + initial_rate_sqr); 2db72: a7 01 movw r20, r14 2db74: 96 01 movw r18, r12 2db76: 69 85 ldd r22, Y+9 ; 0x09 2db78: 7a 85 ldd r23, Y+10 ; 0x0a 2db7a: 8b 85 ldd r24, Y+11 ; 0x0b 2db7c: 9c 85 ldd r25, Y+12 ; 0x0c 2db7e: 0f 94 3f a0 call 0x3407e ; 0x3407e <__mulsi3> 2db82: 2d 85 ldd r18, Y+13 ; 0x0d 2db84: 3e 85 ldd r19, Y+14 ; 0x0e 2db86: 4f 85 ldd r20, Y+15 ; 0x0f 2db88: 58 89 ldd r21, Y+16 ; 0x10 2db8a: 62 0f add r22, r18 2db8c: 73 1f adc r23, r19 2db8e: 84 1f adc r24, r20 2db90: 95 1f adc r25, r21 2db92: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 2db96: 0f 94 d2 a4 call 0x349a4 ; 0x349a4 max_adv_steps = max_rate * block->adv_comp; 2db9a: f1 01 movw r30, r2 2db9c: ec 5a subi r30, 0xAC ; 172 2db9e: ff 4f sbci r31, 0xFF ; 255 2dba0: 20 81 ld r18, Z 2dba2: 31 81 ldd r19, Z+1 ; 0x01 2dba4: 42 81 ldd r20, Z+2 ; 0x02 2dba6: 53 81 ldd r21, Z+3 ; 0x03 2dba8: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2dbac: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 2dbb0: 46 2f mov r20, r22 2dbb2: 87 2f mov r24, r23 uint32_t accelerate_steps = (nominal_rate_sqr - initial_rate_sqr + acceleration_x2 - 1) / acceleration_x2; // floor(estimate_acceleration_distance(block->nominal_rate, final_rate, -acceleration)); uint32_t decelerate_steps = (nominal_rate_sqr - final_rate_sqr) / acceleration_x2; uint32_t accel_decel_steps = accelerate_steps + decelerate_steps; // Size of Plateau of Nominal Rate. uint32_t plateau_steps = 0; 2dbb4: 41 2c mov r4, r1 2dbb6: 51 2c mov r5, r1 2dbb8: 32 01 movw r6, r4 2dbba: 18 cf rjmp .-464 ; 0x2d9ec accelerate_steps = block->step_event_count.wide; } else { #if 0 decelerate_steps = (block->step_event_count >> 1) + (initial_rate_sqr - final_rate_sqr + (block->step_event_count & 1) * acceleration_x2) / acceleration_x4; #else decelerate_steps = initial_rate_sqr - final_rate_sqr; 2dbbc: 6d 85 ldd r22, Y+13 ; 0x0d 2dbbe: 7e 85 ldd r23, Y+14 ; 0x0e 2dbc0: 8f 85 ldd r24, Y+15 ; 0x0f 2dbc2: 98 89 ldd r25, Y+16 ; 0x10 2dbc4: c9 88 ldd r12, Y+17 ; 0x11 2dbc6: da 88 ldd r13, Y+18 ; 0x12 2dbc8: eb 88 ldd r14, Y+19 ; 0x13 2dbca: fc 88 ldd r15, Y+20 ; 0x14 2dbcc: 6c 19 sub r22, r12 2dbce: 7d 09 sbc r23, r13 2dbd0: 8e 09 sbc r24, r14 2dbd2: 9f 09 sbc r25, r15 if (block->step_event_count.wide & 1) 2dbd4: cd 80 ldd r12, Y+5 ; 0x05 2dbd6: de 80 ldd r13, Y+6 ; 0x06 2dbd8: ef 80 ldd r14, Y+7 ; 0x07 2dbda: f8 84 ldd r15, Y+8 ; 0x08 2dbdc: cd 28 or r12, r13 2dbde: ce 28 or r12, r14 2dbe0: cf 28 or r12, r15 2dbe2: 41 f0 breq .+16 ; 0x2dbf4 decelerate_steps += acceleration_x2; 2dbe4: c9 84 ldd r12, Y+9 ; 0x09 2dbe6: da 84 ldd r13, Y+10 ; 0x0a 2dbe8: eb 84 ldd r14, Y+11 ; 0x0b 2dbea: fc 84 ldd r15, Y+12 ; 0x0c 2dbec: 6c 0d add r22, r12 2dbee: 7d 1d adc r23, r13 2dbf0: 8e 1d adc r24, r14 2dbf2: 9f 1d adc r25, r15 decelerate_steps /= acceleration_x4; 2dbf4: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> decelerate_steps += (block->step_event_count.wide >> 1); 2dbf8: 82 0e add r8, r18 2dbfa: 93 1e adc r9, r19 2dbfc: a4 1e adc r10, r20 2dbfe: b5 1e adc r11, r21 2dc00: 49 80 ldd r4, Y+1 ; 0x01 2dc02: 5a 80 ldd r5, Y+2 ; 0x02 2dc04: 6b 80 ldd r6, Y+3 ; 0x03 2dc06: 7c 80 ldd r7, Y+4 ; 0x04 2dc08: 84 14 cp r8, r4 2dc0a: 95 04 cpc r9, r5 2dc0c: a6 04 cpc r10, r6 2dc0e: b7 04 cpc r11, r7 2dc10: 10 f4 brcc .+4 ; 0x2dc16 2dc12: 24 01 movw r4, r8 2dc14: 35 01 movw r6, r10 #endif if (decelerate_steps > block->step_event_count.wide) decelerate_steps = block->step_event_count.wide; accelerate_steps = block->step_event_count.wide - decelerate_steps; 2dc16: c9 80 ldd r12, Y+1 ; 0x01 2dc18: da 80 ldd r13, Y+2 ; 0x02 2dc1a: eb 80 ldd r14, Y+3 ; 0x03 2dc1c: fc 80 ldd r15, Y+4 ; 0x04 2dc1e: c4 18 sub r12, r4 2dc20: d5 08 sbc r13, r5 2dc22: e6 08 sbc r14, r6 2dc24: f7 08 sbc r15, r7 2dc26: 93 cf rjmp .-218 ; 0x2db4e // Size of Plateau of Nominal Rate. uint32_t plateau_steps = 0; #ifdef LIN_ADVANCE uint16_t final_adv_steps = 0; uint16_t max_adv_steps = 0; 2dc28: 40 e0 ldi r20, 0x00 ; 0 2dc2a: 80 e0 ldi r24, 0x00 ; 0 2dc2c: c3 cf rjmp .-122 ; 0x2dbb4 #ifdef LIN_ADVANCE if (block->use_advance_lead) { if(!accelerate_steps || !decelerate_steps) { // accelerate_steps=0: deceleration-only ramp, max_rate is effectively unused // decelerate_steps=0: acceleration-only ramp, max_rate _is_ final_rate max_adv_steps = final_adv_steps; 2dc2e: 4d 89 ldd r20, Y+21 ; 0x15 2dc30: 8e 89 ldd r24, Y+22 ; 0x16 2dc32: c0 cf rjmp .-128 ; 0x2dbb4 0002dc34 : /// @brief Draw the label and value for a menu edit item /// @param chr 1 byte character /// @param str String residing in program memory (PROGMEM) /// @param val value to render, ranges from -999 to 9999 static void menu_draw_P(const char chr, const char* str, const int16_t val) { 2dc34: 0f 93 push r16 2dc36: 1f 93 push r17 2dc38: cf 93 push r28 2dc3a: df 93 push r29 2dc3c: eb 01 movw r28, r22 2dc3e: 14 2f mov r17, r20 2dc40: 05 2f mov r16, r21 lcd_putc(chr); 2dc42: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 lcd_puts_P(str); 2dc46: ce 01 movw r24, r28 2dc48: 0e 94 66 69 call 0xd2cc ; 0xd2cc lcd_putc(':'); 2dc4c: 8a e3 ldi r24, 0x3A ; 58 2dc4e: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 2dc52: ce 01 movw r24, r28 2dc54: 0f 94 9a 9d call 0x33b34 ; 0x33b34 <__strlen_P> // Padding to compensate variable string length const uint8_t len = strlen_P(str); lcd_space((LCD_WIDTH - 4) - (2 + len)); 2dc58: 9e e0 ldi r25, 0x0E ; 14 2dc5a: 98 1b sub r25, r24 2dc5c: 89 2f mov r24, r25 2dc5e: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 // Right adjusted value lcd_printf_P(PSTR("%4d"), val); 2dc62: 0f 93 push r16 2dc64: 1f 93 push r17 2dc66: 8e e7 ldi r24, 0x7E ; 126 2dc68: 9d e9 ldi r25, 0x9D ; 157 2dc6a: 9f 93 push r25 2dc6c: 8f 93 push r24 2dc6e: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 2dc72: 0f 90 pop r0 2dc74: 0f 90 pop r0 2dc76: 0f 90 pop r0 2dc78: 0f 90 pop r0 } 2dc7a: df 91 pop r29 2dc7c: cf 91 pop r28 2dc7e: 1f 91 pop r17 2dc80: 0f 91 pop r16 2dc82: 08 95 ret 0002dc84 : * \return The value one, true, is returned for success and * the value zero, false, is returned for failure. * Reasons for failure include the file is already open, the FAT volume has * not been initialized or it a FAT12 volume. */ bool SdBaseFile::openRoot(SdVolume* vol) { 2dc84: 0f 93 push r16 2dc86: 1f 93 push r17 2dc88: cf 93 push r28 2dc8a: df 93 push r29 // error if file is already open if (isOpen()) goto fail; 2dc8c: fc 01 movw r30, r24 2dc8e: 23 81 ldd r18, Z+3 ; 0x03 2dc90: 22 23 and r18, r18 2dc92: 31 f0 breq .+12 ; 0x2dca0 dirBlock_ = 0; dirIndex_ = 0; return true; fail: return false; 2dc94: 80 e0 ldi r24, 0x00 ; 0 } 2dc96: df 91 pop r29 2dc98: cf 91 pop r28 2dc9a: 1f 91 pop r17 2dc9c: 0f 91 pop r16 2dc9e: 08 95 ret 2dca0: 8b 01 movw r16, r22 2dca2: ec 01 movw r28, r24 2dca4: fb 01 movw r30, r22 2dca6: 87 89 ldd r24, Z+23 ; 0x17 */ bool SdBaseFile::openRoot(SdVolume* vol) { // error if file is already open if (isOpen()) goto fail; if (vol->fatType() == 16 || (FAT12_SUPPORT && vol->fatType() == 12)) { 2dca8: 80 31 cpi r24, 0x10 ; 16 2dcaa: 39 f5 brne .+78 ; 0x2dcfa type_ = FAT_FILE_TYPE_ROOT_FIXED; 2dcac: 82 e0 ldi r24, 0x02 ; 2 2dcae: 8b 83 std Y+3, r24 ; 0x03 firstCluster_ = 0; 2dcb0: 1d 8a std Y+21, r1 ; 0x15 2dcb2: 1e 8a std Y+22, r1 ; 0x16 2dcb4: 1f 8a std Y+23, r1 ; 0x17 2dcb6: 18 8e std Y+24, r1 ; 0x18 fileSize_ = 32 * vol->rootDirEntryCount(); 2dcb8: 80 8d ldd r24, Z+24 ; 0x18 2dcba: 91 8d ldd r25, Z+25 ; 0x19 2dcbc: b0 e0 ldi r27, 0x00 ; 0 2dcbe: a0 e0 ldi r26, 0x00 ; 0 2dcc0: 25 e0 ldi r18, 0x05 ; 5 2dcc2: 88 0f add r24, r24 2dcc4: 99 1f adc r25, r25 2dcc6: aa 1f adc r26, r26 2dcc8: bb 1f adc r27, r27 2dcca: 2a 95 dec r18 2dccc: d1 f7 brne .-12 ; 0x2dcc2 2dcce: 89 8b std Y+17, r24 ; 0x11 2dcd0: 9a 8b std Y+18, r25 ; 0x12 2dcd2: ab 8b std Y+19, r26 ; 0x13 2dcd4: bc 8b std Y+20, r27 ; 0x14 if (!vol->chainSize(firstCluster_, &fileSize_)) goto fail; } else { // volume is not initialized, invalid, or FAT12 without support return false; } vol_ = vol; 2dcd6: 1a 8f std Y+26, r17 ; 0x1a 2dcd8: 09 8f std Y+25, r16 ; 0x19 // read only flags_ = O_READ; 2dcda: 81 e0 ldi r24, 0x01 ; 1 2dcdc: 89 83 std Y+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 2dcde: 1c 82 std Y+4, r1 ; 0x04 2dce0: 1d 82 std Y+5, r1 ; 0x05 2dce2: 1e 82 std Y+6, r1 ; 0x06 2dce4: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 2dce6: 18 86 std Y+8, r1 ; 0x08 2dce8: 19 86 std Y+9, r1 ; 0x09 2dcea: 1a 86 std Y+10, r1 ; 0x0a 2dcec: 1b 86 std Y+11, r1 ; 0x0b // root has no directory entry dirBlock_ = 0; 2dcee: 1c 86 std Y+12, r1 ; 0x0c 2dcf0: 1d 86 std Y+13, r1 ; 0x0d 2dcf2: 1e 86 std Y+14, r1 ; 0x0e 2dcf4: 1f 86 std Y+15, r1 ; 0x0f dirIndex_ = 0; 2dcf6: 18 8a std Y+16, r1 ; 0x10 2dcf8: ce cf rjmp .-100 ; 0x2dc96 if (vol->fatType() == 16 || (FAT12_SUPPORT && vol->fatType() == 12)) { type_ = FAT_FILE_TYPE_ROOT_FIXED; firstCluster_ = 0; fileSize_ = 32 * vol->rootDirEntryCount(); } else if (vol->fatType() == 32) { 2dcfa: 80 32 cpi r24, 0x20 ; 32 2dcfc: 59 f6 brne .-106 ; 0x2dc94 type_ = FAT_FILE_TYPE_ROOT32; 2dcfe: 83 e0 ldi r24, 0x03 ; 3 2dd00: 8b 83 std Y+3, r24 ; 0x03 int32_t freeClusterCount(); /** \return The number of entries in the root directory for FAT16 volumes. */ uint32_t rootDirEntryCount() const {return rootDirEntryCount_;} /** \return The logical block number for the start of the root directory on FAT16 volumes or the first cluster number on FAT32 volumes. */ uint32_t rootDirStart() const {return rootDirStart_;} 2dd02: 42 8d ldd r20, Z+26 ; 0x1a 2dd04: 53 8d ldd r21, Z+27 ; 0x1b 2dd06: 64 8d ldd r22, Z+28 ; 0x1c 2dd08: 75 8d ldd r23, Z+29 ; 0x1d firstCluster_ = vol->rootDirStart(); 2dd0a: 4d 8b std Y+21, r20 ; 0x15 2dd0c: 5e 8b std Y+22, r21 ; 0x16 2dd0e: 6f 8b std Y+23, r22 ; 0x17 2dd10: 78 8f std Y+24, r23 ; 0x18 if (!vol->chainSize(firstCluster_, &fileSize_)) goto fail; 2dd12: 9e 01 movw r18, r28 2dd14: 2f 5e subi r18, 0xEF ; 239 2dd16: 3f 4f sbci r19, 0xFF ; 255 2dd18: c8 01 movw r24, r16 2dd1a: 0f 94 bf 37 call 0x26f7e ; 0x26f7e 2dd1e: 81 11 cpse r24, r1 2dd20: da cf rjmp .-76 ; 0x2dcd6 2dd22: b8 cf rjmp .-144 ; 0x2dc94 0002dd24 : * * \return The value one, true, is returned for success and * the value zero, false, is returned for failure. * Reasons for failure include no file is open or an I/O error. */ bool SdBaseFile::close() { 2dd24: cf 93 push r28 2dd26: df 93 push r29 2dd28: ec 01 movw r28, r24 bool rtn = sync(); 2dd2a: 0f 94 0a 39 call 0x27214 ; 0x27214 type_ = FAT_FILE_TYPE_CLOSED; 2dd2e: 1b 82 std Y+3, r1 ; 0x03 return rtn; } 2dd30: df 91 pop r29 2dd32: cf 91 pop r28 2dd34: 08 95 ret 0002dd36 : return false; } //------------------------------------------------------------------------------ // cache a file's directory entry // return pointer to cached entry or null for failure dir_t* SdBaseFile::cacheDirEntry(uint8_t action) { 2dd36: cf 93 push r28 2dd38: df 93 push r29 2dd3a: ec 01 movw r28, r24 if (!vol_->cacheRawBlock(dirBlock_, action)) goto fail; 2dd3c: 46 2f mov r20, r22 2dd3e: 41 70 andi r20, 0x01 ; 1 2dd40: 6c 85 ldd r22, Y+12 ; 0x0c 2dd42: 7d 85 ldd r23, Y+13 ; 0x0d 2dd44: 8e 85 ldd r24, Y+14 ; 0x0e 2dd46: 9f 85 ldd r25, Y+15 ; 0x0f 2dd48: 0f 94 6d 36 call 0x26cda ; 0x26cda 2dd4c: 88 23 and r24, r24 2dd4e: 51 f0 breq .+20 ; 0x2dd64 return vol_->cache()->dir + dirIndex_; 2dd50: 88 89 ldd r24, Y+16 ; 0x10 2dd52: 20 e2 ldi r18, 0x20 ; 32 2dd54: 82 9f mul r24, r18 2dd56: c0 01 movw r24, r0 2dd58: 11 24 eor r1, r1 2dd5a: 87 52 subi r24, 0x27 ; 39 2dd5c: 92 4f sbci r25, 0xF2 ; 242 fail: return 0; } 2dd5e: df 91 pop r29 2dd60: cf 91 pop r28 2dd62: 08 95 ret dir_t* SdBaseFile::cacheDirEntry(uint8_t action) { if (!vol_->cacheRawBlock(dirBlock_, action)) goto fail; return vol_->cache()->dir + dirIndex_; fail: return 0; 2dd64: 90 e0 ldi r25, 0x00 ; 0 2dd66: 80 e0 ldi r24, 0x00 ; 0 2dd68: fa cf rjmp .-12 ; 0x2dd5e 0002dd6a : * \param[out] name An array of 13 characters for the file's name. * * \return The value one, true, is returned for success and * the value zero, false, is returned for failure. */ bool SdBaseFile::getFilename(char* name) { 2dd6a: cf 93 push r28 2dd6c: df 93 push r29 2dd6e: eb 01 movw r28, r22 2dd70: fc 01 movw r30, r24 2dd72: 23 81 ldd r18, Z+3 ; 0x03 if (!isOpen()) return false; 2dd74: 21 11 cpse r18, r1 2dd76: 04 c0 rjmp .+8 ; 0x2dd80 2dd78: 80 e0 ldi r24, 0x00 ; 0 if (!p) return false; // format name dirName(*p, name); return true; } 2dd7a: df 91 pop r29 2dd7c: cf 91 pop r28 2dd7e: 08 95 ret bool isOpen() const {return type_ != FAT_FILE_TYPE_CLOSED;} /** \return True if this is a subdirectory else false. */ bool isSubDir() const {return type_ == FAT_FILE_TYPE_SUBDIR;} /** \return True if this is the root directory. */ bool isRoot() const { return type_ == FAT_FILE_TYPE_ROOT_FIXED || type_ == FAT_FILE_TYPE_ROOT32; 2dd80: 22 50 subi r18, 0x02 ; 2 * the value zero, false, is returned for failure. */ bool SdBaseFile::getFilename(char* name) { if (!isOpen()) return false; if (isRoot()) { 2dd82: 22 30 cpi r18, 0x02 ; 2 2dd84: 28 f4 brcc .+10 ; 0x2dd90 name[0] = '/'; 2dd86: 8f e2 ldi r24, 0x2F ; 47 2dd88: 88 83 st Y, r24 name[1] = '\0'; 2dd8a: 19 82 std Y+1, r1 ; 0x01 dir_t* p = cacheDirEntry(SdVolume::CACHE_FOR_READ); if (!p) return false; // format name dirName(*p, name); return true; 2dd8c: 81 e0 ldi r24, 0x01 ; 1 2dd8e: f5 cf rjmp .-22 ; 0x2dd7a name[0] = '/'; name[1] = '\0'; return true; } // cache entry dir_t* p = cacheDirEntry(SdVolume::CACHE_FOR_READ); 2dd90: 60 e0 ldi r22, 0x00 ; 0 2dd92: 0f 94 9b 6e call 0x2dd36 ; 0x2dd36 if (!p) return false; 2dd96: 00 97 sbiw r24, 0x00 ; 0 2dd98: 79 f3 breq .-34 ; 0x2dd78 2dd9a: dc 01 movw r26, r24 * * \param[in] dir The directory structure containing the name. * \param[out] name A 13 byte char array for the formatted name. */ void SdBaseFile::dirName(const dir_t& dir, char* name) { uint8_t j = 0; 2dd9c: 60 e0 ldi r22, 0x00 ; 0 for (uint8_t i = 0; i < 11; i++) { 2dd9e: 80 e0 ldi r24, 0x00 ; 0 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; 2dda0: 9e e2 ldi r25, 0x2E ; 46 * \param[out] name A 13 byte char array for the formatted name. */ void SdBaseFile::dirName(const dir_t& dir, char* name) { uint8_t j = 0; for (uint8_t i = 0; i < 11; i++) { if (dir.name[i] == ' ')continue; 2dda2: 2d 91 ld r18, X+ 2dda4: 20 32 cpi r18, 0x20 ; 32 2dda6: 99 f0 breq .+38 ; 0x2ddce if (i == 8) name[j++] = '.'; 2dda8: 88 30 cpi r24, 0x08 ; 8 2ddaa: 31 f4 brne .+12 ; 0x2ddb8 2ddac: 9e 01 movw r18, r28 2ddae: 26 0f add r18, r22 2ddb0: 31 1d adc r19, r1 2ddb2: f9 01 movw r30, r18 2ddb4: 90 83 st Z, r25 2ddb6: 6f 5f subi r22, 0xFF ; 255 name[j++] = dir.name[i]; 2ddb8: 9e 01 movw r18, r28 2ddba: 26 0f add r18, r22 2ddbc: 31 1d adc r19, r1 2ddbe: ad 01 movw r20, r26 2ddc0: 41 50 subi r20, 0x01 ; 1 2ddc2: 51 09 sbc r21, r1 2ddc4: fa 01 movw r30, r20 2ddc6: 40 81 ld r20, Z 2ddc8: f9 01 movw r30, r18 2ddca: 40 83 st Z, r20 2ddcc: 6f 5f subi r22, 0xFF ; 255 * \param[in] dir The directory structure containing the name. * \param[out] name A 13 byte char array for the formatted name. */ void SdBaseFile::dirName(const dir_t& dir, char* name) { uint8_t j = 0; for (uint8_t i = 0; i < 11; i++) { 2ddce: 8f 5f subi r24, 0xFF ; 255 2ddd0: 8b 30 cpi r24, 0x0B ; 11 2ddd2: 39 f7 brne .-50 ; 0x2dda2 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; name[j++] = dir.name[i]; } name[j] = 0; 2ddd4: fe 01 movw r30, r28 2ddd6: e6 0f add r30, r22 2ddd8: f1 1d adc r31, r1 2ddda: 10 82 st Z, r1 2dddc: d7 cf rjmp .-82 ; 0x2dd8c 0002ddde : SdBaseFile* SdBaseFile::cwd_ = 0; // callback function for date/time void (*SdBaseFile::dateTime_)(uint16_t* date, uint16_t* time) = 0; //------------------------------------------------------------------------------ // add a cluster to a file bool SdBaseFile::addCluster() { 2ddde: 3f 92 push r3 2dde0: 4f 92 push r4 2dde2: 5f 92 push r5 2dde4: 6f 92 push r6 2dde6: 7f 92 push r7 2dde8: 8f 92 push r8 2ddea: 9f 92 push r9 2ddec: af 92 push r10 2ddee: bf 92 push r11 2ddf0: cf 92 push r12 2ddf2: df 92 push r13 2ddf4: ef 92 push r14 2ddf6: ff 92 push r15 2ddf8: 0f 93 push r16 2ddfa: 1f 93 push r17 2ddfc: cf 93 push r28 2ddfe: df 93 push r29 2de00: cd b7 in r28, 0x3d ; 61 2de02: de b7 in r29, 0x3e ; 62 2de04: 2c 97 sbiw r28, 0x0c ; 12 2de06: 0f b6 in r0, 0x3f ; 63 2de08: f8 94 cli 2de0a: de bf out 0x3e, r29 ; 62 2de0c: 0f be out 0x3f, r0 ; 63 2de0e: cd bf out 0x3d, r28 ; 61 2de10: 5c 01 movw r10, r24 if (!vol_->allocContiguous(1, &curCluster_)) goto fail; 2de12: dc 01 movw r26, r24 2de14: 59 96 adiw r26, 0x19 ; 25 2de16: 8d 90 ld r8, X+ 2de18: 9c 90 ld r9, X // start of group uint32_t bgnCluster; // end of group uint32_t endCluster; // last cluster of FAT uint32_t fatEnd = clusterCount_ + 1; 2de1a: f4 01 movw r30, r8 2de1c: 81 85 ldd r24, Z+9 ; 0x09 2de1e: 92 85 ldd r25, Z+10 ; 0x0a 2de20: a3 85 ldd r26, Z+11 ; 0x0b 2de22: b4 85 ldd r27, Z+12 ; 0x0c 2de24: 9c 01 movw r18, r24 2de26: ad 01 movw r20, r26 2de28: 2f 5f subi r18, 0xFF ; 255 2de2a: 3f 4f sbci r19, 0xFF ; 255 2de2c: 4f 4f sbci r20, 0xFF ; 255 2de2e: 5f 4f sbci r21, 0xFF ; 255 2de30: 29 87 std Y+9, r18 ; 0x09 2de32: 3a 87 std Y+10, r19 ; 0x0a 2de34: 4b 87 std Y+11, r20 ; 0x0b 2de36: 5c 87 std Y+12, r21 ; 0x0c // flag to save place to start next search bool setStart; // set search start cluster if (*curCluster) { 2de38: d5 01 movw r26, r10 2de3a: 14 96 adiw r26, 0x04 ; 4 2de3c: 4d 90 ld r4, X+ 2de3e: 5d 90 ld r5, X+ 2de40: 6d 90 ld r6, X+ 2de42: 7c 90 ld r7, X 2de44: 17 97 sbiw r26, 0x07 ; 7 2de46: 41 14 cp r4, r1 2de48: 51 04 cpc r5, r1 2de4a: 61 04 cpc r6, r1 2de4c: 71 04 cpc r7, r1 2de4e: 09 f4 brne .+2 ; 0x2de52 2de50: 59 c0 rjmp .+178 ; 0x2df04 // try to make file contiguous bgnCluster = *curCluster + 1; 2de52: bf ef ldi r27, 0xFF ; 255 2de54: 4b 1a sub r4, r27 2de56: 5b 0a sbc r5, r27 2de58: 6b 0a sbc r6, r27 2de5a: 7b 0a sbc r7, r27 // don't save new start location setStart = false; 2de5c: 31 2c mov r3, r1 // save next search start if one cluster setStart = count == 1; } // end of group endCluster = bgnCluster; 2de5e: 73 01 movw r14, r6 2de60: 62 01 movw r12, r4 // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 2de62: 1d 82 std Y+5, r1 ; 0x05 2de64: 1e 82 std Y+6, r1 ; 0x06 2de66: 1f 82 std Y+7, r1 ; 0x07 2de68: 18 86 std Y+8, r1 ; 0x08 // can't find space checked all clusters if (n >= clusterCount_) goto fail; 2de6a: f4 01 movw r30, r8 2de6c: 81 85 ldd r24, Z+9 ; 0x09 2de6e: 92 85 ldd r25, Z+10 ; 0x0a 2de70: a3 85 ldd r26, Z+11 ; 0x0b 2de72: b4 85 ldd r27, Z+12 ; 0x0c 2de74: 2d 81 ldd r18, Y+5 ; 0x05 2de76: 3e 81 ldd r19, Y+6 ; 0x06 2de78: 4f 81 ldd r20, Y+7 ; 0x07 2de7a: 58 85 ldd r21, Y+8 ; 0x08 2de7c: 28 17 cp r18, r24 2de7e: 39 07 cpc r19, r25 2de80: 4a 07 cpc r20, r26 2de82: 5b 07 cpc r21, r27 2de84: 08 f0 brcs .+2 ; 0x2de88 2de86: 56 c0 rjmp .+172 ; 0x2df34 // past end - start from beginning of FAT if (endCluster > fatEnd) { 2de88: 89 85 ldd r24, Y+9 ; 0x09 2de8a: 9a 85 ldd r25, Y+10 ; 0x0a 2de8c: ab 85 ldd r26, Y+11 ; 0x0b 2de8e: bc 85 ldd r27, Y+12 ; 0x0c 2de90: 8c 15 cp r24, r12 2de92: 9d 05 cpc r25, r13 2de94: ae 05 cpc r26, r14 2de96: bf 05 cpc r27, r15 2de98: 50 f4 brcc .+20 ; 0x2deae bgnCluster = endCluster = 2; 2de9a: 82 e0 ldi r24, 0x02 ; 2 2de9c: c8 2e mov r12, r24 2de9e: d1 2c mov r13, r1 2dea0: e1 2c mov r14, r1 2dea2: f1 2c mov r15, r1 2dea4: 92 e0 ldi r25, 0x02 ; 2 2dea6: 49 2e mov r4, r25 2dea8: 51 2c mov r5, r1 2deaa: 61 2c mov r6, r1 2deac: 71 2c mov r7, r1 } uint32_t f; if (!fatGet(endCluster, &f)) goto fail; 2deae: 9e 01 movw r18, r28 2deb0: 2f 5f subi r18, 0xFF ; 255 2deb2: 3f 4f sbci r19, 0xFF ; 255 2deb4: b7 01 movw r22, r14 2deb6: a6 01 movw r20, r12 2deb8: c4 01 movw r24, r8 2deba: 0f 94 3c 37 call 0x26e78 ; 0x26e78 2debe: 88 23 and r24, r24 2dec0: c9 f1 breq .+114 ; 0x2df34 if (f != 0) { 2dec2: 89 81 ldd r24, Y+1 ; 0x01 2dec4: 9a 81 ldd r25, Y+2 ; 0x02 2dec6: ab 81 ldd r26, Y+3 ; 0x03 2dec8: bc 81 ldd r27, Y+4 ; 0x04 2deca: 89 2b or r24, r25 2decc: 8a 2b or r24, r26 2dece: 8b 2b or r24, r27 2ded0: 01 f1 breq .+64 ; 0x2df12 // cluster in use try next cluster as bgnCluster bgnCluster = endCluster + 1; 2ded2: 26 01 movw r4, r12 2ded4: 37 01 movw r6, r14 2ded6: 9f ef ldi r25, 0xFF ; 255 2ded8: 49 1a sub r4, r25 2deda: 59 0a sbc r5, r25 2dedc: 69 0a sbc r6, r25 2dede: 79 0a sbc r7, r25 } // end of group endCluster = bgnCluster; // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 2dee0: 2d 81 ldd r18, Y+5 ; 0x05 2dee2: 3e 81 ldd r19, Y+6 ; 0x06 2dee4: 4f 81 ldd r20, Y+7 ; 0x07 2dee6: 58 85 ldd r21, Y+8 ; 0x08 2dee8: 2f 5f subi r18, 0xFF ; 255 2deea: 3f 4f sbci r19, 0xFF ; 255 2deec: 4f 4f sbci r20, 0xFF ; 255 2deee: 5f 4f sbci r21, 0xFF ; 255 2def0: 2d 83 std Y+5, r18 ; 0x05 2def2: 3e 83 std Y+6, r19 ; 0x06 2def4: 4f 83 std Y+7, r20 ; 0x07 2def6: 58 87 std Y+8, r21 ; 0x08 2def8: 3f ef ldi r19, 0xFF ; 255 2defa: c3 1a sub r12, r19 2defc: d3 0a sbc r13, r19 2defe: e3 0a sbc r14, r19 2df00: f3 0a sbc r15, r19 2df02: b3 cf rjmp .-154 ; 0x2de6a // don't save new start location setStart = false; } else { // start at likely place for free cluster bgnCluster = allocSearchStart_; 2df04: 40 80 ld r4, Z 2df06: 51 80 ldd r5, Z+1 ; 0x01 2df08: 62 80 ldd r6, Z+2 ; 0x02 2df0a: 73 80 ldd r7, Z+3 ; 0x03 // save next search start if one cluster setStart = count == 1; 2df0c: 33 24 eor r3, r3 2df0e: 33 94 inc r3 2df10: a6 cf rjmp .-180 ; 0x2de5e if (!fatGet(endCluster, &f)) goto fail; if (f != 0) { // cluster in use try next cluster as bgnCluster bgnCluster = endCluster + 1; } else if ((endCluster - bgnCluster + 1) == count) { 2df12: c4 14 cp r12, r4 2df14: d5 04 cpc r13, r5 2df16: e6 04 cpc r14, r6 2df18: f7 04 cpc r15, r7 2df1a: 11 f7 brne .-60 ; 0x2dee0 void cacheSetDirty() {cacheDirty_ |= CACHE_FOR_WRITE;} bool chainSize(uint32_t beginCluster, uint32_t* size); bool fatGet(uint32_t cluster, uint32_t* value); bool fatPut(uint32_t cluster, uint32_t value); bool fatPutEOC(uint32_t cluster) { return fatPut(cluster, 0x0FFFFFFF); 2df1c: 0f ef ldi r16, 0xFF ; 255 2df1e: 1f ef ldi r17, 0xFF ; 255 2df20: 2f ef ldi r18, 0xFF ; 255 2df22: 3f e0 ldi r19, 0x0F ; 15 2df24: b7 01 movw r22, r14 2df26: a6 01 movw r20, r12 2df28: c4 01 movw r24, r8 2df2a: 0f 94 aa 36 call 0x26d54 ; 0x26d54 2df2e: 78 2e mov r7, r24 // done - found space break; } } // mark end of chain if (!fatPutEOC(endCluster)) goto fail; 2df30: 81 11 cpse r24, r1 2df32: 1a c0 rjmp .+52 ; 0x2df68 flags_ |= F_FILE_DIR_DIRTY; } return true; fail: return false; 2df34: 71 2c mov r7, r1 } 2df36: 87 2d mov r24, r7 2df38: 2c 96 adiw r28, 0x0c ; 12 2df3a: 0f b6 in r0, 0x3f ; 63 2df3c: f8 94 cli 2df3e: de bf out 0x3e, r29 ; 62 2df40: 0f be out 0x3f, r0 ; 63 2df42: cd bf out 0x3d, r28 ; 61 2df44: df 91 pop r29 2df46: cf 91 pop r28 2df48: 1f 91 pop r17 2df4a: 0f 91 pop r16 2df4c: ff 90 pop r15 2df4e: ef 90 pop r14 2df50: df 90 pop r13 2df52: cf 90 pop r12 2df54: bf 90 pop r11 2df56: af 90 pop r10 2df58: 9f 90 pop r9 2df5a: 8f 90 pop r8 2df5c: 7f 90 pop r7 2df5e: 6f 90 pop r6 2df60: 5f 90 pop r5 2df62: 4f 90 pop r4 2df64: 3f 90 pop r3 2df66: 08 95 ret // link clusters while (endCluster > bgnCluster) { if (!fatPut(endCluster - 1, endCluster)) goto fail; endCluster--; } if (*curCluster != 0) { 2df68: f5 01 movw r30, r10 2df6a: 44 81 ldd r20, Z+4 ; 0x04 2df6c: 55 81 ldd r21, Z+5 ; 0x05 2df6e: 66 81 ldd r22, Z+6 ; 0x06 2df70: 77 81 ldd r23, Z+7 ; 0x07 2df72: 41 15 cp r20, r1 2df74: 51 05 cpc r21, r1 2df76: 61 05 cpc r22, r1 2df78: 71 05 cpc r23, r1 2df7a: 39 f0 breq .+14 ; 0x2df8a // connect chains if (!fatPut(*curCluster, bgnCluster)) goto fail; 2df7c: 97 01 movw r18, r14 2df7e: 86 01 movw r16, r12 2df80: c4 01 movw r24, r8 2df82: 0f 94 aa 36 call 0x26d54 ; 0x26d54 2df86: 88 23 and r24, r24 2df88: a9 f2 breq .-86 ; 0x2df34 } // return first cluster number to caller *curCluster = bgnCluster; 2df8a: d5 01 movw r26, r10 2df8c: 14 96 adiw r26, 0x04 ; 4 2df8e: cd 92 st X+, r12 2df90: dd 92 st X+, r13 2df92: ed 92 st X+, r14 2df94: fc 92 st X, r15 2df96: 17 97 sbiw r26, 0x07 ; 7 // remember possible next free cluster if (setStart) allocSearchStart_ = bgnCluster + 1; 2df98: 33 20 and r3, r3 2df9a: 51 f0 breq .+20 ; 0x2dfb0 2df9c: d7 01 movw r26, r14 2df9e: c6 01 movw r24, r12 2dfa0: 01 96 adiw r24, 0x01 ; 1 2dfa2: a1 1d adc r26, r1 2dfa4: b1 1d adc r27, r1 2dfa6: f4 01 movw r30, r8 2dfa8: 80 83 st Z, r24 2dfaa: 91 83 std Z+1, r25 ; 0x01 2dfac: a2 83 std Z+2, r26 ; 0x02 2dfae: b3 83 std Z+3, r27 ; 0x03 // add a cluster to a file bool SdBaseFile::addCluster() { if (!vol_->allocContiguous(1, &curCluster_)) goto fail; // if first cluster of file link to directory entry if (firstCluster_ == 0) { 2dfb0: f5 01 movw r30, r10 2dfb2: 85 89 ldd r24, Z+21 ; 0x15 2dfb4: 96 89 ldd r25, Z+22 ; 0x16 2dfb6: a7 89 ldd r26, Z+23 ; 0x17 2dfb8: b0 8d ldd r27, Z+24 ; 0x18 2dfba: 89 2b or r24, r25 2dfbc: 8a 2b or r24, r26 2dfbe: 8b 2b or r24, r27 2dfc0: 09 f0 breq .+2 ; 0x2dfc4 2dfc2: b9 cf rjmp .-142 ; 0x2df36 firstCluster_ = curCluster_; 2dfc4: c5 8a std Z+21, r12 ; 0x15 2dfc6: d6 8a std Z+22, r13 ; 0x16 2dfc8: e7 8a std Z+23, r14 ; 0x17 2dfca: f0 8e std Z+24, r15 ; 0x18 flags_ |= F_FILE_DIR_DIRTY; 2dfcc: 81 81 ldd r24, Z+1 ; 0x01 2dfce: 80 68 ori r24, 0x80 ; 128 2dfd0: 81 83 std Z+1, r24 ; 0x01 2dfd2: b1 cf rjmp .-158 ; 0x2df36 0002dfd4 : buf[nbyte] = SPDR; } //------------------------------------------------------------------------------ /** SPI send a byte */ static void spiSend(uint8_t b) { SPDR = b; 2dfd4: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2dfd6: 0d b4 in r0, 0x2d ; 45 2dfd8: 07 fe sbrs r0, 7 2dfda: fd cf rjmp .-6 ; 0x2dfd6 } 2dfdc: 08 95 ret 0002dfde : SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; } //------------------------------------------------------------------------------ /** SPI receive a byte */ static uint8_t spiRec() { SPDR = 0XFF; 2dfde: 8f ef ldi r24, 0xFF ; 255 2dfe0: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2dfe2: 0d b4 in r0, 0x2d ; 45 2dfe4: 07 fe sbrs r0, 7 2dfe6: fd cf rjmp .-6 ; 0x2dfe2 return SPDR; 2dfe8: 8e b5 in r24, 0x2e ; 46 } 2dfea: 08 95 ret 0002dfec : } } #endif // SOFTWARE_SPI //------------------------------------------------------------------------------ // send command and return error code. Return zero for OK uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) { 2dfec: 8f 92 push r8 2dfee: 9f 92 push r9 2dff0: af 92 push r10 2dff2: bf 92 push r11 2dff4: ef 92 push r14 2dff6: ff 92 push r15 2dff8: 0f 93 push r16 2dffa: 1f 93 push r17 2dffc: cf 93 push r28 2dffe: 7c 01 movw r14, r24 2e000: c6 2f mov r28, r22 2e002: 49 01 movw r8, r18 2e004: 5a 01 movw r10, r20 WRITE(SDSS, 1); } //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); 2e006: fc 01 movw r30, r24 2e008: 91 81 ldd r25, Z+1 ; 0x01 * Initialize hardware SPI * Set SCK rate to F_CPU/pow(2, 1 + spiRate) for spiRate [0,6] */ static void spiInit(uint8_t spiRate) { // See avr processor documentation SPCR = (1 << SPE) | (1 << MSTR) | (spiRate >> 1); 2e00a: 89 2f mov r24, r25 2e00c: 80 6a ori r24, 0xA0 ; 160 2e00e: 86 95 lsr r24 2e010: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 2e012: 90 fd sbrc r25, 0 2e014: 03 c0 rjmp .+6 ; 0x2e01c 2e016: 81 e0 ldi r24, 0x01 ; 1 2e018: 96 30 cpi r25, 0x06 ; 6 2e01a: 09 f4 brne .+2 ; 0x2e01e 2e01c: 80 e0 ldi r24, 0x00 ; 0 2e01e: 8d bd out 0x2d, r24 ; 45 //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); #endif // SOFTWARE_SPI WRITE(SDSS, 0); 2e020: 28 98 cbi 0x05, 0 ; 5 uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) { // select card chipSelectLow(); // wait up to 300 ms if busy waitNotBusy(300); 2e022: 8c e2 ldi r24, 0x2C ; 44 2e024: 91 e0 ldi r25, 0x01 ; 1 2e026: 0f 94 c9 41 call 0x28392 ; 0x28392 // send command spiSend(cmd | 0x40); 2e02a: 8c 2f mov r24, r28 2e02c: 80 64 ori r24, 0x40 ; 64 2e02e: 0f 94 ea 6f call 0x2dfd4 ; 0x2dfd4 2e032: 08 e1 ldi r16, 0x18 ; 24 2e034: 10 e0 ldi r17, 0x00 ; 0 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); 2e036: d5 01 movw r26, r10 2e038: c4 01 movw r24, r8 2e03a: 00 2e mov r0, r16 2e03c: 04 c0 rjmp .+8 ; 0x2e046 2e03e: b6 95 lsr r27 2e040: a7 95 ror r26 2e042: 97 95 ror r25 2e044: 87 95 ror r24 2e046: 0a 94 dec r0 2e048: d2 f7 brpl .-12 ; 0x2e03e 2e04a: 0f 94 ea 6f call 0x2dfd4 ; 0x2dfd4 2e04e: 08 50 subi r16, 0x08 ; 8 2e050: 11 09 sbc r17, r1 2e052: 08 3f cpi r16, 0xF8 ; 248 2e054: ff ef ldi r31, 0xFF ; 255 2e056: 1f 07 cpc r17, r31 2e058: 71 f7 brne .-36 ; 0x2e036 // send CRC uint8_t crc = 0XFF; if (cmd == CMD0) crc = 0X95; // correct crc for CMD0 with arg 0 2e05a: 85 e9 ldi r24, 0x95 ; 149 2e05c: cc 23 and r28, r28 2e05e: 21 f0 breq .+8 ; 0x2e068 if (cmd == CMD8) crc = 0X87; // correct crc for CMD8 with arg 0X1AA 2e060: 87 e8 ldi r24, 0x87 ; 135 2e062: c8 30 cpi r28, 0x08 ; 8 2e064: 09 f0 breq .+2 ; 0x2e068 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 2e066: 8f ef ldi r24, 0xFF ; 255 if (cmd == CMD0) crc = 0X95; // correct crc for CMD0 with arg 0 if (cmd == CMD8) crc = 0X87; // correct crc for CMD8 with arg 0X1AA spiSend(crc); 2e068: 0f 94 ea 6f call 0x2dfd4 ; 0x2dfd4 // skip stuff byte for stop read if (cmd == CMD12) spiRec(); 2e06c: cc 30 cpi r28, 0x0C ; 12 2e06e: 11 f4 brne .+4 ; 0x2e074 2e070: 0f 94 ef 6f call 0x2dfde ; 0x2dfde // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 2e074: c0 e0 ldi r28, 0x00 ; 0 // skip stuff byte for stop read if (cmd == CMD12) spiRec(); // wait for response for (uint8_t i = 0; ((status_ = spiRec()) & 0X80) && i != 0XFF; i++) { /* Intentionally left empty */ } 2e076: 0f 94 ef 6f call 0x2dfde ; 0x2dfde 2e07a: f7 01 movw r30, r14 2e07c: 82 83 std Z+2, r24 ; 0x02 2e07e: 87 ff sbrs r24, 7 2e080: 04 c0 rjmp .+8 ; 0x2e08a 2e082: cf 3f cpi r28, 0xFF ; 255 2e084: 11 f0 breq .+4 ; 0x2e08a 2e086: cf 5f subi r28, 0xFF ; 255 2e088: f6 cf rjmp .-20 ; 0x2e076 return status_; } 2e08a: cf 91 pop r28 2e08c: 1f 91 pop r17 2e08e: 0f 91 pop r16 2e090: ff 90 pop r15 2e092: ef 90 pop r14 2e094: bf 90 pop r11 2e096: af 90 pop r10 2e098: 9f 90 pop r9 2e09a: 8f 90 pop r8 2e09c: 08 95 ret 0002e09e : * \param[in] blockNumber Logical block to be written. * \param[in] src Pointer to the location of the data to be written. * \return The value one, true, is returned for success and * the value zero, false, is returned for failure. */ bool Sd2Card::writeBlock(uint32_t blockNumber, const uint8_t* src) { 2e09e: 0f 93 push r16 2e0a0: 1f 93 push r17 2e0a2: cf 93 push r28 2e0a4: df 93 push r29 2e0a6: ec 01 movw r28, r24 2e0a8: 89 01 movw r16, r18 // use address if not SDHC card if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; 2e0aa: 8b 81 ldd r24, Y+3 ; 0x03 2e0ac: 83 30 cpi r24, 0x03 ; 3 2e0ae: 39 f0 breq .+14 ; 0x2e0be 2e0b0: 89 e0 ldi r24, 0x09 ; 9 2e0b2: 44 0f add r20, r20 2e0b4: 55 1f adc r21, r21 2e0b6: 66 1f adc r22, r22 2e0b8: 77 1f adc r23, r23 2e0ba: 8a 95 dec r24 2e0bc: d1 f7 brne .-12 ; 0x2e0b2 if (cardCommand(CMD24, blockNumber)) { 2e0be: 9a 01 movw r18, r20 2e0c0: ab 01 movw r20, r22 2e0c2: 68 e1 ldi r22, 0x18 ; 24 2e0c4: ce 01 movw r24, r28 2e0c6: 0f 94 f6 6f call 0x2dfec ; 0x2dfec 2e0ca: 88 23 and r24, r24 2e0cc: 19 f0 breq .+6 ; 0x2e0d4 2e0ce: 86 e0 ldi r24, 0x06 ; 6 2e0d0: 88 83 st Y, r24 2e0d2: 39 c0 rjmp .+114 ; 0x2e146 } //------------------------------------------------------------------------------ /** SPI send block - only one call so force inline */ static inline __attribute__((always_inline)) void spiSendBlock(uint8_t token, const uint8_t* buf) { SPDR = token; 2e0d4: 8e ef ldi r24, 0xFE ; 254 2e0d6: 8e bd out 0x2e, r24 ; 46 2e0d8: f8 01 movw r30, r16 2e0da: c8 01 movw r24, r16 2e0dc: 9e 5f subi r25, 0xFE ; 254 for (uint16_t i = 0; i < 512; i += 2) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e0de: 0d b4 in r0, 0x2d ; 45 2e0e0: 07 fe sbrs r0, 7 2e0e2: fd cf rjmp .-6 ; 0x2e0de SPDR = buf[i]; 2e0e4: 20 81 ld r18, Z 2e0e6: 2e bd out 0x2e, r18 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e0e8: 0d b4 in r0, 0x2d ; 45 2e0ea: 07 fe sbrs r0, 7 2e0ec: fd cf rjmp .-6 ; 0x2e0e8 SPDR = buf[i + 1]; 2e0ee: 21 81 ldd r18, Z+1 ; 0x01 2e0f0: 2e bd out 0x2e, r18 ; 46 2e0f2: 32 96 adiw r30, 0x02 ; 2 //------------------------------------------------------------------------------ /** SPI send block - only one call so force inline */ static inline __attribute__((always_inline)) void spiSendBlock(uint8_t token, const uint8_t* buf) { SPDR = token; for (uint16_t i = 0; i < 512; i += 2) { 2e0f4: e8 17 cp r30, r24 2e0f6: f9 07 cpc r31, r25 2e0f8: 91 f7 brne .-28 ; 0x2e0de while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } SPDR = buf[i]; while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } SPDR = buf[i + 1]; } while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e0fa: 0d b4 in r0, 0x2d ; 45 2e0fc: 07 fe sbrs r0, 7 2e0fe: fd cf rjmp .-6 ; 0x2e0fa //------------------------------------------------------------------------------ // send one block of data for write block or write multiple blocks bool Sd2Card::writeData(uint8_t token, const uint8_t* src) { spiSendBlock(token, src); spiSend(0xff); // dummy crc 2e100: 8f ef ldi r24, 0xFF ; 255 2e102: 0f 94 ea 6f call 0x2dfd4 ; 0x2dfd4 spiSend(0xff); // dummy crc 2e106: 8f ef ldi r24, 0xFF ; 255 2e108: 0f 94 ea 6f call 0x2dfd4 ; 0x2dfd4 status_ = spiRec(); 2e10c: 0f 94 ef 6f call 0x2dfde ; 0x2dfde 2e110: 8a 83 std Y+2, r24 ; 0x02 if ((status_ & DATA_RES_MASK) != DATA_RES_ACCEPTED) { 2e112: 8f 71 andi r24, 0x1F ; 31 2e114: 85 30 cpi r24, 0x05 ; 5 2e116: 99 f4 brne .+38 ; 0x2e13e goto fail; } if (!writeData(DATA_START_BLOCK, src)) goto fail; // wait for flash programming to complete if (!waitNotBusy(SD_WRITE_TIMEOUT)) { 2e118: 88 e5 ldi r24, 0x58 ; 88 2e11a: 92 e0 ldi r25, 0x02 ; 2 2e11c: 0f 94 c9 41 call 0x28392 ; 0x28392 2e120: 18 2f mov r17, r24 2e122: 87 e1 ldi r24, 0x17 ; 23 2e124: 11 23 and r17, r17 2e126: a1 f2 breq .-88 ; 0x2e0d0 error(SD_CARD_ERROR_WRITE_TIMEOUT); goto fail; } // response is r2 so get and check two bytes for nonzero if (cardCommand(CMD13, 0) || spiRec()) { 2e128: 20 e0 ldi r18, 0x00 ; 0 2e12a: 30 e0 ldi r19, 0x00 ; 0 2e12c: a9 01 movw r20, r18 2e12e: 6d e0 ldi r22, 0x0D ; 13 2e130: ce 01 movw r24, r28 2e132: 0f 94 f6 6f call 0x2dfec ; 0x2dfec 2e136: 88 23 and r24, r24 2e138: 51 f0 breq .+20 ; 0x2e14e 2e13a: 86 e1 ldi r24, 0x16 ; 22 2e13c: c9 cf rjmp .-110 ; 0x2e0d0 2e13e: 83 e1 ldi r24, 0x13 ; 19 2e140: 88 83 st Y, r24 goto fail; } return true; fail: chipSelectHigh(); 2e142: 0f 94 c7 41 call 0x2838e ; 0x2838e } chipSelectHigh(); return true; fail: chipSelectHigh(); 2e146: 0f 94 c7 41 call 0x2838e ; 0x2838e return false; 2e14a: 10 e0 ldi r17, 0x00 ; 0 2e14c: 06 c0 rjmp .+12 ; 0x2e15a if (!waitNotBusy(SD_WRITE_TIMEOUT)) { error(SD_CARD_ERROR_WRITE_TIMEOUT); goto fail; } // response is r2 so get and check two bytes for nonzero if (cardCommand(CMD13, 0) || spiRec()) { 2e14e: 0f 94 ef 6f call 0x2dfde ; 0x2dfde 2e152: 81 11 cpse r24, r1 2e154: f2 cf rjmp .-28 ; 0x2e13a error(SD_CARD_ERROR_WRITE_PROGRAMMING); goto fail; } chipSelectHigh(); 2e156: 0f 94 c7 41 call 0x2838e ; 0x2838e return true; fail: chipSelectHigh(); return false; } 2e15a: 81 2f mov r24, r17 2e15c: df 91 pop r29 2e15e: cf 91 pop r28 2e160: 1f 91 pop r17 2e162: 0f 91 pop r16 2e164: 08 95 ret 0002e166 : * \param[in] blockNumber Logical block to be read. * \param[out] dst Pointer to the location that will receive the data. * \return The value one, true, is returned for success and * the value zero, false, is returned for failure. */ bool Sd2Card::readBlock(uint32_t blockNumber, uint8_t* dst) { 2e166: 2f 92 push r2 2e168: 3f 92 push r3 2e16a: 4f 92 push r4 2e16c: 5f 92 push r5 2e16e: 6f 92 push r6 2e170: 7f 92 push r7 2e172: 8f 92 push r8 2e174: 9f 92 push r9 2e176: af 92 push r10 2e178: bf 92 push r11 2e17a: cf 92 push r12 2e17c: df 92 push r13 2e17e: ef 92 push r14 2e180: ff 92 push r15 2e182: 0f 93 push r16 2e184: 1f 93 push r17 2e186: cf 93 push r28 2e188: df 93 push r29 2e18a: ec 01 movw r28, r24 2e18c: 2a 01 movw r4, r20 2e18e: 3b 01 movw r6, r22 2e190: 69 01 movw r12, r18 #ifdef SD_CHECK_AND_RETRY uint8_t retryCnt = 3; // use address if not SDHC card if (type()!= SD_CARD_TYPE_SDHC) blockNumber <<= 9; 2e192: 8b 81 ldd r24, Y+3 ; 0x03 2e194: 83 30 cpi r24, 0x03 ; 3 2e196: 39 f0 breq .+14 ; 0x2e1a6 2e198: 69 e0 ldi r22, 0x09 ; 9 2e19a: 44 0c add r4, r4 2e19c: 55 1c adc r5, r5 2e19e: 66 1c adc r6, r6 2e1a0: 77 1c adc r7, r7 2e1a2: 6a 95 dec r22 2e1a4: d1 f7 brne .-12 ; 0x2e19a retry2: 2e1a6: 43 e0 ldi r20, 0x03 ; 3 2e1a8: 94 2e mov r9, r20 2e1aa: 56 01 movw r10, r12 2e1ac: 81 e0 ldi r24, 0x01 ; 1 2e1ae: a8 1a sub r10, r24 2e1b0: 8e ef ldi r24, 0xFE ; 254 2e1b2: b8 0a sbc r11, r24 2e1b4: 16 01 movw r2, r12 2e1b6: ee ef ldi r30, 0xFE ; 254 2e1b8: 3e 1a sub r3, r30 2e1ba: 54 e0 ldi r21, 0x04 ; 4 2e1bc: 85 2e mov r8, r21 retryCnt --; 2e1be: 9a 94 dec r9 if (cardCommand(CMD17, blockNumber)) { 2e1c0: a3 01 movw r20, r6 2e1c2: 92 01 movw r18, r4 2e1c4: 61 e1 ldi r22, 0x11 ; 17 2e1c6: ce 01 movw r24, r28 2e1c8: 0f 94 f6 6f call 0x2dfec ; 0x2dfec 2e1cc: 88 23 and r24, r24 2e1ce: 79 f0 breq .+30 ; 0x2e1ee 2e1d0: 88 82 st Y, r8 error(SD_CARD_ERROR_CMD17); if (retryCnt > 0) goto retry; 2e1d2: 99 20 and r9, r9 2e1d4: 09 f4 brne .+2 ; 0x2e1d8 2e1d6: 7a c0 rjmp .+244 ; 0x2e2cc if (retryCnt > 0) goto retry; goto fail; } return true; retry: chipSelectHigh(); 2e1d8: 0f 94 c7 41 call 0x2838e ; 0x2838e cardCommand(CMD12, 0);//Try sending a stop command, but ignore the result. 2e1dc: 20 e0 ldi r18, 0x00 ; 0 2e1de: 30 e0 ldi r19, 0x00 ; 0 2e1e0: a9 01 movw r20, r18 2e1e2: 6c e0 ldi r22, 0x0C ; 12 2e1e4: ce 01 movw r24, r28 2e1e6: 0f 94 f6 6f call 0x2dfec ; 0x2dfec errorCode_ = 0; 2e1ea: 18 82 st Y, r1 2e1ec: e8 cf rjmp .-48 ; 0x2e1be #endif //------------------------------------------------------------------------------ bool Sd2Card::readData(uint8_t* dst, uint16_t count) { // wait for start block token uint16_t t0 = _millis(); 2e1ee: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 2e1f2: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 2e1f4: 0f 94 ef 6f call 0x2dfde ; 0x2dfde 2e1f8: 8a 83 std Y+2, r24 ; 0x02 2e1fa: 8f 3f cpi r24, 0xFF ; 255 2e1fc: 91 f4 brne .+36 ; 0x2e222 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 2e1fe: 0f 94 74 0f call 0x21ee8 ; 0x21ee8 2e202: 60 1b sub r22, r16 2e204: 71 0b sbc r23, r17 2e206: 6d 32 cpi r22, 0x2D ; 45 2e208: 71 40 sbci r23, 0x01 ; 1 2e20a: a0 f3 brcs .-24 ; 0x2e1f4 2e20c: 81 e1 ldi r24, 0x11 ; 17 2e20e: 88 83 st Y, r24 if (flash_air_compatible_) spiSend(0XFF); return true; fail: chipSelectHigh(); 2e210: 0f 94 c7 41 call 0x2838e ; 0x2838e // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 2e214: 8c 81 ldd r24, Y+4 ; 0x04 2e216: 88 23 and r24, r24 2e218: e1 f2 breq .-72 ; 0x2e1d2 spiSend(0XFF); 2e21a: 8f ef ldi r24, 0xFF ; 255 2e21c: 0f 94 ea 6f call 0x2dfd4 ; 0x2dfd4 2e220: d8 cf rjmp .-80 ; 0x2e1d2 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 2e222: 8e 3f cpi r24, 0xFE ; 254 2e224: 11 f0 breq .+4 ; 0x2e22a 2e226: 8f e0 ldi r24, 0x0F ; 15 2e228: f2 cf rjmp .-28 ; 0x2e20e //------------------------------------------------------------------------------ /** SPI read data - only one call so force inline */ static inline __attribute__((always_inline)) void spiRead(uint8_t* buf, uint16_t nbyte) { if (nbyte-- == 0) return; SPDR = 0XFF; 2e22a: 8f ef ldi r24, 0xFF ; 255 2e22c: 8e bd out 0x2e, r24 ; 46 2e22e: d6 01 movw r26, r12 2e230: f6 01 movw r30, r12 for (uint16_t i = 0; i < nbyte; i++) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e232: 0d b4 in r0, 0x2d ; 45 2e234: 07 fe sbrs r0, 7 2e236: fd cf rjmp .-6 ; 0x2e232 buf[i] = SPDR; 2e238: 9e b5 in r25, 0x2e ; 46 2e23a: 91 93 st Z+, r25 SPDR = 0XFF; 2e23c: 8e bd out 0x2e, r24 ; 46 /** SPI read data - only one call so force inline */ static inline __attribute__((always_inline)) void spiRead(uint8_t* buf, uint16_t nbyte) { if (nbyte-- == 0) return; SPDR = 0XFF; for (uint16_t i = 0; i < nbyte; i++) { 2e23e: ea 15 cp r30, r10 2e240: fb 05 cpc r31, r11 2e242: b9 f7 brne .-18 ; 0x2e232 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } buf[i] = SPDR; SPDR = 0XFF; } while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e244: 0d b4 in r0, 0x2d ; 45 2e246: 07 fe sbrs r0, 7 2e248: fd cf rjmp .-6 ; 0x2e244 buf[nbyte] = SPDR; 2e24a: 8e b5 in r24, 0x2e ; 46 2e24c: f5 01 movw r30, r10 2e24e: 80 83 st Z, r24 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1, 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8, 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0 }; static uint16_t CRC_CCITT(const uint8_t* data, size_t n) { uint16_t crc = 0; 2e250: f1 2c mov r15, r1 2e252: e1 2c mov r14, r1 for (size_t i = 0; i < n; i++) { crc = pgm_read_word(&crctab[(crc >> 8 ^ data[i]) & 0XFF]) ^ (crc << 8); 2e254: 8d 91 ld r24, X+ 2e256: ef 2d mov r30, r15 2e258: ff 27 eor r31, r31 2e25a: e8 27 eor r30, r24 2e25c: ee 0f add r30, r30 2e25e: ff 1f adc r31, r31 2e260: ee 59 subi r30, 0x9E ; 158 2e262: f0 46 sbci r31, 0x60 ; 96 2e264: 85 91 lpm r24, Z+ 2e266: 94 91 lpm r25, Z 2e268: fe 2c mov r15, r14 2e26a: ee 24 eor r14, r14 2e26c: e8 26 eor r14, r24 2e26e: f9 26 eor r15, r25 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8, 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0 }; static uint16_t CRC_CCITT(const uint8_t* data, size_t n) { uint16_t crc = 0; for (size_t i = 0; i < n; i++) { 2e270: 2a 16 cp r2, r26 2e272: 3b 06 cpc r3, r27 2e274: 79 f7 brne .-34 ; 0x2e254 spiRead(dst, count); #ifdef SD_CHECK_AND_RETRY { uint16_t calcCrc = CRC_CCITT(dst, count); uint16_t recvCrc = spiRec() << 8; 2e276: 0f 94 ef 6f call 0x2dfde ; 0x2dfde 2e27a: 08 2f mov r16, r24 2e27c: 10 e0 ldi r17, 0x00 ; 0 2e27e: 10 2f mov r17, r16 2e280: 00 27 eor r16, r16 recvCrc |= spiRec(); 2e282: 0f 94 ef 6f call 0x2dfde ; 0x2dfde 2e286: 08 2b or r16, r24 if (calcCrc != recvCrc) 2e288: 0e 15 cp r16, r14 2e28a: 1f 05 cpc r17, r15 2e28c: 19 f0 breq .+6 ; 0x2e294 2e28e: f0 e2 ldi r31, 0x20 ; 32 2e290: f8 83 st Y, r31 2e292: be cf rjmp .-132 ; 0x2e210 #else // discard CRC spiRec(); spiRec(); #endif chipSelectHigh(); 2e294: 0f 94 c7 41 call 0x2838e ; 0x2838e // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 2e298: cc 81 ldd r28, Y+4 ; 0x04 2e29a: cc 23 and r28, r28 2e29c: d9 f0 breq .+54 ; 0x2e2d4 spiSend(0XFF); 2e29e: 8f ef ldi r24, 0xFF ; 255 2e2a0: 0f 94 ea 6f call 0x2dfd4 ; 0x2dfd4 #endif fail: chipSelectHigh(); return false; } 2e2a4: 8c 2f mov r24, r28 2e2a6: df 91 pop r29 2e2a8: cf 91 pop r28 2e2aa: 1f 91 pop r17 2e2ac: 0f 91 pop r16 2e2ae: ff 90 pop r15 2e2b0: ef 90 pop r14 2e2b2: df 90 pop r13 2e2b4: cf 90 pop r12 2e2b6: bf 90 pop r11 2e2b8: af 90 pop r10 2e2ba: 9f 90 pop r9 2e2bc: 8f 90 pop r8 2e2be: 7f 90 pop r7 2e2c0: 6f 90 pop r6 2e2c2: 5f 90 pop r5 2e2c4: 4f 90 pop r4 2e2c6: 3f 90 pop r3 2e2c8: 2f 90 pop r2 2e2ca: 08 95 ret } return readData(dst, 512); #endif fail: chipSelectHigh(); 2e2cc: 0f 94 c7 41 call 0x2838e ; 0x2838e return false; 2e2d0: c0 e0 ldi r28, 0x00 ; 0 2e2d2: e8 cf rjmp .-48 ; 0x2e2a4 if (!readData(dst, 512)) { if (retryCnt > 0) goto retry; goto fail; } return true; 2e2d4: c1 e0 ldi r28, 0x01 ; 1 2e2d6: e6 cf rjmp .-52 ; 0x2e2a4 0002e2d8 : * if end of file is reached. * If an error occurs, read() returns -1. Possible errors include * read() called before a file has been opened, corrupt file system * or an I/O error occurred. */ int16_t SdBaseFile::read(void* buf, uint16_t nbyte) { 2e2d8: 2f 92 push r2 2e2da: 3f 92 push r3 2e2dc: 4f 92 push r4 2e2de: 5f 92 push r5 2e2e0: 6f 92 push r6 2e2e2: 7f 92 push r7 2e2e4: 8f 92 push r8 2e2e6: 9f 92 push r9 2e2e8: af 92 push r10 2e2ea: bf 92 push r11 2e2ec: cf 92 push r12 2e2ee: df 92 push r13 2e2f0: ef 92 push r14 2e2f2: ff 92 push r15 2e2f4: 0f 93 push r16 2e2f6: 1f 93 push r17 2e2f8: cf 93 push r28 2e2fa: df 93 push r29 2e2fc: 00 d0 rcall .+0 ; 0x2e2fe 2e2fe: 1f 92 push r1 2e300: cd b7 in r28, 0x3d ; 61 2e302: de b7 in r29, 0x3e ; 62 2e304: 9c 83 std Y+4, r25 ; 0x04 2e306: 8b 83 std Y+3, r24 ; 0x03 2e308: 4b 01 movw r8, r22 2e30a: 7a 01 movw r14, r20 uint16_t offset; uint16_t toRead; uint32_t block; // raw device block number // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) goto fail; 2e30c: dc 01 movw r26, r24 2e30e: 13 96 adiw r26, 0x03 ; 3 2e310: 8c 91 ld r24, X 2e312: 81 11 cpse r24, r1 2e314: 19 c0 rjmp .+50 ; 0x2e348 toRead -= n; } return nbyte; fail: return -1; 2e316: 8f ef ldi r24, 0xFF ; 255 2e318: 9f ef ldi r25, 0xFF ; 255 } 2e31a: 0f 90 pop r0 2e31c: 0f 90 pop r0 2e31e: 0f 90 pop r0 2e320: 0f 90 pop r0 2e322: df 91 pop r29 2e324: cf 91 pop r28 2e326: 1f 91 pop r17 2e328: 0f 91 pop r16 2e32a: ff 90 pop r15 2e32c: ef 90 pop r14 2e32e: df 90 pop r13 2e330: cf 90 pop r12 2e332: bf 90 pop r11 2e334: af 90 pop r10 2e336: 9f 90 pop r9 2e338: 8f 90 pop r8 2e33a: 7f 90 pop r7 2e33c: 6f 90 pop r6 2e33e: 5f 90 pop r5 2e340: 4f 90 pop r4 2e342: 3f 90 pop r3 2e344: 2f 90 pop r2 2e346: 08 95 ret uint16_t offset; uint16_t toRead; uint32_t block; // raw device block number // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) goto fail; 2e348: eb 81 ldd r30, Y+3 ; 0x03 2e34a: fc 81 ldd r31, Y+4 ; 0x04 2e34c: 81 81 ldd r24, Z+1 ; 0x01 2e34e: 80 ff sbrs r24, 0 2e350: e2 cf rjmp .-60 ; 0x2e316 // max bytes left in file if (nbyte >= (fileSize_ - curPosition_)) { 2e352: 01 89 ldd r16, Z+17 ; 0x11 2e354: 12 89 ldd r17, Z+18 ; 0x12 2e356: 23 89 ldd r18, Z+19 ; 0x13 2e358: 34 89 ldd r19, Z+20 ; 0x14 2e35a: 40 85 ldd r20, Z+8 ; 0x08 2e35c: 51 85 ldd r21, Z+9 ; 0x09 2e35e: 62 85 ldd r22, Z+10 ; 0x0a 2e360: 73 85 ldd r23, Z+11 ; 0x0b 2e362: c7 01 movw r24, r14 2e364: b0 e0 ldi r27, 0x00 ; 0 2e366: a0 e0 ldi r26, 0x00 ; 0 2e368: 28 01 movw r4, r16 2e36a: 39 01 movw r6, r18 2e36c: 44 1a sub r4, r20 2e36e: 55 0a sbc r5, r21 2e370: 66 0a sbc r6, r22 2e372: 77 0a sbc r7, r23 2e374: 84 15 cp r24, r4 2e376: 95 05 cpc r25, r5 2e378: a6 05 cpc r26, r6 2e37a: b7 05 cpc r27, r7 2e37c: 18 f0 brcs .+6 ; 0x2e384 nbyte = fileSize_ - curPosition_; 2e37e: 78 01 movw r14, r16 2e380: e4 1a sub r14, r20 2e382: f5 0a sbc r15, r21 } // amount left to read toRead = nbyte; 2e384: 67 01 movw r12, r14 if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2e386: 8b 81 ldd r24, Y+3 ; 0x03 2e388: 9c 81 ldd r25, Y+4 ; 0x04 2e38a: 04 96 adiw r24, 0x04 ; 4 2e38c: 9a 83 std Y+2, r25 ; 0x02 2e38e: 89 83 std Y+1, r24 ; 0x01 block = vol_->clusterStartBlock(curCluster_) + blockOfCluster; } uint16_t n = toRead; // amount to be read from current block if (n > (512 - offset)) n = 512 - offset; 2e390: 61 2c mov r6, r1 2e392: 32 e0 ldi r19, 0x02 ; 2 2e394: 73 2e mov r7, r19 if (nbyte >= (fileSize_ - curPosition_)) { nbyte = fileSize_ - curPosition_; } // amount left to read toRead = nbyte; while (toRead > 0) { 2e396: c1 14 cp r12, r1 2e398: d1 04 cpc r13, r1 2e39a: 09 f4 brne .+2 ; 0x2e39e 2e39c: b7 c0 rjmp .+366 ; 0x2e50c offset = curPosition_ & 0X1FF; // offset in block 2e39e: ab 81 ldd r26, Y+3 ; 0x03 2e3a0: bc 81 ldd r27, Y+4 ; 0x04 2e3a2: 18 96 adiw r26, 0x08 ; 8 2e3a4: 4d 91 ld r20, X+ 2e3a6: 5d 91 ld r21, X+ 2e3a8: 6d 91 ld r22, X+ 2e3aa: 7c 91 ld r23, X 2e3ac: 1b 97 sbiw r26, 0x0b ; 11 2e3ae: 5a 01 movw r10, r20 2e3b0: b1 e0 ldi r27, 0x01 ; 1 2e3b2: bb 22 and r11, r27 2e3b4: eb 81 ldd r30, Y+3 ; 0x03 2e3b6: fc 81 ldd r31, Y+4 ; 0x04 2e3b8: 81 8d ldd r24, Z+25 ; 0x19 2e3ba: 92 8d ldd r25, Z+26 ; 0x1a 2e3bc: 1a 01 movw r2, r20 2e3be: 2b 01 movw r4, r22 2e3c0: 29 e0 ldi r18, 0x09 ; 9 2e3c2: 56 94 lsr r5 2e3c4: 47 94 ror r4 2e3c6: 37 94 ror r3 2e3c8: 27 94 ror r2 2e3ca: 2a 95 dec r18 2e3cc: d1 f7 brne .-12 ; 0x2e3c2 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2e3ce: 23 81 ldd r18, Z+3 ; 0x03 2e3d0: 22 30 cpi r18, 0x02 ; 2 2e3d2: 91 f5 brne .+100 ; 0x2e438 block = vol_->rootDirStart() + (curPosition_ >> 9); 2e3d4: dc 01 movw r26, r24 2e3d6: 5a 96 adiw r26, 0x1a ; 26 2e3d8: 6d 91 ld r22, X+ 2e3da: 7d 91 ld r23, X+ 2e3dc: 8d 91 ld r24, X+ 2e3de: 9c 91 ld r25, X 2e3e0: 5d 97 sbiw r26, 0x1d ; 29 2e3e2: 62 0d add r22, r2 2e3e4: 73 1d adc r23, r3 2e3e6: 84 1d adc r24, r4 2e3e8: 95 1d adc r25, r5 2e3ea: 83 01 movw r16, r6 2e3ec: 0a 19 sub r16, r10 2e3ee: 1b 09 sbc r17, r11 2e3f0: c0 16 cp r12, r16 2e3f2: d1 06 cpc r13, r17 2e3f4: 08 f4 brcc .+2 ; 0x2e3f8 2e3f6: 86 01 movw r16, r12 // amount to be read from current block if (n > (512 - offset)) n = 512 - offset; // no buffering needed if n == 512 if (n == 512 && block != vol_->cacheBlockNumber()) { 2e3f8: 01 15 cp r16, r1 2e3fa: b2 e0 ldi r27, 0x02 ; 2 2e3fc: 1b 07 cpc r17, r27 2e3fe: 71 f4 brne .+28 ; 0x2e41c 2e400: 20 91 cd 0d lds r18, 0x0DCD ; 0x800dcd 2e404: 30 91 ce 0d lds r19, 0x0DCE ; 0x800dce 2e408: 40 91 cf 0d lds r20, 0x0DCF ; 0x800dcf 2e40c: 50 91 d0 0d lds r21, 0x0DD0 ; 0x800dd0 2e410: 62 17 cp r22, r18 2e412: 73 07 cpc r23, r19 2e414: 84 07 cpc r24, r20 2e416: 95 07 cpc r25, r21 2e418: 09 f0 breq .+2 ; 0x2e41c 2e41a: 59 c0 rjmp .+178 ; 0x2e4ce if (!vol_->readBlock(block, dst)) goto fail; } else { // read block to cache and copy data to caller if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_READ)) goto fail; 2e41c: 40 e0 ldi r20, 0x00 ; 0 2e41e: 0f 94 6d 36 call 0x26cda ; 0x26cda 2e422: 88 23 and r24, r24 2e424: 09 f4 brne .+2 ; 0x2e428 2e426: 77 cf rjmp .-274 ; 0x2e316 uint8_t* src = vol_->cache()->data + offset; 2e428: b5 01 movw r22, r10 2e42a: 67 52 subi r22, 0x27 ; 39 2e42c: 72 4f sbci r23, 0xF2 ; 242 memcpy(dst, src, n); 2e42e: a8 01 movw r20, r16 2e430: c4 01 movw r24, r8 2e432: 0f 94 05 a6 call 0x34c0a ; 0x34c0a 2e436: 57 c0 rjmp .+174 ; 0x2e4e6 uint16_t rootDirEntryCount_; // number of entries in FAT16 root dir uint32_t rootDirStart_; // root start block for FAT16, cluster for FAT32 //---------------------------------------------------------------------------- bool allocContiguous(uint32_t count, uint32_t* curCluster); uint8_t blockOfCluster(uint32_t position) const { return (position >> 9) & (blocksPerCluster_ - 1);} 2e438: fc 01 movw r30, r24 2e43a: 14 81 ldd r17, Z+4 ; 0x04 2e43c: 11 50 subi r17, 0x01 ; 1 2e43e: 12 21 and r17, r2 offset = curPosition_ & 0X1FF; // offset in block if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { block = vol_->rootDirStart() + (curPosition_ >> 9); } else { uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); if (offset == 0 && blockOfCluster == 0) { 2e440: a1 14 cp r10, r1 2e442: b1 04 cpc r11, r1 2e444: 81 f4 brne .+32 ; 0x2e466 2e446: 11 11 cpse r17, r1 2e448: 0e c0 rjmp .+28 ; 0x2e466 // start of new cluster if (curPosition_ == 0) { 2e44a: 45 2b or r20, r21 2e44c: 46 2b or r20, r22 2e44e: 47 2b or r20, r23 2e450: 79 f5 brne .+94 ; 0x2e4b0 // use first cluster in file curCluster_ = firstCluster_; 2e452: eb 81 ldd r30, Y+3 ; 0x03 2e454: fc 81 ldd r31, Y+4 ; 0x04 2e456: 85 89 ldd r24, Z+21 ; 0x15 2e458: 96 89 ldd r25, Z+22 ; 0x16 2e45a: a7 89 ldd r26, Z+23 ; 0x17 2e45c: b0 8d ldd r27, Z+24 ; 0x18 2e45e: 84 83 std Z+4, r24 ; 0x04 2e460: 95 83 std Z+5, r25 ; 0x05 2e462: a6 83 std Z+6, r26 ; 0x06 2e464: b7 83 std Z+7, r27 ; 0x07 } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; } } block = vol_->clusterStartBlock(curCluster_) + blockOfCluster; 2e466: ab 81 ldd r26, Y+3 ; 0x03 2e468: bc 81 ldd r27, Y+4 ; 0x04 2e46a: 59 96 adiw r26, 0x19 ; 25 2e46c: ed 91 ld r30, X+ 2e46e: fc 91 ld r31, X 2e470: 5a 97 sbiw r26, 0x1a ; 26 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2e472: 14 96 adiw r26, 0x04 ; 4 2e474: 6d 91 ld r22, X+ 2e476: 7d 91 ld r23, X+ 2e478: 8d 91 ld r24, X+ 2e47a: 9c 91 ld r25, X 2e47c: 17 97 sbiw r26, 0x07 ; 7 2e47e: 62 50 subi r22, 0x02 ; 2 2e480: 71 09 sbc r23, r1 2e482: 81 09 sbc r24, r1 2e484: 91 09 sbc r25, r1 2e486: 25 85 ldd r18, Z+13 ; 0x0d 2e488: 04 c0 rjmp .+8 ; 0x2e492 2e48a: 66 0f add r22, r22 2e48c: 77 1f adc r23, r23 2e48e: 88 1f adc r24, r24 2e490: 99 1f adc r25, r25 2e492: 2a 95 dec r18 2e494: d2 f7 brpl .-12 ; 0x2e48a 2e496: 26 85 ldd r18, Z+14 ; 0x0e 2e498: 37 85 ldd r19, Z+15 ; 0x0f 2e49a: 40 89 ldd r20, Z+16 ; 0x10 2e49c: 51 89 ldd r21, Z+17 ; 0x11 2e49e: 62 0f add r22, r18 2e4a0: 73 1f adc r23, r19 2e4a2: 84 1f adc r24, r20 2e4a4: 95 1f adc r25, r21 2e4a6: 61 0f add r22, r17 2e4a8: 71 1d adc r23, r1 2e4aa: 81 1d adc r24, r1 2e4ac: 91 1d adc r25, r1 2e4ae: 9d cf rjmp .-198 ; 0x2e3ea if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2e4b0: ab 81 ldd r26, Y+3 ; 0x03 2e4b2: bc 81 ldd r27, Y+4 ; 0x04 2e4b4: 14 96 adiw r26, 0x04 ; 4 2e4b6: 4d 91 ld r20, X+ 2e4b8: 5d 91 ld r21, X+ 2e4ba: 6d 91 ld r22, X+ 2e4bc: 7c 91 ld r23, X 2e4be: 17 97 sbiw r26, 0x07 ; 7 2e4c0: 29 81 ldd r18, Y+1 ; 0x01 2e4c2: 3a 81 ldd r19, Y+2 ; 0x02 2e4c4: 0f 94 3c 37 call 0x26e78 ; 0x26e78 2e4c8: 81 11 cpse r24, r1 2e4ca: cd cf rjmp .-102 ; 0x2e466 2e4cc: 24 cf rjmp .-440 ; 0x2e316 if (FAT12_SUPPORT && fatType_ == 12) return cluster >= FAT12EOC_MIN; if (fatType_ == 16) return cluster >= FAT16EOC_MIN; return cluster >= FAT32EOC_MIN; } bool readBlock(uint32_t block, uint8_t* dst) { return sdCard_->readBlock(block, dst);} 2e4ce: 94 01 movw r18, r8 2e4d0: ab 01 movw r20, r22 2e4d2: bc 01 movw r22, r24 2e4d4: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 2e4d8: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 2e4dc: 0f 94 b3 70 call 0x2e166 ; 0x2e166 // amount to be read from current block if (n > (512 - offset)) n = 512 - offset; // no buffering needed if n == 512 if (n == 512 && block != vol_->cacheBlockNumber()) { if (!vol_->readBlock(block, dst)) goto fail; 2e4e0: 88 23 and r24, r24 2e4e2: 09 f4 brne .+2 ; 0x2e4e6 2e4e4: 18 cf rjmp .-464 ; 0x2e316 // read block to cache and copy data to caller if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_READ)) goto fail; uint8_t* src = vol_->cache()->data + offset; memcpy(dst, src, n); } dst += n; 2e4e6: 80 0e add r8, r16 2e4e8: 91 1e adc r9, r17 curPosition_ += n; 2e4ea: eb 81 ldd r30, Y+3 ; 0x03 2e4ec: fc 81 ldd r31, Y+4 ; 0x04 2e4ee: 80 85 ldd r24, Z+8 ; 0x08 2e4f0: 91 85 ldd r25, Z+9 ; 0x09 2e4f2: a2 85 ldd r26, Z+10 ; 0x0a 2e4f4: b3 85 ldd r27, Z+11 ; 0x0b 2e4f6: 80 0f add r24, r16 2e4f8: 91 1f adc r25, r17 2e4fa: a1 1d adc r26, r1 2e4fc: b1 1d adc r27, r1 2e4fe: 80 87 std Z+8, r24 ; 0x08 2e500: 91 87 std Z+9, r25 ; 0x09 2e502: a2 87 std Z+10, r26 ; 0x0a 2e504: b3 87 std Z+11, r27 ; 0x0b toRead -= n; 2e506: c0 1a sub r12, r16 2e508: d1 0a sbc r13, r17 2e50a: 45 cf rjmp .-374 ; 0x2e396 } return nbyte; 2e50c: c7 01 movw r24, r14 2e50e: 05 cf rjmp .-502 ; 0x2e31a 0002e510 : return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 2e510: 4f 92 push r4 2e512: 5f 92 push r5 2e514: 6f 92 push r6 2e516: 7f 92 push r7 2e518: af 92 push r10 2e51a: bf 92 push r11 2e51c: cf 92 push r12 2e51e: df 92 push r13 2e520: ef 92 push r14 2e522: ff 92 push r15 2e524: 0f 93 push r16 2e526: 1f 93 push r17 2e528: cf 93 push r28 2e52a: df 93 push r29 2e52c: 1f 92 push r1 2e52e: cd b7 in r28, 0x3d ; 61 2e530: de b7 in r29, 0x3e ; 62 2e532: 8c 01 movw r16, r24 2e534: 7b 01 movw r14, r22 2e536: 5a 01 movw r10, r20 2e538: c2 2e mov r12, r18 bool emptyFound = false; bool fileFound = false; uint8_t index; dir_t* p; vol_ = dirFile->vol_; 2e53a: db 01 movw r26, r22 2e53c: 59 96 adiw r26, 0x19 ; 25 2e53e: 8d 91 ld r24, X+ 2e540: 9c 91 ld r25, X 2e542: f8 01 movw r30, r16 2e544: 92 8f std Z+26, r25 ; 0x1a 2e546: 81 8f std Z+25, r24 ; 0x19 dirFile->rewind(); 2e548: cb 01 movw r24, r22 2e54a: 0e 94 36 70 call 0xe06c ; 0xe06c } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { bool emptyFound = false; 2e54e: 71 2c mov r7, r1 vol_ = dirFile->vol_; dirFile->rewind(); // search for file while (dirFile->curPosition_ < dirFile->fileSize_) { 2e550: f7 01 movw r30, r14 2e552: 80 85 ldd r24, Z+8 ; 0x08 2e554: 91 85 ldd r25, Z+9 ; 0x09 2e556: a2 85 ldd r26, Z+10 ; 0x0a 2e558: b3 85 ldd r27, Z+11 ; 0x0b 2e55a: 41 89 ldd r20, Z+17 ; 0x11 2e55c: 52 89 ldd r21, Z+18 ; 0x12 2e55e: 63 89 ldd r22, Z+19 ; 0x13 2e560: 74 89 ldd r23, Z+20 ; 0x14 2e562: 84 17 cp r24, r20 2e564: 95 07 cpc r25, r21 2e566: a6 07 cpc r26, r22 2e568: b7 07 cpc r27, r23 2e56a: 08 f0 brcs .+2 ; 0x2e56e 2e56c: 52 c0 rjmp .+164 ; 0x2e612 index = 0XF & (dirFile->curPosition_ >> 5); 2e56e: 55 e0 ldi r21, 0x05 ; 5 2e570: b6 95 lsr r27 2e572: a7 95 ror r26 2e574: 97 95 ror r25 2e576: 87 95 ror r24 2e578: 5a 95 dec r21 2e57a: d1 f7 brne .-12 ; 0x2e570 2e57c: f8 2f mov r31, r24 2e57e: ff 70 andi r31, 0x0F ; 15 2e580: df 2e mov r13, r31 // Read next directory entry into the cache // Assumes file is correctly positioned dir_t* SdBaseFile::readDirCache() { uint8_t i; // error if not directory if (!isDir()) goto fail; 2e582: d7 01 movw r26, r14 2e584: 13 96 adiw r26, 0x03 ; 3 2e586: 8c 91 ld r24, X 2e588: 82 30 cpi r24, 0x02 ; 2 2e58a: 10 f4 brcc .+4 ; 0x2e590 if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; return false; 2e58c: 80 e0 ldi r24, 0x00 ; 0 2e58e: db c0 rjmp .+438 ; 0x2e746 * \return For success read returns the next byte in the file as an int. * If an error occurs or end of file is reached -1 is returned. */ int16_t SdBaseFile::read() { uint8_t b; return read(&b, 1) == 1 ? b : -1; 2e590: 41 e0 ldi r20, 0x01 ; 1 2e592: 50 e0 ldi r21, 0x00 ; 0 2e594: be 01 movw r22, r28 2e596: 6f 5f subi r22, 0xFF ; 255 2e598: 7f 4f sbci r23, 0xFF ; 255 2e59a: c7 01 movw r24, r14 2e59c: 0f 94 6c 71 call 0x2e2d8 ; 0x2e2d8 2e5a0: 01 97 sbiw r24, 0x01 ; 1 2e5a2: a1 f7 brne .-24 ; 0x2e58c // use read to locate and cache block if (read() < 0) goto fail; // advance to next entry curPosition_ += 31; 2e5a4: f7 01 movw r30, r14 2e5a6: 80 85 ldd r24, Z+8 ; 0x08 2e5a8: 91 85 ldd r25, Z+9 ; 0x09 2e5aa: a2 85 ldd r26, Z+10 ; 0x0a 2e5ac: b3 85 ldd r27, Z+11 ; 0x0b 2e5ae: 4f 96 adiw r24, 0x1f ; 31 2e5b0: a1 1d adc r26, r1 2e5b2: b1 1d adc r27, r1 2e5b4: 80 87 std Z+8, r24 ; 0x08 2e5b6: 91 87 std Z+9, r25 ; 0x09 2e5b8: a2 87 std Z+10, r26 ; 0x0a 2e5ba: b3 87 std Z+11, r27 ; 0x0b // return pointer to entry return vol_->cache()->dir + i; 2e5bc: f0 e2 ldi r31, 0x20 ; 32 2e5be: df 9e mul r13, r31 2e5c0: b0 01 movw r22, r0 2e5c2: 11 24 eor r1, r1 2e5c4: 67 52 subi r22, 0x27 ; 39 2e5c6: 72 4f sbci r23, 0xF2 ; 242 // search for file while (dirFile->curPosition_ < dirFile->fileSize_) { index = 0XF & (dirFile->curPosition_ >> 5); p = dirFile->readDirCache(); if (!p) goto fail; 2e5c8: 61 15 cp r22, r1 2e5ca: 71 05 cpc r23, r1 2e5cc: f9 f2 breq .-66 ; 0x2e58c if (p->name[0] == DIR_NAME_FREE || p->name[0] == DIR_NAME_DELETED) { 2e5ce: db 01 movw r26, r22 2e5d0: 8c 91 ld r24, X 2e5d2: 88 23 and r24, r24 2e5d4: 41 f0 breq .+16 ; 0x2e5e6 2e5d6: 85 3e cpi r24, 0xE5 ; 229 2e5d8: 09 f0 breq .+2 ; 0x2e5dc 2e5da: 4c c0 rjmp .+152 ; 0x2e674 // remember first empty slot if (!emptyFound) { 2e5dc: 77 20 and r7, r7 2e5de: 29 f0 breq .+10 ; 0x2e5ea return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 2e5e0: 77 24 eor r7, r7 2e5e2: 73 94 inc r7 2e5e4: b5 cf rjmp .-150 ; 0x2e550 p = dirFile->readDirCache(); if (!p) goto fail; if (p->name[0] == DIR_NAME_FREE || p->name[0] == DIR_NAME_DELETED) { // remember first empty slot if (!emptyFound) { 2e5e6: 71 10 cpse r7, r1 2e5e8: 0e c0 rjmp .+28 ; 0x2e606 dirBlock_ = dirFile->vol_->cacheBlockNumber(); 2e5ea: 80 91 cd 0d lds r24, 0x0DCD ; 0x800dcd 2e5ee: 90 91 ce 0d lds r25, 0x0DCE ; 0x800dce 2e5f2: a0 91 cf 0d lds r26, 0x0DCF ; 0x800dcf 2e5f6: b0 91 d0 0d lds r27, 0x0DD0 ; 0x800dd0 2e5fa: f8 01 movw r30, r16 2e5fc: 84 87 std Z+12, r24 ; 0x0c 2e5fe: 95 87 std Z+13, r25 ; 0x0d 2e600: a6 87 std Z+14, r26 ; 0x0e 2e602: b7 87 std Z+15, r27 ; 0x0f dirIndex_ = index; 2e604: d0 8a std Z+16, r13 ; 0x10 emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; 2e606: db 01 movw r26, r22 2e608: 8c 91 ld r24, X 2e60a: 81 11 cpse r24, r1 2e60c: e9 cf rjmp .-46 ; 0x2e5e0 2e60e: 77 24 eor r7, r7 2e610: 73 94 inc r7 if (fileFound) { // don't open existing file if O_EXCL if (oflag & O_EXCL) goto fail; } else { // don't create unless O_CREAT and O_WRITE if (!(oflag & O_CREAT) || !(oflag & O_WRITE)) goto fail; 2e612: 8c 2d mov r24, r12 2e614: 82 74 andi r24, 0x42 ; 66 2e616: 82 34 cpi r24, 0x42 ; 66 2e618: 09 f0 breq .+2 ; 0x2e61c 2e61a: b8 cf rjmp .-144 ; 0x2e58c if (emptyFound) { 2e61c: 77 20 and r7, r7 2e61e: 09 f4 brne .+2 ; 0x2e622 2e620: a2 c0 rjmp .+324 ; 0x2e766 index = dirIndex_; 2e622: f8 01 movw r30, r16 2e624: d0 88 ldd r13, Z+16 ; 0x10 p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 2e626: 61 e0 ldi r22, 0x01 ; 1 2e628: c8 01 movw r24, r16 2e62a: 0f 94 9b 6e call 0x2dd36 ; 0x2dd36 if (!p) goto fail; 2e62e: 00 97 sbiw r24, 0x00 ; 0 2e630: 09 f4 brne .+2 ; 0x2e634 2e632: ac cf rjmp .-168 ; 0x2e58c // use first entry in cluster p = dirFile->vol_->cache()->dir; index = 0; } // initialize as empty file memset(p, 0, sizeof(dir_t)); 2e634: 20 e2 ldi r18, 0x20 ; 32 2e636: dc 01 movw r26, r24 2e638: 1d 92 st X+, r1 2e63a: 2a 95 dec r18 2e63c: e9 f7 brne .-6 ; 0x2e638 memcpy(p->name, dname, 11); 2e63e: 2b e0 ldi r18, 0x0B ; 11 2e640: f5 01 movw r30, r10 2e642: dc 01 movw r26, r24 2e644: 01 90 ld r0, Z+ 2e646: 0d 92 st X+, r0 2e648: 2a 95 dec r18 2e64a: e1 f7 brne .-8 ; 0x2e644 if (dateTime_) { // call user date/time function dateTime_(&p->creationDate, &p->creationTime); } else { // use default date/time p->creationDate = FAT_DEFAULT_DATE; 2e64c: 21 e2 ldi r18, 0x21 ; 33 2e64e: 38 e2 ldi r19, 0x28 ; 40 2e650: fc 01 movw r30, r24 2e652: 31 8b std Z+17, r19 ; 0x11 2e654: 20 8b std Z+16, r18 ; 0x10 p->creationTime = FAT_DEFAULT_TIME; 2e656: 40 e0 ldi r20, 0x00 ; 0 2e658: 58 e0 ldi r21, 0x08 ; 8 2e65a: 57 87 std Z+15, r21 ; 0x0f 2e65c: 46 87 std Z+14, r20 ; 0x0e } p->lastAccessDate = p->creationDate; 2e65e: 33 8b std Z+19, r19 ; 0x13 2e660: 22 8b std Z+18, r18 ; 0x12 p->lastWriteDate = p->creationDate; 2e662: 31 8f std Z+25, r19 ; 0x19 2e664: 20 8f std Z+24, r18 ; 0x18 p->lastWriteTime = p->creationTime; 2e666: 57 8b std Z+23, r21 ; 0x17 2e668: 46 8b std Z+22, r20 ; 0x16 // write entry to SD if (!dirFile->vol_->cacheFlush()) goto fail; 2e66a: 0f 94 2e 36 call 0x26c5c ; 0x26c5c 2e66e: 81 11 cpse r24, r1 2e670: 09 c0 rjmp .+18 ; 0x2e684 2e672: 8c cf rjmp .-232 ; 0x2e58c dirIndex_ = index; emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; } else if (!memcmp(dname, p->name, 11)) { 2e674: 4b e0 ldi r20, 0x0B ; 11 2e676: 50 e0 ldi r21, 0x00 ; 0 2e678: c5 01 movw r24, r10 2e67a: 0f 94 f8 a5 call 0x34bf0 ; 0x34bf0 2e67e: 89 2b or r24, r25 2e680: 09 f0 breq .+2 ; 0x2e684 2e682: 66 cf rjmp .-308 ; 0x2e550 } //------------------------------------------------------------------------------ // open a cached directory entry. Assumes vol_ is initialized bool SdBaseFile::openCachedEntry(uint8_t dirIndex, uint8_t oflag) { // location of entry in cache dir_t* p = &vol_->cache()->dir[dirIndex]; 2e684: f0 e2 ldi r31, 0x20 ; 32 2e686: df 9e mul r13, r31 2e688: d0 01 movw r26, r0 2e68a: 11 24 eor r1, r1 2e68c: 9d 01 movw r18, r26 2e68e: 27 52 subi r18, 0x27 ; 39 2e690: 32 4f sbci r19, 0xF2 ; 242 // write or truncate is an error for a directory or read-only file if (p->attributes & (DIR_ATT_READ_ONLY | DIR_ATT_DIRECTORY)) { 2e692: f9 01 movw r30, r18 2e694: 83 85 ldd r24, Z+11 ; 0x0b 2e696: 81 71 andi r24, 0x11 ; 17 2e698: 21 f0 breq .+8 ; 0x2e6a2 if (oflag & (O_WRITE | O_TRUNC)) goto fail; 2e69a: 8c 2d mov r24, r12 2e69c: 82 71 andi r24, 0x12 ; 18 2e69e: 09 f0 breq .+2 ; 0x2e6a2 2e6a0: fc c0 rjmp .+504 ; 0x2e89a } //------------------------------------------------------------------------------ // open a cached directory entry. Assumes vol_ is initialized bool SdBaseFile::openCachedEntry(uint8_t dirIndex, uint8_t oflag) { // location of entry in cache dir_t* p = &vol_->cache()->dir[dirIndex]; 2e6a2: f8 01 movw r30, r16 2e6a4: 81 8d ldd r24, Z+25 ; 0x19 2e6a6: 92 8d ldd r25, Z+26 ; 0x1a // write or truncate is an error for a directory or read-only file if (p->attributes & (DIR_ATT_READ_ONLY | DIR_ATT_DIRECTORY)) { if (oflag & (O_WRITE | O_TRUNC)) goto fail; } // remember location of directory entry on SD dirBlock_ = vol_->cacheBlockNumber(); 2e6a8: 40 91 cd 0d lds r20, 0x0DCD ; 0x800dcd 2e6ac: 50 91 ce 0d lds r21, 0x0DCE ; 0x800dce 2e6b0: 60 91 cf 0d lds r22, 0x0DCF ; 0x800dcf 2e6b4: 70 91 d0 0d lds r23, 0x0DD0 ; 0x800dd0 2e6b8: 44 87 std Z+12, r20 ; 0x0c 2e6ba: 55 87 std Z+13, r21 ; 0x0d 2e6bc: 66 87 std Z+14, r22 ; 0x0e 2e6be: 77 87 std Z+15, r23 ; 0x0f dirIndex_ = dirIndex; 2e6c0: d0 8a std Z+16, r13 ; 0x10 // copy first cluster number for directory fields firstCluster_ = (uint32_t)p->firstClusterHigh << 16; 2e6c2: fd 01 movw r30, r26 2e6c4: e7 52 subi r30, 0x27 ; 39 2e6c6: f2 4f sbci r31, 0xF2 ; 242 2e6c8: 44 88 ldd r4, Z+20 ; 0x14 2e6ca: 55 88 ldd r5, Z+21 ; 0x15 2e6cc: 71 2c mov r7, r1 2e6ce: 61 2c mov r6, r1 2e6d0: 32 01 movw r6, r4 2e6d2: 55 24 eor r5, r5 2e6d4: 44 24 eor r4, r4 2e6d6: d8 01 movw r26, r16 2e6d8: 55 96 adiw r26, 0x15 ; 21 2e6da: 4d 92 st X+, r4 2e6dc: 5d 92 st X+, r5 2e6de: 6d 92 st X+, r6 2e6e0: 7c 92 st X, r7 2e6e2: 58 97 sbiw r26, 0x18 ; 24 firstCluster_ |= p->firstClusterLow; 2e6e4: 42 8d ldd r20, Z+26 ; 0x1a 2e6e6: 53 8d ldd r21, Z+27 ; 0x1b 2e6e8: 70 e0 ldi r23, 0x00 ; 0 2e6ea: 60 e0 ldi r22, 0x00 ; 0 2e6ec: 44 29 or r20, r4 2e6ee: 55 29 or r21, r5 2e6f0: 66 29 or r22, r6 2e6f2: 77 29 or r23, r7 2e6f4: 55 96 adiw r26, 0x15 ; 21 2e6f6: 4d 93 st X+, r20 2e6f8: 5d 93 st X+, r21 2e6fa: 6d 93 st X+, r22 2e6fc: 7c 93 st X, r23 2e6fe: 58 97 sbiw r26, 0x18 ; 24 2e700: d9 01 movw r26, r18 2e702: 1b 96 adiw r26, 0x0b ; 11 2e704: 2c 91 ld r18, X 2e706: 28 71 andi r18, 0x18 ; 24 // make sure it is a normal file or subdirectory if (DIR_IS_FILE(p)) { 2e708: 09 f0 breq .+2 ; 0x2e70c 2e70a: b9 c0 rjmp .+370 ; 0x2e87e fileSize_ = p->fileSize; 2e70c: 84 8d ldd r24, Z+28 ; 0x1c 2e70e: 95 8d ldd r25, Z+29 ; 0x1d 2e710: a6 8d ldd r26, Z+30 ; 0x1e 2e712: b7 8d ldd r27, Z+31 ; 0x1f 2e714: f8 01 movw r30, r16 2e716: 81 8b std Z+17, r24 ; 0x11 2e718: 92 8b std Z+18, r25 ; 0x12 2e71a: a3 8b std Z+19, r26 ; 0x13 2e71c: b4 8b std Z+20, r27 ; 0x14 type_ = FAT_FILE_TYPE_NORMAL; 2e71e: 81 e0 ldi r24, 0x01 ; 1 2e720: 83 83 std Z+3, r24 ; 0x03 type_ = FAT_FILE_TYPE_SUBDIR; } else { goto fail; } // save open flags for read/write flags_ = oflag & F_OFLAG; 2e722: 8c 2d mov r24, r12 2e724: 8f 70 andi r24, 0x0F ; 15 2e726: f8 01 movw r30, r16 2e728: 81 83 std Z+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 2e72a: 14 82 std Z+4, r1 ; 0x04 2e72c: 15 82 std Z+5, r1 ; 0x05 2e72e: 16 82 std Z+6, r1 ; 0x06 2e730: 17 82 std Z+7, r1 ; 0x07 curPosition_ = 0; 2e732: 10 86 std Z+8, r1 ; 0x08 2e734: 11 86 std Z+9, r1 ; 0x09 2e736: 12 86 std Z+10, r1 ; 0x0a 2e738: 13 86 std Z+11, r1 ; 0x0b if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; 2e73a: 81 e0 ldi r24, 0x01 ; 1 flags_ = oflag & F_OFLAG; // set to start of file curCluster_ = 0; curPosition_ = 0; if ((oflag & O_TRUNC) && !truncate(0)) return false; 2e73c: c4 fe sbrs r12, 4 2e73e: 03 c0 rjmp .+6 ; 0x2e746 2e740: c8 01 movw r24, r16 2e742: 0f 94 d7 44 call 0x289ae ; 0x289ae // open entry in cache return openCachedEntry(index, oflag); fail: return false; } 2e746: 0f 90 pop r0 2e748: df 91 pop r29 2e74a: cf 91 pop r28 2e74c: 1f 91 pop r17 2e74e: 0f 91 pop r16 2e750: ff 90 pop r15 2e752: ef 90 pop r14 2e754: df 90 pop r13 2e756: cf 90 pop r12 2e758: bf 90 pop r11 2e75a: af 90 pop r10 2e75c: 7f 90 pop r7 2e75e: 6f 90 pop r6 2e760: 5f 90 pop r5 2e762: 4f 90 pop r4 2e764: 08 95 ret if (emptyFound) { index = dirIndex_; p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); if (!p) goto fail; } else { if (dirFile->type_ == FAT_FILE_TYPE_ROOT_FIXED) goto fail; 2e766: d7 01 movw r26, r14 2e768: 13 96 adiw r26, 0x03 ; 3 2e76a: 8c 91 ld r24, X 2e76c: 13 97 sbiw r26, 0x03 ; 3 2e76e: 82 30 cpi r24, 0x02 ; 2 2e770: 09 f4 brne .+2 ; 0x2e774 2e772: 0c cf rjmp .-488 ; 0x2e58c // Add a cluster to a directory file and zero the cluster. // return with first block of cluster in the cache bool SdBaseFile::addDirCluster() { uint32_t block; // max folder size if (fileSize_/sizeof(dir_t) >= 0XFFFF) goto fail; 2e774: 51 96 adiw r26, 0x11 ; 17 2e776: 8d 91 ld r24, X+ 2e778: 9d 91 ld r25, X+ 2e77a: 0d 90 ld r0, X+ 2e77c: bc 91 ld r27, X 2e77e: a0 2d mov r26, r0 2e780: 80 3e cpi r24, 0xE0 ; 224 2e782: 9f 4f sbci r25, 0xFF ; 255 2e784: af 41 sbci r26, 0x1F ; 31 2e786: b1 05 cpc r27, r1 2e788: 08 f0 brcs .+2 ; 0x2e78c 2e78a: 00 cf rjmp .-512 ; 0x2e58c if (!addCluster()) goto fail; 2e78c: c7 01 movw r24, r14 2e78e: 0f 94 ef 6e call 0x2ddde ; 0x2ddde 2e792: 88 23 and r24, r24 2e794: 09 f4 brne .+2 ; 0x2e798 2e796: fa ce rjmp .-524 ; 0x2e58c if (!vol_->cacheFlush()) goto fail; 2e798: 0f 94 2e 36 call 0x26c5c ; 0x26c5c 2e79c: 88 23 and r24, r24 2e79e: 09 f4 brne .+2 ; 0x2e7a2 2e7a0: f5 ce rjmp .-534 ; 0x2e58c block = vol_->clusterStartBlock(curCluster_); 2e7a2: d7 01 movw r26, r14 2e7a4: 59 96 adiw r26, 0x19 ; 25 2e7a6: ed 91 ld r30, X+ 2e7a8: fc 91 ld r31, X 2e7aa: 5a 97 sbiw r26, 0x1a ; 26 //---------------------------------------------------------------------------- bool allocContiguous(uint32_t count, uint32_t* curCluster); uint8_t blockOfCluster(uint32_t position) const { return (position >> 9) & (blocksPerCluster_ - 1);} uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2e7ac: 14 96 adiw r26, 0x04 ; 4 2e7ae: 4d 90 ld r4, X+ 2e7b0: 5d 90 ld r5, X+ 2e7b2: 6d 90 ld r6, X+ 2e7b4: 7c 90 ld r7, X 2e7b6: 17 97 sbiw r26, 0x07 ; 7 2e7b8: b2 e0 ldi r27, 0x02 ; 2 2e7ba: 4b 1a sub r4, r27 2e7bc: 51 08 sbc r5, r1 2e7be: 61 08 sbc r6, r1 2e7c0: 71 08 sbc r7, r1 2e7c2: 85 85 ldd r24, Z+13 ; 0x0d 2e7c4: 04 c0 rjmp .+8 ; 0x2e7ce 2e7c6: 44 0c add r4, r4 2e7c8: 55 1c adc r5, r5 2e7ca: 66 1c adc r6, r6 2e7cc: 77 1c adc r7, r7 2e7ce: 8a 95 dec r24 2e7d0: d2 f7 brpl .-12 ; 0x2e7c6 2e7d2: 86 85 ldd r24, Z+14 ; 0x0e 2e7d4: 97 85 ldd r25, Z+15 ; 0x0f 2e7d6: a0 89 ldd r26, Z+16 ; 0x10 2e7d8: b1 89 ldd r27, Z+17 ; 0x11 2e7da: 48 0e add r4, r24 2e7dc: 59 1e adc r5, r25 2e7de: 6a 1e adc r6, r26 2e7e0: 7b 1e adc r7, r27 static bool cacheFlush(); static bool cacheRawBlock(uint32_t blockNumber, bool dirty); #endif // USE_MULTIPLE_CARDS // used by SdBaseFile write to assign cache to SD location void cacheSetBlockNumber(uint32_t blockNumber, bool dirty) { cacheDirty_ = dirty; 2e7e2: 81 e0 ldi r24, 0x01 ; 1 2e7e4: 80 93 d5 0d sts 0x0DD5, r24 ; 0x800dd5 cacheBlockNumber_ = blockNumber; 2e7e8: 40 92 cd 0d sts 0x0DCD, r4 ; 0x800dcd 2e7ec: 50 92 ce 0d sts 0x0DCE, r5 ; 0x800dce 2e7f0: 60 92 cf 0d sts 0x0DCF, r6 ; 0x800dcf 2e7f4: 70 92 d0 0d sts 0x0DD0, r7 ; 0x800dd0 // set cache to first block of cluster vol_->cacheSetBlockNumber(block, true); // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); 2e7f8: e9 ed ldi r30, 0xD9 ; 217 2e7fa: fd e0 ldi r31, 0x0D ; 13 2e7fc: 80 e0 ldi r24, 0x00 ; 0 2e7fe: 92 e0 ldi r25, 0x02 ; 2 2e800: df 01 movw r26, r30 2e802: 9c 01 movw r18, r24 2e804: 1d 92 st X+, r1 2e806: 21 50 subi r18, 0x01 ; 1 2e808: 30 40 sbci r19, 0x00 ; 0 2e80a: e1 f7 brne .-8 ; 0x2e804 // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 2e80c: dd 24 eor r13, r13 2e80e: d3 94 inc r13 2e810: d7 01 movw r26, r14 2e812: 59 96 adiw r26, 0x19 ; 25 2e814: ed 91 ld r30, X+ 2e816: fc 91 ld r31, X 2e818: 84 81 ldd r24, Z+4 ; 0x04 2e81a: d8 16 cp r13, r24 2e81c: 98 f4 brcc .+38 ; 0x2e844 return cluster >= FAT32EOC_MIN; } bool readBlock(uint32_t block, uint8_t* dst) { return sdCard_->readBlock(block, dst);} bool writeBlock(uint32_t block, const uint8_t* dst) { return sdCard_->writeBlock(block, dst); 2e81e: 29 ed ldi r18, 0xD9 ; 217 2e820: 3d e0 ldi r19, 0x0D ; 13 2e822: b3 01 movw r22, r6 2e824: a2 01 movw r20, r4 2e826: 4d 0d add r20, r13 2e828: 51 1d adc r21, r1 2e82a: 61 1d adc r22, r1 2e82c: 71 1d adc r23, r1 2e82e: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 2e832: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 2e836: 0f 94 4f 70 call 0x2e09e ; 0x2e09e if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; 2e83a: 88 23 and r24, r24 2e83c: 09 f4 brne .+2 ; 0x2e840 2e83e: a6 ce rjmp .-692 ; 0x2e58c // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 2e840: d3 94 inc r13 2e842: e6 cf rjmp .-52 ; 0x2e810 if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; } // Increase directory file size by cluster size fileSize_ += 512UL << vol_->clusterSizeShift_; 2e844: 25 85 ldd r18, Z+13 ; 0x0d 2e846: 80 e0 ldi r24, 0x00 ; 0 2e848: 92 e0 ldi r25, 0x02 ; 2 2e84a: a0 e0 ldi r26, 0x00 ; 0 2e84c: b0 e0 ldi r27, 0x00 ; 0 2e84e: 04 c0 rjmp .+8 ; 0x2e858 2e850: 88 0f add r24, r24 2e852: 99 1f adc r25, r25 2e854: aa 1f adc r26, r26 2e856: bb 1f adc r27, r27 2e858: 2a 95 dec r18 2e85a: d2 f7 brpl .-12 ; 0x2e850 2e85c: f7 01 movw r30, r14 2e85e: 41 89 ldd r20, Z+17 ; 0x11 2e860: 52 89 ldd r21, Z+18 ; 0x12 2e862: 63 89 ldd r22, Z+19 ; 0x13 2e864: 74 89 ldd r23, Z+20 ; 0x14 2e866: 84 0f add r24, r20 2e868: 95 1f adc r25, r21 2e86a: a6 1f adc r26, r22 2e86c: b7 1f adc r27, r23 2e86e: 81 8b std Z+17, r24 ; 0x11 2e870: 92 8b std Z+18, r25 ; 0x12 2e872: a3 8b std Z+19, r26 ; 0x13 2e874: b4 8b std Z+20, r27 ; 0x14 // add and zero cluster for dirFile - first cluster is in cache for write if (!dirFile->addDirCluster()) goto fail; // use first entry in cluster p = dirFile->vol_->cache()->dir; 2e876: 89 ed ldi r24, 0xD9 ; 217 2e878: 9d e0 ldi r25, 0x0D ; 13 index = 0; 2e87a: d1 2c mov r13, r1 2e87c: db ce rjmp .-586 ; 0x2e634 // make sure it is a normal file or subdirectory if (DIR_IS_FILE(p)) { fileSize_ = p->fileSize; type_ = FAT_FILE_TYPE_NORMAL; } else if (DIR_IS_SUBDIR(p)) { 2e87e: 20 31 cpi r18, 0x10 ; 16 2e880: 61 f4 brne .+24 ; 0x2e89a if (!vol_->chainSize(firstCluster_, &fileSize_)) goto fail; 2e882: 98 01 movw r18, r16 2e884: 2f 5e subi r18, 0xEF ; 239 2e886: 3f 4f sbci r19, 0xFF ; 255 2e888: 0f 94 bf 37 call 0x26f7e ; 0x26f7e 2e88c: 88 23 and r24, r24 2e88e: 29 f0 breq .+10 ; 0x2e89a type_ = FAT_FILE_TYPE_SUBDIR; 2e890: 84 e0 ldi r24, 0x04 ; 4 2e892: d8 01 movw r26, r16 2e894: 13 96 adiw r26, 0x03 ; 3 2e896: 8c 93 st X, r24 2e898: 44 cf rjmp .-376 ; 0x2e722 curPosition_ = 0; if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; 2e89a: d8 01 movw r26, r16 2e89c: 13 96 adiw r26, 0x03 ; 3 2e89e: 1c 92 st X, r1 2e8a0: 75 ce rjmp .-790 ; 0x2e58c 0002e8a2 : } #endif // Return True if a character was found static inline bool code_seen(char code) { return (strchr_pointer = strchr(CMDBUFFER_CURRENT_STRING, code)) != NULL; } static inline bool code_seen_P(const char *code_PROGMEM) { return (strchr_pointer = strstr_P(CMDBUFFER_CURRENT_STRING, code_PROGMEM)) != NULL; } 2e8a2: 20 91 cb 11 lds r18, 0x11CB ; 0x8011cb 2e8a6: 30 91 cc 11 lds r19, 0x11CC ; 0x8011cc 2e8aa: bc 01 movw r22, r24 2e8ac: c9 01 movw r24, r18 2e8ae: 8f 51 subi r24, 0x1F ; 31 2e8b0: 90 4f sbci r25, 0xF0 ; 240 2e8b2: 0f 94 e3 9d call 0x33bc6 ; 0x33bc6 2e8b6: 9c 01 movw r18, r24 2e8b8: 90 93 f6 16 sts 0x16F6, r25 ; 0x8016f6 2e8bc: 80 93 f5 16 sts 0x16F5, r24 ; 0x8016f5 2e8c0: 81 e0 ldi r24, 0x01 ; 1 2e8c2: 23 2b or r18, r19 2e8c4: 09 f4 brne .+2 ; 0x2e8c8 2e8c6: 80 e0 ldi r24, 0x00 ; 0 2e8c8: 08 95 ret 0002e8ca : } } uint16_t planner_calc_sd_length() { uint8_t _block_buffer_head = block_buffer_head; 2e8ca: 60 91 a8 0d lds r22, 0x0DA8 ; 0x800da8 uint8_t _block_buffer_tail = block_buffer_tail; 2e8ce: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 uint16_t sdlen = 0; 2e8d2: 30 e0 ldi r19, 0x00 ; 0 2e8d4: 20 e0 ldi r18, 0x00 ; 0 while (_block_buffer_head != _block_buffer_tail) { sdlen += block_buffer[_block_buffer_tail].sdlen; 2e8d6: 8e e6 ldi r24, 0x6E ; 110 uint16_t planner_calc_sd_length() { uint8_t _block_buffer_head = block_buffer_head; uint8_t _block_buffer_tail = block_buffer_tail; uint16_t sdlen = 0; while (_block_buffer_head != _block_buffer_tail) 2e8d8: 96 17 cp r25, r22 2e8da: 61 f0 breq .+24 ; 0x2e8f4 { sdlen += block_buffer[_block_buffer_tail].sdlen; 2e8dc: 89 9f mul r24, r25 2e8de: f0 01 movw r30, r0 2e8e0: 11 24 eor r1, r1 2e8e2: ec 5c subi r30, 0xCC ; 204 2e8e4: f8 4f sbci r31, 0xF8 ; 248 2e8e6: 40 81 ld r20, Z 2e8e8: 51 81 ldd r21, Z+1 ; 0x01 2e8ea: 24 0f add r18, r20 2e8ec: 35 1f adc r19, r21 _block_buffer_tail = (_block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 2e8ee: 9f 5f subi r25, 0xFF ; 255 2e8f0: 9f 70 andi r25, 0x0F ; 15 2e8f2: f2 cf rjmp .-28 ; 0x2e8d8 } return sdlen; } 2e8f4: c9 01 movw r24, r18 2e8f6: 08 95 ret 0002e8f8 : } #endif /* PLANNER_DIAGNOSTICS */ void planner_add_sd_length(uint16_t sdlen) { if (block_buffer_head != block_buffer_tail) { 2e8f8: 30 91 a8 0d lds r19, 0x0DA8 ; 0x800da8 2e8fc: 20 91 a9 0d lds r18, 0x0DA9 ; 0x800da9 2e900: 32 17 cp r19, r18 2e902: 91 f0 breq .+36 ; 0x2e928 // The planner buffer is not empty. Get the index of the last buffer line entered, // which is (block_buffer_head - 1) modulo BLOCK_BUFFER_SIZE. block_buffer[prev_block_index(block_buffer_head)].sdlen += sdlen; 2e904: e0 91 a8 0d lds r30, 0x0DA8 ; 0x800da8 } // Returns the index of the previous block in the ring buffer static inline uint8_t prev_block_index(uint8_t block_index) { if (block_index == 0) 2e908: e1 11 cpse r30, r1 2e90a: 01 c0 rjmp .+2 ; 0x2e90e block_index = BLOCK_BUFFER_SIZE; 2e90c: e0 e1 ldi r30, 0x10 ; 16 -- block_index; 2e90e: e1 50 subi r30, 0x01 ; 1 void planner_add_sd_length(uint16_t sdlen) { if (block_buffer_head != block_buffer_tail) { // The planner buffer is not empty. Get the index of the last buffer line entered, // which is (block_buffer_head - 1) modulo BLOCK_BUFFER_SIZE. block_buffer[prev_block_index(block_buffer_head)].sdlen += sdlen; 2e910: 2e e6 ldi r18, 0x6E ; 110 2e912: e2 9f mul r30, r18 2e914: f0 01 movw r30, r0 2e916: 11 24 eor r1, r1 2e918: ec 5c subi r30, 0xCC ; 204 2e91a: f8 4f sbci r31, 0xF8 ; 248 2e91c: 20 81 ld r18, Z 2e91e: 31 81 ldd r19, Z+1 ; 0x01 2e920: 82 0f add r24, r18 2e922: 93 1f adc r25, r19 2e924: 91 83 std Z+1, r25 ; 0x01 2e926: 80 83 st Z, r24 } else { // There is no line stored in the planner buffer, which means the last command does not need to be revertible, // at a power panic, so the length of this command may be forgotten. } } 2e928: 08 95 ret 0002e92a : } #endif //PREVENT_DANGEROUS_EXTRUDE // Calculate the steps/s^2 acceleration rates, based on the mm/s^s void reset_acceleration_rates() { 2e92a: cf 92 push r12 2e92c: df 92 push r13 2e92e: ef 92 push r14 2e930: ff 92 push r15 2e932: 0f 93 push r16 2e934: 1f 93 push r17 2e936: cf 93 push r28 2e938: df 93 push r29 2e93a: 06 e3 ldi r16, 0x36 ; 54 2e93c: 14 e0 ldi r17, 0x04 ; 4 2e93e: c5 ee ldi r28, 0xE5 ; 229 2e940: d6 e1 ldi r29, 0x16 ; 22 2e942: 85 ef ldi r24, 0xF5 ; 245 2e944: c8 2e mov r12, r24 2e946: 86 e1 ldi r24, 0x16 ; 22 2e948: d8 2e mov r13, r24 2e94a: 78 01 movw r14, r16 2e94c: 0c 5f subi r16, 0xFC ; 252 2e94e: 1f 4f sbci r17, 0xFF ; 255 for(int8_t i=0; i < NUM_AXIS; i++) max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * cs.axis_steps_per_mm[i]; 2e950: f7 01 movw r30, r14 2e952: 60 a1 ldd r22, Z+32 ; 0x20 2e954: 71 a1 ldd r23, Z+33 ; 0x21 2e956: 82 a1 ldd r24, Z+34 ; 0x22 2e958: 93 a1 ldd r25, Z+35 ; 0x23 2e95a: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 2e95e: f7 01 movw r30, r14 2e960: 20 81 ld r18, Z 2e962: 31 81 ldd r19, Z+1 ; 0x01 2e964: 42 81 ldd r20, Z+2 ; 0x02 2e966: 53 81 ldd r21, Z+3 ; 0x03 2e968: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2e96c: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 2e970: 69 93 st Y+, r22 2e972: 79 93 st Y+, r23 2e974: 89 93 st Y+, r24 2e976: 99 93 st Y+, r25 #endif //PREVENT_DANGEROUS_EXTRUDE // Calculate the steps/s^2 acceleration rates, based on the mm/s^s void reset_acceleration_rates() { for(int8_t i=0; i < NUM_AXIS; i++) 2e978: cc 16 cp r12, r28 2e97a: dd 06 cpc r13, r29 2e97c: 31 f7 brne .-52 ; 0x2e94a max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * cs.axis_steps_per_mm[i]; } 2e97e: df 91 pop r29 2e980: cf 91 pop r28 2e982: 1f 91 pop r17 2e984: 0f 91 pop r16 2e986: ff 90 pop r15 2e988: ef 90 pop r14 2e98a: df 90 pop r13 2e98c: cf 90 pop r12 2e98e: 08 95 ret 0002e990 : } void plan_set_e_position(const float &e) { #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 2e990: fc 01 movw r30, r24 2e992: 40 81 ld r20, Z 2e994: 51 81 ldd r21, Z+1 ; 0x01 2e996: 62 81 ldd r22, Z+2 ; 0x02 2e998: 73 81 ldd r23, Z+3 ; 0x03 2e99a: 40 93 10 04 sts 0x0410, r20 ; 0x800410 2e99e: 50 93 11 04 sts 0x0411, r21 ; 0x800411 2e9a2: 60 93 12 04 sts 0x0412, r22 ; 0x800412 2e9a6: 70 93 13 04 sts 0x0413, r23 ; 0x800413 #endif position[E_AXIS] = lround(e*cs.axis_steps_per_mm[E_AXIS]); 2e9aa: 20 91 42 04 lds r18, 0x0442 ; 0x800442 2e9ae: 30 91 43 04 lds r19, 0x0443 ; 0x800443 2e9b2: 40 91 44 04 lds r20, 0x0444 ; 0x800444 2e9b6: 50 91 45 04 lds r21, 0x0445 ; 0x800445 2e9ba: 60 81 ld r22, Z 2e9bc: 71 81 ldd r23, Z+1 ; 0x01 2e9be: 82 81 ldd r24, Z+2 ; 0x02 2e9c0: 93 81 ldd r25, Z+3 ; 0x03 2e9c2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2e9c6: 0f 94 41 a4 call 0x34882 ; 0x34882 2e9ca: e6 ea ldi r30, 0xA6 ; 166 2e9cc: f6 e0 ldi r31, 0x06 ; 6 2e9ce: 64 87 std Z+12, r22 ; 0x0c 2e9d0: 75 87 std Z+13, r23 ; 0x0d 2e9d2: 86 87 std Z+14, r24 ; 0x0e 2e9d4: 97 87 std Z+15, r25 ; 0x0f CRITICAL_SECTION_END; } void st_set_e_position(const long &e) { CRITICAL_SECTION_START; 2e9d6: 8f b7 in r24, 0x3f ; 63 2e9d8: f8 94 cli count_position[E_AXIS] = e; 2e9da: 44 85 ldd r20, Z+12 ; 0x0c 2e9dc: 55 85 ldd r21, Z+13 ; 0x0d 2e9de: 66 85 ldd r22, Z+14 ; 0x0e 2e9e0: 77 85 ldd r23, Z+15 ; 0x0f 2e9e2: 40 93 c2 06 sts 0x06C2, r20 ; 0x8006c2 2e9e6: 50 93 c3 06 sts 0x06C3, r21 ; 0x8006c3 2e9ea: 60 93 c4 06 sts 0x06C4, r22 ; 0x8006c4 2e9ee: 70 93 c5 06 sts 0x06C5, r23 ; 0x8006c5 CRITICAL_SECTION_END; 2e9f2: 8f bf out 0x3f, r24 ; 63 st_set_e_position(position[E_AXIS]); } 2e9f4: 08 95 ret 0002e9f6 : // Only useful in the bed leveling routine, when the mesh bed leveling is off. void plan_set_z_position(const float &z) { #ifdef LIN_ADVANCE position_float[Z_AXIS] = z; 2e9f6: fc 01 movw r30, r24 2e9f8: 40 81 ld r20, Z 2e9fa: 51 81 ldd r21, Z+1 ; 0x01 2e9fc: 62 81 ldd r22, Z+2 ; 0x02 2e9fe: 73 81 ldd r23, Z+3 ; 0x03 2ea00: 40 93 0c 04 sts 0x040C, r20 ; 0x80040c 2ea04: 50 93 0d 04 sts 0x040D, r21 ; 0x80040d 2ea08: 60 93 0e 04 sts 0x040E, r22 ; 0x80040e 2ea0c: 70 93 0f 04 sts 0x040F, r23 ; 0x80040f #endif position[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 2ea10: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 2ea14: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 2ea18: 40 91 40 04 lds r20, 0x0440 ; 0x800440 2ea1c: 50 91 41 04 lds r21, 0x0441 ; 0x800441 2ea20: 60 81 ld r22, Z 2ea22: 71 81 ldd r23, Z+1 ; 0x01 2ea24: 82 81 ldd r24, Z+2 ; 0x02 2ea26: 93 81 ldd r25, Z+3 ; 0x03 2ea28: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2ea2c: 0f 94 41 a4 call 0x34882 ; 0x34882 2ea30: 60 93 ae 06 sts 0x06AE, r22 ; 0x8006ae 2ea34: 70 93 af 06 sts 0x06AF, r23 ; 0x8006af 2ea38: 80 93 b0 06 sts 0x06B0, r24 ; 0x8006b0 2ea3c: 90 93 b1 06 sts 0x06B1, r25 ; 0x8006b1 st_set_position(position); 2ea40: 0d 94 73 53 jmp 0x2a6e6 ; 0x2a6e6 0002ea44 : // Add a new linear movement to the buffer. steps_x, _y and _z is the absolute position in // mm. Microseconds specify how many microseconds the move should take to perform. To aid acceleration // calculation the caller must also provide the physical length of the line in millimeters. void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate, const float* gcode_start_position, uint16_t segment_idx) { 2ea44: 2f 92 push r2 2ea46: 3f 92 push r3 2ea48: 4f 92 push r4 2ea4a: 5f 92 push r5 2ea4c: 6f 92 push r6 2ea4e: 7f 92 push r7 2ea50: 8f 92 push r8 2ea52: 9f 92 push r9 2ea54: af 92 push r10 2ea56: bf 92 push r11 2ea58: cf 92 push r12 2ea5a: df 92 push r13 2ea5c: ef 92 push r14 2ea5e: ff 92 push r15 2ea60: 0f 93 push r16 2ea62: 1f 93 push r17 2ea64: cf 93 push r28 2ea66: df 93 push r29 2ea68: cd b7 in r28, 0x3d ; 61 2ea6a: de b7 in r29, 0x3e ; 62 2ea6c: c4 58 subi r28, 0x84 ; 132 2ea6e: d1 09 sbc r29, r1 2ea70: 0f b6 in r0, 0x3f ; 63 2ea72: f8 94 cli 2ea74: de bf out 0x3e, r29 ; 62 2ea76: 0f be out 0x3f, r0 ; 63 2ea78: cd bf out 0x3d, r28 ; 61 2ea7a: 69 a3 std Y+33, r22 ; 0x21 2ea7c: 7a a3 std Y+34, r23 ; 0x22 2ea7e: 8b a3 std Y+35, r24 ; 0x23 2ea80: 9c a3 std Y+36, r25 ; 0x24 2ea82: 2d a3 std Y+37, r18 ; 0x25 2ea84: 3e a3 std Y+38, r19 ; 0x26 2ea86: 4f a3 std Y+39, r20 ; 0x27 2ea88: 58 a7 std Y+40, r21 ; 0x28 2ea8a: a7 96 adiw r28, 0x27 ; 39 2ea8c: ec ae std Y+60, r14 ; 0x3c 2ea8e: fd ae std Y+61, r15 ; 0x3d 2ea90: 0e af std Y+62, r16 ; 0x3e 2ea92: 1f af std Y+63, r17 ; 0x3f 2ea94: a7 97 sbiw r28, 0x27 ; 39 2ea96: a9 96 adiw r28, 0x29 ; 41 2ea98: df ae std Y+63, r13 ; 0x3f 2ea9a: ce ae std Y+62, r12 ; 0x3e 2ea9c: a9 97 sbiw r28, 0x29 ; 41 2ea9e: 89 ae std Y+57, r8 ; 0x39 2eaa0: 99 aa std Y+49, r9 ; 0x31 2eaa2: ad ae std Y+61, r10 ; 0x3d 2eaa4: bd aa std Y+53, r11 ; 0x35 2eaa6: c6 56 subi r28, 0x66 ; 102 2eaa8: df 4f sbci r29, 0xFF ; 255 2eaaa: 08 81 ld r16, Y 2eaac: 19 81 ldd r17, Y+1 ; 0x01 2eaae: ca 59 subi r28, 0x9A ; 154 2eab0: d0 40 sbci r29, 0x00 ; 0 // CRITICAL_SECTION_START; //prevent stack overflow in ISR // printf_P(PSTR("plan_buffer_line(%f, %f, %f, %f, %f, %u, [%f,%f,%f,%f], %u)\n"), x, y, z, e, feed_rate, extruder, gcode_start_position[0], gcode_start_position[1], gcode_start_position[2], gcode_start_position[3], segment_idx); // CRITICAL_SECTION_END; // Calculate the buffer head after we push this byte uint8_t next_buffer_head = next_block_index(block_buffer_head); 2eab2: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 static bool plan_reset_next_e_sched; // Returns the index of the next block in the ring buffer // NOTE: Removed modulo (%) operator, which uses an expensive divide and multiplication. static inline uint8_t next_block_index(uint8_t block_index) { if (++ block_index == BLOCK_BUFFER_SIZE) 2eab6: 8f 5f subi r24, 0xFF ; 255 2eab8: a0 96 adiw r28, 0x20 ; 32 2eaba: 8f af std Y+63, r24 ; 0x3f 2eabc: a0 97 sbiw r28, 0x20 ; 32 2eabe: 80 31 cpi r24, 0x10 ; 16 2eac0: 19 f4 brne .+6 ; 0x2eac8 block_index = 0; 2eac2: a0 96 adiw r28, 0x20 ; 32 2eac4: 1f ae std Y+63, r1 ; 0x3f 2eac6: a0 97 sbiw r28, 0x20 ; 32 // Calculate the buffer head after we push this byte uint8_t next_buffer_head = next_block_index(block_buffer_head); // If the buffer is full: good! That means we are well ahead of the robot. // Rest here until there is room in the buffer. if (block_buffer_tail == next_buffer_head) { 2eac8: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 2eacc: a0 96 adiw r28, 0x20 ; 32 2eace: 2f ad ldd r18, Y+63 ; 0x3f 2ead0: a0 97 sbiw r28, 0x20 ; 32 2ead2: 82 13 cpse r24, r18 2ead4: 0f c0 rjmp .+30 ; 0x2eaf4 do { manage_heater(); 2ead6: 0f 94 5b 32 call 0x264b6 ; 0x264b6 // Vojtech: Don't disable motors inside the planner! manage_inactivity(false); 2eada: 80 e0 ldi r24, 0x00 ; 0 2eadc: 0e 94 01 7a call 0xf402 ; 0xf402 lcd_update(0); 2eae0: 80 e0 ldi r24, 0x00 ; 0 2eae2: 0e 94 42 69 call 0xd284 ; 0xd284 } while (block_buffer_tail == next_buffer_head); 2eae6: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 2eaea: a0 96 adiw r28, 0x20 ; 32 2eaec: 3f ad ldd r19, Y+63 ; 0x3f 2eaee: a0 97 sbiw r28, 0x20 ; 32 2eaf0: 83 17 cp r24, r19 2eaf2: 89 f3 breq .-30 ; 0x2ead6 } #ifdef PLANNER_DIAGNOSTICS planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ if(planner_aborted) { 2eaf4: 40 91 ac 0d lds r20, 0x0DAC ; 0x800dac 2eaf8: a1 96 adiw r28, 0x21 ; 33 2eafa: 4f af std Y+63, r20 ; 0x3f 2eafc: a1 97 sbiw r28, 0x21 ; 33 2eafe: 44 23 and r20, r20 2eb00: 11 f1 breq .+68 ; 0x2eb46 // avoid planning the block early if aborted SERIAL_ECHO_START; 2eb02: 81 e6 ldi r24, 0x61 ; 97 2eb04: 9d e9 ldi r25, 0x9D ; 157 2eb06: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLNRPGM(_n("Move aborted")); 2eb0a: 87 e7 ldi r24, 0x77 ; 119 2eb0c: 9c e6 ldi r25, 0x6C ; 108 2eb0e: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 // The stepper timer interrupt will run continuously from now on. // If there are no planner blocks to be executed by the stepper routine, // the stepper interrupt ticks at 1kHz to wake up and pick a block // from the planner queue if available. ENABLE_STEPPER_DRIVER_INTERRUPT(); } 2eb12: cc 57 subi r28, 0x7C ; 124 2eb14: df 4f sbci r29, 0xFF ; 255 2eb16: 0f b6 in r0, 0x3f ; 63 2eb18: f8 94 cli 2eb1a: de bf out 0x3e, r29 ; 62 2eb1c: 0f be out 0x3f, r0 ; 63 2eb1e: cd bf out 0x3d, r28 ; 61 2eb20: df 91 pop r29 2eb22: cf 91 pop r28 2eb24: 1f 91 pop r17 2eb26: 0f 91 pop r16 2eb28: ff 90 pop r15 2eb2a: ef 90 pop r14 2eb2c: df 90 pop r13 2eb2e: cf 90 pop r12 2eb30: bf 90 pop r11 2eb32: af 90 pop r10 2eb34: 9f 90 pop r9 2eb36: 8f 90 pop r8 2eb38: 7f 90 pop r7 2eb3a: 6f 90 pop r6 2eb3c: 5f 90 pop r5 2eb3e: 4f 90 pop r4 2eb40: 3f 90 pop r3 2eb42: 2f 90 pop r2 2eb44: 08 95 ret SERIAL_ECHOLNRPGM(_n("Move aborted")); return; } // Prepare to set up new block block_t *block = &block_buffer[block_buffer_head]; 2eb46: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 2eb4a: 29 2e mov r2, r25 2eb4c: 31 2c mov r3, r1 2eb4e: 8e e6 ldi r24, 0x6E ; 110 2eb50: 98 9f mul r25, r24 2eb52: d0 01 movw r26, r0 2eb54: 11 24 eor r1, r1 2eb56: a3 96 adiw r28, 0x23 ; 35 2eb58: bf af std Y+63, r27 ; 0x3f 2eb5a: ae af std Y+62, r26 ; 0x3e 2eb5c: a3 97 sbiw r28, 0x23 ; 35 // Mark block as not busy (Not executed by the stepper interrupt, could be still tinkered with.) block->busy = false; 2eb5e: cd 01 movw r24, r26 2eb60: 88 53 subi r24, 0x38 ; 56 2eb62: 99 4f sbci r25, 0xF9 ; 249 2eb64: fc 01 movw r30, r24 2eb66: e9 5b subi r30, 0xB9 ; 185 2eb68: ff 4f sbci r31, 0xFF ; 255 2eb6a: 10 82 st Z, r1 // Set sdlen for calculating sd position block->sdlen = 0; 2eb6c: 84 59 subi r24, 0x94 ; 148 2eb6e: 9f 4f sbci r25, 0xFF ; 255 2eb70: fc 01 movw r30, r24 2eb72: 11 82 std Z+1, r1 ; 0x01 2eb74: 10 82 st Z, r1 // Save original start position of the move if (gcode_start_position) 2eb76: 01 15 cp r16, r1 2eb78: 11 05 cpc r17, r1 2eb7a: 11 f4 brne .+4 ; 0x2eb80 2eb7c: 0d 94 0f 80 jmp 0x3001e ; 0x3001e memcpy(block->gcode_start_position, gcode_start_position, sizeof(block_t::gcode_start_position)); 2eb80: 80 e1 ldi r24, 0x10 ; 16 2eb82: f8 01 movw r30, r16 2eb84: a0 5e subi r26, 0xE0 ; 224 2eb86: b8 4f sbci r27, 0xF8 ; 248 else memcpy(block->gcode_start_position, current_position, sizeof(block_t::gcode_start_position)); 2eb88: 01 90 ld r0, Z+ 2eb8a: 0d 92 st X+, r0 2eb8c: 8a 95 dec r24 2eb8e: e1 f7 brne .-8 ; 0x2eb88 // Save the index of this segment (when a single G0/1/2/3 command plans multiple segments) block->segment_idx = segment_idx; 2eb90: 8e e6 ldi r24, 0x6E ; 110 2eb92: 82 9d mul r24, r2 2eb94: 80 01 movw r16, r0 2eb96: 83 9d mul r24, r3 2eb98: 10 0d add r17, r0 2eb9a: 11 24 eor r1, r1 2eb9c: 08 53 subi r16, 0x38 ; 56 2eb9e: 19 4f sbci r17, 0xF9 ; 249 2eba0: f8 01 movw r30, r16 2eba2: e8 59 subi r30, 0x98 ; 152 2eba4: ff 4f sbci r31, 0xFF ; 255 2eba6: c4 56 subi r28, 0x64 ; 100 2eba8: df 4f sbci r29, 0xFF ; 255 2ebaa: 88 81 ld r24, Y 2ebac: 99 81 ldd r25, Y+1 ; 0x01 2ebae: cc 59 subi r28, 0x9C ; 156 2ebb0: d0 40 sbci r29, 0x00 ; 0 2ebb2: 91 83 std Z+1, r25 ; 0x01 2ebb4: 80 83 st Z, r24 // Save the global feedrate at scheduling time block->gcode_feedrate = feedrate; 2ebb6: 06 59 subi r16, 0x96 ; 150 2ebb8: 1f 4f sbci r17, 0xFF ; 255 2ebba: 60 91 7a 02 lds r22, 0x027A ; 0x80027a 2ebbe: 70 91 7b 02 lds r23, 0x027B ; 0x80027b 2ebc2: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 2ebc6: 90 91 7d 02 lds r25, 0x027D ; 0x80027d 2ebca: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 2ebce: d8 01 movw r26, r16 2ebd0: 6d 93 st X+, r22 2ebd2: 7c 93 st X, r23 // Reset the starting E position when requested if (plan_reset_next_e_queue) 2ebd4: 80 91 ef 03 lds r24, 0x03EF ; 0x8003ef <_ZL23plan_reset_next_e_queue.lto_priv.448> 2ebd8: 88 23 and r24, r24 2ebda: a9 f0 breq .+42 ; 0x2ec06 { position[E_AXIS] = 0; 2ebdc: 10 92 b2 06 sts 0x06B2, r1 ; 0x8006b2 2ebe0: 10 92 b3 06 sts 0x06B3, r1 ; 0x8006b3 2ebe4: 10 92 b4 06 sts 0x06B4, r1 ; 0x8006b4 2ebe8: 10 92 b5 06 sts 0x06B5, r1 ; 0x8006b5 #ifdef LIN_ADVANCE position_float[E_AXIS] = 0; 2ebec: 10 92 10 04 sts 0x0410, r1 ; 0x800410 2ebf0: 10 92 11 04 sts 0x0411, r1 ; 0x800411 2ebf4: 10 92 12 04 sts 0x0412, r1 ; 0x800412 2ebf8: 10 92 13 04 sts 0x0413, r1 ; 0x800413 #endif // the block might still be discarded later, but we need to ensure the lower-level // count_position is also reset correctly for consistent results! plan_reset_next_e_queue = false; 2ebfc: 10 92 ef 03 sts 0x03EF, r1 ; 0x8003ef <_ZL23plan_reset_next_e_queue.lto_priv.448> plan_reset_next_e_sched = true; 2ec00: 81 e0 ldi r24, 0x01 ; 1 2ec02: 80 93 ee 03 sts 0x03EE, r24 ; 0x8003ee <_ZL23plan_reset_next_e_sched.lto_priv.449> } // Apply the machine correction matrix. world2machine(x, y); 2ec06: be 01 movw r22, r28 2ec08: 6b 5d subi r22, 0xDB ; 219 2ec0a: 7f 4f sbci r23, 0xFF ; 255 2ec0c: ce 01 movw r24, r28 2ec0e: 81 96 adiw r24, 0x21 ; 33 2ec10: 0e 94 fe 62 call 0xc5fc ; 0xc5fc // The target position of the tool in absolute steps // Calculate target position in absolute steps //this should be done after the wait, because otherwise a M92 code within the gcode disrupts this calculation somehow long target[4]; target[X_AXIS] = lround(x*cs.axis_steps_per_mm[X_AXIS]); 2ec14: c9 a0 ldd r12, Y+33 ; 0x21 2ec16: da a0 ldd r13, Y+34 ; 0x22 2ec18: eb a0 ldd r14, Y+35 ; 0x23 2ec1a: fc a0 ldd r15, Y+36 ; 0x24 2ec1c: 20 91 36 04 lds r18, 0x0436 ; 0x800436 2ec20: 30 91 37 04 lds r19, 0x0437 ; 0x800437 2ec24: 40 91 38 04 lds r20, 0x0438 ; 0x800438 2ec28: 50 91 39 04 lds r21, 0x0439 ; 0x800439 2ec2c: c7 01 movw r24, r14 2ec2e: b6 01 movw r22, r12 2ec30: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2ec34: 0f 94 41 a4 call 0x34882 ; 0x34882 2ec38: c3 58 subi r28, 0x83 ; 131 2ec3a: df 4f sbci r29, 0xFF ; 255 2ec3c: 68 83 st Y, r22 2ec3e: 79 83 std Y+1, r23 ; 0x01 2ec40: 8a 83 std Y+2, r24 ; 0x02 2ec42: 9b 83 std Y+3, r25 ; 0x03 2ec44: cd 57 subi r28, 0x7D ; 125 2ec46: d0 40 sbci r29, 0x00 ; 0 target[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 2ec48: 8d a0 ldd r8, Y+37 ; 0x25 2ec4a: 9e a0 ldd r9, Y+38 ; 0x26 2ec4c: af a0 ldd r10, Y+39 ; 0x27 2ec4e: b8 a4 ldd r11, Y+40 ; 0x28 2ec50: 20 91 3a 04 lds r18, 0x043A ; 0x80043a 2ec54: 30 91 3b 04 lds r19, 0x043B ; 0x80043b 2ec58: 40 91 3c 04 lds r20, 0x043C ; 0x80043c 2ec5c: 50 91 3d 04 lds r21, 0x043D ; 0x80043d 2ec60: c5 01 movw r24, r10 2ec62: b4 01 movw r22, r8 2ec64: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2ec68: 0f 94 41 a4 call 0x34882 ; 0x34882 2ec6c: cf 57 subi r28, 0x7F ; 127 2ec6e: df 4f sbci r29, 0xFF ; 255 2ec70: 68 83 st Y, r22 2ec72: 79 83 std Y+1, r23 ; 0x01 2ec74: 8a 83 std Y+2, r24 ; 0x02 2ec76: 9b 83 std Y+3, r25 ; 0x03 2ec78: c1 58 subi r28, 0x81 ; 129 2ec7a: d0 40 sbci r29, 0x00 ; 0 #ifdef MESH_BED_LEVELING if (mbl.active){ 2ec7c: 80 91 9c 12 lds r24, 0x129C ; 0x80129c 2ec80: 88 23 and r24, r24 2ec82: 11 f4 brne .+4 ; 0x2ec88 2ec84: 0d 94 16 80 jmp 0x3002c ; 0x3002c target[Z_AXIS] = lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]); 2ec88: a5 01 movw r20, r10 2ec8a: 94 01 movw r18, r8 2ec8c: c7 01 movw r24, r14 2ec8e: b6 01 movw r22, r12 2ec90: 0f 94 08 60 call 0x2c010 ; 0x2c010 2ec94: a7 96 adiw r28, 0x27 ; 39 2ec96: 2c ad ldd r18, Y+60 ; 0x3c 2ec98: 3d ad ldd r19, Y+61 ; 0x3d 2ec9a: 4e ad ldd r20, Y+62 ; 0x3e 2ec9c: 5f ad ldd r21, Y+63 ; 0x3f 2ec9e: a7 97 sbiw r28, 0x27 ; 39 2eca0: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2eca4: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 2eca8: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 2ecac: 40 91 40 04 lds r20, 0x0440 ; 0x800440 2ecb0: 50 91 41 04 lds r21, 0x0441 ; 0x800441 }else{ target[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 2ecb4: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2ecb8: 0f 94 41 a4 call 0x34882 ; 0x34882 2ecbc: e5 96 adiw r28, 0x35 ; 53 2ecbe: 6c af std Y+60, r22 ; 0x3c 2ecc0: 7d af std Y+61, r23 ; 0x3d 2ecc2: 8e af std Y+62, r24 ; 0x3e 2ecc4: 9f af std Y+63, r25 ; 0x3f 2ecc6: e5 97 sbiw r28, 0x35 ; 53 } #else target[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); #endif // ENABLE_MESH_BED_LEVELING target[E_AXIS] = lround(e*cs.axis_steps_per_mm[E_AXIS]); 2ecc8: a9 96 adiw r28, 0x29 ; 41 2ecca: ee ad ldd r30, Y+62 ; 0x3e 2eccc: ff ad ldd r31, Y+63 ; 0x3f 2ecce: a9 97 sbiw r28, 0x29 ; 41 2ecd0: 80 80 ld r8, Z 2ecd2: 91 80 ldd r9, Z+1 ; 0x01 2ecd4: a2 80 ldd r10, Z+2 ; 0x02 2ecd6: b3 80 ldd r11, Z+3 ; 0x03 2ecd8: 20 91 42 04 lds r18, 0x0442 ; 0x800442 2ecdc: 30 91 43 04 lds r19, 0x0443 ; 0x800443 2ece0: 40 91 44 04 lds r20, 0x0444 ; 0x800444 2ece4: 50 91 45 04 lds r21, 0x0445 ; 0x800445 2ece8: c5 01 movw r24, r10 2ecea: b4 01 movw r22, r8 2ecec: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2ecf0: 0f 94 41 a4 call 0x34882 ; 0x34882 2ecf4: ad 96 adiw r28, 0x2d ; 45 2ecf6: 6c af std Y+60, r22 ; 0x3c 2ecf8: 7d af std Y+61, r23 ; 0x3d 2ecfa: 8e af std Y+62, r24 ; 0x3e 2ecfc: 9f af std Y+63, r25 ; 0x3f 2ecfe: ad 97 sbiw r28, 0x2d ; 45 // Calculate subtraction to re-use result in many places // This saves memory and speeds up calculations int32_t de = target[E_AXIS] - position[E_AXIS]; 2ed00: 80 91 b2 06 lds r24, 0x06B2 ; 0x8006b2 2ed04: 90 91 b3 06 lds r25, 0x06B3 ; 0x8006b3 2ed08: a0 91 b4 06 lds r26, 0x06B4 ; 0x8006b4 2ed0c: b0 91 b5 06 lds r27, 0x06B5 ; 0x8006b5 2ed10: ad 96 adiw r28, 0x2d ; 45 2ed12: 4c ac ldd r4, Y+60 ; 0x3c 2ed14: 5d ac ldd r5, Y+61 ; 0x3d 2ed16: 6e ac ldd r6, Y+62 ; 0x3e 2ed18: 7f ac ldd r7, Y+63 ; 0x3f 2ed1a: ad 97 sbiw r28, 0x2d ; 45 2ed1c: 48 1a sub r4, r24 2ed1e: 59 0a sbc r5, r25 2ed20: 6a 0a sbc r6, r26 2ed22: 7b 0a sbc r7, r27 int32_t dx = target[X_AXIS] - position[X_AXIS]; 2ed24: 80 91 a6 06 lds r24, 0x06A6 ; 0x8006a6 2ed28: 90 91 a7 06 lds r25, 0x06A7 ; 0x8006a7 2ed2c: a0 91 a8 06 lds r26, 0x06A8 ; 0x8006a8 2ed30: b0 91 a9 06 lds r27, 0x06A9 ; 0x8006a9 2ed34: c3 58 subi r28, 0x83 ; 131 2ed36: df 4f sbci r29, 0xFF ; 255 2ed38: c8 80 ld r12, Y 2ed3a: d9 80 ldd r13, Y+1 ; 0x01 2ed3c: ea 80 ldd r14, Y+2 ; 0x02 2ed3e: fb 80 ldd r15, Y+3 ; 0x03 2ed40: cd 57 subi r28, 0x7D ; 125 2ed42: d0 40 sbci r29, 0x00 ; 0 2ed44: c8 1a sub r12, r24 2ed46: d9 0a sbc r13, r25 2ed48: ea 0a sbc r14, r26 2ed4a: fb 0a sbc r15, r27 int32_t dy = target[Y_AXIS] - position[Y_AXIS]; 2ed4c: 80 91 aa 06 lds r24, 0x06AA ; 0x8006aa 2ed50: 90 91 ab 06 lds r25, 0x06AB ; 0x8006ab 2ed54: a0 91 ac 06 lds r26, 0x06AC ; 0x8006ac 2ed58: b0 91 ad 06 lds r27, 0x06AD ; 0x8006ad 2ed5c: cf 57 subi r28, 0x7F ; 127 2ed5e: df 4f sbci r29, 0xFF ; 255 2ed60: 28 81 ld r18, Y 2ed62: 39 81 ldd r19, Y+1 ; 0x01 2ed64: 4a 81 ldd r20, Y+2 ; 0x02 2ed66: 5b 81 ldd r21, Y+3 ; 0x03 2ed68: c1 58 subi r28, 0x81 ; 129 2ed6a: d0 40 sbci r29, 0x00 ; 0 2ed6c: 28 1b sub r18, r24 2ed6e: 39 0b sbc r19, r25 2ed70: 4a 0b sbc r20, r26 2ed72: 5b 0b sbc r21, r27 2ed74: 29 a7 std Y+41, r18 ; 0x29 2ed76: 3a a7 std Y+42, r19 ; 0x2a 2ed78: 4b a7 std Y+43, r20 ; 0x2b 2ed7a: 5c a7 std Y+44, r21 ; 0x2c int32_t dz = target[Z_AXIS] - position[Z_AXIS]; 2ed7c: 80 91 ae 06 lds r24, 0x06AE ; 0x8006ae 2ed80: 90 91 af 06 lds r25, 0x06AF ; 0x8006af 2ed84: a0 91 b0 06 lds r26, 0x06B0 ; 0x8006b0 2ed88: b0 91 b1 06 lds r27, 0x06B1 ; 0x8006b1 2ed8c: e5 96 adiw r28, 0x35 ; 53 2ed8e: 2c ad ldd r18, Y+60 ; 0x3c 2ed90: 3d ad ldd r19, Y+61 ; 0x3d 2ed92: 4e ad ldd r20, Y+62 ; 0x3e 2ed94: 5f ad ldd r21, Y+63 ; 0x3f 2ed96: e5 97 sbiw r28, 0x35 ; 53 2ed98: 28 1b sub r18, r24 2ed9a: 39 0b sbc r19, r25 2ed9c: 4a 0b sbc r20, r26 2ed9e: 5b 0b sbc r21, r27 2eda0: 2d a7 std Y+45, r18 ; 0x2d 2eda2: 3e a7 std Y+46, r19 ; 0x2e 2eda4: 4f a7 std Y+47, r20 ; 0x2f 2eda6: 58 ab std Y+48, r21 ; 0x30 #ifdef PREVENT_DANGEROUS_EXTRUDE if(de) 2eda8: 41 14 cp r4, r1 2edaa: 51 04 cpc r5, r1 2edac: 61 04 cpc r6, r1 2edae: 71 04 cpc r7, r1 2edb0: 09 f4 brne .+2 ; 0x2edb4 2edb2: 80 c0 rjmp .+256 ; 0x2eeb4 { if((int)degHotend(active_extruder) 2edb8: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 2edbc: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 2edc0: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 2edc4: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 2edc8: 20 91 57 02 lds r18, 0x0257 ; 0x800257 2edcc: 30 91 58 02 lds r19, 0x0258 ; 0x800258 2edd0: 62 17 cp r22, r18 2edd2: 73 07 cpc r23, r19 2edd4: 0c f5 brge .+66 ; 0x2ee18 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 2edd6: ad 96 adiw r28, 0x2d ; 45 2edd8: 8c ad ldd r24, Y+60 ; 0x3c 2edda: 9d ad ldd r25, Y+61 ; 0x3d 2eddc: ae ad ldd r26, Y+62 ; 0x3e 2edde: bf ad ldd r27, Y+63 ; 0x3f 2ede0: ad 97 sbiw r28, 0x2d ; 45 2ede2: 80 93 b2 06 sts 0x06B2, r24 ; 0x8006b2 2ede6: 90 93 b3 06 sts 0x06B3, r25 ; 0x8006b3 2edea: a0 93 b4 06 sts 0x06B4, r26 ; 0x8006b4 2edee: b0 93 b5 06 sts 0x06B5, r27 ; 0x8006b5 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 2edf2: 80 92 10 04 sts 0x0410, r8 ; 0x800410 2edf6: 90 92 11 04 sts 0x0411, r9 ; 0x800411 2edfa: a0 92 12 04 sts 0x0412, r10 ; 0x800412 2edfe: b0 92 13 04 sts 0x0413, r11 ; 0x800413 #endif de = 0; // no difference SERIAL_ECHO_START; 2ee02: 81 e6 ldi r24, 0x61 ; 97 2ee04: 9d e9 ldi r25, 0x9D ; 157 2ee06: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLNRPGM(_n(" cold extrusion prevented"));////MSG_ERR_COLD_EXTRUDE_STOP 2ee0a: 8d e5 ldi r24, 0x5D ; 93 2ee0c: 9c e6 ldi r25, 0x6C ; 108 2ee0e: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part #ifdef LIN_ADVANCE position_float[E_AXIS] = e; #endif de = 0; // no difference 2ee12: 41 2c mov r4, r1 2ee14: 51 2c mov r5, r1 2ee16: 32 01 movw r6, r4 SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n(" cold extrusion prevented"));////MSG_ERR_COLD_EXTRUDE_STOP } #ifdef PREVENT_LENGTHY_EXTRUDE if(labs(de) > cs.axis_steps_per_mm[E_AXIS]*EXTRUDE_MAXLENGTH) 2ee18: c3 01 movw r24, r6 2ee1a: b2 01 movw r22, r4 2ee1c: 77 fe sbrs r7, 7 2ee1e: 07 c0 rjmp .+14 ; 0x2ee2e 2ee20: 66 27 eor r22, r22 2ee22: 77 27 eor r23, r23 2ee24: cb 01 movw r24, r22 2ee26: 64 19 sub r22, r4 2ee28: 75 09 sbc r23, r5 2ee2a: 86 09 sbc r24, r6 2ee2c: 97 09 sbc r25, r7 2ee2e: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2ee32: 4b 01 movw r8, r22 2ee34: 5c 01 movw r10, r24 2ee36: 20 e0 ldi r18, 0x00 ; 0 2ee38: 30 e0 ldi r19, 0x00 ; 0 2ee3a: 48 ee ldi r20, 0xE8 ; 232 2ee3c: 53 e4 ldi r21, 0x43 ; 67 2ee3e: 60 91 42 04 lds r22, 0x0442 ; 0x800442 2ee42: 70 91 43 04 lds r23, 0x0443 ; 0x800443 2ee46: 80 91 44 04 lds r24, 0x0444 ; 0x800444 2ee4a: 90 91 45 04 lds r25, 0x0445 ; 0x800445 2ee4e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2ee52: 9b 01 movw r18, r22 2ee54: ac 01 movw r20, r24 2ee56: c5 01 movw r24, r10 2ee58: b4 01 movw r22, r8 2ee5a: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 2ee5e: 18 16 cp r1, r24 2ee60: 4c f5 brge .+82 ; 0x2eeb4 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 2ee62: ad 96 adiw r28, 0x2d ; 45 2ee64: 2c ad ldd r18, Y+60 ; 0x3c 2ee66: 3d ad ldd r19, Y+61 ; 0x3d 2ee68: 4e ad ldd r20, Y+62 ; 0x3e 2ee6a: 5f ad ldd r21, Y+63 ; 0x3f 2ee6c: ad 97 sbiw r28, 0x2d ; 45 2ee6e: 20 93 b2 06 sts 0x06B2, r18 ; 0x8006b2 2ee72: 30 93 b3 06 sts 0x06B3, r19 ; 0x8006b3 2ee76: 40 93 b4 06 sts 0x06B4, r20 ; 0x8006b4 2ee7a: 50 93 b5 06 sts 0x06B5, r21 ; 0x8006b5 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 2ee7e: a9 96 adiw r28, 0x29 ; 41 2ee80: ee ad ldd r30, Y+62 ; 0x3e 2ee82: ff ad ldd r31, Y+63 ; 0x3f 2ee84: a9 97 sbiw r28, 0x29 ; 41 2ee86: 80 81 ld r24, Z 2ee88: 91 81 ldd r25, Z+1 ; 0x01 2ee8a: a2 81 ldd r26, Z+2 ; 0x02 2ee8c: b3 81 ldd r27, Z+3 ; 0x03 2ee8e: 80 93 10 04 sts 0x0410, r24 ; 0x800410 2ee92: 90 93 11 04 sts 0x0411, r25 ; 0x800411 2ee96: a0 93 12 04 sts 0x0412, r26 ; 0x800412 2ee9a: b0 93 13 04 sts 0x0413, r27 ; 0x800413 #endif de = 0; // no difference SERIAL_ECHO_START; 2ee9e: 81 e6 ldi r24, 0x61 ; 97 2eea0: 9d e9 ldi r25, 0x9D ; 157 2eea2: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLNRPGM(_n(" too long extrusion prevented"));////MSG_ERR_LONG_EXTRUDE_STOP 2eea6: 8f e3 ldi r24, 0x3F ; 63 2eea8: 9c e6 ldi r25, 0x6C ; 108 2eeaa: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part #ifdef LIN_ADVANCE position_float[E_AXIS] = e; #endif de = 0; // no difference 2eeae: 41 2c mov r4, r1 2eeb0: 51 2c mov r5, r1 2eeb2: 32 01 movw r6, r4 #endif //PREVENT_DANGEROUS_EXTRUDE // Number of steps for each axis #ifndef COREXY // default non-h-bot planning block->steps[X_AXIS].wide = labs(dx); 2eeb4: 8e e6 ldi r24, 0x6E ; 110 2eeb6: 82 9d mul r24, r2 2eeb8: f0 01 movw r30, r0 2eeba: 83 9d mul r24, r3 2eebc: f0 0d add r31, r0 2eebe: 11 24 eor r1, r1 2eec0: e8 53 subi r30, 0x38 ; 56 2eec2: f9 4f sbci r31, 0xF9 ; 249 2eec4: d7 01 movw r26, r14 2eec6: c6 01 movw r24, r12 2eec8: f7 fe sbrs r15, 7 2eeca: 07 c0 rjmp .+14 ; 0x2eeda 2eecc: 88 27 eor r24, r24 2eece: 99 27 eor r25, r25 2eed0: dc 01 movw r26, r24 2eed2: 8c 19 sub r24, r12 2eed4: 9d 09 sbc r25, r13 2eed6: ae 09 sbc r26, r14 2eed8: bf 09 sbc r27, r15 2eeda: 80 83 st Z, r24 2eedc: 91 83 std Z+1, r25 ; 0x01 2eede: a2 83 std Z+2, r26 ; 0x02 2eee0: b3 83 std Z+3, r27 ; 0x03 block->steps[Y_AXIS].wide = labs(dy); 2eee2: 8e e6 ldi r24, 0x6E ; 110 2eee4: 82 9d mul r24, r2 2eee6: f0 01 movw r30, r0 2eee8: 83 9d mul r24, r3 2eeea: f0 0d add r31, r0 2eeec: 11 24 eor r1, r1 2eeee: e8 53 subi r30, 0x38 ; 56 2eef0: f9 4f sbci r31, 0xF9 ; 249 2eef2: 89 a5 ldd r24, Y+41 ; 0x29 2eef4: 9a a5 ldd r25, Y+42 ; 0x2a 2eef6: ab a5 ldd r26, Y+43 ; 0x2b 2eef8: bc a5 ldd r27, Y+44 ; 0x2c 2eefa: b7 ff sbrs r27, 7 2eefc: 07 c0 rjmp .+14 ; 0x2ef0c 2eefe: b0 95 com r27 2ef00: a0 95 com r26 2ef02: 90 95 com r25 2ef04: 81 95 neg r24 2ef06: 9f 4f sbci r25, 0xFF ; 255 2ef08: af 4f sbci r26, 0xFF ; 255 2ef0a: bf 4f sbci r27, 0xFF ; 255 2ef0c: 84 83 std Z+4, r24 ; 0x04 2ef0e: 95 83 std Z+5, r25 ; 0x05 2ef10: a6 83 std Z+6, r26 ; 0x06 2ef12: b7 83 std Z+7, r27 ; 0x07 // corexy planning // these equations follow the form of the dA and dB equations on http://www.corexy.com/theory.html block->steps[X_AXIS].wide = labs(dx + dy); block->steps[Y_AXIS].wide = labs(dx - dy); #endif block->steps[Z_AXIS].wide = labs(dz); 2ef14: 8e e6 ldi r24, 0x6E ; 110 2ef16: 82 9d mul r24, r2 2ef18: f0 01 movw r30, r0 2ef1a: 83 9d mul r24, r3 2ef1c: f0 0d add r31, r0 2ef1e: 11 24 eor r1, r1 2ef20: e8 53 subi r30, 0x38 ; 56 2ef22: f9 4f sbci r31, 0xF9 ; 249 2ef24: 8d a5 ldd r24, Y+45 ; 0x2d 2ef26: 9e a5 ldd r25, Y+46 ; 0x2e 2ef28: af a5 ldd r26, Y+47 ; 0x2f 2ef2a: b8 a9 ldd r27, Y+48 ; 0x30 2ef2c: b7 ff sbrs r27, 7 2ef2e: 07 c0 rjmp .+14 ; 0x2ef3e 2ef30: b0 95 com r27 2ef32: a0 95 com r26 2ef34: 90 95 com r25 2ef36: 81 95 neg r24 2ef38: 9f 4f sbci r25, 0xFF ; 255 2ef3a: af 4f sbci r26, 0xFF ; 255 2ef3c: bf 4f sbci r27, 0xFF ; 255 2ef3e: 80 87 std Z+8, r24 ; 0x08 2ef40: 91 87 std Z+9, r25 ; 0x09 2ef42: a2 87 std Z+10, r26 ; 0x0a 2ef44: b3 87 std Z+11, r27 ; 0x0b block->steps[E_AXIS].wide = labs(de); 2ef46: b3 01 movw r22, r6 2ef48: a2 01 movw r20, r4 2ef4a: 77 fe sbrs r7, 7 2ef4c: 07 c0 rjmp .+14 ; 0x2ef5c 2ef4e: 44 27 eor r20, r20 2ef50: 55 27 eor r21, r21 2ef52: ba 01 movw r22, r20 2ef54: 44 19 sub r20, r4 2ef56: 55 09 sbc r21, r5 2ef58: 66 09 sbc r22, r6 2ef5a: 77 09 sbc r23, r7 2ef5c: 8e e6 ldi r24, 0x6E ; 110 2ef5e: 82 9d mul r24, r2 2ef60: f0 01 movw r30, r0 2ef62: 83 9d mul r24, r3 2ef64: f0 0d add r31, r0 2ef66: 11 24 eor r1, r1 2ef68: e8 53 subi r30, 0x38 ; 56 2ef6a: f9 4f sbci r31, 0xF9 ; 249 2ef6c: 44 87 std Z+12, r20 ; 0x0c 2ef6e: 55 87 std Z+13, r21 ; 0x0d 2ef70: 66 87 std Z+14, r22 ; 0x0e 2ef72: 77 87 std Z+15, r23 ; 0x0f block->step_event_count.wide = max(block->steps[X_AXIS].wide, max(block->steps[Y_AXIS].wide, max(block->steps[Z_AXIS].wide, block->steps[E_AXIS].wide))); 2ef74: 00 81 ld r16, Z 2ef76: 11 81 ldd r17, Z+1 ; 0x01 2ef78: 22 81 ldd r18, Z+2 ; 0x02 2ef7a: 33 81 ldd r19, Z+3 ; 0x03 2ef7c: 84 81 ldd r24, Z+4 ; 0x04 2ef7e: 95 81 ldd r25, Z+5 ; 0x05 2ef80: a6 81 ldd r26, Z+6 ; 0x06 2ef82: b7 81 ldd r27, Z+7 ; 0x07 2ef84: 80 17 cp r24, r16 2ef86: 91 07 cpc r25, r17 2ef88: a2 07 cpc r26, r18 2ef8a: b3 07 cpc r27, r19 2ef8c: 14 f4 brge .+4 ; 0x2ef92 2ef8e: d9 01 movw r26, r18 2ef90: c8 01 movw r24, r16 2ef92: ee e6 ldi r30, 0x6E ; 110 2ef94: be 2e mov r11, r30 2ef96: b2 9c mul r11, r2 2ef98: f0 01 movw r30, r0 2ef9a: b3 9c mul r11, r3 2ef9c: f0 0d add r31, r0 2ef9e: 11 24 eor r1, r1 2efa0: e8 53 subi r30, 0x38 ; 56 2efa2: f9 4f sbci r31, 0xF9 ; 249 2efa4: 80 84 ldd r8, Z+8 ; 0x08 2efa6: 91 84 ldd r9, Z+9 ; 0x09 2efa8: a2 84 ldd r10, Z+10 ; 0x0a 2efaa: b3 84 ldd r11, Z+11 ; 0x0b 2efac: 88 15 cp r24, r8 2efae: 99 05 cpc r25, r9 2efb0: aa 05 cpc r26, r10 2efb2: bb 05 cpc r27, r11 2efb4: 14 f4 brge .+4 ; 0x2efba 2efb6: d5 01 movw r26, r10 2efb8: c4 01 movw r24, r8 2efba: 84 17 cp r24, r20 2efbc: 95 07 cpc r25, r21 2efbe: a6 07 cpc r26, r22 2efc0: b7 07 cpc r27, r23 2efc2: 14 f4 brge .+4 ; 0x2efc8 2efc4: db 01 movw r26, r22 2efc6: ca 01 movw r24, r20 2efc8: 4e e6 ldi r20, 0x6E ; 110 2efca: 42 9d mul r20, r2 2efcc: f0 01 movw r30, r0 2efce: 43 9d mul r20, r3 2efd0: f0 0d add r31, r0 2efd2: 11 24 eor r1, r1 2efd4: e8 53 subi r30, 0x38 ; 56 2efd6: f9 4f sbci r31, 0xF9 ; 249 2efd8: 80 8b std Z+16, r24 ; 0x10 2efda: 91 8b std Z+17, r25 ; 0x11 2efdc: a2 8b std Z+18, r26 ; 0x12 2efde: b3 8b std Z+19, r27 ; 0x13 // Bail if this is a zero-length block if (block->step_event_count.wide <= dropsegments) 2efe0: 06 97 sbiw r24, 0x06 ; 6 2efe2: a1 05 cpc r26, r1 2efe4: b1 05 cpc r27, r1 2efe6: 0c f4 brge .+2 ; 0x2efea 2efe8: 94 cd rjmp .-1240 ; 0x2eb12 planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ return; } block->fan_speed = fanSpeed; 2efea: 80 91 e9 11 lds r24, 0x11E9 ; 0x8011e9 2efee: df 01 movw r26, r30 2eff0: aa 5b subi r26, 0xBA ; 186 2eff2: bf 4f sbci r27, 0xFF ; 255 2eff4: 8c 93 st X, r24 // Compute direction bits for this block block->direction_bits = 0; #ifndef COREXY if (dx < 0) block->direction_bits |= _BV(X_AXIS); 2eff6: f7 fe sbrs r15, 7 2eff8: 02 c0 rjmp .+4 ; 0x2effe 2effa: 0d 94 26 80 jmp 0x3004c ; 0x3004c } block->fan_speed = fanSpeed; // Compute direction bits for this block block->direction_bits = 0; 2effe: 10 8e std Z+24, r1 ; 0x18 #ifndef COREXY if (dx < 0) block->direction_bits |= _BV(X_AXIS); if (dy < 0) block->direction_bits |= _BV(Y_AXIS); 2f000: 89 a5 ldd r24, Y+41 ; 0x29 2f002: 9a a5 ldd r25, Y+42 ; 0x2a 2f004: ab a5 ldd r26, Y+43 ; 0x2b 2f006: bc a5 ldd r27, Y+44 ; 0x2c 2f008: b7 ff sbrs r27, 7 2f00a: 0b c0 rjmp .+22 ; 0x2f022 2f00c: 8e e6 ldi r24, 0x6E ; 110 2f00e: 82 9d mul r24, r2 2f010: f0 01 movw r30, r0 2f012: 83 9d mul r24, r3 2f014: f0 0d add r31, r0 2f016: 11 24 eor r1, r1 2f018: e8 53 subi r30, 0x38 ; 56 2f01a: f9 4f sbci r31, 0xF9 ; 249 2f01c: 80 8d ldd r24, Z+24 ; 0x18 2f01e: 82 60 ori r24, 0x02 ; 2 2f020: 80 8f std Z+24, r24 ; 0x18 #else if (dx + dy < 0) block->direction_bits |= _BV(X_AXIS); if (dx - dy < 0) block->direction_bits |= _BV(Y_AXIS); #endif if (dz < 0) block->direction_bits |= _BV(Z_AXIS); 2f022: 8d a5 ldd r24, Y+45 ; 0x2d 2f024: 9e a5 ldd r25, Y+46 ; 0x2e 2f026: af a5 ldd r26, Y+47 ; 0x2f 2f028: b8 a9 ldd r27, Y+48 ; 0x30 2f02a: b7 ff sbrs r27, 7 2f02c: 0b c0 rjmp .+22 ; 0x2f044 2f02e: 8e e6 ldi r24, 0x6E ; 110 2f030: 82 9d mul r24, r2 2f032: f0 01 movw r30, r0 2f034: 83 9d mul r24, r3 2f036: f0 0d add r31, r0 2f038: 11 24 eor r1, r1 2f03a: e8 53 subi r30, 0x38 ; 56 2f03c: f9 4f sbci r31, 0xF9 ; 249 2f03e: 80 8d ldd r24, Z+24 ; 0x18 2f040: 84 60 ori r24, 0x04 ; 4 2f042: 80 8f std Z+24, r24 ; 0x18 if (de < 0) block->direction_bits |= _BV(E_AXIS); 2f044: 77 fe sbrs r7, 7 2f046: 0b c0 rjmp .+22 ; 0x2f05e 2f048: 8e e6 ldi r24, 0x6E ; 110 2f04a: 82 9d mul r24, r2 2f04c: f0 01 movw r30, r0 2f04e: 83 9d mul r24, r3 2f050: f0 0d add r31, r0 2f052: 11 24 eor r1, r1 2f054: e8 53 subi r30, 0x38 ; 56 2f056: f9 4f sbci r31, 0xF9 ; 249 2f058: 80 8d ldd r24, Z+24 ; 0x18 2f05a: 88 60 ori r24, 0x08 ; 8 2f05c: 80 8f std Z+24, r24 ; 0x18 { enable_x(); enable_y(); } #else if(block->steps[X_AXIS].wide != 0) enable_x(); 2f05e: 01 2b or r16, r17 2f060: 02 2b or r16, r18 2f062: 03 2b or r16, r19 2f064: 09 f0 breq .+2 ; 0x2f068 2f066: 17 98 cbi 0x02, 7 ; 2 if(block->steps[Y_AXIS].wide != 0) enable_y(); 2f068: 8e e6 ldi r24, 0x6E ; 110 2f06a: 82 9d mul r24, r2 2f06c: f0 01 movw r30, r0 2f06e: 83 9d mul r24, r3 2f070: f0 0d add r31, r0 2f072: 11 24 eor r1, r1 2f074: e8 53 subi r30, 0x38 ; 56 2f076: f9 4f sbci r31, 0xF9 ; 249 2f078: 84 81 ldd r24, Z+4 ; 0x04 2f07a: 95 81 ldd r25, Z+5 ; 0x05 2f07c: a6 81 ldd r26, Z+6 ; 0x06 2f07e: b7 81 ldd r27, Z+7 ; 0x07 2f080: 89 2b or r24, r25 2f082: 8a 2b or r24, r26 2f084: 8b 2b or r24, r27 2f086: 09 f0 breq .+2 ; 0x2f08a 2f088: 16 98 cbi 0x02, 6 ; 2 #endif if(block->steps[Z_AXIS].wide != 0) enable_z(); 2f08a: 8e e6 ldi r24, 0x6E ; 110 2f08c: 82 9d mul r24, r2 2f08e: f0 01 movw r30, r0 2f090: 83 9d mul r24, r3 2f092: f0 0d add r31, r0 2f094: 11 24 eor r1, r1 2f096: e8 53 subi r30, 0x38 ; 56 2f098: f9 4f sbci r31, 0xF9 ; 249 2f09a: 80 85 ldd r24, Z+8 ; 0x08 2f09c: 91 85 ldd r25, Z+9 ; 0x09 2f09e: a2 85 ldd r26, Z+10 ; 0x0a 2f0a0: b3 85 ldd r27, Z+11 ; 0x0b 2f0a2: 89 2b or r24, r25 2f0a4: 8a 2b or r24, r26 2f0a6: 8b 2b or r24, r27 2f0a8: 09 f0 breq .+2 ; 0x2f0ac 2f0aa: 15 98 cbi 0x02, 5 ; 2 if(block->steps[E_AXIS].wide != 0) enable_e0(); 2f0ac: 8e e6 ldi r24, 0x6E ; 110 2f0ae: 82 9d mul r24, r2 2f0b0: f0 01 movw r30, r0 2f0b2: 83 9d mul r24, r3 2f0b4: f0 0d add r31, r0 2f0b6: 11 24 eor r1, r1 2f0b8: e8 53 subi r30, 0x38 ; 56 2f0ba: f9 4f sbci r31, 0xF9 ; 249 2f0bc: 84 85 ldd r24, Z+12 ; 0x0c 2f0be: 95 85 ldd r25, Z+13 ; 0x0d 2f0c0: a6 85 ldd r26, Z+14 ; 0x0e 2f0c2: b7 85 ldd r27, Z+15 ; 0x0f 2f0c4: 89 2b or r24, r25 2f0c6: 8a 2b or r24, r26 2f0c8: 8b 2b or r24, r27 2f0ca: 09 f0 breq .+2 ; 0x2f0ce 2f0cc: 14 98 cbi 0x02, 4 ; 2 if (block->steps[E_AXIS].wide == 0) 2f0ce: 8e e6 ldi r24, 0x6E ; 110 2f0d0: 82 9d mul r24, r2 2f0d2: f0 01 movw r30, r0 2f0d4: 83 9d mul r24, r3 2f0d6: f0 0d add r31, r0 2f0d8: 11 24 eor r1, r1 2f0da: e8 53 subi r30, 0x38 ; 56 2f0dc: f9 4f sbci r31, 0xF9 ; 249 2f0de: 24 85 ldd r18, Z+12 ; 0x0c 2f0e0: 35 85 ldd r19, Z+13 ; 0x0d 2f0e2: 46 85 ldd r20, Z+14 ; 0x0e 2f0e4: 57 85 ldd r21, Z+15 ; 0x0f 2f0e6: 2a 96 adiw r28, 0x0a ; 10 2f0e8: 2c af std Y+60, r18 ; 0x3c 2f0ea: 3d af std Y+61, r19 ; 0x3d 2f0ec: 4e af std Y+62, r20 ; 0x3e 2f0ee: 5f af std Y+63, r21 ; 0x3f 2f0f0: 2a 97 sbiw r28, 0x0a ; 10 2f0f2: 23 2b or r18, r19 2f0f4: 24 2b or r18, r20 2f0f6: 25 2b or r18, r21 2f0f8: 09 f0 breq .+2 ; 0x2f0fc 2f0fa: ac c7 rjmp .+3928 ; 0x30054 { if(feed_rate 2f100: b0 90 73 04 lds r11, 0x0473 ; 0x800473 2f104: 00 91 74 04 lds r16, 0x0474 ; 0x800474 2f108: 10 91 75 04 lds r17, 0x0475 ; 0x800475 } else { if(feed_rate 2f11c: 18 16 cp r1, r24 2f11e: 24 f4 brge .+8 ; 0x2f128 2f120: a9 ae std Y+57, r10 ; 0x39 2f122: b9 aa std Y+49, r11 ; 0x31 2f124: 0d af std Y+61, r16 ; 0x3d 2f126: 1d ab std Y+53, r17 ; 0x35 So we need to create other 2 "AXIS", named X_HEAD and Y_HEAD, meaning the real displacement of the Head. Having the real displacement of the head, we can calculate the total movement length and apply the desired speed. */ #ifndef COREXY float delta_mm[4]; delta_mm[X_AXIS] = dx / cs.axis_steps_per_mm[X_AXIS]; 2f128: c7 01 movw r24, r14 2f12a: b6 01 movw r22, r12 2f12c: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2f130: 20 91 36 04 lds r18, 0x0436 ; 0x800436 2f134: 30 91 37 04 lds r19, 0x0437 ; 0x800437 2f138: 40 91 38 04 lds r20, 0x0438 ; 0x800438 2f13c: 50 91 39 04 lds r21, 0x0439 ; 0x800439 2f140: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2f144: 4b 01 movw r8, r22 2f146: 5c 01 movw r10, r24 2f148: 89 82 std Y+1, r8 ; 0x01 2f14a: 9a 82 std Y+2, r9 ; 0x02 2f14c: ab 82 std Y+3, r10 ; 0x03 2f14e: bc 82 std Y+4, r11 ; 0x04 delta_mm[Y_AXIS] = dy / cs.axis_steps_per_mm[Y_AXIS]; 2f150: 69 a5 ldd r22, Y+41 ; 0x29 2f152: 7a a5 ldd r23, Y+42 ; 0x2a 2f154: 8b a5 ldd r24, Y+43 ; 0x2b 2f156: 9c a5 ldd r25, Y+44 ; 0x2c 2f158: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2f15c: 20 91 3a 04 lds r18, 0x043A ; 0x80043a 2f160: 30 91 3b 04 lds r19, 0x043B ; 0x80043b 2f164: 40 91 3c 04 lds r20, 0x043C ; 0x80043c 2f168: 50 91 3d 04 lds r21, 0x043D ; 0x80043d 2f16c: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2f170: 6b 01 movw r12, r22 2f172: 7c 01 movw r14, r24 2f174: cd 82 std Y+5, r12 ; 0x05 2f176: de 82 std Y+6, r13 ; 0x06 2f178: ef 82 std Y+7, r14 ; 0x07 2f17a: f8 86 std Y+8, r15 ; 0x08 delta_mm[X_HEAD] = dx / cs.axis_steps_per_mm[X_AXIS]; delta_mm[Y_HEAD] = dy / cs.axis_steps_per_mm[Y_AXIS]; delta_mm[X_AXIS] = (dx + dy) / cs.axis_steps_per_mm[X_AXIS]; delta_mm[Y_AXIS] = (dx - dy) / cs.axis_steps_per_mm[Y_AXIS]; #endif delta_mm[Z_AXIS] = dz / cs.axis_steps_per_mm[Z_AXIS]; 2f17c: 6d a5 ldd r22, Y+45 ; 0x2d 2f17e: 7e a5 ldd r23, Y+46 ; 0x2e 2f180: 8f a5 ldd r24, Y+47 ; 0x2f 2f182: 98 a9 ldd r25, Y+48 ; 0x30 2f184: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2f188: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 2f18c: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 2f190: 40 91 40 04 lds r20, 0x0440 ; 0x800440 2f194: 50 91 41 04 lds r21, 0x0441 ; 0x800441 2f198: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2f19c: 22 96 adiw r28, 0x02 ; 2 2f19e: 6c af std Y+60, r22 ; 0x3c 2f1a0: 7d af std Y+61, r23 ; 0x3d 2f1a2: 8e af std Y+62, r24 ; 0x3e 2f1a4: 9f af std Y+63, r25 ; 0x3f 2f1a6: 22 97 sbiw r28, 0x02 ; 2 2f1a8: 69 87 std Y+9, r22 ; 0x09 2f1aa: 7a 87 std Y+10, r23 ; 0x0a 2f1ac: 8b 87 std Y+11, r24 ; 0x0b 2f1ae: 9c 87 std Y+12, r25 ; 0x0c delta_mm[E_AXIS] = de / cs.axis_steps_per_mm[E_AXIS]; 2f1b0: c3 01 movw r24, r6 2f1b2: b2 01 movw r22, r4 2f1b4: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 2f1b8: 20 91 42 04 lds r18, 0x0442 ; 0x800442 2f1bc: 30 91 43 04 lds r19, 0x0443 ; 0x800443 2f1c0: 40 91 44 04 lds r20, 0x0444 ; 0x800444 2f1c4: 50 91 45 04 lds r21, 0x0445 ; 0x800445 2f1c8: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2f1cc: 26 96 adiw r28, 0x06 ; 6 2f1ce: 6c af std Y+60, r22 ; 0x3c 2f1d0: 7d af std Y+61, r23 ; 0x3d 2f1d2: 8e af std Y+62, r24 ; 0x3e 2f1d4: 9f af std Y+63, r25 ; 0x3f 2f1d6: 26 97 sbiw r28, 0x06 ; 6 2f1d8: 6d 87 std Y+13, r22 ; 0x0d 2f1da: 7e 87 std Y+14, r23 ; 0x0e 2f1dc: 8f 87 std Y+15, r24 ; 0x0f 2f1de: 98 8b std Y+16, r25 ; 0x10 if ( block->steps[X_AXIS].wide <=dropsegments && block->steps[Y_AXIS].wide <=dropsegments && block->steps[Z_AXIS].wide <=dropsegments ) 2f1e0: 8e e6 ldi r24, 0x6E ; 110 2f1e2: 82 9d mul r24, r2 2f1e4: f0 01 movw r30, r0 2f1e6: 83 9d mul r24, r3 2f1e8: f0 0d add r31, r0 2f1ea: 11 24 eor r1, r1 2f1ec: e8 53 subi r30, 0x38 ; 56 2f1ee: f9 4f sbci r31, 0xF9 ; 249 2f1f0: 80 81 ld r24, Z 2f1f2: 91 81 ldd r25, Z+1 ; 0x01 2f1f4: a2 81 ldd r26, Z+2 ; 0x02 2f1f6: b3 81 ldd r27, Z+3 ; 0x03 2f1f8: 2e 96 adiw r28, 0x0e ; 14 2f1fa: 8c af std Y+60, r24 ; 0x3c 2f1fc: 9d af std Y+61, r25 ; 0x3d 2f1fe: ae af std Y+62, r26 ; 0x3e 2f200: bf af std Y+63, r27 ; 0x3f 2f202: 2e 97 sbiw r28, 0x0e ; 14 2f204: 06 97 sbiw r24, 0x06 ; 6 2f206: a1 05 cpc r26, r1 2f208: b1 05 cpc r27, r1 2f20a: 0c f0 brlt .+2 ; 0x2f20e 2f20c: 2c c7 rjmp .+3672 ; 0x30066 2f20e: 84 81 ldd r24, Z+4 ; 0x04 2f210: 95 81 ldd r25, Z+5 ; 0x05 2f212: a6 81 ldd r26, Z+6 ; 0x06 2f214: b7 81 ldd r27, Z+7 ; 0x07 2f216: 06 97 sbiw r24, 0x06 ; 6 2f218: a1 05 cpc r26, r1 2f21a: b1 05 cpc r27, r1 2f21c: 0c f0 brlt .+2 ; 0x2f220 2f21e: 23 c7 rjmp .+3654 ; 0x30066 2f220: 80 85 ldd r24, Z+8 ; 0x08 2f222: 91 85 ldd r25, Z+9 ; 0x09 2f224: a2 85 ldd r26, Z+10 ; 0x0a 2f226: b3 85 ldd r27, Z+11 ; 0x0b 2f228: 06 97 sbiw r24, 0x06 ; 6 2f22a: a1 05 cpc r26, r1 2f22c: b1 05 cpc r27, r1 2f22e: 0c f0 brlt .+2 ; 0x2f232 2f230: 1a c7 rjmp .+3636 ; 0x30066 { block->millimeters = fabs(delta_mm[E_AXIS]); 2f232: 26 96 adiw r28, 0x06 ; 6 2f234: 8c ad ldd r24, Y+60 ; 0x3c 2f236: 9d ad ldd r25, Y+61 ; 0x3d 2f238: ae ad ldd r26, Y+62 ; 0x3e 2f23a: bf ad ldd r27, Y+63 ; 0x3f 2f23c: 26 97 sbiw r28, 0x06 ; 6 2f23e: bf 77 andi r27, 0x7F ; 127 2f240: 85 a7 std Z+45, r24 ; 0x2d 2f242: 96 a7 std Z+46, r25 ; 0x2e 2f244: a7 a7 std Z+47, r26 ; 0x2f 2f246: b0 ab std Z+48, r27 ; 0x30 block->millimeters = sqrt(square(delta_mm[X_AXIS]) + square(delta_mm[Y_AXIS]) + square(delta_mm[Z_AXIS])); #else block->millimeters = sqrt(square(delta_mm[X_HEAD]) + square(delta_mm[Y_HEAD]) + square(delta_mm[Z_AXIS])); #endif } float inverse_millimeters = 1.0/block->millimeters; // Inverse millimeters to remove multiple divides 2f248: 8e e6 ldi r24, 0x6E ; 110 2f24a: 82 9d mul r24, r2 2f24c: f0 01 movw r30, r0 2f24e: 83 9d mul r24, r3 2f250: f0 0d add r31, r0 2f252: 11 24 eor r1, r1 2f254: e8 53 subi r30, 0x38 ; 56 2f256: f9 4f sbci r31, 0xF9 ; 249 2f258: 45 a4 ldd r4, Z+45 ; 0x2d 2f25a: 56 a4 ldd r5, Z+46 ; 0x2e 2f25c: 67 a4 ldd r6, Z+47 ; 0x2f 2f25e: 70 a8 ldd r7, Z+48 ; 0x30 2f260: a3 01 movw r20, r6 2f262: 92 01 movw r18, r4 2f264: 60 e0 ldi r22, 0x00 ; 0 2f266: 70 e0 ldi r23, 0x00 ; 0 2f268: 80 e8 ldi r24, 0x80 ; 128 2f26a: 9f e3 ldi r25, 0x3F ; 63 2f26c: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> // Calculate speed in mm/second for each axis. No divide by zero due to previous checks. float inverse_second = feed_rate * inverse_millimeters; 2f270: 29 ad ldd r18, Y+57 ; 0x39 2f272: 39 a9 ldd r19, Y+49 ; 0x31 2f274: 4d ad ldd r20, Y+61 ; 0x3d 2f276: 5d a9 ldd r21, Y+53 ; 0x35 2f278: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2f27c: 6b 01 movw r12, r22 2f27e: 7c 01 movw r14, r24 } //return the nr of buffered moves FORCE_INLINE uint8_t moves_planned() { return (block_buffer_head + BLOCK_BUFFER_SIZE - block_buffer_tail) & (BLOCK_BUFFER_SIZE - 1); 2f280: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 2f284: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 2f288: 89 1b sub r24, r25 2f28a: 8f 70 andi r24, 0x0F ; 15 2f28c: 8d af std Y+61, r24 ; 0x3d // slow down when de buffer starts to empty, rather than wait at the corner for a buffer refill #ifdef SLOWDOWN //FIXME Vojtech: Why moves_queued > 1? Why not >=1? // Can we somehow differentiate the filling of the buffer at the start of a g-code from a buffer draining situation? if (moves_queued > 1 && moves_queued < (BLOCK_BUFFER_SIZE >> 1)) { 2f28e: 82 50 subi r24, 0x02 ; 2 2f290: 86 30 cpi r24, 0x06 ; 6 2f292: 08 f0 brcs .+2 ; 0x2f296 2f294: 40 c0 rjmp .+128 ; 0x2f316 // segment time in micro seconds unsigned long segment_time = lround(1000000.0/inverse_second); 2f296: a7 01 movw r20, r14 2f298: 96 01 movw r18, r12 2f29a: 60 e0 ldi r22, 0x00 ; 0 2f29c: 74 e2 ldi r23, 0x24 ; 36 2f29e: 84 e7 ldi r24, 0x74 ; 116 2f2a0: 99 e4 ldi r25, 0x49 ; 73 2f2a2: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2f2a6: 0f 94 41 a4 call 0x34882 ; 0x34882 2f2aa: 4b 01 movw r8, r22 2f2ac: 5c 01 movw r10, r24 if (segment_time < cs.min_segment_time_us) 2f2ae: 80 91 76 04 lds r24, 0x0476 ; 0x800476 2f2b2: 90 91 77 04 lds r25, 0x0477 ; 0x800477 2f2b6: a0 91 78 04 lds r26, 0x0478 ; 0x800478 2f2ba: b0 91 79 04 lds r27, 0x0479 ; 0x800479 2f2be: 88 16 cp r8, r24 2f2c0: 99 06 cpc r9, r25 2f2c2: aa 06 cpc r10, r26 2f2c4: bb 06 cpc r11, r27 2f2c6: 38 f5 brcc .+78 ; 0x2f316 // buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more. inverse_second=1000000.0/(segment_time+lround(2*(cs.min_segment_time_us-segment_time)/moves_queued)); 2f2c8: bc 01 movw r22, r24 2f2ca: cd 01 movw r24, r26 2f2cc: 68 19 sub r22, r8 2f2ce: 79 09 sbc r23, r9 2f2d0: 8a 09 sbc r24, r10 2f2d2: 9b 09 sbc r25, r11 2f2d4: 66 0f add r22, r22 2f2d6: 77 1f adc r23, r23 2f2d8: 88 1f adc r24, r24 2f2da: 99 1f adc r25, r25 2f2dc: ad ad ldd r26, Y+61 ; 0x3d 2f2de: 2a 2f mov r18, r26 2f2e0: 30 e0 ldi r19, 0x00 ; 0 2f2e2: 50 e0 ldi r21, 0x00 ; 0 2f2e4: 40 e0 ldi r20, 0x00 ; 0 2f2e6: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> 2f2ea: ca 01 movw r24, r20 2f2ec: b9 01 movw r22, r18 2f2ee: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 2f2f2: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 2f2f6: 68 0d add r22, r8 2f2f8: 79 1d adc r23, r9 2f2fa: 8a 1d adc r24, r10 2f2fc: 9b 1d adc r25, r11 2f2fe: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 2f302: 9b 01 movw r18, r22 2f304: ac 01 movw r20, r24 2f306: 60 e0 ldi r22, 0x00 ; 0 2f308: 74 e2 ldi r23, 0x24 ; 36 2f30a: 84 e7 ldi r24, 0x74 ; 116 2f30c: 99 e4 ldi r25, 0x49 ; 73 2f30e: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2f312: 6b 01 movw r12, r22 2f314: 7c 01 movw r14, r24 } #endif // SLOWDOWN block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0 2f316: a3 01 movw r20, r6 2f318: 92 01 movw r18, r4 2f31a: c7 01 movw r24, r14 2f31c: b6 01 movw r22, r12 2f31e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2f322: 6d ab std Y+53, r22 ; 0x35 2f324: 7e ab std Y+54, r23 ; 0x36 2f326: 8f ab std Y+55, r24 ; 0x37 2f328: 98 af std Y+56, r25 ; 0x38 2f32a: 8e e6 ldi r24, 0x6E ; 110 2f32c: 82 9d mul r24, r2 2f32e: 80 01 movw r16, r0 2f330: 83 9d mul r24, r3 2f332: 10 0d add r17, r0 2f334: 11 24 eor r1, r1 2f336: 08 53 subi r16, 0x38 ; 56 2f338: 19 4f sbci r17, 0xF9 ; 249 2f33a: 2d a9 ldd r18, Y+53 ; 0x35 2f33c: 3e a9 ldd r19, Y+54 ; 0x36 2f33e: 4f a9 ldd r20, Y+55 ; 0x37 2f340: 58 ad ldd r21, Y+56 ; 0x38 2f342: d8 01 movw r26, r16 2f344: 91 96 adiw r26, 0x21 ; 33 2f346: 2d 93 st X+, r18 2f348: 3d 93 st X+, r19 2f34a: 4d 93 st X+, r20 2f34c: 5c 93 st X, r21 2f34e: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate = ceil(block->step_event_count.wide * inverse_second); // (step/sec) Always > 0 2f350: 50 96 adiw r26, 0x10 ; 16 2f352: 6d 91 ld r22, X+ 2f354: 7d 91 ld r23, X+ 2f356: 8d 91 ld r24, X+ 2f358: 9c 91 ld r25, X 2f35a: 53 97 sbiw r26, 0x13 ; 19 2f35c: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 2f360: 69 af std Y+57, r22 ; 0x39 2f362: 7a af std Y+58, r23 ; 0x3a 2f364: 8b af std Y+59, r24 ; 0x3b 2f366: 9c af std Y+60, r25 ; 0x3c 2f368: 9b 01 movw r18, r22 2f36a: ac 01 movw r20, r24 2f36c: c7 01 movw r24, r14 2f36e: b6 01 movw r22, r12 2f370: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2f374: 0f 94 e2 a1 call 0x343c4 ; 0x343c4 2f378: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 2f37c: 62 96 adiw r28, 0x12 ; 18 2f37e: 6c af std Y+60, r22 ; 0x3c 2f380: 7d af std Y+61, r23 ; 0x3d 2f382: 8e af std Y+62, r24 ; 0x3e 2f384: 9f af std Y+63, r25 ; 0x3f 2f386: 62 97 sbiw r28, 0x12 ; 18 2f388: f8 01 movw r30, r16 2f38a: 66 ab std Z+54, r22 ; 0x36 2f38c: 77 ab std Z+55, r23 ; 0x37 2f38e: 80 af std Z+56, r24 ; 0x38 2f390: 91 af std Z+57, r25 ; 0x39 2f392: 9e 01 movw r18, r28 2f394: 2f 5f subi r18, 0xFF ; 255 2f396: 3f 4f sbci r19, 0xFF ; 255 2f398: 3a ab std Y+50, r19 ; 0x32 2f39a: 29 ab std Y+49, r18 ; 0x31 2f39c: ae 01 movw r20, r28 2f39e: 4f 5e subi r20, 0xEF ; 239 2f3a0: 5f 4f sbci r21, 0xFF ; 255 2f3a2: 6e 96 adiw r28, 0x1e ; 30 2f3a4: 5f af std Y+63, r21 ; 0x3f 2f3a6: 4e af std Y+62, r20 ; 0x3e 2f3a8: 6e 97 sbiw r28, 0x1e ; 30 2f3aa: 86 e4 ldi r24, 0x46 ; 70 2f3ac: 94 e0 ldi r25, 0x04 ; 4 2f3ae: 68 96 adiw r28, 0x18 ; 24 2f3b0: 9f af std Y+63, r25 ; 0x3f 2f3b2: 8e af std Y+62, r24 ; 0x3e 2f3b4: 68 97 sbiw r28, 0x18 ; 24 2f3b6: 6c 96 adiw r28, 0x1c ; 28 2f3b8: 5f af std Y+63, r21 ; 0x3f 2f3ba: 4e af std Y+62, r20 ; 0x3e 2f3bc: 6c 97 sbiw r28, 0x1c ; 28 // Calculate and limit speed in mm/sec for each axis float current_speed[4]; float speed_factor = 1.0; //factor <=1 do decrease speed 2f3be: 19 a6 std Y+41, r1 ; 0x29 2f3c0: 1d a6 std Y+45, r1 ; 0x2d 2f3c2: 00 e8 ldi r16, 0x80 ; 128 2f3c4: 1f e3 ldi r17, 0x3F ; 63 for(int i=0; i < 4; i++) { current_speed[i] = delta_mm[i] * inverse_second; 2f3c6: a9 a9 ldd r26, Y+49 ; 0x31 2f3c8: ba a9 ldd r27, Y+50 ; 0x32 2f3ca: 2d 91 ld r18, X+ 2f3cc: 3d 91 ld r19, X+ 2f3ce: 4d 91 ld r20, X+ 2f3d0: 5d 91 ld r21, X+ 2f3d2: ba ab std Y+50, r27 ; 0x32 2f3d4: a9 ab std Y+49, r26 ; 0x31 2f3d6: c7 01 movw r24, r14 2f3d8: b6 01 movw r22, r12 2f3da: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2f3de: 6c 96 adiw r28, 0x1c ; 28 2f3e0: ee ad ldd r30, Y+62 ; 0x3e 2f3e2: ff ad ldd r31, Y+63 ; 0x3f 2f3e4: 6c 97 sbiw r28, 0x1c ; 28 2f3e6: 61 93 st Z+, r22 2f3e8: 71 93 st Z+, r23 2f3ea: 81 93 st Z+, r24 2f3ec: 91 93 st Z+, r25 2f3ee: 6c 96 adiw r28, 0x1c ; 28 2f3f0: ff af std Y+63, r31 ; 0x3f 2f3f2: ee af std Y+62, r30 ; 0x3e 2f3f4: 6c 97 sbiw r28, 0x1c ; 28 if(fabs(current_speed[i]) > max_feedrate[i]) 2f3f6: 4b 01 movw r8, r22 2f3f8: 5c 01 movw r10, r24 2f3fa: e8 94 clt 2f3fc: b7 f8 bld r11, 7 2f3fe: 68 96 adiw r28, 0x18 ; 24 2f400: ae ad ldd r26, Y+62 ; 0x3e 2f402: bf ad ldd r27, Y+63 ; 0x3f 2f404: 68 97 sbiw r28, 0x18 ; 24 2f406: 2d 91 ld r18, X+ 2f408: 3d 91 ld r19, X+ 2f40a: 4d 91 ld r20, X+ 2f40c: 5d 91 ld r21, X+ 2f40e: 68 96 adiw r28, 0x18 ; 24 2f410: bf af std Y+63, r27 ; 0x3f 2f412: ae af std Y+62, r26 ; 0x3e 2f414: 68 97 sbiw r28, 0x18 ; 24 2f416: 66 96 adiw r28, 0x16 ; 22 2f418: 2c af std Y+60, r18 ; 0x3c 2f41a: 3d af std Y+61, r19 ; 0x3d 2f41c: 4e af std Y+62, r20 ; 0x3e 2f41e: 5f af std Y+63, r21 ; 0x3f 2f420: 66 97 sbiw r28, 0x16 ; 22 2f422: c5 01 movw r24, r10 2f424: b4 01 movw r22, r8 2f426: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 2f42a: 18 16 cp r1, r24 2f42c: b4 f4 brge .+44 ; 0x2f45a { speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); 2f42e: a5 01 movw r20, r10 2f430: 94 01 movw r18, r8 2f432: 66 96 adiw r28, 0x16 ; 22 2f434: 6c ad ldd r22, Y+60 ; 0x3c 2f436: 7d ad ldd r23, Y+61 ; 0x3d 2f438: 8e ad ldd r24, Y+62 ; 0x3e 2f43a: 9f ad ldd r25, Y+63 ; 0x3f 2f43c: 66 97 sbiw r28, 0x16 ; 22 2f43e: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2f442: 4b 01 movw r8, r22 2f444: 5c 01 movw r10, r24 2f446: 29 a5 ldd r18, Y+41 ; 0x29 2f448: 3d a5 ldd r19, Y+45 ; 0x2d 2f44a: a8 01 movw r20, r16 2f44c: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 2f450: 18 16 cp r1, r24 2f452: 1c f0 brlt .+6 ; 0x2f45a 2f454: 89 a6 std Y+41, r8 ; 0x29 2f456: 9d a6 std Y+45, r9 ; 0x2d 2f458: 85 01 movw r16, r10 block->nominal_rate = ceil(block->step_event_count.wide * inverse_second); // (step/sec) Always > 0 // Calculate and limit speed in mm/sec for each axis float current_speed[4]; float speed_factor = 1.0; //factor <=1 do decrease speed for(int i=0; i < 4; i++) 2f45a: 6e 96 adiw r28, 0x1e ; 30 2f45c: ee ad ldd r30, Y+62 ; 0x3e 2f45e: ff ad ldd r31, Y+63 ; 0x3f 2f460: 6e 97 sbiw r28, 0x1e ; 30 2f462: 29 a9 ldd r18, Y+49 ; 0x31 2f464: 3a a9 ldd r19, Y+50 ; 0x32 2f466: e2 17 cp r30, r18 2f468: f3 07 cpc r31, r19 2f46a: 09 f0 breq .+2 ; 0x2f46e 2f46c: ac cf rjmp .-168 ; 0x2f3c6 speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); } } // Correct the speed if( speed_factor < 1.0) 2f46e: 20 e0 ldi r18, 0x00 ; 0 2f470: 30 e0 ldi r19, 0x00 ; 0 2f472: 40 e8 ldi r20, 0x80 ; 128 2f474: 5f e3 ldi r21, 0x3F ; 63 2f476: 69 a5 ldd r22, Y+41 ; 0x29 2f478: 7d a5 ldd r23, Y+45 ; 0x2d 2f47a: c8 01 movw r24, r16 2f47c: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 2f480: 87 ff sbrs r24, 7 2f482: 50 c0 rjmp .+160 ; 0x2f524 2f484: 6e 96 adiw r28, 0x1e ; 30 2f486: ae ac ldd r10, Y+62 ; 0x3e 2f488: bf ac ldd r11, Y+63 ; 0x3f 2f48a: 6e 97 sbiw r28, 0x1e ; 30 2f48c: 30 e1 ldi r19, 0x10 ; 16 2f48e: a3 0e add r10, r19 2f490: b1 1c adc r11, r1 2f492: 6e 96 adiw r28, 0x1e ; 30 2f494: ce ac ldd r12, Y+62 ; 0x3e 2f496: df ac ldd r13, Y+63 ; 0x3f 2f498: 6e 97 sbiw r28, 0x1e ; 30 { for(unsigned char i=0; i < 4; i++) { current_speed[i] *= speed_factor; 2f49a: d6 01 movw r26, r12 2f49c: 6d 91 ld r22, X+ 2f49e: 7d 91 ld r23, X+ 2f4a0: 8d 91 ld r24, X+ 2f4a2: 9d 91 ld r25, X+ 2f4a4: 6d 01 movw r12, r26 2f4a6: 7d 01 movw r14, r26 2f4a8: b4 e0 ldi r27, 0x04 ; 4 2f4aa: eb 1a sub r14, r27 2f4ac: f1 08 sbc r15, r1 2f4ae: 29 a5 ldd r18, Y+41 ; 0x29 2f4b0: 3d a5 ldd r19, Y+45 ; 0x2d 2f4b2: a8 01 movw r20, r16 2f4b4: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2f4b8: f7 01 movw r30, r14 2f4ba: 60 83 st Z, r22 2f4bc: 71 83 std Z+1, r23 ; 0x01 2f4be: 82 83 std Z+2, r24 ; 0x02 2f4c0: 93 83 std Z+3, r25 ; 0x03 } // Correct the speed if( speed_factor < 1.0) { for(unsigned char i=0; i < 4; i++) 2f4c2: ac 14 cp r10, r12 2f4c4: bd 04 cpc r11, r13 2f4c6: 49 f7 brne .-46 ; 0x2f49a { current_speed[i] *= speed_factor; } block->nominal_speed *= speed_factor; 2f4c8: 2e e6 ldi r18, 0x6E ; 110 2f4ca: 22 9d mul r18, r2 2f4cc: c0 01 movw r24, r0 2f4ce: 23 9d mul r18, r3 2f4d0: 90 0d add r25, r0 2f4d2: 11 24 eor r1, r1 2f4d4: 9c 01 movw r18, r24 2f4d6: 28 53 subi r18, 0x38 ; 56 2f4d8: 39 4f sbci r19, 0xF9 ; 249 2f4da: 79 01 movw r14, r18 2f4dc: 29 a5 ldd r18, Y+41 ; 0x29 2f4de: 3d a5 ldd r19, Y+45 ; 0x2d 2f4e0: a8 01 movw r20, r16 2f4e2: 6d a9 ldd r22, Y+53 ; 0x35 2f4e4: 7e a9 ldd r23, Y+54 ; 0x36 2f4e6: 8f a9 ldd r24, Y+55 ; 0x37 2f4e8: 98 ad ldd r25, Y+56 ; 0x38 2f4ea: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2f4ee: d7 01 movw r26, r14 2f4f0: 91 96 adiw r26, 0x21 ; 33 2f4f2: 6d 93 st X+, r22 2f4f4: 7d 93 st X+, r23 2f4f6: 8d 93 st X+, r24 2f4f8: 9c 93 st X, r25 2f4fa: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate *= speed_factor; 2f4fc: 62 96 adiw r28, 0x12 ; 18 2f4fe: 6c ad ldd r22, Y+60 ; 0x3c 2f500: 7d ad ldd r23, Y+61 ; 0x3d 2f502: 8e ad ldd r24, Y+62 ; 0x3e 2f504: 9f ad ldd r25, Y+63 ; 0x3f 2f506: 62 97 sbiw r28, 0x12 ; 18 2f508: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 2f50c: 29 a5 ldd r18, Y+41 ; 0x29 2f50e: 3d a5 ldd r19, Y+45 ; 0x2d 2f510: a8 01 movw r20, r16 2f512: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2f516: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 2f51a: f7 01 movw r30, r14 2f51c: 66 ab std Z+54, r22 ; 0x36 2f51e: 77 ab std Z+55, r23 ; 0x37 2f520: 80 af std Z+56, r24 ; 0x38 2f522: 91 af std Z+57, r25 ; 0x39 float e_D_ratio = 0; #endif // Compute and limit the acceleration rate for the trapezoid generator. // block->step_event_count ... event count of the fastest axis // block->millimeters ... Euclidian length of the XYZ movement or the E length, if no XYZ movement. float steps_per_mm = block->step_event_count.wide/block->millimeters; 2f524: a3 01 movw r20, r6 2f526: 92 01 movw r18, r4 2f528: 69 ad ldd r22, Y+57 ; 0x39 2f52a: 7a ad ldd r23, Y+58 ; 0x3a 2f52c: 8b ad ldd r24, Y+59 ; 0x3b 2f52e: 9c ad ldd r25, Y+60 ; 0x3c 2f530: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2f534: 69 a7 std Y+41, r22 ; 0x29 2f536: 7a a7 std Y+42, r23 ; 0x2a 2f538: 8b a7 std Y+43, r24 ; 0x2b 2f53a: 9c a7 std Y+44, r25 ; 0x2c uint32_t accel; if(block->steps[X_AXIS].wide == 0 && block->steps[Y_AXIS].wide == 0 && block->steps[Z_AXIS].wide == 0) 2f53c: 2e 96 adiw r28, 0x0e ; 14 2f53e: 2c ad ldd r18, Y+60 ; 0x3c 2f540: 3d ad ldd r19, Y+61 ; 0x3d 2f542: 4e ad ldd r20, Y+62 ; 0x3e 2f544: 5f ad ldd r21, Y+63 ; 0x3f 2f546: 2e 97 sbiw r28, 0x0e ; 14 2f548: 23 2b or r18, r19 2f54a: 24 2b or r18, r20 2f54c: 25 2b or r18, r21 2f54e: 09 f0 breq .+2 ; 0x2f552 2f550: b9 c5 rjmp .+2930 ; 0x300c4 2f552: 8e e6 ldi r24, 0x6E ; 110 2f554: 82 9d mul r24, r2 2f556: 80 01 movw r16, r0 2f558: 83 9d mul r24, r3 2f55a: 10 0d add r17, r0 2f55c: 11 24 eor r1, r1 2f55e: 08 53 subi r16, 0x38 ; 56 2f560: 19 4f sbci r17, 0xF9 ; 249 2f562: f8 01 movw r30, r16 2f564: 84 81 ldd r24, Z+4 ; 0x04 2f566: 95 81 ldd r25, Z+5 ; 0x05 2f568: a6 81 ldd r26, Z+6 ; 0x06 2f56a: b7 81 ldd r27, Z+7 ; 0x07 2f56c: 89 2b or r24, r25 2f56e: 8a 2b or r24, r26 2f570: 8b 2b or r24, r27 2f572: 09 f0 breq .+2 ; 0x2f576 2f574: a7 c5 rjmp .+2894 ; 0x300c4 2f576: 80 85 ldd r24, Z+8 ; 0x08 2f578: 91 85 ldd r25, Z+9 ; 0x09 2f57a: a2 85 ldd r26, Z+10 ; 0x0a 2f57c: b3 85 ldd r27, Z+11 ; 0x0b 2f57e: 89 2b or r24, r25 2f580: 8a 2b or r24, r26 2f582: 8b 2b or r24, r27 2f584: 09 f0 breq .+2 ; 0x2f588 2f586: 9e c5 rjmp .+2876 ; 0x300c4 { accel = ceil(cs.retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 2f588: 20 91 6a 04 lds r18, 0x046A ; 0x80046a 2f58c: 30 91 6b 04 lds r19, 0x046B ; 0x80046b 2f590: 40 91 6c 04 lds r20, 0x046C ; 0x80046c 2f594: 50 91 6d 04 lds r21, 0x046D ; 0x80046d 2f598: 69 a5 ldd r22, Y+41 ; 0x29 2f59a: 7a a5 ldd r23, Y+42 ; 0x2a 2f59c: 8b a5 ldd r24, Y+43 ; 0x2b 2f59e: 9c a5 ldd r25, Y+44 ; 0x2c 2f5a0: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2f5a4: 0f 94 e2 a1 call 0x343c4 ; 0x343c4 2f5a8: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 2f5ac: 2b 01 movw r4, r22 2f5ae: 3c 01 movw r6, r24 #ifdef LIN_ADVANCE block->use_advance_lead = false; 2f5b0: f8 01 movw r30, r16 2f5b2: e4 5b subi r30, 0xB4 ; 180 2f5b4: ff 4f sbci r31, 0xFF ; 255 2f5b6: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 2f5b8: 6a 96 adiw r28, 0x1a ; 26 2f5ba: 1c ae std Y+60, r1 ; 0x3c 2f5bc: 1d ae std Y+61, r1 ; 0x3d 2f5be: 1e ae std Y+62, r1 ; 0x3e 2f5c0: 1f ae std Y+63, r1 ; 0x3f 2f5c2: 6a 97 sbiw r28, 0x1a ; 26 if (max_possible < accel) accel = max_possible; } } } // Acceleration of the segment, in mm/sec^2 block->acceleration_steps_per_s2 = accel; 2f5c4: 8e e6 ldi r24, 0x6E ; 110 2f5c6: 82 9d mul r24, r2 2f5c8: 80 01 movw r16, r0 2f5ca: 83 9d mul r24, r3 2f5cc: 10 0d add r17, r0 2f5ce: 11 24 eor r1, r1 2f5d0: 08 53 subi r16, 0x38 ; 56 2f5d2: 19 4f sbci r17, 0xF9 ; 249 2f5d4: f8 01 movw r30, r16 2f5d6: ee 5b subi r30, 0xBE ; 190 2f5d8: ff 4f sbci r31, 0xFF ; 255 2f5da: 40 82 st Z, r4 2f5dc: 51 82 std Z+1, r5 ; 0x01 2f5de: 62 82 std Z+2, r6 ; 0x02 2f5e0: 73 82 std Z+3, r7 ; 0x03 block->acceleration = accel / steps_per_mm; 2f5e2: c3 01 movw r24, r6 2f5e4: b2 01 movw r22, r4 2f5e6: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 2f5ea: 6b 01 movw r12, r22 2f5ec: 7c 01 movw r14, r24 2f5ee: 29 a5 ldd r18, Y+41 ; 0x29 2f5f0: 3a a5 ldd r19, Y+42 ; 0x2a 2f5f2: 4b a5 ldd r20, Y+43 ; 0x2b 2f5f4: 5c a5 ldd r21, Y+44 ; 0x2c 2f5f6: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2f5fa: e1 96 adiw r28, 0x31 ; 49 2f5fc: 6c af std Y+60, r22 ; 0x3c 2f5fe: 7d af std Y+61, r23 ; 0x3d 2f600: 8e af std Y+62, r24 ; 0x3e 2f602: 9f af std Y+63, r25 ; 0x3f 2f604: e1 97 sbiw r28, 0x31 ; 49 2f606: f8 01 movw r30, r16 2f608: 61 ab std Z+49, r22 ; 0x31 2f60a: 72 ab std Z+50, r23 ; 0x32 2f60c: 83 ab std Z+51, r24 ; 0x33 2f60e: 94 ab std Z+52, r25 ; 0x34 block->acceleration_rate = (uint32_t)(accel * (float(1UL << 24) / ((F_CPU) / 8.0f))); 2f610: 2d eb ldi r18, 0xBD ; 189 2f612: 37 e3 ldi r19, 0x37 ; 55 2f614: 46 e0 ldi r20, 0x06 ; 6 2f616: 51 e4 ldi r21, 0x41 ; 65 2f618: c7 01 movw r24, r14 2f61a: b6 01 movw r22, r12 2f61c: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2f620: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 2f624: d8 01 movw r26, r16 2f626: 54 96 adiw r26, 0x14 ; 20 2f628: 6d 93 st X+, r22 2f62a: 7d 93 st X+, r23 2f62c: 8d 93 st X+, r24 2f62e: 9c 93 st X, r25 2f630: 57 97 sbiw r26, 0x17 ; 23 // Start with a safe speed. // Safe speed is the speed, from which the machine may halt to stop immediately. float safe_speed = block->nominal_speed; 2f632: 91 96 adiw r26, 0x21 ; 33 2f634: bc 91 ld r27, X 2f636: 27 96 adiw r28, 0x07 ; 7 2f638: bf af std Y+63, r27 ; 0x3f 2f63a: 27 97 sbiw r28, 0x07 ; 7 2f63c: f8 01 movw r30, r16 2f63e: f2 a1 ldd r31, Z+34 ; 0x22 2f640: 2b 96 adiw r28, 0x0b ; 11 2f642: ff af std Y+63, r31 ; 0x3f 2f644: 2b 97 sbiw r28, 0x0b ; 11 2f646: d8 01 movw r26, r16 2f648: 93 96 adiw r26, 0x23 ; 35 2f64a: bc 91 ld r27, X 2f64c: 2f 96 adiw r28, 0x0f ; 15 2f64e: bf af std Y+63, r27 ; 0x3f 2f650: 2f 97 sbiw r28, 0x0f ; 15 2f652: f8 01 movw r30, r16 2f654: f4 a1 ldd r31, Z+36 ; 0x24 2f656: 63 96 adiw r28, 0x13 ; 19 2f658: ff af std Y+63, r31 ; 0x3f 2f65a: 63 97 sbiw r28, 0x13 ; 19 2f65c: 2a e7 ldi r18, 0x7A ; 122 2f65e: 34 e0 ldi r19, 0x04 ; 4 2f660: ed 96 adiw r28, 0x3d ; 61 2f662: 3f af std Y+63, r19 ; 0x3f 2f664: 2e af std Y+62, r18 ; 0x3e 2f666: ed 97 sbiw r28, 0x3d ; 61 2f668: 6e 96 adiw r28, 0x1e ; 30 2f66a: 4e ac ldd r4, Y+62 ; 0x3e 2f66c: 5f ac ldd r5, Y+63 ; 0x3f 2f66e: 6e 97 sbiw r28, 0x1e ; 30 2f670: 30 e1 ldi r19, 0x10 ; 16 2f672: 43 0e add r4, r19 2f674: 51 1c adc r5, r1 2f676: 0a e7 ldi r16, 0x7A ; 122 2f678: 14 e0 ldi r17, 0x04 ; 4 2f67a: 6e 96 adiw r28, 0x1e ; 30 2f67c: 6e ac ldd r6, Y+62 ; 0x3e 2f67e: 7f ac ldd r7, Y+63 ; 0x3f 2f680: 6e 97 sbiw r28, 0x1e ; 30 2f682: 27 96 adiw r28, 0x07 ; 7 2f684: 4f ad ldd r20, Y+63 ; 0x3f 2f686: 27 97 sbiw r28, 0x07 ; 7 2f688: 49 a7 std Y+41, r20 ; 0x29 2f68a: 2b 96 adiw r28, 0x0b ; 11 2f68c: 5f ad ldd r21, Y+63 ; 0x3f 2f68e: 2b 97 sbiw r28, 0x0b ; 11 2f690: 5d a7 std Y+45, r21 ; 0x2d 2f692: b9 af std Y+57, r27 ; 0x39 2f694: f9 ab std Y+49, r31 ; 0x31 bool limited = false; 2f696: 1d aa std Y+53, r1 ; 0x35 for (uint8_t axis = 0; axis < 4; ++ axis) { float jerk = fabs(current_speed[axis]); 2f698: d3 01 movw r26, r6 2f69a: 8d 90 ld r8, X+ 2f69c: 9d 90 ld r9, X+ 2f69e: ad 90 ld r10, X+ 2f6a0: bd 90 ld r11, X+ 2f6a2: 3d 01 movw r6, r26 2f6a4: e8 94 clt 2f6a6: b7 f8 bld r11, 7 if (jerk > cs.max_jerk[axis]) { 2f6a8: f8 01 movw r30, r16 2f6aa: c1 90 ld r12, Z+ 2f6ac: d1 90 ld r13, Z+ 2f6ae: e1 90 ld r14, Z+ 2f6b0: f1 90 ld r15, Z+ 2f6b2: 8f 01 movw r16, r30 2f6b4: a5 01 movw r20, r10 2f6b6: 94 01 movw r18, r8 2f6b8: c7 01 movw r24, r14 2f6ba: b6 01 movw r22, r12 2f6bc: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 2f6c0: 87 ff sbrs r24, 7 2f6c2: 3a c0 rjmp .+116 ; 0x2f738 // The actual jerk is lower, if it has been limited by the XY jerk. if (limited) { 2f6c4: fd a9 ldd r31, Y+53 ; 0x35 2f6c6: ff 23 and r31, r31 2f6c8: 09 f4 brne .+2 ; 0x2f6cc 2f6ca: 7e c6 rjmp .+3324 ; 0x303c8 // Spare one division by a following gymnastics: // Instead of jerk *= safe_speed / block->nominal_speed, // multiply max_jerk[axis] by the divisor. jerk *= safe_speed; 2f6cc: 29 a5 ldd r18, Y+41 ; 0x29 2f6ce: 3d a5 ldd r19, Y+45 ; 0x2d 2f6d0: 49 ad ldd r20, Y+57 ; 0x39 2f6d2: 59 a9 ldd r21, Y+49 ; 0x31 2f6d4: c5 01 movw r24, r10 2f6d6: b4 01 movw r22, r8 2f6d8: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2f6dc: 4b 01 movw r8, r22 2f6de: 5c 01 movw r10, r24 float mjerk = cs.max_jerk[axis] * block->nominal_speed; 2f6e0: a7 01 movw r20, r14 2f6e2: 96 01 movw r18, r12 2f6e4: 27 96 adiw r28, 0x07 ; 7 2f6e6: 6f ad ldd r22, Y+63 ; 0x3f 2f6e8: 27 97 sbiw r28, 0x07 ; 7 2f6ea: 2b 96 adiw r28, 0x0b ; 11 2f6ec: 7f ad ldd r23, Y+63 ; 0x3f 2f6ee: 2b 97 sbiw r28, 0x0b ; 11 2f6f0: 2f 96 adiw r28, 0x0f ; 15 2f6f2: 8f ad ldd r24, Y+63 ; 0x3f 2f6f4: 2f 97 sbiw r28, 0x0f ; 15 2f6f6: 63 96 adiw r28, 0x13 ; 19 2f6f8: 9f ad ldd r25, Y+63 ; 0x3f 2f6fa: 63 97 sbiw r28, 0x13 ; 19 2f6fc: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2f700: 6b 01 movw r12, r22 2f702: 7c 01 movw r14, r24 if (jerk > mjerk) { 2f704: ac 01 movw r20, r24 2f706: 9b 01 movw r18, r22 2f708: c5 01 movw r24, r10 2f70a: b4 01 movw r22, r8 2f70c: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 2f710: 18 16 cp r1, r24 2f712: 94 f4 brge .+36 ; 0x2f738 safe_speed *= mjerk / jerk; 2f714: a5 01 movw r20, r10 2f716: 94 01 movw r18, r8 2f718: c7 01 movw r24, r14 2f71a: b6 01 movw r22, r12 2f71c: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2f720: 9b 01 movw r18, r22 2f722: ac 01 movw r20, r24 2f724: 69 a5 ldd r22, Y+41 ; 0x29 2f726: 7d a5 ldd r23, Y+45 ; 0x2d 2f728: 89 ad ldd r24, Y+57 ; 0x39 2f72a: 99 a9 ldd r25, Y+49 ; 0x31 2f72c: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2f730: 69 a7 std Y+41, r22 ; 0x29 2f732: 7d a7 std Y+45, r23 ; 0x2d 2f734: 89 af std Y+57, r24 ; 0x39 2f736: 99 ab std Y+49, r25 ; 0x31 // Start with a safe speed. // Safe speed is the speed, from which the machine may halt to stop immediately. float safe_speed = block->nominal_speed; bool limited = false; for (uint8_t axis = 0; axis < 4; ++ axis) { 2f738: 46 14 cp r4, r6 2f73a: 57 04 cpc r5, r7 2f73c: 09 f0 breq .+2 ; 0x2f740 2f73e: ac cf rjmp .-168 ; 0x2f698 } } } // Reset the block flag. block->flag = 0; 2f740: 8e e6 ldi r24, 0x6E ; 110 2f742: 82 9d mul r24, r2 2f744: f0 01 movw r30, r0 2f746: 83 9d mul r24, r3 2f748: f0 0d add r31, r0 2f74a: 11 24 eor r1, r1 2f74c: e8 53 subi r30, 0x38 ; 56 2f74e: f9 4f sbci r31, 0xF9 ; 249 2f750: 15 aa std Z+53, r1 ; 0x35 if (plan_reset_next_e_sched) 2f752: 80 91 ee 03 lds r24, 0x03EE ; 0x8003ee <_ZL23plan_reset_next_e_sched.lto_priv.449> 2f756: 88 23 and r24, r24 2f758: 21 f0 breq .+8 ; 0x2f762 { // finally propagate a pending reset block->flag |= BLOCK_FLAG_E_RESET; 2f75a: 80 e1 ldi r24, 0x10 ; 16 2f75c: 85 ab std Z+53, r24 ; 0x35 plan_reset_next_e_sched = false; 2f75e: 10 92 ee 03 sts 0x03EE, r1 ; 0x8003ee <_ZL23plan_reset_next_e_sched.lto_priv.449> float vmax_junction; //FIXME Vojtech: Why only if at least two lines are planned in the queue? // Is it because we don't want to tinker with the first buffer line, which // is likely to be executed by the stepper interrupt routine soon? if (moves_queued > 1 && previous_nominal_speed > 0.0001f) { 2f762: 3d ad ldd r19, Y+61 ; 0x3d 2f764: 32 30 cpi r19, 0x02 ; 2 2f766: 08 f4 brcc .+2 ; 0x2f76a 2f768: 8f c6 rjmp .+3358 ; 0x30488 2f76a: 40 91 f0 03 lds r20, 0x03F0 ; 0x8003f0 <_ZL22previous_nominal_speed.lto_priv.450> 2f76e: 6b 96 adiw r28, 0x1b ; 27 2f770: 4f af std Y+63, r20 ; 0x3f 2f772: 6b 97 sbiw r28, 0x1b ; 27 2f774: 50 91 f1 03 lds r21, 0x03F1 ; 0x8003f1 <_ZL22previous_nominal_speed.lto_priv.450+0x1> 2f778: 6f 96 adiw r28, 0x1f ; 31 2f77a: 5f af std Y+63, r21 ; 0x3f 2f77c: 6f 97 sbiw r28, 0x1f ; 31 2f77e: 00 91 f2 03 lds r16, 0x03F2 ; 0x8003f2 <_ZL22previous_nominal_speed.lto_priv.450+0x2> 2f782: 10 91 f3 03 lds r17, 0x03F3 ; 0x8003f3 <_ZL22previous_nominal_speed.lto_priv.450+0x3> 2f786: 27 e1 ldi r18, 0x17 ; 23 2f788: 37 eb ldi r19, 0xB7 ; 183 2f78a: 41 ed ldi r20, 0xD1 ; 209 2f78c: 58 e3 ldi r21, 0x38 ; 56 2f78e: 6b 96 adiw r28, 0x1b ; 27 2f790: 6f ad ldd r22, Y+63 ; 0x3f 2f792: 6b 97 sbiw r28, 0x1b ; 27 2f794: 6f 96 adiw r28, 0x1f ; 31 2f796: 7f ad ldd r23, Y+63 ; 0x3f 2f798: 6f 97 sbiw r28, 0x1f ; 31 2f79a: c8 01 movw r24, r16 2f79c: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 2f7a0: 18 16 cp r1, r24 2f7a2: 0c f0 brlt .+2 ; 0x2f7a6 2f7a4: 71 c6 rjmp .+3298 ; 0x30488 // If this maximum velocity allowed is lower than the minimum of the entry / exit safe velocities, // then the machine is not coasting anymore and the safe entry / exit velocities shall be used. // The junction velocity will be shared between successive segments. Limit the junction velocity to their minimum. bool prev_speed_larger = previous_nominal_speed > block->nominal_speed; float smaller_speed_factor = prev_speed_larger ? (block->nominal_speed / previous_nominal_speed) : (previous_nominal_speed / block->nominal_speed); 2f7a6: 6b 96 adiw r28, 0x1b ; 27 2f7a8: 2f ad ldd r18, Y+63 ; 0x3f 2f7aa: 6b 97 sbiw r28, 0x1b ; 27 2f7ac: 6f 96 adiw r28, 0x1f ; 31 2f7ae: 3f ad ldd r19, Y+63 ; 0x3f 2f7b0: 6f 97 sbiw r28, 0x1f ; 31 2f7b2: a8 01 movw r20, r16 2f7b4: 27 96 adiw r28, 0x07 ; 7 2f7b6: 6f ad ldd r22, Y+63 ; 0x3f 2f7b8: 27 97 sbiw r28, 0x07 ; 7 2f7ba: 2b 96 adiw r28, 0x0b ; 11 2f7bc: 7f ad ldd r23, Y+63 ; 0x3f 2f7be: 2b 97 sbiw r28, 0x0b ; 11 2f7c0: 2f 96 adiw r28, 0x0f ; 15 2f7c2: 8f ad ldd r24, Y+63 ; 0x3f 2f7c4: 2f 97 sbiw r28, 0x0f ; 15 2f7c6: 63 96 adiw r28, 0x13 ; 19 2f7c8: 9f ad ldd r25, Y+63 ; 0x3f 2f7ca: 63 97 sbiw r28, 0x13 ; 19 2f7cc: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 2f7d0: 87 ff sbrs r24, 7 2f7d2: 01 c6 rjmp .+3074 ; 0x303d6 2f7d4: 6b 96 adiw r28, 0x1b ; 27 2f7d6: 2f ad ldd r18, Y+63 ; 0x3f 2f7d8: 6b 97 sbiw r28, 0x1b ; 27 2f7da: 6f 96 adiw r28, 0x1f ; 31 2f7dc: 3f ad ldd r19, Y+63 ; 0x3f 2f7de: 6f 97 sbiw r28, 0x1f ; 31 2f7e0: a8 01 movw r20, r16 2f7e2: 27 96 adiw r28, 0x07 ; 7 2f7e4: 6f ad ldd r22, Y+63 ; 0x3f 2f7e6: 27 97 sbiw r28, 0x07 ; 7 2f7e8: 2b 96 adiw r28, 0x0b ; 11 2f7ea: 7f ad ldd r23, Y+63 ; 0x3f 2f7ec: 2b 97 sbiw r28, 0x0b ; 11 2f7ee: 2f 96 adiw r28, 0x0f ; 15 2f7f0: 8f ad ldd r24, Y+63 ; 0x3f 2f7f2: 2f 97 sbiw r28, 0x0f ; 15 2f7f4: 63 96 adiw r28, 0x13 ; 19 2f7f6: 9f ad ldd r25, Y+63 ; 0x3f 2f7f8: 63 97 sbiw r28, 0x13 ; 19 2f7fa: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2f7fe: eb 96 adiw r28, 0x3b ; 59 2f800: 6c af std Y+60, r22 ; 0x3c 2f802: 7d af std Y+61, r23 ; 0x3d 2f804: 8e af std Y+62, r24 ; 0x3e 2f806: 9f af std Y+63, r25 ; 0x3f 2f808: eb 97 sbiw r28, 0x3b ; 59 // Pick the smaller of the nominal speeds. Higher speed shall not be achieved at the junction during coasting. vmax_junction = prev_speed_larger ? block->nominal_speed : previous_nominal_speed; 2f80a: 27 96 adiw r28, 0x07 ; 7 2f80c: 8f ad ldd r24, Y+63 ; 0x3f 2f80e: 27 97 sbiw r28, 0x07 ; 7 2f810: 8d af std Y+61, r24 ; 0x3d 2f812: 2b 96 adiw r28, 0x0b ; 11 2f814: 9f ad ldd r25, Y+63 ; 0x3f 2f816: 2b 97 sbiw r28, 0x0b ; 11 2f818: 9d ab std Y+53, r25 ; 0x35 2f81a: 2f 96 adiw r28, 0x0f ; 15 2f81c: af ad ldd r26, Y+63 ; 0x3f 2f81e: 2f 97 sbiw r28, 0x0f ; 15 2f820: ae af std Y+62, r26 ; 0x3e 2f822: 63 96 adiw r28, 0x13 ; 19 2f824: bf ad ldd r27, Y+63 ; 0x3f 2f826: 63 97 sbiw r28, 0x13 ; 19 2f828: 23 96 adiw r28, 0x03 ; 3 2f82a: bf af std Y+63, r27 ; 0x3f 2f82c: 23 97 sbiw r28, 0x03 ; 3 2f82e: 24 ef ldi r18, 0xF4 ; 244 2f830: 33 e0 ldi r19, 0x03 ; 3 2f832: e7 96 adiw r28, 0x37 ; 55 2f834: 3f af std Y+63, r19 ; 0x3f 2f836: 2e af std Y+62, r18 ; 0x3e 2f838: e7 97 sbiw r28, 0x37 ; 55 // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. float v_factor = 1.f; 2f83a: 41 2c mov r4, r1 2f83c: 51 2c mov r5, r1 2f83e: 30 e8 ldi r19, 0x80 ; 128 2f840: 63 2e mov r6, r19 2f842: 3f e3 ldi r19, 0x3F ; 63 2f844: 73 2e mov r7, r19 limited = false; // Now limit the jerk in all axes. for (uint8_t axis = 0; axis < 4; ++ axis) { // Limit an axis. We have to differentiate coasting from the reversal of an axis movement, or a full stop. float v_exit = previous_speed[axis]; 2f846: e7 96 adiw r28, 0x37 ; 55 2f848: ae ad ldd r26, Y+62 ; 0x3e 2f84a: bf ad ldd r27, Y+63 ; 0x3f 2f84c: e7 97 sbiw r28, 0x37 ; 55 2f84e: 8d 90 ld r8, X+ 2f850: 9d 90 ld r9, X+ 2f852: ad 90 ld r10, X+ 2f854: bd 90 ld r11, X+ 2f856: e7 96 adiw r28, 0x37 ; 55 2f858: bf af std Y+63, r27 ; 0x3f 2f85a: ae af std Y+62, r26 ; 0x3e 2f85c: e7 97 sbiw r28, 0x37 ; 55 float v_entry = current_speed [axis]; 2f85e: 6e 96 adiw r28, 0x1e ; 30 2f860: ee ad ldd r30, Y+62 ; 0x3e 2f862: ff ad ldd r31, Y+63 ; 0x3f 2f864: 6e 97 sbiw r28, 0x1e ; 30 2f866: c1 90 ld r12, Z+ 2f868: d1 90 ld r13, Z+ 2f86a: e1 90 ld r14, Z+ 2f86c: f1 90 ld r15, Z+ 2f86e: 6e 96 adiw r28, 0x1e ; 30 2f870: ff af std Y+63, r31 ; 0x3f 2f872: ee af std Y+62, r30 ; 0x3e 2f874: 6e 97 sbiw r28, 0x1e ; 30 if (prev_speed_larger) 2f876: 6b 96 adiw r28, 0x1b ; 27 2f878: 2f ad ldd r18, Y+63 ; 0x3f 2f87a: 6b 97 sbiw r28, 0x1b ; 27 2f87c: 6f 96 adiw r28, 0x1f ; 31 2f87e: 3f ad ldd r19, Y+63 ; 0x3f 2f880: 6f 97 sbiw r28, 0x1f ; 31 2f882: a8 01 movw r20, r16 2f884: 27 96 adiw r28, 0x07 ; 7 2f886: 6f ad ldd r22, Y+63 ; 0x3f 2f888: 27 97 sbiw r28, 0x07 ; 7 2f88a: 2b 96 adiw r28, 0x0b ; 11 2f88c: 7f ad ldd r23, Y+63 ; 0x3f 2f88e: 2b 97 sbiw r28, 0x0b ; 11 2f890: 2f 96 adiw r28, 0x0f ; 15 2f892: 8f ad ldd r24, Y+63 ; 0x3f 2f894: 2f 97 sbiw r28, 0x0f ; 15 2f896: 63 96 adiw r28, 0x13 ; 19 2f898: 9f ad ldd r25, Y+63 ; 0x3f 2f89a: 63 97 sbiw r28, 0x13 ; 19 2f89c: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 2f8a0: 87 ff sbrs r24, 7 2f8a2: 0c c0 rjmp .+24 ; 0x2f8bc v_exit *= smaller_speed_factor; 2f8a4: eb 96 adiw r28, 0x3b ; 59 2f8a6: 2c ad ldd r18, Y+60 ; 0x3c 2f8a8: 3d ad ldd r19, Y+61 ; 0x3d 2f8aa: 4e ad ldd r20, Y+62 ; 0x3e 2f8ac: 5f ad ldd r21, Y+63 ; 0x3f 2f8ae: eb 97 sbiw r28, 0x3b ; 59 2f8b0: c5 01 movw r24, r10 2f8b2: b4 01 movw r22, r8 2f8b4: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2f8b8: 4b 01 movw r8, r22 2f8ba: 5c 01 movw r10, r24 if (limited) { 2f8bc: a1 96 adiw r28, 0x21 ; 33 2f8be: ff ad ldd r31, Y+63 ; 0x3f 2f8c0: a1 97 sbiw r28, 0x21 ; 33 2f8c2: ff 23 and r31, r31 2f8c4: 81 f0 breq .+32 ; 0x2f8e6 v_exit *= v_factor; 2f8c6: a3 01 movw r20, r6 2f8c8: 92 01 movw r18, r4 2f8ca: c5 01 movw r24, r10 2f8cc: b4 01 movw r22, r8 2f8ce: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2f8d2: 4b 01 movw r8, r22 2f8d4: 5c 01 movw r10, r24 v_entry *= v_factor; 2f8d6: a3 01 movw r20, r6 2f8d8: 92 01 movw r18, r4 2f8da: c7 01 movw r24, r14 2f8dc: b6 01 movw r22, r12 2f8de: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2f8e2: 6b 01 movw r12, r22 2f8e4: 7c 01 movw r14, r24 } // Calculate the jerk depending on whether the axis is coasting in the same direction or reversing a direction. float jerk = (v_exit > v_entry) ? 2f8e6: a7 01 movw r20, r14 2f8e8: 96 01 movw r18, r12 2f8ea: c5 01 movw r24, r10 2f8ec: b4 01 movw r22, r8 2f8ee: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> ((v_entry > 0.f || v_exit < 0.f) ? 2f8f2: 20 e0 ldi r18, 0x00 ; 0 2f8f4: 30 e0 ldi r19, 0x00 ; 0 2f8f6: a9 01 movw r20, r18 v_exit *= v_factor; v_entry *= v_factor; } // Calculate the jerk depending on whether the axis is coasting in the same direction or reversing a direction. float jerk = (v_exit > v_entry) ? 2f8f8: 18 16 cp r1, r24 2f8fa: 0c f0 brlt .+2 ; 0x2f8fe 2f8fc: a3 c5 rjmp .+2886 ; 0x30444 ((v_entry > 0.f || v_exit < 0.f) ? 2f8fe: c7 01 movw r24, r14 2f900: b6 01 movw r22, r12 2f902: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 2f906: 18 16 cp r1, r24 2f908: 4c f0 brlt .+18 ; 0x2f91c 2f90a: 20 e0 ldi r18, 0x00 ; 0 2f90c: 30 e0 ldi r19, 0x00 ; 0 2f90e: a9 01 movw r20, r18 2f910: c5 01 movw r24, r10 2f912: b4 01 movw r22, r8 2f914: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 2f918: 87 ff sbrs r24, 7 2f91a: 85 c5 rjmp .+2826 ; 0x30426 2f91c: a7 01 movw r20, r14 2f91e: 96 01 movw r18, r12 2f920: c5 01 movw r24, r10 2f922: b4 01 movw r22, r8 // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? 2f924: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 2f928: 6b 01 movw r12, r22 2f92a: 7c 01 movw r14, r24 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); if (jerk > cs.max_jerk[axis]) { 2f92c: ed 96 adiw r28, 0x3d ; 61 2f92e: ae ad ldd r26, Y+62 ; 0x3e 2f930: bf ad ldd r27, Y+63 ; 0x3f 2f932: ed 97 sbiw r28, 0x3d ; 61 2f934: 8d 90 ld r8, X+ 2f936: 9d 90 ld r9, X+ 2f938: ad 90 ld r10, X+ 2f93a: bd 90 ld r11, X+ 2f93c: ed 96 adiw r28, 0x3d ; 61 2f93e: bf af std Y+63, r27 ; 0x3f 2f940: ae af std Y+62, r26 ; 0x3e 2f942: ed 97 sbiw r28, 0x3d ; 61 2f944: a5 01 movw r20, r10 2f946: 94 01 movw r18, r8 2f948: c7 01 movw r24, r14 2f94a: b6 01 movw r22, r12 2f94c: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 2f950: 18 16 cp r1, r24 2f952: 94 f4 brge .+36 ; 0x2f978 v_factor *= cs.max_jerk[axis] / jerk; 2f954: a7 01 movw r20, r14 2f956: 96 01 movw r18, r12 2f958: c5 01 movw r24, r10 2f95a: b4 01 movw r22, r8 2f95c: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2f960: 9b 01 movw r18, r22 2f962: ac 01 movw r20, r24 2f964: c3 01 movw r24, r6 2f966: b2 01 movw r22, r4 2f968: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2f96c: 2b 01 movw r4, r22 2f96e: 3c 01 movw r6, r24 limited = true; 2f970: b1 e0 ldi r27, 0x01 ; 1 2f972: a1 96 adiw r28, 0x21 ; 33 2f974: bf af std Y+63, r27 ; 0x3f 2f976: a1 97 sbiw r28, 0x21 ; 33 vmax_junction = prev_speed_larger ? block->nominal_speed : previous_nominal_speed; // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. float v_factor = 1.f; limited = false; // Now limit the jerk in all axes. for (uint8_t axis = 0; axis < 4; ++ axis) { 2f978: e4 e0 ldi r30, 0x04 ; 4 2f97a: f4 e0 ldi r31, 0x04 ; 4 2f97c: e7 96 adiw r28, 0x37 ; 55 2f97e: 2e ad ldd r18, Y+62 ; 0x3e 2f980: 3f ad ldd r19, Y+63 ; 0x3f 2f982: e7 97 sbiw r28, 0x37 ; 55 2f984: e2 17 cp r30, r18 2f986: f3 07 cpc r31, r19 2f988: 09 f0 breq .+2 ; 0x2f98c 2f98a: 5d cf rjmp .-326 ; 0x2f846 if (jerk > cs.max_jerk[axis]) { v_factor *= cs.max_jerk[axis] / jerk; limited = true; } } if (limited) 2f98c: a1 96 adiw r28, 0x21 ; 33 2f98e: 3f ad ldd r19, Y+63 ; 0x3f 2f990: a1 97 sbiw r28, 0x21 ; 33 2f992: 33 23 and r19, r19 2f994: 81 f0 breq .+32 ; 0x2f9b6 vmax_junction *= v_factor; 2f996: a3 01 movw r20, r6 2f998: 92 01 movw r18, r4 2f99a: 6d ad ldd r22, Y+61 ; 0x3d 2f99c: 7d a9 ldd r23, Y+53 ; 0x35 2f99e: 8e ad ldd r24, Y+62 ; 0x3e 2f9a0: 23 96 adiw r28, 0x03 ; 3 2f9a2: 9f ad ldd r25, Y+63 ; 0x3f 2f9a4: 23 97 sbiw r28, 0x03 ; 3 2f9a6: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2f9aa: 6d af std Y+61, r22 ; 0x3d 2f9ac: 7d ab std Y+53, r23 ; 0x35 2f9ae: 8e af std Y+62, r24 ; 0x3e 2f9b0: 23 96 adiw r28, 0x03 ; 3 2f9b2: 9f af std Y+63, r25 ; 0x3f 2f9b4: 23 97 sbiw r28, 0x03 ; 3 // Now the transition velocity is known, which maximizes the shared exit / entry velocity while // respecting the jerk factors, it may be possible, that applying separate safe exit / entry velocities will achieve faster prints. float vmax_junction_threshold = vmax_junction * 0.99f; 2f9b6: 24 ea ldi r18, 0xA4 ; 164 2f9b8: 30 e7 ldi r19, 0x70 ; 112 2f9ba: 4d e7 ldi r20, 0x7D ; 125 2f9bc: 5f e3 ldi r21, 0x3F ; 63 2f9be: 6d ad ldd r22, Y+61 ; 0x3d 2f9c0: 7d a9 ldd r23, Y+53 ; 0x35 2f9c2: 8e ad ldd r24, Y+62 ; 0x3e 2f9c4: 23 96 adiw r28, 0x03 ; 3 2f9c6: 9f ad ldd r25, Y+63 ; 0x3f 2f9c8: 23 97 sbiw r28, 0x03 ; 3 2f9ca: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2f9ce: 6b 01 movw r12, r22 2f9d0: 7c 01 movw r14, r24 if (previous_safe_speed > vmax_junction_threshold && safe_speed > vmax_junction_threshold) { 2f9d2: ac 01 movw r20, r24 2f9d4: 9b 01 movw r18, r22 2f9d6: 60 91 dd 16 lds r22, 0x16DD ; 0x8016dd 2f9da: 70 91 de 16 lds r23, 0x16DE ; 0x8016de 2f9de: 80 91 df 16 lds r24, 0x16DF ; 0x8016df 2f9e2: 90 91 e0 16 lds r25, 0x16E0 ; 0x8016e0 2f9e6: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 2f9ea: 18 16 cp r1, r24 2f9ec: fc f4 brge .+62 ; 0x2fa2c 2f9ee: 29 a5 ldd r18, Y+41 ; 0x29 2f9f0: 3d a5 ldd r19, Y+45 ; 0x2d 2f9f2: 49 ad ldd r20, Y+57 ; 0x39 2f9f4: 59 a9 ldd r21, Y+49 ; 0x31 2f9f6: c7 01 movw r24, r14 2f9f8: b6 01 movw r22, r12 2f9fa: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 2f9fe: 87 ff sbrs r24, 7 2fa00: 15 c0 rjmp .+42 ; 0x2fa2c // Not coasting. The machine will stop and start the movements anyway, // better to start the segment from start. block->flag |= BLOCK_FLAG_START_FROM_FULL_HALT; 2fa02: 8e e6 ldi r24, 0x6E ; 110 2fa04: 82 9d mul r24, r2 2fa06: f0 01 movw r30, r0 2fa08: 83 9d mul r24, r3 2fa0a: f0 0d add r31, r0 2fa0c: 11 24 eor r1, r1 2fa0e: e8 53 subi r30, 0x38 ; 56 2fa10: f9 4f sbci r31, 0xF9 ; 249 2fa12: 85 a9 ldd r24, Z+53 ; 0x35 2fa14: 84 60 ori r24, 0x04 ; 4 2fa16: 85 ab std Z+53, r24 ; 0x35 2fa18: 49 a5 ldd r20, Y+41 ; 0x29 2fa1a: 4d af std Y+61, r20 ; 0x3d 2fa1c: 5d a5 ldd r21, Y+45 ; 0x2d 2fa1e: 5d ab std Y+53, r21 ; 0x35 2fa20: 89 ad ldd r24, Y+57 ; 0x39 2fa22: 8e af std Y+62, r24 ; 0x3e 2fa24: 99 a9 ldd r25, Y+49 ; 0x31 2fa26: 23 96 adiw r28, 0x03 ; 3 2fa28: 9f af std Y+63, r25 ; 0x3f 2fa2a: 23 97 sbiw r28, 0x03 ; 3 block->flag |= BLOCK_FLAG_START_FROM_FULL_HALT; vmax_junction = safe_speed; } // Max entry speed of this block equals the max exit speed of the previous block. block->max_entry_speed = vmax_junction; 2fa2c: 8e e6 ldi r24, 0x6E ; 110 2fa2e: 82 9d mul r24, r2 2fa30: 80 01 movw r16, r0 2fa32: 83 9d mul r24, r3 2fa34: 10 0d add r17, r0 2fa36: 11 24 eor r1, r1 2fa38: 08 53 subi r16, 0x38 ; 56 2fa3a: 19 4f sbci r17, 0xF9 ; 249 2fa3c: 8d ad ldd r24, Y+61 ; 0x3d 2fa3e: 9d a9 ldd r25, Y+53 ; 0x35 2fa40: ae ad ldd r26, Y+62 ; 0x3e 2fa42: 23 96 adiw r28, 0x03 ; 3 2fa44: bf ad ldd r27, Y+63 ; 0x3f 2fa46: 23 97 sbiw r28, 0x03 ; 3 2fa48: f8 01 movw r30, r16 2fa4a: 81 a7 std Z+41, r24 ; 0x29 2fa4c: 92 a7 std Z+42, r25 ; 0x2a 2fa4e: a3 a7 std Z+43, r26 ; 0x2b 2fa50: b4 a7 std Z+44, r27 ; 0x2c // Calculates the maximum allowable entry speed, when you must be able to reach target_velocity using the // decceleration within the allotted distance. FORCE_INLINE float max_allowable_entry_speed(float decceleration, float target_velocity, float distance) { // assert(decceleration < 0); return sqrt(target_velocity*target_velocity-2*decceleration*distance); 2fa52: 29 a5 ldd r18, Y+41 ; 0x29 2fa54: 3d a5 ldd r19, Y+45 ; 0x2d 2fa56: 49 ad ldd r20, Y+57 ; 0x39 2fa58: 59 a9 ldd r21, Y+49 ; 0x31 2fa5a: 69 a5 ldd r22, Y+41 ; 0x29 2fa5c: 7d a5 ldd r23, Y+45 ; 0x2d 2fa5e: 89 ad ldd r24, Y+57 ; 0x39 2fa60: 99 a9 ldd r25, Y+49 ; 0x31 2fa62: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2fa66: 6b 01 movw r12, r22 2fa68: 7c 01 movw r14, r24 // Max entry speed of this block equals the max exit speed of the previous block. block->max_entry_speed = vmax_junction; // Initialize block entry speed. Compute based on deceleration to safe_speed. double v_allowable = max_allowable_entry_speed(-block->acceleration,safe_speed,block->millimeters); 2fa6a: e1 96 adiw r28, 0x31 ; 49 2fa6c: 6c ad ldd r22, Y+60 ; 0x3c 2fa6e: 7d ad ldd r23, Y+61 ; 0x3d 2fa70: 8e ad ldd r24, Y+62 ; 0x3e 2fa72: 9f ad ldd r25, Y+63 ; 0x3f 2fa74: e1 97 sbiw r28, 0x31 ; 49 2fa76: 90 58 subi r25, 0x80 ; 128 // Calculates the maximum allowable entry speed, when you must be able to reach target_velocity using the // decceleration within the allotted distance. FORCE_INLINE float max_allowable_entry_speed(float decceleration, float target_velocity, float distance) { // assert(decceleration < 0); return sqrt(target_velocity*target_velocity-2*decceleration*distance); 2fa78: 9b 01 movw r18, r22 2fa7a: ac 01 movw r20, r24 2fa7c: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2fa80: d8 01 movw r26, r16 2fa82: 9d 96 adiw r26, 0x2d ; 45 2fa84: 2d 91 ld r18, X+ 2fa86: 3d 91 ld r19, X+ 2fa88: 4d 91 ld r20, X+ 2fa8a: 5c 91 ld r21, X 2fa8c: d0 97 sbiw r26, 0x30 ; 48 2fa8e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2fa92: 9b 01 movw r18, r22 2fa94: ac 01 movw r20, r24 2fa96: c7 01 movw r24, r14 2fa98: b6 01 movw r22, r12 2fa9a: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 2fa9e: 0f 94 d2 a4 call 0x349a4 ; 0x349a4 2faa2: d6 2e mov r13, r22 2faa4: e7 2e mov r14, r23 2faa6: 8c 01 movw r16, r24 // Max entry speed of this block equals the max exit speed of the previous block. block->max_entry_speed = vmax_junction; // Initialize block entry speed. Compute based on deceleration to safe_speed. double v_allowable = max_allowable_entry_speed(-block->acceleration,safe_speed,block->millimeters); block->entry_speed = min(vmax_junction, v_allowable); 2faa8: 2d ad ldd r18, Y+61 ; 0x3d 2faaa: 3d a9 ldd r19, Y+53 ; 0x35 2faac: 4e ad ldd r20, Y+62 ; 0x3e 2faae: 23 96 adiw r28, 0x03 ; 3 2fab0: 5f ad ldd r21, Y+63 ; 0x3f 2fab2: 23 97 sbiw r28, 0x03 ; 3 2fab4: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 2fab8: 18 16 cp r1, r24 2faba: 34 f0 brlt .+12 ; 0x2fac8 2fabc: dd ae std Y+61, r13 ; 0x3d 2fabe: ed aa std Y+53, r14 ; 0x35 2fac0: 0e af std Y+62, r16 ; 0x3e 2fac2: 23 96 adiw r28, 0x03 ; 3 2fac4: 1f af std Y+63, r17 ; 0x3f 2fac6: 23 97 sbiw r28, 0x03 ; 3 2fac8: 8e e6 ldi r24, 0x6E ; 110 2faca: 82 9d mul r24, r2 2facc: f0 01 movw r30, r0 2face: 83 9d mul r24, r3 2fad0: f0 0d add r31, r0 2fad2: 11 24 eor r1, r1 2fad4: e8 53 subi r30, 0x38 ; 56 2fad6: f9 4f sbci r31, 0xF9 ; 249 2fad8: 8d ad ldd r24, Y+61 ; 0x3d 2fada: 9d a9 ldd r25, Y+53 ; 0x35 2fadc: ae ad ldd r26, Y+62 ; 0x3e 2fade: 23 96 adiw r28, 0x03 ; 3 2fae0: bf ad ldd r27, Y+63 ; 0x3f 2fae2: 23 97 sbiw r28, 0x03 ; 3 2fae4: 85 a3 std Z+37, r24 ; 0x25 2fae6: 96 a3 std Z+38, r25 ; 0x26 2fae8: a7 a3 std Z+39, r26 ; 0x27 2faea: b0 a7 std Z+40, r27 ; 0x28 // junction speeds in deceleration and acceleration, respectively. This is due to how the current // block nominal speed limits both the current and next maximum junction speeds. Hence, in both // the reverse and forward planners, the corresponding block junction speed will always be at the // the maximum junction speed and may always be ignored for any speed reduction checks. // Always calculate trapezoid for new block block->flag |= (block->nominal_speed <= v_allowable) ? (BLOCK_FLAG_NOMINAL_LENGTH | BLOCK_FLAG_RECALCULATE) : BLOCK_FLAG_RECALCULATE; 2faec: f5 a8 ldd r15, Z+53 ; 0x35 2faee: 2d 2d mov r18, r13 2faf0: 3e 2d mov r19, r14 2faf2: a8 01 movw r20, r16 2faf4: 27 96 adiw r28, 0x07 ; 7 2faf6: 6f ad ldd r22, Y+63 ; 0x3f 2faf8: 27 97 sbiw r28, 0x07 ; 7 2fafa: 2b 96 adiw r28, 0x0b ; 11 2fafc: 7f ad ldd r23, Y+63 ; 0x3f 2fafe: 2b 97 sbiw r28, 0x0b ; 11 2fb00: 2f 96 adiw r28, 0x0f ; 15 2fb02: 8f ad ldd r24, Y+63 ; 0x3f 2fb04: 2f 97 sbiw r28, 0x0f ; 15 2fb06: 63 96 adiw r28, 0x13 ; 19 2fb08: 9f ad ldd r25, Y+63 ; 0x3f 2fb0a: 63 97 sbiw r28, 0x13 ; 19 2fb0c: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 2fb10: 18 16 cp r1, r24 2fb12: 0c f4 brge .+2 ; 0x2fb16 2fb14: cf c4 rjmp .+2462 ; 0x304b4 2fb16: 83 e0 ldi r24, 0x03 ; 3 2fb18: 9e e6 ldi r25, 0x6E ; 110 2fb1a: 92 9d mul r25, r2 2fb1c: 80 01 movw r16, r0 2fb1e: 93 9d mul r25, r3 2fb20: 10 0d add r17, r0 2fb22: 11 24 eor r1, r1 2fb24: 08 53 subi r16, 0x38 ; 56 2fb26: 19 4f sbci r17, 0xF9 ; 249 2fb28: f8 2a or r15, r24 2fb2a: f8 01 movw r30, r16 2fb2c: f5 aa std Z+53, r15 ; 0x35 // Update previous path unit_vector and nominal speed memcpy(previous_speed, current_speed, sizeof(previous_speed)); // previous_speed[] = current_speed[] 2fb2e: 80 e1 ldi r24, 0x10 ; 16 2fb30: fe 01 movw r30, r28 2fb32: 71 96 adiw r30, 0x11 ; 17 2fb34: a4 ef ldi r26, 0xF4 ; 244 2fb36: b3 e0 ldi r27, 0x03 ; 3 2fb38: 01 90 ld r0, Z+ 2fb3a: 0d 92 st X+, r0 2fb3c: 8a 95 dec r24 2fb3e: e1 f7 brne .-8 ; 0x2fb38 previous_nominal_speed = block->nominal_speed; 2fb40: 27 96 adiw r28, 0x07 ; 7 2fb42: 8f ad ldd r24, Y+63 ; 0x3f 2fb44: 27 97 sbiw r28, 0x07 ; 7 2fb46: 2b 96 adiw r28, 0x0b ; 11 2fb48: 9f ad ldd r25, Y+63 ; 0x3f 2fb4a: 2b 97 sbiw r28, 0x0b ; 11 2fb4c: 2f 96 adiw r28, 0x0f ; 15 2fb4e: af ad ldd r26, Y+63 ; 0x3f 2fb50: 2f 97 sbiw r28, 0x0f ; 15 2fb52: 63 96 adiw r28, 0x13 ; 19 2fb54: bf ad ldd r27, Y+63 ; 0x3f 2fb56: 63 97 sbiw r28, 0x13 ; 19 2fb58: 80 93 f0 03 sts 0x03F0, r24 ; 0x8003f0 <_ZL22previous_nominal_speed.lto_priv.450> 2fb5c: 90 93 f1 03 sts 0x03F1, r25 ; 0x8003f1 <_ZL22previous_nominal_speed.lto_priv.450+0x1> 2fb60: a0 93 f2 03 sts 0x03F2, r26 ; 0x8003f2 <_ZL22previous_nominal_speed.lto_priv.450+0x2> 2fb64: b0 93 f3 03 sts 0x03F3, r27 ; 0x8003f3 <_ZL22previous_nominal_speed.lto_priv.450+0x3> previous_safe_speed = safe_speed; 2fb68: 89 a5 ldd r24, Y+41 ; 0x29 2fb6a: 9d a5 ldd r25, Y+45 ; 0x2d 2fb6c: a9 ad ldd r26, Y+57 ; 0x39 2fb6e: b9 a9 ldd r27, Y+49 ; 0x31 2fb70: 80 93 dd 16 sts 0x16DD, r24 ; 0x8016dd 2fb74: 90 93 de 16 sts 0x16DE, r25 ; 0x8016de 2fb78: a0 93 df 16 sts 0x16DF, r26 ; 0x8016df 2fb7c: b0 93 e0 16 sts 0x16E0, r27 ; 0x8016e0 // Precalculate the division, so when all the trapezoids in the planner queue get recalculated, the division is not repeated. block->speed_factor = block->nominal_rate / block->nominal_speed; 2fb80: d8 01 movw r26, r16 2fb82: d6 96 adiw r26, 0x36 ; 54 2fb84: 6d 91 ld r22, X+ 2fb86: 7d 91 ld r23, X+ 2fb88: 8d 91 ld r24, X+ 2fb8a: 9c 91 ld r25, X 2fb8c: d9 97 sbiw r26, 0x39 ; 57 2fb8e: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 2fb92: 27 96 adiw r28, 0x07 ; 7 2fb94: 2f ad ldd r18, Y+63 ; 0x3f 2fb96: 27 97 sbiw r28, 0x07 ; 7 2fb98: 2b 96 adiw r28, 0x0b ; 11 2fb9a: 3f ad ldd r19, Y+63 ; 0x3f 2fb9c: 2b 97 sbiw r28, 0x0b ; 11 2fb9e: 2f 96 adiw r28, 0x0f ; 15 2fba0: 4f ad ldd r20, Y+63 ; 0x3f 2fba2: 2f 97 sbiw r28, 0x0f ; 15 2fba4: 63 96 adiw r28, 0x13 ; 19 2fba6: 5f ad ldd r21, Y+63 ; 0x3f 2fba8: 63 97 sbiw r28, 0x13 ; 19 2fbaa: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2fbae: 2b 01 movw r4, r22 2fbb0: 3c 01 movw r6, r24 2fbb2: f8 01 movw r30, r16 2fbb4: e8 5b subi r30, 0xB8 ; 184 2fbb6: ff 4f sbci r31, 0xFF ; 255 2fbb8: 40 82 st Z, r4 2fbba: 51 82 std Z+1, r5 ; 0x01 2fbbc: 62 82 std Z+2, r6 ; 0x02 2fbbe: 73 82 std Z+3, r7 ; 0x03 #ifdef LIN_ADVANCE if (block->use_advance_lead) { 2fbc0: 34 96 adiw r30, 0x04 ; 4 2fbc2: 80 81 ld r24, Z 2fbc4: 88 23 and r24, r24 2fbc6: 09 f4 brne .+2 ; 0x2fbca 2fbc8: 89 c0 rjmp .+274 ; 0x2fcdc // calculate the compression ratio for the segment (the required advance steps are computed // during trapezoid planning) float adv_comp = extruder_advance_K * e_D_ratio * cs.axis_steps_per_mm[E_AXIS]; // (step/(mm/s)) 2fbca: 20 91 e1 16 lds r18, 0x16E1 ; 0x8016e1 2fbce: 30 91 e2 16 lds r19, 0x16E2 ; 0x8016e2 2fbd2: 40 91 e3 16 lds r20, 0x16E3 ; 0x8016e3 2fbd6: 50 91 e4 16 lds r21, 0x16E4 ; 0x8016e4 2fbda: 6a 96 adiw r28, 0x1a ; 26 2fbdc: 6c ad ldd r22, Y+60 ; 0x3c 2fbde: 7d ad ldd r23, Y+61 ; 0x3d 2fbe0: 8e ad ldd r24, Y+62 ; 0x3e 2fbe2: 9f ad ldd r25, Y+63 ; 0x3f 2fbe4: 6a 97 sbiw r28, 0x1a ; 26 2fbe6: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2fbea: 4b 01 movw r8, r22 2fbec: 5c 01 movw r10, r24 2fbee: c0 90 42 04 lds r12, 0x0442 ; 0x800442 2fbf2: d0 90 43 04 lds r13, 0x0443 ; 0x800443 2fbf6: e0 90 44 04 lds r14, 0x0444 ; 0x800444 2fbfa: f0 90 45 04 lds r15, 0x0445 ; 0x800445 block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 2fbfe: 0c 5a subi r16, 0xAC ; 172 2fc00: 1f 4f sbci r17, 0xFF ; 255 #ifdef LIN_ADVANCE if (block->use_advance_lead) { // calculate the compression ratio for the segment (the required advance steps are computed // during trapezoid planning) float adv_comp = extruder_advance_K * e_D_ratio * cs.axis_steps_per_mm[E_AXIS]; // (step/(mm/s)) 2fc02: a7 01 movw r20, r14 2fc04: 96 01 movw r18, r12 2fc06: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 2fc0a: a3 01 movw r20, r6 2fc0c: 92 01 movw r18, r4 2fc0e: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2fc12: f8 01 movw r30, r16 2fc14: 60 83 st Z, r22 2fc16: 71 83 std Z+1, r23 ; 0x01 2fc18: 82 83 std Z+2, r24 ; 0x02 2fc1a: 93 83 std Z+3, r25 ; 0x03 float advance_speed; if (e_D_ratio > 0) 2fc1c: 20 e0 ldi r18, 0x00 ; 0 2fc1e: 30 e0 ldi r19, 0x00 ; 0 2fc20: a9 01 movw r20, r18 2fc22: 6a 96 adiw r28, 0x1a ; 26 2fc24: 6c ad ldd r22, Y+60 ; 0x3c 2fc26: 7d ad ldd r23, Y+61 ; 0x3d 2fc28: 8e ad ldd r24, Y+62 ; 0x3e 2fc2a: 9f ad ldd r25, Y+63 ; 0x3f 2fc2c: 6a 97 sbiw r28, 0x1a ; 26 2fc2e: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 2fc32: 18 16 cp r1, r24 2fc34: 0c f0 brlt .+2 ; 0x2fc38 2fc36: 40 c4 rjmp .+2176 ; 0x304b8 advance_speed = (extruder_advance_K * e_D_ratio * block->acceleration * cs.axis_steps_per_mm[E_AXIS]); 2fc38: a5 01 movw r20, r10 2fc3a: 94 01 movw r18, r8 2fc3c: e1 96 adiw r28, 0x31 ; 49 2fc3e: 6c ad ldd r22, Y+60 ; 0x3c 2fc40: 7d ad ldd r23, Y+61 ; 0x3d 2fc42: 8e ad ldd r24, Y+62 ; 0x3e 2fc44: 9f ad ldd r25, Y+63 ; 0x3f 2fc46: e1 97 sbiw r28, 0x31 ; 49 2fc48: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2fc4c: a7 01 movw r20, r14 2fc4e: 96 01 movw r18, r12 else advance_speed = cs.max_jerk[E_AXIS] * cs.axis_steps_per_mm[E_AXIS]; 2fc50: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2fc54: 6b 01 movw r12, r22 2fc56: 7c 01 movw r14, r24 // to save more space we avoid another copy of calc_timer and go through slow division, but we // still need to replicate the *exact* same step grouping policy (see below) if (advance_speed > MAX_STEP_FREQUENCY) advance_speed = MAX_STEP_FREQUENCY; 2fc58: 20 e0 ldi r18, 0x00 ; 0 2fc5a: 30 e4 ldi r19, 0x40 ; 64 2fc5c: 4c e1 ldi r20, 0x1C ; 28 2fc5e: 57 e4 ldi r21, 0x47 ; 71 2fc60: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 2fc64: 18 16 cp r1, r24 2fc66: 3c f4 brge .+14 ; 0x2fc76 2fc68: c1 2c mov r12, r1 2fc6a: 20 e4 ldi r18, 0x40 ; 64 2fc6c: d2 2e mov r13, r18 2fc6e: 2c e1 ldi r18, 0x1C ; 28 2fc70: e2 2e mov r14, r18 2fc72: 27 e4 ldi r18, 0x47 ; 71 2fc74: f2 2e mov r15, r18 float advance_rate = (F_CPU / 8.0) / advance_speed; 2fc76: a7 01 movw r20, r14 2fc78: 96 01 movw r18, r12 2fc7a: 60 e0 ldi r22, 0x00 ; 0 2fc7c: 74 e2 ldi r23, 0x24 ; 36 2fc7e: 84 ef ldi r24, 0xF4 ; 244 2fc80: 99 e4 ldi r25, 0x49 ; 73 2fc82: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 2fc86: 4b 01 movw r8, r22 2fc88: 5c 01 movw r10, r24 if (advance_speed > 20000) { 2fc8a: 20 e0 ldi r18, 0x00 ; 0 2fc8c: 30 e4 ldi r19, 0x40 ; 64 2fc8e: 4c e9 ldi r20, 0x9C ; 156 2fc90: 56 e4 ldi r21, 0x46 ; 70 2fc92: c7 01 movw r24, r14 2fc94: b6 01 movw r22, r12 2fc96: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 2fc9a: 18 16 cp r1, r24 2fc9c: 0c f0 brlt .+2 ; 0x2fca0 2fc9e: 17 c4 rjmp .+2094 ; 0x304ce block->advance_rate = advance_rate * 4; 2fca0: 8e e6 ldi r24, 0x6E ; 110 2fca2: 82 9d mul r24, r2 2fca4: 80 01 movw r16, r0 2fca6: 83 9d mul r24, r3 2fca8: 10 0d add r17, r0 2fcaa: 11 24 eor r1, r1 2fcac: 08 53 subi r16, 0x38 ; 56 2fcae: 19 4f sbci r17, 0xF9 ; 249 2fcb0: 78 01 movw r14, r16 2fcb2: fd e4 ldi r31, 0x4D ; 77 2fcb4: ef 0e add r14, r31 2fcb6: f1 1c adc r15, r1 2fcb8: 20 e0 ldi r18, 0x00 ; 0 2fcba: 30 e0 ldi r19, 0x00 ; 0 2fcbc: 40 e8 ldi r20, 0x80 ; 128 2fcbe: 50 e4 ldi r21, 0x40 ; 64 2fcc0: c5 01 movw r24, r10 2fcc2: b4 01 movw r22, r8 2fcc4: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2fcc8: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 2fccc: d7 01 movw r26, r14 2fcce: 6d 93 st X+, r22 2fcd0: 7c 93 st X, r23 block->advance_step_loops = 4; 2fcd2: f8 01 movw r30, r16 2fcd4: ed 5a subi r30, 0xAD ; 173 2fcd6: ff 4f sbci r31, 0xFF ; 255 2fcd8: 84 e0 ldi r24, 0x04 ; 4 // never overflow the internal accumulator with very low rates if (advance_rate < UINT16_MAX) block->advance_rate = advance_rate; else block->advance_rate = UINT16_MAX; block->advance_step_loops = 1; 2fcda: 80 83 st Z, r24 SERIAL_ECHOLNPGM("LA: More than 2 steps per eISR loop executed."); #endif } #endif calculate_trapezoid_for_block(block, block->entry_speed, safe_speed); 2fcdc: 09 a5 ldd r16, Y+41 ; 0x29 2fcde: 1d a5 ldd r17, Y+45 ; 0x2d 2fce0: 29 ad ldd r18, Y+57 ; 0x39 2fce2: 39 a9 ldd r19, Y+49 ; 0x31 2fce4: 4d ad ldd r20, Y+61 ; 0x3d 2fce6: 5d a9 ldd r21, Y+53 ; 0x35 2fce8: 6e ad ldd r22, Y+62 ; 0x3e 2fcea: 23 96 adiw r28, 0x03 ; 3 2fcec: 7f ad ldd r23, Y+63 ; 0x3f 2fcee: 23 97 sbiw r28, 0x03 ; 3 2fcf0: a3 96 adiw r28, 0x23 ; 35 2fcf2: 8e ad ldd r24, Y+62 ; 0x3e 2fcf4: 9f ad ldd r25, Y+63 ; 0x3f 2fcf6: a3 97 sbiw r28, 0x23 ; 35 2fcf8: 88 53 subi r24, 0x38 ; 56 2fcfa: 99 4f sbci r25, 0xF9 ; 249 2fcfc: 0f 94 b8 6b call 0x2d770 ; 0x2d770 if (block->step_event_count.wide <= 32767) 2fd00: 8e e6 ldi r24, 0x6E ; 110 2fd02: 82 9d mul r24, r2 2fd04: f0 01 movw r30, r0 2fd06: 83 9d mul r24, r3 2fd08: f0 0d add r31, r0 2fd0a: 11 24 eor r1, r1 2fd0c: e8 53 subi r30, 0x38 ; 56 2fd0e: f9 4f sbci r31, 0xF9 ; 249 2fd10: 80 89 ldd r24, Z+16 ; 0x10 2fd12: 91 89 ldd r25, Z+17 ; 0x11 2fd14: a2 89 ldd r26, Z+18 ; 0x12 2fd16: b3 89 ldd r27, Z+19 ; 0x13 2fd18: 81 15 cp r24, r1 2fd1a: 90 48 sbci r25, 0x80 ; 128 2fd1c: a1 05 cpc r26, r1 2fd1e: b1 05 cpc r27, r1 2fd20: 18 f4 brcc .+6 ; 0x2fd28 block->flag |= BLOCK_FLAG_DDA_LOWRES; 2fd22: 85 a9 ldd r24, Z+53 ; 0x35 2fd24: 88 60 ori r24, 0x08 ; 8 2fd26: 85 ab std Z+53, r24 ; 0x35 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 2fd28: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2fd2a: f8 94 cli // Move the buffer head ensuring the current block hasn't been cancelled from an isr context // (this is possible both during crash detection *and* uvlo, thus needing a global cli) if(planner_aborted) return; 2fd2c: 90 91 ac 0d lds r25, 0x0DAC ; 0x800dac 2fd30: 91 11 cpse r25, r1 2fd32: 93 c4 rjmp .+2342 ; 0x3065a block_buffer_head = next_buffer_head; 2fd34: a0 96 adiw r28, 0x20 ; 32 2fd36: 3f ad ldd r19, Y+63 ; 0x3f 2fd38: a0 97 sbiw r28, 0x20 ; 32 2fd3a: 30 93 a8 0d sts 0x0DA8, r19 ; 0x800da8 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2fd3e: 8f bf out 0x3f, r24 ; 63 } // Update position memcpy(position, target, sizeof(target)); // position[] = target[] 2fd40: c3 58 subi r28, 0x83 ; 131 2fd42: df 4f sbci r29, 0xFF ; 255 2fd44: 88 81 ld r24, Y 2fd46: 99 81 ldd r25, Y+1 ; 0x01 2fd48: aa 81 ldd r26, Y+2 ; 0x02 2fd4a: bb 81 ldd r27, Y+3 ; 0x03 2fd4c: cd 57 subi r28, 0x7D ; 125 2fd4e: d0 40 sbci r29, 0x00 ; 0 2fd50: 80 93 a6 06 sts 0x06A6, r24 ; 0x8006a6 2fd54: 90 93 a7 06 sts 0x06A7, r25 ; 0x8006a7 2fd58: a0 93 a8 06 sts 0x06A8, r26 ; 0x8006a8 2fd5c: b0 93 a9 06 sts 0x06A9, r27 ; 0x8006a9 2fd60: cf 57 subi r28, 0x7F ; 127 2fd62: df 4f sbci r29, 0xFF ; 255 2fd64: 28 81 ld r18, Y 2fd66: 39 81 ldd r19, Y+1 ; 0x01 2fd68: 4a 81 ldd r20, Y+2 ; 0x02 2fd6a: 5b 81 ldd r21, Y+3 ; 0x03 2fd6c: c1 58 subi r28, 0x81 ; 129 2fd6e: d0 40 sbci r29, 0x00 ; 0 2fd70: 20 93 aa 06 sts 0x06AA, r18 ; 0x8006aa 2fd74: 30 93 ab 06 sts 0x06AB, r19 ; 0x8006ab 2fd78: 40 93 ac 06 sts 0x06AC, r20 ; 0x8006ac 2fd7c: 50 93 ad 06 sts 0x06AD, r21 ; 0x8006ad 2fd80: e5 96 adiw r28, 0x35 ; 53 2fd82: 8c ad ldd r24, Y+60 ; 0x3c 2fd84: 9d ad ldd r25, Y+61 ; 0x3d 2fd86: ae ad ldd r26, Y+62 ; 0x3e 2fd88: bf ad ldd r27, Y+63 ; 0x3f 2fd8a: e5 97 sbiw r28, 0x35 ; 53 2fd8c: 80 93 ae 06 sts 0x06AE, r24 ; 0x8006ae 2fd90: 90 93 af 06 sts 0x06AF, r25 ; 0x8006af 2fd94: a0 93 b0 06 sts 0x06B0, r26 ; 0x8006b0 2fd98: b0 93 b1 06 sts 0x06B1, r27 ; 0x8006b1 2fd9c: ad 96 adiw r28, 0x2d ; 45 2fd9e: 2c ad ldd r18, Y+60 ; 0x3c 2fda0: 3d ad ldd r19, Y+61 ; 0x3d 2fda2: 4e ad ldd r20, Y+62 ; 0x3e 2fda4: 5f ad ldd r21, Y+63 ; 0x3f 2fda6: ad 97 sbiw r28, 0x2d ; 45 2fda8: 20 93 b2 06 sts 0x06B2, r18 ; 0x8006b2 2fdac: 30 93 b3 06 sts 0x06B3, r19 ; 0x8006b3 2fdb0: 40 93 b4 06 sts 0x06B4, r20 ; 0x8006b4 2fdb4: 50 93 b5 06 sts 0x06B5, r21 ; 0x8006b5 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 2fdb8: 89 a1 ldd r24, Y+33 ; 0x21 2fdba: 9a a1 ldd r25, Y+34 ; 0x22 2fdbc: ab a1 ldd r26, Y+35 ; 0x23 2fdbe: bc a1 ldd r27, Y+36 ; 0x24 2fdc0: 80 93 04 04 sts 0x0404, r24 ; 0x800404 2fdc4: 90 93 05 04 sts 0x0405, r25 ; 0x800405 2fdc8: a0 93 06 04 sts 0x0406, r26 ; 0x800406 2fdcc: b0 93 07 04 sts 0x0407, r27 ; 0x800407 position_float[Y_AXIS] = y; 2fdd0: 8d a1 ldd r24, Y+37 ; 0x25 2fdd2: 9e a1 ldd r25, Y+38 ; 0x26 2fdd4: af a1 ldd r26, Y+39 ; 0x27 2fdd6: b8 a5 ldd r27, Y+40 ; 0x28 2fdd8: 80 93 08 04 sts 0x0408, r24 ; 0x800408 2fddc: 90 93 09 04 sts 0x0409, r25 ; 0x800409 2fde0: a0 93 0a 04 sts 0x040A, r26 ; 0x80040a 2fde4: b0 93 0b 04 sts 0x040B, r27 ; 0x80040b position_float[Z_AXIS] = z; 2fde8: a7 96 adiw r28, 0x27 ; 39 2fdea: 8c ad ldd r24, Y+60 ; 0x3c 2fdec: 9d ad ldd r25, Y+61 ; 0x3d 2fdee: ae ad ldd r26, Y+62 ; 0x3e 2fdf0: bf ad ldd r27, Y+63 ; 0x3f 2fdf2: a7 97 sbiw r28, 0x27 ; 39 2fdf4: 80 93 0c 04 sts 0x040C, r24 ; 0x80040c 2fdf8: 90 93 0d 04 sts 0x040D, r25 ; 0x80040d 2fdfc: a0 93 0e 04 sts 0x040E, r26 ; 0x80040e 2fe00: b0 93 0f 04 sts 0x040F, r27 ; 0x80040f position_float[E_AXIS] = e; 2fe04: a9 96 adiw r28, 0x29 ; 41 2fe06: ee ad ldd r30, Y+62 ; 0x3e 2fe08: ff ad ldd r31, Y+63 ; 0x3f 2fe0a: a9 97 sbiw r28, 0x29 ; 41 2fe0c: 80 81 ld r24, Z 2fe0e: 91 81 ldd r25, Z+1 ; 0x01 2fe10: a2 81 ldd r26, Z+2 ; 0x02 2fe12: b3 81 ldd r27, Z+3 ; 0x03 2fe14: 80 93 10 04 sts 0x0410, r24 ; 0x800410 2fe18: 90 93 11 04 sts 0x0411, r25 ; 0x800411 2fe1c: a0 93 12 04 sts 0x0412, r26 ; 0x800412 2fe20: b0 93 13 04 sts 0x0413, r27 ; 0x800413 void planner_recalculate(const float &safe_final_speed) { // Reverse pass // Make a local copy of block_buffer_tail, because the interrupt can alter it // by consuming the blocks, therefore shortening the queue. uint8_t tail = block_buffer_tail; 2fe24: f0 90 a9 0d lds r15, 0x0DA9 ; 0x800da9 block_t *prev, *current, *next; // SERIAL_ECHOLNPGM("planner_recalculate - 1"); // At least three blocks are in the queue? uint8_t n_blocks = (block_buffer_head + BLOCK_BUFFER_SIZE - tail) & (BLOCK_BUFFER_SIZE - 1); 2fe28: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 2fe2c: 8f 19 sub r24, r15 2fe2e: 8f 70 andi r24, 0x0F ; 15 if (n_blocks >= 3) { 2fe30: 83 30 cpi r24, 0x03 ; 3 2fe32: 40 f1 brcs .+80 ; 0x2fe84 // Initialize the last tripple of blocks. block_index = prev_block_index(block_buffer_head); 2fe34: 10 91 a8 0d lds r17, 0x0DA8 ; 0x800da8 } // Returns the index of the previous block in the ring buffer static inline uint8_t prev_block_index(uint8_t block_index) { if (block_index == 0) 2fe38: 11 11 cpse r17, r1 2fe3a: 01 c0 rjmp .+2 ; 0x2fe3e block_index = BLOCK_BUFFER_SIZE; 2fe3c: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 2fe3e: 11 50 subi r17, 0x01 ; 1 // At least three blocks are in the queue? uint8_t n_blocks = (block_buffer_head + BLOCK_BUFFER_SIZE - tail) & (BLOCK_BUFFER_SIZE - 1); if (n_blocks >= 3) { // Initialize the last tripple of blocks. block_index = prev_block_index(block_buffer_head); next = block_buffer + block_index; 2fe40: fe e6 ldi r31, 0x6E ; 110 2fe42: 1f 9f mul r17, r31 2fe44: c0 01 movw r24, r0 2fe46: 11 24 eor r1, r1 2fe48: 9c 01 movw r18, r24 2fe4a: 28 53 subi r18, 0x38 ; 56 2fe4c: 39 4f sbci r19, 0xF9 ; 249 2fe4e: 59 01 movw r10, r18 } // Returns the index of the previous block in the ring buffer static inline uint8_t prev_block_index(uint8_t block_index) { if (block_index == 0) 2fe50: 11 11 cpse r17, r1 2fe52: 01 c0 rjmp .+2 ; 0x2fe56 block_index = BLOCK_BUFFER_SIZE; 2fe54: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 2fe56: 11 50 subi r17, 0x01 ; 1 uint8_t n_blocks = (block_buffer_head + BLOCK_BUFFER_SIZE - tail) & (BLOCK_BUFFER_SIZE - 1); if (n_blocks >= 3) { // Initialize the last tripple of blocks. block_index = prev_block_index(block_buffer_head); next = block_buffer + block_index; current = block_buffer + (block_index = prev_block_index(block_index)); 2fe58: 3e e6 ldi r19, 0x6E ; 110 2fe5a: 13 9f mul r17, r19 2fe5c: c0 01 movw r24, r0 2fe5e: 11 24 eor r1, r1 2fe60: ac 01 movw r20, r24 2fe62: 48 53 subi r20, 0x38 ; 56 2fe64: 59 4f sbci r21, 0xF9 ; 249 2fe66: 6a 01 movw r12, r20 // min(current->max_entry_speed, sqrt(next->entry_speed*next->entry_speed+2*current->acceleration*current->millimeters)); min(current->max_entry_speed, max_allowable_entry_speed(-current->acceleration,next->entry_speed,current->millimeters)); current->flag |= BLOCK_FLAG_RECALCULATE; } next = current; current = block_buffer + (block_index = prev_block_index(block_index)); 2fe68: 9e e6 ldi r25, 0x6E ; 110 2fe6a: 69 2e mov r6, r25 current = block_buffer + (block_index = prev_block_index(block_index)); // No need to recalculate the last block, it has already been set by the plan_buffer_line() function. // Vojtech thinks, that one shall not touch the entry speed of the very first block as well, because // 1) it may already be running at the stepper interrupt, // 2) there is no way to limit it when going in the forward direction. while (block_index != tail) { 2fe6c: f1 16 cp r15, r17 2fe6e: 69 f0 breq .+26 ; 0x2fe8a if (current->flag & BLOCK_FLAG_START_FROM_FULL_HALT) { 2fe70: d6 01 movw r26, r12 2fe72: d5 96 adiw r26, 0x35 ; 53 2fe74: 0c 91 ld r16, X 2fe76: 02 ff sbrs r16, 2 2fe78: 7e c3 rjmp .+1788 ; 0x30576 // Don't modify the entry velocity of the starting block. // Also don't modify the trapezoids before this block, they are finalized already, prepared // for the stepper interrupt routine to use them. tail = block_index; // Update the number of blocks to process. n_blocks = (block_buffer_head + BLOCK_BUFFER_SIZE - tail) & (BLOCK_BUFFER_SIZE - 1); 2fe7a: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 2fe7e: 81 1b sub r24, r17 2fe80: 8f 70 andi r24, 0x0F ; 15 2fe82: f1 2e mov r15, r17 } // SERIAL_ECHOLNPGM("planner_recalculate - 2"); // Forward pass and recalculate the trapezoids. if (n_blocks >= 2) { 2fe84: 82 30 cpi r24, 0x02 ; 2 2fe86: 08 f4 brcc .+2 ; 0x2fe8a 2fe88: a3 c0 rjmp .+326 ; 0x2ffd0 // Better to limit the velocities using the already processed block, if it is available, so rather use the saved tail. block_index = tail; prev = block_buffer + block_index; 2fe8a: 3e e6 ldi r19, 0x6E ; 110 2fe8c: f3 9e mul r15, r19 2fe8e: c0 01 movw r24, r0 2fe90: 11 24 eor r1, r1 2fe92: ac 01 movw r20, r24 2fe94: 48 53 subi r20, 0x38 ; 56 2fe96: 59 4f sbci r21, 0xF9 ; 249 2fe98: 5a 01 movw r10, r20 static bool plan_reset_next_e_sched; // Returns the index of the next block in the ring buffer // NOTE: Removed modulo (%) operator, which uses an expensive divide and multiplication. static inline uint8_t next_block_index(uint8_t block_index) { if (++ block_index == BLOCK_BUFFER_SIZE) 2fe9a: f3 94 inc r15 2fe9c: 50 e1 ldi r21, 0x10 ; 16 2fe9e: f5 12 cpse r15, r21 2fea0: 01 c0 rjmp .+2 ; 0x2fea4 block_index = 0; 2fea2: f1 2c mov r15, r1 // Forward pass and recalculate the trapezoids. if (n_blocks >= 2) { // Better to limit the velocities using the already processed block, if it is available, so rather use the saved tail. block_index = tail; prev = block_buffer + block_index; current = block_buffer + (block_index = next_block_index(block_index)); 2fea4: ae e6 ldi r26, 0x6E ; 110 2fea6: fa 9e mul r15, r26 2fea8: c0 01 movw r24, r0 2feaa: 11 24 eor r1, r1 2feac: fc 01 movw r30, r24 2feae: e8 53 subi r30, 0x38 ; 56 2feb0: f9 4f sbci r31, 0xF9 ; 249 2feb2: 6f 01 movw r12, r30 calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; } prev = current; current = block_buffer + (block_index = next_block_index(block_index)); 2feb4: 8e e6 ldi r24, 0x6E ; 110 2feb6: 88 2e mov r8, r24 do { // If the previous block is an acceleration block, but it is not long enough to complete the // full speed change within the block, we need to adjust the entry speed accordingly. Entry // speeds have already been reset, maximized, and reverse planned by reverse planner. // If nominal length is true, max junction speed is guaranteed to be reached. No need to recheck. if (! (prev->flag & BLOCK_FLAG_NOMINAL_LENGTH) && prev->entry_speed < current->entry_speed) { 2feb8: d5 01 movw r26, r10 2feba: d5 96 adiw r26, 0x35 ; 53 2febc: 8c 91 ld r24, X 2febe: d5 97 sbiw r26, 0x35 ; 53 2fec0: 81 fd sbrc r24, 1 2fec2: 5a c0 rjmp .+180 ; 0x2ff78 2fec4: 95 96 adiw r26, 0x25 ; 37 2fec6: 4d 90 ld r4, X+ 2fec8: 5d 90 ld r5, X+ 2feca: 6d 90 ld r6, X+ 2fecc: 7c 90 ld r7, X 2fece: 98 97 sbiw r26, 0x28 ; 40 2fed0: f6 01 movw r30, r12 2fed2: 95 a0 ldd r9, Z+37 ; 0x25 2fed4: e6 a0 ldd r14, Z+38 ; 0x26 2fed6: 07 a1 ldd r16, Z+39 ; 0x27 2fed8: 10 a5 ldd r17, Z+40 ; 0x28 2feda: 29 2d mov r18, r9 2fedc: 3e 2d mov r19, r14 2fede: a8 01 movw r20, r16 2fee0: c3 01 movw r24, r6 2fee2: b2 01 movw r22, r4 2fee4: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 2fee8: 87 ff sbrs r24, 7 2feea: 46 c0 rjmp .+140 ; 0x2ff78 // Calculates the maximum allowable entry speed, when you must be able to reach target_velocity using the // decceleration within the allotted distance. FORCE_INLINE float max_allowable_entry_speed(float decceleration, float target_velocity, float distance) { // assert(decceleration < 0); return sqrt(target_velocity*target_velocity-2*decceleration*distance); 2feec: a3 01 movw r20, r6 2feee: 92 01 movw r18, r4 2fef0: c3 01 movw r24, r6 2fef2: b2 01 movw r22, r4 2fef4: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2fef8: 2b 01 movw r4, r22 2fefa: 3c 01 movw r6, r24 // If the previous block is an acceleration block, but it is not long enough to complete the // full speed change within the block, we need to adjust the entry speed accordingly. Entry // speeds have already been reset, maximized, and reverse planned by reverse planner. // If nominal length is true, max junction speed is guaranteed to be reached. No need to recheck. if (! (prev->flag & BLOCK_FLAG_NOMINAL_LENGTH) && prev->entry_speed < current->entry_speed) { float entry_speed = min(current->entry_speed, max_allowable_entry_speed(-prev->acceleration,prev->entry_speed,prev->millimeters)); 2fefc: d5 01 movw r26, r10 2fefe: d1 96 adiw r26, 0x31 ; 49 2ff00: 6d 91 ld r22, X+ 2ff02: 7d 91 ld r23, X+ 2ff04: 8d 91 ld r24, X+ 2ff06: 9c 91 ld r25, X 2ff08: d4 97 sbiw r26, 0x34 ; 52 2ff0a: 90 58 subi r25, 0x80 ; 128 // Calculates the maximum allowable entry speed, when you must be able to reach target_velocity using the // decceleration within the allotted distance. FORCE_INLINE float max_allowable_entry_speed(float decceleration, float target_velocity, float distance) { // assert(decceleration < 0); return sqrt(target_velocity*target_velocity-2*decceleration*distance); 2ff0c: 9b 01 movw r18, r22 2ff0e: ac 01 movw r20, r24 2ff10: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 2ff14: f5 01 movw r30, r10 2ff16: 25 a5 ldd r18, Z+45 ; 0x2d 2ff18: 36 a5 ldd r19, Z+46 ; 0x2e 2ff1a: 47 a5 ldd r20, Z+47 ; 0x2f 2ff1c: 50 a9 ldd r21, Z+48 ; 0x30 2ff1e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 2ff22: 9b 01 movw r18, r22 2ff24: ac 01 movw r20, r24 2ff26: c3 01 movw r24, r6 2ff28: b2 01 movw r22, r4 2ff2a: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 2ff2e: 0f 94 d2 a4 call 0x349a4 ; 0x349a4 2ff32: 2b 01 movw r4, r22 2ff34: 3c 01 movw r6, r24 // If the previous block is an acceleration block, but it is not long enough to complete the // full speed change within the block, we need to adjust the entry speed accordingly. Entry // speeds have already been reset, maximized, and reverse planned by reverse planner. // If nominal length is true, max junction speed is guaranteed to be reached. No need to recheck. if (! (prev->flag & BLOCK_FLAG_NOMINAL_LENGTH) && prev->entry_speed < current->entry_speed) { float entry_speed = min(current->entry_speed, max_allowable_entry_speed(-prev->acceleration,prev->entry_speed,prev->millimeters)); 2ff36: 9b 01 movw r18, r22 2ff38: ac 01 movw r20, r24 2ff3a: 69 2d mov r22, r9 2ff3c: 7e 2d mov r23, r14 2ff3e: c8 01 movw r24, r16 2ff40: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 2ff44: 87 ff sbrs r24, 7 2ff46: 03 c0 rjmp .+6 ; 0x2ff4e 2ff48: 49 2c mov r4, r9 2ff4a: 5e 2c mov r5, r14 2ff4c: 38 01 movw r6, r16 // Check for junction speed change if (current->entry_speed != entry_speed) { 2ff4e: 92 01 movw r18, r4 2ff50: a3 01 movw r20, r6 2ff52: 69 2d mov r22, r9 2ff54: 7e 2d mov r23, r14 2ff56: c8 01 movw r24, r16 2ff58: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 2ff5c: 88 23 and r24, r24 2ff5e: 61 f0 breq .+24 ; 0x2ff78 2ff60: d6 01 movw r26, r12 2ff62: d5 96 adiw r26, 0x35 ; 53 2ff64: 2c 91 ld r18, X current->entry_speed = entry_speed; 2ff66: c2 01 movw r24, r4 2ff68: d3 01 movw r26, r6 2ff6a: f6 01 movw r30, r12 2ff6c: 85 a3 std Z+37, r24 ; 0x25 2ff6e: 96 a3 std Z+38, r25 ; 0x26 2ff70: a7 a3 std Z+39, r26 ; 0x27 2ff72: b0 a7 std Z+40, r27 ; 0x28 current->flag |= BLOCK_FLAG_RECALCULATE; 2ff74: 21 60 ori r18, 0x01 ; 1 2ff76: 25 ab std Z+53, r18 ; 0x35 } } // Recalculate if current block entry or exit junction speed has changed. if ((prev->flag | current->flag) & BLOCK_FLAG_RECALCULATE) { 2ff78: d5 01 movw r26, r10 2ff7a: d5 96 adiw r26, 0x35 ; 53 2ff7c: 8c 91 ld r24, X 2ff7e: d5 97 sbiw r26, 0x35 ; 53 2ff80: f6 01 movw r30, r12 2ff82: 95 a9 ldd r25, Z+53 ; 0x35 2ff84: 89 2b or r24, r25 2ff86: 80 ff sbrs r24, 0 2ff88: 14 c0 rjmp .+40 ; 0x2ffb2 // NOTE: Entry and exit factors always > 0 by all previous logic operations. calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); 2ff8a: 05 a1 ldd r16, Z+37 ; 0x25 2ff8c: 16 a1 ldd r17, Z+38 ; 0x26 2ff8e: 27 a1 ldd r18, Z+39 ; 0x27 2ff90: 30 a5 ldd r19, Z+40 ; 0x28 2ff92: 95 96 adiw r26, 0x25 ; 37 2ff94: 4d 91 ld r20, X+ 2ff96: 5d 91 ld r21, X+ 2ff98: 6d 91 ld r22, X+ 2ff9a: 7c 91 ld r23, X 2ff9c: 98 97 sbiw r26, 0x28 ; 40 2ff9e: c5 01 movw r24, r10 2ffa0: 0f 94 b8 6b call 0x2d770 ; 0x2d770 // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; 2ffa4: d5 01 movw r26, r10 2ffa6: d5 96 adiw r26, 0x35 ; 53 2ffa8: 8c 91 ld r24, X 2ffaa: d5 97 sbiw r26, 0x35 ; 53 2ffac: 8e 7f andi r24, 0xFE ; 254 2ffae: d5 96 adiw r26, 0x35 ; 53 2ffb0: 8c 93 st X, r24 static bool plan_reset_next_e_sched; // Returns the index of the next block in the ring buffer // NOTE: Removed modulo (%) operator, which uses an expensive divide and multiplication. static inline uint8_t next_block_index(uint8_t block_index) { if (++ block_index == BLOCK_BUFFER_SIZE) 2ffb2: f3 94 inc r15 2ffb4: b0 e1 ldi r27, 0x10 ; 16 2ffb6: fb 12 cpse r15, r27 2ffb8: 01 c0 rjmp .+2 ; 0x2ffbc block_index = 0; 2ffba: f1 2c mov r15, r1 calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; } prev = current; current = block_buffer + (block_index = next_block_index(block_index)); 2ffbc: f8 9c mul r15, r8 2ffbe: c0 01 movw r24, r0 2ffc0: 11 24 eor r1, r1 2ffc2: 88 53 subi r24, 0x38 ; 56 2ffc4: 99 4f sbci r25, 0xF9 ; 249 } while (block_index != block_buffer_head); 2ffc6: 20 91 a8 0d lds r18, 0x0DA8 ; 0x800da8 // NOTE: Entry and exit factors always > 0 by all previous logic operations. calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; } prev = current; 2ffca: 56 01 movw r10, r12 current = block_buffer + (block_index = next_block_index(block_index)); } while (block_index != block_buffer_head); 2ffcc: f2 12 cpse r15, r18 2ffce: 43 c3 rjmp .+1670 ; 0x30656 } // SERIAL_ECHOLNPGM("planner_recalculate - 3"); // Last/newest block in buffer. Exit speed is set with safe_final_speed. Always recalculated. current = block_buffer + prev_block_index(block_buffer_head); 2ffd0: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 } // Returns the index of the previous block in the ring buffer static inline uint8_t prev_block_index(uint8_t block_index) { if (block_index == 0) 2ffd4: 81 11 cpse r24, r1 2ffd6: 01 c0 rjmp .+2 ; 0x2ffda block_index = BLOCK_BUFFER_SIZE; 2ffd8: 80 e1 ldi r24, 0x10 ; 16 -- block_index; 2ffda: 81 50 subi r24, 0x01 ; 1 } // SERIAL_ECHOLNPGM("planner_recalculate - 3"); // Last/newest block in buffer. Exit speed is set with safe_final_speed. Always recalculated. current = block_buffer + prev_block_index(block_buffer_head); 2ffdc: ee e6 ldi r30, 0x6E ; 110 2ffde: 8e 9f mul r24, r30 2ffe0: c0 01 movw r24, r0 2ffe2: 11 24 eor r1, r1 2ffe4: 9c 01 movw r18, r24 2ffe6: 28 53 subi r18, 0x38 ; 56 2ffe8: 39 4f sbci r19, 0xF9 ; 249 2ffea: 79 01 movw r14, r18 calculate_trapezoid_for_block(current, current->entry_speed, safe_final_speed); 2ffec: d9 01 movw r26, r18 2ffee: 95 96 adiw r26, 0x25 ; 37 2fff0: 4d 91 ld r20, X+ 2fff2: 5d 91 ld r21, X+ 2fff4: 6d 91 ld r22, X+ 2fff6: 7c 91 ld r23, X 2fff8: 98 97 sbiw r26, 0x28 ; 40 2fffa: 09 a5 ldd r16, Y+41 ; 0x29 2fffc: 1d a5 ldd r17, Y+45 ; 0x2d 2fffe: 29 ad ldd r18, Y+57 ; 0x39 30000: 39 a9 ldd r19, Y+49 ; 0x31 30002: c7 01 movw r24, r14 30004: 0f 94 b8 6b call 0x2d770 ; 0x2d770 current->flag &= ~BLOCK_FLAG_RECALCULATE; 30008: f7 01 movw r30, r14 3000a: 85 a9 ldd r24, Z+53 ; 0x35 3000c: 8e 7f andi r24, 0xFE ; 254 3000e: 85 ab std Z+53, r24 ; 0x35 // The stepper timer interrupt will run continuously from now on. // If there are no planner blocks to be executed by the stepper routine, // the stepper interrupt ticks at 1kHz to wake up and pick a block // from the planner queue if available. ENABLE_STEPPER_DRIVER_INTERRUPT(); 30010: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 30014: 82 60 ori r24, 0x02 ; 2 30016: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 3001a: 0d 94 89 75 jmp 0x2eb12 ; 0x2eb12 // Save original start position of the move if (gcode_start_position) memcpy(block->gcode_start_position, gcode_start_position, sizeof(block_t::gcode_start_position)); else memcpy(block->gcode_start_position, current_position, sizeof(block_t::gcode_start_position)); 3001e: a0 5e subi r26, 0xE0 ; 224 30020: b8 4f sbci r27, 0xF8 ; 248 30022: 80 e1 ldi r24, 0x10 ; 16 30024: e5 ef ldi r30, 0xF5 ; 245 30026: f1 e1 ldi r31, 0x11 ; 17 30028: 0d 94 c4 75 jmp 0x2eb88 ; 0x2eb88 target[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); #ifdef MESH_BED_LEVELING if (mbl.active){ target[Z_AXIS] = lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]); }else{ target[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 3002c: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 30030: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 30034: 40 91 40 04 lds r20, 0x0440 ; 0x800440 30038: 50 91 41 04 lds r21, 0x0441 ; 0x800441 3003c: a7 96 adiw r28, 0x27 ; 39 3003e: 6c ad ldd r22, Y+60 ; 0x3c 30040: 7d ad ldd r23, Y+61 ; 0x3d 30042: 8e ad ldd r24, Y+62 ; 0x3e 30044: 9f ad ldd r25, Y+63 ; 0x3f 30046: a7 97 sbiw r28, 0x27 ; 39 30048: 0d 94 5a 76 jmp 0x2ecb4 ; 0x2ecb4 block->fan_speed = fanSpeed; // Compute direction bits for this block block->direction_bits = 0; #ifndef COREXY if (dx < 0) block->direction_bits |= _BV(X_AXIS); 3004c: 81 e0 ldi r24, 0x01 ; 1 3004e: 80 8f std Z+24, r24 ; 0x18 30050: 0d 94 00 78 jmp 0x2f000 ; 0x2f000 { if(feed_rate 30058: b0 90 6f 04 lds r11, 0x046F ; 0x80046f 3005c: 00 91 70 04 lds r16, 0x0470 ; 0x800470 30060: 10 91 71 04 lds r17, 0x0471 ; 0x800471 30064: 53 c8 rjmp .-3930 ; 0x2f10c block->millimeters = fabs(delta_mm[E_AXIS]); } else { #ifndef COREXY block->millimeters = sqrt(square(delta_mm[X_AXIS]) + square(delta_mm[Y_AXIS]) + square(delta_mm[Z_AXIS])); 30066: c5 01 movw r24, r10 30068: b4 01 movw r22, r8 3006a: 0f 94 a5 9a call 0x3354a ; 0x3354a 3006e: 4b 01 movw r8, r22 30070: 5c 01 movw r10, r24 30072: c7 01 movw r24, r14 30074: b6 01 movw r22, r12 30076: 0f 94 a5 9a call 0x3354a ; 0x3354a 3007a: 9b 01 movw r18, r22 3007c: ac 01 movw r20, r24 3007e: c5 01 movw r24, r10 30080: b4 01 movw r22, r8 30082: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 30086: 6b 01 movw r12, r22 30088: 7c 01 movw r14, r24 3008a: 22 96 adiw r28, 0x02 ; 2 3008c: 6c ad ldd r22, Y+60 ; 0x3c 3008e: 7d ad ldd r23, Y+61 ; 0x3d 30090: 8e ad ldd r24, Y+62 ; 0x3e 30092: 9f ad ldd r25, Y+63 ; 0x3f 30094: 22 97 sbiw r28, 0x02 ; 2 30096: 0f 94 a5 9a call 0x3354a ; 0x3354a 3009a: 9b 01 movw r18, r22 3009c: ac 01 movw r20, r24 3009e: c7 01 movw r24, r14 300a0: b6 01 movw r22, r12 300a2: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 300a6: 0f 94 d2 a4 call 0x349a4 ; 0x349a4 300aa: 2e e6 ldi r18, 0x6E ; 110 300ac: 22 9d mul r18, r2 300ae: f0 01 movw r30, r0 300b0: 23 9d mul r18, r3 300b2: f0 0d add r31, r0 300b4: 11 24 eor r1, r1 300b6: e8 53 subi r30, 0x38 ; 56 300b8: f9 4f sbci r31, 0xF9 ; 249 300ba: 65 a7 std Z+45, r22 ; 0x2d 300bc: 76 a7 std Z+46, r23 ; 0x2e 300be: 87 a7 std Z+47, r24 ; 0x2f 300c0: 90 ab std Z+48, r25 ; 0x30 300c2: c2 c8 rjmp .-3708 ; 0x2f248 block->use_advance_lead = false; #endif } else { accel = ceil((block->steps[E_AXIS].wide ? cs.acceleration : cs.travel_acceleration) * steps_per_mm); // convert to: acceleration steps/sec^2 300c4: 2a 96 adiw r28, 0x0a ; 10 300c6: 2c ad ldd r18, Y+60 ; 0x3c 300c8: 3d ad ldd r19, Y+61 ; 0x3d 300ca: 4e ad ldd r20, Y+62 ; 0x3e 300cc: 5f ad ldd r21, Y+63 ; 0x3f 300ce: 2a 97 sbiw r28, 0x0a ; 10 300d0: 23 2b or r18, r19 300d2: 24 2b or r18, r20 300d4: 25 2b or r18, r21 300d6: 09 f4 brne .+2 ; 0x300da 300d8: 0e c1 rjmp .+540 ; 0x302f6 300da: 60 91 66 04 lds r22, 0x0466 ; 0x800466 300de: 70 91 67 04 lds r23, 0x0467 ; 0x800467 300e2: 80 91 68 04 lds r24, 0x0468 ; 0x800468 300e6: 90 91 69 04 lds r25, 0x0469 ; 0x800469 300ea: 29 a5 ldd r18, Y+41 ; 0x29 300ec: 3a a5 ldd r19, Y+42 ; 0x2a 300ee: 4b a5 ldd r20, Y+43 ; 0x2b 300f0: 5c a5 ldd r21, Y+44 ; 0x2c 300f2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 300f6: 0f 94 e2 a1 call 0x343c4 ; 0x343c4 300fa: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 300fe: 2b 01 movw r4, r22 30100: 3c 01 movw r6, r24 * * extruder_advance_K : There is an advance factor set. * delta_mm[E_AXIS] >= 0 : Extruding or traveling, but _not_ retracting. * |delta_mm[Z_AXIS]| < 0.5 : Z is only moved for leveling (_not_ for priming) */ block->use_advance_lead = extruder_advance_K > 0 30102: 80 91 e1 16 lds r24, 0x16E1 ; 0x8016e1 30106: 90 91 e2 16 lds r25, 0x16E2 ; 0x8016e2 3010a: a0 91 e3 16 lds r26, 0x16E3 ; 0x8016e3 3010e: b0 91 e4 16 lds r27, 0x16E4 ; 0x8016e4 30112: 8d a7 std Y+45, r24 ; 0x2d 30114: 9e a7 std Y+46, r25 ; 0x2e 30116: af a7 std Y+47, r26 ; 0x2f 30118: b8 ab std Y+48, r27 ; 0x30 && delta_mm[E_AXIS] >= 0 && fabs(delta_mm[Z_AXIS]) < 0.5; 3011a: 20 e0 ldi r18, 0x00 ; 0 3011c: 30 e0 ldi r19, 0x00 ; 0 3011e: a9 01 movw r20, r18 30120: bc 01 movw r22, r24 30122: cd 01 movw r24, r26 30124: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 30128: 18 16 cp r1, r24 3012a: 0c f0 brlt .+2 ; 0x3012e 3012c: ed c0 rjmp .+474 ; 0x30308 * extruder_advance_K : There is an advance factor set. * delta_mm[E_AXIS] >= 0 : Extruding or traveling, but _not_ retracting. * |delta_mm[Z_AXIS]| < 0.5 : Z is only moved for leveling (_not_ for priming) */ block->use_advance_lead = extruder_advance_K > 0 && delta_mm[E_AXIS] >= 0 3012e: 20 e0 ldi r18, 0x00 ; 0 30130: 30 e0 ldi r19, 0x00 ; 0 30132: a9 01 movw r20, r18 30134: 26 96 adiw r28, 0x06 ; 6 30136: 6c ad ldd r22, Y+60 ; 0x3c 30138: 7d ad ldd r23, Y+61 ; 0x3d 3013a: 8e ad ldd r24, Y+62 ; 0x3e 3013c: 9f ad ldd r25, Y+63 ; 0x3f 3013e: 26 97 sbiw r28, 0x06 ; 6 30140: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 30144: 87 fd sbrc r24, 7 30146: e0 c0 rjmp .+448 ; 0x30308 && fabs(delta_mm[Z_AXIS]) < 0.5; 30148: 22 96 adiw r28, 0x02 ; 2 3014a: 6c ad ldd r22, Y+60 ; 0x3c 3014c: 7d ad ldd r23, Y+61 ; 0x3d 3014e: 8e ad ldd r24, Y+62 ; 0x3e 30150: 9f ad ldd r25, Y+63 ; 0x3f 30152: 22 97 sbiw r28, 0x02 ; 2 30154: 9f 77 andi r25, 0x7F ; 127 30156: 20 e0 ldi r18, 0x00 ; 0 30158: 30 e0 ldi r19, 0x00 ; 0 3015a: 40 e0 ldi r20, 0x00 ; 0 3015c: 5f e3 ldi r21, 0x3F ; 63 3015e: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 30162: 87 ff sbrs r24, 7 30164: d1 c0 rjmp .+418 ; 0x30308 * * extruder_advance_K : There is an advance factor set. * delta_mm[E_AXIS] >= 0 : Extruding or traveling, but _not_ retracting. * |delta_mm[Z_AXIS]| < 0.5 : Z is only moved for leveling (_not_ for priming) */ block->use_advance_lead = extruder_advance_K > 0 30166: 8e e6 ldi r24, 0x6E ; 110 30168: 82 9d mul r24, r2 3016a: 80 01 movw r16, r0 3016c: 83 9d mul r24, r3 3016e: 10 0d add r17, r0 30170: 11 24 eor r1, r1 30172: 0c 5e subi r16, 0xEC ; 236 30174: 18 4f sbci r17, 0xF8 ; 248 30176: 81 e0 ldi r24, 0x01 ; 1 30178: d8 01 movw r26, r16 3017a: 8c 93 st X, r24 float delta_e = (e - position_float[E_AXIS]) / extruder_multiplier[extruder]; #else // M221/FLOW only adjusts for an incorrect source diameter float delta_e = (e - position_float[E_AXIS]); #endif float delta_D = sqrt(sq(x - position_float[X_AXIS]) 3017c: 20 91 04 04 lds r18, 0x0404 ; 0x800404 30180: 30 91 05 04 lds r19, 0x0405 ; 0x800405 30184: 40 91 06 04 lds r20, 0x0406 ; 0x800406 30188: 50 91 07 04 lds r21, 0x0407 ; 0x800407 3018c: 69 a1 ldd r22, Y+33 ; 0x21 3018e: 7a a1 ldd r23, Y+34 ; 0x22 30190: 8b a1 ldd r24, Y+35 ; 0x23 30192: 9c a1 ldd r25, Y+36 ; 0x24 30194: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 30198: 69 ab std Y+49, r22 ; 0x31 3019a: 7a ab std Y+50, r23 ; 0x32 3019c: 8b ab std Y+51, r24 ; 0x33 3019e: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 301a0: 20 91 08 04 lds r18, 0x0408 ; 0x800408 301a4: 30 91 09 04 lds r19, 0x0409 ; 0x800409 301a8: 40 91 0a 04 lds r20, 0x040A ; 0x80040a 301ac: 50 91 0b 04 lds r21, 0x040B ; 0x80040b 301b0: 6d a1 ldd r22, Y+37 ; 0x25 301b2: 7e a1 ldd r23, Y+38 ; 0x26 301b4: 8f a1 ldd r24, Y+39 ; 0x27 301b6: 98 a5 ldd r25, Y+40 ; 0x28 301b8: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 301bc: 4b 01 movw r8, r22 301be: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 301c0: 20 91 0c 04 lds r18, 0x040C ; 0x80040c 301c4: 30 91 0d 04 lds r19, 0x040D ; 0x80040d 301c8: 40 91 0e 04 lds r20, 0x040E ; 0x80040e 301cc: 50 91 0f 04 lds r21, 0x040F ; 0x80040f 301d0: a7 96 adiw r28, 0x27 ; 39 301d2: 6c ad ldd r22, Y+60 ; 0x3c 301d4: 7d ad ldd r23, Y+61 ; 0x3d 301d6: 8e ad ldd r24, Y+62 ; 0x3e 301d8: 9f ad ldd r25, Y+63 ; 0x3f 301da: a7 97 sbiw r28, 0x27 ; 39 301dc: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 301e0: 6b 01 movw r12, r22 301e2: 7c 01 movw r14, r24 float delta_e = (e - position_float[E_AXIS]) / extruder_multiplier[extruder]; #else // M221/FLOW only adjusts for an incorrect source diameter float delta_e = (e - position_float[E_AXIS]); #endif float delta_D = sqrt(sq(x - position_float[X_AXIS]) 301e4: 29 a9 ldd r18, Y+49 ; 0x31 301e6: 3a a9 ldd r19, Y+50 ; 0x32 301e8: 4b a9 ldd r20, Y+51 ; 0x33 301ea: 5c a9 ldd r21, Y+52 ; 0x34 301ec: ca 01 movw r24, r20 301ee: b9 01 movw r22, r18 301f0: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 301f4: 69 ab std Y+49, r22 ; 0x31 301f6: 7a ab std Y+50, r23 ; 0x32 301f8: 8b ab std Y+51, r24 ; 0x33 301fa: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 301fc: a5 01 movw r20, r10 301fe: 94 01 movw r18, r8 30200: c5 01 movw r24, r10 30202: b4 01 movw r22, r8 30204: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 30208: 9b 01 movw r18, r22 3020a: ac 01 movw r20, r24 3020c: 69 a9 ldd r22, Y+49 ; 0x31 3020e: 7a a9 ldd r23, Y+50 ; 0x32 30210: 8b a9 ldd r24, Y+51 ; 0x33 30212: 9c a9 ldd r25, Y+52 ; 0x34 30214: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 30218: 4b 01 movw r8, r22 3021a: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 3021c: a7 01 movw r20, r14 3021e: 96 01 movw r18, r12 30220: c7 01 movw r24, r14 30222: b6 01 movw r22, r12 30224: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 30228: 9b 01 movw r18, r22 3022a: ac 01 movw r20, r24 3022c: c5 01 movw r24, r10 3022e: b4 01 movw r22, r8 30230: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> float delta_e = (e - position_float[E_AXIS]) / extruder_multiplier[extruder]; #else // M221/FLOW only adjusts for an incorrect source diameter float delta_e = (e - position_float[E_AXIS]); #endif float delta_D = sqrt(sq(x - position_float[X_AXIS]) 30234: 0f 94 d2 a4 call 0x349a4 ; 0x349a4 30238: 6b 01 movw r12, r22 3023a: 7c 01 movw r14, r24 #ifdef LA_FLOWADJ // M221/FLOW should change uniformly the extrusion thickness float delta_e = (e - position_float[E_AXIS]) / extruder_multiplier[extruder]; #else // M221/FLOW only adjusts for an incorrect source diameter float delta_e = (e - position_float[E_AXIS]); 3023c: 20 91 10 04 lds r18, 0x0410 ; 0x800410 30240: 30 91 11 04 lds r19, 0x0411 ; 0x800411 30244: 40 91 12 04 lds r20, 0x0412 ; 0x800412 30248: 50 91 13 04 lds r21, 0x0413 ; 0x800413 3024c: a9 96 adiw r28, 0x29 ; 41 3024e: ee ad ldd r30, Y+62 ; 0x3e 30250: ff ad ldd r31, Y+63 ; 0x3f 30252: a9 97 sbiw r28, 0x29 ; 41 30254: 60 81 ld r22, Z 30256: 71 81 ldd r23, Z+1 ; 0x01 30258: 82 81 ldd r24, Z+2 ; 0x02 3025a: 93 81 ldd r25, Z+3 ; 0x03 3025c: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> + sq(y - position_float[Y_AXIS]) + sq(z - position_float[Z_AXIS])); // all extrusion moves with LA require a compression which is proportional to the // extrusion_length to distance ratio (e/D) e_D_ratio = delta_e / delta_D; 30260: a7 01 movw r20, r14 30262: 96 01 movw r18, r12 30264: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 30268: 6a 96 adiw r28, 0x1a ; 26 3026a: 6c af std Y+60, r22 ; 0x3c 3026c: 7d af std Y+61, r23 ; 0x3d 3026e: 8e af std Y+62, r24 ; 0x3e 30270: 9f af std Y+63, r25 ; 0x3f 30272: 6a 97 sbiw r28, 0x1a ; 26 // Check for unusual high e_D ratio to detect if a retract move was combined with the last // print move due to min. steps per segment. Never execute this with advance! This assumes // no one will use a retract length of 0mm < retr_length < ~0.2mm and no one will print // 100mm wide lines using 3mm filament or 35mm wide lines using 1.75mm filament. if (e_D_ratio > 3.0) 30274: 20 e0 ldi r18, 0x00 ; 0 30276: 30 e0 ldi r19, 0x00 ; 0 30278: 40 e4 ldi r20, 0x40 ; 64 3027a: 50 e4 ldi r21, 0x40 ; 64 3027c: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 30280: 18 16 cp r1, r24 30282: 0c f4 brge .+2 ; 0x30286 30284: 9e c0 rjmp .+316 ; 0x303c2 block->use_advance_lead = false; else if (e_D_ratio > 0) { 30286: 20 e0 ldi r18, 0x00 ; 0 30288: 30 e0 ldi r19, 0x00 ; 0 3028a: a9 01 movw r20, r18 3028c: 6a 96 adiw r28, 0x1a ; 26 3028e: 6c ad ldd r22, Y+60 ; 0x3c 30290: 7d ad ldd r23, Y+61 ; 0x3d 30292: 8e ad ldd r24, Y+62 ; 0x3e 30294: 9f ad ldd r25, Y+63 ; 0x3f 30296: 6a 97 sbiw r28, 0x1a ; 26 30298: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 3029c: 18 16 cp r1, r24 3029e: 0c f0 brlt .+2 ; 0x302a2 302a0: 42 c0 rjmp .+132 ; 0x30326 const uint32_t max_accel_steps_per_s2 = ceil(cs.max_jerk[E_AXIS] / (extruder_advance_K * e_D_ratio) * steps_per_mm); 302a2: 6a 96 adiw r28, 0x1a ; 26 302a4: 2c ad ldd r18, Y+60 ; 0x3c 302a6: 3d ad ldd r19, Y+61 ; 0x3d 302a8: 4e ad ldd r20, Y+62 ; 0x3e 302aa: 5f ad ldd r21, Y+63 ; 0x3f 302ac: 6a 97 sbiw r28, 0x1a ; 26 302ae: 6d a5 ldd r22, Y+45 ; 0x2d 302b0: 7e a5 ldd r23, Y+46 ; 0x2e 302b2: 8f a5 ldd r24, Y+47 ; 0x2f 302b4: 98 a9 ldd r25, Y+48 ; 0x30 302b6: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 302ba: 9b 01 movw r18, r22 302bc: ac 01 movw r20, r24 302be: 60 91 86 04 lds r22, 0x0486 ; 0x800486 302c2: 70 91 87 04 lds r23, 0x0487 ; 0x800487 302c6: 80 91 88 04 lds r24, 0x0488 ; 0x800488 302ca: 90 91 89 04 lds r25, 0x0489 ; 0x800489 302ce: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 302d2: 29 a5 ldd r18, Y+41 ; 0x29 302d4: 3a a5 ldd r19, Y+42 ; 0x2a 302d6: 4b a5 ldd r20, Y+43 ; 0x2b 302d8: 5c a5 ldd r21, Y+44 ; 0x2c 302da: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 302de: 0f 94 e2 a1 call 0x343c4 ; 0x343c4 302e2: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 302e6: 64 15 cp r22, r4 302e8: 75 05 cpc r23, r5 302ea: 86 05 cpc r24, r6 302ec: 97 05 cpc r25, r7 302ee: d8 f4 brcc .+54 ; 0x30326 302f0: 2b 01 movw r4, r22 302f2: 3c 01 movw r6, r24 302f4: 18 c0 rjmp .+48 ; 0x30326 block->use_advance_lead = false; #endif } else { accel = ceil((block->steps[E_AXIS].wide ? cs.acceleration : cs.travel_acceleration) * steps_per_mm); // convert to: acceleration steps/sec^2 302f6: 60 91 f2 04 lds r22, 0x04F2 ; 0x8004f2 302fa: 70 91 f3 04 lds r23, 0x04F3 ; 0x8004f3 302fe: 80 91 f4 04 lds r24, 0x04F4 ; 0x8004f4 30302: 90 91 f5 04 lds r25, 0x04F5 ; 0x8004f5 30306: f1 ce rjmp .-542 ; 0x300ea * * extruder_advance_K : There is an advance factor set. * delta_mm[E_AXIS] >= 0 : Extruding or traveling, but _not_ retracting. * |delta_mm[Z_AXIS]| < 0.5 : Z is only moved for leveling (_not_ for priming) */ block->use_advance_lead = extruder_advance_K > 0 30308: 8e e6 ldi r24, 0x6E ; 110 3030a: 82 9d mul r24, r2 3030c: f0 01 movw r30, r0 3030e: 83 9d mul r24, r3 30310: f0 0d add r31, r0 30312: 11 24 eor r1, r1 30314: ec 5e subi r30, 0xEC ; 236 30316: f8 4f sbci r31, 0xF8 ; 248 30318: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 3031a: 6a 96 adiw r28, 0x1a ; 26 3031c: 1c ae std Y+60, r1 ; 0x3c 3031e: 1d ae std Y+61, r1 ; 0x3d 30320: 1e ae std Y+62, r1 ; 0x3e 30322: 1f ae std Y+63, r1 ; 0x3f 30324: 6a 97 sbiw r28, 0x1a ; 26 30326: 10 e0 ldi r17, 0x00 ; 0 30328: 00 e0 ldi r16, 0x00 ; 0 #endif // Limit acceleration per axis for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { if(block->steps[axis].wide && max_acceleration_steps_per_s2[axis] < accel) 3032a: a3 96 adiw r28, 0x23 ; 35 3032c: ee ad ldd r30, Y+62 ; 0x3e 3032e: ff ad ldd r31, Y+63 ; 0x3f 30330: a3 97 sbiw r28, 0x23 ; 35 30332: e0 0f add r30, r16 30334: f1 1f adc r31, r17 30336: e8 53 subi r30, 0x38 ; 56 30338: f9 4f sbci r31, 0xF9 ; 249 3033a: c0 80 ld r12, Z 3033c: d1 80 ldd r13, Z+1 ; 0x01 3033e: e2 80 ldd r14, Z+2 ; 0x02 30340: f3 80 ldd r15, Z+3 ; 0x03 30342: c1 14 cp r12, r1 30344: d1 04 cpc r13, r1 30346: e1 04 cpc r14, r1 30348: f1 04 cpc r15, r1 3034a: a1 f1 breq .+104 ; 0x303b4 3034c: f8 01 movw r30, r16 3034e: eb 51 subi r30, 0x1B ; 27 30350: f9 4e sbci r31, 0xE9 ; 233 30352: 60 81 ld r22, Z 30354: 71 81 ldd r23, Z+1 ; 0x01 30356: 82 81 ldd r24, Z+2 ; 0x02 30358: 93 81 ldd r25, Z+3 ; 0x03 3035a: 64 15 cp r22, r4 3035c: 75 05 cpc r23, r5 3035e: 86 05 cpc r24, r6 30360: 97 05 cpc r25, r7 30362: 40 f5 brcc .+80 ; 0x303b4 { const float max_possible = float(max_acceleration_steps_per_s2[axis]) * float(block->step_event_count.wide) / float(block->steps[axis].wide); 30364: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 30368: 29 ad ldd r18, Y+57 ; 0x39 3036a: 3a ad ldd r19, Y+58 ; 0x3a 3036c: 4b ad ldd r20, Y+59 ; 0x3b 3036e: 5c ad ldd r21, Y+60 ; 0x3c 30370: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 30374: 4b 01 movw r8, r22 30376: 5c 01 movw r10, r24 30378: c7 01 movw r24, r14 3037a: b6 01 movw r22, r12 3037c: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 30380: 9b 01 movw r18, r22 30382: ac 01 movw r20, r24 30384: c5 01 movw r24, r10 30386: b4 01 movw r22, r8 30388: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 3038c: 6b 01 movw r12, r22 3038e: 7c 01 movw r14, r24 if (max_possible < accel) accel = max_possible; 30390: c3 01 movw r24, r6 30392: b2 01 movw r22, r4 30394: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 30398: 9b 01 movw r18, r22 3039a: ac 01 movw r20, r24 3039c: c7 01 movw r24, r14 3039e: b6 01 movw r22, r12 303a0: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 303a4: 87 ff sbrs r24, 7 303a6: 06 c0 rjmp .+12 ; 0x303b4 303a8: c7 01 movw r24, r14 303aa: b6 01 movw r22, r12 303ac: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 303b0: 2b 01 movw r4, r22 303b2: 3c 01 movw r6, r24 303b4: 0c 5f subi r16, 0xFC ; 252 303b6: 1f 4f sbci r17, 0xFF ; 255 } } #endif // Limit acceleration per axis for (uint8_t axis = 0; axis < NUM_AXIS; axis++) 303b8: 00 31 cpi r16, 0x10 ; 16 303ba: 11 05 cpc r17, r1 303bc: 09 f0 breq .+2 ; 0x303c0 303be: b5 cf rjmp .-150 ; 0x3032a 303c0: 01 c9 rjmp .-3582 ; 0x2f5c4 // Check for unusual high e_D ratio to detect if a retract move was combined with the last // print move due to min. steps per segment. Never execute this with advance! This assumes // no one will use a retract length of 0mm < retr_length < ~0.2mm and no one will print // 100mm wide lines using 3mm filament or 35mm wide lines using 1.75mm filament. if (e_D_ratio > 3.0) block->use_advance_lead = false; 303c2: d8 01 movw r26, r16 303c4: 1c 92 st X, r1 303c6: af cf rjmp .-162 ; 0x30326 if (jerk > mjerk) { safe_speed *= mjerk / jerk; limited = true; } } else { safe_speed = cs.max_jerk[axis]; 303c8: c9 a6 std Y+41, r12 ; 0x29 303ca: dd a6 std Y+45, r13 ; 0x2d 303cc: e9 ae std Y+57, r14 ; 0x39 303ce: f9 aa std Y+49, r15 ; 0x31 limited = true; 303d0: 21 e0 ldi r18, 0x01 ; 1 303d2: 2d ab std Y+53, r18 ; 0x35 303d4: b1 c9 rjmp .-3230 ; 0x2f738 // If this maximum velocity allowed is lower than the minimum of the entry / exit safe velocities, // then the machine is not coasting anymore and the safe entry / exit velocities shall be used. // The junction velocity will be shared between successive segments. Limit the junction velocity to their minimum. bool prev_speed_larger = previous_nominal_speed > block->nominal_speed; float smaller_speed_factor = prev_speed_larger ? (block->nominal_speed / previous_nominal_speed) : (previous_nominal_speed / block->nominal_speed); 303d6: 27 96 adiw r28, 0x07 ; 7 303d8: 2f ad ldd r18, Y+63 ; 0x3f 303da: 27 97 sbiw r28, 0x07 ; 7 303dc: 2b 96 adiw r28, 0x0b ; 11 303de: 3f ad ldd r19, Y+63 ; 0x3f 303e0: 2b 97 sbiw r28, 0x0b ; 11 303e2: 2f 96 adiw r28, 0x0f ; 15 303e4: 4f ad ldd r20, Y+63 ; 0x3f 303e6: 2f 97 sbiw r28, 0x0f ; 15 303e8: 63 96 adiw r28, 0x13 ; 19 303ea: 5f ad ldd r21, Y+63 ; 0x3f 303ec: 63 97 sbiw r28, 0x13 ; 19 303ee: 6b 96 adiw r28, 0x1b ; 27 303f0: 6f ad ldd r22, Y+63 ; 0x3f 303f2: 6b 97 sbiw r28, 0x1b ; 27 303f4: 6f 96 adiw r28, 0x1f ; 31 303f6: 7f ad ldd r23, Y+63 ; 0x3f 303f8: 6f 97 sbiw r28, 0x1f ; 31 303fa: c8 01 movw r24, r16 303fc: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 30400: eb 96 adiw r28, 0x3b ; 59 30402: 6c af std Y+60, r22 ; 0x3c 30404: 7d af std Y+61, r23 ; 0x3d 30406: 8e af std Y+62, r24 ; 0x3e 30408: 9f af std Y+63, r25 ; 0x3f 3040a: eb 97 sbiw r28, 0x3b ; 59 // Pick the smaller of the nominal speeds. Higher speed shall not be achieved at the junction during coasting. vmax_junction = prev_speed_larger ? block->nominal_speed : previous_nominal_speed; 3040c: 6b 96 adiw r28, 0x1b ; 27 3040e: ef ad ldd r30, Y+63 ; 0x3f 30410: 6b 97 sbiw r28, 0x1b ; 27 30412: ed af std Y+61, r30 ; 0x3d 30414: 6f 96 adiw r28, 0x1f ; 31 30416: ff ad ldd r31, Y+63 ; 0x3f 30418: 6f 97 sbiw r28, 0x1f ; 31 3041a: fd ab std Y+53, r31 ; 0x35 3041c: 0e af std Y+62, r16 ; 0x3e 3041e: 23 96 adiw r28, 0x03 ; 3 30420: 1f af std Y+63, r17 ; 0x3f 30422: 23 97 sbiw r28, 0x03 ; 3 30424: 04 ca rjmp .-3064 ; 0x2f82e (v_exit > v_entry) ? ((v_entry > 0.f || v_exit < 0.f) ? // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : 30426: f7 fa bst r15, 7 30428: f0 94 com r15 3042a: f7 f8 bld r15, 7 3042c: f0 94 com r15 3042e: a5 01 movw r20, r10 30430: 94 01 movw r18, r8 30432: c7 01 movw r24, r14 30434: b6 01 movw r22, r12 30436: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 3043a: 87 ff sbrs r24, 7 3043c: 77 ca rjmp .-2834 ; 0x2f92c // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 3043e: 75 01 movw r14, r10 30440: 64 01 movw r12, r8 30442: 74 ca rjmp .-2840 ; 0x2f92c // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? 30444: c7 01 movw r24, r14 30446: b6 01 movw r22, r12 30448: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 3044c: 87 fd sbrc r24, 7 3044e: 09 c0 rjmp .+18 ; 0x30462 30450: 20 e0 ldi r18, 0x00 ; 0 30452: 30 e0 ldi r19, 0x00 ; 0 30454: a9 01 movw r20, r18 30456: c5 01 movw r24, r10 30458: b4 01 movw r22, r8 3045a: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 3045e: 18 16 cp r1, r24 30460: 2c f4 brge .+10 ; 0x3046c 30462: a5 01 movw r20, r10 30464: 94 01 movw r18, r8 30466: c7 01 movw r24, r14 30468: b6 01 movw r22, r12 3046a: 5c ca rjmp .-2888 ; 0x2f924 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 3046c: b7 fa bst r11, 7 3046e: b0 94 com r11 30470: b7 f8 bld r11, 7 30472: b0 94 com r11 30474: a7 01 movw r20, r14 30476: 96 01 movw r18, r12 30478: c5 01 movw r24, r10 3047a: b4 01 movw r22, r8 3047c: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 30480: 18 16 cp r1, r24 30482: 0c f0 brlt .+2 ; 0x30486 30484: 53 ca rjmp .-2906 ; 0x2f92c 30486: db cf rjmp .-74 ; 0x3043e // better to start the segment from start. block->flag |= BLOCK_FLAG_START_FROM_FULL_HALT; vmax_junction = safe_speed; } } else { block->flag |= BLOCK_FLAG_START_FROM_FULL_HALT; 30488: 8e e6 ldi r24, 0x6E ; 110 3048a: 82 9d mul r24, r2 3048c: f0 01 movw r30, r0 3048e: 83 9d mul r24, r3 30490: f0 0d add r31, r0 30492: 11 24 eor r1, r1 30494: e8 53 subi r30, 0x38 ; 56 30496: f9 4f sbci r31, 0xF9 ; 249 30498: 85 a9 ldd r24, Z+53 ; 0x35 3049a: 84 60 ori r24, 0x04 ; 4 3049c: 85 ab std Z+53, r24 ; 0x35 3049e: a9 a5 ldd r26, Y+41 ; 0x29 304a0: ad af std Y+61, r26 ; 0x3d 304a2: bd a5 ldd r27, Y+45 ; 0x2d 304a4: bd ab std Y+53, r27 ; 0x35 304a6: e9 ad ldd r30, Y+57 ; 0x39 304a8: ee af std Y+62, r30 ; 0x3e 304aa: f9 a9 ldd r31, Y+49 ; 0x31 304ac: 23 96 adiw r28, 0x03 ; 3 304ae: ff af std Y+63, r31 ; 0x3f 304b0: 23 97 sbiw r28, 0x03 ; 3 304b2: bc ca rjmp .-2696 ; 0x2fa2c // junction speeds in deceleration and acceleration, respectively. This is due to how the current // block nominal speed limits both the current and next maximum junction speeds. Hence, in both // the reverse and forward planners, the corresponding block junction speed will always be at the // the maximum junction speed and may always be ignored for any speed reduction checks. // Always calculate trapezoid for new block block->flag |= (block->nominal_speed <= v_allowable) ? (BLOCK_FLAG_NOMINAL_LENGTH | BLOCK_FLAG_RECALCULATE) : BLOCK_FLAG_RECALCULATE; 304b4: 81 e0 ldi r24, 0x01 ; 1 304b6: 30 cb rjmp .-2464 ; 0x2fb18 float advance_speed; if (e_D_ratio > 0) advance_speed = (extruder_advance_K * e_D_ratio * block->acceleration * cs.axis_steps_per_mm[E_AXIS]); else advance_speed = cs.max_jerk[E_AXIS] * cs.axis_steps_per_mm[E_AXIS]; 304b8: 20 91 86 04 lds r18, 0x0486 ; 0x800486 304bc: 30 91 87 04 lds r19, 0x0487 ; 0x800487 304c0: 40 91 88 04 lds r20, 0x0488 ; 0x800488 304c4: 50 91 89 04 lds r21, 0x0489 ; 0x800489 304c8: c7 01 movw r24, r14 304ca: b6 01 movw r22, r12 304cc: c1 cb rjmp .-2174 ; 0x2fc50 float advance_rate = (F_CPU / 8.0) / advance_speed; if (advance_speed > 20000) { block->advance_rate = advance_rate * 4; block->advance_step_loops = 4; } else if (advance_speed > 10000) { 304ce: 20 e0 ldi r18, 0x00 ; 0 304d0: 30 e4 ldi r19, 0x40 ; 64 304d2: 4c e1 ldi r20, 0x1C ; 28 304d4: 56 e4 ldi r21, 0x46 ; 70 304d6: c7 01 movw r24, r14 304d8: b6 01 movw r22, r12 304da: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 304de: 18 16 cp r1, r24 304e0: d4 f4 brge .+52 ; 0x30516 block->advance_rate = advance_rate * 2; 304e2: 8e e6 ldi r24, 0x6E ; 110 304e4: 82 9d mul r24, r2 304e6: 80 01 movw r16, r0 304e8: 83 9d mul r24, r3 304ea: 10 0d add r17, r0 304ec: 11 24 eor r1, r1 304ee: 08 53 subi r16, 0x38 ; 56 304f0: 19 4f sbci r17, 0xF9 ; 249 304f2: 78 01 movw r14, r16 304f4: bd e4 ldi r27, 0x4D ; 77 304f6: eb 0e add r14, r27 304f8: f1 1c adc r15, r1 304fa: a5 01 movw r20, r10 304fc: 94 01 movw r18, r8 304fe: c5 01 movw r24, r10 30500: b4 01 movw r22, r8 30502: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 30506: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 3050a: f7 01 movw r30, r14 3050c: 71 83 std Z+1, r23 ; 0x01 3050e: 60 83 st Z, r22 block->advance_step_loops = 2; 30510: 36 96 adiw r30, 0x06 ; 6 30512: 82 e0 ldi r24, 0x02 ; 2 30514: e2 cb rjmp .-2108 ; 0x2fcda } else { // never overflow the internal accumulator with very low rates if (advance_rate < UINT16_MAX) 30516: 20 e0 ldi r18, 0x00 ; 0 30518: 3f ef ldi r19, 0xFF ; 255 3051a: 4f e7 ldi r20, 0x7F ; 127 3051c: 57 e4 ldi r21, 0x47 ; 71 3051e: c5 01 movw r24, r10 30520: b4 01 movw r22, r8 30522: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 30526: 87 ff sbrs r24, 7 30528: 19 c0 rjmp .+50 ; 0x3055c block->advance_rate = advance_rate; 3052a: 8e e6 ldi r24, 0x6E ; 110 3052c: 82 9d mul r24, r2 3052e: 80 01 movw r16, r0 30530: 83 9d mul r24, r3 30532: 10 0d add r17, r0 30534: 11 24 eor r1, r1 30536: 0b 5e subi r16, 0xEB ; 235 30538: 18 4f sbci r17, 0xF8 ; 248 3053a: c5 01 movw r24, r10 3053c: b4 01 movw r22, r8 3053e: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 30542: d8 01 movw r26, r16 30544: 6d 93 st X+, r22 30546: 7c 93 st X, r23 else block->advance_rate = UINT16_MAX; block->advance_step_loops = 1; 30548: 8e e6 ldi r24, 0x6E ; 110 3054a: 82 9d mul r24, r2 3054c: f0 01 movw r30, r0 3054e: 83 9d mul r24, r3 30550: f0 0d add r31, r0 30552: 11 24 eor r1, r1 30554: e5 5e subi r30, 0xE5 ; 229 30556: f8 4f sbci r31, 0xF8 ; 248 30558: 81 e0 ldi r24, 0x01 ; 1 3055a: bf cb rjmp .-2178 ; 0x2fcda { // never overflow the internal accumulator with very low rates if (advance_rate < UINT16_MAX) block->advance_rate = advance_rate; else block->advance_rate = UINT16_MAX; 3055c: 8e e6 ldi r24, 0x6E ; 110 3055e: 82 9d mul r24, r2 30560: f0 01 movw r30, r0 30562: 83 9d mul r24, r3 30564: f0 0d add r31, r0 30566: 11 24 eor r1, r1 30568: eb 5e subi r30, 0xEB ; 235 3056a: f8 4f sbci r31, 0xF8 ; 248 3056c: 8f ef ldi r24, 0xFF ; 255 3056e: 9f ef ldi r25, 0xFF ; 255 30570: 91 83 std Z+1, r25 ; 0x01 30572: 80 83 st Z, r24 30574: e9 cf rjmp .-46 ; 0x30548 break; } // If entry speed is already at the maximum entry speed, no need to recheck. Block is cruising. // If not, block in state of acceleration or deceleration. Reset entry speed to maximum and // check for maximum allowable speed reductions to ensure maximum possible planned speed. if (current->entry_speed != current->max_entry_speed) { 30576: f6 01 movw r30, r12 30578: 71 a4 ldd r7, Z+41 ; 0x29 3057a: 82 a4 ldd r8, Z+42 ; 0x2a 3057c: 93 a4 ldd r9, Z+43 ; 0x2b 3057e: e4 a4 ldd r14, Z+44 ; 0x2c 30580: 27 2d mov r18, r7 30582: 38 2d mov r19, r8 30584: 49 2d mov r20, r9 30586: 5e 2d mov r21, r14 30588: 65 a1 ldd r22, Z+37 ; 0x25 3058a: 76 a1 ldd r23, Z+38 ; 0x26 3058c: 87 a1 ldd r24, Z+39 ; 0x27 3058e: 90 a5 ldd r25, Z+40 ; 0x28 30590: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 30594: 88 23 and r24, r24 30596: 09 f4 brne .+2 ; 0x3059a 30598: 51 c0 rjmp .+162 ; 0x3063c // If nominal length true, max junction speed is guaranteed to be reached even if decelerating to a jerk-from-zero velocity. // Only compute for max allowable speed if block is decelerating and nominal length is false. // entry_speed is uint16_t, 24 bits would be sufficient for block->acceleration and block->millimiteres, if scaled to um. // therefore an optimized assembly 24bit x 24bit -> 32bit multiply would be more than sufficient // together with an assembly 32bit->16bit sqrt function. current->entry_speed = ((current->flag & BLOCK_FLAG_NOMINAL_LENGTH) || current->max_entry_speed <= next->entry_speed) ? 3059a: 01 fd sbrc r16, 1 3059c: 44 c0 rjmp .+136 ; 0x30626 3059e: d5 01 movw r26, r10 305a0: 95 96 adiw r26, 0x25 ; 37 305a2: 2d 90 ld r2, X+ 305a4: 3d 90 ld r3, X+ 305a6: 4d 90 ld r4, X+ 305a8: 5c 90 ld r5, X 305aa: 98 97 sbiw r26, 0x28 ; 40 305ac: a2 01 movw r20, r4 305ae: 91 01 movw r18, r2 305b0: 67 2d mov r22, r7 305b2: 78 2d mov r23, r8 305b4: 89 2d mov r24, r9 305b6: 9e 2d mov r25, r14 305b8: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 305bc: 18 16 cp r1, r24 305be: 9c f5 brge .+102 ; 0x30626 // Calculates the maximum allowable entry speed, when you must be able to reach target_velocity using the // decceleration within the allotted distance. FORCE_INLINE float max_allowable_entry_speed(float decceleration, float target_velocity, float distance) { // assert(decceleration < 0); return sqrt(target_velocity*target_velocity-2*decceleration*distance); 305c0: a2 01 movw r20, r4 305c2: 91 01 movw r18, r2 305c4: c2 01 movw r24, r4 305c6: b1 01 movw r22, r2 305c8: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 305cc: 1b 01 movw r2, r22 305ce: 2c 01 movw r4, r24 // therefore an optimized assembly 24bit x 24bit -> 32bit multiply would be more than sufficient // together with an assembly 32bit->16bit sqrt function. current->entry_speed = ((current->flag & BLOCK_FLAG_NOMINAL_LENGTH) || current->max_entry_speed <= next->entry_speed) ? current->max_entry_speed : // min(current->max_entry_speed, sqrt(next->entry_speed*next->entry_speed+2*current->acceleration*current->millimeters)); min(current->max_entry_speed, max_allowable_entry_speed(-current->acceleration,next->entry_speed,current->millimeters)); 305d0: f6 01 movw r30, r12 305d2: 61 a9 ldd r22, Z+49 ; 0x31 305d4: 72 a9 ldd r23, Z+50 ; 0x32 305d6: 83 a9 ldd r24, Z+51 ; 0x33 305d8: 94 a9 ldd r25, Z+52 ; 0x34 305da: 90 58 subi r25, 0x80 ; 128 // Calculates the maximum allowable entry speed, when you must be able to reach target_velocity using the // decceleration within the allotted distance. FORCE_INLINE float max_allowable_entry_speed(float decceleration, float target_velocity, float distance) { // assert(decceleration < 0); return sqrt(target_velocity*target_velocity-2*decceleration*distance); 305dc: 9b 01 movw r18, r22 305de: ac 01 movw r20, r24 305e0: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 305e4: d6 01 movw r26, r12 305e6: 9d 96 adiw r26, 0x2d ; 45 305e8: 2d 91 ld r18, X+ 305ea: 3d 91 ld r19, X+ 305ec: 4d 91 ld r20, X+ 305ee: 5c 91 ld r21, X 305f0: d0 97 sbiw r26, 0x30 ; 48 305f2: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 305f6: 9b 01 movw r18, r22 305f8: ac 01 movw r20, r24 305fa: c2 01 movw r24, r4 305fc: b1 01 movw r22, r2 305fe: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 30602: 0f 94 d2 a4 call 0x349a4 ; 0x349a4 30606: 2b 01 movw r4, r22 30608: 5c 01 movw r10, r24 // therefore an optimized assembly 24bit x 24bit -> 32bit multiply would be more than sufficient // together with an assembly 32bit->16bit sqrt function. current->entry_speed = ((current->flag & BLOCK_FLAG_NOMINAL_LENGTH) || current->max_entry_speed <= next->entry_speed) ? current->max_entry_speed : // min(current->max_entry_speed, sqrt(next->entry_speed*next->entry_speed+2*current->acceleration*current->millimeters)); min(current->max_entry_speed, max_allowable_entry_speed(-current->acceleration,next->entry_speed,current->millimeters)); 3060a: 9b 01 movw r18, r22 3060c: ac 01 movw r20, r24 3060e: 67 2d mov r22, r7 30610: 78 2d mov r23, r8 30612: 89 2d mov r24, r9 30614: 9e 2d mov r25, r14 30616: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 3061a: 87 fd sbrc r24, 7 3061c: 04 c0 rjmp .+8 ; 0x30626 3061e: 74 2c mov r7, r4 30620: 85 2c mov r8, r5 30622: 9a 2c mov r9, r10 30624: eb 2c mov r14, r11 // If nominal length true, max junction speed is guaranteed to be reached even if decelerating to a jerk-from-zero velocity. // Only compute for max allowable speed if block is decelerating and nominal length is false. // entry_speed is uint16_t, 24 bits would be sufficient for block->acceleration and block->millimiteres, if scaled to um. // therefore an optimized assembly 24bit x 24bit -> 32bit multiply would be more than sufficient // together with an assembly 32bit->16bit sqrt function. current->entry_speed = ((current->flag & BLOCK_FLAG_NOMINAL_LENGTH) || current->max_entry_speed <= next->entry_speed) ? 30626: 87 2d mov r24, r7 30628: 98 2d mov r25, r8 3062a: a9 2d mov r26, r9 3062c: be 2d mov r27, r14 3062e: f6 01 movw r30, r12 30630: 85 a3 std Z+37, r24 ; 0x25 30632: 96 a3 std Z+38, r25 ; 0x26 30634: a7 a3 std Z+39, r26 ; 0x27 30636: b0 a7 std Z+40, r27 ; 0x28 current->max_entry_speed : // min(current->max_entry_speed, sqrt(next->entry_speed*next->entry_speed+2*current->acceleration*current->millimeters)); min(current->max_entry_speed, max_allowable_entry_speed(-current->acceleration,next->entry_speed,current->millimeters)); current->flag |= BLOCK_FLAG_RECALCULATE; 30638: 01 60 ori r16, 0x01 ; 1 3063a: 05 ab std Z+53, r16 ; 0x35 } // Returns the index of the previous block in the ring buffer static inline uint8_t prev_block_index(uint8_t block_index) { if (block_index == 0) 3063c: 11 11 cpse r17, r1 3063e: 01 c0 rjmp .+2 ; 0x30642 block_index = BLOCK_BUFFER_SIZE; 30640: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 30642: 11 50 subi r17, 0x01 ; 1 // min(current->max_entry_speed, sqrt(next->entry_speed*next->entry_speed+2*current->acceleration*current->millimeters)); min(current->max_entry_speed, max_allowable_entry_speed(-current->acceleration,next->entry_speed,current->millimeters)); current->flag |= BLOCK_FLAG_RECALCULATE; } next = current; current = block_buffer + (block_index = prev_block_index(block_index)); 30644: 16 9d mul r17, r6 30646: c0 01 movw r24, r0 30648: 11 24 eor r1, r1 current->max_entry_speed : // min(current->max_entry_speed, sqrt(next->entry_speed*next->entry_speed+2*current->acceleration*current->millimeters)); min(current->max_entry_speed, max_allowable_entry_speed(-current->acceleration,next->entry_speed,current->millimeters)); current->flag |= BLOCK_FLAG_RECALCULATE; } next = current; 3064a: 56 01 movw r10, r12 current = block_buffer + (block_index = prev_block_index(block_index)); 3064c: 9c 01 movw r18, r24 3064e: 28 53 subi r18, 0x38 ; 56 30650: 39 4f sbci r19, 0xF9 ; 249 30652: 69 01 movw r12, r18 30654: 0b cc rjmp .-2026 ; 0x2fe6c calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; } prev = current; current = block_buffer + (block_index = next_block_index(block_index)); 30656: 6c 01 movw r12, r24 30658: 2f cc rjmp .-1954 ; 0x2feb8 3065a: 8f bf out 0x3f, r24 ; 63 __asm__ volatile ("" ::: "memory"); 3065c: 0d 94 89 75 jmp 0x2eb12 ; 0x2eb12 00030660 : void plan_buffer_line_destinationXYZE(float feed_rate) { plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_rate); } void plan_set_position_curposXYZE(){ 30660: 4f 92 push r4 30662: 5f 92 push r5 30664: 6f 92 push r6 30666: 7f 92 push r7 30668: 8f 92 push r8 3066a: 9f 92 push r9 3066c: af 92 push r10 3066e: bf 92 push r11 30670: cf 92 push r12 30672: df 92 push r13 30674: ef 92 push r14 30676: ff 92 push r15 30678: cf 93 push r28 3067a: df 93 push r29 3067c: cd b7 in r28, 0x3d ; 61 3067e: de b7 in r29, 0x3e ; 62 30680: 2c 97 sbiw r28, 0x0c ; 12 30682: 0f b6 in r0, 0x3f ; 63 30684: f8 94 cli 30686: de bf out 0x3e, r29 ; 62 30688: 0f be out 0x3f, r0 ; 63 3068a: cd bf out 0x3d, r28 ; 61 plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); 3068c: c0 90 fd 11 lds r12, 0x11FD ; 0x8011fd 30690: d0 90 fe 11 lds r13, 0x11FE ; 0x8011fe 30694: e0 90 ff 11 lds r14, 0x11FF ; 0x8011ff 30698: f0 90 00 12 lds r15, 0x1200 ; 0x801200 3069c: 80 91 f9 11 lds r24, 0x11F9 ; 0x8011f9 306a0: 90 91 fa 11 lds r25, 0x11FA ; 0x8011fa 306a4: a0 91 fb 11 lds r26, 0x11FB ; 0x8011fb 306a8: b0 91 fc 11 lds r27, 0x11FC ; 0x8011fc 306ac: 40 91 f5 11 lds r20, 0x11F5 ; 0x8011f5 306b0: 50 91 f6 11 lds r21, 0x11F6 ; 0x8011f6 306b4: 60 91 f7 11 lds r22, 0x11F7 ; 0x8011f7 306b8: 70 91 f8 11 lds r23, 0x11F8 ; 0x8011f8 306bc: 4d 83 std Y+5, r20 ; 0x05 306be: 5e 83 std Y+6, r21 ; 0x06 306c0: 6f 83 std Y+7, r22 ; 0x07 306c2: 78 87 std Y+8, r23 ; 0x08 306c4: 89 83 std Y+1, r24 ; 0x01 306c6: 9a 83 std Y+2, r25 ; 0x02 306c8: ab 83 std Y+3, r26 ; 0x03 306ca: bc 83 std Y+4, r27 ; 0x04 ENABLE_STEPPER_DRIVER_INTERRUPT(); } void plan_set_position(float x, float y, float z, const float &e) { world2machine(x, y); 306cc: be 01 movw r22, r28 306ce: 6f 5f subi r22, 0xFF ; 255 306d0: 7f 4f sbci r23, 0xFF ; 255 306d2: ce 01 movw r24, r28 306d4: 05 96 adiw r24, 0x05 ; 5 306d6: 0e 94 fe 62 call 0xc5fc ; 0xc5fc position[X_AXIS] = lround(x*cs.axis_steps_per_mm[X_AXIS]); 306da: 4d 80 ldd r4, Y+5 ; 0x05 306dc: 5e 80 ldd r5, Y+6 ; 0x06 306de: 6f 80 ldd r6, Y+7 ; 0x07 306e0: 78 84 ldd r7, Y+8 ; 0x08 306e2: 20 91 36 04 lds r18, 0x0436 ; 0x800436 306e6: 30 91 37 04 lds r19, 0x0437 ; 0x800437 306ea: 40 91 38 04 lds r20, 0x0438 ; 0x800438 306ee: 50 91 39 04 lds r21, 0x0439 ; 0x800439 306f2: c3 01 movw r24, r6 306f4: b2 01 movw r22, r4 306f6: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 306fa: 0f 94 41 a4 call 0x34882 ; 0x34882 306fe: 60 93 a6 06 sts 0x06A6, r22 ; 0x8006a6 30702: 70 93 a7 06 sts 0x06A7, r23 ; 0x8006a7 30706: 80 93 a8 06 sts 0x06A8, r24 ; 0x8006a8 3070a: 90 93 a9 06 sts 0x06A9, r25 ; 0x8006a9 position[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 3070e: 89 80 ldd r8, Y+1 ; 0x01 30710: 9a 80 ldd r9, Y+2 ; 0x02 30712: ab 80 ldd r10, Y+3 ; 0x03 30714: bc 80 ldd r11, Y+4 ; 0x04 30716: 20 91 3a 04 lds r18, 0x043A ; 0x80043a 3071a: 30 91 3b 04 lds r19, 0x043B ; 0x80043b 3071e: 40 91 3c 04 lds r20, 0x043C ; 0x80043c 30722: 50 91 3d 04 lds r21, 0x043D ; 0x80043d 30726: c5 01 movw r24, r10 30728: b4 01 movw r22, r8 3072a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 3072e: 0f 94 41 a4 call 0x34882 ; 0x34882 30732: 60 93 aa 06 sts 0x06AA, r22 ; 0x8006aa 30736: 70 93 ab 06 sts 0x06AB, r23 ; 0x8006ab 3073a: 80 93 ac 06 sts 0x06AC, r24 ; 0x8006ac 3073e: 90 93 ad 06 sts 0x06AD, r25 ; 0x8006ad #ifdef MESH_BED_LEVELING position[Z_AXIS] = mbl.active ? 30742: 80 91 9c 12 lds r24, 0x129C ; 0x80129c 30746: 88 23 and r24, r24 30748: 09 f4 brne .+2 ; 0x3074c 3074a: 8c c0 rjmp .+280 ; 0x30864 lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]) : 3074c: a5 01 movw r20, r10 3074e: 94 01 movw r18, r8 30750: c3 01 movw r24, r6 30752: b2 01 movw r22, r4 30754: 0f 94 08 60 call 0x2c010 ; 0x2c010 30758: 9b 01 movw r18, r22 3075a: ac 01 movw r20, r24 3075c: c7 01 movw r24, r14 3075e: b6 01 movw r22, r12 30760: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 30764: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 30768: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 3076c: 40 91 40 04 lds r20, 0x0440 ; 0x800440 30770: 50 91 41 04 lds r21, 0x0441 ; 0x800441 lround(z*cs.axis_steps_per_mm[Z_AXIS]); 30774: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> world2machine(x, y); position[X_AXIS] = lround(x*cs.axis_steps_per_mm[X_AXIS]); position[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); #ifdef MESH_BED_LEVELING position[Z_AXIS] = mbl.active ? 30778: 0f 94 41 a4 call 0x34882 ; 0x34882 3077c: 60 93 ae 06 sts 0x06AE, r22 ; 0x8006ae 30780: 70 93 af 06 sts 0x06AF, r23 ; 0x8006af 30784: 80 93 b0 06 sts 0x06B0, r24 ; 0x8006b0 30788: 90 93 b1 06 sts 0x06B1, r25 ; 0x8006b1 lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]) : lround(z*cs.axis_steps_per_mm[Z_AXIS]); #else position[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); #endif // ENABLE_MESH_BED_LEVELING position[E_AXIS] = lround(e*cs.axis_steps_per_mm[E_AXIS]); 3078c: 80 91 01 12 lds r24, 0x1201 ; 0x801201 30790: 90 91 02 12 lds r25, 0x1202 ; 0x801202 30794: a0 91 03 12 lds r26, 0x1203 ; 0x801203 30798: b0 91 04 12 lds r27, 0x1204 ; 0x801204 3079c: 89 87 std Y+9, r24 ; 0x09 3079e: 9a 87 std Y+10, r25 ; 0x0a 307a0: ab 87 std Y+11, r26 ; 0x0b 307a2: bc 87 std Y+12, r27 ; 0x0c 307a4: 20 91 42 04 lds r18, 0x0442 ; 0x800442 307a8: 30 91 43 04 lds r19, 0x0443 ; 0x800443 307ac: 40 91 44 04 lds r20, 0x0444 ; 0x800444 307b0: 50 91 45 04 lds r21, 0x0445 ; 0x800445 307b4: bc 01 movw r22, r24 307b6: cd 01 movw r24, r26 307b8: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 307bc: 0f 94 41 a4 call 0x34882 ; 0x34882 307c0: 60 93 b2 06 sts 0x06B2, r22 ; 0x8006b2 307c4: 70 93 b3 06 sts 0x06B3, r23 ; 0x8006b3 307c8: 80 93 b4 06 sts 0x06B4, r24 ; 0x8006b4 307cc: 90 93 b5 06 sts 0x06B5, r25 ; 0x8006b5 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 307d0: 40 92 04 04 sts 0x0404, r4 ; 0x800404 307d4: 50 92 05 04 sts 0x0405, r5 ; 0x800405 307d8: 60 92 06 04 sts 0x0406, r6 ; 0x800406 307dc: 70 92 07 04 sts 0x0407, r7 ; 0x800407 position_float[Y_AXIS] = y; 307e0: 80 92 08 04 sts 0x0408, r8 ; 0x800408 307e4: 90 92 09 04 sts 0x0409, r9 ; 0x800409 307e8: a0 92 0a 04 sts 0x040A, r10 ; 0x80040a 307ec: b0 92 0b 04 sts 0x040B, r11 ; 0x80040b position_float[Z_AXIS] = z; 307f0: c0 92 0c 04 sts 0x040C, r12 ; 0x80040c 307f4: d0 92 0d 04 sts 0x040D, r13 ; 0x80040d 307f8: e0 92 0e 04 sts 0x040E, r14 ; 0x80040e 307fc: f0 92 0f 04 sts 0x040F, r15 ; 0x80040f position_float[E_AXIS] = e; 30800: 89 85 ldd r24, Y+9 ; 0x09 30802: 9a 85 ldd r25, Y+10 ; 0x0a 30804: ab 85 ldd r26, Y+11 ; 0x0b 30806: bc 85 ldd r27, Y+12 ; 0x0c 30808: 80 93 10 04 sts 0x0410, r24 ; 0x800410 3080c: 90 93 11 04 sts 0x0411, r25 ; 0x800411 30810: a0 93 12 04 sts 0x0412, r26 ; 0x800412 30814: b0 93 13 04 sts 0x0413, r27 ; 0x800413 #endif st_set_position(position); 30818: 0f 94 73 53 call 0x2a6e6 ; 0x2a6e6 previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest. 3081c: 10 92 f0 03 sts 0x03F0, r1 ; 0x8003f0 <_ZL22previous_nominal_speed.lto_priv.450> 30820: 10 92 f1 03 sts 0x03F1, r1 ; 0x8003f1 <_ZL22previous_nominal_speed.lto_priv.450+0x1> 30824: 10 92 f2 03 sts 0x03F2, r1 ; 0x8003f2 <_ZL22previous_nominal_speed.lto_priv.450+0x2> 30828: 10 92 f3 03 sts 0x03F3, r1 ; 0x8003f3 <_ZL22previous_nominal_speed.lto_priv.450+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 3082c: e4 ef ldi r30, 0xF4 ; 244 3082e: f3 e0 ldi r31, 0x03 ; 3 30830: 80 e1 ldi r24, 0x10 ; 16 30832: df 01 movw r26, r30 30834: 1d 92 st X+, r1 30836: 8a 95 dec r24 30838: e9 f7 brne .-6 ; 0x30834 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_rate); } void plan_set_position_curposXYZE(){ plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); } 3083a: 2c 96 adiw r28, 0x0c ; 12 3083c: 0f b6 in r0, 0x3f ; 63 3083e: f8 94 cli 30840: de bf out 0x3e, r29 ; 62 30842: 0f be out 0x3f, r0 ; 63 30844: cd bf out 0x3d, r28 ; 61 30846: df 91 pop r29 30848: cf 91 pop r28 3084a: ff 90 pop r15 3084c: ef 90 pop r14 3084e: df 90 pop r13 30850: cf 90 pop r12 30852: bf 90 pop r11 30854: af 90 pop r10 30856: 9f 90 pop r9 30858: 8f 90 pop r8 3085a: 7f 90 pop r7 3085c: 6f 90 pop r6 3085e: 5f 90 pop r5 30860: 4f 90 pop r4 30862: 08 95 ret position[X_AXIS] = lround(x*cs.axis_steps_per_mm[X_AXIS]); position[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); #ifdef MESH_BED_LEVELING position[Z_AXIS] = mbl.active ? lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]) : lround(z*cs.axis_steps_per_mm[Z_AXIS]); 30864: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 30868: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 3086c: 40 91 40 04 lds r20, 0x0440 ; 0x800440 30870: 50 91 41 04 lds r21, 0x0441 ; 0x800441 30874: c7 01 movw r24, r14 30876: b6 01 movw r22, r12 30878: 7d cf rjmp .-262 ; 0x30774 0003087a : void plan_buffer_line_curposXYZE(float feed_rate) { plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feed_rate); } void plan_buffer_line_destinationXYZE(float feed_rate) { 3087a: 8f 92 push r8 3087c: 9f 92 push r9 3087e: af 92 push r10 30880: bf 92 push r11 30882: cf 92 push r12 30884: df 92 push r13 30886: ef 92 push r14 30888: ff 92 push r15 3088a: 0f 93 push r16 3088c: 1f 93 push r17 3088e: 4b 01 movw r8, r22 30890: 5c 01 movw r10, r24 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_rate); 30892: e3 e9 ldi r30, 0x93 ; 147 30894: f6 e0 ldi r31, 0x06 ; 6 30896: e0 84 ldd r14, Z+8 ; 0x08 30898: f1 84 ldd r15, Z+9 ; 0x09 3089a: 02 85 ldd r16, Z+10 ; 0x0a 3089c: 13 85 ldd r17, Z+11 ; 0x0b 3089e: 24 81 ldd r18, Z+4 ; 0x04 308a0: 35 81 ldd r19, Z+5 ; 0x05 308a2: 46 81 ldd r20, Z+6 ; 0x06 308a4: 57 81 ldd r21, Z+7 ; 0x07 308a6: 60 81 ld r22, Z 308a8: 71 81 ldd r23, Z+1 ; 0x01 308aa: 82 81 ldd r24, Z+2 ; 0x02 308ac: 93 81 ldd r25, Z+3 ; 0x03 308ae: 1f 92 push r1 308b0: 1f 92 push r1 308b2: 1f 92 push r1 308b4: 1f 92 push r1 308b6: ef e9 ldi r30, 0x9F ; 159 308b8: ce 2e mov r12, r30 308ba: e6 e0 ldi r30, 0x06 ; 6 308bc: de 2e mov r13, r30 308be: 0f 94 22 75 call 0x2ea44 ; 0x2ea44 308c2: 0f 90 pop r0 308c4: 0f 90 pop r0 308c6: 0f 90 pop r0 308c8: 0f 90 pop r0 } 308ca: 1f 91 pop r17 308cc: 0f 91 pop r16 308ce: ff 90 pop r15 308d0: ef 90 pop r14 308d2: df 90 pop r13 308d4: cf 90 pop r12 308d6: bf 90 pop r11 308d8: af 90 pop r10 308da: 9f 90 pop r9 308dc: 8f 90 pop r8 308de: 08 95 ret 000308e0 : // Reset position sync requests plan_reset_next_e_queue = false; plan_reset_next_e_sched = false; } void plan_buffer_line_curposXYZE(float feed_rate) { 308e0: 8f 92 push r8 308e2: 9f 92 push r9 308e4: af 92 push r10 308e6: bf 92 push r11 308e8: cf 92 push r12 308ea: df 92 push r13 308ec: ef 92 push r14 308ee: ff 92 push r15 308f0: 0f 93 push r16 308f2: 1f 93 push r17 308f4: 4b 01 movw r8, r22 308f6: 5c 01 movw r10, r24 plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feed_rate); 308f8: e5 ef ldi r30, 0xF5 ; 245 308fa: f1 e1 ldi r31, 0x11 ; 17 308fc: e0 84 ldd r14, Z+8 ; 0x08 308fe: f1 84 ldd r15, Z+9 ; 0x09 30900: 02 85 ldd r16, Z+10 ; 0x0a 30902: 13 85 ldd r17, Z+11 ; 0x0b 30904: 24 81 ldd r18, Z+4 ; 0x04 30906: 35 81 ldd r19, Z+5 ; 0x05 30908: 46 81 ldd r20, Z+6 ; 0x06 3090a: 57 81 ldd r21, Z+7 ; 0x07 3090c: 60 81 ld r22, Z 3090e: 71 81 ldd r23, Z+1 ; 0x01 30910: 82 81 ldd r24, Z+2 ; 0x02 30912: 93 81 ldd r25, Z+3 ; 0x03 30914: 1f 92 push r1 30916: 1f 92 push r1 30918: 1f 92 push r1 3091a: 1f 92 push r1 3091c: e1 e0 ldi r30, 0x01 ; 1 3091e: ce 2e mov r12, r30 30920: e2 e1 ldi r30, 0x12 ; 18 30922: de 2e mov r13, r30 30924: 0f 94 22 75 call 0x2ea44 ; 0x2ea44 30928: 0f 90 pop r0 3092a: 0f 90 pop r0 3092c: 0f 90 pop r0 3092e: 0f 90 pop r0 } 30930: 1f 91 pop r17 30932: 0f 91 pop r16 30934: ff 90 pop r15 30936: ef 90 pop r14 30938: df 90 pop r13 3093a: cf 90 pop r12 3093c: bf 90 pop r11 3093e: af 90 pop r10 30940: 9f 90 pop r9 30942: 8f 90 pop r8 30944: 08 95 ret 00030946 : #endif /* PLANNER_DIAGNOSTICS */ extern volatile uint32_t step_events_completed; // The number of step events executed in the current block void planner_reset_position() { 30946: 4f 92 push r4 30948: 5f 92 push r5 3094a: 6f 92 push r6 3094c: 7f 92 push r7 3094e: 8f 92 push r8 30950: 9f 92 push r9 30952: af 92 push r10 30954: bf 92 push r11 30956: cf 92 push r12 30958: df 92 push r13 3095a: ef 92 push r14 3095c: ff 92 push r15 3095e: cf 93 push r28 // First update the planner's current position in the physical motor steps. position[X_AXIS] = st_get_position(X_AXIS); 30960: 80 e0 ldi r24, 0x00 ; 0 30962: 0f 94 20 22 call 0x24440 ; 0x24440 30966: 60 93 a6 06 sts 0x06A6, r22 ; 0x8006a6 3096a: 70 93 a7 06 sts 0x06A7, r23 ; 0x8006a7 3096e: 80 93 a8 06 sts 0x06A8, r24 ; 0x8006a8 30972: 90 93 a9 06 sts 0x06A9, r25 ; 0x8006a9 position[Y_AXIS] = st_get_position(Y_AXIS); 30976: 81 e0 ldi r24, 0x01 ; 1 30978: 0f 94 20 22 call 0x24440 ; 0x24440 3097c: 60 93 aa 06 sts 0x06AA, r22 ; 0x8006aa 30980: 70 93 ab 06 sts 0x06AB, r23 ; 0x8006ab 30984: 80 93 ac 06 sts 0x06AC, r24 ; 0x8006ac 30988: 90 93 ad 06 sts 0x06AD, r25 ; 0x8006ad position[Z_AXIS] = st_get_position(Z_AXIS); 3098c: 82 e0 ldi r24, 0x02 ; 2 3098e: 0f 94 20 22 call 0x24440 ; 0x24440 30992: 60 93 ae 06 sts 0x06AE, r22 ; 0x8006ae 30996: 70 93 af 06 sts 0x06AF, r23 ; 0x8006af 3099a: 80 93 b0 06 sts 0x06B0, r24 ; 0x8006b0 3099e: 90 93 b1 06 sts 0x06B1, r25 ; 0x8006b1 position[E_AXIS] = st_get_position(E_AXIS); 309a2: 83 e0 ldi r24, 0x03 ; 3 309a4: 0f 94 20 22 call 0x24440 ; 0x24440 309a8: 60 93 b2 06 sts 0x06B2, r22 ; 0x8006b2 309ac: 70 93 b3 06 sts 0x06B3, r23 ; 0x8006b3 309b0: 80 93 b4 06 sts 0x06B4, r24 ; 0x8006b4 309b4: 90 93 b5 06 sts 0x06B5, r25 ; 0x8006b5 // Second update the current position of the front end. current_position[X_AXIS] = st_get_position_mm(X_AXIS); 309b8: 80 e0 ldi r24, 0x00 ; 0 309ba: 0f 94 2e 22 call 0x2445c ; 0x2445c 309be: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 309c2: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 309c6: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 309ca: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 309ce: 81 e0 ldi r24, 0x01 ; 1 309d0: 0f 94 2e 22 call 0x2445c ; 0x2445c 309d4: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 309d8: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 309dc: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 309e0: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 309e4: 82 e0 ldi r24, 0x02 ; 2 309e6: 0f 94 2e 22 call 0x2445c ; 0x2445c 309ea: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 309ee: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 309f2: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 309f6: 90 93 00 12 sts 0x1200, r25 ; 0x801200 current_position[E_AXIS] = st_get_position_mm(E_AXIS); 309fa: 83 e0 ldi r24, 0x03 ; 3 309fc: 0f 94 2e 22 call 0x2445c ; 0x2445c 30a00: 60 93 01 12 sts 0x1201, r22 ; 0x801201 30a04: 70 93 02 12 sts 0x1202, r23 ; 0x801202 30a08: 80 93 03 12 sts 0x1203, r24 ; 0x801203 30a0c: 90 93 04 12 sts 0x1204, r25 ; 0x801204 // Apply the mesh bed leveling correction to the Z axis. #ifdef MESH_BED_LEVELING if (mbl.active) { 30a10: 80 91 9c 12 lds r24, 0x129C ; 0x80129c 30a14: 88 23 and r24, r24 30a16: 31 f1 breq .+76 ; 0x30a64 #if 1 // Undo the bed level correction so the current Z position is reversible wrt. the machine coordinates. // This does not necessary mean that the Z position will be the same as linearly interpolated from the source G-code line. current_position[Z_AXIS] -= mbl.get_z(current_position[X_AXIS], current_position[Y_AXIS]); 30a18: 20 91 f9 11 lds r18, 0x11F9 ; 0x8011f9 30a1c: 30 91 fa 11 lds r19, 0x11FA ; 0x8011fa 30a20: 40 91 fb 11 lds r20, 0x11FB ; 0x8011fb 30a24: 50 91 fc 11 lds r21, 0x11FC ; 0x8011fc 30a28: 60 91 f5 11 lds r22, 0x11F5 ; 0x8011f5 30a2c: 70 91 f6 11 lds r23, 0x11F6 ; 0x8011f6 30a30: 80 91 f7 11 lds r24, 0x11F7 ; 0x8011f7 30a34: 90 91 f8 11 lds r25, 0x11F8 ; 0x8011f8 30a38: 0f 94 08 60 call 0x2c010 ; 0x2c010 30a3c: 9b 01 movw r18, r22 30a3e: ac 01 movw r20, r24 30a40: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 30a44: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 30a48: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 30a4c: 90 91 00 12 lds r25, 0x1200 ; 0x801200 30a50: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 30a54: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 30a58: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 30a5c: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 30a60: 90 93 00 12 sts 0x1200, r25 ; 0x801200 } } inline void machine2world(float &x, float &y) { if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { 30a64: c0 91 dc 16 lds r28, 0x16DC ; 0x8016dc 30a68: cc 23 and r28, r28 30a6a: 09 f4 brne .+2 ; 0x30a6e 30a6c: 9a c0 rjmp .+308 ; 0x30ba2 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { 30a6e: c0 ff sbrs r28, 0 30a70: 34 c0 rjmp .+104 ; 0x30ada // Then add the offset. x -= world2machine_shift[0]; 30a72: 20 91 d4 16 lds r18, 0x16D4 ; 0x8016d4 30a76: 30 91 d5 16 lds r19, 0x16D5 ; 0x8016d5 30a7a: 40 91 d6 16 lds r20, 0x16D6 ; 0x8016d6 30a7e: 50 91 d7 16 lds r21, 0x16D7 ; 0x8016d7 30a82: 60 91 f5 11 lds r22, 0x11F5 ; 0x8011f5 30a86: 70 91 f6 11 lds r23, 0x11F6 ; 0x8011f6 30a8a: 80 91 f7 11 lds r24, 0x11F7 ; 0x8011f7 30a8e: 90 91 f8 11 lds r25, 0x11F8 ; 0x8011f8 30a92: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 30a96: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 30a9a: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 30a9e: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 30aa2: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 y -= world2machine_shift[1]; 30aa6: 20 91 d8 16 lds r18, 0x16D8 ; 0x8016d8 30aaa: 30 91 d9 16 lds r19, 0x16D9 ; 0x8016d9 30aae: 40 91 da 16 lds r20, 0x16DA ; 0x8016da 30ab2: 50 91 db 16 lds r21, 0x16DB ; 0x8016db 30ab6: 60 91 f9 11 lds r22, 0x11F9 ; 0x8011f9 30aba: 70 91 fa 11 lds r23, 0x11FA ; 0x8011fa 30abe: 80 91 fb 11 lds r24, 0x11FB ; 0x8011fb 30ac2: 90 91 fc 11 lds r25, 0x11FC ; 0x8011fc 30ac6: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 30aca: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 30ace: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 30ad2: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 30ad6: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { 30ada: c1 ff sbrs r28, 1 30adc: 62 c0 rjmp .+196 ; 0x30ba2 // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; 30ade: 80 90 f5 11 lds r8, 0x11F5 ; 0x8011f5 30ae2: 90 90 f6 11 lds r9, 0x11F6 ; 0x8011f6 30ae6: a0 90 f7 11 lds r10, 0x11F7 ; 0x8011f7 30aea: b0 90 f8 11 lds r11, 0x11F8 ; 0x8011f8 30aee: c0 90 f9 11 lds r12, 0x11F9 ; 0x8011f9 30af2: d0 90 fa 11 lds r13, 0x11FA ; 0x8011fa 30af6: e0 90 fb 11 lds r14, 0x11FB ; 0x8011fb 30afa: f0 90 fc 11 lds r15, 0x11FC ; 0x8011fc float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; 30afe: 20 91 cc 16 lds r18, 0x16CC ; 0x8016cc 30b02: 30 91 cd 16 lds r19, 0x16CD ; 0x8016cd 30b06: 40 91 ce 16 lds r20, 0x16CE ; 0x8016ce 30b0a: 50 91 cf 16 lds r21, 0x16CF ; 0x8016cf 30b0e: c5 01 movw r24, r10 30b10: b4 01 movw r22, r8 30b12: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 30b16: 2b 01 movw r4, r22 30b18: 3c 01 movw r6, r24 30b1a: 20 91 d0 16 lds r18, 0x16D0 ; 0x8016d0 30b1e: 30 91 d1 16 lds r19, 0x16D1 ; 0x8016d1 30b22: 40 91 d2 16 lds r20, 0x16D2 ; 0x8016d2 30b26: 50 91 d3 16 lds r21, 0x16D3 ; 0x8016d3 30b2a: c7 01 movw r24, r14 30b2c: b6 01 movw r22, r12 30b2e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 30b32: 9b 01 movw r18, r22 30b34: ac 01 movw r20, r24 30b36: c3 01 movw r24, r6 30b38: b2 01 movw r22, r4 30b3a: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 30b3e: 2b 01 movw r4, r22 30b40: 3c 01 movw r6, r24 x -= world2machine_shift[0]; y -= world2machine_shift[1]; } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; 30b42: 20 91 c4 16 lds r18, 0x16C4 ; 0x8016c4 30b46: 30 91 c5 16 lds r19, 0x16C5 ; 0x8016c5 30b4a: 40 91 c6 16 lds r20, 0x16C6 ; 0x8016c6 30b4e: 50 91 c7 16 lds r21, 0x16C7 ; 0x8016c7 30b52: c5 01 movw r24, r10 30b54: b4 01 movw r22, r8 30b56: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 30b5a: 4b 01 movw r8, r22 30b5c: 5c 01 movw r10, r24 30b5e: 20 91 c8 16 lds r18, 0x16C8 ; 0x8016c8 30b62: 30 91 c9 16 lds r19, 0x16C9 ; 0x8016c9 30b66: 40 91 ca 16 lds r20, 0x16CA ; 0x8016ca 30b6a: 50 91 cb 16 lds r21, 0x16CB ; 0x8016cb 30b6e: c7 01 movw r24, r14 30b70: b6 01 movw r22, r12 30b72: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 30b76: 9b 01 movw r18, r22 30b78: ac 01 movw r20, r24 30b7a: c5 01 movw r24, r10 30b7c: b4 01 movw r22, r8 30b7e: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; x = out_x; 30b82: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 30b86: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 30b8a: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 30b8e: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 y = out_y; 30b92: 40 92 f9 11 sts 0x11F9, r4 ; 0x8011f9 30b96: 50 92 fa 11 sts 0x11FA, r5 ; 0x8011fa 30b9a: 60 92 fb 11 sts 0x11FB, r6 ; 0x8011fb 30b9e: 70 92 fc 11 sts 0x11FC, r7 ; 0x8011fc } #endif // Apply inverse world correction matrix. machine2world(current_position[X_AXIS], current_position[Y_AXIS]); set_destination_to_current(); 30ba2: 0e 94 36 61 call 0xc26c ; 0xc26c #ifdef LIN_ADVANCE memcpy(position_float, current_position, sizeof(position_float)); 30ba6: 80 e1 ldi r24, 0x10 ; 16 30ba8: e5 ef ldi r30, 0xF5 ; 245 30baa: f1 e1 ldi r31, 0x11 ; 17 30bac: a4 e0 ldi r26, 0x04 ; 4 30bae: b4 e0 ldi r27, 0x04 ; 4 30bb0: 01 90 ld r0, Z+ 30bb2: 0d 92 st X+, r0 30bb4: 8a 95 dec r24 30bb6: e1 f7 brne .-8 ; 0x30bb0 #endif } 30bb8: cf 91 pop r28 30bba: ff 90 pop r15 30bbc: ef 90 pop r14 30bbe: df 90 pop r13 30bc0: cf 90 pop r12 30bc2: bf 90 pop r11 30bc4: af 90 pop r10 30bc6: 9f 90 pop r9 30bc8: 8f 90 pop r8 30bca: 7f 90 pop r7 30bcc: 6f 90 pop r6 30bce: 5f 90 pop r5 30bd0: 4f 90 pop r4 30bd2: 08 95 ret 00030bd4 : void planner_abort_hard() { // Abort the stepper routine and flush the planner queue. DISABLE_STEPPER_DRIVER_INTERRUPT(); 30bd4: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 30bd8: 8d 7f andi r24, 0xFD ; 253 30bda: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> // Now the front-end (the Marlin_main.cpp with its current_position) is out of sync. planner_reset_position(); 30bde: 0f 94 a3 84 call 0x30946 ; 0x30946 // Relay to planner wait routine that the current line shall be canceled. planner_aborted = true; 30be2: 81 e0 ldi r24, 0x01 ; 1 30be4: 80 93 ac 0d sts 0x0DAC, r24 ; 0x800dac } void quickStop() { DISABLE_STEPPER_DRIVER_INTERRUPT(); 30be8: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 30bec: 8d 7f andi r24, 0xFD ; 253 30bee: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> return(block); } // Returns true if the buffer has a queued block, false otherwise FORCE_INLINE bool blocks_queued() { return (block_buffer_head != block_buffer_tail); 30bf2: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 30bf6: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 while (blocks_queued()) plan_discard_current_block(); 30bfa: 98 17 cp r25, r24 30bfc: 69 f0 breq .+26 ; 0x30c18 extern volatile uint8_t block_buffer_tail; // Called when the current block is no longer needed. Discards the block and makes the memory // available for new blocks. FORCE_INLINE void plan_discard_current_block() { if (block_buffer_head != block_buffer_tail) { 30bfe: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 30c02: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 30c06: 98 17 cp r25, r24 30c08: a1 f3 breq .-24 ; 0x30bf2 block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 30c0a: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 30c0e: 8f 5f subi r24, 0xFF ; 255 30c10: 8f 70 andi r24, 0x0F ; 15 30c12: 80 93 a9 0d sts 0x0DA9, r24 ; 0x800da9 30c16: ed cf rjmp .-38 ; 0x30bf2 current_block = NULL; 30c18: 10 92 e5 11 sts 0x11E5, r1 ; 0x8011e5 30c1c: 10 92 e4 11 sts 0x11E4, r1 ; 0x8011e4 #ifdef LIN_ADVANCE nextAdvanceISR = ADV_NEVER; 30c20: 8f ef ldi r24, 0xFF ; 255 30c22: 9f ef ldi r25, 0xFF ; 255 30c24: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 30c28: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> current_adv_steps = 0; 30c2c: 10 92 17 04 sts 0x0417, r1 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 30c30: 10 92 16 04 sts 0x0416, r1 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> #endif st_reset_timer(); 30c34: 0f 94 4e 22 call 0x2449c ; 0x2449c ENABLE_STEPPER_DRIVER_INTERRUPT(); 30c38: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 30c3c: 82 60 ori r24, 0x02 ; 2 30c3e: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> // Clear the planner queue, reset and re-enable the stepper timer. quickStop(); // Resets planner junction speeds. Assumes start from rest. previous_nominal_speed = 0.0; 30c42: 10 92 f0 03 sts 0x03F0, r1 ; 0x8003f0 <_ZL22previous_nominal_speed.lto_priv.450> 30c46: 10 92 f1 03 sts 0x03F1, r1 ; 0x8003f1 <_ZL22previous_nominal_speed.lto_priv.450+0x1> 30c4a: 10 92 f2 03 sts 0x03F2, r1 ; 0x8003f2 <_ZL22previous_nominal_speed.lto_priv.450+0x2> 30c4e: 10 92 f3 03 sts 0x03F3, r1 ; 0x8003f3 <_ZL22previous_nominal_speed.lto_priv.450+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 30c52: e4 ef ldi r30, 0xF4 ; 244 30c54: f3 e0 ldi r31, 0x03 ; 3 30c56: 80 e1 ldi r24, 0x10 ; 16 30c58: df 01 movw r26, r30 30c5a: 1d 92 st X+, r1 30c5c: 8a 95 dec r24 30c5e: e9 f7 brne .-6 ; 0x30c5a // Reset position sync requests plan_reset_next_e_queue = false; 30c60: 10 92 ef 03 sts 0x03EF, r1 ; 0x8003ef <_ZL23plan_reset_next_e_queue.lto_priv.448> plan_reset_next_e_sched = false; 30c64: 10 92 ee 03 sts 0x03EE, r1 ; 0x8003ee <_ZL23plan_reset_next_e_sched.lto_priv.449> } 30c68: 08 95 ret 00030c6a : void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); } void ScreenUpdateEnable(){ lcd_update_enable(true); 30c6a: 81 e0 ldi r24, 0x01 ; 1 30c6c: 0c 94 c0 69 jmp 0xd380 ; 0xd380 00030c70 : void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); } static void FullScreenMsg(const char *pgmS, uint8_t slot){ 30c70: 0f 93 push r16 30c72: 1f 93 push r17 30c74: cf 93 push r28 30c76: 8c 01 movw r16, r24 30c78: c6 2f mov r28, r22 lcd_update_enable(false); 30c7a: 80 e0 ldi r24, 0x00 ; 0 30c7c: 0e 94 c0 69 call 0xd380 ; 0xd380 lcd_clear(); 30c80: 0e 94 ae 69 call 0xd35c ; 0xd35c lcd_puts_at_P(0, 1, pgmS); 30c84: a8 01 movw r20, r16 30c86: 61 e0 ldi r22, 0x01 ; 1 30c88: 80 e0 ldi r24, 0x00 ; 0 30c8a: 0e 94 8f 69 call 0xd31e ; 0xd31e } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 30c8e: 80 e2 ldi r24, 0x20 ; 32 30c90: 0e 94 2a 6a call 0xd454 ; 0xd454 lcd_print(' '); lcd_print(slot + 1); 30c94: 6c 2f mov r22, r28 30c96: 70 e0 ldi r23, 0x00 ; 0 30c98: 6f 5f subi r22, 0xFF ; 255 30c9a: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 30c9c: 07 2e mov r0, r23 30c9e: 00 0c add r0, r0 30ca0: 88 0b sbc r24, r24 30ca2: 99 0b sbc r25, r25 } 30ca4: cf 91 pop r28 30ca6: 1f 91 pop r17 30ca8: 0f 91 pop r16 30caa: 0c 94 34 6b jmp 0xd668 ; 0xd668 00030cae : eeprom_increment_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL); eeprom_increment_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT); } void IncrementMMUFails(){ eeprom_increment_byte((uint8_t *)EEPROM_MMU_FAIL); 30cae: 82 ed ldi r24, 0xD2 ; 210 30cb0: 9e e0 ldi r25, 0x0E ; 14 30cb2: 0e 94 0c 6f call 0xde18 ; 0xde18 eeprom_increment_word((uint16_t *)EEPROM_MMU_FAIL_TOT); 30cb6: 83 ed ldi r24, 0xD3 ; 211 30cb8: 9e e0 ldi r25, 0x0E ; 14 30cba: 0c 94 ff 6e jmp 0xddfe ; 0xddfe 00030cbe : inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 30cbe: 41 e0 ldi r20, 0x01 ; 1 30cc0: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 30cc4: 81 11 cpse r24, r1 30cc6: 01 c0 rjmp .+2 ; 0x30cca 30cc8: 40 e0 ldi r20, 0x00 ; 0 * @brief Renders any characters that will be updated live on the MMU error screen. *Currently, this is FINDA and Filament Sensor status and Extruder temperature. */ extern void ReportErrorHookDynamicRender(void){ // beware - this optimization abuses the fact, that FindaDetectsFilament returns 0 or 1 and '0' is followed by '1' in the ASCII table lcd_putc_at(3, 2, mmu2.FindaDetectsFilament() + '0'); 30cca: 40 5d subi r20, 0xD0 ; 208 30ccc: 62 e0 ldi r22, 0x02 ; 2 30cce: 83 e0 ldi r24, 0x03 ; 3 30cd0: 0e 94 9b 69 call 0xd336 ; 0xd336 lcd_putc_at(8, 2, fsensor.getFilamentPresent() + '0'); 30cd4: 0e 94 fc c3 call 0x187f8 ; 0x187f8 30cd8: 40 e3 ldi r20, 0x30 ; 48 30cda: 48 0f add r20, r24 30cdc: 62 e0 ldi r22, 0x02 ; 2 30cde: 88 e0 ldi r24, 0x08 ; 8 30ce0: 0e 94 9b 69 call 0xd336 ; 0xd336 // print active/changing filament slot lcd_set_cursor(10, 2); 30ce4: 62 e0 ldi r22, 0x02 ; 2 30ce6: 8a e0 ldi r24, 0x0A ; 10 30ce8: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcdui_print_extruder(); 30cec: 0f 94 f4 0c call 0x219e8 ; 0x219e8 // Print active extruder temperature lcd_set_cursor(16, 2); 30cf0: 62 e0 ldi r22, 0x02 ; 2 30cf2: 80 e1 ldi r24, 0x10 ; 16 30cf4: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_printf_P(PSTR("%3d"), (int)(degHotend(0) + 0.5)); 30cf8: 20 e0 ldi r18, 0x00 ; 0 30cfa: 30 e0 ldi r19, 0x00 ; 0 30cfc: 40 e0 ldi r20, 0x00 ; 0 30cfe: 5f e3 ldi r21, 0x3F ; 63 30d00: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 30d04: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 30d08: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 30d0c: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 30d10: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 30d14: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> 30d18: 7f 93 push r23 30d1a: 6f 93 push r22 30d1c: 8a ea ldi r24, 0xAA ; 170 30d1e: 9d e9 ldi r25, 0x9D ; 157 30d20: 9f 93 push r25 30d22: 8f 93 push r24 30d24: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 30d28: 0f 90 pop r0 30d2a: 0f 90 pop r0 30d2c: 0f 90 pop r0 30d2e: 0f 90 pop r0 } 30d30: 08 95 ret 00030d32 : return 0; } } static constexpr uint8_t Nibble2Char(uint8_t n) { switch (n) { 30d32: 8a 30 cpi r24, 0x0A ; 10 30d34: 20 f0 brcs .+8 ; 0x30d3e 30d36: 80 31 cpi r24, 0x10 ; 16 30d38: 20 f4 brcc .+8 ; 0x30d42 case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; 30d3a: 89 5a subi r24, 0xA9 ; 169 30d3c: 08 95 ret case 5: case 6: case 7: case 8: case 9: return n + '0'; 30d3e: 80 5d subi r24, 0xD0 ; 208 30d40: 08 95 ret case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; default: return 0; 30d42: 80 e0 ldi r24, 0x00 ; 0 } } 30d44: 08 95 ret 00030d46 : i += AppendCRC(rsp.CRC(), txbuff + i); txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { 30d46: 0f 93 push r16 30d48: 1f 93 push r17 30d4a: cf 93 push r28 30d4c: df 93 push r29 30d4e: 08 2f mov r16, r24 30d50: eb 01 movw r28, r22 if (value == 0) { *dst = '0'; return 1; } uint8_t v = value >> 4U; 30d52: 90 e0 ldi r25, 0x00 ; 0 30d54: 24 e0 ldi r18, 0x04 ; 4 30d56: 95 95 asr r25 30d58: 87 95 ror r24 30d5a: 2a 95 dec r18 30d5c: e1 f7 brne .-8 ; 0x30d56 uint8_t charsOut = 1; 30d5e: 11 e0 ldi r17, 0x01 ; 1 if (v != 0) { // skip the first '0' if any 30d60: 00 97 sbiw r24, 0x00 ; 0 30d62: 21 f0 breq .+8 ; 0x30d6c *dst = Nibble2Char(v); 30d64: 0f 94 99 86 call 0x30d32 ; 0x30d32 30d68: 89 93 st Y+, r24 ++dst; charsOut = 2; 30d6a: 12 e0 ldi r17, 0x02 ; 2 } v = value & 0xfU; *dst = Nibble2Char(v); 30d6c: 80 2f mov r24, r16 30d6e: 8f 70 andi r24, 0x0F ; 15 30d70: 0f 94 99 86 call 0x30d32 ; 0x30d32 30d74: 88 83 st Y, r24 return charsOut; } 30d76: 81 2f mov r24, r17 30d78: df 91 pop r29 30d7a: cf 91 pop r28 30d7c: 1f 91 pop r17 30d7e: 0f 91 pop r16 30d80: 08 95 ret 00030d82 : } static constexpr bool IsHexDigit(uint8_t c) { return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f'); } static constexpr uint8_t Char2Nibble(uint8_t c) { switch (c) { 30d82: 80 33 cpi r24, 0x30 ; 48 30d84: 30 f0 brcs .+12 ; 0x30d92 30d86: 8a 33 cpi r24, 0x3A ; 58 30d88: 30 f0 brcs .+12 ; 0x30d96 30d8a: 9f e9 ldi r25, 0x9F ; 159 30d8c: 98 0f add r25, r24 30d8e: 96 30 cpi r25, 0x06 ; 6 30d90: 20 f0 brcs .+8 ; 0x30d9a case 'd': case 'e': case 'f': return c - 'a' + 10; default: return 0; 30d92: 80 e0 ldi r24, 0x00 ; 0 } } 30d94: 08 95 ret case '5': case '6': case '7': case '8': case '9': return c - '0'; 30d96: 80 53 subi r24, 0x30 ; 48 30d98: 08 95 ret case 'b': case 'c': case 'd': case 'e': case 'f': return c - 'a' + 10; 30d9a: 87 55 subi r24, 0x57 ; 87 30d9c: 08 95 ret 00030d9e : /// CRC8 check - please note we abuse this byte for CRC of ResponseMsgs as well. /// The crc8 byte itself is not added into the CRC computation (obviously ;) ) /// Beware - adding any members of this data structure may need changing the way CRC is being computed! uint8_t crc8; constexpr uint8_t ComputeCRC8() const { 30d9e: cf 93 push r28 30da0: df 93 push r29 30da2: ec 01 movw r28, r24 uint8_t crc = 0; crc = modules::crc::CRC8::CCITT_updateCX(0, (uint8_t)code); 30da4: 68 81 ld r22, Y 30da6: 80 e0 ldi r24, 0x00 ; 0 30da8: 0f 94 8e 6b call 0x2d71c ; 0x2d71c crc = modules::crc::CRC8::CCITT_updateCX(crc, value); 30dac: 69 81 ldd r22, Y+1 ; 0x01 30dae: 0f 94 8e 6b call 0x2d71c ; 0x2d71c crc = modules::crc::CRC8::CCITT_updateW(crc, value2); 30db2: 6a 81 ldd r22, Y+2 ; 0x02 30db4: cb 81 ldd r28, Y+3 ; 0x03 uint8_t b[2]; uint16_t w; explicit constexpr inline U(uint16_t w) : w(w) {} } u(w); return CCITT_updateCX(CCITT_updateCX(crc, u.b[0]), u.b[1]); 30db6: 0f 94 8e 6b call 0x2d71c ; 0x2d71c 30dba: 6c 2f mov r22, r28 return crc; } 30dbc: df 91 pop r29 30dbe: cf 91 pop r28 30dc0: 0d 94 8e 6b jmp 0x2d71c ; 0x2d71c 00030dc4 : struct ResponseMsg { RequestMsg request; ///< response is always preceeded by the request message ResponseMsgParamCodes paramCode; ///< code of the parameter uint16_t paramValue; ///< value of the parameter constexpr uint8_t ComputeCRC8() const { 30dc4: cf 93 push r28 30dc6: df 93 push r29 30dc8: ec 01 movw r28, r24 uint8_t crc = request.ComputeCRC8(); 30dca: 0f 94 cf 86 call 0x30d9e ; 0x30d9e crc = modules::crc::CRC8::CCITT_updateCX(crc, (uint8_t)paramCode); 30dce: 6d 81 ldd r22, Y+5 ; 0x05 30dd0: 0f 94 8e 6b call 0x2d71c ; 0x2d71c crc = modules::crc::CRC8::CCITT_updateW(crc, paramValue); 30dd4: 6e 81 ldd r22, Y+6 ; 0x06 30dd6: cf 81 ldd r28, Y+7 ; 0x07 30dd8: 0f 94 8e 6b call 0x2d71c ; 0x2d71c 30ddc: 6c 2f mov r22, r28 return crc; } 30dde: df 91 pop r29 30de0: cf 91 pop r28 30de2: 0d 94 8e 6b jmp 0x2d71c ; 0x2d71c 00030de6 : return crc; } /// @param code of the request message /// @param value of the request message inline constexpr RequestMsg(RequestMsgCodes code, uint8_t value) 30de6: cf 93 push r28 30de8: df 93 push r29 30dea: ec 01 movw r28, r24 : code(code) , value(value) , value2(0) , crc8(ComputeCRC8()) { 30dec: 68 83 st Y, r22 30dee: 49 83 std Y+1, r20 ; 0x01 30df0: 1b 82 std Y+3, r1 ; 0x03 30df2: 1a 82 std Y+2, r1 ; 0x02 30df4: 0f 94 cf 86 call 0x30d9e ; 0x30d9e 30df8: 8c 83 std Y+4, r24 ; 0x04 } 30dfa: df 91 pop r29 30dfc: cf 91 pop r28 30dfe: 08 95 ret 00030e00 : void Enable_E0() { enable_e0(); } void Disable_E0() { disable_e0(); 30e00: 14 9a sbi 0x02, 4 ; 2 } 30e02: 08 95 ret 00030e04 : static void planner_line_to_current_position_sync(float feedRate_mm_s){ planner_line_to_current_position(feedRate_mm_s); planner_synchronize(); } void extruder_move(float delta, float feedRate) { 30e04: cf 92 push r12 30e06: df 92 push r13 30e08: ef 92 push r14 30e0a: ff 92 push r15 30e0c: cf 93 push r28 30e0e: df 93 push r29 30e10: 69 01 movw r12, r18 30e12: 7a 01 movw r14, r20 current_position[E_AXIS] += delta; 30e14: c5 ef ldi r28, 0xF5 ; 245 30e16: d1 e1 ldi r29, 0x11 ; 17 30e18: 9b 01 movw r18, r22 30e1a: ac 01 movw r20, r24 30e1c: 6c 85 ldd r22, Y+12 ; 0x0c 30e1e: 7d 85 ldd r23, Y+13 ; 0x0d 30e20: 8e 85 ldd r24, Y+14 ; 0x0e 30e22: 9f 85 ldd r25, Y+15 ; 0x0f 30e24: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 30e28: 6c 87 std Y+12, r22 ; 0x0c 30e2a: 7d 87 std Y+13, r23 ; 0x0d 30e2c: 8e 87 std Y+14, r24 ; 0x0e 30e2e: 9f 87 std Y+15, r25 ; 0x0f #include "temperature.h" namespace MMU2 { static void planner_line_to_current_position(float feedRate_mm_s){ plan_buffer_line_curposXYZE(feedRate_mm_s); 30e30: c7 01 movw r24, r14 30e32: b6 01 movw r22, r12 } void extruder_move(float delta, float feedRate) { current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } 30e34: df 91 pop r29 30e36: cf 91 pop r28 30e38: ff 90 pop r15 30e3a: ef 90 pop r14 30e3c: df 90 pop r13 30e3e: cf 90 pop r12 #include "temperature.h" namespace MMU2 { static void planner_line_to_current_position(float feedRate_mm_s){ plan_buffer_line_curposXYZE(feedRate_mm_s); 30e40: 0d 94 70 84 jmp 0x308e0 ; 0x308e0 00030e44 : st_synchronize(); } static inline void go_to_current(float fr) { plan_buffer_line_curposXYZE(fr); 30e44: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 30e48: 0d 94 42 22 jmp 0x24484 ; 0x24484 00030e4c : #include "mmu2_log.h" namespace MMU2 { void LogErrorEvent_P(const char *msg){ 30e4c: cf 93 push r28 30e4e: df 93 push r29 30e50: ec 01 movw r28, r24 SERIAL_ECHO_START; //!@todo Decide MMU errors on serial line 30e52: 81 e6 ldi r24, 0x61 ; 97 30e54: 9d e9 ldi r25, 0x9D ; 157 30e56: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_MMU2(); 30e5a: 84 ea ldi r24, 0xA4 ; 164 30e5c: 9d e9 ldi r25, 0x9D ; 157 30e5e: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHOLNRPGM(msg); 30e62: ce 01 movw r24, r28 } 30e64: df 91 pop r29 30e66: cf 91 pop r28 namespace MMU2 { void LogErrorEvent_P(const char *msg){ SERIAL_ECHO_START; //!@todo Decide MMU errors on serial line SERIAL_MMU2(); SERIAL_ECHOLNRPGM(msg); 30e68: 0c 94 53 72 jmp 0xe4a6 ; 0xe4a6 00030e6c : #include "Filament_sensor.h" namespace MMU2 { FilamentState WhereIsFilament(){ return fsensor.getFilamentPresent() ? FilamentState::AT_FSENSOR : FilamentState::NOT_PRESENT; 30e6c: 0c 94 fc c3 jmp 0x187f8 ; 0x187f8 00030e70 : constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 30e70: 89 32 cpi r24, 0x29 ; 41 30e72: 20 e8 ldi r18, 0x80 ; 128 30e74: 92 07 cpc r25, r18 30e76: 09 f4 brne .+2 ; 0x30e7a 30e78: 97 c0 rjmp .+302 ; 0x30fa8 30e7a: 08 f0 brcs .+2 ; 0x30e7e 30e7c: 48 c0 rjmp .+144 ; 0x30f0e 30e7e: 86 30 cpi r24, 0x06 ; 6 30e80: 60 e8 ldi r22, 0x80 ; 128 30e82: 96 07 cpc r25, r22 30e84: 09 f4 brne .+2 ; 0x30e88 30e86: 9a c0 rjmp .+308 ; 0x30fbc 30e88: 30 f5 brcc .+76 ; 0x30ed6 30e8a: 83 30 cpi r24, 0x03 ; 3 30e8c: 40 e8 ldi r20, 0x80 ; 128 30e8e: 94 07 cpc r25, r20 30e90: 09 f4 brne .+2 ; 0x30e94 30e92: 80 c0 rjmp .+256 ; 0x30f94 30e94: a8 f4 brcc .+42 ; 0x30ec0 30e96: 81 30 cpi r24, 0x01 ; 1 30e98: 20 e8 ldi r18, 0x80 ; 128 30e9a: 92 07 cpc r25, r18 30e9c: 09 f4 brne .+2 ; 0x30ea0 30e9e: 17 c1 rjmp .+558 ; 0x310ce 30ea0: 82 30 cpi r24, 0x02 ; 2 30ea2: 40 e8 ldi r20, 0x80 ; 128 30ea4: 94 07 cpc r25, r20 30ea6: 09 f4 brne .+2 ; 0x30eaa 30ea8: 73 c0 rjmp .+230 ; 0x30f90 static_assert(FindErrorIndex(ERR_MECHANICAL_FINDA_FILAMENT_STUCK) == 1); static_assert(FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER) == 2); static_assert(FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK) == 3); constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); 30eaa: 9c 01 movw r18, r24 } // Electrical issues which can be detected somehow. // Need to be placed before TMC-related errors in order to process couples of error bits between single ones // and to keep the code size down. if (ContainsBit(ec, ErrorCode::TMC_PULLEY_BIT)) { 30eac: 86 ff sbrs r24, 6 30eae: 8e c0 rjmp .+284 ; 0x30fcc static_assert(FindErrorIndex(ERR_MECHANICAL_FINDA_FILAMENT_STUCK) == 1); static_assert(FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER) == 2); static_assert(FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK) == 3); constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); 30eb0: 22 27 eor r18, r18 30eb2: 32 7c andi r19, 0xC2 ; 194 // Electrical issues which can be detected somehow. // Need to be placed before TMC-related errors in order to process couples of error bits between single ones // and to keep the code size down. if (ContainsBit(ec, ErrorCode::TMC_PULLEY_BIT)) { if ((ec & ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) == ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) { 30eb4: 21 15 cp r18, r1 30eb6: 32 4c sbci r19, 0xC2 ; 194 30eb8: 09 f0 breq .+2 ; 0x30ebc 30eba: 9e c0 rjmp .+316 ; 0x30ff8 return FindErrorIndex(ERR_ELECTRICAL_MMU_PULLEY_SELFTEST_FAILED); 30ebc: 8e e1 ldi r24, 0x1E ; 30 30ebe: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 30ec0: 84 30 cpi r24, 0x04 ; 4 30ec2: 60 e8 ldi r22, 0x80 ; 128 30ec4: 96 07 cpc r25, r22 30ec6: 09 f4 brne .+2 ; 0x30eca 30ec8: 67 c0 rjmp .+206 ; 0x30f98 30eca: 85 30 cpi r24, 0x05 ; 5 30ecc: 20 e8 ldi r18, 0x80 ; 128 30ece: 92 07 cpc r25, r18 30ed0: 61 f7 brne .-40 ; 0x30eaa case ErrorCode::MMU_NOT_RESPONDING: return FindErrorIndex(ERR_CONNECT_MMU_NOT_RESPONDING); case ErrorCode::PROTOCOL_ERROR: return FindErrorIndex(ERR_CONNECT_COMMUNICATION_ERROR); case ErrorCode::FILAMENT_ALREADY_LOADED: return FindErrorIndex(ERR_SYSTEM_FILAMENT_ALREADY_LOADED); 30ed2: 84 e2 ldi r24, 0x24 ; 36 30ed4: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 30ed6: 8a 30 cpi r24, 0x0A ; 10 30ed8: 40 e8 ldi r20, 0x80 ; 128 30eda: 94 07 cpc r25, r20 30edc: 09 f4 brne .+2 ; 0x30ee0 30ede: 5e c0 rjmp .+188 ; 0x30f9c 30ee0: 58 f4 brcc .+22 ; 0x30ef8 30ee2: 88 30 cpi r24, 0x08 ; 8 30ee4: 20 e8 ldi r18, 0x80 ; 128 30ee6: 92 07 cpc r25, r18 30ee8: 09 f4 brne .+2 ; 0x30eec 30eea: 6e c0 rjmp .+220 ; 0x30fc8 30eec: 89 30 cpi r24, 0x09 ; 9 30eee: 40 e8 ldi r20, 0x80 ; 128 30ef0: 94 07 cpc r25, r20 30ef2: d9 f6 brne .-74 ; 0x30eaa case ErrorCode::FSENSOR_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER); case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK); case ErrorCode::FSENSOR_TOO_EARLY: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_TOO_EARLY); 30ef4: 85 e0 ldi r24, 0x05 ; 5 30ef6: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 30ef8: 8c 30 cpi r24, 0x0C ; 12 30efa: 60 e8 ldi r22, 0x80 ; 128 30efc: 96 07 cpc r25, r22 30efe: 09 f4 brne .+2 ; 0x30f02 30f00: 51 c0 rjmp .+162 ; 0x30fa4 30f02: 8d 30 cpi r24, 0x0D ; 13 30f04: 20 e8 ldi r18, 0x80 ; 128 30f06: 92 07 cpc r25, r18 30f08: 81 f6 brne .-96 ; 0x30eaa case ErrorCode::INTERNAL: return FindErrorIndex(ERR_SYSTEM_FW_RUNTIME_ERROR); case ErrorCode::FINDA_VS_EEPROM_DISREPANCY: return FindErrorIndex(ERR_SYSTEM_UNLOAD_MANUALLY); case ErrorCode::MCU_UNDERVOLTAGE_VCC: return FindErrorIndex(ERR_ELECTRICAL_MMU_MCU_ERROR); 30f0a: 81 e2 ldi r24, 0x21 ; 33 30f0c: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 30f0e: 8f 32 cpi r24, 0x2F ; 47 30f10: 40 e8 ldi r20, 0x80 ; 128 30f12: 94 07 cpc r25, r20 30f14: 09 f4 brne .+2 ; 0x30f18 30f16: 56 c0 rjmp .+172 ; 0x30fc4 30f18: e0 f4 brcc .+56 ; 0x30f52 30f1a: 8c 32 cpi r24, 0x2C ; 44 30f1c: 20 e8 ldi r18, 0x80 ; 128 30f1e: 92 07 cpc r25, r18 30f20: 09 f4 brne .+2 ; 0x30f24 30f22: 4e c0 rjmp .+156 ; 0x30fc0 30f24: 58 f4 brcc .+22 ; 0x30f3c 30f26: 8a 32 cpi r24, 0x2A ; 42 30f28: 60 e8 ldi r22, 0x80 ; 128 30f2a: 96 07 cpc r25, r22 30f2c: c9 f1 breq .+114 ; 0x30fa0 30f2e: 8b 32 cpi r24, 0x2B ; 43 30f30: 20 e8 ldi r18, 0x80 ; 128 30f32: 92 07 cpc r25, r18 30f34: 09 f0 breq .+2 ; 0x30f38 30f36: b9 cf rjmp .-142 ; 0x30eaa case ErrorCode::FILAMENT_ALREADY_LOADED: return FindErrorIndex(ERR_SYSTEM_FILAMENT_ALREADY_LOADED); case ErrorCode::INVALID_TOOL: return FindErrorIndex(ERR_SYSTEM_INVALID_TOOL); case ErrorCode::QUEUE_FULL: return FindErrorIndex(ERR_SYSTEM_QUEUE_FULL); 30f38: 86 e2 ldi r24, 0x26 ; 38 30f3a: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 30f3c: 8d 32 cpi r24, 0x2D ; 45 30f3e: 40 e8 ldi r20, 0x80 ; 128 30f40: 94 07 cpc r25, r20 30f42: d1 f1 breq .+116 ; 0x30fb8 30f44: 8e 32 cpi r24, 0x2E ; 46 30f46: 60 e8 ldi r22, 0x80 ; 128 30f48: 96 07 cpc r25, r22 30f4a: 09 f0 breq .+2 ; 0x30f4e 30f4c: ae cf rjmp .-164 ; 0x30eaa return FindErrorIndex(ERR_MECHANICAL_IDLER_CANNOT_HOME); case ErrorCode::MOVE_IDLER_FAILED: return FindErrorIndex(ERR_MECHANICAL_IDLER_CANNOT_MOVE); case ErrorCode::MMU_NOT_RESPONDING: return FindErrorIndex(ERR_CONNECT_MMU_NOT_RESPONDING); 30f4e: 82 e2 ldi r24, 0x22 ; 34 30f50: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 30f52: 87 38 cpi r24, 0x87 ; 135 30f54: 20 e8 ldi r18, 0x80 ; 128 30f56: 92 07 cpc r25, r18 30f58: 49 f1 breq .+82 ; 0x30fac 30f5a: 58 f4 brcc .+22 ; 0x30f72 30f5c: 87 34 cpi r24, 0x47 ; 71 30f5e: 60 e8 ldi r22, 0x80 ; 128 30f60: 96 07 cpc r25, r22 30f62: 29 f0 breq .+10 ; 0x30f6e 30f64: 8b 34 cpi r24, 0x4B ; 75 30f66: 20 e8 ldi r18, 0x80 ; 128 30f68: 92 07 cpc r25, r18 30f6a: 09 f0 breq .+2 ; 0x30f6e 30f6c: 9e cf rjmp .-196 ; 0x30eaa case ErrorCode::FILAMENT_CHANGE: return FindErrorIndex(ERR_SYSTEM_FILAMENT_CHANGE); case ErrorCode::STALLED_PULLEY: case ErrorCode::MOVE_PULLEY_FAILED: return FindErrorIndex(ERR_MECHANICAL_PULLEY_CANNOT_MOVE); 30f6e: 84 e0 ldi r24, 0x04 ; 4 30f70: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 30f72: 87 30 cpi r24, 0x07 ; 7 30f74: 41 e8 ldi r20, 0x81 ; 129 30f76: 94 07 cpc r25, r20 30f78: d9 f0 breq .+54 ; 0x30fb0 30f7a: 8b 30 cpi r24, 0x0B ; 11 30f7c: 61 e8 ldi r22, 0x81 ; 129 30f7e: 96 07 cpc r25, r22 30f80: c9 f0 breq .+50 ; 0x30fb4 30f82: 8b 38 cpi r24, 0x8B ; 139 30f84: 20 e8 ldi r18, 0x80 ; 128 30f86: 92 07 cpc r25, r18 30f88: 09 f0 breq .+2 ; 0x30f8c 30f8a: 8f cf rjmp .-226 ; 0x30eaa return FindErrorIndex(ERR_MECHANICAL_PULLEY_CANNOT_MOVE); case ErrorCode::HOMING_SELECTOR_FAILED: return FindErrorIndex(ERR_MECHANICAL_SELECTOR_CANNOT_HOME); case ErrorCode::MOVE_SELECTOR_FAILED: return FindErrorIndex(ERR_MECHANICAL_SELECTOR_CANNOT_MOVE); 30f8c: 89 e0 ldi r24, 0x09 ; 9 30f8e: 08 95 ret uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { case ErrorCode::FINDA_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER); case ErrorCode::FINDA_DIDNT_SWITCH_OFF: return FindErrorIndex(ERR_MECHANICAL_FINDA_FILAMENT_STUCK); 30f90: 81 e0 ldi r24, 0x01 ; 1 30f92: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER); 30f94: 82 e0 ldi r24, 0x02 ; 2 30f96: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK); 30f98: 83 e0 ldi r24, 0x03 ; 3 30f9a: 08 95 ret case ErrorCode::FSENSOR_TOO_EARLY: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_TOO_EARLY); case ErrorCode::FINDA_FLICKERS: return FindErrorIndex(ERR_MECHANICAL_INSPECT_FINDA); 30f9c: 86 e0 ldi r24, 0x06 ; 6 30f9e: 08 95 ret case ErrorCode::LOAD_TO_EXTRUDER_FAILED: return FindErrorIndex(ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED); 30fa0: 87 e0 ldi r24, 0x07 ; 7 30fa2: 08 95 ret case ErrorCode::FILAMENT_EJECTED: return FindErrorIndex(ERR_SYSTEM_FILAMENT_EJECTED); 30fa4: 8a e2 ldi r24, 0x2A ; 42 30fa6: 08 95 ret case ErrorCode::FILAMENT_CHANGE: return FindErrorIndex(ERR_SYSTEM_FILAMENT_CHANGE); 30fa8: 8b e2 ldi r24, 0x2B ; 43 30faa: 08 95 ret case ErrorCode::STALLED_PULLEY: case ErrorCode::MOVE_PULLEY_FAILED: return FindErrorIndex(ERR_MECHANICAL_PULLEY_CANNOT_MOVE); case ErrorCode::HOMING_SELECTOR_FAILED: return FindErrorIndex(ERR_MECHANICAL_SELECTOR_CANNOT_HOME); 30fac: 88 e0 ldi r24, 0x08 ; 8 30fae: 08 95 ret case ErrorCode::MOVE_SELECTOR_FAILED: return FindErrorIndex(ERR_MECHANICAL_SELECTOR_CANNOT_MOVE); case ErrorCode::HOMING_IDLER_FAILED: return FindErrorIndex(ERR_MECHANICAL_IDLER_CANNOT_HOME); 30fb0: 8a e0 ldi r24, 0x0A ; 10 30fb2: 08 95 ret case ErrorCode::MOVE_IDLER_FAILED: return FindErrorIndex(ERR_MECHANICAL_IDLER_CANNOT_MOVE); 30fb4: 8b e0 ldi r24, 0x0B ; 11 30fb6: 08 95 ret case ErrorCode::MMU_NOT_RESPONDING: return FindErrorIndex(ERR_CONNECT_MMU_NOT_RESPONDING); case ErrorCode::PROTOCOL_ERROR: return FindErrorIndex(ERR_CONNECT_COMMUNICATION_ERROR); 30fb8: 83 e2 ldi r24, 0x23 ; 35 30fba: 08 95 ret case ErrorCode::FILAMENT_ALREADY_LOADED: return FindErrorIndex(ERR_SYSTEM_FILAMENT_ALREADY_LOADED); case ErrorCode::INVALID_TOOL: return FindErrorIndex(ERR_SYSTEM_INVALID_TOOL); 30fbc: 85 e2 ldi r24, 0x25 ; 37 30fbe: 08 95 ret case ErrorCode::QUEUE_FULL: return FindErrorIndex(ERR_SYSTEM_QUEUE_FULL); case ErrorCode::VERSION_MISMATCH: return FindErrorIndex(ERR_SYSTEM_FW_UPDATE_NEEDED); 30fc0: 87 e2 ldi r24, 0x27 ; 39 30fc2: 08 95 ret case ErrorCode::INTERNAL: return FindErrorIndex(ERR_SYSTEM_FW_RUNTIME_ERROR); 30fc4: 88 e2 ldi r24, 0x28 ; 40 30fc6: 08 95 ret case ErrorCode::FINDA_VS_EEPROM_DISREPANCY: return FindErrorIndex(ERR_SYSTEM_UNLOAD_MANUALLY); 30fc8: 89 e2 ldi r24, 0x29 ; 41 30fca: 08 95 ret // and to keep the code size down. if (ContainsBit(ec, ErrorCode::TMC_PULLEY_BIT)) { if ((ec & ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) == ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) { return FindErrorIndex(ERR_ELECTRICAL_MMU_PULLEY_SELFTEST_FAILED); } } else if (ContainsBit(ec, ErrorCode::TMC_SELECTOR_BIT)) { 30fcc: 87 ff sbrs r24, 7 30fce: 07 c0 rjmp .+14 ; 0x30fde static_assert(FindErrorIndex(ERR_MECHANICAL_FINDA_FILAMENT_STUCK) == 1); static_assert(FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER) == 2); static_assert(FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK) == 3); constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); 30fd0: 22 27 eor r18, r18 30fd2: 32 7c andi r19, 0xC2 ; 194 if (ContainsBit(ec, ErrorCode::TMC_PULLEY_BIT)) { if ((ec & ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) == ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) { return FindErrorIndex(ERR_ELECTRICAL_MMU_PULLEY_SELFTEST_FAILED); } } else if (ContainsBit(ec, ErrorCode::TMC_SELECTOR_BIT)) { if ((ec & ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) == ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) { 30fd4: 21 15 cp r18, r1 30fd6: 32 4c sbci r19, 0xC2 ; 194 30fd8: a1 f5 brne .+104 ; 0x31042 return FindErrorIndex(ERR_ELECTRICAL_MMU_SELECTOR_SELFTEST_FAILED); 30fda: 8f e1 ldi r24, 0x1F ; 31 30fdc: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 30fde: 22 27 eor r18, r18 30fe0: 31 70 andi r19, 0x01 ; 1 30fe2: 90 ff sbrs r25, 0 30fe4: 52 c0 rjmp .+164 ; 0x3108a static_assert(FindErrorIndex(ERR_MECHANICAL_FINDA_FILAMENT_STUCK) == 1); static_assert(FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER) == 2); static_assert(FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK) == 3); constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); 30fe6: ac 01 movw r20, r24 30fe8: 44 27 eor r20, r20 30fea: 52 7c andi r21, 0xC2 ; 194 } else if (ContainsBit(ec, ErrorCode::TMC_SELECTOR_BIT)) { if ((ec & ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) == ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) { return FindErrorIndex(ERR_ELECTRICAL_MMU_SELECTOR_SELFTEST_FAILED); } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { if ((ec & ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) == ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) { 30fec: 41 15 cp r20, r1 30fee: 52 4c sbci r21, 0xC2 ; 194 30ff0: 09 f0 breq .+2 ; 0x30ff4 30ff2: 4b c0 rjmp .+150 ; 0x3108a return FindErrorIndex(ERR_ELECTRICAL_MMU_IDLER_SELFTEST_FAILED); 30ff4: 80 e2 ldi r24, 0x20 ; 32 30ff6: 08 95 ret constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 30ff8: 9c 01 movw r18, r24 30ffa: 22 27 eor r18, r18 30ffc: 32 78 andi r19, 0x82 ; 130 // TMC-related errors - multiple of these can occur at once // - in such a case we report the first which gets found/converted into Prusa-Error-Codes (usually the fact, that one TMC has an issue is serious enough) // By carefully ordering the checks here we can prioritize the errors being reported to the user. if (ContainsBit(ec, ErrorCode::TMC_PULLEY_BIT)) { if (ContainsBit(ec, ErrorCode::TMC_IOIN_MISMATCH)) { 30ffe: 23 2b or r18, r19 31000: 09 f0 breq .+2 ; 0x31004 31002: 67 c0 rjmp .+206 ; 0x310d2 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 31004: 9c 01 movw r18, r24 31006: 22 27 eor r18, r18 31008: 34 78 andi r19, 0x84 ; 132 // By carefully ordering the checks here we can prioritize the errors being reported to the user. if (ContainsBit(ec, ErrorCode::TMC_PULLEY_BIT)) { if (ContainsBit(ec, ErrorCode::TMC_IOIN_MISMATCH)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_ERROR); } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { 3100a: 23 2b or r18, r19 3100c: 09 f0 breq .+2 ; 0x31010 3100e: 63 c0 rjmp .+198 ; 0x310d6 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 31010: 9c 01 movw r18, r24 31012: 22 27 eor r18, r18 31014: 38 78 andi r19, 0x88 ; 136 return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_ERROR); } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_RESET); } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { 31016: 23 2b or r18, r19 31018: 09 f0 breq .+2 ; 0x3101c 3101a: 5f c0 rjmp .+190 ; 0x310da constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 3101c: 9c 01 movw r18, r24 3101e: 22 27 eor r18, r18 31020: 30 79 andi r19, 0x90 ; 144 return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_RESET); } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_UNDERVOLTAGE_ERROR); } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { 31022: 23 2b or r18, r19 31024: 09 f0 breq .+2 ; 0x31028 31026: 5b c0 rjmp .+182 ; 0x310de constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 31028: 9c 01 movw r18, r24 3102a: 22 27 eor r18, r18 3102c: 30 7a andi r19, 0xA0 ; 160 return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_UNDERVOLTAGE_ERROR); } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_SHORTED); } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { 3102e: 23 2b or r18, r19 31030: 09 f0 breq .+2 ; 0x31034 31032: 57 c0 rjmp .+174 ; 0x310e2 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 31034: 88 27 eor r24, r24 31036: 90 7c andi r25, 0xC0 ; 192 return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_SHORTED); } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_PULLEY_TOO_HOT); } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_ERROR)) { 31038: 89 2b or r24, r25 3103a: 09 f4 brne .+2 ; 0x3103e 3103c: 68 c0 rjmp .+208 ; 0x3110e return FindErrorIndex(ERR_TEMPERATURE_TMC_PULLEY_OVERHEAT_ERROR); 3103e: 8f e0 ldi r24, 0x0F ; 15 31040: 08 95 ret constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 31042: 9c 01 movw r18, r24 31044: 22 27 eor r18, r18 31046: 32 78 andi r19, 0x82 ; 130 } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_ERROR)) { return FindErrorIndex(ERR_TEMPERATURE_TMC_PULLEY_OVERHEAT_ERROR); } } else if (ContainsBit(ec, ErrorCode::TMC_SELECTOR_BIT)) { if (ContainsBit(ec, ErrorCode::TMC_IOIN_MISMATCH)) { 31048: 23 2b or r18, r19 3104a: 09 f0 breq .+2 ; 0x3104e 3104c: 4c c0 rjmp .+152 ; 0x310e6 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 3104e: 9c 01 movw r18, r24 31050: 22 27 eor r18, r18 31052: 34 78 andi r19, 0x84 ; 132 } } else if (ContainsBit(ec, ErrorCode::TMC_SELECTOR_BIT)) { if (ContainsBit(ec, ErrorCode::TMC_IOIN_MISMATCH)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_ERROR); } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { 31054: 23 2b or r18, r19 31056: 09 f0 breq .+2 ; 0x3105a 31058: 48 c0 rjmp .+144 ; 0x310ea constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 3105a: 9c 01 movw r18, r24 3105c: 22 27 eor r18, r18 3105e: 38 78 andi r19, 0x88 ; 136 return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_ERROR); } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_RESET); } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { 31060: 23 2b or r18, r19 31062: 09 f0 breq .+2 ; 0x31066 31064: 44 c0 rjmp .+136 ; 0x310ee constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 31066: 9c 01 movw r18, r24 31068: 22 27 eor r18, r18 3106a: 30 79 andi r19, 0x90 ; 144 return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_RESET); } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_UNDERVOLTAGE_ERROR); } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { 3106c: 23 2b or r18, r19 3106e: 09 f0 breq .+2 ; 0x31072 31070: 40 c0 rjmp .+128 ; 0x310f2 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 31072: 9c 01 movw r18, r24 31074: 22 27 eor r18, r18 31076: 30 7a andi r19, 0xA0 ; 160 return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_UNDERVOLTAGE_ERROR); } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_SHORTED); } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { 31078: 23 2b or r18, r19 3107a: e9 f5 brne .+122 ; 0x310f6 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 3107c: 88 27 eor r24, r24 3107e: 90 7c andi r25, 0xC0 ; 192 return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_SHORTED); } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT); } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_ERROR)) { 31080: 89 2b or r24, r25 31082: 09 f4 brne .+2 ; 0x31086 31084: 44 c0 rjmp .+136 ; 0x3110e return FindErrorIndex(ERR_TEMPERATURE_TMC_SELECTOR_OVERHEAT_ERROR); 31086: 80 e1 ldi r24, 0x10 ; 16 31088: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 3108a: 23 2b or r18, r19 3108c: 09 f4 brne .+2 ; 0x31090 3108e: 3f c0 rjmp .+126 ; 0x3110e constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 31090: 9c 01 movw r18, r24 31092: 22 27 eor r18, r18 31094: 32 78 andi r19, 0x82 ; 130 } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_ERROR)) { return FindErrorIndex(ERR_TEMPERATURE_TMC_SELECTOR_OVERHEAT_ERROR); } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { if (ContainsBit(ec, ErrorCode::TMC_IOIN_MISMATCH)) { 31096: 23 2b or r18, r19 31098: 81 f5 brne .+96 ; 0x310fa constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 3109a: 9c 01 movw r18, r24 3109c: 22 27 eor r18, r18 3109e: 34 78 andi r19, 0x84 ; 132 } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { if (ContainsBit(ec, ErrorCode::TMC_IOIN_MISMATCH)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_ERROR); } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { 310a0: 23 2b or r18, r19 310a2: 69 f5 brne .+90 ; 0x310fe constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 310a4: 9c 01 movw r18, r24 310a6: 22 27 eor r18, r18 310a8: 38 78 andi r19, 0x88 ; 136 return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_ERROR); } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_RESET); } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { 310aa: 23 2b or r18, r19 310ac: 51 f5 brne .+84 ; 0x31102 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 310ae: 9c 01 movw r18, r24 310b0: 22 27 eor r18, r18 310b2: 30 79 andi r19, 0x90 ; 144 return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_RESET); } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_UNDERVOLTAGE_ERROR); } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { 310b4: 23 2b or r18, r19 310b6: 39 f5 brne .+78 ; 0x31106 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 310b8: 9c 01 movw r18, r24 310ba: 22 27 eor r18, r18 310bc: 30 7a andi r19, 0xA0 ; 160 return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_UNDERVOLTAGE_ERROR); } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_SHORTED); } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { 310be: 23 2b or r18, r19 310c0: 21 f5 brne .+72 ; 0x3110a constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 310c2: 88 27 eor r24, r24 310c4: 90 7c andi r25, 0xC0 ; 192 return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_SHORTED); } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT); } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_ERROR)) { 310c6: 89 2b or r24, r25 310c8: 11 f1 breq .+68 ; 0x3110e return FindErrorIndex(ERR_TEMPERATURE_TMC_IDLER_OVERHEAT_ERROR); 310ca: 81 e1 ldi r24, 0x11 ; 17 310cc: 08 95 ret } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { case ErrorCode::FINDA_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER); 310ce: 80 e0 ldi r24, 0x00 ; 0 310d0: 08 95 ret // TMC-related errors - multiple of these can occur at once // - in such a case we report the first which gets found/converted into Prusa-Error-Codes (usually the fact, that one TMC has an issue is serious enough) // By carefully ordering the checks here we can prioritize the errors being reported to the user. if (ContainsBit(ec, ErrorCode::TMC_PULLEY_BIT)) { if (ContainsBit(ec, ErrorCode::TMC_IOIN_MISMATCH)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_ERROR); 310d2: 82 e1 ldi r24, 0x12 ; 18 310d4: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_RESET); 310d6: 85 e1 ldi r24, 0x15 ; 21 310d8: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_UNDERVOLTAGE_ERROR); 310da: 88 e1 ldi r24, 0x18 ; 24 310dc: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_SHORTED); 310de: 8b e1 ldi r24, 0x1B ; 27 310e0: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_PULLEY_TOO_HOT); 310e2: 8c e0 ldi r24, 0x0C ; 12 310e4: 08 95 ret if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_ERROR)) { return FindErrorIndex(ERR_TEMPERATURE_TMC_PULLEY_OVERHEAT_ERROR); } } else if (ContainsBit(ec, ErrorCode::TMC_SELECTOR_BIT)) { if (ContainsBit(ec, ErrorCode::TMC_IOIN_MISMATCH)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_ERROR); 310e6: 83 e1 ldi r24, 0x13 ; 19 310e8: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_RESET); 310ea: 86 e1 ldi r24, 0x16 ; 22 310ec: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_UNDERVOLTAGE_ERROR); 310ee: 89 e1 ldi r24, 0x19 ; 25 310f0: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_SHORTED); 310f2: 8c e1 ldi r24, 0x1C ; 28 310f4: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT); 310f6: 8d e0 ldi r24, 0x0D ; 13 310f8: 08 95 ret if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_ERROR)) { return FindErrorIndex(ERR_TEMPERATURE_TMC_SELECTOR_OVERHEAT_ERROR); } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { if (ContainsBit(ec, ErrorCode::TMC_IOIN_MISMATCH)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_ERROR); 310fa: 84 e1 ldi r24, 0x14 ; 20 310fc: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_RESET); 310fe: 87 e1 ldi r24, 0x17 ; 23 31100: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_UNDERVOLTAGE_ERROR); 31102: 8a e1 ldi r24, 0x1A ; 26 31104: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_SHORTED); 31106: 8d e1 ldi r24, 0x1D ; 29 31108: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT); 3110a: 8e e0 ldi r24, 0x0E ; 14 3110c: 08 95 ret return FindErrorIndex(ERR_TEMPERATURE_TMC_IDLER_OVERHEAT_ERROR); } } // if nothing got caught, return a generic error return FindErrorIndex(ERR_OTHER_UNKNOWN_ERROR); 3110e: 8c e2 ldi r24, 0x2C ; 44 } 31110: 08 95 ret 00031112 : bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { 31112: cf 92 push r12 31114: df 92 push r13 31116: ef 92 push r14 31118: ff 92 push r15 3111a: 0f 93 push r16 3111c: 1f 93 push r17 3111e: cf 93 push r28 31120: df 93 push r29 if (putErrorScreenToSleep) return; if (mmu2.MMUCurrentErrorCode() == ErrorCode::OK && mmu2.MMULastErrorSource() == MMU2::ErrorSourceMMU) { 31122: 20 91 65 12 lds r18, 0x1265 ; 0x801265 31126: 30 91 66 12 lds r19, 0x1266 ; 0x801266 3112a: 21 30 cpi r18, 0x01 ; 1 3112c: 31 05 cpc r19, r1 3112e: 39 f4 brne .+14 ; 0x3113e 31130: 20 91 8e 12 lds r18, 0x128E ; 0x80128e 31134: 21 30 cpi r18, 0x01 ; 1 31136: 19 f4 brne .+6 ; 0x3113e // If the error code suddenly changes to OK, that means // a button was pushed on the MMU and the LCD should // dismiss the error screen until MMU raises a new error ReportErrorHookState = ReportErrorHookStates::DISMISS_ERROR_SCREEN; 31138: 22 e0 ldi r18, 0x02 ; 2 3113a: 20 93 c3 16 sts 0x16C3, r18 ; 0x8016c3 } const uint8_t ei = PrusaErrorCodeIndex((ErrorCode)ec); 3113e: 0f 94 38 87 call 0x30e70 ; 0x30e70 31142: d8 2f mov r29, r24 switch ((uint8_t)ReportErrorHookState) { 31144: 80 91 c3 16 lds r24, 0x16C3 ; 0x8016c3 31148: 81 30 cpi r24, 0x01 ; 1 3114a: 09 f4 brne .+2 ; 0x3114e 3114c: 64 c0 rjmp .+200 ; 0x31216 3114e: 60 f0 brcs .+24 ; 0x31168 31150: 82 30 cpi r24, 0x02 ; 2 31152: 09 f4 brne .+2 ; 0x31156 31154: f4 c0 rjmp .+488 ; 0x3133e ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; default: break; } } 31156: df 91 pop r29 31158: cf 91 pop r28 3115a: 1f 91 pop r17 3115c: 0f 91 pop r16 3115e: ff 90 pop r15 31160: ef 90 pop r14 31162: df 90 pop r13 31164: cf 90 pop r12 31166: 08 95 ret const uint8_t ei = PrusaErrorCodeIndex((ErrorCode)ec); switch ((uint8_t)ReportErrorHookState) { case (uint8_t)ReportErrorHookStates::RENDER_ERROR_SCREEN: KEEPALIVE_STATE(PAUSED_FOR_USER); 31168: 84 e0 ldi r24, 0x04 ; 4 3116a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 const char *PrusaErrorDesc(uint8_t i) { return (const char *)pgm_read_ptr(errorDescs + i); } uint8_t PrusaErrorButtons(uint8_t i) { return pgm_read_byte(errorButtons + i); 3116e: 0d 2f mov r16, r29 31170: 10 e0 ldi r17, 0x00 ; 0 31172: f8 01 movw r30, r16 31174: e2 5f subi r30, 0xF2 ; 242 31176: f1 46 sbci r31, 0x61 ; 97 31178: c4 91 lpm r28, Z //! |>Retry >Done >W| <- buttons bool two_choices = false; // Read and determine what operations should be shown on the menu const uint8_t button_operation = PrusaErrorButtons(ei); const uint8_t button_op_right = BUTTON_OP_RIGHT(button_operation); 3117a: fc 2e mov r15, r28 3117c: f2 94 swap r15 3117e: 6f e0 ldi r22, 0x0F ; 15 31180: f6 22 and r15, r22 const uint8_t button_op_middle = BUTTON_OP_MIDDLE(button_operation); 31182: cf 70 andi r28, 0x0F ; 15 if (button_op_right == (uint8_t)ButtonOperations::NoOperation){ // Two operations not specified, the error menu should only show two choices two_choices = true; } lcd_update_enable(false); 31184: 80 e0 ldi r24, 0x00 ; 0 31186: 0e 94 c0 69 call 0xd380 ; 0xd380 lcd_clear(); 3118a: 0e 94 ae 69 call 0xd35c ; 0xd35c // if nothing got caught, return a generic error return FindErrorIndex(ERR_OTHER_UNKNOWN_ERROR); } uint16_t PrusaErrorCode(uint8_t i) { return pgm_read_word(errorCodes + i); 3118e: 00 0f add r16, r16 31190: 11 1f adc r17, r17 31192: f8 01 movw r30, r16 31194: e5 5c subi r30, 0xC5 ; 197 31196: f1 46 sbci r31, 0x61 ; 97 31198: c5 90 lpm r12, Z+ 3119a: d4 90 lpm r13, Z } const char *PrusaErrorTitle(uint8_t i) { return (const char *)pgm_read_ptr(errorTitles + i); 3119c: 09 50 subi r16, 0x09 ; 9 3119e: 15 46 sbci r17, 0x65 ; 101 311a0: f8 01 movw r30, r16 311a2: 85 91 lpm r24, Z+ 311a4: 94 91 lpm r25, Z // Print title and header lcd_printf_P(PSTR("%.20S\nprusa.io/04%hu"), _T(PrusaErrorTitle(ei)), PrusaErrorCode(ei) ); 311a6: 0e 94 b1 6c call 0xd962 ; 0xd962 311aa: df 92 push r13 311ac: cf 92 push r12 311ae: 9f 93 push r25 311b0: 8f 93 push r24 311b2: 87 ea ldi r24, 0xA7 ; 167 311b4: 9e e9 ldi r25, 0x9E ; 158 311b6: 9f 93 push r25 311b8: 8f 93 push r24 311ba: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 lcd_show_choices_prompt_P(two_choices ? LCD_LEFT_BUTTON_CHOICE : LCD_MIDDLE_BUTTON_CHOICE, _T(PrusaErrorButtonTitle(button_op_middle)), two_choices ? PrusaErrorButtonMore() : _T(PrusaErrorButtonTitle(button_op_right)), two_choices ? 18 : 9, two_choices ? nullptr : PrusaErrorButtonMore()); } void ReportErrorHookSensorLineRender(){ // Render static characters in third line lcd_puts_at_P(0, 2, PSTR("FI: FS: > " LCD_STR_THERMOMETER " " LCD_STR_DEGREE)); 311be: 42 e8 ldi r20, 0x82 ; 130 311c0: 5b e9 ldi r21, 0x9B ; 155 311c2: 62 e0 ldi r22, 0x02 ; 2 311c4: 80 e0 ldi r24, 0x00 ; 0 311c6: 0e 94 8f 69 call 0xd31e ; 0xd31e lcd_printf_P(PSTR("%.20S\nprusa.io/04%hu"), _T(PrusaErrorTitle(ei)), PrusaErrorCode(ei) ); ReportErrorHookSensorLineRender(); // Render the choices lcd_show_choices_prompt_P(two_choices ? LCD_LEFT_BUTTON_CHOICE : LCD_MIDDLE_BUTTON_CHOICE, _T(PrusaErrorButtonTitle(button_op_middle)), two_choices ? PrusaErrorButtonMore() : _T(PrusaErrorButtonTitle(button_op_right)), two_choices ? 18 : 9, two_choices ? nullptr : PrusaErrorButtonMore()); 311ca: 0f 90 pop r0 311cc: 0f 90 pop r0 311ce: 0f 90 pop r0 311d0: 0f 90 pop r0 311d2: 0f 90 pop r0 311d4: 0f 90 pop r0 311d6: f1 10 cpse r15, r1 311d8: c6 c0 rjmp .+396 ; 0x31366 311da: 10 e0 ldi r17, 0x00 ; 0 311dc: 00 e0 ldi r16, 0x00 ; 0 311de: 42 e1 ldi r20, 0x12 ; 18 311e0: e4 2e mov r14, r20 311e2: 5d e3 ldi r21, 0x3D ; 61 311e4: c5 2e mov r12, r21 311e6: 5c e6 ldi r21, 0x6C ; 108 311e8: d5 2e mov r13, r21 return pgm_read_byte(errorButtons + i); } const char *PrusaErrorButtonTitle(uint8_t bi) { // -1 represents the hidden NoOperation button which is not drawn in any way return (const char *)pgm_read_ptr(btnOperation + bi - 1); 311ea: ec 2f mov r30, r28 311ec: f0 e0 ldi r31, 0x00 ; 0 311ee: ee 0f add r30, r30 311f0: ff 1f adc r31, r31 311f2: ed 56 subi r30, 0x6D ; 109 311f4: f1 46 sbci r31, 0x61 ; 97 311f6: 85 91 lpm r24, Z+ 311f8: 94 91 lpm r25, Z 311fa: 0e 94 b1 6c call 0xd962 ; 0xd962 311fe: bc 01 movw r22, r24 31200: 81 e0 ldi r24, 0x01 ; 1 31202: f1 10 cpse r15, r1 31204: 01 c0 rjmp .+2 ; 0x31208 31206: 80 e0 ldi r24, 0x00 ; 0 31208: 2e 2d mov r18, r14 3120a: a6 01 movw r20, r12 3120c: 0f 94 6f 0a call 0x214de ; 0x214de switch ((uint8_t)ReportErrorHookState) { case (uint8_t)ReportErrorHookStates::RENDER_ERROR_SCREEN: KEEPALIVE_STATE(PAUSED_FOR_USER); ReportErrorHookStaticRender(ei); ReportErrorHookState = ReportErrorHookStates::MONITOR_SELECTION; 31210: 81 e0 ldi r24, 0x01 ; 1 31212: 80 93 c3 16 sts 0x16C3, r24 ; 0x8016c3 [[fallthrough]]; case (uint8_t)ReportErrorHookStates::MONITOR_SELECTION: is_mmu_error_monitor_active = true; 31216: 81 e0 ldi r24, 0x01 ; 1 31218: 80 93 c6 06 sts 0x06C6, r24 ; 0x8006c6 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.452> ReportErrorHookDynamicRender(); // Render dynamic characters 3121c: 0f 94 5f 86 call 0x30cbe ; 0x30cbe sound_wait_for_user(); 31220: 0f 94 cb 35 call 0x26b96 ; 0x26b96 const char *PrusaErrorDesc(uint8_t i) { return (const char *)pgm_read_ptr(errorDescs + i); } uint8_t PrusaErrorButtons(uint8_t i) { return pgm_read_byte(errorButtons + i); 31224: 0d 2f mov r16, r29 31226: 10 e0 ldi r17, 0x00 ; 0 31228: f8 01 movw r30, r16 3122a: e2 5f subi r30, 0xF2 ; 242 3122c: f1 46 sbci r31, 0x61 ; 97 3122e: c4 91 lpm r28, Z bool two_choices = false; static uint8_t reset_button_selection; // Read and determine what operations should be shown on the menu const uint8_t button_operation = PrusaErrorButtons(ei); const uint8_t button_op_right = BUTTON_OP_RIGHT(button_operation); 31230: dc 2f mov r29, r28 31232: d2 95 swap r29 31234: df 70 andi r29, 0x0F ; 15 if (button_op_right == (uint8_t)ButtonOperations::NoOperation){ // Two operations not specified, the error menu should only show two choices two_choices = true; } static int8_t current_selection = two_choices ? LCD_LEFT_BUTTON_CHOICE : LCD_MIDDLE_BUTTON_CHOICE; 31236: 80 91 bb 16 lds r24, 0x16BB ; 0x8016bb 3123a: 81 11 cpse r24, r1 3123c: 09 c0 rjmp .+18 ; 0x31250 3123e: 81 e0 ldi r24, 0x01 ; 1 31240: d1 11 cpse r29, r1 31242: 01 c0 rjmp .+2 ; 0x31246 31244: 80 e0 ldi r24, 0x00 ; 0 31246: 80 93 ba 16 sts 0x16BA, r24 ; 0x8016ba 3124a: 81 e0 ldi r24, 0x01 ; 1 3124c: 80 93 bb 16 sts 0x16BB, r24 ; 0x8016bb static int8_t choice_selected = -1; if (reset_button_selection) { 31250: 80 91 b9 16 lds r24, 0x16B9 ; 0x8016b9 31254: 88 23 and r24, r24 31256: 41 f0 breq .+16 ; 0x31268 // If a new error screen is shown, we must reset the button selection // Default selection is different depending on how many buttons are present current_selection = two_choices ? LCD_LEFT_BUTTON_CHOICE : LCD_MIDDLE_BUTTON_CHOICE; 31258: 81 e0 ldi r24, 0x01 ; 1 3125a: d1 11 cpse r29, r1 3125c: 01 c0 rjmp .+2 ; 0x31260 3125e: 80 e0 ldi r24, 0x00 ; 0 31260: 80 93 ba 16 sts 0x16BA, r24 ; 0x8016ba choice_selected = -1; reset_button_selection = 0; 31264: 10 92 b9 16 sts 0x16B9, r1 ; 0x8016b9 } // Check if knob was rotated if (lcd_encoder) { 31268: 20 91 06 05 lds r18, 0x0506 ; 0x800506 3126c: 30 91 07 05 lds r19, 0x0507 ; 0x800507 31270: 21 15 cp r18, r1 31272: 31 05 cpc r19, r1 31274: b9 f1 breq .+110 ; 0x312e4 31276: 80 91 ba 16 lds r24, 0x16BA ; 0x8016ba if (two_choices == false) { // third_choice is not nullptr, safe to dereference 3127a: dd 23 and r29, r29 3127c: 61 f0 breq .+24 ; 0x31296 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 3127e: 37 ff sbrs r19, 7 31280: 06 c0 rjmp .+12 ; 0x3128e 31282: 88 23 and r24, r24 31284: 69 f0 breq .+26 ; 0x312a0 // Rotating knob counter clockwise current_selection--; 31286: 81 50 subi r24, 0x01 ; 1 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { // Rotating knob counter clockwise current_selection = LCD_LEFT_BUTTON_CHOICE; } else if (lcd_encoder > 0 && current_selection != LCD_MIDDLE_BUTTON_CHOICE) { // Rotating knob clockwise current_selection = LCD_MIDDLE_BUTTON_CHOICE; 31288: 80 93 ba 16 sts 0x16BA, r24 ; 0x8016ba 3128c: 09 c0 rjmp .+18 ; 0x312a0 if (lcd_encoder) { if (two_choices == false) { // third_choice is not nullptr, safe to dereference if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { // Rotating knob counter clockwise current_selection--; } else if (lcd_encoder > 0 && current_selection != LCD_RIGHT_BUTTON_CHOICE) { 3128e: 82 30 cpi r24, 0x02 ; 2 31290: 39 f0 breq .+14 ; 0x312a0 // Rotating knob clockwise current_selection++; 31292: 8f 5f subi r24, 0xFF ; 255 31294: f9 cf rjmp .-14 ; 0x31288 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 31296: 37 ff sbrs r19, 7 31298: 41 c0 rjmp .+130 ; 0x3131c 3129a: 81 11 cpse r24, r1 // Rotating knob counter clockwise current_selection = LCD_LEFT_BUTTON_CHOICE; 3129c: 10 92 ba 16 sts 0x16BA, r1 ; 0x8016ba //! ---------------------- //! |>(left) >(mid) | //! ---------------------- //! @endcode // lcd_putc_at(0, 3, current_selection == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 312a0: 80 91 ba 16 lds r24, 0x16BA ; 0x8016ba 312a4: 4e e3 ldi r20, 0x3E ; 62 312a6: 81 11 cpse r24, r1 312a8: 40 e2 ldi r20, 0x20 ; 32 312aa: 63 e0 ldi r22, 0x03 ; 3 312ac: 80 e0 ldi r24, 0x00 ; 0 312ae: 0e 94 9b 69 call 0xd336 ; 0xd336 312b2: 80 91 ba 16 lds r24, 0x16BA ; 0x8016ba if (two_choices == false) 312b6: dd 23 and r29, r29 312b8: b1 f1 breq .+108 ; 0x31326 { lcd_putc_at(9, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 312ba: 4e e3 ldi r20, 0x3E ; 62 312bc: 81 30 cpi r24, 0x01 ; 1 312be: 09 f0 breq .+2 ; 0x312c2 312c0: 40 e2 ldi r20, 0x20 ; 32 312c2: 63 e0 ldi r22, 0x03 ; 3 312c4: 89 e0 ldi r24, 0x09 ; 9 312c6: 0e 94 9b 69 call 0xd336 ; 0xd336 lcd_putc_at(18, 3, current_selection == LCD_RIGHT_BUTTON_CHOICE ? '>': ' '); 312ca: 80 91 ba 16 lds r24, 0x16BA ; 0x8016ba 312ce: 82 30 cpi r24, 0x02 ; 2 312d0: 61 f5 brne .+88 ; 0x3132a } else { // More button for two button screen lcd_putc_at(18, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 312d2: 4e e3 ldi r20, 0x3E ; 62 312d4: 63 e0 ldi r22, 0x03 ; 3 312d6: 82 e1 ldi r24, 0x12 ; 18 312d8: 0e 94 9b 69 call 0xd336 ; 0xd336 } // Consume rotation event lcd_encoder = 0; 312dc: 10 92 07 05 sts 0x0507, r1 ; 0x800507 312e0: 10 92 06 05 sts 0x0506, r1 ; 0x800506 } // Check if knob was clicked and consume the event if (lcd_clicked()) { 312e4: 0e 94 98 6b call 0xd730 ; 0xd730 312e8: 88 23 and r24, r24 312ea: 09 f4 brne .+2 ; 0x312ee 312ec: 34 cf rjmp .-408 ; 0x31156 choice_selected = current_selection; 312ee: 80 91 ba 16 lds r24, 0x16BA ; 0x8016ba } else { // continue monitoring return ret; } if ((two_choices && choice_selected == LCD_MIDDLE_BUTTON_CHOICE) // Two choices and middle button selected 312f2: d1 11 cpse r29, r1 312f4: 1c c0 rjmp .+56 ; 0x3132e 312f6: 81 30 cpi r24, 0x01 ; 1 312f8: 89 f5 brne .+98 ; 0x3135c const char *PrusaErrorTitle(uint8_t i) { return (const char *)pgm_read_ptr(errorTitles + i); } const char *PrusaErrorDesc(uint8_t i) { return (const char *)pgm_read_ptr(errorDescs + i); 312fa: f8 01 movw r30, r16 312fc: ee 0f add r30, r30 312fe: ff 1f adc r31, r31 31300: ec 54 subi r30, 0x4C ; 76 31302: f2 46 sbci r31, 0x62 ; 98 31304: 85 91 lpm r24, Z+ 31306: 94 91 lpm r25, Z || (!two_choices && choice_selected == LCD_RIGHT_BUTTON_CHOICE)) // Three choices and right most button selected { // 'More' show error description lcd_show_fullscreen_message_and_wait_P(_T(PrusaErrorDesc(ei))); 31308: 0e 94 b1 6c call 0xd962 ; 0xd962 3130c: 0f 94 47 0b call 0x2168e ; 0x2168e SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 31310: 81 e0 ldi r24, 0x01 ; 1 31312: 80 93 b9 16 sts 0x16B9, r24 ; 0x8016b9 lcd_return_to_status(); sound_wait_for_user_reset(); // Reset the state in case a new error is reported is_mmu_error_monitor_active = false; KEEPALIVE_STATE(IN_HANDLER); ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; 31316: 10 92 c3 16 sts 0x16C3, r1 ; 0x8016c3 3131a: 1d cf rjmp .-454 ; 0x31156 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { // Rotating knob counter clockwise current_selection = LCD_LEFT_BUTTON_CHOICE; } else if (lcd_encoder > 0 && current_selection != LCD_MIDDLE_BUTTON_CHOICE) { 3131c: 81 30 cpi r24, 0x01 ; 1 3131e: 09 f4 brne .+2 ; 0x31322 31320: bf cf rjmp .-130 ; 0x312a0 // Rotating knob clockwise current_selection = LCD_MIDDLE_BUTTON_CHOICE; 31322: 81 e0 ldi r24, 0x01 ; 1 31324: b1 cf rjmp .-158 ; 0x31288 { lcd_putc_at(9, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); lcd_putc_at(18, 3, current_selection == LCD_RIGHT_BUTTON_CHOICE ? '>': ' '); } else { // More button for two button screen lcd_putc_at(18, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 31326: 81 30 cpi r24, 0x01 ; 1 31328: a1 f2 breq .-88 ; 0x312d2 3132a: 40 e2 ldi r20, 0x20 ; 32 3132c: d3 cf rjmp .-90 ; 0x312d4 // continue monitoring return ret; } if ((two_choices && choice_selected == LCD_MIDDLE_BUTTON_CHOICE) // Two choices and middle button selected || (!two_choices && choice_selected == LCD_RIGHT_BUTTON_CHOICE)) // Three choices and right most button selected 3132e: 82 30 cpi r24, 0x02 ; 2 31330: 21 f3 breq .-56 ; 0x312fa { // 'More' show error description lcd_show_fullscreen_message_and_wait_P(_T(PrusaErrorDesc(ei))); ret = 1; } else if(choice_selected == LCD_MIDDLE_BUTTON_CHOICE) { 31332: 81 30 cpi r24, 0x01 ; 1 31334: 99 f4 brne .+38 ; 0x3135c return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 31336: d0 93 ae 0d sts 0x0DAE, r29 ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 3133a: 80 93 b9 16 sts 0x16B9, r24 ; 0x8016b9 // More button selected, change state ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; case 2: // Exit error screen and enable lcd updates lcd_update_enable(true); 3133e: 81 e0 ldi r24, 0x01 ; 1 31340: 0e 94 c0 69 call 0xd380 ; 0xd380 lcd_return_to_status(); 31344: 0e 94 17 fe call 0x1fc2e ; 0x1fc2e 31348: 10 92 2b 05 sts 0x052B, r1 ; 0x80052b <_ZL10beep_timer.lto_priv.456> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 3134c: 10 92 2e 05 sts 0x052E, r1 ; 0x80052e <_ZL6bFirst.lto_priv.457> sound_wait_for_user_reset(); // Reset the state in case a new error is reported is_mmu_error_monitor_active = false; 31350: 10 92 c6 06 sts 0x06C6, r1 ; 0x8006c6 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.452> KEEPALIVE_STATE(IN_HANDLER); 31354: 82 e0 ldi r24, 0x02 ; 2 31356: 80 93 78 02 sts 0x0278, r24 ; 0x800278 3135a: dd cf rjmp .-70 ; 0x31316 static uint8_t reset_button_selection; // Read and determine what operations should be shown on the menu const uint8_t button_operation = PrusaErrorButtons(ei); const uint8_t button_op_right = BUTTON_OP_RIGHT(button_operation); const uint8_t button_op_middle = BUTTON_OP_MIDDLE(button_operation); 3135c: cf 70 andi r28, 0x0F ; 15 3135e: c0 93 ae 0d sts 0x0DAE, r28 ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 31362: 81 e0 ldi r24, 0x01 ; 1 31364: ea cf rjmp .-44 ; 0x3133a return pgm_read_byte(errorButtons + i); } const char *PrusaErrorButtonTitle(uint8_t bi) { // -1 represents the hidden NoOperation button which is not drawn in any way return (const char *)pgm_read_ptr(btnOperation + bi - 1); 31366: ef 2d mov r30, r15 31368: f0 e0 ldi r31, 0x00 ; 0 3136a: ee 0f add r30, r30 3136c: ff 1f adc r31, r31 3136e: ed 56 subi r30, 0x6D ; 109 31370: f1 46 sbci r31, 0x61 ; 97 31372: 85 91 lpm r24, Z+ 31374: 94 91 lpm r25, Z lcd_printf_P(PSTR("%.20S\nprusa.io/04%hu"), _T(PrusaErrorTitle(ei)), PrusaErrorCode(ei) ); ReportErrorHookSensorLineRender(); // Render the choices lcd_show_choices_prompt_P(two_choices ? LCD_LEFT_BUTTON_CHOICE : LCD_MIDDLE_BUTTON_CHOICE, _T(PrusaErrorButtonTitle(button_op_middle)), two_choices ? PrusaErrorButtonMore() : _T(PrusaErrorButtonTitle(button_op_right)), two_choices ? 18 : 9, two_choices ? nullptr : PrusaErrorButtonMore()); 31376: 0e 94 b1 6c call 0xd962 ; 0xd962 3137a: 6c 01 movw r12, r24 3137c: 0d e3 ldi r16, 0x3D ; 61 3137e: 1c e6 ldi r17, 0x6C ; 108 31380: 99 e0 ldi r25, 0x09 ; 9 31382: e9 2e mov r14, r25 31384: 32 cf rjmp .-412 ; 0x311ea 00031386 : buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation return result; } Buttons ButtonAvailable(ErrorCode ec) { uint8_t ei = PrusaErrorCodeIndex(ec); 31386: 0f 94 38 87 call 0x30e70 ; 0x30e70 // if nothing got caught, return a generic error return FindErrorIndex(ERR_OTHER_UNKNOWN_ERROR); } uint16_t PrusaErrorCode(uint8_t i) { return pgm_read_word(errorCodes + i); 3138a: e8 2f mov r30, r24 3138c: f0 e0 ldi r31, 0x00 ; 0 3138e: ee 0f add r30, r30 31390: ff 1f adc r31, r31 31392: e5 5c subi r30, 0xC5 ; 197 31394: f1 46 sbci r31, 0x61 ; 97 31396: 25 91 lpm r18, Z+ 31398: 34 91 lpm r19, Z // The list of responses which occur in mmu error dialogs // Return button index or perform some action on the MK3 by itself (like Reset MMU) // Based on Prusa-Error-Codes errors_list.h // So far hardcoded, but shall be generated in the future switch ( PrusaErrorCode(ei) ) { 3139a: 23 33 cpi r18, 0x33 ; 51 3139c: 81 e0 ldi r24, 0x01 ; 1 3139e: 38 07 cpc r19, r24 313a0: 08 f0 brcs .+2 ; 0x313a4 313a2: 41 c0 rjmp .+130 ; 0x31426 313a4: 2d 32 cpi r18, 0x2D ; 45 313a6: 81 e0 ldi r24, 0x01 ; 1 313a8: 38 07 cpc r19, r24 313aa: 78 f5 brcc .+94 ; 0x3140a 313ac: 2e 37 cpi r18, 0x7E ; 126 313ae: 31 05 cpc r19, r1 313b0: 09 f4 brne .+2 ; 0x313b4 313b2: 83 c0 rjmp .+262 ; 0x314ba 313b4: f0 f4 brcc .+60 ; 0x313f2 313b6: 2c 36 cpi r18, 0x6C ; 108 313b8: 31 05 cpc r19, r1 313ba: 09 f4 brne .+2 ; 0x313be 313bc: 85 c0 rjmp .+266 ; 0x314c8 313be: 30 f4 brcc .+12 ; 0x313cc 313c0: 25 36 cpi r18, 0x65 ; 101 313c2: 31 05 cpc r19, r1 313c4: 08 f0 brcs .+2 ; 0x313c8 313c6: 79 c0 rjmp .+242 ; 0x314ba default: break; } return Buttons::NoButton; 313c8: 8f ef ldi r24, 0xFF ; 255 313ca: 08 95 ret // The list of responses which occur in mmu error dialogs // Return button index or perform some action on the MK3 by itself (like Reset MMU) // Based on Prusa-Error-Codes errors_list.h // So far hardcoded, but shall be generated in the future switch ( PrusaErrorCode(ei) ) { 313cc: 24 37 cpi r18, 0x74 ; 116 313ce: 31 05 cpc r19, r1 313d0: 09 f4 brne .+2 ; 0x313d4 313d2: 73 c0 rjmp .+230 ; 0x314ba 313d4: 2d 37 cpi r18, 0x7D ; 125 313d6: 31 05 cpc r19, r1 313d8: 19 f0 breq .+6 ; 0x313e0 313da: 23 37 cpi r18, 0x73 ; 115 313dc: 31 05 cpc r19, r1 313de: a1 f7 brne .-24 ; 0x313c8 break; } break; case ERR_MECHANICAL_SELECTOR_CANNOT_HOME: case ERR_MECHANICAL_IDLER_CANNOT_HOME: switch (buttonSelectedOperation) { 313e0: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> 313e4: 81 30 cpi r24, 0x01 ; 1 313e6: 09 f4 brne .+2 ; 0x313ea 313e8: 6d c0 rjmp .+218 ; 0x314c4 313ea: 87 30 cpi r24, 0x07 ; 7 313ec: 69 f7 brne .-38 ; 0x313c8 // may be allow move selector right and left in the future case ButtonOperations::Tune: // Tune Stallguard threshold return Buttons::TuneMMU; 313ee: 88 e0 ldi r24, 0x08 ; 8 313f0: 08 95 ret // The list of responses which occur in mmu error dialogs // Return button index or perform some action on the MK3 by itself (like Reset MMU) // Based on Prusa-Error-Codes errors_list.h // So far hardcoded, but shall be generated in the future switch ( PrusaErrorCode(ei) ) { 313f2: 23 3d cpi r18, 0xD3 ; 211 313f4: 31 05 cpc r19, r1 313f6: 09 f4 brne .+2 ; 0x313fa 313f8: 6e c0 rjmp .+220 ; 0x314d6 313fa: 50 f4 brcc .+20 ; 0x31410 313fc: 29 3c cpi r18, 0xC9 ; 201 313fe: 31 05 cpc r19, r1 31400: 09 f4 brne .+2 ; 0x31404 31402: 69 c0 rjmp .+210 ; 0x314d6 31404: 2a 3c cpi r18, 0xCA ; 202 31406: 31 05 cpc r19, r1 31408: f9 f6 brne .-66 ; 0x313c8 case ERR_ELECTRICAL_MMU_IDLER_SELFTEST_FAILED: case ERR_SYSTEM_QUEUE_FULL: case ERR_SYSTEM_FW_RUNTIME_ERROR: case ERR_ELECTRICAL_MMU_MCU_ERROR: switch (buttonSelectedOperation) { 3140a: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> 3140e: 67 c0 rjmp .+206 ; 0x314de // The list of responses which occur in mmu error dialogs // Return button index or perform some action on the MK3 by itself (like Reset MMU) // Based on Prusa-Error-Codes errors_list.h // So far hardcoded, but shall be generated in the future switch ( PrusaErrorCode(ei) ) { 31410: 2d 3d cpi r18, 0xDD ; 221 31412: 31 05 cpc r19, r1 31414: 09 f4 brne .+2 ; 0x31418 31416: 5f c0 rjmp .+190 ; 0x314d6 31418: 2e 3d cpi r18, 0xDE ; 222 3141a: 31 05 cpc r19, r1 3141c: b1 f3 breq .-20 ; 0x3140a 3141e: 24 3d cpi r18, 0xD4 ; 212 31420: 31 05 cpc r19, r1 31422: 91 f6 brne .-92 ; 0x313c8 31424: f2 cf rjmp .-28 ; 0x3140a 31426: 25 3f cpi r18, 0xF5 ; 245 31428: 81 e0 ldi r24, 0x01 ; 1 3142a: 38 07 cpc r19, r24 3142c: 09 f4 brne .+2 ; 0x31430 3142e: 5c c0 rjmp .+184 ; 0x314e8 31430: f8 f4 brcc .+62 ; 0x31470 31432: 26 34 cpi r18, 0x46 ; 70 31434: 81 e0 ldi r24, 0x01 ; 1 31436: 38 07 cpc r19, r24 31438: 58 f4 brcc .+22 ; 0x31450 3143a: 21 34 cpi r18, 0x41 ; 65 3143c: 81 e0 ldi r24, 0x01 ; 1 3143e: 38 07 cpc r19, r24 31440: 20 f7 brcc .-56 ; 0x3140a 31442: 27 53 subi r18, 0x37 ; 55 31444: 31 40 sbci r19, 0x01 ; 1 31446: 25 30 cpi r18, 0x05 ; 5 31448: 31 05 cpc r19, r1 3144a: 08 f0 brcs .+2 ; 0x3144e 3144c: bd cf rjmp .-134 ; 0x313c8 3144e: dd cf rjmp .-70 ; 0x3140a 31450: 21 59 subi r18, 0x91 ; 145 31452: 31 40 sbci r19, 0x01 ; 1 31454: 22 30 cpi r18, 0x02 ; 2 31456: 31 05 cpc r19, r1 31458: 08 f0 brcs .+2 ; 0x3145c 3145a: b6 cf rjmp .-148 ; 0x313c8 } break; case ERR_CONNECT_MMU_NOT_RESPONDING: case ERR_CONNECT_COMMUNICATION_ERROR: case ERR_SYSTEM_FW_UPDATE_NEEDED: switch (buttonSelectedOperation) { 3145c: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> 31460: 83 30 cpi r24, 0x03 ; 3 31462: 09 f4 brne .+2 ; 0x31466 31464: 3f c0 rjmp .+126 ; 0x314e4 31466: 89 30 cpi r24, 0x09 ; 9 31468: 09 f0 breq .+2 ; 0x3146c 3146a: ae cf rjmp .-164 ; 0x313c8 case ButtonOperations::DisableMMU: // "Disable" return Buttons::DisableMMU; 3146c: 87 e0 ldi r24, 0x07 ; 7 3146e: 08 95 ret // The list of responses which occur in mmu error dialogs // Return button index or perform some action on the MK3 by itself (like Reset MMU) // Based on Prusa-Error-Codes errors_list.h // So far hardcoded, but shall be generated in the future switch ( PrusaErrorCode(ei) ) { 31470: 29 3f cpi r18, 0xF9 ; 249 31472: 81 e0 ldi r24, 0x01 ; 1 31474: 38 07 cpc r19, r24 31476: 49 f2 breq .-110 ; 0x3140a 31478: 70 f4 brcc .+28 ; 0x31496 3147a: 27 3f cpi r18, 0xF7 ; 247 3147c: 81 e0 ldi r24, 0x01 ; 1 3147e: 38 07 cpc r19, r24 31480: 21 f2 breq .-120 ; 0x3140a 31482: 60 f7 brcc .-40 ; 0x3145c break; } break; case ERR_SYSTEM_INVALID_TOOL: switch (buttonSelectedOperation) { 31484: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> 31488: 83 30 cpi r24, 0x03 ; 3 3148a: 61 f1 breq .+88 ; 0x314e4 3148c: 88 30 cpi r24, 0x08 ; 8 3148e: 09 f0 breq .+2 ; 0x31492 31490: 9b cf rjmp .-202 ; 0x313c8 case ButtonOperations::StopPrint: // "Stop print" return Buttons::StopPrint; 31492: 86 e0 ldi r24, 0x06 ; 6 31494: 08 95 ret // The list of responses which occur in mmu error dialogs // Return button index or perform some action on the MK3 by itself (like Reset MMU) // Based on Prusa-Error-Codes errors_list.h // So far hardcoded, but shall be generated in the future switch ( PrusaErrorCode(ei) ) { 31496: 2b 3f cpi r18, 0xFB ; 251 31498: 81 e0 ldi r24, 0x01 ; 1 3149a: 38 07 cpc r19, r24 3149c: a9 f0 breq .+42 ; 0x314c8 3149e: 68 f0 brcs .+26 ; 0x314ba 314a0: 2c 3f cpi r18, 0xFC ; 252 314a2: 31 40 sbci r19, 0x01 ; 1 314a4: 09 f0 breq .+2 ; 0x314a8 314a6: 90 cf rjmp .-224 ; 0x313c8 default: break; } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { 314a8: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> 314ac: 85 30 cpi r24, 0x05 ; 5 314ae: 89 f0 breq .+34 ; 0x314d2 314b0: 86 30 cpi r24, 0x06 ; 6 314b2: 09 f0 breq .+2 ; 0x314b6 314b4: 89 cf rjmp .-238 ; 0x313c8 case ButtonOperations::Load: return Buttons::Load; case ButtonOperations::Eject: return Buttons::Eject; 314b6: 85 e0 ldi r24, 0x05 ; 5 314b8: 08 95 ret case ERR_MECHANICAL_INSPECT_FINDA: case ERR_MECHANICAL_SELECTOR_CANNOT_MOVE: case ERR_MECHANICAL_IDLER_CANNOT_MOVE: case ERR_MECHANICAL_PULLEY_CANNOT_MOVE: case ERR_SYSTEM_UNLOAD_MANUALLY: switch (buttonSelectedOperation) { 314ba: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> 314be: 81 30 cpi r24, 0x01 ; 1 314c0: 09 f0 breq .+2 ; 0x314c4 314c2: 82 cf rjmp .-252 ; 0x313c8 switch (buttonSelectedOperation) { // may be allow move selector right and left in the future case ButtonOperations::Tune: // Tune Stallguard threshold return Buttons::TuneMMU; case ButtonOperations::Retry: // "Repeat action" return Buttons::Middle; 314c4: 81 e0 ldi r24, 0x01 ; 1 314c6: 08 95 ret break; } break; case ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED: case ERR_SYSTEM_FILAMENT_EJECTED: switch (buttonSelectedOperation) { 314c8: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> 314cc: 82 30 cpi r24, 0x02 ; 2 314ce: d1 f3 breq .-12 ; 0x314c4 314d0: 7b cf rjmp .-266 ; 0x313c8 } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { case ButtonOperations::Load: return Buttons::Load; 314d2: 84 e0 ldi r24, 0x04 ; 4 314d4: 08 95 ret } break; case ERR_TEMPERATURE_WARNING_TMC_PULLEY_TOO_HOT: case ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT: case ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT: switch (buttonSelectedOperation) { 314d6: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> 314da: 82 30 cpi r24, 0x02 ; 2 314dc: 61 f0 breq .+24 ; 0x314f6 case ERR_ELECTRICAL_MMU_IDLER_SELFTEST_FAILED: case ERR_SYSTEM_QUEUE_FULL: case ERR_SYSTEM_FW_RUNTIME_ERROR: case ERR_ELECTRICAL_MMU_MCU_ERROR: switch (buttonSelectedOperation) { 314de: 83 30 cpi r24, 0x03 ; 3 314e0: 09 f0 breq .+2 ; 0x314e4 314e2: 72 cf rjmp .-284 ; 0x313c8 case ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT: switch (buttonSelectedOperation) { case ButtonOperations::Continue: // "Continue" return Buttons::Left; case ButtonOperations::ResetMMU: // "Reset MMU" return Buttons::ResetMMU; 314e4: 83 e0 ldi r24, 0x03 ; 3 default: break; } return Buttons::NoButton; } 314e6: 08 95 ret default: break; } break; case ERR_SYSTEM_FILAMENT_ALREADY_LOADED: switch (buttonSelectedOperation) { 314e8: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> 314ec: 82 30 cpi r24, 0x02 ; 2 314ee: 29 f0 breq .+10 ; 0x314fa 314f0: 84 30 cpi r24, 0x04 ; 4 314f2: 09 f0 breq .+2 ; 0x314f6 314f4: 69 cf rjmp .-302 ; 0x313c8 case ERR_TEMPERATURE_WARNING_TMC_PULLEY_TOO_HOT: case ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT: case ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT: switch (buttonSelectedOperation) { case ButtonOperations::Continue: // "Continue" return Buttons::Left; 314f6: 82 e0 ldi r24, 0x02 ; 2 314f8: 08 95 ret case ERR_SYSTEM_FILAMENT_ALREADY_LOADED: switch (buttonSelectedOperation) { case ButtonOperations::Unload: // "Unload" return Buttons::Left; case ButtonOperations::Continue: // "Proceed/Continue" return Buttons::Right; 314fa: 80 e0 ldi r24, 0x00 ; 0 314fc: 08 95 ret 000314fe (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.356]>: #endif namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { 314fe: cf 93 push r28 31500: df 93 push r29 31502: ec 01 movw r28, r24 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 31504: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 31508: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 3150c: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 31510: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 31514: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 31518: 20 91 f1 11 lds r18, 0x11F1 ; 0x8011f1 3151c: 30 91 f2 11 lds r19, 0x11F2 ; 0x8011f2 31520: c9 01 movw r24, r18 31522: 86 1b sub r24, r22 31524: 97 0b sbc r25, r23 31526: 06 97 sbiw r24, 0x06 ; 6 31528: 24 f0 brlt .+8 ; 0x31532 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.356]+0x34> void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 3152a: ce 01 movw r24, r28 3152c: 0e 94 48 7c call 0xf890 ; 0xf890 31530: e9 cf rjmp .-46 ; 0x31504 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.356]+0x6> f(); safe_delay_keep_alive(delay); } } 31532: df 91 pop r29 31534: cf 91 pop r28 31536: 08 95 ret 00031538 : } //parameter ix: index of mesh bed leveling point in X-axis (for meas_points == 7 is valid range from 0 to 6; for meas_points == 3 is valid range from 0 to 2 ) //parameter iy: index of mesh bed leveling point in Y-axis (for meas_points == 7 is valid range from 0 to 6; for meas_points == 3 is valid range from 0 to 2 ) //function returns true if point is considered valid (typicaly in safe distance from magnet or another object which inflences PINDA measurements) bool mbl_point_measurement_valid(uint8_t ix, uint8_t iy) { 31538: cf 93 push r28 3153a: df 93 push r29 3153c: 00 d0 rcall .+0 ; 0x3153e 3153e: 00 d0 rcall .+0 ; 0x31540 31540: 1f 92 push r1 31542: cd b7 in r28, 0x3d ; 61 31544: de b7 in r29, 0x3e ; 62 //"human readable" heatbed plan //magnet proximity influence Z coordinate measurements significantly (40 - 100 um) //0 - measurement point is above magnet and Z coordinate can be influenced negatively //1 - we should be in safe distance from magnets, measurement should be accurate if ((ix >= MESH_NUM_X_POINTS) || (iy >= MESH_NUM_Y_POINTS)) 31546: 87 30 cpi r24, 0x07 ; 7 31548: 50 f5 brcc .+84 ; 0x3159e 3154a: 67 30 cpi r22, 0x07 ; 7 3154c: 40 f5 brcc .+80 ; 0x3159e return false; uint8_t valid_points_mask[7] = { 3154e: 97 e0 ldi r25, 0x07 ; 7 31550: ed eb ldi r30, 0xBD ; 189 31552: f2 e0 ldi r31, 0x02 ; 2 31554: de 01 movw r26, r28 31556: 11 96 adiw r26, 0x01 ; 1 31558: 01 90 ld r0, Z+ 3155a: 0d 92 st X+, r0 3155c: 9a 95 dec r25 3155e: e1 f7 brne .-8 ; 0x31558 0b1110111,//2 0b1111111,//1 0b1111111,//0 //[0,0] }; return (valid_points_mask[6 - iy] & (1 << (6 - ix))); 31560: 46 e0 ldi r20, 0x06 ; 6 31562: 50 e0 ldi r21, 0x00 ; 0 31564: fa 01 movw r30, r20 31566: e6 1b sub r30, r22 31568: f1 09 sbc r31, r1 3156a: 21 e0 ldi r18, 0x01 ; 1 3156c: 30 e0 ldi r19, 0x00 ; 0 3156e: 2c 0f add r18, r28 31570: 3d 1f adc r19, r29 31572: e2 0f add r30, r18 31574: f3 1f adc r31, r19 31576: 20 81 ld r18, Z 31578: 30 e0 ldi r19, 0x00 ; 0 3157a: 48 1b sub r20, r24 3157c: 51 09 sbc r21, r1 3157e: c9 01 movw r24, r18 31580: 02 c0 rjmp .+4 ; 0x31586 31582: 95 95 asr r25 31584: 87 95 ror r24 31586: 4a 95 dec r20 31588: e2 f7 brpl .-8 ; 0x31582 3158a: 81 70 andi r24, 0x01 ; 1 } 3158c: 27 96 adiw r28, 0x07 ; 7 3158e: 0f b6 in r0, 0x3f ; 63 31590: f8 94 cli 31592: de bf out 0x3e, r29 ; 62 31594: 0f be out 0x3f, r0 ; 63 31596: cd bf out 0x3d, r28 ; 61 31598: df 91 pop r29 3159a: cf 91 pop r28 3159c: 08 95 ret //"human readable" heatbed plan //magnet proximity influence Z coordinate measurements significantly (40 - 100 um) //0 - measurement point is above magnet and Z coordinate can be influenced negatively //1 - we should be in safe distance from magnets, measurement should be accurate if ((ix >= MESH_NUM_X_POINTS) || (iy >= MESH_NUM_Y_POINTS)) return false; 3159e: 80 e0 ldi r24, 0x00 ; 0 315a0: f5 cf rjmp .-22 ; 0x3158c 000315a2 : #endif //NEW_XYZCAL // Shift a Z axis by a given delta. // To replace loading of the babystep correction. static void shift_z(float delta) { 315a2: 0f 93 push r16 315a4: 1f 93 push r17 315a6: cf 93 push r28 315a8: df 93 push r29 315aa: 00 d0 rcall .+0 ; 0x315ac 315ac: 1f 92 push r1 315ae: cd b7 in r28, 0x3d ; 61 315b0: de b7 in r29, 0x3e ; 62 315b2: 9b 01 movw r18, r22 315b4: ac 01 movw r20, r24 const float curpos_z = current_position[Z_AXIS]; 315b6: 05 ef ldi r16, 0xF5 ; 245 315b8: 11 e1 ldi r17, 0x11 ; 17 315ba: f8 01 movw r30, r16 315bc: 60 85 ldd r22, Z+8 ; 0x08 315be: 71 85 ldd r23, Z+9 ; 0x09 315c0: 82 85 ldd r24, Z+10 ; 0x0a 315c2: 93 85 ldd r25, Z+11 ; 0x0b 315c4: 69 83 std Y+1, r22 ; 0x01 315c6: 7a 83 std Y+2, r23 ; 0x02 315c8: 8b 83 std Y+3, r24 ; 0x03 315ca: 9c 83 std Y+4, r25 ; 0x04 current_position[Z_AXIS] -= delta; 315cc: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 315d0: f8 01 movw r30, r16 315d2: 60 87 std Z+8, r22 ; 0x08 315d4: 71 87 std Z+9, r23 ; 0x09 315d6: 82 87 std Z+10, r24 ; 0x0a 315d8: 93 87 std Z+11, r25 ; 0x0b plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 315da: 65 e5 ldi r22, 0x55 ; 85 315dc: 75 e5 ldi r23, 0x55 ; 85 315de: 85 e5 ldi r24, 0x55 ; 85 315e0: 91 e4 ldi r25, 0x41 ; 65 315e2: 0f 94 70 84 call 0x308e0 ; 0x308e0 st_synchronize(); 315e6: 0f 94 42 22 call 0x24484 ; 0x24484 current_position[Z_AXIS] = curpos_z; 315ea: 89 81 ldd r24, Y+1 ; 0x01 315ec: 9a 81 ldd r25, Y+2 ; 0x02 315ee: ab 81 ldd r26, Y+3 ; 0x03 315f0: bc 81 ldd r27, Y+4 ; 0x04 315f2: f8 01 movw r30, r16 315f4: 80 87 std Z+8, r24 ; 0x08 315f6: 91 87 std Z+9, r25 ; 0x09 315f8: a2 87 std Z+10, r26 ; 0x0a 315fa: b3 87 std Z+11, r27 ; 0x0b plan_set_z_position(curpos_z); 315fc: ce 01 movw r24, r28 315fe: 01 96 adiw r24, 0x01 ; 1 31600: 0f 94 fb 74 call 0x2e9f6 ; 0x2e9f6 } 31604: 0f 90 pop r0 31606: 0f 90 pop r0 31608: 0f 90 pop r0 3160a: 0f 90 pop r0 3160c: df 91 pop r29 3160e: cf 91 pop r28 31610: 1f 91 pop r17 31612: 0f 91 pop r16 31614: 08 95 ret 00031616 : shift_z(- float(babystepLoadZ) / float(cs.axis_steps_per_mm[Z_AXIS])); } void babystep_undo() { shift_z(float(babystepLoadZ) / float(cs.axis_steps_per_mm[Z_AXIS])); 31616: 60 91 29 05 lds r22, 0x0529 ; 0x800529 <_ZL13babystepLoadZ.lto_priv.459> 3161a: 70 91 2a 05 lds r23, 0x052A ; 0x80052a <_ZL13babystepLoadZ.lto_priv.459+0x1> 3161e: 07 2e mov r0, r23 31620: 00 0c add r0, r0 31622: 88 0b sbc r24, r24 31624: 99 0b sbc r25, r25 31626: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 3162a: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 3162e: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 31632: 40 91 40 04 lds r20, 0x0440 ; 0x800440 31636: 50 91 41 04 lds r21, 0x0441 ; 0x800441 3163a: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 3163e: 0f 94 d1 8a call 0x315a2 ; 0x315a2 babystepLoadZ = 0; 31642: 10 92 2a 05 sts 0x052A, r1 ; 0x80052a <_ZL13babystepLoadZ.lto_priv.459+0x1> 31646: 10 92 29 05 sts 0x0529, r1 ; 0x800529 <_ZL13babystepLoadZ.lto_priv.459> } 3164a: 08 95 ret 0003164c : return sampled; } void go_home_with_z_lift() { 3164c: cf 93 push r28 3164e: df 93 push r29 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 31650: 0e 94 c9 5f call 0xbf92 ; 0xbf92 // Go home. // First move up to a safe height. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 31654: c5 ef ldi r28, 0xF5 ; 245 31656: d1 e1 ldi r29, 0x11 ; 17 31658: 80 e0 ldi r24, 0x00 ; 0 3165a: 90 e0 ldi r25, 0x00 ; 0 3165c: a0 ea ldi r26, 0xA0 ; 160 3165e: b0 e4 ldi r27, 0x40 ; 64 31660: 88 87 std Y+8, r24 ; 0x08 31662: 99 87 std Y+9, r25 ; 0x09 31664: aa 87 std Y+10, r26 ; 0x0a 31666: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 31668: 65 e5 ldi r22, 0x55 ; 85 3166a: 75 e5 ldi r23, 0x55 ; 85 3166c: 85 e5 ldi r24, 0x55 ; 85 3166e: 91 e4 ldi r25, 0x41 ; 65 31670: 0f 94 22 87 call 0x30e44 ; 0x30e44 // Second move to XY [0, 0]. current_position[X_AXIS] = X_MIN_POS + 0.2; 31674: 8d ec ldi r24, 0xCD ; 205 31676: 9c ec ldi r25, 0xCC ; 204 31678: ac e4 ldi r26, 0x4C ; 76 3167a: be e3 ldi r27, 0x3E ; 62 3167c: 88 83 st Y, r24 3167e: 99 83 std Y+1, r25 ; 0x01 31680: aa 83 std Y+2, r26 ; 0x02 31682: bb 83 std Y+3, r27 ; 0x03 current_position[Y_AXIS] = Y_MIN_POS + 0.2; 31684: 83 e3 ldi r24, 0x33 ; 51 31686: 93 e3 ldi r25, 0x33 ; 51 31688: a3 e7 ldi r26, 0x73 ; 115 3168a: b0 ec ldi r27, 0xC0 ; 192 3168c: 8c 83 std Y+4, r24 ; 0x04 3168e: 9d 83 std Y+5, r25 ; 0x05 31690: ae 83 std Y+6, r26 ; 0x06 31692: bf 83 std Y+7, r27 ; 0x07 // Clamp to the physical coordinates. world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 31694: 69 ef ldi r22, 0xF9 ; 249 31696: 71 e1 ldi r23, 0x11 ; 17 31698: ce 01 movw r24, r28 3169a: 0e 94 a6 63 call 0xc74c ; 0xc74c go_to_current((3 * homing_feedrate[X_AXIS]) / 60); 3169e: 60 e0 ldi r22, 0x00 ; 0 316a0: 70 e0 ldi r23, 0x00 ; 0 316a2: 86 e1 ldi r24, 0x16 ; 22 316a4: 93 e4 ldi r25, 0x43 ; 67 316a6: 0f 94 22 87 call 0x30e44 ; 0x30e44 // Third move up to a safe height. current_position[Z_AXIS] = Z_MIN_POS; 316aa: 8a e9 ldi r24, 0x9A ; 154 316ac: 99 e9 ldi r25, 0x99 ; 153 316ae: a9 e1 ldi r26, 0x19 ; 25 316b0: be e3 ldi r27, 0x3E ; 62 316b2: 88 87 std Y+8, r24 ; 0x08 316b4: 99 87 std Y+9, r25 ; 0x09 316b6: aa 87 std Y+10, r26 ; 0x0a 316b8: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 316ba: 65 e5 ldi r22, 0x55 ; 85 316bc: 75 e5 ldi r23, 0x55 ; 85 316be: 85 e5 ldi r24, 0x55 ; 85 316c0: 91 e4 ldi r25, 0x41 ; 65 } 316c2: df 91 pop r29 316c4: cf 91 pop r28 // Clamp to the physical coordinates. world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); go_to_current((3 * homing_feedrate[X_AXIS]) / 60); // Third move up to a safe height. current_position[Z_AXIS] = Z_MIN_POS; go_to_current(homing_feedrate[Z_AXIS] / 60); 316c6: 0d 94 22 87 jmp 0x30e44 ; 0x30e44 000316ca : #define MESH_BED_CALIBRATION_SHOW_LCD float __attribute__((noinline)) BED_X(const uint8_t col) { return ((float)col * x_mesh_density + BED_X0); 316ca: 68 2f mov r22, r24 316cc: 70 e0 ldi r23, 0x00 ; 0 316ce: 90 e0 ldi r25, 0x00 ; 0 316d0: 80 e0 ldi r24, 0x00 ; 0 316d2: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 316d6: 20 e0 ldi r18, 0x00 ; 0 316d8: 30 e0 ldi r19, 0x00 ; 0 316da: 48 e0 ldi r20, 0x08 ; 8 316dc: 52 e4 ldi r21, 0x42 ; 66 316de: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 316e2: 20 e0 ldi r18, 0x00 ; 0 316e4: 30 e0 ldi r19, 0x00 ; 0 316e6: 40 e8 ldi r20, 0x80 ; 128 316e8: 5f e3 ldi r21, 0x3F ; 63 316ea: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> } 316ee: 08 95 ret 000316f0 : // Sample the 9 points of the bed and store them into the EEPROM as a reference. // When calling this function, the X, Y, Z axes should be already homed, // and the world2machine correction matrix should be active. // Returns false if the reference values are more than 3mm far away. bool sample_mesh_and_store_reference() { 316f0: 2f 92 push r2 316f2: 3f 92 push r3 316f4: 4f 92 push r4 316f6: 5f 92 push r5 316f8: 6f 92 push r6 316fa: 7f 92 push r7 316fc: 8f 92 push r8 316fe: 9f 92 push r9 31700: af 92 push r10 31702: bf 92 push r11 31704: cf 92 push r12 31706: df 92 push r13 31708: ef 92 push r14 3170a: ff 92 push r15 3170c: 0f 93 push r16 3170e: 1f 93 push r17 31710: cf 93 push r28 31712: df 93 push r29 31714: 00 d0 rcall .+0 ; 0x31716 31716: 00 d0 rcall .+0 ; 0x31718 31718: cd b7 in r28, 0x3d ; 61 3171a: de b7 in r29, 0x3e ; 62 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 3171c: 80 91 77 02 lds r24, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.364> 31720: 8c 83 std Y+4, r24 ; 0x04 check_endstops = check; 31722: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.364> bool result = false; #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif bool endstops_enabled = enable_endstops(false); bool endstop_z_enabled = enable_z_endstop(false); 31726: 80 e0 ldi r24, 0x00 ; 0 31728: 0f 94 7a 2c call 0x258f4 ; 0x258f4 3172c: 8b 83 std Y+3, r24 ; 0x03 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 3172e: 0e 94 c9 5f call 0xbf92 ; 0xbf92 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 31732: 82 ed ldi r24, 0xD2 ; 210 31734: 97 e4 ldi r25, 0x47 ; 71 31736: 0e 94 b1 6c call 0xd962 ; 0xd962 3173a: 0f 94 c0 0a call 0x21580 ; 0x21580 // display "point xx of yy" lcd_puts_at_P(0,3,_n("1/9")); 3173e: 49 e3 ldi r20, 0x39 ; 57 31740: 5c e6 ldi r21, 0x6C ; 108 31742: 63 e0 ldi r22, 0x03 ; 3 31744: 80 e0 ldi r24, 0x00 ; 0 31746: 0e 94 8f 69 call 0xd31e ; 0xd31e 3174a: 81 e0 ldi r24, 0x01 ; 1 3174c: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.364> // Sample Z heights for the mesh bed leveling. // In addition, store the results into an eeprom, to be used later for verification of the bed leveling process. { // Lower Z to the mesh search height with stall detection enable_endstops(true); current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 31750: 80 e0 ldi r24, 0x00 ; 0 31752: 90 e0 ldi r25, 0x00 ; 0 31754: a0 ea ldi r26, 0xA0 ; 160 31756: b0 e4 ldi r27, 0x40 ; 64 31758: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 3175c: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 31760: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 31764: b0 93 00 12 sts 0x1200, r27 ; 0x801200 go_to_current(homing_feedrate[Z_AXIS]/60); 31768: 65 e5 ldi r22, 0x55 ; 85 3176a: 75 e5 ldi r23, 0x55 ; 85 3176c: 85 e5 ldi r24, 0x55 ; 85 3176e: 91 e4 ldi r25, 0x41 ; 65 31770: 0f 94 22 87 call 0x30e44 ; 0x30e44 31774: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.364> check_Z_crash(); #endif enable_endstops(false); // Move XY to first point current_position[X_AXIS] = BED_X0; 31778: 80 e0 ldi r24, 0x00 ; 0 3177a: 90 e0 ldi r25, 0x00 ; 0 3177c: a0 e8 ldi r26, 0x80 ; 128 3177e: bf e3 ldi r27, 0x3F ; 63 31780: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 31784: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 31788: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 3178c: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = BED_Y0; 31790: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 31794: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 31798: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 3179c: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 317a0: 69 ef ldi r22, 0xF9 ; 249 317a2: 71 e1 ldi r23, 0x11 ; 17 317a4: 85 ef ldi r24, 0xF5 ; 245 317a6: 91 e1 ldi r25, 0x11 ; 17 317a8: 0e 94 a6 63 call 0xc74c ; 0xc74c go_to_current(homing_feedrate[X_AXIS]/60); 317ac: 60 e0 ldi r22, 0x00 ; 0 317ae: 70 e0 ldi r23, 0x00 ; 0 317b0: 88 e4 ldi r24, 0x48 ; 72 317b2: 92 e4 ldi r25, 0x42 ; 66 317b4: 0f 94 22 87 call 0x30e44 ; 0x30e44 set_destination_to_current(); 317b8: 0e 94 36 61 call 0xc26c ; 0xc26c homeaxis(Z_AXIS); 317bc: 82 e0 ldi r24, 0x02 ; 2 317be: 0f 94 bc 53 call 0x2a778 ; 0x2a778 if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 317c2: 43 e0 ldi r20, 0x03 ; 3 317c4: 60 e0 ldi r22, 0x00 ; 0 317c6: 70 e0 ldi r23, 0x00 ; 0 317c8: 80 e2 ldi r24, 0x20 ; 32 317ca: 91 ec ldi r25, 0xC1 ; 193 317cc: 0f 94 fb 55 call 0x2abf6 ; 0x2abf6 317d0: 81 11 cpse r24, r1 317d2: 06 c0 rjmp .+12 ; 0x317e0 lcd_set_cursor(0, 3); lcd_printf_P(PSTR("%d/9"),mesh_point+1); #endif /* MESH_BED_CALIBRATION_SHOW_LCD */ if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um { kill(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); 317d4: 87 e2 ldi r24, 0x27 ; 39 317d6: 92 e6 ldi r25, 0x62 ; 98 317d8: 0e 94 b1 6c call 0xd962 ; 0xd962 317dc: 0e 94 df 72 call 0xe5be ; 0xe5be float get_z(float x, float y); void set_z(uint8_t ix, uint8_t iy, float z) { z_values[iy][ix] = z; } 317e0: 80 91 fd 11 lds r24, 0x11FD ; 0x8011fd 317e4: 90 91 fe 11 lds r25, 0x11FE ; 0x8011fe 317e8: a0 91 ff 11 lds r26, 0x11FF ; 0x8011ff 317ec: b0 91 00 12 lds r27, 0x1200 ; 0x801200 317f0: 80 93 9d 12 sts 0x129D, r24 ; 0x80129d 317f4: 90 93 9e 12 sts 0x129E, r25 ; 0x80129e 317f8: a0 93 9f 12 sts 0x129F, r26 ; 0x80129f 317fc: b0 93 a0 12 sts 0x12A0, r27 ; 0x8012a0 31800: e2 e0 ldi r30, 0x02 ; 2 31802: f0 e0 ldi r31, 0x00 ; 0 31804: fa 83 std Y+2, r31 ; 0x02 31806: e9 83 std Y+1, r30 ; 0x01 static_assert(MESH_MEAS_NUM_X_POINTS * MESH_MEAS_NUM_Y_POINTS <= 255, "overflow....."); for (uint8_t mesh_point = 1; mesh_point != MESH_MEAS_NUM_X_POINTS * MESH_MEAS_NUM_Y_POINTS; ++ mesh_point) { // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); // Print the decrasing ID of the measurement point. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 31808: c1 2c mov r12, r1 3180a: d1 2c mov r13, r1 3180c: 30 ea ldi r19, 0xA0 ; 160 3180e: e3 2e mov r14, r19 31810: 30 e4 ldi r19, 0x40 ; 64 31812: f3 2e mov r15, r19 go_to_current(homing_feedrate[Z_AXIS]/60); uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 31814: 43 e0 ldi r20, 0x03 ; 3 31816: b4 2e mov r11, r20 uint8_t iy = mesh_point / MESH_MEAS_NUM_X_POINTS; if (iy & 1) ix = (MESH_MEAS_NUM_X_POINTS - 1) - ix; // Zig zag 31818: 52 e0 ldi r21, 0x02 ; 2 3181a: 95 2e mov r9, r21 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); go_to_current(homing_feedrate[X_AXIS]/60); #ifdef MESH_BED_CALIBRATION_SHOW_LCD // display "point xx of yy" lcd_set_cursor(0, 3); lcd_printf_P(PSTR("%d/9"),mesh_point+1); 3181c: 0f e9 ldi r16, 0x9F ; 159 3181e: 1d e9 ldi r17, 0x9D ; 157 31820: 67 e0 ldi r22, 0x07 ; 7 31822: a6 2e mov r10, r22 mbl.set_z(0, 0, current_position[Z_AXIS]); } static_assert(MESH_MEAS_NUM_X_POINTS * MESH_MEAS_NUM_Y_POINTS <= 255, "overflow....."); for (uint8_t mesh_point = 1; mesh_point != MESH_MEAS_NUM_X_POINTS * MESH_MEAS_NUM_Y_POINTS; ++ mesh_point) { // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 31824: 0e 94 c9 5f call 0xbf92 ; 0xbf92 // Print the decrasing ID of the measurement point. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 31828: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 3182c: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 31830: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 31834: f0 92 00 12 sts 0x1200, r15 ; 0x801200 go_to_current(homing_feedrate[Z_AXIS]/60); 31838: 65 e5 ldi r22, 0x55 ; 85 3183a: 75 e5 ldi r23, 0x55 ; 85 3183c: 85 e5 ldi r24, 0x55 ; 85 3183e: 91 e4 ldi r25, 0x41 ; 65 31840: 0f 94 22 87 call 0x30e44 ; 0x30e44 uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 31844: 29 81 ldd r18, Y+1 ; 0x01 31846: 21 50 subi r18, 0x01 ; 1 31848: 82 2f mov r24, r18 3184a: 6b 2d mov r22, r11 3184c: 0f 94 8b a0 call 0x34116 ; 0x34116 <__udivmodqi4> 31850: 89 2e mov r8, r25 uint8_t iy = mesh_point / MESH_MEAS_NUM_X_POINTS; 31852: 82 2f mov r24, r18 31854: 0f 94 97 a0 call 0x3412e ; 0x3412e <__divmodqi4> 31858: 78 2e mov r7, r24 if (iy & 1) ix = (MESH_MEAS_NUM_X_POINTS - 1) - ix; // Zig zag 3185a: 80 ff sbrs r24, 0 3185c: 03 c0 rjmp .+6 ; 0x31864 3185e: f9 2d mov r31, r9 31860: f8 19 sub r31, r8 31862: 8f 2e mov r8, r31 current_position[X_AXIS] = BED_X(ix * 3); 31864: 88 2d mov r24, r8 31866: 88 0f add r24, r24 31868: 88 0d add r24, r8 3186a: 0f 94 65 8b call 0x316ca ; 0x316ca 3186e: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 31872: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 31876: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 3187a: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 current_position[Y_AXIS] = BED_Y(iy * 3); 3187e: 87 2d mov r24, r7 31880: 88 0f add r24, r24 31882: 87 0d add r24, r7 31884: 0f 94 65 8b call 0x316ca ; 0x316ca 31888: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 3188c: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 31890: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 31894: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 31898: 69 ef ldi r22, 0xF9 ; 249 3189a: 71 e1 ldi r23, 0x11 ; 17 3189c: 85 ef ldi r24, 0xF5 ; 245 3189e: 91 e1 ldi r25, 0x11 ; 17 318a0: 0e 94 a6 63 call 0xc74c ; 0xc74c go_to_current(homing_feedrate[X_AXIS]/60); 318a4: 60 e0 ldi r22, 0x00 ; 0 318a6: 70 e0 ldi r23, 0x00 ; 0 318a8: 88 e4 ldi r24, 0x48 ; 72 318aa: 92 e4 ldi r25, 0x42 ; 66 318ac: 0f 94 22 87 call 0x30e44 ; 0x30e44 #ifdef MESH_BED_CALIBRATION_SHOW_LCD // display "point xx of yy" lcd_set_cursor(0, 3); 318b0: 63 e0 ldi r22, 0x03 ; 3 318b2: 80 e0 ldi r24, 0x00 ; 0 318b4: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_printf_P(PSTR("%d/9"),mesh_point+1); 318b8: 8a 81 ldd r24, Y+2 ; 0x02 318ba: 8f 93 push r24 318bc: 99 81 ldd r25, Y+1 ; 0x01 318be: 9f 93 push r25 318c0: 1f 93 push r17 318c2: 0f 93 push r16 318c4: 0e 94 54 69 call 0xd2a8 ; 0xd2a8 #endif /* MESH_BED_CALIBRATION_SHOW_LCD */ if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 318c8: 43 e0 ldi r20, 0x03 ; 3 318ca: 60 e0 ldi r22, 0x00 ; 0 318cc: 70 e0 ldi r23, 0x00 ; 0 318ce: 80 e2 ldi r24, 0x20 ; 32 318d0: 91 ec ldi r25, 0xC1 ; 193 318d2: 0f 94 fb 55 call 0x2abf6 ; 0x2abf6 318d6: 58 2e mov r5, r24 318d8: 0f 90 pop r0 318da: 0f 90 pop r0 318dc: 0f 90 pop r0 318de: 0f 90 pop r0 318e0: 88 23 and r24, r24 318e2: 09 f4 brne .+2 ; 0x318e6 318e4: 77 cf rjmp .-274 ; 0x317d4 318e6: a7 9c mul r10, r7 318e8: f0 01 movw r30, r0 318ea: 11 24 eor r1, r1 318ec: e8 0d add r30, r8 318ee: f1 1d adc r31, r1 318f0: ee 0f add r30, r30 318f2: ff 1f adc r31, r31 318f4: ee 0f add r30, r30 318f6: ff 1f adc r31, r31 318f8: e4 56 subi r30, 0x64 ; 100 318fa: fd 4e sbci r31, 0xED ; 237 318fc: 80 91 fd 11 lds r24, 0x11FD ; 0x8011fd 31900: 90 91 fe 11 lds r25, 0x11FE ; 0x8011fe 31904: a0 91 ff 11 lds r26, 0x11FF ; 0x8011ff 31908: b0 91 00 12 lds r27, 0x1200 ; 0x801200 3190c: 81 83 std Z+1, r24 ; 0x01 3190e: 92 83 std Z+2, r25 ; 0x02 31910: a3 83 std Z+3, r26 ; 0x03 31912: b4 83 std Z+4, r27 ; 0x04 31914: e9 81 ldd r30, Y+1 ; 0x01 31916: fa 81 ldd r31, Y+2 ; 0x02 31918: 31 96 adiw r30, 0x01 ; 1 3191a: fa 83 std Y+2, r31 ; 0x02 3191c: e9 83 std Y+1, r30 ; 0x01 kill(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); } mbl.set_z(0, 0, current_position[Z_AXIS]); } static_assert(MESH_MEAS_NUM_X_POINTS * MESH_MEAS_NUM_Y_POINTS <= 255, "overflow....."); for (uint8_t mesh_point = 1; mesh_point != MESH_MEAS_NUM_X_POINTS * MESH_MEAS_NUM_Y_POINTS; ++ mesh_point) { 3191e: 3a 97 sbiw r30, 0x0a ; 10 31920: 09 f0 breq .+2 ; 0x31924 31922: 80 cf rjmp .-256 ; 0x31824 mbl.set_z(ix, iy, current_position[Z_AXIS]); } { // Verify the span of the Z values. float zmin = mbl.z_values[0][0]; 31924: 60 90 9d 12 lds r6, 0x129D ; 0x80129d 31928: 70 90 9e 12 lds r7, 0x129E ; 0x80129e 3192c: 80 90 9f 12 lds r8, 0x129F ; 0x80129f 31930: 90 90 a0 12 lds r9, 0x12A0 ; 0x8012a0 float zmax = zmin; 31934: 46 2c mov r4, r6 31936: a7 2c mov r10, r7 31938: b8 2c mov r11, r8 3193a: 29 2c mov r2, r9 mbl.set_z(ix, iy, current_position[Z_AXIS]); } { // Verify the span of the Z values. float zmin = mbl.z_values[0][0]; 3193c: 1e 82 std Y+6, r1 ; 0x06 3193e: 1d 82 std Y+5, r1 ; 0x05 31940: 0c e9 ldi r16, 0x9C ; 156 31942: 12 e1 ldi r17, 0x12 ; 18 31944: 8d 81 ldd r24, Y+5 ; 0x05 31946: 9e 81 ldd r25, Y+6 ; 0x06 31948: 83 56 subi r24, 0x63 ; 99 3194a: 9d 4e sbci r25, 0xED ; 237 3194c: 9a 83 std Y+2, r25 ; 0x02 3194e: 89 83 std Y+1, r24 ; 0x01 31950: 93 e0 ldi r25, 0x03 ; 3 31952: 39 2e mov r3, r25 float zmax = zmin; for (int8_t j = 0; j < 3; ++ j) for (int8_t i = 0; i < 3; ++ i) { zmin = min(zmin, mbl.z_values[j][i]); 31954: e9 81 ldd r30, Y+1 ; 0x01 31956: fa 81 ldd r31, Y+2 ; 0x02 31958: c1 90 ld r12, Z+ 3195a: d1 90 ld r13, Z+ 3195c: e1 90 ld r14, Z+ 3195e: f1 90 ld r15, Z+ 31960: fa 83 std Y+2, r31 ; 0x02 31962: e9 83 std Y+1, r30 ; 0x01 31964: 93 01 movw r18, r6 31966: a4 01 movw r20, r8 31968: c7 01 movw r24, r14 3196a: b6 01 movw r22, r12 3196c: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 31970: 18 16 cp r1, r24 31972: 14 f0 brlt .+4 ; 0x31978 31974: 36 01 movw r6, r12 31976: 47 01 movw r8, r14 zmax = max(zmax, mbl.z_values[j][i]); 31978: 24 2d mov r18, r4 3197a: 3a 2d mov r19, r10 3197c: 4b 2d mov r20, r11 3197e: 52 2d mov r21, r2 31980: c7 01 movw r24, r14 31982: b6 01 movw r22, r12 31984: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 31988: 87 fd sbrc r24, 7 3198a: 04 c0 rjmp .+8 ; 0x31994 3198c: 4c 2c mov r4, r12 3198e: ad 2c mov r10, r13 31990: be 2c mov r11, r14 31992: 2f 2c mov r2, r15 31994: 3a 94 dec r3 { // Verify the span of the Z values. float zmin = mbl.z_values[0][0]; float zmax = zmin; for (int8_t j = 0; j < 3; ++ j) for (int8_t i = 0; i < 3; ++ i) { 31996: 31 10 cpse r3, r1 31998: dd cf rjmp .-70 ; 0x31954 3199a: 8d 81 ldd r24, Y+5 ; 0x05 3199c: 9e 81 ldd r25, Y+6 ; 0x06 3199e: 4c 96 adiw r24, 0x1c ; 28 319a0: 9e 83 std Y+6, r25 ; 0x06 319a2: 8d 83 std Y+5, r24 ; 0x05 } { // Verify the span of the Z values. float zmin = mbl.z_values[0][0]; float zmax = zmin; for (int8_t j = 0; j < 3; ++ j) 319a4: 84 35 cpi r24, 0x54 ; 84 319a6: 91 05 cpc r25, r1 319a8: 59 f6 brne .-106 ; 0x31940 for (int8_t i = 0; i < 3; ++ i) { zmin = min(zmin, mbl.z_values[j][i]); zmax = max(zmax, mbl.z_values[j][i]); } if (zmax - zmin > 3.f) { 319aa: 93 01 movw r18, r6 319ac: a4 01 movw r20, r8 319ae: 64 2d mov r22, r4 319b0: 7a 2d mov r23, r10 319b2: 8b 2d mov r24, r11 319b4: 92 2d mov r25, r2 319b6: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 319ba: 20 e0 ldi r18, 0x00 ; 0 319bc: 30 e0 ldi r19, 0x00 ; 0 319be: 40 e4 ldi r20, 0x40 ; 64 319c0: 50 e4 ldi r21, 0x40 ; 64 319c2: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 319c6: 18 16 cp r1, r24 319c8: 2c f5 brge .+74 ; 0x31a14 // The span of the Z offsets is extreme. Give up. // Homing failed on some of the points. SERIAL_PROTOCOLLNPGM("Exreme span of the Z values!"); 319ca: 82 e8 ldi r24, 0x82 ; 130 319cc: 9d e9 ldi r25, 0x9D ; 157 319ce: 0e 94 53 72 call 0xe4a6 ; 0xe4a6 // When calling this function, the X, Y, Z axes should be already homed, // and the world2machine correction matrix should be active. // Returns false if the reference values are more than 3mm far away. bool sample_mesh_and_store_reference() { bool result = false; 319d2: 51 2c mov r5, r1 319d4: fc 81 ldd r31, Y+4 ; 0x04 319d6: f0 93 77 02 sts 0x0277, r31 ; 0x800277 <_ZL14check_endstops.lto_priv.364> go_home_with_z_lift(); result = true; end: enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 319da: 8b 81 ldd r24, Y+3 ; 0x03 319dc: 0f 94 7a 2c call 0x258f4 ; 0x258f4 #ifdef TMC2130 tmc2130_home_exit(); #endif return result; } 319e0: 85 2d mov r24, r5 319e2: 26 96 adiw r28, 0x06 ; 6 319e4: 0f b6 in r0, 0x3f ; 63 319e6: f8 94 cli 319e8: de bf out 0x3e, r29 ; 62 319ea: 0f be out 0x3f, r0 ; 63 319ec: cd bf out 0x3d, r28 ; 61 319ee: df 91 pop r29 319f0: cf 91 pop r28 319f2: 1f 91 pop r17 319f4: 0f 91 pop r16 319f6: ff 90 pop r15 319f8: ef 90 pop r14 319fa: df 90 pop r13 319fc: cf 90 pop r12 319fe: bf 90 pop r11 31a00: af 90 pop r10 31a02: 9f 90 pop r9 31a04: 8f 90 pop r8 31a06: 7f 90 pop r7 31a08: 6f 90 pop r6 31a0a: 5f 90 pop r5 31a0c: 4f 90 pop r4 31a0e: 3f 90 pop r3 31a10: 2f 90 pop r2 31a12: 08 95 ret // Store the correction values to EEPROM. // Offsets of the Z heiths of the calibration points from the first point. // The offsets are saved as 16bit signed int, scaled to tenths of microns. { uint16_t addr = EEPROM_BED_CALIBRATION_Z_JITTER; for (int8_t j = 0; j < 3; ++ j) 31a14: 19 82 std Y+1, r1 ; 0x01 // Store the correction values to EEPROM. // Offsets of the Z heiths of the calibration points from the first point. // The offsets are saved as 16bit signed int, scaled to tenths of microns. { uint16_t addr = EEPROM_BED_CALIBRATION_Z_JITTER; 31a16: 85 ec ldi r24, 0xC5 ; 197 31a18: e8 2e mov r14, r24 31a1a: 8f e0 ldi r24, 0x0F ; 15 31a1c: f8 2e mov r15, r24 31a1e: 68 01 movw r12, r16 for (int8_t j = 0; j < 3; ++ j) for (int8_t i = 0; i < 3; ++ i) { 31a20: 1d 82 std Y+5, r1 ; 0x05 if (i == 0 && j == 0) 31a22: 9d 81 ldd r25, Y+5 ; 0x05 31a24: 91 11 cpse r25, r1 31a26: 03 c0 rjmp .+6 ; 0x31a2e 31a28: e9 81 ldd r30, Y+1 ; 0x01 31a2a: ee 23 and r30, r30 31a2c: 29 f1 breq .+74 ; 0x31a78 continue; float dif = mbl.z_values[j][i] - mbl.z_values[0][0]; 31a2e: 20 91 9d 12 lds r18, 0x129D ; 0x80129d 31a32: 30 91 9e 12 lds r19, 0x129E ; 0x80129e 31a36: 40 91 9f 12 lds r20, 0x129F ; 0x80129f 31a3a: 50 91 a0 12 lds r21, 0x12A0 ; 0x8012a0 31a3e: f6 01 movw r30, r12 31a40: 61 81 ldd r22, Z+1 ; 0x01 31a42: 72 81 ldd r23, Z+2 ; 0x02 31a44: 83 81 ldd r24, Z+3 ; 0x03 31a46: 94 81 ldd r25, Z+4 ; 0x04 31a48: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> int16_t dif_quantized = int16_t(floor(dif * 100.f + 0.5f)); 31a4c: 20 e0 ldi r18, 0x00 ; 0 31a4e: 30 e0 ldi r19, 0x00 ; 0 31a50: 48 ec ldi r20, 0xC8 ; 200 31a52: 52 e4 ldi r21, 0x42 ; 66 31a54: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 31a58: 20 e0 ldi r18, 0x00 ; 0 31a5a: 30 e0 ldi r19, 0x00 ; 0 31a5c: 40 e0 ldi r20, 0x00 ; 0 31a5e: 5f e3 ldi r21, 0x3F ; 63 31a60: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 31a64: 0f 94 ab a2 call 0x34556 ; 0x34556 31a68: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 31a6c: c7 01 movw r24, r14 31a6e: 0f 94 1e a0 call 0x3403c ; 0x3403c SERIAL_ECHOPGM(", read: "); MYSERIAL.print(dif2, 5); SERIAL_ECHOLNPGM(""); } #endif addr += 2; 31a72: f2 e0 ldi r31, 0x02 ; 2 31a74: ef 0e add r14, r31 31a76: f1 1c adc r15, r1 31a78: 84 e0 ldi r24, 0x04 ; 4 31a7a: c8 0e add r12, r24 31a7c: d1 1c adc r13, r1 31a7e: 9d 81 ldd r25, Y+5 ; 0x05 31a80: 9f 5f subi r25, 0xFF ; 255 31a82: 9d 83 std Y+5, r25 ; 0x05 // Offsets of the Z heiths of the calibration points from the first point. // The offsets are saved as 16bit signed int, scaled to tenths of microns. { uint16_t addr = EEPROM_BED_CALIBRATION_Z_JITTER; for (int8_t j = 0; j < 3; ++ j) for (int8_t i = 0; i < 3; ++ i) { 31a84: 93 30 cpi r25, 0x03 ; 3 31a86: 69 f6 brne .-102 ; 0x31a22 31a88: 04 5e subi r16, 0xE4 ; 228 31a8a: 1f 4f sbci r17, 0xFF ; 255 31a8c: e9 81 ldd r30, Y+1 ; 0x01 31a8e: ef 5f subi r30, 0xFF ; 255 31a90: e9 83 std Y+1, r30 ; 0x01 // Store the correction values to EEPROM. // Offsets of the Z heiths of the calibration points from the first point. // The offsets are saved as 16bit signed int, scaled to tenths of microns. { uint16_t addr = EEPROM_BED_CALIBRATION_Z_JITTER; for (int8_t j = 0; j < 3; ++ j) 31a92: e3 30 cpi r30, 0x03 ; 3 31a94: 21 f6 brne .-120 ; 0x31a1e #endif addr += 2; } } mbl.reset(); 31a96: 0f 94 f1 55 call 0x2abe2 ; 0x2abe2 go_home_with_z_lift(); 31a9a: 0f 94 26 8b call 0x3164c ; 0x3164c 31a9e: 9a cf rjmp .-204 ; 0x319d4 00031aa0 : plan_set_position_curposXYZE(); } static inline void update_current_position_z() { current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 31aa0: 82 e0 ldi r24, 0x02 ; 2 31aa2: 0f 94 2e 22 call 0x2445c ; 0x2445c 31aa6: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 31aaa: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 31aae: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 31ab2: 90 93 00 12 sts 0x1200, r25 ; 0x801200 plan_set_z_position(current_position[Z_AXIS]); 31ab6: 8d ef ldi r24, 0xFD ; 253 31ab8: 91 e1 ldi r25, 0x11 ; 17 31aba: 0d 94 fb 74 jmp 0x2e9f6 ; 0x2e9f6 00031abe : * this will get the absolute coordinates from the servos, * applies the inverse world2machine transformation * and stores the result into current_position[x,y]. */ void world2machine_update_current() { 31abe: 4f 92 push r4 31ac0: 5f 92 push r5 31ac2: 6f 92 push r6 31ac4: 7f 92 push r7 31ac6: 8f 92 push r8 31ac8: 9f 92 push r9 31aca: af 92 push r10 31acc: bf 92 push r11 31ace: cf 92 push r12 31ad0: df 92 push r13 31ad2: ef 92 push r14 31ad4: ff 92 push r15 31ad6: 0f 93 push r16 31ad8: 1f 93 push r17 31ada: cf 93 push r28 31adc: df 93 push r29 float x = current_position[X_AXIS] - world2machine_shift[0]; 31ade: 05 ef ldi r16, 0xF5 ; 245 31ae0: 11 e1 ldi r17, 0x11 ; 17 31ae2: c4 ed ldi r28, 0xD4 ; 212 31ae4: d6 e1 ldi r29, 0x16 ; 22 31ae6: 28 81 ld r18, Y 31ae8: 39 81 ldd r19, Y+1 ; 0x01 31aea: 4a 81 ldd r20, Y+2 ; 0x02 31aec: 5b 81 ldd r21, Y+3 ; 0x03 31aee: f8 01 movw r30, r16 31af0: 60 81 ld r22, Z 31af2: 71 81 ldd r23, Z+1 ; 0x01 31af4: 82 81 ldd r24, Z+2 ; 0x02 31af6: 93 81 ldd r25, Z+3 ; 0x03 31af8: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 31afc: 4b 01 movw r8, r22 31afe: 5c 01 movw r10, r24 float y = current_position[Y_AXIS] - world2machine_shift[1]; 31b00: 2c 81 ldd r18, Y+4 ; 0x04 31b02: 3d 81 ldd r19, Y+5 ; 0x05 31b04: 4e 81 ldd r20, Y+6 ; 0x06 31b06: 5f 81 ldd r21, Y+7 ; 0x07 31b08: f8 01 movw r30, r16 31b0a: 64 81 ldd r22, Z+4 ; 0x04 31b0c: 75 81 ldd r23, Z+5 ; 0x05 31b0e: 86 81 ldd r24, Z+6 ; 0x06 31b10: 97 81 ldd r25, Z+7 ; 0x07 31b12: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 31b16: 6b 01 movw r12, r22 31b18: 7c 01 movw r14, r24 current_position[X_AXIS] = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; 31b1a: c4 ec ldi r28, 0xC4 ; 196 31b1c: d6 e1 ldi r29, 0x16 ; 22 31b1e: 28 81 ld r18, Y 31b20: 39 81 ldd r19, Y+1 ; 0x01 31b22: 4a 81 ldd r20, Y+2 ; 0x02 31b24: 5b 81 ldd r21, Y+3 ; 0x03 31b26: c5 01 movw r24, r10 31b28: b4 01 movw r22, r8 31b2a: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 31b2e: 2b 01 movw r4, r22 31b30: 3c 01 movw r6, r24 31b32: 2c 81 ldd r18, Y+4 ; 0x04 31b34: 3d 81 ldd r19, Y+5 ; 0x05 31b36: 4e 81 ldd r20, Y+6 ; 0x06 31b38: 5f 81 ldd r21, Y+7 ; 0x07 31b3a: c7 01 movw r24, r14 31b3c: b6 01 movw r22, r12 31b3e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 31b42: 9b 01 movw r18, r22 31b44: ac 01 movw r20, r24 31b46: c3 01 movw r24, r6 31b48: b2 01 movw r22, r4 31b4a: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 31b4e: f8 01 movw r30, r16 31b50: 60 83 st Z, r22 31b52: 71 83 std Z+1, r23 ; 0x01 31b54: 82 83 std Z+2, r24 ; 0x02 31b56: 93 83 std Z+3, r25 ; 0x03 current_position[Y_AXIS] = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; 31b58: 28 85 ldd r18, Y+8 ; 0x08 31b5a: 39 85 ldd r19, Y+9 ; 0x09 31b5c: 4a 85 ldd r20, Y+10 ; 0x0a 31b5e: 5b 85 ldd r21, Y+11 ; 0x0b 31b60: c5 01 movw r24, r10 31b62: b4 01 movw r22, r8 31b64: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 31b68: 4b 01 movw r8, r22 31b6a: 5c 01 movw r10, r24 31b6c: 2c 85 ldd r18, Y+12 ; 0x0c 31b6e: 3d 85 ldd r19, Y+13 ; 0x0d 31b70: 4e 85 ldd r20, Y+14 ; 0x0e 31b72: 5f 85 ldd r21, Y+15 ; 0x0f 31b74: c7 01 movw r24, r14 31b76: b6 01 movw r22, r12 31b78: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 31b7c: 9b 01 movw r18, r22 31b7e: ac 01 movw r20, r24 31b80: c5 01 movw r24, r10 31b82: b4 01 movw r22, r8 31b84: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 31b88: f8 01 movw r30, r16 31b8a: 64 83 std Z+4, r22 ; 0x04 31b8c: 75 83 std Z+5, r23 ; 0x05 31b8e: 86 83 std Z+6, r24 ; 0x06 31b90: 97 83 std Z+7, r25 ; 0x07 } 31b92: df 91 pop r29 31b94: cf 91 pop r28 31b96: 1f 91 pop r17 31b98: 0f 91 pop r16 31b9a: ff 90 pop r15 31b9c: ef 90 pop r14 31b9e: df 90 pop r13 31ba0: cf 90 pop r12 31ba2: bf 90 pop r11 31ba4: af 90 pop r10 31ba6: 9f 90 pop r9 31ba8: 8f 90 pop r8 31baa: 7f 90 pop r7 31bac: 6f 90 pop r6 31bae: 5f 90 pop r5 31bb0: 4f 90 pop r4 31bb2: 08 95 ret 00031bb4 : } return false; } static void world2machine_update(const float vec_x[2], const float vec_y[2], const float cntr[2]) { 31bb4: 4f 92 push r4 31bb6: 5f 92 push r5 31bb8: 6f 92 push r6 31bba: 7f 92 push r7 31bbc: 8f 92 push r8 31bbe: 9f 92 push r9 31bc0: af 92 push r10 31bc2: bf 92 push r11 31bc4: cf 92 push r12 31bc6: df 92 push r13 31bc8: ef 92 push r14 31bca: ff 92 push r15 31bcc: 0f 93 push r16 31bce: 1f 93 push r17 31bd0: cf 93 push r28 31bd2: df 93 push r29 31bd4: 00 d0 rcall .+0 ; 0x31bd6 31bd6: 00 d0 rcall .+0 ; 0x31bd8 31bd8: 1f 92 push r1 31bda: 1f 92 push r1 31bdc: cd b7 in r28, 0x3d ; 61 31bde: de b7 in r29, 0x3e ; 62 world2machine_rotation_and_skew[0][0] = vec_x[0]; 31be0: dc 01 movw r26, r24 31be2: cd 90 ld r12, X+ 31be4: dd 90 ld r13, X+ 31be6: ed 90 ld r14, X+ 31be8: fc 90 ld r15, X 31bea: 13 97 sbiw r26, 0x03 ; 3 31bec: c0 92 a9 16 sts 0x16A9, r12 ; 0x8016a9 31bf0: d0 92 aa 16 sts 0x16AA, r13 ; 0x8016aa 31bf4: e0 92 ab 16 sts 0x16AB, r14 ; 0x8016ab 31bf8: f0 92 ac 16 sts 0x16AC, r15 ; 0x8016ac world2machine_rotation_and_skew[1][0] = vec_x[1]; 31bfc: 14 96 adiw r26, 0x04 ; 4 31bfe: 0d 91 ld r16, X+ 31c00: 1d 91 ld r17, X+ 31c02: 2d 91 ld r18, X+ 31c04: 3c 91 ld r19, X 31c06: 17 97 sbiw r26, 0x07 ; 7 31c08: 09 83 std Y+1, r16 ; 0x01 31c0a: 1a 83 std Y+2, r17 ; 0x02 31c0c: 2b 83 std Y+3, r18 ; 0x03 31c0e: 3c 83 std Y+4, r19 ; 0x04 31c10: 00 93 b1 16 sts 0x16B1, r16 ; 0x8016b1 31c14: 10 93 b2 16 sts 0x16B2, r17 ; 0x8016b2 31c18: 20 93 b3 16 sts 0x16B3, r18 ; 0x8016b3 31c1c: 30 93 b4 16 sts 0x16B4, r19 ; 0x8016b4 world2machine_rotation_and_skew[0][1] = vec_y[0]; 31c20: db 01 movw r26, r22 31c22: 0d 91 ld r16, X+ 31c24: 1d 91 ld r17, X+ 31c26: 2d 91 ld r18, X+ 31c28: 3c 91 ld r19, X 31c2a: 13 97 sbiw r26, 0x03 ; 3 31c2c: 0d 83 std Y+5, r16 ; 0x05 31c2e: 1e 83 std Y+6, r17 ; 0x06 31c30: 2f 83 std Y+7, r18 ; 0x07 31c32: 38 87 std Y+8, r19 ; 0x08 31c34: 00 93 ad 16 sts 0x16AD, r16 ; 0x8016ad 31c38: 10 93 ae 16 sts 0x16AE, r17 ; 0x8016ae 31c3c: 20 93 af 16 sts 0x16AF, r18 ; 0x8016af 31c40: 30 93 b0 16 sts 0x16B0, r19 ; 0x8016b0 world2machine_rotation_and_skew[1][1] = vec_y[1]; 31c44: 14 96 adiw r26, 0x04 ; 4 31c46: 4d 90 ld r4, X+ 31c48: 5d 90 ld r5, X+ 31c4a: 6d 90 ld r6, X+ 31c4c: 7c 90 ld r7, X 31c4e: 17 97 sbiw r26, 0x07 ; 7 31c50: 40 92 b5 16 sts 0x16B5, r4 ; 0x8016b5 31c54: 50 92 b6 16 sts 0x16B6, r5 ; 0x8016b6 31c58: 60 92 b7 16 sts 0x16B7, r6 ; 0x8016b7 31c5c: 70 92 b8 16 sts 0x16B8, r7 ; 0x8016b8 world2machine_shift[0] = cntr[0]; 31c60: fa 01 movw r30, r20 31c62: 60 81 ld r22, Z 31c64: 71 81 ldd r23, Z+1 ; 0x01 31c66: 82 81 ldd r24, Z+2 ; 0x02 31c68: 93 81 ldd r25, Z+3 ; 0x03 31c6a: 60 93 d4 16 sts 0x16D4, r22 ; 0x8016d4 31c6e: 70 93 d5 16 sts 0x16D5, r23 ; 0x8016d5 31c72: 80 93 d6 16 sts 0x16D6, r24 ; 0x8016d6 31c76: 90 93 d7 16 sts 0x16D7, r25 ; 0x8016d7 world2machine_shift[1] = cntr[1]; 31c7a: 84 80 ldd r8, Z+4 ; 0x04 31c7c: 95 80 ldd r9, Z+5 ; 0x05 31c7e: a6 80 ldd r10, Z+6 ; 0x06 31c80: b7 80 ldd r11, Z+7 ; 0x07 31c82: 80 92 d8 16 sts 0x16D8, r8 ; 0x8016d8 31c86: 90 92 d9 16 sts 0x16D9, r9 ; 0x8016d9 31c8a: a0 92 da 16 sts 0x16DA, r10 ; 0x8016da 31c8e: b0 92 db 16 sts 0x16DB, r11 ; 0x8016db // No correction. world2machine_correction_mode = WORLD2MACHINE_CORRECTION_NONE; if (world2machine_shift[0] != 0.f || world2machine_shift[1] != 0.f) 31c92: 20 e0 ldi r18, 0x00 ; 0 31c94: 30 e0 ldi r19, 0x00 ; 0 31c96: a9 01 movw r20, r18 31c98: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 31c9c: 81 11 cpse r24, r1 31c9e: aa c0 rjmp .+340 ; 0x31df4 31ca0: 20 e0 ldi r18, 0x00 ; 0 31ca2: 30 e0 ldi r19, 0x00 ; 0 31ca4: a9 01 movw r20, r18 31ca6: c5 01 movw r24, r10 31ca8: b4 01 movw r22, r8 31caa: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 31cae: 81 11 cpse r24, r1 31cb0: a1 c0 rjmp .+322 ; 0x31df4 world2machine_rotation_and_skew[0][1] = vec_y[0]; world2machine_rotation_and_skew[1][1] = vec_y[1]; world2machine_shift[0] = cntr[0]; world2machine_shift[1] = cntr[1]; // No correction. world2machine_correction_mode = WORLD2MACHINE_CORRECTION_NONE; 31cb2: 10 92 dc 16 sts 0x16DC, r1 ; 0x8016dc if (world2machine_shift[0] != 0.f || world2machine_shift[1] != 0.f) // Shift correction. world2machine_correction_mode |= WORLD2MACHINE_CORRECTION_SHIFT; if (world2machine_rotation_and_skew[0][0] != 1.f || world2machine_rotation_and_skew[0][1] != 0.f || 31cb6: 20 e0 ldi r18, 0x00 ; 0 31cb8: 30 e0 ldi r19, 0x00 ; 0 31cba: 40 e8 ldi r20, 0x80 ; 128 31cbc: 5f e3 ldi r21, 0x3F ; 63 31cbe: c7 01 movw r24, r14 31cc0: b6 01 movw r22, r12 31cc2: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 31cc6: 81 11 cpse r24, r1 31cc8: 21 c0 rjmp .+66 ; 0x31d0c 31cca: 20 e0 ldi r18, 0x00 ; 0 31ccc: 30 e0 ldi r19, 0x00 ; 0 31cce: a9 01 movw r20, r18 31cd0: 6d 81 ldd r22, Y+5 ; 0x05 31cd2: 7e 81 ldd r23, Y+6 ; 0x06 31cd4: 8f 81 ldd r24, Y+7 ; 0x07 31cd6: 98 85 ldd r25, Y+8 ; 0x08 31cd8: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 31cdc: 81 11 cpse r24, r1 31cde: 16 c0 rjmp .+44 ; 0x31d0c 31ce0: 20 e0 ldi r18, 0x00 ; 0 31ce2: 30 e0 ldi r19, 0x00 ; 0 31ce4: a9 01 movw r20, r18 31ce6: 69 81 ldd r22, Y+1 ; 0x01 31ce8: 7a 81 ldd r23, Y+2 ; 0x02 31cea: 8b 81 ldd r24, Y+3 ; 0x03 31cec: 9c 81 ldd r25, Y+4 ; 0x04 31cee: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 31cf2: 81 11 cpse r24, r1 31cf4: 0b c0 rjmp .+22 ; 0x31d0c world2machine_rotation_and_skew[1][0] != 0.f || world2machine_rotation_and_skew[1][1] != 1.f) { 31cf6: 20 e0 ldi r18, 0x00 ; 0 31cf8: 30 e0 ldi r19, 0x00 ; 0 31cfa: 40 e8 ldi r20, 0x80 ; 128 31cfc: 5f e3 ldi r21, 0x3F ; 63 31cfe: c3 01 movw r24, r6 31d00: b2 01 movw r22, r4 31d02: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 31d06: 88 23 and r24, r24 31d08: 09 f4 brne .+2 ; 0x31d0c 31d0a: 78 c0 rjmp .+240 ; 0x31dfc // Rotation & skew correction. world2machine_correction_mode |= WORLD2MACHINE_CORRECTION_SKEW; 31d0c: 80 91 dc 16 lds r24, 0x16DC ; 0x8016dc 31d10: 82 60 ori r24, 0x02 ; 2 31d12: 80 93 dc 16 sts 0x16DC, r24 ; 0x8016dc // Invert the world2machine matrix. float d = world2machine_rotation_and_skew[0][0] * world2machine_rotation_and_skew[1][1] - world2machine_rotation_and_skew[1][0] * world2machine_rotation_and_skew[0][1]; 31d16: a3 01 movw r20, r6 31d18: 92 01 movw r18, r4 31d1a: c7 01 movw r24, r14 31d1c: b6 01 movw r22, r12 31d1e: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 31d22: 4b 01 movw r8, r22 31d24: 5c 01 movw r10, r24 31d26: 2d 81 ldd r18, Y+5 ; 0x05 31d28: 3e 81 ldd r19, Y+6 ; 0x06 31d2a: 4f 81 ldd r20, Y+7 ; 0x07 31d2c: 58 85 ldd r21, Y+8 ; 0x08 31d2e: 69 81 ldd r22, Y+1 ; 0x01 31d30: 7a 81 ldd r23, Y+2 ; 0x02 31d32: 8b 81 ldd r24, Y+3 ; 0x03 31d34: 9c 81 ldd r25, Y+4 ; 0x04 31d36: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 31d3a: 9b 01 movw r18, r22 31d3c: ac 01 movw r20, r24 31d3e: c5 01 movw r24, r10 31d40: b4 01 movw r22, r8 31d42: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 31d46: 4b 01 movw r8, r22 31d48: 5c 01 movw r10, r24 world2machine_rotation_and_skew_inv[0][0] = world2machine_rotation_and_skew[1][1] / d; 31d4a: ac 01 movw r20, r24 31d4c: 9b 01 movw r18, r22 31d4e: c3 01 movw r24, r6 31d50: b2 01 movw r22, r4 31d52: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 31d56: 60 93 c4 16 sts 0x16C4, r22 ; 0x8016c4 31d5a: 70 93 c5 16 sts 0x16C5, r23 ; 0x8016c5 31d5e: 80 93 c6 16 sts 0x16C6, r24 ; 0x8016c6 31d62: 90 93 c7 16 sts 0x16C7, r25 ; 0x8016c7 world2machine_rotation_and_skew_inv[0][1] = -world2machine_rotation_and_skew[0][1] / d; 31d66: 6d 81 ldd r22, Y+5 ; 0x05 31d68: 7e 81 ldd r23, Y+6 ; 0x06 31d6a: 8f 81 ldd r24, Y+7 ; 0x07 31d6c: 98 85 ldd r25, Y+8 ; 0x08 31d6e: 90 58 subi r25, 0x80 ; 128 31d70: a5 01 movw r20, r10 31d72: 94 01 movw r18, r8 31d74: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 31d78: 60 93 c8 16 sts 0x16C8, r22 ; 0x8016c8 31d7c: 70 93 c9 16 sts 0x16C9, r23 ; 0x8016c9 31d80: 80 93 ca 16 sts 0x16CA, r24 ; 0x8016ca 31d84: 90 93 cb 16 sts 0x16CB, r25 ; 0x8016cb world2machine_rotation_and_skew_inv[1][0] = -world2machine_rotation_and_skew[1][0] / d; 31d88: 69 81 ldd r22, Y+1 ; 0x01 31d8a: 7a 81 ldd r23, Y+2 ; 0x02 31d8c: 8b 81 ldd r24, Y+3 ; 0x03 31d8e: 9c 81 ldd r25, Y+4 ; 0x04 31d90: 90 58 subi r25, 0x80 ; 128 31d92: a5 01 movw r20, r10 31d94: 94 01 movw r18, r8 31d96: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 31d9a: 60 93 cc 16 sts 0x16CC, r22 ; 0x8016cc 31d9e: 70 93 cd 16 sts 0x16CD, r23 ; 0x8016cd 31da2: 80 93 ce 16 sts 0x16CE, r24 ; 0x8016ce 31da6: 90 93 cf 16 sts 0x16CF, r25 ; 0x8016cf world2machine_rotation_and_skew_inv[1][1] = world2machine_rotation_and_skew[0][0] / d; 31daa: a5 01 movw r20, r10 31dac: 94 01 movw r18, r8 31dae: c7 01 movw r24, r14 31db0: b6 01 movw r22, r12 31db2: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> 31db6: 60 93 d0 16 sts 0x16D0, r22 ; 0x8016d0 31dba: 70 93 d1 16 sts 0x16D1, r23 ; 0x8016d1 31dbe: 80 93 d2 16 sts 0x16D2, r24 ; 0x8016d2 31dc2: 90 93 d3 16 sts 0x16D3, r25 ; 0x8016d3 world2machine_rotation_and_skew_inv[0][0] = 1.f; world2machine_rotation_and_skew_inv[0][1] = 0.f; world2machine_rotation_and_skew_inv[1][0] = 0.f; world2machine_rotation_and_skew_inv[1][1] = 1.f; } } 31dc6: 28 96 adiw r28, 0x08 ; 8 31dc8: 0f b6 in r0, 0x3f ; 63 31dca: f8 94 cli 31dcc: de bf out 0x3e, r29 ; 62 31dce: 0f be out 0x3f, r0 ; 63 31dd0: cd bf out 0x3d, r28 ; 61 31dd2: df 91 pop r29 31dd4: cf 91 pop r28 31dd6: 1f 91 pop r17 31dd8: 0f 91 pop r16 31dda: ff 90 pop r15 31ddc: ef 90 pop r14 31dde: df 90 pop r13 31de0: cf 90 pop r12 31de2: bf 90 pop r11 31de4: af 90 pop r10 31de6: 9f 90 pop r9 31de8: 8f 90 pop r8 31dea: 7f 90 pop r7 31dec: 6f 90 pop r6 31dee: 5f 90 pop r5 31df0: 4f 90 pop r4 31df2: 08 95 ret world2machine_shift[1] = cntr[1]; // No correction. world2machine_correction_mode = WORLD2MACHINE_CORRECTION_NONE; if (world2machine_shift[0] != 0.f || world2machine_shift[1] != 0.f) // Shift correction. world2machine_correction_mode |= WORLD2MACHINE_CORRECTION_SHIFT; 31df4: 81 e0 ldi r24, 0x01 ; 1 31df6: 80 93 dc 16 sts 0x16DC, r24 ; 0x8016dc 31dfa: 5d cf rjmp .-326 ; 0x31cb6 world2machine_rotation_and_skew_inv[0][0] = world2machine_rotation_and_skew[1][1] / d; world2machine_rotation_and_skew_inv[0][1] = -world2machine_rotation_and_skew[0][1] / d; world2machine_rotation_and_skew_inv[1][0] = -world2machine_rotation_and_skew[1][0] / d; world2machine_rotation_and_skew_inv[1][1] = world2machine_rotation_and_skew[0][0] / d; } else { world2machine_rotation_and_skew_inv[0][0] = 1.f; 31dfc: 80 e0 ldi r24, 0x00 ; 0 31dfe: 90 e0 ldi r25, 0x00 ; 0 31e00: a0 e8 ldi r26, 0x80 ; 128 31e02: bf e3 ldi r27, 0x3F ; 63 31e04: 80 93 c4 16 sts 0x16C4, r24 ; 0x8016c4 31e08: 90 93 c5 16 sts 0x16C5, r25 ; 0x8016c5 31e0c: a0 93 c6 16 sts 0x16C6, r26 ; 0x8016c6 31e10: b0 93 c7 16 sts 0x16C7, r27 ; 0x8016c7 world2machine_rotation_and_skew_inv[0][1] = 0.f; 31e14: 10 92 c8 16 sts 0x16C8, r1 ; 0x8016c8 31e18: 10 92 c9 16 sts 0x16C9, r1 ; 0x8016c9 31e1c: 10 92 ca 16 sts 0x16CA, r1 ; 0x8016ca 31e20: 10 92 cb 16 sts 0x16CB, r1 ; 0x8016cb world2machine_rotation_and_skew_inv[1][0] = 0.f; 31e24: 10 92 cc 16 sts 0x16CC, r1 ; 0x8016cc 31e28: 10 92 cd 16 sts 0x16CD, r1 ; 0x8016cd 31e2c: 10 92 ce 16 sts 0x16CE, r1 ; 0x8016ce 31e30: 10 92 cf 16 sts 0x16CF, r1 ; 0x8016cf world2machine_rotation_and_skew_inv[1][1] = 1.f; 31e34: 80 93 d0 16 sts 0x16D0, r24 ; 0x8016d0 31e38: 90 93 d1 16 sts 0x16D1, r25 ; 0x8016d1 31e3c: a0 93 d2 16 sts 0x16D2, r26 ; 0x8016d2 31e40: b0 93 d3 16 sts 0x16D3, r27 ; 0x8016d3 31e44: c0 cf rjmp .-128 ; 0x31dc6 00031e46 : * * In contrast with world2machine_revert_to_uncorrected(), it doesn't wait for finishing moves * nor updates the current position with the absolute values. */ void world2machine_reset() { 31e46: cf 93 push r28 31e48: df 93 push r29 31e4a: cd b7 in r28, 0x3d ; 61 31e4c: de b7 in r29, 0x3e ; 62 31e4e: 68 97 sbiw r28, 0x18 ; 24 31e50: 0f b6 in r0, 0x3f ; 63 31e52: f8 94 cli 31e54: de bf out 0x3e, r29 ; 62 31e56: 0f be out 0x3f, r0 ; 63 31e58: cd bf out 0x3d, r28 ; 61 const float vx[] = { 1.f, 0.f }; 31e5a: 80 e0 ldi r24, 0x00 ; 0 31e5c: 90 e0 ldi r25, 0x00 ; 0 31e5e: a0 e8 ldi r26, 0x80 ; 128 31e60: bf e3 ldi r27, 0x3F ; 63 31e62: 89 83 std Y+1, r24 ; 0x01 31e64: 9a 83 std Y+2, r25 ; 0x02 31e66: ab 83 std Y+3, r26 ; 0x03 31e68: bc 83 std Y+4, r27 ; 0x04 31e6a: 1d 82 std Y+5, r1 ; 0x05 31e6c: 1e 82 std Y+6, r1 ; 0x06 31e6e: 1f 82 std Y+7, r1 ; 0x07 31e70: 18 86 std Y+8, r1 ; 0x08 const float vy[] = { 0.f, 1.f }; 31e72: 19 86 std Y+9, r1 ; 0x09 31e74: 1a 86 std Y+10, r1 ; 0x0a 31e76: 1b 86 std Y+11, r1 ; 0x0b 31e78: 1c 86 std Y+12, r1 ; 0x0c 31e7a: 8d 87 std Y+13, r24 ; 0x0d 31e7c: 9e 87 std Y+14, r25 ; 0x0e 31e7e: af 87 std Y+15, r26 ; 0x0f 31e80: b8 8b std Y+16, r27 ; 0x10 const float cntr[] = { 0.f, 0.f }; 31e82: 19 8a std Y+17, r1 ; 0x11 31e84: 1a 8a std Y+18, r1 ; 0x12 31e86: 1b 8a std Y+19, r1 ; 0x13 31e88: 1c 8a std Y+20, r1 ; 0x14 31e8a: 1d 8a std Y+21, r1 ; 0x15 31e8c: 1e 8a std Y+22, r1 ; 0x16 31e8e: 1f 8a std Y+23, r1 ; 0x17 31e90: 18 8e std Y+24, r1 ; 0x18 world2machine_update(vx, vy, cntr); 31e92: ae 01 movw r20, r28 31e94: 4f 5e subi r20, 0xEF ; 239 31e96: 5f 4f sbci r21, 0xFF ; 255 31e98: be 01 movw r22, r28 31e9a: 67 5f subi r22, 0xF7 ; 247 31e9c: 7f 4f sbci r23, 0xFF ; 255 31e9e: ce 01 movw r24, r28 31ea0: 01 96 adiw r24, 0x01 ; 1 31ea2: 0f 94 da 8d call 0x31bb4 ; 0x31bb4 } 31ea6: 68 96 adiw r28, 0x18 ; 24 31ea8: 0f b6 in r0, 0x3f ; 63 31eaa: f8 94 cli 31eac: de bf out 0x3e, r29 ; 62 31eae: 0f be out 0x3f, r0 ; 63 31eb0: cd bf out 0x3d, r28 ; 61 31eb2: df 91 pop r29 31eb4: cf 91 pop r28 31eb6: 08 95 ret 00031eb8 : * * Wait for the motors to stop and then update the current position with the absolute values. */ void world2machine_revert_to_uncorrected() { if (world2machine_correction_mode != WORLD2MACHINE_CORRECTION_NONE) { 31eb8: 80 91 dc 16 lds r24, 0x16DC ; 0x8016dc 31ebc: 88 23 and r24, r24 31ebe: d1 f0 breq .+52 ; 0x31ef4 world2machine_reset(); 31ec0: 0f 94 23 8f call 0x31e46 ; 0x31e46 st_synchronize(); 31ec4: 0f 94 42 22 call 0x24484 ; 0x24484 current_position[X_AXIS] = st_get_position_mm(X_AXIS); 31ec8: 80 e0 ldi r24, 0x00 ; 0 31eca: 0f 94 2e 22 call 0x2445c ; 0x2445c 31ece: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 31ed2: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 31ed6: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 31eda: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 31ede: 81 e0 ldi r24, 0x01 ; 1 31ee0: 0f 94 2e 22 call 0x2445c ; 0x2445c 31ee4: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 31ee8: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 31eec: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 31ef0: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc } } 31ef4: 08 95 ret 00031ef6 : if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 31ef6: 4f ef ldi r20, 0xFF ; 255 31ef8: 5f ef ldi r21, 0xFF ; 255 31efa: ba 01 movw r22, r20 31efc: 85 ee ldi r24, 0xE5 ; 229 31efe: 9f e0 ldi r25, 0x0F ; 15 31f00: 0f 94 12 a0 call 0x34024 ; 0x34024 31f04: 4f ef ldi r20, 0xFF ; 255 31f06: 5f ef ldi r21, 0xFF ; 255 31f08: ba 01 movw r22, r20 31f0a: 89 ee ldi r24, 0xE9 ; 233 31f0c: 9f e0 ldi r25, 0x0F ; 15 31f0e: 0f 94 12 a0 call 0x34024 ; 0x34024 31f12: 4f ef ldi r20, 0xFF ; 255 31f14: 5f ef ldi r21, 0xFF ; 255 31f16: ba 01 movw r22, r20 31f18: 8d ed ldi r24, 0xDD ; 221 31f1a: 9f e0 ldi r25, 0x0F ; 15 31f1c: 0f 94 12 a0 call 0x34024 ; 0x34024 31f20: 4f ef ldi r20, 0xFF ; 255 31f22: 5f ef ldi r21, 0xFF ; 255 31f24: ba 01 movw r22, r20 31f26: 81 ee ldi r24, 0xE1 ; 225 31f28: 9f e0 ldi r25, 0x0F ; 15 31f2a: 0f 94 12 a0 call 0x34024 ; 0x34024 31f2e: 4f ef ldi r20, 0xFF ; 255 31f30: 5f ef ldi r21, 0xFF ; 255 31f32: ba 01 movw r22, r20 31f34: 85 ed ldi r24, 0xD5 ; 213 31f36: 9f e0 ldi r25, 0x0F ; 15 31f38: 0f 94 12 a0 call 0x34024 ; 0x34024 31f3c: 4f ef ldi r20, 0xFF ; 255 31f3e: 5f ef ldi r21, 0xFF ; 255 31f40: ba 01 movw r22, r20 31f42: 89 ed ldi r24, 0xD9 ; 217 31f44: 9f e0 ldi r25, 0x0F ; 15 31f46: 0f 94 12 a0 call 0x34024 ; 0x34024 31f4a: 4f ef ldi r20, 0xFF ; 255 31f4c: 5f ef ldi r21, 0xFF ; 255 31f4e: ba 01 movw r22, r20 31f50: 85 ec ldi r24, 0xC5 ; 197 31f52: 9f e0 ldi r25, 0x0F ; 15 31f54: 0f 94 12 a0 call 0x34024 ; 0x34024 31f58: 4f ef ldi r20, 0xFF ; 255 31f5a: 5f ef ldi r21, 0xFF ; 255 31f5c: ba 01 movw r22, r20 31f5e: 89 ec ldi r24, 0xC9 ; 201 31f60: 9f e0 ldi r25, 0x0F ; 15 31f62: 0f 94 12 a0 call 0x34024 ; 0x34024 31f66: 4f ef ldi r20, 0xFF ; 255 31f68: 5f ef ldi r21, 0xFF ; 255 31f6a: ba 01 movw r22, r20 31f6c: 8d ec ldi r24, 0xCD ; 205 31f6e: 9f e0 ldi r25, 0x0F ; 15 31f70: 0f 94 12 a0 call 0x34024 ; 0x34024 31f74: 4f ef ldi r20, 0xFF ; 255 31f76: 5f ef ldi r21, 0xFF ; 255 31f78: ba 01 movw r22, r20 31f7a: 81 ed ldi r24, 0xD1 ; 209 31f7c: 9f e0 ldi r25, 0x0F ; 15 31f7e: 0d 94 12 a0 jmp 0x34024 ; 0x34024 00031f82 : /** * @brief Read and apply validated calibration data from EEPROM */ void world2machine_initialize() { 31f82: 4f 92 push r4 31f84: 5f 92 push r5 31f86: 6f 92 push r6 31f88: 7f 92 push r7 31f8a: 8f 92 push r8 31f8c: 9f 92 push r9 31f8e: af 92 push r10 31f90: bf 92 push r11 31f92: cf 92 push r12 31f94: df 92 push r13 31f96: ef 92 push r14 31f98: ff 92 push r15 31f9a: 1f 93 push r17 31f9c: cf 93 push r28 31f9e: df 93 push r29 31fa0: cd b7 in r28, 0x3d ; 61 31fa2: de b7 in r29, 0x3e ; 62 31fa4: a8 97 sbiw r28, 0x28 ; 40 31fa6: 0f b6 in r0, 0x3f ; 63 31fa8: f8 94 cli 31faa: de bf out 0x3e, r29 ; 62 31fac: 0f be out 0x3f, r0 ; 63 31fae: cd bf out 0x3d, r28 ; 61 * @param [out] vec_y axis y vector * @param [out] cntr offset vector */ void world2machine_read_valid(float vec_x[2], float vec_y[2], float cntr[2]) { eeprom_read_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8); 31fb0: 48 e0 ldi r20, 0x08 ; 8 31fb2: 50 e0 ldi r21, 0x00 ; 0 31fb4: 6d ed ldi r22, 0xDD ; 221 31fb6: 7f e0 ldi r23, 0x0F ; 15 31fb8: ce 01 movw r24, r28 31fba: 01 96 adiw r24, 0x01 ; 1 31fbc: 0f 94 cc 9f call 0x33f98 ; 0x33f98 eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 31fc0: 48 e0 ldi r20, 0x08 ; 8 31fc2: 50 e0 ldi r21, 0x00 ; 0 31fc4: 65 ed ldi r22, 0xD5 ; 213 31fc6: 7f e0 ldi r23, 0x0F ; 15 31fc8: ce 01 movw r24, r28 31fca: 09 96 adiw r24, 0x09 ; 9 31fcc: 0f 94 cc 9f call 0x33f98 ; 0x33f98 eeprom_read_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8); 31fd0: 48 e0 ldi r20, 0x08 ; 8 31fd2: 50 e0 ldi r21, 0x00 ; 0 31fd4: 65 ee ldi r22, 0xE5 ; 229 31fd6: 7f e0 ldi r23, 0x0F ; 15 31fd8: ce 01 movw r24, r28 31fda: 41 96 adiw r24, 0x11 ; 17 31fdc: 0f 94 cc 9f call 0x33f98 ; 0x33f98 } static inline bool vec_undef(const float v[2]) { const uint32_t *vx = (const uint32_t*)v; return vx[0] == 0xFFFFFFFF || vx[1] == 0xFFFFFFFF; 31fe0: 89 89 ldd r24, Y+17 ; 0x11 31fe2: 9a 89 ldd r25, Y+18 ; 0x12 31fe4: ab 89 ldd r26, Y+19 ; 0x13 31fe6: bc 89 ldd r27, Y+20 ; 0x14 31fe8: 89 a3 std Y+33, r24 ; 0x21 31fea: 9a a3 std Y+34, r25 ; 0x22 31fec: ab a3 std Y+35, r26 ; 0x23 31fee: bc a3 std Y+36, r27 ; 0x24 31ff0: 8f 3f cpi r24, 0xFF ; 255 31ff2: 9f 4f sbci r25, 0xFF ; 255 31ff4: af 4f sbci r26, 0xFF ; 255 31ff6: bf 4f sbci r27, 0xFF ; 255 31ff8: 09 f4 brne .+2 ; 0x31ffc 31ffa: b1 c0 rjmp .+354 ; 0x3215e 31ffc: 8d 89 ldd r24, Y+21 ; 0x15 31ffe: 9e 89 ldd r25, Y+22 ; 0x16 32000: af 89 ldd r26, Y+23 ; 0x17 32002: b8 8d ldd r27, Y+24 ; 0x18 32004: 8d a3 std Y+37, r24 ; 0x25 32006: 9e a3 std Y+38, r25 ; 0x26 32008: af a3 std Y+39, r26 ; 0x27 3200a: b8 a7 std Y+40, r27 ; 0x28 3200c: 8f 3f cpi r24, 0xFF ; 255 3200e: 9f 4f sbci r25, 0xFF ; 255 32010: af 4f sbci r26, 0xFF ; 255 32012: bf 4f sbci r27, 0xFF ; 255 32014: 09 f4 brne .+2 ; 0x32018 32016: a3 c0 rjmp .+326 ; 0x3215e 32018: 89 80 ldd r8, Y+1 ; 0x01 3201a: 9a 80 ldd r9, Y+2 ; 0x02 3201c: ab 80 ldd r10, Y+3 ; 0x03 3201e: bc 80 ldd r11, Y+4 ; 0x04 32020: 8f ef ldi r24, 0xFF ; 255 32022: 88 16 cp r8, r24 32024: 98 06 cpc r9, r24 32026: a8 06 cpc r10, r24 32028: b8 06 cpc r11, r24 3202a: 09 f4 brne .+2 ; 0x3202e 3202c: 98 c0 rjmp .+304 ; 0x3215e 3202e: 8d 81 ldd r24, Y+5 ; 0x05 32030: 9e 81 ldd r25, Y+6 ; 0x06 32032: af 81 ldd r26, Y+7 ; 0x07 32034: b8 85 ldd r27, Y+8 ; 0x08 32036: 89 8f std Y+25, r24 ; 0x19 32038: 9a 8f std Y+26, r25 ; 0x1a 3203a: ab 8f std Y+27, r26 ; 0x1b 3203c: bc 8f std Y+28, r27 ; 0x1c 3203e: 8f 3f cpi r24, 0xFF ; 255 32040: 9f 4f sbci r25, 0xFF ; 255 32042: af 4f sbci r26, 0xFF ; 255 32044: bf 4f sbci r27, 0xFF ; 255 32046: 09 f4 brne .+2 ; 0x3204a 32048: 8a c0 rjmp .+276 ; 0x3215e 3204a: c9 84 ldd r12, Y+9 ; 0x09 3204c: da 84 ldd r13, Y+10 ; 0x0a 3204e: eb 84 ldd r14, Y+11 ; 0x0b 32050: fc 84 ldd r15, Y+12 ; 0x0c 32052: 8f ef ldi r24, 0xFF ; 255 32054: c8 16 cp r12, r24 32056: d8 06 cpc r13, r24 32058: e8 06 cpc r14, r24 3205a: f8 06 cpc r15, r24 3205c: 09 f4 brne .+2 ; 0x32060 3205e: 7f c0 rjmp .+254 ; 0x3215e 32060: 8d 85 ldd r24, Y+13 ; 0x0d 32062: 9e 85 ldd r25, Y+14 ; 0x0e 32064: af 85 ldd r26, Y+15 ; 0x0f 32066: b8 89 ldd r27, Y+16 ; 0x10 32068: 8d 8f std Y+29, r24 ; 0x1d 3206a: 9e 8f std Y+30, r25 ; 0x1e 3206c: af 8f std Y+31, r26 ; 0x1f 3206e: b8 a3 std Y+32, r27 ; 0x20 32070: 8f 3f cpi r24, 0xFF ; 255 32072: 9f 4f sbci r25, 0xFF ; 255 32074: af 4f sbci r26, 0xFF ; 255 32076: bf 4f sbci r27, 0xFF ; 255 32078: 09 f4 brne .+2 ; 0x3207c 3207a: 71 c0 rjmp .+226 ; 0x3215e reset = true; } else { // Length of the vec_x shall be close to unity. float l = hypot(vec_x[0], vec_x[1]); 3207c: 29 8d ldd r18, Y+25 ; 0x19 3207e: 3a 8d ldd r19, Y+26 ; 0x1a 32080: 4b 8d ldd r20, Y+27 ; 0x1b 32082: 5c 8d ldd r21, Y+28 ; 0x1c 32084: c5 01 movw r24, r10 32086: b4 01 movw r22, r8 32088: 0f 94 a0 a3 call 0x34740 ; 0x34740 3208c: 2b 01 movw r4, r22 3208e: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 32090: 26 e6 ldi r18, 0x66 ; 102 32092: 36 e6 ldi r19, 0x66 ; 102 32094: 46 e6 ldi r20, 0x66 ; 102 32096: 5f e3 ldi r21, 0x3F ; 63 32098: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> #if 0 SERIAL_ECHOLNPGM("X vector length:"); MYSERIAL.println(l); SERIAL_ECHOLNPGM("Invalid bed correction matrix. Length of the X vector out of range."); #endif reset = true; 3209c: 11 e0 ldi r17, 0x01 ; 1 } else { // Length of the vec_x shall be close to unity. float l = hypot(vec_x[0], vec_x[1]); if (l < 0.9 || l > 1.1) 3209e: 87 fd sbrc r24, 7 320a0: 0b c0 rjmp .+22 ; 0x320b8 320a2: 2d ec ldi r18, 0xCD ; 205 320a4: 3c ec ldi r19, 0xCC ; 204 320a6: 4c e8 ldi r20, 0x8C ; 140 320a8: 5f e3 ldi r21, 0x3F ; 63 320aa: c3 01 movw r24, r6 320ac: b2 01 movw r22, r4 320ae: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 320b2: 18 16 cp r1, r24 320b4: 0c f0 brlt .+2 ; 0x320b8 320b6: 10 e0 ldi r17, 0x00 ; 0 SERIAL_ECHOLNPGM("Invalid bed correction matrix. Length of the X vector out of range."); #endif reset = true; } // Length of the vec_y shall be close to unity. l = hypot(vec_y[0], vec_y[1]); 320b8: 2d 8d ldd r18, Y+29 ; 0x1d 320ba: 3e 8d ldd r19, Y+30 ; 0x1e 320bc: 4f 8d ldd r20, Y+31 ; 0x1f 320be: 58 a1 ldd r21, Y+32 ; 0x20 320c0: c7 01 movw r24, r14 320c2: b6 01 movw r22, r12 320c4: 0f 94 a0 a3 call 0x34740 ; 0x34740 320c8: 2b 01 movw r4, r22 320ca: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 320cc: 26 e6 ldi r18, 0x66 ; 102 320ce: 36 e6 ldi r19, 0x66 ; 102 320d0: 46 e6 ldi r20, 0x66 ; 102 320d2: 5f e3 ldi r21, 0x3F ; 63 320d4: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 320d8: 87 fd sbrc r24, 7 320da: 7f c0 rjmp .+254 ; 0x321da 320dc: 2d ec ldi r18, 0xCD ; 205 320de: 3c ec ldi r19, 0xCC ; 204 320e0: 4c e8 ldi r20, 0x8C ; 140 320e2: 5f e3 ldi r21, 0x3F ; 63 320e4: c3 01 movw r24, r6 320e6: b2 01 movw r22, r4 320e8: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 320ec: 18 16 cp r1, r24 320ee: 0c f4 brge .+2 ; 0x320f2 320f0: 74 c0 rjmp .+232 ; 0x321da SERIAL_ECHOLNPGM("Invalid bed correction matrix. Length of the Y vector out of range."); #endif reset = true; } // Correction of the zero point shall be reasonably small. l = hypot(cntr[0], cntr[1]); 320f2: 2d a1 ldd r18, Y+37 ; 0x25 320f4: 3e a1 ldd r19, Y+38 ; 0x26 320f6: 4f a1 ldd r20, Y+39 ; 0x27 320f8: 58 a5 ldd r21, Y+40 ; 0x28 320fa: 69 a1 ldd r22, Y+33 ; 0x21 320fc: 7a a1 ldd r23, Y+34 ; 0x22 320fe: 8b a1 ldd r24, Y+35 ; 0x23 32100: 9c a1 ldd r25, Y+36 ; 0x24 32102: 0f 94 a0 a3 call 0x34740 ; 0x34740 if (l > 15.f) 32106: 20 e0 ldi r18, 0x00 ; 0 32108: 30 e0 ldi r19, 0x00 ; 0 3210a: 40 e7 ldi r20, 0x70 ; 112 3210c: 51 e4 ldi r21, 0x41 ; 65 3210e: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 32112: 18 16 cp r1, r24 32114: 0c f4 brge .+2 ; 0x32118 #if 0 SERIAL_ECHOLNPGM("Zero point correction:"); MYSERIAL.println(l); SERIAL_ECHOLNPGM("Invalid bed correction matrix. Shift out of range."); #endif reset = true; 32116: 11 e0 ldi r17, 0x01 ; 1 } // vec_x and vec_y shall be nearly perpendicular. l = vec_x[0] * vec_y[0] + vec_x[1] * vec_y[1]; 32118: a5 01 movw r20, r10 3211a: 94 01 movw r18, r8 3211c: c7 01 movw r24, r14 3211e: b6 01 movw r22, r12 32120: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 32124: 6b 01 movw r12, r22 32126: 7c 01 movw r14, r24 32128: 2d 8d ldd r18, Y+29 ; 0x1d 3212a: 3e 8d ldd r19, Y+30 ; 0x1e 3212c: 4f 8d ldd r20, Y+31 ; 0x1f 3212e: 58 a1 ldd r21, Y+32 ; 0x20 32130: 69 8d ldd r22, Y+25 ; 0x19 32132: 7a 8d ldd r23, Y+26 ; 0x1a 32134: 8b 8d ldd r24, Y+27 ; 0x1b 32136: 9c 8d ldd r25, Y+28 ; 0x1c 32138: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 3213c: 9b 01 movw r18, r22 3213e: ac 01 movw r20, r24 32140: c7 01 movw r24, r14 32142: b6 01 movw r22, r12 32144: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> if (fabs(l) > 0.1f) 32148: 9f 77 andi r25, 0x7F ; 127 3214a: 2d ec ldi r18, 0xCD ; 205 3214c: 3c ec ldi r19, 0xCC ; 204 3214e: 4c ec ldi r20, 0xCC ; 204 32150: 5d e3 ldi r21, 0x3D ; 61 32152: 0f 94 8d a3 call 0x3471a ; 0x3471a <__gesf2> 32156: 18 16 cp r1, r24 32158: 14 f0 brlt .+4 ; 0x3215e #endif reset = true; } } if (reset) 3215a: 11 23 and r17, r17 3215c: f1 f0 breq .+60 ; 0x3219a { #if 0 SERIAL_ECHOLNPGM("Invalid bed correction matrix. Resetting to identity."); #endif reset_bed_offset_and_skew(); 3215e: 0f 94 7b 8f call 0x31ef6 ; 0x31ef6 * @param [out] vec_y axis y vector * @param [out] cntr offset vector */ static void world2machine_default(float vec_x[2], float vec_y[2], float cntr[2]) { vec_x[0] = 1.f; 32162: 80 e0 ldi r24, 0x00 ; 0 32164: 90 e0 ldi r25, 0x00 ; 0 32166: a0 e8 ldi r26, 0x80 ; 128 32168: bf e3 ldi r27, 0x3F ; 63 3216a: 89 83 std Y+1, r24 ; 0x01 3216c: 9a 83 std Y+2, r25 ; 0x02 3216e: ab 83 std Y+3, r26 ; 0x03 32170: bc 83 std Y+4, r27 ; 0x04 vec_x[1] = 0.f; 32172: 1d 82 std Y+5, r1 ; 0x05 32174: 1e 82 std Y+6, r1 ; 0x06 32176: 1f 82 std Y+7, r1 ; 0x07 32178: 18 86 std Y+8, r1 ; 0x08 vec_y[0] = 0.f; 3217a: 19 86 std Y+9, r1 ; 0x09 3217c: 1a 86 std Y+10, r1 ; 0x0a 3217e: 1b 86 std Y+11, r1 ; 0x0b 32180: 1c 86 std Y+12, r1 ; 0x0c vec_y[1] = 1.f; 32182: 8d 87 std Y+13, r24 ; 0x0d 32184: 9e 87 std Y+14, r25 ; 0x0e 32186: af 87 std Y+15, r26 ; 0x0f 32188: b8 8b std Y+16, r27 ; 0x10 cntr[0] = 0.f; 3218a: 19 8a std Y+17, r1 ; 0x11 3218c: 1a 8a std Y+18, r1 ; 0x12 3218e: 1b 8a std Y+19, r1 ; 0x13 32190: 1c 8a std Y+20, r1 ; 0x14 #ifdef DEFAULT_Y_OFFSET cntr[1] = DEFAULT_Y_OFFSET; #else cntr[1] = 0.f; 32192: 1d 8a std Y+21, r1 ; 0x15 32194: 1e 8a std Y+22, r1 ; 0x16 32196: 1f 8a std Y+23, r1 ; 0x17 32198: 18 8e std Y+24, r1 ; 0x18 #endif float vec_x[2]; float vec_y[2]; float cntr[2]; world2machine_read_valid(vec_x, vec_y, cntr); world2machine_update(vec_x, vec_y, cntr); 3219a: ae 01 movw r20, r28 3219c: 4f 5e subi r20, 0xEF ; 239 3219e: 5f 4f sbci r21, 0xFF ; 255 321a0: be 01 movw r22, r28 321a2: 67 5f subi r22, 0xF7 ; 247 321a4: 7f 4f sbci r23, 0xFF ; 255 321a6: ce 01 movw r24, r28 321a8: 01 96 adiw r24, 0x01 ; 1 321aa: 0f 94 da 8d call 0x31bb4 ; 0x31bb4 MYSERIAL.print(world2machine_shift[0], 5); SERIAL_ECHOPGM(", "); MYSERIAL.print(world2machine_shift[1], 5); SERIAL_ECHOLNPGM(""); #endif } 321ae: a8 96 adiw r28, 0x28 ; 40 321b0: 0f b6 in r0, 0x3f ; 63 321b2: f8 94 cli 321b4: de bf out 0x3e, r29 ; 62 321b6: 0f be out 0x3f, r0 ; 63 321b8: cd bf out 0x3d, r28 ; 61 321ba: df 91 pop r29 321bc: cf 91 pop r28 321be: 1f 91 pop r17 321c0: ff 90 pop r15 321c2: ef 90 pop r14 321c4: df 90 pop r13 321c6: cf 90 pop r12 321c8: bf 90 pop r11 321ca: af 90 pop r10 321cc: 9f 90 pop r9 321ce: 8f 90 pop r8 321d0: 7f 90 pop r7 321d2: 6f 90 pop r6 321d4: 5f 90 pop r5 321d6: 4f 90 pop r4 321d8: 08 95 ret #if 0 SERIAL_ECHOLNPGM("Y vector length:"); MYSERIAL.println(l); SERIAL_ECHOLNPGM("Invalid bed correction matrix. Length of the Y vector out of range."); #endif reset = true; 321da: 11 e0 ldi r17, 0x01 ; 1 321dc: 8a cf rjmp .-236 ; 0x320f2 000321de : lcd_print_pad_P(title, LCD_WIDTH); lcd_set_cursor(0, 2); } void menu_progressbar_update(uint16_t newVal) { 321de: cf 93 push r28 uint8_t newCnt = (newVal * LCD_WIDTH) / progressbar_total; 321e0: 24 e1 ldi r18, 0x14 ; 20 321e2: ac 01 movw r20, r24 321e4: 24 9f mul r18, r20 321e6: c0 01 movw r24, r0 321e8: 25 9f mul r18, r21 321ea: 90 0d add r25, r0 321ec: 11 24 eor r1, r1 321ee: 60 91 a7 16 lds r22, 0x16A7 ; 0x8016a7 321f2: 70 91 a8 16 lds r23, 0x16A8 ; 0x8016a8 321f6: 0f 94 a5 a0 call 0x3414a ; 0x3414a <__udivmodhi4> 321fa: c6 2f mov r28, r22 321fc: 65 31 cpi r22, 0x15 ; 21 321fe: 08 f0 brcs .+2 ; 0x32202 32200: c4 e1 ldi r28, 0x14 ; 20 if (newCnt > LCD_WIDTH) newCnt = LCD_WIDTH; while (newCnt > progressbar_block_count) 32202: 80 91 a6 16 lds r24, 0x16A6 ; 0x8016a6 32206: 8c 17 cp r24, r28 32208: 48 f4 brcc .+18 ; 0x3221c } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 3220a: 8f ef ldi r24, 0xFF ; 255 3220c: 0e 94 2a 6a call 0xd454 ; 0xd454 { lcd_print(LCD_STR_SOLID_BLOCK[0]); progressbar_block_count++; 32210: 80 91 a6 16 lds r24, 0x16A6 ; 0x8016a6 32214: 8f 5f subi r24, 0xFF ; 255 32216: 80 93 a6 16 sts 0x16A6, r24 ; 0x8016a6 3221a: f3 cf rjmp .-26 ; 0x32202 } } 3221c: cf 91 pop r28 3221e: 08 95 ret 00032220 : void menu_progressbar_finish(void) { progressbar_total = 1; 32220: 81 e0 ldi r24, 0x01 ; 1 32222: 90 e0 ldi r25, 0x00 ; 0 32224: 90 93 a8 16 sts 0x16A8, r25 ; 0x8016a8 32228: 80 93 a7 16 sts 0x16A7, r24 ; 0x8016a7 menu_progressbar_update(1); 3222c: 0f 94 ef 90 call 0x321de ; 0x321de _delay(300); 32230: 6c e2 ldi r22, 0x2C ; 44 32232: 71 e0 ldi r23, 0x01 ; 1 32234: 80 e0 ldi r24, 0x00 ; 0 32236: 90 e0 ldi r25, 0x00 ; 0 32238: 0d 94 7b 0d jmp 0x21af6 ; 0x21af6 0003223c : } static uint8_t progressbar_block_count = 0; static uint16_t progressbar_total = 0; void menu_progressbar_init(uint16_t total, const char* title) { 3223c: 0f 93 push r16 3223e: 1f 93 push r17 32240: cf 93 push r28 32242: df 93 push r29 32244: 8c 01 movw r16, r24 32246: eb 01 movw r28, r22 lcd_clear(); 32248: 0e 94 ae 69 call 0xd35c ; 0xd35c progressbar_block_count = 0; 3224c: 10 92 a6 16 sts 0x16A6, r1 ; 0x8016a6 progressbar_total = total; 32250: 10 93 a8 16 sts 0x16A8, r17 ; 0x8016a8 32254: 00 93 a7 16 sts 0x16A7, r16 ; 0x8016a7 lcd_set_cursor(0, 1); 32258: 61 e0 ldi r22, 0x01 ; 1 3225a: 80 e0 ldi r24, 0x00 ; 0 3225c: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 lcd_print_pad_P(title, LCD_WIDTH); 32260: 64 e1 ldi r22, 0x14 ; 20 32262: ce 01 movw r24, r28 32264: 0e 94 50 6b call 0xd6a0 ; 0xd6a0 lcd_set_cursor(0, 2); 32268: 62 e0 ldi r22, 0x02 ; 2 3226a: 80 e0 ldi r24, 0x00 ; 0 } 3226c: df 91 pop r29 3226e: cf 91 pop r28 32270: 1f 91 pop r17 32272: 0f 91 pop r16 progressbar_block_count = 0; progressbar_total = total; lcd_set_cursor(0, 1); lcd_print_pad_P(title, LCD_WIDTH); lcd_set_cursor(0, 2); 32274: 0c 94 7b 69 jmp 0xd2f6 ; 0xd2f6 00032278 : } menu_item++; } bool __attribute__((noinline)) menu_item_leave(){ return ((menu_item == menu_line) && menu_clicked && (lcd_encoder == menu_item)) || menu_leaving; 32278: 80 91 31 04 lds r24, 0x0431 ; 0x800431 3227c: 90 91 30 04 lds r25, 0x0430 ; 0x800430 32280: 89 13 cpse r24, r25 32282: 0b c0 rjmp .+22 ; 0x3229a 32284: 90 91 2f 04 lds r25, 0x042F ; 0x80042f 32288: 99 23 and r25, r25 3228a: 39 f0 breq .+14 ; 0x3229a 3228c: 20 91 06 05 lds r18, 0x0506 ; 0x800506 32290: 30 91 07 05 lds r19, 0x0507 ; 0x800507 32294: 82 17 cp r24, r18 32296: 13 06 cpc r1, r19 32298: 39 f0 breq .+14 ; 0x322a8 3229a: 81 e0 ldi r24, 0x01 ; 1 3229c: 90 91 92 03 lds r25, 0x0392 ; 0x800392 322a0: 91 11 cpse r25, r1 322a2: 03 c0 rjmp .+6 ; 0x322aa 322a4: 80 e0 ldi r24, 0x00 ; 0 322a6: 08 95 ret 322a8: 81 e0 ldi r24, 0x01 ; 1 } 322aa: 08 95 ret 000322ac : //! @brief Format sheet name //! //! @param[in] sheet_E Sheet in EEPROM //! @param[out] buffer for formatted output void menu_format_sheet_E(const Sheet &sheet_E, SheetFormatBuffer &buffer) { 322ac: 0f 93 push r16 322ae: 1f 93 push r17 322b0: cf 93 push r28 322b2: df 93 push r29 322b4: 8c 01 movw r16, r24 322b6: eb 01 movw r28, r22 uint_least8_t index = sprintf_P(buffer.c, PSTR("%.10S "), _T(MSG_SHEET)); 322b8: 84 ea ldi r24, 0xA4 ; 164 322ba: 93 e4 ldi r25, 0x43 ; 67 322bc: 0e 94 b1 6c call 0xd962 ; 0xd962 322c0: 9f 93 push r25 322c2: 8f 93 push r24 322c4: 87 e7 ldi r24, 0x77 ; 119 322c6: 9d e9 ldi r25, 0x9D ; 157 322c8: 9f 93 push r25 322ca: 8f 93 push r24 322cc: df 93 push r29 322ce: cf 93 push r28 322d0: 0f 94 f3 9e call 0x33de6 ; 0x33de6 eeprom_read_block(&(buffer.c[index]), sheet_E.name, 7); 322d4: c8 0f add r28, r24 322d6: d1 1d adc r29, r1 322d8: 47 e0 ldi r20, 0x07 ; 7 322da: 50 e0 ldi r21, 0x00 ; 0 322dc: b8 01 movw r22, r16 322de: ce 01 movw r24, r28 322e0: 0f 94 cc 9f call 0x33f98 ; 0x33f98 //index += 7; buffer.c[index + 7] = '\0'; 322e4: 1f 82 std Y+7, r1 ; 0x07 322e6: 0f 90 pop r0 322e8: 0f 90 pop r0 322ea: 0f 90 pop r0 322ec: 0f 90 pop r0 322ee: 0f 90 pop r0 322f0: 0f 90 pop r0 } 322f2: df 91 pop r29 322f4: cf 91 pop r28 322f6: 1f 91 pop r17 322f8: 0f 91 pop r16 322fa: 08 95 ret 000322fc : menu_line = 0; // prevent subsequent menu items from rendering at all in the current MENU_BEGIN() for loop cycle menu_clicked = 0; // prevent subsequent items from being able to be clicked in case the current menu or position was changed by the clicked menu item } static char menu_selection_mark(){ return (lcd_encoder == menu_item)?'>':' '; 322fc: 20 91 31 04 lds r18, 0x0431 ; 0x800431 32300: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32304: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32308: 28 17 cp r18, r24 3230a: 19 06 cpc r1, r25 3230c: 11 f0 breq .+4 ; 0x32312 3230e: 80 e2 ldi r24, 0x20 ; 32 32310: 08 95 ret 32312: 8e e3 ldi r24, 0x3E ; 62 } 32314: 08 95 ret 00032316 : static void menu_draw_item_puts_P(char type_char, const char* str) { 32316: 0f 93 push r16 32318: 1f 93 push r17 3231a: cf 93 push r28 3231c: c8 2f mov r28, r24 3231e: 8b 01 movw r16, r22 lcd_putc_at(0, menu_row, menu_selection_mark()); 32320: 0f 94 7e 91 call 0x322fc ; 0x322fc 32324: 48 2f mov r20, r24 32326: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 3232a: 80 e0 ldi r24, 0x00 ; 0 3232c: 0e 94 9b 69 call 0xd336 ; 0xd336 lcd_print_pad_P(str, LCD_WIDTH - 2); 32330: 62 e1 ldi r22, 0x12 ; 18 32332: c8 01 movw r24, r16 32334: 0e 94 50 6b call 0xd6a0 ; 0xd6a0 lcd_putc(type_char); 32338: 8c 2f mov r24, r28 } 3233a: cf 91 pop r28 3233c: 1f 91 pop r17 3233e: 0f 91 pop r16 static void menu_draw_item_puts_P(char type_char, const char* str) { lcd_putc_at(0, menu_row, menu_selection_mark()); lcd_print_pad_P(str, LCD_WIDTH - 2); lcd_putc(type_char); 32340: 0c 94 6a 69 jmp 0xd2d4 ; 0xd2d4 00032344 : } } void menu_item_ret(void) { lcd_draw_update = 2; 32344: 82 e0 ldi r24, 0x02 ; 2 32346: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b menu_item++; 3234a: 80 91 31 04 lds r24, 0x0431 ; 0x800431 3234e: 8f 5f subi r24, 0xFF ; 255 32350: 80 93 31 04 sts 0x0431, r24 ; 0x800431 //prevent the rest of the menu items from rendering or getting clicked menu_row = LCD_HEIGHT; // early exit from the MENU_BEGIN() for loop at the end of the current cycle 32354: 84 e0 ldi r24, 0x04 ; 4 32356: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e menu_line = 0; // prevent subsequent menu items from rendering at all in the current MENU_BEGIN() for loop cycle 3235a: 10 92 30 04 sts 0x0430, r1 ; 0x800430 menu_clicked = 0; // prevent subsequent items from being able to be clicked in case the current menu or position was changed by the clicked menu item 3235e: 10 92 2f 04 sts 0x042F, r1 ; 0x80042f } 32362: 08 95 ret 00032364 : } menu_item++; } void menu_item_gcode_P(const char* str, const char* str_gcode) { 32364: cf 93 push r28 32366: df 93 push r29 if (menu_item == menu_line) 32368: 30 91 31 04 lds r19, 0x0431 ; 0x800431 3236c: 20 91 30 04 lds r18, 0x0430 ; 0x800430 32370: 32 13 cpse r19, r18 32372: 20 c0 rjmp .+64 ; 0x323b4 32374: eb 01 movw r28, r22 32376: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 32378: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 3237c: 88 23 and r24, r24 3237e: 19 f0 breq .+6 ; 0x32386 32380: 80 e2 ldi r24, 0x20 ; 32 32382: 0f 94 8b 91 call 0x32316 ; 0x32316 if (menu_clicked && (lcd_encoder == menu_item)) 32386: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 3238a: 88 23 and r24, r24 3238c: 99 f0 breq .+38 ; 0x323b4 3238e: 20 91 31 04 lds r18, 0x0431 ; 0x800431 32392: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32396: 90 91 07 05 lds r25, 0x0507 ; 0x800507 3239a: 28 17 cp r18, r24 3239c: 19 06 cpc r1, r25 3239e: 51 f4 brne .+20 ; 0x323b4 { if (str_gcode) enquecommand_P(str_gcode); 323a0: 20 97 sbiw r28, 0x00 ; 0 323a2: 21 f0 breq .+8 ; 0x323ac 323a4: 61 e0 ldi r22, 0x01 ; 1 323a6: ce 01 movw r24, r28 323a8: 0e 94 af 7c call 0xf95e ; 0xf95e menu_item_ret(); return; } } menu_item++; } 323ac: df 91 pop r29 323ae: cf 91 pop r28 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); if (menu_clicked && (lcd_encoder == menu_item)) { if (str_gcode) enquecommand_P(str_gcode); menu_item_ret(); 323b0: 0d 94 a2 91 jmp 0x32344 ; 0x32344 return; } } menu_item++; 323b4: 80 91 31 04 lds r24, 0x0431 ; 0x800431 323b8: 8f 5f subi r24, 0xFF ; 255 323ba: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 323be: df 91 pop r29 323c0: cf 91 pop r28 323c2: 08 95 ret 000323c4 : //! @param func pointer to function taking uint8_t with no return value //! @param fn_par value to be passed to function //! @retval 0 //! @retval 1 Item was clicked void menu_item_function_P(const char* str, char number, void (*func)(uint8_t), uint8_t fn_par) { 323c4: ef 92 push r14 323c6: ff 92 push r15 323c8: 0f 93 push r16 323ca: 1f 93 push r17 323cc: cf 93 push r28 323ce: df 93 push r29 if (menu_item == menu_line) 323d0: 70 91 31 04 lds r23, 0x0431 ; 0x800431 323d4: 30 91 30 04 lds r19, 0x0430 ; 0x800430 323d8: 73 13 cpse r23, r19 323da: 3f c0 rjmp .+126 ; 0x3245a 323dc: 12 2f mov r17, r18 323de: ea 01 movw r28, r20 323e0: 06 2f mov r16, r22 323e2: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str, number); 323e4: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 323e8: 88 23 and r24, r24 323ea: d1 f0 breq .+52 ; 0x32420 } static void menu_draw_item_puts_P(char type_char, const char* str, char num) { const uint8_t max_strlen = LCD_WIDTH - 3; lcd_putc_at(0, menu_row, menu_selection_mark()); 323ec: 0f 94 7e 91 call 0x322fc ; 0x322fc 323f0: 48 2f mov r20, r24 323f2: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 323f6: 80 e0 ldi r24, 0x00 ; 0 323f8: 0e 94 9b 69 call 0xd336 ; 0xd336 uint8_t len = lcd_print_pad_P(str, max_strlen); 323fc: 61 e1 ldi r22, 0x11 ; 17 323fe: c7 01 movw r24, r14 32400: 0e 94 50 6b call 0xd6a0 ; 0xd6a0 lcd_putc_at((max_strlen - len) + 2, menu_row, num); 32404: 40 2f mov r20, r16 32406: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 3240a: 93 e1 ldi r25, 0x13 ; 19 3240c: 98 1b sub r25, r24 3240e: 89 2f mov r24, r25 32410: 0e 94 9b 69 call 0xd336 ; 0xd336 lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); 32414: 40 e2 ldi r20, 0x20 ; 32 32416: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 3241a: 83 e1 ldi r24, 0x13 ; 19 3241c: 0e 94 9b 69 call 0xd336 ; 0xd336 void menu_item_function_P(const char* str, char number, void (*func)(uint8_t), uint8_t fn_par) { if (menu_item == menu_line) { if (lcd_draw_update) menu_draw_item_puts_P(' ', str, number); if (menu_clicked && (lcd_encoder == menu_item)) 32420: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32424: 88 23 and r24, r24 32426: c9 f0 breq .+50 ; 0x3245a 32428: 20 91 31 04 lds r18, 0x0431 ; 0x800431 3242c: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32430: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32434: 28 17 cp r18, r24 32436: 19 06 cpc r1, r25 32438: 81 f4 brne .+32 ; 0x3245a { lcd_update_enabled = 0; 3243a: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c if (func) func(fn_par); 3243e: 81 2f mov r24, r17 32440: fe 01 movw r30, r28 32442: 19 95 eicall lcd_update_enabled = 1; 32444: 81 e0 ldi r24, 0x01 ; 1 32446: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c menu_item_ret(); return; } } menu_item++; } 3244a: df 91 pop r29 3244c: cf 91 pop r28 3244e: 1f 91 pop r17 32450: 0f 91 pop r16 32452: ff 90 pop r15 32454: ef 90 pop r14 if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = 0; if (func) func(fn_par); lcd_update_enabled = 1; menu_item_ret(); 32456: 0d 94 a2 91 jmp 0x32344 ; 0x32344 return; } } menu_item++; 3245a: 80 91 31 04 lds r24, 0x0431 ; 0x800431 3245e: 8f 5f subi r24, 0xFF ; 255 32460: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 32464: df 91 pop r29 32466: cf 91 pop r28 32468: 1f 91 pop r17 3246a: 0f 91 pop r16 3246c: ff 90 pop r15 3246e: ef 90 pop r14 32470: 08 95 ret 00032472 : bool __attribute__((noinline)) menu_item_leave(){ return ((menu_item == menu_line) && menu_clicked && (lcd_encoder == menu_item)) || menu_leaving; } void menu_item_function_P(const char* str, menu_func_t func) { 32472: cf 93 push r28 32474: df 93 push r29 if (menu_item == menu_line) 32476: 30 91 31 04 lds r19, 0x0431 ; 0x800431 3247a: 20 91 30 04 lds r18, 0x0430 ; 0x800430 3247e: 32 13 cpse r19, r18 32480: 21 c0 rjmp .+66 ; 0x324c4 32482: eb 01 movw r28, r22 32484: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 32486: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 3248a: 88 23 and r24, r24 3248c: 19 f0 breq .+6 ; 0x32494 3248e: 80 e2 ldi r24, 0x20 ; 32 32490: 0f 94 8b 91 call 0x32316 ; 0x32316 if (menu_clicked && (lcd_encoder == menu_item)) 32494: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32498: 88 23 and r24, r24 3249a: a1 f0 breq .+40 ; 0x324c4 3249c: 20 91 31 04 lds r18, 0x0431 ; 0x800431 324a0: 80 91 06 05 lds r24, 0x0506 ; 0x800506 324a4: 90 91 07 05 lds r25, 0x0507 ; 0x800507 324a8: 28 17 cp r18, r24 324aa: 19 06 cpc r1, r25 324ac: 59 f4 brne .+22 ; 0x324c4 { lcd_update_enabled = 0; 324ae: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c if (func) func(); 324b2: fe 01 movw r30, r28 324b4: 19 95 eicall lcd_update_enabled = 1; 324b6: 81 e0 ldi r24, 0x01 ; 1 324b8: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c menu_item_ret(); return; } } menu_item++; } 324bc: df 91 pop r29 324be: cf 91 pop r28 if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = 0; if (func) func(); lcd_update_enabled = 1; menu_item_ret(); 324c0: 0d 94 a2 91 jmp 0x32344 ; 0x32344 return; } } menu_item++; 324c4: 80 91 31 04 lds r24, 0x0431 ; 0x800431 324c8: 8f 5f subi r24, 0xFF ; 255 324ca: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 324ce: df 91 pop r29 324d0: cf 91 pop r28 324d2: 08 95 ret 000324d4 : menu_item++; } uint8_t menu_item_text_P(const char* str) { if (menu_item == menu_line) 324d4: 30 91 31 04 lds r19, 0x0431 ; 0x800431 324d8: 20 91 30 04 lds r18, 0x0430 ; 0x800430 324dc: 32 13 cpse r19, r18 324de: 19 c0 rjmp .+50 ; 0x32512 324e0: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 324e2: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 324e6: 88 23 and r24, r24 324e8: 19 f0 breq .+6 ; 0x324f0 324ea: 80 e2 ldi r24, 0x20 ; 32 324ec: 0f 94 8b 91 call 0x32316 ; 0x32316 if (menu_clicked && (lcd_encoder == menu_item)) 324f0: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 324f4: 88 23 and r24, r24 324f6: 69 f0 breq .+26 ; 0x32512 324f8: 20 91 31 04 lds r18, 0x0431 ; 0x800431 324fc: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32500: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32504: 28 17 cp r18, r24 32506: 19 06 cpc r1, r25 32508: 21 f4 brne .+8 ; 0x32512 { menu_item_ret(); 3250a: 0f 94 a2 91 call 0x32344 ; 0x32344 return 1; 3250e: 81 e0 ldi r24, 0x01 ; 1 32510: 08 95 ret } } menu_item++; 32512: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32516: 8f 5f subi r24, 0xFF ; 255 32518: 80 93 31 04 sts 0x0431, r24 ; 0x800431 return 0; 3251c: 80 e0 ldi r24, 0x00 ; 0 } 3251e: 08 95 ret 00032520 : menu_clicked = lcd_clicked(); // Consume click event } void menu_end(void) { if (menu_row >= LCD_HEIGHT) 32520: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 32524: 84 30 cpi r24, 0x04 ; 4 32526: 38 f5 brcc .+78 ; 0x32576 { // Early abort if the menu was clicked. The current menu might have changed because of the click event return; } if (lcd_encoder >= menu_item) 32528: 80 91 31 04 lds r24, 0x0431 ; 0x800431 3252c: 90 e0 ldi r25, 0x00 ; 0 3252e: 20 91 06 05 lds r18, 0x0506 ; 0x800506 32532: 30 91 07 05 lds r19, 0x0507 ; 0x800507 32536: 28 17 cp r18, r24 32538: 39 07 cpc r19, r25 3253a: 44 f0 brlt .+16 ; 0x3254c { lcd_encoder = menu_item - 1; 3253c: 01 97 sbiw r24, 0x01 ; 1 3253e: 90 93 07 05 sts 0x0507, r25 ; 0x800507 32542: 80 93 06 05 sts 0x0506, r24 ; 0x800506 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 32546: 87 e0 ldi r24, 0x07 ; 7 32548: 0f 94 9f 2c call 0x2593e ; 0x2593e } if (((uint8_t)lcd_encoder) >= menu_top + LCD_HEIGHT) 3254c: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32550: 20 91 60 03 lds r18, 0x0360 ; 0x800360 32554: 30 e0 ldi r19, 0x00 ; 0 32556: 2d 5f subi r18, 0xFD ; 253 32558: 3f 4f sbci r19, 0xFF ; 255 3255a: 82 17 cp r24, r18 3255c: 13 06 cpc r1, r19 3255e: 59 f0 breq .+22 ; 0x32576 32560: 54 f0 brlt .+20 ; 0x32576 { menu_top = lcd_encoder - LCD_HEIGHT + 1; 32562: 9d ef ldi r25, 0xFD ; 253 32564: 98 0f add r25, r24 32566: 90 93 60 03 sts 0x0360, r25 ; 0x800360 menu_line = menu_top - 1; 3256a: 84 50 subi r24, 0x04 ; 4 3256c: 80 93 30 04 sts 0x0430, r24 ; 0x800430 menu_row = -1; 32570: 8f ef ldi r24, 0xFF ; 255 32572: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e } } 32576: 08 95 ret 00032578 : CRITICAL_SECTION_END; } void menu_start(void) { if (lcd_encoder < 0) 32578: 80 91 06 05 lds r24, 0x0506 ; 0x800506 3257c: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32580: 97 ff sbrs r25, 7 32582: 07 c0 rjmp .+14 ; 0x32592 { lcd_encoder = 0; 32584: 10 92 07 05 sts 0x0507, r1 ; 0x800507 32588: 10 92 06 05 sts 0x0506, r1 ; 0x800506 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 3258c: 87 e0 ldi r24, 0x07 ; 7 3258e: 0f 94 9f 2c call 0x2593e ; 0x2593e } if (lcd_encoder < menu_top) 32592: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32596: 90 91 07 05 lds r25, 0x0507 ; 0x800507 3259a: 20 91 60 03 lds r18, 0x0360 ; 0x800360 3259e: 28 17 cp r18, r24 325a0: 19 06 cpc r1, r25 325a2: 19 f0 breq .+6 ; 0x325aa 325a4: 14 f0 brlt .+4 ; 0x325aa menu_top = lcd_encoder; 325a6: 80 93 60 03 sts 0x0360, r24 ; 0x800360 menu_line = menu_top; 325aa: 80 91 60 03 lds r24, 0x0360 ; 0x800360 325ae: 80 93 30 04 sts 0x0430, r24 ; 0x800430 menu_clicked = lcd_clicked(); // Consume click event 325b2: 0e 94 98 6b call 0xd730 ; 0xd730 325b6: 80 93 2f 04 sts 0x042F, r24 ; 0x80042f } 325ba: 08 95 ret 000325bc : void menu_data_reset(void) { // Resets the global shared C union. // This ensures, that the menu entered will find out, that it shall initialize itself. memset(&menu_data, 0, sizeof(menu_data)); 325bc: e4 e6 ldi r30, 0x64 ; 100 325be: f3 e0 ldi r31, 0x03 ; 3 325c0: 80 e2 ldi r24, 0x20 ; 32 325c2: df 01 movw r26, r30 325c4: 1d 92 st X+, r1 325c6: 8a 95 dec r24 325c8: e9 f7 brne .-6 ; 0x325c4 } 325ca: 08 95 ret 000325cc : void menu_goto(menu_func_t menu, const int16_t encoder, bool reset_menu_state, const bool feedback) { 325cc: cf 93 push r28 CRITICAL_SECTION_START; 325ce: 3f b7 in r19, 0x3f ; 63 325d0: f8 94 cli if (menu_menu != menu) 325d2: e0 91 d0 03 lds r30, 0x03D0 ; 0x8003d0 325d6: f0 91 d1 03 lds r31, 0x03D1 ; 0x8003d1 325da: e8 17 cp r30, r24 325dc: f9 07 cpc r31, r25 325de: c9 f0 breq .+50 ; 0x32612 325e0: c4 2f mov r28, r20 { menu_menu = menu; 325e2: 90 93 d1 03 sts 0x03D1, r25 ; 0x8003d1 325e6: 80 93 d0 03 sts 0x03D0, r24 ; 0x8003d0 lcd_encoder = encoder; 325ea: 70 93 07 05 sts 0x0507, r23 ; 0x800507 325ee: 60 93 06 05 sts 0x0506, r22 ; 0x800506 menu_top = 0; //reset menu view. Needed if menu_back() is called from deep inside a menu, such as Support 325f2: 10 92 60 03 sts 0x0360, r1 ; 0x800360 lcd_draw_update = 2; // Full LCD re-draw 325f6: 82 e0 ldi r24, 0x02 ; 2 325f8: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b CRITICAL_SECTION_END; 325fc: 3f bf out 0x3f, r19 ; 63 if (feedback) lcd_beeper_quick_feedback(); 325fe: 22 23 and r18, r18 32600: 19 f0 breq .+6 ; 0x32608 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 32602: 80 e0 ldi r24, 0x00 ; 0 32604: 0f 94 9f 2c call 0x2593e ; 0x2593e if (reset_menu_state) menu_data_reset(); 32608: cc 23 and r28, r28 3260a: 21 f0 breq .+8 ; 0x32614 } else CRITICAL_SECTION_END; } 3260c: cf 91 pop r28 lcd_encoder = encoder; menu_top = 0; //reset menu view. Needed if menu_back() is called from deep inside a menu, such as Support lcd_draw_update = 2; // Full LCD re-draw CRITICAL_SECTION_END; if (feedback) lcd_beeper_quick_feedback(); if (reset_menu_state) menu_data_reset(); 3260e: 0d 94 de 92 jmp 0x325bc ; 0x325bc } else CRITICAL_SECTION_END; 32612: 3f bf out 0x3f, r19 ; 63 } 32614: cf 91 pop r28 32616: 08 95 ret 00032618 : menu_back_no_reset(); } } void menu_item_edit_P(const char* str, void* pval, uint8_t pbits, int16_t min_val, int16_t max_val, int16_t jmp_val) { 32618: 7f 92 push r7 3261a: 8f 92 push r8 3261c: 9f 92 push r9 3261e: af 92 push r10 32620: bf 92 push r11 32622: cf 92 push r12 32624: df 92 push r13 32626: ef 92 push r14 32628: ff 92 push r15 3262a: 0f 93 push r16 3262c: 1f 93 push r17 3262e: cf 93 push r28 32630: df 93 push r29 menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (menu_item == menu_line) 32632: e0 91 31 04 lds r30, 0x0431 ; 0x800431 32636: 50 91 30 04 lds r21, 0x0430 ; 0x800430 3263a: e5 13 cpse r30, r21 3263c: 73 c0 rjmp .+230 ; 0x32724 { int16_t cur_val = (pbits == 8 ? *((uint8_t*)pval) : *((int16_t*)pval)); 3263e: fb 01 movw r30, r22 32640: 48 30 cpi r20, 0x08 ; 8 32642: 09 f0 breq .+2 ; 0x32646 32644: 6c c0 rjmp .+216 ; 0x3271e 32646: c0 81 ld r28, Z 32648: d0 e0 ldi r29, 0x00 ; 0 3264a: 49 01 movw r8, r18 3264c: 74 2e mov r7, r20 3264e: 6b 01 movw r12, r22 32650: 5c 01 movw r10, r24 if (lcd_draw_update) 32652: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 32656: 88 23 and r24, r24 32658: 59 f0 breq .+22 ; 0x32670 { lcd_set_cursor(0, menu_row); 3265a: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 3265e: 80 e0 ldi r24, 0x00 ; 0 32660: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 menu_draw_P(menu_selection_mark(), str, cur_val); 32664: 0f 94 7e 91 call 0x322fc ; 0x322fc 32668: ae 01 movw r20, r28 3266a: b5 01 movw r22, r10 3266c: 0f 94 1a 6e call 0x2dc34 ; 0x2dc34 } if (menu_clicked && (lcd_encoder == menu_item)) 32670: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32674: 88 23 and r24, r24 32676: 09 f4 brne .+2 ; 0x3267a 32678: 55 c0 rjmp .+170 ; 0x32724 3267a: 90 91 31 04 lds r25, 0x0431 ; 0x800431 3267e: 20 91 06 05 lds r18, 0x0506 ; 0x800506 32682: 30 91 07 05 lds r19, 0x0507 ; 0x800507 32686: 92 17 cp r25, r18 32688: 13 06 cpc r1, r19 3268a: 09 f0 breq .+2 ; 0x3268e 3268c: 4b c0 rjmp .+150 ; 0x32724 } } void menu_submenu_no_reset(menu_func_t submenu, const bool feedback) { if (menu_depth < MENU_DEPTH_MAX) 3268e: 80 91 ad 03 lds r24, 0x03AD ; 0x8003ad 32692: 87 30 cpi r24, 0x07 ; 7 32694: d8 f4 brcc .+54 ; 0x326cc { menu_stack[menu_depth].menu = menu_menu; 32696: 28 2f mov r18, r24 32698: 30 e0 ldi r19, 0x00 ; 0 3269a: f9 01 movw r30, r18 3269c: ee 0f add r30, r30 3269e: ff 1f adc r31, r31 326a0: e2 0f add r30, r18 326a2: f3 1f adc r31, r19 326a4: ef 56 subi r30, 0x6F ; 111 326a6: f9 4e sbci r31, 0xE9 ; 233 326a8: 20 91 d0 03 lds r18, 0x03D0 ; 0x8003d0 326ac: 30 91 d1 03 lds r19, 0x03D1 ; 0x8003d1 326b0: 31 83 std Z+1, r19 ; 0x01 326b2: 20 83 st Z, r18 menu_stack[menu_depth++].position = lcd_encoder; 326b4: 8f 5f subi r24, 0xFF ; 255 326b6: 80 93 ad 03 sts 0x03AD, r24 ; 0x8003ad 326ba: 92 83 std Z+2, r25 ; 0x02 menu_goto(submenu, 0, false, feedback); 326bc: 20 e0 ldi r18, 0x00 ; 0 326be: 40 e0 ldi r20, 0x00 ; 0 326c0: 70 e0 ldi r23, 0x00 ; 0 326c2: 60 e0 ldi r22, 0x00 ; 0 326c4: 8b e9 ldi r24, 0x9B ; 155 326c6: 97 e3 ldi r25, 0x37 ; 55 326c8: 0f 94 e6 92 call 0x325cc ; 0x325cc menu_draw_P(menu_selection_mark(), str, cur_val); } if (menu_clicked && (lcd_encoder == menu_item)) { menu_submenu_no_reset(_menu_edit_P); _md->editLabel = str; 326cc: b0 92 65 03 sts 0x0365, r11 ; 0x800365 326d0: a0 92 64 03 sts 0x0364, r10 ; 0x800364 _md->editValuePtr = pval; 326d4: d0 92 68 03 sts 0x0368, r13 ; 0x800368 326d8: c0 92 67 03 sts 0x0367, r12 ; 0x800367 _md->editValueBits = pbits; 326dc: 70 92 66 03 sts 0x0366, r7 ; 0x800366 _md->currentValue = cur_val; 326e0: d0 93 6a 03 sts 0x036A, r29 ; 0x80036a 326e4: c0 93 69 03 sts 0x0369, r28 ; 0x800369 _md->minEditValue = min_val; 326e8: 90 92 6c 03 sts 0x036C, r9 ; 0x80036c 326ec: 80 92 6b 03 sts 0x036B, r8 ; 0x80036b _md->maxEditValue = max_val; 326f0: 10 93 6e 03 sts 0x036E, r17 ; 0x80036e 326f4: 00 93 6d 03 sts 0x036D, r16 ; 0x80036d _md->minJumpValue = jmp_val; 326f8: f0 92 70 03 sts 0x0370, r15 ; 0x800370 326fc: e0 92 6f 03 sts 0x036F, r14 ; 0x80036f menu_item_ret(); return; } } menu_item++; } 32700: df 91 pop r29 32702: cf 91 pop r28 32704: 1f 91 pop r17 32706: 0f 91 pop r16 32708: ff 90 pop r15 3270a: ef 90 pop r14 3270c: df 90 pop r13 3270e: cf 90 pop r12 32710: bf 90 pop r11 32712: af 90 pop r10 32714: 9f 90 pop r9 32716: 8f 90 pop r8 32718: 7f 90 pop r7 _md->editValueBits = pbits; _md->currentValue = cur_val; _md->minEditValue = min_val; _md->maxEditValue = max_val; _md->minJumpValue = jmp_val; menu_item_ret(); 3271a: 0d 94 a2 91 jmp 0x32344 ; 0x32344 void menu_item_edit_P(const char* str, void* pval, uint8_t pbits, int16_t min_val, int16_t max_val, int16_t jmp_val) { menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (menu_item == menu_line) { int16_t cur_val = (pbits == 8 ? *((uint8_t*)pval) : *((int16_t*)pval)); 3271e: c0 81 ld r28, Z 32720: d1 81 ldd r29, Z+1 ; 0x01 32722: 93 cf rjmp .-218 ; 0x3264a _md->minJumpValue = jmp_val; menu_item_ret(); return; } } menu_item++; 32724: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32728: 8f 5f subi r24, 0xFF ; 255 3272a: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 3272e: df 91 pop r29 32730: cf 91 pop r28 32732: 1f 91 pop r17 32734: 0f 91 pop r16 32736: ff 90 pop r15 32738: ef 90 pop r14 3273a: df 90 pop r13 3273c: cf 90 pop r12 3273e: bf 90 pop r11 32740: af 90 pop r10 32742: 9f 90 pop r9 32744: 8f 90 pop r8 32746: 7f 90 pop r7 32748: 08 95 ret 0003274a <_menu_edit_P()>: } static void _menu_edit_P() { menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (lcd_draw_update) 3274a: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 3274e: 88 23 and r24, r24 32750: 09 f4 brne .+2 ; 0x32754 <_menu_edit_P()+0xa> 32752: 52 c0 rjmp .+164 ; 0x327f8 <_menu_edit_P()+0xae> { // handle initial value jumping if (_md->minJumpValue && lcd_encoder) { 32754: 20 91 6f 03 lds r18, 0x036F ; 0x80036f 32758: 30 91 70 03 lds r19, 0x0370 ; 0x800370 3275c: 80 91 6b 03 lds r24, 0x036B ; 0x80036b 32760: 90 91 6c 03 lds r25, 0x036C ; 0x80036c 32764: 21 15 cp r18, r1 32766: 31 05 cpc r19, r1 32768: d9 f0 breq .+54 ; 0x327a0 <_menu_edit_P()+0x56> 3276a: 40 91 06 05 lds r20, 0x0506 ; 0x800506 3276e: 50 91 07 05 lds r21, 0x0507 ; 0x800507 32772: 41 15 cp r20, r1 32774: 51 05 cpc r21, r1 32776: a1 f0 breq .+40 ; 0x327a0 <_menu_edit_P()+0x56> if (lcd_encoder > 0 && _md->currentValue == _md->minEditValue) { 32778: 7c f0 brlt .+30 ; 0x32798 <_menu_edit_P()+0x4e> 3277a: 40 91 69 03 lds r20, 0x0369 ; 0x800369 3277e: 50 91 6a 03 lds r21, 0x036A ; 0x80036a 32782: 48 17 cp r20, r24 32784: 59 07 cpc r21, r25 32786: 41 f4 brne .+16 ; 0x32798 <_menu_edit_P()+0x4e> _md->currentValue = _md->minJumpValue; 32788: 30 93 6a 03 sts 0x036A, r19 ; 0x80036a 3278c: 20 93 69 03 sts 0x0369, r18 ; 0x800369 lcd_encoder = 0; 32790: 10 92 07 05 sts 0x0507, r1 ; 0x800507 32794: 10 92 06 05 sts 0x0506, r1 ; 0x800506 } // disable after first use and/or if the initial value is not minEditValue _md->minJumpValue = 0; 32798: 10 92 70 03 sts 0x0370, r1 ; 0x800370 3279c: 10 92 6f 03 sts 0x036F, r1 ; 0x80036f } _md->currentValue += lcd_encoder; 327a0: 20 91 69 03 lds r18, 0x0369 ; 0x800369 327a4: 30 91 6a 03 lds r19, 0x036A ; 0x80036a 327a8: 40 91 06 05 lds r20, 0x0506 ; 0x800506 327ac: 50 91 07 05 lds r21, 0x0507 ; 0x800507 327b0: 24 0f add r18, r20 327b2: 35 1f adc r19, r21 lcd_encoder = 0; // Consume knob rotation event 327b4: 10 92 07 05 sts 0x0507, r1 ; 0x800507 327b8: 10 92 06 05 sts 0x0506, r1 ; 0x800506 // Constrain the value in case it's outside the allowed limits _md->currentValue = constrain(_md->currentValue, _md->minEditValue, _md->maxEditValue); 327bc: 28 17 cp r18, r24 327be: 39 07 cpc r19, r25 327c0: 44 f0 brlt .+16 ; 0x327d2 <_menu_edit_P()+0x88> 327c2: 80 91 6d 03 lds r24, 0x036D ; 0x80036d 327c6: 90 91 6e 03 lds r25, 0x036E ; 0x80036e 327ca: 28 17 cp r18, r24 327cc: 39 07 cpc r19, r25 327ce: 0c f4 brge .+2 ; 0x327d2 <_menu_edit_P()+0x88> 327d0: c9 01 movw r24, r18 327d2: 90 93 6a 03 sts 0x036A, r25 ; 0x80036a 327d6: 80 93 69 03 sts 0x0369, r24 ; 0x800369 lcd_set_cursor(0, 1); 327da: 61 e0 ldi r22, 0x01 ; 1 327dc: 80 e0 ldi r24, 0x00 ; 0 327de: 0e 94 7b 69 call 0xd2f6 ; 0xd2f6 menu_draw_P(' ', _md->editLabel, _md->currentValue); 327e2: 40 91 69 03 lds r20, 0x0369 ; 0x800369 327e6: 50 91 6a 03 lds r21, 0x036A ; 0x80036a 327ea: 60 91 64 03 lds r22, 0x0364 ; 0x800364 327ee: 70 91 65 03 lds r23, 0x0365 ; 0x800365 327f2: 80 e2 ldi r24, 0x20 ; 32 327f4: 0f 94 1a 6e call 0x2dc34 ; 0x2dc34 } if (lcd_clicked()) 327f8: 0e 94 98 6b call 0xd730 ; 0xd730 327fc: 88 23 and r24, r24 327fe: 41 f1 breq .+80 ; 0x32850 <_menu_edit_P()+0x106> 32800: e0 91 67 03 lds r30, 0x0367 ; 0x800367 32804: f0 91 68 03 lds r31, 0x0368 ; 0x800368 32808: 80 91 69 03 lds r24, 0x0369 ; 0x800369 3280c: 90 91 6a 03 lds r25, 0x036A ; 0x80036a { if (_md->editValueBits == 8) 32810: 20 91 66 03 lds r18, 0x0366 ; 0x800366 *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; 32814: 80 83 st Z, r24 lcd_set_cursor(0, 1); menu_draw_P(' ', _md->editLabel, _md->currentValue); } if (lcd_clicked()) { if (_md->editValueBits == 8) 32816: 28 30 cpi r18, 0x08 ; 8 32818: c9 f4 brne .+50 ; 0x3284c <_menu_edit_P()+0x102> menu_back(1); } void menu_back_no_reset(void) { if (menu_depth > 0) 3281a: 80 91 ad 03 lds r24, 0x03AD ; 0x8003ad 3281e: 88 23 and r24, r24 32820: b9 f0 breq .+46 ; 0x32850 <_menu_edit_P()+0x106> { menu_depth--; 32822: 81 50 subi r24, 0x01 ; 1 32824: 80 93 ad 03 sts 0x03AD, r24 ; 0x8003ad menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, false); 32828: 90 e0 ldi r25, 0x00 ; 0 3282a: fc 01 movw r30, r24 3282c: ee 0f add r30, r30 3282e: ff 1f adc r31, r31 32830: e8 0f add r30, r24 32832: f9 1f adc r31, r25 32834: ef 56 subi r30, 0x6F ; 111 32836: f9 4e sbci r31, 0xE9 ; 233 32838: 62 81 ldd r22, Z+2 ; 0x02 3283a: 06 2e mov r0, r22 3283c: 00 0c add r0, r0 3283e: 77 0b sbc r23, r23 32840: 20 e0 ldi r18, 0x00 ; 0 32842: 40 e0 ldi r20, 0x00 ; 0 32844: 80 81 ld r24, Z 32846: 91 81 ldd r25, Z+1 ; 0x01 32848: 0d 94 e6 92 jmp 0x325cc ; 0x325cc if (lcd_clicked()) { if (_md->editValueBits == 8) *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; else *((int16_t*)(_md->editValuePtr)) = _md->currentValue; 3284c: 91 83 std Z+1, r25 ; 0x01 3284e: e5 cf rjmp .-54 ; 0x3281a <_menu_edit_P()+0xd0> menu_back_no_reset(); } } 32850: 08 95 ret 00032852 : if (lcd_clicked()) menu_back(); } void menu_submenu(menu_func_t submenu, const bool feedback) { 32852: dc 01 movw r26, r24 32854: 26 2f mov r18, r22 if (menu_depth < MENU_DEPTH_MAX) 32856: 90 91 ad 03 lds r25, 0x03AD ; 0x8003ad 3285a: 97 30 cpi r25, 0x07 ; 7 3285c: d8 f4 brcc .+54 ; 0x32894 { menu_stack[menu_depth].menu = menu_menu; 3285e: 49 2f mov r20, r25 32860: 50 e0 ldi r21, 0x00 ; 0 32862: fa 01 movw r30, r20 32864: ee 0f add r30, r30 32866: ff 1f adc r31, r31 32868: e4 0f add r30, r20 3286a: f5 1f adc r31, r21 3286c: ef 56 subi r30, 0x6F ; 111 3286e: f9 4e sbci r31, 0xE9 ; 233 32870: 40 91 d0 03 lds r20, 0x03D0 ; 0x8003d0 32874: 50 91 d1 03 lds r21, 0x03D1 ; 0x8003d1 32878: 51 83 std Z+1, r21 ; 0x01 3287a: 40 83 st Z, r20 menu_stack[menu_depth++].position = lcd_encoder; 3287c: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32880: 9f 5f subi r25, 0xFF ; 255 32882: 90 93 ad 03 sts 0x03AD, r25 ; 0x8003ad 32886: 82 83 std Z+2, r24 ; 0x02 menu_goto(submenu, 0, true, feedback); 32888: 41 e0 ldi r20, 0x01 ; 1 3288a: 70 e0 ldi r23, 0x00 ; 0 3288c: 60 e0 ldi r22, 0x00 ; 0 3288e: cd 01 movw r24, r26 32890: 0d 94 e6 92 jmp 0x325cc ; 0x325cc } } 32894: 08 95 ret 00032896 : } menu_item++; } void menu_item_toggle_P(const char* str, const char* toggle, menu_func_t func, const uint8_t settings) { 32896: 8f 92 push r8 32898: 9f 92 push r9 3289a: af 92 push r10 3289c: bf 92 push r11 3289e: cf 92 push r12 328a0: df 92 push r13 328a2: ef 92 push r14 328a4: ff 92 push r15 328a6: 0f 93 push r16 328a8: 1f 93 push r17 328aa: cf 93 push r28 328ac: df 93 push r29 if (menu_item == menu_line) 328ae: e0 91 31 04 lds r30, 0x0431 ; 0x800431 328b2: 30 91 30 04 lds r19, 0x0430 ; 0x800430 328b6: e3 13 cpse r30, r19 328b8: 73 c0 rjmp .+230 ; 0x329a0 328ba: c2 2f mov r28, r18 328bc: 6a 01 movw r12, r20 328be: 7b 01 movw r14, r22 328c0: 5c 01 movw r10, r24 { if (lcd_draw_update) menu_draw_toggle_puts_P(str, toggle, settings | (menu_selection_mark()=='>')); 328c2: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 328c6: 88 23 and r24, r24 328c8: a1 f1 breq .+104 ; 0x32932 328ca: 0f 94 7e 91 call 0x322fc ; 0x322fc 328ce: 01 e0 ldi r16, 0x01 ; 1 328d0: 8e 33 cpi r24, 0x3E ; 62 328d2: 09 f0 breq .+2 ; 0x328d6 328d4: 00 e0 ldi r16, 0x00 ; 0 328d6: 0c 2b or r16, r28 { //settings: //xxxxxcba //a = selection mark. If it's set(1), then '>' will be used as the first character on the line. Else leave blank //b = toggle string is from progmem uint8_t is_progmem = settings & 0x02; 328d8: 80 2f mov r24, r16 328da: 82 70 andi r24, 0x02 ; 2 328dc: 88 2e mov r8, r24 const char eol = (toggle == NULL) ? LCD_STR_ARROW_RIGHT[0] : ' '; 328de: e1 14 cp r14, r1 328e0: f1 04 cpc r15, r1 328e2: 09 f4 brne .+2 ; 0x328e6 328e4: 6f c0 rjmp .+222 ; 0x329c4 328e6: e7 01 movw r28, r14 328e8: 90 e2 ldi r25, 0x20 ; 32 328ea: 99 2e mov r9, r25 if (toggle == NULL) toggle = _T(MSG_NA); uint8_t len = 4 + (is_progmem ? strlen_P(toggle) : strlen(toggle)); 328ec: 88 20 and r8, r8 328ee: 09 f4 brne .+2 ; 0x328f2 328f0: 41 c0 rjmp .+130 ; 0x32974 328f2: ce 01 movw r24, r28 328f4: 0f 94 9a 9d call 0x33b34 ; 0x33b34 <__strlen_P> 328f8: 14 e0 ldi r17, 0x04 ; 4 328fa: 18 0f add r17, r24 lcd_putc_at(0, menu_row, (settings & 0x01) ? '>' : ' '); 328fc: 4e e3 ldi r20, 0x3E ; 62 328fe: 00 ff sbrs r16, 0 32900: 40 e2 ldi r20, 0x20 ; 32 32902: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 32906: 80 e0 ldi r24, 0x00 ; 0 32908: 0e 94 9b 69 call 0xd336 ; 0xd336 lcd_print_pad_P(str, LCD_WIDTH - len); 3290c: 64 e1 ldi r22, 0x14 ; 20 3290e: 61 1b sub r22, r17 32910: c5 01 movw r24, r10 32912: 0e 94 50 6b call 0xd6a0 ; 0xd6a0 lcd_putc('['); 32916: 8b e5 ldi r24, 0x5B ; 91 32918: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 if (is_progmem) { lcd_puts_P(toggle); 3291c: ce 01 movw r24, r28 if (toggle == NULL) toggle = _T(MSG_NA); uint8_t len = 4 + (is_progmem ? strlen_P(toggle) : strlen(toggle)); lcd_putc_at(0, menu_row, (settings & 0x01) ? '>' : ' '); lcd_print_pad_P(str, LCD_WIDTH - len); lcd_putc('['); if (is_progmem) 3291e: 88 20 and r8, r8 32920: 89 f1 breq .+98 ; 0x32984 { lcd_puts_P(toggle); 32922: 0e 94 66 69 call 0xd2cc ; 0xd2cc } else { lcd_print(toggle); } lcd_putc(']'); 32926: 8d e5 ldi r24, 0x5D ; 93 32928: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 lcd_putc(eol); 3292c: 89 2d mov r24, r9 3292e: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 void menu_item_toggle_P(const char* str, const char* toggle, menu_func_t func, const uint8_t settings) { if (menu_item == menu_line) { if (lcd_draw_update) menu_draw_toggle_puts_P(str, toggle, settings | (menu_selection_mark()=='>')); if (menu_clicked && (lcd_encoder == menu_item)) 32932: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32936: 88 23 and r24, r24 32938: 99 f1 breq .+102 ; 0x329a0 3293a: 20 91 31 04 lds r18, 0x0431 ; 0x800431 3293e: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32942: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32946: 28 17 cp r18, r24 32948: 19 06 cpc r1, r25 3294a: 51 f5 brne .+84 ; 0x329a0 { if (toggle == NULL) // print N/A warning message 3294c: ef 28 or r14, r15 3294e: e9 f4 brne .+58 ; 0x3298a { menu_submenu(func); 32950: 60 e0 ldi r22, 0x00 ; 0 32952: c6 01 movw r24, r12 32954: 0f 94 29 94 call 0x32852 ; 0x32852 menu_item_ret(); return; } } menu_item++; } 32958: df 91 pop r29 3295a: cf 91 pop r28 3295c: 1f 91 pop r17 3295e: 0f 91 pop r16 32960: ff 90 pop r15 32962: ef 90 pop r14 32964: df 90 pop r13 32966: cf 90 pop r12 32968: bf 90 pop r11 3296a: af 90 pop r10 3296c: 9f 90 pop r9 3296e: 8f 90 pop r8 { lcd_update_enabled = 0; if (func) func(); lcd_update_enabled = 1; } menu_item_ret(); 32970: 0d 94 a2 91 jmp 0x32344 ; 0x32344 //a = selection mark. If it's set(1), then '>' will be used as the first character on the line. Else leave blank //b = toggle string is from progmem uint8_t is_progmem = settings & 0x02; const char eol = (toggle == NULL) ? LCD_STR_ARROW_RIGHT[0] : ' '; if (toggle == NULL) toggle = _T(MSG_NA); uint8_t len = 4 + (is_progmem ? strlen_P(toggle) : strlen(toggle)); 32974: fe 01 movw r30, r28 32976: 01 90 ld r0, Z+ 32978: 00 20 and r0, r0 3297a: e9 f7 brne .-6 ; 0x32976 3297c: ec 1b sub r30, r28 3297e: 13 e0 ldi r17, 0x03 ; 3 32980: 1e 0f add r17, r30 32982: bc cf rjmp .-136 ; 0x328fc lcd_putc('['); if (is_progmem) { lcd_puts_P(toggle); } else { lcd_print(toggle); 32984: 0e 94 82 6b call 0xd704 ; 0xd704 32988: ce cf rjmp .-100 ; 0x32926 { menu_submenu(func); } else // do the actual toggling { lcd_update_enabled = 0; 3298a: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c if (func) func(); 3298e: c1 14 cp r12, r1 32990: d1 04 cpc r13, r1 32992: 11 f0 breq .+4 ; 0x32998 32994: f6 01 movw r30, r12 32996: 19 95 eicall lcd_update_enabled = 1; 32998: 81 e0 ldi r24, 0x01 ; 1 3299a: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c 3299e: dc cf rjmp .-72 ; 0x32958 } menu_item_ret(); return; } } menu_item++; 329a0: 80 91 31 04 lds r24, 0x0431 ; 0x800431 329a4: 8f 5f subi r24, 0xFF ; 255 329a6: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 329aa: df 91 pop r29 329ac: cf 91 pop r28 329ae: 1f 91 pop r17 329b0: 0f 91 pop r16 329b2: ff 90 pop r15 329b4: ef 90 pop r14 329b6: df 90 pop r13 329b8: cf 90 pop r12 329ba: bf 90 pop r11 329bc: af 90 pop r10 329be: 9f 90 pop r9 329c0: 8f 90 pop r8 329c2: 08 95 ret //xxxxxcba //a = selection mark. If it's set(1), then '>' will be used as the first character on the line. Else leave blank //b = toggle string is from progmem uint8_t is_progmem = settings & 0x02; const char eol = (toggle == NULL) ? LCD_STR_ARROW_RIGHT[0] : ' '; if (toggle == NULL) toggle = _T(MSG_NA); 329c4: 8c e8 ldi r24, 0x8C ; 140 329c6: 9d e3 ldi r25, 0x3D ; 61 329c8: 0e 94 b1 6c call 0xd962 ; 0xd962 329cc: ec 01 movw r28, r24 //settings: //xxxxxcba //a = selection mark. If it's set(1), then '>' will be used as the first character on the line. Else leave blank //b = toggle string is from progmem uint8_t is_progmem = settings & 0x02; const char eol = (toggle == NULL) ? LCD_STR_ARROW_RIGHT[0] : ' '; 329ce: 8e e7 ldi r24, 0x7E ; 126 329d0: 98 2e mov r9, r24 329d2: 8c cf rjmp .-232 ; 0x328ec 000329d4 : menu_item++; return 0; } void menu_item_submenu_P(const char* str, menu_func_t submenu) { 329d4: cf 93 push r28 329d6: df 93 push r29 if (menu_item == menu_line) 329d8: 30 91 31 04 lds r19, 0x0431 ; 0x800431 329dc: 20 91 30 04 lds r18, 0x0430 ; 0x800430 329e0: 32 13 cpse r19, r18 329e2: 1e c0 rjmp .+60 ; 0x32a20 329e4: eb 01 movw r28, r22 329e6: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_ARROW_RIGHT[0], str); 329e8: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 329ec: 88 23 and r24, r24 329ee: 19 f0 breq .+6 ; 0x329f6 329f0: 8e e7 ldi r24, 0x7E ; 126 329f2: 0f 94 8b 91 call 0x32316 ; 0x32316 if (menu_clicked && (lcd_encoder == menu_item)) 329f6: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 329fa: 88 23 and r24, r24 329fc: 89 f0 breq .+34 ; 0x32a20 329fe: 20 91 31 04 lds r18, 0x0431 ; 0x800431 32a02: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32a06: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32a0a: 28 17 cp r18, r24 32a0c: 19 06 cpc r1, r25 32a0e: 41 f4 brne .+16 ; 0x32a20 { menu_submenu(submenu); 32a10: 60 e0 ldi r22, 0x00 ; 0 32a12: ce 01 movw r24, r28 32a14: 0f 94 29 94 call 0x32852 ; 0x32852 menu_item_ret(); return; } } menu_item++; } 32a18: df 91 pop r29 32a1a: cf 91 pop r28 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_ARROW_RIGHT[0], str); if (menu_clicked && (lcd_encoder == menu_item)) { menu_submenu(submenu); menu_item_ret(); 32a1c: 0d 94 a2 91 jmp 0x32344 ; 0x32344 return; } } menu_item++; 32a20: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32a24: 8f 5f subi r24, 0xFF ; 255 32a26: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 32a2a: df 91 pop r29 32a2c: cf 91 pop r28 32a2e: 08 95 ret 00032a30 : void menu_item_submenu_E(const Sheet &sheet, menu_func_t submenu) { 32a30: 0f 93 push r16 32a32: 1f 93 push r17 32a34: cf 93 push r28 32a36: df 93 push r29 32a38: cd b7 in r28, 0x3d ; 61 32a3a: de b7 in r29, 0x3e ; 62 32a3c: 63 97 sbiw r28, 0x13 ; 19 32a3e: 0f b6 in r0, 0x3f ; 63 32a40: f8 94 cli 32a42: de bf out 0x3e, r29 ; 62 32a44: 0f be out 0x3f, r0 ; 63 32a46: cd bf out 0x3d, r28 ; 61 if (menu_item == menu_line) 32a48: 30 91 31 04 lds r19, 0x0431 ; 0x800431 32a4c: 20 91 30 04 lds r18, 0x0430 ; 0x800430 32a50: 32 13 cpse r19, r18 32a52: 38 c0 rjmp .+112 ; 0x32ac4 32a54: 8b 01 movw r16, r22 { if (lcd_draw_update) menu_draw_item_puts_E(LCD_STR_ARROW_RIGHT[0], sheet); 32a56: 20 91 5b 02 lds r18, 0x025B ; 0x80025b 32a5a: 22 23 and r18, r18 32a5c: a9 f0 breq .+42 ; 0x32a88 static void menu_draw_item_puts_E(char type_char, const Sheet &sheet) { SheetFormatBuffer buffer; menu_format_sheet_E(sheet, buffer); 32a5e: be 01 movw r22, r28 32a60: 6f 5f subi r22, 0xFF ; 255 32a62: 7f 4f sbci r23, 0xFF ; 255 32a64: 0f 94 56 91 call 0x322ac ; 0x322ac lcd_putc_at(0, menu_row, menu_selection_mark()); 32a68: 0f 94 7e 91 call 0x322fc ; 0x322fc 32a6c: 48 2f mov r20, r24 32a6e: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 32a72: 80 e0 ldi r24, 0x00 ; 0 32a74: 0e 94 9b 69 call 0xd336 ; 0xd336 lcd_print_pad(buffer.c, LCD_WIDTH - 2); 32a78: 62 e1 ldi r22, 0x12 ; 18 32a7a: ce 01 movw r24, r28 32a7c: 01 96 adiw r24, 0x01 ; 1 32a7e: 0e 94 6a 6b call 0xd6d4 ; 0xd6d4 lcd_putc(type_char); 32a82: 8e e7 ldi r24, 0x7E ; 126 32a84: 0e 94 6a 69 call 0xd2d4 ; 0xd2d4 void menu_item_submenu_E(const Sheet &sheet, menu_func_t submenu) { if (menu_item == menu_line) { if (lcd_draw_update) menu_draw_item_puts_E(LCD_STR_ARROW_RIGHT[0], sheet); if (menu_clicked && (lcd_encoder == menu_item)) 32a88: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32a8c: 88 23 and r24, r24 32a8e: d1 f0 breq .+52 ; 0x32ac4 32a90: 20 91 31 04 lds r18, 0x0431 ; 0x800431 32a94: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32a98: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32a9c: 28 17 cp r18, r24 32a9e: 19 06 cpc r1, r25 32aa0: 89 f4 brne .+34 ; 0x32ac4 if (menu_item == menu_line) { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_ARROW_RIGHT[0], str); if (menu_clicked && (lcd_encoder == menu_item)) { menu_submenu(submenu); 32aa2: 60 e0 ldi r22, 0x00 ; 0 32aa4: c8 01 movw r24, r16 32aa6: 0f 94 29 94 call 0x32852 ; 0x32852 menu_item_ret(); 32aaa: 0f 94 a2 91 call 0x32344 ; 0x32344 menu_item_ret(); return; } } menu_item++; } 32aae: 63 96 adiw r28, 0x13 ; 19 32ab0: 0f b6 in r0, 0x3f ; 63 32ab2: f8 94 cli 32ab4: de bf out 0x3e, r29 ; 62 32ab6: 0f be out 0x3f, r0 ; 63 32ab8: cd bf out 0x3d, r28 ; 61 32aba: df 91 pop r29 32abc: cf 91 pop r28 32abe: 1f 91 pop r17 32ac0: 0f 91 pop r16 32ac2: 08 95 ret menu_submenu(submenu); menu_item_ret(); return; } } menu_item++; 32ac4: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32ac8: 8f 5f subi r24, 0xFF ; 255 32aca: 80 93 31 04 sts 0x0431, r24 ; 0x800431 32ace: ef cf rjmp .-34 ; 0x32aae 00032ad0 : menu_row = -1; } } void menu_back(uint8_t nLevel) { 32ad0: 98 2f mov r25, r24 menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 32ad2: 80 91 ad 03 lds r24, 0x03AD ; 0x8003ad 32ad6: 98 17 cp r25, r24 32ad8: a8 f4 brcc .+42 ; 0x32b04 32ada: 89 1b sub r24, r25 32adc: 80 93 ad 03 sts 0x03AD, r24 ; 0x8003ad menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); 32ae0: 90 e0 ldi r25, 0x00 ; 0 32ae2: fc 01 movw r30, r24 32ae4: ee 0f add r30, r30 32ae6: ff 1f adc r31, r31 32ae8: e8 0f add r30, r24 32aea: f9 1f adc r31, r25 32aec: ef 56 subi r30, 0x6F ; 111 32aee: f9 4e sbci r31, 0xE9 ; 233 32af0: 62 81 ldd r22, Z+2 ; 0x02 32af2: 06 2e mov r0, r22 32af4: 00 0c add r0, r0 32af6: 77 0b sbc r23, r23 32af8: 20 e0 ldi r18, 0x00 ; 0 32afa: 41 e0 ldi r20, 0x01 ; 1 32afc: 80 81 ld r24, Z 32afe: 91 81 ldd r25, Z+1 ; 0x01 32b00: 0d 94 e6 92 jmp 0x325cc ; 0x325cc } } void menu_back(uint8_t nLevel) { menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 32b04: 80 e0 ldi r24, 0x00 ; 0 32b06: ea cf rjmp .-44 ; 0x32adc 00032b08 : menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); } void menu_back(void) { menu_back(1); 32b08: 81 e0 ldi r24, 0x01 ; 1 32b0a: 0d 94 68 95 jmp 0x32ad0 ; 0x32ad0 00032b0e : menu_item++; } void menu_item_back_P(const char* str) { if (menu_item == menu_line) 32b0e: 30 91 31 04 lds r19, 0x0431 ; 0x800431 32b12: 20 91 30 04 lds r18, 0x0430 ; 0x800430 32b16: 32 13 cpse r19, r18 32b18: 19 c0 rjmp .+50 ; 0x32b4c 32b1a: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_UPLEVEL[0], str); 32b1c: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 32b20: 88 23 and r24, r24 32b22: 19 f0 breq .+6 ; 0x32b2a 32b24: 83 e8 ldi r24, 0x83 ; 131 32b26: 0f 94 8b 91 call 0x32316 ; 0x32316 if (menu_clicked && (lcd_encoder == menu_item)) 32b2a: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32b2e: 88 23 and r24, r24 32b30: 69 f0 breq .+26 ; 0x32b4c 32b32: 20 91 31 04 lds r18, 0x0431 ; 0x800431 32b36: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32b3a: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32b3e: 28 17 cp r18, r24 32b40: 19 06 cpc r1, r25 32b42: 21 f4 brne .+8 ; 0x32b4c { menu_back(); 32b44: 0f 94 84 95 call 0x32b08 ; 0x32b08 menu_item_ret(); 32b48: 0d 94 a2 91 jmp 0x32344 ; 0x32344 return; } } menu_item++; 32b4c: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32b50: 8f 5f subi r24, 0xFF ; 255 32b52: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 32b56: 08 95 ret 00032b58 : }; static_assert(sizeof(_menu_tune_data_t) == 18); static_assert(sizeof(menu_data)>= sizeof(_menu_tune_data_t),"_menu_tune_data_t doesn't fit into menu_data"); void tuneIdlerStallguardThresholdMenu() { 32b58: ef 92 push r14 32b5a: ff 92 push r15 32b5c: 0f 93 push r16 32b5e: 1f 93 push r17 32b60: cf 93 push r28 32b62: df 93 push r29 32b64: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 static constexpr _menu_tune_data_t * const _md = (_menu_tune_data_t*)&(menu_data[0]); // Do not timeout the screen, otherwise there will be FW crash (menu recursion) lcd_timeoutToStatus.stop(); if (_md->status == 0) 32b68: 80 91 71 03 lds r24, 0x0371 ; 0x800371 32b6c: 81 11 cpse r24, r1 32b6e: 23 c0 rjmp .+70 ; 0x32bb6 { _md->status = 1; // Menu entered for the first time 32b70: 81 e0 ldi r24, 0x01 ; 1 32b72: 80 93 71 03 sts 0x0371, r24 ; 0x800371 // Fetch the TuneItem from PROGMEM const uint8_t offset = (mmu2.MMUCurrentErrorCode() == ErrorCode::HOMING_IDLER_FAILED) ? 1 : 0; 32b76: 81 e0 ldi r24, 0x01 ; 1 32b78: 90 e0 ldi r25, 0x00 ; 0 32b7a: 20 91 65 12 lds r18, 0x1265 ; 0x801265 32b7e: 30 91 66 12 lds r19, 0x1266 ; 0x801266 32b82: 27 30 cpi r18, 0x07 ; 7 32b84: 31 48 sbci r19, 0x81 ; 129 32b86: 11 f0 breq .+4 ; 0x32b8c 32b88: 90 e0 ldi r25, 0x00 ; 0 32b8a: 80 e0 ldi r24, 0x00 ; 0 memcpy_P(&(_md->item), &TuneItems[offset], sizeof(TuneItem)); 32b8c: bc 01 movw r22, r24 32b8e: 66 0f add r22, r22 32b90: 77 1f adc r23, r23 32b92: 68 0f add r22, r24 32b94: 79 1f adc r23, r25 32b96: 62 55 subi r22, 0x52 ; 82 32b98: 72 46 sbci r23, 0x62 ; 98 32b9a: 43 e0 ldi r20, 0x03 ; 3 32b9c: 50 e0 ldi r21, 0x00 ; 0 32b9e: 83 e7 ldi r24, 0x73 ; 115 32ba0: 93 e0 ldi r25, 0x03 ; 3 32ba2: 0f 94 76 9d call 0x33aec ; 0x33aec // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); 32ba6: 80 91 73 03 lds r24, 0x0373 ; 0x800373 32baa: 0e 94 7d f7 call 0x1eefa ; 0x1eefa _md->currentValue = mmu2.GetLastReadRegisterValue(); 32bae: 80 91 90 12 lds r24, 0x1290 ; 0x801290 32bb2: 80 93 72 03 sts 0x0372, r24 ; 0x800372 } MENU_BEGIN(); 32bb6: 0f 94 bc 92 call 0x32578 ; 0x32578 32bba: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 32bbe: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 32bc2: 84 30 cpi r24, 0x04 ; 4 32bc4: e0 f5 brcc .+120 ; 0x32c3e 32bc6: 10 92 31 04 sts 0x0431, r1 ; 0x800431 ON_MENU_LEAVE( 32bca: 0f 94 3c 91 call 0x32278 ; 0x32278 32bce: 88 23 and r24, r24 32bd0: 89 f0 breq .+34 ; 0x32bf4 32bd2: 60 91 72 03 lds r22, 0x0372 ; 0x800372 32bd6: 70 e0 ldi r23, 0x00 ; 0 32bd8: 80 91 73 03 lds r24, 0x0373 ; 0x800373 32bdc: 0e 94 9f bf call 0x17f3e ; 0x17f3e 32be0: 10 92 ad 0d sts 0x0DAD, r1 ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.458> &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 32be4: df 91 pop r29 32be6: cf 91 pop r28 32be8: 1f 91 pop r17 32bea: 0f 91 pop r16 32bec: ff 90 pop r15 32bee: ef 90 pop r14 mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); ON_MENU_LEAVE( 32bf0: 0c 94 17 fe jmp 0x1fc2e ; 0x1fc2e mmu2.WriteRegister(_md->item.address, (uint16_t)_md->currentValue); putErrorScreenToSleep = false; lcd_return_to_status(); return; ); MENU_ITEM_BACK_P(_T(MSG_DONE)); 32bf4: 88 e8 ldi r24, 0x88 ; 136 32bf6: 92 e6 ldi r25, 0x62 ; 98 32bf8: 0e 94 b1 6c call 0xd962 ; 0xd962 32bfc: 0f 94 87 95 call 0x32b0e ; 0x32b0e MENU_ITEM_EDIT_int3_P( 32c00: 00 91 75 03 lds r16, 0x0375 ; 0x800375 32c04: 10 e0 ldi r17, 0x00 ; 0 32c06: c0 91 74 03 lds r28, 0x0374 ; 0x800374 32c0a: d0 e0 ldi r29, 0x00 ; 0 32c0c: 8a e7 ldi r24, 0x7A ; 122 32c0e: 92 e6 ldi r25, 0x62 ; 98 32c10: 0e 94 b1 6c call 0xd962 ; 0xd962 32c14: f1 2c mov r15, r1 32c16: e1 2c mov r14, r1 32c18: 9e 01 movw r18, r28 32c1a: 48 e0 ldi r20, 0x08 ; 8 32c1c: 62 e7 ldi r22, 0x72 ; 114 32c1e: 73 e0 ldi r23, 0x03 ; 3 32c20: 0f 94 0c 93 call 0x32618 ; 0x32618 _T(MSG_MMU_SENSITIVITY), &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); 32c24: 0f 94 90 92 call 0x32520 ; 0x32520 // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); 32c28: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 32c2c: 8f 5f subi r24, 0xFF ; 255 32c2e: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 32c32: 80 91 30 04 lds r24, 0x0430 ; 0x800430 32c36: 8f 5f subi r24, 0xFF ; 255 32c38: 80 93 30 04 sts 0x0430, r24 ; 0x800430 32c3c: c0 cf rjmp .-128 ; 0x32bbe &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 32c3e: df 91 pop r29 32c40: cf 91 pop r28 32c42: 1f 91 pop r17 32c44: 0f 91 pop r16 32c46: ff 90 pop r15 32c48: ef 90 pop r14 32c4a: 08 95 ret 00032c4c : } } void menu_back_if_clicked(void) { if (lcd_clicked()) 32c4c: 0e 94 98 6b call 0xd730 ; 0xd730 32c50: 81 11 cpse r24, r1 menu_back(); 32c52: 0d 94 84 95 jmp 0x32b08 ; 0x32b08 } 32c56: 08 95 ret 00032c58 : } // Private Methods ///////////////////////////////////////////////////////////// void MarlinSerial::printNumber(unsigned long n, uint8_t base) { 32c58: 8f 92 push r8 32c5a: 9f 92 push r9 32c5c: af 92 push r10 32c5e: bf 92 push r11 32c60: ef 92 push r14 32c62: ff 92 push r15 32c64: 0f 93 push r16 32c66: 1f 93 push r17 32c68: cf 93 push r28 32c6a: df 93 push r29 32c6c: cd b7 in r28, 0x3d ; 61 32c6e: de b7 in r29, 0x3e ; 62 32c70: a0 97 sbiw r28, 0x20 ; 32 32c72: 0f b6 in r0, 0x3f ; 63 32c74: f8 94 cli 32c76: de bf out 0x3e, r29 ; 62 32c78: 0f be out 0x3f, r0 ; 63 32c7a: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) { 32c7c: 61 15 cp r22, r1 32c7e: 71 05 cpc r23, r1 32c80: 81 05 cpc r24, r1 32c82: 91 05 cpc r25, r1 32c84: 99 f4 brne .+38 ; 0x32cac } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32c86: 80 e3 ldi r24, 0x30 ; 48 for (; i > 0; i--) print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); } 32c88: a0 96 adiw r28, 0x20 ; 32 32c8a: 0f b6 in r0, 0x3f ; 63 32c8c: f8 94 cli 32c8e: de bf out 0x3e, r29 ; 62 32c90: 0f be out 0x3f, r0 ; 63 32c92: cd bf out 0x3d, r28 ; 61 32c94: df 91 pop r29 32c96: cf 91 pop r28 32c98: 1f 91 pop r17 32c9a: 0f 91 pop r16 32c9c: ff 90 pop r15 32c9e: ef 90 pop r14 32ca0: bf 90 pop r11 32ca2: af 90 pop r10 32ca4: 9f 90 pop r9 32ca6: 8f 90 pop r8 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32ca8: 0c 94 41 70 jmp 0xe082 ; 0xe082 // Private Methods ///////////////////////////////////////////////////////////// void MarlinSerial::printNumber(unsigned long n, uint8_t base) { unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; 32cac: 00 e0 ldi r16, 0x00 ; 0 print('0'); return; } while (n > 0) { buf[i++] = n % base; 32cae: 84 2e mov r8, r20 32cb0: 91 2c mov r9, r1 32cb2: b1 2c mov r11, r1 32cb4: a1 2c mov r10, r1 32cb6: 9e 01 movw r18, r28 32cb8: 2f 5f subi r18, 0xFF ; 255 32cba: 3f 4f sbci r19, 0xFF ; 255 32cbc: 79 01 movw r14, r18 32cbe: a5 01 movw r20, r10 32cc0: 94 01 movw r18, r8 32cc2: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> 32cc6: f7 01 movw r30, r14 32cc8: e0 0f add r30, r16 32cca: f1 1d adc r31, r1 32ccc: 60 83 st Z, r22 n /= base; 32cce: b9 01 movw r22, r18 32cd0: ca 01 movw r24, r20 print('0'); return; } while (n > 0) { buf[i++] = n % base; 32cd2: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { print('0'); return; } while (n > 0) { 32cd4: 61 15 cp r22, r1 32cd6: 71 05 cpc r23, r1 32cd8: 81 05 cpc r24, r1 32cda: 91 05 cpc r25, r1 32cdc: 81 f7 brne .-32 ; 0x32cbe 32cde: 0e 0d add r16, r14 32ce0: 1f 2d mov r17, r15 32ce2: 11 1d adc r17, r1 buf[i++] = n % base; n /= base; } for (; i > 0; i--) 32ce4: e0 16 cp r14, r16 32ce6: f1 06 cpc r15, r17 32ce8: 59 f0 breq .+22 ; 0x32d00 print((char) (buf[i - 1] < 10 ? 32cea: f8 01 movw r30, r16 32cec: 82 91 ld r24, -Z 32cee: 8f 01 movw r16, r30 32cf0: 8a 30 cpi r24, 0x0A ; 10 32cf2: 20 f4 brcc .+8 ; 0x32cfc '0' + buf[i - 1] : 32cf4: 80 5d subi r24, 0xD0 ; 208 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32cf6: 0e 94 41 70 call 0xe082 ; 0xe082 32cfa: f4 cf rjmp .-24 ; 0x32ce4 } for (; i > 0; i--) print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); 32cfc: 89 5c subi r24, 0xC9 ; 201 32cfe: fb cf rjmp .-10 ; 0x32cf6 } 32d00: a0 96 adiw r28, 0x20 ; 32 32d02: 0f b6 in r0, 0x3f ; 63 32d04: f8 94 cli 32d06: de bf out 0x3e, r29 ; 62 32d08: 0f be out 0x3f, r0 ; 63 32d0a: cd bf out 0x3d, r28 ; 61 32d0c: df 91 pop r29 32d0e: cf 91 pop r28 32d10: 1f 91 pop r17 32d12: 0f 91 pop r16 32d14: ff 90 pop r15 32d16: ef 90 pop r14 32d18: bf 90 pop r11 32d1a: af 90 pop r10 32d1c: 9f 90 pop r9 32d1e: 8f 90 pop r8 32d20: 08 95 ret 00032d22 : static void prusa_stat_farm_number() { SERIAL_ECHOPGM("[PFN:0]"); } static void prusa_stat_diameter() { SERIAL_ECHOPGM("[DIA:"); 32d22: 81 e0 ldi r24, 0x01 ; 1 32d24: 9f e9 ldi r25, 0x9F ; 159 32d26: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHO(eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)); 32d2a: 85 ea ldi r24, 0xA5 ; 165 32d2c: 9d e0 ldi r25, 0x0D ; 13 32d2e: 0f 94 ea 9f call 0x33fd4 ; 0x33fd4 print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 32d32: bc 01 movw r22, r24 32d34: 90 e0 ldi r25, 0x00 ; 0 32d36: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 32d38: 4a e0 ldi r20, 0x0A ; 10 32d3a: 0f 94 2c 96 call 0x32c58 ; 0x32c58 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32d3e: 8d e5 ldi r24, 0x5D ; 93 32d40: 0c 94 41 70 jmp 0xe082 ; 0xe082 00032d44 : void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); } void MarlinSerial::print(long n, int base) 32d44: cf 92 push r12 32d46: df 92 push r13 32d48: ef 92 push r14 32d4a: ff 92 push r15 32d4c: 6b 01 movw r12, r22 32d4e: 7c 01 movw r14, r24 { if (base == 0) { write(n); } else if (base == 10) { if (n < 0) { 32d50: f7 fe sbrs r15, 7 32d52: 0b c0 rjmp .+22 ; 0x32d6a } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32d54: 8d e2 ldi r24, 0x2D ; 45 32d56: 0e 94 41 70 call 0xe082 ; 0xe082 } else if (base == 10) { if (n < 0) { print('-'); n = -n; 32d5a: f0 94 com r15 32d5c: e0 94 com r14 32d5e: d0 94 com r13 32d60: c0 94 com r12 32d62: c1 1c adc r12, r1 32d64: d1 1c adc r13, r1 32d66: e1 1c adc r14, r1 32d68: f1 1c adc r15, r1 } printNumber(n, 10); 32d6a: 4a e0 ldi r20, 0x0A ; 10 32d6c: c7 01 movw r24, r14 32d6e: b6 01 movw r22, r12 } else { printNumber(n, base); } } 32d70: ff 90 pop r15 32d72: ef 90 pop r14 32d74: df 90 pop r13 32d76: cf 90 pop r12 } else if (base == 10) { if (n < 0) { print('-'); n = -n; } printNumber(n, 10); 32d78: 0d 94 2c 96 jmp 0x32c58 ; 0x32c58 00032d7c : SERIAL_ECHO(c); SERIAL_ECHO(']'); prusa_stat_farm_number(); } static void prusa_statistics_case0(uint8_t statnr) { 32d7c: cf 93 push r28 32d7e: c8 2f mov r28, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32d80: 8b e7 ldi r24, 0x7B ; 123 32d82: 0e 94 41 70 call 0xe082 ; 0xe082 SERIAL_ECHO('{'); prusa_stat_printerstatus(statnr); 32d86: 8c 2f mov r24, r28 32d88: 0f 94 9c 6b call 0x2d738 ; 0x2d738 prusa_stat_farm_number(); 32d8c: 0f 94 98 6b call 0x2d730 ; 0x2d730 SERIAL_ECHO(current_temperature_bed); SERIAL_ECHO(']'); } static void prusa_stat_printinfo() { SERIAL_ECHOPGM("[TFU:"); 32d90: 8d ee ldi r24, 0xED ; 237 32d92: 9e e9 ldi r25, 0x9E ; 158 32d94: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 32d98: 60 91 84 06 lds r22, 0x0684 ; 0x800684 32d9c: 70 91 85 06 lds r23, 0x0685 ; 0x800685 32da0: 80 91 86 06 lds r24, 0x0686 ; 0x800686 32da4: 90 91 87 06 lds r25, 0x0687 ; 0x800687 32da8: 4a e0 ldi r20, 0x0A ; 10 32daa: 0f 94 2c 96 call 0x32c58 ; 0x32c58 SERIAL_ECHO(total_filament_used); SERIAL_ECHOPGM("][PCD:"); 32dae: 86 ee ldi r24, 0xE6 ; 230 32db0: 9e e9 ldi r25, 0x9E ; 158 32db2: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; FORCE_INLINE uint8_t percentDone(){if(!isFileOpen()) return 0; if(filesize) return sdpos/((filesize+99)/100); else return 0;}; 32db6: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 32dba: 88 23 and r24, r24 32dbc: 09 f4 brne .+2 ; 0x32dc0 32dbe: 5e c0 rjmp .+188 ; 0x32e7c 32dc0: 80 91 77 16 lds r24, 0x1677 ; 0x801677 32dc4: 90 91 78 16 lds r25, 0x1678 ; 0x801678 32dc8: a0 91 79 16 lds r26, 0x1679 ; 0x801679 32dcc: b0 91 7a 16 lds r27, 0x167A ; 0x80167a 32dd0: 00 97 sbiw r24, 0x00 ; 0 32dd2: a1 05 cpc r26, r1 32dd4: b1 05 cpc r27, r1 32dd6: 09 f4 brne .+2 ; 0x32dda 32dd8: 51 c0 rjmp .+162 ; 0x32e7c 32dda: bc 01 movw r22, r24 32ddc: cd 01 movw r24, r26 32dde: 6d 59 subi r22, 0x9D ; 157 32de0: 7f 4f sbci r23, 0xFF ; 255 32de2: 8f 4f sbci r24, 0xFF ; 255 32de4: 9f 4f sbci r25, 0xFF ; 255 32de6: 24 e6 ldi r18, 0x64 ; 100 32de8: 30 e0 ldi r19, 0x00 ; 0 32dea: 40 e0 ldi r20, 0x00 ; 0 32dec: 50 e0 ldi r21, 0x00 ; 0 32dee: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> 32df2: 60 91 7e 16 lds r22, 0x167E ; 0x80167e 32df6: 70 91 7f 16 lds r23, 0x167F ; 0x80167f 32dfa: 80 91 80 16 lds r24, 0x1680 ; 0x801680 32dfe: 90 91 81 16 lds r25, 0x1681 ; 0x801681 32e02: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 32e06: 62 2f mov r22, r18 32e08: 70 e0 ldi r23, 0x00 ; 0 32e0a: 90 e0 ldi r25, 0x00 ; 0 32e0c: 80 e0 ldi r24, 0x00 ; 0 32e0e: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_ECHO((int)card.percentDone()); SERIAL_ECHOPGM("][FEM:"); 32e12: 8f ed ldi r24, 0xDF ; 223 32e14: 9e e9 ldi r25, 0x9E ; 158 32e16: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 32e1a: 60 91 8e 02 lds r22, 0x028E ; 0x80028e 32e1e: 70 91 8f 02 lds r23, 0x028F ; 0x80028f 32e22: 07 2e mov r0, r23 32e24: 00 0c add r0, r0 32e26: 88 0b sbc r24, r24 32e28: 99 0b sbc r25, r25 32e2a: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_ECHO(feedmultiply); SERIAL_ECHOPGM("][FNM:"); 32e2e: 88 ed ldi r24, 0xD8 ; 216 32e30: 9e e9 ldi r25, 0x9E ; 158 32e32: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHO(card.longFilename[0] ? card.longFilename : card.filename); 32e36: 80 91 81 13 lds r24, 0x1381 ; 0x801381 32e3a: 81 11 cpse r24, r1 32e3c: 21 c0 rjmp .+66 ; 0x32e80 32e3e: 8c e6 ldi r24, 0x6C ; 108 32e40: 93 e1 ldi r25, 0x13 ; 19 32e42: 0e 94 a3 7c call 0xf946 ; 0xf946 SERIAL_ECHOPGM("][TIM:"); 32e46: 81 ed ldi r24, 0xD1 ; 209 32e48: 9e e9 ldi r25, 0x9E ; 158 32e4a: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 if (print_job_timer.isRunning()) { 32e4e: 80 91 59 03 lds r24, 0x0359 ; 0x800359 32e52: 81 30 cpi r24, 0x01 ; 1 32e54: c1 f4 brne .+48 ; 0x32e86 SERIAL_ECHO(print_job_timer.duration()); 32e56: 0f 94 66 1c call 0x238cc ; 0x238cc } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 32e5a: 4a e0 ldi r20, 0x0A ; 10 32e5c: 0f 94 2c 96 call 0x32c58 ; 0x32c58 } else { SERIAL_ECHO(0); } SERIAL_ECHOPGM("][FWR:"); 32e60: 8a ec ldi r24, 0xCA ; 202 32e62: 9e e9 ldi r25, 0x9E ; 158 32e64: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 SERIAL_ECHORPGM(FW_VERSION_STR_P()); 32e68: 83 ec ldi r24, 0xC3 ; 195 32e6a: 9e e9 ldi r25, 0x9E ; 158 32e6c: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32e70: 8d e5 ldi r24, 0x5D ; 93 32e72: 0e 94 41 70 call 0xe082 ; 0xe082 static void prusa_statistics_case0(uint8_t statnr) { SERIAL_ECHO('{'); prusa_stat_printerstatus(statnr); prusa_stat_farm_number(); prusa_stat_printinfo(); } 32e76: cf 91 pop r28 SERIAL_ECHO(0); } SERIAL_ECHOPGM("][FWR:"); SERIAL_ECHORPGM(FW_VERSION_STR_P()); SERIAL_ECHO(']'); prusa_stat_diameter(); 32e78: 0d 94 91 96 jmp 0x32d22 ; 0x32d22 32e7c: 20 e0 ldi r18, 0x00 ; 0 32e7e: c3 cf rjmp .-122 ; 0x32e06 SERIAL_ECHOPGM("][PCD:"); SERIAL_ECHO((int)card.percentDone()); SERIAL_ECHOPGM("][FEM:"); SERIAL_ECHO(feedmultiply); SERIAL_ECHOPGM("][FNM:"); SERIAL_ECHO(card.longFilename[0] ? card.longFilename : card.filename); 32e80: 81 e8 ldi r24, 0x81 ; 129 32e82: 93 e1 ldi r25, 0x13 ; 19 32e84: de cf rjmp .-68 ; 0x32e42 32e86: 60 e0 ldi r22, 0x00 ; 0 32e88: 70 e0 ldi r23, 0x00 ; 0 32e8a: cb 01 movw r24, r22 32e8c: 0f 94 a2 96 call 0x32d44 ; 0x32d44 32e90: e7 cf rjmp .-50 ; 0x32e60 00032e92 : '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); } void MarlinSerial::printFloat(double number, uint8_t digits) { 32e92: 8f 92 push r8 32e94: 9f 92 push r9 32e96: af 92 push r10 32e98: bf 92 push r11 32e9a: cf 92 push r12 32e9c: df 92 push r13 32e9e: ef 92 push r14 32ea0: ff 92 push r15 32ea2: cf 93 push r28 32ea4: 6b 01 movw r12, r22 32ea6: 7c 01 movw r14, r24 32ea8: b4 2e mov r11, r20 // Handle negative numbers if (number < 0.0) 32eaa: 20 e0 ldi r18, 0x00 ; 0 32eac: 30 e0 ldi r19, 0x00 ; 0 32eae: a9 01 movw r20, r18 32eb0: 0f 94 f9 a1 call 0x343f2 ; 0x343f2 <__cmpsf2> 32eb4: 87 ff sbrs r24, 7 32eb6: 07 c0 rjmp .+14 ; 0x32ec6 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32eb8: 8d e2 ldi r24, 0x2D ; 45 32eba: 0e 94 41 70 call 0xe082 ; 0xe082 { // Handle negative numbers if (number < 0.0) { print('-'); number = -number; 32ebe: f7 fa bst r15, 7 32ec0: f0 94 com r15 32ec2: f7 f8 bld r15, 7 32ec4: f0 94 com r15 } // Round correctly so that print(1.999, 2) prints as "2.00" double rounding = 0.5; for (uint8_t i=0; i rounding /= 10.0; 32ed4: 20 e0 ldi r18, 0x00 ; 0 32ed6: 30 e0 ldi r19, 0x00 ; 0 32ed8: 40 e2 ldi r20, 0x20 ; 32 32eda: 51 e4 ldi r21, 0x41 ; 65 32edc: 0f 94 03 a2 call 0x34406 ; 0x34406 <__divsf3> number = -number; } // Round correctly so that print(1.999, 2) prints as "2.00" double rounding = 0.5; for (uint8_t i=0; i rounding /= 10.0; number += rounding; 32ee4: 9b 01 movw r18, r22 32ee6: ac 01 movw r20, r24 32ee8: c7 01 movw r24, r14 32eea: b6 01 movw r22, r12 32eec: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 32ef0: 6b 01 movw r12, r22 32ef2: 7c 01 movw r14, r24 // Extract the integer part of the number and print it unsigned long int_part = (unsigned long)number; 32ef4: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 32ef8: 4b 01 movw r8, r22 32efa: 5c 01 movw r10, r24 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 32efc: 4a e0 ldi r20, 0x0A ; 10 32efe: 0f 94 2c 96 call 0x32c58 ; 0x32c58 unsigned long int_part = (unsigned long)number; double remainder = number - (double)int_part; print(int_part); // Print the decimal point, but only if there are digits beyond if (digits > 0) 32f02: cc 23 and r28, r28 32f04: 91 f1 breq .+100 ; 0x32f6a number += rounding; // Extract the integer part of the number and print it unsigned long int_part = (unsigned long)number; double remainder = number - (double)int_part; 32f06: c5 01 movw r24, r10 32f08: b4 01 movw r22, r8 32f0a: 0f 94 68 9a call 0x334d0 ; 0x334d0 <__floatunsisf> 32f0e: 9b 01 movw r18, r22 32f10: ac 01 movw r20, r24 32f12: c7 01 movw r24, r14 32f14: b6 01 movw r22, r12 32f16: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 32f1a: 6b 01 movw r12, r22 32f1c: 7c 01 movw r14, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32f1e: 8e e2 ldi r24, 0x2E ; 46 32f20: 0e 94 41 70 call 0xe082 ; 0xe082 // Print the decimal point, but only if there are digits beyond if (digits > 0) print('.'); // Extract digits from the remainder one at a time while (digits-- > 0) 32f24: c1 50 subi r28, 0x01 ; 1 32f26: 08 f1 brcs .+66 ; 0x32f6a { remainder *= 10.0; 32f28: 20 e0 ldi r18, 0x00 ; 0 32f2a: 30 e0 ldi r19, 0x00 ; 0 32f2c: 40 e2 ldi r20, 0x20 ; 32 32f2e: 51 e4 ldi r21, 0x41 ; 65 32f30: c7 01 movw r24, r14 32f32: b6 01 movw r22, r12 32f34: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 32f38: 4b 01 movw r8, r22 32f3a: 5c 01 movw r10, r24 int toPrint = int(remainder); 32f3c: 0f 94 75 a2 call 0x344ea ; 0x344ea <__fixsfsi> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 32f40: 6b 01 movw r12, r22 32f42: 77 0f add r23, r23 32f44: ee 08 sbc r14, r14 32f46: ff 08 sbc r15, r15 32f48: c7 01 movw r24, r14 32f4a: b6 01 movw r22, r12 32f4c: 0f 94 a2 96 call 0x32d44 ; 0x32d44 while (digits-- > 0) { remainder *= 10.0; int toPrint = int(remainder); print(toPrint); remainder -= toPrint; 32f50: c7 01 movw r24, r14 32f52: b6 01 movw r22, r12 32f54: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 32f58: 9b 01 movw r18, r22 32f5a: ac 01 movw r20, r24 32f5c: c5 01 movw r24, r10 32f5e: b4 01 movw r22, r8 32f60: 0f 94 03 a1 call 0x34206 ; 0x34206 <__subsf3> 32f64: 6b 01 movw r12, r22 32f66: 7c 01 movw r14, r24 32f68: dd cf rjmp .-70 ; 0x32f24 } } 32f6a: cf 91 pop r28 32f6c: ff 90 pop r15 32f6e: ef 90 pop r14 32f70: df 90 pop r13 32f72: cf 90 pop r12 32f74: bf 90 pop r11 32f76: af 90 pop r10 32f78: 9f 90 pop r9 32f7a: 8f 90 pop r8 32f7c: 08 95 ret 00032f7e : SERIAL_ECHO(eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)); SERIAL_ECHO(']'); } static void prusa_stat_temperatures() { SERIAL_ECHOPGM("[ST0:"); 32f7e: 8c e1 ldi r24, 0x1C ; 28 32f80: 9f e9 ldi r25, 0x9F ; 159 32f82: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 32f86: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 32f8a: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 32f8e: 07 2e mov r0, r23 32f90: 00 0c add r0, r0 32f92: 88 0b sbc r24, r24 32f94: 99 0b sbc r25, r25 32f96: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_ECHO(target_temperature[0]); SERIAL_ECHOPGM("][STB:"); 32f9a: 85 e1 ldi r24, 0x15 ; 21 32f9c: 9f e9 ldi r25, 0x9F ; 159 32f9e: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 32fa2: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 32fa6: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee 32faa: 07 2e mov r0, r23 32fac: 00 0c add r0, r0 32fae: 88 0b sbc r24, r24 32fb0: 99 0b sbc r25, r25 32fb2: 0f 94 a2 96 call 0x32d44 ; 0x32d44 SERIAL_ECHO(target_temperature_bed); SERIAL_ECHOPGM("][AT0:"); 32fb6: 8e e0 ldi r24, 0x0E ; 14 32fb8: 9f e9 ldi r25, 0x9F ; 159 32fba: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 32fbe: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 32fc2: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 32fc6: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 32fca: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 32fce: 42 e0 ldi r20, 0x02 ; 2 32fd0: 0f 94 49 97 call 0x32e92 ; 0x32e92 SERIAL_ECHO(current_temperature[0]); SERIAL_ECHOPGM("][ATB:"); 32fd4: 87 e0 ldi r24, 0x07 ; 7 32fd6: 9f e9 ldi r25, 0x9F ; 159 32fd8: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 32fdc: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 32fe0: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 32fe4: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 32fe8: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 32fec: 42 e0 ldi r20, 0x02 ; 2 32fee: 0f 94 49 97 call 0x32e92 ; 0x32e92 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32ff2: 8d e5 ldi r24, 0x5D ; 93 32ff4: 0c 94 41 70 jmp 0xe082 ; 0xe082 00032ff8 : 32ff8: 8a e0 ldi r24, 0x0A ; 10 32ffa: 0c 94 41 70 jmp 0xe082 ; 0xe082 00032ffe : } } #endif //PRUSA_M28 void prusa_statistics(uint8_t _message) { 32ffe: cf 93 push r28 const uint8_t _fil_nr = 0; if (!farm_mode) 33000: 90 91 ca 0d lds r25, 0x0DCA ; 0x800dca 33004: 99 23 and r25, r25 33006: 09 f4 brne .+2 ; 0x3300a 33008: f6 c0 rjmp .+492 ; 0x331f6 3300a: c8 2f mov r28, r24 return; switch (_message) { 3300c: 87 30 cpi r24, 0x07 ; 7 3300e: 09 f4 brne .+2 ; 0x33012 33010: be c0 rjmp .+380 ; 0x3318e 33012: 08 f0 brcs .+2 ; 0x33016 33014: 46 c0 rjmp .+140 ; 0x330a2 33016: 83 30 cpi r24, 0x03 ; 3 33018: 09 f4 brne .+2 ; 0x3301c 3301a: ed c0 rjmp .+474 ; 0x331f6 3301c: 80 f5 brcc .+96 ; 0x3307e 3301e: 81 30 cpi r24, 0x01 ; 1 33020: 09 f4 brne .+2 ; 0x33024 33022: 88 c0 rjmp .+272 ; 0x33134 33024: 08 f4 brcc .+2 ; 0x33028 33026: 60 c0 rjmp .+192 ; 0x330e8 33028: 8b e7 ldi r24, 0x7B ; 123 3302a: 0e 94 41 70 call 0xe082 ; 0xe082 farm_timer = 1; break; case 2: // heating done SERIAL_ECHO('{'); prusa_stat_printerstatus(3); 3302e: 83 e0 ldi r24, 0x03 ; 3 33030: 0f 94 9c 6b call 0x2d738 ; 0x2d738 prusa_stat_farm_number(); 33034: 0f 94 98 6b call 0x2d730 ; 0x2d730 33038: 8d e7 ldi r24, 0x7D ; 125 3303a: 0e 94 41 70 call 0xe082 ; 0xe082 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 3303e: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 SERIAL_ECHOLN('}'); status_number = 3; 33042: c3 e0 ldi r28, 0x03 ; 3 33044: c0 93 f7 16 sts 0x16F7, r28 ; 0x8016f7 <_ZL13status_number.lto_priv.496> farm_timer = 1; 33048: 81 e0 ldi r24, 0x01 ; 1 3304a: 80 93 76 02 sts 0x0276, r24 ; 0x800276 <_ZL10farm_timer.lto_priv.447> if (IS_SD_PRINTING || (eFilamentAction != FilamentAction::None)) { 3304e: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 33052: 81 11 cpse r24, r1 33054: 05 c0 rjmp .+10 ; 0x33060 33056: 80 91 62 03 lds r24, 0x0362 ; 0x800362 3305a: 88 23 and r24, r24 3305c: 09 f4 brne .+2 ; 0x33060 3305e: 78 c0 rjmp .+240 ; 0x33150 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 33060: 8b e7 ldi r24, 0x7B ; 123 33062: 0e 94 41 70 call 0xe082 ; 0xe082 SERIAL_ECHO('{'); prusa_stat_printerstatus(4); 33066: 84 e0 ldi r24, 0x04 ; 4 33068: 0f 94 9c 6b call 0x2d738 ; 0x2d738 prusa_stat_farm_number(); 3306c: 0f 94 98 6b call 0x2d730 ; 0x2d730 status_number = 4; 33070: 84 e0 ldi r24, 0x04 ; 4 33072: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 <_ZL13status_number.lto_priv.496> SERIAL_ECHO('{'); prusa_stat_printerstatus(3); prusa_stat_farm_number(); status_number = 3; } farm_timer = 1; 33076: 81 e0 ldi r24, 0x01 ; 1 SERIAL_ECHOPGM("{[RES:1][FIL:"); MYSERIAL.print(int(_fil_nr)); SERIAL_ECHO(']'); prusa_stat_printerstatus(status_number); prusa_stat_farm_number(); farm_timer = 2; 33078: 80 93 76 02 sts 0x0276, r24 ; 0x800276 <_ZL10farm_timer.lto_priv.447> 3307c: 1e c0 rjmp .+60 ; 0x330ba void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 3307e: 85 30 cpi r24, 0x05 ; 5 33080: 09 f4 brne .+2 ; 0x33084 33082: 71 c0 rjmp .+226 ; 0x33166 // must do a return here to prevent doing SERIAL_ECHOLN("}") at the very end of this function // saved a considerable amount of FLASH return; break; case 4: // print succesfull SERIAL_ECHOPGM("{[RES:1][FIL:"); 33084: 84 e5 ldi r24, 0x54 ; 84 33086: 9f e9 ldi r25, 0x9F ; 159 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 33088: c6 30 cpi r28, 0x06 ; 6 3308a: 08 f4 brcc .+2 ; 0x3308e 3308c: 6e c0 rjmp .+220 ; 0x3316a prusa_stat_printerstatus(status_number); prusa_stat_farm_number(); farm_timer = 2; break; case 6: // print done SERIAL_ECHOPGM("{[PRN:8]"); 3308e: 8d e3 ldi r24, 0x3D ; 61 33090: 9f e9 ldi r25, 0x9F ; 159 33092: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 prusa_stat_farm_number(); 33096: 0f 94 98 6b call 0x2d730 ; 0x2d730 status_number = 8; 3309a: 88 e0 ldi r24, 0x08 ; 8 farm_timer = 2; break; case 7: // print done - stopped SERIAL_ECHOPGM("{[PRN:9]"); prusa_stat_farm_number(); status_number = 9; 3309c: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 <_ZL13status_number.lto_priv.496> 330a0: 74 c0 rjmp .+232 ; 0x3318a void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 330a2: 86 31 cpi r24, 0x16 ; 22 330a4: 09 f4 brne .+2 ; 0x330a8 330a6: 9b c0 rjmp .+310 ; 0x331de 330a8: 70 f4 brcc .+28 ; 0x330c6 330aa: 84 31 cpi r24, 0x14 ; 20 330ac: 09 f4 brne .+2 ; 0x330b0 330ae: 80 c0 rjmp .+256 ; 0x331b0 330b0: 08 f0 brcs .+2 ; 0x330b4 330b2: 89 c0 rjmp .+274 ; 0x331c6 330b4: 88 30 cpi r24, 0x08 ; 8 330b6: 09 f4 brne .+2 ; 0x330ba 330b8: 72 c0 rjmp .+228 ; 0x3319e 330ba: 8d e7 ldi r24, 0x7D ; 125 330bc: 0e 94 41 70 call 0xe082 ; 0xe082 prusa_stat_temperatures(); prusa_stat_farm_number(); break; } SERIAL_ECHOLN('}'); } 330c0: cf 91 pop r28 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 330c2: 0d 94 fc 97 jmp 0x32ff8 ; 0x32ff8 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 330c6: 8b 35 cpi r24, 0x5B ; 91 330c8: 09 f4 brne .+2 ; 0x330cc 330ca: 91 c0 rjmp .+290 ; 0x331ee 330cc: 30 f4 brcc .+12 ; 0x330da prusa_stat_farm_number(); status_number = 5; break; case 90: // Error - Thermal Runaway prusa_statistics_err('1'); 330ce: 81 e3 ldi r24, 0x31 ; 49 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 330d0: ca 35 cpi r28, 0x5A ; 90 330d2: 99 f7 brne .-26 ; 0x330ba break; case 92: // Error - Min temp prusa_statistics_err('3'); break; case 93: // Error - Max temp prusa_statistics_err('4'); 330d4: 0f 94 a9 6b call 0x2d752 ; 0x2d752 330d8: f0 cf rjmp .-32 ; 0x330ba void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 330da: 8c 35 cpi r24, 0x5C ; 92 330dc: 09 f4 brne .+2 ; 0x330e0 330de: 89 c0 rjmp .+274 ; 0x331f2 break; case 92: // Error - Min temp prusa_statistics_err('3'); break; case 93: // Error - Max temp prusa_statistics_err('4'); 330e0: 84 e3 ldi r24, 0x34 ; 52 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 330e2: cd 35 cpi r28, 0x5D ; 93 330e4: b9 f3 breq .-18 ; 0x330d4 330e6: e9 cf rjmp .-46 ; 0x330ba case 0: // default message if (busy_state == PAUSED_FOR_USER) { 330e8: 80 91 78 02 lds r24, 0x0278 ; 0x800278 330ec: 84 30 cpi r24, 0x04 ; 4 330ee: 21 f4 brne .+8 ; 0x330f8 prusa_statistics_case0(15); 330f0: 8f e0 ldi r24, 0x0F ; 15 } else if (printingIsPaused()) { prusa_statistics_case0(14); 330f2: 0f 94 be 96 call 0x32d7c ; 0x32d7c 330f6: e1 cf rjmp .-62 ; 0x330ba switch (_message) { case 0: // default message if (busy_state == PAUSED_FOR_USER) { prusa_statistics_case0(15); } else if (printingIsPaused()) { 330f8: 0e 94 bd 60 call 0xc17a ; 0xc17a 330fc: 88 23 and r24, r24 330fe: 11 f0 breq .+4 ; 0x33104 prusa_statistics_case0(14); 33100: 8e e0 ldi r24, 0x0E ; 14 33102: f7 cf rjmp .-18 ; 0x330f2 } else if (IS_SD_PRINTING || (eFilamentAction != FilamentAction::None)) { 33104: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 33108: 81 11 cpse r24, r1 3310a: 04 c0 rjmp .+8 ; 0x33114 3310c: 80 91 62 03 lds r24, 0x0362 ; 0x800362 33110: 88 23 and r24, r24 33112: 11 f0 breq .+4 ; 0x33118 prusa_statistics_case0(4); 33114: 84 e0 ldi r24, 0x04 ; 4 33116: ed cf rjmp .-38 ; 0x330f2 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 33118: 8b e7 ldi r24, 0x7B ; 123 3311a: 0e 94 41 70 call 0xe082 ; 0xe082 } else { SERIAL_ECHO('{'); prusa_stat_printerstatus(1); 3311e: 81 e0 ldi r24, 0x01 ; 1 33120: 0f 94 9c 6b call 0x2d738 ; 0x2d738 prusa_stat_farm_number(); 33124: 0f 94 98 6b call 0x2d730 ; 0x2d730 prusa_stat_diameter(); 33128: 0f 94 91 96 call 0x32d22 ; 0x32d22 status_number = 1; 3312c: 81 e0 ldi r24, 0x01 ; 1 prusa_stat_printerstatus(status_number); break; case 22: // waiting for filament change SERIAL_ECHOPGM("{[PRN:5]"); prusa_stat_farm_number(); status_number = 5; 3312e: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 <_ZL13status_number.lto_priv.496> 33132: c3 cf rjmp .-122 ; 0x330ba 33134: 8b e7 ldi r24, 0x7B ; 123 33136: 0e 94 41 70 call 0xe082 ; 0xe082 } break; case 1: // 1 heating SERIAL_ECHO('{'); prusa_stat_printerstatus(2); 3313a: 82 e0 ldi r24, 0x02 ; 2 3313c: 0f 94 9c 6b call 0x2d738 ; 0x2d738 prusa_stat_farm_number(); 33140: 0f 94 98 6b call 0x2d730 ; 0x2d730 status_number = 2; 33144: 82 e0 ldi r24, 0x02 ; 2 33146: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 <_ZL13status_number.lto_priv.496> farm_timer = 1; 3314a: c0 93 76 02 sts 0x0276, r28 ; 0x800276 <_ZL10farm_timer.lto_priv.447> 3314e: b5 cf rjmp .-150 ; 0x330ba 33150: 8b e7 ldi r24, 0x7B ; 123 33152: 0e 94 41 70 call 0xe082 ; 0xe082 prusa_stat_farm_number(); status_number = 4; } else { SERIAL_ECHO('{'); prusa_stat_printerstatus(3); 33156: 83 e0 ldi r24, 0x03 ; 3 33158: 0f 94 9c 6b call 0x2d738 ; 0x2d738 prusa_stat_farm_number(); 3315c: 0f 94 98 6b call 0x2d730 ; 0x2d730 status_number = 3; 33160: c0 93 f7 16 sts 0x16F7, r28 ; 0x8016f7 <_ZL13status_number.lto_priv.496> 33164: 88 cf rjmp .-240 ; 0x33076 prusa_stat_printerstatus(status_number); prusa_stat_farm_number(); farm_timer = 2; break; case 5: // print not succesfull SERIAL_ECHOPGM("{[RES:0][FIL:"); 33166: 86 e4 ldi r24, 0x46 ; 70 33168: 9f e9 ldi r25, 0x9F ; 159 // must do a return here to prevent doing SERIAL_ECHOLN("}") at the very end of this function // saved a considerable amount of FLASH return; break; case 4: // print succesfull SERIAL_ECHOPGM("{[RES:1][FIL:"); 3316a: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 3316e: 60 e0 ldi r22, 0x00 ; 0 33170: 70 e0 ldi r23, 0x00 ; 0 33172: cb 01 movw r24, r22 33174: 0f 94 a2 96 call 0x32d44 ; 0x32d44 33178: 8d e5 ldi r24, 0x5D ; 93 3317a: 0e 94 41 70 call 0xe082 ; 0xe082 MYSERIAL.print(int(_fil_nr)); SERIAL_ECHO(']'); prusa_stat_printerstatus(status_number); 3317e: 80 91 f7 16 lds r24, 0x16F7 ; 0x8016f7 <_ZL13status_number.lto_priv.496> 33182: 0f 94 9c 6b call 0x2d738 ; 0x2d738 prusa_stat_farm_number(); 33186: 0f 94 98 6b call 0x2d730 ; 0x2d730 farm_timer = 2; 3318a: 82 e0 ldi r24, 0x02 ; 2 3318c: 75 cf rjmp .-278 ; 0x33078 prusa_stat_farm_number(); status_number = 8; farm_timer = 2; break; case 7: // print done - stopped SERIAL_ECHOPGM("{[PRN:9]"); 3318e: 84 e3 ldi r24, 0x34 ; 52 33190: 9f e9 ldi r25, 0x9F ; 159 33192: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 prusa_stat_farm_number(); 33196: 0f 94 98 6b call 0x2d730 ; 0x2d730 status_number = 9; 3319a: 89 e0 ldi r24, 0x09 ; 9 3319c: 7f cf rjmp .-258 ; 0x3309c farm_timer = 2; break; case 8: // printer started SERIAL_ECHOPGM("{[PRN:0]"); 3319e: 8b e2 ldi r24, 0x2B ; 43 331a0: 9f e9 ldi r25, 0x9F ; 159 331a2: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 prusa_stat_farm_number(); 331a6: 0f 94 98 6b call 0x2d730 ; 0x2d730 status_number = 0; 331aa: 10 92 f7 16 sts 0x16F7, r1 ; 0x8016f7 <_ZL13status_number.lto_priv.496> 331ae: ed cf rjmp .-38 ; 0x3318a 331b0: 8b e7 ldi r24, 0x7B ; 123 331b2: 0e 94 41 70 call 0xe082 ; 0xe082 farm_timer = 2; break; case 20: // echo farm no SERIAL_ECHO('{'); prusa_stat_printerstatus(status_number); 331b6: 80 91 f7 16 lds r24, 0x16F7 ; 0x8016f7 <_ZL13status_number.lto_priv.496> 331ba: 0f 94 9c 6b call 0x2d738 ; 0x2d738 prusa_stat_farm_number(); 331be: 0f 94 98 6b call 0x2d730 ; 0x2d730 farm_timer = 4; 331c2: 84 e0 ldi r24, 0x04 ; 4 331c4: 59 cf rjmp .-334 ; 0x33078 331c6: 8b e7 ldi r24, 0x7B ; 123 331c8: 0e 94 41 70 call 0xe082 ; 0xe082 break; case 21: // temperatures SERIAL_ECHO('{'); prusa_stat_temperatures(); 331cc: 0f 94 bf 97 call 0x32f7e ; 0x32f7e prusa_stat_farm_number(); 331d0: 0f 94 98 6b call 0x2d730 ; 0x2d730 prusa_stat_printerstatus(status_number); 331d4: 80 91 f7 16 lds r24, 0x16F7 ; 0x8016f7 <_ZL13status_number.lto_priv.496> 331d8: 0f 94 9c 6b call 0x2d738 ; 0x2d738 331dc: 6e cf rjmp .-292 ; 0x330ba break; case 22: // waiting for filament change SERIAL_ECHOPGM("{[PRN:5]"); 331de: 82 e2 ldi r24, 0x22 ; 34 331e0: 9f e9 ldi r25, 0x9F ; 159 331e2: 0e 94 5a 70 call 0xe0b4 ; 0xe0b4 prusa_stat_farm_number(); 331e6: 0f 94 98 6b call 0x2d730 ; 0x2d730 status_number = 5; 331ea: 85 e0 ldi r24, 0x05 ; 5 331ec: a0 cf rjmp .-192 ; 0x3312e case 90: // Error - Thermal Runaway prusa_statistics_err('1'); break; case 91: // Error - Thermal Runaway Preheat prusa_statistics_err('2'); 331ee: 82 e3 ldi r24, 0x32 ; 50 331f0: 71 cf rjmp .-286 ; 0x330d4 break; case 92: // Error - Min temp prusa_statistics_err('3'); 331f2: 83 e3 ldi r24, 0x33 ; 51 331f4: 6f cf rjmp .-290 ; 0x330d4 prusa_stat_temperatures(); prusa_stat_farm_number(); break; } SERIAL_ECHOLN('}'); } 331f6: cf 91 pop r28 331f8: 08 95 ret 000331fa : 331fa: 0e 94 a3 7c call 0xf946 ; 0xf946 }*/ void MarlinSerial::println(const char c[]) { print(c); println(); 331fe: 0d 94 fc 97 jmp 0x32ff8 ; 0x32ff8 00033202 <__vector_36>: #endif //DEBUG_DUMP_TO_2ND_SERIAL } } ISR(USART1_RX_vect) { 33202: 1f 92 push r1 33204: 0f 92 push r0 33206: 0f b6 in r0, 0x3f ; 63 33208: 0f 92 push r0 3320a: 11 24 eor r1, r1 3320c: 0b b6 in r0, 0x3b ; 59 3320e: 0f 92 push r0 33210: 2f 93 push r18 33212: 3f 93 push r19 33214: 4f 93 push r20 33216: 6f 93 push r22 33218: 7f 93 push r23 3321a: 8f 93 push r24 3321c: 9f 93 push r25 3321e: ef 93 push r30 33220: ff 93 push r31 // Test for a framing error. if (UCSR1A & (1< 33226: 84 ff sbrs r24, 4 33228: 12 c0 rjmp .+36 ; 0x3324e <__vector_36+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)UDR1); 3322a: 80 91 ce 00 lds r24, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> store_char(c); #ifdef DEBUG_DUMP_TO_2ND_SERIAL M_UDRx = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } 3322e: ff 91 pop r31 33230: ef 91 pop r30 33232: 9f 91 pop r25 33234: 8f 91 pop r24 33236: 7f 91 pop r23 33238: 6f 91 pop r22 3323a: 4f 91 pop r20 3323c: 3f 91 pop r19 3323e: 2f 91 pop r18 33240: 0f 90 pop r0 33242: 0b be out 0x3b, r0 ; 59 33244: 0f 90 pop r0 33246: 0f be out 0x3f, r0 ; 63 33248: 0f 90 pop r0 3324a: 1f 90 pop r1 3324c: 18 95 reti (void)(*(char *)UDR1); } else { // Read the input register. unsigned char c = UDR1; 3324e: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> if (selectedSerialPort == 1) 33252: 80 91 04 05 lds r24, 0x0504 ; 0x800504 33256: 81 30 cpi r24, 0x01 ; 1 33258: 51 f7 brne .-44 ; 0x3322e <__vector_36+0x2c> ring_buffer rx_buffer = { { 0 }, 0, 0 }; #endif FORCE_INLINE void store_char(unsigned char c) { int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 3325a: 20 91 af 05 lds r18, 0x05AF ; 0x8005af 3325e: 30 91 b0 05 lds r19, 0x05B0 ; 0x8005b0 33262: c9 01 movw r24, r18 33264: 01 96 adiw r24, 0x01 ; 1 33266: 8f 77 andi r24, 0x7F ; 127 33268: 99 27 eor r25, r25 // if we should be storing the received character into the location // just before the tail (meaning that the head would advance to the // current location of the tail), we're about to overflow the buffer // and so we don't write the character or advance the head. if (i != rx_buffer.tail) { 3326a: 60 91 b1 05 lds r22, 0x05B1 ; 0x8005b1 3326e: 70 91 b2 05 lds r23, 0x05B2 ; 0x8005b2 33272: 86 17 cp r24, r22 33274: 97 07 cpc r25, r23 33276: d9 f2 breq .-74 ; 0x3322e <__vector_36+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 33278: 21 5d subi r18, 0xD1 ; 209 3327a: 3a 4f sbci r19, 0xFA ; 250 3327c: f9 01 movw r30, r18 3327e: 40 83 st Z, r20 rx_buffer.head = i; 33280: 90 93 b0 05 sts 0x05B0, r25 ; 0x8005b0 33284: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af 33288: d2 cf rjmp .-92 ; 0x3322e <__vector_36+0x2c> 0003328a <__vector_25>: // ticks at maximum 11.76 kHz and blocks for 2.688 us at each tick. // If the serial line is fully utilized, this corresponds to 3.16% // loading of the CPU (the interrupt invocation overhead not taken into account). // As the serial line is not fully utilized, the CPU load is likely around 1%. ISR(M_USARTx_RX_vect) { 3328a: 1f 92 push r1 3328c: 0f 92 push r0 3328e: 0f b6 in r0, 0x3f ; 63 33290: 0f 92 push r0 33292: 11 24 eor r1, r1 33294: 0b b6 in r0, 0x3b ; 59 33296: 0f 92 push r0 33298: 2f 93 push r18 3329a: 3f 93 push r19 3329c: 4f 93 push r20 3329e: 6f 93 push r22 332a0: 7f 93 push r23 332a2: 8f 93 push r24 332a4: 9f 93 push r25 332a6: ef 93 push r30 332a8: ff 93 push r31 // Test for a framing error. if (M_UCSRxA & (1< 332ae: 84 ff sbrs r24, 4 332b0: 12 c0 rjmp .+36 ; 0x332d6 <__vector_25+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)M_UDRx); 332b2: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> store_char(c); #ifdef DEBUG_DUMP_TO_2ND_SERIAL UDR1 = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } 332b6: ff 91 pop r31 332b8: ef 91 pop r30 332ba: 9f 91 pop r25 332bc: 8f 91 pop r24 332be: 7f 91 pop r23 332c0: 6f 91 pop r22 332c2: 4f 91 pop r20 332c4: 3f 91 pop r19 332c6: 2f 91 pop r18 332c8: 0f 90 pop r0 332ca: 0b be out 0x3b, r0 ; 59 332cc: 0f 90 pop r0 332ce: 0f be out 0x3f, r0 ; 63 332d0: 0f 90 pop r0 332d2: 1f 90 pop r1 332d4: 18 95 reti (void)(*(char *)M_UDRx); } else { // Read the input register. unsigned char c = M_UDRx; 332d6: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> if (selectedSerialPort == 0) 332da: 80 91 04 05 lds r24, 0x0504 ; 0x800504 332de: 81 11 cpse r24, r1 332e0: ea cf rjmp .-44 ; 0x332b6 <__vector_25+0x2c> ring_buffer rx_buffer = { { 0 }, 0, 0 }; #endif FORCE_INLINE void store_char(unsigned char c) { int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 332e2: 20 91 af 05 lds r18, 0x05AF ; 0x8005af 332e6: 30 91 b0 05 lds r19, 0x05B0 ; 0x8005b0 332ea: c9 01 movw r24, r18 332ec: 01 96 adiw r24, 0x01 ; 1 332ee: 8f 77 andi r24, 0x7F ; 127 332f0: 99 27 eor r25, r25 // if we should be storing the received character into the location // just before the tail (meaning that the head would advance to the // current location of the tail), we're about to overflow the buffer // and so we don't write the character or advance the head. if (i != rx_buffer.tail) { 332f2: 60 91 b1 05 lds r22, 0x05B1 ; 0x8005b1 332f6: 70 91 b2 05 lds r23, 0x05B2 ; 0x8005b2 332fa: 86 17 cp r24, r22 332fc: 97 07 cpc r25, r23 332fe: d9 f2 breq .-74 ; 0x332b6 <__vector_25+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 33300: 21 5d subi r18, 0xD1 ; 209 33302: 3a 4f sbci r19, 0xFA ; 250 33304: f9 01 movw r30, r18 33306: 40 83 st Z, r20 rx_buffer.head = i; 33308: 90 93 b0 05 sts 0x05B0, r25 ; 0x8005b0 3330c: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af 33310: d2 cf rjmp .-92 ; 0x332b6 <__vector_25+0x2c> 00033312 : * the value zero, false, is returned for failure. * Reasons for failure include this file is already open, \a dirFile is not * a directory, \a path is invalid, the file does not exist * or can't be opened in the access mode specified by oflag. */ bool SdBaseFile::open(SdBaseFile* dirFile, const char* path, uint8_t oflag) { 33312: 2f 92 push r2 33314: 3f 92 push r3 33316: 4f 92 push r4 33318: 5f 92 push r5 3331a: 6f 92 push r6 3331c: 7f 92 push r7 3331e: 8f 92 push r8 33320: 9f 92 push r9 33322: af 92 push r10 33324: bf 92 push r11 33326: cf 92 push r12 33328: df 92 push r13 3332a: ef 92 push r14 3332c: ff 92 push r15 3332e: 0f 93 push r16 33330: 1f 93 push r17 33332: cf 93 push r28 33334: df 93 push r29 33336: cd b7 in r28, 0x3d ; 61 33338: de b7 in r29, 0x3e ; 62 3333a: c2 54 subi r28, 0x42 ; 66 3333c: d1 09 sbc r29, r1 3333e: 0f b6 in r0, 0x3f ; 63 33340: f8 94 cli 33342: de bf out 0x3e, r29 ; 62 33344: 0f be out 0x3f, r0 ; 63 33346: cd bf out 0x3d, r28 ; 61 33348: 4c 01 movw r8, r24 3334a: 5b 01 movw r10, r22 3334c: 6a 01 movw r12, r20 3334e: 32 2e mov r3, r18 * \brief Base class for SdFile with Print and C++ streams. */ class SdBaseFile { public: /** Create an instance. */ SdBaseFile() : writeError(false), type_(FAT_FILE_TYPE_CLOSED) {} 33350: 19 82 std Y+1, r1 ; 0x01 33352: 1c 82 std Y+4, r1 ; 0x04 33354: 1c 8e std Y+28, r1 ; 0x1c 33356: 1f 8e std Y+31, r1 ; 0x1f uint8_t dname[11]; SdBaseFile dir1, dir2; SdBaseFile *parent = dirFile; SdBaseFile *sub = &dir1; if (!dirFile) goto fail; 33358: 67 2b or r22, r23 3335a: 21 f5 brne .+72 ; 0x333a4 sub = parent != &dir1 ? &dir1 : &dir2; } return open(parent, dname, oflag); fail: return false; 3335c: 10 e0 ldi r17, 0x00 ; 0 * a directory, \a path is invalid, the file does not exist * or can't be opened in the access mode specified by oflag. */ bool SdBaseFile::open(SdBaseFile* dirFile, const char* path, uint8_t oflag) { uint8_t dname[11]; SdBaseFile dir1, dir2; 3335e: ce 01 movw r24, r28 33360: 4c 96 adiw r24, 0x1c ; 28 33362: 0e 94 3b 70 call 0xe076 ; 0xe076 33366: ce 01 movw r24, r28 33368: 01 96 adiw r24, 0x01 ; 1 3336a: 0e 94 3b 70 call 0xe076 ; 0xe076 } return open(parent, dname, oflag); fail: return false; } 3336e: 81 2f mov r24, r17 33370: ce 5b subi r28, 0xBE ; 190 33372: df 4f sbci r29, 0xFF ; 255 33374: 0f b6 in r0, 0x3f ; 63 33376: f8 94 cli 33378: de bf out 0x3e, r29 ; 62 3337a: 0f be out 0x3f, r0 ; 63 3337c: cd bf out 0x3d, r28 ; 61 3337e: df 91 pop r29 33380: cf 91 pop r28 33382: 1f 91 pop r17 33384: 0f 91 pop r16 33386: ff 90 pop r15 33388: ef 90 pop r14 3338a: df 90 pop r13 3338c: cf 90 pop r12 3338e: bf 90 pop r11 33390: af 90 pop r10 33392: 9f 90 pop r9 33394: 8f 90 pop r8 33396: 7f 90 pop r7 33398: 6f 90 pop r6 3339a: 5f 90 pop r5 3339c: 4f 90 pop r4 3339e: 3f 90 pop r3 333a0: 2f 90 pop r2 333a2: 08 95 ret SdBaseFile *sub = &dir1; if (!dirFile) goto fail; // error if already open if (isOpen()) goto fail; 333a4: fc 01 movw r30, r24 333a6: 83 81 ldd r24, Z+3 ; 0x03 333a8: 81 11 cpse r24, r1 333aa: d8 cf rjmp .-80 ; 0x3335c if (*path == '/') { 333ac: fa 01 movw r30, r20 333ae: 80 81 ld r24, Z 333b0: 8f 32 cpi r24, 0x2F ; 47 333b2: c1 f4 brne .+48 ; 0x333e4 333b4: ca 01 movw r24, r20 333b6: 6c 01 movw r12, r24 333b8: 01 96 adiw r24, 0x01 ; 1 while (*path == '/') path++; 333ba: f6 01 movw r30, r12 333bc: 20 81 ld r18, Z 333be: 2f 32 cpi r18, 0x2F ; 47 333c0: d1 f3 breq .-12 ; 0x333b6 bool isOpen() const {return type_ != FAT_FILE_TYPE_CLOSED;} /** \return True if this is a subdirectory else false. */ bool isSubDir() const {return type_ == FAT_FILE_TYPE_SUBDIR;} /** \return True if this is the root directory. */ bool isRoot() const { return type_ == FAT_FILE_TYPE_ROOT_FIXED || type_ == FAT_FILE_TYPE_ROOT32; 333c2: f5 01 movw r30, r10 333c4: 83 81 ldd r24, Z+3 ; 0x03 333c6: 82 50 subi r24, 0x02 ; 2 if (!dirFile->isRoot()) { 333c8: 82 30 cpi r24, 0x02 ; 2 333ca: 60 f0 brcs .+24 ; 0x333e4 if (!dir2.openRoot(dirFile->vol_)) goto fail; 333cc: 61 8d ldd r22, Z+25 ; 0x19 333ce: 72 8d ldd r23, Z+26 ; 0x1a 333d0: ce 01 movw r24, r28 333d2: 4c 96 adiw r24, 0x1c ; 28 333d4: 0f 94 42 6e call 0x2dc84 ; 0x2dc84 parent = &dir2; 333d8: 8e 01 movw r16, r28 333da: 04 5e subi r16, 0xE4 ; 228 333dc: 1f 4f sbci r17, 0xFF ; 255 if (isOpen()) goto fail; if (*path == '/') { while (*path == '/') path++; if (!dirFile->isRoot()) { if (!dir2.openRoot(dirFile->vol_)) goto fail; 333de: 81 11 cpse r24, r1 333e0: 02 c0 rjmp .+4 ; 0x333e6 333e2: bc cf rjmp .-136 ; 0x3335c // error if already open if (isOpen()) goto fail; if (*path == '/') { while (*path == '/') path++; if (!dirFile->isRoot()) { 333e4: 85 01 movw r16, r10 while (*path == '/') path++; if (!*path) break; if (!sub->open(parent, dname, O_READ)) goto fail; if (parent != dirFile) parent->close(); parent = sub; sub = parent != &dir1 ? &dir1 : &dir2; 333e6: ce 01 movw r24, r28 333e8: 01 96 adiw r24, 0x01 ; 1 333ea: 7c 01 movw r14, r24 333ec: 3c 01 movw r6, r24 333ee: 2e 01 movw r4, r28 333f0: 9c e1 ldi r25, 0x1C ; 28 333f2: 49 0e add r4, r25 333f4: 51 1c adc r5, r1 333f6: 23 96 adiw r28, 0x03 ; 3 333f8: ef ae std Y+63, r14 ; 0x3f 333fa: 23 97 sbiw r28, 0x03 ; 3 333fc: 2f 2c mov r2, r15 333fe: fe 01 movw r30, r28 33400: f7 96 adiw r30, 0x37 ; 55 33402: cf 01 movw r24, r30 33404: 0b 96 adiw r24, 0x0b ; 11 33406: af 01 movw r20, r30 bool SdBaseFile::make83Name(const char* str, uint8_t* name, const char** ptr) { uint8_t c; uint8_t n = 7; // max index for part before dot uint8_t i = 0; // blank fill name and extension while (i < 11) name[i++] = ' '; 33408: 20 e2 ldi r18, 0x20 ; 32 3340a: 21 93 st Z+, r18 3340c: e8 17 cp r30, r24 3340e: f9 07 cpc r31, r25 33410: d9 f7 brne .-10 ; 0x33408 33412: 96 01 movw r18, r12 i = 0; 33414: 90 e0 ldi r25, 0x00 ; 0 } //------------------------------------------------------------------------------ // format directory name field from a 8.3 name string bool SdBaseFile::make83Name(const char* str, uint8_t* name, const char** ptr) { uint8_t c; uint8_t n = 7; // max index for part before dot 33416: 67 e0 ldi r22, 0x07 ; 7 uint8_t i = 0; // blank fill name and extension while (i < 11) name[i++] = ' '; i = 0; while (*str != '\0' && *str != '/') { 33418: d9 01 movw r26, r18 3341a: 8d 91 ld r24, X+ 3341c: 88 23 and r24, r24 3341e: 49 f1 breq .+82 ; 0x33472 33420: 8f 32 cpi r24, 0x2F ; 47 33422: 39 f1 breq .+78 ; 0x33472 c = *str++; 33424: 28 2f mov r18, r24 if (c == '.') { 33426: 8e 32 cpi r24, 0x2E ; 46 33428: 39 f4 brne .+14 ; 0x33438 if (n == 10) goto fail; // only one dot allowed 3342a: 6a 30 cpi r22, 0x0A ; 10 3342c: 09 f4 brne .+2 ; 0x33430 3342e: 96 cf rjmp .-212 ; 0x3335c n = 10; // max index for full 8.3 name i = 8; // place for extension 33430: 98 e0 ldi r25, 0x08 ; 8 i = 0; while (*str != '\0' && *str != '/') { c = *str++; if (c == '.') { if (n == 10) goto fail; // only one dot allowed n = 10; // max index for full 8.3 name 33432: 6a e0 ldi r22, 0x0A ; 10 33434: 9d 01 movw r18, r26 33436: f0 cf rjmp .-32 ; 0x33418 33438: e2 e6 ldi r30, 0x62 ; 98 3343a: f1 ea ldi r31, 0xA1 ; 161 //PGM_P p = PSTR("|<>^+=?/[];,*\"\\"); // 2019-08-27 really? // Microsoft defines, that only a subset of these characters is not allowed. PGM_P p = PSTR("|<>?/*\"\\"); uint8_t b; while ((b = pgm_read_byte(p++))) if (b == c) goto fail; 3343c: 34 91 lpm r19, Z 3343e: 33 23 and r19, r19 33440: 21 f0 breq .+8 ; 0x3344a 33442: 31 96 adiw r30, 0x01 ; 1 33444: 83 13 cpse r24, r19 33446: fa cf rjmp .-12 ; 0x3343c 33448: 89 cf rjmp .-238 ; 0x3335c // check size and only allow ASCII printable characters if (i > n || c < 0X21 || c > 0X7E)goto fail; 3344a: 69 17 cp r22, r25 3344c: 08 f4 brcc .+2 ; 0x33450 3344e: 86 cf rjmp .-244 ; 0x3335c 33450: 3f ed ldi r19, 0xDF ; 223 33452: 38 0f add r19, r24 33454: 3e 35 cpi r19, 0x5E ; 94 33456: 08 f0 brcs .+2 ; 0x3345a 33458: 81 cf rjmp .-254 ; 0x3335c // only upper case allowed in 8.3 names - convert lower to upper name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); 3345a: 3f e9 ldi r19, 0x9F ; 159 3345c: 38 0f add r19, r24 3345e: 3a 31 cpi r19, 0x1A ; 26 33460: 10 f4 brcc .+4 ; 0x33466 33462: 20 ee ldi r18, 0xE0 ; 224 33464: 28 0f add r18, r24 33466: fa 01 movw r30, r20 33468: e9 0f add r30, r25 3346a: f1 1d adc r31, r1 3346c: 20 83 st Z, r18 3346e: 9f 5f subi r25, 0xFF ; 255 33470: e1 cf rjmp .-62 ; 0x33434 if (!dir2.openRoot(dirFile->vol_)) goto fail; parent = &dir2; } } while (1) { if (!make83Name(path, dname, &path)) goto fail; 33472: 8f a9 ldd r24, Y+55 ; 0x37 33474: 80 32 cpi r24, 0x20 ; 32 33476: 09 f4 brne .+2 ; 0x3347a 33478: 71 cf rjmp .-286 ; 0x3335c 3347a: 69 01 movw r12, r18 while (*path == '/') path++; 3347c: f9 01 movw r30, r18 3347e: 80 81 ld r24, Z 33480: 2f 5f subi r18, 0xFF ; 255 33482: 3f 4f sbci r19, 0xFF ; 255 33484: 8f 32 cpi r24, 0x2F ; 47 33486: c9 f3 breq .-14 ; 0x3347a if (!*path) break; 33488: 88 23 and r24, r24 3348a: d9 f0 breq .+54 ; 0x334c2 if (!sub->open(parent, dname, O_READ)) goto fail; 3348c: 21 e0 ldi r18, 0x01 ; 1 3348e: b8 01 movw r22, r16 33490: c7 01 movw r24, r14 33492: 0f 94 88 72 call 0x2e510 ; 0x2e510 33496: 88 23 and r24, r24 33498: 09 f4 brne .+2 ; 0x3349c 3349a: 60 cf rjmp .-320 ; 0x3335c if (parent != dirFile) parent->close(); 3349c: 0a 15 cp r16, r10 3349e: 1b 05 cpc r17, r11 334a0: 19 f0 breq .+6 ; 0x334a8 334a2: c8 01 movw r24, r16 334a4: 0f 94 92 6e call 0x2dd24 ; 0x2dd24 parent = sub; sub = parent != &dir1 ? &dir1 : &dir2; 334a8: 94 2d mov r25, r4 334aa: 85 2d mov r24, r5 334ac: 6e 14 cp r6, r14 334ae: 7f 04 cpc r7, r15 334b0: 21 f0 breq .+8 ; 0x334ba 334b2: 23 96 adiw r28, 0x03 ; 3 334b4: 9f ad ldd r25, Y+63 ; 0x3f 334b6: 23 97 sbiw r28, 0x03 ; 3 334b8: 82 2d mov r24, r2 334ba: 87 01 movw r16, r14 334bc: e9 2e mov r14, r25 334be: f8 2e mov r15, r24 334c0: 9e cf rjmp .-196 ; 0x333fe } return open(parent, dname, oflag); 334c2: 23 2d mov r18, r3 334c4: b8 01 movw r22, r16 334c6: c4 01 movw r24, r8 334c8: 0f 94 88 72 call 0x2e510 ; 0x2e510 334cc: 18 2f mov r17, r24 334ce: 47 cf rjmp .-370 ; 0x3335e 000334d0 <__floatunsisf>: 334d0: e8 94 clt 334d2: 09 c0 rjmp .+18 ; 0x334e6 <__floatsisf+0x12> 000334d4 <__floatsisf>: 334d4: 97 fb bst r25, 7 334d6: 3e f4 brtc .+14 ; 0x334e6 <__floatsisf+0x12> 334d8: 90 95 com r25 334da: 80 95 com r24 334dc: 70 95 com r23 334de: 61 95 neg r22 334e0: 7f 4f sbci r23, 0xFF ; 255 334e2: 8f 4f sbci r24, 0xFF ; 255 334e4: 9f 4f sbci r25, 0xFF ; 255 334e6: 99 23 and r25, r25 334e8: a9 f0 breq .+42 ; 0x33514 <__floatsisf+0x40> 334ea: f9 2f mov r31, r25 334ec: 96 e9 ldi r25, 0x96 ; 150 334ee: bb 27 eor r27, r27 334f0: 93 95 inc r25 334f2: f6 95 lsr r31 334f4: 87 95 ror r24 334f6: 77 95 ror r23 334f8: 67 95 ror r22 334fa: b7 95 ror r27 334fc: f1 11 cpse r31, r1 334fe: f8 cf rjmp .-16 ; 0x334f0 <__floatsisf+0x1c> 33500: fa f4 brpl .+62 ; 0x33540 <__floatsisf+0x6c> 33502: bb 0f add r27, r27 33504: 11 f4 brne .+4 ; 0x3350a <__floatsisf+0x36> 33506: 60 ff sbrs r22, 0 33508: 1b c0 rjmp .+54 ; 0x33540 <__floatsisf+0x6c> 3350a: 6f 5f subi r22, 0xFF ; 255 3350c: 7f 4f sbci r23, 0xFF ; 255 3350e: 8f 4f sbci r24, 0xFF ; 255 33510: 9f 4f sbci r25, 0xFF ; 255 33512: 16 c0 rjmp .+44 ; 0x33540 <__floatsisf+0x6c> 33514: 88 23 and r24, r24 33516: 11 f0 breq .+4 ; 0x3351c <__floatsisf+0x48> 33518: 96 e9 ldi r25, 0x96 ; 150 3351a: 11 c0 rjmp .+34 ; 0x3353e <__floatsisf+0x6a> 3351c: 77 23 and r23, r23 3351e: 21 f0 breq .+8 ; 0x33528 <__floatsisf+0x54> 33520: 9e e8 ldi r25, 0x8E ; 142 33522: 87 2f mov r24, r23 33524: 76 2f mov r23, r22 33526: 05 c0 rjmp .+10 ; 0x33532 <__floatsisf+0x5e> 33528: 66 23 and r22, r22 3352a: 71 f0 breq .+28 ; 0x33548 <__floatsisf+0x74> 3352c: 96 e8 ldi r25, 0x86 ; 134 3352e: 86 2f mov r24, r22 33530: 70 e0 ldi r23, 0x00 ; 0 33532: 60 e0 ldi r22, 0x00 ; 0 33534: 2a f0 brmi .+10 ; 0x33540 <__floatsisf+0x6c> 33536: 9a 95 dec r25 33538: 66 0f add r22, r22 3353a: 77 1f adc r23, r23 3353c: 88 1f adc r24, r24 3353e: da f7 brpl .-10 ; 0x33536 <__floatsisf+0x62> 33540: 88 0f add r24, r24 33542: 96 95 lsr r25 33544: 87 95 ror r24 33546: 97 f9 bld r25, 7 33548: 08 95 ret 0003354a : 3354a: 9b 01 movw r18, r22 3354c: ac 01 movw r20, r24 3354e: 0d 94 a9 9a jmp 0x33552 ; 0x33552 <__mulsf3> 00033552 <__mulsf3>: 33552: 0f 94 bc 9a call 0x33578 ; 0x33578 <__mulsf3x> 33556: 0d 94 2d 9b jmp 0x3365a ; 0x3365a <__fp_round> 3355a: 0f 94 1f 9b call 0x3363e ; 0x3363e <__fp_pscA> 3355e: 38 f0 brcs .+14 ; 0x3356e <__mulsf3+0x1c> 33560: 0f 94 26 9b call 0x3364c ; 0x3364c <__fp_pscB> 33564: 20 f0 brcs .+8 ; 0x3356e <__mulsf3+0x1c> 33566: 95 23 and r25, r21 33568: 11 f0 breq .+4 ; 0x3356e <__mulsf3+0x1c> 3356a: 0d 94 16 9b jmp 0x3362c ; 0x3362c <__fp_inf> 3356e: 0d 94 1c 9b jmp 0x33638 ; 0x33638 <__fp_nan> 33572: 11 24 eor r1, r1 33574: 0d 94 61 9b jmp 0x336c2 ; 0x336c2 <__fp_szero> 00033578 <__mulsf3x>: 33578: 0f 94 3e 9b call 0x3367c ; 0x3367c <__fp_split3> 3357c: 70 f3 brcs .-36 ; 0x3355a <__mulsf3+0x8> 0003357e <__mulsf3_pse>: 3357e: 95 9f mul r25, r21 33580: c1 f3 breq .-16 ; 0x33572 <__mulsf3+0x20> 33582: 95 0f add r25, r21 33584: 50 e0 ldi r21, 0x00 ; 0 33586: 55 1f adc r21, r21 33588: 62 9f mul r22, r18 3358a: f0 01 movw r30, r0 3358c: 72 9f mul r23, r18 3358e: bb 27 eor r27, r27 33590: f0 0d add r31, r0 33592: b1 1d adc r27, r1 33594: 63 9f mul r22, r19 33596: aa 27 eor r26, r26 33598: f0 0d add r31, r0 3359a: b1 1d adc r27, r1 3359c: aa 1f adc r26, r26 3359e: 64 9f mul r22, r20 335a0: 66 27 eor r22, r22 335a2: b0 0d add r27, r0 335a4: a1 1d adc r26, r1 335a6: 66 1f adc r22, r22 335a8: 82 9f mul r24, r18 335aa: 22 27 eor r18, r18 335ac: b0 0d add r27, r0 335ae: a1 1d adc r26, r1 335b0: 62 1f adc r22, r18 335b2: 73 9f mul r23, r19 335b4: b0 0d add r27, r0 335b6: a1 1d adc r26, r1 335b8: 62 1f adc r22, r18 335ba: 83 9f mul r24, r19 335bc: a0 0d add r26, r0 335be: 61 1d adc r22, r1 335c0: 22 1f adc r18, r18 335c2: 74 9f mul r23, r20 335c4: 33 27 eor r19, r19 335c6: a0 0d add r26, r0 335c8: 61 1d adc r22, r1 335ca: 23 1f adc r18, r19 335cc: 84 9f mul r24, r20 335ce: 60 0d add r22, r0 335d0: 21 1d adc r18, r1 335d2: 82 2f mov r24, r18 335d4: 76 2f mov r23, r22 335d6: 6a 2f mov r22, r26 335d8: 11 24 eor r1, r1 335da: 9f 57 subi r25, 0x7F ; 127 335dc: 50 40 sbci r21, 0x00 ; 0 335de: 9a f0 brmi .+38 ; 0x33606 <__mulsf3_pse+0x88> 335e0: f1 f0 breq .+60 ; 0x3361e <__mulsf3_pse+0xa0> 335e2: 88 23 and r24, r24 335e4: 4a f0 brmi .+18 ; 0x335f8 <__mulsf3_pse+0x7a> 335e6: ee 0f add r30, r30 335e8: ff 1f adc r31, r31 335ea: bb 1f adc r27, r27 335ec: 66 1f adc r22, r22 335ee: 77 1f adc r23, r23 335f0: 88 1f adc r24, r24 335f2: 91 50 subi r25, 0x01 ; 1 335f4: 50 40 sbci r21, 0x00 ; 0 335f6: a9 f7 brne .-22 ; 0x335e2 <__mulsf3_pse+0x64> 335f8: 9e 3f cpi r25, 0xFE ; 254 335fa: 51 05 cpc r21, r1 335fc: 80 f0 brcs .+32 ; 0x3361e <__mulsf3_pse+0xa0> 335fe: 0d 94 16 9b jmp 0x3362c ; 0x3362c <__fp_inf> 33602: 0d 94 61 9b jmp 0x336c2 ; 0x336c2 <__fp_szero> 33606: 5f 3f cpi r21, 0xFF ; 255 33608: e4 f3 brlt .-8 ; 0x33602 <__mulsf3_pse+0x84> 3360a: 98 3e cpi r25, 0xE8 ; 232 3360c: d4 f3 brlt .-12 ; 0x33602 <__mulsf3_pse+0x84> 3360e: 86 95 lsr r24 33610: 77 95 ror r23 33612: 67 95 ror r22 33614: b7 95 ror r27 33616: f7 95 ror r31 33618: e7 95 ror r30 3361a: 9f 5f subi r25, 0xFF ; 255 3361c: c1 f7 brne .-16 ; 0x3360e <__mulsf3_pse+0x90> 3361e: fe 2b or r31, r30 33620: 88 0f add r24, r24 33622: 91 1d adc r25, r1 33624: 96 95 lsr r25 33626: 87 95 ror r24 33628: 97 f9 bld r25, 7 3362a: 08 95 ret 0003362c <__fp_inf>: 3362c: 97 f9 bld r25, 7 3362e: 9f 67 ori r25, 0x7F ; 127 33630: 80 e8 ldi r24, 0x80 ; 128 33632: 70 e0 ldi r23, 0x00 ; 0 33634: 60 e0 ldi r22, 0x00 ; 0 33636: 08 95 ret 00033638 <__fp_nan>: 33638: 9f ef ldi r25, 0xFF ; 255 3363a: 80 ec ldi r24, 0xC0 ; 192 3363c: 08 95 ret 0003363e <__fp_pscA>: 3363e: 00 24 eor r0, r0 33640: 0a 94 dec r0 33642: 16 16 cp r1, r22 33644: 17 06 cpc r1, r23 33646: 18 06 cpc r1, r24 33648: 09 06 cpc r0, r25 3364a: 08 95 ret 0003364c <__fp_pscB>: 3364c: 00 24 eor r0, r0 3364e: 0a 94 dec r0 33650: 12 16 cp r1, r18 33652: 13 06 cpc r1, r19 33654: 14 06 cpc r1, r20 33656: 05 06 cpc r0, r21 33658: 08 95 ret 0003365a <__fp_round>: 3365a: 09 2e mov r0, r25 3365c: 03 94 inc r0 3365e: 00 0c add r0, r0 33660: 11 f4 brne .+4 ; 0x33666 <__fp_round+0xc> 33662: 88 23 and r24, r24 33664: 52 f0 brmi .+20 ; 0x3367a <__fp_round+0x20> 33666: bb 0f add r27, r27 33668: 40 f4 brcc .+16 ; 0x3367a <__fp_round+0x20> 3366a: bf 2b or r27, r31 3366c: 11 f4 brne .+4 ; 0x33672 <__fp_round+0x18> 3366e: 60 ff sbrs r22, 0 33670: 04 c0 rjmp .+8 ; 0x3367a <__fp_round+0x20> 33672: 6f 5f subi r22, 0xFF ; 255 33674: 7f 4f sbci r23, 0xFF ; 255 33676: 8f 4f sbci r24, 0xFF ; 255 33678: 9f 4f sbci r25, 0xFF ; 255 3367a: 08 95 ret 0003367c <__fp_split3>: 3367c: 57 fd sbrc r21, 7 3367e: 90 58 subi r25, 0x80 ; 128 33680: 44 0f add r20, r20 33682: 55 1f adc r21, r21 33684: 59 f0 breq .+22 ; 0x3369c <__fp_splitA+0x10> 33686: 5f 3f cpi r21, 0xFF ; 255 33688: 71 f0 breq .+28 ; 0x336a6 <__fp_splitA+0x1a> 3368a: 47 95 ror r20 0003368c <__fp_splitA>: 3368c: 88 0f add r24, r24 3368e: 97 fb bst r25, 7 33690: 99 1f adc r25, r25 33692: 61 f0 breq .+24 ; 0x336ac <__fp_splitA+0x20> 33694: 9f 3f cpi r25, 0xFF ; 255 33696: 79 f0 breq .+30 ; 0x336b6 <__fp_splitA+0x2a> 33698: 87 95 ror r24 3369a: 08 95 ret 3369c: 12 16 cp r1, r18 3369e: 13 06 cpc r1, r19 336a0: 14 06 cpc r1, r20 336a2: 55 1f adc r21, r21 336a4: f2 cf rjmp .-28 ; 0x3368a <__fp_split3+0xe> 336a6: 46 95 lsr r20 336a8: f1 df rcall .-30 ; 0x3368c <__fp_splitA> 336aa: 08 c0 rjmp .+16 ; 0x336bc <__fp_splitA+0x30> 336ac: 16 16 cp r1, r22 336ae: 17 06 cpc r1, r23 336b0: 18 06 cpc r1, r24 336b2: 99 1f adc r25, r25 336b4: f1 cf rjmp .-30 ; 0x33698 <__fp_splitA+0xc> 336b6: 86 95 lsr r24 336b8: 71 05 cpc r23, r1 336ba: 61 05 cpc r22, r1 336bc: 08 94 sec 336be: 08 95 ret 000336c0 <__fp_zero>: 336c0: e8 94 clt 000336c2 <__fp_szero>: 336c2: bb 27 eor r27, r27 336c4: 66 27 eor r22, r22 336c6: 77 27 eor r23, r23 336c8: cb 01 movw r24, r22 336ca: 97 f9 bld r25, 7 336cc: 08 95 ret 000336ce : 336ce: 3f 92 push r3 336d0: 4f 92 push r4 336d2: 5f 92 push r5 336d4: 6f 92 push r6 336d6: 7f 92 push r7 336d8: 8f 92 push r8 336da: 9f 92 push r9 336dc: af 92 push r10 336de: bf 92 push r11 336e0: cf 92 push r12 336e2: df 92 push r13 336e4: ef 92 push r14 336e6: ff 92 push r15 336e8: 0f 93 push r16 336ea: 1f 93 push r17 336ec: cf 93 push r28 336ee: df 93 push r29 336f0: 5c 01 movw r10, r24 336f2: 6b 01 movw r12, r22 336f4: 7a 01 movw r14, r20 336f6: 61 15 cp r22, r1 336f8: 71 05 cpc r23, r1 336fa: 19 f0 breq .+6 ; 0x33702 336fc: fb 01 movw r30, r22 336fe: 91 83 std Z+1, r25 ; 0x01 33700: 80 83 st Z, r24 33702: e1 14 cp r14, r1 33704: f1 04 cpc r15, r1 33706: 51 f0 breq .+20 ; 0x3371c 33708: c7 01 movw r24, r14 3370a: 02 97 sbiw r24, 0x02 ; 2 3370c: 83 97 sbiw r24, 0x23 ; 35 3370e: 30 f0 brcs .+12 ; 0x3371c 33710: 40 e0 ldi r20, 0x00 ; 0 33712: 30 e0 ldi r19, 0x00 ; 0 33714: 20 e0 ldi r18, 0x00 ; 0 33716: 90 e0 ldi r25, 0x00 ; 0 33718: 6b c0 rjmp .+214 ; 0x337f0 3371a: 5e 01 movw r10, r28 3371c: e5 01 movw r28, r10 3371e: 21 96 adiw r28, 0x01 ; 1 33720: f5 01 movw r30, r10 33722: 10 81 ld r17, Z 33724: 81 2f mov r24, r17 33726: 90 e0 ldi r25, 0x00 ; 0 33728: 0f 94 6d 9d call 0x33ada ; 0x33ada 3372c: 89 2b or r24, r25 3372e: a9 f7 brne .-22 ; 0x3371a 33730: 1d 32 cpi r17, 0x2D ; 45 33732: 01 f5 brne .+64 ; 0x33774 33734: 21 96 adiw r28, 0x01 ; 1 33736: f5 01 movw r30, r10 33738: 11 81 ldd r17, Z+1 ; 0x01 3373a: 01 e0 ldi r16, 0x01 ; 1 3373c: e1 14 cp r14, r1 3373e: f1 04 cpc r15, r1 33740: 09 f4 brne .+2 ; 0x33744 33742: e6 c0 rjmp .+460 ; 0x33910 33744: f0 e1 ldi r31, 0x10 ; 16 33746: ef 16 cp r14, r31 33748: f1 04 cpc r15, r1 3374a: 09 f0 breq .+2 ; 0x3374e 3374c: 88 c0 rjmp .+272 ; 0x3385e 3374e: 10 33 cpi r17, 0x30 ; 48 33750: 59 f4 brne .+22 ; 0x33768 33752: 88 81 ld r24, Y 33754: 8f 7d andi r24, 0xDF ; 223 33756: 88 35 cpi r24, 0x58 ; 88 33758: 09 f0 breq .+2 ; 0x3375c 3375a: 7c c0 rjmp .+248 ; 0x33854 3375c: 19 81 ldd r17, Y+1 ; 0x01 3375e: 22 96 adiw r28, 0x02 ; 2 33760: 02 60 ori r16, 0x02 ; 2 33762: f0 e1 ldi r31, 0x10 ; 16 33764: ef 2e mov r14, r31 33766: f1 2c mov r15, r1 33768: 81 2c mov r8, r1 3376a: 91 2c mov r9, r1 3376c: a1 2c mov r10, r1 3376e: 88 e0 ldi r24, 0x08 ; 8 33770: b8 2e mov r11, r24 33772: 92 c0 rjmp .+292 ; 0x33898 33774: 1b 32 cpi r17, 0x2B ; 43 33776: 21 f4 brne .+8 ; 0x33780 33778: e5 01 movw r28, r10 3377a: 22 96 adiw r28, 0x02 ; 2 3377c: f5 01 movw r30, r10 3377e: 11 81 ldd r17, Z+1 ; 0x01 33780: 00 e0 ldi r16, 0x00 ; 0 33782: dc cf rjmp .-72 ; 0x3373c 33784: ea e0 ldi r30, 0x0A ; 10 33786: ee 16 cp r14, r30 33788: f1 04 cpc r15, r1 3378a: 09 f4 brne .+2 ; 0x3378e 3378c: c7 c0 rjmp .+398 ; 0x3391c 3378e: f0 e1 ldi r31, 0x10 ; 16 33790: ef 16 cp r14, r31 33792: f1 04 cpc r15, r1 33794: 09 f0 breq .+2 ; 0x33798 33796: 73 c0 rjmp .+230 ; 0x3387e 33798: e7 cf rjmp .-50 ; 0x33768 3379a: 78 e0 ldi r23, 0x08 ; 8 3379c: e7 2e mov r14, r23 3379e: f1 2c mov r15, r1 337a0: 81 2c mov r8, r1 337a2: 91 2c mov r9, r1 337a4: a1 2c mov r10, r1 337a6: 60 e1 ldi r22, 0x10 ; 16 337a8: b6 2e mov r11, r22 337aa: 76 c0 rjmp .+236 ; 0x33898 337ac: 21 e0 ldi r18, 0x01 ; 1 337ae: ad c0 rjmp .+346 ; 0x3390a 337b0: 30 2f mov r19, r16 337b2: 31 70 andi r19, 0x01 ; 1 337b4: c1 14 cp r12, r1 337b6: d1 04 cpc r13, r1 337b8: 31 f0 breq .+12 ; 0x337c6 337ba: 22 23 and r18, r18 337bc: 71 f1 breq .+92 ; 0x3381a 337be: 21 97 sbiw r28, 0x01 ; 1 337c0: f6 01 movw r30, r12 337c2: d1 83 std Z+1, r29 ; 0x01 337c4: c0 83 st Z, r28 337c6: 27 ff sbrs r18, 7 337c8: 2e c0 rjmp .+92 ; 0x33826 337ca: 60 e0 ldi r22, 0x00 ; 0 337cc: 70 e0 ldi r23, 0x00 ; 0 337ce: 80 e0 ldi r24, 0x00 ; 0 337d0: 90 e8 ldi r25, 0x80 ; 128 337d2: 31 11 cpse r19, r1 337d4: 04 c0 rjmp .+8 ; 0x337de 337d6: 6f ef ldi r22, 0xFF ; 255 337d8: 7f ef ldi r23, 0xFF ; 255 337da: 8f ef ldi r24, 0xFF ; 255 337dc: 9f e7 ldi r25, 0x7F ; 127 337de: 22 e2 ldi r18, 0x22 ; 34 337e0: 30 e0 ldi r19, 0x00 ; 0 337e2: 30 93 f9 16 sts 0x16F9, r19 ; 0x8016f9 337e6: 20 93 f8 16 sts 0x16F8, r18 ; 0x8016f8 337ea: 46 2f mov r20, r22 337ec: 37 2f mov r19, r23 337ee: 28 2f mov r18, r24 337f0: 64 2f mov r22, r20 337f2: 73 2f mov r23, r19 337f4: 82 2f mov r24, r18 337f6: df 91 pop r29 337f8: cf 91 pop r28 337fa: 1f 91 pop r17 337fc: 0f 91 pop r16 337fe: ff 90 pop r15 33800: ef 90 pop r14 33802: df 90 pop r13 33804: cf 90 pop r12 33806: bf 90 pop r11 33808: af 90 pop r10 3380a: 9f 90 pop r9 3380c: 8f 90 pop r8 3380e: 7f 90 pop r7 33810: 6f 90 pop r6 33812: 5f 90 pop r5 33814: 4f 90 pop r4 33816: 3f 90 pop r3 33818: 08 95 ret 3381a: 01 ff sbrs r16, 1 3381c: 04 c0 rjmp .+8 ; 0x33826 3381e: 22 97 sbiw r28, 0x02 ; 2 33820: f6 01 movw r30, r12 33822: d1 83 std Z+1, r29 ; 0x01 33824: c0 83 st Z, r28 33826: 33 23 and r19, r19 33828: 41 f0 breq .+16 ; 0x3383a 3382a: 90 95 com r25 3382c: 80 95 com r24 3382e: 70 95 com r23 33830: 61 95 neg r22 33832: 7f 4f sbci r23, 0xFF ; 255 33834: 8f 4f sbci r24, 0xFF ; 255 33836: 9f 4f sbci r25, 0xFF ; 255 33838: d8 cf rjmp .-80 ; 0x337ea 3383a: 97 ff sbrs r25, 7 3383c: d6 cf rjmp .-84 ; 0x337ea 3383e: 82 e2 ldi r24, 0x22 ; 34 33840: 90 e0 ldi r25, 0x00 ; 0 33842: 90 93 f9 16 sts 0x16F9, r25 ; 0x8016f9 33846: 80 93 f8 16 sts 0x16F8, r24 ; 0x8016f8 3384a: 6f ef ldi r22, 0xFF ; 255 3384c: 7f ef ldi r23, 0xFF ; 255 3384e: 8f ef ldi r24, 0xFF ; 255 33850: 9f e7 ldi r25, 0x7F ; 127 33852: cb cf rjmp .-106 ; 0x337ea 33854: 10 e3 ldi r17, 0x30 ; 48 33856: e1 14 cp r14, r1 33858: f1 04 cpc r15, r1 3385a: 09 f4 brne .+2 ; 0x3385e 3385c: 9e cf rjmp .-196 ; 0x3379a 3385e: 28 e0 ldi r18, 0x08 ; 8 33860: e2 16 cp r14, r18 33862: f1 04 cpc r15, r1 33864: 09 f4 brne .+2 ; 0x33868 33866: 9c cf rjmp .-200 ; 0x337a0 33868: 0c f0 brlt .+2 ; 0x3386c 3386a: 8c cf rjmp .-232 ; 0x33784 3386c: 81 2c mov r8, r1 3386e: 91 2c mov r9, r1 33870: a1 2c mov r10, r1 33872: e0 e4 ldi r30, 0x40 ; 64 33874: be 2e mov r11, r30 33876: 82 e0 ldi r24, 0x02 ; 2 33878: e8 16 cp r14, r24 3387a: f1 04 cpc r15, r1 3387c: 69 f0 breq .+26 ; 0x33898 3387e: 60 e0 ldi r22, 0x00 ; 0 33880: 70 e0 ldi r23, 0x00 ; 0 33882: 80 e0 ldi r24, 0x00 ; 0 33884: 90 e8 ldi r25, 0x80 ; 128 33886: 97 01 movw r18, r14 33888: 0f 2c mov r0, r15 3388a: 00 0c add r0, r0 3388c: 44 0b sbc r20, r20 3388e: 55 0b sbc r21, r21 33890: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> 33894: 49 01 movw r8, r18 33896: 5a 01 movw r10, r20 33898: 20 e0 ldi r18, 0x00 ; 0 3389a: 60 e0 ldi r22, 0x00 ; 0 3389c: 70 e0 ldi r23, 0x00 ; 0 3389e: cb 01 movw r24, r22 338a0: 27 01 movw r4, r14 338a2: 0f 2c mov r0, r15 338a4: 00 0c add r0, r0 338a6: 66 08 sbc r6, r6 338a8: 77 08 sbc r7, r7 338aa: fe 01 movw r30, r28 338ac: 50 ed ldi r21, 0xD0 ; 208 338ae: 35 2e mov r3, r21 338b0: 31 0e add r3, r17 338b2: 39 e0 ldi r19, 0x09 ; 9 338b4: 33 15 cp r19, r3 338b6: 70 f4 brcc .+28 ; 0x338d4 338b8: 3f eb ldi r19, 0xBF ; 191 338ba: 31 0f add r19, r17 338bc: 49 ec ldi r20, 0xC9 ; 201 338be: 34 2e mov r3, r20 338c0: 3a 31 cpi r19, 0x1A ; 26 338c2: 38 f0 brcs .+14 ; 0x338d2 338c4: 3f e9 ldi r19, 0x9F ; 159 338c6: 31 0f add r19, r17 338c8: 3a 31 cpi r19, 0x1A ; 26 338ca: 08 f0 brcs .+2 ; 0x338ce 338cc: 71 cf rjmp .-286 ; 0x337b0 338ce: 39 ea ldi r19, 0xA9 ; 169 338d0: 33 2e mov r3, r19 338d2: 31 0e add r3, r17 338d4: 3e 14 cp r3, r14 338d6: 1f 04 cpc r1, r15 338d8: 0c f0 brlt .+2 ; 0x338dc 338da: 6a cf rjmp .-300 ; 0x337b0 338dc: 27 fd sbrc r18, 7 338de: 15 c0 rjmp .+42 ; 0x3390a 338e0: 86 16 cp r8, r22 338e2: 97 06 cpc r9, r23 338e4: a8 06 cpc r10, r24 338e6: b9 06 cpc r11, r25 338e8: 78 f0 brcs .+30 ; 0x33908 338ea: a3 01 movw r20, r6 338ec: 92 01 movw r18, r4 338ee: 0f 94 3f a0 call 0x3407e ; 0x3407e <__mulsi3> 338f2: 63 0d add r22, r3 338f4: 71 1d adc r23, r1 338f6: 81 1d adc r24, r1 338f8: 91 1d adc r25, r1 338fa: 61 30 cpi r22, 0x01 ; 1 338fc: 71 05 cpc r23, r1 338fe: 81 05 cpc r24, r1 33900: 20 e8 ldi r18, 0x80 ; 128 33902: 92 07 cpc r25, r18 33904: 08 f4 brcc .+2 ; 0x33908 33906: 52 cf rjmp .-348 ; 0x337ac 33908: 2f ef ldi r18, 0xFF ; 255 3390a: 21 96 adiw r28, 0x01 ; 1 3390c: 10 81 ld r17, Z 3390e: cd cf rjmp .-102 ; 0x338aa 33910: 10 33 cpi r17, 0x30 ; 48 33912: 09 f4 brne .+2 ; 0x33916 33914: 1e cf rjmp .-452 ; 0x33752 33916: 2a e0 ldi r18, 0x0A ; 10 33918: e2 2e mov r14, r18 3391a: f1 2c mov r15, r1 3391c: 9c ec ldi r25, 0xCC ; 204 3391e: 89 2e mov r8, r25 33920: 98 2c mov r9, r8 33922: a8 2c mov r10, r8 33924: 9c e0 ldi r25, 0x0C ; 12 33926: b9 2e mov r11, r25 33928: b7 cf rjmp .-146 ; 0x33898 0003392a <__ftoa_engine>: 3392a: 28 30 cpi r18, 0x08 ; 8 3392c: 08 f0 brcs .+2 ; 0x33930 <__ftoa_engine+0x6> 3392e: 27 e0 ldi r18, 0x07 ; 7 33930: 33 27 eor r19, r19 33932: da 01 movw r26, r20 33934: 99 0f add r25, r25 33936: 31 1d adc r19, r1 33938: 87 fd sbrc r24, 7 3393a: 91 60 ori r25, 0x01 ; 1 3393c: 00 96 adiw r24, 0x00 ; 0 3393e: 61 05 cpc r22, r1 33940: 71 05 cpc r23, r1 33942: 39 f4 brne .+14 ; 0x33952 <__ftoa_engine+0x28> 33944: 32 60 ori r19, 0x02 ; 2 33946: 2e 5f subi r18, 0xFE ; 254 33948: 3d 93 st X+, r19 3394a: 30 e3 ldi r19, 0x30 ; 48 3394c: 2a 95 dec r18 3394e: e1 f7 brne .-8 ; 0x33948 <__ftoa_engine+0x1e> 33950: 08 95 ret 33952: 9f 3f cpi r25, 0xFF ; 255 33954: 30 f0 brcs .+12 ; 0x33962 <__ftoa_engine+0x38> 33956: 80 38 cpi r24, 0x80 ; 128 33958: 71 05 cpc r23, r1 3395a: 61 05 cpc r22, r1 3395c: 09 f0 breq .+2 ; 0x33960 <__ftoa_engine+0x36> 3395e: 3c 5f subi r19, 0xFC ; 252 33960: 3c 5f subi r19, 0xFC ; 252 33962: 3d 93 st X+, r19 33964: 91 30 cpi r25, 0x01 ; 1 33966: 08 f0 brcs .+2 ; 0x3396a <__ftoa_engine+0x40> 33968: 80 68 ori r24, 0x80 ; 128 3396a: 91 1d adc r25, r1 3396c: df 93 push r29 3396e: cf 93 push r28 33970: 1f 93 push r17 33972: 0f 93 push r16 33974: ff 92 push r15 33976: ef 92 push r14 33978: 19 2f mov r17, r25 3397a: 98 7f andi r25, 0xF8 ; 248 3397c: 96 95 lsr r25 3397e: e9 2f mov r30, r25 33980: 96 95 lsr r25 33982: 96 95 lsr r25 33984: e9 0f add r30, r25 33986: ff 27 eor r31, r31 33988: e0 56 subi r30, 0x60 ; 96 3398a: fe 48 sbci r31, 0x8E ; 142 3398c: 99 27 eor r25, r25 3398e: 33 27 eor r19, r19 33990: ee 24 eor r14, r14 33992: ff 24 eor r15, r15 33994: a7 01 movw r20, r14 33996: e7 01 movw r28, r14 33998: 05 90 lpm r0, Z+ 3399a: 08 94 sec 3399c: 07 94 ror r0 3399e: 28 f4 brcc .+10 ; 0x339aa <__ftoa_engine+0x80> 339a0: 36 0f add r19, r22 339a2: e7 1e adc r14, r23 339a4: f8 1e adc r15, r24 339a6: 49 1f adc r20, r25 339a8: 51 1d adc r21, r1 339aa: 66 0f add r22, r22 339ac: 77 1f adc r23, r23 339ae: 88 1f adc r24, r24 339b0: 99 1f adc r25, r25 339b2: 06 94 lsr r0 339b4: a1 f7 brne .-24 ; 0x3399e <__ftoa_engine+0x74> 339b6: 05 90 lpm r0, Z+ 339b8: 07 94 ror r0 339ba: 28 f4 brcc .+10 ; 0x339c6 <__ftoa_engine+0x9c> 339bc: e7 0e add r14, r23 339be: f8 1e adc r15, r24 339c0: 49 1f adc r20, r25 339c2: 56 1f adc r21, r22 339c4: c1 1d adc r28, r1 339c6: 77 0f add r23, r23 339c8: 88 1f adc r24, r24 339ca: 99 1f adc r25, r25 339cc: 66 1f adc r22, r22 339ce: 06 94 lsr r0 339d0: a1 f7 brne .-24 ; 0x339ba <__ftoa_engine+0x90> 339d2: 05 90 lpm r0, Z+ 339d4: 07 94 ror r0 339d6: 28 f4 brcc .+10 ; 0x339e2 <__ftoa_engine+0xb8> 339d8: f8 0e add r15, r24 339da: 49 1f adc r20, r25 339dc: 56 1f adc r21, r22 339de: c7 1f adc r28, r23 339e0: d1 1d adc r29, r1 339e2: 88 0f add r24, r24 339e4: 99 1f adc r25, r25 339e6: 66 1f adc r22, r22 339e8: 77 1f adc r23, r23 339ea: 06 94 lsr r0 339ec: a1 f7 brne .-24 ; 0x339d6 <__ftoa_engine+0xac> 339ee: 05 90 lpm r0, Z+ 339f0: 07 94 ror r0 339f2: 20 f4 brcc .+8 ; 0x339fc <__ftoa_engine+0xd2> 339f4: 49 0f add r20, r25 339f6: 56 1f adc r21, r22 339f8: c7 1f adc r28, r23 339fa: d8 1f adc r29, r24 339fc: 99 0f add r25, r25 339fe: 66 1f adc r22, r22 33a00: 77 1f adc r23, r23 33a02: 88 1f adc r24, r24 33a04: 06 94 lsr r0 33a06: a9 f7 brne .-22 ; 0x339f2 <__ftoa_engine+0xc8> 33a08: 84 91 lpm r24, Z 33a0a: 10 95 com r17 33a0c: 17 70 andi r17, 0x07 ; 7 33a0e: 41 f0 breq .+16 ; 0x33a20 <__ftoa_engine+0xf6> 33a10: d6 95 lsr r29 33a12: c7 95 ror r28 33a14: 57 95 ror r21 33a16: 47 95 ror r20 33a18: f7 94 ror r15 33a1a: e7 94 ror r14 33a1c: 1a 95 dec r17 33a1e: c1 f7 brne .-16 ; 0x33a10 <__ftoa_engine+0xe6> 33a20: e6 e4 ldi r30, 0x46 ; 70 33a22: f1 e7 ldi r31, 0x71 ; 113 33a24: 68 94 set 33a26: 15 90 lpm r1, Z+ 33a28: 15 91 lpm r17, Z+ 33a2a: 35 91 lpm r19, Z+ 33a2c: 65 91 lpm r22, Z+ 33a2e: 95 91 lpm r25, Z+ 33a30: 05 90 lpm r0, Z+ 33a32: 7f e2 ldi r23, 0x2F ; 47 33a34: 73 95 inc r23 33a36: e1 18 sub r14, r1 33a38: f1 0a sbc r15, r17 33a3a: 43 0b sbc r20, r19 33a3c: 56 0b sbc r21, r22 33a3e: c9 0b sbc r28, r25 33a40: d0 09 sbc r29, r0 33a42: c0 f7 brcc .-16 ; 0x33a34 <__ftoa_engine+0x10a> 33a44: e1 0c add r14, r1 33a46: f1 1e adc r15, r17 33a48: 43 1f adc r20, r19 33a4a: 56 1f adc r21, r22 33a4c: c9 1f adc r28, r25 33a4e: d0 1d adc r29, r0 33a50: 7e f4 brtc .+30 ; 0x33a70 <__ftoa_engine+0x146> 33a52: 70 33 cpi r23, 0x30 ; 48 33a54: 11 f4 brne .+4 ; 0x33a5a <__ftoa_engine+0x130> 33a56: 8a 95 dec r24 33a58: e6 cf rjmp .-52 ; 0x33a26 <__ftoa_engine+0xfc> 33a5a: e8 94 clt 33a5c: 01 50 subi r16, 0x01 ; 1 33a5e: 30 f0 brcs .+12 ; 0x33a6c <__ftoa_engine+0x142> 33a60: 08 0f add r16, r24 33a62: 0a f4 brpl .+2 ; 0x33a66 <__ftoa_engine+0x13c> 33a64: 00 27 eor r16, r16 33a66: 02 17 cp r16, r18 33a68: 08 f4 brcc .+2 ; 0x33a6c <__ftoa_engine+0x142> 33a6a: 20 2f mov r18, r16 33a6c: 23 95 inc r18 33a6e: 02 2f mov r16, r18 33a70: 7a 33 cpi r23, 0x3A ; 58 33a72: 28 f0 brcs .+10 ; 0x33a7e <__ftoa_engine+0x154> 33a74: 79 e3 ldi r23, 0x39 ; 57 33a76: 7d 93 st X+, r23 33a78: 2a 95 dec r18 33a7a: e9 f7 brne .-6 ; 0x33a76 <__ftoa_engine+0x14c> 33a7c: 10 c0 rjmp .+32 ; 0x33a9e <__ftoa_engine+0x174> 33a7e: 7d 93 st X+, r23 33a80: 2a 95 dec r18 33a82: 89 f6 brne .-94 ; 0x33a26 <__ftoa_engine+0xfc> 33a84: 06 94 lsr r0 33a86: 97 95 ror r25 33a88: 67 95 ror r22 33a8a: 37 95 ror r19 33a8c: 17 95 ror r17 33a8e: 17 94 ror r1 33a90: e1 18 sub r14, r1 33a92: f1 0a sbc r15, r17 33a94: 43 0b sbc r20, r19 33a96: 56 0b sbc r21, r22 33a98: c9 0b sbc r28, r25 33a9a: d0 09 sbc r29, r0 33a9c: 98 f0 brcs .+38 ; 0x33ac4 <__ftoa_engine+0x19a> 33a9e: 23 95 inc r18 33aa0: 7e 91 ld r23, -X 33aa2: 73 95 inc r23 33aa4: 7a 33 cpi r23, 0x3A ; 58 33aa6: 08 f0 brcs .+2 ; 0x33aaa <__ftoa_engine+0x180> 33aa8: 70 e3 ldi r23, 0x30 ; 48 33aaa: 7c 93 st X, r23 33aac: 20 13 cpse r18, r16 33aae: b8 f7 brcc .-18 ; 0x33a9e <__ftoa_engine+0x174> 33ab0: 7e 91 ld r23, -X 33ab2: 70 61 ori r23, 0x10 ; 16 33ab4: 7d 93 st X+, r23 33ab6: 30 f0 brcs .+12 ; 0x33ac4 <__ftoa_engine+0x19a> 33ab8: 83 95 inc r24 33aba: 71 e3 ldi r23, 0x31 ; 49 33abc: 7d 93 st X+, r23 33abe: 70 e3 ldi r23, 0x30 ; 48 33ac0: 2a 95 dec r18 33ac2: e1 f7 brne .-8 ; 0x33abc <__ftoa_engine+0x192> 33ac4: 11 24 eor r1, r1 33ac6: ef 90 pop r14 33ac8: ff 90 pop r15 33aca: 0f 91 pop r16 33acc: 1f 91 pop r17 33ace: cf 91 pop r28 33ad0: df 91 pop r29 33ad2: 99 27 eor r25, r25 33ad4: 87 fd sbrc r24, 7 33ad6: 90 95 com r25 33ad8: 08 95 ret 00033ada : 33ada: 91 11 cpse r25, r1 33adc: 0d 94 c9 9f jmp 0x33f92 ; 0x33f92 <__ctype_isfalse> 33ae0: 80 32 cpi r24, 0x20 ; 32 33ae2: 19 f0 breq .+6 ; 0x33aea 33ae4: 89 50 subi r24, 0x09 ; 9 33ae6: 85 50 subi r24, 0x05 ; 5 33ae8: c8 f7 brcc .-14 ; 0x33adc 33aea: 08 95 ret 00033aec : 33aec: fb 01 movw r30, r22 33aee: dc 01 movw r26, r24 33af0: 02 c0 rjmp .+4 ; 0x33af6 33af2: 05 90 lpm r0, Z+ 33af4: 0d 92 st X+, r0 33af6: 41 50 subi r20, 0x01 ; 1 33af8: 50 40 sbci r21, 0x00 ; 0 33afa: d8 f7 brcc .-10 ; 0x33af2 33afc: 08 95 ret 00033afe : 33afe: fb 01 movw r30, r22 33b00: dc 01 movw r26, r24 33b02: 0d 90 ld r0, X+ 33b04: 00 20 and r0, r0 33b06: e9 f7 brne .-6 ; 0x33b02 33b08: 11 97 sbiw r26, 0x01 ; 1 33b0a: 05 90 lpm r0, Z+ 33b0c: 0d 92 st X+, r0 33b0e: 00 20 and r0, r0 33b10: e1 f7 brne .-8 ; 0x33b0a 33b12: 08 95 ret 00033b14 : 33b14: fb 01 movw r30, r22 33b16: dc 01 movw r26, r24 33b18: 8d 91 ld r24, X+ 33b1a: 05 90 lpm r0, Z+ 33b1c: 80 19 sub r24, r0 33b1e: 01 10 cpse r0, r1 33b20: d9 f3 breq .-10 ; 0x33b18 33b22: 99 0b sbc r25, r25 33b24: 08 95 ret 00033b26 : 33b26: fb 01 movw r30, r22 33b28: dc 01 movw r26, r24 33b2a: 05 90 lpm r0, Z+ 33b2c: 0d 92 st X+, r0 33b2e: 00 20 and r0, r0 33b30: e1 f7 brne .-8 ; 0x33b2a 33b32: 08 95 ret 00033b34 <__strlen_P>: 33b34: fc 01 movw r30, r24 33b36: 05 90 lpm r0, Z+ 33b38: 00 20 and r0, r0 33b3a: e9 f7 brne .-6 ; 0x33b36 <__strlen_P+0x2> 33b3c: 80 95 com r24 33b3e: 90 95 com r25 33b40: 8e 0f add r24, r30 33b42: 9f 1f adc r25, r31 33b44: 08 95 ret 00033b46 : 33b46: fb 01 movw r30, r22 33b48: dc 01 movw r26, r24 33b4a: 41 50 subi r20, 0x01 ; 1 33b4c: 50 40 sbci r21, 0x00 ; 0 33b4e: 88 f0 brcs .+34 ; 0x33b72 33b50: 8d 91 ld r24, X+ 33b52: 81 34 cpi r24, 0x41 ; 65 33b54: 1c f0 brlt .+6 ; 0x33b5c 33b56: 8b 35 cpi r24, 0x5B ; 91 33b58: 0c f4 brge .+2 ; 0x33b5c 33b5a: 80 5e subi r24, 0xE0 ; 224 33b5c: 65 91 lpm r22, Z+ 33b5e: 61 34 cpi r22, 0x41 ; 65 33b60: 1c f0 brlt .+6 ; 0x33b68 33b62: 6b 35 cpi r22, 0x5B ; 91 33b64: 0c f4 brge .+2 ; 0x33b68 33b66: 60 5e subi r22, 0xE0 ; 224 33b68: 86 1b sub r24, r22 33b6a: 61 11 cpse r22, r1 33b6c: 71 f3 breq .-36 ; 0x33b4a 33b6e: 99 0b sbc r25, r25 33b70: 08 95 ret 33b72: 88 1b sub r24, r24 33b74: fc cf rjmp .-8 ; 0x33b6e 00033b76 : 33b76: fb 01 movw r30, r22 33b78: dc 01 movw r26, r24 33b7a: 41 50 subi r20, 0x01 ; 1 33b7c: 50 40 sbci r21, 0x00 ; 0 33b7e: 30 f0 brcs .+12 ; 0x33b8c 33b80: 8d 91 ld r24, X+ 33b82: 05 90 lpm r0, Z+ 33b84: 80 19 sub r24, r0 33b86: 19 f4 brne .+6 ; 0x33b8e 33b88: 00 20 and r0, r0 33b8a: b9 f7 brne .-18 ; 0x33b7a 33b8c: 88 1b sub r24, r24 33b8e: 99 0b sbc r25, r25 33b90: 08 95 ret 00033b92 : 33b92: fb 01 movw r30, r22 33b94: dc 01 movw r26, r24 33b96: 41 50 subi r20, 0x01 ; 1 33b98: 50 40 sbci r21, 0x00 ; 0 33b9a: 48 f0 brcs .+18 ; 0x33bae 33b9c: 05 90 lpm r0, Z+ 33b9e: 0d 92 st X+, r0 33ba0: 00 20 and r0, r0 33ba2: c9 f7 brne .-14 ; 0x33b96 33ba4: 01 c0 rjmp .+2 ; 0x33ba8 33ba6: 1d 92 st X+, r1 33ba8: 41 50 subi r20, 0x01 ; 1 33baa: 50 40 sbci r21, 0x00 ; 0 33bac: e0 f7 brcc .-8 ; 0x33ba6 33bae: 08 95 ret 00033bb0 : 33bb0: fc 01 movw r30, r24 33bb2: 05 90 lpm r0, Z+ 33bb4: 61 50 subi r22, 0x01 ; 1 33bb6: 70 40 sbci r23, 0x00 ; 0 33bb8: 01 10 cpse r0, r1 33bba: d8 f7 brcc .-10 ; 0x33bb2 33bbc: 80 95 com r24 33bbe: 90 95 com r25 33bc0: 8e 0f add r24, r30 33bc2: 9f 1f adc r25, r31 33bc4: 08 95 ret 00033bc6 : 33bc6: fb 01 movw r30, r22 33bc8: 55 91 lpm r21, Z+ 33bca: 55 23 and r21, r21 33bcc: a9 f0 breq .+42 ; 0x33bf8 33bce: bf 01 movw r22, r30 33bd0: dc 01 movw r26, r24 33bd2: 4d 91 ld r20, X+ 33bd4: 45 17 cp r20, r21 33bd6: 41 11 cpse r20, r1 33bd8: e1 f7 brne .-8 ; 0x33bd2 33bda: 59 f4 brne .+22 ; 0x33bf2 33bdc: cd 01 movw r24, r26 33bde: 05 90 lpm r0, Z+ 33be0: 00 20 and r0, r0 33be2: 49 f0 breq .+18 ; 0x33bf6 33be4: 4d 91 ld r20, X+ 33be6: 40 15 cp r20, r0 33be8: 41 11 cpse r20, r1 33bea: c9 f3 breq .-14 ; 0x33bde 33bec: fb 01 movw r30, r22 33bee: 41 11 cpse r20, r1 33bf0: ef cf rjmp .-34 ; 0x33bd0 33bf2: 81 e0 ldi r24, 0x01 ; 1 33bf4: 90 e0 ldi r25, 0x00 ; 0 33bf6: 01 97 sbiw r24, 0x01 ; 1 33bf8: 08 95 ret 00033bfa : 33bfa: fc 01 movw r30, r24 33bfc: 61 50 subi r22, 0x01 ; 1 33bfe: 70 40 sbci r23, 0x00 ; 0 33c00: 01 90 ld r0, Z+ 33c02: 01 10 cpse r0, r1 33c04: d8 f7 brcc .-10 ; 0x33bfc 33c06: 80 95 com r24 33c08: 90 95 com r25 33c0a: 8e 0f add r24, r30 33c0c: 9f 1f adc r25, r31 33c0e: 08 95 ret 00033c10 : 33c10: cf 93 push r28 33c12: df 93 push r29 33c14: ec 01 movw r28, r24 33c16: 2b 81 ldd r18, Y+3 ; 0x03 33c18: 20 ff sbrs r18, 0 33c1a: 1a c0 rjmp .+52 ; 0x33c50 33c1c: 26 ff sbrs r18, 6 33c1e: 0c c0 rjmp .+24 ; 0x33c38 33c20: 2f 7b andi r18, 0xBF ; 191 33c22: 2b 83 std Y+3, r18 ; 0x03 33c24: 8e 81 ldd r24, Y+6 ; 0x06 33c26: 9f 81 ldd r25, Y+7 ; 0x07 33c28: 01 96 adiw r24, 0x01 ; 1 33c2a: 9f 83 std Y+7, r25 ; 0x07 33c2c: 8e 83 std Y+6, r24 ; 0x06 33c2e: 8a 81 ldd r24, Y+2 ; 0x02 33c30: 90 e0 ldi r25, 0x00 ; 0 33c32: df 91 pop r29 33c34: cf 91 pop r28 33c36: 08 95 ret 33c38: 22 ff sbrs r18, 2 33c3a: 18 c0 rjmp .+48 ; 0x33c6c 33c3c: e8 81 ld r30, Y 33c3e: f9 81 ldd r31, Y+1 ; 0x01 33c40: 80 81 ld r24, Z 33c42: 08 2e mov r0, r24 33c44: 00 0c add r0, r0 33c46: 99 0b sbc r25, r25 33c48: 00 97 sbiw r24, 0x00 ; 0 33c4a: 29 f4 brne .+10 ; 0x33c56 33c4c: 20 62 ori r18, 0x20 ; 32 33c4e: 2b 83 std Y+3, r18 ; 0x03 33c50: 8f ef ldi r24, 0xFF ; 255 33c52: 9f ef ldi r25, 0xFF ; 255 33c54: ee cf rjmp .-36 ; 0x33c32 33c56: 31 96 adiw r30, 0x01 ; 1 33c58: f9 83 std Y+1, r31 ; 0x01 33c5a: e8 83 st Y, r30 33c5c: 2e 81 ldd r18, Y+6 ; 0x06 33c5e: 3f 81 ldd r19, Y+7 ; 0x07 33c60: 2f 5f subi r18, 0xFF ; 255 33c62: 3f 4f sbci r19, 0xFF ; 255 33c64: 3f 83 std Y+7, r19 ; 0x07 33c66: 2e 83 std Y+6, r18 ; 0x06 33c68: 99 27 eor r25, r25 33c6a: e3 cf rjmp .-58 ; 0x33c32 33c6c: ea 85 ldd r30, Y+10 ; 0x0a 33c6e: fb 85 ldd r31, Y+11 ; 0x0b 33c70: 19 95 eicall 33c72: 97 ff sbrs r25, 7 33c74: f3 cf rjmp .-26 ; 0x33c5c 33c76: 2b 81 ldd r18, Y+3 ; 0x03 33c78: 01 96 adiw r24, 0x01 ; 1 33c7a: 21 f0 breq .+8 ; 0x33c84 33c7c: 80 e2 ldi r24, 0x20 ; 32 33c7e: 82 2b or r24, r18 33c80: 8b 83 std Y+3, r24 ; 0x03 33c82: e6 cf rjmp .-52 ; 0x33c50 33c84: 80 e1 ldi r24, 0x10 ; 16 33c86: fb cf rjmp .-10 ; 0x33c7e 00033c88 : 33c88: 0f 93 push r16 33c8a: 1f 93 push r17 33c8c: cf 93 push r28 33c8e: df 93 push r29 33c90: 18 2f mov r17, r24 33c92: 09 2f mov r16, r25 33c94: eb 01 movw r28, r22 33c96: 8b 81 ldd r24, Y+3 ; 0x03 33c98: 81 fd sbrc r24, 1 33c9a: 09 c0 rjmp .+18 ; 0x33cae 33c9c: 1f ef ldi r17, 0xFF ; 255 33c9e: 0f ef ldi r16, 0xFF ; 255 33ca0: 81 2f mov r24, r17 33ca2: 90 2f mov r25, r16 33ca4: df 91 pop r29 33ca6: cf 91 pop r28 33ca8: 1f 91 pop r17 33caa: 0f 91 pop r16 33cac: 08 95 ret 33cae: 82 ff sbrs r24, 2 33cb0: 14 c0 rjmp .+40 ; 0x33cda 33cb2: 2e 81 ldd r18, Y+6 ; 0x06 33cb4: 3f 81 ldd r19, Y+7 ; 0x07 33cb6: 8c 81 ldd r24, Y+4 ; 0x04 33cb8: 9d 81 ldd r25, Y+5 ; 0x05 33cba: 28 17 cp r18, r24 33cbc: 39 07 cpc r19, r25 33cbe: 3c f4 brge .+14 ; 0x33cce 33cc0: e8 81 ld r30, Y 33cc2: f9 81 ldd r31, Y+1 ; 0x01 33cc4: cf 01 movw r24, r30 33cc6: 01 96 adiw r24, 0x01 ; 1 33cc8: 99 83 std Y+1, r25 ; 0x01 33cca: 88 83 st Y, r24 33ccc: 10 83 st Z, r17 33cce: 8e 81 ldd r24, Y+6 ; 0x06 33cd0: 9f 81 ldd r25, Y+7 ; 0x07 33cd2: 01 96 adiw r24, 0x01 ; 1 33cd4: 9f 83 std Y+7, r25 ; 0x07 33cd6: 8e 83 std Y+6, r24 ; 0x06 33cd8: e3 cf rjmp .-58 ; 0x33ca0 33cda: e8 85 ldd r30, Y+8 ; 0x08 33cdc: f9 85 ldd r31, Y+9 ; 0x09 33cde: 81 2f mov r24, r17 33ce0: 19 95 eicall 33ce2: 89 2b or r24, r25 33ce4: a1 f3 breq .-24 ; 0x33cce 33ce6: da cf rjmp .-76 ; 0x33c9c 00033ce8 : 33ce8: ef 92 push r14 33cea: ff 92 push r15 33cec: 0f 93 push r16 33cee: 1f 93 push r17 33cf0: cf 93 push r28 33cf2: df 93 push r29 33cf4: 8c 01 movw r16, r24 33cf6: 7b 01 movw r14, r22 33cf8: db 01 movw r26, r22 33cfa: 13 96 adiw r26, 0x03 ; 3 33cfc: 8c 91 ld r24, X 33cfe: d0 e0 ldi r29, 0x00 ; 0 33d00: c0 e0 ldi r28, 0x00 ; 0 33d02: 81 fd sbrc r24, 1 33d04: 0f c0 rjmp .+30 ; 0x33d24 33d06: cf ef ldi r28, 0xFF ; 255 33d08: df ef ldi r29, 0xFF ; 255 33d0a: 10 c0 rjmp .+32 ; 0x33d2c 33d0c: d7 01 movw r26, r14 33d0e: 18 96 adiw r26, 0x08 ; 8 33d10: ed 91 ld r30, X+ 33d12: fc 91 ld r31, X 33d14: b7 01 movw r22, r14 33d16: 19 95 eicall 33d18: 89 2b or r24, r25 33d1a: 11 f0 breq .+4 ; 0x33d20 33d1c: cf ef ldi r28, 0xFF ; 255 33d1e: df ef ldi r29, 0xFF ; 255 33d20: 0f 5f subi r16, 0xFF ; 255 33d22: 1f 4f sbci r17, 0xFF ; 255 33d24: f8 01 movw r30, r16 33d26: 84 91 lpm r24, Z 33d28: 81 11 cpse r24, r1 33d2a: f0 cf rjmp .-32 ; 0x33d0c 33d2c: ce 01 movw r24, r28 33d2e: df 91 pop r29 33d30: cf 91 pop r28 33d32: 1f 91 pop r17 33d34: 0f 91 pop r16 33d36: ff 90 pop r15 33d38: ef 90 pop r14 33d3a: 08 95 ret 00033d3c : 33d3c: 0f 93 push r16 33d3e: 1f 93 push r17 33d40: cf 93 push r28 33d42: df 93 push r29 33d44: cd b7 in r28, 0x3d ; 61 33d46: de b7 in r29, 0x3e ; 62 33d48: ae 01 movw r20, r28 33d4a: 48 5f subi r20, 0xF8 ; 248 33d4c: 5f 4f sbci r21, 0xFF ; 255 33d4e: da 01 movw r26, r20 33d50: 6d 91 ld r22, X+ 33d52: 7d 91 ld r23, X+ 33d54: ad 01 movw r20, r26 33d56: 0e ef ldi r16, 0xFE ; 254 33d58: 16 e1 ldi r17, 0x16 ; 22 33d5a: f8 01 movw r30, r16 33d5c: 82 81 ldd r24, Z+2 ; 0x02 33d5e: 93 81 ldd r25, Z+3 ; 0x03 33d60: dc 01 movw r26, r24 33d62: 13 96 adiw r26, 0x03 ; 3 33d64: 2c 91 ld r18, X 33d66: 13 97 sbiw r26, 0x03 ; 3 33d68: 28 60 ori r18, 0x08 ; 8 33d6a: 13 96 adiw r26, 0x03 ; 3 33d6c: 2c 93 st X, r18 33d6e: 0e 94 eb 50 call 0xa1d6 ; 0xa1d6 33d72: d8 01 movw r26, r16 33d74: 12 96 adiw r26, 0x02 ; 2 33d76: ed 91 ld r30, X+ 33d78: fc 91 ld r31, X 33d7a: 23 81 ldd r18, Z+3 ; 0x03 33d7c: 27 7f andi r18, 0xF7 ; 247 33d7e: 23 83 std Z+3, r18 ; 0x03 33d80: df 91 pop r29 33d82: cf 91 pop r28 33d84: 1f 91 pop r17 33d86: 0f 91 pop r16 33d88: 08 95 ret 00033d8a : 33d8a: 0f 93 push r16 33d8c: 1f 93 push r17 33d8e: cf 93 push r28 33d90: df 93 push r29 33d92: 8c 01 movw r16, r24 33d94: e0 91 00 17 lds r30, 0x1700 ; 0x801700 <__iob+0x2> 33d98: f0 91 01 17 lds r31, 0x1701 ; 0x801701 <__iob+0x3> 33d9c: 83 81 ldd r24, Z+3 ; 0x03 33d9e: d0 e0 ldi r29, 0x00 ; 0 33da0: c0 e0 ldi r28, 0x00 ; 0 33da2: 81 fd sbrc r24, 1 33da4: 0a c0 rjmp .+20 ; 0x33dba 33da6: cf ef ldi r28, 0xFF ; 255 33da8: df ef ldi r29, 0xFF ; 255 33daa: 17 c0 rjmp .+46 ; 0x33dda 33dac: 19 95 eicall 33dae: 89 2b or r24, r25 33db0: 11 f0 breq .+4 ; 0x33db6 33db2: cf ef ldi r28, 0xFF ; 255 33db4: df ef ldi r29, 0xFF ; 255 33db6: 0f 5f subi r16, 0xFF ; 255 33db8: 1f 4f sbci r17, 0xFF ; 255 33dba: f8 01 movw r30, r16 33dbc: 84 91 lpm r24, Z 33dbe: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> 33dc2: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> 33dc6: db 01 movw r26, r22 33dc8: 18 96 adiw r26, 0x08 ; 8 33dca: ed 91 ld r30, X+ 33dcc: fc 91 ld r31, X 33dce: 81 11 cpse r24, r1 33dd0: ed cf rjmp .-38 ; 0x33dac 33dd2: 8a e0 ldi r24, 0x0A ; 10 33dd4: 19 95 eicall 33dd6: 89 2b or r24, r25 33dd8: 31 f7 brne .-52 ; 0x33da6 33dda: ce 01 movw r24, r28 33ddc: df 91 pop r29 33dde: cf 91 pop r28 33de0: 1f 91 pop r17 33de2: 0f 91 pop r16 33de4: 08 95 ret 00033de6 : 33de6: 0f 93 push r16 33de8: 1f 93 push r17 33dea: cf 93 push r28 33dec: df 93 push r29 33dee: cd b7 in r28, 0x3d ; 61 33df0: de b7 in r29, 0x3e ; 62 33df2: 2e 97 sbiw r28, 0x0e ; 14 33df4: 0f b6 in r0, 0x3f ; 63 33df6: f8 94 cli 33df8: de bf out 0x3e, r29 ; 62 33dfa: 0f be out 0x3f, r0 ; 63 33dfc: cd bf out 0x3d, r28 ; 61 33dfe: 0e 89 ldd r16, Y+22 ; 0x16 33e00: 1f 89 ldd r17, Y+23 ; 0x17 33e02: 8e e0 ldi r24, 0x0E ; 14 33e04: 8c 83 std Y+4, r24 ; 0x04 33e06: 1a 83 std Y+2, r17 ; 0x02 33e08: 09 83 std Y+1, r16 ; 0x01 33e0a: 8f ef ldi r24, 0xFF ; 255 33e0c: 9f e7 ldi r25, 0x7F ; 127 33e0e: 9e 83 std Y+6, r25 ; 0x06 33e10: 8d 83 std Y+5, r24 ; 0x05 33e12: ae 01 movw r20, r28 33e14: 46 5e subi r20, 0xE6 ; 230 33e16: 5f 4f sbci r21, 0xFF ; 255 33e18: 68 8d ldd r22, Y+24 ; 0x18 33e1a: 79 8d ldd r23, Y+25 ; 0x19 33e1c: ce 01 movw r24, r28 33e1e: 01 96 adiw r24, 0x01 ; 1 33e20: 0e 94 eb 50 call 0xa1d6 ; 0xa1d6 33e24: 2f 81 ldd r18, Y+7 ; 0x07 33e26: 38 85 ldd r19, Y+8 ; 0x08 33e28: 02 0f add r16, r18 33e2a: 13 1f adc r17, r19 33e2c: f8 01 movw r30, r16 33e2e: 10 82 st Z, r1 33e30: 2e 96 adiw r28, 0x0e ; 14 33e32: 0f b6 in r0, 0x3f ; 63 33e34: f8 94 cli 33e36: de bf out 0x3e, r29 ; 62 33e38: 0f be out 0x3f, r0 ; 63 33e3a: cd bf out 0x3d, r28 ; 61 33e3c: df 91 pop r29 33e3e: cf 91 pop r28 33e40: 1f 91 pop r17 33e42: 0f 91 pop r16 33e44: 08 95 ret 00033e46 : 33e46: cf 93 push r28 33e48: df 93 push r29 33e4a: ec 01 movw r28, r24 33e4c: 8b 81 ldd r24, Y+3 ; 0x03 33e4e: 88 60 ori r24, 0x08 ; 8 33e50: 8b 83 std Y+3, r24 ; 0x03 33e52: ce 01 movw r24, r28 33e54: 0e 94 eb 50 call 0xa1d6 ; 0xa1d6 33e58: 2b 81 ldd r18, Y+3 ; 0x03 33e5a: 27 7f andi r18, 0xF7 ; 247 33e5c: 2b 83 std Y+3, r18 ; 0x03 33e5e: df 91 pop r29 33e60: cf 91 pop r28 33e62: 08 95 ret 00033e64 : 33e64: 0f 93 push r16 33e66: 1f 93 push r17 33e68: cf 93 push r28 33e6a: df 93 push r29 33e6c: cd b7 in r28, 0x3d ; 61 33e6e: de b7 in r29, 0x3e ; 62 33e70: 2e 97 sbiw r28, 0x0e ; 14 33e72: 0f b6 in r0, 0x3f ; 63 33e74: f8 94 cli 33e76: de bf out 0x3e, r29 ; 62 33e78: 0f be out 0x3f, r0 ; 63 33e7a: cd bf out 0x3d, r28 ; 61 33e7c: 8c 01 movw r16, r24 33e7e: fa 01 movw r30, r20 33e80: 8e e0 ldi r24, 0x0E ; 14 33e82: 8c 83 std Y+4, r24 ; 0x04 33e84: 1a 83 std Y+2, r17 ; 0x02 33e86: 09 83 std Y+1, r16 ; 0x01 33e88: 77 ff sbrs r23, 7 33e8a: 02 c0 rjmp .+4 ; 0x33e90 33e8c: 60 e0 ldi r22, 0x00 ; 0 33e8e: 70 e8 ldi r23, 0x80 ; 128 33e90: 61 50 subi r22, 0x01 ; 1 33e92: 71 09 sbc r23, r1 33e94: 7e 83 std Y+6, r23 ; 0x06 33e96: 6d 83 std Y+5, r22 ; 0x05 33e98: a9 01 movw r20, r18 33e9a: bf 01 movw r22, r30 33e9c: ce 01 movw r24, r28 33e9e: 01 96 adiw r24, 0x01 ; 1 33ea0: 0e 94 eb 50 call 0xa1d6 ; 0xa1d6 33ea4: 4d 81 ldd r20, Y+5 ; 0x05 33ea6: 5e 81 ldd r21, Y+6 ; 0x06 33ea8: 57 fd sbrc r21, 7 33eaa: 0a c0 rjmp .+20 ; 0x33ec0 33eac: 2f 81 ldd r18, Y+7 ; 0x07 33eae: 38 85 ldd r19, Y+8 ; 0x08 33eb0: 42 17 cp r20, r18 33eb2: 53 07 cpc r21, r19 33eb4: 0c f4 brge .+2 ; 0x33eb8 33eb6: 9a 01 movw r18, r20 33eb8: 02 0f add r16, r18 33eba: 13 1f adc r17, r19 33ebc: f8 01 movw r30, r16 33ebe: 10 82 st Z, r1 33ec0: 2e 96 adiw r28, 0x0e ; 14 33ec2: 0f b6 in r0, 0x3f ; 63 33ec4: f8 94 cli 33ec6: de bf out 0x3e, r29 ; 62 33ec8: 0f be out 0x3f, r0 ; 63 33eca: cd bf out 0x3d, r28 ; 61 33ecc: df 91 pop r29 33ece: cf 91 pop r28 33ed0: 1f 91 pop r17 33ed2: 0f 91 pop r16 33ed4: 08 95 ret 00033ed6 <__ultoa_invert>: 33ed6: fa 01 movw r30, r20 33ed8: aa 27 eor r26, r26 33eda: 28 30 cpi r18, 0x08 ; 8 33edc: 51 f1 breq .+84 ; 0x33f32 <__ultoa_invert+0x5c> 33ede: 20 31 cpi r18, 0x10 ; 16 33ee0: 81 f1 breq .+96 ; 0x33f42 <__ultoa_invert+0x6c> 33ee2: e8 94 clt 33ee4: 6f 93 push r22 33ee6: 6e 7f andi r22, 0xFE ; 254 33ee8: 6e 5f subi r22, 0xFE ; 254 33eea: 7f 4f sbci r23, 0xFF ; 255 33eec: 8f 4f sbci r24, 0xFF ; 255 33eee: 9f 4f sbci r25, 0xFF ; 255 33ef0: af 4f sbci r26, 0xFF ; 255 33ef2: b1 e0 ldi r27, 0x01 ; 1 33ef4: 3e d0 rcall .+124 ; 0x33f72 <__ultoa_invert+0x9c> 33ef6: b4 e0 ldi r27, 0x04 ; 4 33ef8: 3c d0 rcall .+120 ; 0x33f72 <__ultoa_invert+0x9c> 33efa: 67 0f add r22, r23 33efc: 78 1f adc r23, r24 33efe: 89 1f adc r24, r25 33f00: 9a 1f adc r25, r26 33f02: a1 1d adc r26, r1 33f04: 68 0f add r22, r24 33f06: 79 1f adc r23, r25 33f08: 8a 1f adc r24, r26 33f0a: 91 1d adc r25, r1 33f0c: a1 1d adc r26, r1 33f0e: 6a 0f add r22, r26 33f10: 71 1d adc r23, r1 33f12: 81 1d adc r24, r1 33f14: 91 1d adc r25, r1 33f16: a1 1d adc r26, r1 33f18: 20 d0 rcall .+64 ; 0x33f5a <__ultoa_invert+0x84> 33f1a: 09 f4 brne .+2 ; 0x33f1e <__ultoa_invert+0x48> 33f1c: 68 94 set 33f1e: 3f 91 pop r19 33f20: 2a e0 ldi r18, 0x0A ; 10 33f22: 26 9f mul r18, r22 33f24: 11 24 eor r1, r1 33f26: 30 19 sub r19, r0 33f28: 30 5d subi r19, 0xD0 ; 208 33f2a: 31 93 st Z+, r19 33f2c: de f6 brtc .-74 ; 0x33ee4 <__ultoa_invert+0xe> 33f2e: cf 01 movw r24, r30 33f30: 08 95 ret 33f32: 46 2f mov r20, r22 33f34: 47 70 andi r20, 0x07 ; 7 33f36: 40 5d subi r20, 0xD0 ; 208 33f38: 41 93 st Z+, r20 33f3a: b3 e0 ldi r27, 0x03 ; 3 33f3c: 0f d0 rcall .+30 ; 0x33f5c <__ultoa_invert+0x86> 33f3e: c9 f7 brne .-14 ; 0x33f32 <__ultoa_invert+0x5c> 33f40: f6 cf rjmp .-20 ; 0x33f2e <__ultoa_invert+0x58> 33f42: 46 2f mov r20, r22 33f44: 4f 70 andi r20, 0x0F ; 15 33f46: 40 5d subi r20, 0xD0 ; 208 33f48: 4a 33 cpi r20, 0x3A ; 58 33f4a: 18 f0 brcs .+6 ; 0x33f52 <__ultoa_invert+0x7c> 33f4c: 49 5d subi r20, 0xD9 ; 217 33f4e: 31 fd sbrc r19, 1 33f50: 40 52 subi r20, 0x20 ; 32 33f52: 41 93 st Z+, r20 33f54: 02 d0 rcall .+4 ; 0x33f5a <__ultoa_invert+0x84> 33f56: a9 f7 brne .-22 ; 0x33f42 <__ultoa_invert+0x6c> 33f58: ea cf rjmp .-44 ; 0x33f2e <__ultoa_invert+0x58> 33f5a: b4 e0 ldi r27, 0x04 ; 4 33f5c: a6 95 lsr r26 33f5e: 97 95 ror r25 33f60: 87 95 ror r24 33f62: 77 95 ror r23 33f64: 67 95 ror r22 33f66: ba 95 dec r27 33f68: c9 f7 brne .-14 ; 0x33f5c <__ultoa_invert+0x86> 33f6a: 00 97 sbiw r24, 0x00 ; 0 33f6c: 61 05 cpc r22, r1 33f6e: 71 05 cpc r23, r1 33f70: 08 95 ret 33f72: 9b 01 movw r18, r22 33f74: ac 01 movw r20, r24 33f76: 0a 2e mov r0, r26 33f78: 06 94 lsr r0 33f7a: 57 95 ror r21 33f7c: 47 95 ror r20 33f7e: 37 95 ror r19 33f80: 27 95 ror r18 33f82: ba 95 dec r27 33f84: c9 f7 brne .-14 ; 0x33f78 <__ultoa_invert+0xa2> 33f86: 62 0f add r22, r18 33f88: 73 1f adc r23, r19 33f8a: 84 1f adc r24, r20 33f8c: 95 1f adc r25, r21 33f8e: a0 1d adc r26, r0 33f90: 08 95 ret 00033f92 <__ctype_isfalse>: 33f92: 99 27 eor r25, r25 33f94: 88 27 eor r24, r24 00033f96 <__ctype_istrue>: 33f96: 08 95 ret 00033f98 : 33f98: dc 01 movw r26, r24 33f9a: cb 01 movw r24, r22 00033f9c : 33f9c: fc 01 movw r30, r24 33f9e: f9 99 sbic 0x1f, 1 ; 31 33fa0: fe cf rjmp .-4 ; 0x33f9e 33fa2: 06 c0 rjmp .+12 ; 0x33fb0 33fa4: f2 bd out 0x22, r31 ; 34 33fa6: e1 bd out 0x21, r30 ; 33 33fa8: f8 9a sbi 0x1f, 0 ; 31 33faa: 31 96 adiw r30, 0x01 ; 1 33fac: 00 b4 in r0, 0x20 ; 32 33fae: 0d 92 st X+, r0 33fb0: 41 50 subi r20, 0x01 ; 1 33fb2: 50 40 sbci r21, 0x00 ; 0 33fb4: b8 f7 brcc .-18 ; 0x33fa4 33fb6: 08 95 ret 00033fb8 : 33fb8: f9 99 sbic 0x1f, 1 ; 31 33fba: fe cf rjmp .-4 ; 0x33fb8 33fbc: 92 bd out 0x22, r25 ; 34 33fbe: 81 bd out 0x21, r24 ; 33 33fc0: f8 9a sbi 0x1f, 0 ; 31 33fc2: 99 27 eor r25, r25 33fc4: 80 b5 in r24, 0x20 ; 32 33fc6: 08 95 ret 00033fc8 : 33fc8: a6 e1 ldi r26, 0x16 ; 22 33fca: b0 e0 ldi r27, 0x00 ; 0 33fcc: 44 e0 ldi r20, 0x04 ; 4 33fce: 50 e0 ldi r21, 0x00 ; 0 33fd0: 0d 94 ce 9f jmp 0x33f9c ; 0x33f9c 00033fd4 : 33fd4: a8 e1 ldi r26, 0x18 ; 24 33fd6: b0 e0 ldi r27, 0x00 ; 0 33fd8: 42 e0 ldi r20, 0x02 ; 2 33fda: 50 e0 ldi r21, 0x00 ; 0 33fdc: 0d 94 ce 9f jmp 0x33f9c ; 0x33f9c 00033fe0 : 33fe0: dc 01 movw r26, r24 33fe2: a4 0f add r26, r20 33fe4: b5 1f adc r27, r21 33fe6: 41 50 subi r20, 0x01 ; 1 33fe8: 50 40 sbci r21, 0x00 ; 0 33fea: 48 f0 brcs .+18 ; 0x33ffe 33fec: cb 01 movw r24, r22 33fee: 84 0f add r24, r20 33ff0: 95 1f adc r25, r21 33ff2: 2e 91 ld r18, -X 33ff4: 0f 94 01 a0 call 0x34002 ; 0x34002 33ff8: 41 50 subi r20, 0x01 ; 1 33ffa: 50 40 sbci r21, 0x00 ; 0 33ffc: d0 f7 brcc .-12 ; 0x33ff2 33ffe: 08 95 ret 00034000 : 34000: 26 2f mov r18, r22 00034002 : 34002: f9 99 sbic 0x1f, 1 ; 31 34004: fe cf rjmp .-4 ; 0x34002 34006: 92 bd out 0x22, r25 ; 34 34008: 81 bd out 0x21, r24 ; 33 3400a: f8 9a sbi 0x1f, 0 ; 31 3400c: 01 97 sbiw r24, 0x01 ; 1 3400e: 00 b4 in r0, 0x20 ; 32 34010: 02 16 cp r0, r18 34012: 39 f0 breq .+14 ; 0x34022 34014: 1f ba out 0x1f, r1 ; 31 34016: 20 bd out 0x20, r18 ; 32 34018: 0f b6 in r0, 0x3f ; 63 3401a: f8 94 cli 3401c: fa 9a sbi 0x1f, 2 ; 31 3401e: f9 9a sbi 0x1f, 1 ; 31 34020: 0f be out 0x3f, r0 ; 63 34022: 08 95 ret 00034024 : 34024: 03 96 adiw r24, 0x03 ; 3 34026: 27 2f mov r18, r23 34028: 0f 94 01 a0 call 0x34002 ; 0x34002 3402c: 0f 94 00 a0 call 0x34000 ; 0x34000 34030: 25 2f mov r18, r21 34032: 0f 94 01 a0 call 0x34002 ; 0x34002 34036: 24 2f mov r18, r20 34038: 0d 94 01 a0 jmp 0x34002 ; 0x34002 0003403c : 3403c: 01 96 adiw r24, 0x01 ; 1 3403e: 27 2f mov r18, r23 34040: 0f 94 01 a0 call 0x34002 ; 0x34002 34044: 0d 94 00 a0 jmp 0x34000 ; 0x34000 00034048 : 34048: 26 2f mov r18, r22 0003404a : 3404a: f9 99 sbic 0x1f, 1 ; 31 3404c: fe cf rjmp .-4 ; 0x3404a 3404e: 1f ba out 0x1f, r1 ; 31 34050: 92 bd out 0x22, r25 ; 34 34052: 81 bd out 0x21, r24 ; 33 34054: 20 bd out 0x20, r18 ; 32 34056: 0f b6 in r0, 0x3f ; 63 34058: f8 94 cli 3405a: fa 9a sbi 0x1f, 2 ; 31 3405c: f9 9a sbi 0x1f, 1 ; 31 3405e: 0f be out 0x3f, r0 ; 63 34060: 01 96 adiw r24, 0x01 ; 1 34062: 08 95 ret 00034064 : 34064: 24 2f mov r18, r20 34066: 0f 94 25 a0 call 0x3404a ; 0x3404a 3406a: 25 2f mov r18, r21 3406c: 0f 94 25 a0 call 0x3404a ; 0x3404a 34070: 0d 94 3a a0 jmp 0x34074 ; 0x34074 00034074 : 34074: 0f 94 24 a0 call 0x34048 ; 0x34048 34078: 27 2f mov r18, r23 3407a: 0d 94 25 a0 jmp 0x3404a ; 0x3404a 0003407e <__mulsi3>: 3407e: db 01 movw r26, r22 34080: 8f 93 push r24 34082: 9f 93 push r25 34084: 0f 94 71 a0 call 0x340e2 ; 0x340e2 <__muluhisi3> 34088: bf 91 pop r27 3408a: af 91 pop r26 3408c: a2 9f mul r26, r18 3408e: 80 0d add r24, r0 34090: 91 1d adc r25, r1 34092: a3 9f mul r26, r19 34094: 90 0d add r25, r0 34096: b2 9f mul r27, r18 34098: 90 0d add r25, r0 3409a: 11 24 eor r1, r1 3409c: 08 95 ret 0003409e <__udivmodsi4>: 3409e: a1 e2 ldi r26, 0x21 ; 33 340a0: 1a 2e mov r1, r26 340a2: aa 1b sub r26, r26 340a4: bb 1b sub r27, r27 340a6: fd 01 movw r30, r26 340a8: 0d c0 rjmp .+26 ; 0x340c4 <__udivmodsi4_ep> 000340aa <__udivmodsi4_loop>: 340aa: aa 1f adc r26, r26 340ac: bb 1f adc r27, r27 340ae: ee 1f adc r30, r30 340b0: ff 1f adc r31, r31 340b2: a2 17 cp r26, r18 340b4: b3 07 cpc r27, r19 340b6: e4 07 cpc r30, r20 340b8: f5 07 cpc r31, r21 340ba: 20 f0 brcs .+8 ; 0x340c4 <__udivmodsi4_ep> 340bc: a2 1b sub r26, r18 340be: b3 0b sbc r27, r19 340c0: e4 0b sbc r30, r20 340c2: f5 0b sbc r31, r21 000340c4 <__udivmodsi4_ep>: 340c4: 66 1f adc r22, r22 340c6: 77 1f adc r23, r23 340c8: 88 1f adc r24, r24 340ca: 99 1f adc r25, r25 340cc: 1a 94 dec r1 340ce: 69 f7 brne .-38 ; 0x340aa <__udivmodsi4_loop> 340d0: 60 95 com r22 340d2: 70 95 com r23 340d4: 80 95 com r24 340d6: 90 95 com r25 340d8: 9b 01 movw r18, r22 340da: ac 01 movw r20, r24 340dc: bd 01 movw r22, r26 340de: cf 01 movw r24, r30 340e0: 08 95 ret 000340e2 <__muluhisi3>: 340e2: 0f 94 7c a0 call 0x340f8 ; 0x340f8 <__umulhisi3> 340e6: a5 9f mul r26, r21 340e8: 90 0d add r25, r0 340ea: b4 9f mul r27, r20 340ec: 90 0d add r25, r0 340ee: a4 9f mul r26, r20 340f0: 80 0d add r24, r0 340f2: 91 1d adc r25, r1 340f4: 11 24 eor r1, r1 340f6: 08 95 ret 000340f8 <__umulhisi3>: 340f8: a2 9f mul r26, r18 340fa: b0 01 movw r22, r0 340fc: b3 9f mul r27, r19 340fe: c0 01 movw r24, r0 34100: a3 9f mul r26, r19 34102: 70 0d add r23, r0 34104: 81 1d adc r24, r1 34106: 11 24 eor r1, r1 34108: 91 1d adc r25, r1 3410a: b2 9f mul r27, r18 3410c: 70 0d add r23, r0 3410e: 81 1d adc r24, r1 34110: 11 24 eor r1, r1 34112: 91 1d adc r25, r1 34114: 08 95 ret 00034116 <__udivmodqi4>: 34116: 99 1b sub r25, r25 34118: 79 e0 ldi r23, 0x09 ; 9 3411a: 04 c0 rjmp .+8 ; 0x34124 <__udivmodqi4_ep> 0003411c <__udivmodqi4_loop>: 3411c: 99 1f adc r25, r25 3411e: 96 17 cp r25, r22 34120: 08 f0 brcs .+2 ; 0x34124 <__udivmodqi4_ep> 34122: 96 1b sub r25, r22 00034124 <__udivmodqi4_ep>: 34124: 88 1f adc r24, r24 34126: 7a 95 dec r23 34128: c9 f7 brne .-14 ; 0x3411c <__udivmodqi4_loop> 3412a: 80 95 com r24 3412c: 08 95 ret 0003412e <__divmodqi4>: 3412e: 87 fb bst r24, 7 34130: 08 2e mov r0, r24 34132: 06 26 eor r0, r22 34134: 87 fd sbrc r24, 7 34136: 81 95 neg r24 34138: 67 fd sbrc r22, 7 3413a: 61 95 neg r22 3413c: 0f 94 8b a0 call 0x34116 ; 0x34116 <__udivmodqi4> 34140: 0e f4 brtc .+2 ; 0x34144 <__divmodqi4_1> 34142: 91 95 neg r25 00034144 <__divmodqi4_1>: 34144: 07 fc sbrc r0, 7 34146: 81 95 neg r24 00034148 <__divmodqi4_exit>: 34148: 08 95 ret 0003414a <__udivmodhi4>: 3414a: aa 1b sub r26, r26 3414c: bb 1b sub r27, r27 3414e: 51 e1 ldi r21, 0x11 ; 17 34150: 07 c0 rjmp .+14 ; 0x34160 <__udivmodhi4_ep> 00034152 <__udivmodhi4_loop>: 34152: aa 1f adc r26, r26 34154: bb 1f adc r27, r27 34156: a6 17 cp r26, r22 34158: b7 07 cpc r27, r23 3415a: 10 f0 brcs .+4 ; 0x34160 <__udivmodhi4_ep> 3415c: a6 1b sub r26, r22 3415e: b7 0b sbc r27, r23 00034160 <__udivmodhi4_ep>: 34160: 88 1f adc r24, r24 34162: 99 1f adc r25, r25 34164: 5a 95 dec r21 34166: a9 f7 brne .-22 ; 0x34152 <__udivmodhi4_loop> 34168: 80 95 com r24 3416a: 90 95 com r25 3416c: bc 01 movw r22, r24 3416e: cd 01 movw r24, r26 34170: 08 95 ret 00034172 <__divmodhi4>: 34172: 97 fb bst r25, 7 34174: 07 2e mov r0, r23 34176: 16 f4 brtc .+4 ; 0x3417c <__divmodhi4+0xa> 34178: 00 94 com r0 3417a: 07 d0 rcall .+14 ; 0x3418a <__divmodhi4_neg1> 3417c: 77 fd sbrc r23, 7 3417e: 09 d0 rcall .+18 ; 0x34192 <__divmodhi4_neg2> 34180: 0f 94 a5 a0 call 0x3414a ; 0x3414a <__udivmodhi4> 34184: 07 fc sbrc r0, 7 34186: 05 d0 rcall .+10 ; 0x34192 <__divmodhi4_neg2> 34188: 3e f4 brtc .+14 ; 0x34198 <__divmodhi4_exit> 0003418a <__divmodhi4_neg1>: 3418a: 90 95 com r25 3418c: 81 95 neg r24 3418e: 9f 4f sbci r25, 0xFF ; 255 34190: 08 95 ret 00034192 <__divmodhi4_neg2>: 34192: 70 95 com r23 34194: 61 95 neg r22 34196: 7f 4f sbci r23, 0xFF ; 255 00034198 <__divmodhi4_exit>: 34198: 08 95 ret 0003419a <__divmodsi4>: 3419a: 05 2e mov r0, r21 3419c: 97 fb bst r25, 7 3419e: 1e f4 brtc .+6 ; 0x341a6 <__divmodsi4+0xc> 341a0: 00 94 com r0 341a2: 0f 94 e4 a0 call 0x341c8 ; 0x341c8 <__negsi2> 341a6: 57 fd sbrc r21, 7 341a8: 07 d0 rcall .+14 ; 0x341b8 <__divmodsi4_neg2> 341aa: 0f 94 4f a0 call 0x3409e ; 0x3409e <__udivmodsi4> 341ae: 07 fc sbrc r0, 7 341b0: 03 d0 rcall .+6 ; 0x341b8 <__divmodsi4_neg2> 341b2: 4e f4 brtc .+18 ; 0x341c6 <__divmodsi4_exit> 341b4: 0d 94 e4 a0 jmp 0x341c8 ; 0x341c8 <__negsi2> 000341b8 <__divmodsi4_neg2>: 341b8: 50 95 com r21 341ba: 40 95 com r20 341bc: 30 95 com r19 341be: 21 95 neg r18 341c0: 3f 4f sbci r19, 0xFF ; 255 341c2: 4f 4f sbci r20, 0xFF ; 255 341c4: 5f 4f sbci r21, 0xFF ; 255 000341c6 <__divmodsi4_exit>: 341c6: 08 95 ret 000341c8 <__negsi2>: 341c8: 90 95 com r25 341ca: 80 95 com r24 341cc: 70 95 com r23 341ce: 61 95 neg r22 341d0: 7f 4f sbci r23, 0xFF ; 255 341d2: 8f 4f sbci r24, 0xFF ; 255 341d4: 9f 4f sbci r25, 0xFF ; 255 341d6: 08 95 ret 000341d8 <__tablejump2__>: 341d8: ee 0f add r30, r30 341da: ff 1f adc r31, r31 341dc: 88 1f adc r24, r24 341de: 8b bf out 0x3b, r24 ; 59 341e0: 07 90 elpm r0, Z+ 341e2: f6 91 elpm r31, Z 341e4: e0 2d mov r30, r0 341e6: 19 94 eijmp 000341e8 <__mulhisi3>: 341e8: 0f 94 7c a0 call 0x340f8 ; 0x340f8 <__umulhisi3> 341ec: 33 23 and r19, r19 341ee: 12 f4 brpl .+4 ; 0x341f4 <__mulhisi3+0xc> 341f0: 8a 1b sub r24, r26 341f2: 9b 0b sbc r25, r27 341f4: 0d 94 fe a0 jmp 0x341fc ; 0x341fc <__usmulhisi3_tail> 000341f8 <__usmulhisi3>: 341f8: 0f 94 7c a0 call 0x340f8 ; 0x340f8 <__umulhisi3> 000341fc <__usmulhisi3_tail>: 341fc: b7 ff sbrs r27, 7 341fe: 08 95 ret 34200: 82 1b sub r24, r18 34202: 93 0b sbc r25, r19 34204: 08 95 ret 00034206 <__subsf3>: 34206: 50 58 subi r21, 0x80 ; 128 00034208 <__addsf3>: 34208: bb 27 eor r27, r27 3420a: aa 27 eor r26, r26 3420c: 0f 94 1b a1 call 0x34236 ; 0x34236 <__addsf3x> 34210: 0d 94 2d 9b jmp 0x3365a ; 0x3365a <__fp_round> 34214: 0f 94 1f 9b call 0x3363e ; 0x3363e <__fp_pscA> 34218: 38 f0 brcs .+14 ; 0x34228 <__addsf3+0x20> 3421a: 0f 94 26 9b call 0x3364c ; 0x3364c <__fp_pscB> 3421e: 20 f0 brcs .+8 ; 0x34228 <__addsf3+0x20> 34220: 39 f4 brne .+14 ; 0x34230 <__addsf3+0x28> 34222: 9f 3f cpi r25, 0xFF ; 255 34224: 19 f4 brne .+6 ; 0x3422c <__addsf3+0x24> 34226: 26 f4 brtc .+8 ; 0x34230 <__addsf3+0x28> 34228: 0d 94 1c 9b jmp 0x33638 ; 0x33638 <__fp_nan> 3422c: 0e f4 brtc .+2 ; 0x34230 <__addsf3+0x28> 3422e: e0 95 com r30 34230: e7 fb bst r30, 7 34232: 0d 94 16 9b jmp 0x3362c ; 0x3362c <__fp_inf> 00034236 <__addsf3x>: 34236: e9 2f mov r30, r25 34238: 0f 94 3e 9b call 0x3367c ; 0x3367c <__fp_split3> 3423c: 58 f3 brcs .-42 ; 0x34214 <__addsf3+0xc> 3423e: ba 17 cp r27, r26 34240: 62 07 cpc r22, r18 34242: 73 07 cpc r23, r19 34244: 84 07 cpc r24, r20 34246: 95 07 cpc r25, r21 34248: 20 f0 brcs .+8 ; 0x34252 <__addsf3x+0x1c> 3424a: 79 f4 brne .+30 ; 0x3426a <__addsf3x+0x34> 3424c: a6 f5 brtc .+104 ; 0x342b6 <__addsf3x+0x80> 3424e: 0d 94 60 9b jmp 0x336c0 ; 0x336c0 <__fp_zero> 34252: 0e f4 brtc .+2 ; 0x34256 <__addsf3x+0x20> 34254: e0 95 com r30 34256: 0b 2e mov r0, r27 34258: ba 2f mov r27, r26 3425a: a0 2d mov r26, r0 3425c: 0b 01 movw r0, r22 3425e: b9 01 movw r22, r18 34260: 90 01 movw r18, r0 34262: 0c 01 movw r0, r24 34264: ca 01 movw r24, r20 34266: a0 01 movw r20, r0 34268: 11 24 eor r1, r1 3426a: ff 27 eor r31, r31 3426c: 59 1b sub r21, r25 3426e: 99 f0 breq .+38 ; 0x34296 <__addsf3x+0x60> 34270: 59 3f cpi r21, 0xF9 ; 249 34272: 50 f4 brcc .+20 ; 0x34288 <__addsf3x+0x52> 34274: 50 3e cpi r21, 0xE0 ; 224 34276: 68 f1 brcs .+90 ; 0x342d2 <__addsf3x+0x9c> 34278: 1a 16 cp r1, r26 3427a: f0 40 sbci r31, 0x00 ; 0 3427c: a2 2f mov r26, r18 3427e: 23 2f mov r18, r19 34280: 34 2f mov r19, r20 34282: 44 27 eor r20, r20 34284: 58 5f subi r21, 0xF8 ; 248 34286: f3 cf rjmp .-26 ; 0x3426e <__addsf3x+0x38> 34288: 46 95 lsr r20 3428a: 37 95 ror r19 3428c: 27 95 ror r18 3428e: a7 95 ror r26 34290: f0 40 sbci r31, 0x00 ; 0 34292: 53 95 inc r21 34294: c9 f7 brne .-14 ; 0x34288 <__addsf3x+0x52> 34296: 7e f4 brtc .+30 ; 0x342b6 <__addsf3x+0x80> 34298: 1f 16 cp r1, r31 3429a: ba 0b sbc r27, r26 3429c: 62 0b sbc r22, r18 3429e: 73 0b sbc r23, r19 342a0: 84 0b sbc r24, r20 342a2: ba f0 brmi .+46 ; 0x342d2 <__addsf3x+0x9c> 342a4: 91 50 subi r25, 0x01 ; 1 342a6: a1 f0 breq .+40 ; 0x342d0 <__addsf3x+0x9a> 342a8: ff 0f add r31, r31 342aa: bb 1f adc r27, r27 342ac: 66 1f adc r22, r22 342ae: 77 1f adc r23, r23 342b0: 88 1f adc r24, r24 342b2: c2 f7 brpl .-16 ; 0x342a4 <__addsf3x+0x6e> 342b4: 0e c0 rjmp .+28 ; 0x342d2 <__addsf3x+0x9c> 342b6: ba 0f add r27, r26 342b8: 62 1f adc r22, r18 342ba: 73 1f adc r23, r19 342bc: 84 1f adc r24, r20 342be: 48 f4 brcc .+18 ; 0x342d2 <__addsf3x+0x9c> 342c0: 87 95 ror r24 342c2: 77 95 ror r23 342c4: 67 95 ror r22 342c6: b7 95 ror r27 342c8: f7 95 ror r31 342ca: 9e 3f cpi r25, 0xFE ; 254 342cc: 08 f0 brcs .+2 ; 0x342d0 <__addsf3x+0x9a> 342ce: b0 cf rjmp .-160 ; 0x34230 <__addsf3+0x28> 342d0: 93 95 inc r25 342d2: 88 0f add r24, r24 342d4: 08 f0 brcs .+2 ; 0x342d8 <__addsf3x+0xa2> 342d6: 99 27 eor r25, r25 342d8: ee 0f add r30, r30 342da: 97 95 ror r25 342dc: 87 95 ror r24 342de: 08 95 ret 342e0: 0f 94 1f 9b call 0x3363e ; 0x3363e <__fp_pscA> 342e4: 60 f0 brcs .+24 ; 0x342fe <__addsf3x+0xc8> 342e6: 80 e8 ldi r24, 0x80 ; 128 342e8: 91 e0 ldi r25, 0x01 ; 1 342ea: 09 f4 brne .+2 ; 0x342ee <__addsf3x+0xb8> 342ec: 9e ef ldi r25, 0xFE ; 254 342ee: 0f 94 26 9b call 0x3364c ; 0x3364c <__fp_pscB> 342f2: 28 f0 brcs .+10 ; 0x342fe <__addsf3x+0xc8> 342f4: 40 e8 ldi r20, 0x80 ; 128 342f6: 51 e0 ldi r21, 0x01 ; 1 342f8: 71 f4 brne .+28 ; 0x34316 342fa: 5e ef ldi r21, 0xFE ; 254 342fc: 0c c0 rjmp .+24 ; 0x34316 342fe: 0d 94 1c 9b jmp 0x33638 ; 0x33638 <__fp_nan> 34302: 0d 94 60 9b jmp 0x336c0 ; 0x336c0 <__fp_zero> 00034306 : 34306: e9 2f mov r30, r25 34308: e0 78 andi r30, 0x80 ; 128 3430a: 0f 94 3e 9b call 0x3367c ; 0x3367c <__fp_split3> 3430e: 40 f3 brcs .-48 ; 0x342e0 <__addsf3x+0xaa> 34310: 09 2e mov r0, r25 34312: 05 2a or r0, r21 34314: b1 f3 breq .-20 ; 0x34302 <__addsf3x+0xcc> 34316: 26 17 cp r18, r22 34318: 37 07 cpc r19, r23 3431a: 48 07 cpc r20, r24 3431c: 59 07 cpc r21, r25 3431e: 38 f0 brcs .+14 ; 0x3432e 34320: 0e 2e mov r0, r30 34322: 07 f8 bld r0, 7 34324: e0 25 eor r30, r0 34326: 69 f0 breq .+26 ; 0x34342 34328: e0 25 eor r30, r0 3432a: e0 64 ori r30, 0x40 ; 64 3432c: 0a c0 rjmp .+20 ; 0x34342 3432e: ef 63 ori r30, 0x3F ; 63 34330: 07 f8 bld r0, 7 34332: 00 94 com r0 34334: 07 fa bst r0, 7 34336: db 01 movw r26, r22 34338: b9 01 movw r22, r18 3433a: 9d 01 movw r18, r26 3433c: dc 01 movw r26, r24 3433e: ca 01 movw r24, r20 34340: ad 01 movw r20, r26 34342: ef 93 push r30 34344: 0f 94 1a a2 call 0x34434 ; 0x34434 <__divsf3_pse> 34348: 0f 94 2d 9b call 0x3365a ; 0x3365a <__fp_round> 3434c: 0f 94 b3 a1 call 0x34366 ; 0x34366 34350: 5f 91 pop r21 34352: 55 23 and r21, r21 34354: 39 f0 breq .+14 ; 0x34364 34356: 2b ed ldi r18, 0xDB ; 219 34358: 3f e0 ldi r19, 0x0F ; 15 3435a: 49 e4 ldi r20, 0x49 ; 73 3435c: 50 fd sbrc r21, 0 3435e: 49 ec ldi r20, 0xC9 ; 201 34360: 0d 94 04 a1 jmp 0x34208 ; 0x34208 <__addsf3> 34364: 08 95 ret 00034366 : 34366: df 93 push r29 34368: dd 27 eor r29, r29 3436a: b9 2f mov r27, r25 3436c: bf 77 andi r27, 0x7F ; 127 3436e: 40 e8 ldi r20, 0x80 ; 128 34370: 5f e3 ldi r21, 0x3F ; 63 34372: 16 16 cp r1, r22 34374: 17 06 cpc r1, r23 34376: 48 07 cpc r20, r24 34378: 5b 07 cpc r21, r27 3437a: 18 f4 brcc .+6 ; 0x34382 3437c: d9 2f mov r29, r25 3437e: 0f 94 ff a3 call 0x347fe ; 0x347fe 34382: 9f 93 push r25 34384: 8f 93 push r24 34386: 7f 93 push r23 34388: 6f 93 push r22 3438a: 0f 94 a5 9a call 0x3354a ; 0x3354a 3438e: e4 e8 ldi r30, 0x84 ; 132 34390: fc e6 ldi r31, 0x6C ; 108 34392: 0f 94 0f a3 call 0x3461e ; 0x3461e <__fp_powser> 34396: 0f 94 2d 9b call 0x3365a ; 0x3365a <__fp_round> 3439a: 2f 91 pop r18 3439c: 3f 91 pop r19 3439e: 4f 91 pop r20 343a0: 5f 91 pop r21 343a2: 0f 94 bc 9a call 0x33578 ; 0x33578 <__mulsf3x> 343a6: dd 23 and r29, r29 343a8: 51 f0 breq .+20 ; 0x343be 343aa: 90 58 subi r25, 0x80 ; 128 343ac: a2 ea ldi r26, 0xA2 ; 162 343ae: 2a ed ldi r18, 0xDA ; 218 343b0: 3f e0 ldi r19, 0x0F ; 15 343b2: 49 ec ldi r20, 0xC9 ; 201 343b4: 5f e3 ldi r21, 0x3F ; 63 343b6: d0 78 andi r29, 0x80 ; 128 343b8: 5d 27 eor r21, r29 343ba: 0f 94 1b a1 call 0x34236 ; 0x34236 <__addsf3x> 343be: df 91 pop r29 343c0: 0d 94 2d 9b jmp 0x3365a ; 0x3365a <__fp_round> 000343c4 : 343c4: 0f 94 75 a3 call 0x346ea ; 0x346ea <__fp_trunc> 343c8: 90 f0 brcs .+36 ; 0x343ee 343ca: 9f 37 cpi r25, 0x7F ; 127 343cc: 48 f4 brcc .+18 ; 0x343e0 343ce: 91 11 cpse r25, r1 343d0: 16 f4 brtc .+4 ; 0x343d6 343d2: 0d 94 61 9b jmp 0x336c2 ; 0x336c2 <__fp_szero> 343d6: 60 e0 ldi r22, 0x00 ; 0 343d8: 70 e0 ldi r23, 0x00 ; 0 343da: 80 e8 ldi r24, 0x80 ; 128 343dc: 9f e3 ldi r25, 0x3F ; 63 343de: 08 95 ret 343e0: 26 f0 brts .+8 ; 0x343ea 343e2: 1b 16 cp r1, r27 343e4: 61 1d adc r22, r1 343e6: 71 1d adc r23, r1 343e8: 81 1d adc r24, r1 343ea: 0d 94 e6 a2 jmp 0x345cc ; 0x345cc <__fp_mintl> 343ee: 0d 94 01 a3 jmp 0x34602 ; 0x34602 <__fp_mpack> 000343f2 <__cmpsf2>: 343f2: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__fp_cmp> 343f6: 08 f4 brcc .+2 ; 0x343fa <__cmpsf2+0x8> 343f8: 81 e0 ldi r24, 0x01 ; 1 343fa: 08 95 ret 000343fc : 343fc: 0f 94 38 a3 call 0x34670 ; 0x34670 <__fp_rempio2> 34400: e3 95 inc r30 34402: 0d 94 61 a3 jmp 0x346c2 ; 0x346c2 <__fp_sinus> 00034406 <__divsf3>: 34406: 0f 94 17 a2 call 0x3442e ; 0x3442e <__divsf3x> 3440a: 0d 94 2d 9b jmp 0x3365a ; 0x3365a <__fp_round> 3440e: 0f 94 26 9b call 0x3364c ; 0x3364c <__fp_pscB> 34412: 58 f0 brcs .+22 ; 0x3442a <__divsf3+0x24> 34414: 0f 94 1f 9b call 0x3363e ; 0x3363e <__fp_pscA> 34418: 40 f0 brcs .+16 ; 0x3442a <__divsf3+0x24> 3441a: 29 f4 brne .+10 ; 0x34426 <__divsf3+0x20> 3441c: 5f 3f cpi r21, 0xFF ; 255 3441e: 29 f0 breq .+10 ; 0x3442a <__divsf3+0x24> 34420: 0d 94 16 9b jmp 0x3362c ; 0x3362c <__fp_inf> 34424: 51 11 cpse r21, r1 34426: 0d 94 61 9b jmp 0x336c2 ; 0x336c2 <__fp_szero> 3442a: 0d 94 1c 9b jmp 0x33638 ; 0x33638 <__fp_nan> 0003442e <__divsf3x>: 3442e: 0f 94 3e 9b call 0x3367c ; 0x3367c <__fp_split3> 34432: 68 f3 brcs .-38 ; 0x3440e <__divsf3+0x8> 00034434 <__divsf3_pse>: 34434: 99 23 and r25, r25 34436: b1 f3 breq .-20 ; 0x34424 <__divsf3+0x1e> 34438: 55 23 and r21, r21 3443a: 91 f3 breq .-28 ; 0x34420 <__divsf3+0x1a> 3443c: 95 1b sub r25, r21 3443e: 55 0b sbc r21, r21 34440: bb 27 eor r27, r27 34442: aa 27 eor r26, r26 34444: 62 17 cp r22, r18 34446: 73 07 cpc r23, r19 34448: 84 07 cpc r24, r20 3444a: 38 f0 brcs .+14 ; 0x3445a <__divsf3_pse+0x26> 3444c: 9f 5f subi r25, 0xFF ; 255 3444e: 5f 4f sbci r21, 0xFF ; 255 34450: 22 0f add r18, r18 34452: 33 1f adc r19, r19 34454: 44 1f adc r20, r20 34456: aa 1f adc r26, r26 34458: a9 f3 breq .-22 ; 0x34444 <__divsf3_pse+0x10> 3445a: 35 d0 rcall .+106 ; 0x344c6 <__divsf3_pse+0x92> 3445c: 0e 2e mov r0, r30 3445e: 3a f0 brmi .+14 ; 0x3446e <__divsf3_pse+0x3a> 34460: e0 e8 ldi r30, 0x80 ; 128 34462: 32 d0 rcall .+100 ; 0x344c8 <__divsf3_pse+0x94> 34464: 91 50 subi r25, 0x01 ; 1 34466: 50 40 sbci r21, 0x00 ; 0 34468: e6 95 lsr r30 3446a: 00 1c adc r0, r0 3446c: ca f7 brpl .-14 ; 0x34460 <__divsf3_pse+0x2c> 3446e: 2b d0 rcall .+86 ; 0x344c6 <__divsf3_pse+0x92> 34470: fe 2f mov r31, r30 34472: 29 d0 rcall .+82 ; 0x344c6 <__divsf3_pse+0x92> 34474: 66 0f add r22, r22 34476: 77 1f adc r23, r23 34478: 88 1f adc r24, r24 3447a: bb 1f adc r27, r27 3447c: 26 17 cp r18, r22 3447e: 37 07 cpc r19, r23 34480: 48 07 cpc r20, r24 34482: ab 07 cpc r26, r27 34484: b0 e8 ldi r27, 0x80 ; 128 34486: 09 f0 breq .+2 ; 0x3448a <__divsf3_pse+0x56> 34488: bb 0b sbc r27, r27 3448a: 80 2d mov r24, r0 3448c: bf 01 movw r22, r30 3448e: ff 27 eor r31, r31 34490: 93 58 subi r25, 0x83 ; 131 34492: 5f 4f sbci r21, 0xFF ; 255 34494: 3a f0 brmi .+14 ; 0x344a4 <__divsf3_pse+0x70> 34496: 9e 3f cpi r25, 0xFE ; 254 34498: 51 05 cpc r21, r1 3449a: 78 f0 brcs .+30 ; 0x344ba <__divsf3_pse+0x86> 3449c: 0d 94 16 9b jmp 0x3362c ; 0x3362c <__fp_inf> 344a0: 0d 94 61 9b jmp 0x336c2 ; 0x336c2 <__fp_szero> 344a4: 5f 3f cpi r21, 0xFF ; 255 344a6: e4 f3 brlt .-8 ; 0x344a0 <__divsf3_pse+0x6c> 344a8: 98 3e cpi r25, 0xE8 ; 232 344aa: d4 f3 brlt .-12 ; 0x344a0 <__divsf3_pse+0x6c> 344ac: 86 95 lsr r24 344ae: 77 95 ror r23 344b0: 67 95 ror r22 344b2: b7 95 ror r27 344b4: f7 95 ror r31 344b6: 9f 5f subi r25, 0xFF ; 255 344b8: c9 f7 brne .-14 ; 0x344ac <__divsf3_pse+0x78> 344ba: 88 0f add r24, r24 344bc: 91 1d adc r25, r1 344be: 96 95 lsr r25 344c0: 87 95 ror r24 344c2: 97 f9 bld r25, 7 344c4: 08 95 ret 344c6: e1 e0 ldi r30, 0x01 ; 1 344c8: 66 0f add r22, r22 344ca: 77 1f adc r23, r23 344cc: 88 1f adc r24, r24 344ce: bb 1f adc r27, r27 344d0: 62 17 cp r22, r18 344d2: 73 07 cpc r23, r19 344d4: 84 07 cpc r24, r20 344d6: ba 07 cpc r27, r26 344d8: 20 f0 brcs .+8 ; 0x344e2 <__divsf3_pse+0xae> 344da: 62 1b sub r22, r18 344dc: 73 0b sbc r23, r19 344de: 84 0b sbc r24, r20 344e0: ba 0b sbc r27, r26 344e2: ee 1f adc r30, r30 344e4: 88 f7 brcc .-30 ; 0x344c8 <__divsf3_pse+0x94> 344e6: e0 95 com r30 344e8: 08 95 ret 000344ea <__fixsfsi>: 344ea: 0f 94 7c a2 call 0x344f8 ; 0x344f8 <__fixunssfsi> 344ee: 68 94 set 344f0: b1 11 cpse r27, r1 344f2: 0d 94 61 9b jmp 0x336c2 ; 0x336c2 <__fp_szero> 344f6: 08 95 ret 000344f8 <__fixunssfsi>: 344f8: 0f 94 46 9b call 0x3368c ; 0x3368c <__fp_splitA> 344fc: 88 f0 brcs .+34 ; 0x34520 <__fixunssfsi+0x28> 344fe: 9f 57 subi r25, 0x7F ; 127 34500: 98 f0 brcs .+38 ; 0x34528 <__fixunssfsi+0x30> 34502: b9 2f mov r27, r25 34504: 99 27 eor r25, r25 34506: b7 51 subi r27, 0x17 ; 23 34508: b0 f0 brcs .+44 ; 0x34536 <__fixunssfsi+0x3e> 3450a: e1 f0 breq .+56 ; 0x34544 <__fixunssfsi+0x4c> 3450c: 66 0f add r22, r22 3450e: 77 1f adc r23, r23 34510: 88 1f adc r24, r24 34512: 99 1f adc r25, r25 34514: 1a f0 brmi .+6 ; 0x3451c <__fixunssfsi+0x24> 34516: ba 95 dec r27 34518: c9 f7 brne .-14 ; 0x3450c <__fixunssfsi+0x14> 3451a: 14 c0 rjmp .+40 ; 0x34544 <__fixunssfsi+0x4c> 3451c: b1 30 cpi r27, 0x01 ; 1 3451e: 91 f0 breq .+36 ; 0x34544 <__fixunssfsi+0x4c> 34520: 0f 94 60 9b call 0x336c0 ; 0x336c0 <__fp_zero> 34524: b1 e0 ldi r27, 0x01 ; 1 34526: 08 95 ret 34528: 0d 94 60 9b jmp 0x336c0 ; 0x336c0 <__fp_zero> 3452c: 67 2f mov r22, r23 3452e: 78 2f mov r23, r24 34530: 88 27 eor r24, r24 34532: b8 5f subi r27, 0xF8 ; 248 34534: 39 f0 breq .+14 ; 0x34544 <__fixunssfsi+0x4c> 34536: b9 3f cpi r27, 0xF9 ; 249 34538: cc f3 brlt .-14 ; 0x3452c <__fixunssfsi+0x34> 3453a: 86 95 lsr r24 3453c: 77 95 ror r23 3453e: 67 95 ror r22 34540: b3 95 inc r27 34542: d9 f7 brne .-10 ; 0x3453a <__fixunssfsi+0x42> 34544: 3e f4 brtc .+14 ; 0x34554 <__fixunssfsi+0x5c> 34546: 90 95 com r25 34548: 80 95 com r24 3454a: 70 95 com r23 3454c: 61 95 neg r22 3454e: 7f 4f sbci r23, 0xFF ; 255 34550: 8f 4f sbci r24, 0xFF ; 255 34552: 9f 4f sbci r25, 0xFF ; 255 34554: 08 95 ret 00034556 : 34556: 0f 94 75 a3 call 0x346ea ; 0x346ea <__fp_trunc> 3455a: 90 f0 brcs .+36 ; 0x34580 3455c: 9f 37 cpi r25, 0x7F ; 127 3455e: 48 f4 brcc .+18 ; 0x34572 34560: 91 11 cpse r25, r1 34562: 16 f0 brts .+4 ; 0x34568 34564: 0d 94 61 9b jmp 0x336c2 ; 0x336c2 <__fp_szero> 34568: 60 e0 ldi r22, 0x00 ; 0 3456a: 70 e0 ldi r23, 0x00 ; 0 3456c: 80 e8 ldi r24, 0x80 ; 128 3456e: 9f eb ldi r25, 0xBF ; 191 34570: 08 95 ret 34572: 26 f4 brtc .+8 ; 0x3457c 34574: 1b 16 cp r1, r27 34576: 61 1d adc r22, r1 34578: 71 1d adc r23, r1 3457a: 81 1d adc r24, r1 3457c: 0d 94 e6 a2 jmp 0x345cc ; 0x345cc <__fp_mintl> 34580: 0d 94 01 a3 jmp 0x34602 ; 0x34602 <__fp_mpack> 00034584 <__fp_cmp>: 34584: 99 0f add r25, r25 34586: 00 08 sbc r0, r0 34588: 55 0f add r21, r21 3458a: aa 0b sbc r26, r26 3458c: e0 e8 ldi r30, 0x80 ; 128 3458e: fe ef ldi r31, 0xFE ; 254 34590: 16 16 cp r1, r22 34592: 17 06 cpc r1, r23 34594: e8 07 cpc r30, r24 34596: f9 07 cpc r31, r25 34598: c0 f0 brcs .+48 ; 0x345ca <__fp_cmp+0x46> 3459a: 12 16 cp r1, r18 3459c: 13 06 cpc r1, r19 3459e: e4 07 cpc r30, r20 345a0: f5 07 cpc r31, r21 345a2: 98 f0 brcs .+38 ; 0x345ca <__fp_cmp+0x46> 345a4: 62 1b sub r22, r18 345a6: 73 0b sbc r23, r19 345a8: 84 0b sbc r24, r20 345aa: 95 0b sbc r25, r21 345ac: 39 f4 brne .+14 ; 0x345bc <__fp_cmp+0x38> 345ae: 0a 26 eor r0, r26 345b0: 61 f0 breq .+24 ; 0x345ca <__fp_cmp+0x46> 345b2: 23 2b or r18, r19 345b4: 24 2b or r18, r20 345b6: 25 2b or r18, r21 345b8: 21 f4 brne .+8 ; 0x345c2 <__fp_cmp+0x3e> 345ba: 08 95 ret 345bc: 0a 26 eor r0, r26 345be: 09 f4 brne .+2 ; 0x345c2 <__fp_cmp+0x3e> 345c0: a1 40 sbci r26, 0x01 ; 1 345c2: a6 95 lsr r26 345c4: 8f ef ldi r24, 0xFF ; 255 345c6: 81 1d adc r24, r1 345c8: 81 1d adc r24, r1 345ca: 08 95 ret 000345cc <__fp_mintl>: 345cc: 88 23 and r24, r24 345ce: 71 f4 brne .+28 ; 0x345ec <__fp_mintl+0x20> 345d0: 77 23 and r23, r23 345d2: 21 f0 breq .+8 ; 0x345dc <__fp_mintl+0x10> 345d4: 98 50 subi r25, 0x08 ; 8 345d6: 87 2b or r24, r23 345d8: 76 2f mov r23, r22 345da: 07 c0 rjmp .+14 ; 0x345ea <__fp_mintl+0x1e> 345dc: 66 23 and r22, r22 345de: 11 f4 brne .+4 ; 0x345e4 <__fp_mintl+0x18> 345e0: 99 27 eor r25, r25 345e2: 0d c0 rjmp .+26 ; 0x345fe <__fp_mintl+0x32> 345e4: 90 51 subi r25, 0x10 ; 16 345e6: 86 2b or r24, r22 345e8: 70 e0 ldi r23, 0x00 ; 0 345ea: 60 e0 ldi r22, 0x00 ; 0 345ec: 2a f0 brmi .+10 ; 0x345f8 <__fp_mintl+0x2c> 345ee: 9a 95 dec r25 345f0: 66 0f add r22, r22 345f2: 77 1f adc r23, r23 345f4: 88 1f adc r24, r24 345f6: da f7 brpl .-10 ; 0x345ee <__fp_mintl+0x22> 345f8: 88 0f add r24, r24 345fa: 96 95 lsr r25 345fc: 87 95 ror r24 345fe: 97 f9 bld r25, 7 34600: 08 95 ret 00034602 <__fp_mpack>: 34602: 9f 3f cpi r25, 0xFF ; 255 34604: 31 f0 breq .+12 ; 0x34612 <__fp_mpack_finite+0xc> 00034606 <__fp_mpack_finite>: 34606: 91 50 subi r25, 0x01 ; 1 34608: 20 f4 brcc .+8 ; 0x34612 <__fp_mpack_finite+0xc> 3460a: 87 95 ror r24 3460c: 77 95 ror r23 3460e: 67 95 ror r22 34610: b7 95 ror r27 34612: 88 0f add r24, r24 34614: 91 1d adc r25, r1 34616: 96 95 lsr r25 34618: 87 95 ror r24 3461a: 97 f9 bld r25, 7 3461c: 08 95 ret 0003461e <__fp_powser>: 3461e: df 93 push r29 34620: cf 93 push r28 34622: 1f 93 push r17 34624: 0f 93 push r16 34626: ff 92 push r15 34628: ef 92 push r14 3462a: df 92 push r13 3462c: 7b 01 movw r14, r22 3462e: 8c 01 movw r16, r24 34630: 68 94 set 34632: 06 c0 rjmp .+12 ; 0x34640 <__fp_powser+0x22> 34634: da 2e mov r13, r26 34636: ef 01 movw r28, r30 34638: 0f 94 bc 9a call 0x33578 ; 0x33578 <__mulsf3x> 3463c: fe 01 movw r30, r28 3463e: e8 94 clt 34640: a5 91 lpm r26, Z+ 34642: 25 91 lpm r18, Z+ 34644: 35 91 lpm r19, Z+ 34646: 45 91 lpm r20, Z+ 34648: 55 91 lpm r21, Z+ 3464a: a6 f3 brts .-24 ; 0x34634 <__fp_powser+0x16> 3464c: ef 01 movw r28, r30 3464e: 0f 94 1b a1 call 0x34236 ; 0x34236 <__addsf3x> 34652: fe 01 movw r30, r28 34654: 97 01 movw r18, r14 34656: a8 01 movw r20, r16 34658: da 94 dec r13 3465a: 69 f7 brne .-38 ; 0x34636 <__fp_powser+0x18> 3465c: df 90 pop r13 3465e: ef 90 pop r14 34660: ff 90 pop r15 34662: 0f 91 pop r16 34664: 1f 91 pop r17 34666: cf 91 pop r28 34668: df 91 pop r29 3466a: 08 95 ret 3466c: 0d 94 1c 9b jmp 0x33638 ; 0x33638 <__fp_nan> 00034670 <__fp_rempio2>: 34670: 0f 94 46 9b call 0x3368c ; 0x3368c <__fp_splitA> 34674: d8 f3 brcs .-10 ; 0x3466c <__fp_powser+0x4e> 34676: e8 94 clt 34678: e0 e0 ldi r30, 0x00 ; 0 3467a: bb 27 eor r27, r27 3467c: 9f 57 subi r25, 0x7F ; 127 3467e: f0 f0 brcs .+60 ; 0x346bc <__fp_rempio2+0x4c> 34680: 2a ed ldi r18, 0xDA ; 218 34682: 3f e0 ldi r19, 0x0F ; 15 34684: 49 ec ldi r20, 0xC9 ; 201 34686: 06 c0 rjmp .+12 ; 0x34694 <__fp_rempio2+0x24> 34688: ee 0f add r30, r30 3468a: bb 0f add r27, r27 3468c: 66 1f adc r22, r22 3468e: 77 1f adc r23, r23 34690: 88 1f adc r24, r24 34692: 28 f0 brcs .+10 ; 0x3469e <__fp_rempio2+0x2e> 34694: b2 3a cpi r27, 0xA2 ; 162 34696: 62 07 cpc r22, r18 34698: 73 07 cpc r23, r19 3469a: 84 07 cpc r24, r20 3469c: 28 f0 brcs .+10 ; 0x346a8 <__fp_rempio2+0x38> 3469e: b2 5a subi r27, 0xA2 ; 162 346a0: 62 0b sbc r22, r18 346a2: 73 0b sbc r23, r19 346a4: 84 0b sbc r24, r20 346a6: e3 95 inc r30 346a8: 9a 95 dec r25 346aa: 72 f7 brpl .-36 ; 0x34688 <__fp_rempio2+0x18> 346ac: 80 38 cpi r24, 0x80 ; 128 346ae: 30 f4 brcc .+12 ; 0x346bc <__fp_rempio2+0x4c> 346b0: 9a 95 dec r25 346b2: bb 0f add r27, r27 346b4: 66 1f adc r22, r22 346b6: 77 1f adc r23, r23 346b8: 88 1f adc r24, r24 346ba: d2 f7 brpl .-12 ; 0x346b0 <__fp_rempio2+0x40> 346bc: 90 48 sbci r25, 0x80 ; 128 346be: 0d 94 03 a3 jmp 0x34606 ; 0x34606 <__fp_mpack_finite> 000346c2 <__fp_sinus>: 346c2: ef 93 push r30 346c4: e0 ff sbrs r30, 0 346c6: 07 c0 rjmp .+14 ; 0x346d6 <__fp_sinus+0x14> 346c8: a2 ea ldi r26, 0xA2 ; 162 346ca: 2a ed ldi r18, 0xDA ; 218 346cc: 3f e0 ldi r19, 0x0F ; 15 346ce: 49 ec ldi r20, 0xC9 ; 201 346d0: 5f eb ldi r21, 0xBF ; 191 346d2: 0f 94 1b a1 call 0x34236 ; 0x34236 <__addsf3x> 346d6: 0f 94 2d 9b call 0x3365a ; 0x3365a <__fp_round> 346da: 0f 90 pop r0 346dc: 03 94 inc r0 346de: 01 fc sbrc r0, 1 346e0: 90 58 subi r25, 0x80 ; 128 346e2: e1 eb ldi r30, 0xB1 ; 177 346e4: fc e6 ldi r31, 0x6C ; 108 346e6: 0d 94 58 a5 jmp 0x34ab0 ; 0x34ab0 <__fp_powsodd> 000346ea <__fp_trunc>: 346ea: 0f 94 46 9b call 0x3368c ; 0x3368c <__fp_splitA> 346ee: a0 f0 brcs .+40 ; 0x34718 <__fp_trunc+0x2e> 346f0: be e7 ldi r27, 0x7E ; 126 346f2: b9 17 cp r27, r25 346f4: 88 f4 brcc .+34 ; 0x34718 <__fp_trunc+0x2e> 346f6: bb 27 eor r27, r27 346f8: 9f 38 cpi r25, 0x8F ; 143 346fa: 60 f4 brcc .+24 ; 0x34714 <__fp_trunc+0x2a> 346fc: 16 16 cp r1, r22 346fe: b1 1d adc r27, r1 34700: 67 2f mov r22, r23 34702: 78 2f mov r23, r24 34704: 88 27 eor r24, r24 34706: 98 5f subi r25, 0xF8 ; 248 34708: f7 cf rjmp .-18 ; 0x346f8 <__fp_trunc+0xe> 3470a: 86 95 lsr r24 3470c: 77 95 ror r23 3470e: 67 95 ror r22 34710: b1 1d adc r27, r1 34712: 93 95 inc r25 34714: 96 39 cpi r25, 0x96 ; 150 34716: c8 f3 brcs .-14 ; 0x3470a <__fp_trunc+0x20> 34718: 08 95 ret 0003471a <__gesf2>: 3471a: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__fp_cmp> 3471e: 08 f4 brcc .+2 ; 0x34722 <__gesf2+0x8> 34720: 8f ef ldi r24, 0xFF ; 255 34722: 08 95 ret 34724: 0f 94 1f 9b call 0x3363e ; 0x3363e <__fp_pscA> 34728: 29 f0 breq .+10 ; 0x34734 <__gesf2+0x1a> 3472a: 0f 94 26 9b call 0x3364c ; 0x3364c <__fp_pscB> 3472e: 11 f0 breq .+4 ; 0x34734 <__gesf2+0x1a> 34730: 0d 94 1c 9b jmp 0x33638 ; 0x33638 <__fp_nan> 34734: 0d 94 16 9b jmp 0x3362c ; 0x3362c <__fp_inf> 34738: b9 01 movw r22, r18 3473a: ca 01 movw r24, r20 3473c: 0d 94 01 a3 jmp 0x34602 ; 0x34602 <__fp_mpack> 00034740 : 34740: 9f 77 andi r25, 0x7F ; 127 34742: 5f 77 andi r21, 0x7F ; 127 34744: 0f 94 3e 9b call 0x3367c ; 0x3367c <__fp_split3> 34748: 68 f3 brcs .-38 ; 0x34724 <__gesf2+0xa> 3474a: 99 23 and r25, r25 3474c: a9 f3 breq .-22 ; 0x34738 <__gesf2+0x1e> 3474e: 55 23 and r21, r21 34750: a9 f3 breq .-22 ; 0x3473c <__gesf2+0x22> 34752: ff 27 eor r31, r31 34754: 95 17 cp r25, r21 34756: 58 f4 brcc .+22 ; 0x3476e 34758: e5 2f mov r30, r21 3475a: e9 1b sub r30, r25 3475c: ed 30 cpi r30, 0x0D ; 13 3475e: 60 f7 brcc .-40 ; 0x34738 <__gesf2+0x1e> 34760: 5e 3b cpi r21, 0xBE ; 190 34762: 10 f0 brcs .+4 ; 0x34768 34764: f1 e4 ldi r31, 0x41 ; 65 34766: 1c c0 rjmp .+56 ; 0x347a0 34768: 90 34 cpi r25, 0x40 ; 64 3476a: e0 f4 brcc .+56 ; 0x347a4 3476c: 0a c0 rjmp .+20 ; 0x34782 3476e: e9 2f mov r30, r25 34770: e5 1b sub r30, r21 34772: ed 30 cpi r30, 0x0D ; 13 34774: 18 f7 brcc .-58 ; 0x3473c <__gesf2+0x22> 34776: 9e 3b cpi r25, 0xBE ; 190 34778: 10 f0 brcs .+4 ; 0x3477e 3477a: f1 e4 ldi r31, 0x41 ; 65 3477c: 11 c0 rjmp .+34 ; 0x347a0 3477e: 50 34 cpi r21, 0x40 ; 64 34780: 88 f4 brcc .+34 ; 0x347a4 34782: f9 ea ldi r31, 0xA9 ; 169 34784: 88 23 and r24, r24 34786: 2a f0 brmi .+10 ; 0x34792 34788: 9a 95 dec r25 3478a: 66 0f add r22, r22 3478c: 77 1f adc r23, r23 3478e: 88 1f adc r24, r24 34790: da f7 brpl .-10 ; 0x34788 34792: 44 23 and r20, r20 34794: 2a f0 brmi .+10 ; 0x347a0 34796: 5a 95 dec r21 34798: 22 0f add r18, r18 3479a: 33 1f adc r19, r19 3479c: 44 1f adc r20, r20 3479e: da f7 brpl .-10 ; 0x34796 347a0: 9f 1b sub r25, r31 347a2: 5f 1b sub r21, r31 347a4: ff 93 push r31 347a6: 1f 93 push r17 347a8: 0f 93 push r16 347aa: ff 92 push r15 347ac: ef 92 push r14 347ae: 79 01 movw r14, r18 347b0: 8a 01 movw r16, r20 347b2: bb 27 eor r27, r27 347b4: ab 2f mov r26, r27 347b6: 9b 01 movw r18, r22 347b8: ac 01 movw r20, r24 347ba: 0f 94 bf 9a call 0x3357e ; 0x3357e <__mulsf3_pse> 347be: 97 01 movw r18, r14 347c0: a8 01 movw r20, r16 347c2: bf 93 push r27 347c4: 7b 01 movw r14, r22 347c6: 8c 01 movw r16, r24 347c8: aa 27 eor r26, r26 347ca: ba 2f mov r27, r26 347cc: b9 01 movw r22, r18 347ce: ca 01 movw r24, r20 347d0: 0f 94 bf 9a call 0x3357e ; 0x3357e <__mulsf3_pse> 347d4: af 91 pop r26 347d6: 97 01 movw r18, r14 347d8: a8 01 movw r20, r16 347da: ef 90 pop r14 347dc: ff 90 pop r15 347de: 0f 91 pop r16 347e0: 1f 91 pop r17 347e2: 0f 94 1b a1 call 0x34236 ; 0x34236 <__addsf3x> 347e6: 0f 94 2d 9b call 0x3365a ; 0x3365a <__fp_round> 347ea: 0f 94 d2 a4 call 0x349a4 ; 0x349a4 347ee: 4f 91 pop r20 347f0: 40 ff sbrs r20, 0 347f2: 08 95 ret 347f4: 55 27 eor r21, r21 347f6: 47 fd sbrc r20, 7 347f8: 50 95 com r21 347fa: 0d 94 0b a4 jmp 0x34816 ; 0x34816 000347fe : 347fe: 9b 01 movw r18, r22 34800: ac 01 movw r20, r24 34802: 60 e0 ldi r22, 0x00 ; 0 34804: 70 e0 ldi r23, 0x00 ; 0 34806: 80 e8 ldi r24, 0x80 ; 128 34808: 9f e3 ldi r25, 0x3F ; 63 3480a: 0d 94 03 a2 jmp 0x34406 ; 0x34406 <__divsf3> 3480e: 0d 94 16 9b jmp 0x3362c ; 0x3362c <__fp_inf> 34812: 0d 94 01 a3 jmp 0x34602 ; 0x34602 <__fp_mpack> 00034816 : 34816: 0f 94 46 9b call 0x3368c ; 0x3368c <__fp_splitA> 3481a: d8 f3 brcs .-10 ; 0x34812 3481c: 99 23 and r25, r25 3481e: c9 f3 breq .-14 ; 0x34812 34820: 94 0f add r25, r20 34822: 51 1d adc r21, r1 34824: a3 f3 brvs .-24 ; 0x3480e 34826: 91 50 subi r25, 0x01 ; 1 34828: 50 40 sbci r21, 0x00 ; 0 3482a: 94 f0 brlt .+36 ; 0x34850 3482c: 59 f0 breq .+22 ; 0x34844 3482e: 88 23 and r24, r24 34830: 32 f0 brmi .+12 ; 0x3483e 34832: 66 0f add r22, r22 34834: 77 1f adc r23, r23 34836: 88 1f adc r24, r24 34838: 91 50 subi r25, 0x01 ; 1 3483a: 50 40 sbci r21, 0x00 ; 0 3483c: c1 f7 brne .-16 ; 0x3482e 3483e: 9e 3f cpi r25, 0xFE ; 254 34840: 51 05 cpc r21, r1 34842: 2c f7 brge .-54 ; 0x3480e 34844: 88 0f add r24, r24 34846: 91 1d adc r25, r1 34848: 96 95 lsr r25 3484a: 87 95 ror r24 3484c: 97 f9 bld r25, 7 3484e: 08 95 ret 34850: 5f 3f cpi r21, 0xFF ; 255 34852: ac f0 brlt .+42 ; 0x3487e 34854: 98 3e cpi r25, 0xE8 ; 232 34856: 9c f0 brlt .+38 ; 0x3487e 34858: bb 27 eor r27, r27 3485a: 86 95 lsr r24 3485c: 77 95 ror r23 3485e: 67 95 ror r22 34860: b7 95 ror r27 34862: 08 f4 brcc .+2 ; 0x34866 34864: b1 60 ori r27, 0x01 ; 1 34866: 93 95 inc r25 34868: c1 f7 brne .-16 ; 0x3485a 3486a: bb 0f add r27, r27 3486c: 58 f7 brcc .-42 ; 0x34844 3486e: 11 f4 brne .+4 ; 0x34874 34870: 60 ff sbrs r22, 0 34872: e8 cf rjmp .-48 ; 0x34844 34874: 6f 5f subi r22, 0xFF ; 255 34876: 7f 4f sbci r23, 0xFF ; 255 34878: 8f 4f sbci r24, 0xFF ; 255 3487a: 9f 4f sbci r25, 0xFF ; 255 3487c: e3 cf rjmp .-58 ; 0x34844 3487e: 0d 94 61 9b jmp 0x336c2 ; 0x336c2 <__fp_szero> 00034882 : 34882: 0f 94 46 9b call 0x3368c ; 0x3368c <__fp_splitA> 34886: 58 f1 brcs .+86 ; 0x348de 34888: 9e 57 subi r25, 0x7E ; 126 3488a: 60 f1 brcs .+88 ; 0x348e4 3488c: 98 51 subi r25, 0x18 ; 24 3488e: a0 f0 brcs .+40 ; 0x348b8 34890: e9 f0 breq .+58 ; 0x348cc 34892: 98 30 cpi r25, 0x08 ; 8 34894: 20 f5 brcc .+72 ; 0x348de 34896: 09 2e mov r0, r25 34898: 99 27 eor r25, r25 3489a: 66 0f add r22, r22 3489c: 77 1f adc r23, r23 3489e: 88 1f adc r24, r24 348a0: 99 1f adc r25, r25 348a2: 0a 94 dec r0 348a4: d1 f7 brne .-12 ; 0x3489a 348a6: 12 c0 rjmp .+36 ; 0x348cc 348a8: 06 2e mov r0, r22 348aa: 67 2f mov r22, r23 348ac: 78 2f mov r23, r24 348ae: 88 27 eor r24, r24 348b0: 98 5f subi r25, 0xF8 ; 248 348b2: 11 f4 brne .+4 ; 0x348b8 348b4: 00 0c add r0, r0 348b6: 07 c0 rjmp .+14 ; 0x348c6 348b8: 99 3f cpi r25, 0xF9 ; 249 348ba: b4 f3 brlt .-20 ; 0x348a8 348bc: 86 95 lsr r24 348be: 77 95 ror r23 348c0: 67 95 ror r22 348c2: 93 95 inc r25 348c4: d9 f7 brne .-10 ; 0x348bc 348c6: 61 1d adc r22, r1 348c8: 71 1d adc r23, r1 348ca: 81 1d adc r24, r1 348cc: 3e f4 brtc .+14 ; 0x348dc 348ce: 90 95 com r25 348d0: 80 95 com r24 348d2: 70 95 com r23 348d4: 61 95 neg r22 348d6: 7f 4f sbci r23, 0xFF ; 255 348d8: 8f 4f sbci r24, 0xFF ; 255 348da: 9f 4f sbci r25, 0xFF ; 255 348dc: 08 95 ret 348de: 68 94 set 348e0: 0d 94 61 9b jmp 0x336c2 ; 0x336c2 <__fp_szero> 348e4: 0d 94 60 9b jmp 0x336c0 ; 0x336c0 <__fp_zero> 000348e8 : 348e8: fa 01 movw r30, r20 348ea: ee 0f add r30, r30 348ec: ff 1f adc r31, r31 348ee: 30 96 adiw r30, 0x00 ; 0 348f0: 21 05 cpc r18, r1 348f2: 31 05 cpc r19, r1 348f4: a1 f1 breq .+104 ; 0x3495e 348f6: 61 15 cp r22, r1 348f8: 71 05 cpc r23, r1 348fa: 61 f4 brne .+24 ; 0x34914 348fc: 80 38 cpi r24, 0x80 ; 128 348fe: bf e3 ldi r27, 0x3F ; 63 34900: 9b 07 cpc r25, r27 34902: 49 f1 breq .+82 ; 0x34956 34904: 68 94 set 34906: 90 38 cpi r25, 0x80 ; 128 34908: 81 05 cpc r24, r1 3490a: 61 f0 breq .+24 ; 0x34924 3490c: 80 38 cpi r24, 0x80 ; 128 3490e: bf ef ldi r27, 0xFF ; 255 34910: 9b 07 cpc r25, r27 34912: 41 f0 breq .+16 ; 0x34924 34914: 99 23 and r25, r25 34916: 4a f5 brpl .+82 ; 0x3496a 34918: ff 3f cpi r31, 0xFF ; 255 3491a: e1 05 cpc r30, r1 3491c: 31 05 cpc r19, r1 3491e: 21 05 cpc r18, r1 34920: 19 f1 breq .+70 ; 0x34968 34922: e8 94 clt 34924: 08 94 sec 34926: e7 95 ror r30 34928: d9 01 movw r26, r18 3492a: aa 23 and r26, r26 3492c: 29 f4 brne .+10 ; 0x34938 3492e: ab 2f mov r26, r27 34930: be 2f mov r27, r30 34932: f8 5f subi r31, 0xF8 ; 248 34934: d0 f3 brcs .-12 ; 0x3492a 34936: 10 c0 rjmp .+32 ; 0x34958 34938: ff 5f subi r31, 0xFF ; 255 3493a: 70 f4 brcc .+28 ; 0x34958 3493c: a6 95 lsr r26 3493e: e0 f7 brcc .-8 ; 0x34938 34940: f7 39 cpi r31, 0x97 ; 151 34942: 50 f0 brcs .+20 ; 0x34958 34944: 19 f0 breq .+6 ; 0x3494c 34946: ff 3a cpi r31, 0xAF ; 175 34948: 38 f4 brcc .+14 ; 0x34958 3494a: 9f 77 andi r25, 0x7F ; 127 3494c: 9f 93 push r25 3494e: 0d d0 rcall .+26 ; 0x3496a 34950: 0f 90 pop r0 34952: 07 fc sbrc r0, 7 34954: 90 58 subi r25, 0x80 ; 128 34956: 08 95 ret 34958: 46 f0 brts .+16 ; 0x3496a 3495a: 0d 94 1c 9b jmp 0x33638 ; 0x33638 <__fp_nan> 3495e: 60 e0 ldi r22, 0x00 ; 0 34960: 70 e0 ldi r23, 0x00 ; 0 34962: 80 e8 ldi r24, 0x80 ; 128 34964: 9f e3 ldi r25, 0x3F ; 63 34966: 08 95 ret 34968: 4f e7 ldi r20, 0x7F ; 127 3496a: 9f 77 andi r25, 0x7F ; 127 3496c: 5f 93 push r21 3496e: 4f 93 push r20 34970: 3f 93 push r19 34972: 2f 93 push r18 34974: 0f 94 74 a5 call 0x34ae8 ; 0x34ae8 34978: 2f 91 pop r18 3497a: 3f 91 pop r19 3497c: 4f 91 pop r20 3497e: 5f 91 pop r21 34980: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 34984: 0d 94 1f a5 jmp 0x34a3e ; 0x34a3e 00034988 : 34988: 9f 93 push r25 3498a: 0f 94 38 a3 call 0x34670 ; 0x34670 <__fp_rempio2> 3498e: 0f 90 pop r0 34990: 07 fc sbrc r0, 7 34992: ee 5f subi r30, 0xFE ; 254 34994: 0d 94 61 a3 jmp 0x346c2 ; 0x346c2 <__fp_sinus> 34998: 19 f4 brne .+6 ; 0x349a0 3499a: 16 f4 brtc .+4 ; 0x349a0 3499c: 0d 94 1c 9b jmp 0x33638 ; 0x33638 <__fp_nan> 349a0: 0d 94 01 a3 jmp 0x34602 ; 0x34602 <__fp_mpack> 000349a4 : 349a4: 0f 94 46 9b call 0x3368c ; 0x3368c <__fp_splitA> 349a8: b8 f3 brcs .-18 ; 0x34998 349aa: 99 23 and r25, r25 349ac: c9 f3 breq .-14 ; 0x349a0 349ae: b6 f3 brts .-20 ; 0x3499c 349b0: 9f 57 subi r25, 0x7F ; 127 349b2: 55 0b sbc r21, r21 349b4: 87 ff sbrs r24, 7 349b6: 0f 94 51 a5 call 0x34aa2 ; 0x34aa2 <__fp_norm2> 349ba: 00 24 eor r0, r0 349bc: a0 e6 ldi r26, 0x60 ; 96 349be: 40 ea ldi r20, 0xA0 ; 160 349c0: 90 01 movw r18, r0 349c2: 80 58 subi r24, 0x80 ; 128 349c4: 56 95 lsr r21 349c6: 97 95 ror r25 349c8: 28 f4 brcc .+10 ; 0x349d4 349ca: 80 5c subi r24, 0xC0 ; 192 349cc: 66 0f add r22, r22 349ce: 77 1f adc r23, r23 349d0: 88 1f adc r24, r24 349d2: 20 f0 brcs .+8 ; 0x349dc 349d4: 26 17 cp r18, r22 349d6: 37 07 cpc r19, r23 349d8: 48 07 cpc r20, r24 349da: 30 f4 brcc .+12 ; 0x349e8 349dc: 62 1b sub r22, r18 349de: 73 0b sbc r23, r19 349e0: 84 0b sbc r24, r20 349e2: 20 29 or r18, r0 349e4: 31 29 or r19, r1 349e6: 4a 2b or r20, r26 349e8: a6 95 lsr r26 349ea: 17 94 ror r1 349ec: 07 94 ror r0 349ee: 20 25 eor r18, r0 349f0: 31 25 eor r19, r1 349f2: 4a 27 eor r20, r26 349f4: 58 f7 brcc .-42 ; 0x349cc 349f6: 66 0f add r22, r22 349f8: 77 1f adc r23, r23 349fa: 88 1f adc r24, r24 349fc: 20 f0 brcs .+8 ; 0x34a06 349fe: 26 17 cp r18, r22 34a00: 37 07 cpc r19, r23 34a02: 48 07 cpc r20, r24 34a04: 30 f4 brcc .+12 ; 0x34a12 34a06: 62 0b sbc r22, r18 34a08: 73 0b sbc r23, r19 34a0a: 84 0b sbc r24, r20 34a0c: 20 0d add r18, r0 34a0e: 31 1d adc r19, r1 34a10: 41 1d adc r20, r1 34a12: a0 95 com r26 34a14: 81 f7 brne .-32 ; 0x349f6 34a16: b9 01 movw r22, r18 34a18: 84 2f mov r24, r20 34a1a: 91 58 subi r25, 0x81 ; 129 34a1c: 88 0f add r24, r24 34a1e: 96 95 lsr r25 34a20: 87 95 ror r24 34a22: 08 95 ret 00034a24 <__unordsf2>: 34a24: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__fp_cmp> 34a28: 88 0b sbc r24, r24 34a2a: 99 0b sbc r25, r25 34a2c: 08 95 ret 34a2e: 29 f4 brne .+10 ; 0x34a3a <__unordsf2+0x16> 34a30: 16 f0 brts .+4 ; 0x34a36 <__unordsf2+0x12> 34a32: 0d 94 16 9b jmp 0x3362c ; 0x3362c <__fp_inf> 34a36: 0d 94 60 9b jmp 0x336c0 ; 0x336c0 <__fp_zero> 34a3a: 0d 94 1c 9b jmp 0x33638 ; 0x33638 <__fp_nan> 00034a3e : 34a3e: 0f 94 46 9b call 0x3368c ; 0x3368c <__fp_splitA> 34a42: a8 f3 brcs .-22 ; 0x34a2e <__unordsf2+0xa> 34a44: 96 38 cpi r25, 0x86 ; 134 34a46: a0 f7 brcc .-24 ; 0x34a30 <__unordsf2+0xc> 34a48: 07 f8 bld r0, 7 34a4a: 0f 92 push r0 34a4c: e8 94 clt 34a4e: 2b e3 ldi r18, 0x3B ; 59 34a50: 3a ea ldi r19, 0xAA ; 170 34a52: 48 eb ldi r20, 0xB8 ; 184 34a54: 5f e7 ldi r21, 0x7F ; 127 34a56: 0f 94 bf 9a call 0x3357e ; 0x3357e <__mulsf3_pse> 34a5a: 0f 92 push r0 34a5c: 0f 92 push r0 34a5e: 0f 92 push r0 34a60: 4d b7 in r20, 0x3d ; 61 34a62: 5e b7 in r21, 0x3e ; 62 34a64: 0f 92 push r0 34a66: 0f 94 bc a5 call 0x34b78 ; 0x34b78 34a6a: ef ec ldi r30, 0xCF ; 207 34a6c: fc e6 ldi r31, 0x6C ; 108 34a6e: 0f 94 0f a3 call 0x3461e ; 0x3461e <__fp_powser> 34a72: 4f 91 pop r20 34a74: 5f 91 pop r21 34a76: ef 91 pop r30 34a78: ff 91 pop r31 34a7a: e5 95 asr r30 34a7c: ee 1f adc r30, r30 34a7e: ff 1f adc r31, r31 34a80: 49 f0 breq .+18 ; 0x34a94 34a82: fe 57 subi r31, 0x7E ; 126 34a84: e0 68 ori r30, 0x80 ; 128 34a86: 44 27 eor r20, r20 34a88: ee 0f add r30, r30 34a8a: 44 1f adc r20, r20 34a8c: fa 95 dec r31 34a8e: e1 f7 brne .-8 ; 0x34a88 34a90: 41 95 neg r20 34a92: 55 0b sbc r21, r21 34a94: 0f 94 0b a4 call 0x34816 ; 0x34816 34a98: 0f 90 pop r0 34a9a: 07 fe sbrs r0, 7 34a9c: 0d 94 ff a3 jmp 0x347fe ; 0x347fe 34aa0: 08 95 ret 00034aa2 <__fp_norm2>: 34aa2: 91 50 subi r25, 0x01 ; 1 34aa4: 50 40 sbci r21, 0x00 ; 0 34aa6: 66 0f add r22, r22 34aa8: 77 1f adc r23, r23 34aaa: 88 1f adc r24, r24 34aac: d2 f7 brpl .-12 ; 0x34aa2 <__fp_norm2> 34aae: 08 95 ret 00034ab0 <__fp_powsodd>: 34ab0: 9f 93 push r25 34ab2: 8f 93 push r24 34ab4: 7f 93 push r23 34ab6: 6f 93 push r22 34ab8: ff 93 push r31 34aba: ef 93 push r30 34abc: 9b 01 movw r18, r22 34abe: ac 01 movw r20, r24 34ac0: 0f 94 a9 9a call 0x33552 ; 0x33552 <__mulsf3> 34ac4: ef 91 pop r30 34ac6: ff 91 pop r31 34ac8: 0f 94 0f a3 call 0x3461e ; 0x3461e <__fp_powser> 34acc: 2f 91 pop r18 34ace: 3f 91 pop r19 34ad0: 4f 91 pop r20 34ad2: 5f 91 pop r21 34ad4: 0d 94 a9 9a jmp 0x33552 ; 0x33552 <__mulsf3> 34ad8: 16 f0 brts .+4 ; 0x34ade <__fp_powsodd+0x2e> 34ada: 0d 94 01 a3 jmp 0x34602 ; 0x34602 <__fp_mpack> 34ade: 0d 94 1c 9b jmp 0x33638 ; 0x33638 <__fp_nan> 34ae2: 68 94 set 34ae4: 0d 94 16 9b jmp 0x3362c ; 0x3362c <__fp_inf> 00034ae8 : 34ae8: 0f 94 46 9b call 0x3368c ; 0x3368c <__fp_splitA> 34aec: a8 f3 brcs .-22 ; 0x34ad8 <__fp_powsodd+0x28> 34aee: 99 23 and r25, r25 34af0: c1 f3 breq .-16 ; 0x34ae2 <__fp_powsodd+0x32> 34af2: ae f3 brts .-22 ; 0x34ade <__fp_powsodd+0x2e> 34af4: df 93 push r29 34af6: cf 93 push r28 34af8: 1f 93 push r17 34afa: 0f 93 push r16 34afc: ff 92 push r15 34afe: c9 2f mov r28, r25 34b00: dd 27 eor r29, r29 34b02: 88 23 and r24, r24 34b04: 2a f0 brmi .+10 ; 0x34b10 34b06: 21 97 sbiw r28, 0x01 ; 1 34b08: 66 0f add r22, r22 34b0a: 77 1f adc r23, r23 34b0c: 88 1f adc r24, r24 34b0e: da f7 brpl .-10 ; 0x34b06 34b10: 20 e0 ldi r18, 0x00 ; 0 34b12: 30 e0 ldi r19, 0x00 ; 0 34b14: 40 e8 ldi r20, 0x80 ; 128 34b16: 5f eb ldi r21, 0xBF ; 191 34b18: 9f e3 ldi r25, 0x3F ; 63 34b1a: 88 39 cpi r24, 0x98 ; 152 34b1c: 20 f0 brcs .+8 ; 0x34b26 34b1e: 80 3e cpi r24, 0xE0 ; 224 34b20: 38 f0 brcs .+14 ; 0x34b30 34b22: 21 96 adiw r28, 0x01 ; 1 34b24: 8f 77 andi r24, 0x7F ; 127 34b26: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 34b2a: e7 ef ldi r30, 0xF7 ; 247 34b2c: fc e6 ldi r31, 0x6C ; 108 34b2e: 04 c0 rjmp .+8 ; 0x34b38 34b30: 0f 94 04 a1 call 0x34208 ; 0x34208 <__addsf3> 34b34: e4 e2 ldi r30, 0x24 ; 36 34b36: fd e6 ldi r31, 0x6D ; 109 34b38: 0f 94 0f a3 call 0x3461e ; 0x3461e <__fp_powser> 34b3c: 8b 01 movw r16, r22 34b3e: be 01 movw r22, r28 34b40: ec 01 movw r28, r24 34b42: fb 2e mov r15, r27 34b44: 6f 57 subi r22, 0x7F ; 127 34b46: 71 09 sbc r23, r1 34b48: 75 95 asr r23 34b4a: 77 1f adc r23, r23 34b4c: 88 0b sbc r24, r24 34b4e: 99 0b sbc r25, r25 34b50: 0f 94 6a 9a call 0x334d4 ; 0x334d4 <__floatsisf> 34b54: 28 e1 ldi r18, 0x18 ; 24 34b56: 32 e7 ldi r19, 0x72 ; 114 34b58: 41 e3 ldi r20, 0x31 ; 49 34b5a: 5f e3 ldi r21, 0x3F ; 63 34b5c: 0f 94 bc 9a call 0x33578 ; 0x33578 <__mulsf3x> 34b60: af 2d mov r26, r15 34b62: 98 01 movw r18, r16 34b64: ae 01 movw r20, r28 34b66: ff 90 pop r15 34b68: 0f 91 pop r16 34b6a: 1f 91 pop r17 34b6c: cf 91 pop r28 34b6e: df 91 pop r29 34b70: 0f 94 1b a1 call 0x34236 ; 0x34236 <__addsf3x> 34b74: 0d 94 2d 9b jmp 0x3365a ; 0x3365a <__fp_round> 00034b78 : 34b78: fa 01 movw r30, r20 34b7a: dc 01 movw r26, r24 34b7c: aa 0f add r26, r26 34b7e: bb 1f adc r27, r27 34b80: 9b 01 movw r18, r22 34b82: ac 01 movw r20, r24 34b84: bf 57 subi r27, 0x7F ; 127 34b86: 28 f4 brcc .+10 ; 0x34b92 34b88: 22 27 eor r18, r18 34b8a: 33 27 eor r19, r19 34b8c: 44 27 eor r20, r20 34b8e: 50 78 andi r21, 0x80 ; 128 34b90: 20 c0 rjmp .+64 ; 0x34bd2 34b92: b7 51 subi r27, 0x17 ; 23 34b94: 90 f4 brcc .+36 ; 0x34bba 34b96: ab 2f mov r26, r27 34b98: 00 24 eor r0, r0 34b9a: 46 95 lsr r20 34b9c: 37 95 ror r19 34b9e: 27 95 ror r18 34ba0: 01 1c adc r0, r1 34ba2: a3 95 inc r26 34ba4: d2 f3 brmi .-12 ; 0x34b9a 34ba6: 00 20 and r0, r0 34ba8: 71 f0 breq .+28 ; 0x34bc6 34baa: 22 0f add r18, r18 34bac: 33 1f adc r19, r19 34bae: 44 1f adc r20, r20 34bb0: b3 95 inc r27 34bb2: da f3 brmi .-10 ; 0x34baa 34bb4: 0e d0 rcall .+28 ; 0x34bd2 34bb6: 0d 94 03 a1 jmp 0x34206 ; 0x34206 <__subsf3> 34bba: 61 30 cpi r22, 0x01 ; 1 34bbc: 71 05 cpc r23, r1 34bbe: a0 e8 ldi r26, 0x80 ; 128 34bc0: 8a 07 cpc r24, r26 34bc2: b9 46 sbci r27, 0x69 ; 105 34bc4: 30 f4 brcc .+12 ; 0x34bd2 34bc6: 9b 01 movw r18, r22 34bc8: ac 01 movw r20, r24 34bca: 66 27 eor r22, r22 34bcc: 77 27 eor r23, r23 34bce: 88 27 eor r24, r24 34bd0: 90 78 andi r25, 0x80 ; 128 34bd2: 30 96 adiw r30, 0x00 ; 0 34bd4: 21 f0 breq .+8 ; 0x34bde 34bd6: 20 83 st Z, r18 34bd8: 31 83 std Z+1, r19 ; 0x01 34bda: 42 83 std Z+2, r20 ; 0x02 34bdc: 53 83 std Z+3, r21 ; 0x03 34bde: 08 95 ret 00034be0 : 34be0: 91 11 cpse r25, r1 34be2: 08 95 ret 34be4: 81 54 subi r24, 0x41 ; 65 34be6: 8a 51 subi r24, 0x1A ; 26 34be8: 08 f4 brcc .+2 ; 0x34bec 34bea: 80 5e subi r24, 0xE0 ; 224 34bec: 85 5a subi r24, 0xA5 ; 165 34bee: 08 95 ret 00034bf0 : 34bf0: fb 01 movw r30, r22 34bf2: dc 01 movw r26, r24 34bf4: 04 c0 rjmp .+8 ; 0x34bfe 34bf6: 8d 91 ld r24, X+ 34bf8: 01 90 ld r0, Z+ 34bfa: 80 19 sub r24, r0 34bfc: 21 f4 brne .+8 ; 0x34c06 34bfe: 41 50 subi r20, 0x01 ; 1 34c00: 50 40 sbci r21, 0x00 ; 0 34c02: c8 f7 brcc .-14 ; 0x34bf6 34c04: 88 1b sub r24, r24 34c06: 99 0b sbc r25, r25 34c08: 08 95 ret 00034c0a : 34c0a: fb 01 movw r30, r22 34c0c: dc 01 movw r26, r24 34c0e: 02 c0 rjmp .+4 ; 0x34c14 34c10: 01 90 ld r0, Z+ 34c12: 0d 92 st X+, r0 34c14: 41 50 subi r20, 0x01 ; 1 34c16: 50 40 sbci r21, 0x00 ; 0 34c18: d8 f7 brcc .-10 ; 0x34c10 34c1a: 08 95 ret 00034c1c : 34c1c: dc 01 movw r26, r24 34c1e: 01 c0 rjmp .+2 ; 0x34c22 34c20: 6d 93 st X+, r22 34c22: 41 50 subi r20, 0x01 ; 1 34c24: 50 40 sbci r21, 0x00 ; 0 34c26: e0 f7 brcc .-8 ; 0x34c20 34c28: 08 95 ret 00034c2a : 34c2a: fb 01 movw r30, r22 34c2c: dc 01 movw r26, r24 34c2e: 8d 91 ld r24, X+ 34c30: 81 34 cpi r24, 0x41 ; 65 34c32: 1c f0 brlt .+6 ; 0x34c3a 34c34: 8b 35 cpi r24, 0x5B ; 91 34c36: 0c f4 brge .+2 ; 0x34c3a 34c38: 80 5e subi r24, 0xE0 ; 224 34c3a: 61 91 ld r22, Z+ 34c3c: 61 34 cpi r22, 0x41 ; 65 34c3e: 1c f0 brlt .+6 ; 0x34c46 34c40: 6b 35 cpi r22, 0x5B ; 91 34c42: 0c f4 brge .+2 ; 0x34c46 34c44: 60 5e subi r22, 0xE0 ; 224 34c46: 86 1b sub r24, r22 34c48: 61 11 cpse r22, r1 34c4a: 89 f3 breq .-30 ; 0x34c2e 34c4c: 99 0b sbc r25, r25 34c4e: 08 95 ret 00034c50 : 34c50: fb 01 movw r30, r22 34c52: dc 01 movw r26, r24 34c54: 0d 90 ld r0, X+ 34c56: 00 20 and r0, r0 34c58: e9 f7 brne .-6 ; 0x34c54 34c5a: 11 97 sbiw r26, 0x01 ; 1 34c5c: 01 90 ld r0, Z+ 34c5e: 0d 92 st X+, r0 34c60: 00 20 and r0, r0 34c62: e1 f7 brne .-8 ; 0x34c5c 34c64: 08 95 ret 00034c66 : 34c66: fc 01 movw r30, r24 34c68: 81 91 ld r24, Z+ 34c6a: 86 17 cp r24, r22 34c6c: 21 f0 breq .+8 ; 0x34c76 34c6e: 88 23 and r24, r24 34c70: d9 f7 brne .-10 ; 0x34c68 34c72: 99 27 eor r25, r25 34c74: 08 95 ret 34c76: 31 97 sbiw r30, 0x01 ; 1 34c78: cf 01 movw r24, r30 34c7a: 08 95 ret 00034c7c : 34c7c: fb 01 movw r30, r22 34c7e: dc 01 movw r26, r24 34c80: 8d 91 ld r24, X+ 34c82: 01 90 ld r0, Z+ 34c84: 80 19 sub r24, r0 34c86: 01 10 cpse r0, r1 34c88: d9 f3 breq .-10 ; 0x34c80 34c8a: 99 0b sbc r25, r25 34c8c: 08 95 ret 00034c8e : 34c8e: fb 01 movw r30, r22 34c90: dc 01 movw r26, r24 34c92: 01 90 ld r0, Z+ 34c94: 0d 92 st X+, r0 34c96: 00 20 and r0, r0 34c98: e1 f7 brne .-8 ; 0x34c92 34c9a: 08 95 ret 00034c9c : 34c9c: fb 01 movw r30, r22 34c9e: dc 01 movw r26, r24 34ca0: 41 50 subi r20, 0x01 ; 1 34ca2: 50 40 sbci r21, 0x00 ; 0 34ca4: 30 f0 brcs .+12 ; 0x34cb2 34ca6: 8d 91 ld r24, X+ 34ca8: 01 90 ld r0, Z+ 34caa: 80 19 sub r24, r0 34cac: 19 f4 brne .+6 ; 0x34cb4 34cae: 00 20 and r0, r0 34cb0: b9 f7 brne .-18 ; 0x34ca0 34cb2: 88 1b sub r24, r24 34cb4: 99 0b sbc r25, r25 34cb6: 08 95 ret 00034cb8 : 34cb8: fb 01 movw r30, r22 34cba: dc 01 movw r26, r24 34cbc: 41 50 subi r20, 0x01 ; 1 34cbe: 50 40 sbci r21, 0x00 ; 0 34cc0: 48 f0 brcs .+18 ; 0x34cd4 34cc2: 01 90 ld r0, Z+ 34cc4: 0d 92 st X+, r0 34cc6: 00 20 and r0, r0 34cc8: c9 f7 brne .-14 ; 0x34cbc 34cca: 01 c0 rjmp .+2 ; 0x34cce 34ccc: 1d 92 st X+, r1 34cce: 41 50 subi r20, 0x01 ; 1 34cd0: 50 40 sbci r21, 0x00 ; 0 34cd2: e0 f7 brcc .-8 ; 0x34ccc 34cd4: 08 95 ret 00034cd6 : 34cd6: 0f 93 push r16 34cd8: 1f 93 push r17 34cda: cf 93 push r28 34cdc: df 93 push r29 34cde: e0 91 00 17 lds r30, 0x1700 ; 0x801700 <__iob+0x2> 34ce2: f0 91 01 17 lds r31, 0x1701 ; 0x801701 <__iob+0x3> 34ce6: 23 81 ldd r18, Z+3 ; 0x03 34ce8: ec 01 movw r28, r24 34cea: 10 e0 ldi r17, 0x00 ; 0 34cec: 00 e0 ldi r16, 0x00 ; 0 34cee: 21 fd sbrc r18, 1 34cf0: 08 c0 rjmp .+16 ; 0x34d02 34cf2: 0f ef ldi r16, 0xFF ; 255 34cf4: 1f ef ldi r17, 0xFF ; 255 34cf6: 14 c0 rjmp .+40 ; 0x34d20 34cf8: 19 95 eicall 34cfa: 89 2b or r24, r25 34cfc: 11 f0 breq .+4 ; 0x34d02 34cfe: 0f ef ldi r16, 0xFF ; 255 34d00: 1f ef ldi r17, 0xFF ; 255 34d02: 89 91 ld r24, Y+ 34d04: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> 34d08: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> 34d0c: db 01 movw r26, r22 34d0e: 18 96 adiw r26, 0x08 ; 8 34d10: ed 91 ld r30, X+ 34d12: fc 91 ld r31, X 34d14: 81 11 cpse r24, r1 34d16: f0 cf rjmp .-32 ; 0x34cf8 34d18: 8a e0 ldi r24, 0x0A ; 10 34d1a: 19 95 eicall 34d1c: 89 2b or r24, r25 34d1e: 49 f7 brne .-46 ; 0x34cf2 34d20: c8 01 movw r24, r16 34d22: df 91 pop r29 34d24: cf 91 pop r28 34d26: 1f 91 pop r17 34d28: 0f 91 pop r16 34d2a: 08 95 ret 00034d2c <__do_global_dtors>: 34d2c: 10 e5 ldi r17, 0x50 ; 80 34d2e: c7 eb ldi r28, 0xB7 ; 183 34d30: d0 e5 ldi r29, 0x50 ; 80 34d32: 00 e0 ldi r16, 0x00 ; 0 34d34: 06 c0 rjmp .+12 ; 0x34d42 <__do_global_dtors+0x16> 34d36: 80 2f mov r24, r16 34d38: fe 01 movw r30, r28 34d3a: 0f 94 ec a0 call 0x341d8 ; 0x341d8 <__tablejump2__> 34d3e: 21 96 adiw r28, 0x01 ; 1 34d40: 01 1d adc r16, r1 34d42: c8 3b cpi r28, 0xB8 ; 184 34d44: d1 07 cpc r29, r17 34d46: 80 e0 ldi r24, 0x00 ; 0 34d48: 08 07 cpc r16, r24 34d4a: a9 f7 brne .-22 ; 0x34d36 <__do_global_dtors+0xa> 34d4c: f8 94 cli 00034d4e <__stop_program>: 34d4e: ff cf rjmp .-2 ; 0x34d4e <__stop_program>