MK25S-RAMBo13a_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 c0 74 jmp 0xe980 ; 0xe980 <__vector_12> 34: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 38: 0d 94 59 15 jmp 0x22ab2 ; 0x22ab2 <__vector_14> 3c: 0d 94 9d 12 jmp 0x2253a ; 0x2253a <__vector_15> 40: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 44: 0d 94 f6 22 jmp 0x245ec ; 0x245ec <__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 39 6d jmp 0xda72 ; 0xda72 <__vector_23> 60: 0c 94 e9 50 jmp 0xa1d2 ; 0xa1d2 <__bad_interrupt> 64: 0d 94 04 9a jmp 0x33408 ; 0x33408 <__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 6f 7d jmp 0xfade ; 0xfade <__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 a7 17 jmp 0x22f4e ; 0x22f4e <__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 c0 99 jmp 0x33380 ; 0x33380 <__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 e5 0d jmp 0x21bca ; 0x21bca <__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 c7 0d jmp 0x21b8e ; 0x21b8e <__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 87 0d jmp 0x21b0e ; 0x21b0e <__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: 0d 94 1b 05 jmp 0x20a36 ; 0x20a36 6d56: 0c 94 ae c0 jmp 0x1815c ; 0x1815c 6d5a: 0c 94 b2 b3 jmp 0x16764 ; 0x16764 6d5e: 0c 94 cb fc jmp 0x1f996 ; 0x1f996 6d62: 0d 94 0c 32 jmp 0x26418 ; 0x26418 6d66: 0c 94 ea b0 jmp 0x161d4 ; 0x161d4 6d6a: 0c 94 c1 b0 jmp 0x16182 ; 0x16182 6d6e: 0d 94 6c 07 jmp 0x20ed8 ; 0x20ed8 6d72: 0c 94 c7 bb jmp 0x1778e ; 0x1778e 6d76: 0c 94 25 b5 jmp 0x16a4a ; 0x16a4a ()> 6d7a: 0c 94 78 ef jmp 0x1def0 ; 0x1def0 6d7e: 0d 94 07 07 jmp 0x20e0e ; 0x20e0e 6d82: 0d 94 c2 07 jmp 0x20f84 ; 0x20f84 6d86: 0c 94 04 f7 jmp 0x1ee08 ; 0x1ee08 6d8a: 0d 94 fc 12 jmp 0x225f8 ; 0x225f8 6d8e: 0d 94 f9 11 jmp 0x223f2 ; 0x223f2 6d92: 0d 94 ca 2f jmp 0x25f94 ; 0x25f94 6d96: 0d 94 2f 32 jmp 0x2645e ; 0x2645e 6d9a: 0c 94 b3 b0 jmp 0x16166 ; 0x16166 6d9e: 0d 94 73 09 jmp 0x212e6 ; 0x212e6 6da2: 0c 94 ca ba jmp 0x17594 ; 0x17594 6da6: 0c 94 20 fd jmp 0x1fa40 ; 0x1fa40 6daa: 0c 94 d0 bb jmp 0x177a0 ; 0x177a0 6dae: 0c 94 18 c1 jmp 0x18230 ; 0x18230 6db2: 0c 94 21 e3 jmp 0x1c642 ; 0x1c642 6db6: 0c 94 c4 fe jmp 0x1fd88 ; 0x1fd88 6dba: 0c 94 0c b5 jmp 0x16a18 ; 0x16a18 ()> 6dbe: 0d 94 8b 3a jmp 0x27516 ; 0x27516 6dc2: 0c 94 af fe jmp 0x1fd5e ; 0x1fd5e 6dc6: 0c 94 6d fe jmp 0x1fcda ; 0x1fcda 6dca: 0d 94 10 30 jmp 0x26020 ; 0x26020 6dce: 0c 94 8b 6d jmp 0xdb16 ; 0xdb16 <__vector_23+0xa4> 6dd2: 0c 94 94 b6 jmp 0x16d28 ; 0x16d28 6dd6: 0c 94 c5 b0 jmp 0x1618a ; 0x1618a 6dda: 0c 94 3c c6 jmp 0x18c78 ; 0x18c78 6dde: 0c 94 6d bc jmp 0x178da ; 0x178da 6de2: 0d 94 7d 11 jmp 0x222fa ; 0x222fa 6de6: 0c 94 2d e3 jmp 0x1c65a ; 0x1c65a 6dea: 0d 94 40 2f jmp 0x25e80 ; 0x25e80 6dee: 0c 94 38 ff jmp 0x1fe70 ; 0x1fe70 6df2: 0c 94 f1 ff jmp 0x1ffe2 ; 0x1ffe2 6df6: 0c 94 20 b5 jmp 0x16a40 ; 0x16a40 ()> 6dfa: 0c 94 a6 c0 jmp 0x1814c ; 0x1814c 6dfe: 0d 94 1f 32 jmp 0x2643e ; 0x2643e 6e02: 0c 94 eb fc jmp 0x1f9d6 ; 0x1f9d6 6e06: 0c 94 95 bc jmp 0x1792a ; 0x1792a 6e0a: 0c 94 66 ec jmp 0x1d8cc ; 0x1d8cc 6e0e: 0d 94 94 0c jmp 0x21928 ; 0x21928 6e12: 0c 94 b7 fc jmp 0x1f96e ; 0x1f96e 6e16: 0c 94 52 b7 jmp 0x16ea4 ; 0x16ea4 6e1a: 0c 94 1b f7 jmp 0x1ee36 ; 0x1ee36 6e1e: 0c 94 7e fe jmp 0x1fcfc ; 0x1fcfc 6e22: 0d 94 0e 05 jmp 0x20a1c ; 0x20a1c 6e26: 0d 94 2a 02 jmp 0x20454 ; 0x20454 6e2a: 0d 94 04 1e jmp 0x23c08 ; 0x23c08 6e2e: 0c 94 90 bb jmp 0x17720 ; 0x17720 6e32: 0c 94 ff fc jmp 0x1f9fe ; 0x1f9fe 6e36: 0d 94 26 12 jmp 0x2244c ; 0x2244c 6e3a: 0c 94 d1 c0 jmp 0x181a2 ; 0x181a2 6e3e: 0c 94 b3 c0 jmp 0x18166 ; 0x18166 6e42: 0d 94 27 32 jmp 0x2644e ; 0x2644e 6e46: 0c 94 f5 fc jmp 0x1f9ea ; 0x1f9ea 6e4a: 0d 94 bf 07 jmp 0x20f7e ; 0x20f7e 6e4e: 0c 94 11 b3 jmp 0x16622 ; 0x16622 6e52: 0c 94 84 6b jmp 0xd708 ; 0xd708 6e56: 0d 94 e6 3a jmp 0x275cc ; 0x275cc 6e5a: 0c 94 d4 ba jmp 0x175a8 ; 0x175a8 6e5e: 0c 94 5e b4 jmp 0x168bc ; 0x168bc 6e62: 0c 94 07 b5 jmp 0x16a0e ; 0x16a0e ()> 6e66: 0c 94 d2 b0 jmp 0x161a4 ; 0x161a4 6e6a: 0c 94 74 b6 jmp 0x16ce8 ; 0x16ce8 6e6e: 0d 94 84 64 jmp 0x2c908 ; 0x2c908 6e72: 0c 94 53 b5 jmp 0x16aa6 ; 0x16aa6 6e76: 0c 94 7c b4 jmp 0x168f8 ; 0x168f8 6e7a: 0c 94 09 fd jmp 0x1fa12 ; 0x1fa12 6e7e: 0d 94 7d 00 jmp 0x200fa ; 0x200fa 6e82: 0c 94 f3 b0 jmp 0x161e6 ; 0x161e6 6e86: 0d 94 fe 6a jmp 0x2d5fc ; 0x2d5fc 6e8a: 0c 94 b5 e9 jmp 0x1d36a ; 0x1d36a 6e8e: 0d 94 3b 31 jmp 0x26276 ; 0x26276 6e92: 0d 94 fc 64 jmp 0x2c9f8 ; 0x2c9f8 6e96: 0c 94 15 f0 jmp 0x1e02a ; 0x1e02a 6e9a: 0c 94 6d eb jmp 0x1d6da ; 0x1d6da 6e9e: 0d 94 31 30 jmp 0x26062 ; 0x26062 6ea2: 0d 94 6a 31 jmp 0x262d4 ; 0x262d4 6ea6: 0d 94 6a 11 jmp 0x222d4 ; 0x222d4 6eaa: 0c 94 40 c1 jmp 0x18280 ; 0x18280 6eae: 0c 94 a8 fe jmp 0x1fd50 ; 0x1fd50 6eb2: 0c 94 42 e3 jmp 0x1c684 ; 0x1c684 6eb6: 0c 94 91 b1 jmp 0x16322 ; 0x16322 6eba: 0c 94 31 fd jmp 0x1fa62 ; 0x1fa62 6ebe: 0d 94 60 2f jmp 0x25ec0 ; 0x25ec0 6ec2: 0c 94 ca bb jmp 0x17794 ; 0x17794 6ec6: 0c 94 79 bc jmp 0x178f2 ; 0x178f2 6eca: 0c 94 f5 c0 jmp 0x181ea ; 0x181ea 6ece: 0d 94 17 32 jmp 0x2642e ; 0x2642e 6ed2: 0d 94 0f 32 jmp 0x2641e ; 0x2641e 6ed6: 0c 94 df fc jmp 0x1f9be ; 0x1f9be 6eda: 0c 94 d5 fc jmp 0x1f9aa ; 0x1f9aa 6ede: 0c 94 7d 6d jmp 0xdafa ; 0xdafa <__vector_23+0x88> 6ee2: 0d 94 a4 01 jmp 0x20348 ; 0x20348 6ee6: 0c 94 0e e8 jmp 0x1d01c ; 0x1d01c 6eea: 0d 94 fe 06 jmp 0x20dfc ; 0x20dfc 6eee: 0c 94 c7 c0 jmp 0x1818e ; 0x1818e 6ef2: 0c 94 06 f7 jmp 0x1ee0c ; 0x1ee0c 6ef6: 0c 94 cd bb jmp 0x1779a ; 0x1779a 6efa: 0d 94 7e 02 jmp 0x204fc ; 0x204fc 6efe: 0c 94 23 f8 jmp 0x1f046 ; 0x1f046 6f02: 0d 94 6c 2f jmp 0x25ed8 ; 0x25ed8 6f06: 0d 94 3f 32 jmp 0x2647e ; 0x2647e 6f0a: 0d 94 e2 6a jmp 0x2d5c4 ; 0x2d5c4 6f0e: 0d 94 cd 0a jmp 0x2159a ; 0x2159a 6f12: 0d 94 6b 96 jmp 0x32cd6 ; 0x32cd6 6f16: 0c 94 8c ef jmp 0x1df18 ; 0x1df18 6f1a: 0c 94 00 b1 jmp 0x16200 ; 0x16200 6f1e: 0d 94 3d 03 jmp 0x2067a ; 0x2067a 6f22: 0c 94 36 c1 jmp 0x1826c ; 0x1826c 6f26: 0c 94 48 e9 jmp 0x1d290 ; 0x1d290 6f2a: 0c 94 1d b3 jmp 0x1663a ; 0x1663a 6f2e: 0d 94 64 94 jmp 0x328c8 ; 0x328c8 <_menu_edit_P()> 6f32: 0d 94 4f 32 jmp 0x2649e ; 0x2649e 6f36: 0d 94 d2 31 jmp 0x263a4 ; 0x263a4 6f3a: 0c 94 65 bc jmp 0x178ca ; 0x178ca 6f3e: 0c 94 30 e3 jmp 0x1c660 ; 0x1c660 6f42: 0d 94 37 32 jmp 0x2646e ; 0x2646e 6f46: 0d 94 08 10 jmp 0x22010 ; 0x22010 6f4a: 0d 94 0a 12 jmp 0x22414 ; 0x22414 6f4e: 0c 94 eb c0 jmp 0x181d6 ; 0x181d6 6f52: 0d 94 df 64 jmp 0x2c9be ; 0x2c9be 6f56: 0c 94 0f fe jmp 0x1fc1e ; 0x1fc1e 6f5a: 0c 94 26 fe jmp 0x1fc4c ; 0x1fc4c 6f5e: 0c 94 a1 6d jmp 0xdb42 ; 0xdb42 <__vector_23+0xd0> 6f62: 0d 94 96 22 jmp 0x2452c ; 0x2452c 6f66: 0c 94 b9 e9 jmp 0x1d372 ; 0x1d372 6f6a: 0c 94 f8 b0 jmp 0x161f0 ; 0x161f0 6f6e: 0c 94 03 fe jmp 0x1fc06 ; 0x1fc06 6f72: 0d 94 67 0f jmp 0x21ece ; 0x21ece 6f76: 0d 94 ea 01 jmp 0x203d4 ; 0x203d4 6f7a: 0d 94 24 1d jmp 0x23a48 ; 0x23a48 6f7e: 0d 94 16 05 jmp 0x20a2c ; 0x20a2c 6f82: 0c 94 a1 ea jmp 0x1d542 ; 0x1d542 6f86: 0c 94 1a c6 jmp 0x18c34 ; 0x18c34 6f8a: 0d 94 f5 06 jmp 0x20dea ; 0x20dea 6f8e: 0c 94 0f eb jmp 0x1d61e ; 0x1d61e 6f92: 0c 94 cd 6d jmp 0xdb9a ; 0xdb9a <__vector_23+0x128> 6f96: 0c 94 2c b3 jmp 0x16658 ; 0x16658 6f9a: 0c 94 97 b1 jmp 0x1632e ; 0x1632e 6f9e: 0c 94 84 bc jmp 0x17908 ; 0x17908 6fa2: 0d 94 a6 31 jmp 0x2634c ; 0x2634c 6fa6: 0c 94 d9 c0 jmp 0x181b2 ; 0x181b2 6faa: 0d 94 e5 02 jmp 0x205ca ; 0x205ca 6fae: 0d 94 03 65 jmp 0x2ca06 ; 0x2ca06 6fb2: 0c 94 55 bc jmp 0x178aa ; 0x178aa 6fb6: 0c 94 38 b3 jmp 0x16670 ; 0x16670 6fba: 0d 94 36 0e jmp 0x21c6c ; 0x21c6c 6fbe: 0c 94 02 ff jmp 0x1fe04 ; 0x1fe04 6fc2: 0c 94 a5 f7 jmp 0x1ef4a ; 0x1ef4a 6fc6: 0d 94 60 05 jmp 0x20ac0 ; 0x20ac0 6fca: 0d 94 fc 2f jmp 0x25ff8 ; 0x25ff8 6fce: 0c 94 b6 fe jmp 0x1fd6c ; 0x1fd6c 6fd2: 0d 94 01 6b jmp 0x2d602 ; 0x2d602 6fd6: 0c 94 16 b5 jmp 0x16a2c ; 0x16a2c ()> 6fda: 0c 94 cc b5 jmp 0x16b98 ; 0x16b98 6fde: 0d 94 b0 2f jmp 0x25f60 ; 0x25f60 6fe2: 0d 94 57 32 jmp 0x264ae ; 0x264ae 6fe6: 0c 94 d6 bb jmp 0x177ac ; 0x177ac 6fea: 0c 94 df bb jmp 0x177be ; 0x177be 6fee: 0c 94 0e c1 jmp 0x1821c ; 0x1821c 6ff2: 0c 94 5f fd jmp 0x1fabe ; 0x1fabe 6ff6: 0d 94 67 32 jmp 0x264ce ; 0x264ce 6ffa: 0c 94 bd c0 jmp 0x1817a ; 0x1817a 6ffe: 0d 94 13 6b jmp 0x2d626 ; 0x2d626 7002: 0c 94 0b eb jmp 0x1d616 ; 0x1d616 7006: 0c 94 36 e3 jmp 0x1c66c ; 0x1c66c 700a: 0d 94 0e 6b jmp 0x2d61c ; 0x2d61c 700e: 0c 94 43 b3 jmp 0x16686 ; 0x16686 7012: 0c 94 c8 b0 jmp 0x16190 ; 0x16190 7016: 0c 94 2c c1 jmp 0x18258 ; 0x18258 701a: 0c 94 6b fe jmp 0x1fcd6 ; 0x1fcd6 701e: 0d 94 c6 11 jmp 0x2238c ; 0x2238c 7022: 0c 94 ce b0 jmp 0x1619c ; 0x1619c 7026: 0d 94 06 32 jmp 0x2640c ; 0x2640c 702a: 0c 94 ff ba jmp 0x175fe ; 0x175fe 702e: 0c 94 df 6d jmp 0xdbbe ; 0xdbbe <__vector_23+0x14c> 7032: 0d 94 ff 64 jmp 0x2c9fe ; 0x2c9fe 7036: 0d 94 f3 2f jmp 0x25fe6 ; 0x25fe6 703a: 0c 94 22 c1 jmp 0x18244 ; 0x18244 703e: 0d 94 60 31 jmp 0x262c0 ; 0x262c0 7042: 0c 94 f4 b0 jmp 0x161e8 ; 0x161e8 7046: 0c 94 5f b0 jmp 0x160be ; 0x160be 704a: 0c 94 00 e3 jmp 0x1c600 ; 0x1c600 704e: 0c 94 33 e3 jmp 0x1c666 ; 0x1c666 7052: 0c 94 90 e6 jmp 0x1cd20 ; 0x1cd20 7056: 0c 94 0b f8 jmp 0x1f016 ; 0x1f016 705a: 0d 94 cf 40 jmp 0x2819e ; 0x2819e 705e: 0d 94 d8 31 jmp 0x263b0 ; 0x263b0 7062: 0c 94 1b fe jmp 0x1fc36 ; 0x1fc36 7066: 0c 94 bd fe jmp 0x1fd7a ; 0x1fd7a 706a: 0c 94 aa 6d jmp 0xdb54 ; 0xdb54 <__vector_23+0xe2> 706e: 0c 94 ff c3 jmp 0x187fe ; 0x187fe 7072: 0c 94 ff c0 jmp 0x181fe ; 0x181fe 7076: 0c 94 e6 b0 jmp 0x161cc ; 0x161cc 707a: 0c 94 69 b5 jmp 0x16ad2 ; 0x16ad2 707e: 0d 94 e5 2f jmp 0x25fca ; 0x25fca 7082: 0d 94 6d 31 jmp 0x262da ; 0x262da 7086: 0c 94 4d 5e jmp 0xbc9a ; 0xbc9a <_GLOBAL__sub_D_card> 708a: 0c 94 4b 70 jmp 0xe096 ; 0xe096 708e: 0d 94 d5 31 jmp 0x263aa ; 0x263aa 7092: 0c 94 93 bc jmp 0x17926 ; 0x17926 7096: 0c 94 e8 e2 jmp 0x1c5d0 ; 0x1c5d0 709a: 0c 94 ee b0 jmp 0x161dc ; 0x161dc 709e: 0c 94 11 b5 jmp 0x16a22 ; 0x16a22 ()> 70a2: 0c 94 fc b0 jmp 0x161f8 ; 0x161f8 70a6: 0d 94 76 2f jmp 0x25eec ; 0x25eec 70aa: 0c 94 5d bc jmp 0x178ba ; 0x178ba 70ae: 0c 94 30 6f jmp 0xde60 ; 0xde60 70b2: 0c 94 73 fc jmp 0x1f8e6 ; 0x1f8e6 70b6: 0d 94 47 32 jmp 0x2648e ; 0x2648e 70ba: 0c 94 d3 bb jmp 0x177a6 ; 0x177a6 70be: 0d 94 db 2f jmp 0x25fb6 ; 0x25fb6 70c2: 0c 94 48 fe jmp 0x1fc90 ; 0x1fc90 70c6: 0c 94 72 6d jmp 0xdae4 ; 0xdae4 <__vector_23+0x72> 70ca: 0d 94 9c 6a jmp 0x2d538 ; 0x2d538 70ce: 0c 94 02 b5 jmp 0x16a04 ; 0x16a04 ()> 70d2: 0c 94 dc b0 jmp 0x161b8 ; 0x161b8 70d6: 0d 94 63 31 jmp 0x262c6 ; 0x262c6 70da: 0c 94 64 fe jmp 0x1fcc8 ; 0x1fcc8 70de: 0c 94 4a ea jmp 0x1d494 ; 0x1d494 70e2: 0d 94 05 6b jmp 0x2d60a ; 0x2d60a 70e6: 0c 94 e0 b0 jmp 0x161c0 ; 0x161c0 70ea: 0d 94 9d 64 jmp 0x2c93a ; 0x2c93a 70ee: 0c 94 dc e2 jmp 0x1c5b8 ; 0x1c5b8 70f2: 0c 94 e5 b5 jmp 0x16bca ; 0x16bca 70f6: 0d 94 7f 04 jmp 0x208fe ; 0x208fe 70fa: 0c 94 b9 b0 jmp 0x16172 ; 0x16172 70fe: 0d 94 5f 32 jmp 0x264be ; 0x264be 7102: 0d 94 e1 2f jmp 0x25fc2 ; 0x25fc2 7106: 0c 94 44 ba jmp 0x17488 ; 0x17488 710a: 0c 94 bd b0 jmp 0x1617a ; 0x1617a 710e: 0c 94 c1 fc jmp 0x1f982 ; 0x1f982 7112: 0d 94 09 32 jmp 0x26412 ; 0x26412 7116: 0d 94 51 0d jmp 0x21aa2 ; 0x21aa2 711a: 0c 94 ae b8 jmp 0x1715c ; 0x1715c 711e: 0c 94 e1 c0 jmp 0x181c2 ; 0x181c2 7122: 0c 94 08 e8 jmp 0x1d010 ; 0x1d010 7126: 0c 94 58 6d jmp 0xdab0 ; 0xdab0 <__vector_23+0x3e> 712a: 0c 94 1b b5 jmp 0x16a36 ; 0x16a36 ()> 712e: 0d 94 23 31 jmp 0x26246 ; 0x26246 7132: 0d 94 3a 01 jmp 0x20274 ; 0x20274 7136: 0c 94 d8 b0 jmp 0x161b0 ; 0x161b0 713a: 0c 94 98 bc jmp 0x17930 ; 0x17930 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 33 61 2d 45 33 44 76 36 66 75 6c 6c 00 Bo13a-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 33 61 00 RAMBo13a. 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: 2d 38 cpi r18, 0x8D ; 141 0000a16e <__ctors_end>: a16e: 4d 5e subi r20, 0xED ; 237 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: ee ec ldi r30, 0xCE ; 206 a188: fe e4 ldi r31, 0x4E ; 78 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 ab a1 call 0x34356 ; 0x34356 <__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 9c d8 call 0x1b138 ; 0x1b138
a1ce: 0d 94 55 a7 jmp 0x34eaa ; 0x34eaa <__do_global_dtors> 0000a1d2 <__bad_interrupt>: a1d2: 0c 94 b8 74 jmp 0xe970 ; 0xe970 <__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 54 9d call 0x33aa8 ; 0x33aa8 <__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 03 9f call 0x33e06 ; 0x33e06 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 03 9f call 0x33e06 ; 0x33e06 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 03 9f call 0x33e06 ; 0x33e06 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 03 9f call 0x33e06 ; 0x33e06 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 03 9f call 0x33e06 ; 0x33e06 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 03 9f call 0x33e06 ; 0x33e06 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 03 9f call 0x33e06 ; 0x33e06 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 03 9f call 0x33e06 ; 0x33e06 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 03 9f call 0x33e06 ; 0x33e06 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 03 9f call 0x33e06 ; 0x33e06 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 03 9f call 0x33e06 ; 0x33e06 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 03 9f call 0x33e06 ; 0x33e06 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 03 9f call 0x33e06 ; 0x33e06 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 03 9f call 0x33e06 ; 0x33e06 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 03 9f call 0x33e06 ; 0x33e06 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 03 9f call 0x33e06 ; 0x33e06 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 97 9e call 0x33d2e ; 0x33d2e 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 bc 9e call 0x33d78 ; 0x33d78 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 03 9f call 0x33e06 ; 0x33e06 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 03 9f call 0x33e06 ; 0x33e06 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 2a a0 call 0x34054 ; 0x34054 <__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 03 9f call 0x33e06 ; 0x33e06 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 03 9f call 0x33e06 ; 0x33e06 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 03 9f call 0x33e06 ; 0x33e06 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 2a a0 call 0x34054 ; 0x34054 <__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 03 9f call 0x33e06 ; 0x33e06 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 03 9f call 0x33e06 ; 0x33e06 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 03 9f call 0x33e06 ; 0x33e06 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 b8 a2 call 0x34570 ; 0x34570 <__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 5d 9f call 0x33eba ; 0x33eba 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 9b a0 call 0x34136 ; 0x34136 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 f2 a6 call 0x34de4 ; 0x34de4 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 26 9c call 0x3384c ; 0x3384c 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 26 9c call 0x3384c ; 0x3384c 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 5d 9f call 0x33eba ; 0x33eba 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 9b a0 jmp 0x34136 ; 0x34136 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 26 9c jmp 0x3384c ; 0x3384c 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 bf a0 call 0x3417e ; 0x3417e ab46: 60 e0 ldi r22, 0x00 ; 0 ab48: 88 e6 ldi r24, 0x68 ; 104 ab4a: 9f e0 ldi r25, 0x0F ; 15 ab4c: 0f 94 bf a0 call 0x3417e ; 0x3417e ab50: 60 e0 ldi r22, 0x00 ; 0 ab52: 85 e6 ldi r24, 0x65 ; 101 ab54: 9f e0 ldi r25, 0x0F ; 15 ab56: 0f 94 bf a0 call 0x3417e ; 0x3417e ab5a: 60 e0 ldi r22, 0x00 ; 0 ab5c: 84 e6 ldi r24, 0x64 ; 100 ab5e: 9f e0 ldi r25, 0x0F ; 15 ab60: 0f 94 bf a0 call 0x3417e ; 0x3417e ab64: 60 e0 ldi r22, 0x00 ; 0 ab66: 82 ed ldi r24, 0xD2 ; 210 ab68: 9e e0 ldi r25, 0x0E ; 14 ab6a: 0f 94 bf a0 call 0x3417e ; 0x3417e ab6e: 60 e0 ldi r22, 0x00 ; 0 ab70: 8f ec ldi r24, 0xCF ; 207 ab72: 9e e0 ldi r25, 0x0E ; 14 ab74: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 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 cd a6 call 0x34d9a ; 0x34d9a // 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 29 9b call 0x33652 ; 0x33652 <__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 29 9b call 0x33652 ; 0x33652 <__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 4c a4 call 0x34898 ; 0x34898 <__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 c2 a1 call 0x34384 ; 0x34384 <__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 c2 a1 call 0x34384 ; 0x34384 <__subsf3> adb6: a5 01 movw r20, r10 adb8: 94 01 movw r18, r8 adba: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__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 c3 a1 call 0x34386 ; 0x34386 <__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 c2 a1 call 0x34384 ; 0x34384 <__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 68 9b call 0x336d0 ; 0x336d0 <__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 68 9b call 0x336d0 ; 0x336d0 <__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 c2 a1 call 0x34384 ; 0x34384 <__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 68 9b call 0x336d0 ; 0x336d0 <__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 c3 a1 call 0x34386 ; 0x34386 <__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 c2 a1 call 0x34384 ; 0x34384 <__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 c2 a2 call 0x34584 ; 0x34584 <__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 b8 a2 call 0x34570 ; 0x34570 <__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 4c a4 call 0x34898 ; 0x34898 <__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 b8 a2 call 0x34570 ; 0x34570 <__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 c2 a1 call 0x34384 ; 0x34384 <__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 33 a5 call 0x34a66 ; 0x34a66 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 c2 a1 call 0x34384 ; 0x34384 <__subsf3> b1a6: a3 01 movw r20, r6 b1a8: 92 01 movw r18, r4 b1aa: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__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 c3 a1 call 0x34386 ; 0x34386 <__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 68 9b call 0x336d0 ; 0x336d0 <__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 68 9b call 0x336d0 ; 0x336d0 <__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 c3 a1 call 0x34386 ; 0x34386 <__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 c2 a2 call 0x34584 ; 0x34584 <__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 c2 a1 call 0x34384 ; 0x34384 <__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 68 9b call 0x336d0 ; 0x336d0 <__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 c2 a1 call 0x34384 ; 0x34384 <__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 68 9b call 0x336d0 ; 0x336d0 <__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 c2 a2 call 0x34584 ; 0x34584 <__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 68 9b call 0x336d0 ; 0x336d0 <__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 68 9b call 0x336d0 ; 0x336d0 <__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 68 9b call 0x336d0 ; 0x336d0 <__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 68 9b call 0x336d0 ; 0x336d0 <__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 c3 a1 call 0x34386 ; 0x34386 <__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 c3 a1 call 0x34386 ; 0x34386 <__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 c3 a1 call 0x34386 ; 0x34386 <__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 a9 a0 call 0x34152 ; 0x34152 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 6a 6b jmp 0x2d6d4 ; 0x2d6d4 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 ad 6b jmp 0x2d75a ; 0x2d75a 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 9b a0 call 0x34136 ; 0x34136 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 73 54 call 0x2a8e6 ; 0x2a8e6 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 2a 6c jmp 0x2d854 ; 0x2d854 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 2c 9e call 0x33c58 ; 0x33c58 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 62 9e call 0x33cc4 ; 0x33cc4 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 62 9e call 0x33cc4 ; 0x33cc4 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 30 a1 call 0x34260 ; 0x34260 <__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 27 9b call 0x3364e ; 0x3364e <__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 b8 a2 call 0x34570 ; 0x34570 <__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 68 9b call 0x336d0 ; 0x336d0 <__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 b8 a2 call 0x34570 ; 0x34570 <__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 b8 a2 call 0x34570 ; 0x34570 <__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 c2 a1 call 0x34384 ; 0x34384 <__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 68 9b call 0x336d0 ; 0x336d0 <__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 c3 a1 call 0x34386 ; 0x34386 <__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 b8 a2 call 0x34570 ; 0x34570 <__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 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> b7f8: 8d 2d mov r24, r13 b7fa: 0f 94 1b 22 call 0x24436 ; 0x24436 //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 4c a4 call 0x34898 ; 0x34898 <__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 4c a4 call 0x34898 ; 0x34898 <__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 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> b8b0: 8d 2d mov r24, r13 b8b2: 0f 94 1b 22 call 0x24436 ; 0x24436 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 c2 a1 call 0x34384 ; 0x34384 <__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 c2 a2 call 0x34584 ; 0x34584 <__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 68 9b call 0x336d0 ; 0x336d0 <__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 68 9b call 0x336d0 ; 0x336d0 <__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 c2 a1 call 0x34384 ; 0x34384 <__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 c3 a1 call 0x34386 ; 0x34386 <__addsf3> st_current_set(i, tmp_motor[i]); b948: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> b94c: 8b 8d ldd r24, Y+27 ; 0x1b b94e: 0f 94 1b 22 call 0x24436 ; 0x24436 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 03 9f jmp 0x33e06 ; 0x33e06 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: 84 ff sbrs r24, 4 b9a8: 18 c0 rjmp .+48 ; 0xb9da b9aa: 5a 9a sbi 0x0b, 2 ; 11 WRITE(LCD_PINS_D5, value & 0x20); b9ac: 85 ff sbrs r24, 5 b9ae: 17 c0 rjmp .+46 ; 0xb9de b9b0: a4 9a sbi 0x14, 4 ; 20 WRITE(LCD_PINS_D6, value & 0x40); b9b2: 2f b7 in r18, 0x3f ; 63 b9b4: 86 ff sbrs r24, 6 b9b6: 15 c0 rjmp .+42 ; 0xb9e2 b9b8: f8 94 cli b9ba: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> b9be: 90 68 ori r25, 0x80 ; 128 b9c0: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> b9c4: 2f bf out 0x3f, r18 ; 63 WRITE(LCD_PINS_D7, value & 0x80); b9c6: 87 ff sbrs r24, 7 b9c8: 11 c0 rjmp .+34 ; 0xb9ec b9ca: a3 9a sbi 0x14, 3 ; 20 static void lcd_print_custom(uint8_t c); static void lcd_invalidate_custom_characters(); static void lcd_pulseEnable(void) { WRITE(LCD_PINS_ENABLE,HIGH); b9cc: 5b 9a sbi 0x0b, 3 ; 11 #else //round up by default __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); #endif __builtin_avr_delay_cycles(__ticks_dc); b9ce: 85 e0 ldi r24, 0x05 ; 5 b9d0: 8a 95 dec r24 b9d2: f1 f7 brne .-4 ; 0xb9d0 b9d4: 00 00 nop _delay_us(1); // enable pulse must be >450ns WRITE(LCD_PINS_ENABLE,LOW); b9d6: 5b 98 cbi 0x0b, 3 ; 11 WRITE(LCD_PINS_D5, value & 0x20); WRITE(LCD_PINS_D6, value & 0x40); WRITE(LCD_PINS_D7, value & 0x80); lcd_pulseEnable(); } b9d8: 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); b9da: 5a 98 cbi 0x0b, 2 ; 11 b9dc: e7 cf rjmp .-50 ; 0xb9ac WRITE(LCD_PINS_D5, value & 0x20); b9de: a4 98 cbi 0x14, 4 ; 20 b9e0: e8 cf rjmp .-48 ; 0xb9b2 WRITE(LCD_PINS_D6, value & 0x40); b9e2: f8 94 cli b9e4: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> b9e8: 9f 77 andi r25, 0x7F ; 127 b9ea: ea cf rjmp .-44 ; 0xb9c0 WRITE(LCD_PINS_D7, value & 0x80); b9ec: a3 98 cbi 0x14, 3 ; 20 b9ee: ee cf rjmp .-36 ; 0xb9cc 0000b9f0 : lcd_pulseEnable(); } static void lcd_send(uint8_t data, uint8_t flags, uint16_t duration = LCD_DEFAULT_DELAY) { b9f0: 0f 93 push r16 b9f2: 1f 93 push r17 b9f4: cf 93 push r28 b9f6: df 93 push r29 b9f8: c8 2f mov r28, r24 b9fa: d6 2f mov r29, r22 b9fc: 8a 01 movw r16, r20 WRITE(LCD_PINS_RS,flags&LCD_RS_FLAG); b9fe: 60 ff sbrs r22, 0 ba00: 15 c0 rjmp .+42 ; 0xba2c ba02: 5d 9a sbi 0x0b, 5 ; 11 ba04: 8a e1 ldi r24, 0x1A ; 26 ba06: 8a 95 dec r24 ba08: f1 f7 brne .-4 ; 0xba06 ba0a: 00 c0 rjmp .+0 ; 0xba0c _delay_us(5); lcd_writebits(data); ba0c: 8c 2f mov r24, r28 ba0e: 0e 94 d3 5c call 0xb9a6 ; 0xb9a6 #ifndef LCD_8BIT if (!(flags & LCD_HALF_FLAG)) { ba12: d1 fd sbrc r29, 1 ba14: 04 c0 rjmp .+8 ; 0xba1e // _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 ba16: 8c 2f mov r24, r28 ba18: 82 95 swap r24 ba1a: 0e 94 d3 5c call 0xb9a6 ; 0xb9a6 } #endif delayMicroseconds(duration); ba1e: c8 01 movw r24, r16 } ba20: df 91 pop r29 ba22: cf 91 pop r28 ba24: 1f 91 pop r17 ba26: 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); ba28: 0c 94 db bf jmp 0x17fb6 ; 0x17fb6 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); ba2c: 5d 98 cbi 0x0b, 5 ; 11 ba2e: ea cf rjmp .-44 ; 0xba04 0000ba30 : return def; } return val; } void __attribute__((noinline)) eeprom_init_default_float(float *__p, float def) { ba30: cf 92 push r12 ba32: df 92 push r13 ba34: ef 92 push r14 ba36: ff 92 push r15 ba38: cf 93 push r28 ba3a: df 93 push r29 ba3c: ec 01 movw r28, r24 ba3e: 6a 01 movw r12, r20 ba40: 7b 01 movw r14, r22 if (eeprom_read_dword((uint32_t*)__p) == EEPROM_EMPTY_VALUE32) ba42: 0f 94 a3 a0 call 0x34146 ; 0x34146 ba46: 6f 3f cpi r22, 0xFF ; 255 ba48: 7f 4f sbci r23, 0xFF ; 255 ba4a: 8f 4f sbci r24, 0xFF ; 255 ba4c: 9f 4f sbci r25, 0xFF ; 255 ba4e: 59 f4 brne .+22 ; 0xba66 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); ba50: b7 01 movw r22, r14 ba52: a6 01 movw r20, r12 ba54: 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); } ba56: df 91 pop r29 ba58: cf 91 pop r28 ba5a: ff 90 pop r15 ba5c: ef 90 pop r14 ba5e: df 90 pop r13 ba60: 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); ba62: 0d 94 f1 a0 jmp 0x341e2 ; 0x341e2 } 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); } ba66: df 91 pop r29 ba68: cf 91 pop r28 ba6a: ff 90 pop r15 ba6c: ef 90 pop r14 ba6e: df 90 pop r13 ba70: cf 90 pop r12 ba72: 08 95 ret 0000ba74 : } } void dcode_core(daddr_t addr_start, const daddr_t addr_end, const dcode_mem_t type, uint8_t dcode, const char* type_desc) { ba74: 7f 92 push r7 ba76: 8f 92 push r8 ba78: 9f 92 push r9 ba7a: af 92 push r10 ba7c: bf 92 push r11 ba7e: cf 92 push r12 ba80: df 92 push r13 ba82: ef 92 push r14 ba84: ff 92 push r15 ba86: 0f 93 push r16 ba88: 1f 93 push r17 ba8a: cf 93 push r28 ba8c: df 93 push r29 ba8e: cd b7 in r28, 0x3d ; 61 ba90: de b7 in r29, 0x3e ; 62 ba92: 60 97 sbiw r28, 0x10 ; 16 ba94: 0f b6 in r0, 0x3f ; 63 ba96: f8 94 cli ba98: de bf out 0x3e, r29 ; 62 ba9a: 0f be out 0x3f, r0 ; 63 ba9c: cd bf out 0x3d, r28 ; 61 ba9e: 5c 01 movw r10, r24 baa0: 6b 01 movw r12, r22 baa2: 74 2e mov r7, r20 KEEPALIVE_STATE(NOT_BUSY); baa4: 81 e0 ldi r24, 0x01 ; 1 baa6: 80 93 78 02 sts 0x0278, r24 ; 0x800278 DBG(_N("D%d - Read/Write %S\n"), dcode, type_desc); baaa: 1f 93 push r17 baac: 0f 93 push r16 baae: 1f 92 push r1 bab0: 2f 93 push r18 bab2: 8d e7 ldi r24, 0x7D ; 125 bab4: 93 e6 ldi r25, 0x63 ; 99 bab6: 9f 93 push r25 bab8: 8f 93 push r24 baba: 0f 94 5d 9f call 0x33eba ; 0x33eba daddr_t count = -1; // RW the entire space by default if (code_seen('A')) babe: 81 e4 ldi r24, 0x41 ; 65 bac0: 0e 94 2b 55 call 0xaa56 ; 0xaa56 bac4: 0f 90 pop r0 bac6: 0f 90 pop r0 bac8: 0f 90 pop r0 baca: 0f 90 pop r0 bacc: 0f 90 pop r0 bace: 0f 90 pop r0 bad0: 88 23 and r24, r24 bad2: 89 f0 breq .+34 ; 0xbaf6 addr_start = (strchr_pointer[1] == 'x')?strtol(strchr_pointer + 2, 0, 16):(int)code_value(); bad4: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 bad8: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 badc: fc 01 movw r30, r24 bade: 21 81 ldd r18, Z+1 ; 0x01 bae0: 28 37 cpi r18, 0x78 ; 120 bae2: 09 f0 breq .+2 ; 0xbae6 bae4: 56 c0 rjmp .+172 ; 0xbb92 bae6: 40 e1 ldi r20, 0x10 ; 16 bae8: 50 e0 ldi r21, 0x00 ; 0 baea: 70 e0 ldi r23, 0x00 ; 0 baec: 60 e0 ldi r22, 0x00 ; 0 baee: 02 96 adiw r24, 0x02 ; 2 baf0: 0f 94 26 9c call 0x3384c ; 0x3384c baf4: 5b 01 movw r10, r22 if (code_seen('C')) baf6: 83 e4 ldi r24, 0x43 ; 67 baf8: 0e 94 2b 55 call 0xaa56 ; 0xaa56 bafc: 88 23 and r24, r24 bafe: 09 f4 brne .+2 ; 0xbb02 bb00: 4d c0 rjmp .+154 ; 0xbb9c count = code_value_long(); bb02: 0e 94 93 55 call 0xab26 ; 0xab26 bb06: 4b 01 movw r8, r22 bb08: 75 01 movw r14, r10 bb0a: ca 14 cp r12, r10 bb0c: db 04 cpc r13, r11 bb0e: 08 f4 brcc .+2 ; 0xbb12 bb10: 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) bb12: c4 01 movw r24, r8 bb14: 8e 0d add r24, r14 bb16: 9f 1d adc r25, r15 bb18: c8 16 cp r12, r24 bb1a: d9 06 cpc r13, r25 bb1c: 18 f0 brcs .+6 ; 0xbb24 bb1e: 8e 15 cp r24, r14 bb20: 9f 05 cpc r25, r15 bb22: 18 f4 brcc .+6 ; 0xbb2a count = addr_end - addr_start; bb24: 46 01 movw r8, r12 bb26: 8e 18 sub r8, r14 bb28: 9f 08 sbc r9, r15 if (code_seen('X')) bb2a: 88 e5 ldi r24, 0x58 ; 88 bb2c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 bb30: 88 23 and r24, r24 bb32: 09 f4 brne .+2 ; 0xbb36 bb34: 71 c0 rjmp .+226 ; 0xbc18 { uint8_t data[16]; count = parse_hex(strchr_pointer + 1, data, 16); bb36: 20 91 f5 16 lds r18, 0x16F5 ; 0x8016f5 bb3a: 30 91 f6 16 lds r19, 0x16F6 ; 0x8016f6 bb3e: 2f 5f subi r18, 0xFF ; 255 bb40: 3f 4f sbci r19, 0xFF ; 255 bb42: ce 01 movw r24, r28 bb44: 01 96 adiw r24, 0x01 ; 1 bb46: 5c 01 movw r10, r24 bb48: dc 01 movw r26, r24 print_hex_byte(val & 0xFF); } int parse_hex(const char* hex, uint8_t* data, int count) { int parsed = 0; bb4a: d1 2c mov r13, r1 bb4c: c1 2c mov r12, r1 bb4e: f9 01 movw r30, r18 while (*hex) bb50: 80 81 ld r24, Z bb52: 2f 5f subi r18, 0xFF ; 255 bb54: 3f 4f sbci r19, 0xFF ; 255 bb56: 88 23 and r24, r24 bb58: b9 f1 breq .+110 ; 0xbbc8 { if (count && (parsed >= count)) break; bb5a: 90 e1 ldi r25, 0x10 ; 16 bb5c: c9 16 cp r12, r25 bb5e: d1 04 cpc r13, r1 bb60: 99 f1 breq .+102 ; 0xbbc8 char c = *(hex++); if (c == ' ') continue; bb62: 80 32 cpi r24, 0x20 ; 32 bb64: a1 f3 breq .-24 ; 0xbb4e if (c == '\n') break; bb66: 8a 30 cpi r24, 0x0A ; 10 bb68: 79 f1 breq .+94 ; 0xbbc8 uint8_t val = 0x00; if ((c >= '0') && (c <= '9')) val |= ((c - '0') << 4); bb6a: 90 ed ldi r25, 0xD0 ; 208 bb6c: 98 0f add r25, r24 bb6e: 9a 30 cpi r25, 0x0A ; 10 bb70: c8 f4 brcc .+50 ; 0xbba4 bb72: 82 95 swap r24 bb74: 80 7f andi r24, 0xF0 ; 240 else if ((c >= 'a') && (c <= 'f')) val |= ((c - 'a' + 10) << 4); else return -parsed; c = *(hex++); bb76: 9f 01 movw r18, r30 bb78: 2e 5f subi r18, 0xFE ; 254 bb7a: 3f 4f sbci r19, 0xFF ; 255 if ((c >= '0') && (c <= '9')) val |= (c - '0'); bb7c: 91 81 ldd r25, Z+1 ; 0x01 bb7e: 40 ed ldi r20, 0xD0 ; 208 bb80: 49 0f add r20, r25 bb82: 4a 30 cpi r20, 0x0A ; 10 bb84: b8 f4 brcc .+46 ; 0xbbb4 bb86: 84 2b or r24, r20 else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); else return -parsed; data[parsed] = val; bb88: 8d 93 st X+, r24 parsed++; bb8a: ef ef ldi r30, 0xFF ; 255 bb8c: ce 1a sub r12, r30 bb8e: de 0a sbc r13, r30 bb90: de cf rjmp .-68 ; 0xbb4e { 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(); bb92: 0e 94 03 5a call 0xb406 ; 0xb406 bb96: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> bb9a: ac cf rjmp .-168 ; 0xbaf4 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 bb9c: 88 24 eor r8, r8 bb9e: 8a 94 dec r8 bba0: 98 2c mov r9, r8 bba2: b2 cf rjmp .-156 ; 0xbb08 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); bba4: 9f e9 ldi r25, 0x9F ; 159 bba6: 98 0f add r25, r24 bba8: 96 30 cpi r25, 0x06 ; 6 bbaa: 58 f4 brcc .+22 ; 0xbbc2 bbac: 82 95 swap r24 bbae: 80 7f andi r24, 0xF0 ; 240 bbb0: 80 57 subi r24, 0x70 ; 112 bbb2: e1 cf rjmp .-62 ; 0xbb76 else return -parsed; c = *(hex++); if ((c >= '0') && (c <= '9')) val |= (c - '0'); else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); bbb4: 4f e9 ldi r20, 0x9F ; 159 bbb6: 49 0f add r20, r25 bbb8: 46 30 cpi r20, 0x06 ; 6 bbba: 18 f4 brcc .+6 ; 0xbbc2 bbbc: 97 55 subi r25, 0x57 ; 87 bbbe: 89 2b or r24, r25 bbc0: e3 cf rjmp .-58 ; 0xbb88 else return -parsed; bbc2: d1 94 neg r13 bbc4: c1 94 neg r12 bbc6: 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++) bbc8: 91 2c mov r9, r1 bbca: 81 2c mov r8, r1 bbcc: c8 14 cp r12, r8 bbce: d9 04 cpc r13, r9 bbd0: 91 f0 breq .+36 ; 0xbbf6 bbd2: f5 01 movw r30, r10 bbd4: 61 91 ld r22, Z+ bbd6: 5f 01 movw r10, r30 bbd8: c4 01 movw r24, r8 bbda: 8e 0d add r24, r14 bbdc: 9f 1d adc r25, r15 { switch (type) bbde: f1 e0 ldi r31, 0x01 ; 1 bbe0: 7f 16 cp r7, r31 bbe2: 31 f0 breq .+12 ; 0xbbf0 { case dcode_mem_t::sram: *((uint8_t*)address) = data[i]; break; bbe4: fc 01 movw r30, r24 bbe6: 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++) bbe8: ff ef ldi r31, 0xFF ; 255 bbea: 8f 1a sub r8, r31 bbec: 9f 0a sbc r9, r31 bbee: ee cf rjmp .-36 ; 0xbbcc 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); bbf0: 0f 94 e3 a0 call 0x341c6 ; 0x341c6 bbf4: f9 cf rjmp .-14 ; 0xbbe8 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); bbf6: ff 92 push r15 bbf8: ef 92 push r14 bbfa: 1f 93 push r17 bbfc: 0f 93 push r16 bbfe: 9f 92 push r9 bc00: 8f 92 push r8 bc02: 83 e5 ldi r24, 0x53 ; 83 bc04: 93 e6 ldi r25, 0x63 ; 99 bc06: 9f 93 push r25 bc08: 8f 93 push r24 bc0a: 0f 94 5d 9f call 0x33eba ; 0x33eba bc0e: 0f b6 in r0, 0x3f ; 63 bc10: f8 94 cli bc12: de bf out 0x3e, r29 ; 62 bc14: 0f be out 0x3f, r0 ; 63 bc16: cd bf out 0x3d, r28 ; 61 #endif } print_mem(addr_start, count, type); bc18: 47 2d mov r20, r7 bc1a: b4 01 movw r22, r8 bc1c: c7 01 movw r24, r14 } bc1e: 60 96 adiw r28, 0x10 ; 16 bc20: 0f b6 in r0, 0x3f ; 63 bc22: f8 94 cli bc24: de bf out 0x3e, r29 ; 62 bc26: 0f be out 0x3f, r0 ; 63 bc28: cd bf out 0x3d, r28 ; 61 bc2a: df 91 pop r29 bc2c: cf 91 pop r28 bc2e: 1f 91 pop r17 bc30: 0f 91 pop r16 bc32: ff 90 pop r15 bc34: ef 90 pop r14 bc36: df 90 pop r13 bc38: cf 90 pop r12 bc3a: bf 90 pop r11 bc3c: af 90 pop r10 bc3e: 9f 90 pop r9 bc40: 8f 90 pop r8 bc42: 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); bc44: 0d 94 a4 53 jmp 0x2a748 ; 0x2a748 0000bc48 : /// 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)); bc48: 80 e1 ldi r24, 0x10 ; 16 bc4a: e5 ef ldi r30, 0xF5 ; 245 bc4c: f1 e1 ldi r31, 0x11 ; 17 bc4e: a0 e9 ldi r26, 0x90 ; 144 bc50: b2 e0 ldi r27, 0x02 ; 2 bc52: 01 90 ld r0, Z+ bc54: 0d 92 st X+, r0 bc56: 8a 95 dec r24 bc58: e1 f7 brne .-8 ; 0xbc52 saved_feedmultiply2 = feedmultiply; //save feedmultiply bc5a: 80 91 8e 02 lds r24, 0x028E ; 0x80028e bc5e: 90 91 8f 02 lds r25, 0x028F ; 0x80028f bc62: 90 93 f4 11 sts 0x11F4, r25 ; 0x8011f4 <_ZL19saved_feedmultiply2.lto_priv.502+0x1> bc66: 80 93 f3 11 sts 0x11F3, r24 ; 0x8011f3 <_ZL19saved_feedmultiply2.lto_priv.502> saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); bc6a: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 bc6e: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 bc72: 90 93 f0 11 sts 0x11F0, r25 ; 0x8011f0 bc76: 80 93 ef 11 sts 0x11EF, r24 ; 0x8011ef saved_bed_temperature = (uint8_t)degTargetBed(); bc7a: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed bc7e: 80 93 ec 11 sts 0x11EC, r24 ; 0x8011ec saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; bc82: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb bc86: 83 fb bst r24, 3 bc88: 88 27 eor r24, r24 bc8a: 80 f9 bld r24, 0 bc8c: 80 93 ea 11 sts 0x11EA, r24 ; 0x8011ea saved_fan_speed = fanSpeed; bc90: 80 91 e9 11 lds r24, 0x11E9 ; 0x8011e9 bc94: 80 93 e8 11 sts 0x11E8, r24 ; 0x8011e8 isPartialBackupAvailable = true; } bc98: 08 95 ret 0000bc9a <_GLOBAL__sub_D_card>: while(!lcd_clicked()) { delay_keep_alive(0); } KEEPALIVE_STATE(busy_state_backup); } bc9a: cf 93 push r28 bc9c: df 93 push r29 //------------------------------------------------------------------------------ /** * \class SdFile * \brief SdBaseFile with Print. */ class SdFile : public SdBaseFile/*, public Print*/ { bc9e: 8a ef ldi r24, 0xFA ; 250 bca0: 95 e1 ldi r25, 0x15 ; 21 bca2: 0e 94 31 70 call 0xe062 ; 0xe062 #ifdef SDSUPPORT #define MAX_DIR_DEPTH 6 #include "SdFile.h" class CardReader bca6: 88 e3 ldi r24, 0x38 ; 56 bca8: 94 e1 ldi r25, 0x14 ; 20 bcaa: 89 2b or r24, r25 bcac: 51 f0 breq .+20 ; 0xbcc2 <_GLOBAL__sub_D_card+0x28> bcae: ca e0 ldi r28, 0x0A ; 10 bcb0: d5 e1 ldi r29, 0x15 ; 21 bcb2: a3 97 sbiw r28, 0x23 ; 35 bcb4: ce 01 movw r24, r28 bcb6: 0e 94 31 70 call 0xe062 ; 0xe062 bcba: 84 e1 ldi r24, 0x14 ; 20 bcbc: c8 33 cpi r28, 0x38 ; 56 bcbe: d8 07 cpc r29, r24 bcc0: c1 f7 brne .-16 ; 0xbcb2 <_GLOBAL__sub_D_card+0x18> bcc2: 85 e1 ldi r24, 0x15 ; 21 bcc4: 94 e1 ldi r25, 0x14 ; 20 bcc6: 0e 94 31 70 call 0xe062 ; 0xe062 bcca: 80 ef ldi r24, 0xF0 ; 240 bccc: 93 e1 ldi r25, 0x13 ; 19 bcce: df 91 pop r29 bcd0: cf 91 pop r28 bcd2: 0c 94 31 70 jmp 0xe062 ; 0xe062 0000bcd6 : print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; } void load_filament_final_feed() { bcd6: cf 93 push r28 bcd8: df 93 push r29 current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; bcda: c5 ef ldi r28, 0xF5 ; 245 bcdc: d1 e1 ldi r29, 0x11 ; 17 bcde: 20 e0 ldi r18, 0x00 ; 0 bce0: 30 e0 ldi r19, 0x00 ; 0 bce2: 48 ec ldi r20, 0xC8 ; 200 bce4: 51 e4 ldi r21, 0x41 ; 65 bce6: 6c 85 ldd r22, Y+12 ; 0x0c bce8: 7d 85 ldd r23, Y+13 ; 0x0d bcea: 8e 85 ldd r24, Y+14 ; 0x0e bcec: 9f 85 ldd r25, Y+15 ; 0x0f bcee: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> bcf2: 6c 87 std Y+12, r22 ; 0x0c bcf4: 7d 87 std Y+13, r23 ; 0x0d bcf6: 8e 87 std Y+14, r24 ; 0x0e bcf8: 9f 87 std Y+15, r25 ; 0x0f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); bcfa: 63 e3 ldi r22, 0x33 ; 51 bcfc: 73 e3 ldi r23, 0x33 ; 51 bcfe: 83 e5 ldi r24, 0x53 ; 83 bd00: 90 e4 ldi r25, 0x40 ; 64 } bd02: df 91 pop r29 bd04: cf 91 pop r28 } void load_filament_final_feed() { current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); bd06: 0d 94 2f 85 jmp 0x30a5e ; 0x30a5e 0000bd0a : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); bd0a: 60 e0 ldi r22, 0x00 ; 0 bd0c: 85 ea ldi r24, 0xA5 ; 165 bd0e: 9f e0 ldi r25, 0x0F ; 15 bd10: 0f 94 bf a0 call 0x3417e ; 0x3417e bd14: 60 e0 ldi r22, 0x00 ; 0 bd16: 8f e7 ldi r24, 0x7F ; 127 bd18: 9c e0 ldi r25, 0x0C ; 12 bd1a: 0f 94 bf a0 call 0x3417e ; 0x3417e // 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; bd1e: 80 e0 ldi r24, 0x00 ; 0 bd20: 90 e0 ldi r25, 0x00 ; 0 bd22: a0 e8 ldi r26, 0x80 ; 128 bd24: bf eb ldi r27, 0xBF ; 191 bd26: 80 93 7e 02 sts 0x027E, r24 ; 0x80027e bd2a: 90 93 7f 02 sts 0x027F, r25 ; 0x80027f bd2e: a0 93 80 02 sts 0x0280, r26 ; 0x800280 bd32: b0 93 81 02 sts 0x0281, r27 ; 0x800281 saved_printing_type = PowerPanic::PRINT_TYPE_NONE; bd36: 82 e0 ldi r24, 0x02 ; 2 bd38: 80 93 79 02 sts 0x0279, r24 ; 0x800279 saved_printing = false; bd3c: 10 92 e7 11 sts 0x11E7, r1 ; 0x8011e7 } bd40: 08 95 ret 0000bd42 : enquecommandf_P(MSG_M23, filename); } void restore_extruder_temperature_from_ram() { if ((uint16_t)degTargetHotend(active_extruder) != saved_extruder_temperature) bd42: 80 91 ef 11 lds r24, 0x11EF ; 0x8011ef bd46: 90 91 f0 11 lds r25, 0x11F0 ; 0x8011f0 bd4a: 20 91 f1 11 lds r18, 0x11F1 ; 0x8011f1 bd4e: 30 91 f2 11 lds r19, 0x11F2 ; 0x8011f2 bd52: 28 17 cp r18, r24 bd54: 39 07 cpc r19, r25 bd56: 71 f0 breq .+28 ; 0xbd74 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; bd58: 90 93 f2 11 sts 0x11F2, r25 ; 0x8011f2 bd5c: 80 93 f1 11 sts 0x11F1, r24 ; 0x8011f1 { setTargetHotend(saved_extruder_temperature); heating_status = HeatingStatus::EXTRUDER_HEATING; bd60: 81 e0 ldi r24, 0x01 ; 1 bd62: 80 93 99 03 sts 0x0399, r24 ; 0x800399 wait_for_heater(_millis(), active_extruder); bd66: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 bd6a: 0f 94 57 4f call 0x29eae ; 0x29eae heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; bd6e: 82 e0 ldi r24, 0x02 ; 2 bd70: 80 93 99 03 sts 0x0399, r24 ; 0x800399 } } bd74: 08 95 ret 0000bd76 : saved_fan_speed = fanSpeed; isPartialBackupAvailable = true; } void __attribute__((noinline)) refresh_saved_feedrate_multiplier_in_ram() { if (!saved_printing) { bd76: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 bd7a: 88 23 and r24, r24 bd7c: 41 f0 breq .+16 ; 0xbd8e // There is no saved print, therefore nothing to refresh return; } saved_feedmultiply2 = feedmultiply; bd7e: 80 91 8e 02 lds r24, 0x028E ; 0x80028e bd82: 90 91 8f 02 lds r25, 0x028F ; 0x80028f bd86: 90 93 f4 11 sts 0x11F4, r25 ; 0x8011f4 <_ZL19saved_feedmultiply2.lto_priv.502+0x1> bd8a: 80 93 f3 11 sts 0x11F3, r24 ; 0x8011f3 <_ZL19saved_feedmultiply2.lto_priv.502> } bd8e: 08 95 ret 0000bd90 : if (extrudemultiply != 100) out *= float(extrudemultiply) * 0.01f; return out; } void calculate_extruder_multipliers() { bd90: cf 92 push r12 bd92: df 92 push r13 bd94: ef 92 push r14 bd96: ff 92 push r15 extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); bd98: c0 90 ca 04 lds r12, 0x04CA ; 0x8004ca bd9c: d0 90 cb 04 lds r13, 0x04CB ; 0x8004cb bda0: e0 90 cc 04 lds r14, 0x04CC ; 0x8004cc bda4: 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) { bda8: 80 91 c9 04 lds r24, 0x04C9 ; 0x8004c9 bdac: 88 23 and r24, r24 bdae: 09 f4 brne .+2 ; 0xbdb2 bdb0: 4e c0 rjmp .+156 ; 0xbe4e bdb2: 20 e0 ldi r18, 0x00 ; 0 bdb4: 30 e0 ldi r19, 0x00 ; 0 bdb6: a9 01 movw r20, r18 bdb8: c7 01 movw r24, r14 bdba: b6 01 movw r22, r12 bdbc: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> bdc0: 18 16 cp r1, r24 bdc2: 0c f0 brlt .+2 ; 0xbdc6 bdc4: 44 c0 rjmp .+136 ; 0xbe4e float area = M_PI * diameter * diameter * 0.25; bdc6: 2b ed ldi r18, 0xDB ; 219 bdc8: 3f e0 ldi r19, 0x0F ; 15 bdca: 49 e4 ldi r20, 0x49 ; 73 bdcc: 50 e4 ldi r21, 0x40 ; 64 bdce: c7 01 movw r24, r14 bdd0: b6 01 movw r22, r12 bdd2: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> bdd6: a7 01 movw r20, r14 bdd8: 96 01 movw r18, r12 bdda: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> bdde: 20 e0 ldi r18, 0x00 ; 0 bde0: 30 e0 ldi r19, 0x00 ; 0 bde2: 40 e8 ldi r20, 0x80 ; 128 bde4: 5e e3 ldi r21, 0x3E ; 62 bde6: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> bdea: 9b 01 movw r18, r22 bdec: ac 01 movw r20, r24 out = 1.f / area; bdee: 60 e0 ldi r22, 0x00 ; 0 bdf0: 70 e0 ldi r23, 0x00 ; 0 bdf2: 80 e8 ldi r24, 0x80 ; 128 bdf4: 9f e3 ldi r25, 0x3F ; 63 bdf6: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> bdfa: 6b 01 movw r12, r22 bdfc: 7c 01 movw r14, r24 } if (extrudemultiply != 100) bdfe: 60 91 59 02 lds r22, 0x0259 ; 0x800259 be02: 70 91 5a 02 lds r23, 0x025A ; 0x80025a be06: 64 36 cpi r22, 0x64 ; 100 be08: 71 05 cpc r23, r1 be0a: a1 f0 breq .+40 ; 0xbe34 out *= float(extrudemultiply) * 0.01f; be0c: 07 2e mov r0, r23 be0e: 00 0c add r0, r0 be10: 88 0b sbc r24, r24 be12: 99 0b sbc r25, r25 be14: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> be18: 2a e0 ldi r18, 0x0A ; 10 be1a: 37 ed ldi r19, 0xD7 ; 215 be1c: 43 e2 ldi r20, 0x23 ; 35 be1e: 5c e3 ldi r21, 0x3C ; 60 be20: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> be24: 9b 01 movw r18, r22 be26: ac 01 movw r20, r24 be28: c7 01 movw r24, r14 be2a: b6 01 movw r22, r12 be2c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> be30: 6b 01 movw r12, r22 be32: 7c 01 movw r14, r24 return out; } void calculate_extruder_multipliers() { extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); be34: c0 92 10 02 sts 0x0210, r12 ; 0x800210 be38: d0 92 11 02 sts 0x0211, r13 ; 0x800211 be3c: e0 92 12 02 sts 0x0212, r14 ; 0x800212 be40: 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 } be44: ff 90 pop r15 be46: ef 90 pop r14 be48: df 90 pop r13 be4a: cf 90 pop r12 be4c: 08 95 ret MMU2::mmu2.ClearTMCFailures(); // not stored into EEPROM } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; be4e: c1 2c mov r12, r1 be50: d1 2c mov r13, r1 be52: 80 e8 ldi r24, 0x80 ; 128 be54: e8 2e mov r14, r24 be56: 8f e3 ldi r24, 0x3F ; 63 be58: f8 2e mov r15, r24 be5a: d1 cf rjmp .-94 ; 0xbdfe 0000be5c : } } #endif //FAST_PWM_FAN void save_statistics() { be5c: 8f 92 push r8 be5e: 9f 92 push r9 be60: af 92 push r10 be62: bf 92 push r11 be64: cf 92 push r12 be66: df 92 push r13 be68: ef 92 push r14 be6a: ff 92 push r15 uint32_t _previous_filament = eeprom_init_default_dword((uint32_t *)EEPROM_FILAMENTUSED, 0); //_previous_filament unit: centimeter be6c: 81 ef ldi r24, 0xF1 ; 241 be6e: 9f e0 ldi r25, 0x0F ; 15 be70: 0f 94 76 49 call 0x292ec ; 0x292ec be74: 6b 01 movw r12, r22 be76: 7c 01 movw r14, r24 uint32_t _previous_time = eeprom_init_default_dword((uint32_t *)EEPROM_TOTALTIME, 0); //_previous_time unit: min be78: 8d ee ldi r24, 0xED ; 237 be7a: 9f e0 ldi r25, 0x0F ; 15 be7c: 0f 94 76 49 call 0x292ec ; 0x292ec be80: 4b 01 movw r8, r22 be82: 5c 01 movw r10, r24 uint32_t time_minutes = print_job_timer.duration() / 60; be84: 0f 94 f2 1c call 0x239e4 ; 0x239e4 be88: 2c e3 ldi r18, 0x3C ; 60 be8a: 30 e0 ldi r19, 0x00 ; 0 be8c: 40 e0 ldi r20, 0x00 ; 0 be8e: 50 e0 ldi r21, 0x00 ; 0 be90: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, _previous_time + time_minutes); // EEPROM_TOTALTIME unit: min be94: ba 01 movw r22, r20 be96: a9 01 movw r20, r18 be98: 48 0d add r20, r8 be9a: 59 1d adc r21, r9 be9c: 6a 1d adc r22, r10 be9e: 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); bea0: 8d ee ldi r24, 0xED ; 237 bea2: 9f e0 ldi r25, 0x0F ; 15 bea4: 0f 94 d1 a0 call 0x341a2 ; 0x341a2 eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, _previous_filament + (total_filament_used / 1000)); bea8: 60 91 84 06 lds r22, 0x0684 ; 0x800684 beac: 70 91 85 06 lds r23, 0x0685 ; 0x800685 beb0: 80 91 86 06 lds r24, 0x0686 ; 0x800686 beb4: 90 91 87 06 lds r25, 0x0687 ; 0x800687 beb8: 28 ee ldi r18, 0xE8 ; 232 beba: 33 e0 ldi r19, 0x03 ; 3 bebc: 40 e0 ldi r20, 0x00 ; 0 bebe: 50 e0 ldi r21, 0x00 ; 0 bec0: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> bec4: ba 01 movw r22, r20 bec6: a9 01 movw r20, r18 bec8: 4c 0d add r20, r12 beca: 5d 1d adc r21, r13 becc: 6e 1d adc r22, r14 bece: 7f 1d adc r23, r15 bed0: 81 ef ldi r24, 0xF1 ; 241 bed2: 9f e0 ldi r25, 0x0F ; 15 bed4: 0f 94 d1 a0 call 0x341a2 ; 0x341a2 print_job_timer.reset(); bed8: 0f 94 c7 20 call 0x2418e ; 0x2418e total_filament_used = 0; bedc: 10 92 84 06 sts 0x0684, r1 ; 0x800684 bee0: 10 92 85 06 sts 0x0685, r1 ; 0x800685 bee4: 10 92 86 06 sts 0x0686, r1 ; 0x800686 bee8: 10 92 87 06 sts 0x0687, r1 ; 0x800687 if (MMU2::mmu2.Enabled()) { beec: 80 91 94 12 lds r24, 0x1294 ; 0x801294 bef0: 81 30 cpi r24, 0x01 ; 1 bef2: 81 f4 brne .+32 ; 0xbf14 eeprom_add_dword((uint32_t *)EEPROM_MMU_MATERIAL_CHANGES, MMU2::mmu2.ToolChangeCounter()); bef4: 60 91 98 12 lds r22, 0x1298 ; 0x801298 bef8: 70 91 99 12 lds r23, 0x1299 ; 0x801299 befc: 90 e0 ldi r25, 0x00 ; 0 befe: 80 e0 ldi r24, 0x00 ; 0 bf00: 0f 94 5e 49 call 0x292bc ; 0x292bc /// @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; }; bf04: 10 92 99 12 sts 0x1299, r1 ; 0x801299 bf08: 10 92 98 12 sts 0x1298, r1 ; 0x801298 inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } inline void ClearTMCFailures() { tmcFailures = 0; } bf0c: 10 92 9b 12 sts 0x129B, r1 ; 0x80129b bf10: 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 } } bf14: ff 90 pop r15 bf16: ef 90 pop r14 bf18: df 90 pop r13 bf1a: cf 90 pop r12 bf1c: bf 90 pop r11 bf1e: af 90 pop r10 bf20: 9f 90 pop r9 bf22: 8f 90 pop r8 bf24: 08 95 ret 0000bf26 : } #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); bf26: 80 91 e9 11 lds r24, 0x11E9 ; 0x8011e9 bf2a: 1f 92 push r1 bf2c: 8f 93 push r24 bf2e: 80 91 40 03 lds r24, 0x0340 ; 0x800340 bf32: 1f 92 push r1 bf34: 8f 93 push r24 bf36: e5 e8 ldi r30, 0x85 ; 133 bf38: f3 e0 ldi r31, 0x03 ; 3 bf3a: 42 81 ldd r20, Z+2 ; 0x02 bf3c: 53 81 ldd r21, Z+3 ; 0x03 bf3e: 2c e3 ldi r18, 0x3C ; 60 bf40: 24 9f mul r18, r20 bf42: c0 01 movw r24, r0 bf44: 25 9f mul r18, r21 bf46: 90 0d add r25, r0 bf48: 11 24 eor r1, r1 bf4a: 9f 93 push r25 bf4c: 8f 93 push r24 bf4e: 40 81 ld r20, Z bf50: 51 81 ldd r21, Z+1 ; 0x01 bf52: 24 9f mul r18, r20 bf54: c0 01 movw r24, r0 bf56: 25 9f mul r18, r21 bf58: 90 0d add r25, r0 bf5a: 11 24 eor r1, r1 bf5c: 9f 93 push r25 bf5e: 8f 93 push r24 bf60: 84 e1 ldi r24, 0x14 ; 20 bf62: 94 e6 ldi r25, 0x64 ; 100 bf64: 9f 93 push r25 bf66: 8f 93 push r24 bf68: 0f 94 5d 9f call 0x33eba ; 0x33eba bf6c: 8d b7 in r24, 0x3d ; 61 bf6e: 9e b7 in r25, 0x3e ; 62 bf70: 0a 96 adiw r24, 0x0a ; 10 bf72: 0f b6 in r0, 0x3f ; 63 bf74: f8 94 cli bf76: 9e bf out 0x3e, r25 ; 62 bf78: 0f be out 0x3f, r0 ; 63 bf7a: 8d bf out 0x3d, r24 ; 61 } bf7c: 08 95 ret 0000bf7e : endstops_hit_on_purpose(); } void refresh_cmd_timeout(void) { previous_millis_cmd.start(); bf7e: 8a e4 ldi r24, 0x4A ; 74 bf80: 93 e0 ldi r25, 0x03 ; 3 bf82: 0d 94 29 12 jmp 0x22452 ; 0x22452 ::start()> 0000bf86 : } } #endif //TMC2130 float __attribute__((noinline)) get_feedrate_mm_s(const float feedrate_mm_min) { return feedrate_mm_min / 60.f; bf86: 20 e0 ldi r18, 0x00 ; 0 bf88: 30 e0 ldi r19, 0x00 ; 0 bf8a: 40 e7 ldi r20, 0x70 ; 112 bf8c: 52 e4 ldi r21, 0x42 ; 66 bf8e: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> } bf92: 08 95 ret 0000bf94 : } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; bf94: 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; bf98: 40 91 3b 03 lds r20, 0x033B ; 0x80033b bf9c: 50 91 3c 03 lds r21, 0x033C ; 0x80033c bfa0: 60 91 3d 03 lds r22, 0x033D ; 0x80033d bfa4: 70 91 3e 03 lds r23, 0x033E ; 0x80033e bfa8: 40 93 7a 02 sts 0x027A, r20 ; 0x80027a bfac: 50 93 7b 02 sts 0x027B, r21 ; 0x80027b bfb0: 60 93 7c 02 sts 0x027C, r22 ; 0x80027c bfb4: 70 93 7d 02 sts 0x027D, r23 ; 0x80027d feedmultiply = original_feedmultiply; bfb8: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f bfbc: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e previous_millis_cmd.start(); bfc0: 8a e4 ldi r24, 0x4A ; 74 bfc2: 93 e0 ldi r25, 0x03 ; 3 bfc4: 0d 94 29 12 jmp 0x22452 ; 0x22452 ::start()> 0000bfc8 : 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) { bfc8: 1f 93 push r17 bfca: cf 93 push r28 bfcc: df 93 push r29 bfce: 18 2f mov r17, r24 saved_feedrate = feedrate; bfd0: 80 91 7a 02 lds r24, 0x027A ; 0x80027a bfd4: 90 91 7b 02 lds r25, 0x027B ; 0x80027b bfd8: a0 91 7c 02 lds r26, 0x027C ; 0x80027c bfdc: b0 91 7d 02 lds r27, 0x027D ; 0x80027d bfe0: 80 93 3b 03 sts 0x033B, r24 ; 0x80033b bfe4: 90 93 3c 03 sts 0x033C, r25 ; 0x80033c bfe8: a0 93 3d 03 sts 0x033D, r26 ; 0x80033d bfec: b0 93 3e 03 sts 0x033E, r27 ; 0x80033e int l_feedmultiply = feedmultiply; bff0: c0 91 8e 02 lds r28, 0x028E ; 0x80028e bff4: d0 91 8f 02 lds r29, 0x028F ; 0x80028f feedmultiply = 100; bff8: 84 e6 ldi r24, 0x64 ; 100 bffa: 90 e0 ldi r25, 0x00 ; 0 bffc: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f c000: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e previous_millis_cmd.start(); c004: 8a e4 ldi r24, 0x4A ; 74 c006: 93 e0 ldi r25, 0x03 ; 3 c008: 0f 94 29 12 call 0x22452 ; 0x22452 ::start()> c00c: 10 93 77 02 sts 0x0277, r17 ; 0x800277 <_ZL14check_endstops.lto_priv.364> enable_endstops(enable_endstops_now); return l_feedmultiply; } c010: ce 01 movw r24, r28 c012: df 91 pop r29 c014: cf 91 pop r28 c016: 1f 91 pop r17 c018: 08 95 ret 0000c01a : 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) { c01a: cf 92 push r12 c01c: df 92 push r13 c01e: ef 92 push r14 c020: ff 92 push r15 c022: 0f 93 push r16 c024: 1f 93 push r17 c026: cf 93 push r28 c028: 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); c02a: 90 e0 ldi r25, 0x00 ; 0 c02c: ec 01 movw r28, r24 c02e: cc 0f add r28, r28 c030: dd 1f adc r29, r29 c032: cc 0f add r28, r28 c034: dd 1f adc r29, r29 c036: fe 01 movw r30, r28 c038: eb 59 subi r30, 0x9B ; 155 c03a: 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); c03c: 25 91 lpm r18, Z+ c03e: 35 91 lpm r19, Z+ c040: 45 91 lpm r20, Z+ c042: 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]; c044: fe 01 movw r30, r28 c046: e6 57 subi r30, 0x76 ; 118 c048: fb 4f sbci r31, 0xFB ; 251 c04a: c0 80 ld r12, Z c04c: d1 80 ldd r13, Z+1 ; 0x01 c04e: e2 80 ldd r14, Z+2 ; 0x02 c050: f3 80 ldd r15, Z+3 ; 0x03 c052: 8e 01 movw r16, r28 c054: 0b 50 subi r16, 0x0B ; 11 c056: 1e 4e sbci r17, 0xEE ; 238 c058: c7 01 movw r24, r14 c05a: b6 01 movw r22, r12 c05c: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> c060: f8 01 movw r30, r16 c062: 60 83 st Z, r22 c064: 71 83 std Z+1, r23 ; 0x01 c066: 82 83 std Z+2, r24 ; 0x02 c068: 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); c06a: fe 01 movw r30, r28 c06c: e7 5a subi r30, 0xA7 ; 167 c06e: 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); c070: 25 91 lpm r18, Z+ c072: 35 91 lpm r19, Z+ c074: 45 91 lpm r20, Z+ c076: 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]; c078: 8e 01 movw r16, r28 c07a: 0c 5d subi r16, 0xDC ; 220 c07c: 1d 4f sbci r17, 0xFD ; 253 c07e: c7 01 movw r24, r14 c080: b6 01 movw r22, r12 c082: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> c086: f8 01 movw r30, r16 c088: 60 83 st Z, r22 c08a: 71 83 std Z+1, r23 ; 0x01 c08c: 82 83 std Z+2, r24 ; 0x02 c08e: 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); c090: fe 01 movw r30, r28 c092: e3 5b subi r30, 0xB3 ; 179 c094: 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); c096: 25 91 lpm r18, Z+ c098: 35 91 lpm r19, Z+ c09a: 45 91 lpm r20, Z+ c09c: 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]; c09e: c8 5e subi r28, 0xE8 ; 232 c0a0: dd 4f sbci r29, 0xFD ; 253 c0a2: c7 01 movw r24, r14 c0a4: b6 01 movw r22, r12 c0a6: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> c0aa: 68 83 st Y, r22 c0ac: 79 83 std Y+1, r23 ; 0x01 c0ae: 8a 83 std Y+2, r24 ; 0x02 c0b0: 9b 83 std Y+3, r25 ; 0x03 } c0b2: df 91 pop r29 c0b4: cf 91 pop r28 c0b6: 1f 91 pop r17 c0b8: 0f 91 pop r16 c0ba: ff 90 pop r15 c0bc: ef 90 pop r14 c0be: df 90 pop r13 c0c0: cf 90 pop r12 c0c2: 08 95 ret 0000c0c4 : c0c4: 40 e0 ldi r20, 0x00 ; 0 c0c6: 50 e0 ldi r21, 0x00 ; 0 c0c8: ba 01 movw r22, r20 c0ca: 8d ee ldi r24, 0xED ; 237 c0cc: 9f e0 ldi r25, 0x0F ; 15 c0ce: 0f 94 d1 a0 call 0x341a2 ; 0x341a2 c0d2: 40 e0 ldi r20, 0x00 ; 0 c0d4: 50 e0 ldi r21, 0x00 ; 0 c0d6: ba 01 movw r22, r20 c0d8: 81 ef ldi r24, 0xF1 ; 241 c0da: 9f e0 ldi r25, 0x0F ; 15 c0dc: 0f 94 d1 a0 call 0x341a2 ; 0x341a2 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(); c0e0: 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); c0e4: 70 e0 ldi r23, 0x00 ; 0 c0e6: 60 e0 ldi r22, 0x00 ; 0 c0e8: 85 e0 ldi r24, 0x05 ; 5 c0ea: 9f e0 ldi r25, 0x0F ; 15 c0ec: 0f 94 dd a0 call 0x341ba ; 0x341ba c0f0: 70 e0 ldi r23, 0x00 ; 0 c0f2: 60 e0 ldi r22, 0x00 ; 0 c0f4: 83 e0 ldi r24, 0x03 ; 3 c0f6: 9f e0 ldi r25, 0x0F ; 15 c0f8: 0f 94 dd a0 call 0x341ba ; 0x341ba c0fc: 70 e0 ldi r23, 0x00 ; 0 c0fe: 60 e0 ldi r22, 0x00 ; 0 c100: 81 e0 ldi r24, 0x01 ; 1 c102: 9f e0 ldi r25, 0x0F ; 15 c104: 0f 94 dd a0 call 0x341ba ; 0x341ba c108: 70 e0 ldi r23, 0x00 ; 0 c10a: 60 e0 ldi r22, 0x00 ; 0 c10c: 8f ef ldi r24, 0xFF ; 255 c10e: 9e e0 ldi r25, 0x0E ; 14 c110: 0f 94 dd a0 call 0x341ba ; 0x341ba c114: 70 e0 ldi r23, 0x00 ; 0 c116: 60 e0 ldi r22, 0x00 ; 0 c118: 83 ed ldi r24, 0xD3 ; 211 c11a: 9e e0 ldi r25, 0x0E ; 14 c11c: 0f 94 dd a0 call 0x341ba ; 0x341ba c120: 70 e0 ldi r23, 0x00 ; 0 c122: 60 e0 ldi r22, 0x00 ; 0 c124: 80 ed ldi r24, 0xD0 ; 208 c126: 9e e0 ldi r25, 0x0E ; 14 c128: 0f 94 dd a0 call 0x341ba ; 0x341ba if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); c12c: 40 e0 ldi r20, 0x00 ; 0 c12e: 50 e0 ldi r21, 0x00 ; 0 c130: ba 01 movw r22, r20 c132: 88 ea ldi r24, 0xA8 ; 168 c134: 9c e0 ldi r25, 0x0C ; 12 c136: 0d 94 d1 a0 jmp 0x341a2 ; 0x341a2 0000c13a : wdt_disable(); } } void softReset(void) { cli(); c13a: 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" ); c13c: 88 e1 ldi r24, 0x18 ; 24 c13e: 9f e0 ldi r25, 0x0F ; 15 c140: 0f b6 in r0, 0x3f ; 63 c142: f8 94 cli c144: a8 95 wdr c146: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> c14a: 0f be out 0x3f, r0 ; 63 c14c: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> c150: ff cf rjmp .-2 ; 0xc150 0000c152 : } #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); c152: 85 ea ldi r24, 0xA5 ; 165 c154: 9f e0 ldi r25, 0x0F ; 15 c156: 0f 94 9b a0 call 0x34136 ; 0x34136 c15a: 91 e0 ldi r25, 0x01 ; 1 c15c: 81 11 cpse r24, r1 c15e: 01 c0 rjmp .+2 ; 0xc162 c160: 90 e0 ldi r25, 0x00 ; 0 } c162: 89 2f mov r24, r25 c164: 08 95 ret 0000c166 : 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(); c166: 80 91 9b 03 lds r24, 0x039B ; 0x80039b c16a: 81 11 cpse r24, r1 c16c: 06 c0 rjmp .+12 ; 0xc17a c16e: 81 e0 ldi r24, 0x01 ; 1 c170: 90 91 59 03 lds r25, 0x0359 ; 0x800359 c174: 92 30 cpi r25, 0x02 ; 2 c176: 09 f0 breq .+2 ; 0xc17a c178: 80 e0 ldi r24, 0x00 ; 0 } c17a: 08 95 ret 0000c17c : WRITE(SUICIDE_PIN, LOW); #endif } bool __attribute__((noinline)) printJobOngoing() { return (IS_SD_PRINTING || usb_timer.running() || print_job_timer.isRunning()); c17c: 80 91 6a 13 lds r24, 0x136A ; 0x80136a c180: 81 11 cpse r24, r1 c182: 0a c0 rjmp .+20 ; 0xc198 c184: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 c188: 81 11 cpse r24, r1 c18a: 06 c0 rjmp .+12 ; 0xc198 c18c: 81 e0 ldi r24, 0x01 ; 1 c18e: 90 91 59 03 lds r25, 0x0359 ; 0x800359 c192: 91 30 cpi r25, 0x01 ; 1 c194: 09 f0 breq .+2 ; 0xc198 c196: 80 e0 ldi r24, 0x00 ; 0 } c198: 08 95 ret 0000c19a : && !mesh_bed_leveling_flag && !homing_flag && e_active(); } bool __attribute__((noinline)) babystep_allowed() { c19a: cf 93 push r28 c19c: df 93 push r29 return ( !homing_flag c19e: c0 91 05 12 lds r28, 0x1205 ; 0x801205 && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) c1a2: c1 11 cpse r28, r1 c1a4: 1f c0 rjmp .+62 ; 0xc1e4 && e_active(); } bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag c1a6: 80 91 06 12 lds r24, 0x1206 ; 0x801206 c1aa: 81 11 cpse r24, r1 c1ac: 1c c0 rjmp .+56 ; 0xc1e6 && !printingIsPaused() c1ae: 0e 94 b3 60 call 0xc166 ; 0xc166 c1b2: 81 11 cpse r24, r1 c1b4: 18 c0 rjmp .+48 ; 0xc1e6 && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) c1b6: d0 91 c8 0d lds r29, 0x0DC8 ; 0x800dc8 c1ba: d4 30 cpi r29, 0x04 ; 4 c1bc: 61 f4 brne .+24 ; 0xc1d6 c1be: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 c1c2: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 c1c6: 89 2b or r24, r25 c1c8: 91 f4 brne .+36 ; 0xc1ee c1ca: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed c1ce: 90 91 ee 11 lds r25, 0x11EE ; 0x8011ee c1d2: 89 2b or r24, r25 c1d4: 61 f4 brne .+24 ; 0xc1ee || printJobOngoing() c1d6: 0e 94 be 60 call 0xc17c ; 0xc17c c1da: c8 2f mov r28, r24 c1dc: 81 11 cpse r24, r1 c1de: 03 c0 rjmp .+6 ; 0xc1e6 || lcd_commands_type == LcdCommands::Idle c1e0: c1 e0 ldi r28, 0x01 ; 1 c1e2: 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) c1e4: c0 e0 ldi r28, 0x00 ; 0 || printJobOngoing() || lcd_commands_type == LcdCommands::Idle ) ); } c1e6: 8c 2f mov r24, r28 c1e8: df 91 pop r29 c1ea: cf 91 pop r28 c1ec: 08 95 ret bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) c1ee: c1 e0 ldi r28, 0x01 ; 1 c1f0: fa cf rjmp .-12 ; 0xc1e6 0000c1f2 : ) ); } bool __attribute__((noinline)) babystep_allowed_strict() { return ( babystep_allowed() && current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU); c1f2: 0e 94 cd 60 call 0xc19a ; 0xc19a c1f6: 88 23 and r24, r24 c1f8: 89 f0 breq .+34 ; 0xc21c c1fa: 20 e0 ldi r18, 0x00 ; 0 c1fc: 30 e0 ldi r19, 0x00 ; 0 c1fe: 40 e0 ldi r20, 0x00 ; 0 c200: 50 e4 ldi r21, 0x40 ; 64 c202: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd c206: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe c20a: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff c20e: 90 91 00 12 lds r25, 0x1200 ; 0x801200 c212: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> c216: 88 1f adc r24, r24 c218: 88 27 eor r24, r24 c21a: 88 1f adc r24, r24 } c21c: 08 95 ret 0000c21e : bool printingIsPaused() { return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() c21e: 0e 94 be 60 call 0xc17c ; 0xc17c || printingIsPaused() || saved_printing || (lcd_commands_type != LcdCommands::Idle) || MMU2::mmu2.MMU_PRINT_SAVED() || homing_flag || mesh_bed_leveling_flag; c222: 81 11 cpse r24, r1 c224: 18 c0 rjmp .+48 ; 0xc256 return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() || printingIsPaused() c226: 0e 94 b3 60 call 0xc166 ; 0xc166 c22a: 81 11 cpse r24, r1 c22c: 14 c0 rjmp .+40 ; 0xc256 || saved_printing c22e: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 c232: 81 11 cpse r24, r1 c234: 10 c0 rjmp .+32 ; 0xc256 || (lcd_commands_type != LcdCommands::Idle) c236: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 c23a: 81 11 cpse r24, r1 c23c: 0b c0 rjmp .+22 ; 0xc254 || MMU2::mmu2.MMU_PRINT_SAVED() c23e: 80 91 95 12 lds r24, 0x1295 ; 0x801295 c242: 81 11 cpse r24, r1 c244: 07 c0 rjmp .+14 ; 0xc254 || homing_flag c246: 80 91 05 12 lds r24, 0x1205 ; 0x801205 c24a: 81 11 cpse r24, r1 c24c: 04 c0 rjmp .+8 ; 0xc256 || mesh_bed_leveling_flag; c24e: 80 91 06 12 lds r24, 0x1206 ; 0x801206 c252: 08 95 ret c254: 81 e0 ldi r24, 0x01 ; 1 } c256: 08 95 ret 0000c258 : inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); } c258: 80 e1 ldi r24, 0x10 ; 16 c25a: e5 ef ldi r30, 0xF5 ; 245 c25c: f1 e1 ldi r31, 0x11 ; 17 c25e: a3 e9 ldi r26, 0x93 ; 147 c260: b6 e0 ldi r27, 0x06 ; 6 c262: 01 90 ld r0, Z+ c264: 0d 92 st X+, r0 c266: 8a 95 dec r24 c268: e1 f7 brne .-8 ; 0xc262 c26a: 08 95 ret 0000c26c : //! //! Internally lcd_update() is called by wait_for_heater(). //! //! @param e_move void restore_print_from_ram_and_continue(float e_move) { c26c: 4f 92 push r4 c26e: 5f 92 push r5 c270: 6f 92 push r6 c272: 7f 92 push r7 c274: 8f 92 push r8 c276: 9f 92 push r9 c278: af 92 push r10 c27a: bf 92 push r11 c27c: cf 92 push r12 c27e: df 92 push r13 c280: ef 92 push r14 c282: ff 92 push r15 c284: 0f 93 push r16 c286: 1f 93 push r17 c288: cf 93 push r28 c28a: df 93 push r29 c28c: 00 d0 rcall .+0 ; 0xc28e c28e: 00 d0 rcall .+0 ; 0xc290 c290: 1f 92 push r1 c292: 1f 92 push r1 c294: cd b7 in r28, 0x3d ; 61 c296: de b7 in r29, 0x3e ; 62 if (!saved_printing) return; c298: 20 91 e7 11 lds r18, 0x11E7 ; 0x8011e7 c29c: 22 23 and r18, r18 c29e: 09 f4 brne .+2 ; 0xc2a2 c2a0: 73 c1 rjmp .+742 ; 0xc588 #ifdef FANCHECK // Do not allow resume printing if fans are still not ok if (fan_check_error == EFCE_REPORTED) return; c2a2: 20 91 9c 03 lds r18, 0x039C ; 0x80039c c2a6: 22 30 cpi r18, 0x02 ; 2 c2a8: 09 f4 brne .+2 ; 0xc2ac c2aa: 6e c1 rjmp .+732 ; 0xc588 if (fan_check_error == EFCE_FIXED) fan_check_error = EFCE_OK; //reenable serial stream processing if printing from usb c2ac: 20 91 9c 03 lds r18, 0x039C ; 0x80039c c2b0: 21 30 cpi r18, 0x01 ; 1 c2b2: 11 f4 brne .+4 ; 0xc2b8 c2b4: 10 92 9c 03 sts 0x039C, r1 ; 0x80039c c2b8: 2b 01 movw r4, r22 c2ba: 3c 01 movw r6, r24 #endif // Make sure fan is turned off fanSpeed = 0; c2bc: 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) c2c0: 10 91 ec 11 lds r17, 0x11EC ; 0x8011ec c2c4: 60 91 8a 03 lds r22, 0x038A ; 0x80038a c2c8: 70 91 8b 03 lds r23, 0x038B ; 0x80038b c2cc: 80 91 8c 03 lds r24, 0x038C ; 0x80038c c2d0: 90 91 8d 03 lds r25, 0x038D ; 0x80038d c2d4: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> c2d8: 61 17 cp r22, r17 c2da: 31 f0 breq .+12 ; 0xc2e8 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; c2dc: 81 2f mov r24, r17 c2de: 90 e0 ldi r25, 0x00 ; 0 c2e0: 90 93 ee 11 sts 0x11EE, r25 ; 0x8011ee c2e4: 80 93 ed 11 sts 0x11ED, r24 ; 0x8011ed setTargetBed(saved_bed_temperature); restore_extruder_temperature_from_ram(); c2e8: 0e 94 a1 5e call 0xbd42 ; 0xbd42 // Restore saved fan speed fanSpeed = saved_fan_speed; c2ec: 80 91 e8 11 lds r24, 0x11E8 ; 0x8011e8 c2f0: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 axis_relative_modes ^= (-saved_extruder_relative_mode ^ axis_relative_modes) & E_AXIS_MASK; c2f4: 90 91 eb 11 lds r25, 0x11EB ; 0x8011eb c2f8: 80 91 ea 11 lds r24, 0x11EA ; 0x8011ea c2fc: 81 95 neg r24 c2fe: 89 27 eor r24, r25 c300: 88 70 andi r24, 0x08 ; 8 c302: 89 27 eor r24, r25 c304: 80 93 eb 11 sts 0x11EB, r24 ; 0x8011eb float e = saved_pos[E_AXIS] - e_move; c308: a3 01 movw r20, r6 c30a: 92 01 movw r18, r4 c30c: 60 91 9c 02 lds r22, 0x029C ; 0x80029c c310: 70 91 9d 02 lds r23, 0x029D ; 0x80029d c314: 80 91 9e 02 lds r24, 0x029E ; 0x80029e c318: 90 91 9f 02 lds r25, 0x029F ; 0x80029f c31c: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> c320: 6d 83 std Y+5, r22 ; 0x05 c322: 7e 83 std Y+6, r23 ; 0x06 c324: 8f 83 std Y+7, r24 ; 0x07 c326: 98 87 std Y+8, r25 ; 0x08 plan_set_e_position(e); c328: ce 01 movw r24, r28 c32a: 05 96 adiw r24, 0x05 ; 5 c32c: 0f 94 87 75 call 0x2eb0e ; 0x2eb0e #ifdef FANCHECK fans_check_enabled = false; c330: 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) c334: 20 e0 ldi r18, 0x00 ; 0 c336: 30 e0 ldi r19, 0x00 ; 0 c338: 40 e8 ldi r20, 0x80 ; 128 c33a: 5f eb ldi r21, 0xBF ; 191 c33c: 60 91 90 02 lds r22, 0x0290 ; 0x800290 c340: 70 91 91 02 lds r23, 0x0291 ; 0x800291 c344: 80 91 92 02 lds r24, 0x0292 ; 0x800292 c348: 90 91 93 02 lds r25, 0x0293 ; 0x800293 c34c: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> c350: 81 11 cpse r24, r1 c352: 20 c0 rjmp .+64 ; 0xc394 { saved_pos[X_AXIS] = current_position[X_AXIS]; c354: 80 91 f5 11 lds r24, 0x11F5 ; 0x8011f5 c358: 90 91 f6 11 lds r25, 0x11F6 ; 0x8011f6 c35c: a0 91 f7 11 lds r26, 0x11F7 ; 0x8011f7 c360: b0 91 f8 11 lds r27, 0x11F8 ; 0x8011f8 c364: 80 93 90 02 sts 0x0290, r24 ; 0x800290 c368: 90 93 91 02 sts 0x0291, r25 ; 0x800291 c36c: a0 93 92 02 sts 0x0292, r26 ; 0x800292 c370: b0 93 93 02 sts 0x0293, r27 ; 0x800293 saved_pos[Y_AXIS] = current_position[Y_AXIS]; c374: 80 91 f9 11 lds r24, 0x11F9 ; 0x8011f9 c378: 90 91 fa 11 lds r25, 0x11FA ; 0x8011fa c37c: a0 91 fb 11 lds r26, 0x11FB ; 0x8011fb c380: b0 91 fc 11 lds r27, 0x11FC ; 0x8011fc c384: 80 93 94 02 sts 0x0294, r24 ; 0x800294 c388: 90 93 95 02 sts 0x0295, r25 ; 0x800295 c38c: a0 93 96 02 sts 0x0296, r26 ; 0x800296 c390: 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); c394: a3 01 movw r20, r6 c396: 92 01 movw r18, r4 c398: 60 91 9c 02 lds r22, 0x029C ; 0x80029c c39c: 70 91 9d 02 lds r23, 0x029D ; 0x80029d c3a0: 80 91 9e 02 lds r24, 0x029E ; 0x80029e c3a4: 90 91 9f 02 lds r25, 0x029F ; 0x80029f c3a8: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> c3ac: 69 83 std Y+1, r22 ; 0x01 c3ae: 7a 83 std Y+2, r23 ; 0x02 c3b0: 8b 83 std Y+3, r24 ; 0x03 c3b2: 9c 83 std Y+4, r25 ; 0x04 c3b4: e0 90 fd 11 lds r14, 0x11FD ; 0x8011fd c3b8: f0 90 fe 11 lds r15, 0x11FE ; 0x8011fe c3bc: 00 91 ff 11 lds r16, 0x11FF ; 0x8011ff c3c0: 10 91 00 12 lds r17, 0x1200 ; 0x801200 c3c4: 20 91 94 02 lds r18, 0x0294 ; 0x800294 c3c8: 30 91 95 02 lds r19, 0x0295 ; 0x800295 c3cc: 40 91 96 02 lds r20, 0x0296 ; 0x800296 c3d0: 50 91 97 02 lds r21, 0x0297 ; 0x800297 c3d4: 60 91 90 02 lds r22, 0x0290 ; 0x800290 c3d8: 70 91 91 02 lds r23, 0x0291 ; 0x800291 c3dc: 80 91 92 02 lds r24, 0x0292 ; 0x800292 c3e0: 90 91 93 02 lds r25, 0x0293 ; 0x800293 c3e4: 1f 92 push r1 c3e6: 1f 92 push r1 c3e8: 1f 92 push r1 c3ea: 1f 92 push r1 c3ec: e2 e6 ldi r30, 0x62 ; 98 c3ee: 8e 2e mov r8, r30 c3f0: e7 e2 ldi r30, 0x27 ; 39 c3f2: 9e 2e mov r9, r30 c3f4: e6 e7 ldi r30, 0x76 ; 118 c3f6: ae 2e mov r10, r30 c3f8: e2 e4 ldi r30, 0x42 ; 66 c3fa: be 2e mov r11, r30 c3fc: fe 01 movw r30, r28 c3fe: 31 96 adiw r30, 0x01 ; 1 c400: 6f 01 movw r12, r30 c402: 0f 94 e1 75 call 0x2ebc2 ; 0x2ebc2 //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); c406: a3 01 movw r20, r6 c408: 92 01 movw r18, r4 c40a: 60 91 9c 02 lds r22, 0x029C ; 0x80029c c40e: 70 91 9d 02 lds r23, 0x029D ; 0x80029d c412: 80 91 9e 02 lds r24, 0x029E ; 0x80029e c416: 90 91 9f 02 lds r25, 0x029F ; 0x80029f c41a: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> c41e: 69 83 std Y+1, r22 ; 0x01 c420: 7a 83 std Y+2, r23 ; 0x02 c422: 8b 83 std Y+3, r24 ; 0x03 c424: 9c 83 std Y+4, r25 ; 0x04 c426: e0 90 98 02 lds r14, 0x0298 ; 0x800298 c42a: f0 90 99 02 lds r15, 0x0299 ; 0x800299 c42e: 00 91 9a 02 lds r16, 0x029A ; 0x80029a c432: 10 91 9b 02 lds r17, 0x029B ; 0x80029b c436: 20 91 94 02 lds r18, 0x0294 ; 0x800294 c43a: 30 91 95 02 lds r19, 0x0295 ; 0x800295 c43e: 40 91 96 02 lds r20, 0x0296 ; 0x800296 c442: 50 91 97 02 lds r21, 0x0297 ; 0x800297 c446: 60 91 90 02 lds r22, 0x0290 ; 0x800290 c44a: 70 91 91 02 lds r23, 0x0291 ; 0x800291 c44e: 80 91 92 02 lds r24, 0x0292 ; 0x800292 c452: 90 91 93 02 lds r25, 0x0293 ; 0x800293 c456: 1f 92 push r1 c458: 1f 92 push r1 c45a: 1f 92 push r1 c45c: 1f 92 push r1 c45e: 0f 94 e1 75 call 0x2ebc2 ; 0x2ebc2 //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); c462: e0 90 98 02 lds r14, 0x0298 ; 0x800298 c466: f0 90 99 02 lds r15, 0x0299 ; 0x800299 c46a: 00 91 9a 02 lds r16, 0x029A ; 0x80029a c46e: 10 91 9b 02 lds r17, 0x029B ; 0x80029b c472: 20 91 94 02 lds r18, 0x0294 ; 0x800294 c476: 30 91 95 02 lds r19, 0x0295 ; 0x800295 c47a: 40 91 96 02 lds r20, 0x0296 ; 0x800296 c47e: 50 91 97 02 lds r21, 0x0297 ; 0x800297 c482: 60 91 90 02 lds r22, 0x0290 ; 0x800290 c486: 70 91 91 02 lds r23, 0x0291 ; 0x800291 c48a: 80 91 92 02 lds r24, 0x0292 ; 0x800292 c48e: 90 91 93 02 lds r25, 0x0293 ; 0x800293 c492: 1f 92 push r1 c494: 1f 92 push r1 c496: 1f 92 push r1 c498: 1f 92 push r1 c49a: 81 2c mov r8, r1 c49c: 91 2c mov r9, r1 c49e: f8 ee ldi r31, 0xE8 ; 232 c4a0: af 2e mov r10, r31 c4a2: f2 e4 ldi r31, 0x42 ; 66 c4a4: bf 2e mov r11, r31 c4a6: ac e9 ldi r26, 0x9C ; 156 c4a8: ca 2e mov r12, r26 c4aa: a2 e0 ldi r26, 0x02 ; 2 c4ac: da 2e mov r13, r26 c4ae: 0f 94 e1 75 call 0x2ebc2 ; 0x2ebc2 st_synchronize(); c4b2: 0f 94 ce 22 call 0x2459c ; 0x2459c #ifdef FANCHECK fans_check_enabled = true; c4b6: 11 e0 ldi r17, 0x01 ; 1 c4b8: 10 93 40 02 sts 0x0240, r17 ; 0x800240 #endif // restore original feedrate/feedmultiply _after_ restoring the extruder position feedrate = saved_feedrate2; c4bc: 60 91 e2 11 lds r22, 0x11E2 ; 0x8011e2 c4c0: 70 91 e3 11 lds r23, 0x11E3 ; 0x8011e3 c4c4: 90 e0 ldi r25, 0x00 ; 0 c4c6: 80 e0 ldi r24, 0x00 ; 0 c4c8: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> c4cc: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a c4d0: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b c4d4: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c c4d8: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d feedmultiply = saved_feedmultiply2; c4dc: 80 91 f3 11 lds r24, 0x11F3 ; 0x8011f3 <_ZL19saved_feedmultiply2.lto_priv.502> c4e0: 90 91 f4 11 lds r25, 0x11F4 ; 0x8011f4 <_ZL19saved_feedmultiply2.lto_priv.502+0x1> c4e4: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f c4e8: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e memcpy(current_position, saved_pos, sizeof(saved_pos)); c4ec: 80 e1 ldi r24, 0x10 ; 16 c4ee: e0 e9 ldi r30, 0x90 ; 144 c4f0: f2 e0 ldi r31, 0x02 ; 2 c4f2: a5 ef ldi r26, 0xF5 ; 245 c4f4: b1 e1 ldi r27, 0x11 ; 17 c4f6: 01 90 ld r0, Z+ c4f8: 0d 92 st X+, r0 c4fa: 8a 95 dec r24 c4fc: e1 f7 brne .-8 ; 0xc4f6 set_destination_to_current(); c4fe: 0e 94 2c 61 call 0xc258 ; 0xc258 //not sd printing nor usb printing } } void restore_print_file_state() { if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { //was sd printing c502: 80 91 79 02 lds r24, 0x0279 ; 0x800279 c506: 0f b6 in r0, 0x3f ; 63 c508: f8 94 cli c50a: de bf out 0x3e, r29 ; 62 c50c: 0f be out 0x3f, r0 ; 63 c50e: cd bf out 0x3d, r28 ; 61 c510: 81 11 cpse r24, r1 c512: 51 c0 rjmp .+162 ; 0xc5b6 card.setIndex(saved_sdpos); c514: 60 91 d8 11 lds r22, 0x11D8 ; 0x8011d8 c518: 70 91 d9 11 lds r23, 0x11D9 ; 0x8011d9 c51c: 80 91 da 11 lds r24, 0x11DA ; 0x8011da c520: 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);}; c524: 60 93 7e 16 sts 0x167E, r22 ; 0x80167e c528: 70 93 7f 16 sts 0x167F, r23 ; 0x80167f c52c: 80 93 80 16 sts 0x1680, r24 ; 0x801680 c530: 90 93 81 16 sts 0x1681, r25 ; 0x801681 c534: 0f 94 b5 44 call 0x2896a ; 0x2896a sdpos_atomic = saved_sdpos; c538: 80 91 d8 11 lds r24, 0x11D8 ; 0x8011d8 c53c: 90 91 d9 11 lds r25, 0x11D9 ; 0x8011d9 c540: a0 91 da 11 lds r26, 0x11DA ; 0x8011da c544: b0 91 db 11 lds r27, 0x11DB ; 0x8011db c548: 80 93 dc 11 sts 0x11DC, r24 ; 0x8011dc c54c: 90 93 dd 11 sts 0x11DD, r25 ; 0x8011dd c550: a0 93 de 11 sts 0x11DE, r26 ; 0x8011de c554: b0 93 df 11 sts 0x11DF, r27 ; 0x8011df card.sdprinting = true; c558: 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); c55c: 60 e0 ldi r22, 0x00 ; 0 c55e: 85 ea ldi r24, 0xA5 ; 165 c560: 9f e0 ldi r25, 0x0F ; 15 c562: 0f 94 bf a0 call 0x3417e ; 0x3417e c566: 60 e0 ldi r22, 0x00 ; 0 c568: 8f e7 ldi r24, 0x7F ; 127 c56a: 9c e0 ldi r25, 0x0C ; 12 c56c: 0f 94 bf a0 call 0x3417e ; 0x3417e 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); c570: 87 e6 ldi r24, 0x67 ; 103 c572: 9b e6 ldi r25, 0x6B ; 107 c574: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 saved_printing_type = PowerPanic::PRINT_TYPE_NONE; c578: 82 e0 ldi r24, 0x02 ; 2 c57a: 80 93 79 02 sts 0x0279, r24 ; 0x800279 saved_printing = false; c57e: 10 92 e7 11 sts 0x11E7, r1 ; 0x8011e7 planner_aborted = true; // unroll the stack c582: 81 e0 ldi r24, 0x01 ; 1 c584: 80 93 ac 0d sts 0x0DAC, r24 ; 0x800dac } c588: 28 96 adiw r28, 0x08 ; 8 c58a: 0f b6 in r0, 0x3f ; 63 c58c: f8 94 cli c58e: de bf out 0x3e, r29 ; 62 c590: 0f be out 0x3f, r0 ; 63 c592: cd bf out 0x3d, r28 ; 61 c594: df 91 pop r29 c596: cf 91 pop r28 c598: 1f 91 pop r17 c59a: 0f 91 pop r16 c59c: ff 90 pop r15 c59e: ef 90 pop r14 c5a0: df 90 pop r13 c5a2: cf 90 pop r12 c5a4: bf 90 pop r11 c5a6: af 90 pop r10 c5a8: 9f 90 pop r9 c5aa: 8f 90 pop r8 c5ac: 7f 90 pop r7 c5ae: 6f 90 pop r6 c5b0: 5f 90 pop r5 c5b2: 4f 90 pop r4 c5b4: 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 c5b6: 81 30 cpi r24, 0x01 ; 1 c5b8: 89 f6 brne .-94 ; 0xc55c gcode_LastN = saved_sdpos; //saved_sdpos was reused for storing line number when usb printing c5ba: 80 91 d8 11 lds r24, 0x11D8 ; 0x8011d8 c5be: 90 91 d9 11 lds r25, 0x11D9 ; 0x8011d9 c5c2: a0 91 da 11 lds r26, 0x11DA ; 0x8011da c5c6: b0 91 db 11 lds r27, 0x11DB ; 0x8011db c5ca: 80 93 d1 11 sts 0x11D1, r24 ; 0x8011d1 c5ce: 90 93 d2 11 sts 0x11D2, r25 ; 0x8011d2 c5d2: a0 93 d3 11 sts 0x11D3, r26 ; 0x8011d3 c5d6: b0 93 d4 11 sts 0x11D4, r27 ; 0x8011d4 serial_count = 0; c5da: 10 92 db 0f sts 0x0FDB, r1 ; 0x800fdb c5de: 10 92 da 0f sts 0x0FDA, r1 ; 0x800fda FlushSerialRequestResend(); c5e2: 0e 94 e2 54 call 0xa9c4 ; 0xa9c4 c5e6: ba cf rjmp .-140 ; 0xc55c 0000c5e8 : 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) { c5e8: 3f 92 push r3 c5ea: 4f 92 push r4 c5ec: 5f 92 push r5 c5ee: 6f 92 push r6 c5f0: 7f 92 push r7 c5f2: 8f 92 push r8 c5f4: 9f 92 push r9 c5f6: af 92 push r10 c5f8: bf 92 push r11 c5fa: cf 92 push r12 c5fc: df 92 push r13 c5fe: ef 92 push r14 c600: ff 92 push r15 c602: 0f 93 push r16 c604: 1f 93 push r17 c606: cf 93 push r28 c608: df 93 push r29 if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { c60a: 30 90 dc 16 lds r3, 0x16DC ; 0x8016dc c60e: 33 20 and r3, r3 c610: 09 f4 brne .+2 ; 0xc614 c612: 80 c0 rjmp .+256 ; 0xc714 c614: 8b 01 movw r16, r22 c616: ec 01 movw r28, r24 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { c618: 31 fe sbrs r3, 1 c61a: 54 c0 rjmp .+168 ; 0xc6c4 // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew[0][0] * x + world2machine_rotation_and_skew[0][1] * y; c61c: 88 80 ld r8, Y c61e: 99 80 ldd r9, Y+1 ; 0x01 c620: aa 80 ldd r10, Y+2 ; 0x02 c622: bb 80 ldd r11, Y+3 ; 0x03 c624: fb 01 movw r30, r22 c626: c0 80 ld r12, Z c628: d1 80 ldd r13, Z+1 ; 0x01 c62a: e2 80 ldd r14, Z+2 ; 0x02 c62c: f3 80 ldd r15, Z+3 ; 0x03 float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; c62e: 20 91 b1 16 lds r18, 0x16B1 ; 0x8016b1 c632: 30 91 b2 16 lds r19, 0x16B2 ; 0x8016b2 c636: 40 91 b3 16 lds r20, 0x16B3 ; 0x8016b3 c63a: 50 91 b4 16 lds r21, 0x16B4 ; 0x8016b4 c63e: c5 01 movw r24, r10 c640: b4 01 movw r22, r8 c642: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> c646: 2b 01 movw r4, r22 c648: 3c 01 movw r6, r24 c64a: 20 91 b5 16 lds r18, 0x16B5 ; 0x8016b5 c64e: 30 91 b6 16 lds r19, 0x16B6 ; 0x8016b6 c652: 40 91 b7 16 lds r20, 0x16B7 ; 0x8016b7 c656: 50 91 b8 16 lds r21, 0x16B8 ; 0x8016b8 c65a: c7 01 movw r24, r14 c65c: b6 01 movw r22, r12 c65e: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> c662: 9b 01 movw r18, r22 c664: ac 01 movw r20, r24 c666: c3 01 movw r24, r6 c668: b2 01 movw r22, r4 c66a: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> c66e: 2b 01 movw r4, r22 c670: 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; c672: 20 91 a9 16 lds r18, 0x16A9 ; 0x8016a9 c676: 30 91 aa 16 lds r19, 0x16AA ; 0x8016aa c67a: 40 91 ab 16 lds r20, 0x16AB ; 0x8016ab c67e: 50 91 ac 16 lds r21, 0x16AC ; 0x8016ac c682: c5 01 movw r24, r10 c684: b4 01 movw r22, r8 c686: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> c68a: 4b 01 movw r8, r22 c68c: 5c 01 movw r10, r24 c68e: 20 91 ad 16 lds r18, 0x16AD ; 0x8016ad c692: 30 91 ae 16 lds r19, 0x16AE ; 0x8016ae c696: 40 91 af 16 lds r20, 0x16AF ; 0x8016af c69a: 50 91 b0 16 lds r21, 0x16B0 ; 0x8016b0 c69e: c7 01 movw r24, r14 c6a0: b6 01 movw r22, r12 c6a2: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> c6a6: 9b 01 movw r18, r22 c6a8: ac 01 movw r20, r24 c6aa: c5 01 movw r24, r10 c6ac: b4 01 movw r22, r8 c6ae: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; x = out_x; c6b2: 68 83 st Y, r22 c6b4: 79 83 std Y+1, r23 ; 0x01 c6b6: 8a 83 std Y+2, r24 ; 0x02 c6b8: 9b 83 std Y+3, r25 ; 0x03 y = out_y; c6ba: f8 01 movw r30, r16 c6bc: 40 82 st Z, r4 c6be: 51 82 std Z+1, r5 ; 0x01 c6c0: 62 82 std Z+2, r6 ; 0x02 c6c2: 73 82 std Z+3, r7 ; 0x03 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { c6c4: 30 fe sbrs r3, 0 c6c6: 26 c0 rjmp .+76 ; 0xc714 // Then add the offset. x += world2machine_shift[0]; c6c8: 20 91 d4 16 lds r18, 0x16D4 ; 0x8016d4 c6cc: 30 91 d5 16 lds r19, 0x16D5 ; 0x8016d5 c6d0: 40 91 d6 16 lds r20, 0x16D6 ; 0x8016d6 c6d4: 50 91 d7 16 lds r21, 0x16D7 ; 0x8016d7 c6d8: 68 81 ld r22, Y c6da: 79 81 ldd r23, Y+1 ; 0x01 c6dc: 8a 81 ldd r24, Y+2 ; 0x02 c6de: 9b 81 ldd r25, Y+3 ; 0x03 c6e0: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> c6e4: 68 83 st Y, r22 c6e6: 79 83 std Y+1, r23 ; 0x01 c6e8: 8a 83 std Y+2, r24 ; 0x02 c6ea: 9b 83 std Y+3, r25 ; 0x03 y += world2machine_shift[1]; c6ec: 20 91 d8 16 lds r18, 0x16D8 ; 0x8016d8 c6f0: 30 91 d9 16 lds r19, 0x16D9 ; 0x8016d9 c6f4: 40 91 da 16 lds r20, 0x16DA ; 0x8016da c6f8: 50 91 db 16 lds r21, 0x16DB ; 0x8016db c6fc: f8 01 movw r30, r16 c6fe: 60 81 ld r22, Z c700: 71 81 ldd r23, Z+1 ; 0x01 c702: 82 81 ldd r24, Z+2 ; 0x02 c704: 93 81 ldd r25, Z+3 ; 0x03 c706: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> c70a: f8 01 movw r30, r16 c70c: 60 83 st Z, r22 c70e: 71 83 std Z+1, r23 ; 0x01 c710: 82 83 std Z+2, r24 ; 0x02 c712: 93 83 std Z+3, r25 ; 0x03 } } } c714: df 91 pop r29 c716: cf 91 pop r28 c718: 1f 91 pop r17 c71a: 0f 91 pop r16 c71c: ff 90 pop r15 c71e: ef 90 pop r14 c720: df 90 pop r13 c722: cf 90 pop r12 c724: bf 90 pop r11 c726: af 90 pop r10 c728: 9f 90 pop r9 c72a: 8f 90 pop r8 c72c: 7f 90 pop r7 c72e: 6f 90 pop r6 c730: 5f 90 pop r5 c732: 4f 90 pop r4 c734: 3f 90 pop r3 c736: 08 95 ret 0000c738 : } } } inline bool world2machine_clamp(float &x, float &y) { c738: 2f 92 push r2 c73a: 3f 92 push r3 c73c: 4f 92 push r4 c73e: 5f 92 push r5 c740: 6f 92 push r6 c742: 7f 92 push r7 c744: 8f 92 push r8 c746: 9f 92 push r9 c748: af 92 push r10 c74a: bf 92 push r11 c74c: cf 92 push r12 c74e: df 92 push r13 c750: ef 92 push r14 c752: ff 92 push r15 c754: 0f 93 push r16 c756: 1f 93 push r17 c758: cf 93 push r28 c75a: df 93 push r29 c75c: 00 d0 rcall .+0 ; 0xc75e c75e: 00 d0 rcall .+0 ; 0xc760 c760: 1f 92 push r1 c762: 1f 92 push r1 c764: cd b7 in r28, 0x3d ; 61 c766: de b7 in r29, 0x3e ; 62 c768: 8c 01 movw r16, r24 c76a: 1b 01 movw r2, r22 } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; c76c: fc 01 movw r30, r24 c76e: 80 81 ld r24, Z c770: 91 81 ldd r25, Z+1 ; 0x01 c772: a2 81 ldd r26, Z+2 ; 0x02 c774: b3 81 ldd r27, Z+3 ; 0x03 c776: 89 83 std Y+1, r24 ; 0x01 c778: 9a 83 std Y+2, r25 ; 0x02 c77a: ab 83 std Y+3, r26 ; 0x03 c77c: bc 83 std Y+4, r27 ; 0x04 out_y = y; c77e: fb 01 movw r30, r22 c780: 80 81 ld r24, Z c782: 91 81 ldd r25, Z+1 ; 0x01 c784: a2 81 ldd r26, Z+2 ; 0x02 c786: b3 81 ldd r27, Z+3 ; 0x03 c788: 8d 83 std Y+5, r24 ; 0x05 c78a: 9e 83 std Y+6, r25 ; 0x06 c78c: af 83 std Y+7, r26 ; 0x07 c78e: b8 87 std Y+8, r27 ; 0x08 world2machine(out_x, out_y); c790: be 01 movw r22, r28 c792: 6b 5f subi r22, 0xFB ; 251 c794: 7f 4f sbci r23, 0xFF ; 255 c796: ce 01 movw r24, r28 c798: 01 96 adiw r24, 0x01 ; 1 c79a: 0e 94 f4 62 call 0xc5e8 ; 0xc5e8 inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; float tmpx, tmpy; world2machine(x, y, tmpx, tmpy); if (tmpx < X_MIN_POS) { c79e: c9 80 ldd r12, Y+1 ; 0x01 c7a0: da 80 ldd r13, Y+2 ; 0x02 c7a2: eb 80 ldd r14, Y+3 ; 0x03 c7a4: fc 80 ldd r15, Y+4 ; 0x04 c7a6: 20 e0 ldi r18, 0x00 ; 0 c7a8: 30 e0 ldi r19, 0x00 ; 0 c7aa: a9 01 movw r20, r18 c7ac: c7 01 movw r24, r14 c7ae: b6 01 movw r22, r12 c7b0: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> c7b4: 87 ff sbrs r24, 7 c7b6: 35 c0 rjmp .+106 ; 0xc822 tmpx = X_MIN_POS; c7b8: 19 82 std Y+1, r1 ; 0x01 c7ba: 1a 82 std Y+2, r1 ; 0x02 c7bc: 1b 82 std Y+3, r1 ; 0x03 c7be: 1c 82 std Y+4, r1 ; 0x04 clamped = true; } else if (tmpx > X_MAX_POS) { tmpx = X_MAX_POS; clamped = true; c7c0: ff 24 eor r15, r15 c7c2: f3 94 inc r15 } if (tmpy < Y_MIN_POS) { c7c4: 8d 80 ldd r8, Y+5 ; 0x05 c7c6: 9e 80 ldd r9, Y+6 ; 0x06 c7c8: af 80 ldd r10, Y+7 ; 0x07 c7ca: b8 84 ldd r11, Y+8 ; 0x08 c7cc: 20 e0 ldi r18, 0x00 ; 0 c7ce: 30 e0 ldi r19, 0x00 ; 0 c7d0: 40 e8 ldi r20, 0x80 ; 128 c7d2: 50 ec ldi r21, 0xC0 ; 192 c7d4: c5 01 movw r24, r10 c7d6: b4 01 movw r22, r8 c7d8: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> c7dc: 87 ff sbrs r24, 7 c7de: 35 c0 rjmp .+106 ; 0xc84a tmpy = Y_MIN_POS; c7e0: 80 e0 ldi r24, 0x00 ; 0 c7e2: 90 e0 ldi r25, 0x00 ; 0 c7e4: a0 e8 ldi r26, 0x80 ; 128 c7e6: b0 ec ldi r27, 0xC0 ; 192 clamped = true; } else if (tmpy > Y_MAX_POS) { tmpy = Y_MAX_POS; c7e8: 8d 83 std Y+5, r24 ; 0x05 c7ea: 9e 83 std Y+6, r25 ; 0x06 c7ec: af 83 std Y+7, r26 ; 0x07 c7ee: b8 87 std Y+8, r27 ; 0x08 clamped = true; } if (clamped) machine2world(tmpx, tmpy, x, y); c7f0: cd 80 ldd r12, Y+5 ; 0x05 c7f2: de 80 ldd r13, Y+6 ; 0x06 c7f4: ef 80 ldd r14, Y+7 ; 0x07 c7f6: f8 84 ldd r15, Y+8 ; 0x08 c7f8: 89 80 ldd r8, Y+1 ; 0x01 c7fa: 9a 80 ldd r9, Y+2 ; 0x02 c7fc: ab 80 ldd r10, Y+3 ; 0x03 c7fe: 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) { c800: 70 90 dc 16 lds r7, 0x16DC ; 0x8016dc c804: 71 10 cpse r7, r1 c806: 4c c0 rjmp .+152 ; 0xc8a0 // No correction. out_x = x; c808: f8 01 movw r30, r16 c80a: 80 82 st Z, r8 c80c: 91 82 std Z+1, r9 ; 0x01 c80e: a2 82 std Z+2, r10 ; 0x02 c810: b3 82 std Z+3, r11 ; 0x03 out_y = y; c812: f1 01 movw r30, r2 c814: c0 82 st Z, r12 c816: d1 82 std Z+1, r13 ; 0x01 c818: e2 82 std Z+2, r14 ; 0x02 c81a: 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) { c81c: ff 24 eor r15, r15 c81e: f3 94 inc r15 c820: 25 c0 rjmp .+74 ; 0xc86c 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) { c822: 20 e0 ldi r18, 0x00 ; 0 c824: 30 e0 ldi r19, 0x00 ; 0 c826: 4a e7 ldi r20, 0x7A ; 122 c828: 53 e4 ldi r21, 0x43 ; 67 c82a: c7 01 movw r24, r14 c82c: b6 01 movw r22, r12 c82e: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> } } inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; c832: 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) { c834: 18 16 cp r1, r24 c836: 34 f6 brge .-116 ; 0xc7c4 tmpx = X_MAX_POS; c838: 80 e0 ldi r24, 0x00 ; 0 c83a: 90 e0 ldi r25, 0x00 ; 0 c83c: aa e7 ldi r26, 0x7A ; 122 c83e: b3 e4 ldi r27, 0x43 ; 67 c840: 89 83 std Y+1, r24 ; 0x01 c842: 9a 83 std Y+2, r25 ; 0x02 c844: ab 83 std Y+3, r26 ; 0x03 c846: bc 83 std Y+4, r27 ; 0x04 c848: bb cf rjmp .-138 ; 0xc7c0 } if (tmpy < Y_MIN_POS) { tmpy = Y_MIN_POS; clamped = true; } else if (tmpy > Y_MAX_POS) { c84a: 20 e0 ldi r18, 0x00 ; 0 c84c: 30 e0 ldi r19, 0x00 ; 0 c84e: 42 e5 ldi r20, 0x52 ; 82 c850: 53 e4 ldi r21, 0x43 ; 67 c852: c5 01 movw r24, r10 c854: b4 01 movw r22, r8 c856: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> c85a: 18 16 cp r1, r24 c85c: 2c f4 brge .+10 ; 0xc868 tmpy = Y_MAX_POS; c85e: 80 e0 ldi r24, 0x00 ; 0 c860: 90 e0 ldi r25, 0x00 ; 0 c862: a2 e5 ldi r26, 0x52 ; 82 c864: b3 e4 ldi r27, 0x43 ; 67 c866: c0 cf rjmp .-128 ; 0xc7e8 clamped = true; } if (clamped) c868: f1 10 cpse r15, r1 c86a: c2 cf rjmp .-124 ; 0xc7f0 machine2world(tmpx, tmpy, x, y); return clamped; } c86c: 8f 2d mov r24, r15 c86e: 28 96 adiw r28, 0x08 ; 8 c870: 0f b6 in r0, 0x3f ; 63 c872: f8 94 cli c874: de bf out 0x3e, r29 ; 62 c876: 0f be out 0x3f, r0 ; 63 c878: cd bf out 0x3d, r28 ; 61 c87a: df 91 pop r29 c87c: cf 91 pop r28 c87e: 1f 91 pop r17 c880: 0f 91 pop r16 c882: ff 90 pop r15 c884: ef 90 pop r14 c886: df 90 pop r13 c888: cf 90 pop r12 c88a: bf 90 pop r11 c88c: af 90 pop r10 c88e: 9f 90 pop r9 c890: 8f 90 pop r8 c892: 7f 90 pop r7 c894: 6f 90 pop r6 c896: 5f 90 pop r5 c898: 4f 90 pop r4 c89a: 3f 90 pop r3 c89c: 2f 90 pop r2 c89e: 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) { c8a0: 70 fe sbrs r7, 0 c8a2: 1c c0 rjmp .+56 ; 0xc8dc // Then add the offset. x -= world2machine_shift[0]; c8a4: 20 91 d4 16 lds r18, 0x16D4 ; 0x8016d4 c8a8: 30 91 d5 16 lds r19, 0x16D5 ; 0x8016d5 c8ac: 40 91 d6 16 lds r20, 0x16D6 ; 0x8016d6 c8b0: 50 91 d7 16 lds r21, 0x16D7 ; 0x8016d7 c8b4: c5 01 movw r24, r10 c8b6: b4 01 movw r22, r8 c8b8: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> c8bc: 4b 01 movw r8, r22 c8be: 5c 01 movw r10, r24 y -= world2machine_shift[1]; c8c0: 20 91 d8 16 lds r18, 0x16D8 ; 0x8016d8 c8c4: 30 91 d9 16 lds r19, 0x16D9 ; 0x8016d9 c8c8: 40 91 da 16 lds r20, 0x16DA ; 0x8016da c8cc: 50 91 db 16 lds r21, 0x16DB ; 0x8016db c8d0: c7 01 movw r24, r14 c8d2: b6 01 movw r22, r12 c8d4: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> c8d8: 6b 01 movw r12, r22 c8da: 7c 01 movw r14, r24 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { c8dc: 71 fe sbrs r7, 1 c8de: 9e cf rjmp .-196 ; 0xc81c // Firs the skew & rotation correction. out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; c8e0: 20 91 c4 16 lds r18, 0x16C4 ; 0x8016c4 c8e4: 30 91 c5 16 lds r19, 0x16C5 ; 0x8016c5 c8e8: 40 91 c6 16 lds r20, 0x16C6 ; 0x8016c6 c8ec: 50 91 c7 16 lds r21, 0x16C7 ; 0x8016c7 c8f0: c5 01 movw r24, r10 c8f2: b4 01 movw r22, r8 c8f4: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> c8f8: 2b 01 movw r4, r22 c8fa: 3c 01 movw r6, r24 c8fc: 20 91 c8 16 lds r18, 0x16C8 ; 0x8016c8 c900: 30 91 c9 16 lds r19, 0x16C9 ; 0x8016c9 c904: 40 91 ca 16 lds r20, 0x16CA ; 0x8016ca c908: 50 91 cb 16 lds r21, 0x16CB ; 0x8016cb c90c: c7 01 movw r24, r14 c90e: b6 01 movw r22, r12 c910: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> c914: 9b 01 movw r18, r22 c916: ac 01 movw r20, r24 c918: c3 01 movw r24, r6 c91a: b2 01 movw r22, r4 c91c: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> c920: f8 01 movw r30, r16 c922: 60 83 st Z, r22 c924: 71 83 std Z+1, r23 ; 0x01 c926: 82 83 std Z+2, r24 ; 0x02 c928: 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; c92a: 20 91 cc 16 lds r18, 0x16CC ; 0x8016cc c92e: 30 91 cd 16 lds r19, 0x16CD ; 0x8016cd c932: 40 91 ce 16 lds r20, 0x16CE ; 0x8016ce c936: 50 91 cf 16 lds r21, 0x16CF ; 0x8016cf c93a: c5 01 movw r24, r10 c93c: b4 01 movw r22, r8 c93e: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> c942: 4b 01 movw r8, r22 c944: 5c 01 movw r10, r24 c946: 20 91 d0 16 lds r18, 0x16D0 ; 0x8016d0 c94a: 30 91 d1 16 lds r19, 0x16D1 ; 0x8016d1 c94e: 40 91 d2 16 lds r20, 0x16D2 ; 0x8016d2 c952: 50 91 d3 16 lds r21, 0x16D3 ; 0x8016d3 c956: c7 01 movw r24, r14 c958: b6 01 movw r22, r12 c95a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> c95e: 9b 01 movw r18, r22 c960: ac 01 movw r20, r24 c962: c5 01 movw r24, r10 c964: b4 01 movw r22, r8 c966: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> c96a: f1 01 movw r30, r2 c96c: 60 83 st Z, r22 c96e: 71 83 std Z+1, r23 ; 0x01 c970: 82 83 std Z+2, r24 ; 0x02 c972: 93 83 std Z+3, r25 ; 0x03 c974: 53 cf rjmp .-346 ; 0xc81c 0000c976 : if(next_feedrate > 0.f) feedrate = next_feedrate; } } void clamp_to_software_endstops(float target[3]) { c976: cf 92 push r12 c978: df 92 push r13 c97a: ef 92 push r14 c97c: ff 92 push r15 c97e: cf 93 push r28 c980: df 93 push r29 c982: ec 01 movw r28, r24 #ifdef DEBUG_DISABLE_SWLIMITS return; #endif //DEBUG_DISABLE_SWLIMITS world2machine_clamp(target[0], target[1]); c984: bc 01 movw r22, r24 c986: 6c 5f subi r22, 0xFC ; 252 c988: 7f 4f sbci r23, 0xFF ; 255 c98a: 0e 94 9c 63 call 0xc738 ; 0xc738 // Clamp the Z coordinate. if (min_software_endstops) { if (target[Z_AXIS] < min_pos[Z_AXIS]) target[Z_AXIS] = min_pos[Z_AXIS]; c98e: c0 90 2c 02 lds r12, 0x022C ; 0x80022c c992: d0 90 2d 02 lds r13, 0x022D ; 0x80022d c996: e0 90 2e 02 lds r14, 0x022E ; 0x80022e c99a: f0 90 2f 02 lds r15, 0x022F ; 0x80022f c99e: a7 01 movw r20, r14 c9a0: 96 01 movw r18, r12 c9a2: 68 85 ldd r22, Y+8 ; 0x08 c9a4: 79 85 ldd r23, Y+9 ; 0x09 c9a6: 8a 85 ldd r24, Y+10 ; 0x0a c9a8: 9b 85 ldd r25, Y+11 ; 0x0b c9aa: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> c9ae: 87 ff sbrs r24, 7 c9b0: 04 c0 rjmp .+8 ; 0xc9ba c9b2: c8 86 std Y+8, r12 ; 0x08 c9b4: d9 86 std Y+9, r13 ; 0x09 c9b6: ea 86 std Y+10, r14 ; 0x0a c9b8: 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]; c9ba: c0 90 20 02 lds r12, 0x0220 ; 0x800220 c9be: d0 90 21 02 lds r13, 0x0221 ; 0x800221 c9c2: e0 90 22 02 lds r14, 0x0222 ; 0x800222 c9c6: f0 90 23 02 lds r15, 0x0223 ; 0x800223 c9ca: a7 01 movw r20, r14 c9cc: 96 01 movw r18, r12 c9ce: 68 85 ldd r22, Y+8 ; 0x08 c9d0: 79 85 ldd r23, Y+9 ; 0x09 c9d2: 8a 85 ldd r24, Y+10 ; 0x0a c9d4: 9b 85 ldd r25, Y+11 ; 0x0b c9d6: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> c9da: 18 16 cp r1, r24 c9dc: 24 f4 brge .+8 ; 0xc9e6 c9de: c8 86 std Y+8, r12 ; 0x08 c9e0: d9 86 std Y+9, r13 ; 0x09 c9e2: ea 86 std Y+10, r14 ; 0x0a c9e4: fb 86 std Y+11, r15 ; 0x0b } } c9e6: df 91 pop r29 c9e8: cf 91 pop r28 c9ea: ff 90 pop r15 c9ec: ef 90 pop r14 c9ee: df 90 pop r13 c9f0: cf 90 pop r12 c9f2: 08 95 ret 0000c9f4 : plan_buffer_line(x, y, z, e, feed_rate, current_position); } #endif // MESH_BED_LEVELING void prepare_move(uint16_t start_segment_idx) { c9f4: 2f 92 push r2 c9f6: 3f 92 push r3 c9f8: 4f 92 push r4 c9fa: 5f 92 push r5 c9fc: 6f 92 push r6 c9fe: 7f 92 push r7 ca00: 8f 92 push r8 ca02: 9f 92 push r9 ca04: af 92 push r10 ca06: bf 92 push r11 ca08: cf 92 push r12 ca0a: df 92 push r13 ca0c: ef 92 push r14 ca0e: ff 92 push r15 ca10: 0f 93 push r16 ca12: 1f 93 push r17 ca14: cf 93 push r28 ca16: df 93 push r29 ca18: cd b7 in r28, 0x3d ; 61 ca1a: de b7 in r29, 0x3e ; 62 ca1c: a2 97 sbiw r28, 0x22 ; 34 ca1e: 0f b6 in r0, 0x3f ; 63 ca20: f8 94 cli ca22: de bf out 0x3e, r29 ; 62 ca24: 0f be out 0x3f, r0 ; 63 ca26: cd bf out 0x3d, r28 ; 61 ca28: 1c 01 movw r2, r24 clamp_to_software_endstops(destination); ca2a: 83 e9 ldi r24, 0x93 ; 147 ca2c: 96 e0 ldi r25, 0x06 ; 6 ca2e: 0e 94 bb 64 call 0xc976 ; 0xc976 previous_millis_cmd.start(); ca32: 8a e4 ldi r24, 0x4A ; 74 ca34: 93 e0 ldi r25, 0x03 ; 3 ca36: 0f 94 29 12 call 0x22452 ; 0x22452 ::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])) { ca3a: 40 90 f5 11 lds r4, 0x11F5 ; 0x8011f5 ca3e: 50 90 f6 11 lds r5, 0x11F6 ; 0x8011f6 ca42: 60 90 f7 11 lds r6, 0x11F7 ; 0x8011f7 ca46: 70 90 f8 11 lds r7, 0x11F8 ; 0x8011f8 ca4a: c0 90 93 06 lds r12, 0x0693 ; 0x800693 ca4e: d0 90 94 06 lds r13, 0x0694 ; 0x800694 ca52: e0 90 95 06 lds r14, 0x0695 ; 0x800695 ca56: f0 90 96 06 lds r15, 0x0696 ; 0x800696 ca5a: a7 01 movw r20, r14 ca5c: 96 01 movw r18, r12 ca5e: c3 01 movw r24, r6 ca60: b2 01 movw r22, r4 ca62: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> ca66: 81 11 cpse r24, r1 ca68: 3f c0 rjmp .+126 ; 0xcae8 ca6a: 20 91 97 06 lds r18, 0x0697 ; 0x800697 ca6e: 30 91 98 06 lds r19, 0x0698 ; 0x800698 ca72: 40 91 99 06 lds r20, 0x0699 ; 0x800699 ca76: 50 91 9a 06 lds r21, 0x069A ; 0x80069a ca7a: 60 91 f9 11 lds r22, 0x11F9 ; 0x8011f9 ca7e: 70 91 fa 11 lds r23, 0x11FA ; 0x8011fa ca82: 80 91 fb 11 lds r24, 0x11FB ; 0x8011fb ca86: 90 91 fc 11 lds r25, 0x11FC ; 0x8011fc ca8a: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> ca8e: 81 11 cpse r24, r1 ca90: 2b c0 rjmp .+86 ; 0xcae8 plan_buffer_line_destinationXYZE(feedrate/60); ca92: 20 e0 ldi r18, 0x00 ; 0 ca94: 30 e0 ldi r19, 0x00 ; 0 ca96: 40 e7 ldi r20, 0x70 ; 112 ca98: 52 e4 ldi r21, 0x42 ; 66 ca9a: 60 91 7a 02 lds r22, 0x027A ; 0x80027a ca9e: 70 91 7b 02 lds r23, 0x027B ; 0x80027b caa2: 80 91 7c 02 lds r24, 0x027C ; 0x80027c caa6: 90 91 7d 02 lds r25, 0x027D ; 0x80027d caaa: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> caae: 0f 94 fc 84 call 0x309f8 ; 0x309f8 #else plan_buffer_line_destinationXYZE(feedrate*feedmultiply*(1./(60.f*100.f))); #endif } set_current_to_destination(); cab2: 0e 94 ac 54 call 0xa958 ; 0xa958 } cab6: a2 96 adiw r28, 0x22 ; 34 cab8: 0f b6 in r0, 0x3f ; 63 caba: f8 94 cli cabc: de bf out 0x3e, r29 ; 62 cabe: 0f be out 0x3f, r0 ; 63 cac0: cd bf out 0x3d, r28 ; 61 cac2: df 91 pop r29 cac4: cf 91 pop r28 cac6: 1f 91 pop r17 cac8: 0f 91 pop r16 caca: ff 90 pop r15 cacc: ef 90 pop r14 cace: df 90 pop r13 cad0: cf 90 pop r12 cad2: bf 90 pop r11 cad4: af 90 pop r10 cad6: 9f 90 pop r9 cad8: 8f 90 pop r8 cada: 7f 90 pop r7 cadc: 6f 90 pop r6 cade: 5f 90 pop r5 cae0: 4f 90 pop r4 cae2: 3f 90 pop r3 cae4: 2f 90 pop r2 cae6: 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); cae8: 60 91 8e 02 lds r22, 0x028E ; 0x80028e caec: 70 91 8f 02 lds r23, 0x028F ; 0x80028f caf0: 07 2e mov r0, r23 caf2: 00 0c add r0, r0 caf4: 88 0b sbc r24, r24 caf6: 99 0b sbc r25, r25 caf8: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> cafc: 20 91 7a 02 lds r18, 0x027A ; 0x80027a cb00: 30 91 7b 02 lds r19, 0x027B ; 0x80027b cb04: 40 91 7c 02 lds r20, 0x027C ; 0x80027c cb08: 50 91 7d 02 lds r21, 0x027D ; 0x80027d cb0c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> cb10: 2e e3 ldi r18, 0x3E ; 62 cb12: 33 ec ldi r19, 0xC3 ; 195 cb14: 4e e2 ldi r20, 0x2E ; 46 cb16: 59 e3 ldi r21, 0x39 ; 57 cb18: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> cb1c: 6f 83 std Y+7, r22 ; 0x07 cb1e: 78 87 std Y+8, r23 ; 0x08 cb20: 89 87 std Y+9, r24 ; 0x09 cb22: 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) { cb24: 80 91 9c 12 lds r24, 0x129C ; 0x80129c cb28: 88 23 and r24, r24 cb2a: 09 f4 brne .+2 ; 0xcb2e cb2c: 0f c1 rjmp .+542 ; 0xcd4c 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]; cb2e: a3 01 movw r20, r6 cb30: 92 01 movw r18, r4 cb32: c7 01 movw r24, r14 cb34: b6 01 movw r22, r12 cb36: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> cb3a: 2b 01 movw r4, r22 cb3c: 3c 01 movw r6, r24 float dy = y - current_position[Y_AXIS]; cb3e: 20 91 f9 11 lds r18, 0x11F9 ; 0x8011f9 cb42: 30 91 fa 11 lds r19, 0x11FA ; 0x8011fa cb46: 40 91 fb 11 lds r20, 0x11FB ; 0x8011fb cb4a: 50 91 fc 11 lds r21, 0x11FC ; 0x8011fc cb4e: 60 91 97 06 lds r22, 0x0697 ; 0x800697 cb52: 70 91 98 06 lds r23, 0x0698 ; 0x800698 cb56: 80 91 99 06 lds r24, 0x0699 ; 0x800699 cb5a: 90 91 9a 06 lds r25, 0x069A ; 0x80069a cb5e: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> cb62: 6b 87 std Y+11, r22 ; 0x0b cb64: 7c 87 std Y+12, r23 ; 0x0c cb66: 8d 87 std Y+13, r24 ; 0x0d cb68: 9e 87 std Y+14, r25 ; 0x0e uint16_t n_segments = 0; if (mbl.active) { float len = fabs(dx) + fabs(dy); cb6a: c3 01 movw r24, r6 cb6c: b2 01 movw r22, r4 cb6e: 9f 77 andi r25, 0x7F ; 127 cb70: 2b 85 ldd r18, Y+11 ; 0x0b cb72: 3c 85 ldd r19, Y+12 ; 0x0c cb74: 4d 85 ldd r20, Y+13 ; 0x0d cb76: 5e 85 ldd r21, Y+14 ; 0x0e cb78: 5f 77 andi r21, 0x7F ; 127 cb7a: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> cb7e: 6b 01 movw r12, r22 cb80: 7c 01 movw r14, r24 if (len > 0) cb82: 20 e0 ldi r18, 0x00 ; 0 cb84: 30 e0 ldi r19, 0x00 ; 0 cb86: a9 01 movw r20, r18 cb88: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> cb8c: 18 16 cp r1, r24 cb8e: 0c f0 brlt .+2 ; 0xcb92 cb90: dd c0 rjmp .+442 ; 0xcd4c // Split to 3cm segments or shorter. n_segments = uint16_t(ceil(len / 30.f)); cb92: 20 e0 ldi r18, 0x00 ; 0 cb94: 30 e0 ldi r19, 0x00 ; 0 cb96: 40 ef ldi r20, 0xF0 ; 240 cb98: 51 e4 ldi r21, 0x41 ; 65 cb9a: c7 01 movw r24, r14 cb9c: b6 01 movw r22, r12 cb9e: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> cba2: 0f 94 a1 a2 call 0x34542 ; 0x34542 cba6: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> cbaa: 7e 83 std Y+6, r23 ; 0x06 cbac: 6d 83 std Y+5, r22 ; 0x05 } if (n_segments > 1 && start_segment_idx) { cbae: 62 30 cpi r22, 0x02 ; 2 cbb0: 71 05 cpc r23, r1 cbb2: 08 f4 brcc .+2 ; 0xcbb6 cbb4: cb c0 rjmp .+406 ; 0xcd4c cbb6: 21 14 cp r2, r1 cbb8: 31 04 cpc r3, r1 cbba: 09 f4 brne .+2 ; 0xcbbe cbbc: c7 c0 rjmp .+398 ; 0xcd4c float dz = z - current_position[Z_AXIS]; cbbe: 20 91 fd 11 lds r18, 0x11FD ; 0x8011fd cbc2: 30 91 fe 11 lds r19, 0x11FE ; 0x8011fe cbc6: 40 91 ff 11 lds r20, 0x11FF ; 0x8011ff cbca: 50 91 00 12 lds r21, 0x1200 ; 0x801200 cbce: 60 91 9b 06 lds r22, 0x069B ; 0x80069b cbd2: 70 91 9c 06 lds r23, 0x069C ; 0x80069c cbd6: 80 91 9d 06 lds r24, 0x069D ; 0x80069d cbda: 90 91 9e 06 lds r25, 0x069E ; 0x80069e cbde: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> cbe2: 6f 87 std Y+15, r22 ; 0x0f cbe4: 78 8b std Y+16, r23 ; 0x10 cbe6: 89 8b std Y+17, r24 ; 0x11 cbe8: 9a 8b std Y+18, r25 ; 0x12 float de = e - current_position[E_AXIS]; cbea: 20 91 01 12 lds r18, 0x1201 ; 0x801201 cbee: 30 91 02 12 lds r19, 0x1202 ; 0x801202 cbf2: 40 91 03 12 lds r20, 0x1203 ; 0x801203 cbf6: 50 91 04 12 lds r21, 0x1204 ; 0x801204 cbfa: 60 91 9f 06 lds r22, 0x069F ; 0x80069f cbfe: 70 91 a0 06 lds r23, 0x06A0 ; 0x8006a0 cc02: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 cc06: 90 91 a2 06 lds r25, 0x06A2 ; 0x8006a2 cc0a: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> cc0e: 6b 8b std Y+19, r22 ; 0x13 cc10: 7c 8b std Y+20, r23 ; 0x14 cc12: 8d 8b std Y+21, r24 ; 0x15 cc14: 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); cc16: ad 81 ldd r26, Y+5 ; 0x05 cc18: be 81 ldd r27, Y+6 ; 0x06 cc1a: cd 01 movw r24, r26 cc1c: b0 e0 ldi r27, 0x00 ; 0 cc1e: a0 e0 ldi r26, 0x00 ; 0 cc20: 8f 8f std Y+31, r24 ; 0x1f cc22: 98 a3 std Y+32, r25 ; 0x20 cc24: a9 a3 std Y+33, r26 ; 0x21 cc26: 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) { cc28: 2d 81 ldd r18, Y+5 ; 0x05 cc2a: 3e 81 ldd r19, Y+6 ; 0x06 cc2c: 22 16 cp r2, r18 cc2e: 33 06 cpc r3, r19 cc30: 08 f0 brcs .+2 ; 0xcc34 cc32: 8c c0 rjmp .+280 ; 0xcd4c float t = float(i) / float(n_segments); cc34: b1 01 movw r22, r2 cc36: 90 e0 ldi r25, 0x00 ; 0 cc38: 80 e0 ldi r24, 0x00 ; 0 cc3a: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> cc3e: 6b 01 movw r12, r22 cc40: 7c 01 movw r14, r24 cc42: 6f 8d ldd r22, Y+31 ; 0x1f cc44: 78 a1 ldd r23, Y+32 ; 0x20 cc46: 89 a1 ldd r24, Y+33 ; 0x21 cc48: 9a a1 ldd r25, Y+34 ; 0x22 cc4a: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> cc4e: 9b 01 movw r18, r22 cc50: ac 01 movw r20, r24 cc52: c7 01 movw r24, r14 cc54: b6 01 movw r22, r12 cc56: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> cc5a: 6b 01 movw r12, r22 cc5c: 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, cc5e: ac 01 movw r20, r24 cc60: 9b 01 movw r18, r22 cc62: 6b 89 ldd r22, Y+19 ; 0x13 cc64: 7c 89 ldd r23, Y+20 ; 0x14 cc66: 8d 89 ldd r24, Y+21 ; 0x15 cc68: 9e 89 ldd r25, Y+22 ; 0x16 cc6a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> cc6e: 9b 01 movw r18, r22 cc70: ac 01 movw r20, r24 cc72: 60 91 01 12 lds r22, 0x1201 ; 0x801201 cc76: 70 91 02 12 lds r23, 0x1202 ; 0x801202 cc7a: 80 91 03 12 lds r24, 0x1203 ; 0x801203 cc7e: 90 91 04 12 lds r25, 0x1204 ; 0x801204 cc82: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> cc86: 69 83 std Y+1, r22 ; 0x01 cc88: 7a 83 std Y+2, r23 ; 0x02 cc8a: 8b 83 std Y+3, r24 ; 0x03 cc8c: 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, cc8e: a7 01 movw r20, r14 cc90: 96 01 movw r18, r12 cc92: 6f 85 ldd r22, Y+15 ; 0x0f cc94: 78 89 ldd r23, Y+16 ; 0x10 cc96: 89 89 ldd r24, Y+17 ; 0x11 cc98: 9a 89 ldd r25, Y+18 ; 0x12 cc9a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__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, cc9e: 20 91 fd 11 lds r18, 0x11FD ; 0x8011fd cca2: 30 91 fe 11 lds r19, 0x11FE ; 0x8011fe cca6: 40 91 ff 11 lds r20, 0x11FF ; 0x8011ff ccaa: 50 91 00 12 lds r21, 0x1200 ; 0x801200 ccae: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> ccb2: 6f 8b std Y+23, r22 ; 0x17 ccb4: 78 8f std Y+24, r23 ; 0x18 ccb6: 89 8f std Y+25, r24 ; 0x19 ccb8: 9a 8f std Y+26, r25 ; 0x1a current_position[Y_AXIS] + t * dy, ccba: a7 01 movw r20, r14 ccbc: 96 01 movw r18, r12 ccbe: 6b 85 ldd r22, Y+11 ; 0x0b ccc0: 7c 85 ldd r23, Y+12 ; 0x0c ccc2: 8d 85 ldd r24, Y+13 ; 0x0d ccc4: 9e 85 ldd r25, Y+14 ; 0x0e ccc6: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__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, ccca: 20 91 f9 11 lds r18, 0x11F9 ; 0x8011f9 ccce: 30 91 fa 11 lds r19, 0x11FA ; 0x8011fa ccd2: 40 91 fb 11 lds r20, 0x11FB ; 0x8011fb ccd6: 50 91 fc 11 lds r21, 0x11FC ; 0x8011fc ccda: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> ccde: 6b 8f std Y+27, r22 ; 0x1b cce0: 7c 8f std Y+28, r23 ; 0x1c cce2: 8d 8f std Y+29, r24 ; 0x1d cce4: 9e 8f std Y+30, r25 ; 0x1e cce6: a7 01 movw r20, r14 cce8: 96 01 movw r18, r12 ccea: c3 01 movw r24, r6 ccec: b2 01 movw r22, r4 ccee: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> ccf2: 20 91 f5 11 lds r18, 0x11F5 ; 0x8011f5 ccf6: 30 91 f6 11 lds r19, 0x11F6 ; 0x8011f6 ccfa: 40 91 f7 11 lds r20, 0x11F7 ; 0x8011f7 ccfe: 50 91 f8 11 lds r21, 0x11F8 ; 0x8011f8 cd02: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> cd06: 3f 92 push r3 cd08: 2f 92 push r2 cd0a: a5 ef ldi r26, 0xF5 ; 245 cd0c: b1 e1 ldi r27, 0x11 ; 17 cd0e: bf 93 push r27 cd10: af 93 push r26 cd12: 8f 80 ldd r8, Y+7 ; 0x07 cd14: 98 84 ldd r9, Y+8 ; 0x08 cd16: a9 84 ldd r10, Y+9 ; 0x09 cd18: ba 84 ldd r11, Y+10 ; 0x0a cd1a: de 01 movw r26, r28 cd1c: 11 96 adiw r26, 0x01 ; 1 cd1e: 6d 01 movw r12, r26 cd20: ef 88 ldd r14, Y+23 ; 0x17 cd22: f8 8c ldd r15, Y+24 ; 0x18 cd24: 09 8d ldd r16, Y+25 ; 0x19 cd26: 1a 8d ldd r17, Y+26 ; 0x1a cd28: 2b 8d ldd r18, Y+27 ; 0x1b cd2a: 3c 8d ldd r19, Y+28 ; 0x1c cd2c: 4d 8d ldd r20, Y+29 ; 0x1d cd2e: 5e 8d ldd r21, Y+30 ; 0x1e cd30: 0f 94 e1 75 call 0x2ebc2 ; 0x2ebc2 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) cd34: 0f 90 pop r0 cd36: 0f 90 pop r0 cd38: 0f 90 pop r0 cd3a: 0f 90 pop r0 cd3c: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac cd40: 81 11 cpse r24, r1 cd42: b7 ce rjmp .-658 ; 0xcab2 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) { cd44: bf ef ldi r27, 0xFF ; 255 cd46: 2b 1a sub r2, r27 cd48: 3b 0a sbc r3, r27 cd4a: 6e cf rjmp .-292 ; 0xcc28 if (planner_aborted) return; } } // The rest of the path. plan_buffer_line(x, y, z, e, feed_rate, current_position); cd4c: e0 90 9b 06 lds r14, 0x069B ; 0x80069b cd50: f0 90 9c 06 lds r15, 0x069C ; 0x80069c cd54: 00 91 9d 06 lds r16, 0x069D ; 0x80069d cd58: 10 91 9e 06 lds r17, 0x069E ; 0x80069e cd5c: 20 91 97 06 lds r18, 0x0697 ; 0x800697 cd60: 30 91 98 06 lds r19, 0x0698 ; 0x800698 cd64: 40 91 99 06 lds r20, 0x0699 ; 0x800699 cd68: 50 91 9a 06 lds r21, 0x069A ; 0x80069a cd6c: 60 91 93 06 lds r22, 0x0693 ; 0x800693 cd70: 70 91 94 06 lds r23, 0x0694 ; 0x800694 cd74: 80 91 95 06 lds r24, 0x0695 ; 0x800695 cd78: 90 91 96 06 lds r25, 0x0696 ; 0x800696 cd7c: 1f 92 push r1 cd7e: 1f 92 push r1 cd80: e5 ef ldi r30, 0xF5 ; 245 cd82: f1 e1 ldi r31, 0x11 ; 17 cd84: ff 93 push r31 cd86: ef 93 push r30 cd88: 8f 80 ldd r8, Y+7 ; 0x07 cd8a: 98 84 ldd r9, Y+8 ; 0x08 cd8c: a9 84 ldd r10, Y+9 ; 0x09 cd8e: ba 84 ldd r11, Y+10 ; 0x0a cd90: ef e9 ldi r30, 0x9F ; 159 cd92: ce 2e mov r12, r30 cd94: e6 e0 ldi r30, 0x06 ; 6 cd96: de 2e mov r13, r30 cd98: 0f 94 e1 75 call 0x2ebc2 ; 0x2ebc2 cd9c: 0f 90 pop r0 cd9e: 0f 90 pop r0 cda0: 0f 90 pop r0 cda2: 0f 90 pop r0 cda4: 86 ce rjmp .-756 ; 0xcab2 0000cda6 : /// @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) { cda6: cf 92 push r12 cda8: df 92 push r13 cdaa: ef 92 push r14 cdac: ff 92 push r15 cdae: cf 93 push r28 float travel_z = current_position[Z_AXIS]; cdb0: c0 90 fd 11 lds r12, 0x11FD ; 0x8011fd cdb4: d0 90 fe 11 lds r13, 0x11FE ; 0x8011fe cdb8: e0 90 ff 11 lds r14, 0x11FF ; 0x8011ff cdbc: f0 90 00 12 lds r15, 0x1200 ; 0x801200 // Prepare to move Z axis current_position[Z_AXIS] += delta; cdc0: a7 01 movw r20, r14 cdc2: 96 01 movw r18, r12 cdc4: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> cdc8: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd cdcc: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe cdd0: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff cdd4: 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); cdd8: 83 b1 in r24, 0x03 ; 3 #else bool z_min_endstop = false; #endif if (axis_known_position[Z_AXIS] || z_min_endstop) cdda: 90 91 a5 06 lds r25, 0x06A5 ; 0x8006a5 cdde: 91 11 cpse r25, r1 cde0: 02 c0 rjmp .+4 ; 0xcde6 cde2: 84 ff sbrs r24, 4 cde4: 26 c0 rjmp .+76 ; 0xce32 { // current position is known or very low, it's safe to raise Z clamp_to_software_endstops(current_position); cde6: 85 ef ldi r24, 0xF5 ; 245 cde8: 91 e1 ldi r25, 0x11 ; 17 cdea: 0e 94 bb 64 call 0xc976 ; 0xc976 plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); cdee: 60 91 4e 04 lds r22, 0x044E ; 0x80044e cdf2: 70 91 4f 04 lds r23, 0x044F ; 0x80044f cdf6: 80 91 50 04 lds r24, 0x0450 ; 0x800450 cdfa: 90 91 51 04 lds r25, 0x0451 ; 0x800451 cdfe: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); ce02: 0f 94 ce 22 call 0x2459c ; 0x2459c // Get the final travel distance travel_z = current_position[Z_AXIS] - travel_z; ce06: a7 01 movw r20, r14 ce08: 96 01 movw r18, r12 ce0a: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd ce0e: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe ce12: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff ce16: 90 91 00 12 lds r25, 0x1200 ; 0x801200 ce1a: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> ce1e: 6b 01 movw r12, r22 ce20: 7c 01 movw r14, r24 #endif //TMC2130 enable_z_endstop(z_endstop_enabled); } return travel_z; } ce22: c7 01 movw r24, r14 ce24: b6 01 movw r22, r12 ce26: cf 91 pop r28 ce28: ff 90 pop r15 ce2a: ef 90 pop r14 ce2c: df 90 pop r13 ce2e: cf 90 pop r12 ce30: 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(); ce32: 15 98 cbi 0x02, 5 ; 2 st_synchronize(); ce34: 0f 94 ce 22 call 0x2459c ; 0x2459c // rely on crashguard to limit damage bool z_endstop_enabled = enable_z_endstop(true); ce38: 81 e0 ldi r24, 0x01 ; 1 ce3a: 0f 94 06 2d call 0x25a0c ; 0x25a0c ce3e: c8 2f mov r28, r24 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); ce40: 65 e5 ldi r22, 0x55 ; 85 ce42: 75 e5 ldi r23, 0x55 ; 85 ce44: 85 e5 ldi r24, 0x55 ; 85 ce46: 91 e4 ldi r25, 0x41 ; 65 ce48: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); ce4c: 0f 94 ce 22 call 0x2459c ; 0x2459c // Get the final travel distance travel_z = st_get_position_mm(Z_AXIS) - travel_z; ce50: 82 e0 ldi r24, 0x02 ; 2 ce52: 0f 94 ba 22 call 0x24574 ; 0x24574 ce56: a7 01 movw r20, r14 ce58: 96 01 movw r18, r12 ce5a: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> ce5e: 6b 01 movw r12, r22 ce60: 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); ce62: 8c 2f mov r24, r28 ce64: 0f 94 06 2d call 0x25a0c ; 0x25a0c ce68: dc cf rjmp .-72 ; 0xce22 0000ce6a : // // 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) { ce6a: 8f 92 push r8 ce6c: 9f 92 push r9 ce6e: af 92 push r10 ce70: bf 92 push r11 ce72: cf 92 push r12 ce74: df 92 push r13 ce76: ef 92 push r14 ce78: ff 92 push r15 ce7a: 4b 01 movw r8, r22 ce7c: 5c 01 movw r10, r24 if (current_position[Z_AXIS] >= target) ce7e: c0 90 fd 11 lds r12, 0x11FD ; 0x8011fd ce82: d0 90 fe 11 lds r13, 0x11FE ; 0x8011fe ce86: e0 90 ff 11 lds r14, 0x11FF ; 0x8011ff ce8a: f0 90 00 12 lds r15, 0x1200 ; 0x801200 ce8e: ac 01 movw r20, r24 ce90: 9b 01 movw r18, r22 ce92: c7 01 movw r24, r14 ce94: b6 01 movw r22, r12 ce96: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> ce9a: 87 ff sbrs r24, 7 ce9c: 11 c0 rjmp .+34 ; 0xcec0 return; // Use absolute value in case the current position is unknown raise_z(fabs(current_position[Z_AXIS] - target)); ce9e: a5 01 movw r20, r10 cea0: 94 01 movw r18, r8 cea2: c7 01 movw r24, r14 cea4: b6 01 movw r22, r12 cea6: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> ceaa: 9f 77 andi r25, 0x7F ; 127 } ceac: ff 90 pop r15 ceae: ef 90 pop r14 ceb0: df 90 pop r13 ceb2: cf 90 pop r12 ceb4: bf 90 pop r11 ceb6: af 90 pop r10 ceb8: 9f 90 pop r9 ceba: 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)); cebc: 0c 94 d3 66 jmp 0xcda6 ; 0xcda6 } 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 ced0: 08 95 ret 0000ced2 : #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 { ced2: 2f 92 push r2 ced4: 3f 92 push r3 ced6: 4f 92 push r4 ced8: 5f 92 push r5 ceda: 6f 92 push r6 cedc: 7f 92 push r7 cede: 8f 92 push r8 cee0: 9f 92 push r9 cee2: af 92 push r10 cee4: bf 92 push r11 cee6: cf 92 push r12 cee8: df 92 push r13 ceea: ef 92 push r14 ceec: ff 92 push r15 ceee: 0f 93 push r16 cef0: 1f 93 push r17 cef2: cf 93 push r28 cef4: df 93 push r29 cef6: 00 d0 rcall .+0 ; 0xcef8 cef8: 1f 92 push r1 cefa: 1f 92 push r1 cefc: cd b7 in r28, 0x3d ; 61 cefe: de b7 in r29, 0x3e ; 62 cf00: d8 2e mov r13, r24 cf02: 2a 01 movw r4, r20 cf04: 3b 01 movw r6, r22 cf06: 32 2e mov r3, r18 cf08: e9 82 std Y+1, r14 ; 0x01 cf0a: fa 82 std Y+2, r15 ; 0x02 cf0c: 0b 83 std Y+3, r16 ; 0x03 cf0e: 1c 83 std Y+4, r17 ; 0x04 // Flag for the display update routine and to disable the print cancelation during homing. st_synchronize(); cf10: 0f 94 ce 22 call 0x2459c ; 0x2459c homing_flag = true; cf14: 81 e0 ldi r24, 0x01 ; 1 cf16: 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; cf1a: fc 2c mov r15, r12 cf1c: e3 2c mov r14, r3 cf1e: d3 10 cpse r13, r3 cf20: 10 c0 rjmp .+32 ; 0xcf42 cf22: ed 2c mov r14, r13 cf24: dc 10 cpse r13, r12 cf26: 0d c0 rjmp .+26 ; 0xcf42 // 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); cf28: 60 e0 ldi r22, 0x00 ; 0 cf2a: 70 e0 ldi r23, 0x00 ; 0 cf2c: 80 ea ldi r24, 0xA0 ; 160 cf2e: 90 e4 ldi r25, 0x40 ; 64 cf30: 0e 94 35 67 call 0xce6a ; 0xce6a // 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; cf34: ff 24 eor r15, r15 cf36: f3 94 inc r15 cf38: ee 24 eor r14, r14 cf3a: e3 94 inc r14 cf3c: 22 24 eor r2, r2 cf3e: 23 94 inc r2 cf40: 01 c0 rjmp .+2 ; 0xcf44 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; cf42: 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(); cf44: 0f 94 1b 90 call 0x32036 ; 0x32036 // 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; cf48: 80 91 9c 12 lds r24, 0x129C ; 0x80129c cf4c: 8d 83 std Y+5, r24 ; 0x05 mbl.active = 0; cf4e: 10 92 9c 12 sts 0x129C, r1 ; 0x80129c current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); cf52: 82 e0 ldi r24, 0x02 ; 2 cf54: 0f 94 ba 22 call 0x24574 ; 0x24574 cf58: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd cf5c: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe cf60: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff cf64: 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) cf68: f1 10 cpse r15, r1 babystep_undo(); cf6a: 0f 94 ca 8b call 0x31794 ; 0x31794 int l_feedmultiply = setup_for_endstop_move(); cf6e: 81 e0 ldi r24, 0x01 ; 1 cf70: 0e 94 e4 5f call 0xbfc8 ; 0xbfc8 cf74: 8c 01 movw r16, r24 set_destination_to_current(); cf76: 0e 94 2c 61 call 0xc258 ; 0xc258 feedrate = 0.0; cf7a: 10 92 7a 02 sts 0x027A, r1 ; 0x80027a cf7e: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b cf82: 10 92 7c 02 sts 0x027C, r1 ; 0x80027c cf86: 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); cf8a: 22 20 and r2, r2 cf8c: 19 f0 breq .+6 ; 0xcf94 cf8e: 80 e0 ldi r24, 0x00 ; 0 cf90: 0f 94 7b 54 call 0x2a8f6 ; 0x2a8f6 if(home_y) homeaxis(Y_AXIS); cf94: ee 20 and r14, r14 cf96: 19 f0 breq .+6 ; 0xcf9e cf98: 81 e0 ldi r24, 0x01 ; 1 cf9a: 0f 94 7b 54 call 0x2a8f6 ; 0x2a8f6 #endif //TMC2130 if(home_x_axis && home_x_value != 0) cf9e: dd 20 and r13, r13 cfa0: e9 f0 breq .+58 ; 0xcfdc cfa2: 41 14 cp r4, r1 cfa4: 51 04 cpc r5, r1 cfa6: 61 04 cpc r6, r1 cfa8: 71 04 cpc r7, r1 cfaa: c1 f0 breq .+48 ; 0xcfdc current_position[X_AXIS]=home_x_value+cs.add_homing[X_AXIS]; cfac: c3 01 movw r24, r6 cfae: b2 01 movw r22, r4 cfb0: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> cfb4: 9b 01 movw r18, r22 cfb6: ac 01 movw r20, r24 cfb8: 60 91 8a 04 lds r22, 0x048A ; 0x80048a cfbc: 70 91 8b 04 lds r23, 0x048B ; 0x80048b cfc0: 80 91 8c 04 lds r24, 0x048C ; 0x80048c cfc4: 90 91 8d 04 lds r25, 0x048D ; 0x80048d cfc8: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> cfcc: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 cfd0: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 cfd4: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 cfd8: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 if(home_y_axis && home_y_value != 0) cfdc: 33 20 and r3, r3 cfde: 01 f1 breq .+64 ; 0xd020 cfe0: 89 81 ldd r24, Y+1 ; 0x01 cfe2: 9a 81 ldd r25, Y+2 ; 0x02 cfe4: ab 81 ldd r26, Y+3 ; 0x03 cfe6: bc 81 ldd r27, Y+4 ; 0x04 cfe8: 00 97 sbiw r24, 0x00 ; 0 cfea: a1 05 cpc r26, r1 cfec: b1 05 cpc r27, r1 cfee: c1 f0 breq .+48 ; 0xd020 current_position[Y_AXIS]=home_y_value+cs.add_homing[Y_AXIS]; cff0: bc 01 movw r22, r24 cff2: cd 01 movw r24, r26 cff4: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> cff8: 9b 01 movw r18, r22 cffa: ac 01 movw r20, r24 cffc: 60 91 8e 04 lds r22, 0x048E ; 0x80048e d000: 70 91 8f 04 lds r23, 0x048F ; 0x80048f d004: 80 91 90 04 lds r24, 0x0490 ; 0x800490 d008: 90 91 91 04 lds r25, 0x0491 ; 0x800491 d00c: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> d010: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 d014: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa d018: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb d01c: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc #if Z_HOME_DIR < 0 // If homing towards BED do Z last if(home_z) { d020: ff 20 and r15, r15 d022: 09 f4 brne .+2 ; 0xd026 d024: 99 c0 rjmp .+306 ; 0xd158 #ifdef MESH_BED_LEVELING // If Mesh bed leveling, move X&Y to safe position for home raise_z_above(MESH_HOME_Z_SEARCH); d026: 60 e0 ldi r22, 0x00 ; 0 d028: 70 e0 ldi r23, 0x00 ; 0 d02a: 80 ea ldi r24, 0xA0 ; 160 d02c: 90 e4 ldi r25, 0x40 ; 64 d02e: 0e 94 35 67 call 0xce6a ; 0xce6a if (!axis_known_position[X_AXIS]) homeaxis(X_AXIS); d032: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 d036: 81 11 cpse r24, r1 d038: 02 c0 rjmp .+4 ; 0xd03e d03a: 0f 94 7b 54 call 0x2a8f6 ; 0x2a8f6 if (!axis_known_position[Y_AXIS]) homeaxis(Y_AXIS); d03e: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 d042: 81 11 cpse r24, r1 d044: 03 c0 rjmp .+6 ; 0xd04c d046: 81 e0 ldi r24, 0x01 ; 1 d048: 0f 94 7b 54 call 0x2a8f6 ; 0x2a8f6 // 1st mesh bed leveling measurement point, corrected. world2machine_initialize(); d04c: 0f 94 80 90 call 0x32100 ; 0x32100 world2machine(pgm_read_float(bed_ref_points_4), pgm_read_float(bed_ref_points_4+1), destination[X_AXIS], destination[Y_AXIS]); d050: e0 e5 ldi r30, 0x50 ; 80 d052: f8 e8 ldi r31, 0x88 ; 136 d054: 85 91 lpm r24, Z+ d056: 95 91 lpm r25, Z+ d058: a5 91 lpm r26, Z+ d05a: b4 91 lpm r27, Z d05c: ec e4 ldi r30, 0x4C ; 76 d05e: f8 e8 ldi r31, 0x88 ; 136 d060: 45 91 lpm r20, Z+ d062: 55 91 lpm r21, Z+ d064: 65 91 lpm r22, Z+ d066: 74 91 lpm r23, Z } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; d068: 40 93 93 06 sts 0x0693, r20 ; 0x800693 d06c: 50 93 94 06 sts 0x0694, r21 ; 0x800694 d070: 60 93 95 06 sts 0x0695, r22 ; 0x800695 d074: 70 93 96 06 sts 0x0696, r23 ; 0x800696 out_y = y; d078: 80 93 97 06 sts 0x0697, r24 ; 0x800697 d07c: 90 93 98 06 sts 0x0698, r25 ; 0x800698 d080: a0 93 99 06 sts 0x0699, r26 ; 0x800699 d084: b0 93 9a 06 sts 0x069A, r27 ; 0x80069a world2machine(out_x, out_y); d088: 67 e9 ldi r22, 0x97 ; 151 d08a: 76 e0 ldi r23, 0x06 ; 6 d08c: 83 e9 ldi r24, 0x93 ; 147 d08e: 96 e0 ldi r25, 0x06 ; 6 d090: 0e 94 f4 62 call 0xc5e8 ; 0xc5e8 world2machine_reset(); d094: 0f 94 e2 8f call 0x31fc4 ; 0x31fc4 if (destination[Y_AXIS] < Y_MIN_POS) d098: 20 e0 ldi r18, 0x00 ; 0 d09a: 30 e0 ldi r19, 0x00 ; 0 d09c: 40 e8 ldi r20, 0x80 ; 128 d09e: 50 ec ldi r21, 0xC0 ; 192 d0a0: 60 91 97 06 lds r22, 0x0697 ; 0x800697 d0a4: 70 91 98 06 lds r23, 0x0698 ; 0x800698 d0a8: 80 91 99 06 lds r24, 0x0699 ; 0x800699 d0ac: 90 91 9a 06 lds r25, 0x069A ; 0x80069a d0b0: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> d0b4: 87 ff sbrs r24, 7 d0b6: 0c c0 rjmp .+24 ; 0xd0d0 destination[Y_AXIS] = Y_MIN_POS; d0b8: 80 e0 ldi r24, 0x00 ; 0 d0ba: 90 e0 ldi r25, 0x00 ; 0 d0bc: a0 e8 ldi r26, 0x80 ; 128 d0be: b0 ec ldi r27, 0xC0 ; 192 d0c0: 80 93 97 06 sts 0x0697, r24 ; 0x800697 d0c4: 90 93 98 06 sts 0x0698, r25 ; 0x800698 d0c8: a0 93 99 06 sts 0x0699, r26 ; 0x800699 d0cc: b0 93 9a 06 sts 0x069A, r27 ; 0x80069a feedrate = homing_feedrate[X_AXIS] / 20; d0d0: 80 e0 ldi r24, 0x00 ; 0 d0d2: 90 e0 ldi r25, 0x00 ; 0 d0d4: a6 e1 ldi r26, 0x16 ; 22 d0d6: b3 e4 ldi r27, 0x43 ; 67 d0d8: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a d0dc: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b d0e0: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c d0e4: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d d0e8: 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(); d0ec: 0f 94 ef 83 call 0x307de ; 0x307de 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); d0f0: 60 91 7a 02 lds r22, 0x027A ; 0x80027a d0f4: 70 91 7b 02 lds r23, 0x027B ; 0x80027b d0f8: 80 91 7c 02 lds r24, 0x027C ; 0x80027c d0fc: 90 91 7d 02 lds r25, 0x027D ; 0x80027d d100: 0f 94 fc 84 call 0x309f8 ; 0x309f8 st_synchronize(); d104: 0f 94 ce 22 call 0x2459c ; 0x2459c current_position[X_AXIS] = destination[X_AXIS]; d108: 80 91 93 06 lds r24, 0x0693 ; 0x800693 d10c: 90 91 94 06 lds r25, 0x0694 ; 0x800694 d110: a0 91 95 06 lds r26, 0x0695 ; 0x800695 d114: b0 91 96 06 lds r27, 0x0696 ; 0x800696 d118: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 d11c: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 d120: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 d124: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = destination[Y_AXIS]; d128: 80 91 97 06 lds r24, 0x0697 ; 0x800697 d12c: 90 91 98 06 lds r25, 0x0698 ; 0x800698 d130: a0 91 99 06 lds r26, 0x0699 ; 0x800699 d134: b0 91 9a 06 lds r27, 0x069A ; 0x80069a d138: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 d13c: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa d140: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb d144: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc d148: 81 e0 ldi r24, 0x01 ; 1 d14a: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.364> enable_endstops(true); endstops_hit_on_purpose(); d14e: 0f 94 22 2d call 0x25a44 ; 0x25a44 homeaxis(Z_AXIS); d152: 82 e0 ldi r24, 0x02 ; 2 d154: 0f 94 7b 54 call 0x2a8f6 ; 0x2a8f6 homeaxis(Z_AXIS); #endif // MESH_BED_LEVELING } #endif // Z_HOME_DIR < 0 if(home_z_axis && home_z_value != 0) d158: cc 20 and r12, r12 d15a: e9 f0 breq .+58 ; 0xd196 d15c: 81 14 cp r8, r1 d15e: 91 04 cpc r9, r1 d160: a1 04 cpc r10, r1 d162: b1 04 cpc r11, r1 d164: c1 f0 breq .+48 ; 0xd196 current_position[Z_AXIS]=home_z_value+cs.add_homing[Z_AXIS]; d166: c5 01 movw r24, r10 d168: b4 01 movw r22, r8 d16a: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> d16e: 9b 01 movw r18, r22 d170: ac 01 movw r20, r24 d172: 60 91 92 04 lds r22, 0x0492 ; 0x800492 d176: 70 91 93 04 lds r23, 0x0493 ; 0x800493 d17a: 80 91 94 04 lds r24, 0x0494 ; 0x800494 d17e: 90 91 95 04 lds r25, 0x0495 ; 0x800495 d182: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> d186: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd d18a: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe d18e: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff d192: 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(); d196: 0f 94 ef 83 call 0x307de ; 0x307de clean_up_after_endstop_move(l_feedmultiply); d19a: c8 01 movw r24, r16 d19c: 0e 94 ca 5f call 0xbf94 ; 0xbf94 endstops_hit_on_purpose(); d1a0: 0f 94 22 2d call 0x25a44 ; 0x25a44 // Load the machine correction matrix world2machine_initialize(); d1a4: 0f 94 80 90 call 0x32100 ; 0x32100 // and correct the current_position XY axes to match the transformed coordinate system. world2machine_update_current(); d1a8: 0f 94 1e 8e call 0x31c3c ; 0x31c3c #ifdef MESH_BED_LEVELING if (home_x_axis || home_y_axis || without_mbl || home_z_axis) d1ac: d1 10 cpse r13, r1 d1ae: 07 c0 rjmp .+14 ; 0xd1be d1b0: 31 10 cpse r3, r1 d1b2: 05 c0 rjmp .+10 ; 0xd1be d1b4: 8b 8d ldd r24, Y+27 ; 0x1b d1b6: 81 11 cpse r24, r1 d1b8: 02 c0 rjmp .+4 ; 0xd1be d1ba: cc 20 and r12, r12 d1bc: 39 f1 breq .+78 ; 0xd20c { if (! home_z && mbl_was_active) { d1be: f1 10 cpse r15, r1 d1c0: 25 c0 rjmp .+74 ; 0xd20c d1c2: 9d 81 ldd r25, Y+5 ; 0x05 d1c4: 99 23 and r25, r25 d1c6: 11 f1 breq .+68 ; 0xd20c // Re-enable the mesh bed leveling if only the X and Y axes were re-homed. mbl.active = true; d1c8: 81 e0 ldi r24, 0x01 ; 1 d1ca: 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)); d1ce: 0f 94 ba 22 call 0x24574 ; 0x24574 d1d2: 6b 01 movw r12, r22 d1d4: 7c 01 movw r14, r24 d1d6: 80 e0 ldi r24, 0x00 ; 0 d1d8: 0f 94 ba 22 call 0x24574 ; 0x24574 d1dc: a7 01 movw r20, r14 d1de: 96 01 movw r18, r12 d1e0: 0f 94 c7 60 call 0x2c18e ; 0x2c18e d1e4: 9b 01 movw r18, r22 d1e6: ac 01 movw r20, r24 d1e8: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd d1ec: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe d1f0: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff d1f4: 90 91 00 12 lds r25, 0x1200 ; 0x801200 d1f8: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> d1fc: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd d200: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe d204: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff d208: 90 93 00 12 sts 0x1200, r25 ; 0x801200 } } #endif prusa_statistics(20); d20c: 84 e1 ldi r24, 0x14 ; 20 d20e: 0f 94 be 98 call 0x3317c ; 0x3317c st_synchronize(); d212: 0f 94 ce 22 call 0x2459c ; 0x2459c homing_flag = false; d216: 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 } d21a: 0f 90 pop r0 d21c: 0f 90 pop r0 d21e: 0f 90 pop r0 d220: 0f 90 pop r0 d222: 0f 90 pop r0 d224: df 91 pop r29 d226: cf 91 pop r28 d228: 1f 91 pop r17 d22a: 0f 91 pop r16 d22c: ff 90 pop r15 d22e: ef 90 pop r14 d230: df 90 pop r13 d232: cf 90 pop r12 d234: bf 90 pop r11 d236: af 90 pop r10 d238: 9f 90 pop r9 d23a: 8f 90 pop r8 d23c: 7f 90 pop r7 d23e: 6f 90 pop r6 d240: 5f 90 pop r5 d242: 4f 90 pop r4 d244: 3f 90 pop r3 d246: 2f 90 pop r2 d248: 08 95 ret 0000d24a : static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); } void lcd_frame_start() { d24a: e3 e3 ldi r30, 0x33 ; 51 d24c: 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; d24e: 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]; d250: 81 91 ld r24, Z+ if (c == 0x7F) { //slot empty d252: 8f 37 cpi r24, 0x7F ; 127 d254: 31 f0 breq .+12 ; 0xd262 d256: df 01 movw r26, r30 d258: 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 d25a: 87 ff sbrs r24, 7 d25c: 07 c0 rjmp .+14 ; 0xd26c lcd_custom_characters[i] = c & 0x7F; d25e: 8f 77 andi r24, 0x7F ; 127 d260: 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++) { d262: 83 e0 ldi r24, 0x03 ; 3 d264: eb 33 cpi r30, 0x3B ; 59 d266: f8 07 cpc r31, r24 d268: 99 f7 brne .-26 ; 0xd250 for (uint8_t i = 0; i < 8; i++) { printf_P(PSTR(" %02x"), lcd_custom_characters[i]); } printf_P(PSTR("\n")); #endif // DEBUG_CUSTOM_CHARACTERS } d26a: 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; d26c: 9c 93 st X, r25 d26e: f9 cf rjmp .-14 ; 0xd262 0000d270 : } } void lcd_update(uint8_t lcdDrawUpdateOverride) { if (lcd_draw_update < lcdDrawUpdateOverride) d270: 90 91 5b 02 lds r25, 0x025B ; 0x80025b d274: 98 17 cp r25, r24 d276: 10 f4 brcc .+4 ; 0xd27c lcd_draw_update = lcdDrawUpdateOverride; d278: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b if (!lcd_update_enabled) return; d27c: 80 91 5c 02 lds r24, 0x025C ; 0x80025c d280: 88 23 and r24, r24 d282: 39 f0 breq .+14 ; 0xd292 if (lcd_lcdupdate_func) d284: e0 91 d2 03 lds r30, 0x03D2 ; 0x8003d2 d288: f0 91 d3 03 lds r31, 0x03D3 ; 0x8003d3 d28c: 30 97 sbiw r30, 0x00 ; 0 d28e: 09 f0 breq .+2 ; 0xd292 lcd_lcdupdate_func(); d290: 19 94 eijmp } d292: 08 95 ret 0000d294 : lcd_set_cursor(c, r); return fputs_P(str, lcdout); } int lcd_printf_P(const char* format, ...) { d294: cf 93 push r28 d296: df 93 push r29 d298: cd b7 in r28, 0x3d ; 61 d29a: de b7 in r29, 0x3e ; 62 d29c: ae 01 movw r20, r28 d29e: 4a 5f subi r20, 0xFA ; 250 d2a0: 5f 4f sbci r21, 0xFF ; 255 d2a2: fa 01 movw r30, r20 d2a4: 61 91 ld r22, Z+ d2a6: 71 91 ld r23, Z+ d2a8: af 01 movw r20, r30 va_list args; va_start(args, format); int ret = vfprintf_P(lcdout, format, args); d2aa: 80 ec ldi r24, 0xC0 ; 192 d2ac: 93 e0 ldi r25, 0x03 ; 3 d2ae: 0f 94 e2 9f call 0x33fc4 ; 0x33fc4 va_end(args); return ret; } d2b2: df 91 pop r29 d2b4: cf 91 pop r28 d2b6: 08 95 ret 0000d2b8 : return fputc(ch, lcdout); } int lcd_puts_P(const char* str) { return fputs_P(str, lcdout); d2b8: 60 ec ldi r22, 0xC0 ; 192 d2ba: 73 e0 ldi r23, 0x03 ; 3 d2bc: 0d 94 33 9f jmp 0x33e66 ; 0x33e66 0000d2c0 : lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address } int lcd_putc(char c) { return fputc(c, lcdout); d2c0: 60 ec ldi r22, 0xC0 ; 192 d2c2: 73 e0 ldi r23, 0x03 ; 3 d2c4: 08 2e mov r0, r24 d2c6: 00 0c add r0, r0 d2c8: 99 0b sbc r25, r25 d2ca: 0d 94 03 9f jmp 0x33e06 ; 0x33e06 0000d2ce : va_end(args); return ret; } void lcd_space(uint8_t n) { d2ce: cf 93 push r28 d2d0: c8 2f mov r28, r24 while (n--) lcd_putc(' '); d2d2: c1 50 subi r28, 0x01 ; 1 d2d4: 20 f0 brcs .+8 ; 0xd2de d2d6: 80 e2 ldi r24, 0x20 ; 32 d2d8: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 d2dc: fa cf rjmp .-12 ; 0xd2d2 } d2de: cf 91 pop r28 d2e0: 08 95 ret 0000d2e2 : { return pgm_read_byte(row_offsets + min(row, LCD_HEIGHT - 1)); } void lcd_set_cursor(uint8_t col, uint8_t row) { d2e2: cf 93 push r28 d2e4: c8 2f mov r28, r24 d2e6: 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); d2e8: 64 30 cpi r22, 0x04 ; 4 d2ea: 08 f0 brcs .+2 ; 0xd2ee d2ec: 83 e0 ldi r24, 0x03 ; 3 d2ee: 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); d2f2: 0e 94 b6 54 call 0xa96c ; 0xa96c d2f6: 8c 0f add r24, r28 lcd_ddram_address = addr; d2f8: 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); d2fc: 44 e6 ldi r20, 0x64 ; 100 d2fe: 50 e0 ldi r21, 0x00 ; 0 d300: 60 e0 ldi r22, 0x00 ; 0 d302: 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); } d304: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d306: 0c 94 f8 5c jmp 0xb9f0 ; 0xb9f0 0000d30a : { return fputs_P(str, lcdout); } int lcd_puts_at_P(uint8_t c, uint8_t r, const char* str) { d30a: cf 93 push r28 d30c: df 93 push r29 d30e: ea 01 movw r28, r20 lcd_set_cursor(c, r); d310: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 return fputs_P(str, lcdout); d314: 60 ec ldi r22, 0xC0 ; 192 d316: 73 e0 ldi r23, 0x03 ; 3 d318: ce 01 movw r24, r28 } d31a: df 91 pop r29 d31c: 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); d31e: 0d 94 33 9f jmp 0x33e66 ; 0x33e66 0000d322 : { return fputc(c, lcdout); } int lcd_putc_at(uint8_t c, uint8_t r, char ch) { d322: cf 93 push r28 d324: c4 2f mov r28, r20 lcd_set_cursor(c, r); d326: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 return fputc(ch, lcdout); d32a: 60 ec ldi r22, 0xC0 ; 192 d32c: 73 e0 ldi r23, 0x03 ; 3 d32e: 8c 2f mov r24, r28 d330: cc 0f add r28, r28 d332: 99 0b sbc r25, r25 } d334: 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); d336: 0d 94 03 9f jmp 0x33e06 ; 0x33e06 0000d33a : } // Set cursor position to zero and in DDRAM. It does not unshift the display. void lcd_home(void) { lcd_set_cursor(0, 0); d33a: 60 e0 ldi r22, 0x00 ; 0 d33c: 80 e0 ldi r24, 0x00 ; 0 d33e: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_ddram_address = 0; d342: 10 92 31 03 sts 0x0331, r1 ; 0x800331 } d346: 08 95 ret 0000d348 : delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d348: 40 e4 ldi r20, 0x40 ; 64 d34a: 56 e0 ldi r21, 0x06 ; 6 d34c: 60 e0 ldi r22, 0x00 ; 0 d34e: 81 e0 ldi r24, 0x01 ; 1 d350: 0e 94 f8 5c call 0xb9f0 ; 0xb9f0 // 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; d354: 10 92 32 03 sts 0x0332, r1 ; 0x800332 lcd_ddram_address = 0; d358: 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)); d35c: 48 e0 ldi r20, 0x08 ; 8 d35e: 50 e0 ldi r21, 0x00 ; 0 d360: 6f e7 ldi r22, 0x7F ; 127 d362: 70 e0 ldi r23, 0x00 ; 0 d364: 83 e3 ldi r24, 0x33 ; 51 d366: 93 e0 ldi r25, 0x03 ; 3 d368: 0d 94 cd a6 jmp 0x34d9a ; 0x34d9a 0000d36c : } 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) d36c: 90 91 5c 02 lds r25, 0x025C ; 0x80025c d370: 98 17 cp r25, r24 d372: 09 f1 breq .+66 ; 0xd3b6 { lcd_update_enabled = enabled; d374: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c if (enabled) d378: 88 23 and r24, r24 d37a: e9 f0 breq .+58 ; 0xd3b6 { // Reset encoder position. This is equivalent to re-entering a menu. lcd_encoder = 0; d37c: 10 92 07 05 sts 0x0507, r1 ; 0x800507 d380: 10 92 06 05 sts 0x0506, r1 ; 0x800506 lcd_encoder_diff = 0; d384: 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(); d388: 81 eb ldi r24, 0xB1 ; 177 d38a: 93 e0 ldi r25, 0x03 ; 3 d38c: 0f 94 29 12 call 0x22452 ; 0x22452 ::start()> // Force the keypad update now. lcd_next_update_millis = _millis() - 1; d390: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 d394: 61 50 subi r22, 0x01 ; 1 d396: 71 09 sbc r23, r1 d398: 81 09 sbc r24, r1 d39a: 91 09 sbc r25, r1 d39c: 60 93 93 03 sts 0x0393, r22 ; 0x800393 d3a0: 70 93 94 03 sts 0x0394, r23 ; 0x800394 d3a4: 80 93 95 03 sts 0x0395, r24 ; 0x800395 d3a8: 90 93 96 03 sts 0x0396, r25 ; 0x800396 // Full update. lcd_clear(); d3ac: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_update(2); d3b0: 82 e0 ldi r24, 0x02 ; 2 d3b2: 0c 94 38 69 jmp 0xd270 ; 0xd270 } else { // Clear the LCD always, or let it to the caller? } } } d3b6: 08 95 ret 0000d3b8 : lcd_ddram_address++; // no need for preventing ddram overflow } } static void lcd_begin(uint8_t clear) { d3b8: cf 93 push r28 d3ba: c8 2f mov r28, r24 lcd_currline = 0; d3bc: 10 92 32 03 sts 0x0332, r1 ; 0x800332 lcd_ddram_address = 0; d3c0: 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)); d3c4: 48 e0 ldi r20, 0x08 ; 8 d3c6: 50 e0 ldi r21, 0x00 ; 0 d3c8: 6f e7 ldi r22, 0x7F ; 127 d3ca: 70 e0 ldi r23, 0x00 ; 0 d3cc: 83 e3 ldi r24, 0x33 ; 51 d3ce: 93 e0 ldi r25, 0x03 ; 3 d3d0: 0f 94 cd a6 call 0x34d9a ; 0x34d9a 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 d3d4: 44 e9 ldi r20, 0x94 ; 148 d3d6: 51 e1 ldi r21, 0x11 ; 17 d3d8: 62 e0 ldi r22, 0x02 ; 2 d3da: 80 e3 ldi r24, 0x30 ; 48 d3dc: 0e 94 f8 5c call 0xb9f0 ; 0xb9f0 // second try lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); d3e0: 46 e9 ldi r20, 0x96 ; 150 d3e2: 50 e0 ldi r21, 0x00 ; 0 d3e4: 62 e0 ldi r22, 0x02 ; 2 d3e6: 80 e3 ldi r24, 0x30 ; 48 d3e8: 0e 94 f8 5c call 0xb9f0 ; 0xb9f0 // third go! lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); d3ec: 46 e9 ldi r20, 0x96 ; 150 d3ee: 50 e0 ldi r21, 0x00 ; 0 d3f0: 62 e0 ldi r22, 0x02 ; 2 d3f2: 80 e3 ldi r24, 0x30 ; 48 d3f4: 0e 94 f8 5c call 0xb9f0 ; 0xb9f0 #ifndef LCD_8BIT // set to 4-bit interface lcd_send(LCD_FUNCTIONSET | LCD_4BITMODE, LOW | LCD_HALF_FLAG, 150); d3f8: 46 e9 ldi r20, 0x96 ; 150 d3fa: 50 e0 ldi r21, 0x00 ; 0 d3fc: 62 e0 ldi r22, 0x02 ; 2 d3fe: 80 e2 ldi r24, 0x20 ; 32 d400: 0e 94 f8 5c call 0xb9f0 ; 0xb9f0 #endif // finally, set # lines, font size, etc.0 lcd_command(LCD_FUNCTIONSET | lcd_displayfunction); d404: 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); d408: 44 e6 ldi r20, 0x64 ; 100 d40a: 50 e0 ldi r21, 0x00 ; 0 d40c: 60 e0 ldi r22, 0x00 ; 0 d40e: 80 62 ori r24, 0x20 ; 32 d410: 0e 94 f8 5c call 0xb9f0 ; 0xb9f0 } // Turn the display on/off (quickly) void lcd_display(void) { lcd_displaycontrol |= LCD_DISPLAYON; d414: 84 e0 ldi r24, 0x04 ; 4 d416: 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); d41a: 44 e6 ldi r20, 0x64 ; 100 d41c: 50 e0 ldi r21, 0x00 ; 0 d41e: 60 e0 ldi r22, 0x00 ; 0 d420: 8c e0 ldi r24, 0x0C ; 12 d422: 0e 94 f8 5c call 0xb9f0 ; 0xb9f0 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(); d426: c1 11 cpse r28, r1 d428: 0e 94 a4 69 call 0xd348 ; 0xd348 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d42c: 44 e6 ldi r20, 0x64 ; 100 d42e: 50 e0 ldi r21, 0x00 ; 0 d430: 60 e0 ldi r22, 0x00 ; 0 d432: 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); } d434: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); d436: 0c 94 f8 5c jmp 0xb9f0 ; 0xb9f0 0000d43a : fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream } void lcd_refresh(void) { lcd_begin(1); d43a: 81 e0 ldi r24, 0x01 ; 1 d43c: 0c 94 dc 69 jmp 0xd3b8 ; 0xd3b8 0000d440 : { lcd_send(value, LOW, duration); } static void lcd_write(uint8_t value) { d440: cf 92 push r12 d442: df 92 push r13 d444: ff 92 push r15 d446: 0f 93 push r16 d448: 1f 93 push r17 d44a: cf 93 push r28 d44c: df 93 push r29 d44e: 00 d0 rcall .+0 ; 0xd450 d450: 00 d0 rcall .+0 ; 0xd452 d452: 1f 92 push r1 d454: 1f 92 push r1 d456: cd b7 in r28, 0x3d ; 61 d458: de b7 in r29, 0x3e ; 62 if (value == '\n') { d45a: 8a 30 cpi r24, 0x0A ; 10 d45c: d9 f4 brne .+54 ; 0xd494 if (lcd_currline > 3) lcd_currline = -1; d45e: 80 91 32 03 lds r24, 0x0332 ; 0x800332 d462: 84 30 cpi r24, 0x04 ; 4 d464: 18 f0 brcs .+6 ; 0xd46c d466: 8f ef ldi r24, 0xFF ; 255 d468: 80 93 32 03 sts 0x0332, r24 ; 0x800332 lcd_set_cursor(0, lcd_currline + 1); // LF d46c: 60 91 32 03 lds r22, 0x0332 ; 0x800332 d470: 6f 5f subi r22, 0xFF ; 255 d472: 80 e0 ldi r24, 0x00 ; 0 d474: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_print_custom(value); } else { lcd_send(value, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } } d478: 28 96 adiw r28, 0x08 ; 8 d47a: 0f b6 in r0, 0x3f ; 63 d47c: f8 94 cli d47e: de bf out 0x3e, r29 ; 62 d480: 0f be out 0x3f, r0 ; 63 d482: cd bf out 0x3d, r28 ; 61 d484: df 91 pop r29 d486: cf 91 pop r28 d488: 1f 91 pop r17 d48a: 0f 91 pop r16 d48c: ff 90 pop r15 d48e: df 90 pop r13 d490: cf 90 pop r12 d492: 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))) { d494: 90 e8 ldi r25, 0x80 ; 128 d496: 98 0f add r25, r24 lcd_print_custom(value); } else { lcd_send(value, HIGH); d498: 44 e6 ldi r20, 0x64 ; 100 d49a: 50 e0 ldi r21, 0x00 ; 0 d49c: 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))) { d49e: 9a 34 cpi r25, 0x4A ; 74 d4a0: 08 f5 brcc .+66 ; 0xd4e4 // 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. d4a2: 48 2f mov r20, r24 d4a4: 40 58 subi r20, 0x80 ; 128 d4a6: 55 0b sbc r21, r21 d4a8: 9a 01 movw r18, r20 d4aa: 96 e0 ldi r25, 0x06 ; 6 d4ac: 92 9f mul r25, r18 d4ae: a0 01 movw r20, r0 d4b0: 93 9f mul r25, r19 d4b2: 50 0d add r21, r0 d4b4: 11 24 eor r1, r1 d4b6: fa 01 movw r30, r20 d4b8: e4 5a subi r30, 0xA4 ; 164 d4ba: fb 48 sbci r31, 0x8B ; 139 d4bc: f4 90 lpm r15, Z d4be: e3 e3 ldi r30, 0x33 ; 51 d4c0: f3 e0 ldi r31, 0x03 ; 3 d4c2: 30 e0 ldi r19, 0x00 ; 0 d4c4: 20 e0 ldi r18, 0x00 ; 0 int8_t slotToUse = -1; d4c6: 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)) { d4c8: 61 91 ld r22, Z+ d4ca: 78 2f mov r23, r24 d4cc: 76 27 eor r23, r22 d4ce: 7f 77 andi r23, 0x7F ; 127 d4d0: 89 f4 brne .+34 ; 0xd4f4 lcd_custom_characters[i] = c; // mark the custom character as used d4d2: f9 01 movw r30, r18 d4d4: ed 5c subi r30, 0xCD ; 205 d4d6: fc 4f sbci r31, 0xFC ; 252 d4d8: 80 83 st Z, r24 d4da: 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); d4dc: 44 e6 ldi r20, 0x64 ; 100 d4de: 50 e0 ldi r21, 0x00 ; 0 d4e0: 61 e0 ldi r22, 0x01 ; 1 d4e2: 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); d4e4: 0e 94 f8 5c call 0xb9f0 ; 0xb9f0 lcd_ddram_address++; // no need for preventing ddram overflow d4e8: 80 91 31 03 lds r24, 0x0331 ; 0x800331 d4ec: 8f 5f subi r24, 0xFF ; 255 d4ee: 80 93 31 03 sts 0x0331, r24 ; 0x800331 d4f2: c2 cf rjmp .-124 ; 0xd478 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 d4f4: 6f 37 cpi r22, 0x7F ; 127 d4f6: 09 f0 breq .+2 ; 0xd4fa d4f8: 3c c0 rjmp .+120 ; 0xd572 lcd_custom_characters[i] = c; // mark the custom character as used d4fa: f9 01 movw r30, r18 d4fc: ed 5c subi r30, 0xCD ; 205 d4fe: fc 4f sbci r31, 0xFC ; 252 d500: 80 83 st Z, r24 slotToUse = i; d502: 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; d504: f9 2e mov r15, r25 lcd_createChar_P(slotToUse, &Font[c - 0x80]); d506: fa 01 movw r30, r20 d508: e9 5a subi r30, 0xA9 ; 169 d50a: fb 48 sbci r31, 0x8B ; 139 "dec __zero_reg__" "\n\t" "brne forBegin_%=" "\n\t" : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); d50c: 8e 01 movw r16, r28 d50e: 0f 5f subi r16, 0xFF ; 255 d510: 1f 4f sbci r17, 0xFF ; 255 d512: d8 01 movw r26, r16 d514: 95 91 lpm r25, Z+ d516: 88 e0 ldi r24, 0x08 ; 8 d518: 18 2e mov r1, r24 0000d51a : d51a: 10 fe sbrs r1, 0 d51c: 05 90 lpm r0, Z+ d51e: 02 94 swap r0 d520: 80 2d mov r24, r0 d522: 97 95 ror r25 d524: 88 1f adc r24, r24 d526: 8d 93 st X+, r24 d528: 1a 94 dec r1 d52a: b9 f7 brne .-18 ; 0xd51a lcd_command(LCD_SETCGRAMADDR | (location << 3)); d52c: bf 2d mov r27, r15 d52e: e8 e0 ldi r30, 0x08 ; 8 d530: be 02 muls r27, r30 d532: c0 01 movw r24, r0 d534: 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); d536: 44 e6 ldi r20, 0x64 ; 100 d538: 50 e0 ldi r21, 0x00 ; 0 d53a: 60 e0 ldi r22, 0x00 ; 0 d53c: 80 64 ori r24, 0x40 ; 64 d53e: 0e 94 f8 5c call 0xb9f0 ; 0xb9f0 d542: 6e 01 movw r12, r28 d544: f9 e0 ldi r31, 0x09 ; 9 d546: cf 0e add r12, r31 d548: 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); d54a: 44 e6 ldi r20, 0x64 ; 100 d54c: 50 e0 ldi r21, 0x00 ; 0 d54e: 61 e0 ldi r22, 0x01 ; 1 d550: d8 01 movw r26, r16 d552: 8d 91 ld r24, X+ d554: 8d 01 movw r16, r26 d556: 0e 94 f8 5c call 0xb9f0 ; 0xb9f0 : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); lcd_command(LCD_SETCGRAMADDR | (location << 3)); for (uint8_t i = 0; i < 8; i++) { d55a: c0 16 cp r12, r16 d55c: d1 06 cpc r13, r17 d55e: a9 f7 brne .-22 ; 0xd54a lcd_send(charmap[i], HIGH); } lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address d560: 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); d564: 44 e6 ldi r20, 0x64 ; 100 d566: 50 e0 ldi r21, 0x00 ; 0 d568: 60 e0 ldi r22, 0x00 ; 0 d56a: 80 68 ori r24, 0x80 ; 128 d56c: 0e 94 f8 5c call 0xb9f0 ; 0xb9f0 d570: b5 cf rjmp .-150 ; 0xd4dc 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 d572: 67 ff sbrs r22, 7 slotToUse = i; d574: 92 2f mov r25, r18 d576: 2f 5f subi r18, 0xFF ; 255 d578: 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++) { d57a: 28 30 cpi r18, 0x08 ; 8 d57c: 31 05 cpc r19, r1 d57e: 09 f0 breq .+2 ; 0xd582 d580: a3 cf rjmp .-186 ; 0xd4c8 } // 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) { d582: 9f 3f cpi r25, 0xFF ; 255 d584: 09 f0 breq .+2 ; 0xd588 d586: be cf rjmp .-132 ; 0xd504 d588: a9 cf rjmp .-174 ; 0xd4dc 0000d58a : else lcd_printNumber(n, base); } void lcd_printNumber(unsigned long n, uint8_t base) { d58a: 8f 92 push r8 d58c: 9f 92 push r9 d58e: af 92 push r10 d590: bf 92 push r11 d592: ef 92 push r14 d594: ff 92 push r15 d596: 0f 93 push r16 d598: 1f 93 push r17 d59a: cf 93 push r28 d59c: df 93 push r29 d59e: cd b7 in r28, 0x3d ; 61 d5a0: de b7 in r29, 0x3e ; 62 d5a2: a0 97 sbiw r28, 0x20 ; 32 d5a4: 0f b6 in r0, 0x3f ; 63 d5a6: f8 94 cli d5a8: de bf out 0x3e, r29 ; 62 d5aa: 0f be out 0x3f, r0 ; 63 d5ac: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) d5ae: 61 15 cp r22, r1 d5b0: 71 05 cpc r23, r1 d5b2: 81 05 cpc r24, r1 d5b4: 91 05 cpc r25, r1 d5b6: 99 f4 brne .+38 ; 0xd5de } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); d5b8: 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)); } d5ba: a0 96 adiw r28, 0x20 ; 32 d5bc: 0f b6 in r0, 0x3f ; 63 d5be: f8 94 cli d5c0: de bf out 0x3e, r29 ; 62 d5c2: 0f be out 0x3f, r0 ; 63 d5c4: cd bf out 0x3d, r28 ; 61 d5c6: df 91 pop r29 d5c8: cf 91 pop r28 d5ca: 1f 91 pop r17 d5cc: 0f 91 pop r16 d5ce: ff 90 pop r15 d5d0: ef 90 pop r14 d5d2: bf 90 pop r11 d5d4: af 90 pop r10 d5d6: 9f 90 pop r9 d5d8: 8f 90 pop r8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); d5da: 0c 94 20 6a jmp 0xd440 ; 0xd440 } void lcd_printNumber(unsigned long n, uint8_t base) { unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; d5de: 00 e0 ldi r16, 0x00 ; 0 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; d5e0: 84 2e mov r8, r20 d5e2: 91 2c mov r9, r1 d5e4: b1 2c mov r11, r1 d5e6: a1 2c mov r10, r1 d5e8: 9e 01 movw r18, r28 d5ea: 2f 5f subi r18, 0xFF ; 255 d5ec: 3f 4f sbci r19, 0xFF ; 255 d5ee: 79 01 movw r14, r18 d5f0: a5 01 movw r20, r10 d5f2: 94 01 movw r18, r8 d5f4: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> d5f8: f7 01 movw r30, r14 d5fa: e0 0f add r30, r16 d5fc: f1 1d adc r31, r1 d5fe: 60 83 st Z, r22 n /= base; d600: b9 01 movw r22, r18 d602: ca 01 movw r24, r20 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; d604: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { lcd_print('0'); return; } while (n > 0) d606: 61 15 cp r22, r1 d608: 71 05 cpc r23, r1 d60a: 81 05 cpc r24, r1 d60c: 91 05 cpc r25, r1 d60e: 81 f7 brne .-32 ; 0xd5f0 d610: 0e 0d add r16, r14 d612: 1f 2d mov r17, r15 d614: 11 1d adc r17, r1 { buf[i++] = n % base; n /= base; } for (; i > 0; i--) d616: e0 16 cp r14, r16 d618: f1 06 cpc r15, r17 d61a: 59 f0 breq .+22 ; 0xd632 lcd_print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); d61c: f8 01 movw r30, r16 d61e: 82 91 ld r24, -Z d620: 8f 01 movw r16, r30 d622: 8a 30 cpi r24, 0x0A ; 10 d624: 20 f4 brcc .+8 ; 0xd62e d626: 80 5d subi r24, 0xD0 ; 208 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); d628: 0e 94 20 6a call 0xd440 ; 0xd440 d62c: f4 cf rjmp .-24 ; 0xd616 { 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)); d62e: 89 5c subi r24, 0xC9 ; 201 d630: fb cf rjmp .-10 ; 0xd628 } d632: a0 96 adiw r28, 0x20 ; 32 d634: 0f b6 in r0, 0x3f ; 63 d636: f8 94 cli d638: de bf out 0x3e, r29 ; 62 d63a: 0f be out 0x3f, r0 ; 63 d63c: cd bf out 0x3d, r28 ; 61 d63e: df 91 pop r29 d640: cf 91 pop r28 d642: 1f 91 pop r17 d644: 0f 91 pop r16 d646: ff 90 pop r15 d648: ef 90 pop r14 d64a: bf 90 pop r11 d64c: af 90 pop r10 d64e: 9f 90 pop r9 d650: 8f 90 pop r8 d652: 08 95 ret 0000d654 : void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); } void lcd_print(long n, int base) d654: cf 92 push r12 d656: df 92 push r13 d658: ef 92 push r14 d65a: ff 92 push r15 d65c: 6b 01 movw r12, r22 d65e: 7c 01 movw r14, r24 { if (base == 0) lcd_write(n); else if (base == 10) { if (n < 0) d660: f7 fe sbrs r15, 7 d662: 0b c0 rjmp .+22 ; 0xd67a } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); d664: 8d e2 ldi r24, 0x2D ; 45 d666: 0e 94 20 6a call 0xd440 ; 0xd440 else if (base == 10) { if (n < 0) { lcd_print('-'); n = -n; d66a: f0 94 com r15 d66c: e0 94 com r14 d66e: d0 94 com r13 d670: c0 94 com r12 d672: c1 1c adc r12, r1 d674: d1 1c adc r13, r1 d676: e1 1c adc r14, r1 d678: f1 1c adc r15, r1 } lcd_printNumber(n, 10); d67a: 4a e0 ldi r20, 0x0A ; 10 d67c: c7 01 movw r24, r14 d67e: b6 01 movw r22, r12 } else lcd_printNumber(n, base); } d680: ff 90 pop r15 d682: ef 90 pop r14 d684: df 90 pop r13 d686: cf 90 pop r12 if (n < 0) { lcd_print('-'); n = -n; } lcd_printNumber(n, 10); d688: 0c 94 c5 6a jmp 0xd58a ; 0xd58a 0000d68c : lcd_space(len); return len; } uint8_t lcd_print_pad_P(const char* s, uint8_t len) { d68c: 0f 93 push r16 d68e: 1f 93 push r17 d690: cf 93 push r28 d692: 8c 01 movw r16, r24 d694: c6 2f mov r28, r22 while (len && pgm_read_byte(s)) { d696: cc 23 and r28, r28 d698: 59 f0 breq .+22 ; 0xd6b0 d69a: f8 01 movw r30, r16 d69c: 24 91 lpm r18, Z d69e: 22 23 and r18, r18 d6a0: 39 f0 breq .+14 ; 0xd6b0 lcd_write(pgm_read_byte(s++)); d6a2: 0f 5f subi r16, 0xFF ; 255 d6a4: 1f 4f sbci r17, 0xFF ; 255 d6a6: 84 91 lpm r24, Z d6a8: 0e 94 20 6a call 0xd440 ; 0xd440 --len; d6ac: c1 50 subi r28, 0x01 ; 1 d6ae: f3 cf rjmp .-26 ; 0xd696 } lcd_space(len); d6b0: 8c 2f mov r24, r28 d6b2: 0e 94 67 69 call 0xd2ce ; 0xd2ce return len; } d6b6: 8c 2f mov r24, r28 d6b8: cf 91 pop r28 d6ba: 1f 91 pop r17 d6bc: 0f 91 pop r16 d6be: 08 95 ret 0000d6c0 : { while (*s) lcd_write(*(s++)); } uint8_t lcd_print_pad(const char* s, uint8_t len) { d6c0: 0f 93 push r16 d6c2: 1f 93 push r17 d6c4: cf 93 push r28 d6c6: 8c 01 movw r16, r24 d6c8: c6 2f mov r28, r22 while (len && *s) { d6ca: cc 23 and r28, r28 d6cc: 49 f0 breq .+18 ; 0xd6e0 d6ce: f8 01 movw r30, r16 d6d0: 81 91 ld r24, Z+ d6d2: 8f 01 movw r16, r30 d6d4: 88 23 and r24, r24 d6d6: 21 f0 breq .+8 ; 0xd6e0 lcd_write(*(s++)); d6d8: 0e 94 20 6a call 0xd440 ; 0xd440 --len; d6dc: c1 50 subi r28, 0x01 ; 1 d6de: f5 cf rjmp .-22 ; 0xd6ca } lcd_space(len); d6e0: 8c 2f mov r24, r28 d6e2: 0e 94 67 69 call 0xd2ce ; 0xd2ce return len; } d6e6: 8c 2f mov r24, r28 d6e8: cf 91 pop r28 d6ea: 1f 91 pop r17 d6ec: 0f 91 pop r16 d6ee: 08 95 ret 0000d6f0 : while (n--) lcd_putc(' '); } void lcd_print(const char* s) { d6f0: cf 93 push r28 d6f2: df 93 push r29 d6f4: ec 01 movw r28, r24 while (*s) lcd_write(*(s++)); d6f6: 89 91 ld r24, Y+ d6f8: 88 23 and r24, r24 d6fa: 19 f0 breq .+6 ; 0xd702 d6fc: 0e 94 20 6a call 0xd440 ; 0xd440 d700: fa cf rjmp .-12 ; 0xd6f6 } d702: df 91 pop r29 d704: cf 91 pop r28 d706: 08 95 ret 0000d708 : lcd_command(LCD_ENTRYMODESET | lcd_displaymode); } static int lcd_putchar(char c, FILE *) { lcd_write(c); d708: 0e 94 20 6a call 0xd440 ; 0xd440 return 0; } d70c: 90 e0 ldi r25, 0x00 ; 0 d70e: 80 e0 ldi r24, 0x00 ; 0 d710: 08 95 ret 0000d712 : extern void lcd_frame_start(); //! @brief Consume click and longpress event inline void lcd_consume_click() { lcd_click_trigger = 0; d712: 10 92 63 03 sts 0x0363, r1 ; 0x800363 lcd_longpress_trigger = 0; d716: 10 92 14 06 sts 0x0614, r1 ; 0x800614 } d71a: 08 95 ret 0000d71c : //! Generally is used in modal dialogs. //! //! @retval 0 not clicked //! @retval nonzero clicked uint8_t lcd_clicked(void) { d71c: cf 93 push r28 bool clicked = LCD_CLICKED; d71e: 80 91 63 03 lds r24, 0x0363 ; 0x800363 d722: c1 e0 ldi r28, 0x01 ; 1 d724: 81 11 cpse r24, r1 d726: 04 c0 rjmp .+8 ; 0xd730 d728: c0 e0 ldi r28, 0x00 ; 0 if(clicked) { lcd_consume_click(); } return clicked; } d72a: 8c 2f mov r24, r28 d72c: cf 91 pop r28 d72e: 08 95 ret uint8_t lcd_clicked(void) { bool clicked = LCD_CLICKED; if(clicked) { lcd_consume_click(); d730: 0e 94 89 6b call 0xd712 ; 0xd712 d734: fa cf rjmp .-12 ; 0xd72a 0000d736 : 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); d736: 8e ef ldi r24, 0xFE ; 254 d738: 9f e0 ldi r25, 0x0F ; 15 d73a: 0f 94 9b a0 call 0x34136 ; 0x34136 return (lang_eeprom != LANG_ID_FORCE_SELECTION) && (lang_eeprom == lang_selected); d73e: 8e 3f cpi r24, 0xFE ; 254 d740: 39 f0 breq .+14 ; 0xd750 d742: 91 e0 ldi r25, 0x01 ; 1 d744: 20 91 2f 03 lds r18, 0x032F ; 0x80032f d748: 28 13 cpse r18, r24 d74a: 90 e0 ldi r25, 0x00 ; 0 d74c: 89 2f mov r24, r25 d74e: 08 95 ret d750: 80 e0 ldi r24, 0x00 ; 0 } d752: 08 95 ret 0000d754 : return _n("??"); } void lang_reset(void) { lang_selected = 0; d754: 10 92 2f 03 sts 0x032F, r1 ; 0x80032f eeprom_update_byte((unsigned char*)EEPROM_LANG, LANG_ID_FORCE_SELECTION); d758: 6e ef ldi r22, 0xFE ; 254 d75a: 8e ef ldi r24, 0xFE ; 254 d75c: 9f e0 ldi r25, 0x0F ; 15 d75e: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 0000d762 : return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) d762: 85 37 cpi r24, 0x75 ; 117 d764: 28 e6 ldi r18, 0x68 ; 104 d766: 92 07 cpc r25, r18 d768: 09 f4 brne .+2 ; 0xd76c d76a: 59 c0 rjmp .+178 ; 0xd81e d76c: f8 f4 brcc .+62 ; 0xd7ac d76e: 8e 36 cpi r24, 0x6E ; 110 d770: 25 e6 ldi r18, 0x65 ; 101 d772: 92 07 cpc r25, r18 d774: 09 f4 brne .+2 ; 0xd778 d776: 59 c0 rjmp .+178 ; 0xd82a d778: 50 f4 brcc .+20 ; 0xd78e d77a: 83 37 cpi r24, 0x73 ; 115 d77c: 23 e6 ldi r18, 0x63 ; 99 d77e: 92 07 cpc r25, r18 d780: b1 f1 breq .+108 ; 0xd7ee d782: 85 36 cpi r24, 0x65 ; 101 d784: 94 46 sbci r25, 0x64 ; 100 d786: b1 f1 breq .+108 ; 0xd7f4 //#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("??"); d788: 82 e9 ldi r24, 0x92 ; 146 d78a: 93 e6 ldi r25, 0x63 ; 99 d78c: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) d78e: 82 37 cpi r24, 0x72 ; 114 d790: 26 e6 ldi r18, 0x66 ; 102 d792: 92 07 cpc r25, r18 d794: 91 f1 breq .+100 ; 0xd7fa d796: 82 37 cpi r24, 0x72 ; 114 d798: 28 e6 ldi r18, 0x68 ; 104 d79a: 92 07 cpc r25, r18 d79c: 09 f4 brne .+2 ; 0xd7a0 d79e: 42 c0 rjmp .+132 ; 0xd824 d7a0: 83 37 cpi r24, 0x73 ; 115 d7a2: 95 46 sbci r25, 0x65 ; 101 d7a4: 89 f7 brne .-30 ; 0xd788 { 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"); d7a6: 89 ee ldi r24, 0xE9 ; 233 d7a8: 93 e6 ldi r25, 0x63 ; 99 d7aa: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) d7ac: 8c 36 cpi r24, 0x6C ; 108 d7ae: 20 e7 ldi r18, 0x70 ; 112 d7b0: 92 07 cpc r25, r18 d7b2: 31 f1 breq .+76 ; 0xd800 d7b4: 70 f4 brcc .+28 ; 0xd7d2 d7b6: 8c 36 cpi r24, 0x6C ; 108 d7b8: 2e e6 ldi r18, 0x6E ; 110 d7ba: 92 07 cpc r25, r18 d7bc: 21 f1 breq .+72 ; 0xd806 d7be: 8f 36 cpi r24, 0x6F ; 111 d7c0: 2e e6 ldi r18, 0x6E ; 110 d7c2: 92 07 cpc r25, r18 d7c4: 31 f1 breq .+76 ; 0xd812 d7c6: 84 37 cpi r24, 0x74 ; 116 d7c8: 99 46 sbci r25, 0x69 ; 105 d7ca: f1 f6 brne .-68 ; 0xd788 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"); d7cc: 87 ed ldi r24, 0xD7 ; 215 d7ce: 93 e6 ldi r25, 0x63 ; 99 d7d0: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) d7d2: 8b 36 cpi r24, 0x6B ; 107 d7d4: 23 e7 ldi r18, 0x73 ; 115 d7d6: 92 07 cpc r25, r18 d7d8: f9 f0 breq .+62 ; 0xd818 d7da: 86 37 cpi r24, 0x76 ; 118 d7dc: 23 e7 ldi r18, 0x73 ; 115 d7de: 92 07 cpc r25, r18 d7e0: a9 f0 breq .+42 ; 0xd80c d7e2: 8f 36 cpi r24, 0x6F ; 111 d7e4: 92 47 sbci r25, 0x72 ; 114 d7e6: 81 f6 brne .-96 ; 0xd788 #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 d7e8: 85 e9 ldi r24, 0x95 ; 149 d7ea: 93 e6 ldi r25, 0x63 ; 99 d7ec: 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"); d7ee: 89 ef ldi r24, 0xF9 ; 249 d7f0: 93 e6 ldi r25, 0x63 ; 99 d7f2: 08 95 ret case LANG_CODE_DE: return _n("Deutsch"); d7f4: 81 ef ldi r24, 0xF1 ; 241 d7f6: 93 e6 ldi r25, 0x63 ; 99 d7f8: 08 95 ret case LANG_CODE_ES: return _n("Espanol"); case LANG_CODE_FR: return _n("Francais"); d7fa: 80 ee ldi r24, 0xE0 ; 224 d7fc: 93 e6 ldi r25, 0x63 ; 99 d7fe: 08 95 ret case LANG_CODE_IT: return _n("Italiano"); case LANG_CODE_PL: return _n("Polski"); d800: 80 ed ldi r24, 0xD0 ; 208 d802: 93 e6 ldi r25, 0x63 ; 99 d804: 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 d806: 85 ec ldi r24, 0xC5 ; 197 d808: 93 e6 ldi r25, 0x63 ; 99 d80a: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_NL #ifdef COMMUNITY_LANG_GROUP1_SV case LANG_CODE_SV: return _n("Svenska"); //community Swedish contribution d80c: 8d eb ldi r24, 0xBD ; 189 d80e: 93 e6 ldi r25, 0x63 ; 99 d810: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_SV #ifdef COMMUNITY_LANG_GROUP1_NO case LANG_CODE_NO: return _n("Norsk"); //community Swedish contribution d812: 87 eb ldi r24, 0xB7 ; 183 d814: 93 e6 ldi r25, 0x63 ; 99 d816: 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 d818: 8c ea ldi r24, 0xAC ; 172 d81a: 93 e6 ldi r25, 0x63 ; 99 d81c: 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 d81e: 85 ea ldi r24, 0xA5 ; 165 d820: 93 e6 ldi r25, 0x63 ; 99 d822: 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 d824: 8c e9 ldi r24, 0x9C ; 156 d826: 93 e6 ldi r25, 0x63 ; 99 d828: 08 95 ret const char* lang_get_name_by_code(uint16_t code) { switch (code) { case LANG_CODE_EN: return _n("English"); d82a: 81 e0 ldi r24, 0x01 ; 1 d82c: 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("??"); } d82e: 08 95 ret 0000d830 : return (sum == lt_sum); } uint8_t lang_get_count() { if (pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE))) == 0xffffffff) d830: e3 e5 ldi r30, 0x53 ; 83 d832: f4 e7 ldi r31, 0x74 ; 116 d834: 85 91 lpm r24, Z+ d836: 95 91 lpm r25, Z+ d838: a5 91 lpm r26, Z+ d83a: b4 91 lpm r27, Z d83c: 8f 3f cpi r24, 0xFF ; 255 d83e: 9f 4f sbci r25, 0xFF ; 255 d840: af 4f sbci r26, 0xFF ; 255 d842: bf 4f sbci r27, 0xFF ; 255 d844: b1 f0 breq .+44 ; 0xd872 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; d846: 20 e0 ldi r18, 0x00 ; 0 d848: 31 e0 ldi r19, 0x01 ; 1 uint8_t count = 1; //count = 1 (primary) d84a: 81 e0 ldi r24, 0x01 ; 1 while (pgm_read_dword(((uint32_t*)table)) == LANG_MAGIC) //magic valid d84c: f9 01 movw r30, r18 d84e: 45 91 lpm r20, Z+ d850: 55 91 lpm r21, Z+ d852: 65 91 lpm r22, Z+ d854: 74 91 lpm r23, Z d856: 45 3a cpi r20, 0xA5 ; 165 d858: 5a 45 sbci r21, 0x5A ; 90 d85a: 64 4b sbci r22, 0xB4 ; 180 d85c: 7b 44 sbci r23, 0x4B ; 75 d85e: 09 f0 breq .+2 ; 0xd862 d860: 08 95 ret { table += pgm_read_word((uint16_t*)(table + 4)); d862: f9 01 movw r30, r18 d864: 34 96 adiw r30, 0x04 ; 4 d866: 45 91 lpm r20, Z+ d868: 54 91 lpm r21, Z d86a: 24 0f add r18, r20 d86c: 35 1f adc r19, r21 count++; d86e: 8f 5f subi r24, 0xFF ; 255 d870: ed cf rjmp .-38 ; 0xd84c } 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 d872: 81 e0 ldi r24, 0x01 ; 1 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return count; } d874: 08 95 ret 0000d876 : 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) { d876: 0f 93 push r16 d878: 1f 93 push r17 if (lang == LANG_ID_PRI) //primary language d87a: 81 11 cpse r24, r1 d87c: 13 c0 rjmp .+38 ; 0xd8a4 { lang_table = 0; d87e: 10 92 2e 03 sts 0x032E, r1 ; 0x80032e d882: 10 92 2d 03 sts 0x032D, r1 ; 0x80032d lang_selected = lang; d886: 10 92 2f 03 sts 0x032F, r1 ; 0x80032f lang_selected = lang; // set language id } } } #endif //XFLASH if (lang_selected == lang) d88a: 90 91 2f 03 lds r25, 0x032F ; 0x80032f d88e: 98 13 cpse r25, r24 d890: 5c c0 rjmp .+184 ; 0xd94a d892: 68 2f mov r22, r24 { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); d894: 8e ef ldi r24, 0xFE ; 254 d896: 9f e0 ldi r25, 0x0F ; 15 d898: 0f 94 bf a0 call 0x3417e ; 0x3417e return 1; d89c: 81 e0 ldi r24, 0x01 ; 1 } return 0; } d89e: 1f 91 pop r17 d8a0: 0f 91 pop r16 d8a2: 08 95 ret lang_selected = lang; // set language id } } } #else //XFLASH if (lang == LANG_ID_SEC) d8a4: 81 30 cpi r24, 0x01 ; 1 d8a6: 89 f7 brne .-30 ; 0xd88a { uint16_t table = _SEC_LANG_TABLE; if (pgm_read_dword(((uint32_t*)table)) == LANG_MAGIC) //magic valid d8a8: e0 e0 ldi r30, 0x00 ; 0 d8aa: f1 e0 ldi r31, 0x01 ; 1 d8ac: 45 91 lpm r20, Z+ d8ae: 55 91 lpm r21, Z+ d8b0: 65 91 lpm r22, Z+ d8b2: 74 91 lpm r23, Z d8b4: 45 3a cpi r20, 0xA5 ; 165 d8b6: 5a 45 sbci r21, 0x5A ; 90 d8b8: 64 4b sbci r22, 0xB4 ; 180 d8ba: 7b 44 sbci r23, 0x4B ; 75 d8bc: 31 f7 brne .-52 ; 0xd88a } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; uint16_t size = pgm_read_word((uint16_t*)(addr + 4)); d8be: e4 e0 ldi r30, 0x04 ; 4 d8c0: f1 e0 ldi r31, 0x01 ; 1 d8c2: a5 91 lpm r26, Z+ d8c4: b4 91 lpm r27, Z uint16_t lt_sum = pgm_read_word((uint16_t*)(addr + 8)); d8c6: e8 e0 ldi r30, 0x08 ; 8 d8c8: f1 e0 ldi r31, 0x01 ; 1 d8ca: 65 91 lpm r22, Z+ d8cc: 74 91 lpm r23, Z uint16_t i; for (i = 0; i < size; i++) d8ce: 50 e0 ldi r21, 0x00 ; 0 d8d0: 40 e0 ldi r20, 0x00 ; 0 return 0; } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; d8d2: 30 e0 ldi r19, 0x00 ; 0 d8d4: 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++) d8d6: a4 17 cp r26, r20 d8d8: b5 07 cpc r27, r21 d8da: 29 f5 brne .+74 ; 0xd926 sum += (uint16_t)pgm_read_byte((uint8_t*)(addr + i)) << ((i & 1)?0:8); sum -= lt_sum; //subtract checksum d8dc: 26 1b sub r18, r22 d8de: 37 0b sbc r19, r23 sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes d8e0: 32 27 eor r19, r18 d8e2: 23 27 eor r18, r19 d8e4: 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)) d8e6: 62 17 cp r22, r18 d8e8: 73 07 cpc r23, r19 d8ea: 09 f0 breq .+2 ; 0xd8ee d8ec: ce cf rjmp .-100 ; 0xd88a if (pgm_read_dword(((uint32_t*)(table + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid d8ee: ec e0 ldi r30, 0x0C ; 12 d8f0: f1 e0 ldi r31, 0x01 ; 1 d8f2: 05 91 lpm r16, Z+ d8f4: 15 91 lpm r17, Z+ d8f6: 25 91 lpm r18, Z+ d8f8: 34 91 lpm r19, Z d8fa: e3 e5 ldi r30, 0x53 ; 83 d8fc: f4 e7 ldi r31, 0x74 ; 116 d8fe: 45 91 lpm r20, Z+ d900: 55 91 lpm r21, Z+ d902: 65 91 lpm r22, Z+ d904: 74 91 lpm r23, Z d906: 04 17 cp r16, r20 d908: 15 07 cpc r17, r21 d90a: 26 07 cpc r18, r22 d90c: 37 07 cpc r19, r23 d90e: 09 f0 breq .+2 ; 0xd912 d910: bc cf rjmp .-136 ; 0xd88a { lang_table = (lang_table_t*)table; // set table pointer d912: 20 e0 ldi r18, 0x00 ; 0 d914: 31 e0 ldi r19, 0x01 ; 1 d916: 30 93 2e 03 sts 0x032E, r19 ; 0x80032e d91a: 20 93 2d 03 sts 0x032D, r18 ; 0x80032d lang_selected = lang; // set language id d91e: 91 e0 ldi r25, 0x01 ; 1 d920: 90 93 2f 03 sts 0x032F, r25 ; 0x80032f d924: b2 cf rjmp .-156 ; 0xd88a { 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); d926: fa 01 movw r30, r20 d928: e0 50 subi r30, 0x00 ; 0 d92a: ff 4f sbci r31, 0xFF ; 255 d92c: e4 91 lpm r30, Z d92e: f0 e0 ldi r31, 0x00 ; 0 d930: 98 e0 ldi r25, 0x08 ; 8 d932: 40 fd sbrc r20, 0 d934: 90 e0 ldi r25, 0x00 ; 0 d936: 02 c0 rjmp .+4 ; 0xd93c d938: ee 0f add r30, r30 d93a: ff 1f adc r31, r31 d93c: 9a 95 dec r25 d93e: e2 f7 brpl .-8 ; 0xd938 d940: 2e 0f add r18, r30 d942: 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++) d944: 4f 5f subi r20, 0xFF ; 255 d946: 5f 4f sbci r21, 0xFF ; 255 d948: c6 cf rjmp .-116 ; 0xd8d6 if (lang_selected == lang) { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); return 1; } return 0; d94a: 80 e0 ldi r24, 0x00 ; 0 d94c: a8 cf rjmp .-176 ; 0xd89e 0000d94e : //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. d94e: 20 91 2f 03 lds r18, 0x032F ; 0x80032f d952: 21 11 cpse r18, r1 d954: 04 c0 rjmp .+8 ; 0xd95e d956: fc 01 movw r30, r24 d958: 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 } d95a: cf 01 movw r24, r30 d95c: 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. d95e: 40 91 2d 03 lds r20, 0x032D ; 0x80032d d962: 50 91 2e 03 lds r21, 0x032E ; 0x80032e d966: 41 15 cp r20, r1 d968: 51 05 cpc r21, r1 d96a: a9 f3 breq .-22 ; 0xd956 uint16_t ui = pgm_read_word(((uint16_t*)s)); //read string id d96c: fc 01 movw r30, r24 d96e: 25 91 lpm r18, Z+ d970: 34 91 lpm r19, Z if (ui == 0xffff) return s + 2; //id not assigned, return orig. str. d972: 2f 3f cpi r18, 0xFF ; 255 d974: 32 07 cpc r19, r18 d976: 79 f3 breq .-34 ; 0xd956 ui = pgm_read_word(((uint16_t*)(((char*)lang_table + 16 + ui*2)))); //read relative offset d978: f9 01 movw r30, r18 d97a: 38 96 adiw r30, 0x08 ; 8 d97c: ee 0f add r30, r30 d97e: ff 1f adc r31, r31 d980: e4 0f add r30, r20 d982: f5 1f adc r31, r21 d984: 25 91 lpm r18, Z+ d986: 34 91 lpm r19, Z if (pgm_read_byte(((uint8_t*)((char*)lang_table + ui))) == 0) //read first character d988: fa 01 movw r30, r20 d98a: e2 0f add r30, r18 d98c: f3 1f adc r31, r19 d98e: 24 91 lpm r18, Z d990: 22 23 and r18, r18 d992: 09 f3 breq .-62 ; 0xd956 d994: e2 cf rjmp .-60 ; 0xd95a 0000d996 : } sound_wait_for_user_reset(); } void M600_load_filament_movements(const char* filament_name) { d996: cf 93 push r28 d998: df 93 push r29 d99a: ec 01 movw r28, r24 current_position[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED; d99c: 20 e0 ldi r18, 0x00 ; 0 d99e: 30 e0 ldi r19, 0x00 ; 0 d9a0: 4c e8 ldi r20, 0x8C ; 140 d9a2: 52 e4 ldi r21, 0x42 ; 66 d9a4: 60 91 01 12 lds r22, 0x1201 ; 0x801201 d9a8: 70 91 02 12 lds r23, 0x1202 ; 0x801202 d9ac: 80 91 03 12 lds r24, 0x1203 ; 0x801203 d9b0: 90 91 04 12 lds r25, 0x1204 ; 0x801204 d9b4: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> d9b8: 60 93 01 12 sts 0x1201, r22 ; 0x801201 d9bc: 70 93 02 12 sts 0x1202, r23 ; 0x801202 d9c0: 80 93 03 12 sts 0x1203, r24 ; 0x801203 d9c4: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); d9c8: 60 e0 ldi r22, 0x00 ; 0 d9ca: 70 e0 ldi r23, 0x00 ; 0 d9cc: 80 ea ldi r24, 0xA0 ; 160 d9ce: 91 e4 ldi r25, 0x41 ; 65 d9d0: 0f 94 2f 85 call 0x30a5e ; 0x30a5e load_filament_final_feed(); d9d4: 0e 94 6b 5e call 0xbcd6 ; 0xbcd6 } void lcd_loading_filament(const char* filament_name) { lcd_clear(); d9d8: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_puts_at_P(0, 0, _T(MSG_LOADING_FILAMENT)); d9dc: 82 e0 ldi r24, 0x02 ; 2 d9de: 9a e5 ldi r25, 0x5A ; 90 d9e0: 0e 94 a7 6c call 0xd94e ; 0xd94e d9e4: ac 01 movw r20, r24 d9e6: 60 e0 ldi r22, 0x00 ; 0 d9e8: 80 e0 ldi r24, 0x00 ; 0 d9ea: 0e 94 85 69 call 0xd30a ; 0xd30a if (filament_name[0]) { d9ee: 88 81 ld r24, Y d9f0: 88 23 and r24, r24 d9f2: 39 f0 breq .+14 ; 0xda02 lcd_set_cursor(0, 1); d9f4: 61 e0 ldi r22, 0x01 ; 1 d9f6: 80 e0 ldi r24, 0x00 ; 0 d9f8: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_print(filament_name); d9fc: ce 01 movw r24, r28 d9fe: 0e 94 78 6b call 0xd6f0 ; 0xd6f0 } lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); da02: 85 e6 ldi r24, 0x65 ; 101 da04: 99 e3 ldi r25, 0x39 ; 57 da06: 0e 94 a7 6c call 0xd94e ; 0xd94e da0a: ac 01 movw r20, r24 da0c: 62 e0 ldi r22, 0x02 ; 2 da0e: 80 e0 ldi r24, 0x00 ; 0 da10: 0e 94 85 69 call 0xd30a ; 0xd30a 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 da14: 83 e4 ldi r24, 0x43 ; 67 da16: 9b e2 ldi r25, 0x2B ; 43 da18: 0f 94 6d 0c call 0x218da ; 0x218da lcd_loading_filament(filament_name); st_synchronize(); } da1c: df 91 pop r29 da1e: 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(); da20: 0d 94 ce 22 jmp 0x2459c ; 0x2459c 0000da24 : * 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; da24: 0f 94 4a 42 call 0x28494 ; 0x28494 da28: 8f 3f cpi r24, 0xFF ; 255 da2a: 11 f1 breq .+68 ; 0xda70 lcd_update_enable(false); da2c: 80 e0 ldi r24, 0x00 ; 0 da2e: 0e 94 b6 69 call 0xd36c ; 0xd36c lcd_clear(); da32: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_puts_at_P(0, 1, _T(MSG_UNLOADING_FILAMENT)); da36: 8e e5 ldi r24, 0x5E ; 94 da38: 96 e5 ldi r25, 0x56 ; 86 da3a: 0e 94 a7 6c call 0xd94e ; 0xd94e da3e: ac 01 movw r20, r24 da40: 61 e0 ldi r22, 0x01 ; 1 da42: 80 e0 ldi r24, 0x00 ; 0 da44: 0e 94 85 69 call 0xd30a ; 0xd30a } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); da48: 80 e2 ldi r24, 0x20 ; 32 da4a: 0e 94 20 6a call 0xd440 ; 0xd440 lcd_print(' '); lcd_print(MMU2::mmu2.get_current_tool() + 1); da4e: 0f 94 4a 42 call 0x28494 ; 0x28494 da52: 68 2f mov r22, r24 da54: 70 e0 ldi r23, 0x00 ; 0 da56: 6f 5f subi r22, 0xFF ; 255 da58: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); da5a: 07 2e mov r0, r23 da5c: 00 0c add r0, r0 da5e: 88 0b sbc r24, r24 da60: 99 0b sbc r25, r25 da62: 0e 94 2a 6b call 0xd654 ; 0xd654 // unload just current filament for multimaterial printers (used also in M702) MMU2::mmu2.unload(); da66: 0f 94 52 6b call 0x2d6a4 ; 0x2d6a4 lcd_update_enable(true); da6a: 81 e0 ldi r24, 0x01 ; 1 da6c: 0c 94 b6 69 jmp 0xd36c ; 0xd36c } da70: 08 95 ret 0000da72 <__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 { da72: 1f 92 push r1 da74: 0f 92 push r0 da76: 0f b6 in r0, 0x3f ; 63 da78: 0f 92 push r0 da7a: 11 24 eor r1, r1 da7c: 0b b6 in r0, 0x3b ; 59 da7e: 0f 92 push r0 da80: 2f 93 push r18 da82: 8f 93 push r24 da84: 9f 93 push r25 da86: ef 93 push r30 da88: ff 93 push r31 switch(state){ da8a: e0 91 28 03 lds r30, 0x0328 ; 0x800328 da8e: e8 30 cpi r30, 0x08 ; 8 da90: e8 f4 brcc .+58 ; 0xdacc <__vector_23+0x5a> da92: f0 e0 ldi r31, 0x00 ; 0 da94: 88 27 eor r24, r24 da96: e0 5b subi r30, 0xB0 ; 176 da98: f2 49 sbci r31, 0x92 ; 146 da9a: 8f 4f sbci r24, 0xFF ; 255 da9c: 0d 94 ab a1 jmp 0x34356 ; 0x34356 <__tablejump2__> daa0: 58 6d ori r21, 0xD8 ; 216 daa2: 72 6d ori r23, 0xD2 ; 210 daa4: 7d 6d ori r23, 0xDD ; 221 daa6: 8b 6d ori r24, 0xDB ; 219 daa8: a1 6d ori r26, 0xD1 ; 209 daaa: aa 6d ori r26, 0xDA ; 218 daac: cd 6d ori r28, 0xDD ; 221 daae: df 6d ori r29, 0xDF ; 223 case States::ZERO_START: if (bedPWMDisabled) return; // stay in the OFF state and do not change the output pin dab0: 80 91 92 06 lds r24, 0x0692 ; 0x800692 dab4: 81 11 cpse r24, r1 dab6: 0a c0 rjmp .+20 ; 0xdacc <__vector_23+0x5a> pwm = soft_pwm_bed << 1;// expecting soft_pwm_bed to be 7bit! dab8: 80 91 5b 06 lds r24, 0x065B ; 0x80065b dabc: 88 0f add r24, r24 dabe: 80 93 27 03 sts 0x0327, r24 ; 0x800327 if( pwm != 0 ){ dac2: 88 23 and r24, r24 dac4: 19 f0 breq .+6 ; 0xdacc <__vector_23+0x5a> state = States::ZERO; // do nothing, let it tick once again after the 30Hz period dac6: 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 dac8: 80 93 28 03 sts 0x0328, r24 ; 0x800328 TCNT0 = 128; OCR0B = 255; TCCR0B = (1 << CS01); // change prescaler to 8, i.e. 7.8kHz break; } } dacc: ff 91 pop r31 dace: ef 91 pop r30 dad0: 9f 91 pop r25 dad2: 8f 91 pop r24 dad4: 2f 91 pop r18 dad6: 0f 90 pop r0 dad8: 0b be out 0x3b, r0 ; 59 dada: 0f 90 pop r0 dadc: 0f be out 0x3f, r0 ; 63 dade: 0f 90 pop r0 dae0: 1f 90 pop r1 dae2: 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) dae4: 80 91 26 03 lds r24, 0x0326 ; 0x800326 dae8: 8f 5f subi r24, 0xFF ; 255 daea: 80 93 26 03 sts 0x0326, r24 ; 0x800326 if( slowCounter > pwm ){ daee: 90 91 27 03 lds r25, 0x0327 ; 0x800327 daf2: 98 17 cp r25, r24 daf4: 58 f3 brcs .-42 ; 0xdacc <__vector_23+0x5a> return; } // otherwise moving towards RISE state = States::ZERO_TO_RISE; // and finalize the change in a transitional state RISE0 daf6: 82 e0 ldi r24, 0x02 ; 2 daf8: e7 cf rjmp .-50 ; 0xdac8 <__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 dafa: 83 e0 ldi r24, 0x03 ; 3 dafc: 80 93 28 03 sts 0x0328, r24 ; 0x800328 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE db00: 8f e0 ldi r24, 0x0F ; 15 db02: 80 93 25 03 sts 0x0325, r24 ; 0x800325 TCNT0 = 255; // force overflow on the next clock cycle db06: 8f ef ldi r24, 0xFF ; 255 db08: 86 bd out 0x26, r24 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz db0a: 81 e0 ldi r24, 0x01 ; 1 db0c: 85 bd out 0x25, r24 ; 37 TCCR0A &= ~(1 << COM0B0); // Clear OC0B on Compare Match, set OC0B at BOTTOM (non-inverting mode) db0e: 84 b5 in r24, 0x24 ; 36 db10: 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 db12: 84 bd out 0x24, r24 ; 36 db14: db cf rjmp .-74 ; 0xdacc <__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; db16: 80 91 25 03 lds r24, 0x0325 ; 0x800325 db1a: 82 95 swap r24 db1c: 80 7f andi r24, 0xF0 ; 240 db1e: 81 95 neg r24 db20: 88 bd out 0x28, r24 ; 40 if( fastCounter ){ db22: 80 91 25 03 lds r24, 0x0325 ; 0x800325 db26: 88 23 and r24, r24 db28: 21 f0 breq .+8 ; 0xdb32 <__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; db2a: 81 50 subi r24, 0x01 ; 1 db2c: 80 93 25 03 sts 0x0325, r24 ; 0x800325 db30: cd cf rjmp .-102 ; 0xdacc <__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; db32: 84 e0 ldi r24, 0x04 ; 4 db34: 80 93 28 03 sts 0x0328, r24 ; 0x800328 OCR0B = 255; // full duty db38: 8f ef ldi r24, 0xFF ; 255 db3a: 88 bd out 0x28, r24 ; 40 TCNT0 = 254; // make the timer overflow in the next cycle db3c: 8e ef ldi r24, 0xFE ; 254 db3e: 86 bd out 0x26, r24 ; 38 db40: c5 cf rjmp .-118 ; 0xdacc <__vector_23+0x5a> // @@TODO these constants are still subject to investigation } break; case States::RISE_TO_ONE: state = States::ONE; db42: 85 e0 ldi r24, 0x05 ; 5 db44: 80 93 28 03 sts 0x0328, r24 ; 0x800328 OCR0B = 255; // full duty db48: 8f ef ldi r24, 0xFF ; 255 db4a: 88 bd out 0x28, r24 ; 40 TCNT0 = 255; // make the timer overflow in the next cycle db4c: 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 db4e: 82 e0 ldi r24, 0x02 ; 2 db50: 85 bd out 0x25, r24 ; 37 db52: bc cf rjmp .-136 ; 0xdacc <__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; db54: 2f ef ldi r18, 0xFF ; 255 db56: 28 bd out 0x28, r18 ; 40 if (bedPWMDisabled) return; // stay in the ON state and do not change the output pin db58: 80 91 92 06 lds r24, 0x0692 ; 0x800692 db5c: 81 11 cpse r24, r1 db5e: b6 cf rjmp .-148 ; 0xdacc <__vector_23+0x5a> slowCounter += slowInc; // this does software timer_clk/256 or less db60: 80 91 26 03 lds r24, 0x0326 ; 0x800326 db64: 8f 5f subi r24, 0xFF ; 255 db66: 80 93 26 03 sts 0x0326, r24 ; 0x800326 if( slowCounter < pwm ){ db6a: 90 91 27 03 lds r25, 0x0327 ; 0x800327 db6e: 89 17 cp r24, r25 db70: 08 f4 brcc .+2 ; 0xdb74 <__vector_23+0x102> db72: ac cf rjmp .-168 ; 0xdacc <__vector_23+0x5a> return; } if( (soft_pwm_bed << 1) >= (255 - slowInc - 1) ){ //@@TODO simplify & explain db74: 80 91 5b 06 lds r24, 0x065B ; 0x80065b db78: 90 e0 ldi r25, 0x00 ; 0 db7a: 8f 37 cpi r24, 0x7F ; 127 db7c: 91 05 cpc r25, r1 db7e: 0c f0 brlt .+2 ; 0xdb82 <__vector_23+0x110> db80: a5 cf rjmp .-182 ; 0xdacc <__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; db82: 86 e0 ldi r24, 0x06 ; 6 db84: 80 93 28 03 sts 0x0328, r24 ; 0x800328 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE db88: 8f e0 ldi r24, 0x0F ; 15 db8a: 80 93 25 03 sts 0x0325, r24 ; 0x800325 TCNT0 = 255; // force overflow on the next clock cycle db8e: 26 bd out 0x26, r18 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz db90: 81 e0 ldi r24, 0x01 ; 1 db92: 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 db94: 84 b5 in r24, 0x24 ; 36 db96: 80 61 ori r24, 0x10 ; 16 db98: bc cf rjmp .-136 ; 0xdb12 <__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 db9a: 80 91 25 03 lds r24, 0x0325 ; 0x800325 db9e: 82 95 swap r24 dba0: 80 7f andi r24, 0xF0 ; 240 dba2: 81 95 neg r24 dba4: 88 bd out 0x28, r24 ; 40 //TCCR0A |= (1 << COM0B0); // already set in ONE_TO_FALL if( fastCounter ){ dba6: 80 91 25 03 lds r24, 0x0325 ; 0x800325 dbaa: 81 11 cpse r24, r1 dbac: be cf rjmp .-132 ; 0xdb2a <__vector_23+0xb8> --fastCounter; } else { // end of FALL cycles, changing into state ZERO state = States::FALL_TO_ZERO; dbae: 87 e0 ldi r24, 0x07 ; 7 dbb0: 80 93 28 03 sts 0x0328, r24 ; 0x800328 TCNT0 = 128; //@@TODO again - need to wait long enough to propagate the timer state changes dbb4: 80 e8 ldi r24, 0x80 ; 128 dbb6: 86 bd out 0x26, r24 ; 38 OCR0B = 255; dbb8: 8f ef ldi r24, 0xFF ; 255 dbba: 88 bd out 0x28, r24 ; 40 dbbc: 87 cf rjmp .-242 ; 0xdacc <__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 dbbe: 10 92 28 03 sts 0x0328, r1 ; 0x800328 TCNT0 = 128; dbc2: 80 e8 ldi r24, 0x80 ; 128 dbc4: 86 bd out 0x26, r24 ; 38 OCR0B = 255; dbc6: 8f ef ldi r24, 0xFF ; 255 dbc8: 88 bd out 0x28, r24 ; 40 dbca: c1 cf rjmp .-126 ; 0xdb4e <__vector_23+0xdc> 0000dbcc : if (updateEEPROM) { eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR_ACTION_NA, (uint8_t)state); } } void Filament_sensor::settings_init_common() { dbcc: cf 93 push r28 dbce: df 93 push r29 dbd0: ec 01 movw r28, r24 bool enabled = eeprom_read_byte((uint8_t *)EEPROM_FSENSOR); dbd2: 87 e6 ldi r24, 0x67 ; 103 dbd4: 9f e0 ldi r25, 0x0F ; 15 dbd6: 0f 94 9b a0 call 0x34136 ; 0x34136 dbda: 91 e0 ldi r25, 0x01 ; 1 dbdc: 81 11 cpse r24, r1 dbde: 01 c0 rjmp .+2 ; 0xdbe2 dbe0: 90 e0 ldi r25, 0x00 ; 0 if ((state != State::disabled) != enabled) { dbe2: 81 e0 ldi r24, 0x01 ; 1 dbe4: 28 81 ld r18, Y dbe6: 21 11 cpse r18, r1 dbe8: 01 c0 rjmp .+2 ; 0xdbec dbea: 80 e0 ldi r24, 0x00 ; 0 dbec: 89 13 cpse r24, r25 state = enabled ? State::initializing : State::disabled; dbee: 98 83 st Y, r25 } autoLoadEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED); dbf0: 87 e0 ldi r24, 0x07 ; 7 dbf2: 9f e0 ldi r25, 0x0F ; 15 dbf4: 0f 94 9b a0 call 0x34136 ; 0x34136 dbf8: 91 e0 ldi r25, 0x01 ; 1 dbfa: 81 11 cpse r24, r1 dbfc: 01 c0 rjmp .+2 ; 0xdc00 dbfe: 90 e0 ldi r25, 0x00 ; 0 dc00: 99 83 std Y+1, r25 ; 0x01 runoutEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_RUNOUT_ENABLED); dc02: 85 ed ldi r24, 0xD5 ; 213 dc04: 9e e0 ldi r25, 0x0E ; 14 dc06: 0f 94 9b a0 call 0x34136 ; 0x34136 dc0a: 91 e0 ldi r25, 0x01 ; 1 dc0c: 81 11 cpse r24, r1 dc0e: 01 c0 rjmp .+2 ; 0xdc12 dc10: 90 e0 ldi r25, 0x00 ; 0 dc12: 9a 83 std Y+2, r25 ; 0x02 sensorActionOnError = (SensorActionOnError)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_ACTION_NA); dc14: 87 e4 ldi r24, 0x47 ; 71 dc16: 9d e0 ldi r25, 0x0D ; 13 dc18: 0f 94 9b a0 call 0x34136 ; 0x34136 if (sensorActionOnError == SensorActionOnError::_Undef) { dc1c: 8f 3f cpi r24, 0xFF ; 255 dc1e: 21 f0 breq .+8 ; 0xdc28 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); dc20: 88 87 std Y+8, r24 ; 0x08 if (sensorActionOnError == SensorActionOnError::_Undef) { sensorActionOnError = SensorActionOnError::_Continue; } } dc22: df 91 pop r29 dc24: cf 91 pop r28 dc26: 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; dc28: 18 86 std Y+8, r1 ; 0x08 dc2a: fb cf rjmp .-10 ; 0xdc22 0000dc2c : #else // FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { } FSensorBlockRunout::~FSensorBlockRunout() { } #endif // FILAMENT_SENSOR void Filament_sensor::setEnabled(bool enabled) { dc2c: cf 93 push r28 dc2e: c8 2f mov r28, r24 dc30: 68 2f mov r22, r24 dc32: 87 e6 ldi r24, 0x67 ; 103 dc34: 9f e0 ldi r25, 0x0F ; 15 dc36: 0f 94 bf a0 call 0x3417e ; 0x3417e eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR, enabled); if (enabled) { dc3a: cc 23 and r28, r28 dc3c: 19 f0 breq .+6 ; 0xdc44 fsensor.init(); } else { fsensor.deinit(); } } dc3e: 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(); dc40: 0d 94 fd 53 jmp 0x2a7fa ; 0x2a7fa 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 dc44: 51 98 cbi 0x0a, 1 ; 10 WRITE(IR_SENSOR_PIN, 0); // no pullup dc46: 59 98 cbi 0x0b, 1 ; 11 state = State::disabled; dc48: 10 92 84 16 sts 0x1684, r1 ; 0x801684 if (enabled) { fsensor.init(); } else { fsensor.deinit(); } } dc4c: cf 91 pop r28 dc4e: 08 95 ret 0000dc50 : #endif #endif //DEBUG_DISABLE_FANCHECK } void resetFanCheck() { fan_measuring = false; dc50: 10 92 84 03 sts 0x0384, r1 ; 0x800384 extruder_autofan_last_check = _millis(); dc54: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 dc58: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d dc5c: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e dc60: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f dc64: 90 93 90 16 sts 0x1690, r25 ; 0x801690 } dc68: 08 95 ret 0000dc6a : 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; dc6a: 80 93 24 03 sts 0x0324, r24 ; 0x800324 newFanSpeed = 0; if (fanState & 0x01) dc6e: 80 fd sbrc r24, 0 dc70: 1c c0 rjmp .+56 ; 0xdcaa { //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; dc72: 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); dc76: 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) dc7a: 8f ef ldi r24, 0xFF ; 255 dc7c: 82 0f add r24, r18 dc7e: 8e 3f cpi r24, 0xFE ; 254 dc80: e8 f0 brcs .+58 ; 0xdcbc { // We use digital logic if the duty cycle is 0% or 100% TCCR4A &= ~_BV(COM4C1); dc82: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> dc86: 87 7f andi r24, 0xF7 ; 247 dc88: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = 0; dc8c: 10 92 ad 00 sts 0x00AD, r1 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> dc90: 10 92 ac 00 sts 0x00AC, r1 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> WRITE(EXTRUDER_0_AUTO_FAN_PIN, duty); dc94: 9f b7 in r25, 0x3f ; 63 dc96: 22 23 and r18, r18 dc98: 61 f0 breq .+24 ; 0xdcb2 dc9a: f8 94 cli dc9c: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> dca0: 80 62 ori r24, 0x20 ; 32 dca2: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> dca6: 9f bf out 0x3f, r25 ; 63 dca8: 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; dcaa: 8f ef ldi r24, 0xFF ; 255 dcac: 80 93 40 03 sts 0x0340, r24 ; 0x800340 dcb0: e2 cf rjmp .-60 ; 0xdc76 dcb2: f8 94 cli dcb4: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> dcb8: 8f 7d andi r24, 0xDF ; 223 dcba: f3 cf rjmp .-26 ; 0xdca2 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; dcbc: ef b7 in r30, 0x3f ; 63 dcbe: f8 94 cli // Enable the PWM output on the fan pin. TCCR4A |= _BV(COM4C1); dcc0: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> dcc4: 88 60 ori r24, 0x08 ; 8 dcc6: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = (((uint16_t)duty) * ((uint16_t)((TIMSK4 & _BV(OCIE4A)) ? OCR4A : 255U))) / 255U; dcca: 30 e0 ldi r19, 0x00 ; 0 dccc: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> dcd0: 4f ef ldi r20, 0xFF ; 255 dcd2: 50 e0 ldi r21, 0x00 ; 0 dcd4: 81 ff sbrs r24, 1 dcd6: 04 c0 rjmp .+8 ; 0xdce0 dcd8: 40 91 a8 00 lds r20, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> dcdc: 50 91 a9 00 lds r21, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> dce0: 24 9f mul r18, r20 dce2: c0 01 movw r24, r0 dce4: 25 9f mul r18, r21 dce6: 90 0d add r25, r0 dce8: 34 9f mul r19, r20 dcea: 90 0d add r25, r0 dcec: 11 24 eor r1, r1 dcee: 6f ef ldi r22, 0xFF ; 255 dcf0: 70 e0 ldi r23, 0x00 ; 0 dcf2: 0f 94 64 a1 call 0x342c8 ; 0x342c8 <__udivmodhi4> dcf6: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> dcfa: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> CRITICAL_SECTION_END; dcfe: ef bf out 0x3f, r30 ; 63 #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); } dd00: 08 95 ret 0000dd02 : } #endif //EXTRUDER_ALTFAN_DETECT void checkExtruderAutoFans() { dd02: 1f 93 push r17 dd04: cf 93 push r28 dd06: df 93 push r29 #if defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1 if (!(fanState & 0x02)) dd08: d0 91 24 03 lds r29, 0x0324 ; 0x800324 dd0c: d1 fd sbrc r29, 1 dd0e: 1d c0 rjmp .+58 ; 0xdd4a temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; dd10: 10 91 9a 03 lds r17, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; dd14: c1 e0 ldi r28, 0x01 ; 1 dd16: 20 e0 ldi r18, 0x00 ; 0 dd18: 30 e0 ldi r19, 0x00 ; 0 dd1a: 48 e4 ldi r20, 0x48 ; 72 dd1c: 52 e4 ldi r21, 0x42 ; 66 dd1e: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 dd22: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 dd26: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 dd2a: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 dd2e: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> dd32: 18 16 cp r1, r24 dd34: 0c f0 brlt .+2 ; 0xdd38 dd36: 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; dd38: de 7f andi r29, 0xFE ; 254 fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; dd3a: cd 2b or r28, r29 dd3c: 81 e0 ldi r24, 0x01 ; 1 dd3e: 11 11 cpse r17, r1 dd40: 01 c0 rjmp .+2 ; 0xdd44 dd42: 80 e0 ldi r24, 0x00 ; 0 fanState |= get_temp_error(); dd44: c8 2b or r28, r24 dd46: c0 93 24 03 sts 0x0324, r28 ; 0x800324 } setExtruderAutoFanState(fanState); dd4a: 80 91 24 03 lds r24, 0x0324 ; 0x800324 #endif } dd4e: df 91 pop r29 dd50: cf 91 pop r28 dd52: 1f 91 pop r17 { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; fanState |= get_temp_error(); } setExtruderAutoFanState(fanState); dd54: 0c 94 35 6e jmp 0xdc6a ; 0xdc6a 0000dd58 : 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) { dd58: ef 92 push r14 dd5a: ff 92 push r15 dd5c: 0f 93 push r16 dd5e: 1f 93 push r17 dd60: cf 93 push r28 dd62: df 93 push r29 dd64: ec 01 movw r28, r24 dd66: 8b 01 movw r16, r22 dd68: 7a 01 movw r14, r20 if (!eeprom_is_initialized_block(__p, __n)) dd6a: 0e 94 10 55 call 0xaa20 ; 0xaa20 dd6e: 81 11 cpse r24, r1 dd70: 0b c0 rjmp .+22 ; 0xdd88 #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); dd72: a8 01 movw r20, r16 dd74: be 01 movw r22, r28 dd76: 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); } dd78: df 91 pop r29 dd7a: cf 91 pop r28 dd7c: 1f 91 pop r17 dd7e: 0f 91 pop r16 dd80: ff 90 pop r15 dd82: 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); dd84: 0d 94 af a0 jmp 0x3415e ; 0x3415e } 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); } dd88: df 91 pop r29 dd8a: cf 91 pop r28 dd8c: 1f 91 pop r17 dd8e: 0f 91 pop r16 dd90: ff 90 pop r15 dd92: ef 90 pop r14 dd94: 08 95 ret 0000dd96 : return def; } return val; } uint16_t __attribute__((noinline)) eeprom_init_default_word(uint16_t *__p, uint16_t def) { dd96: 0f 93 push r16 dd98: 1f 93 push r17 dd9a: cf 93 push r28 dd9c: df 93 push r29 dd9e: 8c 01 movw r16, r24 dda0: d6 2f mov r29, r22 dda2: c7 2f mov r28, r23 uint16_t val = eeprom_read_word(__p); dda4: 0f 94 a9 a0 call 0x34152 ; 0x34152 if (val == EEPROM_EMPTY_VALUE16) { dda8: 8f 3f cpi r24, 0xFF ; 255 ddaa: 98 07 cpc r25, r24 ddac: 39 f4 brne .+14 ; 0xddbc 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); ddae: 6d 2f mov r22, r29 ddb0: 7c 2f mov r23, r28 ddb2: c8 01 movw r24, r16 ddb4: 0f 94 f9 a0 call 0x341f2 ; 0x341f2 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; ddb8: 8d 2f mov r24, r29 ddba: 9c 2f mov r25, r28 } return val; } ddbc: df 91 pop r29 ddbe: cf 91 pop r28 ddc0: 1f 91 pop r17 ddc2: 0f 91 pop r16 ddc4: 08 95 ret 0000ddc6 : 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) { ddc6: 0f 93 push r16 ddc8: 1f 93 push r17 ddca: cf 93 push r28 ddcc: 8c 01 movw r16, r24 ddce: c6 2f mov r28, r22 uint8_t val = eeprom_read_byte(__p); ddd0: 0f 94 9b a0 call 0x34136 ; 0x34136 if (val == EEPROM_EMPTY_VALUE) { ddd4: 8f 3f cpi r24, 0xFF ; 255 ddd6: 29 f4 brne .+10 ; 0xdde2 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); ddd8: 6c 2f mov r22, r28 ddda: c8 01 movw r24, r16 dddc: 0f 94 e3 a0 call 0x341c6 ; 0x341c6 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; dde0: 8c 2f mov r24, r28 } return val; } dde2: cf 91 pop r28 dde4: 1f 91 pop r17 dde6: 0f 91 pop r16 dde8: 08 95 ret 0000ddea : 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) { ddea: cf 93 push r28 ddec: df 93 push r29 ddee: ec 01 movw r28, r24 eeprom_write_word_notify(__p, eeprom_read_word(__p) + 1); ddf0: 0f 94 a9 a0 call 0x34152 ; 0x34152 ddf4: bc 01 movw r22, r24 ddf6: 6f 5f subi r22, 0xFF ; 255 ddf8: 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); ddfa: 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); } ddfc: df 91 pop r29 ddfe: 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); de00: 0d 94 f9 a0 jmp 0x341f2 ; 0x341f2 0000de04 : void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) { de04: cf 93 push r28 de06: df 93 push r29 de08: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, eeprom_read_byte(__p) + 1); de0a: 0f 94 9b a0 call 0x34136 ; 0x34136 de0e: 61 e0 ldi r22, 0x01 ; 1 de10: 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); de12: 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); } de14: df 91 pop r29 de16: 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); de18: 0d 94 e3 a0 jmp 0x341c6 ; 0x341c6 0000de1c : 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); de1c: 2b e0 ldi r18, 0x0B ; 11 de1e: 82 9f mul r24, r18 de20: c0 01 movw r24, r0 de22: 11 24 eor r1, r1 de24: 80 5b subi r24, 0xB0 ; 176 de26: 92 4f sbci r25, 0xF2 ; 242 de28: 0f 94 a9 a0 call 0x34152 ; 0x34152 de2c: 21 e0 ldi r18, 0x01 ; 1 de2e: 01 96 adiw r24, 0x01 ; 1 de30: 09 f4 brne .+2 ; 0xde34 de32: 20 e0 ldi r18, 0x00 ; 0 } de34: 82 2f mov r24, r18 de36: 08 95 ret 0000de38 : //! //! @param sheet Current sheet //! @return next initialized sheet //! @retval -1 no sheet is initialized int8_t eeprom_next_initialized_sheet(int8_t sheet) { de38: cf 93 push r28 de3a: df 93 push r29 de3c: c8 2f mov r28, r24 de3e: d8 e0 ldi r29, 0x08 ; 8 for (int8_t i = 0; i < static_cast(sizeof(Sheets::s)/sizeof(Sheet)); ++i) { ++sheet; de40: cf 5f subi r28, 0xFF ; 255 if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; de42: c8 30 cpi r28, 0x08 ; 8 de44: 0c f0 brlt .+2 ; 0xde48 de46: c0 e0 ldi r28, 0x00 ; 0 if (eeprom_is_sheet_initialized(sheet)) return sheet; de48: 8c 2f mov r24, r28 de4a: 0e 94 0e 6f call 0xde1c ; 0xde1c de4e: 81 11 cpse r24, r1 de50: 03 c0 rjmp .+6 ; 0xde58 de52: 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) de54: a9 f7 brne .-22 ; 0xde40 { ++sheet; if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; if (eeprom_is_sheet_initialized(sheet)) return sheet; } return -1; de56: cf ef ldi r28, 0xFF ; 255 } de58: 8c 2f mov r24, r28 de5a: df 91 pop r29 de5c: cf 91 pop r28 de5e: 08 95 ret 0000de60 : #endif //DEBUG_EEPROM_CHANGES } void eeprom_switch_to_next_sheet() { int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); de60: 81 ea ldi r24, 0xA1 ; 161 de62: 9d e0 ldi r25, 0x0D ; 13 de64: 0f 94 9b a0 call 0x34136 ; 0x34136 sheet = eeprom_next_initialized_sheet(sheet); de68: 0e 94 1c 6f call 0xde38 ; 0xde38 if (sheet >= 0) eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), sheet); de6c: 87 fd sbrc r24, 7 de6e: 05 c0 rjmp .+10 ; 0xde7a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); de70: 68 2f mov r22, r24 de72: 81 ea ldi r24, 0xA1 ; 161 de74: 9d e0 ldi r25, 0x0D ; 13 de76: 0d 94 bf a0 jmp 0x3417e ; 0x3417e { 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); } de7a: 08 95 ret 0000de7c : //! | 7 | Custom2 | //! //! @param[in] index //! @param[out] sheetName void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName) { de7c: 0f 93 push r16 de7e: 1f 93 push r17 de80: cf 93 push r28 de82: c8 2f mov r28, r24 de84: 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")); de86: 66 e0 ldi r22, 0x06 ; 6 de88: 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) de8a: 82 30 cpi r24, 0x02 ; 2 de8c: 70 f0 brcs .+28 ; 0xdeaa { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); de8e: 6f ef ldi r22, 0xFF ; 255 de90: 73 e7 ldi r23, 0x73 ; 115 if (index < 2) { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) de92: 84 30 cpi r24, 0x04 ; 4 de94: 50 f0 brcs .+20 ; 0xdeaa { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); de96: 67 ef ldi r22, 0xF7 ; 247 de98: 73 e7 ldi r23, 0x73 ; 115 } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) de9a: 84 30 cpi r24, 0x04 ; 4 de9c: 31 f0 breq .+12 ; 0xdeaa { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) { strcpy_P(sheetName.c, PSTR("NylonPA")); de9e: 6f ee ldi r22, 0xEF ; 239 dea0: 73 e7 ldi r23, 0x73 ; 115 } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) dea2: 85 30 cpi r24, 0x05 ; 5 dea4: 11 f0 breq .+4 ; 0xdeaa { strcpy_P(sheetName.c, PSTR("NylonPA")); } else { strcpy_P(sheetName.c, PSTR("Custom")); dea6: 68 ee ldi r22, 0xE8 ; 232 dea8: 73 e7 ldi r23, 0x73 ; 115 deaa: c8 01 movw r24, r16 deac: 0f 94 52 9e call 0x33ca4 ; 0x33ca4 } if (index <4 || index >5) deb0: 8c ef ldi r24, 0xFC ; 252 deb2: 8c 0f add r24, r28 deb4: 82 30 cpi r24, 0x02 ; 2 deb6: 28 f0 brcs .+10 ; 0xdec2 { sheetName.c[6] = '0' + ((index % 2)+1); deb8: c1 70 andi r28, 0x01 ; 1 deba: cf 5c subi r28, 0xCF ; 207 debc: f8 01 movw r30, r16 debe: c6 83 std Z+6, r28 ; 0x06 sheetName.c[7] = '\0'; dec0: 17 82 std Z+7, r1 ; 0x07 } } dec2: cf 91 pop r28 dec4: 1f 91 pop r17 dec6: 0f 91 pop r16 dec8: 08 95 ret 0000deca : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); deca: 61 e0 ldi r22, 0x01 ; 1 decc: 80 ec ldi r24, 0xC0 ; 192 dece: 9f e0 ldi r25, 0x0F ; 15 ded0: 0f 94 bf a0 call 0x3417e ; 0x3417e ded4: 60 e0 ldi r22, 0x00 ; 0 ded6: 8f eb ldi r24, 0xBF ; 191 ded8: 9f e0 ldi r25, 0x0F ; 15 deda: 0f 94 bf a0 call 0x3417e ; 0x3417e dede: 60 e0 ldi r22, 0x00 ; 0 dee0: 8e eb ldi r24, 0xBE ; 190 dee2: 9f e0 ldi r25, 0x0F ; 15 dee4: 0f 94 bf a0 call 0x3417e ; 0x3417e dee8: 60 e0 ldi r22, 0x00 ; 0 deea: 8d eb ldi r24, 0xBD ; 189 deec: 9f e0 ldi r25, 0x0F ; 15 deee: 0f 94 bf a0 call 0x3417e ; 0x3417e def2: 60 e0 ldi r22, 0x00 ; 0 def4: 8c eb ldi r24, 0xBC ; 188 def6: 9f e0 ldi r25, 0x0F ; 15 def8: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 0000defc : { putchar((val > 9)?(val - 10 + 'a'):(val + '0')); } void print_hex_byte(uint8_t val) { defc: cf 93 push r28 defe: c8 2f mov r28, r24 print_hex_nibble(val >> 4); df00: 82 95 swap r24 df02: 8f 70 andi r24, 0x0F ; 15 df04: 0e 94 c6 5c call 0xb98c ; 0xb98c print_hex_nibble(val & 15); df08: 8c 2f mov r24, r28 df0a: 8f 70 andi r24, 0x0F ; 15 } df0c: cf 91 pop r28 } void print_hex_byte(uint8_t val) { print_hex_nibble(val >> 4); print_hex_nibble(val & 15); df0e: 0c 94 c6 5c jmp 0xb98c ; 0xb98c 0000df12 : #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) df12: 40 91 cf 11 lds r20, 0x11CF ; 0x8011cf df16: 50 91 d0 11 lds r21, 0x11D0 ; 0x8011d0 return 0; df1a: 90 e0 ldi r25, 0x00 ; 0 df1c: 80 e0 ldi r24, 0x00 ; 0 #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) df1e: 41 15 cp r20, r1 df20: 51 05 cpc r21, r1 df22: b1 f1 breq .+108 ; 0xdf90 char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; for (size_t _buflen = buflen, _bufindr = bufindr;;) { df24: 20 91 cb 11 lds r18, 0x11CB ; 0x8011cb df28: 30 91 cc 11 lds r19, 0x11CC ; 0x8011cc char lo; char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; df2c: 90 e0 ldi r25, 0x00 ; 0 df2e: 80 e0 ldi r24, 0x00 ; 0 for (size_t _buflen = buflen, _bufindr = bufindr;;) { if (cmdbuffer[_bufindr] == CMDBUFFER_CURRENT_TYPE_SDCARD) { df30: f9 01 movw r30, r18 df32: e2 52 subi r30, 0x22 ; 34 df34: f0 4f sbci r31, 0xF0 ; 240 df36: a0 81 ld r26, Z df38: a2 30 cpi r26, 0x02 ; 2 df3a: 21 f4 brne .+8 ; 0xdf44 sdlen_single.lohi.lo = cmdbuffer[_bufindr + 1]; df3c: 61 81 ldd r22, Z+1 ; 0x01 sdlen_single.lohi.hi = cmdbuffer[_bufindr + 2]; df3e: 72 81 ldd r23, Z+2 ; 0x02 sdlen += sdlen_single.value; df40: 86 0f add r24, r22 df42: 97 1f adc r25, r23 } if (-- _buflen == 0) df44: 41 50 subi r20, 0x01 ; 1 df46: 51 09 sbc r21, r1 df48: 19 f1 breq .+70 ; 0xdf90 df4a: f9 01 movw r30, r18 df4c: ef 51 subi r30, 0x1F ; 31 df4e: 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) ; df50: a1 91 ld r26, Z+ df52: 9f 01 movw r18, r30 df54: 2e 5d subi r18, 0xDE ; 222 df56: 3f 40 sbci r19, 0x0F ; 15 df58: a1 11 cpse r26, r1 df5a: fa cf rjmp .-12 ; 0xdf50 df5c: f9 01 movw r30, r18 df5e: e2 52 subi r30, 0x22 ; 34 df60: 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) ; df62: 2d 3e cpi r18, 0xED ; 237 df64: a1 e0 ldi r26, 0x01 ; 1 df66: 3a 07 cpc r19, r26 df68: 30 f4 brcc .+12 ; 0xdf76 df6a: a1 91 ld r26, Z+ df6c: a1 11 cpse r26, r1 df6e: e0 cf rjmp .-64 ; 0xdf30 df70: 2f 5f subi r18, 0xFF ; 255 df72: 3f 4f sbci r19, 0xFF ; 255 df74: f6 cf rjmp .-20 ; 0xdf62 // If the end of the buffer was empty, if (_bufindr == sizeof(cmdbuffer)) { df76: 2d 3e cpi r18, 0xED ; 237 df78: e1 e0 ldi r30, 0x01 ; 1 df7a: 3e 07 cpc r19, r30 df7c: c9 f6 brne .-78 ; 0xdf30 df7e: ee ed ldi r30, 0xDE ; 222 df80: ff e0 ldi r31, 0x0F ; 15 df82: 9f 01 movw r18, r30 df84: 2e 5d subi r18, 0xDE ; 222 df86: 3f 40 sbci r19, 0x0F ; 15 // skip to the start and find the nonzero command. for (_bufindr = 0; cmdbuffer[_bufindr] == 0; ++ _bufindr) ; df88: a1 91 ld r26, Z+ df8a: aa 23 and r26, r26 df8c: d1 f3 breq .-12 ; 0xdf82 df8e: d0 cf rjmp .-96 ; 0xdf30 } } return sdlen; } df90: 08 95 ret 0000df92 : // 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) { df92: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf df96: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 df9a: 18 16 cp r1, r24 df9c: 19 06 cpc r1, r25 df9e: 0c f0 brlt .+2 ; 0xdfa2 dfa0: 43 c0 rjmp .+134 ; 0xe028 SERIAL_ECHO(serial_count); SERIAL_ECHOPGM(", bufsize "); SERIAL_ECHO(sizeof(cmdbuffer)); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ if (-- buflen == 0) { dfa2: 01 97 sbiw r24, 0x01 ; 1 dfa4: 90 93 d0 11 sts 0x11D0, r25 ; 0x8011d0 dfa8: 80 93 cf 11 sts 0x11CF, r24 ; 0x8011cf dfac: 89 2b or r24, r25 dfae: a1 f4 brne .+40 ; 0xdfd8 // Empty buffer. if (serial_count == 0) dfb0: 80 91 da 0f lds r24, 0x0FDA ; 0x800fda dfb4: 90 91 db 0f lds r25, 0x0FDB ; 0x800fdb dfb8: 89 2b or r24, r25 dfba: 21 f4 brne .+8 ; 0xdfc4 // No serial communication is pending. Reset both pointers to zero. bufindw = 0; dfbc: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> dfc0: 10 92 dc 0f sts 0x0FDC, r1 ; 0x800fdc <_ZL7bufindw.lto_priv.516> bufindr = bufindw; dfc4: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> dfc8: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> dfcc: 90 93 cc 11 sts 0x11CC, r25 ; 0x8011cc dfd0: 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; dfd4: 81 e0 ldi r24, 0x01 ; 1 dfd6: 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) ; dfd8: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb dfdc: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc dfe0: 03 96 adiw r24, 0x03 ; 3 dfe2: fc 01 movw r30, r24 dfe4: e2 52 subi r30, 0x22 ; 34 dfe6: f0 4f sbci r31, 0xF0 ; 240 dfe8: 20 81 ld r18, Z dfea: 01 96 adiw r24, 0x01 ; 1 dfec: 21 11 cpse r18, r1 dfee: f9 cf rjmp .-14 ; 0xdfe2 dff0: fc 01 movw r30, r24 dff2: e2 52 subi r30, 0x22 ; 34 dff4: 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) ; dff6: 8d 3e cpi r24, 0xED ; 237 dff8: 21 e0 ldi r18, 0x01 ; 1 dffa: 92 07 cpc r25, r18 dffc: 40 f4 brcc .+16 ; 0xe00e dffe: 41 91 ld r20, Z+ e000: 9c 01 movw r18, r24 e002: 2f 5f subi r18, 0xFF ; 255 e004: 3f 4f sbci r19, 0xFF ; 255 e006: 41 11 cpse r20, r1 e008: e1 cf rjmp .-62 ; 0xdfcc e00a: c9 01 movw r24, r18 e00c: f4 cf rjmp .-24 ; 0xdff6 // If the end of the buffer was empty, if (bufindr == sizeof(cmdbuffer)) { e00e: ee ed ldi r30, 0xDE ; 222 e010: ff e0 ldi r31, 0x0F ; 15 e012: 8d 3e cpi r24, 0xED ; 237 e014: 21 e0 ldi r18, 0x01 ; 1 e016: 92 07 cpc r25, r18 e018: c9 f6 brne .-78 ; 0xdfcc e01a: cf 01 movw r24, r30 e01c: 8e 5d subi r24, 0xDE ; 222 e01e: 9f 40 sbci r25, 0x0F ; 15 // skip to the start and find the nonzero command. for (bufindr = 0; cmdbuffer[bufindr] == 0; ++ bufindr) ; e020: 21 91 ld r18, Z+ e022: 22 23 and r18, r18 e024: d1 f3 breq .-12 ; 0xe01a e026: d2 cf rjmp .-92 ; 0xdfcc SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; } return false; e028: 80 e0 ldi r24, 0x00 ; 0 } e02a: 08 95 ret 0000e02c : autostart_atmillis.start(); // reset timer } char *createFilename(char *buffer,const dir_t &p) //buffer>12characters { char *pos=buffer; e02c: fc 01 movw r30, r24 for (uint8_t i = 0; i < 11; i++) e02e: 20 e0 ldi r18, 0x00 ; 0 { if (p.name[i] == ' ')continue; if (i == 8) { *pos++='.'; e030: 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; e032: db 01 movw r26, r22 e034: 4d 91 ld r20, X+ e036: bd 01 movw r22, r26 e038: 40 32 cpi r20, 0x20 ; 32 e03a: 49 f0 breq .+18 ; 0xe04e if (i == 8) e03c: 28 30 cpi r18, 0x08 ; 8 e03e: 11 f4 brne .+4 ; 0xe044 { *pos++='.'; e040: 30 83 st Z, r19 e042: 31 96 adiw r30, 0x01 ; 1 } *pos++=p.name[i]; e044: db 01 movw r26, r22 e046: 11 97 sbiw r26, 0x01 ; 1 e048: 4c 91 ld r20, X e04a: 40 83 st Z, r20 e04c: 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++) e04e: 2f 5f subi r18, 0xFF ; 255 e050: 2b 30 cpi r18, 0x0B ; 11 e052: 79 f7 brne .-34 ; 0xe032 { *pos++='.'; } *pos++=p.name[i]; } *pos++=0; e054: 10 82 st Z, r1 return buffer; } e056: 08 95 ret 0000e058 : 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);} e058: 40 e0 ldi r20, 0x00 ; 0 e05a: 50 e0 ldi r21, 0x00 ; 0 e05c: ba 01 movw r22, r20 e05e: 0d 94 f7 39 jmp 0x273ee ; 0x273ee 0000e062 : 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();} e062: fc 01 movw r30, r24 e064: 23 81 ldd r18, Z+3 ; 0x03 e066: 21 11 cpse r18, r1 e068: 0d 94 51 6f jmp 0x2dea2 ; 0x2dea2 e06c: 08 95 ret 0000e06e : M_UDRx = c; } */ static void write(uint8_t c) { if (selectedSerialPort == 0) e06e: 90 91 04 05 lds r25, 0x0504 ; 0x800504 e072: 91 11 cpse r25, r1 e074: 07 c0 rjmp .+14 ; 0xe084 { while (!((M_UCSRxA) & (1 << M_UDREx))); e076: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> e07a: 95 ff sbrs r25, 5 e07c: fc cf rjmp .-8 ; 0xe076 M_UDRx = c; e07e: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> e082: 08 95 ret } else if (selectedSerialPort == 1) e084: 91 30 cpi r25, 0x01 ; 1 e086: 31 f4 brne .+12 ; 0xe094 { while (!((UCSR1A) & (1 << UDRE1))); e088: 90 91 c8 00 lds r25, 0x00C8 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> e08c: 95 ff sbrs r25, 5 e08e: fc cf rjmp .-8 ; 0xe088 UDR1 = c; e090: 80 93 ce 00 sts 0x00CE, r24 ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> } } e094: 08 95 ret 0000e096 : static FILE _uartout; #define uartout (&_uartout) int uart_putchar(char c, FILE *) { MYSERIAL.write(c); e096: 0e 94 37 70 call 0xe06e ; 0xe06e return 0; } e09a: 90 e0 ldi r25, 0x00 ; 0 e09c: 80 e0 ldi r24, 0x00 ; 0 e09e: 08 95 ret 0000e0a0 : 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) { e0a0: cf 93 push r28 e0a2: df 93 push r29 e0a4: ec 01 movw r28, r24 while(uint8_t ch = pgm_read_byte(str)) { e0a6: fe 01 movw r30, r28 e0a8: 84 91 lpm r24, Z e0aa: 88 23 and r24, r24 e0ac: 21 f0 breq .+8 ; 0xe0b6 MYSERIAL.write((char)ch); e0ae: 0e 94 37 70 call 0xe06e ; 0xe06e ++str; e0b2: 21 96 adiw r28, 0x01 ; 1 e0b4: f8 cf rjmp .-16 ; 0xe0a6 } } e0b6: df 91 pop r29 e0b8: cf 91 pop r28 e0ba: 08 95 ret 0000e0bc : // Turn off the print fan fanSpeed = 0; } } void serialecho_temperatures() { e0bc: cf 92 push r12 e0be: df 92 push r13 e0c0: ef 92 push r14 e0c2: 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]; e0c4: c0 90 c4 0d lds r12, 0x0DC4 ; 0x800dc4 e0c8: d0 90 c5 0d lds r13, 0x0DC5 ; 0x800dc5 e0cc: e0 90 c6 0d lds r14, 0x0DC6 ; 0x800dc6 e0d0: f0 90 c7 0d lds r15, 0x0DC7 ; 0x800dc7 float tt = degHotend(active_extruder); SERIAL_PROTOCOLPGM("T:"); e0d4: 89 e5 ldi r24, 0x59 ; 89 e0d6: 98 e7 ldi r25, 0x78 ; 120 e0d8: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); e0dc: 42 e0 ldi r20, 0x02 ; 2 e0de: c7 01 movw r24, r14 e0e0: b6 01 movw r22, r12 e0e2: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOL(tt); SERIAL_PROTOCOLPGM(" E:0 B:"); e0e6: 81 e5 ldi r24, 0x51 ; 81 e0e8: 98 e7 ldi r25, 0x78 ; 120 e0ea: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 e0ee: 60 91 8a 03 lds r22, 0x038A ; 0x80038a e0f2: 70 91 8b 03 lds r23, 0x038B ; 0x80038b e0f6: 80 91 8c 03 lds r24, 0x038C ; 0x80038c e0fa: 90 91 8d 03 lds r25, 0x038D ; 0x80038d e0fe: 41 e0 ldi r20, 0x01 ; 1 e100: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } e104: ff 90 pop r15 e106: ef 90 pop r14 e108: df 90 pop r13 e10a: 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(); e10c: 0d 94 bb 98 jmp 0x33176 ; 0x33176 0000e110 : } } /// @brief Helper function to reduce code size in M861 /// by extracting common code into one function static void gcode_M861_print_pinda_cal_eeprom() { e110: 4f 92 push r4 e112: 5f 92 push r5 e114: 6f 92 push r6 e116: 7f 92 push r7 e118: 8f 92 push r8 e11a: 9f 92 push r9 e11c: af 92 push r10 e11e: bf 92 push r11 e120: cf 92 push r12 e122: df 92 push r13 e124: ef 92 push r14 e126: ff 92 push r15 e128: 0f 93 push r16 e12a: 1f 93 push r17 e12c: cf 93 push r28 e12e: df 93 push r29 e130: cc 24 eor r12, r12 e132: ca 94 dec r12 e134: dc 2c mov r13, r12 e136: 76 01 movw r14, r12 e138: 0e ea ldi r16, 0xAE ; 174 e13a: 1f e0 ldi r17, 0x0F ; 15 e13c: 93 e2 ldi r25, 0x23 ; 35 e13e: 89 2e mov r8, r25 e140: 91 2c mov r9, r1 e142: a1 2c mov r10, r1 e144: b1 2c mov r11, r1 int16_t usteps = 0; float mm = 0; e146: 41 2c mov r4, r1 e148: 51 2c mov r5, r1 e14a: 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; e14c: d0 e0 ldi r29, 0x00 ; 0 e14e: 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) { e150: 8f ef ldi r24, 0xFF ; 255 e152: c8 16 cp r12, r24 e154: 09 f4 brne .+2 ; 0xe158 e156: 5d c0 rjmp .+186 ; 0xe212 usteps = eeprom_read_word((uint16_t*) EEPROM_PROBE_TEMP_SHIFT + (i - 1)); e158: c8 01 movw r24, r16 e15a: 0f 94 a9 a0 call 0x34152 ; 0x34152 e15e: ec 01 movw r28, r24 mm = ((float)usteps) / cs.axis_steps_per_mm[Z_AXIS]; e160: bc 01 movw r22, r24 e162: 99 0f add r25, r25 e164: 88 0b sbc r24, r24 e166: 99 0b sbc r25, r25 e168: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> e16c: 20 91 3e 04 lds r18, 0x043E ; 0x80043e e170: 30 91 3f 04 lds r19, 0x043F ; 0x80043f e174: 40 91 40 04 lds r20, 0x0440 ; 0x800440 e178: 50 91 41 04 lds r21, 0x0441 ; 0x800441 e17c: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> e180: 2b 01 movw r4, r22 e182: 3c 01 movw r6, r24 e184: c7 01 movw r24, r14 e186: b6 01 movw r22, r12 e188: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_PROTOCOL(i - 1); } else { SERIAL_PROTOCOLRPGM(MSG_NA); } SERIAL_PROTOCOLRPGM(comma_sep); e18c: 8d ea ldi r24, 0xAD ; 173 e18e: 97 e7 ldi r25, 0x77 ; 119 e190: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 e194: c5 01 movw r24, r10 e196: b4 01 movw r22, r8 e198: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_PROTOCOL(35 + (i * 5)); SERIAL_PROTOCOLRPGM(comma_sep); e19c: 8d ea ldi r24, 0xAD ; 173 e19e: 97 e7 ldi r25, 0x77 ; 119 e1a0: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); e1a4: be 01 movw r22, r28 e1a6: 0d 2e mov r0, r29 e1a8: 00 0c add r0, r0 e1aa: 88 0b sbc r24, r24 e1ac: 99 0b sbc r25, r25 e1ae: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); e1b2: 8d ea ldi r24, 0xAD ; 173 e1b4: 97 e7 ldi r25, 0x77 ; 119 e1b6: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_PROTOCOLLN(mm * 1000); e1ba: 20 e0 ldi r18, 0x00 ; 0 e1bc: 30 e0 ldi r19, 0x00 ; 0 e1be: 4a e7 ldi r20, 0x7A ; 122 e1c0: 54 e4 ldi r21, 0x44 ; 68 e1c2: c3 01 movw r24, r6 e1c4: b2 01 movw r22, r4 e1c6: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> e1ca: 0f 94 45 42 call 0x2848a ; 0x2848a e1ce: 85 e0 ldi r24, 0x05 ; 5 e1d0: 88 0e add r8, r24 e1d2: 91 1c adc r9, r1 e1d4: a1 1c adc r10, r1 e1d6: b1 1c adc r11, r1 e1d8: 0e 5f subi r16, 0xFE ; 254 e1da: 1f 4f sbci r17, 0xFF ; 255 e1dc: 8f ef ldi r24, 0xFF ; 255 e1de: c8 1a sub r12, r24 e1e0: d8 0a sbc r13, r24 e1e2: e8 0a sbc r14, r24 e1e4: 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++) { e1e6: 0a 3b cpi r16, 0xBA ; 186 e1e8: 8f e0 ldi r24, 0x0F ; 15 e1ea: 18 07 cpc r17, r24 e1ec: 09 f0 breq .+2 ; 0xe1f0 e1ee: b0 cf rjmp .-160 ; 0xe150 SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOLLN(mm * 1000); } } e1f0: df 91 pop r29 e1f2: cf 91 pop r28 e1f4: 1f 91 pop r17 e1f6: 0f 91 pop r16 e1f8: ff 90 pop r15 e1fa: ef 90 pop r14 e1fc: df 90 pop r13 e1fe: cf 90 pop r12 e200: bf 90 pop r11 e202: af 90 pop r10 e204: 9f 90 pop r9 e206: 8f 90 pop r8 e208: 7f 90 pop r7 e20a: 6f 90 pop r6 e20c: 5f 90 pop r5 e20e: 4f 90 pop r4 e210: 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); e212: 8c e8 ldi r24, 0x8C ; 140 e214: 9d e3 ldi r25, 0x3D ; 61 e216: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 e21a: b8 cf rjmp .-144 ; 0xe18c 0000e21c : /// @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) { e21c: 88 23 and r24, r24 e21e: 71 f1 breq .+92 ; 0xe27c currentMMUSlot = slot; } uint8_t SpoolJoin::nextSlot() { SERIAL_ECHOPGM("SpoolJoin: "); e220: 81 ea ldi r24, 0xA1 ; 161 e222: 97 e7 ldi r25, 0x77 ; 119 e224: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 e228: 60 91 23 12 lds r22, 0x1223 ; 0x801223 e22c: 70 e0 ldi r23, 0x00 ; 0 e22e: 90 e0 ldi r25, 0x00 ; 0 e230: 80 e0 ldi r24, 0x00 ; 0 e232: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= MMU_FILAMENT_COUNT-1) currentMMUSlot = 0; e236: 80 91 23 12 lds r24, 0x1223 ; 0x801223 e23a: 84 30 cpi r24, 0x04 ; 4 e23c: d8 f0 brcs .+54 ; 0xe274 e23e: 10 92 23 12 sts 0x1223, r1 ; 0x801223 else currentMMUSlot++; SERIAL_ECHOPGM(" -> "); e242: 8c e9 ldi r24, 0x9C ; 156 e244: 97 e7 ldi r25, 0x77 ; 119 e246: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLN((int)currentMMUSlot); e24a: 80 91 23 12 lds r24, 0x1223 ; 0x801223 e24e: 90 e0 ldi r25, 0x00 ; 0 e250: 0f 94 62 42 call 0x284c4 ; 0x284c4 return currentMMUSlot; e254: 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; e258: 20 91 ef 11 lds r18, 0x11EF ; 0x8011ef e25c: 30 91 f0 11 lds r19, 0x11F0 ; 0x8011f0 e260: 30 93 f2 11 sts 0x11F2, r19 ; 0x8011f2 e264: 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); e268: 0e 94 33 f7 call 0x1ee66 ; 0x1ee66 load_filament_final_feed(); // @@TODO verify e26c: 0e 94 6b 5e call 0xbcd6 ; 0xbcd6 st_synchronize(); e270: 0d 94 ce 22 jmp 0x2459c ; 0x2459c { SERIAL_ECHOPGM("SpoolJoin: "); SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= MMU_FILAMENT_COUNT-1) currentMMUSlot = 0; else currentMMUSlot++; e274: 8f 5f subi r24, 0xFF ; 255 e276: 80 93 23 12 sts 0x1223, r24 ; 0x801223 e27a: e3 cf rjmp .-58 ; 0xe242 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); e27c: 84 e2 ldi r24, 0x24 ; 36 e27e: 9e e3 ldi r25, 0x3E ; 62 e280: 0e 94 a7 6c call 0xd94e ; 0xd94e e284: 70 e0 ldi r23, 0x00 ; 0 e286: 60 e0 ldi r22, 0x00 ; 0 e288: 0e 94 e7 bc call 0x179ce ; 0x179ce e28c: e5 cf rjmp .-54 ; 0xe258 0000e28e : return final_result; } void gcode_M114() { e28e: cf 93 push r28 e290: df 93 push r29 SERIAL_PROTOCOLPGM("X:"); e292: 89 e9 ldi r24, 0x99 ; 153 e294: 97 e7 ldi r25, 0x77 ; 119 e296: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_PROTOCOL(current_position[X_AXIS]); e29a: c5 ef ldi r28, 0xF5 ; 245 e29c: d1 e1 ldi r29, 0x11 ; 17 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); e29e: 68 81 ld r22, Y e2a0: 79 81 ldd r23, Y+1 ; 0x01 e2a2: 8a 81 ldd r24, Y+2 ; 0x02 e2a4: 9b 81 ldd r25, Y+3 ; 0x03 e2a6: 42 e0 ldi r20, 0x02 ; 2 e2a8: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOLPGM(" Y:"); e2ac: 85 e9 ldi r24, 0x95 ; 149 e2ae: 97 e7 ldi r25, 0x77 ; 119 e2b0: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 e2b4: 6c 81 ldd r22, Y+4 ; 0x04 e2b6: 7d 81 ldd r23, Y+5 ; 0x05 e2b8: 8e 81 ldd r24, Y+6 ; 0x06 e2ba: 9f 81 ldd r25, Y+7 ; 0x07 e2bc: 42 e0 ldi r20, 0x02 ; 2 e2be: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOL(current_position[Y_AXIS]); SERIAL_PROTOCOLPGM(" Z:"); e2c2: 81 e9 ldi r24, 0x91 ; 145 e2c4: 97 e7 ldi r25, 0x77 ; 119 e2c6: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 e2ca: 68 85 ldd r22, Y+8 ; 0x08 e2cc: 79 85 ldd r23, Y+9 ; 0x09 e2ce: 8a 85 ldd r24, Y+10 ; 0x0a e2d0: 9b 85 ldd r25, Y+11 ; 0x0b e2d2: 42 e0 ldi r20, 0x02 ; 2 e2d4: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOL(current_position[Z_AXIS]); SERIAL_PROTOCOLPGM(" E:"); e2d8: 8d e8 ldi r24, 0x8D ; 141 e2da: 97 e7 ldi r25, 0x77 ; 119 e2dc: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 e2e0: 6c 85 ldd r22, Y+12 ; 0x0c e2e2: 7d 85 ldd r23, Y+13 ; 0x0d e2e4: 8e 85 ldd r24, Y+14 ; 0x0e e2e6: 9f 85 ldd r25, Y+15 ; 0x0f e2e8: 42 e0 ldi r20, 0x02 ; 2 e2ea: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOL(current_position[E_AXIS]); SERIAL_PROTOCOLRPGM(_n(" Count X: "));////MSG_COUNT_X e2ee: 89 e0 ldi r24, 0x09 ; 9 e2f0: 94 e6 ldi r25, 0x64 ; 100 e2f2: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_PROTOCOL(float(st_get_position(X_AXIS)) / cs.axis_steps_per_mm[X_AXIS]); e2f6: 80 e0 ldi r24, 0x00 ; 0 e2f8: 0f 94 ac 22 call 0x24558 ; 0x24558 e2fc: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> e300: c2 e3 ldi r28, 0x32 ; 50 e302: d4 e0 ldi r29, 0x04 ; 4 e304: 2c 81 ldd r18, Y+4 ; 0x04 e306: 3d 81 ldd r19, Y+5 ; 0x05 e308: 4e 81 ldd r20, Y+6 ; 0x06 e30a: 5f 81 ldd r21, Y+7 ; 0x07 e30c: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> e310: 42 e0 ldi r20, 0x02 ; 2 e312: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOLPGM(" Y:"); e316: 89 e8 ldi r24, 0x89 ; 137 e318: 97 e7 ldi r25, 0x77 ; 119 e31a: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_PROTOCOL(float(st_get_position(Y_AXIS)) / cs.axis_steps_per_mm[Y_AXIS]); e31e: 81 e0 ldi r24, 0x01 ; 1 e320: 0f 94 ac 22 call 0x24558 ; 0x24558 e324: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> e328: 28 85 ldd r18, Y+8 ; 0x08 e32a: 39 85 ldd r19, Y+9 ; 0x09 e32c: 4a 85 ldd r20, Y+10 ; 0x0a e32e: 5b 85 ldd r21, Y+11 ; 0x0b e330: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> e334: 42 e0 ldi r20, 0x02 ; 2 e336: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOLPGM(" Z:"); e33a: 85 e8 ldi r24, 0x85 ; 133 e33c: 97 e7 ldi r25, 0x77 ; 119 e33e: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_PROTOCOL(float(st_get_position(Z_AXIS)) / cs.axis_steps_per_mm[Z_AXIS]); e342: 82 e0 ldi r24, 0x02 ; 2 e344: 0f 94 ac 22 call 0x24558 ; 0x24558 e348: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> e34c: 2c 85 ldd r18, Y+12 ; 0x0c e34e: 3d 85 ldd r19, Y+13 ; 0x0d e350: 4e 85 ldd r20, Y+14 ; 0x0e e352: 5f 85 ldd r21, Y+15 ; 0x0f e354: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> e358: 42 e0 ldi r20, 0x02 ; 2 e35a: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOLPGM(" E:"); e35e: 81 e8 ldi r24, 0x81 ; 129 e360: 97 e7 ldi r25, 0x77 ; 119 e362: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_PROTOCOLLN(float(st_get_position(E_AXIS)) / cs.axis_steps_per_mm[E_AXIS]); e366: 83 e0 ldi r24, 0x03 ; 3 e368: 0f 94 ac 22 call 0x24558 ; 0x24558 e36c: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> e370: 28 89 ldd r18, Y+16 ; 0x10 e372: 39 89 ldd r19, Y+17 ; 0x11 e374: 4a 89 ldd r20, Y+18 ; 0x12 e376: 5b 89 ldd r21, Y+19 ; 0x13 e378: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> } e37c: df 91 pop r29 e37e: 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]); e380: 0d 94 45 42 jmp 0x2848a ; 0x2848a 0000e384 : #endif //TMC2130 void gcode_M105() { #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1 SERIAL_PROTOCOLPGM("T:"); e384: 80 e9 ldi r24, 0x90 ; 144 e386: 96 e7 ldi r25, 0x76 ; 118 e388: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 e38c: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 e390: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 e394: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 e398: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 e39c: 41 e0 ldi r20, 0x01 ; 1 e39e: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); e3a2: 8d e8 ldi r24, 0x8D ; 141 e3a4: 96 e7 ldi r25, 0x76 ; 118 e3a6: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; e3aa: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 e3ae: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 e3b2: 07 2e mov r0, r23 e3b4: 00 0c add r0, r0 e3b6: 88 0b sbc r24, r24 e3b8: 99 0b sbc r25, r25 e3ba: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> e3be: 41 e0 ldi r20, 0x01 ; 1 e3c0: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOL_F(degTargetHotend(active_extruder),1); #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 SERIAL_PROTOCOLPGM(" B:"); e3c4: 89 e8 ldi r24, 0x89 ; 137 e3c6: 96 e7 ldi r25, 0x76 ; 118 e3c8: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 e3cc: 60 91 8a 03 lds r22, 0x038A ; 0x80038a e3d0: 70 91 8b 03 lds r23, 0x038B ; 0x80038b e3d4: 80 91 8c 03 lds r24, 0x038C ; 0x80038c e3d8: 90 91 8d 03 lds r25, 0x038D ; 0x80038d e3dc: 41 e0 ldi r20, 0x01 ; 1 e3de: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOL_F(degBed(),1); SERIAL_PROTOCOLPGM(" /"); e3e2: 86 e8 ldi r24, 0x86 ; 134 e3e4: 96 e7 ldi r25, 0x76 ; 118 e3e6: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; e3ea: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed e3ee: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee e3f2: 07 2e mov r0, r23 e3f4: 00 0c add r0, r0 e3f6: 88 0b sbc r24, r24 e3f8: 99 0b sbc r25, r25 e3fa: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> e3fe: 41 e0 ldi r20, 0x01 ; 1 e400: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOL_F(degTargetBed(),1); #endif //TEMP_BED_PIN SERIAL_PROTOCOLPGM(" T0:"); e404: 81 e8 ldi r24, 0x81 ; 129 e406: 96 e7 ldi r25, 0x76 ; 118 e408: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 e40c: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 e410: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 e414: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 e418: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 e41c: 41 e0 ldi r20, 0x01 ; 1 e41e: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); e422: 8e e7 ldi r24, 0x7E ; 126 e424: 96 e7 ldi r25, 0x76 ; 118 e426: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; e42a: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 e42e: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 e432: 07 2e mov r0, r23 e434: 00 0c add r0, r0 e436: 88 0b sbc r24, r24 e438: 99 0b sbc r25, r25 e43a: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> e43e: 41 e0 ldi r20, 0x01 ; 1 e440: 0f 94 08 98 call 0x33010 ; 0x33010 #else SERIAL_ERROR_START; SERIAL_ERRORLNRPGM(_n("No thermistors - no temperature"));////MSG_ERR_NO_THERMISTORS #endif SERIAL_PROTOCOLPGM(" @:"); e444: 8a e7 ldi r24, 0x7A ; 122 e446: 96 e7 ldi r25, 0x76 ; 118 e448: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); e44c: 60 91 62 06 lds r22, 0x0662 ; 0x800662 <_ZL8soft_pwm.lto_priv.506> e450: 70 e0 ldi r23, 0x00 ; 0 e452: 90 e0 ldi r25, 0x00 ; 0 e454: 80 e0 ldi r24, 0x00 ; 0 e456: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_PROTOCOLPGM("W"); #else SERIAL_PROTOCOL(getHeaterPower(active_extruder)); #endif SERIAL_PROTOCOLPGM(" B@:"); e45a: 85 e7 ldi r24, 0x75 ; 117 e45c: 96 e7 ldi r25, 0x76 ; 118 e45e: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 e462: 60 91 5b 06 lds r22, 0x065B ; 0x80065b e466: 70 e0 ldi r23, 0x00 ; 0 e468: 90 e0 ldi r25, 0x00 ; 0 e46a: 80 e0 ldi r24, 0x00 ; 0 e46c: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 #else SERIAL_PROTOCOL(getHeaterPower(-1)); #endif #ifdef PINDA_THERMISTOR SERIAL_PROTOCOLPGM(" P:"); e470: 81 e7 ldi r24, 0x71 ; 113 e472: 96 e7 ldi r25, 0x76 ; 118 e474: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); e478: 60 91 8e 06 lds r22, 0x068E ; 0x80068e e47c: 70 91 8f 06 lds r23, 0x068F ; 0x80068f e480: 80 91 90 06 lds r24, 0x0690 ; 0x800690 e484: 90 91 91 06 lds r25, 0x0691 ; 0x800691 e488: 41 e0 ldi r20, 0x01 ; 1 e48a: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOL_F(100 * (1 + (PtA * (raw/OVERSAMPLENR)) + (PtB * sq((raw/OVERSAMPLENR)))), 5); SERIAL_PROTOCOLPGM(" Rx0->"); SERIAL_PROTOCOL_F(raw, 5); } #endif SERIAL_PROTOCOLLN(); e48e: 0d 94 bb 98 jmp 0x33176 ; 0x33176 0000e492 : ++str; } } void serialprintlnPGM(const char *str) { serialprintPGM(str); e492: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 MYSERIAL.println(); e496: 0d 94 bb 98 jmp 0x33176 ; 0x33176 0000e49a : /** * Output a "busy" message at regular intervals * while the machine is not accepting commands. */ void host_keepalive() { e49a: 8f 92 push r8 e49c: 9f 92 push r9 e49e: af 92 push r10 e4a0: bf 92 push r11 e4a2: cf 92 push r12 e4a4: df 92 push r13 e4a6: ef 92 push r14 e4a8: ff 92 push r15 #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; long ms = _millis(); e4aa: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 e4ae: 6b 01 movw r12, r22 e4b0: 7c 01 movw r14, r24 if (host_keepalive_interval && busy_state != NOT_BUSY) { e4b2: 20 91 32 02 lds r18, 0x0232 ; 0x800232 e4b6: 22 23 and r18, r18 e4b8: 09 f1 breq .+66 ; 0xe4fc e4ba: 40 91 78 02 lds r20, 0x0278 ; 0x800278 e4be: 41 30 cpi r20, 0x01 ; 1 e4c0: e9 f0 breq .+58 ; 0xe4fc if ((ms - prev_busy_signal_ms) < (long)(1000L * host_keepalive_interval)) return; e4c2: 80 91 14 02 lds r24, 0x0214 ; 0x800214 e4c6: 90 91 15 02 lds r25, 0x0215 ; 0x800215 e4ca: a0 91 16 02 lds r26, 0x0216 ; 0x800216 e4ce: b0 91 17 02 lds r27, 0x0217 ; 0x800217 e4d2: 46 01 movw r8, r12 e4d4: 57 01 movw r10, r14 e4d6: 88 1a sub r8, r24 e4d8: 99 0a sbc r9, r25 e4da: aa 0a sbc r10, r26 e4dc: bb 0a sbc r11, r27 e4de: 30 e0 ldi r19, 0x00 ; 0 e4e0: a8 ee ldi r26, 0xE8 ; 232 e4e2: b3 e0 ldi r27, 0x03 ; 3 e4e4: 0f 94 3b a1 call 0x34276 ; 0x34276 <__umulhisi3> e4e8: 86 16 cp r8, r22 e4ea: 97 06 cpc r9, r23 e4ec: a8 06 cpc r10, r24 e4ee: b9 06 cpc r11, r25 e4f0: 6c f0 brlt .+26 ; 0xe50c switch (busy_state) { e4f2: 44 30 cpi r20, 0x04 ; 4 e4f4: 31 f1 breq .+76 ; 0xe542 e4f6: 9c f4 brge .+38 ; 0xe51e e4f8: 42 30 cpi r20, 0x02 ; 2 e4fa: d4 f4 brge .+52 ; 0xe530 break; default: break; } } prev_busy_signal_ms = ms; e4fc: c0 92 14 02 sts 0x0214, r12 ; 0x800214 e500: d0 92 15 02 sts 0x0215, r13 ; 0x800215 e504: e0 92 16 02 sts 0x0216, r14 ; 0x800216 e508: f0 92 17 02 sts 0x0217, r15 ; 0x800217 } e50c: ff 90 pop r15 e50e: ef 90 pop r14 e510: df 90 pop r13 e512: cf 90 pop r12 e514: bf 90 pop r11 e516: af 90 pop r10 e518: 9f 90 pop r9 e51a: 8f 90 pop r8 e51c: 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) { e51e: 45 30 cpi r20, 0x05 ; 5 e520: 69 f7 brne .-38 ; 0xe4fc case PAUSED_FOR_USER: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; e522: 81 e6 ldi r24, 0x61 ; 97 e524: 9d e9 ldi r25, 0x9D ; 157 e526: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLNPGM("busy: paused for input"); e52a: 8c e5 ldi r24, 0x5C ; 92 e52c: 98 e7 ldi r25, 0x78 ; 120 e52e: 06 c0 rjmp .+12 ; 0xe53c 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; e530: 81 e6 ldi r24, 0x61 ; 97 e532: 9d e9 ldi r25, 0x9D ; 157 e534: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLNPGM("busy: processing"); e538: 89 e8 ldi r24, 0x89 ; 137 e53a: 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"); e53c: 0e 94 49 72 call 0xe492 ; 0xe492 e540: dd cf rjmp .-70 ; 0xe4fc case IN_PROCESS: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: processing"); break; case PAUSED_FOR_USER: SERIAL_ECHO_START; e542: 81 e6 ldi r24, 0x61 ; 97 e544: 9d e9 ldi r25, 0x9D ; 157 e546: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLNPGM("busy: paused for user"); e54a: 83 e7 ldi r24, 0x73 ; 115 e54c: 98 e7 ldi r25, 0x78 ; 120 e54e: f6 cf rjmp .-20 ; 0xe53c 0000e550 : #endif //TEMP_RESIDENCY_TIME } } void check_babystep() { e550: 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))); e552: 81 ea ldi r24, 0xA1 ; 161 e554: 9d e0 ldi r25, 0x0D ; 13 e556: 0f 94 9b a0 call 0x34136 ; 0x34136 } } void check_babystep() { int babystep_z = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> e55a: cb e0 ldi r28, 0x0B ; 11 e55c: 8c 9f mul r24, r28 e55e: c0 01 movw r24, r0 e560: 11 24 eor r1, r1 e562: 80 5b subi r24, 0xB0 ; 176 e564: 92 4f sbci r25, 0xF2 ; 242 e566: 0f 94 a9 a0 call 0x34152 ; 0x34152 s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); if ((babystep_z < Z_BABYSTEP_MIN) || (babystep_z > Z_BABYSTEP_MAX)) { e56a: 81 56 subi r24, 0x61 ; 97 e56c: 90 4f sbci r25, 0xF0 ; 240 e56e: 80 3a cpi r24, 0xA0 ; 160 e570: 9f 40 sbci r25, 0x0F ; 15 e572: c8 f0 brcs .+50 ; 0xe5a6 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"); e574: 88 e2 ldi r24, 0x28 ; 40 e576: 98 e7 ldi r25, 0x78 ; 120 e578: 0e 94 49 72 call 0xe492 ; 0xe492 eeprom_write_word_notify(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)), e57c: 81 ea ldi r24, 0xA1 ; 161 e57e: 9d e0 ldi r25, 0x0D ; 13 e580: 0f 94 9b a0 call 0x34136 ; 0x34136 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-> e584: 8c 9f mul r24, r28 e586: c0 01 movw r24, r0 e588: 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); e58a: 70 e0 ldi r23, 0x00 ; 0 e58c: 60 e0 ldi r22, 0x00 ; 0 e58e: 80 5b subi r24, 0xB0 ; 176 e590: 92 4f sbci r25, 0xF2 ; 242 e592: 0f 94 f9 a0 call 0x341f2 ; 0x341f2 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.")); e596: 8b ee ldi r24, 0xEB ; 235 e598: 97 e7 ldi r25, 0x77 ; 119 e59a: 0f 94 a9 0b call 0x21752 ; 0x21752 lcd_update_enable(true); e59e: 81 e0 ldi r24, 0x01 ; 1 } } e5a0: 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); e5a2: 0c 94 b6 69 jmp 0xd36c ; 0xd36c } } e5a6: cf 91 pop r28 e5a8: 08 95 ret 0000e5aa : #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } void kill(const char *full_screen_message) { e5aa: ec 01 movw r28, r24 cli(); // Stop interrupts e5ac: f8 94 cli disable_heater(); e5ae: 0f 94 e7 12 call 0x225ce ; 0x225ce disable_x(); e5b2: 17 9a sbi 0x02, 7 ; 2 e5b4: 10 92 a3 06 sts 0x06A3, r1 ; 0x8006a3 disable_y(); e5b8: 16 9a sbi 0x02, 6 ; 2 e5ba: 10 92 a4 06 sts 0x06A4, r1 ; 0x8006a4 poweroff_z(); disable_e0(); e5be: 14 9a sbi 0x02, 4 ; 2 SERIAL_ERROR_START; e5c0: 84 e4 ldi r24, 0x44 ; 68 e5c2: 9d e9 ldi r25, 0x9D ; 157 e5c4: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); e5c8: 8c ec ldi r24, 0xCC ; 204 e5ca: 97 e7 ldi r25, 0x77 ; 119 e5cc: 0e 94 49 72 call 0xe492 ; 0xe492 if (full_screen_message != NULL) { e5d0: 20 97 sbiw r28, 0x00 ; 0 e5d2: 79 f0 breq .+30 ; 0xe5f2 SERIAL_ERRORLNRPGM(full_screen_message); e5d4: ce 01 movw r24, r28 e5d6: 0e 94 49 72 call 0xe492 ; 0xe492 e5da: be 01 movw r22, r28 e5dc: 85 e9 ldi r24, 0x95 ; 149 e5de: 9c e0 ldi r25, 0x0C ; 12 e5e0: 0f 94 f9 a0 call 0x341f2 ; 0x341f2 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); e5e4: 62 e4 ldi r22, 0x42 ; 66 e5e6: 84 e9 ldi r24, 0x94 ; 148 e5e8: 9c e0 ldi r25, 0x0C ; 12 e5ea: 0f 94 e3 a0 call 0x341c6 ; 0x341c6 // 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(); e5ee: 0e 94 9d 60 call 0xc13a ; 0xc13a SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); if (full_screen_message != NULL) { SERIAL_ERRORLNRPGM(full_screen_message); } else { full_screen_message = PSTR("KILLED."); e5f2: c4 ec ldi r28, 0xC4 ; 196 e5f4: d7 e7 ldi r29, 0x77 ; 119 e5f6: f1 cf rjmp .-30 ; 0xe5da 0000e5f8 : // 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(); e5f8: 8a e4 ldi r24, 0x4A ; 74 e5fa: 93 e0 ldi r25, 0x03 ; 3 e5fc: 0f 94 29 12 call 0x22452 ; 0x22452 ::start()> if (buflen && ((CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB) || (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR))) e600: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf e604: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 e608: 89 2b or r24, r25 e60a: 79 f0 breq .+30 ; 0xe62a e60c: e0 91 cb 11 lds r30, 0x11CB ; 0x8011cb e610: f0 91 cc 11 lds r31, 0x11CC ; 0x8011cc e614: e2 52 subi r30, 0x22 ; 34 e616: f0 4f sbci r31, 0xF0 ; 240 e618: 80 81 ld r24, Z e61a: 81 30 cpi r24, 0x01 ; 1 e61c: 11 f0 breq .+4 ; 0xe622 e61e: 86 30 cpi r24, 0x06 ; 6 e620: 21 f4 brne .+8 ; 0xe62a SERIAL_PROTOCOLLNRPGM(MSG_OK); e622: 81 e3 ldi r24, 0x31 ; 49 e624: 99 e6 ldi r25, 0x69 ; 105 e626: 0c 94 49 72 jmp 0xe492 ; 0xe492 } e62a: 08 95 ret 0000e62c : void cmdqueue_reset() { while (buflen) e62c: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf e630: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 e634: 89 2b or r24, r25 e636: 29 f0 breq .+10 ; 0xe642 { // printf_P(PSTR("dumping: \"%s\" of type %u\n"), cmdbuffer+bufindr+CMDHDRSIZE, CMDBUFFER_CURRENT_TYPE); ClearToSend(); e638: 0e 94 fc 72 call 0xe5f8 ; 0xe5f8 cmdqueue_pop_front(); e63c: 0e 94 c9 6f call 0xdf92 ; 0xdf92 e640: f5 cf rjmp .-22 ; 0xe62c } bufindr = 0; e642: 10 92 cc 11 sts 0x11CC, r1 ; 0x8011cc e646: 10 92 cb 11 sts 0x11CB, r1 ; 0x8011cb bufindw = 0; e64a: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> e64e: 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; e652: 81 e0 ldi r24, 0x01 ; 1 e654: 80 93 e6 11 sts 0x11E6, r24 ; 0x8011e6 } e658: 08 95 ret 0000e65a : } // G81_M420 Mesh bed leveling status static void gcode_G81_M420() { e65a: ef 92 push r14 e65c: ff 92 push r15 e65e: 0f 93 push r16 e660: 1f 93 push r17 e662: cf 93 push r28 e664: df 93 push r29 if (mbl.active) { e666: 80 91 9c 12 lds r24, 0x129C ; 0x80129c e66a: 88 23 and r24, r24 e66c: 89 f1 breq .+98 ; 0xe6d0 } } } void mesh_bed_leveling::print() { SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(MESH_NUM_X_POINTS) "," STRINGIFY(MESH_NUM_Y_POINTS)); e66e: 86 e5 ldi r24, 0x56 ; 86 e670: 97 e7 ldi r25, 0x77 ; 119 e672: 0e 94 49 72 call 0xe492 ; 0xe492 SERIAL_PROTOCOLLNPGM("Z search height: " STRINGIFY(MESH_HOME_Z_SEARCH)); e676: 80 e4 ldi r24, 0x40 ; 64 e678: 97 e7 ldi r25, 0x77 ; 119 e67a: 0e 94 49 72 call 0xe492 ; 0xe492 SERIAL_PROTOCOLLNPGM("Measured points:"); e67e: 8f e2 ldi r24, 0x2F ; 47 e680: 97 e7 ldi r25, 0x77 ; 119 e682: 0e 94 49 72 call 0xe492 ; 0xe492 for (uint8_t y = MESH_NUM_Y_POINTS; y-- > 0;) { e686: c7 e0 ldi r28, 0x07 ; 7 e688: dc e1 ldi r29, 0x1C ; 28 e68a: c1 50 subi r28, 0x01 ; 1 e68c: 58 f1 brcs .+86 ; 0xe6e4 e68e: cd 9f mul r28, r29 e690: 70 01 movw r14, r0 e692: 11 24 eor r1, r1 e694: 01 e0 ldi r16, 0x01 ; 1 e696: 10 e0 ldi r17, 0x00 ; 0 for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) { SERIAL_PROTOCOLPGM(" "); e698: 8c e2 ldi r24, 0x2C ; 44 e69a: 97 e7 ldi r25, 0x77 ; 119 e69c: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_PROTOCOL_F(z_values[y][x], 5); e6a0: f8 01 movw r30, r16 e6a2: ee 0f add r30, r30 e6a4: ff 1f adc r31, r31 e6a6: ee 0f add r30, r30 e6a8: ff 1f adc r31, r31 e6aa: ee 0d add r30, r14 e6ac: ff 1d adc r31, r15 e6ae: e7 56 subi r30, 0x67 ; 103 e6b0: fd 4e sbci r31, 0xED ; 237 e6b2: 60 81 ld r22, Z e6b4: 71 81 ldd r23, Z+1 ; 0x01 e6b6: 82 81 ldd r24, Z+2 ; 0x02 e6b8: 93 81 ldd r25, Z+3 ; 0x03 e6ba: 45 e0 ldi r20, 0x05 ; 5 e6bc: 0f 94 08 98 call 0x33010 ; 0x33010 e6c0: 0f 5f subi r16, 0xFF ; 255 e6c2: 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++) { e6c4: 08 30 cpi r16, 0x08 ; 8 e6c6: 11 05 cpc r17, r1 e6c8: 39 f7 brne .-50 ; 0xe698 SERIAL_PROTOCOLPGM(" "); SERIAL_PROTOCOL_F(z_values[y][x], 5); } SERIAL_PROTOCOLLN(); e6ca: 0f 94 bb 98 call 0x33176 ; 0x33176 e6ce: dd cf rjmp .-70 ; 0xe68a mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); e6d0: 83 e6 ldi r24, 0x63 ; 99 e6d2: 97 e7 ldi r25, 0x77 ; 119 return; } e6d4: df 91 pop r29 e6d6: cf 91 pop r28 e6d8: 1f 91 pop r17 e6da: 0f 91 pop r16 e6dc: ff 90 pop r15 e6de: ef 90 pop r14 static void gcode_G81_M420() { if (mbl.active) { mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); e6e0: 0c 94 49 72 jmp 0xe492 ; 0xe492 return; } e6e4: df 91 pop r29 e6e6: cf 91 pop r28 e6e8: 1f 91 pop r17 e6ea: 0f 91 pop r16 e6ec: ff 90 pop r15 e6ee: ef 90 pop r14 e6f0: 08 95 ret 0000e6f2 : return (k >= 0? la10c_convert(k): -1); } float la10c_jerk(float j) { e6f2: cf 92 push r12 e6f4: df 92 push r13 e6f6: ef 92 push r14 e6f8: ff 92 push r15 e6fa: 6b 01 movw r12, r22 e6fc: 7c 01 movw r14, r24 la10c_orig_jerk = j; e6fe: c0 92 29 03 sts 0x0329, r12 ; 0x800329 e702: d0 92 2a 03 sts 0x032A, r13 ; 0x80032a e706: e0 92 2b 03 sts 0x032B, r14 ; 0x80032b e70a: f0 92 2c 03 sts 0x032C, r15 ; 0x80032c if(la10c_mode != LA10C_LA10) e70e: 80 91 45 03 lds r24, 0x0345 ; 0x800345 e712: 82 30 cpi r24, 0x02 ; 2 e714: b1 f4 brne .+44 ; 0xe742 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) e716: 20 e0 ldi r18, 0x00 ; 0 e718: 30 e0 ldi r19, 0x00 ; 0 e71a: 40 e9 ldi r20, 0x90 ; 144 e71c: 50 e4 ldi r21, 0x40 ; 64 e71e: c7 01 movw r24, r14 e720: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> e724: 87 ff sbrs r24, 7 e726: 14 c0 rjmp .+40 ; 0xe750 e728: 80 91 62 04 lds r24, 0x0462 ; 0x800462 e72c: 90 91 63 04 lds r25, 0x0463 ; 0x800463 e730: a0 91 64 04 lds r26, 0x0464 ; 0x800464 e734: b0 91 65 04 lds r27, 0x0465 ; 0x800465 e738: 80 3d cpi r24, 0xD0 ; 208 e73a: 97 40 sbci r25, 0x07 ; 7 e73c: a1 05 cpc r26, r1 e73e: b1 05 cpc r27, r1 e740: 20 f5 brcc .+72 ; 0xe78a j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); SERIAL_ECHOLN(j); return j; } e742: c7 01 movw r24, r14 e744: b6 01 movw r22, r12 e746: ff 90 pop r15 e748: ef 90 pop r14 e74a: df 90 pop r13 e74c: cf 90 pop r12 e74e: 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: e750: 2a e9 ldi r18, 0x9A ; 154 e752: 39 e9 ldi r19, 0x99 ; 153 e754: 49 e9 ldi r20, 0x99 ; 153 e756: 5e e3 ldi r21, 0x3E ; 62 e758: c7 01 movw r24, r14 e75a: b6 01 movw r22, r12 e75c: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> e760: 87 ff sbrs r24, 7 e762: 0a c0 rjmp .+20 ; 0xe778 e764: 20 e0 ldi r18, 0x00 ; 0 e766: 30 e0 ldi r19, 0x00 ; 0 e768: 48 e3 ldi r20, 0x38 ; 56 e76a: 51 e4 ldi r21, 0x41 ; 65 e76c: c7 01 movw r24, r14 e76e: b6 01 movw r22, r12 e770: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> e774: 6b 01 movw r12, r22 e776: 7c 01 movw r14, r24 j < 4.5? j * 0.25 + 3.375: j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); e778: 8a e3 ldi r24, 0x3A ; 58 e77a: 94 e7 ldi r25, 0x74 ; 116 e77c: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLN(j); e780: c7 01 movw r24, r14 e782: b6 01 movw r22, r12 e784: 0f 94 45 42 call 0x2848a ; 0x2848a e788: dc cf rjmp .-72 ; 0xe742 // 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: e78a: 2a e9 ldi r18, 0x9A ; 154 e78c: 39 e9 ldi r19, 0x99 ; 153 e78e: 49 e9 ldi r20, 0x99 ; 153 e790: 5e e3 ldi r21, 0x3E ; 62 e792: c7 01 movw r24, r14 e794: b6 01 movw r22, r12 e796: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> e79a: 87 fd sbrc r24, 7 e79c: e3 cf rjmp .-58 ; 0xe764 j < 4.5? j * 0.25 + 3.375: e79e: 20 e0 ldi r18, 0x00 ; 0 e7a0: 30 e0 ldi r19, 0x00 ; 0 e7a2: 40 e8 ldi r20, 0x80 ; 128 e7a4: 5e e3 ldi r21, 0x3E ; 62 e7a6: c7 01 movw r24, r14 e7a8: b6 01 movw r22, r12 e7aa: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__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: e7ae: 20 e0 ldi r18, 0x00 ; 0 e7b0: 30 e0 ldi r19, 0x00 ; 0 e7b2: 48 e5 ldi r20, 0x58 ; 88 e7b4: 50 e4 ldi r21, 0x40 ; 64 e7b6: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> e7ba: dc cf rjmp .-72 ; 0xe774 0000e7bc : return la10c_mode; } void la10c_mode_change(LA10C_MODE mode) { e7bc: cf 92 push r12 e7be: df 92 push r13 e7c0: ef 92 push r14 e7c2: ff 92 push r15 e7c4: cf 93 push r28 if(mode == la10c_mode) return; e7c6: 90 91 45 03 lds r25, 0x0345 ; 0x800345 e7ca: 98 17 cp r25, r24 e7cc: b9 f1 breq .+110 ; 0xe83c e7ce: c8 2f mov r28, r24 // always restore to the last unadjusted E-jerk value if(la10c_orig_jerk) e7d0: c0 90 29 03 lds r12, 0x0329 ; 0x800329 e7d4: d0 90 2a 03 lds r13, 0x032A ; 0x80032a e7d8: e0 90 2b 03 lds r14, 0x032B ; 0x80032b e7dc: f0 90 2c 03 lds r15, 0x032C ; 0x80032c e7e0: 20 e0 ldi r18, 0x00 ; 0 e7e2: 30 e0 ldi r19, 0x00 ; 0 e7e4: a9 01 movw r20, r18 e7e6: c7 01 movw r24, r14 e7e8: b6 01 movw r22, r12 e7ea: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> e7ee: 88 23 and r24, r24 e7f0: 41 f0 breq .+16 ; 0xe802 cs.max_jerk[E_AXIS] = la10c_orig_jerk; e7f2: c0 92 86 04 sts 0x0486, r12 ; 0x800486 e7f6: d0 92 87 04 sts 0x0487, r13 ; 0x800487 e7fa: e0 92 88 04 sts 0x0488, r14 ; 0x800488 e7fe: f0 92 89 04 sts 0x0489, r15 ; 0x800489 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); e802: 8d e1 ldi r24, 0x1D ; 29 e804: 94 e7 ldi r25, 0x74 ; 116 e806: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 switch(mode) e80a: c1 30 cpi r28, 0x01 ; 1 e80c: 11 f1 breq .+68 ; 0xe852 e80e: e0 f0 brcs .+56 ; 0xe848 e810: c2 30 cpi r28, 0x02 ; 2 e812: 11 f1 breq .+68 ; 0xe858 { 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; e814: 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]); e818: 60 91 86 04 lds r22, 0x0486 ; 0x800486 e81c: 70 91 87 04 lds r23, 0x0487 ; 0x800487 e820: 80 91 88 04 lds r24, 0x0488 ; 0x800488 e824: 90 91 89 04 lds r25, 0x0489 ; 0x800489 e828: 0e 94 79 73 call 0xe6f2 ; 0xe6f2 e82c: 60 93 86 04 sts 0x0486, r22 ; 0x800486 e830: 70 93 87 04 sts 0x0487, r23 ; 0x800487 e834: 80 93 88 04 sts 0x0488, r24 ; 0x800488 e838: 90 93 89 04 sts 0x0489, r25 ; 0x800489 } e83c: cf 91 pop r28 e83e: ff 90 pop r15 e840: ef 90 pop r14 e842: df 90 pop r13 e844: cf 90 pop r12 e846: 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; e848: 85 e1 ldi r24, 0x15 ; 21 e84a: 94 e7 ldi r25, 0x74 ; 116 case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; e84c: 0e 94 49 72 call 0xe492 ; 0xe492 e850: e1 cf rjmp .-62 ; 0xe814 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); switch(mode) { case LA10C_UNKNOWN: SERIAL_ECHOLNPGM("UNKNOWN"); break; case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; e852: 81 e1 ldi r24, 0x11 ; 17 e854: 94 e7 ldi r25, 0x74 ; 116 e856: fa cf rjmp .-12 ; 0xe84c case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; e858: 8d e0 ldi r24, 0x0D ; 13 e85a: 94 e7 ldi r25, 0x74 ; 116 e85c: f7 cf rjmp .-18 ; 0xe84c 0000e85e : bool IsStopped() { return Stopped; }; void finishAndDisableSteppers() { st_synchronize(); e85e: 0f 94 ce 22 call 0x2459c ; 0x2459c disable_x(); e862: 17 9a sbi 0x02, 7 ; 2 e864: e3 ea ldi r30, 0xA3 ; 163 e866: f6 e0 ldi r31, 0x06 ; 6 e868: 10 82 st Z, r1 disable_y(); e86a: 16 9a sbi 0x02, 6 ; 2 e86c: 11 82 std Z+1, r1 ; 0x01 disable_z(); disable_e0(); e86e: 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); } e870: 80 e0 ldi r24, 0x00 ; 0 e872: 0e 94 de 73 call 0xe7bc ; 0xe7bc return percent_done; } static void print_time_remaining_init() { print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; e876: 8f ef ldi r24, 0xFF ; 255 e878: 9f ef ldi r25, 0xFF ; 255 e87a: 90 93 75 02 sts 0x0275, r25 ; 0x800275 e87e: 80 93 74 02 sts 0x0274, r24 ; 0x800274 print_percent_done_normal = PRINT_PERCENT_DONE_INIT; e882: 2f ef ldi r18, 0xFF ; 255 e884: 20 93 71 02 sts 0x0271, r18 ; 0x800271 print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; e888: 90 93 3e 02 sts 0x023E, r25 ; 0x80023e e88c: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d print_percent_done_silent = PRINT_PERCENT_DONE_INIT; e890: 20 93 3f 02 sts 0x023F, r18 ; 0x80023f print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; e894: 90 93 73 02 sts 0x0273, r25 ; 0x800273 e898: 80 93 72 02 sts 0x0272, r24 ; 0x800272 print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; e89c: 90 93 3c 02 sts 0x023C, r25 ; 0x80023c e8a0: 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(); } e8a4: 08 95 ret 0000e8a6 : SERIAL_ECHOLNRPGM(emergency_serial_dump? _N("enabled"): _N("disabled")); } } void __attribute__((noinline)) serial_dump_and_reset(dump_crash_reason reason) { e8a6: 18 2f mov r17, r24 uint16_t sp; uint32_t pc; // we're being called from a live state, so shut off interrupts ... cli(); e8a8: f8 94 cli // sample SP/PC sp = SP; e8aa: cd b7 in r28, 0x3d ; 61 e8ac: de b7 in r29, 0x3e ; 62 "rcall .\n" "pop %A0\n" "pop %B0\n" "pop %C0\n" : "=&r" (ret) ); e8ae: 00 d0 rcall .+0 ; 0xe8b0 e8b0: cf 90 pop r12 e8b2: df 90 pop r13 e8b4: ef 90 pop r14 e8b6: 88 e1 ldi r24, 0x18 ; 24 e8b8: 99 e2 ldi r25, 0x29 ; 41 e8ba: 0f b6 in r0, 0x3f ; 63 e8bc: f8 94 cli e8be: a8 95 wdr e8c0: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> e8c4: 0f be out 0x3f, r0 ; 63 e8c6: 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); e8ca: 9f b7 in r25, 0x3f ; 63 e8cc: f8 94 cli e8ce: e2 e0 ldi r30, 0x02 ; 2 e8d0: f1 e0 ldi r31, 0x01 ; 1 e8d2: 80 81 ld r24, Z e8d4: 88 60 ori r24, 0x08 ; 8 e8d6: 80 83 st Z, r24 e8d8: 9f bf out 0x3f, r25 ; 63 disable_heater(); e8da: 0f 94 e7 12 call 0x225ce ; 0x225ce // 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"); e8de: 8c ec ldi r24, 0xCC ; 204 e8e0: 93 e7 ldi r25, 0x73 ; 115 e8e2: 0e 94 49 72 call 0xe492 ; 0xe492 SERIAL_ECHOPGM("error: "); e8e6: 84 ec ldi r24, 0xC4 ; 196 e8e8: 93 e7 ldi r25, 0x73 ; 115 e8ea: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 print((long) c, base); } void MarlinSerial::print(unsigned char b, int base) { print((unsigned long) b, base); e8ee: 61 2f mov r22, r17 e8f0: 70 e0 ldi r23, 0x00 ; 0 e8f2: 90 e0 ldi r25, 0x00 ; 0 e8f4: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); e8f6: 4a e0 ldi r20, 0x0A ; 10 e8f8: 0f 94 eb 96 call 0x32dd6 ; 0x32dd6 MYSERIAL.print((uint8_t)reason, DEC); SERIAL_ECHOPGM(" 0x"); e8fc: 80 ec ldi r24, 0xC0 ; 192 e8fe: 93 e7 ldi r25, 0x73 ; 115 e900: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 // we're being called from a live state, so shut off interrupts ... cli(); // sample SP/PC sp = SP; pc = GETPC(); e904: 8e 2d mov r24, r14 e906: b6 01 movw r22, r12 e908: 90 e0 ldi r25, 0x00 ; 0 e90a: 40 e1 ldi r20, 0x10 ; 16 e90c: 0f 94 eb 96 call 0x32dd6 ; 0x32dd6 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"); e910: 8c eb ldi r24, 0xBC ; 188 e912: 93 e7 ldi r25, 0x73 ; 115 e914: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); e918: be 01 movw r22, r28 e91a: 90 e0 ldi r25, 0x00 ; 0 e91c: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); e91e: 40 e1 ldi r20, 0x10 ; 16 e920: 0f 94 eb 96 call 0x32dd6 ; 0x32dd6 } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); e924: 0f 94 bb 98 call 0x33176 ; 0x33176 MYSERIAL.println(sp, HEX); print_mem(0, RAMEND+1, dcode_mem_t::sram); e928: 40 e0 ldi r20, 0x00 ; 0 e92a: 60 e0 ldi r22, 0x00 ; 0 e92c: 72 e2 ldi r23, 0x22 ; 34 e92e: 90 e0 ldi r25, 0x00 ; 0 e930: 80 e0 ldi r24, 0x00 ; 0 e932: 0f 94 a4 53 call 0x2a748 ; 0x2a748 SERIAL_ECHOLNRPGM(MSG_OK); e936: 81 e3 ldi r24, 0x31 ; 49 e938: 99 e6 ldi r25, 0x69 ; 105 e93a: 0e 94 49 72 call 0xe492 ; 0xe492 // reset soon softReset(); e93e: 0e 94 9d 60 call 0xc13a ; 0xc13a 0000e942 : #endif //EMERGENCY_HANDLERS #endif //WATCHDOG } static inline void crash_and_burn(dump_crash_reason reason) { e942: c8 2f mov r28, r24 WRITE(BEEPER, HIGH); e944: 9f b7 in r25, 0x3f ; 63 e946: f8 94 cli e948: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> e94c: 84 60 ori r24, 0x04 ; 4 e94e: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> e952: 9f bf out 0x3f, r25 ; 63 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); e954: 6c 2f mov r22, r28 e956: 83 e0 ldi r24, 0x03 ; 3 e958: 9d e0 ldi r25, 0x0D ; 13 e95a: 0f 94 bf a0 call 0x3417e ; 0x3417e 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) e95e: 80 91 7c 06 lds r24, 0x067C ; 0x80067c e962: 88 23 and r24, r24 e964: 19 f0 breq .+6 ; 0xe96c serial_dump_and_reset(reason); e966: 8c 2f mov r24, r28 e968: 0e 94 53 74 call 0xe8a6 ; 0xe8a6 #endif softReset(); e96c: 0e 94 9d 60 call 0xc13a ; 0xc13a 0000e970 <__vector_default>: crash_and_burn(dump_crash_reason::watchdog); } #endif ISR(BADISR_vect) { e970: 1f 92 push r1 e972: 0f 92 push r0 e974: 0f b6 in r0, 0x3f ; 63 e976: 0f 92 push r0 e978: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::bad_isr); e97a: 83 e0 ldi r24, 0x03 ; 3 e97c: 0e 94 a1 74 call 0xe942 ; 0xe942 0000e980 <__vector_12>: } #ifdef EMERGENCY_HANDLERS #ifdef WATCHDOG ISR(WDT_vect) { e980: 1f 92 push r1 e982: 0f 92 push r0 e984: 0f b6 in r0, 0x3f ; 63 e986: 0f 92 push r0 e988: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::watchdog); e98a: 82 e0 ldi r24, 0x02 ; 2 e98c: 0e 94 a1 74 call 0xe942 ; 0xe942 0000e990 : } #endif void Config_ResetDefault() { memcpy_P(&cs,&default_conf, sizeof(cs)); e990: 41 ed ldi r20, 0xD1 ; 209 e992: 50 e0 ldi r21, 0x00 ; 0 e994: 6b ee ldi r22, 0xEB ; 235 e996: 72 e7 ldi r23, 0x72 ; 114 e998: 82 e3 ldi r24, 0x32 ; 50 e99a: 94 e0 ldi r25, 0x04 ; 4 e99c: 0f 94 35 9e call 0x33c6a ; 0x33c6a // steps per sq second need to be updated to agree with the units per sq second reset_acceleration_rates(); e9a0: 0f 94 54 75 call 0x2eaa8 ; 0x2eaa8 #ifdef PIDTEMP updatePID(); e9a4: 0f 94 22 19 call 0x23244 ; 0x23244 #endif//PIDTEMP #ifdef THERMAL_MODEL thermal_model_reset_settings(); #endif calculate_extruder_multipliers(); e9a8: 0e 94 c8 5e call 0xbd90 ; 0xbd90 SERIAL_ECHO_START; e9ac: 81 e6 ldi r24, 0x61 ; 97 e9ae: 9d e9 ldi r25, 0x9D ; 157 e9b0: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded"); e9b4: 89 ec ldi r24, 0xC9 ; 201 e9b6: 92 e7 ldi r25, 0x72 ; 114 e9b8: 0c 94 49 72 jmp 0xe492 ; 0xe492 0000e9bc : //! @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)); e9bc: 44 e0 ldi r20, 0x04 ; 4 e9be: 50 e0 ldi r21, 0x00 ; 0 e9c0: 64 e1 ldi r22, 0x14 ; 20 e9c2: 70 e0 ldi r23, 0x00 ; 0 e9c4: 82 e3 ldi r24, 0x32 ; 50 e9c6: 94 e0 ldi r25, 0x04 ; 4 e9c8: 0f 94 8b a0 call 0x34116 ; 0x34116 // SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << cs.version << "]"); if (strncmp_P(cs.version, default_conf.version, sizeof(EEPROM_VERSION)) == 0) // version number match e9cc: 43 e0 ldi r20, 0x03 ; 3 e9ce: 50 e0 ldi r21, 0x00 ; 0 e9d0: 6b ee ldi r22, 0xEB ; 235 e9d2: 72 e7 ldi r23, 0x72 ; 114 e9d4: 82 e3 ldi r24, 0x32 ; 50 e9d6: 94 e0 ldi r25, 0x04 ; 4 e9d8: 0f 94 7a 9e call 0x33cf4 ; 0x33cf4 e9dc: 89 2b or r24, r25 e9de: 09 f0 breq .+2 ; 0xe9e2 e9e0: 5d c0 rjmp .+186 ; 0xea9c { // 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)); e9e2: ef ea ldi r30, 0xAF ; 175 e9e4: f3 e7 ldi r31, 0x73 ; 115 e9e6: 45 91 lpm r20, Z+ e9e8: 55 91 lpm r21, Z+ e9ea: 65 91 lpm r22, Z+ e9ec: 74 91 lpm r23, Z e9ee: 88 ed ldi r24, 0xD8 ; 216 e9f0: 90 e0 ldi r25, 0x00 ; 0 e9f2: 0e 94 18 5d call 0xba30 ; 0xba30 eeprom_init_default_float(&EEPROM_M500_base->min_mm_per_arc_segment, pgm_read_float(&default_conf.min_mm_per_arc_segment)); e9f6: e3 eb ldi r30, 0xB3 ; 179 e9f8: f3 e7 ldi r31, 0x73 ; 115 e9fa: 45 91 lpm r20, Z+ e9fc: 55 91 lpm r21, Z+ e9fe: 65 91 lpm r22, Z+ ea00: 74 91 lpm r23, Z ea02: 8c ed ldi r24, 0xDC ; 220 ea04: 90 e0 ldi r25, 0x00 ; 0 ea06: 0e 94 18 5d call 0xba30 ; 0xba30 eeprom_init_default_byte(&EEPROM_M500_base->n_arc_correction, pgm_read_byte(&default_conf.n_arc_correction)); ea0a: e7 eb ldi r30, 0xB7 ; 183 ea0c: f3 e7 ldi r31, 0x73 ; 115 ea0e: 64 91 lpm r22, Z ea10: 80 ee ldi r24, 0xE0 ; 224 ea12: 90 e0 ldi r25, 0x00 ; 0 ea14: 0e 94 e3 6e call 0xddc6 ; 0xddc6 eeprom_init_default_word(&EEPROM_M500_base->min_arc_segments, pgm_read_word(&default_conf.min_arc_segments)); ea18: e8 eb ldi r30, 0xB8 ; 184 ea1a: f3 e7 ldi r31, 0x73 ; 115 ea1c: 65 91 lpm r22, Z+ ea1e: 74 91 lpm r23, Z ea20: 81 ee ldi r24, 0xE1 ; 225 ea22: 90 e0 ldi r25, 0x00 ; 0 ea24: 0e 94 cb 6e call 0xdd96 ; 0xdd96 eeprom_init_default_word(&EEPROM_M500_base->arc_segments_per_sec, pgm_read_word(&default_conf.arc_segments_per_sec)); ea28: ea eb ldi r30, 0xBA ; 186 ea2a: f3 e7 ldi r31, 0x73 ; 115 ea2c: 65 91 lpm r22, Z+ ea2e: 74 91 lpm r23, Z ea30: 83 ee ldi r24, 0xE3 ; 227 ea32: 90 e0 ldi r25, 0x00 ; 0 ea34: 0e 94 cb 6e call 0xdd96 ; 0xdd96 // 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)); ea38: eb ea ldi r30, 0xAB ; 171 ea3a: f3 e7 ldi r31, 0x73 ; 115 ea3c: 45 91 lpm r20, Z+ ea3e: 55 91 lpm r21, Z+ ea40: 65 91 lpm r22, Z+ ea42: 74 91 lpm r23, Z ea44: 84 ed ldi r24, 0xD4 ; 212 ea46: 90 e0 ldi r25, 0x00 ; 0 ea48: 0e 94 18 5d call 0xba30 ; 0xba30 // 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); ea4c: 47 e8 ldi r20, 0x87 ; 135 ea4e: 53 e7 ldi r21, 0x73 ; 115 ea50: 60 e1 ldi r22, 0x10 ; 16 ea52: 70 e0 ldi r23, 0x00 ; 0 ea54: 80 eb ldi r24, 0xB0 ; 176 ea56: 90 e0 ldi r25, 0x00 ; 0 ea58: 0e 94 ac 6e call 0xdd58 ; 0xdd58 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); ea5c: 47 e9 ldi r20, 0x97 ; 151 ea5e: 53 e7 ldi r21, 0x73 ; 115 ea60: 60 e1 ldi r22, 0x10 ; 16 ea62: 70 e0 ldi r23, 0x00 ; 0 ea64: 80 ec ldi r24, 0xC0 ; 192 ea66: 90 e0 ldi r25, 0x00 ; 0 ea68: 0e 94 ac 6e call 0xdd58 ; 0xdd58 #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)); ea6c: 41 ed ldi r20, 0xD1 ; 209 ea6e: 50 e0 ldi r21, 0x00 ; 0 ea70: 64 e1 ldi r22, 0x14 ; 20 ea72: 70 e0 ldi r23, 0x00 ; 0 ea74: 82 e3 ldi r24, 0x32 ; 50 ea76: 94 e0 ldi r25, 0x04 ; 4 ea78: 0f 94 8b a0 call 0x34116 ; 0x34116 calculate_extruder_multipliers(); ea7c: 0e 94 c8 5e call 0xbd90 ; 0xbd90 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(); ea80: 0f 94 54 75 call 0x2eaa8 ; 0x2eaa8 // Call updatePID (similar to when we have processed M301) updatePID(); ea84: 0f 94 22 19 call 0x23244 ; 0x23244 #ifdef THERMAL_MODEL thermal_model_load_settings(); #endif SERIAL_ECHO_START; ea88: 81 e6 ldi r24, 0x61 ; 97 ea8a: 9d e9 ldi r25, 0x9D ; 157 ea8c: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLNPGM("Stored settings retrieved"); ea90: 8f ea ldi r24, 0xAF ; 175 ea92: 92 e7 ldi r25, 0x72 ; 114 ea94: 0e 94 49 72 call 0xe492 ; 0xe492 ea98: 81 e0 ldi r24, 0x01 ; 1 ea9a: 08 95 ret } else { Config_ResetDefault(); ea9c: 0e 94 c8 74 call 0xe990 ; 0xe990 //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))) { eaa0: 64 e0 ldi r22, 0x04 ; 4 eaa2: 70 e0 ldi r23, 0x00 ; 0 eaa4: 84 e1 ldi r24, 0x14 ; 20 eaa6: 90 e0 ldi r25, 0x00 ; 0 eaa8: 0e 94 10 55 call 0xaa20 ; 0xaa20 eaac: 91 e0 ldi r25, 0x01 ; 1 eaae: 89 27 eor r24, r25 return false; } } return true; } eab0: 08 95 ret 0000eab2 : }; void Config_StoreSettings() { strcpy_P(cs.version, default_conf.version); eab2: 6b ee ldi r22, 0xEB ; 235 eab4: 72 e7 ldi r23, 0x72 ; 114 eab6: 82 e3 ldi r24, 0x32 ; 50 eab8: 94 e0 ldi r25, 0x04 ; 4 eaba: 0f 94 52 9e call 0x33ca4 ; 0x33ca4 #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); eabe: 41 ed ldi r20, 0xD1 ; 209 eac0: 50 e0 ldi r21, 0x00 ; 0 eac2: 64 e1 ldi r22, 0x14 ; 20 eac4: 70 e0 ldi r23, 0x00 ; 0 eac6: 82 e3 ldi r24, 0x32 ; 50 eac8: 94 e0 ldi r25, 0x04 ; 4 eaca: 0f 94 af a0 call 0x3415e ; 0x3415e 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; eace: 81 e6 ldi r24, 0x61 ; 97 ead0: 9d e9 ldi r25, 0x9D ; 157 ead2: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLNPGM("Settings Stored"); ead6: 8f e9 ldi r24, 0x9F ; 159 ead8: 92 e7 ldi r25, 0x72 ; 114 eada: 0c 94 49 72 jmp 0xe492 ; 0xe492 0000eade : { cmdbuffer_front_already_processed = true; } void get_command() { eade: 2f 92 push r2 eae0: 3f 92 push r3 eae2: 4f 92 push r4 eae4: 5f 92 push r5 eae6: 6f 92 push r6 eae8: 7f 92 push r7 eaea: 8f 92 push r8 eaec: 9f 92 push r9 eaee: af 92 push r10 eaf0: bf 92 push r11 eaf2: cf 92 push r12 eaf4: df 92 push r13 eaf6: ef 92 push r14 eaf8: ff 92 push r15 eafa: 0f 93 push r16 eafc: 1f 93 push r17 eafe: cf 93 push r28 eb00: df 93 push r29 eb02: cd b7 in r28, 0x3d ; 61 eb04: de b7 in r29, 0x3e ; 62 eb06: a0 97 sbiw r28, 0x20 ; 32 eb08: 0f b6 in r0, 0x3f ; 63 eb0a: f8 94 cli eb0c: de bf out 0x3e, r29 ; 62 eb0e: 0f be out 0x3f, r0 ; 63 eb10: cd bf out 0x3d, r28 ; 61 // Test and reserve space for the new command string. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE - 1)) eb12: 8f e5 ldi r24, 0x5F ; 95 eb14: 90 e0 ldi r25, 0x00 ; 0 eb16: 0e 94 bc 55 call 0xab78 ; 0xab78 eb1a: 88 23 and r24, r24 eb1c: 09 f4 brne .+2 ; 0xeb20 eb1e: a1 c0 rjmp .+322 ; 0xec62 return; if (MYSERIAL.available() == RX_BUFFER_SIZE - 1) { //compare number of chars buffered in rx buffer with rx buffer size eb20: 0e 94 c0 54 call 0xa980 ; 0xa980 eb24: 8f 37 cpi r24, 0x7F ; 127 eb26: 91 05 cpc r25, r1 eb28: 61 f4 brne .+24 ; 0xeb42 // 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; eb2a: 80 91 b1 05 lds r24, 0x05B1 ; 0x8005b1 eb2e: 90 91 b2 05 lds r25, 0x05B2 ; 0x8005b2 eb32: 90 93 b0 05 sts 0x05B0, r25 ; 0x8005b0 eb36: 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 eb3a: 80 e9 ldi r24, 0x90 ; 144 eb3c: 92 e7 ldi r25, 0x72 ; 114 eb3e: 0e 94 49 72 call 0xe492 ; 0xe492 eb42: 6e 01 movw r12, r28 eb44: 4f e1 ldi r20, 0x1F ; 31 eb46: c4 0e add r12, r20 eb48: 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; eb4a: 99 24 eor r9, r9 eb4c: 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 eb4e: 0e 94 c0 54 call 0xa980 ; 0xa980 eb52: 18 16 cp r1, r24 eb54: 19 06 cpc r1, r25 eb56: 0c f0 brlt .+2 ; 0xeb5a eb58: 78 c0 rjmp .+240 ; 0xec4a eb5a: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 eb5e: 88 23 and r24, r24 eb60: 29 f0 breq .+10 ; 0xeb6c eb62: 0e 94 b3 60 call 0xc166 ; 0xc166 eb66: 88 23 and r24, r24 eb68: 09 f4 brne .+2 ; 0xeb6c eb6a: 6f c0 rjmp .+222 ; 0xec4a eb6c: 80 91 61 03 lds r24, 0x0361 ; 0x800361 eb70: 81 11 cpse r24, r1 eb72: 6b c0 rjmp .+214 ; 0xec4a } 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) { eb74: 20 91 b1 05 lds r18, 0x05B1 ; 0x8005b1 eb78: 30 91 b2 05 lds r19, 0x05B2 ; 0x8005b2 eb7c: 80 91 af 05 lds r24, 0x05AF ; 0x8005af eb80: 90 91 b0 05 lds r25, 0x05B0 ; 0x8005b0 eb84: 82 17 cp r24, r18 eb86: 93 07 cpc r25, r19 eb88: 11 f3 breq .-60 ; 0xeb4e return -1; } else { unsigned char c = rx_buffer.buffer[rx_buffer.tail]; eb8a: f9 01 movw r30, r18 eb8c: e1 5d subi r30, 0xD1 ; 209 eb8e: fa 4f sbci r31, 0xFA ; 250 eb90: 80 81 ld r24, Z rx_buffer.tail = (unsigned int)(rx_buffer.tail + 1) % RX_BUFFER_SIZE; eb92: 2f 5f subi r18, 0xFF ; 255 eb94: 3f 4f sbci r19, 0xFF ; 255 eb96: 2f 77 andi r18, 0x7F ; 127 eb98: 33 27 eor r19, r19 eb9a: 30 93 b2 05 sts 0x05B2, r19 ; 0x8005b2 eb9e: 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)) { eba2: 8f 3f cpi r24, 0xFF ; 255 eba4: 09 f0 breq .+2 ; 0xeba8 eba6: 79 c0 rjmp .+242 ; 0xec9a if (mp_cmd_count > 0) { eba8: 80 91 1b 03 lds r24, 0x031B ; 0x80031b ebac: 88 23 and r24, r24 ebae: 09 f4 brne .+2 ; 0xebb2 ebb0: 71 c0 rjmp .+226 ; 0xec94 mp_cmd_active = 1; ebb2: 90 92 1a 03 sts 0x031A, r9 ; 0x80031a mp_cmd_count = 0; ebb6: 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}; ebba: 1f 8e std Y+31, r1 ; 0x1f ebbc: 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) { ebbe: 80 90 1e 03 lds r8, 0x031E ; 0x80031e ebc2: 88 20 and r8, r8 ebc4: 21 f2 breq .-120 ; 0xeb4e 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]; ebc6: 80 91 1c 03 lds r24, 0x031C ; 0x80031c ebca: 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) ebcc: f1 e0 ldi r31, 0x01 ; 1 ebce: f8 15 cp r31, r8 ebd0: 18 f4 brcc .+6 ; 0xebd8 out[i] = (char)mp_char_out_buf[i]; ebd2: 80 91 1d 03 lds r24, 0x031D ; 0x80031d ebd6: 88 a3 std Y+32, r24 ; 0x20 mp_char_out_count = 0; ebd8: 10 92 1e 03 sts 0x031E, r1 ; 0x80031e ebdc: 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]; ebde: 82 2d mov r24, r2 ebe0: 8c 19 sub r24, r12 ebe2: 88 15 cp r24, r8 ebe4: 08 f0 brcs .+2 ; 0xebe8 ebe6: b3 cf rjmp .-154 ; 0xeb4e ebe8: f1 01 movw r30, r2 ebea: 11 91 ld r17, Z+ ebec: 1f 01 movw r2, r30 #else char serial_char = MYSERIAL.read(); #endif serialTimeoutTimer.start(); ebee: 81 e2 ldi r24, 0x21 ; 33 ebf0: 93 e0 ldi r25, 0x03 ; 3 ebf2: 0f 94 5e 10 call 0x220bc ; 0x220bc ::start()> if (serial_char < 0) ebf6: 17 fd sbrc r17, 7 ebf8: f2 cf rjmp .-28 ; 0xebde ebfa: 80 91 da 0f lds r24, 0x0FDA ; 0x800fda ebfe: 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' || ec02: 1a 30 cpi r17, 0x0A ; 10 ec04: 09 f4 brne .+2 ; 0xec08 ec06: 4b c1 rjmp .+662 ; 0xee9e ec08: 1d 30 cpi r17, 0x0D ; 13 ec0a: 09 f4 brne .+2 ; 0xec0e ec0c: 48 c1 rjmp .+656 ; 0xee9e serial_char == '\r' || ec0e: 8f 35 cpi r24, 0x5F ; 95 ec10: 91 05 cpc r25, r1 ec12: 0c f0 brlt .+2 ; 0xec16 ec14: 49 c1 rjmp .+658 ; 0xeea8 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; ec16: 1b 33 cpi r17, 0x3B ; 59 ec18: 11 f4 brne .+4 ; 0xec1e ec1a: 90 92 20 03 sts 0x0320, r9 ; 0x800320 if(!comment_mode) cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; ec1e: 20 91 20 03 lds r18, 0x0320 ; 0x800320 ec22: 21 11 cpse r18, r1 ec24: dc cf rjmp .-72 ; 0xebde ec26: 9c 01 movw r18, r24 ec28: 2f 5f subi r18, 0xFF ; 255 ec2a: 3f 4f sbci r19, 0xFF ; 255 ec2c: 30 93 db 0f sts 0x0FDB, r19 ; 0x800fdb ec30: 20 93 da 0f sts 0x0FDA, r18 ; 0x800fda ec34: 20 91 dc 0f lds r18, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> ec38: 30 91 dd 0f lds r19, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> ec3c: 22 52 subi r18, 0x22 ; 34 ec3e: 30 4f sbci r19, 0xF0 ; 240 ec40: 82 0f add r24, r18 ec42: 93 1f adc r25, r19 ec44: fc 01 movw r30, r24 ec46: 13 83 std Z+3, r17 ; 0x03 ec48: ca cf rjmp .-108 ; 0xebde #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { ec4a: 80 91 da 0f lds r24, 0x0FDA ; 0x800fda ec4e: 90 91 db 0f lds r25, 0x0FDB ; 0x800fdb ec52: 18 16 cp r1, r24 ec54: 19 06 cpc r1, r25 ec56: 0c f4 brge .+2 ; 0xec5a ec58: 51 c2 rjmp .+1186 ; 0xf0fc SERIAL_ECHOLNPGM("RX timeout"); return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ ec5a: 80 91 6a 13 lds r24, 0x136A ; 0x80136a ec5e: 81 11 cpse r24, r1 ec60: 67 c2 rjmp .+1230 ; 0xf130 prusa_statistics(6); } } #endif //SDSUPPORT } ec62: a0 96 adiw r28, 0x20 ; 32 ec64: 0f b6 in r0, 0x3f ; 63 ec66: f8 94 cli ec68: de bf out 0x3e, r29 ; 62 ec6a: 0f be out 0x3f, r0 ; 63 ec6c: cd bf out 0x3d, r28 ; 61 ec6e: df 91 pop r29 ec70: cf 91 pop r28 ec72: 1f 91 pop r17 ec74: 0f 91 pop r16 ec76: ff 90 pop r15 ec78: ef 90 pop r14 ec7a: df 90 pop r13 ec7c: cf 90 pop r12 ec7e: bf 90 pop r11 ec80: af 90 pop r10 ec82: 9f 90 pop r9 ec84: 8f 90 pop r8 ec86: 7f 90 pop r7 ec88: 6f 90 pop r6 ec8a: 5f 90 pop r5 ec8c: 4f 90 pop r4 ec8e: 3f 90 pop r3 ec90: 2f 90 pop r2 ec92: 08 95 ret if (mp_cmd_count > 0) { mp_cmd_active = 1; mp_cmd_count = 0; } else ++mp_cmd_count; ec94: 90 92 1b 03 sts 0x031B, r9 ; 0x80031b ec98: 90 cf rjmp .-224 ; 0xebba return; } if (mp_cmd_active > 0) { ec9a: 90 91 1a 03 lds r25, 0x031A ; 0x80031a ec9e: 99 23 and r25, r25 eca0: 09 f4 brne .+2 ; 0xeca4 eca2: 58 c0 rjmp .+176 ; 0xed54 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { eca4: 89 3f cpi r24, 0xF9 ; 249 eca6: e9 f1 breq .+122 ; 0xed22 eca8: 70 f5 brcc .+92 ; 0xed06 ecaa: 86 3f cpi r24, 0xF6 ; 246 ecac: 09 f4 brne .+2 ; 0xecb0 ecae: 4a c0 rjmp .+148 ; 0xed44 ecb0: 87 3f cpi r24, 0xF7 ; 247 ecb2: 09 f4 brne .+2 ; 0xecb6 ecb4: 43 c0 rjmp .+134 ; 0xed3c 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. ecb6: 8b e5 ldi r24, 0x5B ; 91 ecb8: 92 e7 ldi r25, 0x72 ; 114 ecba: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 // 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); ecbe: 86 e5 ldi r24, 0x56 ; 86 ecc0: 92 e7 ldi r25, 0x72 ; 114 ecc2: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 // Echo current state if (mp_config & MPConfig_Active) ecc6: 10 91 19 03 lds r17, 0x0319 ; 0x800319 SERIAL_ECHOPGM(" ON"); ecca: 82 e5 ldi r24, 0x52 ; 82 eccc: 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) ecce: 10 fd sbrc r17, 0 ecd0: 02 c0 rjmp .+4 ; 0xecd6 SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); ecd2: 8d e4 ldi r24, 0x4D ; 77 ecd4: 92 e7 ldi r25, 0x72 ; 114 ecd6: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 if (mp_config & MPConfig_NoSpaces) ecda: 01 2f mov r16, r17 ecdc: 02 70 andi r16, 0x02 ; 2 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces ecde: 88 e4 ldi r24, 0x48 ; 72 ece0: 92 e7 ldi r25, 0x72 ; 114 if (mp_config & MPConfig_Active) SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); if (mp_config & MPConfig_NoSpaces) ece2: 11 fd sbrc r17, 1 ece4: 02 c0 rjmp .+4 ; 0xecea SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces else SERIAL_ECHOPGM(" ESP"); // [E]nabled [SP]aces ece6: 83 e4 ldi r24, 0x43 ; 67 ece8: 92 e7 ldi r25, 0x72 ; 114 ecea: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLNPGM(""); ecee: 82 e4 ldi r24, 0x42 ; 66 ecf0: 92 e7 ldi r25, 0x72 ; 114 ecf2: 0e 94 49 72 call 0xe492 ; 0xe492 // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) ecf6: 00 23 and r16, r16 ecf8: 49 f1 breq .+82 ; 0xed4c MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); ecfa: 85 e4 ldi r24, 0x45 ; 69 ecfc: 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; ed00: 10 92 1a 03 sts 0x031A, r1 ; 0x80031a ed04: 5a cf rjmp .-332 ; 0xebba } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { ed06: 8a 3f cpi r24, 0xFA ; 250 ed08: 41 f0 breq .+16 ; 0xed1a ed0a: 8b 3f cpi r24, 0xFB ; 251 ed0c: a1 f6 brne .-88 ; 0xecb6 case MPCommand_EnablePacking: { mp_config |= MPConfig_Active; ed0e: 80 91 19 03 lds r24, 0x0319 ; 0x800319 ed12: 81 60 ori r24, 0x01 ; 1 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); ed14: 80 93 19 03 sts 0x0319, r24 ; 0x800319 ed18: ce cf rjmp .-100 ; 0xecb6 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL REC"); #endif } break; case MPCommand_DisablePacking: { mp_config &= ~(MPConfig_Active); ed1a: 80 91 19 03 lds r24, 0x0319 ; 0x800319 ed1e: 8e 7f andi r24, 0xFE ; 254 ed20: f9 cf rjmp .-14 ; 0xed14 return out; } //============================================================================== void FORCE_INLINE mp_reset_state() { mp_char_out_count = 0; ed22: 10 92 1e 03 sts 0x031E, r1 ; 0x80031e mp_cmd_active = MPCommand_None; ed26: 10 92 1a 03 sts 0x031A, r1 ; 0x80031a mp_config = MPConfig_None; ed2a: 10 92 19 03 sts 0x0319, r1 ; 0x800319 mp_char_buf = 0; ed2e: 10 92 18 03 sts 0x0318, r1 ; 0x800318 mp_cmd_count = 0; ed32: 10 92 1b 03 sts 0x031B, r1 ; 0x80031b mp_cmd_active = 0; mp_full_char_queue = 0; ed36: 10 92 17 03 sts 0x0317, r1 ; 0x800317 ed3a: bd cf rjmp .-134 ; 0xecb6 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] RESET REC"); #endif } break; case MPCommand_EnableNoSpaces: { mp_config |= MPConfig_NoSpaces; ed3c: 80 91 19 03 lds r24, 0x0319 ; 0x800319 ed40: 82 60 ori r24, 0x02 ; 2 ed42: e8 cf rjmp .-48 ; 0xed14 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); ed44: 80 91 19 03 lds r24, 0x0319 ; 0x800319 ed48: 8d 7f andi r24, 0xFD ; 253 ed4a: e4 cf rjmp .-56 ; 0xed14 // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); else MeatPackLookupTbl[MeatPack_SpaceCharIdx] = ' '; ed4c: 90 e2 ldi r25, 0x20 ; 32 ed4e: 90 93 0b 02 sts 0x020B, r25 ; 0x80020b <__DATA_REGION_ORIGIN__+0xb> ed52: d6 cf rjmp .-84 ; 0xed00 mp_handle_cmd((MeatPack_Command)c); mp_cmd_active = 0; return; } if (mp_cmd_count > 0) { ed54: 90 91 1b 03 lds r25, 0x031B ; 0x80031b ed58: 30 91 19 03 lds r19, 0x0319 ; 0x800319 ed5c: 99 23 and r25, r25 ed5e: 31 f1 breq .+76 ; 0xedac ed60: 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) { ed64: 30 ff sbrs r19, 0 ed66: 49 c0 rjmp .+146 ; 0xedfa if (mp_full_char_queue > 0) { ed68: 20 91 17 03 lds r18, 0x0317 ; 0x800317 ed6c: 22 23 and r18, r18 ed6e: 09 f4 brne .+2 ; 0xed72 ed70: 40 c0 rjmp .+128 ; 0xedf2 #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; ed72: 91 e0 ldi r25, 0x01 ; 1 ed74: 9e 0f add r25, r30 ed76: 90 93 1e 03 sts 0x031E, r25 ; 0x80031e ed7a: ae 2f mov r26, r30 ed7c: b0 e0 ldi r27, 0x00 ; 0 ed7e: a4 5e subi r26, 0xE4 ; 228 ed80: bc 4f sbci r27, 0xFC ; 252 ed82: ff ef ldi r31, 0xFF ; 255 ed84: 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) { ed86: 40 91 18 03 lds r20, 0x0318 ; 0x800318 ed8a: 44 23 and r20, r20 ed8c: 51 f0 breq .+20 ; 0xeda2 #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; ed8e: ee 5f subi r30, 0xFE ; 254 ed90: e0 93 1e 03 sts 0x031E, r30 ; 0x80031e ed94: e9 2f mov r30, r25 ed96: f0 e0 ldi r31, 0x00 ; 0 ed98: e4 5e subi r30, 0xE4 ; 228 ed9a: fc 4f sbci r31, 0xFC ; 252 ed9c: 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; ed9e: 10 92 18 03 sts 0x0318, r1 ; 0x800318 } --mp_full_char_queue; eda2: 21 50 subi r18, 0x01 ; 1 eda4: 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; eda8: 10 92 1b 03 sts 0x031B, r1 ; 0x80031b edac: 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) { edb0: 30 ff sbrs r19, 0 edb2: 6c c0 rjmp .+216 ; 0xee8c if (mp_full_char_queue > 0) { edb4: 90 91 17 03 lds r25, 0x0317 ; 0x800317 edb8: 99 23 and r25, r25 edba: 49 f1 breq .+82 ; 0xee0e #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; edbc: 21 e0 ldi r18, 0x01 ; 1 edbe: 2e 0f add r18, r30 edc0: 20 93 1e 03 sts 0x031E, r18 ; 0x80031e edc4: ae 2f mov r26, r30 edc6: b0 e0 ldi r27, 0x00 ; 0 edc8: a4 5e subi r26, 0xE4 ; 228 edca: bc 4f sbci r27, 0xFC ; 252 edcc: 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) { edce: 80 91 18 03 lds r24, 0x0318 ; 0x800318 edd2: 88 23 and r24, r24 edd4: 51 f0 breq .+20 ; 0xedea #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; edd6: ee 5f subi r30, 0xFE ; 254 edd8: e0 93 1e 03 sts 0x031E, r30 ; 0x80031e eddc: e2 2f mov r30, r18 edde: f0 e0 ldi r31, 0x00 ; 0 ede0: e4 5e subi r30, 0xE4 ; 228 ede2: fc 4f sbci r31, 0xFC ; 252 ede4: 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; ede6: 10 92 18 03 sts 0x0318, r1 ; 0x800318 } --mp_full_char_queue; edea: 91 50 subi r25, 0x01 ; 1 edec: 90 93 17 03 sts 0x0317, r25 ; 0x800317 edf0: e4 ce rjmp .-568 ; 0xebba 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; edf2: 42 e0 ldi r20, 0x02 ; 2 edf4: 40 93 17 03 sts 0x0317, r20 ; 0x800317 edf8: d7 cf rjmp .-82 ; 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; edfa: 91 e0 ldi r25, 0x01 ; 1 edfc: 9e 0f add r25, r30 edfe: 90 93 1e 03 sts 0x031E, r25 ; 0x80031e ee02: f0 e0 ldi r31, 0x00 ; 0 ee04: e4 5e subi r30, 0xE4 ; 228 ee06: fc 4f sbci r31, 0xFC ; 252 ee08: 9f ef ldi r25, 0xFF ; 255 ee0a: 90 83 st Z, r25 ee0c: cd cf rjmp .-102 ; 0xeda8 ee0e: a8 2f mov r26, r24 ee10: af 70 andi r26, 0x0F ; 15 mp_char_buf = 0; } --mp_full_char_queue; } else { uint8_t buf[2] = { 0,0 }; ee12: 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; ee14: 21 e0 ldi r18, 0x01 ; 1 ee16: af 30 cpi r26, 0x0F ; 15 ee18: 29 f0 breq .+10 ; 0xee24 ee1a: b0 e0 ldi r27, 0x00 ; 0 else chars_out[0] = MeatPackLookupTbl[(pk & 0xF)]; // Assign lower char ee1c: a0 50 subi r26, 0x00 ; 0 ee1e: be 4f sbci r27, 0xFE ; 254 ee20: 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; ee22: 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; ee24: 48 2f mov r20, r24 ee26: 40 7f andi r20, 0xF0 ; 240 ee28: 40 3f cpi r20, 0xF0 ; 240 ee2a: 59 f4 brne .+22 ; 0xee42 ee2c: 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) { ee2e: 20 ff sbrs r18, 0 ee30: 13 c0 rjmp .+38 ; 0xee58 ++mp_full_char_queue; ee32: 90 92 17 03 sts 0x0317, r9 ; 0x800317 if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; ee36: 21 ff sbrs r18, 1 ee38: 0c c0 rjmp .+24 ; 0xee52 ee3a: e2 e0 ldi r30, 0x02 ; 2 ee3c: e0 93 17 03 sts 0x0317, r30 ; 0x800317 ee40: bc ce rjmp .-648 ; 0xebba 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 ee42: 82 95 swap r24 ee44: 8f 70 andi r24, 0x0F ; 15 ee46: a8 2f mov r26, r24 ee48: b0 e0 ldi r27, 0x00 ; 0 ee4a: a0 50 subi r26, 0x00 ; 0 ee4c: be 4f sbci r27, 0xFE ; 254 ee4e: 9c 91 ld r25, X ee50: ee cf rjmp .-36 ; 0xee2e 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]; ee52: 90 93 18 03 sts 0x0318, r25 ; 0x800318 ee56: b1 ce rjmp .-670 ; 0xebba #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; ee58: 81 e0 ldi r24, 0x01 ; 1 ee5a: 8e 0f add r24, r30 ee5c: 80 93 1e 03 sts 0x031E, r24 ; 0x80031e ee60: ae 2f mov r26, r30 ee62: b0 e0 ldi r27, 0x00 ; 0 ee64: a4 5e subi r26, 0xE4 ; 228 ee66: bc 4f sbci r27, 0xFC ; 252 ee68: 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') { ee6a: 3a 30 cpi r19, 0x0A ; 10 ee6c: 09 f4 brne .+2 ; 0xee70 ee6e: a5 ce rjmp .-694 ; 0xebba if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; ee70: 21 ff sbrs r18, 1 ee72: 03 c0 rjmp .+6 ; 0xee7a ee74: 90 92 17 03 sts 0x0317, r9 ; 0x800317 ee78: a0 ce rjmp .-704 ; 0xebba #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; ee7a: ee 5f subi r30, 0xFE ; 254 ee7c: e0 93 1e 03 sts 0x031E, r30 ; 0x80031e ee80: e8 2f mov r30, r24 ee82: f0 e0 ldi r31, 0x00 ; 0 ee84: e4 5e subi r30, 0xE4 ; 228 ee86: fc 4f sbci r31, 0xFC ; 252 ee88: 90 83 st Z, r25 ee8a: 97 ce rjmp .-722 ; 0xebba ee8c: 91 e0 ldi r25, 0x01 ; 1 ee8e: 9e 0f add r25, r30 ee90: 90 93 1e 03 sts 0x031E, r25 ; 0x80031e ee94: f0 e0 ldi r31, 0x00 ; 0 ee96: e4 5e subi r30, 0xE4 ; 228 ee98: fc 4f sbci r31, 0xFC ; 252 ee9a: 80 83 st Z, r24 ee9c: 8e ce rjmp .-740 ; 0xebba continue; if(serial_char == '\n' || serial_char == '\r' || serial_count >= (MAX_CMD_SIZE - 1) ) { if(!serial_count) { //if empty line ee9e: 00 97 sbiw r24, 0x00 ; 0 eea0: 19 f4 brne .+6 ; 0xeea8 comment_mode = false; //for new command eea2: 10 92 20 03 sts 0x0320, r1 ; 0x800320 eea6: dd ce rjmp .-582 ; 0xec62 eea8: 00 91 dc 0f lds r16, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> eeac: 10 91 dd 0f lds r17, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> return; } cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; // terminate string eeb0: 0f 51 subi r16, 0x1F ; 31 eeb2: 10 4f sbci r17, 0xF0 ; 240 eeb4: 80 0f add r24, r16 eeb6: 91 1f adc r25, r17 eeb8: fc 01 movw r30, r24 eeba: 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) eebc: 1a 83 std Y+2, r17 ; 0x02 eebe: 09 83 std Y+1, r16 ; 0x01 if(!comment_mode){ eec0: 80 91 20 03 lds r24, 0x0320 ; 0x800320 eec4: 81 11 cpse r24, r1 eec6: fd c0 rjmp .+506 ; 0xf0c2 long gcode_N = -1; // seen line number // Line numbers must be first in buffer if (*cmd_head == 'N') { eec8: f8 01 movw r30, r16 eeca: 80 81 ld r24, Z eecc: 8e 34 cpi r24, 0x4E ; 78 eece: 09 f0 breq .+2 ; 0xeed2 eed0: 84 c0 rjmp .+264 ; 0xefda // Line number met: decode the number, then move cmd_start past all spaces. gcode_N = (strtol(cmd_head+1, &cmd_start, 10)); eed2: 4a e0 ldi r20, 0x0A ; 10 eed4: 50 e0 ldi r21, 0x00 ; 0 eed6: be 01 movw r22, r28 eed8: 6f 5f subi r22, 0xFF ; 255 eeda: 7f 4f sbci r23, 0xFF ; 255 eedc: c8 01 movw r24, r16 eede: 01 96 adiw r24, 0x01 ; 1 eee0: 0f 94 26 9c call 0x3384c ; 0x3384c eee4: 2b 01 movw r4, r22 eee6: 3c 01 movw r6, r24 while (*cmd_start == ' ') ++cmd_start; eee8: e9 80 ldd r14, Y+1 ; 0x01 eeea: fa 80 ldd r15, Y+2 ; 0x02 eeec: f7 01 movw r30, r14 eeee: 80 81 ld r24, Z eef0: 80 32 cpi r24, 0x20 ; 32 eef2: 31 f4 brne .+12 ; 0xef00 eef4: ff ef ldi r31, 0xFF ; 255 eef6: ef 1a sub r14, r31 eef8: ff 0a sbc r15, r31 eefa: fa 82 std Y+2, r15 ; 0x02 eefc: e9 82 std Y+1, r14 ; 0x01 eefe: f4 cf rjmp .-24 ; 0xeee8 // 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)) { ef00: 80 91 d1 11 lds r24, 0x11D1 ; 0x8011d1 ef04: 90 91 d2 11 lds r25, 0x11D2 ; 0x8011d2 ef08: a0 91 d3 11 lds r26, 0x11D3 ; 0x8011d3 ef0c: b0 91 d4 11 lds r27, 0x11D4 ; 0x8011d4 ef10: 01 96 adiw r24, 0x01 ; 1 ef12: a1 1d adc r26, r1 ef14: b1 1d adc r27, r1 ef16: 84 15 cp r24, r4 ef18: 95 05 cpc r25, r5 ef1a: a6 05 cpc r26, r6 ef1c: b7 05 cpc r27, r7 ef1e: 49 f0 breq .+18 ; 0xef32 ef20: 44 e0 ldi r20, 0x04 ; 4 ef22: 50 e0 ldi r21, 0x00 ; 0 ef24: 6b e8 ldi r22, 0x8B ; 139 ef26: 72 e7 ldi r23, 0x72 ; 114 ef28: c7 01 movw r24, r14 ef2a: 0f 94 7a 9e call 0x33cf4 ; 0x33cf4 ef2e: 89 2b or r24, r25 ef30: a1 f4 brne .+40 ; 0xef5a FlushSerialRequestResend(); serial_count = 0; return; } if((strchr_pointer = strchr(cmd_start, '*')) != NULL) ef32: 6a e2 ldi r22, 0x2A ; 42 ef34: 70 e0 ldi r23, 0x00 ; 0 ef36: c7 01 movw r24, r14 ef38: 0f 94 f2 a6 call 0x34de4 ; 0x34de4 ef3c: 90 93 f6 16 sts 0x16F6, r25 ; 0x8016f6 ef40: 80 93 f5 16 sts 0x16F5, r24 ; 0x8016f5 ef44: 00 97 sbiw r24, 0x00 ; 0 ef46: 09 f4 brne .+2 ; 0xef4a ef48: 41 c0 rjmp .+130 ; 0xefcc ef4a: f8 01 movw r30, r16 { byte checksum = 0; ef4c: f1 2c mov r15, r1 char *p = cmd_head; while (p != strchr_pointer) ef4e: 8e 17 cp r24, r30 ef50: 9f 07 cpc r25, r31 ef52: f1 f0 breq .+60 ; 0xef90 checksum = checksum^(*p++); ef54: 21 91 ld r18, Z+ ef56: f2 26 eor r15, r18 ef58: fa cf rjmp .-12 ; 0xef4e 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; ef5a: 84 e4 ldi r24, 0x44 ; 68 ef5c: 9d e9 ldi r25, 0x9D ; 157 ef5e: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ERRORRPGM(_n("Line Number is not Last Line Number+1, Last Line: "));////MSG_ERR_LINE_NO ef62: 80 e2 ldi r24, 0x20 ; 32 ef64: 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 ef66: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 ef6a: 60 91 d1 11 lds r22, 0x11D1 ; 0x8011d1 ef6e: 70 91 d2 11 lds r23, 0x11D2 ; 0x8011d2 ef72: 80 91 d3 11 lds r24, 0x11D3 ; 0x8011d3 ef76: 90 91 d4 11 lds r25, 0x11D4 ; 0x8011d4 ef7a: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 } void MarlinSerial::println(long n, int base) { print(n, base); println(); ef7e: 0f 94 bb 98 call 0x33176 ; 0x33176 SERIAL_ERRORLN(gcode_LastN); FlushSerialRequestResend(); ef82: 0e 94 e2 54 call 0xa9c4 ; 0xa9c4 serial_count = 0; ef86: 10 92 db 0f sts 0x0FDB, r1 ; 0x800fdb ef8a: 10 92 da 0f sts 0x0FDA, r1 ; 0x800fda ef8e: 69 ce rjmp .-814 ; 0xec62 { byte checksum = 0; char *p = cmd_head; while (p != strchr_pointer) checksum = checksum^(*p++); if (code_value_short() != (int16_t)checksum) { ef90: 0e 94 4d 55 call 0xaa9a ; 0xaa9a ef94: f8 16 cp r15, r24 ef96: 19 06 cpc r1, r25 ef98: 39 f0 breq .+14 ; 0xefa8 SERIAL_ERROR_START; ef9a: 84 e4 ldi r24, 0x44 ; 68 ef9c: 9d e9 ldi r25, 0x9D ; 157 ef9e: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ERRORRPGM(_n("checksum mismatch, Last Line: "));////MSG_ERR_CHECKSUM_MISMATCH efa2: 81 e0 ldi r24, 0x01 ; 1 efa4: 93 e6 ldi r25, 0x63 ; 99 efa6: df cf rjmp .-66 ; 0xef66 FlushSerialRequestResend(); serial_count = 0; return; } // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; efa8: e0 91 f5 16 lds r30, 0x16F5 ; 0x8016f5 efac: f0 91 f6 16 lds r31, 0x16F6 ; 0x8016f6 efb0: 10 82 st Z, r1 return; } } // Handle KILL early, even when Stopped if(strcmp_P(cmd_start, PSTR("M112")) == 0) efb2: e9 80 ldd r14, Y+1 ; 0x01 efb4: fa 80 ldd r15, Y+2 ; 0x02 efb6: 66 e8 ldi r22, 0x86 ; 134 efb8: 72 e7 ldi r23, 0x72 ; 114 efba: c7 01 movw r24, r14 efbc: 0f 94 49 9e call 0x33c92 ; 0x33c92 efc0: 89 2b or r24, r25 efc2: 39 f5 brne .+78 ; 0xf012 kill(MSG_M112_KILL); efc4: 87 e6 ldi r24, 0x67 ; 103 efc6: 95 e6 ldi r25, 0x65 ; 101 efc8: 0e 94 d5 72 call 0xe5aa ; 0xe5aa // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; } else { SERIAL_ERROR_START; efcc: 84 e4 ldi r24, 0x44 ; 68 efce: 9d e9 ldi r25, 0x9D ; 157 efd0: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM efd4: 87 ed ldi r24, 0xD7 ; 215 efd6: 92 e6 ldi r25, 0x62 ; 98 efd8: c6 cf rjmp .-116 ; 0xef66 } } else { // move cmd_start past all spaces while (*cmd_start == ' ') ++cmd_start; efda: 89 81 ldd r24, Y+1 ; 0x01 efdc: 9a 81 ldd r25, Y+2 ; 0x02 efde: fc 01 movw r30, r24 efe0: 20 81 ld r18, Z efe2: 20 32 cpi r18, 0x20 ; 32 efe4: 21 f4 brne .+8 ; 0xefee efe6: 01 96 adiw r24, 0x01 ; 1 efe8: 9a 83 std Y+2, r25 ; 0x02 efea: 89 83 std Y+1, r24 ; 0x01 efec: f6 cf rjmp .-20 ; 0xefda // if we didn't receive 'N' but still see '*' if (strchr(cmd_start, '*') != NULL) efee: 6a e2 ldi r22, 0x2A ; 42 eff0: 70 e0 ldi r23, 0x00 ; 0 eff2: 0f 94 f2 a6 call 0x34de4 ; 0x34de4 eff6: 89 2b or r24, r25 eff8: 39 f0 breq .+14 ; 0xf008 { SERIAL_ERROR_START; effa: 84 e4 ldi r24, 0x44 ; 68 effc: 9d e9 ldi r25, 0x9D ; 157 effe: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ERRORRPGM(_n("No Line Number with checksum, Last Line: "));////MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM f002: 8d ea ldi r24, 0xAD ; 173 f004: 92 e6 ldi r25, 0x62 ; 98 f006: af cf rjmp .-162 ; 0xef66 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 f008: 44 24 eor r4, r4 f00a: 4a 94 dec r4 f00c: 54 2c mov r5, r4 f00e: 32 01 movw r6, r4 f010: d0 cf rjmp .-96 ; 0xefb2 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) f012: 44 e0 ldi r20, 0x04 ; 4 f014: 50 e0 ldi r21, 0x00 ; 0 f016: 61 e8 ldi r22, 0x81 ; 129 f018: 72 e7 ldi r23, 0x72 ; 114 f01a: c7 01 movw r24, r14 f01c: 0f 94 7a 9e call 0x33cf4 ; 0x33cf4 f020: 5c 01 movw r10, r24 allow_when_stopped = true; // Handle the USB timer if ((*cmd_start == 'G') && (GetPrinterState() != PrinterState::IsSDPrinting)) { f022: f7 01 movw r30, r14 f024: 80 81 ld r24, Z f026: 87 34 cpi r24, 0x47 ; 71 f028: 81 f4 brne .+32 ; 0xf04a f02a: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.367> f02e: 85 30 cpi r24, 0x05 ; 5 f030: 61 f0 breq .+24 ; 0xf04a usb_timer.start(); f032: 85 ed ldi r24, 0xD5 ; 213 f034: 91 e1 ldi r25, 0x11 ; 17 f036: 0f 94 5e 10 call 0x220bc ; 0x220bc ::start()> PrinterState GetPrinterState() { return printer_state; } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; f03a: f6 e0 ldi r31, 0x06 ; 6 f03c: 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); f040: 60 e0 ldi r22, 0x00 ; 0 f042: 85 ea ldi r24, 0xA5 ; 165 f044: 9f e0 ldi r25, 0x0F ; 15 f046: 0f 94 bf a0 call 0x3417e ; 0x3417e 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) { f04a: ab 28 or r10, r11 f04c: 21 f0 breq .+8 ; 0xf056 f04e: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce f052: 81 11 cpse r24, r1 f054: 98 cf rjmp .-208 ; 0xef86 } // 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; f056: 26 e0 ldi r18, 0x06 ; 6 f058: 77 fc sbrc r7, 7 f05a: 21 e0 ldi r18, 0x01 ; 1 f05c: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> f060: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f064: fc 01 movw r30, r24 f066: e2 52 subi r30, 0x22 ; 34 f068: f0 4f sbci r31, 0xF0 ; 240 f06a: 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) f06c: 49 81 ldd r20, Y+1 ; 0x01 f06e: 5a 81 ldd r21, Y+2 ; 0x02 cmd_len = strlen(cmd_start) + 1; f070: 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) f072: da 01 movw r26, r20 f074: 40 17 cp r20, r16 f076: 51 07 cpc r21, r17 f078: a1 f5 brne .+104 ; 0xf0e2 cmd_len = strlen(cmd_start) + 1; f07a: 01 90 ld r0, Z+ f07c: 00 20 and r0, r0 f07e: e9 f7 brne .-6 ; 0xf07a f080: 9f 01 movw r18, r30 f082: 20 1b sub r18, r16 f084: 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; f086: 03 96 adiw r24, 0x03 ; 3 f088: 28 0f add r18, r24 f08a: 39 1f adc r19, r25 if (bufindw == sizeof(cmdbuffer)) f08c: 2d 3e cpi r18, 0xED ; 237 f08e: f1 e0 ldi r31, 0x01 ; 1 f090: 3f 07 cpc r19, r31 f092: 79 f1 breq .+94 ; 0xf0f2 // 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; f094: 30 93 dd 0f sts 0x0FDD, r19 ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f098: 20 93 dc 0f sts 0x0FDC, r18 ; 0x800fdc <_ZL7bufindw.lto_priv.516> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; f09c: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf f0a0: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 f0a4: 01 96 adiw r24, 0x01 ; 1 f0a6: 90 93 d0 11 sts 0x11D0, r25 ; 0x8011d0 f0aa: 80 93 cf 11 sts 0x11CF, r24 ; 0x8011cf // Update the processed gcode line if (gcode_N >= 0) f0ae: 77 fc sbrc r7, 7 f0b0: 08 c0 rjmp .+16 ; 0xf0c2 gcode_LastN = gcode_N; f0b2: 40 92 d1 11 sts 0x11D1, r4 ; 0x8011d1 f0b6: 50 92 d2 11 sts 0x11D2, r5 ; 0x8011d2 f0ba: 60 92 d3 11 sts 0x11D3, r6 ; 0x8011d3 f0be: 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 f0c2: 10 92 db 0f sts 0x0FDB, r1 ; 0x800fdb f0c6: 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)) f0ca: 0e 94 c0 54 call 0xa980 ; 0xa980 f0ce: 89 2b or r24, r25 f0d0: 09 f4 brne .+2 ; 0xf0d4 f0d2: c7 cd rjmp .-1138 ; 0xec62 f0d4: 8f e5 ldi r24, 0x5F ; 95 f0d6: 90 e0 ldi r25, 0x00 ; 0 f0d8: 0e 94 bc 55 call 0xab78 ; 0xab78 f0dc: 81 11 cpse r24, r1 f0de: 7f cd rjmp .-1282 ; 0xebde f0e0: c0 cd rjmp .-1152 ; 0xec62 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]; } f0e2: 6d 91 ld r22, X+ f0e4: 61 93 st Z+, r22 f0e6: 9d 01 movw r18, r26 f0e8: 24 1b sub r18, r20 f0ea: 35 0b sbc r19, r21 while (cmd_head[cmd_len++]); f0ec: 61 11 cpse r22, r1 f0ee: f9 cf rjmp .-14 ; 0xf0e2 f0f0: ca cf rjmp .-108 ; 0xf086 } bufindw += cmd_len + CMDHDRSIZE; if (bufindw == sizeof(cmdbuffer)) bufindw = 0; f0f2: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f0f6: 10 92 dc 0f sts 0x0FDC, r1 ; 0x800fdc <_ZL7bufindw.lto_priv.516> f0fa: d0 cf rjmp .-96 ; 0xf09c #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { f0fc: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca f100: 60 e2 ldi r22, 0x20 ; 32 f102: 73 e0 ldi r23, 0x03 ; 3 f104: 81 11 cpse r24, r1 f106: 02 c0 rjmp .+4 ; 0xf10c f108: 60 ed ldi r22, 0xD0 ; 208 f10a: 77 e0 ldi r23, 0x07 ; 7 f10c: 81 e2 ldi r24, 0x21 ; 33 f10e: 93 e0 ldi r25, 0x03 ; 3 f110: 0f 94 2f 10 call 0x2205e ; 0x2205e ::expired(unsigned short)> f114: 88 23 and r24, r24 f116: 09 f4 brne .+2 ; 0xf11a f118: a0 cd rjmp .-1216 ; 0xec5a comment_mode = false; f11a: 10 92 20 03 sts 0x0320, r1 ; 0x800320 serial_count = 0; f11e: 10 92 db 0f sts 0x0FDB, r1 ; 0x800fdb f122: 10 92 da 0f sts 0x0FDA, r1 ; 0x800fda SERIAL_ECHOLNPGM("RX timeout"); f126: 86 e7 ldi r24, 0x76 ; 118 f128: 92 e7 ldi r25, 0x72 ; 114 f12a: 0e 94 49 72 call 0xe492 ; 0xe492 f12e: 99 cd rjmp .-1230 ; 0xec62 return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ f130: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd f134: 88 23 and r24, r24 f136: 09 f4 brne .+2 ; 0xf13a f138: 94 cd rjmp .-1240 ; 0xec62 f13a: 80 91 da 0f lds r24, 0x0FDA ; 0x800fda f13e: 90 91 db 0f lds r25, 0x0FDB ; 0x800fdb f142: 89 2b or r24, r25 f144: 09 f0 breq .+2 ; 0xf148 f146: 8d cd rjmp .-1254 ; 0xec62 //'#' 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; f148: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf f14c: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 f150: 89 2b or r24, r25 f152: 11 f4 brne .+4 ; 0xf158 f154: 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; f158: 12 e0 ldi r17, 0x02 ; 2 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; f15a: 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) { f15c: 40 91 7e 16 lds r20, 0x167E ; 0x80167e f160: 50 91 7f 16 lds r21, 0x167F ; 0x80167f f164: 60 91 80 16 lds r22, 0x1680 ; 0x801680 f168: 70 91 81 16 lds r23, 0x1681 ; 0x801681 f16c: 80 91 77 16 lds r24, 0x1677 ; 0x801677 f170: 90 91 78 16 lds r25, 0x1678 ; 0x801678 f174: a0 91 79 16 lds r26, 0x1679 ; 0x801679 f178: b0 91 7a 16 lds r27, 0x167A ; 0x80167a f17c: 48 17 cp r20, r24 f17e: 59 07 cpc r21, r25 f180: 6a 07 cpc r22, r26 f182: 7b 07 cpc r23, r27 f184: 08 f0 brcs .+2 ; 0xf188 f186: c1 c0 rjmp .+386 ; 0xf30a f188: 80 91 1f 03 lds r24, 0x031F ; 0x80031f f18c: 81 11 cpse r24, r1 f18e: bd c0 rjmp .+378 ; 0xf30a FORCE_INLINE bool isFileOpen() { return file.isOpen(); } bool eof() { return sdpos>=filesize; } FORCE_INLINE int16_t getFilteredGcodeChar() { int16_t c = (int16_t)file.readFilteredGcode(); f190: 0f 94 8d 49 call 0x2931a ; 0x2931a 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_;} f194: 40 91 02 16 lds r20, 0x1602 ; 0x801602 f198: 50 91 03 16 lds r21, 0x1603 ; 0x801603 f19c: 60 91 04 16 lds r22, 0x1604 ; 0x801604 f1a0: 70 91 05 16 lds r23, 0x1605 ; 0x801605 sdpos = file.curPosition(); f1a4: 40 93 7e 16 sts 0x167E, r20 ; 0x80167e f1a8: 50 93 7f 16 sts 0x167F, r21 ; 0x80167f f1ac: 60 93 80 16 sts 0x1680, r22 ; 0x801680 f1b0: 70 93 81 16 sts 0x1681, r23 ; 0x801681 f1b4: 20 91 da 0f lds r18, 0x0FDA ; 0x800fda f1b8: 30 91 db 0f lds r19, 0x0FDB ; 0x800fdb int16_t n=card.getFilteredGcodeChar(); char serial_char = (char)n; if( serial_char == '\n' f1bc: 8a 30 cpi r24, 0x0A ; 10 f1be: 61 f0 breq .+24 ; 0xf1d8 || serial_char == '\r' f1c0: 8d 30 cpi r24, 0x0D ; 13 f1c2: 51 f0 breq .+20 ; 0xf1d8 || serial_char == '#' f1c4: 83 32 cpi r24, 0x23 ; 35 f1c6: 09 f4 brne .+2 ; 0xf1ca f1c8: 87 c0 rjmp .+270 ; 0xf2d8 || serial_count >= (MAX_CMD_SIZE - 1) f1ca: 2f 35 cpi r18, 0x5F ; 95 f1cc: 31 05 cpc r19, r1 f1ce: 24 f4 brge .+8 ; 0xf1d8 || n==-1 f1d0: 8f 3f cpi r24, 0xFF ; 255 f1d2: 98 07 cpc r25, r24 f1d4: 09 f0 breq .+2 ; 0xf1d8 f1d6: 87 c0 rjmp .+270 ; 0xf2e6 ){ if(serial_char=='#') stop_buffering=true; if(!serial_count) f1d8: 21 15 cp r18, r1 f1da: 31 05 cpc r19, r1 f1dc: 09 f4 brne .+2 ; 0xf1e0 f1de: 41 cd rjmp .-1406 ; 0xec62 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); }; f1e0: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd f1e4: 81 11 cpse r24, r1 f1e6: 03 c0 rjmp .+6 ; 0xf1ee f1e8: 40 e0 ldi r20, 0x00 ; 0 f1ea: 50 e0 ldi r21, 0x00 ; 0 f1ec: 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; f1ee: 80 91 dc 11 lds r24, 0x11DC ; 0x8011dc f1f2: 90 91 dd 11 lds r25, 0x11DD ; 0x8011dd f1f6: 48 1b sub r20, r24 f1f8: 59 0b sbc r21, r25 cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_SDCARD; f1fa: a0 91 dc 0f lds r26, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> f1fe: b0 91 dd 0f lds r27, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f202: fd 01 movw r30, r26 f204: e2 52 subi r30, 0x22 ; 34 f206: f0 4f sbci r31, 0xF0 ; 240 f208: 10 83 st Z, r17 cmdbuffer[bufindw+1] = sd_count.lohi.lo; f20a: 41 83 std Z+1, r20 ; 0x01 cmdbuffer[bufindw+2] = sd_count.lohi.hi; f20c: 52 83 std Z+2, r21 ; 0x02 f20e: 13 96 adiw r26, 0x03 ; 3 cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string f210: 22 52 subi r18, 0x22 ; 34 f212: 30 4f sbci r19, 0xF0 ; 240 f214: f9 01 movw r30, r18 f216: ea 0f add r30, r26 f218: fb 1f adc r31, r27 f21a: 10 82 st Z, r1 // Calculate the length before disabling the interrupts. uint8_t len = strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE); f21c: a2 52 subi r26, 0x22 ; 34 f21e: b0 4f sbci r27, 0xF0 ; 240 f220: fd 01 movw r30, r26 f222: 01 90 ld r0, Z+ f224: 00 20 and r0, r0 f226: e9 f7 brne .-6 ; 0xf222 f228: 31 97 sbiw r30, 0x01 ; 1 f22a: ea 1b sub r30, r26 f22c: fb 0b sbc r31, r27 // MYSERIAL.print(cmdbuffer); // SERIAL_ECHOPGM("buflen:"); // MYSERIAL.print(buflen+1); sd_count.value = 0; cli(); f22e: 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; f230: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf f234: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 f238: 01 96 adiw r24, 0x01 ; 1 f23a: 90 93 d0 11 sts 0x11D0, r25 ; 0x8011d0 f23e: 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); f242: 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; f244: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> f248: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f24c: e8 0f add r30, r24 f24e: f9 2f mov r31, r25 f250: f1 1d adc r31, r1 f252: f0 93 dd 0f sts 0x0FDD, r31 ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f256: e0 93 dc 0f sts 0x0FDC, r30 ; 0x800fdc <_ZL7bufindw.lto_priv.516> f25a: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd f25e: 88 23 and r24, r24 f260: 09 f4 brne .+2 ; 0xf264 f262: 3d c0 rjmp .+122 ; 0xf2de f264: 80 91 7e 16 lds r24, 0x167E ; 0x80167e f268: 90 91 7f 16 lds r25, 0x167F ; 0x80167f f26c: a0 91 80 16 lds r26, 0x1680 ; 0x801680 f270: b0 91 81 16 lds r27, 0x1681 ; 0x801681 sdpos_atomic = card.get_sdpos(); f274: 80 93 dc 11 sts 0x11DC, r24 ; 0x8011dc f278: 90 93 dd 11 sts 0x11DD, r25 ; 0x8011dd f27c: a0 93 de 11 sts 0x11DE, r26 ; 0x8011de f280: b0 93 df 11 sts 0x11DF, r27 ; 0x8011df if (bufindw == sizeof(cmdbuffer)) f284: ed 3e cpi r30, 0xED ; 237 f286: f1 40 sbci r31, 0x01 ; 1 f288: 21 f4 brne .+8 ; 0xf292 bufindw = 0; f28a: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f28e: 10 92 dc 0f sts 0x0FDC, r1 ; 0x800fdc <_ZL7bufindw.lto_priv.516> sei(); f292: 78 94 sei comment_mode = false; //for new command f294: 10 92 20 03 sts 0x0320, r1 ; 0x800320 serial_count = 0; //clear buffer f298: 10 92 db 0f sts 0x0FDB, r1 ; 0x800fdb f29c: 10 92 da 0f sts 0x0FDA, r1 ; 0x800fda if(card.eof()) break; f2a0: 40 91 7e 16 lds r20, 0x167E ; 0x80167e f2a4: 50 91 7f 16 lds r21, 0x167F ; 0x80167f f2a8: 60 91 80 16 lds r22, 0x1680 ; 0x801680 f2ac: 70 91 81 16 lds r23, 0x1681 ; 0x801681 f2b0: 80 91 77 16 lds r24, 0x1677 ; 0x801677 f2b4: 90 91 78 16 lds r25, 0x1678 ; 0x801678 f2b8: a0 91 79 16 lds r26, 0x1679 ; 0x801679 f2bc: b0 91 7a 16 lds r27, 0x167A ; 0x80167a f2c0: 48 17 cp r20, r24 f2c2: 59 07 cpc r21, r25 f2c4: 6a 07 cpc r22, r26 f2c6: 7b 07 cpc r23, r27 f2c8: 00 f5 brcc .+64 ; 0xf30a // The following line will reserve buffer space if available. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1)) f2ca: 8f e5 ldi r24, 0x5F ; 95 f2cc: 90 e0 ldi r25, 0x00 ; 0 f2ce: 0e 94 bc 55 call 0xab78 ; 0xab78 f2d2: 81 11 cpse r24, r1 f2d4: 43 cf rjmp .-378 ; 0xf15c f2d6: c5 cc rjmp .-1654 ; 0xec62 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; f2d8: 00 93 1f 03 sts 0x031F, r16 ; 0x80031f f2dc: 7d cf rjmp .-262 ; 0xf1d8 f2de: 80 e0 ldi r24, 0x00 ; 0 f2e0: 90 e0 ldi r25, 0x00 ; 0 f2e2: dc 01 movw r26, r24 f2e4: c7 cf rjmp .-114 ; 0xf274 return; } else { // there are no comments coming from the filtered file cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; f2e6: a9 01 movw r20, r18 f2e8: 4f 5f subi r20, 0xFF ; 255 f2ea: 5f 4f sbci r21, 0xFF ; 255 f2ec: 50 93 db 0f sts 0x0FDB, r21 ; 0x800fdb f2f0: 40 93 da 0f sts 0x0FDA, r20 ; 0x800fda f2f4: 40 91 dc 0f lds r20, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> f2f8: 50 91 dd 0f lds r21, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f2fc: 42 52 subi r20, 0x22 ; 34 f2fe: 50 4f sbci r21, 0xF0 ; 240 f300: 24 0f add r18, r20 f302: 35 1f adc r19, r21 f304: f9 01 movw r30, r18 f306: 83 83 std Z+3, r24 ; 0x03 f308: 29 cf rjmp .-430 ; 0xf15c } } if(card.eof()) f30a: 40 91 7e 16 lds r20, 0x167E ; 0x80167e f30e: 50 91 7f 16 lds r21, 0x167F ; 0x80167f f312: 60 91 80 16 lds r22, 0x1680 ; 0x801680 f316: 70 91 81 16 lds r23, 0x1681 ; 0x801681 f31a: 80 91 77 16 lds r24, 0x1677 ; 0x801677 f31e: 90 91 78 16 lds r25, 0x1678 ; 0x801678 f322: a0 91 79 16 lds r26, 0x1679 ; 0x801679 f326: b0 91 7a 16 lds r27, 0x167A ; 0x80167a f32a: 48 17 cp r20, r24 f32c: 59 07 cpc r21, r25 f32e: 6a 07 cpc r22, r26 f330: 7b 07 cpc r23, r27 f332: 08 f4 brcc .+2 ; 0xf336 f334: 96 cc rjmp .-1748 ; 0xec62 { // 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()) f336: 0e 94 89 6f call 0xdf12 ; 0xdf12 f33a: 89 2b or r24, r25 f33c: 09 f0 breq .+2 ; 0xf340 f33e: 91 cc rjmp .-1758 ; 0xec62 { // queue is complete, but before we process EOF commands prevent // re-entry by disabling SD processing from any st_synchronize call card.closefile(); f340: 0f 94 9c 42 call 0x28538 ; 0x28538 SERIAL_PROTOCOLLNRPGM(_n("Done printing file"));////MSG_FILE_PRINTED f344: 8a e9 ldi r24, 0x9A ; 154 f346: 92 e6 ldi r25, 0x62 ; 98 f348: 0e 94 49 72 call 0xe492 ; 0xe492 char time[30]; uint32_t t = print_job_timer.duration() / 60; f34c: 0f 94 f2 1c call 0x239e4 ; 0x239e4 f350: 6b 01 movw r12, r22 f352: 7c 01 movw r14, r24 int hours, minutes; minutes = t % 60; hours = t / 60; save_statistics(); f354: 0e 94 2e 5f call 0xbe5c ; 0xbe5c // 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; f358: 8c e3 ldi r24, 0x3C ; 60 f35a: 88 2e mov r8, r24 f35c: 91 2c mov r9, r1 f35e: a1 2c mov r10, r1 f360: b1 2c mov r11, r1 f362: c7 01 movw r24, r14 f364: b6 01 movw r22, r12 f366: a5 01 movw r20, r10 f368: 94 01 movw r18, r8 f36a: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> int hours, minutes; minutes = t % 60; f36e: ca 01 movw r24, r20 f370: b9 01 movw r22, r18 f372: a5 01 movw r20, r10 f374: 94 01 movw r18, r8 f376: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> hours = t / 60; save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); f37a: 7f 93 push r23 f37c: 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; f37e: c7 01 movw r24, r14 f380: b6 01 movw r22, r12 f382: 20 e1 ldi r18, 0x10 ; 16 f384: 3e e0 ldi r19, 0x0E ; 14 f386: 40 e0 ldi r20, 0x00 ; 0 f388: 50 e0 ldi r21, 0x00 ; 0 f38a: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); f38e: 3f 93 push r19 f390: 2f 93 push r18 f392: 82 e6 ldi r24, 0x62 ; 98 f394: 92 e7 ldi r25, 0x72 ; 114 f396: 9f 93 push r25 f398: 8f 93 push r24 f39a: 8e 01 movw r16, r28 f39c: 0f 5f subi r16, 0xFF ; 255 f39e: 1f 4f sbci r17, 0xFF ; 255 f3a0: 1f 93 push r17 f3a2: 0f 93 push r16 f3a4: 0f 94 b2 9f call 0x33f64 ; 0x33f64 SERIAL_ECHO_START; f3a8: 81 e6 ldi r24, 0x61 ; 97 f3aa: 9d e9 ldi r25, 0x9D ; 157 f3ac: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLN(time); f3b0: c8 01 movw r24, r16 f3b2: 0f 94 bc 99 call 0x33378 ; 0x33378 #ifndef SHOW_FILENAME_AFTER_FINISH lcd_setstatus(time); f3b6: c8 01 movw r24, r16 f3b8: 0e 94 bb ef call 0x1df76 ; 0x1df76 #endif //SHOW_FILENAME_AFTER_FINISH card.printingHasFinished(); f3bc: 0f 94 fd 4d call 0x29bfa ; 0x29bfa if(!autostart_stilltocheck) return; if(autostart_atmillis.expired(5000)) return; } autostart_stilltocheck = false; f3c0: 10 92 56 02 sts 0x0256, r1 ; 0x800256 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.517> if(!mounted) f3c4: 0f b6 in r0, 0x3f ; 63 f3c6: f8 94 cli f3c8: de bf out 0x3e, r29 ; 62 f3ca: 0f be out 0x3f, r0 ; 63 f3cc: cd bf out 0x3d, r28 ; 61 f3ce: 80 91 6b 13 lds r24, 0x136B ; 0x80136b f3d2: 88 23 and r24, r24 f3d4: 59 f0 breq .+22 ; 0xf3ec f3d6: 0f 94 d0 44 call 0x289a0 ; 0x289a0 card.checkautostart(true); if (farm_mode) f3da: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca f3de: 88 23 and r24, r24 f3e0: 09 f4 brne .+2 ; 0xf3e4 f3e2: 3f cc rjmp .-1922 ; 0xec62 prusa_statistics(6); f3e4: 86 e0 ldi r24, 0x06 ; 6 f3e6: 0f 94 be 98 call 0x3317c ; 0x3317c f3ea: 3b cc rjmp .-1930 ; 0xec62 { mount(); f3ec: 81 e0 ldi r24, 0x01 ; 1 f3ee: 0f 94 3c 4e call 0x29c78 ; 0x29c78 if(!mounted) //fail f3f2: 80 91 6b 13 lds r24, 0x136B ; 0x80136b f3f6: 81 11 cpse r24, r1 f3f8: ee cf rjmp .-36 ; 0xf3d6 f3fa: ef cf rjmp .-34 ; 0xf3da 0000f3fc : } } #endif //SAFETYTIMER void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument set in Marlin.h { f3fc: 0f 93 push r16 f3fe: 1f 93 push r17 f400: cf 93 push r28 f402: df 93 push r29 f404: d8 2f mov r29, r24 WRITE(IR_SENSOR_PIN, 0); // no pullup state = State::disabled; } bool IR_sensor::update() { switch (state) { f406: 80 91 84 16 lds r24, 0x1684 ; 0x801684 f40a: 81 30 cpi r24, 0x01 ; 1 f40c: 09 f4 brne .+2 ; 0xf410 f40e: 49 c0 rjmp .+146 ; 0xf4a2 f410: 82 30 cpi r24, 0x02 ; 2 f412: 09 f4 brne .+2 ; 0xf416 f414: 4d c0 rjmp .+154 ; 0xf4b0 * * 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) f416: 0e 94 0f 61 call 0xc21e ; 0xc21e f41a: 81 11 cpse r24, r1 f41c: ec c0 rjmp .+472 ; 0xf5f6 f41e: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 f422: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 f426: 00 97 sbiw r24, 0x00 ; 0 f428: 39 f4 brne .+14 ; 0xf438 f42a: 20 91 ed 11 lds r18, 0x11ED ; 0x8011ed f42e: 30 91 ee 11 lds r19, 0x11EE ; 0x8011ee f432: 23 2b or r18, r19 f434: 09 f4 brne .+2 ; 0xf438 f436: df c0 rjmp .+446 ; 0xf5f6 f438: 40 91 33 02 lds r20, 0x0233 ; 0x800233 f43c: 50 91 34 02 lds r21, 0x0234 ; 0x800234 f440: 60 91 35 02 lds r22, 0x0235 ; 0x800235 f444: 70 91 36 02 lds r23, 0x0236 ; 0x800236 f448: 41 15 cp r20, r1 f44a: 51 05 cpc r21, r1 f44c: 61 05 cpc r22, r1 f44e: 71 05 cpc r23, r1 f450: 09 f4 brne .+2 ; 0xf454 f452: d1 c0 rjmp .+418 ; 0xf5f6 { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) f454: 89 2b or r24, r25 f456: 31 f4 brne .+12 ; 0xf464 f458: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed f45c: 90 91 ee 11 lds r25, 0x11EE ; 0x8011ee f460: 89 2b or r24, r25 f462: 29 f0 breq .+10 ; 0xf46e f464: 80 91 1a 06 lds r24, 0x061A ; 0x80061a f468: 88 23 and r24, r24 f46a: 09 f4 brne .+2 ; 0xf46e f46c: 2c c1 rjmp .+600 ; 0xf6c6 { safetyTimer.start(); } else if (safetyTimer.expired(farm_mode?FARM_DEFAULT_SAFETYTIMER_TIME_ms:safetytimer_inactive_time)) f46e: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca f472: 88 23 and r24, r24 f474: 21 f0 breq .+8 ; 0xf47e f476: 40 ee ldi r20, 0xE0 ; 224 f478: 52 e3 ldi r21, 0x32 ; 50 f47a: 69 e2 ldi r22, 0x29 ; 41 f47c: 70 e0 ldi r23, 0x00 ; 0 f47e: 8a e1 ldi r24, 0x1A ; 26 f480: 96 e0 ldi r25, 0x06 ; 6 f482: 0f 94 6a 10 call 0x220d4 ; 0x220d4 ::expired(unsigned long)> f486: 88 23 and r24, r24 f488: 09 f4 brne .+2 ; 0xf48c f48a: b7 c0 rjmp .+366 ; 0xf5fa { disable_heater(); f48c: 0f 94 e7 12 call 0x225ce ; 0x225ce lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_HEATING_SAFETY_DISABLED)); f490: 80 e6 ldi r24, 0x60 ; 96 f492: 96 e3 ldi r25, 0x36 ; 54 f494: 0e 94 a7 6c call 0xd94e ; 0xd94e f498: 0f 94 a9 0b call 0x21752 ; 0x21752 lcd_return_to_status(); f49c: 0e 94 6d fe call 0x1fcda ; 0x1fcda f4a0: ac c0 rjmp .+344 ; 0xf5fa case State::initializing: state = State::ready; // the IR sensor gets ready instantly as it's just a gpio read operation. f4a2: 82 e0 ldi r24, 0x02 ; 2 f4a4: 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(); f4a8: 0e 94 f9 c3 call 0x187f2 ; 0x187f2 f4ac: 80 93 87 16 sts 0x1687, r24 ; 0x801687 [[fallthrough]]; case State::ready: { postponedLoadEvent = false; f4b0: 10 92 88 16 sts 0x1688, r1 ; 0x801688 sensorActionOnError = SensorActionOnError::_Continue; } } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) f4b4: 80 91 84 16 lds r24, 0x1684 ; 0x801684 f4b8: 82 30 cpi r24, 0x02 ; 2 f4ba: 09 f0 breq .+2 ; 0xf4be f4bc: ac cf rjmp .-168 ; 0xf416 return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms f4be: 80 91 89 16 lds r24, 0x1689 ; 0x801689 f4c2: 81 11 cpse r24, r1 f4c4: 3d c0 rjmp .+122 ; 0xf540 return false; } bool newFilamentPresent = fsensor.getFilamentPresent(); f4c6: 0e 94 f9 c3 call 0x187f2 ; 0x187f2 f4ca: c8 2f mov r28, r24 if (oldFilamentPresent != newFilamentPresent) { f4cc: 80 91 87 16 lds r24, 0x1687 ; 0x801687 f4d0: c8 17 cp r28, r24 f4d2: 09 f4 brne .+2 ; 0xf4d6 f4d4: a0 cf rjmp .-192 ; 0xf416 oldFilamentPresent = newFilamentPresent; f4d6: c0 93 87 16 sts 0x1687, r28 ; 0x801687 eventBlankingTimer.start(); f4da: 89 e8 ldi r24, 0x89 ; 137 f4dc: 96 e1 ldi r25, 0x16 ; 22 f4de: 0f 94 5e 10 call 0x220bc ; 0x220bc ::start()> if (newFilamentPresent) { // filament insertion f4e2: cc 23 and r28, r28 f4e4: b1 f1 breq .+108 ; 0xf552 } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( f4e6: 80 91 85 16 lds r24, 0x1685 ; 0x801685 f4ea: 88 23 and r24, r24 f4ec: 11 f1 breq .+68 ; 0xf532 return false; } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) f4ee: 80 91 62 03 lds r24, 0x0362 ; 0x800362 f4f2: 81 11 cpse r24, r1 f4f4: 1e c0 rjmp .+60 ; 0xf532 && !( f4f6: 80 91 94 12 lds r24, 0x1294 ; 0x801294 f4fa: 81 30 cpi r24, 0x01 ; 1 f4fc: d1 f0 breq .+52 ; 0xf532 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); f4fe: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 f502: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 f506: 89 1b sub r24, r25 f508: 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 f50a: 99 f4 brne .+38 ; 0xf532 || printJobOngoing() f50c: 0e 94 be 60 call 0xc17c ; 0xc17c f510: 81 11 cpse r24, r1 f512: 0f c0 rjmp .+30 ; 0xf532 || (lcd_commands_type == LcdCommands::Layer1Cal) f514: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 f518: 84 30 cpi r24, 0x04 ; 4 f51a: 59 f0 breq .+22 ; 0xf532 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) f51c: 8f e5 ldi r24, 0x5F ; 95 f51e: 9f e0 ldi r25, 0x0F ; 15 f520: 0f 94 9b a0 call 0x34136 ; 0x34136 } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( f524: 81 11 cpse r24, r1 f526: 05 c0 rjmp .+10 ; 0xf532 || printJobOngoing() || (lcd_commands_type == LcdCommands::Layer1Cal) || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) ) ) { menu_submenu(lcd_AutoLoadFilament, true); f528: 61 e0 ldi r22, 0x01 ; 1 f52a: 83 e1 ldi r24, 0x13 ; 19 f52c: 98 e3 ldi r25, 0x38 ; 56 f52e: 0f 94 e8 94 call 0x329d0 ; 0x329d0 oldFilamentPresent = newFilamentPresent; eventBlankingTimer.start(); if (newFilamentPresent) { // filament insertion // puts_P(PSTR("filament inserted")); triggerFilamentInserted(); postponedLoadEvent = true; f532: 81 e0 ldi r24, 0x01 ; 1 f534: 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. f538: 81 e0 ldi r24, 0x01 ; 1 f53a: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b f53e: 6b cf rjmp .-298 ; 0xf416 } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms f540: 64 e6 ldi r22, 0x64 ; 100 f542: 70 e0 ldi r23, 0x00 ; 0 f544: 89 e8 ldi r24, 0x89 ; 137 f546: 96 e1 ldi r25, 0x16 ; 22 f548: 0f 94 2f 10 call 0x2205e ; 0x2205e ::expired(unsigned short)> f54c: 81 11 cpse r24, r1 f54e: bb cf rjmp .-138 ; 0xf4c6 f550: 62 cf rjmp .-316 ; 0xf416 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( f552: 80 91 86 16 lds r24, 0x1686 ; 0x801686 f556: 88 23 and r24, r24 f558: 79 f3 breq .-34 ; 0xf538 } void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled && (eFilamentAction == FilamentAction::None) f55a: 80 91 62 03 lds r24, 0x0362 ; 0x800362 f55e: 81 11 cpse r24, r1 f560: eb cf rjmp .-42 ; 0xf538 f562: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 f566: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 f56a: 89 1b sub r24, r25 f56c: 8f 70 andi r24, 0x0F ; 15 && ( f56e: 21 f4 brne .+8 ; 0xf578 moves_planned() != 0 || printJobOngoing() f570: 0e 94 be 60 call 0xc17c ; 0xc17c f574: 88 23 and r24, r24 f576: 01 f3 breq .-64 ; 0xf538 ) && !( f578: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 f57c: 81 11 cpse r24, r1 f57e: dc cf rjmp .-72 ; 0xf538 saved_printing || MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts just before the toolchange f580: 80 91 94 12 lds r24, 0x1294 ; 0x801294 f584: 81 30 cpi r24, 0x01 ; 1 f586: c1 f2 breq .-80 ; 0xf538 || (lcd_commands_type == LcdCommands::Layer1Cal) f588: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 f58c: 84 30 cpi r24, 0x04 ; 4 f58e: a1 f2 breq .-88 ; 0xf538 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) f590: 8f e5 ldi r24, 0x5F ; 95 f592: 9f e0 ldi r25, 0x0F ; 15 f594: 0f 94 9b a0 call 0x34136 ; 0x34136 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( f598: 81 11 cpse r24, r1 f59a: ce cf rjmp .-100 ; 0xf538 } //! @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); f59c: 88 e6 ldi r24, 0x68 ; 104 f59e: 94 e6 ldi r25, 0x64 ; 100 f5a0: 9f 93 push r25 f5a2: 8f 93 push r24 f5a4: 8e e4 ldi r24, 0x4E ; 78 f5a6: 94 e6 ldi r25, 0x64 ; 100 f5a8: 9f 93 push r25 f5aa: 8f 93 push r24 f5ac: 0f 94 5d 9f call 0x33eba ; 0x33eba void Filament_sensor::filRunout() { // SERIAL_ECHOLNPGM("filRunout"); sendHostNotification_P(MSG_FILAMENT_RUNOUT_DETECTED); runoutEnabled = false; f5b0: 10 92 86 16 sts 0x1686, r1 ; 0x801686 autoLoadEnabled = false; f5b4: 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; f5b8: 0f 90 pop r0 f5ba: 0f 90 pop r0 f5bc: 0f 90 pop r0 f5be: 0f 90 pop r0 f5c0: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 f5c4: 81 11 cpse r24, r1 f5c6: 05 c0 rjmp .+10 ; 0xf5d2 f5c8: 60 e0 ldi r22, 0x00 ; 0 f5ca: 70 e0 ldi r23, 0x00 ; 0 f5cc: cb 01 movw r24, r22 f5ce: 0f 94 a9 42 call 0x28552 ; 0x28552 stop_and_save_print_to_ram(0, 0); restore_print_from_ram_and_continue(0); f5d2: 60 e0 ldi r22, 0x00 ; 0 f5d4: 70 e0 ldi r23, 0x00 ; 0 f5d6: cb 01 movw r24, r22 f5d8: 0e 94 36 61 call 0xc26c ; 0xc26c eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); f5dc: 85 e6 ldi r24, 0x65 ; 101 f5de: 9f e0 ldi r25, 0x0F ; 15 f5e0: 0e 94 02 6f call 0xde04 ; 0xde04 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); f5e4: 81 e0 ldi r24, 0x01 ; 1 f5e6: 9f e0 ldi r25, 0x0F ; 15 f5e8: 0e 94 f5 6e call 0xddea ; 0xddea enquecommand_front_P(MSG_M600); f5ec: 8b e7 ldi r24, 0x7B ; 123 f5ee: 9b e6 ldi r25, 0x6B ; 107 f5f0: 0f 94 16 44 call 0x2882c ; 0x2882c f5f4: a1 cf rjmp .-190 ; 0xf538 inline constexpr Timer() : m_isRunning(false) , m_started(0) {}; void start(); void stop(){m_isRunning = false;} f5f6: 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)){ f5fa: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf f5fe: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 f602: 03 97 sbiw r24, 0x03 ; 3 f604: 14 f4 brge .+4 ; 0xf60a get_command(); f606: 0e 94 6f 75 call 0xeade ; 0xeade 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); f60a: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 f60e: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 } if (blocks_queued() && GetPrinterState() == PrinterState::IsHostPrinting && usb_timer.expired((USB_TIMER_TIMEOUT) / 2)) f612: 98 17 cp r25, r24 f614: 81 f0 breq .+32 ; 0xf636 f616: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.367> f61a: 86 30 cpi r24, 0x06 ; 6 f61c: 61 f4 brne .+24 ; 0xf636 f61e: 68 e8 ldi r22, 0x88 ; 136 f620: 73 e1 ldi r23, 0x13 ; 19 f622: 85 ed ldi r24, 0xD5 ; 213 f624: 91 e1 ldi r25, 0x11 ; 17 f626: 0f 94 2f 10 call 0x2205e ; 0x2205e ::expired(unsigned short)> f62a: 88 23 and r24, r24 f62c: 21 f0 breq .+8 ; 0xf636 { // 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(); f62e: 85 ed ldi r24, 0xD5 ; 213 f630: 91 e1 ldi r25, 0x11 ; 17 f632: 0f 94 5e 10 call 0x220bc ; 0x220bc ::start()> } if(max_inactive_time && previous_millis_cmd.expired(max_inactive_time)) f636: 40 91 46 03 lds r20, 0x0346 ; 0x800346 f63a: 50 91 47 03 lds r21, 0x0347 ; 0x800347 f63e: 60 91 48 03 lds r22, 0x0348 ; 0x800348 f642: 70 91 49 03 lds r23, 0x0349 ; 0x800349 f646: 41 15 cp r20, r1 f648: 51 05 cpc r21, r1 f64a: 61 05 cpc r22, r1 f64c: 71 05 cpc r23, r1 f64e: 09 f0 breq .+2 ; 0xf652 f650: 3f c0 rjmp .+126 ; 0xf6d0 kill(PSTR("Inactivity Shutdown")); if(stepper_inactive_time && previous_millis_cmd.expired(stepper_inactive_time)) { f652: 40 91 37 02 lds r20, 0x0237 ; 0x800237 f656: 50 91 38 02 lds r21, 0x0238 ; 0x800238 f65a: 60 91 39 02 lds r22, 0x0239 ; 0x800239 f65e: 70 91 3a 02 lds r23, 0x023A ; 0x80023a f662: 41 15 cp r20, r1 f664: 51 05 cpc r21, r1 f666: 61 05 cpc r22, r1 f668: 71 05 cpc r23, r1 f66a: a9 f0 breq .+42 ; 0xf696 f66c: 8a e4 ldi r24, 0x4A ; 74 f66e: 93 e0 ldi r25, 0x03 ; 3 f670: 0f 94 6a 10 call 0x220d4 ; 0x220d4 ::expired(unsigned long)> f674: 88 23 and r24, r24 f676: 79 f0 breq .+30 ; 0xf696 f678: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 f67c: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 if(blocks_queued() == false && ignore_stepper_queue == false) { f680: 98 13 cpse r25, r24 f682: 09 c0 rjmp .+18 ; 0xf696 f684: d1 11 cpse r29, r1 f686: 07 c0 rjmp .+14 ; 0xf696 disable_x(); f688: 17 9a sbi 0x02, 7 ; 2 f68a: 10 92 a3 06 sts 0x06A3, r1 ; 0x8006a3 disable_y(); f68e: 16 9a sbi 0x02, 6 ; 2 f690: 10 92 a4 06 sts 0x06A4, r1 ; 0x8006a4 disable_z(); disable_e0(); f694: 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; f696: c0 91 e9 11 lds r28, 0x11E9 ; 0x8011e9 block_t *block; if(block_buffer_tail != block_buffer_head) f69a: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 f69e: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 f6a2: 98 17 cp r25, r24 f6a4: 01 f1 breq .+64 ; 0xf6e6 { uint8_t block_index = block_buffer_tail; f6a6: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 tail_fan_speed = block_buffer[block_index].fan_speed; f6aa: 9e e6 ldi r25, 0x6E ; 110 f6ac: 89 9f mul r24, r25 f6ae: f0 01 movw r30, r0 f6b0: 11 24 eor r1, r1 f6b2: e2 5f subi r30, 0xF2 ; 242 f6b4: f8 4f sbci r31, 0xF8 ; 248 f6b6: c0 81 ld r28, Z while(block_index != block_buffer_head) f6b8: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 f6bc: 98 17 cp r25, r24 f6be: 99 f0 breq .+38 ; 0xf6e6 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); f6c0: 8f 5f subi r24, 0xFF ; 255 f6c2: 8f 70 andi r24, 0x0F ; 15 f6c4: f9 cf rjmp .-14 ; 0xf6b8 { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) { safetyTimer.start(); f6c6: 8a e1 ldi r24, 0x1A ; 26 f6c8: 96 e0 ldi r25, 0x06 ; 6 f6ca: 0f 94 29 12 call 0x22452 ; 0x22452 ::start()> f6ce: 95 cf rjmp .-214 ; 0xf5fa // 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)) f6d0: 8a e4 ldi r24, 0x4A ; 74 f6d2: 93 e0 ldi r25, 0x03 ; 3 f6d4: 0f 94 6a 10 call 0x220d4 ; 0x220d4 ::expired(unsigned long)> f6d8: 88 23 and r24, r24 f6da: 09 f4 brne .+2 ; 0xf6de f6dc: ba cf rjmp .-140 ; 0xf652 kill(PSTR("Inactivity Shutdown")); f6de: 80 eb ldi r24, 0xB0 ; 176 f6e0: 97 e7 ldi r25, 0x77 ; 119 f6e2: 0e 94 d5 72 call 0xe5aa ; 0xe5aa 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) { f6e6: cc 23 and r28, r28 f6e8: 09 f4 brne .+2 ; 0xf6ec f6ea: be c0 rjmp .+380 ; 0xf868 if (fan_kick_end == 0) { f6ec: 80 91 41 03 lds r24, 0x0341 ; 0x800341 f6f0: 90 91 42 03 lds r25, 0x0342 ; 0x800342 f6f4: a0 91 43 03 lds r26, 0x0343 ; 0x800343 f6f8: b0 91 44 03 lds r27, 0x0344 ; 0x800344 f6fc: 89 2b or r24, r25 f6fe: 8a 2b or r24, r26 f700: 8b 2b or r24, r27 f702: 81 f4 brne .+32 ; 0xf724 // Just starting up fan - run at full power. fan_kick_end = _millis() + FAN_KICKSTART_TIME; f704: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 f708: 60 5e subi r22, 0xE0 ; 224 f70a: 7c 4f sbci r23, 0xFC ; 252 f70c: 8f 4f sbci r24, 0xFF ; 255 f70e: 9f 4f sbci r25, 0xFF ; 255 f710: 60 93 41 03 sts 0x0341, r22 ; 0x800341 f714: 70 93 42 03 sts 0x0342, r23 ; 0x800342 f718: 80 93 43 03 sts 0x0343, r24 ; 0x800343 f71c: 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; f720: cf ef ldi r28, 0xFF ; 255 f722: 0f c0 rjmp .+30 ; 0xf742 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()) f724: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 f728: 00 91 41 03 lds r16, 0x0341 ; 0x800341 f72c: 10 91 42 03 lds r17, 0x0342 ; 0x800342 f730: 20 91 43 03 lds r18, 0x0343 ; 0x800343 f734: 30 91 44 03 lds r19, 0x0344 ; 0x800344 f738: 60 17 cp r22, r16 f73a: 71 07 cpc r23, r17 f73c: 82 07 cpc r24, r18 f73e: 93 07 cpc r25, r19 f740: 78 f3 brcs .-34 ; 0xf720 } 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 f742: 80 91 84 03 lds r24, 0x0384 ; 0x800384 f746: 88 23 and r24, r24 f748: 09 f4 brne .+2 ; 0xf74c f74a: 97 c0 rjmp .+302 ; 0xf87a fanSpeedBckp = tail_fan_speed; f74c: 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) { f750: 80 91 2d 04 lds r24, 0x042D ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.505> f754: 81 11 cpse r24, r1 f756: 07 c0 rjmp .+14 ; 0xf766 return; } avoidRecursion = true; f758: 81 e0 ldi r24, 0x01 ; 1 f75a: 80 93 2d 04 sts 0x042D, r24 ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.505> mmu_loop_inner(true); f75e: 0f 94 11 65 call 0x2ca22 ; 0x2ca22 avoidRecursion = false; f762: 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) { f766: 80 91 13 06 lds r24, 0x0613 ; 0x800613 <_ZL26lcd_backlight_wake_trigger.lto_priv.503> f76a: 88 23 and r24, r24 f76c: c9 f1 breq .+114 ; 0xf7e0 lcd_backlight_wake_trigger = false; f76e: 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) { f772: 4f b7 in r20, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); f774: f8 94 cli if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { f776: 80 91 11 06 lds r24, 0x0611 ; 0x800611 <_ZL16lcd_encoder_diff.lto_priv.504> f77a: 28 2f mov r18, r24 f77c: 08 2e mov r0, r24 f77e: 00 0c add r0, r0 f780: 33 0b sbc r19, r19 f782: 37 ff sbrs r19, 7 f784: 03 c0 rjmp .+6 ; 0xf78c f786: 31 95 neg r19 f788: 21 95 neg r18 f78a: 31 09 sbc r19, r1 f78c: 24 30 cpi r18, 0x04 ; 4 f78e: 31 05 cpc r19, r1 f790: 0c f4 brge .+2 ; 0xf794 f792: 76 c0 rjmp .+236 ; 0xf880 lcd_encoder += lcd_encoder_diff / ENCODER_PULSES_PER_STEP; f794: 98 2f mov r25, r24 f796: 87 ff sbrs r24, 7 f798: 02 c0 rjmp .+4 ; 0xf79e f79a: 93 e0 ldi r25, 0x03 ; 3 f79c: 98 0f add r25, r24 f79e: 95 95 asr r25 f7a0: 95 95 asr r25 f7a2: 20 91 06 05 lds r18, 0x0506 ; 0x800506 f7a6: 30 91 07 05 lds r19, 0x0507 ; 0x800507 f7aa: 29 0f add r18, r25 f7ac: 31 1d adc r19, r1 f7ae: 97 fd sbrc r25, 7 f7b0: 3a 95 dec r19 f7b2: 30 93 07 05 sts 0x0507, r19 ; 0x800507 f7b6: 20 93 06 05 sts 0x0506, r18 ; 0x800506 lcd_encoder_diff %= ENCODER_PULSES_PER_STEP; f7ba: 83 78 andi r24, 0x83 ; 131 f7bc: 87 ff sbrs r24, 7 f7be: 03 c0 rjmp .+6 ; 0xf7c6 f7c0: 81 50 subi r24, 0x01 ; 1 f7c2: 8c 6f ori r24, 0xFC ; 252 f7c4: 8f 5f subi r24, 0xFF ; 255 f7c6: 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; f7ca: 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); f7cc: 86 e0 ldi r24, 0x06 ; 6 f7ce: 0f 94 2b 2d call 0x25a56 ; 0x25a56 if (lcd_draw_update == 0) { f7d2: 80 91 5b 02 lds r24, 0x025B ; 0x80025b f7d6: 81 11 cpse r24, r1 f7d8: 03 c0 rjmp .+6 ; 0xf7e0 // Update LCD rendering at minimum lcd_draw_update = 1; f7da: 81 e0 ldi r24, 0x01 ; 1 f7dc: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b lcd_knob_update(); backlight_update(); // handle longpress if(lcd_longpress_trigger) f7e0: 80 91 14 06 lds r24, 0x0614 ; 0x800614 f7e4: 88 23 and r24, r24 f7e6: 61 f0 breq .+24 ; 0xf800 { lcd_consume_click(); // Reset trigger to prevent recursion f7e8: 0e 94 89 6b call 0xd712 ; 0xd712 // long press is not possible in modal mode, wait until ready if (lcd_longpress_func && lcd_update_enabled) f7ec: e0 91 d4 03 lds r30, 0x03D4 ; 0x8003d4 f7f0: f0 91 d5 03 lds r31, 0x03D5 ; 0x8003d5 f7f4: 30 97 sbiw r30, 0x00 ; 0 f7f6: 21 f0 breq .+8 ; 0xf800 f7f8: 80 91 5c 02 lds r24, 0x025C ; 0x80025c f7fc: 81 11 cpse r24, r1 { lcd_longpress_func(); f7fe: 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); } f800: 20 91 62 13 lds r18, 0x1362 ; 0x801362 f804: 30 e0 ldi r19, 0x00 ; 0 f806: a8 ee ldi r26, 0xE8 ; 232 f808: b3 e0 ldi r27, 0x03 ; 3 f80a: 0f 94 3b a1 call 0x34276 ; 0x34276 <__umulhisi3> f80e: ab 01 movw r20, r22 f810: bc 01 movw r22, r24 f812: 83 e6 ldi r24, 0x63 ; 99 f814: 93 e1 ldi r25, 0x13 ; 19 f816: 0f 94 6a 10 call 0x220d4 ; 0x220d4 ::expired(unsigned long)> * Output autoreport values according to features requested in M155 */ #if defined(AUTO_REPORT) void host_autoreport() { if (autoReportFeatures.TimerExpired()) f81a: 88 23 and r24, r24 f81c: 99 f0 breq .+38 ; 0xf844 f81e: 80 91 61 13 lds r24, 0x1361 ; 0x801361 { if(autoReportFeatures.Temp()){ f822: 80 fd sbrc r24, 0 gcode_M105(); f824: 0e 94 c2 71 call 0xe384 ; 0xe384 f828: 80 91 61 13 lds r24, 0x1361 ; 0x801361 } if(autoReportFeatures.Pos()){ f82c: 82 fd sbrc r24, 2 gcode_M114(); f82e: 0e 94 47 71 call 0xe28e ; 0xe28e f832: 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()){ f836: 81 fd sbrc r24, 1 gcode_M123(); f838: 0e 94 93 5f call 0xbf26 ; 0xbf26 } else{ auto_report_timer.stop(); } } inline void TimerStart() { auto_report_timer.start(); } f83c: 83 e6 ldi r24, 0x63 ; 99 f83e: 93 e1 ldi r25, 0x13 ; 19 f840: 0f 94 29 12 call 0x22452 ; 0x22452 ::start()> */ void host_keepalive() { #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; f844: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca f848: 81 11 cpse r24, r1 f84a: 02 c0 rjmp .+4 ; 0xf850 f84c: 0e 94 4d 72 call 0xe49a ; 0xe49a bool M79_timer_get_status() { return M79_timer.running(); } void M79_timer_update_status() { M79_timer.expired(M79_TIMEOUT); f850: 40 e3 ldi r20, 0x30 ; 48 f852: 55 e7 ldi r21, 0x75 ; 117 f854: 60 e0 ldi r22, 0x00 ; 0 f856: 70 e0 ldi r23, 0x00 ; 0 f858: 8a e5 ldi r24, 0x5A ; 90 f85a: 93 e0 ldi r25, 0x03 ; 3 #if defined(AUTO_REPORT) host_autoreport(); #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } f85c: df 91 pop r29 f85e: cf 91 pop r28 f860: 1f 91 pop r17 f862: 0f 91 pop r16 f864: 0d 94 6a 10 jmp 0x220d4 ; 0x220d4 ::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; f868: 10 92 41 03 sts 0x0341, r1 ; 0x800341 f86c: 10 92 42 03 sts 0x0342, r1 ; 0x800342 f870: 10 92 43 03 sts 0x0343, r1 ; 0x800343 f874: 10 92 44 03 sts 0x0344, r1 ; 0x800344 f878: 64 cf rjmp .-312 ; 0xf742 #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; f87a: c0 93 05 05 sts 0x0505, r28 ; 0x800505 f87e: 68 cf rjmp .-304 ; 0xf750 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; f880: 10 92 11 06 sts 0x0611, r1 ; 0x800611 <_ZL16lcd_encoder_diff.lto_priv.504> f884: 4f bf out 0x3f, r20 ; 63 } } Sound_MakeSound(did_rotate ? e_SOUND_TYPE_EncoderMove : e_SOUND_TYPE_ButtonEcho); f886: 80 e0 ldi r24, 0x00 ; 0 f888: a2 cf rjmp .-188 ; 0xf7ce 0000f88a : #endif #endif } void delay_keep_alive(unsigned int ms) { f88a: cf 93 push r28 f88c: df 93 push r29 f88e: ec 01 movw r28, r24 for (;;) { manage_heater(); f890: 0f 94 13 33 call 0x26626 ; 0x26626 // Manage inactivity, but don't disable steppers on timeout. manage_inactivity(true); f894: 81 e0 ldi r24, 0x01 ; 1 f896: 0e 94 fe 79 call 0xf3fc ; 0xf3fc lcd_update(0); f89a: 80 e0 ldi r24, 0x00 ; 0 f89c: 0e 94 38 69 call 0xd270 ; 0xd270 if (ms == 0) f8a0: 20 97 sbiw r28, 0x00 ; 0 f8a2: 99 f0 breq .+38 ; 0xf8ca break; else if (ms >= 50) { f8a4: c2 33 cpi r28, 0x32 ; 50 f8a6: d1 05 cpc r29, r1 f8a8: 40 f0 brcs .+16 ; 0xf8ba _delay(50); f8aa: 62 e3 ldi r22, 0x32 ; 50 f8ac: 70 e0 ldi r23, 0x00 ; 0 f8ae: 80 e0 ldi r24, 0x00 ; 0 f8b0: 90 e0 ldi r25, 0x00 ; 0 f8b2: 0f 94 03 0e call 0x21c06 ; 0x21c06 ms -= 50; f8b6: e2 97 sbiw r28, 0x32 ; 50 f8b8: eb cf rjmp .-42 ; 0xf890 } else { _delay(ms); f8ba: be 01 movw r22, r28 f8bc: 90 e0 ldi r25, 0x00 ; 0 f8be: 80 e0 ldi r24, 0x00 ; 0 f8c0: 0f 94 03 0e call 0x21c06 ; 0x21c06 ms = 0; f8c4: d0 e0 ldi r29, 0x00 ; 0 f8c6: c0 e0 ldi r28, 0x00 ; 0 f8c8: e3 cf rjmp .-58 ; 0xf890 } } } f8ca: df 91 pop r29 f8cc: cf 91 pop r28 f8ce: 08 95 ret 0000f8d0 : /// @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) { f8d0: cf 93 push r28 f8d2: df 93 push r29 f8d4: c8 2f mov r28, r24 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; f8d6: df ef ldi r29, 0xFF ; 255 MMU2::Buttons btn; for(;;) { manage_heater(); f8d8: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(true); f8dc: 81 e0 ldi r24, 0x01 ; 1 f8de: 0e 94 fe 79 call 0xf3fc ; 0xf3fc f8e2: 80 91 92 12 lds r24, 0x1292 ; 0x801292 btn = MMU2::mmu2.GetPrinterButtonOperation(); if (btn != MMU2::Buttons::NoButton) f8e6: 8f 3f cpi r24, 0xFF ; 255 f8e8: d9 f4 brne .+54 ; 0xf920 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { f8ea: 80 91 27 12 lds r24, 0x1227 ; 0x801227 f8ee: 84 30 cpi r24, 0x04 ; 4 f8f0: 21 f4 brne .+8 ; 0xf8fa }; 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 f8f2: 80 91 2a 12 lds r24, 0x122A ; 0x80122a f8f6: 81 11 cpse r24, r1 f8f8: ef cf rjmp .-34 ; 0xf8d8 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 f8fa: 80 91 65 12 lds r24, 0x1265 ; 0x801265 f8fe: 90 91 66 12 lds r25, 0x1266 ; 0x801266 f902: 01 97 sbiw r24, 0x01 ; 1 f904: 49 f7 brne .-46 ; 0xf8d8 && lastErrorCode != ec) // The error code is not a duplicate f906: 80 91 8c 12 lds r24, 0x128C ; 0x80128c f90a: 90 91 8d 12 lds r25, 0x128D ; 0x80128d f90e: 89 32 cpi r24, 0x29 ; 41 f910: 90 48 sbci r25, 0x80 ; 128 f912: 11 f3 breq .-60 ; 0xf8d8 { ReportError(ec, ErrorSource::ErrorSourcePrinter); f914: 60 e0 ldi r22, 0x00 ; 0 f916: 89 e2 ldi r24, 0x29 ; 41 f918: 90 e8 ldi r25, 0x80 ; 128 f91a: 0f 94 69 50 call 0x2a0d2 ; 0x2a0d2 f91e: dc cf rjmp .-72 ; 0xf8d8 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; f920: d0 93 92 12 sts 0x1292, r29 ; 0x801292 { MMU2::mmu2.ClearPrinterButtonOperation(); if (btn == MMU2::Buttons::Eject) { f924: 85 30 cpi r24, 0x05 ; 5 f926: 39 f4 brne .+14 ; 0xf936 if (eject_slot != (uint8_t)MMU2::FILAMENT_UNKNOWN) { f928: cf 3f cpi r28, 0xFF ; 255 f92a: f9 f2 breq .-66 ; 0xf8ea MMU2::mmu2.eject_filament(eject_slot, true); f92c: 61 e0 ldi r22, 0x01 ; 1 f92e: 8c 2f mov r24, r28 f930: 0f 94 ad 6b call 0x2d75a ; 0x2d75a f934: d1 cf rjmp .-94 ; 0xf8d8 // the operation is done. We must be careful to not raise FILAMENT_CHANGE // screen too quickly continue; } } else if (btn == MMU2::Buttons::Load) f936: 84 30 cpi r24, 0x04 ; 4 f938: c1 f6 brne .-80 ; 0xf8ea } } MMU2::mmu2.InvokeErrorScreen(ErrorCode::FILAMENT_CHANGE); } } f93a: df 91 pop r29 f93c: cf 91 pop r28 f93e: 08 95 ret 0000f940 : static void printFloat(double, uint8_t); public: static /*FORCE_INLINE*/ void write(const char *str) f940: cf 93 push r28 f942: df 93 push r29 f944: ec 01 movw r28, r24 { while (*str) f946: 89 91 ld r24, Y+ f948: 88 23 and r24, r24 f94a: 19 f0 breq .+6 ; 0xf952 write(*str++); f94c: 0e 94 37 70 call 0xe06e ; 0xe06e f950: fa cf rjmp .-12 ; 0xf946 } f952: df 91 pop r29 f954: cf 91 pop r28 f956: 08 95 ret 0000f958 : //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) { f958: ff 92 push r15 f95a: 0f 93 push r16 f95c: 1f 93 push r17 f95e: cf 93 push r28 f960: df 93 push r29 f962: ec 01 movw r28, r24 f964: f6 2e mov r15, r22 size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd); f966: 66 23 and r22, r22 f968: 09 f4 brne .+2 ; 0xf96c f96a: 4b c0 rjmp .+150 ; 0xfa02 #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); f96c: 0f 94 59 9e call 0x33cb2 ; 0x33cb2 <__strlen_P> f970: 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)) { f972: c8 01 movw r24, r16 f974: 0e 94 bc 55 call 0xab78 ; 0xab78 f978: 88 23 and r24, r24 f97a: 09 f4 brne .+2 ; 0xf97e f97c: 53 c0 rjmp .+166 ; 0xfa24 // 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; f97e: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> f982: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f986: fc 01 movw r30, r24 f988: e2 52 subi r30, 0x22 ; 34 f98a: f0 4f sbci r31, 0xF0 ; 240 f98c: 23 e0 ldi r18, 0x03 ; 3 f98e: 20 83 st Z, r18 f990: 8f 51 subi r24, 0x1F ; 31 f992: 90 4f sbci r25, 0xF0 ; 240 if (from_progmem) strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); f994: 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) f996: ff 20 and r15, r15 f998: e9 f1 breq .+122 ; 0xfa14 strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); f99a: 0f 94 52 9e call 0x33ca4 ; 0x33ca4 else strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; f99e: 81 e6 ldi r24, 0x61 ; 97 f9a0: 9d e9 ldi r25, 0x9D ; 157 f9a2: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHORPGM(MSG_Enqueing); f9a6: 8f e8 ldi r24, 0x8F ; 143 f9a8: 92 e6 ldi r25, 0x62 ; 98 f9aa: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); f9ae: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> f9b2: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> } }*/ static FORCE_INLINE void print(const char *str) { write(str); f9b6: 8f 51 subi r24, 0x1F ; 31 f9b8: 90 4f sbci r25, 0xF0 ; 240 f9ba: 0e 94 a0 7c call 0xf940 ; 0xf940 SERIAL_ECHOLNPGM("\""); f9be: 80 e4 ldi r24, 0x40 ; 64 f9c0: 92 e7 ldi r25, 0x72 ; 114 f9c2: 0e 94 49 72 call 0xe492 ; 0xe492 bufindw += len + (CMDHDRSIZE + 1); f9c6: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> f9ca: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f9ce: 04 96 adiw r24, 0x04 ; 4 f9d0: 08 0f add r16, r24 f9d2: 19 1f adc r17, r25 if (bufindw == sizeof(cmdbuffer)) f9d4: 0d 3e cpi r16, 0xED ; 237 f9d6: 81 e0 ldi r24, 0x01 ; 1 f9d8: 18 07 cpc r17, r24 f9da: f9 f0 breq .+62 ; 0xfa1a strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); f9dc: 10 93 dd 0f sts 0x0FDD, r17 ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> f9e0: 00 93 dc 0f sts 0x0FDC, r16 ; 0x800fdc <_ZL7bufindw.lto_priv.516> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; f9e4: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf f9e8: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 f9ec: 01 96 adiw r24, 0x01 ; 1 f9ee: 90 93 d0 11 sts 0x11D0, r25 ; 0x8011d0 f9f2: 80 93 cf 11 sts 0x11CF, r24 ; 0x8011cf SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } f9f6: df 91 pop r29 f9f8: cf 91 pop r28 f9fa: 1f 91 pop r17 f9fc: 0f 91 pop r16 f9fe: ff 90 pop r15 fa00: 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); fa02: fc 01 movw r30, r24 fa04: 01 90 ld r0, Z+ fa06: 00 20 and r0, r0 fa08: e9 f7 brne .-6 ; 0xfa04 fa0a: 31 97 sbiw r30, 0x01 ; 1 fa0c: 8f 01 movw r16, r30 fa0e: 08 1b sub r16, r24 fa10: 19 0b sbc r17, r25 fa12: af cf rjmp .-162 ; 0xf972 // 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); fa14: 0f 94 06 a7 call 0x34e0c ; 0x34e0c fa18: c2 cf rjmp .-124 ; 0xf99e SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); if (bufindw == sizeof(cmdbuffer)) bufindw = 0; fa1a: 10 92 dd 0f sts 0x0FDD, r1 ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> fa1e: 10 92 dc 0f sts 0x0FDC, r1 ; 0x800fdc <_ZL7bufindw.lto_priv.516> fa22: e0 cf rjmp .-64 ; 0xf9e4 ++ buflen; #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; fa24: 84 e4 ldi r24, 0x44 ; 68 fa26: 9d e9 ldi r25, 0x9D ; 157 fa28: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHORPGM(MSG_Enqueing); fa2c: 8f e8 ldi r24, 0x8F ; 143 fa2e: 92 e6 ldi r25, 0x62 ; 98 fa30: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); fa34: ce 01 movw r24, r28 cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) fa36: ff 20 and r15, r15 fa38: 59 f0 breq .+22 ; 0xfa50 SERIAL_PROTOCOLRPGM(cmd); fa3a: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); fa3e: 82 e1 ldi r24, 0x12 ; 18 fa40: 9d e9 ldi r25, 0x9D ; 157 #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } fa42: df 91 pop r29 fa44: cf 91 pop r28 fa46: 1f 91 pop r17 fa48: 0f 91 pop r16 fa4a: ff 90 pop r15 SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); fa4c: 0c 94 49 72 jmp 0xe492 ; 0xe492 fa50: 0e 94 a0 7c call 0xf940 ; 0xf940 fa54: f4 cf rjmp .-24 ; 0xfa3e 0000fa56 : { 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) { fa56: 0f 93 push r16 fa58: 1f 93 push r17 fa5a: cf 93 push r28 fa5c: df 93 push r29 fa5e: d6 2f mov r29, r22 fa60: 8c 01 movw r16, r24 for (uint8_t i = 0; i < steps; ++i) fa62: c0 e0 ldi r28, 0x00 ; 0 { void * const pgm_ptr = pgm_read_ptr(cmd_sequence + i); fa64: f8 01 movw r30, r16 fa66: 85 91 lpm r24, Z+ fa68: 94 91 lpm r25, Z // M702 is currently only used with MMU enabled if (pgm_ptr == MSG_M702 && !MMU2::mmu2.Enabled()) { fa6a: 28 e6 ldi r18, 0x68 ; 104 fa6c: 8d 30 cpi r24, 0x0D ; 13 fa6e: 92 07 cpc r25, r18 fa70: 21 f4 brne .+8 ; 0xfa7a fa72: 20 91 94 12 lds r18, 0x1294 ; 0x801294 fa76: 21 30 cpi r18, 0x01 ; 1 fa78: 19 f4 brne .+6 ; 0xfa80 continue; } enquecommand_P(static_cast(pgm_ptr)); fa7a: 61 e0 ldi r22, 0x01 ; 1 fa7c: 0e 94 ac 7c call 0xf958 ; 0xf958 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) fa80: cf 5f subi r28, 0xFF ; 255 fa82: 0e 5f subi r16, 0xFE ; 254 fa84: 1f 4f sbci r17, 0xFF ; 255 fa86: dc 13 cpse r29, r28 fa88: ed cf rjmp .-38 ; 0xfa64 continue; } enquecommand_P(static_cast(pgm_ptr)); } } fa8a: df 91 pop r29 fa8c: cf 91 pop r28 fa8e: 1f 91 pop r17 fa90: 0f 91 pop r16 fa92: 08 95 ret 0000fa94 : static const char bufferFull[] PROGMEM = "\" failed: Buffer full!"; static const char enqueingFront[] PROGMEM = "Enqueing to the front: \""; void enquecommandf_P(const char *fmt, ...) { fa94: cf 93 push r28 fa96: df 93 push r29 fa98: cd b7 in r28, 0x3d ; 61 fa9a: de b7 in r29, 0x3e ; 62 fa9c: 6e 97 sbiw r28, 0x1e ; 30 fa9e: 0f b6 in r0, 0x3f ; 63 faa0: f8 94 cli faa2: de bf out 0x3e, r29 ; 62 faa4: 0f be out 0x3f, r0 ; 63 faa6: cd bf out 0x3d, r28 ; 61 faa8: 9e 01 movw r18, r28 faaa: 2c 5d subi r18, 0xDC ; 220 faac: 3f 4f sbci r19, 0xFF ; 255 faae: f9 01 movw r30, r18 fab0: 41 91 ld r20, Z+ fab2: 51 91 ld r21, Z+ fab4: 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); fab6: 6e e1 ldi r22, 0x1E ; 30 fab8: 70 e0 ldi r23, 0x00 ; 0 faba: ce 01 movw r24, r28 fabc: 01 96 adiw r24, 0x01 ; 1 fabe: 0f 94 f1 9f call 0x33fe2 ; 0x33fe2 va_end(ap); enquecommand(cmd_buffer, false); fac2: 60 e0 ldi r22, 0x00 ; 0 fac4: ce 01 movw r24, r28 fac6: 01 96 adiw r24, 0x01 ; 1 fac8: 0e 94 ac 7c call 0xf958 ; 0xf958 } facc: 6e 96 adiw r28, 0x1e ; 30 face: 0f b6 in r0, 0x3f ; 63 fad0: f8 94 cli fad2: de bf out 0x3e, r29 ; 62 fad4: 0f be out 0x3f, r0 ; 63 fad6: cd bf out 0x3d, r28 ; 61 fad8: df 91 pop r29 fada: cf 91 pop r28 fadc: 08 95 ret 0000fade <__vector_29>: #ifdef ADC_CALLBACK extern void ADC_CALLBACK(); #endif //ADC_CALLBACK ISR(ADC_vect) { fade: 1f 92 push r1 fae0: 0f 92 push r0 fae2: 0f b6 in r0, 0x3f ; 63 fae4: 0f 92 push r0 fae6: 11 24 eor r1, r1 fae8: 0b b6 in r0, 0x3b ; 59 faea: 0f 92 push r0 faec: 2f 93 push r18 faee: 3f 93 push r19 faf0: 4f 93 push r20 faf2: 5f 93 push r21 faf4: 6f 93 push r22 faf6: 7f 93 push r23 faf8: 8f 93 push r24 fafa: 9f 93 push r25 fafc: af 93 push r26 fafe: bf 93 push r27 fb00: ef 93 push r30 fb02: ff 93 push r31 adc_values[adc_channel] += ADC; fb04: 20 91 78 00 lds r18, 0x0078 ; 0x800078 <__TEXT_REGION_LENGTH__+0x7c2078> fb08: 30 91 79 00 lds r19, 0x0079 ; 0x800079 <__TEXT_REGION_LENGTH__+0x7c2079> fb0c: e0 91 16 03 lds r30, 0x0316 ; 0x800316 fb10: f0 e0 ldi r31, 0x00 ; 0 fb12: ee 0f add r30, r30 fb14: ff 1f adc r31, r31 fb16: ea 5f subi r30, 0xFA ; 250 fb18: fc 4f sbci r31, 0xFC ; 252 fb1a: 80 81 ld r24, Z fb1c: 91 81 ldd r25, Z+1 ; 0x01 fb1e: 82 0f add r24, r18 fb20: 93 1f adc r25, r19 fb22: 91 83 std Z+1, r25 ; 0x01 fb24: 80 83 st Z, r24 if (++adc_count == ADC_OVRSAMPL) fb26: 80 91 05 03 lds r24, 0x0305 ; 0x800305 fb2a: 8f 5f subi r24, 0xFF ; 255 fb2c: 80 93 05 03 sts 0x0305, r24 ; 0x800305 fb30: 80 31 cpi r24, 0x10 ; 16 fb32: e9 f5 brne .+122 ; 0xfbae <__vector_29+0xd0> { // go to the next channel if (++adc_channel == ADC_CHAN_CNT) { fb34: 80 91 16 03 lds r24, 0x0316 ; 0x800316 fb38: 8f 5f subi r24, 0xFF ; 255 fb3a: 80 93 16 03 sts 0x0316, r24 ; 0x800316 fb3e: 88 30 cpi r24, 0x08 ; 8 fb40: 71 f5 brne .+92 ; 0xfb9e <__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 fb42: 80 91 06 03 lds r24, 0x0306 ; 0x800306 fb46: 90 91 07 03 lds r25, 0x0307 ; 0x800307 fb4a: 90 93 4a 06 sts 0x064A, r25 ; 0x80064a fb4e: 80 93 49 06 sts 0x0649, r24 ; 0x800649 current_temperature_bed_raw = adc_values[ADC_PIN_IDX(TEMP_BED_PIN)]; fb52: 80 91 0a 03 lds r24, 0x030A ; 0x80030a fb56: 90 91 0b 03 lds r25, 0x030B ; 0x80030b fb5a: 90 93 4c 06 sts 0x064C, r25 ; 0x80064c fb5e: 80 93 4b 06 sts 0x064B, r24 ; 0x80064b #ifdef PINDA_THERMISTOR current_temperature_raw_pinda = adc_values[ADC_PIN_IDX(TEMP_PINDA_PIN)]; fb62: 80 91 08 03 lds r24, 0x0308 ; 0x800308 fb66: 90 91 09 03 lds r25, 0x0309 ; 0x800309 fb6a: 90 93 48 06 sts 0x0648, r25 ; 0x800648 fb6e: 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; fb72: 81 e0 ldi r24, 0x01 ; 1 fb74: 80 93 63 06 sts 0x0663, r24 ; 0x800663 <_ZL16adc_values_ready.lto_priv.519> break; } } } ADCSRA |= (1 << ADSC); //start conversion } fb78: ff 91 pop r31 fb7a: ef 91 pop r30 fb7c: bf 91 pop r27 fb7e: af 91 pop r26 fb80: 9f 91 pop r25 fb82: 8f 91 pop r24 fb84: 7f 91 pop r23 fb86: 6f 91 pop r22 fb88: 5f 91 pop r21 fb8a: 4f 91 pop r20 fb8c: 3f 91 pop r19 fb8e: 2f 91 pop r18 fb90: 0f 90 pop r0 fb92: 0b be out 0x3b, r0 ; 59 fb94: 0f 90 pop r0 fb96: 0f be out 0x3f, r0 ; 63 fb98: 0f 90 pop r0 fb9a: 1f 90 pop r1 fb9c: 18 95 reti fb9e: 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)) { fba2: 4f e5 ldi r20, 0x5F ; 95 fba4: 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) { fba6: 8f 5f subi r24, 0xFF ; 255 fba8: 41 f4 brne .+16 ; 0xfbba <__vector_29+0xdc> fbaa: 10 92 04 03 sts 0x0304, r1 ; 0x800304 <__data_end> adc_count = 0; break; } } } ADCSRA |= (1 << ADSC); //start conversion fbae: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> fbb2: 80 64 ori r24, 0x40 ; 64 fbb4: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> fbb8: df cf rjmp .-66 ; 0xfb78 <__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)) { fbba: 9a 01 movw r18, r20 fbbc: 08 2e mov r0, r24 fbbe: 02 c0 rjmp .+4 ; 0xfbc4 <__vector_29+0xe6> fbc0: 35 95 asr r19 fbc2: 27 95 ror r18 fbc4: 0a 94 dec r0 fbc6: e2 f7 brpl .-8 ; 0xfbc0 <__vector_29+0xe2> fbc8: 20 ff sbrs r18, 0 fbca: ed cf rjmp .-38 ; 0xfba6 <__vector_29+0xc8> fbcc: 80 93 04 03 sts 0x0304, r24 ; 0x800304 <__data_end> adc_setmux(adc_channel_idx); fbd0: 0e 94 cd 54 call 0xa99a ; 0xa99a adc_count = 0; fbd4: 10 92 05 03 sts 0x0305, r1 ; 0x800305 fbd8: ea cf rjmp .-44 ; 0xfbae <__vector_29+0xd0> 0000fbda : if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { fbda: cf 93 push r28 fbdc: 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 fbde: ca e7 ldi r28, 0x7A ; 122 fbe0: d0 e0 ldi r29, 0x00 ; 0 fbe2: 88 81 ld r24, Y fbe4: 8f 7b andi r24, 0xBF ; 191 fbe6: 88 83 st Y, r24 adc_count = 0; fbe8: 10 92 05 03 sts 0x0305, r1 ; 0x800305 adc_channel = 0; fbec: 10 92 16 03 sts 0x0316, r1 ; 0x800316 adc_channel_idx = first_channel_idx; fbf0: 10 92 04 03 sts 0x0304, r1 ; 0x800304 <__data_end> adc_setmux(adc_channel_idx); fbf4: 80 e0 ldi r24, 0x00 ; 0 fbf6: 0e 94 cd 54 call 0xa99a ; 0xa99a memset((void*)adc_values, 0, sizeof(adc_values)); fbfa: e6 e0 ldi r30, 0x06 ; 6 fbfc: f3 e0 ldi r31, 0x03 ; 3 fbfe: 80 e1 ldi r24, 0x10 ; 16 fc00: df 01 movw r26, r30 fc02: 1d 92 st X+, r1 fc04: 8a 95 dec r24 fc06: e9 f7 brne .-6 ; 0xfc02 ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { adc_reset(); ADCSRA |= (1 << ADSC); //start conversion fc08: 88 81 ld r24, Y fc0a: 80 64 ori r24, 0x40 ; 64 fc0c: 88 83 st Y, r24 } fc0e: df 91 pop r29 fc10: cf 91 pop r28 fc12: 08 95 ret 0000fc14 : } // G80 - Automatic mesh bed leveling static void gcode_G80() { fc14: 2f 92 push r2 fc16: 3f 92 push r3 fc18: 4f 92 push r4 fc1a: 5f 92 push r5 fc1c: 6f 92 push r6 fc1e: 7f 92 push r7 fc20: 8f 92 push r8 fc22: 9f 92 push r9 fc24: af 92 push r10 fc26: bf 92 push r11 fc28: cf 92 push r12 fc2a: df 92 push r13 fc2c: ef 92 push r14 fc2e: ff 92 push r15 fc30: 0f 93 push r16 fc32: 1f 93 push r17 fc34: cf 93 push r28 fc36: df 93 push r29 fc38: cd b7 in r28, 0x3d ; 61 fc3a: de b7 in r29, 0x3e ; 62 fc3c: a4 97 sbiw r28, 0x24 ; 36 fc3e: 0f b6 in r0, 0x3f ; 63 fc40: f8 94 cli fc42: de bf out 0x3e, r29 ; 62 fc44: 0f be out 0x3f, r0 ; 63 fc46: 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(); fc48: 0f 94 ce 22 call 0x2459c ; 0x2459c if (planner_aborted) fc4c: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac fc50: 81 11 cpse r24, r1 fc52: 17 c0 rjmp .+46 ; 0xfc82 return; mesh_bed_leveling_flag = true; fc54: 81 e0 ldi r24, 0x01 ; 1 fc56: 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])) { fc5a: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 fc5e: 88 23 and r24, r24 fc60: 49 f0 breq .+18 ; 0xfc74 fc62: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 fc66: 88 23 and r24, r24 fc68: 29 f0 breq .+10 ; 0xfc74 fc6a: 20 91 a5 06 lds r18, 0x06A5 ; 0x8006a5 fc6e: 2f 83 std Y+7, r18 ; 0x07 fc70: 21 11 cpse r18, r1 fc72: 20 c0 rjmp .+64 ; 0xfcb4 // 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; fc74: 81 e0 ldi r24, 0x01 ; 1 fc76: 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); fc7a: 82 e1 ldi r24, 0x12 ; 18 fc7c: 98 e6 ldi r25, 0x68 ; 104 fc7e: 0f 94 16 44 call 0x2882c ; 0x2882c custom_message_state = custom_message_state_old; lcd_update(2); st_synchronize(); mesh_bed_leveling_flag = false; } fc82: a4 96 adiw r28, 0x24 ; 36 fc84: 0f b6 in r0, 0x3f ; 63 fc86: f8 94 cli fc88: de bf out 0x3e, r29 ; 62 fc8a: 0f be out 0x3f, r0 ; 63 fc8c: cd bf out 0x3d, r28 ; 61 fc8e: df 91 pop r29 fc90: cf 91 pop r28 fc92: 1f 91 pop r17 fc94: 0f 91 pop r16 fc96: ff 90 pop r15 fc98: ef 90 pop r14 fc9a: df 90 pop r13 fc9c: cf 90 pop r12 fc9e: bf 90 pop r11 fca0: af 90 pop r10 fca2: 9f 90 pop r9 fca4: 8f 90 pop r8 fca6: 7f 90 pop r7 fca8: 6f 90 pop r6 fcaa: 5f 90 pop r5 fcac: 4f 90 pop r4 fcae: 3f 90 pop r3 fcb0: 2f 90 pop r2 fcb2: 08 95 ret return; } run = false; #endif //PINDA_THERMISTOR uint8_t nMeasPoints = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); fcb4: 8b ea ldi r24, 0xAB ; 171 fcb6: 9d e0 ldi r25, 0x0D ; 13 fcb8: 0f 94 9b a0 call 0x34136 ; 0x34136 fcbc: 18 2f mov r17, r24 if (uint8_t codeSeen = code_seen('N'), value = code_value_uint8(); codeSeen && (value == 7 || value == 3)) fcbe: 8e e4 ldi r24, 0x4E ; 78 fcc0: 0e 94 2b 55 call 0xaa56 ; 0xaa56 fcc4: 08 2f mov r16, r24 fcc6: 0e 94 40 55 call 0xaa80 ; 0xaa80 fcca: 8e 83 std Y+6, r24 ; 0x06 fccc: 00 23 and r16, r16 fcce: 29 f0 breq .+10 ; 0xfcda fcd0: 87 30 cpi r24, 0x07 ; 7 fcd2: 09 f4 brne .+2 ; 0xfcd6 fcd4: c9 c0 rjmp .+402 ; 0xfe68 fcd6: 83 30 cpi r24, 0x03 ; 3 fcd8: 29 f0 breq .+10 ; 0xfce4 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; fcda: 13 30 cpi r17, 0x03 ; 3 fcdc: 09 f0 breq .+2 ; 0xfce0 fcde: c3 c0 rjmp .+390 ; 0xfe66 fce0: 63 e0 ldi r22, 0x03 ; 3 fce2: 6e 83 std Y+6, r22 ; 0x06 fce4: 80 e0 ldi r24, 0x00 ; 0 fce6: 90 e0 ldi r25, 0x00 ; 0 fce8: a0 e8 ldi r26, 0x80 ; 128 fcea: bf e3 ldi r27, 0x3F ; 63 fcec: 8a 83 std Y+2, r24 ; 0x02 fcee: 9b 83 std Y+3, r25 ; 0x03 fcf0: ac 83 std Y+4, r26 ; 0x04 fcf2: bd 83 std Y+5, r27 ; 0x05 uint8_t nProbeRetryCount = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); fcf4: 8a ea ldi r24, 0xAA ; 170 fcf6: 9d e0 ldi r25, 0x0D ; 13 fcf8: 0f 94 9b a0 call 0x34136 ; 0x34136 fcfc: 88 8f std Y+24, r24 ; 0x18 if (uint8_t codeSeen = code_seen('C'), value = code_value_uint8(); codeSeen && value >= 1 && value <= 10) fcfe: 83 e4 ldi r24, 0x43 ; 67 fd00: 0e 94 2b 55 call 0xaa56 ; 0xaa56 fd04: 18 2f mov r17, r24 fd06: 0e 94 40 55 call 0xaa80 ; 0xaa80 fd0a: 11 23 and r17, r17 fd0c: 29 f0 breq .+10 ; 0xfd18 fd0e: 88 23 and r24, r24 fd10: 19 f0 breq .+6 ; 0xfd18 fd12: 8b 30 cpi r24, 0x0B ; 11 fd14: 08 f4 brcc .+2 ; 0xfd18 fd16: 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; fd18: 88 e5 ldi r24, 0x58 ; 88 fd1a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 fd1e: 88 23 and r24, r24 fd20: 09 f4 brne .+2 ; 0xfd24 fd22: ab c0 rjmp .+342 ; 0xfe7a fd24: 0e 94 03 5a call 0xb406 ; 0xb406 fd28: 20 e0 ldi r18, 0x00 ; 0 fd2a: 30 e0 ldi r19, 0x00 ; 0 fd2c: 48 e0 ldi r20, 0x08 ; 8 fd2e: 52 e4 ldi r21, 0x42 ; 66 fd30: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> fd34: 20 e0 ldi r18, 0x00 ; 0 fd36: 30 e0 ldi r19, 0x00 ; 0 fd38: 48 eb ldi r20, 0xB8 ; 184 fd3a: 51 e4 ldi r21, 0x41 ; 65 fd3c: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> fd40: 6a 87 std Y+10, r22 ; 0x0a fd42: 7b 87 std Y+11, r23 ; 0x0b fd44: 8c 87 std Y+12, r24 ; 0x0c fd46: 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; fd48: 89 e5 ldi r24, 0x59 ; 89 fd4a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 fd4e: 88 23 and r24, r24 fd50: 09 f4 brne .+2 ; 0xfd54 fd52: 9c c0 rjmp .+312 ; 0xfe8c fd54: 0e 94 03 5a call 0xb406 ; 0xb406 fd58: 20 e0 ldi r18, 0x00 ; 0 fd5a: 30 e0 ldi r19, 0x00 ; 0 fd5c: 48 e0 ldi r20, 0x08 ; 8 fd5e: 52 e4 ldi r21, 0x42 ; 66 fd60: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> fd64: 20 e0 ldi r18, 0x00 ; 0 fd66: 30 e0 ldi r19, 0x00 ; 0 fd68: 40 ea ldi r20, 0xA0 ; 160 fd6a: 50 e4 ldi r21, 0x40 ; 64 fd6c: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> fd70: 6c 8b std Y+20, r22 ; 0x14 fd72: 7d 8b std Y+21, r23 ; 0x15 fd74: 8e 8b std Y+22, r24 ; 0x16 fd76: 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; fd78: 87 e5 ldi r24, 0x57 ; 87 fd7a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 fd7e: 88 23 and r24, r24 fd80: 09 f4 brne .+2 ; 0xfd84 fd82: 89 c0 rjmp .+274 ; 0xfe96 fd84: 0e 94 03 5a call 0xb406 ; 0xb406 fd88: 2a 85 ldd r18, Y+10 ; 0x0a fd8a: 3b 85 ldd r19, Y+11 ; 0x0b fd8c: 4c 85 ldd r20, Y+12 ; 0x0c fd8e: 5d 85 ldd r21, Y+13 ; 0x0d fd90: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> fd94: 20 e0 ldi r18, 0x00 ; 0 fd96: 30 e0 ldi r19, 0x00 ; 0 fd98: 48 e8 ldi r20, 0x88 ; 136 fd9a: 52 e4 ldi r21, 0x42 ; 66 fd9c: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> fda0: 69 8f std Y+25, r22 ; 0x19 fda2: 7a 8f std Y+26, r23 ; 0x1a fda4: 8b 8f std Y+27, r24 ; 0x1b fda6: 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; fda8: 88 e4 ldi r24, 0x48 ; 72 fdaa: 0e 94 2b 55 call 0xaa56 ; 0xaa56 fdae: 88 23 and r24, r24 fdb0: 09 f4 brne .+2 ; 0xfdb4 fdb2: 7a c0 rjmp .+244 ; 0xfea8 fdb4: 0e 94 03 5a call 0xb406 ; 0xb406 fdb8: 2c 89 ldd r18, Y+20 ; 0x14 fdba: 3d 89 ldd r19, Y+21 ; 0x15 fdbc: 4e 89 ldd r20, Y+22 ; 0x16 fdbe: 5f 89 ldd r21, Y+23 ; 0x17 fdc0: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> fdc4: 20 e0 ldi r18, 0x00 ; 0 fdc6: 30 e0 ldi r19, 0x00 ; 0 fdc8: 48 e8 ldi r20, 0x88 ; 136 fdca: 52 e4 ldi r21, 0x42 ; 66 fdcc: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> fdd0: 6d 8f std Y+29, r22 ; 0x1d fdd2: 7e 8f std Y+30, r23 ; 0x1e fdd4: 8f 8f std Y+31, r24 ; 0x1f fdd6: 98 a3 std Y+32, r25 ; 0x20 mbl.reset(); //reset mesh bed leveling fdd8: 0f 94 b0 56 call 0x2ad60 ; 0x2ad60 mbl.z_values[0][0] = min_pos[Z_AXIS]; fddc: 80 91 2c 02 lds r24, 0x022C ; 0x80022c fde0: 90 91 2d 02 lds r25, 0x022D ; 0x80022d fde4: a0 91 2e 02 lds r26, 0x022E ; 0x80022e fde8: b0 91 2f 02 lds r27, 0x022F ; 0x80022f fdec: 80 93 9d 12 sts 0x129D, r24 ; 0x80129d fdf0: 90 93 9e 12 sts 0x129E, r25 ; 0x80129e fdf4: a0 93 9f 12 sts 0x129F, r26 ; 0x80129f fdf8: b0 93 a0 12 sts 0x12A0, r27 ; 0x8012a0 // Reset baby stepping to zero, if the babystepping has already been loaded before. babystep_undo(); fdfc: 0f 94 ca 8b call 0x31794 ; 0x31794 fe00: 05 ec ldi r16, 0xC5 ; 197 fe02: 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) fe04: c8 01 movw r24, r16 fe06: 0f 94 a9 a0 call 0x34152 ; 0x34152 fe0a: 01 96 adiw r24, 0x01 ; 1 fe0c: 09 f0 breq .+2 ; 0xfe10 fe0e: 51 c0 rjmp .+162 ; 0xfeb2 fe10: 0e 5f subi r16, 0xFE ; 254 fe12: 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) { fe14: 05 3d cpi r16, 0xD5 ; 213 fe16: 8f e0 ldi r24, 0x0F ; 15 fe18: 18 07 cpc r17, r24 fe1a: a1 f7 brne .-24 ; 0xfe04 if (eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + i * 2)) != 0x0FFFF) return true; } return false; fe1c: 21 2c mov r2, r1 fe1e: ac e9 ldi r26, 0x9C ; 156 fe20: b2 e1 ldi r27, 0x12 ; 18 fe22: ba a3 std Y+34, r27 ; 0x22 fe24: 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; fe26: b9 87 std Y+9, r27 ; 0x09 fe28: a8 87 std Y+8, r26 ; 0x08 fe2a: 51 2c mov r5, r1 fe2c: 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; fe2e: 31 2c mov r3, r1 fe30: 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)); fe32: 84 2d mov r24, r4 fe34: 63 e0 ldi r22, 0x03 ; 3 fe36: 0f 94 4a a1 call 0x34294 ; 0x34294 <__udivmodqi4> fe3a: 98 8b std Y+16, r25 ; 0x10 fe3c: 68 84 ldd r6, Y+8 ; 0x08 fe3e: 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++) { fe40: 10 e0 ldi r17, 0x00 ; 0 bool isOn3x3Mesh = ((row % 3 == 0) && (col % 3 == 0)); fe42: f8 89 ldd r31, Y+16 ; 0x10 fe44: f1 11 cpse r31, r1 fe46: 37 c0 rjmp .+110 ; 0xfeb6 fe48: 81 2f mov r24, r17 fe4a: 63 e0 ldi r22, 0x03 ; 3 fe4c: 0f 94 4a a1 call 0x34294 ; 0x34294 <__udivmodqi4> fe50: 91 11 cpse r25, r1 fe52: 31 c0 rjmp .+98 ; 0xfeb6 if (isOn3x3Mesh) { if (has_z && (row || col)) { fe54: 21 10 cpse r2, r1 fe56: 3f c1 rjmp .+638 ; 0x100d6 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { fe58: 7e 81 ldd r23, Y+6 ; 0x06 fe5a: 73 30 cpi r23, 0x03 ; 3 fe5c: 09 f4 brne .+2 ; 0xfe60 fe5e: 70 c0 rjmp .+224 ; 0xff40 fe60: 8f 81 ldd r24, Y+7 ; 0x07 fe62: 8e 87 std Y+14, r24 ; 0x0e fe64: 37 c0 rjmp .+110 ; 0xfed4 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; fe66: 1e 83 std Y+6, r17 ; 0x06 fe68: 6a e9 ldi r22, 0x9A ; 154 fe6a: 79 e9 ldi r23, 0x99 ; 153 fe6c: 89 e1 ldi r24, 0x19 ; 25 fe6e: 9f e3 ldi r25, 0x3F ; 63 fe70: 6a 83 std Y+2, r22 ; 0x02 fe72: 7b 83 std Y+3, r23 ; 0x03 fe74: 8c 83 std Y+4, r24 ; 0x04 fe76: 9d 83 std Y+5, r25 ; 0x05 fe78: 3d cf rjmp .-390 ; 0xfcf4 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; fe7a: 80 e0 ldi r24, 0x00 ; 0 fe7c: 90 e0 ldi r25, 0x00 ; 0 fe7e: a0 e8 ldi r26, 0x80 ; 128 fe80: bf ef ldi r27, 0xFF ; 255 fe82: 8a 87 std Y+10, r24 ; 0x0a fe84: 9b 87 std Y+11, r25 ; 0x0b fe86: ac 87 std Y+12, r26 ; 0x0c fe88: bd 87 std Y+13, r27 ; 0x0d fe8a: 5e cf rjmp .-324 ; 0xfd48 const float area_min_y = code_seen('Y') ? code_value() - y_mesh_density - Y_PROBE_OFFSET_FROM_EXTRUDER : -INFINITY; fe8c: 60 e0 ldi r22, 0x00 ; 0 fe8e: 70 e0 ldi r23, 0x00 ; 0 fe90: 80 e8 ldi r24, 0x80 ; 128 fe92: 9f ef ldi r25, 0xFF ; 255 fe94: 6d cf rjmp .-294 ; 0xfd70 const float area_max_x = code_seen('W') ? area_min_x + code_value() + 2 * x_mesh_density : INFINITY; fe96: 80 e0 ldi r24, 0x00 ; 0 fe98: 90 e0 ldi r25, 0x00 ; 0 fe9a: a0 e8 ldi r26, 0x80 ; 128 fe9c: bf e7 ldi r27, 0x7F ; 127 fe9e: 89 8f std Y+25, r24 ; 0x19 fea0: 9a 8f std Y+26, r25 ; 0x1a fea2: ab 8f std Y+27, r26 ; 0x1b fea4: bc 8f std Y+28, r27 ; 0x1c fea6: 80 cf rjmp .-256 ; 0xfda8 const float area_max_y = code_seen('H') ? area_min_y + code_value() + 2 * y_mesh_density : INFINITY; fea8: 60 e0 ldi r22, 0x00 ; 0 feaa: 70 e0 ldi r23, 0x00 ; 0 feac: 80 e8 ldi r24, 0x80 ; 128 feae: 9f e7 ldi r25, 0x7F ; 127 feb0: 8f cf rjmp .-226 ; 0xfdd0 feb2: 2f 80 ldd r2, Y+7 ; 0x07 feb4: b4 cf rjmp .-152 ; 0xfe1e 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; } feb6: 60 e0 ldi r22, 0x00 ; 0 feb8: 70 e0 ldi r23, 0x00 ; 0 feba: 80 ec ldi r24, 0xC0 ; 192 febc: 9f e7 ldi r25, 0x7F ; 127 febe: d3 01 movw r26, r6 fec0: 11 96 adiw r26, 0x01 ; 1 fec2: 6d 93 st X+, r22 fec4: 7d 93 st X+, r23 fec6: 8d 93 st X+, r24 fec8: 9c 93 st X, r25 feca: 14 97 sbiw r26, 0x04 ; 4 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { fecc: be 81 ldd r27, Y+6 ; 0x06 fece: b3 30 cpi r27, 0x03 ; 3 fed0: c1 f1 breq .+112 ; 0xff42 fed2: 1e 86 std Y+14, r1 ; 0x0e if (!isOn3x3Mesh) continue; } else { const float x_pos = BED_X(col); fed4: 81 2f mov r24, r17 fed6: 0f 94 24 8c call 0x31848 ; 0x31848 feda: 4b 01 movw r8, r22 fedc: 5c 01 movw r10, r24 const float y_pos = BED_Y(row); fede: 80 2f mov r24, r16 fee0: 0f 94 24 8c call 0x31848 ; 0x31848 fee4: 6b 01 movw r12, r22 fee6: 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)) { fee8: a5 01 movw r20, r10 feea: 94 01 movw r18, r8 feec: 6a 85 ldd r22, Y+10 ; 0x0a feee: 7b 85 ldd r23, Y+11 ; 0x0b fef0: 8c 85 ldd r24, Y+12 ; 0x0c fef2: 9d 85 ldd r25, Y+13 ; 0x0d fef4: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> fef8: 18 16 cp r1, r24 fefa: 0c f4 brge .+2 ; 0xfefe fefc: 1c c1 rjmp .+568 ; 0x10136 fefe: 29 8d ldd r18, Y+25 ; 0x19 ff00: 3a 8d ldd r19, Y+26 ; 0x1a ff02: 4b 8d ldd r20, Y+27 ; 0x1b ff04: 5c 8d ldd r21, Y+28 ; 0x1c ff06: c5 01 movw r24, r10 ff08: b4 01 movw r22, r8 ff0a: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> ff0e: 18 16 cp r1, r24 ff10: 0c f4 brge .+2 ; 0xff14 ff12: 11 c1 rjmp .+546 ; 0x10136 ff14: a7 01 movw r20, r14 ff16: 96 01 movw r18, r12 ff18: 6c 89 ldd r22, Y+20 ; 0x14 ff1a: 7d 89 ldd r23, Y+21 ; 0x15 ff1c: 8e 89 ldd r24, Y+22 ; 0x16 ff1e: 9f 89 ldd r25, Y+23 ; 0x17 ff20: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> ff24: 18 16 cp r1, r24 ff26: 0c f4 brge .+2 ; 0xff2a ff28: 06 c1 rjmp .+524 ; 0x10136 ff2a: 2d 8d ldd r18, Y+29 ; 0x1d ff2c: 3e 8d ldd r19, Y+30 ; 0x1e ff2e: 4f 8d ldd r20, Y+31 ; 0x1f ff30: 58 a1 ldd r21, Y+32 ; 0x20 ff32: c7 01 movw r24, r14 ff34: b6 01 movw r22, r12 ff36: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> ff3a: 18 16 cp r1, r24 ff3c: 0c f4 brge .+2 ; 0xff40 ff3e: fb c0 rjmp .+502 ; 0x10136 continue; } } // increment the total point counter if the points are not skipped meshPointsToProbe++; ff40: 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++) { ff42: 1f 5f subi r17, 0xFF ; 255 ff44: 24 e0 ldi r18, 0x04 ; 4 ff46: 62 0e add r6, r18 ff48: 71 1c adc r7, r1 ff4a: 17 30 cpi r17, 0x07 ; 7 ff4c: 09 f0 breq .+2 ; 0xff50 ff4e: 79 cf rjmp .-270 ; 0xfe42 ff50: 6f ef ldi r22, 0xFF ; 255 ff52: 46 1a sub r4, r22 ff54: 56 0a sbc r5, r22 ff56: 88 85 ldd r24, Y+8 ; 0x08 ff58: 99 85 ldd r25, Y+9 ; 0x09 ff5a: 4c 96 adiw r24, 0x1c ; 28 ff5c: 99 87 std Y+9, r25 ; 0x09 ff5e: 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++) { ff60: 97 e0 ldi r25, 0x07 ; 7 ff62: 49 16 cp r4, r25 ff64: 51 04 cpc r5, r1 ff66: 09 f0 breq .+2 ; 0xff6a ff68: 63 cf rjmp .-314 ; 0xfe30 // increment the total point counter if the points are not skipped meshPointsToProbe++; } } mbl.upsample_3x3(); //upsample the default mesh ff6a: 0e 94 36 f1 call 0x1e26c ; 0x1e26c // Save custom message state, set a new custom message state to display: Calibrating point 9. CustomMsg custom_message_type_old = custom_message_type; ff6e: a0 91 c7 06 lds r26, 0x06C7 ; 0x8006c7 ff72: af 83 std Y+7, r26 ; 0x07 uint8_t custom_message_state_old = custom_message_state; ff74: b0 91 ac 03 lds r27, 0x03AC ; 0x8003ac ff78: b8 87 std Y+8, r27 ; 0x08 custom_message_type = CustomMsg::MeshBedLeveling; ff7a: 81 e0 ldi r24, 0x01 ; 1 ff7c: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 custom_message_state = meshPointsToProbe + 10; ff80: 8a e0 ldi r24, 0x0A ; 10 ff82: 83 0d add r24, r3 ff84: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac lcd_update(1); ff88: 81 e0 ldi r24, 0x01 ; 1 ff8a: 0e 94 38 69 call 0xd270 ; 0xd270 // Lift Z to a safe position before probing the first point current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; ff8e: 80 e0 ldi r24, 0x00 ; 0 ff90: 90 e0 ldi r25, 0x00 ; 0 ff92: a0 ea ldi r26, 0xA0 ; 160 ff94: b0 e4 ldi r27, 0x40 ; 64 ff96: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd ff9a: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe ff9e: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff ffa2: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); ffa6: 65 e5 ldi r22, 0x55 ; 85 ffa8: 75 e5 ldi r23, 0x55 ; 85 ffaa: 85 e5 ldi r24, 0x55 ; 85 ffac: 91 e4 ldi r25, 0x41 ; 65 ffae: 0f 94 2f 85 call 0x30a5e ; 0x30a5e // Cycle through all points and probe them int l_feedmultiply = setup_for_endstop_move(false); //save feedrate and feedmultiply, sets feedmultiply to 100 ffb2: 80 e0 ldi r24, 0x00 ; 0 ffb4: 0e 94 e4 5f call 0xbfc8 ; 0xbfc8 ffb8: 9c a3 std Y+36, r25 ; 0x24 ffba: 8b a3 std Y+35, r24 ; 0x23 ffbc: 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 ffbe: 83 2d mov r24, r3 ffc0: 67 e0 ldi r22, 0x07 ; 7 ffc2: 0f 94 4a a1 call 0x34294 ; 0x34294 <__udivmodqi4> ffc6: f8 2e mov r15, r24 ffc8: 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 ffca: 68 2f mov r22, r24 ffcc: 70 e0 ldi r23, 0x00 ; 0 ffce: 7f 87 std Y+15, r23 ; 0x0f ffd0: 6e 87 std Y+14, r22 ; 0x0e ffd2: 80 ff sbrs r24, 0 ffd4: 03 c0 rjmp .+6 ; 0xffdc ffd6: 76 e0 ldi r23, 0x06 ; 6 ffd8: 79 1b sub r23, r25 ffda: 07 2f mov r16, r23 bool isOn3x3Mesh = ((ix % 3 == 0) && (iy % 3 == 0)); ffdc: 80 2f mov r24, r16 ffde: 63 e0 ldi r22, 0x03 ; 3 ffe0: 0f 94 4a a1 call 0x34294 ; 0x34294 <__udivmodqi4> ffe4: 91 11 cpse r25, r1 ffe6: 05 c0 rjmp .+10 ; 0xfff2 ffe8: 8f 2d mov r24, r15 ffea: 0f 94 4a a1 call 0x34294 ; 0x34294 <__udivmodqi4> ffee: 11 e0 ldi r17, 0x01 ; 1 fff0: 91 11 cpse r25, r1 fff2: 10 e0 ldi r17, 0x00 ; 0 float x_pos = BED_X(ix); fff4: 80 2f mov r24, r16 fff6: 0f 94 24 8c call 0x31848 ; 0x31848 fffa: 68 8b std Y+16, r22 ; 0x10 fffc: 79 8b std Y+17, r23 ; 0x11 fffe: 8a 8b std Y+18, r24 ; 0x12 10000: 9b 8b std Y+19, r25 ; 0x13 float y_pos = BED_Y(iy); 10002: 8f 2d mov r24, r15 10004: 0f 94 24 8c call 0x31848 ; 0x31848 10008: 4b 01 movw r8, r22 1000a: 5c 01 movw r10, r24 if (nMeasPoints == 3) { 1000c: 8e 81 ldd r24, Y+6 ; 0x06 1000e: 83 30 cpi r24, 0x03 ; 3 10010: 09 f0 breq .+2 ; 0x10014 10012: 99 c0 rjmp .+306 ; 0x10146 if (!isOn3x3Mesh) { 10014: 11 11 cpse r17, r1 10016: c8 c0 rjmp .+400 ; 0x101a8 10018: 27 e0 ldi r18, 0x07 ; 7 1001a: ae 85 ldd r26, Y+14 ; 0x0e 1001c: bf 85 ldd r27, Y+15 ; 0x0f 1001e: 2a 9f mul r18, r26 10020: f0 01 movw r30, r0 10022: 2b 9f mul r18, r27 10024: f0 0d add r31, r0 10026: 11 24 eor r1, r1 10028: e0 0f add r30, r16 1002a: f1 1d adc r31, r1 1002c: ee 0f add r30, r30 1002e: ff 1f adc r31, r31 10030: ee 0f add r30, r30 10032: ff 1f adc r31, r31 10034: e4 56 subi r30, 0x64 ; 100 10036: fd 4e sbci r31, 0xED ; 237 10038: 60 e0 ldi r22, 0x00 ; 0 1003a: 70 e0 ldi r23, 0x00 ; 0 1003c: 80 ec ldi r24, 0xC0 ; 192 1003e: 9f e7 ldi r25, 0x7F ; 127 10040: 61 83 std Z+1, r22 ; 0x01 10042: 72 83 std Z+2, r23 ; 0x02 10044: 83 83 std Z+3, r24 ; 0x03 10046: 94 83 std Z+4, r25 ; 0x04 10048: 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) { 1004a: e1 e3 ldi r30, 0x31 ; 49 1004c: 3e 12 cpse r3, r30 1004e: b7 cf rjmp .-146 ; 0xffbe custom_message_state--; mesh_point++; lcd_update(1); } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 10050: 80 e0 ldi r24, 0x00 ; 0 10052: 90 e0 ldi r25, 0x00 ; 0 10054: a0 ea ldi r26, 0xA0 ; 160 10056: b0 e4 ldi r27, 0x40 ; 64 10058: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 1005c: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 10060: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 10064: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 10068: 65 e5 ldi r22, 0x55 ; 85 1006a: 75 e5 ldi r23, 0x55 ; 85 1006c: 85 e5 ldi r24, 0x55 ; 85 1006e: 91 e4 ldi r25, 0x41 ; 65 10070: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 10074: 0f 94 ce 22 call 0x2459c ; 0x2459c static uint8_t g80_fail_cnt = 0; if (mesh_point != MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) { 10078: b1 e3 ldi r27, 0x31 ; 49 1007a: 3b 16 cp r3, r27 1007c: 09 f4 brne .+2 ; 0x10080 1007e: 3c c2 rjmp .+1144 ; 0x104f8 if (g80_fail_cnt++ >= 1) { 10080: 80 91 3f 03 lds r24, 0x033F ; 0x80033f 10084: 91 e0 ldi r25, 0x01 ; 1 10086: 98 0f add r25, r24 10088: 90 93 3f 03 sts 0x033F, r25 ; 0x80033f 1008c: 88 23 and r24, r24 1008e: 09 f4 brne .+2 ; 0x10092 10090: d3 c1 rjmp .+934 ; 0x10438 print_stop(); 10092: 60 e0 ldi r22, 0x00 ; 0 10094: 80 e0 ldi r24, 0x00 ; 0 10096: 0e 94 cc ef call 0x1df98 ; 0x1df98 lcd_show_fullscreen_message_and_wait_P(_T(MSG_MBL_FAILED)); 1009a: 84 e3 ldi r24, 0x34 ; 52 1009c: 96 e3 ldi r25, 0x36 ; 54 1009e: 0e 94 a7 6c call 0xd94e ; 0xd94e 100a2: 0f 94 a9 0b call 0x21752 ; 0x21752 lcd_z_calibration_prompt(false); 100a6: 80 e0 ldi r24, 0x00 ; 0 100a8: 0f 94 6b 30 call 0x260d6 ; 0x260d6 current_position[E_AXIS] += default_retraction; plan_buffer_line_curposXYZE(400); } #endif // !PINDA_THERMISTOR exit: KEEPALIVE_STATE(NOT_BUSY); 100ac: 81 e0 ldi r24, 0x01 ; 1 100ae: 80 93 78 02 sts 0x0278, r24 ; 0x800278 // Restore custom message state lcd_setstatuspgm(MSG_WELCOME); 100b2: 87 e6 ldi r24, 0x67 ; 103 100b4: 9b e6 ldi r25, 0x6B ; 107 100b6: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 custom_message_type = custom_message_type_old; 100ba: 2f 81 ldd r18, Y+7 ; 0x07 100bc: 20 93 c7 06 sts 0x06C7, r18 ; 0x8006c7 custom_message_state = custom_message_state_old; 100c0: 68 85 ldd r22, Y+8 ; 0x08 100c2: 60 93 ac 03 sts 0x03AC, r22 ; 0x8003ac lcd_update(2); 100c6: 82 e0 ldi r24, 0x02 ; 2 100c8: 0e 94 38 69 call 0xd270 ; 0xd270 st_synchronize(); 100cc: 0f 94 ce 22 call 0x2459c ; 0x2459c mesh_bed_leveling_flag = false; 100d0: 10 92 06 12 sts 0x1206, r1 ; 0x801206 100d4: d6 cd rjmp .-1108 ; 0xfc82 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)) { 100d6: 01 11 cpse r16, r1 100d8: 03 c0 rjmp .+6 ; 0x100e0 100da: 11 23 and r17, r17 100dc: 09 f4 brne .+2 ; 0x100e0 100de: bc ce rjmp .-648 ; 0xfe58 // 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))); 100e0: 81 2f mov r24, r17 100e2: 63 e0 ldi r22, 0x03 ; 3 100e4: 0f 94 56 a1 call 0x342ac ; 0x342ac <__divmodqi4> 100e8: 84 0d add r24, r4 100ea: 95 2d mov r25, r5 100ec: 91 1d adc r25, r1 100ee: 88 0f add r24, r24 100f0: 99 1f adc r25, r25 100f2: 8d 53 subi r24, 0x3D ; 61 100f4: 90 4f sbci r25, 0xF0 ; 240 100f6: 0f 94 a9 a0 call 0x34152 ; 0x34152 const float z0 = mbl.z_values[0][0] + *reinterpret_cast(&z_offset_u) * 0.01; 100fa: bc 01 movw r22, r24 100fc: 99 0f add r25, r25 100fe: 88 0b sbc r24, r24 10100: 99 0b sbc r25, r25 10102: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 10106: 2a e0 ldi r18, 0x0A ; 10 10108: 37 ed ldi r19, 0xD7 ; 215 1010a: 43 e2 ldi r20, 0x23 ; 35 1010c: 5c e3 ldi r21, 0x3C ; 60 1010e: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 10112: 9b 01 movw r18, r22 10114: ac 01 movw r20, r24 10116: 60 91 9d 12 lds r22, 0x129D ; 0x80129d 1011a: 70 91 9e 12 lds r23, 0x129E ; 0x80129e 1011e: 80 91 9f 12 lds r24, 0x129F ; 0x80129f 10122: 90 91 a0 12 lds r25, 0x12A0 ; 0x8012a0 10126: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1012a: f3 01 movw r30, r6 1012c: 61 83 std Z+1, r22 ; 0x01 1012e: 72 83 std Z+2, r23 ; 0x02 10130: 83 83 std Z+3, r24 ; 0x03 10132: 94 83 std Z+4, r25 ; 0x04 10134: 91 ce rjmp .-734 ; 0xfe58 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)) { 10136: fe 85 ldd r31, Y+14 ; 0x0e 10138: ff 23 and r31, r31 1013a: 09 f4 brne .+2 ; 0x1013e 1013c: 02 cf rjmp .-508 ; 0xff42 1013e: 22 20 and r2, r2 10140: 09 f4 brne .+2 ; 0x10144 10142: fe ce rjmp .-516 ; 0xff40 10144: fe ce rjmp .-516 ; 0xff42 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)) { 10146: 28 89 ldd r18, Y+16 ; 0x10 10148: 39 89 ldd r19, Y+17 ; 0x11 1014a: 4a 89 ldd r20, Y+18 ; 0x12 1014c: 5b 89 ldd r21, Y+19 ; 0x13 1014e: 6a 85 ldd r22, Y+10 ; 0x0a 10150: 7b 85 ldd r23, Y+11 ; 0x0b 10152: 8c 85 ldd r24, Y+12 ; 0x0c 10154: 9d 85 ldd r25, Y+13 ; 0x0d 10156: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 1015a: 18 16 cp r1, r24 1015c: 04 f1 brlt .+64 ; 0x1019e 1015e: 28 89 ldd r18, Y+16 ; 0x10 10160: 39 89 ldd r19, Y+17 ; 0x11 10162: 4a 89 ldd r20, Y+18 ; 0x12 10164: 5b 89 ldd r21, Y+19 ; 0x13 10166: 69 8d ldd r22, Y+25 ; 0x19 10168: 7a 8d ldd r23, Y+26 ; 0x1a 1016a: 8b 8d ldd r24, Y+27 ; 0x1b 1016c: 9c 8d ldd r25, Y+28 ; 0x1c 1016e: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 10172: 87 fd sbrc r24, 7 10174: 14 c0 rjmp .+40 ; 0x1019e 10176: a5 01 movw r20, r10 10178: 94 01 movw r18, r8 1017a: 6c 89 ldd r22, Y+20 ; 0x14 1017c: 7d 89 ldd r23, Y+21 ; 0x15 1017e: 8e 89 ldd r24, Y+22 ; 0x16 10180: 9f 89 ldd r25, Y+23 ; 0x17 10182: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 10186: 18 16 cp r1, r24 10188: 54 f0 brlt .+20 ; 0x1019e 1018a: a5 01 movw r20, r10 1018c: 94 01 movw r18, r8 1018e: 6d 8d ldd r22, Y+29 ; 0x1d 10190: 7e 8d ldd r23, Y+30 ; 0x1e 10192: 8f 8d ldd r24, Y+31 ; 0x1f 10194: 98 a1 ldd r25, Y+32 ; 0x20 10196: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1019a: 87 ff sbrs r24, 7 1019c: 05 c0 rjmp .+10 ; 0x101a8 1019e: 11 23 and r17, r17 101a0: 09 f4 brne .+2 ; 0x101a4 101a2: 52 cf rjmp .-348 ; 0x10048 101a4: 21 10 cpse r2, r1 101a6: 50 cf rjmp .-352 ; 0x10048 mesh_point++; continue; //skip } // Move Z up to the probe height of the current Z point. const float z0 = mbl.z_values[iy][ix]; 101a8: 10 e0 ldi r17, 0x00 ; 0 101aa: a7 e0 ldi r26, 0x07 ; 7 101ac: 8e 85 ldd r24, Y+14 ; 0x0e 101ae: 9f 85 ldd r25, Y+15 ; 0x0f 101b0: a8 9f mul r26, r24 101b2: f0 01 movw r30, r0 101b4: a9 9f mul r26, r25 101b6: f0 0d add r31, r0 101b8: 11 24 eor r1, r1 101ba: e0 0f add r30, r16 101bc: f1 1f adc r31, r17 101be: ee 0f add r30, r30 101c0: ff 1f adc r31, r31 101c2: ee 0f add r30, r30 101c4: ff 1f adc r31, r31 101c6: e4 56 subi r30, 0x64 ; 100 101c8: fd 4e sbci r31, 0xED ; 237 101ca: 41 80 ldd r4, Z+1 ; 0x01 101cc: 52 80 ldd r5, Z+2 ; 0x02 101ce: 63 80 ldd r6, Z+3 ; 0x03 101d0: 74 80 ldd r7, Z+4 ; 0x04 const float init_z_bckp = !has_z ? MESH_HOME_Z_SEARCH : z0 + MESH_HOME_Z_SEARCH_FAST; 101d2: c1 2c mov r12, r1 101d4: d1 2c mov r13, r1 101d6: e0 ea ldi r30, 0xA0 ; 160 101d8: ee 2e mov r14, r30 101da: e0 e4 ldi r30, 0x40 ; 64 101dc: fe 2e mov r15, r30 101de: 22 20 and r2, r2 101e0: 51 f0 breq .+20 ; 0x101f6 101e2: 23 e3 ldi r18, 0x33 ; 51 101e4: 33 e3 ldi r19, 0x33 ; 51 101e6: 43 eb ldi r20, 0xB3 ; 179 101e8: 5e e3 ldi r21, 0x3E ; 62 101ea: c3 01 movw r24, r6 101ec: b2 01 movw r22, r4 101ee: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 101f2: 6b 01 movw r12, r22 101f4: 7c 01 movw r14, r24 if (init_z_bckp > current_position[Z_AXIS]) { 101f6: a7 01 movw r20, r14 101f8: 96 01 movw r18, r12 101fa: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 101fe: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 10202: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 10206: 90 91 00 12 lds r25, 0x1200 ; 0x801200 1020a: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1020e: 87 ff sbrs r24, 7 10210: 10 c0 rjmp .+32 ; 0x10232 current_position[Z_AXIS] = init_z_bckp; 10212: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 10216: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 1021a: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 1021e: f0 92 00 12 sts 0x1200, r15 ; 0x801200 plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 10222: 65 e5 ldi r22, 0x55 ; 85 10224: 75 e5 ldi r23, 0x55 ; 85 10226: 85 e5 ldi r24, 0x55 ; 85 10228: 91 e4 ldi r25, 0x41 ; 65 1022a: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 1022e: 0f 94 ce 22 call 0x2459c ; 0x2459c } // Move to XY position of the sensor point. current_position[X_AXIS] = x_pos; 10232: 68 89 ldd r22, Y+16 ; 0x10 10234: 79 89 ldd r23, Y+17 ; 0x11 10236: 8a 89 ldd r24, Y+18 ; 0x12 10238: 9b 89 ldd r25, Y+19 ; 0x13 1023a: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 1023e: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 10242: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 10246: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 current_position[Y_AXIS] = y_pos; 1024a: 80 92 f9 11 sts 0x11F9, r8 ; 0x8011f9 1024e: 90 92 fa 11 sts 0x11FA, r9 ; 0x8011fa 10252: a0 92 fb 11 sts 0x11FB, r10 ; 0x8011fb 10256: b0 92 fc 11 sts 0x11FC, r11 ; 0x8011fc world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 1025a: 69 ef ldi r22, 0xF9 ; 249 1025c: 71 e1 ldi r23, 0x11 ; 17 1025e: 85 ef ldi r24, 0xF5 ; 245 10260: 91 e1 ldi r25, 0x11 ; 17 10262: 0e 94 9c 63 call 0xc738 ; 0xc738 plan_buffer_line_curposXYZE(XY_AXIS_FEEDRATE); 10266: 60 e0 ldi r22, 0x00 ; 0 10268: 70 e0 ldi r23, 0x00 ; 0 1026a: 86 e1 ldi r24, 0x16 ; 22 1026c: 93 e4 ldi r25, 0x43 ; 67 1026e: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 10272: 0f 94 ce 22 call 0x2459c ; 0x2459c if (planner_aborted) 10276: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 1027a: 88 23 and r24, r24 1027c: 39 f0 breq .+14 ; 0x1028c { custom_message_type = custom_message_type_old; 1027e: 7f 81 ldd r23, Y+7 ; 0x07 10280: 70 93 c7 06 sts 0x06C7, r23 ; 0x8006c7 custom_message_state = custom_message_state_old; 10284: 88 85 ldd r24, Y+8 ; 0x08 10286: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac 1028a: fb cc rjmp .-1546 ; 0xfc82 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 1028c: 81 2c mov r8, r1 1028e: 91 2c mov r9, r1 10290: 70 e2 ldi r23, 0x20 ; 32 10292: a7 2e mov r10, r23 10294: 71 ec ldi r23, 0xC1 ; 193 10296: b7 2e mov r11, r23 10298: 22 20 and r2, r2 1029a: 51 f0 breq .+20 ; 0x102b0 1029c: 2a 81 ldd r18, Y+2 ; 0x02 1029e: 3b 81 ldd r19, Y+3 ; 0x03 102a0: 4c 81 ldd r20, Y+4 ; 0x04 102a2: 5d 81 ldd r21, Y+5 ; 0x05 102a4: c3 01 movw r24, r6 102a6: b2 01 movw r22, r4 102a8: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 102ac: 4b 01 movw r8, r22 102ae: 5c 01 movw r10, r24 102b0: 48 8d ldd r20, Y+24 ; 0x18 102b2: c5 01 movw r24, r10 102b4: b4 01 movw r22, r8 102b6: 0f 94 ba 56 call 0x2ad74 ; 0x2ad74 102ba: 81 11 cpse r24, r1 102bc: 0b c0 rjmp .+22 ; 0x102d4 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)); 102be: 87 e2 ldi r24, 0x27 ; 39 102c0: 92 e6 ldi r25, 0x62 ; 98 102c2: 0e 94 a7 6c call 0xd94e ; 0xd94e 102c6: 9f 93 push r25 102c8: 8f 93 push r24 102ca: 0f 94 5d 9f call 0x33eba ; 0x33eba 102ce: 0f 90 pop r0 102d0: 0f 90 pop r0 102d2: be ce rjmp .-644 ; 0x10050 // 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. 102d4: 20 91 fd 11 lds r18, 0x11FD ; 0x8011fd 102d8: 30 91 fe 11 lds r19, 0x11FE ; 0x8011fe 102dc: 40 91 ff 11 lds r20, 0x11FF ; 0x8011ff 102e0: 50 91 00 12 lds r21, 0x1200 ; 0x801200 102e4: c7 01 movw r24, r14 102e6: b6 01 movw r22, r12 102e8: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 102ec: 20 e0 ldi r18, 0x00 ; 0 102ee: 30 e0 ldi r19, 0x00 ; 0 102f0: a9 01 movw r20, r18 102f2: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 102f6: 87 ff sbrs r24, 7 102f8: 36 c0 rjmp .+108 ; 0x10366 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 102fa: 60 e0 ldi r22, 0x00 ; 0 102fc: 70 e0 ldi r23, 0x00 ; 0 102fe: 80 ea ldi r24, 0xA0 ; 160 10300: 90 e4 ldi r25, 0x40 ; 64 10302: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 10306: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 1030a: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 1030e: 90 93 00 12 sts 0x1200, r25 ; 0x801200 plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 10312: 65 e5 ldi r22, 0x55 ; 85 10314: 75 e5 ldi r23, 0x55 ; 85 10316: 85 e5 ldi r24, 0x55 ; 85 10318: 91 e4 ldi r25, 0x41 ; 65 1031a: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 1031e: 0f 94 ce 22 call 0x2459c ; 0x2459c 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 10322: 48 8d ldd r20, Y+24 ; 0x18 10324: c5 01 movw r24, r10 10326: b4 01 movw r22, r8 10328: 0f 94 ba 56 call 0x2ad74 ; 0x2ad74 1032c: 88 23 and r24, r24 1032e: 39 f2 breq .-114 ; 0x102be printf_P(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); break; } if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { 10330: 20 91 fd 11 lds r18, 0x11FD ; 0x8011fd 10334: 30 91 fe 11 lds r19, 0x11FE ; 0x8011fe 10338: 40 91 ff 11 lds r20, 0x11FF ; 0x8011ff 1033c: 50 91 00 12 lds r21, 0x1200 ; 0x801200 10340: 60 e0 ldi r22, 0x00 ; 0 10342: 70 e0 ldi r23, 0x00 ; 0 10344: 80 ea ldi r24, 0xA0 ; 160 10346: 90 e4 ldi r25, 0x40 ; 64 10348: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1034c: 2d ec ldi r18, 0xCD ; 205 1034e: 3c ec ldi r19, 0xCC ; 204 10350: 4c ec ldi r20, 0xCC ; 204 10352: 5d e3 ldi r21, 0x3D ; 61 10354: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 10358: 87 ff sbrs r24, 7 1035a: 05 c0 rjmp .+10 ; 0x10366 puts_P(PSTR("Bed leveling failed. Sensor triggered too soon")); 1035c: 8d ef ldi r24, 0xFD ; 253 1035e: 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")); 10360: 0f 94 84 9f call 0x33f08 ; 0x33f08 10364: 75 ce rjmp .-790 ; 0x10050 10366: c0 90 fd 11 lds r12, 0x11FD ; 0x8011fd 1036a: d0 90 fe 11 lds r13, 0x11FE ; 0x8011fe 1036e: e0 90 ff 11 lds r14, 0x11FF ; 0x8011ff 10372: 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 10376: 22 20 and r2, r2 10378: a1 f0 breq .+40 ; 0x103a2 1037a: a7 01 movw r20, r14 1037c: 96 01 movw r18, r12 1037e: c3 01 movw r24, r6 10380: b2 01 movw r22, r4 10382: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 10386: 9b 01 movw r18, r22 10388: ac 01 movw r20, r24 1038a: 5f 77 andi r21, 0x7F ; 127 1038c: 6a 81 ldd r22, Y+2 ; 0x02 1038e: 7b 81 ldd r23, Y+3 ; 0x03 10390: 8c 81 ldd r24, Y+4 ; 0x04 10392: 9d 81 ldd r25, Y+5 ; 0x05 10394: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 10398: 87 ff sbrs r24, 7 1039a: 03 c0 rjmp .+6 ; 0x103a2 puts_P(PSTR("Bed leveling failed. Too much variation from eeprom mesh")); 1039c: 84 ec ldi r24, 0xC4 ; 196 1039e: 96 e7 ldi r25, 0x76 ; 118 103a0: df cf rjmp .-66 ; 0x10360 } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 103a2: 8f ea ldi r24, 0xAF ; 175 103a4: 9f e0 ldi r25, 0x0F ; 15 103a6: 0f 94 9b a0 call 0x34136 ; 0x34136 103aa: 88 23 and r24, r24 103ac: 09 f4 brne .+2 ; 0x103b0 103ae: 40 c0 rjmp .+128 ; 0x10430 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); } 103b0: 86 ea ldi r24, 0xA6 ; 166 103b2: 9f e0 ldi r25, 0x0F ; 15 103b4: 0f 94 9b a0 call 0x34136 ; 0x34136 if (!calibration_status_pinda()) return 0; 103b8: 88 23 and r24, r24 103ba: d1 f1 breq .+116 ; 0x10430 return temp_comp_interpolation(temperature_pinda) / cs.axis_steps_per_mm[Z_AXIS]; 103bc: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 103c0: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 103c4: 80 91 90 06 lds r24, 0x0690 ; 0x800690 103c8: 90 91 91 06 lds r25, 0x0691 ; 0x800691 103cc: 0e 94 04 56 call 0xac08 ; 0xac08 103d0: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 103d4: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 103d8: 40 91 40 04 lds r20, 0x0440 ; 0x800440 103dc: 50 91 41 04 lds r21, 0x0441 ; 0x800441 103e0: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 103e4: 9b 01 movw r18, r22 103e6: ac 01 movw r20, r24 103e8: e7 e0 ldi r30, 0x07 ; 7 103ea: ae 85 ldd r26, Y+14 ; 0x0e 103ec: bf 85 ldd r27, Y+15 ; 0x0f 103ee: ea 9f mul r30, r26 103f0: c0 01 movw r24, r0 103f2: eb 9f mul r30, r27 103f4: 90 0d add r25, r0 103f6: 11 24 eor r1, r1 103f8: 08 0f add r16, r24 103fa: 19 1f adc r17, r25 103fc: 00 0f add r16, r16 103fe: 11 1f adc r17, r17 10400: 00 0f add r16, r16 10402: 11 1f adc r17, r17 10404: 04 56 subi r16, 0x64 ; 100 10406: 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; 10408: c7 01 movw r24, r14 1040a: b6 01 movw r22, r12 1040c: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 10410: d8 01 movw r26, r16 10412: 11 96 adiw r26, 0x01 ; 1 10414: 6d 93 st X+, r22 10416: 7d 93 st X+, r23 10418: 8d 93 st X+, r24 1041a: 9c 93 st X, r25 1041c: 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--; 1041e: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 10422: 81 50 subi r24, 0x01 ; 1 10424: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac mesh_point++; lcd_update(1); 10428: 81 e0 ldi r24, 0x01 ; 1 1042a: 0e 94 38 69 call 0xd270 ; 0xd270 1042e: 0c ce rjmp .-1000 ; 0x10048 } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 10430: 20 e0 ldi r18, 0x00 ; 0 10432: 30 e0 ldi r19, 0x00 ; 0 10434: a9 01 movw r20, r18 10436: d8 cf rjmp .-80 ; 0x103e8 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); 10438: 85 e0 ldi r24, 0x05 ; 5 1043a: 0f 94 2b 2d call 0x25a56 ; 0x25a56 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; 1043e: c1 2c mov r12, r1 10440: d1 2c mov r13, r1 10442: 90 ea ldi r25, 0xA0 ; 160 10444: e9 2e mov r14, r25 10446: 90 e4 ldi r25, 0x40 ; 64 10448: 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)); 1044a: 80 e0 ldi r24, 0x00 ; 0 1044c: 96 e3 ldi r25, 0x36 ; 54 1044e: 0e 94 a7 6c call 0xd94e ; 0xd94e 10452: 0f 94 22 0b call 0x21644 ; 0x21644 #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 10456: 90 e0 ldi r25, 0x00 ; 0 10458: 80 e0 ldi r24, 0x00 ; 0 1045a: 0f 94 59 35 call 0x26ab2 ; 0x26ab2 lcd_calibrate_z_end_stop_manual(true); // Z-leveling (X-assembly stay up!!!) 1045e: 81 e0 ldi r24, 0x01 ; 1 10460: 0f 94 b5 35 call 0x26b6a ; 0x26b6a #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); 10464: 80 e0 ldi r24, 0x00 ; 0 10466: 0f 94 06 2d call 0x25a0c ; 0x25a0c 1046a: 18 2f mov r17, r24 raise_z(-1); 1046c: 60 e0 ldi r22, 0x00 ; 0 1046e: 70 e0 ldi r23, 0x00 ; 0 10470: 80 e8 ldi r24, 0x80 ; 128 10472: 9f eb ldi r25, 0xBF ; 191 10474: 0e 94 d3 66 call 0xcda6 ; 0xcda6 enable_z_endstop(true); 10478: 81 e0 ldi r24, 0x01 ; 1 1047a: 0f 94 06 2d call 0x25a0c ; 0x25a0c #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif // TMC2130 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1047e: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 10482: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 10486: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 1048a: f0 92 00 12 sts 0x1200, r15 ; 0x801200 plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 1048e: 65 e5 ldi r22, 0x55 ; 85 10490: 75 e5 ldi r23, 0x55 ; 85 10492: 85 e5 ldi r24, 0x55 ; 85 10494: 91 e4 ldi r25, 0x41 ; 65 10496: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 1049a: 0f 94 ce 22 call 0x2459c ; 0x2459c #ifdef TMC2130 tmc2130_home_exit(); #endif // TMC2130 enable_z_endstop(bState); 1049e: 81 2f mov r24, r17 104a0: 0f 94 06 2d call 0x25a0c ; 0x25a0c } while (st_get_position_mm(Z_AXIS) > MESH_HOME_Z_SEARCH); // i.e. Z-leveling not o.k. 104a4: 82 e0 ldi r24, 0x02 ; 2 104a6: 0f 94 ba 22 call 0x24574 ; 0x24574 104aa: 20 e0 ldi r18, 0x00 ; 0 104ac: 30 e0 ldi r19, 0x00 ; 0 104ae: 40 ea ldi r20, 0xA0 ; 160 104b0: 50 e4 ldi r21, 0x40 ; 64 104b2: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 104b6: 18 16 cp r1, r24 104b8: 44 f2 brlt .-112 ; 0x1044a custom_message_type = custom_message_type_old; 104ba: ef 81 ldd r30, Y+7 ; 0x07 104bc: e0 93 c7 06 sts 0x06C7, r30 ; 0x8006c7 custom_message_state = custom_message_state_old; 104c0: f8 85 ldd r31, Y+8 ; 0x08 104c2: f0 93 ac 03 sts 0x03AC, r31 ; 0x8003ac lcd_update_enable(true); // display / status-line recovery 104c6: 81 e0 ldi r24, 0x01 ; 1 104c8: 0e 94 b6 69 call 0xd36c ; 0xd36c 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); 104cc: dd 24 eor r13, r13 104ce: d3 94 inc r13 104d0: df 92 push r13 104d2: 81 2c mov r8, r1 104d4: 91 2c mov r9, r1 104d6: 54 01 movw r10, r8 104d8: cc 24 eor r12, r12 104da: c3 94 inc r12 104dc: e1 2c mov r14, r1 104de: f1 2c mov r15, r1 104e0: 87 01 movw r16, r14 104e2: 21 e0 ldi r18, 0x01 ; 1 104e4: 40 e0 ldi r20, 0x00 ; 0 104e6: 50 e0 ldi r21, 0x00 ; 0 104e8: ba 01 movw r22, r20 104ea: 81 e0 ldi r24, 0x01 ; 1 104ec: 0e 94 69 67 call 0xced2 ; 0xced2 104f0: d0 92 e6 11 sts 0x11E6, r13 ; 0x8011e6 104f4: 0f 90 pop r0 104f6: c5 cb rjmp .-2166 ; 0xfc82 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. 104f8: 10 92 3f 03 sts 0x033F, r1 ; 0x80033f clean_up_after_endstop_move(l_feedmultiply); 104fc: 8b a1 ldd r24, Y+35 ; 0x23 104fe: 9c a1 ldd r25, Y+36 ; 0x24 10500: 0e 94 ca 5f call 0xbf94 ; 0xbf94 // Number of baby steps applied static int babystepLoadZ = 0; void babystep_load() { babystepLoadZ = 0; 10504: 10 92 2a 05 sts 0x052A, r1 ; 0x80052a <_ZL13babystepLoadZ.lto_priv.459+0x1> 10508: 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)) 1050c: 80 e1 ldi r24, 0x10 ; 16 1050e: 0e 94 52 d8 call 0x1b0a4 ; 0x1b0a4 10512: 88 23 and r24, r24 10514: 91 f0 breq .+36 ; 0x1053a { check_babystep(); //checking if babystep is in allowed range, otherwise setting babystep to 0 10516: 0e 94 a8 72 call 0xe550 ; 0xe550 // 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))); 1051a: 81 ea ldi r24, 0xA1 ; 161 1051c: 9d e0 ldi r25, 0x0D ; 13 1051e: 0f 94 9b a0 call 0x34136 ; 0x34136 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-> 10522: 2b e0 ldi r18, 0x0B ; 11 10524: 82 9f mul r24, r18 10526: c0 01 movw r24, r0 10528: 11 24 eor r1, r1 1052a: 80 5b subi r24, 0xB0 ; 176 1052c: 92 4f sbci r25, 0xF2 ; 242 1052e: 0f 94 a9 a0 call 0x34152 ; 0x34152 10532: 90 93 2a 05 sts 0x052A, r25 ; 0x80052a <_ZL13babystepLoadZ.lto_priv.459+0x1> 10536: 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])); 1053a: 60 91 29 05 lds r22, 0x0529 ; 0x800529 <_ZL13babystepLoadZ.lto_priv.459> 1053e: 70 91 2a 05 lds r23, 0x052A ; 0x80052a <_ZL13babystepLoadZ.lto_priv.459+0x1> 10542: 07 2e mov r0, r23 10544: 00 0c add r0, r0 10546: 88 0b sbc r24, r24 10548: 99 0b sbc r25, r25 1054a: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 1054e: 90 58 subi r25, 0x80 ; 128 10550: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 10554: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 10558: 40 91 40 04 lds r20, 0x0440 ; 0x800440 1055c: 50 91 41 04 lds r21, 0x0441 ; 0x800441 10560: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 10564: 0f 94 90 8b call 0x31720 ; 0x31720 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; 10568: 80 ec ldi r24, 0xC0 ; 192 1056a: 9f e0 ldi r25, 0x0F ; 15 1056c: 0f 94 9b a0 call 0x34136 ; 0x34136 10570: 91 e0 ldi r25, 0x01 ; 1 10572: 81 30 cpi r24, 0x01 ; 1 10574: 09 f0 breq .+2 ; 0x10578 10576: 90 e0 ldi r25, 0x00 ; 0 } } else if (eeprom_bed_correction_valid) { return (int8_t)eeprom_read_byte(eep_address); } return 0; }; 10578: 99 83 std Y+1, r25 ; 0x01 const int8_t correction[4] = { bedCorrectHelper('L', (uint8_t*)EEPROM_BED_CORRECTION_LEFT), 1057a: 4f eb ldi r20, 0xBF ; 191 1057c: 5f e0 ldi r21, 0x0F ; 15 1057e: 6c e4 ldi r22, 0x4C ; 76 10580: ce 01 movw r24, r28 10582: 01 96 adiw r24, 0x01 ; 1 10584: 0e 94 5a 55 call 0xaab4 ; 0xaab4 10588: f8 2e mov r15, r24 bedCorrectHelper('R', (uint8_t*)EEPROM_BED_CORRECTION_RIGHT), 1058a: 4e eb ldi r20, 0xBE ; 190 1058c: 5f e0 ldi r21, 0x0F ; 15 1058e: 62 e5 ldi r22, 0x52 ; 82 10590: ce 01 movw r24, r28 10592: 01 96 adiw r24, 0x01 ; 1 10594: 0e 94 5a 55 call 0xaab4 ; 0xaab4 10598: 08 2f mov r16, r24 bedCorrectHelper('F', (uint8_t*)EEPROM_BED_CORRECTION_FRONT), 1059a: 4d eb ldi r20, 0xBD ; 189 1059c: 5f e0 ldi r21, 0x0F ; 15 1059e: 66 e4 ldi r22, 0x46 ; 70 105a0: ce 01 movw r24, r28 105a2: 01 96 adiw r24, 0x01 ; 1 105a4: 0e 94 5a 55 call 0xaab4 ; 0xaab4 105a8: 18 2f mov r17, r24 bedCorrectHelper('B', (uint8_t*)EEPROM_BED_CORRECTION_REAR), 105aa: 4c eb ldi r20, 0xBC ; 188 105ac: 5f e0 ldi r21, 0x0F ; 15 105ae: 62 e4 ldi r22, 0x42 ; 66 105b0: ce 01 movw r24, r28 105b2: 01 96 adiw r24, 0x01 ; 1 105b4: 0e 94 5a 55 call 0xaab4 ; 0xaab4 105b8: 21 2f mov r18, r17 105ba: 11 0f add r17, r17 105bc: 33 0b sbc r19, r19 105be: 08 2e mov r0, r24 105c0: 00 0c add r0, r0 105c2: 99 0b sbc r25, r25 105c4: 5c 01 movw r10, r24 105c6: a2 1a sub r10, r18 105c8: b3 0a sbc r11, r19 105ca: 8f 2d mov r24, r15 105cc: ff 0c add r15, r15 105ce: 99 0b sbc r25, r25 105d0: 28 0f add r18, r24 105d2: 39 1f adc r19, r25 105d4: 46 e0 ldi r20, 0x06 ; 6 105d6: 42 9f mul r20, r18 105d8: 60 01 movw r12, r0 105da: 43 9f mul r20, r19 105dc: d0 0c add r13, r0 105de: 11 24 eor r1, r1 105e0: f1 2c mov r15, r1 105e2: e1 2c mov r14, r1 105e4: 00 2e mov r0, r16 105e6: 00 0c add r0, r0 105e8: 11 0b sbc r17, r17 105ea: 08 1b sub r16, r24 105ec: 19 0b sbc r17, r25 105ee: b7 01 movw r22, r14 105f0: 63 56 subi r22, 0x63 ; 99 105f2: 7d 4e sbci r23, 0xED ; 237 105f4: 3b 01 movw r6, r22 105f6: 46 01 movw r8, r12 105f8: 77 e0 ldi r23, 0x07 ; 7 105fa: 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 * ( 105fc: d3 01 movw r26, r6 105fe: 2d 90 ld r2, X+ 10600: 3d 90 ld r3, X+ 10602: 4d 90 ld r4, X+ 10604: 5d 90 ld r5, X+ 10606: 3d 01 movw r6, r26 10608: fd 01 movw r30, r26 1060a: 34 97 sbiw r30, 0x04 ; 4 1060c: fb 87 std Y+11, r31 ; 0x0b 1060e: ea 87 std Y+10, r30 ; 0x0a 10610: b4 01 movw r22, r8 10612: 09 2c mov r0, r9 10614: 00 0c add r0, r0 10616: 88 0b sbc r24, r24 10618: 99 0b sbc r25, r25 1061a: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 1061e: 2f e3 ldi r18, 0x3F ; 63 10620: 33 ec ldi r19, 0xC3 ; 195 10622: 4e e2 ldi r20, 0x2E ; 46 10624: 59 e3 ldi r21, 0x39 ; 57 10626: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1062a: a2 01 movw r20, r4 1062c: 91 01 movw r18, r2 1062e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 10632: aa 85 ldd r26, Y+10 ; 0x0a 10634: bb 85 ldd r27, Y+11 ; 0x0b 10636: 6d 93 st X+, r22 10638: 7d 93 st X+, r23 1063a: 8d 93 st X+, r24 1063c: 9c 93 st X, r25 1063e: 13 97 sbiw r26, 0x03 ; 3 10640: ba 81 ldd r27, Y+2 ; 0x02 10642: b1 50 subi r27, 0x01 ; 1 10644: ba 83 std Y+2, r27 ; 0x02 10646: 80 0e add r8, r16 10648: 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++) { 1064a: b1 11 cpse r27, r1 1064c: d7 cf rjmp .-82 ; 0x105fc 1064e: ca 0c add r12, r10 10650: db 1c adc r13, r11 10652: ec e1 ldi r30, 0x1C ; 28 10654: ee 0e add r14, r30 10656: 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++) { 10658: f4 ec ldi r31, 0xC4 ; 196 1065a: ef 16 cp r14, r31 1065c: f1 04 cpc r15, r1 1065e: 39 f6 brne .-114 ; 0x105ee + 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) 10660: 0e 94 36 f1 call 0x1e26c ; 0x1e26c { // apply magnet compensation uint8_t useMagnetCompensation = code_seen('M') ? code_value_uint8() : eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION); 10664: 8d e4 ldi r24, 0x4D ; 77 10666: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1066a: 88 23 and r24, r24 1066c: 09 f4 brne .+2 ; 0x10670 1066e: 84 c0 rjmp .+264 ; 0x10778 10670: 0e 94 40 55 call 0xaa80 ; 0xaa80 if (nMeasPoints == 7 && useMagnetCompensation) { 10674: 2e 81 ldd r18, Y+6 ; 0x06 10676: 27 30 cpi r18, 0x07 ; 7 10678: 09 f0 breq .+2 ; 0x1067c 1067a: 94 c0 rjmp .+296 ; 0x107a4 1067c: 88 23 and r24, r24 1067e: 09 f4 brne .+2 ; 0x10682 10680: 91 c0 rjmp .+290 ; 0x107a4 10682: bb 24 eor r11, r11 10684: b3 94 inc r11 10686: aa 24 eor r10, r10 10688: aa 94 dec r10 1068a: ab 0c add r10, r11 1068c: 09 a1 ldd r16, Y+33 ; 0x21 1068e: 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++) { 10690: 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++; } 10692: 8e ef ldi r24, 0xFE ; 254 10694: 88 2e mov r8, r24 10696: 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)) { 10698: 6a 2d mov r22, r10 1069a: 86 2d mov r24, r6 1069c: 0f 94 5b 8b call 0x316b6 ; 0x316b6 106a0: 99 24 eor r9, r9 106a2: 93 94 inc r9 106a4: 96 0c add r9, r6 106a6: 81 11 cpse r24, r1 106a8: 6e c0 rjmp .+220 ; 0x10786 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++; } 106aa: 6b 2d mov r22, r11 106ac: 86 2d mov r24, r6 106ae: 0f 94 5b 8b call 0x316b6 ; 0x316b6 } 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; 106b2: c1 2c mov r12, r1 106b4: d1 2c mov r13, r1 106b6: 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; 106b8: 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++; } 106ba: 88 23 and r24, r24 106bc: 81 f0 breq .+32 ; 0x106de 106be: 20 e0 ldi r18, 0x00 ; 0 106c0: 30 e0 ldi r19, 0x00 ; 0 106c2: a9 01 movw r20, r18 106c4: d8 01 movw r26, r16 106c6: 5d 96 adiw r26, 0x1d ; 29 106c8: 6d 91 ld r22, X+ 106ca: 7d 91 ld r23, X+ 106cc: 8d 91 ld r24, X+ 106ce: 9c 91 ld r25, X 106d0: 90 97 sbiw r26, 0x20 ; 32 106d2: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 106d6: 6b 01 movw r12, r22 106d8: 7c 01 movw r14, r24 106da: 77 24 eor r7, r7 106dc: 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++; } 106de: 68 2d mov r22, r8 106e0: 86 2d mov r24, r6 106e2: 0f 94 5b 8b call 0x316b6 ; 0x316b6 106e6: 88 23 and r24, r24 106e8: 69 f0 breq .+26 ; 0x10704 106ea: f8 01 movw r30, r16 106ec: 7b 97 sbiw r30, 0x1b ; 27 106ee: 20 81 ld r18, Z 106f0: 31 81 ldd r19, Z+1 ; 0x01 106f2: 42 81 ldd r20, Z+2 ; 0x02 106f4: 53 81 ldd r21, Z+3 ; 0x03 106f6: c7 01 movw r24, r14 106f8: b6 01 movw r22, r12 106fa: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 106fe: 6b 01 movw r12, r22 10700: 7c 01 movw r14, r24 10702: 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++; } 10704: 6a 2d mov r22, r10 10706: 89 2d mov r24, r9 10708: 0f 94 5b 8b call 0x316b6 ; 0x316b6 1070c: 88 23 and r24, r24 1070e: 61 f0 breq .+24 ; 0x10728 10710: f8 01 movw r30, r16 10712: 25 81 ldd r18, Z+5 ; 0x05 10714: 36 81 ldd r19, Z+6 ; 0x06 10716: 47 81 ldd r20, Z+7 ; 0x07 10718: 50 85 ldd r21, Z+8 ; 0x08 1071a: c7 01 movw r24, r14 1071c: b6 01 movw r22, r12 1071e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 10722: 6b 01 movw r12, r22 10724: 7c 01 movw r14, r24 10726: 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++; } 10728: 6a 2d mov r22, r10 1072a: 8f ef ldi r24, 0xFF ; 255 1072c: 86 0d add r24, r6 1072e: 0f 94 5b 8b call 0x316b6 ; 0x316b6 10732: 88 23 and r24, r24 10734: 31 f1 breq .+76 ; 0x10782 10736: f8 01 movw r30, r16 10738: 33 97 sbiw r30, 0x03 ; 3 1073a: 20 81 ld r18, Z 1073c: 31 81 ldd r19, Z+1 ; 0x01 1073e: 42 81 ldd r20, Z+2 ; 0x02 10740: 53 81 ldd r21, Z+3 ; 0x03 10742: c7 01 movw r24, r14 10744: b6 01 movw r22, r12 10746: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1074a: 6b 01 movw r12, r22 1074c: 7c 01 movw r14, r24 1074e: 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 10750: 67 2d mov r22, r7 10752: 70 e0 ldi r23, 0x00 ; 0 10754: 90 e0 ldi r25, 0x00 ; 0 10756: 80 e0 ldi r24, 0x00 ; 0 10758: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 1075c: 9b 01 movw r18, r22 1075e: ac 01 movw r20, r24 10760: c7 01 movw r24, r14 10762: b6 01 movw r22, r12 10764: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 10768: d8 01 movw r26, r16 1076a: 11 96 adiw r26, 0x01 ; 1 1076c: 6d 93 st X+, r22 1076e: 7d 93 st X+, r23 10770: 8d 93 st X+, r24 10772: 9c 93 st X, r25 10774: 14 97 sbiw r26, 0x04 ; 4 10776: 07 c0 rjmp .+14 ; 0x10786 } 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); 10778: 8c ea ldi r24, 0xAC ; 172 1077a: 9d e0 ldi r25, 0x0D ; 13 1077c: 0f 94 9b a0 call 0x34136 ; 0x34136 10780: 79 cf rjmp .-270 ; 0x10674 10782: 71 10 cpse r7, r1 10784: e5 cf rjmp .-54 ; 0x10750 //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++) { 10786: 69 2c mov r6, r9 10788: 0c 5f subi r16, 0xFC ; 252 1078a: 1f 4f sbci r17, 0xFF ; 255 1078c: b7 e0 ldi r27, 0x07 ; 7 1078e: 9b 12 cpse r9, r27 10790: 83 cf rjmp .-250 ; 0x10698 10792: b3 94 inc r11 10794: e9 a1 ldd r30, Y+33 ; 0x21 10796: fa a1 ldd r31, Y+34 ; 0x22 10798: 7c 96 adiw r30, 0x1c ; 28 1079a: fa a3 std Y+34, r31 ; 0x22 1079c: 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++) { 1079e: f8 e0 ldi r31, 0x08 ; 8 107a0: bf 12 cpse r11, r31 107a2: 71 cf rjmp .-286 ; 0x10686 if (nMeasPoints == 7 && useMagnetCompensation) { mbl_magnet_elimination(); } } mbl.active = 1; //activate mesh bed leveling 107a4: 81 e0 ldi r24, 0x01 ; 1 107a6: 80 93 9c 12 sts 0x129C, r24 ; 0x80129c if (code_seen('O') && !code_value_uint8()) { 107aa: 8f e4 ldi r24, 0x4F ; 79 107ac: 0e 94 2b 55 call 0xaa56 ; 0xaa56 107b0: 81 11 cpse r24, r1 107b2: 03 c0 rjmp .+6 ; 0x107ba // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); } else { go_home_with_z_lift(); 107b4: 0f 94 e5 8b call 0x317ca ; 0x317ca 107b8: 79 cc rjmp .-1806 ; 0x100ac } } mbl.active = 1; //activate mesh bed leveling if (code_seen('O') && !code_value_uint8()) { 107ba: 0e 94 40 55 call 0xaa80 ; 0xaa80 107be: 81 11 cpse r24, r1 107c0: f9 cf rjmp .-14 ; 0x107b4 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 107c2: 0e 94 bf 5f call 0xbf7e ; 0xbf7e 107c6: 72 cc rjmp .-1820 ; 0x100ac 000107c8 : 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() 107c8: 2f 92 push r2 107ca: 3f 92 push r3 107cc: 4f 92 push r4 107ce: 5f 92 push r5 107d0: 6f 92 push r6 107d2: 7f 92 push r7 107d4: 8f 92 push r8 107d6: 9f 92 push r9 107d8: af 92 push r10 107da: bf 92 push r11 107dc: cf 92 push r12 107de: df 92 push r13 107e0: ef 92 push r14 107e2: ff 92 push r15 107e4: 0f 93 push r16 107e6: 1f 93 push r17 107e8: cf 93 push r28 107ea: df 93 push r29 107ec: cd b7 in r28, 0x3d ; 61 107ee: de b7 in r29, 0x3e ; 62 107f0: c3 56 subi r28, 0x63 ; 99 107f2: d1 09 sbc r29, r1 107f4: 0f b6 in r0, 0x3f ; 63 107f6: f8 94 cli 107f8: de bf out 0x3e, r29 ; 62 107fa: 0f be out 0x3f, r0 ; 63 107fc: cd bf out 0x3d, r28 ; 61 #endif /* CMDBUFFER_DEBUG */ unsigned long codenum; //throw away variable // PRUSA GCODES KEEPALIVE_STATE(IN_HANDLER); 107fe: 82 e0 ldi r24, 0x02 ; 2 10800: 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) { 10804: 00 91 cb 11 lds r16, 0x11CB ; 0x8011cb 10808: 10 91 cc 11 lds r17, 0x11CC ; 0x8011cc 1080c: 0f 51 subi r16, 0x1F ; 31 1080e: 10 4f sbci r17, 0xF0 ; 240 10810: 45 e0 ldi r20, 0x05 ; 5 10812: 50 e0 ldi r21, 0x00 ; 0 10814: 60 e2 ldi r22, 0x20 ; 32 10816: 71 e8 ldi r23, 0x81 ; 129 10818: c8 01 movw r24, r16 1081a: 0f 94 7a 9e call 0x33cf4 ; 0x33cf4 1081e: 89 2b or r24, r25 10820: 09 f0 breq .+2 ; 0x10824 10822: 9b c1 rjmp .+822 ; 0x10b5a eeprom_update_byte_notify((uint8_t*)EEPROM_FAN_CHECK_ENABLED, true); } } bool farm_prusa_code_seen() { if (!farm_mode) 10824: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 10828: 88 23 and r24, r24 1082a: 09 f4 brne .+2 ; 0x1082e 1082c: 4d c0 rjmp .+154 ; 0x108c8 return false; if (code_seen_P(PSTR("PRN"))) { // PRUSA PRN 1082e: 8e e2 ldi r24, 0x2E ; 46 10830: 9e e7 ldi r25, 0x7E ; 126 10832: 0f 94 10 75 call 0x2ea20 ; 0x2ea20 10836: 88 23 and r24, r24 10838: 79 f0 breq .+30 ; 0x10858 printf_P(_N("%u"), status_number); 1083a: 80 91 f7 16 lds r24, 0x16F7 ; 0x8016f7 <_ZL13status_number.lto_priv.496> 1083e: 1f 92 push r1 10840: 8f 93 push r24 10842: 82 ef ldi r24, 0xF2 ; 242 10844: 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); 10846: 9f 93 push r25 10848: 8f 93 push r24 1084a: 0f 94 5d 9f call 0x33eba ; 0x33eba 1084e: 0f 90 pop r0 10850: 0f 90 pop r0 10852: 0f 90 pop r0 10854: 0f 90 pop r0 10856: 08 c0 rjmp .+16 ; 0x10868 } else if (code_seen_P(PSTR("thx"))) { // PRUSA thx 10858: 8a e2 ldi r24, 0x2A ; 42 1085a: 9e e7 ldi r25, 0x7E ; 126 1085c: 0f 94 10 75 call 0x2ea20 ; 0x2ea20 10860: 88 23 and r24, r24 10862: 41 f0 breq .+16 ; 0x10874 no_response = false; 10864: 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); 10868: 81 e0 ldi r24, 0x01 ; 1 1086a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 ClearToSend(); 1086e: 0e 94 fc 72 call 0xe5f8 ; 0xe5f8 10872: 3a c2 rjmp .+1140 ; 0x10ce8 trace(); prusa_sd_card_upload = true; card.openFileWrite(strchr_pointer+4); } #endif //PRUSA_M28 else if (code_seen_P(PSTR("fv"))) { // PRUSA fv 10874: 87 e2 ldi r24, 0x27 ; 39 10876: 9e e7 ldi r25, 0x7E ; 126 10878: 0f 94 10 75 call 0x2ea20 ; 0x2ea20 1087c: 88 23 and r24, r24 1087e: 21 f1 breq .+72 ; 0x108c8 // get file version #ifdef SDSUPPORT card.openFileReadFilteredGcode(strchr_pointer + 3, true); 10880: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 10884: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 10888: 61 e0 ldi r22, 0x01 ; 1 1088a: 03 96 adiw r24, 0x03 ; 3 1088c: 0f 94 c5 4c call 0x2998a ; 0x2998a FORCE_INLINE bool isFileOpen() { return file.isOpen(); } bool eof() { return sdpos>=filesize; } FORCE_INLINE int16_t getFilteredGcodeChar() { int16_t c = (int16_t)file.readFilteredGcode(); 10890: 0f 94 8d 49 call 0x2931a ; 0x2931a 10894: 8c 01 movw r16, r24 sdpos = file.curPosition(); 10896: 80 91 02 16 lds r24, 0x1602 ; 0x801602 1089a: 90 91 03 16 lds r25, 0x1603 ; 0x801603 1089e: a0 91 04 16 lds r26, 0x1604 ; 0x801604 108a2: b0 91 05 16 lds r27, 0x1605 ; 0x801605 108a6: 80 93 7e 16 sts 0x167E, r24 ; 0x80167e 108aa: 90 93 7f 16 sts 0x167F, r25 ; 0x80167f 108ae: a0 93 80 16 sts 0x1680, r26 ; 0x801680 108b2: b0 93 81 16 sts 0x1681, r27 ; 0x801681 while (true) { uint16_t readByte = card.getFilteredGcodeChar(); MYSERIAL.write(readByte); 108b6: 80 2f mov r24, r16 108b8: 0e 94 37 70 call 0xe06e ; 0xe06e if (readByte == '\n') { 108bc: 0a 30 cpi r16, 0x0A ; 10 108be: 11 05 cpc r17, r1 108c0: 39 f7 brne .-50 ; 0x10890 break; } } card.closefile(); 108c2: 0f 94 9c 42 call 0x28538 ; 0x28538 108c6: d0 cf rjmp .-96 ; 0x10868 - `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"))) { 108c8: 86 e1 ldi r24, 0x16 ; 22 108ca: 91 e8 ldi r25, 0x81 ; 129 108cc: 0f 94 10 75 call 0x2ea20 ; 0x2ea20 108d0: 81 11 cpse r24, r1 108d2: ca cf rjmp .-108 ; 0x10868 gcode_PRUSA_BadRAMBoFanTest(); } else if (code_seen_P(PSTR("FAN"))) { // PRUSA FAN 108d4: 82 e1 ldi r24, 0x12 ; 18 108d6: 91 e8 ldi r25, 0x81 ; 129 108d8: 0f 94 10 75 call 0x2ea20 ; 0x2ea20 108dc: 88 23 and r24, r24 108de: 21 f1 breq .+72 ; 0x10928 printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]); 108e0: 40 91 87 03 lds r20, 0x0387 ; 0x800387 108e4: 50 91 88 03 lds r21, 0x0388 ; 0x800388 108e8: 2c e3 ldi r18, 0x3C ; 60 108ea: 24 9f mul r18, r20 108ec: c0 01 movw r24, r0 108ee: 25 9f mul r18, r21 108f0: 90 0d add r25, r0 108f2: 11 24 eor r1, r1 108f4: 9f 93 push r25 108f6: 8f 93 push r24 108f8: 40 91 85 03 lds r20, 0x0385 ; 0x800385 108fc: 50 91 86 03 lds r21, 0x0386 ; 0x800386 10900: 24 9f mul r18, r20 10902: c0 01 movw r24, r0 10904: 25 9f mul r18, r21 10906: 90 0d add r25, r0 10908: 11 24 eor r1, r1 1090a: 9f 93 push r25 1090c: 8f 93 push r24 1090e: 86 e2 ldi r24, 0x26 ; 38 10910: 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); 10912: 9f 93 push r25 10914: 8f 93 push r24 10916: 0f 94 5d 9f call 0x33eba ; 0x33eba 1091a: 0f 90 pop r0 1091c: 0f 90 pop r0 1091e: 0f 90 pop r0 10920: 0f 90 pop r0 10922: 0f 90 pop r0 10924: 0f 90 pop r0 10926: a0 cf rjmp .-192 ; 0x10868 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 10928: 8d e0 ldi r24, 0x0D ; 13 1092a: 91 e8 ldi r25, 0x81 ; 129 1092c: 0f 94 10 75 call 0x2ea20 ; 0x2ea20 10930: 88 23 and r24, r24 10932: 11 f1 breq .+68 ; 0x10978 if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD) { 10934: 8c e8 ldi r24, 0x8C ; 140 10936: 9f e0 ldi r25, 0x0F ; 15 10938: 0f 94 9b a0 call 0x34136 ; 0x34136 1093c: 81 11 cpse r24, r1 1093e: 10 c0 rjmp .+32 ; 0x10960 // M24 - Start SD print enquecommand_P(MSG_M24); 10940: 61 e0 ldi r22, 0x01 ; 1 10942: 85 ee ldi r24, 0xE5 ; 229 10944: 9b e6 ldi r25, 0x6B ; 107 10946: 0e 94 ac 7c call 0xf958 ; 0xf958 1094a: 60 e0 ldi r22, 0x00 ; 0 1094c: 85 ea ldi r24, 0xA5 ; 165 1094e: 9f e0 ldi r25, 0x0F ; 15 10950: 0f 94 bf a0 call 0x3417e ; 0x3417e 10954: 60 e0 ldi r22, 0x00 ; 0 10956: 8f e7 ldi r24, 0x7F ; 127 10958: 9c e0 ldi r25, 0x0C ; 12 1095a: 0f 94 bf a0 call 0x3417e ; 0x3417e 1095e: 84 cf rjmp .-248 ; 0x10868 // 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) { 10960: 81 30 cpi r24, 0x01 ; 1 10962: 09 f0 breq .+2 ; 0x10966 10964: 81 cf rjmp .-254 ; 0x10868 // 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(); 10966: 0f 94 e2 20 call 0x241c4 ; 0x241c4 usb_timer.start(); 1096a: 85 ed ldi r24, 0xD5 ; 213 1096c: 91 e1 ldi r25, 0x11 ; 17 1096e: 0f 94 5e 10 call 0x220bc ; 0x220bc ::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(); 10972: 0f 94 08 10 call 0x22010 ; 0x22010 10976: 78 cf rjmp .-272 ; 0x10868 } } else if (code_seen_P(PSTR("MMURES"))) { // PRUSA MMURES 10978: 86 e0 ldi r24, 0x06 ; 6 1097a: 91 e8 ldi r25, 0x81 ; 129 1097c: 0f 94 10 75 call 0x2ea20 ; 0x2ea20 10980: 88 23 and r24, r24 10982: 21 f0 breq .+8 ; 0x1098c break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 10984: 80 e0 ldi r24, 0x00 ; 0 10986: 0f 94 1c 63 call 0x2c638 ; 0x2c638 1098a: 6e cf rjmp .-292 ; 0x10868 MMU2::mmu2.Reset(MMU2::MMU2::Software); } else if (code_seen_P(PSTR("RESET"))) { // PRUSA RESET 1098c: 80 e0 ldi r24, 0x00 ; 0 1098e: 91 e8 ldi r25, 0x81 ; 129 10990: 0f 94 10 75 call 0x2ea20 ; 0x2ea20 10994: 81 11 cpse r24, r1 #if defined(XFLASH) && defined(BOOTAPP) boot_app_magic = 0; #endif //defined(XFLASH) && defined(BOOTAPP) softReset(); 10996: 0e 94 9d 60 call 0xc13a ; 0xc13a } else if (code_seen_P(PSTR("SN"))) { // PRUSA SN 1099a: 8d ef ldi r24, 0xFD ; 253 1099c: 90 e8 ldi r25, 0x80 ; 128 1099e: 0f 94 10 75 call 0x2ea20 ; 0x2ea20 109a2: 88 23 and r24, r24 109a4: a9 f0 breq .+42 ; 0x109d0 char SN[20]; eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); 109a6: 44 e1 ldi r20, 0x14 ; 20 109a8: 50 e0 ldi r21, 0x00 ; 0 109aa: 65 e1 ldi r22, 0x15 ; 21 109ac: 7d e0 ldi r23, 0x0D ; 13 109ae: ce 01 movw r24, r28 109b0: 01 96 adiw r24, 0x01 ; 1 109b2: 0f 94 8b a0 call 0x34116 ; 0x34116 if (SN[19]) 109b6: 8c 89 ldd r24, Y+20 ; 0x14 109b8: 88 23 and r24, r24 109ba: 29 f0 breq .+10 ; 0x109c6 puts_P(PSTR("SN invalid")); 109bc: 82 ef ldi r24, 0xF2 ; 242 109be: 90 e8 ldi r25, 0x80 ; 128 109c0: 0f 94 84 9f call 0x33f08 ; 0x33f08 109c4: 51 cf rjmp .-350 ; 0x10868 else puts(SN); 109c6: ce 01 movw r24, r28 109c8: 01 96 adiw r24, 0x01 ; 1 109ca: 0f 94 2a a7 call 0x34e54 ; 0x34e54 109ce: 4c cf rjmp .-360 ; 0x10868 } else if(code_seen_P(PSTR("Fir"))){ // PRUSA Fir 109d0: 8e ee ldi r24, 0xEE ; 238 109d2: 90 e8 ldi r25, 0x80 ; 128 109d4: 0f 94 10 75 call 0x2ea20 ; 0x2ea20 109d8: 88 23 and r24, r24 109da: 29 f0 breq .+10 ; 0x109e6 SERIAL_PROTOCOLLNPGM(FW_VERSION_FULL); 109dc: 82 ee ldi r24, 0xE2 ; 226 109de: 90 e8 ldi r25, 0x80 ; 128 else { SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); 109e0: 0e 94 49 72 call 0xe492 ; 0xe492 109e4: 41 cf rjmp .-382 ; 0x10868 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 109e6: 8e ed ldi r24, 0xDE ; 222 109e8: 90 e8 ldi r25, 0x80 ; 128 109ea: 0f 94 10 75 call 0x2ea20 ; 0x2ea20 109ee: 88 23 and r24, r24 109f0: 19 f0 breq .+6 ; 0x109f8 SERIAL_PROTOCOLLNPGM(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE ); 109f2: 8e eb ldi r24, 0xBE ; 190 109f4: 90 e8 ldi r25, 0x80 ; 128 109f6: f4 cf rjmp .-24 ; 0x109e0 } else if(code_seen_P(PSTR("Lang"))) { // PRUSA Lang 109f8: 89 eb ldi r24, 0xB9 ; 185 109fa: 90 e8 ldi r25, 0x80 ; 128 109fc: 0f 94 10 75 call 0x2ea20 ; 0x2ea20 10a00: 88 23 and r24, r24 10a02: 19 f0 breq .+6 ; 0x10a0a lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 10a04: 0e 94 aa 6b call 0xd754 ; 0xd754 10a08: 2f cf rjmp .-418 ; 0x10868 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 10a0a: 86 eb ldi r24, 0xB6 ; 182 10a0c: 90 e8 ldi r25, 0x80 ; 128 10a0e: 0f 94 10 75 call 0x2ea20 ; 0x2ea20 10a12: 88 23 and r24, r24 10a14: 79 f0 breq .+30 ; 0x10a34 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 10a16: 81 ea ldi r24, 0xA1 ; 161 10a18: 9d e0 ldi r25, 0x0D ; 13 10a1a: 0f 94 9b a0 call 0x34136 ; 0x34136 10a1e: 2b e0 ldi r18, 0x0B ; 11 10a20: 82 9f mul r24, r18 10a22: c0 01 movw r24, r0 10a24: 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); 10a26: 70 e0 ldi r23, 0x00 ; 0 10a28: 60 e0 ldi r22, 0x00 ; 0 10a2a: 80 5b subi r24, 0xB0 ; 176 10a2c: 92 4f sbci r25, 0xF2 ; 242 10a2e: 0f 94 dd a0 call 0x341ba ; 0x341ba 10a32: 1a cf rjmp .-460 ; 0x10868 } else if(code_seen_P(PSTR("FR"))) { // PRUSA FR 10a34: 83 eb ldi r24, 0xB3 ; 179 10a36: 90 e8 ldi r25, 0x80 ; 128 10a38: 0f 94 10 75 call 0x2ea20 ; 0x2ea20 10a3c: 88 23 and r24, r24 10a3e: 51 f0 breq .+20 ; 0x10a54 // 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(); 10a40: 0e 94 a4 69 call 0xd348 ; 0xd348 Sound_MakeCustom(100,0,false); 10a44: 40 e0 ldi r20, 0x00 ; 0 10a46: 70 e0 ldi r23, 0x00 ; 0 10a48: 60 e0 ldi r22, 0x00 ; 0 10a4a: 84 e6 ldi r24, 0x64 ; 100 10a4c: 90 e0 ldi r25, 0x00 ; 0 10a4e: 0f 94 6f 32 call 0x264de ; 0x264de 10a52: d8 cf rjmp .-80 ; 0x10a04 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 10a54: 8f ea ldi r24, 0xAF ; 175 10a56: 90 e8 ldi r25, 0x80 ; 128 10a58: 0f 94 10 75 call 0x2ea20 ; 0x2ea20 10a5c: 88 23 and r24, r24 10a5e: e1 f0 breq .+56 ; 0x10a98 // Change the MBL status without changing the logical Z position. if(code_seen('V')) { 10a60: 86 e5 ldi r24, 0x56 ; 86 10a62: 0e 94 2b 55 call 0xaa56 ; 0xaa56 10a66: 88 23 and r24, r24 10a68: 09 f4 brne .+2 ; 0x10a6c 10a6a: fe ce rjmp .-516 ; 0x10868 bool value = code_value_short(); 10a6c: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 10a70: 11 e0 ldi r17, 0x01 ; 1 10a72: 89 2b or r24, r25 10a74: 09 f4 brne .+2 ; 0x10a78 10a76: 10 e0 ldi r17, 0x00 ; 0 st_synchronize(); 10a78: 0f 94 ce 22 call 0x2459c ; 0x2459c if(value != mbl.active) { 10a7c: 80 91 9c 12 lds r24, 0x129C ; 0x80129c 10a80: 90 e0 ldi r25, 0x00 ; 0 10a82: 18 17 cp r17, r24 10a84: 19 06 cpc r1, r25 10a86: 09 f4 brne .+2 ; 0x10a8a 10a88: ef ce rjmp .-546 ; 0x10868 mbl.active = value; 10a8a: 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]); 10a8e: 8d ef ldi r24, 0xFD ; 253 10a90: 91 e1 ldi r25, 0x11 ; 17 10a92: 0f 94 ba 75 call 0x2eb74 ; 0x2eb74 10a96: e8 ce rjmp .-560 ; 0x10868 } } } else if (code_seen_P(PSTR("nozzle"))) { // PRUSA nozzle 10a98: 88 ea ldi r24, 0xA8 ; 168 10a9a: 90 e8 ldi r25, 0x80 ; 128 10a9c: 0f 94 10 75 call 0x2ea20 ; 0x2ea20 10aa0: 88 23 and r24, r24 10aa2: 09 f4 brne .+2 ; 0x10aa6 10aa4: e1 ce rjmp .-574 ; 0x10868 uint16_t nDiameter; if(code_seen('D')) { 10aa6: 84 e4 ldi r24, 0x44 ; 68 10aa8: 0e 94 2b 55 call 0xaa56 ; 0xaa56 10aac: 88 23 and r24, r24 10aae: a1 f0 breq .+40 ; 0x10ad8 nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 10ab0: 0e 94 03 5a call 0xb406 ; 0xb406 10ab4: 20 e0 ldi r18, 0x00 ; 0 10ab6: 30 e0 ldi r19, 0x00 ; 0 10ab8: 4a e7 ldi r20, 0x7A ; 122 10aba: 54 e4 ldi r21, 0x44 ; 68 10abc: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 10ac0: 20 e0 ldi r18, 0x00 ; 0 10ac2: 30 e0 ldi r19, 0x00 ; 0 10ac4: 40 e0 ldi r20, 0x00 ; 0 10ac6: 5f e3 ldi r21, 0x3F ; 63 10ac8: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 10acc: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> nozzle_diameter_check(nDiameter); 10ad0: cb 01 movw r24, r22 10ad2: 0e 94 58 f0 call 0x1e0b0 ; 0x1e0b0 10ad6: c8 ce rjmp .-624 ; 0x10868 } else if(code_seen_P(PSTR("set")) && farm_mode) { 10ad8: 84 ea ldi r24, 0xA4 ; 164 10ada: 90 e8 ldi r25, 0x80 ; 128 10adc: 0f 94 10 75 call 0x2ea20 ; 0x2ea20 10ae0: 88 23 and r24, r24 10ae2: 49 f1 breq .+82 ; 0x10b36 10ae4: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 10ae8: 88 23 and r24, r24 10aea: 29 f1 breq .+74 ; 0x10b36 strchr_pointer++; // skip 1st char (~ 's') strchr_pointer++; // skip 2nd char (~ 'e') 10aec: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 10af0: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 10af4: 02 96 adiw r24, 0x02 ; 2 10af6: 90 93 f6 16 sts 0x16F6, r25 ; 0x8016f6 10afa: 80 93 f5 16 sts 0x16F5, r24 ; 0x8016f5 nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 10afe: 0e 94 03 5a call 0xb406 ; 0xb406 10b02: 6b 01 movw r12, r22 10b04: 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); 10b06: 6f ef ldi r22, 0xFF ; 255 10b08: 87 ea ldi r24, 0xA7 ; 167 10b0a: 9d e0 ldi r25, 0x0D ; 13 10b0c: 0f 94 bf a0 call 0x3417e ; 0x3417e 10b10: 20 e0 ldi r18, 0x00 ; 0 10b12: 30 e0 ldi r19, 0x00 ; 0 10b14: 4a e7 ldi r20, 0x7A ; 122 10b16: 54 e4 ldi r21, 0x44 ; 68 10b18: c7 01 movw r24, r14 10b1a: b6 01 movw r22, r12 10b1c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 10b20: 20 e0 ldi r18, 0x00 ; 0 10b22: 30 e0 ldi r19, 0x00 ; 0 10b24: 40 e0 ldi r20, 0x00 ; 0 10b26: 5f e3 ldi r21, 0x3F ; 63 10b28: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 10b2c: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 10b30: 85 ea ldi r24, 0xA5 ; 165 10b32: 9d e0 ldi r25, 0x0D ; 13 10b34: 7c cf rjmp .-264 ; 0x10a2e 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); 10b36: 85 ea ldi r24, 0xA5 ; 165 10b38: 9d e0 ldi r25, 0x0D ; 13 10b3a: 0f 94 a9 a0 call 0x34152 ; 0x34152 10b3e: bc 01 movw r22, r24 10b40: 90 e0 ldi r25, 0x00 ; 0 10b42: 80 e0 ldi r24, 0x00 ; 0 10b44: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 10b48: 20 e0 ldi r18, 0x00 ; 0 10b4a: 30 e0 ldi r19, 0x00 ; 0 10b4c: 4a e7 ldi r20, 0x7A ; 122 10b4e: 54 e4 ldi r21, 0x44 ; 68 10b50: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 10b54: 0f 94 45 42 call 0x2848a ; 0x2848a 10b58: 87 ce rjmp .-754 ; 0x10868 } } else if(*CMDBUFFER_CURRENT_STRING == 'G') 10b5a: d8 01 movw r26, r16 10b5c: 8c 91 ld r24, X 10b5e: 87 34 cpi r24, 0x47 ; 71 10b60: 11 f0 breq .+4 ; 0x10b66 10b62: 0c 94 d8 90 jmp 0x121b0 ; 0x121b0 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 10b66: 10 93 f6 16 sts 0x16F6, r17 ; 0x8016f6 10b6a: 00 93 f5 16 sts 0x16F5, r16 ; 0x8016f5 gcode_in_progress = code_value_short(); 10b6e: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 10b72: 90 93 58 03 sts 0x0358, r25 ; 0x800358 10b76: 80 93 57 03 sts 0x0357, r24 ; 0x800357 // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 10b7a: 8b 34 cpi r24, 0x4B ; 75 10b7c: 91 05 cpc r25, r1 10b7e: 09 f4 brne .+2 ; 0x10b82 10b80: 45 c6 rjmp .+3210 ; 0x1180c 10b82: 0c f0 brlt .+2 ; 0x10b86 10b84: 4b c1 rjmp .+662 ; 0x10e1c 10b86: 84 30 cpi r24, 0x04 ; 4 10b88: 91 05 cpc r25, r1 10b8a: 09 f4 brne .+2 ; 0x10b8e 10b8c: aa c5 rjmp .+2900 ; 0x116e2 10b8e: 0c f0 brlt .+2 ; 0x10b92 10b90: c5 c0 rjmp .+394 ; 0x10d1c 10b92: 97 fd sbrc r25, 7 10b94: cf c0 rjmp .+414 ; 0x10d34 10b96: 02 97 sbiw r24, 0x02 ; 2 10b98: 0c f0 brlt .+2 ; 0x10b9c 10b9a: a2 c1 rjmp .+836 ; 0x10ee0 */ case 0: // G0 -> G1 case 1: // G1 { uint16_t start_segment_idx = restore_interrupted_gcode(); 10b9c: 0e 94 75 54 call 0xa8ea ; 0xa8ea 10ba0: 8c 01 movw r16, r24 get_coordinates(); // For X Y Z E F 10ba2: 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 10ba6: 60 91 84 06 lds r22, 0x0684 ; 0x800684 10baa: 70 91 85 06 lds r23, 0x0685 ; 0x800685 10bae: 80 91 86 06 lds r24, 0x0686 ; 0x800686 10bb2: 90 91 87 06 lds r25, 0x0687 ; 0x800687 10bb6: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 10bba: 6b 01 movw r12, r22 10bbc: 7c 01 movw r14, r24 10bbe: 40 90 01 12 lds r4, 0x1201 ; 0x801201 10bc2: 50 90 02 12 lds r5, 0x1202 ; 0x801202 10bc6: 60 90 03 12 lds r6, 0x1203 ; 0x801203 10bca: 70 90 04 12 lds r7, 0x1204 ; 0x801204 10bce: 80 90 9f 06 lds r8, 0x069F ; 0x80069f 10bd2: 90 90 a0 06 lds r9, 0x06A0 ; 0x8006a0 10bd6: a0 90 a1 06 lds r10, 0x06A1 ; 0x8006a1 10bda: b0 90 a2 06 lds r11, 0x06A2 ; 0x8006a2 10bde: a5 01 movw r20, r10 10be0: 94 01 movw r18, r8 10be2: c3 01 movw r24, r6 10be4: b2 01 movw r22, r4 10be6: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 10bea: 20 e0 ldi r18, 0x00 ; 0 10bec: 30 e0 ldi r19, 0x00 ; 0 10bee: 48 ec ldi r20, 0xC8 ; 200 10bf0: 52 e4 ldi r21, 0x42 ; 66 10bf2: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 10bf6: 9b 01 movw r18, r22 10bf8: ac 01 movw r20, r24 10bfa: c7 01 movw r24, r14 10bfc: b6 01 movw r22, r12 10bfe: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 10c02: 18 16 cp r1, r24 10c04: d4 f4 brge .+52 ; 0x10c3a total_filament_used = total_filament_used + ((destination[E_AXIS] - current_position[E_AXIS]) * 100); 10c06: a3 01 movw r20, r6 10c08: 92 01 movw r18, r4 10c0a: c5 01 movw r24, r10 10c0c: b4 01 movw r22, r8 10c0e: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 10c12: 20 e0 ldi r18, 0x00 ; 0 10c14: 30 e0 ldi r19, 0x00 ; 0 10c16: 48 ec ldi r20, 0xC8 ; 200 10c18: 52 e4 ldi r21, 0x42 ; 66 10c1a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 10c1e: a7 01 movw r20, r14 10c20: 96 01 movw r18, r12 10c22: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 10c26: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 10c2a: 60 93 84 06 sts 0x0684, r22 ; 0x800684 10c2e: 70 93 85 06 sts 0x0685, r23 ; 0x800685 10c32: 80 93 86 06 sts 0x0686, r24 ; 0x800686 10c36: 90 93 87 06 sts 0x0687, r25 ; 0x800687 } #ifdef FWRETRACT if(cs.autoretract_enabled) { 10c3a: 80 91 b4 04 lds r24, 0x04B4 ; 0x8004b4 10c3e: 88 23 and r24, r24 10c40: 09 f4 brne .+2 ; 0x10c44 10c42: 46 c1 rjmp .+652 ; 0x10ed0 if( !(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) { 10c44: 88 e5 ldi r24, 0x58 ; 88 10c46: 0e 94 2b 55 call 0xaa56 ; 0xaa56 10c4a: 81 11 cpse r24, r1 10c4c: 41 c1 rjmp .+642 ; 0x10ed0 10c4e: 89 e5 ldi r24, 0x59 ; 89 10c50: 0e 94 2b 55 call 0xaa56 ; 0xaa56 10c54: 81 11 cpse r24, r1 10c56: 3c c1 rjmp .+632 ; 0x10ed0 10c58: 8a e5 ldi r24, 0x5A ; 90 10c5a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 10c5e: 81 11 cpse r24, r1 10c60: 37 c1 rjmp .+622 ; 0x10ed0 10c62: 85 e4 ldi r24, 0x45 ; 69 10c64: 0e 94 2b 55 call 0xaa56 ; 0xaa56 10c68: 88 23 and r24, r24 10c6a: 09 f4 brne .+2 ; 0x10c6e 10c6c: 31 c1 rjmp .+610 ; 0x10ed0 float echange=destination[E_AXIS]-current_position[E_AXIS]; 10c6e: 20 91 01 12 lds r18, 0x1201 ; 0x801201 10c72: 30 91 02 12 lds r19, 0x1202 ; 0x801202 10c76: 40 91 03 12 lds r20, 0x1203 ; 0x801203 10c7a: 50 91 04 12 lds r21, 0x1204 ; 0x801204 10c7e: 60 91 9f 06 lds r22, 0x069F ; 0x80069f 10c82: 70 91 a0 06 lds r23, 0x06A0 ; 0x8006a0 10c86: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 10c8a: 90 91 a2 06 lds r25, 0x06A2 ; 0x8006a2 10c8e: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 10c92: 6b 01 movw r12, r22 10c94: 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 10c96: 2d ec ldi r18, 0xCD ; 205 10c98: 3c ec ldi r19, 0xCC ; 204 10c9a: 4c ec ldi r20, 0xCC ; 204 10c9c: 5d eb ldi r21, 0xBD ; 189 10c9e: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 10ca2: 87 ff sbrs r24, 7 10ca4: 07 c1 rjmp .+526 ; 0x10eb4 10ca6: 80 91 03 05 lds r24, 0x0503 ; 0x800503 10caa: 81 11 cpse r24, r1 10cac: 0c 94 1b b0 jmp 0x16036 ; 0x16036 st_synchronize(); 10cb0: 0f 94 ce 22 call 0x2459c ; 0x2459c current_position[E_AXIS] = destination[E_AXIS]; //hide the slicer-generated retract/recover from calculations 10cb4: 80 91 9f 06 lds r24, 0x069F ; 0x80069f 10cb8: 90 91 a0 06 lds r25, 0x06A0 ; 0x8006a0 10cbc: a0 91 a1 06 lds r26, 0x06A1 ; 0x8006a1 10cc0: b0 91 a2 06 lds r27, 0x06A2 ; 0x8006a2 10cc4: 80 93 01 12 sts 0x1201, r24 ; 0x801201 10cc8: 90 93 02 12 sts 0x1202, r25 ; 0x801202 10ccc: a0 93 03 12 sts 0x1203, r26 ; 0x801203 10cd0: b0 93 04 12 sts 0x1204, r27 ; 0x801204 plan_set_e_position(current_position[E_AXIS]); //AND from the planner 10cd4: 81 e0 ldi r24, 0x01 ; 1 10cd6: 92 e1 ldi r25, 0x12 ; 18 10cd8: 0f 94 87 75 call 0x2eb0e ; 0x2eb0e retract(!retracted[active_extruder]); 10cdc: 90 91 03 05 lds r25, 0x0503 ; 0x800503 10ce0: 81 e0 ldi r24, 0x01 ; 1 10ce2: 89 27 eor r24, r25 10ce4: 0e 94 50 be call 0x17ca0 ; 0x17ca0 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); ClearToSend(); } 10ce8: cd 59 subi r28, 0x9D ; 157 10cea: df 4f sbci r29, 0xFF ; 255 10cec: 0f b6 in r0, 0x3f ; 63 10cee: f8 94 cli 10cf0: de bf out 0x3e, r29 ; 62 10cf2: 0f be out 0x3f, r0 ; 63 10cf4: cd bf out 0x3d, r28 ; 61 10cf6: df 91 pop r29 10cf8: cf 91 pop r28 10cfa: 1f 91 pop r17 10cfc: 0f 91 pop r16 10cfe: ff 90 pop r15 10d00: ef 90 pop r14 10d02: df 90 pop r13 10d04: cf 90 pop r12 10d06: bf 90 pop r11 10d08: af 90 pop r10 10d0a: 9f 90 pop r9 10d0c: 8f 90 pop r8 10d0e: 7f 90 pop r7 10d10: 6f 90 pop r6 10d12: 5f 90 pop r5 10d14: 4f 90 pop r4 10d16: 3f 90 pop r3 10d18: 2f 90 pop r2 10d1a: 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) 10d1c: 85 31 cpi r24, 0x15 ; 21 10d1e: 91 05 cpc r25, r1 10d20: 09 f4 brne .+2 ; 0x10d24 10d22: d9 c0 rjmp .+434 ; 0x10ed6 10d24: fc f4 brge .+62 ; 0x10d64 10d26: 8a 30 cpi r24, 0x0A ; 10 10d28: 91 05 cpc r25, r1 10d2a: 09 f4 brne .+2 ; 0x10d2e 10d2c: 23 c5 rjmp .+2630 ; 0x11774 10d2e: 0b 97 sbiw r24, 0x0b ; 11 10d30: 09 f4 brne .+2 ; 0x10d34 10d32: 24 c5 rjmp .+2632 ; 0x1177c case 99: farm_gcode_g99(); break; #endif //PRUSA_FARM default: printf_P(MSG_UNKNOWN_CODE, 'G', cmdbuffer + bufindr + CMDHDRSIZE); 10d34: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 10d38: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 10d3c: 8f 51 subi r24, 0x1F ; 31 10d3e: 90 4f sbci r25, 0xF0 ; 240 10d40: 9f 93 push r25 10d42: 8f 93 push r24 10d44: 1f 92 push r1 10d46: 87 e4 ldi r24, 0x47 ; 71 10d48: 8f 93 push r24 10d4a: 88 e4 ldi r24, 0x48 ; 72 10d4c: 96 e6 ldi r25, 0x66 ; 102 10d4e: 9f 93 push r25 10d50: 8f 93 push r24 10d52: 0f 94 5d 9f call 0x33eba ; 0x33eba 10d56: 0f 90 pop r0 10d58: 0f 90 pop r0 10d5a: 0f 90 pop r0 10d5c: 0f 90 pop r0 10d5e: 0f 90 pop r0 10d60: 0f 90 pop r0 10d62: b9 c0 rjmp .+370 ; 0x10ed6 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) 10d64: 8c 31 cpi r24, 0x1C ; 28 10d66: 91 05 cpc r25, r1 10d68: 09 f4 brne .+2 ; 0x10d6c 10d6a: 0a c5 rjmp .+2580 ; 0x11780 10d6c: 4e 97 sbiw r24, 0x1e ; 30 10d6e: 11 f7 brne .-60 ; 0x10d34 Sensor must be over the bed. The maximum travel distance before an error is triggered is 10mm. */ case 30: { st_synchronize(); 10d70: 0f 94 ce 22 call 0x2459c ; 0x2459c homing_flag = true; 10d74: 81 e0 ldi r24, 0x01 ; 1 10d76: 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(); 10d7a: 0e 94 e4 5f call 0xbfc8 ; 0xbfc8 10d7e: 8c 01 movw r16, r24 feedrate = homing_feedrate[Z_AXIS]; 10d80: 80 e0 ldi r24, 0x00 ; 0 10d82: 90 e0 ldi r25, 0x00 ; 0 10d84: a8 e4 ldi r26, 0x48 ; 72 10d86: b4 e4 ldi r27, 0x44 ; 68 10d88: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a 10d8c: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b 10d90: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c 10d94: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d find_bed_induction_sensor_point_z(-10.f, 3); 10d98: 43 e0 ldi r20, 0x03 ; 3 10d9a: 60 e0 ldi r22, 0x00 ; 0 10d9c: 70 e0 ldi r23, 0x00 ; 0 10d9e: 80 e2 ldi r24, 0x20 ; 32 10da0: 91 ec ldi r25, 0xC1 ; 193 10da2: 0f 94 ba 56 call 0x2ad74 ; 0x2ad74 printf_P(_N("%S X: %.5f Y: %.5f Z: %.5f\n"), _T(MSG_BED), _x, _y, _z); 10da6: 70 90 fd 11 lds r7, 0x11FD ; 0x8011fd 10daa: 60 90 fe 11 lds r6, 0x11FE ; 0x8011fe 10dae: 50 90 ff 11 lds r5, 0x11FF ; 0x8011ff 10db2: 40 90 00 12 lds r4, 0x1200 ; 0x801200 10db6: b0 90 f9 11 lds r11, 0x11F9 ; 0x8011f9 10dba: a0 90 fa 11 lds r10, 0x11FA ; 0x8011fa 10dbe: 90 90 fb 11 lds r9, 0x11FB ; 0x8011fb 10dc2: 80 90 fc 11 lds r8, 0x11FC ; 0x8011fc 10dc6: f0 90 f5 11 lds r15, 0x11F5 ; 0x8011f5 10dca: e0 90 f6 11 lds r14, 0x11F6 ; 0x8011f6 10dce: d0 90 f7 11 lds r13, 0x11F7 ; 0x8011f7 10dd2: c0 90 f8 11 lds r12, 0x11F8 ; 0x8011f8 10dd6: 8d e6 ldi r24, 0x6D ; 109 10dd8: 95 e5 ldi r25, 0x55 ; 85 10dda: 0e 94 a7 6c call 0xd94e ; 0xd94e 10dde: 4f 92 push r4 10de0: 5f 92 push r5 10de2: 6f 92 push r6 10de4: 7f 92 push r7 10de6: 8f 92 push r8 10de8: 9f 92 push r9 10dea: af 92 push r10 10dec: bf 92 push r11 10dee: cf 92 push r12 10df0: df 92 push r13 10df2: ef 92 push r14 10df4: ff 92 push r15 10df6: 9f 93 push r25 10df8: 8f 93 push r24 10dfa: 81 e0 ldi r24, 0x01 ; 1 10dfc: 97 e6 ldi r25, 0x67 ; 103 10dfe: 9f 93 push r25 10e00: 8f 93 push r24 10e02: 0f 94 5d 9f call 0x33eba ; 0x33eba clean_up_after_endstop_move(l_feedmultiply); 10e06: c8 01 movw r24, r16 10e08: 0e 94 ca 5f call 0xbf94 ; 0xbf94 homing_flag = false; 10e0c: 10 92 05 12 sts 0x1205, r1 ; 0x801205 10e10: 0f b6 in r0, 0x3f ; 63 10e12: f8 94 cli 10e14: de bf out 0x3e, r29 ; 62 10e16: 0f be out 0x3f, r0 ; 63 10e18: cd bf out 0x3d, r28 ; 61 10e1a: 5d c0 rjmp .+186 ; 0x10ed6 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) 10e1c: 88 35 cpi r24, 0x58 ; 88 10e1e: 91 05 cpc r25, r1 10e20: 09 f4 brne .+2 ; 0x10e24 10e22: 59 c0 rjmp .+178 ; 0x10ed6 10e24: f4 f4 brge .+60 ; 0x10e62 10e26: 81 35 cpi r24, 0x51 ; 81 10e28: 91 05 cpc r25, r1 10e2a: 11 f4 brne .+4 ; 0x10e30 10e2c: 0c 94 1e 90 jmp 0x1203c ; 0x1203c 10e30: 5c f4 brge .+22 ; 0x10e48 10e32: 8c 34 cpi r24, 0x4C ; 76 10e34: 91 05 cpc r25, r1 10e36: 09 f4 brne .+2 ; 0x10e3a 10e38: 0c c5 rjmp .+2584 ; 0x11852 10e3a: 80 35 cpi r24, 0x50 ; 80 10e3c: 91 05 cpc r25, r1 10e3e: 09 f0 breq .+2 ; 0x10e42 10e40: 79 cf rjmp .-270 ; 0x10d34 - `W` - area width (on X axis) - `H` - area height (on Y axis) */ case 80: { gcode_G80(); 10e42: 0e 94 0a 7e call 0xfc14 ; 0xfc14 10e46: 47 c0 rjmp .+142 ; 0x10ed6 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) 10e48: 86 35 cpi r24, 0x56 ; 86 10e4a: 91 05 cpc r25, r1 10e4c: 11 f4 brne .+4 ; 0x10e52 10e4e: 0c 94 22 90 jmp 0x12044 ; 0x12044 10e52: 87 35 cpi r24, 0x57 ; 87 10e54: 91 05 cpc r25, r1 10e56: 09 f0 breq .+2 ; 0x10e5a 10e58: 6d cf rjmp .-294 ; 0x10d34 This G-code will be performed at the end of a calibration script. (Prusa3D specific) */ case 87: calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 10e5a: 80 e1 ldi r24, 0x10 ; 16 10e5c: 0e 94 83 c6 call 0x18d06 ; 0x18d06 10e60: 3a c0 rjmp .+116 ; 0x10ed6 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) 10e62: 8c 35 cpi r24, 0x5C ; 92 10e64: 91 05 cpc r25, r1 10e66: 11 f4 brne .+4 ; 0x10e6c 10e68: 0c 94 2e 90 jmp 0x1205c ; 0x1205c 10e6c: 74 f4 brge .+28 ; 0x10e8a 10e6e: 8a 35 cpi r24, 0x5A ; 90 10e70: 91 05 cpc r25, r1 10e72: 11 f4 brne .+4 ; 0x10e78 10e74: 0c 94 27 90 jmp 0x1204e ; 0x1204e 10e78: 8b 35 cpi r24, 0x5B ; 91 10e7a: 91 05 cpc r25, r1 10e7c: 09 f0 breq .+2 ; 0x10e80 10e7e: 5a cf rjmp .-332 ; 0x10d34 /*! ### 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; 10e80: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb 10e84: 87 60 ori r24, 0x07 ; 7 10e86: 0c 94 2a 90 jmp 0x12054 ; 0x12054 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) 10e8a: 82 36 cpi r24, 0x62 ; 98 10e8c: 91 05 cpc r25, r1 10e8e: 11 f4 brne .+4 ; 0x10e94 10e90: 0c 94 c5 90 jmp 0x1218a ; 0x1218a 10e94: 83 36 cpi r24, 0x63 ; 99 10e96: 91 05 cpc r25, r1 10e98: 09 f0 breq .+2 ; 0x10e9c 10e9a: 4c cf rjmp .-360 ; 0x10d34 lcd_update(2); fCheckModeInit(); // alternatively invoke printer reset } void farm_disable() { farm_mode = false; 10e9c: 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); 10ea0: 60 e0 ldi r22, 0x00 ; 0 10ea2: 84 ec ldi r24, 0xC4 ; 196 10ea4: 9f e0 ldi r25, 0x0F ; 15 10ea6: 0f 94 bf a0 call 0x3417e ; 0x3417e fCheckModeInit(); // alternatively invoke printer reset } void farm_gcode_g99() { farm_disable(); lcd_update(2); 10eaa: 82 e0 ldi r24, 0x02 ; 2 10eac: 0e 94 38 69 call 0xd270 ; 0xd270 10eb0: 0c 94 d4 90 jmp 0x121a8 ; 0x121a8 #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 10eb4: 2d ec ldi r18, 0xCD ; 205 10eb6: 3c ec ldi r19, 0xCC ; 204 10eb8: 4c ec ldi r20, 0xCC ; 204 10eba: 5d e3 ldi r21, 0x3D ; 61 10ebc: c7 01 movw r24, r14 10ebe: b6 01 movw r22, r12 10ec0: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 10ec4: 18 16 cp r1, r24 10ec6: 24 f4 brge .+8 ; 0x10ed0 10ec8: 80 91 03 05 lds r24, 0x0503 ; 0x800503 10ecc: 81 11 cpse r24, r1 10ece: f0 ce rjmp .-544 ; 0x10cb0 } } } #endif //FWRETRACT prepare_move(start_segment_idx); 10ed0: c8 01 movw r24, r16 10ed2: 0e 94 fa 64 call 0xc9f4 ; 0xc9f4 #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; 10ed6: 10 92 58 03 sts 0x0358, r1 ; 0x800358 10eda: 10 92 57 03 sts 0x0357, r1 ; 0x800357 10ede: c4 cc rjmp .-1656 ; 0x10868 */ case 2: case 3: { uint16_t start_segment_idx = restore_interrupted_gcode(); 10ee0: 0e 94 75 54 call 0xa8ea ; 0xa8ea 10ee4: 2e 96 adiw r28, 0x0e ; 14 10ee6: 9f af std Y+63, r25 ; 0x3f 10ee8: 8e af std Y+62, r24 ; 0x3e 10eea: 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 10eec: 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; 10ef0: 89 e4 ldi r24, 0x49 ; 73 10ef2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 10ef6: 88 23 and r24, r24 10ef8: 09 f4 brne .+2 ; 0x10efc 10efa: a0 c3 rjmp .+1856 ; 0x1163c 10efc: 0e 94 03 5a call 0xb406 ; 0xb406 10f00: 60 93 4f 03 sts 0x034F, r22 ; 0x80034f 10f04: 70 93 50 03 sts 0x0350, r23 ; 0x800350 10f08: 80 93 51 03 sts 0x0351, r24 ; 0x800351 10f0c: 90 93 52 03 sts 0x0352, r25 ; 0x800352 offset[1] = code_seen('J') ? code_value() : 0.f; 10f10: 8a e4 ldi r24, 0x4A ; 74 10f12: 0e 94 2b 55 call 0xaa56 ; 0xaa56 10f16: c1 2c mov r12, r1 10f18: d1 2c mov r13, r1 10f1a: 76 01 movw r14, r12 10f1c: 88 23 and r24, r24 10f1e: 21 f0 breq .+8 ; 0x10f28 10f20: 0e 94 03 5a call 0xb406 ; 0xb406 10f24: 6b 01 movw r12, r22 10f26: 7c 01 movw r14, r24 10f28: c0 92 53 03 sts 0x0353, r12 ; 0x800353 10f2c: d0 92 54 03 sts 0x0354, r13 ; 0x800354 10f30: e0 92 55 03 sts 0x0355, r14 ; 0x800355 10f34: f0 92 56 03 sts 0x0356, r15 ; 0x800356 prepare_arc_move((gcode_in_progress == 2), start_segment_idx); 10f38: e0 91 57 03 lds r30, 0x0357 ; 0x800357 10f3c: f0 91 58 03 lds r31, 0x0358 ; 0x800358 10f40: a4 96 adiw r28, 0x24 ; 36 10f42: ff af std Y+63, r31 ; 0x3f 10f44: ee af std Y+62, r30 ; 0x3e 10f46: 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 10f48: 80 90 4f 03 lds r8, 0x034F ; 0x80034f 10f4c: 90 90 50 03 lds r9, 0x0350 ; 0x800350 10f50: a0 90 51 03 lds r10, 0x0351 ; 0x800351 10f54: b0 90 52 03 lds r11, 0x0352 ; 0x800352 10f58: a7 01 movw r20, r14 10f5a: 96 01 movw r18, r12 10f5c: c5 01 movw r24, r10 10f5e: b4 01 movw r22, r8 10f60: 0f 94 5f a4 call 0x348be ; 0x348be 10f64: 24 96 adiw r28, 0x04 ; 4 10f66: 6c af std Y+60, r22 ; 0x3c 10f68: 7d af std Y+61, r23 ; 0x3d 10f6a: 8e af std Y+62, r24 ; 0x3e 10f6c: 9f af std Y+63, r25 ; 0x3f 10f6e: 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); 10f70: 60 91 8e 02 lds r22, 0x028E ; 0x80028e 10f74: 70 91 8f 02 lds r23, 0x028F ; 0x80028f 10f78: 07 2e mov r0, r23 10f7a: 00 0c add r0, r0 10f7c: 88 0b sbc r24, r24 10f7e: 99 0b sbc r25, r25 10f80: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 10f84: 20 91 7a 02 lds r18, 0x027A ; 0x80027a 10f88: 30 91 7b 02 lds r19, 0x027B ; 0x80027b 10f8c: 40 91 7c 02 lds r20, 0x027C ; 0x80027c 10f90: 50 91 7d 02 lds r21, 0x027D ; 0x80027d 10f94: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 10f98: 2e e3 ldi r18, 0x3E ; 62 10f9a: 33 ec ldi r19, 0xC3 ; 195 10f9c: 4e e2 ldi r20, 0x2E ; 46 10f9e: 59 e3 ldi r21, 0x39 ; 57 10fa0: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 10fa4: 68 af std Y+56, r22 ; 0x38 10fa6: 79 af std Y+57, r23 ; 0x39 10fa8: 8a af std Y+58, r24 ; 0x3a 10faa: 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)); 10fac: 80 e1 ldi r24, 0x10 ; 16 10fae: e5 ef ldi r30, 0xF5 ; 245 10fb0: f1 e1 ldi r31, 0x11 ; 17 10fb2: de 01 movw r26, r28 10fb4: 11 96 adiw r26, 0x01 ; 1 10fb6: 01 90 ld r0, Z+ 10fb8: 0d 92 st X+, r0 10fba: 8a 95 dec r24 10fbc: e1 f7 brne .-8 ; 0x10fb6 float r_axis_x = -offset[X_AXIS]; // Radius vector from center to current location 10fbe: a5 01 movw r20, r10 10fc0: 94 01 movw r18, r8 10fc2: 50 58 subi r21, 0x80 ; 128 10fc4: 28 a7 std Y+40, r18 ; 0x28 10fc6: 39 a7 std Y+41, r19 ; 0x29 10fc8: 4a a7 std Y+42, r20 ; 0x2a 10fca: 5b a7 std Y+43, r21 ; 0x2b float r_axis_y = -offset[Y_AXIS]; 10fcc: d7 01 movw r26, r14 10fce: c6 01 movw r24, r12 10fd0: b0 58 subi r27, 0x80 ; 128 10fd2: 8c a7 std Y+44, r24 ; 0x2c 10fd4: 9d a7 std Y+45, r25 ; 0x2d 10fd6: ae a7 std Y+46, r26 ; 0x2e 10fd8: bf a7 std Y+47, r27 ; 0x2f float center_axis_x = start_position[X_AXIS] - r_axis_x; 10fda: 29 81 ldd r18, Y+1 ; 0x01 10fdc: 3a 81 ldd r19, Y+2 ; 0x02 10fde: 4b 81 ldd r20, Y+3 ; 0x03 10fe0: 5c 81 ldd r21, Y+4 ; 0x04 10fe2: 28 96 adiw r28, 0x08 ; 8 10fe4: 2c af std Y+60, r18 ; 0x3c 10fe6: 3d af std Y+61, r19 ; 0x3d 10fe8: 4e af std Y+62, r20 ; 0x3e 10fea: 5f af std Y+63, r21 ; 0x3f 10fec: 28 97 sbiw r28, 0x08 ; 8 10fee: c5 01 movw r24, r10 10ff0: b4 01 movw r22, r8 10ff2: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 10ff6: 62 96 adiw r28, 0x12 ; 18 10ff8: 6c af std Y+60, r22 ; 0x3c 10ffa: 7d af std Y+61, r23 ; 0x3d 10ffc: 8e af std Y+62, r24 ; 0x3e 10ffe: 9f af std Y+63, r25 ; 0x3f 11000: 62 97 sbiw r28, 0x12 ; 18 float center_axis_y = start_position[Y_AXIS] - r_axis_y; 11002: 8d 81 ldd r24, Y+5 ; 0x05 11004: 9e 81 ldd r25, Y+6 ; 0x06 11006: af 81 ldd r26, Y+7 ; 0x07 11008: b8 85 ldd r27, Y+8 ; 0x08 1100a: 2c 96 adiw r28, 0x0c ; 12 1100c: 8c af std Y+60, r24 ; 0x3c 1100e: 9d af std Y+61, r25 ; 0x3d 11010: ae af std Y+62, r26 ; 0x3e 11012: bf af std Y+63, r27 ; 0x3f 11014: 2c 97 sbiw r28, 0x0c ; 12 11016: 9c 01 movw r18, r24 11018: ad 01 movw r20, r26 1101a: c7 01 movw r24, r14 1101c: b6 01 movw r22, r12 1101e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 11022: 66 96 adiw r28, 0x16 ; 22 11024: 6c af std Y+60, r22 ; 0x3c 11026: 7d af std Y+61, r23 ; 0x3d 11028: 8e af std Y+62, r24 ; 0x3e 1102a: 9f af std Y+63, r25 ; 0x3f 1102c: 66 97 sbiw r28, 0x16 ; 22 float travel_z = target[Z_AXIS] - start_position[Z_AXIS]; 1102e: 29 85 ldd r18, Y+9 ; 0x09 11030: 3a 85 ldd r19, Y+10 ; 0x0a 11032: 4b 85 ldd r20, Y+11 ; 0x0b 11034: 5c 85 ldd r21, Y+12 ; 0x0c 11036: 60 91 9b 06 lds r22, 0x069B ; 0x80069b 1103a: 70 91 9c 06 lds r23, 0x069C ; 0x80069c 1103e: 80 91 9d 06 lds r24, 0x069D ; 0x80069d 11042: 90 91 9e 06 lds r25, 0x069E ; 0x80069e 11046: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1104a: 6a 96 adiw r28, 0x1a ; 26 1104c: 6c af std Y+60, r22 ; 0x3c 1104e: 7d af std Y+61, r23 ; 0x3d 11050: 8e af std Y+62, r24 ; 0x3e 11052: 9f af std Y+63, r25 ; 0x3f 11054: 6a 97 sbiw r28, 0x1a ; 26 float rt_x = target[X_AXIS] - center_axis_x; 11056: 20 91 93 06 lds r18, 0x0693 ; 0x800693 1105a: 30 91 94 06 lds r19, 0x0694 ; 0x800694 1105e: 40 91 95 06 lds r20, 0x0695 ; 0x800695 11062: 50 91 96 06 lds r21, 0x0696 ; 0x800696 11066: 6e 96 adiw r28, 0x1e ; 30 11068: 2c af std Y+60, r18 ; 0x3c 1106a: 3d af std Y+61, r19 ; 0x3d 1106c: 4e af std Y+62, r20 ; 0x3e 1106e: 5f af std Y+63, r21 ; 0x3f 11070: 6e 97 sbiw r28, 0x1e ; 30 11072: 62 96 adiw r28, 0x12 ; 18 11074: 2c ad ldd r18, Y+60 ; 0x3c 11076: 3d ad ldd r19, Y+61 ; 0x3d 11078: 4e ad ldd r20, Y+62 ; 0x3e 1107a: 5f ad ldd r21, Y+63 ; 0x3f 1107c: 62 97 sbiw r28, 0x12 ; 18 1107e: 6e 96 adiw r28, 0x1e ; 30 11080: 6c ad ldd r22, Y+60 ; 0x3c 11082: 7d ad ldd r23, Y+61 ; 0x3d 11084: 8e ad ldd r24, Y+62 ; 0x3e 11086: 9f ad ldd r25, Y+63 ; 0x3f 11088: 6e 97 sbiw r28, 0x1e ; 30 1108a: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1108e: 6b 01 movw r12, r22 11090: 7c 01 movw r14, r24 float rt_y = target[Y_AXIS] - center_axis_y; 11092: 80 91 97 06 lds r24, 0x0697 ; 0x800697 11096: 90 91 98 06 lds r25, 0x0698 ; 0x800698 1109a: a0 91 99 06 lds r26, 0x0699 ; 0x800699 1109e: b0 91 9a 06 lds r27, 0x069A ; 0x80069a 110a2: a2 96 adiw r28, 0x22 ; 34 110a4: 8c af std Y+60, r24 ; 0x3c 110a6: 9d af std Y+61, r25 ; 0x3d 110a8: ae af std Y+62, r26 ; 0x3e 110aa: bf af std Y+63, r27 ; 0x3f 110ac: a2 97 sbiw r28, 0x22 ; 34 110ae: 66 96 adiw r28, 0x16 ; 22 110b0: 2c ad ldd r18, Y+60 ; 0x3c 110b2: 3d ad ldd r19, Y+61 ; 0x3d 110b4: 4e ad ldd r20, Y+62 ; 0x3e 110b6: 5f ad ldd r21, Y+63 ; 0x3f 110b8: 66 97 sbiw r28, 0x16 ; 22 110ba: bc 01 movw r22, r24 110bc: cd 01 movw r24, r26 110be: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 110c2: 4b 01 movw r8, r22 110c4: 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; 110c6: 30 90 f6 04 lds r3, 0x04F6 ; 0x8004f6 110ca: 20 90 f7 04 lds r2, 0x04F7 ; 0x8004f7 110ce: 90 91 f8 04 lds r25, 0x04F8 ; 0x8004f8 110d2: 9c ab std Y+52, r25 ; 0x34 110d4: a0 91 f9 04 lds r26, 0x04F9 ; 0x8004f9 110d8: 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; 110da: b0 91 fe 04 lds r27, 0x04FE ; 0x8004fe 110de: 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); 110e0: a7 01 movw r20, r14 110e2: 96 01 movw r18, r12 110e4: 68 a5 ldd r22, Y+40 ; 0x28 110e6: 79 a5 ldd r23, Y+41 ; 0x29 110e8: 8a a5 ldd r24, Y+42 ; 0x2a 110ea: 9b a5 ldd r25, Y+43 ; 0x2b 110ec: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 110f0: 2b 01 movw r4, r22 110f2: 3c 01 movw r6, r24 110f4: a5 01 movw r20, r10 110f6: 94 01 movw r18, r8 110f8: 6c a5 ldd r22, Y+44 ; 0x2c 110fa: 7d a5 ldd r23, Y+45 ; 0x2d 110fc: 8e a5 ldd r24, Y+46 ; 0x2e 110fe: 9f a5 ldd r25, Y+47 ; 0x2f 11100: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 11104: 9b 01 movw r18, r22 11106: ac 01 movw r20, r24 11108: c3 01 movw r24, r6 1110a: b2 01 movw r22, r4 1110c: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 11110: 2b 01 movw r4, r22 11112: 3c 01 movw r6, r24 11114: a5 01 movw r20, r10 11116: 94 01 movw r18, r8 11118: 68 a5 ldd r22, Y+40 ; 0x28 1111a: 79 a5 ldd r23, Y+41 ; 0x29 1111c: 8a a5 ldd r24, Y+42 ; 0x2a 1111e: 9b a5 ldd r25, Y+43 ; 0x2b 11120: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 11124: 4b 01 movw r8, r22 11126: 5c 01 movw r10, r24 11128: a7 01 movw r20, r14 1112a: 96 01 movw r18, r12 1112c: 6c a5 ldd r22, Y+44 ; 0x2c 1112e: 7d a5 ldd r23, Y+45 ; 0x2d 11130: 8e a5 ldd r24, Y+46 ; 0x2e 11132: 9f a5 ldd r25, Y+47 ; 0x2f 11134: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 11138: 9b 01 movw r18, r22 1113a: ac 01 movw r20, r24 1113c: c5 01 movw r24, r10 1113e: b4 01 movw r22, r8 11140: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 11144: a3 01 movw r20, r6 11146: 92 01 movw r18, r4 11148: 0f 94 42 a2 call 0x34484 ; 0x34484 1114c: 6b 01 movw r12, r22 1114e: 7c 01 movw r14, r24 if (angular_travel_total < 0) { angular_travel_total += 2 * M_PI; } 11150: 20 e0 ldi r18, 0x00 ; 0 11152: 30 e0 ldi r19, 0x00 ; 0 11154: a9 01 movw r20, r18 11156: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1115a: 87 ff sbrs r24, 7 1115c: 0a c0 rjmp .+20 ; 0x11172 1115e: 2b ed ldi r18, 0xDB ; 219 11160: 3f e0 ldi r19, 0x0F ; 15 11162: 49 ec ldi r20, 0xC9 ; 201 11164: 50 e4 ldi r21, 0x40 ; 64 11166: c7 01 movw r24, r14 11168: b6 01 movw r22, r12 1116a: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1116e: 6b 01 movw r12, r22 11170: 7c 01 movw r14, r24 if (cs.min_arc_segments > 0) 11172: 60 91 ff 04 lds r22, 0x04FF ; 0x8004ff 11176: 70 91 00 05 lds r23, 0x0500 ; 0x800500 1117a: 61 15 cp r22, r1 1117c: 71 05 cpc r23, r1 1117e: 09 f4 brne .+2 ; 0x11182 11180: 61 c2 rjmp .+1218 ; 0x11644 { // 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); 11182: 90 e0 ldi r25, 0x00 ; 0 11184: 80 e0 ldi r24, 0x00 ; 0 11186: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 1118a: 9b 01 movw r18, r22 1118c: ac 01 movw r20, r24 1118e: 6b ed ldi r22, 0xDB ; 219 11190: 7f e0 ldi r23, 0x0F ; 15 11192: 89 ec ldi r24, 0xC9 ; 201 11194: 90 e4 ldi r25, 0x40 ; 64 11196: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1119a: 24 96 adiw r28, 0x04 ; 4 1119c: 2c ad ldd r18, Y+60 ; 0x3c 1119e: 3d ad ldd r19, Y+61 ; 0x3d 111a0: 4e ad ldd r20, Y+62 ; 0x3e 111a2: 5f ad ldd r21, Y+63 ; 0x3f 111a4: 24 97 sbiw r28, 0x04 ; 4 111a6: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 111aa: 5b 01 movw r10, r22 111ac: 8c 01 movw r16, r24 } if (cs.arc_segments_per_sec > 0) 111ae: 60 91 01 05 lds r22, 0x0501 ; 0x800501 111b2: 70 91 02 05 lds r23, 0x0502 ; 0x800502 111b6: 61 15 cp r22, r1 111b8: 71 05 cpc r23, r1 111ba: e1 f0 breq .+56 ; 0x111f4 { // 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)); 111bc: 90 e0 ldi r25, 0x00 ; 0 111be: 80 e0 ldi r24, 0x00 ; 0 111c0: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 111c4: 20 e0 ldi r18, 0x00 ; 0 111c6: 30 e0 ldi r19, 0x00 ; 0 111c8: 40 e7 ldi r20, 0x70 ; 112 111ca: 52 e4 ldi r21, 0x42 ; 66 111cc: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 111d0: 9b 01 movw r18, r22 111d2: ac 01 movw r20, r24 111d4: 68 ad ldd r22, Y+56 ; 0x38 111d6: 79 ad ldd r23, Y+57 ; 0x39 111d8: 8a ad ldd r24, Y+58 ; 0x3a 111da: 9b ad ldd r25, Y+59 ; 0x3b 111dc: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 111e0: 3b 01 movw r6, r22 111e2: 4c 01 movw r8, r24 if (mm_per_arc_segment_sec < mm_per_arc_segment) 111e4: 95 01 movw r18, r10 111e6: a8 01 movw r20, r16 111e8: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 111ec: 87 ff sbrs r24, 7 111ee: 02 c0 rjmp .+4 ; 0x111f4 mm_per_arc_segment = mm_per_arc_segment_sec; 111f0: 53 01 movw r10, r6 111f2: 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) 111f4: 40 90 fa 04 lds r4, 0x04FA ; 0x8004fa 111f8: 50 90 fb 04 lds r5, 0x04FB ; 0x8004fb 111fc: 60 90 fc 04 lds r6, 0x04FC ; 0x8004fc 11200: 70 90 fd 04 lds r7, 0x04FD ; 0x8004fd 11204: 95 01 movw r18, r10 11206: a8 01 movw r20, r16 11208: b2 01 movw r22, r4 1120a: c3 01 movw r24, r6 1120c: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 11210: 18 16 cp r1, r24 11212: 84 f0 brlt .+32 ; 0x11234 { // 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) { 11214: 95 01 movw r18, r10 11216: a8 01 movw r20, r16 11218: 63 2d mov r22, r3 1121a: 72 2d mov r23, r2 1121c: 8c a9 ldd r24, Y+52 ; 0x34 1121e: 9c ad ldd r25, Y+60 ; 0x3c 11220: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 11224: 25 01 movw r4, r10 11226: 38 01 movw r6, r16 11228: 87 ff sbrs r24, 7 1122a: 04 c0 rjmp .+8 ; 0x11234 // 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; 1122c: 43 2c mov r4, r3 1122e: 52 2c mov r5, r2 11230: 6c a8 ldd r6, Y+52 ; 0x34 11232: 7c ac ldd r7, Y+60 ; 0x3c } // Adjust the angular travel if the direction is clockwise if (isclockwise) { angular_travel_total -= 2 * M_PI; } 11234: a4 96 adiw r28, 0x24 ; 36 11236: ee ad ldd r30, Y+62 ; 0x3e 11238: ff ad ldd r31, Y+63 ; 0x3f 1123a: a4 97 sbiw r28, 0x24 ; 36 1123c: 32 97 sbiw r30, 0x02 ; 2 1123e: 51 f4 brne .+20 ; 0x11254 11240: 2b ed ldi r18, 0xDB ; 219 11242: 3f e0 ldi r19, 0x0F ; 15 11244: 49 ec ldi r20, 0xC9 ; 201 11246: 50 e4 ldi r21, 0x40 ; 64 11248: c7 01 movw r24, r14 1124a: b6 01 movw r22, r12 1124c: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 11250: 6b 01 movw r12, r22 11252: 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) 11254: 6e 96 adiw r28, 0x1e ; 30 11256: 2c ad ldd r18, Y+60 ; 0x3c 11258: 3d ad ldd r19, Y+61 ; 0x3d 1125a: 4e ad ldd r20, Y+62 ; 0x3e 1125c: 5f ad ldd r21, Y+63 ; 0x3f 1125e: 6e 97 sbiw r28, 0x1e ; 30 11260: 28 96 adiw r28, 0x08 ; 8 11262: 6c ad ldd r22, Y+60 ; 0x3c 11264: 7d ad ldd r23, Y+61 ; 0x3d 11266: 8e ad ldd r24, Y+62 ; 0x3e 11268: 9f ad ldd r25, Y+63 ; 0x3f 1126a: 28 97 sbiw r28, 0x08 ; 8 1126c: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 11270: 81 11 cpse r24, r1 11272: 23 c0 rjmp .+70 ; 0x112ba 11274: a2 96 adiw r28, 0x22 ; 34 11276: 2c ad ldd r18, Y+60 ; 0x3c 11278: 3d ad ldd r19, Y+61 ; 0x3d 1127a: 4e ad ldd r20, Y+62 ; 0x3e 1127c: 5f ad ldd r21, Y+63 ; 0x3f 1127e: a2 97 sbiw r28, 0x22 ; 34 11280: 2c 96 adiw r28, 0x0c ; 12 11282: 6c ad ldd r22, Y+60 ; 0x3c 11284: 7d ad ldd r23, Y+61 ; 0x3d 11286: 8e ad ldd r24, Y+62 ; 0x3e 11288: 9f ad ldd r25, Y+63 ; 0x3f 1128a: 2c 97 sbiw r28, 0x0c ; 12 1128c: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 11290: 81 11 cpse r24, r1 11292: 13 c0 rjmp .+38 ; 0x112ba 11294: 20 e0 ldi r18, 0x00 ; 0 11296: 30 e0 ldi r19, 0x00 ; 0 11298: a9 01 movw r20, r18 1129a: c7 01 movw r24, r14 1129c: b6 01 movw r22, r12 1129e: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 112a2: 81 11 cpse r24, r1 112a4: 0a c0 rjmp .+20 ; 0x112ba { angular_travel_total += 2 * M_PI; 112a6: 2b ed ldi r18, 0xDB ; 219 112a8: 3f e0 ldi r19, 0x0F ; 15 112aa: 49 ec ldi r20, 0xC9 ; 201 112ac: 50 e4 ldi r21, 0x40 ; 64 112ae: c7 01 movw r24, r14 112b0: b6 01 movw r22, r12 112b2: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 112b6: 6b 01 movw r12, r22 112b8: 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)); 112ba: a7 01 movw r20, r14 112bc: 96 01 movw r18, r12 112be: 24 96 adiw r28, 0x04 ; 4 112c0: 6c ad ldd r22, Y+60 ; 0x3c 112c2: 7d ad ldd r23, Y+61 ; 0x3d 112c4: 8e ad ldd r24, Y+62 ; 0x3e 112c6: 9f ad ldd r25, Y+63 ; 0x3f 112c8: 24 97 sbiw r28, 0x04 ; 4 112ca: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 112ce: 6a 96 adiw r28, 0x1a ; 26 112d0: 2c ad ldd r18, Y+60 ; 0x3c 112d2: 3d ad ldd r19, Y+61 ; 0x3d 112d4: 4e ad ldd r20, Y+62 ; 0x3e 112d6: 5f ad ldd r21, Y+63 ; 0x3f 112d8: 6a 97 sbiw r28, 0x1a ; 26 112da: 0f 94 5f a4 call 0x348be ; 0x348be 112de: 4b 01 movw r8, r22 112e0: 5c 01 movw r10, r24 if (millimeters_of_travel_arc < 0.001) { return; } 112e2: 2f e6 ldi r18, 0x6F ; 111 112e4: 32 e1 ldi r19, 0x12 ; 18 112e6: 43 e8 ldi r20, 0x83 ; 131 112e8: 5a e3 ldi r21, 0x3A ; 58 112ea: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 112ee: 87 fd sbrc r24, 7 112f0: 9e c1 rjmp .+828 ; 0x1162e // Calculate the number of arc segments unsigned short segments = static_cast(ceil(millimeters_of_travel_arc / mm_per_arc_segment)); 112f2: 92 01 movw r18, r4 112f4: a3 01 movw r20, r6 112f6: c5 01 movw r24, r10 112f8: b4 01 movw r22, r8 112fa: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 112fe: 0f 94 a1 a2 call 0x34542 ; 0x34542 11302: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 11306: 7d ab std Y+53, r23 ; 0x35 11308: 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) 1130a: 62 30 cpi r22, 0x02 ; 2 1130c: 71 05 cpc r23, r1 1130e: 08 f4 brcc .+2 ; 0x11312 11310: 5e c1 rjmp .+700 ; 0x115ce 11312: 2e 96 adiw r28, 0x0e ; 14 11314: 4e ad ldd r20, Y+62 ; 0x3e 11316: 5f ad ldd r21, Y+63 ; 0x3f 11318: 2e 97 sbiw r28, 0x0e ; 14 1131a: 45 2b or r20, r21 1131c: 09 f4 brne .+2 ; 0x11320 1131e: 57 c1 rjmp .+686 ; 0x115ce { // 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, 11320: 90 e0 ldi r25, 0x00 ; 0 11322: 80 e0 ldi r24, 0x00 ; 0 11324: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 11328: 4b 01 movw r8, r22 1132a: 5c 01 movw r10, r24 1132c: ac 01 movw r20, r24 1132e: 9b 01 movw r18, r22 11330: c7 01 movw r24, r14 11332: b6 01 movw r22, r12 11334: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 11338: 2b 01 movw r4, r22 1133a: 3c 01 movw r6, r24 linear_per_segment = travel_z / (segments), 1133c: a5 01 movw r20, r10 1133e: 94 01 movw r18, r8 11340: 6a 96 adiw r28, 0x1a ; 26 11342: 6c ad ldd r22, Y+60 ; 0x3c 11344: 7d ad ldd r23, Y+61 ; 0x3d 11346: 8e ad ldd r24, Y+62 ; 0x3e 11348: 9f ad ldd r25, Y+63 ; 0x3f 1134a: 6a 97 sbiw r28, 0x1a ; 26 1134c: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 11350: 28 96 adiw r28, 0x08 ; 8 11352: 6c af std Y+60, r22 ; 0x3c 11354: 7d af std Y+61, r23 ; 0x3d 11356: 8e af std Y+62, r24 ; 0x3e 11358: 9f af std Y+63, r25 ; 0x3f 1135a: 28 97 sbiw r28, 0x08 ; 8 segment_extruder_travel = (target[E_AXIS] - start_position[E_AXIS]) / (segments), 1135c: 2d 85 ldd r18, Y+13 ; 0x0d 1135e: 3e 85 ldd r19, Y+14 ; 0x0e 11360: 4f 85 ldd r20, Y+15 ; 0x0f 11362: 58 89 ldd r21, Y+16 ; 0x10 11364: 60 91 9f 06 lds r22, 0x069F ; 0x80069f 11368: 70 91 a0 06 lds r23, 0x06A0 ; 0x8006a0 1136c: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 11370: 90 91 a2 06 lds r25, 0x06A2 ; 0x8006a2 11374: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 11378: a5 01 movw r20, r10 1137a: 94 01 movw r18, r8 1137c: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 11380: 2c 96 adiw r28, 0x0c ; 12 11382: 6c af std Y+60, r22 ; 0x3c 11384: 7d af std Y+61, r23 ; 0x3d 11386: 8e af std Y+62, r24 ; 0x3e 11388: 9f af std Y+63, r25 ; 0x3f 1138a: 2c 97 sbiw r28, 0x0c ; 12 sq_theta_per_segment = theta_per_segment * theta_per_segment, 1138c: a3 01 movw r20, r6 1138e: 92 01 movw r18, r4 11390: c3 01 movw r24, r6 11392: b2 01 movw r22, r4 11394: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 11398: 6b 01 movw r12, r22 1139a: 7c 01 movw r14, r24 sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6, 1139c: ac 01 movw r20, r24 1139e: 9b 01 movw r18, r22 113a0: c3 01 movw r24, r6 113a2: b2 01 movw r22, r4 113a4: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 113a8: 20 e0 ldi r18, 0x00 ; 0 113aa: 30 e0 ldi r19, 0x00 ; 0 113ac: 40 ec ldi r20, 0xC0 ; 192 113ae: 50 e4 ldi r21, 0x40 ; 64 113b0: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 113b4: 9b 01 movw r18, r22 113b6: ac 01 movw r20, r24 113b8: c3 01 movw r24, r6 113ba: b2 01 movw r22, r4 113bc: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 113c0: 6c af std Y+60, r22 ; 0x3c 113c2: 7d af std Y+61, r23 ; 0x3d 113c4: 8e af std Y+62, r24 ; 0x3e 113c6: 9f af std Y+63, r25 ; 0x3f cos_T = 1 - 0.5f * sq_theta_per_segment; 113c8: 20 e0 ldi r18, 0x00 ; 0 113ca: 30 e0 ldi r19, 0x00 ; 0 113cc: 40 e0 ldi r20, 0x00 ; 0 113ce: 5f e3 ldi r21, 0x3F ; 63 113d0: c7 01 movw r24, r14 113d2: b6 01 movw r22, r12 113d4: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 113d8: 9b 01 movw r18, r22 113da: ac 01 movw r20, r24 113dc: 60 e0 ldi r22, 0x00 ; 0 113de: 70 e0 ldi r23, 0x00 ; 0 113e0: 80 e8 ldi r24, 0x80 ; 128 113e2: 9f e3 ldi r25, 0x3F ; 63 113e4: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 113e8: 24 96 adiw r28, 0x04 ; 4 113ea: 6c af std Y+60, r22 ; 0x3c 113ec: 7d af std Y+61, r23 ; 0x3d 113ee: 8e af std Y+62, r24 ; 0x3e 113f0: 9f af std Y+63, r25 ; 0x3f 113f2: 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++) { 113f4: 22 24 eor r2, r2 113f6: 23 94 inc r2 113f8: 31 2c mov r3, r1 if (n_arc_correction-- == 0) { 113fa: d8 a8 ldd r13, Y+48 ; 0x30 113fc: da 94 dec r13 113fe: 58 a9 ldd r21, Y+48 ; 0x30 11400: 51 11 cpse r21, r1 11402: 25 c1 rjmp .+586 ; 0x1164e // 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); 11404: b1 01 movw r22, r2 11406: 90 e0 ldi r25, 0x00 ; 0 11408: 80 e0 ldi r24, 0x00 ; 0 1140a: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 1140e: a3 01 movw r20, r6 11410: 92 01 movw r18, r4 11412: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 11416: 6b 01 movw r12, r22 11418: 7c 01 movw r14, r24 1141a: 0f 94 bd a2 call 0x3457a ; 0x3457a 1141e: 6c a7 std Y+44, r22 ; 0x2c 11420: 7d a7 std Y+45, r23 ; 0x2d 11422: 8e a7 std Y+46, r24 ; 0x2e 11424: 9f a7 std Y+47, r25 ; 0x2f 11426: c7 01 movw r24, r14 11428: b6 01 movw r22, r12 1142a: 0f 94 83 a5 call 0x34b06 ; 0x34b06 1142e: 4b 01 movw r8, r22 11430: 5c 01 movw r10, r24 r_axis_x = -offset[X_AXIS] * cos_Ti + offset[Y_AXIS] * sin_Ti; 11432: c0 90 4f 03 lds r12, 0x034F ; 0x80034f 11436: d0 90 50 03 lds r13, 0x0350 ; 0x800350 1143a: e0 90 51 03 lds r14, 0x0351 ; 0x800351 1143e: f0 90 52 03 lds r15, 0x0352 ; 0x800352 11442: f7 fa bst r15, 7 11444: f0 94 com r15 11446: f7 f8 bld r15, 7 11448: f0 94 com r15 1144a: 80 91 53 03 lds r24, 0x0353 ; 0x800353 1144e: 90 91 54 03 lds r25, 0x0354 ; 0x800354 11452: a0 91 55 03 lds r26, 0x0355 ; 0x800355 11456: b0 91 56 03 lds r27, 0x0356 ; 0x800356 1145a: 88 ab std Y+48, r24 ; 0x30 1145c: 99 ab std Y+49, r25 ; 0x31 1145e: aa ab std Y+50, r26 ; 0x32 11460: bb ab std Y+51, r27 ; 0x33 11462: a7 01 movw r20, r14 11464: 96 01 movw r18, r12 11466: 6c a5 ldd r22, Y+44 ; 0x2c 11468: 7d a5 ldd r23, Y+45 ; 0x2d 1146a: 8e a5 ldd r24, Y+46 ; 0x2e 1146c: 9f a5 ldd r25, Y+47 ; 0x2f 1146e: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 11472: 68 a7 std Y+40, r22 ; 0x28 11474: 79 a7 std Y+41, r23 ; 0x29 11476: 8a a7 std Y+42, r24 ; 0x2a 11478: 9b a7 std Y+43, r25 ; 0x2b 1147a: 28 a9 ldd r18, Y+48 ; 0x30 1147c: 39 a9 ldd r19, Y+49 ; 0x31 1147e: 4a a9 ldd r20, Y+50 ; 0x32 11480: 5b a9 ldd r21, Y+51 ; 0x33 11482: c5 01 movw r24, r10 11484: b4 01 movw r22, r8 11486: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1148a: 9b 01 movw r18, r22 1148c: ac 01 movw r20, r24 1148e: 68 a5 ldd r22, Y+40 ; 0x28 11490: 79 a5 ldd r23, Y+41 ; 0x29 11492: 8a a5 ldd r24, Y+42 ; 0x2a 11494: 9b a5 ldd r25, Y+43 ; 0x2b 11496: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1149a: 68 a7 std Y+40, r22 ; 0x28 1149c: 79 a7 std Y+41, r23 ; 0x29 1149e: 8a a7 std Y+42, r24 ; 0x2a 114a0: 9b a7 std Y+43, r25 ; 0x2b r_axis_y = -offset[X_AXIS] * sin_Ti - offset[Y_AXIS] * cos_Ti; 114a2: a7 01 movw r20, r14 114a4: 96 01 movw r18, r12 114a6: c5 01 movw r24, r10 114a8: b4 01 movw r22, r8 114aa: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 114ae: 6b 01 movw r12, r22 114b0: 7c 01 movw r14, r24 114b2: 28 a9 ldd r18, Y+48 ; 0x30 114b4: 39 a9 ldd r19, Y+49 ; 0x31 114b6: 4a a9 ldd r20, Y+50 ; 0x32 114b8: 5b a9 ldd r21, Y+51 ; 0x33 114ba: 6c a5 ldd r22, Y+44 ; 0x2c 114bc: 7d a5 ldd r23, Y+45 ; 0x2d 114be: 8e a5 ldd r24, Y+46 ; 0x2e 114c0: 9f a5 ldd r25, Y+47 ; 0x2f 114c2: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 114c6: 9b 01 movw r18, r22 114c8: ac 01 movw r20, r24 114ca: c7 01 movw r24, r14 114cc: b6 01 movw r22, r12 114ce: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 114d2: 6c a7 std Y+44, r22 ; 0x2c 114d4: 7d a7 std Y+45, r23 ; 0x2d 114d6: 8e a7 std Y+46, r24 ; 0x2e 114d8: 9f a7 std Y+47, r25 ; 0x2f // reset n_arc_correction n_arc_correction = cs.n_arc_correction; 114da: 90 91 fe 04 lds r25, 0x04FE ; 0x8004fe 114de: 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; 114e0: 28 a5 ldd r18, Y+40 ; 0x28 114e2: 39 a5 ldd r19, Y+41 ; 0x29 114e4: 4a a5 ldd r20, Y+42 ; 0x2a 114e6: 5b a5 ldd r21, Y+43 ; 0x2b 114e8: 62 96 adiw r28, 0x12 ; 18 114ea: 6c ad ldd r22, Y+60 ; 0x3c 114ec: 7d ad ldd r23, Y+61 ; 0x3d 114ee: 8e ad ldd r24, Y+62 ; 0x3e 114f0: 9f ad ldd r25, Y+63 ; 0x3f 114f2: 62 97 sbiw r28, 0x12 ; 18 114f4: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 114f8: 69 83 std Y+1, r22 ; 0x01 114fa: 7a 83 std Y+2, r23 ; 0x02 114fc: 8b 83 std Y+3, r24 ; 0x03 114fe: 9c 83 std Y+4, r25 ; 0x04 start_position[Y_AXIS] = center_axis_y + r_axis_y; 11500: 2c a5 ldd r18, Y+44 ; 0x2c 11502: 3d a5 ldd r19, Y+45 ; 0x2d 11504: 4e a5 ldd r20, Y+46 ; 0x2e 11506: 5f a5 ldd r21, Y+47 ; 0x2f 11508: 66 96 adiw r28, 0x16 ; 22 1150a: 6c ad ldd r22, Y+60 ; 0x3c 1150c: 7d ad ldd r23, Y+61 ; 0x3d 1150e: 8e ad ldd r24, Y+62 ; 0x3e 11510: 9f ad ldd r25, Y+63 ; 0x3f 11512: 66 97 sbiw r28, 0x16 ; 22 11514: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 11518: 6d 83 std Y+5, r22 ; 0x05 1151a: 7e 83 std Y+6, r23 ; 0x06 1151c: 8f 83 std Y+7, r24 ; 0x07 1151e: 98 87 std Y+8, r25 ; 0x08 start_position[Z_AXIS] += linear_per_segment; 11520: 28 96 adiw r28, 0x08 ; 8 11522: 2c ad ldd r18, Y+60 ; 0x3c 11524: 3d ad ldd r19, Y+61 ; 0x3d 11526: 4e ad ldd r20, Y+62 ; 0x3e 11528: 5f ad ldd r21, Y+63 ; 0x3f 1152a: 28 97 sbiw r28, 0x08 ; 8 1152c: 69 85 ldd r22, Y+9 ; 0x09 1152e: 7a 85 ldd r23, Y+10 ; 0x0a 11530: 8b 85 ldd r24, Y+11 ; 0x0b 11532: 9c 85 ldd r25, Y+12 ; 0x0c 11534: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 11538: 69 87 std Y+9, r22 ; 0x09 1153a: 7a 87 std Y+10, r23 ; 0x0a 1153c: 8b 87 std Y+11, r24 ; 0x0b 1153e: 9c 87 std Y+12, r25 ; 0x0c start_position[E_AXIS] += segment_extruder_travel; 11540: 2c 96 adiw r28, 0x0c ; 12 11542: 2c ad ldd r18, Y+60 ; 0x3c 11544: 3d ad ldd r19, Y+61 ; 0x3d 11546: 4e ad ldd r20, Y+62 ; 0x3e 11548: 5f ad ldd r21, Y+63 ; 0x3f 1154a: 2c 97 sbiw r28, 0x0c ; 12 1154c: 6d 85 ldd r22, Y+13 ; 0x0d 1154e: 7e 85 ldd r23, Y+14 ; 0x0e 11550: 8f 85 ldd r24, Y+15 ; 0x0f 11552: 98 89 ldd r25, Y+16 ; 0x10 11554: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 11558: 6d 87 std Y+13, r22 ; 0x0d 1155a: 7e 87 std Y+14, r23 ; 0x0e 1155c: 8f 87 std Y+15, r24 ; 0x0f 1155e: 98 8b std Y+16, r25 ; 0x10 // Clamp to the calculated position. clamp_to_software_endstops(start_position); 11560: ce 01 movw r24, r28 11562: 01 96 adiw r24, 0x01 ; 1 11564: 0e 94 bb 64 call 0xc976 ; 0xc976 // Insert the segment into the buffer if (i >= start_segment_idx) 11568: 2e 96 adiw r28, 0x0e ; 14 1156a: ae ad ldd r26, Y+62 ; 0x3e 1156c: bf ad ldd r27, Y+63 ; 0x3f 1156e: 2e 97 sbiw r28, 0x0e ; 14 11570: 2a 16 cp r2, r26 11572: 3b 06 cpc r3, r27 11574: f8 f0 brcs .+62 ; 0x115b4 plan_buffer_line(start_position[X_AXIS], start_position[Y_AXIS], start_position[Z_AXIS], start_position[E_AXIS], feed_rate, position, i); 11576: e9 84 ldd r14, Y+9 ; 0x09 11578: fa 84 ldd r15, Y+10 ; 0x0a 1157a: 0b 85 ldd r16, Y+11 ; 0x0b 1157c: 1c 85 ldd r17, Y+12 ; 0x0c 1157e: 2d 81 ldd r18, Y+5 ; 0x05 11580: 3e 81 ldd r19, Y+6 ; 0x06 11582: 4f 81 ldd r20, Y+7 ; 0x07 11584: 58 85 ldd r21, Y+8 ; 0x08 11586: 69 81 ldd r22, Y+1 ; 0x01 11588: 7a 81 ldd r23, Y+2 ; 0x02 1158a: 8b 81 ldd r24, Y+3 ; 0x03 1158c: 9c 81 ldd r25, Y+4 ; 0x04 1158e: 3f 92 push r3 11590: 2f 92 push r2 11592: e5 ef ldi r30, 0xF5 ; 245 11594: f1 e1 ldi r31, 0x11 ; 17 11596: ff 93 push r31 11598: ef 93 push r30 1159a: 88 ac ldd r8, Y+56 ; 0x38 1159c: 99 ac ldd r9, Y+57 ; 0x39 1159e: aa ac ldd r10, Y+58 ; 0x3a 115a0: bb ac ldd r11, Y+59 ; 0x3b 115a2: fe 01 movw r30, r28 115a4: 3d 96 adiw r30, 0x0d ; 13 115a6: 6f 01 movw r12, r30 115a8: 0f 94 e1 75 call 0x2ebc2 ; 0x2ebc2 115ac: 0f 90 pop r0 115ae: 0f 90 pop r0 115b0: 0f 90 pop r0 115b2: 0f 90 pop r0 // Handle the situation where the planner is aborted hard. if (planner_aborted) 115b4: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 115b8: 81 11 cpse r24, r1 115ba: 39 c0 rjmp .+114 ; 0x1162e 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++) { 115bc: ff ef ldi r31, 0xFF ; 255 115be: 2f 1a sub r2, r31 115c0: 3f 0a sbc r3, r31 115c2: 2c a9 ldd r18, Y+52 ; 0x34 115c4: 3d a9 ldd r19, Y+53 ; 0x35 115c6: 22 15 cp r18, r2 115c8: 33 05 cpc r19, r3 115ca: 09 f0 breq .+2 ; 0x115ce 115cc: 16 cf rjmp .-468 ; 0x113fa if (planner_aborted) return; } } // Clamp to the target position. clamp_to_software_endstops(target); 115ce: 83 e9 ldi r24, 0x93 ; 147 115d0: 96 e0 ldi r25, 0x06 ; 6 115d2: 0e 94 bb 64 call 0xc976 ; 0xc976 // 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); 115d6: e0 90 9b 06 lds r14, 0x069B ; 0x80069b 115da: f0 90 9c 06 lds r15, 0x069C ; 0x80069c 115de: 00 91 9d 06 lds r16, 0x069D ; 0x80069d 115e2: 10 91 9e 06 lds r17, 0x069E ; 0x80069e 115e6: 20 91 97 06 lds r18, 0x0697 ; 0x800697 115ea: 30 91 98 06 lds r19, 0x0698 ; 0x800698 115ee: 40 91 99 06 lds r20, 0x0699 ; 0x800699 115f2: 50 91 9a 06 lds r21, 0x069A ; 0x80069a 115f6: 60 91 93 06 lds r22, 0x0693 ; 0x800693 115fa: 70 91 94 06 lds r23, 0x0694 ; 0x800694 115fe: 80 91 95 06 lds r24, 0x0695 ; 0x800695 11602: 90 91 96 06 lds r25, 0x0696 ; 0x800696 11606: 1f 92 push r1 11608: 1f 92 push r1 1160a: e5 ef ldi r30, 0xF5 ; 245 1160c: f1 e1 ldi r31, 0x11 ; 17 1160e: ff 93 push r31 11610: ef 93 push r30 11612: 88 ac ldd r8, Y+56 ; 0x38 11614: 99 ac ldd r9, Y+57 ; 0x39 11616: aa ac ldd r10, Y+58 ; 0x3a 11618: bb ac ldd r11, Y+59 ; 0x3b 1161a: ef e9 ldi r30, 0x9F ; 159 1161c: ce 2e mov r12, r30 1161e: e6 e0 ldi r30, 0x06 ; 6 11620: de 2e mov r13, r30 11622: 0f 94 e1 75 call 0x2ebc2 ; 0x2ebc2 11626: 0f 90 pop r0 11628: 0f 90 pop r0 1162a: 0f 90 pop r0 1162c: 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(); 1162e: 0e 94 ac 54 call 0xa958 ; 0xa958 previous_millis_cmd.start(); 11632: 8a e4 ldi r24, 0x4A ; 74 11634: 93 e0 ldi r25, 0x03 ; 3 11636: 0f 94 29 12 call 0x22452 ; 0x22452 ::start()> 1163a: 4d cc rjmp .-1894 ; 0x10ed6 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; 1163c: 60 e0 ldi r22, 0x00 ; 0 1163e: 70 e0 ldi r23, 0x00 ; 0 11640: cb 01 movw r24, r22 11642: 5e cc rjmp .-1860 ; 0x10f00 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; 11644: a3 2c mov r10, r3 11646: b2 2c mov r11, r2 11648: 0c a9 ldd r16, Y+52 ; 0x34 1164a: 1c ad ldd r17, Y+60 ; 0x3c 1164c: b0 cd rjmp .-1184 ; 0x111ae // 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; 1164e: 28 a5 ldd r18, Y+40 ; 0x28 11650: 39 a5 ldd r19, Y+41 ; 0x29 11652: 4a a5 ldd r20, Y+42 ; 0x2a 11654: 5b a5 ldd r21, Y+43 ; 0x2b 11656: 6c ad ldd r22, Y+60 ; 0x3c 11658: 7d ad ldd r23, Y+61 ; 0x3d 1165a: 8e ad ldd r24, Y+62 ; 0x3e 1165c: 9f ad ldd r25, Y+63 ; 0x3f 1165e: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 11662: 4b 01 movw r8, r22 11664: 5c 01 movw r10, r24 11666: 2c a5 ldd r18, Y+44 ; 0x2c 11668: 3d a5 ldd r19, Y+45 ; 0x2d 1166a: 4e a5 ldd r20, Y+46 ; 0x2e 1166c: 5f a5 ldd r21, Y+47 ; 0x2f 1166e: 24 96 adiw r28, 0x04 ; 4 11670: 6c ad ldd r22, Y+60 ; 0x3c 11672: 7d ad ldd r23, Y+61 ; 0x3d 11674: 8e ad ldd r24, Y+62 ; 0x3e 11676: 9f ad ldd r25, Y+63 ; 0x3f 11678: 24 97 sbiw r28, 0x04 ; 4 1167a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1167e: 9b 01 movw r18, r22 11680: ac 01 movw r20, r24 11682: c5 01 movw r24, r10 11684: b4 01 movw r22, r8 11686: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1168a: 7b 01 movw r14, r22 1168c: 8c 01 movw r16, r24 r_axis_x = r_axis_x * cos_T - r_axis_y * sin_T; 1168e: 28 a5 ldd r18, Y+40 ; 0x28 11690: 39 a5 ldd r19, Y+41 ; 0x29 11692: 4a a5 ldd r20, Y+42 ; 0x2a 11694: 5b a5 ldd r21, Y+43 ; 0x2b 11696: 24 96 adiw r28, 0x04 ; 4 11698: 6c ad ldd r22, Y+60 ; 0x3c 1169a: 7d ad ldd r23, Y+61 ; 0x3d 1169c: 8e ad ldd r24, Y+62 ; 0x3e 1169e: 9f ad ldd r25, Y+63 ; 0x3f 116a0: 24 97 sbiw r28, 0x04 ; 4 116a2: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 116a6: 4b 01 movw r8, r22 116a8: 5c 01 movw r10, r24 116aa: 2c a5 ldd r18, Y+44 ; 0x2c 116ac: 3d a5 ldd r19, Y+45 ; 0x2d 116ae: 4e a5 ldd r20, Y+46 ; 0x2e 116b0: 5f a5 ldd r21, Y+47 ; 0x2f 116b2: 6c ad ldd r22, Y+60 ; 0x3c 116b4: 7d ad ldd r23, Y+61 ; 0x3d 116b6: 8e ad ldd r24, Y+62 ; 0x3e 116b8: 9f ad ldd r25, Y+63 ; 0x3f 116ba: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 116be: 9b 01 movw r18, r22 116c0: ac 01 movw r20, r24 116c2: c5 01 movw r24, r10 116c4: b4 01 movw r22, r8 116c6: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 116ca: 68 a7 std Y+40, r22 ; 0x28 116cc: 79 a7 std Y+41, r23 ; 0x29 116ce: 8a a7 std Y+42, r24 ; 0x2a 116d0: 9b a7 std Y+43, r25 ; 0x2b 116d2: d8 aa std Y+48, r13 ; 0x30 r_axis_y = r_axisi; 116d4: c7 01 movw r24, r14 116d6: d8 01 movw r26, r16 116d8: 8c a7 std Y+44, r24 ; 0x2c 116da: 9d a7 std Y+45, r25 ; 0x2d 116dc: ae a7 std Y+46, r26 ; 0x2e 116de: bf a7 std Y+47, r27 ; 0x2f 116e0: ff ce rjmp .-514 ; 0x114e0 - `S` - Time to wait, in seconds */ case 4: codenum = 0; if(code_seen('P')) codenum = code_value(); // milliseconds to wait 116e2: 80 e5 ldi r24, 0x50 ; 80 116e4: 0e 94 2b 55 call 0xaa56 ; 0xaa56 - `P` - Time to wait, in milliseconds - `S` - Time to wait, in seconds */ case 4: codenum = 0; 116e8: c1 2c mov r12, r1 116ea: d1 2c mov r13, r1 116ec: 76 01 movw r14, r12 if(code_seen('P')) codenum = code_value(); // milliseconds to wait 116ee: 88 23 and r24, r24 116f0: 31 f0 breq .+12 ; 0x116fe 116f2: 0e 94 03 5a call 0xb406 ; 0xb406 116f6: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 116fa: 6b 01 movw r12, r22 116fc: 7c 01 movw r14, r24 if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait 116fe: 83 e5 ldi r24, 0x53 ; 83 11700: 0e 94 2b 55 call 0xaa56 ; 0xaa56 11704: 88 23 and r24, r24 11706: 61 f0 breq .+24 ; 0x11720 11708: 0e 94 03 5a call 0xb406 ; 0xb406 1170c: 20 e0 ldi r18, 0x00 ; 0 1170e: 30 e0 ldi r19, 0x00 ; 0 11710: 4a e7 ldi r20, 0x7A ; 122 11712: 54 e4 ldi r21, 0x44 ; 68 11714: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 11718: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 1171c: 6b 01 movw r12, r22 1171e: 7c 01 movw r14, r24 if(codenum != 0) 11720: c1 14 cp r12, r1 11722: d1 04 cpc r13, r1 11724: e1 04 cpc r14, r1 11726: f1 04 cpc r15, r1 11728: 41 f0 breq .+16 ; 0x1173a { if(custom_message_type != CustomMsg::M117) 1172a: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 1172e: 87 30 cpi r24, 0x07 ; 7 11730: 21 f0 breq .+8 ; 0x1173a { LCD_MESSAGERPGM(_n("Sleep..."));////MSG_DWELL 11732: 8d e1 ldi r24, 0x1D ; 29 11734: 97 e6 ldi r25, 0x67 ; 103 11736: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 } } st_synchronize(); 1173a: 0f 94 ce 22 call 0x2459c ; 0x2459c codenum += _millis(); // keep track of when we started waiting 1173e: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 11742: c6 0e add r12, r22 11744: d7 1e adc r13, r23 11746: e8 1e adc r14, r24 11748: f9 1e adc r15, r25 previous_millis_cmd.start(); 1174a: 8a e4 ldi r24, 0x4A ; 74 1174c: 93 e0 ldi r25, 0x03 ; 3 1174e: 0f 94 29 12 call 0x22452 ; 0x22452 ::start()> while(_millis() < codenum) { 11752: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 11756: 6c 15 cp r22, r12 11758: 7d 05 cpc r23, r13 1175a: 8e 05 cpc r24, r14 1175c: 9f 05 cpc r25, r15 1175e: 08 f0 brcs .+2 ; 0x11762 11760: ba cb rjmp .-2188 ; 0x10ed6 manage_heater(); 11762: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(); 11766: 80 e0 ldi r24, 0x00 ; 0 11768: 0e 94 fe 79 call 0xf3fc ; 0xf3fc lcd_update(0); 1176c: 80 e0 ldi r24, 0x00 ; 0 1176e: 0e 94 38 69 call 0xd270 ; 0xd270 11772: ef cf rjmp .-34 ; 0x11752 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); 11774: 81 e0 ldi r24, 0x01 ; 1 */ case 11: #if EXTRUDERS > 1 retract(false,retracted_swap[active_extruder]); #else retract(false); 11776: 0e 94 50 be call 0x17ca0 ; 0x17ca0 1177a: ad cb rjmp .-2214 ; 0x10ed6 1177c: 80 e0 ldi r24, 0x00 ; 0 1177e: fb cf rjmp .-10 ; 0x11776 { 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]); 11780: 88 e5 ldi r24, 0x58 ; 88 11782: 0e 94 2b 55 call 0xaa56 ; 0xaa56 11786: 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; 11788: 41 2c mov r4, r1 1178a: 51 2c mov r5, r1 1178c: 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(); 1178e: 88 23 and r24, r24 11790: 21 f0 breq .+8 ; 0x1179a 11792: 0e 94 93 55 call 0xab26 ; 0xab26 11796: 2b 01 movw r4, r22 11798: 3c 01 movw r6, r24 bool home_y = code_seen(axis_codes[Y_AXIS]); 1179a: 89 e5 ldi r24, 0x59 ; 89 1179c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 117a0: 28 2e mov r2, r24 if (home_y) home_y_value = code_value_long(); 117a2: 88 23 and r24, r24 117a4: 71 f1 breq .+92 ; 0x11802 117a6: 0e 94 93 55 call 0xab26 ; 0xab26 117aa: 6c a7 std Y+44, r22 ; 0x2c 117ac: 7d a7 std Y+45, r23 ; 0x2d 117ae: 8e a7 std Y+46, r24 ; 0x2e 117b0: 9f a7 std Y+47, r25 ; 0x2f bool home_z = code_seen(axis_codes[Z_AXIS]); 117b2: 8a e5 ldi r24, 0x5A ; 90 117b4: 0e 94 2b 55 call 0xaa56 ; 0xaa56 117b8: d8 2e mov r13, r24 */ case 28: { long home_x_value = 0; long home_y_value = 0; long home_z_value = 0; 117ba: 81 2c mov r8, r1 117bc: 91 2c mov r9, r1 117be: 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(); 117c0: 88 23 and r24, r24 117c2: 21 f0 breq .+8 ; 0x117cc 117c4: 0e 94 93 55 call 0xab26 ; 0xab26 117c8: 4b 01 movw r8, r22 117ca: 5c 01 movw r10, r24 bool without_mbl = code_seen('W'); 117cc: 87 e5 ldi r24, 0x57 ; 87 117ce: 0e 94 2b 55 call 0xaa56 ; 0xaa56 117d2: 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); 117d4: 8f 93 push r24 117d6: cd 2c mov r12, r13 117d8: ec a4 ldd r14, Y+44 ; 0x2c 117da: fd a4 ldd r15, Y+45 ; 0x2d 117dc: 0e a5 ldd r16, Y+46 ; 0x2e 117de: 1f a5 ldd r17, Y+47 ; 0x2f 117e0: 22 2d mov r18, r2 117e2: b3 01 movw r22, r6 117e4: a2 01 movw r20, r4 117e6: 83 2d mov r24, r3 117e8: 0e 94 69 67 call 0xced2 ; 0xced2 #endif //TMC2130 if ((home_x || home_y || without_mbl || home_z) == false) { 117ec: 0f 90 pop r0 117ee: 31 10 cpse r3, r1 117f0: 72 cb rjmp .-2332 ; 0x10ed6 117f2: 21 10 cpse r2, r1 117f4: 70 cb rjmp .-2336 ; 0x10ed6 117f6: 38 a5 ldd r19, Y+40 ; 0x28 117f8: 31 11 cpse r19, r1 117fa: 6d cb rjmp .-2342 ; 0x10ed6 117fc: d1 10 cpse r13, r1 117fe: 6b cb rjmp .-2346 ; 0x10ed6 11800: 20 cb rjmp .-2496 ; 0x10e42 - `C` - Calibrate X and Y origin (home) - Only on MK3/s */ case 28: { long home_x_value = 0; long home_y_value = 0; 11802: 1c a6 std Y+44, r1 ; 0x2c 11804: 1d a6 std Y+45, r1 ; 0x2d 11806: 1e a6 std Y+46, r1 ; 0x2e 11808: 1f a6 std Y+47, r1 ; 0x2f 1180a: d3 cf rjmp .-90 ; 0x117b2 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) 1180c: 08 e2 ldi r16, 0x28 ; 40 1180e: 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)); 11810: 98 ef ldi r25, 0xF8 ; 248 11812: e9 2e mov r14, r25 11814: 96 e6 ldi r25, 0x66 ; 102 11816: f9 2e mov r15, r25 11818: 60 2f mov r22, r16 1181a: 70 e0 ldi r23, 0x00 ; 0 1181c: 90 e0 ldi r25, 0x00 ; 0 1181e: 80 e0 ldi r24, 0x00 ; 0 11820: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 11824: 0e 94 04 56 call 0xac08 ; 0xac08 11828: 9f 93 push r25 1182a: 8f 93 push r24 1182c: 7f 93 push r23 1182e: 6f 93 push r22 11830: 1f 93 push r17 11832: 0f 93 push r16 11834: ff 92 push r15 11836: ef 92 push r14 11838: 0f 94 5d 9f call 0x33eba ; 0x33eba 1183c: 0f 5f subi r16, 0xFF ; 255 1183e: 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++) 11840: 0f b6 in r0, 0x3f ; 63 11842: f8 94 cli 11844: de bf out 0x3e, r29 ; 62 11846: 0f be out 0x3f, r0 ; 63 11848: cd bf out 0x3d, r28 ; 61 1184a: 0f 36 cpi r16, 0x6F ; 111 1184c: 11 05 cpc r17, r1 1184e: 21 f7 brne .-56 ; 0x11818 11850: 42 cb rjmp .-2428 ; 0x10ed6 ``` */ case 76: { #ifdef PINDA_THERMISTOR if (!has_temperature_compensation()) 11852: 0f 94 3a 15 call 0x22a74 ; 0x22a74 11856: 81 11 cpse r24, r1 11858: 05 c0 rjmp .+10 ; 0x11864 { SERIAL_ECHOLNPGM("No PINDA thermistor"); 1185a: 80 e9 ldi r24, 0x90 ; 144 1185c: 90 e8 ldi r25, 0x80 ; 128 1185e: 0e 94 49 72 call 0xe492 ; 0xe492 11862: 39 cb rjmp .-2446 ; 0x10ed6 break; } if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 11864: 82 e0 ldi r24, 0x02 ; 2 11866: 0e 94 52 d8 call 0x1b0a4 ; 0x1b0a4 1186a: 81 11 cpse r24, r1 1186c: 07 c0 rjmp .+14 ; 0x1187c //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)); 1186e: 8a ed ldi r24, 0xDA ; 218 11870: 99 e3 ldi r25, 0x39 ; 57 11872: 0e 94 a7 6c call 0xd94e ; 0xd94e 11876: 0f 94 a9 0b call 0x21752 ; 0x21752 1187a: 2d cb rjmp .-2470 ; 0x10ed6 break; } if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) 1187c: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 11880: 88 23 and r24, r24 11882: 41 f0 breq .+16 ; 0x11894 11884: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 11888: 88 23 and r24, r24 1188a: 21 f0 breq .+8 ; 0x11894 1188c: d0 90 a5 06 lds r13, 0x06A5 ; 0x8006a5 11890: d1 10 cpse r13, r1 11892: 08 c0 rjmp .+16 ; 0x118a4 11894: 81 e0 ldi r24, 0x01 ; 1 11896: 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); 1189a: 82 e1 ldi r24, 0x12 ; 18 1189c: 98 e6 ldi r25, 0x68 ; 104 1189e: 0f 94 16 44 call 0x2882c ; 0x2882c 118a2: 19 cb rjmp .-2510 ; 0x10ed6 break; } lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CAL_WARNING)); 118a4: 81 e9 ldi r24, 0x91 ; 145 118a6: 99 e3 ldi r25, 0x39 ; 57 118a8: 0e 94 a7 6c call 0xd94e ; 0xd94e 118ac: 0f 94 a9 0b call 0x21752 ; 0x21752 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false); 118b0: 89 ed ldi r24, 0xD9 ; 217 118b2: 90 e5 ldi r25, 0x50 ; 80 118b4: 0e 94 a7 6c call 0xd94e ; 0xd94e 118b8: 41 e0 ldi r20, 0x01 ; 1 118ba: 60 e0 ldi r22, 0x00 ; 0 118bc: 0f 94 8a 2e call 0x25d14 ; 0x25d14 if (result == LCD_LEFT_BUTTON_CHOICE) 118c0: 81 11 cpse r24, r1 118c2: 6e c0 rjmp .+220 ; 0x119a0 { current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 118c4: 80 e0 ldi r24, 0x00 ; 0 118c6: 90 e0 ldi r25, 0x00 ; 0 118c8: a0 ea ldi r26, 0xA0 ; 160 118ca: b0 e4 ldi r27, 0x40 ; 64 118cc: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 118d0: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 118d4: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 118d8: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 118dc: 60 e0 ldi r22, 0x00 ; 0 118de: 70 e0 ldi r23, 0x00 ; 0 118e0: 88 e4 ldi r24, 0x48 ; 72 118e2: 92 e4 ldi r25, 0x42 ; 66 118e4: 0f 94 2f 85 call 0x30a5e ; 0x30a5e current_position[Z_AXIS] = 50; 118e8: 80 e0 ldi r24, 0x00 ; 0 118ea: 90 e0 ldi r25, 0x00 ; 0 118ec: a8 e4 ldi r26, 0x48 ; 72 118ee: b2 e4 ldi r27, 0x42 ; 66 118f0: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 118f4: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 118f8: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 118fc: b0 93 00 12 sts 0x1200, r27 ; 0x801200 current_position[Y_AXIS] = 180; 11900: 80 e0 ldi r24, 0x00 ; 0 11902: 90 e0 ldi r25, 0x00 ; 0 11904: a4 e3 ldi r26, 0x34 ; 52 11906: b3 e4 ldi r27, 0x43 ; 67 11908: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 1190c: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 11910: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 11914: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(3000 / 60); 11918: 60 e0 ldi r22, 0x00 ; 0 1191a: 70 e0 ldi r23, 0x00 ; 0 1191c: 88 e4 ldi r24, 0x48 ; 72 1191e: 92 e4 ldi r25, 0x42 ; 66 11920: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 11924: 0f 94 ce 22 call 0x2459c ; 0x2459c lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET)); 11928: 8f ea ldi r24, 0xAF ; 175 1192a: 90 e5 ldi r25, 0x50 ; 80 1192c: 0e 94 a7 6c call 0xd94e ; 0xd94e 11930: 0f 94 a9 0b call 0x21752 ; 0x21752 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 11934: e0 e5 ldi r30, 0x50 ; 80 11936: f8 e8 ldi r31, 0x88 ; 136 11938: 85 91 lpm r24, Z+ 1193a: 95 91 lpm r25, Z+ 1193c: a5 91 lpm r26, Z+ 1193e: b4 91 lpm r27, Z 11940: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 11944: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 11948: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 1194c: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 11950: ec e4 ldi r30, 0x4C ; 76 11952: f8 e8 ldi r31, 0x88 ; 136 11954: 85 91 lpm r24, Z+ 11956: 95 91 lpm r25, Z+ 11958: a5 91 lpm r26, Z+ 1195a: b4 91 lpm r27, Z 1195c: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 11960: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 11964: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 11968: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 plan_buffer_line_curposXYZE(3000 / 60); 1196c: 60 e0 ldi r22, 0x00 ; 0 1196e: 70 e0 ldi r23, 0x00 ; 0 11970: 88 e4 ldi r24, 0x48 ; 72 11972: 92 e4 ldi r25, 0x42 ; 66 11974: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 11978: 0f 94 ce 22 call 0x2459c ; 0x2459c 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); 1197c: 81 e0 ldi r24, 0x01 ; 1 1197e: 8f 93 push r24 11980: 81 2c mov r8, r1 11982: 91 2c mov r9, r1 11984: 54 01 movw r10, r8 11986: cc 24 eor r12, r12 11988: c3 94 inc r12 1198a: e1 2c mov r14, r1 1198c: f1 2c mov r15, r1 1198e: 87 01 movw r16, r14 11990: 20 e0 ldi r18, 0x00 ; 0 11992: 40 e0 ldi r20, 0x00 ; 0 11994: 50 e0 ldi r21, 0x00 ; 0 11996: ba 01 movw r22, r20 11998: 80 e0 ldi r24, 0x00 ; 0 1199a: 0e 94 69 67 call 0xced2 ; 0xced2 1199e: 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)) { 119a0: 20 e0 ldi r18, 0x00 ; 0 119a2: 30 e0 ldi r19, 0x00 ; 0 119a4: 4c e0 ldi r20, 0x0C ; 12 119a6: 52 e4 ldi r21, 0x42 ; 66 119a8: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 119ac: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 119b0: 80 91 90 06 lds r24, 0x0690 ; 0x800690 119b4: 90 91 91 06 lds r25, 0x0691 ; 0x800691 119b8: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 119bc: 18 16 cp r1, r24 119be: 0c f0 brlt .+2 ; 0x119c2 119c0: 76 c0 rjmp .+236 ; 0x11aae 119c2: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 119c6: 81 11 cpse r24, r1 119c8: 72 c0 rjmp .+228 ; 0x11aae //waiting for PIDNA probe to cool down in case that we are not in farm mode current_position[Z_AXIS] = 100; 119ca: 80 e0 ldi r24, 0x00 ; 0 119cc: 90 e0 ldi r25, 0x00 ; 0 119ce: a8 ec ldi r26, 0xC8 ; 200 119d0: b2 e4 ldi r27, 0x42 ; 66 119d2: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 119d6: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 119da: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 119de: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 119e2: 60 e0 ldi r22, 0x00 ; 0 119e4: 70 e0 ldi r23, 0x00 ; 0 119e6: 88 e4 ldi r24, 0x48 ; 72 119e8: 92 e4 ldi r25, 0x42 ; 66 119ea: 0f 94 2f 85 call 0x30a5e ; 0x30a5e } #ifdef PINDA_THERMISTOR bool lcd_wait_for_pinda(float temp) { disable_heater(); 119ee: 0f 94 e7 12 call 0x225ce ; 0x225ce LongTimer pinda_timeout; 119f2: 19 82 std Y+1, r1 ; 0x01 119f4: 1a 82 std Y+2, r1 ; 0x02 119f6: 1b 82 std Y+3, r1 ; 0x03 119f8: 1c 82 std Y+4, r1 ; 0x04 119fa: 1d 82 std Y+5, r1 ; 0x05 pinda_timeout.start(); 119fc: ce 01 movw r24, r28 119fe: 01 96 adiw r24, 0x01 ; 1 11a00: 0f 94 29 12 call 0x22452 ; 0x22452 ::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); 11a04: 83 e2 ldi r24, 0x23 ; 35 11a06: f8 2e mov r15, r24 11a08: 0f e1 ldi r16, 0x1F ; 31 11a0a: 1e e7 ldi r17, 0x7E ; 126 disable_heater(); LongTimer pinda_timeout; pinda_timeout.start(); bool target_temp_reached = true; while (current_temperature_pinda > temp){ 11a0c: 20 e0 ldi r18, 0x00 ; 0 11a0e: 30 e0 ldi r19, 0x00 ; 0 11a10: 4c e0 ldi r20, 0x0C ; 12 11a12: 52 e4 ldi r21, 0x42 ; 66 11a14: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 11a18: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 11a1c: 80 91 90 06 lds r24, 0x0690 ; 0x800690 11a20: 90 91 91 06 lds r25, 0x0691 ; 0x800691 11a24: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 11a28: 18 16 cp r1, r24 11a2a: c4 f5 brge .+112 ; 0x11a9c lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP_PINDA)); 11a2c: 83 e4 ldi r24, 0x43 ; 67 11a2e: 99 e3 ldi r25, 0x39 ; 57 11a30: 0e 94 a7 6c call 0xd94e ; 0xd94e 11a34: 0f 94 22 0b call 0x21644 ; 0x21644 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 11a38: 42 e8 ldi r20, 0x82 ; 130 11a3a: 64 e0 ldi r22, 0x04 ; 4 11a3c: 80 e0 ldi r24, 0x00 ; 0 11a3e: 0e 94 91 69 call 0xd322 ; 0xd322 lcd_printf_P(PSTR("%3d/%3d"), (int16_t)current_temperature_pinda, (int16_t) temp); 11a42: 1f 92 push r1 11a44: ff 92 push r15 11a46: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 11a4a: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 11a4e: 80 91 90 06 lds r24, 0x0690 ; 0x800690 11a52: 90 91 91 06 lds r25, 0x0691 ; 0x800691 11a56: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 11a5a: 7f 93 push r23 11a5c: 6f 93 push r22 11a5e: 1f 93 push r17 11a60: 0f 93 push r16 11a62: 0e 94 4a 69 call 0xd294 ; 0xd294 lcd_putc(LCD_STR_DEGREE[0]); 11a66: 81 e8 ldi r24, 0x81 ; 129 11a68: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 delay_keep_alive(1000); 11a6c: 88 ee ldi r24, 0xE8 ; 232 11a6e: 93 e0 ldi r25, 0x03 ; 3 11a70: 0e 94 45 7c call 0xf88a ; 0xf88a serialecho_temperatures(); 11a74: 0e 94 5e 70 call 0xe0bc ; 0xe0bc if (pinda_timeout.expired(8 * 60 * 1000ul)) { //PINDA cooling from 60 C to 35 C takes about 7 minutes 11a78: 40 e0 ldi r20, 0x00 ; 0 11a7a: 53 e5 ldi r21, 0x53 ; 83 11a7c: 67 e0 ldi r22, 0x07 ; 7 11a7e: 70 e0 ldi r23, 0x00 ; 0 11a80: ce 01 movw r24, r28 11a82: 01 96 adiw r24, 0x01 ; 1 11a84: 0f 94 6a 10 call 0x220d4 ; 0x220d4 ::expired(unsigned long)> 11a88: 0f 90 pop r0 11a8a: 0f 90 pop r0 11a8c: 0f 90 pop r0 11a8e: 0f 90 pop r0 11a90: 0f 90 pop r0 11a92: 0f 90 pop r0 11a94: 88 23 and r24, r24 11a96: 09 f4 brne .+2 ; 0x11a9a 11a98: b9 cf rjmp .-142 ; 0x11a0c target_temp_reached = false; 11a9a: d1 2c mov r13, r1 break; } } lcd_update_enable(true); 11a9c: 81 e0 ldi r24, 0x01 ; 1 11a9e: 0e 94 b6 69 call 0xd36c ; 0xd36c if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails 11aa2: d1 10 cpse r13, r1 11aa4: 04 c0 rjmp .+8 ; 0x11aae lcd_temp_cal_show_result(false); 11aa6: 80 e0 ldi r24, 0x00 ; 0 11aa8: 0f 94 3a 0c call 0x21874 ; 0x21874 11aac: 14 ca rjmp .-3032 ; 0x10ed6 break; } } st_synchronize(); 11aae: 0f 94 ce 22 call 0x2459c ; 0x2459c homing_flag = true; // keep homing on to avoid babystepping while the LCD is enabled 11ab2: 81 e0 ldi r24, 0x01 ; 1 11ab4: 80 93 05 12 sts 0x1205, r24 ; 0x801205 lcd_update_enable(true); 11ab8: 0e 94 b6 69 call 0xd36c ; 0xd36c SERIAL_ECHOLNPGM("PINDA probe calibration start"); 11abc: 82 e7 ldi r24, 0x72 ; 114 11abe: 90 e8 ldi r25, 0x80 ; 128 11ac0: 0e 94 49 72 call 0xe492 ; 0xe492 float zero_z; int z_shift = 0; //unit: steps float start_temp = 5 * (int)(current_temperature_pinda / 5); 11ac4: 80 90 8e 06 lds r8, 0x068E ; 0x80068e 11ac8: 90 90 8f 06 lds r9, 0x068F ; 0x80068f 11acc: a0 90 90 06 lds r10, 0x0690 ; 0x800690 11ad0: b0 90 91 06 lds r11, 0x0691 ; 0x800691 11ad4: 20 e0 ldi r18, 0x00 ; 0 11ad6: 30 e0 ldi r19, 0x00 ; 0 11ad8: 40 ea ldi r20, 0xA0 ; 160 11ada: 50 e4 ldi r21, 0x40 ; 64 11adc: c5 01 movw r24, r10 11ade: b4 01 movw r22, r8 11ae0: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 11ae4: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 11ae8: 25 e0 ldi r18, 0x05 ; 5 11aea: 26 9f mul r18, r22 11aec: a0 01 movw r20, r0 11aee: 27 9f mul r18, r23 11af0: 50 0d add r21, r0 11af2: 11 24 eor r1, r1 11af4: ba 01 movw r22, r20 11af6: 55 0f add r21, r21 11af8: 88 0b sbc r24, r24 11afa: 99 0b sbc r25, r25 11afc: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 11b00: 1b 01 movw r2, r22 11b02: 7c 01 movw r14, r24 if (start_temp < 35) start_temp = 35; 11b04: 20 e0 ldi r18, 0x00 ; 0 11b06: 30 e0 ldi r19, 0x00 ; 0 11b08: 4c e0 ldi r20, 0x0C ; 12 11b0a: 52 e4 ldi r21, 0x42 ; 66 11b0c: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 11b10: 87 ff sbrs r24, 7 11b12: 06 c0 rjmp .+12 ; 0x11b20 11b14: 21 2c mov r2, r1 11b16: 31 2c mov r3, r1 11b18: 1c e0 ldi r17, 0x0C ; 12 11b1a: e1 2e mov r14, r17 11b1c: 02 e4 ldi r16, 0x42 ; 66 11b1e: f0 2e mov r15, r16 if (start_temp < current_temperature_pinda) start_temp += 5; 11b20: 22 2d mov r18, r2 11b22: 33 2d mov r19, r3 11b24: 4e 2d mov r20, r14 11b26: 5f 2d mov r21, r15 11b28: c5 01 movw r24, r10 11b2a: b4 01 movw r22, r8 11b2c: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 11b30: 18 16 cp r1, r24 11b32: 64 f4 brge .+24 ; 0x11b4c 11b34: 20 e0 ldi r18, 0x00 ; 0 11b36: 30 e0 ldi r19, 0x00 ; 0 11b38: 40 ea ldi r20, 0xA0 ; 160 11b3a: 50 e4 ldi r21, 0x40 ; 64 11b3c: 62 2d mov r22, r2 11b3e: 73 2d mov r23, r3 11b40: 8e 2d mov r24, r14 11b42: 9f 2d mov r25, r15 11b44: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 11b48: 1b 01 movw r2, r22 11b4a: 7c 01 movw r14, r24 printf_P(_N("start temperature: %.1f\n"), start_temp); 11b4c: ff 92 push r15 11b4e: ef 92 push r14 11b50: 3f 92 push r3 11b52: 2f 92 push r2 11b54: 8f ed ldi r24, 0xDF ; 223 11b56: 96 e6 ldi r25, 0x66 ; 102 11b58: 9f 93 push r25 11b5a: 8f 93 push r24 11b5c: 0f 94 5d 9f call 0x33eba ; 0x33eba setTargetBed(70 + (start_temp - 30)); 11b60: 20 e0 ldi r18, 0x00 ; 0 11b62: 30 e0 ldi r19, 0x00 ; 0 11b64: 40 ef ldi r20, 0xF0 ; 240 11b66: 51 e4 ldi r21, 0x41 ; 65 11b68: 62 2d mov r22, r2 11b6a: 73 2d mov r23, r3 11b6c: 8e 2d mov r24, r14 11b6e: 9f 2d mov r25, r15 11b70: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 11b74: 20 e0 ldi r18, 0x00 ; 0 11b76: 30 e0 ldi r19, 0x00 ; 0 11b78: 4c e8 ldi r20, 0x8C ; 140 11b7a: 52 e4 ldi r21, 0x42 ; 66 11b7c: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 11b80: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 11b84: 70 93 ee 11 sts 0x11EE, r23 ; 0x8011ee 11b88: 60 93 ed 11 sts 0x11ED, r22 ; 0x8011ed custom_message_type = CustomMsg::TempCal; 11b8c: 84 e0 ldi r24, 0x04 ; 4 11b8e: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 custom_message_state = 1; 11b92: 81 e0 ldi r24, 0x01 ; 1 11b94: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac lcd_setstatuspgm(_T(MSG_PINDA_CALIBRATION)); 11b98: 85 ee ldi r24, 0xE5 ; 229 11b9a: 9a e3 ldi r25, 0x3A ; 58 11b9c: 0e 94 a7 6c call 0xd94e ; 0xd94e 11ba0: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 11ba4: 80 e0 ldi r24, 0x00 ; 0 11ba6: 90 e0 ldi r25, 0x00 ; 0 11ba8: a0 ea ldi r26, 0xA0 ; 160 11baa: b0 e4 ldi r27, 0x40 ; 64 11bac: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 11bb0: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 11bb4: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11bb8: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11bbc: 60 e0 ldi r22, 0x00 ; 0 11bbe: 70 e0 ldi r23, 0x00 ; 0 11bc0: 88 e4 ldi r24, 0x48 ; 72 11bc2: 92 e4 ldi r25, 0x42 ; 66 11bc4: 0f 94 2f 85 call 0x30a5e ; 0x30a5e current_position[X_AXIS] = PINDA_PREHEAT_X; 11bc8: 80 e0 ldi r24, 0x00 ; 0 11bca: 90 e0 ldi r25, 0x00 ; 0 11bcc: a0 ea ldi r26, 0xA0 ; 160 11bce: b1 e4 ldi r27, 0x41 ; 65 11bd0: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 11bd4: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 11bd8: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 11bdc: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 11be0: 80 e0 ldi r24, 0x00 ; 0 11be2: 90 e0 ldi r25, 0x00 ; 0 11be4: a0 e7 ldi r26, 0x70 ; 112 11be6: b2 e4 ldi r27, 0x42 ; 66 11be8: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 11bec: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 11bf0: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 11bf4: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(3000 / 60); 11bf8: 60 e0 ldi r22, 0x00 ; 0 11bfa: 70 e0 ldi r23, 0x00 ; 0 11bfc: 88 e4 ldi r24, 0x48 ; 72 11bfe: 92 e4 ldi r25, 0x42 ; 66 11c00: 0f 94 2f 85 call 0x30a5e ; 0x30a5e current_position[Z_AXIS] = PINDA_PREHEAT_Z; 11c04: 8a e9 ldi r24, 0x9A ; 154 11c06: 99 e9 ldi r25, 0x99 ; 153 11c08: a9 e1 ldi r26, 0x19 ; 25 11c0a: be e3 ldi r27, 0x3E ; 62 11c0c: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 11c10: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 11c14: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11c18: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11c1c: 60 e0 ldi r22, 0x00 ; 0 11c1e: 70 e0 ldi r23, 0x00 ; 0 11c20: 88 e4 ldi r24, 0x48 ; 72 11c22: 92 e4 ldi r25, 0x42 ; 66 11c24: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 11c28: 0f 94 ce 22 call 0x2459c ; 0x2459c 11c2c: 0f 90 pop r0 11c2e: 0f 90 pop r0 11c30: 0f 90 pop r0 11c32: 0f 90 pop r0 11c34: 0f 90 pop r0 11c36: 0f 90 pop r0 while (current_temperature_pinda < start_temp) 11c38: 20 91 8e 06 lds r18, 0x068E ; 0x80068e 11c3c: 30 91 8f 06 lds r19, 0x068F ; 0x80068f 11c40: 40 91 90 06 lds r20, 0x0690 ; 0x800690 11c44: 50 91 91 06 lds r21, 0x0691 ; 0x800691 11c48: 62 2d mov r22, r2 11c4a: 73 2d mov r23, r3 11c4c: 8e 2d mov r24, r14 11c4e: 9f 2d mov r25, r15 11c50: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 11c54: 18 16 cp r1, r24 11c56: 3c f4 brge .+14 ; 0x11c66 { delay_keep_alive(1000); 11c58: 88 ee ldi r24, 0xE8 ; 232 11c5a: 93 e0 ldi r25, 0x03 ; 3 11c5c: 0e 94 45 7c call 0xf88a ; 0xf88a serialecho_temperatures(); 11c60: 0e 94 5e 70 call 0xe0bc ; 0xe0bc 11c64: e9 cf rjmp .-46 ; 0x11c38 11c66: 60 e0 ldi r22, 0x00 ; 0 11c68: 86 ea ldi r24, 0xA6 ; 166 11c6a: 9f e0 ldi r25, 0x0F ; 15 11c6c: 0f 94 bf a0 call 0x3417e ; 0x3417e } 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; 11c70: 80 e0 ldi r24, 0x00 ; 0 11c72: 90 e0 ldi r25, 0x00 ; 0 11c74: a0 ea ldi r26, 0xA0 ; 160 11c76: b0 e4 ldi r27, 0x40 ; 64 11c78: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 11c7c: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 11c80: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11c84: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11c88: 60 e0 ldi r22, 0x00 ; 0 11c8a: 70 e0 ldi r23, 0x00 ; 0 11c8c: 88 e4 ldi r24, 0x48 ; 72 11c8e: 92 e4 ldi r25, 0x42 ; 66 11c90: 0f 94 2f 85 call 0x30a5e ; 0x30a5e current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 11c94: ec e4 ldi r30, 0x4C ; 76 11c96: f8 e8 ldi r31, 0x88 ; 136 11c98: 85 91 lpm r24, Z+ 11c9a: 95 91 lpm r25, Z+ 11c9c: a5 91 lpm r26, Z+ 11c9e: b4 91 lpm r27, Z 11ca0: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 11ca4: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 11ca8: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 11cac: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 11cb0: e0 e5 ldi r30, 0x50 ; 80 11cb2: f8 e8 ldi r31, 0x88 ; 136 11cb4: 85 91 lpm r24, Z+ 11cb6: 95 91 lpm r25, Z+ 11cb8: a5 91 lpm r26, Z+ 11cba: b4 91 lpm r27, Z 11cbc: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 11cc0: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 11cc4: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 11cc8: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(3000 / 60); 11ccc: 60 e0 ldi r22, 0x00 ; 0 11cce: 70 e0 ldi r23, 0x00 ; 0 11cd0: 88 e4 ldi r24, 0x48 ; 72 11cd2: 92 e4 ldi r25, 0x42 ; 66 11cd4: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 11cd8: 0f 94 ce 22 call 0x2459c ; 0x2459c bool find_z_result = find_bed_induction_sensor_point_z(-1.f); 11cdc: 43 e0 ldi r20, 0x03 ; 3 11cde: 60 e0 ldi r22, 0x00 ; 0 11ce0: 70 e0 ldi r23, 0x00 ; 0 11ce2: 80 e8 ldi r24, 0x80 ; 128 11ce4: 9f eb ldi r25, 0xBF ; 191 11ce6: 0f 94 ba 56 call 0x2ad74 ; 0x2ad74 if (find_z_result == false) { 11cea: 81 11 cpse r24, r1 11cec: 05 c0 rjmp .+10 ; 0x11cf8 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); 11cee: 0f 94 3a 0c call 0x21874 ; 0x21874 homing_flag = false; 11cf2: 10 92 05 12 sts 0x1205, r1 ; 0x801205 11cf6: ef c8 rjmp .-3618 ; 0x10ed6 if (find_z_result == false) { lcd_temp_cal_show_result(find_z_result); homing_flag = false; break; } zero_z = current_position[Z_AXIS]; 11cf8: 90 91 fd 11 lds r25, 0x11FD ; 0x8011fd 11cfc: 98 a7 std Y+40, r25 ; 0x28 11cfe: a0 91 fe 11 lds r26, 0x11FE ; 0x8011fe 11d02: ac a7 std Y+44, r26 ; 0x2c 11d04: b0 91 ff 11 lds r27, 0x11FF ; 0x8011ff 11d08: b8 ab std Y+48, r27 ; 0x30 11d0a: e0 91 00 12 lds r30, 0x1200 ; 0x801200 11d0e: e8 af std Y+56, r30 ; 0x38 printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); 11d10: ef 93 push r30 11d12: bf 93 push r27 11d14: af 93 push r26 11d16: 9f 93 push r25 11d18: 82 ed ldi r24, 0xD2 ; 210 11d1a: 96 e6 ldi r25, 0x66 ; 102 11d1c: 9f 93 push r25 11d1e: 8f 93 push r24 11d20: 0f 94 5d 9f call 0x33eba ; 0x33eba 11d24: 0f 90 pop r0 11d26: 0f 90 pop r0 11d28: 0f 90 pop r0 11d2a: 0f 90 pop r0 11d2c: 0f 90 pop r0 11d2e: 0f 90 pop r0 11d30: ae ea ldi r26, 0xAE ; 174 11d32: 8a 2e mov r8, r26 11d34: af e0 ldi r26, 0x0F ; 15 11d36: 9a 2e mov r9, r26 11d38: b3 e2 ldi r27, 0x23 ; 35 11d3a: cb 2e mov r12, r27 11d3c: d1 2c mov r13, r1 int i = -1; for (; i < 5; i++) 11d3e: 0f ef ldi r16, 0xFF ; 255 11d40: 1f ef ldi r17, 0xFF ; 255 { float temp = (40 + i * 5); 11d42: b6 01 movw r22, r12 11d44: 0d 2c mov r0, r13 11d46: 00 0c add r0, r0 11d48: 88 0b sbc r24, r24 11d4a: 99 0b sbc r25, r25 11d4c: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 11d50: 2b 01 movw r4, r22 11d52: 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)); 11d54: df 92 push r13 11d56: cf 92 push r12 11d58: c8 01 movw r24, r16 11d5a: 02 96 adiw r24, 0x02 ; 2 11d5c: 9f 93 push r25 11d5e: 8f 93 push r24 11d60: 26 e9 ldi r18, 0x96 ; 150 11d62: 36 e6 ldi r19, 0x66 ; 102 11d64: 3f 93 push r19 11d66: 2f 93 push r18 11d68: 0f 94 5d 9f call 0x33eba ; 0x33eba 11d6c: 58 01 movw r10, r16 11d6e: 5f ef ldi r21, 0xFF ; 255 11d70: a5 1a sub r10, r21 11d72: b5 0a sbc r11, r21 if (i >= 0) { 11d74: 0f 90 pop r0 11d76: 0f 90 pop r0 11d78: 0f 90 pop r0 11d7a: 0f 90 pop r0 11d7c: 0f 90 pop r0 11d7e: 0f 90 pop r0 11d80: 11 f4 brne .+4 ; 0x11d86 11d82: 0c 94 29 b0 jmp 0x16052 ; 0x16052 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 11d86: 70 e0 ldi r23, 0x00 ; 0 11d88: 60 e0 ldi r22, 0x00 ; 0 11d8a: c4 01 movw r24, r8 11d8c: 0f 94 dd a0 call 0x341ba ; 0x341ba eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; 11d90: a3 01 movw r20, r6 11d92: 92 01 movw r18, r4 11d94: 62 2d mov r22, r2 11d96: 73 2d mov r23, r3 11d98: 8e 2d mov r24, r14 11d9a: 9f 2d mov r25, r15 11d9c: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 11da0: 18 16 cp r1, r24 11da2: 44 f4 brge .+16 ; 0x11db4 } zero_z = current_position[Z_AXIS]; printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); int i = -1; for (; i < 5; i++) 11da4: 85 e0 ldi r24, 0x05 ; 5 11da6: a8 16 cp r10, r24 11da8: b1 04 cpc r11, r1 11daa: 11 f0 breq .+4 ; 0x11db0 11dac: 0c 94 35 b0 jmp 0x1606a ; 0x1606a 11db0: 05 e0 ldi r16, 0x05 ; 5 11db2: 10 e0 ldi r17, 0x00 ; 0 11db4: 58 01 movw r10, r16 11db6: 97 e2 ldi r25, 0x27 ; 39 11db8: a9 1a sub r10, r25 11dba: 98 ef ldi r25, 0xF8 ; 248 11dbc: b9 0a sbc r11, r25 11dbe: aa 0c add r10, r10 11dc0: bb 1c adc r11, r11 11dc2: 85 e0 ldi r24, 0x05 ; 5 11dc4: 80 9f mul r24, r16 11dc6: 10 01 movw r2, r0 11dc8: 81 9f mul r24, r17 11dca: 30 0c add r3, r0 11dcc: 11 24 eor r1, r1 11dce: 0d 5f subi r16, 0xFD ; 253 11dd0: 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; 11dd2: ea e9 ldi r30, 0x9A ; 154 11dd4: 4e 2e mov r4, r30 11dd6: e9 e9 ldi r30, 0x99 ; 153 11dd8: 5e 2e mov r5, r30 11dda: e9 e1 ldi r30, 0x19 ; 25 11ddc: 6e 2e mov r6, r30 11dde: ee e3 ldi r30, 0x3E ; 62 11de0: 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); 11de2: fd e5 ldi r31, 0x5D ; 93 11de4: 8f 2e mov r8, r31 11de6: f6 e6 ldi r31, 0x66 ; 102 11de8: 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++) 11dea: c8 01 movw r24, r16 11dec: 02 97 sbiw r24, 0x02 ; 2 11dee: 05 97 sbiw r24, 0x05 ; 5 11df0: 0c f0 brlt .+2 ; 0x11df4 11df2: d4 c0 rjmp .+424 ; 0x11f9c { float temp = (40 + i * 5); 11df4: b1 01 movw r22, r2 11df6: 63 5d subi r22, 0xD3 ; 211 11df8: 7f 4f sbci r23, 0xFF ; 255 11dfa: 07 2e mov r0, r23 11dfc: 00 0c add r0, r0 11dfe: 88 0b sbc r24, r24 11e00: 99 0b sbc r25, r25 11e02: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 11e06: 6b 01 movw r12, r22 11e08: 7c 01 movw r14, r24 printf_P(_N("\nStep: %d/6\n"), i + 2); 11e0a: 1f 93 push r17 11e0c: 0f 93 push r16 11e0e: a9 e8 ldi r26, 0x89 ; 137 11e10: b6 e6 ldi r27, 0x66 ; 102 11e12: bf 93 push r27 11e14: af 93 push r26 11e16: 0f 94 5d 9f call 0x33eba ; 0x33eba custom_message_state = i + 2; 11e1a: 00 93 ac 03 sts 0x03AC, r16 ; 0x8003ac setTargetBed(50 + 10 * (temp - 30) / 5); 11e1e: 20 e0 ldi r18, 0x00 ; 0 11e20: 30 e0 ldi r19, 0x00 ; 0 11e22: 40 ef ldi r20, 0xF0 ; 240 11e24: 51 e4 ldi r21, 0x41 ; 65 11e26: c7 01 movw r24, r14 11e28: b6 01 movw r22, r12 11e2a: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 11e2e: 20 e0 ldi r18, 0x00 ; 0 11e30: 30 e0 ldi r19, 0x00 ; 0 11e32: 40 e2 ldi r20, 0x20 ; 32 11e34: 51 e4 ldi r21, 0x41 ; 65 11e36: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 11e3a: 20 e0 ldi r18, 0x00 ; 0 11e3c: 30 e0 ldi r19, 0x00 ; 0 11e3e: 40 ea ldi r20, 0xA0 ; 160 11e40: 50 e4 ldi r21, 0x40 ; 64 11e42: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 11e46: 20 e0 ldi r18, 0x00 ; 0 11e48: 30 e0 ldi r19, 0x00 ; 0 11e4a: 48 e4 ldi r20, 0x48 ; 72 11e4c: 52 e4 ldi r21, 0x42 ; 66 11e4e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 11e52: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 11e56: 70 93 ee 11 sts 0x11EE, r23 ; 0x8011ee 11e5a: 60 93 ed 11 sts 0x11ED, r22 ; 0x8011ed current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 11e5e: 80 e0 ldi r24, 0x00 ; 0 11e60: 90 e0 ldi r25, 0x00 ; 0 11e62: a0 ea ldi r26, 0xA0 ; 160 11e64: b0 e4 ldi r27, 0x40 ; 64 11e66: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 11e6a: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 11e6e: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11e72: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11e76: 60 e0 ldi r22, 0x00 ; 0 11e78: 70 e0 ldi r23, 0x00 ; 0 11e7a: 88 e4 ldi r24, 0x48 ; 72 11e7c: 92 e4 ldi r25, 0x42 ; 66 11e7e: 0f 94 2f 85 call 0x30a5e ; 0x30a5e current_position[X_AXIS] = PINDA_PREHEAT_X; 11e82: 20 e0 ldi r18, 0x00 ; 0 11e84: 30 e0 ldi r19, 0x00 ; 0 11e86: 40 ea ldi r20, 0xA0 ; 160 11e88: 51 e4 ldi r21, 0x41 ; 65 11e8a: 20 93 f5 11 sts 0x11F5, r18 ; 0x8011f5 11e8e: 30 93 f6 11 sts 0x11F6, r19 ; 0x8011f6 11e92: 40 93 f7 11 sts 0x11F7, r20 ; 0x8011f7 11e96: 50 93 f8 11 sts 0x11F8, r21 ; 0x8011f8 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 11e9a: 80 e0 ldi r24, 0x00 ; 0 11e9c: 90 e0 ldi r25, 0x00 ; 0 11e9e: a0 e7 ldi r26, 0x70 ; 112 11ea0: b2 e4 ldi r27, 0x42 ; 66 11ea2: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 11ea6: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 11eaa: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 11eae: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(3000 / 60); 11eb2: 60 e0 ldi r22, 0x00 ; 0 11eb4: 70 e0 ldi r23, 0x00 ; 0 11eb6: 88 e4 ldi r24, 0x48 ; 72 11eb8: 92 e4 ldi r25, 0x42 ; 66 11eba: 0f 94 2f 85 call 0x30a5e ; 0x30a5e current_position[Z_AXIS] = PINDA_PREHEAT_Z; 11ebe: 40 92 fd 11 sts 0x11FD, r4 ; 0x8011fd 11ec2: 50 92 fe 11 sts 0x11FE, r5 ; 0x8011fe 11ec6: 60 92 ff 11 sts 0x11FF, r6 ; 0x8011ff 11eca: 70 92 00 12 sts 0x1200, r7 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11ece: 60 e0 ldi r22, 0x00 ; 0 11ed0: 70 e0 ldi r23, 0x00 ; 0 11ed2: 88 e4 ldi r24, 0x48 ; 72 11ed4: 92 e4 ldi r25, 0x42 ; 66 11ed6: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 11eda: 0f 94 ce 22 call 0x2459c ; 0x2459c 11ede: 0f 90 pop r0 11ee0: 0f 90 pop r0 11ee2: 0f 90 pop r0 11ee4: 0f 90 pop r0 while (current_temperature_pinda < temp) 11ee6: 20 91 8e 06 lds r18, 0x068E ; 0x80068e 11eea: 30 91 8f 06 lds r19, 0x068F ; 0x80068f 11eee: 40 91 90 06 lds r20, 0x0690 ; 0x800690 11ef2: 50 91 91 06 lds r21, 0x0691 ; 0x800691 11ef6: c7 01 movw r24, r14 11ef8: b6 01 movw r22, r12 11efa: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 11efe: 18 16 cp r1, r24 11f00: 3c f4 brge .+14 ; 0x11f10 { delay_keep_alive(1000); 11f02: 88 ee ldi r24, 0xE8 ; 232 11f04: 93 e0 ldi r25, 0x03 ; 3 11f06: 0e 94 45 7c call 0xf88a ; 0xf88a serialecho_temperatures(); 11f0a: 0e 94 5e 70 call 0xe0bc ; 0xe0bc 11f0e: eb cf rjmp .-42 ; 0x11ee6 } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 11f10: 80 e0 ldi r24, 0x00 ; 0 11f12: 90 e0 ldi r25, 0x00 ; 0 11f14: a0 ea ldi r26, 0xA0 ; 160 11f16: b0 e4 ldi r27, 0x40 ; 64 11f18: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 11f1c: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 11f20: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 11f24: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(3000 / 60); 11f28: 60 e0 ldi r22, 0x00 ; 0 11f2a: 70 e0 ldi r23, 0x00 ; 0 11f2c: 88 e4 ldi r24, 0x48 ; 72 11f2e: 92 e4 ldi r25, 0x42 ; 66 11f30: 0f 94 2f 85 call 0x30a5e ; 0x30a5e current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 11f34: ec e4 ldi r30, 0x4C ; 76 11f36: f8 e8 ldi r31, 0x88 ; 136 11f38: 85 91 lpm r24, Z+ 11f3a: 95 91 lpm r25, Z+ 11f3c: a5 91 lpm r26, Z+ 11f3e: b4 91 lpm r27, Z 11f40: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 11f44: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 11f48: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 11f4c: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 11f50: e0 e5 ldi r30, 0x50 ; 80 11f52: f8 e8 ldi r31, 0x88 ; 136 11f54: 85 91 lpm r24, Z+ 11f56: 95 91 lpm r25, Z+ 11f58: a5 91 lpm r26, Z+ 11f5a: b4 91 lpm r27, Z 11f5c: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 11f60: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 11f64: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 11f68: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(3000 / 60); 11f6c: 60 e0 ldi r22, 0x00 ; 0 11f6e: 70 e0 ldi r23, 0x00 ; 0 11f70: 88 e4 ldi r24, 0x48 ; 72 11f72: 92 e4 ldi r25, 0x42 ; 66 11f74: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 11f78: 0f 94 ce 22 call 0x2459c ; 0x2459c find_z_result = find_bed_induction_sensor_point_z(-1.f); 11f7c: 43 e0 ldi r20, 0x03 ; 3 11f7e: 60 e0 ldi r22, 0x00 ; 0 11f80: 70 e0 ldi r23, 0x00 ; 0 11f82: 80 e8 ldi r24, 0x80 ; 128 11f84: 9f eb ldi r25, 0xBF ; 191 11f86: 0f 94 ba 56 call 0x2ad74 ; 0x2ad74 11f8a: 95 e0 ldi r25, 0x05 ; 5 11f8c: 29 0e add r2, r25 11f8e: 31 1c adc r3, r1 11f90: 0f 5f subi r16, 0xFF ; 255 11f92: 1f 4f sbci r17, 0xFF ; 255 if (find_z_result == false) { 11f94: 81 11 cpse r24, r1 11f96: 04 c0 rjmp .+8 ; 0x11fa0 lcd_temp_cal_show_result(find_z_result); 11f98: 0f 94 3a 0c call 0x21874 ; 0x21874 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); 11f9c: 81 e0 ldi r24, 0x01 ; 1 11f9e: a7 ce rjmp .-690 ; 0x11cee 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]); 11fa0: 78 a5 ldd r23, Y+40 ; 0x28 11fa2: 6c a5 ldd r22, Y+44 ; 0x2c 11fa4: 98 a9 ldd r25, Y+48 ; 0x30 11fa6: 88 ad ldd r24, Y+56 ; 0x38 11fa8: 27 2f mov r18, r23 11faa: 36 2f mov r19, r22 11fac: 49 2f mov r20, r25 11fae: 58 2f mov r21, r24 11fb0: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 11fb4: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 11fb8: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 11fbc: 90 91 00 12 lds r25, 0x1200 ; 0x801200 11fc0: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 11fc4: f6 2e mov r15, r22 11fc6: e7 2e mov r14, r23 11fc8: d8 2e mov r13, r24 11fca: c9 2e mov r12, r25 11fcc: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 11fd0: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 11fd4: 40 91 40 04 lds r20, 0x0440 ; 0x800440 11fd8: 50 91 41 04 lds r21, 0x0441 ; 0x800441 11fdc: d7 01 movw r26, r14 11fde: f6 01 movw r30, r12 11fe0: 6b 2f mov r22, r27 11fe2: 7a 2f mov r23, r26 11fe4: 8f 2f mov r24, r31 11fe6: 9e 2f mov r25, r30 11fe8: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 11fec: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 11ff0: 6c ab std Y+52, r22 ; 0x34 11ff2: 7d ab std Y+53, r23 ; 0x35 11ff4: 8e ab std Y+54, r24 ; 0x36 11ff6: 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); 11ff8: cf 92 push r12 11ffa: df 92 push r13 11ffc: ef 92 push r14 11ffe: ff 92 push r15 12000: 80 91 91 06 lds r24, 0x0691 ; 0x800691 12004: 8f 93 push r24 12006: 80 91 90 06 lds r24, 0x0690 ; 0x800690 1200a: 8f 93 push r24 1200c: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 12010: 8f 93 push r24 12012: 80 91 8e 06 lds r24, 0x068E ; 0x80068e 12016: 8f 93 push r24 12018: 9f 92 push r9 1201a: 8f 92 push r8 1201c: 0f 94 5d 9f call 0x33eba ; 0x33eba 12020: 6c a9 ldd r22, Y+52 ; 0x34 12022: 7d a9 ldd r23, Y+53 ; 0x35 12024: c5 01 movw r24, r10 12026: 0f 94 dd a0 call 0x341ba ; 0x341ba 1202a: a2 e0 ldi r26, 0x02 ; 2 1202c: aa 0e add r10, r26 1202e: b1 1c adc r11, r1 12030: 0f b6 in r0, 0x3f ; 63 12032: f8 94 cli 12034: de bf out 0x3e, r29 ; 62 12036: 0f be out 0x3f, r0 ; 63 12038: cd bf out 0x3d, r28 ; 61 1203a: d7 ce rjmp .-594 ; 0x11dea /*! ### 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(); 1203c: 0e 94 2d 73 call 0xe65a ; 0xe65a 12040: 0c 94 6b 87 jmp 0x10ed6 ; 0x10ed6 This G-code will be performed at the start of a calibration script. (Prusa3D specific) */ case 86: calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 12044: 80 e1 ldi r24, 0x10 ; 16 12046: 0e 94 2e c6 call 0x18c5c ; 0x18c5c 1204a: 0c 94 6b 87 jmp 0x10ed6 ; 0x10ed6 /*! ### 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); 1204e: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb 12052: 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; 12054: 80 93 eb 11 sts 0x11EB, r24 ; 0x8011eb 12058: 0c 94 6b 87 jmp 0x10ed6 ; 0x10ed6 1205c: 54 ec ldi r21, 0xC4 ; 196 1205e: c5 2e mov r12, r21 12060: 52 e0 ldi r21, 0x02 ; 2 12062: d5 2e mov r13, r21 12064: 8e 01 movw r16, r28 12066: 0c 5d subi r16, 0xDC ; 220 12068: 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) 1206a: 58 01 movw r10, r16 1206c: ee 24 eor r14, r14 1206e: e3 94 inc r14 12070: 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]); 12072: d6 01 movw r26, r12 12074: 8d 91 ld r24, X+ 12076: 6d 01 movw r12, r26 12078: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1207c: f5 01 movw r30, r10 1207e: 81 93 st Z+, r24 12080: 5f 01 movw r10, r30 if(codes[i]) 12082: 88 23 and r24, r24 12084: 91 f0 breq .+36 ; 0x120aa values[i] = code_value(); 12086: 0e 94 03 5a call 0xb406 ; 0xb406 1208a: f7 01 movw r30, r14 1208c: ee 0f add r30, r30 1208e: ff 1f adc r31, r31 12090: ee 0f add r30, r30 12092: ff 1f adc r31, r31 12094: 34 97 sbiw r30, 0x04 ; 4 12096: 21 e0 ldi r18, 0x01 ; 1 12098: 30 e0 ldi r19, 0x00 ; 0 1209a: 2c 0f add r18, r28 1209c: 3d 1f adc r19, r29 1209e: e2 0f add r30, r18 120a0: f3 1f adc r31, r19 120a2: 60 83 st Z, r22 120a4: 71 83 std Z+1, r23 ; 0x01 120a6: 82 83 std Z+2, r24 ; 0x02 120a8: 93 83 std Z+3, r25 ; 0x03 120aa: 3f ef ldi r19, 0xFF ; 255 120ac: e3 1a sub r14, r19 120ae: 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) 120b0: 45 e0 ldi r20, 0x05 ; 5 120b2: e4 16 cp r14, r20 120b4: f1 04 cpc r15, r1 120b6: e9 f6 brne .-70 ; 0x12072 codes[i] = code_seen(axis_codes[i]); if(codes[i]) values[i] = code_value(); } if((codes[E_AXIS] && values[E_AXIS] == 0) && 120b8: 9f a0 ldd r9, Y+39 ; 0x27 120ba: fc a0 ldd r15, Y+36 ; 0x24 120bc: 99 20 and r9, r9 120be: 01 f1 breq .+64 ; 0x12100 120c0: 20 e0 ldi r18, 0x00 ; 0 120c2: 30 e0 ldi r19, 0x00 ; 0 120c4: a9 01 movw r20, r18 120c6: 6d 85 ldd r22, Y+13 ; 0x0d 120c8: 7e 85 ldd r23, Y+14 ; 0x0e 120ca: 8f 85 ldd r24, Y+15 ; 0x0f 120cc: 98 89 ldd r25, Y+16 ; 0x10 120ce: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 120d2: 81 11 cpse r24, r1 120d4: 15 c0 rjmp .+42 ; 0x12100 120d6: f1 10 cpse r15, r1 120d8: 13 c0 rjmp .+38 ; 0x12100 (!codes[X_AXIS] && !codes[Y_AXIS] && !codes[Z_AXIS])) 120da: 8d a1 ldd r24, Y+37 ; 0x25 120dc: 81 11 cpse r24, r1 120de: 10 c0 rjmp .+32 ; 0x12100 120e0: 8e a1 ldd r24, Y+38 ; 0x26 120e2: 81 11 cpse r24, r1 120e4: 0d c0 rjmp .+26 ; 0x12100 { // 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; 120e6: 10 92 01 12 sts 0x1201, r1 ; 0x801201 120ea: 10 92 02 12 sts 0x1202, r1 ; 0x801202 120ee: 10 92 03 12 sts 0x1203, r1 ; 0x801203 120f2: 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; 120f6: 81 e0 ldi r24, 0x01 ; 1 120f8: 80 93 ef 03 sts 0x03EF, r24 ; 0x8003ef <_ZL23plan_reset_next_e_queue.lto_priv.448> 120fc: 0c 94 6b 87 jmp 0x10ed6 ; 0x10ed6 plan_reset_next_e(); } else { // In any other case we're forced to synchronize st_synchronize(); 12100: 0f 94 ce 22 call 0x2459c ; 0x2459c 12104: ce 01 movw r24, r28 12106: 01 96 adiw r24, 0x01 ; 1 12108: 5c 01 movw r10, r24 1210a: 2a e8 ldi r18, 0x8A ; 138 1210c: c2 2e mov r12, r18 1210e: 24 e0 ldi r18, 0x04 ; 4 12110: d2 2e mov r13, r18 12112: 35 ef ldi r19, 0xF5 ; 245 12114: e3 2e mov r14, r19 12116: 31 e1 ldi r19, 0x11 ; 17 12118: f3 2e mov r15, r19 1211a: 38 01 movw r6, r16 1211c: 93 e0 ldi r25, 0x03 ; 3 1211e: 69 0e add r6, r25 12120: 71 1c adc r7, r1 for(uint8_t i = 0; i < 3; ++i) { if(codes[i]) 12122: d8 01 movw r26, r16 12124: 8d 91 ld r24, X+ 12126: 8d 01 movw r16, r26 12128: 88 23 and r24, r24 1212a: 89 f0 breq .+34 ; 0x1214e current_position[i] = values[i] + cs.add_homing[i]; 1212c: f6 01 movw r30, r12 1212e: 20 81 ld r18, Z 12130: 31 81 ldd r19, Z+1 ; 0x01 12132: 42 81 ldd r20, Z+2 ; 0x02 12134: 53 81 ldd r21, Z+3 ; 0x03 12136: d5 01 movw r26, r10 12138: 6d 91 ld r22, X+ 1213a: 7d 91 ld r23, X+ 1213c: 8d 91 ld r24, X+ 1213e: 9c 91 ld r25, X 12140: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 12144: f7 01 movw r30, r14 12146: 60 83 st Z, r22 12148: 71 83 std Z+1, r23 ; 0x01 1214a: 82 83 std Z+2, r24 ; 0x02 1214c: 93 83 std Z+3, r25 ; 0x03 1214e: f4 e0 ldi r31, 0x04 ; 4 12150: af 0e add r10, r31 12152: b1 1c adc r11, r1 12154: 24 e0 ldi r18, 0x04 ; 4 12156: c2 0e add r12, r18 12158: d1 1c adc r13, r1 1215a: 34 e0 ldi r19, 0x04 ; 4 1215c: e3 0e add r14, r19 1215e: 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) 12160: 60 16 cp r6, r16 12162: 71 06 cpc r7, r17 12164: f1 f6 brne .-68 ; 0x12122 { if(codes[i]) current_position[i] = values[i] + cs.add_homing[i]; } if(codes[E_AXIS]) 12166: 99 20 and r9, r9 12168: 61 f0 breq .+24 ; 0x12182 current_position[E_AXIS] = values[E_AXIS]; 1216a: 8d 85 ldd r24, Y+13 ; 0x0d 1216c: 9e 85 ldd r25, Y+14 ; 0x0e 1216e: af 85 ldd r26, Y+15 ; 0x0f 12170: b8 89 ldd r27, Y+16 ; 0x10 12172: 80 93 01 12 sts 0x1201, r24 ; 0x801201 12176: 90 93 02 12 sts 0x1202, r25 ; 0x801202 1217a: a0 93 03 12 sts 0x1203, r26 ; 0x801203 1217e: b0 93 04 12 sts 0x1204, r27 ; 0x801204 // Set all at once plan_set_position_curposXYZE(); 12182: 0f 94 ef 83 call 0x307de ; 0x307de 12186: 0c 94 6b 87 jmp 0x10ed6 ; 0x10ed6 return true; } void farm_gcode_g98() { farm_mode = 1; 1218a: 81 e0 ldi r24, 0x01 ; 1 1218c: 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); 12190: 61 e0 ldi r22, 0x01 ; 1 12192: 84 ec ldi r24, 0xC4 ; 196 12194: 9f e0 ldi r25, 0x0F ; 15 12196: 0f 94 bf a0 call 0x3417e ; 0x3417e eeprom_update_byte_notify((unsigned char *)EEPROM_FARM_MODE, farm_mode); SilentModeMenu = SILENT_MODE_OFF; 1219a: 10 92 89 03 sts 0x0389, r1 ; 0x800389 1219e: 60 e0 ldi r22, 0x00 ; 0 121a0: 8f ef ldi r24, 0xFF ; 255 121a2: 9f e0 ldi r25, 0x0F ; 15 121a4: 0f 94 bf a0 call 0x3417e ; 0x3417e } void farm_gcode_g99() { farm_disable(); lcd_update(2); fCheckModeInit(); // alternatively invoke printer reset 121a8: 0e 94 5f d8 call 0x1b0be ; 0x1b0be 121ac: 0c 94 6b 87 jmp 0x10ed6 ; 0x10ed6 /*! --------------------------------------------------------------------------------- # M Commands */ else if(*CMDBUFFER_CURRENT_STRING == 'M') 121b0: 8d 34 cpi r24, 0x4D ; 77 121b2: 11 f0 breq .+4 ; 0x121b8 121b4: 0c 94 2b af jmp 0x15e56 ; 0x15e56 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 121b8: 10 93 f6 16 sts 0x16F6, r17 ; 0x8016f6 121bc: 00 93 f5 16 sts 0x16F5, r16 ; 0x8016f5 121c0: f8 01 movw r30, r16 121c2: 31 96 adiw r30, 0x01 ; 1 int index; for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++); 121c4: 81 91 ld r24, Z+ 121c6: 80 32 cpi r24, 0x20 ; 32 121c8: e9 f3 breq .-6 ; 0x121c4 121ca: 89 30 cpi r24, 0x09 ; 9 121cc: d9 f3 breq .-10 ; 0x121c4 /*for (++strchr_pointer; *strchr_pointer == ' ' || *strchr_pointer == '\t'; ++strchr_pointer);*/ if (*(strchr_pointer+index) < '0' || *(strchr_pointer+index) > '9') { 121ce: 80 53 subi r24, 0x30 ; 48 121d0: 8a 30 cpi r24, 0x0A ; 10 121d2: 30 f0 brcs .+12 ; 0x121e0 printf_P(PSTR("Invalid M code: %s\n"), cmdbuffer + bufindr + CMDHDRSIZE); 121d4: 1f 93 push r17 121d6: 0f 93 push r16 121d8: 8e e5 ldi r24, 0x5E ; 94 121da: 90 e8 ldi r25, 0x80 ; 128 121dc: 0c 94 23 84 jmp 0x10846 ; 0x10846 } else { mcode_in_progress = code_value_short(); 121e0: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 121e4: 90 93 ab 0d sts 0x0DAB, r25 ; 0x800dab <_ZL17mcode_in_progress.lto_priv.493+0x1> 121e8: 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) 121ec: 8e 3b cpi r24, 0xBE ; 190 121ee: 91 05 cpc r25, r1 121f0: 11 f4 brne .+4 ; 0x121f6 121f2: 0c 94 16 9c jmp 0x1382c ; 0x1382c 121f6: 0c f0 brlt .+2 ; 0x121fa 121f8: 31 c3 rjmp .+1634 ; 0x1285c 121fa: 8c 34 cpi r24, 0x4C ; 76 121fc: 91 05 cpc r25, r1 121fe: 11 f4 brne .+4 ; 0x12204 12200: 0c 94 ff 9a jmp 0x135fe ; 0x135fe 12204: 0c f0 brlt .+2 ; 0x12208 12206: df c1 rjmp .+958 ; 0x125c6 12208: 8c 31 cpi r24, 0x1C ; 28 1220a: 91 05 cpc r25, r1 1220c: 11 f4 brne .+4 ; 0x12212 1220e: 0c 94 36 99 jmp 0x1326c ; 0x1326c 12212: 0c f0 brlt .+2 ; 0x12216 12214: f4 c0 rjmp .+488 ; 0x123fe 12216: 85 31 cpi r24, 0x15 ; 21 12218: 91 05 cpc r25, r1 1221a: 09 f4 brne .+2 ; 0x1221e 1221c: 40 c7 rjmp .+3712 ; 0x1309e 1221e: 0c f0 brlt .+2 ; 0x12222 12220: 5a c0 rjmp .+180 ; 0x122d6 12222: 81 31 cpi r24, 0x11 ; 17 12224: 91 05 cpc r25, r1 12226: 09 f4 brne .+2 ; 0x1222a 12228: 2f c7 rjmp .+3678 ; 0x13088 1222a: dc f4 brge .+54 ; 0x12262 1222c: 02 97 sbiw r24, 0x02 ; 2 1222e: 08 f4 brcc .+2 ; 0x12232 12230: 93 c6 rjmp .+3366 ; 0x12f58 /*! #### End of M-Commands */ default: printf_P(MSG_UNKNOWN_CODE, 'M', cmdbuffer + bufindr + CMDHDRSIZE); 12232: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 12236: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 1223a: 8f 51 subi r24, 0x1F ; 31 1223c: 90 4f sbci r25, 0xF0 ; 240 1223e: 9f 93 push r25 12240: 8f 93 push r24 12242: 1f 92 push r1 12244: 8d e4 ldi r24, 0x4D ; 77 12246: 8f 93 push r24 12248: 88 e4 ldi r24, 0x48 ; 72 1224a: 96 e6 ldi r25, 0x66 ; 102 1224c: 9f 93 push r25 1224e: 8f 93 push r24 12250: 0f 94 5d 9f call 0x33eba ; 0x33eba 12254: 0f 90 pop r0 12256: 0f 90 pop r0 12258: 0f 90 pop r0 1225a: 0f 90 pop r0 1225c: 0f 90 pop r0 1225e: 0f 90 pop r0 12260: de c6 rjmp .+3516 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12262: 82 31 cpi r24, 0x12 ; 18 12264: 91 05 cpc r25, r1 12266: 11 f4 brne .+4 ; 0x1226c 12268: 0c 94 c1 9c jmp 0x13982 ; 0x13982 1226c: 44 97 sbiw r24, 0x14 ; 20 1226e: 09 f7 brne .-62 ; 0x12232 #### 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() 12270: 81 e0 ldi r24, 0x01 ; 1 12272: 80 93 78 02 sts 0x0278, r24 ; 0x800278 SERIAL_PROTOCOLLNRPGM(_N("Begin file list"));////MSG_BEGIN_FILE_LIST 12276: 88 e3 ldi r24, 0x38 ; 56 12278: 96 e6 ldi r25, 0x66 ; 102 1227a: 0e 94 49 72 call 0xe492 ; 0xe492 card.ls(CardReader::ls_param(code_seen('L'), code_seen('T'))); 1227e: 84 e5 ldi r24, 0x54 ; 84 12280: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12284: 18 2f mov r17, r24 12286: 8c e4 ldi r24, 0x4C ; 76 12288: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1228c: 00 e0 ldi r16, 0x00 ; 0 1228e: 80 fb bst r24, 0 12290: 00 f9 bld r16, 0 12292: 10 fb bst r17, 0 12294: 01 f9 bld r16, 1 } // while readDir } void CardReader::ls(ls_param params) { root.rewind(); 12296: 80 ef ldi r24, 0xF0 ; 240 12298: 93 e1 ldi r25, 0x13 ; 19 1229a: 0e 94 2c 70 call 0xe058 ; 0xe058 lsDive("",root, NULL, LS_SerialPrint, params); 1229e: 83 e2 ldi r24, 0x23 ; 35 122a0: e0 ef ldi r30, 0xF0 ; 240 122a2: f3 e1 ldi r31, 0x13 ; 19 122a4: de 01 movw r26, r28 122a6: 11 96 adiw r26, 0x01 ; 1 122a8: 01 90 ld r0, Z+ 122aa: 0d 92 st X+, r0 122ac: 8a 95 dec r24 122ae: e1 f7 brne .-8 ; 0x122a8 122b0: 20 e0 ldi r18, 0x00 ; 0 122b2: 50 e0 ldi r21, 0x00 ; 0 122b4: 40 e0 ldi r20, 0x00 ; 0 122b6: be 01 movw r22, r28 122b8: 6f 5f subi r22, 0xFF ; 255 122ba: 7f 4f sbci r23, 0xFF ; 255 122bc: 8a ed ldi r24, 0xDA ; 218 122be: 92 e0 ldi r25, 0x02 ; 2 122c0: 0f 94 28 46 call 0x28c50 ; 0x28c50 122c4: ce 01 movw r24, r28 122c6: 01 96 adiw r24, 0x01 ; 1 122c8: 0e 94 31 70 call 0xe062 ; 0xe062 SERIAL_PROTOCOLLNRPGM(_N("End file list"));////MSG_END_FILE_LIST 122cc: 8a e2 ldi r24, 0x2A ; 42 122ce: 96 e6 ldi r25, 0x66 ; 102 122d0: 0e 94 49 72 call 0xe492 ; 0xe492 122d4: a4 c6 rjmp .+3400 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 122d6: 88 31 cpi r24, 0x18 ; 24 122d8: 91 05 cpc r25, r1 122da: 09 f4 brne .+2 ; 0x122de 122dc: f1 c6 rjmp .+3554 ; 0x130c0 122de: 84 f4 brge .+32 ; 0x12300 122e0: 86 31 cpi r24, 0x16 ; 22 122e2: 91 05 cpc r25, r1 122e4: 09 f4 brne .+2 ; 0x122e8 122e6: df c6 rjmp .+3518 ; 0x130a6 122e8: 47 97 sbiw r24, 0x17 ; 23 122ea: 09 f0 breq .+2 ; 0x122ee 122ec: a2 cf rjmp .-188 ; 0x12232 M23 [filename] */ case 23: card.openFileReadFilteredGcode(strchr_pointer + 4, true); 122ee: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 122f2: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 122f6: 61 e0 ldi r22, 0x01 ; 1 122f8: 04 96 adiw r24, 0x04 ; 4 122fa: 0f 94 c5 4c call 0x2998a ; 0x2998a 122fe: 8f c6 rjmp .+3358 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12300: 8a 31 cpi r24, 0x1A ; 26 12302: 91 05 cpc r25, r1 12304: 09 f4 brne .+2 ; 0x12308 12306: 22 c7 rjmp .+3652 ; 0x1314c 12308: 0c f0 brlt .+2 ; 0x1230c 1230a: 42 c7 rjmp .+3716 ; 0x13190 1230c: 04 ec ldi r16, 0xC4 ; 196 1230e: 12 e0 ldi r17, 0x02 ; 2 12310: f2 e4 ldi r31, 0x42 ; 66 12312: af 2e mov r10, r31 12314: f2 e0 ldi r31, 0x02 ; 2 12316: bf 2e mov r11, r31 12318: a4 e2 ldi r26, 0x24 ; 36 1231a: ca 2e mov r12, r26 1231c: a2 e0 ldi r26, 0x02 ; 2 1231e: da 2e mov r13, r26 12320: b8 e1 ldi r27, 0x18 ; 24 12322: eb 2e mov r14, r27 12324: b2 e0 ldi r27, 0x02 ; 2 12326: fb 2e mov r15, r27 12328: 87 ec ldi r24, 0xC7 ; 199 1232a: 88 2e mov r8, r24 1232c: 82 e0 ldi r24, 0x02 ; 2 1232e: 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])) { 12330: f8 01 movw r30, r16 12332: 81 91 ld r24, Z+ 12334: 8f 01 movw r16, r30 12336: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1233a: 88 23 and r24, r24 1233c: 21 f1 breq .+72 ; 0x12386 //Check that the positions are within hardware limits pause_position[axis] = constrain(code_value(), min_pos[axis], max_pos[axis]); 1233e: 0e 94 03 5a call 0xb406 ; 0xb406 12342: d6 01 movw r26, r12 12344: 4d 90 ld r4, X+ 12346: 5d 90 ld r5, X+ 12348: 6d 90 ld r6, X+ 1234a: 7c 90 ld r7, X 1234c: a3 01 movw r20, r6 1234e: 92 01 movw r18, r4 12350: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 12354: 87 fd sbrc r24, 7 12356: 11 c0 rjmp .+34 ; 0x1237a 12358: 0e 94 03 5a call 0xb406 ; 0xb406 1235c: f7 01 movw r30, r14 1235e: 40 80 ld r4, Z 12360: 51 80 ldd r5, Z+1 ; 0x01 12362: 62 80 ldd r6, Z+2 ; 0x02 12364: 73 80 ldd r7, Z+3 ; 0x03 12366: a3 01 movw r20, r6 12368: 92 01 movw r18, r4 1236a: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 1236e: 18 16 cp r1, r24 12370: 24 f0 brlt .+8 ; 0x1237a 12372: 0e 94 03 5a call 0xb406 ; 0xb406 12376: 2b 01 movw r4, r22 12378: 3c 01 movw r6, r24 1237a: d5 01 movw r26, r10 1237c: 4d 92 st X+, r4 1237e: 5d 92 st X+, r5 12380: 6d 92 st X+, r6 12382: 7c 92 st X, r7 12384: 13 97 sbiw r26, 0x03 ; 3 12386: b4 e0 ldi r27, 0x04 ; 4 12388: ab 0e add r10, r27 1238a: b1 1c adc r11, r1 1238c: e4 e0 ldi r30, 0x04 ; 4 1238e: ce 0e add r12, r30 12390: d1 1c adc r13, r1 12392: f4 e0 ldi r31, 0x04 ; 4 12394: ef 0e add r14, r31 12396: 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++) { 12398: 80 16 cp r8, r16 1239a: 91 06 cpc r9, r17 1239c: 49 f6 brne .-110 ; 0x12330 //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')) { 1239e: 83 e5 ldi r24, 0x53 ; 83 123a0: 0e 94 2b 55 call 0xaa56 ; 0xaa56 123a4: 88 23 and r24, r24 123a6: 11 f4 brne .+4 ; 0x123ac 123a8: 0c 94 01 a9 jmp 0x15202 ; 0x15202 if ( code_value_uint8() == 0 ) { 123ac: 0e 94 40 55 call 0xaa80 ; 0xaa80 123b0: 81 11 cpse r24, r1 123b2: 35 c6 rjmp .+3178 ; 0x1301e pause_position[X_AXIS] = X_PAUSE_POS; 123b4: 80 e0 ldi r24, 0x00 ; 0 123b6: 90 e0 ldi r25, 0x00 ; 0 123b8: a8 e4 ldi r26, 0x48 ; 72 123ba: b2 e4 ldi r27, 0x42 ; 66 123bc: 80 93 42 02 sts 0x0242, r24 ; 0x800242 <_ZL14pause_position.lto_priv.495> 123c0: 90 93 43 02 sts 0x0243, r25 ; 0x800243 <_ZL14pause_position.lto_priv.495+0x1> 123c4: a0 93 44 02 sts 0x0244, r26 ; 0x800244 <_ZL14pause_position.lto_priv.495+0x2> 123c8: b0 93 45 02 sts 0x0245, r27 ; 0x800245 <_ZL14pause_position.lto_priv.495+0x3> pause_position[Y_AXIS] = Y_PAUSE_POS; 123cc: 80 e0 ldi r24, 0x00 ; 0 123ce: 90 e0 ldi r25, 0x00 ; 0 123d0: ae e3 ldi r26, 0x3E ; 62 123d2: b3 e4 ldi r27, 0x43 ; 67 123d4: 80 93 46 02 sts 0x0246, r24 ; 0x800246 <_ZL14pause_position.lto_priv.495+0x4> 123d8: 90 93 47 02 sts 0x0247, r25 ; 0x800247 <_ZL14pause_position.lto_priv.495+0x5> 123dc: a0 93 48 02 sts 0x0248, r26 ; 0x800248 <_ZL14pause_position.lto_priv.495+0x6> 123e0: b0 93 49 02 sts 0x0249, r27 ; 0x800249 <_ZL14pause_position.lto_priv.495+0x7> pause_position[Z_AXIS] = Z_PAUSE_LIFT; 123e4: 80 e0 ldi r24, 0x00 ; 0 123e6: 90 e0 ldi r25, 0x00 ; 0 123e8: a0 ea ldi r26, 0xA0 ; 160 123ea: b1 e4 ldi r27, 0x41 ; 65 123ec: 80 93 4a 02 sts 0x024A, r24 ; 0x80024a <_ZL14pause_position.lto_priv.495+0x8> 123f0: 90 93 4b 02 sts 0x024B, r25 ; 0x80024b <_ZL14pause_position.lto_priv.495+0x9> 123f4: a0 93 4c 02 sts 0x024C, r26 ; 0x80024c <_ZL14pause_position.lto_priv.495+0xa> 123f8: b0 93 4d 02 sts 0x024D, r27 ; 0x80024d <_ZL14pause_position.lto_priv.495+0xb> 123fc: 10 c6 rjmp .+3104 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 123fe: 8c 32 cpi r24, 0x2C ; 44 12400: 91 05 cpc r25, r1 12402: 11 f4 brne .+4 ; 0x12408 12404: 0c 94 07 9a jmp 0x1340e ; 0x1340e 12408: 0c f0 brlt .+2 ; 0x1240c 1240a: 8f c0 rjmp .+286 ; 0x1252a 1240c: 8f 31 cpi r24, 0x1F ; 31 1240e: 91 05 cpc r25, r1 12410: 09 f4 brne .+2 ; 0x12414 12412: d3 c7 rjmp .+4006 ; 0x133ba 12414: 0c f0 brlt .+2 ; 0x12418 12416: 52 c0 rjmp .+164 ; 0x124bc 12418: 8d 31 cpi r24, 0x1D ; 29 1241a: 91 05 cpc r25, r1 1241c: 09 f4 brne .+2 ; 0x12420 1241e: ff c5 rjmp .+3070 ; 0x1301e 12420: 4e 97 sbiw r24, 0x1e ; 30 12422: 09 f0 breq .+2 ; 0x12426 12424: 06 cf rjmp .-500 ; 0x12232 M30 [filename] */ case 30: if (card.mounted){ 12426: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1242a: 88 23 and r24, r24 1242c: 09 f4 brne .+2 ; 0x12430 1242e: f7 c5 rjmp .+3054 ; 0x1301e card.closefile(); 12430: 0f 94 9c 42 call 0x28538 ; 0x28538 card.removeFile(strchr_pointer + 4); 12434: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 12438: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 1243c: 0c 5f subi r16, 0xFC ; 252 1243e: 1f 4f sbci r17, 0xFF ; 255 } } void CardReader::removeFile(const char* name) { if(!mounted) return; 12440: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 12444: 88 23 and r24, r24 12446: 09 f4 brne .+2 ; 0x1244a 12448: ea c5 rjmp .+3028 ; 0x1301e file.close(); 1244a: 8a ef ldi r24, 0xFA ; 250 1244c: 95 e1 ldi r25, 0x15 ; 21 1244e: 0f 94 51 6f call 0x2dea2 ; 0x2dea2 sdprinting = false; 12452: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a const char *fname=name; 12456: 1d a3 std Y+37, r17 ; 0x25 12458: 0c a3 std Y+36, r16 ; 0x24 if (!diveSubfolder(fname)) 1245a: ce 01 movw r24, r28 1245c: 84 96 adiw r24, 0x24 ; 36 1245e: 0f 94 40 4c call 0x29880 ; 0x29880 12462: 88 23 and r24, r24 12464: 09 f4 brne .+2 ; 0x12468 12466: db c5 rjmp .+2998 ; 0x1301e return; if (file.remove(curDir, fname)) 12468: 4c a1 ldd r20, Y+36 ; 0x24 1246a: 5d a1 ldd r21, Y+37 ; 0x25 1246c: 60 91 13 14 lds r22, 0x1413 ; 0x801413 12470: 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) {} 12474: 19 82 std Y+1, r1 ; 0x01 12476: 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; 12478: 22 e0 ldi r18, 0x02 ; 2 1247a: ce 01 movw r24, r28 1247c: 01 96 adiw r24, 0x01 ; 1 1247e: 0f 94 48 9a call 0x33490 ; 0x33490 12482: 81 11 cpse r24, r1 12484: fb c6 rjmp .+3574 ; 0x1327c return file.remove(); fail: // can't set iostate - static function return false; 12486: 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; 12488: ce 01 movw r24, r28 1248a: 01 96 adiw r24, 0x01 ; 1 1248c: 0e 94 31 70 call 0xe062 ; 0xe062 12490: 11 23 and r17, r17 12492: 09 f4 brne .+2 ; 0x12496 12494: 0a c7 rjmp .+3604 ; 0x132aa { SERIAL_PROTOCOLPGM("File deleted:"); 12496: 85 ee ldi r24, 0xE5 ; 229 12498: 9d e7 ldi r25, 0x7D ; 125 1249a: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_PROTOCOLLN(fname); 1249e: 8c a1 ldd r24, Y+36 ; 0x24 124a0: 9d a1 ldd r25, Y+37 ; 0x25 124a2: 0f 94 bc 99 call 0x33378 ; 0x33378 sdpos = 0; 124a6: 10 92 7e 16 sts 0x167E, r1 ; 0x80167e 124aa: 10 92 7f 16 sts 0x167F, r1 ; 0x80167f 124ae: 10 92 80 16 sts 0x1680, r1 ; 0x801680 124b2: 10 92 81 16 sts 0x1681, r1 ; 0x801681 #ifdef SDCARD_SORT_ALPHA presort(); 124b6: 0f 94 04 4a call 0x29408 ; 0x29408 124ba: b1 c5 rjmp .+2914 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 124bc: 80 32 cpi r24, 0x20 ; 32 124be: 91 05 cpc r25, r1 124c0: 09 f4 brne .+2 ; 0x124c4 124c2: 01 c7 rjmp .+3586 ; 0x132c6 124c4: 8a 97 sbiw r24, 0x2a ; 42 124c6: 09 f0 breq .+2 ; 0x124ca 124c8: b4 ce rjmp .-664 ; 0x12232 #### 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')) 124ca: 83 e5 ldi r24, 0x53 ; 83 124cc: 0e 94 2b 55 call 0xaa56 ; 0xaa56 124d0: 88 23 and r24, r24 124d2: 09 f4 brne .+2 ; 0x124d6 124d4: a4 c5 rjmp .+2888 ; 0x1301e { uint8_t pin_status = code_value_uint8(); 124d6: 0e 94 40 55 call 0xaa80 ; 0xaa80 124da: 08 2f mov r16, r24 int8_t pin_number = LED_PIN; if (code_seen('P')) 124dc: 80 e5 ldi r24, 0x50 ; 80 124de: 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; 124e2: 1d e0 ldi r17, 0x0D ; 13 if (code_seen('P')) 124e4: 88 23 and r24, r24 124e6: 19 f0 breq .+6 ; 0x124ee pin_number = code_value_uint8(); 124e8: 0e 94 40 55 call 0xaa80 ; 0xaa80 124ec: 18 2f mov r17, r24 124ee: e3 e3 ldi r30, 0x33 ; 51 124f0: 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) 124f2: 84 91 lpm r24, Z 124f4: 81 17 cp r24, r17 124f6: 09 f4 brne .+2 ; 0x124fa 124f8: 92 c5 rjmp .+2852 ; 0x1301e 124fa: 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++) 124fc: 30 e8 ldi r19, 0x80 ; 128 124fe: ef 34 cpi r30, 0x4F ; 79 12500: f3 07 cpc r31, r19 12502: b9 f7 brne .-18 ; 0x124f2 pin_number = -1; break; } } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) 12504: 16 30 cpi r17, 0x06 ; 6 12506: 09 f0 breq .+2 ; 0x1250a 12508: 7f c7 rjmp .+3838 ; 0x13408 fanSpeed = pin_status; 1250a: 00 93 e9 11 sts 0x11E9, r16 ; 0x8011e9 #endif if (pin_number > -1) { pinMode(pin_number, OUTPUT); 1250e: 61 e0 ldi r22, 0x01 ; 1 12510: 81 2f mov r24, r17 12512: 0e 94 3d c0 call 0x1807a ; 0x1807a digitalWrite(pin_number, pin_status); 12516: 60 2f mov r22, r16 12518: 81 2f mov r24, r17 1251a: 0e 94 0f c0 call 0x1801e ; 0x1801e analogWrite(pin_number, pin_status); 1251e: 60 2f mov r22, r16 12520: 70 e0 ldi r23, 0x00 ; 0 12522: 81 2f mov r24, r17 12524: 0e 94 6e c0 call 0x180dc ; 0x180dc 12528: 7a c5 rjmp .+2804 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1252a: 8f 32 cpi r24, 0x2F ; 47 1252c: 91 05 cpc r25, r1 1252e: 09 f4 brne .+2 ; 0x12532 12530: 97 c7 rjmp .+3886 ; 0x13460 12532: 5c f5 brge .+86 ; 0x1258a 12534: 8d 32 cpi r24, 0x2D ; 45 12536: 91 05 cpc r25, r1 12538: 09 f4 brne .+2 ; 0x1253c 1253a: 82 c7 rjmp .+3844 ; 0x13440 1253c: 8e 97 sbiw r24, 0x2e ; 46 1253e: 09 f0 breq .+2 ; 0x12542 12540: 78 ce rjmp .-784 ; 0x12232 ### 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()) { 12542: 80 91 db 15 lds r24, 0x15DB ; 0x8015db 12546: 88 23 and r24, r24 12548: 09 f4 brne .+2 ; 0x1254c 1254a: 85 c7 rjmp .+3850 ; 0x13456 uint8_t ip[4]; if (card.ToshibaFlashAir_GetIP(ip)) { 1254c: ce 01 movw r24, r28 1254e: 01 96 adiw r24, 0x01 ; 1 12550: 0f 94 49 53 call 0x2a692 ; 0x2a692 12554: 88 23 and r24, r24 12556: 09 f4 brne .+2 ; 0x1255a 12558: 79 c7 rjmp .+3826 ; 0x1344c } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 1255a: 89 81 ldd r24, Y+1 ; 0x01 1255c: 0e 94 37 70 call 0xe06e ; 0xe06e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 12560: 8e e2 ldi r24, 0x2E ; 46 12562: 0e 94 37 70 call 0xe06e ; 0xe06e } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 12566: 8a 81 ldd r24, Y+2 ; 0x02 12568: 0e 94 37 70 call 0xe06e ; 0xe06e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 1256c: 8e e2 ldi r24, 0x2E ; 46 1256e: 0e 94 37 70 call 0xe06e ; 0xe06e } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 12572: 8b 81 ldd r24, Y+3 ; 0x03 12574: 0e 94 37 70 call 0xe06e ; 0xe06e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 12578: 8e e2 ldi r24, 0x2E ; 46 1257a: 0e 94 37 70 call 0xe06e ; 0xe06e } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 1257e: 8c 81 ldd r24, Y+4 ; 0x04 12580: 0e 94 37 70 call 0xe06e ; 0xe06e } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 12584: 0f 94 bb 98 call 0x33176 ; 0x33176 12588: 4a c5 rjmp .+2708 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1258a: 89 34 cpi r24, 0x49 ; 73 1258c: 91 05 cpc r25, r1 1258e: 09 f4 brne .+2 ; 0x12592 12590: 90 c7 rjmp .+3872 ; 0x134b2 12592: 8b 34 cpi r24, 0x4B ; 75 12594: 91 05 cpc r25, r1 12596: 11 f4 brne .+4 ; 0x1259c 12598: 0c 94 f9 9a jmp 0x135f2 ; 0x135f2 1259c: 88 34 cpi r24, 0x48 ; 72 1259e: 91 05 cpc r25, r1 125a0: 09 f0 breq .+2 ; 0x125a4 125a2: 47 ce rjmp .-882 ; 0x12232 #### Parameters - `Snnn` - Set printer state 0 = not_ready, 1 = ready */ case 72: { if(code_seen('S')){ 125a4: 83 e5 ldi r24, 0x53 ; 83 125a6: 0e 94 2b 55 call 0xaa56 ; 0xaa56 125aa: 88 23 and r24, r24 125ac: 09 f4 brne .+2 ; 0x125b0 125ae: 72 c7 rjmp .+3812 ; 0x13494 switch (code_value_uint8()){ 125b0: 0e 94 40 55 call 0xaa80 ; 0xaa80 125b4: 88 23 and r24, r24 125b6: 09 f4 brne .+2 ; 0x125ba 125b8: 6a c7 rjmp .+3796 ; 0x1348e 125ba: 81 30 cpi r24, 0x01 ; 1 125bc: 09 f0 breq .+2 ; 0x125c0 125be: 2f c5 rjmp .+2654 ; 0x1301e 125c0: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.367> 125c4: 2c c5 rjmp .+2648 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 125c6: 8b 36 cpi r24, 0x6B ; 107 125c8: 91 05 cpc r25, r1 125ca: 11 f4 brne .+4 ; 0x125d0 125cc: 0c 94 b8 9c jmp 0x13970 ; 0x13970 125d0: 0c f0 brlt .+2 ; 0x125d4 125d2: ab c0 rjmp .+342 ; 0x1272a 125d4: 84 35 cpi r24, 0x54 ; 84 125d6: 91 05 cpc r25, r1 125d8: 11 f4 brne .+4 ; 0x125de 125da: 0c 94 c1 9c jmp 0x13982 ; 0x13982 125de: 0c f0 brlt .+2 ; 0x125e2 125e0: 5d c0 rjmp .+186 ; 0x1269c 125e2: 8f 34 cpi r24, 0x4F ; 79 125e4: 91 05 cpc r25, r1 125e6: 11 f4 brne .+4 ; 0x125ec 125e8: 0c 94 47 9b jmp 0x1368e ; 0x1368e 125ec: 0c f0 brlt .+2 ; 0x125f0 125ee: 47 c0 rjmp .+142 ; 0x1267e 125f0: 8d 34 cpi r24, 0x4D ; 77 125f2: 91 05 cpc r25, r1 125f4: 11 f4 brne .+4 ; 0x125fa 125f6: 0c 94 12 9b jmp 0x13624 ; 0x13624 125fa: 8e 34 cpi r24, 0x4E ; 78 125fc: 91 05 cpc r25, r1 125fe: 09 f0 breq .+2 ; 0x12602 12600: 18 ce rjmp .-976 ; 0x12232 const char *_m_fil; const char *_m_time; uint32_t _cm = 0; uint32_t _min = 0; if (printJobOngoing()) { 12602: 0e 94 be 60 call 0xc17c ; 0xc17c 12606: 88 23 and r24, r24 12608: 11 f4 brne .+4 ; 0x1260e 1260a: 0c 94 17 9b jmp 0x1362e ; 0x1362e _m_fil = _O(MSG_FILAMENT_USED); _m_time = _O(MSG_PRINT_TIME); _cm = (uint32_t)total_filament_used / 1000; 1260e: 60 91 84 06 lds r22, 0x0684 ; 0x800684 12612: 70 91 85 06 lds r23, 0x0685 ; 0x800685 12616: 80 91 86 06 lds r24, 0x0686 ; 0x800686 1261a: 90 91 87 06 lds r25, 0x0687 ; 0x800687 1261e: 28 ee ldi r18, 0xE8 ; 232 12620: 33 e0 ldi r19, 0x03 ; 3 12622: 40 e0 ldi r20, 0x00 ; 0 12624: 50 e0 ldi r21, 0x00 ; 0 12626: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> 1262a: 12 2f mov r17, r18 1262c: 03 2f mov r16, r19 1262e: f4 2e mov r15, r20 12630: e5 2e mov r14, r21 _min = print_job_timer.duration() / 60; 12632: 0f 94 f2 1c call 0x239e4 ; 0x239e4 12636: 2c e3 ldi r18, 0x3C ; 60 12638: 30 e0 ldi r19, 0x00 ; 0 1263a: 40 e0 ldi r20, 0x00 ; 0 1263c: 50 e0 ldi r21, 0x00 ; 0 1263e: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> 12642: b9 01 movw r22, r18 12644: 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); 12646: 45 e1 ldi r20, 0x15 ; 21 12648: 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); 1264a: 25 e0 ldi r18, 0x05 ; 5 1264c: 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); 1264e: 9f 93 push r25 12650: 8f 93 push r24 12652: 7f 93 push r23 12654: 6f 93 push r22 12656: 5f 93 push r21 12658: 4f 93 push r20 1265a: ef 92 push r14 1265c: ff 92 push r15 1265e: 0f 93 push r16 12660: 1f 93 push r17 12662: 3f 93 push r19 12664: 2f 93 push r18 12666: 81 ea ldi r24, 0xA1 ; 161 12668: 95 e6 ldi r25, 0x65 ; 101 1266a: 9f 93 push r25 1266c: 8f 93 push r24 1266e: 0f 94 5d 9f call 0x33eba ; 0x33eba 12672: 0f b6 in r0, 0x3f ; 63 12674: f8 94 cli 12676: de bf out 0x3e, r29 ; 62 12678: 0f be out 0x3f, r0 ; 63 1267a: cd bf out 0x3d, r28 ; 61 1267c: d0 c4 rjmp .+2464 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1267e: 82 35 cpi r24, 0x52 ; 82 12680: 91 05 cpc r25, r1 12682: 11 f4 brne .+4 ; 0x12688 12684: 0c 94 bb 9c jmp 0x13976 ; 0x13976 12688: 83 35 cpi r24, 0x53 ; 83 1268a: 91 05 cpc r25, r1 1268c: 09 f0 breq .+2 ; 0x12690 1268e: d1 cd rjmp .-1118 ; 0x12232 /*! ### 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; 12690: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb 12694: 88 60 ori r24, 0x08 ; 8 12696: 80 93 eb 11 sts 0x11EB, r24 ; 0x8011eb 1269a: c1 c4 rjmp .+2434 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1269c: 8c 35 cpi r24, 0x5C ; 92 1269e: 91 05 cpc r25, r1 126a0: 11 f4 brne .+4 ; 0x126a6 126a2: 0c 94 2a 9d jmp 0x13a54 ; 0x13a54 126a6: 34 f5 brge .+76 ; 0x126f4 126a8: 85 35 cpi r24, 0x55 ; 85 126aa: 91 05 cpc r25, r1 126ac: 11 f4 brne .+4 ; 0x126b2 126ae: 0c 94 11 9d jmp 0x13a22 ; 0x13a22 126b2: 86 35 cpi r24, 0x56 ; 86 126b4: 91 05 cpc r25, r1 126b6: 09 f0 breq .+2 ; 0x126ba 126b8: bc cd rjmp .-1160 ; 0x12232 #### Parameters - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled. */ case 86: if (code_seen('S')) { 126ba: 83 e5 ldi r24, 0x53 ; 83 126bc: 0e 94 2b 55 call 0xaa56 ; 0xaa56 126c0: 88 23 and r24, r24 126c2: 09 f4 brne .+2 ; 0x126c6 126c4: ac c4 rjmp .+2392 ; 0x1301e safetytimer_inactive_time = code_value() * 1000; 126c6: 0e 94 03 5a call 0xb406 ; 0xb406 126ca: 20 e0 ldi r18, 0x00 ; 0 126cc: 30 e0 ldi r19, 0x00 ; 0 126ce: 4a e7 ldi r20, 0x7A ; 122 126d0: 54 e4 ldi r21, 0x44 ; 68 126d2: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 126d6: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 126da: 60 93 33 02 sts 0x0233, r22 ; 0x800233 126de: 70 93 34 02 sts 0x0234, r23 ; 0x800234 126e2: 80 93 35 02 sts 0x0235, r24 ; 0x800235 126e6: 90 93 36 02 sts 0x0236, r25 ; 0x800236 safetyTimer.start(); 126ea: 8a e1 ldi r24, 0x1A ; 26 126ec: 96 e0 ldi r25, 0x06 ; 6 126ee: 0f 94 29 12 call 0x22452 ; 0x22452 ::start()> 126f2: 95 c4 rjmp .+2346 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 126f4: 89 36 cpi r24, 0x69 ; 105 126f6: 91 05 cpc r25, r1 126f8: 11 f4 brne .+4 ; 0x126fe 126fa: 0c 94 9a 9b jmp 0x13734 ; 0x13734 126fe: 14 f0 brlt .+4 ; 0x12704 12700: 0c 94 aa 9c jmp 0x13954 ; 0x13954 12704: 88 36 cpi r24, 0x68 ; 104 12706: 91 05 cpc r25, r1 12708: 09 f0 breq .+2 ; 0x1270c 1270a: 93 cd rjmp .-1242 ; 0x12232 #### Parameters - `S` - Target temperature */ case 104: // M104 { if (code_seen('S')) 1270c: 83 e5 ldi r24, 0x53 ; 83 1270e: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12712: 88 23 and r24, r24 12714: 09 f4 brne .+2 ; 0x12718 12716: 83 c4 rjmp .+2310 ; 0x1301e { setTargetHotend(code_value()); 12718: 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; 1271c: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 12720: 70 93 f2 11 sts 0x11F2, r23 ; 0x8011f2 12724: 60 93 f1 11 sts 0x11F1, r22 ; 0x8011f1 12728: 7a c4 rjmp .+2292 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1272a: 85 37 cpi r24, 0x75 ; 117 1272c: 91 05 cpc r25, r1 1272e: 11 f4 brne .+4 ; 0x12734 12730: 0c 94 a8 9e jmp 0x13d50 ; 0x13d50 12734: bc f5 brge .+110 ; 0x127a4 12736: 80 37 cpi r24, 0x70 ; 112 12738: 91 05 cpc r25, r1 1273a: 09 f4 brne .+2 ; 0x1273e 1273c: e8 c7 rjmp .+4048 ; 0x1370e 1273e: d4 f4 brge .+52 ; 0x12774 12740: 8d 36 cpi r24, 0x6D ; 109 12742: 91 05 cpc r25, r1 12744: 11 f4 brne .+4 ; 0x1274a 12746: 0c 94 c6 9b jmp 0x1378c ; 0x1378c 1274a: 8e 36 cpi r24, 0x6E ; 110 1274c: 91 05 cpc r25, r1 1274e: 09 f0 breq .+2 ; 0x12752 12750: 70 cd rjmp .-1312 ; 0x12232 #### Parameters - `N` - Line number */ case 110: if (code_seen('N')) 12752: 8e e4 ldi r24, 0x4E ; 78 12754: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12758: 88 23 and r24, r24 1275a: 09 f4 brne .+2 ; 0x1275e 1275c: 60 c4 rjmp .+2240 ; 0x1301e gcode_LastN = code_value_long(); 1275e: 0e 94 93 55 call 0xab26 ; 0xab26 12762: 60 93 d1 11 sts 0x11D1, r22 ; 0x8011d1 12766: 70 93 d2 11 sts 0x11D2, r23 ; 0x8011d2 1276a: 80 93 d3 11 sts 0x11D3, r24 ; 0x8011d3 1276e: 90 93 d4 11 sts 0x11D4, r25 ; 0x8011d4 12772: 55 c4 rjmp .+2218 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12774: 82 37 cpi r24, 0x72 ; 114 12776: 91 05 cpc r25, r1 12778: 11 f4 brne .+4 ; 0x1277e 1277a: 0c 94 a5 9e jmp 0x13d4a ; 0x13d4a 1277e: 14 f4 brge .+4 ; 0x12784 12780: 0c 94 b2 9d jmp 0x13b64 ; 0x13b64 12784: 83 37 cpi r24, 0x73 ; 115 12786: 91 05 cpc r25, r1 12788: 09 f0 breq .+2 ; 0x1278c 1278a: 53 cd rjmp .-1370 ; 0x12232 #### 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')) { 1278c: 86 e5 ldi r24, 0x56 ; 86 1278e: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12792: 88 23 and r24, r24 12794: 11 f4 brne .+4 ; 0x1279a 12796: 0c 94 d1 9d jmp 0x13ba2 ; 0x13ba2 // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); 1279a: 83 ec ldi r24, 0xC3 ; 195 1279c: 9e e9 ldi r25, 0x9E ; 158 1279e: 0e 94 49 72 call 0xe492 ; 0xe492 127a2: 3d c4 rjmp .+2170 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 127a4: 8b 37 cpi r24, 0x7B ; 123 127a6: 91 05 cpc r25, r1 127a8: 11 f4 brne .+4 ; 0x127ae 127aa: 0c 94 00 9f jmp 0x13e00 ; 0x13e00 127ae: 0c f0 brlt .+2 ; 0x127b2 127b0: 48 c0 rjmp .+144 ; 0x12842 127b2: 86 37 cpi r24, 0x76 ; 118 127b4: 91 05 cpc r25, r1 127b6: 11 f4 brne .+4 ; 0x127bc 127b8: 0c 94 b8 9e jmp 0x13d70 ; 0x13d70 127bc: 87 37 cpi r24, 0x77 ; 119 127be: 91 05 cpc r25, r1 127c0: 09 f0 breq .+2 ; 0x127c4 127c2: 37 cd rjmp .-1426 ; 0x12232 /*! ### 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 127c4: 8e e4 ldi r24, 0x4E ; 78 127c6: 95 e6 ldi r25, 0x65 ; 101 127c8: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_PROTOCOLLN(); 127cc: 0f 94 bb 98 call 0x33176 ; 0x33176 #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_min: "));////MSG_X_MIN 127d0: 86 e4 ldi r24, 0x46 ; 70 127d2: 95 e6 ldi r25, 0x65 ; 101 127d4: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 if(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){ 127d8: 1e 9b sbis 0x03, 6 ; 3 127da: 02 c0 rjmp .+4 ; 0x127e0 127dc: 0c 94 f0 9e jmp 0x13de0 ; 0x13de0 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 127e0: 81 e4 ldi r24, 0x41 ; 65 127e2: 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); 127e4: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 127e8: 0f 94 bb 98 call 0x33176 ; 0x33176 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 127ec: 8f e2 ldi r24, 0x2F ; 47 127ee: 95 e6 ldi r25, 0x65 ; 101 127f0: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 if(READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ 127f4: 1d 9b sbis 0x03, 5 ; 3 127f6: 02 c0 rjmp .+4 ; 0x127fc 127f8: 0c 94 f4 9e jmp 0x13de8 ; 0x13de8 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 127fc: 81 e4 ldi r24, 0x41 ; 65 127fe: 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); 12800: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 12804: 0f 94 bb 98 call 0x33176 ; 0x33176 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MIN); 12808: 87 e2 ldi r24, 0x27 ; 39 1280a: 95 e6 ldi r25, 0x65 ; 101 1280c: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 if(READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ 12810: 1c 9b sbis 0x03, 4 ; 3 12812: 02 c0 rjmp .+4 ; 0x12818 12814: 0c 94 f8 9e jmp 0x13df0 ; 0x13df0 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 12818: 81 e4 ldi r24, 0x41 ; 65 1281a: 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); 1281c: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 12820: 0f 94 bb 98 call 0x33176 ; 0x33176 #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MAX); 12824: 8f e1 ldi r24, 0x1F ; 31 12826: 95 e6 ldi r25, 0x65 ; 101 12828: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 if(READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ 1282c: 01 99 sbic 0x00, 1 ; 0 1282e: 02 c0 rjmp .+4 ; 0x12834 12830: 0c 94 fc 9e jmp 0x13df8 ; 0x13df8 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 12834: 81 e4 ldi r24, 0x41 ; 65 12836: 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); 12838: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 1283c: 0f 94 bb 98 call 0x33176 ; 0x33176 12840: ee c3 rjmp .+2012 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12842: 8c 38 cpi r24, 0x8C ; 140 12844: 91 05 cpc r25, r1 12846: 09 f4 brne .+2 ; 0x1284a 12848: 66 c7 rjmp .+3788 ; 0x13716 1284a: 8b 39 cpi r24, 0x9B ; 155 1284c: 91 05 cpc r25, r1 1284e: 09 f4 brne .+2 ; 0x12852 12850: 7d c7 rjmp .+3834 ; 0x1374c 12852: 8d 37 cpi r24, 0x7D ; 125 12854: 91 05 cpc r25, r1 12856: 09 f0 breq .+2 ; 0x1285a 12858: ec cc rjmp .-1576 ; 0x12232 1285a: 58 cd rjmp .-1360 ; 0x1230c 1285c: 84 3a cpi r24, 0xA4 ; 164 1285e: 41 e0 ldi r20, 0x01 ; 1 12860: 94 07 cpc r25, r20 12862: 11 f4 brne .+4 ; 0x12868 12864: 0c 94 23 a2 jmp 0x14446 ; 0x14446 12868: 0c f0 brlt .+2 ; 0x1286c 1286a: 44 c2 rjmp .+1160 ; 0x12cf4 1286c: 82 3e cpi r24, 0xE2 ; 226 1286e: 91 05 cpc r25, r1 12870: 11 f4 brne .+4 ; 0x12876 12872: 0c 94 ad a0 jmp 0x1415a ; 0x1415a 12876: 0c f0 brlt .+2 ; 0x1287a 12878: 6b c1 rjmp .+726 ; 0x12b50 1287a: 8e 3c cpi r24, 0xCE ; 206 1287c: 91 05 cpc r25, r1 1287e: 11 f4 brne .+4 ; 0x12884 12880: 0c 94 bc 9f jmp 0x13f78 ; 0x13f78 12884: 0c f0 brlt .+2 ; 0x12888 12886: b1 c0 rjmp .+354 ; 0x129ea 12888: 8b 3c cpi r24, 0xCB ; 203 1288a: 91 05 cpc r25, r1 1288c: 11 f4 brne .+4 ; 0x12892 1288e: 0c 94 46 9f jmp 0x13e8c ; 0x13e8c 12892: 5c f5 brge .+86 ; 0x128ea 12894: 88 3c cpi r24, 0xC8 ; 200 12896: 91 05 cpc r25, r1 12898: 11 f4 brne .+4 ; 0x1289e 1289a: 0c 94 03 9f jmp 0x13e06 ; 0x13e06 1289e: 04 ec ldi r16, 0xC4 ; 196 128a0: 12 e0 ldi r17, 0x02 ; 2 128a2: a2 e3 ldi r26, 0x32 ; 50 128a4: ea 2e mov r14, r26 128a6: a4 e0 ldi r26, 0x04 ; 4 128a8: fa 2e mov r15, r26 128aa: b8 ec ldi r27, 0xC8 ; 200 128ac: cb 2e mov r12, r27 128ae: b2 e0 ldi r27, 0x02 ; 2 128b0: db 2e mov r13, r27 128b2: 89 3c cpi r24, 0xC9 ; 201 128b4: 91 05 cpc r25, r1 128b6: 09 f0 breq .+2 ; 0x128ba 128b8: bc cc rjmp .-1672 ; 0x12232 - `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])) 128ba: d8 01 movw r26, r16 128bc: 8d 91 ld r24, X+ 128be: 8d 01 movw r16, r26 128c0: 0e 94 2b 55 call 0xaa56 ; 0xaa56 128c4: 88 23 and r24, r24 128c6: 49 f0 breq .+18 ; 0x128da { unsigned long val = code_value(); 128c8: 0e 94 03 5a call 0xb406 ; 0xb406 128cc: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 128d0: f7 01 movw r30, r14 128d2: 64 a3 std Z+36, r22 ; 0x24 128d4: 75 a3 std Z+37, r23 ; 0x25 128d6: 86 a3 std Z+38, r24 ; 0x26 128d8: 97 a3 std Z+39, r25 ; 0x27 128da: f4 e0 ldi r31, 0x04 ; 4 128dc: ef 0e add r14, r31 128de: 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++) 128e0: c0 16 cp r12, r16 128e2: d1 06 cpc r13, r17 128e4: 51 f7 brne .-44 ; 0x128ba 128e6: 0c 94 a7 9d jmp 0x13b4e ; 0x13b4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 128ea: 8c 3c cpi r24, 0xCC ; 204 128ec: 91 05 cpc r25, r1 128ee: 11 f4 brne .+4 ; 0x128f4 128f0: 0c 94 65 9f jmp 0x13eca ; 0x13eca 128f4: 8d 3c cpi r24, 0xCD ; 205 128f6: 91 05 cpc r25, r1 128f8: 09 f0 breq .+2 ; 0x128fc 128fa: 9b cc rjmp .-1738 ; 0x12232 - `Z` - Maximum Z jerk (units/s) - `E` - Maximum E jerk (units/s) */ case 205: { if(code_seen('S')) cs.minimumfeedrate = code_value(); 128fc: 83 e5 ldi r24, 0x53 ; 83 128fe: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12902: 88 23 and r24, r24 12904: 51 f0 breq .+20 ; 0x1291a 12906: 0e 94 03 5a call 0xb406 ; 0xb406 1290a: 60 93 6e 04 sts 0x046E, r22 ; 0x80046e 1290e: 70 93 6f 04 sts 0x046F, r23 ; 0x80046f 12912: 80 93 70 04 sts 0x0470, r24 ; 0x800470 12916: 90 93 71 04 sts 0x0471, r25 ; 0x800471 if(code_seen('T')) cs.mintravelfeedrate = code_value(); 1291a: 84 e5 ldi r24, 0x54 ; 84 1291c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12920: 88 23 and r24, r24 12922: 51 f0 breq .+20 ; 0x12938 12924: 0e 94 03 5a call 0xb406 ; 0xb406 12928: 60 93 72 04 sts 0x0472, r22 ; 0x800472 1292c: 70 93 73 04 sts 0x0473, r23 ; 0x800473 12930: 80 93 74 04 sts 0x0474, r24 ; 0x800474 12934: 90 93 75 04 sts 0x0475, r25 ; 0x800475 if(code_seen('B')) cs.min_segment_time_us = (uint32_t)code_value(); 12938: 82 e4 ldi r24, 0x42 ; 66 1293a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1293e: 88 23 and r24, r24 12940: 61 f0 breq .+24 ; 0x1295a 12942: 0e 94 03 5a call 0xb406 ; 0xb406 12946: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 1294a: 60 93 76 04 sts 0x0476, r22 ; 0x800476 1294e: 70 93 77 04 sts 0x0477, r23 ; 0x800477 12952: 80 93 78 04 sts 0x0478, r24 ; 0x800478 12956: 90 93 79 04 sts 0x0479, r25 ; 0x800479 if(code_seen('X')) cs.max_jerk[X_AXIS] = cs.max_jerk[Y_AXIS] = code_value(); 1295a: 88 e5 ldi r24, 0x58 ; 88 1295c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12960: 88 23 and r24, r24 12962: 91 f0 breq .+36 ; 0x12988 12964: 0e 94 03 5a call 0xb406 ; 0xb406 12968: 60 93 7e 04 sts 0x047E, r22 ; 0x80047e 1296c: 70 93 7f 04 sts 0x047F, r23 ; 0x80047f 12970: 80 93 80 04 sts 0x0480, r24 ; 0x800480 12974: 90 93 81 04 sts 0x0481, r25 ; 0x800481 12978: 60 93 7a 04 sts 0x047A, r22 ; 0x80047a 1297c: 70 93 7b 04 sts 0x047B, r23 ; 0x80047b 12980: 80 93 7c 04 sts 0x047C, r24 ; 0x80047c 12984: 90 93 7d 04 sts 0x047D, r25 ; 0x80047d if(code_seen('Y')) cs.max_jerk[Y_AXIS] = code_value(); 12988: 89 e5 ldi r24, 0x59 ; 89 1298a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1298e: 88 23 and r24, r24 12990: 51 f0 breq .+20 ; 0x129a6 12992: 0e 94 03 5a call 0xb406 ; 0xb406 12996: 60 93 7e 04 sts 0x047E, r22 ; 0x80047e 1299a: 70 93 7f 04 sts 0x047F, r23 ; 0x80047f 1299e: 80 93 80 04 sts 0x0480, r24 ; 0x800480 129a2: 90 93 81 04 sts 0x0481, r25 ; 0x800481 if(code_seen('Z')) cs.max_jerk[Z_AXIS] = code_value(); 129a6: 8a e5 ldi r24, 0x5A ; 90 129a8: 0e 94 2b 55 call 0xaa56 ; 0xaa56 129ac: 88 23 and r24, r24 129ae: 51 f0 breq .+20 ; 0x129c4 129b0: 0e 94 03 5a call 0xb406 ; 0xb406 129b4: 60 93 82 04 sts 0x0482, r22 ; 0x800482 129b8: 70 93 83 04 sts 0x0483, r23 ; 0x800483 129bc: 80 93 84 04 sts 0x0484, r24 ; 0x800484 129c0: 90 93 85 04 sts 0x0485, r25 ; 0x800485 if(code_seen('E')) 129c4: 85 e4 ldi r24, 0x45 ; 69 129c6: 0e 94 2b 55 call 0xaa56 ; 0xaa56 129ca: 88 23 and r24, r24 129cc: 09 f4 brne .+2 ; 0x129d0 129ce: 27 c3 rjmp .+1614 ; 0x1301e { float e = code_value(); 129d0: 0e 94 03 5a call 0xb406 ; 0xb406 #ifndef LA_NOCOMPAT e = la10c_jerk(e); 129d4: 0e 94 79 73 call 0xe6f2 ; 0xe6f2 #endif cs.max_jerk[E_AXIS] = e; 129d8: 60 93 86 04 sts 0x0486, r22 ; 0x800486 129dc: 70 93 87 04 sts 0x0487, r23 ; 0x800487 129e0: 80 93 88 04 sts 0x0488, r24 ; 0x800488 129e4: 90 93 89 04 sts 0x0489, r25 ; 0x800489 129e8: 1a c3 rjmp .+1588 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 129ea: 81 3d cpi r24, 0xD1 ; 209 129ec: 91 05 cpc r25, r1 129ee: 11 f4 brne .+4 ; 0x129f4 129f0: 0c 94 0a a0 jmp 0x14014 ; 0x14014 129f4: 5c f5 brge .+86 ; 0x12a4c 129f6: 8f 3c cpi r24, 0xCF ; 207 129f8: 91 05 cpc r25, r1 129fa: 11 f4 brne .+4 ; 0x12a00 129fc: 0c 94 d8 9f jmp 0x13fb0 ; 0x13fb0 12a00: 80 3d cpi r24, 0xD0 ; 208 12a02: 91 05 cpc r25, r1 12a04: 09 f0 breq .+2 ; 0x12a08 12a06: 15 cc rjmp .-2006 ; 0x12232 - `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')) 12a08: 83 e5 ldi r24, 0x53 ; 83 12a0a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12a0e: 88 23 and r24, r24 12a10: 51 f0 breq .+20 ; 0x12a26 { cs.retract_recover_length = code_value() ; 12a12: 0e 94 03 5a call 0xb406 ; 0xb406 12a16: 60 93 c1 04 sts 0x04C1, r22 ; 0x8004c1 12a1a: 70 93 c2 04 sts 0x04C2, r23 ; 0x8004c2 12a1e: 80 93 c3 04 sts 0x04C3, r24 ; 0x8004c3 12a22: 90 93 c4 04 sts 0x04C4, r25 ; 0x8004c4 } if(code_seen('F')) 12a26: 86 e4 ldi r24, 0x46 ; 70 12a28: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12a2c: 88 23 and r24, r24 12a2e: 09 f4 brne .+2 ; 0x12a32 12a30: f6 c2 rjmp .+1516 ; 0x1301e { cs.retract_recover_feedrate = get_feedrate_mm_s(code_value()); 12a32: 0e 94 03 5a call 0xb406 ; 0xb406 12a36: 0e 94 c3 5f call 0xbf86 ; 0xbf86 12a3a: 60 93 c5 04 sts 0x04C5, r22 ; 0x8004c5 12a3e: 70 93 c6 04 sts 0x04C6, r23 ; 0x8004c6 12a42: 80 93 c7 04 sts 0x04C7, r24 ; 0x8004c7 12a46: 90 93 c8 04 sts 0x04C8, r25 ; 0x8004c8 12a4a: e9 c2 rjmp .+1490 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12a4c: 8c 3d cpi r24, 0xDC ; 220 12a4e: 91 05 cpc r25, r1 12a50: 11 f4 brne .+4 ; 0x12a56 12a52: 0c 94 4d a0 jmp 0x1409a ; 0x1409a 12a56: 8d 3d cpi r24, 0xDD ; 221 12a58: 91 05 cpc r25, r1 12a5a: 11 f4 brne .+4 ; 0x12a60 12a5c: 0c 94 8c a0 jmp 0x14118 ; 0x14118 12a60: 86 3d cpi r24, 0xD6 ; 214 12a62: 91 05 cpc r25, r1 12a64: 09 f0 breq .+2 ; 0x12a68 12a66: e5 cb rjmp .-2102 ; 0x12232 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; 12a68: 80 e5 ldi r24, 0x50 ; 80 12a6a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12a6e: 88 23 and r24, r24 12a70: 11 f4 brne .+4 ; 0x12a76 12a72: 0c 94 39 a0 jmp 0x14072 ; 0x14072 12a76: 0e 94 03 5a call 0xb406 ; 0xb406 12a7a: 2b 01 movw r4, r22 12a7c: 3c 01 movw r6, r24 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 12a7e: 83 e5 ldi r24, 0x53 ; 83 12a80: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12a84: 88 23 and r24, r24 12a86: 11 f4 brne .+4 ; 0x12a8c 12a88: 0c 94 43 a0 jmp 0x14086 ; 0x14086 12a8c: 0e 94 03 5a call 0xb406 ; 0xb406 12a90: 4b 01 movw r8, r22 12a92: 5c 01 movw r10, r24 unsigned char n = code_seen('N') ? code_value() : cs.n_arc_correction; 12a94: 8e e4 ldi r24, 0x4E ; 78 12a96: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12a9a: d0 90 fe 04 lds r13, 0x04FE ; 0x8004fe 12a9e: 88 23 and r24, r24 12aa0: 29 f0 breq .+10 ; 0x12aac 12aa2: 0e 94 03 5a call 0xb406 ; 0xb406 12aa6: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 12aaa: d6 2e mov r13, r22 unsigned short r = code_seen('R') ? code_value() : cs.min_arc_segments; 12aac: 82 e5 ldi r24, 0x52 ; 82 12aae: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12ab2: e0 90 ff 04 lds r14, 0x04FF ; 0x8004ff 12ab6: f0 90 00 05 lds r15, 0x0500 ; 0x800500 12aba: 88 23 and r24, r24 12abc: 29 f0 breq .+10 ; 0x12ac8 12abe: 0e 94 03 5a call 0xb406 ; 0xb406 12ac2: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 12ac6: 7b 01 movw r14, r22 unsigned short f = code_seen('F') ? code_value() : cs.arc_segments_per_sec; 12ac8: 86 e4 ldi r24, 0x46 ; 70 12aca: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12ace: 00 91 01 05 lds r16, 0x0501 ; 0x800501 12ad2: 10 91 02 05 lds r17, 0x0502 ; 0x800502 12ad6: 88 23 and r24, r24 12ad8: 29 f0 breq .+10 ; 0x12ae4 12ada: 0e 94 03 5a call 0xb406 ; 0xb406 12ade: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 12ae2: 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) 12ae4: 20 e0 ldi r18, 0x00 ; 0 12ae6: 30 e0 ldi r19, 0x00 ; 0 12ae8: a9 01 movw r20, r18 12aea: c3 01 movw r24, r6 12aec: b2 01 movw r22, r4 12aee: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 12af2: 18 16 cp r1, r24 12af4: 0c f0 brlt .+2 ; 0x12af8 12af6: 93 c2 rjmp .+1318 ; 0x1301e 12af8: 20 e0 ldi r18, 0x00 ; 0 12afa: 30 e0 ldi r19, 0x00 ; 0 12afc: a9 01 movw r20, r18 12afe: c5 01 movw r24, r10 12b00: b4 01 movw r22, r8 12b02: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 12b06: 87 fd sbrc r24, 7 12b08: 8a c2 rjmp .+1300 ; 0x1301e 12b0a: a5 01 movw r20, r10 12b0c: 94 01 movw r18, r8 12b0e: c3 01 movw r24, r6 12b10: b2 01 movw r22, r4 12b12: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 12b16: 87 fd sbrc r24, 7 12b18: 82 c2 rjmp .+1284 ; 0x1301e { // Should we display some error here? break; } cs.mm_per_arc_segment = p; 12b1a: 40 92 f6 04 sts 0x04F6, r4 ; 0x8004f6 12b1e: 50 92 f7 04 sts 0x04F7, r5 ; 0x8004f7 12b22: 60 92 f8 04 sts 0x04F8, r6 ; 0x8004f8 12b26: 70 92 f9 04 sts 0x04F9, r7 ; 0x8004f9 cs.min_mm_per_arc_segment = s; 12b2a: 80 92 fa 04 sts 0x04FA, r8 ; 0x8004fa 12b2e: 90 92 fb 04 sts 0x04FB, r9 ; 0x8004fb 12b32: a0 92 fc 04 sts 0x04FC, r10 ; 0x8004fc 12b36: b0 92 fd 04 sts 0x04FD, r11 ; 0x8004fd cs.n_arc_correction = n; 12b3a: d0 92 fe 04 sts 0x04FE, r13 ; 0x8004fe cs.min_arc_segments = r; 12b3e: f0 92 00 05 sts 0x0500, r15 ; 0x800500 12b42: e0 92 ff 04 sts 0x04FF, r14 ; 0x8004ff cs.arc_segments_per_sec = f; 12b46: 10 93 02 05 sts 0x0502, r17 ; 0x800502 12b4a: 00 93 01 05 sts 0x0501, r16 ; 0x800501 12b4e: 67 c2 rjmp .+1230 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12b50: 80 33 cpi r24, 0x30 ; 48 12b52: a1 e0 ldi r26, 0x01 ; 1 12b54: 9a 07 cpc r25, r26 12b56: 11 f4 brne .+4 ; 0x12b5c 12b58: 0c 94 88 a1 jmp 0x14310 ; 0x14310 12b5c: 0c f0 brlt .+2 ; 0x12b60 12b5e: 78 c0 rjmp .+240 ; 0x12c50 12b60: 8d 32 cpi r24, 0x2D ; 45 12b62: e1 e0 ldi r30, 0x01 ; 1 12b64: 9e 07 cpc r25, r30 12b66: 11 f4 brne .+4 ; 0x12b6c 12b68: 0c 94 0f a1 jmp 0x1421e ; 0x1421e 12b6c: b4 f5 brge .+108 ; 0x12bda 12b6e: 80 3f cpi r24, 0xF0 ; 240 12b70: 91 05 cpc r25, r1 12b72: 09 f4 brne .+2 ; 0x12b76 12b74: 54 c2 rjmp .+1192 ; 0x1301e 12b76: 8c 32 cpi r24, 0x2C ; 44 12b78: 91 40 sbci r25, 0x01 ; 1 12b7a: 09 f0 breq .+2 ; 0x12b7e 12b7c: 5a cb rjmp .-2380 ; 0x12232 - `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; 12b7e: 80 e5 ldi r24, 0x50 ; 80 12b80: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12b84: 08 ee ldi r16, 0xE8 ; 232 12b86: 13 e0 ldi r17, 0x03 ; 3 12b88: 88 23 and r24, r24 12b8a: 89 f0 breq .+34 ; 0x12bae 12b8c: 0e 94 03 5a call 0xb406 ; 0xb406 12b90: 20 e0 ldi r18, 0x00 ; 0 12b92: 30 ec ldi r19, 0xC0 ; 192 12b94: 4a e5 ldi r20, 0x5A ; 90 12b96: 55 e4 ldi r21, 0x45 ; 69 12b98: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 12b9c: 0c ea ldi r16, 0xAC ; 172 12b9e: 1d e0 ldi r17, 0x0D ; 13 12ba0: 87 ff sbrs r24, 7 12ba2: 05 c0 rjmp .+10 ; 0x12bae 12ba4: 0e 94 03 5a call 0xb406 ; 0xb406 12ba8: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 12bac: 8b 01 movw r16, r22 uint16_t beepS; if (!code_seen('S')) 12bae: 83 e5 ldi r24, 0x53 ; 83 12bb0: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12bb4: 88 23 and r24, r24 12bb6: 11 f4 brne .+4 ; 0x12bbc 12bb8: 0c 94 07 a1 jmp 0x1420e ; 0x1420e beepS = 0; else { beepS = code_value(); 12bbc: 0e 94 03 5a call 0xb406 ; 0xb406 12bc0: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> if (!beepS) { 12bc4: 61 15 cp r22, r1 12bc6: 71 05 cpc r23, r1 12bc8: 11 f0 breq .+4 ; 0x12bce 12bca: 0c 94 09 a1 jmp 0x14212 ; 0x14212 // handle S0 as a pause _delay(beepP); 12bce: b8 01 movw r22, r16 12bd0: 90 e0 ldi r25, 0x00 ; 0 12bd2: 80 e0 ldi r24, 0x00 ; 0 12bd4: 0f 94 03 0e call 0x21c06 ; 0x21c06 12bd8: 22 c2 rjmp .+1092 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12bda: 8e 32 cpi r24, 0x2E ; 46 12bdc: 31 e0 ldi r19, 0x01 ; 1 12bde: 93 07 cpc r25, r19 12be0: 11 f4 brne .+4 ; 0x12be6 12be2: 0c 94 01 a2 jmp 0x14402 ; 0x14402 12be6: 8f 32 cpi r24, 0x2F ; 47 12be8: 91 40 sbci r25, 0x01 ; 1 12bea: 09 f0 breq .+2 ; 0x12bee 12bec: 22 cb rjmp .-2492 ; 0x12232 case 303: { float temp = 150.0; int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); 12bee: 85 e4 ldi r24, 0x45 ; 69 12bf0: 0e 94 2b 55 call 0xaa56 ; 0xaa56 - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; int e = 0; 12bf4: 10 e0 ldi r17, 0x00 ; 0 12bf6: 00 e0 ldi r16, 0x00 ; 0 int c = 5; if (code_seen('E')) e = code_value_short(); 12bf8: 88 23 and r24, r24 12bfa: 59 f0 breq .+22 ; 0x12c12 12bfc: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 12c00: 8c 01 movw r16, r24 if (e < 0) temp = 70; 12c02: c1 2c mov r12, r1 12c04: d1 2c mov r13, r1 12c06: 5c e8 ldi r21, 0x8C ; 140 12c08: e5 2e mov r14, r21 12c0a: 52 e4 ldi r21, 0x42 ; 66 12c0c: 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) 12c0e: 97 fd sbrc r25, 7 12c10: 06 c0 rjmp .+12 ; 0x12c1e - `S` - Target temperature, default `210°C` for hotend, 70 for bed - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; 12c12: c1 2c mov r12, r1 12c14: d1 2c mov r13, r1 12c16: 66 e1 ldi r22, 0x16 ; 22 12c18: e6 2e mov r14, r22 12c1a: 63 e4 ldi r22, 0x43 ; 67 12c1c: 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(); 12c1e: 83 e5 ldi r24, 0x53 ; 83 12c20: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12c24: 88 23 and r24, r24 12c26: 21 f0 breq .+8 ; 0x12c30 12c28: 0e 94 03 5a call 0xb406 ; 0xb406 12c2c: 6b 01 movw r12, r22 12c2e: 7c 01 movw r14, r24 if (code_seen('C')) c = code_value_short(); 12c30: 83 e4 ldi r24, 0x43 ; 67 12c32: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12c36: 88 23 and r24, r24 12c38: 11 f4 brne .+4 ; 0x12c3e 12c3a: 0c 94 11 a2 jmp 0x14422 ; 0x14422 12c3e: 0e 94 4d 55 call 0xaa9a ; 0xaa9a PID_autotune(temp, e, c); 12c42: 9c 01 movw r18, r24 12c44: a8 01 movw r20, r16 12c46: c7 01 movw r24, r14 12c48: b6 01 movw r22, r12 12c4a: 0f 94 4f 19 call 0x2329e ; 0x2329e 12c4e: e7 c1 rjmp .+974 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12c50: 80 39 cpi r24, 0x90 ; 144 12c52: 51 e0 ldi r21, 0x01 ; 1 12c54: 95 07 cpc r25, r21 12c56: 11 f4 brne .+4 ; 0x12c5c 12c58: 0c 94 15 a2 jmp 0x1442a ; 0x1442a 12c5c: 04 f5 brge .+64 ; 0x12c9e 12c5e: 8e 35 cpi r24, 0x5E ; 94 12c60: b1 e0 ldi r27, 0x01 ; 1 12c62: 9b 07 cpc r25, r27 12c64: 11 f4 brne .+4 ; 0x12c6a 12c66: 0c 94 57 ad jmp 0x15aae ; 0x15aae 12c6a: 8f 35 cpi r24, 0x5F ; 95 12c6c: 91 40 sbci r25, 0x01 ; 1 12c6e: 09 f0 breq .+2 ; 0x12c72 12c70: e0 ca rjmp .-2624 ; 0x12232 - `B` - new pin value */ case 351: { #if defined(X_MS1_PIN) && X_MS1_PIN > -1 if(code_seen('S')) switch((int)code_value()) 12c72: 83 e5 ldi r24, 0x53 ; 83 12c74: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12c78: 88 23 and r24, r24 12c7a: 71 f0 breq .+28 ; 0x12c98 12c7c: 0e 94 03 5a call 0xb406 ; 0xb406 12c80: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 12c84: 61 30 cpi r22, 0x01 ; 1 12c86: 71 05 cpc r23, r1 12c88: 11 f4 brne .+4 ; 0x12c8e 12c8a: 0c 94 8d ad jmp 0x15b1a ; 0x15b1a 12c8e: 62 30 cpi r22, 0x02 ; 2 12c90: 71 05 cpc r23, r1 12c92: 11 f4 brne .+4 ; 0x12c98 12c94: 0c 94 af ad jmp 0x15b5e ; 0x15b5e case 2: for(int i=0;i 12c9c: c0 c1 rjmp .+896 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12c9e: 85 39 cpi r24, 0x95 ; 149 12ca0: f1 e0 ldi r31, 0x01 ; 1 12ca2: 9f 07 cpc r25, r31 12ca4: 11 f4 brne .+4 ; 0x12caa 12ca6: 0c 94 19 a2 jmp 0x14432 ; 0x14432 12caa: 86 39 cpi r24, 0x96 ; 150 12cac: 21 e0 ldi r18, 0x01 ; 1 12cae: 92 07 cpc r25, r18 12cb0: 11 f4 brne .+4 ; 0x12cb6 12cb2: 0c 94 1e a2 jmp 0x1443c ; 0x1443c 12cb6: 83 39 cpi r24, 0x93 ; 147 12cb8: 91 40 sbci r25, 0x01 ; 1 12cba: 09 f0 breq .+2 ; 0x12cbe 12cbc: ba ca rjmp .-2700 ; 0x12232 */ 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()) 12cbe: 80 91 94 12 lds r24, 0x1294 ; 0x801294 12cc2: 81 30 cpi r24, 0x01 ; 1 12cc4: 09 f0 breq .+2 ; 0x12cc8 12cc6: ab c1 rjmp .+854 ; 0x1301e { uint8_t extruder = 255; uint8_t filament = FILAMENT_UNDEFINED; if(code_seen('E')) extruder = code_value_uint8(); 12cc8: 85 e4 ldi r24, 0x45 ; 69 12cca: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12cce: 81 11 cpse r24, r1 12cd0: 0e 94 40 55 call 0xaa80 ; 0xaa80 if(code_seen('F')) filament = code_value_uint8(); 12cd4: 86 e4 ldi r24, 0x46 ; 70 12cd6: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12cda: 81 11 cpse r24, r1 12cdc: 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()) { 12ce0: 0f 94 73 54 call 0x2a8e6 ; 0x2a8e6 12ce4: 88 23 and r24, r24 12ce6: 09 f4 brne .+2 ; 0x12cea 12ce8: 9a c1 rjmp .+820 ; 0x1301e // slot = slot; // @@TODO // type = type; // @@TODO // cmd_arg = filamentType; // command(MMU_CMD_F0 + index); if (!manage_response(false, false)) { 12cea: 60 e0 ldi r22, 0x00 ; 0 12cec: 80 e0 ldi r24, 0x00 ; 0 12cee: 0f 94 87 6a call 0x2d50e ; 0x2d50e 12cf2: 95 c1 rjmp .+810 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12cf4: 80 3c cpi r24, 0xC0 ; 192 12cf6: 42 e0 ldi r20, 0x02 ; 2 12cf8: 94 07 cpc r25, r20 12cfa: 11 f4 brne .+4 ; 0x12d00 12cfc: 0c 94 9e ae jmp 0x15d3c ; 0x15d3c 12d00: 0c f0 brlt .+2 ; 0x12d04 12d02: 57 c0 rjmp .+174 ; 0x12db2 12d04: 88 32 cpi r24, 0x28 ; 40 12d06: a2 e0 ldi r26, 0x02 ; 2 12d08: 9a 07 cpc r25, r26 12d0a: 11 f4 brne .+4 ; 0x12d10 12d0c: 0c 94 e2 a4 jmp 0x149c4 ; 0x149c4 12d10: 4c f5 brge .+82 ; 0x12d64 12d12: 86 3f cpi r24, 0xF6 ; 246 12d14: e1 e0 ldi r30, 0x01 ; 1 12d16: 9e 07 cpc r25, r30 12d18: 11 f4 brne .+4 ; 0x12d1e 12d1a: 0c 94 2b a2 jmp 0x14456 ; 0x14456 12d1e: 6c f4 brge .+26 ; 0x12d3a 12d20: 84 3f cpi r24, 0xF4 ; 244 12d22: 21 e0 ldi r18, 0x01 ; 1 12d24: 92 07 cpc r25, r18 12d26: 11 f4 brne .+4 ; 0x12d2c 12d28: 0c 94 27 a2 jmp 0x1444e ; 0x1444e 12d2c: 85 3f cpi r24, 0xF5 ; 245 12d2e: 91 40 sbci r25, 0x01 ; 1 12d30: 09 f0 breq .+2 ; 0x12d34 12d32: 7f ca rjmp .-2818 ; 0x12232 M501 */ case 501: { Config_RetrieveSettings(); 12d34: 0e 94 de 74 call 0xe9bc ; 0xe9bc 12d38: 72 c1 rjmp .+740 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12d3a: 87 3f cpi r24, 0xF7 ; 247 12d3c: 41 e0 ldi r20, 0x01 ; 1 12d3e: 94 07 cpc r25, r20 12d40: 11 f4 brne .+4 ; 0x12d46 12d42: 0c 94 2f a2 jmp 0x1445e ; 0x1445e 12d46: 8d 3f cpi r24, 0xFD ; 253 12d48: 91 40 sbci r25, 0x01 ; 1 12d4a: 09 f0 breq .+2 ; 0x12d4e 12d4c: 72 ca rjmp .-2844 ; 0x12232 M509 */ case 509: { lang_reset(); 12d4e: 0e 94 aa 6b call 0xd754 ; 0xd754 SERIAL_ECHO_START; 12d52: 81 e6 ldi r24, 0x61 ; 97 12d54: 9d e9 ldi r25, 0x9D ; 157 12d56: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_PROTOCOLPGM("LANG SEL FORCED"); 12d5a: 87 e1 ldi r24, 0x17 ; 23 12d5c: 9f e7 ldi r25, 0x7F ; 127 12d5e: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 12d62: 5d c1 rjmp .+698 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12d64: 8a 35 cpi r24, 0x5A ; 90 12d66: a2 e0 ldi r26, 0x02 ; 2 12d68: 9a 07 cpc r25, r26 12d6a: 11 f4 brne .+4 ; 0x12d70 12d6c: 0c 94 10 a9 jmp 0x15220 ; 0x15220 12d70: 5c f4 brge .+22 ; 0x12d88 12d72: 88 35 cpi r24, 0x58 ; 88 12d74: e2 e0 ldi r30, 0x02 ; 2 12d76: 9e 07 cpc r25, r30 12d78: 11 f4 brne .+4 ; 0x12d7e 12d7a: 0c 94 17 a5 jmp 0x14a2e ; 0x14a2e 12d7e: 89 35 cpi r24, 0x59 ; 89 12d80: 92 40 sbci r25, 0x02 ; 2 12d82: 09 f4 brne .+2 ; 0x12d86 12d84: c3 ca rjmp .-2682 ; 0x1230c 12d86: 55 ca rjmp .-2902 ; 0x12232 12d88: 8d 3b cpi r24, 0xBD ; 189 12d8a: 22 e0 ldi r18, 0x02 ; 2 12d8c: 92 07 cpc r25, r18 12d8e: 11 f4 brne .+4 ; 0x12d94 12d90: 0c 94 c8 ad jmp 0x15b90 ; 0x15b90 12d94: 8e 3b cpi r24, 0xBE ; 190 12d96: 32 e0 ldi r19, 0x02 ; 2 12d98: 93 07 cpc r25, r19 12d9a: 11 f4 brne .+4 ; 0x12da0 12d9c: 0c 94 6a ae jmp 0x15cd4 ; 0x15cd4 12da0: 8b 35 cpi r24, 0x5B ; 91 12da2: 92 40 sbci r25, 0x02 ; 2 12da4: 09 f0 breq .+2 ; 0x12da8 12da6: 45 ca rjmp .-2934 ; 0x12232 /*! ### M603 - Stop print M603: Stop print */ case 603: { print_stop(); 12da8: 60 e0 ldi r22, 0x00 ; 0 12daa: 80 e0 ldi r24, 0x00 ; 0 12dac: 0e 94 cc ef call 0x1df98 ; 0x1df98 12db0: 36 c1 rjmp .+620 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12db2: 8c 35 cpi r24, 0x5C ; 92 12db4: 53 e0 ldi r21, 0x03 ; 3 12db6: 95 07 cpc r25, r21 12db8: 11 f4 brne .+4 ; 0x12dbe 12dba: 0c 94 32 aa jmp 0x15464 ; 0x15464 12dbe: 0c f0 brlt .+2 ; 0x12dc2 12dc0: 42 c0 rjmp .+132 ; 0x12e46 12dc2: 83 3c cpi r24, 0xC3 ; 195 12dc4: b2 e0 ldi r27, 0x02 ; 2 12dc6: 9b 07 cpc r25, r27 12dc8: 11 f4 brne .+4 ; 0x12dce 12dca: 0c 94 aa ae jmp 0x15d54 ; 0x15d54 12dce: 7c f4 brge .+30 ; 0x12dee 12dd0: 81 3c cpi r24, 0xC1 ; 193 12dd2: f2 e0 ldi r31, 0x02 ; 2 12dd4: 9f 07 cpc r25, r31 12dd6: 11 f4 brne .+4 ; 0x12ddc 12dd8: 0c 94 a4 ae jmp 0x15d48 ; 0x15d48 12ddc: 82 3c cpi r24, 0xC2 ; 194 12dde: 92 40 sbci r25, 0x02 ; 2 12de0: 09 f0 breq .+2 ; 0x12de4 12de2: 27 ca rjmp .-2994 ; 0x12232 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 706: { gcodes_M704_M705_M706(706); 12de4: 82 ec ldi r24, 0xC2 ; 194 12de6: 92 e0 ldi r25, 0x02 ; 2 12de8: 0e 94 c9 59 call 0xb392 ; 0xb392 12dec: 18 c1 rjmp .+560 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12dee: 85 3c cpi r24, 0xC5 ; 197 12df0: 32 e0 ldi r19, 0x02 ; 2 12df2: 93 07 cpc r25, r19 12df4: 11 f4 brne .+4 ; 0x12dfa 12df6: 0c 94 f3 ae jmp 0x15de6 ; 0x15de6 12dfa: 14 f4 brge .+4 ; 0x12e00 12dfc: 0c 94 c7 ae jmp 0x15d8e ; 0x15d8e 12e00: 82 35 cpi r24, 0x52 ; 82 12e02: 93 40 sbci r25, 0x03 ; 3 12e04: 09 f0 breq .+2 ; 0x12e08 12e06: 15 ca rjmp .-3030 ; 0x12232 float z_val = 0; char strLabel[8]; uint8_t iBedC = 0; uint8_t iPindaC = 0; bool bIsActive=false; strLabel[7] = '\0'; // null terminate. 12e08: 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')) { 12e0a: 83 e5 ldi r24, 0x53 ; 83 12e0c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12e10: 88 23 and r24, r24 12e12: 11 f4 brne .+4 ; 0x12e18 12e14: 0c 94 18 a9 jmp 0x15230 ; 0x15230 iSel = code_value_uint8(); 12e18: 0e 94 40 55 call 0xaa80 ; 0xaa80 12e1c: 18 2f mov r17, r24 if (iSel>=max_sheets) 12e1e: 88 30 cpi r24, 0x08 ; 8 12e20: 10 f4 brcc .+4 ; 0x12e26 12e22: 0c 94 1d a9 jmp 0x1523a ; 0x1523a { SERIAL_PROTOCOLPGM("Invalid sheet ID. Allowed: 0.."); 12e26: 83 ef ldi r24, 0xF3 ; 243 12e28: 9e e7 ldi r25, 0x7E ; 126 12e2a: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 12e2e: 4a e0 ldi r20, 0x0A ; 10 12e30: 67 e0 ldi r22, 0x07 ; 7 12e32: 70 e0 ldi r23, 0x00 ; 0 12e34: 80 e0 ldi r24, 0x00 ; 0 12e36: 90 e0 ldi r25, 0x00 ; 0 12e38: 0f 94 eb 96 call 0x32dd6 ; 0x32dd6 SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); 12e3c: 8a ed ldi r24, 0xDA ; 218 12e3e: 92 e0 ldi r25, 0x02 ; 2 12e40: 0f 94 bc 99 call 0x33378 ; 0x33378 12e44: ec c0 rjmp .+472 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12e46: 84 38 cpi r24, 0x84 ; 132 12e48: a3 e0 ldi r26, 0x03 ; 3 12e4a: 9a 07 cpc r25, r26 12e4c: 11 f4 brne .+4 ; 0x12e52 12e4e: 0c 94 a8 ac jmp 0x15950 ; 0x15950 12e52: 0c f0 brlt .+2 ; 0x12e56 12e54: 4d c0 rjmp .+154 ; 0x12ef0 12e56: 8d 35 cpi r24, 0x5D ; 93 12e58: e3 e0 ldi r30, 0x03 ; 3 12e5a: 9e 07 cpc r25, r30 12e5c: 11 f4 brne .+4 ; 0x12e62 12e5e: 0c 94 bc aa jmp 0x15578 ; 0x15578 12e62: 8e 35 cpi r24, 0x5E ; 94 12e64: 93 40 sbci r25, 0x03 ; 3 12e66: 09 f0 breq .+2 ; 0x12e6a 12e68: e4 c9 rjmp .-3128 ; 0x12232 */ 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); 12e6a: 0e 94 03 5a call 0xb406 ; 0xb406 12e6e: 20 e0 ldi r18, 0x00 ; 0 12e70: 30 e0 ldi r19, 0x00 ; 0 12e72: 40 e2 ldi r20, 0x20 ; 32 12e74: 51 e4 ldi r21, 0x41 ; 65 12e76: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 12e7a: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 12e7e: 6c 5a subi r22, 0xAC ; 172 switch(nCommand) 12e80: 63 30 cpi r22, 0x03 ; 3 12e82: 11 f4 brne .+4 ; 0x12e88 12e84: 0c 94 c2 ab jmp 0x15784 ; 0x15784 12e88: 10 f0 brcs .+4 ; 0x12e8e 12e8a: 0c 94 54 ab jmp 0x156a8 ; 0x156a8 12e8e: 61 30 cpi r22, 0x01 ; 1 12e90: 11 f4 brne .+4 ; 0x12e96 12e92: 0c 94 7d ab jmp 0x156fa ; 0x156fa 12e96: 62 30 cpi r22, 0x02 ; 2 12e98: 09 f0 breq .+2 ; 0x12e9c 12e9a: c1 c0 rjmp .+386 ; 0x1301e ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 12e9c: 80 91 94 12 lds r24, 0x1294 ; 0x801294 return pgm_read_word(&_nPrinterMmuType); 12ea0: e7 e0 ldi r30, 0x07 ; 7 12ea2: f9 e7 ldi r31, 0x79 ; 121 ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 12ea4: 81 30 cpi r24, 0x01 ; 1 12ea6: 11 f0 breq .+4 ; 0x12eac return pgm_read_word(&_nPrinterMmuType); } else { return pgm_read_word(&_nPrinterType); 12ea8: e9 e0 ldi r30, 0x09 ; 9 12eaa: f9 e7 ldi r31, 0x79 ; 121 12eac: 05 91 lpm r16, Z+ 12eae: 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')) 12eb0: 80 e5 ldi r24, 0x50 ; 80 12eb2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12eb6: 88 23 and r24, r24 12eb8: 11 f4 brne .+4 ; 0x12ebe 12eba: 0c 94 b1 ab jmp 0x15762 ; 0x15762 { uint16_t nPrinterModel; nPrinterModel=(uint16_t)code_value_long(); 12ebe: 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) 12ec2: f0 90 b8 03 lds r15, 0x03B8 ; 0x8003b8 12ec6: ff 20 and r15, r15 12ec8: 09 f4 brne .+2 ; 0x12ecc 12eca: a9 c0 rjmp .+338 ; 0x1301e return; if (nPrinterModel == actualPrinterModel) 12ecc: 60 17 cp r22, r16 12ece: 71 07 cpc r23, r17 12ed0: 09 f4 brne .+2 ; 0x12ed4 12ed2: a5 c0 rjmp .+330 ; 0x1301e // SERIAL_ECHOLNPGM("Printer model differs from the G-code ..."); // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(actualPrinterModel); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nPrinterModel); render_M862_warnings( 12ed4: 89 e8 ldi r24, 0x89 ; 137 12ed6: 97 e3 ldi r25, 0x37 ; 55 12ed8: 0e 94 a7 6c call 0xd94e ; 0xd94e 12edc: 8c 01 movw r16, r24 12ede: 8b e5 ldi r24, 0x5B ; 91 12ee0: 97 e3 ldi r25, 0x37 ; 55 12ee2: 0e 94 a7 6c call 0xd94e ; 0xd94e 12ee6: 4f 2d mov r20, r15 12ee8: b8 01 movw r22, r16 12eea: 0e 94 19 f0 call 0x1e032 ; 0x1e032 12eee: 97 c0 rjmp .+302 ; 0x1301e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 12ef0: 8c 38 cpi r24, 0x8C ; 140 12ef2: 23 e0 ldi r18, 0x03 ; 3 12ef4: 92 07 cpc r25, r18 12ef6: 09 f4 brne .+2 ; 0x12efa 12ef8: 92 c0 rjmp .+292 ; 0x1301e 12efa: 80 3a cpi r24, 0xA0 ; 160 12efc: 33 e0 ldi r19, 0x03 ; 3 12efe: 93 07 cpc r25, r19 12f00: 09 f4 brne .+2 ; 0x12f04 12f02: 50 c2 rjmp .+1184 ; 0x133a4 12f04: 8b 38 cpi r24, 0x8B ; 139 12f06: 93 40 sbci r25, 0x03 ; 3 12f08: 09 f0 breq .+2 ; 0x12f0c 12f0a: 93 c9 rjmp .-3290 ; 0x12232 for(int i=0;i 12f12: 88 23 and r24, r24 12f14: 39 f0 breq .+14 ; 0x12f24 12f16: 0e 94 03 5a call 0xb406 ; 0xb406 12f1a: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 12f1e: 80 e0 ldi r24, 0x00 ; 0 12f20: 0f 94 1b 22 call 0x24436 ; 0x24436 #endif #ifdef MOTOR_CURRENT_PWM_Z_PIN if(code_seen('Z')) st_current_set(1, code_value()); 12f24: 8a e5 ldi r24, 0x5A ; 90 12f26: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12f2a: 88 23 and r24, r24 12f2c: 39 f0 breq .+14 ; 0x12f3c 12f2e: 0e 94 03 5a call 0xb406 ; 0xb406 12f32: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 12f36: 81 e0 ldi r24, 0x01 ; 1 12f38: 0f 94 1b 22 call 0x24436 ; 0x24436 #endif #ifdef MOTOR_CURRENT_PWM_E_PIN if(code_seen('E')) st_current_set(2, code_value()); 12f3c: 85 e4 ldi r24, 0x45 ; 69 12f3e: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12f42: 88 23 and r24, r24 12f44: 09 f4 brne .+2 ; 0x12f48 12f46: 6b c0 rjmp .+214 ; 0x1301e 12f48: 0e 94 03 5a call 0xb406 ; 0xb406 12f4c: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 12f50: cb 01 movw r24, r22 12f52: 0f 94 1b 21 call 0x24236 ; 0x24236 12f56: 63 c0 rjmp .+198 ; 0x1301e - `string` - Must for M1 and optional for M0 message to display on the LCD */ case 0: case 1: { const char *src = strchr_pointer + 2; 12f58: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 12f5c: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 12f60: 0e 5f subi r16, 0xFE ; 254 12f62: 1f 4f sbci r17, 0xFF ; 255 codenum = 0; if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 12f64: 80 e5 ldi r24, 0x50 ; 80 12f66: 0e 94 2b 55 call 0xaa56 ; 0xaa56 */ case 0: case 1: { const char *src = strchr_pointer + 2; codenum = 0; 12f6a: c1 2c mov r12, r1 12f6c: d1 2c mov r13, r1 12f6e: 76 01 movw r14, r12 if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 12f70: 88 23 and r24, r24 12f72: 21 f0 breq .+8 ; 0x12f7c 12f74: 0e 94 93 55 call 0xab26 ; 0xab26 12f78: 6b 01 movw r12, r22 12f7a: 7c 01 movw r14, r24 if (code_seen('S')) codenum = code_value_long() * 1000; // seconds to wait 12f7c: 83 e5 ldi r24, 0x53 ; 83 12f7e: 0e 94 2b 55 call 0xaa56 ; 0xaa56 12f82: 88 23 and r24, r24 12f84: 51 f0 breq .+20 ; 0x12f9a 12f86: 0e 94 93 55 call 0xab26 ; 0xab26 12f8a: 9b 01 movw r18, r22 12f8c: ac 01 movw r20, r24 12f8e: a8 ee ldi r26, 0xE8 ; 232 12f90: b3 e0 ldi r27, 0x03 ; 3 12f92: 0f 94 30 a1 call 0x34260 ; 0x34260 <__muluhisi3> 12f96: 6b 01 movw r12, r22 12f98: 7c 01 movw r14, r24 12f9a: c8 01 movw r24, r16 12f9c: 0f 5f subi r16, 0xFF ; 255 12f9e: 1f 4f sbci r17, 0xFF ; 255 bool expiration_time_set = bool(codenum); while (*src == ' ') ++src; 12fa0: dc 01 movw r26, r24 12fa2: 4c 91 ld r20, X 12fa4: 40 32 cpi r20, 0x20 ; 32 12fa6: c9 f3 breq .-14 ; 0x12f9a custom_message_type = CustomMsg::M0Wait; 12fa8: 26 e0 ldi r18, 0x06 ; 6 12faa: 20 93 c7 06 sts 0x06C7, r18 ; 0x8006c7 if (!expiration_time_set && *src != '\0') { 12fae: c1 14 cp r12, r1 12fb0: d1 04 cpc r13, r1 12fb2: e1 04 cpc r14, r1 12fb4: f1 04 cpc r15, r1 12fb6: c9 f5 brne .+114 ; 0x1302a 12fb8: 2c 91 ld r18, X 12fba: 22 23 and r18, r18 12fbc: b1 f1 breq .+108 ; 0x1302a lcd_setstatus(src); 12fbe: 0e 94 bb ef call 0x1df76 ; 0x1df76 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(); 12fc2: 0f 94 ce 22 call 0x2459c ; 0x2459c menu_set_block(MENU_BLOCK_STATUS_SCREEN_M0); 12fc6: 80 91 cd 11 lds r24, 0x11CD ; 0x8011cd 12fca: 84 60 ori r24, 0x04 ; 4 12fcc: 80 93 cd 11 sts 0x11CD, r24 ; 0x8011cd previous_millis_cmd.start(); 12fd0: 8a e4 ldi r24, 0x4A ; 74 12fd2: 93 e0 ldi r25, 0x03 ; 3 12fd4: 0f 94 29 12 call 0x22452 ; 0x22452 ::start()> if (expiration_time_set) { 12fd8: c1 14 cp r12, r1 12fda: d1 04 cpc r13, r1 12fdc: e1 04 cpc r14, r1 12fde: f1 04 cpc r15, r1 12fe0: d9 f1 breq .+118 ; 0x13058 codenum += _millis(); // keep track of when we started waiting 12fe2: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 12fe6: c6 0e add r12, r22 12fe8: d7 1e adc r13, r23 12fea: e8 1e adc r14, r24 12fec: f9 1e adc r15, r25 KEEPALIVE_STATE(PAUSED_FOR_USER); 12fee: 84 e0 ldi r24, 0x04 ; 4 12ff0: 80 93 78 02 sts 0x0278, r24 ; 0x800278 while(_millis() < codenum && !lcd_clicked()) { 12ff4: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 12ff8: 6c 15 cp r22, r12 12ffa: 7d 05 cpc r23, r13 12ffc: 8e 05 cpc r24, r14 12ffe: 9f 05 cpc r25, r15 13000: 10 f1 brcs .+68 ; 0x13046 delay_keep_alive(0); } KEEPALIVE_STATE(IN_HANDLER); 13002: 82 e0 ldi r24, 0x02 ; 2 13004: 80 93 78 02 sts 0x0278, r24 ; 0x800278 } else { marlin_wait_for_click(); } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); 13008: 80 91 cd 11 lds r24, 0x11CD ; 0x8011cd 1300c: 8b 7f andi r24, 0xFB ; 251 1300e: 80 93 cd 11 sts 0x11CD, r24 ; 0x8011cd if (IS_SD_PRINTING) 13012: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 13016: 88 23 and r24, r24 13018: 91 f1 breq .+100 ; 0x1307e custom_message_type = CustomMsg::Status; 1301a: 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; 1301e: 10 92 ab 0d sts 0x0DAB, r1 ; 0x800dab <_ZL17mcode_in_progress.lto_priv.493+0x1> 13022: 10 92 aa 0d sts 0x0DAA, r1 ; 0x800daa <_ZL17mcode_in_progress.lto_priv.493> 13026: 0c 94 34 84 jmp 0x10868 ; 0x10868 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){ 1302a: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1302e: 81 11 cpse r24, r1 13030: 07 c0 rjmp .+14 ; 0x13040 LCD_MESSAGERPGM(_T(MSG_USERWAIT)); 13032: 8e e7 ldi r24, 0x7E ; 126 13034: 99 e3 ldi r25, 0x39 ; 57 13036: 0e 94 a7 6c call 0xd94e ; 0xd94e 1303a: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 1303e: c1 cf rjmp .-126 ; 0x12fc2 } else { custom_message_type = CustomMsg::Status; // let the lcd display the name of the printed G-code file in farm mode 13040: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 13044: be cf rjmp .-132 ; 0x12fc2 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()) { 13046: 0e 94 8e 6b call 0xd71c ; 0xd71c 1304a: 81 11 cpse r24, r1 1304c: da cf rjmp .-76 ; 0x13002 delay_keep_alive(0); 1304e: 90 e0 ldi r25, 0x00 ; 0 13050: 80 e0 ldi r24, 0x00 ; 0 13052: 0e 94 45 7c call 0xf88a ; 0xf88a 13056: ce cf rjmp .-100 ; 0x12ff4 //! @brief Wait for click //! //! Set void marlin_wait_for_click() { int8_t busy_state_backup = busy_state; 13058: 10 91 78 02 lds r17, 0x0278 ; 0x800278 KEEPALIVE_STATE(PAUSED_FOR_USER); 1305c: 84 e0 ldi r24, 0x04 ; 4 1305e: 80 93 78 02 sts 0x0278, r24 ; 0x800278 lcd_consume_click(); 13062: 0e 94 89 6b call 0xd712 ; 0xd712 while(!lcd_clicked()) 13066: 0e 94 8e 6b call 0xd71c ; 0xd71c 1306a: 81 11 cpse r24, r1 1306c: 05 c0 rjmp .+10 ; 0x13078 { delay_keep_alive(0); 1306e: 90 e0 ldi r25, 0x00 ; 0 13070: 80 e0 ldi r24, 0x00 ; 0 13072: 0e 94 45 7c call 0xf88a ; 0xf88a 13076: f7 cf rjmp .-18 ; 0x13066 } KEEPALIVE_STATE(busy_state_backup); 13078: 10 93 78 02 sts 0x0278, r17 ; 0x800278 1307c: c5 cf rjmp .-118 ; 0x13008 } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); if (IS_SD_PRINTING) custom_message_type = CustomMsg::Status; else LCD_MESSAGERPGM(MSG_WELCOME); 1307e: 87 e6 ldi r24, 0x67 ; 103 13080: 9b e6 ldi r25, 0x6B ; 107 13082: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 13086: cb cf rjmp .-106 ; 0x1301e /*! ### M17 - Enable all axes M17: Enable/Power all stepper motors */ case 17: LCD_MESSAGERPGM(_T(MSG_NO_MOVE)); 13088: 83 e7 ldi r24, 0x73 ; 115 1308a: 99 e3 ldi r25, 0x39 ; 57 1308c: 0e 94 a7 6c call 0xd94e ; 0xd94e 13090: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 enable_x(); 13094: 17 98 cbi 0x02, 7 ; 2 enable_y(); 13096: 16 98 cbi 0x02, 6 ; 2 enable_z(); 13098: 15 98 cbi 0x02, 5 ; 2 enable_e0(); 1309a: 14 98 cbi 0x02, 4 ; 2 1309c: c0 cf rjmp .-128 ; 0x1301e /*! ### M21 - Init SD card M21: Initialize SD card */ case 21: card.mount(); 1309e: 81 e0 ldi r24, 0x01 ; 1 130a0: 0f 94 3c 4e call 0x29c78 ; 0x29c78 130a4: bc cf rjmp .-136 ; 0x1301e presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 130a6: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a mounted = false; 130aa: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b SERIAL_ECHO_START; 130ae: 81 e6 ldi r24, 0x61 ; 97 130b0: 9d e9 ldi r25, 0x9D ; 157 130b2: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 130b6: 89 ee ldi r24, 0xE9 ; 233 130b8: 97 e6 ldi r25, 0x67 ; 103 130ba: 0e 94 49 72 call 0xe492 ; 0xe492 130be: af cf rjmp .-162 ; 0x1301e /*! ### M24 - Start SD print M24: Start/resume SD print */ case 24: if (printingIsPaused()) 130c0: 0e 94 b3 60 call 0xc166 ; 0xc166 130c4: 88 23 and r24, r24 130c6: 19 f0 breq .+6 ; 0x130ce lcd_resume_print(); 130c8: 0e 94 8c ef call 0x1df18 ; 0x1df18 130cc: a8 cf rjmp .-176 ; 0x1301e else { if (!filament_presence_check()) { 130ce: 0e 94 2a f0 call 0x1e054 ; 0x1e054 130d2: 88 23 and r24, r24 130d4: 09 f4 brne .+2 ; 0x130d8 130d6: a3 cf rjmp .-186 ; 0x1301e 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); }; 130d8: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 130dc: 88 23 and r24, r24 130de: 61 f0 breq .+24 ; 0x130f8 // Print was aborted break; } if (!card.get_sdpos()) 130e0: 80 91 7e 16 lds r24, 0x167E ; 0x80167e 130e4: 90 91 7f 16 lds r25, 0x167F ; 0x80167f 130e8: a0 91 80 16 lds r26, 0x1680 ; 0x801680 130ec: b0 91 81 16 lds r27, 0x1681 ; 0x801681 130f0: 89 2b or r24, r25 130f2: 8a 2b or r24, r26 130f4: 8b 2b or r24, r27 130f6: 69 f4 brne .+26 ; 0x13112 { // A new print has started from scratch, reset stats failstats_reset_print(); 130f8: 0e 94 9e 55 call 0xab3c ; 0xab3c sdpos_atomic = 0; 130fc: 10 92 dc 11 sts 0x11DC, r1 ; 0x8011dc 13100: 10 92 dd 11 sts 0x11DD, r1 ; 0x8011dd 13104: 10 92 de 11 sts 0x11DE, r1 ; 0x8011de 13108: 10 92 df 11 sts 0x11DF, r1 ; 0x8011df 1310c: 80 e0 ldi r24, 0x00 ; 0 1310e: 0e 94 de 73 call 0xe7bc ; 0xe7bc } void CardReader::startFileprint() { if(mounted) 13112: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 13116: 88 23 and r24, r24 13118: 31 f0 breq .+12 ; 0x13126 { sdprinting = true; 1311a: 81 e0 ldi r24, 0x01 ; 1 1311c: 80 93 6a 13 sts 0x136A, r24 ; 0x80136a 13120: 85 e0 ldi r24, 0x05 ; 5 13122: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.367> la10c_reset(); #endif } card.startFileprint(); print_job_timer.start(); 13126: 0f 94 e2 20 call 0x241c4 ; 0x241c4 if (MMU2::mmu2.Enabled()) 1312a: 80 91 94 12 lds r24, 0x1294 ; 0x801294 1312e: 81 30 cpi r24, 0x01 ; 1 13130: 09 f0 breq .+2 ; 0x13134 13132: 75 cf rjmp .-278 ; 0x1301e { if (MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) 13134: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 13138: 88 23 and r24, r24 1313a: 09 f4 brne .+2 ; 0x1313e 1313c: 70 cf rjmp .-288 ; 0x1301e 1313e: 0e 94 f9 c3 call 0x187f2 ; 0x187f2 13142: 81 11 cpse r24, r1 13144: 6c cf rjmp .-296 ; 0x1301e { // Filament only half way into the PTFE. Unload the filament. MMU2::mmu2.unload(); 13146: 0f 94 52 6b call 0x2d6a4 ; 0x2d6a4 1314a: 69 cf rjmp .-302 ; 0x1301e #### Parameters - `S` - Index in bytes */ case 26: if(card.mounted && code_seen('S')) { 1314c: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 13150: 88 23 and r24, r24 13152: 09 f4 brne .+2 ; 0x13156 13154: 64 cf rjmp .-312 ; 0x1301e 13156: 83 e5 ldi r24, 0x53 ; 83 13158: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1315c: 88 23 and r24, r24 1315e: 09 f4 brne .+2 ; 0x13162 13160: 5e cf rjmp .-324 ; 0x1301e long index = code_value_long(); 13162: 0e 94 93 55 call 0xab26 ; 0xab26 13166: 6b 01 movw r12, r22 13168: 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);}; 1316a: c0 92 7e 16 sts 0x167E, r12 ; 0x80167e 1316e: d0 92 7f 16 sts 0x167F, r13 ; 0x80167f 13172: e0 92 80 16 sts 0x1680, r14 ; 0x801680 13176: f0 92 81 16 sts 0x1681, r15 ; 0x801681 1317a: 0f 94 b5 44 call 0x2896a ; 0x2896a 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; 1317e: c0 92 dc 11 sts 0x11DC, r12 ; 0x8011dc 13182: d0 92 dd 11 sts 0x11DD, r13 ; 0x8011dd 13186: e0 92 de 11 sts 0x11DE, r14 ; 0x8011de 1318a: f0 92 df 11 sts 0x11DF, r15 ; 0x8011df 1318e: 47 cf rjmp .-370 ; 0x1301e #### Parameters - `P` - Show full SFN path instead of LFN only. */ case 27: card.getStatus(code_seen('P')); 13190: 80 e5 ldi r24, 0x50 ; 80 13192: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13196: 18 2f mov r17, r24 return filesize; } void CardReader::getStatus(bool arg_P) { if (printingIsPaused()) 13198: 0e 94 b3 60 call 0xc166 ; 0xc166 1319c: 88 23 and r24, r24 1319e: 91 f0 breq .+36 ; 0x131c4 { if (saved_printing && (saved_printing_type == PowerPanic::PRINT_TYPE_SD)) 131a0: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 131a4: 88 23 and r24, r24 131a6: 49 f0 breq .+18 ; 0x131ba 131a8: 80 91 79 02 lds r24, 0x0279 ; 0x800279 131ac: 81 11 cpse r24, r1 131ae: 05 c0 rjmp .+10 ; 0x131ba SERIAL_PROTOCOLLNPGM("SD print paused"); 131b0: 8f e0 ldi r24, 0x0F ; 15 131b2: 9e e7 ldi r25, 0x7E ; 126 131b4: 0e 94 49 72 call 0xe492 ; 0xe492 131b8: 32 cf rjmp .-412 ; 0x1301e else SERIAL_PROTOCOLLNPGM("Print saved"); 131ba: 83 e0 ldi r24, 0x03 ; 3 131bc: 9e e7 ldi r25, 0x7E ; 126 131be: 0e 94 49 72 call 0xe492 ; 0xe492 131c2: 2d cf rjmp .-422 ; 0x1301e } else if (sdprinting) 131c4: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 131c8: 88 23 and r24, r24 131ca: 09 f4 brne .+2 ; 0x131ce 131cc: 4a c0 rjmp .+148 ; 0x13262 { if (arg_P) 131ce: 11 23 and r17, r17 131d0: e1 f1 breq .+120 ; 0x1324a { printAbsFilenameFast(); 131d2: 0f 94 3a 49 call 0x29274 ; 0x29274 SERIAL_PROTOCOLLN(); 131d6: 0f 94 bb 98 call 0x33176 ; 0x33176 } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); SERIAL_PROTOCOLRPGM(_N("SD printing byte "));////MSG_SD_PRINTING_BYTE 131da: 80 ee ldi r24, 0xE0 ; 224 131dc: 94 e6 ldi r25, 0x64 ; 100 131de: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 131e2: 60 91 7e 16 lds r22, 0x167E ; 0x80167e 131e6: 70 91 7f 16 lds r23, 0x167F ; 0x80167f 131ea: 80 91 80 16 lds r24, 0x1680 ; 0x801680 131ee: 90 91 81 16 lds r25, 0x1681 ; 0x801681 131f2: 4a e0 ldi r20, 0x0A ; 10 131f4: 0f 94 eb 96 call 0x32dd6 ; 0x32dd6 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 131f8: 8f e2 ldi r24, 0x2F ; 47 131fa: 0e 94 37 70 call 0xe06e ; 0xe06e } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 131fe: 60 91 77 16 lds r22, 0x1677 ; 0x801677 13202: 70 91 78 16 lds r23, 0x1678 ; 0x801678 13206: 80 91 79 16 lds r24, 0x1679 ; 0x801679 1320a: 90 91 7a 16 lds r25, 0x167A ; 0x80167a 1320e: 4a e0 ldi r20, 0x0A ; 10 13210: 0f 94 eb 96 call 0x32dd6 ; 0x32dd6 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 13214: 0f 94 bb 98 call 0x33176 ; 0x33176 SERIAL_PROTOCOL(sdpos); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(filesize); uint16_t time = print_job_timer.duration() / 60; 13218: 0f 94 f2 1c call 0x239e4 ; 0x239e4 1321c: 2c e3 ldi r18, 0x3C ; 60 1321e: 30 e0 ldi r19, 0x00 ; 0 13220: 40 e0 ldi r20, 0x00 ; 0 13222: 50 e0 ldi r21, 0x00 ; 0 13224: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> SERIAL_PROTOCOL((int)(time / 60)); 13228: c9 01 movw r24, r18 1322a: 6c e3 ldi r22, 0x3C ; 60 1322c: 70 e0 ldi r23, 0x00 ; 0 1322e: 0f 94 64 a1 call 0x342c8 ; 0x342c8 <__udivmodhi4> 13232: 8c 01 movw r16, r24 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 13234: 90 e0 ldi r25, 0x00 ; 0 13236: 80 e0 ldi r24, 0x00 ; 0 13238: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 1323c: 8a e3 ldi r24, 0x3A ; 58 1323e: 0e 94 37 70 call 0xe06e ; 0xe06e SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); 13242: c8 01 movw r24, r16 13244: 0f 94 62 42 call 0x284c4 ; 0x284c4 13248: ea ce rjmp .-556 ; 0x1301e { printAbsFilenameFast(); SERIAL_PROTOCOLLN(); } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); 1324a: 80 91 81 13 lds r24, 0x1381 ; 0x801381 1324e: 88 23 and r24, r24 13250: 29 f0 breq .+10 ; 0x1325c 13252: 81 e8 ldi r24, 0x81 ; 129 13254: 93 e1 ldi r25, 0x13 ; 19 13256: 0f 94 bc 99 call 0x33378 ; 0x33378 1325a: bf cf rjmp .-130 ; 0x131da 1325c: 8c e6 ldi r24, 0x6C ; 108 1325e: 93 e1 ldi r25, 0x13 ; 19 13260: fa cf rjmp .-12 ; 0x13256 SERIAL_PROTOCOL((int)(time / 60)); SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); } else SERIAL_PROTOCOLLNPGM("Not SD printing"); 13262: 83 ef ldi r24, 0xF3 ; 243 13264: 9d e7 ldi r25, 0x7D ; 125 13266: 0e 94 49 72 call 0xe492 ; 0xe492 1326a: d9 ce rjmp .-590 ; 0x1301e /*! ### M28 - Start SD write M28: Begin write to SD card */ case 28: card.openFileWrite(strchr_pointer+4); 1326c: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 13270: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 13274: 04 96 adiw r24, 0x04 ; 4 13276: 0f 94 e1 52 call 0x2a5c2 ; 0x2a5c2 1327a: d1 ce rjmp .-606 ; 0x1301e * 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; 1327c: ce 01 movw r24, r28 1327e: 01 96 adiw r24, 0x01 ; 1 13280: 0f 94 96 45 call 0x28b2c ; 0x28b2c 13284: 88 23 and r24, r24 13286: 09 f4 brne .+2 ; 0x1328a 13288: fe c8 rjmp .-3588 ; 0x12486 // cache directory entry d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 1328a: 61 e0 ldi r22, 0x01 ; 1 1328c: ce 01 movw r24, r28 1328e: 01 96 adiw r24, 0x01 ; 1 13290: 0f 94 5a 6f call 0x2deb4 ; 0x2deb4 if (!d) goto fail; 13294: 00 97 sbiw r24, 0x00 ; 0 13296: 09 f4 brne .+2 ; 0x1329a 13298: f6 c8 rjmp .-3604 ; 0x12486 // mark entry deleted d->name[0] = DIR_NAME_DELETED; 1329a: 25 ee ldi r18, 0xE5 ; 229 1329c: fc 01 movw r30, r24 1329e: 20 83 st Z, r18 // set this file closed type_ = FAT_FILE_TYPE_CLOSED; 132a0: 1c 82 std Y+4, r1 ; 0x04 // write entry to SD return vol_->cacheFlush(); 132a2: 0f 94 e6 36 call 0x26dcc ; 0x26dcc 132a6: 18 2f mov r17, r24 132a8: ef c8 rjmp .-3618 ; 0x12488 presort(); #endif } else { SERIAL_PROTOCOLPGM("Deletion failed, File: "); 132aa: 8d ec ldi r24, 0xCD ; 205 132ac: 9d e7 ldi r25, 0x7D ; 125 132ae: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 132b2: 8c a1 ldd r24, Y+36 ; 0x24 132b4: 9d a1 ldd r25, Y+37 ; 0x25 132b6: 0e 94 a0 7c call 0xf940 ; 0xf940 132ba: 8e e2 ldi r24, 0x2E ; 46 132bc: 0e 94 37 70 call 0xe06e ; 0xe06e } void MarlinSerial::println(char c, int base) { print(c, base); println(); 132c0: 0f 94 bb 98 call 0x33176 ; 0x33176 132c4: ac ce rjmp .-680 ; 0x1301e - `S` - Starting file offset */ case 32: { if(card.sdprinting) { 132c6: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 132ca: 81 11 cpse r24, r1 st_synchronize(); 132cc: 0f 94 ce 22 call 0x2459c ; 0x2459c } const char* namestartpos = (strchr(strchr_pointer + 4,'!')); //find ! to indicate filename string start. 132d0: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 132d4: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 132d8: 0c 5f subi r16, 0xFC ; 252 132da: 1f 4f sbci r17, 0xFF ; 255 132dc: 61 e2 ldi r22, 0x21 ; 33 132de: 70 e0 ldi r23, 0x00 ; 0 132e0: c8 01 movw r24, r16 132e2: 0f 94 f2 a6 call 0x34de4 ; 0x34de4 if(namestartpos==NULL) 132e6: 00 97 sbiw r24, 0x00 ; 0 132e8: 19 f0 breq .+6 ; 0x132f0 { namestartpos=strchr_pointer + 4; //default name position, 4 letters after the M } else namestartpos++; //to skip the '!' 132ea: 8c 01 movw r16, r24 132ec: 0f 5f subi r16, 0xFF ; 255 132ee: 1f 4f sbci r17, 0xFF ; 255 bool call_procedure=(code_seen('P')); 132f0: 80 e5 ldi r24, 0x50 ; 80 132f2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 132f6: f8 2e mov r15, r24 if(strchr_pointer>namestartpos) 132f8: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 132fc: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 13300: 08 17 cp r16, r24 13302: 19 07 cpc r17, r25 13304: 08 f4 brcc .+2 ; 0x13308 call_procedure=false; //false alert, 'P' found within filename 13306: f1 2c mov r15, r1 if( card.mounted ) 13308: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1330c: 88 23 and r24, r24 1330e: 09 f4 brne .+2 ; 0x13312 13310: 86 ce rjmp .-756 ; 0x1301e { card.openFileReadFilteredGcode(namestartpos,!call_procedure); 13312: 61 e0 ldi r22, 0x01 ; 1 13314: 6f 25 eor r22, r15 13316: c8 01 movw r24, r16 13318: 0f 94 c5 4c call 0x2998a ; 0x2998a if(code_seen('S')) 1331c: 83 e5 ldi r24, 0x53 ; 83 1331e: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13322: 88 23 and r24, r24 13324: 99 f0 breq .+38 ; 0x1334c if(strchr_pointer 1332a: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 1332e: 80 17 cp r24, r16 13330: 91 07 cpc r25, r17 13332: 60 f4 brcc .+24 ; 0x1334c card.setIndex(code_value_long()); 13334: 0e 94 93 55 call 0xab26 ; 0xab26 13338: 60 93 7e 16 sts 0x167E, r22 ; 0x80167e 1333c: 70 93 7f 16 sts 0x167F, r23 ; 0x80167f 13340: 80 93 80 16 sts 0x1680, r24 ; 0x801680 13344: 90 93 81 16 sts 0x1681, r25 ; 0x801681 13348: 0f 94 b5 44 call 0x2896a ; 0x2896a SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 1334c: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 13350: 88 23 and r24, r24 13352: 31 f0 breq .+12 ; 0x13360 { sdprinting = true; 13354: 81 e0 ldi r24, 0x01 ; 1 13356: 80 93 6a 13 sts 0x136A, r24 ; 0x80136a 1335a: 85 e0 ldi r24, 0x05 ; 5 1335c: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.367> card.startFileprint(); if(!call_procedure) 13360: f1 10 cpse r15, r1 13362: 5d ce rjmp .-838 ; 0x1301e 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); }; 13364: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 13368: 88 23 and r24, r24 1336a: 61 f0 breq .+24 ; 0x13384 { if(!card.get_sdpos()) 1336c: 80 91 7e 16 lds r24, 0x167E ; 0x80167e 13370: 90 91 7f 16 lds r25, 0x167F ; 0x80167f 13374: a0 91 80 16 lds r26, 0x1680 ; 0x801680 13378: b0 91 81 16 lds r27, 0x1681 ; 0x801681 1337c: 89 2b or r24, r25 1337e: 8a 2b or r24, r26 13380: 8b 2b or r24, r27 13382: 69 f4 brne .+26 ; 0x1339e { // A new print has started from scratch, reset stats failstats_reset_print(); 13384: 0e 94 9e 55 call 0xab3c ; 0xab3c sdpos_atomic = 0; 13388: 10 92 dc 11 sts 0x11DC, r1 ; 0x8011dc 1338c: 10 92 dd 11 sts 0x11DD, r1 ; 0x8011dd 13390: 10 92 de 11 sts 0x11DE, r1 ; 0x8011de 13394: 10 92 df 11 sts 0x11DF, r1 ; 0x8011df 13398: 80 e0 ldi r24, 0x00 ; 0 1339a: 0e 94 de 73 call 0xe7bc ; 0xe7bc #ifndef LA_NOCOMPAT la10c_reset(); #endif } print_job_timer.start(); // procedure calls count as normal print time. 1339e: 0f 94 e2 20 call 0x241c4 ; 0x241c4 133a2: 3d ce rjmp .-902 ; 0x1301e M928 [filename] */ case 928: card.openLogFile(strchr_pointer+5); 133a4: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 133a8: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 } } void CardReader::openLogFile(const char* name) { logging = true; 133ac: 21 e0 ldi r18, 0x01 ; 1 133ae: 20 93 69 13 sts 0x1369, r18 ; 0x801369 openFileWrite(name); 133b2: 05 96 adiw r24, 0x05 ; 5 133b4: 0f 94 e1 52 call 0x2a5c2 ; 0x2a5c2 133b8: 32 ce rjmp .-924 ; 0x1301e ### 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(); 133ba: 0f 94 f2 1c call 0x239e4 ; 0x239e4 int16_t sec, min; min = t / 60; sec = t % 60; 133be: 2c e3 ldi r18, 0x3C ; 60 133c0: 30 e0 ldi r19, 0x00 ; 0 133c2: 40 e0 ldi r20, 0x00 ; 0 133c4: 50 e0 ldi r21, 0x00 ; 0 133c6: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> sprintf_P(time, PSTR("%i min, %i sec"), min, sec); 133ca: 7f 93 push r23 133cc: 6f 93 push r22 133ce: 3f 93 push r19 133d0: 2f 93 push r18 133d2: 8f e4 ldi r24, 0x4F ; 79 133d4: 90 e8 ldi r25, 0x80 ; 128 133d6: 9f 93 push r25 133d8: 8f 93 push r24 133da: 8e 01 movw r16, r28 133dc: 0f 5f subi r16, 0xFF ; 255 133de: 1f 4f sbci r17, 0xFF ; 255 133e0: 1f 93 push r17 133e2: 0f 93 push r16 133e4: 0f 94 b2 9f call 0x33f64 ; 0x33f64 SERIAL_ECHO_START; 133e8: 81 e6 ldi r24, 0x61 ; 97 133ea: 9d e9 ldi r25, 0x9D ; 157 133ec: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLN(time); 133f0: c8 01 movw r24, r16 133f2: 0f 94 bc 99 call 0x33378 ; 0x33378 lcd_setstatus(time); 133f6: c8 01 movw r24, r16 133f8: 0e 94 bb ef call 0x1df76 ; 0x1df76 autotempShutdown(); 133fc: 0f b6 in r0, 0x3f ; 63 133fe: f8 94 cli 13400: de bf out 0x3e, r29 ; 62 13402: 0f be out 0x3f, r0 ; 63 13404: cd bf out 0x3d, r28 ; 61 13406: 0b ce rjmp .-1002 ; 0x1301e } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) fanSpeed = pin_status; #endif if (pin_number > -1) 13408: 17 fd sbrc r17, 7 1340a: 09 ce rjmp .-1006 ; 0x1301e 1340c: 80 c8 rjmp .-3840 ; 0x1250e ### 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); 1340e: 80 e1 ldi r24, 0x10 ; 16 13410: 0e 94 2e c6 call 0x18c5c ; 0x18c5c eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 13414: 81 ea ldi r24, 0xA1 ; 161 13416: 9d e0 ldi r25, 0x0D ; 13 13418: 0f 94 9b a0 call 0x34136 ; 0x34136 1341c: 4b e0 ldi r20, 0x0B ; 11 1341e: 84 9f mul r24, r20 13420: c0 01 movw r24, r0 13422: 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); 13424: 70 e0 ldi r23, 0x00 ; 0 13426: 60 e0 ldi r22, 0x00 ; 0 13428: 80 5b subi r24, 0xB0 ; 176 1342a: 92 4f sbci r25, 0xF2 ; 242 1342c: 0f 94 dd a0 call 0x341ba ; 0x341ba // Reset the skew and offset in both RAM and EEPROM. calibration_status_clear(CALIBRATION_STATUS_XYZ); 13430: 82 e0 ldi r24, 0x02 ; 2 13432: 0e 94 2e c6 call 0x18c5c ; 0x18c5c reset_bed_offset_and_skew(); 13436: 0f 94 3a 90 call 0x32074 ; 0x32074 // 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(); 1343a: 0f 94 1b 90 call 0x32036 ; 0x32036 1343e: ef cd rjmp .-1058 ; 0x1301e */ case 45: // M45: Prusa3D: bed skew and offset with manual Z up { int8_t verbosity_level = 0; bool only_Z = code_seen('Z'); 13440: 8a e5 ldi r24, 0x5A ; 90 13442: 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); 13446: 0e 94 90 c6 call 0x18d20 ; 0x18d20 1344a: e9 cd rjmp .-1070 ; 0x1301e SERIAL_PROTOCOL('.'); SERIAL_PROTOCOL(uint8_t(ip[2])); SERIAL_PROTOCOL('.'); SERIAL_PROTOCOLLN(uint8_t(ip[3])); } else { SERIAL_PROTOCOLPGM("?Toshiba FlashAir GetIP failed\n"); 1344c: 83 e1 ldi r24, 0x13 ; 19 1344e: 90 e8 ldi r25, 0x80 ; 128 13450: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 13454: e4 cd rjmp .-1080 ; 0x1301e } } else { SERIAL_PROTOCOLLNPGM("n/a"); 13456: 8f e0 ldi r24, 0x0F ; 15 13458: 90 e8 ldi r25, 0x80 ; 128 1345a: 0e 94 49 72 call 0xe492 ; 0xe492 1345e: df cd rjmp .-1090 ; 0x1301e /*! ### 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); 13460: 84 e0 ldi r24, 0x04 ; 4 13462: 80 93 78 02 sts 0x0278, r24 ; 0x800278 menu_back_if_clicked(); } void lcd_diag_show_end_stops() { lcd_clear(); 13466: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_consume_click(); 1346a: 0e 94 89 6b call 0xd712 ; 0xd712 for (;;) { manage_heater(); 1346e: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(true); 13472: 81 e0 ldi r24, 0x01 ; 1 13474: 0e 94 fe 79 call 0xf3fc ; 0xf3fc lcd_show_end_stops(); 13478: 0f 94 a6 0a call 0x2154c ; 0x2154c if (lcd_clicked()) { 1347c: 0e 94 8e 6b call 0xd71c ; 0xd71c 13480: 88 23 and r24, r24 13482: a9 f3 breq .-22 ; 0x1346e break; } } lcd_clear(); 13484: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_return_to_status(); 13488: 0e 94 6d fe call 0x1fcda ; 0x1fcda 1348c: c8 cd rjmp .-1136 ; 0x1301e 1348e: 10 92 cb 0d sts 0x0DCB, r1 ; 0x800dcb <_ZL13printer_state.lto_priv.367> 13492: c5 cd rjmp .-1142 ; 0x1301e break; default: break; } } else { printf_P(_N("PrinterState: %d\n"),uint8_t(GetPrinterState())); 13494: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.367> 13498: 1f 92 push r1 1349a: 8f 93 push r24 1349c: 88 e1 ldi r24, 0x18 ; 24 1349e: 96 e6 ldi r25, 0x66 ; 102 134a0: 9f 93 push r25 134a2: 8f 93 push r24 134a4: 0f 94 5d 9f call 0x33eba ; 0x33eba 134a8: 0f 90 pop r0 134aa: 0f 90 pop r0 134ac: 0f 90 pop r0 134ae: 0f 90 pop r0 134b0: b6 cd rjmp .-1172 ; 0x1301e - `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(); 134b2: 80 e5 ldi r24, 0x50 ; 80 134b4: 0e 94 2b 55 call 0xaa56 ; 0xaa56 134b8: 88 23 and r24, r24 134ba: 21 f0 breq .+8 ; 0x134c4 134bc: 0e 94 40 55 call 0xaa80 ; 0xaa80 134c0: 80 93 71 02 sts 0x0271, r24 ; 0x800271 if(code_seen('R')) print_time_remaining_normal = code_value(); 134c4: 82 e5 ldi r24, 0x52 ; 82 134c6: 0e 94 2b 55 call 0xaa56 ; 0xaa56 134ca: 88 23 and r24, r24 134cc: 41 f0 breq .+16 ; 0x134de 134ce: 0e 94 03 5a call 0xb406 ; 0xb406 134d2: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 134d6: 70 93 75 02 sts 0x0275, r23 ; 0x800275 134da: 60 93 74 02 sts 0x0274, r22 ; 0x800274 if(code_seen('Q')) print_percent_done_silent = code_value_uint8(); 134de: 81 e5 ldi r24, 0x51 ; 81 134e0: 0e 94 2b 55 call 0xaa56 ; 0xaa56 134e4: 88 23 and r24, r24 134e6: 21 f0 breq .+8 ; 0x134f0 134e8: 0e 94 40 55 call 0xaa80 ; 0xaa80 134ec: 80 93 3f 02 sts 0x023F, r24 ; 0x80023f if(code_seen('S')) print_time_remaining_silent = code_value(); 134f0: 83 e5 ldi r24, 0x53 ; 83 134f2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 134f6: 88 23 and r24, r24 134f8: 41 f0 breq .+16 ; 0x1350a 134fa: 0e 94 03 5a call 0xb406 ; 0xb406 134fe: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 13502: 70 93 3e 02 sts 0x023E, r23 ; 0x80023e 13506: 60 93 3d 02 sts 0x023D, r22 ; 0x80023d if(code_seen('C')){ 1350a: 83 e4 ldi r24, 0x43 ; 67 1350c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13510: 88 23 and r24, r24 13512: a9 f0 breq .+42 ; 0x1353e float print_time_to_change_normal_f = code_value(); 13514: 0e 94 03 5a call 0xb406 ; 0xb406 13518: 6b 01 movw r12, r22 1351a: 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; 1351c: 20 e0 ldi r18, 0x00 ; 0 1351e: 30 e0 ldi r19, 0x00 ; 0 13520: a9 01 movw r20, r18 13522: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 13526: 6f ef ldi r22, 0xFF ; 255 13528: 7f ef ldi r23, 0xFF ; 255 1352a: 18 16 cp r1, r24 1352c: 24 f4 brge .+8 ; 0x13536 1352e: c7 01 movw r24, r14 13530: b6 01 movw r22, r12 13532: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 13536: 70 93 73 02 sts 0x0273, r23 ; 0x800273 1353a: 60 93 72 02 sts 0x0272, r22 ; 0x800272 } if(code_seen('D')){ 1353e: 84 e4 ldi r24, 0x44 ; 68 13540: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13544: 88 23 and r24, r24 13546: a9 f0 breq .+42 ; 0x13572 float print_time_to_change_silent_f = code_value(); 13548: 0e 94 03 5a call 0xb406 ; 0xb406 1354c: 6b 01 movw r12, r22 1354e: 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; 13550: 20 e0 ldi r18, 0x00 ; 0 13552: 30 e0 ldi r19, 0x00 ; 0 13554: a9 01 movw r20, r18 13556: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1355a: 6f ef ldi r22, 0xFF ; 255 1355c: 7f ef ldi r23, 0xFF ; 255 1355e: 18 16 cp r1, r24 13560: 24 f4 brge .+8 ; 0x1356a 13562: c7 01 movw r24, r14 13564: b6 01 movw r22, r12 13566: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 1356a: 70 93 3c 02 sts 0x023C, r23 ; 0x80023c 1356e: 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); 13572: 80 91 73 02 lds r24, 0x0273 ; 0x800273 13576: 8f 93 push r24 13578: 80 91 72 02 lds r24, 0x0272 ; 0x800272 1357c: 8f 93 push r24 1357e: 80 91 75 02 lds r24, 0x0275 ; 0x800275 13582: 8f 93 push r24 13584: 80 91 74 02 lds r24, 0x0274 ; 0x800274 13588: 8f 93 push r24 1358a: 80 91 71 02 lds r24, 0x0271 ; 0x800271 1358e: 28 2f mov r18, r24 13590: 08 2e mov r0, r24 13592: 00 0c add r0, r0 13594: 33 0b sbc r19, r19 13596: 3f 93 push r19 13598: 8f 93 push r24 1359a: 8e eb ldi r24, 0xBE ; 190 1359c: 95 e6 ldi r25, 0x65 ; 101 1359e: 9f 93 push r25 135a0: 8f 93 push r24 135a2: 05 ec ldi r16, 0xC5 ; 197 135a4: 15 e6 ldi r17, 0x65 ; 101 135a6: 1f 93 push r17 135a8: 0f 93 push r16 135aa: 0f 94 5d 9f call 0x33eba ; 0x33eba printf_P(_msg_mode_done_remain, _N("SILENT"), int8_t(print_percent_done_silent), print_time_remaining_silent, print_time_to_change_silent); 135ae: 80 91 3c 02 lds r24, 0x023C ; 0x80023c 135b2: 8f 93 push r24 135b4: 80 91 3b 02 lds r24, 0x023B ; 0x80023b 135b8: 8f 93 push r24 135ba: 80 91 3e 02 lds r24, 0x023E ; 0x80023e 135be: 8f 93 push r24 135c0: 80 91 3d 02 lds r24, 0x023D ; 0x80023d 135c4: 8f 93 push r24 135c6: 80 91 3f 02 lds r24, 0x023F ; 0x80023f 135ca: 28 2f mov r18, r24 135cc: 08 2e mov r0, r24 135ce: 00 0c add r0, r0 135d0: 33 0b sbc r19, r19 135d2: 3f 93 push r19 135d4: 8f 93 push r24 135d6: 87 eb ldi r24, 0xB7 ; 183 135d8: 95 e6 ldi r25, 0x65 ; 101 135da: 9f 93 push r25 135dc: 8f 93 push r24 135de: 1f 93 push r17 135e0: 0f 93 push r16 135e2: 0f 94 5d 9f call 0x33eba ; 0x33eba 135e6: 0f b6 in r0, 0x3f ; 63 135e8: f8 94 cli 135ea: de bf out 0x3e, r29 ; 62 135ec: 0f be out 0x3f, r0 ; 63 135ee: cd bf out 0x3d, r28 ; 61 135f0: 16 cd rjmp .-1492 ; 0x1301e /*! ### M75 - Start the print job timer M75: Start the print job timer */ case 75: { if (!filament_presence_check()) { 135f2: 0e 94 2a f0 call 0x1e054 ; 0x1e054 135f6: 88 23 and r24, r24 135f8: 09 f4 brne .+2 ; 0x135fc 135fa: 11 cd rjmp .-1502 ; 0x1301e 135fc: d0 ce rjmp .-608 ; 0x1339e } else return false; } bool Stopwatch::pause() { if (isRunning()) { 135fe: 80 91 59 03 lds r24, 0x0359 ; 0x800359 13602: 81 30 cpi r24, 0x01 ; 1 13604: 09 f0 breq .+2 ; 0x13608 13606: 0b cd rjmp .-1514 ; 0x1301e state = PAUSED; 13608: 82 e0 ldi r24, 0x02 ; 2 1360a: 80 93 59 03 sts 0x0359, r24 ; 0x800359 stopTimestamp = _millis(); 1360e: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 13612: 60 93 78 06 sts 0x0678, r22 ; 0x800678 13616: 70 93 79 06 sts 0x0679, r23 ; 0x800679 1361a: 80 93 7a 06 sts 0x067A, r24 ; 0x80067a 1361e: 90 93 7b 06 sts 0x067B, r25 ; 0x80067b 13622: fd cc rjmp .-1542 ; 0x1301e /*! ### M77 - Stop the print job timer M77: Stop the print job timer */ case 77: { print_job_timer.stop(); 13624: 0f 94 06 21 call 0x2420c ; 0x2420c save_statistics(); 13628: 0e 94 2e 5f call 0xbe5c ; 0xbe5c 1362c: f8 cc rjmp .-1552 ; 0x1301e _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')) { 1362e: 83 e5 ldi r24, 0x53 ; 83 13630: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13634: 88 23 and r24, r24 13636: 51 f0 breq .+20 ; 0x1364c eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, code_value()); 13638: 0e 94 03 5a call 0xb406 ; 0xb406 1363c: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 13640: ab 01 movw r20, r22 13642: 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); 13644: 81 ef ldi r24, 0xF1 ; 241 13646: 9f e0 ldi r25, 0x0F ; 15 13648: 0f 94 d1 a0 call 0x341a2 ; 0x341a2 } if (code_seen('T')) { 1364c: 84 e5 ldi r24, 0x54 ; 84 1364e: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13652: 88 23 and r24, r24 13654: 51 f0 breq .+20 ; 0x1366a eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, code_value()); 13656: 0e 94 03 5a call 0xb406 ; 0xb406 1365a: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 1365e: ab 01 movw r20, r22 13660: bc 01 movw r22, r24 13662: 8d ee ldi r24, 0xED ; 237 13664: 9f e0 ldi r25, 0x0F ; 15 13666: 0f 94 d1 a0 call 0x341a2 ; 0x341a2 } _m_fil = _O(MSG_TOTAL_FILAMENT); _m_time = _O(MSG_TOTAL_PRINT_TIME); _cm = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); 1366a: 81 ef ldi r24, 0xF1 ; 241 1366c: 9f e0 ldi r25, 0x0F ; 15 1366e: 0f 94 a3 a0 call 0x34146 ; 0x34146 13672: 16 2f mov r17, r22 13674: 07 2f mov r16, r23 13676: f8 2e mov r15, r24 13678: e9 2e mov r14, r25 _min = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); 1367a: 8d ee ldi r24, 0xED ; 237 1367c: 9f e0 ldi r25, 0x0F ; 15 1367e: 0f 94 a3 a0 call 0x34146 ; 0x34146 } 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); 13682: 42 ef ldi r20, 0xF2 ; 242 13684: 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); 13686: 21 ee ldi r18, 0xE1 ; 225 13688: 3a e4 ldi r19, 0x4A ; 74 1368a: 0c 94 27 93 jmp 0x1264e ; 0x1264e void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); } void M79_timer_restart() { M79_timer.start(); 1368e: 8a e5 ldi r24, 0x5A ; 90 13690: 93 e0 ldi r25, 0x03 ; 3 13692: 0f 94 29 12 call 0x22452 ; 0x22452 ::start()> - `S` - Quoted string containing two characters e.g. "PL" */ case 79: M79_timer_restart(); if (code_seen('S')) 13696: 83 e5 ldi r24, 0x53 ; 83 13698: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1369c: 88 23 and r24, r24 1369e: 09 f1 breq .+66 ; 0x136e2 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 136a0: 62 e2 ldi r22, 0x22 ; 34 136a2: 70 e0 ldi r23, 0x00 ; 0 136a4: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 136a8: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 136ac: 0f 94 f2 a6 call 0x34de4 ; 0x34de4 136b0: 8c 01 movw r16, r24 if (!this->ptr) { 136b2: 89 2b or r24, r25 136b4: b1 f0 breq .+44 ; 0x136e2 // First quote not found return; } // Skip the leading quote this->ptr++; 136b6: 0f 5f subi r16, 0xFF ; 255 136b8: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 136ba: 62 e2 ldi r22, 0x22 ; 34 136bc: 70 e0 ldi r23, 0x00 ; 0 136be: c8 01 movw r24, r16 136c0: 0f 94 f2 a6 call 0x34de4 ; 0x34de4 if(!pStrEnd) { 136c4: 89 2b or r24, r25 136c6: 69 f0 breq .+26 ; 0x136e2 char * GetHostStatusScreenName() { return host_status_screen_name; } void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); 136c8: e2 e7 ldi r30, 0x72 ; 114 136ca: f6 e0 ldi r31, 0x06 ; 6 136cc: 83 e0 ldi r24, 0x03 ; 3 136ce: df 01 movw r26, r30 136d0: 1d 92 st X+, r1 136d2: 8a 95 dec r24 136d4: e9 f7 brne .-6 ; 0x136d0 static LongTimer M79_timer; static char host_status_screen_name[3]; void SetHostStatusScreenName(const char * name) { strncpy(host_status_screen_name, name, 2); 136d6: 42 e0 ldi r20, 0x02 ; 2 136d8: 50 e0 ldi r21, 0x00 ; 0 136da: b8 01 movw r22, r16 136dc: cf 01 movw r24, r30 136de: 0f 94 1b a7 call 0x34e36 ; 0x34e36 } #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 136e2: 8c e8 ldi r24, 0x8C ; 140 136e4: 9f e0 ldi r25, 0x0F ; 15 136e6: 0f 94 9b a0 call 0x34136 ; 0x34136 && printer_recovering() && printingIsPaused()) { 136ea: 81 30 cpi r24, 0x01 ; 1 136ec: 09 f0 breq .+2 ; 0x136f0 136ee: 97 cc rjmp .-1746 ; 0x1301e #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() 136f0: 0e 94 a9 60 call 0xc152 ; 0xc152 136f4: 88 23 and r24, r24 136f6: 09 f4 brne .+2 ; 0x136fa 136f8: 92 cc rjmp .-1756 ; 0x1301e && printingIsPaused()) { 136fa: 0e 94 b3 60 call 0xc166 ; 0xc166 136fe: 88 23 and r24, r24 13700: 09 f4 brne .+2 ; 0x13704 13702: 8d cc rjmp .-1766 ; 0x1301e // 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); 13704: 84 e8 ldi r24, 0x84 ; 132 13706: 95 e6 ldi r25, 0x65 ; 101 13708: 0e 94 49 72 call 0xe492 ; 0xe492 1370c: 88 cc rjmp .-1776 ; 0x1301e /*! ### M112 - Emergency stop M112: Full (Emergency) Stop It is processed much earlier as to bypass the cmdqueue. */ case 112: kill(MSG_M112_KILL); 1370e: 87 e6 ldi r24, 0x67 ; 103 13710: 95 e6 ldi r25, 0x65 ; 101 13712: 0e 94 d5 72 call 0xe5aa ; 0xe5aa #### Parameters - `S` - Target temperature */ case 140: if (code_seen('S')) setTargetBed(code_value()); 13716: 83 e5 ldi r24, 0x53 ; 83 13718: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1371c: 88 23 and r24, r24 1371e: 09 f4 brne .+2 ; 0x13722 13720: 7e cc rjmp .-1796 ; 0x1301e 13722: 0e 94 03 5a call 0xb406 ; 0xb406 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 13726: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 1372a: 70 93 ee 11 sts 0x11EE, r23 ; 0x8011ee 1372e: 60 93 ed 11 sts 0x11ED, r22 ; 0x8011ed 13732: 75 cc rjmp .-1814 ; 0x1301e 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 "); 13734: 8b e0 ldi r24, 0x0B ; 11 13736: 90 e8 ldi r25, 0x80 ; 128 13738: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 gcode_M105(); 1373c: 0e 94 c2 71 call 0xe384 ; 0xe384 cmdqueue_pop_front(); //prevent an ok after the command since this command uses an ok at the beginning. 13740: 0e 94 c9 6f call 0xdf92 ; 0xdf92 cmdbuffer_front_already_processed = true; 13744: 81 e0 ldi r24, 0x01 ; 1 13746: 80 93 e6 11 sts 0x11E6, r24 ; 0x8011e6 1374a: 69 cc rjmp .-1838 ; 0x1301e bit 6 = free bit 7 = free */ case 155: { if (code_seen('S')){ 1374c: 83 e5 ldi r24, 0x53 ; 83 1374e: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13752: 88 23 and r24, r24 13754: 51 f0 breq .+20 ; 0x1376a autoReportFeatures.SetPeriod( code_value_uint8() ); 13756: 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; 1375a: 80 93 62 13 sts 0x1362, r24 ; 0x801362 if (auto_report_period != 0){ 1375e: 88 23 and r24, r24 13760: 71 f0 breq .+28 ; 0x1377e auto_report_timer.start(); 13762: 83 e6 ldi r24, 0x63 ; 99 13764: 93 e1 ldi r25, 0x13 ; 19 13766: 0f 94 29 12 call 0x22452 ; 0x22452 ::start()> case 155: { if (code_seen('S')){ autoReportFeatures.SetPeriod( code_value_uint8() ); } if (code_seen('C')){ 1376a: 83 e4 ldi r24, 0x43 ; 67 1376c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13770: 88 23 and r24, r24 13772: 41 f0 breq .+16 ; 0x13784 autoReportFeatures.SetMask(code_value_uint8()); 13774: 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; } 13778: 80 93 61 13 sts 0x1361, r24 ; 0x801361 1377c: 50 cc rjmp .-1888 ; 0x1301e 1377e: 10 92 63 13 sts 0x1363, r1 ; 0x801363 13782: f3 cf rjmp .-26 ; 0x1376a 13784: 81 e0 ldi r24, 0x01 ; 1 13786: 80 93 61 13 sts 0x1361, r24 ; 0x801361 1378a: 49 cc rjmp .-1902 ; 0x1301e 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)); 1378c: 89 eb ldi r24, 0xB9 ; 185 1378e: 98 e4 ldi r25, 0x48 ; 72 13790: 0e 94 a7 6c call 0xd94e ; 0xd94e 13794: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 heating_status = HeatingStatus::EXTRUDER_HEATING; 13798: 81 e0 ldi r24, 0x01 ; 1 1379a: 80 93 99 03 sts 0x0399, r24 ; 0x800399 prusa_statistics(1); 1379e: 0f 94 be 98 call 0x3317c ; 0x3317c #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { 137a2: 83 e5 ldi r24, 0x53 ; 83 137a4: 0e 94 2b 55 call 0xaa56 ; 0xaa56 137a8: 88 23 and r24, r24 137aa: 49 f0 breq .+18 ; 0x137be setTargetHotend(code_value()); } else if (code_seen('R')) { setTargetHotend(code_value()); 137ac: 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; 137b0: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 137b4: 70 93 f2 11 sts 0x11F2, r23 ; 0x8011f2 137b8: 60 93 f1 11 sts 0x11F1, r22 ; 0x8011f1 137bc: 05 c0 rjmp .+10 ; 0x137c8 #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { setTargetHotend(code_value()); } else if (code_seen('R')) { 137be: 82 e5 ldi r24, 0x52 ; 82 137c0: 0e 94 2b 55 call 0xaa56 ; 0xaa56 137c4: 81 11 cpse r24, r1 137c6: f2 cf rjmp .-28 ; 0x137ac autotemp_factor=code_value(); autotemp_enabled=true; } #endif codenum = _millis(); 137c8: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 137cc: 6b 01 movw r12, r22 137ce: 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]; 137d0: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 137d4: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 137d8: 07 2e mov r0, r23 137da: 00 0c add r0, r0 137dc: 88 0b sbc r24, r24 137de: 99 0b sbc r25, r25 137e0: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 137e4: 11 e0 ldi r17, 0x01 ; 1 137e6: 20 91 c4 0d lds r18, 0x0DC4 ; 0x800dc4 137ea: 30 91 c5 0d lds r19, 0x0DC5 ; 0x800dc5 137ee: 40 91 c6 0d lds r20, 0x0DC6 ; 0x800dc6 137f2: 50 91 c7 0d lds r21, 0x0DC7 ; 0x800dc7 137f6: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 137fa: 18 16 cp r1, r24 137fc: 0c f0 brlt .+2 ; 0x13800 137fe: 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 13800: 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 13804: c7 01 movw r24, r14 13806: b6 01 movw r22, r12 13808: 0f 94 57 4f call 0x29eae ; 0x29eae LCD_MESSAGERPGM(_T(MSG_HEATING_COMPLETE)); 1380c: 89 ea ldi r24, 0xA9 ; 169 1380e: 98 e4 ldi r25, 0x48 ; 72 13810: 0e 94 a7 6c call 0xd94e ; 0xd94e 13814: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; 13818: 82 e0 ldi r24, 0x02 ; 2 1381a: 80 93 99 03 sts 0x0399, r24 ; 0x800399 prusa_statistics(2); 1381e: 0f 94 be 98 call 0x3317c ; 0x3317c previous_millis_cmd.start(); 13822: 8a e4 ldi r24, 0x4A ; 74 13824: 93 e0 ldi r25, 0x03 ; 3 13826: 0f 94 29 12 call 0x22452 ; 0x22452 ::start()> 1382a: f9 cb rjmp .-2062 ; 0x1301e */ case 190: #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 { bool CooldownNoWait = false; LCD_MESSAGERPGM(_T(MSG_BED_HEATING)); 1382c: 8b e9 ldi r24, 0x9B ; 155 1382e: 98 e4 ldi r25, 0x48 ; 72 13830: 0e 94 a7 6c call 0xd94e ; 0xd94e 13834: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 heating_status = HeatingStatus::BED_HEATING; 13838: 83 e0 ldi r24, 0x03 ; 3 1383a: 80 93 99 03 sts 0x0399, r24 ; 0x800399 prusa_statistics(1); 1383e: 81 e0 ldi r24, 0x01 ; 1 13840: 0f 94 be 98 call 0x3317c ; 0x3317c if (code_seen('S')) 13844: 83 e5 ldi r24, 0x53 ; 83 13846: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1384a: 18 2f mov r17, r24 1384c: 88 23 and r24, r24 1384e: 49 f0 breq .+18 ; 0x13862 setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) { setTargetBed(code_value()); 13850: 0e 94 03 5a call 0xb406 ; 0xb406 target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 13854: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 13858: 70 93 ee 11 sts 0x11EE, r23 ; 0x8011ee 1385c: 60 93 ed 11 sts 0x11ED, r22 ; 0x8011ed 13860: 05 c0 rjmp .+10 ; 0x1386c if (code_seen('S')) { setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) 13862: 82 e5 ldi r24, 0x52 ; 82 13864: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13868: 81 11 cpse r24, r1 1386a: f2 cf rjmp .-28 ; 0x13850 { setTargetBed(code_value()); } codenum = _millis(); 1386c: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 13870: 6b 01 movw r12, r22 13872: 7c 01 movw r14, r24 cancel_heatup = false; 13874: 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; 13878: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 1387c: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee 13880: 07 2e mov r0, r23 13882: 00 0c add r0, r0 13884: 88 0b sbc r24, r24 13886: 99 0b sbc r25, r25 13888: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 1388c: 01 e0 ldi r16, 0x01 ; 1 1388e: 20 91 8a 03 lds r18, 0x038A ; 0x80038a 13892: 30 91 8b 03 lds r19, 0x038B ; 0x80038b 13896: 40 91 8c 03 lds r20, 0x038C ; 0x80038c 1389a: 50 91 8d 03 lds r21, 0x038D ; 0x80038d 1389e: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 138a2: 18 16 cp r1, r24 138a4: 0c f0 brlt .+2 ; 0x138a8 138a6: 00 e0 ldi r16, 0x00 ; 0 target_direction = isHeatingBed(); // true if heating, false if cooling 138a8: 00 93 c3 0d sts 0x0DC3, r16 ; 0x800dc3 <_ZL16target_direction.lto_priv.494> while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 138ac: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.377> 138b0: 81 11 cpse r24, r1 138b2: 1a c0 rjmp .+52 ; 0x138e8 138b4: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 138b8: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee 138bc: 07 2e mov r0, r23 138be: 00 0c add r0, r0 138c0: 88 0b sbc r24, r24 138c2: 99 0b sbc r25, r25 138c4: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 138c8: 20 91 8a 03 lds r18, 0x038A ; 0x80038a 138cc: 30 91 8b 03 lds r19, 0x038B ; 0x80038b 138d0: 40 91 8c 03 lds r20, 0x038C ; 0x80038c 138d4: 50 91 8d 03 lds r21, 0x038D ; 0x80038d 138d8: e0 91 c3 0d lds r30, 0x0DC3 ; 0x800dc3 <_ZL16target_direction.lto_priv.494> 138dc: ee 23 and r30, r30 138de: 91 f0 breq .+36 ; 0x13904 138e0: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 138e4: 18 16 cp r1, r24 138e6: a4 f0 brlt .+40 ; 0x13910 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(_T(MSG_BED_DONE)); 138e8: 80 e9 ldi r24, 0x90 ; 144 138ea: 98 e4 ldi r25, 0x48 ; 72 138ec: 0e 94 a7 6c call 0xd94e ; 0xd94e 138f0: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 heating_status = HeatingStatus::BED_HEATING_COMPLETE; 138f4: 84 e0 ldi r24, 0x04 ; 4 138f6: 80 93 99 03 sts 0x0399, r24 ; 0x800399 previous_millis_cmd.start(); 138fa: 8a e4 ldi r24, 0x4A ; 74 138fc: 93 e0 ldi r25, 0x03 ; 3 138fe: 0f 94 29 12 call 0x22452 ; 0x22452 ::start()> 13902: 8d cb rjmp .-2278 ; 0x1301e codenum = _millis(); cancel_heatup = false; target_direction = isHeatingBed(); // true if heating, false if cooling while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 13904: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 13908: 87 ff sbrs r24, 7 1390a: ee cf rjmp .-36 ; 0x138e8 1390c: 11 11 cpse r17, r1 1390e: ec cf rjmp .-40 ; 0x138e8 { if (lcd_commands_type == LcdCommands::LongPause) { 13910: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 13914: 82 30 cpi r24, 0x02 ; 2 13916: 41 f3 breq .-48 ; 0x138e8 // 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. 13918: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 1391c: 6c 19 sub r22, r12 1391e: 7d 09 sbc r23, r13 13920: 8e 09 sbc r24, r14 13922: 9f 09 sbc r25, r15 13924: 69 3e cpi r22, 0xE9 ; 233 13926: 73 40 sbci r23, 0x03 ; 3 13928: 81 05 cpc r24, r1 1392a: 91 05 cpc r25, r1 1392c: 50 f0 brcs .+20 ; 0x13942 { if (!farm_mode) { 1392e: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 13932: 81 11 cpse r24, r1 13934: 02 c0 rjmp .+4 ; 0x1393a serialecho_temperatures(); 13936: 0e 94 5e 70 call 0xe0bc ; 0xe0bc } codenum = _millis(); 1393a: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 1393e: 6b 01 movw r12, r22 13940: 7c 01 movw r14, r24 } manage_heater(); 13942: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(); 13946: 80 e0 ldi r24, 0x00 ; 0 13948: 0e 94 fe 79 call 0xf3fc ; 0xf3fc lcd_update(0); 1394c: 80 e0 ldi r24, 0x00 ; 0 1394e: 0e 94 38 69 call 0xd270 ; 0xd270 13952: ac cf rjmp .-168 ; 0x138ac #### 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')){ 13954: 83 e5 ldi r24, 0x53 ; 83 13956: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1395a: 88 23 and r24, r24 1395c: 29 f0 breq .+10 ; 0x13968 fanSpeed = code_value_uint8(); 1395e: 0e 94 40 55 call 0xaa80 ; 0xaa80 13962: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 13966: 5b cb rjmp .-2378 ; 0x1301e } else { fanSpeed = 255; 13968: 8f ef ldi r24, 0xFF ; 255 1396a: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 1396e: 57 cb rjmp .-2386 ; 0x1301e /*! ### M107 - Fan off M107: Fan Off */ case 107: fanSpeed = 0; 13970: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 13974: 54 cb rjmp .-2392 ; 0x1301e /*! ### 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; 13976: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb 1397a: 87 7f andi r24, 0xF7 ; 247 1397c: 80 93 eb 11 sts 0x11EB, r24 ; 0x8011eb 13980: 4e cb rjmp .-2404 ; 0x1301e ### M18 - Disable steppers M18: Disable all stepper motors Equal to M84 (compatibility) */ case 18: //compatibility case 84: // M84 if(code_seen('S')){ 13982: 83 e5 ldi r24, 0x53 ; 83 13984: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13988: 88 23 and r24, r24 1398a: 99 f0 breq .+38 ; 0x139b2 stepper_inactive_time = code_value() * 1000; 1398c: 0e 94 03 5a call 0xb406 ; 0xb406 13990: 20 e0 ldi r18, 0x00 ; 0 13992: 30 e0 ldi r19, 0x00 ; 0 13994: 4a e7 ldi r20, 0x7A ; 122 13996: 54 e4 ldi r21, 0x44 ; 68 13998: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1399c: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 139a0: 60 93 37 02 sts 0x0237, r22 ; 0x800237 139a4: 70 93 38 02 sts 0x0238, r23 ; 0x800238 139a8: 80 93 39 02 sts 0x0239, r24 ; 0x800239 139ac: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 139b0: 36 cb rjmp .-2452 ; 0x1301e } 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]))); 139b2: 88 e5 ldi r24, 0x58 ; 88 139b4: 0e 94 2b 55 call 0xaa56 ; 0xaa56 139b8: 88 23 and r24, r24 139ba: d1 f0 breq .+52 ; 0x139f0 disable_e0(); finishAndDisableSteppers(); } else { st_synchronize(); 139bc: 0f 94 ce 22 call 0x2459c ; 0x2459c if (code_seen('X')) disable_x(); 139c0: 88 e5 ldi r24, 0x58 ; 88 139c2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 139c6: 81 11 cpse r24, r1 139c8: 28 c0 rjmp .+80 ; 0x13a1a if (code_seen('Y')) disable_y(); 139ca: 89 e5 ldi r24, 0x59 ; 89 139cc: 0e 94 2b 55 call 0xaa56 ; 0xaa56 139d0: 88 23 and r24, r24 139d2: 19 f0 breq .+6 ; 0x139da 139d4: 16 9a sbi 0x02, 6 ; 2 139d6: 10 92 a4 06 sts 0x06A4, r1 ; 0x8006a4 if (code_seen('Z')) disable_z(); 139da: 8a e5 ldi r24, 0x5A ; 90 139dc: 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(); 139e0: 85 e4 ldi r24, 0x45 ; 69 139e2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 139e6: 88 23 and r24, r24 139e8: 09 f4 brne .+2 ; 0x139ec 139ea: 19 cb rjmp .-2510 ; 0x1301e 139ec: 14 9a sbi 0x02, 4 ; 2 139ee: 17 cb rjmp .-2514 ; 0x1301e 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]))); 139f0: 89 e5 ldi r24, 0x59 ; 89 139f2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 139f6: 81 11 cpse r24, r1 139f8: e1 cf rjmp .-62 ; 0x139bc 139fa: 8a e5 ldi r24, 0x5A ; 90 139fc: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13a00: 81 11 cpse r24, r1 13a02: dc cf rjmp .-72 ; 0x139bc 13a04: 85 e4 ldi r24, 0x45 ; 69 13a06: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13a0a: 81 11 cpse r24, r1 13a0c: d7 cf rjmp .-82 ; 0x139bc if(all_axis) { st_synchronize(); 13a0e: 0f 94 ce 22 call 0x2459c ; 0x2459c disable_e0(); 13a12: 14 9a sbi 0x02, 4 ; 2 finishAndDisableSteppers(); 13a14: 0e 94 2f 74 call 0xe85e ; 0xe85e 13a18: 02 cb rjmp .-2556 ; 0x1301e } else { st_synchronize(); if (code_seen('X')) disable_x(); 13a1a: 17 9a sbi 0x02, 7 ; 2 13a1c: 10 92 a3 06 sts 0x06A3, r1 ; 0x8006a3 13a20: d4 cf rjmp .-88 ; 0x139ca #### 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')) { 13a22: 83 e5 ldi r24, 0x53 ; 83 13a24: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13a28: 88 23 and r24, r24 13a2a: 09 f4 brne .+2 ; 0x13a2e 13a2c: f8 ca rjmp .-2576 ; 0x1301e max_inactive_time = code_value() * 1000; 13a2e: 0e 94 03 5a call 0xb406 ; 0xb406 13a32: 20 e0 ldi r18, 0x00 ; 0 13a34: 30 e0 ldi r19, 0x00 ; 0 13a36: 4a e7 ldi r20, 0x7A ; 122 13a38: 54 e4 ldi r21, 0x44 ; 68 13a3a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 13a3e: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 13a42: 60 93 46 03 sts 0x0346, r22 ; 0x800346 13a46: 70 93 47 03 sts 0x0347, r23 ; 0x800347 13a4a: 80 93 48 03 sts 0x0348, r24 ; 0x800348 13a4e: 90 93 49 03 sts 0x0349, r25 ; 0x800349 13a52: e5 ca rjmp .-2614 ; 0x1301e 13a54: 84 ec ldi r24, 0xC4 ; 196 13a56: 88 2e mov r8, r24 13a58: 82 e0 ldi r24, 0x02 ; 2 13a5a: 98 2e mov r9, r24 13a5c: 92 e3 ldi r25, 0x32 ; 50 13a5e: a9 2e mov r10, r25 13a60: 94 e0 ldi r25, 0x04 ; 4 13a62: 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++) 13a64: 10 e0 ldi r17, 0x00 ; 0 { if(code_seen(axis_codes[i])) 13a66: f4 01 movw r30, r8 13a68: 81 91 ld r24, Z+ 13a6a: 4f 01 movw r8, r30 13a6c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13a70: 88 23 and r24, r24 13a72: 09 f4 brne .+2 ; 0x13a76 13a74: 65 c0 rjmp .+202 ; 0x13b40 { float value = code_value(); 13a76: 0e 94 03 5a call 0xb406 ; 0xb406 13a7a: 6b 01 movw r12, r22 13a7c: 7c 01 movw r14, r24 if(i == E_AXIS) { // E 13a7e: 13 30 cpi r17, 0x03 ; 3 13a80: 09 f0 breq .+2 ; 0x13a84 13a82: 68 c0 rjmp .+208 ; 0x13b54 if(value < 20.0) { 13a84: 20 e0 ldi r18, 0x00 ; 0 13a86: 30 e0 ldi r19, 0x00 ; 0 13a88: 40 ea ldi r20, 0xA0 ; 160 13a8a: 51 e4 ldi r21, 0x41 ; 65 13a8c: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 13a90: 87 ff sbrs r24, 7 13a92: 4e c0 rjmp .+156 ; 0x13b30 const float factor = cs.axis_steps_per_mm[E_AXIS] / value; // increase e constants if M92 E14 is given for netfab. 13a94: a7 01 movw r20, r14 13a96: 96 01 movw r18, r12 13a98: 60 91 42 04 lds r22, 0x0442 ; 0x800442 13a9c: 70 91 43 04 lds r23, 0x0443 ; 0x800443 13aa0: 80 91 44 04 lds r24, 0x0444 ; 0x800444 13aa4: 90 91 45 04 lds r25, 0x0445 ; 0x800445 13aa8: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 13aac: 2b 01 movw r4, r22 13aae: 3c 01 movw r6, r24 cs.max_jerk[E_AXIS] *= factor; 13ab0: ac 01 movw r20, r24 13ab2: 9b 01 movw r18, r22 13ab4: 60 91 86 04 lds r22, 0x0486 ; 0x800486 13ab8: 70 91 87 04 lds r23, 0x0487 ; 0x800487 13abc: 80 91 88 04 lds r24, 0x0488 ; 0x800488 13ac0: 90 91 89 04 lds r25, 0x0489 ; 0x800489 13ac4: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 13ac8: 60 93 86 04 sts 0x0486, r22 ; 0x800486 13acc: 70 93 87 04 sts 0x0487, r23 ; 0x800487 13ad0: 80 93 88 04 sts 0x0488, r24 ; 0x800488 13ad4: 90 93 89 04 sts 0x0489, r25 ; 0x800489 max_feedrate[E_AXIS] *= factor; 13ad8: a3 01 movw r20, r6 13ada: 92 01 movw r18, r4 13adc: 60 91 52 04 lds r22, 0x0452 ; 0x800452 13ae0: 70 91 53 04 lds r23, 0x0453 ; 0x800453 13ae4: 80 91 54 04 lds r24, 0x0454 ; 0x800454 13ae8: 90 91 55 04 lds r25, 0x0455 ; 0x800455 13aec: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 13af0: 60 93 52 04 sts 0x0452, r22 ; 0x800452 13af4: 70 93 53 04 sts 0x0453, r23 ; 0x800453 13af8: 80 93 54 04 sts 0x0454, r24 ; 0x800454 13afc: 90 93 55 04 sts 0x0455, r25 ; 0x800455 max_acceleration_steps_per_s2[E_AXIS] *= factor; 13b00: 60 91 f1 16 lds r22, 0x16F1 ; 0x8016f1 13b04: 70 91 f2 16 lds r23, 0x16F2 ; 0x8016f2 13b08: 80 91 f3 16 lds r24, 0x16F3 ; 0x8016f3 13b0c: 90 91 f4 16 lds r25, 0x16F4 ; 0x8016f4 13b10: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 13b14: a3 01 movw r20, r6 13b16: 92 01 movw r18, r4 13b18: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 13b1c: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 13b20: 60 93 f1 16 sts 0x16F1, r22 ; 0x8016f1 13b24: 70 93 f2 16 sts 0x16F2, r23 ; 0x8016f2 13b28: 80 93 f3 16 sts 0x16F3, r24 ; 0x8016f3 13b2c: 90 93 f4 16 sts 0x16F4, r25 ; 0x8016f4 } cs.axis_steps_per_mm[E_AXIS] = value; 13b30: c0 92 42 04 sts 0x0442, r12 ; 0x800442 13b34: d0 92 43 04 sts 0x0443, r13 ; 0x800443 13b38: e0 92 44 04 sts 0x0444, r14 ; 0x800444 13b3c: f0 92 45 04 sts 0x0445, r15 ; 0x800445 13b40: b4 e0 ldi r27, 0x04 ; 4 13b42: ab 0e add r10, r27 13b44: b1 1c adc r11, r1 13b46: 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++) 13b48: 14 30 cpi r17, 0x04 ; 4 13b4a: 09 f0 breq .+2 ; 0x13b4e 13b4c: 8c cf rjmp .-232 ; 0x13a66 } else { cs.axis_steps_per_mm[i] = value; } } } reset_acceleration_rates(); 13b4e: 0f 94 54 75 call 0x2eaa8 ; 0x2eaa8 13b52: 65 ca rjmp .-2870 ; 0x1301e 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; 13b54: d5 01 movw r26, r10 13b56: 14 96 adiw r26, 0x04 ; 4 13b58: cd 92 st X+, r12 13b5a: dd 92 st X+, r13 13b5c: ed 92 st X+, r14 13b5e: fc 92 st X, r15 13b60: 17 97 sbiw r26, 0x07 ; 7 13b62: ee cf rjmp .-36 ; 0x13b40 #### Parameters - `S` - Seconds. Default is 2 seconds between "busy" messages */ case 113: if (code_seen('S')) { 13b64: 83 e5 ldi r24, 0x53 ; 83 13b66: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13b6a: 88 23 and r24, r24 13b6c: 29 f0 breq .+10 ; 0x13b78 host_keepalive_interval = code_value_uint8(); 13b6e: 0e 94 40 55 call 0xaa80 ; 0xaa80 13b72: 80 93 32 02 sts 0x0232, r24 ; 0x800232 13b76: 53 ca rjmp .-2906 ; 0x1301e } else { SERIAL_ECHO_START; 13b78: 81 e6 ldi r24, 0x61 ; 97 13b7a: 9d e9 ldi r25, 0x9D ; 157 13b7c: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); 13b80: c0 90 32 02 lds r12, 0x0232 ; 0x800232 13b84: d1 2c mov r13, r1 13b86: f1 2c mov r15, r1 13b88: 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); } 13b8a: 84 e0 ldi r24, 0x04 ; 4 13b8c: 90 e8 ldi r25, 0x80 ; 128 13b8e: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 13b92: 4a e0 ldi r20, 0x0A ; 10 13b94: c7 01 movw r24, r14 13b96: b6 01 movw r22, r12 13b98: 0f 94 eb 96 call 0x32dd6 ; 0x32dd6 host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); SERIAL_PROTOCOLLN(); 13b9c: 0f 94 bb 98 call 0x33176 ; 0x33176 13ba0: 3e ca rjmp .-2948 ; 0x1301e */ case 115: // M115 if (code_seen('V')) { // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); } else if (code_seen('U')) { 13ba2: 85 e5 ldi r24, 0x55 ; 85 13ba4: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13ba8: 88 23 and r24, r24 13baa: 09 f4 brne .+2 ; 0x13bae 13bac: 5a c0 rjmp .+180 ; 0x13c62 // 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); 13bae: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 13bb2: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 13bb6: 0f 5f subi r16, 0xFF ; 255 13bb8: 1f 4f sbci r17, 0xFF ; 255 13bba: 10 93 f6 16 sts 0x16F6, r17 ; 0x8016f6 13bbe: 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) 13bc2: 80 91 b7 03 lds r24, 0x03B7 ; 0x8003b7 13bc6: 88 23 and r24, r24 13bc8: 09 f4 brne .+2 ; 0x13bcc 13bca: 29 ca rjmp .-2990 ; 0x1301e // 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)) 13bcc: be 01 movw r22, r28 13bce: 6f 5f subi r22, 0xFF ; 255 13bd0: 7f 4f sbci r23, 0xFF ; 255 13bd2: c8 01 movw r24, r16 13bd4: 0e 94 4b e1 call 0x1c296 ; 0x1c296 13bd8: 88 23 and r24, r24 13bda: 09 f4 brne .+2 ; 0x13bde 13bdc: 20 ca rjmp .-3008 ; 0x1301e 13bde: 8f e4 ldi r24, 0x4F ; 79 13be0: 96 e8 ldi r25, 0x86 ; 134 13be2: de 01 movw r26, r28 13be4: 11 96 adiw r26, 0x01 ; 1 13be6: be 01 movw r22, r28 13be8: 67 5f subi r22, 0xF7 ; 247 13bea: 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]); 13bec: fc 01 movw r30, r24 13bee: 45 91 lpm r20, Z+ 13bf0: 54 91 lpm r21, Z if (ver_gcode[i] > v) 13bf2: 2d 91 ld r18, X+ 13bf4: 3d 91 ld r19, X+ 13bf6: 42 17 cp r20, r18 13bf8: 53 07 cpc r21, r19 13bfa: 10 f4 brcc .+4 ; 0x13c00 13bfc: 0c 94 3e b0 jmp 0x1607c ; 0x1607c return 1; else if (ver_gcode[i] < v) 13c00: 24 17 cp r18, r20 13c02: 35 07 cpc r19, r21 13c04: 08 f4 brcc .+2 ; 0x13c08 13c06: 0b ca rjmp .-3050 ; 0x1301e 13c08: 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) 13c0a: a6 17 cp r26, r22 13c0c: b7 07 cpc r27, r23 13c0e: 71 f7 brne .-36 ; 0x13bec 13c10: 06 ca rjmp .-3060 ; 0x1301e 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)); 13c12: 8f e0 ldi r24, 0x0F ; 15 13c14: 99 e3 ldi r25, 0x39 ; 57 13c16: 0e 94 a7 6c call 0xd94e ; 0xd94e 13c1a: ac 01 movw r20, r24 13c1c: 63 e0 ldi r22, 0x03 ; 3 13c1e: 80 e0 ldi r24, 0x00 ; 0 13c20: 0e 94 85 69 call 0xd30a ; 0xd30a Sound_MakeCustom(50,1000,false); 13c24: 40 e0 ldi r20, 0x00 ; 0 13c26: 68 ee ldi r22, 0xE8 ; 232 13c28: 73 e0 ldi r23, 0x03 ; 3 13c2a: 82 e3 ldi r24, 0x32 ; 50 13c2c: 90 e0 ldi r25, 0x00 ; 0 13c2e: 0f 94 6f 32 call 0x264de ; 0x264de delay_keep_alive(500); 13c32: 84 ef ldi r24, 0xF4 ; 244 13c34: 91 e0 ldi r25, 0x01 ; 1 13c36: 0e 94 45 7c call 0xf88a ; 0xf88a Sound_MakeCustom(50,1000,false); 13c3a: 40 e0 ldi r20, 0x00 ; 0 13c3c: 68 ee ldi r22, 0xE8 ; 232 13c3e: 73 e0 ldi r23, 0x03 ; 3 13c40: 82 e3 ldi r24, 0x32 ; 50 13c42: 90 e0 ldi r25, 0x00 ; 0 13c44: 0f 94 6f 32 call 0x264de ; 0x264de lcd_wait_for_click_delay(30); 13c48: 8e e1 ldi r24, 0x1E ; 30 13c4a: 90 e0 ldi r25, 0x00 ; 0 13c4c: 0f 94 59 35 call 0x26ab2 ; 0x26ab2 lcd_update_enable(true); 13c50: 81 e0 ldi r24, 0x01 ; 1 13c52: 0e 94 b6 69 call 0xd36c ; 0xd36c lcd_clear(); 13c56: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_update(0); 13c5a: 80 e0 ldi r24, 0x00 ; 0 13c5c: 0e 94 38 69 call 0xd270 ; 0xd270 13c60: de c9 rjmp .-3140 ; 0x1301e } 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); 13c62: 41 e1 ldi r20, 0x11 ; 17 13c64: 50 e0 ldi r21, 0x00 ; 0 13c66: 60 e8 ldi r22, 0x80 ; 128 13c68: 7c e0 ldi r23, 0x0C ; 12 13c6a: ce 01 movw r24, r28 13c6c: 01 96 adiw r24, 0x01 ; 1 13c6e: 0f 94 8b a0 call 0x34116 ; 0x34116 SERIAL_ECHOPGM("FIRMWARE_NAME:Prusa-Firmware "); 13c72: 86 ee ldi r24, 0xE6 ; 230 13c74: 9f e7 ldi r25, 0x7F ; 127 13c76: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHORPGM(FW_VERSION_STR_P()); 13c7a: 83 ec ldi r24, 0xC3 ; 195 13c7c: 9e e9 ldi r25, 0x9E ; 158 13c7e: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOPGM("+"); 13c82: 84 ee ldi r24, 0xE4 ; 228 13c84: 9f e7 ldi r25, 0x7F ; 127 13c86: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOPGM(STR(FW_COMMITNR)); 13c8a: 8f ed ldi r24, 0xDF ; 223 13c8c: 9f e7 ldi r25, 0x7F ; 127 13c8e: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOPGM("_"); 13c92: 8d ed ldi r24, 0xDD ; 221 13c94: 9f e7 ldi r25, 0x7F ; 127 13c96: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOPGM(FW_COMMIT_HASH); 13c9a: 83 ed ldi r24, 0xD3 ; 211 13c9c: 9f e7 ldi r25, 0x7F ; 127 13c9e: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOPGM(" based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:"); 13ca2: 89 e7 ldi r24, 0x79 ; 121 13ca4: 9f e7 ldi r25, 0x7F ; 127 13ca6: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOPGM(PROTOCOL_VERSION); 13caa: 85 e7 ldi r24, 0x75 ; 117 13cac: 9f e7 ldi r25, 0x7F ; 127 13cae: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOPGM(" MACHINE_TYPE:"); 13cb2: 86 e6 ldi r24, 0x66 ; 102 13cb4: 9f e7 ldi r25, 0x7F ; 127 13cb6: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 13cba: ce 01 movw r24, r28 13cbc: 01 96 adiw r24, 0x01 ; 1 13cbe: 0e 94 a0 7c call 0xf940 ; 0xf940 SERIAL_PROTOCOL(custom_mendel_name); SERIAL_ECHOPGM(" EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)); 13cc2: 84 e5 ldi r24, 0x54 ; 84 13cc4: 9f e7 ldi r25, 0x7F ; 127 13cc6: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 #ifdef MACHINE_UUID SERIAL_ECHOPGM(" UUID:"); SERIAL_ECHOPGM(MACHINE_UUID); #endif //MACHINE_UUID SERIAL_ECHOLNPGM(""); 13cca: 83 e5 ldi r24, 0x53 ; 83 13ccc: 9f e7 ldi r25, 0x7F ; 127 13cce: 0e 94 49 72 call 0xe492 ; 0xe492 } #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'); 13cd2: 1f 92 push r1 13cd4: 01 e3 ldi r16, 0x31 ; 49 13cd6: f0 2e mov r15, r16 13cd8: ff 92 push r15 13cda: 8c eb ldi r24, 0xBC ; 188 13cdc: 9d e7 ldi r25, 0x7D ; 125 13cde: 9f 93 push r25 13ce0: 8f 93 push r24 13ce2: 05 e7 ldi r16, 0x75 ; 117 13ce4: 1d e7 ldi r17, 0x7D ; 125 13ce6: 1f 93 push r17 13ce8: 0f 93 push r16 13cea: 0f 94 5d 9f call 0x33eba ; 0x33eba 13cee: 1f 92 push r1 13cf0: ff 92 push r15 13cf2: 8c ea ldi r24, 0xAC ; 172 13cf4: 9d e7 ldi r25, 0x7D ; 125 13cf6: 9f 93 push r25 13cf8: 8f 93 push r24 13cfa: 1f 93 push r17 13cfc: 0f 93 push r16 13cfe: 0f 94 5d 9f call 0x33eba ; 0x33eba 13d02: 1f 92 push r1 13d04: ff 92 push r15 13d06: 88 e9 ldi r24, 0x98 ; 152 13d08: 9d e7 ldi r25, 0x7D ; 125 13d0a: 9f 93 push r25 13d0c: 8f 93 push r24 13d0e: 1f 93 push r17 13d10: 0f 93 push r16 13d12: 0f 94 5d 9f call 0x33eba ; 0x33eba 13d16: 1f 92 push r1 13d18: ff 92 push r15 13d1a: 8b e8 ldi r24, 0x8B ; 139 13d1c: 9d e7 ldi r25, 0x7D ; 125 13d1e: 9f 93 push r25 13d20: 8f 93 push r24 13d22: 1f 93 push r17 13d24: 0f 93 push r16 13d26: 0f 94 5d 9f call 0x33eba ; 0x33eba 13d2a: 1f 92 push r1 13d2c: ff 92 push r15 13d2e: 80 e8 ldi r24, 0x80 ; 128 13d30: 9d e7 ldi r25, 0x7D ; 125 13d32: 9f 93 push r25 13d34: 8f 93 push r24 13d36: 1f 93 push r17 13d38: 0f 93 push r16 13d3a: 0f 94 5d 9f call 0x33eba ; 0x33eba 13d3e: 0f b6 in r0, 0x3f ; 63 13d40: f8 94 cli 13d42: de bf out 0x3e, r29 ; 62 13d44: 0f be out 0x3f, r0 ; 63 13d46: cd bf out 0x3d, r28 ; 61 13d48: 6a c9 rjmp .-3372 ; 0x1301e /*! ### M114 - Get current position M114: Get Current Position */ case 114: gcode_M114(); 13d4a: 0e 94 47 71 call 0xe28e ; 0xe28e 13d4e: 67 c9 rjmp .-3378 ; 0x1301e /*! ### M117 - Display Message M117: Display Message */ case 117: { const char *src = strchr_pointer + 4; // "M117" 13d50: e0 91 f5 16 lds r30, 0x16F5 ; 0x8016f5 13d54: f0 91 f6 16 lds r31, 0x16F6 ; 0x8016f6 13d58: cf 01 movw r24, r30 13d5a: 04 96 adiw r24, 0x04 ; 4 lcd_setstatus(*src == ' '? src + 1: src); 13d5c: 24 81 ldd r18, Z+4 ; 0x04 13d5e: 20 32 cpi r18, 0x20 ; 32 13d60: 09 f4 brne .+2 ; 0x13d64 13d62: 01 96 adiw r24, 0x01 ; 1 13d64: 0e 94 bb ef call 0x1df76 ; 0x1df76 custom_message_type = CustomMsg::M117; 13d68: 87 e0 ldi r24, 0x07 ; 7 13d6a: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 13d6e: 57 c9 rjmp .-3410 ; 0x1301e - `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; 13d70: 00 91 f5 16 lds r16, 0x16F5 ; 0x8016f5 13d74: 10 91 f6 16 lds r17, 0x16F6 ; 0x8016f6 13d78: 0b 5f subi r16, 0xFB ; 251 13d7a: 1f 4f sbci r17, 0xFF ; 255 13d7c: 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; 13d7e: f1 2c mov r15, r1 13d80: 40 e0 ldi r20, 0x00 ; 0 13d82: 81 50 subi r24, 0x01 ; 1 char *p = strchr_pointer + 5; for (uint8_t i = 2; i--;) { 13d84: e9 f0 breq .+58 ; 0x13dc0 // A1, E1, and Pn are always parsed out if (!((p[0] == 'A' || p[0] == 'E') && p[1] == '1')) break; 13d86: d8 01 movw r26, r16 13d88: 9c 91 ld r25, X 13d8a: 29 2f mov r18, r25 13d8c: 2b 7f andi r18, 0xFB ; 251 13d8e: 21 34 cpi r18, 0x41 ; 65 13d90: b9 f4 brne .+46 ; 0x13dc0 13d92: 11 96 adiw r26, 0x01 ; 1 13d94: 2c 91 ld r18, X 13d96: 21 33 cpi r18, 0x31 ; 49 13d98: 99 f4 brne .+38 ; 0x13dc0 switch (p[0]) { 13d9a: 91 34 cpi r25, 0x41 ; 65 13d9c: 71 f0 breq .+28 ; 0x13dba 13d9e: 95 34 cpi r25, 0x45 ; 69 13da0: 09 f4 brne .+2 ; 0x13da4 case 'A': hasA = true; break; case 'E': hasE = true; break; 13da2: 41 e0 ldi r20, 0x01 ; 1 } p += 2; 13da4: 98 01 movw r18, r16 13da6: 2e 5f subi r18, 0xFE ; 254 13da8: 3f 4f sbci r19, 0xFF ; 255 13daa: 89 01 movw r16, r18 13dac: 2f 5f subi r18, 0xFF ; 255 13dae: 3f 4f sbci r19, 0xFF ; 255 while (*p == ' ') ++p; 13db0: f8 01 movw r30, r16 13db2: 90 81 ld r25, Z 13db4: 90 32 cpi r25, 0x20 ; 32 13db6: c9 f3 breq .-14 ; 0x13daa 13db8: e4 cf rjmp .-56 ; 0x13d82 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; 13dba: ff 24 eor r15, r15 13dbc: f3 94 inc r15 13dbe: f2 cf rjmp .-28 ; 0x13da4 } p += 2; while (*p == ' ') ++p; } if (hasE) SERIAL_ECHO_START; 13dc0: 44 23 and r20, r20 13dc2: 21 f0 breq .+8 ; 0x13dcc 13dc4: 81 e6 ldi r24, 0x61 ; 97 13dc6: 9d e9 ldi r25, 0x9D ; 157 13dc8: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 if (hasA) SERIAL_ECHOPGM("//"); 13dcc: ff 20 and r15, r15 13dce: 21 f0 breq .+8 ; 0x13dd8 13dd0: 80 e5 ldi r24, 0x50 ; 80 13dd2: 9f e7 ldi r25, 0x7F ; 127 13dd4: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLN(p); 13dd8: c8 01 movw r24, r16 13dda: 0f 94 bc 99 call 0x33378 ; 0x33378 13dde: 1f c9 rjmp .-3522 ; 0x1301e 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); 13de0: 87 e3 ldi r24, 0x37 ; 55 13de2: 95 e6 ldi r25, 0x65 ; 101 13de4: 0c 94 f2 93 jmp 0x127e4 ; 0x127e4 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); 13de8: 87 e3 ldi r24, 0x37 ; 55 13dea: 95 e6 ldi r25, 0x65 ; 101 13dec: 0c 94 00 94 jmp 0x12800 ; 0x12800 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); 13df0: 87 e3 ldi r24, 0x37 ; 55 13df2: 95 e6 ldi r25, 0x65 ; 101 13df4: 0c 94 0e 94 jmp 0x1281c ; 0x1281c 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); 13df8: 87 e3 ldi r24, 0x37 ; 55 13dfa: 95 e6 ldi r25, 0x65 ; 101 13dfc: 0c 94 1c 94 jmp 0x12838 ; 0x12838 E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255 */ case 123: gcode_M123(); 13e00: 0e 94 93 5f call 0xbf26 ; 0xbf26 13e04: 0c c9 rjmp .-3560 ; 0x1301e */ 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')) { 13e06: 84 e5 ldi r24, 0x54 ; 84 13e08: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13e0c: 88 23 and r24, r24 13e0e: 69 f0 breq .+26 ; 0x13e2a extruder = code_value_uint8(); 13e10: 0e 94 40 55 call 0xaa80 ; 0xaa80 if(extruder >= EXTRUDERS) { 13e14: 88 23 and r24, r24 13e16: 49 f0 breq .+18 ; 0x13e2a SERIAL_ECHO_START; 13e18: 81 e6 ldi r24, 0x61 ; 97 13e1a: 9d e9 ldi r25, 0x9D ; 157 13e1c: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 13e20: 88 e0 ldi r24, 0x08 ; 8 13e22: 95 e6 ldi r25, 0x65 ; 101 13e24: 0e 94 a0 7c call 0xf940 ; 0xf940 13e28: fa c8 rjmp .-3596 ; 0x1301e SERIAL_ECHO(_n("M200 Invalid extruder "));////MSG_M200_INVALID_EXTRUDER break; } } if(code_seen('D')) { 13e2a: 84 e4 ldi r24, 0x44 ; 68 13e2c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13e30: 88 23 and r24, r24 13e32: 09 f4 brne .+2 ; 0x13e36 13e34: f4 c8 rjmp .-3608 ; 0x1301e float diameter = code_value(); 13e36: 0e 94 03 5a call 0xb406 ; 0xb406 if (diameter == 0.0) { 13e3a: 20 e0 ldi r18, 0x00 ; 0 13e3c: 30 e0 ldi r19, 0x00 ; 0 13e3e: a9 01 movw r20, r18 13e40: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 13e44: 81 11 cpse r24, r1 13e46: 05 c0 rjmp .+10 ; 0x13e52 // 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; 13e48: 10 92 c9 04 sts 0x04C9, r1 ; 0x8004c9 } } else { //reserved for setting filament diameter via UFID or filament measuring device break; } calculate_extruder_multipliers(); 13e4c: 0e 94 c8 5e call 0xbd90 ; 0xbd90 13e50: e6 c8 rjmp .-3636 ; 0x1301e // 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(); 13e52: 0e 94 03 5a call 0xb406 ; 0xb406 13e56: 6b 01 movw r12, r22 13e58: 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]); 13e5a: 20 e0 ldi r18, 0x00 ; 0 13e5c: 30 e0 ldi r19, 0x00 ; 0 13e5e: a9 01 movw r20, r18 13e60: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 13e64: 81 11 cpse r24, r1 13e66: 06 c0 rjmp .+12 ; 0x13e74 13e68: c1 2c mov r12, r1 13e6a: d1 2c mov r13, r1 13e6c: 10 ee ldi r17, 0xE0 ; 224 13e6e: e1 2e mov r14, r17 13e70: 1f e3 ldi r17, 0x3F ; 63 13e72: f1 2e mov r15, r17 13e74: c0 92 ca 04 sts 0x04CA, r12 ; 0x8004ca 13e78: d0 92 cb 04 sts 0x04CB, r13 ; 0x8004cb 13e7c: e0 92 cc 04 sts 0x04CC, r14 ; 0x8004cc 13e80: 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; 13e84: 81 e0 ldi r24, 0x01 ; 1 13e86: 80 93 c9 04 sts 0x04C9, r24 ; 0x8004c9 13e8a: e0 cf rjmp .-64 ; 0x13e4c 13e8c: 04 ec ldi r16, 0xC4 ; 196 13e8e: 12 e0 ldi r17, 0x02 ; 2 13e90: e2 e3 ldi r30, 0x32 ; 50 13e92: ee 2e mov r14, r30 13e94: e4 e0 ldi r30, 0x04 ; 4 13e96: fe 2e mov r15, r30 13e98: f8 ec ldi r31, 0xC8 ; 200 13e9a: cf 2e mov r12, r31 13e9c: f2 e0 ldi r31, 0x02 ; 2 13e9e: 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])) 13ea0: d8 01 movw r26, r16 13ea2: 8d 91 ld r24, X+ 13ea4: 8d 01 movw r16, r26 13ea6: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13eaa: 88 23 and r24, r24 13eac: 39 f0 breq .+14 ; 0x13ebc { float val = code_value(); 13eae: 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; 13eb2: f7 01 movw r30, r14 13eb4: 64 8b std Z+20, r22 ; 0x14 13eb6: 75 8b std Z+21, r23 ; 0x15 13eb8: 86 8b std Z+22, r24 ; 0x16 13eba: 97 8b std Z+23, r25 ; 0x17 13ebc: f4 e0 ldi r31, 0x04 ; 4 13ebe: ef 0e add r14, r31 13ec0: 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++) 13ec2: c0 16 cp r12, r16 13ec4: d1 06 cpc r13, r17 13ec6: 61 f7 brne .-40 ; 0x13ea0 13ec8: aa c8 rjmp .-3756 ; 0x1301e - `R` - filmanent only moves - `T` - travel moves (as of now T is ignored) */ case 204: { if(code_seen('S')) { 13eca: 83 e5 ldi r24, 0x53 ; 83 13ecc: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13ed0: 88 23 and r24, r24 13ed2: 19 f1 breq .+70 ; 0x13f1a // 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(); 13ed4: 0e 94 03 5a call 0xb406 ; 0xb406 13ed8: 60 93 f2 04 sts 0x04F2, r22 ; 0x8004f2 13edc: 70 93 f3 04 sts 0x04F3, r23 ; 0x8004f3 13ee0: 80 93 f4 04 sts 0x04F4, r24 ; 0x8004f4 13ee4: 90 93 f5 04 sts 0x04F5, r25 ; 0x8004f5 13ee8: 60 93 66 04 sts 0x0466, r22 ; 0x800466 13eec: 70 93 67 04 sts 0x0467, r23 ; 0x800467 13ef0: 80 93 68 04 sts 0x0468, r24 ; 0x800468 13ef4: 90 93 69 04 sts 0x0469, r25 ; 0x800469 // Interpret the T value as retract acceleration in the old Marlin format. if(code_seen('T')) 13ef8: 84 e5 ldi r24, 0x54 ; 84 13efa: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13efe: 88 23 and r24, r24 13f00: 09 f4 brne .+2 ; 0x13f04 13f02: 8d c8 rjmp .-3814 ; 0x1301e cs.retract_acceleration = code_value(); 13f04: 0e 94 03 5a call 0xb406 ; 0xb406 13f08: 60 93 6a 04 sts 0x046A, r22 ; 0x80046a 13f0c: 70 93 6b 04 sts 0x046B, r23 ; 0x80046b 13f10: 80 93 6c 04 sts 0x046C, r24 ; 0x80046c 13f14: 90 93 6d 04 sts 0x046D, r25 ; 0x80046d 13f18: 82 c8 rjmp .-3836 ; 0x1301e } else { // New acceleration format, compatible with the upstream Marlin. if(code_seen('P')) 13f1a: 80 e5 ldi r24, 0x50 ; 80 13f1c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13f20: 88 23 and r24, r24 13f22: 51 f0 breq .+20 ; 0x13f38 cs.acceleration = code_value(); 13f24: 0e 94 03 5a call 0xb406 ; 0xb406 13f28: 60 93 66 04 sts 0x0466, r22 ; 0x800466 13f2c: 70 93 67 04 sts 0x0467, r23 ; 0x800467 13f30: 80 93 68 04 sts 0x0468, r24 ; 0x800468 13f34: 90 93 69 04 sts 0x0469, r25 ; 0x800469 if(code_seen('R')) 13f38: 82 e5 ldi r24, 0x52 ; 82 13f3a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13f3e: 88 23 and r24, r24 13f40: 51 f0 breq .+20 ; 0x13f56 cs.retract_acceleration = code_value(); 13f42: 0e 94 03 5a call 0xb406 ; 0xb406 13f46: 60 93 6a 04 sts 0x046A, r22 ; 0x80046a 13f4a: 70 93 6b 04 sts 0x046B, r23 ; 0x80046b 13f4e: 80 93 6c 04 sts 0x046C, r24 ; 0x80046c 13f52: 90 93 6d 04 sts 0x046D, r25 ; 0x80046d if(code_seen('T')) 13f56: 84 e5 ldi r24, 0x54 ; 84 13f58: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13f5c: 88 23 and r24, r24 13f5e: 09 f4 brne .+2 ; 0x13f62 13f60: 5e c8 rjmp .-3908 ; 0x1301e cs.travel_acceleration = code_value(); 13f62: 0e 94 03 5a call 0xb406 ; 0xb406 13f66: 60 93 f2 04 sts 0x04F2, r22 ; 0x8004f2 13f6a: 70 93 f3 04 sts 0x04F3, r23 ; 0x8004f3 13f6e: 80 93 f4 04 sts 0x04F4, r24 ; 0x8004f4 13f72: 90 93 f5 04 sts 0x04F5, r25 ; 0x8004f5 13f76: 53 c8 rjmp .-3930 ; 0x1301e 13f78: 04 ec ldi r16, 0xC4 ; 196 13f7a: 12 e0 ldi r17, 0x02 ; 2 13f7c: 7a e8 ldi r23, 0x8A ; 138 13f7e: e7 2e mov r14, r23 13f80: 74 e0 ldi r23, 0x04 ; 4 13f82: 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(); 13f84: d8 01 movw r26, r16 13f86: 8d 91 ld r24, X+ 13f88: 8d 01 movw r16, r26 13f8a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13f8e: 88 23 and r24, r24 13f90: 39 f0 breq .+14 ; 0x13fa0 13f92: 0e 94 03 5a call 0xb406 ; 0xb406 13f96: f7 01 movw r30, r14 13f98: 60 83 st Z, r22 13f9a: 71 83 std Z+1, r23 ; 0x01 13f9c: 82 83 std Z+2, r24 ; 0x02 13f9e: 93 83 std Z+3, r25 ; 0x03 13fa0: f4 e0 ldi r31, 0x04 ; 4 13fa2: ef 0e add r14, r31 13fa4: 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++) 13fa6: 22 e0 ldi r18, 0x02 ; 2 13fa8: 07 3c cpi r16, 0xC7 ; 199 13faa: 12 07 cpc r17, r18 13fac: 59 f7 brne .-42 ; 0x13f84 13fae: 37 c8 rjmp .-3986 ; 0x1301e - `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')) 13fb0: 83 e5 ldi r24, 0x53 ; 83 13fb2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13fb6: 88 23 and r24, r24 13fb8: 51 f0 breq .+20 ; 0x13fce { cs.retract_length = code_value() ; 13fba: 0e 94 03 5a call 0xb406 ; 0xb406 13fbe: 60 93 b5 04 sts 0x04B5, r22 ; 0x8004b5 13fc2: 70 93 b6 04 sts 0x04B6, r23 ; 0x8004b6 13fc6: 80 93 b7 04 sts 0x04B7, r24 ; 0x8004b7 13fca: 90 93 b8 04 sts 0x04B8, r25 ; 0x8004b8 } if(code_seen('F')) 13fce: 86 e4 ldi r24, 0x46 ; 70 13fd0: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13fd4: 88 23 and r24, r24 13fd6: 61 f0 breq .+24 ; 0x13ff0 { cs.retract_feedrate = get_feedrate_mm_s(code_value()); 13fd8: 0e 94 03 5a call 0xb406 ; 0xb406 13fdc: 0e 94 c3 5f call 0xbf86 ; 0xbf86 13fe0: 60 93 b9 04 sts 0x04B9, r22 ; 0x8004b9 13fe4: 70 93 ba 04 sts 0x04BA, r23 ; 0x8004ba 13fe8: 80 93 bb 04 sts 0x04BB, r24 ; 0x8004bb 13fec: 90 93 bc 04 sts 0x04BC, r25 ; 0x8004bc } if(code_seen('Z')) 13ff0: 8a e5 ldi r24, 0x5A ; 90 13ff2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 13ff6: 88 23 and r24, r24 13ff8: 09 f4 brne .+2 ; 0x13ffc 13ffa: 11 c8 rjmp .-4062 ; 0x1301e { cs.retract_zlift = code_value() ; 13ffc: 0e 94 03 5a call 0xb406 ; 0xb406 14000: 60 93 bd 04 sts 0x04BD, r22 ; 0x8004bd 14004: 70 93 be 04 sts 0x04BE, r23 ; 0x8004be 14008: 80 93 bf 04 sts 0x04BF, r24 ; 0x8004bf 1400c: 90 93 c0 04 sts 0x04C0, r25 ; 0x8004c0 14010: 0c 94 0f 98 jmp 0x1301e ; 0x1301e #### 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')) 14014: 83 e5 ldi r24, 0x53 ; 83 14016: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1401a: 88 23 and r24, r24 1401c: 11 f4 brne .+4 ; 0x14022 1401e: 0c 94 0f 98 jmp 0x1301e ; 0x1301e { switch(code_value_uint8()) 14022: 0e 94 40 55 call 0xaa80 ; 0xaa80 14026: 88 23 and r24, r24 14028: c1 f0 breq .+48 ; 0x1405a 1402a: 81 30 cpi r24, 0x01 ; 1 1402c: e1 f0 breq .+56 ; 0x14066 #if EXTRUDERS > 2 retracted[2]=false; #endif }break; default: SERIAL_ECHO_START; 1402e: 81 e6 ldi r24, 0x61 ; 97 14030: 9d e9 ldi r25, 0x9D ; 157 14032: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 14036: 85 ef ldi r24, 0xF5 ; 245 14038: 94 e6 ldi r25, 0x64 ; 100 1403a: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 1403e: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 14042: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 14046: 8f 51 subi r24, 0x1F ; 31 14048: 90 4f sbci r25, 0xF0 ; 240 1404a: 0e 94 a0 7c call 0xf940 ; 0xf940 SERIAL_ECHOLNPGM("\"(1)"); 1404e: 8b e4 ldi r24, 0x4B ; 75 14050: 9f e7 ldi r25, 0x7F ; 127 14052: 0e 94 49 72 call 0xe492 ; 0xe492 14056: 0c 94 0f 98 jmp 0x1301e ; 0x1301e { switch(code_value_uint8()) { case 0: { cs.autoretract_enabled=false; 1405a: 10 92 b4 04 sts 0x04B4, r1 ; 0x8004b4 retracted[0]=false; 1405e: 10 92 03 05 sts 0x0503, r1 ; 0x800503 14062: 0c 94 0f 98 jmp 0x1301e ; 0x1301e retracted[2]=false; #endif }break; case 1: { cs.autoretract_enabled=true; 14066: 80 93 b4 04 sts 0x04B4, r24 ; 0x8004b4 retracted[0]=false; 1406a: 10 92 03 05 sts 0x0503, r1 ; 0x800503 1406e: 0c 94 0f 98 jmp 0x1301e ; 0x1301e 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; 14072: 40 90 f6 04 lds r4, 0x04F6 ; 0x8004f6 14076: 50 90 f7 04 lds r5, 0x04F7 ; 0x8004f7 1407a: 60 90 f8 04 lds r6, 0x04F8 ; 0x8004f8 1407e: 70 90 f9 04 lds r7, 0x04F9 ; 0x8004f9 14082: 0c 94 3f 95 jmp 0x12a7e ; 0x12a7e float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 14086: 80 90 fa 04 lds r8, 0x04FA ; 0x8004fa 1408a: 90 90 fb 04 lds r9, 0x04FB ; 0x8004fb 1408e: a0 90 fc 04 lds r10, 0x04FC ; 0x8004fc 14092: b0 90 fd 04 lds r11, 0x04FD ; 0x8004fd 14096: 0c 94 4a 95 jmp 0x12a94 ; 0x12a94 - `R` - Restore previous speed factor */ case 220: { bool codesWereSeen = false; if (code_seen('B')) //backup current speed factor 1409a: 82 e4 ldi r24, 0x42 ; 66 1409c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 140a0: 18 2f mov r17, r24 140a2: 88 23 and r24, r24 140a4: 41 f0 breq .+16 ; 0x140b6 { saved_feedmultiply_mm = feedmultiply; 140a6: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 140aa: 90 91 8f 02 lds r25, 0x028F ; 0x80028f 140ae: 90 93 31 02 sts 0x0231, r25 ; 0x800231 140b2: 80 93 30 02 sts 0x0230, r24 ; 0x800230 codesWereSeen = true; } if (code_seen('S')) 140b6: 83 e5 ldi r24, 0x53 ; 83 140b8: 0e 94 2b 55 call 0xaa56 ; 0xaa56 140bc: 08 2f mov r16, r24 140be: 88 23 and r24, r24 140c0: 39 f0 breq .+14 ; 0x140d0 { feedmultiply = code_value_short(); 140c2: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 140c6: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 140ca: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e codesWereSeen = true; 140ce: 10 2f mov r17, r16 } if (code_seen('R')) //restore previous feedmultiply 140d0: 82 e5 ldi r24, 0x52 ; 82 140d2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 140d6: 88 23 and r24, r24 140d8: 51 f0 breq .+20 ; 0x140ee { feedmultiply = saved_feedmultiply_mm; 140da: 80 91 30 02 lds r24, 0x0230 ; 0x800230 140de: 90 91 31 02 lds r25, 0x0231 ; 0x800231 140e2: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 140e6: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e 140ea: 0c 94 0f 98 jmp 0x1301e ; 0x1301e codesWereSeen = true; } if (!codesWereSeen) 140ee: 11 11 cpse r17, r1 140f0: 0c 94 0f 98 jmp 0x1301e ; 0x1301e { printf_P(PSTR("%i%%\n"), feedmultiply); 140f4: 80 91 8f 02 lds r24, 0x028F ; 0x80028f 140f8: 8f 93 push r24 140fa: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 140fe: 8f 93 push r24 14100: 85 e4 ldi r24, 0x45 ; 69 14102: 9f e7 ldi r25, 0x7F ; 127 14104: 9f 93 push r25 14106: 8f 93 push r24 14108: 0f 94 5d 9f call 0x33eba ; 0x33eba 1410c: 0f 90 pop r0 1410e: 0f 90 pop r0 14110: 0f 90 pop r0 14112: 0f 90 pop r0 14114: 0c 94 0f 98 jmp 0x1301e ; 0x1301e #### Parameters - `S` - Extrude factor override percentage (0..100 or higher), default 100% */ case 221: { if (code_seen('S')) 14118: 83 e5 ldi r24, 0x53 ; 83 1411a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1411e: 88 23 and r24, r24 14120: 51 f0 breq .+20 ; 0x14136 { extrudemultiply = code_value_short(); 14122: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 14126: 90 93 5a 02 sts 0x025A, r25 ; 0x80025a 1412a: 80 93 59 02 sts 0x0259, r24 ; 0x800259 calculate_extruder_multipliers(); 1412e: 0e 94 c8 5e call 0xbd90 ; 0xbd90 14132: 0c 94 0f 98 jmp 0x1301e ; 0x1301e } else { printf_P(PSTR("%i%%\n"), extrudemultiply); 14136: 80 91 5a 02 lds r24, 0x025A ; 0x80025a 1413a: 8f 93 push r24 1413c: 80 91 59 02 lds r24, 0x0259 ; 0x800259 14140: 8f 93 push r24 14142: 8f e3 ldi r24, 0x3F ; 63 14144: 9f e7 ldi r25, 0x7F ; 127 14146: 9f 93 push r25 14148: 8f 93 push r24 1414a: 0f 94 5d 9f call 0x33eba ; 0x33eba 1414e: 0f 90 pop r0 14150: 0f 90 pop r0 14152: 0f 90 pop r0 14154: 0f 90 pop r0 14156: 0c 94 0f 98 jmp 0x1301e ; 0x1301e - `P` - pin number - `S` - pin state */ case 226: { if(code_seen('P')){ 1415a: 80 e5 ldi r24, 0x50 ; 80 1415c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 14160: 88 23 and r24, r24 14162: 11 f4 brne .+4 ; 0x14168 14164: 0c 94 0f 98 jmp 0x1301e ; 0x1301e int pin_number = code_value_short(); // pin number 14168: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 1416c: 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 1416e: 83 e5 ldi r24, 0x53 ; 83 14170: 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 14174: 0f ef ldi r16, 0xFF ; 255 14176: 1f ef ldi r17, 0xFF ; 255 if(code_seen('S')) pin_state = code_value_short(); // required pin state 14178: 88 23 and r24, r24 1417a: 19 f0 breq .+6 ; 0x14182 1417c: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 14180: 8c 01 movw r16, r24 if(pin_state >= -1 && pin_state <= 1){ 14182: c8 01 movw r24, r16 14184: 01 96 adiw r24, 0x01 ; 1 14186: 03 97 sbiw r24, 0x03 ; 3 14188: 10 f0 brcs .+4 ; 0x1418e 1418a: 0c 94 0f 98 jmp 0x1301e ; 0x1301e 1418e: e3 e3 ldi r30, 0x33 ; 51 14190: f0 e8 ldi r31, 0x80 ; 128 14192: 2f e4 ldi r18, 0x4F ; 79 14194: 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)) 14196: 84 91 lpm r24, Z 14198: 08 2e mov r0, r24 1419a: 00 0c add r0, r0 1419c: 99 0b sbc r25, r25 1419e: e8 16 cp r14, r24 141a0: f9 06 cpc r15, r25 141a2: 11 f4 brne .+4 ; 0x141a8 141a4: 0c 94 0f 98 jmp 0x1301e ; 0x1301e 141a8: 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++) 141aa: 2e 17 cp r18, r30 141ac: 3f 07 cpc r19, r31 141ae: 99 f7 brne .-26 ; 0x14196 pin_number = -1; break; } } if (pin_number > -1) 141b0: f7 fe sbrs r15, 7 141b2: 02 c0 rjmp .+4 ; 0x141b8 141b4: 0c 94 0f 98 jmp 0x1301e ; 0x1301e { int target = LOW; st_synchronize(); 141b8: 0f 94 ce 22 call 0x2459c ; 0x2459c pinMode(pin_number, INPUT); 141bc: de 2c mov r13, r14 141be: 60 e0 ldi r22, 0x00 ; 0 141c0: 8e 2d mov r24, r14 141c2: 0e 94 3d c0 call 0x1807a ; 0x1807a switch(pin_state){ 141c6: 0f 3f cpi r16, 0xFF ; 255 141c8: 10 07 cpc r17, r16 141ca: b1 f0 breq .+44 ; 0x141f8 141cc: 01 30 cpi r16, 0x01 ; 1 141ce: 11 05 cpc r17, r1 141d0: 11 f0 breq .+4 ; 0x141d6 } } if (pin_number > -1) { int target = LOW; 141d2: 10 e0 ldi r17, 0x00 ; 0 141d4: 00 e0 ldi r16, 0x00 ; 0 case -1: target = !digitalRead(pin_number); break; } while(digitalRead(pin_number) != target){ 141d6: 8d 2d mov r24, r13 141d8: 0e 94 e6 bf call 0x17fcc ; 0x17fcc 141dc: 80 17 cp r24, r16 141de: 91 07 cpc r25, r17 141e0: 11 f4 brne .+4 ; 0x141e6 141e2: 0c 94 0f 98 jmp 0x1301e ; 0x1301e manage_heater(); 141e6: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(); 141ea: 80 e0 ldi r24, 0x00 ; 0 141ec: 0e 94 fe 79 call 0xf3fc ; 0xf3fc lcd_update(0); 141f0: 80 e0 ldi r24, 0x00 ; 0 141f2: 0e 94 38 69 call 0xd270 ; 0xd270 141f6: ef cf rjmp .-34 ; 0x141d6 case 0: target = LOW; break; case -1: target = !digitalRead(pin_number); 141f8: 8e 2d mov r24, r14 141fa: 0e 94 e6 bf call 0x17fcc ; 0x17fcc 141fe: 31 e0 ldi r19, 0x01 ; 1 14200: 20 e0 ldi r18, 0x00 ; 0 14202: 89 2b or r24, r25 14204: 09 f0 breq .+2 ; 0x14208 14206: 30 e0 ldi r19, 0x00 ; 0 14208: 03 2f mov r16, r19 1420a: 12 2f mov r17, r18 1420c: e4 cf rjmp .-56 ; 0x141d6 case 300: // M300 { uint16_t beepP = code_seen('P') ? min(code_value(), 3500) : 1000; uint16_t beepS; if (!code_seen('S')) beepS = 0; 1420e: 70 e0 ldi r23, 0x00 ; 0 14210: 60 e0 ldi r22, 0x00 ; 0 // handle S0 as a pause _delay(beepP); break; } } Sound_MakeCustom(beepP, beepS, false); 14212: 40 e0 ldi r20, 0x00 ; 0 14214: c8 01 movw r24, r16 14216: 0f 94 6f 32 call 0x264de ; 0x264de 1421a: 0c 94 0f 98 jmp 0x1301e ; 0x1301e - `I` - integral (Ki) - `D` - derivative (Kd) */ case 301: { if(code_seen('P')) cs.Kp = code_value(); 1421e: 80 e5 ldi r24, 0x50 ; 80 14220: 0e 94 2b 55 call 0xaa56 ; 0xaa56 14224: 88 23 and r24, r24 14226: 51 f0 breq .+20 ; 0x1423c 14228: 0e 94 03 5a call 0xb406 ; 0xb406 1422c: 60 93 9a 04 sts 0x049A, r22 ; 0x80049a 14230: 70 93 9b 04 sts 0x049B, r23 ; 0x80049b 14234: 80 93 9c 04 sts 0x049C, r24 ; 0x80049c 14238: 90 93 9d 04 sts 0x049D, r25 ; 0x80049d if(code_seen('I')) cs.Ki = scalePID_i(code_value()); 1423c: 89 e4 ldi r24, 0x49 ; 73 1423e: 0e 94 2b 55 call 0xaa56 ; 0xaa56 14242: 88 23 and r24, r24 14244: 81 f0 breq .+32 ; 0x14266 14246: 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; 1424a: 2c ea ldi r18, 0xAC ; 172 1424c: 35 ec ldi r19, 0xC5 ; 197 1424e: 47 e2 ldi r20, 0x27 ; 39 14250: 5e e3 ldi r21, 0x3E ; 62 14252: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 14256: 60 93 9e 04 sts 0x049E, r22 ; 0x80049e 1425a: 70 93 9f 04 sts 0x049F, r23 ; 0x80049f 1425e: 80 93 a0 04 sts 0x04A0, r24 ; 0x8004a0 14262: 90 93 a1 04 sts 0x04A1, r25 ; 0x8004a1 if(code_seen('D')) cs.Kd = scalePID_d(code_value()); 14266: 84 e4 ldi r24, 0x44 ; 68 14268: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1426c: 88 23 and r24, r24 1426e: 81 f0 breq .+32 ; 0x14290 14270: 0e 94 03 5a call 0xb406 ; 0xb406 } float unscalePID_i(float i) { return i/PID_dT; 14274: 2c ea ldi r18, 0xAC ; 172 14276: 35 ec ldi r19, 0xC5 ; 197 14278: 47 e2 ldi r20, 0x27 ; 39 1427a: 5e e3 ldi r21, 0x3E ; 62 1427c: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 14280: 60 93 a2 04 sts 0x04A2, r22 ; 0x8004a2 14284: 70 93 a3 04 sts 0x04A3, r23 ; 0x8004a3 14288: 80 93 a4 04 sts 0x04A4, r24 ; 0x8004a4 1428c: 90 93 a5 04 sts 0x04A5, r25 ; 0x8004a5 updatePID(); 14290: 0f 94 22 19 call 0x23244 ; 0x23244 SERIAL_PROTOCOLRPGM(MSG_OK); 14294: 81 e3 ldi r24, 0x31 ; 49 14296: 99 e6 ldi r25, 0x69 ; 105 14298: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_PROTOCOLPGM(" p:"); 1429c: 8b e3 ldi r24, 0x3B ; 59 1429e: 9f e7 ldi r25, 0x7F ; 127 142a0: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 142a4: 60 91 9a 04 lds r22, 0x049A ; 0x80049a 142a8: 70 91 9b 04 lds r23, 0x049B ; 0x80049b 142ac: 80 91 9c 04 lds r24, 0x049C ; 0x80049c 142b0: 90 91 9d 04 lds r25, 0x049D ; 0x80049d 142b4: 42 e0 ldi r20, 0x02 ; 2 142b6: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOL(cs.Kp); SERIAL_PROTOCOLPGM(" i:"); 142ba: 87 e3 ldi r24, 0x37 ; 55 142bc: 9f e7 ldi r25, 0x7F ; 127 142be: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 142c2: 2c ea ldi r18, 0xAC ; 172 142c4: 35 ec ldi r19, 0xC5 ; 197 142c6: 47 e2 ldi r20, 0x27 ; 39 142c8: 5e e3 ldi r21, 0x3E ; 62 142ca: 60 91 9e 04 lds r22, 0x049E ; 0x80049e 142ce: 70 91 9f 04 lds r23, 0x049F ; 0x80049f 142d2: 80 91 a0 04 lds r24, 0x04A0 ; 0x8004a0 142d6: 90 91 a1 04 lds r25, 0x04A1 ; 0x8004a1 142da: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 142de: 42 e0 ldi r20, 0x02 ; 2 142e0: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOL(unscalePID_i(cs.Ki)); SERIAL_PROTOCOLPGM(" d:"); 142e4: 83 e3 ldi r24, 0x33 ; 51 142e6: 9f e7 ldi r25, 0x7F ; 127 142e8: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 142ec: 2c ea ldi r18, 0xAC ; 172 142ee: 35 ec ldi r19, 0xC5 ; 197 142f0: 47 e2 ldi r20, 0x27 ; 39 142f2: 5e e3 ldi r21, 0x3E ; 62 142f4: 60 91 a2 04 lds r22, 0x04A2 ; 0x8004a2 142f8: 70 91 a3 04 lds r23, 0x04A3 ; 0x8004a3 142fc: 80 91 a4 04 lds r24, 0x04A4 ; 0x8004a4 14300: 90 91 a5 04 lds r25, 0x04A5 ; 0x8004a5 14304: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.Kd)); 14308: 0f 94 45 42 call 0x2848a ; 0x2848a 1430c: 0c 94 0f 98 jmp 0x1301e ; 0x1301e - `I` - integral (Ki) - `D` - derivative (Kd) */ case 304: { if(code_seen('P')) cs.bedKp = code_value(); 14310: 80 e5 ldi r24, 0x50 ; 80 14312: 0e 94 2b 55 call 0xaa56 ; 0xaa56 14316: 88 23 and r24, r24 14318: 51 f0 breq .+20 ; 0x1432e 1431a: 0e 94 03 5a call 0xb406 ; 0xb406 1431e: 60 93 a6 04 sts 0x04A6, r22 ; 0x8004a6 14322: 70 93 a7 04 sts 0x04A7, r23 ; 0x8004a7 14326: 80 93 a8 04 sts 0x04A8, r24 ; 0x8004a8 1432a: 90 93 a9 04 sts 0x04A9, r25 ; 0x8004a9 if(code_seen('I')) cs.bedKi = scalePID_i(code_value()); 1432e: 89 e4 ldi r24, 0x49 ; 73 14330: 0e 94 2b 55 call 0xaa56 ; 0xaa56 14334: 88 23 and r24, r24 14336: 81 f0 breq .+32 ; 0x14358 14338: 0e 94 03 5a call 0xb406 ; 0xb406 1433c: 2c ea ldi r18, 0xAC ; 172 1433e: 35 ec ldi r19, 0xC5 ; 197 14340: 47 e2 ldi r20, 0x27 ; 39 14342: 5e e3 ldi r21, 0x3E ; 62 14344: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 14348: 60 93 aa 04 sts 0x04AA, r22 ; 0x8004aa 1434c: 70 93 ab 04 sts 0x04AB, r23 ; 0x8004ab 14350: 80 93 ac 04 sts 0x04AC, r24 ; 0x8004ac 14354: 90 93 ad 04 sts 0x04AD, r25 ; 0x8004ad if(code_seen('D')) cs.bedKd = scalePID_d(code_value()); 14358: 84 e4 ldi r24, 0x44 ; 68 1435a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1435e: 88 23 and r24, r24 14360: 81 f0 breq .+32 ; 0x14382 14362: 0e 94 03 5a call 0xb406 ; 0xb406 } float unscalePID_i(float i) { return i/PID_dT; 14366: 2c ea ldi r18, 0xAC ; 172 14368: 35 ec ldi r19, 0xC5 ; 197 1436a: 47 e2 ldi r20, 0x27 ; 39 1436c: 5e e3 ldi r21, 0x3E ; 62 1436e: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 14372: 60 93 ae 04 sts 0x04AE, r22 ; 0x8004ae 14376: 70 93 af 04 sts 0x04AF, r23 ; 0x8004af 1437a: 80 93 b0 04 sts 0x04B0, r24 ; 0x8004b0 1437e: 90 93 b1 04 sts 0x04B1, r25 ; 0x8004b1 updatePID(); 14382: 0f 94 22 19 call 0x23244 ; 0x23244 SERIAL_PROTOCOLRPGM(MSG_OK); 14386: 81 e3 ldi r24, 0x31 ; 49 14388: 99 e6 ldi r25, 0x69 ; 105 1438a: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_PROTOCOLPGM(" p:"); 1438e: 8f e2 ldi r24, 0x2F ; 47 14390: 9f e7 ldi r25, 0x7F ; 127 14392: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 14396: 60 91 a6 04 lds r22, 0x04A6 ; 0x8004a6 1439a: 70 91 a7 04 lds r23, 0x04A7 ; 0x8004a7 1439e: 80 91 a8 04 lds r24, 0x04A8 ; 0x8004a8 143a2: 90 91 a9 04 lds r25, 0x04A9 ; 0x8004a9 143a6: 42 e0 ldi r20, 0x02 ; 2 143a8: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOL(cs.bedKp); SERIAL_PROTOCOLPGM(" i:"); 143ac: 8b e2 ldi r24, 0x2B ; 43 143ae: 9f e7 ldi r25, 0x7F ; 127 143b0: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 143b4: 2c ea ldi r18, 0xAC ; 172 143b6: 35 ec ldi r19, 0xC5 ; 197 143b8: 47 e2 ldi r20, 0x27 ; 39 143ba: 5e e3 ldi r21, 0x3E ; 62 143bc: 60 91 aa 04 lds r22, 0x04AA ; 0x8004aa 143c0: 70 91 ab 04 lds r23, 0x04AB ; 0x8004ab 143c4: 80 91 ac 04 lds r24, 0x04AC ; 0x8004ac 143c8: 90 91 ad 04 lds r25, 0x04AD ; 0x8004ad 143cc: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 143d0: 42 e0 ldi r20, 0x02 ; 2 143d2: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOL(unscalePID_i(cs.bedKi)); SERIAL_PROTOCOLPGM(" d:"); 143d6: 87 e2 ldi r24, 0x27 ; 39 143d8: 9f e7 ldi r25, 0x7F ; 127 143da: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 143de: 2c ea ldi r18, 0xAC ; 172 143e0: 35 ec ldi r19, 0xC5 ; 197 143e2: 47 e2 ldi r20, 0x27 ; 39 143e4: 5e e3 ldi r21, 0x3E ; 62 143e6: 60 91 ae 04 lds r22, 0x04AE ; 0x8004ae 143ea: 70 91 af 04 lds r23, 0x04AF ; 0x8004af 143ee: 80 91 b0 04 lds r24, 0x04B0 ; 0x8004b0 143f2: 90 91 b1 04 lds r25, 0x04B1 ; 0x8004b1 143f6: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.bedKd)); 143fa: 0f 94 45 42 call 0x2848a ; 0x2848a 143fe: 0c 94 0f 98 jmp 0x1301e ; 0x1301e - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; if (code_seen('S')) temp=code_value_short(); 14402: 83 e5 ldi r24, 0x53 ; 83 14404: 0e 94 2b 55 call 0xaa56 ; 0xaa56 14408: 88 23 and r24, r24 1440a: 41 f0 breq .+16 ; 0x1441c 1440c: 0e 94 4d 55 call 0xaa9a ; 0xaa9a } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 14410: 90 93 58 02 sts 0x0258, r25 ; 0x800258 14414: 80 93 57 02 sts 0x0257, r24 ; 0x800257 14418: 0c 94 0f 98 jmp 0x1301e ; 0x1301e #### Parameters - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; 1441c: 90 e0 ldi r25, 0x00 ; 0 1441e: 80 e0 ldi r24, 0x00 ; 0 14420: f7 cf rjmp .-18 ; 0x14410 */ case 303: { float temp = 150.0; int e = 0; int c = 5; 14422: 85 e0 ldi r24, 0x05 ; 5 14424: 90 e0 ldi r25, 0x00 ; 0 14426: 0c 94 21 96 jmp 0x12c42 ; 0x12c42 M400 */ case 400: { st_synchronize(); 1442a: 0f 94 ce 22 call 0x2459c ; 0x2459c 1442e: 0c 94 0f 98 jmp 0x1301e ; 0x1301e */ case 405: // M405 Enable Filament Sensor { fsensor.setEnabled(1); 14432: 81 e0 ldi r24, 0x01 ; 1 14434: 0e 94 16 6e call 0xdc2c ; 0xdc2c 14438: 0c 94 0f 98 jmp 0x1301e ; 0x1301e */ case 406: // M406 Disable Filament Sensor { fsensor.setEnabled(0); 1443c: 80 e0 ldi r24, 0x00 ; 0 1443e: 0e 94 16 6e call 0xdc2c ; 0xdc2c 14442: 0c 94 0f 98 jmp 0x1301e ; 0x1301e M420 */ case 420: // M420 Mesh bed leveling status { gcode_G81_M420(); 14446: 0e 94 2d 73 call 0xe65a ; 0xe65a 1444a: 0c 94 0f 98 jmp 0x1301e ; 0x1301e M500 */ case 500: { Config_StoreSettings(); 1444e: 0e 94 59 75 call 0xeab2 ; 0xeab2 14452: 0c 94 0f 98 jmp 0x1301e ; 0x1301e M502 */ case 502: { Config_ResetDefault(); 14456: 0e 94 c8 74 call 0xe990 ; 0xe990 1445a: 0c 94 0f 98 jmp 0x1301e ; 0x1301e 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( 1445e: 80 91 95 04 lds r24, 0x0495 ; 0x800495 14462: 8f 93 push r24 14464: 80 91 94 04 lds r24, 0x0494 ; 0x800494 14468: 8f 93 push r24 1446a: 80 91 93 04 lds r24, 0x0493 ; 0x800493 1446e: 8f 93 push r24 14470: 80 91 92 04 lds r24, 0x0492 ; 0x800492 14474: 8f 93 push r24 14476: 80 91 91 04 lds r24, 0x0491 ; 0x800491 1447a: 8f 93 push r24 1447c: 80 91 90 04 lds r24, 0x0490 ; 0x800490 14480: 8f 93 push r24 14482: 80 91 8f 04 lds r24, 0x048F ; 0x80048f 14486: 8f 93 push r24 14488: 80 91 8e 04 lds r24, 0x048E ; 0x80048e 1448c: 8f 93 push r24 1448e: 80 91 8d 04 lds r24, 0x048D ; 0x80048d 14492: 8f 93 push r24 14494: 80 91 8c 04 lds r24, 0x048C ; 0x80048c 14498: 8f 93 push r24 1449a: 80 91 8b 04 lds r24, 0x048B ; 0x80048b 1449e: 8f 93 push r24 144a0: 80 91 8a 04 lds r24, 0x048A ; 0x80048a 144a4: 8f 93 push r24 144a6: 01 e6 ldi r16, 0x61 ; 97 144a8: 1d e9 ldi r17, 0x9D ; 157 144aa: 1f 93 push r17 144ac: 0f 93 push r16 144ae: 1f 93 push r17 144b0: 0f 93 push r16 144b2: 80 91 89 04 lds r24, 0x0489 ; 0x800489 144b6: 8f 93 push r24 144b8: 80 91 88 04 lds r24, 0x0488 ; 0x800488 144bc: 8f 93 push r24 144be: 80 91 87 04 lds r24, 0x0487 ; 0x800487 144c2: 8f 93 push r24 144c4: 80 91 86 04 lds r24, 0x0486 ; 0x800486 144c8: 8f 93 push r24 144ca: 80 91 85 04 lds r24, 0x0485 ; 0x800485 144ce: 8f 93 push r24 144d0: 80 91 84 04 lds r24, 0x0484 ; 0x800484 144d4: 8f 93 push r24 144d6: 80 91 83 04 lds r24, 0x0483 ; 0x800483 144da: 8f 93 push r24 144dc: 80 91 82 04 lds r24, 0x0482 ; 0x800482 144e0: 8f 93 push r24 144e2: 80 91 81 04 lds r24, 0x0481 ; 0x800481 144e6: 8f 93 push r24 144e8: 80 91 80 04 lds r24, 0x0480 ; 0x800480 144ec: 8f 93 push r24 144ee: 80 91 7f 04 lds r24, 0x047F ; 0x80047f 144f2: 8f 93 push r24 144f4: 80 91 7e 04 lds r24, 0x047E ; 0x80047e 144f8: 8f 93 push r24 144fa: 80 91 7d 04 lds r24, 0x047D ; 0x80047d 144fe: 8f 93 push r24 14500: 80 91 7c 04 lds r24, 0x047C ; 0x80047c 14504: 8f 93 push r24 14506: 80 91 7b 04 lds r24, 0x047B ; 0x80047b 1450a: 8f 93 push r24 1450c: 80 91 7a 04 lds r24, 0x047A ; 0x80047a 14510: 8f 93 push r24 14512: 80 91 79 04 lds r24, 0x0479 ; 0x800479 14516: 8f 93 push r24 14518: 80 91 78 04 lds r24, 0x0478 ; 0x800478 1451c: 8f 93 push r24 1451e: 80 91 77 04 lds r24, 0x0477 ; 0x800477 14522: 8f 93 push r24 14524: 80 91 76 04 lds r24, 0x0476 ; 0x800476 14528: 8f 93 push r24 1452a: 80 91 75 04 lds r24, 0x0475 ; 0x800475 1452e: 8f 93 push r24 14530: 80 91 74 04 lds r24, 0x0474 ; 0x800474 14534: 8f 93 push r24 14536: 80 91 73 04 lds r24, 0x0473 ; 0x800473 1453a: 8f 93 push r24 1453c: 80 91 72 04 lds r24, 0x0472 ; 0x800472 14540: 8f 93 push r24 14542: 80 91 71 04 lds r24, 0x0471 ; 0x800471 14546: 8f 93 push r24 14548: 80 91 70 04 lds r24, 0x0470 ; 0x800470 1454c: 8f 93 push r24 1454e: 80 91 6f 04 lds r24, 0x046F ; 0x80046f 14552: 8f 93 push r24 14554: 80 91 6e 04 lds r24, 0x046E ; 0x80046e 14558: 8f 93 push r24 1455a: 1f 93 push r17 1455c: 0f 93 push r16 1455e: 1f 93 push r17 14560: 0f 93 push r16 14562: 80 91 f5 04 lds r24, 0x04F5 ; 0x8004f5 14566: 8f 93 push r24 14568: 80 91 f4 04 lds r24, 0x04F4 ; 0x8004f4 1456c: 8f 93 push r24 1456e: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 14572: 8f 93 push r24 14574: 80 91 f2 04 lds r24, 0x04F2 ; 0x8004f2 14578: 8f 93 push r24 1457a: 80 91 6d 04 lds r24, 0x046D ; 0x80046d 1457e: 8f 93 push r24 14580: 80 91 6c 04 lds r24, 0x046C ; 0x80046c 14584: 8f 93 push r24 14586: 80 91 6b 04 lds r24, 0x046B ; 0x80046b 1458a: 8f 93 push r24 1458c: 80 91 6a 04 lds r24, 0x046A ; 0x80046a 14590: 8f 93 push r24 14592: 80 91 69 04 lds r24, 0x0469 ; 0x800469 14596: 8f 93 push r24 14598: 80 91 68 04 lds r24, 0x0468 ; 0x800468 1459c: 8f 93 push r24 1459e: 80 91 67 04 lds r24, 0x0467 ; 0x800467 145a2: 8f 93 push r24 145a4: 80 91 66 04 lds r24, 0x0466 ; 0x800466 145a8: 8f 93 push r24 145aa: 1f 93 push r17 145ac: 0f 93 push r16 145ae: 1f 93 push r17 145b0: 0f 93 push r16 145b2: 80 91 65 04 lds r24, 0x0465 ; 0x800465 145b6: 8f 93 push r24 145b8: 80 91 64 04 lds r24, 0x0464 ; 0x800464 145bc: 8f 93 push r24 145be: 80 91 63 04 lds r24, 0x0463 ; 0x800463 145c2: 8f 93 push r24 145c4: 80 91 62 04 lds r24, 0x0462 ; 0x800462 145c8: 8f 93 push r24 145ca: 80 91 61 04 lds r24, 0x0461 ; 0x800461 145ce: 8f 93 push r24 145d0: 80 91 60 04 lds r24, 0x0460 ; 0x800460 145d4: 8f 93 push r24 145d6: 80 91 5f 04 lds r24, 0x045F ; 0x80045f 145da: 8f 93 push r24 145dc: 80 91 5e 04 lds r24, 0x045E ; 0x80045e 145e0: 8f 93 push r24 145e2: 80 91 5d 04 lds r24, 0x045D ; 0x80045d 145e6: 8f 93 push r24 145e8: 80 91 5c 04 lds r24, 0x045C ; 0x80045c 145ec: 8f 93 push r24 145ee: 80 91 5b 04 lds r24, 0x045B ; 0x80045b 145f2: 8f 93 push r24 145f4: 80 91 5a 04 lds r24, 0x045A ; 0x80045a 145f8: 8f 93 push r24 145fa: 80 91 59 04 lds r24, 0x0459 ; 0x800459 145fe: 8f 93 push r24 14600: 80 91 58 04 lds r24, 0x0458 ; 0x800458 14604: 8f 93 push r24 14606: 80 91 57 04 lds r24, 0x0457 ; 0x800457 1460a: 8f 93 push r24 1460c: 80 91 56 04 lds r24, 0x0456 ; 0x800456 14610: 8f 93 push r24 14612: 1f 93 push r17 14614: 0f 93 push r16 14616: 1f 93 push r17 14618: 0f 93 push r16 1461a: 80 91 55 04 lds r24, 0x0455 ; 0x800455 1461e: 8f 93 push r24 14620: 80 91 54 04 lds r24, 0x0454 ; 0x800454 14624: 8f 93 push r24 14626: 80 91 53 04 lds r24, 0x0453 ; 0x800453 1462a: 8f 93 push r24 1462c: 80 91 52 04 lds r24, 0x0452 ; 0x800452 14630: 8f 93 push r24 14632: 80 91 51 04 lds r24, 0x0451 ; 0x800451 14636: 8f 93 push r24 14638: 80 91 50 04 lds r24, 0x0450 ; 0x800450 1463c: 8f 93 push r24 1463e: 80 91 4f 04 lds r24, 0x044F ; 0x80044f 14642: 8f 93 push r24 14644: 80 91 4e 04 lds r24, 0x044E ; 0x80044e 14648: 8f 93 push r24 1464a: 80 91 4d 04 lds r24, 0x044D ; 0x80044d 1464e: 8f 93 push r24 14650: 80 91 4c 04 lds r24, 0x044C ; 0x80044c 14654: 8f 93 push r24 14656: 80 91 4b 04 lds r24, 0x044B ; 0x80044b 1465a: 8f 93 push r24 1465c: 80 91 4a 04 lds r24, 0x044A ; 0x80044a 14660: 8f 93 push r24 14662: 80 91 49 04 lds r24, 0x0449 ; 0x800449 14666: 8f 93 push r24 14668: 80 91 48 04 lds r24, 0x0448 ; 0x800448 1466c: 8f 93 push r24 1466e: 80 91 47 04 lds r24, 0x0447 ; 0x800447 14672: 8f 93 push r24 14674: 80 91 46 04 lds r24, 0x0446 ; 0x800446 14678: 8f 93 push r24 1467a: 1f 93 push r17 1467c: 0f 93 push r16 1467e: 1f 93 push r17 14680: 0f 93 push r16 14682: 80 91 45 04 lds r24, 0x0445 ; 0x800445 14686: 8f 93 push r24 14688: 80 91 44 04 lds r24, 0x0444 ; 0x800444 1468c: 8f 93 push r24 1468e: 80 91 43 04 lds r24, 0x0443 ; 0x800443 14692: 8f 93 push r24 14694: 80 91 42 04 lds r24, 0x0442 ; 0x800442 14698: 8f 93 push r24 1469a: 80 91 41 04 lds r24, 0x0441 ; 0x800441 1469e: 8f 93 push r24 146a0: 80 91 40 04 lds r24, 0x0440 ; 0x800440 146a4: 8f 93 push r24 146a6: 80 91 3f 04 lds r24, 0x043F ; 0x80043f 146aa: 8f 93 push r24 146ac: 80 91 3e 04 lds r24, 0x043E ; 0x80043e 146b0: 8f 93 push r24 146b2: 80 91 3d 04 lds r24, 0x043D ; 0x80043d 146b6: 8f 93 push r24 146b8: 80 91 3c 04 lds r24, 0x043C ; 0x80043c 146bc: 8f 93 push r24 146be: 80 91 3b 04 lds r24, 0x043B ; 0x80043b 146c2: 8f 93 push r24 146c4: 80 91 3a 04 lds r24, 0x043A ; 0x80043a 146c8: 8f 93 push r24 146ca: 80 91 39 04 lds r24, 0x0439 ; 0x800439 146ce: 8f 93 push r24 146d0: 80 91 38 04 lds r24, 0x0438 ; 0x800438 146d4: 8f 93 push r24 146d6: 80 91 37 04 lds r24, 0x0437 ; 0x800437 146da: 8f 93 push r24 146dc: 80 91 36 04 lds r24, 0x0436 ; 0x800436 146e0: 8f 93 push r24 146e2: 1f 93 push r17 146e4: 0f 93 push r16 146e6: 1f 93 push r17 146e8: 0f 93 push r16 146ea: 8a e6 ldi r24, 0x6A ; 106 146ec: 9b e7 ldi r25, 0x7B ; 123 146ee: 9f 93 push r25 146f0: 8f 93 push r24 146f2: 0f 94 5d 9f call 0x33eba ; 0x33eba 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"), 146f6: 0f b6 in r0, 0x3f ; 63 146f8: f8 94 cli 146fa: de bf out 0x3e, r29 ; 62 146fc: 0f be out 0x3f, r0 ; 63 146fe: cd bf out 0x3d, r28 ; 61 14700: 2c ea ldi r18, 0xAC ; 172 14702: 35 ec ldi r19, 0xC5 ; 197 14704: 47 e2 ldi r20, 0x27 ; 39 14706: 5e e3 ldi r21, 0x3E ; 62 14708: 60 91 a2 04 lds r22, 0x04A2 ; 0x8004a2 1470c: 70 91 a3 04 lds r23, 0x04A3 ; 0x8004a3 14710: 80 91 a4 04 lds r24, 0x04A4 ; 0x8004a4 14714: 90 91 a5 04 lds r25, 0x04A5 ; 0x8004a5 14718: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1471c: 9f 93 push r25 1471e: 8f 93 push r24 14720: 7f 93 push r23 14722: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 14724: 2c ea ldi r18, 0xAC ; 172 14726: 35 ec ldi r19, 0xC5 ; 197 14728: 47 e2 ldi r20, 0x27 ; 39 1472a: 5e e3 ldi r21, 0x3E ; 62 1472c: 60 91 9e 04 lds r22, 0x049E ; 0x80049e 14730: 70 91 9f 04 lds r23, 0x049F ; 0x80049f 14734: 80 91 a0 04 lds r24, 0x04A0 ; 0x8004a0 14738: 90 91 a1 04 lds r25, 0x04A1 ; 0x8004a1 1473c: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 14740: 9f 93 push r25 14742: 8f 93 push r24 14744: 7f 93 push r23 14746: 6f 93 push r22 14748: 80 91 9d 04 lds r24, 0x049D ; 0x80049d 1474c: 8f 93 push r24 1474e: 80 91 9c 04 lds r24, 0x049C ; 0x80049c 14752: 8f 93 push r24 14754: 80 91 9b 04 lds r24, 0x049B ; 0x80049b 14758: 8f 93 push r24 1475a: 80 91 9a 04 lds r24, 0x049A ; 0x80049a 1475e: 8f 93 push r24 14760: 1f 93 push r17 14762: 0f 93 push r16 14764: 1f 93 push r17 14766: 0f 93 push r16 14768: 8d e3 ldi r24, 0x3D ; 61 1476a: 9b e7 ldi r25, 0x7B ; 123 1476c: 9f 93 push r25 1476e: 8f 93 push r24 14770: 0f 94 5d 9f call 0x33eba ; 0x33eba #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 14774: 2c ea ldi r18, 0xAC ; 172 14776: 35 ec ldi r19, 0xC5 ; 197 14778: 47 e2 ldi r20, 0x27 ; 39 1477a: 5e e3 ldi r21, 0x3E ; 62 1477c: 60 91 ae 04 lds r22, 0x04AE ; 0x8004ae 14780: 70 91 af 04 lds r23, 0x04AF ; 0x8004af 14784: 80 91 b0 04 lds r24, 0x04B0 ; 0x8004b0 14788: 90 91 b1 04 lds r25, 0x04B1 ; 0x8004b1 1478c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__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"), 14790: 9f 93 push r25 14792: 8f 93 push r24 14794: 7f 93 push r23 14796: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 14798: 2c ea ldi r18, 0xAC ; 172 1479a: 35 ec ldi r19, 0xC5 ; 197 1479c: 47 e2 ldi r20, 0x27 ; 39 1479e: 5e e3 ldi r21, 0x3E ; 62 147a0: 60 91 aa 04 lds r22, 0x04AA ; 0x8004aa 147a4: 70 91 ab 04 lds r23, 0x04AB ; 0x8004ab 147a8: 80 91 ac 04 lds r24, 0x04AC ; 0x8004ac 147ac: 90 91 ad 04 lds r25, 0x04AD ; 0x8004ad 147b0: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 147b4: 9f 93 push r25 147b6: 8f 93 push r24 147b8: 7f 93 push r23 147ba: 6f 93 push r22 147bc: 80 91 a9 04 lds r24, 0x04A9 ; 0x8004a9 147c0: 8f 93 push r24 147c2: 80 91 a8 04 lds r24, 0x04A8 ; 0x8004a8 147c6: 8f 93 push r24 147c8: 80 91 a7 04 lds r24, 0x04A7 ; 0x8004a7 147cc: 8f 93 push r24 147ce: 80 91 a6 04 lds r24, 0x04A6 ; 0x8004a6 147d2: 8f 93 push r24 147d4: 1f 93 push r17 147d6: 0f 93 push r16 147d8: 1f 93 push r17 147da: 0f 93 push r16 147dc: 88 e0 ldi r24, 0x08 ; 8 147de: 9b e7 ldi r25, 0x7B ; 123 147e0: 9f 93 push r25 147e2: 8f 93 push r24 147e4: 0f 94 5d 9f call 0x33eba ; 0x33eba echomagic, echomagic, cs.bedKp, unscalePID_i(cs.bedKi), unscalePID_d(cs.bedKd)); #endif #ifdef FWRETRACT printf_P(PSTR( 147e8: 0f b6 in r0, 0x3f ; 63 147ea: f8 94 cli 147ec: de bf out 0x3e, r29 ; 62 147ee: 0f be out 0x3f, r0 ; 63 147f0: cd bf out 0x3d, r28 ; 61 147f2: 80 91 b4 04 lds r24, 0x04B4 ; 0x8004b4 147f6: 1f 92 push r1 147f8: 8f 93 push r24 147fa: 1f 93 push r17 147fc: 0f 93 push r16 147fe: 1f 93 push r17 14800: 0f 93 push r16 14802: 20 e0 ldi r18, 0x00 ; 0 14804: 30 e0 ldi r19, 0x00 ; 0 14806: 40 e7 ldi r20, 0x70 ; 112 14808: 52 e4 ldi r21, 0x42 ; 66 1480a: 60 91 c5 04 lds r22, 0x04C5 ; 0x8004c5 1480e: 70 91 c6 04 lds r23, 0x04C6 ; 0x8004c6 14812: 80 91 c7 04 lds r24, 0x04C7 ; 0x8004c7 14816: 90 91 c8 04 lds r25, 0x04C8 ; 0x8004c8 1481a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1481e: 9f 93 push r25 14820: 8f 93 push r24 14822: 7f 93 push r23 14824: 6f 93 push r22 14826: 80 91 c4 04 lds r24, 0x04C4 ; 0x8004c4 1482a: 8f 93 push r24 1482c: 80 91 c3 04 lds r24, 0x04C3 ; 0x8004c3 14830: 8f 93 push r24 14832: 80 91 c2 04 lds r24, 0x04C2 ; 0x8004c2 14836: 8f 93 push r24 14838: 80 91 c1 04 lds r24, 0x04C1 ; 0x8004c1 1483c: 8f 93 push r24 1483e: 1f 93 push r17 14840: 0f 93 push r16 14842: 1f 93 push r17 14844: 0f 93 push r16 14846: 80 91 c0 04 lds r24, 0x04C0 ; 0x8004c0 1484a: 8f 93 push r24 1484c: 80 91 bf 04 lds r24, 0x04BF ; 0x8004bf 14850: 8f 93 push r24 14852: 80 91 be 04 lds r24, 0x04BE ; 0x8004be 14856: 8f 93 push r24 14858: 80 91 bd 04 lds r24, 0x04BD ; 0x8004bd 1485c: 8f 93 push r24 1485e: 20 e0 ldi r18, 0x00 ; 0 14860: 30 e0 ldi r19, 0x00 ; 0 14862: 40 e7 ldi r20, 0x70 ; 112 14864: 52 e4 ldi r21, 0x42 ; 66 14866: 60 91 b9 04 lds r22, 0x04B9 ; 0x8004b9 1486a: 70 91 ba 04 lds r23, 0x04BA ; 0x8004ba 1486e: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 14872: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 14876: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1487a: 9f 93 push r25 1487c: 8f 93 push r24 1487e: 7f 93 push r23 14880: 6f 93 push r22 14882: 80 91 b8 04 lds r24, 0x04B8 ; 0x8004b8 14886: 8f 93 push r24 14888: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 1488c: 8f 93 push r24 1488e: 80 91 b6 04 lds r24, 0x04B6 ; 0x8004b6 14892: 8f 93 push r24 14894: 80 91 b5 04 lds r24, 0x04B5 ; 0x8004b5 14898: 8f 93 push r24 1489a: 1f 93 push r17 1489c: 0f 93 push r16 1489e: 1f 93 push r17 148a0: 0f 93 push r16 148a2: 87 e0 ldi r24, 0x07 ; 7 148a4: 9a e7 ldi r25, 0x7A ; 122 148a6: 9f 93 push r25 148a8: 8f 93 push r24 148aa: 0f 94 5d 9f call 0x33eba ; 0x33eba ); #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) { 148ae: 0f b6 in r0, 0x3f ; 63 148b0: f8 94 cli 148b2: de bf out 0x3e, r29 ; 62 148b4: 0f be out 0x3f, r0 ; 63 148b6: cd bf out 0x3d, r28 ; 61 148b8: 80 91 c9 04 lds r24, 0x04C9 ; 0x8004c9 148bc: 88 23 and r24, r24 148be: 09 f4 brne .+2 ; 0x148c2 148c0: 74 c0 rjmp .+232 ; 0x149aa printf_P(PSTR("%SFilament settings:\n%S M200 D%.2f\n"), 148c2: 80 91 cd 04 lds r24, 0x04CD ; 0x8004cd 148c6: 8f 93 push r24 148c8: 80 91 cc 04 lds r24, 0x04CC ; 0x8004cc 148cc: 8f 93 push r24 148ce: 80 91 cb 04 lds r24, 0x04CB ; 0x8004cb 148d2: 8f 93 push r24 148d4: 80 91 ca 04 lds r24, 0x04CA ; 0x8004ca 148d8: 8f 93 push r24 148da: 1f 93 push r17 148dc: 0f 93 push r16 148de: 1f 93 push r17 148e0: 0f 93 push r16 148e2: 81 ee ldi r24, 0xE1 ; 225 148e4: 99 e7 ldi r25, 0x79 ; 121 148e6: 9f 93 push r25 148e8: 8f 93 push r24 148ea: 0f 94 5d 9f call 0x33eba ; 0x33eba 148ee: 0f b6 in r0, 0x3f ; 63 148f0: f8 94 cli 148f2: de bf out 0x3e, r29 ; 62 148f4: 0f be out 0x3f, r0 ; 63 148f6: 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( 148f8: 80 91 02 05 lds r24, 0x0502 ; 0x800502 148fc: 8f 93 push r24 148fe: 80 91 01 05 lds r24, 0x0501 ; 0x800501 14902: 8f 93 push r24 14904: 80 91 00 05 lds r24, 0x0500 ; 0x800500 14908: 8f 93 push r24 1490a: 80 91 ff 04 lds r24, 0x04FF ; 0x8004ff 1490e: 8f 93 push r24 14910: 80 91 fe 04 lds r24, 0x04FE ; 0x8004fe 14914: 1f 92 push r1 14916: 8f 93 push r24 14918: 80 91 fd 04 lds r24, 0x04FD ; 0x8004fd 1491c: 8f 93 push r24 1491e: 80 91 fc 04 lds r24, 0x04FC ; 0x8004fc 14922: 8f 93 push r24 14924: 80 91 fb 04 lds r24, 0x04FB ; 0x8004fb 14928: 8f 93 push r24 1492a: 80 91 fa 04 lds r24, 0x04FA ; 0x8004fa 1492e: 8f 93 push r24 14930: 80 91 f9 04 lds r24, 0x04F9 ; 0x8004f9 14934: 8f 93 push r24 14936: 80 91 f8 04 lds r24, 0x04F8 ; 0x8004f8 1493a: 8f 93 push r24 1493c: 80 91 f7 04 lds r24, 0x04F7 ; 0x8004f7 14940: 8f 93 push r24 14942: 80 91 f6 04 lds r24, 0x04F6 ; 0x8004f6 14946: 8f 93 push r24 14948: 01 e6 ldi r16, 0x61 ; 97 1494a: 1d e9 ldi r17, 0x9D ; 157 1494c: 1f 93 push r17 1494e: 0f 93 push r16 14950: 1f 93 push r17 14952: 0f 93 push r16 14954: 80 e4 ldi r24, 0x40 ; 64 14956: 99 e7 ldi r25, 0x79 ; 121 14958: 9f 93 push r25 1495a: 8f 93 push r24 1495c: 0f 94 5d 9f call 0x33eba ; 0x33eba "%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( 14960: 8d ee ldi r24, 0xED ; 237 14962: 9f e0 ldi r25, 0x0F ; 15 14964: 0f 94 a3 a0 call 0x34146 ; 0x34146 14968: f6 2e mov r15, r22 1496a: e7 2e mov r14, r23 1496c: d8 2e mov r13, r24 1496e: c9 2e mov r12, r25 14970: 81 ef ldi r24, 0xF1 ; 241 14972: 9f e0 ldi r25, 0x0F ; 15 14974: 0f 94 a3 a0 call 0x34146 ; 0x34146 14978: cf 92 push r12 1497a: df 92 push r13 1497c: ef 92 push r14 1497e: ff 92 push r15 14980: 9f 93 push r25 14982: 8f 93 push r24 14984: 7f 93 push r23 14986: 6f 93 push r22 14988: 1f 93 push r17 1498a: 0f 93 push r16 1498c: 1f 93 push r17 1498e: 0f 93 push r16 14990: 8f e1 ldi r24, 0x1F ; 31 14992: 99 e7 ldi r25, 0x79 ; 121 14994: 9f 93 push r25 14996: 8f 93 push r24 14998: 0f 94 5d 9f call 0x33eba ; 0x33eba 1499c: 0f b6 in r0, 0x3f ; 63 1499e: f8 94 cli 149a0: de bf out 0x3e, r29 ; 62 149a2: 0f be out 0x3f, r0 ; 63 149a4: cd bf out 0x3d, r28 ; 61 149a6: 0c 94 0f 98 jmp 0x1301e ; 0x1301e 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); 149aa: 1f 93 push r17 149ac: 0f 93 push r16 149ae: 82 ec ldi r24, 0xC2 ; 194 149b0: 99 e7 ldi r25, 0x79 ; 121 149b2: 9f 93 push r25 149b4: 8f 93 push r24 149b6: 0f 94 5d 9f call 0x33eba ; 0x33eba 149ba: 0f 90 pop r0 149bc: 0f 90 pop r0 149be: 0f 90 pop r0 149c0: 0f 90 pop r0 149c2: 9a cf rjmp .-204 ; 0x148f8 #### Parameters - `P` - The IP address in xxx.xxx.xxx.xxx format. Eg: P192.168.1.14 */ case 552: { if (code_seen('P')) 149c4: 80 e5 ldi r24, 0x50 ; 80 149c6: 0e 94 2b 55 call 0xaa56 ; 0xaa56 149ca: 88 23 and r24, r24 149cc: 11 f4 brne .+4 ; 0x149d2 149ce: 0c 94 0f 98 jmp 0x1301e ; 0x1301e { uint8_t valCnt = 0; IP_address = 0; 149d2: 10 92 7d 06 sts 0x067D, r1 ; 0x80067d 149d6: 10 92 7e 06 sts 0x067E, r1 ; 0x80067e 149da: 10 92 7f 06 sts 0x067F, r1 ; 0x80067f 149de: 10 92 80 06 sts 0x0680, r1 ; 0x800680 149e2: 0d e7 ldi r16, 0x7D ; 125 149e4: 16 e0 ldi r17, 0x06 ; 6 149e6: 31 e8 ldi r19, 0x81 ; 129 149e8: e3 2e mov r14, r19 149ea: 36 e0 ldi r19, 0x06 ; 6 149ec: f3 2e mov r15, r19 do { *strchr_pointer = '*'; 149ee: 4a e2 ldi r20, 0x2A ; 42 149f0: d4 2e mov r13, r20 149f2: e0 91 f5 16 lds r30, 0x16F5 ; 0x8016f5 149f6: f0 91 f6 16 lds r31, 0x16F6 ; 0x8016f6 149fa: d0 82 st Z, r13 ((uint8_t*)&IP_address)[valCnt] = code_value_short(); 149fc: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 14a00: d8 01 movw r26, r16 14a02: 8d 93 st X+, r24 14a04: 8d 01 movw r16, r26 valCnt++; } while ((valCnt < 4) && code_seen('.')); 14a06: ea 16 cp r14, r26 14a08: fb 06 cpc r15, r27 14a0a: 11 f4 brne .+4 ; 0x14a10 14a0c: 0c 94 0f 98 jmp 0x1301e ; 0x1301e 14a10: 8e e2 ldi r24, 0x2E ; 46 14a12: 0e 94 2b 55 call 0xaa56 ; 0xaa56 14a16: 81 11 cpse r24, r1 14a18: ec cf rjmp .-40 ; 0x149f2 if (valCnt != 4) IP_address = 0; 14a1a: 10 92 7d 06 sts 0x067D, r1 ; 0x80067d 14a1e: 10 92 7e 06 sts 0x067E, r1 ; 0x80067e 14a22: 10 92 7f 06 sts 0x067F, r1 ; 0x80067f 14a26: 10 92 80 06 sts 0x0680, r1 ; 0x800680 14a2a: 0c 94 0f 98 jmp 0x1301e ; 0x1301e - `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(); 14a2e: 0f 94 ce 22 call 0x2459c ; 0x2459c /// 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; 14a32: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 14a36: 81 11 cpse r24, r1 14a38: 02 c0 rjmp .+4 ; 0x14a3e 14a3a: 0e 94 24 5e call 0xbc48 ; 0xbc48 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(); 14a3e: 85 e4 ldi r24, 0x45 ; 69 14a40: 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; 14a44: 81 2c mov r8, r1 14a46: 91 2c mov r9, r1 14a48: a1 2c mov r10, r1 14a4a: 20 ec ldi r18, 0xC0 ; 192 14a4c: 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(); 14a4e: 88 23 and r24, r24 14a50: 21 f0 breq .+8 ; 0x14a5a 14a52: 0e 94 03 5a call 0xb406 ; 0xb406 14a56: 4b 01 movw r8, r22 14a58: 5c 01 movw r10, r24 if (code_seen('L')) e_shift_late = code_value(); 14a5a: 8c e4 ldi r24, 0x4C ; 76 14a5c: 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; 14a60: c1 2c mov r12, r1 14a62: d1 2c mov r13, r1 14a64: 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(); 14a66: 88 23 and r24, r24 14a68: 21 f0 breq .+8 ; 0x14a72 14a6a: 0e 94 03 5a call 0xb406 ; 0xb406 14a6e: 6b 01 movw r12, r22 14a70: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_shift = fabs(code_value()); 14a72: 8a e5 ldi r24, 0x5A ; 90 14a74: 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; 14a78: 41 2c mov r4, r1 14a7a: 51 2c mov r5, r1 14a7c: 98 ed ldi r25, 0xD8 ; 216 14a7e: 69 2e mov r6, r25 14a80: 91 e4 ldi r25, 0x41 ; 65 14a82: 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()); 14a84: 88 23 and r24, r24 14a86: 31 f0 breq .+12 ; 0x14a94 14a88: 0e 94 03 5a call 0xb406 ; 0xb406 14a8c: 2b 01 movw r4, r22 14a8e: 3c 01 movw r6, r24 14a90: e8 94 clt 14a92: 77 f8 bld r7, 7 //Move XY to side if (code_seen('X')) x_position = code_value(); 14a94: 88 e5 ldi r24, 0x58 ; 88 14a96: 0e 94 2b 55 call 0xaa56 ; 0xaa56 14a9a: 88 23 and r24, r24 14a9c: 09 f4 brne .+2 ; 0x14aa0 14a9e: b5 c1 rjmp .+874 ; 0x14e0a 14aa0: 0e 94 03 5a call 0xb406 ; 0xb406 14aa4: 68 a7 std Y+40, r22 ; 0x28 14aa6: 79 a7 std Y+41, r23 ; 0x29 14aa8: 8a a7 std Y+42, r24 ; 0x2a 14aaa: 9b a7 std Y+43, r25 ; 0x2b if (code_seen('Y')) y_position = code_value(); 14aac: 89 e5 ldi r24, 0x59 ; 89 14aae: 0e 94 2b 55 call 0xaa56 ; 0xaa56 14ab2: 88 23 and r24, r24 14ab4: 09 f4 brne .+2 ; 0x14ab8 14ab6: b2 c1 rjmp .+868 ; 0x14e1c 14ab8: 0e 94 03 5a call 0xb406 ; 0xb406 14abc: 6c a7 std Y+44, r22 ; 0x2c 14abe: 7d a7 std Y+45, r23 ; 0x2d 14ac0: 8e a7 std Y+46, r24 ; 0x2e 14ac2: 9f a7 std Y+47, r25 ; 0x2f // Filament name to show during the loading char filament_name[LCD_WIDTH + 1] = ""; 14ac4: 1a 82 std Y+2, r1 ; 0x02 14ac6: 19 82 std Y+1, r1 ; 0x01 14ac8: fe 01 movw r30, r28 14aca: 33 96 adiw r30, 0x03 ; 3 14acc: 83 e1 ldi r24, 0x13 ; 19 14ace: df 01 movw r26, r30 14ad0: 1d 92 st X+, r1 14ad2: 8a 95 dec r24 14ad4: e9 f7 brne .-6 ; 0x14ad0 if (code_seen('C')) { 14ad6: 83 e4 ldi r24, 0x43 ; 67 14ad8: 0e 94 2b 55 call 0xaa56 ; 0xaa56 14adc: 88 23 and r24, r24 14ade: f9 f0 breq .+62 ; 0x14b1e , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 14ae0: 62 e2 ldi r22, 0x22 ; 34 14ae2: 70 e0 ldi r23, 0x00 ; 0 14ae4: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 14ae8: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 14aec: 0f 94 f2 a6 call 0x34de4 ; 0x34de4 14af0: 8c 01 movw r16, r24 if (!this->ptr) { 14af2: 89 2b or r24, r25 14af4: a1 f0 breq .+40 ; 0x14b1e // First quote not found return; } // Skip the leading quote this->ptr++; 14af6: 0f 5f subi r16, 0xFF ; 255 14af8: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 14afa: 62 e2 ldi r22, 0x22 ; 34 14afc: 70 e0 ldi r23, 0x00 ; 0 14afe: c8 01 movw r24, r16 14b00: 0f 94 f2 a6 call 0x34de4 ; 0x34de4 if(!pStrEnd) { 14b04: 00 97 sbiw r24, 0x00 ; 0 14b06: 59 f0 breq .+22 ; 0x14b1e // Second quote not found return; } this->len = pStrEnd - this->ptr; 14b08: 80 1b sub r24, r16 unquoted_string str = unquoted_string(strchr_pointer); if (str.WasFound()) { const uint8_t len = min(str.GetLength(), LCD_WIDTH); 14b0a: 84 31 cpi r24, 0x14 ; 20 14b0c: 08 f0 brcs .+2 ; 0x14b10 14b0e: 84 e1 ldi r24, 0x14 ; 20 memcpy(filament_name, str.GetUnquotedString(), len); 14b10: 48 2f mov r20, r24 14b12: 50 e0 ldi r21, 0x00 ; 0 14b14: b8 01 movw r22, r16 14b16: ce 01 movw r24, r28 14b18: 01 96 adiw r24, 0x01 ; 1 14b1a: 0f 94 c4 a6 call 0x34d88 ; 0x34d88 } } if (MMU2::mmu2.Enabled() && code_seen_P(PSTR("AUTO"))) 14b1e: 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; 14b22: 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"))) 14b24: 81 30 cpi r24, 0x01 ; 1 14b26: 29 f4 brne .+10 ; 0x14b32 14b28: 82 e1 ldi r24, 0x12 ; 18 14b2a: 9f e7 ldi r25, 0x7F ; 127 14b2c: 0f 94 10 75 call 0x2ea20 ; 0x2ea20 14b30: 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(); 14b32: 0f 94 ce 22 call 0x2459c ; 0x2459c // 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); 14b36: 86 e1 ldi r24, 0x16 ; 22 14b38: 0f 94 be 98 call 0x3317c ; 0x3317c // Turn off the fan fanSpeed = 0; 14b3c: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 // Retract E if (!printingIsPaused()) 14b40: 0e 94 b3 60 call 0xc166 ; 0xc166 14b44: 81 11 cpse r24, r1 14b46: 6f c1 rjmp .+734 ; 0x14e26 { current_position[E_AXIS] += e_shift; 14b48: a5 01 movw r20, r10 14b4a: 94 01 movw r18, r8 14b4c: 60 91 01 12 lds r22, 0x1201 ; 0x801201 14b50: 70 91 02 12 lds r23, 0x1202 ; 0x801202 14b54: 80 91 03 12 lds r24, 0x1203 ; 0x801203 14b58: 90 91 04 12 lds r25, 0x1204 ; 0x801204 14b5c: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 14b60: 60 93 01 12 sts 0x1201, r22 ; 0x801201 14b64: 70 93 02 12 sts 0x1202, r23 ; 0x801202 14b68: 80 93 03 12 sts 0x1203, r24 ; 0x801203 14b6c: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 14b70: 60 e0 ldi r22, 0x00 ; 0 14b72: 70 e0 ldi r23, 0x00 ; 0 14b74: 88 ee ldi r24, 0xE8 ; 232 14b76: 92 e4 ldi r25, 0x42 ; 66 14b78: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 14b7c: 0f 94 ce 22 call 0x2459c ; 0x2459c SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 14b80: 86 e3 ldi r24, 0x36 ; 54 14b82: 9a e6 ldi r25, 0x6A ; 106 14b84: 0e 94 49 72 call 0xe492 ; 0xe492 // Filament change can be issued via the Tune menu restore_extruder_temperature_from_ram(); } // Raise the Z axis raise_z(z_shift); 14b88: c3 01 movw r24, r6 14b8a: b2 01 movw r22, r4 14b8c: 0e 94 d3 66 call 0xcda6 ; 0xcda6 // Move XY to side current_position[X_AXIS] = x_position; 14b90: 28 a5 ldd r18, Y+40 ; 0x28 14b92: 39 a5 ldd r19, Y+41 ; 0x29 14b94: 4a a5 ldd r20, Y+42 ; 0x2a 14b96: 5b a5 ldd r21, Y+43 ; 0x2b 14b98: 20 93 f5 11 sts 0x11F5, r18 ; 0x8011f5 14b9c: 30 93 f6 11 sts 0x11F6, r19 ; 0x8011f6 14ba0: 40 93 f7 11 sts 0x11F7, r20 ; 0x8011f7 14ba4: 50 93 f8 11 sts 0x11F8, r21 ; 0x8011f8 current_position[Y_AXIS] = y_position; 14ba8: 8c a5 ldd r24, Y+44 ; 0x2c 14baa: 9d a5 ldd r25, Y+45 ; 0x2d 14bac: ae a5 ldd r26, Y+46 ; 0x2e 14bae: bf a5 ldd r27, Y+47 ; 0x2f 14bb0: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 14bb4: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 14bb8: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 14bbc: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 14bc0: 60 e0 ldi r22, 0x00 ; 0 14bc2: 70 e0 ldi r23, 0x00 ; 0 14bc4: 88 e4 ldi r24, 0x48 ; 72 14bc6: 92 e4 ldi r25, 0x42 ; 66 14bc8: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 14bcc: 0f 94 ce 22 call 0x2459c ; 0x2459c bool repeat = false; 14bd0: 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; 14bd2: 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)); 14bd4: 0b e0 ldi r16, 0x0B ; 11 14bd6: 20 2e mov r2, r16 14bd8: 09 e7 ldi r16, 0x79 ; 121 14bda: 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)); 14bdc: 83 e1 ldi r24, 0x13 ; 19 14bde: 88 2e mov r8, r24 14be0: 89 e7 ldi r24, 0x79 ; 121 14be2: 98 2e mov r9, r24 st_synchronize(); bool repeat = false; do { // Unload filament if (MMU2::mmu2.Enabled()) { 14be4: 80 91 94 12 lds r24, 0x1294 ; 0x801294 14be8: 81 30 cpi r24, 0x01 ; 1 14bea: 09 f0 breq .+2 ; 0x14bee 14bec: 1f c1 rjmp .+574 ; 0x14e2c eject_slot = MMU2::mmu2.get_current_tool(); 14bee: 0f 94 4a 42 call 0x28494 ; 0x28494 14bf2: a8 2e mov r10, r24 mmu_M600_unload_filament(); 14bf4: 0e 94 12 6d call 0xda24 ; 0xda24 } 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 14bf8: 0f 94 ce 22 call 0x2459c ; 0x2459c eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 14bfc: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 14c00: 10 92 85 16 sts 0x1685, r1 ; 0x801685 FSensorBlockRunout fsBlockRunout; if (!MMU2::mmu2.Enabled()) 14c04: 80 91 94 12 lds r24, 0x1294 ; 0x801294 14c08: 81 30 cpi r24, 0x01 ; 1 14c0a: 09 f4 brne .+2 ; 0x14c0e 14c0c: d9 c1 rjmp .+946 ; 0x14fc0 { KEEPALIVE_STATE(PAUSED_FOR_USER); 14c0e: 84 e0 ldi r24, 0x04 ; 4 14c10: 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); 14c14: 8d ee ldi r24, 0xED ; 237 14c16: 98 e3 ldi r25, 0x38 ; 56 14c18: 0e 94 a7 6c call 0xd94e ; 0xd94e 14c1c: 40 e0 ldi r20, 0x00 ; 0 14c1e: 60 e0 ldi r22, 0x00 ; 0 14c20: 0f 94 8a 2e call 0x25d14 ; 0x25d14 14c24: 08 2f mov r16, r24 lcd_update_enable(false); 14c26: 80 e0 ldi r24, 0x00 ; 0 14c28: 0e 94 b6 69 call 0xd36c ; 0xd36c if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 14c2c: 01 30 cpi r16, 0x01 ; 1 14c2e: 29 f5 brne .+74 ; 0x14c7a lcd_clear(); 14c30: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 14c34: 85 e6 ldi r24, 0x65 ; 101 14c36: 99 e3 ldi r25, 0x39 ; 57 14c38: 0e 94 a7 6c call 0xd94e ; 0xd94e 14c3c: ac 01 movw r20, r24 14c3e: 62 e0 ldi r22, 0x02 ; 2 14c40: 80 e0 ldi r24, 0x00 ; 0 14c42: 0e 94 85 69 call 0xd30a ; 0xd30a current_position[X_AXIS] = 100; 14c46: 80 e0 ldi r24, 0x00 ; 0 14c48: 90 e0 ldi r25, 0x00 ; 0 14c4a: a8 ec ldi r26, 0xC8 ; 200 14c4c: b2 e4 ldi r27, 0x42 ; 66 14c4e: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 14c52: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 14c56: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 14c5a: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 14c5e: 60 e0 ldi r22, 0x00 ; 0 14c60: 70 e0 ldi r23, 0x00 ; 0 14c62: 88 e4 ldi r24, 0x48 ; 72 14c64: 92 e4 ldi r25, 0x42 ; 66 14c66: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 14c6a: 0f 94 ce 22 call 0x2459c ; 0x2459c lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHECK_IDLER)); 14c6e: 8b eb ldi r24, 0xBB ; 187 14c70: 98 e3 ldi r25, 0x38 ; 56 14c72: 0e 94 a7 6c call 0xd94e ; 0xd94e 14c76: 0f 94 a9 0b call 0x21752 ; 0x21752 preheat_or_continue(FilamentAction::UnLoad); } void lcd_wait_interact(const char* filament_name) { lcd_clear(); 14c7a: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_puts_at_P(0, 0, _T(MSG_INSERT_FILAMENT)); 14c7e: 89 e4 ldi r24, 0x49 ; 73 14c80: 98 e3 ldi r25, 0x38 ; 56 14c82: 0e 94 a7 6c call 0xd94e ; 0xd94e 14c86: ac 01 movw r20, r24 14c88: 60 e0 ldi r22, 0x00 ; 0 14c8a: 80 e0 ldi r24, 0x00 ; 0 14c8c: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_set_cursor(0, 1); 14c90: 61 e0 ldi r22, 0x01 ; 1 14c92: 80 e0 ldi r24, 0x00 ; 0 14c94: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 if (filament_name[0]) { 14c98: 89 81 ldd r24, Y+1 ; 0x01 14c9a: 88 23 and r24, r24 14c9c: 41 f0 breq .+16 ; 0x14cae lcd_print(filament_name); 14c9e: ce 01 movw r24, r28 14ca0: 01 96 adiw r24, 0x01 ; 1 14ca2: 0e 94 78 6b call 0xd6f0 ; 0xd6f0 lcd_set_cursor(0, 2); 14ca6: 62 e0 ldi r22, 0x02 ; 2 14ca8: 80 e0 ldi r24, 0x00 ; 0 14caa: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 } #ifdef FILAMENT_SENSOR if (!fsensor.getAutoLoadEnabled()) 14cae: 80 91 85 16 lds r24, 0x1685 ; 0x801685 14cb2: 81 11 cpse r24, r1 14cb4: 06 c0 rjmp .+12 ; 0x14cc2 #endif //FILAMENT_SENSOR { lcd_puts_P(_T(MSG_PRESS)); 14cb6: 84 e3 ldi r24, 0x34 ; 52 14cb8: 98 e3 ldi r25, 0x38 ; 56 14cba: 0e 94 a7 6c call 0xd94e ; 0xd94e 14cbe: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 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); 14cc2: 84 e0 ldi r24, 0x04 ; 4 14cc4: 80 93 78 02 sts 0x0278, r24 ; 0x800278 while(!lcd_clicked()) 14cc8: 0e 94 8e 6b call 0xd71c ; 0xd71c 14ccc: 81 11 cpse r24, r1 14cce: 10 c0 rjmp .+32 ; 0x14cf0 { manage_heater(); 14cd0: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(true); 14cd4: 81 e0 ldi r24, 0x01 ; 1 14cd6: 0e 94 fe 79 call 0xf3fc ; 0xf3fc #ifdef FILAMENT_SENSOR if (fsensor.getFilamentLoadEvent()) { 14cda: 80 91 88 16 lds r24, 0x1688 ; 0x801688 14cde: 88 23 and r24, r24 14ce0: 99 f3 breq .-26 ; 0x14cc8 Sound_MakeCustom(50,1000,false); 14ce2: 40 e0 ldi r20, 0x00 ; 0 14ce4: 68 ee ldi r22, 0xE8 ; 232 14ce6: 73 e0 ldi r23, 0x03 ; 3 14ce8: 82 e3 ldi r24, 0x32 ; 50 14cea: 90 e0 ldi r25, 0x00 ; 0 14cec: 0f 94 6f 32 call 0x264de ; 0x264de break; } #endif //FILAMENT_SENSOR } KEEPALIVE_STATE(IN_HANDLER); 14cf0: 32 e0 ldi r19, 0x02 ; 2 14cf2: 30 93 78 02 sts 0x0278, r19 ; 0x800278 M600_load_filament_movements(filament_name); 14cf6: ce 01 movw r24, r28 14cf8: 01 96 adiw r24, 0x01 ; 1 14cfa: 0e 94 cb 6c call 0xd996 ; 0xd996 Sound_MakeCustom(50,1000,false); 14cfe: 40 e0 ldi r20, 0x00 ; 0 14d00: 68 ee ldi r22, 0xE8 ; 232 14d02: 73 e0 ldi r23, 0x03 ; 3 14d04: 82 e3 ldi r24, 0x32 ; 50 14d06: 90 e0 ldi r25, 0x00 ; 0 14d08: 0f 94 6f 32 call 0x264de ; 0x264de else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); mmu_M600_load_filament(automatic); } if (!automatic) 14d0c: 11 11 cpse r17, r1 14d0e: 9e c1 rjmp .+828 ; 0x1504c 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); 14d10: b4 e0 ldi r27, 0x04 ; 4 14d12: bb 2e mov r11, r27 14d14: b0 92 78 02 sts 0x0278, r11 ; 0x800278 uint8_t lcd_alright() { uint8_t cursor_pos = 0; lcd_clear(); 14d18: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_puts_at_P(1, 0, _T(MSG_CORRECTLY)); 14d1c: 85 e8 ldi r24, 0x85 ; 133 14d1e: 98 e3 ldi r25, 0x38 ; 56 14d20: 0e 94 a7 6c call 0xd94e ; 0xd94e 14d24: ac 01 movw r20, r24 14d26: 60 e0 ldi r22, 0x00 ; 0 14d28: 81 e0 ldi r24, 0x01 ; 1 14d2a: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_puts_at_P(1, 1, _T(MSG_NOT_LOADED)); 14d2e: 8f e6 ldi r24, 0x6F ; 111 14d30: 98 e3 ldi r25, 0x38 ; 56 14d32: 0e 94 a7 6c call 0xd94e ; 0xd94e 14d36: ac 01 movw r20, r24 14d38: 61 e0 ldi r22, 0x01 ; 1 14d3a: 81 e0 ldi r24, 0x01 ; 1 14d3c: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_puts_at_P(1, 2, _T(MSG_NOT_COLOR)); 14d40: 8b e5 ldi r24, 0x5B ; 91 14d42: 98 e3 ldi r25, 0x38 ; 56 14d44: 0e 94 a7 6c call 0xd94e ; 0xd94e 14d48: ac 01 movw r20, r24 14d4a: 62 e0 ldi r22, 0x02 ; 2 14d4c: 81 e0 ldi r24, 0x01 ; 1 14d4e: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_puts_at_P(1, 3, _T(MSG_UNLOAD_FILAMENT)); 14d52: 8b e6 ldi r24, 0x6B ; 107 14d54: 9c e3 ldi r25, 0x3C ; 60 14d56: 0e 94 a7 6c call 0xd94e ; 0xd94e 14d5a: ac 01 movw r20, r24 14d5c: 63 e0 ldi r22, 0x03 ; 3 14d5e: 81 e0 ldi r24, 0x01 ; 1 14d60: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_putc_at(0, cursor_pos, '>'); 14d64: 4e e3 ldi r20, 0x3E ; 62 14d66: 60 e0 ldi r22, 0x00 ; 0 14d68: 80 e0 ldi r24, 0x00 ; 0 14d6a: 0e 94 91 69 call 0xd322 ; 0xd322 lcd_consume_click(); 14d6e: 0e 94 89 6b call 0xd712 ; 0xd712 uint8_t lcd_alright() { uint8_t cursor_pos = 0; 14d72: 00 e0 ldi r16, 0x00 ; 0 lcd_putc_at(0, cursor_pos, '>'); lcd_consume_click(); while (1) { manage_heater(); 14d74: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(true); 14d78: 81 e0 ldi r24, 0x01 ; 1 14d7a: 0e 94 fe 79 call 0xf3fc ; 0xf3fc if (lcd_encoder) 14d7e: 80 91 06 05 lds r24, 0x0506 ; 0x800506 14d82: 90 91 07 05 lds r25, 0x0507 ; 0x800507 14d86: 00 97 sbiw r24, 0x00 ; 0 14d88: d9 f0 breq .+54 ; 0x14dc0 { if (lcd_encoder < 0 ) { 14d8a: 97 ff sbrs r25, 7 14d8c: 22 c1 rjmp .+580 ; 0x14fd2 // Rotating knob counter clockwise if (cursor_pos > 0) 14d8e: 00 23 and r16, r16 14d90: 09 f4 brne .+2 ; 0x14d94 14d92: 23 c1 rjmp .+582 ; 0x14fda cursor_pos--; 14d94: 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 ")); 14d96: 47 e1 ldi r20, 0x17 ; 23 14d98: 59 e7 ldi r21, 0x79 ; 121 14d9a: 60 e0 ldi r22, 0x00 ; 0 14d9c: 80 e0 ldi r24, 0x00 ; 0 14d9e: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_putc_at(0, cursor_pos, '>'); 14da2: 4e e3 ldi r20, 0x3E ; 62 14da4: 60 2f mov r22, r16 14da6: 80 e0 ldi r24, 0x00 ; 0 14da8: 0e 94 91 69 call 0xd322 ; 0xd322 // Consume rotation event and make feedback sound lcd_encoder = 0; 14dac: 10 92 07 05 sts 0x0507, r1 ; 0x800507 14db0: 10 92 06 05 sts 0x0506, r1 ; 0x800506 _delay(100); 14db4: 64 e6 ldi r22, 0x64 ; 100 14db6: 70 e0 ldi r23, 0x00 ; 0 14db8: 80 e0 ldi r24, 0x00 ; 0 14dba: 90 e0 ldi r25, 0x00 ; 0 14dbc: 0f 94 03 0e call 0x21c06 ; 0x21c06 } if (lcd_clicked()) 14dc0: 0e 94 8e 6b call 0xd71c ; 0xd71c 14dc4: 88 23 and r24, r24 14dc6: b1 f2 breq .-84 ; 0x14d74 { lcd_clear(); 14dc8: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_return_to_status(); 14dcc: 0e 94 6d fe call 0x1fcda ; 0x1fcda lcd_change_filament_state = lcd_alright(); KEEPALIVE_STATE(IN_HANDLER); 14dd0: 42 e0 ldi r20, 0x02 ; 2 14dd2: 40 93 78 02 sts 0x0278, r20 ; 0x800278 switch(lcd_change_filament_state) 14dd6: 02 30 cpi r16, 0x02 ; 2 14dd8: 09 f4 brne .+2 ; 0x14ddc 14dda: 08 c1 rjmp .+528 ; 0x14fec 14ddc: 03 30 cpi r16, 0x03 ; 3 14dde: 09 f4 brne .+2 ; 0x14de2 14de0: ed c1 rjmp .+986 ; 0x151bc 14de2: 01 30 cpi r16, 0x01 ; 1 14de4: 09 f0 breq .+2 ; 0x14de8 14de6: 21 c1 rjmp .+578 ; 0x1502a { // Filament failed to load so load it again case 1: if (MMU2::mmu2.Enabled()) { 14de8: 80 91 94 12 lds r24, 0x1294 ; 0x801294 14dec: 81 30 cpi r24, 0x01 ; 1 14dee: 09 f0 breq .+2 ; 0x14df2 14df0: f8 c0 rjmp .+496 ; 0x14fe2 uint8_t eject_slot = MMU2::mmu2.get_current_tool(); 14df2: 0f 94 4a 42 call 0x28494 ; 0x28494 14df6: 08 2f mov r16, r24 // Unload filament mmu_M600_unload_filament(); 14df8: 0e 94 12 6d call 0xda24 ; 0xda24 // Ask to remove any old filament and load new mmu_M600_filament_change_screen(eject_slot); 14dfc: 80 2f mov r24, r16 14dfe: 0e 94 68 7c call 0xf8d0 ; 0xf8d0 // After user clicks knob, MMU will load the filament mmu_M600_load_filament(false); 14e02: 80 e0 ldi r24, 0x00 ; 0 14e04: 0e 94 0e 71 call 0xe21c ; 0xe21c 14e08: 85 cf rjmp .-246 ; 0x14d14 // 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; 14e0a: 20 e0 ldi r18, 0x00 ; 0 14e0c: 30 e0 ldi r19, 0x00 ; 0 14e0e: 43 e5 ldi r20, 0x53 ; 83 14e10: 53 e4 ldi r21, 0x43 ; 67 14e12: 28 a7 std Y+40, r18 ; 0x28 14e14: 39 a7 std Y+41, r19 ; 0x29 14e16: 4a a7 std Y+42, r20 ; 0x2a 14e18: 5b a7 std Y+43, r21 ; 0x2b 14e1a: 48 ce rjmp .-880 ; 0x14aac float y_position = FILAMENTCHANGE_YPOS; 14e1c: 1c a6 std Y+44, r1 ; 0x2c 14e1e: 1d a6 std Y+45, r1 ; 0x2d 14e20: 1e a6 std Y+46, r1 ; 0x2e 14e22: 1f a6 std Y+47, r1 ; 0x2f 14e24: 4f ce rjmp .-866 ; 0x14ac4 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(); 14e26: 0e 94 a1 5e call 0xbd42 ; 0xbd42 14e2a: ae ce rjmp .-676 ; 0x14b88 //! //! 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); 14e2c: 84 e0 ldi r24, 0x04 ; 4 14e2e: 80 93 78 02 sts 0x0278, r24 ; 0x800278 unsigned long waiting_start_time = _millis(); 14e32: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 14e36: 2b 01 movw r4, r22 14e38: 3c 01 movw r6, r24 uint8_t wait_for_user_state = 0; lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 14e3a: 89 e0 ldi r24, 0x09 ; 9 14e3c: 98 e3 ldi r25, 0x38 ; 56 14e3e: 0e 94 a7 6c call 0xd94e ; 0xd94e 14e42: 0f 94 22 0b call 0x21644 ; 0x21644 while (!(wait_for_user_state == 0 && lcd_clicked())){ 14e46: 0e 94 8e 6b call 0xd71c ; 0xd71c 14e4a: 08 2f mov r16, r24 14e4c: 81 11 cpse r24, r1 14e4e: 34 c0 rjmp .+104 ; 0x14eb8 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) { 14e50: a3 01 movw r20, r6 14e52: 92 01 movw r18, r4 14e54: 20 54 subi r18, 0x40 ; 64 14e56: 38 4d sbci r19, 0xD8 ; 216 14e58: 46 4f sbci r20, 0xF6 ; 246 14e5a: 5f 4f sbci r21, 0xFF ; 255 14e5c: 28 a7 std Y+40, r18 ; 0x28 14e5e: 39 a7 std Y+41, r19 ; 0x29 14e60: 4a a7 std Y+42, r20 ; 0x2a 14e62: 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(); 14e64: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(true); 14e68: 81 e0 ldi r24, 0x01 ; 1 14e6a: 0e 94 fe 79 call 0xf3fc ; 0xf3fc if (wait_for_user_state != 2) sound_wait_for_user(); 14e6e: 02 30 cpi r16, 0x02 ; 2 14e70: 09 f4 brne .+2 ; 0x14e74 14e72: 65 c0 rjmp .+202 ; 0x14f3e 14e74: 0f 94 83 36 call 0x26d06 ; 0x26d06 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); 14e78: 84 e0 ldi r24, 0x04 ; 4 14e7a: 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) { 14e7c: 01 30 cpi r16, 0x01 ; 1 14e7e: 29 f1 breq .+74 ; 0x14eca case 0: //nozzle is hot, waiting for user to press the knob to unload filament delay_keep_alive(4); 14e80: 0e 94 45 7c call 0xf88a ; 0xf88a if (_millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) { 14e84: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 14e88: 28 a5 ldd r18, Y+40 ; 0x28 14e8a: 39 a5 ldd r19, Y+41 ; 0x29 14e8c: 4a a5 ldd r20, Y+42 ; 0x2a 14e8e: 5b a5 ldd r21, Y+43 ; 0x2b 14e90: 26 17 cp r18, r22 14e92: 37 07 cpc r19, r23 14e94: 48 07 cpc r20, r24 14e96: 59 07 cpc r21, r25 14e98: b0 f6 brcc .-84 ; 0x14e46 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_PREHEAT)); 14e9a: 88 ed ldi r24, 0xD8 ; 216 14e9c: 97 e3 ldi r25, 0x37 ; 55 14e9e: 0e 94 a7 6c call 0xd94e ; 0xd94e 14ea2: 0f 94 22 0b call 0x21644 ; 0x21644 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 14ea6: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 14eaa: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 wait_for_user_state = 1; setTargetHotend(0); st_synchronize(); 14eae: 0f 94 ce 22 call 0x2459c ; 0x2459c disable_e0(); 14eb2: 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; 14eb4: 01 e0 ldi r16, 0x01 ; 1 14eb6: d6 cf rjmp .-84 ; 0x14e64 14eb8: 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; 14ebc: 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); 14ec0: c7 01 movw r24, r14 14ec2: b6 01 movw r22, r12 14ec4: 0e 94 86 f0 call 0x1e10c ; 0x1e10c 14ec8: 97 ce rjmp .-722 ; 0x14bf8 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); 14eca: 0e 94 45 7c call 0xf88a ; 0xf88a if (lcd_clicked()) { 14ece: 0e 94 8e 6b call 0xd71c ; 0xd71c 14ed2: 88 23 and r24, r24 14ed4: 39 f2 breq .-114 ; 0x14e64 14ed6: 80 91 ef 11 lds r24, 0x11EF ; 0x8011ef 14eda: 90 91 f0 11 lds r25, 0x11F0 ; 0x8011f0 14ede: 90 93 f2 11 sts 0x11F2, r25 ; 0x8011f2 14ee2: 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)); 14ee6: 85 e4 ldi r24, 0x45 ; 69 14ee8: 9e e4 ldi r25, 0x4E ; 78 14eea: 0e 94 a7 6c call 0xd94e ; 0xd94e 14eee: 0f 94 22 0b call 0x21644 ; 0x21644 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 14ef2: 42 e8 ldi r20, 0x82 ; 130 14ef4: 64 e0 ldi r22, 0x04 ; 4 14ef6: 80 e0 ldi r24, 0x00 ; 0 14ef8: 0e 94 91 69 call 0xd322 ; 0xd322 lcd_printf_P(PSTR("%3d/%3d"), (int16_t)degHotend(active_extruder), (int16_t) degTargetHotend(active_extruder)); 14efc: 80 91 f2 11 lds r24, 0x11F2 ; 0x8011f2 14f00: 8f 93 push r24 14f02: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 14f06: 8f 93 push r24 14f08: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 14f0c: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 14f10: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 14f14: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 14f18: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 14f1c: 7f 93 push r23 14f1e: 6f 93 push r22 14f20: 3f 92 push r3 14f22: 2f 92 push r2 14f24: 0e 94 4a 69 call 0xd294 ; 0xd294 lcd_putc(LCD_STR_DEGREE[0]); 14f28: 81 e8 ldi r24, 0x81 ; 129 14f2a: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 14f2e: 0f 90 pop r0 14f30: 0f 90 pop r0 14f32: 0f 90 pop r0 14f34: 0f 90 pop r0 14f36: 0f 90 pop r0 14f38: 0f 90 pop r0 setTargetHotend(saved_extruder_temperature); lcd_wait_for_heater(); wait_for_user_state = 2; 14f3a: 02 e0 ldi r16, 0x02 ; 2 14f3c: 93 cf rjmp .-218 ; 0x14e64 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 14f3e: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 14f42: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 14f46: 07 2e mov r0, r23 14f48: 00 0c add r0, r0 14f4a: 88 0b sbc r24, r24 14f4c: 99 0b sbc r25, r25 14f4e: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> } break; case 2: //waiting for nozzle to reach target temperature if (fabs(degTargetHotend(active_extruder) - degHotend(active_extruder)) < TEMP_HYSTERESIS) { 14f52: 20 91 c4 0d lds r18, 0x0DC4 ; 0x800dc4 14f56: 30 91 c5 0d lds r19, 0x0DC5 ; 0x800dc5 14f5a: 40 91 c6 0d lds r20, 0x0DC6 ; 0x800dc6 14f5e: 50 91 c7 0d lds r21, 0x0DC7 ; 0x800dc7 14f62: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 14f66: 9f 77 andi r25, 0x7F ; 127 14f68: 20 e0 ldi r18, 0x00 ; 0 14f6a: 30 e0 ldi r19, 0x00 ; 0 14f6c: 40 ea ldi r20, 0xA0 ; 160 14f6e: 50 e4 ldi r21, 0x40 ; 64 14f70: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 14f74: 87 ff sbrs r24, 7 14f76: 0b c0 rjmp .+22 ; 0x14f8e lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 14f78: 89 e0 ldi r24, 0x09 ; 9 14f7a: 98 e3 ldi r25, 0x38 ; 56 14f7c: 0e 94 a7 6c call 0xd94e ; 0xd94e 14f80: 0f 94 22 0b call 0x21644 ; 0x21644 waiting_start_time = _millis(); 14f84: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 14f88: 2b 01 movw r4, r22 14f8a: 3c 01 movw r6, r24 14f8c: 5c cf rjmp .-328 ; 0x14e46 wait_for_user_state = 0; } else { lcd_set_cursor(1, 4); 14f8e: 64 e0 ldi r22, 0x04 ; 4 14f90: 81 e0 ldi r24, 0x01 ; 1 14f92: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_printf_P(PSTR("%3d"), (int16_t)degHotend(active_extruder)); 14f96: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 14f9a: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 14f9e: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 14fa2: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 14fa6: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 14faa: 7f 93 push r23 14fac: 6f 93 push r22 14fae: 9f 92 push r9 14fb0: 8f 92 push r8 14fb2: 0e 94 4a 69 call 0xd294 ; 0xd294 14fb6: 0f 90 pop r0 14fb8: 0f 90 pop r0 14fba: 0f 90 pop r0 14fbc: 0f 90 pop r0 14fbe: 52 cf rjmp .-348 ; 0x14e64 } M600_load_filament(filament_name); } else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); 14fc0: 11 11 cpse r17, r1 14fc2: 03 c0 rjmp .+6 ; 0x14fca 14fc4: 8a 2d mov r24, r10 14fc6: 0e 94 68 7c call 0xf8d0 ; 0xf8d0 mmu_M600_load_filament(automatic); 14fca: 81 2f mov r24, r17 14fcc: 0e 94 0e 71 call 0xe21c ; 0xe21c 14fd0: 9d ce rjmp .-710 ; 0x14d0c cursor_pos--; else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); } else if (lcd_encoder > 0) { // Rotating knob clockwise if (cursor_pos < 3) 14fd2: 03 30 cpi r16, 0x03 ; 3 14fd4: 10 f4 brcc .+4 ; 0x14fda cursor_pos++; 14fd6: 0f 5f subi r16, 0xFF ; 255 14fd8: de ce rjmp .-580 ; 0x14d96 else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 14fda: 87 e0 ldi r24, 0x07 ; 7 14fdc: 0f 94 2b 2d call 0x25a56 ; 0x25a56 14fe0: da ce rjmp .-588 ; 0x14d96 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); 14fe2: ce 01 movw r24, r28 14fe4: 01 96 adiw r24, 0x01 ; 1 14fe6: 0e 94 cb 6c call 0xd996 ; 0xd996 14fea: 94 ce rjmp .-728 ; 0x14d14 } break; // Filament loaded properly but color is not clear case 2: st_synchronize(); 14fec: 0f 94 ce 22 call 0x2459c ; 0x2459c load_filament_final_feed(); 14ff0: 0e 94 6b 5e call 0xbcd6 ; 0xbcd6 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(); 14ff4: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_puts_at_P(0, 0, _T(MSG_LOADING_COLOR)); 14ff8: 89 e9 ldi r24, 0x99 ; 153 14ffa: 98 e3 ldi r25, 0x38 ; 56 14ffc: 0e 94 a7 6c call 0xd94e ; 0xd94e 15000: ac 01 movw r20, r24 15002: 60 e0 ldi r22, 0x00 ; 0 15004: 80 e0 ldi r24, 0x00 ; 0 15006: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 1500a: 85 e6 ldi r24, 0x65 ; 101 1500c: 99 e3 ldi r25, 0x39 ; 57 1500e: 0e 94 a7 6c call 0xd94e ; 0xd94e 15012: ac 01 movw r20, r24 15014: 62 e0 ldi r22, 0x02 ; 2 15016: 80 e0 ldi r24, 0x00 ; 0 15018: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_loading_progress_bar((FILAMENTCHANGE_FINALFEED * 1000ul) / FILAMENTCHANGE_EFEED_FINAL); //show progress bar during filament loading slow sequence 1501c: 87 e9 ldi r24, 0x97 ; 151 1501e: 9d e1 ldi r25, 0x1D ; 29 15020: 0f 94 6d 0c call 0x218da ; 0x218da lcd_loading_color(); st_synchronize(); 15024: 0f 94 ce 22 call 0x2459c ; 0x2459c 15028: 75 ce rjmp .-790 ; 0x14d14 } void lcd_change_success() { lcd_clear(); 1502a: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); 1502e: 89 ea ldi r24, 0xA9 ; 169 15030: 98 e3 ldi r25, 0x38 ; 56 15032: 0e 94 a7 6c call 0xd94e ; 0xd94e 15036: ac 01 movw r20, r24 15038: 62 e0 ldi r22, 0x02 ; 2 1503a: 80 e0 ldi r24, 0x00 ; 0 1503c: 0e 94 85 69 call 0xd30a ; 0xd30a //! @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) 15040: 00 23 and r16, r16 15042: 19 f0 breq .+6 ; 0x1504a 15044: 03 30 cpi r16, 0x03 ; 3 15046: 09 f0 breq .+2 ; 0x1504a 15048: 65 ce rjmp .-822 ; 0x14d14 default: lcd_change_success(); break; } } return false; 1504a: 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(); } 1504c: 84 e8 ldi r24, 0x84 ; 132 1504e: 96 e1 ldi r25, 0x16 ; 22 15050: 0e 94 e6 6d call 0xdbcc ; 0xdbcc current_position[Y_AXIS] = y_position; plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); st_synchronize(); bool repeat = false; do { 15054: b1 10 cpse r11, r1 15056: c6 cd rjmp .-1140 ; 0x14be4 if (!automatic) repeat = M600_check_state_and_repeat(filament_name); } while (repeat); lcd_update_enable(true); 15058: 81 e0 ldi r24, 0x01 ; 1 1505a: 0e 94 b6 69 call 0xd36c ; 0xd36c // Not let's go back to print fanSpeed = saved_fan_speed; 1505e: 80 91 e8 11 lds r24, 0x11E8 ; 0x8011e8 15062: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 // Feed a little of filament to stabilize pressure if (!automatic) { 15066: 11 11 cpse r17, r1 15068: 27 c0 rjmp .+78 ; 0x150b8 if (printingIsPaused()) 1506a: 0e 94 b3 60 call 0xc166 ; 0xc166 1506e: c0 90 01 12 lds r12, 0x1201 ; 0x801201 15072: d0 90 02 12 lds r13, 0x1202 ; 0x801202 15076: e0 90 03 12 lds r14, 0x1203 ; 0x801203 1507a: f0 90 04 12 lds r15, 0x1204 ; 0x801204 1507e: 88 23 and r24, r24 15080: 09 f4 brne .+2 ; 0x15084 15082: 9f c0 rjmp .+318 ; 0x151c2 { // 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; 15084: 20 e0 ldi r18, 0x00 ; 0 15086: 30 e0 ldi r19, 0x00 ; 0 15088: 40 e8 ldi r20, 0x80 ; 128 1508a: 5f e3 ldi r21, 0x3F ; 63 1508c: c7 01 movw r24, r14 1508e: b6 01 movw r22, r12 15090: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 15094: 60 93 01 12 sts 0x1201, r22 ; 0x801201 15098: 70 93 02 12 sts 0x1202, r23 ; 0x801202 1509c: 80 93 03 12 sts 0x1203, r24 ; 0x801203 150a0: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 150a4: 60 e0 ldi r22, 0x00 ; 0 150a6: 70 e0 ldi r23, 0x00 ; 0 150a8: 88 ee ldi r24, 0xE8 ; 232 150aa: 92 e4 ldi r25, 0x42 ; 66 150ac: 0f 94 2f 85 call 0x30a5e ; 0x30a5e return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 150b0: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 150b4: 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); 150b8: e0 90 fd 11 lds r14, 0x11FD ; 0x8011fd 150bc: f0 90 fe 11 lds r15, 0x11FE ; 0x8011fe 150c0: 00 91 ff 11 lds r16, 0x11FF ; 0x8011ff 150c4: 10 91 00 12 lds r17, 0x1200 ; 0x801200 150c8: 20 91 94 02 lds r18, 0x0294 ; 0x800294 150cc: 30 91 95 02 lds r19, 0x0295 ; 0x800295 150d0: 40 91 96 02 lds r20, 0x0296 ; 0x800296 150d4: 50 91 97 02 lds r21, 0x0297 ; 0x800297 150d8: 60 91 90 02 lds r22, 0x0290 ; 0x800290 150dc: 70 91 91 02 lds r23, 0x0291 ; 0x800291 150e0: 80 91 92 02 lds r24, 0x0292 ; 0x800292 150e4: 90 91 93 02 lds r25, 0x0293 ; 0x800293 150e8: 1f 92 push r1 150ea: 1f 92 push r1 150ec: 1f 92 push r1 150ee: 1f 92 push r1 150f0: 81 2c mov r8, r1 150f2: 91 2c mov r9, r1 150f4: e8 e4 ldi r30, 0x48 ; 72 150f6: ae 2e mov r10, r30 150f8: e2 e4 ldi r30, 0x42 ; 66 150fa: be 2e mov r11, r30 150fc: f1 e0 ldi r31, 0x01 ; 1 150fe: cf 2e mov r12, r31 15100: f2 e1 ldi r31, 0x12 ; 18 15102: df 2e mov r13, r31 15104: 0f 94 e1 75 call 0x2ebc2 ; 0x2ebc2 st_synchronize(); 15108: 0f 94 ce 22 call 0x2459c ; 0x2459c // Move Z back plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_ZFEED); 1510c: e0 90 98 02 lds r14, 0x0298 ; 0x800298 15110: f0 90 99 02 lds r15, 0x0299 ; 0x800299 15114: 00 91 9a 02 lds r16, 0x029A ; 0x80029a 15118: 10 91 9b 02 lds r17, 0x029B ; 0x80029b 1511c: 20 91 94 02 lds r18, 0x0294 ; 0x800294 15120: 30 91 95 02 lds r19, 0x0295 ; 0x800295 15124: 40 91 96 02 lds r20, 0x0296 ; 0x800296 15128: 50 91 97 02 lds r21, 0x0297 ; 0x800297 1512c: 60 91 90 02 lds r22, 0x0290 ; 0x800290 15130: 70 91 91 02 lds r23, 0x0291 ; 0x800291 15134: 80 91 92 02 lds r24, 0x0292 ; 0x800292 15138: 90 91 93 02 lds r25, 0x0293 ; 0x800293 1513c: 1f 92 push r1 1513e: 1f 92 push r1 15140: 1f 92 push r1 15142: 1f 92 push r1 15144: 81 2c mov r8, r1 15146: 91 2c mov r9, r1 15148: a0 e7 ldi r26, 0x70 ; 112 1514a: aa 2e mov r10, r26 1514c: a1 e4 ldi r26, 0x41 ; 65 1514e: ba 2e mov r11, r26 15150: 0f 94 e1 75 call 0x2ebc2 ; 0x2ebc2 st_synchronize(); 15154: 0f 94 ce 22 call 0x2459c ; 0x2459c // Set E position to original plan_set_e_position(saved_pos[E_AXIS]); 15158: 8c e9 ldi r24, 0x9C ; 156 1515a: 92 e0 ldi r25, 0x02 ; 2 1515c: 0f 94 87 75 call 0x2eb0e ; 0x2eb0e memcpy(current_position, saved_pos, sizeof(saved_pos)); 15160: 80 e1 ldi r24, 0x10 ; 16 15162: e0 e9 ldi r30, 0x90 ; 144 15164: f2 e0 ldi r31, 0x02 ; 2 15166: a5 ef ldi r26, 0xF5 ; 245 15168: b1 e1 ldi r27, 0x11 ; 17 1516a: 01 90 ld r0, Z+ 1516c: 0d 92 st X+, r0 1516e: 8a 95 dec r24 15170: e1 f7 brne .-8 ; 0x1516a set_destination_to_current(); 15172: 0e 94 2c 61 call 0xc258 ; 0xc258 // Recover feed rate feedmultiply = saved_feedmultiply2; 15176: 80 91 f3 11 lds r24, 0x11F3 ; 0x8011f3 <_ZL19saved_feedmultiply2.lto_priv.502> 1517a: 90 91 f4 11 lds r25, 0x11F4 ; 0x8011f4 <_ZL19saved_feedmultiply2.lto_priv.502+0x1> 1517e: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e 15182: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f enquecommandf_P(MSG_M220, saved_feedmultiply2); 15186: 9f 93 push r25 15188: 8f 93 push r24 1518a: 87 ed ldi r24, 0xD7 ; 215 1518c: 94 e6 ldi r25, 0x64 ; 100 1518e: 9f 93 push r25 15190: 8f 93 push r24 15192: 0e 94 4a 7d call 0xfa94 ; 0xfa94 if (printingIsPaused()) { 15196: 0e 94 b3 60 call 0xc166 ; 0xc166 1519a: 0f b6 in r0, 0x3f ; 63 1519c: f8 94 cli 1519e: de bf out 0x3e, r29 ; 62 151a0: 0f be out 0x3f, r0 ; 63 151a2: cd bf out 0x3d, r28 ; 61 151a4: 88 23 and r24, r24 151a6: 21 f1 breq .+72 ; 0x151f0 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 151a8: 8b ee ldi r24, 0xEB ; 235 151aa: 90 e4 ldi r25, 0x40 ; 64 151ac: 0e 94 a7 6c call 0xd94e ; 0xd94e 151b0: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 } else { lcd_setstatuspgm(MSG_WELCOME); SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); } custom_message_type = CustomMsg::Status; 151b4: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 151b8: 0c 94 0f 98 jmp 0x1301e ; 0x1301e st_synchronize(); break; // Unload filament case 3: return true; 151bc: bb 24 eor r11, r11 151be: b3 94 inc r11 151c0: 45 cf rjmp .-374 ; 0x1504c setTargetHotend(0); } else { // Feed a little of filament to stabilize pressure current_position[E_AXIS] += FILAMENTCHANGE_RECFEED; 151c2: 20 e0 ldi r18, 0x00 ; 0 151c4: 30 e0 ldi r19, 0x00 ; 0 151c6: 40 ea ldi r20, 0xA0 ; 160 151c8: 50 e4 ldi r21, 0x40 ; 64 151ca: c7 01 movw r24, r14 151cc: b6 01 movw r22, r12 151ce: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 151d2: 60 93 01 12 sts 0x1201, r22 ; 0x801201 151d6: 70 93 02 12 sts 0x1202, r23 ; 0x801202 151da: 80 93 03 12 sts 0x1203, r24 ; 0x801203 151de: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED); 151e2: 60 e0 ldi r22, 0x00 ; 0 151e4: 70 e0 ldi r23, 0x00 ; 0 151e6: 80 e0 ldi r24, 0x00 ; 0 151e8: 90 e4 ldi r25, 0x40 ; 64 151ea: 0f 94 2f 85 call 0x30a5e ; 0x30a5e 151ee: 64 cf rjmp .-312 ; 0x150b8 if (printingIsPaused()) { lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); } else { lcd_setstatuspgm(MSG_WELCOME); 151f0: 87 e6 ldi r24, 0x67 ; 103 151f2: 9b e6 ldi r25, 0x6B ; 107 151f4: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); 151f8: 8c e7 ldi r24, 0x7C ; 124 151fa: 97 e6 ldi r25, 0x67 ; 103 151fc: 0e 94 49 72 call 0xe492 ; 0xe492 15200: d9 cf rjmp .-78 ; 0x151b4 SERIAL_ECHOPGM("Y:"); SERIAL_ECHOLN(pause_position[Y_AXIS]); SERIAL_ECHOPGM("Z:"); SERIAL_ECHOLN(pause_position[Z_AXIS]); */ if (!printingIsPaused()) { 15202: 0e 94 b3 60 call 0xc166 ; 0xc166 15206: 81 11 cpse r24, r1 15208: 0c 94 0f 98 jmp 0x1301e ; 0x1301e st_synchronize(); 1520c: 0f 94 ce 22 call 0x2459c ; 0x2459c ClearToSend(); //send OK even before the command finishes executing because we want to make sure it is not skipped because of cmdqueue_pop_front(); 15210: 0e 94 fc 72 call 0xe5f8 ; 0xe5f8 cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore 15214: 0e 94 c9 6f call 0xdf92 ; 0xdf92 lcd_pause_print(); 15218: 0f 94 08 10 call 0x22010 ; 0x22010 1521c: 0c 94 0f 98 jmp 0x1301e ; 0x1301e /*! ### M602 - Resume print M602: Resume print */ case 602: { if (printingIsPaused()) lcd_resume_print(); 15220: 0e 94 b3 60 call 0xc166 ; 0xc166 15224: 88 23 and r24, r24 15226: 11 f4 brne .+4 ; 0x1522c 15228: 0c 94 0f 98 jmp 0x1301e ; 0x1301e 1522c: 0c 94 64 98 jmp 0x130c8 ; 0x130c8 SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); break; // invalid sheet ID } } else { iSel = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 15230: 81 ea ldi r24, 0xA1 ; 161 15232: 9d e0 ldi r25, 0x0D ; 13 15234: 0f 94 9b a0 call 0x34136 ; 0x34136 15238: 18 2f mov r17, r24 } if (code_seen('Z')){ 1523a: 8a e5 ldi r24, 0x5A ; 90 1523c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15240: 88 23 and r24, r24 15242: 09 f4 brne .+2 ; 0x15246 15244: d7 c0 rjmp .+430 ; 0x153f4 z_val = code_value(); 15246: 0e 94 03 5a call 0xb406 ; 0xb406 1524a: 2b 01 movw r4, r22 1524c: 3c 01 movw r6, r24 zraw = z_val*cs.axis_steps_per_mm[Z_AXIS]; 1524e: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 15252: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 15256: 40 91 40 04 lds r20, 0x0440 ; 0x800440 1525a: 50 91 41 04 lds r21, 0x0441 ; 0x800441 1525e: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 15262: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 15266: 6b 01 movw r12, r22 if ((zraw < Z_BABYSTEP_MIN) || (zraw > Z_BABYSTEP_MAX)) 15268: 9b 01 movw r18, r22 1526a: 21 56 subi r18, 0x61 ; 97 1526c: 30 4f sbci r19, 0xF0 ; 240 1526e: 20 3a cpi r18, 0xA0 ; 160 15270: 3f 40 sbci r19, 0x0F ; 15 15272: 30 f0 brcs .+12 ; 0x15280 { SERIAL_PROTOCOLLNPGM(" Z VALUE OUT OF RANGE"); 15274: 8d ed ldi r24, 0xDD ; 221 15276: 9e e7 ldi r25, 0x7E ; 126 15278: 0e 94 49 72 call 0xe492 ; 0xe492 1527c: 0c 94 0f 98 jmp 0x1301e ; 0x1301e break; } eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[iSel].z_offset)),zraw); 15280: 5b e0 ldi r21, 0x0B ; 11 15282: 15 9f mul r17, r21 15284: 90 01 movw r18, r0 15286: 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); 15288: c9 01 movw r24, r18 1528a: 80 5b subi r24, 0xB0 ; 176 1528c: 92 4f sbci r25, 0xF2 ; 242 1528e: 0f 94 dd a0 call 0x341ba ; 0x341ba { 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')) 15292: 8c e4 ldi r24, 0x4C ; 76 15294: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15298: bb e0 ldi r27, 0x0B ; 11 1529a: 1b 9f mul r17, r27 1529c: 70 01 movw r14, r0 1529e: 11 24 eor r1, r1 152a0: 57 01 movw r10, r14 152a2: e7 eb ldi r30, 0xB7 ; 183 152a4: ae 1a sub r10, r30 152a6: e2 ef ldi r30, 0xF2 ; 242 152a8: be 0a sbc r11, r30 152aa: 88 23 and r24, r24 152ac: 09 f4 brne .+2 ; 0x152b0 152ae: be c0 rjmp .+380 ; 0x1542c { char *src = strchr_pointer + 1; 152b0: e0 91 f5 16 lds r30, 0x16F5 ; 0x8016f5 152b4: f0 91 f6 16 lds r31, 0x16F6 ; 0x8016f6 152b8: 31 96 adiw r30, 0x01 ; 1 152ba: bf 01 movw r22, r30 while (*src == ' ') ++src; 152bc: 81 91 ld r24, Z+ 152be: 80 32 cpi r24, 0x20 ; 32 152c0: e1 f3 breq .-8 ; 0x152ba if (*src != '\0') 152c2: 88 23 and r24, r24 152c4: 31 f0 breq .+12 ; 0x152d2 { strncpy(strLabel,src,7); 152c6: 47 e0 ldi r20, 0x07 ; 7 152c8: 50 e0 ldi r21, 0x00 ; 0 152ca: ce 01 movw r24, r28 152cc: 01 96 adiw r24, 0x01 ; 1 152ce: 0f 94 1b a7 call 0x34e36 ; 0x34e36 #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); 152d2: 47 e0 ldi r20, 0x07 ; 7 152d4: 50 e0 ldi r21, 0x00 ; 0 152d6: b5 01 movw r22, r10 152d8: ce 01 movw r24, r28 152da: 01 96 adiw r24, 0x01 ; 1 152dc: 0f 94 af a0 call 0x3415e ; 0x3415e else { eeprom_read_block(strLabel, EEPROM_Sheets_base->s[iSel].name, sizeof(Sheet::name)); } if (code_seen('B')) 152e0: 82 e4 ldi r24, 0x42 ; 66 152e2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 152e6: 57 01 movw r10, r14 152e8: fe ea ldi r31, 0xAE ; 174 152ea: af 1a sub r10, r31 152ec: f2 ef ldi r31, 0xF2 ; 242 152ee: bf 0a sbc r11, r31 152f0: 88 23 and r24, r24 152f2: 09 f4 brne .+2 ; 0x152f6 152f4: a3 c0 rjmp .+326 ; 0x1543c { iBedC = code_value_uint8(); 152f6: 0e 94 40 55 call 0xaa80 ; 0xaa80 152fa: 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); 152fc: 68 2f mov r22, r24 152fe: c5 01 movw r24, r10 15300: 0f 94 bf a0 call 0x3417e ; 0x3417e else { iBedC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].bed_temp); } if (code_seen('P')) 15304: 80 e5 ldi r24, 0x50 ; 80 15306: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1530a: 2d ea ldi r18, 0xAD ; 173 1530c: e2 1a sub r14, r18 1530e: 22 ef ldi r18, 0xF2 ; 242 15310: f2 0a sbc r15, r18 15312: 88 23 and r24, r24 15314: 09 f4 brne .+2 ; 0x15318 15316: 97 c0 rjmp .+302 ; 0x15446 { iPindaC = code_value_uint8(); 15318: 0e 94 40 55 call 0xaa80 ; 0xaa80 1531c: b8 2e mov r11, r24 1531e: 68 2f mov r22, r24 15320: c7 01 movw r24, r14 15322: 0f 94 bf a0 call 0x3417e ; 0x3417e else { iPindaC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].pinda_temp); } if (code_seen('A')) 15326: 81 e4 ldi r24, 0x41 ; 65 15328: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1532c: 88 23 and r24, r24 1532e: 09 f4 brne .+2 ; 0x15332 15330: 8f c0 rjmp .+286 ; 0x15450 { bIsActive |= code_value_uint8() || (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 15332: 0e 94 40 55 call 0xaa80 ; 0xaa80 15336: 81 11 cpse r24, r1 15338: 06 c0 rjmp .+12 ; 0x15346 1533a: 81 ea ldi r24, 0xA1 ; 161 1533c: 9d e0 ldi r25, 0x0D ; 13 1533e: 0f 94 9b a0 call 0x34136 ; 0x34136 15342: 18 13 cpse r17, r24 15344: 8d c0 rjmp .+282 ; 0x15460 if(bIsActive && eeprom_is_sheet_initialized(iSel)) { 15346: 81 2f mov r24, r17 15348: 0e 94 0e 6f call 0xde1c ; 0xde1c 1534c: 08 2f mov r16, r24 1534e: 88 23 and r24, r24 15350: 29 f0 breq .+10 ; 0x1535c 15352: 61 2f mov r22, r17 15354: 81 ea ldi r24, 0xA1 ; 161 15356: 9d e0 ldi r25, 0x0D ; 13 15358: 0f 94 bf a0 call 0x3417e ; 0x3417e else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); } SERIAL_PROTOCOLPGM("Sheet "); 1535c: 86 ed ldi r24, 0xD6 ; 214 1535e: 9e e7 ldi r25, 0x7E ; 126 15360: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 15364: 61 2f mov r22, r17 15366: 70 e0 ldi r23, 0x00 ; 0 15368: 90 e0 ldi r25, 0x00 ; 0 1536a: 80 e0 ldi r24, 0x00 ; 0 1536c: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_PROTOCOL((int)iSel); if (!eeprom_is_sheet_initialized(iSel)) 15370: 81 2f mov r24, r17 15372: 0e 94 0e 6f call 0xde1c ; 0xde1c 15376: 81 11 cpse r24, r1 15378: 04 c0 rjmp .+8 ; 0x15382 SERIAL_PROTOCOLLNPGM(" NOT INITIALIZED"); 1537a: 85 ec ldi r24, 0xC5 ; 197 1537c: 9e e7 ldi r25, 0x7E ; 126 1537e: 0e 94 49 72 call 0xe492 ; 0xe492 SERIAL_PROTOCOLPGM(" Z"); 15382: 82 ec ldi r24, 0xC2 ; 194 15384: 9e e7 ldi r25, 0x7E ; 126 15386: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 1538a: 44 e0 ldi r20, 0x04 ; 4 1538c: c3 01 movw r24, r6 1538e: b2 01 movw r22, r4 15390: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOL_F(z_val,4); SERIAL_PROTOCOLPGM(" R"); 15394: 8f eb ldi r24, 0xBF ; 191 15396: 9e e7 ldi r25, 0x7E ; 126 15398: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1539c: b6 01 movw r22, r12 1539e: dd 0c add r13, r13 153a0: 88 0b sbc r24, r24 153a2: 99 0b sbc r25, r25 153a4: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_PROTOCOL((int)zraw); SERIAL_PROTOCOLPGM(" L"); 153a8: 8c eb ldi r24, 0xBC ; 188 153aa: 9e e7 ldi r25, 0x7E ; 126 153ac: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 153b0: ce 01 movw r24, r28 153b2: 01 96 adiw r24, 0x01 ; 1 153b4: 0e 94 a0 7c call 0xf940 ; 0xf940 SERIAL_PROTOCOL(strLabel); SERIAL_PROTOCOLPGM(" B"); 153b8: 89 eb ldi r24, 0xB9 ; 185 153ba: 9e e7 ldi r25, 0x7E ; 126 153bc: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 153c0: 69 2d mov r22, r9 153c2: 70 e0 ldi r23, 0x00 ; 0 153c4: 90 e0 ldi r25, 0x00 ; 0 153c6: 80 e0 ldi r24, 0x00 ; 0 153c8: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_PROTOCOL((int)iBedC); SERIAL_PROTOCOLPGM(" P"); 153cc: 86 eb ldi r24, 0xB6 ; 182 153ce: 9e e7 ldi r25, 0x7E ; 126 153d0: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 153d4: 6b 2d mov r22, r11 153d6: 70 e0 ldi r23, 0x00 ; 0 153d8: 90 e0 ldi r25, 0x00 ; 0 153da: 80 e0 ldi r24, 0x00 ; 0 153dc: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_PROTOCOL((int)iPindaC); SERIAL_PROTOCOLPGM(" A"); 153e0: 83 eb ldi r24, 0xB3 ; 179 153e2: 9e e7 ldi r25, 0x7E ; 126 153e4: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_PROTOCOLLN((int)bIsActive); 153e8: 80 2f mov r24, r16 153ea: 90 e0 ldi r25, 0x00 ; 0 153ec: 0f 94 62 42 call 0x284c4 ; 0x284c4 153f0: 0c 94 0f 98 jmp 0x1301e ; 0x1301e } 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))); 153f4: ab e0 ldi r26, 0x0B ; 11 153f6: 1a 9f mul r17, r26 153f8: c0 01 movw r24, r0 153fa: 11 24 eor r1, r1 153fc: 80 5b subi r24, 0xB0 ; 176 153fe: 92 4f sbci r25, 0xF2 ; 242 15400: 0f 94 a9 a0 call 0x34152 ; 0x34152 15404: 6c 01 movw r12, r24 z_val = ((float)zraw/cs.axis_steps_per_mm[Z_AXIS]); 15406: bc 01 movw r22, r24 15408: 99 0f add r25, r25 1540a: 88 0b sbc r24, r24 1540c: 99 0b sbc r25, r25 1540e: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 15412: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 15416: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 1541a: 40 91 40 04 lds r20, 0x0440 ; 0x800440 1541e: 50 91 41 04 lds r21, 0x0441 ; 0x800441 15422: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 15426: 2b 01 movw r4, r22 15428: 3c 01 movw r6, r24 1542a: 33 cf rjmp .-410 ; 0x15292 } 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)); 1542c: 47 e0 ldi r20, 0x07 ; 7 1542e: 50 e0 ldi r21, 0x00 ; 0 15430: b5 01 movw r22, r10 15432: ce 01 movw r24, r28 15434: 01 96 adiw r24, 0x01 ; 1 15436: 0f 94 8b a0 call 0x34116 ; 0x34116 1543a: 52 cf rjmp .-348 ; 0x152e0 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); 1543c: c5 01 movw r24, r10 1543e: 0f 94 9b a0 call 0x34136 ; 0x34136 15442: 98 2e mov r9, r24 15444: 5f cf rjmp .-322 ; 0x15304 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); 15446: c7 01 movw r24, r14 15448: 0f 94 9b a0 call 0x34136 ; 0x34136 1544c: b8 2e mov r11, r24 1544e: 6b cf rjmp .-298 ; 0x15326 bIsActive = 0; } } else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 15450: 81 ea ldi r24, 0xA1 ; 161 15452: 9d e0 ldi r25, 0x0D ; 13 15454: 0f 94 9b a0 call 0x34136 ; 0x34136 15458: 01 e0 ldi r16, 0x01 ; 1 1545a: 18 17 cp r17, r24 1545c: 09 f4 brne .+2 ; 0x15460 1545e: 7e cf rjmp .-260 ; 0x1535c { 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; 15460: 00 e0 ldi r16, 0x00 ; 0 15462: 7c cf rjmp .-264 ; 0x1535c */ case 860: { int set_target_pinda = 0; if (code_seen('S')) { 15464: 83 e5 ldi r24, 0x53 ; 83 15466: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1546a: 88 23 and r24, r24 1546c: 11 f4 brne .+4 ; 0x15472 1546e: 0c 94 0f 98 jmp 0x1301e ; 0x1301e set_target_pinda = code_value_short(); 15472: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 15476: 8c 01 movw r16, r24 } else { break; } LCD_MESSAGERPGM(_T(MSG_PLEASE_WAIT)); 15478: 85 e6 ldi r24, 0x65 ; 101 1547a: 99 e3 ldi r25, 0x39 ; 57 1547c: 0e 94 a7 6c call 0xd94e ; 0xd94e 15480: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 SERIAL_PROTOCOLPGM("Wait for PINDA target temperature:"); 15484: 80 e9 ldi r24, 0x90 ; 144 15486: 9e e7 ldi r25, 0x7E ; 126 15488: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_PROTOCOLLN(set_target_pinda); 1548c: c8 01 movw r24, r16 1548e: 0f 94 62 42 call 0x284c4 ; 0x284c4 codenum = _millis(); 15492: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 15496: 4b 01 movw r8, r22 15498: 5c 01 movw r10, r24 cancel_heatup = false; 1549a: 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; 1549e: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 154a2: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 154a6: 89 2b or r24, r25 154a8: 41 f4 brne .+16 ; 0x154ba 154aa: ff 24 eor r15, r15 154ac: f3 94 inc r15 154ae: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed 154b2: 90 91 ee 11 lds r25, 0x11EE ; 0x8011ee 154b6: 89 2b or r24, r25 154b8: 09 f0 breq .+2 ; 0x154bc SERIAL_PROTOCOLLN(set_target_pinda); codenum = _millis(); cancel_heatup = false; bool is_pinda_cooling = false; 154ba: 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)) ) { 154bc: 28 01 movw r4, r16 154be: 01 2e mov r0, r17 154c0: 00 0c add r0, r0 154c2: 66 08 sbc r6, r6 154c4: 77 08 sbc r7, r7 154c6: f1 10 cpse r15, r1 154c8: 1a c0 rjmp .+52 ; 0x154fe 154ca: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.377> 154ce: 81 11 cpse r24, r1 154d0: 10 c0 rjmp .+32 ; 0x154f2 154d2: c3 01 movw r24, r6 154d4: b2 01 movw r22, r4 154d6: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 154da: 20 91 8e 06 lds r18, 0x068E ; 0x80068e 154de: 30 91 8f 06 lds r19, 0x068F ; 0x80068f 154e2: 40 91 90 06 lds r20, 0x0690 ; 0x800690 154e6: 50 91 91 06 lds r21, 0x0691 ; 0x800691 154ea: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 154ee: 18 16 cp r1, r24 154f0: b4 f0 brlt .+44 ; 0x1551e } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(MSG_OK); 154f2: 81 e3 ldi r24, 0x31 ; 49 154f4: 99 e6 ldi r25, 0x69 ; 105 154f6: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 154fa: 0c 94 0f 98 jmp 0x1301e ; 0x1301e 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)) ) { 154fe: c3 01 movw r24, r6 15500: b2 01 movw r22, r4 15502: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 15506: 20 91 8e 06 lds r18, 0x068E ; 0x80068e 1550a: 30 91 8f 06 lds r19, 0x068F ; 0x80068f 1550e: 40 91 90 06 lds r20, 0x0690 ; 0x800690 15512: 50 91 91 06 lds r21, 0x0691 ; 0x800691 15516: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1551a: 87 ff sbrs r24, 7 1551c: ea cf rjmp .-44 ; 0x154f2 if ((_millis() - codenum) > 1000) //Print Temp Reading every 1 second while waiting. 1551e: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 15522: 68 19 sub r22, r8 15524: 79 09 sbc r23, r9 15526: 8a 09 sbc r24, r10 15528: 9b 09 sbc r25, r11 1552a: 69 3e cpi r22, 0xE9 ; 233 1552c: 73 40 sbci r23, 0x03 ; 3 1552e: 81 05 cpc r24, r1 15530: 91 05 cpc r25, r1 15532: c8 f0 brcs .+50 ; 0x15566 { SERIAL_PROTOCOLPGM("P:"); 15534: 8d e8 ldi r24, 0x8D ; 141 15536: 9e e7 ldi r25, 0x7E ; 126 15538: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 1553c: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 15540: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 15544: 80 91 90 06 lds r24, 0x0690 ; 0x800690 15548: 90 91 91 06 lds r25, 0x0691 ; 0x800691 1554c: 41 e0 ldi r20, 0x01 ; 1 1554e: 0f 94 08 98 call 0x33010 ; 0x33010 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15552: 8f e2 ldi r24, 0x2F ; 47 15554: 0e 94 37 70 call 0xe06e ; 0xe06e SERIAL_PROTOCOL_F(current_temperature_pinda, 1); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(set_target_pinda); 15558: c8 01 movw r24, r16 1555a: 0f 94 62 42 call 0x284c4 ; 0x284c4 codenum = _millis(); 1555e: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 15562: 4b 01 movw r8, r22 15564: 5c 01 movw r10, r24 } manage_heater(); 15566: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(); 1556a: 80 e0 ldi r24, 0x00 ; 0 1556c: 0e 94 fe 79 call 0xf3fc ; 0xf3fc lcd_update(0); 15570: 80 e0 ldi r24, 0x00 ; 0 15572: 0e 94 38 69 call 0xd270 ; 0xd270 15576: a7 cf rjmp .-178 ; 0x154c6 - `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 15578: 8f e3 ldi r24, 0x3F ; 63 1557a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1557e: 88 23 and r24, r24 15580: c9 f0 breq .+50 ; 0x155b4 SERIAL_PROTOCOLPGM("PINDA cal status: "); 15582: 8a e7 ldi r24, 0x7A ; 122 15584: 9e e7 ldi r25, 0x7E ; 126 15586: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 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); } 1558a: 86 ea ldi r24, 0xA6 ; 166 1558c: 9f e0 ldi r25, 0x0F ; 15 1558e: 0f 94 9b a0 call 0x34136 ; 0x34136 15592: 21 e0 ldi r18, 0x01 ; 1 15594: 30 e0 ldi r19, 0x00 ; 0 15596: 81 11 cpse r24, r1 15598: 02 c0 rjmp .+4 ; 0x1559e 1559a: 30 e0 ldi r19, 0x00 ; 0 1559c: 20 e0 ldi r18, 0x00 ; 0 SERIAL_PROTOCOLLN(calibration_status_pinda()); 1559e: c9 01 movw r24, r18 155a0: 0f 94 62 42 call 0x284c4 ; 0x284c4 SERIAL_PROTOCOLLNRPGM(_header); 155a4: 83 e6 ldi r24, 0x63 ; 99 155a6: 9e e7 ldi r25, 0x7E ; 126 155a8: 0e 94 49 72 call 0xe492 ; 0xe492 gcode_M861_print_pinda_cal_eeprom(); 155ac: 0e 94 88 70 call 0xe110 ; 0xe110 155b0: 0c 94 0f 98 jmp 0x1301e ; 0x1301e } else if (code_seen('!')) { // ! - Set factory default values 155b4: 81 e2 ldi r24, 0x21 ; 33 155b6: 0e 94 2b 55 call 0xaa56 ; 0xaa56 155ba: 88 23 and r24, r24 155bc: 49 f1 breq .+82 ; 0x15610 155be: 61 e0 ldi r22, 0x01 ; 1 155c0: 86 ea ldi r24, 0xA6 ; 166 155c2: 9f e0 ldi r25, 0x0F ; 15 155c4: 0f 94 bf a0 call 0x3417e ; 0x3417e if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 155c8: 68 e0 ldi r22, 0x08 ; 8 155ca: 70 e0 ldi r23, 0x00 ; 0 155cc: 80 eb ldi r24, 0xB0 ; 176 155ce: 9f e0 ldi r25, 0x0F ; 15 155d0: 0f 94 dd a0 call 0x341ba ; 0x341ba 155d4: 68 e1 ldi r22, 0x18 ; 24 155d6: 70 e0 ldi r23, 0x00 ; 0 155d8: 82 eb ldi r24, 0xB2 ; 178 155da: 9f e0 ldi r25, 0x0F ; 15 155dc: 0f 94 dd a0 call 0x341ba ; 0x341ba 155e0: 60 e3 ldi r22, 0x30 ; 48 155e2: 70 e0 ldi r23, 0x00 ; 0 155e4: 84 eb ldi r24, 0xB4 ; 180 155e6: 9f e0 ldi r25, 0x0F ; 15 155e8: 0f 94 dd a0 call 0x341ba ; 0x341ba 155ec: 60 e5 ldi r22, 0x50 ; 80 155ee: 70 e0 ldi r23, 0x00 ; 0 155f0: 86 eb ldi r24, 0xB6 ; 182 155f2: 9f e0 ldi r25, 0x0F ; 15 155f4: 0f 94 dd a0 call 0x341ba ; 0x341ba 155f8: 68 e7 ldi r22, 0x78 ; 120 155fa: 70 e0 ldi r23, 0x00 ; 0 155fc: 88 eb ldi r24, 0xB8 ; 184 155fe: 9f e0 ldi r25, 0x0F ; 15 15600: 0f 94 dd a0 call 0x341ba ; 0x341ba 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"); 15604: 82 e5 ldi r24, 0x52 ; 82 15606: 9e e7 ldi r25, 0x7E ; 126 15608: 0e 94 49 72 call 0xe492 ; 0xe492 1560c: 0c 94 0f 98 jmp 0x1301e ; 0x1301e } else if (code_seen('Z')) { // Z - Set all values to 0 (effectively disabling PINDA temperature compensation) 15610: 8a e5 ldi r24, 0x5A ; 90 15612: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15616: 88 23 and r24, r24 15618: c1 f0 breq .+48 ; 0x1564a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1561a: 61 e0 ldi r22, 0x01 ; 1 1561c: 86 ea ldi r24, 0xA6 ; 166 1561e: 9f e0 ldi r25, 0x0F ; 15 15620: 0f 94 bf a0 call 0x3417e ; 0x3417e 15624: 00 eb ldi r16, 0xB0 ; 176 15626: 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); 15628: 70 e0 ldi r23, 0x00 ; 0 1562a: 60 e0 ldi r22, 0x00 ; 0 1562c: c8 01 movw r24, r16 1562e: 0f 94 dd a0 call 0x341ba ; 0x341ba 15632: 0e 5f subi r16, 0xFE ; 254 15634: 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++) { 15636: 0a 3b cpi r16, 0xBA ; 186 15638: 4f e0 ldi r20, 0x0F ; 15 1563a: 14 07 cpc r17, r20 1563c: a9 f7 brne .-22 ; 0x15628 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } SERIAL_PROTOCOLLNPGM("zerorized"); 1563e: 88 e4 ldi r24, 0x48 ; 72 15640: 9e e7 ldi r25, 0x7E ; 126 15642: 0e 94 49 72 call 0xe492 ; 0xe492 15646: 0c 94 0f 98 jmp 0x1301e ; 0x1301e } else if (code_seen('S')) { // Sxxx Iyyy - Set compensation ustep value S for compensation table index I 1564a: 83 e5 ldi r24, 0x53 ; 83 1564c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15650: 88 23 and r24, r24 15652: 21 f1 breq .+72 ; 0x1569c int16_t usteps = code_value_short(); 15654: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 15658: 8c 01 movw r16, r24 if (code_seen('I')) { 1565a: 89 e4 ldi r24, 0x49 ; 73 1565c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15660: 88 23 and r24, r24 15662: 11 f4 brne .+4 ; 0x15668 15664: 0c 94 0f 98 jmp 0x1301e ; 0x1301e uint8_t index = code_value_uint8(); 15668: 0e 94 40 55 call 0xaa80 ; 0xaa80 if (index < 5) { 1566c: 85 30 cpi r24, 0x05 ; 5 1566e: 10 f0 brcs .+4 ; 0x15674 15670: 0c 94 0f 98 jmp 0x1301e ; 0x1301e eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + index, usteps); 15674: 90 e0 ldi r25, 0x00 ; 0 15676: 88 52 subi r24, 0x28 ; 40 15678: 98 4f sbci r25, 0xF8 ; 248 1567a: b8 01 movw r22, r16 1567c: 88 0f add r24, r24 1567e: 99 1f adc r25, r25 15680: 0f 94 dd a0 call 0x341ba ; 0x341ba SERIAL_PROTOCOLLNRPGM(MSG_OK); 15684: 81 e3 ldi r24, 0x31 ; 49 15686: 99 e6 ldi r25, 0x69 ; 105 15688: 0e 94 49 72 call 0xe492 ; 0xe492 SERIAL_PROTOCOLLNRPGM(_header); 1568c: 83 e6 ldi r24, 0x63 ; 99 1568e: 9e e7 ldi r25, 0x7E ; 126 15690: 0e 94 49 72 call 0xe492 ; 0xe492 gcode_M861_print_pinda_cal_eeprom(); 15694: 0e 94 88 70 call 0xe110 ; 0xe110 15698: 0c 94 0f 98 jmp 0x1301e ; 0x1301e } } } else { SERIAL_PROTOCOLLNPGM("no valid command"); 1569c: 87 e3 ldi r24, 0x37 ; 55 1569e: 9e e7 ldi r25, 0x7E ; 126 156a0: 0e 94 49 72 call 0xe492 ; 0xe492 156a4: 0c 94 0f 98 jmp 0x1301e ; 0x1301e 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) 156a8: 64 30 cpi r22, 0x04 ; 4 156aa: 09 f4 brne .+2 ; 0x156ae 156ac: be c0 rjmp .+380 ; 0x1582a 156ae: 65 30 cpi r22, 0x05 ; 5 156b0: 11 f0 breq .+4 ; 0x156b6 156b2: 0c 94 0f 98 jmp 0x1301e ; 0x1301e 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')) 156b6: 80 e5 ldi r24, 0x50 ; 80 156b8: 0e 94 2b 55 call 0xaa56 ; 0xaa56 156bc: 88 23 and r24, r24 156be: 09 f4 brne .+2 ; 0x156c2 156c0: 3a c1 rjmp .+628 ; 0x15936 { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); 156c2: 0e 94 93 55 call 0xab26 ; 0xab26 done: return true; } void gcode_level_check(uint16_t nGcodeLevel) { if (oCheckGcode == ClCheckMode::_None) 156c6: 10 91 b6 03 lds r17, 0x03B6 ; 0x8003b6 156ca: 11 23 and r17, r17 156cc: 11 f4 brne .+4 ; 0x156d2 156ce: 0c 94 0f 98 jmp 0x1301e ; 0x1301e return; if (nGcodeLevel <= (uint16_t)GCODE_LEVEL) 156d2: 62 30 cpi r22, 0x02 ; 2 156d4: 71 05 cpc r23, r1 156d6: 10 f4 brcc .+4 ; 0x156dc 156d8: 0c 94 0f 98 jmp 0x1301e ; 0x1301e // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(GCODE_LEVEL); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nGcodeLevel); render_M862_warnings( 156dc: 8b ea ldi r24, 0xAB ; 171 156de: 96 e3 ldi r25, 0x36 ; 54 156e0: 0e 94 a7 6c call 0xd94e ; 0xd94e 156e4: 7c 01 movw r14, r24 156e6: 84 e8 ldi r24, 0x84 ; 132 156e8: 96 e3 ldi r25, 0x36 ; 54 156ea: 0e 94 a7 6c call 0xd94e ; 0xd94e 156ee: 41 2f mov r20, r17 156f0: b7 01 movw r22, r14 156f2: 0e 94 19 f0 call 0x1e032 ; 0x1e032 156f6: 0c 94 0f 98 jmp 0x1301e ; 0x1301e ClPrintChecking nCommand = static_cast((uint16_t)(code_value()*10) - 8620u); switch(nCommand) { case ClPrintChecking::_Nozzle: // ~ .1 uint16_t nDiameter; if(code_seen('P')) 156fa: 80 e5 ldi r24, 0x50 ; 80 156fc: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15700: 88 23 and r24, r24 15702: a9 f0 breq .+42 ; 0x1572e { nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 15704: 0e 94 03 5a call 0xb406 ; 0xb406 15708: 20 e0 ldi r18, 0x00 ; 0 1570a: 30 e0 ldi r19, 0x00 ; 0 1570c: 4a e7 ldi r20, 0x7A ; 122 1570e: 54 e4 ldi r21, 0x44 ; 68 15710: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 15714: 20 e0 ldi r18, 0x00 ; 0 15716: 30 e0 ldi r19, 0x00 ; 0 15718: 40 e0 ldi r20, 0x00 ; 0 1571a: 5f e3 ldi r21, 0x3F ; 63 1571c: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 15720: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> nozzle_diameter_check(nDiameter); 15724: cb 01 movw r24, r22 15726: 0e 94 58 f0 call 0x1e0b0 ; 0x1e0b0 1572a: 0c 94 0f 98 jmp 0x1301e ; 0x1301e } else if(code_seen('Q')) 1572e: 81 e5 ldi r24, 0x51 ; 81 15730: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15734: 88 23 and r24, r24 15736: 11 f4 brne .+4 ; 0x1573c 15738: 0c 94 0f 98 jmp 0x1301e ; 0x1301e SERIAL_PROTOCOLLN((float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); 1573c: 85 ea ldi r24, 0xA5 ; 165 1573e: 9d e0 ldi r25, 0x0D ; 13 15740: 0f 94 a9 a0 call 0x34152 ; 0x34152 15744: bc 01 movw r22, r24 15746: 90 e0 ldi r25, 0x00 ; 0 15748: 80 e0 ldi r24, 0x00 ; 0 1574a: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 1574e: 20 e0 ldi r18, 0x00 ; 0 15750: 30 e0 ldi r19, 0x00 ; 0 15752: 4a e7 ldi r20, 0x7A ; 122 15754: 54 e4 ldi r21, 0x44 ; 68 15756: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1575a: 0f 94 45 42 call 0x2848a ; 0x2848a 1575e: 0c 94 0f 98 jmp 0x1301e ; 0x1301e 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')) 15762: 81 e5 ldi r24, 0x51 ; 81 15764: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15768: 88 23 and r24, r24 1576a: 11 f4 brne .+4 ; 0x15770 1576c: 0c 94 0f 98 jmp 0x1301e ; 0x1301e print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 15770: b8 01 movw r22, r16 15772: 90 e0 ldi r25, 0x00 ; 0 15774: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 15776: 4a e0 ldi r20, 0x0A ; 10 15778: 0f 94 eb 96 call 0x32dd6 ; 0x32dd6 } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); 1577c: 0f 94 bb 98 call 0x33176 ; 0x33176 15780: 0c 94 0f 98 jmp 0x1301e ; 0x1301e return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 15784: 80 91 94 12 lds r24, 0x1294 ; 0x801294 return _sPrinterMmuName; 15788: 7b ef ldi r23, 0xFB ; 251 1578a: e7 2e mov r14, r23 1578c: 78 e7 ldi r23, 0x78 ; 120 1578e: f7 2e mov r15, r23 return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 15790: 81 30 cpi r24, 0x01 ; 1 15792: 21 f0 breq .+8 ; 0x1579c return _sPrinterMmuName; } else { return _sPrinterName; 15794: 64 ef ldi r22, 0xF4 ; 244 15796: e6 2e mov r14, r22 15798: 68 e7 ldi r22, 0x78 ; 120 1579a: f6 2e mov r15, r22 SERIAL_PROTOCOLLN(type); } break; case ClPrintChecking::_Smodel: { // ~ .3 const char *type = sPrinterType(MMU2::mmu2.Enabled()); if(code_seen('P')) 1579c: 80 e5 ldi r24, 0x50 ; 80 1579e: 0e 94 2b 55 call 0xaa56 ; 0xaa56 157a2: 88 23 and r24, r24 157a4: b1 f1 breq .+108 ; 0x15812 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 157a6: 62 e2 ldi r22, 0x22 ; 34 157a8: 70 e0 ldi r23, 0x00 ; 0 157aa: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 157ae: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 157b2: 0f 94 f2 a6 call 0x34de4 ; 0x34de4 157b6: 8c 01 movw r16, r24 if (!this->ptr) { 157b8: 89 2b or r24, r25 157ba: d1 f0 breq .+52 ; 0x157f0 // First quote not found return; } // Skip the leading quote this->ptr++; 157bc: 0f 5f subi r16, 0xFF ; 255 157be: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 157c0: 62 e2 ldi r22, 0x22 ; 34 157c2: 70 e0 ldi r23, 0x00 ; 0 157c4: c8 01 movw r24, r16 157c6: 0f 94 f2 a6 call 0x34de4 ; 0x34de4 if(!pStrEnd) { 157ca: 00 97 sbiw r24, 0x00 ; 0 157cc: 89 f0 breq .+34 ; 0x157f0 // Second quote not found return; } this->len = pStrEnd - this->ptr; 157ce: d8 2e mov r13, r24 157d0: d0 1a sub r13, r16 157d2: c7 01 movw r24, r14 157d4: 0f 94 59 9e call 0x33cb2 ; 0x33cb2 <__strlen_P> unquoted_string smodel = unquoted_string(pStrPos); if(smodel.WasFound()) { const uint8_t compareLength = strlen_P(actualPrinterSModel); if(compareLength == smodel.GetLength()) { 157d8: d8 12 cpse r13, r24 157da: 0a c0 rjmp .+20 ; 0x157f0 if (strncmp_P(smodel.GetUnquotedString(), actualPrinterSModel, compareLength) == 0) return; 157dc: ac 01 movw r20, r24 157de: 55 27 eor r21, r21 157e0: b7 01 movw r22, r14 157e2: c8 01 movw r24, r16 157e4: 0f 94 7a 9e call 0x33cf4 ; 0x33cf4 157e8: 89 2b or r24, r25 157ea: 11 f4 brne .+4 ; 0x157f0 157ec: 0c 94 0f 98 jmp 0x1301e ; 0x1301e } } render_M862_warnings( 157f0: f0 90 b8 03 lds r15, 0x03B8 ; 0x8003b8 157f4: 89 e8 ldi r24, 0x89 ; 137 157f6: 97 e3 ldi r25, 0x37 ; 55 157f8: 0e 94 a7 6c call 0xd94e ; 0xd94e 157fc: 8c 01 movw r16, r24 157fe: 8b e5 ldi r24, 0x5B ; 91 15800: 97 e3 ldi r25, 0x37 ; 55 15802: 0e 94 a7 6c call 0xd94e ; 0xd94e 15806: 4f 2d mov r20, r15 15808: b8 01 movw r22, r16 1580a: 0e 94 19 f0 call 0x1e032 ; 0x1e032 1580e: 0c 94 0f 98 jmp 0x1301e ; 0x1301e { printer_smodel_check(strchr_pointer, type); } else if(code_seen('Q')) 15812: 81 e5 ldi r24, 0x51 ; 81 15814: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15818: 88 23 and r24, r24 1581a: 11 f4 brne .+4 ; 0x15820 1581c: 0c 94 0f 98 jmp 0x1301e ; 0x1301e SERIAL_PROTOCOLLNRPGM(type); 15820: c7 01 movw r24, r14 15822: 0e 94 49 72 call 0xe492 ; 0xe492 15826: 0c 94 0f 98 jmp 0x1301e ; 0x1301e } break; case ClPrintChecking::_Version: // ~ .4 if(code_seen('P')) 1582a: 80 e5 ldi r24, 0x50 ; 80 1582c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15830: 88 23 and r24, r24 15832: 09 f4 brne .+2 ; 0x15836 15834: 77 c0 rjmp .+238 ; 0x15924 fw_version_check(++strchr_pointer); 15836: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 1583a: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 1583e: 01 96 adiw r24, 0x01 ; 1 15840: 90 93 f6 16 sts 0x16F6, r25 ; 0x8016f6 15844: 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) 15848: 20 91 b7 03 lds r18, 0x03B7 ; 0x8003b7 1584c: 22 23 and r18, r18 1584e: 11 f4 brne .+4 ; 0x15854 15850: 0c 94 0f 98 jmp 0x1301e ; 0x1301e return; uint16_t aVersion[4]; uint8_t nCompareValueResult; parse_version(pVersion, aVersion); 15854: be 01 movw r22, r28 15856: 6f 5f subi r22, 0xFF ; 255 15858: 7f 4f sbci r23, 0xFF ; 255 1585a: 0e 94 4b e1 call 0x1c296 ; 0x1c296 nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6; 1585e: 8a e0 ldi r24, 0x0A ; 10 15860: 90 e0 ldi r25, 0x00 ; 0 15862: 0f 94 a9 a0 call 0x34152 ; 0x34152 15866: 29 81 ldd r18, Y+1 ; 0x01 15868: 3a 81 ldd r19, Y+2 ; 0x02 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 1586a: 12 e0 ldi r17, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 1586c: 82 17 cp r24, r18 1586e: 93 07 cpc r25, r19 15870: 28 f0 brcs .+10 ; 0x1587c return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 15872: 11 e0 ldi r17, 0x01 ; 1 15874: 28 17 cp r18, r24 15876: 39 07 cpc r19, r25 15878: 08 f4 brcc .+2 ; 0x1587c 1587a: 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; 1587c: 12 95 swap r17 1587e: 11 0f add r17, r17 15880: 11 0f add r17, r17 15882: 10 7c andi r17, 0xC0 ; 192 nCompareValueResult += mCompareValue(aVersion[1], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR)) << 4; 15884: 8c e0 ldi r24, 0x0C ; 12 15886: 90 e0 ldi r25, 0x00 ; 0 15888: 0f 94 a9 a0 call 0x34152 ; 0x34152 1588c: ac 01 movw r20, r24 1588e: 2b 81 ldd r18, Y+3 ; 0x03 15890: 3c 81 ldd r19, Y+4 ; 0x04 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 15892: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 15894: 42 17 cp r20, r18 15896: 53 07 cpc r21, r19 15898: 28 f0 brcs .+10 ; 0x158a4 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 1589a: 81 e0 ldi r24, 0x01 ; 1 1589c: 24 17 cp r18, r20 1589e: 35 07 cpc r19, r21 158a0: 08 f4 brcc .+2 ; 0x158a4 158a2: 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; 158a4: 50 e1 ldi r21, 0x10 ; 16 158a6: 85 9f mul r24, r21 158a8: c0 01 movw r24, r0 158aa: 11 24 eor r1, r1 158ac: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[2], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_REVISION)) << 2; 158ae: 8e e0 ldi r24, 0x0E ; 14 158b0: 90 e0 ldi r25, 0x00 ; 0 158b2: 0f 94 a9 a0 call 0x34152 ; 0x34152 158b6: ac 01 movw r20, r24 158b8: 2d 81 ldd r18, Y+5 ; 0x05 158ba: 3e 81 ldd r19, Y+6 ; 0x06 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 158bc: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 158be: 42 17 cp r20, r18 158c0: 53 07 cpc r21, r19 158c2: 28 f0 brcs .+10 ; 0x158ce return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 158c4: 81 e0 ldi r24, 0x01 ; 1 158c6: 24 17 cp r18, r20 158c8: 35 07 cpc r19, r21 158ca: 08 f4 brcc .+2 ; 0x158ce 158cc: 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; 158ce: a4 e0 ldi r26, 0x04 ; 4 158d0: 8a 9f mul r24, r26 158d2: c0 01 movw r24, r0 158d4: 11 24 eor r1, r1 158d6: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[3], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_FLAVOR)); 158d8: 80 e1 ldi r24, 0x10 ; 16 158da: 90 e0 ldi r25, 0x00 ; 0 158dc: 0f 94 a9 a0 call 0x34152 ; 0x34152 158e0: ac 01 movw r20, r24 158e2: 2f 81 ldd r18, Y+7 ; 0x07 158e4: 38 85 ldd r19, Y+8 ; 0x08 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 158e6: 92 e0 ldi r25, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 158e8: 42 17 cp r20, r18 158ea: 53 07 cpc r21, r19 158ec: 28 f0 brcs .+10 ; 0x158f8 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 158ee: 91 e0 ldi r25, 0x01 ; 1 158f0: 24 17 cp r18, r20 158f2: 35 07 cpc r19, r21 158f4: 08 f4 brcc .+2 ; 0x158f8 158f6: 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)); 158f8: 19 0f add r17, r25 if (nCompareValueResult <= COMPARE_VALUE_EQUAL) 158fa: 16 35 cpi r17, 0x56 ; 86 158fc: 10 f4 brcc .+4 ; 0x15902 158fe: 0c 94 0f 98 jmp 0x1301e ; 0x1301e SERIAL_ECHO(aVersion[2]); SERIAL_ECHO('.'); SERIAL_ECHOLN(aVersion[3]); */ render_M862_warnings( 15902: f0 90 b7 03 lds r15, 0x03B7 ; 0x8003b7 15906: 89 e1 ldi r24, 0x19 ; 25 15908: 97 e3 ldi r25, 0x37 ; 55 1590a: 0e 94 a7 6c call 0xd94e ; 0xd94e 1590e: 8c 01 movw r16, r24 15910: 83 ef ldi r24, 0xF3 ; 243 15912: 96 e3 ldi r25, 0x36 ; 54 15914: 0e 94 a7 6c call 0xd94e ; 0xd94e 15918: 4f 2d mov r20, r15 1591a: b8 01 movw r22, r16 1591c: 0e 94 19 f0 call 0x1e032 ; 0x1e032 15920: 0c 94 0f 98 jmp 0x1301e ; 0x1301e else if(code_seen('Q')) 15924: 81 e5 ldi r24, 0x51 ; 81 15926: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1592a: 88 23 and r24, r24 1592c: 11 f4 brne .+4 ; 0x15932 1592e: 0c 94 0f 98 jmp 0x1301e ; 0x1301e 15932: 0c 94 cd 93 jmp 0x1279a ; 0x1279a { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); gcode_level_check(nGcodeLevel); } else if(code_seen('Q')) 15936: 81 e5 ldi r24, 0x51 ; 81 15938: 0e 94 2b 55 call 0xaa56 ; 0xaa56 1593c: 88 23 and r24, r24 1593e: 11 f4 brne .+4 ; 0x15944 15940: 0c 94 0f 98 jmp 0x1301e ; 0x1301e SERIAL_PROTOCOLLN(GCODE_LEVEL); 15944: 81 e0 ldi r24, 0x01 ; 1 15946: 90 e0 ldi r25, 0x00 ; 0 15948: 0f 94 62 42 call 0x284c4 ; 0x284c4 1594c: 0c 94 0f 98 jmp 0x1301e ; 0x1301e * 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; 15950: 8b e4 ldi r24, 0x4B ; 75 15952: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15956: c1 2c mov r12, r1 15958: d1 2c mov r13, r1 1595a: e1 2c mov r14, r1 1595c: 50 ec ldi r21, 0xC0 ; 192 1595e: f5 2e mov r15, r21 15960: 88 23 and r24, r24 15962: 49 f1 breq .+82 ; 0x159b6 15964: 0e 94 03 5a call 0xb406 ; 0xb406 15968: 6b 01 movw r12, r22 1596a: 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) 1596c: 20 e0 ldi r18, 0x00 ; 0 1596e: 30 e0 ldi r19, 0x00 ; 0 15970: a9 01 movw r20, r18 15972: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 15976: 81 11 cpse r24, r1 15978: 1e c0 rjmp .+60 ; 0x159b6 { extruder_advance_K = 0; 1597a: 10 92 e1 16 sts 0x16E1, r1 ; 0x8016e1 1597e: 10 92 e2 16 sts 0x16E2, r1 ; 0x8016e2 15982: 10 92 e3 16 sts 0x16E3, r1 ; 0x8016e3 15986: 10 92 e4 16 sts 0x16E4, r1 ; 0x8016e4 1598a: 0e 94 de 73 call 0xe7bc ; 0xe7bc else extruder_advance_K = newK; } #endif SERIAL_ECHO_START; 1598e: 81 e6 ldi r24, 0x61 ; 97 15990: 9d e9 ldi r25, 0x9D ; 157 15992: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOPGM("Advance K="); 15996: 81 ed ldi r24, 0xD1 ; 209 15998: 98 e7 ldi r25, 0x78 ; 120 1599a: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLN(extruder_advance_K); 1599e: 60 91 e1 16 lds r22, 0x16E1 ; 0x8016e1 159a2: 70 91 e2 16 lds r23, 0x16E2 ; 0x8016e2 159a6: 80 91 e3 16 lds r24, 0x16E3 ; 0x8016e3 159aa: 90 91 e4 16 lds r25, 0x16E4 ; 0x8016e4 159ae: 0f 94 45 42 call 0x2848a ; 0x2848a 159b2: 0c 94 0f 98 jmp 0x1301e ; 0x1301e } float la10c_value(float k) { if(la10c_mode == LA10C_UNKNOWN) 159b6: 80 91 45 03 lds r24, 0x0345 ; 0x800345 159ba: 81 11 cpse r24, r1 159bc: 1b c0 rjmp .+54 ; 0x159f4 { // do not autodetect until a valid value is seen if(k == 0) return 0; else if(k < 0) 159be: 20 e0 ldi r18, 0x00 ; 0 159c0: 30 e0 ldi r19, 0x00 ; 0 159c2: a9 01 movw r20, r18 159c4: c7 01 movw r24, r14 159c6: b6 01 movw r22, r12 159c8: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 159cc: 87 ff sbrs r24, 7 159ce: 05 c0 rjmp .+10 ; 0x159da } else { newK = la10c_value(newK); if (newK < 0) SERIAL_ECHOLNPGM("K out of allowed range!"); 159d0: 8c ed ldi r24, 0xDC ; 220 159d2: 98 e7 ldi r25, 0x78 ; 120 159d4: 0e 94 49 72 call 0xe492 ; 0xe492 159d8: da cf rjmp .-76 ; 0x1598e return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 159da: 20 e0 ldi r18, 0x00 ; 0 159dc: 30 e0 ldi r19, 0x00 ; 0 159de: 40 e2 ldi r20, 0x20 ; 32 159e0: 51 e4 ldi r21, 0x41 ; 65 159e2: c7 01 movw r24, r14 159e4: b6 01 movw r22, r12 159e6: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 159ea: 87 ff sbrs r24, 7 159ec: 2c c0 rjmp .+88 ; 0x15a46 159ee: 81 e0 ldi r24, 0x01 ; 1 159f0: 0e 94 de 73 call 0xe7bc ; 0xe7bc } if(la10c_mode == LA10C_LA15) 159f4: 80 91 45 03 lds r24, 0x0345 ; 0x800345 return (k >= 0 && k < LA_K_MAX? k: -1); 159f8: 20 e0 ldi r18, 0x00 ; 0 159fa: 30 e0 ldi r19, 0x00 ; 0 159fc: a9 01 movw r20, r18 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); } if(la10c_mode == LA10C_LA15) 159fe: 81 30 cpi r24, 0x01 ; 1 15a00: 21 f5 brne .+72 ; 0x15a4a return (k >= 0 && k < LA_K_MAX? k: -1); 15a02: c7 01 movw r24, r14 15a04: b6 01 movw r22, r12 15a06: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 15a0a: 87 fd sbrc r24, 7 15a0c: e1 cf rjmp .-62 ; 0x159d0 15a0e: 20 e0 ldi r18, 0x00 ; 0 15a10: 30 e0 ldi r19, 0x00 ; 0 15a12: 40 e2 ldi r20, 0x20 ; 32 15a14: 51 e4 ldi r21, 0x41 ; 65 15a16: c7 01 movw r24, r14 15a18: b6 01 movw r22, r12 15a1a: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 15a1e: 87 ff sbrs r24, 7 15a20: d7 cf rjmp .-82 ; 0x159d0 la10c_reset(); } else { newK = la10c_value(newK); if (newK < 0) 15a22: 20 e0 ldi r18, 0x00 ; 0 15a24: 30 e0 ldi r19, 0x00 ; 0 15a26: a9 01 movw r20, r18 15a28: c7 01 movw r24, r14 15a2a: b6 01 movw r22, r12 15a2c: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 15a30: 87 fd sbrc r24, 7 15a32: ce cf rjmp .-100 ; 0x159d0 SERIAL_ECHOLNPGM("K out of allowed range!"); else extruder_advance_K = newK; 15a34: c0 92 e1 16 sts 0x16E1, r12 ; 0x8016e1 15a38: d0 92 e2 16 sts 0x16E2, r13 ; 0x8016e2 15a3c: e0 92 e3 16 sts 0x16E3, r14 ; 0x8016e3 15a40: f0 92 e4 16 sts 0x16E4, r15 ; 0x8016e4 15a44: a4 cf rjmp .-184 ; 0x1598e if(k == 0) return 0; else if(k < 0) return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 15a46: 82 e0 ldi r24, 0x02 ; 2 15a48: d3 cf rjmp .-90 ; 0x159f0 } if(la10c_mode == LA10C_LA15) return (k >= 0 && k < LA_K_MAX? k: -1); else return (k >= 0? la10c_convert(k): -1); 15a4a: c7 01 movw r24, r14 15a4c: b6 01 movw r22, r12 15a4e: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 15a52: 87 fd sbrc r24, 7 15a54: bd cf rjmp .-134 ; 0x159d0 // Approximate a LA10 value to a LA15 equivalent. static float la10c_convert(float k) { float new_K = k * 0.002 - 0.01; 15a56: 2f e6 ldi r18, 0x6F ; 111 15a58: 32 e1 ldi r19, 0x12 ; 18 15a5a: 43 e0 ldi r20, 0x03 ; 3 15a5c: 5b e3 ldi r21, 0x3B ; 59 15a5e: c7 01 movw r24, r14 15a60: b6 01 movw r22, r12 15a62: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 15a66: 2a e0 ldi r18, 0x0A ; 10 15a68: 37 ed ldi r19, 0xD7 ; 215 15a6a: 43 e2 ldi r20, 0x23 ; 35 15a6c: 5c e3 ldi r21, 0x3C ; 60 15a6e: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 15a72: 6b 01 movw r12, r22 15a74: 7c 01 movw r14, r24 return new_K < 0? 0: 15a76: 20 e0 ldi r18, 0x00 ; 0 15a78: 30 e0 ldi r19, 0x00 ; 0 15a7a: a9 01 movw r20, r18 15a7c: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 15a80: 87 fd sbrc r24, 7 15a82: 11 c0 rjmp .+34 ; 0x15aa6 new_K > (LA_K_MAX - FLT_EPSILON)? (LA_K_MAX - FLT_EPSILON): 15a84: 20 e0 ldi r18, 0x00 ; 0 15a86: 30 e0 ldi r19, 0x00 ; 0 15a88: 40 e2 ldi r20, 0x20 ; 32 15a8a: 51 e4 ldi r21, 0x41 ; 65 15a8c: c7 01 movw r24, r14 15a8e: b6 01 movw r22, r12 15a90: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 15a94: 18 16 cp r1, r24 15a96: 2c f6 brge .-118 ; 0x15a22 15a98: c1 2c mov r12, r1 15a9a: d1 2c mov r13, r1 15a9c: 40 e2 ldi r20, 0x20 ; 32 15a9e: e4 2e mov r14, r20 15aa0: 41 e4 ldi r20, 0x41 ; 65 15aa2: f4 2e mov r15, r20 15aa4: c7 cf rjmp .-114 ; 0x15a34 // 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: 15aa6: c1 2c mov r12, r1 15aa8: d1 2c mov r13, r1 15aaa: 76 01 movw r14, r12 15aac: c3 cf rjmp .-122 ; 0x15a34 } } 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()); 15aae: 83 e5 ldi r24, 0x53 ; 83 15ab0: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15ab4: 88 23 and r24, r24 15ab6: 59 f0 breq .+22 ; 0x15ace 15ab8: 10 e0 ldi r17, 0x00 ; 0 15aba: 0e 94 03 5a call 0xb406 ; 0xb406 15abe: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 15ac2: 81 2f mov r24, r17 15ac4: 0f 94 04 22 call 0x24408 ; 0x24408 15ac8: 1f 5f subi r17, 0xFF ; 255 15aca: 15 30 cpi r17, 0x05 ; 5 15acc: b1 f7 brne .-20 ; 0x15aba 15ace: 34 ec ldi r19, 0xC4 ; 196 15ad0: e3 2e mov r14, r19 15ad2: 32 e0 ldi r19, 0x02 ; 2 15ad4: f3 2e mov r15, r19 15ad6: 10 e0 ldi r17, 0x00 ; 0 for(int i=0;i 15ae2: 88 23 and r24, r24 15ae4: 39 f0 breq .+14 ; 0x15af4 15ae6: 0e 94 03 5a call 0xb406 ; 0xb406 15aea: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 15aee: 81 2f mov r24, r17 15af0: 0f 94 04 22 call 0x24408 ; 0x24408 15af4: 1f 5f subi r17, 0xFF ; 255 15af6: 14 30 cpi r17, 0x04 ; 4 15af8: 79 f7 brne .-34 ; 0x15ad8 if(code_seen('B')) microstep_mode(4,code_value()); 15afa: 82 e4 ldi r24, 0x42 ; 66 15afc: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15b00: 88 23 and r24, r24 15b02: 39 f0 breq .+14 ; 0x15b12 15b04: 0e 94 03 5a call 0xb406 ; 0xb406 15b08: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 15b0c: 84 e0 ldi r24, 0x04 ; 4 15b0e: 0f 94 04 22 call 0x24408 ; 0x24408 microstep_readings(); 15b12: 0f 94 2a 21 call 0x24254 ; 0x24254 15b16: 0c 94 0f 98 jmp 0x1301e ; 0x1301e 15b1a: 24 ec ldi r18, 0xC4 ; 196 15b1c: e2 2e mov r14, r18 15b1e: 22 e0 ldi r18, 0x02 ; 2 15b20: 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()) 15b22: 10 e0 ldi r17, 0x00 ; 0 { case 1: for(int i=0;i 15b2e: 88 23 and r24, r24 15b30: 41 f0 breq .+16 ; 0x15b42 15b32: 0e 94 03 5a call 0xb406 ; 0xb406 15b36: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 15b3a: 4f ef ldi r20, 0xFF ; 255 15b3c: 81 2f mov r24, r17 15b3e: 0f 94 85 21 call 0x2430a ; 0x2430a 15b42: 1f 5f subi r17, 0xFF ; 255 15b44: 14 30 cpi r17, 0x04 ; 4 15b46: 71 f7 brne .-36 ; 0x15b24 if(code_seen('B')) microstep_ms(4,code_value(),-1); 15b48: 82 e4 ldi r24, 0x42 ; 66 15b4a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15b4e: 88 23 and r24, r24 15b50: 11 f4 brne .+4 ; 0x15b56 15b52: 0c 94 4c 96 jmp 0x12c98 ; 0x12c98 15b56: 0e 94 03 5a call 0xb406 ; 0xb406 15b5a: 0c 94 4c 96 jmp 0x12c98 ; 0x12c98 15b5e: 94 ec ldi r25, 0xC4 ; 196 15b60: e9 2e mov r14, r25 15b62: 92 e0 ldi r25, 0x02 ; 2 15b64: 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()) 15b66: 10 e0 ldi r17, 0x00 ; 0 case 1: for(int i=0;i 15b72: 88 23 and r24, r24 15b74: 49 f0 breq .+18 ; 0x15b88 15b76: 0e 94 03 5a call 0xb406 ; 0xb406 15b7a: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 15b7e: 46 2f mov r20, r22 15b80: 6f ef ldi r22, 0xFF ; 255 15b82: 81 2f mov r24, r17 15b84: 0f 94 85 21 call 0x2430a ; 0x2430a 15b88: 1f 5f subi r17, 0xFF ; 255 15b8a: 14 30 cpi r17, 0x04 ; 4 15b8c: 69 f7 brne .-38 ; 0x15b68 15b8e: dc cf rjmp .-72 ; 0x15b48 case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; if( MMU2::mmu2.Enabled() ) 15b90: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15b94: 81 30 cpi r24, 0x01 ; 1 15b96: c1 f1 breq .+112 ; 0x15c08 - `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; 15b98: 1f ef ldi r17, 0xFF ; 255 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 15b9a: 8c e4 ldi r24, 0x4C ; 76 15b9c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15ba0: 88 23 and r24, r24 15ba2: 09 f4 brne .+2 ; 0x15ba6 15ba4: 40 c0 rjmp .+128 ; 0x15c26 15ba6: 0e 94 03 5a call 0xb406 ; 0xb406 15baa: 6b 01 movw r12, r22 15bac: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 15bae: 8a e5 ldi r24, 0x5A ; 90 15bb0: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15bb4: 88 23 and r24, r24 15bb6: f1 f1 breq .+124 ; 0x15c34 15bb8: 0e 94 03 5a call 0xb406 ; 0xb406 15bbc: 9f 77 andi r25, 0x7F ; 127 // Raise the Z axis float delta = raise_z(z_target); 15bbe: 0e 94 d3 66 call 0xcda6 ; 0xcda6 15bc2: 4b 01 movw r8, r22 15bc4: 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 15bc6: 8a e5 ldi r24, 0x5A ; 90 15bc8: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15bcc: 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; 15bce: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 15bd2: 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); 15bd6: 86 e1 ldi r24, 0x16 ; 22 15bd8: 0f 94 be 98 call 0x3317c ; 0x3317c if (MMU2::mmu2.Enabled()) { 15bdc: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15be0: 81 30 cpi r24, 0x01 ; 1 15be2: 61 f5 brne .+88 ; 0x15c3c if (mmuSlotIndex < MMU_FILAMENT_COUNT) { 15be4: 15 30 cpi r17, 0x05 ; 5 15be6: 18 f4 brcc .+6 ; 0x15bee MMU2::mmu2.load_filament_to_nozzle(mmuSlotIndex); 15be8: 81 2f mov r24, r17 15bea: 0e 94 33 f7 call 0x1ee66 ; 0x1ee66 lcd_update(2); lcd_setstatuspgm(MSG_WELCOME); custom_message_type = CustomMsg::Status; } eFilamentAction = FilamentAction::None; 15bee: 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(); } 15bf2: 84 e8 ldi r24, 0x84 ; 132 15bf4: 96 e1 ldi r25, 0x16 ; 22 15bf6: 0e 94 e6 6d call 0xdbcc ; 0xdbcc // 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); 15bfa: c5 01 movw r24, r10 15bfc: b4 01 movw r22, r8 15bfe: 90 58 subi r25, 0x80 ; 128 15c00: 0e 94 d3 66 call 0xcda6 ; 0xcda6 15c04: 0c 94 0f 98 jmp 0x1301e ; 0x1301e 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') ) { 15c08: 80 e5 ldi r24, 0x50 ; 80 15c0a: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15c0e: 88 23 and r24, r24 15c10: 21 f0 breq .+8 ; 0x15c1a mmuSlotIndex = code_value_uint8(); 15c12: 0e 94 40 55 call 0xaa80 ; 0xaa80 15c16: 18 2f mov r17, r24 15c18: c0 cf rjmp .-128 ; 0x15b9a 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') ) { 15c1a: 84 e5 ldi r24, 0x54 ; 84 15c1c: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15c20: 81 11 cpse r24, r1 15c22: f7 cf rjmp .-18 ; 0x15c12 15c24: b9 cf rjmp .-142 ; 0x15b98 - `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 15c26: c1 2c mov r12, r1 15c28: d1 2c mov r13, r1 15c2a: 8c e8 ldi r24, 0x8C ; 140 15c2c: e8 2e mov r14, r24 15c2e: 82 e4 ldi r24, 0x42 ; 66 15c30: f8 2e mov r15, r24 15c32: bd cf rjmp .-134 ; 0x15bae float z_target = 0; 15c34: 60 e0 ldi r22, 0x00 ; 0 15c36: 70 e0 ldi r23, 0x00 ; 0 15c38: cb 01 movw r24, r22 15c3a: c1 cf rjmp .-126 ; 0x15bbe 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; 15c3c: 82 e0 ldi r24, 0x02 ; 2 15c3e: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT)); 15c42: 82 e0 ldi r24, 0x02 ; 2 15c44: 9a e5 ldi r25, 0x5A ; 90 15c46: 0e 94 a7 6c call 0xd94e ; 0xd94e 15c4a: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 current_position[E_AXIS] += fastLoadLength; 15c4e: a7 01 movw r20, r14 15c50: 96 01 movw r18, r12 15c52: 60 91 01 12 lds r22, 0x1201 ; 0x801201 15c56: 70 91 02 12 lds r23, 0x1202 ; 0x801202 15c5a: 80 91 03 12 lds r24, 0x1203 ; 0x801203 15c5e: 90 91 04 12 lds r25, 0x1204 ; 0x801204 15c62: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 15c66: 60 93 01 12 sts 0x1201, r22 ; 0x801201 15c6a: 70 93 02 12 sts 0x1202, r23 ; 0x801202 15c6e: 80 93 03 12 sts 0x1203, r24 ; 0x801203 15c72: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); //fast sequence 15c76: 60 e0 ldi r22, 0x00 ; 0 15c78: 70 e0 ldi r23, 0x00 ; 0 15c7a: 80 ea ldi r24, 0xA0 ; 160 15c7c: 91 e4 ldi r25, 0x41 ; 65 15c7e: 0f 94 2f 85 call 0x30a5e ; 0x30a5e if (raise_z_axis) { // backwards compatibility for 3.12 and older FW 15c82: 01 11 cpse r16, r1 15c84: 06 c0 rjmp .+12 ; 0x15c92 raise_z_above(MIN_Z_FOR_LOAD); 15c86: 60 e0 ldi r22, 0x00 ; 0 15c88: 70 e0 ldi r23, 0x00 ; 0 15c8a: 8c e0 ldi r24, 0x0C ; 12 15c8c: 92 e4 ldi r25, 0x42 ; 66 15c8e: 0e 94 35 67 call 0xce6a ; 0xce6a } load_filament_final_feed(); // slow sequence 15c92: 0e 94 6b 5e call 0xbcd6 ; 0xbcd6 st_synchronize(); 15c96: 0f 94 ce 22 call 0x2459c ; 0x2459c Sound_MakeCustom(50, 500, false); 15c9a: 40 e0 ldi r20, 0x00 ; 0 15c9c: 64 ef ldi r22, 0xF4 ; 244 15c9e: 71 e0 ldi r23, 0x01 ; 1 15ca0: 82 e3 ldi r24, 0x32 ; 50 15ca2: 90 e0 ldi r25, 0x00 ; 0 15ca4: 0f 94 6f 32 call 0x264de ; 0x264de if (!farm_mode && (eFilamentAction != FilamentAction::None)) { 15ca8: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 15cac: 81 11 cpse r24, r1 15cae: 05 c0 rjmp .+10 ; 0x15cba 15cb0: 80 91 62 03 lds r24, 0x0362 ; 0x800362 15cb4: 81 11 cpse r24, r1 lcd_load_filament_color_check(); 15cb6: 0f 94 7c 30 call 0x260f8 ; 0x260f8 #ifdef COMMUNITY_PREVENT_OOZE // Retract filament to prevent oozing retract_for_ooze_prevention(); #endif //COMMUNITY_PREVENT_OOZE lcd_update_enable(true); 15cba: 81 e0 ldi r24, 0x01 ; 1 15cbc: 0e 94 b6 69 call 0xd36c ; 0xd36c lcd_update(2); 15cc0: 82 e0 ldi r24, 0x02 ; 2 15cc2: 0e 94 38 69 call 0xd270 ; 0xd270 lcd_setstatuspgm(MSG_WELCOME); 15cc6: 87 e6 ldi r24, 0x67 ; 103 15cc8: 9b e6 ldi r25, 0x6B ; 107 15cca: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 custom_message_type = CustomMsg::Status; 15cce: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 15cd2: 8d cf rjmp .-230 ; 0x15bee */ case 702: { float z_target = 0; float unloadLength = FILAMENTCHANGE_FINALRETRACT; if (code_seen('U')) unloadLength = code_value(); 15cd4: 85 e5 ldi r24, 0x55 ; 85 15cd6: 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; 15cda: c1 2c mov r12, r1 15cdc: d1 2c mov r13, r1 15cde: 76 01 movw r14, r12 if (code_seen('U')) unloadLength = code_value(); 15ce0: 88 23 and r24, r24 15ce2: 21 f0 breq .+8 ; 0x15cec 15ce4: 0e 94 03 5a call 0xb406 ; 0xb406 15ce8: 6b 01 movw r12, r22 15cea: 7c 01 movw r14, r24 // For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 15cec: 8a e5 ldi r24, 0x5A ; 90 15cee: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15cf2: 88 23 and r24, r24 15cf4: a1 f0 breq .+40 ; 0x15d1e 15cf6: 0e 94 03 5a call 0xb406 ; 0xb406 15cfa: 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); 15cfc: 0e 94 d3 66 call 0xcda6 ; 0xcda6 15d00: 4b 01 movw r8, r22 15d02: 5c 01 movw r10, r24 // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); 15d04: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15d08: 81 30 cpi r24, 0x01 ; 1 15d0a: 99 f4 brne .+38 ; 0x15d32 15d0c: 0f 94 52 6b call 0x2d6a4 ; 0x2d6a4 else unload_filament(unloadLength); // Restore Z axis raise_z(-delta); 15d10: c5 01 movw r24, r10 15d12: b4 01 movw r22, r8 15d14: 90 58 subi r25, 0x80 ; 128 15d16: 0e 94 d3 66 call 0xcda6 ; 0xcda6 15d1a: 0c 94 0f 98 jmp 0x1301e ; 0x1301e 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 15d1e: 60 e0 ldi r22, 0x00 ; 0 15d20: 70 e0 ldi r23, 0x00 ; 0 15d22: 8c e0 ldi r24, 0x0C ; 12 15d24: 92 e4 ldi r25, 0x42 ; 66 15d26: 0e 94 35 67 call 0xce6a ; 0xce6a - `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; 15d2a: 60 e0 ldi r22, 0x00 ; 0 15d2c: 70 e0 ldi r23, 0x00 ; 0 15d2e: cb 01 movw r24, r22 15d30: e5 cf rjmp .-54 ; 0x15cfc // Raise the Z axis float delta = raise_z(z_target); // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); else unload_filament(unloadLength); 15d32: c7 01 movw r24, r14 15d34: b6 01 movw r22, r12 15d36: 0e 94 86 f0 call 0x1e10c ; 0x1e10c 15d3a: ea cf rjmp .-44 ; 0x15d10 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 704: { gcodes_M704_M705_M706(704); 15d3c: 80 ec ldi r24, 0xC0 ; 192 15d3e: 92 e0 ldi r25, 0x02 ; 2 15d40: 0e 94 c9 59 call 0xb392 ; 0xb392 15d44: 0c 94 0f 98 jmp 0x1301e ; 0x1301e #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 705: { gcodes_M704_M705_M706(705); 15d48: 81 ec ldi r24, 0xC1 ; 193 15d4a: 92 e0 ldi r25, 0x02 ; 2 15d4c: 0e 94 c9 59 call 0xb392 ; 0xb392 15d50: 0c 94 0f 98 jmp 0x1301e ; 0x1301e 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() ) { 15d54: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15d58: 81 30 cpi r24, 0x01 ; 1 15d5a: 11 f0 breq .+4 ; 0x15d60 15d5c: 0c 94 0f 98 jmp 0x1301e ; 0x1301e if( code_seen('A') ) { 15d60: 81 e4 ldi r24, 0x41 ; 65 15d62: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15d66: 88 23 and r24, r24 15d68: 11 f4 brne .+4 ; 0x15d6e 15d6a: 0c 94 0f 98 jmp 0x1301e ; 0x1301e MMU2::mmu2.ReadRegister(uint8_t(strtol(strchr_pointer+1, NULL, 16))); 15d6e: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 15d72: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 15d76: 40 e1 ldi r20, 0x10 ; 16 15d78: 50 e0 ldi r21, 0x00 ; 0 15d7a: 70 e0 ldi r23, 0x00 ; 0 15d7c: 60 e0 ldi r22, 0x00 ; 0 15d7e: 01 96 adiw r24, 0x01 ; 1 15d80: 0f 94 26 9c call 0x3384c ; 0x3384c 15d84: 86 2f mov r24, r22 15d86: 0e 94 b7 f7 call 0x1ef6e ; 0x1ef6e 15d8a: 0c 94 0f 98 jmp 0x1301e ; 0x1301e 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() ){ 15d8e: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15d92: 81 30 cpi r24, 0x01 ; 1 15d94: 11 f0 breq .+4 ; 0x15d9a 15d96: 0c 94 0f 98 jmp 0x1301e ; 0x1301e uint8_t addr = 0; if( code_seen('A') ) { 15d9a: 81 e4 ldi r24, 0x41 ; 65 15d9c: 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; 15da0: 10 e0 ldi r17, 0x00 ; 0 if( code_seen('A') ) { 15da2: 88 23 and r24, r24 15da4: 61 f0 breq .+24 ; 0x15dbe addr = uint8_t(strtol(strchr_pointer+1, NULL, 16)); 15da6: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 15daa: 90 91 f6 16 lds r25, 0x16F6 ; 0x8016f6 15dae: 40 e1 ldi r20, 0x10 ; 16 15db0: 50 e0 ldi r21, 0x00 ; 0 15db2: 70 e0 ldi r23, 0x00 ; 0 15db4: 60 e0 ldi r22, 0x00 ; 0 15db6: 01 96 adiw r24, 0x01 ; 1 15db8: 0f 94 26 9c call 0x3384c ; 0x3384c 15dbc: 16 2f mov r17, r22 } uint16_t data = 0; if( code_seen('X') ) { 15dbe: 88 e5 ldi r24, 0x58 ; 88 15dc0: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15dc4: 88 23 and r24, r24 15dc6: 61 f0 breq .+24 ; 0x15de0 data = code_value_short(); 15dc8: 0e 94 4d 55 call 0xaa9a ; 0xaa9a } if(addr){ 15dcc: 11 23 and r17, r17 15dce: 11 f4 brne .+4 ; 0x15dd4 15dd0: 0c 94 0f 98 jmp 0x1301e ; 0x1301e MMU2::mmu2.WriteRegister(addr, data); 15dd4: bc 01 movw r22, r24 15dd6: 81 2f mov r24, r17 15dd8: 0e 94 9c bf call 0x17f38 ; 0x17f38 15ddc: 0c 94 0f 98 jmp 0x1301e ; 0x1301e 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; 15de0: 90 e0 ldi r25, 0x00 ; 0 15de2: 80 e0 ldi r24, 0x00 ; 0 15de4: f3 cf rjmp .-26 ; 0x15dcc M709 - Serial message if en- or disabled */ case 709: { if (code_seen('S')) 15de6: 83 e5 ldi r24, 0x53 ; 83 15de8: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15dec: 88 23 and r24, r24 15dee: 31 f0 breq .+12 ; 0x15dfc { switch (code_value_uint8()) 15df0: 0e 94 40 55 call 0xaa80 ; 0xaa80 15df4: 88 23 and r24, r24 15df6: a9 f0 breq .+42 ; 0x15e22 15df8: 81 30 cpi r24, 0x01 ; 1 15dfa: f9 f0 breq .+62 ; 0x15e3a break; default: break; } } if (MMU2::mmu2.Enabled() && code_seen('X')) 15dfc: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15e00: 81 30 cpi r24, 0x01 ; 1 15e02: 59 f4 brne .+22 ; 0x15e1a 15e04: 88 e5 ldi r24, 0x58 ; 88 15e06: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15e0a: 88 23 and r24, r24 15e0c: 31 f0 breq .+12 ; 0x15e1a { switch (code_value_uint8()) 15e0e: 0e 94 40 55 call 0xaa80 ; 0xaa80 15e12: 82 30 cpi r24, 0x02 ; 2 15e14: d0 f0 brcs .+52 ; 0x15e4a 15e16: 8a 32 cpi r24, 0x2A ; 42 15e18: e1 f0 breq .+56 ; 0x15e52 break; default: break; } } MMU2::mmu2.Status(); 15e1a: 0f 94 50 42 call 0x284a0 ; 0x284a0 15e1e: 0c 94 0f 98 jmp 0x1301e ; 0x1301e if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 15e22: 60 e0 ldi r22, 0x00 ; 0 15e24: 8c ea ldi r24, 0xAC ; 172 15e26: 9c e0 ldi r25, 0x0C ; 12 15e28: 0f 94 bf a0 call 0x3417e ; 0x3417e StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 15e2c: 10 92 94 12 sts 0x1294, r1 ; 0x801294 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 15e30: 10 92 42 12 sts 0x1242, r1 ; 0x801242 currentScope = Scope::Stopped; 15e34: 10 92 27 12 sts 0x1227, r1 ; 0x801227 15e38: e1 cf rjmp .-62 ; 0x15dfc 15e3a: 61 e0 ldi r22, 0x01 ; 1 15e3c: 8c ea ldi r24, 0xAC ; 172 15e3e: 9c e0 ldi r25, 0x0C ; 12 15e40: 0f 94 bf a0 call 0x3417e ; 0x3417e 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(); 15e44: 0f 94 59 63 call 0x2c6b2 ; 0x2c6b2 15e48: d9 cf rjmp .-78 ; 0x15dfc break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 15e4a: 80 e0 ldi r24, 0x00 ; 0 } void MMU2::ResetX42() { logic.ResetMMU(42); 15e4c: 0f 94 1c 63 call 0x2c638 ; 0x2c638 15e50: e4 cf rjmp .-56 ; 0x15e1a 15e52: 8a e2 ldi r24, 0x2A ; 42 15e54: fb cf rjmp .-10 ; 0x15e4c 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') { 15e56: 84 35 cpi r24, 0x54 ; 84 15e58: 09 f0 breq .+2 ; 0x15e5c 15e5a: 79 c0 rjmp .+242 ; 0x15f4e strchr_pointer = CMDBUFFER_CURRENT_STRING; 15e5c: 10 93 f6 16 sts 0x16F6, r17 ; 0x8016f6 15e60: 00 93 f5 16 sts 0x16F5, r16 ; 0x8016f5 processing_tcode = true; 15e64: 81 e0 ldi r24, 0x01 ; 1 15e66: 80 93 5f 03 sts 0x035F, r24 ; 0x80035f TCodes(strchr_pointer, code_value_uint8()); 15e6a: 0e 94 40 55 call 0xaa80 ; 0xaa80 15e6e: 18 2f mov r17, r24 15e70: 20 91 f5 16 lds r18, 0x16F5 ; 0x8016f5 15e74: 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; 15e78: 91 e0 ldi r25, 0x01 ; 1 for ( /*nothing*/ ; strchr_pointer[index] == ' ' || strchr_pointer[index] == '\t'; index++) 15e7a: 79 01 movw r14, r18 15e7c: e9 0e add r14, r25 15e7e: f1 1c adc r15, r1 15e80: d7 01 movw r26, r14 15e82: 8c 91 ld r24, X 15e84: 80 32 cpi r24, 0x20 ; 32 15e86: 11 f0 breq .+4 ; 0x15e8c 15e88: 89 30 cpi r24, 0x09 ; 9 15e8a: 11 f4 brne .+4 ; 0x15e90 15e8c: 9f 5f subi r25, 0xFF ; 255 15e8e: f5 cf rjmp .-22 ; 0x15e7a ; strchr_pointer[index] = tolower(strchr_pointer[index]); 15e90: 08 2e mov r0, r24 15e92: 00 0c add r0, r0 15e94: 99 0b sbc r25, r25 15e96: 0f 94 af a6 call 0x34d5e ; 0x34d5e 15e9a: f7 01 movw r30, r14 15e9c: 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'); 15e9e: 90 ed ldi r25, 0xD0 ; 208 15ea0: 98 0f add r25, r24 15ea2: 95 30 cpi r25, 0x05 ; 5 15ea4: 58 f0 brcs .+22 ; 0x15ebc 15ea6: 8f 33 cpi r24, 0x3F ; 63 15ea8: 69 f0 breq .+26 ; 0x15ec4 15eaa: 88 37 cpi r24, 0x78 ; 120 15eac: 59 f0 breq .+22 ; 0x15ec4 15eae: 83 36 cpi r24, 0x63 ; 99 15eb0: 01 f1 breq .+64 ; 0x15ef2 } inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); 15eb2: 87 ea ldi r24, 0xA7 ; 167 15eb4: 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 15eb6: 0e 94 49 72 call 0xe492 ; 0xe492 15eba: 15 c0 rjmp .+42 ; 0x15ee6 15ebc: 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] == '?'){ 15ec0: 8f 33 cpi r24, 0x3F ; 63 15ec2: a9 f4 brne .+42 ; 0x15eee // load to extruder gears; if mmu is not present do nothing if (MMU2::mmu2.Enabled()) { 15ec4: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15ec8: 81 30 cpi r24, 0x01 ; 1 15eca: 69 f4 brne .+26 ; 0x15ee6 MMU2::mmu2.tool_change(strchr_pointer[index], choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT)); 15ecc: 84 e2 ldi r24, 0x24 ; 36 15ece: 9e e3 ldi r25, 0x3E ; 62 15ed0: 0e 94 a7 6c call 0xd94e ; 0xd94e 15ed4: 70 e0 ldi r23, 0x00 ; 0 15ed6: 60 e0 ldi r22, 0x00 ; 0 15ed8: 0e 94 e7 bc call 0x179ce ; 0x179ce 15edc: 68 2f mov r22, r24 15ede: d7 01 movw r26, r14 15ee0: 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()); 15ee2: 0e 94 6c f7 call 0x1eed8 ; 0x1eed8 processing_tcode = false; 15ee6: 10 92 5f 03 sts 0x035F, r1 ; 0x80035f 15eea: 0c 94 34 84 jmp 0x10868 ; 0x10868 } 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'){ 15eee: 83 36 cpi r24, 0x63 ; 99 15ef0: 49 f4 brne .+18 ; 0x15f04 // load from extruder gears to nozzle (nozzle should be preheated) if (MMU2::mmu2.Enabled()) { 15ef2: 80 91 94 12 lds r24, 0x1294 ; 0x801294 15ef6: 81 30 cpi r24, 0x01 ; 1 15ef8: b1 f7 brne .-20 ; 0x15ee6 MMU2::mmu2.tool_change(strchr_pointer[index], MMU2::mmu2.get_current_tool()); 15efa: 0f 94 4a 42 call 0x28494 ; 0x28494 15efe: 68 2f mov r22, r24 15f00: 83 e6 ldi r24, 0x63 ; 99 15f02: ef cf rjmp .-34 ; 0x15ee2 } } else { // Process T0 ... T4 if (MMU2::mmu2.Enabled()) { 15f04: 91 30 cpi r25, 0x01 ; 1 15f06: 69 f4 brne .+26 ; 0x15f22 if (codeValue == MMU2::mmu2.get_current_tool()){ 15f08: 0f 94 4a 42 call 0x28494 ; 0x28494 15f0c: 18 13 cpse r17, r24 15f0e: 05 c0 rjmp .+10 ; 0x15f1a // don't execute the same T-code twice in a row puts_P(duplicate_Tcode_ignored); 15f10: 87 eb ldi r24, 0xB7 ; 183 15f12: 98 e7 ldi r25, 0x78 ; 120 15f14: 0f 94 84 9f call 0x33f08 ; 0x33f08 15f18: e6 cf rjmp .-52 ; 0x15ee6 #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); 15f1a: 81 2f mov r24, r17 15f1c: 0e 94 04 f4 call 0x1e808 ; 0x1e808 15f20: e2 cf rjmp .-60 ; 0x15ee6 } } else { SERIAL_ECHO_START; 15f22: 81 e6 ldi r24, 0x61 ; 97 15f24: 9d e9 ldi r25, 0x9D ; 157 15f26: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 if (codeValue >= EXTRUDERS) { 15f2a: 11 23 and r17, r17 15f2c: 59 f0 breq .+22 ; 0x15f44 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15f2e: 84 e5 ldi r24, 0x54 ; 84 15f30: 0e 94 37 70 call 0xe06e ; 0xe06e SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); 15f34: 81 2f mov r24, r17 15f36: 90 e0 ldi r25, 0x00 ; 0 15f38: c0 96 adiw r24, 0x30 ; 48 15f3a: 0f 94 62 42 call 0x284c4 ; 0x284c4 SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 15f3e: 86 ec ldi r24, 0xC6 ; 198 15f40: 94 e6 ldi r25, 0x64 ; 100 15f42: b9 cf rjmp .-142 ; 0x15eb6 // next_feedrate = code_value(); // if (next_feedrate > 0.0) { // feedrate = next_feedrate; // } // } SERIAL_ECHORPGM(_n("Active Extruder: 0")); ////MSG_ACTIVE_EXTRUDER 15f44: 83 eb ldi r24, 0xB3 ; 179 15f46: 94 e6 ldi r25, 0x64 ; 100 15f48: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 15f4c: cc cf rjmp .-104 ; 0x15ee6 /** *--------------------------------------------------------------------------------- *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) 15f4e: 84 34 cpi r24, 0x44 ; 68 15f50: 09 f0 breq .+2 ; 0x15f54 15f52: 5d c0 rjmp .+186 ; 0x1600e { strchr_pointer = CMDBUFFER_CURRENT_STRING; 15f54: 10 93 f6 16 sts 0x16F6, r17 ; 0x8016f6 15f58: 00 93 f5 16 sts 0x16F5, r16 ; 0x8016f5 switch(code_value_short()) 15f5c: 0e 94 4d 55 call 0xaa9a ; 0xaa9a 15f60: 82 30 cpi r24, 0x02 ; 2 15f62: 91 05 cpc r25, r1 15f64: 41 f1 breq .+80 ; 0x15fb6 15f66: 8c f4 brge .+34 ; 0x15f8a 15f68: 01 96 adiw r24, 0x01 ; 1 15f6a: e1 f0 breq .+56 ; 0x15fa4 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 15f6c: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 15f70: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 15f74: 8f 51 subi r24, 0x1F ; 31 15f76: 90 4f sbci r25, 0xF0 ; 240 15f78: 9f 93 push r25 15f7a: 8f 93 push r24 15f7c: 1f 92 push r1 15f7e: 84 e4 ldi r24, 0x44 ; 68 15f80: 8f 93 push r24 15f82: 88 e4 ldi r24, 0x48 ; 72 15f84: 96 e6 ldi r25, 0x66 ; 102 15f86: 0c 94 89 84 jmp 0x10912 ; 0x10912 *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) { strchr_pointer = CMDBUFFER_CURRENT_STRING; switch(code_value_short()) 15f8a: 83 30 cpi r24, 0x03 ; 3 15f8c: 91 05 cpc r25, r1 15f8e: f9 f0 breq .+62 ; 0x15fce 15f90: 47 97 sbiw r24, 0x17 ; 23 15f92: 61 f7 brne .-40 ; 0x15f6c bool emergency_serial_dump = false; void dcode_23() { if(code_seen('E')) 15f94: 85 e4 ldi r24, 0x45 ; 69 15f96: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15f9a: 88 23 and r24, r24 15f9c: 09 f1 breq .+66 ; 0x15fe0 serial_dump_and_reset(dump_crash_reason::manual); 15f9e: 80 e0 ldi r24, 0x00 ; 0 15fa0: 0e 94 53 74 call 0xe8a6 ; 0xe8a6 * */ void dcode__1() { DBG(_N("D-1 - Endless loop\n")); 15fa4: 8f e9 ldi r24, 0x9F ; 159 15fa6: 94 e6 ldi r25, 0x64 ; 100 15fa8: 9f 93 push r25 15faa: 8f 93 push r24 15fac: 0f 94 5d 9f call 0x33eba ; 0x33eba 15fb0: 0f 90 pop r0 15fb2: 0f 90 pop r0 15fb4: ff cf rjmp .-2 ; 0x15fb4 - The hex data needs to be lowercase */ void dcode_2() { dcode_core(RAMSTART, RAMEND+1, dcode_mem_t::sram, 2, _N("SRAM")); 15fb6: 0a e9 ldi r16, 0x9A ; 154 15fb8: 14 e6 ldi r17, 0x64 ; 100 15fba: 22 e0 ldi r18, 0x02 ; 2 15fbc: 40 e0 ldi r20, 0x00 ; 0 15fbe: 60 e0 ldi r22, 0x00 ; 0 15fc0: 72 e2 ldi r23, 0x22 ; 34 15fc2: 80 e0 ldi r24, 0x00 ; 0 15fc4: 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")); 15fc6: 0e 94 3a 5d call 0xba74 ; 0xba74 15fca: 0c 94 34 84 jmp 0x10868 ; 0x10868 15fce: 03 e9 ldi r16, 0x93 ; 147 15fd0: 14 e6 ldi r17, 0x64 ; 100 15fd2: 23 e0 ldi r18, 0x03 ; 3 15fd4: 41 e0 ldi r20, 0x01 ; 1 15fd6: 60 e0 ldi r22, 0x00 ; 0 15fd8: 70 e1 ldi r23, 0x10 ; 16 15fda: 90 e0 ldi r25, 0x00 ; 0 15fdc: 80 e0 ldi r24, 0x00 ; 0 15fde: f3 cf rjmp .-26 ; 0x15fc6 { if(code_seen('E')) serial_dump_and_reset(dump_crash_reason::manual); else { emergency_serial_dump = !code_seen('R'); 15fe0: 82 e5 ldi r24, 0x52 ; 82 15fe2: 0e 94 2b 55 call 0xaa56 ; 0xaa56 15fe6: 91 e0 ldi r25, 0x01 ; 1 15fe8: 89 27 eor r24, r25 15fea: 80 93 7c 06 sts 0x067C, r24 ; 0x80067c SERIAL_ECHOPGM("serial dump "); 15fee: 8a e9 ldi r24, 0x9A ; 154 15ff0: 98 e7 ldi r25, 0x78 ; 120 15ff2: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLNRPGM(emergency_serial_dump? _N("enabled"): _N("disabled")); 15ff6: 80 91 7c 06 lds r24, 0x067C ; 0x80067c 15ffa: 88 23 and r24, r24 15ffc: 21 f0 breq .+8 ; 0x16006 15ffe: 8b e8 ldi r24, 0x8B ; 139 16000: 94 e6 ldi r25, 0x64 ; 100 16002: 0c 94 f0 84 jmp 0x109e0 ; 0x109e0 16006: 82 e8 ldi r24, 0x82 ; 130 16008: 94 e6 ldi r25, 0x64 ; 100 1600a: 0c 94 f0 84 jmp 0x109e0 ; 0x109e0 } } else { SERIAL_ECHO_START; 1600e: 81 e6 ldi r24, 0x61 ; 97 16010: 9d e9 ldi r25, 0x9D ; 157 16012: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 16016: 85 ef ldi r24, 0xF5 ; 245 16018: 94 e6 ldi r25, 0x64 ; 100 1601a: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 1601e: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 16022: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 16026: 8f 51 subi r24, 0x1F ; 31 16028: 90 4f sbci r25, 0xF0 ; 240 1602a: 0e 94 a0 7c call 0xf940 ; 0xf940 SERIAL_ECHOLNPGM("\"(2)"); 1602e: 82 e3 ldi r24, 0x32 ; 50 16030: 9e e7 ldi r25, 0x7E ; 126 16032: 0c 94 f0 84 jmp 0x109e0 ; 0x109e0 #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 16036: 2d ec ldi r18, 0xCD ; 205 16038: 3c ec ldi r19, 0xCC ; 204 1603a: 4c ec ldi r20, 0xCC ; 204 1603c: 5d e3 ldi r21, 0x3D ; 61 1603e: c7 01 movw r24, r14 16040: b6 01 movw r22, r12 16042: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 16046: 18 16 cp r1, r24 16048: 14 f4 brge .+4 ; 0x1604e 1604a: 0c 94 58 86 jmp 0x10cb0 ; 0x10cb0 1604e: 0c 94 68 87 jmp 0x10ed0 ; 0x10ed0 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; 16052: a3 01 movw r20, r6 16054: 92 01 movw r18, r4 16056: 62 2d mov r22, r2 16058: 73 2d mov r23, r3 1605a: 8e 2d mov r24, r14 1605c: 9f 2d mov r25, r15 1605e: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 16062: 18 16 cp r1, r24 16064: 14 f0 brlt .+4 ; 0x1606a 16066: 0c 94 da 8e jmp 0x11db4 ; 0x11db4 1606a: e5 e0 ldi r30, 0x05 ; 5 1606c: ce 0e add r12, r30 1606e: d1 1c adc r13, r1 16070: f2 e0 ldi r31, 0x02 ; 2 16072: 8f 0e add r8, r31 16074: 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; 16076: 85 01 movw r16, r10 16078: 0c 94 a1 8e jmp 0x11d42 ; 0x11d42 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)); 1607c: 81 e2 ldi r24, 0x21 ; 33 1607e: 99 e3 ldi r25, 0x39 ; 57 16080: 0e 94 a7 6c call 0xd94e ; 0xd94e 16084: 0f 94 22 0b call 0x21644 ; 0x21644 lcd_puts_at_P(0, 2, PSTR("")); 16088: 4c ec ldi r20, 0xCC ; 204 1608a: 5d e7 ldi r21, 0x7D ; 125 1608c: 62 e0 ldi r22, 0x02 ; 2 1608e: 80 e0 ldi r24, 0x00 ; 0 16090: 0e 94 85 69 call 0xd30a ; 0xd30a for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c) 16094: f8 01 movw r30, r16 16096: 81 91 ld r24, Z+ 16098: 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'; 1609a: 98 2f mov r25, r24 1609c: 9f 7d andi r25, 0xDF ; 223 1609e: 11 f4 brne .+4 ; 0x160a4 160a0: 0c 94 09 9e jmp 0x13c12 ; 0x13c12 160a4: 97 ef ldi r25, 0xF7 ; 247 160a6: 98 0f add r25, r24 160a8: 92 30 cpi r25, 0x02 ; 2 160aa: 10 f4 brcc .+4 ; 0x160b0 160ac: 0c 94 09 9e jmp 0x13c12 ; 0x13c12 160b0: 8d 30 cpi r24, 0x0D ; 13 160b2: 11 f4 brne .+4 ; 0x160b8 160b4: 0c 94 09 9e jmp 0x13c12 ; 0x13c12 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); 160b8: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 160bc: eb cf rjmp .-42 ; 0x16094 000160be : uint8_t check_pinda_0() { return _PINDA?0:1; } 160be: 80 91 bd 03 lds r24, 0x03BD ; 0x8003bd 160c2: 90 91 be 03 lds r25, 0x03BE ; 0x8003be 160c6: 08 95 ret 000160c8 : 160c8: 22 e0 ldi r18, 0x02 ; 2 160ca: 20 93 c0 00 sts 0x00C0, r18 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 160ce: 10 92 c5 00 sts 0x00C5, r1 ; 0x8000c5 <__TEXT_REGION_LENGTH__+0x7c20c5> 160d2: 90 e1 ldi r25, 0x10 ; 16 160d4: 90 93 c4 00 sts 0x00C4, r25 ; 0x8000c4 <__TEXT_REGION_LENGTH__+0x7c20c4> 160d8: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160dc: 80 61 ori r24, 0x10 ; 16 160de: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160e2: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160e6: 88 60 ori r24, 0x08 ; 8 160e8: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160ec: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160f0: 80 68 ori r24, 0x80 ; 128 160f2: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 160f6: 80 91 04 05 lds r24, 0x0504 ; 0x800504 160fa: 81 30 cpi r24, 0x01 ; 1 160fc: a9 f4 brne .+42 ; 0x16128 160fe: 20 93 c8 00 sts 0x00C8, r18 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> 16102: 10 92 cd 00 sts 0x00CD, r1 ; 0x8000cd <__TEXT_REGION_LENGTH__+0x7c20cd> 16106: 90 93 cc 00 sts 0x00CC, r25 ; 0x8000cc <__TEXT_REGION_LENGTH__+0x7c20cc> 1610a: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1610e: 80 61 ori r24, 0x10 ; 16 16110: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 16114: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 16118: 88 60 ori r24, 0x08 ; 8 1611a: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1611e: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 16122: 80 68 ori r24, 0x80 ; 128 16124: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 16128: 08 95 ret 0001612a : 1612a: 81 50 subi r24, 0x01 ; 1 1612c: 82 31 cpi r24, 0x12 ; 18 1612e: 08 f0 brcs .+2 ; 0x16132 16130: 5a c0 rjmp .+180 ; 0x161e6 16132: e8 2f mov r30, r24 16134: f0 e0 ldi r31, 0x00 ; 0 16136: 88 27 eor r24, r24 16138: ef 55 subi r30, 0x5F ; 95 1613a: ff 44 sbci r31, 0x4F ; 79 1613c: 8f 4f sbci r24, 0xFF ; 255 1613e: 0d 94 ab a1 jmp 0x34356 ; 0x34356 <__tablejump2__> 16142: c1 b0 in r12, 0x01 ; 1 16144: c5 b0 in r12, 0x05 ; 5 16146: b3 b0 in r11, 0x03 ; 3 16148: b9 b0 in r11, 0x09 ; 9 1614a: bd b0 in r11, 0x0d ; 13 1614c: f3 b0 in r15, 0x03 ; 3 1614e: c8 b0 in r12, 0x08 ; 8 16150: ce b0 in r12, 0x0e ; 14 16152: d2 b0 in r13, 0x02 ; 2 16154: d8 b0 in r13, 0x08 ; 8 16156: dc b0 in r13, 0x0c ; 12 16158: e0 b0 in r14, 0x00 ; 0 1615a: e6 b0 in r14, 0x06 ; 6 1615c: ea b0 in r14, 0x0a ; 10 1615e: f3 b0 in r15, 0x03 ; 3 16160: ee b0 in r14, 0x0e ; 14 16162: f4 b0 in r15, 0x04 ; 4 16164: f8 b0 in r15, 0x08 ; 8 16166: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1616a: 8f 77 andi r24, 0x7F ; 127 1616c: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 16170: 08 95 ret 16172: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 16176: 8f 7d andi r24, 0xDF ; 223 16178: f9 cf rjmp .-14 ; 0x1616c 1617a: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1617e: 87 7f andi r24, 0xF7 ; 247 16180: f5 cf rjmp .-22 ; 0x1616c 16182: 84 b5 in r24, 0x24 ; 36 16184: 8f 77 andi r24, 0x7F ; 127 16186: 84 bd out 0x24, r24 ; 36 16188: 08 95 ret 1618a: 84 b5 in r24, 0x24 ; 36 1618c: 8f 7d andi r24, 0xDF ; 223 1618e: fb cf rjmp .-10 ; 0x16186 16190: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 16194: 8f 77 andi r24, 0x7F ; 127 16196: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1619a: 08 95 ret 1619c: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 161a0: 8f 7d andi r24, 0xDF ; 223 161a2: f9 cf rjmp .-14 ; 0x16196 161a4: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 161a8: 8f 77 andi r24, 0x7F ; 127 161aa: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 161ae: 08 95 ret 161b0: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 161b4: 8f 7d andi r24, 0xDF ; 223 161b6: f9 cf rjmp .-14 ; 0x161aa 161b8: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 161bc: 87 7f andi r24, 0xF7 ; 247 161be: f5 cf rjmp .-22 ; 0x161aa 161c0: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 161c4: 8f 77 andi r24, 0x7F ; 127 161c6: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 161ca: 08 95 ret 161cc: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 161d0: 8f 7d andi r24, 0xDF ; 223 161d2: f9 cf rjmp .-14 ; 0x161c6 161d4: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 161d8: 87 7f andi r24, 0xF7 ; 247 161da: f5 cf rjmp .-22 ; 0x161c6 161dc: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 161e0: 8f 77 andi r24, 0x7F ; 127 161e2: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 161e6: 08 95 ret 161e8: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 161ec: 8f 7d andi r24, 0xDF ; 223 161ee: f9 cf rjmp .-14 ; 0x161e2 161f0: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 161f4: 87 7f andi r24, 0xF7 ; 247 161f6: f5 cf rjmp .-22 ; 0x161e2 000161f8 : 161f8: 83 b1 in r24, 0x03 ; 3 161fa: 82 95 swap r24 161fc: 81 70 andi r24, 0x01 ; 1 161fe: 08 95 ret 00016200 : } uint8_t xyzcal_dm = 0; void xyzcal_update_pos(uint16_t dx, uint16_t dy, uint16_t dz, uint16_t) { 16200: cf 92 push r12 16202: df 92 push r13 16204: ef 92 push r14 16206: 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; 16208: 20 91 bf 03 lds r18, 0x03BF ; 0x8003bf 1620c: b0 e0 ldi r27, 0x00 ; 0 1620e: a0 e0 ldi r26, 0x00 ; 0 16210: c0 90 b6 06 lds r12, 0x06B6 ; 0x8006b6 16214: d0 90 b7 06 lds r13, 0x06B7 ; 0x8006b7 16218: e0 90 b8 06 lds r14, 0x06B8 ; 0x8006b8 1621c: f0 90 b9 06 lds r15, 0x06B9 ; 0x8006b9 16220: 20 ff sbrs r18, 0 16222: 42 c0 rjmp .+132 ; 0x162a8 16224: c8 1a sub r12, r24 16226: d9 0a sbc r13, r25 16228: ea 0a sbc r14, r26 1622a: fb 0a sbc r15, r27 1622c: c0 92 b6 06 sts 0x06B6, r12 ; 0x8006b6 16230: d0 92 b7 06 sts 0x06B7, r13 ; 0x8006b7 16234: e0 92 b8 06 sts 0x06B8, r14 ; 0x8006b8 16238: f0 92 b9 06 sts 0x06B9, r15 ; 0x8006b9 1623c: cb 01 movw r24, r22 1623e: b0 e0 ldi r27, 0x00 ; 0 16240: a0 e0 ldi r26, 0x00 ; 0 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 16242: c0 90 ba 06 lds r12, 0x06BA ; 0x8006ba 16246: d0 90 bb 06 lds r13, 0x06BB ; 0x8006bb 1624a: e0 90 bc 06 lds r14, 0x06BC ; 0x8006bc 1624e: f0 90 bd 06 lds r15, 0x06BD ; 0x8006bd 16252: 21 ff sbrs r18, 1 16254: 36 c0 rjmp .+108 ; 0x162c2 16256: c8 1a sub r12, r24 16258: d9 0a sbc r13, r25 1625a: ea 0a sbc r14, r26 1625c: fb 0a sbc r15, r27 1625e: c0 92 ba 06 sts 0x06BA, r12 ; 0x8006ba 16262: d0 92 bb 06 sts 0x06BB, r13 ; 0x8006bb 16266: e0 92 bc 06 sts 0x06BC, r14 ; 0x8006bc 1626a: f0 92 bd 06 sts 0x06BD, r15 ; 0x8006bd 1626e: 70 e0 ldi r23, 0x00 ; 0 16270: 60 e0 ldi r22, 0x00 ; 0 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 16272: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 16276: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 1627a: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 1627e: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 16282: 22 ff sbrs r18, 2 16284: 2b c0 rjmp .+86 ; 0x162dc 16286: 84 1b sub r24, r20 16288: 95 0b sbc r25, r21 1628a: a6 0b sbc r26, r22 1628c: b7 0b sbc r27, r23 1628e: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 16292: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 16296: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 1629a: 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]); } 1629e: ff 90 pop r15 162a0: ef 90 pop r14 162a2: df 90 pop r13 162a4: cf 90 pop r12 162a6: 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; 162a8: 8c 0d add r24, r12 162aa: 9d 1d adc r25, r13 162ac: ae 1d adc r26, r14 162ae: bf 1d adc r27, r15 162b0: 80 93 b6 06 sts 0x06B6, r24 ; 0x8006b6 162b4: 90 93 b7 06 sts 0x06B7, r25 ; 0x8006b7 162b8: a0 93 b8 06 sts 0x06B8, r26 ; 0x8006b8 162bc: b0 93 b9 06 sts 0x06B9, r27 ; 0x8006b9 162c0: bd cf rjmp .-134 ; 0x1623c if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 162c2: 8c 0d add r24, r12 162c4: 9d 1d adc r25, r13 162c6: ae 1d adc r26, r14 162c8: bf 1d adc r27, r15 162ca: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 162ce: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb 162d2: a0 93 bc 06 sts 0x06BC, r26 ; 0x8006bc 162d6: b0 93 bd 06 sts 0x06BD, r27 ; 0x8006bd 162da: c9 cf rjmp .-110 ; 0x1626e if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 162dc: 84 0f add r24, r20 162de: 95 1f adc r25, r21 162e0: a6 1f adc r26, r22 162e2: b7 1f adc r27, r23 162e4: d4 cf rjmp .-88 ; 0x1628e 000162e6 : inline bool is_digit(char c) { return c >= '0' && c <= '9'; } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ 162e6: fb 01 movw r30, r22 *v = 0; 162e8: 11 82 std Z+1, r1 ; 0x01 162ea: 10 82 st Z, r1 while(is_digit(*str)){ *v *= 10; 162ec: 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'; 162ee: dc 01 movw r26, r24 162f0: 2c 91 ld r18, X 162f2: 20 53 subi r18, 0x30 ; 48 } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ *v = 0; while(is_digit(*str)){ 162f4: 2a 30 cpi r18, 0x0A ; 10 162f6: a0 f4 brcc .+40 ; 0x16320 *v *= 10; 162f8: 40 81 ld r20, Z 162fa: 51 81 ldd r21, Z+1 ; 0x01 162fc: 64 9f mul r22, r20 162fe: 90 01 movw r18, r0 16300: 65 9f mul r22, r21 16302: 30 0d add r19, r0 16304: 11 24 eor r1, r1 16306: 31 83 std Z+1, r19 ; 0x01 16308: 20 83 st Z, r18 *v += *str - '0'; 1630a: 4d 91 ld r20, X+ 1630c: cd 01 movw r24, r26 1630e: 20 53 subi r18, 0x30 ; 48 16310: 31 09 sbc r19, r1 16312: 24 0f add r18, r20 16314: 31 1d adc r19, r1 16316: 47 fd sbrc r20, 7 16318: 3a 95 dec r19 1631a: 31 83 std Z+1, r19 ; 0x01 1631c: 20 83 st Z, r18 1631e: e7 cf rjmp .-50 ; 0x162ee ++str; } return str; } 16320: 08 95 ret 00016322 : } //! @brief Send host action "start" void lcd_send_action_start() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_START); 16322: 8a ef ldi r24, 0xFA ; 250 16324: 97 e6 ldi r25, 0x67 ; 103 16326: 0e 94 49 72 call 0xe492 ; 0xe492 lcd_return_to_status(); 1632a: 0c 94 6d fe jmp 0x1fcda ; 0x1fcda 0001632e : //! 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) { 1632e: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.367> 16332: 81 30 cpi r24, 0x01 ; 1 16334: 21 f4 brne .+8 ; 0x1633e SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_NOT_READY); 16336: 8c ea ldi r24, 0xAC ; 172 16338: 97 e6 ldi r25, 0x67 ; 103 } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_READY); 1633a: 0c 94 49 72 jmp 0xe492 ; 0xe492 1633e: 8d e9 ldi r24, 0x9D ; 157 16340: 97 e6 ldi r25, 0x67 ; 103 16342: fb cf rjmp .-10 ; 0x1633a 00016344 : 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, 16344: 1f 93 push r17 16346: cf 93 push r28 16348: df 93 push r29 1634a: c8 2f mov r28, r24 1634c: d6 2f mov r29, r22 const bool _default) { bool _result = check_opposite; lcd_clear(); 1634e: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_FAN)); 16352: 8c ee ldi r24, 0xEC ; 236 16354: 93 e4 ldi r25, 0x43 ; 67 16356: 0e 94 a7 6c call 0xd94e ; 0xd94e 1635a: ac 01 movw r20, r24 1635c: 60 e0 ldi r22, 0x00 ; 0 1635e: 80 e0 ldi r24, 0x00 ; 0 16360: 0e 94 85 69 call 0xd30a ; 0xd30a 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)); 16364: 86 ec ldi r24, 0xC6 ; 198 16366: 93 e4 ldi r25, 0x43 ; 67 16368: c1 11 cpse r28, r1 1636a: 02 c0 rjmp .+4 ; 0x16370 1636c: 89 ed ldi r24, 0xD9 ; 217 1636e: 93 e4 ldi r25, 0x43 ; 67 16370: 0e 94 a7 6c call 0xd94e ; 0xd94e 16374: ac 01 movw r20, r24 16376: 61 e0 ldi r22, 0x01 ; 1 16378: 80 e0 ldi r24, 0x00 ; 0 1637a: 0e 94 85 69 call 0xd30a ; 0xd30a } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1637e: 8f ef ldi r24, 0xFF ; 255 16380: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 16384: 80 93 05 05 sts 0x0505, r24 ; 0x800505 #endif manage_heater(); 16388: 0f 94 13 33 call 0x26626 ; 0x26626 // 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); 1638c: 64 ef ldi r22, 0xF4 ; 244 1638e: 71 e0 ldi r23, 0x01 ; 1 16390: 80 e0 ldi r24, 0x00 ; 0 16392: 90 e0 ldi r25, 0x00 ; 0 16394: 0f 94 03 0e call 0x21c06 ; 0x21c06 lcd_puts_at_P(1, 2, _T(MSG_SELFTEST_FAN_YES)); 16398: 8b eb ldi r24, 0xBB ; 187 1639a: 93 e4 ldi r25, 0x43 ; 67 1639c: 0e 94 a7 6c call 0xd94e ; 0xd94e 163a0: ac 01 movw r20, r24 163a2: 62 e0 ldi r22, 0x02 ; 2 163a4: 81 e0 ldi r24, 0x01 ; 1 163a6: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_putc_at(0, 3, '>'); 163aa: 4e e3 ldi r20, 0x3E ; 62 163ac: 63 e0 ldi r22, 0x03 ; 3 163ae: 80 e0 ldi r24, 0x00 ; 0 163b0: 0e 94 91 69 call 0xd322 ; 0xd322 lcd_puts_P(_T(MSG_SELFTEST_FAN_NO)); 163b4: 8c ea ldi r24, 0xAC ; 172 163b6: 93 e4 ldi r25, 0x43 ; 67 163b8: 0e 94 a7 6c call 0xd94e ; 0xd94e 163bc: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 lcd_encoder = _default; 163c0: 6d 2f mov r22, r29 163c2: 70 e0 ldi r23, 0x00 ; 0 163c4: 70 93 07 05 sts 0x0507, r23 ; 0x800507 163c8: 60 93 06 05 sts 0x0506, r22 ; 0x800506 KEEPALIVE_STATE(PAUSED_FOR_USER); 163cc: 84 e0 ldi r24, 0x04 ; 4 163ce: 80 93 78 02 sts 0x0278, r24 ; 0x800278 lcd_consume_click(); 163d2: 0e 94 89 6b call 0xd712 ; 0xd712 163d6: dc 2f mov r29, r28 do { if (lcd_encoder) { if (lcd_encoder < 0) { _result = !check_opposite; 163d8: 11 e0 ldi r17, 0x01 ; 1 163da: 1c 27 eor r17, r28 KEEPALIVE_STATE(PAUSED_FOR_USER); lcd_consume_click(); do { if (lcd_encoder) { 163dc: 80 91 06 05 lds r24, 0x0506 ; 0x800506 163e0: 90 91 07 05 lds r25, 0x0507 ; 0x800507 163e4: 00 97 sbiw r24, 0x00 ; 0 163e6: 19 f1 breq .+70 ; 0x1642e if (lcd_encoder < 0) { 163e8: 97 ff sbrs r25, 7 163ea: 0b c0 rjmp .+22 ; 0x16402 _result = !check_opposite; 163ec: d1 2f mov r29, r17 lcd_putc_at(0, 2, '>'); 163ee: 4e e3 ldi r20, 0x3E ; 62 163f0: 62 e0 ldi r22, 0x02 ; 2 163f2: 80 e0 ldi r24, 0x00 ; 0 163f4: 0e 94 91 69 call 0xd322 ; 0xd322 lcd_putc_at(0, 3, ' '); 163f8: 40 e2 ldi r20, 0x20 ; 32 163fa: 63 e0 ldi r22, 0x03 ; 3 163fc: 80 e0 ldi r24, 0x00 ; 0 163fe: 0e 94 91 69 call 0xd322 ; 0xd322 } if (lcd_encoder > 0) { 16402: 80 91 06 05 lds r24, 0x0506 ; 0x800506 16406: 90 91 07 05 lds r25, 0x0507 ; 0x800507 1640a: 18 16 cp r1, r24 1640c: 19 06 cpc r1, r25 1640e: 5c f4 brge .+22 ; 0x16426 _result = check_opposite; lcd_putc_at(0, 2, ' '); 16410: 40 e2 ldi r20, 0x20 ; 32 16412: 62 e0 ldi r22, 0x02 ; 2 16414: 80 e0 ldi r24, 0x00 ; 0 16416: 0e 94 91 69 call 0xd322 ; 0xd322 lcd_putc_at(0, 3, '>'); 1641a: 4e e3 ldi r20, 0x3E ; 62 1641c: 63 e0 ldi r22, 0x03 ; 3 1641e: 80 e0 ldi r24, 0x00 ; 0 16420: 0e 94 91 69 call 0xd322 ; 0xd322 16424: dc 2f mov r29, r28 } lcd_encoder = 0; 16426: 10 92 07 05 sts 0x0507, r1 ; 0x800507 1642a: 10 92 06 05 sts 0x0506, r1 ; 0x800506 } manage_heater(); 1642e: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(true); 16432: 81 e0 ldi r24, 0x01 ; 1 16434: 0e 94 fe 79 call 0xf3fc ; 0xf3fc _delay(100); 16438: 64 e6 ldi r22, 0x64 ; 100 1643a: 70 e0 ldi r23, 0x00 ; 0 1643c: 80 e0 ldi r24, 0x00 ; 0 1643e: 90 e0 ldi r25, 0x00 ; 0 16440: 0f 94 03 0e call 0x21c06 ; 0x21c06 } while (!lcd_clicked()); 16444: 0e 94 8e 6b call 0xd71c ; 0xd71c 16448: 88 23 and r24, r24 1644a: 41 f2 breq .-112 ; 0x163dc KEEPALIVE_STATE(IN_HANDLER); 1644c: 82 e0 ldi r24, 0x02 ; 2 1644e: 80 93 78 02 sts 0x0278, r24 ; 0x800278 setExtruderAutoFanState(0); // Turn off hotend fan 16452: 80 e0 ldi r24, 0x00 ; 0 16454: 0e 94 35 6e call 0xdc6a ; 0xdc6a } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 16458: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1645c: 10 92 05 05 sts 0x0505, r1 ; 0x800505 #endif manage_heater(); 16460: 0f 94 13 33 call 0x26626 ; 0x26626 KEEPALIVE_STATE(IN_HANDLER); setExtruderAutoFanState(0); // Turn off hotend fan lcd_selftest_setfan(0); // Turn off print fan return _result; } 16464: 8d 2f mov r24, r29 16466: df 91 pop r29 16468: cf 91 pop r28 1646a: 1f 91 pop r17 1646c: 08 95 ret 0001646e : planner_synchronize(); Disable_E0(); } void MMU2::execute_load_to_nozzle_sequence() { 1646e: cf 93 push r28 16470: df 93 push r29 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 16472: 0f 94 ce 22 call 0x2459c ; 0x2459c float planner_get_current_position_E() { return current_position[E_AXIS]; } void planner_set_current_position_E(float e) { current_position[E_AXIS] = e; 16476: c5 ef ldi r28, 0xF5 ; 245 16478: 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)); 1647a: 60 91 71 12 lds r22, 0x1271 ; 0x801271 1647e: 70 e0 ldi r23, 0x00 ; 0 16480: 90 e0 ldi r25, 0x00 ; 0 16482: 80 e0 ldi r24, 0x00 ; 0 16484: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 16488: 9b 01 movw r18, r22 1648a: ac 01 movw r20, r24 1648c: 6c 85 ldd r22, Y+12 ; 0x0c 1648e: 7d 85 ldd r23, Y+13 ; 0x0d 16490: 8e 85 ldd r24, Y+14 ; 0x0e 16492: 9f 85 ldd r25, Y+15 ; 0x0f 16494: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 16498: 6c 87 std Y+12, r22 ; 0x0c 1649a: 7d 87 std Y+13, r23 ; 0x0d 1649c: 8e 87 std Y+14, r24 ; 0x0e 1649e: 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])); 164a0: 62 e0 ldi r22, 0x02 ; 2 164a2: 84 ea ldi r24, 0xA4 ; 164 164a4: 96 e8 ldi r25, 0x86 ; 134 } 164a6: df 91 pop r29 164a8: 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])); 164aa: 0d 94 4a 54 jmp 0x2a894 ; 0x2a894 000164ae : 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) { 164ae: 0f 93 push r16 164b0: 1f 93 push r17 164b2: cf 93 push r28 164b4: df 93 push r29 164b6: 98 2f mov r25, r24 164b8: 86 2f mov r24, r22 164ba: 14 2f mov r17, r20 164bc: e9 01 movw r28, r18 lcd_set_cursor(_col, _row); 164be: 69 2f mov r22, r25 164c0: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 switch (_state) 164c4: 11 30 cpi r17, 0x01 ; 1 164c6: 21 f0 breq .+8 ; 0x164d0 164c8: 12 30 cpi r17, 0x02 ; 2 164ca: 79 f0 breq .+30 ; 0x164ea lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 164cc: ce 01 movw r24, r28 164ce: 15 c0 rjmp .+42 ; 0x164fa { lcd_set_cursor(_col, _row); switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); 164d0: ce 01 movw r24, r28 164d2: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 lcd_putc(':'); 164d6: 8a e3 ldi r24, 0x3A ; 58 164d8: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 lcd_putc(_indicator); 164dc: 80 2f mov r24, r16 lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); } } 164de: df 91 pop r29 164e0: cf 91 pop r28 164e2: 1f 91 pop r17 164e4: 0f 91 pop r16 switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_putc(_indicator); 164e6: 0c 94 60 69 jmp 0xd2c0 ; 0xd2c0 break; case 2: lcd_puts_P(_name_PROGMEM); 164ea: ce 01 movw r24, r28 164ec: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 lcd_putc(':'); 164f0: 8a e3 ldi r24, 0x3A ; 58 164f2: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 lcd_puts_P(MSG_OK_CAPS); 164f6: 83 ed ldi r24, 0xD3 ; 211 164f8: 97 e6 ldi r25, 0x67 ; 103 break; default: lcd_puts_P(_name_PROGMEM); } } 164fa: df 91 pop r29 164fc: cf 91 pop r28 164fe: 1f 91 pop r17 16500: 0f 91 pop r16 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 16502: 0c 94 5c 69 jmp 0xd2b8 ; 0xd2b8 00016506 : } } menu_item++; } void __attribute__((noinline)) menu_item_function_E(const Sheet &sheet, menu_func_t func) 16506: df 92 push r13 16508: ef 92 push r14 1650a: ff 92 push r15 1650c: 0f 93 push r16 1650e: 1f 93 push r17 16510: cf 93 push r28 16512: df 93 push r29 16514: cd b7 in r28, 0x3d ; 61 16516: de b7 in r29, 0x3e ; 62 16518: 63 97 sbiw r28, 0x13 ; 19 1651a: 0f b6 in r0, 0x3f ; 63 1651c: f8 94 cli 1651e: de bf out 0x3e, r29 ; 62 16520: 0f be out 0x3f, r0 ; 63 16522: cd bf out 0x3d, r28 ; 61 { if (menu_item == menu_line) 16524: 30 91 31 04 lds r19, 0x0431 ; 0x800431 16528: 20 91 30 04 lds r18, 0x0430 ; 0x800430 1652c: 32 13 cpse r19, r18 1652e: 73 c0 rjmp .+230 ; 0x16616 16530: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_select_sheet_E(' ', sheet); 16532: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 16536: 88 23 and r24, r24 16538: 09 f4 brne .+2 ; 0x1653c 1653a: 45 c0 rjmp .+138 ; 0x165c6 //! //! @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)); 1653c: 84 ea ldi r24, 0xA4 ; 164 1653e: 93 e4 ldi r25, 0x43 ; 67 16540: 0e 94 a7 6c call 0xd94e ; 0xd94e 16544: 9f 93 push r25 16546: 8f 93 push r24 16548: 8c e9 ldi r24, 0x9C ; 156 1654a: 96 e8 ldi r25, 0x86 ; 134 1654c: 9f 93 push r25 1654e: 8f 93 push r24 16550: 8e 01 movw r16, r28 16552: 0f 5f subi r16, 0xFF ; 255 16554: 1f 4f sbci r17, 0xFF ; 255 16556: 1f 93 push r17 16558: 0f 93 push r16 1655a: 0f 94 b2 9f call 0x33f64 ; 0x33f64 1655e: d8 2e mov r13, r24 eeprom_read_block(&(buffer.c[index]), sheet_E.name, sizeof(sheet_E.name)/sizeof(sheet_E.name[0])); 16560: 47 e0 ldi r20, 0x07 ; 7 16562: 50 e0 ldi r21, 0x00 ; 0 16564: b7 01 movw r22, r14 16566: 80 0f add r24, r16 16568: 91 2f mov r25, r17 1656a: 91 1d adc r25, r1 1656c: 0f 94 8b a0 call 0x34116 ; 0x34116 16570: 0f 90 pop r0 16572: 0f 90 pop r0 16574: 0f 90 pop r0 16576: 0f 90 pop r0 16578: 0f 90 pop r0 1657a: 0f 90 pop r0 1657c: 20 e0 ldi r18, 0x00 ; 0 1657e: 82 2f mov r24, r18 16580: 8d 0d add r24, r13 16582: 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) 16584: 27 30 cpi r18, 0x07 ; 7 16586: 39 f0 breq .+14 ; 0x16596 16588: 2f 5f subi r18, 0xFF ; 255 { if (buffer.c[index] == '\0') break; 1658a: f8 01 movw r30, r16 1658c: e8 0f add r30, r24 1658e: f9 1f adc r31, r25 16590: 30 81 ld r19, Z 16592: 31 11 cpse r19, r1 16594: f4 cf rjmp .-24 ; 0x1657e } buffer.c[index] = ']'; 16596: f8 01 movw r30, r16 16598: e8 0f add r30, r24 1659a: f9 1f adc r31, r25 1659c: 2d e5 ldi r18, 0x5D ; 93 1659e: 20 83 st Z, r18 buffer.c[index + 1] = '\0'; 165a0: 8c 0f add r24, r28 165a2: 9d 1f adc r25, r29 165a4: fc 01 movw r30, r24 165a6: 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()); 165a8: 0f 94 3d 92 call 0x3247a ; 0x3247a 165ac: 48 2f mov r20, r24 165ae: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 165b2: 80 e0 ldi r24, 0x00 ; 0 165b4: 0e 94 91 69 call 0xd322 ; 0xd322 lcd_print_pad(buffer.c, LCD_WIDTH - 2); 165b8: 62 e1 ldi r22, 0x12 ; 18 165ba: c8 01 movw r24, r16 165bc: 0e 94 60 6b call 0xd6c0 ; 0xd6c0 lcd_putc(type_char); 165c0: 80 e2 ldi r24, 0x20 ; 32 165c2: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 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)) 165c6: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 165ca: 88 23 and r24, r24 165cc: 21 f1 breq .+72 ; 0x16616 165ce: 20 91 31 04 lds r18, 0x0431 ; 0x800431 165d2: 80 91 06 05 lds r24, 0x0506 ; 0x800506 165d6: 90 91 07 05 lds r25, 0x0507 ; 0x800507 165da: 28 17 cp r18, r24 165dc: 19 06 cpc r1, r25 165de: d9 f4 brne .+54 ; 0x16616 { lcd_update_enabled = 0; 165e0: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c if (func) func(); 165e4: 80 e3 ldi r24, 0x30 ; 48 165e6: 9f e6 ldi r25, 0x6F ; 111 165e8: 89 2b or r24, r25 165ea: 11 f0 breq .+4 ; 0x165f0 165ec: 0e 94 30 6f call 0xde60 ; 0xde60 lcd_update_enabled = 1; 165f0: 81 e0 ldi r24, 0x01 ; 1 165f2: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c menu_item_ret(); 165f6: 0f 94 61 92 call 0x324c2 ; 0x324c2 return; } } menu_item++; } 165fa: 63 96 adiw r28, 0x13 ; 19 165fc: 0f b6 in r0, 0x3f ; 63 165fe: f8 94 cli 16600: de bf out 0x3e, r29 ; 62 16602: 0f be out 0x3f, r0 ; 63 16604: cd bf out 0x3d, r28 ; 61 16606: df 91 pop r29 16608: cf 91 pop r28 1660a: 1f 91 pop r17 1660c: 0f 91 pop r16 1660e: ff 90 pop r15 16610: ef 90 pop r14 16612: df 90 pop r13 16614: 08 95 ret lcd_update_enabled = 1; menu_item_ret(); return; } } menu_item++; 16616: 80 91 31 04 lds r24, 0x0431 ; 0x800431 1661a: 8f 5f subi r24, 0xFF ; 255 1661c: 80 93 31 04 sts 0x0431, r24 ; 0x800431 16620: ec cf rjmp .-40 ; 0x165fa 00016622 : } #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); 16622: 87 ea ldi r24, 0xA7 ; 167 16624: 9c e0 ldi r25, 0x0C ; 12 16626: 0f 94 9b a0 call 0x34136 ; 0x34136 if (value > 1) value = 1; 1662a: 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) 1662c: 82 30 cpi r24, 0x02 ; 2 1662e: 08 f4 brcc .+2 ; 0x16632 16630: 68 27 eor r22, r24 16632: 87 ea ldi r24, 0xA7 ; 167 16634: 9c e0 ldi r25, 0x0C ; 12 16636: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 0001663a : 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); 1663a: 8a ea ldi r24, 0xAA ; 170 1663c: 9d e0 ldi r25, 0x0D ; 13 1663e: 0f 94 9b a0 call 0x34136 ; 0x34136 switch (mbl_z_probe_nr) { case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; 16642: 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) { 16644: 83 30 cpi r24, 0x03 ; 3 16646: 21 f0 breq .+8 ; 0x16650 case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; case 5: mbl_z_probe_nr = 1; break; 16648: 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) { 1664a: 85 30 cpi r24, 0x05 ; 5 1664c: 09 f0 breq .+2 ; 0x16650 case 1: mbl_z_probe_nr = 3; break; 1664e: 63 e0 ldi r22, 0x03 ; 3 16650: 8a ea ldi r24, 0xAA ; 170 16652: 9d e0 ldi r25, 0x0D ; 13 16654: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 00016658 : 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); 16658: 8b ea ldi r24, 0xAB ; 171 1665a: 9d e0 ldi r25, 0x0D ; 13 1665c: 0f 94 9b a0 call 0x34136 ; 0x34136 if(mesh_nr == 3) mesh_nr = 7; else mesh_nr = 3; 16660: 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; 16662: 83 30 cpi r24, 0x03 ; 3 16664: 09 f4 brne .+2 ; 0x16668 16666: 67 e0 ldi r22, 0x07 ; 7 16668: 8b ea ldi r24, 0xAB ; 171 1666a: 9d e0 ldi r25, 0x0D ; 13 1666c: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 00016670 : #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); 16670: 8c ea ldi r24, 0xAC ; 172 16672: 9d e0 ldi r25, 0x0D ; 13 16674: 0f 94 9b a0 call 0x34136 ; 0x34136 magnet_elimination = !magnet_elimination; 16678: 61 e0 ldi r22, 0x01 ; 1 1667a: 81 11 cpse r24, r1 1667c: 60 e0 ldi r22, 0x00 ; 0 1667e: 8c ea ldi r24, 0xAC ; 172 16680: 9d e0 ldi r25, 0x0D ; 13 16682: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 00016686 : 16686: 60 91 98 03 lds r22, 0x0398 ; 0x800398 1668a: 81 ea ldi r24, 0xA1 ; 161 1668c: 9d e0 ldi r25, 0x0D ; 13 1668e: 0f 94 bf a0 call 0x3417e ; 0x3417e //! @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(); 16692: 0d 94 7d 00 jmp 0x200fa ; 0x200fa 00016696 : } return 0; } bool eeprom_fw_version_older_than_p(const uint16_t (&ver_req)[4]) { 16696: 0f 93 push r16 16698: 1f 93 push r17 1669a: cf 93 push r28 1669c: df 93 push r29 1669e: 00 d0 rcall .+0 ; 0x166a0 166a0: 00 d0 rcall .+0 ; 0x166a2 166a2: 1f 92 push r1 166a4: 1f 92 push r1 166a6: cd b7 in r28, 0x3d ; 61 166a8: de b7 in r29, 0x3e ; 62 166aa: 8c 01 movw r16, r24 uint16_t ver_eeprom[4]; ver_eeprom[0] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR); 166ac: 8a e0 ldi r24, 0x0A ; 10 166ae: 90 e0 ldi r25, 0x00 ; 0 166b0: 0f 94 a9 a0 call 0x34152 ; 0x34152 166b4: 9a 83 std Y+2, r25 ; 0x02 166b6: 89 83 std Y+1, r24 ; 0x01 ver_eeprom[1] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR); 166b8: 8c e0 ldi r24, 0x0C ; 12 166ba: 90 e0 ldi r25, 0x00 ; 0 166bc: 0f 94 a9 a0 call 0x34152 ; 0x34152 166c0: 9c 83 std Y+4, r25 ; 0x04 166c2: 8b 83 std Y+3, r24 ; 0x03 ver_eeprom[2] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION); 166c4: 8e e0 ldi r24, 0x0E ; 14 166c6: 90 e0 ldi r25, 0x00 ; 0 166c8: 0f 94 a9 a0 call 0x34152 ; 0x34152 166cc: 9e 83 std Y+6, r25 ; 0x06 166ce: 8d 83 std Y+5, r24 ; 0x05 ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR); 166d0: 80 e1 ldi r24, 0x10 ; 16 166d2: 90 e0 ldi r25, 0x00 ; 0 166d4: 0f 94 a9 a0 call 0x34152 ; 0x34152 166d8: 98 87 std Y+8, r25 ; 0x08 166da: 8f 83 std Y+7, r24 ; 0x07 166dc: c8 01 movw r24, r16 166de: de 01 movw r26, r28 166e0: 11 96 adiw r26, 0x01 ; 1 166e2: be 01 movw r22, r28 166e4: 67 5f subi r22, 0xF7 ; 247 166e6: 7f 4f sbci r23, 0xFF ; 255 for (uint8_t i = 0; i < 4; ++i) { uint16_t v = pgm_read_word(&ver_req[i]); 166e8: fc 01 movw r30, r24 166ea: 25 91 lpm r18, Z+ 166ec: 34 91 lpm r19, Z if (v > ver_eeprom[i]) 166ee: 4d 91 ld r20, X+ 166f0: 5d 91 ld r21, X+ 166f2: 42 17 cp r20, r18 166f4: 53 07 cpc r21, r19 166f6: 48 f0 brcs .+18 ; 0x1670a return true; else if (v < ver_eeprom[i]) 166f8: 24 17 cp r18, r20 166fa: 35 07 cpc r19, r21 166fc: 20 f0 brcs .+8 ; 0x16706 166fe: 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) { 16700: a6 17 cp r26, r22 16702: b7 07 cpc r27, r23 16704: 89 f7 brne .-30 ; 0x166e8 return true; else if (v < ver_eeprom[i]) break; } return false; 16706: 80 e0 ldi r24, 0x00 ; 0 16708: 01 c0 rjmp .+2 ; 0x1670c 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; 1670a: 81 e0 ldi r24, 0x01 ; 1 else if (v < ver_eeprom[i]) break; } return false; } 1670c: 28 96 adiw r28, 0x08 ; 8 1670e: 0f b6 in r0, 0x3f ; 63 16710: f8 94 cli 16712: de bf out 0x3e, r29 ; 62 16714: 0f be out 0x3f, r0 ; 63 16716: cd bf out 0x3d, r28 ; 61 16718: df 91 pop r29 1671a: cf 91 pop r28 1671c: 1f 91 pop r17 1671e: 0f 91 pop r16 16720: 08 95 ret 00016722 : eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() 16722: cf 93 push r28 16724: 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)) 16726: 8f ef ldi r24, 0xFF ; 255 16728: 9f e0 ldi r25, 0x0F ; 15 1672a: 0f 94 9b a0 call 0x34136 ; 0x34136 1672e: 81 30 cpi r24, 0x01 ; 1 16730: 99 f0 breq .+38 ; 0x16758 16732: 82 30 cpi r24, 0x02 ; 2 16734: a1 f0 breq .+40 ; 0x1675e { case SILENT_MODE_POWER: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_HIGH_POWER), lcd_silent_mode_set); 16736: 88 e3 ldi r24, 0x38 ; 56 16738: 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); 1673a: 0e 94 a7 6c call 0xd94e ; 0xd94e 1673e: ec 01 movw r28, r24 16740: 81 e3 ldi r24, 0x31 ; 49 16742: 90 e4 ldi r25, 0x40 ; 64 16744: 0e 94 a7 6c call 0xd94e ; 0xd94e 16748: 22 e0 ldi r18, 0x02 ; 2 1674a: 41 eb ldi r20, 0xB1 ; 177 1674c: 57 e3 ldi r21, 0x37 ; 55 1674e: 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 } } 16750: df 91 pop r29 16752: 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); 16754: 0d 94 0a 95 jmp 0x32a14 ; 0x32a14 { 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); 16758: 88 e2 ldi r24, 0x28 ; 40 1675a: 90 e4 ldi r25, 0x40 ; 64 1675c: ee cf rjmp .-36 ; 0x1673a break; case SILENT_MODE_AUTO: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_AUTO_POWER), lcd_silent_mode_set); 1675e: 8b e1 ldi r24, 0x1B ; 27 16760: 90 e4 ldi r25, 0x40 ; 64 16762: eb cf rjmp .-42 ; 0x1673a 00016764 : 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) 16764: 80 91 64 03 lds r24, 0x0364 ; 0x800364 16768: 88 23 and r24, r24 1676a: 21 f0 breq .+8 ; 0x16774 1676c: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 16770: 88 23 and r24, r24 16772: 51 f0 breq .+20 ; 0x16788 { _md->status = 1; 16774: 81 e0 ldi r24, 0x01 ; 1 16776: 80 93 64 03 sts 0x0364, r24 ; 0x800364 _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); 1677a: 60 e0 ldi r22, 0x00 ; 0 1677c: 8a e2 ldi r24, 0x2A ; 42 1677e: 9d e0 ldi r25, 0x0D ; 13 16780: 0e 94 e3 6e call 0xddc6 ; 0xddc6 16784: 80 93 65 03 sts 0x0365, r24 ; 0x800365 } MENU_BEGIN(); 16788: 0f 94 7b 93 call 0x326f6 ; 0x326f6 1678c: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 16790: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16794: 84 30 cpi r24, 0x04 ; 4 16796: 08 f0 brcs .+2 ; 0x1679a 16798: 90 c0 rjmp .+288 ; 0x168ba 1679a: 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 1679e: 80 91 ba 03 lds r24, 0x03BA ; 0x8003ba 167a2: 81 11 cpse r24, r1 167a4: 55 c0 rjmp .+170 ; 0x16850 167a6: 84 e1 ldi r24, 0x14 ; 20 167a8: 90 e4 ldi r25, 0x40 ; 64 167aa: 0e 94 a7 6c call 0xd94e ; 0xd94e 167ae: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); 167b2: 85 ef ldi r24, 0xF5 ; 245 167b4: 9b e3 ldi r25, 0x3B ; 59 167b6: 0e 94 a7 6c call 0xd94e ; 0xd94e 167ba: 68 e9 ldi r22, 0x98 ; 152 167bc: 7c eb ldi r23, 0xBC ; 188 167be: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 SETTINGS_NOZZLE; 167c2: 80 91 b9 03 lds r24, 0x03B9 ; 0x8003b9 167c6: 8c 33 cpi r24, 0x3C ; 60 167c8: 09 f4 brne .+2 ; 0x167cc 167ca: 60 c0 rjmp .+192 ; 0x1688c 167cc: 08 f0 brcs .+2 ; 0x167d0 167ce: 43 c0 rjmp .+134 ; 0x16856 167d0: 89 31 cpi r24, 0x19 ; 25 167d2: 09 f4 brne .+2 ; 0x167d6 167d4: 4f c0 rjmp .+158 ; 0x16874 167d6: 88 32 cpi r24, 0x28 ; 40 167d8: 09 f4 brne .+2 ; 0x167dc 167da: 42 c0 rjmp .+132 ; 0x16860 MENU_ITEM_FUNCTION_P(_T(MSG_NOZZLE_CNG_MENU),nozzle_change); 167dc: 8e e8 ldi r24, 0x8E ; 142 167de: 9a e3 ldi r25, 0x3A ; 58 167e0: 0e 94 a7 6c call 0xd94e ; 0xd94e 167e4: 6a e1 ldi r22, 0x1A ; 26 167e6: 76 ec ldi r23, 0xC6 ; 198 167e8: 0f 94 f8 92 call 0x325f0 ; 0x325f0 MENU_ITEM_SUBMENU_P(_T(MSG_CHECKS), lcd_checking_menu); 167ec: 8b e3 ldi r24, 0x3B ; 59 167ee: 9a e3 ldi r25, 0x3A ; 58 167f0: 0e 94 a7 6c call 0xd94e ; 0xd94e 167f4: 63 e7 ldi r22, 0x73 ; 115 167f6: 7c ef ldi r23, 0xFC ; 252 167f8: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 //! 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) 167fc: 80 91 65 03 lds r24, 0x0365 ; 0x800365 16800: 88 23 and r24, r24 16802: 31 f0 breq .+12 ; 0x16810 { MENU_ITEM_SUBMENU_P(PSTR("Experimental"), lcd_experimental_menu);////MSG_MENU_EXPERIMENTAL c=18 16804: 6e e5 ldi r22, 0x5E ; 94 16806: 74 eb ldi r23, 0xB4 ; 180 16808: 87 e7 ldi r24, 0x77 ; 119 1680a: 92 e8 ldi r25, 0x82 ; 130 1680c: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 //! 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); 16810: 89 e2 ldi r24, 0x29 ; 41 16812: 9d e0 ldi r25, 0x0D ; 13 16814: 0f 94 9b a0 call 0x34136 ; 0x34136 16818: 88 23 and r24, r24 1681a: 09 f4 brne .+2 ; 0x1681e 1681c: 4b c0 rjmp .+150 ; 0x168b4 1681e: 82 eb ldi r24, 0xB2 ; 178 16820: 9d e3 ldi r25, 0x3D ; 61 16822: 0e 94 a7 6c call 0xd94e ; 0xd94e 16826: 22 e0 ldi r18, 0x02 ; 2 16828: 4c ec ldi r20, 0xCC ; 204 1682a: 55 eb ldi r21, 0xB5 ; 181 1682c: bc 01 movw r22, r24 1682e: 86 e4 ldi r24, 0x46 ; 70 16830: 97 e6 ldi r25, 0x67 ; 103 16832: 0f 94 0a 95 call 0x32a14 ; 0x32a14 #endif //PINDA_TEMP_COMP MENU_END(); 16836: 0f 94 4f 93 call 0x3269e ; 0x3269e _md->status = 1; _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); } MENU_BEGIN(); 1683a: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1683e: 8f 5f subi r24, 0xFF ; 255 16840: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 16844: 80 91 30 04 lds r24, 0x0430 ; 0x800430 16848: 8f 5f subi r24, 0xFF ; 255 1684a: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1684e: a0 cf rjmp .-192 ; 0x16790 MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 16850: 87 ea ldi r24, 0xA7 ; 167 16852: 9d e3 ldi r25, 0x3D ; 61 16854: aa cf rjmp .-172 ; 0x167aa MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); SETTINGS_NOZZLE; 16856: 80 35 cpi r24, 0x50 ; 80 16858: 19 f1 breq .+70 ; 0x168a0 1685a: 8f 3f cpi r24, 0xFF ; 255 1685c: 09 f0 breq .+2 ; 0x16860 1685e: be cf rjmp .-132 ; 0x167dc 16860: 84 e4 ldi r24, 0x44 ; 68 16862: 9a e3 ldi r25, 0x3A ; 58 16864: 0e 94 a7 6c call 0xd94e ; 0xd94e 16868: 22 e0 ldi r18, 0x02 ; 2 1686a: 41 e3 ldi r20, 0x31 ; 49 1686c: 5d ef ldi r21, 0xFD ; 253 1686e: 6e e8 ldi r22, 0x8E ; 142 16870: 72 e8 ldi r23, 0x82 ; 130 16872: 09 c0 rjmp .+18 ; 0x16886 16874: 84 e4 ldi r24, 0x44 ; 68 16876: 9a e3 ldi r25, 0x3A ; 58 16878: 0e 94 a7 6c call 0xd94e ; 0xd94e 1687c: 22 e0 ldi r18, 0x02 ; 2 1687e: 41 e3 ldi r20, 0x31 ; 49 16880: 5d ef ldi r21, 0xFD ; 253 16882: 63 e9 ldi r22, 0x93 ; 147 16884: 72 e8 ldi r23, 0x82 ; 130 16886: 0f 94 0a 95 call 0x32a14 ; 0x32a14 1688a: a8 cf rjmp .-176 ; 0x167dc 1688c: 84 e4 ldi r24, 0x44 ; 68 1688e: 9a e3 ldi r25, 0x3A ; 58 16890: 0e 94 a7 6c call 0xd94e ; 0xd94e 16894: 22 e0 ldi r18, 0x02 ; 2 16896: 41 e3 ldi r20, 0x31 ; 49 16898: 5d ef ldi r21, 0xFD ; 253 1689a: 69 e8 ldi r22, 0x89 ; 137 1689c: 72 e8 ldi r23, 0x82 ; 130 1689e: f3 cf rjmp .-26 ; 0x16886 168a0: 84 e4 ldi r24, 0x44 ; 68 168a2: 9a e3 ldi r25, 0x3A ; 58 168a4: 0e 94 a7 6c call 0xd94e ; 0xd94e 168a8: 22 e0 ldi r18, 0x02 ; 2 168aa: 41 e3 ldi r20, 0x31 ; 49 168ac: 5d ef ldi r21, 0xFD ; 253 168ae: 64 e8 ldi r22, 0x84 ; 132 168b0: 72 e8 ldi r23, 0x82 ; 130 168b2: e9 cf rjmp .-46 ; 0x16886 //! 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); 168b4: 88 eb ldi r24, 0xB8 ; 184 168b6: 9d e3 ldi r25, 0x3D ; 61 168b8: b4 cf rjmp .-152 ; 0x16822 #endif //PINDA_TEMP_COMP MENU_END(); } 168ba: 08 95 ret 000168bc : } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 168bc: 0f 94 7b 93 call 0x326f6 ; 0x326f6 168c0: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 168c4: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 168c8: 84 30 cpi r24, 0x04 ; 4 168ca: a8 f4 brcc .+42 ; 0x168f6 168cc: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_BACK)); 168d0: 84 e1 ldi r24, 0x14 ; 20 168d2: 90 e4 ldi r25, 0x40 ; 64 168d4: 0e 94 a7 6c call 0xd94e ; 0xd94e 168d8: 0f 94 46 96 call 0x32c8c ; 0x32c8c #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(); 168dc: 0f 94 4f 93 call 0x3269e ; 0x3269e } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 168e0: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 168e4: 8f 5f subi r24, 0xFF ; 255 168e6: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 168ea: 80 91 30 04 lds r24, 0x0430 ; 0x800430 168ee: 8f 5f subi r24, 0xFF ; 255 168f0: 80 93 30 04 sts 0x0430, r24 ; 0x800430 168f4: e7 cf rjmp .-50 ; 0x168c4 #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(); } 168f6: 08 95 ret 000168f8 : lcd_return_to_status(); } #endif //THERMAL_MODEL void lcd_sdcard_stop() { 168f8: cf 93 push r28 // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); 168fa: 8d eb ldi r24, 0xBD ; 189 168fc: 9d e3 ldi r25, 0x3D ; 61 168fe: 0e 94 a7 6c call 0xd94e ; 0xd94e 16902: ac 01 movw r20, r24 16904: 60 e0 ldi r22, 0x00 ; 0 16906: 80 e0 ldi r24, 0x00 ; 0 16908: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_putc_at(0, 1, '\n'); 1690c: 4a e0 ldi r20, 0x0A ; 10 1690e: 61 e0 ldi r22, 0x01 ; 1 16910: 80 e0 ldi r24, 0x00 ; 0 16912: 0e 94 91 69 call 0xd322 ; 0xd322 MENU_BEGIN(); 16916: 0f 94 7b 93 call 0x326f6 ; 0x326f6 1691a: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 1691e: 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(); 16920: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16924: 84 30 cpi r24, 0x04 ; 4 16926: 18 f5 brcc .+70 ; 0x1696e 16928: 10 92 31 04 sts 0x0431, r1 ; 0x800431 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 1692c: 81 11 cpse r24, r1 1692e: 02 c0 rjmp .+4 ; 0x16934 16930: 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); 16934: 88 eb ldi r24, 0xB8 ; 184 16936: 9d e3 ldi r25, 0x3D ; 61 16938: 0e 94 a7 6c call 0xd94e ; 0xd94e 1693c: 6d e6 ldi r22, 0x6D ; 109 1693e: 7e ef ldi r23, 0xFE ; 254 16940: 0f 94 f8 92 call 0x325f0 ; 0x325f0 MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); 16944: 82 eb ldi r24, 0xB2 ; 178 16946: 9d e3 ldi r25, 0x3D ; 61 16948: 0e 94 a7 6c call 0xd94e ; 0xd94e 1694c: 65 e1 ldi r22, 0x15 ; 21 1694e: 70 ef ldi r23, 0xF0 ; 240 16950: 0f 94 f8 92 call 0x325f0 ; 0x325f0 MENU_END(); 16954: 0f 94 4f 93 call 0x3269e ; 0x3269e { // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); lcd_putc_at(0, 1, '\n'); MENU_BEGIN(); 16958: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1695c: 8f 5f subi r24, 0xFF ; 255 1695e: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 16962: 80 91 30 04 lds r24, 0x0430 ; 0x800430 16966: 8f 5f subi r24, 0xFF ; 255 16968: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1696c: d9 cf rjmp .-78 ; 0x16920 // 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(); } 1696e: cf 91 pop r28 16970: 08 95 ret 00016972 : lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 16972: 0f 94 7b 93 call 0x326f6 ; 0x326f6 16976: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1697a: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1697e: 84 30 cpi r24, 0x04 ; 4 16980: 08 f0 brcs .+2 ; 0x16984 16982: 3f c0 rjmp .+126 ; 0x16a02 16984: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_STEEL_SHEETS)); 16988: 85 ef ldi r24, 0xF5 ; 245 1698a: 9b e3 ldi r25, 0x3B ; 59 1698c: 0e 94 a7 6c call 0xd94e ; 0xd94e 16990: 0f 94 46 96 call 0x32c8c ; 0x32c8c if(eeprom_is_sheet_initialized(selected_sheet)){ 16994: 80 91 98 03 lds r24, 0x0398 ; 0x800398 16998: 0e 94 0e 6f call 0xde1c ; 0xde1c 1699c: 88 23 and r24, r24 1699e: 41 f0 breq .+16 ; 0x169b0 MENU_ITEM_SUBMENU_P(_T(MSG_SELECT), change_sheet); 169a0: 8c ee ldi r24, 0xEC ; 236 169a2: 9b e3 ldi r25, 0x3B ; 59 169a4: 0e 94 a7 6c call 0xd94e ; 0xd94e 169a8: 66 ed ldi r22, 0xD6 ; 214 169aa: 7b eb ldi r23, 0xBB ; 187 169ac: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 } if (lcd_commands_type == LcdCommands::Idle) 169b0: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 169b4: 81 11 cpse r24, r1 169b6: 08 c0 rjmp .+16 ; 0x169c8 { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), activate_calibrate_sheet); 169b8: 89 ed ldi r24, 0xD9 ; 217 169ba: 9b e3 ldi r25, 0x3B ; 59 169bc: 0e 94 a7 6c call 0xd94e ; 0xd94e 169c0: 63 e4 ldi r22, 0x43 ; 67 169c2: 73 eb ldi r23, 0xB3 ; 179 169c4: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); 169c8: 80 ed ldi r24, 0xD0 ; 208 169ca: 9b e3 ldi r25, 0x3B ; 59 169cc: 0e 94 a7 6c call 0xd94e ; 0xd94e 169d0: 64 e4 ldi r22, 0x44 ; 68 169d2: 7a eb ldi r23, 0xBA ; 186 169d4: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); 169d8: 88 ec ldi r24, 0xC8 ; 200 169da: 9b e3 ldi r25, 0x3B ; 59 169dc: 0e 94 a7 6c call 0xd94e ; 0xd94e 169e0: 6c e3 ldi r22, 0x3C ; 60 169e2: 76 ec ldi r23, 0xC6 ; 198 169e4: 0f 94 f8 92 call 0x325f0 ; 0x325f0 MENU_END(); 169e8: 0f 94 4f 93 call 0x3269e ; 0x3269e lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 169ec: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 169f0: 8f 5f subi r24, 0xFF ; 255 169f2: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 169f6: 80 91 30 04 lds r24, 0x0430 ; 0x800430 169fa: 8f 5f subi r24, 0xFF ; 255 169fc: 80 93 30 04 sts 0x0430, r24 ; 0x800430 16a00: bc cf rjmp .-136 ; 0x1697a } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); MENU_END(); } 16a02: 08 95 ret 00016a04 ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a04: 87 e0 ldi r24, 0x07 ; 7 16a06: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a0a: 0c 94 b9 b4 jmp 0x16972 ; 0x16972 00016a0e ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a0e: 86 e0 ldi r24, 0x06 ; 6 16a10: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a14: 0c 94 b9 b4 jmp 0x16972 ; 0x16972 00016a18 ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a18: 85 e0 ldi r24, 0x05 ; 5 16a1a: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a1e: 0c 94 b9 b4 jmp 0x16972 ; 0x16972 00016a22 ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a22: 84 e0 ldi r24, 0x04 ; 4 16a24: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a28: 0c 94 b9 b4 jmp 0x16972 ; 0x16972 00016a2c ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a2c: 83 e0 ldi r24, 0x03 ; 3 16a2e: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a32: 0c 94 b9 b4 jmp 0x16972 ; 0x16972 00016a36 ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a36: 82 e0 ldi r24, 0x02 ; 2 16a38: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a3c: 0c 94 b9 b4 jmp 0x16972 ; 0x16972 00016a40 ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a40: 81 e0 ldi r24, 0x01 ; 1 16a42: 80 93 98 03 sts 0x0398, r24 ; 0x800398 lcd_sheet_menu(); 16a46: 0c 94 b9 b4 jmp 0x16972 ; 0x16972 00016a4a ()>: } template static void select_sheet_menu() { selected_sheet = number; 16a4a: 10 92 98 03 sts 0x0398, r1 ; 0x800398 lcd_sheet_menu(); 16a4e: 0c 94 b9 b4 jmp 0x16972 ; 0x16972 00016a52 : ++str; } return str; } bool __attribute__((noinline)) Tag(const char *str, const char *tag_P, uint8_t tagSize, uint16_t tagMask, uint16_t *v){ 16a52: cf 92 push r12 16a54: df 92 push r13 16a56: ef 92 push r14 16a58: ff 92 push r15 16a5a: 0f 93 push r16 16a5c: 1f 93 push r17 16a5e: cf 93 push r28 16a60: df 93 push r29 16a62: 6c 01 movw r12, r24 16a64: 79 01 movw r14, r18 if( ! strncmp_P(str, tag_P, tagSize) ){ 16a66: c4 2f mov r28, r20 16a68: d0 e0 ldi r29, 0x00 ; 0 16a6a: ae 01 movw r20, r28 16a6c: 0f 94 7a 9e call 0x33cf4 ; 0x33cf4 16a70: 89 2b or r24, r25 16a72: b9 f4 brne .+46 ; 0x16aa2 Number(str + tagSize, v); 16a74: b8 01 movw r22, r16 16a76: c6 01 movw r24, r12 16a78: 8c 0f add r24, r28 16a7a: 9d 1f adc r25, r29 16a7c: 0e 94 73 b1 call 0x162e6 ; 0x162e6 *v |= tagMask; 16a80: f8 01 movw r30, r16 16a82: 20 81 ld r18, Z 16a84: 31 81 ldd r19, Z+1 ; 0x01 16a86: 2e 29 or r18, r14 16a88: 3f 29 or r19, r15 16a8a: 31 83 std Z+1, r19 ; 0x01 16a8c: 20 83 st Z, r18 return true; 16a8e: 81 e0 ldi r24, 0x01 ; 1 } return false; } 16a90: df 91 pop r29 16a92: cf 91 pop r28 16a94: 1f 91 pop r17 16a96: 0f 91 pop r16 16a98: ff 90 pop r15 16a9a: ef 90 pop r14 16a9c: df 90 pop r13 16a9e: cf 90 pop r12 16aa0: 08 95 ret if( ! strncmp_P(str, tag_P, tagSize) ){ Number(str + tagSize, v); *v |= tagMask; return true; } return false; 16aa2: 80 e0 ldi r24, 0x00 ; 0 16aa4: f5 cf rjmp .-22 ; 0x16a90 00016aa6 : } 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 16aa6: 41 e0 ldi r20, 0x01 ; 1 16aa8: 61 e0 ldi r22, 0x01 ; 1 16aaa: 80 ec ldi r24, 0xC0 ; 192 16aac: 92 e8 ldi r25, 0x82 ; 130 16aae: 0f 94 8a 2e call 0x25d14 ; 0x25d14 if (disable == LCD_LEFT_BUTTON_CHOICE) 16ab2: 81 11 cpse r24, r1 16ab4: 07 c0 rjmp .+14 ; 0x16ac4 { enquecommand_P(PSTR("G99")); 16ab6: 61 e0 ldi r22, 0x01 ; 1 16ab8: 8c eb ldi r24, 0xBC ; 188 16aba: 92 e8 ldi r25, 0x82 ; 130 16abc: 0e 94 ac 7c call 0xf958 ; 0xf958 lcd_return_to_status(); 16ac0: 0e 94 6d fe call 0x1fcda ; 0x1fcda } lcd_update_enable(true); 16ac4: 81 e0 ldi r24, 0x01 ; 1 16ac6: 0e 94 b6 69 call 0xd36c ; 0xd36c lcd_draw_update = 2; 16aca: 82 e0 ldi r24, 0x02 ; 2 16acc: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } 16ad0: 08 95 ret 00016ad2 : else value = !value; eeprom_update_byte_notify((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, value); } void lcd_reprint_from_eeprom() { 16ad2: ef 92 push r14 16ad4: ff 92 push r15 16ad6: 0f 93 push r16 16ad8: 1f 93 push r17 16ada: cf 93 push r28 16adc: df 93 push r29 16ade: cd b7 in r28, 0x3d ; 61 16ae0: de b7 in r29, 0x3e ; 62 16ae2: 6b 97 sbiw r28, 0x1b ; 27 16ae4: 0f b6 in r0, 0x3f ; 63 16ae6: f8 94 cli 16ae8: de bf out 0x3e, r29 ; 62 16aea: 0f be out 0x3f, r0 ; 63 16aec: 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); 16aee: 8a e5 ldi r24, 0x5A ; 90 16af0: 9f e0 ldi r25, 0x0F ; 15 16af2: 0f 94 9b a0 call 0x34136 ; 0x34136 16af6: e8 2e mov r14, r24 16af8: 0a e0 ldi r16, 0x0A ; 10 16afa: 1f e0 ldi r17, 0x0F ; 15 for (uint8_t i = 0; i < depth; i++) { 16afc: 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); 16afe: 48 e0 ldi r20, 0x08 ; 8 16b00: 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++) { 16b02: ef 14 cp r14, r15 16b04: 79 f0 breq .+30 ; 0x16b24 eeprom_read_block(dir_name, (const char *)EEPROM_DIRS + 8 * i, 8); 16b06: b8 01 movw r22, r16 16b08: ce 01 movw r24, r28 16b0a: 0e 96 adiw r24, 0x0e ; 14 16b0c: 0f 94 8b a0 call 0x34116 ; 0x34116 dir_name[8] = '\0'; 16b10: 1e 8a std Y+22, r1 ; 0x16 card.chdir(dir_name, false); 16b12: 60 e0 ldi r22, 0x00 ; 0 16b14: ce 01 movw r24, r28 16b16: 0e 96 adiw r24, 0x0e ; 14 16b18: 0f 94 8e 4b call 0x2971c ; 0x2971c 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++) { 16b1c: f3 94 inc r15 16b1e: 08 5f subi r16, 0xF8 ; 248 16b20: 1f 4f sbci r17, 0xFF ; 255 16b22: ed cf rjmp .-38 ; 0x16afe 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); 16b24: 65 e9 ldi r22, 0x95 ; 149 16b26: 7f e0 ldi r23, 0x0F ; 15 16b28: 8e 01 movw r16, r28 16b2a: 0f 5f subi r16, 0xFF ; 255 16b2c: 1f 4f sbci r17, 0xFF ; 255 16b2e: c8 01 movw r24, r16 16b30: 0f 94 8b a0 call 0x34116 ; 0x34116 // Add null delimiter in case all 8 characters were not NULL filename[8] = '\0'; 16b34: 19 86 std Y+9, r1 ; 0x09 // Add extension to complete the DOS 8.3 filename e.g. ".gco" or ".g" extension_ptr[0] = '.'; 16b36: 8e e2 ldi r24, 0x2E ; 46 16b38: 8f 8b std Y+23, r24 ; 0x17 eeprom_read_block(&extension_ptr[1], (const char *)EEPROM_FILENAME_EXTENSION, 3); 16b3a: 43 e0 ldi r20, 0x03 ; 3 16b3c: 50 e0 ldi r21, 0x00 ; 0 16b3e: 61 e9 ldi r22, 0x91 ; 145 16b40: 7c e0 ldi r23, 0x0C ; 12 16b42: ce 01 movw r24, r28 16b44: 48 96 adiw r24, 0x18 ; 24 16b46: 0f 94 8b a0 call 0x34116 ; 0x34116 extension_ptr[4] = '\0'; 16b4a: 1b 8e std Y+27, r1 ; 0x1b strcat(filename, extension_ptr); 16b4c: be 01 movw r22, r28 16b4e: 69 5e subi r22, 0xE9 ; 233 16b50: 7f 4f sbci r23, 0xFF ; 255 16b52: c8 01 movw r24, r16 16b54: 0f 94 e7 a6 call 0x34dce ; 0x34dce enquecommandf_P(MSG_M23, filename); 16b58: 1f 93 push r17 16b5a: 0f 93 push r16 16b5c: 89 ee ldi r24, 0xE9 ; 233 16b5e: 9b e6 ldi r25, 0x6B ; 107 16b60: 9f 93 push r25 16b62: 8f 93 push r24 16b64: 0e 94 4a 7d call 0xfa94 ; 0xfa94 restore_file_from_sd(); // M24: Start/resume SD print enquecommand_P(MSG_M24); 16b68: 61 e0 ldi r22, 0x01 ; 1 16b6a: 85 ee ldi r24, 0xE5 ; 229 16b6c: 9b e6 ldi r25, 0x6B ; 107 16b6e: 0e 94 ac 7c call 0xf958 ; 0xf958 lcd_return_to_status(); 16b72: 0e 94 6d fe call 0x1fcda ; 0x1fcda 16b76: 0f 90 pop r0 16b78: 0f 90 pop r0 16b7a: 0f 90 pop r0 16b7c: 0f 90 pop r0 } 16b7e: 6b 96 adiw r28, 0x1b ; 27 16b80: 0f b6 in r0, 0x3f ; 63 16b82: f8 94 cli 16b84: de bf out 0x3e, r29 ; 62 16b86: 0f be out 0x3f, r0 ; 63 16b88: cd bf out 0x3d, r28 ; 61 16b8a: df 91 pop r29 16b8c: cf 91 pop r28 16b8e: 1f 91 pop r17 16b90: 0f 91 pop r16 16b92: ff 90 pop r15 16b94: ef 90 pop r14 16b96: 08 95 ret 00016b98 : MENU_END(); } #ifdef PINDA_TEMP_COMP void lcd_pinda_temp_compensation_toggle() { 16b98: cf 93 push r28 uint8_t pinda_temp_compensation = eeprom_read_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION); 16b9a: 89 e2 ldi r24, 0x29 ; 41 16b9c: 9d e0 ldi r25, 0x0D ; 13 16b9e: 0f 94 9b a0 call 0x34136 ; 0x34136 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; 16ba2: 81 50 subi r24, 0x01 ; 1 16ba4: c1 e0 ldi r28, 0x01 ; 1 16ba6: 8e 3f cpi r24, 0xFE ; 254 16ba8: 08 f4 brcc .+2 ; 0x16bac 16baa: c0 e0 ldi r28, 0x00 ; 0 16bac: 6c 2f mov r22, r28 16bae: 89 e2 ldi r24, 0x29 ; 41 16bb0: 9d e0 ldi r25, 0x0D ; 13 16bb2: 0f 94 bf a0 call 0x3417e ; 0x3417e eeprom_update_byte_notify((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION, pinda_temp_compensation); SERIAL_ECHOLNPGM("SuperPINDA:"); 16bb6: 80 e3 ldi r24, 0x30 ; 48 16bb8: 93 e8 ldi r25, 0x83 ; 131 16bba: 0e 94 49 72 call 0xe492 ; 0xe492 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 16bbe: 8c 2f mov r24, r28 16bc0: 0e 94 37 70 call 0xe06e ; 0xe06e SERIAL_ECHOLN(pinda_temp_compensation); } 16bc4: cf 91 pop r28 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 16bc6: 0d 94 bb 98 jmp 0x33176 ; 0x33176 00016bca : { return lcd_status_message_level; } void menu_lcd_longpress_func(void) { 16bca: cf 93 push r28 16bcc: df 93 push r29 // Wake up the LCD backlight and, // start LCD inactivity timer lcd_timeoutToStatus.start(); 16bce: 81 eb ldi r24, 0xB1 ; 177 16bd0: 93 e0 ldi r25, 0x03 ; 3 16bd2: 0f 94 29 12 call 0x22452 ; 0x22452 ::start()> if (homing_flag || mesh_bed_leveling_flag || menu_menu == lcd_babystep_z || menu_menu == lcd_move_z || menu_is_any_block() || Stopped) 16bd6: 80 91 05 12 lds r24, 0x1205 ; 0x801205 16bda: 81 11 cpse r24, r1 16bdc: 18 c0 rjmp .+48 ; 0x16c0e 16bde: 80 91 06 12 lds r24, 0x1206 ; 0x801206 16be2: 81 11 cpse r24, r1 16be4: 14 c0 rjmp .+40 ; 0x16c0e 16be6: c0 91 d0 03 lds r28, 0x03D0 ; 0x8003d0 16bea: d0 91 d1 03 lds r29, 0x03D1 ; 0x8003d1 16bee: 87 e3 ldi r24, 0x37 ; 55 16bf0: cd 3d cpi r28, 0xDD ; 221 16bf2: d8 07 cpc r29, r24 16bf4: 61 f0 breq .+24 ; 0x16c0e 16bf6: 86 e3 ldi r24, 0x36 ; 54 16bf8: cf 3b cpi r28, 0xBF ; 191 16bfa: d8 07 cpc r29, r24 16bfc: 41 f0 breq .+16 ; 0x16c0e 16bfe: 80 91 cd 11 lds r24, 0x11CD ; 0x8011cd 16c02: 81 11 cpse r24, r1 16c04: 04 c0 rjmp .+8 ; 0x16c0e 16c06: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 16c0a: 88 23 and r24, r24 16c0c: 31 f0 breq .+12 ; 0x16c1a { // disable longpress during re-entry, while homing, calibration or if a serious error lcd_draw_update = 2; 16c0e: 82 e0 ldi r24, 0x02 ; 2 16c10: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 16c14: df 91 pop r29 16c16: cf 91 pop r28 16c18: 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) 16c1a: 83 eb ldi r24, 0xB3 ; 179 16c1c: c2 3b cpi r28, 0xB2 ; 178 16c1e: d8 07 cpc r29, r24 16c20: 81 f4 brne .+32 ; 0x16c42 { // only toggle the experimental menu visibility flag lcd_draw_update = 2; 16c22: 82 e0 ldi r24, 0x02 ; 2 16c24: 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)); 16c28: 8a e2 ldi r24, 0x2A ; 42 16c2a: 9d e0 ldi r25, 0x0D ; 13 16c2c: 0f 94 9b a0 call 0x34136 ; 0x34136 16c30: 61 e0 ldi r22, 0x01 ; 1 16c32: 81 11 cpse r24, r1 16c34: 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); 16c36: 8a e2 ldi r24, 0x2A ; 42 16c38: 9d e0 ldi r25, 0x0D ; 13 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 16c3a: df 91 pop r29 16c3c: cf 91 pop r28 16c3e: 0d 94 e3 a0 jmp 0x341c6 ; 0x341c6 16c42: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 16c46: 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 16c4a: 98 13 cpse r25, r24 16c4c: 04 c0 rjmp .+8 ; 0x16c56 16c4e: 0e 94 be 60 call 0xc17c ; 0xc17c 16c52: 88 23 and r24, r24 16c54: 61 f0 breq .+24 ; 0x16c6e if ( babystep_allowed_strict() 16c56: 0e 94 f9 60 call 0xc1f2 ; 0xc1f2 && (menu_menu == lcd_status_screen // and in listed menus... 16c5a: 81 11 cpse r24, r1 16c5c: 10 c0 rjmp .+32 ; 0x16c7e Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } void lcd_quick_feedback(void) { lcd_draw_update = 2; 16c5e: 82 e0 ldi r24, 0x02 ; 2 16c60: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 16c64: 80 e0 ldi r24, 0x00 ; 0 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 16c66: df 91 pop r29 16c68: cf 91 pop r28 16c6a: 0d 94 2b 2d jmp 0x25a56 ; 0x25a56 menu_submenu(lcd_babystep_z); } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen 16c6e: 87 e3 ldi r24, 0x37 ; 55 16c70: c5 31 cpi r28, 0x15 ; 21 16c72: d8 07 cpc r29, r24 16c74: e1 f4 brne .+56 ; 0x16cae #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 16c76: 60 e0 ldi r22, 0x00 ; 0 16c78: 8f eb ldi r24, 0xBF ; 191 16c7a: 96 e3 ldi r25, 0x36 ; 54 16c7c: 14 c0 rjmp .+40 ; 0x16ca6 // 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... 16c7e: 87 e3 ldi r24, 0x37 ; 55 16c80: c5 31 cpi r28, 0x15 ; 21 16c82: d8 07 cpc r29, r24 16c84: 59 f0 breq .+22 ; 0x16c9c || menu_menu == lcd_main_menu 16c86: 83 ec ldi r24, 0xC3 ; 195 16c88: cf 3f cpi r28, 0xFF ; 255 16c8a: d8 07 cpc r29, r24 16c8c: 39 f0 breq .+14 ; 0x16c9c || menu_menu == lcd_tune_menu 16c8e: 86 eb ldi r24, 0xB6 ; 182 16c90: c4 39 cpi r28, 0x94 ; 148 16c92: d8 07 cpc r29, r24 16c94: 19 f0 breq .+6 ; 0x16c9c || menu_menu == lcd_support_menu 16c96: c1 5c subi r28, 0xC1 ; 193 16c98: d6 43 sbci r29, 0x36 ; 54 16c9a: 09 f7 brne .-62 ; 0x16c5e ) ){ lcd_clear(); 16c9c: 0e 94 a4 69 call 0xd348 ; 0xd348 menu_submenu(lcd_babystep_z); 16ca0: 60 e0 ldi r22, 0x00 ; 0 16ca2: 8d ed ldi r24, 0xDD ; 221 16ca4: 97 e3 ldi r25, 0x37 ; 55 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 16ca6: df 91 pop r29 16ca8: cf 91 pop r28 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 16caa: 0d 94 e8 94 jmp 0x329d0 ; 0x329d0 } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen || menu_menu == lcd_main_menu 16cae: 83 ec ldi r24, 0xC3 ; 195 16cb0: cf 3f cpi r28, 0xFF ; 255 16cb2: d8 07 cpc r29, r24 16cb4: 01 f3 breq .-64 ; 0x16c76 || menu_menu == lcd_preheat_menu 16cb6: 88 e3 ldi r24, 0x38 ; 56 16cb8: cb 38 cpi r28, 0x8B ; 139 16cba: d8 07 cpc r29, r24 16cbc: e1 f2 breq .-72 ; 0x16c76 || menu_menu == lcd_sdcard_menu 16cbe: 8c ee ldi r24, 0xEC ; 236 16cc0: c6 36 cpi r28, 0x66 ; 102 16cc2: d8 07 cpc r29, r24 16cc4: c1 f2 breq .-80 ; 0x16c76 || menu_menu == lcd_settings_menu 16cc6: 87 eb ldi r24, 0xB7 ; 183 16cc8: c2 35 cpi r28, 0x52 ; 82 16cca: d8 07 cpc r29, r24 16ccc: a1 f2 breq .-88 ; 0x16c76 || menu_menu == lcd_control_temperature_menu 16cce: 86 eb ldi r24, 0xB6 ; 182 16cd0: c4 37 cpi r28, 0x74 ; 116 16cd2: d8 07 cpc r29, r24 16cd4: 81 f2 breq .-96 ; 0x16c76 #if (LANG_MODE != 0) || menu_menu == lcd_language 16cd6: 8e ef ldi r24, 0xFE ; 254 16cd8: ce 37 cpi r28, 0x7E ; 126 16cda: d8 07 cpc r29, r24 16cdc: 61 f2 breq .-104 ; 0x16c76 #endif || menu_menu == lcd_support_menu 16cde: c1 5c subi r28, 0xC1 ; 193 16ce0: d6 43 sbci r29, 0x36 ; 54 16ce2: 09 f0 breq .+2 ; 0x16ce6 16ce4: bc cf rjmp .-136 ; 0x16c5e 16ce6: c7 cf rjmp .-114 ; 0x16c76 00016ce8 : } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 16ce8: 0f 94 7b 93 call 0x326f6 ; 0x326f6 16cec: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 16cf0: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16cf4: 84 30 cpi r24, 0x04 ; 4 16cf6: b8 f4 brcc .+46 ; 0x16d26 16cf8: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 16cfc: 87 ea ldi r24, 0xA7 ; 167 16cfe: 9d e3 ldi r25, 0x3D ; 61 16d00: 0e 94 a7 6c call 0xd94e ; 0xd94e 16d04: 0f 94 46 96 call 0x32c8c ; 0x32c8c menuitems_temperature_common(); 16d08: 0f 94 3c 0a call 0x21478 ; 0x21478 MENU_END(); 16d0c: 0f 94 4f 93 call 0x3269e ; 0x3269e } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 16d10: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16d14: 8f 5f subi r24, 0xFF ; 255 16d16: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 16d1a: 80 91 30 04 lds r24, 0x0430 ; 0x800430 16d1e: 8f 5f subi r24, 0xFF ; 255 16d20: 80 93 30 04 sts 0x0430, r24 ; 0x800430 16d24: e5 cf rjmp .-54 ; 0x16cf0 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); menuitems_temperature_common(); MENU_END(); } 16d26: 08 95 ret 00016d28 : #define MENU_ITEM_EDIT_advance_K() do { lcd_advance_K(); } while (0) #endif static void lcd_tune_menu() { 16d28: ef 92 push r14 16d2a: ff 92 push r15 16d2c: 0f 93 push r16 16d2e: 1f 93 push r17 16d30: cf 93 push r28 16d32: df 93 push r29 16d34: 80 91 59 02 lds r24, 0x0259 ; 0x800259 16d38: 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) 16d3c: 20 91 71 03 lds r18, 0x0371 ; 0x800371 16d40: 21 11 cpse r18, r1 16d42: 91 c0 rjmp .+290 ; 0x16e66 { // Menu was entered. Mark the menu as entered and save the current extrudemultiply value. _md->status = 1; 16d44: 21 e0 ldi r18, 0x01 ; 1 16d46: 20 93 71 03 sts 0x0371, r18 ; 0x800371 _md->extrudemultiply = extrudemultiply; 16d4a: 90 93 73 03 sts 0x0373, r25 ; 0x800373 16d4e: 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); 16d52: 8f ef ldi r24, 0xFF ; 255 16d54: 9f e0 ldi r25, 0x0F ; 15 16d56: 0f 94 9b a0 call 0x34136 ; 0x34136 16d5a: 80 93 89 03 sts 0x0389, r24 ; 0x800389 MENU_BEGIN(); 16d5e: 0f 94 7b 93 call 0x326f6 ; 0x326f6 16d62: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 16d66: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16d6a: 84 30 cpi r24, 0x04 ; 4 16d6c: 08 f0 brcs .+2 ; 0x16d70 16d6e: 93 c0 rjmp .+294 ; 0x16e96 16d70: 10 92 31 04 sts 0x0431, r1 ; 0x800431 ON_MENU_LEAVE( 16d74: 0f 94 fb 91 call 0x323f6 ; 0x323f6 16d78: 81 11 cpse r24, r1 16d7a: 0e 94 bb 5e call 0xbd76 ; 0xbd76 refresh_saved_feedrate_multiplier_in_ram(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 16d7e: 88 ef ldi r24, 0xF8 ; 248 16d80: 9d e3 ldi r25, 0x3D ; 61 16d82: 0e 94 a7 6c call 0xd94e ; 0xd94e 16d86: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_EDIT_int3_P(_T(MSG_SPEED), &feedmultiply, 10, 999); 16d8a: 84 e7 ldi r24, 0x74 ; 116 16d8c: 9d e3 ldi r25, 0x3D ; 61 16d8e: 0e 94 a7 6c call 0xd94e ; 0xd94e 16d92: f1 2c mov r15, r1 16d94: e1 2c mov r14, r1 16d96: 07 ee ldi r16, 0xE7 ; 231 16d98: 13 e0 ldi r17, 0x03 ; 3 16d9a: 2a e0 ldi r18, 0x0A ; 10 16d9c: 30 e0 ldi r19, 0x00 ; 0 16d9e: 40 e1 ldi r20, 0x10 ; 16 16da0: 6e e8 ldi r22, 0x8E ; 142 16da2: 72 e0 ldi r23, 0x02 ; 2 16da4: 0f 94 cb 93 call 0x32796 ; 0x32796 menuitems_temperature_common(); 16da8: 0f 94 3c 0a call 0x21478 ; 0x21478 MENU_ITEM_EDIT_int3_P(_T(MSG_FLOW), &extrudemultiply, 10, 999); 16dac: 8d e6 ldi r24, 0x6D ; 109 16dae: 9d e3 ldi r25, 0x3D ; 61 16db0: 0e 94 a7 6c call 0xd94e ; 0xd94e 16db4: 2a e0 ldi r18, 0x0A ; 10 16db6: 30 e0 ldi r19, 0x00 ; 0 16db8: 40 e1 ldi r20, 0x10 ; 16 16dba: 69 e5 ldi r22, 0x59 ; 89 16dbc: 72 e0 ldi r23, 0x02 ; 2 16dbe: 0f 94 cb 93 call 0x32796 ; 0x32796 #ifdef LA_LIVE_K MENU_ITEM_EDIT_advance_K(); #endif #ifdef FILAMENTCHANGEENABLE if (!farm_mode) 16dc2: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 16dc6: 81 11 cpse r24, r1 16dc8: 08 c0 rjmp .+16 ; 0x16dda MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change); 16dca: 8b e5 ldi r24, 0x5B ; 91 16dcc: 9d e3 ldi r25, 0x3D ; 61 16dce: 0e 94 a7 6c call 0xd94e ; 0xd94e 16dd2: 68 e7 ldi r22, 0x78 ; 120 16dd4: 7f ee ldi r23, 0xEF ; 239 16dd6: 0f 94 f8 92 call 0x325f0 ; 0x325f0 #endif if (printingIsPaused()) {// Don't allow rehome if actively printing. Maaaaybe it could work to insert on the fly, seems too risky. 16dda: 0e 94 b3 60 call 0xc166 ; 0xc166 16dde: 88 23 and r24, r24 16de0: 41 f0 breq .+16 ; 0x16df2 MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME),PSTR("G28 XY")); 16de2: 80 e4 ldi r24, 0x40 ; 64 16de4: 98 e4 ldi r25, 0x48 ; 72 16de6: 0e 94 a7 6c call 0xd94e ; 0xd94e 16dea: 63 ed ldi r22, 0xD3 ; 211 16dec: 72 e8 ldi r23, 0x82 ; 130 16dee: 0f 94 71 92 call 0x324e2 ; 0x324e2 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 16df2: 8d e4 ldi r24, 0x4D ; 77 16df4: 9d e3 ldi r25, 0x3D ; 61 16df6: 0e 94 a7 6c call 0xd94e ; 0xd94e 16dfa: 6f e5 ldi r22, 0x5F ; 95 16dfc: 7d ef ldi r23, 0xFD ; 253 16dfe: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 #endif //FILAMENT_SENSOR if (MMU2::mmu2.Enabled()) 16e02: 80 91 94 12 lds r24, 0x1294 ; 0x801294 16e06: 81 30 cpi r24, 0x01 ; 1 16e08: 11 f4 brne .+4 ; 0x16e0e { menuitems_MMU_settings_common(); 16e0a: 0f 94 75 0a call 0x214ea ; 0x214ea } SETTINGS_FANS_CHECK(); 16e0e: 0f 94 22 0a call 0x21444 ; 0x21444 MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { if (!farm_mode) 16e12: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 16e16: 81 11 cpse r24, r1 16e18: 02 c0 rjmp .+4 ; 0x16e1e 16e1a: 0e 94 91 b3 call 0x16722 ; 0x16722 menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 16e1e: 80 91 15 04 lds r24, 0x0415 ; 0x800415 16e22: 82 30 cpi r24, 0x02 ; 2 16e24: 91 f1 breq .+100 ; 0x16e8a 16e26: 83 30 cpi r24, 0x03 ; 3 16e28: 99 f1 breq .+102 ; 0x16e90 16e2a: 81 30 cpi r24, 0x01 ; 1 16e2c: 59 f1 breq .+86 ; 0x16e84 16e2e: 86 e4 ldi r24, 0x46 ; 70 16e30: 9d e3 ldi r25, 0x3D ; 61 16e32: 0e 94 a7 6c call 0xd94e ; 0xd94e 16e36: ec 01 movw r28, r24 16e38: 8e e3 ldi r24, 0x3E ; 62 16e3a: 9d e3 ldi r25, 0x3D ; 61 16e3c: 0e 94 a7 6c call 0xd94e ; 0xd94e 16e40: 22 e0 ldi r18, 0x02 ; 2 16e42: 49 e0 ldi r20, 0x09 ; 9 16e44: 5d ef ldi r21, 0xFD ; 253 16e46: be 01 movw r22, r28 16e48: 0f 94 0a 95 call 0x32a14 ; 0x32a14 if (backlightSupport) { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); 16e4c: 0f 94 4f 93 call 0x3269e ; 0x3269e calculate_extruder_multipliers(); } SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 16e50: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16e54: 8f 5f subi r24, 0xFF ; 255 16e56: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 16e5a: 80 91 30 04 lds r24, 0x0430 ; 0x800430 16e5e: 8f 5f subi r24, 0xFF ; 255 16e60: 80 93 30 04 sts 0x0430, r24 ; 0x800430 16e64: 80 cf rjmp .-256 ; 0x16d66 { // 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) 16e66: 20 91 72 03 lds r18, 0x0372 ; 0x800372 16e6a: 30 91 73 03 lds r19, 0x0373 ; 0x800373 16e6e: 28 17 cp r18, r24 16e70: 39 07 cpc r19, r25 16e72: 09 f4 brne .+2 ; 0x16e76 16e74: 6e cf rjmp .-292 ; 0x16d52 { // extrudemultiply has been changed from the child menu. Apply the new value. _md->extrudemultiply = extrudemultiply; 16e76: 90 93 73 03 sts 0x0373, r25 ; 0x800373 16e7a: 80 93 72 03 sts 0x0372, r24 ; 0x800372 calculate_extruder_multipliers(); 16e7e: 0e 94 c8 5e call 0xbd90 ; 0xbd90 16e82: 67 cf rjmp .-306 ; 0x16d52 menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 16e84: 87 e3 ldi r24, 0x37 ; 55 16e86: 9d e3 ldi r25, 0x3D ; 61 16e88: d4 cf rjmp .-88 ; 0x16e32 16e8a: 88 e2 ldi r24, 0x28 ; 40 16e8c: 90 e4 ldi r25, 0x40 ; 64 16e8e: d1 cf rjmp .-94 ; 0x16e32 16e90: 8e e2 ldi r24, 0x2E ; 46 16e92: 9d e3 ldi r25, 0x3D ; 61 16e94: ce cf rjmp .-100 ; 0x16e32 { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); } 16e96: df 91 pop r29 16e98: cf 91 pop r28 16e9a: 1f 91 pop r17 16e9c: 0f 91 pop r16 16e9e: ff 90 pop r15 16ea0: ef 90 pop r14 16ea2: 08 95 ret 00016ea4 : MENU_END(); } static void lcd_settings_menu() { 16ea4: 1f 93 push r17 16ea6: cf 93 push r28 16ea8: df 93 push r29 SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); 16eaa: 8f ef ldi r24, 0xFF ; 255 16eac: 9f e0 ldi r25, 0x0F ; 15 16eae: 0f 94 9b a0 call 0x34136 ; 0x34136 16eb2: 80 93 89 03 sts 0x0389, r24 ; 0x800389 MENU_BEGIN(); 16eb6: 0f 94 7b 93 call 0x326f6 ; 0x326f6 16eba: 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 16ebe: 11 e0 ldi r17, 0x01 ; 1 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 16ec0: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 16ec4: 84 30 cpi r24, 0x04 ; 4 16ec6: 08 f0 brcs .+2 ; 0x16eca 16ec8: 45 c1 rjmp .+650 ; 0x17154 16eca: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 16ece: 88 ef ldi r24, 0xF8 ; 248 16ed0: 9d e3 ldi r25, 0x3D ; 61 16ed2: 0e 94 a7 6c call 0xd94e ; 0xd94e 16ed6: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_SUBMENU_P(_T(MSG_TEMPERATURE), lcd_control_temperature_menu); 16eda: 87 ed ldi r24, 0xD7 ; 215 16edc: 9a e3 ldi r25, 0x3A ; 58 16ede: 0e 94 a7 6c call 0xd94e ; 0xd94e 16ee2: 64 e7 ldi r22, 0x74 ; 116 16ee4: 76 eb ldi r23, 0xB6 ; 182 16ee6: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 if (!printer_active() || printingIsPaused()) 16eea: 0e 94 0f 61 call 0xc21e ; 0xc21e 16eee: 88 23 and r24, r24 16ef0: 21 f0 breq .+8 ; 0x16efa 16ef2: 0e 94 b3 60 call 0xc166 ; 0xc166 16ef6: 88 23 and r24, r24 16ef8: 81 f0 breq .+32 ; 0x16f1a { MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_AXIS), lcd_move_menu_axis); 16efa: 8b ec ldi r24, 0xCB ; 203 16efc: 9a e3 ldi r25, 0x3A ; 58 16efe: 0e 94 a7 6c call 0xd94e ; 0xd94e 16f02: 64 ec ldi r22, 0xC4 ; 196 16f04: 7e ef ldi r23, 0xFE ; 254 16f06: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 MENU_ITEM_GCODE_P(_T(MSG_DISABLE_STEPPERS), MSG_M84); 16f0a: 88 eb ldi r24, 0xB8 ; 184 16f0c: 9a e3 ldi r25, 0x3A ; 58 16f0e: 0e 94 a7 6c call 0xd94e ; 0xd94e 16f12: 6f ec ldi r22, 0xCF ; 207 16f14: 77 e6 ldi r23, 0x67 ; 103 16f16: 0f 94 71 92 call 0x324e2 ; 0x324e2 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 16f1a: 8d e4 ldi r24, 0x4D ; 77 16f1c: 9d e3 ldi r25, 0x3D ; 61 16f1e: 0e 94 a7 6c call 0xd94e ; 0xd94e 16f22: 6f e5 ldi r22, 0x5F ; 95 16f24: 7d ef ldi r23, 0xFD ; 253 16f26: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 #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); 16f2a: 8c ea ldi r24, 0xAC ; 172 16f2c: 9c e0 ldi r25, 0x0C ; 12 16f2e: 0f 94 9b a0 call 0x34136 ; 0x34136 16f32: 88 23 and r24, r24 16f34: 09 f4 brne .+2 ; 0x16f38 16f36: 91 c0 rjmp .+290 ; 0x1705a 16f38: 8f ea ldi r24, 0xAF ; 175 16f3a: 9a e5 ldi r25, 0x5A ; 90 16f3c: 0e 94 a7 6c call 0xd94e ; 0xd94e 16f40: 22 e0 ldi r18, 0x02 ; 2 16f42: 48 e4 ldi r20, 0x48 ; 72 16f44: 5e ef ldi r21, 0xFE ; 254 16f46: bc 01 movw r22, r24 16f48: 84 eb ldi r24, 0xB4 ; 180 16f4a: 92 e8 ldi r25, 0x82 ; 130 16f4c: 0f 94 0a 95 call 0x32a14 ; 0x32a14 if (eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED)) 16f50: 8c ea ldi r24, 0xAC ; 172 16f52: 9c e0 ldi r25, 0x0C ; 12 16f54: 0f 94 9b a0 call 0x34136 ; 0x34136 16f58: 88 23 and r24, r24 16f5a: 31 f0 breq .+12 ; 0x16f68 { // Communication with MMU not required to reset MMU MENU_ITEM_FUNCTION_P(PSTR("Reset MMU"), []() { MMU2::mmu2.Reset(MMU2::MMU2::ResetForm::Software); }); 16f5c: 65 e9 ldi r22, 0x95 ; 149 16f5e: 7c eb ldi r23, 0xBC ; 188 16f60: 8a ea ldi r24, 0xAA ; 170 16f62: 92 e8 ldi r25, 0x82 ; 130 16f64: 0f 94 f8 92 call 0x325f0 ; 0x325f0 } if (MMU2::mmu2.Enabled()) 16f68: 80 91 94 12 lds r24, 0x1294 ; 0x801294 16f6c: 81 30 cpi r24, 0x01 ; 1 16f6e: 51 f4 brne .+20 ; 0x16f84 { // Only show menus when communicating with MMU menuitems_MMU_settings_common(); 16f70: 0f 94 75 0a call 0x214ea ; 0x214ea MENU_ITEM_SUBMENU_P(_T(MSG_LOADING_TEST), lcd_mmuLoadingTest); 16f74: 89 ea ldi r24, 0xA9 ; 169 16f76: 9a e3 ldi r25, 0x3A ; 58 16f78: 0e 94 a7 6c call 0xd94e ; 0xd94e 16f7c: 63 ed ldi r22, 0xD3 ; 211 16f7e: 7b eb ldi r23, 0xBB ; 187 16f80: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 } SETTINGS_FANS_CHECK(); 16f84: 0f 94 22 0a call 0x21444 ; 0x21444 MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { if (!farm_mode) 16f88: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 16f8c: 81 11 cpse r24, r1 16f8e: 02 c0 rjmp .+4 ; 0x16f94 16f90: 0e 94 91 b3 call 0x16722 ; 0x16722 } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); if(!farm_mode) 16f94: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 16f98: 81 11 cpse r24, r1 16f9a: 62 c0 rjmp .+196 ; 0x17060 { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 16f9c: 10 93 ba 03 sts 0x03BA, r17 ; 0x8003ba MENU_ITEM_SUBMENU_P(_T(MSG_HW_SETUP), lcd_hw_setup_menu); 16fa0: 8e e9 ldi r24, 0x9E ; 158 16fa2: 9a e3 ldi r25, 0x3A ; 58 16fa4: 0e 94 a7 6c call 0xd94e ; 0xd94e 16fa8: 62 eb ldi r22, 0xB2 ; 178 16faa: 73 eb ldi r23, 0xB3 ; 179 16fac: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 } 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); 16fb0: 8d e3 ldi r24, 0x3D ; 61 16fb2: 9b e3 ldi r25, 0x3B ; 59 16fb4: 0e 94 a7 6c call 0xd94e ; 0xd94e 16fb8: 6f ef ldi r22, 0xFF ; 255 16fba: 7a eb ldi r23, 0xBA ; 186 16fbc: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 #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()) 16fc0: 0f 94 3a 15 call 0x22a74 ; 0x22a74 16fc4: 88 23 and r24, r24 16fc6: b1 f0 breq .+44 ; 0x16ff4 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); 16fc8: 8f ea ldi r24, 0xAF ; 175 16fca: 9f e0 ldi r25, 0x0F ; 15 16fcc: 0f 94 9b a0 call 0x34136 ; 0x34136 16fd0: 88 23 and r24, r24 16fd2: 09 f4 brne .+2 ; 0x16fd6 16fd4: 4e c0 rjmp .+156 ; 0x17072 16fd6: 8f ea ldi r24, 0xAF ; 175 16fd8: 9a e5 ldi r25, 0x5A ; 90 16fda: 0e 94 a7 6c call 0xd94e ; 0xd94e 16fde: ec 01 movw r28, r24 16fe0: 85 ee ldi r24, 0xE5 ; 229 16fe2: 9a e3 ldi r25, 0x3A ; 58 16fe4: 0e 94 a7 6c call 0xd94e ; 0xd94e 16fe8: 22 e0 ldi r18, 0x02 ; 2 16fea: 4b e1 ldi r20, 0x1B ; 27 16fec: 5e ef ldi r21, 0xFE ; 254 16fee: be 01 movw r22, r28 16ff0: 0f 94 0a 95 call 0x32a14 ; 0x32a14 #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); 16ff4: 0e 94 b3 60 call 0xc166 ; 0xc166 16ff8: 81 11 cpse r24, r1 16ffa: 08 c0 rjmp .+16 ; 0x1700c 16ffc: 86 e0 ldi r24, 0x06 ; 6 16ffe: 9d e3 ldi r25, 0x3D ; 61 17000: 0e 94 a7 6c call 0xd94e ; 0xd94e 17004: 6d ed ldi r22, 0xDD ; 221 17006: 77 e3 ldi r23, 0x37 ; 55 17008: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 #if (LANG_MODE != 0) MENU_ITEM_SUBMENU_P(_T(MSG_SELECT_LANGUAGE), lcd_language_menu); 1700c: 8c e7 ldi r24, 0x7C ; 124 1700e: 9a e3 ldi r25, 0x3A ; 58 17010: 0e 94 a7 6c call 0xd94e ; 0xd94e 17014: 69 e9 ldi r22, 0x99 ; 153 17016: 78 e3 ldi r23, 0x38 ; 56 17018: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 #endif //(LANG_MODE != 0) if (!farm_mode) { //SD related settings are not available in farm mode 1701c: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 17020: 81 11 cpse r24, r1 17022: 47 c0 rjmp .+142 ; 0x170b2 if (card.ToshibaFlashAir_isEnabled()) 17024: 80 91 db 15 lds r24, 0x15DB ; 0x8015db 17028: 88 23 and r24, r24 1702a: 31 f1 breq .+76 ; 0x17078 MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY, lcd_toshiba_flash_air_compatibility_toggle); 1702c: 82 e7 ldi r24, 0x72 ; 114 1702e: 9a e3 ldi r25, 0x3A ; 58 17030: 0e 94 a7 6c call 0xd94e ; 0xd94e 17034: 22 e0 ldi r18, 0x02 ; 2 17036: 4f ef ldi r20, 0xFF ; 255 17038: 5c ef ldi r21, 0xFC ; 252 1703a: 6e e5 ldi r22, 0x5E ; 94 1703c: 77 e6 ldi r23, 0x67 ; 103 else MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle); 1703e: 0f 94 0a 95 call 0x32a14 ; 0x32a14 #ifdef SDCARD_SORT_ALPHA switch (eeprom_read_byte((uint8_t*) EEPROM_SD_SORT)) { 17042: 89 e0 ldi r24, 0x09 ; 9 17044: 9f e0 ldi r25, 0x0F ; 15 17046: 0f 94 9b a0 call 0x34136 ; 0x34136 1704a: 88 23 and r24, r24 1704c: 19 f1 breq .+70 ; 0x17094 1704e: 81 30 cpi r24, 0x01 ; 1 17050: 09 f4 brne .+2 ; 0x17054 17052: 71 c0 rjmp .+226 ; 0x17136 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); 17054: 85 e5 ldi r24, 0x55 ; 85 17056: 90 e4 ldi r25, 0x40 ; 64 17058: 1f c0 rjmp .+62 ; 0x17098 #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); 1705a: 89 ea ldi r24, 0xA9 ; 169 1705c: 9a e5 ldi r25, 0x5A ; 90 1705e: 6e cf rjmp .-292 ; 0x16f3c 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); 17060: 8e e8 ldi r24, 0x8E ; 142 17062: 9a e3 ldi r25, 0x3A ; 58 17064: 0e 94 a7 6c call 0xd94e ; 0xd94e 17068: 6a e1 ldi r22, 0x1A ; 26 1706a: 76 ec ldi r23, 0xC6 ; 198 1706c: 0f 94 f8 92 call 0x325f0 ; 0x325f0 17070: 9f cf rjmp .-194 ; 0x16fb0 #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); 17072: 89 ea ldi r24, 0xA9 ; 169 17074: 9a e5 ldi r25, 0x5A ; 90 17076: b1 cf rjmp .-158 ; 0x16fda 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); 17078: 89 e6 ldi r24, 0x69 ; 105 1707a: 9a e3 ldi r25, 0x3A ; 58 1707c: 0e 94 a7 6c call 0xd94e ; 0xd94e 17080: ec 01 movw r28, r24 17082: 82 e7 ldi r24, 0x72 ; 114 17084: 9a e3 ldi r25, 0x3A ; 58 17086: 0e 94 a7 6c call 0xd94e ; 0xd94e 1708a: 22 e0 ldi r18, 0x02 ; 2 1708c: 4f ef ldi r20, 0xFF ; 255 1708e: 5c ef ldi r21, 0xFC ; 252 17090: be 01 movw r22, r28 17092: d5 cf rjmp .-86 ; 0x1703e #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; 17094: 82 e6 ldi r24, 0x62 ; 98 17096: 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); 17098: 0e 94 a7 6c call 0xd94e ; 0xd94e 1709c: ec 01 movw r28, r24 1709e: 8b e5 ldi r24, 0x5B ; 91 170a0: 9a e3 ldi r25, 0x3A ; 58 170a2: 0e 94 a7 6c call 0xd94e ; 0xd94e 170a6: 22 e0 ldi r18, 0x02 ; 2 170a8: 46 e2 ldi r20, 0x26 ; 38 170aa: 5e ef ldi r21, 0xFE ; 254 170ac: be 01 movw r22, r28 170ae: 0f 94 0a 95 call 0x32a14 ; 0x32a14 } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 170b2: 80 91 15 04 lds r24, 0x0415 ; 0x800415 170b6: 82 30 cpi r24, 0x02 ; 2 170b8: 09 f4 brne .+2 ; 0x170bc 170ba: 43 c0 rjmp .+134 ; 0x17142 170bc: 83 30 cpi r24, 0x03 ; 3 170be: 09 f4 brne .+2 ; 0x170c2 170c0: 43 c0 rjmp .+134 ; 0x17148 170c2: 81 30 cpi r24, 0x01 ; 1 170c4: d9 f1 breq .+118 ; 0x1713c 170c6: 86 e4 ldi r24, 0x46 ; 70 170c8: 9d e3 ldi r25, 0x3D ; 61 170ca: 0e 94 a7 6c call 0xd94e ; 0xd94e 170ce: ec 01 movw r28, r24 170d0: 8e e3 ldi r24, 0x3E ; 62 170d2: 9d e3 ldi r25, 0x3D ; 61 170d4: 0e 94 a7 6c call 0xd94e ; 0xd94e 170d8: 22 e0 ldi r18, 0x02 ; 2 170da: 49 e0 ldi r20, 0x09 ; 9 170dc: 5d ef ldi r21, 0xFD ; 253 170de: be 01 movw r22, r28 170e0: 0f 94 0a 95 call 0x32a14 ; 0x32a14 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 170e4: 87 ea ldi r24, 0xA7 ; 167 170e6: 9c e0 ldi r25, 0x0C ; 12 170e8: 0f 94 9b a0 call 0x34136 ; 0x34136 170ec: 88 23 and r24, r24 170ee: 79 f1 breq .+94 ; 0x1714e 170f0: 82 eb ldi r24, 0xB2 ; 178 170f2: 9d e3 ldi r25, 0x3D ; 61 170f4: 0e 94 a7 6c call 0xd94e ; 0xd94e 170f8: 22 e0 ldi r18, 0x02 ; 2 170fa: 41 e1 ldi r20, 0x11 ; 17 170fc: 53 eb ldi r21, 0xB3 ; 179 170fe: bc 01 movw r22, r24 17100: 81 e5 ldi r24, 0x51 ; 81 17102: 97 e6 ldi r25, 0x67 ; 103 17104: 0f 94 0a 95 call 0x32a14 ; 0x32a14 if (farm_mode) 17108: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1710c: 88 23 and r24, r24 1710e: 31 f0 breq .+12 ; 0x1711c { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); 17110: 63 e5 ldi r22, 0x53 ; 83 17112: 75 eb ldi r23, 0xB5 ; 181 17114: 88 e9 ldi r24, 0x98 ; 152 17116: 92 e8 ldi r25, 0x82 ; 130 17118: 0f 94 f8 92 call 0x325f0 ; 0x325f0 } MENU_END(); 1711c: 0f 94 4f 93 call 0x3269e ; 0x3269e } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 17120: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17124: 8f 5f subi r24, 0xFF ; 255 17126: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1712a: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1712e: 8f 5f subi r24, 0xFF ; 255 17130: 80 93 30 04 sts 0x0430, r24 ; 0x800430 17134: c5 ce rjmp .-630 ; 0x16ec0 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; 17136: 80 e5 ldi r24, 0x50 ; 80 17138: 9a e3 ldi r25, 0x3A ; 58 1713a: ae cf rjmp .-164 ; 0x17098 default: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_NONE), lcd_sort_type_set); } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 1713c: 87 e3 ldi r24, 0x37 ; 55 1713e: 9d e3 ldi r25, 0x3D ; 61 17140: c4 cf rjmp .-120 ; 0x170ca 17142: 88 e2 ldi r24, 0x28 ; 40 17144: 90 e4 ldi r25, 0x40 ; 64 17146: c1 cf rjmp .-126 ; 0x170ca 17148: 8e e2 ldi r24, 0x2E ; 46 1714a: 9d e3 ldi r25, 0x3D ; 61 1714c: be cf rjmp .-132 ; 0x170ca 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 1714e: 88 eb ldi r24, 0xB8 ; 184 17150: 9d e3 ldi r25, 0x3D ; 61 17152: d0 cf rjmp .-96 ; 0x170f4 { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); } 17154: df 91 pop r29 17156: cf 91 pop r28 17158: 1f 91 pop r17 1715a: 08 95 ret 0001715c : } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1715c: 0f 94 7b 93 call 0x326f6 ; 0x326f6 17160: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 17164: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17168: 84 30 cpi r24, 0x04 ; 4 1716a: 08 f0 brcs .+2 ; 0x1716e 1716c: 7d c0 rjmp .+250 ; 0x17268 1716e: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 17172: 88 ef ldi r24, 0xF8 ; 248 17174: 9d e3 ldi r25, 0x3D ; 61 17176: 0e 94 a7 6c call 0xd94e ; 0xd94e 1717a: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_FUNCTION_P(_T(MSG_WIZARD), lcd_wizard); 1717e: 8a e7 ldi r24, 0x7A ; 122 17180: 9b e3 ldi r25, 0x3B ; 59 17182: 0e 94 a7 6c call 0xd94e ; 0xd94e 17186: 6f e4 ldi r22, 0x4F ; 79 17188: 77 e3 ldi r23, 0x37 ; 55 1718a: 0f 94 f8 92 call 0x325f0 ; 0x325f0 if (lcd_commands_type == LcdCommands::Idle) 1718e: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 17192: 81 11 cpse r24, r1 17194: 08 c0 rjmp .+16 ; 0x171a6 { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_first_layer_calibration_reset); 17196: 89 ed ldi r24, 0xD9 ; 217 17198: 9b e3 ldi r25, 0x3B ; 59 1719a: 0e 94 a7 6c call 0xd94e ; 0xd94e 1719e: 6f e3 ldi r22, 0x3F ; 63 171a0: 77 e3 ldi r23, 0x37 ; 55 171a2: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 } MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME), G28W); 171a6: 80 e4 ldi r24, 0x40 ; 64 171a8: 98 e4 ldi r25, 0x48 ; 72 171aa: 0e 94 a7 6c call 0xd94e ; 0xd94e 171ae: 62 e1 ldi r22, 0x12 ; 18 171b0: 78 e6 ldi r23, 0x68 ; 104 171b2: 0f 94 71 92 call 0x324e2 ; 0x324e2 #ifdef TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_BELTTEST), lcd_belttest_v); #endif //TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_SELFTEST), lcd_selftest_v); 171b6: 8f e6 ldi r24, 0x6F ; 111 171b8: 9b e3 ldi r25, 0x3B ; 59 171ba: 0e 94 a7 6c call 0xd94e ; 0xd94e 171be: 64 e0 ldi r22, 0x04 ; 4 171c0: 77 ef ldi r23, 0xF7 ; 247 171c2: 0f 94 f8 92 call 0x325f0 ; 0x325f0 // MK2 MENU_ITEM_FUNCTION_P(_T(MSG_CALIBRATE_BED), lcd_mesh_calibration); 171c6: 8f e5 ldi r24, 0x5F ; 95 171c8: 9b e3 ldi r25, 0x3B ; 59 171ca: 0e 94 a7 6c call 0xd94e ; 0xd94e 171ce: 66 eb ldi r22, 0xB6 ; 182 171d0: 7e ef ldi r23, 0xFE ; 254 171d2: 0f 94 f8 92 call 0x325f0 ; 0x325f0 // "Calibrate Z" with storing the reference values to EEPROM. MENU_ITEM_FUNCTION_P(_T(MSG_HOMEYZ), lcd_mesh_calibration_z); 171d6: 81 e5 ldi r24, 0x51 ; 81 171d8: 9b e3 ldi r25, 0x3B ; 59 171da: 0e 94 a7 6c call 0xd94e ; 0xd94e 171de: 6f ea ldi r22, 0xAF ; 175 171e0: 7e ef ldi r23, 0xFE ; 254 171e2: 0f 94 f8 92 call 0x325f0 ; 0x325f0 MENU_ITEM_SUBMENU_P(_T(MSG_MESH_BED_LEVELING), lcd_mesh_bedleveling); ////MSG_MESH_BED_LEVELING c=18 171e6: 8d e3 ldi r24, 0x3D ; 61 171e8: 9b e3 ldi r25, 0x3B ; 59 171ea: 0e 94 a7 6c call 0xd94e ; 0xd94e 171ee: 6d eb ldi r22, 0xBD ; 189 171f0: 7e ef ldi r23, 0xFE ; 254 171f2: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 MENU_ITEM_SUBMENU_P(_T(MSG_BED_CORRECTION_MENU), lcd_adjust_bed); 171f6: 89 e2 ldi r24, 0x29 ; 41 171f8: 9b e3 ldi r25, 0x3B ; 59 171fa: 0e 94 a7 6c call 0xd94e ; 0xd94e 171fe: 68 e3 ldi r22, 0x38 ; 56 17200: 7f ef ldi r23, 0xFF ; 255 17202: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 MENU_ITEM_SUBMENU_P(_T(MSG_PID_EXTRUDER), pid_extruder); 17206: 87 e1 ldi r24, 0x17 ; 23 17208: 9b e3 ldi r25, 0x3B ; 59 1720a: 0e 94 a7 6c call 0xd94e ; 0xd94e 1720e: 61 ef ldi r22, 0xF1 ; 241 17210: 7f ef ldi r23, 0xFF ; 255 17212: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 #ifndef TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_SHOW_END_STOPS), menu_show_end_stops); 17216: 86 e0 ldi r24, 0x06 ; 6 17218: 9b e3 ldi r25, 0x3B ; 59 1721a: 0e 94 a7 6c call 0xd94e ; 0xd94e 1721e: 67 e8 ldi r22, 0x87 ; 135 17220: 77 e3 ldi r23, 0x37 ; 55 17222: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 #endif MENU_ITEM_GCODE_P(_T(MSG_CALIBRATE_BED_RESET), PSTR("M44")); 17226: 82 ef ldi r24, 0xF2 ; 242 17228: 9a e3 ldi r25, 0x3A ; 58 1722a: 0e 94 a7 6c call 0xd94e ; 0xd94e 1722e: 68 eb ldi r22, 0xB8 ; 184 17230: 72 e8 ldi r23, 0x82 ; 130 17232: 0f 94 71 92 call 0x324e2 ; 0x324e2 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 17236: 0f 94 3a 15 call 0x22a74 ; 0x22a74 1723a: 88 23 and r24, r24 1723c: 41 f0 breq .+16 ; 0x1724e MENU_ITEM_FUNCTION_P(_T(MSG_PINDA_CALIBRATION), lcd_calibrate_pinda); 1723e: 85 ee ldi r24, 0xE5 ; 229 17240: 9a e3 ldi r25, 0x3A ; 58 17242: 0e 94 a7 6c call 0xd94e ; 0xd94e 17246: 68 ea ldi r22, 0xA8 ; 168 17248: 7e ef ldi r23, 0xFE ; 254 1724a: 0f 94 f8 92 call 0x325f0 ; 0x325f0 #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); 1724e: 0f 94 4f 93 call 0x3269e ; 0x3269e } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 17252: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17256: 8f 5f subi r24, 0xFF ; 255 17258: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1725c: 80 91 30 04 lds r24, 0x0430 ; 0x800430 17260: 8f 5f subi r24, 0xFF ; 255 17262: 80 93 30 04 sts 0x0430, r24 ; 0x800430 17266: 7e cf rjmp .-260 ; 0x17164 #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); } 17268: 08 95 ret 0001726a : } #endif //FANCHECK static uint8_t lcd_selftest_screen(TestScreen screen, uint8_t _progress, uint8_t _progress_scale, bool _clear, uint16_t _delay) { 1726a: bf 92 push r11 1726c: cf 92 push r12 1726e: df 92 push r13 17270: ef 92 push r14 17272: ff 92 push r15 17274: 0f 93 push r16 17276: 1f 93 push r17 17278: cf 93 push r28 1727a: df 93 push r29 1727c: c8 2f mov r28, r24 1727e: f6 2e mov r15, r22 17280: e4 2e mov r14, r20 17282: b2 2e mov r11, r18 17284: 68 01 movw r12, r16 lcd_update_enable(false); 17286: 80 e0 ldi r24, 0x00 ; 0 17288: 0e 94 b6 69 call 0xd36c ; 0xd36c const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; 1728c: dc e7 ldi r29, 0x7C ; 124 1728e: fe 14 cp r15, r14 17290: 08 f0 brcs .+2 ; 0x17294 17292: dd e2 ldi r29, 0x2D ; 45 if (_clear) 17294: bb 20 and r11, r11 17296: 09 f1 breq .+66 ; 0x172da lcd_clear(); 17298: 0e 94 a4 69 call 0xd348 ; 0xd348 else lcd_home(); if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1729c: c1 11 cpse r28, r1 1729e: 20 c0 rjmp .+64 ; 0x172e0 if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 172a0: 8c ee ldi r24, 0xEC ; 236 172a2: 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)); 172a4: 0e 94 a7 6c call 0xd94e ; 0xd94e 172a8: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 if (screen == TestScreen::Hotend || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 172ac: 88 ef ldi r24, 0xF8 ; 248 172ae: 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 172b0: 82 30 cpi r24, 0x02 ; 2 172b2: 78 f5 brcc .+94 ; 0x17312 || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 172b4: 8a e9 ldi r24, 0x9A ; 154 172b6: 9f e3 ldi r25, 0x3F ; 63 172b8: 0e 94 a7 6c call 0xd94e ; 0xd94e 172bc: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 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)); 172c0: 89 e7 ldi r24, 0x79 ; 121 172c2: 9f e3 ldi r25, 0x3F ; 63 172c4: cc 30 cpi r28, 0x0C ; 12 172c6: 49 f1 breq .+82 ; 0x1731a if (screen == TestScreen::Failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED)); 172c8: 87 e6 ldi r24, 0x67 ; 103 172ca: 9f e3 ldi r25, 0x3F ; 63 172cc: cd 30 cpi r28, 0x0D ; 13 172ce: 29 f1 breq .+74 ; 0x1731a if (screen == TestScreen::Home) lcd_puts_P(_T(MSG_CALIBRATING_HOME)); 172d0: ce 30 cpi r28, 0x0E ; 14 172d2: 39 f5 brne .+78 ; 0x17322 172d4: 84 e5 ldi r24, 0x54 ; 84 172d6: 9f e3 ldi r25, 0x3F ; 63 172d8: 20 c0 rjmp .+64 ; 0x1731a lcd_update_enable(false); const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; if (_clear) lcd_clear(); else lcd_home(); 172da: 0e 94 9d 69 call 0xd33a ; 0xd33a 172de: de cf rjmp .-68 ; 0x1729c if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 172e0: c1 30 cpi r28, 0x01 ; 1 172e2: f1 f2 breq .-68 ; 0x172a0 if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 172e4: c2 30 cpi r28, 0x02 ; 2 172e6: e1 f2 breq .-72 ; 0x172a0 if (screen == TestScreen::EndStops) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ENDSTOPS)); 172e8: 81 ef ldi r24, 0xF1 ; 241 172ea: 9f e3 ldi r25, 0x3F ; 63 172ec: c3 30 cpi r28, 0x03 ; 3 172ee: d1 f2 breq .-76 ; 0x172a4 if (screen == TestScreen::AxisX) lcd_puts_P(_T(MSG_CHECKING_X)); 172f0: 8f ed ldi r24, 0xDF ; 223 172f2: 9f e3 ldi r25, 0x3F ; 63 172f4: c4 30 cpi r28, 0x04 ; 4 172f6: b1 f2 breq .-84 ; 0x172a4 if (screen == TestScreen::AxisY) lcd_puts_P(_T(MSG_CHECKING_Y)); 172f8: 8d ec ldi r24, 0xCD ; 205 172fa: 9f e3 ldi r25, 0x3F ; 63 172fc: c5 30 cpi r28, 0x05 ; 5 172fe: 91 f2 breq .-92 ; 0x172a4 if (screen == TestScreen::AxisZ) lcd_puts_P(_T(MSG_SELFTEST_CHECK_Z)); 17300: 8b eb ldi r24, 0xBB ; 187 17302: 9f e3 ldi r25, 0x3F ; 63 17304: c6 30 cpi r28, 0x06 ; 6 17306: 71 f2 breq .-100 ; 0x172a4 if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED)); 17308: c7 30 cpi r28, 0x07 ; 7 1730a: 81 f6 brne .-96 ; 0x172ac 1730c: 8c ea ldi r24, 0xAC ; 172 1730e: 9f e3 ldi r25, 0x3F ; 63 17310: c9 cf rjmp .-110 ; 0x172a4 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)); 17312: ca 30 cpi r28, 0x0A ; 10 17314: 99 f5 brne .+102 ; 0x1737c if (screen == TestScreen::FsensorOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); 17316: 87 e8 ldi r24, 0x87 ; 135 17318: 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)); 1731a: 0e 94 a7 6c call 0xd94e ; 0xd94e 1731e: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 lcd_puts_at_P(0, 1, STR_SEPARATOR); 17322: 4b e1 ldi r20, 0x1B ; 27 17324: 53 e8 ldi r21, 0x83 ; 131 17326: 61 e0 ldi r22, 0x01 ; 1 17328: 80 e0 ldi r24, 0x00 ; 0 1732a: 0e 94 85 69 call 0xd30a ; 0xd30a if ((screen >= TestScreen::ExtruderFan) && (screen <= TestScreen::FansOk)) 1732e: c3 30 cpi r28, 0x03 ; 3 17330: 70 f5 brcc .+92 ; 0x1738e { //SERIAL_ECHOLNPGM("Fan test"); lcd_puts_at_P(0, 2, _T(MSG_HOTEND_FAN_SPEED)); 17332: 86 e4 ldi r24, 0x46 ; 70 17334: 9f e3 ldi r25, 0x3F ; 63 17336: 0e 94 a7 6c call 0xd94e ; 0xd94e 1733a: ac 01 movw r20, r24 1733c: 62 e0 ldi r22, 0x02 ; 2 1733e: 80 e0 ldi r24, 0x00 ; 0 17340: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_set_cursor(18, 2); 17344: 62 e0 ldi r22, 0x02 ; 2 17346: 82 e1 ldi r24, 0x12 ; 18 17348: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 (screen < TestScreen::PrintFan) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1734c: c1 11 cpse r28, r1 1734e: 1a c0 rjmp .+52 ; 0x17384 17350: 8d 2f mov r24, r29 17352: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 lcd_puts_at_P(0, 3, _T(MSG_PRINT_FAN_SPEED)); 17356: 89 e3 ldi r24, 0x39 ; 57 17358: 9f e3 ldi r25, 0x3F ; 63 1735a: 0e 94 a7 6c call 0xd94e ; 0xd94e 1735e: ac 01 movw r20, r24 17360: 63 e0 ldi r22, 0x03 ; 3 17362: 80 e0 ldi r24, 0x00 ; 0 17364: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_set_cursor(18, 3); 17368: 63 e0 ldi r22, 0x03 ; 3 1736a: 82 e1 ldi r24, 0x12 ; 18 1736c: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 (screen < TestScreen::FansOk) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 17370: c2 30 cpi r28, 0x02 ; 2 17372: 19 f1 breq .+70 ; 0x173ba 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); 17374: 8d 2f mov r24, r29 17376: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 1737a: 23 c0 rjmp .+70 ; 0x173c2 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)); 1737c: cb 30 cpi r28, 0x0B ; 11 1737e: 09 f0 breq .+2 ; 0x17382 17380: 9f cf rjmp .-194 ; 0x172c0 17382: c9 cf rjmp .-110 ; 0x17316 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); 17384: 83 ed ldi r24, 0xD3 ; 211 17386: 97 e6 ldi r25, 0x67 ; 103 17388: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 1738c: e4 cf rjmp .-56 ; 0x17356 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) 1738e: 86 ef ldi r24, 0xF6 ; 246 17390: 8c 0f add r24, r28 17392: 82 30 cpi r24, 0x02 ; 2 17394: 80 f5 brcc .+96 ; 0x173f6 { lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 17396: 87 e2 ldi r24, 0x27 ; 39 17398: 9f e3 ldi r25, 0x3F ; 63 1739a: 0e 94 a7 6c call 0xd94e ; 0xd94e 1739e: ac 01 movw r20, r24 173a0: 62 e0 ldi r22, 0x02 ; 2 173a2: 80 e0 ldi r24, 0x00 ; 0 173a4: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_putc(':'); 173a8: 8a e3 ldi r24, 0x3A ; 58 173aa: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 lcd_set_cursor(18, 2); 173ae: 62 e0 ldi r22, 0x02 ; 2 173b0: 82 e1 ldi r24, 0x12 ; 18 173b2: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 (screen == TestScreen::Fsensor) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 173b6: ca 30 cpi r28, 0x0A ; 10 173b8: e9 f2 breq .-70 ; 0x17374 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); 173ba: 83 ed ldi r24, 0xD3 ; 211 173bc: 97 e6 ldi r25, 0x67 ; 103 173be: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 _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); 173c2: c1 14 cp r12, r1 173c4: d1 04 cpc r13, r1 173c6: 19 f0 breq .+6 ; 0x173ce 173c8: c6 01 movw r24, r12 173ca: 0e 94 45 7c call 0xf88a ; 0xf88a _progress++; 173ce: 81 e0 ldi r24, 0x01 ; 1 173d0: 8f 0d add r24, r15 return (_progress >= _progress_scale * 2) ? 0 : _progress; 173d2: 4e 2d mov r20, r14 173d4: 50 e0 ldi r21, 0x00 ; 0 173d6: 44 0f add r20, r20 173d8: 55 1f adc r21, r21 173da: 84 17 cp r24, r20 173dc: 15 06 cpc r1, r21 173de: 0c f0 brlt .+2 ; 0x173e2 173e0: 80 e0 ldi r24, 0x00 ; 0 } 173e2: df 91 pop r29 173e4: cf 91 pop r28 173e6: 1f 91 pop r17 173e8: 0f 91 pop r16 173ea: ff 90 pop r15 173ec: ef 90 pop r14 173ee: df 90 pop r13 173f0: cf 90 pop r12 173f2: bf 90 pop r11 173f4: 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) 173f6: ca 30 cpi r28, 0x0A ; 10 173f8: 20 f7 brcc .-56 ; 0x173c2 { //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); 173fa: 41 e0 ldi r20, 0x01 ; 1 173fc: c4 30 cpi r28, 0x04 ; 4 173fe: 21 f0 breq .+8 ; 0x17408 17400: 42 e0 ldi r20, 0x02 ; 2 17402: c3 30 cpi r28, 0x03 ; 3 17404: 09 f4 brne .+2 ; 0x17408 17406: 40 e0 ldi r20, 0x00 ; 0 17408: 0d 2f mov r16, r29 1740a: 29 e1 ldi r18, 0x19 ; 25 1740c: 33 e8 ldi r19, 0x83 ; 131 1740e: 62 e0 ldi r22, 0x02 ; 2 17410: 82 e0 ldi r24, 0x02 ; 2 17412: 0e 94 57 b2 call 0x164ae ; 0x164ae _step_block = TestScreen::AxisY; lcd_selftest_screen_step(2, 8, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Y"), _indicator); 17416: 41 e0 ldi r20, 0x01 ; 1 17418: c5 30 cpi r28, 0x05 ; 5 1741a: 21 f0 breq .+8 ; 0x17424 1741c: 42 e0 ldi r20, 0x02 ; 2 1741e: c5 30 cpi r28, 0x05 ; 5 17420: 08 f4 brcc .+2 ; 0x17424 17422: 40 e0 ldi r20, 0x00 ; 0 17424: 0d 2f mov r16, r29 17426: 27 e1 ldi r18, 0x17 ; 23 17428: 33 e8 ldi r19, 0x83 ; 131 1742a: 68 e0 ldi r22, 0x08 ; 8 1742c: 82 e0 ldi r24, 0x02 ; 2 1742e: 0e 94 57 b2 call 0x164ae ; 0x164ae _step_block = TestScreen::AxisZ; lcd_selftest_screen_step(2, 14, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Z"), _indicator); 17432: 41 e0 ldi r20, 0x01 ; 1 17434: c6 30 cpi r28, 0x06 ; 6 17436: 21 f0 breq .+8 ; 0x17440 17438: 42 e0 ldi r20, 0x02 ; 2 1743a: c6 30 cpi r28, 0x06 ; 6 1743c: 08 f4 brcc .+2 ; 0x17440 1743e: 40 e0 ldi r20, 0x00 ; 0 17440: 0d 2f mov r16, r29 17442: 25 e1 ldi r18, 0x15 ; 21 17444: 33 e8 ldi r19, 0x83 ; 131 17446: 6e e0 ldi r22, 0x0E ; 14 17448: 82 e0 ldi r24, 0x02 ; 2 1744a: 0e 94 57 b2 call 0x164ae ; 0x164ae _step_block = TestScreen::Bed; lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Bed"), _indicator); 1744e: 41 e0 ldi r20, 0x01 ; 1 17450: c7 30 cpi r28, 0x07 ; 7 17452: 21 f0 breq .+8 ; 0x1745c 17454: 42 e0 ldi r20, 0x02 ; 2 17456: c7 30 cpi r28, 0x07 ; 7 17458: 08 f4 brcc .+2 ; 0x1745c 1745a: 40 e0 ldi r20, 0x00 ; 0 1745c: 0d 2f mov r16, r29 1745e: 21 e1 ldi r18, 0x11 ; 17 17460: 33 e8 ldi r19, 0x83 ; 131 17462: 60 e0 ldi r22, 0x00 ; 0 17464: 83 e0 ldi r24, 0x03 ; 3 17466: 0e 94 57 b2 call 0x164ae ; 0x164ae _step_block = TestScreen::Hotend; lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Hotend"), _indicator); 1746a: 41 e0 ldi r20, 0x01 ; 1 1746c: c8 30 cpi r28, 0x08 ; 8 1746e: 21 f0 breq .+8 ; 0x17478 17470: 42 e0 ldi r20, 0x02 ; 2 17472: c8 30 cpi r28, 0x08 ; 8 17474: 08 f4 brcc .+2 ; 0x17478 17476: 40 e0 ldi r20, 0x00 ; 0 17478: 0d 2f mov r16, r29 1747a: 2a e0 ldi r18, 0x0A ; 10 1747c: 33 e8 ldi r19, 0x83 ; 131 1747e: 69 e0 ldi r22, 0x09 ; 9 17480: 83 e0 ldi r24, 0x03 ; 3 17482: 0e 94 57 b2 call 0x164ae ; 0x164ae 17486: 9d cf rjmp .-198 ; 0x173c2 00017488 : { printf_P(MSG_HOST_ACTION_NOTIFICATION, message); } static void lcd_rename_sheet_menu() { 17488: cf 93 push r28 1748a: 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) 1748c: 80 91 64 03 lds r24, 0x0364 ; 0x800364 17490: 81 11 cpse r24, r1 17492: 18 c0 rjmp .+48 ; 0x174c4 { eeprom_read_block(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); 17494: 60 91 98 03 lds r22, 0x0398 ; 0x800398 17498: 8b e0 ldi r24, 0x0B ; 11 1749a: 68 9f mul r22, r24 1749c: b0 01 movw r22, r0 1749e: 11 24 eor r1, r1 174a0: 67 5b subi r22, 0xB7 ; 183 174a2: 72 4f sbci r23, 0xF2 ; 242 174a4: 47 e0 ldi r20, 0x07 ; 7 174a6: 50 e0 ldi r21, 0x00 ; 0 174a8: 86 e6 ldi r24, 0x66 ; 102 174aa: 93 e0 ldi r25, 0x03 ; 3 174ac: 0f 94 8b a0 call 0x34116 ; 0x34116 lcd_encoder = menuData->name[0]; 174b0: 80 91 66 03 lds r24, 0x0366 ; 0x800366 174b4: 90 e0 ldi r25, 0x00 ; 0 174b6: 90 93 07 05 sts 0x0507, r25 ; 0x800507 174ba: 80 93 06 05 sts 0x0506, r24 ; 0x800506 menuData->initialized = true; 174be: 81 e0 ldi r24, 0x01 ; 1 174c0: 80 93 64 03 sts 0x0364, r24 ; 0x800364 } if (lcd_encoder < 0x20) lcd_encoder = 0x20; 174c4: 80 91 06 05 lds r24, 0x0506 ; 0x800506 174c8: 90 91 07 05 lds r25, 0x0507 ; 0x800507 174cc: 80 97 sbiw r24, 0x20 ; 32 174ce: 34 f4 brge .+12 ; 0x174dc 174d0: 80 e2 ldi r24, 0x20 ; 32 174d2: 90 e0 ldi r25, 0x00 ; 0 174d4: 90 93 07 05 sts 0x0507, r25 ; 0x800507 174d8: 80 93 06 05 sts 0x0506, r24 ; 0x800506 if (lcd_encoder > 0xFF) lcd_encoder = 0xFF; 174dc: 80 91 06 05 lds r24, 0x0506 ; 0x800506 174e0: 90 91 07 05 lds r25, 0x0507 ; 0x800507 174e4: 8f 3f cpi r24, 0xFF ; 255 174e6: 91 05 cpc r25, r1 174e8: 39 f0 breq .+14 ; 0x174f8 174ea: 34 f0 brlt .+12 ; 0x174f8 174ec: 8f ef ldi r24, 0xFF ; 255 174ee: 90 e0 ldi r25, 0x00 ; 0 174f0: 90 93 07 05 sts 0x0507, r25 ; 0x800507 174f4: 80 93 06 05 sts 0x0506, r24 ; 0x800506 menuData->name[menuData->selected] = lcd_encoder; 174f8: e0 91 65 03 lds r30, 0x0365 ; 0x800365 174fc: f0 e0 ldi r31, 0x00 ; 0 174fe: ec 59 subi r30, 0x9C ; 156 17500: fc 4f sbci r31, 0xFC ; 252 17502: 80 91 06 05 lds r24, 0x0506 ; 0x800506 17506: 82 83 std Z+2, r24 ; 0x02 lcd_home(); 17508: 0e 94 9d 69 call 0xd33a ; 0xd33a 1750c: c6 e6 ldi r28, 0x66 ; 102 1750e: d3 e0 ldi r29, 0x03 ; 3 for (uint_least8_t i = 0; i < sizeof(Sheet::name); ++i) { lcd_putc(menuData->name[i]); 17510: 89 91 ld r24, Y+ 17512: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 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) 17516: 83 e0 ldi r24, 0x03 ; 3 17518: cd 36 cpi r28, 0x6D ; 109 1751a: d8 07 cpc r29, r24 1751c: c9 f7 brne .-14 ; 0x17510 { lcd_putc(menuData->name[i]); } lcd_putc_at(menuData->selected, 1, '^'); 1751e: 4e e5 ldi r20, 0x5E ; 94 17520: 61 e0 ldi r22, 0x01 ; 1 17522: 80 91 65 03 lds r24, 0x0365 ; 0x800365 17526: 0e 94 91 69 call 0xd322 ; 0xd322 if (menuData->selected > 0) 1752a: 80 91 65 03 lds r24, 0x0365 ; 0x800365 1752e: 88 23 and r24, r24 17530: 29 f0 breq .+10 ; 0x1753c { lcd_putc_at(menuData->selected-1, 1, ' '); 17532: 40 e2 ldi r20, 0x20 ; 32 17534: 61 e0 ldi r22, 0x01 ; 1 17536: 81 50 subi r24, 0x01 ; 1 17538: 0e 94 91 69 call 0xd322 ; 0xd322 } if (lcd_clicked()) 1753c: 0e 94 8e 6b call 0xd71c ; 0xd71c 17540: 88 23 and r24, r24 17542: 99 f0 breq .+38 ; 0x1756a { if ((menuData->selected + 1u) < sizeof(Sheet::name)) 17544: e0 91 65 03 lds r30, 0x0365 ; 0x800365 17548: 8e 2f mov r24, r30 1754a: 90 e0 ldi r25, 0x00 ; 0 1754c: 01 96 adiw r24, 0x01 ; 1 1754e: 07 97 sbiw r24, 0x07 ; 7 17550: 78 f4 brcc .+30 ; 0x17570 { lcd_encoder = menuData->name[++(menuData->selected)]; 17552: ef 5f subi r30, 0xFF ; 255 17554: e0 93 65 03 sts 0x0365, r30 ; 0x800365 17558: f0 e0 ldi r31, 0x00 ; 0 1755a: ec 59 subi r30, 0x9C ; 156 1755c: fc 4f sbci r31, 0xFC ; 252 1755e: 82 81 ldd r24, Z+2 ; 0x02 17560: 90 e0 ldi r25, 0x00 ; 0 17562: 90 93 07 05 sts 0x0507, r25 ; 0x800507 17566: 80 93 06 05 sts 0x0506, r24 ; 0x800506 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 1756a: df 91 pop r29 1756c: cf 91 pop r28 1756e: 08 95 ret { lcd_encoder = menuData->name[++(menuData->selected)]; } else { eeprom_update_block_notify(menuData->name, 17570: 60 91 98 03 lds r22, 0x0398 ; 0x800398 17574: 8b e0 ldi r24, 0x0B ; 11 17576: 68 9f mul r22, r24 17578: b0 01 movw r22, r0 1757a: 11 24 eor r1, r1 1757c: 67 5b subi r22, 0xB7 ; 183 1757e: 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); 17580: 47 e0 ldi r20, 0x07 ; 7 17582: 50 e0 ldi r21, 0x00 ; 0 17584: 86 e6 ldi r24, 0x66 ; 102 17586: 93 e0 ldi r25, 0x03 ; 3 17588: 0f 94 af a0 call 0x3415e ; 0x3415e EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 1758c: df 91 pop r29 1758e: cf 91 pop r28 else { eeprom_update_block_notify(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); 17590: 0d 94 43 96 jmp 0x32c86 ; 0x32c86 00017594 : static void lcd_sd_refresh() { #if SDCARDDETECT == -1 card.mount(); #else card.presort(); 17594: 0f 94 04 4a call 0x29408 ; 0x29408 #endif menu_top = 0; 17598: 10 92 60 03 sts 0x0360, r1 ; 0x800360 lcd_encoder = 0; 1759c: 10 92 07 05 sts 0x0507, r1 ; 0x800507 175a0: 10 92 06 05 sts 0x0506, r1 ; 0x800506 menu_data_reset(); //Forces reloading of cached variables. 175a4: 0d 94 9d 93 jmp 0x3273a ; 0x3273a 000175a8 : } } void CardReader::updir() { if(workDirDepth > 0) 175a8: 80 91 0a 15 lds r24, 0x150A ; 0x80150a 175ac: 88 23 and r24, r24 175ae: f9 f0 breq .+62 ; 0x175ee { --workDirDepth; 175b0: 81 50 subi r24, 0x01 ; 1 175b2: 80 93 0a 15 sts 0x150A, r24 ; 0x80150a workDir = workDirParents[0]; 175b6: 93 e2 ldi r25, 0x23 ; 35 175b8: e8 e3 ldi r30, 0x38 ; 56 175ba: f4 e1 ldi r31, 0x14 ; 20 175bc: a5 e1 ldi r26, 0x15 ; 21 175be: b4 e1 ldi r27, 0x14 ; 20 175c0: 01 90 ld r0, Z+ 175c2: 0d 92 st X+, r0 175c4: 9a 95 dec r25 175c6: e1 f7 brne .-8 ; 0x175c0 175c8: 28 e3 ldi r18, 0x38 ; 56 175ca: 34 e1 ldi r19, 0x14 ; 20 for (uint8_t d = 0; d < workDirDepth; d++) 175cc: 90 e0 ldi r25, 0x00 ; 0 175ce: 98 17 cp r25, r24 175d0: 60 f4 brcc .+24 ; 0x175ea { workDirParents[d] = workDirParents[d+1]; 175d2: 43 e2 ldi r20, 0x23 ; 35 175d4: f9 01 movw r30, r18 175d6: b3 96 adiw r30, 0x23 ; 35 175d8: d9 01 movw r26, r18 175da: 01 90 ld r0, Z+ 175dc: 0d 92 st X+, r0 175de: 4a 95 dec r20 175e0: e1 f7 brne .-8 ; 0x175da { if(workDirDepth > 0) { --workDirDepth; workDir = workDirParents[0]; for (uint8_t d = 0; d < workDirDepth; d++) 175e2: 9f 5f subi r25, 0xFF ; 255 175e4: 2d 5d subi r18, 0xDD ; 221 175e6: 3f 4f sbci r19, 0xFF ; 255 175e8: f2 cf rjmp .-28 ; 0x175ce { workDirParents[d] = workDirParents[d+1]; } #ifdef SDCARD_SORT_ALPHA presort(); 175ea: 0f 94 04 4a call 0x29408 ; 0x29408 } static void lcd_sd_updir() { card.updir(); menu_top = 0; 175ee: 10 92 60 03 sts 0x0360, r1 ; 0x800360 lcd_encoder = 0; 175f2: 10 92 07 05 sts 0x0507, r1 ; 0x800507 175f6: 10 92 06 05 sts 0x0506, r1 ; 0x800506 menu_data_reset(); //Forces reloading of cached variables. 175fa: 0d 94 9d 93 jmp 0x3273a ; 0x3273a 000175fe : } eeprom_update_byte_notify((uint8_t*)EEPROM_MBL_PROBE_NR, mbl_z_probe_nr); } static void lcd_mesh_bed_leveling_settings() { 175fe: bf 92 push r11 17600: cf 92 push r12 17602: df 92 push r13 17604: ef 92 push r14 17606: ff 92 push r15 17608: 0f 93 push r16 1760a: 1f 93 push r17 1760c: cf 93 push r28 1760e: df 93 push r29 17610: 00 d0 rcall .+0 ; 0x17612 17612: 1f 92 push r1 17614: cd b7 in r28, 0x3d ; 61 17616: de b7 in r29, 0x3e ; 62 bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); 17618: 8c ea ldi r24, 0xAC ; 172 1761a: 9d e0 ldi r25, 0x0D ; 13 1761c: 0f 94 9b a0 call 0x34136 ; 0x34136 17620: c8 2e mov r12, r24 uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 17622: 8b ea ldi r24, 0xAB ; 171 17624: 9d e0 ldi r25, 0x0D ; 13 17626: 0f 94 9b a0 call 0x34136 ; 0x34136 1762a: f8 2e mov r15, r24 uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 1762c: 8a ea ldi r24, 0xAA ; 170 1762e: 9d e0 ldi r25, 0x0D ; 13 17630: 0f 94 9b a0 call 0x34136 ; 0x34136 17634: 18 2f mov r17, r24 char sToggle[4]; //enough for nxn format MENU_BEGIN(); 17636: 0f 94 7b 93 call 0x326f6 ; 0x326f6 1763a: 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'; 1763e: 80 e3 ldi r24, 0x30 ; 48 17640: d8 2e mov r13, r24 17642: df 0c add r13, r15 sToggle[1] = 'x'; 17644: 98 e7 ldi r25, 0x78 ; 120 17646: 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'; 17648: 20 e3 ldi r18, 0x30 ; 48 1764a: e2 2e mov r14, r18 1764c: 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(); 1764e: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17652: 84 30 cpi r24, 0x04 ; 4 17654: 08 f0 brcs .+2 ; 0x17658 17656: 56 c0 rjmp .+172 ; 0x17704 17658: 10 92 31 04 sts 0x0431, r1 ; 0x800431 ON_MENU_LEAVE( 1765c: 0f 94 fb 91 call 0x323f6 ; 0x323f6 17660: 88 23 and r24, r24 17662: 31 f0 breq .+12 ; 0x17670 17664: 87 e0 ldi r24, 0x07 ; 7 17666: f8 12 cpse r15, r24 17668: 03 c0 rjmp .+6 ; 0x17670 1766a: 81 e0 ldi r24, 0x01 ; 1 1766c: 0f 94 6b 30 call 0x260d6 ; 0x260d6 // 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)); 17670: 87 ea ldi r24, 0xA7 ; 167 17672: 9d e3 ldi r25, 0x3D ; 61 17674: 0e 94 a7 6c call 0xd94e ; 0xd94e 17678: 0f 94 46 96 call 0x32c8c ; 0x32c8c sToggle[0] = points_nr + '0'; 1767c: d9 82 std Y+1, r13 ; 0x01 sToggle[1] = 'x'; 1767e: ba 82 std Y+2, r11 ; 0x02 sToggle[2] = points_nr + '0'; 17680: db 82 std Y+3, r13 ; 0x03 sToggle[3] = 0; 17682: 1c 82 std Y+4, r1 ; 0x04 MENU_ITEM_TOGGLE(_T(MSG_MESH), sToggle, mbl_mesh_toggle); 17684: 80 ea ldi r24, 0xA0 ; 160 17686: 9d e3 ldi r25, 0x3D ; 61 17688: 0e 94 a7 6c call 0xd94e ; 0xd94e 1768c: 20 e0 ldi r18, 0x00 ; 0 1768e: 4c e2 ldi r20, 0x2C ; 44 17690: 53 eb ldi r21, 0xB3 ; 179 17692: be 01 movw r22, r28 17694: 6f 5f subi r22, 0xFF ; 255 17696: 7f 4f sbci r23, 0xFF ; 255 17698: 0f 94 0a 95 call 0x32a14 ; 0x32a14 sToggle[0] = mbl_z_probe_nr + '0'; 1769c: e9 82 std Y+1, r14 ; 0x01 sToggle[1] = 0; 1769e: 1a 82 std Y+2, r1 ; 0x02 MENU_ITEM_TOGGLE(_T(MSG_Z_PROBE_NR), sToggle, mbl_probe_nr_toggle); 176a0: 82 e9 ldi r24, 0x92 ; 146 176a2: 9d e3 ldi r25, 0x3D ; 61 176a4: 0e 94 a7 6c call 0xd94e ; 0xd94e 176a8: 20 e0 ldi r18, 0x00 ; 0 176aa: 4d e1 ldi r20, 0x1D ; 29 176ac: 53 eb ldi r21, 0xB3 ; 179 176ae: be 01 movw r22, r28 176b0: 6f 5f subi r22, 0xFF ; 255 176b2: 7f 4f sbci r23, 0xFF ; 255 176b4: 0f 94 0a 95 call 0x32a14 ; 0x32a14 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); 176b8: 87 e0 ldi r24, 0x07 ; 7 176ba: f8 12 cpse r15, r24 176bc: 20 c0 rjmp .+64 ; 0x176fe 176be: 8f ea ldi r24, 0xAF ; 175 176c0: 9a e5 ldi r25, 0x5A ; 90 176c2: c1 10 cpse r12, r1 176c4: 02 c0 rjmp .+4 ; 0x176ca 176c6: 89 ea ldi r24, 0xA9 ; 169 176c8: 9a e5 ldi r25, 0x5A ; 90 176ca: 0e 94 a7 6c call 0xd94e ; 0xd94e 176ce: 8c 01 movw r16, r24 176d0: 8c e7 ldi r24, 0x7C ; 124 176d2: 9d e3 ldi r25, 0x3D ; 61 176d4: 0e 94 a7 6c call 0xd94e ; 0xd94e 176d8: 22 e0 ldi r18, 0x02 ; 2 176da: 48 e3 ldi r20, 0x38 ; 56 176dc: 53 eb ldi r21, 0xB3 ; 179 176de: b8 01 movw r22, r16 176e0: 0f 94 0a 95 call 0x32a14 ; 0x32a14 MENU_END(); 176e4: 0f 94 4f 93 call 0x3269e ; 0x3269e 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(); 176e8: 90 91 2e 04 lds r25, 0x042E ; 0x80042e 176ec: 9f 5f subi r25, 0xFF ; 255 176ee: 90 93 2e 04 sts 0x042E, r25 ; 0x80042e 176f2: 90 91 30 04 lds r25, 0x0430 ; 0x800430 176f6: 9f 5f subi r25, 0xFF ; 255 176f8: 90 93 30 04 sts 0x0430, r25 ; 0x800430 176fc: a8 cf rjmp .-176 ; 0x1764e 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); 176fe: 8c e8 ldi r24, 0x8C ; 140 17700: 9d e3 ldi r25, 0x3D ; 61 17702: e3 cf rjmp .-58 ; 0x176ca MENU_END(); } 17704: 0f 90 pop r0 17706: 0f 90 pop r0 17708: 0f 90 pop r0 1770a: 0f 90 pop r0 1770c: df 91 pop r29 1770e: cf 91 pop r28 17710: 1f 91 pop r17 17712: 0f 91 pop r16 17714: ff 90 pop r15 17716: ef 90 pop r14 17718: df 90 pop r13 1771a: cf 90 pop r12 1771c: bf 90 pop r11 1771e: 08 95 ret 00017720 : static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { 17720: cf 93 push r28 MENU_BEGIN(); 17722: 0f 94 7b 93 call 0x326f6 ; 0x326f6 17726: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1772a: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1772e: 84 30 cpi r24, 0x04 ; 4 17730: 60 f5 brcc .+88 ; 0x1778a 17732: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 17736: 88 ef ldi r24, 0xF8 ; 248 17738: 9d e3 ldi r25, 0x3D ; 61 1773a: 0e 94 a7 6c call 0xd94e ; 0xd94e 1773e: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), load_all_wrapper); 17742: 86 e9 ldi r24, 0x96 ; 150 17744: 9b e3 ldi r25, 0x3B ; 59 17746: 0e 94 a7 6c call 0xd94e ; 0xd94e 1774a: 64 e8 ldi r22, 0x84 ; 132 1774c: 7c eb ldi r23, 0xBC ; 188 1774e: 0f 94 f8 92 call 0x325f0 ; 0x325f0 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 17752: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); 17754: 8b e5 ldi r24, 0x5B ; 91 17756: 9c e3 ldi r25, 0x3C ; 60 17758: 0e 94 a7 6c call 0xd94e ; 0xd94e 1775c: 61 e3 ldi r22, 0x31 ; 49 1775e: 6c 0f add r22, r28 17760: 2c 2f mov r18, r28 17762: 43 e9 ldi r20, 0x93 ; 147 17764: 5c eb ldi r21, 0xBC ; 188 17766: 0f 94 a1 92 call 0x32542 ; 0x32542 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++) 1776a: cf 5f subi r28, 0xFF ; 255 1776c: c5 30 cpi r28, 0x05 ; 5 1776e: 91 f7 brne .-28 ; 0x17754 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); MENU_END(); 17770: 0f 94 4f 93 call 0x3269e ; 0x3269e static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { MENU_BEGIN(); 17774: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17778: 8f 5f subi r24, 0xFF ; 255 1777a: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1777e: 80 91 30 04 lds r24, 0x0430 ; 0x800430 17782: 8f 5f subi r24, 0xFF ; 255 17784: 80 93 30 04 sts 0x0430, r24 ; 0x800430 17788: d0 cf rjmp .-96 ; 0x1772a 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(); } 1778a: cf 91 pop r28 1778c: 08 95 ret 0001778e : static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); } static void lcd_mmuLoadFilament() { preheat_or_continue(FilamentAction::MmuLoad); 1778e: 84 e0 ldi r24, 0x04 ; 4 17790: 0d 94 db 31 jmp 0x263b6 ; 0x263b6 00017794 : } static void lcd_mmuUnloadFilament() { preheat_or_continue(FilamentAction::MmuUnLoad); 17794: 85 e0 ldi r24, 0x05 ; 5 17796: 0d 94 db 31 jmp 0x263b6 ; 0x263b6 0001779a : } static void lcd_mmuEjectFilament() { preheat_or_continue(FilamentAction::MmuEject); 1779a: 86 e0 ldi r24, 0x06 ; 6 1779c: 0d 94 db 31 jmp 0x263b6 ; 0x263b6 000177a0 : static void lcd_mmuLoadingTest() { preheat_or_continue(FilamentAction::MmuLoadingTest); } static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); 177a0: 87 e0 ldi r24, 0x07 ; 7 177a2: 0d 94 db 31 jmp 0x263b6 ; 0x263b6 000177a6 : 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); 177a6: 88 e0 ldi r24, 0x08 ; 8 177a8: 0d 94 db 31 jmp 0x263b6 ; 0x263b6 000177ac : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 177ac: 60 91 98 03 lds r22, 0x0398 ; 0x800398 177b0: 81 ea ldi r24, 0xA1 ; 161 177b2: 9d e0 ldi r25, 0x0D ; 13 177b4: 0f 94 bf a0 call 0x3417e ; 0x3417e } static void change_sheet() { eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), selected_sheet); menu_back(3); 177b8: 83 e0 ldi r24, 0x03 ; 3 177ba: 0d 94 27 96 jmp 0x32c4e ; 0x32c4e 000177be : // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { 177be: cf 93 push r28 MENU_BEGIN(); 177c0: 0f 94 7b 93 call 0x326f6 ; 0x326f6 177c4: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 177c8: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 177cc: 84 30 cpi r24, 0x04 ; 4 177ce: 88 f5 brcc .+98 ; 0x17832 177d0: 10 92 31 04 sts 0x0431, r1 ; 0x800431 ON_MENU_LEAVE( 177d4: 0f 94 fb 91 call 0x323f6 ; 0x323f6 177d8: 81 11 cpse r24, r1 177da: 0f 94 91 0c call 0x21922 ; 0x21922 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 177de: 88 ef ldi r24, 0xF8 ; 248 177e0: 9d e3 ldi r25, 0x3D ; 61 177e2: 0e 94 a7 6c call 0xd94e ; 0xd94e 177e6: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), loading_test_all_wrapper); 177ea: 86 e9 ldi r24, 0x96 ; 150 177ec: 9b e3 ldi r25, 0x3B ; 59 177ee: 0e 94 a7 6c call 0xd94e ; 0xd94e 177f2: 6b e1 ldi r22, 0x1B ; 27 177f4: 77 ef ldi r23, 0xF7 ; 247 177f6: 0f 94 f8 92 call 0x325f0 ; 0x325f0 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 177fa: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); 177fc: 8b e5 ldi r24, 0x5B ; 91 177fe: 9c e3 ldi r25, 0x3C ; 60 17800: 0e 94 a7 6c call 0xd94e ; 0xd94e 17804: 61 e3 ldi r22, 0x31 ; 49 17806: 6c 0f add r22, r28 17808: 2c 2f mov r18, r28 1780a: 46 e0 ldi r20, 0x06 ; 6 1780c: 57 ef ldi r21, 0xF7 ; 247 1780e: 0f 94 a1 92 call 0x32542 ; 0x32542 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++) 17812: cf 5f subi r28, 0xFF ; 255 17814: c5 30 cpi r28, 0x05 ; 5 17816: 91 f7 brne .-28 ; 0x177fc MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); MENU_END(); 17818: 0f 94 4f 93 call 0x3269e ; 0x3269e // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { MENU_BEGIN(); 1781c: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17820: 8f 5f subi r24, 0xFF ; 255 17822: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 17826: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1782a: 8f 5f subi r24, 0xFF ; 255 1782c: 80 93 30 04 sts 0x0430, r24 ; 0x800430 17830: cb cf rjmp .-106 ; 0x177c8 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(); } 17832: cf 91 pop r28 17834: 08 95 ret 00017836 : } // 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)) { 17836: ef 92 push r14 17838: ff 92 push r15 1783a: 0f 93 push r16 1783c: 1f 93 push r17 1783e: cf 93 push r28 17840: 8c 01 movw r16, r24 17842: 7b 01 movw r14, r22 MENU_BEGIN(); 17844: 0f 94 7b 93 call 0x326f6 ; 0x326f6 17848: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1784c: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 17850: 84 30 cpi r24, 0x04 ; 4 17852: 28 f5 brcc .+74 ; 0x1789e 17854: 10 92 31 04 sts 0x0431, r1 ; 0x800431 ON_MENU_LEAVE( 17858: 0f 94 fb 91 call 0x323f6 ; 0x323f6 1785c: 81 11 cpse r24, r1 1785e: 0f 94 91 0c call 0x21922 ; 0x21922 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 17862: 88 ef ldi r24, 0xF8 ; 248 17864: 9d e3 ldi r25, 0x3D ; 61 17866: 0e 94 a7 6c call 0xd94e ; 0xd94e 1786a: 0f 94 46 96 call 0x32c8c ; 0x32c8c for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1786e: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); 17870: 61 e3 ldi r22, 0x31 ; 49 17872: 6c 0f add r22, r28 17874: 2c 2f mov r18, r28 17876: a7 01 movw r20, r14 17878: c8 01 movw r24, r16 1787a: 0f 94 a1 92 call 0x32542 ; 0x32542 MENU_BEGIN(); ON_MENU_LEAVE( clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1787e: cf 5f subi r28, 0xFF ; 255 17880: c5 30 cpi r28, 0x05 ; 5 17882: b1 f7 brne .-20 ; 0x17870 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); MENU_END(); 17884: 0f 94 4f 93 call 0x3269e ; 0x3269e // 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(); 17888: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1788c: 8f 5f subi r24, 0xFF ; 255 1788e: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 17892: 80 91 30 04 lds r24, 0x0430 ; 0x800430 17896: 8f 5f subi r24, 0xFF ; 255 17898: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1789c: d7 cf rjmp .-82 ; 0x1784c ); 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(); } 1789e: cf 91 pop r28 178a0: 1f 91 pop r17 178a2: 0f 91 pop r16 178a4: ff 90 pop r15 178a6: ef 90 pop r14 178a8: 08 95 ret 000178aa : 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); 178aa: 82 ee ldi r24, 0xE2 ; 226 178ac: 99 e5 ldi r25, 0x59 ; 89 178ae: 0e 94 a7 6c call 0xd94e ; 0xd94e 178b2: 6d e6 ldi r22, 0x6D ; 109 178b4: 7c eb ldi r23, 0xBC ; 188 178b6: 0c 94 1b bc jmp 0x17836 ; 0x17836 000178ba : // Clear the filament action clearFilamentAction(); } static void mmu_fil_eject_menu() { mmu_common_choose_filament_menu(_T(MSG_EJECT_FROM_MMU), mmu_eject_filament); 178ba: 81 ef ldi r24, 0xF1 ; 241 178bc: 99 e5 ldi r25, 0x59 ; 89 178be: 0e 94 a7 6c call 0xd94e ; 0xd94e 178c2: 69 e7 ldi r22, 0x79 ; 121 178c4: 7c eb ldi r23, 0xBC ; 188 178c6: 0c 94 1b bc jmp 0x17836 ; 0x17836 000178ca : 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); 178ca: 8b e5 ldi r24, 0x5B ; 91 178cc: 9c e3 ldi r25, 0x3C ; 60 178ce: 0e 94 a7 6c call 0xd94e ; 0xd94e 178d2: 65 ea ldi r22, 0xA5 ; 165 178d4: 77 ef ldi r23, 0xF7 ; 247 178d6: 0c 94 1b bc jmp 0x17836 ; 0x17836 000178da : 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){ 178da: cf 93 push r28 178dc: c8 2f mov r28, r24 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { 178de: 0f 94 73 54 call 0x2a8e6 ; 0x2a8e6 178e2: 88 23 and r24, r24 178e4: 21 f0 breq .+8 ; 0x178ee 178e6: 8c 2f mov r24, r28 MMU2::mmu2.cut_filament(index); } 178e8: cf 91 pop r28 178ea: 0d 94 2a 6c jmp 0x2d854 ; 0x2d854 178ee: cf 91 pop r28 178f0: 08 95 ret 000178f2 : 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) { 178f2: cf 93 push r28 178f4: c8 2f mov r28, r24 menu_back(); 178f6: 0f 94 43 96 call 0x32c86 ; 0x32c86 MMU2::mmu2.eject_filament(filament, true); 178fa: 61 e0 ldi r22, 0x01 ; 1 178fc: 8c 2f mov r24, r28 178fe: 0f 94 ad 6b call 0x2d75a ; 0x2d75a // Clear the filament action clearFilamentAction(); } 17902: 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(); 17904: 0d 94 91 0c jmp 0x21922 ; 0x21922 00017908 : } static inline void load_all_wrapper(){ for(uint8_t i = 0; i < MMU_FILAMENT_COUNT; ++i){ MMU2::mmu2.load_filament(i); 17908: 80 e0 ldi r24, 0x00 ; 0 1790a: 0f 94 6a 6b call 0x2d6d4 ; 0x2d6d4 1790e: 81 e0 ldi r24, 0x01 ; 1 17910: 0f 94 6a 6b call 0x2d6d4 ; 0x2d6d4 17914: 82 e0 ldi r24, 0x02 ; 2 17916: 0f 94 6a 6b call 0x2d6d4 ; 0x2d6d4 1791a: 83 e0 ldi r24, 0x03 ; 3 1791c: 0f 94 6a 6b call 0x2d6d4 ; 0x2d6d4 17920: 84 e0 ldi r24, 0x04 ; 4 17922: 0d 94 6a 6b jmp 0x2d6d4 ; 0x2d6d4 00017926 : } } static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); 17926: 0d 94 6a 6b jmp 0x2d6d4 ; 0x2d6d4 0001792a : break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 1792a: 80 e0 ldi r24, 0x00 ; 0 1792c: 0d 94 1c 63 jmp 0x2c638 ; 0x2c638 00017930 : lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 17930: 0f 94 7b 93 call 0x326f6 ; 0x326f6 17934: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 17938: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1793c: 84 30 cpi r24, 0x04 ; 4 1793e: 08 f0 brcs .+2 ; 0x17942 17940: 45 c0 rjmp .+138 ; 0x179cc 17942: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 17946: 8e e9 ldi r24, 0x9E ; 158 17948: 9a e3 ldi r25, 0x3A ; 58 1794a: 0e 94 a7 6c call 0xd94e ; 0xd94e 1794e: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[0], select_sheet_menu<0>); 17952: 65 e2 ldi r22, 0x25 ; 37 17954: 75 eb ldi r23, 0xB5 ; 181 17956: 89 e4 ldi r24, 0x49 ; 73 17958: 9d e0 ldi r25, 0x0D ; 13 1795a: 0f 94 a9 95 call 0x32b52 ; 0x32b52 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[1], select_sheet_menu<1>); 1795e: 60 e2 ldi r22, 0x20 ; 32 17960: 75 eb ldi r23, 0xB5 ; 181 17962: 84 e5 ldi r24, 0x54 ; 84 17964: 9d e0 ldi r25, 0x0D ; 13 17966: 0f 94 a9 95 call 0x32b52 ; 0x32b52 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[2], select_sheet_menu<2>); 1796a: 6b e1 ldi r22, 0x1B ; 27 1796c: 75 eb ldi r23, 0xB5 ; 181 1796e: 8f e5 ldi r24, 0x5F ; 95 17970: 9d e0 ldi r25, 0x0D ; 13 17972: 0f 94 a9 95 call 0x32b52 ; 0x32b52 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[3], select_sheet_menu<3>); 17976: 66 e1 ldi r22, 0x16 ; 22 17978: 75 eb ldi r23, 0xB5 ; 181 1797a: 8a e6 ldi r24, 0x6A ; 106 1797c: 9d e0 ldi r25, 0x0D ; 13 1797e: 0f 94 a9 95 call 0x32b52 ; 0x32b52 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[4], select_sheet_menu<4>); 17982: 61 e1 ldi r22, 0x11 ; 17 17984: 75 eb ldi r23, 0xB5 ; 181 17986: 85 e7 ldi r24, 0x75 ; 117 17988: 9d e0 ldi r25, 0x0D ; 13 1798a: 0f 94 a9 95 call 0x32b52 ; 0x32b52 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[5], select_sheet_menu<5>); 1798e: 6c e0 ldi r22, 0x0C ; 12 17990: 75 eb ldi r23, 0xB5 ; 181 17992: 80 e8 ldi r24, 0x80 ; 128 17994: 9d e0 ldi r25, 0x0D ; 13 17996: 0f 94 a9 95 call 0x32b52 ; 0x32b52 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[6], select_sheet_menu<6>); 1799a: 67 e0 ldi r22, 0x07 ; 7 1799c: 75 eb ldi r23, 0xB5 ; 181 1799e: 8b e8 ldi r24, 0x8B ; 139 179a0: 9d e0 ldi r25, 0x0D ; 13 179a2: 0f 94 a9 95 call 0x32b52 ; 0x32b52 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[7], select_sheet_menu<7>); 179a6: 62 e0 ldi r22, 0x02 ; 2 179a8: 75 eb ldi r23, 0xB5 ; 181 179aa: 86 e9 ldi r24, 0x96 ; 150 179ac: 9d e0 ldi r25, 0x0D ; 13 179ae: 0f 94 a9 95 call 0x32b52 ; 0x32b52 MENU_END(); 179b2: 0f 94 4f 93 call 0x3269e ; 0x3269e lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 179b6: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 179ba: 8f 5f subi r24, 0xFF ; 255 179bc: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 179c0: 80 91 30 04 lds r24, 0x0430 ; 0x800430 179c4: 8f 5f subi r24, 0xFF ; 255 179c6: 80 93 30 04 sts 0x0430, r24 ; 0x800430 179ca: b6 cf rjmp .-148 ; 0x17938 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(); } 179cc: 08 95 ret 000179ce : //! //! @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) 179ce: 4f 92 push r4 179d0: 5f 92 push r5 179d2: 6f 92 push r6 179d4: 7f 92 push r7 179d6: 8f 92 push r8 179d8: 9f 92 push r9 179da: af 92 push r10 179dc: bf 92 push r11 179de: cf 92 push r12 179e0: df 92 push r13 179e2: ef 92 push r14 179e4: ff 92 push r15 179e6: 0f 93 push r16 179e8: 1f 93 push r17 179ea: cf 93 push r28 179ec: df 93 push r29 179ee: 6c 01 movw r12, r24 179f0: 7b 01 movw r14, r22 179f2: 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); 179f6: 67 2b or r22, r23 179f8: 29 f0 breq .+10 ; 0x17a04 179fa: 06 e0 ldi r16, 0x06 ; 6 179fc: 81 30 cpi r24, 0x01 ; 1 179fe: 29 f0 breq .+10 ; 0x17a0a 17a00: 05 e0 ldi r16, 0x05 ; 5 17a02: 03 c0 rjmp .+6 ; 0x17a0a 17a04: 04 e0 ldi r16, 0x04 ; 4 17a06: 81 30 cpi r24, 0x01 ; 1 17a08: d9 f3 breq .-10 ; 0x17a00 const uint8_t item_len = item?strlen_P(item):0; int8_t first = 0; int8_t cursor_pos = 1; lcd_clear(); 17a0a: 0e 94 a4 69 call 0xd348 ; 0xd348 KEEPALIVE_STATE(PAUSED_FOR_USER); 17a0e: 84 e0 ldi r24, 0x04 ; 4 17a10: 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; 17a14: 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; 17a16: 81 2c mov r8, r1 } if (cursor_pos > 3) { cursor_pos = 3; if (first < items_no - 3) 17a18: 03 50 subi r16, 0x03 ; 3 17a1a: 11 0b sbc r17, r17 lcd_clear(); KEEPALIVE_STATE(PAUSED_FOR_USER); while (1) { manage_heater(); 17a1c: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(true); 17a20: 81 e0 ldi r24, 0x01 ; 1 17a22: 0e 94 fe 79 call 0xf3fc ; 0xf3fc if (lcd_encoder) 17a26: 80 91 06 05 lds r24, 0x0506 ; 0x800506 17a2a: 90 91 07 05 lds r25, 0x0507 ; 0x800507 17a2e: 00 97 sbiw r24, 0x00 ; 0 17a30: 09 f4 brne .+2 ; 0x17a34 17a32: 9d c0 rjmp .+314 ; 0x17b6e { if (lcd_encoder < 0) 17a34: 97 ff sbrs r25, 7 17a36: 88 c0 rjmp .+272 ; 0x17b48 { cursor_pos--; 17a38: c1 50 subi r28, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } lcd_encoder = 0; 17a3a: 10 92 07 05 sts 0x0507, r1 ; 0x800507 17a3e: 10 92 06 05 sts 0x0506, r1 ; 0x800506 } if (cursor_pos > 3) 17a42: c4 30 cpi r28, 0x04 ; 4 17a44: 0c f4 brge .+2 ; 0x17a48 17a46: 86 c0 rjmp .+268 ; 0x17b54 { cursor_pos = 3; if (first < items_no - 3) 17a48: 88 2d mov r24, r8 17a4a: 08 2c mov r0, r8 17a4c: 00 0c add r0, r0 17a4e: 99 0b sbc r25, r25 17a50: 80 17 cp r24, r16 17a52: 91 07 cpc r25, r17 17a54: 0c f0 brlt .+2 ; 0x17a58 17a56: 7a c0 rjmp .+244 ; 0x17b4c { first++; 17a58: 83 94 inc r8 lcd_clear(); 17a5a: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_encoder = 0; } if (cursor_pos > 3) { cursor_pos = 3; 17a5e: 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); 17a60: c1 14 cp r12, r1 17a62: d1 04 cpc r13, r1 17a64: 29 f0 breq .+10 ; 0x17a70 17a66: a6 01 movw r20, r12 17a68: 60 e0 ldi r22, 0x00 ; 0 17a6a: 80 e0 ldi r24, 0x00 ; 0 17a6c: 0e 94 85 69 call 0xd30a ; 0xd30a const bool last_visible = (first == items_no - 3); 17a70: a8 2c mov r10, r8 17a72: 08 2c mov r0, r8 17a74: 00 0c add r0, r0 17a76: bb 08 sbc r11, r11 const uint_least8_t ordinary_items = (last_item&&last_visible)?2:3; 17a78: e1 14 cp r14, r1 17a7a: f1 04 cpc r15, r1 17a7c: 29 f0 breq .+10 ; 0x17a88 17a7e: 82 e0 ldi r24, 0x02 ; 2 17a80: 98 2e mov r9, r24 17a82: a0 16 cp r10, r16 17a84: b1 06 cpc r11, r17 17a86: 11 f0 breq .+4 ; 0x17a8c 17a88: 93 e0 ldi r25, 0x03 ; 3 17a8a: 99 2e mov r9, r25 for (uint_least8_t i = 0; i < ordinary_items; i++) 17a8c: d0 e0 ldi r29, 0x00 ; 0 { if (item) lcd_puts_at_P(1, i + 1, item); 17a8e: df 5f subi r29, 0xFF ; 255 17a90: 44 e3 ldi r20, 0x34 ; 52 17a92: 59 e6 ldi r21, 0x69 ; 105 17a94: 6d 2f mov r22, r29 17a96: 81 e0 ldi r24, 0x01 ; 1 17a98: 0e 94 85 69 call 0xd30a ; 0xd30a 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++) 17a9c: 9d 12 cpse r9, r29 17a9e: f7 cf rjmp .-18 ; 0x17a8e 17aa0: 48 2c mov r4, r8 17aa2: 08 2c mov r0, r8 17aa4: 00 0c add r0, r0 17aa6: 55 08 sbc r5, r5 17aa8: 66 08 sbc r6, r6 17aaa: 77 08 sbc r7, r7 17aac: 8f ef ldi r24, 0xFF ; 255 17aae: 48 1a sub r4, r24 17ab0: 58 0a sbc r5, r24 17ab2: 68 0a sbc r6, r24 17ab4: 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++) 17ab6: 91 2c mov r9, r1 { lcd_set_cursor(2 + item_len, i+1); 17ab8: 93 94 inc r9 17aba: 69 2d mov r22, r9 17abc: 8a e0 ldi r24, 0x0A ; 10 17abe: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 17ac2: c3 01 movw r24, r6 17ac4: b2 01 movw r22, r4 17ac6: 0e 94 2a 6b call 0xd654 ; 0xd654 17aca: 8f ef ldi r24, 0xFF ; 255 17acc: 48 1a sub r4, r24 17ace: 58 0a sbc r5, r24 17ad0: 68 0a sbc r6, r24 17ad2: 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++) 17ad4: d9 11 cpse r29, r9 17ad6: f0 cf rjmp .-32 ; 0x17ab8 { 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); 17ad8: e1 14 cp r14, r1 17ada: f1 04 cpc r15, r1 17adc: 41 f0 breq .+16 ; 0x17aee 17ade: a0 16 cp r10, r16 17ae0: b1 06 cpc r11, r17 17ae2: 29 f4 brne .+10 ; 0x17aee 17ae4: a7 01 movw r20, r14 17ae6: 63 e0 ldi r22, 0x03 ; 3 17ae8: 81 e0 ldi r24, 0x01 ; 1 17aea: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_puts_at_P(0, 1, PSTR(" \n \n ")); 17aee: 44 eb ldi r20, 0xB4 ; 180 17af0: 56 e8 ldi r21, 0x86 ; 134 17af2: 61 e0 ldi r22, 0x01 ; 1 17af4: 80 e0 ldi r24, 0x00 ; 0 17af6: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_putc_at(0, cursor_pos, '>'); 17afa: 4e e3 ldi r20, 0x3E ; 62 17afc: 6c 2f mov r22, r28 17afe: 80 e0 ldi r24, 0x00 ; 0 17b00: 0e 94 91 69 call 0xd322 ; 0xd322 _delay(100); 17b04: 64 e6 ldi r22, 0x64 ; 100 17b06: 70 e0 ldi r23, 0x00 ; 0 17b08: 80 e0 ldi r24, 0x00 ; 0 17b0a: 90 e0 ldi r25, 0x00 ; 0 17b0c: 0f 94 03 0e call 0x21c06 ; 0x21c06 if (lcd_clicked()) 17b10: 0e 94 8e 6b call 0xd71c ; 0xd71c 17b14: 88 23 and r24, r24 17b16: 09 f4 brne .+2 ; 0x17b1a 17b18: 81 cf rjmp .-254 ; 0x17a1c { KEEPALIVE_STATE(IN_HANDLER); 17b1a: 82 e0 ldi r24, 0x02 ; 2 17b1c: 80 93 78 02 sts 0x0278, r24 ; 0x800278 return(cursor_pos + first - 1); 17b20: 8f ef ldi r24, 0xFF ; 255 17b22: 8c 0f add r24, r28 17b24: 88 0d add r24, r8 } } } 17b26: df 91 pop r29 17b28: cf 91 pop r28 17b2a: 1f 91 pop r17 17b2c: 0f 91 pop r16 17b2e: ff 90 pop r15 17b30: ef 90 pop r14 17b32: df 90 pop r13 17b34: cf 90 pop r12 17b36: bf 90 pop r11 17b38: af 90 pop r10 17b3a: 9f 90 pop r9 17b3c: 8f 90 pop r8 17b3e: 7f 90 pop r7 17b40: 6f 90 pop r6 17b42: 5f 90 pop r5 17b44: 4f 90 pop r4 17b46: 08 95 ret cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 17b48: cf 5f subi r28, 0xFF ; 255 17b4a: 77 cf rjmp .-274 ; 0x17a3a 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); 17b4c: 87 e0 ldi r24, 0x07 ; 7 17b4e: 0f 94 2b 2d call 0x25a56 ; 0x25a56 17b52: 85 cf rjmp .-246 ; 0x17a5e } } if (cursor_pos < 1) 17b54: c1 11 cpse r28, r1 17b56: 84 cf rjmp .-248 ; 0x17a60 { cursor_pos = 1; if (first > 0) 17b58: 18 14 cp r1, r8 17b5a: 2c f4 brge .+10 ; 0x17b66 { first--; 17b5c: 8a 94 dec r8 lcd_clear(); 17b5e: 0e 94 a4 69 call 0xd348 ; 0xd348 } } if (cursor_pos < 1) { cursor_pos = 1; 17b62: c1 e0 ldi r28, 0x01 ; 1 17b64: 7d cf rjmp .-262 ; 0x17a60 if (first > 0) { first--; lcd_clear(); } else { // here we are at the very end of the list Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 17b66: 87 e0 ldi r24, 0x07 ; 7 17b68: 0f 94 2b 2d call 0x25a56 ; 0x25a56 17b6c: fa cf rjmp .-12 ; 0x17b62 cursor_pos++; } lcd_encoder = 0; } if (cursor_pos > 3) 17b6e: c4 30 cpi r28, 0x04 ; 4 17b70: 0c f0 brlt .+2 ; 0x17b74 17b72: 6a cf rjmp .-300 ; 0x17a48 17b74: 75 cf rjmp .-278 ; 0x17a60 00017b76 : } #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) { 17b76: 4f 92 push r4 17b78: 5f 92 push r5 17b7a: 6f 92 push r6 17b7c: 7f 92 push r7 17b7e: af 92 push r10 17b80: bf 92 push r11 17b82: cf 92 push r12 17b84: df 92 push r13 17b86: ef 92 push r14 17b88: ff 92 push r15 17b8a: 0f 93 push r16 17b8c: 1f 93 push r17 17b8e: cf 93 push r28 17b90: df 93 push r29 17b92: 24 e0 ldi r18, 0x04 ; 4 17b94: 30 e0 ldi r19, 0x00 ; 0 17b96: 41 e0 ldi r20, 0x01 ; 1 17b98: 50 e0 ldi r21, 0x00 ; 0 17b9a: d9 01 movw r26, r18 17b9c: a9 50 subi r26, 0x09 ; 9 17b9e: be 47 sbci r27, 0x7E ; 126 uint8_t i; short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]); for (i=1; i raw) 17ba0: fd 01 movw r30, r26 17ba2: 65 91 lpm r22, Z+ 17ba4: 74 91 lpm r23, Z 17ba6: 86 17 cp r24, r22 17ba8: 97 07 cpc r25, r23 17baa: 0c f0 brlt .+2 ; 0x17bae 17bac: 66 c0 rjmp .+204 ; 0x17c7a { celsius = PGM_RD_W((*tt)[i-1][1]) + 17bae: 41 50 subi r20, 0x01 ; 1 17bb0: 51 09 sbc r21, r1 17bb2: 44 0f add r20, r20 17bb4: 55 1f adc r21, r21 17bb6: 44 0f add r20, r20 17bb8: 55 1f adc r21, r21 17bba: ea 01 movw r28, r20 17bbc: c7 50 subi r28, 0x07 ; 7 17bbe: de 47 sbci r29, 0x7E ; 126 17bc0: fe 01 movw r30, r28 17bc2: 05 91 lpm r16, Z+ 17bc4: 14 91 lpm r17, Z (raw - PGM_RD_W((*tt)[i-1][0])) * 17bc6: 49 50 subi r20, 0x09 ; 9 17bc8: 5e 47 sbci r21, 0x7E ; 126 17bca: fa 01 movw r30, r20 17bcc: 65 91 lpm r22, Z+ 17bce: 74 91 lpm r23, Z (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 17bd0: f9 01 movw r30, r18 17bd2: e7 50 subi r30, 0x07 ; 7 17bd4: fe 47 sbci r31, 0x7E ; 126 17bd6: e5 90 lpm r14, Z+ 17bd8: f4 90 lpm r15, Z 17bda: fe 01 movw r30, r28 17bdc: c5 90 lpm r12, Z+ 17bde: d4 90 lpm r13, Z (float)(PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i-1][0])); 17be0: fd 01 movw r30, r26 17be2: c5 91 lpm r28, Z+ 17be4: d4 91 lpm r29, Z 17be6: fa 01 movw r30, r20 17be8: a5 90 lpm r10, Z+ 17bea: 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])) * 17bec: 86 1b sub r24, r22 17bee: 97 0b sbc r25, r23 17bf0: bc 01 movw r22, r24 17bf2: 99 0f add r25, r25 17bf4: 88 0b sbc r24, r24 17bf6: 99 0b sbc r25, r25 17bf8: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 17bfc: 2b 01 movw r4, r22 17bfe: 3c 01 movw r6, r24 (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 17c00: b7 01 movw r22, r14 17c02: 6c 19 sub r22, r12 17c04: 7d 09 sbc r23, r13 17c06: 07 2e mov r0, r23 17c08: 00 0c add r0, r0 17c0a: 88 0b sbc r24, r24 17c0c: 99 0b sbc r25, r25 17c0e: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 17c12: 9b 01 movw r18, r22 17c14: 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])) * 17c16: c3 01 movw r24, r6 17c18: b2 01 movw r22, r4 17c1a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 17c1e: 6b 01 movw r12, r22 17c20: 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])); 17c22: be 01 movw r22, r28 17c24: 6a 19 sub r22, r10 17c26: 7b 09 sbc r23, r11 17c28: 07 2e mov r0, r23 17c2a: 00 0c add r0, r0 17c2c: 88 0b sbc r24, r24 17c2e: 99 0b sbc r25, r25 17c30: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 17c34: 9b 01 movw r18, r22 17c36: 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])) / 17c38: c7 01 movw r24, r14 17c3a: b6 01 movw r22, r12 17c3c: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 17c40: 6b 01 movw r12, r22 17c42: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W((*tt)[i-1][1]) + 17c44: b8 01 movw r22, r16 17c46: 11 0f add r17, r17 17c48: 88 0b sbc r24, r24 17c4a: 99 0b sbc r25, r25 17c4c: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 17c50: 9b 01 movw r18, r22 17c52: ac 01 movw r20, r24 17c54: c7 01 movw r24, r14 17c56: b6 01 movw r22, r12 17c58: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__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; } 17c5c: df 91 pop r29 17c5e: cf 91 pop r28 17c60: 1f 91 pop r17 17c62: 0f 91 pop r16 17c64: ff 90 pop r15 17c66: ef 90 pop r14 17c68: df 90 pop r13 17c6a: cf 90 pop r12 17c6c: bf 90 pop r11 17c6e: af 90 pop r10 17c70: 7f 90 pop r7 17c72: 6f 90 pop r6 17c74: 5f 90 pop r5 17c76: 4f 90 pop r4 17c78: 08 95 ret 17c7a: 4f 5f subi r20, 0xFF ; 255 17c7c: 5f 4f sbci r21, 0xFF ; 255 17c7e: 2c 5f subi r18, 0xFC ; 252 17c80: 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 17c88: 88 cf rjmp .-240 ; 0x17b9a break; } } // Overflow: Set to last value in the table if (i == heater_ttbllen_map[e]) celsius = PGM_RD_W((*tt)[i-1][1]); 17c8a: e5 e7 ldi r30, 0x75 ; 117 17c8c: f2 e8 ldi r31, 0x82 ; 130 17c8e: 65 91 lpm r22, Z+ 17c90: 74 91 lpm r23, Z 17c92: 07 2e mov r0, r23 17c94: 00 0c add r0, r0 17c96: 88 0b sbc r24, r24 17c98: 99 0b sbc r25, r25 17c9a: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 17c9e: de cf rjmp .-68 ; 0x17c5c 00017ca0 : { previous_millis_cmd.start(); } #ifdef FWRETRACT void retract(bool retracting, bool swapretract = false) { 17ca0: 8f 92 push r8 17ca2: 9f 92 push r9 17ca4: af 92 push r10 17ca6: bf 92 push r11 17ca8: cf 92 push r12 17caa: df 92 push r13 17cac: ef 92 push r14 17cae: ff 92 push r15 17cb0: 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]) { 17cb4: 88 23 and r24, r24 17cb6: 09 f4 brne .+2 ; 0x17cba 17cb8: 9d c0 rjmp .+314 ; 0x17df4 17cba: 91 11 cpse r25, r1 17cbc: 92 c0 rjmp .+292 ; 0x17de2 st_synchronize(); 17cbe: 0f 94 ce 22 call 0x2459c ; 0x2459c set_destination_to_current(); 17cc2: 0e 94 2c 61 call 0xc258 ; 0xc258 current_position[E_AXIS]+=(swapretract?retract_length_swap:cs.retract_length)*float(extrudemultiply)*0.01f; 17cc6: 60 91 59 02 lds r22, 0x0259 ; 0x800259 17cca: 70 91 5a 02 lds r23, 0x025A ; 0x80025a 17cce: 07 2e mov r0, r23 17cd0: 00 0c add r0, r0 17cd2: 88 0b sbc r24, r24 17cd4: 99 0b sbc r25, r25 17cd6: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 17cda: 20 91 b5 04 lds r18, 0x04B5 ; 0x8004b5 17cde: 30 91 b6 04 lds r19, 0x04B6 ; 0x8004b6 17ce2: 40 91 b7 04 lds r20, 0x04B7 ; 0x8004b7 17ce6: 50 91 b8 04 lds r21, 0x04B8 ; 0x8004b8 17cea: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 17cee: 2a e0 ldi r18, 0x0A ; 10 17cf0: 37 ed ldi r19, 0xD7 ; 215 17cf2: 43 e2 ldi r20, 0x23 ; 35 17cf4: 5c e3 ldi r21, 0x3C ; 60 17cf6: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 17cfa: 20 91 01 12 lds r18, 0x1201 ; 0x801201 17cfe: 30 91 02 12 lds r19, 0x1202 ; 0x801202 17d02: 40 91 03 12 lds r20, 0x1203 ; 0x801203 17d06: 50 91 04 12 lds r21, 0x1204 ; 0x801204 17d0a: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 17d0e: 60 93 01 12 sts 0x1201, r22 ; 0x801201 17d12: 70 93 02 12 sts 0x1202, r23 ; 0x801202 17d16: 80 93 03 12 sts 0x1203, r24 ; 0x801203 17d1a: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_set_e_position(current_position[E_AXIS]); 17d1e: 81 e0 ldi r24, 0x01 ; 1 17d20: 92 e1 ldi r25, 0x12 ; 18 17d22: 0f 94 87 75 call 0x2eb0e ; 0x2eb0e float oldFeedrate = feedrate; 17d26: c0 90 7a 02 lds r12, 0x027A ; 0x80027a 17d2a: d0 90 7b 02 lds r13, 0x027B ; 0x80027b 17d2e: e0 90 7c 02 lds r14, 0x027C ; 0x80027c 17d32: f0 90 7d 02 lds r15, 0x027D ; 0x80027d feedrate=cs.retract_feedrate*60; 17d36: 20 e0 ldi r18, 0x00 ; 0 17d38: 30 e0 ldi r19, 0x00 ; 0 17d3a: 40 e7 ldi r20, 0x70 ; 112 17d3c: 52 e4 ldi r21, 0x42 ; 66 17d3e: 60 91 b9 04 lds r22, 0x04B9 ; 0x8004b9 17d42: 70 91 ba 04 lds r23, 0x04BA ; 0x8004ba 17d46: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 17d4a: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 17d4e: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 17d52: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a 17d56: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b 17d5a: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 17d5e: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d retracted[active_extruder]=true; 17d62: 81 e0 ldi r24, 0x01 ; 1 17d64: 80 93 03 05 sts 0x0503, r24 ; 0x800503 prepare_move(); 17d68: 90 e0 ldi r25, 0x00 ; 0 17d6a: 80 e0 ldi r24, 0x00 ; 0 17d6c: 0e 94 fa 64 call 0xc9f4 ; 0xc9f4 if(cs.retract_zlift) { 17d70: 20 e0 ldi r18, 0x00 ; 0 17d72: 30 e0 ldi r19, 0x00 ; 0 17d74: a9 01 movw r20, r18 17d76: 60 91 bd 04 lds r22, 0x04BD ; 0x8004bd 17d7a: 70 91 be 04 lds r23, 0x04BE ; 0x8004be 17d7e: 80 91 bf 04 lds r24, 0x04BF ; 0x8004bf 17d82: 90 91 c0 04 lds r25, 0x04C0 ; 0x8004c0 17d86: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 17d8a: 88 23 and r24, r24 17d8c: 11 f1 breq .+68 ; 0x17dd2 st_synchronize(); 17d8e: 0f 94 ce 22 call 0x2459c ; 0x2459c current_position[Z_AXIS]-=cs.retract_zlift; 17d92: 20 91 bd 04 lds r18, 0x04BD ; 0x8004bd 17d96: 30 91 be 04 lds r19, 0x04BE ; 0x8004be 17d9a: 40 91 bf 04 lds r20, 0x04BF ; 0x8004bf 17d9e: 50 91 c0 04 lds r21, 0x04C0 ; 0x8004c0 17da2: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 17da6: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 17daa: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 17dae: 90 91 00 12 lds r25, 0x1200 ; 0x801200 17db2: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 17db6: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 17dba: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 17dbe: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 17dc2: 90 93 00 12 sts 0x1200, r25 ; 0x801200 plan_set_position_curposXYZE(); 17dc6: 0f 94 ef 83 call 0x307de ; 0x307de prepare_move(); 17dca: 90 e0 ldi r25, 0x00 ; 0 17dcc: 80 e0 ldi r24, 0x00 ; 0 17dce: 0e 94 fa 64 call 0xc9f4 ; 0xc9f4 } feedrate = oldFeedrate; 17dd2: c0 92 7a 02 sts 0x027A, r12 ; 0x80027a 17dd6: d0 92 7b 02 sts 0x027B, r13 ; 0x80027b 17dda: e0 92 7c 02 sts 0x027C, r14 ; 0x80027c 17dde: 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 17de2: ff 90 pop r15 17de4: ef 90 pop r14 17de6: df 90 pop r13 17de8: cf 90 pop r12 17dea: bf 90 pop r11 17dec: af 90 pop r10 17dee: 9f 90 pop r9 17df0: 8f 90 pop r8 17df2: 08 95 ret current_position[Z_AXIS]-=cs.retract_zlift; plan_set_position_curposXYZE(); prepare_move(); } feedrate = oldFeedrate; } else if(!retracting && retracted[active_extruder]) { 17df4: 99 23 and r25, r25 17df6: a9 f3 breq .-22 ; 0x17de2 st_synchronize(); 17df8: 0f 94 ce 22 call 0x2459c ; 0x2459c set_destination_to_current(); 17dfc: 0e 94 2c 61 call 0xc258 ; 0xc258 float oldFeedrate = feedrate; 17e00: 80 90 7a 02 lds r8, 0x027A ; 0x80027a 17e04: 90 90 7b 02 lds r9, 0x027B ; 0x80027b 17e08: a0 90 7c 02 lds r10, 0x027C ; 0x80027c 17e0c: b0 90 7d 02 lds r11, 0x027D ; 0x80027d feedrate=cs.retract_recover_feedrate*60; 17e10: 20 e0 ldi r18, 0x00 ; 0 17e12: 30 e0 ldi r19, 0x00 ; 0 17e14: 40 e7 ldi r20, 0x70 ; 112 17e16: 52 e4 ldi r21, 0x42 ; 66 17e18: 60 91 c5 04 lds r22, 0x04C5 ; 0x8004c5 17e1c: 70 91 c6 04 lds r23, 0x04C6 ; 0x8004c6 17e20: 80 91 c7 04 lds r24, 0x04C7 ; 0x8004c7 17e24: 90 91 c8 04 lds r25, 0x04C8 ; 0x8004c8 17e28: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 17e2c: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a 17e30: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b 17e34: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 17e38: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d if(cs.retract_zlift) { 17e3c: c0 90 bd 04 lds r12, 0x04BD ; 0x8004bd 17e40: d0 90 be 04 lds r13, 0x04BE ; 0x8004be 17e44: e0 90 bf 04 lds r14, 0x04BF ; 0x8004bf 17e48: f0 90 c0 04 lds r15, 0x04C0 ; 0x8004c0 17e4c: 20 e0 ldi r18, 0x00 ; 0 17e4e: 30 e0 ldi r19, 0x00 ; 0 17e50: a9 01 movw r20, r18 17e52: c7 01 movw r24, r14 17e54: b6 01 movw r22, r12 17e56: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 17e5a: 88 23 and r24, r24 17e5c: e1 f0 breq .+56 ; 0x17e96 current_position[Z_AXIS]+=cs.retract_zlift; 17e5e: a7 01 movw r20, r14 17e60: 96 01 movw r18, r12 17e62: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 17e66: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 17e6a: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 17e6e: 90 91 00 12 lds r25, 0x1200 ; 0x801200 17e72: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 17e76: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 17e7a: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 17e7e: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 17e82: 90 93 00 12 sts 0x1200, r25 ; 0x801200 plan_set_position_curposXYZE(); 17e86: 0f 94 ef 83 call 0x307de ; 0x307de prepare_move(); 17e8a: 90 e0 ldi r25, 0x00 ; 0 17e8c: 80 e0 ldi r24, 0x00 ; 0 17e8e: 0e 94 fa 64 call 0xc9f4 ; 0xc9f4 st_synchronize(); 17e92: 0f 94 ce 22 call 0x2459c ; 0x2459c } current_position[E_AXIS]-=(swapretract?(retract_length_swap+retract_recover_length_swap):(cs.retract_length+cs.retract_recover_length))*float(extrudemultiply)*0.01f; 17e96: 20 91 c1 04 lds r18, 0x04C1 ; 0x8004c1 17e9a: 30 91 c2 04 lds r19, 0x04C2 ; 0x8004c2 17e9e: 40 91 c3 04 lds r20, 0x04C3 ; 0x8004c3 17ea2: 50 91 c4 04 lds r21, 0x04C4 ; 0x8004c4 17ea6: 60 91 b5 04 lds r22, 0x04B5 ; 0x8004b5 17eaa: 70 91 b6 04 lds r23, 0x04B6 ; 0x8004b6 17eae: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 17eb2: 90 91 b8 04 lds r25, 0x04B8 ; 0x8004b8 17eb6: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 17eba: 6b 01 movw r12, r22 17ebc: 7c 01 movw r14, r24 17ebe: 60 91 59 02 lds r22, 0x0259 ; 0x800259 17ec2: 70 91 5a 02 lds r23, 0x025A ; 0x80025a 17ec6: 07 2e mov r0, r23 17ec8: 00 0c add r0, r0 17eca: 88 0b sbc r24, r24 17ecc: 99 0b sbc r25, r25 17ece: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 17ed2: 9b 01 movw r18, r22 17ed4: ac 01 movw r20, r24 17ed6: c7 01 movw r24, r14 17ed8: b6 01 movw r22, r12 17eda: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 17ede: 2a e0 ldi r18, 0x0A ; 10 17ee0: 37 ed ldi r19, 0xD7 ; 215 17ee2: 43 e2 ldi r20, 0x23 ; 35 17ee4: 5c e3 ldi r21, 0x3C ; 60 17ee6: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 17eea: 9b 01 movw r18, r22 17eec: ac 01 movw r20, r24 17eee: 60 91 01 12 lds r22, 0x1201 ; 0x801201 17ef2: 70 91 02 12 lds r23, 0x1202 ; 0x801202 17ef6: 80 91 03 12 lds r24, 0x1203 ; 0x801203 17efa: 90 91 04 12 lds r25, 0x1204 ; 0x801204 17efe: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 17f02: 60 93 01 12 sts 0x1201, r22 ; 0x801201 17f06: 70 93 02 12 sts 0x1202, r23 ; 0x801202 17f0a: 80 93 03 12 sts 0x1203, r24 ; 0x801203 17f0e: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_set_e_position(current_position[E_AXIS]); 17f12: 81 e0 ldi r24, 0x01 ; 1 17f14: 92 e1 ldi r25, 0x12 ; 18 17f16: 0f 94 87 75 call 0x2eb0e ; 0x2eb0e retracted[active_extruder]=false; 17f1a: 10 92 03 05 sts 0x0503, r1 ; 0x800503 prepare_move(); 17f1e: 90 e0 ldi r25, 0x00 ; 0 17f20: 80 e0 ldi r24, 0x00 ; 0 17f22: 0e 94 fa 64 call 0xc9f4 ; 0xc9f4 feedrate = oldFeedrate; 17f26: 80 92 7a 02 sts 0x027A, r8 ; 0x80027a 17f2a: 90 92 7b 02 sts 0x027B, r9 ; 0x80027b 17f2e: a0 92 7c 02 sts 0x027C, r10 ; 0x80027c 17f32: b0 92 7d 02 sts 0x027D, r11 ; 0x80027d 17f36: 55 cf rjmp .-342 ; 0x17de2 00017f38 : // Update cached value lastReadRegisterValue = logic.rsp.paramValue; return true; } bool __attribute__((noinline)) MMU2::WriteRegister(uint8_t address, uint16_t data) { 17f38: ef 92 push r14 17f3a: ff 92 push r15 17f3c: 0f 93 push r16 17f3e: 1f 93 push r17 17f40: cf 93 push r28 17f42: df 93 push r29 17f44: 00 d0 rcall .+0 ; 0x17f46 17f46: 1f 92 push r1 17f48: 1f 92 push r1 17f4a: cd b7 in r28, 0x3d ; 61 17f4c: de b7 in r29, 0x3e ; 62 17f4e: 08 2f mov r16, r24 17f50: 16 2f mov r17, r22 17f52: f7 2e mov r15, r23 if (!WaitForMMUReady()) { 17f54: 0f 94 73 54 call 0x2a8e6 ; 0x2a8e6 17f58: 88 23 and r24, r24 17f5a: d9 f0 breq .+54 ; 0x17f92 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) { 17f5c: 0b 30 cpi r16, 0x0B ; 11 17f5e: 29 f1 breq .+74 ; 0x17faa 17f60: 04 31 cpi r16, 0x14 ; 20 17f62: 31 f1 breq .+76 ; 0x17fb0 /// @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()) { 17f64: 87 e5 ldi r24, 0x57 ; 87 17f66: e8 2e mov r14, r24 17f68: e9 82 std Y+1, r14 ; 0x01 17f6a: 0a 83 std Y+2, r16 ; 0x02 17f6c: 1b 83 std Y+3, r17 ; 0x03 17f6e: fc 82 std Y+4, r15 ; 0x04 17f70: ce 01 movw r24, r28 17f72: 01 96 adiw r24, 0x01 ; 1 17f74: 0f 94 8e 87 call 0x30f1c ; 0x30f1c 17f78: 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)); 17f7a: 47 e5 ldi r20, 0x57 ; 87 17f7c: 50 2f mov r21, r16 17f7e: 61 2f mov r22, r17 17f80: 7f 2d mov r23, r15 17f82: 0f 94 f2 62 call 0x2c5e4 ; 0x2c5e4 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)); 17f86: 60 e0 ldi r22, 0x00 ; 0 17f88: 80 e0 ldi r24, 0x00 ; 0 17f8a: 0f 94 87 6a call 0x2d50e ; 0x2d50e 17f8e: 88 23 and r24, r24 17f90: 59 f3 breq .-42 ; 0x17f68 return true; } 17f92: 0f 90 pop r0 17f94: 0f 90 pop r0 17f96: 0f 90 pop r0 17f98: 0f 90 pop r0 17f9a: 0f 90 pop r0 17f9c: df 91 pop r29 17f9e: cf 91 pop r28 17fa0: 1f 91 pop r17 17fa2: 0f 91 pop r16 17fa4: ff 90 pop r15 17fa6: ef 90 pop r14 17fa8: 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); 17faa: 10 93 71 12 sts 0x1271, r17 ; 0x801271 17fae: da cf rjmp .-76 ; 0x17f64 break; case (uint8_t)Register::Pulley_Slow_Feedrate: logic.PlanPulleySlowFeedRate(data); 17fb0: 10 93 72 12 sts 0x1272, r17 ; 0x801272 17fb4: d7 cf rjmp .-82 ; 0x17f64 00017fb6 : #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) 17fb6: 82 30 cpi r24, 0x02 ; 2 17fb8: 91 05 cpc r25, r1 17fba: 38 f0 brcs .+14 ; 0x17fca // 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 17fbc: 88 0f add r24, r24 17fbe: 99 1f adc r25, r25 17fc0: 88 0f add r24, r24 17fc2: 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, 17fc4: 05 97 sbiw r24, 0x05 ; 5 #endif // busy wait __asm__ __volatile__ ( 17fc6: 01 97 sbiw r24, 0x01 ; 1 17fc8: f1 f7 brne .-4 ; 0x17fc6 "1: sbiw %0,1" "\n\t" // 2 cycles "brne 1b" : "=w" (us) : "0" (us) // 2 cycles ); // return = 4 cycles } 17fca: 08 95 ret 00017fcc : SREG = oldSREG; } int digitalRead(uint8_t pin) { 17fcc: cf 93 push r28 17fce: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 17fd0: 28 2f mov r18, r24 17fd2: 30 e0 ldi r19, 0x00 ; 0 17fd4: f9 01 movw r30, r18 17fd6: ec 5b subi r30, 0xBC ; 188 17fd8: fa 47 sbci r31, 0x7A ; 122 17fda: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 17fdc: f9 01 movw r30, r18 17fde: e2 51 subi r30, 0x12 ; 18 17fe0: fb 47 sbci r31, 0x7B ; 123 17fe2: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 17fe4: f9 01 movw r30, r18 17fe6: e8 56 subi r30, 0x68 ; 104 17fe8: fb 47 sbci r31, 0x7B ; 123 17fea: c4 91 lpm r28, Z if (port == NOT_A_PIN) return LOW; 17fec: cc 23 and r28, r28 17fee: a1 f0 breq .+40 ; 0x18018 // 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); 17ff0: 81 11 cpse r24, r1 17ff2: 0e 94 95 b0 call 0x1612a ; 0x1612a if (*portInputRegister(port) & bit) return HIGH; 17ff6: ec 2f mov r30, r28 17ff8: f0 e0 ldi r31, 0x00 ; 0 17ffa: ee 0f add r30, r30 17ffc: ff 1f adc r31, r31 17ffe: e2 58 subi r30, 0x82 ; 130 18000: fb 47 sbci r31, 0x7B ; 123 18002: a5 91 lpm r26, Z+ 18004: b4 91 lpm r27, Z 18006: ec 91 ld r30, X 18008: ed 23 and r30, r29 1800a: 81 e0 ldi r24, 0x01 ; 1 1800c: 90 e0 ldi r25, 0x00 ; 0 1800e: 09 f4 brne .+2 ; 0x18012 18010: 80 e0 ldi r24, 0x00 ; 0 return LOW; } 18012: df 91 pop r29 18014: cf 91 pop r28 18016: 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; 18018: 80 e0 ldi r24, 0x00 ; 0 1801a: 90 e0 ldi r25, 0x00 ; 0 1801c: fa cf rjmp .-12 ; 0x18012 0001801e : #endif } } void digitalWrite(uint8_t pin, uint8_t val) { 1801e: 1f 93 push r17 18020: cf 93 push r28 18022: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 18024: 28 2f mov r18, r24 18026: 30 e0 ldi r19, 0x00 ; 0 18028: f9 01 movw r30, r18 1802a: ec 5b subi r30, 0xBC ; 188 1802c: fa 47 sbci r31, 0x7A ; 122 1802e: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 18030: f9 01 movw r30, r18 18032: e2 51 subi r30, 0x12 ; 18 18034: fb 47 sbci r31, 0x7B ; 123 18036: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 18038: f9 01 movw r30, r18 1803a: e8 56 subi r30, 0x68 ; 104 1803c: fb 47 sbci r31, 0x7B ; 123 1803e: c4 91 lpm r28, Z volatile uint8_t *out; if (port == NOT_A_PIN) return; 18040: cc 23 and r28, r28 18042: a9 f0 breq .+42 ; 0x1806e 18044: 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); 18046: 81 11 cpse r24, r1 18048: 0e 94 95 b0 call 0x1612a ; 0x1612a out = portOutputRegister(port); 1804c: ec 2f mov r30, r28 1804e: f0 e0 ldi r31, 0x00 ; 0 18050: ee 0f add r30, r30 18052: ff 1f adc r31, r31 18054: ec 59 subi r30, 0x9C ; 156 18056: fb 47 sbci r31, 0x7B ; 123 18058: a5 91 lpm r26, Z+ 1805a: b4 91 lpm r27, Z uint8_t oldSREG = SREG; 1805c: 8f b7 in r24, 0x3f ; 63 cli(); 1805e: f8 94 cli if (val == LOW) { *out &= ~bit; 18060: ec 91 ld r30, X out = portOutputRegister(port); uint8_t oldSREG = SREG; cli(); if (val == LOW) { 18062: 11 11 cpse r17, r1 18064: 08 c0 rjmp .+16 ; 0x18076 *out &= ~bit; 18066: d0 95 com r29 18068: de 23 and r29, r30 } else { *out |= bit; 1806a: dc 93 st X, r29 } SREG = oldSREG; 1806c: 8f bf out 0x3f, r24 ; 63 } 1806e: df 91 pop r29 18070: cf 91 pop r28 18072: 1f 91 pop r17 18074: 08 95 ret cli(); if (val == LOW) { *out &= ~bit; } else { *out |= bit; 18076: de 2b or r29, r30 18078: f8 cf rjmp .-16 ; 0x1806a 0001807a : #define ARDUINO_MAIN #include "wiring_private.h" #include "pins_arduino.h" void pinMode(uint8_t pin, uint8_t mode) { 1807a: cf 93 push r28 1807c: df 93 push r29 uint8_t bit = digitalPinToBitMask(pin); 1807e: 90 e0 ldi r25, 0x00 ; 0 18080: fc 01 movw r30, r24 18082: e2 51 subi r30, 0x12 ; 18 18084: fb 47 sbci r31, 0x7B ; 123 18086: 24 91 lpm r18, Z uint8_t port = digitalPinToPort(pin); 18088: 88 56 subi r24, 0x68 ; 104 1808a: 9b 47 sbci r25, 0x7B ; 123 1808c: fc 01 movw r30, r24 1808e: 84 91 lpm r24, Z volatile uint8_t *reg, *out; if (port == NOT_A_PIN) return; 18090: 88 23 and r24, r24 18092: d1 f0 breq .+52 ; 0x180c8 // JWS: can I let the optimizer do this? reg = portModeRegister(port); 18094: 90 e0 ldi r25, 0x00 ; 0 18096: 88 0f add r24, r24 18098: 99 1f adc r25, r25 1809a: fc 01 movw r30, r24 1809c: e6 5b subi r30, 0xB6 ; 182 1809e: fb 47 sbci r31, 0x7B ; 123 180a0: a5 91 lpm r26, Z+ 180a2: b4 91 lpm r27, Z out = portOutputRegister(port); 180a4: fc 01 movw r30, r24 180a6: ec 59 subi r30, 0x9C ; 156 180a8: fb 47 sbci r31, 0x7B ; 123 180aa: c5 91 lpm r28, Z+ 180ac: d4 91 lpm r29, Z if (mode == INPUT) { 180ae: 61 11 cpse r22, r1 180b0: 0e c0 rjmp .+28 ; 0x180ce uint8_t oldSREG = SREG; 180b2: 9f b7 in r25, 0x3f ; 63 cli(); 180b4: f8 94 cli *reg &= ~bit; 180b6: 8c 91 ld r24, X 180b8: e2 2f mov r30, r18 180ba: e0 95 com r30 180bc: 8e 23 and r24, r30 180be: 8c 93 st X, r24 *out &= ~bit; 180c0: 28 81 ld r18, Y 180c2: e2 23 and r30, r18 180c4: e8 83 st Y, r30 SREG = oldSREG; 180c6: 9f bf out 0x3f, r25 ; 63 uint8_t oldSREG = SREG; cli(); *reg |= bit; SREG = oldSREG; } } 180c8: df 91 pop r29 180ca: cf 91 pop r28 180cc: 08 95 ret cli(); *reg &= ~bit; *out |= bit; SREG = oldSREG; } else { uint8_t oldSREG = SREG; 180ce: 8f b7 in r24, 0x3f ; 63 cli(); 180d0: f8 94 cli *reg |= bit; 180d2: ec 91 ld r30, X 180d4: e2 2b or r30, r18 180d6: ec 93 st X, r30 SREG = oldSREG; 180d8: 8f bf out 0x3f, r24 ; 63 180da: f6 cf rjmp .-20 ; 0x180c8 000180dc : // 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) { 180dc: 1f 93 push r17 180de: cf 93 push r28 180e0: df 93 push r29 180e2: 18 2f mov r17, r24 180e4: 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); 180e6: 61 e0 ldi r22, 0x01 ; 1 180e8: 0e 94 3d c0 call 0x1807a ; 0x1807a if (val == 0) 180ec: 20 97 sbiw r28, 0x00 ; 0 180ee: 39 f4 brne .+14 ; 0x180fe { digitalWrite(pin, LOW); 180f0: 60 e0 ldi r22, 0x00 ; 0 } else if (val == 255) { digitalWrite(pin, HIGH); 180f2: 81 2f mov r24, r17 } else { digitalWrite(pin, HIGH); } } } } 180f4: df 91 pop r29 180f6: cf 91 pop r28 180f8: 1f 91 pop r17 { digitalWrite(pin, LOW); } else if (val == 255) { digitalWrite(pin, HIGH); 180fa: 0c 94 0f c0 jmp 0x1801e ; 0x1801e pinMode(pin, OUTPUT); if (val == 0) { digitalWrite(pin, LOW); } else if (val == 255) 180fe: cf 3f cpi r28, 0xFF ; 255 18100: d1 05 cpc r29, r1 18102: 11 f4 brne .+4 ; 0x18108 { digitalWrite(pin, HIGH); 18104: 61 e0 ldi r22, 0x01 ; 1 18106: f5 cf rjmp .-22 ; 0x180f2 } else { switch(digitalPinToTimer(pin)) 18108: e1 2f mov r30, r17 1810a: f0 e0 ldi r31, 0x00 ; 0 1810c: ec 5b subi r30, 0xBC ; 188 1810e: fa 47 sbci r31, 0x7A ; 122 18110: e4 91 lpm r30, Z 18112: e1 50 subi r30, 0x01 ; 1 18114: e2 31 cpi r30, 0x12 ; 18 18116: 08 f0 brcs .+2 ; 0x1811a 18118: b3 c0 rjmp .+358 ; 0x18280 1811a: f0 e0 ldi r31, 0x00 ; 0 1811c: 88 27 eor r24, r24 1811e: ec 56 subi r30, 0x6C ; 108 18120: ff 43 sbci r31, 0x3F ; 63 18122: 8f 4f sbci r24, 0xFF ; 255 18124: 0d 94 ab a1 jmp 0x34356 ; 0x34356 <__tablejump2__> 18128: a6 c0 rjmp .+332 ; 0x18276 1812a: ae c0 rjmp .+348 ; 0x18288 1812c: b3 c0 rjmp .+358 ; 0x18294 1812e: bd c0 rjmp .+378 ; 0x182aa 18130: c7 c0 rjmp .+398 ; 0x182c0 18132: 40 c1 rjmp .+640 ; 0x183b4 18134: d1 c0 rjmp .+418 ; 0x182d8 18136: d9 c0 rjmp .+434 ; 0x182ea 18138: e1 c0 rjmp .+450 ; 0x182fc 1813a: eb c0 rjmp .+470 ; 0x18312 1813c: f5 c0 rjmp .+490 ; 0x18328 1813e: ff c0 rjmp .+510 ; 0x1833e 18140: 0e c1 rjmp .+540 ; 0x1835e 18142: 18 c1 rjmp .+560 ; 0x18374 18144: 40 c1 rjmp .+640 ; 0x183c6 18146: 22 c1 rjmp .+580 ; 0x1838c 18148: 2c c1 rjmp .+600 ; 0x183a2 1814a: 36 c1 rjmp .+620 ; 0x183b8 #endif #if defined(TCCR0A) && defined(COM0A1) case TIMER0A: // connect pwm to pin on timer 0, channel A sbi(TCCR0A, COM0A1); 1814c: 84 b5 in r24, 0x24 ; 36 1814e: 80 68 ori r24, 0x80 ; 128 18150: 84 bd out 0x24, r24 ; 36 OCR0A = val; // set pwm duty 18152: c7 bd out 0x27, r28 ; 39 } else { digitalWrite(pin, HIGH); } } } } 18154: df 91 pop r29 18156: cf 91 pop r28 18158: 1f 91 pop r17 1815a: 08 95 ret #endif #if defined(TCCR0A) && defined(COM0B1) case TIMER0B: // connect pwm to pin on timer 0, channel B sbi(TCCR0A, COM0B1); 1815c: 84 b5 in r24, 0x24 ; 36 1815e: 80 62 ori r24, 0x20 ; 32 18160: 84 bd out 0x24, r24 ; 36 OCR0B = val; // set pwm duty 18162: c8 bd out 0x28, r28 ; 40 18164: f7 cf rjmp .-18 ; 0x18154 #endif #if defined(TCCR1A) && defined(COM1A1) case TIMER1A: // connect pwm to pin on timer 1, channel A sbi(TCCR1A, COM1A1); 18166: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1816a: 80 68 ori r24, 0x80 ; 128 1816c: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1A = val; // set pwm duty 18170: d0 93 89 00 sts 0x0089, r29 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 18174: c0 93 88 00 sts 0x0088, r28 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 18178: ed cf rjmp .-38 ; 0x18154 #endif #if defined(TCCR1A) && defined(COM1B1) case TIMER1B: // connect pwm to pin on timer 1, channel B sbi(TCCR1A, COM1B1); 1817a: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1817e: 80 62 ori r24, 0x20 ; 32 18180: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1B = val; // set pwm duty 18184: d0 93 8b 00 sts 0x008B, r29 ; 0x80008b <__TEXT_REGION_LENGTH__+0x7c208b> 18188: c0 93 8a 00 sts 0x008A, r28 ; 0x80008a <__TEXT_REGION_LENGTH__+0x7c208a> 1818c: e3 cf rjmp .-58 ; 0x18154 #endif #if defined(TCCR1A) && defined(COM1C1) case TIMER1C: // connect pwm to pin on timer 1, channel C sbi(TCCR1A, COM1C1); 1818e: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 18192: 88 60 ori r24, 0x08 ; 8 18194: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1C = val; // set pwm duty 18198: d0 93 8d 00 sts 0x008D, r29 ; 0x80008d <__TEXT_REGION_LENGTH__+0x7c208d> 1819c: c0 93 8c 00 sts 0x008C, r28 ; 0x80008c <__TEXT_REGION_LENGTH__+0x7c208c> 181a0: d9 cf rjmp .-78 ; 0x18154 #endif #if defined(TCCR2A) && defined(COM2A1) case TIMER2A: // connect pwm to pin on timer 2, channel A sbi(TCCR2A, COM2A1); 181a2: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 181a6: 80 68 ori r24, 0x80 ; 128 181a8: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2A = val; // set pwm duty 181ac: c0 93 b3 00 sts 0x00B3, r28 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> 181b0: d1 cf rjmp .-94 ; 0x18154 #endif #if defined(TCCR2A) && defined(COM2B1) case TIMER2B: // connect pwm to pin on timer 2, channel B sbi(TCCR2A, COM2B1); 181b2: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 181b6: 80 62 ori r24, 0x20 ; 32 181b8: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2B = val; // set pwm duty 181bc: c0 93 b4 00 sts 0x00B4, r28 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> 181c0: c9 cf rjmp .-110 ; 0x18154 #endif #if defined(TCCR3A) && defined(COM3A1) case TIMER3A: // connect pwm to pin on timer 3, channel A sbi(TCCR3A, COM3A1); 181c2: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 181c6: 80 68 ori r24, 0x80 ; 128 181c8: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3A = val; // set pwm duty 181cc: d0 93 99 00 sts 0x0099, r29 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 181d0: c0 93 98 00 sts 0x0098, r28 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> 181d4: bf cf rjmp .-130 ; 0x18154 #endif #if defined(TCCR3A) && defined(COM3B1) case TIMER3B: // connect pwm to pin on timer 3, channel B sbi(TCCR3A, COM3B1); 181d6: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 181da: 80 62 ori r24, 0x20 ; 32 181dc: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3B = val; // set pwm duty 181e0: d0 93 9b 00 sts 0x009B, r29 ; 0x80009b <__TEXT_REGION_LENGTH__+0x7c209b> 181e4: c0 93 9a 00 sts 0x009A, r28 ; 0x80009a <__TEXT_REGION_LENGTH__+0x7c209a> 181e8: b5 cf rjmp .-150 ; 0x18154 #endif #if defined(TCCR3A) && defined(COM3C1) case TIMER3C: // connect pwm to pin on timer 3, channel C sbi(TCCR3A, COM3C1); 181ea: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 181ee: 88 60 ori r24, 0x08 ; 8 181f0: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3C = val; // set pwm duty 181f4: d0 93 9d 00 sts 0x009D, r29 ; 0x80009d <__TEXT_REGION_LENGTH__+0x7c209d> 181f8: c0 93 9c 00 sts 0x009C, r28 ; 0x80009c <__TEXT_REGION_LENGTH__+0x7c209c> 181fc: ab cf rjmp .-170 ; 0x18154 #endif #if defined(TCCR4A) case TIMER4A: //connect pwm to pin on timer 4, channel A sbi(TCCR4A, COM4A1); 181fe: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 18202: 80 68 ori r24, 0x80 ; 128 18204: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #if defined(COM4A0) // only used on 32U4 cbi(TCCR4A, COM4A0); 18208: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1820c: 8f 7b andi r24, 0xBF ; 191 1820e: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #endif OCR4A = val; // set pwm duty 18212: d0 93 a9 00 sts 0x00A9, r29 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 18216: c0 93 a8 00 sts 0x00A8, r28 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 1821a: 9c cf rjmp .-200 ; 0x18154 #endif #if defined(TCCR4A) && defined(COM4B1) case TIMER4B: // connect pwm to pin on timer 4, channel B sbi(TCCR4A, COM4B1); 1821c: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 18220: 80 62 ori r24, 0x20 ; 32 18222: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4B = val; // set pwm duty 18226: d0 93 ab 00 sts 0x00AB, r29 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1822a: c0 93 aa 00 sts 0x00AA, r28 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> 1822e: 92 cf rjmp .-220 ; 0x18154 #endif #if defined(TCCR4A) && defined(COM4C1) case TIMER4C: // connect pwm to pin on timer 4, channel C sbi(TCCR4A, COM4C1); 18230: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 18234: 88 60 ori r24, 0x08 ; 8 18236: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = val; // set pwm duty 1823a: d0 93 ad 00 sts 0x00AD, r29 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1823e: c0 93 ac 00 sts 0x00AC, r28 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 18242: 88 cf rjmp .-240 ; 0x18154 #if defined(TCCR5A) && defined(COM5A1) case TIMER5A: // connect pwm to pin on timer 5, channel A sbi(TCCR5A, COM5A1); 18244: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 18248: 80 68 ori r24, 0x80 ; 128 1824a: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5A = val; // set pwm duty 1824e: d0 93 29 01 sts 0x0129, r29 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 18252: c0 93 28 01 sts 0x0128, r28 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> 18256: 7e cf rjmp .-260 ; 0x18154 #endif #if defined(TCCR5A) && defined(COM5B1) case TIMER5B: // connect pwm to pin on timer 5, channel B sbi(TCCR5A, COM5B1); 18258: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1825c: 80 62 ori r24, 0x20 ; 32 1825e: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5B = val; // set pwm duty 18262: d0 93 2b 01 sts 0x012B, r29 ; 0x80012b <__TEXT_REGION_LENGTH__+0x7c212b> 18266: c0 93 2a 01 sts 0x012A, r28 ; 0x80012a <__TEXT_REGION_LENGTH__+0x7c212a> 1826a: 74 cf rjmp .-280 ; 0x18154 #endif #if defined(TCCR5A) && defined(COM5C1) case TIMER5C: // connect pwm to pin on timer 5, channel C sbi(TCCR5A, COM5C1); 1826c: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 18270: 88 60 ori r24, 0x08 ; 8 18272: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5C = val; // set pwm duty 18276: d0 93 2d 01 sts 0x012D, r29 ; 0x80012d <__TEXT_REGION_LENGTH__+0x7c212d> 1827a: c0 93 2c 01 sts 0x012C, r28 ; 0x80012c <__TEXT_REGION_LENGTH__+0x7c212c> 1827e: 6a cf rjmp .-300 ; 0x18154 break; #endif case NOT_ON_TIMER: default: if (val < 128) { 18280: c0 38 cpi r28, 0x80 ; 128 18282: d1 05 cpc r29, r1 18284: 0c f0 brlt .+2 ; 0x18288 18286: 3e cf rjmp .-388 ; 0x18104 18288: 33 cf rjmp .-410 ; 0x180f0 0001828a : } } /// 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){ 1828a: 4f 92 push r4 1828c: 5f 92 push r5 1828e: 6f 92 push r6 18290: 7f 92 push r7 18292: 8f 92 push r8 18294: 9f 92 push r9 18296: af 92 push r10 18298: bf 92 push r11 1829a: cf 92 push r12 1829c: df 92 push r13 1829e: ef 92 push r14 182a0: ff 92 push r15 182a2: 0f 93 push r16 182a4: 1f 93 push r17 182a6: cf 93 push r28 182a8: df 93 push r29 182aa: eb 01 movw r28, r22 182ac: 6a 01 movw r12, r20 182ae: 79 01 movw r14, r18 sm4_do_step(axes); 182b0: 0f 94 b5 36 call 0x26d6a ; 0x26d6a 182b4: f6 01 movw r30, r12 182b6: 00 81 ld r16, Z 182b8: 11 81 ldd r17, Z+1 ; 0x01 /// keep max speed (avoid extra computation) if (acc > 0 && delay_us == min_delay_us){ 182ba: 1c 16 cp r1, r28 182bc: 1d 06 cpc r1, r29 182be: b4 f4 brge .+44 ; 0x182ec 182c0: 0e 15 cp r16, r14 182c2: 1f 05 cpc r17, r15 182c4: 99 f4 brne .+38 ; 0x182ec delayMicroseconds(delay_us); 182c6: c8 01 movw r24, r16 //DBG(_n("%d "), t1); delayMicroseconds(t1); delay_us = t1; } 182c8: df 91 pop r29 182ca: cf 91 pop r28 182cc: 1f 91 pop r17 182ce: 0f 91 pop r16 182d0: ff 90 pop r15 182d2: ef 90 pop r14 182d4: df 90 pop r13 182d6: cf 90 pop r12 182d8: bf 90 pop r11 182da: af 90 pop r10 182dc: 9f 90 pop r9 182de: 8f 90 pop r8 182e0: 7f 90 pop r7 182e2: 6f 90 pop r6 182e4: 5f 90 pop r5 182e6: 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); 182e8: 0c 94 db bf jmp 0x17fb6 ; 0x17fb6 return; } // v1 = v0 + a * t // 0.01 = length of a step const float t0 = delay_us * 0.000001f; 182ec: b8 01 movw r22, r16 182ee: 90 e0 ldi r25, 0x00 ; 0 182f0: 80 e0 ldi r24, 0x00 ; 0 182f2: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 182f6: 2d eb ldi r18, 0xBD ; 189 182f8: 37 e3 ldi r19, 0x37 ; 55 182fa: 46 e8 ldi r20, 0x86 ; 134 182fc: 55 e3 ldi r21, 0x35 ; 53 182fe: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 18302: 4b 01 movw r8, r22 18304: 5c 01 movw r10, r24 const float v1 = (0.01f / t0 + acc * t0); 18306: be 01 movw r22, r28 18308: 0d 2e mov r0, r29 1830a: 00 0c add r0, r0 1830c: 88 0b sbc r24, r24 1830e: 99 0b sbc r25, r25 18310: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 18314: a5 01 movw r20, r10 18316: 94 01 movw r18, r8 18318: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1831c: 2b 01 movw r4, r22 1831e: 3c 01 movw r6, r24 18320: a5 01 movw r20, r10 18322: 94 01 movw r18, r8 18324: 6a e0 ldi r22, 0x0A ; 10 18326: 77 ed ldi r23, 0xD7 ; 215 18328: 83 e2 ldi r24, 0x23 ; 35 1832a: 9c e3 ldi r25, 0x3C ; 60 1832c: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 18330: 9b 01 movw r18, r22 18332: ac 01 movw r20, r24 18334: c3 01 movw r24, r6 18336: b2 01 movw r22, r4 18338: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1833c: 4b 01 movw r8, r22 1833e: 5c 01 movw r10, r24 uint16_t t1; if (v1 <= 0.16f){ ///< slowest speed convertible to uint16_t delay 18340: 2a e0 ldi r18, 0x0A ; 10 18342: 37 ed ldi r19, 0xD7 ; 215 18344: 43 e2 ldi r20, 0x23 ; 35 18346: 5e e3 ldi r21, 0x3E ; 62 18348: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1834c: 18 16 cp r1, r24 1834e: dc f5 brge .+118 ; 0x183c6 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)); 18350: a5 01 movw r20, r10 18352: 94 01 movw r18, r8 18354: 6a e0 ldi r22, 0x0A ; 10 18356: 77 ed ldi r23, 0xD7 ; 215 18358: 83 e2 ldi r24, 0x23 ; 35 1835a: 9c e3 ldi r25, 0x3C ; 60 1835c: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 18360: 20 e0 ldi r18, 0x00 ; 0 18362: 34 e2 ldi r19, 0x24 ; 36 18364: 44 e7 ldi r20, 0x74 ; 116 18366: 59 e4 ldi r21, 0x49 ; 73 18368: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__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); 1836c: 20 e0 ldi r18, 0x00 ; 0 1836e: 30 e0 ldi r19, 0x00 ; 0 18370: 40 e0 ldi r20, 0x00 ; 0 18372: 5f e3 ldi r21, 0x3F ; 63 18374: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 18378: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 1837c: 5b 01 movw r10, r22 1837e: 6e 15 cp r22, r14 18380: 7f 05 cpc r23, r15 18382: 08 f4 brcc .+2 ; 0x18386 18384: 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){ 18386: 0a 15 cp r16, r10 18388: 1b 05 cpc r17, r11 1838a: 31 f4 brne .+12 ; 0x18398 1838c: 20 97 sbiw r28, 0x00 ; 0 1838e: 21 f0 breq .+8 ; 0x18398 if (acc > 0) 18390: fc f0 brlt .+62 ; 0x183d0 t1--; 18392: f1 e0 ldi r31, 0x01 ; 1 18394: af 1a sub r10, r31 18396: b1 08 sbc r11, r1 t1++; } //DBG(_n("%d "), t1); delayMicroseconds(t1); 18398: c5 01 movw r24, r10 1839a: 0e 94 db bf call 0x17fb6 ; 0x17fb6 delay_us = t1; 1839e: f6 01 movw r30, r12 183a0: b1 82 std Z+1, r11 ; 0x01 183a2: a0 82 st Z, r10 } 183a4: df 91 pop r29 183a6: cf 91 pop r28 183a8: 1f 91 pop r17 183aa: 0f 91 pop r16 183ac: ff 90 pop r15 183ae: ef 90 pop r14 183b0: df 90 pop r13 183b2: cf 90 pop r12 183b4: bf 90 pop r11 183b6: af 90 pop r10 183b8: 9f 90 pop r9 183ba: 8f 90 pop r8 183bc: 7f 90 pop r7 183be: 6f 90 pop r6 183c0: 5f 90 pop r5 183c2: 4f 90 pop r4 183c4: 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 183c6: 80 e1 ldi r24, 0x10 ; 16 183c8: a8 2e mov r10, r24 183ca: 87 e2 ldi r24, 0x27 ; 39 183cc: b8 2e mov r11, r24 183ce: db cf rjmp .-74 ; 0x18386 /// make sure delay has changed a bit at least if (t1 == delay_us && acc != 0){ if (acc > 0) t1--; else t1++; 183d0: 8f ef ldi r24, 0xFF ; 255 183d2: a8 1a sub r10, r24 183d4: b8 0a sbc r11, r24 183d6: e0 cf rjmp .-64 ; 0x18398 000183d8 : /// 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){ 183d8: 2f 92 push r2 183da: 3f 92 push r3 183dc: 4f 92 push r4 183de: 5f 92 push r5 183e0: 6f 92 push r6 183e2: 7f 92 push r7 183e4: 8f 92 push r8 183e6: 9f 92 push r9 183e8: af 92 push r10 183ea: bf 92 push r11 183ec: cf 92 push r12 183ee: df 92 push r13 183f0: ef 92 push r14 183f2: ff 92 push r15 183f4: 0f 93 push r16 183f6: 1f 93 push r17 183f8: cf 93 push r28 183fa: df 93 push r29 183fc: 00 d0 rcall .+0 ; 0x183fe 183fe: cd b7 in r28, 0x3d ; 61 18400: de b7 in r29, 0x3e ; 62 if (steps <= 0 || dec <= 0) 18402: f9 01 movw r30, r18 18404: e0 80 ld r14, Z 18406: f1 80 ldd r15, Z+1 ; 0x01 18408: e1 14 cp r14, r1 1840a: f1 04 cpc r15, r1 1840c: 09 f4 brne .+2 ; 0x18410 1840e: 6c c0 rjmp .+216 ; 0x184e8 18410: 16 16 cp r1, r22 18412: 17 06 cpc r1, r23 18414: 0c f0 brlt .+2 ; 0x18418 18416: 68 c0 rjmp .+208 ; 0x184e8 18418: 19 01 movw r2, r18 1841a: 5b 83 std Y+3, r21 ; 0x03 1841c: 4a 83 std Y+2, r20 ; 0x02 1841e: 6b 01 movw r12, r22 18420: 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)); 18422: fa 01 movw r30, r20 18424: 00 81 ld r16, Z 18426: 11 81 ldd r17, Z+1 ; 0x01 18428: b8 01 movw r22, r16 1842a: 90 e0 ldi r25, 0x00 ; 0 1842c: 80 e0 ldi r24, 0x00 ; 0 1842e: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 18432: 4b 01 movw r8, r22 18434: 5c 01 movw r10, r24 18436: b6 01 movw r22, r12 18438: 0d 2c mov r0, r13 1843a: 00 0c add r0, r0 1843c: 88 0b sbc r24, r24 1843e: 99 0b sbc r25, r25 18440: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 18444: 2b 01 movw r4, r22 18446: 3c 01 movw r6, r24 18448: a5 01 movw r20, r10 1844a: 94 01 movw r18, r8 1844c: c5 01 movw r24, r10 1844e: b4 01 movw r22, r8 18450: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 18454: 9b 01 movw r18, r22 18456: ac 01 movw r20, r24 18458: c3 01 movw r24, r6 1845a: b2 01 movw r22, r4 1845c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 18460: 9b 01 movw r18, r22 18462: ac 01 movw r20, r24 18464: 6a e0 ldi r22, 0x0A ; 10 18466: 77 ed ldi r23, 0xD7 ; 215 18468: 83 ea ldi r24, 0xA3 ; 163 1846a: 9b e3 ldi r25, 0x3B ; 59 1846c: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__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); 18470: 20 e0 ldi r18, 0x00 ; 0 18472: 30 e0 ldi r19, 0x00 ; 0 18474: 40 e0 ldi r20, 0x00 ; 0 18476: 5f e3 ldi r21, 0x3F ; 63 18478: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1847c: 0f 94 3b a3 call 0x34676 ; 0x34676 <__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){ 18480: 6e 15 cp r22, r14 18482: 7f 05 cpc r23, r15 18484: 30 f5 brcc .+76 ; 0x184d2 /// go steady sm4_do_step(axes); 18486: 89 81 ldd r24, Y+1 ; 0x01 18488: 0f 94 b5 36 call 0x26d6a ; 0x26d6a delayMicroseconds(delay_us); 1848c: ea 81 ldd r30, Y+2 ; 0x02 1848e: fb 81 ldd r31, Y+3 ; 0x03 18490: 80 81 ld r24, Z 18492: 91 81 ldd r25, Z+1 ; 0x01 18494: 0e 94 db bf call 0x17fb6 ; 0x17fb6 } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); } --steps; 18498: f1 01 movw r30, r2 1849a: 80 81 ld r24, Z 1849c: 91 81 ldd r25, Z+1 ; 0x01 1849e: 01 97 sbiw r24, 0x01 ; 1 184a0: 91 83 std Z+1, r25 ; 0x01 184a2: 80 83 st Z, r24 return true; 184a4: 81 e0 ldi r24, 0x01 ; 1 } 184a6: 0f 90 pop r0 184a8: 0f 90 pop r0 184aa: 0f 90 pop r0 184ac: df 91 pop r29 184ae: cf 91 pop r28 184b0: 1f 91 pop r17 184b2: 0f 91 pop r16 184b4: ff 90 pop r15 184b6: ef 90 pop r14 184b8: df 90 pop r13 184ba: cf 90 pop r12 184bc: bf 90 pop r11 184be: af 90 pop r10 184c0: 9f 90 pop r9 184c2: 8f 90 pop r8 184c4: 7f 90 pop r7 184c6: 6f 90 pop r6 184c8: 5f 90 pop r5 184ca: 4f 90 pop r4 184cc: 3f 90 pop r3 184ce: 2f 90 pop r2 184d0: 08 95 ret /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); 184d2: 66 27 eor r22, r22 184d4: 77 27 eor r23, r23 184d6: 6c 19 sub r22, r12 184d8: 7d 09 sbc r23, r13 184da: 98 01 movw r18, r16 184dc: 4a 81 ldd r20, Y+2 ; 0x02 184de: 5b 81 ldd r21, Y+3 ; 0x03 184e0: 89 81 ldd r24, Y+1 ; 0x01 184e2: 0e 94 45 c1 call 0x1828a ; 0x1828a 184e6: d8 cf rjmp .-80 ; 0x18498 /// 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; 184e8: 80 e0 ldi r24, 0x00 ; 0 184ea: dd cf rjmp .-70 ; 0x184a6 000184ec : count_position[i] += dir & mask ? -1L : 1L; } } } static void __attribute__((noinline)) set_axes_dir(const uint8_t axis, const uint8_t dir) { 184ec: 0f 93 push r16 184ee: 1f 93 push r17 184f0: cf 93 push r28 184f2: df 93 push r29 184f4: 18 2f mov r17, r24 184f6: 06 2f mov r16, r22 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 184f8: d1 e0 ldi r29, 0x01 ; 1 184fa: c0 e0 ldi r28, 0x00 ; 0 if (axis & mask) { 184fc: 81 2f mov r24, r17 184fe: 8d 23 and r24, r29 18500: 29 f0 breq .+10 ; 0x1850c sm4_set_dir(i, dir & mask); 18502: 60 2f mov r22, r16 18504: 6d 23 and r22, r29 18506: 8c 2f mov r24, r28 18508: 0f 94 bd 36 call 0x26d7a ; 0x26d7a } } } 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) { 1850c: cf 5f subi r28, 0xFF ; 255 1850e: dd 0f add r29, r29 18510: c3 30 cpi r28, 0x03 ; 3 18512: a1 f7 brne .-24 ; 0x184fc if (axis & mask) { sm4_set_dir(i, dir & mask); } } } 18514: df 91 pop r29 18516: cf 91 pop r28 18518: 1f 91 pop r17 1851a: 0f 91 pop r16 1851c: 08 95 ret 0001851e : //@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) { 1851e: 8f 92 push r8 18520: 9f 92 push r9 18522: af 92 push r10 18524: bf 92 push r11 18526: cf 92 push r12 18528: df 92 push r13 1852a: ef 92 push r14 1852c: ff 92 push r15 1852e: 30 e0 ldi r19, 0x00 ; 0 18530: 20 e0 ldi r18, 0x00 ; 0 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 18532: 91 e0 ldi r25, 0x01 ; 1 if (axis & mask) { 18534: 48 2f mov r20, r24 18536: 49 23 and r20, r25 18538: 19 f1 breq .+70 ; 0x18580 count_position[i] += dir & mask ? -1L : 1L; 1853a: a9 01 movw r20, r18 1853c: 44 0f add r20, r20 1853e: 55 1f adc r21, r21 18540: 44 0f add r20, r20 18542: 55 1f adc r21, r21 18544: fa 01 movw r30, r20 18546: ea 54 subi r30, 0x4A ; 74 18548: f9 4f sbci r31, 0xF9 ; 249 1854a: c0 80 ld r12, Z 1854c: d1 80 ldd r13, Z+1 ; 0x01 1854e: e2 80 ldd r14, Z+2 ; 0x02 18550: f3 80 ldd r15, Z+3 ; 0x03 18552: 76 2f mov r23, r22 18554: 79 23 and r23, r25 18556: 81 2c mov r8, r1 18558: 91 2c mov r9, r1 1855a: 54 01 movw r10, r8 1855c: 83 94 inc r8 1855e: 77 23 and r23, r23 18560: 21 f0 breq .+8 ; 0x1856a 18562: 88 24 eor r8, r8 18564: 8a 94 dec r8 18566: 98 2c mov r9, r8 18568: 54 01 movw r10, r8 1856a: c8 0c add r12, r8 1856c: d9 1c adc r13, r9 1856e: ea 1c adc r14, r10 18570: fb 1c adc r15, r11 18572: 4a 54 subi r20, 0x4A ; 74 18574: 59 4f sbci r21, 0xF9 ; 249 18576: fa 01 movw r30, r20 18578: c0 82 st Z, r12 1857a: d1 82 std Z+1, r13 ; 0x01 1857c: e2 82 std Z+2, r14 ; 0x02 1857e: 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) { 18580: 99 0f add r25, r25 18582: 2f 5f subi r18, 0xFF ; 255 18584: 3f 4f sbci r19, 0xFF ; 255 18586: 23 30 cpi r18, 0x03 ; 3 18588: 31 05 cpc r19, r1 1858a: a1 f6 brne .-88 ; 0x18534 if (axis & mask) { count_position[i] += dir & mask ? -1L : 1L; } } } 1858c: ff 90 pop r15 1858e: ef 90 pop r14 18590: df 90 pop r13 18592: cf 90 pop r12 18594: bf 90 pop r11 18596: af 90 pop r10 18598: 9f 90 pop r9 1859a: 8f 90 pop r8 1859c: 08 95 ret 0001859e : /// 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) { 1859e: 2f 92 push r2 185a0: 3f 92 push r3 185a2: 4f 92 push r4 185a4: 5f 92 push r5 185a6: 6f 92 push r6 185a8: 7f 92 push r7 185aa: 8f 92 push r8 185ac: 9f 92 push r9 185ae: af 92 push r10 185b0: bf 92 push r11 185b2: cf 92 push r12 185b4: df 92 push r13 185b6: ef 92 push r14 185b8: ff 92 push r15 185ba: 0f 93 push r16 185bc: 1f 93 push r17 185be: cf 93 push r28 185c0: df 93 push r29 185c2: 00 d0 rcall .+0 ; 0x185c4 185c4: 00 d0 rcall .+0 ; 0x185c6 185c6: cd b7 in r28, 0x3d ; 61 185c8: 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]; 185ca: c0 90 b6 06 lds r12, 0x06B6 ; 0x8006b6 185ce: d0 90 b7 06 lds r13, 0x06B7 ; 0x8006b7 185d2: e0 90 b8 06 lds r14, 0x06B8 ; 0x8006b8 185d6: f0 90 b9 06 lds r15, 0x06B9 ; 0x8006b9 185da: 7c 01 movw r14, r24 185dc: ec 18 sub r14, r12 185de: fd 08 sbc r15, r13 y -= (int16_t)count_position[1]; 185e0: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 185e4: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 185e8: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 185ec: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 185f0: 68 1b sub r22, r24 185f2: 79 0b sbc r23, r25 z -= (int16_t)count_position[2]; 185f4: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 185f8: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 185fc: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 18600: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 18604: fa 01 movw r30, r20 18606: e8 1b sub r30, r24 18608: f9 0b sbc r31, r25 1860a: fa 83 std Y+2, r31 ; 0x02 1860c: e9 83 std Y+1, r30 ; 0x01 xyzcal_dm = ((x<0)?1:0) | ((y<0)?2:0) | ((z<0)?4:0); 1860e: fb 01 movw r30, r22 18610: ff 0f add r31, r31 18612: ee 0b sbc r30, r30 18614: ff 0f add r31, r31 18616: fe 2f mov r31, r30 18618: ee 1f adc r30, r30 1861a: e2 70 andi r30, 0x02 ; 2 1861c: 89 81 ldd r24, Y+1 ; 0x01 1861e: 9a 81 ldd r25, Y+2 ; 0x02 18620: 88 e0 ldi r24, 0x08 ; 8 18622: 98 02 muls r25, r24 18624: 81 2d mov r24, r1 18626: 99 0b sbc r25, r25 18628: 11 24 eor r1, r1 1862a: 84 70 andi r24, 0x04 ; 4 1862c: e8 2b or r30, r24 1862e: 8f 2d mov r24, r15 18630: 88 1f adc r24, r24 18632: 88 27 eor r24, r24 18634: 88 1f adc r24, r24 18636: e8 2b or r30, r24 18638: e0 93 bf 03 sts 0x03BF, r30 ; 0x8003bf asm("nop"); } void sm4_set_dir_bits(uint8_t dir_bits) { uint8_t portL = PORTL; 1863c: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> portL &= 0xb8; //set direction bits to zero 18640: 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; 18642: 87 e0 ldi r24, 0x07 ; 7 18644: e8 27 eor r30, r24 if (dir_bits & 1) portL |= 2; //set X direction bit 18646: e0 fd sbrc r30, 0 18648: 92 60 ori r25, 0x02 ; 2 if (dir_bits & 2) portL |= 1; //set Y direction bit 1864a: e1 fd sbrc r30, 1 1864c: 91 60 ori r25, 0x01 ; 1 if (dir_bits & 4) portL |= 4; //set Z direction bit 1864e: e4 70 andi r30, 0x04 ; 4 18650: 09 f0 breq .+2 ; 0x18654 18652: 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; 18654: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> asm("nop"); 18658: 00 00 nop sm4_set_dir_bits(xyzcal_dm); sm4_stop_cb = check_pinda?((check_pinda<0)?check_pinda_0:check_pinda_1):0; 1865a: 8c ef ldi r24, 0xFC ; 252 1865c: 90 eb ldi r25, 0xB0 ; 176 1865e: 01 11 cpse r16, r1 18660: 02 c0 rjmp .+4 ; 0x18666 18662: 90 e0 ldi r25, 0x00 ; 0 18664: 80 e0 ldi r24, 0x00 ; 0 18666: 90 93 28 05 sts 0x0528, r25 ; 0x800528 1866a: 80 93 27 05 sts 0x0527, r24 ; 0x800527 xyzcal_sm4_delay = delay_us; 1866e: 30 93 be 03 sts 0x03BE, r19 ; 0x8003be 18672: 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; 18676: 29 81 ldd r18, Y+1 ; 0x01 18678: 3a 81 ldd r19, Y+2 ; 0x02 1867a: 3e 83 std Y+6, r19 ; 0x06 1867c: 2d 83 std Y+5, r18 ; 0x05 1867e: 37 ff sbrs r19, 7 18680: 05 c0 rjmp .+10 ; 0x1868c 18682: 31 95 neg r19 18684: 21 95 neg r18 18686: 31 09 sbc r19, r1 18688: 3e 83 std Y+6, r19 ; 0x06 1868a: 2d 83 std Y+5, r18 ; 0x05 1868c: 8b 01 movw r16, r22 1868e: 77 ff sbrs r23, 7 18690: 03 c0 rjmp .+6 ; 0x18698 18692: 11 95 neg r17 18694: 01 95 neg r16 18696: 11 09 sbc r17, r1 18698: f7 fe sbrs r15, 7 1869a: 03 c0 rjmp .+6 ; 0x186a2 1869c: f1 94 neg r15 1869e: e1 94 neg r14 186a0: 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); 186a2: 98 01 movw r18, r16 186a4: d8 01 movw r26, r16 186a6: 0f 94 b3 a1 call 0x34366 ; 0x34366 <__mulhisi3> 186aa: 4b 01 movw r8, r22 186ac: 5c 01 movw r10, r24 186ae: 2d 81 ldd r18, Y+5 ; 0x05 186b0: 3e 81 ldd r19, Y+6 ; 0x06 186b2: d9 01 movw r26, r18 186b4: 0f 94 b3 a1 call 0x34366 ; 0x34366 <__mulhisi3> 186b8: 86 0e add r8, r22 186ba: 97 1e adc r9, r23 186bc: a8 1e adc r10, r24 186be: b9 1e adc r11, r25 186c0: 97 01 movw r18, r14 186c2: d7 01 movw r26, r14 186c4: 0f 94 b3 a1 call 0x34366 ; 0x34366 <__mulhisi3> 186c8: 68 0d add r22, r8 186ca: 79 1d adc r23, r9 186cc: 8a 1d adc r24, r10 186ce: 9b 1d adc r25, r11 186d0: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 186d4: 0f 94 91 a5 call 0x34b22 ; 0x34b22 186d8: 20 e0 ldi r18, 0x00 ; 0 186da: 30 e0 ldi r19, 0x00 ; 0 186dc: 40 e0 ldi r20, 0x00 ; 0 186de: 5f e3 ldi r21, 0x3F ; 63 186e0: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 186e4: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 186e8: 2b 01 movw r4, r22 uint16_t nd = dd; uint16_t cx = dd; uint16_t cy = dd; uint16_t cz = dd; 186ea: 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; 186ec: 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; 186ee: 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; 186f0: 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; 186f2: 1c 82 std Y+4, r1 ; 0x04 186f4: 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; 186f6: 31 2c mov r3, r1 186f8: 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; 186fa: 1a 82 std Y+2, r1 ; 0x02 186fc: 19 82 std Y+1, r1 ; 0x01 uint16_t y = 0; uint16_t z = 0; while (nd){ 186fe: 61 14 cp r6, r1 18700: 71 04 cpc r7, r1 18702: 09 f4 brne .+2 ; 0x18706 18704: 48 c0 rjmp .+144 ; 0x18796 if (sm4_stop_cb && (*sm4_stop_cb)()) break; 18706: e0 91 27 05 lds r30, 0x0527 ; 0x800527 1870a: f0 91 28 05 lds r31, 0x0528 ; 0x800528 1870e: 30 97 sbiw r30, 0x00 ; 0 18710: f1 f5 brne .+124 ; 0x1878e uint8_t sm = 0; //step mask 18712: 80 e0 ldi r24, 0x00 ; 0 if (cx <= dx){ 18714: ec 14 cp r14, r12 18716: fd 04 cpc r15, r13 18718: 40 f0 brcs .+16 ; 0x1872a sm |= 1; cx += dd; 1871a: c4 0c add r12, r4 1871c: d5 1c adc r13, r5 x++; 1871e: 89 81 ldd r24, Y+1 ; 0x01 18720: 9a 81 ldd r25, Y+2 ; 0x02 18722: 01 96 adiw r24, 0x01 ; 1 18724: 9a 83 std Y+2, r25 ; 0x02 18726: 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; 18728: 81 e0 ldi r24, 0x01 ; 1 cx += dd; x++; } if (cy <= dy){ 1872a: 0a 15 cp r16, r10 1872c: 1b 05 cpc r17, r11 1872e: 30 f0 brcs .+12 ; 0x1873c sm |= 2; 18730: 82 60 ori r24, 0x02 ; 2 cy += dd; 18732: a4 0c add r10, r4 18734: b5 1c adc r11, r5 y++; 18736: 9f ef ldi r25, 0xFF ; 255 18738: 29 1a sub r2, r25 1873a: 39 0a sbc r3, r25 } if (cz <= dz){ 1873c: ed 81 ldd r30, Y+5 ; 0x05 1873e: fe 81 ldd r31, Y+6 ; 0x06 18740: e8 15 cp r30, r8 18742: f9 05 cpc r31, r9 18744: 48 f0 brcs .+18 ; 0x18758 sm |= 4; 18746: 84 60 ori r24, 0x04 ; 4 cz += dd; 18748: 84 0c add r8, r4 1874a: 95 1c adc r9, r5 z++; 1874c: 2b 81 ldd r18, Y+3 ; 0x03 1874e: 3c 81 ldd r19, Y+4 ; 0x04 18750: 2f 5f subi r18, 0xFF ; 255 18752: 3f 4f sbci r19, 0xFF ; 255 18754: 3c 83 std Y+4, r19 ; 0x04 18756: 2b 83 std Y+3, r18 ; 0x03 } cx -= dx; 18758: ce 18 sub r12, r14 1875a: df 08 sbc r13, r15 cy -= dy; 1875c: a0 1a sub r10, r16 1875e: b1 0a sbc r11, r17 cz -= dz; 18760: ed 81 ldd r30, Y+5 ; 0x05 18762: fe 81 ldd r31, Y+6 ; 0x06 18764: 8e 1a sub r8, r30 18766: 9f 0a sbc r9, r31 sm4_do_step(sm); 18768: 0f 94 b5 36 call 0x26d6a ; 0x26d6a uint16_t delay = SM4_DEFDELAY; if (sm4_calc_delay_cb) delay = (*sm4_calc_delay_cb)(nd, dd); 1876c: e0 91 23 05 lds r30, 0x0523 ; 0x800523 18770: f0 91 24 05 lds r31, 0x0524 ; 0x800524 18774: 30 97 sbiw r30, 0x00 ; 0 18776: d1 f1 breq .+116 ; 0x187ec 18778: b2 01 movw r22, r4 1877a: c3 01 movw r24, r6 1877c: 19 95 eicall if (delay) delayMicroseconds(delay); 1877e: 00 97 sbiw r24, 0x00 ; 0 18780: 11 f0 breq .+4 ; 0x18786 18782: 0e 94 db bf call 0x17fb6 ; 0x17fb6 nd--; 18786: f1 e0 ldi r31, 0x01 ; 1 18788: 6f 1a sub r6, r31 1878a: 71 08 sbc r7, r1 1878c: b8 cf rjmp .-144 ; 0x186fe 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; 1878e: 19 95 eicall 18790: 88 23 and r24, r24 18792: 09 f4 brne .+2 ; 0x18796 18794: be cf rjmp .-132 ; 0x18712 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) 18796: e0 91 25 05 lds r30, 0x0525 ; 0x800525 1879a: f0 91 26 05 lds r31, 0x0526 ; 0x800526 1879e: 30 97 sbiw r30, 0x00 ; 0 187a0: 41 f0 breq .+16 ; 0x187b2 (*sm4_update_pos_cb)(x, y, z, 0); 187a2: 30 e0 ldi r19, 0x00 ; 0 187a4: 20 e0 ldi r18, 0x00 ; 0 187a6: 4b 81 ldd r20, Y+3 ; 0x03 187a8: 5c 81 ldd r21, Y+4 ; 0x04 187aa: b1 01 movw r22, r2 187ac: 89 81 ldd r24, Y+1 ; 0x01 187ae: 9a 81 ldd r25, Y+2 ; 0x02 187b0: 19 95 eicall 187b2: 81 e0 ldi r24, 0x01 ; 1 187b4: 67 28 or r6, r7 187b6: 09 f4 brne .+2 ; 0x187ba 187b8: 80 e0 ldi r24, 0x00 ; 0 // u = _micros() - u; return ret; } 187ba: 26 96 adiw r28, 0x06 ; 6 187bc: 0f b6 in r0, 0x3f ; 63 187be: f8 94 cli 187c0: de bf out 0x3e, r29 ; 62 187c2: 0f be out 0x3f, r0 ; 63 187c4: cd bf out 0x3d, r28 ; 61 187c6: df 91 pop r29 187c8: cf 91 pop r28 187ca: 1f 91 pop r17 187cc: 0f 91 pop r16 187ce: ff 90 pop r15 187d0: ef 90 pop r14 187d2: df 90 pop r13 187d4: cf 90 pop r12 187d6: bf 90 pop r11 187d8: af 90 pop r10 187da: 9f 90 pop r9 187dc: 8f 90 pop r8 187de: 7f 90 pop r7 187e0: 6f 90 pop r6 187e2: 5f 90 pop r5 187e4: 4f 90 pop r4 187e6: 3f 90 pop r3 187e8: 2f 90 pop r2 187ea: 08 95 ret } cx -= dx; cy -= dy; cz -= dz; sm4_do_step(sm); uint16_t delay = SM4_DEFDELAY; 187ec: 84 ef ldi r24, 0xF4 ; 244 187ee: 91 e0 ldi r25, 0x01 ; 1 187f0: c8 cf rjmp .-112 ; 0x18782 000187f2 : class IR_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return !READ(IR_SENSOR_PIN); } 187f2: 89 b1 in r24, 0x09 ; 9 187f4: 86 95 lsr r24 187f6: 81 70 andi r24, 0x01 ; 1 187f8: 91 e0 ldi r25, 0x01 ; 1 187fa: 89 27 eor r24, r25 187fc: 08 95 ret 000187fe : //! | Fail stats | allways //! | Fail stats MMU | mmu //! | Support | allways //! @endcode static void lcd_main_menu() { 187fe: 1f 93 push r17 18800: cf 93 push r28 18802: df 93 push r29 MENU_BEGIN(); 18804: 0f 94 7b 93 call 0x326f6 ; 0x326f6 18808: 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); 1880c: 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 1880e: d1 e0 ldi r29, 0x01 ; 1 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 18810: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 18814: 84 30 cpi r24, 0x04 ; 4 18816: 08 f0 brcs .+2 ; 0x1881a 18818: 09 c2 rjmp .+1042 ; 0x18c2c 1881a: 10 92 31 04 sts 0x0431, r1 ; 0x800431 // Majkl superawesome menu MENU_ITEM_BACK_P(_T(MSG_INFO_SCREEN)); 1881e: 80 e2 ldi r24, 0x20 ; 32 18820: 9d e3 ldi r25, 0x3D ; 61 18822: 0e 94 a7 6c call 0xd94e ; 0xd94e 18826: 0f 94 46 96 call 0x32c8c ; 0x32c8c 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)) { 1882a: 0e 94 0f 61 call 0xc21e ; 0xc21e 1882e: 81 11 cpse r24, r1 18830: 19 c0 rjmp .+50 ; 0x18864 18832: 0e 94 a9 60 call 0xc152 ; 0xc152 18836: 81 11 cpse r24, r1 18838: 15 c0 rjmp .+42 ; 0x18864 1883a: 80 91 99 03 lds r24, 0x0399 ; 0x800399 1883e: 81 11 cpse r24, r1 18840: 11 c0 rjmp .+34 ; 0x18864 #include "printer_state.h" static PrinterState printer_state; PrinterState GetPrinterState() { return printer_state; 18842: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.367> if ((GetPrinterState() == PrinterState::SDPrintingFinished) && card.mounted) { 18846: 83 30 cpi r24, 0x03 ; 3 18848: 09 f0 breq .+2 ; 0x1884c 1884a: 5d c0 rjmp .+186 ; 0x18906 1884c: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 18850: 88 23 and r24, r24 18852: 41 f0 breq .+16 ; 0x18864 MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_reprint_from_eeprom); 18854: 86 e1 ldi r24, 0x16 ; 22 18856: 9d e3 ldi r25, 0x3D ; 61 18858: 0e 94 a7 6c call 0xd94e ; 0xd94e 1885c: 69 e6 ldi r22, 0x69 ; 105 1885e: 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); 18860: 0f 94 f8 92 call 0x325f0 ; 0x325f0 } } // Menu is never shown when idle if (babystep_allowed_strict() && (printJobOngoing() || lcd_commands_type == LcdCommands::Layer1Cal)) 18864: 0e 94 f9 60 call 0xc1f2 ; 0xc1f2 18868: 88 23 and r24, r24 1886a: 81 f0 breq .+32 ; 0x1888c 1886c: 0e 94 be 60 call 0xc17c ; 0xc17c 18870: 81 11 cpse r24, r1 18872: 04 c0 rjmp .+8 ; 0x1887c 18874: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 18878: 84 30 cpi r24, 0x04 ; 4 1887a: 41 f4 brne .+16 ; 0x1888c MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 1887c: 86 e0 ldi r24, 0x06 ; 6 1887e: 9d e3 ldi r25, 0x3D ; 61 18880: 0e 94 a7 6c call 0xd94e ; 0xd94e 18884: 6d ed ldi r22, 0xDD ; 221 18886: 77 e3 ldi r23, 0x37 ; 55 18888: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 if (farm_mode) 1888c: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 18890: 88 23 and r24, r24 18892: 41 f0 breq .+16 ; 0x188a4 MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 18894: 8b e5 ldi r24, 0x5B ; 91 18896: 9d e3 ldi r25, 0x3D ; 61 18898: 0e 94 a7 6c call 0xd94e ; 0xd94e 1889c: 68 e7 ldi r22, 0x78 ; 120 1889e: 7f ee ldi r23, 0xEF ; 239 188a0: 0f 94 f8 92 call 0x325f0 ; 0x325f0 if (!printer_recovering()) { 188a4: 0e 94 a9 60 call 0xc152 ; 0xc152 188a8: 81 11 cpse r24, r1 188aa: 61 c0 rjmp .+194 ; 0x1896e } //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); 188ac: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 188b0: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 188b4: 89 1b sub r24, r25 188b6: 8f 70 andi r24, 0x0F ; 15 if ( moves_planned() || printer_active() #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 188b8: a9 f5 brne .+106 ; 0x18924 if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { if ( moves_planned() || printer_active() 188ba: 0e 94 0f 61 call 0xc21e ; 0xc21e 188be: 81 11 cpse r24, r1 188c0: 31 c0 rjmp .+98 ; 0x18924 #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 188c2: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 188c6: 82 30 cpi r24, 0x02 ; 2 188c8: 69 f1 breq .+90 ; 0x18924 #endif //End FANCHECK ) { MENU_ITEM_SUBMENU_P(_T(MSG_TUNE), lcd_tune_menu); } else if (!Stopped) { 188ca: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 188ce: 81 11 cpse r24, r1 188d0: 31 c0 rjmp .+98 ; 0x18934 MENU_ITEM_SUBMENU_P(_T(MSG_PREHEAT), lcd_preheat_menu); 188d2: 85 ef ldi r24, 0xF5 ; 245 188d4: 9c e3 ldi r25, 0x3C ; 60 188d6: 0e 94 a7 6c call 0xd94e ; 0xd94e 188da: 6b e8 ldi r22, 0x8B ; 139 188dc: 78 e3 ldi r23, 0x38 ; 56 188de: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 if (M79_timer_get_status()) { 188e2: 80 91 5a 03 lds r24, 0x035A ; 0x80035a <_ZL9M79_timer.lto_priv.419> 188e6: 88 23 and r24, r24 188e8: 29 f1 breq .+74 ; 0x18934 #ifndef REPLACE_SETREADY if(GetPrinterState() == PrinterState::IsReady) { 188ea: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb <_ZL13printer_state.lto_priv.367> 188ee: 81 30 cpi r24, 0x01 ; 1 188f0: 09 f0 breq .+2 ; 0x188f4 188f2: 45 c1 rjmp .+650 ; 0x18b7e MENU_ITEM_FUNCTION_P(_T(MSG_SET_NOT_READY), lcd_printer_ready_state_toggle); 188f4: 85 ee ldi r24, 0xE5 ; 229 188f6: 9c e3 ldi r25, 0x3C ; 60 } else { MENU_ITEM_FUNCTION_P(_T(MSG_SET_READY), lcd_printer_ready_state_toggle); 188f8: 0e 94 a7 6c call 0xd94e ; 0xd94e 188fc: 67 e9 ldi r22, 0x97 ; 151 188fe: 71 eb ldi r23, 0xB1 ; 177 18900: 0f 94 f8 92 call 0x325f0 ; 0x325f0 18904: 17 c0 rjmp .+46 ; 0x18934 // 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()) { 18906: 84 30 cpi r24, 0x04 ; 4 18908: 09 f0 breq .+2 ; 0x1890c 1890a: ac cf rjmp .-168 ; 0x18864 1890c: 80 91 5a 03 lds r24, 0x035A ; 0x80035a <_ZL9M79_timer.lto_priv.419> 18910: 88 23 and r24, r24 18912: 09 f4 brne .+2 ; 0x18916 18914: a7 cf rjmp .-178 ; 0x18864 MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 18916: 86 e1 ldi r24, 0x16 ; 22 18918: 9d e3 ldi r25, 0x3D ; 61 1891a: 0e 94 a7 6c call 0xd94e ; 0xd94e 1891e: 61 e9 ldi r22, 0x91 ; 145 18920: 71 eb ldi r23, 0xB1 ; 177 18922: 9e cf rjmp .-196 ; 0x18860 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); 18924: 8f ef ldi r24, 0xFF ; 255 18926: 9c e3 ldi r25, 0x3C ; 60 18928: 0e 94 a7 6c call 0xd94e ; 0xd94e 1892c: 64 e9 ldi r22, 0x94 ; 148 1892e: 76 eb ldi r23, 0xB6 ; 182 18930: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 #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) { 18934: c0 91 06 12 lds r28, 0x1206 ; 0x801206 18938: 0e 94 b3 60 call 0xc166 ; 0xc166 1893c: c1 11 cpse r28, r1 1893e: 17 c0 rjmp .+46 ; 0x1896e 18940: 90 91 05 12 lds r25, 0x1205 ; 0x801205 18944: 91 11 cpse r25, r1 18946: 13 c0 rjmp .+38 ; 0x1896e 18948: 81 11 cpse r24, r1 1894a: 15 c0 rjmp .+42 ; 0x18976 1894c: 80 91 5f 03 lds r24, 0x035F ; 0x80035f 18950: 81 11 cpse r24, r1 18952: 0d c0 rjmp .+26 ; 0x1896e if (usb_timer.running()) { 18954: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 18958: 88 23 and r24, r24 1895a: 09 f4 brne .+2 ; 0x1895e 1895c: 13 c1 rjmp .+550 ; 0x18b84 MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print); 1895e: 8b ec ldi r24, 0xCB ; 203 18960: 9c e3 ldi r25, 0x3C ; 60 18962: 0e 94 a7 6c call 0xd94e ; 0xd94e 18966: 6b e7 ldi r22, 0x7B ; 123 18968: 78 e3 ldi r23, 0x38 ; 56 } else if (IS_SD_PRINTING) { MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 1896a: 0f 94 f8 92 call 0x325f0 ; 0x325f0 } } } if (printingIsPaused() 1896e: 0e 94 b3 60 call 0xc166 ; 0xc166 && !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) { 18972: 88 23 and r24, r24 18974: f1 f0 breq .+60 ; 0x189b2 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 18976: 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() 1897a: 81 11 cpse r24, r1 1897c: 1a c0 rjmp .+52 ; 0x189b2 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1897e: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 18982: 82 30 cpi r24, 0x02 ; 2 18984: b1 f0 breq .+44 ; 0x189b2 #endif //FANCHECK && (saved_printing_type != PowerPanic::PRINT_TYPE_NONE || saved_printing) 18986: 80 91 79 02 lds r24, 0x0279 ; 0x800279 1898a: 82 30 cpi r24, 0x02 ; 2 1898c: 21 f4 brne .+8 ; 0x18996 1898e: 90 91 e7 11 lds r25, 0x11E7 ; 0x8011e7 18992: 99 23 and r25, r25 18994: 71 f0 breq .+28 ; 0x189b2 && custom_message_type != CustomMsg::Resuming) { 18996: 90 91 c7 06 lds r25, 0x06C7 ; 0x8006c7 1899a: 98 30 cpi r25, 0x08 ; 8 1899c: 51 f0 breq .+20 ; 0x189b2 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { 1899e: 81 11 cpse r24, r1 189a0: fd c0 rjmp .+506 ; 0x18b9c MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print); 189a2: 8c eb ldi r24, 0xBC ; 188 189a4: 9c e3 ldi r25, 0x3C ; 60 189a6: 0e 94 a7 6c call 0xd94e ; 0xd94e 189aa: 6c e8 ldi r22, 0x8C ; 140 189ac: 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); 189ae: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) 189b2: 0e 94 be 60 call 0xc17c ; 0xc17c && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 189b6: 81 11 cpse r24, r1 189b8: 08 c0 rjmp .+16 ; 0x189ca 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())) 189ba: 0e 94 b3 60 call 0xc166 ; 0xc166 189be: 81 11 cpse r24, r1 189c0: 04 c0 rjmp .+8 ; 0x189ca 189c2: 0e 94 a9 60 call 0xc152 ; 0xc152 189c6: 88 23 and r24, r24 189c8: 81 f0 breq .+32 ; 0x189ea && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 189ca: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 189ce: 81 30 cpi r24, 0x01 ; 1 189d0: 61 f0 breq .+24 ; 0x189ea 189d2: 80 91 5f 03 lds r24, 0x035F ; 0x80035f 189d6: 81 11 cpse r24, r1 189d8: 08 c0 rjmp .+16 ; 0x189ea MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); 189da: 8d eb ldi r24, 0xBD ; 189 189dc: 9d e3 ldi r25, 0x3D ; 61 189de: 0e 94 a7 6c call 0xd94e ; 0xd94e 189e2: 6c e7 ldi r22, 0x7C ; 124 189e4: 74 eb ldi r23, 0xB4 ; 180 189e6: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 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() 189ea: 0e 94 a9 60 call 0xc152 ; 0xc152 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 189ee: 81 11 cpse r24, r1 189f0: 95 c0 rjmp .+298 ; 0x18b1c 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() 189f2: 0e 94 0f 61 call 0xc21e ; 0xc21e 189f6: 81 11 cpse r24, r1 189f8: 91 c0 rjmp .+290 ; 0x18b1c 189fa: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 189fe: 81 11 cpse r24, r1 18a00: 8d c0 rjmp .+282 ; 0x18b1c #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 18a02: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 18a06: 82 30 cpi r24, 0x02 ; 2 18a08: 09 f4 brne .+2 ; 0x18a0c 18a0a: 88 c0 rjmp .+272 ; 0x18b1c #endif //FANCHECK ) { #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code if (card.mounted 18a0c: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 18a10: 81 11 cpse r24, r1 18a12: 05 c0 rjmp .+10 ; 0x18a1e || lcd_commands_type != LcdCommands::Idle) { 18a14: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 18a18: 88 23 and r24, r24 18a1a: 09 f4 brne .+2 ; 0x18a1e 18a1c: ce c0 rjmp .+412 ; 0x18bba if (!card.isFileOpen()) { 18a1e: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 18a22: 81 11 cpse r24, r1 18a24: 12 c0 rjmp .+36 ; 0x18a4a if (!usb_timer.running() && (lcd_commands_type == LcdCommands::Idle)) { 18a26: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 18a2a: 81 11 cpse r24, r1 18a2c: 0e c0 rjmp .+28 ; 0x18a4a 18a2e: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 18a32: 81 11 cpse r24, r1 18a34: 0a c0 rjmp .+20 ; 0x18a4a bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function 18a36: d0 93 97 03 sts 0x0397, r29 ; 0x800397 MENU_ITEM_SUBMENU_P(_T(MSG_CARD_MENU), lcd_sdcard_menu); 18a3a: 8c ea ldi r24, 0xAC ; 172 18a3c: 9c e3 ldi r25, 0x3C ; 60 18a3e: 0e 94 a7 6c call 0xd94e ; 0xd94e 18a42: 66 e6 ldi r22, 0x66 ; 102 18a44: 7c ee ldi r23, 0xEC ; 236 18a46: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 #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) { 18a4a: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 18a4e: 81 11 cpse r24, r1 18a50: 12 c0 rjmp .+36 ; 0x18a76 const int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 18a52: 81 ea ldi r24, 0xA1 ; 161 18a54: 9d e0 ldi r25, 0x0D ; 13 18a56: 0f 94 9b a0 call 0x34136 ; 0x34136 18a5a: c8 2f mov r28, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); 18a5c: 0e 94 1c 6f call 0xde38 ; 0xde38 if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized 18a60: 87 fd sbrc r24, 7 18a62: 09 c0 rjmp .+18 ; 0x18a76 18a64: c8 17 cp r28, r24 18a66: 39 f0 breq .+14 ; 0x18a76 MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); 18a68: c1 02 muls r28, r17 18a6a: c0 01 movw r24, r0 18a6c: 11 24 eor r1, r1 18a6e: 87 5b subi r24, 0xB7 ; 183 18a70: 92 4f sbci r25, 0xF2 ; 242 18a72: 0e 94 83 b2 call 0x16506 ; 0x16506 SETTINGS_NOZZLE; #endif //QUICK_NOZZLE_CHANGE } if (!((eFilamentAction != FilamentAction::None) || Stopped )) { 18a76: 80 91 62 03 lds r24, 0x0362 ; 0x800362 18a7a: 81 11 cpse r24, r1 18a7c: 4f c0 rjmp .+158 ; 0x18b1c 18a7e: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 18a82: 81 11 cpse r24, r1 18a84: 4b c0 rjmp .+150 ; 0x18b1c if (MMU2::mmu2.Enabled()) { 18a86: 80 91 94 12 lds r24, 0x1294 ; 0x801294 18a8a: 81 30 cpi r24, 0x01 ; 1 18a8c: 09 f0 breq .+2 ; 0x18a90 18a8e: 9e c0 rjmp .+316 ; 0x18bcc if(!MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) { 18a90: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 18a94: 81 11 cpse r24, r1 18a96: 0c c0 rjmp .+24 ; 0x18ab0 18a98: 0e 94 f9 c3 call 0x187f2 ; 0x187f2 18a9c: 81 11 cpse r24, r1 18a9e: 08 c0 rjmp .+16 ; 0x18ab0 // 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); 18aa0: 8e e8 ldi r24, 0x8E ; 142 18aa2: 9c e3 ldi r25, 0x3C ; 60 18aa4: 0e 94 a7 6c call 0xd94e ; 0xd94e 18aa8: 60 e9 ldi r22, 0x90 ; 144 18aaa: 7b eb ldi r23, 0xBB ; 187 18aac: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 } MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_TO_NOZZLE), lcd_mmuLoadFilament); 18ab0: 8d e7 ldi r24, 0x7D ; 125 18ab2: 9c e3 ldi r25, 0x3C ; 60 18ab4: 0e 94 a7 6c call 0xd94e ; 0xd94e 18ab8: 67 ec ldi r22, 0xC7 ; 199 18aba: 7b eb ldi r23, 0xBB ; 187 18abc: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_mmuUnloadFilament); 18ac0: 8b e6 ldi r24, 0x6B ; 107 18ac2: 9c e3 ldi r25, 0x3C ; 60 18ac4: 0e 94 a7 6c call 0xd94e ; 0xd94e 18ac8: 6a ec ldi r22, 0xCA ; 202 18aca: 7b eb ldi r23, 0xBB ; 187 18acc: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 MENU_ITEM_SUBMENU_P(_T(MSG_EJECT_FROM_MMU), lcd_mmuEjectFilament); 18ad0: 81 ef ldi r24, 0xF1 ; 241 18ad2: 99 e5 ldi r25, 0x59 ; 89 18ad4: 0e 94 a7 6c call 0xd94e ; 0xd94e 18ad8: 6d ec ldi r22, 0xCD ; 205 18ada: 7b eb ldi r23, 0xBB ; 187 18adc: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0) { 18ae0: 8e ec ldi r24, 0xCE ; 206 18ae2: 9e e0 ldi r25, 0x0E ; 14 18ae4: 0f 94 9b a0 call 0x34136 ; 0x34136 18ae8: 88 23 and r24, r24 18aea: 41 f0 breq .+16 ; 0x18afc MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); 18aec: 82 ee ldi r24, 0xE2 ; 226 18aee: 99 e5 ldi r25, 0x59 ; 89 18af0: 0e 94 a7 6c call 0xd94e ; 0xd94e 18af4: 60 ed ldi r22, 0xD0 ; 208 18af6: 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); 18af8: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 #ifdef FILAMENT_SENSOR } #endif //FILAMENT_SENSOR } MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); 18afc: 87 ea ldi r24, 0xA7 ; 167 18afe: 9d e3 ldi r25, 0x3D ; 61 18b00: 0e 94 a7 6c call 0xd94e ; 0xd94e 18b04: 62 e5 ldi r22, 0x52 ; 82 18b06: 77 eb ldi r23, 0xB7 ; 183 18b08: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 MENU_ITEM_SUBMENU_P(_T(MSG_CALIBRATION), lcd_calibration_menu); 18b0c: 89 e3 ldi r24, 0x39 ; 57 18b0e: 9c e3 ldi r25, 0x3C ; 60 18b10: 0e 94 a7 6c call 0xd94e ; 0xd94e 18b14: 6e ea ldi r22, 0xAE ; 174 18b16: 78 eb ldi r23, 0xB8 ; 184 18b18: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 } } MENU_ITEM_SUBMENU_P(_T(MSG_STATISTICS), lcd_menu_statistics); 18b1c: 8c e2 ldi r24, 0x2C ; 44 18b1e: 9c e3 ldi r25, 0x3C ; 60 18b20: 0e 94 a7 6c call 0xd94e ; 0xd94e 18b24: 6d eb ldi r22, 0xBD ; 189 18b26: 77 e3 ldi r23, 0x37 ; 55 18b28: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 #if defined(TMC2130) || defined(FILAMENT_SENSOR) MENU_ITEM_SUBMENU_P(_T(MSG_FAIL_STATS), lcd_menu_fails_stats); 18b2c: 8f e1 ldi r24, 0x1F ; 31 18b2e: 9c e3 ldi r25, 0x3C ; 60 18b30: 0e 94 a7 6c call 0xd94e ; 0xd94e 18b34: 63 e1 ldi r22, 0x13 ; 19 18b36: 77 e3 ldi r23, 0x37 ; 55 18b38: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 #endif if (MMU2::mmu2.Enabled()) { 18b3c: 80 91 94 12 lds r24, 0x1294 ; 0x801294 18b40: 81 30 cpi r24, 0x01 ; 1 18b42: 41 f4 brne .+16 ; 0x18b54 MENU_ITEM_SUBMENU_P(_T(MSG_MMU_FAIL_STATS), lcd_menu_fails_stats_mmu); 18b44: 8e e0 ldi r24, 0x0E ; 14 18b46: 9c e3 ldi r25, 0x3C ; 60 18b48: 0e 94 a7 6c call 0xd94e ; 0xd94e 18b4c: 62 e0 ldi r22, 0x02 ; 2 18b4e: 7f ef ldi r23, 0xFF ; 255 18b50: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 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); 18b54: 84 e0 ldi r24, 0x04 ; 4 18b56: 9c e3 ldi r25, 0x3C ; 60 18b58: 0e 94 a7 6c call 0xd94e ; 0xd94e 18b5c: 61 ec ldi r22, 0xC1 ; 193 18b5e: 76 e3 ldi r23, 0x36 ; 54 18b60: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 MENU_END(); 18b64: 0f 94 4f 93 call 0x3269e ; 0x3269e //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 18b68: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 18b6c: 8f 5f subi r24, 0xFF ; 255 18b6e: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 18b72: 80 91 30 04 lds r24, 0x0430 ; 0x800430 18b76: 8f 5f subi r24, 0xFF ; 255 18b78: 80 93 30 04 sts 0x0430, r24 ; 0x800430 18b7c: 49 ce rjmp .-878 ; 0x18810 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); 18b7e: 89 ed ldi r24, 0xD9 ; 217 18b80: 9c e3 ldi r25, 0x3C ; 60 18b82: ba ce rjmp .-652 ; 0x188f8 } } 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) { 18b84: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 18b88: 88 23 and r24, r24 18b8a: 09 f4 brne .+2 ; 0x18b8e 18b8c: f0 ce rjmp .-544 ; 0x1896e MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 18b8e: 8b ec ldi r24, 0xCB ; 203 18b90: 9c e3 ldi r25, 0x3C ; 60 18b92: 0e 94 a7 6c call 0xd94e ; 0xd94e 18b96: 63 ea ldi r22, 0xA3 ; 163 18b98: 77 e3 ldi r23, 0x37 ; 55 18b9a: e7 ce rjmp .-562 ; 0x1896a #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())) { 18b9c: 81 30 cpi r24, 0x01 ; 1 18b9e: 09 f0 breq .+2 ; 0x18ba2 18ba0: 08 cf rjmp .-496 ; 0x189b2 18ba2: 80 91 5a 03 lds r24, 0x035A ; 0x80035a <_ZL9M79_timer.lto_priv.419> 18ba6: 88 23 and r24, r24 18ba8: 09 f4 brne .+2 ; 0x18bac 18baa: 03 cf rjmp .-506 ; 0x189b2 MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print); 18bac: 8c eb ldi r24, 0xBC ; 188 18bae: 9c e3 ldi r25, 0x3C ; 60 18bb0: 0e 94 a7 6c call 0xd94e ; 0xd94e 18bb4: 60 e9 ldi r22, 0x90 ; 144 18bb6: 76 ee ldi r23, 0xE6 ; 230 18bb8: fa ce rjmp .-524 ; 0x189ae #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 18bba: d0 93 97 03 sts 0x0397, r29 ; 0x800397 MENU_ITEM_BACK_P(_T(MSG_NO_CARD)); 18bbe: 8f e9 ldi r24, 0x9F ; 159 18bc0: 9c e3 ldi r25, 0x3C ; 60 18bc2: 0e 94 a7 6c call 0xd94e ; 0xd94e 18bc6: 0f 94 46 96 call 0x32c8c ; 0x32c8c 18bca: 3f cf rjmp .-386 ; 0x18a4a MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); } #endif //MMU_HAS_CUTTER } else { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled()) { 18bcc: 80 91 84 16 lds r24, 0x1684 ; 0x801684 18bd0: 88 23 and r24, r24 18bd2: 19 f1 breq .+70 ; 0x18c1a if (!fsensor.getAutoLoadEnabled()) { 18bd4: 80 91 85 16 lds r24, 0x1685 ; 0x801685 18bd8: 81 11 cpse r24, r1 18bda: 08 c0 rjmp .+16 ; 0x18bec MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 18bdc: 8b e5 ldi r24, 0x5B ; 91 18bde: 9c e3 ldi r25, 0x3C ; 60 18be0: 0e 94 a7 6c call 0xd94e ; 0xd94e 18be4: 69 e8 ldi r22, 0x89 ; 137 18be6: 78 e3 ldi r23, 0x38 ; 56 18be8: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 } if (fsensor.getFilamentPresent()) { 18bec: 0e 94 f9 c3 call 0x187f2 ; 0x187f2 18bf0: 88 23 and r24, r24 18bf2: 39 f0 breq .+14 ; 0x18c02 } #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); 18bf4: 8b e6 ldi r24, 0x6B ; 107 18bf6: 9c e3 ldi r25, 0x3C ; 60 18bf8: 0e 94 a7 6c call 0xd94e ; 0xd94e 18bfc: 61 eb ldi r22, 0xB1 ; 177 18bfe: 76 e3 ldi r23, 0x36 ; 54 18c00: 7b cf rjmp .-266 ; 0x18af8 if (fsensor.getFilamentPresent()) { MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); } #ifndef REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY else { if (fsensor.getAutoLoadEnabled()) { 18c02: 80 91 85 16 lds r24, 0x1685 ; 0x801685 18c06: 88 23 and r24, r24 18c08: 09 f4 brne .+2 ; 0x18c0c 18c0a: 78 cf rjmp .-272 ; 0x18afc MENU_ITEM_SUBMENU_P(_T(MSG_AUTOLOAD_FILAMENT), lcd_menu_AutoLoadFilament); 18c0c: 87 e4 ldi r24, 0x47 ; 71 18c0e: 9c e3 ldi r25, 0x3C ; 60 18c10: 0e 94 a7 6c call 0xd94e ; 0xd94e 18c14: 61 e1 ldi r22, 0x11 ; 17 18c16: 77 e3 ldi r23, 0x37 ; 55 18c18: 6f cf rjmp .-290 ; 0x18af8 } } #endif //REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY } else { #endif //FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 18c1a: 8b e5 ldi r24, 0x5B ; 91 18c1c: 9c e3 ldi r25, 0x3C ; 60 18c1e: 0e 94 a7 6c call 0xd94e ; 0xd94e 18c22: 69 e8 ldi r22, 0x89 ; 137 18c24: 78 e3 ldi r23, 0x38 ; 56 18c26: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 18c2a: e4 cf rjmp .-56 ; 0x18bf4 #endif //HOST_SHUTOWN MENU_ITEM_SUBMENU_P(_T(MSG_SUPPORT), lcd_support_menu); MENU_END(); } 18c2c: df 91 pop r29 18c2e: cf 91 pop r28 18c30: 1f 91 pop r17 18c32: 08 95 ret 00018c34 : } static void nozzle_change() { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled() && fsensor.getFilamentPresent()) { 18c34: 80 91 84 16 lds r24, 0x1684 ; 0x801684 18c38: 88 23 and r24, r24 18c3a: 61 f0 breq .+24 ; 0x18c54 18c3c: 0e 94 f9 c3 call 0x187f2 ; 0x187f2 18c40: 88 23 and r24, r24 18c42: 41 f0 breq .+16 ; 0x18c54 lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); 18c44: 8e ef ldi r24, 0xFE ; 254 18c46: 99 e3 ldi r25, 0x39 ; 57 18c48: 0e 94 a7 6c call 0xd94e ; 0xd94e 18c4c: 0f 94 a9 0b call 0x21752 ; 0x21752 lcd_return_to_status(); return; } #endif //FILAMENT_SENSOR lcd_commands_type = LcdCommands::NozzleCNG; lcd_return_to_status(); 18c50: 0c 94 6d fe jmp 0x1fcda ; 0x1fcda 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; 18c54: 85 e0 ldi r24, 0x05 ; 5 18c56: 80 93 c8 0d sts 0x0DC8, r24 ; 0x800dc8 18c5a: fa cf rjmp .-12 ; 0x18c50 00018c5c : status |= components; eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } void calibration_status_clear(CalibrationStatus components) { 18c5c: cf 93 push r28 18c5e: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 18c60: 86 ea ldi r24, 0xA6 ; 166 18c62: 9c e0 ldi r25, 0x0C ; 12 18c64: 0f 94 9b a0 call 0x34136 ; 0x34136 status &= ~components; 18c68: c0 95 com r28 18c6a: 6c 2f mov r22, r28 18c6c: 68 23 and r22, r24 18c6e: 86 ea ldi r24, 0xA6 ; 166 18c70: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 18c72: cf 91 pop r28 18c74: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 00018c78 : } } } static void lcd_reset_sheet() { 18c78: 1f 93 push r17 18c7a: cf 93 push r28 18c7c: df 93 push r29 18c7e: 00 d0 rcall .+0 ; 0x18c80 18c80: 00 d0 rcall .+0 ; 0x18c82 18c82: 1f 92 push r1 18c84: 1f 92 push r1 18c86: cd b7 in r28, 0x3d ; 61 18c88: de b7 in r29, 0x3e ; 62 SheetName sheetName; eeprom_default_sheet_name(selected_sheet, sheetName); 18c8a: be 01 movw r22, r28 18c8c: 6f 5f subi r22, 0xFF ; 255 18c8e: 7f 4f sbci r23, 0xFF ; 255 18c90: 80 91 98 03 lds r24, 0x0398 ; 0x800398 18c94: 0e 94 3e 6f call 0xde7c ; 0xde7c eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[selected_sheet].z_offset)),EEPROM_EMPTY_VALUE16); 18c98: 80 91 98 03 lds r24, 0x0398 ; 0x800398 18c9c: 1b e0 ldi r17, 0x0B ; 11 18c9e: 81 9f mul r24, r17 18ca0: c0 01 movw r24, r0 18ca2: 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); 18ca4: 6f ef ldi r22, 0xFF ; 255 18ca6: 7f ef ldi r23, 0xFF ; 255 18ca8: 80 5b subi r24, 0xB0 ; 176 18caa: 92 4f sbci r25, 0xF2 ; 242 18cac: 0f 94 dd a0 call 0x341ba ; 0x341ba eeprom_update_block_notify(sheetName.c,EEPROM_Sheets_base->s[selected_sheet].name,sizeof(Sheet::name)); 18cb0: 60 91 98 03 lds r22, 0x0398 ; 0x800398 18cb4: 61 9f mul r22, r17 18cb6: b0 01 movw r22, r0 18cb8: 11 24 eor r1, r1 18cba: 67 5b subi r22, 0xB7 ; 183 18cbc: 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); 18cbe: 47 e0 ldi r20, 0x07 ; 7 18cc0: 50 e0 ldi r21, 0x00 ; 0 18cc2: ce 01 movw r24, r28 18cc4: 01 96 adiw r24, 0x01 ; 1 18cc6: 0f 94 af a0 call 0x3415e ; 0x3415e if (selected_sheet == eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) 18cca: 81 ea ldi r24, 0xA1 ; 161 18ccc: 9d e0 ldi r25, 0x0D ; 13 18cce: 0f 94 9b a0 call 0x34136 ; 0x34136 18cd2: 90 91 98 03 lds r25, 0x0398 ; 0x800398 18cd6: 89 13 cpse r24, r25 18cd8: 0a c0 rjmp .+20 ; 0x18cee { eeprom_switch_to_next_sheet(); 18cda: 0e 94 30 6f call 0xde60 ; 0xde60 if (-1 == eeprom_next_initialized_sheet(0)) 18cde: 80 e0 ldi r24, 0x00 ; 0 18ce0: 0e 94 1c 6f call 0xde38 ; 0xde38 18ce4: 8f 3f cpi r24, 0xFF ; 255 18ce6: 19 f4 brne .+6 ; 0x18cee calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 18ce8: 80 e1 ldi r24, 0x10 ; 16 18cea: 0e 94 2e c6 call 0x18c5c ; 0x18c5c } menu_back(); 18cee: 0f 94 43 96 call 0x32c86 ; 0x32c86 } 18cf2: 28 96 adiw r28, 0x08 ; 8 18cf4: 0f b6 in r0, 0x3f ; 63 18cf6: f8 94 cli 18cf8: de bf out 0x3e, r29 ; 62 18cfa: 0f be out 0x3f, r0 ; 63 18cfc: cd bf out 0x3d, r28 ; 61 18cfe: df 91 pop r29 18d00: cf 91 pop r28 18d02: 1f 91 pop r17 18d04: 08 95 ret 00018d06 : CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); return ((status & components) == components); } void calibration_status_set(CalibrationStatus components) { 18d06: cf 93 push r28 18d08: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 18d0a: 86 ea ldi r24, 0xA6 ; 166 18d0c: 9c e0 ldi r25, 0x0C ; 12 18d0e: 0f 94 9b a0 call 0x34136 ; 0x34136 status |= components; 18d12: 68 2f mov r22, r24 18d14: 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); 18d16: 86 ea ldi r24, 0xA6 ; 166 18d18: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 18d1a: cf 91 pop r28 18d1c: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 00018d20 : //! @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) 18d20: 2f 92 push r2 18d22: 3f 92 push r3 18d24: 4f 92 push r4 18d26: 5f 92 push r5 18d28: 6f 92 push r6 18d2a: 7f 92 push r7 18d2c: 8f 92 push r8 18d2e: 9f 92 push r9 18d30: af 92 push r10 18d32: bf 92 push r11 18d34: cf 92 push r12 18d36: df 92 push r13 18d38: ef 92 push r14 18d3a: ff 92 push r15 18d3c: 0f 93 push r16 18d3e: 1f 93 push r17 18d40: cf 93 push r28 18d42: df 93 push r29 18d44: cd b7 in r28, 0x3d ; 61 18d46: de b7 in r29, 0x3e ; 62 18d48: ce 5c subi r28, 0xCE ; 206 18d4a: d1 09 sbc r29, r1 18d4c: 0f b6 in r0, 0x3f ; 63 18d4e: f8 94 cli 18d50: de bf out 0x3e, r29 ; 62 18d52: 0f be out 0x3f, r0 ; 63 18d54: cd bf out 0x3d, r28 ; 61 18d56: 18 2f mov r17, r24 #endif // TMC2130 FORCE_BL_ON_START; // Only Z calibration? if (!onlyZ) 18d58: 81 11 cpse r24, r1 18d5a: 04 c0 rjmp .+8 ; 0x18d64 { disable_heater(); 18d5c: 0f 94 e7 12 call 0x225ce ; 0x225ce eeprom_adjust_bed_reset(); //reset bed level correction 18d60: 0e 94 65 6f call 0xdeca ; 0xdeca } // Disable the default update procedure of the display. We will do a modal dialog. lcd_update_enable(false); 18d64: 80 e0 ldi r24, 0x00 ; 0 18d66: 0e 94 b6 69 call 0xd36c ; 0xd36c // Let the planner use the uncorrected coordinates. mbl.reset(); 18d6a: 0f 94 b0 56 call 0x2ad60 ; 0x2ad60 // 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(); 18d6e: 0f 94 1b 90 call 0x32036 ; 0x32036 babystepLoadZ = 0; } void babystep_reset() { babystepLoadZ = 0; 18d72: 10 92 2a 05 sts 0x052A, r1 ; 0x80052a <_ZL13babystepLoadZ.lto_priv.459+0x1> 18d76: 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)); 18d7a: e3 ea ldi r30, 0xA3 ; 163 18d7c: f6 e0 ldi r31, 0x06 ; 6 18d7e: 83 e0 ldi r24, 0x03 ; 3 18d80: df 01 movw r26, r30 18d82: 1d 92 st X+, r1 18d84: 8a 95 dec r24 18d86: e9 f7 brne .-6 ; 0x18d82 // Home in the XY plane. //set_destination_to_current(); int l_feedmultiply = setup_for_endstop_move(); 18d88: 81 e0 ldi r24, 0x01 ; 1 18d8a: 0e 94 e4 5f call 0xbfc8 ; 0xbfc8 18d8e: c7 55 subi r28, 0x57 ; 87 18d90: df 4f sbci r29, 0xFF ; 255 18d92: 99 83 std Y+1, r25 ; 0x01 18d94: 88 83 st Y, r24 18d96: c9 5a subi r28, 0xA9 ; 169 18d98: d0 40 sbci r29, 0x00 ; 0 lcd_display_message_fullscreen_P(_T(MSG_AUTO_HOME)); 18d9a: 80 e4 ldi r24, 0x40 ; 64 18d9c: 98 e4 ldi r25, 0x48 ; 72 18d9e: 0e 94 a7 6c call 0xd94e ; 0xd94e 18da2: 0f 94 22 0b call 0x21644 ; 0x21644 raise_z_above(MESH_HOME_Z_SEARCH); 18da6: 60 e0 ldi r22, 0x00 ; 0 18da8: 70 e0 ldi r23, 0x00 ; 0 18daa: 80 ea ldi r24, 0xA0 ; 160 18dac: 90 e4 ldi r25, 0x40 ; 64 18dae: 0e 94 35 67 call 0xce6a ; 0xce6a } /**/ void home_xy() { set_destination_to_current(); 18db2: 0e 94 2c 61 call 0xc258 ; 0xc258 homeaxis(X_AXIS); 18db6: 80 e0 ldi r24, 0x00 ; 0 18db8: 0f 94 7b 54 call 0x2a8f6 ; 0x2a8f6 homeaxis(Y_AXIS); 18dbc: 81 e0 ldi r24, 0x01 ; 1 18dbe: 0f 94 7b 54 call 0x2a8f6 ; 0x2a8f6 plan_set_position_curposXYZE(); 18dc2: 0f 94 ef 83 call 0x307de ; 0x307de endstops_hit_on_purpose(); 18dc6: 0f 94 22 2d call 0x25a44 ; 0x25a44 18dca: 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; 18dce: 20 e0 ldi r18, 0x00 ; 0 18dd0: 30 e0 ldi r19, 0x00 ; 0 18dd2: 40 ea ldi r20, 0xA0 ; 160 18dd4: 50 e4 ldi r21, 0x40 ; 64 18dd6: 60 91 f5 11 lds r22, 0x11F5 ; 0x8011f5 18dda: 70 91 f6 11 lds r23, 0x11F6 ; 0x8011f6 18dde: 80 91 f7 11 lds r24, 0x11F7 ; 0x8011f7 18de2: 90 91 f8 11 lds r25, 0x11F8 ; 0x8011f8 18de6: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 18dea: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 18dee: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 18df2: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 18df6: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 current_position[Y_AXIS] += 5; 18dfa: 20 e0 ldi r18, 0x00 ; 0 18dfc: 30 e0 ldi r19, 0x00 ; 0 18dfe: 40 ea ldi r20, 0xA0 ; 160 18e00: 50 e4 ldi r21, 0x40 ; 64 18e02: 60 91 f9 11 lds r22, 0x11F9 ; 0x8011f9 18e06: 70 91 fa 11 lds r23, 0x11FA ; 0x8011fa 18e0a: 80 91 fb 11 lds r24, 0x11FB ; 0x8011fb 18e0e: 90 91 fc 11 lds r25, 0x11FC ; 0x8011fc 18e12: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 18e16: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 18e1a: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 18e1e: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 18e22: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 18e26: 60 e0 ldi r22, 0x00 ; 0 18e28: 70 e0 ldi r23, 0x00 ; 0 18e2a: 80 ea ldi r24, 0xA0 ; 160 18e2c: 91 e4 ldi r25, 0x41 ; 65 18e2e: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 18e32: 0f 94 ce 22 call 0x2459c ; 0x2459c // 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)) 18e36: 81 2f mov r24, r17 18e38: 0f 94 b5 35 call 0x26b6a ; 0x26b6a 18e3c: e5 96 adiw r28, 0x35 ; 53 18e3e: 8f af std Y+63, r24 ; 0x3f 18e40: e5 97 sbiw r28, 0x35 ; 53 18e42: 81 11 cpse r24, r1 18e44: 04 c0 rjmp .+8 ; 0x18e4e //! @param verbosity_level //! @retval true Succeeded //! @retval false Failed bool gcode_M45(bool onlyZ, int8_t verbosity_level) { bool final_result = false; 18e46: e5 96 adiw r28, 0x35 ; 53 18e48: 1f ae std Y+63, r1 ; 0x3f 18e4a: e5 97 sbiw r28, 0x35 ; 53 18e4c: 08 c3 rjmp .+1552 ; 0x1945e { #else //TMC2130 if (lcd_calibrate_z_end_stop_manual(onlyZ)) { #endif //TMC2130 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CONFIRM_NOZZLE_CLEAN)); 18e4e: 84 e0 ldi r24, 0x04 ; 4 18e50: 98 e4 ldi r25, 0x48 ; 72 18e52: 0e 94 a7 6c call 0xd94e ; 0xd94e 18e56: 0f 94 a9 0b call 0x21752 ; 0x21752 if(onlyZ){ 18e5a: 11 23 and r17, r17 18e5c: 09 f4 brne .+2 ; 0x18e60 18e5e: da c2 rjmp .+1460 ; 0x19414 prompt_steel_sheet_on_bed(true); 18e60: 81 e0 ldi r24, 0x01 ; 1 18e62: 0f 94 4e 30 call 0x2609c ; 0x2609c lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 18e66: 82 ed ldi r24, 0xD2 ; 210 18e68: 97 e4 ldi r25, 0x47 ; 71 18e6a: 0e 94 a7 6c call 0xd94e ; 0xd94e 18e6e: 0f 94 22 0b call 0x21644 ; 0x21644 lcd_puts_at_P(0,3,_n("1/9")); 18e72: 4a eb ldi r20, 0xBA ; 186 18e74: 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")); 18e76: 63 e0 ldi r22, 0x03 ; 3 18e78: 80 e0 ldi r24, 0x00 ; 0 18e7a: 0e 94 85 69 call 0xd30a ; 0xd30a } refresh_cmd_timeout(); 18e7e: 0e 94 bf 5f call 0xbf7e ; 0xbf7e if (((degHotend(0) > MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) && (!onlyZ)) { lcd_wait_for_cool_down(); } #endif //STEEL_SHEET if(!onlyZ) 18e82: 11 11 cpse r17, r1 18e84: 1b c0 rjmp .+54 ; 0x18ebc { KEEPALIVE_STATE(PAUSED_FOR_USER); 18e86: 84 e0 ldi r24, 0x04 ; 4 18e88: 80 93 78 02 sts 0x0278, r24 ; 0x800278 prompt_steel_sheet_on_bed(false); 18e8c: 80 e0 ldi r24, 0x00 ; 0 18e8e: 0f 94 4e 30 call 0x2609c ; 0x2609c lcd_show_fullscreen_message_and_wait_P(_T(MSG_PAPER)); 18e92: 88 e1 ldi r24, 0x18 ; 24 18e94: 97 e4 ldi r25, 0x47 ; 71 18e96: 0e 94 a7 6c call 0xd94e ; 0xd94e 18e9a: 0f 94 a9 0b call 0x21752 ; 0x21752 KEEPALIVE_STATE(IN_HANDLER); 18e9e: 82 e0 ldi r24, 0x02 ; 2 18ea0: 80 93 78 02 sts 0x0278, r24 ; 0x800278 lcd_display_message_fullscreen_P(_T(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1)); 18ea4: 80 eb ldi r24, 0xB0 ; 176 18ea6: 97 e4 ldi r25, 0x47 ; 71 18ea8: 0e 94 a7 6c call 0xd94e ; 0xd94e 18eac: 0f 94 22 0b call 0x21644 ; 0x21644 lcd_puts_at_P(0,3,_n("1/4")); 18eb0: 42 eb ldi r20, 0xB2 ; 178 18eb2: 59 e6 ldi r21, 0x69 ; 105 18eb4: 63 e0 ldi r22, 0x03 ; 3 18eb6: 80 e0 ldi r24, 0x00 ; 0 18eb8: 0e 94 85 69 call 0xd30a ; 0xd30a return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 18ebc: 00 91 77 02 lds r16, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.364> check_endstops = check; 18ec0: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.364> } bool endstops_enabled = enable_endstops(false); raise_z(-1); 18ec4: 60 e0 ldi r22, 0x00 ; 0 18ec6: 70 e0 ldi r23, 0x00 ; 0 18ec8: 80 e8 ldi r24, 0x80 ; 128 18eca: 9f eb ldi r25, 0xBF ; 191 18ecc: 0e 94 d3 66 call 0xcda6 ; 0xcda6 // Move the print head close to the bed. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 18ed0: c1 2c mov r12, r1 18ed2: d1 2c mov r13, r1 18ed4: b0 ea ldi r27, 0xA0 ; 160 18ed6: eb 2e mov r14, r27 18ed8: b0 e4 ldi r27, 0x40 ; 64 18eda: fb 2e mov r15, r27 18edc: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 18ee0: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 18ee4: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 18ee8: f0 92 00 12 sts 0x1200, r15 ; 0x801200 18eec: 81 e0 ldi r24, 0x01 ; 1 18eee: 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); 18ef2: 60 e0 ldi r22, 0x00 ; 0 18ef4: 70 e0 ldi r23, 0x00 ; 0 18ef6: 80 ea ldi r24, 0xA0 ; 160 18ef8: 91 e4 ldi r25, 0x41 ; 65 18efa: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 18efe: 0f 94 ce 22 call 0x2459c ; 0x2459c 18f02: 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)) && 18f06: 82 e0 ldi r24, 0x02 ; 2 18f08: 0f 94 ba 22 call 0x24574 ; 0x24574 18f0c: 2d ec ldi r18, 0xCD ; 205 18f0e: 3c ec ldi r19, 0xCC ; 204 18f10: 44 ea ldi r20, 0xA4 ; 164 18f12: 50 e4 ldi r21, 0x40 ; 64 18f14: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 18f18: 18 16 cp r1, r24 18f1a: 0c f4 brge .+2 ; 0x18f1e 18f1c: 84 c2 rjmp .+1288 ; 0x19426 (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) 18f1e: 82 e0 ldi r24, 0x02 ; 2 18f20: 0f 94 ba 22 call 0x24574 ; 0x24574 #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)) && 18f24: 23 e3 ldi r18, 0x33 ; 51 18f26: 33 e3 ldi r19, 0x33 ; 51 18f28: 4b e9 ldi r20, 0x9B ; 155 18f2a: 50 e4 ldi r21, 0x40 ; 64 18f2c: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 18f30: 87 fd sbrc r24, 7 18f32: 79 c2 rjmp .+1266 ; 0x19426 (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) { if (onlyZ) 18f34: 11 11 cpse r17, r1 18f36: 7c c2 rjmp .+1272 ; 0x19430 } } else { // Reset the baby step value and the baby step applied flag. calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 18f38: 80 e1 ldi r24, 0x10 ; 16 18f3a: 0e 94 2e c6 call 0x18c5c ; 0x18c5c eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 18f3e: 81 ea ldi r24, 0xA1 ; 161 18f40: 9d e0 ldi r25, 0x0D ; 13 18f42: 0f 94 9b a0 call 0x34136 ; 0x34136 18f46: bb e0 ldi r27, 0x0B ; 11 18f48: 8b 9f mul r24, r27 18f4a: c0 01 movw r24, r0 18f4c: 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); 18f4e: 70 e0 ldi r23, 0x00 ; 0 18f50: 60 e0 ldi r22, 0x00 ; 0 18f52: 80 5b subi r24, 0xB0 ; 176 18f54: 92 4f sbci r25, 0xF2 ; 242 18f56: 0f 94 dd a0 call 0x341ba ; 0x341ba } 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(); 18f5a: 0e 94 bf 5f call 0xbf7e ; 0xbf7e // 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); 18f5e: ed e9 ldi r30, 0x9D ; 157 18f60: f2 e1 ldi r31, 0x12 ; 18 18f62: 84 ec ldi r24, 0xC4 ; 196 18f64: df 01 movw r26, r30 18f66: 1d 92 st X+, r1 18f68: 8a 95 dec r24 18f6a: e9 f7 brne .-6 ; 0x18f66 { #else //NEW_XYZCAL while (iteration < 3) { #endif //NEW_XYZCAL SERIAL_ECHOPGM("Iteration: "); 18f6c: 81 e7 ldi r24, 0x71 ; 113 18f6e: 98 e8 ldi r25, 0x88 ; 136 18f70: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 MYSERIAL.println(int(iteration + 1)); 18f74: 81 e0 ldi r24, 0x01 ; 1 18f76: 90 e0 ldi r25, 0x00 ; 0 18f78: 0f 94 62 42 call 0x284c4 ; 0x284c4 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)); 18f7c: 80 eb ldi r24, 0xB0 ; 176 18f7e: 97 e4 ldi r25, 0x47 ; 71 18f80: 0e 94 a7 6c call 0xd94e ; 0xd94e 18f84: 0f 94 22 0b call 0x21644 ; 0x21644 #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; 18f88: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 18f8c: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 18f90: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 18f94: f0 92 00 12 sts 0x1200, r15 ; 0x801200 18f98: b2 e0 ldi r27, 0x02 ; 2 18f9a: e1 96 adiw r28, 0x31 ; 49 18f9c: bf af std Y+63, r27 ; 0x3f 18f9e: e1 97 sbiw r28, 0x31 ; 49 18fa0: 2c e4 ldi r18, 0x4C ; 76 18fa2: 38 e8 ldi r19, 0x88 ; 136 18fa4: cd 56 subi r28, 0x6D ; 109 18fa6: df 4f sbci r29, 0xFF ; 255 18fa8: 39 83 std Y+1, r19 ; 0x01 18faa: 28 83 st Y, r18 18fac: c3 59 subi r28, 0x93 ; 147 18fae: d0 40 sbci r29, 0x00 ; 0 18fb0: 4c e9 ldi r20, 0x9C ; 156 18fb2: 52 e1 ldi r21, 0x12 ; 18 18fb4: cf 56 subi r28, 0x6F ; 111 18fb6: df 4f sbci r29, 0xFF ; 255 18fb8: 59 83 std Y+1, r21 ; 0x01 18fba: 48 83 st Y, r20 18fbc: c1 59 subi r28, 0x91 ; 145 18fbe: d0 40 sbci r29, 0x00 ; 0 18fc0: a0 96 adiw r28, 0x20 ; 32 18fc2: 5f af std Y+63, r21 ; 0x3f 18fc4: 4e af std Y+62, r20 ; 0x3e 18fc6: a0 97 sbiw r28, 0x20 ; 32 18fc8: e0 96 adiw r28, 0x30 ; 48 18fca: 3f af std Y+63, r19 ; 0x3f 18fcc: 2e af std Y+62, r18 ; 0x3e 18fce: 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; 18fd0: a7 96 adiw r28, 0x27 ; 39 18fd2: 1f ae std Y+63, r1 ; 0x3f 18fd4: a7 97 sbiw r28, 0x27 ; 39 for (int k = 0; k < 4; ++k) { 18fd6: 31 2c mov r3, r1 18fd8: 21 2c mov r2, r1 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 18fda: 0e 94 bf 5f call 0xbf7e ; 0xbf7e #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_set_cursor(0, 3); 18fde: 63 e0 ldi r22, 0x03 ; 3 18fe0: 80 e0 ldi r24, 0x00 ; 0 18fe2: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_printf_P(PSTR("%d/4"),(k+1)); 18fe6: bf ef ldi r27, 0xFF ; 255 18fe8: 2b 1a sub r2, r27 18fea: 3b 0a sbc r3, r27 18fec: 3f 92 push r3 18fee: 2f 92 push r2 18ff0: ec e6 ldi r30, 0x6C ; 108 18ff2: f8 e8 ldi r31, 0x88 ; 136 18ff4: ff 93 push r31 18ff6: ef 93 push r30 18ff8: 0e 94 4a 69 call 0xd294 ; 0xd294 } #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); 18ffc: 65 e5 ldi r22, 0x55 ; 85 18ffe: 75 e5 ldi r23, 0x55 ; 85 19000: 85 e5 ldi r24, 0x55 ; 85 19002: 91 e4 ldi r25, 0x41 ; 65 19004: 0f 94 e1 87 call 0x30fc2 ; 0x30fc2 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); 19008: e0 96 adiw r28, 0x30 ; 48 1900a: ee ad ldd r30, Y+62 ; 0x3e 1900c: ff ad ldd r31, Y+63 ; 0x3f 1900e: e0 97 sbiw r28, 0x30 ; 48 19010: 85 91 lpm r24, Z+ 19012: 95 91 lpm r25, Z+ 19014: a5 91 lpm r26, Z+ 19016: b4 91 lpm r27, Z 19018: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 1901c: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 19020: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 19024: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + k * 2 + 1); 19028: e0 96 adiw r28, 0x30 ; 48 1902a: ee ad ldd r30, Y+62 ; 0x3e 1902c: ff ad ldd r31, Y+63 ; 0x3f 1902e: e0 97 sbiw r28, 0x30 ; 48 19030: 34 96 adiw r30, 0x04 ; 4 19032: 85 91 lpm r24, Z+ 19034: 95 91 lpm r25, Z+ 19036: a5 91 lpm r26, Z+ 19038: b4 91 lpm r27, Z 1903a: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 1903e: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 19042: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 19046: 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); 1904a: 60 e0 ldi r22, 0x00 ; 0 1904c: 70 e0 ldi r23, 0x00 ; 0 1904e: 88 e4 ldi r24, 0x48 ; 72 19050: 92 e4 ldi r25, 0x42 ; 66 19052: 0f 94 e1 87 call 0x30fc2 ; 0x30fc2 return pos * 0.01f; } void xyzcal_measure_enter(void) { DBG(_n("xyzcal_measure_enter\n")); 19056: 41 ed ldi r20, 0xD1 ; 209 19058: 56 e8 ldi r21, 0x86 ; 134 1905a: 5f 93 push r21 1905c: 4f 93 push r20 1905e: 0f 94 5d 9f call 0x33eba ; 0x33eba lcd_puts_at_P(4,3,PSTR("Measure center ")); ////MSG_MEASURE_CENTER c=16 19062: 40 ec ldi r20, 0xC0 ; 192 19064: 56 e8 ldi r21, 0x86 ; 134 19066: 63 e0 ldi r22, 0x03 ; 3 19068: 84 e0 ldi r24, 0x04 ; 4 1906a: 0e 94 85 69 call 0xd30a ; 0xd30a // disable heaters and stop motion before we initialize sm4 disable_heater(); 1906e: 0f 94 e7 12 call 0x225ce ; 0x225ce st_synchronize(); 19072: 0f 94 ce 22 call 0x2459c ; 0x2459c // disable incompatible interrupts DISABLE_STEPPER_DRIVER_INTERRUPT(); 19076: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 1907a: 8d 7f andi r24, 0xFD ; 253 1907c: 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" ); 19080: 0f b6 in r0, 0x3f ; 63 19082: f8 94 cli 19084: a8 95 wdr 19086: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1908a: 88 61 ori r24, 0x18 ; 24 1908c: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 19090: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 19094: 0f be out 0x3f, r0 ; 63 #ifdef WATCHDOG wdt_disable(); #endif //WATCHDOG // setup internal callbacks sm4_stop_cb = 0; 19096: 10 92 28 05 sts 0x0528, r1 ; 0x800528 1909a: 10 92 27 05 sts 0x0527, r1 ; 0x800527 sm4_update_pos_cb = xyzcal_update_pos; 1909e: 80 e0 ldi r24, 0x00 ; 0 190a0: 91 eb ldi r25, 0xB1 ; 177 190a2: 90 93 26 05 sts 0x0526, r25 ; 0x800526 190a6: 80 93 25 05 sts 0x0525, r24 ; 0x800525 sm4_calc_delay_cb = xyzcal_calc_delay; 190aa: af e5 ldi r26, 0x5F ; 95 190ac: b0 eb ldi r27, 0xB0 ; 176 190ae: b0 93 24 05 sts 0x0524, r27 ; 0x800524 190b2: 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]); 190b6: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 190ba: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 190be: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 190c2: 30 91 c1 06 lds r19, 0x06C1 ; 0x8006c1 190c6: 40 91 ba 06 lds r20, 0x06BA ; 0x8006ba 190ca: 50 91 bb 06 lds r21, 0x06BB ; 0x8006bb 190ce: 60 91 bc 06 lds r22, 0x06BC ; 0x8006bc 190d2: 70 91 bd 06 lds r23, 0x06BD ; 0x8006bd 190d6: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 190da: 90 91 b7 06 lds r25, 0x06B7 ; 0x8006b7 190de: a0 91 b8 06 lds r26, 0x06B8 ; 0x8006b8 190e2: b0 91 b9 06 lds r27, 0x06B9 ; 0x8006b9 190e6: 3f 93 push r19 190e8: 2f 93 push r18 190ea: 1f 93 push r17 190ec: 0f 93 push r16 190ee: 7f 93 push r23 190f0: 6f 93 push r22 190f2: 5f 93 push r21 190f4: 4f 93 push r20 190f6: bf 93 push r27 190f8: af 93 push r26 190fa: 9f 93 push r25 190fc: 8f 93 push r24 190fe: e0 e7 ldi r30, 0x70 ; 112 19100: f7 e8 ldi r31, 0x87 ; 135 19102: ff 93 push r31 19104: ef 93 push r30 19106: 0f 94 5d 9f call 0x33eba ; 0x33eba int16_t x0 = _X; 1910a: 40 90 b6 06 lds r4, 0x06B6 ; 0x8006b6 1910e: 50 90 b7 06 lds r5, 0x06B7 ; 0x8006b7 19112: 60 90 b8 06 lds r6, 0x06B8 ; 0x8006b8 19116: 70 90 b9 06 lds r7, 0x06B9 ; 0x8006b9 1911a: b4 2c mov r11, r4 1911c: a5 2c mov r10, r5 int16_t y0 = _Y; 1911e: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 19122: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 19126: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 1912a: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 1912e: a6 96 adiw r28, 0x26 ; 38 19130: 8c af std Y+60, r24 ; 0x3c 19132: 9d af std Y+61, r25 ; 0x3d 19134: ae af std Y+62, r26 ; 0x3e 19136: bf af std Y+63, r27 ; 0x3f 19138: a6 97 sbiw r28, 0x26 ; 38 1913a: a3 96 adiw r28, 0x23 ; 35 1913c: 9f ac ldd r9, Y+63 ; 0x3f 1913e: a3 97 sbiw r28, 0x23 ; 35 19140: a4 96 adiw r28, 0x24 ; 36 19142: 8f ac ldd r8, Y+63 ; 0x3f 19144: a4 97 sbiw r28, 0x24 ; 36 int16_t z = _Z; 19146: c0 90 be 06 lds r12, 0x06BE ; 0x8006be 1914a: d0 90 bf 06 lds r13, 0x06BF ; 0x8006bf 1914e: e0 90 c0 06 lds r14, 0x06C0 ; 0x8006c0 19152: f0 90 c1 06 lds r15, 0x06C1 ; 0x8006c1 19156: 0f b6 in r0, 0x3f ; 63 19158: f8 94 cli 1915a: de bf out 0x3e, r29 ; 62 1915c: 0f be out 0x3f, r0 ; 63 1915e: cd bf out 0x3d, r28 ; 61 // int16_t min_z = -6000; // int16_t dz = 100; while (z > -2300) { //-6mm + 0.25mm 19160: b5 e0 ldi r27, 0x05 ; 5 19162: cb 16 cp r12, r27 19164: b7 ef ldi r27, 0xF7 ; 247 19166: db 06 cpc r13, r27 19168: 0c f4 brge .+2 ; 0x1916c 1916a: d3 c1 rjmp .+934 ; 0x19512 } 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; 1916c: 1a 82 std Y+2, r1 ; 0x02 1916e: 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); 19170: 1f 92 push r1 19172: 1f 92 push r1 19174: e3 e0 ldi r30, 0x03 ; 3 19176: ef 93 push r30 19178: f4 e8 ldi r31, 0x84 ; 132 1917a: ff 93 push r31 1917c: 1f 92 push r1 1917e: 24 e6 ldi r18, 0x64 ; 100 19180: 2f 93 push r18 19182: df 92 push r13 19184: cf 92 push r12 19186: 8f 92 push r8 19188: 9f 92 push r9 1918a: af 92 push r10 1918c: bf 92 push r11 1918e: 47 ee ldi r20, 0xE7 ; 231 19190: 56 e8 ldi r21, 0x86 ; 134 19192: 5f 93 push r21 19194: 4f 93 push r20 19196: 0f 94 5d 9f call 0x33eba ; 0x33eba if (!ret && (ad < 720)) 1919a: 0f b6 in r0, 0x3f ; 63 1919c: f8 94 cli 1919e: de bf out 0x3e, r29 ; 62 191a0: 0f be out 0x3f, r0 ; 63 191a2: cd bf out 0x3d, r28 ; 61 191a4: 89 81 ldd r24, Y+1 ; 0x01 191a6: 9a 81 ldd r25, Y+2 ; 0x02 191a8: 80 3d cpi r24, 0xD0 ; 208 191aa: 92 40 sbci r25, 0x02 ; 2 191ac: 08 f4 brcc .+2 ; 0x191b0 191ae: 7c c1 rjmp .+760 ; 0x194a8 if ((ret = xyzcal_spiral2(cx, cy, z0 - 0*dz, dz, radius, 0, delay_us, check_pinda, &ad)) != 0) ad += 0; if (!ret && (ad < 1440)) 191b0: 89 81 ldd r24, Y+1 ; 0x01 191b2: 9a 81 ldd r25, Y+2 ; 0x02 191b4: 80 3a cpi r24, 0xA0 ; 160 191b6: 95 40 sbci r25, 0x05 ; 5 191b8: 10 f0 brcs .+4 ; 0x191be 191ba: 0c 94 d4 d7 jmp 0x1afa8 ; 0x1afa8 if ((ret = xyzcal_spiral2(cx, cy, z0 - 1*dz, dz, -radius, 0, delay_us, check_pinda, &ad)) != 0) 191be: 9e 01 movw r18, r28 191c0: 2f 5f subi r18, 0xFF ; 255 191c2: 3f 4f sbci r19, 0xFF ; 255 191c4: 79 01 movw r14, r18 191c6: 10 e0 ldi r17, 0x00 ; 0 191c8: 00 e0 ldi r16, 0x00 ; 0 191ca: 2c e7 ldi r18, 0x7C ; 124 191cc: 3c ef ldi r19, 0xFC ; 252 191ce: a6 01 movw r20, r12 191d0: 44 56 subi r20, 0x64 ; 100 191d2: 51 09 sbc r21, r1 191d4: 69 2d mov r22, r9 191d6: 78 2d mov r23, r8 191d8: 8b 2d mov r24, r11 191da: 9a 2d mov r25, r10 191dc: 0f 94 8b 5f call 0x2bf16 ; 0x2bf16 191e0: 88 23 and r24, r24 191e2: 11 f4 brne .+4 ; 0x191e8 191e4: 0c 94 d4 d7 jmp 0x1afa8 ; 0x1afa8 ad += 720; 191e8: 89 81 ldd r24, Y+1 ; 0x01 191ea: 9a 81 ldd r25, Y+2 ; 0x02 191ec: 80 53 subi r24, 0x30 ; 48 191ee: 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); 191f0: c0 90 be 06 lds r12, 0x06BE ; 0x8006be 191f4: d0 90 bf 06 lds r13, 0x06BF ; 0x8006bf 191f8: e0 90 c0 06 lds r14, 0x06C0 ; 0x8006c0 191fc: f0 90 c1 06 lds r15, 0x06C1 ; 0x8006c1 19200: 00 91 ba 06 lds r16, 0x06BA ; 0x8006ba 19204: 10 91 bb 06 lds r17, 0x06BB ; 0x8006bb 19208: 20 91 bc 06 lds r18, 0x06BC ; 0x8006bc 1920c: 30 91 bd 06 lds r19, 0x06BD ; 0x8006bd 19210: 40 91 b6 06 lds r20, 0x06B6 ; 0x8006b6 19214: 50 91 b7 06 lds r21, 0x06B7 ; 0x8006b7 19218: 60 91 b8 06 lds r22, 0x06B8 ; 0x8006b8 1921c: 70 91 b9 06 lds r23, 0x06B9 ; 0x8006b9 19220: 9f 93 push r25 19222: 8f 93 push r24 19224: df 92 push r13 19226: cf 92 push r12 19228: 1f 93 push r17 1922a: 0f 93 push r16 1922c: 5f 93 push r21 1922e: 4f 93 push r20 19230: 8c e4 ldi r24, 0x4C ; 76 19232: 97 e8 ldi r25, 0x87 ; 135 19234: 9f 93 push r25 19236: 8f 93 push r24 19238: 0f 94 5d 9f call 0x33eba ; 0x33eba /// 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); 1923c: 40 91 be 06 lds r20, 0x06BE ; 0x8006be 19240: 50 91 bf 06 lds r21, 0x06BF ; 0x8006bf 19244: 60 91 c0 06 lds r22, 0x06C0 ; 0x8006c0 19248: 70 91 c1 06 lds r23, 0x06C1 ; 0x8006c1 1924c: 48 54 subi r20, 0x48 ; 72 1924e: 51 09 sbc r21, r1 19250: 00 e0 ldi r16, 0x00 ; 0 19252: 28 ec ldi r18, 0xC8 ; 200 19254: 30 e0 ldi r19, 0x00 ; 0 19256: a3 96 adiw r28, 0x23 ; 35 19258: 6f ad ldd r22, Y+63 ; 0x3f 1925a: a3 97 sbiw r28, 0x23 ; 35 1925c: a4 96 adiw r28, 0x24 ; 36 1925e: 7f ad ldd r23, Y+63 ; 0x3f 19260: a4 97 sbiw r28, 0x24 ; 36 19262: c2 01 movw r24, r4 19264: 0e 94 cf c2 call 0x1859e ; 0x1859e /// 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; 19268: 20 91 b6 06 lds r18, 0x06B6 ; 0x8006b6 1926c: 30 91 b7 06 lds r19, 0x06B7 ; 0x8006b7 19270: 40 91 b8 06 lds r20, 0x06B8 ; 0x8006b8 19274: 50 91 b9 06 lds r21, 0x06B9 ; 0x8006b9 19278: 6e 96 adiw r28, 0x1e ; 30 1927a: 2c af std Y+60, r18 ; 0x3c 1927c: 3d af std Y+61, r19 ; 0x3d 1927e: 4e af std Y+62, r20 ; 0x3e 19280: 5f af std Y+63, r21 ; 0x3f 19282: 6e 97 sbiw r28, 0x1e ; 30 int16_t y = _Y; 19284: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 19288: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 1928c: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 19290: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 19294: ae 96 adiw r28, 0x2e ; 46 19296: 8c af std Y+60, r24 ; 0x3c 19298: 9d af std Y+61, r25 ; 0x3d 1929a: ae af std Y+62, r26 ; 0x3e 1929c: bf af std Y+63, r27 ; 0x3f 1929e: ae 97 sbiw r28, 0x2e ; 46 const int16_t z = _Z; 192a0: 20 91 be 06 lds r18, 0x06BE ; 0x8006be 192a4: 30 91 bf 06 lds r19, 0x06BF ; 0x8006bf 192a8: 40 91 c0 06 lds r20, 0x06C0 ; 0x8006c0 192ac: 50 91 c1 06 lds r21, 0x06C1 ; 0x8006c1 192b0: e9 96 adiw r28, 0x39 ; 57 192b2: 2c af std Y+60, r18 ; 0x3c 192b4: 3d af std Y+61, r19 ; 0x3d 192b6: 4e af std Y+62, r20 ; 0x3e 192b8: 5f af std Y+63, r21 ; 0x3f 192ba: e9 97 sbiw r28, 0x39 ; 57 192bc: a8 ec ldi r26, 0xC8 ; 200 192be: ba e0 ldi r27, 0x0A ; 10 192c0: 0f b6 in r0, 0x3f ; 63 192c2: f8 94 cli 192c4: de bf out 0x3e, r29 ; 62 192c6: 0f be out 0x3f, r0 ; 63 192c8: cd bf out 0x3d, r28 ; 61 192ca: 90 e0 ldi r25, 0x00 ; 0 192cc: 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)); 192ce: fc 01 movw r30, r24 192d0: e9 51 subi r30, 0x19 ; 25 192d2: f8 47 sbci r31, 0x78 ; 120 192d4: 25 91 lpm r18, Z+ 192d6: 34 91 lpm r19, Z 192d8: 2d 93 st X+, r18 192da: 3d 93 st X+, r19 pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); 192dc: fc 01 movw r30, r24 192de: e1 53 subi r30, 0x31 ; 49 192e0: f8 47 sbci r31, 0x78 ; 120 192e2: 25 91 lpm r18, Z+ 192e4: 34 91 lpm r19, Z 192e6: 57 96 adiw r26, 0x17 ; 23 192e8: 3c 93 st X, r19 192ea: 2e 93 st -X, r18 192ec: 56 97 sbiw r26, 0x16 ; 22 192ee: 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++){ 192f0: 88 31 cpi r24, 0x18 ; 24 192f2: 91 05 cpc r25, r1 192f4: 61 f7 brne .-40 ; 0x192ce 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); 192f6: e7 96 adiw r28, 0x37 ; 55 192f8: 4e ad ldd r20, Y+62 ; 0x3e 192fa: 5f ad ldd r21, Y+63 ; 0x3f 192fc: e7 97 sbiw r28, 0x37 ; 55 192fe: ac 96 adiw r28, 0x2c ; 44 19300: 6e ad ldd r22, Y+62 ; 0x3e 19302: 7f ad ldd r23, Y+63 ; 0x3f 19304: ac 97 sbiw r28, 0x2c ; 44 19306: 6c 96 adiw r28, 0x1c ; 28 19308: 8e ad ldd r24, Y+62 ; 0x3e 1930a: 9f ad ldd r25, Y+63 ; 0x3f 1930c: 6c 97 sbiw r28, 0x1c ; 28 1930e: 0f 94 13 5c call 0x2b826 ; 0x2b826 19312: 28 ec ldi r18, 0xC8 ; 200 19314: 36 e0 ldi r19, 0x06 ; 6 19316: a4 96 adiw r28, 0x24 ; 36 19318: 3f af std Y+63, r19 ; 0x3f 1931a: 2e af std Y+62, r18 ; 0x3e 1931c: a4 97 sbiw r28, 0x24 ; 36 1931e: 79 01 movw r14, r18 19320: f0 e2 ldi r31, 0x20 ; 32 19322: 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]); 19324: a2 e9 ldi r26, 0x92 ; 146 19326: ca 2e mov r12, r26 19328: a7 e8 ldi r26, 0x87 ; 135 1932a: da 2e mov r13, r26 } DBG(endl); 1932c: 02 e7 ldi r16, 0x72 ; 114 1932e: 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); 19330: 57 01 movw r10, r14 19332: e0 e2 ldi r30, 0x20 ; 32 19334: 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]); 19336: d5 01 movw r26, r10 19338: 8d 91 ld r24, X+ 1933a: 5d 01 movw r10, r26 1933c: 1f 92 push r1 1933e: 8f 93 push r24 19340: df 92 push r13 19342: cf 92 push r12 19344: 0f 94 5d 9f call 0x33eba ; 0x33eba 19348: 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){ 1934a: 0f 90 pop r0 1934c: 0f 90 pop r0 1934e: 0f 90 pop r0 19350: 0f 90 pop r0 19352: 81 10 cpse r8, r1 19354: f0 cf rjmp .-32 ; 0x19336 DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); 19356: 1f 93 push r17 19358: 0f 93 push r16 1935a: 0f 94 5d 9f call 0x33eba ; 0x33eba 1935e: 9a 94 dec r9 19360: b0 e2 ldi r27, 0x20 ; 32 19362: eb 0e add r14, r27 19364: 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){ 19366: 0f 90 pop r0 19368: 0f 90 pop r0 1936a: 91 10 cpse r9, r1 1936c: e1 cf rjmp .-62 ; 0x19330 for (uint8_t x = 0; x < 32; ++x){ DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); } DBG(endl); 1936e: 1f 93 push r17 19370: 0f 93 push r16 19372: 0f 94 5d 9f call 0x33eba ; 0x33eba 19376: 68 ec ldi r22, 0xC8 ; 200 19378: 7a e0 ldi r23, 0x0A ; 10 1937a: 0f 90 pop r0 1937c: 0f 90 pop r0 1937e: e8 ec ldi r30, 0xC8 ; 200 19380: 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; 19382: 90 e0 ldi r25, 0x00 ; 0 19384: 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; 19386: 50 e0 ldi r21, 0x00 ; 0 19388: 40 e0 ldi r20, 0x00 ; 0 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { 1938a: 21 91 ld r18, Z+ 1938c: 21 11 cpse r18, r1 1938e: 01 c3 rjmp .+1538 ; 0x19992 ++mins; 19390: 4f 5f subi r20, 0xFF ; 255 19392: 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){ 19394: 6e 17 cp r22, r30 19396: 7f 07 cpc r23, r31 19398: c1 f7 brne .-16 ; 0x1938a ++maxs; } } const int16_t rest = 1024 - mins - maxs; if (mins + maxs > threshold_total 1939a: 9a 01 movw r18, r20 1939c: 28 0f add r18, r24 1939e: 39 1f adc r19, r25 193a0: 25 38 cpi r18, 0x85 ; 133 193a2: 33 40 sbci r19, 0x03 ; 3 193a4: a4 f0 brlt .+40 ; 0x193ce && mins > threshold_extreme 193a6: 43 33 cpi r20, 0x33 ; 51 193a8: 51 05 cpc r21, r1 193aa: 8c f0 brlt .+34 ; 0x193ce && maxs > threshold_extreme 193ac: 83 33 cpi r24, 0x33 ; 51 193ae: 91 05 cpc r25, r1 193b0: 74 f0 brlt .+28 ; 0x193ce ++mins; } else if (matrix32[i] == 0xFF){ ++maxs; } } const int16_t rest = 1024 - mins - maxs; 193b2: 20 e0 ldi r18, 0x00 ; 0 193b4: 34 e0 ldi r19, 0x04 ; 4 193b6: 24 1b sub r18, r20 193b8: 35 0b sbc r19, r21 193ba: 28 1b sub r18, r24 193bc: 39 0b sbc r19, r25 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest 193be: 24 17 cp r18, r20 193c0: 35 07 cpc r19, r21 193c2: 2c f4 brge .+10 ; 0x193ce } 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; 193c4: 1d ef ldi r17, 0xFD ; 253 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest && maxs > rest) 193c6: 28 17 cp r18, r24 193c8: 39 07 cpc r19, r25 193ca: 0c f4 brge .+2 ; 0x193ce 193cc: d2 c0 rjmp .+420 ; 0x19572 } /// 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; 193ce: 66 96 adiw r28, 0x16 ; 22 193d0: 1f ae std Y+63, r1 ; 0x3f 193d2: 66 97 sbiw r28, 0x16 ; 22 uint8_t r08 = 0; 193d4: 62 96 adiw r28, 0x12 ; 18 193d6: 1f ae std Y+63, r1 ; 0x3f 193d8: 62 97 sbiw r28, 0x12 ; 18 uint8_t match08 = 0; uint8_t c10 = 0; 193da: 22 96 adiw r28, 0x02 ; 2 193dc: 1f ae std Y+63, r1 ; 0x3f 193de: 22 97 sbiw r28, 0x02 ; 2 uint8_t r10 = 0; 193e0: 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) 193e2: 88 ec ldi r24, 0xC8 ; 200 193e4: 96 e0 ldi r25, 0x06 ; 6 193e6: 89 2b or r24, r25 193e8: 99 f0 breq .+38 ; 0x19410 193ea: 88 ec ldi r24, 0xC8 ; 200 193ec: 9a e0 ldi r25, 0x0A ; 10 return -1; 193ee: 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) 193f0: 00 97 sbiw r24, 0x00 ; 0 193f2: 49 f0 breq .+18 ; 0x19406 193f4: ae 01 movw r20, r28 193f6: 4f 5a subi r20, 0xAF ; 175 193f8: 5f 4f sbci r21, 0xFF ; 255 193fa: be 01 movw r22, r28 193fc: 6b 5a subi r22, 0xAB ; 171 193fe: 7f 4f sbci r23, 0xFF ; 255 19400: 0f 94 36 5b call 0x2b66c ; 0x2b66c 19404: 08 2f mov r16, r24 19406: 80 ee ldi r24, 0xE0 ; 224 19408: 9a e0 ldi r25, 0x0A ; 10 1940a: 89 2b or r24, r25 1940c: 09 f0 breq .+2 ; 0x19410 1940e: c6 c2 rjmp .+1420 ; 0x1999c 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; 19410: 8f ef ldi r24, 0xFF ; 255 19412: d6 c2 rjmp .+1452 ; 0x199c0 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)); 19414: 80 eb ldi r24, 0xB0 ; 176 19416: 97 e4 ldi r25, 0x47 ; 71 19418: 0e 94 a7 6c call 0xd94e ; 0xd94e 1941c: 0f 94 22 0b call 0x21644 ; 0x21644 lcd_puts_at_P(0,3,_n("1/4")); 19420: 46 eb ldi r20, 0xB6 ; 182 19422: 59 e6 ldi r21, 0x69 ; 105 19424: 28 cd rjmp .-1456 ; 0x18e76 } } } else { lcd_show_fullscreen_message_and_wait_P(PSTR("Calibration failed! Check the axes and run again.")); 19426: 8d e7 ldi r24, 0x7D ; 125 19428: 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); 1942a: 0f 94 a9 0b call 0x21752 ; 0x21752 1942e: 0b cd rjmp .-1514 ; 0x18e46 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); 19430: c7 55 subi r28, 0x57 ; 87 19432: df 4f sbci r29, 0xFF ; 255 19434: 88 81 ld r24, Y 19436: 99 81 ldd r25, Y+1 ; 0x01 19438: c9 5a subi r28, 0xA9 ; 169 1943a: d0 40 sbci r29, 0x00 ; 0 1943c: 0e 94 ca 5f call 0xbf94 ; 0xbf94 // Z only calibration. // Load the machine correction matrix world2machine_initialize(); 19440: 0f 94 80 90 call 0x32100 ; 0x32100 // and correct the current_position to match the transformed coordinate system. world2machine_update_current(); 19444: 0f 94 1e 8e call 0x31c3c ; 0x31c3c //FIXME bool result = sample_mesh_and_store_reference(); 19448: 0f 94 37 8c call 0x3186e ; 0x3186e 1944c: e5 96 adiw r28, 0x35 ; 53 1944e: 8f af std Y+63, r24 ; 0x3f 19450: e5 97 sbiw r28, 0x35 ; 53 if (result) 19452: 88 23 and r24, r24 19454: 09 f4 brne .+2 ; 0x19458 19456: f7 cc rjmp .-1554 ; 0x18e46 { calibration_status_set(CALIBRATION_STATUS_Z); 19458: 84 e0 ldi r24, 0x04 ; 4 1945a: 0e 94 83 c6 call 0x18d06 ; 0x18d06 } else { // Timeouted. } lcd_update_enable(true); 1945e: 81 e0 ldi r24, 0x01 ; 1 19460: 0e 94 b6 69 call 0xd36c ; 0xd36c #endif // TMC2130 FORCE_BL_ON_END; return final_result; } 19464: e5 96 adiw r28, 0x35 ; 53 19466: 8f ad ldd r24, Y+63 ; 0x3f 19468: e5 97 sbiw r28, 0x35 ; 53 1946a: c2 53 subi r28, 0x32 ; 50 1946c: df 4f sbci r29, 0xFF ; 255 1946e: 0f b6 in r0, 0x3f ; 63 19470: f8 94 cli 19472: de bf out 0x3e, r29 ; 62 19474: 0f be out 0x3f, r0 ; 63 19476: cd bf out 0x3d, r28 ; 61 19478: df 91 pop r29 1947a: cf 91 pop r28 1947c: 1f 91 pop r17 1947e: 0f 91 pop r16 19480: ff 90 pop r15 19482: ef 90 pop r14 19484: df 90 pop r13 19486: cf 90 pop r12 19488: bf 90 pop r11 1948a: af 90 pop r10 1948c: 9f 90 pop r9 1948e: 8f 90 pop r8 19490: 7f 90 pop r7 19492: 6f 90 pop r6 19494: 5f 90 pop r5 19496: 4f 90 pop r4 19498: 3f 90 pop r3 1949a: 2f 90 pop r2 1949c: 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) { 1949e: e1 e0 ldi r30, 0x01 ; 1 194a0: e1 96 adiw r28, 0x31 ; 49 194a2: ef af std Y+63, r30 ; 0x3f 194a4: e1 97 sbiw r28, 0x31 ; 49 194a6: 7c cd rjmp .-1288 ; 0x18fa0 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) 194a8: fe 01 movw r30, r28 194aa: 31 96 adiw r30, 0x01 ; 1 194ac: 7f 01 movw r14, r30 194ae: 10 e0 ldi r17, 0x00 ; 0 194b0: 00 e0 ldi r16, 0x00 ; 0 194b2: 24 e8 ldi r18, 0x84 ; 132 194b4: 33 e0 ldi r19, 0x03 ; 3 194b6: a6 01 movw r20, r12 194b8: 69 2d mov r22, r9 194ba: 78 2d mov r23, r8 194bc: 8b 2d mov r24, r11 194be: 9a 2d mov r25, r10 194c0: 0f 94 8b 5f call 0x2bf16 ; 0x2bf16 ad += 0; if (!ret && (ad < 1440)) 194c4: 88 23 and r24, r24 194c6: 09 f4 brne .+2 ; 0x194ca 194c8: 73 ce rjmp .-794 ; 0x191b0 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; 194ca: 89 81 ldd r24, Y+1 ; 0x01 194cc: 9a 81 ldd r25, Y+2 ; 0x02 194ce: 90 ce rjmp .-736 ; 0x191f0 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)) 194d0: 89 81 ldd r24, Y+1 ; 0x01 194d2: 9a 81 ldd r25, Y+2 ; 0x02 194d4: 80 34 cpi r24, 0x40 ; 64 194d6: 9b 40 sbci r25, 0x0B ; 11 194d8: b8 f4 brcc .+46 ; 0x19508 if ((ret = xyzcal_spiral2(cx, cy, z0 - 3*dz, dz, -radius, 180, delay_us, check_pinda, &ad)) != 0) 194da: ce 01 movw r24, r28 194dc: 01 96 adiw r24, 0x01 ; 1 194de: 7c 01 movw r14, r24 194e0: 04 eb ldi r16, 0xB4 ; 180 194e2: 10 e0 ldi r17, 0x00 ; 0 194e4: 2c e7 ldi r18, 0x7C ; 124 194e6: 3c ef ldi r19, 0xFC ; 252 194e8: a6 01 movw r20, r12 194ea: 4c 52 subi r20, 0x2C ; 44 194ec: 51 40 sbci r21, 0x01 ; 1 194ee: 69 2d mov r22, r9 194f0: 78 2d mov r23, r8 194f2: 8b 2d mov r24, r11 194f4: 9a 2d mov r25, r10 194f6: 0f 94 8b 5f call 0x2bf16 ; 0x2bf16 194fa: 88 23 and r24, r24 194fc: 29 f0 breq .+10 ; 0x19508 ad += 2160; 194fe: 89 81 ldd r24, Y+1 ; 0x01 19500: 9a 81 ldd r25, Y+2 ; 0x02 19502: 80 59 subi r24, 0x90 ; 144 19504: 97 4f sbci r25, 0xF7 ; 247 19506: 74 ce rjmp .-792 ; 0x191f0 /// 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; 19508: 90 e9 ldi r25, 0x90 ; 144 1950a: c9 1a sub r12, r25 1950c: 91 e0 ldi r25, 0x01 ; 1 1950e: d9 0a sbc r13, r25 19510: 27 ce rjmp .-946 ; 0x19160 } //@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]); 19512: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 19516: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 1951a: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 1951e: 30 91 c1 06 lds r19, 0x06C1 ; 0x8006c1 19522: 40 91 ba 06 lds r20, 0x06BA ; 0x8006ba 19526: 50 91 bb 06 lds r21, 0x06BB ; 0x8006bb 1952a: 60 91 bc 06 lds r22, 0x06BC ; 0x8006bc 1952e: 70 91 bd 06 lds r23, 0x06BD ; 0x8006bd 19532: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 19536: 90 91 b7 06 lds r25, 0x06B7 ; 0x8006b7 1953a: a0 91 b8 06 lds r26, 0x06B8 ; 0x8006b8 1953e: b0 91 b9 06 lds r27, 0x06B9 ; 0x8006b9 19542: 3f 93 push r19 19544: 2f 93 push r18 19546: 1f 93 push r17 19548: 0f 93 push r16 1954a: 7f 93 push r23 1954c: 6f 93 push r22 1954e: 5f 93 push r21 19550: 4f 93 push r20 19552: bf 93 push r27 19554: af 93 push r26 19556: 9f 93 push r25 19558: 8f 93 push r24 1955a: 8f e1 ldi r24, 0x1F ; 31 1955c: 97 e8 ldi r25, 0x87 ; 135 1955e: 9f 93 push r25 19560: 8f 93 push r24 19562: 0f 94 5d 9f call 0x33eba ; 0x33eba 19566: 0f b6 in r0, 0x3f ; 63 19568: f8 94 cli 1956a: de bf out 0x3e, r29 ; 62 1956c: 0f be out 0x3f, r0 ; 63 1956e: 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; 19570: 1f ef ldi r17, 0xFF ; 255 sm4_calc_delay_cb = xyzcal_calc_delay; } void xyzcal_measure_leave(void) { DBG(_n("xyzcal_measure_leave\n")); 19572: 8f ef ldi r24, 0xFF ; 255 19574: 97 e8 ldi r25, 0x87 ; 135 19576: 9f 93 push r25 19578: 8f 93 push r24 1957a: 0f 94 5d 9f call 0x33eba ; 0x33eba lcd_set_cursor(4,3); 1957e: 63 e0 ldi r22, 0x03 ; 3 19580: 84 e0 ldi r24, 0x04 ; 4 19582: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_space(16); 19586: 80 e1 ldi r24, 0x10 ; 16 19588: 0e 94 67 69 call 0xd2ce ; 0xd2ce // resync planner position from counters (changed by xyzcal_update_pos) planner_reset_position(); 1958c: 0f 94 62 85 call 0x30ac4 ; 0x30ac4 : "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" ); 19590: 88 e1 ldi r24, 0x18 ; 24 19592: 98 e2 ldi r25, 0x28 ; 40 19594: 0f b6 in r0, 0x3f ; 63 19596: f8 94 cli 19598: a8 95 wdr 1959a: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1959e: 0f be out 0x3f, r0 ; 63 195a0: 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); 195a4: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 195a8: 80 64 ori r24, 0x40 ; 64 195aa: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #endif //EMERGENCY_HANDLERS #endif //WATCHDOG ENABLE_STEPPER_DRIVER_INTERRUPT(); 195ae: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 195b2: 82 60 ori r24, 0x02 ; 2 195b4: 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){ 195b8: 0f 90 pop r0 195ba: 0f 90 pop r0 195bc: 1d 3f cpi r17, 0xFD ; 253 195be: 09 f4 brne .+2 ; 0x195c2 195c0: 64 c3 rjmp .+1736 ; 0x19c8a 195c2: 1f 3f cpi r17, 0xFF ; 255 195c4: 11 f4 brne .+4 ; 0x195ca 195c6: 0c 94 90 d7 jmp 0x1af20 ; 0x1af20 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); 195ca: 20 e0 ldi r18, 0x00 ; 0 195cc: 30 e0 ldi r19, 0x00 ; 0 195ce: a9 01 movw r20, r18 195d0: a0 96 adiw r28, 0x20 ; 32 195d2: ee ad ldd r30, Y+62 ; 0x3e 195d4: ff ad ldd r31, Y+63 ; 0x3f 195d6: a0 97 sbiw r28, 0x20 ; 32 195d8: 61 81 ldd r22, Z+1 ; 0x01 195da: 72 81 ldd r23, Z+2 ; 0x02 195dc: 83 81 ldd r24, Z+3 ; 0x03 195de: 94 81 ldd r25, Z+4 ; 0x04 195e0: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> pt[0] += (current_position[X_AXIS]/(iteration + 1)); //count average 195e4: 20 91 f5 11 lds r18, 0x11F5 ; 0x8011f5 195e8: 30 91 f6 11 lds r19, 0x11F6 ; 0x8011f6 195ec: 40 91 f7 11 lds r20, 0x11F7 ; 0x8011f7 195f0: 50 91 f8 11 lds r21, 0x11F8 ; 0x8011f8 195f4: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 195f8: a0 96 adiw r28, 0x20 ; 32 195fa: ae ad ldd r26, Y+62 ; 0x3e 195fc: bf ad ldd r27, Y+63 ; 0x3f 195fe: a0 97 sbiw r28, 0x20 ; 32 19600: 11 96 adiw r26, 0x01 ; 1 19602: 6d 93 st X+, r22 19604: 7d 93 st X+, r23 19606: 8d 93 st X+, r24 19608: 9c 93 st X, r25 1960a: 14 97 sbiw r26, 0x04 ; 4 pt[1] = (pt[1] * iteration) / (iteration + 1); pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 1960c: c0 90 f9 11 lds r12, 0x11F9 ; 0x8011f9 19610: d0 90 fa 11 lds r13, 0x11FA ; 0x8011fa 19614: e0 90 fb 11 lds r14, 0x11FB ; 0x8011fb 19618: 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); 1961c: 20 e0 ldi r18, 0x00 ; 0 1961e: 30 e0 ldi r19, 0x00 ; 0 19620: a9 01 movw r20, r18 19622: 15 96 adiw r26, 0x05 ; 5 19624: 6d 91 ld r22, X+ 19626: 7d 91 ld r23, X+ 19628: 8d 91 ld r24, X+ 1962a: 9c 91 ld r25, X 1962c: 18 97 sbiw r26, 0x08 ; 8 1962e: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 19632: a7 01 movw r20, r14 19634: 96 01 movw r18, r12 19636: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1963a: a0 96 adiw r28, 0x20 ; 32 1963c: ee ad ldd r30, Y+62 ; 0x3e 1963e: ff ad ldd r31, Y+63 ; 0x3f 19640: a0 97 sbiw r28, 0x20 ; 32 19642: 65 83 std Z+5, r22 ; 0x05 19644: 76 83 std Z+6, r23 ; 0x06 19646: 87 83 std Z+7, r24 ; 0x07 19648: 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) 1964a: 20 e0 ldi r18, 0x00 ; 0 1964c: 30 e0 ldi r19, 0x00 ; 0 1964e: 40 e8 ldi r20, 0x80 ; 128 19650: 50 ec ldi r21, 0xC0 ; 192 19652: c7 01 movw r24, r14 19654: b6 01 movw r22, r12 19656: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1965a: 87 ff sbrs r24, 7 1965c: 0c c0 rjmp .+24 ; 0x19676 current_position[Y_AXIS] = Y_MIN_POS; 1965e: 80 e0 ldi r24, 0x00 ; 0 19660: 90 e0 ldi r25, 0x00 ; 0 19662: a0 e8 ldi r26, 0x80 ; 128 19664: b0 ec ldi r27, 0xC0 ; 192 19666: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 1966a: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 1966e: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 19672: 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; 19676: 20 e0 ldi r18, 0x00 ; 0 19678: 30 e0 ldi r19, 0x00 ; 0 1967a: 40 e4 ldi r20, 0x40 ; 64 1967c: 50 e4 ldi r21, 0x40 ; 64 1967e: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 19682: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 19686: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 1968a: 90 91 00 12 lds r25, 0x1200 ; 0x801200 1968e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 19692: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 19696: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 1969a: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 1969e: 90 93 00 12 sts 0x1200, r25 ; 0x801200 196a2: e0 96 adiw r28, 0x30 ; 48 196a4: 2e ad ldd r18, Y+62 ; 0x3e 196a6: 3f ad ldd r19, Y+63 ; 0x3f 196a8: e0 97 sbiw r28, 0x30 ; 48 196aa: 28 5f subi r18, 0xF8 ; 248 196ac: 3f 4f sbci r19, 0xFF ; 255 196ae: e0 96 adiw r28, 0x30 ; 48 196b0: 3f af std Y+63, r19 ; 0x3f 196b2: 2e af std Y+62, r18 ; 0x3e 196b4: e0 97 sbiw r28, 0x30 ; 48 196b6: a0 96 adiw r28, 0x20 ; 32 196b8: 4e ad ldd r20, Y+62 ; 0x3e 196ba: 5f ad ldd r21, Y+63 ; 0x3f 196bc: a0 97 sbiw r28, 0x20 ; 32 196be: 48 5f subi r20, 0xF8 ; 248 196c0: 5f 4f sbci r21, 0xFF ; 255 196c2: a0 96 adiw r28, 0x20 ; 32 196c4: 5f af std Y+63, r21 ; 0x3f 196c6: 4e af std Y+62, r20 ; 0x3e 196c8: 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) { 196ca: 54 e0 ldi r21, 0x04 ; 4 196cc: 25 16 cp r2, r21 196ce: 31 04 cpc r3, r1 196d0: 09 f0 breq .+2 ; 0x196d4 196d2: 83 cc rjmp .-1786 ; 0x18fda go_to_current(homing_feedrate[X_AXIS] / 60.f); delay_keep_alive(3000); } #endif // SUPPORT_VERBOSITY } if (!retry) 196d4: a7 96 adiw r28, 0x27 ; 39 196d6: 6f ad ldd r22, Y+63 ; 0x3f 196d8: a7 97 sbiw r28, 0x27 ; 39 196da: 66 23 and r22, r22 196dc: 31 f0 breq .+12 ; 0x196ea 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) { 196de: e1 96 adiw r28, 0x31 ; 49 196e0: 8f ad ldd r24, Y+63 ; 0x3f 196e2: e1 97 sbiw r28, 0x31 ; 49 196e4: 81 30 cpi r24, 0x01 ; 1 196e6: 09 f0 breq .+2 ; 0x196ea 196e8: da ce rjmp .-588 ; 0x1949e #endif // SUPPORT_VERBOSITY } if (!retry) break; } DBG(_n("All 4 calibration points found.\n")); 196ea: 81 e9 ldi r24, 0x91 ; 145 196ec: 99 e6 ldi r25, 0x69 ; 105 196ee: 9f 93 push r25 196f0: 8f 93 push r24 196f2: 0f 94 5d 9f call 0x33eba ; 0x33eba delay_keep_alive(0); //manage_heater, reset watchdog, manage inactivity 196f6: 90 e0 ldi r25, 0x00 ; 0 196f8: 80 e0 ldi r24, 0x00 ; 0 196fa: 0e 94 45 7c call 0xf88a ; 0xf88a 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) { 196fe: 0f 90 pop r0 19700: 0f 90 pop r0 19702: 20 e0 ldi r18, 0x00 ; 0 19704: 30 e0 ldi r19, 0x00 ; 0 19706: 40 e9 ldi r20, 0x90 ; 144 19708: 50 ec ldi r21, 0xC0 ; 192 1970a: 60 91 a1 12 lds r22, 0x12A1 ; 0x8012a1 1970e: 70 91 a2 12 lds r23, 0x12A2 ; 0x8012a2 19712: 80 91 a3 12 lds r24, 0x12A3 ; 0x8012a3 19716: 90 91 a4 12 lds r25, 0x12A4 ; 0x8012a4 1971a: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1971e: 87 ff sbrs r24, 7 19720: bb c2 rjmp .+1398 ; 0x19c98 too_far_mask |= 1 << 1; //front center point is out of reach SERIAL_ECHOLNPGM(""); 19722: 8b e4 ldi r24, 0x4B ; 75 19724: 98 e8 ldi r25, 0x88 ; 136 19726: 0e 94 49 72 call 0xe492 ; 0xe492 SERIAL_ECHOPGM("WARNING: Front point not reachable. Y coordinate:"); 1972a: 89 e1 ldi r24, 0x19 ; 25 1972c: 98 e8 ldi r25, 0x88 ; 136 1972e: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 19732: 60 91 a1 12 lds r22, 0x12A1 ; 0x8012a1 19736: 70 91 a2 12 lds r23, 0x12A2 ; 0x8012a2 1973a: 80 91 a3 12 lds r24, 0x12A3 ; 0x8012a3 1973e: 90 91 a4 12 lds r25, 0x12A4 ; 0x8012a4 19742: 42 e0 ldi r20, 0x02 ; 2 19744: 0f 94 08 98 call 0x33010 ; 0x33010 MYSERIAL.print(pts[1]); SERIAL_ECHOPGM(" < "); 19748: 85 e1 ldi r24, 0x15 ; 21 1974a: 98 e8 ldi r25, 0x88 ; 136 1974c: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 MYSERIAL.println(Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 19750: 60 e0 ldi r22, 0x00 ; 0 19752: 70 e0 ldi r23, 0x00 ; 0 19754: 80 e9 ldi r24, 0x90 ; 144 19756: 90 ec ldi r25, 0xC0 ; 192 19758: 0f 94 45 42 call 0x2848a ; 0x2848a 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 1975c: 92 e0 ldi r25, 0x02 ; 2 1975e: af 96 adiw r28, 0x2f ; 47 19760: 9f af std Y+63, r25 ; 0x3f 19762: 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; 19764: 10 92 cd 12 sts 0x12CD, r1 ; 0x8012cd 19768: 10 92 ce 12 sts 0x12CE, r1 ; 0x8012ce 1976c: 10 92 cf 12 sts 0x12CF, r1 ; 0x8012cf 19770: 10 92 d0 12 sts 0x12D0, r1 ; 0x8012d0 cntr[1] = 0.f; 19774: 10 92 d1 12 sts 0x12D1, r1 ; 0x8012d1 19778: 10 92 d2 12 sts 0x12D2, r1 ; 0x8012d2 1977c: 10 92 d3 12 sts 0x12D3, r1 ; 0x8012d3 19780: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 19784: a4 e6 ldi r26, 0x64 ; 100 19786: e6 96 adiw r28, 0x36 ; 54 19788: af af std Y+63, r26 ; 0x3f 1978a: 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; 1978c: a2 96 adiw r28, 0x22 ; 34 1978e: 1c ae std Y+60, r1 ; 0x3c 19790: 1d ae std Y+61, r1 ; 0x3d 19792: 1e ae std Y+62, r1 ; 0x3e 19794: 1f ae std Y+63, r1 ; 0x3f 19796: 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; 19798: a6 96 adiw r28, 0x26 ; 38 1979a: 1c ae std Y+60, r1 ; 0x3c 1979c: 1d ae std Y+61, r1 ; 0x3d 1979e: 1e ae std Y+62, r1 ; 0x3e 197a0: 1f ae std Y+63, r1 ; 0x3f 197a2: 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 }; 197a4: fe 01 movw r30, r28 197a6: 31 96 adiw r30, 0x01 ; 1 197a8: 68 96 adiw r28, 0x18 ; 24 197aa: ff af std Y+63, r31 ; 0x3f 197ac: ee af std Y+62, r30 ; 0x3e 197ae: 68 97 sbiw r28, 0x18 ; 24 float b[4] = { 0.f }; 197b0: 9e 01 movw r18, r28 197b2: 2f 5b subi r18, 0xBF ; 191 197b4: 3f 4f sbci r19, 0xFF ; 255 197b6: 6a 96 adiw r28, 0x1a ; 26 197b8: 3f af std Y+63, r19 ; 0x3f 197ba: 2e af std Y+62, r18 ; 0x3e 197bc: 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; 197be: a6 96 adiw r28, 0x26 ; 38 197c0: 6c ad ldd r22, Y+60 ; 0x3c 197c2: 7d ad ldd r23, Y+61 ; 0x3d 197c4: 8e ad ldd r24, Y+62 ; 0x3e 197c6: 9f ad ldd r25, Y+63 ; 0x3f 197c8: a6 97 sbiw r28, 0x26 ; 38 197ca: 0f 94 bd a2 call 0x3457a ; 0x3457a 197ce: 6e 96 adiw r28, 0x1e ; 30 197d0: 6c af std Y+60, r22 ; 0x3c 197d2: 7d af std Y+61, r23 ; 0x3d 197d4: 8e af std Y+62, r24 ; 0x3e 197d6: 9f af std Y+63, r25 ; 0x3f 197d8: 6e 97 sbiw r28, 0x1e ; 30 float s1 = sin(a1) * MACHINE_AXIS_SCALE_X; 197da: a6 96 adiw r28, 0x26 ; 38 197dc: 6c ad ldd r22, Y+60 ; 0x3c 197de: 7d ad ldd r23, Y+61 ; 0x3d 197e0: 8e ad ldd r24, Y+62 ; 0x3e 197e2: 9f ad ldd r25, Y+63 ; 0x3f 197e4: a6 97 sbiw r28, 0x26 ; 38 197e6: 0f 94 83 a5 call 0x34b06 ; 0x34b06 197ea: cb 57 subi r28, 0x7B ; 123 197ec: df 4f sbci r29, 0xFF ; 255 197ee: 68 83 st Y, r22 197f0: 79 83 std Y+1, r23 ; 0x01 197f2: 8a 83 std Y+2, r24 ; 0x02 197f4: 9b 83 std Y+3, r25 ; 0x03 197f6: c5 58 subi r28, 0x85 ; 133 197f8: d0 40 sbci r29, 0x00 ; 0 float c2 = cos(a2) * MACHINE_AXIS_SCALE_Y; 197fa: a2 96 adiw r28, 0x22 ; 34 197fc: 6c ad ldd r22, Y+60 ; 0x3c 197fe: 7d ad ldd r23, Y+61 ; 0x3d 19800: 8e ad ldd r24, Y+62 ; 0x3e 19802: 9f ad ldd r25, Y+63 ; 0x3f 19804: a2 97 sbiw r28, 0x22 ; 34 19806: 0f 94 bd a2 call 0x3457a ; 0x3457a 1980a: c7 57 subi r28, 0x77 ; 119 1980c: df 4f sbci r29, 0xFF ; 255 1980e: 68 83 st Y, r22 19810: 79 83 std Y+1, r23 ; 0x01 19812: 8a 83 std Y+2, r24 ; 0x02 19814: 9b 83 std Y+3, r25 ; 0x03 19816: c9 58 subi r28, 0x89 ; 137 19818: d0 40 sbci r29, 0x00 ; 0 float s2 = sin(a2) * MACHINE_AXIS_SCALE_Y; 1981a: a2 96 adiw r28, 0x22 ; 34 1981c: 6c ad ldd r22, Y+60 ; 0x3c 1981e: 7d ad ldd r23, Y+61 ; 0x3d 19820: 8e ad ldd r24, Y+62 ; 0x3e 19822: 9f ad ldd r25, Y+63 ; 0x3f 19824: a2 97 sbiw r28, 0x22 ; 34 19826: 0f 94 83 a5 call 0x34b06 ; 0x34b06 1982a: cb 56 subi r28, 0x6B ; 107 1982c: df 4f sbci r29, 0xFF ; 255 1982e: 68 83 st Y, r22 19830: 79 83 std Y+1, r23 ; 0x01 19832: 8a 83 std Y+2, r24 ; 0x02 19834: 9b 83 std Y+3, r25 ; 0x03 19836: c5 59 subi r28, 0x95 ; 149 19838: d0 40 sbci r29, 0x00 ; 0 // Prepare the Normal equation for the Gauss-Newton method. float A[4][4] = { 0.f }; 1983a: 68 96 adiw r28, 0x18 ; 24 1983c: ae ad ldd r26, Y+62 ; 0x3e 1983e: bf ad ldd r27, Y+63 ; 0x3f 19840: 68 97 sbiw r28, 0x18 ; 24 19842: e0 e4 ldi r30, 0x40 ; 64 19844: 1d 92 st X+, r1 19846: ea 95 dec r30 19848: e9 f7 brne .-6 ; 0x19844 float b[4] = { 0.f }; 1984a: 80 e1 ldi r24, 0x10 ; 16 1984c: 6a 96 adiw r28, 0x1a ; 26 1984e: ae ad ldd r26, Y+62 ; 0x3e 19850: bf ad ldd r27, Y+63 ; 0x3f 19852: 6a 97 sbiw r28, 0x1a ; 26 19854: 1d 92 st X+, r1 19856: 8a 95 dec r24 19858: e9 f7 brne .-6 ; 0x19854 float acc; delay_keep_alive(0); //manage heater, reset watchdog, manage inactivity 1985a: 90 e0 ldi r25, 0x00 ; 0 1985c: 80 e0 ldi r24, 0x00 ; 0 1985e: 0e 94 45 7c call 0xf88a ; 0xf88a 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); 19862: 20 91 cd 12 lds r18, 0x12CD ; 0x8012cd 19866: 30 91 ce 12 lds r19, 0x12CE ; 0x8012ce 1986a: 40 91 cf 12 lds r20, 0x12CF ; 0x8012cf 1986e: 50 91 d0 12 lds r21, 0x12D0 ; 0x8012d0 19872: c5 55 subi r28, 0x55 ; 85 19874: df 4f sbci r29, 0xFF ; 255 19876: 28 83 st Y, r18 19878: 39 83 std Y+1, r19 ; 0x01 1987a: 4a 83 std Y+2, r20 ; 0x02 1987c: 5b 83 std Y+3, r21 ; 0x03 1987e: cb 5a subi r28, 0xAB ; 171 19880: 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); 19882: 80 91 d1 12 lds r24, 0x12D1 ; 0x8012d1 19886: 90 91 d2 12 lds r25, 0x12D2 ; 0x8012d2 1988a: a0 91 d3 12 lds r26, 0x12D3 ; 0x8012d3 1988e: b0 91 d4 12 lds r27, 0x12D4 ; 0x8012d4 19892: c1 55 subi r28, 0x51 ; 81 19894: df 4f sbci r29, 0xFF ; 255 19896: 88 83 st Y, r24 19898: 99 83 std Y+1, r25 ; 0x01 1989a: aa 83 std Y+2, r26 ; 0x02 1989c: bb 83 std Y+3, r27 ; 0x03 1989e: cf 5a subi r28, 0xAF ; 175 198a0: d0 40 sbci r29, 0x00 ; 0 198a2: de 01 movw r26, r28 198a4: af 5b subi r26, 0xBF ; 191 198a6: bf 4f sbci r27, 0xFF ; 255 198a8: c7 56 subi r28, 0x67 ; 103 198aa: df 4f sbci r29, 0xFF ; 255 198ac: b9 83 std Y+1, r27 ; 0x01 198ae: a8 83 st Y, r26 198b0: c9 59 subi r28, 0x99 ; 153 198b2: d0 40 sbci r29, 0x00 ; 0 198b4: fe 01 movw r30, r28 198b6: 31 96 adiw r30, 0x01 ; 1 198b8: ac 96 adiw r28, 0x2c ; 44 198ba: ff af std Y+63, r31 ; 0x3f 198bc: ee af std Y+62, r30 ; 0x3e 198be: 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) { 198c0: 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])); 198c2: cb 56 subi r28, 0x6B ; 107 198c4: df 4f sbci r29, 0xFF ; 255 198c6: 28 81 ld r18, Y 198c8: 39 81 ldd r19, Y+1 ; 0x01 198ca: 4a 81 ldd r20, Y+2 ; 0x02 198cc: 5b 81 ldd r21, Y+3 ; 0x03 198ce: c5 59 subi r28, 0x95 ; 149 198d0: d0 40 sbci r29, 0x00 ; 0 198d2: 50 58 subi r21, 0x80 ; 128 198d4: ed 96 adiw r28, 0x3d ; 61 198d6: 2c af std Y+60, r18 ; 0x3c 198d8: 3d af std Y+61, r19 ; 0x3d 198da: 4e af std Y+62, r20 ; 0x3e 198dc: 5f af std Y+63, r21 ; 0x3f 198de: 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])); 198e0: c7 57 subi r28, 0x77 ; 119 198e2: df 4f sbci r29, 0xFF ; 255 198e4: 88 81 ld r24, Y 198e6: 99 81 ldd r25, Y+1 ; 0x01 198e8: aa 81 ldd r26, Y+2 ; 0x02 198ea: bb 81 ldd r27, Y+3 ; 0x03 198ec: c9 58 subi r28, 0x89 ; 137 198ee: d0 40 sbci r29, 0x00 ; 0 198f0: b0 58 subi r27, 0x80 ; 128 198f2: c3 58 subi r28, 0x83 ; 131 198f4: df 4f sbci r29, 0xFF ; 255 198f6: 88 83 st Y, r24 198f8: 99 83 std Y+1, r25 ; 0x01 198fa: aa 83 std Y+2, r26 ; 0x02 198fc: bb 83 std Y+3, r27 ; 0x03 198fe: cd 57 subi r28, 0x7D ; 125 19900: 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]) : 19902: cb 57 subi r28, 0x7B ; 123 19904: df 4f sbci r29, 0xFF ; 255 19906: 28 81 ld r18, Y 19908: 39 81 ldd r19, Y+1 ; 0x01 1990a: 4a 81 ldd r20, Y+2 ; 0x02 1990c: 5b 81 ldd r21, Y+3 ; 0x03 1990e: c5 58 subi r28, 0x85 ; 133 19910: d0 40 sbci r29, 0x00 ; 0 19912: 50 58 subi r21, 0x80 ; 128 19914: cf 57 subi r28, 0x7F ; 127 19916: df 4f sbci r29, 0xFF ; 255 19918: 28 83 st Y, r18 1991a: 39 83 std Y+1, r19 ; 0x01 1991c: 4a 83 std Y+2, r20 ; 0x02 1991e: 5b 83 std Y+3, r21 ; 0x03 19920: c1 58 subi r28, 0x81 ; 129 19922: 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) { 19924: ac 96 adiw r28, 0x2c ; 44 19926: 2e ac ldd r2, Y+62 ; 0x3e 19928: 3f ac ldd r3, Y+63 ; 0x3f 1992a: ac 97 sbiw r28, 0x2c ; 44 for (uint8_t c = 0; c < 4; ++c) { 1992c: 10 e0 ldi r17, 0x00 ; 0 1992e: 6c e9 ldi r22, 0x9C ; 156 19930: 46 2e mov r4, r22 19932: 62 e1 ldi r22, 0x12 ; 18 19934: 56 2e mov r5, r22 19936: 74 e0 ldi r23, 0x04 ; 4 19938: 77 2e mov r7, r23 acc = 0; 1993a: c1 2c mov r12, r1 1993c: d1 2c mov r13, r1 1993e: 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) { 19940: 01 30 cpi r16, 0x01 ; 1 19942: 11 f4 brne .+4 ; 0x19948 19944: 0c 94 48 d8 jmp 0x1b090 ; 0x1b090 19948: 11 30 cpi r17, 0x01 ; 1 1994a: 11 f4 brne .+4 ; 0x19950 1994c: 0c 94 f6 d7 jmp 0x1afec ; 0x1afec float a = (r == 0) ? 1.f : 19950: 00 23 and r16, r16 19952: 11 f4 brne .+4 ; 0x19958 19954: 0c 94 36 d8 jmp 0x1b06c ; 0x1b06c ((r == 2) ? (-s1 * measured_pts[2 * i]) : 19958: 02 30 cpi r16, 0x02 ; 2 1995a: 09 f0 breq .+2 ; 0x1995e 1995c: a1 c1 rjmp .+834 ; 0x19ca0 1995e: d2 01 movw r26, r4 19960: 11 96 adiw r26, 0x01 ; 1 19962: 2d 91 ld r18, X+ 19964: 3d 91 ld r19, X+ 19966: 4d 91 ld r20, X+ 19968: 5c 91 ld r21, X 1996a: 14 97 sbiw r26, 0x04 ; 4 1996c: cf 57 subi r28, 0x7F ; 127 1996e: df 4f sbci r29, 0xFF ; 255 19970: 68 81 ld r22, Y 19972: 79 81 ldd r23, Y+1 ; 0x01 19974: 8a 81 ldd r24, Y+2 ; 0x02 19976: 9b 81 ldd r25, Y+3 ; 0x03 19978: c1 58 subi r28, 0x81 ; 129 1997a: d0 40 sbci r29, 0x00 ; 0 1997c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 19980: 4b 01 movw r8, r22 19982: 5c 01 movw r10, r24 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 19984: 11 11 cpse r17, r1 19986: 9a c1 rjmp .+820 ; 0x19cbc 19988: 60 e0 ldi r22, 0x00 ; 0 1998a: 70 e0 ldi r23, 0x00 ; 0 1998c: 80 e8 ldi r24, 0x80 ; 128 1998e: 9f e3 ldi r25, 0x3F ; 63 19990: aa c1 rjmp .+852 ; 0x19ce6 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { ++mins; } else if (matrix32[i] == 0xFF){ 19992: 2f 3f cpi r18, 0xFF ; 255 19994: 09 f0 breq .+2 ; 0x19998 19996: fe cc rjmp .-1540 ; 0x19394 ++maxs; 19998: 01 96 adiw r24, 0x01 ; 1 1999a: fc cc rjmp .-1544 ; 0x19394 1999c: ae 01 movw r20, r28 1999e: 4f 5f subi r20, 0xFF ; 255 199a0: 5f 4f sbci r21, 0xFF ; 255 199a2: be 01 movw r22, r28 199a4: 6f 5b subi r22, 0xBF ; 191 199a6: 7f 4f sbci r23, 0xFF ; 255 199a8: 80 ee ldi r24, 0xE0 ; 224 199aa: 9a e0 ldi r25, 0x0A ; 10 199ac: 0f 94 36 5b call 0x2b66c ; 0x2b66c 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; 199b0: 66 96 adiw r28, 0x16 ; 22 199b2: 6f ad ldd r22, Y+63 ; 0x3f 199b4: 66 97 sbiw r28, 0x16 ; 22 row = r08; 199b6: 62 96 adiw r28, 0x12 ; 18 199b8: 1f ad ldd r17, Y+63 ; 0x3f 199ba: 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){ 199bc: 80 17 cp r24, r16 199be: 28 f0 brcs .+10 ; 0x199ca col = c08; row = r08; return match08; } col = c10; 199c0: 22 96 adiw r28, 0x02 ; 2 199c2: 6f ad ldd r22, Y+63 ; 0x3f 199c4: 22 97 sbiw r28, 0x02 ; 2 row = r10; 199c6: 19 81 ldd r17, Y+1 ; 0x01 199c8: 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){ 199ca: 08 35 cpi r16, 0x58 ; 88 199cc: 08 f4 brcc .+2 ; 0x199d0 199ce: 5b c1 rjmp .+694 ; 0x19c86 /// find precise circle /// move to the center of the pattern (+5.5) float xf = uc + 5.5f; 199d0: 70 e0 ldi r23, 0x00 ; 0 199d2: 90 e0 ldi r25, 0x00 ; 0 199d4: 80 e0 ldi r24, 0x00 ; 0 199d6: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 199da: 20 e0 ldi r18, 0x00 ; 0 199dc: 30 e0 ldi r19, 0x00 ; 0 199de: 40 eb ldi r20, 0xB0 ; 176 199e0: 50 e4 ldi r21, 0x40 ; 64 199e2: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 199e6: 2b 01 movw r4, r22 199e8: 3c 01 movw r6, r24 199ea: 65 96 adiw r28, 0x15 ; 21 199ec: 4c ae std Y+60, r4 ; 0x3c 199ee: 5d ae std Y+61, r5 ; 0x3d 199f0: 6e ae std Y+62, r6 ; 0x3e 199f2: 7f ae std Y+63, r7 ; 0x3f 199f4: 65 97 sbiw r28, 0x15 ; 21 float yf = ur + 5.5f; 199f6: 61 2f mov r22, r17 199f8: 70 e0 ldi r23, 0x00 ; 0 199fa: 90 e0 ldi r25, 0x00 ; 0 199fc: 80 e0 ldi r24, 0x00 ; 0 199fe: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 19a02: 20 e0 ldi r18, 0x00 ; 0 19a04: 30 e0 ldi r19, 0x00 ; 0 19a06: 40 eb ldi r20, 0xB0 ; 176 19a08: 50 e4 ldi r21, 0x40 ; 64 19a0a: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 19a0e: 4b 01 movw r8, r22 19a10: 5c 01 movw r10, r24 19a12: 25 96 adiw r28, 0x05 ; 5 19a14: 8c ae std Y+60, r8 ; 0x3c 19a16: 9d ae std Y+61, r9 ; 0x3d 19a18: ae ae std Y+62, r10 ; 0x3e 19a1a: bf ae std Y+63, r11 ; 0x3f 19a1c: 25 97 sbiw r28, 0x05 ; 5 float radius = 4.5f; ///< default radius 19a1e: 20 e0 ldi r18, 0x00 ; 0 19a20: 30 e0 ldi r19, 0x00 ; 0 19a22: 40 e9 ldi r20, 0x90 ; 144 19a24: 50 e4 ldi r21, 0x40 ; 64 19a26: 29 83 std Y+1, r18 ; 0x01 19a28: 3a 83 std Y+2, r19 ; 0x02 19a2a: 4b 83 std Y+3, r20 ; 0x03 19a2c: 5c 83 std Y+4, r21 ; 0x04 constexpr const uint8_t iterations = 20; dynamic_circle(matrix32, xf, yf, radius, iterations); 19a2e: ae 01 movw r20, r28 19a30: 4f 5f subi r20, 0xFF ; 255 19a32: 5f 4f sbci r21, 0xFF ; 255 19a34: be 01 movw r22, r28 19a36: 6f 5b subi r22, 0xBF ; 191 19a38: 7f 4f sbci r23, 0xFF ; 255 19a3a: ce 01 movw r24, r28 19a3c: 8f 5a subi r24, 0xAF ; 175 19a3e: 9f 4f sbci r25, 0xFF ; 255 19a40: 0f 94 eb 57 call 0x2afd6 ; 0x2afd6 if (fabs(xf - (uc + 5.5f)) > 3 || fabs(yf - (ur + 5.5f)) > 3 || fabs(radius - 5) > 3){ 19a44: a3 01 movw r20, r6 19a46: 92 01 movw r18, r4 19a48: 65 96 adiw r28, 0x15 ; 21 19a4a: 6c ad ldd r22, Y+60 ; 0x3c 19a4c: 7d ad ldd r23, Y+61 ; 0x3d 19a4e: 8e ad ldd r24, Y+62 ; 0x3e 19a50: 9f ad ldd r25, Y+63 ; 0x3f 19a52: 65 97 sbiw r28, 0x15 ; 21 19a54: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 19a58: 6b 01 movw r12, r22 19a5a: 7c 01 movw r14, r24 19a5c: 9f 77 andi r25, 0x7F ; 127 19a5e: 20 e0 ldi r18, 0x00 ; 0 19a60: 30 e0 ldi r19, 0x00 ; 0 19a62: 40 e4 ldi r20, 0x40 ; 64 19a64: 50 e4 ldi r21, 0x40 ; 64 19a66: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 19a6a: 18 16 cp r1, r24 19a6c: 34 f1 brlt .+76 ; 0x19aba 19a6e: a5 01 movw r20, r10 19a70: 94 01 movw r18, r8 19a72: 25 96 adiw r28, 0x05 ; 5 19a74: 6c ad ldd r22, Y+60 ; 0x3c 19a76: 7d ad ldd r23, Y+61 ; 0x3d 19a78: 8e ad ldd r24, Y+62 ; 0x3e 19a7a: 9f ad ldd r25, Y+63 ; 0x3f 19a7c: 25 97 sbiw r28, 0x05 ; 5 19a7e: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 19a82: 9f 77 andi r25, 0x7F ; 127 19a84: 20 e0 ldi r18, 0x00 ; 0 19a86: 30 e0 ldi r19, 0x00 ; 0 19a88: 40 e4 ldi r20, 0x40 ; 64 19a8a: 50 e4 ldi r21, 0x40 ; 64 19a8c: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 19a90: 18 16 cp r1, r24 19a92: 9c f0 brlt .+38 ; 0x19aba 19a94: 20 e0 ldi r18, 0x00 ; 0 19a96: 30 e0 ldi r19, 0x00 ; 0 19a98: 40 ea ldi r20, 0xA0 ; 160 19a9a: 50 e4 ldi r21, 0x40 ; 64 19a9c: 69 81 ldd r22, Y+1 ; 0x01 19a9e: 7a 81 ldd r23, Y+2 ; 0x02 19aa0: 8b 81 ldd r24, Y+3 ; 0x03 19aa2: 9c 81 ldd r25, Y+4 ; 0x04 19aa4: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 19aa8: 9f 77 andi r25, 0x7F ; 127 19aaa: 20 e0 ldi r18, 0x00 ; 0 19aac: 30 e0 ldi r19, 0x00 ; 0 19aae: 40 e4 ldi r20, 0x40 ; 64 19ab0: 50 e4 ldi r21, 0x40 ; 64 19ab2: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 19ab6: 18 16 cp r1, r24 19ab8: bc f5 brge .+110 ; 0x19b28 //@size=88 DBG(_n(" [%f %f][%f] mm divergence\n"), xf - (uc + 5.5f), yf - (ur + 5.5f), radius - 5); 19aba: 20 e0 ldi r18, 0x00 ; 0 19abc: 30 e0 ldi r19, 0x00 ; 0 19abe: 40 ea ldi r20, 0xA0 ; 160 19ac0: 50 e4 ldi r21, 0x40 ; 64 19ac2: 69 81 ldd r22, Y+1 ; 0x01 19ac4: 7a 81 ldd r23, Y+2 ; 0x02 19ac6: 8b 81 ldd r24, Y+3 ; 0x03 19ac8: 9c 81 ldd r25, Y+4 ; 0x04 19aca: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 19ace: 9f 93 push r25 19ad0: 8f 93 push r24 19ad2: 7f 93 push r23 19ad4: 6f 93 push r22 19ad6: a5 01 movw r20, r10 19ad8: 94 01 movw r18, r8 19ada: 25 96 adiw r28, 0x05 ; 5 19adc: 6c ad ldd r22, Y+60 ; 0x3c 19ade: 7d ad ldd r23, Y+61 ; 0x3d 19ae0: 8e ad ldd r24, Y+62 ; 0x3e 19ae2: 9f ad ldd r25, Y+63 ; 0x3f 19ae4: 25 97 sbiw r28, 0x05 ; 5 19ae6: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 19aea: 9f 93 push r25 19aec: 8f 93 push r24 19aee: 7f 93 push r23 19af0: 6f 93 push r22 19af2: ff 92 push r15 19af4: ef 92 push r14 19af6: df 92 push r13 19af8: cf 92 push r12 19afa: 83 eb ldi r24, 0xB3 ; 179 19afc: 97 e8 ldi r25, 0x87 ; 135 19afe: 9f 93 push r25 19b00: 8f 93 push r24 19b02: 0f 94 5d 9f call 0x33eba ; 0x33eba /// dynamic algorithm diverged, use original position instead xf = uc + 5.5f; 19b06: 65 96 adiw r28, 0x15 ; 21 19b08: 4c ae std Y+60, r4 ; 0x3c 19b0a: 5d ae std Y+61, r5 ; 0x3d 19b0c: 6e ae std Y+62, r6 ; 0x3e 19b0e: 7f ae std Y+63, r7 ; 0x3f 19b10: 65 97 sbiw r28, 0x15 ; 21 yf = ur + 5.5f; 19b12: 25 96 adiw r28, 0x05 ; 5 19b14: 8c ae std Y+60, r8 ; 0x3c 19b16: 9d ae std Y+61, r9 ; 0x3d 19b18: ae ae std Y+62, r10 ; 0x3e 19b1a: bf ae std Y+63, r11 ; 0x3f 19b1c: 25 97 sbiw r28, 0x05 ; 5 19b1e: 0f b6 in r0, 0x3f ; 63 19b20: f8 94 cli 19b22: de bf out 0x3e, r29 ; 62 19b24: 0f be out 0x3f, r0 ; 63 19b26: cd bf out 0x3d, r28 ; 61 } /// move to the center of area and convert to position xf = (float)x + (xf - 15.5f) * 64; 19b28: 20 e0 ldi r18, 0x00 ; 0 19b2a: 30 e0 ldi r19, 0x00 ; 0 19b2c: 48 e7 ldi r20, 0x78 ; 120 19b2e: 51 e4 ldi r21, 0x41 ; 65 19b30: 65 96 adiw r28, 0x15 ; 21 19b32: 6c ad ldd r22, Y+60 ; 0x3c 19b34: 7d ad ldd r23, Y+61 ; 0x3d 19b36: 8e ad ldd r24, Y+62 ; 0x3e 19b38: 9f ad ldd r25, Y+63 ; 0x3f 19b3a: 65 97 sbiw r28, 0x15 ; 21 19b3c: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 19b40: 20 e0 ldi r18, 0x00 ; 0 19b42: 30 e0 ldi r19, 0x00 ; 0 19b44: 40 e8 ldi r20, 0x80 ; 128 19b46: 52 e4 ldi r21, 0x42 ; 66 19b48: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 19b4c: 6b 01 movw r12, r22 19b4e: 7c 01 movw r14, r24 19b50: 6c 96 adiw r28, 0x1c ; 28 19b52: ae ad ldd r26, Y+62 ; 0x3e 19b54: bf ad ldd r27, Y+63 ; 0x3f 19b56: 6c 97 sbiw r28, 0x1c ; 28 19b58: bd 01 movw r22, r26 19b5a: bb 0f add r27, r27 19b5c: 88 0b sbc r24, r24 19b5e: 99 0b sbc r25, r25 19b60: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 19b64: 9b 01 movw r18, r22 19b66: ac 01 movw r20, r24 19b68: c7 01 movw r24, r14 19b6a: b6 01 movw r22, r12 19b6c: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 19b70: 6b 01 movw r12, r22 19b72: 7c 01 movw r14, r24 19b74: 65 96 adiw r28, 0x15 ; 21 19b76: cc ae std Y+60, r12 ; 0x3c 19b78: dd ae std Y+61, r13 ; 0x3d 19b7a: ee ae std Y+62, r14 ; 0x3e 19b7c: ff ae std Y+63, r15 ; 0x3f 19b7e: 65 97 sbiw r28, 0x15 ; 21 yf = (float)y + (yf - 15.5f) * 64; 19b80: 20 e0 ldi r18, 0x00 ; 0 19b82: 30 e0 ldi r19, 0x00 ; 0 19b84: 48 e7 ldi r20, 0x78 ; 120 19b86: 51 e4 ldi r21, 0x41 ; 65 19b88: 25 96 adiw r28, 0x05 ; 5 19b8a: 6c ad ldd r22, Y+60 ; 0x3c 19b8c: 7d ad ldd r23, Y+61 ; 0x3d 19b8e: 8e ad ldd r24, Y+62 ; 0x3e 19b90: 9f ad ldd r25, Y+63 ; 0x3f 19b92: 25 97 sbiw r28, 0x05 ; 5 19b94: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 19b98: 20 e0 ldi r18, 0x00 ; 0 19b9a: 30 e0 ldi r19, 0x00 ; 0 19b9c: 40 e8 ldi r20, 0x80 ; 128 19b9e: 52 e4 ldi r21, 0x42 ; 66 19ba0: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 19ba4: 4b 01 movw r8, r22 19ba6: 5c 01 movw r10, r24 19ba8: ac 96 adiw r28, 0x2c ; 44 19baa: ee ad ldd r30, Y+62 ; 0x3e 19bac: ff ad ldd r31, Y+63 ; 0x3f 19bae: ac 97 sbiw r28, 0x2c ; 44 19bb0: bf 01 movw r22, r30 19bb2: ff 0f add r31, r31 19bb4: 88 0b sbc r24, r24 19bb6: 99 0b sbc r25, r25 19bb8: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 19bbc: 9b 01 movw r18, r22 19bbe: ac 01 movw r20, r24 19bc0: c5 01 movw r24, r10 19bc2: b4 01 movw r22, r8 19bc4: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 19bc8: 25 96 adiw r28, 0x05 ; 5 19bca: 6c af std Y+60, r22 ; 0x3c 19bcc: 7d af std Y+61, r23 ; 0x3d 19bce: 8e af std Y+62, r24 ; 0x3e 19bd0: 9f af std Y+63, r25 ; 0x3f 19bd2: 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; 19bd4: 2a e0 ldi r18, 0x0A ; 10 19bd6: 37 ed ldi r19, 0xD7 ; 215 19bd8: 43 e2 ldi r20, 0x23 ; 35 19bda: 5c e3 ldi r21, 0x3C ; 60 19bdc: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__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)); 19be0: 9f 93 push r25 19be2: 8f 93 push r24 19be4: 7f 93 push r23 19be6: 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; 19be8: 2a e0 ldi r18, 0x0A ; 10 19bea: 37 ed ldi r19, 0xD7 ; 215 19bec: 43 e2 ldi r20, 0x23 ; 35 19bee: 5c e3 ldi r21, 0x3C ; 60 19bf0: c7 01 movw r24, r14 19bf2: b6 01 movw r22, r12 19bf4: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__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)); 19bf8: 9f 93 push r25 19bfa: 8f 93 push r24 19bfc: 7f 93 push r23 19bfe: 6f 93 push r22 19c00: 87 e9 ldi r24, 0x97 ; 151 19c02: 97 e8 ldi r25, 0x87 ; 135 19c04: 9f 93 push r25 19c06: 8f 93 push r24 19c08: 0f 94 5d 9f call 0x33eba ; 0x33eba uint16_t round_to_u16(float f){ return (uint16_t)(f + .5f); } int16_t round_to_i16(float f){ return (int16_t)(f + .5f); 19c0c: 20 e0 ldi r18, 0x00 ; 0 19c0e: 30 e0 ldi r19, 0x00 ; 0 19c10: 40 e0 ldi r20, 0x00 ; 0 19c12: 5f e3 ldi r21, 0x3F ; 63 19c14: 25 96 adiw r28, 0x05 ; 5 19c16: 6c ad ldd r22, Y+60 ; 0x3c 19c18: 7d ad ldd r23, Y+61 ; 0x3d 19c1a: 8e ad ldd r24, Y+62 ; 0x3e 19c1c: 9f ad ldd r25, Y+63 ; 0x3f 19c1e: 25 97 sbiw r28, 0x05 ; 5 19c20: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 19c24: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 19c28: 6b 01 movw r12, r22 19c2a: 20 e0 ldi r18, 0x00 ; 0 19c2c: 30 e0 ldi r19, 0x00 ; 0 19c2e: 40 e0 ldi r20, 0x00 ; 0 19c30: 5f e3 ldi r21, 0x3F ; 63 19c32: 65 96 adiw r28, 0x15 ; 21 19c34: 6c ad ldd r22, Y+60 ; 0x3c 19c36: 7d ad ldd r23, Y+61 ; 0x3d 19c38: 8e ad ldd r24, Y+62 ; 0x3e 19c3a: 9f ad ldd r25, Y+63 ; 0x3f 19c3c: 65 97 sbiw r28, 0x15 ; 21 19c3e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 19c42: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 19c46: 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); 19c48: 00 e0 ldi r16, 0x00 ; 0 19c4a: 28 ec ldi r18, 0xC8 ; 200 19c4c: 30 e0 ldi r19, 0x00 ; 0 19c4e: e7 96 adiw r28, 0x37 ; 55 19c50: 4e ad ldd r20, Y+62 ; 0x3e 19c52: 5f ad ldd r21, Y+63 ; 0x3f 19c54: e7 97 sbiw r28, 0x37 ; 55 19c56: b6 01 movw r22, r12 19c58: 0e 94 cf c2 call 0x1859e ; 0x1859e 19c5c: 0f b6 in r0, 0x3f ; 63 19c5e: f8 94 cli 19c60: de bf out 0x3e, r29 ; 62 19c62: 0f be out 0x3f, r0 ; 63 19c64: cd bf out 0x3d, r28 ; 61 ret = BED_SKEW_OFFSET_DETECTION_POINT_FOUND; 19c66: 10 e0 ldi r17, 0x00 ; 0 19c68: 88 ea ldi r24, 0xA8 ; 168 19c6a: 9d e0 ldi r25, 0x0D ; 13 } /// wipe buffer for (uint16_t i = 0; i < sizeof(block_t)*BLOCK_BUFFER_SIZE; i++) matrix32[i] = 0; 19c6c: a4 96 adiw r28, 0x24 ; 36 19c6e: ae ad ldd r26, Y+62 ; 0x3e 19c70: bf ad ldd r27, Y+63 ; 0x3f 19c72: a4 97 sbiw r28, 0x24 ; 36 19c74: 1d 92 st X+, r1 19c76: a4 96 adiw r28, 0x24 ; 36 19c78: bf af std Y+63, r27 ; 0x3f 19c7a: ae af std Y+62, r26 ; 0x3e 19c7c: 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++) 19c7e: 8a 17 cp r24, r26 19c80: 9b 07 cpc r25, r27 19c82: a1 f7 brne .-24 ; 0x19c6c 19c84: 76 cc rjmp .-1812 ; 0x19572 /// 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; 19c86: 1f ef ldi r17, 0xFF ; 255 19c88: ef cf rjmp .-34 ; 0x19c68 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; 19c8a: e5 96 adiw r28, 0x35 ; 53 19c8c: bf ad ldd r27, Y+63 ; 0x3f 19c8e: e5 97 sbiw r28, 0x35 ; 53 19c90: a7 96 adiw r28, 0x27 ; 39 19c92: bf af std Y+63, r27 ; 0x3f 19c94: a7 97 sbiw r28, 0x27 ; 39 19c96: 99 cc rjmp .-1742 ; 0x195ca // 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; 19c98: af 96 adiw r28, 0x2f ; 47 19c9a: 1f ae std Y+63, r1 ; 0x3f 19c9c: af 97 sbiw r28, 0x2f ; 47 19c9e: 62 cd rjmp .-1340 ; 0x19764 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]) : 19ca0: f2 01 movw r30, r4 19ca2: 25 81 ldd r18, Z+5 ; 0x05 19ca4: 36 81 ldd r19, Z+6 ; 0x06 19ca6: 47 81 ldd r20, Z+7 ; 0x07 19ca8: 50 85 ldd r21, Z+8 ; 0x08 19caa: c3 58 subi r28, 0x83 ; 131 19cac: df 4f sbci r29, 0xFF ; 255 19cae: 68 81 ld r22, Y 19cb0: 79 81 ldd r23, Y+1 ; 0x01 19cb2: 8a 81 ldd r24, Y+2 ; 0x02 19cb4: 9b 81 ldd r25, Y+3 ; 0x03 19cb6: cd 57 subi r28, 0x7D ; 125 19cb8: d0 40 sbci r29, 0x00 ; 0 19cba: 60 ce rjmp .-832 ; 0x1997c (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : ((c == 2) ? (-s1 * measured_pts[2 * i]) : 19cbc: 12 30 cpi r17, 0x02 ; 2 19cbe: 11 f0 breq .+4 ; 0x19cc4 19cc0: 0c 94 37 d7 jmp 0x1ae6e ; 0x1ae6e 19cc4: d2 01 movw r26, r4 19cc6: 11 96 adiw r26, 0x01 ; 1 19cc8: 2d 91 ld r18, X+ 19cca: 3d 91 ld r19, X+ 19ccc: 4d 91 ld r20, X+ 19cce: 5c 91 ld r21, X 19cd0: 14 97 sbiw r26, 0x04 ; 4 19cd2: cf 57 subi r28, 0x7F ; 127 19cd4: df 4f sbci r29, 0xFF ; 255 19cd6: 68 81 ld r22, Y 19cd8: 79 81 ldd r23, Y+1 ; 0x01 19cda: 8a 81 ldd r24, Y+2 ; 0x02 19cdc: 9b 81 ldd r25, Y+3 ; 0x03 19cde: c1 58 subi r28, 0x81 ; 129 19ce0: d0 40 sbci r29, 0x00 ; 0 19ce2: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> (-c2 * measured_pts[2 * i + 1])); float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += a * b * w; 19ce6: 9b 01 movw r18, r22 19ce8: ac 01 movw r20, r24 19cea: c5 01 movw r24, r10 19cec: b4 01 movw r22, r8 19cee: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 19cf2: 9b 01 movw r18, r22 19cf4: ac 01 movw r20, r24 19cf6: c7 01 movw r24, r14 19cf8: b6 01 movw r22, r12 19cfa: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 19cfe: 6b 01 movw r12, r22 19d00: 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) { 19d02: 01 11 cpse r16, r1 19d04: 0c 94 44 d8 jmp 0x1b088 ; 0x1b088 19d08: 7a 94 dec r7 19d0a: f8 e0 ldi r31, 0x08 ; 8 19d0c: 4f 0e add r4, r31 19d0e: 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) { 19d10: 71 10 cpse r7, r1 19d12: 16 ce rjmp .-980 ; 0x19940 (-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; 19d14: d1 01 movw r26, r2 19d16: cd 92 st X+, r12 19d18: dd 92 st X+, r13 19d1a: ed 92 st X+, r14 19d1c: fd 92 st X+, r15 19d1e: 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) { 19d20: 1f 5f subi r17, 0xFF ; 255 19d22: 14 30 cpi r17, 0x04 ; 4 19d24: 09 f0 breq .+2 ; 0x19d28 19d26: 03 ce rjmp .-1018 ; 0x1992e 19d28: 3c e4 ldi r19, 0x4C ; 76 19d2a: 23 2e mov r2, r19 19d2c: 38 e8 ldi r19, 0x88 ; 136 19d2e: 33 2e mov r3, r19 19d30: ec e9 ldi r30, 0x9C ; 156 19d32: f2 e1 ldi r31, 0x12 ; 18 19d34: a8 96 adiw r28, 0x28 ; 40 19d36: ff af std Y+63, r31 ; 0x3f 19d38: ee af std Y+62, r30 ; 0x3e 19d3a: a8 97 sbiw r28, 0x28 ; 40 } } A[r][c] = acc; } // J^T times f(x) acc = 0.f; 19d3c: c3 57 subi r28, 0x73 ; 115 19d3e: df 4f sbci r29, 0xFF ; 255 19d40: 18 82 st Y, r1 19d42: cd 58 subi r28, 0x8D ; 141 19d44: d0 40 sbci r29, 0x00 ; 0 19d46: c3 56 subi r28, 0x63 ; 99 19d48: df 4f sbci r29, 0xFF ; 255 19d4a: 18 82 st Y, r1 19d4c: cd 59 subi r28, 0x9D ; 157 19d4e: d0 40 sbci r29, 0x00 ; 0 19d50: cf 55 subi r28, 0x5F ; 95 19d52: df 4f sbci r29, 0xFF ; 255 19d54: 18 82 st Y, r1 19d56: c1 5a subi r28, 0xA1 ; 161 19d58: d0 40 sbci r29, 0x00 ; 0 19d5a: 10 e0 ldi r17, 0x00 ; 0 19d5c: a8 96 adiw r28, 0x28 ; 40 19d5e: ae ad ldd r26, Y+62 ; 0x3e 19d60: bf ad ldd r27, Y+63 ; 0x3f 19d62: a8 97 sbiw r28, 0x28 ; 40 19d64: 11 96 adiw r26, 0x01 ; 1 19d66: 2d 91 ld r18, X+ 19d68: 3d 91 ld r19, X+ 19d6a: 4d 91 ld r20, X+ 19d6c: 5c 91 ld r21, X 19d6e: 14 97 sbiw r26, 0x04 ; 4 19d70: e4 96 adiw r28, 0x34 ; 52 19d72: 2c af std Y+60, r18 ; 0x3c 19d74: 3d af std Y+61, r19 ; 0x3d 19d76: 4e af std Y+62, r20 ; 0x3e 19d78: 5f af std Y+63, r21 ; 0x3f 19d7a: e4 97 sbiw r28, 0x34 ; 52 19d7c: 15 96 adiw r26, 0x05 ; 5 19d7e: 4d 90 ld r4, X+ 19d80: 5d 90 ld r5, X+ 19d82: 6d 90 ld r6, X+ 19d84: 7c 90 ld r7, X 19d86: 18 97 sbiw r26, 0x08 ; 8 for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 19d88: 00 23 and r16, r16 19d8a: 11 f4 brne .+4 ; 0x19d90 19d8c: 0c 94 6a d7 jmp 0x1aed4 ; 0x1aed4 ((r == 1) ? 0.f : 19d90: 81 2c mov r8, r1 19d92: 91 2c mov r9, r1 19d94: 54 01 movw r10, r8 19d96: 01 30 cpi r16, 0x01 ; 1 19d98: 81 f0 breq .+32 ; 0x19dba ((r == 2) ? (-s1 * measured_pts[2 * i]) : 19d9a: 02 30 cpi r16, 0x02 ; 2 19d9c: 11 f0 breq .+4 ; 0x19da2 19d9e: 0c 94 5e d7 jmp 0x1aebc ; 0x1aebc 19da2: cf 57 subi r28, 0x7F ; 127 19da4: df 4f sbci r29, 0xFF ; 255 19da6: 68 81 ld r22, Y 19da8: 79 81 ldd r23, Y+1 ; 0x01 19daa: 8a 81 ldd r24, Y+2 ; 0x02 19dac: 9b 81 ldd r25, Y+3 ; 0x03 19dae: c1 58 subi r28, 0x81 ; 129 19db0: d0 40 sbci r29, 0x00 ; 0 19db2: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 19db6: 4b 01 movw r8, r22 19db8: 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); 19dba: e4 96 adiw r28, 0x34 ; 52 19dbc: 2c ad ldd r18, Y+60 ; 0x3c 19dbe: 3d ad ldd r19, Y+61 ; 0x3d 19dc0: 4e ad ldd r20, Y+62 ; 0x3e 19dc2: 5f ad ldd r21, Y+63 ; 0x3f 19dc4: e4 97 sbiw r28, 0x34 ; 52 19dc6: 6e 96 adiw r28, 0x1e ; 30 19dc8: 6c ad ldd r22, Y+60 ; 0x3c 19dca: 7d ad ldd r23, Y+61 ; 0x3d 19dcc: 8e ad ldd r24, Y+62 ; 0x3e 19dce: 9f ad ldd r25, Y+63 ; 0x3f 19dd0: 6e 97 sbiw r28, 0x1e ; 30 19dd2: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 19dd6: 6b 01 movw r12, r22 19dd8: 7c 01 movw r14, r24 19dda: f1 01 movw r30, r2 19ddc: 25 91 lpm r18, Z+ 19dde: 35 91 lpm r19, Z+ 19de0: 45 91 lpm r20, Z+ 19de2: 54 91 lpm r21, Z 19de4: cb 55 subi r28, 0x5B ; 91 19de6: df 4f sbci r29, 0xFF ; 255 19de8: 28 83 st Y, r18 19dea: 39 83 std Y+1, r19 ; 0x01 19dec: 4a 83 std Y+2, r20 ; 0x02 19dee: 5b 83 std Y+3, r21 ; 0x03 19df0: c5 5a subi r28, 0xA5 ; 165 19df2: d0 40 sbci r29, 0x00 ; 0 19df4: a3 01 movw r20, r6 19df6: 92 01 movw r18, r4 19df8: cb 56 subi r28, 0x6B ; 107 19dfa: df 4f sbci r29, 0xFF ; 255 19dfc: 68 81 ld r22, Y 19dfe: 79 81 ldd r23, Y+1 ; 0x01 19e00: 8a 81 ldd r24, Y+2 ; 0x02 19e02: 9b 81 ldd r25, Y+3 ; 0x03 19e04: c5 59 subi r28, 0x95 ; 149 19e06: d0 40 sbci r29, 0x00 ; 0 19e08: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 19e0c: 9b 01 movw r18, r22 19e0e: ac 01 movw r20, r24 19e10: c7 01 movw r24, r14 19e12: b6 01 movw r22, r12 19e14: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 19e18: c5 55 subi r28, 0x55 ; 85 19e1a: df 4f sbci r29, 0xFF ; 255 19e1c: 28 81 ld r18, Y 19e1e: 39 81 ldd r19, Y+1 ; 0x01 19e20: 4a 81 ldd r20, Y+2 ; 0x02 19e22: 5b 81 ldd r21, Y+3 ; 0x03 19e24: cb 5a subi r28, 0xAB ; 171 19e26: d0 40 sbci r29, 0x00 ; 0 19e28: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 19e2c: cb 55 subi r28, 0x5B ; 91 19e2e: df 4f sbci r29, 0xFF ; 255 19e30: 28 81 ld r18, Y 19e32: 39 81 ldd r19, Y+1 ; 0x01 19e34: 4a 81 ldd r20, Y+2 ; 0x02 19e36: 5b 81 ldd r21, Y+3 ; 0x03 19e38: c5 5a subi r28, 0xA5 ; 165 19e3a: d0 40 sbci r29, 0x00 ; 0 19e3c: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; 19e40: a5 01 movw r20, r10 19e42: 94 01 movw r18, r8 19e44: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 19e48: c3 57 subi r28, 0x73 ; 115 19e4a: df 4f sbci r29, 0xFF ; 255 19e4c: 28 81 ld r18, Y 19e4e: cd 58 subi r28, 0x8D ; 141 19e50: d0 40 sbci r29, 0x00 ; 0 19e52: c3 56 subi r28, 0x63 ; 99 19e54: df 4f sbci r29, 0xFF ; 255 19e56: 38 81 ld r19, Y 19e58: cd 59 subi r28, 0x9D ; 157 19e5a: d0 40 sbci r29, 0x00 ; 0 19e5c: cf 55 subi r28, 0x5F ; 95 19e5e: df 4f sbci r29, 0xFF ; 255 19e60: 48 81 ld r20, Y 19e62: c1 5a subi r28, 0xA1 ; 161 19e64: d0 40 sbci r29, 0x00 ; 0 19e66: 51 2f mov r21, r17 19e68: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 19e6c: c3 57 subi r28, 0x73 ; 115 19e6e: df 4f sbci r29, 0xFF ; 255 19e70: 68 83 st Y, r22 19e72: 79 83 std Y+1, r23 ; 0x01 19e74: 8a 83 std Y+2, r24 ; 0x02 19e76: 9b 83 std Y+3, r25 ; 0x03 19e78: cd 58 subi r28, 0x8D ; 141 19e7a: d0 40 sbci r29, 0x00 ; 0 } { float j = (r == 0) ? 0.f : 19e7c: 00 23 and r16, r16 19e7e: 11 f4 brne .+4 ; 0x19e84 19e80: 0c 94 72 d7 jmp 0x1aee4 ; 0x1aee4 ((r == 1) ? 1.f : 19e84: 01 30 cpi r16, 0x01 ; 1 19e86: 11 f4 brne .+4 ; 0x19e8c 19e88: 0c 94 77 d7 jmp 0x1aeee ; 0x1aeee ((r == 2) ? ( c1 * measured_pts[2 * i]) : 19e8c: 02 30 cpi r16, 0x02 ; 2 19e8e: 61 f0 breq .+24 ; 0x19ea8 19e90: a3 01 movw r20, r6 19e92: 92 01 movw r18, r4 19e94: ed 96 adiw r28, 0x3d ; 61 19e96: 6c ad ldd r22, Y+60 ; 0x3c 19e98: 7d ad ldd r23, Y+61 ; 0x3d 19e9a: 8e ad ldd r24, Y+62 ; 0x3e 19e9c: 9f ad ldd r25, Y+63 ; 0x3f 19e9e: ed 97 sbiw r28, 0x3d ; 61 19ea0: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 19ea4: 6b 01 movw r12, r22 19ea6: 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); 19ea8: f1 01 movw r30, r2 19eaa: 34 96 adiw r30, 0x04 ; 4 19eac: 85 90 lpm r8, Z+ 19eae: 95 90 lpm r9, Z+ 19eb0: a5 90 lpm r10, Z+ 19eb2: b4 90 lpm r11, Z 19eb4: e4 96 adiw r28, 0x34 ; 52 19eb6: 2c ad ldd r18, Y+60 ; 0x3c 19eb8: 3d ad ldd r19, Y+61 ; 0x3d 19eba: 4e ad ldd r20, Y+62 ; 0x3e 19ebc: 5f ad ldd r21, Y+63 ; 0x3f 19ebe: e4 97 sbiw r28, 0x34 ; 52 19ec0: cb 57 subi r28, 0x7B ; 123 19ec2: df 4f sbci r29, 0xFF ; 255 19ec4: 68 81 ld r22, Y 19ec6: 79 81 ldd r23, Y+1 ; 0x01 19ec8: 8a 81 ldd r24, Y+2 ; 0x02 19eca: 9b 81 ldd r25, Y+3 ; 0x03 19ecc: c5 58 subi r28, 0x85 ; 133 19ece: d0 40 sbci r29, 0x00 ; 0 19ed0: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 19ed4: e4 96 adiw r28, 0x34 ; 52 19ed6: 6c af std Y+60, r22 ; 0x3c 19ed8: 7d af std Y+61, r23 ; 0x3d 19eda: 8e af std Y+62, r24 ; 0x3e 19edc: 9f af std Y+63, r25 ; 0x3f 19ede: e4 97 sbiw r28, 0x34 ; 52 19ee0: a3 01 movw r20, r6 19ee2: 92 01 movw r18, r4 19ee4: c7 57 subi r28, 0x77 ; 119 19ee6: df 4f sbci r29, 0xFF ; 255 19ee8: 68 81 ld r22, Y 19eea: 79 81 ldd r23, Y+1 ; 0x01 19eec: 8a 81 ldd r24, Y+2 ; 0x02 19eee: 9b 81 ldd r25, Y+3 ; 0x03 19ef0: c9 58 subi r28, 0x89 ; 137 19ef2: d0 40 sbci r29, 0x00 ; 0 19ef4: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 19ef8: 9b 01 movw r18, r22 19efa: ac 01 movw r20, r24 19efc: e4 96 adiw r28, 0x34 ; 52 19efe: 6c ad ldd r22, Y+60 ; 0x3c 19f00: 7d ad ldd r23, Y+61 ; 0x3d 19f02: 8e ad ldd r24, Y+62 ; 0x3e 19f04: 9f ad ldd r25, Y+63 ; 0x3f 19f06: e4 97 sbiw r28, 0x34 ; 52 19f08: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 19f0c: c1 55 subi r28, 0x51 ; 81 19f0e: df 4f sbci r29, 0xFF ; 255 19f10: 28 81 ld r18, Y 19f12: 39 81 ldd r19, Y+1 ; 0x01 19f14: 4a 81 ldd r20, Y+2 ; 0x02 19f16: 5b 81 ldd r21, Y+3 ; 0x03 19f18: cf 5a subi r28, 0xAF ; 175 19f1a: d0 40 sbci r29, 0x00 ; 0 19f1c: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 19f20: a5 01 movw r20, r10 19f22: 94 01 movw r18, r8 19f24: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += j * fy * w; 19f28: a7 01 movw r20, r14 19f2a: 96 01 movw r18, r12 19f2c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 19f30: c3 57 subi r28, 0x73 ; 115 19f32: df 4f sbci r29, 0xFF ; 255 19f34: 28 81 ld r18, Y 19f36: 39 81 ldd r19, Y+1 ; 0x01 19f38: 4a 81 ldd r20, Y+2 ; 0x02 19f3a: 5b 81 ldd r21, Y+3 ; 0x03 19f3c: cd 58 subi r28, 0x8D ; 141 19f3e: d0 40 sbci r29, 0x00 ; 0 19f40: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 19f44: c3 57 subi r28, 0x73 ; 115 19f46: df 4f sbci r29, 0xFF ; 255 19f48: 68 83 st Y, r22 19f4a: cd 58 subi r28, 0x8D ; 141 19f4c: d0 40 sbci r29, 0x00 ; 0 19f4e: c3 56 subi r28, 0x63 ; 99 19f50: df 4f sbci r29, 0xFF ; 255 19f52: 78 83 st Y, r23 19f54: cd 59 subi r28, 0x9D ; 157 19f56: d0 40 sbci r29, 0x00 ; 0 19f58: cf 55 subi r28, 0x5F ; 95 19f5a: df 4f sbci r29, 0xFF ; 255 19f5c: 88 83 st Y, r24 19f5e: c1 5a subi r28, 0xA1 ; 161 19f60: d0 40 sbci r29, 0x00 ; 0 19f62: 19 2f mov r17, r25 19f64: a8 96 adiw r28, 0x28 ; 40 19f66: 4e ad ldd r20, Y+62 ; 0x3e 19f68: 5f ad ldd r21, Y+63 ; 0x3f 19f6a: a8 97 sbiw r28, 0x28 ; 40 19f6c: 48 5f subi r20, 0xF8 ; 248 19f6e: 5f 4f sbci r21, 0xFF ; 255 19f70: a8 96 adiw r28, 0x28 ; 40 19f72: 5f af std Y+63, r21 ; 0x3f 19f74: 4e af std Y+62, r20 ; 0x3e 19f76: a8 97 sbiw r28, 0x28 ; 40 19f78: 58 e0 ldi r21, 0x08 ; 8 19f7a: 25 0e add r2, r21 19f7c: 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) { 19f7e: ac eb ldi r26, 0xBC ; 188 19f80: b2 e1 ldi r27, 0x12 ; 18 19f82: a8 96 adiw r28, 0x28 ; 40 19f84: ee ad ldd r30, Y+62 ; 0x3e 19f86: ff ad ldd r31, Y+63 ; 0x3f 19f88: a8 97 sbiw r28, 0x28 ; 40 19f8a: ae 17 cp r26, r30 19f8c: bf 07 cpc r27, r31 19f8e: 09 f0 breq .+2 ; 0x19f92 19f90: e5 ce rjmp .-566 ; 0x19d5c 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; 19f92: 90 58 subi r25, 0x80 ; 128 19f94: c7 56 subi r28, 0x67 ; 103 19f96: df 4f sbci r29, 0xFF ; 255 19f98: a8 81 ld r26, Y 19f9a: b9 81 ldd r27, Y+1 ; 0x01 19f9c: c9 59 subi r28, 0x99 ; 153 19f9e: d0 40 sbci r29, 0x00 ; 0 19fa0: 6d 93 st X+, r22 19fa2: 7d 93 st X+, r23 19fa4: 8d 93 st X+, r24 19fa6: 9d 93 st X+, r25 19fa8: c7 56 subi r28, 0x67 ; 103 19faa: df 4f sbci r29, 0xFF ; 255 19fac: b9 83 std Y+1, r27 ; 0x01 19fae: a8 83 st Y, r26 19fb0: c9 59 subi r28, 0x99 ; 153 19fb2: 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) { 19fb4: 0f 5f subi r16, 0xFF ; 255 19fb6: ac 96 adiw r28, 0x2c ; 44 19fb8: ee ad ldd r30, Y+62 ; 0x3e 19fba: ff ad ldd r31, Y+63 ; 0x3f 19fbc: ac 97 sbiw r28, 0x2c ; 44 19fbe: 70 96 adiw r30, 0x10 ; 16 19fc0: ac 96 adiw r28, 0x2c ; 44 19fc2: ff af std Y+63, r31 ; 0x3f 19fc4: ee af std Y+62, r30 ; 0x3e 19fc6: ac 97 sbiw r28, 0x2c ; 44 19fc8: 04 30 cpi r16, 0x04 ; 4 19fca: 09 f0 breq .+2 ; 0x19fce 19fcc: ab cc rjmp .-1706 ; 0x19924 } // 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]; 19fce: 25 96 adiw r28, 0x05 ; 5 19fd0: 2c ad ldd r18, Y+60 ; 0x3c 19fd2: 3d ad ldd r19, Y+61 ; 0x3d 19fd4: 4e ad ldd r20, Y+62 ; 0x3e 19fd6: 5f ad ldd r21, Y+63 ; 0x3f 19fd8: 25 97 sbiw r28, 0x05 ; 5 19fda: ae 96 adiw r28, 0x2e ; 46 19fdc: 2c af std Y+60, r18 ; 0x3c 19fde: 3d af std Y+61, r19 ; 0x3d 19fe0: 4e af std Y+62, r20 ; 0x3e 19fe2: 5f af std Y+63, r21 ; 0x3f 19fe4: ae 97 sbiw r28, 0x2e ; 46 19fe6: 8d 81 ldd r24, Y+5 ; 0x05 19fe8: 9e 81 ldd r25, Y+6 ; 0x06 19fea: af 81 ldd r26, Y+7 ; 0x07 19fec: b8 85 ldd r27, Y+8 ; 0x08 19fee: e4 96 adiw r28, 0x34 ; 52 19ff0: 8c af std Y+60, r24 ; 0x3c 19ff2: 9d af std Y+61, r25 ; 0x3d 19ff4: ae af std Y+62, r26 ; 0x3e 19ff6: bf af std Y+63, r27 ; 0x3f 19ff8: e4 97 sbiw r28, 0x34 ; 52 19ffa: 29 85 ldd r18, Y+9 ; 0x09 19ffc: 3a 85 ldd r19, Y+10 ; 0x0a 19ffe: 4b 85 ldd r20, Y+11 ; 0x0b 1a000: 5c 85 ldd r21, Y+12 ; 0x0c 1a002: ed 96 adiw r28, 0x3d ; 61 1a004: 2c af std Y+60, r18 ; 0x3c 1a006: 3d af std Y+61, r19 ; 0x3d 1a008: 4e af std Y+62, r20 ; 0x3e 1a00a: 5f af std Y+63, r21 ; 0x3f 1a00c: ed 97 sbiw r28, 0x3d ; 61 1a00e: 8d 85 ldd r24, Y+13 ; 0x0d 1a010: 9e 85 ldd r25, Y+14 ; 0x0e 1a012: af 85 ldd r26, Y+15 ; 0x0f 1a014: b8 89 ldd r27, Y+16 ; 0x10 1a016: c3 58 subi r28, 0x83 ; 131 1a018: df 4f sbci r29, 0xFF ; 255 1a01a: 88 83 st Y, r24 1a01c: 99 83 std Y+1, r25 ; 0x01 1a01e: aa 83 std Y+2, r26 ; 0x02 1a020: bb 83 std Y+3, r27 ; 0x03 1a022: cd 57 subi r28, 0x7D ; 125 1a024: d0 40 sbci r29, 0x00 ; 0 1a026: 29 81 ldd r18, Y+1 ; 0x01 1a028: 3a 81 ldd r19, Y+2 ; 0x02 1a02a: 4b 81 ldd r20, Y+3 ; 0x03 1a02c: 5c 81 ldd r21, Y+4 ; 0x04 1a02e: cf 57 subi r28, 0x7F ; 127 1a030: df 4f sbci r29, 0xFF ; 255 1a032: 28 83 st Y, r18 1a034: 39 83 std Y+1, r19 ; 0x01 1a036: 4a 83 std Y+2, r20 ; 0x02 1a038: 5b 83 std Y+3, r21 ; 0x03 1a03a: c1 58 subi r28, 0x81 ; 129 1a03c: 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]; 1a03e: 29 96 adiw r28, 0x09 ; 9 1a040: 8c ad ldd r24, Y+60 ; 0x3c 1a042: 9d ad ldd r25, Y+61 ; 0x3d 1a044: ae ad ldd r26, Y+62 ; 0x3e 1a046: bf ad ldd r27, Y+63 ; 0x3f 1a048: 29 97 sbiw r28, 0x09 ; 9 1a04a: cb 57 subi r28, 0x7B ; 123 1a04c: df 4f sbci r29, 0xFF ; 255 1a04e: 88 83 st Y, r24 1a050: 99 83 std Y+1, r25 ; 0x01 1a052: aa 83 std Y+2, r26 ; 0x02 1a054: bb 83 std Y+3, r27 ; 0x03 1a056: c5 58 subi r28, 0x85 ; 133 1a058: d0 40 sbci r29, 0x00 ; 0 1a05a: 29 89 ldd r18, Y+17 ; 0x11 1a05c: 3a 89 ldd r19, Y+18 ; 0x12 1a05e: 4b 89 ldd r20, Y+19 ; 0x13 1a060: 5c 89 ldd r21, Y+20 ; 0x14 1a062: c7 57 subi r28, 0x77 ; 119 1a064: df 4f sbci r29, 0xFF ; 255 1a066: 28 83 st Y, r18 1a068: 39 83 std Y+1, r19 ; 0x01 1a06a: 4a 83 std Y+2, r20 ; 0x02 1a06c: 5b 83 std Y+3, r21 ; 0x03 1a06e: c9 58 subi r28, 0x89 ; 137 1a070: d0 40 sbci r29, 0x00 ; 0 1a072: 89 8d ldd r24, Y+25 ; 0x19 1a074: 9a 8d ldd r25, Y+26 ; 0x1a 1a076: ab 8d ldd r26, Y+27 ; 0x1b 1a078: bc 8d ldd r27, Y+28 ; 0x1c 1a07a: cb 56 subi r28, 0x6B ; 107 1a07c: df 4f sbci r29, 0xFF ; 255 1a07e: 88 83 st Y, r24 1a080: 99 83 std Y+1, r25 ; 0x01 1a082: aa 83 std Y+2, r26 ; 0x02 1a084: bb 83 std Y+3, r27 ; 0x03 1a086: c5 59 subi r28, 0x95 ; 149 1a088: d0 40 sbci r29, 0x00 ; 0 1a08a: 2d 8d ldd r18, Y+29 ; 0x1d 1a08c: 3e 8d ldd r19, Y+30 ; 0x1e 1a08e: 4f 8d ldd r20, Y+31 ; 0x1f 1a090: 58 a1 ldd r21, Y+32 ; 0x20 1a092: c7 56 subi r28, 0x67 ; 103 1a094: df 4f sbci r29, 0xFF ; 255 1a096: 28 83 st Y, r18 1a098: 39 83 std Y+1, r19 ; 0x01 1a09a: 4a 83 std Y+2, r20 ; 0x02 1a09c: 5b 83 std Y+3, r21 ; 0x03 1a09e: c9 59 subi r28, 0x99 ; 153 1a0a0: d0 40 sbci r29, 0x00 ; 0 1a0a2: 8d 89 ldd r24, Y+21 ; 0x15 1a0a4: 9e 89 ldd r25, Y+22 ; 0x16 1a0a6: af 89 ldd r26, Y+23 ; 0x17 1a0a8: b8 8d ldd r27, Y+24 ; 0x18 1a0aa: c3 57 subi r28, 0x73 ; 115 1a0ac: df 4f sbci r29, 0xFF ; 255 1a0ae: 88 83 st Y, r24 1a0b0: 99 83 std Y+1, r25 ; 0x01 1a0b2: aa 83 std Y+2, r26 ; 0x02 1a0b4: bb 83 std Y+3, r27 ; 0x03 1a0b6: cd 58 subi r28, 0x8D ; 141 1a0b8: 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]; 1a0ba: 2d 96 adiw r28, 0x0d ; 13 1a0bc: 2c ad ldd r18, Y+60 ; 0x3c 1a0be: 3d ad ldd r19, Y+61 ; 0x3d 1a0c0: 4e ad ldd r20, Y+62 ; 0x3e 1a0c2: 5f ad ldd r21, Y+63 ; 0x3f 1a0c4: 2d 97 sbiw r28, 0x0d ; 13 1a0c6: c3 56 subi r28, 0x63 ; 99 1a0c8: df 4f sbci r29, 0xFF ; 255 1a0ca: 28 83 st Y, r18 1a0cc: 39 83 std Y+1, r19 ; 0x01 1a0ce: 4a 83 std Y+2, r20 ; 0x02 1a0d0: 5b 83 std Y+3, r21 ; 0x03 1a0d2: cd 59 subi r28, 0x9D ; 157 1a0d4: d0 40 sbci r29, 0x00 ; 0 1a0d6: 89 a1 ldd r24, Y+33 ; 0x21 1a0d8: 9a a1 ldd r25, Y+34 ; 0x22 1a0da: ab a1 ldd r26, Y+35 ; 0x23 1a0dc: bc a1 ldd r27, Y+36 ; 0x24 1a0de: cf 55 subi r28, 0x5F ; 95 1a0e0: df 4f sbci r29, 0xFF ; 255 1a0e2: 88 83 st Y, r24 1a0e4: 99 83 std Y+1, r25 ; 0x01 1a0e6: aa 83 std Y+2, r26 ; 0x02 1a0e8: bb 83 std Y+3, r27 ; 0x03 1a0ea: c1 5a subi r28, 0xA1 ; 161 1a0ec: d0 40 sbci r29, 0x00 ; 0 1a0ee: 2d a1 ldd r18, Y+37 ; 0x25 1a0f0: 3e a1 ldd r19, Y+38 ; 0x26 1a0f2: 4f a1 ldd r20, Y+39 ; 0x27 1a0f4: 58 a5 ldd r21, Y+40 ; 0x28 1a0f6: cb 55 subi r28, 0x5B ; 91 1a0f8: df 4f sbci r29, 0xFF ; 255 1a0fa: 28 83 st Y, r18 1a0fc: 39 83 std Y+1, r19 ; 0x01 1a0fe: 4a 83 std Y+2, r20 ; 0x02 1a100: 5b 83 std Y+3, r21 ; 0x03 1a102: c5 5a subi r28, 0xA5 ; 165 1a104: d0 40 sbci r29, 0x00 ; 0 1a106: 8d a5 ldd r24, Y+45 ; 0x2d 1a108: 9e a5 ldd r25, Y+46 ; 0x2e 1a10a: af a5 ldd r26, Y+47 ; 0x2f 1a10c: b8 a9 ldd r27, Y+48 ; 0x30 1a10e: cd 54 subi r28, 0x4D ; 77 1a110: df 4f sbci r29, 0xFF ; 255 1a112: 88 83 st Y, r24 1a114: 99 83 std Y+1, r25 ; 0x01 1a116: aa 83 std Y+2, r26 ; 0x02 1a118: bb 83 std Y+3, r27 ; 0x03 1a11a: c3 5b subi r28, 0xB3 ; 179 1a11c: d0 40 sbci r29, 0x00 ; 0 1a11e: 29 a5 ldd r18, Y+41 ; 0x29 1a120: 3a a5 ldd r19, Y+42 ; 0x2a 1a122: 4b a5 ldd r20, Y+43 ; 0x2b 1a124: 5c a5 ldd r21, Y+44 ; 0x2c 1a126: c9 54 subi r28, 0x49 ; 73 1a128: df 4f sbci r29, 0xFF ; 255 1a12a: 28 83 st Y, r18 1a12c: 39 83 std Y+1, r19 ; 0x01 1a12e: 4a 83 std Y+2, r20 ; 0x02 1a130: 5b 83 std Y+3, r21 ; 0x03 1a132: c7 5b subi r28, 0xB7 ; 183 1a134: 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]; 1a136: 61 96 adiw r28, 0x11 ; 17 1a138: 8c ad ldd r24, Y+60 ; 0x3c 1a13a: 9d ad ldd r25, Y+61 ; 0x3d 1a13c: ae ad ldd r26, Y+62 ; 0x3e 1a13e: bf ad ldd r27, Y+63 ; 0x3f 1a140: 61 97 sbiw r28, 0x11 ; 17 1a142: c5 54 subi r28, 0x45 ; 69 1a144: df 4f sbci r29, 0xFF ; 255 1a146: 88 83 st Y, r24 1a148: 99 83 std Y+1, r25 ; 0x01 1a14a: aa 83 std Y+2, r26 ; 0x02 1a14c: bb 83 std Y+3, r27 ; 0x03 1a14e: cb 5b subi r28, 0xBB ; 187 1a150: d0 40 sbci r29, 0x00 ; 0 1a152: 29 a9 ldd r18, Y+49 ; 0x31 1a154: 3a a9 ldd r19, Y+50 ; 0x32 1a156: 4b a9 ldd r20, Y+51 ; 0x33 1a158: 5c a9 ldd r21, Y+52 ; 0x34 1a15a: c1 54 subi r28, 0x41 ; 65 1a15c: df 4f sbci r29, 0xFF ; 255 1a15e: 28 83 st Y, r18 1a160: 39 83 std Y+1, r19 ; 0x01 1a162: 4a 83 std Y+2, r20 ; 0x02 1a164: 5b 83 std Y+3, r21 ; 0x03 1a166: cf 5b subi r28, 0xBF ; 191 1a168: d0 40 sbci r29, 0x00 ; 0 1a16a: 8d a9 ldd r24, Y+53 ; 0x35 1a16c: 9e a9 ldd r25, Y+54 ; 0x36 1a16e: af a9 ldd r26, Y+55 ; 0x37 1a170: b8 ad ldd r27, Y+56 ; 0x38 1a172: cd 53 subi r28, 0x3D ; 61 1a174: df 4f sbci r29, 0xFF ; 255 1a176: 88 83 st Y, r24 1a178: 99 83 std Y+1, r25 ; 0x01 1a17a: aa 83 std Y+2, r26 ; 0x02 1a17c: bb 83 std Y+3, r27 ; 0x03 1a17e: c3 5c subi r28, 0xC3 ; 195 1a180: d0 40 sbci r29, 0x00 ; 0 1a182: 29 ad ldd r18, Y+57 ; 0x39 1a184: 3a ad ldd r19, Y+58 ; 0x3a 1a186: 4b ad ldd r20, Y+59 ; 0x3b 1a188: 5c ad ldd r21, Y+60 ; 0x3c 1a18a: c9 53 subi r28, 0x39 ; 57 1a18c: df 4f sbci r29, 0xFF ; 255 1a18e: 28 83 st Y, r18 1a190: 39 83 std Y+1, r19 ; 0x01 1a192: 4a 83 std Y+2, r20 ; 0x02 1a194: 5b 83 std Y+3, r21 ; 0x03 1a196: c7 5c subi r28, 0xC7 ; 199 1a198: d0 40 sbci r29, 0x00 ; 0 1a19a: 21 96 adiw r28, 0x01 ; 1 1a19c: 8c ad ldd r24, Y+60 ; 0x3c 1a19e: 9d ad ldd r25, Y+61 ; 0x3d 1a1a0: ae ad ldd r26, Y+62 ; 0x3e 1a1a2: bf ad ldd r27, Y+63 ; 0x3f 1a1a4: 21 97 sbiw r28, 0x01 ; 1 1a1a6: c5 53 subi r28, 0x35 ; 53 1a1a8: df 4f sbci r29, 0xFF ; 255 1a1aa: 88 83 st Y, r24 1a1ac: 99 83 std Y+1, r25 ; 0x01 1a1ae: aa 83 std Y+2, r26 ; 0x02 1a1b0: bb 83 std Y+3, r27 ; 0x03 1a1b2: cb 5c subi r28, 0xCB ; 203 1a1b4: d0 40 sbci r29, 0x00 ; 0 1a1b6: 14 e6 ldi r17, 0x64 ; 100 } b[r] = -acc; } // Solve for h by a Gauss iteration method. float h[4] = { 0.f }; 1a1b8: c1 2c mov r12, r1 1a1ba: d1 2c mov r13, r1 1a1bc: 76 01 movw r14, r12 1a1be: 46 01 movw r8, r12 1a1c0: 57 01 movw r10, r14 1a1c2: 26 01 movw r4, r12 1a1c4: 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]; 1a1c6: a3 01 movw r20, r6 1a1c8: 92 01 movw r18, r4 1a1ca: e4 96 adiw r28, 0x34 ; 52 1a1cc: 6c ad ldd r22, Y+60 ; 0x3c 1a1ce: 7d ad ldd r23, Y+61 ; 0x3d 1a1d0: 8e ad ldd r24, Y+62 ; 0x3e 1a1d2: 9f ad ldd r25, Y+63 ; 0x3f 1a1d4: e4 97 sbiw r28, 0x34 ; 52 1a1d6: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1a1da: 9b 01 movw r18, r22 1a1dc: ac 01 movw r20, r24 1a1de: ae 96 adiw r28, 0x2e ; 46 1a1e0: 6c ad ldd r22, Y+60 ; 0x3c 1a1e2: 7d ad ldd r23, Y+61 ; 0x3d 1a1e4: 8e ad ldd r24, Y+62 ; 0x3e 1a1e6: 9f ad ldd r25, Y+63 ; 0x3f 1a1e8: ae 97 sbiw r28, 0x2e ; 46 1a1ea: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1a1ee: 2b 01 movw r4, r22 1a1f0: 3c 01 movw r6, r24 1a1f2: a5 01 movw r20, r10 1a1f4: 94 01 movw r18, r8 1a1f6: ed 96 adiw r28, 0x3d ; 61 1a1f8: 6c ad ldd r22, Y+60 ; 0x3c 1a1fa: 7d ad ldd r23, Y+61 ; 0x3d 1a1fc: 8e ad ldd r24, Y+62 ; 0x3e 1a1fe: 9f ad ldd r25, Y+63 ; 0x3f 1a200: ed 97 sbiw r28, 0x3d ; 61 1a202: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1a206: 9b 01 movw r18, r22 1a208: ac 01 movw r20, r24 1a20a: c3 01 movw r24, r6 1a20c: b2 01 movw r22, r4 1a20e: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1a212: 2b 01 movw r4, r22 1a214: 3c 01 movw r6, r24 1a216: a7 01 movw r20, r14 1a218: 96 01 movw r18, r12 1a21a: c3 58 subi r28, 0x83 ; 131 1a21c: df 4f sbci r29, 0xFF ; 255 1a21e: 68 81 ld r22, Y 1a220: 79 81 ldd r23, Y+1 ; 0x01 1a222: 8a 81 ldd r24, Y+2 ; 0x02 1a224: 9b 81 ldd r25, Y+3 ; 0x03 1a226: cd 57 subi r28, 0x7D ; 125 1a228: d0 40 sbci r29, 0x00 ; 0 1a22a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1a22e: 9b 01 movw r18, r22 1a230: ac 01 movw r20, r24 1a232: c3 01 movw r24, r6 1a234: b2 01 movw r22, r4 1a236: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1a23a: cf 57 subi r28, 0x7F ; 127 1a23c: df 4f sbci r29, 0xFF ; 255 1a23e: 28 81 ld r18, Y 1a240: 39 81 ldd r19, Y+1 ; 0x01 1a242: 4a 81 ldd r20, Y+2 ; 0x02 1a244: 5b 81 ldd r21, Y+3 ; 0x03 1a246: c1 58 subi r28, 0x81 ; 129 1a248: d0 40 sbci r29, 0x00 ; 0 1a24a: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1a24e: 6e 96 adiw r28, 0x1e ; 30 1a250: 6c af std Y+60, r22 ; 0x3c 1a252: 7d af std Y+61, r23 ; 0x3d 1a254: 8e af std Y+62, r24 ; 0x3e 1a256: 9f af std Y+63, r25 ; 0x3f 1a258: 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]; 1a25a: c7 57 subi r28, 0x77 ; 119 1a25c: df 4f sbci r29, 0xFF ; 255 1a25e: 28 81 ld r18, Y 1a260: 39 81 ldd r19, Y+1 ; 0x01 1a262: 4a 81 ldd r20, Y+2 ; 0x02 1a264: 5b 81 ldd r21, Y+3 ; 0x03 1a266: c9 58 subi r28, 0x89 ; 137 1a268: d0 40 sbci r29, 0x00 ; 0 1a26a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1a26e: 9b 01 movw r18, r22 1a270: ac 01 movw r20, r24 1a272: cb 57 subi r28, 0x7B ; 123 1a274: df 4f sbci r29, 0xFF ; 255 1a276: 68 81 ld r22, Y 1a278: 79 81 ldd r23, Y+1 ; 0x01 1a27a: 8a 81 ldd r24, Y+2 ; 0x02 1a27c: 9b 81 ldd r25, Y+3 ; 0x03 1a27e: c5 58 subi r28, 0x85 ; 133 1a280: d0 40 sbci r29, 0x00 ; 0 1a282: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1a286: 2b 01 movw r4, r22 1a288: 3c 01 movw r6, r24 1a28a: a5 01 movw r20, r10 1a28c: 94 01 movw r18, r8 1a28e: cb 56 subi r28, 0x6B ; 107 1a290: df 4f sbci r29, 0xFF ; 255 1a292: 68 81 ld r22, Y 1a294: 79 81 ldd r23, Y+1 ; 0x01 1a296: 8a 81 ldd r24, Y+2 ; 0x02 1a298: 9b 81 ldd r25, Y+3 ; 0x03 1a29a: c5 59 subi r28, 0x95 ; 149 1a29c: d0 40 sbci r29, 0x00 ; 0 1a29e: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1a2a2: 9b 01 movw r18, r22 1a2a4: ac 01 movw r20, r24 1a2a6: c3 01 movw r24, r6 1a2a8: b2 01 movw r22, r4 1a2aa: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1a2ae: 4b 01 movw r8, r22 1a2b0: 5c 01 movw r10, r24 1a2b2: a7 01 movw r20, r14 1a2b4: 96 01 movw r18, r12 1a2b6: c7 56 subi r28, 0x67 ; 103 1a2b8: df 4f sbci r29, 0xFF ; 255 1a2ba: 68 81 ld r22, Y 1a2bc: 79 81 ldd r23, Y+1 ; 0x01 1a2be: 8a 81 ldd r24, Y+2 ; 0x02 1a2c0: 9b 81 ldd r25, Y+3 ; 0x03 1a2c2: c9 59 subi r28, 0x99 ; 153 1a2c4: d0 40 sbci r29, 0x00 ; 0 1a2c6: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1a2ca: 9b 01 movw r18, r22 1a2cc: ac 01 movw r20, r24 1a2ce: c5 01 movw r24, r10 1a2d0: b4 01 movw r22, r8 1a2d2: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1a2d6: c3 57 subi r28, 0x73 ; 115 1a2d8: df 4f sbci r29, 0xFF ; 255 1a2da: 28 81 ld r18, Y 1a2dc: 39 81 ldd r19, Y+1 ; 0x01 1a2de: 4a 81 ldd r20, Y+2 ; 0x02 1a2e0: 5b 81 ldd r21, Y+3 ; 0x03 1a2e2: cd 58 subi r28, 0x8D ; 141 1a2e4: d0 40 sbci r29, 0x00 ; 0 1a2e6: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1a2ea: 2b 01 movw r4, r22 1a2ec: 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]; 1a2ee: cf 55 subi r28, 0x5F ; 95 1a2f0: df 4f sbci r29, 0xFF ; 255 1a2f2: 28 81 ld r18, Y 1a2f4: 39 81 ldd r19, Y+1 ; 0x01 1a2f6: 4a 81 ldd r20, Y+2 ; 0x02 1a2f8: 5b 81 ldd r21, Y+3 ; 0x03 1a2fa: c1 5a subi r28, 0xA1 ; 161 1a2fc: d0 40 sbci r29, 0x00 ; 0 1a2fe: 6e 96 adiw r28, 0x1e ; 30 1a300: 6c ad ldd r22, Y+60 ; 0x3c 1a302: 7d ad ldd r23, Y+61 ; 0x3d 1a304: 8e ad ldd r24, Y+62 ; 0x3e 1a306: 9f ad ldd r25, Y+63 ; 0x3f 1a308: 6e 97 sbiw r28, 0x1e ; 30 1a30a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1a30e: 9b 01 movw r18, r22 1a310: ac 01 movw r20, r24 1a312: c3 56 subi r28, 0x63 ; 99 1a314: df 4f sbci r29, 0xFF ; 255 1a316: 68 81 ld r22, Y 1a318: 79 81 ldd r23, Y+1 ; 0x01 1a31a: 8a 81 ldd r24, Y+2 ; 0x02 1a31c: 9b 81 ldd r25, Y+3 ; 0x03 1a31e: cd 59 subi r28, 0x9D ; 157 1a320: d0 40 sbci r29, 0x00 ; 0 1a322: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1a326: 4b 01 movw r8, r22 1a328: 5c 01 movw r10, r24 1a32a: cb 55 subi r28, 0x5B ; 91 1a32c: df 4f sbci r29, 0xFF ; 255 1a32e: 28 81 ld r18, Y 1a330: 39 81 ldd r19, Y+1 ; 0x01 1a332: 4a 81 ldd r20, Y+2 ; 0x02 1a334: 5b 81 ldd r21, Y+3 ; 0x03 1a336: c5 5a subi r28, 0xA5 ; 165 1a338: d0 40 sbci r29, 0x00 ; 0 1a33a: c3 01 movw r24, r6 1a33c: b2 01 movw r22, r4 1a33e: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1a342: 9b 01 movw r18, r22 1a344: ac 01 movw r20, r24 1a346: c5 01 movw r24, r10 1a348: b4 01 movw r22, r8 1a34a: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1a34e: 4b 01 movw r8, r22 1a350: 5c 01 movw r10, r24 1a352: a7 01 movw r20, r14 1a354: 96 01 movw r18, r12 1a356: cd 54 subi r28, 0x4D ; 77 1a358: df 4f sbci r29, 0xFF ; 255 1a35a: 68 81 ld r22, Y 1a35c: 79 81 ldd r23, Y+1 ; 0x01 1a35e: 8a 81 ldd r24, Y+2 ; 0x02 1a360: 9b 81 ldd r25, Y+3 ; 0x03 1a362: c3 5b subi r28, 0xB3 ; 179 1a364: d0 40 sbci r29, 0x00 ; 0 1a366: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1a36a: 9b 01 movw r18, r22 1a36c: ac 01 movw r20, r24 1a36e: c5 01 movw r24, r10 1a370: b4 01 movw r22, r8 1a372: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1a376: c9 54 subi r28, 0x49 ; 73 1a378: df 4f sbci r29, 0xFF ; 255 1a37a: 28 81 ld r18, Y 1a37c: 39 81 ldd r19, Y+1 ; 0x01 1a37e: 4a 81 ldd r20, Y+2 ; 0x02 1a380: 5b 81 ldd r21, Y+3 ; 0x03 1a382: c7 5b subi r28, 0xB7 ; 183 1a384: d0 40 sbci r29, 0x00 ; 0 1a386: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1a38a: 4b 01 movw r8, r22 1a38c: 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]; 1a38e: c1 54 subi r28, 0x41 ; 65 1a390: df 4f sbci r29, 0xFF ; 255 1a392: 28 81 ld r18, Y 1a394: 39 81 ldd r19, Y+1 ; 0x01 1a396: 4a 81 ldd r20, Y+2 ; 0x02 1a398: 5b 81 ldd r21, Y+3 ; 0x03 1a39a: cf 5b subi r28, 0xBF ; 191 1a39c: d0 40 sbci r29, 0x00 ; 0 1a39e: 6e 96 adiw r28, 0x1e ; 30 1a3a0: 6c ad ldd r22, Y+60 ; 0x3c 1a3a2: 7d ad ldd r23, Y+61 ; 0x3d 1a3a4: 8e ad ldd r24, Y+62 ; 0x3e 1a3a6: 9f ad ldd r25, Y+63 ; 0x3f 1a3a8: 6e 97 sbiw r28, 0x1e ; 30 1a3aa: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1a3ae: 9b 01 movw r18, r22 1a3b0: ac 01 movw r20, r24 1a3b2: c5 54 subi r28, 0x45 ; 69 1a3b4: df 4f sbci r29, 0xFF ; 255 1a3b6: 68 81 ld r22, Y 1a3b8: 79 81 ldd r23, Y+1 ; 0x01 1a3ba: 8a 81 ldd r24, Y+2 ; 0x02 1a3bc: 9b 81 ldd r25, Y+3 ; 0x03 1a3be: cb 5b subi r28, 0xBB ; 187 1a3c0: d0 40 sbci r29, 0x00 ; 0 1a3c2: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1a3c6: 6b 01 movw r12, r22 1a3c8: 7c 01 movw r14, r24 1a3ca: cd 53 subi r28, 0x3D ; 61 1a3cc: df 4f sbci r29, 0xFF ; 255 1a3ce: 28 81 ld r18, Y 1a3d0: 39 81 ldd r19, Y+1 ; 0x01 1a3d2: 4a 81 ldd r20, Y+2 ; 0x02 1a3d4: 5b 81 ldd r21, Y+3 ; 0x03 1a3d6: c3 5c subi r28, 0xC3 ; 195 1a3d8: d0 40 sbci r29, 0x00 ; 0 1a3da: c3 01 movw r24, r6 1a3dc: b2 01 movw r22, r4 1a3de: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1a3e2: 9b 01 movw r18, r22 1a3e4: ac 01 movw r20, r24 1a3e6: c7 01 movw r24, r14 1a3e8: b6 01 movw r22, r12 1a3ea: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1a3ee: 6b 01 movw r12, r22 1a3f0: 7c 01 movw r14, r24 1a3f2: c9 53 subi r28, 0x39 ; 57 1a3f4: df 4f sbci r29, 0xFF ; 255 1a3f6: 28 81 ld r18, Y 1a3f8: 39 81 ldd r19, Y+1 ; 0x01 1a3fa: 4a 81 ldd r20, Y+2 ; 0x02 1a3fc: 5b 81 ldd r21, Y+3 ; 0x03 1a3fe: c7 5c subi r28, 0xC7 ; 199 1a400: d0 40 sbci r29, 0x00 ; 0 1a402: c5 01 movw r24, r10 1a404: b4 01 movw r22, r8 1a406: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1a40a: 9b 01 movw r18, r22 1a40c: ac 01 movw r20, r24 1a40e: c7 01 movw r24, r14 1a410: b6 01 movw r22, r12 1a412: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1a416: c5 53 subi r28, 0x35 ; 53 1a418: df 4f sbci r29, 0xFF ; 255 1a41a: 28 81 ld r18, Y 1a41c: 39 81 ldd r19, Y+1 ; 0x01 1a41e: 4a 81 ldd r20, Y+2 ; 0x02 1a420: 5b 81 ldd r21, Y+3 ; 0x03 1a422: cb 5c subi r28, 0xCB ; 203 1a424: d0 40 sbci r29, 0x00 ; 0 1a426: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1a42a: 6b 01 movw r12, r22 1a42c: 7c 01 movw r14, r24 1a42e: 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) { 1a430: 09 f0 breq .+2 ; 0x1a434 1a432: c9 ce rjmp .-622 ; 0x1a1c6 // 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]; 1a434: 6e 96 adiw r28, 0x1e ; 30 1a436: 2c ad ldd r18, Y+60 ; 0x3c 1a438: 3d ad ldd r19, Y+61 ; 0x3d 1a43a: 4e ad ldd r20, Y+62 ; 0x3e 1a43c: 5f ad ldd r21, Y+63 ; 0x3f 1a43e: 6e 97 sbiw r28, 0x1e ; 30 1a440: c5 55 subi r28, 0x55 ; 85 1a442: df 4f sbci r29, 0xFF ; 255 1a444: 68 81 ld r22, Y 1a446: 79 81 ldd r23, Y+1 ; 0x01 1a448: 8a 81 ldd r24, Y+2 ; 0x02 1a44a: 9b 81 ldd r25, Y+3 ; 0x03 1a44c: cb 5a subi r28, 0xAB ; 171 1a44e: d0 40 sbci r29, 0x00 ; 0 1a450: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1a454: 60 93 cd 12 sts 0x12CD, r22 ; 0x8012cd 1a458: 70 93 ce 12 sts 0x12CE, r23 ; 0x8012ce 1a45c: 80 93 cf 12 sts 0x12CF, r24 ; 0x8012cf 1a460: 90 93 d0 12 sts 0x12D0, r25 ; 0x8012d0 cntr[1] += h[1]; 1a464: a3 01 movw r20, r6 1a466: 92 01 movw r18, r4 1a468: c1 55 subi r28, 0x51 ; 81 1a46a: df 4f sbci r29, 0xFF ; 255 1a46c: 68 81 ld r22, Y 1a46e: 79 81 ldd r23, Y+1 ; 0x01 1a470: 8a 81 ldd r24, Y+2 ; 0x02 1a472: 9b 81 ldd r25, Y+3 ; 0x03 1a474: cf 5a subi r28, 0xAF ; 175 1a476: d0 40 sbci r29, 0x00 ; 0 1a478: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1a47c: 60 93 d1 12 sts 0x12D1, r22 ; 0x8012d1 1a480: 70 93 d2 12 sts 0x12D2, r23 ; 0x8012d2 1a484: 80 93 d3 12 sts 0x12D3, r24 ; 0x8012d3 1a488: 90 93 d4 12 sts 0x12D4, r25 ; 0x8012d4 a1 += h[2]; 1a48c: a5 01 movw r20, r10 1a48e: 94 01 movw r18, r8 1a490: a6 96 adiw r28, 0x26 ; 38 1a492: 6c ad ldd r22, Y+60 ; 0x3c 1a494: 7d ad ldd r23, Y+61 ; 0x3d 1a496: 8e ad ldd r24, Y+62 ; 0x3e 1a498: 9f ad ldd r25, Y+63 ; 0x3f 1a49a: a6 97 sbiw r28, 0x26 ; 38 1a49c: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1a4a0: a6 96 adiw r28, 0x26 ; 38 1a4a2: 6c af std Y+60, r22 ; 0x3c 1a4a4: 7d af std Y+61, r23 ; 0x3d 1a4a6: 8e af std Y+62, r24 ; 0x3e 1a4a8: 9f af std Y+63, r25 ; 0x3f 1a4aa: a6 97 sbiw r28, 0x26 ; 38 a2 += h[3]; 1a4ac: a7 01 movw r20, r14 1a4ae: 96 01 movw r18, r12 1a4b0: a2 96 adiw r28, 0x22 ; 34 1a4b2: 6c ad ldd r22, Y+60 ; 0x3c 1a4b4: 7d ad ldd r23, Y+61 ; 0x3d 1a4b6: 8e ad ldd r24, Y+62 ; 0x3e 1a4b8: 9f ad ldd r25, Y+63 ; 0x3f 1a4ba: a2 97 sbiw r28, 0x22 ; 34 1a4bc: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1a4c0: a2 96 adiw r28, 0x22 ; 34 1a4c2: 6c af std Y+60, r22 ; 0x3c 1a4c4: 7d af std Y+61, r23 ; 0x3d 1a4c6: 8e af std Y+62, r24 ; 0x3e 1a4c8: 9f af std Y+63, r25 ; 0x3f 1a4ca: a2 97 sbiw r28, 0x22 ; 34 1a4cc: e6 96 adiw r28, 0x36 ; 54 1a4ce: 9f ad ldd r25, Y+63 ; 0x3f 1a4d0: e6 97 sbiw r28, 0x36 ; 54 1a4d2: 91 50 subi r25, 0x01 ; 1 1a4d4: e6 96 adiw r28, 0x36 ; 54 1a4d6: 9f af std Y+63, r25 ; 0x3f 1a4d8: 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) { 1a4da: 91 11 cpse r25, r1 1a4dc: 70 c9 rjmp .-3360 ; 0x197be SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 1a4de: a6 96 adiw r28, 0x26 ; 38 1a4e0: 6c ad ldd r22, Y+60 ; 0x3c 1a4e2: 7d ad ldd r23, Y+61 ; 0x3d 1a4e4: 8e ad ldd r24, Y+62 ; 0x3e 1a4e6: 9f ad ldd r25, Y+63 ; 0x3f 1a4e8: a6 97 sbiw r28, 0x26 ; 38 1a4ea: 0f 94 bd a2 call 0x3457a ; 0x3457a 1a4ee: 60 93 bd 12 sts 0x12BD, r22 ; 0x8012bd 1a4f2: 70 93 be 12 sts 0x12BE, r23 ; 0x8012be 1a4f6: 80 93 bf 12 sts 0x12BF, r24 ; 0x8012bf 1a4fa: 90 93 c0 12 sts 0x12C0, r25 ; 0x8012c0 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 1a4fe: a6 96 adiw r28, 0x26 ; 38 1a500: 6c ad ldd r22, Y+60 ; 0x3c 1a502: 7d ad ldd r23, Y+61 ; 0x3d 1a504: 8e ad ldd r24, Y+62 ; 0x3e 1a506: 9f ad ldd r25, Y+63 ; 0x3f 1a508: a6 97 sbiw r28, 0x26 ; 38 1a50a: 0f 94 83 a5 call 0x34b06 ; 0x34b06 1a50e: 60 93 c1 12 sts 0x12C1, r22 ; 0x8012c1 1a512: 70 93 c2 12 sts 0x12C2, r23 ; 0x8012c2 1a516: 80 93 c3 12 sts 0x12C3, r24 ; 0x8012c3 1a51a: 90 93 c4 12 sts 0x12C4, r25 ; 0x8012c4 vec_y[0] = -sin(a2) * MACHINE_AXIS_SCALE_Y; 1a51e: a2 96 adiw r28, 0x22 ; 34 1a520: 6c ad ldd r22, Y+60 ; 0x3c 1a522: 7d ad ldd r23, Y+61 ; 0x3d 1a524: 8e ad ldd r24, Y+62 ; 0x3e 1a526: 9f ad ldd r25, Y+63 ; 0x3f 1a528: a2 97 sbiw r28, 0x22 ; 34 1a52a: 0f 94 83 a5 call 0x34b06 ; 0x34b06 1a52e: 90 58 subi r25, 0x80 ; 128 1a530: 60 93 c5 12 sts 0x12C5, r22 ; 0x8012c5 1a534: 70 93 c6 12 sts 0x12C6, r23 ; 0x8012c6 1a538: 80 93 c7 12 sts 0x12C7, r24 ; 0x8012c7 1a53c: 90 93 c8 12 sts 0x12C8, r25 ; 0x8012c8 vec_y[1] = cos(a2) * MACHINE_AXIS_SCALE_Y; 1a540: a2 96 adiw r28, 0x22 ; 34 1a542: 6c ad ldd r22, Y+60 ; 0x3c 1a544: 7d ad ldd r23, Y+61 ; 0x3d 1a546: 8e ad ldd r24, Y+62 ; 0x3e 1a548: 9f ad ldd r25, Y+63 ; 0x3f 1a54a: a2 97 sbiw r28, 0x22 ; 34 1a54c: 0f 94 bd a2 call 0x3457a ; 0x3457a 1a550: 60 93 c9 12 sts 0x12C9, r22 ; 0x8012c9 1a554: 70 93 ca 12 sts 0x12CA, r23 ; 0x8012ca 1a558: 80 93 cb 12 sts 0x12CB, r24 ; 0x8012cb 1a55c: 90 93 cc 12 sts 0x12CC, r25 ; 0x8012cc BedSkewOffsetDetectionResultType result = BED_SKEW_OFFSET_DETECTION_PERFECT; { angleDiff = fabs(a2 - a1); 1a560: a6 96 adiw r28, 0x26 ; 38 1a562: 2c ad ldd r18, Y+60 ; 0x3c 1a564: 3d ad ldd r19, Y+61 ; 0x3d 1a566: 4e ad ldd r20, Y+62 ; 0x3e 1a568: 5f ad ldd r21, Y+63 ; 0x3f 1a56a: a6 97 sbiw r28, 0x26 ; 38 1a56c: a2 96 adiw r28, 0x22 ; 34 1a56e: 6c ad ldd r22, Y+60 ; 0x3c 1a570: 7d ad ldd r23, Y+61 ; 0x3d 1a572: 8e ad ldd r24, Y+62 ; 0x3e 1a574: 9f ad ldd r25, Y+63 ; 0x3f 1a576: a2 97 sbiw r28, 0x22 ; 34 1a578: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1a57c: 4b 01 movw r8, r22 1a57e: 5c 01 movw r10, r24 1a580: 7c 01 movw r14, r24 1a582: 6b 01 movw r12, r22 1a584: e8 94 clt 1a586: f7 f8 bld r15, 7 /// XY skew and Y-bed skew DBG(_n("Measured skews: %f %f\n"), degrees(a2 - a1), degrees(a2)); 1a588: 21 ee ldi r18, 0xE1 ; 225 1a58a: 3e e2 ldi r19, 0x2E ; 46 1a58c: 45 e6 ldi r20, 0x65 ; 101 1a58e: 52 e4 ldi r21, 0x42 ; 66 1a590: a2 96 adiw r28, 0x22 ; 34 1a592: 6c ad ldd r22, Y+60 ; 0x3c 1a594: 7d ad ldd r23, Y+61 ; 0x3d 1a596: 8e ad ldd r24, Y+62 ; 0x3e 1a598: 9f ad ldd r25, Y+63 ; 0x3f 1a59a: a2 97 sbiw r28, 0x22 ; 34 1a59c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1a5a0: 9f 93 push r25 1a5a2: 8f 93 push r24 1a5a4: 7f 93 push r23 1a5a6: 6f 93 push r22 1a5a8: 21 ee ldi r18, 0xE1 ; 225 1a5aa: 3e e2 ldi r19, 0x2E ; 46 1a5ac: 45 e6 ldi r20, 0x65 ; 101 1a5ae: 52 e4 ldi r21, 0x42 ; 66 1a5b0: c5 01 movw r24, r10 1a5b2: b4 01 movw r22, r8 1a5b4: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1a5b8: 9f 93 push r25 1a5ba: 8f 93 push r24 1a5bc: 7f 93 push r23 1a5be: 6f 93 push r22 1a5c0: 8d e3 ldi r24, 0x3D ; 61 1a5c2: 99 e6 ldi r25, 0x69 ; 105 1a5c4: 9f 93 push r25 1a5c6: 8f 93 push r24 1a5c8: 0f 94 5d 9f call 0x33eba ; 0x33eba if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 1a5cc: b7 01 movw r22, r14 1a5ce: a6 01 movw r20, r12 1a5d0: 80 e6 ldi r24, 0x60 ; 96 1a5d2: 9f e0 ldi r25, 0x0F ; 15 1a5d4: 0f 94 d1 a0 call 0x341a2 ; 0x341a2 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) 1a5d8: 0f b6 in r0, 0x3f ; 63 1a5da: f8 94 cli 1a5dc: de bf out 0x3e, r29 ; 62 1a5de: 0f be out 0x3f, r0 ; 63 1a5e0: cd bf out 0x3d, r28 ; 61 1a5e2: 2f e1 ldi r18, 0x1F ; 31 1a5e4: 32 e4 ldi r19, 0x42 ; 66 1a5e6: 49 e0 ldi r20, 0x09 ; 9 1a5e8: 5b e3 ldi r21, 0x3B ; 59 1a5ea: c7 01 movw r24, r14 1a5ec: b6 01 movw r22, r12 1a5ee: 0f 94 4c a4 call 0x34898 ; 0x34898 <__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; 1a5f2: 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) 1a5f4: 18 16 cp r1, r24 1a5f6: 64 f4 brge .+24 ; 0x1a610 result = (angleDiff > bed_skew_angle_extreme) ? 1a5f8: 25 e3 ldi r18, 0x35 ; 53 1a5fa: 3a ef ldi r19, 0xFA ; 250 1a5fc: 4e e8 ldi r20, 0x8E ; 142 1a5fe: 5b e3 ldi r21, 0x3B ; 59 1a600: c7 01 movw r24, r14 1a602: b6 01 movw r22, r12 1a604: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 1a608: 12 e0 ldi r17, 0x02 ; 2 1a60a: 18 16 cp r1, r24 1a60c: 0c f0 brlt .+2 ; 0x1a610 1a60e: 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 || 1a610: 25 e3 ldi r18, 0x35 ; 53 1a612: 3a ef ldi r19, 0xFA ; 250 1a614: 4e e8 ldi r20, 0x8E ; 142 1a616: 5b e3 ldi r21, 0x3B ; 59 1a618: a6 96 adiw r28, 0x26 ; 38 1a61a: 6c ad ldd r22, Y+60 ; 0x3c 1a61c: 7d ad ldd r23, Y+61 ; 0x3d 1a61e: 8e ad ldd r24, Y+62 ; 0x3e 1a620: 9f ad ldd r25, Y+63 ; 0x3f 1a622: a6 97 sbiw r28, 0x26 ; 38 1a624: 9f 77 andi r25, 0x7F ; 127 1a626: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 1a62a: 18 16 cp r1, r24 1a62c: 0c f4 brge .+2 ; 0x1a630 1a62e: 67 c4 rjmp .+2254 ; 0x1aefe 1a630: 25 e3 ldi r18, 0x35 ; 53 1a632: 3a ef ldi r19, 0xFA ; 250 1a634: 4e e8 ldi r20, 0x8E ; 142 1a636: 5b e3 ldi r21, 0x3B ; 59 1a638: a2 96 adiw r28, 0x22 ; 34 1a63a: 6c ad ldd r22, Y+60 ; 0x3c 1a63c: 7d ad ldd r23, Y+61 ; 0x3d 1a63e: 8e ad ldd r24, Y+62 ; 0x3e 1a640: 9f ad ldd r25, Y+63 ; 0x3f 1a642: a2 97 sbiw r28, 0x22 ; 34 1a644: 9f 77 andi r25, 0x7F ; 127 1a646: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 1a64a: 18 16 cp r1, r24 1a64c: 0c f4 brge .+2 ; 0x1a650 1a64e: 57 c4 rjmp .+2222 ; 0x1aefe 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]; 1a650: 20 91 bd 12 lds r18, 0x12BD ; 0x8012bd 1a654: 30 91 be 12 lds r19, 0x12BE ; 0x8012be 1a658: 40 91 bf 12 lds r20, 0x12BF ; 0x8012bf 1a65c: 50 91 c0 12 lds r21, 0x12C0 ; 0x8012c0 1a660: ae 96 adiw r28, 0x2e ; 46 1a662: 2c af std Y+60, r18 ; 0x3c 1a664: 3d af std Y+61, r19 ; 0x3d 1a666: 4e af std Y+62, r20 ; 0x3e 1a668: 5f af std Y+63, r21 ; 0x3f 1a66a: ae 97 sbiw r28, 0x2e ; 46 1a66c: 80 91 c5 12 lds r24, 0x12C5 ; 0x8012c5 1a670: 90 91 c6 12 lds r25, 0x12C6 ; 0x8012c6 1a674: a0 91 c7 12 lds r26, 0x12C7 ; 0x8012c7 1a678: b0 91 c8 12 lds r27, 0x12C8 ; 0x8012c8 1a67c: e9 96 adiw r28, 0x39 ; 57 1a67e: 8c af std Y+60, r24 ; 0x3c 1a680: 9d af std Y+61, r25 ; 0x3d 1a682: ae af std Y+62, r26 ; 0x3e 1a684: bf af std Y+63, r27 ; 0x3f 1a686: e9 97 sbiw r28, 0x39 ; 57 1a688: 20 91 cd 12 lds r18, 0x12CD ; 0x8012cd 1a68c: 30 91 ce 12 lds r19, 0x12CE ; 0x8012ce 1a690: 40 91 cf 12 lds r20, 0x12CF ; 0x8012cf 1a694: 50 91 d0 12 lds r21, 0x12D0 ; 0x8012d0 1a698: e4 96 adiw r28, 0x34 ; 52 1a69a: 2c af std Y+60, r18 ; 0x3c 1a69c: 3d af std Y+61, r19 ; 0x3d 1a69e: 4e af std Y+62, r20 ; 0x3e 1a6a0: 5f af std Y+63, r21 ; 0x3f 1a6a2: 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]; 1a6a4: 80 91 c1 12 lds r24, 0x12C1 ; 0x8012c1 1a6a8: 90 91 c2 12 lds r25, 0x12C2 ; 0x8012c2 1a6ac: a0 91 c3 12 lds r26, 0x12C3 ; 0x8012c3 1a6b0: b0 91 c4 12 lds r27, 0x12C4 ; 0x8012c4 1a6b4: ed 96 adiw r28, 0x3d ; 61 1a6b6: 8c af std Y+60, r24 ; 0x3c 1a6b8: 9d af std Y+61, r25 ; 0x3d 1a6ba: ae af std Y+62, r26 ; 0x3e 1a6bc: bf af std Y+63, r27 ; 0x3f 1a6be: ed 97 sbiw r28, 0x3d ; 61 1a6c0: 20 91 c9 12 lds r18, 0x12C9 ; 0x8012c9 1a6c4: 30 91 ca 12 lds r19, 0x12CA ; 0x8012ca 1a6c8: 40 91 cb 12 lds r20, 0x12CB ; 0x8012cb 1a6cc: 50 91 cc 12 lds r21, 0x12CC ; 0x8012cc 1a6d0: c3 58 subi r28, 0x83 ; 131 1a6d2: df 4f sbci r29, 0xFF ; 255 1a6d4: 28 83 st Y, r18 1a6d6: 39 83 std Y+1, r19 ; 0x01 1a6d8: 4a 83 std Y+2, r20 ; 0x02 1a6da: 5b 83 std Y+3, r21 ; 0x03 1a6dc: cd 57 subi r28, 0x7D ; 125 1a6de: d0 40 sbci r29, 0x00 ; 0 1a6e0: 80 91 d1 12 lds r24, 0x12D1 ; 0x8012d1 1a6e4: 90 91 d2 12 lds r25, 0x12D2 ; 0x8012d2 1a6e8: a0 91 d3 12 lds r26, 0x12D3 ; 0x8012d3 1a6ec: b0 91 d4 12 lds r27, 0x12D4 ; 0x8012d4 1a6f0: cf 57 subi r28, 0x7F ; 127 1a6f2: df 4f sbci r29, 0xFF ; 255 1a6f4: 88 83 st Y, r24 1a6f6: 99 83 std Y+1, r25 ; 0x01 1a6f8: aa 83 std Y+2, r26 ; 0x02 1a6fa: bb 83 std Y+3, r27 ; 0x03 1a6fc: c1 58 subi r28, 0x81 ; 129 1a6fe: d0 40 sbci r29, 0x00 ; 0 1a700: ac e4 ldi r26, 0x4C ; 76 1a702: b8 e8 ldi r27, 0x88 ; 136 1a704: 6c 96 adiw r28, 0x1c ; 28 1a706: bf af std Y+63, r27 ; 0x3f 1a708: ae af std Y+62, r26 ; 0x3e 1a70a: 6c 97 sbiw r28, 0x1c ; 28 1a70c: 8c e9 ldi r24, 0x9C ; 156 1a70e: 28 2e mov r2, r24 1a710: 82 e1 ldi r24, 0x12 ; 18 1a712: 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]; 1a714: f1 01 movw r30, r2 1a716: c1 80 ldd r12, Z+1 ; 0x01 1a718: d2 80 ldd r13, Z+2 ; 0x02 1a71a: e3 80 ldd r14, Z+3 ; 0x03 1a71c: f4 80 ldd r15, Z+4 ; 0x04 1a71e: 45 80 ldd r4, Z+5 ; 0x05 1a720: 56 80 ldd r5, Z+6 ; 0x06 1a722: 67 80 ldd r6, Z+7 ; 0x07 1a724: 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; 1a726: 6c 96 adiw r28, 0x1c ; 28 1a728: ee ad ldd r30, Y+62 ; 0x3e 1a72a: ff ad ldd r31, Y+63 ; 0x3f 1a72c: 6c 97 sbiw r28, 0x1c ; 28 1a72e: 25 91 lpm r18, Z+ 1a730: 35 91 lpm r19, Z+ 1a732: 45 91 lpm r20, Z+ 1a734: 54 91 lpm r21, Z 1a736: cb 57 subi r28, 0x7B ; 123 1a738: df 4f sbci r29, 0xFF ; 255 1a73a: 28 83 st Y, r18 1a73c: 39 83 std Y+1, r19 ; 0x01 1a73e: 4a 83 std Y+2, r20 ; 0x02 1a740: 5b 83 std Y+3, r21 ; 0x03 1a742: c5 58 subi r28, 0x85 ; 133 1a744: d0 40 sbci r29, 0x00 ; 0 float errY = pgm_read_float(true_pts + i * 2 + 1) - y; 1a746: 6c 96 adiw r28, 0x1c ; 28 1a748: ee ad ldd r30, Y+62 ; 0x3e 1a74a: ff ad ldd r31, Y+63 ; 0x3f 1a74c: 6c 97 sbiw r28, 0x1c ; 28 1a74e: 34 96 adiw r30, 0x04 ; 4 1a750: 85 90 lpm r8, Z+ 1a752: 95 90 lpm r9, Z+ 1a754: a5 90 lpm r10, Z+ 1a756: 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]; 1a758: ed 96 adiw r28, 0x3d ; 61 1a75a: 2c ad ldd r18, Y+60 ; 0x3c 1a75c: 3d ad ldd r19, Y+61 ; 0x3d 1a75e: 4e ad ldd r20, Y+62 ; 0x3e 1a760: 5f ad ldd r21, Y+63 ; 0x3f 1a762: ed 97 sbiw r28, 0x3d ; 61 1a764: c7 01 movw r24, r14 1a766: b6 01 movw r22, r12 1a768: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1a76c: c7 57 subi r28, 0x77 ; 119 1a76e: df 4f sbci r29, 0xFF ; 255 1a770: 68 83 st Y, r22 1a772: 79 83 std Y+1, r23 ; 0x01 1a774: 8a 83 std Y+2, r24 ; 0x02 1a776: 9b 83 std Y+3, r25 ; 0x03 1a778: c9 58 subi r28, 0x89 ; 137 1a77a: d0 40 sbci r29, 0x00 ; 0 1a77c: c3 58 subi r28, 0x83 ; 131 1a77e: df 4f sbci r29, 0xFF ; 255 1a780: 28 81 ld r18, Y 1a782: 39 81 ldd r19, Y+1 ; 0x01 1a784: 4a 81 ldd r20, Y+2 ; 0x02 1a786: 5b 81 ldd r21, Y+3 ; 0x03 1a788: cd 57 subi r28, 0x7D ; 125 1a78a: d0 40 sbci r29, 0x00 ; 0 1a78c: c3 01 movw r24, r6 1a78e: b2 01 movw r22, r4 1a790: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1a794: 9b 01 movw r18, r22 1a796: ac 01 movw r20, r24 1a798: c7 57 subi r28, 0x77 ; 119 1a79a: df 4f sbci r29, 0xFF ; 255 1a79c: 68 81 ld r22, Y 1a79e: 79 81 ldd r23, Y+1 ; 0x01 1a7a0: 8a 81 ldd r24, Y+2 ; 0x02 1a7a2: 9b 81 ldd r25, Y+3 ; 0x03 1a7a4: c9 58 subi r28, 0x89 ; 137 1a7a6: d0 40 sbci r29, 0x00 ; 0 1a7a8: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1a7ac: cf 57 subi r28, 0x7F ; 127 1a7ae: df 4f sbci r29, 0xFF ; 255 1a7b0: 28 81 ld r18, Y 1a7b2: 39 81 ldd r19, Y+1 ; 0x01 1a7b4: 4a 81 ldd r20, Y+2 ; 0x02 1a7b6: 5b 81 ldd r21, Y+3 ; 0x03 1a7b8: c1 58 subi r28, 0x81 ; 129 1a7ba: d0 40 sbci r29, 0x00 ; 0 1a7bc: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1a7c0: 9b 01 movw r18, r22 1a7c2: 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; 1a7c4: c5 01 movw r24, r10 1a7c6: b4 01 movw r22, r8 1a7c8: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1a7cc: 4b 01 movw r8, r22 1a7ce: 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]; 1a7d0: a7 01 movw r20, r14 1a7d2: 96 01 movw r18, r12 1a7d4: ae 96 adiw r28, 0x2e ; 46 1a7d6: 6c ad ldd r22, Y+60 ; 0x3c 1a7d8: 7d ad ldd r23, Y+61 ; 0x3d 1a7da: 8e ad ldd r24, Y+62 ; 0x3e 1a7dc: 9f ad ldd r25, Y+63 ; 0x3f 1a7de: ae 97 sbiw r28, 0x2e ; 46 1a7e0: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1a7e4: 6b 01 movw r12, r22 1a7e6: 7c 01 movw r14, r24 1a7e8: a3 01 movw r20, r6 1a7ea: 92 01 movw r18, r4 1a7ec: e9 96 adiw r28, 0x39 ; 57 1a7ee: 6c ad ldd r22, Y+60 ; 0x3c 1a7f0: 7d ad ldd r23, Y+61 ; 0x3d 1a7f2: 8e ad ldd r24, Y+62 ; 0x3e 1a7f4: 9f ad ldd r25, Y+63 ; 0x3f 1a7f6: e9 97 sbiw r28, 0x39 ; 57 1a7f8: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1a7fc: 9b 01 movw r18, r22 1a7fe: ac 01 movw r20, r24 1a800: c7 01 movw r24, r14 1a802: b6 01 movw r22, r12 1a804: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1a808: e4 96 adiw r28, 0x34 ; 52 1a80a: 2c ad ldd r18, Y+60 ; 0x3c 1a80c: 3d ad ldd r19, Y+61 ; 0x3d 1a80e: 4e ad ldd r20, Y+62 ; 0x3e 1a810: 5f ad ldd r21, Y+63 ; 0x3f 1a812: e4 97 sbiw r28, 0x34 ; 52 1a814: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1a818: 9b 01 movw r18, r22 1a81a: 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; 1a81c: cb 57 subi r28, 0x7B ; 123 1a81e: df 4f sbci r29, 0xFF ; 255 1a820: 68 81 ld r22, Y 1a822: 79 81 ldd r23, Y+1 ; 0x01 1a824: 8a 81 ldd r24, Y+2 ; 0x02 1a826: 9b 81 ldd r25, Y+3 ; 0x03 1a828: c5 58 subi r28, 0x85 ; 133 1a82a: d0 40 sbci r29, 0x00 ; 0 1a82c: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> float errY = pgm_read_float(true_pts + i * 2 + 1) - y; float err = hypot(errX, errY); 1a830: a5 01 movw r20, r10 1a832: 94 01 movw r18, r8 1a834: 0f 94 5f a4 call 0x348be ; 0x348be } 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) { 1a838: 2d ec ldi r18, 0xCD ; 205 1a83a: 3c ec ldi r19, 0xCC ; 204 1a83c: 4c e4 ldi r20, 0x4C ; 76 1a83e: 5f e3 ldi r21, 0x3F ; 63 1a840: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 1a844: 18 16 cp r1, r24 1a846: 0c f4 brge .+2 ; 0x1a84a result = BED_SKEW_OFFSET_DETECTION_FITTING_FAILED; 1a848: 1e ef ldi r17, 0xFE ; 254 1a84a: 38 e0 ldi r19, 0x08 ; 8 1a84c: 23 0e add r2, r19 1a84e: 31 1c adc r3, r1 1a850: 6c 96 adiw r28, 0x1c ; 28 1a852: 4e ad ldd r20, Y+62 ; 0x3e 1a854: 5f ad ldd r21, Y+63 ; 0x3f 1a856: 6c 97 sbiw r28, 0x1c ; 28 1a858: 48 5f subi r20, 0xF8 ; 248 1a85a: 5f 4f sbci r21, 0xFF ; 255 1a85c: 6c 96 adiw r28, 0x1c ; 28 1a85e: 5f af std Y+63, r21 ; 0x3f 1a860: 4e af std Y+62, r20 ; 0x3e 1a862: 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) { 1a864: a8 96 adiw r28, 0x28 ; 40 1a866: 8e ad ldd r24, Y+62 ; 0x3e 1a868: 9f ad ldd r25, Y+63 ; 0x3f 1a86a: a8 97 sbiw r28, 0x28 ; 40 1a86c: 82 15 cp r24, r2 1a86e: 93 05 cpc r25, r3 1a870: 09 f0 breq .+2 ; 0x1a874 1a872: 50 cf rjmp .-352 ; 0x1a714 MYSERIAL.println(BED_CALIBRATION_POINT_OFFSET_MAX_EUCLIDIAN); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY if (result == BED_SKEW_OFFSET_DETECTION_PERFECT) { 1a874: 11 11 cpse r17, r1 1a876: 62 c1 rjmp .+708 ; 0x1ab3c #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); 1a878: a2 96 adiw r28, 0x22 ; 34 1a87a: 2c ad ldd r18, Y+60 ; 0x3c 1a87c: 3d ad ldd r19, Y+61 ; 0x3d 1a87e: 4e ad ldd r20, Y+62 ; 0x3e 1a880: 5f ad ldd r21, Y+63 ; 0x3f 1a882: a2 97 sbiw r28, 0x22 ; 34 1a884: a6 96 adiw r28, 0x26 ; 38 1a886: 6c ad ldd r22, Y+60 ; 0x3c 1a888: 7d ad ldd r23, Y+61 ; 0x3d 1a88a: 8e ad ldd r24, Y+62 ; 0x3e 1a88c: 9f ad ldd r25, Y+63 ; 0x3f 1a88e: a6 97 sbiw r28, 0x26 ; 38 1a890: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1a894: 20 e0 ldi r18, 0x00 ; 0 1a896: 30 e0 ldi r19, 0x00 ; 0 1a898: 40 e0 ldi r20, 0x00 ; 0 1a89a: 5f e3 ldi r21, 0x3F ; 63 1a89c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1a8a0: 6b 01 movw r12, r22 1a8a2: 7c 01 movw r14, r24 vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 1a8a4: 0f 94 bd a2 call 0x3457a ; 0x3457a 1a8a8: a2 96 adiw r28, 0x22 ; 34 1a8aa: 6c af std Y+60, r22 ; 0x3c 1a8ac: 7d af std Y+61, r23 ; 0x3d 1a8ae: 8e af std Y+62, r24 ; 0x3e 1a8b0: 9f af std Y+63, r25 ; 0x3f 1a8b2: a2 97 sbiw r28, 0x22 ; 34 1a8b4: 60 93 bd 12 sts 0x12BD, r22 ; 0x8012bd 1a8b8: 70 93 be 12 sts 0x12BE, r23 ; 0x8012be 1a8bc: 80 93 bf 12 sts 0x12BF, r24 ; 0x8012bf 1a8c0: 90 93 c0 12 sts 0x12C0, r25 ; 0x8012c0 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 1a8c4: c7 01 movw r24, r14 1a8c6: b6 01 movw r22, r12 1a8c8: 0f 94 83 a5 call 0x34b06 ; 0x34b06 1a8cc: a6 96 adiw r28, 0x26 ; 38 1a8ce: 6c af std Y+60, r22 ; 0x3c 1a8d0: 7d af std Y+61, r23 ; 0x3d 1a8d2: 8e af std Y+62, r24 ; 0x3e 1a8d4: 9f af std Y+63, r25 ; 0x3f 1a8d6: a6 97 sbiw r28, 0x26 ; 38 1a8d8: 60 93 c1 12 sts 0x12C1, r22 ; 0x8012c1 1a8dc: 70 93 c2 12 sts 0x12C2, r23 ; 0x8012c2 1a8e0: 80 93 c3 12 sts 0x12C3, r24 ; 0x8012c3 1a8e4: 90 93 c4 12 sts 0x12C4, r25 ; 0x8012c4 vec_y[0] = -sin(a1) * MACHINE_AXIS_SCALE_Y; 1a8e8: 9b 01 movw r18, r22 1a8ea: ac 01 movw r20, r24 1a8ec: 50 58 subi r21, 0x80 ; 128 1a8ee: aa 96 adiw r28, 0x2a ; 42 1a8f0: 2c af std Y+60, r18 ; 0x3c 1a8f2: 3d af std Y+61, r19 ; 0x3d 1a8f4: 4e af std Y+62, r20 ; 0x3e 1a8f6: 5f af std Y+63, r21 ; 0x3f 1a8f8: aa 97 sbiw r28, 0x2a ; 42 1a8fa: 20 93 c5 12 sts 0x12C5, r18 ; 0x8012c5 1a8fe: 30 93 c6 12 sts 0x12C6, r19 ; 0x8012c6 1a902: 40 93 c7 12 sts 0x12C7, r20 ; 0x8012c7 1a906: 50 93 c8 12 sts 0x12C8, r21 ; 0x8012c8 vec_y[1] = cos(a1) * MACHINE_AXIS_SCALE_Y; 1a90a: a2 96 adiw r28, 0x22 ; 34 1a90c: 8c ad ldd r24, Y+60 ; 0x3c 1a90e: 9d ad ldd r25, Y+61 ; 0x3d 1a910: ae ad ldd r26, Y+62 ; 0x3e 1a912: bf ad ldd r27, Y+63 ; 0x3f 1a914: a2 97 sbiw r28, 0x22 ; 34 1a916: 80 93 c9 12 sts 0x12C9, r24 ; 0x8012c9 1a91a: 90 93 ca 12 sts 0x12CA, r25 ; 0x8012ca 1a91e: a0 93 cb 12 sts 0x12CB, r26 ; 0x8012cb 1a922: b0 93 cc 12 sts 0x12CC, r27 ; 0x8012cc // Refresh the offset. cntr[0] = 0.f; 1a926: 10 92 cd 12 sts 0x12CD, r1 ; 0x8012cd 1a92a: 10 92 ce 12 sts 0x12CE, r1 ; 0x8012ce 1a92e: 10 92 cf 12 sts 0x12CF, r1 ; 0x8012cf 1a932: 10 92 d0 12 sts 0x12D0, r1 ; 0x8012d0 cntr[1] = 0.f; 1a936: 10 92 d1 12 sts 0x12D1, r1 ; 0x8012d1 1a93a: 10 92 d2 12 sts 0x12D2, r1 ; 0x8012d2 1a93e: 10 92 d3 12 sts 0x12D3, r1 ; 0x8012d3 1a942: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 float wx = 0.f; 1a946: 41 2c mov r4, r1 1a948: 51 2c mov r5, r1 1a94a: 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]; 1a94c: cf 56 subi r28, 0x6F ; 111 1a94e: df 4f sbci r29, 0xFF ; 255 1a950: a8 81 ld r26, Y 1a952: b9 81 ldd r27, Y+1 ; 0x01 1a954: c1 59 subi r28, 0x91 ; 145 1a956: d0 40 sbci r29, 0x00 ; 0 1a958: 11 96 adiw r26, 0x01 ; 1 1a95a: 8d 90 ld r8, X+ 1a95c: 9d 90 ld r9, X+ 1a95e: ad 90 ld r10, X+ 1a960: bc 90 ld r11, X 1a962: 14 97 sbiw r26, 0x04 ; 4 1a964: 15 96 adiw r26, 0x05 ; 5 1a966: 2d 91 ld r18, X+ 1a968: 3d 91 ld r19, X+ 1a96a: 4d 91 ld r20, X+ 1a96c: 5c 91 ld r21, X 1a96e: 18 97 sbiw r26, 0x08 ; 8 1a970: 6e 96 adiw r28, 0x1e ; 30 1a972: 2c af std Y+60, r18 ; 0x3c 1a974: 3d af std Y+61, r19 ; 0x3d 1a976: 4e af std Y+62, r20 ; 0x3e 1a978: 5f af std Y+63, r21 ; 0x3f 1a97a: 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); 1a97c: cd 56 subi r28, 0x6D ; 109 1a97e: df 4f sbci r29, 0xFF ; 255 1a980: e8 81 ld r30, Y 1a982: f9 81 ldd r31, Y+1 ; 0x01 1a984: c3 59 subi r28, 0x93 ; 147 1a986: d0 40 sbci r29, 0x00 ; 0 1a988: c5 90 lpm r12, Z+ 1a98a: d5 90 lpm r13, Z+ 1a98c: e5 90 lpm r14, Z+ 1a98e: 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]; 1a990: a5 01 movw r20, r10 1a992: 94 01 movw r18, r8 1a994: a2 96 adiw r28, 0x22 ; 34 1a996: 6c ad ldd r22, Y+60 ; 0x3c 1a998: 7d ad ldd r23, Y+61 ; 0x3d 1a99a: 8e ad ldd r24, Y+62 ; 0x3e 1a99c: 9f ad ldd r25, Y+63 ; 0x3f 1a99e: a2 97 sbiw r28, 0x22 ; 34 1a9a0: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1a9a4: ae 96 adiw r28, 0x2e ; 46 1a9a6: 6c af std Y+60, r22 ; 0x3c 1a9a8: 7d af std Y+61, r23 ; 0x3d 1a9aa: 8e af std Y+62, r24 ; 0x3e 1a9ac: 9f af std Y+63, r25 ; 0x3f 1a9ae: ae 97 sbiw r28, 0x2e ; 46 1a9b0: 6e 96 adiw r28, 0x1e ; 30 1a9b2: 2c ad ldd r18, Y+60 ; 0x3c 1a9b4: 3d ad ldd r19, Y+61 ; 0x3d 1a9b6: 4e ad ldd r20, Y+62 ; 0x3e 1a9b8: 5f ad ldd r21, Y+63 ; 0x3f 1a9ba: 6e 97 sbiw r28, 0x1e ; 30 1a9bc: aa 96 adiw r28, 0x2a ; 42 1a9be: 6c ad ldd r22, Y+60 ; 0x3c 1a9c0: 7d ad ldd r23, Y+61 ; 0x3d 1a9c2: 8e ad ldd r24, Y+62 ; 0x3e 1a9c4: 9f ad ldd r25, Y+63 ; 0x3f 1a9c6: aa 97 sbiw r28, 0x2a ; 42 1a9c8: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1a9cc: 9b 01 movw r18, r22 1a9ce: ac 01 movw r20, r24 1a9d0: ae 96 adiw r28, 0x2e ; 46 1a9d2: 6c ad ldd r22, Y+60 ; 0x3c 1a9d4: 7d ad ldd r23, Y+61 ; 0x3d 1a9d6: 8e ad ldd r24, Y+62 ; 0x3e 1a9d8: 9f ad ldd r25, Y+63 ; 0x3f 1a9da: ae 97 sbiw r28, 0x2e ; 46 1a9dc: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1a9e0: 9b 01 movw r18, r22 1a9e2: 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); 1a9e4: c7 01 movw r24, r14 1a9e6: b6 01 movw r22, r12 1a9e8: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1a9ec: 20 91 cd 12 lds r18, 0x12CD ; 0x8012cd 1a9f0: 30 91 ce 12 lds r19, 0x12CE ; 0x8012ce 1a9f4: 40 91 cf 12 lds r20, 0x12CF ; 0x8012cf 1a9f8: 50 91 d0 12 lds r21, 0x12D0 ; 0x8012d0 1a9fc: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1aa00: 6b 01 movw r12, r22 1aa02: 7c 01 movw r14, r24 1aa04: c0 92 cd 12 sts 0x12CD, r12 ; 0x8012cd 1aa08: d0 92 ce 12 sts 0x12CE, r13 ; 0x8012ce 1aa0c: e0 92 cf 12 sts 0x12CF, r14 ; 0x8012cf 1aa10: f0 92 d0 12 sts 0x12D0, r15 ; 0x8012d0 wx += w; 1aa14: 20 e0 ldi r18, 0x00 ; 0 1aa16: 30 e0 ldi r19, 0x00 ; 0 1aa18: 40 e8 ldi r20, 0x80 ; 128 1aa1a: 5f e3 ldi r21, 0x3F ; 63 1aa1c: c3 01 movw r24, r6 1aa1e: b2 01 movw r22, r4 1aa20: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1aa24: 2b 01 movw r4, r22 1aa26: 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); 1aa28: cd 56 subi r28, 0x6D ; 109 1aa2a: df 4f sbci r29, 0xFF ; 255 1aa2c: e8 81 ld r30, Y 1aa2e: f9 81 ldd r31, Y+1 ; 0x01 1aa30: c3 59 subi r28, 0x93 ; 147 1aa32: d0 40 sbci r29, 0x00 ; 0 1aa34: 34 96 adiw r30, 0x04 ; 4 1aa36: 25 91 lpm r18, Z+ 1aa38: 35 91 lpm r19, Z+ 1aa3a: 45 91 lpm r20, Z+ 1aa3c: 54 91 lpm r21, Z 1aa3e: ae 96 adiw r28, 0x2e ; 46 1aa40: 2c af std Y+60, r18 ; 0x3c 1aa42: 3d af std Y+61, r19 ; 0x3d 1aa44: 4e af std Y+62, r20 ; 0x3e 1aa46: 5f af std Y+63, r21 ; 0x3f 1aa48: 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]; 1aa4a: a5 01 movw r20, r10 1aa4c: 94 01 movw r18, r8 1aa4e: a6 96 adiw r28, 0x26 ; 38 1aa50: 6c ad ldd r22, Y+60 ; 0x3c 1aa52: 7d ad ldd r23, Y+61 ; 0x3d 1aa54: 8e ad ldd r24, Y+62 ; 0x3e 1aa56: 9f ad ldd r25, Y+63 ; 0x3f 1aa58: a6 97 sbiw r28, 0x26 ; 38 1aa5a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1aa5e: 4b 01 movw r8, r22 1aa60: 5c 01 movw r10, r24 1aa62: 6e 96 adiw r28, 0x1e ; 30 1aa64: 2c ad ldd r18, Y+60 ; 0x3c 1aa66: 3d ad ldd r19, Y+61 ; 0x3d 1aa68: 4e ad ldd r20, Y+62 ; 0x3e 1aa6a: 5f ad ldd r21, Y+63 ; 0x3f 1aa6c: 6e 97 sbiw r28, 0x1e ; 30 1aa6e: a2 96 adiw r28, 0x22 ; 34 1aa70: 6c ad ldd r22, Y+60 ; 0x3c 1aa72: 7d ad ldd r23, Y+61 ; 0x3d 1aa74: 8e ad ldd r24, Y+62 ; 0x3e 1aa76: 9f ad ldd r25, Y+63 ; 0x3f 1aa78: a2 97 sbiw r28, 0x22 ; 34 1aa7a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1aa7e: 9b 01 movw r18, r22 1aa80: ac 01 movw r20, r24 1aa82: c5 01 movw r24, r10 1aa84: b4 01 movw r22, r8 1aa86: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1aa8a: 9b 01 movw r18, r22 1aa8c: 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); 1aa8e: ae 96 adiw r28, 0x2e ; 46 1aa90: 6c ad ldd r22, Y+60 ; 0x3c 1aa92: 7d ad ldd r23, Y+61 ; 0x3d 1aa94: 8e ad ldd r24, Y+62 ; 0x3e 1aa96: 9f ad ldd r25, Y+63 ; 0x3f 1aa98: ae 97 sbiw r28, 0x2e ; 46 1aa9a: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1aa9e: 20 91 d1 12 lds r18, 0x12D1 ; 0x8012d1 1aaa2: 30 91 d2 12 lds r19, 0x12D2 ; 0x8012d2 1aaa6: 40 91 d3 12 lds r20, 0x12D3 ; 0x8012d3 1aaaa: 50 91 d4 12 lds r21, 0x12D4 ; 0x8012d4 1aaae: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1aab2: 4b 01 movw r8, r22 1aab4: 5c 01 movw r10, r24 1aab6: 80 92 d1 12 sts 0x12D1, r8 ; 0x8012d1 1aaba: 90 92 d2 12 sts 0x12D2, r9 ; 0x8012d2 1aabe: a0 92 d3 12 sts 0x12D3, r10 ; 0x8012d3 1aac2: b0 92 d4 12 sts 0x12D4, r11 ; 0x8012d4 1aac6: cf 56 subi r28, 0x6F ; 111 1aac8: df 4f sbci r29, 0xFF ; 255 1aaca: 48 81 ld r20, Y 1aacc: 59 81 ldd r21, Y+1 ; 0x01 1aace: c1 59 subi r28, 0x91 ; 145 1aad0: d0 40 sbci r29, 0x00 ; 0 1aad2: 48 5f subi r20, 0xF8 ; 248 1aad4: 5f 4f sbci r21, 0xFF ; 255 1aad6: cf 56 subi r28, 0x6F ; 111 1aad8: df 4f sbci r29, 0xFF ; 255 1aada: 59 83 std Y+1, r21 ; 0x01 1aadc: 48 83 st Y, r20 1aade: c1 59 subi r28, 0x91 ; 145 1aae0: d0 40 sbci r29, 0x00 ; 0 1aae2: cd 56 subi r28, 0x6D ; 109 1aae4: df 4f sbci r29, 0xFF ; 255 1aae6: 88 81 ld r24, Y 1aae8: 99 81 ldd r25, Y+1 ; 0x01 1aaea: c3 59 subi r28, 0x93 ; 147 1aaec: d0 40 sbci r29, 0x00 ; 0 1aaee: 08 96 adiw r24, 0x08 ; 8 1aaf0: cd 56 subi r28, 0x6D ; 109 1aaf2: df 4f sbci r29, 0xFF ; 255 1aaf4: 99 83 std Y+1, r25 ; 0x01 1aaf6: 88 83 st Y, r24 1aaf8: c3 59 subi r28, 0x93 ; 147 1aafa: 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) { 1aafc: 24 16 cp r2, r20 1aafe: 35 06 cpc r3, r21 1ab00: 09 f0 breq .+2 ; 0x1ab04 1ab02: 24 cf rjmp .-440 ; 0x1a94c SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } cntr[0] /= wx; 1ab04: a3 01 movw r20, r6 1ab06: 92 01 movw r18, r4 1ab08: c7 01 movw r24, r14 1ab0a: b6 01 movw r22, r12 1ab0c: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1ab10: 60 93 cd 12 sts 0x12CD, r22 ; 0x8012cd 1ab14: 70 93 ce 12 sts 0x12CE, r23 ; 0x8012ce 1ab18: 80 93 cf 12 sts 0x12CF, r24 ; 0x8012cf 1ab1c: 90 93 d0 12 sts 0x12D0, r25 ; 0x8012d0 cntr[1] /= wy; 1ab20: a3 01 movw r20, r6 1ab22: 92 01 movw r18, r4 1ab24: c5 01 movw r24, r10 1ab26: b4 01 movw r22, r8 1ab28: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1ab2c: 60 93 d1 12 sts 0x12D1, r22 ; 0x8012d1 1ab30: 70 93 d2 12 sts 0x12D2, r23 ; 0x8012d2 1ab34: 80 93 d3 12 sts 0x12D3, r24 ; 0x8012d3 1ab38: 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]; 1ab3c: 40 90 bd 12 lds r4, 0x12BD ; 0x8012bd 1ab40: 50 90 be 12 lds r5, 0x12BE ; 0x8012be 1ab44: 60 90 bf 12 lds r6, 0x12BF ; 0x8012bf 1ab48: 70 90 c0 12 lds r7, 0x12C0 ; 0x8012c0 1ab4c: c0 90 c9 12 lds r12, 0x12C9 ; 0x8012c9 1ab50: d0 90 ca 12 lds r13, 0x12CA ; 0x8012ca 1ab54: e0 90 cb 12 lds r14, 0x12CB ; 0x8012cb 1ab58: f0 90 cc 12 lds r15, 0x12CC ; 0x8012cc 1ab5c: 20 91 c1 12 lds r18, 0x12C1 ; 0x8012c1 1ab60: 30 91 c2 12 lds r19, 0x12C2 ; 0x8012c2 1ab64: 40 91 c3 12 lds r20, 0x12C3 ; 0x8012c3 1ab68: 50 91 c4 12 lds r21, 0x12C4 ; 0x8012c4 1ab6c: a2 96 adiw r28, 0x22 ; 34 1ab6e: 2c af std Y+60, r18 ; 0x3c 1ab70: 3d af std Y+61, r19 ; 0x3d 1ab72: 4e af std Y+62, r20 ; 0x3e 1ab74: 5f af std Y+63, r21 ; 0x3f 1ab76: a2 97 sbiw r28, 0x22 ; 34 1ab78: 80 91 c5 12 lds r24, 0x12C5 ; 0x8012c5 1ab7c: 90 91 c6 12 lds r25, 0x12C6 ; 0x8012c6 1ab80: a0 91 c7 12 lds r26, 0x12C7 ; 0x8012c7 1ab84: b0 91 c8 12 lds r27, 0x12C8 ; 0x8012c8 1ab88: a6 96 adiw r28, 0x26 ; 38 1ab8a: 8c af std Y+60, r24 ; 0x3c 1ab8c: 9d af std Y+61, r25 ; 0x3d 1ab8e: ae af std Y+62, r26 ; 0x3e 1ab90: bf af std Y+63, r27 ; 0x3f 1ab92: a6 97 sbiw r28, 0x26 ; 38 1ab94: a7 01 movw r20, r14 1ab96: 96 01 movw r18, r12 1ab98: c3 01 movw r24, r6 1ab9a: b2 01 movw r22, r4 1ab9c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1aba0: 4b 01 movw r8, r22 1aba2: 5c 01 movw r10, r24 1aba4: a6 96 adiw r28, 0x26 ; 38 1aba6: 2c ad ldd r18, Y+60 ; 0x3c 1aba8: 3d ad ldd r19, Y+61 ; 0x3d 1abaa: 4e ad ldd r20, Y+62 ; 0x3e 1abac: 5f ad ldd r21, Y+63 ; 0x3f 1abae: a6 97 sbiw r28, 0x26 ; 38 1abb0: a2 96 adiw r28, 0x22 ; 34 1abb2: 6c ad ldd r22, Y+60 ; 0x3c 1abb4: 7d ad ldd r23, Y+61 ; 0x3d 1abb6: 8e ad ldd r24, Y+62 ; 0x3e 1abb8: 9f ad ldd r25, Y+63 ; 0x3f 1abba: a2 97 sbiw r28, 0x22 ; 34 1abbc: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1abc0: 9b 01 movw r18, r22 1abc2: ac 01 movw r20, r24 1abc4: c5 01 movw r24, r10 1abc6: b4 01 movw r22, r8 1abc8: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1abcc: 4b 01 movw r8, r22 1abce: 5c 01 movw r10, r24 float Ainv[2][2] = { { vec_y[1] / d, -vec_y[0] / d }, 1abd0: ac 01 movw r20, r24 1abd2: 9b 01 movw r18, r22 1abd4: c7 01 movw r24, r14 1abd6: b6 01 movw r22, r12 1abd8: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1abdc: 6b 01 movw r12, r22 1abde: 7c 01 movw r14, r24 1abe0: a6 96 adiw r28, 0x26 ; 38 1abe2: 6c ad ldd r22, Y+60 ; 0x3c 1abe4: 7d ad ldd r23, Y+61 ; 0x3d 1abe6: 8e ad ldd r24, Y+62 ; 0x3e 1abe8: 9f ad ldd r25, Y+63 ; 0x3f 1abea: a6 97 sbiw r28, 0x26 ; 38 1abec: 90 58 subi r25, 0x80 ; 128 1abee: a5 01 movw r20, r10 1abf0: 94 01 movw r18, r8 1abf2: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1abf6: a6 96 adiw r28, 0x26 ; 38 1abf8: 6c af std Y+60, r22 ; 0x3c 1abfa: 7d af std Y+61, r23 ; 0x3d 1abfc: 8e af std Y+62, r24 ; 0x3e 1abfe: 9f af std Y+63, r25 ; 0x3f 1ac00: a6 97 sbiw r28, 0x26 ; 38 { -vec_x[1] / d, vec_x[0] / d } 1ac02: a2 96 adiw r28, 0x22 ; 34 1ac04: 6c ad ldd r22, Y+60 ; 0x3c 1ac06: 7d ad ldd r23, Y+61 ; 0x3d 1ac08: 8e ad ldd r24, Y+62 ; 0x3e 1ac0a: 9f ad ldd r25, Y+63 ; 0x3f 1ac0c: a2 97 sbiw r28, 0x22 ; 34 1ac0e: 90 58 subi r25, 0x80 ; 128 1ac10: a5 01 movw r20, r10 1ac12: 94 01 movw r18, r8 1ac14: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1ac18: aa 96 adiw r28, 0x2a ; 42 1ac1a: 6c af std Y+60, r22 ; 0x3c 1ac1c: 7d af std Y+61, r23 ; 0x3d 1ac1e: 8e af std Y+62, r24 ; 0x3e 1ac20: 9f af std Y+63, r25 ; 0x3f 1ac22: aa 97 sbiw r28, 0x2a ; 42 1ac24: a5 01 movw r20, r10 1ac26: 94 01 movw r18, r8 1ac28: c3 01 movw r24, r6 1ac2a: b2 01 movw r22, r4 1ac2c: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1ac30: 4b 01 movw r8, r22 1ac32: 5c 01 movw r10, r24 }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], 1ac34: 40 90 cd 12 lds r4, 0x12CD ; 0x8012cd 1ac38: 50 90 ce 12 lds r5, 0x12CE ; 0x8012ce 1ac3c: 60 90 cf 12 lds r6, 0x12CF ; 0x8012cf 1ac40: 70 90 d0 12 lds r7, 0x12D0 ; 0x8012d0 1ac44: 20 91 d1 12 lds r18, 0x12D1 ; 0x8012d1 1ac48: 30 91 d2 12 lds r19, 0x12D2 ; 0x8012d2 1ac4c: 40 91 d3 12 lds r20, 0x12D3 ; 0x8012d3 1ac50: 50 91 d4 12 lds r21, 0x12D4 ; 0x8012d4 1ac54: a2 96 adiw r28, 0x22 ; 34 1ac56: 2c af std Y+60, r18 ; 0x3c 1ac58: 3d af std Y+61, r19 ; 0x3d 1ac5a: 4e af std Y+62, r20 ; 0x3e 1ac5c: 5f af std Y+63, r21 ; 0x3f 1ac5e: a2 97 sbiw r28, 0x22 ; 34 -Ainv[1][0] * cntr[0] - Ainv[1][1] * cntr[1] }; vec_x[0] = Ainv[0][0]; 1ac60: c0 92 bd 12 sts 0x12BD, r12 ; 0x8012bd 1ac64: d0 92 be 12 sts 0x12BE, r13 ; 0x8012be 1ac68: e0 92 bf 12 sts 0x12BF, r14 ; 0x8012bf 1ac6c: f0 92 c0 12 sts 0x12C0, r15 ; 0x8012c0 vec_x[1] = Ainv[1][0]; 1ac70: aa 96 adiw r28, 0x2a ; 42 1ac72: 8c ad ldd r24, Y+60 ; 0x3c 1ac74: 9d ad ldd r25, Y+61 ; 0x3d 1ac76: ae ad ldd r26, Y+62 ; 0x3e 1ac78: bf ad ldd r27, Y+63 ; 0x3f 1ac7a: aa 97 sbiw r28, 0x2a ; 42 1ac7c: 80 93 c1 12 sts 0x12C1, r24 ; 0x8012c1 1ac80: 90 93 c2 12 sts 0x12C2, r25 ; 0x8012c2 1ac84: a0 93 c3 12 sts 0x12C3, r26 ; 0x8012c3 1ac88: b0 93 c4 12 sts 0x12C4, r27 ; 0x8012c4 vec_y[0] = Ainv[0][1]; 1ac8c: a6 96 adiw r28, 0x26 ; 38 1ac8e: 2c ad ldd r18, Y+60 ; 0x3c 1ac90: 3d ad ldd r19, Y+61 ; 0x3d 1ac92: 4e ad ldd r20, Y+62 ; 0x3e 1ac94: 5f ad ldd r21, Y+63 ; 0x3f 1ac96: a6 97 sbiw r28, 0x26 ; 38 1ac98: 20 93 c5 12 sts 0x12C5, r18 ; 0x8012c5 1ac9c: 30 93 c6 12 sts 0x12C6, r19 ; 0x8012c6 1aca0: 40 93 c7 12 sts 0x12C7, r20 ; 0x8012c7 1aca4: 50 93 c8 12 sts 0x12C8, r21 ; 0x8012c8 vec_y[1] = Ainv[1][1]; 1aca8: 80 92 c9 12 sts 0x12C9, r8 ; 0x8012c9 1acac: 90 92 ca 12 sts 0x12CA, r9 ; 0x8012ca 1acb0: a0 92 cb 12 sts 0x12CB, r10 ; 0x8012cb 1acb4: 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], 1acb8: c7 01 movw r24, r14 1acba: b6 01 movw r22, r12 1acbc: 90 58 subi r25, 0x80 ; 128 1acbe: a3 01 movw r20, r6 1acc0: 92 01 movw r18, r4 1acc2: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1acc6: 6b 01 movw r12, r22 1acc8: 7c 01 movw r14, r24 1acca: a2 96 adiw r28, 0x22 ; 34 1accc: 2c ad ldd r18, Y+60 ; 0x3c 1acce: 3d ad ldd r19, Y+61 ; 0x3d 1acd0: 4e ad ldd r20, Y+62 ; 0x3e 1acd2: 5f ad ldd r21, Y+63 ; 0x3f 1acd4: a2 97 sbiw r28, 0x22 ; 34 1acd6: a6 96 adiw r28, 0x26 ; 38 1acd8: 6c ad ldd r22, Y+60 ; 0x3c 1acda: 7d ad ldd r23, Y+61 ; 0x3d 1acdc: 8e ad ldd r24, Y+62 ; 0x3e 1acde: 9f ad ldd r25, Y+63 ; 0x3f 1ace0: a6 97 sbiw r28, 0x26 ; 38 1ace2: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1ace6: 9b 01 movw r18, r22 1ace8: ac 01 movw r20, r24 1acea: c7 01 movw r24, r14 1acec: b6 01 movw r22, r12 1acee: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__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]; 1acf2: 60 93 cd 12 sts 0x12CD, r22 ; 0x8012cd 1acf6: 70 93 ce 12 sts 0x12CE, r23 ; 0x8012ce 1acfa: 80 93 cf 12 sts 0x12CF, r24 ; 0x8012cf 1acfe: 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] 1ad02: aa 96 adiw r28, 0x2a ; 42 1ad04: 6c ad ldd r22, Y+60 ; 0x3c 1ad06: 7d ad ldd r23, Y+61 ; 0x3d 1ad08: 8e ad ldd r24, Y+62 ; 0x3e 1ad0a: 9f ad ldd r25, Y+63 ; 0x3f 1ad0c: aa 97 sbiw r28, 0x2a ; 42 1ad0e: 90 58 subi r25, 0x80 ; 128 1ad10: a3 01 movw r20, r6 1ad12: 92 01 movw r18, r4 1ad14: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1ad18: 6b 01 movw r12, r22 1ad1a: 7c 01 movw r14, r24 1ad1c: a2 96 adiw r28, 0x22 ; 34 1ad1e: 2c ad ldd r18, Y+60 ; 0x3c 1ad20: 3d ad ldd r19, Y+61 ; 0x3d 1ad22: 4e ad ldd r20, Y+62 ; 0x3e 1ad24: 5f ad ldd r21, Y+63 ; 0x3f 1ad26: a2 97 sbiw r28, 0x22 ; 34 1ad28: c5 01 movw r24, r10 1ad2a: b4 01 movw r22, r8 1ad2c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1ad30: 9b 01 movw r18, r22 1ad32: ac 01 movw r20, r24 1ad34: c7 01 movw r24, r14 1ad36: b6 01 movw r22, r12 1ad38: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__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]; 1ad3c: 60 93 d1 12 sts 0x12D1, r22 ; 0x8012d1 1ad40: 70 93 d2 12 sts 0x12D2, r23 ; 0x8012d2 1ad44: 80 93 d3 12 sts 0x12D3, r24 ; 0x8012d3 1ad48: 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 1ad4c: 90 e0 ldi r25, 0x00 ; 0 1ad4e: 80 e0 ldi r24, 0x00 ; 0 1ad50: 0e 94 45 7c call 0xf88a ; 0xf88a if (result >= 0) { 1ad54: 17 fd sbrc r17, 7 1ad56: d5 c0 rjmp .+426 ; 0x1af02 DBG(_n("Calibration success.\n")); 1ad58: 8b e7 ldi r24, 0x7B ; 123 1ad5a: 99 e6 ldi r25, 0x69 ; 105 1ad5c: 9f 93 push r25 1ad5e: 8f 93 push r24 1ad60: 0f 94 5d 9f call 0x33eba ; 0x33eba world2machine_update(vec_x, vec_y, cntr); 1ad64: 4d ec ldi r20, 0xCD ; 205 1ad66: 52 e1 ldi r21, 0x12 ; 18 1ad68: 65 ec ldi r22, 0xC5 ; 197 1ad6a: 72 e1 ldi r23, 0x12 ; 18 1ad6c: 8d eb ldi r24, 0xBD ; 189 1ad6e: 92 e1 ldi r25, 0x12 ; 18 1ad70: 0f 94 99 8e call 0x31d32 ; 0x31d32 #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); 1ad74: 48 e0 ldi r20, 0x08 ; 8 1ad76: 50 e0 ldi r21, 0x00 ; 0 1ad78: 65 ee ldi r22, 0xE5 ; 229 1ad7a: 7f e0 ldi r23, 0x0F ; 15 1ad7c: 8d ec ldi r24, 0xCD ; 205 1ad7e: 92 e1 ldi r25, 0x12 ; 18 1ad80: 0f 94 af a0 call 0x3415e ; 0x3415e 1ad84: 48 e0 ldi r20, 0x08 ; 8 1ad86: 50 e0 ldi r21, 0x00 ; 0 1ad88: 6d ed ldi r22, 0xDD ; 221 1ad8a: 7f e0 ldi r23, 0x0F ; 15 1ad8c: 8d eb ldi r24, 0xBD ; 189 1ad8e: 92 e1 ldi r25, 0x12 ; 18 1ad90: 0f 94 af a0 call 0x3415e ; 0x3415e 1ad94: 48 e0 ldi r20, 0x08 ; 8 1ad96: 50 e0 ldi r21, 0x00 ; 0 1ad98: 65 ed ldi r22, 0xD5 ; 213 1ad9a: 7f e0 ldi r23, 0x0F ; 15 1ad9c: 85 ec ldi r24, 0xC5 ; 197 1ad9e: 92 e1 ldi r25, 0x12 ; 18 1ada0: 0f 94 af a0 call 0x3415e ; 0x3415e 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(); 1ada4: 0f 94 1e 8e call 0x31c3c ; 0x31c3c } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ DBG(_n("Fitting failed => calibration failed.\n")); 1ada8: 0f 90 pop r0 1adaa: 0f 90 pop r0 BedSkewOffsetDetectionResultType result = find_bed_offset_and_skew(verbosity_level, point_too_far_mask); clean_up_after_endstop_move(l_feedmultiply); 1adac: c7 55 subi r28, 0x57 ; 87 1adae: df 4f sbci r29, 0xFF ; 255 1adb0: 88 81 ld r24, Y 1adb2: 99 81 ldd r25, Y+1 ; 0x01 1adb4: c9 5a subi r28, 0xA9 ; 169 1adb6: d0 40 sbci r29, 0x00 ; 0 1adb8: 0e 94 ca 5f call 0xbf94 ; 0xbf94 // Print head up. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1adbc: 80 e0 ldi r24, 0x00 ; 0 1adbe: 90 e0 ldi r25, 0x00 ; 0 1adc0: a0 ea ldi r26, 0xA0 ; 160 1adc2: b0 e4 ldi r27, 0x40 ; 64 1adc4: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 1adc8: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 1adcc: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 1add0: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 1add4: 60 e0 ldi r22, 0x00 ; 0 1add6: 70 e0 ldi r23, 0x00 ; 0 1add8: 80 ea ldi r24, 0xA0 ; 160 1adda: 91 e4 ldi r25, 0x41 ; 65 1addc: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 1ade0: 0f 94 ce 22 call 0x2459c ; 0x2459c //#ifndef NEW_XYZCAL if (result >= 0) 1ade4: 17 fd sbrc r17, 7 1ade6: 22 c0 rjmp .+68 ; 0x1ae2c 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; 1ade8: 10 92 fd 11 sts 0x11FD, r1 ; 0x8011fd 1adec: 10 92 fe 11 sts 0x11FE, r1 ; 0x8011fe 1adf0: 10 92 ff 11 sts 0x11FF, r1 ; 0x8011ff 1adf4: 10 92 00 12 sts 0x1200, r1 ; 0x801200 destination[Z_AXIS] = 150.F; 1adf8: 80 e0 ldi r24, 0x00 ; 0 1adfa: 90 e0 ldi r25, 0x00 ; 0 1adfc: a6 e1 ldi r26, 0x16 ; 22 1adfe: b3 e4 ldi r27, 0x43 ; 67 1ae00: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b 1ae04: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c 1ae08: a0 93 9d 06 sts 0x069D, r26 ; 0x80069d 1ae0c: b0 93 9e 06 sts 0x069E, r27 ; 0x80069e plan_buffer_line_destinationXYZE(homing_feedrate[Z_AXIS] / 60); 1ae10: 65 e5 ldi r22, 0x55 ; 85 1ae12: 75 e5 ldi r23, 0x55 ; 85 1ae14: 85 e5 ldi r24, 0x55 ; 85 1ae16: 91 e4 ldi r25, 0x41 ; 65 1ae18: 0f 94 fc 84 call 0x309f8 ; 0x309f8 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PLACE_STEEL_SHEET)); 1ae1c: 82 e5 ldi r24, 0x52 ; 82 1ae1e: 96 e4 ldi r25, 0x46 ; 70 1ae20: 0e 94 a7 6c call 0xd94e ; 0xd94e 1ae24: 0f 94 a9 0b call 0x21752 ; 0x21752 // 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()) 1ae28: 0f 94 37 8c call 0x3186e ; 0x3186e st_synchronize(); // if (result >= 0) babystep_apply(); #endif //HEATBED_V2 } //#endif //NEW_XYZCAL lcd_update_enable(true); 1ae2c: 81 e0 ldi r24, 0x01 ; 1 1ae2e: 0e 94 b6 69 call 0xd36c ; 0xd36c lcd_update(2); 1ae32: 82 e0 ldi r24, 0x02 ; 2 1ae34: 0e 94 38 69 call 0xd270 ; 0xd270 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)); 1ae38: 83 e1 ldi r24, 0x13 ; 19 1ae3a: 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) { 1ae3c: 1f 3f cpi r17, 0xFF ; 255 1ae3e: 99 f0 breq .+38 ; 0x1ae66 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) { 1ae40: 1e 3f cpi r17, 0xFE ; 254 1ae42: 09 f0 breq .+2 ; 0x1ae46 1ae44: 73 c0 rjmp .+230 ; 0x1af2c if (point_too_far_mask == 0) 1ae46: af 96 adiw r28, 0x2f ; 47 1ae48: 4f ad ldd r20, Y+63 ; 0x3f 1ae4a: af 97 sbiw r28, 0x2f ; 47 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 1ae4c: 8e ed ldi r24, 0xDE ; 222 1ae4e: 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) 1ae50: 44 23 and r20, r20 1ae52: 49 f0 breq .+18 ; 0x1ae66 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); else if (point_too_far_mask == 2 || point_too_far_mask == 7) 1ae54: af 96 adiw r28, 0x2f ; 47 1ae56: 5f ad ldd r21, Y+63 ; 0x3f 1ae58: 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); 1ae5a: 8c e9 ldi r24, 0x9C ; 156 1ae5c: 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) 1ae5e: 52 30 cpi r21, 0x02 ; 2 1ae60: 11 f0 breq .+4 ; 0x1ae66 // 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); 1ae62: 85 e5 ldi r24, 0x55 ; 85 1ae64: 95 e4 ldi r25, 0x45 ; 69 1ae66: 0e 94 a7 6c call 0xd94e ; 0xd94e 1ae6a: 0c 94 15 ca jmp 0x1942a ; 0x1942a (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]) : 1ae6e: f2 01 movw r30, r4 1ae70: 25 81 ldd r18, Z+5 ; 0x05 1ae72: 36 81 ldd r19, Z+6 ; 0x06 1ae74: 47 81 ldd r20, Z+7 ; 0x07 1ae76: 50 85 ldd r21, Z+8 ; 0x08 1ae78: c3 58 subi r28, 0x83 ; 131 1ae7a: df 4f sbci r29, 0xFF ; 255 1ae7c: 68 81 ld r22, Y 1ae7e: 79 81 ldd r23, Y+1 ; 0x01 1ae80: 8a 81 ldd r24, Y+2 ; 0x02 1ae82: 9b 81 ldd r25, Y+3 ; 0x03 1ae84: cd 57 subi r28, 0x7D ; 125 1ae86: d0 40 sbci r29, 0x00 ; 0 1ae88: 0c 94 71 ce jmp 0x19ce2 ; 0x19ce2 // 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]) : 1ae8c: f2 01 movw r30, r4 1ae8e: 25 81 ldd r18, Z+5 ; 0x05 1ae90: 36 81 ldd r19, Z+6 ; 0x06 1ae92: 47 81 ldd r20, Z+7 ; 0x07 1ae94: 50 85 ldd r21, Z+8 ; 0x08 1ae96: ed 96 adiw r28, 0x3d ; 61 1ae98: 6c ad ldd r22, Y+60 ; 0x3c 1ae9a: 7d ad ldd r23, Y+61 ; 0x3d 1ae9c: 8e ad ldd r24, Y+62 ; 0x3e 1ae9e: 9f ad ldd r25, Y+63 ; 0x3f 1aea0: ed 97 sbiw r28, 0x3d ; 61 1aea2: b8 c0 rjmp .+368 ; 0x1b014 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : ((c == 2) ? ( c1 * measured_pts[2 * i]) : 1aea4: f2 01 movw r30, r4 1aea6: 25 81 ldd r18, Z+5 ; 0x05 1aea8: 36 81 ldd r19, Z+6 ; 0x06 1aeaa: 47 81 ldd r20, Z+7 ; 0x07 1aeac: 50 85 ldd r21, Z+8 ; 0x08 1aeae: ed 96 adiw r28, 0x3d ; 61 1aeb0: 6c ad ldd r22, Y+60 ; 0x3c 1aeb2: 7d ad ldd r23, Y+61 ; 0x3d 1aeb4: 8e ad ldd r24, Y+62 ; 0x3e 1aeb6: 9f ad ldd r25, Y+63 ; 0x3f 1aeb8: ed 97 sbiw r28, 0x3d ; 61 1aeba: c6 c0 rjmp .+396 ; 0x1b048 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]) : 1aebc: a3 01 movw r20, r6 1aebe: 92 01 movw r18, r4 1aec0: c3 58 subi r28, 0x83 ; 131 1aec2: df 4f sbci r29, 0xFF ; 255 1aec4: 68 81 ld r22, Y 1aec6: 79 81 ldd r23, Y+1 ; 0x01 1aec8: 8a 81 ldd r24, Y+2 ; 0x02 1aeca: 9b 81 ldd r25, Y+3 ; 0x03 1aecc: cd 57 subi r28, 0x7D ; 125 1aece: d0 40 sbci r29, 0x00 ; 0 1aed0: 0c 94 d9 ce jmp 0x19db2 ; 0x19db2 // J^T times f(x) acc = 0.f; for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 1aed4: 81 2c mov r8, r1 1aed6: 91 2c mov r9, r1 1aed8: 20 e8 ldi r18, 0x80 ; 128 1aeda: a2 2e mov r10, r18 1aedc: 2f e3 ldi r18, 0x3F ; 63 1aede: b2 2e mov r11, r18 1aee0: 0c 94 dd ce jmp 0x19dba ; 0x19dba float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; } { float j = (r == 0) ? 0.f : 1aee4: c1 2c mov r12, r1 1aee6: d1 2c mov r13, r1 1aee8: 76 01 movw r14, r12 1aeea: 0c 94 54 cf jmp 0x19ea8 ; 0x19ea8 ((r == 1) ? 1.f : 1aeee: c1 2c mov r12, r1 1aef0: d1 2c mov r13, r1 1aef2: 90 e8 ldi r25, 0x80 ; 128 1aef4: e9 2e mov r14, r25 1aef6: 9f e3 ldi r25, 0x3F ; 63 1aef8: f9 2e mov r15, r25 1aefa: 0c 94 54 cf jmp 0x19ea8 ; 0x19ea8 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; 1aefe: 12 e0 ldi r17, 0x02 ; 2 1af00: a7 cb rjmp .-2226 ; 0x1a650 } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 1af02: 1e 3f cpi r17, 0xFE ; 254 1af04: 89 f4 brne .+34 ; 0x1af28 1af06: af 96 adiw r28, 0x2f ; 47 1af08: 3f ad ldd r19, Y+63 ; 0x3f 1af0a: af 97 sbiw r28, 0x2f ; 47 1af0c: 32 30 cpi r19, 0x02 ; 2 1af0e: 09 f0 breq .+2 ; 0x1af12 1af10: 4d cf rjmp .-358 ; 0x1adac DBG(_n("Fitting failed => calibration failed.\n")); 1af12: 84 e5 ldi r24, 0x54 ; 84 1af14: 99 e6 ldi r25, 0x69 ; 105 1af16: 9f 93 push r25 1af18: 8f 93 push r24 1af1a: 0f 94 5d 9f call 0x33eba ; 0x33eba 1af1e: 44 cf rjmp .-376 ; 0x1ada8 // 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; 1af20: af 96 adiw r28, 0x2f ; 47 1af22: 1f ae std Y+63, r1 ; 0x3f 1af24: af 97 sbiw r28, 0x2f ; 47 1af26: 42 cf rjmp .-380 ; 0x1adac } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 1af28: 1f ef ldi r17, 0xFF ; 255 1af2a: 40 cf rjmp .-384 ; 0x1adac 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) { 1af2c: af 96 adiw r28, 0x2f ; 47 1af2e: 6f ad ldd r22, Y+63 ; 0x3f 1af30: af 97 sbiw r28, 0x2f ; 47 1af32: 61 11 cpse r22, r1 1af34: 13 c0 rjmp .+38 ; 0x1af5c 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); 1af36: 8a e3 ldi r24, 0x3A ; 58 1af38: 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) { 1af3a: 11 30 cpi r17, 0x01 ; 1 1af3c: 51 f0 breq .+20 ; 0x1af52 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); 1af3e: 87 ef ldi r24, 0xF7 ; 247 1af40: 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) { 1af42: 12 30 cpi r17, 0x02 ; 2 1af44: 31 f0 breq .+12 ; 0x1af52 default: // should not happen msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 1af46: 8e ed ldi r24, 0xDE ; 222 1af48: 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) { 1af4a: 11 11 cpse r17, r1 1af4c: 02 c0 rjmp .+4 ; 0x1af52 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); 1af4e: 8f e7 ldi r24, 0x7F ; 127 1af50: 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); 1af52: 0e 94 a7 6c call 0xd94e ; 0xd94e break; } lcd_show_fullscreen_message_and_wait_P(msg); 1af56: 0f 94 a9 0b call 0x21752 ; 0x21752 1af5a: 0d c0 rjmp .+26 ; 0x1af76 // 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) 1af5c: af 96 adiw r28, 0x2f ; 47 1af5e: 8f ad ldd r24, Y+63 ; 0x3f 1af60: af 97 sbiw r28, 0x2f ; 47 1af62: 82 30 cpi r24, 0x02 ; 2 1af64: f1 f4 brne .+60 ; 0x1afa2 // Only the center point or all the three front points. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR); 1af66: 8e e0 ldi r24, 0x0E ; 14 1af68: 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); 1af6a: 0e 94 a7 6c call 0xd94e ; 0xd94e 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); 1af6e: 0f 94 a9 0b call 0x21752 ; 0x21752 } if (point_too_far_mask == 0 || result > 0) { 1af72: 11 16 cp r1, r17 1af74: 04 f3 brlt .-64 ; 0x1af36 //#endif //NEW_XYZCAL lcd_update_enable(true); lcd_update(2); lcd_bed_calibration_show_result(result, point_too_far_mask); if (result >= 0) 1af76: 1f 3f cpi r17, 0xFF ; 255 1af78: 11 f4 brne .+4 ; 0x1af7e 1af7a: 0c 94 23 c7 jmp 0x18e46 ; 0x18e46 { // 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); 1af7e: 86 e0 ldi r24, 0x06 ; 6 1af80: 0e 94 83 c6 call 0x18d06 ; 0x18d06 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 1af84: 8f e5 ldi r24, 0x5F ; 95 1af86: 9f e0 ldi r25, 0x0F ; 15 1af88: 0f 94 9b a0 call 0x34136 ; 0x34136 1af8c: 81 11 cpse r24, r1 1af8e: 0c 94 2f ca jmp 0x1945e ; 0x1945e lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 1af92: 89 e7 ldi r24, 0x79 ; 121 1af94: 96 e4 ldi r25, 0x46 ; 70 1af96: 0e 94 a7 6c call 0xd94e ; 0xd94e 1af9a: 0f 94 a9 0b call 0x21752 ; 0x21752 1af9e: 0c 94 2f ca jmp 0x1945e ; 0x1945e 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); 1afa2: 82 ec ldi r24, 0xC2 ; 194 1afa4: 94 e4 ldi r25, 0x44 ; 68 1afa6: e1 cf rjmp .-62 ; 0x1af6a 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)) 1afa8: 89 81 ldd r24, Y+1 ; 0x01 1afaa: 9a 81 ldd r25, Y+2 ; 0x02 1afac: 80 37 cpi r24, 0x70 ; 112 1afae: 98 40 sbci r25, 0x08 ; 8 1afb0: 10 f0 brcs .+4 ; 0x1afb6 1afb2: 0c 94 68 ca jmp 0x194d0 ; 0x194d0 if ((ret = xyzcal_spiral2(cx, cy, z0 - 2*dz, dz, radius, 180, delay_us, check_pinda, &ad)) != 0) 1afb6: ae 01 movw r20, r28 1afb8: 4f 5f subi r20, 0xFF ; 255 1afba: 5f 4f sbci r21, 0xFF ; 255 1afbc: 7a 01 movw r14, r20 1afbe: 04 eb ldi r16, 0xB4 ; 180 1afc0: 10 e0 ldi r17, 0x00 ; 0 1afc2: 24 e8 ldi r18, 0x84 ; 132 1afc4: 33 e0 ldi r19, 0x03 ; 3 1afc6: a6 01 movw r20, r12 1afc8: 48 5c subi r20, 0xC8 ; 200 1afca: 51 09 sbc r21, r1 1afcc: 69 2d mov r22, r9 1afce: 78 2d mov r23, r8 1afd0: 8b 2d mov r24, r11 1afd2: 9a 2d mov r25, r10 1afd4: 0f 94 8b 5f call 0x2bf16 ; 0x2bf16 1afd8: 88 23 and r24, r24 1afda: 11 f4 brne .+4 ; 0x1afe0 1afdc: 0c 94 68 ca jmp 0x194d0 ; 0x194d0 ad += 1440; 1afe0: 89 81 ldd r24, Y+1 ; 0x01 1afe2: 9a 81 ldd r25, Y+2 ; 0x02 1afe4: 80 56 subi r24, 0x60 ; 96 1afe6: 9a 4f sbci r25, 0xFA ; 250 1afe8: 0c 94 f8 c8 jmp 0x191f0 ; 0x191f0 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) { 1afec: 00 23 and r16, r16 1afee: 11 f4 brne .+4 ; 0x1aff4 1aff0: 0c 94 84 ce jmp 0x19d08 ; 0x19d08 float a = (r == 1) ? 1.f : ((r == 2) ? ( c1 * measured_pts[2 * i]) : 1aff4: 02 30 cpi r16, 0x02 ; 2 1aff6: 09 f0 breq .+2 ; 0x1affa 1aff8: 49 cf rjmp .-366 ; 0x1ae8c 1affa: d2 01 movw r26, r4 1affc: 11 96 adiw r26, 0x01 ; 1 1affe: 2d 91 ld r18, X+ 1b000: 3d 91 ld r19, X+ 1b002: 4d 91 ld r20, X+ 1b004: 5c 91 ld r21, X 1b006: 14 97 sbiw r26, 0x04 ; 4 1b008: 6e 96 adiw r28, 0x1e ; 30 1b00a: 6c ad ldd r22, Y+60 ; 0x3c 1b00c: 7d ad ldd r23, Y+61 ; 0x3d 1b00e: 8e ad ldd r24, Y+62 ; 0x3e 1b010: 9f ad ldd r25, Y+63 ; 0x3f 1b012: 6e 97 sbiw r28, 0x1e ; 30 1b014: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1b018: 4b 01 movw r8, r22 1b01a: 5c 01 movw r10, r24 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : 1b01c: 60 e0 ldi r22, 0x00 ; 0 1b01e: 70 e0 ldi r23, 0x00 ; 0 1b020: 80 e8 ldi r24, 0x80 ; 128 1b022: 9f e3 ldi r25, 0x3F ; 63 1b024: 11 30 cpi r17, 0x01 ; 1 1b026: 91 f0 breq .+36 ; 0x1b04c ((c == 2) ? ( c1 * measured_pts[2 * i]) : 1b028: 12 30 cpi r17, 0x02 ; 2 1b02a: 09 f0 breq .+2 ; 0x1b02e 1b02c: 3b cf rjmp .-394 ; 0x1aea4 1b02e: d2 01 movw r26, r4 1b030: 11 96 adiw r26, 0x01 ; 1 1b032: 2d 91 ld r18, X+ 1b034: 3d 91 ld r19, X+ 1b036: 4d 91 ld r20, X+ 1b038: 5c 91 ld r21, X 1b03a: 14 97 sbiw r26, 0x04 ; 4 1b03c: 6e 96 adiw r28, 0x1e ; 30 1b03e: 6c ad ldd r22, Y+60 ; 0x3c 1b040: 7d ad ldd r23, Y+61 ; 0x3d 1b042: 8e ad ldd r24, Y+62 ; 0x3e 1b044: 9f ad ldd r25, Y+63 ; 0x3f 1b046: 6e 97 sbiw r28, 0x1e ; 30 1b048: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> (-s2 * measured_pts[2 * i + 1])); float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += a * b * w; 1b04c: 9b 01 movw r18, r22 1b04e: ac 01 movw r20, r24 1b050: c5 01 movw r24, r10 1b052: b4 01 movw r22, r8 1b054: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1b058: 9b 01 movw r18, r22 1b05a: ac 01 movw r20, r24 1b05c: c7 01 movw r24, r14 1b05e: b6 01 movw r22, r12 1b060: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1b064: 6b 01 movw r12, r22 1b066: 7c 01 movw r14, r24 1b068: 0c 94 84 ce jmp 0x19d08 ; 0x19d08 // 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 : 1b06c: 81 2c mov r8, r1 1b06e: 91 2c mov r9, r1 1b070: 50 e8 ldi r21, 0x80 ; 128 1b072: a5 2e mov r10, r21 1b074: 5f e3 ldi r21, 0x3F ; 63 1b076: b5 2e mov r11, r21 ((r == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 1b078: 11 11 cpse r17, r1 1b07a: 0c 94 5e ce jmp 0x19cbc ; 0x19cbc ((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; 1b07e: 20 e0 ldi r18, 0x00 ; 0 1b080: 30 e0 ldi r19, 0x00 ; 0 1b082: 40 e8 ldi r20, 0x80 ; 128 1b084: 5f e3 ldi r21, 0x3F ; 63 1b086: ea cf rjmp .-44 ; 0x1b05c } // 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) { 1b088: 11 11 cpse r17, r1 1b08a: b4 cf rjmp .-152 ; 0x1aff4 1b08c: 0c 94 84 ce jmp 0x19d08 ; 0x19d08 float a = (r == 1) ? 1.f : 1b090: 81 2c mov r8, r1 1b092: 91 2c mov r9, r1 1b094: 40 e8 ldi r20, 0x80 ; 128 1b096: a4 2e mov r10, r20 1b098: 4f e3 ldi r20, 0x3F ; 63 1b09a: 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) { 1b09c: 11 11 cpse r17, r1 1b09e: be cf rjmp .-132 ; 0x1b01c 1b0a0: 0c 94 84 ce jmp 0x19d08 ; 0x19d08 0001b0a4 : sprintf_P(dest, PSTR("%u.%u.%u.%u"), IP[0], IP[1], IP[2], IP[3]); } bool calibration_status_get(CalibrationStatus components) { 1b0a4: cf 93 push r28 1b0a6: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1b0a8: 86 ea ldi r24, 0xA6 ; 166 1b0aa: 9c e0 ldi r25, 0x0C ; 12 1b0ac: 0f 94 9b a0 call 0x34136 ; 0x34136 return ((status & components) == components); 1b0b0: 98 2f mov r25, r24 1b0b2: 9c 23 and r25, r28 1b0b4: 81 e0 ldi r24, 0x01 ; 1 1b0b6: 9c 13 cpse r25, r28 1b0b8: 80 e0 ldi r24, 0x00 ; 0 } 1b0ba: cf 91 pop r28 1b0bc: 08 95 ret 0001b0be : ClCheckMode oCheckVersion; ClCheckMode oCheckGcode; ClCheckMode oCheckFilament; void fCheckModeInit() { oCheckMode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Warn); 1b0be: 61 e0 ldi r22, 0x01 ; 1 1b0c0: 88 ea ldi r24, 0xA8 ; 168 1b0c2: 9d e0 ldi r25, 0x0D ; 13 1b0c4: 0e 94 e3 6e call 0xddc6 ; 0xddc6 1b0c8: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb if (farm_mode) { 1b0cc: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1b0d0: 88 23 and r24, r24 1b0d2: 41 f0 breq .+16 ; 0x1b0e4 oCheckMode = ClCheckMode::_Strict; 1b0d4: 82 e0 ldi r24, 0x02 ; 2 1b0d6: 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); 1b0da: 62 e0 ldi r22, 0x02 ; 2 1b0dc: 88 ea ldi r24, 0xA8 ; 168 1b0de: 9d e0 ldi r25, 0x0D ; 13 1b0e0: 0f 94 bf a0 call 0x3417e ; 0x3417e 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); 1b0e4: 68 e2 ldi r22, 0x28 ; 40 1b0e6: 87 ea ldi r24, 0xA7 ; 167 1b0e8: 9d e0 ldi r25, 0x0D ; 13 1b0ea: 0e 94 e3 6e call 0xddc6 ; 0xddc6 1b0ee: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 eeprom_init_default_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM, EEPROM_NOZZLE_DIAMETER_uM_DEFAULT); 1b0f2: 60 e9 ldi r22, 0x90 ; 144 1b0f4: 71 e0 ldi r23, 0x01 ; 1 1b0f6: 85 ea ldi r24, 0xA5 ; 165 1b0f8: 9d e0 ldi r25, 0x0D ; 13 1b0fa: 0e 94 cb 6e call 0xdd96 ; 0xdd96 oCheckModel = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODEL, (uint8_t)ClCheckMode::_Warn); 1b0fe: 61 e0 ldi r22, 0x01 ; 1 1b100: 84 ea ldi r24, 0xA4 ; 164 1b102: 9d e0 ldi r25, 0x0D ; 13 1b104: 0e 94 e3 6e call 0xddc6 ; 0xddc6 1b108: 80 93 b8 03 sts 0x03B8, r24 ; 0x8003b8 oCheckVersion = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_VERSION, (uint8_t)ClCheckMode::_Warn); 1b10c: 61 e0 ldi r22, 0x01 ; 1 1b10e: 83 ea ldi r24, 0xA3 ; 163 1b110: 9d e0 ldi r25, 0x0D ; 13 1b112: 0e 94 e3 6e call 0xddc6 ; 0xddc6 1b116: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 oCheckGcode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_GCODE, (uint8_t)ClCheckMode::_Warn); 1b11a: 61 e0 ldi r22, 0x01 ; 1 1b11c: 82 ea ldi r24, 0xA2 ; 162 1b11e: 9d e0 ldi r25, 0x0D ; 13 1b120: 0e 94 e3 6e call 0xddc6 ; 0xddc6 1b124: 80 93 b6 03 sts 0x03B6, r24 ; 0x8003b6 oCheckFilament = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_FILAMENT, (uint8_t)ClCheckMode::_Warn); 1b128: 61 e0 ldi r22, 0x01 ; 1 1b12a: 80 e2 ldi r24, 0x20 ; 32 1b12c: 9c e0 ldi r25, 0x0C ; 12 1b12e: 0e 94 e3 6e call 0xddc6 ; 0xddc6 1b132: 80 93 bc 03 sts 0x03BC, r24 ; 0x8003bc } 1b136: 08 95 ret 0001b138
: void setupUSB() __attribute__((weak)); void setupUSB() { } int main(void) { 1b138: cf 93 push r28 1b13a: df 93 push r29 1b13c: 00 d0 rcall .+0 ; 0x1b13e 1b13e: 00 d0 rcall .+0 ; 0x1b140 1b140: 00 d0 rcall .+0 ; 0x1b142 1b142: 1f 92 push r1 1b144: cd b7 in r28, 0x3d ; 61 1b146: de b7 in r29, 0x3e ; 62 void init() { // this needs to be called before setup() or some functions won't // work there sei(); 1b148: 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); 1b14a: 84 b5 in r24, 0x24 ; 36 1b14c: 82 60 ori r24, 0x02 ; 2 1b14e: 84 bd out 0x24, r24 ; 36 sbi(TCCR0A, WGM00); 1b150: 84 b5 in r24, 0x24 ; 36 1b152: 81 60 ori r24, 0x01 ; 1 1b154: 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); 1b156: 85 b5 in r24, 0x25 ; 37 1b158: 82 60 ori r24, 0x02 ; 2 1b15a: 85 bd out 0x25, r24 ; 37 sbi(TCCR0B, CS00); 1b15c: 85 b5 in r24, 0x25 ; 37 1b15e: 81 60 ori r24, 0x01 ; 1 1b160: 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); 1b162: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1b166: 81 60 ori r24, 0x01 ; 1 1b168: 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; 1b16c: 10 92 81 00 sts 0x0081, r1 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // set timer 1 prescale factor to 64 sbi(TCCR1B, CS11); 1b170: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1b174: 82 60 ori r24, 0x02 ; 2 1b176: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> #if F_CPU >= 8000000L sbi(TCCR1B, CS10); 1b17a: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1b17e: 81 60 ori r24, 0x01 ; 1 1b180: 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); 1b184: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1b188: 81 60 ori r24, 0x01 ; 1 1b18a: 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); 1b18e: 80 91 b1 00 lds r24, 0x00B1 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> 1b192: 84 60 ori r24, 0x04 ; 4 1b194: 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); 1b198: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1b19c: 81 60 ori r24, 0x01 ; 1 1b19e: 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 1b1a2: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1b1a6: 82 60 ori r24, 0x02 ; 2 1b1a8: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> sbi(TCCR3B, CS30); 1b1ac: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1b1b0: 81 60 ori r24, 0x01 ; 1 1b1b2: 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 1b1b6: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1b1ba: 81 60 ori r24, 0x01 ; 1 1b1bc: 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 1b1c0: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1b1c4: 82 60 ori r24, 0x02 ; 2 1b1c6: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> sbi(TCCR4B, CS40); 1b1ca: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1b1ce: 81 60 ori r24, 0x01 ; 1 1b1d0: 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 1b1d4: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1b1d8: 81 60 ori r24, 0x01 ; 1 1b1da: 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 1b1de: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1b1e2: 82 60 ori r24, 0x02 ; 2 1b1e4: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> sbi(TCCR5B, CS50); 1b1e8: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1b1ec: 81 60 ori r24, 0x01 ; 1 1b1ee: 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 1b1f2: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1b1f6: 81 60 ori r24, 0x01 ; 1 1b1f8: 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); 1b1fc: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1b200: 84 60 ori r24, 0x04 ; 4 1b202: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS1); 1b206: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1b20a: 82 60 ori r24, 0x02 ; 2 1b20c: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS0); 1b210: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1b214: 81 60 ori r24, 0x01 ; 1 1b216: 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); 1b21a: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1b21e: 80 68 ori r24, 0x80 ; 128 1b220: 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; 1b224: 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) { 1b228: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1b22a: f8 94 cli wdt_reset(); 1b22c: a8 95 wdr MCUSR &= ~_BV(WDRF); 1b22e: 84 b7 in r24, 0x34 ; 52 1b230: 87 7f andi r24, 0xF7 ; 247 1b232: 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" ); 1b234: 0f b6 in r0, 0x3f ; 63 1b236: f8 94 cli 1b238: a8 95 wdr 1b23a: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1b23e: 88 61 ori r24, 0x18 ; 24 1b240: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1b244: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1b248: 0f be out 0x3f, r0 ; 63 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1b24a: 9f bf out 0x3f, r25 ; 63 CRITICAL_SECTION_END; } void timer2_init(void) { CRITICAL_SECTION_START; 1b24c: 9f b7 in r25, 0x3f ; 63 1b24e: 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 1b250: 10 92 b0 00 sts 0x00B0, r1 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> TCCR2B = (4 << CS20); //WGM_2=0, CS_0-2=011 1b254: 84 e0 ldi r24, 0x04 ; 4 1b256: 80 93 b1 00 sts 0x00B1, r24 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> //mask timer2 interrupts - enable OVF, disable others TIMSK2 |= (1< 1b25e: 81 60 ori r24, 0x01 ; 1 1b260: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1b268: 8d 7f andi r24, 0xFD ; 253 1b26a: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1b272: 8b 7f andi r24, 0xFB ; 251 1b274: 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; 1b278: 10 92 b3 00 sts 0x00B3, r1 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> CRITICAL_SECTION_END; 1b27c: 9f bf out 0x3f, r25 ; 63 return 0; } void lcd_init(void) { WRITE(LCD_PINS_ENABLE,LOW); 1b27e: 5b 98 cbi 0x0b, 3 ; 11 SET_OUTPUT(LCD_PINS_RS); 1b280: 55 9a sbi 0x0a, 5 ; 10 SET_OUTPUT(LCD_PINS_ENABLE); 1b282: 53 9a sbi 0x0a, 3 ; 10 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); 1b284: 52 9a sbi 0x0a, 2 ; 10 SET_OUTPUT(LCD_PINS_D5); 1b286: 9c 9a sbi 0x13, 4 ; 19 SET_OUTPUT(LCD_PINS_D6); 1b288: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1b28c: 80 68 ori r24, 0x80 ; 128 1b28e: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> SET_OUTPUT(LCD_PINS_D7); 1b292: 9b 9a sbi 0x13, 3 ; 19 #ifdef LCD_8BIT lcd_displayfunction |= LCD_8BITMODE; #endif lcd_displayfunction |= LCD_2LINE; 1b294: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce <_ZL19lcd_displayfunction.lto_priv.515> 1b298: 88 60 ori r24, 0x08 ; 8 1b29a: 80 93 ce 03 sts 0x03CE, r24 ; 0x8003ce <_ZL19lcd_displayfunction.lto_priv.515> 1b29e: 2f ef ldi r18, 0xFF ; 255 1b2a0: 30 e7 ldi r19, 0x70 ; 112 1b2a2: 82 e0 ldi r24, 0x02 ; 2 1b2a4: 21 50 subi r18, 0x01 ; 1 1b2a6: 30 40 sbci r19, 0x00 ; 0 1b2a8: 80 40 sbci r24, 0x00 ; 0 1b2aa: e1 f7 brne .-8 ; 0x1b2a4 1b2ac: 00 c0 rjmp .+0 ; 0x1b2ae 1b2ae: 00 00 nop _delay_us(50000); lcd_begin(1); //first time init 1b2b0: 81 e0 ldi r24, 0x01 ; 1 1b2b2: 0e 94 dc 69 call 0xd3b8 ; 0xd3b8 fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream 1b2b6: 84 e8 ldi r24, 0x84 ; 132 1b2b8: 9b e6 ldi r25, 0x6B ; 107 1b2ba: 90 93 c9 03 sts 0x03C9, r25 ; 0x8003c9 <_lcdout+0x9> 1b2be: 80 93 c8 03 sts 0x03C8, r24 ; 0x8003c8 <_lcdout+0x8> 1b2c2: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb <_lcdout+0xb> 1b2c6: 10 92 ca 03 sts 0x03CA, r1 ; 0x8003ca <_lcdout+0xa> 1b2ca: 12 e0 ldi r17, 0x02 ; 2 1b2cc: 10 93 c3 03 sts 0x03C3, r17 ; 0x8003c3 <_lcdout+0x3> 1b2d0: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd <_lcdout+0xd> 1b2d4: 10 92 cc 03 sts 0x03CC, r1 ; 0x8003cc <_lcdout+0xc> void ultralcd_init() { backlight_init(); lcd_init(); lcd_refresh(); 1b2d8: 0e 94 1d 6a call 0xd43a ; 0xd43a lcd_longpress_func = menu_lcd_longpress_func; 1b2dc: 85 ee ldi r24, 0xE5 ; 229 1b2de: 95 eb ldi r25, 0xB5 ; 181 1b2e0: 90 93 d5 03 sts 0x03D5, r25 ; 0x8003d5 1b2e4: 80 93 d4 03 sts 0x03D4, r24 ; 0x8003d4 lcd_lcdupdate_func = menu_lcd_lcdupdate_func; 1b2e8: 8d e6 ldi r24, 0x6D ; 109 1b2ea: 9b ee ldi r25, 0xEB ; 235 1b2ec: 90 93 d3 03 sts 0x03D3, r25 ; 0x8003d3 1b2f0: 80 93 d2 03 sts 0x03D2, r24 ; 0x8003d2 menu_menu = lcd_status_screen; 1b2f4: 85 e1 ldi r24, 0x15 ; 21 1b2f6: 97 e3 ldi r25, 0x37 ; 55 1b2f8: 90 93 d1 03 sts 0x03D1, r25 ; 0x8003d1 1b2fc: 80 93 d0 03 sts 0x03D0, r24 ; 0x8003d0 SET_INPUT(BTN_EN1); 1b300: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1b304: 8b 7f andi r24, 0xFB ; 251 1b306: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_INPUT(BTN_EN2); 1b30a: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1b30e: 8d 7f andi r24, 0xFD ; 253 1b310: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(BTN_EN1, HIGH); 1b314: 9f b7 in r25, 0x3f ; 63 1b316: f8 94 cli 1b318: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1b31c: 84 60 ori r24, 0x04 ; 4 1b31e: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1b322: 9f bf out 0x3f, r25 ; 63 WRITE(BTN_EN2, HIGH); 1b324: 9f b7 in r25, 0x3f ; 63 1b326: f8 94 cli 1b328: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1b32c: 82 60 ori r24, 0x02 ; 2 1b32e: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1b332: 9f bf out 0x3f, r25 ; 63 #if BTN_ENC > 0 SET_INPUT(BTN_ENC); 1b334: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1b338: 8f 7b andi r24, 0xBF ; 191 1b33a: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BTN_ENC, HIGH); 1b33e: 9f b7 in r25, 0x3f ; 63 1b340: f8 94 cli 1b342: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1b346: 80 64 ori r24, 0x40 ; 64 1b348: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1b34c: 9f bf out 0x3f, r25 ; 63 #endif #if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0) SET_INPUT(SDCARDDETECT); 1b34e: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1b352: 8e 7f andi r24, 0xFE ; 254 1b354: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(SDCARDDETECT, HIGH); 1b358: 9f b7 in r25, 0x3f ; 63 1b35a: f8 94 cli 1b35c: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1b360: 81 60 ori r24, 0x01 ; 1 1b362: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1b366: 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); 1b368: af e9 ldi r26, 0x9F ; 159 1b36a: bf e0 ldi r27, 0x0F ; 15 1b36c: 11 97 sbiw r26, 0x01 ; 1 1b36e: f1 f7 brne .-4 ; 0x1b36c 1b370: 00 c0 rjmp .+0 ; 0x1b372 1b372: 00 00 nop _delay_ms(1); //wait for the pullups to raise the line lcd_oldcardstatus = IS_SD_INSERTED; 1b374: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1b378: 80 95 com r24 1b37a: 81 70 andi r24, 0x01 ; 1 1b37c: 80 93 cf 03 sts 0x03CF, r24 ; 0x8003cf #endif//(SDCARDDETECT > 0) // Initialise status line strncpy_P(lcd_status_message, MSG_WELCOME, LCD_WIDTH); 1b380: 44 e1 ldi r20, 0x14 ; 20 1b382: 50 e0 ldi r21, 0x00 ; 0 1b384: 67 e6 ldi r22, 0x67 ; 103 1b386: 7b e6 ldi r23, 0x6B ; 107 1b388: 89 e0 ldi r24, 0x09 ; 9 1b38a: 95 e0 ldi r25, 0x05 ; 5 1b38c: 0f 94 88 9e call 0x33d10 ; 0x33d10 extern "C" { #endif //defined(__cplusplus) static inline void spi_init() { DDRB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 1b390: 84 b1 in r24, 0x04 ; 4 1b392: 81 7f andi r24, 0xF1 ; 241 1b394: 84 b9 out 0x04, r24 ; 4 DDRB |= (1 << DD_SS) | (1 << DD_SCK) | (1 << DD_MOSI); 1b396: 84 b1 in r24, 0x04 ; 4 1b398: 87 60 ori r24, 0x07 ; 7 1b39a: 84 b9 out 0x04, r24 ; 4 PORTB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 1b39c: 85 b1 in r24, 0x05 ; 5 1b39e: 81 7f andi r24, 0xF1 ; 241 1b3a0: 85 b9 out 0x05, r24 ; 5 PORTB |= (1 << DD_SS); 1b3a2: 28 9a sbi 0x05, 0 ; 5 SPCR = SPI_SPCR(0, 0, 0, 1, 0); //SPE=1, MSTR=1 (0x50) 1b3a4: 80 e5 ldi r24, 0x50 ; 80 1b3a6: 8c bd out 0x2c, r24 ; 44 SPSR = 0x00; 1b3a8: 1d bc out 0x2d, r1 ; 45 } void lcd_splash() { lcd_clear(); // clears display and homes screen 1b3aa: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_printf_P(PSTR("\n Original Prusa i3\n Prusa Research\n%20.20S"), PSTR(FW_VERSION)); 1b3ae: 8a e9 ldi r24, 0x9A ; 154 1b3b0: 95 e8 ldi r25, 0x85 ; 133 1b3b2: 9f 93 push r25 1b3b4: 8f 93 push r24 1b3b6: 81 ea ldi r24, 0xA1 ; 161 1b3b8: 95 e8 ldi r25, 0x85 ; 133 1b3ba: 9f 93 push r25 1b3bc: 8f 93 push r24 1b3be: 0e 94 4a 69 call 0xd294 ; 0xd294 static void Sound_DoSound_Encoder_Move(void); static void Sound_DoSound_Blind_Alert(void); void Sound_Init(void) { SET_OUTPUT(BEEPER); 1b3c2: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1b3c6: 84 60 ori r24, 0x04 ; 4 1b3c8: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> eSoundMode = static_cast(eeprom_init_default_byte((uint8_t*)EEPROM_SOUND_MODE, e_SOUND_MODE_DEFAULT)); 1b3cc: 60 e0 ldi r22, 0x00 ; 0 1b3ce: 87 ed ldi r24, 0xD7 ; 215 1b3d0: 9e e0 ldi r25, 0x0E ; 14 1b3d2: 0e 94 e3 6e call 0xddc6 ; 0xddc6 1b3d6: 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); 1b3da: 60 e0 ldi r22, 0x00 ; 0 1b3dc: 88 e0 ldi r24, 0x08 ; 8 1b3de: 9f e0 ldi r25, 0x0F ; 15 1b3e0: 0e 94 e3 6e call 0xddc6 ; 0xddc6 1b3e4: 80 93 04 05 sts 0x0504, r24 ; 0x800504 MYSERIAL.begin(BAUDRATE); 1b3e8: 0e 94 64 b0 call 0x160c8 ; 0x160c8 fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream 1b3ec: 8b e4 ldi r24, 0x4B ; 75 1b3ee: 90 e7 ldi r25, 0x70 ; 112 1b3f0: 90 93 27 04 sts 0x0427, r25 ; 0x800427 <_uartout+0x9> 1b3f4: 80 93 26 04 sts 0x0426, r24 ; 0x800426 <_uartout+0x8> 1b3f8: 10 92 29 04 sts 0x0429, r1 ; 0x800429 <_uartout+0xb> 1b3fc: 10 92 28 04 sts 0x0428, r1 ; 0x800428 <_uartout+0xa> 1b400: 10 93 21 04 sts 0x0421, r17 ; 0x800421 <_uartout+0x3> 1b404: 10 92 2b 04 sts 0x042B, r1 ; 0x80042b <_uartout+0xd> 1b408: 10 92 2a 04 sts 0x042A, r1 ; 0x80042a <_uartout+0xc> stdout = uartout; 1b40c: 8e e1 ldi r24, 0x1E ; 30 1b40e: 94 e0 ldi r25, 0x04 ; 4 1b410: 90 93 01 17 sts 0x1701, r25 ; 0x801701 <__iob+0x3> 1b414: 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); 1b418: 60 e0 ldi r22, 0x00 ; 0 1b41a: 84 ec ldi r24, 0xC4 ; 196 1b41c: 9f e0 ldi r25, 0x0F ; 15 1b41e: 0e 94 e3 6e call 0xddc6 ; 0xddc6 1b422: 80 93 ca 0d sts 0x0DCA, r24 ; 0x800dca if (farm_mode) { 1b426: 0f 90 pop r0 1b428: 0f 90 pop r0 1b42a: 0f 90 pop r0 1b42c: 0f 90 pop r0 1b42e: 88 23 and r24, r24 1b430: 79 f0 breq .+30 ; 0x1b450 no_response = true; //we need confirmation by recieving PRUSA thx 1b432: 81 e0 ldi r24, 0x01 ; 1 1b434: 80 93 d6 03 sts 0x03D6, r24 ; 0x8003d6 <_ZL11no_response.lto_priv.497> prusa_statistics(8); 1b438: 88 e0 ldi r24, 0x08 ; 8 1b43a: 0f 94 be 98 call 0x3317c ; 0x3317c #ifdef HAS_SECOND_SERIAL_PORT selectedSerialPort = 1; #endif //HAS_SECOND_SERIAL_PORT MYSERIAL.begin(BAUDRATE); 1b43e: 0e 94 64 b0 call 0x160c8 ; 0x160c8 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1b442: 10 92 85 16 sts 0x1685, r1 ; 0x801685 1b446: 61 e0 ldi r22, 0x01 ; 1 1b448: 87 e8 ldi r24, 0x87 ; 135 1b44a: 9f e0 ldi r25, 0x0F ; 15 1b44c: 0f 94 bf a0 call 0x3417e ; 0x3417e } #endif //PRUSA_SN_SUPPORT #ifndef XFLASH SERIAL_PROTOCOLLNPGM("start"); 1b450: 82 e9 ldi r24, 0x92 ; 146 1b452: 96 e8 ldi r25, 0x86 ; 134 1b454: 0e 94 49 72 call 0xe492 ; 0xe492 #else if ((optiboot_status != 0) || (selectedSerialPort != 0)) SERIAL_PROTOCOLLNPGM("start"); #endif SERIAL_ECHO_START; 1b458: 81 e6 ldi r24, 0x61 ; 97 1b45a: 9d e9 ldi r25, 0x9D ; 157 1b45c: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 puts_P(PSTR(" " FW_VERSION_FULL "_" FW_COMMIT_HASH)); 1b460: 8b e7 ldi r24, 0x7B ; 123 1b462: 96 e8 ldi r25, 0x86 ; 134 1b464: 0f 94 84 9f call 0x33f08 ; 0x33f08 // by default the MMU shall remain disabled - PFW-1418 if (eeprom_init_default_byte((uint8_t *)EEPROM_MMU_ENABLED, 0)) { 1b468: 60 e0 ldi r22, 0x00 ; 0 1b46a: 8c ea ldi r24, 0xAC ; 172 1b46c: 9c e0 ldi r25, 0x0C ; 12 1b46e: 0e 94 e3 6e call 0xddc6 ; 0xddc6 1b472: 81 11 cpse r24, r1 MMU2::mmu2.Start(); 1b474: 0f 94 59 63 call 0x2c6b2 ; 0x2c6b2 } MMU2::mmu2.Status(); 1b478: 0f 94 50 42 call 0x284a0 ; 0x284a0 } void SpoolJoin::initSpoolJoinStatus() { // Useful information to see during bootup SERIAL_ECHOPGM("SpoolJoin is "); 1b47c: 8f ec ldi r24, 0xCF ; 207 1b47e: 95 e8 ldi r25, 0x85 ; 133 1b480: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_SPOOL_JOIN, (uint8_t)EEPROM::Disabled); 1b484: 62 e0 ldi r22, 0x02 ; 2 1b486: 86 ed ldi r24, 0xD6 ; 214 1b488: 9e e0 ldi r25, 0x0E ; 14 1b48a: 0e 94 e3 6e call 0xddc6 ; 0xddc6 if (status == (uint8_t)EEPROM::Enabled) 1b48e: 81 30 cpi r24, 0x01 ; 1 1b490: 09 f0 breq .+2 ; 0x1b494 1b492: 74 c0 rjmp .+232 ; 0x1b57c { SERIAL_ECHOLNRPGM(_O(MSG_ON)); 1b494: 81 eb ldi r24, 0xB1 ; 177 1b496: 9a e5 ldi r25, 0x5A ; 90 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 1b498: 0e 94 49 72 call 0xe492 ; 0xe492 #endif #endif //DEBUG_SEC_LANG // Check startup - does nothing if bootloader sets MCUSR to 0 byte mcu = MCUSR; 1b49c: 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); 1b49e: 10 ff sbrs r17, 0 1b4a0: 04 c0 rjmp .+8 ; 0x1b4aa 1b4a2: 81 e0 ldi r24, 0x01 ; 1 1b4a4: 99 e6 ldi r25, 0x69 ; 105 1b4a6: 0f 94 84 9f call 0x33f08 ; 0x33f08 if (mcu & 2) puts_P(MSG_EXTERNAL_RESET); 1b4aa: 11 ff sbrs r17, 1 1b4ac: 04 c0 rjmp .+8 ; 0x1b4b6 1b4ae: 81 ef ldi r24, 0xF1 ; 241 1b4b0: 98 e6 ldi r25, 0x68 ; 104 1b4b2: 0f 94 84 9f call 0x33f08 ; 0x33f08 if (mcu & 4) puts_P(MSG_BROWNOUT_RESET); 1b4b6: 12 ff sbrs r17, 2 1b4b8: 04 c0 rjmp .+8 ; 0x1b4c2 1b4ba: 80 ee ldi r24, 0xE0 ; 224 1b4bc: 98 e6 ldi r25, 0x68 ; 104 1b4be: 0f 94 84 9f call 0x33f08 ; 0x33f08 if (mcu & 8) puts_P(MSG_WATCHDOG_RESET); 1b4c2: 13 ff sbrs r17, 3 1b4c4: 04 c0 rjmp .+8 ; 0x1b4ce 1b4c6: 80 ed ldi r24, 0xD0 ; 208 1b4c8: 98 e6 ldi r25, 0x68 ; 104 1b4ca: 0f 94 84 9f call 0x33f08 ; 0x33f08 if (mcu & 32) puts_P(MSG_SOFTWARE_RESET); 1b4ce: 15 ff sbrs r17, 5 1b4d0: 04 c0 rjmp .+8 ; 0x1b4da 1b4d2: 80 ec ldi r24, 0xC0 ; 192 1b4d4: 98 e6 ldi r25, 0x68 ; 104 1b4d6: 0f 94 84 9f call 0x33f08 ; 0x33f08 MCUSR = 0; 1b4da: 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; 1b4dc: 81 e6 ldi r24, 0x61 ; 97 1b4de: 9d e9 ldi r25, 0x9D ; 157 1b4e0: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHORPGM(_n(" Last Updated: "));////MSG_CONFIGURATION_VER 1b4e4: 80 eb ldi r24, 0xB0 ; 176 1b4e6: 98 e6 ldi r25, 0x68 ; 104 1b4e8: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOPGM(STRING_VERSION_CONFIG_H); 1b4ec: 87 e6 ldi r24, 0x67 ; 103 1b4ee: 96 e8 ldi r25, 0x86 ; 134 1b4f0: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHORPGM(_n(" | Author: "));////MSG_AUTHOR 1b4f4: 84 ea ldi r24, 0xA4 ; 164 1b4f6: 98 e6 ldi r25, 0x68 ; 104 1b4f8: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLNPGM(STRING_CONFIG_H_AUTHOR); 1b4fc: 8f e5 ldi r24, 0x5F ; 95 1b4fe: 96 e8 ldi r25, 0x86 ; 134 1b500: 0e 94 49 72 call 0xe492 ; 0xe492 #endif #endif SERIAL_ECHO_START; 1b504: 81 e6 ldi r24, 0x61 ; 97 1b506: 9d e9 ldi r25, 0x9D ; 157 1b508: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHORPGM(_n(" Free Memory: "));////MSG_FREE_MEMORY 1b50c: 85 e9 ldi r24, 0x95 ; 149 1b50e: 98 e6 ldi r25, 0x68 ; 104 1b510: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 /** Amount of free RAM * \return The number of free bytes. */ int SdFatUtil::FreeRam() { char top; return __brkval ? &top - __brkval : &top - &__bss_end; 1b514: 80 91 fa 16 lds r24, 0x16FA ; 0x8016fa <__brkval> 1b518: 90 91 fb 16 lds r25, 0x16FB ; 0x8016fb <__brkval+0x1> 1b51c: fe 01 movw r30, r28 1b51e: 31 96 adiw r30, 0x01 ; 1 1b520: 7f 01 movw r14, r30 1b522: bf 01 movw r22, r30 1b524: 00 97 sbiw r24, 0x00 ; 0 1b526: 69 f1 breq .+90 ; 0x1b582 1b528: 68 1b sub r22, r24 1b52a: 79 0b sbc r23, r25 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1b52c: 07 2e mov r0, r23 1b52e: 00 0c add r0, r0 1b530: 88 0b sbc r24, r24 1b532: 99 0b sbc r25, r25 1b534: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_ECHO(freeMemory()); SERIAL_ECHORPGM(_n(" PlannerBufferBytes: "));////MSG_PLANNER_BUFFER_BYTES 1b538: 8e e7 ldi r24, 0x7E ; 126 1b53a: 98 e6 ldi r25, 0x68 ; 104 1b53c: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); 1b540: 80 ee ldi r24, 0xE0 ; 224 1b542: 96 e0 ldi r25, 0x06 ; 6 1b544: 0f 94 62 42 call 0x284c4 ; 0x284c4 #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); 1b548: 6c ef ldi r22, 0xFC ; 252 1b54a: 70 e0 ldi r23, 0x00 ; 0 1b54c: 8e ee ldi r24, 0xEE ; 238 1b54e: 9e e0 ldi r25, 0x0E ; 14 1b550: 0e 94 cb 6e call 0xdd96 ; 0xdd96 1b554: 8c 01 movw r16, r24 uint16_t motherboard = eeprom_init_default_word((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); 1b556: 6b ec ldi r22, 0xCB ; 203 1b558: 70 e0 ldi r23, 0x00 ; 0 1b55a: 8c ee ldi r24, 0xEC ; 236 1b55c: 9e e0 ldi r25, 0x0E ; 14 1b55e: 0e 94 cb 6e call 0xdd96 ; 0xdd96 if (printer_type != PRINTER_TYPE) version_changed |= 0b10; 1b562: 0c 3f cpi r16, 0xFC ; 252 1b564: 11 05 cpc r17, r1 1b566: 09 f0 breq .+2 ; 0x1b56a 1b568: 18 c6 rjmp .+3120 ; 0x1c19a if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1b56a: 01 e0 ldi r16, 0x01 ; 1 1b56c: 8b 3c cpi r24, 0xCB ; 203 1b56e: 91 05 cpc r25, r1 1b570: 09 f4 brne .+2 ; 0x1b574 1b572: 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(); 1b574: 0e 94 de 74 call 0xe9bc ; 0xe9bc 1b578: b8 2e mov r11, r24 1b57a: 17 c6 rjmp .+3118 ; 0x1c1aa 1b57c: 8b ea ldi r24, 0xAB ; 171 1b57e: 9a e5 ldi r25, 0x5A ; 90 1b580: 8b cf rjmp .-234 ; 0x1b498 1b582: 64 50 subi r22, 0x04 ; 4 1b584: 77 41 sbci r23, 0x17 ; 23 1b586: d2 cf rjmp .-92 ; 0x1b52c minttemp_raw[0] -= OVERSAMPLENR; #endif } #endif //MINTEMP #ifdef HEATER_0_MAXTEMP maxttemp[0] = HEATER_0_MAXTEMP; 1b588: 81 e3 ldi r24, 0x31 ; 49 1b58a: 91 e0 ldi r25, 0x01 ; 1 1b58c: 90 93 55 02 sts 0x0255, r25 ; 0x800255 <_ZL8maxttemp.lto_priv.433+0x1> 1b590: 80 93 54 02 sts 0x0254, r24 ; 0x800254 <_ZL8maxttemp.lto_priv.433> while(analog2temp(maxttemp_raw[0], 0) > HEATER_0_MAXTEMP) { 1b594: c0 90 d9 03 lds r12, 0x03D9 ; 0x8003d9 <_ZL12maxttemp_raw.lto_priv.427> 1b598: d0 90 da 03 lds r13, 0x03DA ; 0x8003da <_ZL12maxttemp_raw.lto_priv.427+0x1> 1b59c: c6 01 movw r24, r12 1b59e: 0e 94 bb bd call 0x17b76 ; 0x17b76 1b5a2: 20 e0 ldi r18, 0x00 ; 0 1b5a4: 30 e8 ldi r19, 0x80 ; 128 1b5a6: 48 e9 ldi r20, 0x98 ; 152 1b5a8: 53 e4 ldi r21, 0x43 ; 67 1b5aa: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 1b5ae: 18 16 cp r1, r24 1b5b0: 44 f4 brge .+16 ; 0x1b5c2 #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP maxttemp_raw[0] -= OVERSAMPLENR; #else maxttemp_raw[0] += OVERSAMPLENR; 1b5b2: 20 e1 ldi r18, 0x10 ; 16 1b5b4: c2 0e add r12, r18 1b5b6: d1 1c adc r13, r1 1b5b8: d0 92 da 03 sts 0x03DA, r13 ; 0x8003da <_ZL12maxttemp_raw.lto_priv.427+0x1> 1b5bc: c0 92 d9 03 sts 0x03D9, r12 ; 0x8003d9 <_ZL12maxttemp_raw.lto_priv.427> 1b5c0: e9 cf rjmp .-46 ; 0x1b594 #endif } #endif //MAXTEMP #ifdef BED_MINTEMP while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { 1b5c2: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.425> 1b5c6: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.425+0x1> 1b5ca: 0f 94 a4 16 call 0x22d48 ; 0x22d48 1b5ce: 20 e0 ldi r18, 0x00 ; 0 1b5d0: 30 e0 ldi r19, 0x00 ; 0 1b5d2: 40 ef ldi r20, 0xF0 ; 240 1b5d4: 51 e4 ldi r21, 0x41 ; 65 1b5d6: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1b5da: 87 ff sbrs r24, 7 1b5dc: 0a c0 rjmp .+20 ; 0x1b5f2 #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_minttemp_raw += OVERSAMPLENR; #else bed_minttemp_raw -= OVERSAMPLENR; 1b5de: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.425> 1b5e2: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.425+0x1> 1b5e6: 40 97 sbiw r24, 0x10 ; 16 1b5e8: 90 93 51 02 sts 0x0251, r25 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.425+0x1> 1b5ec: 80 93 50 02 sts 0x0250, r24 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.425> 1b5f0: e8 cf rjmp .-48 ; 0x1b5c2 #endif } #endif //BED_MINTEMP #ifdef BED_MAXTEMP while(analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) { 1b5f2: 80 91 d7 03 lds r24, 0x03D7 ; 0x8003d7 <_ZL16bed_maxttemp_raw.lto_priv.428> 1b5f6: 90 91 d8 03 lds r25, 0x03D8 ; 0x8003d8 <_ZL16bed_maxttemp_raw.lto_priv.428+0x1> 1b5fa: 0f 94 a4 16 call 0x22d48 ; 0x22d48 1b5fe: 20 e0 ldi r18, 0x00 ; 0 1b600: 30 e0 ldi r19, 0x00 ; 0 1b602: 4a ef ldi r20, 0xFA ; 250 1b604: 52 e4 ldi r21, 0x42 ; 66 1b606: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 1b60a: 18 16 cp r1, r24 1b60c: 54 f4 brge .+20 ; 0x1b622 #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_maxttemp_raw -= OVERSAMPLENR; #else bed_maxttemp_raw += OVERSAMPLENR; 1b60e: 80 91 d7 03 lds r24, 0x03D7 ; 0x8003d7 <_ZL16bed_maxttemp_raw.lto_priv.428> 1b612: 90 91 d8 03 lds r25, 0x03D8 ; 0x8003d8 <_ZL16bed_maxttemp_raw.lto_priv.428+0x1> 1b616: 40 96 adiw r24, 0x10 ; 16 1b618: 90 93 d8 03 sts 0x03D8, r25 ; 0x8003d8 <_ZL16bed_maxttemp_raw.lto_priv.428+0x1> 1b61c: 80 93 d7 03 sts 0x03D7, r24 ; 0x8003d7 <_ZL16bed_maxttemp_raw.lto_priv.428> 1b620: e8 cf rjmp .-48 ; 0x1b5f2 #include #include "macros.h" void timer0_init(void) { CRITICAL_SECTION_START; 1b622: 9f b7 in r25, 0x3f ; 63 1b624: f8 94 cli TCNT0 = 0; 1b626: 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; 1b628: 8f ef ldi r24, 0xFF ; 255 1b62a: 88 bd out 0x28, r24 ; 40 // Set fast PWM mode and inverting mode. TCCR0A = (1 << WGM01) | (1 << WGM00) | (1 << COM0B1) | (1 << COM0B0); 1b62c: 83 e3 ldi r24, 0x33 ; 51 1b62e: 84 bd out 0x24, r24 ; 36 TCCR0B = (1 << CS01); // CLK/8 prescaling 1b630: 12 e0 ldi r17, 0x02 ; 2 1b632: 15 bd out 0x25, r17 ; 37 TIMSK0 |= (1 << TOIE0); // enable timer overflow interrupt 1b634: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1b638: 81 60 ori r24, 0x01 ; 1 1b63a: 80 93 6e 00 sts 0x006E, r24 ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> CRITICAL_SECTION_END; 1b63e: 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; 1b640: 80 e8 ldi r24, 0x80 ; 128 1b642: 80 93 b4 00 sts 0x00B4, r24 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> ENABLE_SOFT_PWM_INTERRUPT(); 1b646: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 1b64a: 84 60 ori r24, 0x04 ; 4 1b64c: 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; 1b650: 2f b7 in r18, 0x3f ; 63 1b652: f8 94 cli SET_OUTPUT(BEEPER); 1b654: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1b658: 84 60 ori r24, 0x04 ; 4 1b65a: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BEEPER, LOW); 1b65e: 9f b7 in r25, 0x3f ; 63 1b660: f8 94 cli 1b662: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1b666: 8b 7f andi r24, 0xFB ; 251 1b668: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1b66c: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN); 1b66e: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1b672: 80 62 ori r24, 0x20 ; 32 1b674: 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); 1b678: 81 e0 ldi r24, 0x01 ; 1 1b67a: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> TCCR4B = _BV(WGM43) | _BV(CS42) | _BV(CS40); 1b67e: 85 e1 ldi r24, 0x15 ; 21 1b680: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> OCR4A = 255U; 1b684: 8f ef ldi r24, 0xFF ; 255 1b686: 90 e0 ldi r25, 0x00 ; 0 1b688: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1b68c: 80 93 a8 00 sts 0x00A8, r24 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> OCR4B = 255U; 1b690: 90 93 ab 00 sts 0x00AB, r25 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1b694: 80 93 aa 00 sts 0x00AA, r24 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> OCR4C = 255U; 1b698: 90 93 ad 00 sts 0x00AD, r25 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1b69c: 80 93 ac 00 sts 0x00AC, r24 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> TIMSK4 = 0; 1b6a0: 10 92 72 00 sts 0x0072, r1 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 1b6a4: 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")); 1b6a6: 8d ed ldi r24, 0xDD ; 221 1b6a8: 95 e8 ldi r25, 0x85 ; 133 1b6aa: 0f 94 84 9f call 0x33f08 ; 0x33f08 DIDR0 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) & 0xff); //disable digital inputs PORTF 1b6ae: 8f e5 ldi r24, 0x5F ; 95 1b6b0: 80 93 7e 00 sts 0x007E, r24 ; 0x80007e <__TEXT_REGION_LENGTH__+0x7c207e> DIDR2 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) >> 8); //disable digital inputs PORTK 1b6b4: 10 93 7d 00 sts 0x007D, r17 ; 0x80007d <__TEXT_REGION_LENGTH__+0x7c207d> ADMUX |= (1 << REFS0); //use AVCC as reference 1b6b8: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> 1b6bc: 80 64 ori r24, 0x40 ; 64 1b6be: 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); 1b6c2: 8f e9 ldi r24, 0x9F ; 159 1b6c4: 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(); 1b6c8: 0e 94 ed 7d call 0xfbda ; 0xfbda // initialize temperature timer ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1b6cc: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1b6ce: f8 94 cli // CTC TCCRxB &= ~(1< 1b6d4: 8f 7e andi r24, 0xEF ; 239 1b6d6: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxB |= (1< 1b6de: 88 60 ori r24, 0x08 ; 8 1b6e0: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxA &= ~(1< 1b6e8: 8d 7f andi r24, 0xFD ; 253 1b6ea: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> TCCRxA &= ~(1< 1b6f2: 8e 7f andi r24, 0xFE ; 254 1b6f4: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> // output mode = 00 (disconnected) TCCRxA &= ~(3< 1b6fc: 8f 73 andi r24, 0x3F ; 63 1b6fe: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> TCCRxA &= ~(3< 1b706: 8f 7c andi r24, 0xCF ; 207 1b708: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> // x/256 prescaler TCCRxB |= (1< 1b710: 84 60 ori r24, 0x04 ; 4 1b712: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxB &= ~(1< 1b71a: 8d 7f andi r24, 0xFD ; 253 1b71c: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxB &= ~(1< 1b724: 8e 7f andi r24, 0xFE ; 254 1b726: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> // reset counter TCNTx = 0; 1b72a: 10 92 95 00 sts 0x0095, r1 ; 0x800095 <__TEXT_REGION_LENGTH__+0x7c2095> 1b72e: 10 92 94 00 sts 0x0094, r1 ; 0x800094 <__TEXT_REGION_LENGTH__+0x7c2094> OCRxA = TEMP_TIM_OCRA_OVF; 1b732: 2b ee ldi r18, 0xEB ; 235 1b734: 31 e4 ldi r19, 0x41 ; 65 1b736: 30 93 99 00 sts 0x0099, r19 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 1b73a: 20 93 98 00 sts 0x0098, r18 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> // clear pending interrupts, enable COMPA TEMP_MGR_INT_FLAG_CLEAR(); 1b73e: c1 9a sbi 0x18, 1 ; 24 ENABLE_TEMP_MGR_INTERRUPT(); 1b740: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1b744: 82 60 ori r24, 0x02 ; 2 1b746: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1b74a: 9f bf out 0x3f, r25 ; 63 // SERIAL_ECHOLNPGM("planner_recalculate - 4"); } void plan_init() { block_buffer_head = 0; 1b74c: 10 92 a8 0d sts 0x0DA8, r1 ; 0x800da8 block_buffer_tail = 0; 1b750: 10 92 a9 0d sts 0x0DA9, r1 ; 0x800da9 memset(position, 0, sizeof(position)); // clear position 1b754: 80 e1 ldi r24, 0x10 ; 16 1b756: e6 ea ldi r30, 0xA6 ; 166 1b758: f6 e0 ldi r31, 0x06 ; 6 1b75a: df 01 movw r26, r30 1b75c: 28 2f mov r18, r24 1b75e: 1d 92 st X+, r1 1b760: 2a 95 dec r18 1b762: e9 f7 brne .-6 ; 0x1b75e #ifdef LIN_ADVANCE memset(position_float, 0, sizeof(position_float)); // clear position 1b764: e4 e0 ldi r30, 0x04 ; 4 1b766: f4 e0 ldi r31, 0x04 ; 4 1b768: df 01 movw r26, r30 1b76a: 28 2f mov r18, r24 1b76c: 1d 92 st X+, r1 1b76e: 2a 95 dec r18 1b770: e9 f7 brne .-6 ; 0x1b76c #endif memset(previous_speed, 0, sizeof(previous_speed)); 1b772: e4 ef ldi r30, 0xF4 ; 244 1b774: f3 e0 ldi r31, 0x03 ; 3 1b776: df 01 movw r26, r30 1b778: 1d 92 st X+, r1 1b77a: 8a 95 dec r24 1b77c: e9 f7 brne .-6 ; 0x1b778 previous_nominal_speed = 0.0; 1b77e: 10 92 f0 03 sts 0x03F0, r1 ; 0x8003f0 <_ZL22previous_nominal_speed.lto_priv.450> 1b782: 10 92 f1 03 sts 0x03F1, r1 ; 0x8003f1 <_ZL22previous_nominal_speed.lto_priv.450+0x1> 1b786: 10 92 f2 03 sts 0x03F2, r1 ; 0x8003f2 <_ZL22previous_nominal_speed.lto_priv.450+0x2> 1b78a: 10 92 f3 03 sts 0x03F3, r1 ; 0x8003f3 <_ZL22previous_nominal_speed.lto_priv.450+0x3> plan_reset_next_e_queue = false; 1b78e: 10 92 ef 03 sts 0x03EF, r1 ; 0x8003ef <_ZL23plan_reset_next_e_queue.lto_priv.448> plan_reset_next_e_sched = false; 1b792: 10 92 ee 03 sts 0x03EE, r1 ; 0x8003ee <_ZL23plan_reset_next_e_sched.lto_priv.449> } void factory_reset() { KEEPALIVE_STATE(PAUSED_FOR_USER); 1b796: 84 e0 ldi r24, 0x04 ; 4 1b798: 80 93 78 02 sts 0x0278, r24 ; 0x800278 if (!READ(BTN_ENC)) 1b79c: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1b7a0: 86 fd sbrc r24, 6 1b7a2: c6 c0 rjmp .+396 ; 0x1b930 1b7a4: bf ef ldi r27, 0xFF ; 255 1b7a6: e3 ed ldi r30, 0xD3 ; 211 1b7a8: f0 e3 ldi r31, 0x30 ; 48 1b7aa: b1 50 subi r27, 0x01 ; 1 1b7ac: e0 40 sbci r30, 0x00 ; 0 1b7ae: f0 40 sbci r31, 0x00 ; 0 1b7b0: e1 f7 brne .-8 ; 0x1b7aa 1b7b2: 00 c0 rjmp .+0 ; 0x1b7b4 1b7b4: 00 00 nop { _delay_ms(1000); if (!READ(BTN_ENC)) 1b7b6: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1b7ba: 86 fd sbrc r24, 6 1b7bc: b9 c0 rjmp .+370 ; 0x1b930 { lcd_clear(); 1b7be: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_puts_P(PSTR("Factory RESET")); 1b7c2: 87 e3 ldi r24, 0x37 ; 55 1b7c4: 96 e8 ldi r25, 0x86 ; 134 1b7c6: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 SET_OUTPUT(BEEPER); 1b7ca: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1b7ce: 84 60 ori r24, 0x04 ; 4 1b7d0: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> if(eSoundMode!=e_SOUND_MODE_SILENT) 1b7d4: 80 91 15 04 lds r24, 0x0415 ; 0x800415 1b7d8: 82 30 cpi r24, 0x02 ; 2 1b7da: 41 f0 breq .+16 ; 0x1b7ec WRITE(BEEPER, HIGH); 1b7dc: 9f b7 in r25, 0x3f ; 63 1b7de: f8 94 cli 1b7e0: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1b7e4: 84 60 ori r24, 0x04 ; 4 1b7e6: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1b7ea: 9f bf out 0x3f, r25 ; 63 while (!READ(BTN_ENC)); 1b7ec: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1b7f0: 86 ff sbrs r24, 6 1b7f2: fc cf rjmp .-8 ; 0x1b7ec WRITE(BEEPER, LOW); 1b7f4: 9f b7 in r25, 0x3f ; 63 1b7f6: f8 94 cli 1b7f8: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1b7fc: 8b 7f andi r24, 0xFB ; 251 1b7fe: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1b802: 9f bf out 0x3f, r25 ; 63 1b804: 2f ef ldi r18, 0xFF ; 255 1b806: 37 ea ldi r19, 0xA7 ; 167 1b808: 81 e6 ldi r24, 0x61 ; 97 1b80a: 21 50 subi r18, 0x01 ; 1 1b80c: 30 40 sbci r19, 0x00 ; 0 1b80e: 80 40 sbci r24, 0x00 ; 0 1b810: e1 f7 brne .-8 ; 0x1b80a 1b812: 00 c0 rjmp .+0 ; 0x1b814 1b814: 00 00 nop PSTR("Language"), PSTR("Statistics"), PSTR("Shipping prep"), PSTR("Service prep"), PSTR("All Data"), }; 1b816: 8d e1 ldi r24, 0x1D ; 29 1b818: 96 e8 ldi r25, 0x86 ; 134 1b81a: 9a 83 std Y+2, r25 ; 0x02 1b81c: 89 83 std Y+1, r24 ; 0x01 1b81e: 82 e1 ldi r24, 0x12 ; 18 1b820: 96 e8 ldi r25, 0x86 ; 134 1b822: 9c 83 std Y+4, r25 ; 0x04 1b824: 8b 83 std Y+3, r24 ; 0x03 1b826: 84 e0 ldi r24, 0x04 ; 4 1b828: 96 e8 ldi r25, 0x86 ; 134 1b82a: 9e 83 std Y+6, r25 ; 0x06 1b82c: 8d 83 std Y+5, r24 ; 0x05 1b82e: 87 ef ldi r24, 0xF7 ; 247 1b830: 95 e8 ldi r25, 0x85 ; 133 1b832: 98 87 std Y+8, r25 ; 0x08 1b834: 8f 83 std Y+7, r24 ; 0x07 1b836: 8e ee ldi r24, 0xEE ; 238 1b838: 95 e8 ldi r25, 0x85 ; 133 1b83a: 9a 87 std Y+10, r25 ; 0x0a 1b83c: 89 87 std Y+9, r24 ; 0x09 lcd_clear(); 1b83e: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_putc_at(0, 0, '>'); 1b842: 4e e3 ldi r20, 0x3E ; 62 1b844: 60 e0 ldi r22, 0x00 ; 0 1b846: 80 e0 ldi r24, 0x00 ; 0 1b848: 0e 94 91 69 call 0xd322 ; 0xd322 lcd_consume_click(); 1b84c: 0e 94 89 6b call 0xd712 ; 0xd712 } } char reset_menu() { static int8_t first = 0; char cursor_pos = 0; 1b850: 10 e0 ldi r17, 0x00 ; 0 1b852: d1 2c mov r13, r1 1b854: 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]); 1b856: 80 91 14 04 lds r24, 0x0414 ; 0x800414 1b85a: f6 01 movw r30, r12 1b85c: e8 0f add r30, r24 1b85e: f1 1d adc r31, r1 1b860: 87 fd sbrc r24, 7 1b862: fa 95 dec r31 1b864: ee 0f add r30, r30 1b866: ff 1f adc r31, r31 1b868: ee 0d add r30, r14 1b86a: ff 1d adc r31, r15 1b86c: 40 81 ld r20, Z 1b86e: 51 81 ldd r21, Z+1 ; 0x01 1b870: 6c 2d mov r22, r12 1b872: 81 e0 ldi r24, 0x01 ; 1 1b874: 0e 94 85 69 call 0xd30a ; 0xd30a 1b878: 9f ef ldi r25, 0xFF ; 255 1b87a: c9 1a sub r12, r25 1b87c: 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++) { 1b87e: a4 e0 ldi r26, 0x04 ; 4 1b880: ca 16 cp r12, r26 1b882: d1 04 cpc r13, r1 1b884: 41 f7 brne .-48 ; 0x1b856 lcd_puts_at_P(1, i, item[first + i]); } manage_heater(); 1b886: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(true); 1b88a: 81 e0 ldi r24, 0x01 ; 1 1b88c: 0e 94 fe 79 call 0xf3fc ; 0xf3fc if (lcd_encoder) { 1b890: 80 91 06 05 lds r24, 0x0506 ; 0x800506 1b894: 90 91 07 05 lds r25, 0x0507 ; 0x800507 1b898: 00 97 sbiw r24, 0x00 ; 0 1b89a: 71 f1 breq .+92 ; 0x1b8f8 if (lcd_encoder < 0) { 1b89c: 97 ff sbrs r25, 7 1b89e: 12 c0 rjmp .+36 ; 0x1b8c4 cursor_pos--; 1b8a0: 11 50 subi r17, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { 1b8a2: 14 30 cpi r17, 0x04 ; 4 1b8a4: 0c f4 brge .+2 ; 0x1b8a8 1b8a6: 3a c2 rjmp .+1140 ; 0x1bd1c cursor_pos = 3; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1b8a8: 87 e0 ldi r24, 0x07 ; 7 1b8aa: 0f 94 2b 2d call 0x25a56 ; 0x25a56 if (first < (uint8_t)(sizeof(item) / sizeof(item[0])) - 4) { 1b8ae: 80 91 14 04 lds r24, 0x0414 ; 0x800414 1b8b2: 18 16 cp r1, r24 1b8b4: 2c f0 brlt .+10 ; 0x1b8c0 first++; 1b8b6: 8f 5f subi r24, 0xFF ; 255 1b8b8: 80 93 14 04 sts 0x0414, r24 ; 0x800414 lcd_clear(); 1b8bc: 0e 94 a4 69 call 0xd348 ; 0xd348 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { cursor_pos = 3; 1b8c0: 13 e0 ldi r17, 0x03 ; 3 1b8c2: 03 c0 rjmp .+6 ; 0x1b8ca if (lcd_encoder < 0) { cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1b8c4: 1f 5f subi r17, 0xFF ; 255 } if (cursor_pos > 3) { 1b8c6: 14 30 cpi r17, 0x04 ; 4 1b8c8: 78 f7 brcc .-34 ; 0x1b8a8 if (first > 0) { first--; lcd_clear(); } } lcd_puts_at_P(0, 0, PSTR(" \n \n \n ")); 1b8ca: 46 ee ldi r20, 0xE6 ; 230 1b8cc: 55 e8 ldi r21, 0x85 ; 133 1b8ce: 60 e0 ldi r22, 0x00 ; 0 1b8d0: 80 e0 ldi r24, 0x00 ; 0 1b8d2: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_set_cursor(0, cursor_pos); 1b8d6: 61 2f mov r22, r17 1b8d8: 80 e0 ldi r24, 0x00 ; 0 1b8da: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_putc('>'); 1b8de: 8e e3 ldi r24, 0x3E ; 62 1b8e0: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 lcd_encoder = 0; 1b8e4: 10 92 07 05 sts 0x0507, r1 ; 0x800507 1b8e8: 10 92 06 05 sts 0x0506, r1 ; 0x800506 _delay(100); 1b8ec: 64 e6 ldi r22, 0x64 ; 100 1b8ee: 70 e0 ldi r23, 0x00 ; 0 1b8f0: 80 e0 ldi r24, 0x00 ; 0 1b8f2: 90 e0 ldi r25, 0x00 ; 0 1b8f4: 0f 94 03 0e call 0x21c06 ; 0x21c06 } if (lcd_clicked()) { 1b8f8: 0e 94 8e 6b call 0xd71c ; 0xd71c 1b8fc: 88 23 and r24, r24 1b8fe: 09 f4 brne .+2 ; 0x1b902 1b900: a8 cf rjmp .-176 ; 0x1b852 return(cursor_pos + first); 1b902: 80 91 14 04 lds r24, 0x0414 ; 0x800414 1b906: 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(); 1b908: 0e 94 a4 69 call 0xd348 ; 0xd348 Sound_MakeCustom(100,0,false); 1b90c: 40 e0 ldi r20, 0x00 ; 0 1b90e: 70 e0 ldi r23, 0x00 ; 0 1b910: 60 e0 ldi r22, 0x00 ; 0 1b912: 84 e6 ldi r24, 0x64 ; 100 1b914: 90 e0 ldi r25, 0x00 ; 0 1b916: 0f 94 6f 32 call 0x264de ; 0x264de switch (level) { 1b91a: 12 30 cpi r17, 0x02 ; 2 1b91c: 09 f4 brne .+2 ; 0x1b920 1b91e: 35 c2 rjmp .+1130 ; 0x1bd8a 1b920: 08 f0 brcs .+2 ; 0x1b924 1b922: 0d c2 rjmp .+1050 ; 0x1bd3e 1b924: 11 23 and r17, r17 1b926: 09 f4 brne .+2 ; 0x1b92a 1b928: 28 c2 rjmp .+1104 ; 0x1bd7a 1b92a: 11 30 cpi r17, 0x01 ; 1 1b92c: 09 f4 brne .+2 ; 0x1b930 1b92e: 28 c2 rjmp .+1104 ; 0x1bd80 case 4: _delay_ms(0); break; } } } KEEPALIVE_STATE(IN_HANDLER); 1b930: 82 e0 ldi r24, 0x02 ; 2 1b932: 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); 1b936: 60 e0 ldi r22, 0x00 ; 0 1b938: 8f ef ldi r24, 0xFF ; 255 1b93a: 9f e0 ldi r25, 0x0F ; 15 1b93c: 0e 94 e3 6e call 0xddc6 ; 0xddc6 eeprom_init_default_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard if uninitialized 1b940: 61 e0 ldi r22, 0x01 ; 1 1b942: 8f e5 ldi r24, 0x5F ; 95 1b944: 9f e0 ldi r25, 0x0F ; 15 1b946: 0e 94 e3 6e call 0xddc6 ; 0xddc6 void st_init() { #ifdef TMC2130 tmc2130_init(TMCInitParams(false, FarmOrUserECool())); #else st_current_init(); //Initialize Digipot Motor Current 1b94a: 0f 94 41 22 call 0x24482 ; 0x24482 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; 1b94e: 85 e0 ldi r24, 0x05 ; 5 1b950: e8 eb ldi r30, 0xB8 ; 184 1b952: f2 e0 ldi r31, 0x02 ; 2 1b954: d7 01 movw r26, r14 1b956: 01 90 ld r0, Z+ 1b958: 0d 92 st X+, r0 1b95a: 8a 95 dec r24 1b95c: e1 f7 brne .-8 ; 0x1b956 SET_OUTPUT(X_MS1_PIN); 1b95e: 99 9a sbi 0x13, 1 ; 19 SET_OUTPUT(X_MS2_PIN); 1b960: 98 9a sbi 0x13, 0 ; 19 SET_OUTPUT(Y_MS1_PIN); 1b962: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b966: 80 68 ori r24, 0x80 ; 128 1b968: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(Y_MS2_PIN); 1b96c: 9a 9a sbi 0x13, 2 ; 19 SET_OUTPUT(Z_MS1_PIN); 1b96e: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b972: 80 64 ori r24, 0x40 ; 64 1b974: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(Z_MS2_PIN); 1b978: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b97c: 80 62 ori r24, 0x20 ; 32 1b97e: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_MS1_PIN); 1b982: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b986: 88 60 ori r24, 0x08 ; 8 1b988: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_MS2_PIN); 1b98c: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b990: 80 61 ori r24, 0x10 ; 16 1b992: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1b996: 67 01 movw r12, r14 1b998: 10 e0 ldi r17, 0x00 ; 0 for(int i=0;i<=4;i++) microstep_mode(i,microstep_modes[i]); 1b99a: f6 01 movw r30, r12 1b99c: 61 91 ld r22, Z+ 1b99e: 6f 01 movw r12, r30 1b9a0: 81 2f mov r24, r17 1b9a2: 0f 94 04 22 call 0x24408 ; 0x24408 1b9a6: 1f 5f subi r17, 0xFF ; 255 1b9a8: 15 30 cpi r17, 0x05 ; 5 1b9aa: b9 f7 brne .-18 ; 0x1b99a microstep_init(); //Initialize Microstepping Pins #endif //TMC2130 //Initialize Dir Pins #if defined(X_DIR_PIN) && X_DIR_PIN > -1 SET_OUTPUT(X_DIR_PIN); 1b9ac: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1b9b0: 82 60 ori r24, 0x02 ; 2 1b9b2: 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); 1b9b6: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1b9ba: 81 60 ori r24, 0x01 ; 1 1b9bc: 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); 1b9c0: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1b9c4: 84 60 ori r24, 0x04 ; 4 1b9c6: 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); 1b9ca: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1b9ce: 80 64 ori r24, 0x40 ; 64 1b9d0: 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); 1b9d4: 0f 9a sbi 0x01, 7 ; 1 if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH); 1b9d6: 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); 1b9d8: 0e 9a sbi 0x01, 6 ; 1 if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH); 1b9da: 16 9a sbi 0x02, 6 ; 2 #endif #if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN > -1 SET_OUTPUT(Z_ENABLE_PIN); 1b9dc: 0d 9a sbi 0x01, 5 ; 1 if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH); 1b9de: 15 9a sbi 0x02, 5 ; 2 #endif #if defined(E0_ENABLE_PIN) && (E0_ENABLE_PIN > -1) SET_OUTPUT(E0_ENABLE_PIN); 1b9e0: 0c 9a sbi 0x01, 4 ; 1 if(!E_ENABLE_ON) WRITE(E0_ENABLE_PIN,HIGH); 1b9e2: 14 9a sbi 0x02, 4 ; 2 #endif //endstops and pullups #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SET_INPUT(X_MIN_PIN); 1b9e4: 26 98 cbi 0x04, 6 ; 4 #ifdef ENDSTOPPULLUP_XMIN WRITE(X_MIN_PIN,HIGH); 1b9e6: 2e 9a sbi 0x05, 6 ; 5 #endif #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SET_INPUT(Y_MIN_PIN); 1b9e8: 25 98 cbi 0x04, 5 ; 4 #ifdef ENDSTOPPULLUP_YMIN WRITE(Y_MIN_PIN,HIGH); 1b9ea: 2d 9a sbi 0x05, 5 ; 5 #endif #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SET_INPUT(Z_MIN_PIN); 1b9ec: 24 98 cbi 0x04, 4 ; 4 #ifdef ENDSTOPPULLUP_ZMIN WRITE(Z_MIN_PIN,HIGH); 1b9ee: 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); 1b9f0: 09 98 cbi 0x01, 1 ; 1 #ifdef ENDSTOPPULLUP_ZMAX WRITE(Z_MAX_PIN,HIGH); 1b9f2: 11 9a sbi 0x02, 1 ; 2 #endif #endif #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1)) SET_INPUT(TACH_0); 1b9f4: 3f 98 cbi 0x07, 7 ; 7 #ifdef TACH0PULLUP WRITE(TACH_0, HIGH); 1b9f6: 47 9a sbi 0x08, 7 ; 8 #endif //Initialize Step Pins #if defined(X_STEP_PIN) && (X_STEP_PIN > -1) SET_OUTPUT(X_STEP_PIN); 1b9f8: 38 9a sbi 0x07, 0 ; 7 WRITE(X_STEP_PIN,INVERT_X_STEP_PIN); 1b9fa: 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(); 1b9fc: 17 9a sbi 0x02, 7 ; 2 1b9fe: 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); 1ba02: 39 9a sbi 0x07, 1 ; 7 WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN); 1ba04: 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(); 1ba06: 16 9a sbi 0x02, 6 ; 2 1ba08: 10 92 a4 06 sts 0x06A4, r1 ; 0x8006a4 #endif #if defined(Z_STEP_PIN) && (Z_STEP_PIN > -1) SET_OUTPUT(Z_STEP_PIN); 1ba0c: 3a 9a sbi 0x07, 2 ; 7 WRITE(Z_STEP_PIN,INVERT_Z_STEP_PIN); 1ba0e: 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); 1ba10: 3b 9a sbi 0x07, 3 ; 7 WRITE(E0_STEP_PIN,INVERT_E_STEP_PIN); 1ba12: 43 98 cbi 0x08, 3 ; 8 disable_e0(); 1ba14: 14 9a sbi 0x02, 4 ; 2 #endif // waveform generation = 0100 = CTC TCCR1B &= ~(1< 1ba1a: 8f 7e andi r24, 0xEF ; 239 1ba1c: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1B |= (1< 1ba24: 88 60 ori r24, 0x08 ; 8 1ba26: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1A &= ~(1< 1ba2e: 8d 7f andi r24, 0xFD ; 253 1ba30: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(1< 1ba38: 8e 7f andi r24, 0xFE ; 254 1ba3a: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> // output mode = 00 (disconnected) TCCR1A &= ~(3< 1ba42: 8f 73 andi r24, 0x3F ; 63 1ba44: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(3< 1ba4c: 8f 7c andi r24, 0xCF ; 207 1ba4e: 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< 1ba56: 88 7f andi r24, 0xF8 ; 248 1ba58: 82 60 ori r24, 0x02 ; 2 1ba5a: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // Plan the first interrupt after 8ms from now. OCR1A = 0x4000; 1ba5e: 80 e0 ldi r24, 0x00 ; 0 1ba60: 90 e4 ldi r25, 0x40 ; 64 1ba62: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 1ba66: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> TCNT1 = 0; 1ba6a: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 1ba6e: 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; 1ba72: 10 92 1d 04 sts 0x041D, r1 ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 1ba76: 10 92 1c 04 sts 0x041C, r1 ; 0x80041c <_ZL11nextMainISR.lto_priv.435> nextAdvanceISR = ADV_NEVER; 1ba7a: 8f ef ldi r24, 0xFF ; 255 1ba7c: 9f ef ldi r25, 0xFF ; 255 1ba7e: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 1ba82: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> main_Rate = ADV_NEVER; 1ba86: 90 93 19 04 sts 0x0419, r25 ; 0x800419 <_ZL9main_Rate.lto_priv.437+0x1> 1ba8a: 80 93 18 04 sts 0x0418, r24 ; 0x800418 <_ZL9main_Rate.lto_priv.437> current_adv_steps = 0; 1ba8e: 10 92 17 04 sts 0x0417, r1 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 1ba92: 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; 1ba96: 81 e0 ldi r24, 0x01 ; 1 1ba98: 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(); 1ba9c: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 1baa0: 82 60 ori r24, 0x02 ; 2 1baa2: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> sei(); 1baa6: 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(); 1baa8: 0f 94 e2 8f call 0x31fc4 ; 0x31fc4 // Initialize current_position accounting for software endstops to // avoid unexpected initial shifts on the first move clamp_to_software_endstops(current_position); 1baac: 85 ef ldi r24, 0xF5 ; 245 1baae: 91 e1 ldi r25, 0x11 ; 17 1bab0: 0e 94 bb 64 call 0xc976 ; 0xc976 plan_set_position_curposXYZE(); 1bab4: 0f 94 ef 83 call 0x307de ; 0x307de } #define KILL_PENDING_FLAG 0x42 static void fw_kill_init() { if (eeprom_read_byte((uint8_t*)EEPROM_KILL_PENDING_FLAG) == KILL_PENDING_FLAG) { 1bab8: 84 e9 ldi r24, 0x94 ; 148 1baba: 9c e0 ldi r25, 0x0C ; 12 1babc: 0f 94 9b a0 call 0x34136 ; 0x34136 1bac0: 82 34 cpi r24, 0x42 ; 66 1bac2: 59 f4 brne .+22 ; 0x1bada 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); 1bac4: 6f ef ldi r22, 0xFF ; 255 1bac6: 84 e9 ldi r24, 0x94 ; 148 1bac8: 9c e0 ldi r25, 0x0C ; 12 1baca: 0f 94 e3 a0 call 0x341c6 ; 0x341c6 // 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); 1bace: 85 e9 ldi r24, 0x95 ; 149 1bad0: 9c e0 ldi r25, 0x0C ; 12 1bad2: 0f 94 a9 a0 call 0x34152 ; 0x34152 lcd_show_fullscreen_message_and_wait_P(kill_msg); 1bad6: 0f 94 a9 0b call 0x21752 ; 0x21752 // report kill() events fw_kill_init(); #ifdef FILAMENT_SENSOR fsensor.init(); 1bada: 0f 94 fd 53 call 0x2a7fa ; 0x2a7fa #endif setup_homepin(); #if defined(Z_AXIS_ALWAYS_ON) enable_z(); 1bade: 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); 1bae0: 88 e0 ldi r24, 0x08 ; 8 1bae2: 0f 94 be 98 call 0x3317c ; 0x3317c // Enable Toshiba FlashAir SD card / WiFi enahanced card. card.ToshibaFlashAir_enable(eeprom_read_byte((unsigned char*)EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY) == 1); 1bae6: 8b eb ldi r24, 0xBB ; 187 1bae8: 9f e0 ldi r25, 0x0F ; 15 1baea: 0f 94 9b a0 call 0x34136 ; 0x34136 1baee: 91 e0 ldi r25, 0x01 ; 1 1baf0: 81 30 cpi r24, 0x01 ; 1 1baf2: 09 f0 breq .+2 ; 0x1baf6 1baf4: 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; } 1baf6: 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(); 1bafa: 81 e0 ldi r24, 0x01 ; 1 1bafc: 0f 94 3c 4e call 0x29c78 ; 0x29c78 #include #include void eeprom_init() { eeprom_init_default_byte((uint8_t*)EEPROM_POWER_COUNT, 0); 1bb00: 60 e0 ldi r22, 0x00 ; 0 1bb02: 84 e6 ldi r24, 0x64 ; 100 1bb04: 9f e0 ldi r25, 0x0F ; 15 1bb06: 0e 94 e3 6e call 0xddc6 ; 0xddc6 eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_X, 0); 1bb0a: 60 e0 ldi r22, 0x00 ; 0 1bb0c: 86 e6 ldi r24, 0x66 ; 102 1bb0e: 9f e0 ldi r25, 0x0F ; 15 1bb10: 0e 94 e3 6e call 0xddc6 ; 0xddc6 eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_Y, 0); 1bb14: 60 e0 ldi r22, 0x00 ; 0 1bb16: 88 e6 ldi r24, 0x68 ; 104 1bb18: 9f e0 ldi r25, 0x0F ; 15 1bb1a: 0e 94 e3 6e call 0xddc6 ; 0xddc6 eeprom_init_default_byte((uint8_t*)EEPROM_FERROR_COUNT, 0); 1bb1e: 60 e0 ldi r22, 0x00 ; 0 1bb20: 85 e6 ldi r24, 0x65 ; 101 1bb22: 9f e0 ldi r25, 0x0F ; 15 1bb24: 0e 94 e3 6e call 0xddc6 ; 0xddc6 eeprom_init_default_word((uint16_t*)EEPROM_POWER_COUNT_TOT, 0); 1bb28: 70 e0 ldi r23, 0x00 ; 0 1bb2a: 60 e0 ldi r22, 0x00 ; 0 1bb2c: 8f ef ldi r24, 0xFF ; 255 1bb2e: 9e e0 ldi r25, 0x0E ; 14 1bb30: 0e 94 cb 6e call 0xdd96 ; 0xdd96 eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT, 0); 1bb34: 70 e0 ldi r23, 0x00 ; 0 1bb36: 60 e0 ldi r22, 0x00 ; 0 1bb38: 85 e0 ldi r24, 0x05 ; 5 1bb3a: 9f e0 ldi r25, 0x0F ; 15 1bb3c: 0e 94 cb 6e call 0xdd96 ; 0xdd96 eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT, 0); 1bb40: 70 e0 ldi r23, 0x00 ; 0 1bb42: 60 e0 ldi r22, 0x00 ; 0 1bb44: 83 e0 ldi r24, 0x03 ; 3 1bb46: 9f e0 ldi r25, 0x0F ; 15 1bb48: 0e 94 cb 6e call 0xdd96 ; 0xdd96 eeprom_init_default_word((uint16_t*)EEPROM_FERROR_COUNT_TOT, 0); 1bb4c: 70 e0 ldi r23, 0x00 ; 0 1bb4e: 60 e0 ldi r22, 0x00 ; 0 1bb50: 81 e0 ldi r24, 0x01 ; 1 1bb52: 9f e0 ldi r25, 0x0F ; 15 1bb54: 0e 94 cb 6e call 0xdd96 ; 0xdd96 eeprom_init_default_word((uint16_t*)EEPROM_MMU_FAIL_TOT, 0); 1bb58: 70 e0 ldi r23, 0x00 ; 0 1bb5a: 60 e0 ldi r22, 0x00 ; 0 1bb5c: 83 ed ldi r24, 0xD3 ; 211 1bb5e: 9e e0 ldi r25, 0x0E ; 14 1bb60: 0e 94 cb 6e call 0xdd96 ; 0xdd96 eeprom_init_default_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT, 0); 1bb64: 70 e0 ldi r23, 0x00 ; 0 1bb66: 60 e0 ldi r22, 0x00 ; 0 1bb68: 80 ed ldi r24, 0xD0 ; 208 1bb6a: 9e e0 ldi r25, 0x0E ; 14 1bb6c: 0e 94 cb 6e call 0xdd96 ; 0xdd96 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_FAIL, 0); 1bb70: 60 e0 ldi r22, 0x00 ; 0 1bb72: 82 ed ldi r24, 0xD2 ; 210 1bb74: 9e e0 ldi r25, 0x0E ; 14 1bb76: 0e 94 e3 6e call 0xddc6 ; 0xddc6 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL, 0); 1bb7a: 60 e0 ldi r22, 0x00 ; 0 1bb7c: 8f ec ldi r24, 0xCF ; 207 1bb7e: 9e e0 ldi r25, 0x0E ; 14 1bb80: 0e 94 e3 6e call 0xddc6 ; 0xddc6 eeprom_init_default_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES, 0); 1bb84: 88 ea ldi r24, 0xA8 ; 168 1bb86: 9c e0 ldi r25, 0x0C ; 12 1bb88: 0f 94 76 49 call 0x292ec ; 0x292ec if (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == EEPROM_EMPTY_VALUE) 1bb8c: 81 ea ldi r24, 0xA1 ; 161 1bb8e: 9d e0 ldi r25, 0x0D ; 13 1bb90: 0f 94 9b a0 call 0x34136 ; 0x34136 1bb94: 8f 3f cpi r24, 0xFF ; 255 1bb96: 71 f4 brne .+28 ; 0x1bbb4 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1bb98: 60 e0 ldi r22, 0x00 ; 0 1bb9a: 81 ea ldi r24, 0xA1 ; 161 1bb9c: 9d e0 ldi r25, 0x0D ; 13 1bb9e: 0f 94 bf a0 call 0x3417e ; 0x3417e 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); 1bba2: 88 ef ldi r24, 0xF8 ; 248 1bba4: 9f e0 ldi r25, 0x0F ; 15 1bba6: 0f 94 a9 a0 call 0x34152 ; 0x34152 eeprom_update_word(reinterpret_cast(&(EEPROM_Sheets_base->s[0].z_offset)), last_babystep); 1bbaa: bc 01 movw r22, r24 1bbac: 80 e5 ldi r24, 0x50 ; 80 1bbae: 9d e0 ldi r25, 0x0D ; 13 1bbb0: 0f 94 dd a0 call 0x341ba ; 0x341ba 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); 1bbb4: 49 e4 ldi r20, 0x49 ; 73 1bbb6: c4 2e mov r12, r20 1bbb8: 4d e0 ldi r20, 0x0D ; 13 1bbba: d4 2e mov r13, r20 1bbbc: 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); 1bbbe: b7 01 movw r22, r14 1bbc0: 81 2f mov r24, r17 1bbc2: 0e 94 3e 6f call 0xde7c ; 0xde7c eeprom_init_default_block(EEPROM_Sheets_base->s[i].name, (sizeof(Sheet::name)/sizeof(Sheet::name[0])), sheetName.c); 1bbc6: a7 01 movw r20, r14 1bbc8: 67 e0 ldi r22, 0x07 ; 7 1bbca: 70 e0 ldi r23, 0x00 ; 0 1bbcc: c6 01 movw r24, r12 1bbce: 0e 94 ac 6e call 0xdd58 ; 0xdd58 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++) { 1bbd2: 1f 5f subi r17, 0xFF ; 255 1bbd4: fb e0 ldi r31, 0x0B ; 11 1bbd6: cf 0e add r12, r31 1bbd8: d1 1c adc r13, r1 1bbda: 18 30 cpi r17, 0x08 ; 8 1bbdc: 81 f7 brne .-32 ; 0x1bbbe 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)))) 1bbde: 81 ea ldi r24, 0xA1 ; 161 1bbe0: 9d e0 ldi r25, 0x0D ; 13 1bbe2: 0f 94 9b a0 call 0x34136 ; 0x34136 1bbe6: 0e 94 0e 6f call 0xde1c ; 0xde1c 1bbea: 81 11 cpse r24, r1 1bbec: 02 c0 rjmp .+4 ; 0x1bbf2 { eeprom_switch_to_next_sheet(); 1bbee: 0e 94 30 6f call 0xde60 ; 0xde60 } check_babystep(); 1bbf2: 0e 94 a8 72 call 0xe550 ; 0xe550 // initialize custom mendel name in eeprom if (eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_MENDEL_NAME) == EEPROM_EMPTY_VALUE) { 1bbf6: 80 e8 ldi r24, 0x80 ; 128 1bbf8: 9c e0 ldi r25, 0x0C ; 12 1bbfa: 0f 94 9b a0 call 0x34136 ; 0x34136 1bbfe: 8f 3f cpi r24, 0xFF ; 255 1bc00: 41 f4 brne .+16 ; 0x1bc12 #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); 1bc02: 40 e1 ldi r20, 0x10 ; 16 1bc04: 50 e0 ldi r21, 0x00 ; 0 1bc06: 60 e8 ldi r22, 0x80 ; 128 1bc08: 7c e0 ldi r23, 0x0C ; 12 1bc0a: 88 ec ldi r24, 0xC8 ; 200 1bc0c: 92 e0 ldi r25, 0x02 ; 2 1bc0e: 0f 94 af a0 call 0x3415e ; 0x3415e //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); 1bc12: 60 e0 ldi r22, 0x00 ; 0 1bc14: 89 e2 ldi r24, 0x29 ; 41 1bc16: 9d e0 ldi r25, 0x0D ; 13 1bc18: 0e 94 e3 6e call 0xddc6 ; 0xddc6 #endif //PINDA_TEMP_COMP eeprom_init_default_dword((uint32_t*)EEPROM_JOB_ID, 0); 1bc1c: 85 e0 ldi r24, 0x05 ; 5 1bc1e: 9d e0 ldi r25, 0x0D ; 13 1bc20: 0f 94 76 49 call 0x292ec ; 0x292ec eeprom_init_default_dword((uint32_t*)EEPROM_TOTALTIME, 0); 1bc24: 8d ee ldi r24, 0xED ; 237 1bc26: 9f e0 ldi r25, 0x0F ; 15 1bc28: 0f 94 76 49 call 0x292ec ; 0x292ec eeprom_init_default_dword((uint32_t*)EEPROM_FILAMENTUSED, 0); 1bc2c: 81 ef ldi r24, 0xF1 ; 241 1bc2e: 9f e0 ldi r25, 0x0F ; 15 1bc30: 0f 94 76 49 call 0x292ec ; 0x292ec eeprom_init_default_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 0); 1bc34: 60 e0 ldi r22, 0x00 ; 0 1bc36: 8e ec ldi r24, 0xCE ; 206 1bc38: 9e e0 ldi r25, 0x0E ; 14 1bc3a: 0e 94 e3 6e call 0xddc6 ; 0xddc6 eeprom_init_default_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, 1); 1bc3e: 61 e0 ldi r22, 0x01 ; 1 1bc40: 87 ea ldi r24, 0xA7 ; 167 1bc42: 9c e0 ldi r25, 0x0C ; 12 1bc44: 0e 94 e3 6e call 0xddc6 ; 0xddc6 putchar('\n'); list_sec_lang_from_external_flash(); #endif //DEBUG_XFLASH // lang_reset(); if (!lang_select(eeprom_read_byte((uint8_t*)EEPROM_LANG))) 1bc48: 8e ef ldi r24, 0xFE ; 254 1bc4a: 9f e0 ldi r25, 0x0F ; 15 1bc4c: 0f 94 9b a0 call 0x34136 ; 0x34136 1bc50: 0e 94 3b 6c call 0xd876 ; 0xd876 1bc54: 81 11 cpse r24, r1 1bc56: 02 c0 rjmp .+4 ; 0x1bc5c lcd_language(); 1bc58: 0e 94 7e fe call 0x1fcfc ; 0x1fcfc lang_print_sec_lang(); #endif //DEBUG_SEC_LANG #endif //(LANG_MODE != 0) eeprom_init_default_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0); 1bc5c: 60 e0 ldi r22, 0x00 ; 0 1bc5e: 8f ea ldi r24, 0xAF ; 175 1bc60: 9f e0 ldi r25, 0x0F ; 15 1bc62: 0e 94 e3 6e call 0xddc6 ; 0xddc6 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA) == 255) { 1bc66: 86 ea ldi r24, 0xA6 ; 166 1bc68: 9f e0 ldi r25, 0x0F ; 15 1bc6a: 0f 94 9b a0 call 0x34136 ; 0x34136 1bc6e: 8f 3f cpi r24, 0xFF ; 255 1bc70: d9 f4 brne .+54 ; 0x1bca8 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1bc72: 61 e0 ldi r22, 0x01 ; 1 1bc74: 86 ea ldi r24, 0xA6 ; 166 1bc76: 9f e0 ldi r25, 0x0F ; 15 1bc78: 0f 94 bf a0 call 0x3417e ; 0x3417e 1bc7c: 30 eb ldi r19, 0xB0 ; 176 1bc7e: e3 2e mov r14, r19 1bc80: 3f e0 ldi r19, 0x0F ; 15 1bc82: 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); 1bc84: 70 e0 ldi r23, 0x00 ; 0 1bc86: 60 e0 ldi r22, 0x00 ; 0 1bc88: c7 01 movw r24, r14 1bc8a: 0f 94 dd a0 call 0x341ba ; 0x341ba 1bc8e: 22 e0 ldi r18, 0x02 ; 2 1bc90: e2 0e add r14, r18 1bc92: 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++) { 1bc94: 3a eb ldi r19, 0xBA ; 186 1bc96: e3 16 cp r14, r19 1bc98: 3f e0 ldi r19, 0x0F ; 15 1bc9a: f3 06 cpc r15, r19 1bc9c: 99 f7 brne .-26 ; 0x1bc84 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1bc9e: 60 e0 ldi r22, 0x00 ; 0 1bca0: 8f ea ldi r24, 0xAF ; 175 1bca2: 9f e0 ldi r25, 0x0F ; 15 1bca4: 0f 94 bf a0 call 0x3417e ; 0x3417e 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); 1bca8: 60 e0 ldi r22, 0x00 ; 0 1bcaa: 85 ea ldi r24, 0xA5 ; 165 1bcac: 9f e0 ldi r25, 0x0F ; 15 1bcae: 0e 94 e3 6e call 0xddc6 ; 0xddc6 eeprom_init_default_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED, 0); 1bcb2: 60 e0 ldi r22, 0x00 ; 0 1bcb4: 8f e7 ldi r24, 0x7F ; 127 1bcb6: 9c e0 ldi r25, 0x0C ; 12 1bcb8: 0e 94 e3 6e call 0xddc6 ; 0xddc6 eeprom_init_default_byte((uint8_t*)EEPROM_SD_SORT, 0); 1bcbc: 60 e0 ldi r22, 0x00 ; 0 1bcbe: 89 e0 ldi r24, 0x09 ; 9 1bcc0: 9f e0 ldi r25, 0x0F ; 15 1bcc2: 0e 94 e3 6e call 0xddc6 ; 0xddc6 } 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); 1bcc6: 61 e0 ldi r22, 0x01 ; 1 1bcc8: 8c ea ldi r24, 0xAC ; 172 1bcca: 9d e0 ldi r25, 0x0D ; 13 1bccc: 0e 94 e3 6e call 0xddc6 ; 0xddc6 eeprom_init_default_byte((uint8_t*)EEPROM_MBL_POINTS_NR, 3); 1bcd0: 63 e0 ldi r22, 0x03 ; 3 1bcd2: 8b ea ldi r24, 0xAB ; 171 1bcd4: 9d e0 ldi r25, 0x0D ; 13 1bcd6: 0e 94 e3 6e call 0xddc6 ; 0xddc6 eeprom_init_default_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3); 1bcda: 63 e0 ldi r22, 0x03 ; 3 1bcdc: 8a ea ldi r24, 0xAA ; 170 1bcde: 9d e0 ldi r25, 0x0D ; 13 1bce0: 0e 94 e3 6e call 0xddc6 ; 0xddc6 //mbl_mode_init(); mbl_settings_init(); eeprom_init_default_byte((uint8_t*)EEPROM_MMU_STEALTH, 1); 1bce4: 61 e0 ldi r22, 0x01 ; 1 1bce6: 89 ea ldi r24, 0xA9 ; 169 1bce8: 9d e0 ldi r25, 0x0D ; 13 1bcea: 0e 94 e3 6e call 0xddc6 ; 0xddc6 #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); 1bcee: 84 e0 ldi r24, 0x04 ; 4 1bcf0: 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) { 1bcf4: 02 30 cpi r16, 0x02 ; 2 1bcf6: 09 f4 brne .+2 ; 0x1bcfa 1bcf8: 6e c0 rjmp .+220 ; 0x1bdd6 1bcfa: 03 30 cpi r16, 0x03 ; 3 1bcfc: 09 f4 brne .+2 ; 0x1bd00 1bcfe: 0f c1 rjmp .+542 ; 0x1bf1e 1bd00: 01 30 cpi r16, 0x01 ; 1 1bd02: 09 f0 breq .+2 ; 0x1bd06 1bd04: 74 c0 rjmp .+232 ; 0x1bdee //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)); 1bd06: 8f e7 ldi r24, 0x7F ; 127 1bd08: 93 e4 ldi r25, 0x43 ; 67 1bd0a: 0e 94 a7 6c call 0xd94e ; 0xd94e 1bd0e: 0f 94 a9 0b call 0x21752 ; 0x21752 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); 1bd12: 6b ec ldi r22, 0xCB ; 203 1bd14: 70 e0 ldi r23, 0x00 ; 0 1bd16: 8c ee ldi r24, 0xEC ; 236 1bd18: 9e e0 ldi r25, 0x0E ; 14 1bd1a: 67 c0 rjmp .+206 ; 0x1bdea first++; lcd_clear(); } } if (cursor_pos < 0) { 1bd1c: 1f 3f cpi r17, 0xFF ; 255 1bd1e: 09 f0 breq .+2 ; 0x1bd22 1bd20: d4 cd rjmp .-1112 ; 0x1b8ca cursor_pos = 0; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1bd22: 87 e0 ldi r24, 0x07 ; 7 1bd24: 0f 94 2b 2d call 0x25a56 ; 0x25a56 if (first > 0) { 1bd28: 80 91 14 04 lds r24, 0x0414 ; 0x800414 1bd2c: 18 16 cp r1, r24 1bd2e: 2c f4 brge .+10 ; 0x1bd3a first--; 1bd30: 81 50 subi r24, 0x01 ; 1 1bd32: 80 93 14 04 sts 0x0414, r24 ; 0x800414 lcd_clear(); 1bd36: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_clear(); } } if (cursor_pos < 0) { cursor_pos = 0; 1bd3a: 10 e0 ldi r17, 0x00 ; 0 1bd3c: c6 cd rjmp .-1140 ; 0x1b8ca // Level input parameter sets depth of reset static void factory_reset(char level) { lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { 1bd3e: 13 30 cpi r17, 0x03 ; 3 1bd40: 31 f1 breq .+76 ; 0x1bd8e 1bd42: 14 30 cpi r17, 0x04 ; 4 1bd44: 09 f0 breq .+2 ; 0x1bd48 1bd46: f4 cd rjmp .-1048 ; 0x1b930 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //FILAMENT_SENSOR break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); 1bd48: 66 e2 ldi r22, 0x26 ; 38 1bd4a: 76 e8 ldi r23, 0x86 ; 134 1bd4c: 80 e0 ldi r24, 0x00 ; 0 1bd4e: 90 e1 ldi r25, 0x10 ; 16 1bd50: 0f 94 dd 91 call 0x323ba ; 0x323ba // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 1bd54: 10 e0 ldi r17, 0x00 ; 0 1bd56: 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); 1bd58: 6f ef ldi r22, 0xFF ; 255 1bd5a: c8 01 movw r24, r16 1bd5c: 0f 94 bf a0 call 0x3417e ; 0x3417e eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); 1bd60: c8 01 movw r24, r16 1bd62: 0f 94 ae 91 call 0x3235c ; 0x3235c break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 1bd66: 0f 5f subi r16, 0xFF ; 255 1bd68: 1f 4f sbci r17, 0xFF ; 255 1bd6a: 01 15 cp r16, r1 1bd6c: b0 e1 ldi r27, 0x10 ; 16 1bd6e: 1b 07 cpc r17, r27 1bd70: 99 f7 brne .-26 ; 0x1bd58 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); } menu_progressbar_finish(); 1bd72: 0f 94 cf 91 call 0x3239e ; 0x3239e softReset(); 1bd76: 0e 94 9d 60 call 0xc13a ; 0xc13a lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 1bd7a: 0e 94 aa 6b call 0xd754 ; 0xd754 1bd7e: d8 cd rjmp .-1104 ; 0x1b930 break; case 1: //Level 1: Reset statistics factory_reset_stats(); 1bd80: 0e 94 62 60 call 0xc0c4 ; 0xc0c4 lcd_menu_statistics(); 1bd84: 0f 94 24 1d call 0x23a48 ; 0x23a48 1bd88: d3 cd rjmp .-1114 ; 0x1b930 break; case 2: // Level 2: Prepare for shipping factory_reset_stats(); 1bd8a: 0e 94 62 60 call 0xc0c4 ; 0xc0c4 // FALLTHRU case 3: // Level 3: Preparation after being serviced // Force language selection at the next boot up. lang_reset(); 1bd8e: 0e 94 aa 6b call 0xd754 ; 0xd754 // Force the wizard in "Follow calibration flow" mode at the next boot up calibration_status_clear(CALIBRATION_FORCE_PREP); 1bd92: 84 e0 ldi r24, 0x04 ; 4 1bd94: 0e 94 2e c6 call 0x18c5c ; 0x18c5c 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); 1bd98: 62 e0 ldi r22, 0x02 ; 2 1bd9a: 8f e5 ldi r24, 0x5F ; 95 1bd9c: 9f e0 ldi r25, 0x0F ; 15 1bd9e: 0f 94 e3 a0 call 0x341c6 ; 0x341c6 lcd_update(2); fCheckModeInit(); // alternatively invoke printer reset } void farm_disable() { farm_mode = false; 1bda2: 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); 1bda6: 60 e0 ldi r22, 0x00 ; 0 1bda8: 84 ec ldi r24, 0xC4 ; 196 1bdaa: 9f e0 ldi r25, 0x0F ; 15 1bdac: 0f 94 bf a0 call 0x3417e ; 0x3417e eeprom_write_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 2); farm_disable(); #ifdef FILAMENT_SENSOR fsensor.setEnabled(true); 1bdb0: 81 e0 ldi r24, 0x01 ; 1 1bdb2: 0e 94 16 6e call 0xdc2c ; 0xdc2c 1bdb6: 11 e0 ldi r17, 0x01 ; 1 1bdb8: 10 93 85 16 sts 0x1685, r17 ; 0x801685 1bdbc: 61 e0 ldi r22, 0x01 ; 1 1bdbe: 87 e0 ldi r24, 0x07 ; 7 1bdc0: 9f e0 ldi r25, 0x0F ; 15 1bdc2: 0f 94 bf a0 call 0x3417e ; 0x3417e eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1bdc6: 10 93 86 16 sts 0x1686, r17 ; 0x801686 1bdca: 61 e0 ldi r22, 0x01 ; 1 1bdcc: 85 ed ldi r24, 0xD5 ; 213 1bdce: 9e e0 ldi r25, 0x0E ; 14 1bdd0: 0f 94 bf a0 call 0x3417e ; 0x3417e 1bdd4: ad cd rjmp .-1190 ; 0x1b930 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)); 1bdd6: 8e e5 ldi r24, 0x5E ; 94 1bdd8: 93 e4 ldi r25, 0x43 ; 67 1bdda: 0e 94 a7 6c call 0xd94e ; 0xd94e 1bdde: 0f 94 a9 0b call 0x21752 ; 0x21752 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); 1bde2: 6c ef ldi r22, 0xFC ; 252 1bde4: 70 e0 ldi r23, 0x00 ; 0 1bde6: 8e ee ldi r24, 0xEE ; 238 1bde8: 9e e0 ldi r25, 0x0E ; 14 1bdea: 0f 94 f9 a0 call 0x341f2 ; 0x341f2 eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; default: break; //no change, show no message } if (!previous_settings_retrieved) { 1bdee: b1 10 cpse r11, r1 1bdf0: 08 c0 rjmp .+16 ; 0x1be02 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 1bdf2: 87 ee ldi r24, 0xE7 ; 231 1bdf4: 92 e4 ldi r25, 0x42 ; 66 1bdf6: 0e 94 a7 6c call 0xd94e ; 0xd94e 1bdfa: 0f 94 a9 0b call 0x21752 ; 0x21752 Config_StoreSettings(); 1bdfe: 0e 94 59 75 call 0xeab2 ; 0xeab2 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { 1be02: 80 e8 ldi r24, 0x80 ; 128 1be04: 0e 94 52 d8 call 0x1b0a4 ; 0x1b0a4 1be08: 88 23 and r24, r24 1be0a: c9 f0 breq .+50 ; 0x1be3e CalibrationStatus calibration_status = 0; if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 1be0c: 87 ef ldi r24, 0xF7 ; 247 1be0e: 9f e0 ldi r25, 0x0F ; 15 1be10: 0f 94 9b a0 call 0x34136 ; 0x34136 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { CalibrationStatus calibration_status = 0; 1be14: 60 e0 ldi r22, 0x00 ; 0 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 1be16: 81 30 cpi r24, 0x01 ; 1 1be18: 71 f4 brne .+28 ; 0x1be36 // 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)) { 1be1a: 87 e5 ldi r24, 0x57 ; 87 1be1c: 96 e8 ldi r25, 0x86 ; 134 1be1e: 0e 94 4b b3 call 0x16696 ; 0x16696 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); 1be22: 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)) { 1be24: 88 23 and r24, r24 1be26: 39 f0 breq .+14 ; 0x1be36 // printer upgraded from FW<3.2.0.4 and requires re-running selftest lcd_show_fullscreen_message_and_wait_P(_T(MSG_FORCE_SELFTEST)); 1be28: 85 ea ldi r24, 0xA5 ; 165 1be2a: 92 e4 ldi r25, 0x42 ; 66 1be2c: 0e 94 a7 6c call 0xd94e ; 0xd94e 1be30: 0f 94 a9 0b call 0x21752 ; 0x21752 calibration_status &= ~CALIBRATION_STATUS_SELFTEST; 1be34: 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); 1be36: 86 ea ldi r24, 0xA6 ; 166 1be38: 9c e0 ldi r25, 0x0C ; 12 1be3a: 0f 94 bf a0 call 0x3417e ; 0x3417e } } eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, calibration_status); } if (eeprom_fw_version_older_than_p(FW_VERSION_NR)) { 1be3e: 8f e4 ldi r24, 0x4F ; 79 1be40: 96 e8 ldi r25, 0x86 ; 134 1be42: 0e 94 4b b3 call 0x16696 ; 0x16696 1be46: 18 2f mov r17, r24 1be48: 88 23 and r24, r24 1be4a: 29 f0 breq .+10 ; 0x1be56 if (!calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 1be4c: 87 e1 ldi r24, 0x17 ; 23 1be4e: 0e 94 52 d8 call 0x1b0a4 ; 0x1b0a4 1be52: 11 e0 ldi r17, 0x01 ; 1 1be54: 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; 1be56: f1 2c mov r15, r1 1be58: 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)); 1be5a: f7 01 movw r30, r14 1be5c: eb 5b subi r30, 0xBB ; 187 1be5e: f9 47 sbci r31, 0x79 ; 121 1be60: 64 91 lpm r22, Z 1be62: c7 01 movw r24, r14 1be64: 0f 94 bf a0 call 0x3417e ; 0x3417e 1be68: 8f ef ldi r24, 0xFF ; 255 1be6a: e8 1a sub r14, r24 1be6c: 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){ 1be6e: 9a e0 ldi r25, 0x0A ; 10 1be70: e9 16 cp r14, r25 1be72: f1 04 cpc r15, r1 1be74: 91 f7 brne .-28 ; 0x1be5a 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])); 1be76: ef e4 ldi r30, 0x4F ; 79 1be78: f6 e8 ldi r31, 0x86 ; 134 1be7a: 65 91 lpm r22, Z+ 1be7c: 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); 1be7e: 8a e0 ldi r24, 0x0A ; 10 1be80: 90 e0 ldi r25, 0x00 ; 0 1be82: 0f 94 dd a0 call 0x341ba ; 0x341ba eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[1])); 1be86: e1 e5 ldi r30, 0x51 ; 81 1be88: f6 e8 ldi r31, 0x86 ; 134 1be8a: 65 91 lpm r22, Z+ 1be8c: 74 91 lpm r23, Z 1be8e: 8c e0 ldi r24, 0x0C ; 12 1be90: 90 e0 ldi r25, 0x00 ; 0 1be92: 0f 94 dd a0 call 0x341ba ; 0x341ba eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION, (uint16_t)pgm_read_word(&FW_VERSION_NR[2])); 1be96: e3 e5 ldi r30, 0x53 ; 83 1be98: f6 e8 ldi r31, 0x86 ; 134 1be9a: 65 91 lpm r22, Z+ 1be9c: 74 91 lpm r23, Z 1be9e: 8e e0 ldi r24, 0x0E ; 14 1bea0: 90 e0 ldi r25, 0x00 ; 0 1bea2: 0f 94 dd a0 call 0x341ba ; 0x341ba // 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])); 1bea6: e5 e5 ldi r30, 0x55 ; 85 1bea8: f6 e8 ldi r31, 0x86 ; 134 1beaa: 65 91 lpm r22, Z+ 1beac: 74 91 lpm r23, Z 1beae: 80 e1 ldi r24, 0x10 ; 16 1beb0: 90 e0 ldi r25, 0x00 ; 0 1beb2: 0f 94 dd a0 call 0x341ba ; 0x341ba run_wizard = true; } } update_current_firmware_version_to_eeprom(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 1beb6: 8f e5 ldi r24, 0x5F ; 95 1beb8: 9f e0 ldi r25, 0x0F ; 15 1beba: 0f 94 9b a0 call 0x34136 ; 0x34136 1bebe: 88 23 and r24, r24 1bec0: d9 f1 breq .+118 ; 0x1bf38 // first time run of wizard or service prep lcd_wizard(WizState::Run); 1bec2: 80 e0 ldi r24, 0x00 ; 0 } else if (run_wizard) { // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); 1bec4: 0f 94 b3 2e call 0x25d66 ; 0x25d66 lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); #endif //THERMAL_MODEL } } KEEPALIVE_STATE(IN_PROCESS); 1bec8: 83 e0 ldi r24, 0x03 ; 3 1beca: 80 93 78 02 sts 0x0278, r24 ; 0x800278 #endif //DEBUG_DISABLE_STARTMSGS lcd_update_enable(true); 1bece: 81 e0 ldi r24, 0x01 ; 1 1bed0: 0e 94 b6 69 call 0xd36c ; 0xd36c lcd_clear(); 1bed4: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_update(2); 1bed8: 82 e0 ldi r24, 0x02 ; 2 1beda: 0e 94 38 69 call 0xd270 ; 0xd270 "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); 1bede: 83 e0 ldi r24, 0x03 ; 3 1bee0: 9d e0 ldi r25, 0x0D ; 13 1bee2: 0f 94 9b a0 call 0x34136 ; 0x34136 1bee6: 18 2f mov r17, r24 if(crash_reason != dump_crash_reason::manual && (uint8_t)crash_reason != 0xFF) 1bee8: 8f ef ldi r24, 0xFF ; 255 1beea: 81 0f add r24, r17 1beec: 8e 3f cpi r24, 0xFE ; 254 1beee: 08 f0 brcs .+2 ; 0x1bef2 1bef0: 49 c0 rjmp .+146 ; 0x1bf84 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 1bef2: 80 e0 ldi r24, 0x00 ; 0 1bef4: 0f 94 2b 2d call 0x25a56 ; 0x25a56 { lcd_beeper_quick_feedback(); lcd_clear(); 1bef8: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_puts_P(_n("FIRMWARE CRASH!\nCrash reason:\n")); 1befc: 8f e5 ldi r24, 0x5F ; 95 1befe: 98 e6 ldi r25, 0x68 ; 104 1bf00: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 switch(crash_reason) 1bf04: 12 30 cpi r17, 0x02 ; 2 1bf06: b1 f1 breq .+108 ; 0x1bf74 1bf08: 13 30 cpi r17, 0x03 ; 3 1bf0a: 09 f4 brne .+2 ; 0x1bf0e 1bf0c: 16 c1 rjmp .+556 ; 0x1c13a { case dump_crash_reason::stack_error: lcd_puts_P(_n("Static memory has\nbeen overwritten")); 1bf0e: 8c e3 ldi r24, 0x3C ; 60 1bf10: 98 e6 ldi r25, 0x68 ; 104 { lcd_beeper_quick_feedback(); lcd_clear(); lcd_puts_P(_n("FIRMWARE CRASH!\nCrash reason:\n")); switch(crash_reason) 1bf12: 11 30 cpi r17, 0x01 ; 1 1bf14: 89 f1 breq .+98 ; 0x1bf78 } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 1bf16: 81 2f mov r24, r17 1bf18: 0e 94 20 6a call 0xd440 ; 0xd440 1bf1c: 2f c0 rjmp .+94 ; 0x1bf7c 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)); 1bf1e: 83 e2 ldi r24, 0x23 ; 35 1bf20: 93 e4 ldi r25, 0x43 ; 67 1bf22: 0e 94 a7 6c call 0xd94e ; 0xd94e 1bf26: 0f 94 a9 0b call 0x21752 ; 0x21752 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); 1bf2a: 6c ef ldi r22, 0xFC ; 252 1bf2c: 70 e0 ldi r23, 0x00 ; 0 1bf2e: 8e ee ldi r24, 0xEE ; 238 1bf30: 9e e0 ldi r25, 0x0E ; 14 1bf32: 0f 94 f9 a0 call 0x341f2 ; 0x341f2 1bf36: ed ce rjmp .-550 ; 0x1bd12 // 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); 1bf38: 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) { 1bf3a: 11 11 cpse r17, r1 1bf3c: c3 cf rjmp .-122 ; 0x1bec4 // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); } else { if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { 1bf3e: 0e 94 52 d8 call 0x1b0a4 ; 0x1b0a4 1bf42: 81 11 cpse r24, r1 1bf44: 07 c0 rjmp .+14 ; 0x1bf54 // aborted or missing wizard: show a single warning lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW)); 1bf46: 85 e3 ldi r24, 0x35 ; 53 1bf48: 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)); 1bf4a: 0e 94 a7 6c call 0xd94e ; 0xd94e 1bf4e: 0f 94 a9 0b call 0x21752 ; 0x21752 1bf52: ba cf rjmp .-140 ; 0x1bec8 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)) { 1bf54: 84 e0 ldi r24, 0x04 ; 4 1bf56: 0e 94 52 d8 call 0x1b0a4 ; 0x1b0a4 1bf5a: 81 11 cpse r24, r1 1bf5c: 03 c0 rjmp .+6 ; 0x1bf64 // wizard reset after service prep lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_Z_CALIBRATION_FLOW)); 1bf5e: 8d eb ldi r24, 0xBD ; 189 1bf60: 91 e4 ldi r25, 0x41 ; 65 1bf62: f3 cf rjmp .-26 ; 0x1bf4a } else { // warn about other important steps individually if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 1bf64: 80 e1 ldi r24, 0x10 ; 16 1bf66: 0e 94 52 d8 call 0x1b0a4 ; 0x1b0a4 1bf6a: 81 11 cpse r24, r1 1bf6c: ad cf rjmp .-166 ; 0x1bec8 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 1bf6e: 89 e7 ldi r24, 0x79 ; 121 1bf70: 96 e4 ldi r25, 0x46 ; 70 1bf72: eb cf rjmp .-42 ; 0x1bf4a { 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")); 1bf74: 8b e2 ldi r24, 0x2B ; 43 1bf76: 98 e6 ldi r25, 0x68 ; 104 1bf78: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 } } void lcd_wait_for_click() { lcd_wait_for_click_delay(0); 1bf7c: 90 e0 ldi r25, 0x00 ; 0 1bf7e: 80 e0 ldi r24, 0x00 ; 0 1bf80: 0f 94 59 35 call 0x26ab2 ; 0x26ab2 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1bf84: 6f ef ldi r22, 0xFF ; 255 1bf86: 83 e0 ldi r24, 0x03 ; 3 1bf88: 9d e0 ldi r25, 0x0D ; 13 1bf8a: 0f 94 bf a0 call 0x3417e ; 0x3417e // 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(); 1bf8e: 0e 94 5f d8 call 0x1b0be ; 0x1b0be KEEPALIVE_STATE(NOT_BUSY); 1bf92: 81 e0 ldi r24, 0x01 ; 1 1bf94: 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" ); 1bf98: 88 e1 ldi r24, 0x18 ; 24 1bf9a: 98 e2 ldi r25, 0x28 ; 40 1bf9c: 0f b6 in r0, 0x3f ; 63 1bf9e: f8 94 cli 1bfa0: a8 95 wdr 1bfa2: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1bfa6: 0f be out 0x3f, r0 ; 63 1bfa8: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #ifdef WATCHDOG wdt_enable(WDTO_4S); #ifdef EMERGENCY_HANDLERS WDTCSR |= (1 << WDIE); 1bfac: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1bfb0: 80 64 ori r24, 0x40 ; 64 1bfb2: 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; 1bfb6: 85 e0 ldi r24, 0x05 ; 5 1bfb8: d8 2e mov r13, r24 setup(); for (;;) { loop(); if (serialEventRun) serialEventRun(); 1bfba: 90 e0 ldi r25, 0x00 ; 0 1bfbc: e9 2e mov r14, r25 1bfbe: 90 e0 ldi r25, 0x00 ; 0 1bfc0: 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); 1bfc2: cc 24 eor r12, r12 1bfc4: 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); 1bfc6: 24 e0 ldi r18, 0x04 ; 4 1bfc8: 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; 1bfca: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac if(Stopped) { 1bfce: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 1bfd2: 88 23 and r24, r24 1bfd4: 09 f4 brne .+2 ; 0x1bfd8 1bfd6: b4 c0 rjmp .+360 ; 0x1c140 // 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); 1bfd8: 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. 1bfdc: 0e 94 b3 60 call 0xc166 ; 0xc166 1bfe0: 88 23 and r24, r24 1bfe2: 09 f4 brne .+2 ; 0x1bfe6 1bfe4: b0 c0 rjmp .+352 ; 0x1c146 1bfe6: 80 91 79 02 lds r24, 0x0279 ; 0x800279 1bfea: 81 30 cpi r24, 0x01 ; 1 1bfec: 09 f0 breq .+2 ; 0x1bff0 1bfee: ab c0 rjmp .+342 ; 0x1c146 usb_timer.start(); 1bff0: 85 ed ldi r24, 0xD5 ; 213 1bff2: 91 e1 ldi r25, 0x11 ; 17 1bff4: 0f 94 5e 10 call 0x220bc ; 0x220bc ::start()> } else #endif { get_command(); 1bff8: 0e 94 6f 75 call 0xeade ; 0xeade // 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) 1bffc: 80 91 56 02 lds r24, 0x0256 ; 0x800256 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.517> 1c000: 88 23 and r24, r24 1c002: 89 f0 breq .+34 ; 0x1c026 return; if(autostart_atmillis.expired(5000)) 1c004: 68 e8 ldi r22, 0x88 ; 136 1c006: 73 e1 ldi r23, 0x13 ; 19 1c008: 8b e7 ldi r24, 0x7B ; 123 1c00a: 96 e1 ldi r25, 0x16 ; 22 1c00c: 0f 94 2f 10 call 0x2205e ; 0x2205e ::expired(unsigned short)> 1c010: 81 11 cpse r24, r1 1c012: 09 c0 rjmp .+18 ; 0x1c026 return; } autostart_stilltocheck = false; 1c014: 10 92 56 02 sts 0x0256, r1 ; 0x800256 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.517> if(!mounted) 1c018: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1c01c: 88 23 and r24, r24 1c01e: 09 f4 brne .+2 ; 0x1c022 1c020: 9e c0 rjmp .+316 ; 0x1c15e 1c022: 0f 94 d0 44 call 0x289a0 ; 0x289a0 #ifdef SDSUPPORT card.checkautostart(false); #endif if(buflen) 1c026: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 1c02a: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 1c02e: 89 2b or r24, r25 1c030: 09 f4 brne .+2 ; 0x1c034 1c032: 63 c0 rjmp .+198 ; 0x1c0fa { cmdbuffer_front_already_processed = false; 1c034: 10 92 e6 11 sts 0x11E6, r1 ; 0x8011e6 #ifdef SDSUPPORT if(card.saving) 1c038: 80 91 68 13 lds r24, 0x1368 ; 0x801368 1c03c: 88 23 and r24, r24 1c03e: c1 f1 breq .+112 ; 0x1c0b0 { // 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) { 1c040: 00 91 cb 11 lds r16, 0x11CB ; 0x8011cb 1c044: 10 91 cc 11 lds r17, 0x11CC ; 0x8011cc 1c048: 0f 51 subi r16, 0x1F ; 31 1c04a: 10 4f sbci r17, 0xF0 ; 240 1c04c: 68 e9 ldi r22, 0x98 ; 152 1c04e: 76 e8 ldi r23, 0x86 ; 134 1c050: c8 01 movw r24, r16 1c052: 0f 94 a2 9e call 0x33d44 ; 0x33d44 1c056: 89 2b or r24, r25 1c058: 09 f0 breq .+2 ; 0x1c05c 1c05a: 8e c0 rjmp .+284 ; 0x1c178 else SERIAL_PROTOCOLLNPGM("Not SD printing"); } void CardReader::write_command(char *buf) { file.writeError = false; 1c05c: 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)); 1c060: f8 01 movw r30, r16 1c062: 01 90 ld r0, Z+ 1c064: 00 20 and r0, r0 1c066: e9 f7 brne .-6 ; 0x1c062 1c068: 31 97 sbiw r30, 0x01 ; 1 1c06a: bf 01 movw r22, r30 1c06c: 60 1b sub r22, r16 1c06e: 71 0b sbc r23, r17 1c070: c8 01 movw r24, r16 1c072: 0f 94 db 50 call 0x2a1b6 ; 0x2a1b6 1c076: 62 e0 ldi r22, 0x02 ; 2 1c078: 70 e0 ldi r23, 0x00 ; 0 1c07a: 88 ed ldi r24, 0xD8 ; 216 1c07c: 92 e0 ldi r25, 0x02 ; 2 1c07e: 0f 94 db 50 call 0x2a1b6 ; 0x2a1b6 file.write(buf); //write command file.write("\r\n"); //write line termination if (file.writeError) 1c082: 80 91 fa 15 lds r24, 0x15FA ; 0x8015fa 1c086: 88 23 and r24, r24 1c088: 41 f0 breq .+16 ; 0x1c09a { SERIAL_ERROR_START; 1c08a: 84 e4 ldi r24, 0x44 ; 68 1c08c: 9d e9 ldi r25, 0x9D ; 157 1c08e: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ERRORLNRPGM(MSG_SD_ERR_WRITE_TO_FILE); 1c092: 89 e0 ldi r24, 0x09 ; 9 1c094: 99 e6 ldi r25, 0x69 ; 105 1c096: 0e 94 49 72 call 0xe492 ; 0xe492 card.write_command(CMDBUFFER_CURRENT_STRING); if(card.logging) 1c09a: 80 91 69 13 lds r24, 0x1369 ; 0x801369 1c09e: 88 23 and r24, r24 1c0a0: 09 f4 brne .+2 ; 0x1c0a4 1c0a2: 65 c0 rjmp .+202 ; 0x1c16e */ void process_commands() { if (!buflen) return; //empty command 1c0a4: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 1c0a8: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 1c0ac: 89 2b or r24, r25 1c0ae: 11 f0 breq .+4 ; 0x1c0b4 1c0b0: 0e 94 e4 83 call 0x107c8 ; 0x107c8 } #else process_commands(); #endif //SDSUPPORT if (! cmdbuffer_front_already_processed && buflen) 1c0b4: 80 91 e6 11 lds r24, 0x11E6 ; 0x8011e6 1c0b8: 81 11 cpse r24, r1 1c0ba: 19 c0 rjmp .+50 ; 0x1c0ee 1c0bc: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 1c0c0: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 1c0c4: 89 2b or r24, r25 1c0c6: 99 f0 breq .+38 ; 0x1c0ee { // 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; 1c0c8: e0 91 cb 11 lds r30, 0x11CB ; 0x8011cb 1c0cc: f0 91 cc 11 lds r31, 0x11CC ; 0x8011cc 1c0d0: e2 52 subi r30, 0x22 ; 34 1c0d2: f0 4f sbci r31, 0xF0 ; 240 if (*ptr == CMDBUFFER_CURRENT_TYPE_SDCARD) { 1c0d4: 80 81 ld r24, Z 1c0d6: 82 30 cpi r24, 0x02 ; 2 1c0d8: 09 f0 breq .+2 ; 0x1c0dc 1c0da: 53 c0 rjmp .+166 ; 0x1c182 { // 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(); 1c0dc: 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; 1c0de: 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); 1c0e0: 81 81 ldd r24, Z+1 ; 0x01 1c0e2: 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); 1c0e4: 0f 94 3b 75 call 0x2ea76 ; 0x2ea76 sei(); 1c0e8: 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(); 1c0ea: 0e 94 c9 6f call 0xdf92 ; 0xdf92 */ void host_keepalive() { #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; 1c0ee: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1c0f2: 81 11 cpse r24, r1 1c0f4: 02 c0 rjmp .+4 ; 0x1c0fa 1c0f6: 0e 94 4d 72 call 0xe49a ; 0xe49a } host_keepalive(); } } //check heater every n milliseconds manage_heater(); 1c0fa: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(printingIsPaused()); 1c0fe: 0e 94 b3 60 call 0xc166 ; 0xc166 1c102: 0e 94 fe 79 call 0xf3fc ; 0xf3fc //=============================functions ============================ //=========================================================================== void checkHitEndstops() { if(endstop_hit) { 1c106: 80 91 2c 04 lds r24, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.439> 1c10a: 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; 1c10c: 10 92 2c 04 sts 0x042C, r1 ; 0x80042c <_ZL11endstop_hit.lto_priv.439> checkHitEndstops(); lcd_update(0); 1c110: 80 e0 ldi r24, 0x00 ; 0 1c112: 0e 94 38 69 call 0xd270 ; 0xd270 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) { 1c116: 80 91 2d 04 lds r24, 0x042D ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.505> 1c11a: 81 11 cpse r24, r1 1c11c: 07 c0 rjmp .+14 ; 0x1c12c return; } avoidRecursion = true; 1c11e: c0 92 2d 04 sts 0x042D, r12 ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.505> mmu_loop_inner(true); 1c122: 81 e0 ldi r24, 0x01 ; 1 1c124: 0f 94 11 65 call 0x2ca22 ; 0x2ca22 avoidRecursion = false; 1c128: 10 92 2d 04 sts 0x042D, r1 ; 0x80042d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.505> 1c12c: e1 14 cp r14, r1 1c12e: f1 04 cpc r15, r1 1c130: 09 f4 brne .+2 ; 0x1c134 1c132: 4b cf rjmp .-362 ; 0x1bfca 1c134: 0e 94 00 00 call 0 ; 0x0 <__vectors> 1c138: 48 cf rjmp .-368 ; 0x1bfca 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")); 1c13a: 8d e1 ldi r24, 0x1D ; 29 1c13c: 98 e6 ldi r25, 0x68 ; 104 1c13e: 1c cf rjmp .-456 ; 0x1bf78 // 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); 1c140: c0 92 78 02 sts 0x0278, r12 ; 0x800278 1c144: 4b cf rjmp .-362 ; 0x1bfdc } 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. 1c146: 60 e1 ldi r22, 0x10 ; 16 1c148: 77 e2 ldi r23, 0x27 ; 39 1c14a: 85 ed ldi r24, 0xD5 ; 213 1c14c: 91 e1 ldi r25, 0x11 ; 17 1c14e: 0f 94 2f 10 call 0x2205e ; 0x2205e ::expired(unsigned short)> 1c152: 88 23 and r24, r24 1c154: 09 f4 brne .+2 ; 0x1c158 1c156: 50 cf rjmp .-352 ; 0x1bff8 } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 1c158: b0 92 cb 0d sts 0x0DCB, r11 ; 0x800dcb <_ZL13printer_state.lto_priv.367> 1c15c: 4d cf rjmp .-358 ; 0x1bff8 return; } autostart_stilltocheck = false; if(!mounted) { mount(); 1c15e: 81 e0 ldi r24, 0x01 ; 1 1c160: 0f 94 3c 4e call 0x29c78 ; 0x29c78 if(!mounted) //fail 1c164: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1c168: 81 11 cpse r24, r1 1c16a: 5b cf rjmp .-330 ; 0x1c022 1c16c: 5c cf rjmp .-328 ; 0x1c026 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); 1c16e: 81 e3 ldi r24, 0x31 ; 49 1c170: 99 e6 ldi r25, 0x69 ; 105 } else { card.closefile(); SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 1c172: 0e 94 49 72 call 0xe492 ; 0xe492 1c176: 9e cf rjmp .-196 ; 0x1c0b4 if(card.logging) process_commands(); else SERIAL_PROTOCOLLNRPGM(MSG_OK); } else { card.closefile(); 1c178: 0f 94 9c 42 call 0x28538 ; 0x28538 SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 1c17c: 8f e1 ldi r24, 0x1F ; 31 1c17e: 99 e6 ldi r25, 0x69 ; 105 1c180: f8 cf rjmp .-16 ; 0x1c172 // 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){ 1c182: 86 30 cpi r24, 0x06 ; 6 1c184: 09 f0 breq .+2 ; 0x1c188 1c186: b1 cf rjmp .-158 ; 0x1c0ea 1c188: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 1c18c: 81 11 cpse r24, r1 1c18e: ad cf rjmp .-166 ; 0x1c0ea cli(); 1c190: f8 94 cli *ptr ++ = CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED; 1c192: d0 82 st Z, r13 // and one for each command to previous block in the planner queue. planner_add_sd_length(1); 1c194: 81 e0 ldi r24, 0x01 ; 1 1c196: 90 e0 ldi r25, 0x00 ; 0 1c198: a5 cf rjmp .-182 ; 0x1c0e4 { 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; 1c19a: 02 e0 ldi r16, 0x02 ; 2 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1c19c: 8b 3c cpi r24, 0xCB ; 203 1c19e: 91 05 cpc r25, r1 1c1a0: 09 f0 breq .+2 ; 0x1c1a4 1c1a2: 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(); 1c1a4: 0e 94 c8 74 call 0xe990 ; 0xe990 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; 1c1a8: 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; 1c1aa: 82 ea ldi r24, 0xA2 ; 162 1c1ac: 92 ea ldi r25, 0xA2 ; 162 1c1ae: a0 e0 ldi r26, 0x00 ; 0 1c1b0: b0 e0 ldi r27, 0x00 ; 0 1c1b2: 80 93 24 17 sts 0x1724, r24 ; 0x801724 <__bss_end+0x20> 1c1b6: 90 93 25 17 sts 0x1725, r25 ; 0x801725 <__bss_end+0x21> 1c1ba: a0 93 26 17 sts 0x1726, r26 ; 0x801726 <__bss_end+0x22> 1c1be: 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; 1c1c2: 10 92 ea 03 sts 0x03EA, r1 ; 0x8003ea <_ZL14iState_sum_min.lto_priv.431> 1c1c6: 10 92 eb 03 sts 0x03EB, r1 ; 0x8003eb <_ZL14iState_sum_min.lto_priv.431+0x1> 1c1ca: 10 92 ec 03 sts 0x03EC, r1 ; 0x8003ec <_ZL14iState_sum_min.lto_priv.431+0x2> 1c1ce: 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; 1c1d2: 20 91 9e 04 lds r18, 0x049E ; 0x80049e 1c1d6: 30 91 9f 04 lds r19, 0x049F ; 0x80049f 1c1da: 40 91 a0 04 lds r20, 0x04A0 ; 0x8004a0 1c1de: 50 91 a1 04 lds r21, 0x04A1 ; 0x8004a1 1c1e2: 60 e0 ldi r22, 0x00 ; 0 1c1e4: 70 e0 ldi r23, 0x00 ; 0 1c1e6: 8f e7 ldi r24, 0x7F ; 127 1c1e8: 93 e4 ldi r25, 0x43 ; 67 1c1ea: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1c1ee: 60 93 e6 03 sts 0x03E6, r22 ; 0x8003e6 <_ZL14iState_sum_max.lto_priv.432> 1c1f2: 70 93 e7 03 sts 0x03E7, r23 ; 0x8003e7 <_ZL14iState_sum_max.lto_priv.432+0x1> 1c1f6: 80 93 e8 03 sts 0x03E8, r24 ; 0x8003e8 <_ZL14iState_sum_max.lto_priv.432+0x2> 1c1fa: 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; 1c1fe: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 <_ZL19temp_iState_min_bed.lto_priv.429> 1c202: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 <_ZL19temp_iState_min_bed.lto_priv.429+0x1> 1c206: 10 92 e4 03 sts 0x03E4, r1 ; 0x8003e4 <_ZL19temp_iState_min_bed.lto_priv.429+0x2> 1c20a: 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; 1c20e: 20 91 aa 04 lds r18, 0x04AA ; 0x8004aa 1c212: 30 91 ab 04 lds r19, 0x04AB ; 0x8004ab 1c216: 40 91 ac 04 lds r20, 0x04AC ; 0x8004ac 1c21a: 50 91 ad 04 lds r21, 0x04AD ; 0x8004ad 1c21e: 60 e0 ldi r22, 0x00 ; 0 1c220: 70 e0 ldi r23, 0x00 ; 0 1c222: 8f e7 ldi r24, 0x7F ; 127 1c224: 93 e4 ldi r25, 0x43 ; 67 1c226: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1c22a: 60 93 de 03 sts 0x03DE, r22 ; 0x8003de <_ZL19temp_iState_max_bed.lto_priv.430> 1c22e: 70 93 df 03 sts 0x03DF, r23 ; 0x8003df <_ZL19temp_iState_max_bed.lto_priv.430+0x1> 1c232: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 <_ZL19temp_iState_max_bed.lto_priv.430+0x2> 1c236: 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); 1c23a: 6d 9a sbi 0x0d, 5 ; 13 #endif #if defined(HEATER_BED_PIN) && (HEATER_BED_PIN > -1) SET_OUTPUT(HEATER_BED_PIN); 1c23c: 9d 9a sbi 0x13, 5 ; 19 #endif #if defined(FAN_PIN) && (FAN_PIN > -1) SET_OUTPUT(FAN_PIN); 1c23e: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1c242: 88 60 ori r24, 0x08 ; 8 1c244: 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)); 1c248: 80 91 05 05 lds r24, 0x0505 ; 0x800505 1c24c: 90 e0 ldi r25, 0x00 ; 0 1c24e: 64 e0 ldi r22, 0x04 ; 4 1c250: 95 95 asr r25 1c252: 87 95 ror r24 1c254: 6a 95 dec r22 1c256: e1 f7 brne .-8 ; 0x1c250 1c258: 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; 1c25c: 8e e1 ldi r24, 0x1E ; 30 1c25e: 90 e0 ldi r25, 0x00 ; 0 1c260: 90 93 dc 03 sts 0x03DC, r25 ; 0x8003dc <_ZL8minttemp.lto_priv.424+0x1> 1c264: 80 93 db 03 sts 0x03DB, r24 ; 0x8003db <_ZL8minttemp.lto_priv.424> while(analog2temp(minttemp_raw[0], 0) < HEATER_0_MINTEMP) { 1c268: c0 90 52 02 lds r12, 0x0252 ; 0x800252 <_ZL12minttemp_raw.lto_priv.426> 1c26c: d0 90 53 02 lds r13, 0x0253 ; 0x800253 <_ZL12minttemp_raw.lto_priv.426+0x1> 1c270: c6 01 movw r24, r12 1c272: 0e 94 bb bd call 0x17b76 ; 0x17b76 1c276: 20 e0 ldi r18, 0x00 ; 0 1c278: 30 e0 ldi r19, 0x00 ; 0 1c27a: 40 ef ldi r20, 0xF0 ; 240 1c27c: 51 e4 ldi r21, 0x41 ; 65 1c27e: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1c282: 87 ff sbrs r24, 7 1c284: 81 c9 rjmp .-3326 ; 0x1b588 #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP minttemp_raw[0] += OVERSAMPLENR; #else minttemp_raw[0] -= OVERSAMPLENR; 1c286: f0 e1 ldi r31, 0x10 ; 16 1c288: cf 1a sub r12, r31 1c28a: d1 08 sbc r13, r1 1c28c: d0 92 53 02 sts 0x0253, r13 ; 0x800253 <_ZL12minttemp_raw.lto_priv.426+0x1> 1c290: c0 92 52 02 sts 0x0252, r12 ; 0x800252 <_ZL12minttemp_raw.lto_priv.426> 1c294: e9 cf rjmp .-46 ; 0x1c268 0001c296 : return false; } // Parse a major.minor.revision version number. // Return true if valid. bool parse_version(const char *str, uint16_t version[4]) { 1c296: 0f 93 push r16 1c298: 1f 93 push r17 1c29a: 8b 01 movw r16, r22 for(uint8_t i = 0; i < 2; ++i){ str = Number(str, version + i); 1c29c: 0e 94 73 b1 call 0x162e6 ; 0x162e6 if (*str != '.') 1c2a0: fc 01 movw r30, r24 1c2a2: 20 81 ld r18, Z 1c2a4: 2e 32 cpi r18, 0x2E ; 46 1c2a6: 11 f0 breq .+4 ; 0x1c2ac 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 1c2a8: 80 e0 ldi r24, 0x00 ; 0 1c2aa: 34 c0 rjmp .+104 ; 0x1c314 // 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); 1c2ac: b8 01 movw r22, r16 1c2ae: 6e 5f subi r22, 0xFE ; 254 1c2b0: 7f 4f sbci r23, 0xFF ; 255 1c2b2: 01 96 adiw r24, 0x01 ; 1 1c2b4: 0e 94 73 b1 call 0x162e6 ; 0x162e6 if (*str != '.') 1c2b8: fc 01 movw r30, r24 1c2ba: 20 81 ld r18, Z 1c2bc: 2e 32 cpi r18, 0x2E ; 46 1c2be: a1 f7 brne .-24 ; 0x1c2a8 return false; ++str; } str = Number(str, version + 2); 1c2c0: b8 01 movw r22, r16 1c2c2: 6c 5f subi r22, 0xFC ; 252 1c2c4: 7f 4f sbci r23, 0xFF ; 255 1c2c6: 01 96 adiw r24, 0x01 ; 1 1c2c8: 0e 94 73 b1 call 0x162e6 ; 0x162e6 version[3] = FIRMWARE_REVISION_RELEASED; 1c2cc: 20 e4 ldi r18, 0x40 ; 64 1c2ce: 30 e0 ldi r19, 0x00 ; 0 1c2d0: f8 01 movw r30, r16 1c2d2: 37 83 std Z+7, r19 ; 0x07 1c2d4: 26 83 std Z+6, r18 ; 0x06 1c2d6: fc 01 movw r30, r24 1c2d8: df 01 movw r26, r30 // skip everything else until eol or '-' for(;;){ if(is_whitespace_or_nl_or_eol(*str)){ 1c2da: 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'; 1c2dc: 89 2f mov r24, r25 1c2de: 8f 7d andi r24, 0xDF ; 223 1c2e0: c1 f1 breq .+112 ; 0x1c352 1c2e2: 87 ef ldi r24, 0xF7 ; 247 1c2e4: 89 0f add r24, r25 1c2e6: 82 30 cpi r24, 0x02 ; 2 1c2e8: a0 f1 brcs .+104 ; 0x1c352 1c2ea: 9d 30 cpi r25, 0x0D ; 13 1c2ec: 91 f1 breq .+100 ; 0x1c352 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 == '-'){ 1c2ee: 9d 32 cpi r25, 0x2D ; 45 1c2f0: 99 f7 brne .-26 ; 0x1c2d8 // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1c2f2: 11 96 adiw r26, 0x01 ; 1 1c2f4: 9c 91 ld r25, X 1c2f6: 92 34 cpi r25, 0x42 ; 66 1c2f8: e1 f0 breq .+56 ; 0x1c332 1c2fa: 7c f4 brge .+30 ; 0x1c31a 1c2fc: 91 34 cpi r25, 0x41 ; 65 1c2fe: a1 f6 brne .-88 ; 0x1c2a8 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); 1c300: 0a 5f subi r16, 0xFA ; 250 1c302: 1f 4f sbci r17, 0xFF ; 255 1c304: 28 e0 ldi r18, 0x08 ; 8 1c306: 30 e0 ldi r19, 0x00 ; 0 1c308: 45 e0 ldi r20, 0x05 ; 5 1c30a: 64 e4 ldi r22, 0x44 ; 68 1c30c: 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); 1c30e: cf 01 movw r24, r30 1c310: 0e 94 29 b5 call 0x16a52 ; 0x16a52 // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); return false; } 1c314: 1f 91 pop r17 1c316: 0f 91 pop r16 1c318: 08 95 ret // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1c31a: 94 34 cpi r25, 0x44 ; 68 1c31c: 91 f0 breq .+36 ; 0x1c342 1c31e: 92 35 cpi r25, 0x52 ; 82 1c320: 19 f6 brne .-122 ; 0x1c2a8 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); 1c322: 0a 5f subi r16, 0xFA ; 250 1c324: 1f 4f sbci r17, 0xFF ; 255 1c326: 20 e2 ldi r18, 0x20 ; 32 1c328: 30 e0 ldi r19, 0x00 ; 0 1c32a: 42 e0 ldi r20, 0x02 ; 2 1c32c: 68 e3 ldi r22, 0x38 ; 56 1c32e: 74 e8 ldi r23, 0x84 ; 132 1c330: ee cf rjmp .-36 ; 0x1c30e 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); 1c332: 0a 5f subi r16, 0xFA ; 250 1c334: 1f 4f sbci r17, 0xFF ; 255 1c336: 20 e1 ldi r18, 0x10 ; 16 1c338: 30 e0 ldi r19, 0x00 ; 0 1c33a: 44 e0 ldi r20, 0x04 ; 4 1c33c: 6f e3 ldi r22, 0x3F ; 63 1c33e: 74 e8 ldi r23, 0x84 ; 132 1c340: e6 cf rjmp .-52 ; 0x1c30e 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); 1c342: 0a 5f subi r16, 0xFA ; 250 1c344: 1f 4f sbci r17, 0xFF ; 255 1c346: 30 e0 ldi r19, 0x00 ; 0 1c348: 20 e0 ldi r18, 0x00 ; 0 1c34a: 43 e0 ldi r20, 0x03 ; 3 1c34c: 6b e3 ldi r22, 0x3B ; 59 1c34e: 74 e8 ldi r23, 0x84 ; 132 1c350: de cf rjmp .-68 ; 0x1c30e // 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; 1c352: 81 e0 ldi r24, 0x01 ; 1 1c354: df cf rjmp .-66 ; 0x1c314 0001c356 : crashdet_use_eeprom_setting(); } #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) 1c356: cf 93 push r28 1c358: 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) 1c35a: 8a e0 ldi r24, 0x0A ; 10 1c35c: 91 e4 ldi r25, 0x41 ; 65 1c35e: 0e 94 a7 6c call 0xd94e ; 0xd94e 1c362: 40 e0 ldi r20, 0x00 ; 0 1c364: 60 e0 ldi r22, 0x00 ; 0 1c366: 0f 94 8a 2e call 0x25d14 ; 0x25d14 1c36a: 81 11 cpse r24, r1 1c36c: 20 c0 rjmp .+64 ; 0x1c3ae #endif //(LANG_MODE == 0) void lang_boot_update_start(uint8_t lang) { uint8_t cnt = lang_get_count(); 1c36e: 0e 94 18 6c call 0xd830 ; 0xd830 if ((lang < 2) || (lang > cnt)) return; //only languages from xflash can be selected 1c372: c2 30 cpi r28, 0x02 ; 2 1c374: e0 f0 brcs .+56 ; 0x1c3ae 1c376: 8c 17 cp r24, r28 1c378: d0 f0 brcs .+52 ; 0x1c3ae softReset(); } void bootapp_reboot_user0(uint8_t reserved) { cli(); 1c37a: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 1c37c: 8a ea ldi r24, 0xAA ; 170 1c37e: 95 e5 ldi r25, 0x55 ; 85 1c380: dc 01 movw r26, r24 1c382: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x8f8> 1c386: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x8f9> 1c38a: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x8fa> 1c38e: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x8fb> boot_app_flags = BOOT_APP_FLG_USER0; 1c392: 80 e8 ldi r24, 0x80 ; 128 1c394: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x8f7> boot_copy_size = 0; 1c398: 10 92 f9 1f sts 0x1FF9, r1 ; 0x801ff9 <__bss_end+0x8f5> 1c39c: 10 92 f8 1f sts 0x1FF8, r1 ; 0x801ff8 <__bss_end+0x8f4> bootapp_reboot_user0(lang << 3); 1c3a0: cc 0f add r28, r28 1c3a2: cc 0f add r28, r28 1c3a4: cc 0f add r28, r28 boot_reserved = reserved; 1c3a6: c0 93 fa 1f sts 0x1FFA, r28 ; 0x801ffa <__bss_end+0x8f6> // bootapp_print_vars(); softReset(); 1c3aa: 0e 94 9d 60 call 0xc13a ; 0xc13a lang_boot_update_start(lang); lcd_update_enable(true); 1c3ae: 81 e0 ldi r24, 0x01 ; 1 1c3b0: 0e 94 b6 69 call 0xd36c ; 0xd36c menu_goto(lcd_language_menu, 0, true, true); 1c3b4: 21 e0 ldi r18, 0x01 ; 1 1c3b6: 41 e0 ldi r20, 0x01 ; 1 1c3b8: 70 e0 ldi r23, 0x00 ; 0 1c3ba: 60 e0 ldi r22, 0x00 ; 0 1c3bc: 89 e9 ldi r24, 0x99 ; 153 1c3be: 98 e3 ldi r25, 0x38 ; 56 1c3c0: 0f 94 a5 93 call 0x3274a ; 0x3274a 1c3c4: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout } } 1c3c8: cf 91 pop r28 1c3ca: 08 95 ret 0001c3cc : 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)) { 1c3cc: 0f 93 push r16 1c3ce: 1f 93 push r17 1c3d0: cf 93 push r28 1c3d2: df 93 push r29 1c3d4: eb 01 movw r28, r22 1c3d6: 8a 01 movw r16, r20 switch(*oCheckSetting) { 1c3d8: 81 30 cpi r24, 0x01 ; 1 1c3da: 81 f0 breq .+32 ; 0x1c3fc 1c3dc: 82 30 cpi r24, 0x02 ; 2 1c3de: 89 f0 breq .+34 ; 0x1c402 case ClCheckMode::_None: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); 1c3e0: 85 e5 ldi r24, 0x55 ; 85 1c3e2: 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); 1c3e4: 0e 94 a7 6c call 0xd94e ; 0xd94e 1c3e8: 22 e0 ldi r18, 0x02 ; 2 1c3ea: a8 01 movw r20, r16 1c3ec: bc 01 movw r22, r24 1c3ee: ce 01 movw r24, r28 break; default: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); } } 1c3f0: df 91 pop r29 1c3f2: cf 91 pop r28 1c3f4: 1f 91 pop r17 1c3f6: 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); 1c3f8: 0d 94 0a 95 jmp 0x32a14 ; 0x32a14 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); 1c3fc: 8e e4 ldi r24, 0x4E ; 78 1c3fe: 90 e4 ldi r25, 0x40 ; 64 1c400: f1 cf rjmp .-30 ; 0x1c3e4 break; case ClCheckMode::_Strict: MENU_ITEM_TOGGLE_P(msg, _T(MSG_STRICT), func); 1c402: 85 e4 ldi r24, 0x45 ; 69 1c404: 90 e4 ldi r25, 0x40 ; 64 1c406: ee cf rjmp .-36 ; 0x1c3e4 0001c408 : } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) strncpy_P(lcd_status_message, message, LCD_WIDTH); 1c408: 44 e1 ldi r20, 0x14 ; 20 1c40a: 50 e0 ldi r21, 0x00 ; 0 return false; } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) 1c40c: 66 23 and r22, r22 1c40e: 89 f0 breq .+34 ; 0x1c432 strncpy_P(lcd_status_message, message, LCD_WIDTH); 1c410: bc 01 movw r22, r24 1c412: 89 e0 ldi r24, 0x09 ; 9 1c414: 95 e0 ldi r25, 0x05 ; 5 1c416: 0f 94 88 9e call 0x33d10 ; 0x33d10 else strncpy(lcd_status_message, message, LCD_WIDTH); lcd_status_message[LCD_WIDTH] = 0; 1c41a: 10 92 1d 05 sts 0x051D, r1 ; 0x80051d <_ZL18lcd_status_message.lto_priv.421+0x14> lcd_status_message_idx = 0; // Print message from beginning 1c41e: 10 92 08 05 sts 0x0508, r1 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.417> SERIAL_PROTOCOLLNRPGM(MSG_LCD_STATUS_CHANGED); 1c422: 86 ed ldi r24, 0xD6 ; 214 1c424: 97 e6 ldi r25, 0x67 ; 103 1c426: 0e 94 49 72 call 0xe492 ; 0xe492 // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; 1c42a: 81 e0 ldi r24, 0x01 ; 1 1c42c: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } 1c430: 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); 1c432: bc 01 movw r22, r24 1c434: 89 e0 ldi r24, 0x09 ; 9 1c436: 95 e0 ldi r25, 0x05 ; 5 1c438: 0f 94 1b a7 call 0x34e36 ; 0x34e36 1c43c: ee cf rjmp .-36 ; 0x1c41a 0001c43e : } static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) 1c43e: 90 91 8e 03 lds r25, 0x038E ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.408> 1c442: 89 17 cp r24, r25 1c444: 80 f4 brcc .+32 ; 0x1c466 return true; // check if we can override an info message yet if (lcd_status_message_level == LCD_STATUS_INFO) { 1c446: 91 30 cpi r25, 0x01 ; 1 1c448: 61 f4 brne .+24 ; 0x1c462 } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 1c44a: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL26lcd_status_message_timeout.lto_priv.420> 1c44e: 88 23 and r24, r24 1c450: 51 f0 breq .+20 ; 0x1c466 1c452: 40 e2 ldi r20, 0x20 ; 32 1c454: 5e e4 ldi r21, 0x4E ; 78 1c456: 60 e0 ldi r22, 0x00 ; 0 1c458: 70 e0 ldi r23, 0x00 ; 0 1c45a: 8e e1 ldi r24, 0x1E ; 30 1c45c: 95 e0 ldi r25, 0x05 ; 5 1c45e: 0d 94 6a 10 jmp 0x220d4 ; 0x220d4 ::expired(unsigned long)> return lcd_status_message_timeout.expired_cont(LCD_STATUS_INFO_TIMEOUT); } return false; 1c462: 80 e0 ldi r24, 0x00 ; 0 1c464: 08 95 ret static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) return true; 1c466: 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; } 1c468: 08 95 ret 0001c46a : { lcd_setalertstatus_(message, severity, false); } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { 1c46a: ef 92 push r14 1c46c: ff 92 push r15 1c46e: 1f 93 push r17 1c470: cf 93 push r28 1c472: df 93 push r29 1c474: ec 01 movw r28, r24 1c476: 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)) { 1c478: 86 2f mov r24, r22 1c47a: 0e 94 1f e2 call 0x1c43e ; 0x1c43e 1c47e: 88 23 and r24, r24 1c480: e9 f0 breq .+58 ; 0x1c4bc bool same = !(progmem? strcmp_P(lcd_status_message, message): 1c482: be 01 movw r22, r28 1c484: 89 e0 ldi r24, 0x09 ; 9 1c486: 95 e0 ldi r25, 0x05 ; 5 1c488: 0f 94 49 9e call 0x33c92 ; 0x33c92 1c48c: 7c 01 movw r14, r24 strcmp(lcd_status_message, message)); lcd_status_message_timeout.start(); 1c48e: 8e e1 ldi r24, 0x1E ; 30 1c490: 95 e0 ldi r25, 0x05 ; 5 1c492: 0f 94 29 12 call 0x22452 ; 0x22452 ::start()> lcd_status_message_level = severity; 1c496: 10 93 8e 03 sts 0x038E, r17 ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.408> custom_message_type = CustomMsg::Status; 1c49a: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 custom_message_state = 0; 1c49e: 10 92 ac 03 sts 0x03AC, r1 ; 0x8003ac if (!same) { 1c4a2: ef 28 or r14, r15 1c4a4: 59 f0 breq .+22 ; 0x1c4bc // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 1c4a6: 61 e0 ldi r22, 0x01 ; 1 1c4a8: ce 01 movw r24, r28 1c4aa: 0e 94 04 e2 call 0x1c408 ; 0x1c408 } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 1c4ae: df 91 pop r29 1c4b0: cf 91 pop r28 1c4b2: 1f 91 pop r17 1c4b4: ff 90 pop r15 1c4b6: 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(); 1c4b8: 0c 94 6d fe jmp 0x1fcda ; 0x1fcda } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 1c4bc: df 91 pop r29 1c4be: cf 91 pop r28 1c4c0: 1f 91 pop r17 1c4c2: ff 90 pop r15 1c4c4: ef 90 pop r14 1c4c6: 08 95 ret 0001c4c8 : manage_inactivity(true); return _stepresult; } static void lcd_selftest_error(TestError testError, const char *_error_1, const char *_error_2) { 1c4c8: ef 92 push r14 1c4ca: ff 92 push r15 1c4cc: 1f 93 push r17 1c4ce: cf 93 push r28 1c4d0: df 93 push r29 1c4d2: 18 2f mov r17, r24 1c4d4: eb 01 movw r28, r22 1c4d6: 7a 01 movw r14, r20 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 1c4d8: 80 e0 ldi r24, 0x00 ; 0 1c4da: 0f 94 2b 2d call 0x25a56 ; 0x25a56 lcd_beeper_quick_feedback(); FORCE_BL_ON_END; target_temperature[0] = 0; 1c4de: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 1c4e2: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 target_temperature_bed = 0; 1c4e6: 10 92 ee 11 sts 0x11EE, r1 ; 0x8011ee 1c4ea: 10 92 ed 11 sts 0x11ED, r1 ; 0x8011ed manage_heater(); 1c4ee: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(); 1c4f2: 80 e0 ldi r24, 0x00 ; 0 1c4f4: 0e 94 fe 79 call 0xf3fc ; 0xf3fc lcd_clear(); 1c4f8: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_ERROR)); 1c4fc: 85 e1 ldi r24, 0x15 ; 21 1c4fe: 9f e3 ldi r25, 0x3F ; 63 1c500: 0e 94 a7 6c call 0xd94e ; 0xd94e 1c504: ac 01 movw r20, r24 1c506: 60 e0 ldi r22, 0x00 ; 0 1c508: 80 e0 ldi r24, 0x00 ; 0 1c50a: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_puts_at_P(0, 1, _T(MSG_SELFTEST_PLEASECHECK)); 1c50e: 85 e0 ldi r24, 0x05 ; 5 1c510: 9f e3 ldi r25, 0x3F ; 63 1c512: 0e 94 a7 6c call 0xd94e ; 0xd94e 1c516: ac 01 movw r20, r24 1c518: 61 e0 ldi r22, 0x01 ; 1 1c51a: 80 e0 ldi r24, 0x00 ; 0 1c51c: 0e 94 85 69 call 0xd30a ; 0xd30a switch (testError) 1c520: 11 50 subi r17, 0x01 ; 1 1c522: 19 30 cpi r17, 0x09 ; 9 1c524: 88 f4 brcc .+34 ; 0x1c548 1c526: e1 2f mov r30, r17 1c528: f0 e0 ldi r31, 0x00 ; 0 1c52a: 88 27 eor r24, r24 1c52c: e5 56 subi r30, 0x65 ; 101 1c52e: fd 41 sbci r31, 0x1D ; 29 1c530: 8f 4f sbci r24, 0xFF ; 255 1c532: 0d 94 ab a1 jmp 0x34356 ; 0x34356 <__tablejump2__> 1c536: dc e2 ldi r29, 0x2C ; 44 1c538: e8 e2 ldi r30, 0x28 ; 40 1c53a: 00 e3 ldi r16, 0x30 ; 48 1c53c: 21 e3 ldi r18, 0x31 ; 49 1c53e: 2d e3 ldi r18, 0x3D ; 61 1c540: 30 e3 ldi r19, 0x30 ; 48 1c542: 33 e3 ldi r19, 0x33 ; 51 1c544: 36 e3 ldi r19, 0x36 ; 54 1c546: 42 e3 ldi r20, 0x32 ; 50 { case TestError::Heater: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_HEATERTHERMISTOR)); 1c548: 81 ef ldi r24, 0xF1 ; 241 1c54a: 9e e3 ldi r25, 0x3E ; 62 1c54c: 0e 94 a7 6c call 0xd94e ; 0xd94e 1c550: ac 01 movw r20, r24 1c552: 62 e0 ldi r22, 0x02 ; 2 1c554: 80 e0 ldi r24, 0x00 ; 0 1c556: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_NOTCONNECTED)); 1c55a: 81 ee ldi r24, 0xE1 ; 225 1c55c: 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)); 1c55e: 0e 94 a7 6c call 0xd94e ; 0xd94e 1c562: ac 01 movw r20, r24 1c564: 63 e0 ldi r22, 0x03 ; 3 1c566: 80 e0 ldi r24, 0x00 ; 0 1c568: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_set_cursor(0, 3); lcd_printf_P(_T(MSG_SELFTEST_FS_LEVEL),_error_1); break; } _delay(1000); 1c56c: 68 ee ldi r22, 0xE8 ; 232 1c56e: 73 e0 ldi r23, 0x03 ; 3 1c570: 80 e0 ldi r24, 0x00 ; 0 1c572: 90 e0 ldi r25, 0x00 ; 0 1c574: 0f 94 03 0e call 0x21c06 ; 0x21c06 1c578: 80 e0 ldi r24, 0x00 ; 0 1c57a: 0f 94 2b 2d call 0x25a56 ; 0x25a56 lcd_beeper_quick_feedback(); do { _delay(100); 1c57e: 64 e6 ldi r22, 0x64 ; 100 1c580: 70 e0 ldi r23, 0x00 ; 0 1c582: 80 e0 ldi r24, 0x00 ; 0 1c584: 90 e0 ldi r25, 0x00 ; 0 1c586: 0f 94 03 0e call 0x21c06 ; 0x21c06 manage_heater(); 1c58a: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(); 1c58e: 80 e0 ldi r24, 0x00 ; 0 1c590: 0e 94 fe 79 call 0xf3fc ; 0xf3fc } while (!lcd_clicked()); 1c594: 0e 94 8e 6b call 0xd71c ; 0xd71c 1c598: 88 23 and r24, r24 1c59a: 89 f3 breq .-30 ; 0x1c57e LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 1c59c: 87 e6 ldi r24, 0x67 ; 103 1c59e: 9f e3 ldi r25, 0x3F ; 63 1c5a0: 0e 94 a7 6c call 0xd94e ; 0xd94e 1c5a4: 62 e0 ldi r22, 0x02 ; 2 1c5a6: 0e 94 35 e2 call 0x1c46a ; 0x1c46a lcd_return_to_status(); } 1c5aa: df 91 pop r29 1c5ac: cf 91 pop r28 1c5ae: 1f 91 pop r17 1c5b0: ff 90 pop r15 1c5b2: ef 90 pop r14 manage_heater(); manage_inactivity(); } while (!lcd_clicked()); LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); lcd_return_to_status(); 1c5b4: 0c 94 6d fe jmp 0x1fcda ; 0x1fcda 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)); 1c5b8: 84 ed ldi r24, 0xD4 ; 212 1c5ba: 9e e3 ldi r25, 0x3E ; 62 1c5bc: 0e 94 a7 6c call 0xd94e ; 0xd94e 1c5c0: ac 01 movw r20, r24 1c5c2: 62 e0 ldi r22, 0x02 ; 2 1c5c4: 80 e0 ldi r24, 0x00 ; 0 1c5c6: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 1c5ca: 85 ec ldi r24, 0xC5 ; 197 1c5cc: 9e e3 ldi r25, 0x3E ; 62 1c5ce: c7 cf rjmp .-114 ; 0x1c55e break; case TestError::Endstops: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_ENDSTOPS)); 1c5d0: 8a eb ldi r24, 0xBA ; 186 1c5d2: 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)); 1c5d4: 0e 94 a7 6c call 0xd94e ; 0xd94e 1c5d8: ac 01 movw r20, r24 1c5da: 62 e0 ldi r22, 0x02 ; 2 1c5dc: 80 e0 ldi r24, 0x00 ; 0 1c5de: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 1c5e2: 85 ec ldi r24, 0xC5 ; 197 1c5e4: 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)); 1c5e6: 0e 94 a7 6c call 0xd94e ; 0xd94e 1c5ea: ac 01 movw r20, r24 1c5ec: 63 e0 ldi r22, 0x03 ; 3 1c5ee: 80 e0 ldi r24, 0x00 ; 0 1c5f0: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_set_cursor(18, 3); 1c5f4: 63 e0 ldi r22, 0x03 ; 3 1c5f6: 82 e1 ldi r24, 0x12 ; 18 1c5f8: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_print(_error_1); 1c5fc: ce 01 movw r24, r28 1c5fe: 1e c0 rjmp .+60 ; 0x1c63c 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)); 1c600: 82 eb ldi r24, 0xB2 ; 178 1c602: 9e e3 ldi r25, 0x3E ; 62 1c604: 0e 94 a7 6c call 0xd94e ; 0xd94e 1c608: ac 01 movw r20, r24 1c60a: 62 e0 ldi r22, 0x02 ; 2 1c60c: 80 e0 ldi r24, 0x00 ; 0 1c60e: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_set_cursor(18, 2); 1c612: 62 e0 ldi r22, 0x02 ; 2 1c614: 82 e1 ldi r24, 0x12 ; 18 1c616: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_print(_error_1); 1c61a: ce 01 movw r24, r28 1c61c: 0e 94 78 6b call 0xd6f0 ; 0xd6f0 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_ENDSTOP)); 1c620: 88 ea ldi r24, 0xA8 ; 168 1c622: 9e e3 ldi r25, 0x3E ; 62 1c624: 0e 94 a7 6c call 0xd94e ; 0xd94e 1c628: ac 01 movw r20, r24 1c62a: 63 e0 ldi r22, 0x03 ; 3 1c62c: 80 e0 ldi r24, 0x00 ; 0 1c62e: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_set_cursor(18, 3); 1c632: 63 e0 ldi r22, 0x03 ; 3 1c634: 82 e1 ldi r24, 0x12 ; 18 1c636: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_print(_error_2); 1c63a: 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); 1c63c: 0e 94 78 6b call 0xd6f0 ; 0xd6f0 1c640: 95 cf rjmp .-214 ; 0x1c56c 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)); 1c642: 86 e9 ldi r24, 0x96 ; 150 1c644: 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)); 1c646: 0e 94 a7 6c call 0xd94e ; 0xd94e 1c64a: ac 01 movw r20, r24 1c64c: 62 e0 ldi r22, 0x02 ; 2 1c64e: 80 e0 ldi r24, 0x00 ; 0 1c650: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_MOTOR)); 1c654: 82 eb ldi r24, 0xB2 ; 178 1c656: 9e e3 ldi r25, 0x3E ; 62 1c658: c6 cf rjmp .-116 ; 0x1c5e6 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)); 1c65a: 89 ed ldi r24, 0xD9 ; 217 1c65c: 93 e4 ldi r25, 0x43 ; 67 1c65e: ba cf rjmp .-140 ; 0x1c5d4 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)); 1c660: 86 ec ldi r24, 0xC6 ; 198 1c662: 93 e4 ldi r25, 0x43 ; 67 1c664: b7 cf rjmp .-146 ; 0x1c5d4 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)); 1c666: 87 e8 ldi r24, 0x87 ; 135 1c668: 9e e3 ldi r25, 0x3E ; 62 1c66a: ed cf rjmp .-38 ; 0x1c646 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)); 1c66c: 89 e7 ldi r24, 0x79 ; 121 1c66e: 9e e3 ldi r25, 0x3E ; 62 1c670: 0e 94 a7 6c call 0xd94e ; 0xd94e 1c674: ac 01 movw r20, r24 1c676: 62 e0 ldi r22, 0x02 ; 2 1c678: 80 e0 ldi r24, 0x00 ; 0 1c67a: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_AXIS)); 1c67e: 82 e7 ldi r24, 0x72 ; 114 1c680: 9e e3 ldi r25, 0x3E ; 62 1c682: b1 cf rjmp .-158 ; 0x1c5e6 lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::SwappedFan: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FANS)); 1c684: 80 e6 ldi r24, 0x60 ; 96 1c686: 9e e3 ldi r25, 0x3E ; 62 1c688: 0e 94 a7 6c call 0xd94e ; 0xd94e 1c68c: ac 01 movw r20, r24 1c68e: 62 e0 ldi r22, 0x02 ; 2 1c690: 80 e0 ldi r24, 0x00 ; 0 1c692: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_SWAPPED)); 1c696: 86 e5 ldi r24, 0x56 ; 86 1c698: 9e e3 ldi r25, 0x3E ; 62 1c69a: a5 cf rjmp .-182 ; 0x1c5e6 0001c69c : manage_inactivity(true); return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { 1c69c: 8f 92 push r8 1c69e: 9f 92 push r9 1c6a0: af 92 push r10 1c6a2: bf 92 push r11 1c6a4: cf 92 push r12 1c6a6: df 92 push r13 1c6a8: ef 92 push r14 1c6aa: ff 92 push r15 1c6ac: 0f 93 push r16 1c6ae: 1f 93 push r17 1c6b0: cf 93 push r28 1c6b2: df 93 push r29 1c6b4: f8 2e mov r15, r24 1c6b6: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 1c6ba: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 1c6be: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 1c6c2: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 1c6c6: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 1c6ca: 4b 01 movw r8, r22 1c6cc: 6b 01 movw r12, r22 1c6ce: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 1c6d2: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 1c6d6: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 1c6da: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 1c6de: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 1c6e2: 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 1c6e4: 9c e3 ldi r25, 0x3C ; 60 1c6e6: a9 2e mov r10, r25 target_temperature[0] = (_isbed) ? 0 : 200; 1c6e8: 88 ec ldi r24, 0xC8 ; 200 1c6ea: 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); 1c6ec: ff 20 and r15, r15 1c6ee: 31 f0 breq .+12 ; 0x1c6fc 1c6f0: 6b 01 movw r12, r22 int _opposite_snapshot = (_isbed) ? degHotend(0) : degBed(); 1c6f2: e4 01 movw r28, r8 uint8_t _cycles = (_isbed) ? 180 : 60; //~ 90s / 30s 1c6f4: 24 eb ldi r18, 0xB4 ; 180 1c6f6: a2 2e mov r10, r18 target_temperature[0] = (_isbed) ? 0 : 200; 1c6f8: 90 e0 ldi r25, 0x00 ; 0 1c6fa: 80 e0 ldi r24, 0x00 ; 0 1c6fc: 90 93 f2 11 sts 0x11F2, r25 ; 0x8011f2 1c700: 80 93 f1 11 sts 0x11F1, r24 ; 0x8011f1 target_temperature_bed = (_isbed) ? 100 : 0; 1c704: 84 e6 ldi r24, 0x64 ; 100 1c706: 90 e0 ldi r25, 0x00 ; 0 1c708: f1 10 cpse r15, r1 1c70a: 02 c0 rjmp .+4 ; 0x1c710 1c70c: 90 e0 ldi r25, 0x00 ; 0 1c70e: 80 e0 ldi r24, 0x00 ; 0 1c710: 90 93 ee 11 sts 0x11EE, r25 ; 0x8011ee 1c714: 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(); 1c718: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(true); 1c71c: 81 e0 ldi r24, 0x01 ; 1 1c71e: 0e 94 fe 79 call 0xf3fc ; 0xf3fc for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1c722: e1 2c mov r14, r1 return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { uint8_t _progress = 0; 1c724: 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 1c726: 85 e0 ldi r24, 0x05 ; 5 1c728: 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) 1c72a: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 1c72e: 81 11 cpse r24, r1 1c730: 1c c0 rjmp .+56 ; 0x1c76a { manage_heater(); 1c732: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(true); 1c736: 81 e0 ldi r24, 0x01 ; 1 1c738: 0e 94 fe 79 call 0xf3fc ; 0xf3fc _progress = (_isbed? 1c73c: 00 e9 ldi r16, 0x90 ; 144 1c73e: 11 e0 ldi r17, 0x01 ; 1 1c740: 20 e0 ldi r18, 0x00 ; 0 1c742: 42 e0 ldi r20, 0x02 ; 2 1c744: 6b 2d mov r22, r11 1c746: 87 e0 ldi r24, 0x07 ; 7 1c748: f1 10 cpse r15, r1 1c74a: 01 c0 rjmp .+2 ; 0x1c74e 1c74c: 88 e0 ldi r24, 0x08 ; 8 1c74e: 0e 94 35 b9 call 0x1726a ; 0x1726a 1c752: 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 1c754: 8e 2d mov r24, r14 1c756: 69 2d mov r22, r9 1c758: 0f 94 4a a1 call 0x34294 ; 0x34294 <__udivmodqi4> 1c75c: 91 11 cpse r25, r1 1c75e: 02 c0 rjmp .+4 ; 0x1c764 1c760: 0e 94 5e 70 call 0xe0bc ; 0xe0bc thermal_model_set_enabled(false); #endif //THERMAL_MODEL manage_heater(); manage_inactivity(true); for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1c764: e3 94 inc r14 1c766: ea 10 cpse r14, r10 1c768: e0 cf rjmp .-64 ; 0x1c72a MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds } target_temperature[0] = 0; 1c76a: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 1c76e: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 target_temperature_bed = 0; 1c772: 10 92 ee 11 sts 0x11EE, r1 ; 0x8011ee 1c776: 10 92 ed 11 sts 0x11ED, r1 ; 0x8011ed manage_heater(); 1c77a: 0f 94 13 33 call 0x26626 ; 0x26626 1c77e: b6 01 movw r22, r12 1c780: dd 0c add r13, r13 1c782: 88 0b sbc r24, r24 1c784: 99 0b sbc r25, r25 1c786: 4e 01 movw r8, r28 1c788: dd 0f add r29, r29 1c78a: aa 08 sbc r10, r10 1c78c: bb 08 sbc r11, r11 int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1c78e: ff 20 and r15, r15 1c790: 09 f4 brne .+2 ; 0x1c794 1c792: 4d c0 rjmp .+154 ; 0x1c82e 1c794: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 1c798: 9b 01 movw r18, r22 1c79a: ac 01 movw r20, r24 1c79c: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 1c7a0: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 1c7a4: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 1c7a8: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 1c7ac: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1c7b0: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 1c7b4: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1c7b6: c5 01 movw r24, r10 1c7b8: b4 01 movw r22, r8 1c7ba: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 1c7be: 9b 01 movw r18, r22 1c7c0: ac 01 movw r20, r24 1c7c2: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 1c7c6: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 1c7ca: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 1c7ce: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 1c7d2: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1c7d6: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1c7da: 10 91 ce 11 lds r17, 0x11CE ; 0x8011ce 1c7de: 11 11 cpse r17, r1 1c7e0: 0c c0 rjmp .+24 ; 0x1c7fa 1c7e2: f1 10 cpse r15, r1 1c7e4: 44 c0 rjmp .+136 ; 0x1c86e 1c7e6: 69 30 cpi r22, 0x09 ; 9 1c7e8: 71 05 cpc r23, r1 1c7ea: 0c f0 brlt .+2 ; 0x1c7ee 1c7ec: 46 c0 rjmp .+140 ; 0x1c87a { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1c7ee: 8e e1 ldi r24, 0x1E ; 30 1c7f0: 90 e0 ldi r25, 0x00 ; 0 _stepresult = true; 1c7f2: 11 e0 ldi r17, 0x01 ; 1 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1c7f4: c8 17 cp r28, r24 1c7f6: d9 07 cpc r29, r25 1c7f8: 3c f4 brge .+14 ; 0x1c808 _stepresult = true; else lcd_selftest_error(TestError::Heater, "", ""); 1c7fa: 4a ed ldi r20, 0xDA ; 218 1c7fc: 52 e0 ldi r21, 0x02 ; 2 1c7fe: ba 01 movw r22, r20 1c800: 80 e0 ldi r24, 0x00 ; 0 1c802: 0e 94 64 e2 call 0x1c4c8 ; 0x1c4c8 MYSERIAL.println(_checked_result); MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; 1c806: 10 e0 ldi r17, 0x00 ; 0 } #ifdef THERMAL_MODEL thermal_model_set_enabled(tm_was_enabled); #endif //THERMAL_MODEL manage_heater(); 1c808: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(true); 1c80c: 81 e0 ldi r24, 0x01 ; 1 1c80e: 0e 94 fe 79 call 0xf3fc ; 0xf3fc return _stepresult; } 1c812: 81 2f mov r24, r17 1c814: df 91 pop r29 1c816: cf 91 pop r28 1c818: 1f 91 pop r17 1c81a: 0f 91 pop r16 1c81c: ff 90 pop r15 1c81e: ef 90 pop r14 1c820: df 90 pop r13 1c822: cf 90 pop r12 1c824: bf 90 pop r11 1c826: af 90 pop r10 1c828: 9f 90 pop r9 1c82a: 8f 90 pop r8 1c82c: 08 95 ret target_temperature[0] = 0; target_temperature_bed = 0; manage_heater(); int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1c82e: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 1c832: 9b 01 movw r18, r22 1c834: ac 01 movw r20, r24 1c836: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 1c83a: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 1c83e: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 1c842: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 1c846: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1c84a: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 1c84e: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1c850: c5 01 movw r24, r10 1c852: b4 01 movw r22, r8 1c854: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 1c858: 9b 01 movw r18, r22 1c85a: ac 01 movw r20, r24 1c85c: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 1c860: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 1c864: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 1c868: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 1c86c: b2 cf rjmp .-156 ; 0x1c7d2 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1c86e: 89 e0 ldi r24, 0x09 ; 9 1c870: 90 e0 ldi r25, 0x00 ; 0 MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1c872: 6e 31 cpi r22, 0x1E ; 30 1c874: 71 05 cpc r23, r1 1c876: 0c f4 brge .+2 ; 0x1c87a 1c878: bc cf rjmp .-136 ; 0x1c7f2 else lcd_selftest_error(TestError::Heater, "", ""); } else { lcd_selftest_error(TestError::Bed, "", ""); 1c87a: 4a ed ldi r20, 0xDA ; 218 1c87c: 52 e0 ldi r21, 0x02 ; 2 1c87e: ba 01 movw r22, r20 1c880: 81 e0 ldi r24, 0x01 ; 1 1c882: 0e 94 64 e2 call 0x1c4c8 ; 0x1c4c8 1c886: c0 cf rjmp .-128 ; 0x1c808 0001c888 : return _stepresult; } static bool lcd_selfcheck_pulleys(int axis) { 1c888: 2f 92 push r2 1c88a: 3f 92 push r3 1c88c: 4f 92 push r4 1c88e: 5f 92 push r5 1c890: 6f 92 push r6 1c892: 7f 92 push r7 1c894: 8f 92 push r8 1c896: 9f 92 push r9 1c898: af 92 push r10 1c89a: bf 92 push r11 1c89c: cf 92 push r12 1c89e: df 92 push r13 1c8a0: ef 92 push r14 1c8a2: ff 92 push r15 1c8a4: 0f 93 push r16 1c8a6: 1f 93 push r17 1c8a8: cf 93 push r28 1c8aa: df 93 push r29 1c8ac: 8c 01 movw r16, r24 float current_position_init; float move; bool endstop_triggered = false; int i; unsigned long timeout_counter; refresh_cmd_timeout(); 1c8ae: 0e 94 bf 5f call 0xbf7e ; 0xbf7e manage_inactivity(true); 1c8b2: 81 e0 ldi r24, 0x01 ; 1 1c8b4: 0e 94 fe 79 call 0xf3fc ; 0xf3fc if (axis == 0) move = 50; //X_AXIS else move = 50; //Y_AXIS current_position_init = current_position[axis]; 1c8b8: 18 01 movw r2, r16 1c8ba: 22 0c add r2, r2 1c8bc: 33 1c adc r3, r3 1c8be: 22 0c add r2, r2 1c8c0: 33 1c adc r3, r3 1c8c2: e1 01 movw r28, r2 1c8c4: cb 50 subi r28, 0x0B ; 11 1c8c6: de 4e sbci r29, 0xEE ; 238 1c8c8: 88 80 ld r8, Y 1c8ca: 99 80 ldd r9, Y+1 ; 0x01 1c8cc: aa 80 ldd r10, Y+2 ; 0x02 1c8ce: bb 80 ldd r11, Y+3 ; 0x03 current_position[axis] += 2; 1c8d0: 20 e0 ldi r18, 0x00 ; 0 1c8d2: 30 e0 ldi r19, 0x00 ; 0 1c8d4: 40 e0 ldi r20, 0x00 ; 0 1c8d6: 50 e4 ldi r21, 0x40 ; 64 1c8d8: c5 01 movw r24, r10 1c8da: b4 01 movw r22, r8 1c8dc: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1c8e0: 68 83 st Y, r22 1c8e2: 79 83 std Y+1, r23 ; 0x01 1c8e4: 8a 83 std Y+2, r24 ; 0x02 1c8e6: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1c8e8: 60 e0 ldi r22, 0x00 ; 0 1c8ea: 70 e0 ldi r23, 0x00 ; 0 1c8ec: 84 e3 ldi r24, 0x34 ; 52 1c8ee: 92 e4 ldi r25, 0x42 ; 66 1c8f0: 0f 94 2f 85 call 0x30a5e ; 0x30a5e 1c8f4: 95 e0 ldi r25, 0x05 ; 5 1c8f6: e9 2e mov r14, r25 1c8f8: f1 2c mov r15, r1 for (i = 0; i < 5; i++) { refresh_cmd_timeout(); 1c8fa: 0e 94 bf 5f call 0xbf7e ; 0xbf7e current_position[axis] = current_position[axis] + move; 1c8fe: 20 e0 ldi r18, 0x00 ; 0 1c900: 30 e0 ldi r19, 0x00 ; 0 1c902: 48 e4 ldi r20, 0x48 ; 72 1c904: 52 e4 ldi r21, 0x42 ; 66 1c906: 68 81 ld r22, Y 1c908: 79 81 ldd r23, Y+1 ; 0x01 1c90a: 8a 81 ldd r24, Y+2 ; 0x02 1c90c: 9b 81 ldd r25, Y+3 ; 0x03 1c90e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1c912: 68 83 st Y, r22 1c914: 79 83 std Y+1, r23 ; 0x01 1c916: 8a 83 std Y+2, r24 ; 0x02 1c918: 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); 1c91a: 6c e6 ldi r22, 0x6C ; 108 1c91c: 70 e0 ldi r23, 0x00 ; 0 1c91e: 8e e2 ldi r24, 0x2E ; 46 1c920: 0e 94 6e c0 call 0x180dc ; 0x180dc st_current_set(0, 850); //set motor current higher plan_buffer_line_curposXYZE(200); 1c924: 60 e0 ldi r22, 0x00 ; 0 1c926: 70 e0 ldi r23, 0x00 ; 0 1c928: 88 e4 ldi r24, 0x48 ; 72 1c92a: 93 e4 ldi r25, 0x43 ; 67 1c92c: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 1c930: 0f 94 ce 22 call 0x2459c ; 0x2459c if (SilentModeMenu != SILENT_MODE_OFF) st_current_set(0, tmp_motor[0]); //set back to normal operation currents 1c934: 80 91 89 03 lds r24, 0x0389 ; 0x800389 1c938: 62 e2 ldi r22, 0x22 ; 34 1c93a: 70 e0 ldi r23, 0x00 ; 0 1c93c: 81 11 cpse r24, r1 1c93e: 02 c0 rjmp .+4 ; 0x1c944 1c940: 64 e4 ldi r22, 0x44 ; 68 1c942: 70 e0 ldi r23, 0x00 ; 0 1c944: 8e e2 ldi r24, 0x2E ; 46 1c946: 0e 94 6e c0 call 0x180dc ; 0x180dc else st_current_set(0, tmp_motor_loud[0]); //set motor current back current_position[axis] = current_position[axis] - move; 1c94a: 20 e0 ldi r18, 0x00 ; 0 1c94c: 30 e0 ldi r19, 0x00 ; 0 1c94e: 48 e4 ldi r20, 0x48 ; 72 1c950: 52 e4 ldi r21, 0x42 ; 66 1c952: 68 81 ld r22, Y 1c954: 79 81 ldd r23, Y+1 ; 0x01 1c956: 8a 81 ldd r24, Y+2 ; 0x02 1c958: 9b 81 ldd r25, Y+3 ; 0x03 1c95a: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1c95e: 68 83 st Y, r22 1c960: 79 83 std Y+1, r23 ; 0x01 1c962: 8a 83 std Y+2, r24 ; 0x02 1c964: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(50); 1c966: 60 e0 ldi r22, 0x00 ; 0 1c968: 70 e0 ldi r23, 0x00 ; 0 1c96a: 88 e4 ldi r24, 0x48 ; 72 1c96c: 92 e4 ldi r25, 0x42 ; 66 1c96e: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 1c972: 0f 94 ce 22 call 0x2459c ; 0x2459c if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1c976: 1e 99 sbic 0x03, 6 ; 3 1c978: 3a c0 rjmp .+116 ; 0x1c9ee 1c97a: 1d 99 sbic 0x03, 5 ; 3 1c97c: 38 c0 rjmp .+112 ; 0x1c9ee 1c97e: 21 e0 ldi r18, 0x01 ; 1 1c980: e2 1a sub r14, r18 1c982: 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++) { 1c984: 09 f0 breq .+2 ; 0x1c988 1c986: b9 cf rjmp .-142 ; 0x1c8fa ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) { lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", ""); return(false); } } timeout_counter = _millis() + 2500; 1c988: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 1c98c: 2b 01 movw r4, r22 1c98e: 3c 01 movw r6, r24 1c990: 24 ec ldi r18, 0xC4 ; 196 1c992: 42 0e add r4, r18 1c994: 29 e0 ldi r18, 0x09 ; 9 1c996: 52 1e adc r5, r18 1c998: 61 1c adc r6, r1 1c99a: 71 1c adc r7, r1 endstop_triggered = false; manage_inactivity(true); 1c99c: 81 e0 ldi r24, 0x01 ; 1 1c99e: 0e 94 fe 79 call 0xf3fc ; 0xf3fc 1c9a2: e1 01 movw r28, r2 1c9a4: cb 50 subi r28, 0x0B ; 11 1c9a6: de 4e sbci r29, 0xEE ; 238 1c9a8: c8 80 ld r12, Y 1c9aa: d9 80 ldd r13, Y+1 ; 0x01 1c9ac: ea 80 ldd r14, Y+2 ; 0x02 1c9ae: 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]) { 1c9b0: 20 e0 ldi r18, 0x00 ; 0 1c9b2: 30 e0 ldi r19, 0x00 ; 0 1c9b4: 40 e8 ldi r20, 0x80 ; 128 1c9b6: 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) || 1c9b8: 1e 99 sbic 0x03, 6 ; 3 1c9ba: 26 c0 rjmp .+76 ; 0x1ca08 1c9bc: 1d 99 sbic 0x03, 5 ; 3 1c9be: 24 c0 rjmp .+72 ; 0x1ca08 lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", ""); return(false); } } else { current_position[axis] -= 1; 1c9c0: c7 01 movw r24, r14 1c9c2: b6 01 movw r22, r12 1c9c4: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1c9c8: 68 83 st Y, r22 1c9ca: 79 83 std Y+1, r23 ; 0x01 1c9cc: 8a 83 std Y+2, r24 ; 0x02 1c9ce: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1c9d0: 60 e0 ldi r22, 0x00 ; 0 1c9d2: 70 e0 ldi r23, 0x00 ; 0 1c9d4: 84 e3 ldi r24, 0x34 ; 52 1c9d6: 92 e4 ldi r25, 0x42 ; 66 1c9d8: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 1c9dc: 0f 94 ce 22 call 0x2459c ; 0x2459c if (_millis() > timeout_counter) { 1c9e0: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 1c9e4: 46 16 cp r4, r22 1c9e6: 57 06 cpc r5, r23 1c9e8: 68 06 cpc r6, r24 1c9ea: 79 06 cpc r7, r25 1c9ec: e8 f6 brcc .-70 ; 0x1c9a8 lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", ""); 1c9ee: 6b ed ldi r22, 0xDB ; 219 1c9f0: 72 e0 ldi r23, 0x02 ; 2 1c9f2: 01 2b or r16, r17 1c9f4: 11 f0 breq .+4 ; 0x1c9fa 1c9f6: 6d ed ldi r22, 0xDD ; 221 1c9f8: 72 e0 ldi r23, 0x02 ; 2 1c9fa: 4a ed ldi r20, 0xDA ; 218 1c9fc: 52 e0 ldi r21, 0x02 ; 2 1c9fe: 87 e0 ldi r24, 0x07 ; 7 1ca00: 0e 94 64 e2 call 0x1c4c8 ; 0x1c4c8 return(false); 1ca04: 80 e0 ldi r24, 0x00 ; 0 1ca06: 30 c0 rjmp .+96 ; 0x1ca68 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]) { 1ca08: c5 01 movw r24, r10 1ca0a: b4 01 movw r22, r8 1ca0c: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1ca10: a7 01 movw r20, r14 1ca12: 96 01 movw r18, r12 1ca14: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1ca18: 18 16 cp r1, r24 1ca1a: 4c f3 brlt .-46 ; 0x1c9ee 1ca1c: 20 e0 ldi r18, 0x00 ; 0 1ca1e: 30 e0 ldi r19, 0x00 ; 0 1ca20: 40 e8 ldi r20, 0x80 ; 128 1ca22: 5f e3 ldi r21, 0x3F ; 63 1ca24: c5 01 movw r24, r10 1ca26: b4 01 movw r22, r8 1ca28: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1ca2c: a7 01 movw r20, r14 1ca2e: 96 01 movw r18, r12 1ca30: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 1ca34: 87 fd sbrc r24, 7 1ca36: db cf rjmp .-74 ; 0x1c9ee current_position[axis] += 10; 1ca38: e1 01 movw r28, r2 1ca3a: cb 50 subi r28, 0x0B ; 11 1ca3c: de 4e sbci r29, 0xEE ; 238 1ca3e: 20 e0 ldi r18, 0x00 ; 0 1ca40: 30 e0 ldi r19, 0x00 ; 0 1ca42: 40 e2 ldi r20, 0x20 ; 32 1ca44: 51 e4 ldi r21, 0x41 ; 65 1ca46: c7 01 movw r24, r14 1ca48: b6 01 movw r22, r12 1ca4a: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1ca4e: 68 83 st Y, r22 1ca50: 79 83 std Y+1, r23 ; 0x01 1ca52: 8a 83 std Y+2, r24 ; 0x02 1ca54: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1ca56: 60 e0 ldi r22, 0x00 ; 0 1ca58: 70 e0 ldi r23, 0x00 ; 0 1ca5a: 84 e3 ldi r24, 0x34 ; 52 1ca5c: 92 e4 ldi r25, 0x42 ; 66 1ca5e: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 1ca62: 0f 94 ce 22 call 0x2459c ; 0x2459c return(true); 1ca66: 81 e0 ldi r24, 0x01 ; 1 return(false); } } } return(true); } 1ca68: df 91 pop r29 1ca6a: cf 91 pop r28 1ca6c: 1f 91 pop r17 1ca6e: 0f 91 pop r16 1ca70: ff 90 pop r15 1ca72: ef 90 pop r14 1ca74: df 90 pop r13 1ca76: cf 90 pop r12 1ca78: bf 90 pop r11 1ca7a: af 90 pop r10 1ca7c: 9f 90 pop r9 1ca7e: 8f 90 pop r8 1ca80: 7f 90 pop r7 1ca82: 6f 90 pop r6 1ca84: 5f 90 pop r5 1ca86: 4f 90 pop r4 1ca88: 3f 90 pop r3 1ca8a: 2f 90 pop r2 1ca8c: 08 95 ret 0001ca8e : } #endif //TMC2130 #ifndef TMC2130 static bool lcd_selfcheck_axis(int _axis, int _travel) { 1ca8e: 2f 92 push r2 1ca90: 3f 92 push r3 1ca92: 4f 92 push r4 1ca94: 5f 92 push r5 1ca96: 6f 92 push r6 1ca98: 7f 92 push r7 1ca9a: 8f 92 push r8 1ca9c: 9f 92 push r9 1ca9e: af 92 push r10 1caa0: bf 92 push r11 1caa2: cf 92 push r12 1caa4: df 92 push r13 1caa6: ef 92 push r14 1caa8: ff 92 push r15 1caaa: 0f 93 push r16 1caac: 1f 93 push r17 1caae: cf 93 push r28 1cab0: df 93 push r29 1cab2: 7c 01 movw r14, r24 1cab4: 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); 1cab6: cb 01 movw r24, r22 1cab8: 6a e0 ldi r22, 0x0A ; 10 1caba: 70 e0 ldi r23, 0x00 ; 0 1cabc: 0f 94 78 a1 call 0x342f0 ; 0x342f0 <__divmodhi4> 1cac0: 66 0e add r6, r22 1cac2: 77 1e adc r7, r23 if (_axis == X_AXIS) { 1cac4: e1 14 cp r14, r1 1cac6: f1 04 cpc r15, r1 1cac8: e1 f4 brne .+56 ; 0x1cb02 current_position[Z_AXIS] += 17; 1caca: 20 e0 ldi r18, 0x00 ; 0 1cacc: 30 e0 ldi r19, 0x00 ; 0 1cace: 48 e8 ldi r20, 0x88 ; 136 1cad0: 51 e4 ldi r21, 0x41 ; 65 1cad2: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 1cad6: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 1cada: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 1cade: 90 91 00 12 lds r25, 0x1200 ; 0x801200 1cae2: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1cae6: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 1caea: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 1caee: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 1caf2: 90 93 00 12 sts 0x1200, r25 ; 0x801200 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1caf6: 60 e0 ldi r22, 0x00 ; 0 1caf8: 70 e0 ldi r23, 0x00 ; 0 1cafa: 84 e3 ldi r24, 0x34 ; 52 1cafc: 92 e4 ldi r25, 0x42 ; 66 1cafe: 0f 94 2f 85 call 0x30a5e ; 0x30a5e } #endif //TMC2130 #ifndef TMC2130 static bool lcd_selfcheck_axis(int _axis, int _travel) { 1cb02: 10 e0 ldi r17, 0x00 ; 0 1cb04: 00 e0 ldi r16, 0x00 ; 0 1cb06: d0 e0 ldi r29, 0x00 ; 0 1cb08: c0 e0 ldi r28, 0x00 ; 0 1cb0a: d1 2c mov r13, r1 1cb0c: c1 2c mov r12, r1 1cb0e: 31 2c mov r3, r1 1cb10: 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; 1cb12: 57 01 movw r10, r14 1cb14: aa 0c add r10, r10 1cb16: bb 1c adc r11, r11 1cb18: aa 0c add r10, r10 1cb1a: bb 1c adc r11, r11 1cb1c: c5 01 movw r24, r10 1cb1e: 8b 50 subi r24, 0x0B ; 11 1cb20: 9e 4e sbci r25, 0xEE ; 238 1cb22: 4c 01 movw r8, r24 { _lcd_refresh++; } else { _progress = lcd_selftest_screen(static_cast(static_cast(TestScreen::AxisX) + _axis), _progress, 3, false, 0); 1cb24: 94 e0 ldi r25, 0x04 ; 4 1cb26: 29 2e mov r2, r25 1cb28: 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; 1cb2a: 20 e0 ldi r18, 0x00 ; 0 1cb2c: 30 e0 ldi r19, 0x00 ; 0 1cb2e: 40 e8 ldi r20, 0x80 ; 128 1cb30: 5f e3 ldi r21, 0x3F ; 63 1cb32: f4 01 movw r30, r8 1cb34: 60 81 ld r22, Z 1cb36: 71 81 ldd r23, Z+1 ; 0x01 1cb38: 82 81 ldd r24, Z+2 ; 0x02 1cb3a: 93 81 ldd r25, Z+3 ; 0x03 1cb3c: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1cb40: f4 01 movw r30, r8 1cb42: 60 83 st Z, r22 1cb44: 71 83 std Z+1, r23 ; 0x01 1cb46: 82 83 std Z+2, r24 ; 0x02 1cb48: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1cb4a: 60 e0 ldi r22, 0x00 ; 0 1cb4c: 70 e0 ldi r23, 0x00 ; 0 1cb4e: 84 e3 ldi r24, 0x34 ; 52 1cb50: 92 e4 ldi r25, 0x42 ; 66 1cb52: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 1cb56: 0f 94 ce 22 call 0x2459c ; 0x2459c if ((READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) || (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) || 1cb5a: 1e 99 sbic 0x03, 6 ; 3 1cb5c: 04 c0 rjmp .+8 ; 0x1cb66 1cb5e: 1d 99 sbic 0x03, 5 ; 3 1cb60: 02 c0 rjmp .+4 ; 0x1cb66 1cb62: 1c 9b sbis 0x03, 4 ; 3 1cb64: 39 c0 rjmp .+114 ; 0x1cbd8 (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING)) { if (_axis == 0) { _stepresult = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1cb66: 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) 1cb68: e1 14 cp r14, r1 1cb6a: f1 04 cpc r15, r1 1cb6c: 51 f4 brne .+20 ; 0x1cb82 { _stepresult = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1cb6e: 56 fa bst r5, 6 1cb70: 55 24 eor r5, r5 1cb72: 50 f8 bld r5, 0 _err_endstop = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? 1 : 2; 1cb74: 1d 99 sbic 0x03, 5 ; 3 1cb76: 8e c0 rjmp .+284 ; 0x1cc94 } 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; 1cb78: c2 e0 ldi r28, 0x02 ; 2 1cb7a: 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; 1cb7c: 44 24 eor r4, r4 1cb7e: 43 94 inc r4 1cb80: 2c c0 rjmp .+88 ; 0x1cbda { _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) 1cb82: f1 e0 ldi r31, 0x01 ; 1 1cb84: ef 16 cp r14, r31 1cb86: f1 04 cpc r15, r1 1cb88: 41 f4 brne .+16 ; 0x1cb9a { _stepresult = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1cb8a: 55 fa bst r5, 5 1cb8c: 55 24 eor r5, r5 1cb8e: 50 f8 bld r5, 0 _err_endstop = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? 0 : 2; 1cb90: 1e 9b sbis 0x03, 6 ; 3 1cb92: f2 cf rjmp .-28 ; 0x1cb78 1cb94: d0 e0 ldi r29, 0x00 ; 0 1cb96: c0 e0 ldi r28, 0x00 ; 0 1cb98: f1 cf rjmp .-30 ; 0x1cb7c } if (_axis == 2) { _stepresult = ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1cb9a: 54 fa bst r5, 4 1cb9c: 55 24 eor r5, r5 1cb9e: 50 f8 bld r5, 0 _err_endstop = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? 0 : 1; 1cba0: 83 b1 in r24, 0x03 ; 3 1cba2: 82 95 swap r24 1cba4: 86 95 lsr r24 1cba6: 86 95 lsr r24 1cba8: 83 70 andi r24, 0x03 ; 3 1cbaa: 21 e0 ldi r18, 0x01 ; 1 1cbac: 82 27 eor r24, r18 1cbae: 81 70 andi r24, 0x01 ; 1 1cbb0: c8 2f mov r28, r24 1cbb2: 80 e0 ldi r24, 0x00 ; 0 1cbb4: d8 2f mov r29, r24 printf_P(PSTR("lcd_selfcheck_axis %d, %d\n"), _stepresult, _err_endstop); 1cbb6: 8f 93 push r24 1cbb8: cf 93 push r28 1cbba: 1f 92 push r1 1cbbc: 5f 92 push r5 1cbbe: ef ee ldi r30, 0xEF ; 239 1cbc0: f2 e8 ldi r31, 0x82 ; 130 1cbc2: ff 93 push r31 1cbc4: ef 93 push r30 1cbc6: 0f 94 5d 9f call 0x33eba ; 0x33eba 1cbca: 0f 90 pop r0 1cbcc: 0f 90 pop r0 1cbce: 0f 90 pop r0 1cbd0: 0f 90 pop r0 1cbd2: 0f 90 pop r0 1cbd4: 0f 90 pop r0 1cbd6: d2 cf rjmp .-92 ; 0x1cb7c 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) || 1cbd8: 41 2c mov r4, r1 printf_P(PSTR("lcd_selfcheck_axis %d, %d\n"), _stepresult, _err_endstop); } _stepdone = true; } if (_lcd_refresh < 6) 1cbda: 06 30 cpi r16, 0x06 ; 6 1cbdc: 11 05 cpc r17, r1 1cbde: 0c f0 brlt .+2 ; 0x1cbe2 1cbe0: 4f c0 rjmp .+158 ; 0x1cc80 { _lcd_refresh++; 1cbe2: 0f 5f subi r16, 0xFF ; 255 1cbe4: 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(); 1cbe6: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(true); 1cbea: 81 e0 ldi r24, 0x01 ; 1 1cbec: 0e 94 fe 79 call 0xf3fc ; 0xf3fc (_travel_done <= _travel) ? _travel_done++ : _stepdone = true; 1cbf0: 6c 14 cp r6, r12 1cbf2: 7d 04 cpc r7, r13 1cbf4: 34 f0 brlt .+12 ; 0x1cc02 1cbf6: 8f ef ldi r24, 0xFF ; 255 1cbf8: c8 1a sub r12, r24 1cbfa: d8 0a sbc r13, r24 } while (!_stepdone); 1cbfc: 44 20 and r4, r4 1cbfe: 09 f4 brne .+2 ; 0x1cc02 1cc00: 94 cf rjmp .-216 ; 0x1cb2a if (!_stepresult) 1cc02: 51 10 cpse r5, r1 1cc04: 20 c0 rjmp .+64 ; 0x1cc46 { const char *_error_1; const char *_error_2; if (_axis == X_AXIS) _error_1 = "X"; if (_axis == Y_AXIS) _error_1 = "Y"; 1cc06: 6d ed ldi r22, 0xDD ; 221 1cc08: 72 e0 ldi r23, 0x02 ; 2 1cc0a: 91 e0 ldi r25, 0x01 ; 1 1cc0c: e9 16 cp r14, r25 1cc0e: f1 04 cpc r15, r1 1cc10: 41 f0 breq .+16 ; 0x1cc22 if (_axis == Z_AXIS) _error_1 = "Z"; 1cc12: 6f ed ldi r22, 0xDF ; 223 1cc14: 72 e0 ldi r23, 0x02 ; 2 1cc16: e2 e0 ldi r30, 0x02 ; 2 1cc18: ee 16 cp r14, r30 1cc1a: f1 04 cpc r15, r1 1cc1c: 11 f0 breq .+4 ; 0x1cc22 1cc1e: 6b ed ldi r22, 0xDB ; 219 1cc20: 72 e0 ldi r23, 0x02 ; 2 if (_err_endstop == 0) _error_2 = "X"; if (_err_endstop == 1) _error_2 = "Y"; 1cc22: 4d ed ldi r20, 0xDD ; 221 1cc24: 52 e0 ldi r21, 0x02 ; 2 1cc26: c1 30 cpi r28, 0x01 ; 1 1cc28: d1 05 cpc r29, r1 1cc2a: 31 f0 breq .+12 ; 0x1cc38 if (_err_endstop == 2) _error_2 = "Z"; 1cc2c: 4f ed ldi r20, 0xDF ; 223 1cc2e: 52 e0 ldi r21, 0x02 ; 2 1cc30: 22 97 sbiw r28, 0x02 ; 2 1cc32: 11 f0 breq .+4 ; 0x1cc38 1cc34: 4b ed ldi r20, 0xDB ; 219 1cc36: 52 e0 ldi r21, 0x02 ; 2 if (_travel_done >= _travel) { lcd_selftest_error(TestError::Endstop, _error_1, _error_2); 1cc38: 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) 1cc3a: c6 14 cp r12, r6 1cc3c: d7 04 cpc r13, r7 1cc3e: 0c f4 brge .+2 ; 0x1cc42 { lcd_selftest_error(TestError::Endstop, _error_1, _error_2); } else { lcd_selftest_error(TestError::Motor, _error_1, _error_2); 1cc40: 83 e0 ldi r24, 0x03 ; 3 1cc42: 0e 94 64 e2 call 0x1c4c8 ; 0x1c4c8 } } current_position[_axis] = 0; //simulate axis home to avoid negative numbers for axis position, especially Z. 1cc46: f5 01 movw r30, r10 1cc48: eb 50 subi r30, 0x0B ; 11 1cc4a: fe 4e sbci r31, 0xEE ; 238 1cc4c: 10 82 st Z, r1 1cc4e: 11 82 std Z+1, r1 ; 0x01 1cc50: 12 82 std Z+2, r1 ; 0x02 1cc52: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 1cc54: 0f 94 ef 83 call 0x307de ; 0x307de return _stepresult; } 1cc58: 85 2d mov r24, r5 1cc5a: df 91 pop r29 1cc5c: cf 91 pop r28 1cc5e: 1f 91 pop r17 1cc60: 0f 91 pop r16 1cc62: ff 90 pop r15 1cc64: ef 90 pop r14 1cc66: df 90 pop r13 1cc68: cf 90 pop r12 1cc6a: bf 90 pop r11 1cc6c: af 90 pop r10 1cc6e: 9f 90 pop r9 1cc70: 8f 90 pop r8 1cc72: 7f 90 pop r7 1cc74: 6f 90 pop r6 1cc76: 5f 90 pop r5 1cc78: 4f 90 pop r4 1cc7a: 3f 90 pop r3 1cc7c: 2f 90 pop r2 1cc7e: 08 95 ret { _lcd_refresh++; } else { _progress = lcd_selftest_screen(static_cast(static_cast(TestScreen::AxisX) + _axis), _progress, 3, false, 0); 1cc80: 10 e0 ldi r17, 0x00 ; 0 1cc82: 00 e0 ldi r16, 0x00 ; 0 1cc84: 20 e0 ldi r18, 0x00 ; 0 1cc86: 43 e0 ldi r20, 0x03 ; 3 1cc88: 63 2d mov r22, r3 1cc8a: 82 2d mov r24, r2 1cc8c: 0e 94 35 b9 call 0x1726a ; 0x1726a 1cc90: 38 2e mov r3, r24 1cc92: a9 cf rjmp .-174 ; 0x1cbe6 (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; 1cc94: c1 e0 ldi r28, 0x01 ; 1 1cc96: d0 e0 ldi r29, 0x00 ; 0 1cc98: 71 cf rjmp .-286 ; 0x1cb7c 0001cc9a : return 0; } bool resume_print_checks() { // reset the lcd status so that a newer error will be shown lcd_return_to_status(); 1cc9a: 0e 94 6d fe call 0x1fcda ; 0x1fcda lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1cc9e: 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; 1cca2: 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() 1cca6: 81 11 cpse r24, r1 1cca8: 39 c0 rjmp .+114 ; 0x1cd1c } static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; 1ccaa: 80 91 40 02 lds r24, 0x0240 ; 0x800240 1ccae: 81 11 cpse r24, r1 1ccb0: 02 c0 rjmp .+4 ; 0x1ccb6 #endif ) { return false; // abort if error persists } return true; 1ccb2: 81 e0 ldi r24, 0x01 ; 1 1ccb4: 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; 1ccb6: 8f ef ldi r24, 0xFF ; 255 1ccb8: 80 93 e9 11 sts 0x11E9, r24 ; 0x8011e9 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1ccbc: 80 93 05 05 sts 0x0505, r24 ; 0x800505 #endif manage_heater(); 1ccc0: 0f 94 13 33 call 0x26626 ; 0x26626 { #ifdef FANCHECK if (!fans_check_enabled) return 0; lcd_selftest_setfan(255); setExtruderAutoFanState(3); //force enables the hotend fan 1ccc4: 83 e0 ldi r24, 0x03 ; 3 1ccc6: 0e 94 35 6e call 0xdc6a ; 0xdc6a #ifdef FAN_SOFT_PWM extruder_autofan_last_check = _millis(); 1ccca: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 1ccce: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d 1ccd2: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e 1ccd6: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f 1ccda: 90 93 90 16 sts 0x1690, r25 ; 0x801690 fan_measuring = true; 1ccde: 81 e0 ldi r24, 0x01 ; 1 1cce0: 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) 1cce4: 68 ee ldi r22, 0xE8 ; 232 1cce6: 73 e0 ldi r23, 0x03 ; 3 1cce8: 80 e0 ldi r24, 0x00 ; 0 1ccea: 90 e0 ldi r25, 0x00 ; 0 1ccec: 0f 94 03 0e call 0x21c06 ; 0x21c06 manage_heater(); 1ccf0: 0f 94 13 33 call 0x26626 ; 0x26626 setExtruderAutoFanState(1); //releases lock on the hotend fan 1ccf4: 81 e0 ldi r24, 0x01 ; 1 1ccf6: 0e 94 35 6e call 0xdc6a ; 0xdc6a } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1ccfa: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1ccfe: 10 92 05 05 sts 0x0505, r1 ; 0x800505 #endif manage_heater(); 1cd02: 0f 94 13 33 call 0x26626 ; 0x26626 _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 1cd06: 80 91 85 03 lds r24, 0x0385 ; 0x800385 1cd0a: 90 91 86 03 lds r25, 0x0386 ; 0x800386 1cd0e: 45 97 sbiw r24, 0x15 ; 21 1cd10: 84 f6 brge .-96 ; 0x1ccb2 LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); 1cd12: 62 e0 ldi r22, 0x02 ; 2 1cd14: 87 e6 ldi r24, 0x67 ; 103 1cd16: 97 e6 ldi r25, 0x67 ; 103 1cd18: 0e 94 35 e2 call 0x1c46a ; 0x1c46a if (get_temp_error() #ifdef FANCHECK || fan_error_selftest() #endif ) { return false; // abort if error persists 1cd1c: 80 e0 ldi r24, 0x00 ; 0 } return true; } 1cd1e: 08 95 ret 0001cd20 : //! @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; 1cd20: 0e 94 4d e6 call 0x1cc9a ; 0x1cc9a 1cd24: 88 23 and r24, r24 1cd26: 21 f0 breq .+8 ; 0x1cd30 // resume the usb host SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_RESUME); 1cd28: 8d e8 ldi r24, 0x8D ; 141 1cd2a: 97 e6 ldi r25, 0x67 ; 103 1cd2c: 0c 94 49 72 jmp 0xe492 ; 0xe492 } 1cd30: 08 95 ret 0001cd32 : void lcd_getstatus(char buf[LCD_WIDTH]) { strncpy(buf, lcd_status_message, LCD_WIDTH); } void lcd_setstatuspgm(const char* message) { 1cd32: cf 93 push r28 1cd34: df 93 push r29 1cd36: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1cd38: 80 e0 ldi r24, 0x00 ; 0 1cd3a: 0e 94 1f e2 call 0x1c43e ; 0x1c43e 1cd3e: 88 23 and r24, r24 1cd40: 31 f0 breq .+12 ; 0x1cd4e lcd_updatestatus(message, true); 1cd42: 61 e0 ldi r22, 0x01 ; 1 1cd44: ce 01 movw r24, r28 } 1cd46: df 91 pop r29 1cd48: cf 91 pop r28 } void lcd_setstatuspgm(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); 1cd4a: 0c 94 04 e2 jmp 0x1c408 ; 0x1c408 } 1cd4e: df 91 pop r29 1cd50: cf 91 pop r28 1cd52: 08 95 ret 0001cd54 : } } void lcd_print_stop_finish(); void lcd_commands() 1cd54: 2f 92 push r2 1cd56: 3f 92 push r3 1cd58: 4f 92 push r4 1cd5a: 5f 92 push r5 1cd5c: 6f 92 push r6 1cd5e: 7f 92 push r7 1cd60: 8f 92 push r8 1cd62: 9f 92 push r9 1cd64: af 92 push r10 1cd66: bf 92 push r11 1cd68: cf 92 push r12 1cd6a: df 92 push r13 1cd6c: ef 92 push r14 1cd6e: ff 92 push r15 1cd70: 0f 93 push r16 1cd72: 1f 93 push r17 1cd74: cf 93 push r28 1cd76: 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) 1cd78: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1cd7c: 81 30 cpi r24, 0x01 ; 1 1cd7e: 09 f0 breq .+2 ; 0x1cd82 1cd80: 61 c0 rjmp .+194 ; 0x1ce44 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); 1cd82: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 1cd86: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 { if (!blocks_queued() && !homing_flag) 1cd8a: 98 13 cpse r25, r24 1cd8c: 5b c0 rjmp .+182 ; 0x1ce44 1cd8e: 80 91 05 12 lds r24, 0x1205 ; 0x801205 1cd92: 81 11 cpse r24, r1 1cd94: 57 c0 rjmp .+174 ; 0x1ce44 { custom_message_type = CustomMsg::Status; 1cd96: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 lcd_setstatuspgm(_T(MSG_PRINT_ABORTED)); 1cd9a: 8a ef ldi r24, 0xFA ; 250 1cd9c: 90 e4 ldi r25, 0x40 ; 64 1cd9e: 0e 94 a7 6c call 0xd94e ; 0xd94e 1cda2: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 lcd_commands_type = LcdCommands::Idle; 1cda6: 10 92 c8 0d sts 0x0DC8, r1 ; 0x800dc8 1cdaa: 82 e0 ldi r24, 0x02 ; 2 1cdac: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.367> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 1cdb0: 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(); 1cdb4: 0f 94 06 21 call 0x2420c ; 0x2420c save_statistics(); 1cdb8: 0e 94 2e 5f call 0xbe5c ; 0xbe5c // lift Z raise_z(10); 1cdbc: 60 e0 ldi r22, 0x00 ; 0 1cdbe: 70 e0 ldi r23, 0x00 ; 0 1cdc0: 80 e2 ldi r24, 0x20 ; 32 1cdc2: 91 e4 ldi r25, 0x41 ; 65 1cdc4: 0e 94 d3 66 call 0xcda6 ; 0xcda6 // if axis are homed, move to parking position. if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 1cdc8: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 1cdcc: 88 23 and r24, r24 1cdce: 21 f1 breq .+72 ; 0x1ce18 1cdd0: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 1cdd4: 88 23 and r24, r24 1cdd6: 01 f1 breq .+64 ; 0x1ce18 current_position[X_AXIS] = X_CANCEL_POS; 1cdd8: 80 e0 ldi r24, 0x00 ; 0 1cdda: 90 e0 ldi r25, 0x00 ; 0 1cddc: a8 e4 ldi r26, 0x48 ; 72 1cdde: b2 e4 ldi r27, 0x42 ; 66 1cde0: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 1cde4: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 1cde8: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 1cdec: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = Y_CANCEL_POS; 1cdf0: 80 e0 ldi r24, 0x00 ; 0 1cdf2: 90 e0 ldi r25, 0x00 ; 0 1cdf4: ae e3 ldi r26, 0x3E ; 62 1cdf6: b3 e4 ldi r27, 0x43 ; 67 1cdf8: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 1cdfc: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 1ce00: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 1ce04: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1ce08: 60 e0 ldi r22, 0x00 ; 0 1ce0a: 70 e0 ldi r23, 0x00 ; 0 1ce0c: 84 e3 ldi r24, 0x34 ; 52 1ce0e: 92 e4 ldi r25, 0x42 ; 66 1ce10: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 1ce14: 0f 94 ce 22 call 0x2459c ; 0x2459c 1ce18: 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()) { 1ce1c: 88 23 and r24, r24 1ce1e: 09 f4 brne .+2 ; 0x1ce22 1ce20: c8 c0 rjmp .+400 ; 0x1cfb2 // time to stop the error beep WRITE(BEEPER, LOW); 1ce22: 9f b7 in r25, 0x3f ; 63 1ce24: f8 94 cli 1ce26: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1ce2a: 8b 7f andi r24, 0xFB ; 251 1ce2c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1ce30: 9f bf out 0x3f, r25 ; 63 MMU2::mmu2.unload(); // M702 } } } lcd_cooldown(); //turns off heaters and fan; goes to status screen. 1ce32: 0f 94 fc 12 call 0x225f8 ; 0x225f8 finishAndDisableSteppers(); //M84 1ce36: 0e 94 2f 74 call 0xe85e ; 0xe85e axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative 1ce3a: 88 e0 ldi r24, 0x08 ; 8 1ce3c: 80 93 eb 11 sts 0x11EB, r24 ; 0x8011eb did_pause_print = false; // Clear pause state in case the print was aborted while paused 1ce40: 10 92 9b 03 sts 0x039B, r1 ; 0x80039b lcd_commands_step = 0; lcd_print_stop_finish(); } } if (lcd_commands_type == LcdCommands::LongPause) 1ce44: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1ce48: 82 30 cpi r24, 0x02 ; 2 1ce4a: 09 f0 breq .+2 ; 0x1ce4e 1ce4c: 6a c0 rjmp .+212 ; 0x1cf22 1ce4e: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 1ce52: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 { if (!blocks_queued() && !homing_flag) 1ce56: 98 13 cpse r25, r24 1ce58: 64 c0 rjmp .+200 ; 0x1cf22 1ce5a: 80 91 05 12 lds r24, 0x1205 ; 0x801205 1ce5e: 81 11 cpse r24, r1 1ce60: 60 c0 rjmp .+192 ; 0x1cf22 { if (custom_message_type != CustomMsg::M117) 1ce62: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 1ce66: 87 30 cpi r24, 0x07 ; 7 1ce68: 41 f0 breq .+16 ; 0x1ce7a { custom_message_type = CustomMsg::Status; 1ce6a: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 1ce6e: 8b ee ldi r24, 0xEB ; 235 1ce70: 90 e4 ldi r25, 0x40 ; 64 1ce72: 0e 94 a7 6c call 0xd94e ; 0xd94e 1ce76: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 } lcd_commands_type = LcdCommands::Idle; 1ce7a: 10 92 c8 0d sts 0x0DC8, r1 ; 0x800dc8 1ce7e: 82 e0 ldi r24, 0x02 ; 2 1ce80: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.367> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 1ce84: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 } #endif //PINDA_THERMISTOR void long_pause() //long pause print { st_synchronize(); 1ce88: 0f 94 ce 22 call 0x2459c ; 0x2459c // Stop heaters heating_status = HeatingStatus::NO_HEATING; 1ce8c: 10 92 99 03 sts 0x0399, r1 ; 0x800399 1ce90: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 1ce94: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 setTargetHotend(0); // Lift z raise_z(pause_position[Z_AXIS]); 1ce98: 60 91 4a 02 lds r22, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.495+0x8> 1ce9c: 70 91 4b 02 lds r23, 0x024B ; 0x80024b <_ZL14pause_position.lto_priv.495+0x9> 1cea0: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL14pause_position.lto_priv.495+0xa> 1cea4: 90 91 4d 02 lds r25, 0x024D ; 0x80024d <_ZL14pause_position.lto_priv.495+0xb> 1cea8: 0e 94 d3 66 call 0xcda6 ; 0xcda6 // Move XY to side if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 1ceac: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 1ceb0: 88 23 and r24, r24 1ceb2: 51 f1 breq .+84 ; 0x1cf08 1ceb4: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 1ceb8: 88 23 and r24, r24 1ceba: 31 f1 breq .+76 ; 0x1cf08 current_position[X_AXIS] = pause_position[X_AXIS]; 1cebc: 80 91 42 02 lds r24, 0x0242 ; 0x800242 <_ZL14pause_position.lto_priv.495> 1cec0: 90 91 43 02 lds r25, 0x0243 ; 0x800243 <_ZL14pause_position.lto_priv.495+0x1> 1cec4: a0 91 44 02 lds r26, 0x0244 ; 0x800244 <_ZL14pause_position.lto_priv.495+0x2> 1cec8: b0 91 45 02 lds r27, 0x0245 ; 0x800245 <_ZL14pause_position.lto_priv.495+0x3> 1cecc: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 1ced0: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 1ced4: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 1ced8: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = pause_position[Y_AXIS]; 1cedc: 80 91 46 02 lds r24, 0x0246 ; 0x800246 <_ZL14pause_position.lto_priv.495+0x4> 1cee0: 90 91 47 02 lds r25, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.495+0x5> 1cee4: a0 91 48 02 lds r26, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.495+0x6> 1cee8: b0 91 49 02 lds r27, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.495+0x7> 1ceec: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 1cef0: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 1cef4: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 1cef8: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc plan_buffer_line_curposXYZE(50); 1cefc: 60 e0 ldi r22, 0x00 ; 0 1cefe: 70 e0 ldi r23, 0x00 ; 0 1cf00: 88 e4 ldi r24, 0x48 ; 72 1cf02: 92 e4 ldi r25, 0x42 ; 66 1cf04: 0f 94 2f 85 call 0x30a5e ; 0x30a5e 1cf08: 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()) { 1cf0c: 88 23 and r24, r24 1cf0e: 09 f4 brne .+2 ; 0x1cf12 1cf10: 7a c0 rjmp .+244 ; 0x1d006 // time to stop the error beep WRITE(BEEPER, LOW); 1cf12: 9f b7 in r25, 0x3f ; 63 1cf14: f8 94 cli 1cf16: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1cf1a: 8b 7f andi r24, 0xFB ; 251 1cf1c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1cf20: 9f bf out 0x3f, r25 ; 63 long_pause(); } } if (lcd_commands_type == LcdCommands::Layer1Cal) 1cf22: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1cf26: 84 30 cpi r24, 0x04 ; 4 1cf28: 09 f0 breq .+2 ; 0x1cf2c 1cf2a: a7 c0 rjmp .+334 ; 0x1d07a { const uint16_t nozzle_dia = eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM); 1cf2c: 85 ea ldi r24, 0xA5 ; 165 1cf2e: 9d e0 ldi r25, 0x0D ; 13 1cf30: 0f 94 a9 a0 call 0x34152 ; 0x34152 1cf34: 30 91 a8 0d lds r19, 0x0DA8 ; 0x800da8 1cf38: 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) 1cf3c: 32 13 cpse r19, r18 1cf3e: 74 c1 rjmp .+744 ; 0x1d228 1cf40: 20 91 cf 11 lds r18, 0x11CF ; 0x8011cf 1cf44: 30 91 d0 11 lds r19, 0x11D0 ; 0x8011d0 1cf48: 23 2b or r18, r19 1cf4a: 09 f0 breq .+2 ; 0x1cf4e 1cf4c: 6d c1 rjmp .+730 ; 0x1d228 1cf4e: c0 91 e7 11 lds r28, 0x11E7 ; 0x8011e7 1cf52: c1 11 cpse r28, r1 1cf54: 69 c1 rjmp .+722 ; 0x1d228 { if (lcd_commands_step == 0) 1cf56: 20 91 b0 03 lds r18, 0x03B0 ; 0x8003b0 1cf5a: 21 11 cpse r18, r1 1cf5c: 57 c0 rjmp .+174 ; 0x1d00c lcd_commands_step = 12; 1cf5e: 2c e0 ldi r18, 0x0C ; 12 else lcd_commands_step--; 1cf60: 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; 1cf64: 44 96 adiw r24, 0x14 ; 20 1cf66: bc 01 movw r22, r24 1cf68: 90 e0 ldi r25, 0x00 ; 0 1cf6a: 80 e0 ldi r24, 0x00 ; 0 1cf6c: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 1cf70: 20 e0 ldi r18, 0x00 ; 0 1cf72: 30 e0 ldi r19, 0x00 ; 0 1cf74: 4a e7 ldi r20, 0x7A ; 122 1cf76: 54 e4 ldi r21, 0x44 ; 68 1cf78: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1cf7c: 4b 01 movw r8, r22 1cf7e: 5c 01 movw r10, r24 if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; switch(lcd_commands_step) 1cf80: e0 91 b0 03 lds r30, 0x03B0 ; 0x8003b0 1cf84: e1 50 subi r30, 0x01 ; 1 1cf86: ec 30 cpi r30, 0x0C ; 12 1cf88: 08 f0 brcs .+2 ; 0x1cf8c 1cf8a: 77 c0 rjmp .+238 ; 0x1d07a 1cf8c: f0 e0 ldi r31, 0x00 ; 0 1cf8e: 88 27 eor r24, r24 1cf90: e3 53 subi r30, 0x33 ; 51 1cf92: f8 41 sbci r31, 0x18 ; 24 1cf94: 8f 4f sbci r24, 0xFF ; 255 1cf96: 0d 94 ab a1 jmp 0x34356 ; 0x34356 <__tablejump2__> 1cf9a: 0f eb ldi r16, 0xBF ; 191 1cf9c: 0b eb ldi r16, 0xBB ; 187 1cf9e: a1 ea ldi r26, 0xA1 ; 161 1cfa0: a1 ea ldi r26, 0xA1 ; 161 1cfa2: a1 ea ldi r26, 0xA1 ; 161 1cfa4: a1 ea ldi r26, 0xA1 ; 161 1cfa6: 4a ea ldi r20, 0xAA ; 170 1cfa8: b9 e9 ldi r27, 0x99 ; 153 1cfaa: b5 e9 ldi r27, 0x95 ; 149 1cfac: 48 e9 ldi r20, 0x98 ; 152 1cfae: 0e e8 ldi r16, 0x8E ; 142 1cfb0: 08 e8 ldi r16, 0x88 ; 136 if(get_temp_error()) { // time to stop the error beep WRITE(BEEPER, LOW); } else { // Turn off the print fan fanSpeed = 0; 1cfb2: 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(); 1cfb6: 0e 94 28 6e call 0xdc50 ; 0xdc50 setExtruderAutoFanState(1); 1cfba: 81 e0 ldi r24, 0x01 ; 1 1cfbc: 0e 94 35 6e call 0xdc6a ; 0xdc6a // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1cfc0: 80 91 94 12 lds r24, 0x1294 ; 0x801294 1cfc4: 81 30 cpi r24, 0x01 ; 1 1cfc6: 09 f0 breq .+2 ; 0x1cfca 1cfc8: 34 cf rjmp .-408 ; 0x1ce32 fanSpeed = 0; // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() 1cfca: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 1cfce: 88 23 and r24, r24 1cfd0: 09 f4 brne .+2 ; 0x1cfd4 1cfd2: 2f cf rjmp .-418 ; 0x1ce32 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1cfd4: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 1cfd8: 82 30 cpi r24, 0x02 ; 2 1cfda: 09 f4 brne .+2 ; 0x1cfde 1cfdc: 2a cf rjmp .-428 ; 0x1ce32 #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()) 1cfde: 0e 94 b3 60 call 0xc166 ; 0xc166 1cfe2: 81 11 cpse r24, r1 { // Restore temperature saved in ram after pausing print restore_extruder_temperature_from_ram(); 1cfe4: 0e 94 a1 5e call 0xbd42 ; 0xbd42 } // 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) { 1cfe8: 20 91 f1 11 lds r18, 0x11F1 ; 0x8011f1 1cfec: 30 91 f2 11 lds r19, 0x11F2 ; 0x8011f2 1cff0: 80 91 57 02 lds r24, 0x0257 ; 0x800257 1cff4: 90 91 58 02 lds r25, 0x0258 ; 0x800258 1cff8: 28 17 cp r18, r24 1cffa: 39 07 cpc r19, r25 1cffc: 0c f4 brge .+2 ; 0x1d000 1cffe: 19 cf rjmp .-462 ; 0x1ce32 MMU2::mmu2.unload(); // M702 1d000: 0f 94 52 6b call 0x2d6a4 ; 0x2d6a4 1d004: 16 cf rjmp .-468 ; 0x1ce32 } else { // Turn off the print fan fanSpeed = 0; 1d006: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 1d00a: 8b cf rjmp .-234 ; 0x1cf22 if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) { if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; 1d00c: 21 50 subi r18, 0x01 ; 1 1d00e: a8 cf rjmp .-176 ; 0x1cf60 preheat_cmd_3, preheat_cmd_4, zero_extrusion }; lay1cal_common_enqueue_loop(preheat_cmd, sizeof(preheat_cmd)/sizeof(preheat_cmd[0])); 1d010: 65 e0 ldi r22, 0x05 ; 5 1d012: 86 eb ldi r24, 0xB6 ; 182 1d014: 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]))); 1d016: 0e 94 2b 7d call 0xfa56 ; 0xfa56 1d01a: 2f c0 rjmp .+94 ; 0x1d07a //! @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()) 1d01c: 80 91 94 12 lds r24, 0x1294 ; 0x801294 1d020: 81 30 cpi r24, 0x01 ; 1 1d022: 49 f5 brne .+82 ; 0x1d076 { case 12: lay1cal_wait_preheat(); break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); 1d024: d0 91 af 03 lds r29, 0x03AF ; 0x8003af <_ZL16lay1cal_filament.lto_priv.409> { enquecommand_P(MSG_M83); 1d028: 61 e0 ldi r22, 0x01 ; 1 1d02a: 85 e3 ldi r24, 0x35 ; 53 1d02c: 9c e6 ldi r25, 0x6C ; 108 1d02e: 0e 94 ac 7c call 0xf958 ; 0xf958 enquecommand_P(PSTR("G1Y-3F1000")); 1d032: 61 e0 ldi r22, 0x01 ; 1 1d034: 8b ea ldi r24, 0xAB ; 171 1d036: 93 e8 ldi r25, 0x83 ; 131 1d038: 0e 94 ac 7c call 0xf958 ; 0xf958 enquecommand_P(PSTR("G1Z0.4")); 1d03c: 61 e0 ldi r22, 0x01 ; 1 1d03e: 84 ea ldi r24, 0xA4 ; 164 1d040: 93 e8 ldi r25, 0x83 ; 131 1d042: 0e 94 ac 7c call 0xf958 ; 0xf958 uint8_t currentTool = MMU2::mmu2.get_current_tool(); 1d046: 0f 94 4a 42 call 0x28494 ; 0x28494 if(currentTool == filament ){ 1d04a: d8 17 cp r29, r24 1d04c: a1 f0 breq .+40 ; 0x1d076 // already have the correct tool loaded - do nothing return false; } else if( currentTool != (uint8_t)MMU2::FILAMENT_UNKNOWN){ 1d04e: 8f 3f cpi r24, 0xFF ; 255 1d050: 29 f0 breq .+10 ; 0x1d05c // some other slot is loaded, perform an unload first enquecommand_P(MSG_M702); 1d052: 61 e0 ldi r22, 0x01 ; 1 1d054: 8d e0 ldi r24, 0x0D ; 13 1d056: 98 e6 ldi r25, 0x68 ; 104 1d058: 0e 94 ac 7c call 0xf958 ; 0xf958 } // perform a toolchange enquecommandf_P(PSTR("T%d"), filament); 1d05c: 1f 92 push r1 1d05e: df 93 push r29 1d060: 80 ea ldi r24, 0xA0 ; 160 1d062: 93 e8 ldi r25, 0x83 ; 131 1d064: 9f 93 push r25 1d066: 8f 93 push r24 1d068: 0e 94 4a 7d call 0xfa94 ; 0xfa94 1d06c: 0f 90 pop r0 1d06e: 0f 90 pop r0 1d070: 0f 90 pop r0 1d072: 0f 90 pop r0 return true; 1d074: c1 e0 ldi r28, 0x01 ; 1 1d076: c0 93 ae 03 sts 0x03AE, r28 ; 0x8003ae break; } } } if (lcd_commands_type == LcdCommands::PidExtruder) { 1d07a: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1d07e: 83 30 cpi r24, 0x03 ; 3 1d080: 09 f0 breq .+2 ; 0x1d084 1d082: d2 c0 rjmp .+420 ; 0x1d228 if (lcd_commands_step == 0) { 1d084: 90 91 b0 03 lds r25, 0x03B0 ; 0x8003b0 1d088: 91 11 cpse r25, r1 1d08a: 09 c0 rjmp .+18 ; 0x1d09e custom_message_type = CustomMsg::PidCal; 1d08c: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 custom_message_state = 1; 1d090: 91 e0 ldi r25, 0x01 ; 1 1d092: 90 93 ac 03 sts 0x03AC, r25 ; 0x8003ac lcd_draw_update = 3; 1d096: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b lcd_commands_step = 3; 1d09a: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 } if (lcd_commands_step == 3 && !blocks_queued()) { //PID calibration 1d09e: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 1d0a2: 83 30 cpi r24, 0x03 ; 3 1d0a4: 19 f5 brne .+70 ; 0x1d0ec 1d0a6: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 1d0aa: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 1d0ae: 98 13 cpse r25, r24 1d0b0: 1d c0 rjmp .+58 ; 0x1d0ec return !pid_tuning_finished; } void preparePidTuning() { // ensure heaters are disabled before we switch off PID management! disable_heater(); 1d0b2: 0f 94 e7 12 call 0x225ce ; 0x225ce pid_tuning_finished = false; 1d0b6: 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); 1d0ba: 80 91 4f 02 lds r24, 0x024F ; 0x80024f <_ZL8pid_temp.lto_priv.411+0x1> 1d0be: 8f 93 push r24 1d0c0: 80 91 4e 02 lds r24, 0x024E ; 0x80024e <_ZL8pid_temp.lto_priv.411> 1d0c4: 8f 93 push r24 1d0c6: 8b e2 ldi r24, 0x2B ; 43 1d0c8: 94 e8 ldi r25, 0x84 ; 132 1d0ca: 9f 93 push r25 1d0cc: 8f 93 push r24 1d0ce: 0e 94 4a 7d call 0xfa94 ; 0xfa94 lcd_setstatuspgm(_T(MSG_PID_RUNNING)); 1d0d2: 80 ee ldi r24, 0xE0 ; 224 1d0d4: 90 e4 ldi r25, 0x40 ; 64 1d0d6: 0e 94 a7 6c call 0xd94e ; 0xd94e 1d0da: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 lcd_commands_step = 2; 1d0de: 82 e0 ldi r24, 0x02 ; 2 1d0e0: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 1d0e4: 0f 90 pop r0 1d0e6: 0f 90 pop r0 1d0e8: 0f 90 pop r0 1d0ea: 0f 90 pop r0 } if (lcd_commands_step == 2 && !pidTuningRunning()) { //saving to eeprom 1d0ec: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 1d0f0: 82 30 cpi r24, 0x02 ; 2 1d0f2: 09 f0 breq .+2 ; 0x1d0f6 1d0f4: 7a c0 rjmp .+244 ; 0x1d1ea 1d0f6: 80 91 41 02 lds r24, 0x0241 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.423> 1d0fa: 88 23 and r24, r24 1d0fc: 09 f4 brne .+2 ; 0x1d100 1d0fe: 75 c0 rjmp .+234 ; 0x1d1ea custom_message_state = 0; 1d100: 10 92 ac 03 sts 0x03AC, r1 ; 0x8003ac lcd_setstatuspgm(_T(MSG_PID_FINISHED)); 1d104: 8c ec ldi r24, 0xCC ; 204 1d106: 90 e4 ldi r25, 0x40 ; 64 1d108: 0e 94 a7 6c call 0xd94e ; 0xd94e 1d10c: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 1d110: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 1d114: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 setTargetHotend(0); if (_Kp != 0 || _Ki != 0 || _Kd != 0) { 1d118: c0 91 a8 03 lds r28, 0x03A8 ; 0x8003a8 <_Kp> 1d11c: d0 91 a9 03 lds r29, 0x03A9 ; 0x8003a9 <_Kp+0x1> 1d120: 10 91 aa 03 lds r17, 0x03AA ; 0x8003aa <_Kp+0x2> 1d124: 00 91 ab 03 lds r16, 0x03AB ; 0x8003ab <_Kp+0x3> 1d128: 20 e0 ldi r18, 0x00 ; 0 1d12a: 30 e0 ldi r19, 0x00 ; 0 1d12c: a9 01 movw r20, r18 1d12e: f8 01 movw r30, r16 1d130: 6c 2f mov r22, r28 1d132: 7d 2f mov r23, r29 1d134: 8f 2f mov r24, r31 1d136: 9e 2f mov r25, r30 1d138: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1d13c: 81 11 cpse r24, r1 1d13e: 1f c0 rjmp .+62 ; 0x1d17e 1d140: 20 e0 ldi r18, 0x00 ; 0 1d142: 30 e0 ldi r19, 0x00 ; 0 1d144: a9 01 movw r20, r18 1d146: 60 91 a4 03 lds r22, 0x03A4 ; 0x8003a4 <_Ki> 1d14a: 70 91 a5 03 lds r23, 0x03A5 ; 0x8003a5 <_Ki+0x1> 1d14e: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 <_Ki+0x2> 1d152: 90 91 a7 03 lds r25, 0x03A7 ; 0x8003a7 <_Ki+0x3> 1d156: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1d15a: 81 11 cpse r24, r1 1d15c: 10 c0 rjmp .+32 ; 0x1d17e 1d15e: 20 e0 ldi r18, 0x00 ; 0 1d160: 30 e0 ldi r19, 0x00 ; 0 1d162: a9 01 movw r20, r18 1d164: 60 91 a0 03 lds r22, 0x03A0 ; 0x8003a0 <_Kd> 1d168: 70 91 a1 03 lds r23, 0x03A1 ; 0x8003a1 <_Kd+0x1> 1d16c: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 <_Kd+0x2> 1d170: 90 91 a3 03 lds r25, 0x03A3 ; 0x8003a3 <_Kd+0x3> 1d174: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1d178: 88 23 and r24, r24 1d17a: 09 f4 brne .+2 ; 0x1d17e 1d17c: 66 c2 rjmp .+1228 ; 0x1d64a enquecommandf_P(PSTR("M301 P%.2f I%.2f D%.2f"), _Kp, _Ki, _Kd); 1d17e: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 <_Kd+0x3> 1d182: 8f 93 push r24 1d184: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 <_Kd+0x2> 1d188: 8f 93 push r24 1d18a: 80 91 a1 03 lds r24, 0x03A1 ; 0x8003a1 <_Kd+0x1> 1d18e: 8f 93 push r24 1d190: 80 91 a0 03 lds r24, 0x03A0 ; 0x8003a0 <_Kd> 1d194: 8f 93 push r24 1d196: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 <_Ki+0x3> 1d19a: 8f 93 push r24 1d19c: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 <_Ki+0x2> 1d1a0: 8f 93 push r24 1d1a2: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 <_Ki+0x1> 1d1a6: 8f 93 push r24 1d1a8: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 <_Ki> 1d1ac: 8f 93 push r24 1d1ae: 0f 93 push r16 1d1b0: 1f 93 push r17 1d1b2: df 93 push r29 1d1b4: cf 93 push r28 1d1b6: 84 e1 ldi r24, 0x14 ; 20 1d1b8: 94 e8 ldi r25, 0x84 ; 132 1d1ba: 9f 93 push r25 1d1bc: 8f 93 push r24 1d1be: 0e 94 4a 7d call 0xfa94 ; 0xfa94 enquecommand_P(MSG_M500); 1d1c2: 61 e0 ldi r22, 0x01 ; 1 1d1c4: 88 e1 ldi r24, 0x18 ; 24 1d1c6: 98 e6 ldi r25, 0x68 ; 104 1d1c8: 0e 94 ac 7c call 0xf958 ; 0xf958 1d1cc: 8d b7 in r24, 0x3d ; 61 1d1ce: 9e b7 in r25, 0x3e ; 62 1d1d0: 0e 96 adiw r24, 0x0e ; 14 1d1d2: 0f b6 in r0, 0x3f ; 63 1d1d4: f8 94 cli 1d1d6: 9e bf out 0x3e, r25 ; 62 1d1d8: 0f be out 0x3f, r0 ; 63 1d1da: 8d bf out 0x3d, r24 ; 61 } else { SERIAL_ECHOPGM("Invalid PID cal. results. Not stored to EEPROM."); } display_time.start(); 1d1dc: 8d e9 ldi r24, 0x9D ; 157 1d1de: 93 e0 ldi r25, 0x03 ; 3 1d1e0: 0f 94 5e 10 call 0x220bc ; 0x220bc ::start()> lcd_commands_step = 1; 1d1e4: 81 e0 ldi r24, 0x01 ; 1 1d1e6: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 } if ((lcd_commands_step == 1) && display_time.expired(2000)) { //calibration finished message 1d1ea: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 1d1ee: 81 30 cpi r24, 0x01 ; 1 1d1f0: d9 f4 brne .+54 ; 0x1d228 1d1f2: 60 ed ldi r22, 0xD0 ; 208 1d1f4: 77 e0 ldi r23, 0x07 ; 7 1d1f6: 8d e9 ldi r24, 0x9D ; 157 1d1f8: 93 e0 ldi r25, 0x03 ; 3 1d1fa: 0f 94 2f 10 call 0x2205e ; 0x2205e ::expired(unsigned short)> 1d1fe: 88 23 and r24, r24 1d200: 99 f0 breq .+38 ; 0x1d228 lcd_setstatuspgm(MSG_WELCOME); 1d202: 87 e6 ldi r24, 0x67 ; 103 1d204: 9b e6 ldi r25, 0x6B ; 107 1d206: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 custom_message_type = CustomMsg::Status; 1d20a: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 pid_temp = DEFAULT_PID_TEMP; 1d20e: 82 ed ldi r24, 0xD2 ; 210 1d210: 90 e0 ldi r25, 0x00 ; 0 1d212: 90 93 4f 02 sts 0x024F, r25 ; 0x80024f <_ZL8pid_temp.lto_priv.411+0x1> 1d216: 80 93 4e 02 sts 0x024E, r24 ; 0x80024e <_ZL8pid_temp.lto_priv.411> lcd_commands_step = 0; 1d21a: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 lcd_commands_type = LcdCommands::Idle; 1d21e: 10 92 c8 0d sts 0x0DC8, r1 ; 0x800dc8 1d222: 82 e0 ldi r24, 0x02 ; 2 1d224: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.367> break; } } #endif //THERMAL_MODEL if (lcd_commands_type == LcdCommands::NozzleCNG) 1d228: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1d22c: 85 30 cpi r24, 0x05 ; 5 1d22e: e9 f4 brne .+58 ; 0x1d26a 1d230: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 1d234: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 { if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 1d238: 98 13 cpse r25, r24 1d23a: 17 c0 rjmp .+46 ; 0x1d26a 1d23c: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 1d240: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 1d244: 89 2b or r24, r25 1d246: 89 f4 brne .+34 ; 0x1d26a 1d248: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 1d24c: 81 11 cpse r24, r1 1d24e: 0d c0 rjmp .+26 ; 0x1d26a #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) 1d250: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 1d254: 81 30 cpi r24, 0x01 ; 1 1d256: 09 f4 brne .+2 ; 0x1d25a 1d258: 2d c2 rjmp .+1114 ; 0x1d6b4 1d25a: 08 f4 brcc .+2 ; 0x1d25e 1d25c: fb c1 rjmp .+1014 ; 0x1d654 1d25e: 82 30 cpi r24, 0x02 ; 2 1d260: 09 f4 brne .+2 ; 0x1d264 1d262: 13 c2 rjmp .+1062 ; 0x1d68a 1d264: 83 30 cpi r24, 0x03 ; 3 1d266: 09 f4 brne .+2 ; 0x1d26a 1d268: f9 c1 rjmp .+1010 ; 0x1d65c menu_depth = 3; break; } } } } 1d26a: df 91 pop r29 1d26c: cf 91 pop r28 1d26e: 1f 91 pop r17 1d270: 0f 91 pop r16 1d272: ff 90 pop r15 1d274: ef 90 pop r14 1d276: df 90 pop r13 1d278: cf 90 pop r12 1d27a: bf 90 pop r11 1d27c: af 90 pop r10 1d27e: 9f 90 pop r9 1d280: 8f 90 pop r8 1d282: 7f 90 pop r7 1d284: 6f 90 pop r6 1d286: 5f 90 pop r5 1d288: 4f 90 pop r4 1d28a: 3f 90 pop r3 1d28c: 2f 90 pop r2 1d28e: 08 95 ret break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); break; case 10: lcd_clear(); 1d290: 0e 94 a4 69 call 0xd348 ; 0xd348 menu_depth = 0; 1d294: 10 92 ad 03 sts 0x03AD, r1 ; 0x8003ad menu_submenu(lcd_babystep_z, true); 1d298: 61 e0 ldi r22, 0x01 ; 1 1d29a: 8d ed ldi r24, 0xDD ; 221 1d29c: 97 e3 ldi r25, 0x37 ; 55 1d29e: 0f 94 e8 94 call 0x329d0 ; 0x329d0 cmd_intro_mmu_9, cmd_intro_mmu_10, cmd_intro_mmu_11, }; if (MMU2::mmu2.Enabled()) 1d2a2: 80 91 94 12 lds r24, 0x1294 ; 0x801294 1d2a6: 81 30 cpi r24, 0x01 ; 1 1d2a8: b9 f4 brne .+46 ; 0x1d2d8 { for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(cmd_intro_mmu)/sizeof(cmd_intro_mmu[0])); ++i) 1d2aa: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 1d2ae: 10 e0 ldi r17, 0x00 ; 0 1d2b0: 81 11 cpse r24, r1 1d2b2: 01 c0 rjmp .+2 ; 0x1d2b6 1d2b4: 12 e0 ldi r17, 0x02 ; 2 1d2b6: c1 2f mov r28, r17 1d2b8: d0 e0 ldi r29, 0x00 ; 0 1d2ba: cc 0f add r28, r28 1d2bc: dd 1f adc r29, r29 1d2be: c2 57 subi r28, 0x72 ; 114 1d2c0: dc 47 sbci r29, 0x7C ; 124 { enquecommand_P(static_cast(pgm_read_ptr(&cmd_intro_mmu[i]))); 1d2c2: fe 01 movw r30, r28 1d2c4: 85 91 lpm r24, Z+ 1d2c6: 94 91 lpm r25, Z 1d2c8: 61 e0 ldi r22, 0x01 ; 1 1d2ca: 0e 94 ac 7c call 0xf958 ; 0xf958 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) 1d2ce: 1f 5f subi r17, 0xFF ; 255 1d2d0: 22 96 adiw r28, 0x02 ; 2 1d2d2: 19 30 cpi r17, 0x09 ; 9 1d2d4: b1 f7 brne .-20 ; 0x1d2c2 1d2d6: d1 ce rjmp .-606 ; 0x1d07a enquecommand_P(static_cast(pgm_read_ptr(&cmd_intro_mmu[i]))); } } else { enquecommand_P(feedrate_F1080); //fixed velocity for the intro line 1d2d8: 61 e0 ldi r22, 0x01 ; 1 1d2da: 86 e8 ldi r24, 0x86 ; 134 1d2dc: 93 e8 ldi r25, 0x83 ; 131 1d2de: 0e 94 ac 7c call 0xf958 ; 0xf958 enquecommandf_P(extrude_fmt_X, 60.f, count_e(layer_height, extrusion_width * 4.f, 60)); 1d2e2: 20 e0 ldi r18, 0x00 ; 0 1d2e4: 30 e0 ldi r19, 0x00 ; 0 1d2e6: 40 e8 ldi r20, 0x80 ; 128 1d2e8: 50 e4 ldi r21, 0x40 ; 64 1d2ea: c5 01 movw r24, r10 1d2ec: b4 01 movw r22, r8 1d2ee: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1d2f2: 20 e0 ldi r18, 0x00 ; 0 1d2f4: 30 e0 ldi r19, 0x00 ; 0 1d2f6: 40 e7 ldi r20, 0x70 ; 112 1d2f8: 52 e4 ldi r21, 0x42 ; 66 1d2fa: 0f 94 0b 54 call 0x2a816 ; 0x2a816 1d2fe: 9f 93 push r25 1d300: 8f 93 push r24 1d302: 7f 93 push r23 1d304: 6f 93 push r22 1d306: 82 e4 ldi r24, 0x42 ; 66 1d308: 8f 93 push r24 1d30a: 80 e7 ldi r24, 0x70 ; 112 1d30c: 8f 93 push r24 1d30e: 1f 92 push r1 1d310: 1f 92 push r1 1d312: c9 e7 ldi r28, 0x79 ; 121 1d314: d3 e8 ldi r29, 0x83 ; 131 1d316: df 93 push r29 1d318: cf 93 push r28 1d31a: 0e 94 4a 7d call 0xfa94 ; 0xfa94 enquecommandf_P(extrude_fmt_X, 202.5f, count_e(layer_height, extrusion_width * 8.f, 142.5)); 1d31e: 20 e0 ldi r18, 0x00 ; 0 1d320: 30 e0 ldi r19, 0x00 ; 0 1d322: 40 e0 ldi r20, 0x00 ; 0 1d324: 51 e4 ldi r21, 0x41 ; 65 1d326: c5 01 movw r24, r10 1d328: b4 01 movw r22, r8 1d32a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1d32e: 20 e0 ldi r18, 0x00 ; 0 1d330: 30 e8 ldi r19, 0x80 ; 128 1d332: 4e e0 ldi r20, 0x0E ; 14 1d334: 53 e4 ldi r21, 0x43 ; 67 1d336: 0f 94 0b 54 call 0x2a816 ; 0x2a816 1d33a: 9f 93 push r25 1d33c: 8f 93 push r24 1d33e: 7f 93 push r23 1d340: 6f 93 push r22 1d342: 83 e4 ldi r24, 0x43 ; 67 1d344: 8f 93 push r24 1d346: 8a e4 ldi r24, 0x4A ; 74 1d348: 8f 93 push r24 1d34a: 80 e8 ldi r24, 0x80 ; 128 1d34c: 8f 93 push r24 1d34e: 1f 92 push r1 1d350: df 93 push r29 1d352: cf 93 push r28 1d354: 0e 94 4a 7d call 0xfa94 ; 0xfa94 1d358: 8d b7 in r24, 0x3d ; 61 1d35a: 9e b7 in r25, 0x3e ; 62 1d35c: 44 96 adiw r24, 0x14 ; 20 1d35e: 0f b6 in r0, 0x3f ; 63 1d360: f8 94 cli 1d362: 9e bf out 0x3e, r25 ; 62 1d364: 0f be out 0x3f, r0 ; 63 1d366: 8d bf out 0x3d, r24 ; 61 1d368: 88 ce rjmp .-752 ; 0x1d07a 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]))); 1d36a: 66 e0 ldi r22, 0x06 ; 6 1d36c: 8d e6 ldi r24, 0x6D ; 109 1d36e: 93 e8 ldi r25, 0x83 ; 131 1d370: 52 ce rjmp .-860 ; 0x1d016 //! @brief Print meander start void lay1cal_meander_start(float layer_height, float extrusion_width) { #ifndef NEW_FIRST_LAYER_CAL enquecommand_P(PSTR("G1X50Y155")); 1d372: 61 e0 ldi r22, 0x01 ; 1 1d374: 83 e6 ldi r24, 0x63 ; 99 1d376: 93 e8 ldi r25, 0x83 ; 131 1d378: 0e 94 ac 7c call 0xf958 ; 0xf958 #endif //_NEW_FIRST_LAYER_CAL static const char fmt1[] PROGMEM = "G1Z%.2f"; enquecommandf_P(fmt1, layer_height); 1d37c: 8e e3 ldi r24, 0x3E ; 62 1d37e: 8f 93 push r24 1d380: 8c e4 ldi r24, 0x4C ; 76 1d382: 8f 93 push r24 1d384: 8c ec ldi r24, 0xCC ; 204 1d386: 8f 93 push r24 1d388: 8d ec ldi r24, 0xCD ; 205 1d38a: 8f 93 push r24 1d38c: 8b e5 ldi r24, 0x5B ; 91 1d38e: 93 e8 ldi r25, 0x83 ; 131 1d390: 9f 93 push r25 1d392: 8f 93 push r24 1d394: 0e 94 4a 7d call 0xfa94 ; 0xfa94 enquecommand_P(feedrate_F1080); 1d398: 61 e0 ldi r22, 0x01 ; 1 1d39a: 86 e8 ldi r24, 0x86 ; 134 1d39c: 93 e8 ldi r25, 0x83 ; 131 1d39e: 0e 94 ac 7c call 0xf958 ; 0xf958 enquecommand_P(MSG_G91); //enable relative XYZ 1d3a2: 61 e0 ldi r22, 0x01 ; 1 1d3a4: 89 e0 ldi r24, 0x09 ; 9 1d3a6: 98 e6 ldi r25, 0x68 ; 104 1d3a8: 0e 94 ac 7c call 0xf958 ; 0xf958 #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)); 1d3ac: 20 e0 ldi r18, 0x00 ; 0 1d3ae: 30 e0 ldi r19, 0x00 ; 0 1d3b0: 40 e8 ldi r20, 0x80 ; 128 1d3b2: 50 e4 ldi r21, 0x40 ; 64 1d3b4: c5 01 movw r24, r10 1d3b6: b4 01 movw r22, r8 1d3b8: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1d3bc: 20 e0 ldi r18, 0x00 ; 0 1d3be: 30 e0 ldi r19, 0x00 ; 0 1d3c0: 48 ec ldi r20, 0xC8 ; 200 1d3c2: 51 e4 ldi r21, 0x41 ; 65 1d3c4: 0f 94 0b 54 call 0x2a816 ; 0x2a816 1d3c8: 9f 93 push r25 1d3ca: 8f 93 push r24 1d3cc: 7f 93 push r23 1d3ce: 6f 93 push r22 1d3d0: 01 e4 ldi r16, 0x41 ; 65 1d3d2: 0f 93 push r16 1d3d4: 18 ec ldi r17, 0xC8 ; 200 1d3d6: 1f 93 push r17 1d3d8: 1f 92 push r1 1d3da: 1f 92 push r1 1d3dc: c9 e7 ldi r28, 0x79 ; 121 1d3de: d3 e8 ldi r29, 0x83 ; 131 1d3e0: df 93 push r29 1d3e2: cf 93 push r28 1d3e4: 0e 94 4a 7d call 0xfa94 ; 0xfa94 enquecommandf_P(extrude_fmt_X, 25.f*invert, count_e(layer_height, extrusion_width * 2.f, 25)); 1d3e8: a5 01 movw r20, r10 1d3ea: 94 01 movw r18, r8 1d3ec: c5 01 movw r24, r10 1d3ee: b4 01 movw r22, r8 1d3f0: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1d3f4: 20 e0 ldi r18, 0x00 ; 0 1d3f6: 30 e0 ldi r19, 0x00 ; 0 1d3f8: 48 ec ldi r20, 0xC8 ; 200 1d3fa: 51 e4 ldi r21, 0x41 ; 65 1d3fc: 0f 94 0b 54 call 0x2a816 ; 0x2a816 1d400: 9f 93 push r25 1d402: 8f 93 push r24 1d404: 7f 93 push r23 1d406: 6f 93 push r22 1d408: 0f 93 push r16 1d40a: 1f 93 push r17 1d40c: 1f 92 push r1 1d40e: 1f 92 push r1 1d410: df 93 push r29 1d412: cf 93 push r28 1d414: 0e 94 4a 7d call 0xfa94 ; 0xfa94 enquecommandf_P(extrude_fmt_X, 100.f*invert, count_e(layer_height, extrusion_width, 100)); 1d418: 20 e0 ldi r18, 0x00 ; 0 1d41a: 30 e0 ldi r19, 0x00 ; 0 1d41c: 48 ec ldi r20, 0xC8 ; 200 1d41e: 52 e4 ldi r21, 0x42 ; 66 1d420: c5 01 movw r24, r10 1d422: b4 01 movw r22, r8 1d424: 0f 94 0b 54 call 0x2a816 ; 0x2a816 1d428: 9f 93 push r25 1d42a: 8f 93 push r24 1d42c: 7f 93 push r23 1d42e: 6f 93 push r22 1d430: 82 e4 ldi r24, 0x42 ; 66 1d432: 8f 93 push r24 1d434: 1f 93 push r17 1d436: 1f 92 push r1 1d438: 1f 92 push r1 1d43a: df 93 push r29 1d43c: cf 93 push r28 1d43e: 0e 94 4a 7d call 0xfa94 ; 0xfa94 enquecommandf_P(extrude_fmt_Y, -20.f*invert, count_e(layer_height, extrusion_width, 20)); 1d442: 8d b7 in r24, 0x3d ; 61 1d444: 9e b7 in r25, 0x3e ; 62 1d446: 84 96 adiw r24, 0x24 ; 36 1d448: 0f b6 in r0, 0x3f ; 63 1d44a: f8 94 cli 1d44c: 9e bf out 0x3e, r25 ; 62 1d44e: 0f be out 0x3f, r0 ; 63 1d450: 8d bf out 0x3d, r24 ; 61 1d452: 20 e0 ldi r18, 0x00 ; 0 1d454: 30 e0 ldi r19, 0x00 ; 0 1d456: 40 ea ldi r20, 0xA0 ; 160 1d458: 51 e4 ldi r21, 0x41 ; 65 1d45a: c5 01 movw r24, r10 1d45c: b4 01 movw r22, r8 1d45e: 0f 94 0b 54 call 0x2a816 ; 0x2a816 1d462: 9f 93 push r25 1d464: 8f 93 push r24 1d466: 7f 93 push r23 1d468: 6f 93 push r22 1d46a: 81 ec ldi r24, 0xC1 ; 193 1d46c: 8f 93 push r24 1d46e: 80 ea ldi r24, 0xA0 ; 160 1d470: 8f 93 push r24 1d472: 1f 92 push r1 1d474: 1f 92 push r1 1d476: 8e e4 ldi r24, 0x4E ; 78 1d478: 93 e8 ldi r25, 0x83 ; 131 1d47a: 9f 93 push r25 1d47c: 8f 93 push r24 1d47e: 0e 94 4a 7d call 0xfa94 ; 0xfa94 1d482: 8d b7 in r24, 0x3d ; 61 1d484: 9e b7 in r25, 0x3e ; 62 1d486: 0a 96 adiw r24, 0x0a ; 10 1d488: 0f b6 in r0, 0x3f ; 63 1d48a: f8 94 cli 1d48c: 9e bf out 0x3e, r25 ; 62 1d48e: 0f be out 0x3f, r0 ; 63 1d490: 8d bf out 0x3d, r24 ; 61 1d492: f3 cd rjmp .-1050 ; 0x1d07a //! @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); 1d494: 20 e0 ldi r18, 0x00 ; 0 1d496: 30 e0 ldi r19, 0x00 ; 0 1d498: 46 e1 ldi r20, 0x16 ; 22 1d49a: 53 e4 ldi r21, 0x43 ; 67 1d49c: c5 01 movw r24, r10 1d49e: b4 01 movw r22, r8 1d4a0: 0f 94 0b 54 call 0x2a816 ; 0x2a816 1d4a4: 76 2e mov r7, r22 1d4a6: 67 2e mov r6, r23 1d4a8: 58 2e mov r5, r24 1d4aa: 49 2e mov r4, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 1d4ac: 20 e0 ldi r18, 0x00 ; 0 1d4ae: 30 e0 ldi r19, 0x00 ; 0 1d4b0: 40 ea ldi r20, 0xA0 ; 160 1d4b2: 51 e4 ldi r21, 0x41 ; 65 1d4b4: c5 01 movw r24, r10 1d4b6: b4 01 movw r22, r8 1d4b8: 0f 94 0b 54 call 0x2a816 ; 0x2a816 1d4bc: b6 2e mov r11, r22 1d4be: a7 2e mov r10, r23 1d4c0: 98 2e mov r9, r24 1d4c2: 89 2e mov r8, r25 1d4c4: c5 e0 ldi r28, 0x05 ; 5 for(int8_t i = 0, xdir = -invert; i <= 4; i++, xdir = -xdir) 1d4c6: df ef ldi r29, 0xFF ; 255 { enquecommandf_P(extrude_fmt_X, xdir * long_length, long_extrusion); 1d4c8: 29 e7 ldi r18, 0x79 ; 121 1d4ca: e2 2e mov r14, r18 1d4cc: 23 e8 ldi r18, 0x83 ; 131 1d4ce: f2 2e mov r15, r18 enquecommandf_P(extrude_fmt_Y, invert * -short_length, short_extrusion); 1d4d0: 31 ec ldi r19, 0xC1 ; 193 1d4d2: c3 2e mov r12, r19 1d4d4: 40 ea ldi r20, 0xA0 ; 160 1d4d6: d4 2e mov r13, r20 1d4d8: 0e e4 ldi r16, 0x4E ; 78 1d4da: 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); 1d4dc: 4f 92 push r4 1d4de: 5f 92 push r5 1d4e0: 6f 92 push r6 1d4e2: 7f 92 push r7 1d4e4: 6d 2f mov r22, r29 1d4e6: 0d 2e mov r0, r29 1d4e8: 00 0c add r0, r0 1d4ea: 77 0b sbc r23, r23 1d4ec: 88 0b sbc r24, r24 1d4ee: 99 0b sbc r25, r25 1d4f0: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 1d4f4: 20 e0 ldi r18, 0x00 ; 0 1d4f6: 30 e0 ldi r19, 0x00 ; 0 1d4f8: 46 e1 ldi r20, 0x16 ; 22 1d4fa: 53 e4 ldi r21, 0x43 ; 67 1d4fc: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1d500: 9f 93 push r25 1d502: 8f 93 push r24 1d504: 7f 93 push r23 1d506: 6f 93 push r22 1d508: ff 92 push r15 1d50a: ef 92 push r14 1d50c: 0e 94 4a 7d call 0xfa94 ; 0xfa94 enquecommandf_P(extrude_fmt_Y, invert * -short_length, short_extrusion); 1d510: 8f 92 push r8 1d512: 9f 92 push r9 1d514: af 92 push r10 1d516: bf 92 push r11 1d518: cf 92 push r12 1d51a: df 92 push r13 1d51c: 1f 92 push r1 1d51e: 1f 92 push r1 1d520: 1f 93 push r17 1d522: 0f 93 push r16 1d524: 0e 94 4a 7d call 0xfa94 ; 0xfa94 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) 1d528: d1 95 neg r29 1d52a: c1 50 subi r28, 0x01 ; 1 1d52c: 8d b7 in r24, 0x3d ; 61 1d52e: 9e b7 in r25, 0x3e ; 62 1d530: 44 96 adiw r24, 0x14 ; 20 1d532: 0f b6 in r0, 0x3f ; 63 1d534: f8 94 cli 1d536: 9e bf out 0x3e, r25 ; 62 1d538: 0f be out 0x3f, r0 ; 63 1d53a: 8d bf out 0x3d, r24 ; 61 1d53c: c1 11 cpse r28, r1 1d53e: ce cf rjmp .-100 ; 0x1d4dc 1d540: 9c cd rjmp .-1224 ; 0x1d07a //! @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); 1d542: 23 e4 ldi r18, 0x43 ; 67 1d544: 3d ec ldi r19, 0xCD ; 205 1d546: 4f e2 ldi r20, 0x2F ; 47 1d548: 5d e3 ldi r21, 0x3D ; 61 1d54a: c5 01 movw r24, r10 1d54c: b4 01 movw r22, r8 1d54e: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1d552: 6b 01 movw r12, r22 1d554: 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); 1d556: 20 e0 ldi r18, 0x00 ; 0 1d558: 30 e0 ldi r19, 0x00 ; 0 1d55a: 40 ea ldi r20, 0xA0 ; 160 1d55c: 51 e4 ldi r21, 0x41 ; 65 1d55e: c5 01 movw r24, r10 1d560: b4 01 movw r22, r8 1d562: 0f 94 0b 54 call 0x2a816 ; 0x2a816 1d566: 66 2e mov r6, r22 1d568: 57 2e mov r5, r23 1d56a: 48 2e mov r4, r24 1d56c: 39 2e mov r3, r25 const float short_extrusion = count_e(layer_height, extrusion_width, Y_spacing); 1d56e: a7 01 movw r20, r14 1d570: 96 01 movw r18, r12 1d572: c5 01 movw r24, r10 1d574: b4 01 movw r22, r8 1d576: 0f 94 0b 54 call 0x2a816 ; 0x2a816 1d57a: 26 2e mov r2, r22 1d57c: a7 2e mov r10, r23 1d57e: 98 2e mov r9, r24 1d580: 89 2e mov r8, r25 1d582: 84 e0 ldi r24, 0x04 ; 4 1d584: b8 2e mov r11, r24 for (uint8_t i = 0; i < 4; i++) { enquecommandf_P(extrude_fmt_X, square_width*invert, long_extrusion); 1d586: 90 ea ldi r25, 0xA0 ; 160 1d588: 79 2e mov r7, r25 1d58a: 09 e7 ldi r16, 0x79 ; 121 1d58c: 13 e8 ldi r17, 0x83 ; 131 enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion); 1d58e: f7 fa bst r15, 7 1d590: f0 94 com r15 1d592: f7 f8 bld r15, 7 1d594: f0 94 com r15 1d596: ce e4 ldi r28, 0x4E ; 78 1d598: 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); 1d59a: 3f 92 push r3 1d59c: 4f 92 push r4 1d59e: 5f 92 push r5 1d5a0: 6f 92 push r6 1d5a2: 91 e4 ldi r25, 0x41 ; 65 1d5a4: 9f 93 push r25 1d5a6: 7f 92 push r7 1d5a8: 1f 92 push r1 1d5aa: 1f 92 push r1 1d5ac: 1f 93 push r17 1d5ae: 0f 93 push r16 1d5b0: 0e 94 4a 7d call 0xfa94 ; 0xfa94 enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion); 1d5b4: 8f 92 push r8 1d5b6: 9f 92 push r9 1d5b8: af 92 push r10 1d5ba: 2f 92 push r2 1d5bc: ff 92 push r15 1d5be: ef 92 push r14 1d5c0: df 92 push r13 1d5c2: cf 92 push r12 1d5c4: df 93 push r29 1d5c6: cf 93 push r28 1d5c8: 0e 94 4a 7d call 0xfa94 ; 0xfa94 enquecommandf_P(extrude_fmt_X, -square_width*invert, long_extrusion); 1d5cc: 3f 92 push r3 1d5ce: 4f 92 push r4 1d5d0: 5f 92 push r5 1d5d2: 6f 92 push r6 1d5d4: 81 ec ldi r24, 0xC1 ; 193 1d5d6: 8f 93 push r24 1d5d8: 7f 92 push r7 1d5da: 1f 92 push r1 1d5dc: 1f 92 push r1 1d5de: 1f 93 push r17 1d5e0: 0f 93 push r16 1d5e2: 0e 94 4a 7d call 0xfa94 ; 0xfa94 enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion); 1d5e6: 8f 92 push r8 1d5e8: 9f 92 push r9 1d5ea: af 92 push r10 1d5ec: 2f 92 push r2 1d5ee: ff 92 push r15 1d5f0: ef 92 push r14 1d5f2: df 92 push r13 1d5f4: cf 92 push r12 1d5f6: df 93 push r29 1d5f8: cf 93 push r28 1d5fa: 0e 94 4a 7d call 0xfa94 ; 0xfa94 1d5fe: 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++) 1d600: 8d b7 in r24, 0x3d ; 61 1d602: 9e b7 in r25, 0x3e ; 62 1d604: 88 96 adiw r24, 0x28 ; 40 1d606: 0f b6 in r0, 0x3f ; 63 1d608: f8 94 cli 1d60a: 9e bf out 0x3e, r25 ; 62 1d60c: 0f be out 0x3f, r0 ; 63 1d60e: 8d bf out 0x3d, r24 ; 61 1d610: b1 10 cpse r11, r1 1d612: c3 cf rjmp .-122 ; 0x1d59a 1d614: 32 cd rjmp .-1436 ; 0x1d07a 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]))); 1d616: 69 e0 ldi r22, 0x09 ; 9 1d618: 8c e3 ldi r24, 0x3C ; 60 1d61a: 93 e8 ldi r25, 0x83 ; 131 1d61c: fc cc rjmp .-1544 ; 0x1d016 break; case 2: lay1cal_finish(); break; case 1: lcd_setstatuspgm(MSG_WELCOME); 1d61e: 87 e6 ldi r24, 0x67 ; 103 1d620: 9b e6 ldi r25, 0x6B ; 107 1d622: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 lcd_commands_step = 0; 1d626: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 lcd_commands_type = LcdCommands::Idle; 1d62a: 10 92 c8 0d sts 0x0DC8, r1 ; 0x800dc8 1d62e: 82 e0 ldi r24, 0x02 ; 2 1d630: 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)) 1d634: 8f e5 ldi r24, 0x5F ; 95 1d636: 9f e0 ldi r25, 0x0F ; 15 1d638: 0f 94 9b a0 call 0x34136 ; 0x34136 1d63c: 88 23 and r24, r24 1d63e: 09 f4 brne .+2 ; 0x1d642 1d640: f3 cd rjmp .-1050 ; 0x1d228 lcd_wizard(WizState::RepeatLay1Cal); 1d642: 8b e0 ldi r24, 0x0B ; 11 1d644: 0f 94 b3 2e call 0x25d66 ; 0x25d66 1d648: 18 cd rjmp .-1488 ; 0x1d07a 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."); 1d64a: 84 ee ldi r24, 0xE4 ; 228 1d64c: 93 e8 ldi r25, 0x83 ; 131 1d64e: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 1d652: c4 cd rjmp .-1144 ; 0x1d1dc #endif //THERMAL_MODEL #endif //QUICK_NOZZLE_CHANGE switch(lcd_commands_step) { case 0: lcd_commands_step = 3; 1d654: 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; 1d656: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 1d65a: 07 ce rjmp .-1010 ; 0x1d26a 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)); 1d65c: 85 e9 ldi r24, 0x95 ; 149 1d65e: 90 e4 ldi r25, 0x40 ; 64 1d660: 0e 94 a7 6c call 0xd94e ; 0xd94e 1d664: 0f 94 a9 0b call 0x21752 ; 0x21752 enquecommand_P(G28W); 1d668: 61 e0 ldi r22, 0x01 ; 1 1d66a: 82 e1 ldi r24, 0x12 ; 18 1d66c: 98 e6 ldi r25, 0x68 ; 104 1d66e: 0e 94 ac 7c call 0xf958 ; 0xf958 enquecommand_P(PSTR("G1 X125 Z200 F1000")); 1d672: 61 e0 ldi r22, 0x01 ; 1 1d674: 81 ed ldi r24, 0xD1 ; 209 1d676: 93 e8 ldi r25, 0x83 ; 131 1d678: 0e 94 ac 7c call 0xf958 ; 0xf958 enquecommand_P(PSTR("M109 S280")); 1d67c: 61 e0 ldi r22, 0x01 ; 1 1d67e: 87 ec ldi r24, 0xC7 ; 199 1d680: 93 e8 ldi r25, 0x83 ; 131 1d682: 0e 94 ac 7c call 0xf958 ; 0xf958 } } enquecommand_P(G28W); //home enquecommand_P(PSTR("G1 X125 Z200 F1000")); //move to top center #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 2; 1d686: 82 e0 ldi r24, 0x02 ; 2 1d688: e6 cf rjmp .-52 ; 0x1d656 break; case 2: enquecommand_P(PSTR("M84 XY")); 1d68a: 61 e0 ldi r22, 0x01 ; 1 1d68c: 80 ec ldi r24, 0xC0 ; 192 1d68e: 93 e8 ldi r25, 0x83 ; 131 1d690: 0e 94 ac 7c call 0xf958 ; 0xf958 if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_CHANGED), false) == LCD_LEFT_BUTTON_CHOICE) { 1d694: 8c e5 ldi r24, 0x5C ; 92 1d696: 90 e4 ldi r25, 0x40 ; 64 1d698: 0e 94 a7 6c call 0xd94e ; 0xd94e 1d69c: 41 e0 ldi r20, 0x01 ; 1 1d69e: 60 e0 ldi r22, 0x00 ; 0 1d6a0: 0f 94 8a 2e call 0x25d14 ; 0x25d14 1d6a4: 81 11 cpse r24, r1 1d6a6: e1 cd rjmp .-1086 ; 0x1d26a 1d6a8: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 1d6ac: 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; 1d6b0: 81 e0 ldi r24, 0x01 ; 1 1d6b2: d1 cf rjmp .-94 ; 0x1d656 } break; case 1: lcd_commands_step = 0; 1d6b4: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 lcd_commands_type = LcdCommands::Idle; 1d6b8: 10 92 c8 0d sts 0x0DC8, r1 ; 0x800dc8 1d6bc: 82 e0 ldi r24, 0x02 ; 2 1d6be: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.367> SetPrinterState(PrinterState::Idle); menu_goto(lcd_hw_setup_menu, 2, true); 1d6c2: 20 e0 ldi r18, 0x00 ; 0 1d6c4: 41 e0 ldi r20, 0x01 ; 1 1d6c6: 62 e0 ldi r22, 0x02 ; 2 1d6c8: 70 e0 ldi r23, 0x00 ; 0 1d6ca: 82 eb ldi r24, 0xB2 ; 178 1d6cc: 93 eb ldi r25, 0xB3 ; 179 1d6ce: 0f 94 a5 93 call 0x3274a ; 0x3274a menu_depth = 3; 1d6d2: 83 e0 ldi r24, 0x03 ; 3 1d6d4: 80 93 ad 03 sts 0x03AD, r24 ; 0x8003ad 1d6d8: c8 cd rjmp .-1136 ; 0x1d26a 0001d6da : && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); } void menu_lcd_lcdupdate_func(void) { 1d6da: 0f 93 push r16 1d6dc: 1f 93 push r17 #if (SDCARDDETECT > 0) if ((IS_SD_INSERTED != lcd_oldcardstatus)) 1d6de: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1d6e2: 80 95 com r24 1d6e4: 81 70 andi r24, 0x01 ; 1 1d6e6: 90 91 cf 03 lds r25, 0x03CF ; 0x8003cf 1d6ea: 89 17 cp r24, r25 1d6ec: 89 f1 breq .+98 ; 0x1d750 { if(menu_menu == lcd_sdcard_menu) { 1d6ee: 80 91 d0 03 lds r24, 0x03D0 ; 0x8003d0 1d6f2: 90 91 d1 03 lds r25, 0x03D1 ; 0x8003d1 1d6f6: 86 56 subi r24, 0x66 ; 102 1d6f8: 9c 4e sbci r25, 0xEC ; 236 1d6fa: 11 f4 brne .+4 ; 0x1d700 // 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(); 1d6fc: 0f 94 43 96 call 0x32c86 ; 0x32c86 } lcd_draw_update = 2; 1d700: 82 e0 ldi r24, 0x02 ; 2 1d702: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b lcd_oldcardstatus = IS_SD_INSERTED; 1d706: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1d70a: 80 95 com r24 1d70c: 81 70 andi r24, 0x01 ; 1 1d70e: 80 93 cf 03 sts 0x03CF, r24 ; 0x8003cf lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 1d712: 0e 94 1d 6a call 0xd43a ; 0xd43a backlight_wake(); if (lcd_oldcardstatus) 1d716: 80 91 cf 03 lds r24, 0x03CF ; 0x8003cf 1d71a: 88 23 and r24, r24 1d71c: 09 f4 brne .+2 ; 0x1d720 1d71e: 88 c0 rjmp .+272 ; 0x1d830 { if (!card.mounted) 1d720: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1d724: 81 11 cpse r24, r1 1d726: 05 c0 rjmp .+10 ; 0x1d732 { card.mount(false); //delay the sorting to the sd menu. Otherwise, removing the SD card while sorting will not menu_back() 1d728: 0f 94 3c 4e call 0x29c78 ; 0x29c78 card.presort_flag = true; //force sorting of the SD menu 1d72c: 81 e0 ldi r24, 0x01 ; 1 1d72e: 80 93 b9 13 sts 0x13B9, r24 ; 0x8013b9 } LCD_MESSAGERPGM(MSG_WELCOME); 1d732: 87 e6 ldi r24, 0x67 ; 103 1d734: 9b e6 ldi r25, 0x6B ; 107 1d736: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 bMain=false; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function 1d73a: 10 92 97 03 sts 0x0397, r1 ; 0x800397 menu_submenu(lcd_sdcard_menu, true); 1d73e: 61 e0 ldi r22, 0x01 ; 1 1d740: 86 e6 ldi r24, 0x66 ; 102 1d742: 9c ee ldi r25, 0xEC ; 236 1d744: 0f 94 e8 94 call 0x329d0 ; 0x329d0 lcd_timeoutToStatus.start(); 1d748: 81 eb ldi r24, 0xB1 ; 177 1d74a: 93 e0 ldi r25, 0x03 ; 3 1d74c: 0f 94 29 12 call 0x22452 ; 0x22452 ::start()> card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); } } #endif//CARDINSERTED if (lcd_next_update_millis < _millis()) 1d750: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 1d754: 00 91 93 03 lds r16, 0x0393 ; 0x800393 1d758: 10 91 94 03 lds r17, 0x0394 ; 0x800394 1d75c: 20 91 95 03 lds r18, 0x0395 ; 0x800395 1d760: 30 91 96 03 lds r19, 0x0396 ; 0x800396 1d764: 06 17 cp r16, r22 1d766: 17 07 cpc r17, r23 1d768: 28 07 cpc r18, r24 1d76a: 39 07 cpc r19, r25 1d76c: e8 f5 brcc .+122 ; 0x1d7e8 { if (lcd_draw_update) { 1d76e: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1d772: 88 23 and r24, r24 1d774: 31 f0 breq .+12 ; 0x1d782 lcd_timeoutToStatus.start(); 1d776: 81 eb ldi r24, 0xB1 ; 177 1d778: 93 e0 ldi r25, 0x03 ; 3 1d77a: 0f 94 29 12 call 0x22452 ; 0x22452 ::start()> lcd_frame_start(); 1d77e: 0e 94 25 69 call 0xd24a ; 0xd24a } (*menu_menu)(); 1d782: e0 91 d0 03 lds r30, 0x03D0 ; 0x8003d0 1d786: f0 91 d1 03 lds r31, 0x03D1 ; 0x8003d1 1d78a: 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)))); 1d78c: 80 91 d0 03 lds r24, 0x03D0 ; 0x8003d0 1d790: 90 91 d1 03 lds r25, 0x03D1 ; 0x8003d1 1d794: 8d 5d subi r24, 0xDD ; 221 1d796: 97 43 sbci r25, 0x37 ; 55 1d798: 09 f4 brne .+2 ; 0x1d79c 1d79a: 5d c0 rjmp .+186 ; 0x1d856 } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen 1d79c: 80 91 d0 03 lds r24, 0x03D0 ; 0x8003d0 1d7a0: 90 91 d1 03 lds r25, 0x03D1 ; 0x8003d1 && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 1d7a4: 27 e3 ldi r18, 0x37 ; 55 1d7a6: 85 31 cpi r24, 0x15 ; 21 1d7a8: 92 07 cpc r25, r18 1d7aa: 09 f0 breq .+2 ; 0x1d7ae 1d7ac: 75 c0 rjmp .+234 ; 0x1d898 } lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); 1d7ae: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1d7b2: 82 30 cpi r24, 0x02 ; 2 1d7b4: 21 f4 brne .+8 ; 0x1d7be #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 1d7b6: 0e 94 1d 6a call 0xd43a ; 0xd43a lcd_status_message_idx = 0; // Re-draw message from beginning 1d7ba: 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--; 1d7be: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1d7c2: 88 23 and r24, r24 1d7c4: 19 f0 breq .+6 ; 0x1d7cc 1d7c6: 81 50 subi r24, 0x01 ; 1 1d7c8: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b lcd_next_update_millis = _millis() + LCD_UPDATE_INTERVAL; 1d7cc: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 1d7d0: 6c 59 subi r22, 0x9C ; 156 1d7d2: 7f 4f sbci r23, 0xFF ; 255 1d7d4: 8f 4f sbci r24, 0xFF ; 255 1d7d6: 9f 4f sbci r25, 0xFF ; 255 1d7d8: 60 93 93 03 sts 0x0393, r22 ; 0x800393 1d7dc: 70 93 94 03 sts 0x0394, r23 ; 0x800394 1d7e0: 80 93 95 03 sts 0x0395, r24 ; 0x800395 1d7e4: 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))) { 1d7e8: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1d7ec: 88 23 and r24, r24 1d7ee: 99 f0 breq .+38 ; 0x1d816 1d7f0: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 <_ZL11no_response.lto_priv.497> 1d7f4: 88 23 and r24, r24 1d7f6: 79 f0 breq .+30 ; 0x1d816 1d7f8: 60 e1 ldi r22, 0x10 ; 16 1d7fa: 77 e2 ldi r23, 0x27 ; 39 1d7fc: 8f e8 ldi r24, 0x8F ; 143 1d7fe: 93 e0 ldi r25, 0x03 ; 3 1d800: 0f 94 2f 10 call 0x2205e ; 0x2205e ::expired(unsigned short)> 1d804: 88 23 and r24, r24 1d806: 39 f0 breq .+14 ; 0x1d816 //send important status messages periodicaly prusa_statistics(8); 1d808: 88 e0 ldi r24, 0x08 ; 8 1d80a: 0f 94 be 98 call 0x3317c ; 0x3317c NcTime.start(); 1d80e: 8f e8 ldi r24, 0x8F ; 143 1d810: 93 e0 ldi r25, 0x03 ; 3 1d812: 0f 94 5e 10 call 0x220bc ; 0x220bc ::start()> } prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); 1d816: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1d81a: 84 30 cpi r24, 0x04 ; 4 1d81c: 09 f0 breq .+2 ; 0x1d820 1d81e: 53 c0 rjmp .+166 ; 0x1d8c6 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) { 1d820: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 1d824: 81 11 cpse r24, r1 1d826: 4f c0 rjmp .+158 ; 0x1d8c6 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(); } 1d828: 1f 91 pop r17 1d82a: 0f 91 pop r16 1d82c: 0c 94 aa e6 jmp 0x1cd54 ; 0x1cd54 presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 1d830: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a mounted = false; 1d834: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b SERIAL_ECHO_START; 1d838: 81 e6 ldi r24, 0x61 ; 97 1d83a: 9d e9 ldi r25, 0x9D ; 157 1d83c: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 1d840: 89 ee ldi r24, 0xE9 ; 233 1d842: 97 e6 ldi r25, 0x67 ; 103 1d844: 0e 94 49 72 call 0xe492 ; 0xe492 lcd_timeoutToStatus.start(); } else { card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); 1d848: 85 e0 ldi r24, 0x05 ; 5 1d84a: 90 e4 ldi r25, 0x40 ; 64 1d84c: 0e 94 a7 6c call 0xd94e ; 0xd94e 1d850: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 1d854: 7d cf rjmp .-262 ; 0x1d750 // 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)))); 1d856: 0e 94 cd 60 call 0xc19a ; 0xc19a 1d85a: 81 11 cpse r24, r1 1d85c: 0e c0 rjmp .+28 ; 0x1d87a 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) 1d85e: e0 91 d0 03 lds r30, 0x03D0 ; 0x8003d0 1d862: f0 91 d1 03 lds r31, 0x03D1 ; 0x8003d1 1d866: 30 97 sbiw r30, 0x00 ; 0 1d868: 39 f5 brne .+78 ; 0x1d8b8 { menu_leaving = 1; (*menu_menu)(); menu_leaving = 0; } lcd_clear(); 1d86a: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_return_to_status(); 1d86e: 0e 94 6d fe call 0x1fcda ; 0x1fcda lcd_draw_update = 2; 1d872: 82 e0 ldi r24, 0x02 ; 2 1d874: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b 1d878: 9a cf rjmp .-204 ; 0x1d7ae // 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)))); 1d87a: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 1d87e: 81 11 cpse r24, r1 1d880: 8d cf rjmp .-230 ; 0x1d79c 1d882: 40 e9 ldi r20, 0x90 ; 144 1d884: 5f e5 ldi r21, 0x5F ; 95 1d886: 61 e0 ldi r22, 0x01 ; 1 1d888: 70 e0 ldi r23, 0x00 ; 0 1d88a: 81 eb ldi r24, 0xB1 ; 177 1d88c: 93 e0 ldi r25, 0x03 ; 3 1d88e: 0f 94 6a 10 call 0x220d4 ; 0x220d4 ::expired(unsigned long)> 1d892: 81 11 cpse r24, r1 1d894: e4 cf rjmp .-56 ; 0x1d85e 1d896: 82 cf rjmp .-252 ; 0x1d79c } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen && menu_menu != lcd_babystep_z 1d898: 8d 5d subi r24, 0xDD ; 221 1d89a: 97 43 sbci r25, 0x37 ; 55 1d89c: 09 f4 brne .+2 ; 0x1d8a0 1d89e: 87 cf rjmp .-242 ; 0x1d7ae && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 1d8a0: 40 e3 ldi r20, 0x30 ; 48 1d8a2: 55 e7 ldi r21, 0x75 ; 117 1d8a4: 60 e0 ldi r22, 0x00 ; 0 1d8a6: 70 e0 ldi r23, 0x00 ; 0 1d8a8: 81 eb ldi r24, 0xB1 ; 177 1d8aa: 93 e0 ldi r25, 0x03 ; 3 1d8ac: 0f 94 6a 10 call 0x220d4 ; 0x220d4 ::expired(unsigned long)> 1d8b0: 88 23 and r24, r24 1d8b2: 09 f4 brne .+2 ; 0x1d8b6 1d8b4: 7c cf rjmp .-264 ; 0x1d7ae 1d8b6: d3 cf rjmp .-90 ; 0x1d85e // 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; 1d8b8: 81 e0 ldi r24, 0x01 ; 1 1d8ba: 80 93 92 03 sts 0x0392, r24 ; 0x800392 (*menu_menu)(); 1d8be: 19 95 eicall menu_leaving = 0; 1d8c0: 10 92 92 03 sts 0x0392, r1 ; 0x800392 1d8c4: d2 cf rjmp .-92 ; 0x1d86a 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(); } 1d8c6: 1f 91 pop r17 1d8c8: 0f 91 pop r16 1d8ca: 08 95 ret 0001d8cc : MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); MENU_END(); } void lcd_sdcard_menu() { 1d8cc: 2f 92 push r2 1d8ce: 3f 92 push r3 1d8d0: 4f 92 push r4 1d8d2: 5f 92 push r5 1d8d4: 6f 92 push r6 1d8d6: 7f 92 push r7 1d8d8: 8f 92 push r8 1d8da: 9f 92 push r9 1d8dc: af 92 push r10 1d8de: bf 92 push r11 1d8e0: cf 92 push r12 1d8e2: df 92 push r13 1d8e4: ef 92 push r14 1d8e6: ff 92 push r15 1d8e8: 0f 93 push r16 1d8ea: 1f 93 push r17 1d8ec: cf 93 push r28 1d8ee: df 93 push r29 1d8f0: cd b7 in r28, 0x3d ; 61 1d8f2: de b7 in r29, 0x3e ; 62 1d8f4: 2d 97 sbiw r28, 0x0d ; 13 1d8f6: 0f b6 in r0, 0x3f ; 63 1d8f8: f8 94 cli 1d8fa: de bf out 0x3e, r29 ; 62 1d8fc: 0f be out 0x3f, r0 ; 63 1d8fe: 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) 1d900: 80 91 64 03 lds r24, 0x0364 ; 0x800364 1d904: 81 30 cpi r24, 0x01 ; 1 1d906: 51 f1 breq .+84 ; 0x1d95c 1d908: 30 f0 brcs .+12 ; 0x1d916 1d90a: 82 30 cpi r24, 0x02 ; 2 1d90c: 09 f4 brne .+2 ; 0x1d910 1d90e: 88 c2 rjmp .+1296 ; 0x1de20 { _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. 1d910: 10 92 64 03 sts 0x0364, r1 ; 0x800364 1d914: 04 c1 rjmp .+520 ; 0x1db1e switch(_md->menuState) { case _uninitialized: //Initialize menu data { if (card.presort_flag == true) //used to force resorting if sorting type is changed. 1d916: 80 91 b9 13 lds r24, 0x13B9 ; 0x8013b9 1d91a: 88 23 and r24, r24 1d91c: 49 f0 breq .+18 ; 0x1d930 { card.presort_flag = false; 1d91e: 10 92 b9 13 sts 0x13B9, r1 ; 0x8013b9 lcd_update_enabled = false; 1d922: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c card.presort(); 1d926: 0f 94 04 4a call 0x29408 ; 0x29408 lcd_update_enabled = true; 1d92a: 81 e0 ldi r24, 0x01 ; 1 1d92c: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c } _md->fileCnt = card.getnrfilenames(); 1d930: 0f 94 ed 48 call 0x291da ; 0x291da 1d934: 90 93 6c 03 sts 0x036C, r25 ; 0x80036c 1d938: 80 93 6b 03 sts 0x036B, r24 ; 0x80036b _md->sdSort = farm_mode ? SD_SORT_NONE : eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 1d93c: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1d940: 81 11 cpse r24, r1 1d942: e7 c0 rjmp .+462 ; 0x1db12 1d944: 89 e0 ldi r24, 0x09 ; 9 1d946: 9f e0 ldi r25, 0x0F ; 15 1d948: 0f 94 9b a0 call 0x34136 ; 0x34136 1d94c: 80 93 6e 03 sts 0x036E, r24 ; 0x80036e _md->menuState = _standard; 1d950: 81 e0 ldi r24, 0x01 ; 1 1d952: 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. 1d956: 8f ef ldi r24, 0xFF ; 255 1d958: 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. 1d95c: 80 91 6f 03 lds r24, 0x036F ; 0x80036f 1d960: 81 11 cpse r24, r1 1d962: 07 c0 rjmp .+14 ; 0x1d972 { _md->lcd_scrollTimer.start(); 1d964: 8f e6 ldi r24, 0x6F ; 111 1d966: 93 e0 ldi r25, 0x03 ; 3 1d968: 0f 94 5e 10 call 0x220bc ; 0x220bc ::start()> lcd_draw_update = 1; 1d96c: 81 e0 ldi r24, 0x01 ; 1 1d96e: 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. 1d972: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1d976: 81 11 cpse r24, r1 1d978: 21 c0 rjmp .+66 ; 0x1d9bc 1d97a: 64 ef ldi r22, 0xF4 ; 244 1d97c: 71 e0 ldi r23, 0x01 ; 1 1d97e: 8f e6 ldi r24, 0x6F ; 111 1d980: 93 e0 ldi r25, 0x03 ; 3 1d982: 0f 94 2f 10 call 0x2205e ; 0x2205e ::expired(unsigned short)> 1d986: 88 23 and r24, r24 1d988: a1 f0 breq .+40 ; 0x1d9b2 1d98a: 80 91 6d 03 lds r24, 0x036D ; 0x80036d 1d98e: 8f 3f cpi r24, 0xFF ; 255 1d990: 81 f0 breq .+32 ; 0x1d9b2 { _md->menuState = _scrolling; 1d992: 82 e0 ldi r24, 0x02 ; 2 1d994: 80 93 64 03 sts 0x0364, r24 ; 0x800364 _md->offset = 0; 1d998: 10 92 65 03 sts 0x0365, r1 ; 0x800365 _md->scrollPointer = NULL; 1d99c: 10 92 68 03 sts 0x0368, r1 ; 0x800368 1d9a0: 10 92 67 03 sts 0x0367, r1 ; 0x800367 _md->lcd_scrollTimer.start(); 1d9a4: 8f e6 ldi r24, 0x6F ; 111 1d9a6: 93 e0 ldi r25, 0x03 ; 3 1d9a8: 0f 94 5e 10 call 0x220bc ; 0x220bc ::start()> lcd_draw_update = 1; //forces last load before switching to scrolling. 1d9ac: 81 e0 ldi r24, 0x01 ; 1 1d9ae: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } if (lcd_draw_update == 0 && !lcd_clicked()) 1d9b2: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1d9b6: 88 23 and r24, r24 1d9b8: 09 f4 brne .+2 ; 0x1d9bc 1d9ba: ad c0 rjmp .+346 ; 0x1db16 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. 1d9bc: 8f ef ldi r24, 0xFF ; 255 1d9be: 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(); 1d9c2: 8f e6 ldi r24, 0x6F ; 111 1d9c4: 93 e0 ldi r25, 0x03 ; 3 1d9c6: 0f 94 5e 10 call 0x220bc ; 0x220bc ::start()> MENU_BEGIN(); 1d9ca: 0f 94 7b 93 call 0x326f6 ; 0x326f6 1d9ce: 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); 1d9d2: ce 01 movw r24, r28 1d9d4: 01 96 adiw r24, 0x01 ; 1 1d9d6: 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); 1d9d8: f9 ee ldi r31, 0xE9 ; 233 1d9da: 2f 2e mov r2, r31 1d9dc: fb e6 ldi r31, 0x6B ; 107 1d9de: 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(); 1d9e0: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1d9e4: 84 30 cpi r24, 0x04 ; 4 1d9e6: 08 f0 brcs .+2 ; 0x1d9ea 1d9e8: 9a c0 rjmp .+308 ; 0x1db1e 1d9ea: 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 1d9ee: 80 91 97 03 lds r24, 0x0397 ; 0x800397 1d9f2: 88 23 and r24, r24 1d9f4: 09 f4 brne .+2 ; 0x1d9f8 1d9f6: ac c0 rjmp .+344 ; 0x1db50 1d9f8: 88 ef ldi r24, 0xF8 ; 248 1d9fa: 9d e3 ldi r25, 0x3D ; 61 1d9fc: 0e 94 a7 6c call 0xd94e ; 0xd94e 1da00: 0f 94 46 96 call 0x32c8c ; 0x32c8c 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;}; 1da04: 6c e6 ldi r22, 0x6C ; 108 1da06: 73 e1 ldi r23, 0x13 ; 19 1da08: 85 e1 ldi r24, 0x15 ; 21 1da0a: 94 e1 ldi r25, 0x14 ; 20 1da0c: 0f 94 74 6f call 0x2dee8 ; 0x2dee8 card.getWorkDirName(); if (card.filename[0] == '/') 1da10: 80 91 6c 13 lds r24, 0x136C ; 0x80136c 1da14: 8f 32 cpi r24, 0x2F ; 47 1da16: 09 f0 breq .+2 ; 0x1da1a 1da18: 9e c0 rjmp .+316 ; 0x1db56 { #if SDCARDDETECT == -1 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); #else if (card.ToshibaFlashAir_isEnabled()) 1da1a: 80 91 db 15 lds r24, 0x15DB ; 0x8015db 1da1e: 88 23 and r24, r24 1da20: 41 f0 breq .+16 ; 0x1da32 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); //show the refresh option if in flashAir mode. 1da22: 8d ee ldi r24, 0xED ; 237 1da24: 9d e3 ldi r25, 0x3D ; 61 1da26: 0e 94 a7 6c call 0xd94e ; 0xd94e 1da2a: 6a ec ldi r22, 0xCA ; 202 1da2c: 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. 1da2e: 0f 94 f8 92 call 0x325f0 ; 0x325f0 for (uint16_t i = _md->fileCnt; i-- > 0;) // Every file, from top to bottom. 1da32: c0 90 6b 03 lds r12, 0x036B ; 0x80036b 1da36: 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; 1da3a: 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. 1da3c: 91 e0 ldi r25, 0x01 ; 1 1da3e: c9 1a sub r12, r25 1da40: d1 08 sbc r13, r1 1da42: 08 f4 brcc .+2 ; 0x1da46 1da44: e0 c1 rjmp .+960 ; 0x1de06 { if (menu_item == menu_line) //If the file is on the screen. 1da46: 80 91 31 04 lds r24, 0x0431 ; 0x800431 1da4a: 90 91 30 04 lds r25, 0x0430 ; 0x800430 1da4e: 89 13 cpse r24, r25 1da50: d6 c1 rjmp .+940 ; 0x1ddfe { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(i, _md->sdSort); 1da52: 60 91 6e 03 lds r22, 0x036E ; 0x80036e 1da56: c6 01 movw r24, r12 1da58: 0f 94 7b 52 call 0x2a4f6 ; 0x2a4f6 #else card.getfilename(i); #endif if (lcd_encoder == menu_item) //If the file is selected. 1da5c: 80 91 31 04 lds r24, 0x0431 ; 0x800431 1da60: 90 e0 ldi r25, 0x00 ; 0 1da62: 20 91 06 05 lds r18, 0x0506 ; 0x800506 1da66: 30 91 07 05 lds r19, 0x0507 ; 0x800507 1da6a: 10 91 b6 13 lds r17, 0x13B6 ; 0x8013b6 1da6e: 82 17 cp r24, r18 1da70: 93 07 cpc r25, r19 1da72: 51 f4 brne .+20 ; 0x1da88 { _md->selectedFileID = i; 1da74: d0 92 6a 03 sts 0x036A, r13 ; 0x80036a 1da78: c0 92 69 03 sts 0x0369, r12 ; 0x800369 _md->isDir = card.filenameIsDir; 1da7c: 10 93 66 03 sts 0x0366, r17 ; 0x800366 _md->row = menu_row; 1da80: 40 91 2e 04 lds r20, 0x042E ; 0x80042e 1da84: 40 93 6d 03 sts 0x036D, r20 ; 0x80036d 1da88: 40 91 5b 02 lds r20, 0x025B ; 0x80025b } if (card.filenameIsDir) 1da8c: 11 23 and r17, r17 1da8e: 09 f4 brne .+2 ; 0x1da92 1da90: 67 c0 rjmp .+206 ; 0x1db60 #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) 1da92: 44 23 and r20, r20 1da94: e9 f0 breq .+58 ; 0x1dad0 { lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1da96: 40 91 81 13 lds r20, 0x1381 ; 0x801381 1da9a: ec e6 ldi r30, 0x6C ; 108 1da9c: ae 2e mov r10, r30 1da9e: e3 e1 ldi r30, 0x13 ; 19 1daa0: be 2e mov r11, r30 1daa2: 44 23 and r20, r20 1daa4: 21 f0 breq .+8 ; 0x1daae 1daa6: 71 e8 ldi r23, 0x81 ; 129 1daa8: a7 2e mov r10, r23 1daaa: 73 e1 ldi r23, 0x13 ; 19 1daac: b7 2e mov r11, r23 1daae: 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)?'>':' '); 1dab2: 4e e3 ldi r20, 0x3E ; 62 1dab4: 82 17 cp r24, r18 1dab6: 93 07 cpc r25, r19 1dab8: 09 f0 breq .+2 ; 0x1dabc 1daba: 40 e2 ldi r20, 0x20 ; 32 1dabc: 80 e0 ldi r24, 0x00 ; 0 1dabe: 0e 94 91 69 call 0xd322 ; 0xd322 lcd_putc(LCD_STR_FOLDER[0]); 1dac2: 85 e8 ldi r24, 0x85 ; 133 1dac4: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 lcd_print_pad(longFilename, len); 1dac8: 62 e1 ldi r22, 0x12 ; 18 1daca: c5 01 movw r24, r10 1dacc: 0e 94 60 6b call 0xd6c0 ; 0xd6c0 1dad0: 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)) 1dad4: 90 91 2f 04 lds r25, 0x042F ; 0x80042f 1dad8: 99 23 and r25, r25 1dada: 09 f4 brne .+2 ; 0x1dade 1dadc: 90 c1 rjmp .+800 ; 0x1ddfe 1dade: 20 91 06 05 lds r18, 0x0506 ; 0x800506 1dae2: 30 91 07 05 lds r19, 0x0507 ; 0x800507 1dae6: 82 17 cp r24, r18 1dae8: 13 06 cpc r1, r19 1daea: 09 f0 breq .+2 ; 0x1daee 1daec: 88 c1 rjmp .+784 ; 0x1ddfe { lcd_update_enabled = false; 1daee: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c lcd_return_to_status(); } void menu_action_sddirectory(const char* filename) { card.chdir(filename, true); 1daf2: 61 e0 ldi r22, 0x01 ; 1 1daf4: 8c e6 ldi r24, 0x6C ; 108 1daf6: 93 e1 ldi r25, 0x13 ; 19 1daf8: 0f 94 8e 4b call 0x2971c ; 0x2971c lcd_encoder = 0; 1dafc: 10 92 07 05 sts 0x0507, r1 ; 0x800507 1db00: 10 92 06 05 sts 0x0506, r1 ; 0x800506 menu_data_reset(); //Forces reloading of cached variables. 1db04: 0f 94 9d 93 call 0x3273a ; 0x3273a } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 1db08: 00 93 5c 02 sts 0x025C, r16 ; 0x80025c menu_item_ret(); 1db0c: 0f 94 61 92 call 0x324c2 ; 0x324c2 1db10: 95 cf rjmp .-214 ; 0x1da3c 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); 1db12: 82 e0 ldi r24, 0x02 ; 2 1db14: 1b cf rjmp .-458 ; 0x1d94c _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()) 1db16: 0e 94 8e 6b call 0xd71c ; 0xd71c 1db1a: 81 11 cpse r24, r1 1db1c: 4f cf rjmp .-354 ; 0x1d9bc _md->menuState = _standard; } } break; default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } 1db1e: 2d 96 adiw r28, 0x0d ; 13 1db20: 0f b6 in r0, 0x3f ; 63 1db22: f8 94 cli 1db24: de bf out 0x3e, r29 ; 62 1db26: 0f be out 0x3f, r0 ; 63 1db28: cd bf out 0x3d, r28 ; 61 1db2a: df 91 pop r29 1db2c: cf 91 pop r28 1db2e: 1f 91 pop r17 1db30: 0f 91 pop r16 1db32: ff 90 pop r15 1db34: ef 90 pop r14 1db36: df 90 pop r13 1db38: cf 90 pop r12 1db3a: bf 90 pop r11 1db3c: af 90 pop r10 1db3e: 9f 90 pop r9 1db40: 8f 90 pop r8 1db42: 7f 90 pop r7 1db44: 6f 90 pop r6 1db46: 5f 90 pop r5 1db48: 4f 90 pop r4 1db4a: 3f 90 pop r3 1db4c: 2f 90 pop r2 1db4e: 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 1db50: 84 e1 ldi r24, 0x14 ; 20 1db52: 90 e4 ldi r25, 0x40 ; 64 1db54: 53 cf rjmp .-346 ; 0x1d9fc 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. 1db56: 64 ed ldi r22, 0xD4 ; 212 1db58: 7a eb ldi r23, 0xBA ; 186 1db5a: 8f ed ldi r24, 0xDF ; 223 1db5c: 92 e8 ldi r25, 0x82 ; 130 1db5e: 67 cf rjmp .-306 ; 0x1da2e menu_item++; } static void menu_item_sdfile(const char* str_fn, char* str_fnl) { if (lcd_draw_update) 1db60: 44 23 and r20, r20 1db62: d1 f0 breq .+52 ; 0x1db98 { lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1db64: 40 91 81 13 lds r20, 0x1381 ; 0x801381 1db68: 6c e6 ldi r22, 0x6C ; 108 1db6a: a6 2e mov r10, r22 1db6c: 63 e1 ldi r22, 0x13 ; 19 1db6e: b6 2e mov r11, r22 1db70: 44 23 and r20, r20 1db72: 21 f0 breq .+8 ; 0x1db7c 1db74: 51 e8 ldi r21, 0x81 ; 129 1db76: a5 2e mov r10, r21 1db78: 53 e1 ldi r21, 0x13 ; 19 1db7a: b5 2e mov r11, r21 1db7c: 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)?'>':' '); 1db80: 4e e3 ldi r20, 0x3E ; 62 1db82: 82 17 cp r24, r18 1db84: 93 07 cpc r25, r19 1db86: 09 f0 breq .+2 ; 0x1db8a 1db88: 40 e2 ldi r20, 0x20 ; 32 1db8a: 80 e0 ldi r24, 0x00 ; 0 1db8c: 0e 94 91 69 call 0xd322 ; 0xd322 lcd_print_pad(longFilename, len); 1db90: 63 e1 ldi r22, 0x13 ; 19 1db92: c5 01 movw r24, r10 1db94: 0e 94 60 6b call 0xd6c0 ; 0xd6c0 1db98: 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)) 1db9c: 90 91 2f 04 lds r25, 0x042F ; 0x80042f 1dba0: 99 23 and r25, r25 1dba2: 09 f4 brne .+2 ; 0x1dba6 1dba4: 2c c1 rjmp .+600 ; 0x1ddfe 1dba6: 20 91 06 05 lds r18, 0x0506 ; 0x800506 1dbaa: 30 91 07 05 lds r19, 0x0507 ; 0x800507 1dbae: 82 17 cp r24, r18 1dbb0: 13 06 cpc r1, r19 1dbb2: 09 f0 breq .+2 ; 0x1dbb6 1dbb4: 24 c1 rjmp .+584 ; 0x1ddfe { lcd_update_enabled = false; 1dbb6: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c return result; } static void menu_action_sdfile(const char* filename) { if(eFilamentAction != FilamentAction::None) return; 1dbba: 80 91 62 03 lds r24, 0x0362 ; 0x800362 1dbbe: 81 11 cpse r24, r1 1dbc0: a3 cf rjmp .-186 ; 0x1db08 // 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); 1dbc2: 6c e6 ldi r22, 0x6C ; 108 1dbc4: 73 e1 ldi r23, 0x13 ; 19 1dbc6: c7 01 movw r24, r14 1dbc8: 0f 94 06 a7 call 0x34e0c ; 0x34e0c 1dbcc: 47 01 movw r8, r14 1dbce: 45 e9 ldi r20, 0x95 ; 149 1dbd0: a4 2e mov r10, r20 1dbd2: 4f e0 ldi r20, 0x0F ; 15 1dbd4: 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] == '.') { 1dbd6: f4 01 movw r30, r8 1dbd8: 61 91 ld r22, Z+ 1dbda: 4f 01 movw r8, r30 1dbdc: 66 23 and r22, r22 1dbde: 19 f0 breq .+6 ; 0x1dbe6 1dbe0: 6e 32 cpi r22, 0x2E ; 46 1dbe2: 09 f0 breq .+2 ; 0x1dbe6 1dbe4: 4b c0 rjmp .+150 ; 0x1dc7c 1dbe6: 60 e0 ldi r22, 0x00 ; 0 1dbe8: c5 01 movw r24, r10 1dbea: 0f 94 bf a0 call 0x3417e ; 0x3417e 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, '.'); 1dbee: 6e e2 ldi r22, 0x2E ; 46 1dbf0: 70 e0 ldi r23, 0x00 ; 0 1dbf2: c7 01 movw r24, r14 1dbf4: 0f 94 f2 a6 call 0x34de4 ; 0x34de4 1dbf8: 3c 01 movw r6, r24 if (extension_ptr) { 1dbfa: 89 2b or r24, r25 1dbfc: 19 f0 breq .+6 ; 0x1dc04 extension_ptr++; // skip the '.' 1dbfe: 8f ef ldi r24, 0xFF ; 255 1dc00: 68 1a sub r6, r24 1dc02: 78 0a sbc r7, r24 1dc04: 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); 1dc06: 31 e9 ldi r19, 0x91 ; 145 1dc08: a3 2e mov r10, r19 1dc0a: 3c e0 ldi r19, 0x0C ; 12 1dc0c: 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') { 1dc0e: 61 14 cp r6, r1 1dc10: 71 04 cpc r7, r1 1dc12: 21 f0 breq .+8 ; 0x1dc1c 1dc14: f4 01 movw r30, r8 1dc16: 60 81 ld r22, Z 1dc18: 61 11 cpse r22, r1 1dc1a: 01 c0 rjmp .+2 ; 0x1dc1e 1dc1c: 60 e0 ldi r22, 0x00 ; 0 1dc1e: c5 01 movw r24, r10 1dc20: 0f 94 bf a0 call 0x3417e ; 0x3417e 1dc24: ff ef ldi r31, 0xFF ; 255 1dc26: af 1a sub r10, r31 1dc28: bf 0a sbc r11, r31 1dc2a: 2f ef ldi r18, 0xFF ; 255 1dc2c: 82 1a sub r8, r18 1dc2e: 92 0a sbc r9, r18 if (extension_ptr) { extension_ptr++; // skip the '.' } for (uint_least8_t i = 0; i < 3; i++) 1dc30: 84 e9 ldi r24, 0x94 ; 148 1dc32: a8 16 cp r10, r24 1dc34: 8c e0 ldi r24, 0x0C ; 12 1dc36: b8 06 cpc r11, r24 1dc38: 51 f7 brne .-44 ; 0x1dc0e { workDirParents[level].getFilename(name); } uint8_t CardReader::getWorkDirDepth() { return workDirDepth; 1dc3a: 60 90 0a 15 lds r6, 0x150A ; 0x80150a 1dc3e: 66 2d mov r22, r6 1dc40: 8a e5 ldi r24, 0x5A ; 90 1dc42: 9f e0 ldi r25, 0x0F ; 15 1dc44: 0f 94 bf a0 call 0x3417e ; 0x3417e 1dc48: 88 e6 ldi r24, 0x68 ; 104 1dc4a: 93 e1 ldi r25, 0x13 ; 19 1dc4c: 2a e0 ldi r18, 0x0A ; 10 1dc4e: a2 2e mov r10, r18 1dc50: 2f e0 ldi r18, 0x0F ; 15 1dc52: 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++) { 1dc54: 71 2c mov r7, r1 1dc56: 4c 01 movw r8, r24 1dc58: e9 e0 ldi r30, 0x09 ; 9 1dc5a: 8e 0e add r8, r30 1dc5c: 91 1c adc r9, r1 1dc5e: 76 14 cp r7, r6 1dc60: d1 f0 breq .+52 ; 0x1dc96 #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); 1dc62: 48 e0 ldi r20, 0x08 ; 8 1dc64: 50 e0 ldi r21, 0x00 ; 0 1dc66: b5 01 movw r22, r10 1dc68: 8e 5a subi r24, 0xAE ; 174 1dc6a: 9f 4f sbci r25, 0xFF ; 255 1dc6c: 0f 94 af a0 call 0x3415e ; 0x3415e 1dc70: 73 94 inc r7 1dc72: f8 e0 ldi r31, 0x08 ; 8 1dc74: af 0e add r10, r31 1dc76: b1 1c adc r11, r1 1dc78: c4 01 movw r24, r8 1dc7a: ed cf rjmp .-38 ; 0x1dc56 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1dc7c: c5 01 movw r24, r10 1dc7e: 0f 94 bf a0 call 0x3417e ; 0x3417e 1dc82: ff ef ldi r31, 0xFF ; 255 1dc84: af 1a sub r10, r31 1dc86: 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++) { 1dc88: 2d e9 ldi r18, 0x9D ; 157 1dc8a: a2 16 cp r10, r18 1dc8c: 2f e0 ldi r18, 0x0F ; 15 1dc8e: b2 06 cpc r11, r18 1dc90: 09 f0 breq .+2 ; 0x1dc94 1dc92: a1 cf rjmp .-190 ; 0x1dbd6 1dc94: ac cf rjmp .-168 ; 0x1dbee /** End of menus **/ /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; 1dc96: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1dc9a: 88 23 and r24, r24 1dc9c: 91 f0 breq .+36 ; 0x1dcc2 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); 1dc9e: ff 92 push r15 1dca0: ef 92 push r14 1dca2: 3f 92 push r3 1dca4: 2f 92 push r2 1dca6: 0e 94 4a 7d call 0xfa94 ; 0xfa94 enquecommand_P(MSG_M24); 1dcaa: 61 e0 ldi r22, 0x01 ; 1 1dcac: 85 ee ldi r24, 0xE5 ; 229 1dcae: 9b e6 ldi r25, 0x6B ; 107 1dcb0: 0e 94 ac 7c call 0xf958 ; 0xf958 1dcb4: 0f 90 pop r0 1dcb6: 0f 90 pop r0 1dcb8: 0f 90 pop r0 1dcba: 0f 90 pop r0 } lcd_return_to_status(); 1dcbc: 0e 94 6d fe call 0x1fcda ; 0x1fcda 1dcc0: 23 cf rjmp .-442 ; 0x1db08 /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; card.openFileReadFilteredGcode(filename, true); 1dcc2: 61 e0 ldi r22, 0x01 ; 1 1dcc4: c7 01 movw r24, r14 1dcc6: 0f 94 c5 4c call 0x2998a ; 0x2998a } uint32_t CardReader::getFileSize() { return filesize; 1dcca: 40 90 77 16 lds r4, 0x1677 ; 0x801677 1dcce: 50 90 78 16 lds r5, 0x1678 ; 0x801678 1dcd2: 60 90 79 16 lds r6, 0x1679 ; 0x801679 1dcd6: 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); 1dcda: 94 2d mov r25, r4 1dcdc: 85 2d mov r24, r5 1dcde: 21 e0 ldi r18, 0x01 ; 1 1dce0: 42 16 cp r4, r18 1dce2: 28 e7 ldi r18, 0x78 ; 120 1dce4: 52 06 cpc r5, r18 1dce6: 61 04 cpc r6, r1 1dce8: 71 04 cpc r7, r1 1dcea: 10 f0 brcs .+4 ; 0x1dcf0 1dcec: 90 e0 ldi r25, 0x00 ; 0 1dcee: 88 e7 ldi r24, 0x78 ; 120 1dcf0: a9 2e mov r10, r25 1dcf2: b8 2e mov r11, r24 if (filesize > END_FILE_SECTION) { 1dcf4: 81 e0 ldi r24, 0x01 ; 1 1dcf6: 48 16 cp r4, r24 1dcf8: 88 e7 ldi r24, 0x78 ; 120 1dcfa: 58 06 cpc r5, r24 1dcfc: 61 04 cpc r6, r1 1dcfe: 71 04 cpc r7, r1 1dd00: 08 f4 brcc .+2 ; 0x1dd04 1dd02: 5d c0 rjmp .+186 ; 0x1ddbe startPos = filesize - END_FILE_SECTION; 1dd04: 98 e7 ldi r25, 0x78 ; 120 1dd06: 59 1a sub r5, r25 1dd08: 61 08 sbc r6, r1 1dd0a: 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);}; 1dd0c: 40 92 7e 16 sts 0x167E, r4 ; 0x80167e 1dd10: 50 92 7f 16 sts 0x167F, r5 ; 0x80167f 1dd14: 60 92 80 16 sts 0x1680, r6 ; 0x801680 1dd18: 70 92 81 16 sts 0x1681, r7 ; 0x801681 1dd1c: c3 01 movw r24, r6 1dd1e: b2 01 movw r22, r4 1dd20: 0f 94 b5 44 call 0x2896a ; 0x2896a card.setIndex(startPos); } cmdqueue_reset(); 1dd24: 0e 94 16 73 call 0xe62c ; 0xe62c cmdqueue_serial_disabled = true; 1dd28: 00 93 61 03 sts 0x0361, r16 ; 0x800361 menu_progressbar_init(bytesToCheck, _T(MSG_CHECKING_FILE)); 1dd2c: 8a ec ldi r24, 0xCA ; 202 1dd2e: 9d e3 ldi r25, 0x3D ; 61 1dd30: 0e 94 a7 6c call 0xd94e ; 0xd94e 1dd34: bc 01 movw r22, r24 1dd36: c5 01 movw r24, r10 1dd38: 0f 94 dd 91 call 0x323ba ; 0x323ba 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; } 1dd3c: 80 91 7e 16 lds r24, 0x167E ; 0x80167e 1dd40: 90 91 7f 16 lds r25, 0x167F ; 0x80167f 1dd44: a0 91 80 16 lds r26, 0x1680 ; 0x801680 1dd48: b0 91 81 16 lds r27, 0x1681 ; 0x801681 while (!card.eof() && !result) { 1dd4c: 40 91 77 16 lds r20, 0x1677 ; 0x801677 1dd50: 50 91 78 16 lds r21, 0x1678 ; 0x801678 1dd54: 60 91 79 16 lds r22, 0x1679 ; 0x801679 1dd58: 70 91 7a 16 lds r23, 0x167A ; 0x80167a 1dd5c: 84 17 cp r24, r20 1dd5e: 95 07 cpc r25, r21 1dd60: a6 07 cpc r26, r22 1dd62: b7 07 cpc r27, r23 1dd64: 80 f5 brcc .+96 ; 0x1ddc6 1dd66: 11 11 cpse r17, r1 1dd68: 2e c0 rjmp .+92 ; 0x1ddc6 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); }; 1dd6a: 20 91 fd 15 lds r18, 0x15FD ; 0x8015fd 1dd6e: 21 11 cpse r18, r1 1dd70: 03 c0 rjmp .+6 ; 0x1dd78 1dd72: 80 e0 ldi r24, 0x00 ; 0 1dd74: 90 e0 ldi r25, 0x00 ; 0 1dd76: dc 01 movw r26, r24 menu_progressbar_update(card.get_sdpos() - startPos); 1dd78: 84 19 sub r24, r4 1dd7a: 95 09 sbc r25, r5 1dd7c: 0f 94 ae 91 call 0x3235c ; 0x3235c card.sdprinting = true; 1dd80: 00 93 6a 13 sts 0x136A, r16 ; 0x80136a get_command(); 1dd84: 0e 94 6f 75 call 0xeade ; 0xeade #endif // LIN_ADVANCE bool check_commands() { bool end_command_found = false; while (buflen) 1dd88: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 1dd8c: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 1dd90: 89 2b or r24, r25 1dd92: a1 f2 breq .-88 ; 0x1dd3c { if ((code_seen_P(MSG_M84)) || (code_seen_P(PSTR("M 84")))) end_command_found = true; 1dd94: 8f ec ldi r24, 0xCF ; 207 1dd96: 97 e6 ldi r25, 0x67 ; 103 1dd98: 0f 94 10 75 call 0x2ea20 ; 0x2ea20 1dd9c: 81 11 cpse r24, r1 1dd9e: 05 c0 rjmp .+10 ; 0x1ddaa 1dda0: 8a ed ldi r24, 0xDA ; 218 1dda2: 92 e8 ldi r25, 0x82 ; 130 1dda4: 0f 94 10 75 call 0x2ea20 ; 0x2ea20 1dda8: 81 11 cpse r24, r1 1ddaa: 11 e0 ldi r17, 0x01 ; 1 if (!cmdbuffer_front_already_processed) 1ddac: 80 91 e6 11 lds r24, 0x11E6 ; 0x8011e6 1ddb0: 81 11 cpse r24, r1 1ddb2: 02 c0 rjmp .+4 ; 0x1ddb8 cmdqueue_pop_front(); 1ddb4: 0e 94 c9 6f call 0xdf92 ; 0xdf92 cmdbuffer_front_already_processed = false; 1ddb8: 10 92 e6 11 sts 0x11E6, r1 ; 0x8011e6 1ddbc: e5 cf rjmp .-54 ; 0x1dd88 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; 1ddbe: 41 2c mov r4, r1 1ddc0: 51 2c mov r5, r1 1ddc2: 32 01 movw r6, r4 1ddc4: af cf rjmp .-162 ; 0x1dd24 // with the CMDBUFFER_DEBUG enabled manage_heater(); #endif // CMDBUFFER_DEBUG } menu_progressbar_finish(); 1ddc6: 0f 94 cf 91 call 0x3239e ; 0x3239e cmdqueue_serial_disabled = false; 1ddca: 10 92 61 03 sts 0x0361, r1 ; 0x800361 card.printingHasFinished(); 1ddce: 0f 94 fd 4d call 0x29bfa ; 0x29bfa lcd_setstatuspgm(MSG_WELCOME); 1ddd2: 87 e6 ldi r24, 0x67 ; 103 1ddd4: 9b e6 ldi r25, 0x6B ; 107 1ddd6: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 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)) { 1ddda: 11 11 cpse r17, r1 1dddc: 60 cf rjmp .-320 ; 0x1dc9e result = !lcd_show_multiscreen_message_cont_cancel_and_wait_P(_T(MSG_FILE_INCOMPLETE), false); 1ddde: 8a ed ldi r24, 0xDA ; 218 1dde0: 9d e3 ldi r25, 0x3D ; 61 1dde2: 0e 94 a7 6c call 0xd94e ; 0xd94e 1dde6: 41 e0 ldi r20, 0x01 ; 1 1dde8: 60 e0 ldi r22, 0x00 ; 0 1ddea: 0f 94 61 2e call 0x25cc2 ; 0x25cc2 1ddee: 18 2f mov r17, r24 lcd_update_enable(true); 1ddf0: 81 e0 ldi r24, 0x01 ; 1 1ddf2: 0e 94 b6 69 call 0xd36c ; 0xd36c } if (result) { 1ddf6: 11 23 and r17, r17 1ddf8: 09 f4 brne .+2 ; 0x1ddfc 1ddfa: 51 cf rjmp .-350 ; 0x1dc9e 1ddfc: 5f cf rjmp .-322 ; 0x1dcbc lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); } void menu_item_dummy(void) { menu_item++; 1ddfe: 8f 5f subi r24, 0xFF ; 255 1de00: 80 93 31 04 sts 0x0431, r24 ; 0x800431 1de04: 1b ce rjmp .-970 ; 0x1da3c else MENU_ITEM_SDFILE(card.filename, card.longFilename); } else MENU_ITEM_DUMMY(); //dummy item that just increments the internal menu counters. } MENU_END(); 1de06: 0f 94 4f 93 call 0x3269e ; 0x3269e _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(); 1de0a: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1de0e: 8f 5f subi r24, 0xFF ; 255 1de10: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1de14: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1de18: 8f 5f subi r24, 0xFF ; 255 1de1a: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1de1e: e0 cd rjmp .-1088 ; 0x1d9e0 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. 1de20: 80 91 63 03 lds r24, 0x0363 ; 0x800363 1de24: 11 e0 ldi r17, 0x01 ; 1 1de26: 81 11 cpse r24, r1 1de28: 05 c0 rjmp .+10 ; 0x1de34 1de2a: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 1de2e: 81 11 cpse r24, r1 1de30: 01 c0 rjmp .+2 ; 0x1de34 1de32: 10 e0 ldi r17, 0x00 ; 0 if (_md->scrollPointer == NULL) 1de34: 80 91 67 03 lds r24, 0x0367 ; 0x800367 1de38: 90 91 68 03 lds r25, 0x0368 ; 0x800368 1de3c: 89 2b or r24, r25 1de3e: 91 f4 brne .+36 ; 0x1de64 { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(_md->selectedFileID, _md->sdSort); 1de40: 60 91 6e 03 lds r22, 0x036E ; 0x80036e 1de44: 80 91 69 03 lds r24, 0x0369 ; 0x800369 1de48: 90 91 6a 03 lds r25, 0x036A ; 0x80036a 1de4c: 0f 94 7b 52 call 0x2a4f6 ; 0x2a4f6 #else card.getfilename(_md->selectedFileID); #endif _md->scrollPointer = (card.longFilename[0] == '\0') ? card.filename : card.longFilename; 1de50: 80 91 81 13 lds r24, 0x1381 ; 0x801381 1de54: 81 11 cpse r24, r1 1de56: 46 c0 rjmp .+140 ; 0x1dee4 1de58: 8c e6 ldi r24, 0x6C ; 108 1de5a: 93 e1 ldi r25, 0x13 ; 19 1de5c: 90 93 68 03 sts 0x0368, r25 ; 0x800368 1de60: 80 93 67 03 sts 0x0367, r24 ; 0x800367 } if (rewindFlag) 1de64: 11 11 cpse r17, r1 _md->offset = 0; //redraw once again from the beginning. 1de66: 10 92 65 03 sts 0x0365, r1 ; 0x800365 if (_md->lcd_scrollTimer.expired(300) || rewindFlag) 1de6a: 6c e2 ldi r22, 0x2C ; 44 1de6c: 71 e0 ldi r23, 0x01 ; 1 1de6e: 8f e6 ldi r24, 0x6F ; 111 1de70: 93 e0 ldi r25, 0x03 ; 3 1de72: 0f 94 2f 10 call 0x2205e ; 0x2205e ::expired(unsigned short)> 1de76: 81 11 cpse r24, r1 1de78: 03 c0 rjmp .+6 ; 0x1de80 1de7a: 11 23 and r17, r17 1de7c: 09 f4 brne .+2 ; 0x1de80 1de7e: 4f ce rjmp .-866 ; 0x1db1e { uint8_t len = LCD_WIDTH - ((_md->isDir)? 2 : 1); 1de80: 80 91 66 03 lds r24, 0x0366 ; 0x800366 1de84: 02 e1 ldi r16, 0x12 ; 18 1de86: 81 11 cpse r24, r1 1de88: 01 c0 rjmp .+2 ; 0x1de8c 1de8a: 03 e1 ldi r16, 0x13 ; 19 lcd_putc_at(0, _md->row, '>'); 1de8c: 4e e3 ldi r20, 0x3E ; 62 1de8e: 60 91 6d 03 lds r22, 0x036D ; 0x80036d 1de92: 80 e0 ldi r24, 0x00 ; 0 1de94: 0e 94 91 69 call 0xd322 ; 0xd322 if (_md->isDir) 1de98: 80 91 66 03 lds r24, 0x0366 ; 0x800366 1de9c: 88 23 and r24, r24 1de9e: 19 f0 breq .+6 ; 0x1dea6 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 1dea0: 85 e8 ldi r24, 0x85 ; 133 1dea2: 0e 94 20 6a call 0xd440 ; 0xd440 lcd_print(LCD_STR_FOLDER[0]); if( lcd_print_pad(&_md->scrollPointer[_md->offset], len) == 0) 1dea6: 20 91 65 03 lds r18, 0x0365 ; 0x800365 1deaa: 80 91 67 03 lds r24, 0x0367 ; 0x800367 1deae: 90 91 68 03 lds r25, 0x0368 ; 0x800368 1deb2: 60 2f mov r22, r16 1deb4: 82 0f add r24, r18 1deb6: 91 1d adc r25, r1 1deb8: 0e 94 60 6b call 0xd6c0 ; 0xd6c0 1debc: 81 11 cpse r24, r1 1debe: 15 c0 rjmp .+42 ; 0x1deea { _md->lcd_scrollTimer.start(); 1dec0: 8f e6 ldi r24, 0x6F ; 111 1dec2: 93 e0 ldi r25, 0x03 ; 3 1dec4: 0f 94 5e 10 call 0x220bc ; 0x220bc ::start()> _md->offset++; 1dec8: 80 91 65 03 lds r24, 0x0365 ; 0x800365 1decc: 8f 5f subi r24, 0xFF ; 255 1dece: 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. 1ded2: 11 23 and r17, r17 1ded4: 09 f4 brne .+2 ; 0x1ded8 1ded6: 23 ce rjmp .-954 ; 0x1db1e 1ded8: 10 92 6f 03 sts 0x036F, r1 ; 0x80036f { _md->lcd_scrollTimer.stop(); //forces redraw in _standard state _md->menuState = _standard; 1dedc: 81 e0 ldi r24, 0x01 ; 1 1dede: 80 93 64 03 sts 0x0364, r24 ; 0x800364 1dee2: 1d ce rjmp .-966 ; 0x1db1e #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; 1dee4: 81 e8 ldi r24, 0x81 ; 129 1dee6: 93 e1 ldi r25, 0x13 ; 19 1dee8: b9 cf rjmp .-142 ; 0x1de5c 1deea: 10 92 6f 03 sts 0x036F, r1 ; 0x80036f 1deee: f1 cf rjmp .-30 ; 0x1ded2 0001def0 : } #endif /* DEBUG_STEPPER_TIMER_MISSED */ static void lcd_colorprint_change() { enquecommand_P(MSG_M600); 1def0: 61 e0 ldi r22, 0x01 ; 1 1def2: 8b e7 ldi r24, 0x7B ; 123 1def4: 9b e6 ldi r25, 0x6B ; 107 1def6: 0e 94 ac 7c call 0xf958 ; 0xf958 custom_message_type = CustomMsg::FilamentLoading; //just print status message 1defa: 82 e0 ldi r24, 0x02 ; 2 1defc: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1df00: 8b eb ldi r24, 0xBB ; 187 1df02: 96 e5 ldi r25, 0x56 ; 86 1df04: 0e 94 a7 6c call 0xd94e ; 0xd94e 1df08: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 lcd_return_to_status(); 1df0c: 0e 94 6d fe call 0x1fcda ; 0x1fcda lcd_draw_update = 3; 1df10: 83 e0 ldi r24, 0x03 ; 3 1df12: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } 1df16: 08 95 ret 0001df18 : //! @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; 1df18: 0e 94 4d e6 call 0x1cc9a ; 0x1cc9a 1df1c: 88 23 and r24, r24 1df1e: 51 f1 breq .+84 ; 0x1df74 cmdqueue_serial_disabled = false; 1df20: 10 92 61 03 sts 0x0361, r1 ; 0x800361 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1df24: 8b eb ldi r24, 0xBB ; 187 1df26: 96 e5 ldi r25, 0x56 ; 86 1df28: 0e 94 a7 6c call 0xd94e ; 0xd94e 1df2c: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 st_synchronize(); 1df30: 0f 94 ce 22 call 0x2459c ; 0x2459c custom_message_type = CustomMsg::Resuming; 1df34: 88 e0 ldi r24, 0x08 ; 8 1df36: 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(); 1df3a: 0e 94 28 6e call 0xdc50 ; 0xdc50 setExtruderAutoFanState(1); 1df3e: 81 e0 ldi r24, 0x01 ; 1 1df40: 0e 94 35 6e call 0xdc6a ; 0xdc6a // resume processing USB commands again and restore hotend fan state (in case the print was // stopped due to a thermal error) hotendDefaultAutoFanState(); Stopped = false; 1df44: 10 92 ce 11 sts 0x11CE, r1 ; 0x8011ce restore_print_from_ram_and_continue(default_retraction); 1df48: 60 e0 ldi r22, 0x00 ; 0 1df4a: 70 e0 ldi r23, 0x00 ; 0 1df4c: 80 e8 ldi r24, 0x80 ; 128 1df4e: 9f e3 ldi r25, 0x3F ; 63 1df50: 0e 94 36 61 call 0xc26c ; 0xc26c did_pause_print = false; 1df54: 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(); 1df58: 80 91 59 03 lds r24, 0x0359 ; 0x800359 1df5c: 82 30 cpi r24, 0x02 ; 2 1df5e: 11 f4 brne .+4 ; 0x1df64 1df60: 0f 94 e2 20 call 0x241c4 ; 0x241c4 refresh_cmd_timeout(); 1df64: 0e 94 bf 5f call 0xbf7e ; 0xbf7e SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_RESUMED); 1df68: 8c e7 ldi r24, 0x7C ; 124 1df6a: 97 e6 ldi r25, 0x67 ; 103 1df6c: 0e 94 49 72 call 0xe492 ; 0xe492 custom_message_type = CustomMsg::Status; 1df70: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 } 1df74: 08 95 ret 0001df76 : // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; } void lcd_setstatus(const char* message) { 1df76: cf 93 push r28 1df78: df 93 push r29 1df7a: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1df7c: 80 e0 ldi r24, 0x00 ; 0 1df7e: 0e 94 1f e2 call 0x1c43e ; 0x1c43e 1df82: 88 23 and r24, r24 1df84: 31 f0 breq .+12 ; 0x1df92 lcd_updatestatus(message); 1df86: 60 e0 ldi r22, 0x00 ; 0 1df88: ce 01 movw r24, r28 } 1df8a: df 91 pop r29 1df8c: cf 91 pop r28 } void lcd_setstatus(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); 1df8e: 0c 94 04 e2 jmp 0x1c408 ; 0x1c408 } 1df92: df 91 pop r29 1df94: cf 91 pop r28 1df96: 08 95 ret 0001df98 : 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) { 1df98: cf 93 push r28 1df9a: df 93 push r29 1df9c: c8 2f mov r28, r24 softReset(); } void UnconditionalStop() { CRITICAL_SECTION_START; 1df9e: 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) { 1dfa0: 66 23 and r22, r22 1dfa2: 89 f1 breq .+98 ; 0x1e006 1dfa4: f8 94 cli // Disable all heaters and unroll the temperature wait loop stack disable_heater(); 1dfa6: 0f 94 e7 12 call 0x225ce ; 0x225ce cancel_heatup = true; 1dfaa: 81 e0 ldi r24, 0x01 ; 1 1dfac: 80 93 c9 0d sts 0x0DC9, r24 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.377> heating_status = HeatingStatus::NO_HEATING; 1dfb0: 10 92 99 03 sts 0x0399, r1 ; 0x800399 // Clear any saved printing state cancel_saved_printing(); 1dfb4: 0e 94 85 5e call 0xbd0a ; 0xbd0a // Abort the planner planner_abort_hard(); 1dfb8: 0f 94 a9 86 call 0x30d52 ; 0x30d52 // Reset the queue cmdqueue_reset(); 1dfbc: 0e 94 16 73 call 0xe62c ; 0xe62c cmdqueue_serial_disabled = false; 1dfc0: 10 92 61 03 sts 0x0361, r1 ; 0x800361 st_reset_timer(); 1dfc4: 0f 94 da 22 call 0x245b4 ; 0x245b4 CRITICAL_SECTION_END; 1dfc8: df bf out 0x3f, r29 ; 63 // clear paused state immediately did_pause_print = false; 1dfca: 10 92 9b 03 sts 0x039B, r1 ; 0x80039b print_job_timer.stop(); 1dfce: 0f 94 06 21 call 0x2420c ; 0x2420c } else { // Allow lcd_print_stop_finish() to use the heaters when it is safe ConditionalStop(); } if (card.isFileOpen()) { 1dfd2: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 1dfd6: 88 23 and r24, r24 1dfd8: 21 f0 breq .+8 ; 0x1dfe2 // Reset the sd status card.sdprinting = false; 1dfda: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a card.closefile(); 1dfde: 0f 94 9c 42 call 0x28538 ; 0x28538 } SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_CANCEL); 1dfe2: 8f eb ldi r24, 0xBF ; 191 1dfe4: 97 e6 ldi r25, 0x67 ; 103 1dfe6: 0e 94 49 72 call 0xe492 ; 0xe492 #ifdef MESH_BED_LEVELING mbl.active = false; 1dfea: 10 92 9c 12 sts 0x129C, r1 ; 0x80129c #endif if (interactive) { 1dfee: c1 11 cpse r28, r1 // acknowledged by the user from the LCD: resume processing USB commands again Stopped = false; 1dff0: 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; 1dff4: 81 e0 ldi r24, 0x01 ; 1 1dff6: 80 93 c8 0d sts 0x0DC8, r24 ; 0x800dc8 1dffa: 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(); } 1dffe: df 91 pop r29 1e000: 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(); 1e002: 0c 94 6d fe jmp 0x1fcda ; 0x1fcda } void ConditionalStop() { CRITICAL_SECTION_START; 1e006: 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; 1e008: 81 e0 ldi r24, 0x01 ; 1 1e00a: 80 93 c9 0d sts 0x0DC9, r24 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.377> heating_status = HeatingStatus::NO_HEATING; 1e00e: 10 92 99 03 sts 0x0399, r1 ; 0x800399 // Clear any saved printing state cancel_saved_printing(); 1e012: 0e 94 85 5e call 0xbd0a ; 0xbd0a // Abort the planner planner_abort_hard(); 1e016: 0f 94 a9 86 call 0x30d52 ; 0x30d52 // Reset the queue cmdqueue_reset(); 1e01a: 0e 94 16 73 call 0xe62c ; 0xe62c cmdqueue_serial_disabled = false; 1e01e: 10 92 61 03 sts 0x0361, r1 ; 0x800361 st_reset_timer(); 1e022: 0f 94 da 22 call 0x245b4 ; 0x245b4 CRITICAL_SECTION_END; 1e026: df bf out 0x3f, r29 ; 63 1e028: d4 cf rjmp .-88 ; 0x1dfd2 0001e02a : } void lcd_print_stop() { print_stop(true); 1e02a: 60 e0 ldi r22, 0x00 ; 0 1e02c: 81 e0 ldi r24, 0x01 ; 1 1e02e: 0c 94 cc ef jmp 0x1df98 ; 0x1df98 0001e032 : 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' 1e032: 41 30 cpi r20, 0x01 ; 1 1e034: 41 f4 brne .+16 ; 0x1e046 if (lcd_show_multiscreen_message_cont_cancel_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) { 1e036: 40 e0 ldi r20, 0x00 ; 0 1e038: 61 e0 ldi r22, 0x01 ; 1 1e03a: 0f 94 61 2e call 0x25cc2 ; 0x25cc2 1e03e: 81 30 cpi r24, 0x01 ; 1 1e040: 41 f4 brne .+16 ; 0x1e052 lcd_print_stop(); } } else if (check == 2) { // Strict, always stop print lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); 1e042: 0c 94 15 f0 jmp 0x1e02a ; 0x1e02a { 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 1e046: 42 30 cpi r20, 0x02 ; 2 1e048: 21 f4 brne .+8 ; 0x1e052 lcd_show_fullscreen_message_and_wait_P(strict); 1e04a: cb 01 movw r24, r22 1e04c: 0f 94 a9 0b call 0x21752 ; 0x21752 1e050: f8 cf rjmp .-16 ; 0x1e042 lcd_print_stop(); } } 1e052: 08 95 ret 0001e054 : ,_T(MSG_GCODE_NEWER_FIRMWARE_CANCELLED) ,(uint8_t)oCheckVersion ); } bool filament_presence_check() { 1e054: 0f 93 push r16 1e056: 1f 93 push r17 1e058: 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)) { 1e05a: 8c ea ldi r24, 0xAC ; 172 1e05c: 9c e0 ldi r25, 0x0C ; 12 1e05e: 0f 94 9b a0 call 0x34136 ; 0x34136 1e062: 88 23 and r24, r24 1e064: 29 f0 breq .+10 ; 0x1e070 return false; } } done: return true; 1e066: 81 e0 ldi r24, 0x01 ; 1 } 1e068: cf 91 pop r28 1e06a: 1f 91 pop r17 1e06c: 0f 91 pop r16 1e06e: 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()) { 1e070: 80 91 84 16 lds r24, 0x1684 ; 0x801684 1e074: 88 23 and r24, r24 1e076: b9 f3 breq .-18 ; 0x1e066 1e078: 0e 94 f9 c3 call 0x187f2 ; 0x187f2 1e07c: 81 11 cpse r24, r1 1e07e: f3 cf rjmp .-26 ; 0x1e066 if (oCheckFilament == ClCheckMode::_None) { 1e080: c0 91 bc 03 lds r28, 0x03BC ; 0x8003bc 1e084: cc 23 and r28, r28 1e086: 79 f3 breq .-34 ; 0x1e066 goto done; } render_M862_warnings( 1e088: 8e e9 ldi r24, 0x9E ; 158 1e08a: 91 e4 ldi r25, 0x41 ; 65 1e08c: 0e 94 a7 6c call 0xd94e ; 0xd94e 1e090: 8c 01 movw r16, r24 1e092: 8e e9 ldi r24, 0x9E ; 158 1e094: 91 e4 ldi r25, 0x41 ; 65 1e096: 0e 94 a7 6c call 0xd94e ; 0xd94e 1e09a: 4c 2f mov r20, r28 1e09c: b8 01 movw r22, r16 1e09e: 0e 94 19 f0 call 0x1e032 ; 0x1e032 _T(MSG_MISSING_FILAMENT) ,_T(MSG_MISSING_FILAMENT) //Identical messages ,(uint8_t)oCheckFilament ); if (lcd_commands_type == LcdCommands::StopPrint) { 1e0a2: 81 e0 ldi r24, 0x01 ; 1 1e0a4: 90 91 c8 0d lds r25, 0x0DC8 ; 0x800dc8 1e0a8: 91 30 cpi r25, 0x01 ; 1 1e0aa: f1 f6 brne .-68 ; 0x1e068 1e0ac: 80 e0 ldi r24, 0x00 ; 0 1e0ae: dc cf rjmp .-72 ; 0x1e068 0001e0b0 : lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); } } void nozzle_diameter_check(uint16_t nDiameter) { 1e0b0: 1f 93 push r17 1e0b2: cf 93 push r28 1e0b4: df 93 push r29 uint16_t nDiameter_um; if (oCheckMode == ClCheckMode::_None) 1e0b6: 10 91 bb 03 lds r17, 0x03BB ; 0x8003bb 1e0ba: 11 23 and r17, r17 1e0bc: 19 f1 breq .+70 ; 0x1e104 1e0be: ec 01 movw r28, r24 return; nDiameter_um = eeprom_read_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM); 1e0c0: 85 ea ldi r24, 0xA5 ; 165 1e0c2: 9d e0 ldi r25, 0x0D ; 13 1e0c4: 0f 94 a9 a0 call 0x34152 ; 0x34152 if (nDiameter == nDiameter_um) 1e0c8: 8c 17 cp r24, r28 1e0ca: 9d 07 cpc r25, r29 1e0cc: d9 f0 breq .+54 ; 0x1e104 // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN((float)(nDiameter_um/1000.0)); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN((float)(nDiameter/1000.0)); render_M862_warnings( 1e0ce: 8f e4 ldi r24, 0x4F ; 79 1e0d0: 91 e4 ldi r25, 0x41 ; 65 1e0d2: 0e 94 a7 6c call 0xd94e ; 0xd94e 1e0d6: ec 01 movw r28, r24 1e0d8: 84 e2 ldi r24, 0x24 ; 36 1e0da: 91 e4 ldi r25, 0x41 ; 65 1e0dc: 0e 94 a7 6c call 0xd94e ; 0xd94e 1e0e0: 41 2f mov r20, r17 1e0e2: be 01 movw r22, r28 1e0e4: 0e 94 19 f0 call 0x1e032 ; 0x1e032 _T(MSG_NOZZLE_DIFFERS_CONTINUE) ,_T(MSG_NOZZLE_DIFFERS_CANCELLED) ,(uint8_t)oCheckMode ); if (!farm_mode) { 1e0e8: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 1e0ec: 81 11 cpse r24, r1 1e0ee: 0a c0 rjmp .+20 ; 0x1e104 bSettings = false; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 1e0f0: 10 92 ba 03 sts 0x03BA, r1 ; 0x8003ba menu_submenu(lcd_hw_setup_menu); 1e0f4: 60 e0 ldi r22, 0x00 ; 0 1e0f6: 82 eb ldi r24, 0xB2 ; 178 1e0f8: 93 eb ldi r25, 0xB3 ; 179 } } 1e0fa: df 91 pop r29 1e0fc: cf 91 pop r28 1e0fe: 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); 1e100: 0d 94 e8 94 jmp 0x329d0 ; 0x329d0 } } 1e104: df 91 pop r29 1e106: cf 91 pop r28 1e108: 1f 91 pop r17 1e10a: 08 95 ret 0001e10c : } /// @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) { 1e10c: cf 92 push r12 1e10e: df 92 push r13 1e110: ef 92 push r14 1e112: ff 92 push r15 1e114: cf 93 push r28 1e116: 6b 01 movw r12, r22 1e118: 7c 01 movw r14, r24 custom_message_type = CustomMsg::FilamentLoading; 1e11a: 82 e0 ldi r24, 0x02 ; 2 1e11c: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 lcd_setstatuspgm(_T(MSG_UNLOADING_FILAMENT)); 1e120: 8e e5 ldi r24, 0x5E ; 94 1e122: 96 e5 ldi r25, 0x56 ; 86 1e124: 0e 94 a7 6c call 0xd94e ; 0xd94e 1e128: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 1e12c: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1e130: 10 92 85 16 sts 0x1685, r1 ; 0x801685 FSensorBlockRunout fsBlockRunout; current_position[E_AXIS] -= FILAMENT_UNLOAD_FAST_RETRACT_LENGTH; 1e134: 20 e0 ldi r18, 0x00 ; 0 1e136: 30 e0 ldi r19, 0x00 ; 0 1e138: 44 e3 ldi r20, 0x34 ; 52 1e13a: 52 e4 ldi r21, 0x42 ; 66 1e13c: 60 91 01 12 lds r22, 0x1201 ; 0x801201 1e140: 70 91 02 12 lds r23, 0x1202 ; 0x801202 1e144: 80 91 03 12 lds r24, 0x1203 ; 0x801203 1e148: 90 91 04 12 lds r25, 0x1204 ; 0x801204 1e14c: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1e150: 60 93 01 12 sts 0x1201, r22 ; 0x801201 1e154: 70 93 02 12 sts 0x1202, r23 ; 0x801202 1e158: 80 93 03 12 sts 0x1203, r24 ; 0x801203 1e15c: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_FAST_RETRACT_FEEDRATE); 1e160: 6a e0 ldi r22, 0x0A ; 10 1e162: 77 e5 ldi r23, 0x57 ; 87 1e164: 8d ea ldi r24, 0xAD ; 173 1e166: 92 e4 ldi r25, 0x42 ; 66 1e168: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 1e16c: 0f 94 ce 22 call 0x2459c ; 0x2459c current_position[E_AXIS] -= FILAMENT_UNLOAD_SLOW_RETRACT_LENGTH; 1e170: 20 e0 ldi r18, 0x00 ; 0 1e172: 30 e0 ldi r19, 0x00 ; 0 1e174: 4c e0 ldi r20, 0x0C ; 12 1e176: 52 e4 ldi r21, 0x42 ; 66 1e178: 60 91 01 12 lds r22, 0x1201 ; 0x801201 1e17c: 70 91 02 12 lds r23, 0x1202 ; 0x801202 1e180: 80 91 03 12 lds r24, 0x1203 ; 0x801203 1e184: 90 91 04 12 lds r25, 0x1204 ; 0x801204 1e188: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1e18c: 60 93 01 12 sts 0x1201, r22 ; 0x801201 1e190: 70 93 02 12 sts 0x1202, r23 ; 0x801202 1e194: 80 93 03 12 sts 0x1203, r24 ; 0x801203 1e198: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_SLOW_RETRACT_FEEDRATE); 1e19c: 69 e2 ldi r22, 0x29 ; 41 1e19e: 7c e5 ldi r23, 0x5C ; 92 1e1a0: 85 e8 ldi r24, 0x85 ; 133 1e1a2: 91 e4 ldi r25, 0x41 ; 65 1e1a4: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 1e1a8: 0f 94 ce 22 call 0x2459c ; 0x2459c // Configurable length, by default it's 0. // only plan the move if the length is set to a non-zero value if (unloadLength) 1e1ac: 20 e0 ldi r18, 0x00 ; 0 1e1ae: 30 e0 ldi r19, 0x00 ; 0 1e1b0: a9 01 movw r20, r18 1e1b2: c7 01 movw r24, r14 1e1b4: b6 01 movw r22, r12 1e1b6: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1e1ba: 88 23 and r24, r24 1e1bc: e1 f0 breq .+56 ; 0x1e1f6 { current_position[E_AXIS] += unloadLength; 1e1be: a7 01 movw r20, r14 1e1c0: 96 01 movw r18, r12 1e1c2: 60 91 01 12 lds r22, 0x1201 ; 0x801201 1e1c6: 70 91 02 12 lds r23, 0x1202 ; 0x801202 1e1ca: 80 91 03 12 lds r24, 0x1203 ; 0x801203 1e1ce: 90 91 04 12 lds r25, 0x1204 ; 0x801204 1e1d2: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1e1d6: 60 93 01 12 sts 0x1201, r22 ; 0x801201 1e1da: 70 93 02 12 sts 0x1202, r23 ; 0x801202 1e1de: 80 93 03 12 sts 0x1203, r24 ; 0x801203 1e1e2: 90 93 04 12 sts 0x1204, r25 ; 0x801204 plan_buffer_line_curposXYZE(FILAMENT_CHANGE_UNLOAD_FEEDRATE); 1e1e6: 60 e0 ldi r22, 0x00 ; 0 1e1e8: 70 e0 ldi r23, 0x00 ; 0 1e1ea: 80 e2 ldi r24, 0x20 ; 32 1e1ec: 91 e4 ldi r25, 0x41 ; 65 1e1ee: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 1e1f2: 0f 94 ce 22 call 0x2459c ; 0x2459c } lcd_display_message_fullscreen_P(_T(MSG_PULL_OUT_FILAMENT)); 1e1f6: 81 ea ldi r24, 0xA1 ; 161 1e1f8: 9b e3 ldi r25, 0x3B ; 59 1e1fa: 0e 94 a7 6c call 0xd94e ; 0xd94e 1e1fe: 0f 94 22 0b call 0x21644 ; 0x21644 //disable extruder steppers so filament can be removed disable_e0(); 1e202: 14 9a sbi 0x02, 4 ; 2 _delay(100); 1e204: 64 e6 ldi r22, 0x64 ; 100 1e206: 70 e0 ldi r23, 0x00 ; 0 1e208: 80 e0 ldi r24, 0x00 ; 0 1e20a: 90 e0 ldi r25, 0x00 ; 0 1e20c: 0f 94 03 0e call 0x21c06 ; 0x21c06 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 1e210: 82 e0 ldi r24, 0x02 ; 2 1e212: 0f 94 2b 2d call 0x25a56 ; 0x25a56 1e216: c3 e3 ldi r28, 0x33 ; 51 uint8_t counterBeep = 0; while (!lcd_clicked() && (counterBeep < 50)) { 1e218: 0e 94 8e 6b call 0xd71c ; 0xd71c 1e21c: 81 11 cpse r24, r1 1e21e: 07 c0 rjmp .+14 ; 0x1e22e 1e220: c1 50 subi r28, 0x01 ; 1 1e222: 29 f0 breq .+10 ; 0x1e22e delay_keep_alive(100); 1e224: 84 e6 ldi r24, 0x64 ; 100 1e226: 90 e0 ldi r25, 0x00 ; 0 1e228: 0e 94 45 7c call 0xf88a ; 0xf88a 1e22c: f5 cf rjmp .-22 ; 0x1e218 counterBeep++; } st_synchronize(); 1e22e: 0f 94 ce 22 call 0x2459c ; 0x2459c while (lcd_clicked()) delay_keep_alive(100); 1e232: 0e 94 8e 6b call 0xd71c ; 0xd71c 1e236: 88 23 and r24, r24 1e238: 29 f0 breq .+10 ; 0x1e244 1e23a: 84 e6 ldi r24, 0x64 ; 100 1e23c: 90 e0 ldi r25, 0x00 ; 0 1e23e: 0e 94 45 7c call 0xf88a ; 0xf88a 1e242: f7 cf rjmp .-18 ; 0x1e232 lcd_update_enable(true); 1e244: 81 e0 ldi r24, 0x01 ; 1 1e246: 0e 94 b6 69 call 0xd36c ; 0xd36c lcd_setstatuspgm(MSG_WELCOME); 1e24a: 87 e6 ldi r24, 0x67 ; 103 1e24c: 9b e6 ldi r25, 0x6B ; 107 1e24e: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 custom_message_type = CustomMsg::Status; 1e252: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 clearFilamentAction(); 1e256: 0f 94 91 0c call 0x21922 ; 0x21922 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 1e25a: 84 e8 ldi r24, 0x84 ; 132 1e25c: 96 e1 ldi r25, 0x16 ; 22 } 1e25e: cf 91 pop r28 1e260: ff 90 pop r15 1e262: ef 90 pop r14 1e264: df 90 pop r13 1e266: cf 90 pop r12 1e268: 0c 94 e6 6d jmp 0xdbcc ; 0xdbcc 0001e26c : 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() 1e26c: 2f 92 push r2 1e26e: 3f 92 push r3 1e270: 4f 92 push r4 1e272: 5f 92 push r5 1e274: 6f 92 push r6 1e276: 7f 92 push r7 1e278: 8f 92 push r8 1e27a: 9f 92 push r9 1e27c: af 92 push r10 1e27e: bf 92 push r11 1e280: cf 92 push r12 1e282: df 92 push r13 1e284: ef 92 push r14 1e286: ff 92 push r15 1e288: 0f 93 push r16 1e28a: 1f 93 push r17 1e28c: cf 93 push r28 1e28e: df 93 push r29 1e290: 00 d0 rcall .+0 ; 0x1e292 1e292: 00 d0 rcall .+0 ; 0x1e294 1e294: 00 d0 rcall .+0 ; 0x1e296 1e296: cd b7 in r28, 0x3d ; 61 1e298: de b7 in r29, 0x3e ; 62 1e29a: 0c e9 ldi r16, 0x9C ; 156 1e29c: 12 e1 ldi r17, 0x12 ; 18 1e29e: 1f 83 std Y+7, r17 ; 0x07 1e2a0: 0e 83 std Y+6, r16 ; 0x06 1e2a2: 2e 80 ldd r2, Y+6 ; 0x06 1e2a4: 3f 80 ldd r3, Y+7 ; 0x07 1e2a6: 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])) 1e2a8: f1 01 movw r30, r2 1e2aa: 61 81 ldd r22, Z+1 ; 0x01 1e2ac: 72 81 ldd r23, Z+2 ; 0x02 1e2ae: 83 81 ldd r24, Z+3 ; 0x03 1e2b0: 94 81 ldd r25, Z+4 ; 0x04 1e2b2: 9b 01 movw r18, r22 1e2b4: ac 01 movw r20, r24 1e2b6: 0f 94 d1 a5 call 0x34ba2 ; 0x34ba2 <__unordsf2> 1e2ba: 88 23 and r24, r24 1e2bc: 09 f4 brne .+2 ; 0x1e2c0 1e2be: 7c c0 rjmp .+248 ; 0x1e3b8 mesh_bed_leveling() { reset(); } void reset(); static float get_x(int i) { return BED_X(i) + X_PROBE_OFFSET_FROM_EXTRUDER; } 1e2c0: 89 81 ldd r24, Y+1 ; 0x01 1e2c2: 0f 94 24 8c call 0x31848 ; 0x31848 1e2c6: 20 e0 ldi r18, 0x00 ; 0 1e2c8: 30 e0 ldi r19, 0x00 ; 0 1e2ca: 48 eb ldi r20, 0xB8 ; 184 1e2cc: 51 e4 ldi r21, 0x41 ; 65 1e2ce: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1e2d2: 6b 01 movw r12, r22 1e2d4: 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)) + 1e2d6: 20 e0 ldi r18, 0x00 ; 0 1e2d8: 30 e0 ldi r19, 0x00 ; 0 1e2da: 4c ef ldi r20, 0xFC ; 252 1e2dc: 52 e4 ldi r21, 0x42 ; 66 1e2de: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1e2e2: 2b 01 movw r4, r22 1e2e4: 3c 01 movw r6, r24 1e2e6: 20 e0 ldi r18, 0x00 ; 0 1e2e8: 30 e0 ldi r19, 0x00 ; 0 1e2ea: 44 e6 ldi r20, 0x64 ; 100 1e2ec: 53 e4 ldi r21, 0x43 ; 67 1e2ee: c7 01 movw r24, r14 1e2f0: b6 01 movw r22, r12 1e2f2: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1e2f6: 4b 01 movw r8, r22 1e2f8: 5c 01 movw r10, r24 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 1e2fa: 20 e0 ldi r18, 0x00 ; 0 1e2fc: 30 e0 ldi r19, 0x00 ; 0 1e2fe: 40 ec ldi r20, 0xC0 ; 192 1e300: 51 e4 ldi r21, 0x41 ; 65 1e302: c7 01 movw r24, r14 1e304: b6 01 movw r22, r12 1e306: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1e30a: 6b 01 movw r12, r22 1e30c: 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)) + 1e30e: ee 81 ldd r30, Y+6 ; 0x06 1e310: ff 81 ldd r31, Y+7 ; 0x07 1e312: 21 81 ldd r18, Z+1 ; 0x01 1e314: 32 81 ldd r19, Z+2 ; 0x02 1e316: 43 81 ldd r20, Z+3 ; 0x03 1e318: 54 81 ldd r21, Z+4 ; 0x04 1e31a: c3 01 movw r24, r6 1e31c: b2 01 movw r22, r4 1e31e: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1e322: a5 01 movw r20, r10 1e324: 94 01 movw r18, r8 1e326: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1e32a: 20 e0 ldi r18, 0x00 ; 0 1e32c: 30 e9 ldi r19, 0x90 ; 144 1e32e: 42 ea ldi r20, 0xA2 ; 162 1e330: 56 e4 ldi r21, 0x46 ; 70 1e332: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1e336: 6a 83 std Y+2, r22 ; 0x02 1e338: 7b 83 std Y+3, r23 ; 0x03 1e33a: 8c 83 std Y+4, r24 ; 0x04 1e33c: 9d 83 std Y+5, r25 ; 0x05 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 1e33e: ee 81 ldd r30, Y+6 ; 0x06 1e340: ff 81 ldd r31, Y+7 ; 0x07 1e342: 25 85 ldd r18, Z+13 ; 0x0d 1e344: 36 85 ldd r19, Z+14 ; 0x0e 1e346: 47 85 ldd r20, Z+15 ; 0x0f 1e348: 50 89 ldd r21, Z+16 ; 0x10 1e34a: c7 01 movw r24, r14 1e34c: b6 01 movw r22, r12 1e34e: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1e352: a5 01 movw r20, r10 1e354: 94 01 movw r18, r8 1e356: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1e35a: 20 e0 ldi r18, 0x00 ; 0 1e35c: 30 e9 ldi r19, 0x90 ; 144 1e35e: 42 e2 ldi r20, 0x22 ; 34 1e360: 56 ec ldi r21, 0xC6 ; 198 1e362: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1e366: 9b 01 movw r18, r22 1e368: 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)) + 1e36a: 6a 81 ldd r22, Y+2 ; 0x02 1e36c: 7b 81 ldd r23, Y+3 ; 0x03 1e36e: 8c 81 ldd r24, Y+4 ; 0x04 1e370: 9d 81 ldd r25, Y+5 ; 0x05 1e372: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1e376: 4b 01 movw r8, r22 1e378: 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)); 1e37a: ee 81 ldd r30, Y+6 ; 0x06 1e37c: ff 81 ldd r31, Y+7 ; 0x07 1e37e: 21 8d ldd r18, Z+25 ; 0x19 1e380: 32 8d ldd r19, Z+26 ; 0x1a 1e382: 43 8d ldd r20, Z+27 ; 0x1b 1e384: 54 8d ldd r21, Z+28 ; 0x1c 1e386: c7 01 movw r24, r14 1e388: b6 01 movw r22, r12 1e38a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1e38e: a3 01 movw r20, r6 1e390: 92 01 movw r18, r4 1e392: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1e396: 20 e0 ldi r18, 0x00 ; 0 1e398: 30 e9 ldi r19, 0x90 ; 144 1e39a: 42 ea ldi r20, 0xA2 ; 162 1e39c: 56 e4 ldi r21, 0x46 ; 70 1e39e: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1e3a2: 9b 01 movw r18, r22 1e3a4: 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)) + 1e3a6: c5 01 movw r24, r10 1e3a8: b4 01 movw r22, r8 1e3aa: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__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] = 1e3ae: f1 01 movw r30, r2 1e3b0: 61 83 std Z+1, r22 ; 0x01 1e3b2: 72 83 std Z+2, r23 ; 0x02 1e3b4: 83 83 std Z+3, r24 ; 0x03 1e3b6: 94 83 std Z+4, r25 ; 0x04 1e3b8: f4 e0 ldi r31, 0x04 ; 4 1e3ba: 2f 0e add r2, r31 1e3bc: 31 1c adc r3, r1 1e3be: 29 81 ldd r18, Y+1 ; 0x01 1e3c0: 2f 5f subi r18, 0xFF ; 255 1e3c2: 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) { 1e3c4: 27 30 cpi r18, 0x07 ; 7 1e3c6: 09 f0 breq .+2 ; 0x1e3ca 1e3c8: 6f cf rjmp .-290 ; 0x1e2a8 1e3ca: 8e 81 ldd r24, Y+6 ; 0x06 1e3cc: 9f 81 ldd r25, Y+7 ; 0x07 1e3ce: 4c 96 adiw r24, 0x1c ; 28 1e3d0: 9f 83 std Y+7, r25 ; 0x07 1e3d2: 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) { 1e3d4: 80 56 subi r24, 0x60 ; 96 1e3d6: 93 41 sbci r25, 0x13 ; 19 1e3d8: 09 f0 breq .+2 ; 0x1e3dc 1e3da: 63 cf rjmp .-314 ; 0x1e2a2 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() 1e3dc: 19 87 std Y+9, r17 ; 0x09 1e3de: 08 87 std Y+8, r16 ; 0x08 1e3e0: f1 e0 ldi r31, 0x01 ; 1 1e3e2: 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)) + 1e3e4: c8 01 movw r24, r16 1e3e6: 8b 5a subi r24, 0xAB ; 171 1e3e8: 9f 4f sbci r25, 0xFF ; 255 1e3ea: 9f 83 std Y+7, r25 ; 0x07 1e3ec: 8e 83 std Y+6, r24 ; 0x06 z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); 1e3ee: 18 01 movw r2, r16 1e3f0: 99 ea ldi r25, 0xA9 ; 169 1e3f2: 29 0e add r2, r25 1e3f4: 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])) 1e3f6: e8 85 ldd r30, Y+8 ; 0x08 1e3f8: f9 85 ldd r31, Y+9 ; 0x09 1e3fa: 65 8d ldd r22, Z+29 ; 0x1d 1e3fc: 76 8d ldd r23, Z+30 ; 0x1e 1e3fe: 87 8d ldd r24, Z+31 ; 0x1f 1e400: 90 a1 ldd r25, Z+32 ; 0x20 1e402: 9b 01 movw r18, r22 1e404: ac 01 movw r20, r24 1e406: 0f 94 d1 a5 call 0x34ba2 ; 0x34ba2 <__unordsf2> 1e40a: 88 23 and r24, r24 1e40c: 09 f4 brne .+2 ; 0x1e410 1e40e: 79 c0 rjmp .+242 ; 0x1e502 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 1e410: 89 81 ldd r24, Y+1 ; 0x01 1e412: 0f 94 24 8c call 0x31848 ; 0x31848 1e416: 20 e0 ldi r18, 0x00 ; 0 1e418: 30 e0 ldi r19, 0x00 ; 0 1e41a: 40 ea ldi r20, 0xA0 ; 160 1e41c: 50 e4 ldi r21, 0x40 ; 64 1e41e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1e422: 6b 01 movw r12, r22 1e424: 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)) + 1e426: 20 e0 ldi r18, 0x00 ; 0 1e428: 30 e0 ldi r19, 0x00 ; 0 1e42a: 48 ed ldi r20, 0xD8 ; 216 1e42c: 52 e4 ldi r21, 0x42 ; 66 1e42e: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1e432: 2b 01 movw r4, r22 1e434: 3c 01 movw r6, r24 1e436: 20 e0 ldi r18, 0x00 ; 0 1e438: 30 e0 ldi r19, 0x00 ; 0 1e43a: 42 e5 ldi r20, 0x52 ; 82 1e43c: 53 e4 ldi r21, 0x43 ; 67 1e43e: c7 01 movw r24, r14 1e440: b6 01 movw r22, r12 1e442: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1e446: 4b 01 movw r8, r22 1e448: 5c 01 movw r10, r24 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + 1e44a: 20 e0 ldi r18, 0x00 ; 0 1e44c: 30 e0 ldi r19, 0x00 ; 0 1e44e: 40 ec ldi r20, 0xC0 ; 192 1e450: 50 e4 ldi r21, 0x40 ; 64 1e452: c7 01 movw r24, r14 1e454: b6 01 movw r22, r12 1e456: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1e45a: 6b 01 movw r12, r22 1e45c: 7c 01 movw r14, r24 1e45e: ee 81 ldd r30, Y+6 ; 0x06 1e460: ff 81 ldd r31, Y+7 ; 0x07 1e462: 20 81 ld r18, Z 1e464: 31 81 ldd r19, Z+1 ; 0x01 1e466: 42 81 ldd r20, Z+2 ; 0x02 1e468: 53 81 ldd r21, Z+3 ; 0x03 1e46a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1e46e: a5 01 movw r20, r10 1e470: 94 01 movw r18, r8 1e472: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1e476: 20 e0 ldi r18, 0x00 ; 0 1e478: 30 e9 ldi r19, 0x90 ; 144 1e47a: 42 e2 ldi r20, 0x22 ; 34 1e47c: 56 ec ldi r21, 0xC6 ; 198 1e47e: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1e482: 6a 83 std Y+2, r22 ; 0x02 1e484: 7b 83 std Y+3, r23 ; 0x03 1e486: 8c 83 std Y+4, r24 ; 0x04 1e488: 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)) + 1e48a: f8 01 movw r30, r16 1e48c: 21 81 ldd r18, Z+1 ; 0x01 1e48e: 32 81 ldd r19, Z+2 ; 0x02 1e490: 43 81 ldd r20, Z+3 ; 0x03 1e492: 54 81 ldd r21, Z+4 ; 0x04 1e494: c3 01 movw r24, r6 1e496: b2 01 movw r22, r4 1e498: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1e49c: a5 01 movw r20, r10 1e49e: 94 01 movw r18, r8 1e4a0: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1e4a4: 20 e0 ldi r18, 0x00 ; 0 1e4a6: 30 e9 ldi r19, 0x90 ; 144 1e4a8: 42 ea ldi r20, 0xA2 ; 162 1e4aa: 56 e4 ldi r21, 0x46 ; 70 1e4ac: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1e4b0: 9b 01 movw r18, r22 1e4b2: ac 01 movw r20, r24 1e4b4: 6a 81 ldd r22, Y+2 ; 0x02 1e4b6: 7b 81 ldd r23, Y+3 ; 0x03 1e4b8: 8c 81 ldd r24, Y+4 ; 0x04 1e4ba: 9d 81 ldd r25, Y+5 ; 0x05 1e4bc: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1e4c0: 4b 01 movw r8, r22 1e4c2: 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)); 1e4c4: f1 01 movw r30, r2 1e4c6: 20 81 ld r18, Z 1e4c8: 31 81 ldd r19, Z+1 ; 0x01 1e4ca: 42 81 ldd r20, Z+2 ; 0x02 1e4cc: 53 81 ldd r21, Z+3 ; 0x03 1e4ce: c7 01 movw r24, r14 1e4d0: b6 01 movw r22, r12 1e4d2: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1e4d6: a3 01 movw r20, r6 1e4d8: 92 01 movw r18, r4 1e4da: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1e4de: 20 e0 ldi r18, 0x00 ; 0 1e4e0: 30 e9 ldi r19, 0x90 ; 144 1e4e2: 42 ea ldi r20, 0xA2 ; 162 1e4e4: 56 e4 ldi r21, 0x46 ; 70 1e4e6: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1e4ea: 9b 01 movw r18, r22 1e4ec: 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)) + 1e4ee: c5 01 movw r24, r10 1e4f0: b4 01 movw r22, r8 1e4f2: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__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] = 1e4f6: e8 85 ldd r30, Y+8 ; 0x08 1e4f8: f9 85 ldd r31, Y+9 ; 0x09 1e4fa: 65 8f std Z+29, r22 ; 0x1d 1e4fc: 76 8f std Z+30, r23 ; 0x1e 1e4fe: 87 8f std Z+31, r24 ; 0x1f 1e500: 90 a3 std Z+32, r25 ; 0x20 1e502: 88 85 ldd r24, Y+8 ; 0x08 1e504: 99 85 ldd r25, Y+9 ; 0x09 1e506: 4c 96 adiw r24, 0x1c ; 28 1e508: 99 87 std Y+9, r25 ; 0x09 1e50a: 88 87 std Y+8, r24 ; 0x08 1e50c: 99 81 ldd r25, Y+1 ; 0x01 1e50e: 9f 5f subi r25, 0xFF ; 255 1e510: 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) { 1e512: 96 30 cpi r25, 0x06 ; 6 1e514: 09 f0 breq .+2 ; 0x1e518 1e516: 6f cf rjmp .-290 ; 0x1e3f6 1e518: 0c 5f subi r16, 0xFC ; 252 1e51a: 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) { 1e51c: e2 e1 ldi r30, 0x12 ; 18 1e51e: 08 3b cpi r16, 0xB8 ; 184 1e520: 1e 07 cpc r17, r30 1e522: 09 f0 breq .+2 ; 0x1e526 1e524: 5b cf rjmp .-330 ; 0x1e3dc z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); } } } } 1e526: 29 96 adiw r28, 0x09 ; 9 1e528: 0f b6 in r0, 0x3f ; 63 1e52a: f8 94 cli 1e52c: de bf out 0x3e, r29 ; 62 1e52e: 0f be out 0x3f, r0 ; 63 1e530: cd bf out 0x3d, r28 ; 61 1e532: df 91 pop r29 1e534: cf 91 pop r28 1e536: 1f 91 pop r17 1e538: 0f 91 pop r16 1e53a: ff 90 pop r15 1e53c: ef 90 pop r14 1e53e: df 90 pop r13 1e540: cf 90 pop r12 1e542: bf 90 pop r11 1e544: af 90 pop r10 1e546: 9f 90 pop r9 1e548: 8f 90 pop r8 1e54a: 7f 90 pop r7 1e54c: 6f 90 pop r6 1e54e: 5f 90 pop r5 1e550: 4f 90 pop r4 1e552: 3f 90 pop r3 1e554: 2f 90 pop r2 1e556: 08 95 ret 0001e558 : } } return false; // couldn't accomplish the task } void MMU2::ToolChangeCommon(uint8_t slot) { 1e558: 2f 92 push r2 1e55a: 3f 92 push r3 1e55c: 4f 92 push r4 1e55e: 5f 92 push r5 1e560: 6f 92 push r6 1e562: 7f 92 push r7 1e564: 8f 92 push r8 1e566: 9f 92 push r9 1e568: af 92 push r10 1e56a: bf 92 push r11 1e56c: cf 92 push r12 1e56e: df 92 push r13 1e570: ef 92 push r14 1e572: ff 92 push r15 1e574: 0f 93 push r16 1e576: 1f 93 push r17 1e578: cf 93 push r28 1e57a: df 93 push r29 1e57c: cd b7 in r28, 0x3d ; 61 1e57e: de b7 in r29, 0x3e ; 62 1e580: 67 97 sbiw r28, 0x17 ; 23 1e582: 0f b6 in r0, 0x3f ; 63 1e584: f8 94 cli 1e586: de bf out 0x3e, r29 ; 62 1e588: 0f be out 0x3f, r0 ; 63 1e58a: cd bf out 0x3d, r28 ; 61 1e58c: 08 2f mov r16, r24 1e58e: ce 01 movw r24, r28 1e590: 46 96 adiw r24, 0x16 ; 22 1e592: 9f 8b std Y+23, r25 ; 0x17 1e594: 8e 8b std Y+22, r24 ; 0x16 1e596: 83 e0 ldi r24, 0x03 ; 3 1e598: f8 2e mov r15, r24 lcd_draw_update = 1; // force redraw } void lcd_clearstatus() { memset(lcd_status_message, 0, sizeof(lcd_status_message)); 1e59a: 95 e1 ldi r25, 0x15 ; 21 1e59c: 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 1e59e: 0f 94 bf 87 call 0x30f7e ; 0x30f7e tool_change_extruder = slot; 1e5a2: 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)); 1e5a6: 40 2f mov r20, r16 1e5a8: 64 e5 ldi r22, 0x54 ; 84 1e5aa: ce 01 movw r24, r28 1e5ac: 01 96 adiw r24, 0x01 ; 1 1e5ae: 0f 94 b2 87 call 0x30f64 ; 0x30f64 1e5b2: 49 81 ldd r20, Y+1 ; 0x01 1e5b4: 5a 81 ldd r21, Y+2 ; 0x02 1e5b6: 6b 81 ldd r22, Y+3 ; 0x03 1e5b8: 7c 81 ldd r23, Y+4 ; 0x04 1e5ba: 8d 81 ldd r24, Y+5 ; 0x05 1e5bc: 0f 94 f2 62 call 0x2c5e4 ; 0x2c5e4 logic.ToolChange(slot); // let the MMU pull the filament out and push a new one in if (manage_response(true, true)) { 1e5c0: 61 e0 ldi r22, 0x01 ; 1 1e5c2: 81 e0 ldi r24, 0x01 ; 1 1e5c4: 0f 94 87 6a call 0x2d50e ; 0x2d50e 1e5c8: 18 2f mov r17, r24 1e5ca: 81 11 cpse r24, r1 1e5cc: 07 c0 rjmp .+14 ; 0x1e5dc break; } // otherwise: failed to perform the command - unload first and then let it run again IncrementMMUFails(); 1e5ce: 0f 94 16 87 call 0x30e2c ; 0x30e2c // just in case we stood in an error screen for too long and the hotend got cold ResumeHotendTemp(); 1e5d2: 0f 94 25 6a call 0x2d44a ; 0x2d44a // if the extruder has been parked, it will get unparked once the ToolChange command finishes OK // - so no ResumeUnpark() at this spot UnloadInner(); 1e5d6: 0f 94 15 6b call 0x2d62a ; 0x2d62a 1e5da: e1 cf rjmp .-62 ; 0x1e59e bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 1e5dc: 0f 94 ce 22 call 0x2459c ; 0x2459c } bool MMU2::VerifyFilamentEnteredPTFE() { planner_synchronize(); if (WhereIsFilament() != FilamentState::AT_FSENSOR) 1e5e0: 0f 94 f5 87 call 0x30fea ; 0x30fea 1e5e4: 81 30 cpi r24, 0x01 ; 1 1e5e6: 79 f1 breq .+94 ; 0x1e646 // 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(); 1e5e8: 0f 94 15 6b call 0x2d62a ; 0x2d62a if (retries == 2 && cutter_enabled()) { 1e5ec: 92 e0 ldi r25, 0x02 ; 2 1e5ee: f9 12 cpse r15, r25 1e5f0: 09 c0 rjmp .+18 ; 0x1e604 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; 1e5f2: 8e ec ldi r24, 0xCE ; 206 1e5f4: 9e e0 ldi r25, 0x0E ; 14 1e5f6: 0f 94 9b a0 call 0x34136 ; 0x34136 1e5fa: 81 30 cpi r24, 0x01 ; 1 1e5fc: 19 f4 brne .+6 ; 0x1e604 CutFilamentInner(slot); // try cutting filament tip at the last attempt 1e5fe: 80 2f mov r24, r16 1e600: 0f 94 00 6c call 0x2d800 ; 0x2d800 1e604: 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) { 1e606: f1 10 cpse r15, r1 1e608: ca cf rjmp .-108 ; 0x1e59e 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()) { 1e60a: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 1e60e: 88 23 and r24, r24 1e610: 09 f4 brne .+2 ; 0x1e614 1e612: ef c0 rjmp .+478 ; 0x1e7f2 SetCurrentTool(slot); // filament change is finished SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } 1e614: 67 96 adiw r28, 0x17 ; 23 1e616: 0f b6 in r0, 0x3f ; 63 1e618: f8 94 cli 1e61a: de bf out 0x3e, r29 ; 62 1e61c: 0f be out 0x3f, r0 ; 63 1e61e: cd bf out 0x3d, r28 ; 61 1e620: df 91 pop r29 1e622: cf 91 pop r28 1e624: 1f 91 pop r17 1e626: 0f 91 pop r16 1e628: ff 90 pop r15 1e62a: ef 90 pop r14 1e62c: df 90 pop r13 1e62e: cf 90 pop r12 1e630: bf 90 pop r11 1e632: af 90 pop r10 1e634: 9f 90 pop r9 1e636: 8f 90 pop r8 1e638: 7f 90 pop r7 1e63a: 6f 90 pop r6 1e63c: 5f 90 pop r5 1e63e: 4f 90 pop r4 1e640: 3f 90 pop r3 1e642: 2f 90 pop r2 1e644: 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(); 1e646: 60 91 71 12 lds r22, 0x1271 ; 0x801271 1e64a: 70 e0 ldi r23, 0x00 ; 0 1e64c: 90 e0 ldi r25, 0x00 ; 0 1e64e: 80 e0 ldi r24, 0x00 ; 0 1e650: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 1e654: 9b 01 movw r18, r22 1e656: ac 01 movw r20, r24 1e658: 60 e0 ldi r22, 0x00 ; 0 1e65a: 70 e0 ldi r23, 0x00 ; 0 1e65c: 8c e5 ldi r24, 0x5C ; 92 1e65e: 92 e4 ldi r25, 0x42 ; 66 1e660: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1e664: 36 2e mov r3, r22 1e666: 87 2e mov r8, r23 1e668: 98 2e mov r9, r24 1e66a: 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)) 1e66c: 26 2f mov r18, r22 1e66e: 37 2f mov r19, r23 1e670: 48 2f mov r20, r24 1e672: 59 2f mov r21, r25 1e674: 60 e0 ldi r22, 0x00 ; 0 1e676: 70 e0 ldi r23, 0x00 ; 0 1e678: 80 e2 ldi r24, 0x20 ; 32 1e67a: 91 e4 ldi r25, 0x41 ; 65 1e67c: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 1e680: 2b 01 movw r4, r22 1e682: 3c 01 movw r6, r24 1e684: e9 e0 ldi r30, 0x09 ; 9 1e686: f5 e0 ldi r31, 0x05 ; 5 1e688: 82 2d mov r24, r2 1e68a: 11 92 st Z+, r1 1e68c: 8a 95 dec r24 1e68e: e9 f7 brne .-6 ; 0x1e68a lcd_status_message_idx = 0; 1e690: 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); 1e694: 83 2d mov r24, r3 1e696: 98 2d mov r25, r8 1e698: a9 2d mov r26, r9 1e69a: be 2d mov r27, r14 1e69c: bc 01 movw r22, r24 1e69e: 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++) { 1e6a0: 91 2c mov r9, r1 1e6a2: 31 2c mov r3, r1 1e6a4: e1 2c mov r14, r1 extruder_move(move == 0 ? tryload_length : -tryload_length, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE); 1e6a6: 5b 01 movw r10, r22 1e6a8: 6c 01 movw r12, r24 1e6aa: d7 fa bst r13, 7 1e6ac: d0 94 com r13 1e6ae: d7 f8 bld r13, 7 1e6b0: d0 94 com r13 1e6b2: 20 e0 ldi r18, 0x00 ; 0 1e6b4: 30 e0 ldi r19, 0x00 ; 0 1e6b6: 48 e4 ldi r20, 0x48 ; 72 1e6b8: 52 e4 ldi r21, 0x42 ; 66 1e6ba: 0f 94 c1 87 call 0x30f82 ; 0x30f82 1e6be: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 1e6c2: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 while (planner_any_moves()) { 1e6c6: 98 17 cp r25, r24 1e6c8: 09 f4 brne .+2 ; 0x1e6cc 1e6ca: 49 c0 rjmp .+146 ; 0x1e75e filament_inserted = filament_inserted && (WhereIsFilament() == FilamentState::AT_FSENSOR); 1e6cc: 11 23 and r17, r17 1e6ce: 31 f0 breq .+12 ; 0x1e6dc 1e6d0: 0f 94 f5 87 call 0x30fea ; 0x30fea 1e6d4: 11 e0 ldi r17, 0x01 ; 1 1e6d6: 81 30 cpi r24, 0x01 ; 1 1e6d8: 09 f0 breq .+2 ; 0x1e6dc 1e6da: 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); 1e6dc: 83 e0 ldi r24, 0x03 ; 3 1e6de: 0f 94 ba 22 call 0x24574 ; 0x24574 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); 1e6e2: 20 91 01 12 lds r18, 0x1201 ; 0x801201 1e6e6: 30 91 02 12 lds r19, 0x1202 ; 0x801202 1e6ea: 40 91 03 12 lds r20, 0x1203 ; 0x801203 1e6ee: 50 91 04 12 lds r21, 0x1204 ; 0x801204 1e6f2: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1e6f6: a3 01 movw r20, r6 1e6f8: 92 01 movw r18, r4 1e6fa: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1e6fe: 0f 94 a1 a2 call 0x34542 ; 0x34542 1e702: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 1e706: 86 2e mov r8, r22 if (dpixel1 - dpixel0) { 1e708: e6 16 cp r14, r22 1e70a: c1 f0 breq .+48 ; 0x1e73c 1e70c: e3 2d mov r30, r3 1e70e: e4 31 cpi r30, 0x14 ; 20 1e710: 08 f0 brcs .+2 ; 0x1e714 1e712: 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); 1e714: 33 24 eor r3, r3 1e716: 33 94 inc r3 1e718: 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] : '-'); 1e71a: 8f ef ldi r24, 0xFF ; 255 1e71c: 11 11 cpse r17, r1 1e71e: 01 c0 rjmp .+2 ; 0x1e722 1e720: 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; 1e722: f0 e0 ldi r31, 0x00 ; 0 1e724: e7 5f subi r30, 0xF7 ; 247 1e726: fa 4f sbci r31, 0xFA ; 250 1e728: 80 83 st Z, r24 lcd_draw_update = 1; // force redraw 1e72a: 91 e0 ldi r25, 0x01 ; 1 1e72c: 90 93 5b 02 sts 0x025B, r25 ; 0x80025b if (!lcd_update_enabled) lcdui_print_status_line(); 1e730: 80 91 5c 02 lds r24, 0x025C ; 0x80025c 1e734: 81 11 cpse r24, r1 1e736: 02 c0 rjmp .+4 ; 0x1e73c 1e738: 0f 94 ad 10 call 0x2215a ; 0x2215a void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 1e73c: 90 e0 ldi r25, 0x00 ; 0 1e73e: 80 e0 ldi r24, 0x00 ; 0 1e740: 0e 94 45 7c call 0xf88a ; 0xf88a } 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); 1e744: e8 2c mov r14, r8 tlur.Progress(filament_inserted); safe_delay_keep_alive(0); if (planner_draining()) { 1e746: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 1e74a: 88 23 and r24, r24 1e74c: 09 f4 brne .+2 ; 0x1e750 1e74e: b7 cf rjmp .-146 ; 0x1e6be return false; // power panic or a similar issue happened, bail out fast 1e750: 10 e0 ldi r17, 0x00 ; 0 1e752: 37 c0 rjmp .+110 ; 0x1e7c2 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); 1e754: c6 01 movw r24, r12 1e756: b5 01 movw r22, r10 1e758: 99 24 eor r9, r9 1e75a: 93 94 inc r9 1e75c: aa cf rjmp .-172 ; 0x1e6b2 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++) { 1e75e: 91 e0 ldi r25, 0x01 ; 1 1e760: 99 12 cpse r9, r25 1e762: f8 cf rjmp .-16 ; 0x1e754 return false; // power panic or a similar issue happened, bail out fast } } } Disable_E0(); 1e764: 0f 94 bf 87 call 0x30f7e ; 0x30f7e if (!filament_inserted) { 1e768: 11 11 cpse r17, r1 1e76a: 08 c0 rjmp .+16 ; 0x1e77c eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); } void IncrementLoadFails(){ eeprom_increment_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL); 1e76c: 8f ec ldi r24, 0xCF ; 207 1e76e: 9e e0 ldi r25, 0x0E ; 14 1e770: 0e 94 02 6f call 0xde04 ; 0xde04 eeprom_increment_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT); 1e774: 80 ed ldi r24, 0xD0 ; 208 1e776: 9e e0 ldi r25, 0x0E ; 14 1e778: 0e 94 f5 6e call 0xddea ; 0xddea 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); 1e77c: 44 e1 ldi r20, 0x14 ; 20 1e77e: 50 e0 ldi r21, 0x00 ; 0 1e780: 69 e0 ldi r22, 0x09 ; 9 1e782: 75 e0 ldi r23, 0x05 ; 5 1e784: ce 01 movw r24, r28 1e786: 01 96 adiw r24, 0x01 ; 1 1e788: 0f 94 1b a7 call 0x34e36 ; 0x34e36 1e78c: fe 01 movw r30, r28 1e78e: 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'; 1e790: 81 91 ld r24, Z+ 1e792: 87 fd sbrc r24, 7 1e794: 2c c0 rjmp .+88 ; 0x1e7ee 1e796: 80 e3 ldi r24, 0x30 ; 48 1e798: df 01 movw r26, r30 1e79a: 11 97 sbiw r26, 0x01 ; 1 1e79c: 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++) { 1e79e: 8e 89 ldd r24, Y+22 ; 0x16 1e7a0: 9f 89 ldd r25, Y+23 ; 0x17 1e7a2: 8e 17 cp r24, r30 1e7a4: 9f 07 cpc r25, r31 1e7a6: a1 f7 brne .-24 ; 0x1e790 // 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; 1e7a8: 1d 8a std Y+21, r1 ; 0x15 MMU2_ECHO_MSGLN(buf); 1e7aa: 81 e6 ldi r24, 0x61 ; 97 1e7ac: 9d e9 ldi r25, 0x9D ; 157 1e7ae: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 1e7b2: 8a eb ldi r24, 0xBA ; 186 1e7b4: 96 e8 ldi r25, 0x86 ; 134 1e7b6: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 1e7ba: ce 01 movw r24, r28 1e7bc: 01 96 adiw r24, 0x01 ; 1 1e7be: 0f 94 bc 99 call 0x33378 ; 0x33378 SERIAL_ECHOLN(message); } void lcd_reset_status_message_timeout() { lcd_status_message_timeout.start(); 1e7c2: 8e e1 ldi r24, 0x1E ; 30 1e7c4: 95 e0 ldi r25, 0x05 ; 5 1e7c6: 0f 94 29 12 call 0x22452 ; 0x22452 ::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()) { 1e7ca: 11 23 and r17, r17 1e7cc: 09 f4 brne .+2 ; 0x1e7d0 1e7ce: 0c cf rjmp .-488 ; 0x1e5e8 // 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 1e7d0: 80 2f mov r24, r16 1e7d2: 0f 94 6a 42 call 0x284d4 ; 0x284d4 } } void SpoolJoin::setSlot(uint8_t slot) { currentMMUSlot = slot; 1e7d6: 00 93 23 12 sts 0x1223, r16 ; 0x801223 SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; 1e7da: 80 91 98 12 lds r24, 0x1298 ; 0x801298 1e7de: 90 91 99 12 lds r25, 0x1299 ; 0x801299 1e7e2: 01 96 adiw r24, 0x01 ; 1 1e7e4: 90 93 99 12 sts 0x1299, r25 ; 0x801299 1e7e8: 80 93 98 12 sts 0x1298, r24 ; 0x801298 1e7ec: 13 cf rjmp .-474 ; 0x1e614 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'; 1e7ee: 81 e3 ldi r24, 0x31 ; 49 1e7f0: d3 cf rjmp .-90 ; 0x1e798 void SetInAutoRetry(bool iar) { inAutoRetry = iar; } inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; 1e7f2: 8a e2 ldi r24, 0x2A ; 42 1e7f4: 90 e8 ldi r25, 0x80 ; 128 1e7f6: 90 93 26 12 sts 0x1226, r25 ; 0x801226 1e7fa: 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 1e7fe: 61 e0 ldi r22, 0x01 ; 1 1e800: 81 e0 ldi r24, 0x01 ; 1 1e802: 0f 94 87 6a call 0x2d50e ; 0x2d50e 1e806: c7 ce rjmp .-626 ; 0x1e596 0001e808 : SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } bool MMU2::tool_change(uint8_t slot) { 1e808: cf 93 push r28 1e80a: df 93 push r29 1e80c: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 1e80e: 0f 94 73 54 call 0x2a8e6 ; 0x2a8e6 1e812: c8 2f mov r28, r24 1e814: 88 23 and r24, r24 1e816: d9 f0 breq .+54 ; 0x1e84e return false; } if (slot != extruder) { 1e818: 80 91 7b 12 lds r24, 0x127B ; 0x80127b 1e81c: 8d 17 cp r24, r29 1e81e: b9 f0 breq .+46 ; 0x1e84e 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(); 1e820: 0e 94 0f 61 call 0xc21e ; 0xc21e if (/*FindaDetectsFilament()*/ 1e824: 81 11 cpse r24, r1 1e826: 02 c0 rjmp .+4 ; 0x1e82c /*!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(); 1e828: 0f 94 52 6b call 0x2d6a4 ; 0x2d6a4 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 1e82c: 0f 94 3f 54 call 0x2a87e ; 0x2a87e eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1e830: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1e834: 10 92 85 16 sts 0x1685, r1 ; 0x801685 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 1e838: 0f 94 ce 22 call 0x2459c ; 0x2459c } ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); 1e83c: 8d 2f mov r24, r29 1e83e: 0e 94 ac f2 call 0x1e558 ; 0x1e558 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 1e842: 84 e8 ldi r24, 0x84 ; 132 1e844: 96 e1 ldi r25, 0x16 ; 22 1e846: 0e 94 e6 6d call 0xdbcc ; 0xdbcc explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 1e84a: 0f 94 68 54 call 0x2a8d0 ; 0x2a8d0 FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); } return true; } 1e84e: 8c 2f mov r24, r28 1e850: df 91 pop r29 1e852: cf 91 pop r28 1e854: 08 95 ret 0001e856 : { (void)lcd_selftest(); } bool lcd_selftest() { 1e856: cf 92 push r12 1e858: df 92 push r13 1e85a: ef 92 push r14 1e85c: ff 92 push r15 1e85e: 0f 93 push r16 1e860: 1f 93 push r17 1e862: cf 93 push r28 1e864: df 93 push r29 1e866: 00 d0 rcall .+0 ; 0x1e868 1e868: 1f 92 push r1 1e86a: cd b7 in r28, 0x3d ; 61 1e86c: 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(); 1e86e: 0f 94 e7 12 call 0x225ce ; 0x225ce uint8_t fanSpeedBckp = fanSpeed; 1e872: d0 90 e9 11 lds r13, 0x11E9 ; 0x8011e9 fanSpeed = 255; 1e876: 8f ef ldi r24, 0xFF ; 255 1e878: 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)); 1e87c: 89 ee ldi r24, 0xE9 ; 233 1e87e: e8 2e mov r14, r24 1e880: 82 e8 ldi r24, 0x82 ; 130 1e882: 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()); 1e884: 03 ee ldi r16, 0xE3 ; 227 1e886: 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)) { 1e888: 20 e0 ldi r18, 0x00 ; 0 1e88a: 30 e0 ldi r19, 0x00 ; 0 1e88c: 48 e4 ldi r20, 0x48 ; 72 1e88e: 52 e4 ldi r21, 0x42 ; 66 1e890: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 1e894: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 1e898: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 1e89c: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 1e8a0: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 1e8a4: 18 16 cp r1, r24 1e8a6: 8c f0 brlt .+34 ; 0x1e8ca 1e8a8: 20 e0 ldi r18, 0x00 ; 0 1e8aa: 30 e0 ldi r19, 0x00 ; 0 1e8ac: 48 e4 ldi r20, 0x48 ; 72 1e8ae: 52 e4 ldi r21, 0x42 ; 66 1e8b0: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 1e8b4: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 1e8b8: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 1e8bc: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 1e8c0: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 1e8c4: 18 16 cp r1, r24 1e8c6: 0c f0 brlt .+2 ; 0x1e8ca 1e8c8: 42 c0 rjmp .+132 ; 0x1e94e lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP)); 1e8ca: 8f ef ldi r24, 0xFF ; 255 1e8cc: 9d e3 ldi r25, 0x3D ; 61 1e8ce: 0e 94 a7 6c call 0xd94e ; 0xd94e 1e8d2: 0f 94 22 0b call 0x21644 ; 0x21644 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 1e8d6: 42 e8 ldi r20, 0x82 ; 130 1e8d8: 64 e0 ldi r22, 0x04 ; 4 1e8da: 80 e0 ldi r24, 0x00 ; 0 1e8dc: 0e 94 91 69 call 0xd322 ; 0xd322 lcd_printf_P(PSTR("%3d/0"), (int16_t)degHotend(0)); 1e8e0: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 1e8e4: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 1e8e8: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 1e8ec: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 1e8f0: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 1e8f4: 7f 93 push r23 1e8f6: 6f 93 push r22 1e8f8: ff 92 push r15 1e8fa: ef 92 push r14 1e8fc: 0e 94 4a 69 call 0xd294 ; 0xd294 lcd_putc(LCD_STR_DEGREE[0]); 1e900: 81 e8 ldi r24, 0x81 ; 129 1e902: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 lcd_putc_at(9, 4, LCD_STR_BEDTEMP[0]); 1e906: 40 e8 ldi r20, 0x80 ; 128 1e908: 64 e0 ldi r22, 0x04 ; 4 1e90a: 89 e0 ldi r24, 0x09 ; 9 1e90c: 0e 94 91 69 call 0xd322 ; 0xd322 lcd_printf_P(PSTR("%3d/0"), (int16_t)degBed()); 1e910: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 1e914: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 1e918: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 1e91c: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 1e920: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 1e924: 7f 93 push r23 1e926: 6f 93 push r22 1e928: 1f 93 push r17 1e92a: 0f 93 push r16 1e92c: 0e 94 4a 69 call 0xd294 ; 0xd294 lcd_putc(LCD_STR_DEGREE[0]); 1e930: 81 e8 ldi r24, 0x81 ; 129 1e932: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 delay_keep_alive(1000); 1e936: 88 ee ldi r24, 0xE8 ; 232 1e938: 93 e0 ldi r25, 0x03 ; 3 1e93a: 0e 94 45 7c call 0xf88a ; 0xf88a serialecho_temperatures(); 1e93e: 0e 94 5e 70 call 0xe0bc ; 0xe0bc 1e942: 0f b6 in r0, 0x3f ; 63 1e944: f8 94 cli 1e946: de bf out 0x3e, r29 ; 62 1e948: 0f be out 0x3f, r0 ; 63 1e94a: cd bf out 0x3d, r28 ; 61 1e94c: 9d cf rjmp .-198 ; 0x1e888 } fanSpeed = fanSpeedBckp; 1e94e: d0 92 e9 11 sts 0x11E9, r13 ; 0x8011e9 lcd_update_enable(true); 1e952: 81 e0 ldi r24, 0x01 ; 1 1e954: 0e 94 b6 69 call 0xd36c ; 0xd36c lcd_detect_IRsensor(); } } #endif lcd_wait_for_cool_down(); lcd_clear(); 1e958: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_START)); 1e95c: 85 e4 ldi r24, 0x45 ; 69 1e95e: 9e e3 ldi r25, 0x3E ; 62 1e960: 0e 94 a7 6c call 0xd94e ; 0xd94e 1e964: ac 01 movw r20, r24 1e966: 60 e0 ldi r22, 0x00 ; 0 1e968: 80 e0 ldi r24, 0x00 ; 0 1e96a: 0e 94 85 69 call 0xd30a ; 0xd30a #ifdef TMC2130 FORCE_HIGH_POWER_START; #endif // TMC2130 FORCE_BL_ON_START; _delay(2000); 1e96e: 60 ed ldi r22, 0xD0 ; 208 1e970: 77 e0 ldi r23, 0x07 ; 7 1e972: 80 e0 ldi r24, 0x00 ; 0 1e974: 90 e0 ldi r25, 0x00 ; 0 1e976: 0f 94 03 0e call 0x21c06 ; 0x21c06 KEEPALIVE_STATE(IN_HANDLER); 1e97a: 82 e0 ldi r24, 0x02 ; 2 1e97c: 80 93 78 02 sts 0x0278, r24 ; 0x800278 _progress = lcd_selftest_screen(TestScreen::ExtruderFan, _progress, 3, true, 2000); 1e980: 00 ed ldi r16, 0xD0 ; 208 1e982: 17 e0 ldi r17, 0x07 ; 7 1e984: 21 e0 ldi r18, 0x01 ; 1 1e986: 43 e0 ldi r20, 0x03 ; 3 1e988: 60 e0 ldi r22, 0x00 ; 0 1e98a: 80 e0 ldi r24, 0x00 ; 0 1e98c: 0e 94 35 b9 call 0x1726a ; 0x1726a 1e990: 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 1e992: 83 e0 ldi r24, 0x03 ; 3 1e994: 0e 94 35 6e call 0xdc6a ; 0xdc6a } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1e998: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1e99c: 10 92 05 05 sts 0x0505, r1 ; 0x800505 #endif manage_heater(); 1e9a0: 0f 94 13 33 call 0x26626 ; 0x26626 // 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]); 1e9a4: 4d e2 ldi r20, 0x2D ; 45 1e9a6: 62 e0 ldi r22, 0x02 ; 2 1e9a8: 82 e1 ldi r24, 0x12 ; 18 1e9aa: 0e 94 91 69 call 0xd322 ; 0xd322 delay_keep_alive(1000 / sizeof(symbols)); 1e9ae: 84 ef ldi r24, 0xF4 ; 244 1e9b0: 91 e0 ldi r25, 0x01 ; 1 1e9b2: 0e 94 45 7c call 0xf88a ; 0xf88a // 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]); 1e9b6: 4c e7 ldi r20, 0x7C ; 124 1e9b8: 62 e0 ldi r22, 0x02 ; 2 1e9ba: 82 e1 ldi r24, 0x12 ; 18 1e9bc: 0e 94 91 69 call 0xd322 ; 0xd322 delay_keep_alive(1000 / sizeof(symbols)); 1e9c0: 84 ef ldi r24, 0xF4 ; 244 1e9c2: 91 e0 ldi r25, 0x01 ; 1 1e9c4: 0e 94 45 7c call 0xf88a ; 0xf88a // 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]); 1e9c8: 4d e2 ldi r20, 0x2D ; 45 1e9ca: 62 e0 ldi r22, 0x02 ; 2 1e9cc: 82 e1 ldi r24, 0x12 ; 18 1e9ce: 0e 94 91 69 call 0xd322 ; 0xd322 delay_keep_alive(1000 / sizeof(symbols)); 1e9d2: 84 ef ldi r24, 0xF4 ; 244 1e9d4: 91 e0 ldi r25, 0x01 ; 1 1e9d6: 0e 94 45 7c call 0xf88a ; 0xf88a // 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]); 1e9da: 4c e7 ldi r20, 0x7C ; 124 1e9dc: 62 e0 ldi r22, 0x02 ; 2 1e9de: 82 e1 ldi r24, 0x12 ; 18 1e9e0: 0e 94 91 69 call 0xd322 ; 0xd322 delay_keep_alive(1000 / sizeof(symbols)); 1e9e4: 84 ef ldi r24, 0xF4 ; 244 1e9e6: 91 e0 ldi r25, 0x01 ; 1 1e9e8: 0e 94 45 7c call 0xf88a ; 0xf88a } } #ifdef FANCHECK extruder_autofan_last_check = _millis(); 1e9ec: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 1e9f0: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d 1e9f4: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e 1e9f8: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f 1e9fc: 90 93 90 16 sts 0x1690, r25 ; 0x801690 #endif fan_measuring = true; 1ea00: 81 e0 ldi r24, 0x01 ; 1 1ea02: 80 93 84 03 sts 0x0384, r24 ; 0x800384 while(fan_measuring) { 1ea06: 80 91 84 03 lds r24, 0x0384 ; 0x800384 1ea0a: 88 23 and r24, r24 1ea0c: 29 f0 breq .+10 ; 0x1ea18 delay_keep_alive(100); 1ea0e: 84 e6 ldi r24, 0x64 ; 100 1ea10: 90 e0 ldi r25, 0x00 ; 0 1ea12: 0e 94 45 7c call 0xf88a ; 0xf88a 1ea16: f7 cf rjmp .-18 ; 0x1ea06 } gcode_M123(); 1ea18: 0e 94 93 5f call 0xbf26 ; 0xbf26 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 1ea1c: 80 e0 ldi r24, 0x00 ; 0 1ea1e: 0e 94 35 6e call 0xdc6a ; 0xdc6a if (fan_speed[0] < failThr) { 1ea22: c0 90 85 03 lds r12, 0x0385 ; 0x800385 1ea26: d0 90 86 03 lds r13, 0x0386 ; 0x800386 1ea2a: 94 e1 ldi r25, 0x14 ; 20 1ea2c: c9 16 cp r12, r25 1ea2e: d1 04 cpc r13, r1 1ea30: 54 f1 brlt .+84 ; 0x1ea86 lcd_selftest_error(TestError::ExtruderFan, "", ""); } if (_result) { _progress = lcd_selftest_screen(TestScreen::PrintFan, _progress, 3, true, 2000); 1ea32: 00 ed ldi r16, 0xD0 ; 208 1ea34: 17 e0 ldi r17, 0x07 ; 7 1ea36: 21 e0 ldi r18, 0x01 ; 1 1ea38: 43 e0 ldi r20, 0x03 ; 3 1ea3a: 6f 2d mov r22, r15 1ea3c: 81 e0 ldi r24, 0x01 ; 1 1ea3e: 0e 94 35 b9 call 0x1726a ; 0x1726a 1ea42: f8 2e mov r15, r24 default: _result = false; break; } #else //defined(TACH_1) _result = lcd_selftest_manual_fan_check(1, false); 1ea44: 60 e0 ldi r22, 0x00 ; 0 1ea46: 80 e0 ldi r24, 0x00 ; 0 1ea48: 0e 94 a2 b1 call 0x16344 ; 0x16344 #endif //defined(TACH_1) if (!_result) 1ea4c: 81 11 cpse r24, r1 1ea4e: 3a c0 rjmp .+116 ; 0x1eac4 { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning 1ea50: 4a ed ldi r20, 0xDA ; 218 1ea52: 52 e0 ldi r21, 0x02 ; 2 1ea54: ba 01 movw r22, r20 1ea56: 85 e0 ldi r24, 0x05 ; 5 1ea58: 0e 94 64 e2 call 0x1c4c8 ; 0x1c4c8 } } if (_swapped_fan) { 1ea5c: 86 e4 ldi r24, 0x46 ; 70 1ea5e: c8 16 cp r12, r24 1ea60: d1 04 cpc r13, r1 1ea62: bc f0 brlt .+46 ; 0x1ea92 //turn on print fan and check that left hotend fan is not spinning _result = lcd_selftest_manual_fan_check(1, true); 1ea64: 60 e0 ldi r22, 0x00 ; 0 1ea66: 81 e0 ldi r24, 0x01 ; 1 1ea68: 0e 94 a2 b1 call 0x16344 ; 0x16344 if (_result) { 1ea6c: 88 23 and r24, r24 1ea6e: d9 f0 breq .+54 ; 0x1eaa6 //print fan is stil turned on; check that it is spinning _result = lcd_selftest_manual_fan_check(1, false, true); 1ea70: 61 e0 ldi r22, 0x01 ; 1 1ea72: 80 e0 ldi r24, 0x00 ; 0 1ea74: 0e 94 a2 b1 call 0x16344 ; 0x16344 if (!_result){ 1ea78: 81 11 cpse r24, r1 1ea7a: 28 c0 rjmp .+80 ; 0x1eacc lcd_selftest_error(TestError::PrintFan, "", ""); 1ea7c: 4a ed ldi r20, 0xDA ; 218 1ea7e: 52 e0 ldi r21, 0x02 ; 2 1ea80: ba 01 movw r22, r20 1ea82: 85 e0 ldi r24, 0x05 ; 5 1ea84: 04 c0 rjmp .+8 ; 0x1ea8e #else //defined(TACH_0) _result = lcd_selftest_manual_fan_check(0, false); #endif //defined(TACH_0) if (!_result) { lcd_selftest_error(TestError::ExtruderFan, "", ""); 1ea86: 4a ed ldi r20, 0xDA ; 218 1ea88: 52 e0 ldi r21, 0x02 ; 2 1ea8a: ba 01 movw r22, r20 1ea8c: 86 e0 ldi r24, 0x06 ; 6 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1ea8e: 0e 94 64 e2 call 0x1c4c8 ; 0x1c4c8 { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct } else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); 1ea92: 08 e8 ldi r16, 0x88 ; 136 1ea94: 13 e1 ldi r17, 0x13 ; 19 1ea96: 21 e0 ldi r18, 0x01 ; 1 1ea98: 43 e0 ldi r20, 0x03 ; 3 1ea9a: 6f 2d mov r22, r15 1ea9c: 8d e0 ldi r24, 0x0D ; 13 1ea9e: 0e 94 35 b9 call 0x1726a ; 0x1726a 1eaa2: e1 2c mov r14, r1 1eaa4: 88 c1 rjmp .+784 ; 0x1edb6 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1eaa6: 4a ed ldi r20, 0xDA ; 218 1eaa8: 52 e0 ldi r21, 0x02 ; 2 1eaaa: ba 01 movw r22, r20 1eaac: 89 e0 ldi r24, 0x09 ; 9 1eaae: ef cf rjmp .-34 ; 0x1ea8e #endif //not defined TMC2130 static bool lcd_selfcheck_endstops() { bool _result = true; 1eab0: 11 e0 ldi r17, 0x01 ; 1 1eab2: 96 c0 rjmp .+300 ; 0x1ebe0 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); lcd_return_to_status(); } else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 1eab4: 87 e6 ldi r24, 0x67 ; 103 1eab6: 9f e3 ldi r25, 0x3F ; 63 1eab8: 0e 94 a7 6c call 0xd94e ; 0xd94e 1eabc: 62 e0 ldi r22, 0x02 ; 2 1eabe: 0e 94 35 e2 call 0x1c46a ; 0x1c46a 1eac2: 91 c1 rjmp .+802 ; 0x1ede6 { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning } } if (_swapped_fan) { 1eac4: 96 e4 ldi r25, 0x46 ; 70 1eac6: c9 16 cp r12, r25 1eac8: d1 04 cpc r13, r1 1eaca: 64 f6 brge .-104 ; 0x1ea64 } } if (_result) { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); 1eacc: 00 ed ldi r16, 0xD0 ; 208 1eace: 17 e0 ldi r17, 0x07 ; 7 1ead0: 21 e0 ldi r18, 0x01 ; 1 1ead2: 43 e0 ldi r20, 0x03 ; 3 1ead4: 6f 2d mov r22, r15 1ead6: 82 e0 ldi r24, 0x02 ; 2 1ead8: 0e 94 35 b9 call 0x1726a ; 0x1726a 1eadc: 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) || 1eade: 1e 99 sbic 0x03, 6 ; 3 1eae0: 04 c0 rjmp .+8 ; 0x1eaea { bool _result = true; if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1eae2: 1d 99 sbic 0x03, 5 ; 3 1eae4: 02 c0 rjmp .+4 ; 0x1eaea ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1eae6: 1c 9b sbis 0x03, 4 ; 3 1eae8: 48 c0 rjmp .+144 ; 0x1eb7a #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; 1eaea: 1e 9b sbis 0x03, 6 ; 3 1eaec: 16 c0 rjmp .+44 ; 0x1eb1a 1eaee: 20 e0 ldi r18, 0x00 ; 0 1eaf0: 30 e0 ldi r19, 0x00 ; 0 1eaf2: 40 e2 ldi r20, 0x20 ; 32 1eaf4: 51 e4 ldi r21, 0x41 ; 65 1eaf6: 60 91 f5 11 lds r22, 0x11F5 ; 0x8011f5 1eafa: 70 91 f6 11 lds r23, 0x11F6 ; 0x8011f6 1eafe: 80 91 f7 11 lds r24, 0x11F7 ; 0x8011f7 1eb02: 90 91 f8 11 lds r25, 0x11F8 ; 0x8011f8 1eb06: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1eb0a: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 1eb0e: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 1eb12: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 1eb16: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) current_position[1] += 10; 1eb1a: 1d 9b sbis 0x03, 5 ; 3 1eb1c: 16 c0 rjmp .+44 ; 0x1eb4a 1eb1e: 20 e0 ldi r18, 0x00 ; 0 1eb20: 30 e0 ldi r19, 0x00 ; 0 1eb22: 40 e2 ldi r20, 0x20 ; 32 1eb24: 51 e4 ldi r21, 0x41 ; 65 1eb26: 60 91 f9 11 lds r22, 0x11F9 ; 0x8011f9 1eb2a: 70 91 fa 11 lds r23, 0x11FA ; 0x8011fa 1eb2e: 80 91 fb 11 lds r24, 0x11FB ; 0x8011fb 1eb32: 90 91 fc 11 lds r25, 0x11FC ; 0x8011fc 1eb36: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1eb3a: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 1eb3e: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 1eb42: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 1eb46: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc #endif //!TMC2130 if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) current_position[2] += 10; 1eb4a: 1c 9b sbis 0x03, 4 ; 3 1eb4c: 16 c0 rjmp .+44 ; 0x1eb7a 1eb4e: 20 e0 ldi r18, 0x00 ; 0 1eb50: 30 e0 ldi r19, 0x00 ; 0 1eb52: 40 e2 ldi r20, 0x20 ; 32 1eb54: 51 e4 ldi r21, 0x41 ; 65 1eb56: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 1eb5a: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 1eb5e: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 1eb62: 90 91 00 12 lds r25, 0x1200 ; 0x801200 1eb66: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1eb6a: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 1eb6e: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 1eb72: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 1eb76: 90 93 00 12 sts 0x1200, r25 ; 0x801200 } plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1eb7a: 60 e0 ldi r22, 0x00 ; 0 1eb7c: 70 e0 ldi r23, 0x00 ; 0 1eb7e: 84 e3 ldi r24, 0x34 ; 52 1eb80: 92 e4 ldi r25, 0x42 ; 66 1eb82: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 1eb86: 0f 94 ce 22 call 0x2459c ; 0x2459c if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1eb8a: 1e 99 sbic 0x03, 6 ; 3 1eb8c: 04 c0 rjmp .+8 ; 0x1eb96 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); st_synchronize(); if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1eb8e: 1d 99 sbic 0x03, 5 ; 3 1eb90: 02 c0 rjmp .+4 ; 0x1eb96 ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1eb92: 1c 9b sbis 0x03, 4 ; 3 1eb94: 8d cf rjmp .-230 ; 0x1eab0 #endif //!TMC2130 ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1)) { _result = false; char _error[4] = ""; 1eb96: 1a 82 std Y+2, r1 ; 0x02 1eb98: 19 82 std Y+1, r1 ; 0x01 1eb9a: 1c 82 std Y+4, r1 ; 0x04 1eb9c: 1b 82 std Y+3, r1 ; 0x03 #ifndef TMC2130 if ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "X"); 1eb9e: 1e 9b sbis 0x03, 6 ; 3 1eba0: 06 c0 rjmp .+12 ; 0x1ebae 1eba2: 6b ed ldi r22, 0xDB ; 219 1eba4: 72 e0 ldi r23, 0x02 ; 2 1eba6: ce 01 movw r24, r28 1eba8: 01 96 adiw r24, 0x01 ; 1 1ebaa: 0f 94 e7 a6 call 0x34dce ; 0x34dce if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Y"); 1ebae: 1d 9b sbis 0x03, 5 ; 3 1ebb0: 06 c0 rjmp .+12 ; 0x1ebbe 1ebb2: 6d ed ldi r22, 0xDD ; 221 1ebb4: 72 e0 ldi r23, 0x02 ; 2 1ebb6: ce 01 movw r24, r28 1ebb8: 01 96 adiw r24, 0x01 ; 1 1ebba: 0f 94 e7 a6 call 0x34dce ; 0x34dce #endif //!TMC2130 if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Z"); 1ebbe: 1c 9b sbis 0x03, 4 ; 3 1ebc0: 06 c0 rjmp .+12 ; 0x1ebce 1ebc2: 6f ed ldi r22, 0xDF ; 223 1ebc4: 72 e0 ldi r23, 0x02 ; 2 1ebc6: ce 01 movw r24, r28 1ebc8: 01 96 adiw r24, 0x01 ; 1 1ebca: 0f 94 e7 a6 call 0x34dce ; 0x34dce lcd_selftest_error(TestError::Endstops, _error, ""); 1ebce: 4a ed ldi r20, 0xDA ; 218 1ebd0: 52 e0 ldi r21, 0x02 ; 2 1ebd2: be 01 movw r22, r28 1ebd4: 6f 5f subi r22, 0xFF ; 255 1ebd6: 7f 4f sbci r23, 0xFF ; 255 1ebd8: 82 e0 ldi r24, 0x02 ; 2 1ebda: 0e 94 64 e2 call 0x1c4c8 ; 0x1c4c8 ((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; 1ebde: 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(); 1ebe0: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(true); 1ebe4: 81 e0 ldi r24, 0x01 ; 1 1ebe6: 0e 94 fe 79 call 0xf3fc ; 0xf3fc { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); _result = lcd_selfcheck_endstops(); //With TMC2130, only the Z probe is tested. } if (_result) 1ebea: 11 23 and r17, r17 1ebec: 09 f4 brne .+2 ; 0x1ebf0 1ebee: 51 cf rjmp .-350 ; 0x1ea92 { //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); 1ebf0: 00 ed ldi r16, 0xD0 ; 208 1ebf2: 17 e0 ldi r17, 0x07 ; 7 1ebf4: 21 e0 ldi r18, 0x01 ; 1 1ebf6: 43 e0 ldi r20, 0x03 ; 3 1ebf8: 6f 2d mov r22, r15 1ebfa: 84 e0 ldi r24, 0x04 ; 4 1ebfc: 0e 94 35 b9 call 0x1726a ; 0x1726a 1ec00: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(X_AXIS); #else _result = lcd_selfcheck_axis(X_AXIS, X_MAX_POS); 1ec02: 6a ef ldi r22, 0xFA ; 250 1ec04: 70 e0 ldi r23, 0x00 ; 0 1ec06: 90 e0 ldi r25, 0x00 ; 0 1ec08: 80 e0 ldi r24, 0x00 ; 0 1ec0a: 0e 94 47 e5 call 0x1ca8e ; 0x1ca8e } if (_result) 1ec0e: 88 23 and r24, r24 1ec10: 09 f4 brne .+2 ; 0x1ec14 1ec12: 3f cf rjmp .-386 ; 0x1ea92 { _progress = lcd_selftest_screen(TestScreen::AxisX, _progress, 3, true, 0); 1ec14: 10 e0 ldi r17, 0x00 ; 0 1ec16: 00 e0 ldi r16, 0x00 ; 0 1ec18: 21 e0 ldi r18, 0x01 ; 1 1ec1a: 43 e0 ldi r20, 0x03 ; 3 1ec1c: 6f 2d mov r22, r15 1ec1e: 84 e0 ldi r24, 0x04 ; 4 1ec20: 0e 94 35 b9 call 0x1726a ; 0x1726a 1ec24: f8 2e mov r15, r24 #ifndef TMC2130 _result = lcd_selfcheck_pulleys(X_AXIS); 1ec26: 90 e0 ldi r25, 0x00 ; 0 1ec28: 80 e0 ldi r24, 0x00 ; 0 1ec2a: 0e 94 44 e4 call 0x1c888 ; 0x1c888 #endif } if (_result) 1ec2e: 88 23 and r24, r24 1ec30: 09 f4 brne .+2 ; 0x1ec34 1ec32: 2f cf rjmp .-418 ; 0x1ea92 { _progress = lcd_selftest_screen(TestScreen::AxisY, _progress, 3, true, 1500); 1ec34: 0c ed ldi r16, 0xDC ; 220 1ec36: 15 e0 ldi r17, 0x05 ; 5 1ec38: 21 e0 ldi r18, 0x01 ; 1 1ec3a: 43 e0 ldi r20, 0x03 ; 3 1ec3c: 6f 2d mov r22, r15 1ec3e: 85 e0 ldi r24, 0x05 ; 5 1ec40: 0e 94 35 b9 call 0x1726a ; 0x1726a 1ec44: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(Y_AXIS); #else _result = lcd_selfcheck_axis(Y_AXIS, Y_MAX_POS); 1ec46: 62 ed ldi r22, 0xD2 ; 210 1ec48: 70 e0 ldi r23, 0x00 ; 0 1ec4a: 81 e0 ldi r24, 0x01 ; 1 1ec4c: 90 e0 ldi r25, 0x00 ; 0 1ec4e: 0e 94 47 e5 call 0x1ca8e ; 0x1ca8e #endif // TMC2130 } if (_result) 1ec52: 88 23 and r24, r24 1ec54: 09 f4 brne .+2 ; 0x1ec58 1ec56: 1d cf rjmp .-454 ; 0x1ea92 { _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 0); 1ec58: 10 e0 ldi r17, 0x00 ; 0 1ec5a: 00 e0 ldi r16, 0x00 ; 0 1ec5c: 21 e0 ldi r18, 0x01 ; 1 1ec5e: 43 e0 ldi r20, 0x03 ; 3 1ec60: 6f 2d mov r22, r15 1ec62: 86 e0 ldi r24, 0x06 ; 6 1ec64: 0e 94 35 b9 call 0x1726a ; 0x1726a 1ec68: f8 2e mov r15, r24 #ifndef TMC2130 _result = lcd_selfcheck_pulleys(Y_AXIS); 1ec6a: 81 e0 ldi r24, 0x01 ; 1 1ec6c: 90 e0 ldi r25, 0x00 ; 0 1ec6e: 0e 94 44 e4 call 0x1c888 ; 0x1c888 #endif // TMC2130 } if (_result) 1ec72: 88 23 and r24, r24 1ec74: 09 f4 brne .+2 ; 0x1ec78 1ec76: 0d cf rjmp .-486 ; 0x1ea92 enable_endstops(false); #endif //homeaxis(X_AXIS); //homeaxis(Y_AXIS); current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 1ec78: ec e4 ldi r30, 0x4C ; 76 1ec7a: f8 e8 ldi r31, 0x88 ; 136 1ec7c: 85 91 lpm r24, Z+ 1ec7e: 95 91 lpm r25, Z+ 1ec80: a5 91 lpm r26, Z+ 1ec82: b4 91 lpm r27, Z 1ec84: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 1ec88: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 1ec8c: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 1ec90: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4+1); 1ec94: e0 e5 ldi r30, 0x50 ; 80 1ec96: f8 e8 ldi r31, 0x88 ; 136 1ec98: 85 91 lpm r24, Z+ 1ec9a: 95 91 lpm r25, Z+ 1ec9c: a5 91 lpm r26, Z+ 1ec9e: b4 91 lpm r27, Z 1eca0: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 1eca4: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 1eca8: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 1ecac: 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); 1ecb0: 60 e0 ldi r22, 0x00 ; 0 1ecb2: 70 e0 ldi r23, 0x00 ; 0 1ecb4: 80 e2 ldi r24, 0x20 ; 32 1ecb6: 91 e4 ldi r25, 0x41 ; 65 1ecb8: 0e 94 d3 66 call 0xcda6 ; 0xcda6 set_destination_to_current(); 1ecbc: 0e 94 2c 61 call 0xc258 ; 0xc258 _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 1500); 1ecc0: 0c ed ldi r16, 0xDC ; 220 1ecc2: 15 e0 ldi r17, 0x05 ; 5 1ecc4: 21 e0 ldi r18, 0x01 ; 1 1ecc6: 43 e0 ldi r20, 0x03 ; 3 1ecc8: 6f 2d mov r22, r15 1ecca: 86 e0 ldi r24, 0x06 ; 6 1eccc: 0e 94 35 b9 call 0x1726a ; 0x1726a 1ecd0: 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); 1ecd2: 62 ed ldi r22, 0xD2 ; 210 1ecd4: 70 e0 ldi r23, 0x00 ; 0 1ecd6: 82 e0 ldi r24, 0x02 ; 2 1ecd8: 90 e0 ldi r25, 0x00 ; 0 1ecda: 0e 94 47 e5 call 0x1ca8e ; 0x1ca8e 1ecde: 18 2f mov r17, r24 #endif //TMC2130 //raise Z to not damage the bed during and hotend testing raise_z(20); 1ece0: 60 e0 ldi r22, 0x00 ; 0 1ece2: 70 e0 ldi r23, 0x00 ; 0 1ece4: 80 ea ldi r24, 0xA0 ; 160 1ece6: 91 e4 ldi r25, 0x41 ; 65 1ece8: 0e 94 d3 66 call 0xcda6 ; 0xcda6 eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_ENABLED, 1); _result = bres; } #endif //TMC2130 if (_result) 1ecec: 11 23 and r17, r17 1ecee: 09 f4 brne .+2 ; 0x1ecf2 1ecf0: d0 ce rjmp .-608 ; 0x1ea92 { _progress = lcd_selftest_screen(TestScreen::Bed, _progress, 3, true, 2000); 1ecf2: 00 ed ldi r16, 0xD0 ; 208 1ecf4: 17 e0 ldi r17, 0x07 ; 7 1ecf6: 21 e0 ldi r18, 0x01 ; 1 1ecf8: 43 e0 ldi r20, 0x03 ; 3 1ecfa: 6f 2d mov r22, r15 1ecfc: 87 e0 ldi r24, 0x07 ; 7 1ecfe: 0e 94 35 b9 call 0x1726a ; 0x1726a 1ed02: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(true); 1ed04: 81 e0 ldi r24, 0x01 ; 1 1ed06: 0e 94 4e e3 call 0x1c69c ; 0x1c69c } if (_result) 1ed0a: 88 23 and r24, r24 1ed0c: 09 f4 brne .+2 ; 0x1ed10 1ed0e: c1 ce rjmp .-638 ; 0x1ea92 { _progress = lcd_selftest_screen(TestScreen::Hotend, _progress, 3, true, 1000); 1ed10: 08 ee ldi r16, 0xE8 ; 232 1ed12: 13 e0 ldi r17, 0x03 ; 3 1ed14: 21 e0 ldi r18, 0x01 ; 1 1ed16: 43 e0 ldi r20, 0x03 ; 3 1ed18: 6f 2d mov r22, r15 1ed1a: 88 e0 ldi r24, 0x08 ; 8 1ed1c: 0e 94 35 b9 call 0x1726a ; 0x1726a 1ed20: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(false); 1ed22: 80 e0 ldi r24, 0x00 ; 0 1ed24: 0e 94 4e e3 call 0x1c69c ; 0x1c69c 1ed28: e8 2e mov r14, r24 } if (_result) 1ed2a: 88 23 and r24, r24 1ed2c: 09 f4 brne .+2 ; 0x1ed30 1ed2e: b1 ce rjmp .-670 ; 0x1ea92 { _progress = lcd_selftest_screen(TestScreen::HotendOk, _progress, 3, true, 2000); //nozzle ok 1ed30: 00 ed ldi r16, 0xD0 ; 208 1ed32: 17 e0 ldi r17, 0x07 ; 7 1ed34: 21 e0 ldi r18, 0x01 ; 1 1ed36: 43 e0 ldi r20, 0x03 ; 3 1ed38: 6f 2d mov r22, r15 1ed3a: 89 e0 ldi r24, 0x09 ; 9 1ed3c: 0e 94 35 b9 call 0x1726a ; 0x1726a } #ifdef FILAMENT_SENSOR if (_result) { #if (FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) if (MMU2::mmu2.Enabled()) 1ed40: 90 91 94 12 lds r25, 0x1294 ; 0x801294 1ed44: 91 30 cpi r25, 0x01 ; 1 1ed46: 79 f5 brne .+94 ; 0x1eda6 { _progress = lcd_selftest_screen(TestScreen::Fsensor, _progress, 3, true, 2000); //check filaments sensor 1ed48: 21 e0 ldi r18, 0x01 ; 1 1ed4a: 43 e0 ldi r20, 0x03 ; 3 1ed4c: 68 2f mov r22, r24 1ed4e: 8a e0 ldi r24, 0x0A ; 10 1ed50: 0e 94 35 b9 call 0x1726a ; 0x1726a 1ed54: 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); 1ed56: 84 e2 ldi r24, 0x24 ; 36 1ed58: 9e e3 ldi r25, 0x3E ; 62 1ed5a: 0e 94 a7 6c call 0xd94e ; 0xd94e 1ed5e: 70 e0 ldi r23, 0x00 ; 0 1ed60: 60 e0 ldi r22, 0x00 ; 0 1ed62: 0e 94 e7 bc call 0x179ce ; 0x179ce 1ed66: d8 2e mov r13, r24 // Render self-test screen lcd_selftest_screen(TestScreen::Fsensor, 0, 1, true, 0); 1ed68: 10 e0 ldi r17, 0x00 ; 0 1ed6a: 00 e0 ldi r16, 0x00 ; 0 1ed6c: 21 e0 ldi r18, 0x01 ; 1 1ed6e: 41 e0 ldi r20, 0x01 ; 1 1ed70: 60 e0 ldi r22, 0x00 ; 0 1ed72: 8a e0 ldi r24, 0x0A ; 10 1ed74: 0e 94 35 b9 call 0x1726a ; 0x1726a } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 1ed78: 10 92 58 02 sts 0x0258, r1 ; 0x800258 1ed7c: 10 92 57 02 sts 0x0257, r1 ; 0x800257 // Run self-test set_extrude_min_temp(0); MMU2::mmu2.tool_change(slot); 1ed80: 8d 2d mov r24, r13 1ed82: 0e 94 04 f4 call 0x1e808 ; 0x1e808 MMU2::mmu2.unload(); //Unload filament 1ed86: 0f 94 52 6b call 0x2d6a4 ; 0x2d6a4 1ed8a: 8f ea ldi r24, 0xAF ; 175 1ed8c: 90 e0 ldi r25, 0x00 ; 0 1ed8e: 90 93 58 02 sts 0x0258, r25 ; 0x800258 1ed92: 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 1ed96: 00 ed ldi r16, 0xD0 ; 208 1ed98: 17 e0 ldi r17, 0x07 ; 7 1ed9a: 21 e0 ldi r18, 0x01 ; 1 1ed9c: 43 e0 ldi r20, 0x03 ; 3 1ed9e: 6f 2d mov r22, r15 1eda0: 8b e0 ldi r24, 0x0B ; 11 1eda2: 0e 94 35 b9 call 0x1726a ; 0x1726a } } #endif //FILAMENT_SENSOR if (_result) { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct 1eda6: 08 e8 ldi r16, 0x88 ; 136 1eda8: 13 e1 ldi r17, 0x13 ; 19 1edaa: 21 e0 ldi r18, 0x01 ; 1 1edac: 43 e0 ldi r20, 0x03 ; 3 1edae: 68 2f mov r22, r24 1edb0: 8c e0 ldi r24, 0x0C ; 12 1edb2: 0e 94 35 b9 call 0x1726a ; 0x1726a lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1edb6: 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); 1edba: 61 e0 ldi r22, 0x01 ; 1 1edbc: 8f ec ldi r24, 0xCF ; 207 1edbe: 97 e6 ldi r25, 0x67 ; 103 1edc0: 0e 94 ac 7c call 0xf958 ; 0xf958 lcd_update_enable(true); 1edc4: 81 e0 ldi r24, 0x01 ; 1 1edc6: 0e 94 b6 69 call 0xd36c ; 0xd36c if (_result) 1edca: ee 20 and r14, r14 1edcc: 09 f4 brne .+2 ; 0x1edd0 1edce: 72 ce rjmp .-796 ; 0x1eab4 { calibration_status_set(CALIBRATION_STATUS_SELFTEST); 1edd0: 81 e0 ldi r24, 0x01 ; 1 1edd2: 0e 94 83 c6 call 0x18d06 ; 0x18d06 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); 1edd6: 87 e3 ldi r24, 0x37 ; 55 1edd8: 9e e3 ldi r25, 0x3E ; 62 1edda: 0e 94 a7 6c call 0xd94e ; 0xd94e 1edde: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 lcd_return_to_status(); 1ede2: 0e 94 6d fe call 0x1fcda ; 0x1fcda FORCE_HIGH_POWER_END; #endif // TMC2130 FORCE_BL_ON_END; KEEPALIVE_STATE(NOT_BUSY); 1ede6: 81 e0 ldi r24, 0x01 ; 1 1ede8: 80 93 78 02 sts 0x0278, r24 ; 0x800278 return(_result); } 1edec: 8e 2d mov r24, r14 1edee: 0f 90 pop r0 1edf0: 0f 90 pop r0 1edf2: 0f 90 pop r0 1edf4: 0f 90 pop r0 1edf6: df 91 pop r29 1edf8: cf 91 pop r28 1edfa: 1f 91 pop r17 1edfc: 0f 91 pop r16 1edfe: ff 90 pop r15 1ee00: ef 90 pop r14 1ee02: df 90 pop r13 1ee04: cf 90 pop r12 1ee06: 08 95 ret 0001ee08 : } #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) static void lcd_selftest_v() { (void)lcd_selftest(); 1ee08: 0c 94 2b f4 jmp 0x1e856 ; 0x1e856 0001ee0c : // Clear the filament action clearFilamentAction(); } static inline void loading_test_wrapper(uint8_t i){ 1ee0c: cf 93 push r28 1ee0e: 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); 1ee10: 83 e8 ldi r24, 0x83 ; 131 1ee12: 9b e3 ldi r25, 0x3B ; 59 1ee14: 0e 94 a7 6c call 0xd94e ; 0xd94e 1ee18: 6c 2f mov r22, r28 1ee1a: 0f 94 f7 86 call 0x30dee ; 0x30dee return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 1ee1e: 8c 2f mov r24, r28 1ee20: 0e 94 04 f4 call 0x1e808 ; 0x1e808 1ee24: 0f 94 ce 22 call 0x2459c ; 0x2459c planner_synchronize(); unload(); 1ee28: 0f 94 52 6b call 0x2d6a4 ; 0x2d6a4 ScreenUpdateEnable(); 1ee2c: 0f 94 f4 86 call 0x30de8 ; 0x30de8 MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); } 1ee30: cf 91 pop r28 static inline void loading_test_wrapper(uint8_t i){ MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); 1ee32: 0d 94 91 0c jmp 0x21922 ; 0x21922 0001ee36 : 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(){ 1ee36: cf 93 push r28 for(uint8_t i = 0; i < MMU_FILAMENT_COUNT; ++i){ 1ee38: c0 e0 ldi r28, 0x00 ; 0 1ee3a: 83 e8 ldi r24, 0x83 ; 131 1ee3c: 9b e3 ldi r25, 0x3B ; 59 1ee3e: 0e 94 a7 6c call 0xd94e ; 0xd94e 1ee42: 6c 2f mov r22, r28 1ee44: 0f 94 f7 86 call 0x30dee ; 0x30dee return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 1ee48: 8c 2f mov r24, r28 1ee4a: 0e 94 04 f4 call 0x1e808 ; 0x1e808 1ee4e: 0f 94 ce 22 call 0x2459c ; 0x2459c planner_synchronize(); unload(); 1ee52: 0f 94 52 6b call 0x2d6a4 ; 0x2d6a4 ScreenUpdateEnable(); 1ee56: 0f 94 f4 86 call 0x30de8 ; 0x30de8 1ee5a: cf 5f subi r28, 0xFF ; 255 1ee5c: c5 30 cpi r28, 0x05 ; 5 1ee5e: 69 f7 brne .-38 ; 0x1ee3a MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); } 1ee60: cf 91 pop r28 for(uint8_t i = 0; i < MMU_FILAMENT_COUNT; ++i){ MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); 1ee62: 0d 94 91 0c jmp 0x21922 ; 0x21922 0001ee66 : } ScreenUpdateEnable(); return true; } bool MMU2::load_filament_to_nozzle(uint8_t slot) { 1ee66: cf 93 push r28 1ee68: df 93 push r29 1ee6a: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 1ee6c: 0f 94 73 54 call 0x2a8e6 ; 0x2a8e6 1ee70: c8 2f mov r28, r24 1ee72: 88 23 and r24, r24 1ee74: 69 f1 breq .+90 ; 0x1eed0 safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 1ee76: 88 ec ldi r24, 0xC8 ; 200 1ee78: 90 e0 ldi r25, 0x00 ; 0 1ee7a: 0f 94 3e 8b call 0x3167c ; 0x3167c (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); 1ee7e: 82 e0 ldi r24, 0x02 ; 2 1ee80: 0f 94 2b 2d call 0x25a56 ; 0x25a56 void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 1ee84: 82 e0 ldi r24, 0x02 ; 2 1ee86: 9a e5 ldi r25, 0x5A ; 90 1ee88: 0e 94 a7 6c call 0xd94e ; 0xd94e 1ee8c: 6d 2f mov r22, r29 1ee8e: 0f 94 f7 86 call 0x30dee ; 0x30dee struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 1ee92: 0f 94 3f 54 call 0x2a87e ; 0x2a87e eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1ee96: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1ee9a: 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 1ee9e: 80 91 7b 12 lds r24, 0x127B ; 0x80127b 1eea2: 83 36 cpi r24, 0x63 ; 99 1eea4: 29 f0 breq .+10 ; 0x1eeb0 return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 1eea6: 62 e1 ldi r22, 0x12 ; 18 1eea8: 83 ef ldi r24, 0xF3 ; 243 1eeaa: 98 e9 ldi r25, 0x98 ; 152 1eeac: 0f 94 4a 54 call 0x2a894 ; 0x2a894 if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly filament_ramming(); } ToolChangeCommon(slot); 1eeb0: 8d 2f mov r24, r29 1eeb2: 0e 94 ac f2 call 0x1e558 ; 0x1e558 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); 1eeb6: 0e 94 37 b2 call 0x1646e ; 0x1646e 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); 1eeba: 83 e0 ldi r24, 0x03 ; 3 1eebc: 0f 94 2b 2d call 0x25a56 ; 0x25a56 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 1eec0: 84 e8 ldi r24, 0x84 ; 132 1eec2: 96 e1 ldi r25, 0x16 ; 22 1eec4: 0e 94 e6 6d call 0xdbcc ; 0xdbcc explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 1eec8: 0f 94 68 54 call 0x2a8d0 ; 0x2a8d0 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); MakeSound(Confirm); } ScreenUpdateEnable(); 1eecc: 0f 94 f4 86 call 0x30de8 ; 0x30de8 return true; } 1eed0: 8c 2f mov r24, r28 1eed2: df 91 pop r29 1eed4: cf 91 pop r28 1eed6: 08 95 ret 0001eed8 : /// 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) { 1eed8: 1f 93 push r17 1eeda: cf 93 push r28 1eedc: df 93 push r29 1eede: c8 2f mov r28, r24 1eee0: 16 2f mov r17, r22 if (!WaitForMMUReady()) { 1eee2: 0f 94 73 54 call 0x2a8e6 ; 0x2a8e6 1eee6: d8 2f mov r29, r24 1eee8: 88 23 and r24, r24 1eeea: a9 f0 breq .+42 ; 0x1ef16 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1eeec: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1eef0: 10 92 85 16 sts 0x1685, r1 ; 0x801685 return false; } FSensorBlockRunout blockRunout; switch (code) { 1eef4: c3 36 cpi r28, 0x63 ; 99 1eef6: 11 f1 breq .+68 ; 0x1ef3c 1eef8: c8 37 cpi r28, 0x78 ; 120 1eefa: 91 f0 breq .+36 ; 0x1ef20 1eefc: cf 33 cpi r28, 0x3F ; 63 1eefe: 39 f4 brne .+14 ; 0x1ef0e case '?': { waitForHotendTargetTemp(100, [] {}); 1ef00: 84 e6 ldi r24, 0x64 ; 100 1ef02: 90 e0 ldi r25, 0x00 ; 0 1ef04: 0f 94 3e 8b call 0x3167c ; 0x3167c (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.356]> load_filament_to_nozzle(slot); 1ef08: 81 2f mov r24, r17 1ef0a: 0e 94 33 f7 call 0x1ee66 ; 0x1ee66 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 1ef0e: 84 e8 ldi r24, 0x84 ; 132 1ef10: 96 e1 ldi r25, 0x16 ; 22 1ef12: 0e 94 e6 6d call 0xdbcc ; 0xdbcc execute_load_to_nozzle_sequence(); } break; } return true; } 1ef16: 8d 2f mov r24, r29 1ef18: df 91 pop r29 1ef1a: cf 91 pop r28 1ef1c: 1f 91 pop r17 1ef1e: 08 95 ret 1ef20: 10 92 58 02 sts 0x0258, r1 ; 0x800258 1ef24: 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); 1ef28: 81 2f mov r24, r17 1ef2a: 0e 94 04 f4 call 0x1e808 ; 0x1e808 1ef2e: 8f ea ldi r24, 0xAF ; 175 1ef30: 90 e0 ldi r25, 0x00 ; 0 1ef32: 90 93 58 02 sts 0x0258, r25 ; 0x800258 1ef36: 80 93 57 02 sts 0x0257, r24 ; 0x800257 1ef3a: e9 cf rjmp .-46 ; 0x1ef0e thermal_setExtrudeMintemp(EXTRUDE_MINTEMP); } break; case 'c': { waitForHotendTargetTemp(100, [] {}); 1ef3c: 84 e6 ldi r24, 0x64 ; 100 1ef3e: 90 e0 ldi r25, 0x00 ; 0 1ef40: 0f 94 3e 8b call 0x3167c ; 0x3167c (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.356]> execute_load_to_nozzle_sequence(); 1ef44: 0e 94 37 b2 call 0x1646e ; 0x1646e 1ef48: e2 cf rjmp .-60 ; 0x1ef0e 0001ef4a : 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); 1ef4a: 0e 94 33 f7 call 0x1ee66 ; 0x1ee66 // Extrude a little bit of filament so the user // can see the color is correct load_filament_final_feed(); 1ef4e: 0e 94 6b 5e call 0xbcd6 ; 0xbcd6 st_synchronize(); 1ef52: 0f 94 ce 22 call 0x2459c ; 0x2459c // Ask user if the extruded color is correct: lcd_return_to_status(); 1ef56: 0e 94 6d fe call 0x1fcda ; 0x1fcda lcd_load_filament_color_check(); 1ef5a: 0f 94 7c 30 call 0x260f8 ; 0x260f8 lcd_setstatuspgm(MSG_WELCOME); 1ef5e: 87 e6 ldi r24, 0x67 ; 103 1ef60: 9b e6 ldi r25, 0x6B ; 107 1ef62: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 custom_message_type = CustomMsg::Status; 1ef66: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 // Clear the filament action clearFilamentAction(); 1ef6a: 0d 94 91 0c jmp 0x21922 ; 0x21922 0001ef6e : void MMU2::PowerOn() { power_on(); } bool MMU2::ReadRegister(uint8_t address) { 1ef6e: 1f 93 push r17 1ef70: cf 93 push r28 1ef72: df 93 push r29 1ef74: 00 d0 rcall .+0 ; 0x1ef76 1ef76: 1f 92 push r1 1ef78: 1f 92 push r1 1ef7a: cd b7 in r28, 0x3d ; 61 1ef7c: de b7 in r29, 0x3e ; 62 1ef7e: 18 2f mov r17, r24 if (!WaitForMMUReady()) { 1ef80: 0f 94 73 54 call 0x2a8e6 ; 0x2a8e6 1ef84: 88 23 and r24, r24 1ef86: d9 f0 breq .+54 ; 0x1efbe void ProtocolLogic::Home(uint8_t mode) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Home, mode)); } void ProtocolLogic::ReadRegister(uint8_t address) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Read, address)); 1ef88: 41 2f mov r20, r17 1ef8a: 62 e5 ldi r22, 0x52 ; 82 1ef8c: ce 01 movw r24, r28 1ef8e: 01 96 adiw r24, 0x01 ; 1 1ef90: 0f 94 b2 87 call 0x30f64 ; 0x30f64 1ef94: 49 81 ldd r20, Y+1 ; 0x01 1ef96: 5a 81 ldd r21, Y+2 ; 0x02 1ef98: 6b 81 ldd r22, Y+3 ; 0x03 1ef9a: 7c 81 ldd r23, Y+4 ; 0x04 1ef9c: 8d 81 ldd r24, Y+5 ; 0x05 1ef9e: 0f 94 f2 62 call 0x2c5e4 ; 0x2c5e4 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)); 1efa2: 60 e0 ldi r22, 0x00 ; 0 1efa4: 80 e0 ldi r24, 0x00 ; 0 1efa6: 0f 94 87 6a call 0x2d50e ; 0x2d50e 1efaa: 88 23 and r24, r24 1efac: 69 f3 breq .-38 ; 0x1ef88 // Update cached value lastReadRegisterValue = logic.rsp.paramValue; 1efae: 20 91 40 12 lds r18, 0x1240 ; 0x801240 1efb2: 30 91 41 12 lds r19, 0x1241 ; 0x801241 1efb6: 30 93 91 12 sts 0x1291, r19 ; 0x801291 1efba: 20 93 90 12 sts 0x1290, r18 ; 0x801290 return true; } 1efbe: 0f 90 pop r0 1efc0: 0f 90 pop r0 1efc2: 0f 90 pop r0 1efc4: 0f 90 pop r0 1efc6: 0f 90 pop r0 1efc8: df 91 pop r29 1efca: cf 91 pop r28 1efcc: 1f 91 pop r17 1efce: 08 95 ret 0001efd0 : 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) { 1efd0: fc 01 movw r30, r24 switch(*oCheckSetting) { 1efd2: 80 81 ld r24, Z 1efd4: 88 23 and r24, r24 1efd6: 21 f0 breq .+8 ; 0x1efe0 1efd8: 81 30 cpi r24, 0x01 ; 1 1efda: 29 f4 brne .+10 ; 0x1efe6 case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 1efdc: 82 e0 ldi r24, 0x02 ; 2 1efde: 01 c0 rjmp .+2 ; 0x1efe2 while (0) static void lcd_check_update_RAM(ClCheckMode * oCheckSetting) { switch(*oCheckSetting) { case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; 1efe0: 81 e0 ldi r24, 0x01 ; 1 break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 1efe2: 80 83 st Z, r24 1efe4: 08 95 ret break; case ClCheckMode::_Strict: *oCheckSetting = ClCheckMode::_None; 1efe6: 10 82 st Z, r1 break; default: *oCheckSetting = ClCheckMode::_None; } } 1efe8: 08 95 ret 0001efea : #endif // TMC2130 static inline bool pgm_is_whitespace(const char *c_addr) { const char c = pgm_read_byte(c_addr); 1efea: fc 01 movw r30, r24 1efec: 94 91 lpm r25, Z return c == ' ' || c == '\t' || c == '\r' || c == '\n'; 1efee: 90 32 cpi r25, 0x20 ; 32 1eff0: 49 f0 breq .+18 ; 0x1f004 1eff2: 87 ef ldi r24, 0xF7 ; 247 1eff4: 89 0f add r24, r25 1eff6: 82 30 cpi r24, 0x02 ; 2 1eff8: 28 f0 brcs .+10 ; 0x1f004 1effa: 81 e0 ldi r24, 0x01 ; 1 1effc: 9d 30 cpi r25, 0x0D ; 13 1effe: 19 f0 breq .+6 ; 0x1f006 1f000: 80 e0 ldi r24, 0x00 ; 0 1f002: 08 95 ret 1f004: 81 e0 ldi r24, 0x01 ; 1 } 1f006: 08 95 ret 0001f008 : 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; 1f008: 88 3e cpi r24, 0xE8 ; 232 1f00a: 23 e0 ldi r18, 0x03 ; 3 1f00c: 92 07 cpc r25, r18 1f00e: 10 f0 brcs .+4 ; 0x1f014 1f010: 87 ee ldi r24, 0xE7 ; 231 1f012: 93 e0 ldi r25, 0x03 ; 3 } 1f014: 08 95 ret 0001f016 : return 0; } static int uart2_getchar(_UNUSED FILE *stream) { if (rbuf_empty(uart2_ibuf)) return -1; 1f016: 90 91 b1 0d lds r25, 0x0DB1 ; 0x800db1 1f01a: 80 91 b0 0d lds r24, 0x0DB0 ; 0x800db0 1f01e: 2f ef ldi r18, 0xFF ; 255 1f020: 3f ef ldi r19, 0xFF ; 255 1f022: 89 17 cp r24, r25 1f024: 71 f0 breq .+28 ; 0x1f042 _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 1f026: e9 2f mov r30, r25 1f028: f0 e0 ldi r31, 0x00 ; 0 1f02a: ed 54 subi r30, 0x4D ; 77 1f02c: f2 4f sbci r31, 0xF2 ; 242 1f02e: 20 81 ld r18, Z 1f030: 30 e0 ldi r19, 0x00 ; 0 buf_r++; //increment read index 1f032: 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 1f034: 80 91 af 0d lds r24, 0x0DAF ; 0x800daf 1f038: 98 17 cp r25, r24 1f03a: 08 f0 brcs .+2 ; 0x1f03e 1f03c: 90 e0 ldi r25, 0x00 ; 0 ptr[2] = buf_r; //store read index 1f03e: 90 93 b1 0d sts 0x0DB1, r25 ; 0x800db1 return rbuf_get(uart2_ibuf); } 1f042: c9 01 movw r24, r18 1f044: 08 95 ret 0001f046 : uint8_t uart2_ibuf[20] = {0, 0}; FILE _uart2io; static int uart2_putchar(char c, _UNUSED FILE *stream) { while (!uart2_txready); 1f046: 90 91 d0 00 lds r25, 0x00D0 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7c20d0> 1f04a: 95 ff sbrs r25, 5 1f04c: fc cf rjmp .-8 ; 0x1f046 UDR2 = c; // transmit byte 1f04e: 80 93 d6 00 sts 0x00D6, r24 ; 0x8000d6 <__TEXT_REGION_LENGTH__+0x7c20d6> return 0; } 1f052: 90 e0 ldi r25, 0x00 ; 0 1f054: 80 e0 ldi r24, 0x00 ; 0 1f056: 08 95 ret 0001f058 : } unsigned long micros2(void) { unsigned long m; uint8_t oldSREG = SREG, t; 1f058: 3f b7 in r19, 0x3f ; 63 cli(); 1f05a: f8 94 cli m = timer2_overflow_count; 1f05c: 80 91 69 06 lds r24, 0x0669 ; 0x800669 1f060: 90 91 6a 06 lds r25, 0x066A ; 0x80066a 1f064: a0 91 6b 06 lds r26, 0x066B ; 0x80066b 1f068: b0 91 6c 06 lds r27, 0x066C ; 0x80066c #if defined(TCNT2) t = TCNT2; 1f06c: 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)) 1f070: b8 9b sbis 0x17, 0 ; 23 1f072: 05 c0 rjmp .+10 ; 0x1f07e 1f074: 2f 3f cpi r18, 0xFF ; 255 1f076: 19 f0 breq .+6 ; 0x1f07e m++; 1f078: 01 96 adiw r24, 0x01 ; 1 1f07a: a1 1d adc r26, r1 1f07c: b1 1d adc r27, r1 #else if ((TIFR & _BV(TOV2)) && (t < 255)) m++; #endif SREG = oldSREG; 1f07e: 3f bf out 0x3f, r19 ; 63 return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond()); 1f080: ba 2f mov r27, r26 1f082: a9 2f mov r26, r25 1f084: 98 2f mov r25, r24 1f086: 88 27 eor r24, r24 1f088: bc 01 movw r22, r24 1f08a: cd 01 movw r24, r26 1f08c: 62 0f add r22, r18 1f08e: 71 1d adc r23, r1 1f090: 81 1d adc r24, r1 1f092: 91 1d adc r25, r1 1f094: 42 e0 ldi r20, 0x02 ; 2 1f096: 66 0f add r22, r22 1f098: 77 1f adc r23, r23 1f09a: 88 1f adc r24, r24 1f09c: 99 1f adc r25, r25 1f09e: 4a 95 dec r20 1f0a0: d1 f7 brne .-12 ; 0x1f096 } 1f0a2: 08 95 ret 0001f0a4 : #endif temp_meas_ready = true; } static void temp_mgr_pid() { 1f0a4: 2f 92 push r2 1f0a6: 3f 92 push r3 1f0a8: 4f 92 push r4 1f0aa: 5f 92 push r5 1f0ac: 6f 92 push r6 1f0ae: 7f 92 push r7 1f0b0: 8f 92 push r8 1f0b2: 9f 92 push r9 1f0b4: af 92 push r10 1f0b6: bf 92 push r11 1f0b8: cf 92 push r12 1f0ba: df 92 push r13 1f0bc: ef 92 push r14 1f0be: ff 92 push r15 1f0c0: 0f 93 push r16 1f0c2: 1f 93 push r17 1f0c4: cf 93 push r28 1f0c6: df 93 push r29 1f0c8: cd b7 in r28, 0x3d ; 61 1f0ca: de b7 in r29, 0x3e ; 62 1f0cc: 2e 97 sbiw r28, 0x0e ; 14 1f0ce: 0f b6 in r0, 0x3f ; 63 1f0d0: f8 94 cli 1f0d2: de bf out 0x3e, r29 ; 62 1f0d4: 0f be out 0x3f, r0 ; 63 1f0d6: 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]); 1f0d8: 20 90 5c 06 lds r2, 0x065C ; 0x80065c 1f0dc: 30 90 5d 06 lds r3, 0x065D ; 0x80065d 1f0e0: 40 90 5e 06 lds r4, 0x065E ; 0x80065e 1f0e4: 50 90 5f 06 lds r5, 0x065F ; 0x80065f 1f0e8: 60 90 60 06 lds r6, 0x0660 ; 0x800660 1f0ec: 70 90 61 06 lds r7, 0x0661 ; 0x800661 #ifdef PIDTEMP pid_input = current; #ifndef PID_OPENLOOP if(target == 0) { 1f0f0: 21 14 cp r2, r1 1f0f2: 31 04 cpc r3, r1 1f0f4: 39 f4 brne .+14 ; 0x1f104 pid_output = 0; pid_reset[e] = true; 1f0f6: 81 e0 ldi r24, 0x01 ; 1 1f0f8: 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; 1f0fc: 81 2c mov r8, r1 1f0fe: 91 2c mov r9, r1 1f100: 54 01 movw r10, r8 1f102: f9 c0 rjmp .+498 ; 0x1f2f6 #ifndef PID_OPENLOOP if(target == 0) { pid_output = 0; pid_reset[e] = true; } else { pid_error[e] = target - pid_input; 1f104: b1 01 movw r22, r2 1f106: 03 2c mov r0, r3 1f108: 00 0c add r0, r0 1f10a: 88 0b sbc r24, r24 1f10c: 99 0b sbc r25, r25 1f10e: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 1f112: a3 01 movw r20, r6 1f114: 92 01 movw r18, r4 1f116: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1f11a: 6b 01 movw r12, r22 1f11c: 7c 01 movw r14, r24 if(pid_reset[e]) { 1f11e: 80 91 35 06 lds r24, 0x0635 ; 0x800635 1f122: 88 23 and r24, r24 1f124: 91 f0 breq .+36 ; 0x1f14a iState_sum[e] = 0.0; 1f126: 10 92 31 06 sts 0x0631, r1 ; 0x800631 1f12a: 10 92 32 06 sts 0x0632, r1 ; 0x800632 1f12e: 10 92 33 06 sts 0x0633, r1 ; 0x800633 1f132: 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) 1f136: 10 92 2d 06 sts 0x062D, r1 ; 0x80062d 1f13a: 10 92 2e 06 sts 0x062E, r1 ; 0x80062e 1f13e: 10 92 2f 06 sts 0x062F, r1 ; 0x80062f 1f142: 10 92 30 06 sts 0x0630, r1 ; 0x800630 pid_reset[e] = false; 1f146: 10 92 35 06 sts 0x0635, r1 ; 0x800635 } #ifndef PonM pTerm[e] = cs.Kp * pid_error[e]; 1f14a: 20 91 9a 04 lds r18, 0x049A ; 0x80049a 1f14e: 30 91 9b 04 lds r19, 0x049B ; 0x80049b 1f152: 40 91 9c 04 lds r20, 0x049C ; 0x80049c 1f156: 50 91 9d 04 lds r21, 0x049D ; 0x80049d 1f15a: c7 01 movw r24, r14 1f15c: b6 01 movw r22, r12 1f15e: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1f162: 69 83 std Y+1, r22 ; 0x01 1f164: 7a 83 std Y+2, r23 ; 0x02 1f166: 8b 83 std Y+3, r24 ; 0x03 1f168: 9c 83 std Y+4, r25 ; 0x04 iState_sum[e] += pid_error[e]; 1f16a: 20 91 31 06 lds r18, 0x0631 ; 0x800631 1f16e: 30 91 32 06 lds r19, 0x0632 ; 0x800632 1f172: 40 91 33 06 lds r20, 0x0633 ; 0x800633 1f176: 50 91 34 06 lds r21, 0x0634 ; 0x800634 1f17a: c7 01 movw r24, r14 1f17c: b6 01 movw r22, r12 1f17e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1f182: 4b 01 movw r8, r22 1f184: 5c 01 movw r10, r24 iState_sum[e] = constrain(iState_sum[e], iState_sum_min[e], iState_sum_max[e]); 1f186: 20 91 ea 03 lds r18, 0x03EA ; 0x8003ea <_ZL14iState_sum_min.lto_priv.431> 1f18a: 2d 87 std Y+13, r18 ; 0x0d 1f18c: 30 91 eb 03 lds r19, 0x03EB ; 0x8003eb <_ZL14iState_sum_min.lto_priv.431+0x1> 1f190: 39 87 std Y+9, r19 ; 0x09 1f192: 10 91 ec 03 lds r17, 0x03EC ; 0x8003ec <_ZL14iState_sum_min.lto_priv.431+0x2> 1f196: 00 91 ed 03 lds r16, 0x03ED ; 0x8003ed <_ZL14iState_sum_min.lto_priv.431+0x3> 1f19a: 41 2f mov r20, r17 1f19c: 50 2f mov r21, r16 1f19e: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1f1a2: 87 fd sbrc r24, 7 1f1a4: 17 c0 rjmp .+46 ; 0x1f1d4 1f1a6: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 <_ZL14iState_sum_max.lto_priv.432> 1f1aa: 8d 87 std Y+13, r24 ; 0x0d 1f1ac: 90 91 e7 03 lds r25, 0x03E7 ; 0x8003e7 <_ZL14iState_sum_max.lto_priv.432+0x1> 1f1b0: 99 87 std Y+9, r25 ; 0x09 1f1b2: 10 91 e8 03 lds r17, 0x03E8 ; 0x8003e8 <_ZL14iState_sum_max.lto_priv.432+0x2> 1f1b6: 00 91 e9 03 lds r16, 0x03E9 ; 0x8003e9 <_ZL14iState_sum_max.lto_priv.432+0x3> 1f1ba: 9c 01 movw r18, r24 1f1bc: 41 2f mov r20, r17 1f1be: 50 2f mov r21, r16 1f1c0: b4 01 movw r22, r8 1f1c2: c5 01 movw r24, r10 1f1c4: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 1f1c8: 18 16 cp r1, r24 1f1ca: 24 f0 brlt .+8 ; 0x1f1d4 1f1cc: 8d 86 std Y+13, r8 ; 0x0d 1f1ce: 99 86 std Y+9, r9 ; 0x09 1f1d0: 1a 2d mov r17, r10 1f1d2: 0b 2d mov r16, r11 1f1d4: 8d 85 ldd r24, Y+13 ; 0x0d 1f1d6: 99 85 ldd r25, Y+9 ; 0x09 1f1d8: a1 2f mov r26, r17 1f1da: b0 2f mov r27, r16 1f1dc: 80 93 31 06 sts 0x0631, r24 ; 0x800631 1f1e0: 90 93 32 06 sts 0x0632, r25 ; 0x800632 1f1e4: a0 93 33 06 sts 0x0633, r26 ; 0x800633 1f1e8: b0 93 34 06 sts 0x0634, r27 ; 0x800634 iTerm[e] = cs.Ki * iState_sum[e]; 1f1ec: 20 91 9e 04 lds r18, 0x049E ; 0x80049e 1f1f0: 30 91 9f 04 lds r19, 0x049F ; 0x80049f 1f1f4: 40 91 a0 04 lds r20, 0x04A0 ; 0x8004a0 1f1f8: 50 91 a1 04 lds r21, 0x04A1 ; 0x8004a1 1f1fc: bc 01 movw r22, r24 1f1fe: 81 2f mov r24, r17 1f200: 90 2f mov r25, r16 1f202: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1f206: 6d 83 std Y+5, r22 ; 0x05 1f208: 7e 83 std Y+6, r23 ; 0x06 1f20a: 8f 83 std Y+7, r24 ; 0x07 1f20c: 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 1f20e: 20 91 29 06 lds r18, 0x0629 ; 0x800629 1f212: 30 91 2a 06 lds r19, 0x062A ; 0x80062a 1f216: 40 91 2b 06 lds r20, 0x062B ; 0x80062b 1f21a: 50 91 2c 06 lds r21, 0x062C ; 0x80062c 1f21e: c3 01 movw r24, r6 1f220: b2 01 movw r22, r4 1f222: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1f226: 20 91 a2 04 lds r18, 0x04A2 ; 0x8004a2 1f22a: 30 91 a3 04 lds r19, 0x04A3 ; 0x8004a3 1f22e: 40 91 a4 04 lds r20, 0x04A4 ; 0x8004a4 1f232: 50 91 a5 04 lds r21, 0x04A5 ; 0x8004a5 1f236: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1f23a: 20 ed ldi r18, 0xD0 ; 208 1f23c: 3c ec ldi r19, 0xCC ; 204 1f23e: 4c e4 ldi r20, 0x4C ; 76 1f240: 5d e3 ldi r21, 0x3D ; 61 1f242: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1f246: 4b 01 movw r8, r22 1f248: 5c 01 movw r10, r24 1f24a: 23 e3 ldi r18, 0x33 ; 51 1f24c: 33 e3 ldi r19, 0x33 ; 51 1f24e: 43 e7 ldi r20, 0x73 ; 115 1f250: 5f e3 ldi r21, 0x3F ; 63 1f252: 60 91 2d 06 lds r22, 0x062D ; 0x80062d 1f256: 70 91 2e 06 lds r23, 0x062E ; 0x80062e 1f25a: 80 91 2f 06 lds r24, 0x062F ; 0x80062f 1f25e: 90 91 30 06 lds r25, 0x0630 ; 0x800630 1f262: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1f266: 9b 01 movw r18, r22 1f268: ac 01 movw r20, r24 1f26a: c5 01 movw r24, r10 1f26c: b4 01 movw r22, r8 1f26e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1f272: 4b 01 movw r8, r22 1f274: 5c 01 movw r10, r24 1f276: 80 92 2d 06 sts 0x062D, r8 ; 0x80062d 1f27a: 90 92 2e 06 sts 0x062E, r9 ; 0x80062e 1f27e: a0 92 2f 06 sts 0x062F, r10 ; 0x80062f 1f282: 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) 1f286: 2d 81 ldd r18, Y+5 ; 0x05 1f288: 3e 81 ldd r19, Y+6 ; 0x06 1f28a: 4f 81 ldd r20, Y+7 ; 0x07 1f28c: 58 85 ldd r21, Y+8 ; 0x08 1f28e: 69 81 ldd r22, Y+1 ; 0x01 1f290: 7a 81 ldd r23, Y+2 ; 0x02 1f292: 8b 81 ldd r24, Y+3 ; 0x03 1f294: 9c 81 ldd r25, Y+4 ; 0x04 1f296: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1f29a: a5 01 movw r20, r10 1f29c: 94 01 movw r18, r8 1f29e: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1f2a2: 4b 01 movw r8, r22 1f2a4: 5c 01 movw r10, r24 if (pid_output > PID_MAX) { 1f2a6: 20 e0 ldi r18, 0x00 ; 0 1f2a8: 30 e0 ldi r19, 0x00 ; 0 1f2aa: 4f e7 ldi r20, 0x7F ; 127 1f2ac: 53 e4 ldi r21, 0x43 ; 67 1f2ae: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 1f2b2: 20 e0 ldi r18, 0x00 ; 0 1f2b4: 30 e0 ldi r19, 0x00 ; 0 1f2b6: 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) { 1f2b8: 18 16 cp r1, r24 1f2ba: 0c f0 brlt .+2 ; 0x1f2be 1f2bc: 6d c1 rjmp .+730 ; 0x1f598 if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 1f2be: c7 01 movw r24, r14 1f2c0: b6 01 movw r22, r12 1f2c2: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 1f2c6: 18 16 cp r1, r24 1f2c8: 84 f4 brge .+32 ; 0x1f2ea 1f2ca: a7 01 movw r20, r14 1f2cc: 96 01 movw r18, r12 1f2ce: 6d 85 ldd r22, Y+13 ; 0x0d 1f2d0: 79 85 ldd r23, Y+9 ; 0x09 1f2d2: 81 2f mov r24, r17 1f2d4: 90 2f mov r25, r16 1f2d6: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1f2da: 60 93 31 06 sts 0x0631, r22 ; 0x800631 1f2de: 70 93 32 06 sts 0x0632, r23 ; 0x800632 1f2e2: 80 93 33 06 sts 0x0633, r24 ; 0x800633 1f2e6: 90 93 34 06 sts 0x0634, r25 ; 0x800634 pid_output=PID_MAX; 1f2ea: 81 2c mov r8, r1 1f2ec: 91 2c mov r9, r1 1f2ee: 3f e7 ldi r19, 0x7F ; 127 1f2f0: a3 2e mov r10, r19 1f2f2: 33 e4 ldi r19, 0x43 ; 67 1f2f4: 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; 1f2f6: 40 92 29 06 sts 0x0629, r4 ; 0x800629 1f2fa: 50 92 2a 06 sts 0x062A, r5 ; 0x80062a 1f2fe: 60 92 2b 06 sts 0x062B, r6 ; 0x80062b 1f302: 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)) 1f306: 60 91 54 02 lds r22, 0x0254 ; 0x800254 <_ZL8maxttemp.lto_priv.433> 1f30a: 70 91 55 02 lds r23, 0x0255 ; 0x800255 <_ZL8maxttemp.lto_priv.433+0x1> 1f30e: 07 2e mov r0, r23 1f310: 00 0c add r0, r0 1f312: 88 0b sbc r24, r24 1f314: 99 0b sbc r25, r25 1f316: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 1f31a: 9b 01 movw r18, r22 1f31c: ac 01 movw r20, r24 1f31e: c3 01 movw r24, r6 1f320: b2 01 movw r22, r4 1f322: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1f326: 87 ff sbrs r24, 7 1f328: 57 c1 rjmp .+686 ; 0x1f5d8 1f32a: 23 28 or r2, r3 1f32c: 09 f4 brne .+2 ; 0x1f330 1f32e: 54 c1 rjmp .+680 ; 0x1f5d8 soft_pwm[e] = (int)pid_output >> 1; 1f330: c5 01 movw r24, r10 1f332: b4 01 movw r22, r8 1f334: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 1f338: 75 95 asr r23 1f33a: 67 95 ror r22 1f33c: 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); 1f340: 20 91 55 06 lds r18, 0x0655 ; 0x800655 1f344: 30 91 56 06 lds r19, 0x0656 ; 0x800656 1f348: 3a 83 std Y+2, r19 ; 0x02 1f34a: 29 83 std Y+1, r18 ; 0x01 1f34c: 40 90 57 06 lds r4, 0x0657 ; 0x800657 1f350: 50 90 58 06 lds r5, 0x0658 ; 0x800658 1f354: 60 90 59 06 lds r6, 0x0659 ; 0x800659 1f358: 70 90 5a 06 lds r7, 0x065A ; 0x80065a #ifdef PIDTEMPBED pid_input = current; #ifndef PID_OPENLOOP pid_error_bed = target - pid_input; 1f35c: b9 01 movw r22, r18 1f35e: 33 0f add r19, r19 1f360: 88 0b sbc r24, r24 1f362: 99 0b sbc r25, r25 1f364: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 1f368: a3 01 movw r20, r6 1f36a: 92 01 movw r18, r4 1f36c: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1f370: 6b 01 movw r12, r22 1f372: 7c 01 movw r14, r24 pTerm_bed = cs.bedKp * pid_error_bed; 1f374: 20 91 a6 04 lds r18, 0x04A6 ; 0x8004a6 1f378: 30 91 a7 04 lds r19, 0x04A7 ; 0x8004a7 1f37c: 40 91 a8 04 lds r20, 0x04A8 ; 0x8004a8 1f380: 50 91 a9 04 lds r21, 0x04A9 ; 0x8004a9 1f384: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1f388: 6d 83 std Y+5, r22 ; 0x05 1f38a: 7e 83 std Y+6, r23 ; 0x06 1f38c: 8f 83 std Y+7, r24 ; 0x07 1f38e: 98 87 std Y+8, r25 ; 0x08 temp_iState_bed += pid_error_bed; 1f390: 20 91 3e 06 lds r18, 0x063E ; 0x80063e 1f394: 30 91 3f 06 lds r19, 0x063F ; 0x80063f 1f398: 40 91 40 06 lds r20, 0x0640 ; 0x800640 1f39c: 50 91 41 06 lds r21, 0x0641 ; 0x800641 1f3a0: c7 01 movw r24, r14 1f3a2: b6 01 movw r22, r12 1f3a4: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1f3a8: 5b 01 movw r10, r22 1f3aa: 8c 01 movw r16, r24 temp_iState_bed = constrain(temp_iState_bed, temp_iState_min_bed, temp_iState_max_bed); 1f3ac: 30 91 e2 03 lds r19, 0x03E2 ; 0x8003e2 <_ZL19temp_iState_min_bed.lto_priv.429> 1f3b0: 3e 87 std Y+14, r19 ; 0x0e 1f3b2: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 <_ZL19temp_iState_min_bed.lto_priv.429+0x1> 1f3b6: 8d 87 std Y+13, r24 ; 0x0d 1f3b8: 30 90 e4 03 lds r3, 0x03E4 ; 0x8003e4 <_ZL19temp_iState_min_bed.lto_priv.429+0x2> 1f3bc: 20 90 e5 03 lds r2, 0x03E5 ; 0x8003e5 <_ZL19temp_iState_min_bed.lto_priv.429+0x3> 1f3c0: 23 2f mov r18, r19 1f3c2: 38 2f mov r19, r24 1f3c4: 43 2d mov r20, r3 1f3c6: 52 2d mov r21, r2 1f3c8: b5 01 movw r22, r10 1f3ca: c8 01 movw r24, r16 1f3cc: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1f3d0: 87 fd sbrc r24, 7 1f3d2: 18 c0 rjmp .+48 ; 0x1f404 1f3d4: 90 91 de 03 lds r25, 0x03DE ; 0x8003de <_ZL19temp_iState_max_bed.lto_priv.430> 1f3d8: 9e 87 std Y+14, r25 ; 0x0e 1f3da: 20 91 df 03 lds r18, 0x03DF ; 0x8003df <_ZL19temp_iState_max_bed.lto_priv.430+0x1> 1f3de: 2d 87 std Y+13, r18 ; 0x0d 1f3e0: 30 90 e0 03 lds r3, 0x03E0 ; 0x8003e0 <_ZL19temp_iState_max_bed.lto_priv.430+0x2> 1f3e4: 20 90 e1 03 lds r2, 0x03E1 ; 0x8003e1 <_ZL19temp_iState_max_bed.lto_priv.430+0x3> 1f3e8: 29 2f mov r18, r25 1f3ea: 3d 85 ldd r19, Y+13 ; 0x0d 1f3ec: 43 2d mov r20, r3 1f3ee: 52 2d mov r21, r2 1f3f0: b5 01 movw r22, r10 1f3f2: c8 01 movw r24, r16 1f3f4: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 1f3f8: 18 16 cp r1, r24 1f3fa: 24 f0 brlt .+8 ; 0x1f404 1f3fc: ae 86 std Y+14, r10 ; 0x0e 1f3fe: bd 86 std Y+13, r11 ; 0x0d 1f400: 30 2e mov r3, r16 1f402: 21 2e mov r2, r17 1f404: 8e 85 ldd r24, Y+14 ; 0x0e 1f406: 9d 85 ldd r25, Y+13 ; 0x0d 1f408: a3 2d mov r26, r3 1f40a: b2 2d mov r27, r2 1f40c: 80 93 3e 06 sts 0x063E, r24 ; 0x80063e 1f410: 90 93 3f 06 sts 0x063F, r25 ; 0x80063f 1f414: a0 93 40 06 sts 0x0640, r26 ; 0x800640 1f418: b0 93 41 06 sts 0x0641, r27 ; 0x800641 iTerm_bed = cs.bedKi * temp_iState_bed; 1f41c: 20 91 aa 04 lds r18, 0x04AA ; 0x8004aa 1f420: 30 91 ab 04 lds r19, 0x04AB ; 0x8004ab 1f424: 40 91 ac 04 lds r20, 0x04AC ; 0x8004ac 1f428: 50 91 ad 04 lds r21, 0x04AD ; 0x8004ad 1f42c: bc 01 movw r22, r24 1f42e: 83 2d mov r24, r3 1f430: 92 2d mov r25, r2 1f432: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1f436: 69 87 std Y+9, r22 ; 0x09 1f438: 7a 87 std Y+10, r23 ; 0x0a 1f43a: 8b 87 std Y+11, r24 ; 0x0b 1f43c: 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); 1f43e: 20 91 3a 06 lds r18, 0x063A ; 0x80063a 1f442: 30 91 3b 06 lds r19, 0x063B ; 0x80063b 1f446: 40 91 3c 06 lds r20, 0x063C ; 0x80063c 1f44a: 50 91 3d 06 lds r21, 0x063D ; 0x80063d 1f44e: c3 01 movw r24, r6 1f450: b2 01 movw r22, r4 1f452: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1f456: 20 91 ae 04 lds r18, 0x04AE ; 0x8004ae 1f45a: 30 91 af 04 lds r19, 0x04AF ; 0x8004af 1f45e: 40 91 b0 04 lds r20, 0x04B0 ; 0x8004b0 1f462: 50 91 b1 04 lds r21, 0x04B1 ; 0x8004b1 1f466: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1f46a: 20 ed ldi r18, 0xD0 ; 208 1f46c: 3c ec ldi r19, 0xCC ; 204 1f46e: 4c e4 ldi r20, 0x4C ; 76 1f470: 5d e3 ldi r21, 0x3D ; 61 1f472: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1f476: 4b 01 movw r8, r22 1f478: 5c 01 movw r10, r24 1f47a: 23 e3 ldi r18, 0x33 ; 51 1f47c: 33 e3 ldi r19, 0x33 ; 51 1f47e: 43 e7 ldi r20, 0x73 ; 115 1f480: 5f e3 ldi r21, 0x3F ; 63 1f482: 60 91 36 06 lds r22, 0x0636 ; 0x800636 1f486: 70 91 37 06 lds r23, 0x0637 ; 0x800637 1f48a: 80 91 38 06 lds r24, 0x0638 ; 0x800638 1f48e: 90 91 39 06 lds r25, 0x0639 ; 0x800639 1f492: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 1f496: 9b 01 movw r18, r22 1f498: ac 01 movw r20, r24 1f49a: c5 01 movw r24, r10 1f49c: b4 01 movw r22, r8 1f49e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1f4a2: 4b 01 movw r8, r22 1f4a4: 5c 01 movw r10, r24 1f4a6: 80 92 36 06 sts 0x0636, r8 ; 0x800636 1f4aa: 90 92 37 06 sts 0x0637, r9 ; 0x800637 1f4ae: a0 92 38 06 sts 0x0638, r10 ; 0x800638 1f4b2: b0 92 39 06 sts 0x0639, r11 ; 0x800639 temp_dState_bed = pid_input; 1f4b6: 40 92 3a 06 sts 0x063A, r4 ; 0x80063a 1f4ba: 50 92 3b 06 sts 0x063B, r5 ; 0x80063b 1f4be: 60 92 3c 06 sts 0x063C, r6 ; 0x80063c 1f4c2: 70 92 3d 06 sts 0x063D, r7 ; 0x80063d pid_output = pTerm_bed + iTerm_bed - dTerm_bed; 1f4c6: 29 85 ldd r18, Y+9 ; 0x09 1f4c8: 3a 85 ldd r19, Y+10 ; 0x0a 1f4ca: 4b 85 ldd r20, Y+11 ; 0x0b 1f4cc: 5c 85 ldd r21, Y+12 ; 0x0c 1f4ce: 6d 81 ldd r22, Y+5 ; 0x05 1f4d0: 7e 81 ldd r23, Y+6 ; 0x06 1f4d2: 8f 81 ldd r24, Y+7 ; 0x07 1f4d4: 98 85 ldd r25, Y+8 ; 0x08 1f4d6: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 1f4da: a5 01 movw r20, r10 1f4dc: 94 01 movw r18, r8 1f4de: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1f4e2: 4b 01 movw r8, r22 1f4e4: 5c 01 movw r10, r24 if (pid_output > MAX_BED_POWER) { 1f4e6: 20 e0 ldi r18, 0x00 ; 0 1f4e8: 30 e0 ldi r19, 0x00 ; 0 1f4ea: 4f e7 ldi r20, 0x7F ; 127 1f4ec: 53 e4 ldi r21, 0x43 ; 67 1f4ee: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 1f4f2: 20 e0 ldi r18, 0x00 ; 0 1f4f4: 30 e0 ldi r19, 0x00 ; 0 1f4f6: 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) { 1f4f8: 18 16 cp r1, r24 1f4fa: 0c f0 brlt .+2 ; 0x1f4fe 1f4fc: 70 c0 rjmp .+224 ; 0x1f5de if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 1f4fe: c7 01 movw r24, r14 1f500: b6 01 movw r22, r12 1f502: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 1f506: 18 16 cp r1, r24 1f508: 84 f4 brge .+32 ; 0x1f52a 1f50a: a7 01 movw r20, r14 1f50c: 96 01 movw r18, r12 1f50e: 6e 85 ldd r22, Y+14 ; 0x0e 1f510: 7d 85 ldd r23, Y+13 ; 0x0d 1f512: 83 2d mov r24, r3 1f514: 92 2d mov r25, r2 1f516: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1f51a: 60 93 3e 06 sts 0x063E, r22 ; 0x80063e 1f51e: 70 93 3f 06 sts 0x063F, r23 ; 0x80063f 1f522: 80 93 40 06 sts 0x0640, r24 ; 0x800640 1f526: 90 93 41 06 sts 0x0641, r25 ; 0x800641 pid_output=MAX_BED_POWER; 1f52a: 81 2c mov r8, r1 1f52c: 91 2c mov r9, r1 1f52e: 9f e7 ldi r25, 0x7F ; 127 1f530: a9 2e mov r10, r25 1f532: 93 e4 ldi r25, 0x43 ; 67 1f534: b9 2e mov r11, r25 #else pid_output = constrain(target, 0, MAX_BED_POWER); #endif //PID_OPENLOOP if(current < BED_MAXTEMP) 1f536: 20 e0 ldi r18, 0x00 ; 0 1f538: 30 e0 ldi r19, 0x00 ; 0 1f53a: 4a ef ldi r20, 0xFA ; 250 1f53c: 52 e4 ldi r21, 0x42 ; 66 1f53e: c3 01 movw r24, r6 1f540: b2 01 movw r22, r4 1f542: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1f546: 87 ff sbrs r24, 7 1f548: 6d c0 rjmp .+218 ; 0x1f624 { soft_pwm_bed = (int)pid_output >> 1; 1f54a: c5 01 movw r24, r10 1f54c: b4 01 movw r22, r8 1f54e: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 1f552: 75 95 asr r23 1f554: 67 95 ror r22 1f556: 60 93 5b 06 sts 0x065B, r22 ; 0x80065b soft_pwm_bed = 0; WRITE(HEATER_BED_PIN,LOW); } #endif //BED_LIMIT_SWITCHING if(target==0) 1f55a: 89 81 ldd r24, Y+1 ; 0x01 1f55c: 9a 81 ldd r25, Y+2 ; 0x02 1f55e: 89 2b or r24, r25 1f560: 11 f4 brne .+4 ; 0x1f566 { soft_pwm_bed = 0; 1f562: 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); } 1f566: 2e 96 adiw r28, 0x0e ; 14 1f568: 0f b6 in r0, 0x3f ; 63 1f56a: f8 94 cli 1f56c: de bf out 0x3e, r29 ; 62 1f56e: 0f be out 0x3f, r0 ; 63 1f570: cd bf out 0x3d, r28 ; 61 1f572: df 91 pop r29 1f574: cf 91 pop r28 1f576: 1f 91 pop r17 1f578: 0f 91 pop r16 1f57a: ff 90 pop r15 1f57c: ef 90 pop r14 1f57e: df 90 pop r13 1f580: cf 90 pop r12 1f582: bf 90 pop r11 1f584: af 90 pop r10 1f586: 9f 90 pop r9 1f588: 8f 90 pop r8 1f58a: 7f 90 pop r7 1f58c: 6f 90 pop r6 1f58e: 5f 90 pop r5 1f590: 4f 90 pop r4 1f592: 3f 90 pop r3 1f594: 2f 90 pop r2 1f596: 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) { 1f598: c5 01 movw r24, r10 1f59a: b4 01 movw r22, r8 1f59c: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1f5a0: 87 ff sbrs r24, 7 1f5a2: a9 ce rjmp .-686 ; 0x1f2f6 if (pid_error[e] < 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 1f5a4: 20 e0 ldi r18, 0x00 ; 0 1f5a6: 30 e0 ldi r19, 0x00 ; 0 1f5a8: a9 01 movw r20, r18 1f5aa: c7 01 movw r24, r14 1f5ac: b6 01 movw r22, r12 1f5ae: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1f5b2: 87 ff sbrs r24, 7 1f5b4: a3 cd rjmp .-1210 ; 0x1f0fc 1f5b6: a7 01 movw r20, r14 1f5b8: 96 01 movw r18, r12 1f5ba: 6d 85 ldd r22, Y+13 ; 0x0d 1f5bc: 79 85 ldd r23, Y+9 ; 0x09 1f5be: 81 2f mov r24, r17 1f5c0: 90 2f mov r25, r16 1f5c2: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1f5c6: 60 93 31 06 sts 0x0631, r22 ; 0x800631 1f5ca: 70 93 32 06 sts 0x0632, r23 ; 0x800632 1f5ce: 80 93 33 06 sts 0x0633, r24 ; 0x800633 1f5d2: 90 93 34 06 sts 0x0634, r25 ; 0x800634 1f5d6: 92 cd rjmp .-1244 ; 0x1f0fc // 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; 1f5d8: 10 92 62 06 sts 0x0662, r1 ; 0x800662 <_ZL8soft_pwm.lto_priv.506> 1f5dc: b1 ce rjmp .-670 ; 0x1f340 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){ 1f5de: c5 01 movw r24, r10 1f5e0: b4 01 movw r22, r8 1f5e2: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1f5e6: 87 ff sbrs r24, 7 1f5e8: a6 cf rjmp .-180 ; 0x1f536 if (pid_error_bed < 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 1f5ea: 20 e0 ldi r18, 0x00 ; 0 1f5ec: 30 e0 ldi r19, 0x00 ; 0 1f5ee: a9 01 movw r20, r18 1f5f0: c7 01 movw r24, r14 1f5f2: b6 01 movw r22, r12 1f5f4: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 1f5f8: 87 ff sbrs r24, 7 1f5fa: 10 c0 rjmp .+32 ; 0x1f61c 1f5fc: a7 01 movw r20, r14 1f5fe: 96 01 movw r18, r12 1f600: 6e 85 ldd r22, Y+14 ; 0x0e 1f602: 7d 85 ldd r23, Y+13 ; 0x0d 1f604: 83 2d mov r24, r3 1f606: 92 2d mov r25, r2 1f608: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 1f60c: 60 93 3e 06 sts 0x063E, r22 ; 0x80063e 1f610: 70 93 3f 06 sts 0x063F, r23 ; 0x80063f 1f614: 80 93 40 06 sts 0x0640, r24 ; 0x800640 1f618: 90 93 41 06 sts 0x0641, r25 ; 0x800641 pid_output=0; 1f61c: 81 2c mov r8, r1 1f61e: 91 2c mov r9, r1 1f620: 54 01 movw r10, r8 1f622: 89 cf rjmp .-238 ; 0x1f536 { soft_pwm_bed = (int)pid_output >> 1; } else { soft_pwm_bed = 0; 1f624: 10 92 5b 06 sts 0x065B, r1 ; 0x80065b 1f628: 98 cf rjmp .-208 ; 0x1f55a 0001f62a : } static void setIsrTargetTemperatures() { for(uint8_t e=0;e 1f62e: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 1f632: 90 93 5d 06 sts 0x065D, r25 ; 0x80065d 1f636: 80 93 5c 06 sts 0x065C, r24 ; 0x80065c target_temperature_bed_isr = target_temperature_bed; 1f63a: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed 1f63e: 90 91 ee 11 lds r25, 0x11EE ; 0x8011ee 1f642: 90 93 56 06 sts 0x0656, r25 ; 0x800656 1f646: 80 93 55 06 sts 0x0655, r24 ; 0x800655 } 1f64a: 08 95 ret 0001f64c : /* 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() { 1f64c: cf 93 push r28 { bool temp_mgr_state; public: TempMgrGuard() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1f64e: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1f650: f8 94 cli temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); 1f652: c0 91 71 00 lds r28, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1f656: c2 70 andi r28, 0x02 ; 2 DISABLE_TEMP_MGR_INTERRUPT(); 1f658: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1f65c: 8d 7f andi r24, 0xFD ; 253 1f65e: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1f662: 9f bf out 0x3f, r25 ; 63 } static void setCurrentTemperaturesFromIsr() { for(uint8_t e=0;e 1f668: 90 91 5f 06 lds r25, 0x065F ; 0x80065f 1f66c: a0 91 60 06 lds r26, 0x0660 ; 0x800660 1f670: b0 91 61 06 lds r27, 0x0661 ; 0x800661 1f674: 80 93 c4 0d sts 0x0DC4, r24 ; 0x800dc4 1f678: 90 93 c5 0d sts 0x0DC5, r25 ; 0x800dc5 1f67c: a0 93 c6 0d sts 0x0DC6, r26 ; 0x800dc6 1f680: b0 93 c7 0d sts 0x0DC7, r27 ; 0x800dc7 current_temperature_bed = current_temperature_bed_isr; 1f684: 80 91 57 06 lds r24, 0x0657 ; 0x800657 1f688: 90 91 58 06 lds r25, 0x0658 ; 0x800658 1f68c: a0 91 59 06 lds r26, 0x0659 ; 0x800659 1f690: b0 91 5a 06 lds r27, 0x065A ; 0x80065a 1f694: 80 93 8a 03 sts 0x038A, r24 ; 0x80038a 1f698: 90 93 8b 03 sts 0x038B, r25 ; 0x80038b 1f69c: a0 93 8c 03 sts 0x038C, r26 ; 0x80038c 1f6a0: b0 93 8d 03 sts 0x038D, r27 ; 0x80038d #ifdef PINDA_THERMISTOR current_temperature_pinda = current_temperature_pinda_isr; 1f6a4: 80 91 43 06 lds r24, 0x0643 ; 0x800643 1f6a8: 90 91 44 06 lds r25, 0x0644 ; 0x800644 1f6ac: a0 91 45 06 lds r26, 0x0645 ; 0x800645 1f6b0: b0 91 46 06 lds r27, 0x0646 ; 0x800646 1f6b4: 80 93 8e 06 sts 0x068E, r24 ; 0x80068e 1f6b8: 90 93 8f 06 sts 0x068F, r25 ; 0x80068f 1f6bc: a0 93 90 06 sts 0x0690, r26 ; 0x800690 1f6c0: 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) { 1f6c4: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 1f6c8: 81 11 cpse r24, r1 1f6ca: 02 c0 rjmp .+4 ; 0x1f6d0 // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); 1f6cc: 0e 94 15 fb call 0x1f62a ; 0x1f62a } temp_meas_ready = false; 1f6d0: 10 92 42 06 sts 0x0642, r1 ; 0x800642 DISABLE_TEMP_MGR_INTERRUPT(); } } ~TempMgrGuard() throw() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1f6d4: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1f6d6: f8 94 cli if(temp_mgr_state) ENABLE_TEMP_MGR_INTERRUPT(); 1f6d8: cc 23 and r28, r28 1f6da: 29 f0 breq .+10 ; 0x1f6e6 1f6dc: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1f6e0: 82 60 ori r24, 0x02 ; 2 1f6e2: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1f6e6: 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; } 1f6e8: cf 91 pop r28 1f6ea: 08 95 ret 0001f6ec : { // 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) 1f6ec: 81 30 cpi r24, 0x01 ; 1 1f6ee: 61 f1 breq .+88 ; 0x1f748 1f6f0: 20 f0 brcs .+8 ; 0x1f6fa 1f6f2: 82 30 cpi r24, 0x02 ; 2 1f6f4: 09 f4 brne .+2 ; 0x1f6f8 1f6f6: 4b c0 rjmp .+150 ; 0x1f78e 1f6f8: 08 95 ret { case X_AXIS: { enable_x(); 1f6fa: 17 98 cbi 0x02, 7 ; 2 uint8_t old_x_dir_pin = READ(X_DIR_PIN); 1f6fc: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 1f700: 81 e0 ldi r24, 0x01 ; 1 1f702: 29 2f mov r18, r25 1f704: 22 70 andi r18, 0x02 ; 2 1f706: 91 ff sbrs r25, 1 1f708: 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) { 1f70a: 86 17 cp r24, r22 1f70c: 59 f0 breq .+22 ; 0x1f724 WRITE_NC(X_DIR_PIN, new_x_dir_pin); 1f70e: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f712: 66 23 and r22, r22 1f714: a9 f0 breq .+42 ; 0x1f740 1f716: 82 60 ori r24, 0x02 ; 2 1f718: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif // busy wait __asm__ __volatile__ ( 1f71c: 8b e8 ldi r24, 0x8B ; 139 1f71e: 91 e0 ldi r25, 0x01 ; 1 1f720: 01 97 sbiw r24, 0x01 ; 1 1f722: f1 f7 brne .-4 ; 0x1f720 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(X_AXIS); 1f724: 40 9a sbi 0x08, 0 ; 8 1f726: 83 e0 ldi r24, 0x03 ; 3 1f728: 90 e0 ldi r25, 0x00 ; 0 1f72a: 01 97 sbiw r24, 0x01 ; 1 1f72c: f1 f7 brne .-4 ; 0x1f72a #ifdef DEBUG_XSTEP_DUP_PIN STEP_NC_HI(X_DUP_AXIS); #endif STEPPER_MINIMUM_DELAY; STEP_NC_LO(X_AXIS); 1f72e: 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); 1f730: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f734: 22 23 and r18, r18 1f736: 31 f0 breq .+12 ; 0x1f744 1f738: 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); 1f73a: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> } break; default: break; } } 1f73e: 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); 1f740: 8d 7f andi r24, 0xFD ; 253 1f742: ea cf rjmp .-44 ; 0x1f718 #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); 1f744: 8d 7f andi r24, 0xFD ; 253 1f746: f9 cf rjmp .-14 ; 0x1f73a } break; case Y_AXIS: { enable_y(); 1f748: 16 98 cbi 0x02, 6 ; 2 uint8_t old_y_dir_pin = READ(Y_DIR_PIN); 1f74a: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 1f74e: 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) { 1f750: 86 17 cp r24, r22 1f752: 59 f0 breq .+22 ; 0x1f76a WRITE_NC(Y_DIR_PIN, new_y_dir_pin); 1f754: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f758: 66 23 and r22, r22 1f75a: 99 f0 breq .+38 ; 0x1f782 1f75c: 91 60 ori r25, 0x01 ; 1 1f75e: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f762: eb e8 ldi r30, 0x8B ; 139 1f764: f1 e0 ldi r31, 0x01 ; 1 1f766: 31 97 sbiw r30, 0x01 ; 1 1f768: f1 f7 brne .-4 ; 0x1f766 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Y_AXIS); 1f76a: 41 9a sbi 0x08, 1 ; 8 1f76c: e3 e0 ldi r30, 0x03 ; 3 1f76e: f0 e0 ldi r31, 0x00 ; 0 1f770: 31 97 sbiw r30, 0x01 ; 1 1f772: f1 f7 brne .-4 ; 0x1f770 #ifdef DEBUG_YSTEP_DUP_PIN STEP_NC_HI(Y_DUP_AXIS); #endif STEPPER_MINIMUM_DELAY; STEP_NC_LO(Y_AXIS); 1f774: 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); 1f776: 88 23 and r24, r24 1f778: 31 f0 breq .+12 ; 0x1f786 1f77a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f77e: 81 60 ori r24, 0x01 ; 1 1f780: dc cf rjmp .-72 ; 0x1f73a 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); 1f782: 9e 7f andi r25, 0xFE ; 254 1f784: ec cf rjmp .-40 ; 0x1f75e #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); 1f786: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f78a: 8e 7f andi r24, 0xFE ; 254 1f78c: d6 cf rjmp .-84 ; 0x1f73a } break; case Z_AXIS: { enable_z(); 1f78e: 15 98 cbi 0x02, 5 ; 2 uint8_t old_z_dir_pin = READ(Z_DIR_PIN); 1f790: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 1f794: 81 e0 ldi r24, 0x01 ; 1 1f796: 29 2f mov r18, r25 1f798: 24 70 andi r18, 0x04 ; 4 1f79a: 92 ff sbrs r25, 2 1f79c: 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) { 1f79e: 68 17 cp r22, r24 1f7a0: 59 f0 breq .+22 ; 0x1f7b8 WRITE_NC(Z_DIR_PIN, new_z_dir_pin); 1f7a2: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f7a6: 66 23 and r22, r22 1f7a8: b1 f0 breq .+44 ; 0x1f7d6 1f7aa: 94 60 ori r25, 0x04 ; 4 1f7ac: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f7b0: eb e8 ldi r30, 0x8B ; 139 1f7b2: f1 e0 ldi r31, 0x01 ; 1 1f7b4: 31 97 sbiw r30, 0x01 ; 1 1f7b6: f1 f7 brne .-4 ; 0x1f7b4 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Z_AXIS); 1f7b8: 42 9a sbi 0x08, 2 ; 8 1f7ba: e3 e0 ldi r30, 0x03 ; 3 1f7bc: f0 e0 ldi r31, 0x00 ; 0 1f7be: 31 97 sbiw r30, 0x01 ; 1 1f7c0: f1 f7 brne .-4 ; 0x1f7be STEPPER_MINIMUM_DELAY; STEP_NC_LO(Z_AXIS); 1f7c2: 42 98 cbi 0x08, 2 ; 8 //get old pin state back. if (new_z_dir_pin != old_z_dir_pin) { 1f7c4: 68 17 cp r22, r24 1f7c6: 09 f4 brne .+2 ; 0x1f7ca 1f7c8: ba cf rjmp .-140 ; 0x1f73e WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 1f7ca: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 1f7ce: 22 23 and r18, r18 1f7d0: 21 f0 breq .+8 ; 0x1f7da 1f7d2: 84 60 ori r24, 0x04 ; 4 1f7d4: b2 cf rjmp .-156 ; 0x1f73a 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); 1f7d6: 9b 7f andi r25, 0xFB ; 251 1f7d8: e9 cf rjmp .-46 ; 0x1f7ac 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); 1f7da: 8b 7f andi r24, 0xFB ; 251 1f7dc: ae cf rjmp .-164 ; 0x1f73a 0001f7de : } } static void checkRx(void) { if (selectedSerialPort == 0) { 1f7de: 80 91 04 05 lds r24, 0x0504 ; 0x800504 1f7e2: 81 11 cpse r24, r1 1f7e4: 25 c0 rjmp .+74 ; 0x1f830 if((M_UCSRxA & (1< 1f7ea: 87 ff sbrs r24, 7 1f7ec: 3d c0 rjmp .+122 ; 0x1f868 // Test for a framing error. if (M_UCSRxA & (1< 1f7f2: 84 ff sbrs r24, 4 1f7f4: 03 c0 rjmp .+6 ; 0x1f7fc // 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); 1f7f6: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 1f7fa: 08 95 ret } else { unsigned char c = M_UDRx; 1f7fc: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 1f800: 20 91 af 05 lds r18, 0x05AF ; 0x8005af 1f804: 30 91 b0 05 lds r19, 0x05B0 ; 0x8005b0 1f808: c9 01 movw r24, r18 1f80a: 01 96 adiw r24, 0x01 ; 1 1f80c: 8f 77 andi r24, 0x7F ; 127 1f80e: 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) { 1f810: 60 91 b1 05 lds r22, 0x05B1 ; 0x8005b1 1f814: 70 91 b2 05 lds r23, 0x05B2 ; 0x8005b2 1f818: 86 17 cp r24, r22 1f81a: 97 07 cpc r25, r23 1f81c: 29 f1 breq .+74 ; 0x1f868 // 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; 1f81e: 21 5d subi r18, 0xD1 ; 209 1f820: 3a 4f sbci r19, 0xFA ; 250 1f822: f9 01 movw r30, r18 1f824: 40 83 st Z, r20 rx_buffer.head = i; 1f826: 90 93 b0 05 sts 0x05B0, r25 ; 0x8005b0 1f82a: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af 1f82e: 1c c0 rjmp .+56 ; 0x1f868 UDR1 = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } else { // if(selectedSerialPort == 1) { if((UCSR1A & (1< 1f834: 87 ff sbrs r24, 7 1f836: 18 c0 rjmp .+48 ; 0x1f868 // Test for a framing error. if (UCSR1A & (1< 1f83c: 84 ff sbrs r24, 4 1f83e: 03 c0 rjmp .+6 ; 0x1f846 // 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); 1f840: 80 91 ce 00 lds r24, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> 1f844: 08 95 ret } else { unsigned char c = UDR1; 1f846: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 1f84a: 20 91 af 05 lds r18, 0x05AF ; 0x8005af 1f84e: 30 91 b0 05 lds r19, 0x05B0 ; 0x8005b0 1f852: c9 01 movw r24, r18 1f854: 01 96 adiw r24, 0x01 ; 1 1f856: 8f 77 andi r24, 0x7F ; 127 1f858: 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) { 1f85a: 60 91 b1 05 lds r22, 0x05B1 ; 0x8005b1 1f85e: 70 91 b2 05 lds r23, 0x05B2 ; 0x8005b2 1f862: 68 17 cp r22, r24 1f864: 79 07 cpc r23, r25 1f866: d9 f6 brne .-74 ; 0x1f81e M_UDRx = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } } 1f868: 08 95 ret 0001f86a : static void Sound_DoSound_Alert(bool bOnce) { uint8_t nI,nMax; nMax=bOnce?1:3; 1f86a: 23 e0 ldi r18, 0x03 ; 3 1f86c: 81 11 cpse r24, r1 1f86e: 21 e0 ldi r18, 0x01 ; 1 for(nI=0;nI 1f882: 94 60 ori r25, 0x04 ; 4 1f884: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f888: 3f bf out 0x3f, r19 ; 63 1f88a: fb 01 movw r30, r22 1f88c: 31 97 sbiw r30, 0x01 ; 1 1f88e: f1 f7 brne .-4 ; 0x1f88c delayMicroseconds(200); WRITE(BEEPER,LOW); 1f890: 3f b7 in r19, 0x3f ; 63 1f892: f8 94 cli 1f894: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f898: 9b 7f andi r25, 0xFB ; 251 1f89a: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f89e: 3f bf out 0x3f, r19 ; 63 1f8a0: fa 01 movw r30, r20 1f8a2: 31 97 sbiw r30, 0x01 ; 1 1f8a4: f1 f7 brne .-4 ; 0x1f8a2 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); } } 1f8ac: 08 95 ret 0001f8ae : delayMicroseconds(75); } } static void Sound_DoSound_Echo(void) { 1f8ae: 8a e0 ldi r24, 0x0A ; 10 1f8b0: 2b e8 ldi r18, 0x8B ; 139 1f8b2: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0;nI<10;nI++) { WRITE(BEEPER,HIGH); 1f8b4: 4f b7 in r20, 0x3f ; 63 1f8b6: f8 94 cli 1f8b8: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f8bc: 94 60 ori r25, 0x04 ; 4 1f8be: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f8c2: 4f bf out 0x3f, r20 ; 63 1f8c4: f9 01 movw r30, r18 1f8c6: 31 97 sbiw r30, 0x01 ; 1 1f8c8: f1 f7 brne .-4 ; 0x1f8c6 delayMicroseconds(100); WRITE(BEEPER,LOW); 1f8ca: 4f b7 in r20, 0x3f ; 63 1f8cc: f8 94 cli 1f8ce: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f8d2: 9b 7f andi r25, 0xFB ; 251 1f8d4: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f8d8: 4f bf out 0x3f, r20 ; 63 1f8da: f9 01 movw r30, r18 1f8dc: 31 97 sbiw r30, 0x01 ; 1 1f8de: f1 f7 brne .-4 ; 0x1f8dc 1f8e0: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Echo(void) { uint8_t nI; for(nI=0;nI<10;nI++) 1f8e2: 41 f7 brne .-48 ; 0x1f8b4 WRITE(BEEPER,HIGH); delayMicroseconds(100); WRITE(BEEPER,LOW); delayMicroseconds(100); } } 1f8e4: 08 95 ret 0001f8e6 : } } static void lcd_checking_menu(void) { MENU_BEGIN(); 1f8e6: 0f 94 7b 93 call 0x326f6 ; 0x326f6 1f8ea: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1f8ee: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1f8f2: 84 30 cpi r24, 0x04 ; 4 1f8f4: d8 f5 brcc .+118 ; 0x1f96c 1f8f6: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 1f8fa: 8e e9 ldi r24, 0x9E ; 158 1f8fc: 9a e3 ldi r25, 0x3A ; 58 1f8fe: 0e 94 a7 6c call 0xd94e ; 0xd94e 1f902: 0f 94 46 96 call 0x32c8c ; 0x32c8c settings_check_toggle(&oCheckMode, _T(MSG_NOZZLE), lcd_check_mode_set); 1f906: 88 e8 ldi r24, 0x88 ; 136 1f908: 95 e5 ldi r25, 0x55 ; 85 1f90a: 0e 94 a7 6c call 0xd94e ; 0xd94e 1f90e: 45 ed ldi r20, 0xD5 ; 213 1f910: 5c ef ldi r21, 0xFC ; 252 1f912: bc 01 movw r22, r24 1f914: 80 91 bb 03 lds r24, 0x03BB ; 0x8003bb 1f918: 0e 94 e6 e1 call 0x1c3cc ; 0x1c3cc settings_check_toggle(&oCheckModel, _T(MSG_MODEL), lcd_check_model_set); 1f91c: 80 e8 ldi r24, 0x80 ; 128 1f91e: 95 e5 ldi r25, 0x55 ; 85 1f920: 0e 94 a7 6c call 0xd94e ; 0xd94e 1f924: 4b ec ldi r20, 0xCB ; 203 1f926: 5c ef ldi r21, 0xFC ; 252 1f928: bc 01 movw r22, r24 1f92a: 80 91 b8 03 lds r24, 0x03B8 ; 0x8003b8 1f92e: 0e 94 e6 e1 call 0x1c3cc ; 0x1c3cc settings_check_toggle(&oCheckVersion, MSG_FIRMWARE, lcd_check_version_set); 1f932: 41 ec ldi r20, 0xC1 ; 193 1f934: 5c ef ldi r21, 0xFC ; 252 1f936: 6e e5 ldi r22, 0x5E ; 94 1f938: 7b e6 ldi r23, 0x6B ; 107 1f93a: 80 91 b7 03 lds r24, 0x03B7 ; 0x8003b7 1f93e: 0e 94 e6 e1 call 0x1c3cc ; 0x1c3cc settings_check_toggle(&oCheckFilament, MSG_FILAMENT, lcd_check_filament_set); 1f942: 47 eb ldi r20, 0xB7 ; 183 1f944: 5c ef ldi r21, 0xFC ; 252 1f946: 64 e3 ldi r22, 0x34 ; 52 1f948: 79 e6 ldi r23, 0x69 ; 105 1f94a: 80 91 bc 03 lds r24, 0x03BC ; 0x8003bc 1f94e: 0e 94 e6 e1 call 0x1c3cc ; 0x1c3cc MENU_END(); 1f952: 0f 94 4f 93 call 0x3269e ; 0x3269e } } static void lcd_checking_menu(void) { MENU_BEGIN(); 1f956: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1f95a: 8f 5f subi r24, 0xFF ; 255 1f95c: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1f960: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1f964: 8f 5f subi r24, 0xFF ; 255 1f966: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1f96a: c1 cf rjmp .-126 ; 0x1f8ee 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(); } 1f96c: 08 95 ret 0001f96e : 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); 1f96e: 8c eb ldi r24, 0xBC ; 188 1f970: 93 e0 ldi r25, 0x03 ; 3 1f972: 0e 94 e8 f7 call 0x1efd0 ; 0x1efd0 1f976: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 1f97a: 80 e2 ldi r24, 0x20 ; 32 1f97c: 9c e0 ldi r25, 0x0C ; 12 1f97e: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 0001f982 : 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); 1f982: 87 eb ldi r24, 0xB7 ; 183 1f984: 93 e0 ldi r25, 0x03 ; 3 1f986: 0e 94 e8 f7 call 0x1efd0 ; 0x1efd0 1f98a: 60 91 b7 03 lds r22, 0x03B7 ; 0x8003b7 1f98e: 83 ea ldi r24, 0xA3 ; 163 1f990: 9d e0 ldi r25, 0x0D ; 13 1f992: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 0001f996 : 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); 1f996: 88 eb ldi r24, 0xB8 ; 184 1f998: 93 e0 ldi r25, 0x03 ; 3 1f99a: 0e 94 e8 f7 call 0x1efd0 ; 0x1efd0 1f99e: 60 91 b8 03 lds r22, 0x03B8 ; 0x8003b8 1f9a2: 84 ea ldi r24, 0xA4 ; 164 1f9a4: 9d e0 ldi r25, 0x0D ; 13 1f9a6: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 0001f9aa : *oCheckSetting = ClCheckMode::_None; } } static void lcd_check_mode_set() { lcd_check_update_RAM(&oCheckMode); 1f9aa: 8b eb ldi r24, 0xBB ; 187 1f9ac: 93 e0 ldi r25, 0x03 ; 3 1f9ae: 0e 94 e8 f7 call 0x1efd0 ; 0x1efd0 1f9b2: 60 91 bb 03 lds r22, 0x03BB ; 0x8003bb 1f9b6: 88 ea ldi r24, 0xA8 ; 168 1f9b8: 9d e0 ldi r25, 0x0D ; 13 1f9ba: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 0001f9be : #endif //FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_actionNA_set(void) { Filament_sensor::SensorActionOnError act = fsensor.getActionOnError(); switch(act) { 1f9be: 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; 1f9c2: 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) { 1f9c4: 81 11 cpse r24, r1 1f9c6: 01 c0 rjmp .+2 ; 0x1f9ca case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; 1f9c8: 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; 1f9ca: 60 93 8c 16 sts 0x168C, r22 ; 0x80168c 1f9ce: 87 e4 ldi r24, 0x47 ; 71 1f9d0: 9d e0 ldi r25, 0x0D ; 13 1f9d2: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 0001f9d6 : static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); } static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); 1f9d6: e4 e8 ldi r30, 0x84 ; 132 1f9d8: f6 e1 ldi r31, 0x16 ; 22 1f9da: 61 81 ldd r22, Z+1 ; 0x01 1f9dc: 81 e0 ldi r24, 0x01 ; 1 1f9de: 68 27 eor r22, r24 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1f9e0: 61 83 std Z+1, r22 ; 0x01 1f9e2: 87 e0 ldi r24, 0x07 ; 7 1f9e4: 9f e0 ldi r25, 0x0F ; 15 1f9e6: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 0001f9ea : static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); } static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); 1f9ea: e4 e8 ldi r30, 0x84 ; 132 1f9ec: f6 e1 ldi r31, 0x16 ; 22 1f9ee: 62 81 ldd r22, Z+2 ; 0x02 1f9f0: 81 e0 ldi r24, 0x01 ; 1 1f9f2: 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; 1f9f4: 62 83 std Z+2, r22 ; 0x02 1f9f6: 85 ed ldi r24, 0xD5 ; 213 1f9f8: 9e e0 ldi r25, 0x0E ; 14 1f9fa: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 0001f9fe : lcd_return_to_status(); } void lcd_toshiba_flash_air_compatibility_toggle() { card.ToshibaFlashAir_enable(! card.ToshibaFlashAir_isEnabled()); 1f9fe: eb ed ldi r30, 0xDB ; 219 1fa00: f5 e1 ldi r31, 0x15 ; 21 1fa02: 60 81 ld r22, Z 1fa04: 81 e0 ldi r24, 0x01 ; 1 1fa06: 68 27 eor r22, r24 1fa08: 60 83 st Z, r22 1fa0a: 8b eb ldi r24, 0xBB ; 187 1fa0c: 9f e0 ldi r25, 0x0F ; 15 1fa0e: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 0001fa12 : eeprom_update_byte_notify((uint8_t*)EEPROM_SOUND_MODE,(uint8_t)eSoundMode); } void Sound_CycleState(void) { switch(eSoundMode) 1fa12: 80 91 15 04 lds r24, 0x0415 ; 0x800415 1fa16: 81 30 cpi r24, 0x01 ; 1 1fa18: 71 f0 breq .+28 ; 0x1fa36 1fa1a: 20 f0 brcs .+8 ; 0x1fa24 1fa1c: 82 30 cpi r24, 0x02 ; 2 1fa1e: 69 f4 brne .+26 ; 0x1fa3a break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; 1fa20: 83 e0 ldi r24, 0x03 ; 3 1fa22: 01 c0 rjmp .+2 ; 0x1fa26 void Sound_CycleState(void) { switch(eSoundMode) { case e_SOUND_MODE_LOUD: eSoundMode=e_SOUND_MODE_ONCE; 1fa24: 81 e0 ldi r24, 0x01 ; 1 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; 1fa26: 80 93 15 04 sts 0x0415, r24 ; 0x800415 1fa2a: 60 91 15 04 lds r22, 0x0415 ; 0x800415 1fa2e: 87 ed ldi r24, 0xD7 ; 215 1fa30: 9e e0 ldi r25, 0x0E ; 14 1fa32: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 1fa36: 82 e0 ldi r24, 0x02 ; 2 1fa38: f6 cf rjmp .-20 ; 0x1fa26 break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; break; case e_SOUND_MODE_BLIND: eSoundMode=e_SOUND_MODE_LOUD; 1fa3a: 10 92 15 04 sts 0x0415, r1 ; 0x800415 1fa3e: f5 cf rjmp .-22 ; 0x1fa2a 0001fa40 : MENU_END(); } void lcd_set_fan_check() { fans_check_enabled = !fans_check_enabled; 1fa40: 60 91 40 02 lds r22, 0x0240 ; 0x800240 1fa44: 81 e0 ldi r24, 0x01 ; 1 1fa46: 68 27 eor r22, r24 1fa48: 60 93 40 02 sts 0x0240, r22 ; 0x800240 1fa4c: 87 e8 ldi r24, 0x87 ; 135 1fa4e: 9f e0 ldi r25, 0x0F ; 15 1fa50: 0f 94 bf a0 call 0x3417e ; 0x3417e 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. 1fa54: 80 91 40 02 lds r24, 0x0240 ; 0x800240 1fa58: 81 11 cpse r24, r1 1fa5a: 02 c0 rjmp .+4 ; 0x1fa60 1fa5c: 10 92 9c 03 sts 0x039C, r1 ; 0x80039c #endif //FANCHECK } 1fa60: 08 95 ret 0001fa62 : MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\ }\ }\ while (0) static void lcd_nozzle_diameter_cycle(void) { 1fa62: cf 93 push r28 1fa64: df 93 push r29 uint16_t nDiameter; switch(oNozzleDiameter){ 1fa66: 80 91 b9 03 lds r24, 0x03B9 ; 0x8003b9 1fa6a: 8c 33 cpi r24, 0x3C ; 60 1fa6c: e1 f0 breq .+56 ; 0x1faa6 1fa6e: 80 35 cpi r24, 0x50 ; 80 1fa70: 01 f1 breq .+64 ; 0x1fab2 1fa72: 88 32 cpi r24, 0x28 ; 40 1fa74: 91 f0 breq .+36 ; 0x1fa9a case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; 1fa76: 88 e2 ldi r24, 0x28 ; 40 1fa78: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 nDiameter=400; 1fa7c: c0 e9 ldi r28, 0x90 ; 144 1fa7e: d1 e0 ldi r29, 0x01 ; 1 1fa80: 60 91 b9 03 lds r22, 0x03B9 ; 0x8003b9 1fa84: 87 ea ldi r24, 0xA7 ; 167 1fa86: 9d e0 ldi r25, 0x0D ; 13 1fa88: 0f 94 bf a0 call 0x3417e ; 0x3417e if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 1fa8c: be 01 movw r22, r28 1fa8e: 85 ea ldi r24, 0xA5 ; 165 1fa90: 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); } 1fa92: df 91 pop r29 1fa94: cf 91 pop r28 1fa96: 0d 94 dd a0 jmp 0x341ba ; 0x341ba case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; nDiameter=400; break; case ClNozzleDiameter::_Diameter_400: oNozzleDiameter=ClNozzleDiameter::_Diameter_600; 1fa9a: 8c e3 ldi r24, 0x3C ; 60 1fa9c: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 nDiameter=600; 1faa0: c8 e5 ldi r28, 0x58 ; 88 1faa2: d2 e0 ldi r29, 0x02 ; 2 1faa4: ed cf rjmp .-38 ; 0x1fa80 break; case ClNozzleDiameter::_Diameter_600: oNozzleDiameter=ClNozzleDiameter::_Diameter_800; 1faa6: 80 e5 ldi r24, 0x50 ; 80 1faa8: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 nDiameter=800; 1faac: c0 e2 ldi r28, 0x20 ; 32 1faae: d3 e0 ldi r29, 0x03 ; 3 1fab0: e7 cf rjmp .-50 ; 0x1fa80 break; case ClNozzleDiameter::_Diameter_800: oNozzleDiameter=ClNozzleDiameter::_Diameter_250; 1fab2: 89 e1 ldi r24, 0x19 ; 25 1fab4: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 nDiameter=250; 1fab8: ca ef ldi r28, 0xFA ; 250 1faba: d0 e0 ldi r29, 0x00 ; 0 1fabc: e1 cf rjmp .-62 ; 0x1fa80 0001fabe : act = Filament_sensor::SensorActionOnError::_Continue; } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { 1fabe: cf 93 push r28 1fac0: df 93 push r29 MENU_BEGIN(); 1fac2: 0f 94 7b 93 call 0x326f6 ; 0x326f6 1fac6: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1faca: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1face: 84 30 cpi r24, 0x04 ; 4 1fad0: 08 f0 brcs .+2 ; 0x1fad4 1fad2: 96 c0 rjmp .+300 ; 0x1fc00 1fad4: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_BACK)); 1fad8: 84 e1 ldi r24, 0x14 ; 20 1fada: 90 e4 ldi r25, 0x40 ; 64 1fadc: 0e 94 a7 6c call 0xd94e ; 0xd94e 1fae0: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), fsensor.isEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_enabled_set); 1fae4: 80 91 84 16 lds r24, 0x1684 ; 0x801684 1fae8: 88 23 and r24, r24 1faea: f1 f1 breq .+124 ; 0x1fb68 1faec: 8f ea ldi r24, 0xAF ; 175 1faee: 9a e5 ldi r25, 0x5A ; 90 1faf0: 0e 94 a7 6c call 0xd94e ; 0xd94e 1faf4: ec 01 movw r28, r24 1faf6: 8d e4 ldi r24, 0x4D ; 77 1faf8: 9d e3 ldi r25, 0x3D ; 61 1fafa: 0e 94 a7 6c call 0xd94e ; 0xd94e 1fafe: 22 e0 ldi r18, 0x02 ; 2 1fb00: 44 e6 ldi r20, 0x64 ; 100 1fb02: 5e ef ldi r21, 0xFE ; 254 1fb04: be 01 movw r22, r28 1fb06: 0f 94 0a 95 call 0x32a14 ; 0x32a14 1fb0a: 80 91 84 16 lds r24, 0x1684 ; 0x801684 if (fsensor.isEnabled()) { 1fb0e: 88 23 and r24, r24 1fb10: 09 f4 brne .+2 ; 0x1fb14 1fb12: 66 c0 rjmp .+204 ; 0x1fbe0 if (fsensor.isError()) { 1fb14: 83 30 cpi r24, 0x03 ; 3 1fb16: 59 f5 brne .+86 ; 0x1fb6e MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), _T(MSG_NA), fsensor_reinit); 1fb18: 8c e8 ldi r24, 0x8C ; 140 1fb1a: 9d e3 ldi r25, 0x3D ; 61 1fb1c: 0e 94 a7 6c call 0xd94e ; 0xd94e 1fb20: ec 01 movw r28, r24 1fb22: 8c e4 ldi r24, 0x4C ; 76 1fb24: 95 e5 ldi r25, 0x55 ; 85 1fb26: 0e 94 a7 6c call 0xd94e ; 0xd94e 1fb2a: 22 e0 ldi r18, 0x02 ; 2 1fb2c: 4b e6 ldi r20, 0x6B ; 107 1fb2e: 5e ef ldi r21, 0xFE ; 254 1fb30: be 01 movw r22, r28 1fb32: 0f 94 0a 95 call 0x32a14 ; 0x32a14 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), _T(MSG_NA), fsensor_reinit); 1fb36: 8c e8 ldi r24, 0x8C ; 140 1fb38: 9d e3 ldi r25, 0x3D ; 61 1fb3a: 0e 94 a7 6c call 0xd94e ; 0xd94e 1fb3e: ec 01 movw r28, r24 1fb40: 8e e3 ldi r24, 0x3E ; 62 1fb42: 95 e5 ldi r25, 0x55 ; 85 1fb44: 0e 94 a7 6c call 0xd94e ; 0xd94e 1fb48: 22 e0 ldi r18, 0x02 ; 2 1fb4a: 4b e6 ldi r20, 0x6B ; 107 1fb4c: 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); 1fb4e: be 01 movw r22, r28 1fb50: 0f 94 0a 95 call 0x32a14 ; 0x32a14 #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()) { 1fb54: 80 91 8c 16 lds r24, 0x168C ; 0x80168c 1fb58: 88 23 and r24, r24 1fb5a: 99 f1 breq .+102 ; 0x1fbc2 1fb5c: 81 30 cpi r24, 0x01 ; 1 1fb5e: 09 f4 brne .+2 ; 0x1fb62 1fb60: 4c c0 rjmp .+152 ; 0x1fbfa 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(); 1fb62: 0e 94 df fc call 0x1f9be ; 0x1f9be 1fb66: 3c c0 rjmp .+120 ; 0x1fbe0 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); 1fb68: 89 ea ldi r24, 0xA9 ; 169 1fb6a: 9a e5 ldi r25, 0x5A ; 90 1fb6c: c1 cf rjmp .-126 ; 0x1faf0 #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); 1fb6e: 80 91 86 16 lds r24, 0x1686 ; 0x801686 1fb72: 88 23 and r24, r24 1fb74: 01 f1 breq .+64 ; 0x1fbb6 1fb76: 8f ea ldi r24, 0xAF ; 175 1fb78: 9a e5 ldi r25, 0x5A ; 90 1fb7a: 0e 94 a7 6c call 0xd94e ; 0xd94e 1fb7e: ec 01 movw r28, r24 1fb80: 8c e4 ldi r24, 0x4C ; 76 1fb82: 95 e5 ldi r25, 0x55 ; 85 1fb84: 0e 94 a7 6c call 0xd94e ; 0xd94e 1fb88: 22 e0 ldi r18, 0x02 ; 2 1fb8a: 45 ef ldi r20, 0xF5 ; 245 1fb8c: 5c ef ldi r21, 0xFC ; 252 1fb8e: be 01 movw r22, r28 1fb90: 0f 94 0a 95 call 0x32a14 ; 0x32a14 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 1fb94: 80 91 85 16 lds r24, 0x1685 ; 0x801685 1fb98: 88 23 and r24, r24 1fb9a: 81 f0 breq .+32 ; 0x1fbbc 1fb9c: 8f ea ldi r24, 0xAF ; 175 1fb9e: 9a e5 ldi r25, 0x5A ; 90 1fba0: 0e 94 a7 6c call 0xd94e ; 0xd94e 1fba4: ec 01 movw r28, r24 1fba6: 8e e3 ldi r24, 0x3E ; 62 1fba8: 95 e5 ldi r25, 0x55 ; 85 1fbaa: 0e 94 a7 6c call 0xd94e ; 0xd94e 1fbae: 22 e0 ldi r18, 0x02 ; 2 1fbb0: 4b ee ldi r20, 0xEB ; 235 1fbb2: 5c ef ldi r21, 0xFC ; 252 1fbb4: cc cf rjmp .-104 ; 0x1fb4e #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); 1fbb6: 89 ea ldi r24, 0xA9 ; 169 1fbb8: 9a e5 ldi r25, 0x5A ; 90 1fbba: df cf rjmp .-66 ; 0x1fb7a MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 1fbbc: 89 ea ldi r24, 0xA9 ; 169 1fbbe: 9a e5 ldi r25, 0x5A ; 90 1fbc0: ef cf rjmp .-34 ; 0x1fba0 #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); 1fbc2: 86 e3 ldi r24, 0x36 ; 54 1fbc4: 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); 1fbc6: 0e 94 a7 6c call 0xd94e ; 0xd94e 1fbca: ec 01 movw r28, r24 1fbcc: 8a e2 ldi r24, 0x2A ; 42 1fbce: 95 e5 ldi r25, 0x55 ; 85 1fbd0: 0e 94 a7 6c call 0xd94e ; 0xd94e 1fbd4: 22 e0 ldi r18, 0x02 ; 2 1fbd6: 4f ed ldi r20, 0xDF ; 223 1fbd8: 5c ef ldi r21, 0xFC ; 252 1fbda: be 01 movw r22, r28 1fbdc: 0f 94 0a 95 call 0x32a14 ; 0x32a14 default: lcd_fsensor_actionNA_set(); } } MENU_END(); 1fbe0: 0f 94 4f 93 call 0x3269e ; 0x3269e } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { MENU_BEGIN(); 1fbe4: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fbe8: 8f 5f subi r24, 0xFF ; 255 1fbea: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1fbee: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1fbf2: 8f 5f subi r24, 0xFF ; 255 1fbf4: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1fbf8: 68 cf rjmp .-304 ; 0x1faca 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); 1fbfa: 82 e2 ldi r24, 0x22 ; 34 1fbfc: 95 e5 ldi r25, 0x55 ; 85 1fbfe: e3 cf rjmp .-58 ; 0x1fbc6 lcd_fsensor_actionNA_set(); } } MENU_END(); } 1fc00: df 91 pop r29 1fc02: cf 91 pop r28 1fc04: 08 95 ret 0001fc06 : } } void SpoolJoin::toggleSpoolJoin() { if (eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Disabled) 1fc06: 86 ed ldi r24, 0xD6 ; 214 1fc08: 9e e0 ldi r25, 0x0E ; 14 1fc0a: 0f 94 9b a0 call 0x34136 ; 0x34136 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1fc0e: 61 e0 ldi r22, 0x01 ; 1 1fc10: 82 30 cpi r24, 0x02 ; 2 1fc12: 09 f0 breq .+2 ; 0x1fc16 1fc14: 62 e0 ldi r22, 0x02 ; 2 1fc16: 86 ed ldi r24, 0xD6 ; 214 1fc18: 9e e0 ldi r25, 0x0E ; 14 1fc1a: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 0001fc1e : } #ifdef MMU_HAS_CUTTER void lcd_cutter_enabled() { if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED)) 1fc1e: 8e ec ldi r24, 0xCE ; 206 1fc20: 9e e0 ldi r25, 0x0E ; 14 1fc22: 0f 94 9b a0 call 0x34136 ; 0x34136 1fc26: 60 e0 ldi r22, 0x00 ; 0 1fc28: 81 30 cpi r24, 0x01 ; 1 1fc2a: 09 f0 breq .+2 ; 0x1fc2e 1fc2c: 61 e0 ldi r22, 0x01 ; 1 1fc2e: 8e ec ldi r24, 0xCE ; 206 1fc30: 9e e0 ldi r25, 0x0E ; 14 1fc32: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 0001fc36 : 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); 1fc36: 8f ea ldi r24, 0xAF ; 175 1fc38: 9f e0 ldi r25, 0x0F ; 15 1fc3a: 0f 94 9b a0 call 0x34136 ; 0x34136 temp_cal_active = !temp_cal_active; 1fc3e: 61 e0 ldi r22, 0x01 ; 1 1fc40: 81 11 cpse r24, r1 1fc42: 60 e0 ldi r22, 0x00 ; 0 1fc44: 8f ea ldi r24, 0xAF ; 175 1fc46: 9f e0 ldi r25, 0x0F ; 15 1fc48: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 0001fc4c : } #ifdef SDCARD_SORT_ALPHA static void lcd_sort_type_set() { uint8_t sdSort; sdSort = eeprom_read_byte((uint8_t*) EEPROM_SD_SORT); 1fc4c: 89 e0 ldi r24, 0x09 ; 9 1fc4e: 9f e0 ldi r25, 0x0F ; 15 1fc50: 0f 94 9b a0 call 0x34136 ; 0x34136 switch (sdSort) { case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; 1fc54: 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) { 1fc56: 88 23 and r24, r24 1fc58: 21 f0 breq .+8 ; 0x1fc62 case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; 1fc5a: 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) { 1fc5c: 81 30 cpi r24, 0x01 ; 1 1fc5e: 09 f0 breq .+2 ; 0x1fc62 case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; default: sdSort = SD_SORT_TIME; 1fc60: 60 e0 ldi r22, 0x00 ; 0 1fc62: 89 e0 ldi r24, 0x09 ; 9 1fc64: 9f e0 ldi r25, 0x0F ; 15 1fc66: 0f 94 bf a0 call 0x3417e ; 0x3417e } eeprom_update_byte_notify((uint8_t*)EEPROM_SD_SORT, sdSort); card.presort_flag = true; 1fc6a: 81 e0 ldi r24, 0x01 ; 1 1fc6c: 80 93 b9 13 sts 0x13B9, r24 ; 0x8013b9 } 1fc70: 08 95 ret 0001fc72 : } } #endif //MMU_HAS_CUTTER bool shouldPreheatOnlyNozzle() { uint8_t eeprom_setting = eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT); 1fc72: 87 ea ldi r24, 0xA7 ; 167 1fc74: 9c e0 ldi r25, 0x0C ; 12 1fc76: 0f 94 9b a0 call 0x34136 ; 0x34136 if (eeprom_setting != 0) 1fc7a: 81 11 cpse r24, r1 1fc7c: 05 c0 rjmp .+10 ; 0x1fc88 return false; switch(eFilamentAction) { 1fc7e: 80 91 62 03 lds r24, 0x0362 ; 0x800362 1fc82: 81 50 subi r24, 0x01 ; 1 1fc84: 88 30 cpi r24, 0x08 ; 8 1fc86: 10 f0 brcs .+4 ; 0x1fc8c #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; 1fc88: 80 e0 ldi r24, 0x00 ; 0 1fc8a: 08 95 ret case FilamentAction::MmuLoad: case FilamentAction::MmuUnLoad: case FilamentAction::MmuLoadingTest: case FilamentAction::MmuEject: case FilamentAction::MmuCut: return true; 1fc8c: 81 e0 ldi r24, 0x01 ; 1 default: return false; } } 1fc8e: 08 95 ret 0001fc90 : #endif // MMU_FORCE_STEALTH_MODE } static void mmu_enable_switch() { uint8_t current_state = eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED); 1fc90: 8c ea ldi r24, 0xAC ; 172 1fc92: 9c e0 ldi r25, 0x0C ; 12 1fc94: 0f 94 9b a0 call 0x34136 ; 0x34136 if (current_state) 1fc98: 88 23 and r24, r24 1fc9a: 99 f0 breq .+38 ; 0x1fcc2 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 1fc9c: 10 92 94 12 sts 0x1294, r1 ; 0x801294 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 1fca0: 10 92 42 12 sts 0x1242, r1 ; 0x801242 currentScope = Scope::Stopped; 1fca4: 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)); 1fca8: 8c ea ldi r24, 0xAC ; 172 1fcaa: 9c e0 ldi r25, 0x0C ; 12 1fcac: 0f 94 9b a0 call 0x34136 ; 0x34136 1fcb0: 61 e0 ldi r22, 0x01 ; 1 1fcb2: 81 11 cpse r24, r1 1fcb4: 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); 1fcb6: 8c ea ldi r24, 0xAC ; 172 1fcb8: 9c e0 ldi r25, 0x0C ; 12 1fcba: 0f 94 e3 a0 call 0x341c6 ; 0x341c6 { MMU2::mmu2.Start(); } eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); 1fcbe: 0d 94 50 42 jmp 0x284a0 ; 0x284a0 { MMU2::mmu2.Stop(); } else { MMU2::mmu2.Start(); 1fcc2: 0f 94 59 63 call 0x2c6b2 ; 0x2c6b2 1fcc6: f0 cf rjmp .-32 ; 0x1fca8 0001fcc8 : static void fsensor_reinit() { fsensor.init(); } static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); 1fcc8: 81 e0 ldi r24, 0x01 ; 1 1fcca: 90 91 84 16 lds r25, 0x1684 ; 0x801684 1fcce: 91 11 cpse r25, r1 1fcd0: 80 e0 ldi r24, 0x00 ; 0 1fcd2: 0c 94 16 6e jmp 0xdc2c ; 0xdc2c 0001fcd6 : #endif // TMC2130 #ifdef FILAMENT_SENSOR static void fsensor_reinit() { fsensor.init(); 1fcd6: 0d 94 fd 53 jmp 0x2a7fa ; 0x2a7fa 0001fcda : #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 1fcda: 0e 94 1d 6a call 0xd43a ; 0xd43a lcd_status_message_idx = 0; // Re-draw message from beginning 1fcde: 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); 1fce2: 20 e0 ldi r18, 0x00 ; 0 1fce4: 41 e0 ldi r20, 0x01 ; 1 1fce6: 70 e0 ldi r23, 0x00 ; 0 1fce8: 60 e0 ldi r22, 0x00 ; 0 1fcea: 85 e1 ldi r24, 0x15 ; 21 1fcec: 97 e3 ldi r25, 0x37 ; 55 1fcee: 0f 94 a5 93 call 0x3274a ; 0x3274a menu_depth = 0; 1fcf2: 10 92 ad 03 sts 0x03AD, r1 ; 0x8003ad eFilamentAction = FilamentAction::None; // i.e. non-autoLoad 1fcf6: 10 92 62 03 sts 0x0362, r1 ; 0x800362 } 1fcfa: 08 95 ret 0001fcfc : } } #if (LANG_MODE != 0) void lcd_language() { 1fcfc: cf 93 push r28 1fcfe: df 93 push r29 lcd_update_enable(true); 1fd00: 81 e0 ldi r24, 0x01 ; 1 1fd02: 0e 94 b6 69 call 0xd36c ; 0xd36c menu_goto(lcd_language_menu, 0, true, true); 1fd06: 21 e0 ldi r18, 0x01 ; 1 1fd08: 41 e0 ldi r20, 0x01 ; 1 1fd0a: 70 e0 ldi r23, 0x00 ; 0 1fd0c: 60 e0 ldi r22, 0x00 ; 0 1fd0e: 89 e9 ldi r24, 0x99 ; 153 1fd10: 98 e3 ldi r25, 0x38 ; 56 1fd12: 0f 94 a5 93 call 0x3274a ; 0x3274a 1fd16: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout while ((menu_menu != lcd_status_screen) && (!lang_is_selected())) 1fd1a: c0 91 d0 03 lds r28, 0x03D0 ; 0x8003d0 1fd1e: d0 91 d1 03 lds r29, 0x03D1 ; 0x8003d1 1fd22: 0e 94 9b 6b call 0xd736 ; 0xd736 1fd26: c5 51 subi r28, 0x15 ; 21 1fd28: d7 43 sbci r29, 0x37 ; 55 1fd2a: 39 f0 breq .+14 ; 0x1fd3a 1fd2c: 81 11 cpse r24, r1 1fd2e: 07 c0 rjmp .+14 ; 0x1fd3e { delay_keep_alive(50); 1fd30: 82 e3 ldi r24, 0x32 ; 50 1fd32: 90 e0 ldi r25, 0x00 ; 0 1fd34: 0e 94 45 7c call 0xf88a ; 0xf88a 1fd38: f0 cf rjmp .-32 ; 0x1fd1a } if (lang_is_selected()) 1fd3a: 88 23 and r24, r24 1fd3c: 21 f0 breq .+8 ; 0x1fd46 lcd_return_to_status(); else lang_select(LANG_ID_PRI); } 1fd3e: df 91 pop r29 1fd40: 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(); 1fd42: 0c 94 6d fe jmp 0x1fcda ; 0x1fcda else lang_select(LANG_ID_PRI); 1fd46: 80 e0 ldi r24, 0x00 ; 0 } 1fd48: df 91 pop r29 1fd4a: cf 91 pop r28 delay_keep_alive(50); } if (lang_is_selected()) lcd_return_to_status(); else lang_select(LANG_ID_PRI); 1fd4c: 0c 94 3b 6c jmp 0xd876 ; 0xd876 0001fd50 : MYSERIAL.begin(BAUDRATE); } #endif //HAS_SECOND_SERIAL_PORT void lcd_calibrate_pinda() { enquecommand_P(PSTR("G76")); 1fd50: 61 e0 ldi r22, 0x01 ; 1 1fd52: 8c e1 ldi r24, 0x1C ; 28 1fd54: 98 e9 ldi r25, 0x98 ; 152 1fd56: 0e 94 ac 7c call 0xf958 ; 0xf958 lcd_return_to_status(); 1fd5a: 0c 94 6d fe jmp 0x1fcda ; 0x1fcda 0001fd5e : lcd_return_to_status(); } void lcd_mesh_calibration_z() { enquecommand_P(PSTR("M45 Z")); 1fd5e: 61 e0 ldi r22, 0x01 ; 1 1fd60: 86 e1 ldi r24, 0x16 ; 22 1fd62: 98 e9 ldi r25, 0x98 ; 152 1fd64: 0e 94 ac 7c call 0xf958 ; 0xf958 lcd_return_to_status(); 1fd68: 0c 94 6d fe jmp 0x1fcda ; 0x1fcda 0001fd6c : lcd_return_to_status(); } void lcd_mesh_calibration() { enquecommand_P(PSTR("M45")); 1fd6c: 61 e0 ldi r22, 0x01 ; 1 1fd6e: 82 e1 ldi r24, 0x12 ; 18 1fd70: 98 e9 ldi r25, 0x98 ; 152 1fd72: 0e 94 ac 7c call 0xf958 ; 0xf958 lcd_return_to_status(); 1fd76: 0c 94 6d fe jmp 0x1fcda ; 0x1fcda 0001fd7a : } #endif //(LANG_MODE != 0) void lcd_mesh_bedleveling() { enquecommand_P(PSTR("G80")); 1fd7a: 61 e0 ldi r22, 0x01 ; 1 1fd7c: 8e e0 ldi r24, 0x0E ; 14 1fd7e: 98 e9 ldi r25, 0x98 ; 152 1fd80: 0e 94 ac 7c call 0xf958 ; 0xf958 lcd_return_to_status(); 1fd84: 0c 94 6d fe jmp 0x1fcda ; 0x1fcda 0001fd88 : menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 1fd88: 0f 94 7b 93 call 0x326f6 ; 0x326f6 1fd8c: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1fd90: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fd94: 84 30 cpi r24, 0x04 ; 4 1fd96: a8 f5 brcc .+106 ; 0x1fe02 1fd98: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 1fd9c: 87 ea ldi r24, 0xA7 ; 167 1fd9e: 9d e3 ldi r25, 0x3D ; 61 1fda0: 0e 94 a7 6c call 0xd94e ; 0xd94e 1fda4: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_X), lcd_move_x); 1fda8: 8b e8 ldi r24, 0x8B ; 139 1fdaa: 9d e4 ldi r25, 0x4D ; 77 1fdac: 0e 94 a7 6c call 0xd94e ; 0xd94e 1fdb0: 65 ec ldi r22, 0xC5 ; 197 1fdb2: 77 e3 ldi r23, 0x37 ; 55 1fdb4: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Y), lcd_move_y); 1fdb8: 82 e8 ldi r24, 0x82 ; 130 1fdba: 9d e4 ldi r25, 0x4D ; 77 1fdbc: 0e 94 a7 6c call 0xd94e ; 0xd94e 1fdc0: 65 e7 ldi r22, 0x75 ; 117 1fdc2: 77 e3 ldi r23, 0x37 ; 55 1fdc4: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Z), lcd_move_z); 1fdc8: 89 e7 ldi r24, 0x79 ; 121 1fdca: 9d e4 ldi r25, 0x4D ; 77 1fdcc: 0e 94 a7 6c call 0xd94e ; 0xd94e 1fdd0: 6f eb ldi r22, 0xBF ; 191 1fdd2: 76 e3 ldi r23, 0x36 ; 54 1fdd4: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 MENU_ITEM_SUBMENU_P(_T(MSG_EXTRUDER), lcd_move_e); 1fdd8: 8e e6 ldi r24, 0x6E ; 110 1fdda: 9d e4 ldi r25, 0x4D ; 77 1fddc: 0e 94 a7 6c call 0xd94e ; 0xd94e 1fde0: 69 eb ldi r22, 0xB9 ; 185 1fde2: 77 e3 ldi r23, 0x37 ; 55 1fde4: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 MENU_END(); 1fde8: 0f 94 4f 93 call 0x3269e ; 0x3269e menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 1fdec: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fdf0: 8f 5f subi r24, 0xFF ; 255 1fdf2: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1fdf6: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1fdfa: 8f 5f subi r24, 0xFF ; 255 1fdfc: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1fe00: c7 cf rjmp .-114 ; 0x1fd90 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(); } 1fe02: 08 95 ret 0001fe04 : //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 1fe04: 0f 94 7b 93 call 0x326f6 ; 0x326f6 1fe08: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1fe0c: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fe10: 84 30 cpi r24, 0x04 ; 4 1fe12: 68 f5 brcc .+90 ; 0x1fe6e 1fe14: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1fe18: 88 ef ldi r24, 0xF8 ; 248 1fe1a: 9d e3 ldi r25, 0x3D ; 61 1fe1c: 0e 94 a7 6c call 0xd94e ; 0xd94e 1fe20: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_mmu_print); 1fe24: 8b ec ldi r24, 0xCB ; 203 1fe26: 98 e4 ldi r25, 0x48 ; 72 1fe28: 0e 94 a7 6c call 0xd94e ; 0xd94e 1fe2c: 65 ed ldi r22, 0xD5 ; 213 1fe2e: 77 e3 ldi r23, 0x37 ; 55 1fe30: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_mmu_total); 1fe34: 83 ec ldi r24, 0xC3 ; 195 1fe36: 98 e4 ldi r25, 0x48 ; 72 1fe38: 0e 94 a7 6c call 0xd94e ; 0xd94e 1fe3c: 6d e7 ldi r22, 0x7D ; 125 1fe3e: 77 e3 ldi r23, 0x37 ; 55 1fe40: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 MENU_ITEM_SUBMENU_P(_T(MSG_MATERIAL_CHANGES), lcd_menu_toolchange_stats_mmu_total); 1fe44: 87 e0 ldi r24, 0x07 ; 7 1fe46: 99 e4 ldi r25, 0x49 ; 73 1fe48: 0e 94 a7 6c call 0xd94e ; 0xd94e 1fe4c: 6f ec ldi r22, 0xCF ; 207 1fe4e: 76 e3 ldi r23, 0x36 ; 54 1fe50: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 MENU_END(); 1fe54: 0f 94 4f 93 call 0x3269e ; 0x3269e //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 1fe58: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fe5c: 8f 5f subi r24, 0xFF ; 255 1fe5e: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1fe62: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1fe66: 8f 5f subi r24, 0xFF ; 255 1fe68: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1fe6c: cf cf rjmp .-98 ; 0x1fe0c 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(); } 1fe6e: 08 95 ret 0001fe70 : //! |Rear side [µm]: | MSG_BED_CORRECTION_REAR //! |Reset | MSG_BED_CORRECTION_RESET //! ---------------------- //! @endcode void lcd_adjust_bed(void) { 1fe70: ef 92 push r14 1fe72: ff 92 push r15 1fe74: 0f 93 push r16 1fe76: 1f 93 push r17 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); if (_md->status == 0) 1fe78: 80 91 71 03 lds r24, 0x0371 ; 0x800371 1fe7c: 81 11 cpse r24, r1 1fe7e: 35 c0 rjmp .+106 ; 0x1feea { // Menu was entered. if (eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1) 1fe80: 80 ec ldi r24, 0xC0 ; 192 1fe82: 9f e0 ldi r25, 0x0F ; 15 1fe84: 0f 94 9b a0 call 0x34136 ; 0x34136 1fe88: 81 30 cpi r24, 0x01 ; 1 1fe8a: 61 f5 brne .+88 ; 0x1fee4 { _md->left = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_LEFT); 1fe8c: 8f eb ldi r24, 0xBF ; 191 1fe8e: 9f e0 ldi r25, 0x0F ; 15 1fe90: 0f 94 9b a0 call 0x34136 ; 0x34136 1fe94: 08 2e mov r0, r24 1fe96: 00 0c add r0, r0 1fe98: 99 0b sbc r25, r25 1fe9a: 90 93 73 03 sts 0x0373, r25 ; 0x800373 1fe9e: 80 93 72 03 sts 0x0372, r24 ; 0x800372 _md->right = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_RIGHT); 1fea2: 8e eb ldi r24, 0xBE ; 190 1fea4: 9f e0 ldi r25, 0x0F ; 15 1fea6: 0f 94 9b a0 call 0x34136 ; 0x34136 1feaa: 08 2e mov r0, r24 1feac: 00 0c add r0, r0 1feae: 99 0b sbc r25, r25 1feb0: 90 93 75 03 sts 0x0375, r25 ; 0x800375 1feb4: 80 93 74 03 sts 0x0374, r24 ; 0x800374 _md->front = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_FRONT); 1feb8: 8d eb ldi r24, 0xBD ; 189 1feba: 9f e0 ldi r25, 0x0F ; 15 1febc: 0f 94 9b a0 call 0x34136 ; 0x34136 1fec0: 08 2e mov r0, r24 1fec2: 00 0c add r0, r0 1fec4: 99 0b sbc r25, r25 1fec6: 90 93 77 03 sts 0x0377, r25 ; 0x800377 1feca: 80 93 76 03 sts 0x0376, r24 ; 0x800376 _md->rear = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_REAR); 1fece: 8c eb ldi r24, 0xBC ; 188 1fed0: 9f e0 ldi r25, 0x0F ; 15 1fed2: 0f 94 9b a0 call 0x34136 ; 0x34136 1fed6: 08 2e mov r0, r24 1fed8: 00 0c add r0, r0 1feda: 99 0b sbc r25, r25 1fedc: 90 93 79 03 sts 0x0379, r25 ; 0x800379 1fee0: 80 93 78 03 sts 0x0378, r24 ; 0x800378 } _md->status = 1; 1fee4: 81 e0 ldi r24, 0x01 ; 1 1fee6: 80 93 71 03 sts 0x0371, r24 ; 0x800371 } MENU_BEGIN(); 1feea: 0f 94 7b 93 call 0x326f6 ; 0x326f6 1feee: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 1fef2: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1fef6: 84 30 cpi r24, 0x04 ; 4 1fef8: 08 f0 brcs .+2 ; 0x1fefc 1fefa: 6e c0 rjmp .+220 ; 0x1ffd8 1fefc: 10 92 31 04 sts 0x0431, r1 ; 0x800431 // leaving menu - this condition must be immediately before MENU_ITEM_BACK_P ON_MENU_LEAVE( 1ff00: 0f 94 fb 91 call 0x323f6 ; 0x323f6 1ff04: 88 23 and r24, r24 1ff06: e9 f0 breq .+58 ; 0x1ff42 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1ff08: 60 91 72 03 lds r22, 0x0372 ; 0x800372 1ff0c: 8f eb ldi r24, 0xBF ; 191 1ff0e: 9f e0 ldi r25, 0x0F ; 15 1ff10: 0f 94 bf a0 call 0x3417e ; 0x3417e 1ff14: 60 91 76 03 lds r22, 0x0376 ; 0x800376 1ff18: 8d eb ldi r24, 0xBD ; 189 1ff1a: 9f e0 ldi r25, 0x0F ; 15 1ff1c: 0f 94 bf a0 call 0x3417e ; 0x3417e 1ff20: 60 91 78 03 lds r22, 0x0378 ; 0x800378 1ff24: 8c eb ldi r24, 0xBC ; 188 1ff26: 9f e0 ldi r25, 0x0F ; 15 1ff28: 0f 94 bf a0 call 0x3417e ; 0x3417e 1ff2c: 60 91 74 03 lds r22, 0x0374 ; 0x800374 1ff30: 8e eb ldi r24, 0xBE ; 190 1ff32: 9f e0 ldi r25, 0x0F ; 15 1ff34: 0f 94 bf a0 call 0x3417e ; 0x3417e 1ff38: 61 e0 ldi r22, 0x01 ; 1 1ff3a: 80 ec ldi r24, 0xC0 ; 192 1ff3c: 9f e0 ldi r25, 0x0F ; 15 1ff3e: 0f 94 bf a0 call 0x3417e ; 0x3417e 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)); 1ff42: 84 e1 ldi r24, 0x14 ; 20 1ff44: 90 e4 ldi r25, 0x40 ; 64 1ff46: 0e 94 a7 6c call 0xd94e ; 0xd94e 1ff4a: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_LEFT), &_md->left, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 1ff4e: 86 ee ldi r24, 0xE6 ; 230 1ff50: 9b e4 ldi r25, 0x4B ; 75 1ff52: 0e 94 a7 6c call 0xd94e ; 0xd94e 1ff56: f1 2c mov r15, r1 1ff58: e1 2c mov r14, r1 1ff5a: 04 e6 ldi r16, 0x64 ; 100 1ff5c: 10 e0 ldi r17, 0x00 ; 0 1ff5e: 2c e9 ldi r18, 0x9C ; 156 1ff60: 3f ef ldi r19, 0xFF ; 255 1ff62: 40 e1 ldi r20, 0x10 ; 16 1ff64: 62 e7 ldi r22, 0x72 ; 114 1ff66: 73 e0 ldi r23, 0x03 ; 3 1ff68: 0f 94 cb 93 call 0x32796 ; 0x32796 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_RIGHT), &_md->right, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 1ff6c: 85 ed ldi r24, 0xD5 ; 213 1ff6e: 9b e4 ldi r25, 0x4B ; 75 1ff70: 0e 94 a7 6c call 0xd94e ; 0xd94e 1ff74: 2c e9 ldi r18, 0x9C ; 156 1ff76: 3f ef ldi r19, 0xFF ; 255 1ff78: 40 e1 ldi r20, 0x10 ; 16 1ff7a: 64 e7 ldi r22, 0x74 ; 116 1ff7c: 73 e0 ldi r23, 0x03 ; 3 1ff7e: 0f 94 cb 93 call 0x32796 ; 0x32796 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_FRONT), &_md->front, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 1ff82: 84 ec ldi r24, 0xC4 ; 196 1ff84: 9b e4 ldi r25, 0x4B ; 75 1ff86: 0e 94 a7 6c call 0xd94e ; 0xd94e 1ff8a: 2c e9 ldi r18, 0x9C ; 156 1ff8c: 3f ef ldi r19, 0xFF ; 255 1ff8e: 40 e1 ldi r20, 0x10 ; 16 1ff90: 66 e7 ldi r22, 0x76 ; 118 1ff92: 73 e0 ldi r23, 0x03 ; 3 1ff94: 0f 94 cb 93 call 0x32796 ; 0x32796 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_REAR), &_md->rear, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 1ff98: 83 eb ldi r24, 0xB3 ; 179 1ff9a: 9b e4 ldi r25, 0x4B ; 75 1ff9c: 0e 94 a7 6c call 0xd94e ; 0xd94e 1ffa0: 2c e9 ldi r18, 0x9C ; 156 1ffa2: 3f ef ldi r19, 0xFF ; 255 1ffa4: 40 e1 ldi r20, 0x10 ; 16 1ffa6: 68 e7 ldi r22, 0x78 ; 120 1ffa8: 73 e0 ldi r23, 0x03 ; 3 1ffaa: 0f 94 cb 93 call 0x32796 ; 0x32796 MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_adjust_bed_reset); 1ffae: 88 ec ldi r24, 0xC8 ; 200 1ffb0: 9b e3 ldi r25, 0x3B ; 59 1ffb2: 0e 94 a7 6c call 0xd94e ; 0xd94e 1ffb6: 6f eb ldi r22, 0xBF ; 191 1ffb8: 77 e3 ldi r23, 0x37 ; 55 1ffba: 0f 94 f8 92 call 0x325f0 ; 0x325f0 MENU_END(); 1ffbe: 0f 94 4f 93 call 0x3269e ; 0x3269e _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(); 1ffc2: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 1ffc6: 8f 5f subi r24, 0xFF ; 255 1ffc8: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 1ffcc: 80 91 30 04 lds r24, 0x0430 ; 0x800430 1ffd0: 8f 5f subi r24, 0xFF ; 255 1ffd2: 80 93 30 04 sts 0x0430, r24 ; 0x800430 1ffd6: 8d cf rjmp .-230 ; 0x1fef2 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(); } 1ffd8: 1f 91 pop r17 1ffda: 0f 91 pop r16 1ffdc: ff 90 pop r15 1ffde: ef 90 pop r14 1ffe0: 08 95 ret 0001ffe2 : //! | | //! ---------------------- //! @endcode void pid_extruder() { lcd_clear(); 1ffe2: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_puts_at_P(0, 0, _T(MSG_SET_TEMPERATURE)); 1ffe6: 87 ef ldi r24, 0xF7 ; 247 1ffe8: 9b e4 ldi r25, 0x4B ; 75 1ffea: 0e 94 a7 6c call 0xd94e ; 0xd94e 1ffee: ac 01 movw r20, r24 1fff0: 60 e0 ldi r22, 0x00 ; 0 1fff2: 80 e0 ldi r24, 0x00 ; 0 1fff4: 0e 94 85 69 call 0xd30a ; 0xd30a pid_temp += lcd_encoder; 1fff8: 80 91 4e 02 lds r24, 0x024E ; 0x80024e <_ZL8pid_temp.lto_priv.411> 1fffc: 90 91 4f 02 lds r25, 0x024F ; 0x80024f <_ZL8pid_temp.lto_priv.411+0x1> 20000: 20 91 06 05 lds r18, 0x0506 ; 0x800506 20004: 30 91 07 05 lds r19, 0x0507 ; 0x800507 20008: 82 0f add r24, r18 2000a: 93 1f adc r25, r19 if (pid_temp > HEATER_0_MAXTEMP) pid_temp = HEATER_0_MAXTEMP; 2000c: 82 33 cpi r24, 0x32 ; 50 2000e: 21 e0 ldi r18, 0x01 ; 1 20010: 92 07 cpc r25, r18 20012: 50 f1 brcs .+84 ; 0x20068 20014: 81 e3 ldi r24, 0x31 ; 49 20016: 91 e0 ldi r25, 0x01 ; 1 else if (pid_temp < HEATER_0_MINTEMP) pid_temp = HEATER_0_MINTEMP; 20018: 90 93 4f 02 sts 0x024F, r25 ; 0x80024f <_ZL8pid_temp.lto_priv.411+0x1> 2001c: 80 93 4e 02 sts 0x024E, r24 ; 0x80024e <_ZL8pid_temp.lto_priv.411> lcd_encoder = 0; 20020: 10 92 07 05 sts 0x0507, r1 ; 0x800507 20024: 10 92 06 05 sts 0x0506, r1 ; 0x800506 lcd_set_cursor(1, 2); 20028: 62 e0 ldi r22, 0x02 ; 2 2002a: 81 e0 ldi r24, 0x01 ; 1 2002c: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_printf_P(PSTR("%3u"), pid_temp); 20030: 80 91 4f 02 lds r24, 0x024F ; 0x80024f <_ZL8pid_temp.lto_priv.411+0x1> 20034: 8f 93 push r24 20036: 80 91 4e 02 lds r24, 0x024E ; 0x80024e <_ZL8pid_temp.lto_priv.411> 2003a: 8f 93 push r24 2003c: 85 e7 ldi r24, 0x75 ; 117 2003e: 97 e9 ldi r25, 0x97 ; 151 20040: 9f 93 push r25 20042: 8f 93 push r24 20044: 0e 94 4a 69 call 0xd294 ; 0xd294 if (lcd_clicked()) { 20048: 0e 94 8e 6b call 0xd71c ; 0xd71c 2004c: 0f 90 pop r0 2004e: 0f 90 pop r0 20050: 0f 90 pop r0 20052: 0f 90 pop r0 20054: 88 23 and r24, r24 20056: 71 f0 breq .+28 ; 0x20074 lcd_commands_type = LcdCommands::PidExtruder; 20058: 83 e0 ldi r24, 0x03 ; 3 2005a: 80 93 c8 0d sts 0x0DC8, r24 ; 0x800dc8 lcd_return_to_status(); 2005e: 0e 94 6d fe call 0x1fcda ; 0x1fcda lcd_update(2); 20062: 82 e0 ldi r24, 0x02 ; 2 20064: 0c 94 38 69 jmp 0xd270 ; 0xd270 { 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; 20068: 8e 31 cpi r24, 0x1E ; 30 2006a: 91 05 cpc r25, r1 2006c: a8 f6 brcc .-86 ; 0x20018 2006e: 8e e1 ldi r24, 0x1E ; 30 20070: 90 e0 ldi r25, 0x00 ; 0 20072: d2 cf rjmp .-92 ; 0x20018 lcd_commands_type = LcdCommands::PidExtruder; lcd_return_to_status(); lcd_update(2); } } 20074: 08 95 ret 00020076 : #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){ 20076: cf 93 push r28 20078: df 93 push r29 2007a: cd b7 in r28, 0x3d ; 61 2007c: de b7 in r29, 0x3e ; 62 2007e: 2f 97 sbiw r28, 0x0f ; 15 20080: 0f b6 in r0, 0x3f ; 63 20082: f8 94 cli 20084: de bf out 0x3e, r29 ; 62 20086: 0f be out 0x3f, r0 ; 63 20088: cd bf out 0x3d, r28 ; 61 2008a: fc 01 movw r30, r24 2008c: de 01 movw r26, r28 2008e: 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; 20090: 90 e0 ldi r25, 0x00 ; 0 20092: 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); 20094: 84 91 lpm r24, Z 20096: 41 e0 ldi r20, 0x01 ; 1 20098: 49 0f add r20, r25 if( ! b ) 2009a: 88 23 and r24, r24 2009c: 29 f0 breq .+10 ; 0x200a8 break; dst[i] = b; 2009e: 8d 93 st X+, r24 200a0: 31 96 adiw r30, 0x01 ; 1 200a2: 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 200a4: 4d 30 cpi r20, 0x0D ; 13 200a6: b1 f7 brne .-20 ; 0x20094 uint8_t b = pgm_read_byte(ipgmLabel + i); if( ! b ) break; dst[i] = b; } dst[i] = ':'; // append the colon 200a8: f9 01 movw r30, r18 200aa: e9 0f add r30, r25 200ac: f1 1d adc r31, r1 200ae: 8a e3 ldi r24, 0x3A ; 58 200b0: 80 83 st Z, r24 ++i; 200b2: 9f 5f subi r25, 0xFF ; 255 200b4: f9 01 movw r30, r18 200b6: e9 0f add r30, r25 200b8: f1 1d adc r31, r1 for(; i < dstSize - 1; ++i) // fill the rest with spaces dst[i] = ' '; 200ba: 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 200bc: 9e 30 cpi r25, 0x0E ; 14 200be: 19 f0 breq .+6 ; 0x200c6 dst[i] = ' '; 200c0: 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 200c2: 9f 5f subi r25, 0xFF ; 255 200c4: fb cf rjmp .-10 ; 0x200bc dst[i] = ' '; dst[dstSize-1] = '\0'; // terminate the string properly 200c6: 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 200c8: 7f 93 push r23 200ca: 6f 93 push r22 200cc: 3f 93 push r19 200ce: 2f 93 push r18 200d0: 88 e5 ldi r24, 0x58 ; 88 200d2: 95 e9 ldi r25, 0x95 ; 149 200d4: 9f 93 push r25 200d6: 8f 93 push r24 200d8: 0e 94 4a 69 call 0xd294 ; 0xd294 200dc: 0f 90 pop r0 200de: 0f 90 pop r0 200e0: 0f 90 pop r0 200e2: 0f 90 pop r0 200e4: 0f 90 pop r0 200e6: 0f 90 pop r0 } 200e8: 2f 96 adiw r28, 0x0f ; 15 200ea: 0f b6 in r0, 0x3f ; 63 200ec: f8 94 cli 200ee: de bf out 0x3e, r29 ; 62 200f0: 0f be out 0x3f, r0 ; 63 200f2: cd bf out 0x3d, r28 ; 61 200f4: df 91 pop r29 200f6: cf 91 pop r28 200f8: 08 95 ret 000200fa : //! |>Continue | MSG_CONTINUE //! | Reset | MSG_RESET //! ---------------------- //! @endcode void lcd_first_layer_calibration_reset() { 200fa: af 92 push r10 200fc: bf 92 push r11 200fe: cf 92 push r12 20100: df 92 push r13 20102: ef 92 push r14 20104: ff 92 push r15 20106: 0f 93 push r16 20108: 1f 93 push r17 2010a: cf 93 push r28 2010c: df 93 push r29 2010e: 00 d0 rcall .+0 ; 0x20110 20110: 00 d0 rcall .+0 ; 0x20112 20112: 1f 92 push r1 20114: cd b7 in r28, 0x3d ; 61 20116: 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)) || 20118: 80 91 63 03 lds r24, 0x0363 ; 0x800363 2011c: 81 11 cpse r24, r1 2011e: 18 c0 rjmp .+48 ; 0x20150 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))) || 20120: 81 ea ldi r24, 0xA1 ; 161 20122: 9d e0 ldi r25, 0x0D ; 13 20124: 0f 94 9b a0 call 0x34136 ; 0x34136 20128: 18 2f mov r17, r24 2012a: 0e 94 0e 6f call 0xde1c ; 0xde1c 2012e: 88 23 and r24, r24 20130: 79 f0 breq .+30 ; 0x20150 (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) || 20132: 80 e1 ldi r24, 0x10 ; 16 20134: 0e 94 52 d8 call 0x1b0a4 ; 0x1b0a4 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))) || 20138: 88 23 and r24, r24 2013a: 51 f0 breq .+20 ; 0x20150 (!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))))) 2013c: 2b e0 ldi r18, 0x0B ; 11 2013e: 12 9f mul r17, r18 20140: c0 01 movw r24, r0 20142: 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 20144: 80 5b subi r24, 0xB0 ; 176 20146: 92 4f sbci r25, 0xF2 ; 242 20148: 0f 94 a9 a0 call 0x34152 ; 0x34152 } 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)) || 2014c: 89 2b or r24, r25 2014e: f1 f4 brne .+60 ; 0x2018c (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) 20150: 80 91 64 03 lds r24, 0x0364 ; 0x800364 20154: 88 23 and r24, r24 20156: 71 f0 breq .+28 ; 0x20174 { eeprom_update_word_notify(reinterpret_cast(&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset), 0xffff); 20158: 81 ea ldi r24, 0xA1 ; 161 2015a: 9d e0 ldi r25, 0x0D ; 13 2015c: 0f 94 9b a0 call 0x34136 ; 0x34136 20160: 2b e0 ldi r18, 0x0B ; 11 20162: 82 9f mul r24, r18 20164: c0 01 movw r24, r0 20166: 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); 20168: 6f ef ldi r22, 0xFF ; 255 2016a: 7f ef ldi r23, 0xFF ; 255 2016c: 80 5b subi r24, 0xB0 ; 176 2016e: 92 4f sbci r25, 0xF2 ; 242 20170: 0f 94 dd a0 call 0x341ba ; 0x341ba } // 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()); 20174: 0e 94 8e 6b call 0xd71c ; 0xd71c 20178: 21 e0 ldi r18, 0x01 ; 1 2017a: 81 11 cpse r24, r1 2017c: 20 e0 ldi r18, 0x00 ; 0 2017e: 41 e0 ldi r20, 0x01 ; 1 20180: 70 e0 ldi r23, 0x00 ; 0 20182: 60 e0 ldi r22, 0x00 ; 0 20184: 8f ed ldi r24, 0xDF ; 223 20186: 96 e3 ldi r25, 0x36 ; 54 20188: 0f 94 a5 93 call 0x3274a ; 0x3274a } if (lcd_encoder) { 2018c: 20 91 06 05 lds r18, 0x0506 ; 0x800506 20190: 30 91 07 05 lds r19, 0x0507 ; 0x800507 20194: 21 15 cp r18, r1 20196: 31 05 cpc r19, r1 20198: 59 f0 breq .+22 ; 0x201b0 menuData->reset = lcd_encoder > 0; 2019a: 81 e0 ldi r24, 0x01 ; 1 2019c: 12 16 cp r1, r18 2019e: 13 06 cpc r1, r19 201a0: 0c f0 brlt .+2 ; 0x201a4 201a2: 80 e0 ldi r24, 0x00 ; 0 201a4: 80 93 64 03 sts 0x0364, r24 ; 0x800364 lcd_encoder = 0; // Reset 201a8: 10 92 07 05 sts 0x0507, r1 ; 0x800507 201ac: 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)); 201b0: 81 ea ldi r24, 0xA1 ; 161 201b2: 9d e0 ldi r25, 0x0D ; 13 201b4: 0f 94 9b a0 call 0x34136 ; 0x34136 201b8: 1b e0 ldi r17, 0x0B ; 11 201ba: 81 9f mul r24, r17 201bc: b0 01 movw r22, r0 201be: 11 24 eor r1, r1 201c0: 67 5b subi r22, 0xB7 ; 183 201c2: 72 4f sbci r23, 0xF2 ; 242 201c4: 47 e0 ldi r20, 0x07 ; 7 201c6: 50 e0 ldi r21, 0x00 ; 0 201c8: ce 01 movw r24, r28 201ca: 01 96 adiw r24, 0x01 ; 1 201cc: 7c 01 movw r14, r24 201ce: 0f 94 8b a0 call 0x34116 ; 0x34116 lcd_home(); 201d2: 0e 94 9d 69 call 0xd33a ; 0xd33a 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]; 201d6: 81 ea ldi r24, 0xA1 ; 161 201d8: 9d e0 ldi r25, 0x0D ; 13 201da: 0f 94 9b a0 call 0x34136 ; 0x34136 201de: 81 9f mul r24, r17 201e0: c0 01 movw r24, r0 201e2: 11 24 eor r1, r1 201e4: 80 5b subi r24, 0xB0 ; 176 201e6: 92 4f sbci r25, 0xF2 ; 242 201e8: 0f 94 a9 a0 call 0x34152 ; 0x34152 201ec: bc 01 movw r22, r24 201ee: 99 0f add r25, r25 201f0: 88 0b sbc r24, r24 201f2: 99 0b sbc r25, r25 201f4: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 201f8: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 201fc: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 20200: 40 91 40 04 lds r20, 0x0440 ; 0x800440 20204: 50 91 41 04 lds r21, 0x0441 ; 0x800441 20208: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2020c: d6 2e mov r13, r22 2020e: c7 2e mov r12, r23 20210: b8 2e mov r11, r24 20212: a9 2e mov r10, r25 lcd_printf_P(_T(MSG_SHEET_OFFSET), 20214: 80 91 64 03 lds r24, 0x0364 ; 0x800364 20218: 0e e3 ldi r16, 0x3E ; 62 2021a: 10 e2 ldi r17, 0x20 ; 32 2021c: 81 11 cpse r24, r1 2021e: 02 c0 rjmp .+4 ; 0x20224 20220: 00 e2 ldi r16, 0x20 ; 32 20222: 1e e3 ldi r17, 0x3E ; 62 20224: 84 e9 ldi r24, 0x94 ; 148 20226: 9d e4 ldi r25, 0x4D ; 77 20228: 0e 94 a7 6c call 0xd94e ; 0xd94e 2022c: 1f 92 push r1 2022e: 0f 93 push r16 20230: 1f 92 push r1 20232: 1f 93 push r17 20234: af 92 push r10 20236: bf 92 push r11 20238: cf 92 push r12 2023a: df 92 push r13 2023c: ff 92 push r15 2023e: ef 92 push r14 20240: 9f 93 push r25 20242: 8f 93 push r24 20244: 0e 94 4a 69 call 0xd294 ; 0xd294 20248: 0f b6 in r0, 0x3f ; 63 2024a: f8 94 cli 2024c: de bf out 0x3e, r29 ; 62 2024e: 0f be out 0x3f, r0 ; 63 20250: 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. } 20252: 27 96 adiw r28, 0x07 ; 7 20254: 0f b6 in r0, 0x3f ; 63 20256: f8 94 cli 20258: de bf out 0x3e, r29 ; 62 2025a: 0f be out 0x3f, r0 ; 63 2025c: cd bf out 0x3d, r28 ; 61 2025e: df 91 pop r29 20260: cf 91 pop r28 20262: 1f 91 pop r17 20264: 0f 91 pop r16 20266: ff 90 pop r15 20268: ef 90 pop r14 2026a: df 90 pop r13 2026c: cf 90 pop r12 2026e: bf 90 pop r11 20270: af 90 pop r10 20272: 08 95 ret 00020274 : } #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { 20274: cf 93 push r28 20276: df 93 push r29 MENU_BEGIN(); 20278: 0f 94 7b 93 call 0x326f6 ; 0x326f6 2027c: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 20280: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 20284: 84 30 cpi r24, 0x04 ; 4 20286: 08 f0 brcs .+2 ; 0x2028a 20288: 5c c0 rjmp .+184 ; 0x20342 2028a: 10 92 31 04 sts 0x0431, r1 ; 0x800431 if (lang_is_selected()) MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); // 2028e: 0e 94 9b 6b call 0xd736 ; 0xd736 20292: 88 23 and r24, r24 20294: 31 f0 breq .+12 ; 0x202a2 20296: 87 ea ldi r24, 0xA7 ; 167 20298: 9d e3 ldi r25, 0x3D ; 61 2029a: 0e 94 a7 6c call 0xd94e ; 0xd94e 2029e: 0f 94 46 96 call 0x32c8c ; 0x32c8c if (menu_item_text_P(lang_get_name_by_code(lang_get_code(0)))) //primary language 202a2: 8e e6 ldi r24, 0x6E ; 110 202a4: 95 e6 ldi r25, 0x65 ; 101 202a6: 0e 94 b1 6b call 0xd762 ; 0xd762 202aa: 0f 94 29 93 call 0x32652 ; 0x32652 202ae: 88 23 and r24, r24 202b0: 49 f0 breq .+18 ; 0x202c4 #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { if (!lang_select(lang)) 202b2: 80 e0 ldi r24, 0x00 ; 0 202b4: 0e 94 3b 6c call 0xd876 ; 0xd876 202b8: 81 11 cpse r24, r1 202ba: 43 c0 rjmp .+134 ; 0x20342 MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 202bc: df 91 pop r29 202be: cf 91 pop r28 202c0: 0c 94 ab e1 jmp 0x1c356 ; 0x1c356 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(); 202c4: 0e 94 18 6c call 0xd830 ; 0xd830 202c8: 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) 202ca: c1 e0 ldi r28, 0x01 ; 1 202cc: cd 17 cp r28, r29 202ce: 60 f5 brcc .+88 ; 0x20328 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; 202d0: 80 e0 ldi r24, 0x00 ; 0 202d2: 91 e0 ldi r25, 0x01 ; 1 uint8_t count = 1; //count = 1 (primary) 202d4: 21 e0 ldi r18, 0x01 ; 1 while (pgm_read_dword((uint32_t*)table) == LANG_MAGIC) //magic valid 202d6: fc 01 movw r30, r24 202d8: 45 91 lpm r20, Z+ 202da: 55 91 lpm r21, Z+ 202dc: 65 91 lpm r22, Z+ 202de: 74 91 lpm r23, Z 202e0: 45 3a cpi r20, 0xA5 ; 165 202e2: 5a 45 sbci r21, 0x5A ; 90 202e4: 64 4b sbci r22, 0xB4 ; 180 202e6: 7b 44 sbci r23, 0x4B ; 75 202e8: 19 f0 breq .+6 ; 0x202f0 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; 202ea: 8f e3 ldi r24, 0x3F ; 63 202ec: 9f e3 ldi r25, 0x3F ; 63 202ee: 06 c0 rjmp .+12 ; 0x202fc #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 202f0: fc 01 movw r30, r24 202f2: c2 13 cpse r28, r18 202f4: 10 c0 rjmp .+32 ; 0x20316 202f6: 3a 96 adiw r30, 0x0a ; 10 202f8: 85 91 lpm r24, Z+ 202fa: 94 91 lpm r25, Z #endif //XFLASH if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) 202fc: 0e 94 b1 6b call 0xd762 ; 0xd762 20300: 0f 94 29 93 call 0x32652 ; 0x32652 20304: 88 23 and r24, r24 20306: 71 f0 breq .+28 ; 0x20324 #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { if (!lang_select(lang)) 20308: 8c 2f mov r24, r28 2030a: 0e 94 3b 6c call 0xd876 ; 0xd876 2030e: 81 11 cpse r24, r1 20310: 18 c0 rjmp .+48 ; 0x20342 20312: 8c 2f mov r24, r28 20314: d3 cf rjmp .-90 ; 0x202bc table += pgm_read_word((uint16_t*)(table + 4)); 20316: 34 96 adiw r30, 0x04 ; 4 20318: 45 91 lpm r20, Z+ 2031a: 54 91 lpm r21, Z 2031c: 84 0f add r24, r20 2031e: 95 1f adc r25, r21 count++; 20320: 2f 5f subi r18, 0xFF ; 255 20322: d9 cf rjmp .-78 ; 0x202d6 } } 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) 20324: cf 5f subi r28, 0xFF ; 255 20326: d2 cf rjmp .-92 ; 0x202cc #ifdef XFLASH MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); 20328: 0f 94 4f 93 call 0x3269e ; 0x3269e #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { MENU_BEGIN(); 2032c: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 20330: 8f 5f subi r24, 0xFF ; 255 20332: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 20336: 80 91 30 04 lds r24, 0x0430 ; 0x800430 2033a: 8f 5f subi r24, 0xFF ; 255 2033c: 80 93 30 04 sts 0x0430, r24 ; 0x800430 20340: 9f cf rjmp .-194 ; 0x20280 MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 20342: df 91 pop r29 20344: cf 91 pop r28 20346: 08 95 ret 00020348 : //! | | //! | | //! ---------------------- //! @endcode void lcd_menu_extruder_info() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") { 20348: df 92 push r13 2034a: ef 92 push r14 2034c: ff 92 push r15 2034e: 0f 93 push r16 20350: 1f 93 push r17 20352: cf 93 push r28 20354: df 93 push r29 20356: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 2035a: 0e 94 9d 69 call 0xd33a ; 0xd33a 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] ); 2035e: c5 e8 ldi r28, 0x85 ; 133 20360: d3 e0 ldi r29, 0x03 ; 3 20362: 8a 81 ldd r24, Y+2 ; 0x02 20364: 9b 81 ldd r25, Y+3 ; 0x03 20366: 2c e3 ldi r18, 0x3C ; 60 20368: f2 2e mov r15, r18 2036a: f8 9e mul r15, r24 2036c: 80 01 movw r16, r0 2036e: f9 9e mul r15, r25 20370: 10 0d add r17, r0 20372: 11 24 eor r1, r1 20374: 89 e3 ldi r24, 0x39 ; 57 20376: 9f e3 ldi r25, 0x3F ; 63 20378: 0e 94 a7 6c call 0xd94e ; 0xd94e 2037c: e8 2e mov r14, r24 2037e: d9 2e mov r13, r25 20380: 88 81 ld r24, Y 20382: 99 81 ldd r25, Y+1 ; 0x01 20384: f8 9e mul r15, r24 20386: e0 01 movw r28, r0 20388: f9 9e mul r15, r25 2038a: d0 0d add r29, r0 2038c: 11 24 eor r1, r1 2038e: 86 e4 ldi r24, 0x46 ; 70 20390: 9f e3 ldi r25, 0x3F ; 63 20392: 0e 94 a7 6c call 0xd94e ; 0xd94e 20396: 1f 93 push r17 20398: 0f 93 push r16 2039a: df 92 push r13 2039c: ef 92 push r14 2039e: df 93 push r29 203a0: cf 93 push r28 203a2: 9f 93 push r25 203a4: 8f 93 push r24 203a6: 8e ec ldi r24, 0xCE ; 206 203a8: 94 e9 ldi r25, 0x94 ; 148 203aa: 9f 93 push r25 203ac: 8f 93 push r24 203ae: 0e 94 4a 69 call 0xd294 ; 0xd294 menu_back_if_clicked(); 203b2: 8d b7 in r24, 0x3d ; 61 203b4: 9e b7 in r25, 0x3e ; 62 203b6: 0a 96 adiw r24, 0x0a ; 10 203b8: 0f b6 in r0, 0x3f ; 63 203ba: f8 94 cli 203bc: 9e bf out 0x3e, r25 ; 62 203be: 0f be out 0x3f, r0 ; 63 203c0: 8d bf out 0x3d, r24 ; 61 } 203c2: df 91 pop r29 203c4: cf 91 pop r28 203c6: 1f 91 pop r17 203c8: 0f 91 pop r16 203ca: ff 90 pop r15 203cc: ef 90 pop r14 203ce: 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(); 203d0: 0d 94 e5 96 jmp 0x32dca ; 0x32dca 000203d4 : //! | PINDA: 000D| MSG_PINDA c=14 //! ---------------------- //! D - Degree sysmbol LCD_STR_DEGREE //! @endcode static void lcd_menu_temperatures() { 203d4: cf 92 push r12 203d6: df 92 push r13 203d8: ef 92 push r14 203da: ff 92 push r15 203dc: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 203e0: 0e 94 9d 69 call 0xd33a ; 0xd33a lcd_menu_temperatures_line( _T(MSG_NOZZLE), (int)current_temperature[0] ); 203e4: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 203e8: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 203ec: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 203f0: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 203f4: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 203f8: 6b 01 movw r12, r22 203fa: 88 e8 ldi r24, 0x88 ; 136 203fc: 95 e5 ldi r25, 0x55 ; 85 203fe: 0e 94 a7 6c call 0xd94e ; 0xd94e 20402: b6 01 movw r22, r12 20404: 0f 94 3b 00 call 0x20076 ; 0x20076 lcd_menu_temperatures_line( _T(MSG_BED), (int)current_temperature_bed ); 20408: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 2040c: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 20410: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 20414: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 20418: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 2041c: 6b 01 movw r12, r22 2041e: 8d e6 ldi r24, 0x6D ; 109 20420: 95 e5 ldi r25, 0x55 ; 85 20422: 0e 94 a7 6c call 0xd94e ; 0xd94e 20426: b6 01 movw r22, r12 20428: 0f 94 3b 00 call 0x20076 ; 0x20076 #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 2042c: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 20430: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 20434: 80 91 90 06 lds r24, 0x0690 ; 0x800690 20438: 90 91 91 06 lds r25, 0x0691 ; 0x800691 2043c: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 20440: 88 e3 ldi r24, 0x38 ; 56 20442: 9b e6 ldi r25, 0x6B ; 107 20444: 0f 94 3b 00 call 0x20076 ; 0x20076 #endif //PINDA_THERMISTOR menu_back_if_clicked(); } 20448: ff 90 pop r15 2044a: ef 90 pop r14 2044c: df 90 pop r13 2044e: 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(); 20450: 0d 94 e5 96 jmp 0x32dca ; 0x32dca 00020454 : //! |Total failures | MSG_TOTAL_FAILURES c=20 //! | Fil. runouts 000| MSG_FIL_RUNOUTS c=15 //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { 20454: bf 92 push r11 20456: cf 92 push r12 20458: df 92 push r13 2045a: ef 92 push r14 2045c: ff 92 push r15 2045e: 0f 93 push r16 20460: 1f 93 push r17 20462: cf 93 push r28 20464: df 93 push r29 20466: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout uint8_t filamentLast = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT); 2046a: 85 e6 ldi r24, 0x65 ; 101 2046c: 9f e0 ldi r25, 0x0F ; 15 2046e: 0f 94 9b a0 call 0x34136 ; 0x34136 20472: 18 2f mov r17, r24 uint16_t filamentTotal = clamp999( eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT) ); 20474: 81 e0 ldi r24, 0x01 ; 1 20476: 9f e0 ldi r25, 0x0F ; 15 20478: 0f 94 a9 a0 call 0x34152 ; 0x34152 2047c: 0e 94 04 f8 call 0x1f008 ; 0x1f008 20480: c8 2e mov r12, r24 20482: b9 2e mov r11, r25 lcd_home(); 20484: 0e 94 9d 69 call 0xd33a ; 0xd33a lcd_printf_P(failStatsFmt, 20488: 81 e4 ldi r24, 0x41 ; 65 2048a: 99 e4 ldi r25, 0x49 ; 73 2048c: 0e 94 a7 6c call 0xd94e ; 0xd94e 20490: e8 2e mov r14, r24 20492: d9 2e mov r13, r25 20494: 80 e3 ldi r24, 0x30 ; 48 20496: 99 e4 ldi r25, 0x49 ; 73 20498: 0e 94 a7 6c call 0xd94e ; 0xd94e 2049c: 08 2f mov r16, r24 2049e: f9 2e mov r15, r25 204a0: 81 e4 ldi r24, 0x41 ; 65 204a2: 99 e4 ldi r25, 0x49 ; 73 204a4: 0e 94 a7 6c call 0xd94e ; 0xd94e 204a8: ec 01 movw r28, r24 204aa: 8a e1 ldi r24, 0x1A ; 26 204ac: 99 e4 ldi r25, 0x49 ; 73 204ae: 0e 94 a7 6c call 0xd94e ; 0xd94e 204b2: bf 92 push r11 204b4: cf 92 push r12 204b6: df 92 push r13 204b8: ef 92 push r14 204ba: ff 92 push r15 204bc: 0f 93 push r16 204be: 1f 92 push r1 204c0: 1f 93 push r17 204c2: df 93 push r29 204c4: cf 93 push r28 204c6: 9f 93 push r25 204c8: 8f 93 push r24 204ca: 85 e3 ldi r24, 0x35 ; 53 204cc: 95 e9 ldi r25, 0x95 ; 149 204ce: 9f 93 push r25 204d0: 8f 93 push r24 204d2: 0e 94 4a 69 call 0xd294 ; 0xd294 _T(MSG_LAST_PRINT_FAILURES), _T(MSG_FIL_RUNOUTS), filamentLast, _T(MSG_TOTAL_FAILURES), _T(MSG_FIL_RUNOUTS), filamentTotal); menu_back_if_clicked(); 204d6: 8d b7 in r24, 0x3d ; 61 204d8: 9e b7 in r25, 0x3e ; 62 204da: 0e 96 adiw r24, 0x0e ; 14 204dc: 0f b6 in r0, 0x3f ; 63 204de: f8 94 cli 204e0: 9e bf out 0x3e, r25 ; 62 204e2: 0f be out 0x3f, r0 ; 63 204e4: 8d bf out 0x3d, r24 ; 61 } 204e6: df 91 pop r29 204e8: cf 91 pop r28 204ea: 1f 91 pop r17 204ec: 0f 91 pop r16 204ee: ff 90 pop r15 204f0: ef 90 pop r14 204f2: df 90 pop r13 204f4: cf 90 pop r12 204f6: 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(); 204f8: 0d 94 e5 96 jmp 0x32dca ; 0x32dca 000204fc : //! | 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() { 204fc: 8f 92 push r8 204fe: 9f 92 push r9 20500: af 92 push r10 20502: bf 92 push r11 20504: cf 92 push r12 20506: df 92 push r13 20508: ef 92 push r14 2050a: ff 92 push r15 2050c: 0f 93 push r16 2050e: 1f 93 push r17 20510: cf 93 push r28 20512: df 93 push r29 20514: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 20518: 0e 94 9d 69 call 0xd33a ; 0xd33a lcd_printf_P( 2051c: 80 91 9a 12 lds r24, 0x129A ; 0x80129a 20520: 90 91 9b 12 lds r25, 0x129B ; 0x80129b 20524: 0e 94 04 f8 call 0x1f008 ; 0x1f008 20528: 98 2e mov r9, r24 2052a: 89 2e mov r8, r25 2052c: 85 ef ldi r24, 0xF5 ; 245 2052e: 98 e4 ldi r25, 0x48 ; 72 20530: 0e 94 a7 6c call 0xd94e ; 0xd94e 20534: b8 2e mov r11, r24 20536: a9 2e mov r10, r25 20538: 80 ed ldi r24, 0xD0 ; 208 2053a: 9e e0 ldi r25, 0x0E ; 14 2053c: 0f 94 a9 a0 call 0x34152 ; 0x34152 20540: 0e 94 04 f8 call 0x1f008 ; 0x1f008 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 a7 6c call 0xd94e ; 0xd94e 20550: f8 2e mov r15, r24 20552: e9 2e mov r14, r25 20554: 83 ed ldi r24, 0xD3 ; 211 20556: 9e e0 ldi r25, 0x0E ; 14 20558: 0f 94 a9 a0 call 0x34152 ; 0x34152 2055c: 0e 94 04 f8 call 0x1f008 ; 0x1f008 20560: 18 2f mov r17, r24 20562: 09 2f mov r16, r25 20564: 88 ed ldi r24, 0xD8 ; 216 20566: 98 e4 ldi r25, 0x48 ; 72 20568: 0e 94 a7 6c call 0xd94e ; 0xd94e 2056c: ec 01 movw r28, r24 2056e: 80 e3 ldi r24, 0x30 ; 48 20570: 99 e4 ldi r25, 0x49 ; 73 20572: 0e 94 a7 6c call 0xd94e ; 0xd94e 20576: 8f 92 push r8 20578: 9f 92 push r9 2057a: af 92 push r10 2057c: bf 92 push r11 2057e: cf 92 push r12 20580: df 92 push r13 20582: ef 92 push r14 20584: ff 92 push r15 20586: 0f 93 push r16 20588: 1f 93 push r17 2058a: df 93 push r29 2058c: cf 93 push r28 2058e: 9f 93 push r25 20590: 8f 93 push r24 20592: 88 e0 ldi r24, 0x08 ; 8 20594: 95 e9 ldi r25, 0x95 ; 149 20596: 9f 93 push r25 20598: 8f 93 push r24 2059a: 0e 94 4a 69 call 0xd294 ; 0xd294 ), _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(); 2059e: 8d b7 in r24, 0x3d ; 61 205a0: 9e b7 in r25, 0x3e ; 62 205a2: 40 96 adiw r24, 0x10 ; 16 205a4: 0f b6 in r0, 0x3f ; 63 205a6: f8 94 cli 205a8: 9e bf out 0x3e, r25 ; 62 205aa: 0f be out 0x3f, r0 ; 63 205ac: 8d bf out 0x3d, r24 ; 61 } 205ae: df 91 pop r29 205b0: cf 91 pop r28 205b2: 1f 91 pop r17 205b4: 0f 91 pop r16 205b6: ff 90 pop r15 205b8: ef 90 pop r14 205ba: df 90 pop r13 205bc: cf 90 pop r12 205be: bf 90 pop r11 205c0: af 90 pop r10 205c2: 9f 90 pop r9 205c4: 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(); 205c6: 0d 94 e5 96 jmp 0x32dca ; 0x32dca 000205ca : //! | 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() { 205ca: cf 92 push r12 205cc: df 92 push r13 205ce: ef 92 push r14 205d0: ff 92 push r15 205d2: 0f 93 push r16 205d4: 1f 93 push r17 205d6: cf 93 push r28 205d8: df 93 push r29 205da: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 205de: 0e 94 9d 69 call 0xd33a ; 0xd33a " %-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) )); 205e2: 8f ec ldi r24, 0xCF ; 207 205e4: 9e e0 ldi r25, 0x0E ; 14 205e6: 0f 94 9b a0 call 0x34136 ; 0x34136 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 205ea: 90 e0 ldi r25, 0x00 ; 0 205ec: 0e 94 04 f8 call 0x1f008 ; 0x1f008 205f0: d8 2e mov r13, r24 205f2: c9 2e mov r12, r25 205f4: 84 ee ldi r24, 0xE4 ; 228 205f6: 98 e4 ldi r25, 0x48 ; 72 205f8: 0e 94 a7 6c call 0xd94e ; 0xd94e 205fc: f8 2e mov r15, r24 205fe: 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) ), 20600: 82 ed ldi r24, 0xD2 ; 210 20602: 9e e0 ldi r25, 0x0E ; 14 20604: 0f 94 9b a0 call 0x34136 ; 0x34136 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 20608: 90 e0 ldi r25, 0x00 ; 0 2060a: 0e 94 04 f8 call 0x1f008 ; 0x1f008 2060e: 18 2f mov r17, r24 20610: 09 2f mov r16, r25 20612: 88 ed ldi r24, 0xD8 ; 216 20614: 98 e4 ldi r25, 0x48 ; 72 20616: 0e 94 a7 6c call 0xd94e ; 0xd94e 2061a: ec 01 movw r28, r24 2061c: 8a e1 ldi r24, 0x1A ; 26 2061e: 99 e4 ldi r25, 0x49 ; 73 20620: 0e 94 a7 6c call 0xd94e ; 0xd94e 20624: cf 92 push r12 20626: df 92 push r13 20628: ef 92 push r14 2062a: ff 92 push r15 2062c: 0f 93 push r16 2062e: 1f 93 push r17 20630: df 93 push r29 20632: cf 93 push r28 20634: 9f 93 push r25 20636: 8f 93 push r24 20638: 89 ee ldi r24, 0xE9 ; 233 2063a: 94 e9 ldi r25, 0x94 ; 148 2063c: 9f 93 push r25 2063e: 8f 93 push r24 20640: 0e 94 4a 69 call 0xd294 ; 0xd294 " %-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(); 20644: 8d b7 in r24, 0x3d ; 61 20646: 9e b7 in r25, 0x3e ; 62 20648: 0c 96 adiw r24, 0x0c ; 12 2064a: 0f b6 in r0, 0x3f ; 63 2064c: f8 94 cli 2064e: 9e bf out 0x3e, r25 ; 62 20650: 0f be out 0x3f, r0 ; 63 20652: 8d bf out 0x3d, r24 ; 61 } 20654: df 91 pop r29 20656: cf 91 pop r28 20658: 1f 91 pop r17 2065a: 0f 91 pop r16 2065c: ff 90 pop r15 2065e: ef 90 pop r14 20660: df 90 pop r13 20662: 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(); 20664: 0d 94 e5 96 jmp 0x32dca ; 0x32dca 00020668 : } #endif // not defined TMC2130 static void lcd_print_state(uint8_t state) { switch (state) { 20668: 81 30 cpi r24, 0x01 ; 1 2066a: 21 f4 brne .+8 ; 0x20674 case STATE_ON: lcd_puts_P(_N(" 1")); 2066c: 8e e2 ldi r24, 0x2E ; 46 2066e: 9b e6 ldi r25, 0x6B ; 107 break; case STATE_OFF: lcd_puts_P(_N(" 0")); 20670: 0c 94 5c 69 jmp 0xd2b8 ; 0xd2b8 20674: 8a e2 ldi r24, 0x2A ; 42 20676: 9b e6 ldi r25, 0x6B ; 107 20678: fb cf rjmp .-10 ; 0x20670 0002067a : //! |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() { 2067a: 2f 92 push r2 2067c: 3f 92 push r3 2067e: 4f 92 push r4 20680: 5f 92 push r5 20682: 6f 92 push r6 20684: 7f 92 push r7 20686: 8f 92 push r8 20688: 9f 92 push r9 2068a: af 92 push r10 2068c: bf 92 push r11 2068e: cf 92 push r12 20690: df 92 push r13 20692: ef 92 push r14 20694: ff 92 push r15 20696: 0f 93 push r16 20698: 1f 93 push r17 2069a: cf 93 push r28 2069c: df 93 push r29 2069e: cd b7 in r28, 0x3d ; 61 206a0: de b7 in r29, 0x3e ; 62 206a2: a8 97 sbiw r28, 0x28 ; 40 206a4: 0f b6 in r0, 0x3f ; 63 206a6: f8 94 cli 206a8: de bf out 0x3e, r29 ; 62 206aa: 0f be out 0x3f, r0 ; 63 206ac: 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); 206ae: 48 e0 ldi r20, 0x08 ; 8 206b0: 50 e0 ldi r21, 0x00 ; 0 206b2: 65 ee ldi r22, 0xE5 ; 229 206b4: 7f e0 ldi r23, 0x0F ; 15 206b6: ce 01 movw r24, r28 206b8: 41 96 adiw r24, 0x11 ; 17 206ba: 0f 94 8b a0 call 0x34116 ; 0x34116 eeprom_read_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8); 206be: 48 e0 ldi r20, 0x08 ; 8 206c0: 50 e0 ldi r21, 0x00 ; 0 206c2: 6d ed ldi r22, 0xDD ; 221 206c4: 7f e0 ldi r23, 0x0F ; 15 206c6: ce 01 movw r24, r28 206c8: 09 96 adiw r24, 0x09 ; 9 206ca: 0f 94 8b a0 call 0x34116 ; 0x34116 eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 206ce: 48 e0 ldi r20, 0x08 ; 8 206d0: 50 e0 ldi r21, 0x00 ; 0 206d2: 65 ed ldi r22, 0xD5 ; 213 206d4: 7f e0 ldi r23, 0x0F ; 15 206d6: ce 01 movw r24, r28 206d8: 01 96 adiw r24, 0x01 ; 1 206da: 0f 94 8b a0 call 0x34116 ; 0x34116 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]; 206de: 8d 84 ldd r8, Y+13 ; 0x0d 206e0: 9e 84 ldd r9, Y+14 ; 0x0e 206e2: af 84 ldd r10, Y+15 ; 0x0f 206e4: b8 88 ldd r11, Y+16 ; 0x10 206e6: ec e4 ldi r30, 0x4C ; 76 206e8: f8 e8 ldi r31, 0x88 ; 136 206ea: 25 91 lpm r18, Z+ 206ec: 35 91 lpm r19, Z+ 206ee: 45 91 lpm r20, Z+ 206f0: 54 91 lpm r21, Z 206f2: cd 80 ldd r12, Y+5 ; 0x05 206f4: de 80 ldd r13, Y+6 ; 0x06 206f6: ef 80 ldd r14, Y+7 ; 0x07 206f8: f8 84 ldd r15, Y+8 ; 0x08 206fa: e0 e5 ldi r30, 0x50 ; 80 206fc: f8 e8 ldi r31, 0x88 ; 136 206fe: 85 91 lpm r24, Z+ 20700: 95 91 lpm r25, Z+ 20702: a5 91 lpm r26, Z+ 20704: b4 91 lpm r27, Z 20706: 8d a3 std Y+37, r24 ; 0x25 20708: 9e a3 std Y+38, r25 ; 0x26 2070a: af a3 std Y+39, r26 ; 0x27 2070c: b8 a7 std Y+40, r27 ; 0x28 2070e: 8d 89 ldd r24, Y+21 ; 0x15 20710: 9e 89 ldd r25, Y+22 ; 0x16 20712: af 89 ldd r26, Y+23 ; 0x17 20714: b8 8d ldd r27, Y+24 ; 0x18 20716: 89 a3 std Y+33, r24 ; 0x21 20718: 9a a3 std Y+34, r25 ; 0x22 2071a: ab a3 std Y+35, r26 ; 0x23 2071c: bc a3 std Y+36, r27 ; 0x24 2071e: c5 01 movw r24, r10 20720: b4 01 movw r22, r8 20722: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 20726: 2b 01 movw r4, r22 20728: 3c 01 movw r6, r24 2072a: 2d a1 ldd r18, Y+37 ; 0x25 2072c: 3e a1 ldd r19, Y+38 ; 0x26 2072e: 4f a1 ldd r20, Y+39 ; 0x27 20730: 58 a5 ldd r21, Y+40 ; 0x28 20732: c7 01 movw r24, r14 20734: b6 01 movw r22, r12 20736: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2073a: 9b 01 movw r18, r22 2073c: ac 01 movw r20, r24 2073e: c3 01 movw r24, r6 20740: b2 01 movw r22, r4 20742: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 20746: 29 a1 ldd r18, Y+33 ; 0x21 20748: 3a a1 ldd r19, Y+34 ; 0x22 2074a: 4b a1 ldd r20, Y+35 ; 0x23 2074c: 5c a1 ldd r21, Y+36 ; 0x24 2074e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 20752: 20 e0 ldi r18, 0x00 ; 0 20754: 30 e0 ldi r19, 0x00 ; 0 20756: 40 e9 ldi r20, 0x90 ; 144 20758: 50 e4 ldi r21, 0x40 ; 64 2075a: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2075e: 1b 01 movw r2, r22 20760: 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]; 20762: e4 e5 ldi r30, 0x54 ; 84 20764: f8 e8 ldi r31, 0x88 ; 136 20766: 25 91 lpm r18, Z+ 20768: 35 91 lpm r19, Z+ 2076a: 45 91 lpm r20, Z+ 2076c: 54 91 lpm r21, Z 2076e: e8 e5 ldi r30, 0x58 ; 88 20770: f8 e8 ldi r31, 0x88 ; 136 20772: 45 90 lpm r4, Z+ 20774: 55 90 lpm r5, Z+ 20776: 65 90 lpm r6, Z+ 20778: 74 90 lpm r7, Z 2077a: c5 01 movw r24, r10 2077c: b4 01 movw r22, r8 2077e: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 20782: 4b 01 movw r8, r22 20784: 5c 01 movw r10, r24 20786: a3 01 movw r20, r6 20788: 92 01 movw r18, r4 2078a: c7 01 movw r24, r14 2078c: b6 01 movw r22, r12 2078e: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 20792: 9b 01 movw r18, r22 20794: ac 01 movw r20, r24 20796: c5 01 movw r24, r10 20798: b4 01 movw r22, r8 2079a: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2079e: 29 a1 ldd r18, Y+33 ; 0x21 207a0: 3a a1 ldd r19, Y+34 ; 0x22 207a2: 4b a1 ldd r20, Y+35 ; 0x23 207a4: 5c a1 ldd r21, Y+36 ; 0x24 207a6: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 207aa: 20 e0 ldi r18, 0x00 ; 0 207ac: 30 e0 ldi r19, 0x00 ; 0 207ae: 40 e9 ldi r20, 0x90 ; 144 207b0: 50 e4 ldi r21, 0x40 ; 64 207b2: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 207b6: 6d 8f std Y+29, r22 ; 0x1d 207b8: 7e 8f std Y+30, r23 ; 0x1e 207ba: 8f 8f std Y+31, r24 ; 0x1f 207bc: 98 a3 std Y+32, r25 ; 0x20 float distanceMin[2]; count_xyz_details(distanceMin); lcd_home(); 207be: 0e 94 9d 69 call 0xd33a ; 0xd33a lcd_printf_P(_N( 207c2: 8c e5 ldi r24, 0x5C ; 92 207c4: 9b e4 ldi r25, 0x4B ; 75 207c6: 0e 94 a7 6c call 0xd94e ; 0xd94e 207ca: d8 2e mov r13, r24 207cc: c9 2e mov r12, r25 207ce: 85 e5 ldi r24, 0x55 ; 85 207d0: 9b e4 ldi r25, 0x4B ; 75 207d2: 0e 94 a7 6c call 0xd94e ; 0xd94e 207d6: f8 2e mov r15, r24 207d8: e9 2e mov r14, r25 207da: 8f e3 ldi r24, 0x3F ; 63 207dc: 9b e4 ldi r25, 0x4B ; 75 207de: 0e 94 a7 6c call 0xd94e ; 0xd94e 207e2: cf 92 push r12 207e4: df 92 push r13 207e6: ef 92 push r14 207e8: ff 92 push r15 207ea: 2b e1 ldi r18, 0x1B ; 27 207ec: 33 e8 ldi r19, 0x83 ; 131 207ee: 3f 93 push r19 207f0: 2f 93 push r18 207f2: 9f 93 push r25 207f4: 8f 93 push r24 207f6: 88 ee ldi r24, 0xE8 ; 232 207f8: 9a e6 ldi r25, 0x6A ; 106 207fa: 9f 93 push r25 207fc: 8f 93 push r24 207fe: 0e 94 4a 69 call 0xd294 ; 0xd294 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 20802: 62 e0 ldi r22, 0x02 ; 2 20804: 8b e0 ldi r24, 0x0B ; 11 20806: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 2080a: 0f b6 in r0, 0x3f ; 63 2080c: f8 94 cli 2080e: de bf out 0x3e, r29 ; 62 20810: 0f be out 0x3f, r0 ; 63 20812: cd bf out 0x3d, r28 ; 61 20814: 20 e0 ldi r18, 0x00 ; 0 20816: 30 e0 ldi r19, 0x00 ; 0 20818: 48 e4 ldi r20, 0x48 ; 72 2081a: 53 e4 ldi r21, 0x43 ; 67 2081c: 62 2d mov r22, r2 2081e: 73 2d mov r23, r3 20820: 80 2f mov r24, r16 20822: 91 2f mov r25, r17 20824: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 20828: 87 ff sbrs r24, 7 2082a: 51 c0 rjmp .+162 ; 0x208ce else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 2082c: 1f 93 push r17 2082e: 0f 93 push r16 20830: 3f 92 push r3 20832: 2f 92 push r2 20834: 80 ee ldi r24, 0xE0 ; 224 20836: 9a e6 ldi r25, 0x6A ; 106 20838: 9f 93 push r25 2083a: 8f 93 push r24 2083c: 0e 94 4a 69 call 0xd294 ; 0xd294 20840: 0f 90 pop r0 20842: 0f 90 pop r0 20844: 0f 90 pop r0 20846: 0f 90 pop r0 20848: 0f 90 pop r0 2084a: 0f 90 pop r0 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 2084c: 63 e0 ldi r22, 0x03 ; 3 2084e: 8b e0 ldi r24, 0x0B ; 11 20850: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 20854: 1d 8d ldd r17, Y+29 ; 0x1d 20856: 0e 8d ldd r16, Y+30 ; 0x1e 20858: ff 8c ldd r15, Y+31 ; 0x1f 2085a: e8 a0 ldd r14, Y+32 ; 0x20 2085c: 20 e0 ldi r18, 0x00 ; 0 2085e: 30 e0 ldi r19, 0x00 ; 0 20860: 48 e4 ldi r20, 0x48 ; 72 20862: 53 e4 ldi r21, 0x43 ; 67 20864: d8 01 movw r26, r16 20866: f7 01 movw r30, r14 20868: 6b 2f mov r22, r27 2086a: 7a 2f mov r23, r26 2086c: 8f 2f mov r24, r31 2086e: 9e 2f mov r25, r30 20870: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 20874: 87 fd sbrc r24, 7 20876: 32 c0 rjmp .+100 ; 0x208dc 20878: 8c e8 ldi r24, 0x8C ; 140 2087a: 9d e3 ldi r25, 0x3D ; 61 2087c: 0e 94 a7 6c call 0xd94e ; 0xd94e 20880: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); } if (lcd_clicked()) 20884: 0e 94 8e 6b call 0xd71c ; 0xd71c 20888: 88 23 and r24, r24 2088a: 41 f0 breq .+16 ; 0x2089c menu_goto(lcd_menu_xyz_skew, 0, true); 2088c: 20 e0 ldi r18, 0x00 ; 0 2088e: 41 e0 ldi r20, 0x01 ; 1 20890: 70 e0 ldi r23, 0x00 ; 0 20892: 60 e0 ldi r22, 0x00 ; 0 20894: 83 ee ldi r24, 0xE3 ; 227 20896: 97 e3 ldi r25, 0x37 ; 55 20898: 0f 94 a5 93 call 0x3274a ; 0x3274a } 2089c: a8 96 adiw r28, 0x28 ; 40 2089e: 0f b6 in r0, 0x3f ; 63 208a0: f8 94 cli 208a2: de bf out 0x3e, r29 ; 62 208a4: 0f be out 0x3f, r0 ; 63 208a6: cd bf out 0x3d, r28 ; 61 208a8: df 91 pop r29 208aa: cf 91 pop r28 208ac: 1f 91 pop r17 208ae: 0f 91 pop r16 208b0: ff 90 pop r15 208b2: ef 90 pop r14 208b4: df 90 pop r13 208b6: cf 90 pop r12 208b8: bf 90 pop r11 208ba: af 90 pop r10 208bc: 9f 90 pop r9 208be: 8f 90 pop r8 208c0: 7f 90 pop r7 208c2: 6f 90 pop r6 208c4: 5f 90 pop r5 208c6: 4f 90 pop r4 208c8: 3f 90 pop r3 208ca: 2f 90 pop r2 208cc: 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)); 208ce: 8c e8 ldi r24, 0x8C ; 140 208d0: 9d e3 ldi r25, 0x3D ; 61 208d2: 0e 94 a7 6c call 0xd94e ; 0xd94e 208d6: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 208da: b8 cf rjmp .-144 ; 0x2084c else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 208dc: ef 92 push r14 208de: ff 92 push r15 208e0: 0f 93 push r16 208e2: 1f 93 push r17 208e4: 80 ee ldi r24, 0xE0 ; 224 208e6: 9a e6 ldi r25, 0x6A ; 106 208e8: 9f 93 push r25 208ea: 8f 93 push r24 208ec: 0e 94 4a 69 call 0xd294 ; 0xd294 208f0: 0f 90 pop r0 208f2: 0f 90 pop r0 208f4: 0f 90 pop r0 208f6: 0f 90 pop r0 208f8: 0f 90 pop r0 208fa: 0f 90 pop r0 208fc: c3 cf rjmp .-122 ; 0x20884 000208fe : } //! @brief Send host action "pause" void lcd_pause_usb_print() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_PAUSE); 208fe: 86 e4 ldi r24, 0x46 ; 70 20900: 9a e6 ldi r25, 0x6A ; 106 20902: 0c 94 49 72 jmp 0xe492 ; 0xe492 00020906 : * 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) { 20906: af 92 push r10 20908: bf 92 push r11 2090a: cf 92 push r12 2090c: df 92 push r13 2090e: ef 92 push r14 20910: ff 92 push r15 20912: 0f 93 push r16 20914: 1f 93 push r17 20916: cf 93 push r28 20918: df 93 push r29 2091a: 6c 01 movw r12, r24 const char *msgend = msg; bool multi_screen = false; lcd_frame_start(); 2091c: 0e 94 25 69 call 0xd24a ; 0xd24a * @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; 20920: e6 01 movw r28, r12 bool multi_screen = false; lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { 20922: 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; 20924: e1 2c mov r14, r1 lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { lcd_set_cursor(0, row); 20926: 6f 2d mov r22, r15 20928: 80 e0 ldi r24, 0x00 ; 0 2092a: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 // 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) 2092e: c6 01 movw r24, r12 20930: 0e 94 f5 f7 call 0x1efea ; 0x1efea 20934: 88 23 and r24, r24 20936: 29 f0 breq .+10 ; 0x20942 20938: 8f ef ldi r24, 0xFF ; 255 2093a: c8 1a sub r12, r24 2093c: d8 0a sbc r13, r24 2093e: 09 f4 brne .+2 ; 0x20942 20940: 49 c0 rjmp .+146 ; 0x209d4 20942: c6 01 movw r24, r12 20944: 0f 94 59 9e call 0x33cb2 ; 0x33cb2 <__strlen_P> { // End of the message. break; } uint8_t linelen = min(strlen_P(msg), LCD_WIDTH); 20948: 84 31 cpi r24, 0x14 ; 20 2094a: 91 05 cpc r25, r1 2094c: 10 f0 brcs .+4 ; 0x20952 2094e: 84 e1 ldi r24, 0x14 ; 20 20950: 90 e0 ldi r25, 0x00 ; 0 const char *msgend2 = msg + linelen; 20952: e6 01 movw r28, r12 20954: c8 0f add r28, r24 20956: d9 1f adc r29, r25 msgend = msgend2; if (row == 3 && linelen == LCD_WIDTH) { 20958: e3 e0 ldi r30, 0x03 ; 3 2095a: fe 12 cpse r15, r30 2095c: 0a c0 rjmp .+20 ; 0x20972 2095e: 84 31 cpi r24, 0x14 ; 20 20960: 41 f4 brne .+16 ; 0x20972 // 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; 20962: fe 01 movw r30, r28 20964: 84 91 lpm r24, Z 20966: e1 2c mov r14, r1 if (multi_screen) 20968: 88 23 and r24, r24 2096a: 19 f0 breq .+6 ; 0x20972 msgend = (msgend2 -= 2); 2096c: 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; 2096e: ee 24 eor r14, r14 20970: e3 94 inc r14 if (multi_screen) msgend = (msgend2 -= 2); } if (pgm_read_byte(msgend) != 0 && ! pgm_is_whitespace(msgend) && ! pgm_is_interpunction(msgend)) { 20972: fe 01 movw r30, r28 20974: 84 91 lpm r24, Z 20976: 88 23 and r24, r24 20978: 09 f4 brne .+2 ; 0x2097c 2097a: 40 c0 rjmp .+128 ; 0x209fc 2097c: ce 01 movw r24, r28 2097e: 0e 94 f5 f7 call 0x1efea ; 0x1efea 20982: 81 11 cpse r24, r1 20984: 3b c0 rjmp .+118 ; 0x209fc 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); 20986: fe 01 movw r30, r28 20988: 84 91 lpm r24, Z return c == '.' || c == ',' || c == ':'|| c == ';' || c == '?' || c == '!' || c == '/'; 2098a: 92 ed ldi r25, 0xD2 ; 210 2098c: 98 0f add r25, r24 2098e: 92 30 cpi r25, 0x02 ; 2 20990: a8 f1 brcs .+106 ; 0x209fc 20992: 8c 32 cpi r24, 0x2C ; 44 20994: 99 f1 breq .+102 ; 0x209fc 20996: 96 ec ldi r25, 0xC6 ; 198 20998: 98 0f add r25, r24 2099a: 92 30 cpi r25, 0x02 ; 2 2099c: 78 f1 brcs .+94 ; 0x209fc 2099e: 8f 33 cpi r24, 0x3F ; 63 209a0: 69 f1 breq .+90 ; 0x209fc 209a2: 81 32 cpi r24, 0x21 ; 33 209a4: 59 f1 breq .+86 ; 0x209fc 209a6: 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)) 209a8: c0 16 cp r12, r16 209aa: d1 06 cpc r13, r17 209ac: 58 f4 brcc .+22 ; 0x209c4 209ae: 58 01 movw r10, r16 209b0: f1 e0 ldi r31, 0x01 ; 1 209b2: af 1a sub r10, r31 209b4: b1 08 sbc r11, r1 209b6: c5 01 movw r24, r10 209b8: 0e 94 f5 f7 call 0x1efea ; 0x1efea 209bc: 81 11 cpse r24, r1 209be: 1d c0 rjmp .+58 ; 0x209fa -- msgend; 209c0: 85 01 movw r16, r10 209c2: f2 cf rjmp .-28 ; 0x209a8 if (msgend == msg) 209c4: c0 16 cp r12, r16 209c6: d1 06 cpc r13, r17 209c8: c9 f0 breq .+50 ; 0x209fc 209ca: 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) { 209cc: f3 94 inc r15 209ce: 84 e0 ldi r24, 0x04 ; 4 209d0: f8 12 cpse r15, r24 209d2: a9 cf rjmp .-174 ; 0x20926 } lcd_print(c); } } if (multi_screen) { 209d4: ee 20 and r14, r14 209d6: f9 f0 breq .+62 ; 0x20a16 // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); 209d8: 48 e8 ldi r20, 0x88 ; 136 209da: 63 e0 ldi r22, 0x03 ; 3 209dc: 83 e1 ldi r24, 0x13 ; 19 209de: 0e 94 91 69 call 0xd322 ; 0xd322 } return multi_screen ? msgend : NULL; } 209e2: ce 01 movw r24, r28 209e4: df 91 pop r29 209e6: cf 91 pop r28 209e8: 1f 91 pop r17 209ea: 0f 91 pop r16 209ec: ff 90 pop r15 209ee: ef 90 pop r14 209f0: df 90 pop r13 209f2: cf 90 pop r12 209f4: bf 90 pop r11 209f6: af 90 pop r10 209f8: 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)) 209fa: 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) { 209fc: cc 16 cp r12, r28 209fe: dd 06 cpc r13, r29 20a00: 28 f7 brcc .-54 ; 0x209cc char c = char(pgm_read_byte(msg)); 20a02: f6 01 movw r30, r12 20a04: 84 91 lpm r24, Z if (c == '\n') { 20a06: 8a 30 cpi r24, 0x0A ; 10 20a08: 09 f3 breq .-62 ; 0x209cc 20a0a: 0e 94 20 6a call 0xd440 ; 0xd440 -- msgend; if (msgend == msg) // Found a single long word, which cannot be split. Just cut it. msgend = msgend2; } for (; msg < msgend; ++ msg) { 20a0e: ff ef ldi r31, 0xFF ; 255 20a10: cf 1a sub r12, r31 20a12: df 0a sbc r13, r31 20a14: f3 cf rjmp .-26 ; 0x209fc if (multi_screen) { // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); } return multi_screen ? msgend : NULL; 20a16: d0 e0 ldi r29, 0x00 ; 0 20a18: c0 e0 ldi r28, 0x00 ; 0 20a1a: e3 cf rjmp .-58 ; 0x209e2 00020a1c : } #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)); 20a1c: 82 e9 ldi r24, 0x92 ; 146 20a1e: 9a e4 ldi r25, 0x4A ; 74 20a20: 0e 94 a7 6c call 0xd94e ; 0xd94e 20a24: 0f 94 83 04 call 0x20906 ; 0x20906 menu_back_if_clicked(); 20a28: 0d 94 e5 96 jmp 0x32dca ; 0x32dca 00020a2c : } _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(); 20a2c: 0e 94 65 6f call 0xdeca ; 0xdeca _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); _md->status = 0; 20a30: 10 92 71 03 sts 0x0371, r1 ; 0x800371 } 20a34: 08 95 ret 00020a36 : //! |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() { 20a36: cf 93 push r28 20a38: df 93 push r29 lcd_puts_at_P(0, 0, _T(MSG_MEASURED_OFFSET)); 20a3a: 80 e9 ldi r24, 0x90 ; 144 20a3c: 9b e4 ldi r25, 0x4B ; 75 20a3e: 0e 94 a7 6c call 0xd94e ; 0xd94e 20a42: ac 01 movw r20, r24 20a44: 60 e0 ldi r22, 0x00 ; 0 20a46: 80 e0 ldi r24, 0x00 ; 0 20a48: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_puts_at_P(0, 1, STR_SEPARATOR); 20a4c: 4b e1 ldi r20, 0x1B ; 27 20a4e: 53 e8 ldi r21, 0x83 ; 131 20a50: 61 e0 ldi r22, 0x01 ; 1 20a52: 80 e0 ldi r24, 0x00 ; 0 20a54: 0e 94 85 69 call 0xd30a ; 0xd30a for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(0, i + 2); 20a58: 62 e0 ldi r22, 0x02 ; 2 20a5a: 80 e0 ldi r24, 0x00 ; 0 20a5c: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 20a60: 85 ee ldi r24, 0xE5 ; 229 20a62: 9f e0 ldi r25, 0x0F ; 15 20a64: 0f 94 a3 a0 call 0x34146 ; 0x34146 20a68: 9f 93 push r25 20a6a: 8f 93 push r24 20a6c: 7f 93 push r23 20a6e: 6f 93 push r22 20a70: 1f 92 push r1 20a72: 88 e5 ldi r24, 0x58 ; 88 20a74: 8f 93 push r24 20a76: c0 e5 ldi r28, 0x50 ; 80 20a78: d7 e9 ldi r29, 0x97 ; 151 20a7a: df 93 push r29 20a7c: cf 93 push r28 20a7e: 0e 94 4a 69 call 0xd294 ; 0xd294 { 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); 20a82: 63 e0 ldi r22, 0x03 ; 3 20a84: 80 e0 ldi r24, 0x00 ; 0 20a86: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 20a8a: 89 ee ldi r24, 0xE9 ; 233 20a8c: 9f e0 ldi r25, 0x0F ; 15 20a8e: 0f 94 a3 a0 call 0x34146 ; 0x34146 20a92: 9f 93 push r25 20a94: 8f 93 push r24 20a96: 7f 93 push r23 20a98: 6f 93 push r22 20a9a: 1f 92 push r1 20a9c: 89 e5 ldi r24, 0x59 ; 89 20a9e: 8f 93 push r24 20aa0: df 93 push r29 20aa2: cf 93 push r28 20aa4: 0e 94 4a 69 call 0xd294 ; 0xd294 } menu_back_if_clicked(); 20aa8: 8d b7 in r24, 0x3d ; 61 20aaa: 9e b7 in r25, 0x3e ; 62 20aac: 40 96 adiw r24, 0x10 ; 16 20aae: 0f b6 in r0, 0x3f ; 63 20ab0: f8 94 cli 20ab2: 9e bf out 0x3e, r25 ; 62 20ab4: 0f be out 0x3f, r0 ; 63 20ab6: 8d bf out 0x3d, r24 ; 61 } 20ab8: df 91 pop r29 20aba: 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(); 20abc: 0d 94 e5 96 jmp 0x32dca ; 0x32dca 00020ac0 : //! ---------------------- //! 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() { 20ac0: cf 92 push r12 20ac2: df 92 push r13 20ac4: ef 92 push r14 20ac6: ff 92 push r15 20ac8: 0f 93 push r16 20aca: 1f 93 push r17 20acc: cf 93 push r28 20ace: df 93 push r29 float angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW)); 20ad0: 80 e6 ldi r24, 0x60 ; 96 20ad2: 9f e0 ldi r25, 0x0F ; 15 20ad4: 0f 94 a3 a0 call 0x34146 ; 0x34146 20ad8: 6b 01 movw r12, r22 20ada: 7c 01 movw r14, r24 lcd_home(); 20adc: 0e 94 9d 69 call 0xd33a ; 0xd33a lcd_printf_P(_N( 20ae0: 82 e8 ldi r24, 0x82 ; 130 20ae2: 9b e4 ldi r25, 0x4B ; 75 20ae4: 0e 94 a7 6c call 0xd94e ; 0xd94e 20ae8: 18 2f mov r17, r24 20aea: 09 2f mov r16, r25 20aec: 84 e7 ldi r24, 0x74 ; 116 20aee: 9b e4 ldi r25, 0x4B ; 75 20af0: 0e 94 a7 6c call 0xd94e ; 0xd94e 20af4: ec 01 movw r28, r24 20af6: 84 e6 ldi r24, 0x64 ; 100 20af8: 9b e4 ldi r25, 0x4B ; 75 20afa: 0e 94 a7 6c call 0xd94e ; 0xd94e 20afe: 2e e3 ldi r18, 0x3E ; 62 20b00: 2f 93 push r18 20b02: 20 e8 ldi r18, 0x80 ; 128 20b04: 2f 93 push r18 20b06: 1f 92 push r1 20b08: 1f 92 push r1 20b0a: 0f 93 push r16 20b0c: 1f 93 push r17 20b0e: 2d e3 ldi r18, 0x3D ; 61 20b10: 2f 93 push r18 20b12: 25 ef ldi r18, 0xF5 ; 245 20b14: 2f 93 push r18 20b16: 22 ec ldi r18, 0xC2 ; 194 20b18: 2f 93 push r18 20b1a: 20 e9 ldi r18, 0x90 ; 144 20b1c: 2f 93 push r18 20b1e: df 93 push r29 20b20: cf 93 push r28 20b22: 2b e1 ldi r18, 0x1B ; 27 20b24: 33 e8 ldi r19, 0x83 ; 131 20b26: 3f 93 push r19 20b28: 2f 93 push r18 20b2a: 9f 93 push r25 20b2c: 8f 93 push r24 20b2e: 8d ef ldi r24, 0xFD ; 253 20b30: 9a e6 ldi r25, 0x6A ; 106 20b32: 9f 93 push r25 20b34: 8f 93 push r24 20b36: 0e 94 4a 69 call 0xd294 ; 0xd294 _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); 20b3a: 60 e0 ldi r22, 0x00 ; 0 20b3c: 8f e0 ldi r24, 0x0F ; 15 20b3e: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 if (angleDiff < 100){ 20b42: 8d b7 in r24, 0x3d ; 61 20b44: 9e b7 in r25, 0x3e ; 62 20b46: 42 96 adiw r24, 0x12 ; 18 20b48: 0f b6 in r0, 0x3f ; 63 20b4a: f8 94 cli 20b4c: 9e bf out 0x3e, r25 ; 62 20b4e: 0f be out 0x3f, r0 ; 63 20b50: 8d bf out 0x3d, r24 ; 61 20b52: 20 e0 ldi r18, 0x00 ; 0 20b54: 30 e0 ldi r19, 0x00 ; 0 20b56: 48 ec ldi r20, 0xC8 ; 200 20b58: 52 e4 ldi r21, 0x42 ; 66 20b5a: c7 01 movw r24, r14 20b5c: b6 01 movw r22, r12 20b5e: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 20b62: 87 ff sbrs r24, 7 20b64: 32 c0 rjmp .+100 ; 0x20bca } //@brief Show measured axis skewness float _deg(float rad) { return rad * 180 / M_PI; 20b66: 20 e0 ldi r18, 0x00 ; 0 20b68: 30 e0 ldi r19, 0x00 ; 0 20b6a: 44 e3 ldi r20, 0x34 ; 52 20b6c: 53 e4 ldi r21, 0x43 ; 67 20b6e: c7 01 movw r24, r14 20b70: b6 01 movw r22, r12 20b72: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 20b76: 2b ed ldi r18, 0xDB ; 219 20b78: 3f e0 ldi r19, 0x0F ; 15 20b7a: 49 e4 ldi r20, 0x49 ; 73 20b7c: 50 e4 ldi r21, 0x40 ; 64 20b7e: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__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)); 20b82: 9f 93 push r25 20b84: 8f 93 push r24 20b86: 7f 93 push r23 20b88: 6f 93 push r22 20b8a: 86 ef ldi r24, 0xF6 ; 246 20b8c: 9a e6 ldi r25, 0x6A ; 106 20b8e: 9f 93 push r25 20b90: 8f 93 push r24 20b92: 0e 94 4a 69 call 0xd294 ; 0xd294 20b96: 0f 90 pop r0 20b98: 0f 90 pop r0 20b9a: 0f 90 pop r0 20b9c: 0f 90 pop r0 20b9e: 0f 90 pop r0 20ba0: 0f 90 pop r0 } else { lcd_puts_P(_T(MSG_NA)); } if (lcd_clicked()) 20ba2: 0e 94 8e 6b call 0xd71c ; 0xd71c 20ba6: 88 23 and r24, r24 20ba8: b9 f0 breq .+46 ; 0x20bd8 menu_goto(lcd_menu_xyz_offset, 0, true); 20baa: 20 e0 ldi r18, 0x00 ; 0 20bac: 41 e0 ldi r20, 0x01 ; 1 20bae: 70 e0 ldi r23, 0x00 ; 0 20bb0: 60 e0 ldi r22, 0x00 ; 0 20bb2: 89 ea ldi r24, 0xA9 ; 169 20bb4: 96 e3 ldi r25, 0x36 ; 54 } 20bb6: df 91 pop r29 20bb8: cf 91 pop r28 20bba: 1f 91 pop r17 20bbc: 0f 91 pop r16 20bbe: ff 90 pop r15 20bc0: ef 90 pop r14 20bc2: df 90 pop r13 20bc4: 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); 20bc6: 0d 94 a5 93 jmp 0x3274a ; 0x3274a ); 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)); 20bca: 8c e8 ldi r24, 0x8C ; 140 20bcc: 9d e3 ldi r25, 0x3D ; 61 20bce: 0e 94 a7 6c call 0xd94e ; 0xd94e 20bd2: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 20bd6: e5 cf rjmp .-54 ; 0x20ba2 } if (lcd_clicked()) menu_goto(lcd_menu_xyz_offset, 0, true); } 20bd8: df 91 pop r29 20bda: cf 91 pop r28 20bdc: 1f 91 pop r17 20bde: 0f 91 pop r16 20be0: ff 90 pop r15 20be2: ef 90 pop r14 20be4: df 90 pop r13 20be6: cf 90 pop r12 20be8: 08 95 ret 00020bea <_lcd_move(char const*, unsigned char, int, int)>: } } static void _lcd_move(const char *name, uint8_t axis, int min, int max) { 20bea: 2f 92 push r2 20bec: 3f 92 push r3 20bee: 4f 92 push r4 20bf0: 5f 92 push r5 20bf2: 6f 92 push r6 20bf4: 7f 92 push r7 20bf6: 9f 92 push r9 20bf8: af 92 push r10 20bfa: bf 92 push r11 20bfc: cf 92 push r12 20bfe: df 92 push r13 20c00: ef 92 push r14 20c02: ff 92 push r15 20c04: 0f 93 push r16 20c06: 1f 93 push r17 20c08: cf 93 push r28 20c0a: df 93 push r29 if (homing_flag || mesh_bed_leveling_flag) 20c0c: 70 91 05 12 lds r23, 0x1205 ; 0x801205 20c10: 71 11 cpse r23, r1 20c12: 04 c0 rjmp .+8 ; 0x20c1c <_lcd_move(char const*, unsigned char, int, int)+0x32> 20c14: 70 91 06 12 lds r23, 0x1206 ; 0x801206 20c18: 77 23 and r23, r23 20c1a: 99 f0 breq .+38 ; 0x20c42 <_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(); } 20c1c: df 91 pop r29 20c1e: cf 91 pop r28 20c20: 1f 91 pop r17 20c22: 0f 91 pop r16 20c24: ff 90 pop r15 20c26: ef 90 pop r14 20c28: df 90 pop r13 20c2a: cf 90 pop r12 20c2c: bf 90 pop r11 20c2e: af 90 pop r10 20c30: 9f 90 pop r9 20c32: 7f 90 pop r7 20c34: 6f 90 pop r6 20c36: 5f 90 pop r5 20c38: 4f 90 pop r4 20c3a: 3f 90 pop r3 20c3c: 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(); 20c3e: 0d 94 43 96 jmp 0x32c86 ; 0x32c86 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) 20c42: 70 91 64 03 lds r23, 0x0364 ; 0x800364 20c46: 71 11 cpse r23, r1 20c48: 09 c0 rjmp .+18 ; 0x20c5c <_lcd_move(char const*, unsigned char, int, int)+0x72> return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 20c4a: 70 91 77 02 lds r23, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.364> check_endstops = check; 20c4e: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.364> { _md->endstopsEnabledPrevious = enable_endstops(false); 20c52: 70 93 65 03 sts 0x0365, r23 ; 0x800365 _md->initialized = true; 20c56: 71 e0 ldi r23, 0x01 ; 1 20c58: 70 93 64 03 sts 0x0364, r23 ; 0x800364 20c5c: 19 01 movw r2, r18 20c5e: 6a 01 movw r12, r20 20c60: c6 2f mov r28, r22 20c62: d9 2f mov r29, r25 20c64: 98 2e mov r9, r24 } if (lcd_encoder != 0) 20c66: 80 91 06 05 lds r24, 0x0506 ; 0x800506 20c6a: 90 91 07 05 lds r25, 0x0507 ; 0x800507 20c6e: 89 2b or r24, r25 20c70: 09 f4 brne .+2 ; 0x20c74 <_lcd_move(char const*, unsigned char, int, int)+0x8a> 20c72: 71 c0 rjmp .+226 ; 0x20d56 <_lcd_move(char const*, unsigned char, int, int)+0x16c> { refresh_cmd_timeout(); 20c74: 0e 94 bf 5f call 0xbf7e ; 0xbf7e 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; 20c78: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 if (++ next_block_index == BLOCK_BUFFER_SIZE) 20c7c: 8f 5f subi r24, 0xFF ; 255 20c7e: 80 31 cpi r24, 0x10 ; 16 20c80: 09 f4 brne .+2 ; 0x20c84 <_lcd_move(char const*, unsigned char, int, int)+0x9a> next_block_index = 0; 20c82: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 20c84: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 if (! planner_queue_full()) 20c88: 98 17 cp r25, r24 20c8a: 09 f4 brne .+2 ; 0x20c8e <_lcd_move(char const*, unsigned char, int, int)+0xa4> 20c8c: 64 c0 rjmp .+200 ; 0x20d56 <_lcd_move(char const*, unsigned char, int, int)+0x16c> { current_position[axis] += lcd_encoder; 20c8e: 84 e0 ldi r24, 0x04 ; 4 20c90: c8 9f mul r28, r24 20c92: 80 01 movw r16, r0 20c94: 11 24 eor r1, r1 20c96: f8 01 movw r30, r16 20c98: eb 50 subi r30, 0x0B ; 11 20c9a: fe 4e sbci r31, 0xEE ; 238 20c9c: 5f 01 movw r10, r30 20c9e: 60 91 06 05 lds r22, 0x0506 ; 0x800506 20ca2: 70 91 07 05 lds r23, 0x0507 ; 0x800507 20ca6: 07 2e mov r0, r23 20ca8: 00 0c add r0, r0 20caa: 88 0b sbc r24, r24 20cac: 99 0b sbc r25, r25 20cae: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 20cb2: f5 01 movw r30, r10 20cb4: 20 81 ld r18, Z 20cb6: 31 81 ldd r19, Z+1 ; 0x01 20cb8: 42 81 ldd r20, Z+2 ; 0x02 20cba: 53 81 ldd r21, Z+3 ; 0x03 20cbc: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 20cc0: 2b 01 movw r4, r22 20cc2: 3c 01 movw r6, r24 if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 20cc4: b6 01 movw r22, r12 20cc6: dd 0c add r13, r13 20cc8: 88 0b sbc r24, r24 20cca: 99 0b sbc r25, r25 20ccc: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 20cd0: 6b 01 movw r12, r22 20cd2: 7c 01 movw r14, r24 20cd4: ac 01 movw r20, r24 20cd6: 9b 01 movw r18, r22 20cd8: c3 01 movw r24, r6 20cda: b2 01 movw r22, r4 20cdc: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 20ce0: f5 01 movw r30, r10 20ce2: 87 fd sbrc r24, 7 20ce4: 7d c0 rjmp .+250 ; 0x20de0 <_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; 20ce6: 40 82 st Z, r4 20ce8: 51 82 std Z+1, r5 ; 0x01 20cea: 62 82 std Z+2, r6 ; 0x02 20cec: 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; 20cee: b1 01 movw r22, r2 20cf0: 33 0c add r3, r3 20cf2: 88 0b sbc r24, r24 20cf4: 99 0b sbc r25, r25 20cf6: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 20cfa: 2b 01 movw r4, r22 20cfc: 3c 01 movw r6, r24 20cfe: c8 01 movw r24, r16 20d00: 8b 50 subi r24, 0x0B ; 11 20d02: 9e 4e sbci r25, 0xEE ; 238 20d04: 7c 01 movw r14, r24 20d06: a3 01 movw r20, r6 20d08: 92 01 movw r18, r4 20d0a: fc 01 movw r30, r24 20d0c: 60 81 ld r22, Z 20d0e: 71 81 ldd r23, Z+1 ; 0x01 20d10: 82 81 ldd r24, Z+2 ; 0x02 20d12: 93 81 ldd r25, Z+3 ; 0x03 20d14: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 20d18: 18 16 cp r1, r24 20d1a: 2c f4 brge .+10 ; 0x20d26 <_lcd_move(char const*, unsigned char, int, int)+0x13c> 20d1c: f7 01 movw r30, r14 20d1e: 40 82 st Z, r4 20d20: 51 82 std Z+1, r5 ; 0x01 20d22: 62 82 std Z+2, r6 ; 0x02 20d24: 73 82 std Z+3, r7 ; 0x03 lcd_encoder = 0; 20d26: 10 92 07 05 sts 0x0507, r1 ; 0x800507 20d2a: 10 92 06 05 sts 0x0506, r1 ; 0x800506 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 20d2e: 69 ef ldi r22, 0xF9 ; 249 20d30: 71 e1 ldi r23, 0x11 ; 17 20d32: 85 ef ldi r24, 0xF5 ; 245 20d34: 91 e1 ldi r25, 0x11 ; 17 20d36: 0e 94 9c 63 call 0xc738 ; 0xc738 plan_buffer_line_curposXYZE(get_feedrate_mm_s(manual_feedrate[axis])); 20d3a: f8 01 movw r30, r16 20d3c: ef 51 subi r30, 0x1F ; 31 20d3e: fd 4f sbci r31, 0xFD ; 253 20d40: 60 81 ld r22, Z 20d42: 71 81 ldd r23, Z+1 ; 0x01 20d44: 82 81 ldd r24, Z+2 ; 0x02 20d46: 93 81 ldd r25, Z+3 ; 0x03 20d48: 0e 94 c3 5f call 0xbf86 ; 0xbf86 20d4c: 0f 94 2f 85 call 0x30a5e ; 0x30a5e lcd_draw_update = 1; 20d50: 81 e0 ldi r24, 0x01 ; 1 20d52: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } } if (lcd_draw_update) 20d56: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 20d5a: 88 23 and r24, r24 20d5c: 11 f1 breq .+68 ; 0x20da2 <_lcd_move(char const*, unsigned char, int, int)+0x1b8> { lcd_set_cursor(0, 1); 20d5e: 61 e0 ldi r22, 0x01 ; 1 20d60: 80 e0 ldi r24, 0x00 ; 0 20d62: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 menu_draw_float31(name, current_position[axis]); 20d66: 84 e0 ldi r24, 0x04 ; 4 20d68: c8 9f mul r28, r24 20d6a: f0 01 movw r30, r0 20d6c: 11 24 eor r1, r1 20d6e: eb 50 subi r30, 0x0B ; 11 20d70: 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); 20d72: 83 81 ldd r24, Z+3 ; 0x03 20d74: 8f 93 push r24 20d76: 82 81 ldd r24, Z+2 ; 0x02 20d78: 8f 93 push r24 20d7a: 81 81 ldd r24, Z+1 ; 0x01 20d7c: 8f 93 push r24 20d7e: 80 81 ld r24, Z 20d80: 8f 93 push r24 20d82: df 93 push r29 20d84: 9f 92 push r9 20d86: 87 e3 ldi r24, 0x37 ; 55 20d88: 97 e9 ldi r25, 0x97 ; 151 20d8a: 9f 93 push r25 20d8c: 8f 93 push r24 20d8e: 0e 94 4a 69 call 0xd294 ; 0xd294 20d92: ed b7 in r30, 0x3d ; 61 20d94: fe b7 in r31, 0x3e ; 62 20d96: 38 96 adiw r30, 0x08 ; 8 20d98: 0f b6 in r0, 0x3f ; 63 20d9a: f8 94 cli 20d9c: fe bf out 0x3e, r31 ; 62 20d9e: 0f be out 0x3f, r0 ; 63 20da0: ed bf out 0x3d, r30 ; 61 } if (menu_leaving || LCD_CLICKED) (void)enable_endstops(_md->endstopsEnabledPrevious); 20da2: 80 91 92 03 lds r24, 0x0392 ; 0x800392 20da6: 81 11 cpse r24, r1 20da8: 04 c0 rjmp .+8 ; 0x20db2 <_lcd_move(char const*, unsigned char, int, int)+0x1c8> 20daa: 80 91 63 03 lds r24, 0x0363 ; 0x800363 20dae: 88 23 and r24, r24 20db0: 21 f0 breq .+8 ; 0x20dba <_lcd_move(char const*, unsigned char, int, int)+0x1d0> 20db2: 80 91 65 03 lds r24, 0x0365 ; 0x800365 20db6: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.364> menu_back_if_clicked(); } 20dba: df 91 pop r29 20dbc: cf 91 pop r28 20dbe: 1f 91 pop r17 20dc0: 0f 91 pop r16 20dc2: ff 90 pop r15 20dc4: ef 90 pop r14 20dc6: df 90 pop r13 20dc8: cf 90 pop r12 20dca: bf 90 pop r11 20dcc: af 90 pop r10 20dce: 9f 90 pop r9 20dd0: 7f 90 pop r7 20dd2: 6f 90 pop r6 20dd4: 5f 90 pop r5 20dd6: 4f 90 pop r4 20dd8: 3f 90 pop r3 20dda: 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(); 20ddc: 0d 94 e5 96 jmp 0x32dca ; 0x32dca { refresh_cmd_timeout(); if (! planner_queue_full()) { current_position[axis] += lcd_encoder; if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 20de0: c0 82 st Z, r12 20de2: d1 82 std Z+1, r13 ; 0x01 20de4: e2 82 std Z+2, r14 ; 0x02 20de6: f3 82 std Z+3, r15 ; 0x03 20de8: 82 cf rjmp .-252 ; 0x20cee <_lcd_move(char const*, unsigned char, int, int)+0x104> 00020dea : } // 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); 20dea: 2a ef ldi r18, 0xFA ; 250 20dec: 30 e0 ldi r19, 0x00 ; 0 20dee: 50 e0 ldi r21, 0x00 ; 0 20df0: 40 e0 ldi r20, 0x00 ; 0 20df2: 60 e0 ldi r22, 0x00 ; 0 20df4: 8b e5 ldi r24, 0x5B ; 91 20df6: 97 e9 ldi r25, 0x97 ; 151 20df8: 0d 94 f5 05 jmp 0x20bea ; 0x20bea <_lcd_move(char const*, unsigned char, int, int)> 00020dfc : } static void lcd_move_y() { _lcd_move(PSTR("Y:"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); 20dfc: 22 ed ldi r18, 0xD2 ; 210 20dfe: 30 e0 ldi r19, 0x00 ; 0 20e00: 4c ef ldi r20, 0xFC ; 252 20e02: 5f ef ldi r21, 0xFF ; 255 20e04: 61 e0 ldi r22, 0x01 ; 1 20e06: 8e e5 ldi r24, 0x5E ; 94 20e08: 97 e9 ldi r25, 0x97 ; 151 20e0a: 0d 94 f5 05 jmp 0x20bea ; 0x20bea <_lcd_move(char const*, unsigned char, int, int)> 00020e0e : } static void lcd_move_z() { _lcd_move(PSTR("Z:"), Z_AXIS, Z_MIN_POS, Z_MAX_POS); 20e0e: 22 ed ldi r18, 0xD2 ; 210 20e10: 30 e0 ldi r19, 0x00 ; 0 20e12: 50 e0 ldi r21, 0x00 ; 0 20e14: 40 e0 ldi r20, 0x00 ; 0 20e16: 62 e0 ldi r22, 0x02 ; 2 20e18: 81 e6 ldi r24, 0x61 ; 97 20e1a: 97 e9 ldi r25, 0x97 ; 151 20e1c: 0d 94 f5 05 jmp 0x20bea ; 0x20bea <_lcd_move(char const*, unsigned char, int, int)> 00020e20 : setFilamentAction(FilamentAction::None); } /// Reset the menu stack and clear the planned filament action flag static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); 20e20: 80 91 82 06 lds r24, 0x0682 ; 0x800682 20e24: 81 11 cpse r24, r1 20e26: 03 c0 rjmp .+6 ; 0x20e2e 20e28: 82 e0 ldi r24, 0x02 ; 2 20e2a: 0d 94 27 96 jmp 0x32c4e ; 0x32c4e 20e2e: 81 e0 ldi r24, 0x01 ; 1 20e30: fc cf rjmp .-8 ; 0x20e2a 00020e32 : } // 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); 20e32: 5f 93 push r21 20e34: 4f 93 push r20 20e36: 7f 93 push r23 20e38: 6f 93 push r22 20e3a: 28 2f mov r18, r24 20e3c: 08 2e mov r0, r24 20e3e: 00 0c add r0, r0 20e40: 33 0b sbc r19, r19 20e42: 3f 93 push r19 20e44: 8f 93 push r24 20e46: 82 ed ldi r24, 0xD2 ; 210 20e48: 99 e6 ldi r25, 0x69 ; 105 20e4a: 9f 93 push r25 20e4c: 8f 93 push r24 20e4e: 0e 94 4a 69 call 0xd294 ; 0xd294 lcd_space(9 - chars); 20e52: 2d b7 in r18, 0x3d ; 61 20e54: 3e b7 in r19, 0x3e ; 62 20e56: 28 5f subi r18, 0xF8 ; 248 20e58: 3f 4f sbci r19, 0xFF ; 255 20e5a: 0f b6 in r0, 0x3f ; 63 20e5c: f8 94 cli 20e5e: 3e bf out 0x3e, r19 ; 62 20e60: 0f be out 0x3f, r0 ; 63 20e62: 2d bf out 0x3d, r18 ; 61 20e64: 99 e0 ldi r25, 0x09 ; 9 20e66: 98 1b sub r25, r24 20e68: 89 2f mov r24, r25 20e6a: 0c 94 67 69 jmp 0xd2ce ; 0xd2ce 00020e6e : default: return false; } } void lcd_print_target_temps_first_line() { 20e6e: cf 93 push r28 20e70: df 93 push r29 lcd_home(); 20e72: 0e 94 9d 69 call 0xd33a ; 0xd33a lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0)); 20e76: c0 91 f1 11 lds r28, 0x11F1 ; 0x8011f1 20e7a: d0 91 f2 11 lds r29, 0x11F2 ; 0x8011f2 20e7e: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 20e82: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 20e86: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 20e8a: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 20e8e: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 20e92: ae 01 movw r20, r28 20e94: 82 e8 ldi r24, 0x82 ; 130 20e96: 0f 94 19 07 call 0x20e32 ; 0x20e32 lcd_set_cursor(10, 0); 20e9a: 60 e0 ldi r22, 0x00 ; 0 20e9c: 8a e0 ldi r24, 0x0A ; 10 20e9e: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 20ea2: c0 91 ed 11 lds r28, 0x11ED ; 0x8011ed 20ea6: d0 91 ee 11 lds r29, 0x11EE ; 0x8011ee int targetBedTemp = (int) degTargetBed(); if (targetBedTemp) { 20eaa: 20 97 sbiw r28, 0x00 ; 0 20eac: 81 f0 breq .+32 ; 0x20ece lcdui_print_temp(LCD_STR_BEDTEMP[0], (int) degBed(), targetBedTemp); 20eae: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 20eb2: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 20eb6: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 20eba: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 20ebe: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 20ec2: ae 01 movw r20, r28 20ec4: 80 e8 ldi r24, 0x80 ; 128 } else { lcd_space(10); } } 20ec6: df 91 pop r29 20ec8: 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); 20eca: 0d 94 19 07 jmp 0x20e32 ; 0x20e32 } else { lcd_space(10); 20ece: 8a e0 ldi r24, 0x0A ; 10 } } 20ed0: df 91 pop r29 20ed2: 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); 20ed4: 0c 94 67 69 jmp 0xd2ce ; 0xd2ce 00020ed8 : 20ed8: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 } } static void mFilamentPrompt() { lcd_timeoutToStatus.stop(); lcd_print_target_temps_first_line(); 20edc: 0f 94 37 07 call 0x20e6e ; 0x20e6e lcd_puts_at_P(0,1, _T(MSG_PRESS_KNOB)); 20ee0: 8d ee ldi r24, 0xED ; 237 20ee2: 99 e4 ldi r25, 0x49 ; 73 20ee4: 0e 94 a7 6c call 0xd94e ; 0xd94e 20ee8: ac 01 movw r20, r24 20eea: 61 e0 ldi r22, 0x01 ; 1 20eec: 80 e0 ldi r24, 0x00 ; 0 20eee: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_set_cursor(0,2); 20ef2: 62 e0 ldi r22, 0x02 ; 2 20ef4: 80 e0 ldi r24, 0x00 ; 0 20ef6: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 switch(eFilamentAction) { 20efa: 80 91 62 03 lds r24, 0x0362 ; 0x800362 20efe: 83 30 cpi r24, 0x03 ; 3 20f00: 81 f1 breq .+96 ; 0x20f62 20f02: 48 f4 brcc .+18 ; 0x20f16 20f04: 81 30 cpi r24, 0x01 ; 1 20f06: 60 f0 brcs .+24 ; 0x20f20 case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_TO_LOAD_FIL)); 20f08: 8a ed ldi r24, 0xDA ; 218 20f0a: 99 e4 ldi r25, 0x49 ; 73 break; case FilamentAction::UnLoad: case FilamentAction::MmuUnLoad: lcd_puts_P(_T(MSG_TO_UNLOAD_FIL)); 20f0c: 0e 94 a7 6c call 0xd94e ; 0xd94e 20f10: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 20f14: 05 c0 rjmp .+10 ; 0x20f20 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) { 20f16: 85 30 cpi r24, 0x05 ; 5 20f18: 21 f1 breq .+72 ; 0x20f62 20f1a: b0 f3 brcs .-20 ; 0x20f08 20f1c: 88 30 cpi r24, 0x08 ; 8 20f1e: a1 f3 breq .-24 ; 0x20f08 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } if(lcd_clicked() 20f20: 0e 94 8e 6b call 0xd71c ; 0xd71c #ifdef FILAMENT_SENSOR /// @todo leptun - add this as a specific retest item || (((eFilamentAction == FilamentAction::Load) || (eFilamentAction == FilamentAction::AutoLoad)) && fsensor.getFilamentLoadEvent()) 20f24: 81 11 cpse r24, r1 20f26: 09 c0 rjmp .+18 ; 0x20f3a 20f28: 80 91 62 03 lds r24, 0x0362 ; 0x800362 20f2c: 81 50 subi r24, 0x01 ; 1 20f2e: 82 30 cpi r24, 0x02 ; 2 20f30: 28 f5 brcc .+74 ; 0x20f7c 20f32: 80 91 88 16 lds r24, 0x1688 ; 0x801688 20f36: 88 23 and r24, r24 20f38: 09 f1 breq .+66 ; 0x20f7c #endif //FILAMENT_SENSOR ) { menu_back(bFilamentPreheatState ? 2 : 3); 20f3a: 80 91 82 06 lds r24, 0x0682 ; 0x800682 20f3e: 81 11 cpse r24, r1 20f40: 13 c0 rjmp .+38 ; 0x20f68 20f42: 83 e0 ldi r24, 0x03 ; 3 20f44: 0f 94 27 96 call 0x32c4e ; 0x32c4e switch(eFilamentAction) { 20f48: 80 91 62 03 lds r24, 0x0362 ; 0x800362 20f4c: 82 30 cpi r24, 0x02 ; 2 20f4e: 71 f0 breq .+28 ; 0x20f6c 20f50: 83 30 cpi r24, 0x03 ; 3 20f52: 81 f0 breq .+32 ; 0x20f74 20f54: 81 30 cpi r24, 0x01 ; 1 20f56: 91 f4 brne .+36 ; 0x20f7c case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament 20f58: 61 e0 ldi r22, 0x01 ; 1 20f5a: 83 e9 ldi r24, 0x93 ; 147 20f5c: 9a e6 ldi r25, 0x6A ; 106 break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 20f5e: 0c 94 ac 7c jmp 0xf958 ; 0xf958 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)); 20f62: 85 ec ldi r24, 0xC5 ; 197 20f64: 99 e4 ldi r25, 0x49 ; 73 20f66: d2 cf rjmp .-92 ; 0x20f0c #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); 20f68: 82 e0 ldi r24, 0x02 ; 2 20f6a: ec cf rjmp .-40 ; 0x20f44 switch(eFilamentAction) { case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; 20f6c: 81 e0 ldi r24, 0x01 ; 1 20f6e: 80 93 62 03 sts 0x0362, r24 ; 0x800362 20f72: f2 cf rjmp .-28 ; 0x20f58 [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 20f74: 61 e0 ldi r22, 0x01 ; 1 20f76: 8d e0 ldi r24, 0x0D ; 13 20f78: 98 e6 ldi r25, 0x68 ; 104 20f7a: f1 cf rjmp .-30 ; 0x20f5e case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } } } 20f7c: 08 95 ret 00020f7e : #ifdef MENU_SERIAL_DUMP #include "Dcodes.h" static void lcd_serial_dump() { serial_dump_and_reset(dump_crash_reason::manual); 20f7e: 80 e0 ldi r24, 0x00 ; 0 20f80: 0c 94 53 74 jmp 0xe8a6 ; 0xe8a6 00020f84 : //! | Debug | c=18 //! @endcode //! ---------------------- //! @endcode static void lcd_support_menu() { 20f84: ef 92 push r14 20f86: ff 92 push r15 20f88: 0f 93 push r16 20f8a: 1f 93 push r17 20f8c: cf 93 push r28 20f8e: 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) 20f90: 80 91 64 03 lds r24, 0x0364 ; 0x800364 20f94: 88 23 and r24, r24 20f96: 29 f0 breq .+10 ; 0x20fa2 20f98: 90 91 5b 02 lds r25, 0x025B ; 0x80025b 20f9c: 92 30 cpi r25, 0x02 ; 2 20f9e: 09 f0 breq .+2 ; 0x20fa2 20fa0: 74 c1 rjmp .+744 ; 0x2128a { // Menu was entered or SD card status has changed (plugged in or removed). // Initialize its status. _md->status = 1; 20fa2: 81 e0 ldi r24, 0x01 ; 1 20fa4: 80 93 64 03 sts 0x0364, r24 ; 0x800364 20fa8: 80 91 db 15 lds r24, 0x15DB ; 0x8015db _md->is_flash_air = card.ToshibaFlashAir_isEnabled(); 20fac: 80 93 65 03 sts 0x0365, r24 ; 0x800365 if (_md->is_flash_air) { 20fb0: 88 23 and r24, r24 20fb2: 21 f0 breq .+8 ; 0x20fbc card.ToshibaFlashAir_GetIP((uint8_t*)(&_md->ip)); // ip == 0 if it failed 20fb4: 86 e6 ldi r24, 0x66 ; 102 20fb6: 93 e0 ldi r25, 0x03 ; 3 20fb8: 0f 94 49 53 call 0x2a692 ; 0x2a692 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 20fbc: 0f 94 7b 93 call 0x326f6 ; 0x326f6 20fc0: 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); 20fc4: 83 e9 ldi r24, 0x93 ; 147 20fc6: e8 2e mov r14, r24 20fc8: 85 e9 ldi r24, 0x95 ; 149 20fca: 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]); 20fcc: c2 e6 ldi r28, 0x62 ; 98 20fce: d5 e9 ldi r29, 0x95 ; 149 20fd0: 0a e6 ldi r16, 0x6A ; 106 20fd2: 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(); 20fd4: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 20fd8: 84 30 cpi r24, 0x04 ; 4 20fda: 08 f0 brcs .+2 ; 0x20fde 20fdc: 7d c1 rjmp .+762 ; 0x212d8 20fde: 10 92 31 04 sts 0x0431, r1 ; 0x800431 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 20fe2: 88 ef ldi r24, 0xF8 ; 248 20fe4: 9d e3 ldi r25, 0x3D ; 61 20fe6: 0e 94 a7 6c call 0xd94e ; 0xd94e 20fea: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_BACK_P(PSTR("Firmware:")); 20fee: 87 ef ldi r24, 0xF7 ; 247 20ff0: 95 e9 ldi r25, 0x95 ; 149 20ff2: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_BACK_P(PSTR(" " FW_VERSION_FULL)); 20ff6: 8a ee ldi r24, 0xEA ; 234 20ff8: 95 e9 ldi r25, 0x95 ; 149 20ffa: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_BACK_P(PSTR(" Repo:" FW_REPOSITORY)); 20ffe: 8c ed ldi r24, 0xDC ; 220 21000: 95 e9 ldi r25, 0x95 ; 149 21002: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_BACK_P(PSTR(" Hash:" FW_COMMIT_HASH)); 21006: 8c ec ldi r24, 0xCC ; 204 21008: 95 e9 ldi r25, 0x95 ; 149 2100a: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_BACK_P(_n("prusa3d.com"));////MSG_PRUSA3D c=18 2100e: 87 e8 ldi r24, 0x87 ; 135 21010: 9a e6 ldi r25, 0x6A ; 106 21012: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_BACK_P(_n("forum.prusa3d.com"));////MSG_PRUSA3D_FORUM c=18 21016: 85 e7 ldi r24, 0x75 ; 117 21018: 9a e6 ldi r25, 0x6A ; 106 2101a: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_BACK_P(_n("help.prusa3d.com"));////MSG_PRUSA3D_HELP c=18 2101e: 84 e6 ldi r24, 0x64 ; 100 21020: 9a e6 ldi r25, 0x6A ; 106 21022: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_BACK_P(STR_SEPARATOR); 21026: 8b e1 ldi r24, 0x1B ; 27 21028: 93 e8 ldi r25, 0x83 ; 131 2102a: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_BACK_P(PSTR(FILAMENT_SIZE)); 2102e: 8f eb ldi r24, 0xBF ; 191 21030: 95 e9 ldi r25, 0x95 ; 149 21032: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_BACK_P(PSTR(ELECTRONICS)); 21036: 86 eb ldi r24, 0xB6 ; 182 21038: 95 e9 ldi r25, 0x95 ; 149 2103a: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_BACK_P(PSTR(NOZZLE_TYPE)); 2103e: 8c ea ldi r24, 0xAC ; 172 21040: 95 e9 ldi r25, 0x95 ; 149 21042: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_BACK_P(STR_SEPARATOR); 21046: 8b e1 ldi r24, 0x1B ; 27 21048: 93 e8 ldi r25, 0x83 ; 131 2104a: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_BACK_P(_T(MSG_DATE)); 2104e: 8d eb ldi r24, 0xBD ; 189 21050: 99 e4 ldi r25, 0x49 ; 73 21052: 0e 94 a7 6c call 0xd94e ; 0xd94e 21056: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_BACK_P(PSTR(SOURCE_DATE_EPOCH)); 2105a: 81 ea ldi r24, 0xA1 ; 161 2105c: 95 e9 ldi r25, 0x95 ; 149 2105e: 0f 94 46 96 call 0x32c8c ; 0x32c8c 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); 21062: 8b e1 ldi r24, 0x1B ; 27 21064: 93 e8 ldi r25, 0x83 ; 131 21066: 0f 94 46 96 call 0x32c8c ; 0x32c8c if (MMU2::mmu2.Enabled()) 2106a: 80 91 94 12 lds r24, 0x1294 ; 0x801294 2106e: 81 30 cpi r24, 0x01 ; 1 21070: 09 f0 breq .+2 ; 0x21074 21072: 2d c1 rjmp .+602 ; 0x212ce { MENU_ITEM_BACK_P(_T(MSG_MMU_CONNECTED)); 21074: 8d ea ldi r24, 0xAD ; 173 21076: 99 e4 ldi r25, 0x49 ; 73 21078: 0e 94 a7 6c call 0xd94e ; 0xd94e 2107c: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_BACK_P(PSTR(" FW:")); ////c=17 21080: 8c e9 ldi r24, 0x9C ; 156 21082: 95 e9 ldi r25, 0x95 ; 149 21084: 0f 94 46 96 call 0x32c8c ; 0x32c8c if (((menu_item - 1) == menu_line) && lcd_draw_update) 21088: 80 91 31 04 lds r24, 0x0431 ; 0x800431 2108c: 81 50 subi r24, 0x01 ; 1 2108e: 99 0b sbc r25, r25 21090: 20 91 30 04 lds r18, 0x0430 ; 0x800430 21094: 28 17 cp r18, r24 21096: 19 06 cpc r1, r25 21098: 49 f5 brne .+82 ; 0x210ec 2109a: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 2109e: 88 23 and r24, r24 210a0: 29 f1 breq .+74 ; 0x210ec { lcd_set_cursor(6, menu_row); 210a2: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 210a6: 86 e0 ldi r24, 0x06 ; 6 210a8: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 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) { 210ac: 80 91 94 12 lds r24, 0x1294 ; 0x801294 210b0: 81 30 cpi r24, 0x01 ; 1 210b2: 09 f0 breq .+2 ; 0x210b6 210b4: 05 c1 rjmp .+522 ; 0x212c0 210b6: 80 91 74 12 lds r24, 0x1274 ; 0x801274 210ba: 90 91 75 12 lds r25, 0x1275 ; 0x801275 210be: 20 91 76 12 lds r18, 0x1276 ; 0x801276 MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) 210c2: 88 23 and r24, r24 210c4: 09 f4 brne .+2 ; 0x210c8 210c6: fc c0 rjmp .+504 ; 0x212c0 lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); 210c8: 1f 92 push r1 210ca: 2f 93 push r18 210cc: 1f 92 push r1 210ce: 9f 93 push r25 210d0: 1f 92 push r1 210d2: 8f 93 push r24 210d4: ff 92 push r15 210d6: ef 92 push r14 210d8: 0e 94 4a 69 call 0xd294 ; 0xd294 210dc: 8d b7 in r24, 0x3d ; 61 210de: 9e b7 in r25, 0x3e ; 62 210e0: 08 96 adiw r24, 0x08 ; 8 210e2: 0f b6 in r0, 0x3f ; 63 210e4: f8 94 cli 210e6: 9e bf out 0x3e, r25 ; 62 210e8: 0f be out 0x3f, r0 ; 63 210ea: 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) { 210ec: 80 91 65 03 lds r24, 0x0365 ; 0x800365 210f0: 88 23 and r24, r24 210f2: 09 f4 brne .+2 ; 0x210f6 210f4: 40 c0 rjmp .+128 ; 0x21176 MENU_ITEM_BACK_P(STR_SEPARATOR); 210f6: 8b e1 ldi r24, 0x1B ; 27 210f8: 93 e8 ldi r25, 0x83 ; 131 210fa: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_BACK_P(PSTR("FlashAir IP Addr:")); ////MSG_FLASHAIR c=18 210fe: 82 e7 ldi r24, 0x72 ; 114 21100: 95 e9 ldi r25, 0x95 ; 149 21102: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_BACK_P(PSTR(" ")); 21106: 80 e7 ldi r24, 0x70 ; 112 21108: 95 e9 ldi r25, 0x95 ; 149 2110a: 0f 94 46 96 call 0x32c8c ; 0x32c8c if (((menu_item - 1) == menu_line) && lcd_draw_update) { 2110e: 80 91 31 04 lds r24, 0x0431 ; 0x800431 21112: 81 50 subi r24, 0x01 ; 1 21114: 99 0b sbc r25, r25 21116: 20 91 30 04 lds r18, 0x0430 ; 0x800430 2111a: 28 17 cp r18, r24 2111c: 19 06 cpc r1, r25 2111e: 59 f5 brne .+86 ; 0x21176 21120: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 21124: 88 23 and r24, r24 21126: 39 f1 breq .+78 ; 0x21176 lcd_set_cursor(2, menu_row); 21128: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 2112c: 82 e0 ldi r24, 0x02 ; 2 2112e: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 21132: 80 91 69 03 lds r24, 0x0369 ; 0x800369 21136: 1f 92 push r1 21138: 8f 93 push r24 2113a: 80 91 68 03 lds r24, 0x0368 ; 0x800368 2113e: 1f 92 push r1 21140: 8f 93 push r24 21142: 80 91 67 03 lds r24, 0x0367 ; 0x800367 21146: 1f 92 push r1 21148: 8f 93 push r24 2114a: 80 91 66 03 lds r24, 0x0366 ; 0x800366 2114e: 1f 92 push r1 21150: 8f 93 push r24 21152: df 93 push r29 21154: cf 93 push r28 21156: 1f 93 push r17 21158: 0f 93 push r16 2115a: 0f 94 b2 9f call 0x33f64 ; 0x33f64 ip4_to_str(_md->ip_str, (uint8_t*)(&_md->ip)); lcd_print(_md->ip_str); 2115e: 8a e6 ldi r24, 0x6A ; 106 21160: 93 e0 ldi r25, 0x03 ; 3 21162: 0e 94 78 6b call 0xd6f0 ; 0xd6f0 21166: 8d b7 in r24, 0x3d ; 61 21168: 9e b7 in r25, 0x3e ; 62 2116a: 0c 96 adiw r24, 0x0c ; 12 2116c: 0f b6 in r0, 0x3f ; 63 2116e: f8 94 cli 21170: 9e bf out 0x3e, r25 ; 62 21172: 0f be out 0x3f, r0 ; 63 21174: 8d bf out 0x3d, r24 ; 61 } } // Show the printer IP address, if it is available. if (IP_address) { 21176: 80 91 7d 06 lds r24, 0x067D ; 0x80067d 2117a: 90 91 7e 06 lds r25, 0x067E ; 0x80067e 2117e: a0 91 7f 06 lds r26, 0x067F ; 0x80067f 21182: b0 91 80 06 lds r27, 0x0680 ; 0x800680 21186: 89 2b or r24, r25 21188: 8a 2b or r24, r26 2118a: 8b 2b or r24, r27 2118c: 09 f4 brne .+2 ; 0x21190 2118e: 42 c0 rjmp .+132 ; 0x21214 MENU_ITEM_BACK_P(STR_SEPARATOR); 21190: 8b e1 ldi r24, 0x1B ; 27 21192: 93 e8 ldi r25, 0x83 ; 131 21194: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_BACK_P(_T(MSG_PRINTER_IP)); 21198: 80 e9 ldi r24, 0x90 ; 144 2119a: 99 e4 ldi r25, 0x49 ; 73 2119c: 0e 94 a7 6c call 0xd94e ; 0xd94e 211a0: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_BACK_P(PSTR(" ")); 211a4: 8e e6 ldi r24, 0x6E ; 110 211a6: 95 e9 ldi r25, 0x95 ; 149 211a8: 0f 94 46 96 call 0x32c8c ; 0x32c8c if (((menu_item - 1) == menu_line) && lcd_draw_update) { 211ac: 80 91 31 04 lds r24, 0x0431 ; 0x800431 211b0: 81 50 subi r24, 0x01 ; 1 211b2: 99 0b sbc r25, r25 211b4: 20 91 30 04 lds r18, 0x0430 ; 0x800430 211b8: 28 17 cp r18, r24 211ba: 19 06 cpc r1, r25 211bc: 59 f5 brne .+86 ; 0x21214 211be: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 211c2: 88 23 and r24, r24 211c4: 39 f1 breq .+78 ; 0x21214 lcd_set_cursor(2, menu_row); 211c6: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 211ca: 82 e0 ldi r24, 0x02 ; 2 211cc: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 211d0: 80 91 80 06 lds r24, 0x0680 ; 0x800680 211d4: 1f 92 push r1 211d6: 8f 93 push r24 211d8: 80 91 7f 06 lds r24, 0x067F ; 0x80067f 211dc: 1f 92 push r1 211de: 8f 93 push r24 211e0: 80 91 7e 06 lds r24, 0x067E ; 0x80067e 211e4: 1f 92 push r1 211e6: 8f 93 push r24 211e8: 80 91 7d 06 lds r24, 0x067D ; 0x80067d 211ec: 1f 92 push r1 211ee: 8f 93 push r24 211f0: df 93 push r29 211f2: cf 93 push r28 211f4: 1f 93 push r17 211f6: 0f 93 push r16 211f8: 0f 94 b2 9f call 0x33f64 ; 0x33f64 ip4_to_str(_md->ip_str, (uint8_t*)(&IP_address)); lcd_print(_md->ip_str); 211fc: 8a e6 ldi r24, 0x6A ; 106 211fe: 93 e0 ldi r25, 0x03 ; 3 21200: 0e 94 78 6b call 0xd6f0 ; 0xd6f0 21204: 8d b7 in r24, 0x3d ; 61 21206: 9e b7 in r25, 0x3e ; 62 21208: 0c 96 adiw r24, 0x0c ; 12 2120a: 0f b6 in r0, 0x3f ; 63 2120c: f8 94 cli 2120e: 9e bf out 0x3e, r25 ; 62 21210: 0f be out 0x3f, r0 ; 63 21212: 8d bf out 0x3d, r24 ; 61 } } MENU_ITEM_BACK_P(STR_SEPARATOR); 21214: 8b e1 ldi r24, 0x1B ; 27 21216: 93 e8 ldi r25, 0x83 ; 131 21218: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_SUBMENU_P(_T(MSG_XYZ_DETAILS), lcd_menu_xyz_y_min); 2121c: 8d e7 ldi r24, 0x7D ; 125 2121e: 99 e4 ldi r25, 0x49 ; 73 21220: 0e 94 a7 6c call 0xd94e ; 0xd94e 21224: 6f e8 ldi r22, 0x8F ; 143 21226: 77 e3 ldi r23, 0x37 ; 55 21228: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_EXTRUDER), lcd_menu_extruder_info); 2122c: 8d e6 ldi r24, 0x6D ; 109 2122e: 99 e4 ldi r25, 0x49 ; 73 21230: 0e 94 a7 6c call 0xd94e ; 0xd94e 21234: 61 e7 ldi r22, 0x71 ; 113 21236: 77 e3 ldi r23, 0x37 ; 55 21238: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_SENSORS), lcd_menu_show_sensors_state); 2123c: 8f e5 ldi r24, 0x5F ; 95 2123e: 99 e4 ldi r25, 0x49 ; 73 21240: 0e 94 a7 6c call 0xd94e ; 0xd94e 21244: 6b e2 ldi r22, 0x2B ; 43 21246: 77 e3 ldi r23, 0x37 ; 55 21248: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 #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); 2124c: 80 e5 ldi r24, 0x50 ; 80 2124e: 99 e4 ldi r25, 0x49 ; 73 21250: 0e 94 a7 6c call 0xd94e ; 0xd94e 21254: 6b eb ldi r22, 0xBB ; 187 21256: 77 e3 ldi r23, 0x37 ; 55 21258: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 #ifdef MENU_DUMP MENU_ITEM_FUNCTION_P(_n("Dump memory"), lcd_dump_memory); #endif //MENU_DUMP #ifdef MENU_SERIAL_DUMP if (emergency_serial_dump) 2125c: 80 91 7c 06 lds r24, 0x067C ; 0x80067c 21260: 88 23 and r24, r24 21262: 31 f0 breq .+12 ; 0x21270 MENU_ITEM_FUNCTION_P(_n("Dump to serial"), lcd_serial_dump); 21264: 65 e2 ldi r22, 0x25 ; 37 21266: 77 e3 ldi r23, 0x37 ; 55 21268: 85 e5 ldi r24, 0x55 ; 85 2126a: 9a e6 ldi r25, 0x6A ; 106 2126c: 0f 94 f8 92 call 0x325f0 ; 0x325f0 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(); 21270: 0f 94 4f 93 call 0x3269e ; 0x3269e { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 21274: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 21278: 8f 5f subi r24, 0xFF ; 255 2127a: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 2127e: 80 91 30 04 lds r24, 0x0430 ; 0x800430 21282: 8f 5f subi r24, 0xFF ; 255 21284: 80 93 30 04 sts 0x0430, r24 ; 0x800430 21288: a5 ce rjmp .-694 ; 0x20fd4 _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) 2128a: 90 91 65 03 lds r25, 0x0365 ; 0x800365 2128e: 99 23 and r25, r25 21290: 09 f4 brne .+2 ; 0x21294 21292: 94 ce rjmp .-728 ; 0x20fbc 21294: 40 91 66 03 lds r20, 0x0366 ; 0x800366 21298: 50 91 67 03 lds r21, 0x0367 ; 0x800367 2129c: 60 91 68 03 lds r22, 0x0368 ; 0x800368 212a0: 70 91 69 03 lds r23, 0x0369 ; 0x800369 212a4: 45 2b or r20, r21 212a6: 46 2b or r20, r22 212a8: 47 2b or r20, r23 212aa: 09 f0 breq .+2 ; 0x212ae 212ac: 87 ce rjmp .-754 ; 0x20fbc 212ae: 8f 5f subi r24, 0xFF ; 255 212b0: 80 31 cpi r24, 0x10 ; 16 212b2: 19 f0 breq .+6 ; 0x212ba 212b4: 80 93 64 03 sts 0x0364, r24 ; 0x800364 212b8: 81 ce rjmp .-766 ; 0x20fbc { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; 212ba: 10 92 64 03 sts 0x0364, r1 ; 0x800364 212be: 7e ce rjmp .-772 ; 0x20fbc 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)); 212c0: 83 ea ldi r24, 0xA3 ; 163 212c2: 99 e4 ldi r25, 0x49 ; 73 212c4: 0e 94 a7 6c call 0xd94e ; 0xd94e 212c8: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 212cc: 0f cf rjmp .-482 ; 0x210ec } } else MENU_ITEM_BACK_P(PSTR("MMU N/A")); 212ce: 84 e8 ldi r24, 0x84 ; 132 212d0: 95 e9 ldi r25, 0x95 ; 149 212d2: 0f 94 46 96 call 0x32c8c ; 0x32c8c 212d6: 0a cf rjmp .-492 ; 0x210ec #endif //EMERGENCY_HANDLERS MENU_ITEM_SUBMENU_P(PSTR("Debug"), lcd_menu_debug);////MSG_DEBUG c=18 #endif /* DEBUG_BUILD */ MENU_END(); } 212d8: df 91 pop r29 212da: cf 91 pop r28 212dc: 1f 91 pop r17 212de: 0f 91 pop r16 212e0: ff 90 pop r15 212e2: ef 90 pop r14 212e4: 08 95 ret 000212e6 : { 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) { 212e6: 80 91 64 03 lds r24, 0x0364 ; 0x800364 212ea: 81 11 cpse r24, r1 212ec: 19 c0 rjmp .+50 ; 0x21320 lcd_clear(); 212ee: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_puts_P(_T(MSG_MATERIAL_CHANGES)); /// MSG_MATERIAL_CHANGES c=18 212f2: 87 e0 ldi r24, 0x07 ; 7 212f4: 99 e4 ldi r25, 0x49 ; 73 212f6: 0e 94 a7 6c call 0xd94e ; 0xd94e 212fa: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 lcd_putc(':'); 212fe: 8a e3 ldi r24, 0x3A ; 58 21300: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 lcd_set_cursor(10, 1); 21304: 61 e0 ldi r22, 0x01 ; 1 21306: 8a e0 ldi r24, 0x0A ; 10 21308: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_print(eeprom_read_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES)); 2130c: 88 ea ldi r24, 0xA8 ; 168 2130e: 9c e0 ldi r25, 0x0C ; 12 21310: 0f 94 a3 a0 call 0x34146 ; 0x34146 void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); else lcd_printNumber(n, base); 21314: 4a e0 ldi r20, 0x0A ; 10 21316: 0e 94 c5 6a call 0xd58a ; 0xd58a _md->initialized = true; 2131a: 81 e0 ldi r24, 0x01 ; 1 2131c: 80 93 64 03 sts 0x0364, r24 ; 0x800364 } menu_back_if_clicked(); 21320: 0d 94 e5 96 jmp 0x32dca ; 0x32dca 00021324 : } 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){ 21324: 0f 93 push r16 21326: 1f 93 push r17 21328: cf 93 push r28 2132a: df 93 push r29 2132c: ec 01 movw r28, r24 2132e: cb 01 movw r24, r22 21330: ba 01 movw r22, r20 static const char m1[] PROGMEM = "Please restart"; switch(state){ 21332: 4a 81 ldd r20, Y+2 ; 0x02 21334: 41 30 cpi r20, 0x01 ; 1 21336: 29 f0 breq .+10 ; 0x21342 21338: 88 f0 brcs .+34 ; 0x2135c 2133a: 42 30 cpi r20, 0x02 ; 2 2133c: 09 f1 breq .+66 ; 0x21380 2133e: 43 30 cpi r20, 0x03 ; 3 21340: d1 f4 brne .+52 ; 0x21376 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 ){ 21342: 8b 81 ldd r24, Y+3 ; 0x03 21344: 81 11 cpse r24, r1 21346: 25 c0 rjmp .+74 ; 0x21392 state = next_state; // advance to the next state 21348: 82 e0 ldi r24, 0x02 ; 2 2134a: 8a 83 std Y+2, r24 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 2134c: 63 e0 ldi r22, 0x03 ; 3 2134e: 86 e8 ldi r24, 0x86 ; 134 21350: 94 e9 ldi r25, 0x94 ; 148 21352: 0e 94 35 e2 call 0x1c46a ; 0x1c46a repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too 21356: 85 e0 ldi r24, 0x05 ; 5 } else { --repeat; 21358: 8b 83 std Y+3, r24 ; 0x03 2135a: 0d c0 rjmp .+26 ; 0x21376 //! @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 ){ 2135c: a9 01 movw r20, r18 2135e: 98 01 movw r18, r16 21360: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 21364: 18 16 cp r1, r24 21366: 3c f4 brge .+14 ; 0x21376 lcd_setalertstatuspgm(m2, LCD_STATUS_CRITICAL); 21368: 63 e0 ldi r22, 0x03 ; 3 2136a: 88 81 ld r24, Y 2136c: 99 81 ldd r25, Y+1 ; 0x01 2136e: 0e 94 35 e2 call 0x1c46a ; 0x1c46a state = States::TempAboveMintemp; 21372: 81 e0 ldi r24, 0x01 ; 1 21374: 8a 83 std Y+2, r24 ; 0x02 break; case States::ShowPleaseRestart: // displaying "Please restart" substep(m2, States::ShowMintemp); break; } } 21376: df 91 pop r29 21378: cf 91 pop r28 2137a: 1f 91 pop r17 2137c: 0f 91 pop r16 2137e: 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 ){ 21380: 8b 81 ldd r24, Y+3 ; 0x03 21382: 81 11 cpse r24, r1 21384: 06 c0 rjmp .+12 ; 0x21392 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); 21386: 88 81 ld r24, Y 21388: 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 2138a: 23 e0 ldi r18, 0x03 ; 3 2138c: 2a 83 std Y+2, r18 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 2138e: 63 e0 ldi r22, 0x03 ; 3 21390: e0 cf rjmp .-64 ; 0x21352 repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too } else { --repeat; 21392: 81 50 subi r24, 0x01 ; 1 21394: e1 cf rjmp .-62 ; 0x21358 00021396 : } } static void temp_runaway_stop(bool isPreheat, bool isBed) { 21396: cf 93 push r28 21398: df 93 push r29 if(IsStopped() == false) { 2139a: 90 91 ce 11 lds r25, 0x11CE ; 0x8011ce 2139e: 91 11 cpse r25, r1 213a0: 21 c0 rjmp .+66 ; 0x213e4 213a2: c6 2f mov r28, r22 213a4: d8 2f mov r29, r24 if (isPreheat) { 213a6: 88 23 and r24, r24 213a8: 09 f1 breq .+66 ; 0x213ec lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); 213aa: 8a e2 ldi r24, 0x2A ; 42 213ac: 94 e9 ldi r25, 0x94 ; 148 213ae: 66 23 and r22, r22 213b0: 11 f0 breq .+4 ; 0x213b6 213b2: 88 e3 ldi r24, 0x38 ; 56 213b4: 94 e9 ldi r25, 0x94 ; 148 213b6: 63 e0 ldi r22, 0x03 ; 3 213b8: 0e 94 35 e2 call 0x1c46a ; 0x1c46a SERIAL_ERROR_START; 213bc: 84 e4 ldi r24, 0x44 ; 68 213be: 9d e9 ldi r25, 0x9D ; 157 213c0: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 if (isBed) { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); 213c4: 87 e0 ldi r24, 0x07 ; 7 213c6: 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) { 213c8: c1 11 cpse r28, r1 213ca: 02 c0 rjmp .+4 ; 0x213d0 SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); } else { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HOTEND)"); 213cc: 85 ee ldi r24, 0xE5 ; 229 213ce: 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"); 213d0: 0e 94 49 72 call 0xe492 ; 0xe492 } } prusa_statistics(0); 213d4: 80 e0 ldi r24, 0x00 ; 0 213d6: 0f 94 be 98 call 0x3317c ; 0x3317c prusa_statistics(isPreheat? 91 : 90); 213da: 8a e5 ldi r24, 0x5A ; 90 213dc: d1 11 cpse r29, r1 213de: 8b e5 ldi r24, 0x5B ; 91 213e0: 0f 94 be 98 call 0x3317c ; 0x3317c } ThermalStop(); } 213e4: df 91 pop r29 213e6: cf 91 pop r28 } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 213e8: 0d 94 ed 43 jmp 0x287da ; 0x287da 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); 213ec: 81 ec ldi r24, 0xC1 ; 193 213ee: 93 e9 ldi r25, 0x93 ; 147 213f0: 66 23 and r22, r22 213f2: 11 f0 breq .+4 ; 0x213f8 213f4: 81 ed ldi r24, 0xD1 ; 209 213f6: 93 e9 ldi r25, 0x93 ; 147 213f8: 63 e0 ldi r22, 0x03 ; 3 213fa: 0e 94 35 e2 call 0x1c46a ; 0x1c46a SERIAL_ERROR_START; 213fe: 84 e4 ldi r24, 0x44 ; 68 21400: 9d e9 ldi r25, 0x9D ; 157 21402: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 if (isBed) { SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); 21406: 88 ea ldi r24, 0xA8 ; 168 21408: 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) { 2140a: c1 11 cpse r28, r1 2140c: e1 cf rjmp .-62 ; 0x213d0 SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); } else { SERIAL_ERRORLNPGM(" HOTEND THERMAL RUNAWAY"); 2140e: 80 e9 ldi r24, 0x90 ; 144 21410: 93 e9 ldi r25, 0x93 ; 147 21412: de cf rjmp .-68 ; 0x213d0 00021414 : } static void Sound_DoSound_Prompt(void) { backlight_wake(2); WRITE(BEEPER,HIGH); 21414: 9f b7 in r25, 0x3f ; 63 21416: f8 94 cli 21418: e2 e0 ldi r30, 0x02 ; 2 2141a: f1 e0 ldi r31, 0x01 ; 1 2141c: 80 81 ld r24, Z 2141e: 84 60 ori r24, 0x04 ; 4 21420: 80 83 st Z, r24 21422: 9f bf out 0x3f, r25 ; 63 21424: 2f ef ldi r18, 0xFF ; 255 21426: 89 e6 ldi r24, 0x69 ; 105 21428: 98 e1 ldi r25, 0x18 ; 24 2142a: 21 50 subi r18, 0x01 ; 1 2142c: 80 40 sbci r24, 0x00 ; 0 2142e: 90 40 sbci r25, 0x00 ; 0 21430: e1 f7 brne .-8 ; 0x2142a 21432: 00 c0 rjmp .+0 ; 0x21434 21434: 00 00 nop _delay_ms(500); WRITE(BEEPER,LOW); 21436: 9f b7 in r25, 0x3f ; 63 21438: f8 94 cli 2143a: 80 81 ld r24, Z 2143c: 8b 7f andi r24, 0xFB ; 251 2143e: 80 83 st Z, r24 21440: 9f bf out 0x3f, r25 ; 63 } 21442: 08 95 ret 00021444 : 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() { 21444: cf 93 push r28 21446: 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); 21448: 80 91 40 02 lds r24, 0x0240 ; 0x800240 2144c: 88 23 and r24, r24 2144e: 89 f0 breq .+34 ; 0x21472 21450: 8f ea ldi r24, 0xAF ; 175 21452: 9a e5 ldi r25, 0x5A ; 90 21454: 0e 94 a7 6c call 0xd94e ; 0xd94e 21458: ec 01 movw r28, r24 2145a: 83 e7 ldi r24, 0x73 ; 115 2145c: 95 e5 ldi r25, 0x55 ; 85 2145e: 0e 94 a7 6c call 0xd94e ; 0xd94e 21462: 22 e0 ldi r18, 0x02 ; 2 21464: 40 e2 ldi r20, 0x20 ; 32 21466: 5d ef ldi r21, 0xFD ; 253 21468: be 01 movw r22, r28 } 2146a: df 91 pop r29 2146c: 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); 2146e: 0d 94 0a 95 jmp 0x32a14 ; 0x32a14 21472: 89 ea ldi r24, 0xA9 ; 169 21474: 9a e5 ldi r25, 0x5A ; 90 21476: ee cf rjmp .-36 ; 0x21454 00021478 : } #endif // TMC2130 } } static void menuitems_temperature_common() { 21478: ef 92 push r14 2147a: ff 92 push r15 2147c: 0f 93 push r16 2147e: 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); 21480: 88 e8 ldi r24, 0x88 ; 136 21482: 95 e5 ldi r25, 0x55 ; 85 21484: 0e 94 a7 6c call 0xd94e ; 0xd94e 21488: 28 ec ldi r18, 0xC8 ; 200 2148a: e2 2e mov r14, r18 2148c: f1 2c mov r15, r1 2148e: 07 e2 ldi r16, 0x27 ; 39 21490: 11 e0 ldi r17, 0x01 ; 1 21492: 30 e0 ldi r19, 0x00 ; 0 21494: 20 e0 ldi r18, 0x00 ; 0 21496: 40 e1 ldi r20, 0x10 ; 16 21498: 61 ef ldi r22, 0xF1 ; 241 2149a: 71 e1 ldi r23, 0x11 ; 17 2149c: 0f 94 cb 93 call 0x32796 ; 0x32796 #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); 214a0: 8d e6 ldi r24, 0x6D ; 109 214a2: 95 e5 ldi r25, 0x55 ; 85 214a4: 0e 94 a7 6c call 0xd94e ; 0xd94e 214a8: 32 e3 ldi r19, 0x32 ; 50 214aa: e3 2e mov r14, r19 214ac: f1 2c mov r15, r1 214ae: 08 e7 ldi r16, 0x78 ; 120 214b0: 10 e0 ldi r17, 0x00 ; 0 214b2: 30 e0 ldi r19, 0x00 ; 0 214b4: 20 e0 ldi r18, 0x00 ; 0 214b6: 40 e1 ldi r20, 0x10 ; 16 214b8: 6d ee ldi r22, 0xED ; 237 214ba: 71 e1 ldi r23, 0x11 ; 17 214bc: 0f 94 cb 93 call 0x32796 ; 0x32796 #endif MENU_ITEM_EDIT_int3_jmp_P(_T(MSG_FAN_SPEED), &fanSpeed, 0, 255, LCD_JUMP_FAN_SPEED); 214c0: 81 e6 ldi r24, 0x61 ; 97 214c2: 95 e5 ldi r25, 0x55 ; 85 214c4: 0e 94 a7 6c call 0xd94e ; 0xd94e 214c8: 4f e7 ldi r20, 0x7F ; 127 214ca: e4 2e mov r14, r20 214cc: f1 2c mov r15, r1 214ce: 0f ef ldi r16, 0xFF ; 255 214d0: 10 e0 ldi r17, 0x00 ; 0 214d2: 30 e0 ldi r19, 0x00 ; 0 214d4: 20 e0 ldi r18, 0x00 ; 0 214d6: 48 e0 ldi r20, 0x08 ; 8 214d8: 69 ee ldi r22, 0xE9 ; 233 214da: 71 e1 ldi r23, 0x11 ; 17 214dc: 0f 94 cb 93 call 0x32796 ; 0x32796 } 214e0: 1f 91 pop r17 214e2: 0f 91 pop r16 214e4: ff 90 pop r15 214e6: ef 90 pop r14 214e8: 08 95 ret 000214ea : } #endif //FILAMENT_SENSOR static void menuitems_MMU_settings_common() { 214ea: cf 93 push r28 214ec: df 93 push r29 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 214ee: 86 ed ldi r24, 0xD6 ; 214 214f0: 9e e0 ldi r25, 0x0E ; 14 214f2: 0f 94 9b a0 call 0x34136 ; 0x34136 214f6: 81 30 cpi r24, 0x01 ; 1 214f8: 19 f5 brne .+70 ; 0x21540 MENU_ITEM_TOGGLE_P(MSG_SPOOL_JOIN, SpoolJoin::spooljoin.isSpoolJoinEnabled() ? _T(MSG_ON) : _T(MSG_OFF), SpoolJoin::spooljoin.toggleSpoolJoin); 214fa: 8f ea ldi r24, 0xAF ; 175 214fc: 9a e5 ldi r25, 0x5A ; 90 214fe: 0e 94 a7 6c call 0xd94e ; 0xd94e 21502: 22 e0 ldi r18, 0x02 ; 2 21504: 43 e0 ldi r20, 0x03 ; 3 21506: 5e ef ldi r21, 0xFE ; 254 21508: bc 01 movw r22, r24 2150a: 84 e5 ldi r24, 0x54 ; 84 2150c: 9b e6 ldi r25, 0x6B ; 107 2150e: 0f 94 0a 95 call 0x32a14 ; 0x32a14 #ifdef MMU_HAS_CUTTER if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t *)EEPROM_MMU_CUTTER_ENABLED)) 21512: 8e ec ldi r24, 0xCE ; 206 21514: 9e e0 ldi r25, 0x0E ; 14 21516: 0f 94 9b a0 call 0x34136 ; 0x34136 2151a: 81 30 cpi r24, 0x01 ; 1 2151c: a1 f4 brne .+40 ; 0x21546 { MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_ON), lcd_cutter_enabled); 2151e: 8f ea ldi r24, 0xAF ; 175 21520: 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); 21522: 0e 94 a7 6c call 0xd94e ; 0xd94e 21526: ec 01 movw r28, r24 21528: 88 e5 ldi r24, 0x58 ; 88 2152a: 95 e5 ldi r25, 0x55 ; 85 2152c: 0e 94 a7 6c call 0xd94e ; 0xd94e 21530: 22 e0 ldi r18, 0x02 ; 2 21532: 4f e0 ldi r20, 0x0F ; 15 21534: 5e ef ldi r21, 0xFE ; 254 21536: 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 } 21538: df 91 pop r29 2153a: 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); 2153c: 0d 94 0a 95 jmp 0x32a14 ; 0x32a14 #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); 21540: 89 ea ldi r24, 0xA9 ; 169 21542: 9a e5 ldi r25, 0x5A ; 90 21544: dc cf rjmp .-72 ; 0x214fe 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); 21546: 89 ea ldi r24, 0xA9 ; 169 21548: 9a e5 ldi r25, 0x5A ; 90 2154a: eb cf rjmp .-42 ; 0x21522 0002154c : lcd_update(2); } #ifndef TMC2130 static void lcd_show_end_stops() { lcd_puts_at_P(0, 0, (PSTR("End stops diag"))); 2154c: 4f ef ldi r20, 0xFF ; 255 2154e: 57 e9 ldi r21, 0x97 ; 151 21550: 60 e0 ldi r22, 0x00 ; 0 21552: 80 e0 ldi r24, 0x00 ; 0 21554: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_puts_at_P(0, 1, (READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) ? (PSTR("X1")) : (PSTR("X0"))); 21558: 1e 99 sbic 0x03, 6 ; 3 2155a: 16 c0 rjmp .+44 ; 0x21588 2155c: 49 ef ldi r20, 0xF9 ; 249 2155e: 57 e9 ldi r21, 0x97 ; 151 21560: 61 e0 ldi r22, 0x01 ; 1 21562: 80 e0 ldi r24, 0x00 ; 0 21564: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_puts_at_P(0, 2, (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) ? (PSTR("Y1")) : (PSTR("Y0"))); 21568: 1d 9b sbis 0x03, 5 ; 3 2156a: 11 c0 rjmp .+34 ; 0x2158e 2156c: 46 ef ldi r20, 0xF6 ; 246 2156e: 57 e9 ldi r21, 0x97 ; 151 21570: 62 e0 ldi r22, 0x02 ; 2 21572: 80 e0 ldi r24, 0x00 ; 0 21574: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_puts_at_P(0, 3, (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING) ? (PSTR("Z1")) : (PSTR("Z0"))); 21578: 1c 9b sbis 0x03, 4 ; 3 2157a: 0c c0 rjmp .+24 ; 0x21594 2157c: 40 ef ldi r20, 0xF0 ; 240 2157e: 57 e9 ldi r21, 0x97 ; 151 21580: 63 e0 ldi r22, 0x03 ; 3 21582: 80 e0 ldi r24, 0x00 ; 0 21584: 0c 94 85 69 jmp 0xd30a ; 0xd30a } #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"))); 21588: 4c ef ldi r20, 0xFC ; 252 2158a: 57 e9 ldi r21, 0x97 ; 151 2158c: e9 cf rjmp .-46 ; 0x21560 lcd_puts_at_P(0, 2, (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) ? (PSTR("Y1")) : (PSTR("Y0"))); 2158e: 43 ef ldi r20, 0xF3 ; 243 21590: 57 e9 ldi r21, 0x97 ; 151 21592: ee cf rjmp .-36 ; 0x21570 lcd_puts_at_P(0, 3, (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING) ? (PSTR("Z1")) : (PSTR("Z0"))); 21594: 4d ee ldi r20, 0xED ; 237 21596: 57 e9 ldi r21, 0x97 ; 151 21598: f3 cf rjmp .-26 ; 0x21580 0002159a : } static void menu_show_end_stops() { lcd_show_end_stops(); 2159a: 0f 94 a6 0a call 0x2154c ; 0x2154c menu_back_if_clicked(); 2159e: 0d 94 e5 96 jmp 0x32dca ; 0x32dca 000215a2 : //! @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) { 215a2: cf 92 push r12 215a4: df 92 push r13 215a6: ef 92 push r14 215a8: ff 92 push r15 215aa: 0f 93 push r16 215ac: 1f 93 push r17 215ae: cf 93 push r28 215b0: df 93 push r29 215b2: d8 2f mov r29, r24 215b4: 6b 01 movw r12, r22 215b6: 7a 01 movw r14, r20 215b8: c2 2f mov r28, r18 lcd_putc_at(0, 3, selected == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 215ba: 40 e2 ldi r20, 0x20 ; 32 215bc: 81 11 cpse r24, r1 215be: 01 c0 rjmp .+2 ; 0x215c2 215c0: 4e e3 ldi r20, 0x3E ; 62 215c2: 63 e0 ldi r22, 0x03 ; 3 215c4: 80 e0 ldi r24, 0x00 ; 0 215c6: 0e 94 91 69 call 0xd322 ; 0xd322 lcd_puts_P(first_choice); 215ca: c6 01 movw r24, r12 215cc: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 lcd_putc_at(second_col, 3, selected == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 215d0: 40 e2 ldi r20, 0x20 ; 32 215d2: d1 30 cpi r29, 0x01 ; 1 215d4: 09 f4 brne .+2 ; 0x215d8 215d6: 4e e3 ldi r20, 0x3E ; 62 215d8: 63 e0 ldi r22, 0x03 ; 3 215da: 8c 2f mov r24, r28 215dc: 0e 94 91 69 call 0xd322 ; 0xd322 lcd_puts_P(second_choice); 215e0: c7 01 movw r24, r14 215e2: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 if (third_choice) { 215e6: 01 15 cp r16, r1 215e8: 11 05 cpc r17, r1 215ea: 19 f1 breq .+70 ; 0x21632 215ec: c8 01 movw r24, r16 215ee: 0f 94 59 9e call 0x33cb2 ; 0x33cb2 <__strlen_P> 215f2: d8 2e mov r13, r24 215f4: c7 01 movw r24, r14 215f6: 0f 94 59 9e call 0x33cb2 ; 0x33cb2 <__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; 215fa: 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;} 215fc: 93 e1 ldi r25, 0x13 ; 19 215fe: 9d 19 sub r25, r13 21600: 8c 0f add r24, r28 21602: 89 17 cp r24, r25 21604: 08 f4 brcc .+2 ; 0x21608 21606: 89 2f mov r24, r25 21608: 83 31 cpi r24, 0x13 ; 19 2160a: 08 f0 brcs .+2 ; 0x2160e 2160c: 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 ? '>': ' '); 2160e: 40 e2 ldi r20, 0x20 ; 32 21610: d2 30 cpi r29, 0x02 ; 2 21612: 09 f4 brne .+2 ; 0x21616 21614: 4e e3 ldi r20, 0x3E ; 62 21616: 63 e0 ldi r22, 0x03 ; 3 21618: 0e 94 91 69 call 0xd322 ; 0xd322 lcd_puts_P(third_choice); 2161c: c8 01 movw r24, r16 } } 2161e: df 91 pop r29 21620: cf 91 pop r28 21622: 1f 91 pop r17 21624: 0f 91 pop r16 21626: ff 90 pop r15 21628: ef 90 pop r14 2162a: df 90 pop r13 2162c: 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); 2162e: 0c 94 5c 69 jmp 0xd2b8 ; 0xd2b8 } } 21632: df 91 pop r29 21634: cf 91 pop r28 21636: 1f 91 pop r17 21638: 0f 91 pop r16 2163a: ff 90 pop r15 2163c: ef 90 pop r14 2163e: df 90 pop r13 21640: cf 90 pop r12 21642: 08 95 ret 00021644 : return multi_screen ? msgend : NULL; } const char* lcd_display_message_fullscreen_P(const char *msg) { 21644: cf 93 push r28 21646: df 93 push r29 21648: ec 01 movw r28, r24 // Disable update of the screen by the usual lcd_update(0) routine. lcd_update_enable(false); 2164a: 80 e0 ldi r24, 0x00 ; 0 2164c: 0e 94 b6 69 call 0xd36c ; 0xd36c lcd_clear(); 21650: 0e 94 a4 69 call 0xd348 ; 0xd348 return lcd_display_message_fullscreen_nonBlocking_P(msg); 21654: ce 01 movw r24, r28 } 21656: df 91 pop r29 21658: 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); 2165a: 0d 94 83 04 jmp 0x20906 ; 0x20906 0002165e : lang_select(LANG_ID_PRI); } #endif static void wait_preheat() { 2165e: cf 92 push r12 21660: df 92 push r13 21662: ef 92 push r14 21664: ff 92 push r15 current_position[Z_AXIS] = 100; //move in z axis to make space for loading filament 21666: 80 e0 ldi r24, 0x00 ; 0 21668: 90 e0 ldi r25, 0x00 ; 0 2166a: a8 ec ldi r26, 0xC8 ; 200 2166c: b2 e4 ldi r27, 0x42 ; 66 2166e: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 21672: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 21676: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 2167a: b0 93 00 12 sts 0x1200, r27 ; 0x801200 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 2167e: 65 e5 ldi r22, 0x55 ; 85 21680: 75 e5 ldi r23, 0x55 ; 85 21682: 85 e5 ldi r24, 0x55 ; 85 21684: 91 e4 ldi r25, 0x41 ; 65 21686: 0f 94 2f 85 call 0x30a5e ; 0x30a5e delay_keep_alive(2000); 2168a: 80 ed ldi r24, 0xD0 ; 208 2168c: 97 e0 ldi r25, 0x07 ; 7 2168e: 0e 94 45 7c call 0xf88a ; 0xf88a lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 21692: 85 e4 ldi r24, 0x45 ; 69 21694: 9e e4 ldi r25, 0x4E ; 78 21696: 0e 94 a7 6c call 0xd94e ; 0xd94e 2169a: 0f 94 22 0b call 0x21644 ; 0x21644 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 2169e: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 216a2: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 216a6: 07 2e mov r0, r23 216a8: 00 0c add r0, r0 216aa: 88 0b sbc r24, r24 216ac: 99 0b sbc r25, r25 216ae: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 216b2: 9b 01 movw r18, r22 216b4: ac 01 movw r20, r24 while (fabs(degHotend(0) - degTargetHotend(0)) > TEMP_HYSTERESIS) { 216b6: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 216ba: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 216be: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 216c2: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 216c6: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 216ca: 9f 77 andi r25, 0x7F ; 127 216cc: 20 e0 ldi r18, 0x00 ; 0 216ce: 30 e0 ldi r19, 0x00 ; 0 216d0: 40 ea ldi r20, 0xA0 ; 160 216d2: 50 e4 ldi r21, 0x40 ; 64 216d4: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 216d8: 18 16 cp r1, r24 216da: b4 f5 brge .+108 ; 0x21748 lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 216dc: 85 e4 ldi r24, 0x45 ; 69 216de: 9e e4 ldi r25, 0x4E ; 78 216e0: 0e 94 a7 6c call 0xd94e ; 0xd94e 216e4: 0f 94 22 0b call 0x21644 ; 0x21644 lcd_set_cursor(0, 4); 216e8: 64 e0 ldi r22, 0x04 ; 4 216ea: 80 e0 ldi r24, 0x00 ; 0 216ec: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 216f0: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 216f4: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 216f8: 07 2e mov r0, r23 216fa: 00 0c add r0, r0 216fc: 88 0b sbc r24, r24 216fe: 99 0b sbc r25, r25 21700: 0f 94 29 9b call 0x33652 ; 0x33652 <__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)); 21704: 20 e0 ldi r18, 0x00 ; 0 21706: 30 e0 ldi r19, 0x00 ; 0 21708: 40 e0 ldi r20, 0x00 ; 0 2170a: 5f e3 ldi r21, 0x3F ; 63 2170c: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 21710: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 21714: 6b 01 movw r12, r22 21716: 20 e0 ldi r18, 0x00 ; 0 21718: 30 e0 ldi r19, 0x00 ; 0 2171a: 40 e0 ldi r20, 0x00 ; 0 2171c: 5f e3 ldi r21, 0x3F ; 63 2171e: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 21722: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 21726: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 2172a: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 2172e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 21732: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 21736: a6 01 movw r20, r12 21738: 82 e8 ldi r24, 0x82 ; 130 2173a: 0f 94 19 07 call 0x20e32 ; 0x20e32 delay_keep_alive(1000); 2173e: 88 ee ldi r24, 0xE8 ; 232 21740: 93 e0 ldi r25, 0x03 ; 3 21742: 0e 94 45 7c call 0xf88a ; 0xf88a 21746: ab cf rjmp .-170 ; 0x2169e } } 21748: ff 90 pop r15 2174a: ef 90 pop r14 2174c: df 90 pop r13 2174e: cf 90 pop r12 21750: 08 95 ret 00021752 : * * This function is blocking. * @param msg message to be displayed from PROGMEM */ void lcd_show_fullscreen_message_and_wait_P(const char *msg) { 21752: cf 92 push r12 21754: df 92 push r13 21756: ef 92 push r14 21758: ff 92 push r15 2175a: 0f 93 push r16 2175c: 1f 93 push r17 2175e: cf 93 push r28 21760: df 93 push r29 21762: d8 2e mov r13, r24 21764: 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) 21766: 01 e0 ldi r16, 0x01 ; 1 21768: 80 91 5c 02 lds r24, 0x025C ; 0x80025c 2176c: 81 11 cpse r24, r1 2176e: 01 c0 rjmp .+2 ; 0x21772 21770: 00 e0 ldi r16, 0x00 ; 0 { lcd_update_enabled = false; 21772: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c LcdUpdateDisabler lcdUpdateDisabler; const char *msg_next = lcd_display_message_fullscreen_P(msg); 21776: 8d 2d mov r24, r13 21778: 9c 2d mov r25, r12 2177a: 0f 94 22 0b call 0x21644 ; 0x21644 2177e: 7c 01 movw r14, r24 bool multi_screen = msg_next != NULL; lcd_consume_click(); 21780: 0e 94 89 6b call 0xd712 ; 0xd712 KEEPALIVE_STATE(PAUSED_FOR_USER); 21784: 84 e0 ldi r24, 0x04 ; 4 21786: 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); 2178a: 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) { 2178c: 20 97 sbiw r28, 0x00 ; 0 2178e: 29 f4 brne .+10 ; 0x2179a // Display the confirm char. lcd_putc_at(19, 3, LCD_STR_CONFIRM[0]); 21790: 49 e8 ldi r20, 0x89 ; 137 21792: 63 e0 ldi r22, 0x03 ; 3 21794: 83 e1 ldi r24, 0x13 ; 19 21796: 0e 94 91 69 call 0xd322 ; 0xd322 * @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); 2179a: 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); 2179c: 82 e3 ldi r24, 0x32 ; 50 2179e: 90 e0 ldi r25, 0x00 ; 0 217a0: 0e 94 45 7c call 0xf88a ; 0xf88a if (lcd_clicked()) { 217a4: 0e 94 8e 6b call 0xd71c ; 0xd71c 217a8: 88 23 and r24, r24 217aa: 81 f0 breq .+32 ; 0x217cc if (msg_next == NULL) { 217ac: 20 97 sbiw r28, 0x00 ; 0 217ae: 81 f4 brne .+32 ; 0x217d0 KEEPALIVE_STATE(IN_HANDLER); 217b0: 82 e0 ldi r24, 0x02 ; 2 217b2: 80 93 78 02 sts 0x0278, r24 ; 0x800278 } ~LcdUpdateDisabler() { lcd_update_enabled = m_updateEnabled; 217b6: 00 93 5c 02 sts 0x025C, r16 ; 0x80025c if (msg_next == NULL) msg_next = msg; msg_next = lcd_display_message_fullscreen_P(msg_next); } } } 217ba: df 91 pop r29 217bc: cf 91 pop r28 217be: 1f 91 pop r17 217c0: 0f 91 pop r16 217c2: ff 90 pop r15 217c4: ef 90 pop r14 217c6: df 90 pop r13 217c8: cf 90 pop r12 217ca: 08 95 ret 217cc: 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) { 217ce: 31 f7 brne .-52 ; 0x2179c else { break; } } } if (multi_screen) { 217d0: e1 14 cp r14, r1 217d2: f1 04 cpc r15, r1 217d4: d9 f2 breq .-74 ; 0x2178c if (msg_next == NULL) 217d6: 20 97 sbiw r28, 0x00 ; 0 217d8: 11 f4 brne .+4 ; 0x217de msg_next = msg; 217da: cd 2d mov r28, r13 217dc: dc 2d mov r29, r12 msg_next = lcd_display_message_fullscreen_P(msg_next); 217de: ce 01 movw r24, r28 217e0: 0f 94 22 0b call 0x21644 ; 0x21644 217e4: ec 01 movw r28, r24 217e6: d2 cf rjmp .-92 ; 0x2178c 000217e8 : // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); } static void wizard_lay1cal_message(bool cold) { 217e8: cf 93 push r28 217ea: c8 2f mov r28, r24 lcd_show_fullscreen_message_and_wait_P( 217ec: 87 e3 ldi r24, 0x37 ; 55 217ee: 90 e5 ldi r25, 0x50 ; 80 217f0: 0e 94 a7 6c call 0xd94e ; 0xd94e 217f4: 0f 94 a9 0b call 0x21752 ; 0x21752 _T(MSG_WIZARD_V2_CAL)); if (MMU2::mmu2.Enabled()) 217f8: 80 91 94 12 lds r24, 0x1294 ; 0x801294 217fc: 81 30 cpi r24, 0x01 ; 1 217fe: 69 f4 brne .+26 ; 0x2181a { lcd_show_fullscreen_message_and_wait_P( 21800: 8e ed ldi r24, 0xDE ; 222 21802: 9f e4 ldi r25, 0x4F ; 79 _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) { lcd_show_fullscreen_message_and_wait_P( 21804: 0e 94 a7 6c call 0xd94e ; 0xd94e 21808: 0f 94 a9 0b call 0x21752 ; 0x21752 _T(MSG_SELECT_TEMP_MATCHES_MATERIAL)); } lcd_show_fullscreen_message_and_wait_P( 2180c: 8c e0 ldi r24, 0x0C ; 12 2180e: 9f e4 ldi r25, 0x4F ; 79 21810: 0e 94 a7 6c call 0xd94e ; 0xd94e _T(MSG_WIZARD_V2_CAL_2)); } 21814: 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( 21816: 0d 94 a9 0b jmp 0x21752 ; 0x21752 if (MMU2::mmu2.Enabled()) { lcd_show_fullscreen_message_and_wait_P( _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) 2181a: cc 23 and r28, r28 2181c: b9 f3 breq .-18 ; 0x2180c { lcd_show_fullscreen_message_and_wait_P( 2181e: 8c ea ldi r24, 0xAC ; 172 21820: 9f e4 ldi r25, 0x4F ; 79 21822: f0 cf rjmp .-32 ; 0x21804 00021824 : } } static void lcd_wizard_load() { if (MMU2::mmu2.Enabled()) { 21824: 80 91 94 12 lds r24, 0x1294 ; 0x801294 21828: 81 30 cpi r24, 0x01 ; 1 2182a: 71 f4 brne .+28 ; 0x21848 lcd_show_fullscreen_message_and_wait_P( 2182c: 83 eb ldi r24, 0xB3 ; 179 2182e: 9e e4 ldi r25, 0x4E ; 78 21830: 0e 94 a7 6c call 0xd94e ; 0xd94e 21834: 0f 94 a9 0b call 0x21752 ; 0x21752 _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; 21838: 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; 2183a: 80 93 62 03 sts 0x0362, r24 ; 0x800362 } // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); 2183e: 61 e0 ldi r22, 0x01 ; 1 21840: 80 e2 ldi r24, 0x20 ; 32 21842: 98 e9 ldi r25, 0x98 ; 152 21844: 0c 94 ac 7c jmp 0xf958 ; 0xf958 // 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( 21848: 87 e6 ldi r24, 0x67 ; 103 2184a: 9e e4 ldi r25, 0x4E ; 78 2184c: 0e 94 a7 6c call 0xd94e ; 0xd94e 21850: 0f 94 a9 0b call 0x21752 ; 0x21752 _T(MSG_WIZARD_LOAD_FILAMENT)); lcd_update_enable(false); 21854: 80 e0 ldi r24, 0x00 ; 0 21856: 0e 94 b6 69 call 0xd36c ; 0xd36c lcd_clear(); 2185a: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_puts_at_P(0, 2, _T(MSG_LOADING_FILAMENT)); 2185e: 82 e0 ldi r24, 0x02 ; 2 21860: 9a e5 ldi r25, 0x5A ; 90 21862: 0e 94 a7 6c call 0xd94e ; 0xd94e 21866: ac 01 movw r20, r24 21868: 62 e0 ldi r22, 0x02 ; 2 2186a: 80 e0 ldi r24, 0x00 ; 0 2186c: 0e 94 85 69 call 0xd30a ; 0xd30a eFilamentAction = FilamentAction::Load; 21870: 81 e0 ldi r24, 0x01 ; 1 21872: e3 cf rjmp .-58 ; 0x2183a 00021874 : lcd_show_fullscreen_message_and_wait_P(msg); } } } void lcd_temp_cal_show_result(bool result) { 21874: cf 93 push r28 21876: c8 2f mov r28, r24 custom_message_type = CustomMsg::Status; 21878: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 disable_x(); 2187c: 17 9a sbi 0x02, 7 ; 2 2187e: 10 92 a3 06 sts 0x06A3, r1 ; 0x8006a3 disable_y(); 21882: 16 9a sbi 0x02, 6 ; 2 21884: 10 92 a4 06 sts 0x06A4, r1 ; 0x8006a4 disable_z(); disable_e0(); 21888: 14 9a sbi 0x02, 4 ; 2 target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2188a: 10 92 ee 11 sts 0x11EE, r1 ; 0x8011ee 2188e: 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); 21892: 68 2f mov r22, r24 21894: 86 ea ldi r24, 0xA6 ; 166 21896: 9f e0 ldi r25, 0x0F ; 15 21898: 0f 94 bf a0 call 0x3417e ; 0x3417e 2189c: 6c 2f mov r22, r28 2189e: 8f ea ldi r24, 0xAF ; 175 218a0: 9f e0 ldi r25, 0x0F ; 15 218a2: 0f 94 bf a0 call 0x3417e ; 0x3417e // 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) { 218a6: cc 23 and r28, r28 218a8: 89 f0 breq .+34 ; 0x218cc SERIAL_ECHOLNPGM("PINDA calibration done. Continue with pressing the knob."); 218aa: 84 eb ldi r24, 0xB4 ; 180 218ac: 97 e9 ldi r25, 0x97 ; 151 218ae: 0e 94 49 72 call 0xe492 ; 0xe492 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CALIBRATION_DONE)); 218b2: 82 e1 ldi r24, 0x12 ; 18 218b4: 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)); 218b6: 0e 94 a7 6c call 0xd94e ; 0xd94e 218ba: 0f 94 a9 0b call 0x21752 ; 0x21752 } lcd_update_enable(true); 218be: 81 e0 ldi r24, 0x01 ; 1 218c0: 0e 94 b6 69 call 0xd36c ; 0xd36c lcd_update(2); 218c4: 82 e0 ldi r24, 0x02 ; 2 } 218c6: 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); 218c8: 0c 94 38 69 jmp 0xd270 ; 0xd270 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."); 218cc: 89 e7 ldi r24, 0x79 ; 121 218ce: 97 e9 ldi r25, 0x97 ; 151 218d0: 0e 94 49 72 call 0xe492 ; 0xe492 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 218d4: 87 ef ldi r24, 0xF7 ; 247 218d6: 9c e4 ldi r25, 0x4C ; 76 218d8: ee cf rjmp .-36 ; 0x218b6 000218da : lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { 218da: 1f 93 push r17 218dc: cf 93 push r28 218de: 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); 218e0: 64 e6 ldi r22, 0x64 ; 100 218e2: 70 e0 ldi r23, 0x00 ; 0 218e4: 0f 94 64 a1 call 0x342c8 ; 0x342c8 <__udivmodhi4> 218e8: 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++) { 218ea: 10 e0 ldi r17, 0x00 ; 0 lcd_putc_at(i, 3, '.'); 218ec: 4e e2 ldi r20, 0x2E ; 46 218ee: 63 e0 ldi r22, 0x03 ; 3 218f0: 81 2f mov r24, r17 218f2: 0e 94 91 69 call 0xd322 ; 0xd322 //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); 218f6: ce 01 movw r24, r28 218f8: 0e 94 45 7c call 0xf88a ; 0xf88a 218fc: ce 01 movw r24, r28 218fe: 0e 94 45 7c call 0xf88a ; 0xf88a 21902: ce 01 movw r24, r28 21904: 0e 94 45 7c call 0xf88a ; 0xf88a 21908: ce 01 movw r24, r28 2190a: 0e 94 45 7c call 0xf88a ; 0xf88a 2190e: ce 01 movw r24, r28 21910: 0e 94 45 7c call 0xf88a ; 0xf88a } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { for (uint_least8_t i = 0; i < LCD_WIDTH; i++) { 21914: 1f 5f subi r17, 0xFF ; 255 21916: 14 31 cpi r17, 0x14 ; 20 21918: 49 f7 brne .-46 ; 0x218ec //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); } } } 2191a: df 91 pop r29 2191c: cf 91 pop r28 2191e: 1f 91 pop r17 21920: 08 95 ret 00021922 : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 21922: 10 92 62 03 sts 0x0362, r1 ; 0x800362 static void __attribute__((noinline)) clearFilamentAction() { // filament action has been cancelled or completed setFilamentAction(FilamentAction::None); } 21926: 08 95 ret 00021928 : bFilamentPreheatState = false; mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { 21928: cf 93 push r28 MENU_BEGIN(); 2192a: 0f 94 7b 93 call 0x326f6 ; 0x326f6 2192e: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 21932: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 21936: 84 30 cpi r24, 0x04 ; 4 21938: 08 f0 brcs .+2 ; 0x2193c 2193a: b1 c0 rjmp .+354 ; 0x21a9e 2193c: 10 92 31 04 sts 0x0431, r1 ; 0x800431 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 21940: 8f e5 ldi r24, 0x5F ; 95 21942: 9f e0 ldi r25, 0x0F ; 15 21944: 0f 94 9b a0 call 0x34136 ; 0x34136 21948: 81 11 cpse r24, r1 2194a: 0f c0 rjmp .+30 ; 0x2196a { ON_MENU_LEAVE( 2194c: 0f 94 fb 91 call 0x323f6 ; 0x323f6 21950: 81 11 cpse r24, r1 21952: 0f 94 91 0c call 0x21922 ; 0x21922 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(eFilamentAction == FilamentAction::Lay1Cal ? MSG_BACK : MSG_MAIN)); 21956: 80 91 62 03 lds r24, 0x0362 ; 0x800362 2195a: 8a 30 cpi r24, 0x0A ; 10 2195c: a9 f1 breq .+106 ; 0x219c8 2195e: 88 ef ldi r24, 0xF8 ; 248 21960: 9d e3 ldi r25, 0x3D ; 61 21962: 0e 94 a7 6c call 0xd94e ; 0xd94e 21966: 0f 94 46 96 call 0x32c8c ; 0x32c8c } if (farm_mode) 2196a: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 2196e: 88 23 and r24, r24 21970: 71 f1 breq .+92 ; 0x219ce { MENU_ITEM_FUNCTION_P(PSTR("farm - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FARM_PREHEAT_HPB_TEMP)), mFilamentItem_farm); 21972: 69 e6 ldi r22, 0x69 ; 105 21974: 77 e3 ldi r23, 0x37 ; 55 21976: 86 e2 ldi r24, 0x26 ; 38 21978: 97 e9 ldi r25, 0x97 ; 151 2197a: 0f 94 f8 92 call 0x325f0 ; 0x325f0 MENU_ITEM_FUNCTION_P(PSTR("nozzle - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/0"), mFilamentItem_farm_nozzle); 2197e: 67 e6 ldi r22, 0x67 ; 103 21980: 77 e3 ldi r23, 0x37 ; 55 21982: 86 e1 ldi r24, 0x16 ; 22 21984: 97 e9 ldi r25, 0x97 ; 151 21986: 0f 94 f8 92 call 0x325f0 ; 0x325f0 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); 2198a: 8f e5 ldi r24, 0x5F ; 95 2198c: 9f e0 ldi r25, 0x0F ; 15 2198e: 0f 94 9b a0 call 0x34136 ; 0x34136 21992: 81 11 cpse r24, r1 21994: 0c c0 rjmp .+24 ; 0x219ae 21996: 80 91 62 03 lds r24, 0x0362 ; 0x800362 2199a: 89 30 cpi r24, 0x09 ; 9 2199c: 41 f4 brne .+16 ; 0x219ae 2199e: 84 e5 ldi r24, 0x54 ; 84 219a0: 9a e4 ldi r25, 0x4A ; 74 219a2: 0e 94 a7 6c call 0xd94e ; 0xd94e 219a6: 65 ec ldi r22, 0xC5 ; 197 219a8: 76 e3 ldi r23, 0x36 ; 54 219aa: 0f 94 f8 92 call 0x325f0 ; 0x325f0 MENU_END(); 219ae: 0f 94 4f 93 call 0x3269e ; 0x3269e mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { MENU_BEGIN(); 219b2: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 219b6: 8f 5f subi r24, 0xFF ; 255 219b8: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 219bc: 80 91 30 04 lds r24, 0x0430 ; 0x800430 219c0: 8f 5f subi r24, 0xFF ; 255 219c2: 80 93 30 04 sts 0x0430, r24 ; 0x800430 219c6: b5 cf rjmp .-150 ; 0x21932 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)); 219c8: 84 e1 ldi r24, 0x14 ; 20 219ca: 90 e4 ldi r25, 0x40 ; 64 219cc: ca cf rjmp .-108 ; 0x21962 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(); 219ce: 0e 94 39 fe call 0x1fc72 ; 0x1fc72 219d2: 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); 219d4: 8b ef ldi r24, 0xFB ; 251 219d6: 96 e9 ldi r25, 0x96 ; 150 219d8: cc 23 and r28, r28 219da: 11 f0 breq .+4 ; 0x219e0 219dc: 8a e0 ldi r24, 0x0A ; 10 219de: 97 e9 ldi r25, 0x97 ; 151 219e0: 6f ef ldi r22, 0xFF ; 255 219e2: 76 e3 ldi r23, 0x36 ; 54 219e4: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 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); 219e8: 80 ee ldi r24, 0xE0 ; 224 219ea: 96 e9 ldi r25, 0x96 ; 150 219ec: cc 23 and r28, r28 219ee: 11 f0 breq .+4 ; 0x219f4 219f0: 8f ee ldi r24, 0xEF ; 239 219f2: 96 e9 ldi r25, 0x96 ; 150 219f4: 61 e2 ldi r22, 0x21 ; 33 219f6: 77 e3 ldi r23, 0x37 ; 55 219f8: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 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); 219fc: 84 ec ldi r24, 0xC4 ; 196 219fe: 96 e9 ldi r25, 0x96 ; 150 21a00: cc 23 and r28, r28 21a02: 11 f0 breq .+4 ; 0x21a08 21a04: 84 ed ldi r24, 0xD4 ; 212 21a06: 96 e9 ldi r25, 0x96 ; 150 21a08: 6b ec ldi r22, 0xCB ; 203 21a0a: 76 e3 ldi r23, 0x36 ; 54 21a0c: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 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); 21a10: 88 ea ldi r24, 0xA8 ; 168 21a12: 96 e9 ldi r25, 0x96 ; 150 21a14: cc 23 and r28, r28 21a16: 11 f0 breq .+4 ; 0x21a1c 21a18: 88 eb ldi r24, 0xB8 ; 184 21a1a: 96 e9 ldi r25, 0x96 ; 150 21a1c: 61 ea ldi r22, 0xA1 ; 161 21a1e: 77 e3 ldi r23, 0x37 ; 55 21a20: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 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); 21a24: 8d e8 ldi r24, 0x8D ; 141 21a26: 96 e9 ldi r25, 0x96 ; 150 21a28: cc 23 and r28, r28 21a2a: 11 f0 breq .+4 ; 0x21a30 21a2c: 8c e9 ldi r24, 0x9C ; 156 21a2e: 96 e9 ldi r25, 0x96 ; 150 21a30: 63 e8 ldi r22, 0x83 ; 131 21a32: 77 e3 ldi r23, 0x37 ; 55 21a34: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 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); 21a38: 82 e7 ldi r24, 0x72 ; 114 21a3a: 96 e9 ldi r25, 0x96 ; 150 21a3c: cc 23 and r28, r28 21a3e: 11 f0 breq .+4 ; 0x21a44 21a40: 81 e8 ldi r24, 0x81 ; 129 21a42: 96 e9 ldi r25, 0x96 ; 150 21a44: 6b e5 ldi r22, 0x5B ; 91 21a46: 78 e3 ldi r23, 0x38 ; 56 21a48: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 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); 21a4c: 86 e5 ldi r24, 0x56 ; 86 21a4e: 96 e9 ldi r25, 0x96 ; 150 21a50: cc 23 and r28, r28 21a52: 11 f0 breq .+4 ; 0x21a58 21a54: 86 e6 ldi r24, 0x66 ; 102 21a56: 96 e9 ldi r25, 0x96 ; 150 21a58: 69 e9 ldi r22, 0x99 ; 153 21a5a: 77 e3 ldi r23, 0x37 ; 55 21a5c: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 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); 21a60: 8a e3 ldi r24, 0x3A ; 58 21a62: 96 e9 ldi r25, 0x96 ; 150 21a64: cc 23 and r28, r28 21a66: 11 f0 breq .+4 ; 0x21a6c 21a68: 8a e4 ldi r24, 0x4A ; 74 21a6a: 96 e9 ldi r25, 0x96 ; 150 21a6c: 61 ef ldi r22, 0xF1 ; 241 21a6e: 77 e3 ldi r23, 0x37 ; 55 21a70: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 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); 21a74: 8e e1 ldi r24, 0x1E ; 30 21a76: 96 e9 ldi r25, 0x96 ; 150 21a78: cc 23 and r28, r28 21a7a: 11 f0 breq .+4 ; 0x21a80 21a7c: 8e e2 ldi r24, 0x2E ; 46 21a7e: 96 e9 ldi r25, 0x96 ; 150 21a80: 6f e7 ldi r22, 0x7F ; 127 21a82: 78 e3 ldi r23, 0x38 ; 56 21a84: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 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); 21a88: 83 e0 ldi r24, 0x03 ; 3 21a8a: 96 e9 ldi r25, 0x96 ; 150 21a8c: cc 23 and r28, r28 21a8e: 11 f0 breq .+4 ; 0x21a94 21a90: 82 e1 ldi r24, 0x12 ; 18 21a92: 96 e9 ldi r25, 0x96 ; 150 21a94: 6b ef ldi r22, 0xFB ; 251 21a96: 77 e3 ldi r23, 0x37 ; 55 21a98: 0f 94 f9 95 call 0x32bf2 ; 0x32bf2 21a9c: 76 cf rjmp .-276 ; 0x2198a } if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) && eFilamentAction == FilamentAction::Preheat) MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown); MENU_END(); } 21a9e: cf 91 pop r28 21aa0: 08 95 ret 00021aa2 : #endif //RESUME_DEBUG //! @brief Show Preheat Menu static void lcd_preheat_menu() { eFilamentAction = FilamentAction::Preheat; 21aa2: 89 e0 ldi r24, 0x09 ; 9 21aa4: 80 93 62 03 sts 0x0362, r24 ; 0x800362 lcd_generic_preheat_menu(); 21aa8: 0d 94 94 0c jmp 0x21928 ; 0x21928 00021aac : // 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); 21aac: 81 e0 ldi r24, 0x01 ; 1 21aae: 0e 94 67 69 call 0xd2ce ; 0xd2ce if (MMU2::mmu2.get_current_tool() == MMU2::mmu2.get_tool_change_tool()) { 21ab2: 0f 94 4a 42 call 0x28494 ; 0x28494 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; 21ab6: 90 91 7c 12 lds r25, 0x127C ; 0x80127c 21aba: 93 36 cpi r25, 0x63 ; 99 21abc: 09 f4 brne .+2 ; 0x21ac0 21abe: 9f ef ldi r25, 0xFF ; 255 21ac0: 89 13 cpse r24, r25 21ac2: 0e c0 rjmp .+28 ; 0x21ae0 lcd_putc('F'); 21ac4: 86 e4 ldi r24, 0x46 ; 70 21ac6: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 21aca: 0f 94 4a 42 call 0x28494 ; 0x28494 21ace: 8f 3f cpi r24, 0xFF ; 255 21ad0: 29 f0 breq .+10 ; 0x21adc 21ad2: 8f 5c subi r24, 0xCF ; 207 21ad4: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 21ad8: 83 e0 ldi r24, 0x03 ; 3 21ada: 08 95 ret 21adc: 8f e3 ldi r24, 0x3F ; 63 21ade: fa cf rjmp .-12 ; 0x21ad4 chars += 2; } else { lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 21ae0: 8f 3f cpi r24, 0xFF ; 255 21ae2: 89 f0 breq .+34 ; 0x21b06 21ae4: 8f 5c subi r24, 0xCF ; 207 21ae6: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 lcd_putc('>'); 21aea: 8e e3 ldi r24, 0x3E ; 62 21aec: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 21af0: 80 91 7c 12 lds r24, 0x127C ; 0x80127c 21af4: 83 36 cpi r24, 0x63 ; 99 21af6: 49 f0 breq .+18 ; 0x21b0a lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 21af8: 8f 3f cpi r24, 0xFF ; 255 21afa: 39 f0 breq .+14 ; 0x21b0a 21afc: 8f 5c subi r24, 0xCF ; 207 21afe: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 chars += 3; 21b02: 84 e0 ldi r24, 0x04 ; 4 } return chars; } 21b04: 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'); 21b06: 8f e3 ldi r24, 0x3F ; 63 21b08: ee cf rjmp .-36 ; 0x21ae6 lcd_putc('>'); lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 21b0a: 8f e3 ldi r24, 0x3F ; 63 21b0c: f8 cf rjmp .-16 ; 0x21afe 00021b0e <__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) { 21b0e: 1f 92 push r1 21b10: 0f 92 push r0 21b12: 0f b6 in r0, 0x3f ; 63 21b14: 0f 92 push r0 21b16: 11 24 eor r1, r1 21b18: 0b b6 in r0, 0x3b ; 59 21b1a: 0f 92 push r0 21b1c: 2f 93 push r18 21b1e: 3f 93 push r19 21b20: 4f 93 push r20 21b22: 5f 93 push r21 21b24: 6f 93 push r22 21b26: 7f 93 push r23 21b28: 8f 93 push r24 21b2a: 9f 93 push r25 21b2c: af 93 push r26 21b2e: bf 93 push r27 21b30: ef 93 push r30 21b32: ff 93 push r31 if (rbuf_put(uart2_ibuf, UDR2) < 0) // put received byte to buffer 21b34: 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 21b38: 80 91 b0 0d lds r24, 0x0DB0 ; 0x800db0 uint8_t buf_r = ptr[2]; //get read index 21b3c: 90 91 b1 0d lds r25, 0x0DB1 ; 0x800db1 _unlock(); //unlock ptr[4 + buf_w] = b; //store byte to buffer 21b40: e8 2f mov r30, r24 21b42: f0 e0 ldi r31, 0x00 ; 0 21b44: ed 54 subi r30, 0x4D ; 77 21b46: f2 4f sbci r31, 0xF2 ; 242 21b48: 20 83 st Z, r18 buf_w++; //incerment write index 21b4a: 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 21b4c: 20 91 af 0d lds r18, 0x0DAF ; 0x800daf 21b50: 82 17 cp r24, r18 21b52: 08 f0 brcs .+2 ; 0x21b56 <__vector_51+0x48> 21b54: 80 e0 ldi r24, 0x00 ; 0 if (buf_w == buf_r) return -1; //return -1 to signal buffer full 21b56: 98 13 cpse r25, r24 21b58: 17 c0 rjmp .+46 ; 0x21b88 <__vector_51+0x7a> { //rx buffer full puts_P(PSTR("USART2 rx Full!!!")); 21b5a: 85 e9 ldi r24, 0x95 ; 149 21b5c: 94 e9 ldi r25, 0x94 ; 148 21b5e: 0f 94 84 9f call 0x33f08 ; 0x33f08 } } 21b62: ff 91 pop r31 21b64: ef 91 pop r30 21b66: bf 91 pop r27 21b68: af 91 pop r26 21b6a: 9f 91 pop r25 21b6c: 8f 91 pop r24 21b6e: 7f 91 pop r23 21b70: 6f 91 pop r22 21b72: 5f 91 pop r21 21b74: 4f 91 pop r20 21b76: 3f 91 pop r19 21b78: 2f 91 pop r18 21b7a: 0f 90 pop r0 21b7c: 0b be out 0x3b, r0 ; 59 21b7e: 0f 90 pop r0 21b80: 0f be out 0x3f, r0 ; 63 21b82: 0f 90 pop r0 21b84: 1f 90 pop r1 21b86: 18 95 reti ptr[1] = buf_w; //store write index 21b88: 80 93 b0 0d sts 0x0DB0, r24 ; 0x800db0 21b8c: ea cf rjmp .-44 ; 0x21b62 <__vector_51+0x54> 00021b8e <__vector_45>: { WRITE(BEEPER, 1); } ISR(TIMER4_OVF_vect) { 21b8e: 1f 92 push r1 21b90: 0f 92 push r0 21b92: 0f b6 in r0, 0x3f ; 63 21b94: 0f 92 push r0 21b96: 11 24 eor r1, r1 21b98: 0b b6 in r0, 0x3b ; 59 21b9a: 0f 92 push r0 21b9c: 8f 93 push r24 21b9e: 9f 93 push r25 21ba0: ef 93 push r30 21ba2: ff 93 push r31 WRITE(BEEPER, 0); 21ba4: 9f b7 in r25, 0x3f ; 63 21ba6: f8 94 cli 21ba8: e2 e0 ldi r30, 0x02 ; 2 21baa: f1 e0 ldi r31, 0x01 ; 1 21bac: 80 81 ld r24, Z 21bae: 8b 7f andi r24, 0xFB ; 251 21bb0: 80 83 st Z, r24 21bb2: 9f bf out 0x3f, r25 ; 63 } 21bb4: ff 91 pop r31 21bb6: ef 91 pop r30 21bb8: 9f 91 pop r25 21bba: 8f 91 pop r24 21bbc: 0f 90 pop r0 21bbe: 0b be out 0x3b, r0 ; 59 21bc0: 0f 90 pop r0 21bc2: 0f be out 0x3f, r0 ; 63 21bc4: 0f 90 pop r0 21bc6: 1f 90 pop r1 21bc8: 18 95 reti 00021bca <__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) { 21bca: 1f 92 push r1 21bcc: 0f 92 push r0 21bce: 0f b6 in r0, 0x3f ; 63 21bd0: 0f 92 push r0 21bd2: 11 24 eor r1, r1 21bd4: 0b b6 in r0, 0x3b ; 59 21bd6: 0f 92 push r0 21bd8: 8f 93 push r24 21bda: 9f 93 push r25 21bdc: ef 93 push r30 21bde: ff 93 push r31 WRITE(BEEPER, 1); 21be0: 9f b7 in r25, 0x3f ; 63 21be2: f8 94 cli 21be4: e2 e0 ldi r30, 0x02 ; 2 21be6: f1 e0 ldi r31, 0x01 ; 1 21be8: 80 81 ld r24, Z 21bea: 84 60 ori r24, 0x04 ; 4 21bec: 80 83 st Z, r24 21bee: 9f bf out 0x3f, r25 ; 63 } 21bf0: ff 91 pop r31 21bf2: ef 91 pop r30 21bf4: 9f 91 pop r25 21bf6: 8f 91 pop r24 21bf8: 0f 90 pop r0 21bfa: 0b be out 0x3b, r0 ; 59 21bfc: 0f 90 pop r0 21bfe: 0f be out 0x3f, r0 ; 63 21c00: 0f 90 pop r0 21c02: 1f 90 pop r1 21c04: 18 95 reti 00021c06 : void delay2(unsigned long ms) { 21c06: 8f 92 push r8 21c08: 9f 92 push r9 21c0a: af 92 push r10 21c0c: bf 92 push r11 21c0e: cf 92 push r12 21c10: df 92 push r13 21c12: ef 92 push r14 21c14: ff 92 push r15 21c16: 6b 01 movw r12, r22 21c18: 7c 01 movw r14, r24 uint32_t start = micros2(); 21c1a: 0e 94 2c f8 call 0x1f058 ; 0x1f058 21c1e: 4b 01 movw r8, r22 21c20: 5c 01 movw r10, r24 while (ms > 0) { yield(); while ( ms > 0 && (micros2() - start) >= 1000) 21c22: c1 14 cp r12, r1 21c24: d1 04 cpc r13, r1 21c26: e1 04 cpc r14, r1 21c28: f1 04 cpc r15, r1 21c2a: b9 f0 breq .+46 ; 0x21c5a 21c2c: 0e 94 2c f8 call 0x1f058 ; 0x1f058 21c30: 68 19 sub r22, r8 21c32: 79 09 sbc r23, r9 21c34: 8a 09 sbc r24, r10 21c36: 9b 09 sbc r25, r11 21c38: 68 3e cpi r22, 0xE8 ; 232 21c3a: 73 40 sbci r23, 0x03 ; 3 21c3c: 81 05 cpc r24, r1 21c3e: 91 05 cpc r25, r1 21c40: 80 f3 brcs .-32 ; 0x21c22 { ms--; 21c42: 21 e0 ldi r18, 0x01 ; 1 21c44: c2 1a sub r12, r18 21c46: d1 08 sbc r13, r1 21c48: e1 08 sbc r14, r1 21c4a: f1 08 sbc r15, r1 start += 1000; 21c4c: 88 ee ldi r24, 0xE8 ; 232 21c4e: 88 0e add r8, r24 21c50: 83 e0 ldi r24, 0x03 ; 3 21c52: 98 1e adc r9, r24 21c54: a1 1c adc r10, r1 21c56: b1 1c adc r11, r1 21c58: e4 cf rjmp .-56 ; 0x21c22 } } } 21c5a: ff 90 pop r15 21c5c: ef 90 pop r14 21c5e: df 90 pop r13 21c60: cf 90 pop r12 21c62: bf 90 pop r11 21c64: af 90 pop r10 21c66: 9f 90 pop r9 21c68: 8f 90 pop r8 21c6a: 08 95 ret 00021c6c : * @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() { 21c6c: ef 92 push r14 21c6e: ff 92 push r15 21c70: 0f 93 push r16 21c72: 1f 93 push r17 21c74: cf 93 push r28 21c76: df 93 push r29 21c78: cd b7 in r28, 0x3d ; 61 21c7a: de b7 in r29, 0x3e ; 62 21c7c: 63 97 sbiw r28, 0x13 ; 19 21c7e: 0f b6 in r0, 0x3f ; 63 21c80: f8 94 cli 21c82: de bf out 0x3e, r29 ; 62 21c84: 0f be out 0x3f, r0 ; 63 21c86: 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) 21c88: 80 91 64 03 lds r24, 0x0364 ; 0x800364 21c8c: 81 11 cpse r24, r1 21c8e: 3a c0 rjmp .+116 ; 0x21d04 { // Menu was entered. // Initialize its status. _md->status = 1; 21c90: 81 e0 ldi r24, 0x01 ; 1 21c92: 80 93 64 03 sts 0x0364, r24 ; 0x800364 check_babystep(); 21c96: 0e 94 a8 72 call 0xe550 ; 0xe550 if(!eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))){ 21c9a: 81 ea ldi r24, 0xA1 ; 161 21c9c: 9d e0 ldi r25, 0x0D ; 13 21c9e: 0f 94 9b a0 call 0x34136 ; 0x34136 21ca2: 18 2f mov r17, r24 21ca4: 0e 94 0e 6f call 0xde1c ; 0xde1c 21ca8: 81 11 cpse r24, r1 21caa: ee c0 rjmp .+476 ; 0x21e88 _md->babystepMemZ = 0; 21cac: 10 92 66 03 sts 0x0366, r1 ; 0x800366 21cb0: 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)) 21cb4: 80 e1 ldi r24, 0x10 ; 16 21cb6: 0e 94 52 d8 call 0x1b0a4 ; 0x1b0a4 21cba: 81 11 cpse r24, r1 21cbc: 04 c0 rjmp .+8 ; 0x21cc6 _md->babystepMemZ = 0; 21cbe: 10 92 66 03 sts 0x0366, r1 ; 0x800366 21cc2: 10 92 65 03 sts 0x0365, r1 ; 0x800365 _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_mm[Z_AXIS]; 21cc6: 60 91 65 03 lds r22, 0x0365 ; 0x800365 21cca: 70 91 66 03 lds r23, 0x0366 ; 0x800366 21cce: 07 2e mov r0, r23 21cd0: 00 0c add r0, r0 21cd2: 88 0b sbc r24, r24 21cd4: 99 0b sbc r25, r25 21cd6: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 21cda: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 21cde: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 21ce2: 40 91 40 04 lds r20, 0x0440 ; 0x800440 21ce6: 50 91 41 04 lds r21, 0x0441 ; 0x800441 21cea: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 21cee: 60 93 67 03 sts 0x0367, r22 ; 0x800367 21cf2: 70 93 68 03 sts 0x0368, r23 ; 0x800368 21cf6: 80 93 69 03 sts 0x0369, r24 ; 0x800369 21cfa: 90 93 6a 03 sts 0x036A, r25 ; 0x80036a lcd_draw_update = 1; 21cfe: 81 e0 ldi r24, 0x01 ; 1 21d00: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b //SERIAL_ECHO("Z baby step: "); //SERIAL_ECHO(_md->babystepMem[2]); } if (lcd_encoder != 0) 21d04: 80 91 06 05 lds r24, 0x0506 ; 0x800506 21d08: 90 91 07 05 lds r25, 0x0507 ; 0x800507 21d0c: 00 97 sbiw r24, 0x00 ; 0 21d0e: f1 f1 breq .+124 ; 0x21d8c { _md->babystepMemZ += lcd_encoder; 21d10: 20 91 65 03 lds r18, 0x0365 ; 0x800365 21d14: 30 91 66 03 lds r19, 0x0366 ; 0x800366 21d18: 28 0f add r18, r24 21d1a: 39 1f adc r19, r25 21d1c: 30 93 66 03 sts 0x0366, r19 ; 0x800366 21d20: 20 93 65 03 sts 0x0365, r18 ; 0x800365 if (_md->babystepMemZ < Z_BABYSTEP_MIN) _md->babystepMemZ = Z_BABYSTEP_MIN; //-3999 -> -9.99 mm 21d24: 21 36 cpi r18, 0x61 ; 97 21d26: 40 ef ldi r20, 0xF0 ; 240 21d28: 34 07 cpc r19, r20 21d2a: 0c f0 brlt .+2 ; 0x21d2e 21d2c: ba c0 rjmp .+372 ; 0x21ea2 21d2e: 81 e6 ldi r24, 0x61 ; 97 21d30: 90 ef ldi r25, 0xF0 ; 240 21d32: 90 93 66 03 sts 0x0366, r25 ; 0x800366 21d36: 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]; 21d3a: 60 91 65 03 lds r22, 0x0365 ; 0x800365 21d3e: 70 91 66 03 lds r23, 0x0366 ; 0x800366 21d42: 07 2e mov r0, r23 21d44: 00 0c add r0, r0 21d46: 88 0b sbc r24, r24 21d48: 99 0b sbc r25, r25 21d4a: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 21d4e: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 21d52: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 21d56: 40 91 40 04 lds r20, 0x0440 ; 0x800440 21d5a: 50 91 41 04 lds r21, 0x0441 ; 0x800441 21d5e: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 21d62: 60 93 67 03 sts 0x0367, r22 ; 0x800367 21d66: 70 93 68 03 sts 0x0368, r23 ; 0x800368 21d6a: 80 93 69 03 sts 0x0369, r24 ; 0x800369 21d6e: 90 93 6a 03 sts 0x036A, r25 ; 0x80036a _delay(50); 21d72: 62 e3 ldi r22, 0x32 ; 50 21d74: 70 e0 ldi r23, 0x00 ; 0 21d76: 80 e0 ldi r24, 0x00 ; 0 21d78: 90 e0 ldi r25, 0x00 ; 0 21d7a: 0f 94 03 0e call 0x21c06 ; 0x21c06 lcd_encoder = 0; 21d7e: 10 92 07 05 sts 0x0507, r1 ; 0x800507 21d82: 10 92 06 05 sts 0x0506, r1 ; 0x800506 lcd_draw_update = 1; 21d86: 81 e0 ldi r24, 0x01 ; 1 21d88: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } if (lcd_draw_update) 21d8c: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 21d90: 88 23 and r24, r24 21d92: c9 f1 breq .+114 ; 0x21e06 { SheetFormatBuffer buffer; menu_format_sheet_E(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))], buffer); 21d94: 81 ea ldi r24, 0xA1 ; 161 21d96: 9d e0 ldi r25, 0x0D ; 13 21d98: 0f 94 9b a0 call 0x34136 ; 0x34136 21d9c: 2b e0 ldi r18, 0x0B ; 11 21d9e: 82 9f mul r24, r18 21da0: c0 01 movw r24, r0 21da2: 11 24 eor r1, r1 21da4: be 01 movw r22, r28 21da6: 6f 5f subi r22, 0xFF ; 255 21da8: 7f 4f sbci r23, 0xFF ; 255 21daa: 87 5b subi r24, 0xB7 ; 183 21dac: 92 4f sbci r25, 0xF2 ; 242 21dae: 0f 94 15 92 call 0x3242a ; 0x3242a lcd_home(); 21db2: 0e 94 9d 69 call 0xd33a ; 0xd33a lcd_print(buffer.c); 21db6: ce 01 movw r24, r28 21db8: 01 96 adiw r24, 0x01 ; 1 21dba: 0e 94 78 6b call 0xd6f0 ; 0xd6f0 lcd_set_cursor(0, 1); 21dbe: 61 e0 ldi r22, 0x01 ; 1 21dc0: 80 e0 ldi r24, 0x00 ; 0 21dc2: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 menu_draw_float13(_T(MSG_BABYSTEPPING_Z), _md->babystepMemMMZ); 21dc6: 10 91 67 03 lds r17, 0x0367 ; 0x800367 21dca: 00 91 68 03 lds r16, 0x0368 ; 0x800368 21dce: f0 90 69 03 lds r15, 0x0369 ; 0x800369 21dd2: e0 90 6a 03 lds r14, 0x036A ; 0x80036a 21dd6: 85 ea ldi r24, 0xA5 ; 165 21dd8: 9b e4 ldi r25, 0x4B ; 75 21dda: 0e 94 a7 6c call 0xd94e ; 0xd94e //! (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); 21dde: ef 92 push r14 21de0: ff 92 push r15 21de2: 0f 93 push r16 21de4: 1f 93 push r17 21de6: 9f 93 push r25 21de8: 8f 93 push r24 21dea: 1f 92 push r1 21dec: 80 e2 ldi r24, 0x20 ; 32 21dee: 8f 93 push r24 21df0: 84 e6 ldi r24, 0x64 ; 100 21df2: 97 e9 ldi r25, 0x97 ; 151 21df4: 9f 93 push r25 21df6: 8f 93 push r24 21df8: 0e 94 4a 69 call 0xd294 ; 0xd294 21dfc: 0f b6 in r0, 0x3f ; 63 21dfe: f8 94 cli 21e00: de bf out 0x3e, r29 ; 62 21e02: 0f be out 0x3f, r0 ; 63 21e04: cd bf out 0x3d, r28 ; 61 } if (LCD_CLICKED || menu_leaving) 21e06: 80 91 63 03 lds r24, 0x0363 ; 0x800363 21e0a: 81 11 cpse r24, r1 21e0c: 04 c0 rjmp .+8 ; 0x21e16 21e0e: 80 91 92 03 lds r24, 0x0392 ; 0x800392 21e12: 88 23 and r24, r24 21e14: 51 f1 breq .+84 ; 0x21e6a { // Only update the EEPROM when leaving the menu. uint8_t active_sheet=eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 21e16: 81 ea ldi r24, 0xA1 ; 161 21e18: 9d e0 ldi r25, 0x0D ; 13 21e1a: 0f 94 9b a0 call 0x34136 ; 0x34136 21e1e: 9b e0 ldi r25, 0x0B ; 11 21e20: 89 9f mul r24, r25 21e22: 80 01 movw r16, r0 21e24: 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); 21e26: 60 91 65 03 lds r22, 0x0365 ; 0x800365 21e2a: 70 91 66 03 lds r23, 0x0366 ; 0x800366 21e2e: c8 01 movw r24, r16 21e30: 80 5b subi r24, 0xB0 ; 176 21e32: 92 4f sbci r25, 0xF2 ; 242 21e34: 0f 94 dd a0 call 0x341ba ; 0x341ba if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 21e38: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 21e3c: c8 01 movw r24, r16 21e3e: 8e 5a subi r24, 0xAE ; 174 21e40: 92 4f sbci r25, 0xF2 ; 242 21e42: 0f 94 bf a0 call 0x3417e ; 0x3417e 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); 21e46: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 21e4a: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 21e4e: 80 91 90 06 lds r24, 0x0690 ; 0x800690 21e52: 90 91 91 06 lds r25, 0x0691 ; 0x800691 21e56: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 21e5a: c8 01 movw r24, r16 21e5c: 8d 5a subi r24, 0xAD ; 173 21e5e: 92 4f sbci r25, 0xF2 ; 242 21e60: 0f 94 bf a0 call 0x3417e ; 0x3417e #endif //PINDA_THERMISTOR calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 21e64: 80 e1 ldi r24, 0x10 ; 16 21e66: 0e 94 83 c6 call 0x18d06 ; 0x18d06 } menu_back_if_clicked(); 21e6a: 0f 94 e5 96 call 0x32dca ; 0x32dca } 21e6e: 63 96 adiw r28, 0x13 ; 19 21e70: 0f b6 in r0, 0x3f ; 63 21e72: f8 94 cli 21e74: de bf out 0x3e, r29 ; 62 21e76: 0f be out 0x3f, r0 ; 63 21e78: cd bf out 0x3d, r28 ; 61 21e7a: df 91 pop r29 21e7c: cf 91 pop r28 21e7e: 1f 91 pop r17 21e80: 0f 91 pop r16 21e82: ff 90 pop r15 21e84: ef 90 pop r14 21e86: 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-> 21e88: 2b e0 ldi r18, 0x0B ; 11 21e8a: 12 9f mul r17, r18 21e8c: c0 01 movw r24, r0 21e8e: 11 24 eor r1, r1 21e90: 80 5b subi r24, 0xB0 ; 176 21e92: 92 4f sbci r25, 0xF2 ; 242 21e94: 0f 94 a9 a0 call 0x34152 ; 0x34152 21e98: 90 93 66 03 sts 0x0366, r25 ; 0x800366 21e9c: 80 93 65 03 sts 0x0365, r24 ; 0x800365 21ea0: 09 cf rjmp .-494 ; 0x21cb4 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 21ea2: 12 16 cp r1, r18 21ea4: 13 06 cpc r1, r19 21ea6: 2c f4 brge .+10 ; 0x21eb2 21ea8: 10 92 66 03 sts 0x0366, r1 ; 0x800366 21eac: 10 92 65 03 sts 0x0365, r1 ; 0x800365 21eb0: 44 cf rjmp .-376 ; 0x21d3a extern volatile int babystepsTodo[3]; inline void babystepsTodoZadd(int n) { if (n != 0) { CRITICAL_SECTION_START 21eb2: 2f b7 in r18, 0x3f ; 63 21eb4: f8 94 cli babystepsTodo[Z_AXIS] += n; 21eb6: 40 91 8c 06 lds r20, 0x068C ; 0x80068c 21eba: 50 91 8d 06 lds r21, 0x068D ; 0x80068d 21ebe: 84 0f add r24, r20 21ec0: 95 1f adc r25, r21 21ec2: 90 93 8d 06 sts 0x068D, r25 ; 0x80068d 21ec6: 80 93 8c 06 sts 0x068C, r24 ; 0x80068c CRITICAL_SECTION_END 21eca: 2f bf out 0x3f, r18 ; 63 21ecc: 36 cf rjmp .-404 ; 0x21d3a 00021ece : } void lcd_move_e() { if ((int)degHotend0() > extrude_min_temp) 21ece: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 21ed2: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 21ed6: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 21eda: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 21ede: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 21ee2: 20 91 57 02 lds r18, 0x0257 ; 0x800257 21ee6: 30 91 58 02 lds r19, 0x0258 ; 0x800258 21eea: 26 17 cp r18, r22 21eec: 37 07 cpc r19, r23 21eee: 0c f0 brlt .+2 ; 0x21ef2 21ef0: 65 c0 rjmp .+202 ; 0x21fbc { if (lcd_encoder != 0) 21ef2: 80 91 06 05 lds r24, 0x0506 ; 0x800506 21ef6: 90 91 07 05 lds r25, 0x0507 ; 0x800507 21efa: 89 2b or r24, r25 21efc: b9 f1 breq .+110 ; 0x21f6c { refresh_cmd_timeout(); 21efe: 0e 94 bf 5f call 0xbf7e ; 0xbf7e 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; 21f02: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 if (++ next_block_index == BLOCK_BUFFER_SIZE) 21f06: 8f 5f subi r24, 0xFF ; 255 21f08: 80 31 cpi r24, 0x10 ; 16 21f0a: 09 f4 brne .+2 ; 0x21f0e next_block_index = 0; 21f0c: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 21f0e: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 if (! planner_queue_full()) 21f12: 98 17 cp r25, r24 21f14: 59 f1 breq .+86 ; 0x21f6c { current_position[E_AXIS] += lcd_encoder; 21f16: 60 91 06 05 lds r22, 0x0506 ; 0x800506 21f1a: 70 91 07 05 lds r23, 0x0507 ; 0x800507 21f1e: 07 2e mov r0, r23 21f20: 00 0c add r0, r0 21f22: 88 0b sbc r24, r24 21f24: 99 0b sbc r25, r25 21f26: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 21f2a: 9b 01 movw r18, r22 21f2c: ac 01 movw r20, r24 21f2e: 60 91 01 12 lds r22, 0x1201 ; 0x801201 21f32: 70 91 02 12 lds r23, 0x1202 ; 0x801202 21f36: 80 91 03 12 lds r24, 0x1203 ; 0x801203 21f3a: 90 91 04 12 lds r25, 0x1204 ; 0x801204 21f3e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 21f42: 60 93 01 12 sts 0x1201, r22 ; 0x801201 21f46: 70 93 02 12 sts 0x1202, r23 ; 0x801202 21f4a: 80 93 03 12 sts 0x1203, r24 ; 0x801203 21f4e: 90 93 04 12 sts 0x1204, r25 ; 0x801204 lcd_encoder = 0; 21f52: 10 92 07 05 sts 0x0507, r1 ; 0x800507 21f56: 10 92 06 05 sts 0x0506, r1 ; 0x800506 plan_buffer_line_curposXYZE(manual_feedrate[E_AXIS] / 60); 21f5a: 65 e5 ldi r22, 0x55 ; 85 21f5c: 75 e5 ldi r23, 0x55 ; 85 21f5e: 85 ed ldi r24, 0xD5 ; 213 21f60: 9f e3 ldi r25, 0x3F ; 63 21f62: 0f 94 2f 85 call 0x30a5e ; 0x30a5e lcd_draw_update = 1; 21f66: 81 e0 ldi r24, 0x01 ; 1 21f68: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } } if (lcd_draw_update) 21f6c: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 21f70: 88 23 and r24, r24 21f72: 11 f1 breq .+68 ; 0x21fb8 { lcd_set_cursor(0, 1); 21f74: 61 e0 ldi r22, 0x01 ; 1 21f76: 80 e0 ldi r24, 0x00 ; 0 21f78: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 //! 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); 21f7c: 80 91 04 12 lds r24, 0x1204 ; 0x801204 21f80: 8f 93 push r24 21f82: 80 91 03 12 lds r24, 0x1203 ; 0x801203 21f86: 8f 93 push r24 21f88: 80 91 02 12 lds r24, 0x1202 ; 0x801202 21f8c: 8f 93 push r24 21f8e: 80 91 01 12 lds r24, 0x1201 ; 0x801201 21f92: 8f 93 push r24 21f94: 86 e4 ldi r24, 0x46 ; 70 21f96: 97 e9 ldi r25, 0x97 ; 151 21f98: 9f 93 push r25 21f9a: 8f 93 push r24 21f9c: 87 e3 ldi r24, 0x37 ; 55 21f9e: 97 e9 ldi r25, 0x97 ; 151 21fa0: 9f 93 push r25 21fa2: 8f 93 push r24 21fa4: 0e 94 4a 69 call 0xd294 ; 0xd294 21fa8: 8d b7 in r24, 0x3d ; 61 21faa: 9e b7 in r25, 0x3e ; 62 21fac: 08 96 adiw r24, 0x08 ; 8 21fae: 0f b6 in r0, 0x3f ; 63 21fb0: f8 94 cli 21fb2: 9e bf out 0x3e, r25 ; 62 21fb4: 0f be out 0x3f, r0 ; 63 21fb6: 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(); 21fb8: 0d 94 e5 96 jmp 0x32dca ; 0x32dca }; } void show_preheat_nozzle_warning() { lcd_clear(); 21fbc: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_puts_at_P(0, 0, _T(MSG_ERROR)); 21fc0: 86 e3 ldi r24, 0x36 ; 54 21fc2: 9b e4 ldi r25, 0x4B ; 75 21fc4: 0e 94 a7 6c call 0xd94e ; 0xd94e 21fc8: ac 01 movw r20, r24 21fca: 60 e0 ldi r22, 0x00 ; 0 21fcc: 80 e0 ldi r24, 0x00 ; 0 21fce: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_puts_at_P(0, 2, _T(MSG_PREHEAT_NOZZLE)); 21fd2: 80 e2 ldi r24, 0x20 ; 32 21fd4: 9b e4 ldi r25, 0x4B ; 75 21fd6: 0e 94 a7 6c call 0xd94e ; 0xd94e 21fda: ac 01 movw r20, r24 21fdc: 62 e0 ldi r22, 0x02 ; 2 21fde: 80 e0 ldi r24, 0x00 ; 0 21fe0: 0e 94 85 69 call 0xd30a ; 0xd30a _delay(2000); 21fe4: 60 ed ldi r22, 0xD0 ; 208 21fe6: 77 e0 ldi r23, 0x07 ; 7 21fe8: 80 e0 ldi r24, 0x00 ; 0 21fea: 90 e0 ldi r25, 0x00 ; 0 21fec: 0f 94 03 0e call 0x21c06 ; 0x21c06 lcd_clear(); 21ff0: 0e 94 a4 69 call 0xd348 ; 0xd348 menu_back_if_clicked(); } else { show_preheat_nozzle_warning(); lcd_return_to_status(); 21ff4: 0c 94 6d fe jmp 0x1fcda ; 0x1fcda 00021ff8 : } unsigned long millis2(void) { unsigned long m; uint8_t oldSREG = SREG; 21ff8: 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(); 21ffa: f8 94 cli m = timer2_millis; 21ffc: 60 91 65 06 lds r22, 0x0665 ; 0x800665 22000: 70 91 66 06 lds r23, 0x0666 ; 0x800666 22004: 80 91 67 06 lds r24, 0x0667 ; 0x800667 22008: 90 91 68 06 lds r25, 0x0668 ; 0x800668 SREG = oldSREG; 2200c: 2f bf out 0x3f, r18 ; 63 return m; } 2200e: 08 95 ret 00022010 : //! //! @param z_move //! @param e_move void stop_and_save_print_to_ram(float z_move, float e_move) { if (saved_printing) return; 22010: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 22014: 81 11 cpse r24, r1 22016: 06 c0 rjmp .+12 ; 0x22024 22018: 60 e0 ldi r22, 0x00 ; 0 2201a: 70 e0 ldi r23, 0x00 ; 0 2201c: 80 e8 ldi r24, 0x80 ; 128 2201e: 9f eb ldi r25, 0xBF ; 191 22020: 0f 94 a9 42 call 0x28552 ; 0x28552 //! @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); 22024: 86 e3 ldi r24, 0x36 ; 54 22026: 9a e6 ldi r25, 0x6A ; 106 22028: 0e 94 49 72 call 0xe492 ; 0xe492 // Indicate that the printer is paused did_pause_print = true; 2202c: 81 e0 ldi r24, 0x01 ; 1 2202e: 80 93 9b 03 sts 0x039B, r24 ; 0x80039b } else return false; } bool Stopwatch::pause() { if (isRunning()) { 22032: 80 91 59 03 lds r24, 0x0359 ; 0x800359 22036: 81 30 cpi r24, 0x01 ; 1 22038: 69 f4 brne .+26 ; 0x22054 state = PAUSED; 2203a: 82 e0 ldi r24, 0x02 ; 2 2203c: 80 93 59 03 sts 0x0359, r24 ; 0x800359 stopTimestamp = _millis(); 22040: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 22044: 60 93 78 06 sts 0x0678, r22 ; 0x800678 22048: 70 93 79 06 sts 0x0679, r23 ; 0x800679 2204c: 80 93 7a 06 sts 0x067A, r24 ; 0x80067a 22050: 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; 22054: 82 e0 ldi r24, 0x02 ; 2 22056: 80 93 c8 0d sts 0x0DC8, r24 ; 0x800dc8 lcd_return_to_status(); 2205a: 0c 94 6d fe jmp 0x1fcda ; 0x1fcda 0002205e ::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) 2205e: ff 92 push r15 22060: 0f 93 push r16 22062: 1f 93 push r17 22064: cf 93 push r28 22066: df 93 push r29 { if (!m_isRunning) return false; 22068: fc 01 movw r30, r24 2206a: f0 80 ld r15, Z 2206c: f1 10 cpse r15, r1 2206e: 08 c0 rjmp .+16 ; 0x22080 ::expired(unsigned short)+0x22> 22070: f1 2c mov r15, r1 expired = true; } } if (expired) m_isRunning = false; return expired; } 22072: 8f 2d mov r24, r15 22074: df 91 pop r29 22076: cf 91 pop r28 22078: 1f 91 pop r17 2207a: 0f 91 pop r16 2207c: ff 90 pop r15 2207e: 08 95 ret 22080: 8b 01 movw r16, r22 22082: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 22084: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 if (m_started <= m_started + msPeriod) 22088: 89 81 ldd r24, Y+1 ; 0x01 2208a: 9a 81 ldd r25, Y+2 ; 0x02 2208c: 08 0f add r16, r24 2208e: 19 1f adc r17, r25 22090: 08 17 cp r16, r24 22092: 19 07 cpc r17, r25 22094: 40 f0 brcs .+16 ; 0x220a6 ::expired(unsigned short)+0x48> { if ((now >= m_started + msPeriod) || (now < m_started)) 22096: 60 17 cp r22, r16 22098: 71 07 cpc r23, r17 2209a: 18 f4 brcc .+6 ; 0x220a2 ::expired(unsigned short)+0x44> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 2209c: 68 17 cp r22, r24 2209e: 79 07 cpc r23, r25 220a0: 38 f7 brcc .-50 ; 0x22070 ::expired(unsigned short)+0x12> { expired = true; } } if (expired) m_isRunning = false; 220a2: 18 82 st Y, r1 220a4: e6 cf rjmp .-52 ; 0x22072 ::expired(unsigned short)+0x14> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 220a6: 60 17 cp r22, r16 220a8: 71 07 cpc r23, r17 220aa: c0 f7 brcc .-16 ; 0x2209c ::expired(unsigned short)+0x3e> 220ac: e1 cf rjmp .-62 ; 0x22070 ::expired(unsigned short)+0x12> 000220ae ::expired_cont(unsigned short)>: } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 220ae: fc 01 movw r30, r24 220b0: 20 81 ld r18, Z 220b2: 21 11 cpse r18, r1 220b4: 0d 94 2f 10 jmp 0x2205e ; 0x2205e ::expired(unsigned short)> } 220b8: 81 e0 ldi r24, 0x01 ; 1 220ba: 08 95 ret 000220bc ::start()>: /** * @brief Start timer */ template void Timer::start() 220bc: cf 93 push r28 220be: df 93 push r29 220c0: ec 01 movw r28, r24 { m_started = _millis(); 220c2: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 220c6: 7a 83 std Y+2, r23 ; 0x02 220c8: 69 83 std Y+1, r22 ; 0x01 m_isRunning = true; 220ca: 81 e0 ldi r24, 0x01 ; 1 220cc: 88 83 st Y, r24 } 220ce: df 91 pop r29 220d0: cf 91 pop r28 220d2: 08 95 ret 000220d4 ::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) 220d4: 8f 92 push r8 220d6: 9f 92 push r9 220d8: af 92 push r10 220da: bf 92 push r11 220dc: cf 92 push r12 220de: df 92 push r13 220e0: ef 92 push r14 220e2: ff 92 push r15 220e4: 1f 93 push r17 220e6: cf 93 push r28 220e8: df 93 push r29 { if (!m_isRunning) return false; 220ea: fc 01 movw r30, r24 220ec: 10 81 ld r17, Z 220ee: 11 11 cpse r17, r1 220f0: 0e c0 rjmp .+28 ; 0x2210e ::expired(unsigned long)+0x3a> 220f2: 10 e0 ldi r17, 0x00 ; 0 expired = true; } } if (expired) m_isRunning = false; return expired; } 220f4: 81 2f mov r24, r17 220f6: df 91 pop r29 220f8: cf 91 pop r28 220fa: 1f 91 pop r17 220fc: ff 90 pop r15 220fe: ef 90 pop r14 22100: df 90 pop r13 22102: cf 90 pop r12 22104: bf 90 pop r11 22106: af 90 pop r10 22108: 9f 90 pop r9 2210a: 8f 90 pop r8 2210c: 08 95 ret 2210e: 6a 01 movw r12, r20 22110: 7b 01 movw r14, r22 22112: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 22114: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 22118: 4b 01 movw r8, r22 2211a: 5c 01 movw r10, r24 if (m_started <= m_started + msPeriod) 2211c: 89 81 ldd r24, Y+1 ; 0x01 2211e: 9a 81 ldd r25, Y+2 ; 0x02 22120: ab 81 ldd r26, Y+3 ; 0x03 22122: bc 81 ldd r27, Y+4 ; 0x04 22124: c8 0e add r12, r24 22126: d9 1e adc r13, r25 22128: ea 1e adc r14, r26 2212a: fb 1e adc r15, r27 2212c: c8 16 cp r12, r24 2212e: d9 06 cpc r13, r25 22130: ea 06 cpc r14, r26 22132: fb 06 cpc r15, r27 22134: 60 f0 brcs .+24 ; 0x2214e ::expired(unsigned long)+0x7a> { if ((now >= m_started + msPeriod) || (now < m_started)) 22136: 8c 14 cp r8, r12 22138: 9d 04 cpc r9, r13 2213a: ae 04 cpc r10, r14 2213c: bf 04 cpc r11, r15 2213e: 28 f4 brcc .+10 ; 0x2214a ::expired(unsigned long)+0x76> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 22140: 88 16 cp r8, r24 22142: 99 06 cpc r9, r25 22144: aa 06 cpc r10, r26 22146: bb 06 cpc r11, r27 22148: a0 f6 brcc .-88 ; 0x220f2 ::expired(unsigned long)+0x1e> { expired = true; } } if (expired) m_isRunning = false; 2214a: 18 82 st Y, r1 2214c: d3 cf rjmp .-90 ; 0x220f4 ::expired(unsigned long)+0x20> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 2214e: 8c 14 cp r8, r12 22150: 9d 04 cpc r9, r13 22152: ae 04 cpc r10, r14 22154: bf 04 cpc r11, r15 22156: a0 f7 brcc .-24 ; 0x22140 ::expired(unsigned long)+0x6c> 22158: cc cf rjmp .-104 ; 0x220f2 ::expired(unsigned long)+0x1e> 0002215a : } lcd_space(8 - chars); } //! @Brief Print status line on status screen void lcdui_print_status_line(void) { 2215a: 0f 93 push r16 2215c: 1f 93 push r17 2215e: cf 93 push r28 static uint8_t heating_status_counter; if (heating_status != HeatingStatus::NO_HEATING) { // If heating flag, show progress of heating 22160: 80 91 99 03 lds r24, 0x0399 ; 0x800399 22164: 88 23 and r24, r24 22166: 09 f4 brne .+2 ; 0x2216a 22168: 4d c0 rjmp .+154 ; 0x22204 heating_status_counter++; 2216a: 80 91 71 06 lds r24, 0x0671 ; 0x800671 2216e: 8f 5f subi r24, 0xFF ; 255 if (heating_status_counter > 13) { 22170: 8e 30 cpi r24, 0x0E ; 14 22172: b0 f4 brcc .+44 ; 0x221a0 //! @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++; 22174: 80 93 71 06 sts 0x0671, r24 ; 0x800671 if (heating_status_counter > 13) { heating_status_counter = 0; } lcd_set_cursor(7, 3); 22178: 63 e0 ldi r22, 0x03 ; 3 2217a: 87 e0 ldi r24, 0x07 ; 7 2217c: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_space(13); 22180: 8d e0 ldi r24, 0x0D ; 13 22182: 0e 94 67 69 call 0xd2ce ; 0xd2ce for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 22186: c0 e0 ldi r28, 0x00 ; 0 22188: 80 91 71 06 lds r24, 0x0671 ; 0x800671 2218c: c8 17 cp r28, r24 2218e: 58 f4 brcc .+22 ; 0x221a6 lcd_putc_at(7 + dots, 3, '.'); 22190: 4e e2 ldi r20, 0x2E ; 46 22192: 63 e0 ldi r22, 0x03 ; 3 22194: 87 e0 ldi r24, 0x07 ; 7 22196: 8c 0f add r24, r28 22198: 0e 94 91 69 call 0xd322 ; 0xd322 heating_status_counter = 0; } lcd_set_cursor(7, 3); lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 2219c: cf 5f subi r28, 0xFF ; 255 2219e: f4 cf rjmp .-24 ; 0x22188 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; 221a0: 10 92 71 06 sts 0x0671, r1 ; 0x800671 221a4: e9 cf rjmp .-46 ; 0x22178 lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { lcd_putc_at(7 + dots, 3, '.'); } switch (heating_status) { 221a6: 80 91 99 03 lds r24, 0x0399 ; 0x800399 221aa: 82 30 cpi r24, 0x02 ; 2 221ac: d1 f0 breq .+52 ; 0x221e2 221ae: 30 f4 brcc .+12 ; 0x221bc 221b0: 81 30 cpi r24, 0x01 ; 1 221b2: 59 f0 breq .+22 ; 0x221ca case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 221b4: cf 91 pop r28 221b6: 1f 91 pop r17 221b8: 0f 91 pop r16 221ba: 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) { 221bc: 83 30 cpi r24, 0x03 ; 3 221be: f9 f0 breq .+62 ; 0x221fe 221c0: 84 30 cpi r24, 0x04 ; 4 221c2: c1 f7 brne .-16 ; 0x221b4 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)); 221c4: 80 e9 ldi r24, 0x90 ; 144 221c6: 98 e4 ldi r25, 0x48 ; 72 221c8: 0e c0 rjmp .+28 ; 0x221e6 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)); 221ca: 89 eb ldi r24, 0xB9 ; 185 221cc: 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)); 221ce: 0e 94 a7 6c call 0xd94e ; 0xd94e 221d2: ac 01 movw r20, r24 221d4: 63 e0 ldi r22, 0x03 ; 3 221d6: 80 e0 ldi r24, 0x00 ; 0 break; } } } 221d8: cf 91 pop r28 221da: 1f 91 pop r17 221dc: 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)); 221de: 0c 94 85 69 jmp 0xd30a ; 0xd30a 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)); 221e2: 89 ea ldi r24, 0xA9 ; 169 221e4: 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)); 221e6: 0e 94 a7 6c call 0xd94e ; 0xd94e 221ea: ac 01 movw r20, r24 221ec: 63 e0 ldi r22, 0x03 ; 3 221ee: 80 e0 ldi r24, 0x00 ; 0 221f0: 0e 94 85 69 call 0xd30a ; 0xd30a heating_status = HeatingStatus::NO_HEATING; 221f4: 10 92 99 03 sts 0x0399, r1 ; 0x800399 heating_status_counter = 0; 221f8: 10 92 71 06 sts 0x0671, r1 ; 0x800671 221fc: db cf rjmp .-74 ; 0x221b4 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)); 221fe: 8b e9 ldi r24, 0x9B ; 155 22200: 98 e4 ldi r25, 0x48 ; 72 22202: e5 cf rjmp .-54 ; 0x221ce #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) && 22204: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 22208: 88 23 and r24, r24 2220a: 61 f1 breq .+88 ; 0x22264 } else if (((IS_SD_PRINTING) #ifdef SHOW_FILENAME_AFTER_FINISH || (GetPrinterState() == PrinterState::SDPrintingFinished) #endif //SHOW_FILENAME_AFTER_FINISH ) && 2220c: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 22210: 81 11 cpse r24, r1 22212: 28 c0 rjmp .+80 ; 0x22264 (custom_message_type == CustomMsg::Status) && 22214: 80 91 8e 03 lds r24, 0x038E ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.408> 22218: 82 30 cpi r24, 0x02 ; 2 2221a: 20 f5 brcc .+72 ; 0x22264 } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 2221c: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL26lcd_status_message_timeout.lto_priv.420> 22220: 81 11 cpse r24, r1 22222: 16 c0 rjmp .+44 ; 0x22250 (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); 22224: 80 91 81 13 lds r24, 0x1381 ; 0x801381 22228: 88 23 and r24, r24 2222a: 09 f4 brne .+2 ; 0x2222e 2222c: 35 c0 rjmp .+106 ; 0x22298 2222e: 81 e8 ldi r24, 0x81 ; 129 22230: 93 e1 ldi r25, 0x13 ; 19 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) 22232: 20 91 cc 0d lds r18, 0x0DCC ; 0x800dcc 22236: 64 e1 ldi r22, 0x14 ; 20 22238: 82 0f add r24, r18 2223a: 91 1d adc r25, r1 2223c: 0e 94 60 6b call 0xd6c0 ; 0xd6c0 22240: 81 11 cpse r24, r1 22242: 2d c0 rjmp .+90 ; 0x2229e { scrollstuff++; 22244: 80 91 cc 0d lds r24, 0x0DCC ; 0x800dcc 22248: 8f 5f subi r24, 0xFF ; 255 2224a: 80 93 cc 0d sts 0x0DCC, r24 ; 0x800dcc 2224e: b2 cf rjmp .-156 ; 0x221b4 22250: 40 e2 ldi r20, 0x20 ; 32 22252: 5e e4 ldi r21, 0x4E ; 78 22254: 60 e0 ldi r22, 0x00 ; 0 22256: 70 e0 ldi r23, 0x00 ; 0 22258: 8e e1 ldi r24, 0x1E ; 30 2225a: 95 e0 ldi r25, 0x05 ; 5 2225c: 0f 94 6a 10 call 0x220d4 ; 0x220d4 ::expired(unsigned long)> 22260: 81 11 cpse r24, r1 22262: e0 cf rjmp .-64 ; 0x22224 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) 22264: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 22268: 81 11 cpse r24, r1 2226a: 1c c0 rjmp .+56 ; 0x222a4 { return; // Nothing to do, waiting for delay to expire } switch (custom_message_type) { 2226c: e0 91 c7 06 lds r30, 0x06C7 ; 0x8006c7 22270: ea 30 cpi r30, 0x0A ; 10 22272: 08 f0 brcs .+2 ; 0x22276 22274: 9f cf rjmp .-194 ; 0x221b4 22276: f0 e0 ldi r31, 0x00 ; 0 22278: 88 27 eor r24, r24 2227a: ee 5b subi r30, 0xBE ; 190 2227c: fe 4e sbci r31, 0xEE ; 238 2227e: 8e 4f sbci r24, 0xFE ; 254 22280: 0d 94 ab a1 jmp 0x34356 ; 0x34356 <__tablejump2__> 22284: 53 37 cpi r21, 0x73 ; 115 22286: f1 36 cpi r31, 0x61 ; 97 22288: 53 37 cpi r21, 0x73 ; 115 2228a: 0f 38 cpi r16, 0x8F ; 143 2228c: c7 36 cpi r28, 0x67 ; 103 2228e: a5 37 cpi r26, 0x75 ; 117 22290: 53 37 cpi r21, 0x73 ; 115 22292: 53 37 cpi r21, 0x73 ; 115 22294: 1b 37 cpi r17, 0x7B ; 123 22296: 53 37 cpi r21, 0x73 ; 115 (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); 22298: 8c e6 ldi r24, 0x6C ; 108 2229a: 93 e1 ldi r25, 0x13 ; 19 2229c: ca cf rjmp .-108 ; 0x22232 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) { scrollstuff++; } else { scrollstuff = 0; 2229e: 10 92 cc 0d sts 0x0DCC, r1 ; 0x800dcc 222a2: 88 cf rjmp .-240 ; 0x221b4 } } else { // Otherwise check for other special events if ( custom_message_type != CustomMsg::Status && lcd_status_message_timeout.running() 222a4: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL26lcd_status_message_timeout.lto_priv.420> 222a8: 88 23 and r24, r24 222aa: 01 f3 breq .-64 ; 0x2226c * 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; 222ac: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 222b0: 00 91 1f 05 lds r16, 0x051F ; 0x80051f <_ZL26lcd_status_message_timeout.lto_priv.420+0x1> 222b4: 10 91 20 05 lds r17, 0x0520 ; 0x800520 <_ZL26lcd_status_message_timeout.lto_priv.420+0x2> 222b8: 20 91 21 05 lds r18, 0x0521 ; 0x800521 <_ZL26lcd_status_message_timeout.lto_priv.420+0x3> 222bc: 30 91 22 05 lds r19, 0x0522 ; 0x800522 <_ZL26lcd_status_message_timeout.lto_priv.420+0x4> 222c0: 60 1b sub r22, r16 222c2: 71 0b sbc r23, r17 222c4: 82 0b sbc r24, r18 222c6: 93 0b sbc r25, r19 && lcd_status_message_timeout.elapsed() < LCD_STATUS_DELAYED_TIMEOUT) 222c8: 60 3a cpi r22, 0xA0 ; 160 222ca: 7f 40 sbci r23, 0x0F ; 15 222cc: 81 05 cpc r24, r1 222ce: 91 05 cpc r25, r1 222d0: 68 f6 brcc .-102 ; 0x2226c 222d2: 70 cf rjmp .-288 ; 0x221b4 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); 222d4: 63 e0 ldi r22, 0x03 ; 3 222d6: 80 91 08 05 lds r24, 0x0508 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.417> 222da: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 const uint8_t padding = lcd_print_pad(&lcd_status_message[lcd_status_message_idx], LCD_WIDTH - lcd_status_message_idx); 222de: 80 91 08 05 lds r24, 0x0508 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.417> 222e2: c4 e1 ldi r28, 0x14 ; 20 222e4: 6c 2f mov r22, r28 222e6: 68 1b sub r22, r24 222e8: 90 e0 ldi r25, 0x00 ; 0 222ea: 87 5f subi r24, 0xF7 ; 247 222ec: 9a 4f sbci r25, 0xFA ; 250 222ee: 0e 94 60 6b call 0xd6c0 ; 0xd6c0 lcd_status_message_idx = LCD_WIDTH - padding; 222f2: c8 1b sub r28, r24 222f4: c0 93 08 05 sts 0x0508, r28 ; 0x800508 <_ZL22lcd_status_message_idx.lto_priv.417> 222f8: 5d cf rjmp .-326 ; 0x221b4 } break; case CustomMsg::MeshBedLeveling: // If mesh bed leveling in progress, show the status if (custom_message_state > 10) { 222fa: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 222fe: 8b 30 cpi r24, 0x0B ; 11 22300: 08 f1 brcs .+66 ; 0x22344 lcd_set_cursor(0, 3); 22302: 63 e0 ldi r22, 0x03 ; 3 22304: 80 e0 ldi r24, 0x00 ; 0 22306: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_space(LCD_WIDTH); 2230a: 84 e1 ldi r24, 0x14 ; 20 2230c: 0e 94 67 69 call 0xd2ce ; 0xd2ce lcd_puts_at_P(0, 3, _T(MSG_CALIBRATE_Z_AUTO)); 22310: 80 e8 ldi r24, 0x80 ; 128 22312: 98 e4 ldi r25, 0x48 ; 72 22314: 0e 94 a7 6c call 0xd94e ; 0xd94e 22318: ac 01 movw r20, r24 2231a: 63 e0 ldi r22, 0x03 ; 3 2231c: 80 e0 ldi r24, 0x00 ; 0 2231e: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_puts_P(PSTR(" : ")); 22322: 81 ec ldi r24, 0xC1 ; 193 22324: 94 e9 ldi r25, 0x94 ; 148 22326: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 lcd_print(custom_message_state - 10); 2232a: 60 91 ac 03 lds r22, 0x03AC ; 0x8003ac 2232e: 6a 50 subi r22, 0x0A ; 10 22330: 77 0b sbc r23, r23 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 22332: 07 2e mov r0, r23 22334: 00 0c add r0, r0 22336: 88 0b sbc r24, r24 22338: 99 0b sbc r25, r25 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 2233a: cf 91 pop r28 2233c: 1f 91 pop r17 2233e: 0f 91 pop r16 22340: 0c 94 2a 6b jmp 0xd654 ; 0xd654 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) { 22344: 83 30 cpi r24, 0x03 ; 3 22346: 31 f4 brne .+12 ; 0x22354 lcd_setstatuspgm(MSG_WELCOME); 22348: 87 e6 ldi r24, 0x67 ; 103 2234a: 9b e6 ldi r25, 0x6B ; 107 2234c: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 custom_message_type = CustomMsg::Status; 22350: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 } if (custom_message_state > 3 && custom_message_state <= 10) { 22354: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 22358: 84 50 subi r24, 0x04 ; 4 2235a: 87 30 cpi r24, 0x07 ; 7 2235c: 08 f0 brcs .+2 ; 0x22360 2235e: 2a cf rjmp .-428 ; 0x221b4 lcd_set_cursor(0, 3); 22360: 63 e0 ldi r22, 0x03 ; 3 22362: 80 e0 ldi r24, 0x00 ; 0 22364: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_space(19); 22368: 83 e1 ldi r24, 0x13 ; 19 2236a: 0e 94 67 69 call 0xd2ce ; 0xd2ce lcd_puts_at_P(0, 3, _T(MSG_HOMEYZ_DONE)); 2236e: 8d e6 ldi r24, 0x6D ; 109 22370: 98 e4 ldi r25, 0x48 ; 72 22372: 0e 94 a7 6c call 0xd94e ; 0xd94e 22376: ac 01 movw r20, r24 22378: 63 e0 ldi r22, 0x03 ; 3 2237a: 80 e0 ldi r24, 0x00 ; 0 2237c: 0e 94 85 69 call 0xd30a ; 0xd30a custom_message_state--; 22380: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 22384: 81 50 subi r24, 0x01 ; 1 22386: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac 2238a: 14 cf rjmp .-472 ; 0x221b4 } } break; case CustomMsg::PidCal: // PID tuning in progress lcd_print_pad(lcd_status_message, LCD_WIDTH); 2238c: 64 e1 ldi r22, 0x14 ; 20 2238e: 89 e0 ldi r24, 0x09 ; 9 22390: 95 e0 ldi r25, 0x05 ; 5 22392: 0e 94 60 6b call 0xd6c0 ; 0xd6c0 if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0) { 22396: 20 91 6f 06 lds r18, 0x066F ; 0x80066f 2239a: 30 91 70 06 lds r19, 0x0670 ; 0x800670 2239e: 80 91 6d 06 lds r24, 0x066D ; 0x80066d 223a2: 90 91 6e 06 lds r25, 0x066E ; 0x80066e 223a6: 82 17 cp r24, r18 223a8: 93 07 cpc r25, r19 223aa: 0c f4 brge .+2 ; 0x223ae 223ac: 03 cf rjmp .-506 ; 0x221b4 223ae: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 223b2: 88 23 and r24, r24 223b4: 09 f4 brne .+2 ; 0x223b8 223b6: fe ce rjmp .-516 ; 0x221b4 lcd_set_cursor(10, 3); 223b8: 63 e0 ldi r22, 0x03 ; 3 223ba: 8a e0 ldi r24, 0x0A ; 10 223bc: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_printf_P(PSTR("%3d/%-3d"), pid_cycle, pid_number_of_cycles); 223c0: 80 91 6e 06 lds r24, 0x066E ; 0x80066e 223c4: 8f 93 push r24 223c6: 80 91 6d 06 lds r24, 0x066D ; 0x80066d 223ca: 8f 93 push r24 223cc: 80 91 70 06 lds r24, 0x0670 ; 0x800670 223d0: 8f 93 push r24 223d2: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 223d6: 8f 93 push r24 223d8: 88 eb ldi r24, 0xB8 ; 184 223da: 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); 223dc: 9f 93 push r25 223de: 8f 93 push r24 223e0: 0e 94 4a 69 call 0xd294 ; 0xd294 223e4: 0f 90 pop r0 223e6: 0f 90 pop r0 223e8: 0f 90 pop r0 223ea: 0f 90 pop r0 223ec: 0f 90 pop r0 223ee: 0f 90 pop r0 223f0: e1 ce rjmp .-574 ; 0x221b4 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); 223f2: 63 e0 ldi r22, 0x03 ; 3 223f4: 80 e0 ldi r24, 0x00 ; 0 223f6: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_printf_P(PSTR("%-12.12S%-d/6"), _T(MSG_PINDA_CALIBRATION), custom_message_state); 223fa: c0 91 ac 03 lds r28, 0x03AC ; 0x8003ac 223fe: 85 ee ldi r24, 0xE5 ; 229 22400: 9a e3 ldi r25, 0x3A ; 58 22402: 0e 94 a7 6c call 0xd94e ; 0xd94e 22406: 1f 92 push r1 22408: cf 93 push r28 2240a: 9f 93 push r25 2240c: 8f 93 push r24 2240e: 8a ea ldi r24, 0xAA ; 170 22410: 94 e9 ldi r25, 0x94 ; 148 22412: e4 cf rjmp .-56 ; 0x223dc break; case CustomMsg::TempCompPreheat: // temp compensation preheat lcd_puts_at_P(0, 3, _T(MSG_PINDA_PREHEAT)); 22414: 8d e5 ldi r24, 0x5D ; 93 22416: 98 e4 ldi r25, 0x48 ; 72 22418: 0e 94 a7 6c call 0xd94e ; 0xd94e 2241c: ac 01 movw r20, r24 2241e: 63 e0 ldi r22, 0x03 ; 3 22420: 80 e0 ldi r24, 0x00 ; 0 22422: 0e 94 85 69 call 0xd30a ; 0xd30a if (custom_message_state <= PINDA_HEAT_T) { 22426: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 2242a: 89 37 cpi r24, 0x79 ; 121 2242c: 08 f0 brcs .+2 ; 0x22430 2242e: c2 ce rjmp .-636 ; 0x221b4 lcd_puts_P(PSTR(": ")); 22430: 87 ea ldi r24, 0xA7 ; 167 22432: 94 e9 ldi r25, 0x94 ; 148 22434: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 22438: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 2243c: 0e 94 20 6a call 0xd440 ; 0xd440 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 22440: 80 e2 ldi r24, 0x20 ; 32 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 22442: cf 91 pop r28 22444: 1f 91 pop r17 22446: 0f 91 pop r16 22448: 0c 94 20 6a jmp 0xd440 ; 0xd440 lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 2244c: 8c e4 ldi r24, 0x4C ; 76 2244e: 98 e4 ldi r25, 0x48 ; 72 22450: be ce rjmp .-644 ; 0x221ce 00022452 ::start()>: /** * @brief Start timer */ template void Timer::start() 22452: cf 93 push r28 22454: df 93 push r29 22456: ec 01 movw r28, r24 { m_started = _millis(); 22458: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 2245c: 69 83 std Y+1, r22 ; 0x01 2245e: 7a 83 std Y+2, r23 ; 0x02 22460: 8b 83 std Y+3, r24 ; 0x03 22462: 9c 83 std Y+4, r25 ; 0x04 m_isRunning = true; 22464: 81 e0 ldi r24, 0x01 ; 1 22466: 88 83 st Y, r24 } 22468: df 91 pop r29 2246a: cf 91 pop r28 2246c: 08 95 ret 0002246e : //! 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) { 2246e: cf 92 push r12 22470: df 92 push r13 22472: ef 92 push r14 22474: ff 92 push r15 22476: 1f 93 push r17 22478: cf 93 push r28 2247a: df 93 push r29 2247c: cd b7 in r28, 0x3d ; 61 2247e: de b7 in r29, 0x3e ; 62 22480: 64 97 sbiw r28, 0x14 ; 20 22482: 0f b6 in r0, 0x3f ; 63 22484: f8 94 cli 22486: de bf out 0x3e, r29 ; 62 22488: 0f be out 0x3f, r0 ; 63 2248a: cd bf out 0x3d, r28 ; 61 2248c: 7c 01 movw r14, r24 2248e: 16 2f mov r17, r22 char msg[LCD_WIDTH]; strcpy_P(msg, PSTR("Err: ")); 22490: 60 e7 ldi r22, 0x70 ; 112 22492: 74 e9 ldi r23, 0x94 ; 148 22494: ce 01 movw r24, r28 22496: 01 96 adiw r24, 0x01 ; 1 22498: 0f 94 52 9e call 0x33ca4 ; 0x33ca4 strcat_P(msg, type); 2249c: b7 01 movw r22, r14 2249e: ce 01 movw r24, r28 224a0: 01 96 adiw r24, 0x01 ; 1 224a2: 0f 94 3e 9e call 0x33c7c ; 0x33c7c lcd_status_message_timeout.start(); } void lcd_setalertstatus_(const char* message, uint8_t severity, bool progmem) { if (lcd_message_check(severity)) { 224a6: 83 e0 ldi r24, 0x03 ; 3 224a8: 0e 94 1f e2 call 0x1c43e ; 0x1c43e 224ac: 88 23 and r24, r24 224ae: e1 f0 breq .+56 ; 0x224e8 bool same = !(progmem? strcmp_P(lcd_status_message, message): strcmp(lcd_status_message, message)); 224b0: be 01 movw r22, r28 224b2: 6f 5f subi r22, 0xFF ; 255 224b4: 7f 4f sbci r23, 0xFF ; 255 224b6: 89 e0 ldi r24, 0x09 ; 9 224b8: 95 e0 ldi r25, 0x05 ; 5 224ba: 0f 94 fd a6 call 0x34dfa ; 0x34dfa 224be: 6c 01 movw r12, r24 lcd_status_message_timeout.start(); 224c0: 8e e1 ldi r24, 0x1E ; 30 224c2: 95 e0 ldi r25, 0x05 ; 5 224c4: 0f 94 29 12 call 0x22452 ; 0x22452 ::start()> lcd_status_message_level = severity; 224c8: 83 e0 ldi r24, 0x03 ; 3 224ca: 80 93 8e 03 sts 0x038E, r24 ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.408> custom_message_type = CustomMsg::Status; 224ce: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 custom_message_state = 0; 224d2: 10 92 ac 03 sts 0x03AC, r1 ; 0x8003ac if (!same) { 224d6: cd 28 or r12, r13 224d8: 39 f0 breq .+14 ; 0x224e8 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 224da: 60 e0 ldi r22, 0x00 ; 0 224dc: ce 01 movw r24, r28 224de: 01 96 adiw r24, 0x01 ; 1 224e0: 0e 94 04 e2 call 0x1c408 ; 0x1c408 lcd_return_to_status(); 224e4: 0e 94 6d fe call 0x1fcda ; 0x1fcda lcd_setalertstatus(msg, LCD_STATUS_CRITICAL); SERIAL_ERROR_START; 224e8: 84 e4 ldi r24, 0x44 ; 68 224ea: 9d e9 ldi r25, 0x9D ; 157 224ec: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 if(e != EXTRUDERS) { 224f0: 11 30 cpi r17, 0x01 ; 1 224f2: 51 f0 breq .+20 ; 0x22508 224f4: 61 2f mov r22, r17 224f6: 70 e0 ldi r23, 0x00 ; 0 224f8: 90 e0 ldi r25, 0x00 ; 0 224fa: 80 e0 ldi r24, 0x00 ; 0 224fc: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_ERROR((int)e); SERIAL_ERRORPGM(": "); 22500: 8d e6 ldi r24, 0x6D ; 109 22502: 94 e9 ldi r25, 0x94 ; 148 22504: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 } SERIAL_ERRORPGM("Heaters switched off. "); 22508: 86 e5 ldi r24, 0x56 ; 86 2250a: 94 e9 ldi r25, 0x94 ; 148 2250c: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ERRORRPGM(type); 22510: c7 01 movw r24, r14 22512: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ERRORLNPGM(" triggered!"); 22516: 8a e4 ldi r24, 0x4A ; 74 22518: 94 e9 ldi r25, 0x94 ; 148 2251a: 0e 94 49 72 call 0xe492 ; 0xe492 } 2251e: 64 96 adiw r28, 0x14 ; 20 22520: 0f b6 in r0, 0x3f ; 63 22522: f8 94 cli 22524: de bf out 0x3e, r29 ; 62 22526: 0f be out 0x3f, r0 ; 63 22528: cd bf out 0x3d, r28 ; 61 2252a: df 91 pop r29 2252c: cf 91 pop r28 2252e: 1f 91 pop r17 22530: ff 90 pop r15 22532: ef 90 pop r14 22534: df 90 pop r13 22536: cf 90 pop r12 22538: 08 95 ret 0002253a <__vector_15>: volatile unsigned long timer2_overflow_count; volatile unsigned long timer2_millis; unsigned char timer2_fract = 0; ISR(TIMER2_OVF_vect) { 2253a: 1f 92 push r1 2253c: 0f 92 push r0 2253e: 0f b6 in r0, 0x3f ; 63 22540: 0f 92 push r0 22542: 11 24 eor r1, r1 22544: 2f 93 push r18 22546: 3f 93 push r19 22548: 8f 93 push r24 2254a: 9f 93 push r25 2254c: af 93 push r26 2254e: 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; 22550: 80 91 65 06 lds r24, 0x0665 ; 0x800665 22554: 90 91 66 06 lds r25, 0x0666 ; 0x800666 22558: a0 91 67 06 lds r26, 0x0667 ; 0x800667 2255c: b0 91 68 06 lds r27, 0x0668 ; 0x800668 unsigned char f = timer2_fract; 22560: 30 91 64 06 lds r19, 0x0664 ; 0x800664 m += MILLIS_INC; f += FRACT_INC; 22564: 23 e0 ldi r18, 0x03 ; 3 22566: 23 0f add r18, r19 if (f >= FRACT_MAX) 22568: 2d 37 cpi r18, 0x7D ; 125 2256a: 58 f5 brcc .+86 ; 0x225c2 <__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; 2256c: 01 96 adiw r24, 0x01 ; 1 2256e: a1 1d adc r26, r1 22570: b1 1d adc r27, r1 if (f >= FRACT_MAX) { f -= FRACT_MAX; m += 1; } timer2_fract = f; 22572: 20 93 64 06 sts 0x0664, r18 ; 0x800664 timer2_millis = m; 22576: 80 93 65 06 sts 0x0665, r24 ; 0x800665 2257a: 90 93 66 06 sts 0x0666, r25 ; 0x800666 2257e: a0 93 67 06 sts 0x0667, r26 ; 0x800667 22582: b0 93 68 06 sts 0x0668, r27 ; 0x800668 timer2_overflow_count++; 22586: 80 91 69 06 lds r24, 0x0669 ; 0x800669 2258a: 90 91 6a 06 lds r25, 0x066A ; 0x80066a 2258e: a0 91 6b 06 lds r26, 0x066B ; 0x80066b 22592: b0 91 6c 06 lds r27, 0x066C ; 0x80066c 22596: 01 96 adiw r24, 0x01 ; 1 22598: a1 1d adc r26, r1 2259a: b1 1d adc r27, r1 2259c: 80 93 69 06 sts 0x0669, r24 ; 0x800669 225a0: 90 93 6a 06 sts 0x066A, r25 ; 0x80066a 225a4: a0 93 6b 06 sts 0x066B, r26 ; 0x80066b 225a8: b0 93 6c 06 sts 0x066C, r27 ; 0x80066c } 225ac: bf 91 pop r27 225ae: af 91 pop r26 225b0: 9f 91 pop r25 225b2: 8f 91 pop r24 225b4: 3f 91 pop r19 225b6: 2f 91 pop r18 225b8: 0f 90 pop r0 225ba: 0f be out 0x3f, r0 ; 63 225bc: 0f 90 pop r0 225be: 1f 90 pop r1 225c0: 18 95 reti unsigned char f = timer2_fract; m += MILLIS_INC; f += FRACT_INC; if (f >= FRACT_MAX) { f -= FRACT_MAX; 225c2: 26 e8 ldi r18, 0x86 ; 134 225c4: 23 0f add r18, r19 m += 1; 225c6: 02 96 adiw r24, 0x02 ; 2 225c8: a1 1d adc r26, r1 225ca: b1 1d adc r27, r1 225cc: d2 cf rjmp .-92 ; 0x22572 <__vector_15+0x38> 000225ce : } ENABLE_TEMP_MGR_INTERRUPT(); } void disable_heater() { 225ce: 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; 225d0: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 225d4: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 225d8: 10 92 ee 11 sts 0x11EE, r1 ; 0x8011ee 225dc: 10 92 ed 11 sts 0x11ED, r1 ; 0x8011ed setTargetHotend(0); setTargetBed(0); ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 225e0: cf b7 in r28, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 225e2: f8 94 cli // propagate all values down the chain setIsrTargetTemperatures(); 225e4: 0e 94 15 fb call 0x1f62a ; 0x1f62a temp_mgr_pid(); 225e8: 0e 94 52 f8 call 0x1f0a4 ; 0x1f0a4 // 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); 225ec: 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; 225ee: 10 92 92 06 sts 0x0692, r1 ; 0x800692 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 225f2: cf bf out 0x3f, r28 ; 63 #endif } } 225f4: cf 91 pop r28 225f6: 08 95 ret 000225f8 : /* Menu implementation */ static void lcd_cooldown() { disable_heater(); 225f8: 0f 94 e7 12 call 0x225ce ; 0x225ce fanSpeed = 0; 225fc: 10 92 e9 11 sts 0x11E9, r1 ; 0x8011e9 lcd_return_to_status(); 22600: 0c 94 6d fe jmp 0x1fcda ; 0x1fcda 00022604 : // 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) { 22604: 1f 93 push r17 22606: cf 93 push r28 22608: df 93 push r29 2260a: c8 2f mov r28, r24 2260c: 16 2f mov r17, r22 2260e: d4 2f mov r29, r20 // save the original target temperatures for recovery before disabling heaters if(!temp_error_state.error && !saved_printing) { 22610: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 22614: 80 fd sbrc r24, 0 22616: 18 c0 rjmp .+48 ; 0x22648 22618: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 2261c: 81 11 cpse r24, r1 2261e: 14 c0 rjmp .+40 ; 0x22648 saved_bed_temperature = target_temperature_bed; 22620: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed 22624: 80 93 ec 11 sts 0x11EC, r24 ; 0x8011ec saved_extruder_temperature = target_temperature[index]; 22628: e6 2f mov r30, r22 2262a: f0 e0 ldi r31, 0x00 ; 0 2262c: ee 0f add r30, r30 2262e: ff 1f adc r31, r31 22630: ef 50 subi r30, 0x0F ; 15 22632: fe 4e sbci r31, 0xEE ; 238 22634: 80 81 ld r24, Z 22636: 91 81 ldd r25, Z+1 ; 0x01 22638: 90 93 f0 11 sts 0x11F0, r25 ; 0x8011f0 2263c: 80 93 ef 11 sts 0x11EF, r24 ; 0x8011ef saved_fan_speed = fanSpeed; 22640: 80 91 e9 11 lds r24, 0x11E9 ; 0x8011e9 22644: 80 93 e8 11 sts 0x11E8, r24 ; 0x8011e8 } // keep disabling heaters and keep fans on as long as the condition is asserted disable_heater(); 22648: 0f 94 e7 12 call 0x225ce ; 0x225ce void hotendFanSetFullSpeed() { #ifdef EXTRUDER_ALTFAN_DETECT altfanStatus.altfanOverride = 1; //full speed #endif //EXTRUDER_ALTFAN_DETECT resetFanCheck(); 2264c: 0e 94 28 6e call 0xdc50 ; 0xdc50 setExtruderAutoFanState(3); 22650: 83 e0 ldi r24, 0x03 ; 3 22652: 0e 94 35 6e call 0xdc6a ; 0xdc6a SET_OUTPUT(FAN_PIN); 22656: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 2265a: 88 60 ori r24, 0x08 ; 8 2265c: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = 255; 22660: 8f ef ldi r24, 0xFF ; 255 22662: 80 93 05 05 sts 0x0505, r24 ; 0x800505 #else //FAN_SOFT_PWM analogWrite(FAN_PIN, 255); #endif //FAN_SOFT_PWM fanSpeed = 255; 22666: 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) { 2266a: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 2266e: 80 ff sbrs r24, 0 22670: 07 c0 rjmp .+14 ; 0x22680 22672: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 22676: 82 95 swap r24 22678: 86 95 lsr r24 2267a: 87 70 andi r24, 0x07 ; 7 2267c: d8 17 cp r29, r24 2267e: c0 f4 brcc .+48 ; 0x226b0 temp_error_state.source = (uint8_t)source; 22680: c3 70 andi r28, 0x03 ; 3 22682: cc 0f add r28, r28 22684: cc 0f add r28, r28 22686: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 2268a: 83 7f andi r24, 0xF3 ; 243 2268c: 8c 2b or r24, r28 2268e: 80 93 9a 03 sts 0x039A, r24 ; 0x80039a <_ZL16temp_error_state.lto_priv.422> temp_error_state.index = index; 22692: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 22696: 10 fb bst r17, 0 22698: 84 f9 bld r24, 4 2269a: 80 93 9a 03 sts 0x039A, r24 ; 0x80039a <_ZL16temp_error_state.lto_priv.422> temp_error_state.type = (uint8_t)type; 2269e: d2 95 swap r29 226a0: dd 0f add r29, r29 226a2: d0 7e andi r29, 0xE0 ; 224 226a4: 40 91 9a 03 lds r20, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 226a8: 4f 71 andi r20, 0x1F ; 31 226aa: 4d 2b or r20, r29 226ac: 40 93 9a 03 sts 0x039A, r20 ; 0x80039a <_ZL16temp_error_state.lto_priv.422> } // always set the error state temp_error_state.error = true; 226b0: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 226b4: 81 60 ori r24, 0x01 ; 1 226b6: 80 93 9a 03 sts 0x039A, r24 ; 0x80039a <_ZL16temp_error_state.lto_priv.422> temp_error_state.assert = true; 226ba: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 226be: 82 60 ori r24, 0x02 ; 2 226c0: 80 93 9a 03 sts 0x039A, r24 ; 0x80039a <_ZL16temp_error_state.lto_priv.422> } 226c4: df 91 pop r29 226c6: cf 91 pop r28 226c8: 1f 91 pop r17 226ca: 08 95 ret 000226cc : 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) { 226cc: 2f 92 push r2 226ce: 3f 92 push r3 226d0: 4f 92 push r4 226d2: 5f 92 push r5 226d4: 6f 92 push r6 226d6: 7f 92 push r7 226d8: 8f 92 push r8 226da: 9f 92 push r9 226dc: af 92 push r10 226de: bf 92 push r11 226e0: cf 92 push r12 226e2: df 92 push r13 226e4: ef 92 push r14 226e6: ff 92 push r15 226e8: 0f 93 push r16 226ea: 1f 93 push r17 226ec: cf 93 push r28 226ee: df 93 push r29 226f0: cd b7 in r28, 0x3d ; 61 226f2: de b7 in r29, 0x3e ; 62 226f4: 2c 97 sbiw r28, 0x0c ; 12 226f6: 0f b6 in r0, 0x3f ; 63 226f8: f8 94 cli 226fa: de bf out 0x3e, r29 ; 62 226fc: 0f be out 0x3f, r0 ; 63 226fe: cd bf out 0x3d, r28 ; 61 22700: 28 2e mov r2, r24 22702: 49 83 std Y+1, r20 ; 0x01 22704: 5a 83 std Y+2, r21 ; 0x02 22706: 6b 83 std Y+3, r22 ; 0x03 22708: 7c 83 std Y+4, r23 ; 0x04 2270a: 28 01 movw r4, r16 2270c: 39 01 movw r6, r18 2270e: 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) 22710: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 22714: 02 2d mov r16, r2 22716: 10 e0 ldi r17, 0x00 ; 0 22718: 98 01 movw r18, r16 2271a: 22 0f add r18, r18 2271c: 33 1f adc r19, r19 2271e: 22 0f add r18, r18 22720: 33 1f adc r19, r19 22722: 3c 87 std Y+12, r19 ; 0x0c 22724: 2b 87 std Y+11, r18 ; 0x0b 22726: f9 01 movw r30, r18 22728: e7 5f subi r30, 0xF7 ; 247 2272a: f9 4f sbci r31, 0xF9 ; 249 2272c: 80 80 ld r8, Z 2272e: 91 80 ldd r9, Z+1 ; 0x01 22730: a2 80 ldd r10, Z+2 ; 0x02 22732: b3 80 ldd r11, Z+3 ; 0x03 22734: 68 19 sub r22, r8 22736: 79 09 sbc r23, r9 22738: 8a 09 sbc r24, r10 2273a: 9b 09 sbc r25, r11 2273c: 61 3d cpi r22, 0xD1 ; 209 2273e: 77 40 sbci r23, 0x07 ; 7 22740: 81 05 cpc r24, r1 22742: 91 05 cpc r25, r1 22744: 08 f4 brcc .+2 ; 0x22748 22746: ea c0 rjmp .+468 ; 0x2291c { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) 22748: 33 20 and r3, r3 2274a: 09 f4 brne .+2 ; 0x2274e 2274c: 75 c0 rjmp .+234 ; 0x22838 { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; __timeout = TEMP_RUNAWAY_BED_TIMEOUT; 2274e: 88 e6 ldi r24, 0x68 ; 104 22750: 91 e0 ldi r25, 0x01 ; 1 22752: 9a 87 std Y+10, r25 ; 0x0a 22754: 89 87 std Y+9, r24 ; 0x09 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; 22756: 80 e0 ldi r24, 0x00 ; 0 22758: 90 e0 ldi r25, 0x00 ; 0 2275a: a0 ea ldi r26, 0xA0 ; 160 2275c: b0 e4 ldi r27, 0x40 ; 64 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 2275e: 8d 83 std Y+5, r24 ; 0x05 22760: 9e 83 std Y+6, r25 ; 0x06 22762: af 83 std Y+7, r26 ; 0x07 22764: b8 87 std Y+8, r27 ; 0x08 __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; } #endif temp_runaway_timer[_heater_id] = _millis(); 22766: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 2276a: eb 85 ldd r30, Y+11 ; 0x0b 2276c: fc 85 ldd r31, Y+12 ; 0x0c 2276e: e7 5f subi r30, 0xF7 ; 247 22770: f9 4f sbci r31, 0xF9 ; 249 22772: 60 83 st Z, r22 22774: 71 83 std Z+1, r23 ; 0x01 22776: 82 83 std Z+2, r24 ; 0x02 22778: 93 83 std Z+3, r25 ; 0x03 if (_output == 0) 2277a: 20 e0 ldi r18, 0x00 ; 0 2277c: 30 e0 ldi r19, 0x00 ; 0 2277e: a9 01 movw r20, r18 22780: c7 01 movw r24, r14 22782: b6 01 movw r22, r12 22784: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 22788: 81 11 cpse r24, r1 2278a: 07 c0 rjmp .+14 ; 0x2279a { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 2278c: f8 01 movw r30, r16 2278e: ee 0f add r30, r30 22790: ff 1f adc r31, r31 22792: eb 5f subi r30, 0xFB ; 251 22794: f9 4f sbci r31, 0xF9 ; 249 22796: 11 82 std Z+1, r1 ; 0x01 22798: 10 82 st Z, r1 } if (temp_runaway_target[_heater_id] != _target_temperature) 2279a: ab 85 ldd r26, Y+11 ; 0x0b 2279c: bc 85 ldd r27, Y+12 ; 0x0c 2279e: a3 50 subi r26, 0x03 ; 3 227a0: ba 4f sbci r27, 0xFA ; 250 227a2: 5d 01 movw r10, r26 227a4: 29 81 ldd r18, Y+1 ; 0x01 227a6: 3a 81 ldd r19, Y+2 ; 0x02 227a8: 4b 81 ldd r20, Y+3 ; 0x03 227aa: 5c 81 ldd r21, Y+4 ; 0x04 227ac: 6d 91 ld r22, X+ 227ae: 7d 91 ld r23, X+ 227b0: 8d 91 ld r24, X+ 227b2: 9c 91 ld r25, X 227b4: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 227b8: 88 23 and r24, r24 227ba: 09 f4 brne .+2 ; 0x227be 227bc: 91 c0 rjmp .+290 ; 0x228e0 { if (_target_temperature > 0) 227be: 20 e0 ldi r18, 0x00 ; 0 227c0: 30 e0 ldi r19, 0x00 ; 0 227c2: a9 01 movw r20, r18 227c4: 69 81 ldd r22, Y+1 ; 0x01 227c6: 7a 81 ldd r23, Y+2 ; 0x02 227c8: 8b 81 ldd r24, Y+3 ; 0x03 227ca: 9c 81 ldd r25, Y+4 ; 0x04 227cc: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 227d0: f8 01 movw r30, r16 227d2: e5 50 subi r30, 0x05 ; 5 227d4: fa 4f sbci r31, 0xFA ; 250 227d6: 18 16 cp r1, r24 227d8: c4 f5 brge .+112 ; 0x2284a { temp_runaway_status[_heater_id] = TempRunaway_PREHEAT; 227da: 81 e0 ldi r24, 0x01 ; 1 227dc: 80 83 st Z, r24 temp_runaway_target[_heater_id] = _target_temperature; 227de: 89 81 ldd r24, Y+1 ; 0x01 227e0: 9a 81 ldd r25, Y+2 ; 0x02 227e2: ab 81 ldd r26, Y+3 ; 0x03 227e4: bc 81 ldd r27, Y+4 ; 0x04 227e6: f5 01 movw r30, r10 227e8: 80 83 st Z, r24 227ea: 91 83 std Z+1, r25 ; 0x01 227ec: a2 83 std Z+2, r26 ; 0x02 227ee: b3 83 std Z+3, r27 ; 0x03 __preheat_start[_heater_id] = _current_temperature; 227f0: eb 85 ldd r30, Y+11 ; 0x0b 227f2: fc 85 ldd r31, Y+12 ; 0x0c 227f4: ed 50 subi r30, 0x0D ; 13 227f6: fa 4f sbci r31, 0xFA ; 250 227f8: 40 82 st Z, r4 227fa: 51 82 std Z+1, r5 ; 0x01 227fc: 62 82 std Z+2, r6 ; 0x02 227fe: 73 82 std Z+3, r7 ; 0x03 __preheat_counter[_heater_id] = 0; 22800: f8 01 movw r30, r16 22802: ef 50 subi r30, 0x0F ; 15 22804: fa 4f sbci r31, 0xFA ; 250 22806: 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)) 22808: a3 01 movw r20, r6 2280a: 92 01 movw r18, r4 2280c: bc 01 movw r22, r24 2280e: cd 01 movw r24, r26 22810: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 22814: 18 16 cp r1, r24 22816: 1c f5 brge .+70 ; 0x2285e { __preheat_counter[_heater_id]++; 22818: f8 01 movw r30, r16 2281a: ef 50 subi r30, 0x0F ; 15 2281c: fa 4f sbci r31, 0xFA ; 250 2281e: 80 81 ld r24, Z 22820: 8f 5f subi r24, 0xFF ; 255 22822: 80 83 st Z, r24 if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes 22824: 31 10 cpse r3, r1 22826: c7 c0 rjmp .+398 ; 0x229b6 22828: 89 30 cpi r24, 0x09 ; 9 2282a: c8 f0 brcs .+50 ; 0x2285e { __delta=2.0; 2282c: 81 2c mov r8, r1 2282e: 91 2c mov r9, r1 22830: a1 2c mov r10, r1 22832: 50 e4 ldi r21, 0x40 ; 64 22834: b5 2e mov r11, r21 22836: e8 c0 rjmp .+464 ; 0x22a08 #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; 22838: ad e2 ldi r26, 0x2D ; 45 2283a: b0 e0 ldi r27, 0x00 ; 0 2283c: ba 87 std Y+10, r27 ; 0x0a 2283e: a9 87 std Y+9, r26 ; 0x09 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 22840: 80 e0 ldi r24, 0x00 ; 0 22842: 90 e0 ldi r25, 0x00 ; 0 22844: a0 e7 ldi r26, 0x70 ; 112 22846: b1 e4 ldi r27, 0x41 ; 65 22848: 8a cf rjmp .-236 ; 0x2275e __preheat_start[_heater_id] = _current_temperature; __preheat_counter[_heater_id] = 0; } else { temp_runaway_status[_heater_id] = TempRunaway_INACTIVE; 2284a: 10 82 st Z, r1 temp_runaway_target[_heater_id] = _target_temperature; 2284c: 89 81 ldd r24, Y+1 ; 0x01 2284e: 9a 81 ldd r25, Y+2 ; 0x02 22850: ab 81 ldd r26, Y+3 ; 0x03 22852: bc 81 ldd r27, Y+4 ; 0x04 22854: f5 01 movw r30, r10 22856: 80 83 st Z, r24 22858: 91 83 std Z+1, r25 ; 0x01 2285a: a2 83 std Z+2, r26 ; 0x02 2285c: 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) 2285e: 2d 81 ldd r18, Y+5 ; 0x05 22860: 3e 81 ldd r19, Y+6 ; 0x06 22862: 4f 81 ldd r20, Y+7 ; 0x07 22864: 58 85 ldd r21, Y+8 ; 0x08 22866: 69 81 ldd r22, Y+1 ; 0x01 22868: 7a 81 ldd r23, Y+2 ; 0x02 2286a: 8b 81 ldd r24, Y+3 ; 0x03 2286c: 9c 81 ldd r25, Y+4 ; 0x04 2286e: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 22872: a3 01 movw r20, r6 22874: 92 01 movw r18, r4 22876: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 2287a: 87 ff sbrs r24, 7 2287c: 46 c0 rjmp .+140 ; 0x2290a 2287e: f8 01 movw r30, r16 22880: e5 50 subi r30, 0x05 ; 5 22882: fa 4f sbci r31, 0xFA ; 250 22884: 80 81 ld r24, Z 22886: 81 30 cpi r24, 0x01 ; 1 22888: 49 f4 brne .+18 ; 0x2289c { temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; 2288a: 82 e0 ldi r24, 0x02 ; 2 2288c: 80 83 st Z, r24 temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 2288e: f8 01 movw r30, r16 22890: ee 0f add r30, r30 22892: ff 1f adc r31, r31 22894: eb 5f subi r30, 0xFB ; 251 22896: f9 4f sbci r31, 0xF9 ; 249 22898: 11 82 std Z+1, r1 ; 0x01 2289a: 10 82 st Z, r1 } if (_output > 0) 2289c: 20 e0 ldi r18, 0x00 ; 0 2289e: 30 e0 ldi r19, 0x00 ; 0 228a0: a9 01 movw r20, r18 228a2: c7 01 movw r24, r14 228a4: b6 01 movw r22, r12 228a6: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 228aa: 18 16 cp r1, r24 228ac: bc f5 brge .+110 ; 0x2291c if (temp_runaway_check_active) { // we are in range if ((_current_temperature > (_target_temperature - __hysteresis)) && (_current_temperature < (_target_temperature + __hysteresis))) 228ae: 29 81 ldd r18, Y+1 ; 0x01 228b0: 3a 81 ldd r19, Y+2 ; 0x02 228b2: 4b 81 ldd r20, Y+3 ; 0x03 228b4: 5c 81 ldd r21, Y+4 ; 0x04 228b6: 6d 81 ldd r22, Y+5 ; 0x05 228b8: 7e 81 ldd r23, Y+6 ; 0x06 228ba: 8f 81 ldd r24, Y+7 ; 0x07 228bc: 98 85 ldd r25, Y+8 ; 0x08 228be: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 228c2: a3 01 movw r20, r6 228c4: 92 01 movw r18, r4 228c6: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 228ca: 18 16 cp r1, r24 228cc: 0c f0 brlt .+2 ; 0x228d0 228ce: 3f c0 rjmp .+126 ; 0x2294e { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 228d0: 00 0f add r16, r16 228d2: 11 1f adc r17, r17 228d4: f8 01 movw r30, r16 228d6: eb 5f subi r30, 0xFB ; 251 228d8: f9 4f sbci r31, 0xF9 ; 249 228da: 11 82 std Z+1, r1 ; 0x01 228dc: 10 82 st Z, r1 228de: 1e c0 rjmp .+60 ; 0x2291c 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)) 228e0: a3 01 movw r20, r6 228e2: 92 01 movw r18, r4 228e4: 69 81 ldd r22, Y+1 ; 0x01 228e6: 7a 81 ldd r23, Y+2 ; 0x02 228e8: 8b 81 ldd r24, Y+3 ; 0x03 228ea: 9c 81 ldd r25, Y+4 ; 0x04 228ec: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 228f0: 18 16 cp r1, r24 228f2: 0c f0 brlt .+2 ; 0x228f6 228f4: b4 cf rjmp .-152 ; 0x2285e 228f6: f8 01 movw r30, r16 228f8: e5 50 subi r30, 0x05 ; 5 228fa: fa 4f sbci r31, 0xFA ; 250 228fc: 80 81 ld r24, Z 228fe: 81 30 cpi r24, 0x01 ; 1 22900: 09 f0 breq .+2 ; 0x22904 22902: ad cf rjmp .-166 ; 0x2285e 22904: 89 cf rjmp .-238 ; 0x22818 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; 22906: 10 82 st Z, r1 22908: 97 c0 rjmp .+302 ; 0x22a38 temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } if (_output > 0) 2290a: 20 e0 ldi r18, 0x00 ; 0 2290c: 30 e0 ldi r19, 0x00 ; 0 2290e: a9 01 movw r20, r18 22910: c7 01 movw r24, r14 22912: b6 01 movw r22, r12 22914: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 22918: 18 16 cp r1, r24 2291a: cc f0 brlt .+50 ; 0x2294e } } } } } 2291c: 2c 96 adiw r28, 0x0c ; 12 2291e: 0f b6 in r0, 0x3f ; 63 22920: f8 94 cli 22922: de bf out 0x3e, r29 ; 62 22924: 0f be out 0x3f, r0 ; 63 22926: cd bf out 0x3d, r28 ; 61 22928: df 91 pop r29 2292a: cf 91 pop r28 2292c: 1f 91 pop r17 2292e: 0f 91 pop r16 22930: ff 90 pop r15 22932: ef 90 pop r14 22934: df 90 pop r13 22936: cf 90 pop r12 22938: bf 90 pop r11 2293a: af 90 pop r10 2293c: 9f 90 pop r9 2293e: 8f 90 pop r8 22940: 7f 90 pop r7 22942: 6f 90 pop r6 22944: 5f 90 pop r5 22946: 4f 90 pop r4 22948: 3f 90 pop r3 2294a: 2f 90 pop r2 2294c: 08 95 ret temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } else { if (temp_runaway_status[_heater_id] > TempRunaway_PREHEAT) 2294e: f8 01 movw r30, r16 22950: e5 50 subi r30, 0x05 ; 5 22952: fa 4f sbci r31, 0xFA ; 250 22954: 80 81 ld r24, Z 22956: 82 30 cpi r24, 0x02 ; 2 22958: 08 f3 brcs .-62 ; 0x2291c { temp_runaway_error_counter[_heater_id]++; 2295a: 00 0f add r16, r16 2295c: 11 1f adc r17, r17 2295e: f8 01 movw r30, r16 22960: eb 5f subi r30, 0xFB ; 251 22962: f9 4f sbci r31, 0xF9 ; 249 22964: 80 81 ld r24, Z 22966: 91 81 ldd r25, Z+1 ; 0x01 22968: 01 96 adiw r24, 0x01 ; 1 2296a: 91 83 std Z+1, r25 ; 0x01 2296c: 80 83 st Z, r24 if (temp_runaway_error_counter[_heater_id] * 2 > __timeout) 2296e: 88 0f add r24, r24 22970: 99 1f adc r25, r25 22972: e9 85 ldd r30, Y+9 ; 0x09 22974: fa 85 ldd r31, Y+10 ; 0x0a 22976: e8 17 cp r30, r24 22978: f9 07 cpc r31, r25 2297a: 80 f6 brcc .-96 ; 0x2291c set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::runaway); 2297c: 43 e0 ldi r20, 0x03 ; 3 2297e: 62 2d mov r22, r2 22980: 83 2d mov r24, r3 } } } } } 22982: 2c 96 adiw r28, 0x0c ; 12 22984: 0f b6 in r0, 0x3f ; 63 22986: f8 94 cli 22988: de bf out 0x3e, r29 ; 62 2298a: 0f be out 0x3f, r0 ; 63 2298c: cd bf out 0x3d, r28 ; 61 2298e: df 91 pop r29 22990: cf 91 pop r28 22992: 1f 91 pop r17 22994: 0f 91 pop r16 22996: ff 90 pop r15 22998: ef 90 pop r14 2299a: df 90 pop r13 2299c: cf 90 pop r12 2299e: bf 90 pop r11 229a0: af 90 pop r10 229a2: 9f 90 pop r9 229a4: 8f 90 pop r8 229a6: 7f 90 pop r7 229a8: 6f 90 pop r6 229aa: 5f 90 pop r5 229ac: 4f 90 pop r4 229ae: 3f 90 pop r3 229b0: 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); 229b2: 0d 94 02 13 jmp 0x22604 ; 0x22604 } 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 229b6: 81 31 cpi r24, 0x11 ; 17 229b8: 08 f4 brcc .+2 ; 0x229bc 229ba: 51 cf rjmp .-350 ; 0x2285e { __delta=2.0; if(_isbed) { __delta=3.0; if(_current_temperature>90.0) __delta=2.0; 229bc: 20 e0 ldi r18, 0x00 ; 0 229be: 30 e0 ldi r19, 0x00 ; 0 229c0: 44 eb ldi r20, 0xB4 ; 180 229c2: 52 e4 ldi r21, 0x42 ; 66 229c4: c3 01 movw r24, r6 229c6: b2 01 movw r22, r4 229c8: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes { __delta=2.0; if(_isbed) { __delta=3.0; 229cc: 81 2c mov r8, r1 229ce: 91 2c mov r9, r1 229d0: e0 e4 ldi r30, 0x40 ; 64 229d2: ae 2e mov r10, r30 229d4: ba 2c mov r11, r10 if(_current_temperature>90.0) __delta=2.0; 229d6: 18 16 cp r1, r24 229d8: 2c f4 brge .+10 ; 0x229e4 229da: 81 2c mov r8, r1 229dc: 91 2c mov r9, r1 229de: a1 2c mov r10, r1 229e0: 70 e4 ldi r23, 0x40 ; 64 229e2: b7 2e mov r11, r23 if(_current_temperature>105.0) __delta=0.6; 229e4: 20 e0 ldi r18, 0x00 ; 0 229e6: 30 e0 ldi r19, 0x00 ; 0 229e8: 42 ed ldi r20, 0xD2 ; 210 229ea: 52 e4 ldi r21, 0x42 ; 66 229ec: c3 01 movw r24, r6 229ee: b2 01 movw r22, r4 229f0: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 229f4: 18 16 cp r1, r24 229f6: 44 f4 brge .+16 ; 0x22a08 229f8: 6a e9 ldi r22, 0x9A ; 154 229fa: 86 2e mov r8, r22 229fc: 69 e9 ldi r22, 0x99 ; 153 229fe: 96 2e mov r9, r22 22a00: 69 e1 ldi r22, 0x19 ; 25 22a02: a6 2e mov r10, r22 22a04: 6f e3 ldi r22, 0x3F ; 63 22a06: b6 2e mov r11, r22 } if (_current_temperature - __preheat_start[_heater_id] < __delta) { 22a08: eb 85 ldd r30, Y+11 ; 0x0b 22a0a: fc 85 ldd r31, Y+12 ; 0x0c 22a0c: ed 50 subi r30, 0x0D ; 13 22a0e: fa 4f sbci r31, 0xFA ; 250 22a10: 20 81 ld r18, Z 22a12: 31 81 ldd r19, Z+1 ; 0x01 22a14: 42 81 ldd r20, Z+2 ; 0x02 22a16: 53 81 ldd r21, Z+3 ; 0x03 22a18: c3 01 movw r24, r6 22a1a: b2 01 movw r22, r4 22a1c: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 22a20: a5 01 movw r20, r10 22a22: 94 01 movw r18, r8 22a24: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 22a28: f8 01 movw r30, r16 22a2a: e1 51 subi r30, 0x11 ; 17 22a2c: fa 4f sbci r31, 0xFA ; 250 22a2e: 87 ff sbrs r24, 7 22a30: 6a cf rjmp .-300 ; 0x22906 __preheat_errors[_heater_id]++; 22a32: 80 81 ld r24, Z 22a34: 8f 5f subi r24, 0xFF ; 255 22a36: 80 83 st Z, r24 } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 22a38: 80 81 ld r24, Z 22a3a: 90 e0 ldi r25, 0x00 ; 0 22a3c: 31 10 cpse r3, r1 22a3e: 04 c0 rjmp .+8 ; 0x22a48 22a40: 06 97 sbiw r24, 0x06 ; 6 22a42: 4c f0 brlt .+18 ; 0x22a56 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 22a44: 80 e0 ldi r24, 0x00 ; 0 22a46: 03 c0 rjmp .+6 ; 0x22a4e __preheat_errors[_heater_id]++; } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 22a48: 04 97 sbiw r24, 0x04 ; 4 22a4a: 2c f0 brlt .+10 ; 0x22a56 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 22a4c: 81 e0 ldi r24, 0x01 ; 1 22a4e: 42 e0 ldi r20, 0x02 ; 2 22a50: 62 2d mov r22, r2 22a52: 0f 94 02 13 call 0x22604 ; 0x22604 __preheat_start[_heater_id] = _current_temperature; 22a56: 2b 85 ldd r18, Y+11 ; 0x0b 22a58: 3c 85 ldd r19, Y+12 ; 0x0c 22a5a: 2d 50 subi r18, 0x0D ; 13 22a5c: 3a 4f sbci r19, 0xFA ; 250 22a5e: d9 01 movw r26, r18 22a60: 4d 92 st X+, r4 22a62: 5d 92 st X+, r5 22a64: 6d 92 st X+, r6 22a66: 7c 92 st X, r7 22a68: 13 97 sbiw r26, 0x03 ; 3 __preheat_counter[_heater_id] = 0; 22a6a: f8 01 movw r30, r16 22a6c: ef 50 subi r30, 0x0F ; 15 22a6e: fa 4f sbci r31, 0xFA ; 250 22a70: 10 82 st Z, r1 22a72: f5 ce rjmp .-534 ; 0x2285e 00022a74 : //! @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() { 22a74: 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); 22a76: 89 e2 ldi r24, 0x29 ; 41 22a78: 9d e0 ldi r25, 0x0D ; 13 22a7a: 0f 94 9b a0 call 0x34136 ; 0x34136 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; 22a7e: 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. 22a80: 8f 3f cpi r24, 0xFF ; 255 22a82: 91 f4 brne .+36 ; 0x22aa8 { #endif //PINDA_TEMP_COMP return (current_temperature_pinda >= PINDA_MINTEMP) ? true : false; 22a84: 20 e0 ldi r18, 0x00 ; 0 22a86: 30 e0 ldi r19, 0x00 ; 0 22a88: 40 ef ldi r20, 0xF0 ; 240 22a8a: 51 e4 ldi r21, 0x41 ; 65 22a8c: 60 91 8e 06 lds r22, 0x068E ; 0x80068e 22a90: 70 91 8f 06 lds r23, 0x068F ; 0x80068f 22a94: 80 91 90 06 lds r24, 0x0690 ; 0x800690 22a98: 90 91 91 06 lds r25, 0x0691 ; 0x800691 22a9c: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 22aa0: 87 ff sbrs r24, 7 22aa2: 04 c0 rjmp .+8 ; 0x22aac #ifdef PINDA_TEMP_COMP } else if (pinda_temp_compensation == 0) return true; //Overwritten via LCD menu SuperPINDA [No] 22aa4: c0 e0 ldi r28, 0x00 ; 0 22aa6: 02 c0 rjmp .+4 ; 0x22aac 22aa8: 81 11 cpse r24, r1 22aaa: fc cf rjmp .-8 ; 0x22aa4 else return false; //Overwritten via LCD menu SuperPINDA [YES] #endif //PINDA_TEMP_COMP #else return true; #endif } 22aac: 8c 2f mov r24, r28 22aae: cf 91 pop r28 22ab0: 08 95 ret 00022ab2 <__vector_14>: #ifdef SYSTEM_TIMER_2 ISR(TIMER2_COMPB_vect) #else //SYSTEM_TIMER_2 ISR(TIMER0_COMPB_vect) #endif //SYSTEM_TIMER_2 { 22ab2: 1f 92 push r1 22ab4: 0f 92 push r0 22ab6: 0f b6 in r0, 0x3f ; 63 22ab8: 0f 92 push r0 22aba: 11 24 eor r1, r1 22abc: 0b b6 in r0, 0x3b ; 59 22abe: 0f 92 push r0 22ac0: ff 92 push r15 22ac2: 0f 93 push r16 22ac4: 1f 93 push r17 22ac6: 2f 93 push r18 22ac8: 3f 93 push r19 22aca: 4f 93 push r20 22acc: 5f 93 push r21 22ace: 6f 93 push r22 22ad0: 7f 93 push r23 22ad2: 8f 93 push r24 22ad4: 9f 93 push r25 22ad6: af 93 push r26 22ad8: bf 93 push r27 22ada: cf 93 push r28 22adc: df 93 push r29 22ade: ef 93 push r30 22ae0: ff 93 push r31 DISABLE_SOFT_PWM_INTERRUPT(); 22ae2: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 22ae6: 8b 7f andi r24, 0xFB ; 251 22ae8: 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(); 22aec: 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) 22aee: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 22af2: 86 fd sbrc r24, 6 22af4: c8 c0 rjmp .+400 ; 0x22c86 <__vector_14+0x1d4> { //button is pressed if (buttonBlanking.expired_cont(BUTTON_BLANKING_TIME)) { 22af6: 68 ec ldi r22, 0xC8 ; 200 22af8: 70 e0 ldi r23, 0x00 ; 0 22afa: 8f e1 ldi r24, 0x1F ; 31 22afc: 96 e0 ldi r25, 0x06 ; 6 22afe: 0f 94 57 10 call 0x220ae ; 0x220ae ::expired_cont(unsigned short)> 22b02: 88 23 and r24, r24 22b04: b9 f0 breq .+46 ; 0x22b34 <__vector_14+0x82> buttonBlanking.start(); 22b06: 8f e1 ldi r24, 0x1F ; 31 22b08: 96 e0 ldi r25, 0x06 ; 6 22b0a: 0f 94 5e 10 call 0x220bc ; 0x220bc ::start()> safetyTimer.start(); 22b0e: 8a e1 ldi r24, 0x1A ; 26 22b10: 96 e0 ldi r25, 0x06 ; 6 22b12: 0f 94 29 12 call 0x22452 ; 0x22452 ::start()> if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) 22b16: 80 91 19 06 lds r24, 0x0619 ; 0x800619 22b1a: 81 11 cpse r24, r1 22b1c: a5 c0 rjmp .+330 ; 0x22c68 <__vector_14+0x1b6> 22b1e: 80 91 18 06 lds r24, 0x0618 ; 0x800618 22b22: 81 11 cpse r24, r1 22b24: a1 c0 rjmp .+322 ; 0x22c68 <__vector_14+0x1b6> { longPressTimer.start(); 22b26: 85 e1 ldi r24, 0x15 ; 21 22b28: 96 e0 ldi r25, 0x06 ; 6 22b2a: 0f 94 5e 10 call 0x220bc ; 0x220bc ::start()> lcd_button_pressed = 1; 22b2e: 81 e0 ldi r24, 0x01 ; 1 22b30: 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); 22b34: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 22b38: 82 fb bst r24, 2 22b3a: 88 27 eor r24, r24 22b3c: 80 f9 bld r24, 0 22b3e: 91 e0 ldi r25, 0x01 ; 1 22b40: 89 27 eor r24, r25 if (!READ(BTN_EN2)) enc_bits |= _BV(1); 22b42: 90 91 03 01 lds r25, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 22b46: 91 ff sbrs r25, 1 22b48: 82 60 ori r24, 0x02 ; 2 if (enc_bits != enc_bits_old) 22b4a: e0 91 12 06 lds r30, 0x0612 ; 0x800612 22b4e: e8 17 cp r30, r24 22b50: e1 f0 breq .+56 ; 0x22b8a <__vector_14+0xd8> { int8_t newDiff = pgm_read_byte(&encrot_table[(enc_bits_old << 2) | enc_bits]); 22b52: 24 e0 ldi r18, 0x04 ; 4 22b54: e2 9f mul r30, r18 22b56: f0 01 movw r30, r0 22b58: 11 24 eor r1, r1 22b5a: e8 2b or r30, r24 22b5c: ea 58 subi r30, 0x8A ; 138 22b5e: fb 46 sbci r31, 0x6B ; 107 22b60: e4 91 lpm r30, Z lcd_encoder_diff += newDiff; 22b62: 90 91 11 06 lds r25, 0x0611 ; 0x800611 <_ZL16lcd_encoder_diff.lto_priv.504> 22b66: e9 0f add r30, r25 22b68: e0 93 11 06 sts 0x0611, r30 ; 0x800611 <_ZL16lcd_encoder_diff.lto_priv.504> if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 22b6c: 0e 2e mov r0, r30 22b6e: 00 0c add r0, r0 22b70: ff 0b sbc r31, r31 22b72: f7 ff sbrs r31, 7 22b74: 03 c0 rjmp .+6 ; 0x22b7c <__vector_14+0xca> 22b76: f1 95 neg r31 22b78: e1 95 neg r30 22b7a: f1 09 sbc r31, r1 22b7c: 34 97 sbiw r30, 0x04 ; 4 22b7e: 1c f0 brlt .+6 ; 0x22b86 <__vector_14+0xd4> lcd_backlight_wake_trigger = true; // flag event, knob rotated 22b80: 91 e0 ldi r25, 0x01 ; 1 22b82: 90 93 13 06 sts 0x0613, r25 ; 0x800613 <_ZL26lcd_backlight_wake_trigger.lto_priv.503> } enc_bits_old = enc_bits; 22b86: 80 93 12 06 sts 0x0612, r24 ; 0x800612 #ifndef SLOW_PWM_HEATERS /* * standard PWM modulation */ if (pwm_count == 0) 22b8a: 80 91 70 02 lds r24, 0x0270 ; 0x800270 22b8e: 81 11 cpse r24, r1 22b90: 08 c0 rjmp .+16 ; 0x22ba2 <__vector_14+0xf0> { soft_pwm_0 = soft_pwm[0]; 22b92: 80 91 62 06 lds r24, 0x0662 ; 0x800662 <_ZL8soft_pwm.lto_priv.506> 22b96: 80 93 28 06 sts 0x0628, r24 ; 0x800628 if(soft_pwm_0 > 0) 22b9a: 88 23 and r24, r24 22b9c: 09 f4 brne .+2 ; 0x22ba0 <__vector_14+0xee> 22b9e: 87 c0 rjmp .+270 ; 0x22cae <__vector_14+0x1fc> { WRITE(HEATER_0_PIN,1); 22ba0: 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) 22ba2: 80 91 70 02 lds r24, 0x0270 ; 0x800270 22ba6: 8f 70 andi r24, 0x0F ; 15 22ba8: a9 f4 brne .+42 ; 0x22bd4 <__vector_14+0x122> { soft_pwm_fan = fanSpeedSoftPwm / (1 << (8 - FAN_SOFT_PWM_BITS)); 22baa: 80 91 05 05 lds r24, 0x0505 ; 0x800505 22bae: 90 e0 ldi r25, 0x00 ; 0 22bb0: 24 e0 ldi r18, 0x04 ; 4 22bb2: 95 95 asr r25 22bb4: 87 95 ror r24 22bb6: 2a 95 dec r18 22bb8: e1 f7 brne .-8 ; 0x22bb2 <__vector_14+0x100> 22bba: 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); 22bbe: 89 2b or r24, r25 22bc0: 09 f4 brne .+2 ; 0x22bc4 <__vector_14+0x112> 22bc2: 77 c0 rjmp .+238 ; 0x22cb2 <__vector_14+0x200> 22bc4: 9f b7 in r25, 0x3f ; 63 22bc6: f8 94 cli 22bc8: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22bcc: 88 60 ori r24, 0x08 ; 8 22bce: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22bd2: 9f bf out 0x3f, r25 ; 63 } #endif if(soft_pwm_0 < pwm_count) 22bd4: 90 91 28 06 lds r25, 0x0628 ; 0x800628 22bd8: 80 91 70 02 lds r24, 0x0270 ; 0x800270 22bdc: 98 17 cp r25, r24 22bde: 08 f4 brcc .+2 ; 0x22be2 <__vector_14+0x130> { WRITE(HEATER_0_PIN,0); 22be0: 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); 22be2: 80 91 70 02 lds r24, 0x0270 ; 0x800270 22be6: 8f 70 andi r24, 0x0F ; 15 22be8: 90 91 dd 03 lds r25, 0x03DD ; 0x8003dd <_ZL12soft_pwm_fan.lto_priv.434> 22bec: 98 17 cp r25, r24 22bee: 40 f4 brcc .+16 ; 0x22c00 <__vector_14+0x14e> 22bf0: 9f b7 in r25, 0x3f ; 63 22bf2: f8 94 cli 22bf4: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22bf8: 87 7f andi r24, 0xF7 ; 247 22bfa: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22bfe: 9f bf out 0x3f, r25 ; 63 #endif pwm_count += (1 << SOFT_PWM_SCALE); 22c00: 80 91 70 02 lds r24, 0x0270 ; 0x800270 22c04: 8f 5f subi r24, 0xFF ; 255 pwm_count &= 0x7f; 22c06: 8f 77 andi r24, 0x7F ; 127 22c08: 80 93 70 02 sts 0x0270, r24 ; 0x800270 22c0c: 10 e0 ldi r17, 0x00 ; 0 22c0e: 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 22c10: e8 01 movw r28, r16 22c12: cc 0f add r28, r28 22c14: dd 1f adc r29, r29 22c16: c8 57 subi r28, 0x78 ; 120 22c18: d9 4f sbci r29, 0xF9 ; 249 22c1a: 88 81 ld r24, Y 22c1c: 99 81 ldd r25, Y+1 ; 0x01 if(curTodo>0) 22c1e: 18 16 cp r1, r24 22c20: 19 06 cpc r1, r25 22c22: 0c f0 brlt .+2 ; 0x22c26 <__vector_14+0x174> 22c24: 4c c0 rjmp .+152 ; 0x22cbe <__vector_14+0x20c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 22c26: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 22c28: f8 94 cli babystep(axis,/*fwd*/true); 22c2a: 61 e0 ldi r22, 0x01 ; 1 22c2c: 80 2f mov r24, r16 22c2e: 0e 94 76 fb call 0x1f6ec ; 0x1f6ec babystepsTodo[axis]--; //less to do next time 22c32: 88 81 ld r24, Y 22c34: 99 81 ldd r25, Y+1 ; 0x01 22c36: 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 22c38: 99 83 std Y+1, r25 ; 0x01 22c3a: 88 83 st Y, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 22c3c: ff be out 0x3f, r15 ; 63 __asm__ volatile ("" ::: "memory"); 22c3e: 0f 5f subi r16, 0xFF ; 255 22c40: 1f 4f sbci r17, 0xFF ; 255 } #endif #ifdef BABYSTEPPING FORCE_INLINE static void applyBabysteps() { for(uint8_t axis=0;axis<3;axis++) 22c42: 03 30 cpi r16, 0x03 ; 3 22c44: 11 05 cpc r17, r1 22c46: 21 f7 brne .-56 ; 0x22c10 <__vector_14+0x15e> #ifdef BABYSTEPPING applyBabysteps(); #endif //BABYSTEPPING // Check if a stack overflow happened if (!SdFatUtil::test_stack_integrity()) stack_error(); 22c48: 80 91 24 17 lds r24, 0x1724 ; 0x801724 <__bss_end+0x20> 22c4c: 90 91 25 17 lds r25, 0x1725 ; 0x801725 <__bss_end+0x21> 22c50: a0 91 26 17 lds r26, 0x1726 ; 0x801726 <__bss_end+0x22> 22c54: b0 91 27 17 lds r27, 0x1727 ; 0x801727 <__bss_end+0x23> 22c58: 82 3a cpi r24, 0xA2 ; 162 22c5a: 92 4a sbci r25, 0xA2 ; 162 22c5c: a1 05 cpc r26, r1 22c5e: b1 05 cpc r27, r1 22c60: d9 f1 breq .+118 ; 0x22cd8 <__vector_14+0x226> crash_and_burn(dump_crash_reason::bad_isr); } #endif //EMERGENCY_HANDLERS void stack_error() { crash_and_burn(dump_crash_reason::stack_error); 22c62: 81 e0 ldi r24, 0x01 ; 1 22c64: 0e 94 a1 74 call 0xe942 ; 0xe942 if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) { longPressTimer.start(); lcd_button_pressed = 1; } else if (longPressTimer.expired(LONG_PRESS_TIME)) 22c68: 68 ee ldi r22, 0xE8 ; 232 22c6a: 73 e0 ldi r23, 0x03 ; 3 22c6c: 85 e1 ldi r24, 0x15 ; 21 22c6e: 96 e0 ldi r25, 0x06 ; 6 22c70: 0f 94 2f 10 call 0x2205e ; 0x2205e ::expired(unsigned short)> 22c74: 88 23 and r24, r24 22c76: 09 f4 brne .+2 ; 0x22c7a <__vector_14+0x1c8> 22c78: 5d cf rjmp .-326 ; 0x22b34 <__vector_14+0x82> { lcd_long_press_active = 1; 22c7a: 81 e0 ldi r24, 0x01 ; 1 22c7c: 80 93 18 06 sts 0x0618, r24 ; 0x800618 lcd_longpress_trigger = 1; 22c80: 80 93 14 06 sts 0x0614, r24 ; 0x800614 22c84: 57 cf rjmp .-338 ; 0x22b34 <__vector_14+0x82> } } } else { //button not pressed if (lcd_button_pressed) 22c86: 80 91 19 06 lds r24, 0x0619 ; 0x800619 22c8a: 88 23 and r24, r24 22c8c: 09 f4 brne .+2 ; 0x22c90 <__vector_14+0x1de> 22c8e: 52 cf rjmp .-348 ; 0x22b34 <__vector_14+0x82> { //button was released lcd_button_pressed = 0; // Reset to prevent double triggering 22c90: 10 92 19 06 sts 0x0619, r1 ; 0x800619 if (!lcd_long_press_active) 22c94: 80 91 18 06 lds r24, 0x0618 ; 0x800618 22c98: 81 11 cpse r24, r1 22c9a: 03 c0 rjmp .+6 ; 0x22ca2 <__vector_14+0x1f0> { //button released before long press gets activated lcd_click_trigger = 1; // This flag is reset when the event is consumed 22c9c: 81 e0 ldi r24, 0x01 ; 1 22c9e: 80 93 63 03 sts 0x0363, r24 ; 0x800363 } lcd_backlight_wake_trigger = true; // flag event, knob pressed 22ca2: 81 e0 ldi r24, 0x01 ; 1 22ca4: 80 93 13 06 sts 0x0613, r24 ; 0x800613 <_ZL26lcd_backlight_wake_trigger.lto_priv.503> lcd_long_press_active = 0; 22ca8: 10 92 18 06 sts 0x0618, r1 ; 0x800618 22cac: 43 cf rjmp .-378 ; 0x22b34 <__vector_14+0x82> { WRITE(HEATER_0_PIN,1); #ifdef HEATERS_PARALLEL WRITE(HEATER_1_PIN,1); #endif } else WRITE(HEATER_0_PIN,0); 22cae: 75 98 cbi 0x0e, 5 ; 14 22cb0: 78 cf rjmp .-272 ; 0x22ba2 <__vector_14+0xf0> #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); 22cb2: 9f b7 in r25, 0x3f ; 63 22cb4: f8 94 cli 22cb6: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22cba: 87 7f andi r24, 0xF7 ; 247 22cbc: 88 cf rjmp .-240 ; 0x22bce <__vector_14+0x11c> babystep(axis,/*fwd*/true); babystepsTodo[axis]--; //less to do next time } } else if(curTodo<0) 22cbe: 89 2b or r24, r25 22cc0: 09 f4 brne .+2 ; 0x22cc4 <__vector_14+0x212> 22cc2: bd cf rjmp .-134 ; 0x22c3e <__vector_14+0x18c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 22cc4: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 22cc6: f8 94 cli babystep(axis,/*fwd*/false); 22cc8: 60 e0 ldi r22, 0x00 ; 0 22cca: 80 2f mov r24, r16 22ccc: 0e 94 76 fb call 0x1f6ec ; 0x1f6ec babystepsTodo[axis]++; //less to do next time 22cd0: 88 81 ld r24, Y 22cd2: 99 81 ldd r25, Y+1 ; 0x01 22cd4: 01 96 adiw r24, 0x01 ; 1 22cd6: b0 cf rjmp .-160 ; 0x22c38 <__vector_14+0x186> #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]) { 22cd8: 96 b1 in r25, 0x06 ; 6 22cda: 80 91 26 06 lds r24, 0x0626 ; 0x800626 22cde: 99 1f adc r25, r25 22ce0: 99 27 eor r25, r25 22ce2: 99 1f adc r25, r25 22ce4: 98 17 cp r25, r24 22ce6: 91 f0 breq .+36 ; 0x22d0c <__vector_14+0x25a> if(fan_measuring) fan_edge_counter[0] ++; 22ce8: 90 91 84 03 lds r25, 0x0384 ; 0x800384 22cec: 99 23 and r25, r25 22cee: 51 f0 breq .+20 ; 0x22d04 <__vector_14+0x252> 22cf0: 20 91 22 06 lds r18, 0x0622 ; 0x800622 22cf4: 30 91 23 06 lds r19, 0x0623 ; 0x800623 22cf8: 2f 5f subi r18, 0xFF ; 255 22cfa: 3f 4f sbci r19, 0xFF ; 255 22cfc: 30 93 23 06 sts 0x0623, r19 ; 0x800623 22d00: 20 93 22 06 sts 0x0622, r18 ; 0x800622 fan_state[0] = !fan_state[0]; 22d04: 91 e0 ldi r25, 0x01 ; 1 22d06: 89 27 eor r24, r25 22d08: 80 93 26 06 sts 0x0626, r24 ; 0x800626 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 22d0c: f8 94 cli { DISABLE_SOFT_PWM_INTERRUPT(); NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { soft_pwm_isr(); } ENABLE_SOFT_PWM_INTERRUPT(); 22d0e: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 22d12: 84 60 ori r24, 0x04 ; 4 22d14: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> } 22d18: ff 91 pop r31 22d1a: ef 91 pop r30 22d1c: df 91 pop r29 22d1e: cf 91 pop r28 22d20: bf 91 pop r27 22d22: af 91 pop r26 22d24: 9f 91 pop r25 22d26: 8f 91 pop r24 22d28: 7f 91 pop r23 22d2a: 6f 91 pop r22 22d2c: 5f 91 pop r21 22d2e: 4f 91 pop r20 22d30: 3f 91 pop r19 22d32: 2f 91 pop r18 22d34: 1f 91 pop r17 22d36: 0f 91 pop r16 22d38: ff 90 pop r15 22d3a: 0f 90 pop r0 22d3c: 0b be out 0x3b, r0 ; 59 22d3e: 0f 90 pop r0 22d40: 0f be out 0x3f, r0 ; 63 22d42: 0f 90 pop r0 22d44: 1f 90 pop r1 22d46: 18 95 reti 00022d48 : 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) { 22d48: 4f 92 push r4 22d4a: 5f 92 push r5 22d4c: 6f 92 push r6 22d4e: 7f 92 push r7 22d50: af 92 push r10 22d52: bf 92 push r11 22d54: cf 92 push r12 22d56: df 92 push r13 22d58: ef 92 push r14 22d5a: ff 92 push r15 22d5c: 0f 93 push r16 22d5e: 1f 93 push r17 22d60: cf 93 push r28 22d62: df 93 push r29 22d64: 24 e0 ldi r18, 0x04 ; 4 22d66: 30 e0 ldi r19, 0x00 ; 0 22d68: 41 e0 ldi r20, 0x01 ; 1 22d6a: 50 e0 ldi r21, 0x00 ; 0 22d6c: d9 01 movw r26, r18 22d6e: a4 56 subi r26, 0x64 ; 100 22d70: bd 46 sbci r27, 0x6D ; 109 float celsius = 0; byte i; for (i=1; i raw) 22d72: fd 01 movw r30, r26 22d74: 65 91 lpm r22, Z+ 22d76: 74 91 lpm r23, Z 22d78: 86 17 cp r24, r22 22d7a: 97 07 cpc r25, r23 22d7c: 0c f0 brlt .+2 ; 0x22d80 22d7e: 80 c0 rjmp .+256 ; 0x22e80 { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 22d80: 41 50 subi r20, 0x01 ; 1 22d82: 51 09 sbc r21, r1 22d84: 44 0f add r20, r20 22d86: 55 1f adc r21, r21 22d88: 44 0f add r20, r20 22d8a: 55 1f adc r21, r21 22d8c: 8a 01 movw r16, r20 22d8e: 02 56 subi r16, 0x62 ; 98 22d90: 1d 46 sbci r17, 0x6D ; 109 22d92: f8 01 movw r30, r16 22d94: c5 90 lpm r12, Z+ 22d96: d4 90 lpm r13, Z (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * 22d98: 44 56 subi r20, 0x64 ; 100 22d9a: 5d 46 sbci r21, 0x6D ; 109 22d9c: fa 01 movw r30, r20 22d9e: 65 91 lpm r22, Z+ 22da0: 74 91 lpm r23, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 22da2: f9 01 movw r30, r18 22da4: e2 56 subi r30, 0x62 ; 98 22da6: fd 46 sbci r31, 0x6D ; 109 22da8: c5 91 lpm r28, Z+ 22daa: d4 91 lpm r29, Z 22dac: f8 01 movw r30, r16 22dae: 05 91 lpm r16, Z+ 22db0: 14 91 lpm r17, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][0]) - PGM_RD_W(BEDTEMPTABLE[i-1][0])); 22db2: fd 01 movw r30, r26 22db4: e5 90 lpm r14, Z+ 22db6: f4 90 lpm r15, Z 22db8: fa 01 movw r30, r20 22dba: a5 90 lpm r10, Z+ 22dbc: 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])) * 22dbe: 86 1b sub r24, r22 22dc0: 97 0b sbc r25, r23 22dc2: bc 01 movw r22, r24 22dc4: 99 0f add r25, r25 22dc6: 88 0b sbc r24, r24 22dc8: 99 0b sbc r25, r25 22dca: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 22dce: 2b 01 movw r4, r22 22dd0: 3c 01 movw r6, r24 (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 22dd2: be 01 movw r22, r28 22dd4: 60 1b sub r22, r16 22dd6: 71 0b sbc r23, r17 22dd8: 07 2e mov r0, r23 22dda: 00 0c add r0, r0 22ddc: 88 0b sbc r24, r24 22dde: 99 0b sbc r25, r25 22de0: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 22de4: 9b 01 movw r18, r22 22de6: 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])) * 22de8: c3 01 movw r24, r6 22dea: b2 01 movw r22, r4 22dec: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 22df0: 2b 01 movw r4, r22 22df2: 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])); 22df4: b7 01 movw r22, r14 22df6: 6a 19 sub r22, r10 22df8: 7b 09 sbc r23, r11 22dfa: 07 2e mov r0, r23 22dfc: 00 0c add r0, r0 22dfe: 88 0b sbc r24, r24 22e00: 99 0b sbc r25, r25 22e02: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 22e06: 9b 01 movw r18, r22 22e08: 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])) / 22e0a: c3 01 movw r24, r6 22e0c: b2 01 movw r22, r4 22e0e: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 22e12: 2b 01 movw r4, r22 22e14: 3c 01 movw r6, r24 for (i=1; i raw) { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 22e16: b6 01 movw r22, r12 22e18: dd 0c add r13, r13 22e1a: 88 0b sbc r24, r24 22e1c: 99 0b sbc r25, r25 22e1e: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 22e22: 9b 01 movw r18, r22 22e24: ac 01 movw r20, r24 22e26: c3 01 movw r24, r6 22e28: b2 01 movw r22, r4 22e2a: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 22e2e: 6b 01 movw r12, r22 22e30: 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) 22e32: 20 e0 ldi r18, 0x00 ; 0 22e34: 30 e0 ldi r19, 0x00 ; 0 22e36: 40 e2 ldi r20, 0x20 ; 32 22e38: 52 e4 ldi r21, 0x42 ; 66 22e3a: c7 01 movw r24, r14 22e3c: b6 01 movw r22, r12 22e3e: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 22e42: 87 fd sbrc r24, 7 22e44: 30 c0 rjmp .+96 ; 0x22ea6 22e46: 20 e0 ldi r18, 0x00 ; 0 22e48: 30 e0 ldi r19, 0x00 ; 0 22e4a: 48 e4 ldi r20, 0x48 ; 72 22e4c: 52 e4 ldi r21, 0x42 ; 66 22e4e: c7 01 movw r24, r14 22e50: b6 01 movw r22, r12 22e52: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 22e56: 18 16 cp r1, r24 22e58: 34 f1 brlt .+76 ; 0x22ea6 { celsius = celsius + (_first_koef * (celsius - _offset_start)); 22e5a: 20 e0 ldi r18, 0x00 ; 0 22e5c: 30 e0 ldi r19, 0x00 ; 0 22e5e: 40 e2 ldi r20, 0x20 ; 32 22e60: 52 e4 ldi r21, 0x42 ; 66 22e62: c7 01 movw r24, r14 22e64: b6 01 movw r22, r12 22e66: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 22e6a: 20 e0 ldi r18, 0x00 ; 0 22e6c: 30 e0 ldi r19, 0x00 ; 0 22e6e: 40 e0 ldi r20, 0x00 ; 0 22e70: 5f e3 ldi r21, 0x3F ; 63 22e72: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 22e76: 9b 01 movw r18, r22 22e78: 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; 22e7a: c7 01 movw r24, r14 22e7c: b6 01 movw r22, r12 22e7e: 43 c0 rjmp .+134 ; 0x22f06 22e80: 4f 5f subi r20, 0xFF ; 255 22e82: 5f 4f sbci r21, 0xFF ; 255 22e84: 2c 5f subi r18, 0xFC ; 252 22e86: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempBed(int raw) { #ifdef BED_USES_THERMISTOR float celsius = 0; byte i; for (i=1; i 22e8e: 6e cf rjmp .-292 ; 0x22d6c break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 22e90: ee e8 ldi r30, 0x8E ; 142 22e92: f3 e9 ldi r31, 0x93 ; 147 22e94: 65 91 lpm r22, Z+ 22e96: 74 91 lpm r23, Z 22e98: 07 2e mov r0, r23 22e9a: 00 0c add r0, r0 22e9c: 88 0b sbc r24, r24 22e9e: 99 0b sbc r25, r25 22ea0: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 22ea4: c4 cf rjmp .-120 ; 0x22e2e if (celsius >= _offset_start && celsius <= _offset_center) { celsius = celsius + (_first_koef * (celsius - _offset_start)); } else if (celsius > _offset_center && celsius <= 100) 22ea6: 20 e0 ldi r18, 0x00 ; 0 22ea8: 30 e0 ldi r19, 0x00 ; 0 22eaa: 48 e4 ldi r20, 0x48 ; 72 22eac: 52 e4 ldi r21, 0x42 ; 66 22eae: c7 01 movw r24, r14 22eb0: b6 01 movw r22, r12 22eb2: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 22eb6: 18 16 cp r1, r24 22eb8: dc f5 brge .+118 ; 0x22f30 22eba: 20 e0 ldi r18, 0x00 ; 0 22ebc: 30 e0 ldi r19, 0x00 ; 0 22ebe: 48 ec ldi r20, 0xC8 ; 200 22ec0: 52 e4 ldi r21, 0x42 ; 66 22ec2: c7 01 movw r24, r14 22ec4: b6 01 movw r22, r12 22ec6: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 22eca: 18 16 cp r1, r24 22ecc: 8c f1 brlt .+98 ; 0x22f30 { celsius = celsius + (_first_koef * (_offset_center - _offset_start)) + ( _second_koef * ( celsius - ( 100 - _offset_center ) )) ; 22ece: 20 e0 ldi r18, 0x00 ; 0 22ed0: 30 e0 ldi r19, 0x00 ; 0 22ed2: 40 ea ldi r20, 0xA0 ; 160 22ed4: 50 e4 ldi r21, 0x40 ; 64 22ed6: c7 01 movw r24, r14 22ed8: b6 01 movw r22, r12 22eda: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 22ede: 2b 01 movw r4, r22 22ee0: 3c 01 movw r6, r24 22ee2: 20 e0 ldi r18, 0x00 ; 0 22ee4: 30 e0 ldi r19, 0x00 ; 0 22ee6: 48 e4 ldi r20, 0x48 ; 72 22ee8: 52 e4 ldi r21, 0x42 ; 66 22eea: c7 01 movw r24, r14 22eec: b6 01 movw r22, r12 22eee: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 22ef2: 2d ec ldi r18, 0xCD ; 205 22ef4: 3c ec ldi r19, 0xCC ; 204 22ef6: 4c ec ldi r20, 0xCC ; 204 22ef8: 5d e3 ldi r21, 0x3D ; 61 22efa: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 22efe: 9b 01 movw r18, r22 22f00: ac 01 movw r20, r24 22f02: c3 01 movw r24, r6 22f04: b2 01 movw r22, r4 } else if (celsius > 100) { celsius = celsius + _offset; 22f06: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 22f0a: 6b 01 movw r12, r22 22f0c: 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 } 22f0e: c7 01 movw r24, r14 22f10: b6 01 movw r22, r12 22f12: df 91 pop r29 22f14: cf 91 pop r28 22f16: 1f 91 pop r17 22f18: 0f 91 pop r16 22f1a: ff 90 pop r15 22f1c: ef 90 pop r14 22f1e: df 90 pop r13 22f20: cf 90 pop r12 22f22: bf 90 pop r11 22f24: af 90 pop r10 22f26: 7f 90 pop r7 22f28: 6f 90 pop r6 22f2a: 5f 90 pop r5 22f2c: 4f 90 pop r4 22f2e: 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) 22f30: 20 e0 ldi r18, 0x00 ; 0 22f32: 30 e0 ldi r19, 0x00 ; 0 22f34: 48 ec ldi r20, 0xC8 ; 200 22f36: 52 e4 ldi r21, 0x42 ; 66 22f38: c7 01 movw r24, r14 22f3a: b6 01 movw r22, r12 22f3c: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 22f40: 18 16 cp r1, r24 22f42: 2c f7 brge .-54 ; 0x22f0e { celsius = celsius + _offset; 22f44: 20 e0 ldi r18, 0x00 ; 0 22f46: 30 e0 ldi r19, 0x00 ; 0 22f48: 40 e2 ldi r20, 0x20 ; 32 22f4a: 51 e4 ldi r21, 0x41 ; 65 22f4c: 96 cf rjmp .-212 ; 0x22e7a 00022f4e <__vector_32>: if (pid_tuning_finished) temp_mgr_pid(); } ISR(TIMERx_COMPA_vect) { 22f4e: 1f 92 push r1 22f50: 0f 92 push r0 22f52: 0f b6 in r0, 0x3f ; 63 22f54: 0f 92 push r0 22f56: 11 24 eor r1, r1 22f58: 0b b6 in r0, 0x3b ; 59 22f5a: 0f 92 push r0 22f5c: 4f 92 push r4 22f5e: 5f 92 push r5 22f60: 6f 92 push r6 22f62: 7f 92 push r7 22f64: 8f 92 push r8 22f66: 9f 92 push r9 22f68: af 92 push r10 22f6a: bf 92 push r11 22f6c: cf 92 push r12 22f6e: df 92 push r13 22f70: ef 92 push r14 22f72: ff 92 push r15 22f74: 0f 93 push r16 22f76: 1f 93 push r17 22f78: 2f 93 push r18 22f7a: 3f 93 push r19 22f7c: 4f 93 push r20 22f7e: 5f 93 push r21 22f80: 6f 93 push r22 22f82: 7f 93 push r23 22f84: 8f 93 push r24 22f86: 9f 93 push r25 22f88: af 93 push r26 22f8a: bf 93 push r27 22f8c: cf 93 push r28 22f8e: df 93 push r29 22f90: ef 93 push r30 22f92: ff 93 push r31 // immediately schedule a new conversion if(adc_values_ready != true) return; 22f94: 80 91 63 06 lds r24, 0x0663 ; 0x800663 <_ZL16adc_values_ready.lto_priv.519> 22f98: 88 23 and r24, r24 22f9a: 09 f4 brne .+2 ; 0x22f9e <__vector_32+0x50> 22f9c: 22 c1 rjmp .+580 ; 0x231e2 <__vector_32+0x294> adc_values_ready = false; 22f9e: 10 92 63 06 sts 0x0663, r1 ; 0x800663 <_ZL16adc_values_ready.lto_priv.519> adc_start_cycle(); 22fa2: 0e 94 ed 7d call 0xfbda ; 0xfbda // run temperature management with interrupts enabled to reduce latency DISABLE_TEMP_MGR_INTERRUPT(); 22fa6: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 22faa: 8d 7f andi r24, 0xFD ; 253 22fac: 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(); 22fb0: 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 22fb6: 90 91 4a 06 lds r25, 0x064A ; 0x80064a 22fba: 0e 94 bb bd call 0x17b76 ; 0x17b76 22fbe: 4b 01 movw r8, r22 22fc0: 5c 01 movw r10, r24 22fc2: 80 92 5e 06 sts 0x065E, r8 ; 0x80065e 22fc6: 90 92 5f 06 sts 0x065F, r9 ; 0x80065f 22fca: a0 92 60 06 sts 0x0660, r10 ; 0x800660 22fce: b0 92 61 06 sts 0x0661, r11 ; 0x800661 current_temperature_bed_isr = analog2tempBed(current_temperature_bed_raw); 22fd2: 00 91 4b 06 lds r16, 0x064B ; 0x80064b 22fd6: 10 91 4c 06 lds r17, 0x064C ; 0x80064c 22fda: c8 01 movw r24, r16 22fdc: 0f 94 a4 16 call 0x22d48 ; 0x22d48 22fe0: 6b 01 movw r12, r22 22fe2: 7c 01 movw r14, r24 22fe4: c0 92 57 06 sts 0x0657, r12 ; 0x800657 22fe8: d0 92 58 06 sts 0x0658, r13 ; 0x800658 22fec: e0 92 59 06 sts 0x0659, r14 ; 0x800659 22ff0: f0 92 5a 06 sts 0x065A, r15 ; 0x80065a #ifdef PINDA_THERMISTOR current_temperature_pinda_isr = analog2tempBed(current_temperature_raw_pinda); 22ff4: 80 91 47 06 lds r24, 0x0647 ; 0x800647 22ff8: 90 91 48 06 lds r25, 0x0648 ; 0x800648 22ffc: 0f 94 a4 16 call 0x22d48 ; 0x22d48 23000: 60 93 43 06 sts 0x0643, r22 ; 0x800643 23004: 70 93 44 06 sts 0x0644, r23 ; 0x800644 23008: 80 93 45 06 sts 0x0645, r24 ; 0x800645 2300c: 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; 23010: 81 e0 ldi r24, 0x01 ; 1 23012: 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; 23016: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 2301a: 8d 7f andi r24, 0xFD ; 253 2301c: 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]) { 23020: c0 91 49 06 lds r28, 0x0649 ; 0x800649 23024: d0 91 4a 06 lds r29, 0x064A ; 0x80064a 23028: 80 91 d9 03 lds r24, 0x03D9 ; 0x8003d9 <_ZL12maxttemp_raw.lto_priv.427> 2302c: 90 91 da 03 lds r25, 0x03DA ; 0x8003da <_ZL12maxttemp_raw.lto_priv.427+0x1> 23030: 8c 17 cp r24, r28 23032: 9d 07 cpc r25, r29 23034: 2c f0 brlt .+10 ; 0x23040 <__vector_32+0xf2> #else if (current_temperature_raw[0] >= maxttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::max); 23036: 40 e0 ldi r20, 0x00 ; 0 23038: 60 e0 ldi r22, 0x00 ; 0 2303a: 80 e0 ldi r24, 0x00 ; 0 2303c: 0f 94 02 13 call 0x22604 ; 0x22604 } //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) { 23040: 80 91 d7 03 lds r24, 0x03D7 ; 0x8003d7 <_ZL16bed_maxttemp_raw.lto_priv.428> 23044: 90 91 d8 03 lds r25, 0x03D8 ; 0x8003d8 <_ZL16bed_maxttemp_raw.lto_priv.428+0x1> 23048: 80 17 cp r24, r16 2304a: 91 07 cpc r25, r17 2304c: 2c f0 brlt .+10 ; 0x23058 <__vector_32+0x10a> #else if (current_temperature_bed_raw >= bed_maxttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::max); 2304e: 40 e0 ldi r20, 0x00 ; 0 23050: 60 e0 ldi r22, 0x00 ; 0 23052: 81 e0 ldi r24, 0x01 ; 1 23054: 0f 94 02 13 call 0x22604 ; 0x22604 { // 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]) { 23058: 60 91 db 03 lds r22, 0x03DB ; 0x8003db <_ZL8minttemp.lto_priv.424> 2305c: 70 91 dc 03 lds r23, 0x03DC ; 0x8003dc <_ZL8minttemp.lto_priv.424+0x1> 23060: 80 91 5c 06 lds r24, 0x065C ; 0x80065c 23064: 90 91 5d 06 lds r25, 0x065D ; 0x80065d 23068: 68 17 cp r22, r24 2306a: 79 07 cpc r23, r25 2306c: 0c f0 brlt .+2 ; 0x23070 <__vector_32+0x122> 2306e: dc c0 rjmp .+440 ; 0x23228 <__vector_32+0x2da> // ~ nozzle heating is on bCheckingOnHeater=bCheckingOnHeater||(current_temperature_isr[active_extruder]>(minttemp[active_extruder]+TEMP_HYSTERESIS)); // for eventually delay cutting 23070: 10 91 54 06 lds r17, 0x0654 ; 0x800654 23074: 11 11 cpse r17, r1 23076: 12 c0 rjmp .+36 ; 0x2309c <__vector_32+0x14e> 23078: 6b 5f subi r22, 0xFB ; 251 2307a: 7f 4f sbci r23, 0xFF ; 255 2307c: 07 2e mov r0, r23 2307e: 00 0c add r0, r0 23080: 88 0b sbc r24, r24 23082: 99 0b sbc r25, r25 23084: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 23088: 9b 01 movw r18, r22 2308a: ac 01 movw r20, r24 2308c: 11 e0 ldi r17, 0x01 ; 1 2308e: c5 01 movw r24, r10 23090: b4 01 movw r22, r8 23092: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 23096: 18 16 cp r1, r24 23098: 0c f0 brlt .+2 ; 0x2309c <__vector_32+0x14e> 2309a: 10 e0 ldi r17, 0x00 ; 0 2309c: 10 93 54 06 sts 0x0654, r17 ; 0x800654 if(oTimer4minTempHeater.expired_cont(HEATER_MINTEMP_DELAY) || bCheckingOnHeater) { 230a0: 68 e9 ldi r22, 0x98 ; 152 230a2: 7a e3 ldi r23, 0x3A ; 58 230a4: 81 e5 ldi r24, 0x51 ; 81 230a6: 96 e0 ldi r25, 0x06 ; 6 230a8: 0f 94 57 10 call 0x220ae ; 0x220ae ::expired_cont(unsigned short)> 230ac: 81 11 cpse r24, r1 230ae: 02 c0 rjmp .+4 ; 0x230b4 <__vector_32+0x166> 230b0: 11 23 and r17, r17 230b2: 79 f0 breq .+30 ; 0x230d2 <__vector_32+0x184> bCheckingOnHeater=true; // not necessary 230b4: 81 e0 ldi r24, 0x01 ; 1 230b6: 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]) { 230ba: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL12minttemp_raw.lto_priv.426> 230be: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL12minttemp_raw.lto_priv.426+0x1> 230c2: c8 17 cp r28, r24 230c4: d9 07 cpc r29, r25 230c6: 2c f0 brlt .+10 ; 0x230d2 <__vector_32+0x184> #else if (current_temperature_raw[0] <= minttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::min); 230c8: 41 e0 ldi r20, 0x01 ; 1 230ca: 60 e0 ldi r22, 0x00 ; 0 230cc: 80 e0 ldi r24, 0x00 ; 0 230ce: 0f 94 02 13 call 0x22604 ; 0x22604 // ~ nozzle heating is off oTimer4minTempHeater.start(); bCheckingOnHeater=false; } // * bed checking if(target_temperature_bed_isr>BED_MINTEMP) { 230d2: 80 91 55 06 lds r24, 0x0655 ; 0x800655 230d6: 90 91 56 06 lds r25, 0x0656 ; 0x800656 230da: 4f 97 sbiw r24, 0x1f ; 31 230dc: 0c f4 brge .+2 ; 0x230e0 <__vector_32+0x192> 230de: ab c0 rjmp .+342 ; 0x23236 <__vector_32+0x2e8> // ~ bed heating is on bCheckingOnBed=bCheckingOnBed||(current_temperature_bed_isr>(BED_MINTEMP+TEMP_HYSTERESIS)); // for eventually delay cutting 230e0: c0 91 50 06 lds r28, 0x0650 ; 0x800650 230e4: c1 11 cpse r28, r1 230e6: 0c c0 rjmp .+24 ; 0x23100 <__vector_32+0x1b2> 230e8: c1 e0 ldi r28, 0x01 ; 1 230ea: 20 e0 ldi r18, 0x00 ; 0 230ec: 30 e0 ldi r19, 0x00 ; 0 230ee: 4c e0 ldi r20, 0x0C ; 12 230f0: 52 e4 ldi r21, 0x42 ; 66 230f2: c7 01 movw r24, r14 230f4: b6 01 movw r22, r12 230f6: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 230fa: 18 16 cp r1, r24 230fc: 0c f0 brlt .+2 ; 0x23100 <__vector_32+0x1b2> 230fe: c0 e0 ldi r28, 0x00 ; 0 23100: c0 93 50 06 sts 0x0650, r28 ; 0x800650 if(oTimer4minTempBed.expired_cont(BED_MINTEMP_DELAY) || bCheckingOnBed) { 23104: 60 e5 ldi r22, 0x50 ; 80 23106: 73 ec ldi r23, 0xC3 ; 195 23108: 8d e4 ldi r24, 0x4D ; 77 2310a: 96 e0 ldi r25, 0x06 ; 6 2310c: 0f 94 57 10 call 0x220ae ; 0x220ae ::expired_cont(unsigned short)> 23110: 81 11 cpse r24, r1 23112: 02 c0 rjmp .+4 ; 0x23118 <__vector_32+0x1ca> 23114: cc 23 and r28, r28 23116: 99 f0 breq .+38 ; 0x2313e <__vector_32+0x1f0> bCheckingOnBed=true; // not necessary 23118: 81 e0 ldi r24, 0x01 ; 1 2311a: 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) { 2311e: 20 91 4b 06 lds r18, 0x064B ; 0x80064b 23122: 30 91 4c 06 lds r19, 0x064C ; 0x80064c 23126: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.425> 2312a: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.425+0x1> 2312e: 28 17 cp r18, r24 23130: 39 07 cpc r19, r25 23132: 2c f0 brlt .+10 ; 0x2313e <__vector_32+0x1f0> #else if (current_temperature_bed_raw <= bed_minttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::min); 23134: 41 e0 ldi r20, 0x01 ; 1 23136: 60 e0 ldi r22, 0x00 ; 0 23138: 81 e0 ldi r24, 0x01 ; 1 2313a: 0f 94 02 13 call 0x22604 ; 0x22604 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); 2313e: 60 91 62 06 lds r22, 0x0662 ; 0x800662 <_ZL8soft_pwm.lto_priv.506> 23142: 70 e0 ldi r23, 0x00 ; 0 23144: 90 e0 ldi r25, 0x00 ; 0 23146: 80 e0 ldi r24, 0x00 ; 0 23148: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 2314c: 6b 01 movw r12, r22 2314e: 7c 01 movw r14, r24 23150: 40 90 5e 06 lds r4, 0x065E ; 0x80065e 23154: 50 90 5f 06 lds r5, 0x065F ; 0x80065f 23158: 60 90 60 06 lds r6, 0x0660 ; 0x800660 2315c: 70 90 61 06 lds r7, 0x0661 ; 0x800661 23160: 60 91 5c 06 lds r22, 0x065C ; 0x80065c 23164: 70 91 5d 06 lds r23, 0x065D ; 0x80065d 23168: 07 2e mov r0, r23 2316a: 00 0c add r0, r0 2316c: 88 0b sbc r24, r24 2316e: 99 0b sbc r25, r25 23170: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 23174: ab 01 movw r20, r22 23176: bc 01 movw r22, r24 23178: a1 2c mov r10, r1 2317a: 93 01 movw r18, r6 2317c: 82 01 movw r16, r4 2317e: 81 e0 ldi r24, 0x01 ; 1 23180: 0f 94 66 13 call 0x226cc ; 0x226cc #endif #ifdef TEMP_RUNAWAY_BED_HYSTERESIS temp_runaway_check(0, target_temperature_bed_isr, current_temperature_bed_isr, soft_pwm_bed, true); 23184: 60 91 5b 06 lds r22, 0x065B ; 0x80065b 23188: 70 e0 ldi r23, 0x00 ; 0 2318a: 90 e0 ldi r25, 0x00 ; 0 2318c: 80 e0 ldi r24, 0x00 ; 0 2318e: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 23192: 6b 01 movw r12, r22 23194: 7c 01 movw r14, r24 23196: 40 90 57 06 lds r4, 0x0657 ; 0x800657 2319a: 50 90 58 06 lds r5, 0x0658 ; 0x800658 2319e: 60 90 59 06 lds r6, 0x0659 ; 0x800659 231a2: 70 90 5a 06 lds r7, 0x065A ; 0x80065a 231a6: 60 91 55 06 lds r22, 0x0655 ; 0x800655 231aa: 70 91 56 06 lds r23, 0x0656 ; 0x800656 231ae: 07 2e mov r0, r23 231b0: 00 0c add r0, r0 231b2: 88 0b sbc r24, r24 231b4: 99 0b sbc r25, r25 231b6: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 231ba: ab 01 movw r20, r22 231bc: bc 01 movw r22, r24 231be: aa 24 eor r10, r10 231c0: a3 94 inc r10 231c2: 93 01 movw r18, r6 231c4: 82 01 movw r16, r4 231c6: 80 e0 ldi r24, 0x00 ; 0 231c8: 0f 94 66 13 call 0x226cc ; 0x226cc thermal_model::log_isr(); #endif #endif // PID regulation if (pid_tuning_finished) 231cc: 80 91 41 02 lds r24, 0x0241 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.423> 231d0: 81 11 cpse r24, r1 temp_mgr_pid(); 231d2: 0e 94 52 f8 call 0x1f0a4 ; 0x1f0a4 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 231d6: 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(); 231d8: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 231dc: 82 60 ori r24, 0x02 ; 2 231de: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> } 231e2: ff 91 pop r31 231e4: ef 91 pop r30 231e6: df 91 pop r29 231e8: cf 91 pop r28 231ea: bf 91 pop r27 231ec: af 91 pop r26 231ee: 9f 91 pop r25 231f0: 8f 91 pop r24 231f2: 7f 91 pop r23 231f4: 6f 91 pop r22 231f6: 5f 91 pop r21 231f8: 4f 91 pop r20 231fa: 3f 91 pop r19 231fc: 2f 91 pop r18 231fe: 1f 91 pop r17 23200: 0f 91 pop r16 23202: ff 90 pop r15 23204: ef 90 pop r14 23206: df 90 pop r13 23208: cf 90 pop r12 2320a: bf 90 pop r11 2320c: af 90 pop r10 2320e: 9f 90 pop r9 23210: 8f 90 pop r8 23212: 7f 90 pop r7 23214: 6f 90 pop r6 23216: 5f 90 pop r5 23218: 4f 90 pop r4 2321a: 0f 90 pop r0 2321c: 0b be out 0x3b, r0 ; 59 2321e: 0f 90 pop r0 23220: 0f be out 0x3f, r0 ; 63 23222: 0f 90 pop r0 23224: 1f 90 pop r1 23226: 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(); 23228: 81 e5 ldi r24, 0x51 ; 81 2322a: 96 e0 ldi r25, 0x06 ; 6 2322c: 0f 94 5e 10 call 0x220bc ; 0x220bc ::start()> bCheckingOnHeater=false; 23230: 10 92 54 06 sts 0x0654, r1 ; 0x800654 23234: 4e cf rjmp .-356 ; 0x230d2 <__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(); 23236: 8d e4 ldi r24, 0x4D ; 77 23238: 96 e0 ldi r25, 0x06 ; 6 2323a: 0f 94 5e 10 call 0x220bc ; 0x220bc ::start()> bCheckingOnBed=false; 2323e: 10 92 50 06 sts 0x0650, r1 ; 0x800650 23242: 7d cf rjmp .-262 ; 0x2313e <__vector_32+0x1f0> 00023244 : 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; 23244: 20 91 9e 04 lds r18, 0x049E ; 0x80049e 23248: 30 91 9f 04 lds r19, 0x049F ; 0x80049f 2324c: 40 91 a0 04 lds r20, 0x04A0 ; 0x8004a0 23250: 50 91 a1 04 lds r21, 0x04A1 ; 0x8004a1 23254: 60 e0 ldi r22, 0x00 ; 0 23256: 70 e0 ldi r23, 0x00 ; 0 23258: 8f e7 ldi r24, 0x7F ; 127 2325a: 93 e4 ldi r25, 0x43 ; 67 2325c: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 23260: 60 93 e6 03 sts 0x03E6, r22 ; 0x8003e6 <_ZL14iState_sum_max.lto_priv.432> 23264: 70 93 e7 03 sts 0x03E7, r23 ; 0x8003e7 <_ZL14iState_sum_max.lto_priv.432+0x1> 23268: 80 93 e8 03 sts 0x03E8, r24 ; 0x8003e8 <_ZL14iState_sum_max.lto_priv.432+0x2> 2326c: 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; 23270: 20 91 aa 04 lds r18, 0x04AA ; 0x8004aa 23274: 30 91 ab 04 lds r19, 0x04AB ; 0x8004ab 23278: 40 91 ac 04 lds r20, 0x04AC ; 0x8004ac 2327c: 50 91 ad 04 lds r21, 0x04AD ; 0x8004ad 23280: 60 e0 ldi r22, 0x00 ; 0 23282: 70 e0 ldi r23, 0x00 ; 0 23284: 8f e7 ldi r24, 0x7F ; 127 23286: 93 e4 ldi r25, 0x43 ; 67 23288: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2328c: 60 93 de 03 sts 0x03DE, r22 ; 0x8003de <_ZL19temp_iState_max_bed.lto_priv.430> 23290: 70 93 df 03 sts 0x03DF, r23 ; 0x8003df <_ZL19temp_iState_max_bed.lto_priv.430+0x1> 23294: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 <_ZL19temp_iState_max_bed.lto_priv.430+0x2> 23298: 90 93 e1 03 sts 0x03E1, r25 ; 0x8003e1 <_ZL19temp_iState_max_bed.lto_priv.430+0x3> #endif } 2329c: 08 95 ret 0002329e : #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) { 2329e: 2f 92 push r2 232a0: 3f 92 push r3 232a2: 4f 92 push r4 232a4: 5f 92 push r5 232a6: 6f 92 push r6 232a8: 7f 92 push r7 232aa: 8f 92 push r8 232ac: 9f 92 push r9 232ae: af 92 push r10 232b0: bf 92 push r11 232b2: cf 92 push r12 232b4: df 92 push r13 232b6: ef 92 push r14 232b8: ff 92 push r15 232ba: 0f 93 push r16 232bc: 1f 93 push r17 232be: cf 93 push r28 232c0: df 93 push r29 232c2: cd b7 in r28, 0x3d ; 61 232c4: de b7 in r29, 0x3e ; 62 232c6: e0 97 sbiw r28, 0x30 ; 48 232c8: 0f b6 in r0, 0x3f ; 63 232ca: f8 94 cli 232cc: de bf out 0x3e, r29 ; 62 232ce: 0f be out 0x3f, r0 ; 63 232d0: cd bf out 0x3d, r28 ; 61 232d2: 6a 87 std Y+10, r22 ; 0x0a 232d4: 7b 87 std Y+11, r23 ; 0x0b 232d6: 8c 87 std Y+12, r24 ; 0x0c 232d8: 9d 87 std Y+13, r25 ; 0x0d 232da: 1a 01 movw r2, r20 232dc: 3a a7 std Y+42, r19 ; 0x2a 232de: 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(); 232e0: 0f 94 e7 12 call 0x225ce ; 0x225ce pid_tuning_finished = false; 232e4: 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; 232e8: 29 a5 ldd r18, Y+41 ; 0x29 232ea: 3a a5 ldd r19, Y+42 ; 0x2a 232ec: 30 93 6e 06 sts 0x066E, r19 ; 0x80066e 232f0: 20 93 6d 06 sts 0x066D, r18 ; 0x80066d float input = 0.0; pid_cycle=0; 232f4: 10 92 70 06 sts 0x0670, r1 ; 0x800670 232f8: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f bool heating = true; unsigned long temp_millis = _millis(); 232fc: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 23300: 6e 83 std Y+6, r22 ; 0x06 23302: 7f 83 std Y+7, r23 ; 0x07 23304: 88 87 std Y+8, r24 ; 0x08 23306: 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 23308: 37 fe sbrs r3, 7 2330a: ff c0 rjmp .+510 ; 0x2350a 2330c: 3d e2 ldi r19, 0x2D ; 45 2330e: 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(); 23310: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 23314: 6c a3 std Y+36, r22 ; 0x24 23316: 7d a3 std Y+37, r23 ; 0x25 23318: 8e a3 std Y+38, r24 ; 0x26 2331a: 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."); 2331c: 8b ef ldi r24, 0xFB ; 251 2331e: 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) 23320: 12 14 cp r1, r2 23322: 13 04 cpc r1, r3 23324: 0c f4 brge .+2 ; 0x23328 23326: 8a c2 rjmp .+1300 ; 0x2383c pid_tuning_finished = true; pid_cycle = 0; return; } SERIAL_ECHOLNPGM("PID Autotune start"); 23328: 88 ee ldi r24, 0xE8 ; 232 2332a: 91 e9 ldi r25, 0x91 ; 145 2332c: 0e 94 49 72 call 0xe492 ; 0xe492 23330: 6a 85 ldd r22, Y+10 ; 0x0a 23332: 7b 85 ldd r23, Y+11 ; 0x0b 23334: 8c 85 ldd r24, Y+12 ; 0x0c 23336: 9d 85 ldd r25, Y+13 ; 0x0d 23338: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> if (extruder<0) { soft_pwm_bed = (MAX_BED_POWER)/2; 2333c: 2f e7 ldi r18, 0x7F ; 127 return; } SERIAL_ECHOLNPGM("PID Autotune start"); if (extruder<0) 2333e: 21 14 cp r2, r1 23340: 31 04 cpc r3, r1 23342: 09 f4 brne .+2 ; 0x23346 23344: e5 c0 rjmp .+458 ; 0x23510 { soft_pwm_bed = (MAX_BED_POWER)/2; 23346: 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 2334a: 70 93 ee 11 sts 0x11EE, r23 ; 0x8011ee 2334e: 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 23352: 8e 81 ldd r24, Y+6 ; 0x06 23354: 9f 81 ldd r25, Y+7 ; 0x07 23356: a8 85 ldd r26, Y+8 ; 0x08 23358: b9 85 ldd r27, Y+9 ; 0x09 2335a: 8e 87 std Y+14, r24 ; 0x0e 2335c: 9f 87 std Y+15, r25 ; 0x0f 2335e: a8 8b std Y+16, r26 ; 0x10 23360: b9 8b std Y+17, r27 ; 0x11 23362: 88 a3 std Y+32, r24 ; 0x20 23364: 99 a3 std Y+33, r25 ; 0x21 23366: aa a3 std Y+34, r26 ; 0x22 23368: bb a3 std Y+35, r27 ; 0x23 2336a: 1a 8a std Y+18, r1 ; 0x12 2336c: 90 e4 ldi r25, 0x40 ; 64 2336e: 9b 8b std Y+19, r25 ; 0x13 23370: ac e1 ldi r26, 0x1C ; 28 23372: ac 8b std Y+20, r26 ; 0x14 23374: b6 e4 ldi r27, 0x46 ; 70 23376: bd 8b std Y+21, r27 ; 0x15 23378: 1e 8a std Y+22, r1 ; 0x16 2337a: 1f 8a std Y+23, r1 ; 0x17 2337c: 18 8e std Y+24, r1 ; 0x18 2337e: 19 8e std Y+25, r1 ; 0x19 23380: 6f e7 ldi r22, 0x7F ; 127 23382: c6 2e mov r12, r22 23384: d1 2c mov r13, r1 23386: e1 2c mov r14, r1 23388: f1 2c mov r15, r1 2338a: 00 e0 ldi r16, 0x00 ; 0 2338c: 10 e0 ldi r17, 0x00 ; 0 2338e: 18 aa std Y+48, r1 ; 0x30 23390: 1f a6 std Y+47, r1 ; 0x2f 23392: 1d 82 std Y+5, r1 ; 0x05 23394: 2f e7 ldi r18, 0x7F ; 127 23396: 30 e0 ldi r19, 0x00 ; 0 23398: 40 e0 ldi r20, 0x00 ; 0 2339a: 50 e0 ldi r21, 0x00 ; 0 2339c: 29 83 std Y+1, r18 ; 0x01 2339e: 3a 83 std Y+2, r19 ; 0x02 233a0: 4b 83 std Y+3, r20 ; 0x03 233a2: 5c 83 std Y+4, r21 ; 0x04 233a4: 1b 8e std Y+27, r1 ; 0x1b 233a6: 1c 8e std Y+28, r1 ; 0x1c 233a8: 1d 8e std Y+29, r1 ; 0x1d 233aa: 1e 8e std Y+30, r1 ; 0x1e 233ac: 31 e0 ldi r19, 0x01 ; 1 233ae: 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(); 233b0: a8 95 wdr #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready 233b2: 40 91 42 06 lds r20, 0x0642 ; 0x800642 233b6: 48 a7 std Y+40, r20 ; 0x28 233b8: 44 23 and r20, r20 233ba: 09 f4 brne .+2 ; 0x233be 233bc: 2c c2 rjmp .+1112 ; 0x23816 updateTemperatures(); 233be: 0e 94 26 fb call 0x1f64c ; 0x1f64c input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 233c2: 21 14 cp r2, r1 233c4: 31 04 cpc r3, r1 233c6: 09 f0 breq .+2 ; 0x233ca 233c8: aa c0 rjmp .+340 ; 0x2351e 233ca: 00 91 c4 0d lds r16, 0x0DC4 ; 0x800dc4 233ce: 10 91 c5 0d lds r17, 0x0DC5 ; 0x800dc5 233d2: 50 91 c6 0d lds r21, 0x0DC6 ; 0x800dc6 233d6: 58 ab std Y+48, r21 ; 0x30 233d8: 80 91 c7 0d lds r24, 0x0DC7 ; 0x800dc7 233dc: 8f a7 std Y+47, r24 ; 0x2f max=max(max,input); 233de: 2e 89 ldd r18, Y+22 ; 0x16 233e0: 3f 89 ldd r19, Y+23 ; 0x17 233e2: 48 8d ldd r20, Y+24 ; 0x18 233e4: 59 8d ldd r21, Y+25 ; 0x19 233e6: b8 01 movw r22, r16 233e8: 88 a9 ldd r24, Y+48 ; 0x30 233ea: 9f a5 ldd r25, Y+47 ; 0x2f 233ec: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 233f0: 87 fd sbrc r24, 7 233f2: 06 c0 rjmp .+12 ; 0x23400 233f4: 0e 8b std Y+22, r16 ; 0x16 233f6: 1f 8b std Y+23, r17 ; 0x17 233f8: b8 a9 ldd r27, Y+48 ; 0x30 233fa: b8 8f std Y+24, r27 ; 0x18 233fc: 2f a5 ldd r18, Y+47 ; 0x2f 233fe: 29 8f std Y+25, r18 ; 0x19 min=min(min,input); 23400: 2a 89 ldd r18, Y+18 ; 0x12 23402: 3b 89 ldd r19, Y+19 ; 0x13 23404: 4c 89 ldd r20, Y+20 ; 0x14 23406: 5d 89 ldd r21, Y+21 ; 0x15 23408: b8 01 movw r22, r16 2340a: 88 a9 ldd r24, Y+48 ; 0x30 2340c: 9f a5 ldd r25, Y+47 ; 0x2f 2340e: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 23412: 18 16 cp r1, r24 23414: 34 f0 brlt .+12 ; 0x23422 23416: 0a 8b std Y+18, r16 ; 0x12 23418: 1b 8b std Y+19, r17 ; 0x13 2341a: 38 a9 ldd r19, Y+48 ; 0x30 2341c: 3c 8b std Y+20, r19 ; 0x14 2341e: 4f a5 ldd r20, Y+47 ; 0x2f 23420: 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) { 23422: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 23426: 2c a1 ldd r18, Y+36 ; 0x24 23428: 3d a1 ldd r19, Y+37 ; 0x25 2342a: 4e a1 ldd r20, Y+38 ; 0x26 2342c: 5f a1 ldd r21, Y+39 ; 0x27 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: 65 3c cpi r22, 0xC5 ; 197 23438: 79 40 sbci r23, 0x09 ; 9 2343a: 81 05 cpc r24, r1 2343c: 91 05 cpc r25, r1 2343e: 40 f0 brcs .+16 ; 0x23450 checkExtruderAutoFans(); 23440: 0e 94 81 6e call 0xdd02 ; 0xdd02 extruder_autofan_last_check = _millis(); 23444: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 23448: 6c a3 std Y+36, r22 ; 0x24 2344a: 7d a3 std Y+37, r23 ; 0x25 2344c: 8e a3 std Y+38, r24 ; 0x26 2344e: 9f a3 std Y+39, r25 ; 0x27 } #endif if(heating == true && input > temp) { 23450: 4a 8d ldd r20, Y+26 ; 0x1a 23452: 44 23 and r20, r20 23454: 09 f4 brne .+2 ; 0x23458 23456: 4c c0 rjmp .+152 ; 0x234f0 23458: 2a 85 ldd r18, Y+10 ; 0x0a 2345a: 3b 85 ldd r19, Y+11 ; 0x0b 2345c: 4c 85 ldd r20, Y+12 ; 0x0c 2345e: 5d 85 ldd r21, Y+13 ; 0x0d 23460: b8 01 movw r22, r16 23462: 88 a9 ldd r24, Y+48 ; 0x30 23464: 9f a5 ldd r25, Y+47 ; 0x2f 23466: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 2346a: 18 16 cp r1, r24 2346c: 0c f0 brlt .+2 ; 0x23470 2346e: d3 c1 rjmp .+934 ; 0x23816 if(_millis() - t2 > 5000) { 23470: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 23474: 2e 85 ldd r18, Y+14 ; 0x0e 23476: 3f 85 ldd r19, Y+15 ; 0x0f 23478: 48 89 ldd r20, Y+16 ; 0x10 2347a: 59 89 ldd r21, Y+17 ; 0x11 2347c: 62 1b sub r22, r18 2347e: 73 0b sbc r23, r19 23480: 84 0b sbc r24, r20 23482: 95 0b sbc r25, r21 23484: 69 38 cpi r22, 0x89 ; 137 23486: 73 41 sbci r23, 0x13 ; 19 23488: 81 05 cpc r24, r1 2348a: 91 05 cpc r25, r1 2348c: 08 f4 brcc .+2 ; 0x23490 2348e: c3 c1 rjmp .+902 ; 0x23816 23490: d7 01 movw r26, r14 23492: c6 01 movw r24, r12 23494: 29 81 ldd r18, Y+1 ; 0x01 23496: 3a 81 ldd r19, Y+2 ; 0x02 23498: 4b 81 ldd r20, Y+3 ; 0x03 2349a: 5c 81 ldd r21, Y+4 ; 0x04 2349c: 82 1b sub r24, r18 2349e: 93 0b sbc r25, r19 234a0: a4 0b sbc r26, r20 234a2: b5 0b sbc r27, r21 234a4: b5 95 asr r27 234a6: a7 95 ror r26 234a8: 97 95 ror r25 234aa: 87 95 ror r24 heating=false; if (extruder<0) { 234ac: 21 14 cp r2, r1 234ae: 31 04 cpc r3, r1 234b0: 09 f4 brne .+2 ; 0x234b4 234b2: 40 c0 rjmp .+128 ; 0x23534 soft_pwm_bed = (bias - d) >> 1; 234b4: 80 93 5b 06 sts 0x065B, r24 ; 0x80065b } else soft_pwm[extruder] = (bias - d) >> 1; t1=_millis(); 234b8: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 234bc: 6e 83 std Y+6, r22 ; 0x06 234be: 7f 83 std Y+7, r23 ; 0x07 234c0: 88 87 std Y+8, r24 ; 0x08 234c2: 99 87 std Y+9, r25 ; 0x09 t_high=t1 - t2; 234c4: dc 01 movw r26, r24 234c6: cb 01 movw r24, r22 234c8: 2e 85 ldd r18, Y+14 ; 0x0e 234ca: 3f 85 ldd r19, Y+15 ; 0x0f 234cc: 48 89 ldd r20, Y+16 ; 0x10 234ce: 59 89 ldd r21, Y+17 ; 0x11 234d0: 82 1b sub r24, r18 234d2: 93 0b sbc r25, r19 234d4: a4 0b sbc r26, r20 234d6: b5 0b sbc r27, r21 234d8: 8b 8f std Y+27, r24 ; 0x1b 234da: 9c 8f std Y+28, r25 ; 0x1c 234dc: ad 8f std Y+29, r26 ; 0x1d 234de: be 8f std Y+30, r27 ; 0x1e max=temp; 234e0: 3a 85 ldd r19, Y+10 ; 0x0a 234e2: 3e 8b std Y+22, r19 ; 0x16 234e4: 4b 85 ldd r20, Y+11 ; 0x0b 234e6: 4f 8b std Y+23, r20 ; 0x17 234e8: 5c 85 ldd r21, Y+12 ; 0x0c 234ea: 58 8f std Y+24, r21 ; 0x18 234ec: 8d 85 ldd r24, Y+13 ; 0x0d 234ee: 89 8f std Y+25, r24 ; 0x19 } } if(heating == false && input < temp) { 234f0: 2a 85 ldd r18, Y+10 ; 0x0a 234f2: 3b 85 ldd r19, Y+11 ; 0x0b 234f4: 4c 85 ldd r20, Y+12 ; 0x0c 234f6: 5d 85 ldd r21, Y+13 ; 0x0d 234f8: b8 01 movw r22, r16 234fa: 88 a9 ldd r24, Y+48 ; 0x30 234fc: 9f a5 ldd r25, Y+47 ; 0x2f 234fe: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 23502: 87 fd sbrc r24, 7 23504: 1a c0 rjmp .+52 ; 0x2353a if(_millis() - t1 > 5000) { 23506: 1a 8e std Y+26, r1 ; 0x1a 23508: 86 c1 rjmp .+780 ; 0x23816 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 2350a: 4a e0 ldi r20, 0x0A ; 10 2350c: 4f 8f std Y+31, r20 ; 0x1f 2350e: 00 cf rjmp .-512 ; 0x23310 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; 23510: 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 23514: 70 93 f2 11 sts 0x11F2, r23 ; 0x8011f2 23518: 60 93 f1 11 sts 0x11F1, r22 ; 0x8011f1 2351c: 1a cf rjmp .-460 ; 0x23352 wdt_reset(); #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready updateTemperatures(); input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 2351e: 00 91 8a 03 lds r16, 0x038A ; 0x80038a 23522: 10 91 8b 03 lds r17, 0x038B ; 0x80038b 23526: 90 91 8c 03 lds r25, 0x038C ; 0x80038c 2352a: 98 ab std Y+48, r25 ; 0x30 2352c: a0 91 8d 03 lds r26, 0x038D ; 0x80038d 23530: af a7 std Y+47, r26 ; 0x2f 23532: 55 cf rjmp .-342 ; 0x233de heating=false; if (extruder<0) { soft_pwm_bed = (bias - d) >> 1; } else soft_pwm[extruder] = (bias - d) >> 1; 23534: 80 93 62 06 sts 0x0662, r24 ; 0x800662 <_ZL8soft_pwm.lto_priv.506> 23538: bf cf rjmp .-130 ; 0x234b8 t_high=t1 - t2; max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { 2353a: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 2353e: 2e 81 ldd r18, Y+6 ; 0x06 23540: 3f 81 ldd r19, Y+7 ; 0x07 23542: 48 85 ldd r20, Y+8 ; 0x08 23544: 59 85 ldd r21, Y+9 ; 0x09 23546: 62 1b sub r22, r18 23548: 73 0b sbc r23, r19 2354a: 84 0b sbc r24, r20 2354c: 95 0b sbc r25, r21 2354e: 69 38 cpi r22, 0x89 ; 137 23550: 73 41 sbci r23, 0x13 ; 19 23552: 81 05 cpc r24, r1 23554: 91 05 cpc r25, r1 23556: b8 f2 brcs .-82 ; 0x23506 heating=true; t2=_millis(); 23558: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 2355c: 6e 87 std Y+14, r22 ; 0x0e 2355e: 7f 87 std Y+15, r23 ; 0x0f 23560: 88 8b std Y+16, r24 ; 0x10 23562: 99 8b std Y+17, r25 ; 0x11 t_low=t2 - t1; if(pid_cycle > 0) { 23564: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 23568: 90 91 70 06 lds r25, 0x0670 ; 0x800670 2356c: 18 16 cp r1, r24 2356e: 19 06 cpc r1, r25 23570: 0c f0 brlt .+2 ; 0x23574 23572: 2c c1 rjmp .+600 ; 0x237cc } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; t2=_millis(); t_low=t2 - t1; 23574: 8e 85 ldd r24, Y+14 ; 0x0e 23576: 9f 85 ldd r25, Y+15 ; 0x0f 23578: a8 89 ldd r26, Y+16 ; 0x10 2357a: b9 89 ldd r27, Y+17 ; 0x11 2357c: 2e 81 ldd r18, Y+6 ; 0x06 2357e: 3f 81 ldd r19, Y+7 ; 0x07 23580: 48 85 ldd r20, Y+8 ; 0x08 23582: 59 85 ldd r21, Y+9 ; 0x09 23584: 82 1b sub r24, r18 23586: 93 0b sbc r25, r19 23588: a4 0b sbc r26, r20 2358a: b5 0b sbc r27, r21 if(pid_cycle > 0) { bias += (d*(t_high - t_low))/(t_low + t_high); 2358c: 4b 8c ldd r4, Y+27 ; 0x1b 2358e: 5c 8c ldd r5, Y+28 ; 0x1c 23590: 6d 8c ldd r6, Y+29 ; 0x1d 23592: 7e 8c ldd r7, Y+30 ; 0x1e 23594: 48 0e add r4, r24 23596: 59 1e adc r5, r25 23598: 6a 1e adc r6, r26 2359a: 7b 1e adc r7, r27 2359c: 2b 8d ldd r18, Y+27 ; 0x1b 2359e: 3c 8d ldd r19, Y+28 ; 0x1c 235a0: 4d 8d ldd r20, Y+29 ; 0x1d 235a2: 5e 8d ldd r21, Y+30 ; 0x1e 235a4: 28 1b sub r18, r24 235a6: 39 0b sbc r19, r25 235a8: 4a 0b sbc r20, r26 235aa: 5b 0b sbc r21, r27 235ac: 69 81 ldd r22, Y+1 ; 0x01 235ae: 7a 81 ldd r23, Y+2 ; 0x02 235b0: 8b 81 ldd r24, Y+3 ; 0x03 235b2: 9c 81 ldd r25, Y+4 ; 0x04 235b4: 0f 94 fe a0 call 0x341fc ; 0x341fc <__mulsi3> 235b8: a3 01 movw r20, r6 235ba: 92 01 movw r18, r4 235bc: 0f 94 8c a1 call 0x34318 ; 0x34318 <__divmodsi4> 235c0: da 01 movw r26, r20 235c2: c9 01 movw r24, r18 235c4: 8c 0d add r24, r12 235c6: 9d 1d adc r25, r13 235c8: ae 1d adc r26, r14 235ca: bf 1d adc r27, r15 bias = constrain(bias, 20 ,(extruder<0?(MAX_BED_POWER):(PID_MAX))-20); 235cc: 84 31 cpi r24, 0x14 ; 20 235ce: 91 05 cpc r25, r1 235d0: a1 05 cpc r26, r1 235d2: b1 05 cpc r27, r1 235d4: 0c f4 brge .+2 ; 0x235d8 235d6: 3c c1 rjmp .+632 ; 0x23850 235d8: 6c 01 movw r12, r24 235da: 7d 01 movw r14, r26 235dc: 3c ee ldi r19, 0xEC ; 236 235de: c3 16 cp r12, r19 235e0: d1 04 cpc r13, r1 235e2: e1 04 cpc r14, r1 235e4: f1 04 cpc r15, r1 235e6: 2c f0 brlt .+10 ; 0x235f2 235e8: 4b ee ldi r20, 0xEB ; 235 235ea: c4 2e mov r12, r20 235ec: d1 2c mov r13, r1 235ee: e1 2c mov r14, r1 235f0: 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; 235f2: 80 38 cpi r24, 0x80 ; 128 235f4: 91 05 cpc r25, r1 235f6: a1 05 cpc r26, r1 235f8: b1 05 cpc r27, r1 235fa: 0c f4 brge .+2 ; 0x235fe 235fc: 37 c1 rjmp .+622 ; 0x2386c 235fe: 8e ef ldi r24, 0xFE ; 254 23600: 90 e0 ldi r25, 0x00 ; 0 23602: a0 e0 ldi r26, 0x00 ; 0 23604: b0 e0 ldi r27, 0x00 ; 0 23606: 8c 19 sub r24, r12 23608: 9d 09 sbc r25, r13 2360a: ae 09 sbc r26, r14 2360c: bf 09 sbc r27, r15 2360e: 89 83 std Y+1, r24 ; 0x01 23610: 9a 83 std Y+2, r25 ; 0x02 23612: ab 83 std Y+3, r26 ; 0x03 23614: bc 83 std Y+4, r27 ; 0x04 else d = bias; SERIAL_PROTOCOLPGM(" bias: "); SERIAL_PROTOCOL(bias); 23616: 80 ee ldi r24, 0xE0 ; 224 23618: 91 e9 ldi r25, 0x91 ; 145 2361a: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 2361e: c7 01 movw r24, r14 23620: b6 01 movw r22, r12 23622: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_PROTOCOLPGM(" d: "); SERIAL_PROTOCOL(d); 23626: 8b ed ldi r24, 0xDB ; 219 23628: 91 e9 ldi r25, 0x91 ; 145 2362a: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 2362e: 69 81 ldd r22, Y+1 ; 0x01 23630: 7a 81 ldd r23, Y+2 ; 0x02 23632: 8b 81 ldd r24, Y+3 ; 0x03 23634: 9c 81 ldd r25, Y+4 ; 0x04 23636: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_PROTOCOLPGM(" min: "); SERIAL_PROTOCOL(min); 2363a: 84 ed ldi r24, 0xD4 ; 212 2363c: 91 e9 ldi r25, 0x91 ; 145 2363e: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 23642: 42 e0 ldi r20, 0x02 ; 2 23644: 6a 89 ldd r22, Y+18 ; 0x12 23646: 7b 89 ldd r23, Y+19 ; 0x13 23648: 8c 89 ldd r24, Y+20 ; 0x14 2364a: 9d 89 ldd r25, Y+21 ; 0x15 2364c: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOLPGM(" max: "); SERIAL_PROTOCOLLN(max); 23650: 8d ec ldi r24, 0xCD ; 205 23652: 91 e9 ldi r25, 0x91 ; 145 23654: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 23658: 6e 89 ldd r22, Y+22 ; 0x16 2365a: 7f 89 ldd r23, Y+23 ; 0x17 2365c: 88 8d ldd r24, Y+24 ; 0x18 2365e: 99 8d ldd r25, Y+25 ; 0x19 23660: 0f 94 45 42 call 0x2848a ; 0x2848a if(pid_cycle > 2) { 23664: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 23668: 90 91 70 06 lds r25, 0x0670 ; 0x800670 2366c: 03 97 sbiw r24, 0x03 ; 3 2366e: 0c f4 brge .+2 ; 0x23672 23670: ad c0 rjmp .+346 ; 0x237cc Ku = (4.0*d)/(3.14159*(max-min)/2.0); 23672: 69 81 ldd r22, Y+1 ; 0x01 23674: 7a 81 ldd r23, Y+2 ; 0x02 23676: 8b 81 ldd r24, Y+3 ; 0x03 23678: 9c 81 ldd r25, Y+4 ; 0x04 2367a: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2367e: 20 e0 ldi r18, 0x00 ; 0 23680: 30 e0 ldi r19, 0x00 ; 0 23682: 40 e8 ldi r20, 0x80 ; 128 23684: 50 e4 ldi r21, 0x40 ; 64 23686: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2368a: 4b 01 movw r8, r22 2368c: 5c 01 movw r10, r24 2368e: 2a 89 ldd r18, Y+18 ; 0x12 23690: 3b 89 ldd r19, Y+19 ; 0x13 23692: 4c 89 ldd r20, Y+20 ; 0x14 23694: 5d 89 ldd r21, Y+21 ; 0x15 23696: 6e 89 ldd r22, Y+22 ; 0x16 23698: 7f 89 ldd r23, Y+23 ; 0x17 2369a: 88 8d ldd r24, Y+24 ; 0x18 2369c: 99 8d ldd r25, Y+25 ; 0x19 2369e: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 236a2: 20 ed ldi r18, 0xD0 ; 208 236a4: 3f e0 ldi r19, 0x0F ; 15 236a6: 49 e4 ldi r20, 0x49 ; 73 236a8: 50 e4 ldi r21, 0x40 ; 64 236aa: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 236ae: 20 e0 ldi r18, 0x00 ; 0 236b0: 30 e0 ldi r19, 0x00 ; 0 236b2: 40 e0 ldi r20, 0x00 ; 0 236b4: 5f e3 ldi r21, 0x3F ; 63 236b6: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 236ba: 9b 01 movw r18, r22 236bc: ac 01 movw r20, r24 236be: c5 01 movw r24, r10 236c0: b4 01 movw r22, r8 236c2: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 236c6: 4b 01 movw r8, r22 236c8: 5c 01 movw r10, r24 Tu = ((float)(t_low + t_high)/1000.0); 236ca: c3 01 movw r24, r6 236cc: b2 01 movw r22, r4 236ce: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 236d2: 20 e0 ldi r18, 0x00 ; 0 236d4: 30 e0 ldi r19, 0x00 ; 0 236d6: 4a e7 ldi r20, 0x7A ; 122 236d8: 54 e4 ldi r21, 0x44 ; 68 236da: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 236de: 2b 01 movw r4, r22 236e0: 3c 01 movw r6, r24 SERIAL_PROTOCOLPGM(" Ku: "); SERIAL_PROTOCOL(Ku); 236e2: 87 ec ldi r24, 0xC7 ; 199 236e4: 91 e9 ldi r25, 0x91 ; 145 236e6: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 236ea: 42 e0 ldi r20, 0x02 ; 2 236ec: c5 01 movw r24, r10 236ee: b4 01 movw r22, r8 236f0: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOLPGM(" Tu: "); SERIAL_PROTOCOLLN(Tu); 236f4: 81 ec ldi r24, 0xC1 ; 193 236f6: 91 e9 ldi r25, 0x91 ; 145 236f8: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 236fc: c3 01 movw r24, r6 236fe: b2 01 movw r22, r4 23700: 0f 94 45 42 call 0x2848a ; 0x2848a _Kp = 0.6*Ku; 23704: 2a e9 ldi r18, 0x9A ; 154 23706: 39 e9 ldi r19, 0x99 ; 153 23708: 49 e1 ldi r20, 0x19 ; 25 2370a: 5f e3 ldi r21, 0x3F ; 63 2370c: c5 01 movw r24, r10 2370e: b4 01 movw r22, r8 23710: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 23714: 4b 01 movw r8, r22 23716: 5c 01 movw r10, r24 23718: 80 92 a8 03 sts 0x03A8, r8 ; 0x8003a8 <_Kp> 2371c: 90 92 a9 03 sts 0x03A9, r9 ; 0x8003a9 <_Kp+0x1> 23720: a0 92 aa 03 sts 0x03AA, r10 ; 0x8003aa <_Kp+0x2> 23724: b0 92 ab 03 sts 0x03AB, r11 ; 0x8003ab <_Kp+0x3> _Ki = 2*_Kp/Tu; 23728: ac 01 movw r20, r24 2372a: 9b 01 movw r18, r22 2372c: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 23730: a3 01 movw r20, r6 23732: 92 01 movw r18, r4 23734: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 23738: 60 93 a4 03 sts 0x03A4, r22 ; 0x8003a4 <_Ki> 2373c: 70 93 a5 03 sts 0x03A5, r23 ; 0x8003a5 <_Ki+0x1> 23740: 80 93 a6 03 sts 0x03A6, r24 ; 0x8003a6 <_Ki+0x2> 23744: 90 93 a7 03 sts 0x03A7, r25 ; 0x8003a7 <_Ki+0x3> _Kd = _Kp*Tu/8; 23748: a3 01 movw r20, r6 2374a: 92 01 movw r18, r4 2374c: c5 01 movw r24, r10 2374e: b4 01 movw r22, r8 23750: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 23754: 20 e0 ldi r18, 0x00 ; 0 23756: 30 e0 ldi r19, 0x00 ; 0 23758: 40 e0 ldi r20, 0x00 ; 0 2375a: 5e e3 ldi r21, 0x3E ; 62 2375c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 23760: 60 93 a0 03 sts 0x03A0, r22 ; 0x8003a0 <_Kd> 23764: 70 93 a1 03 sts 0x03A1, r23 ; 0x8003a1 <_Kd+0x1> 23768: 80 93 a2 03 sts 0x03A2, r24 ; 0x8003a2 <_Kd+0x2> 2376c: 90 93 a3 03 sts 0x03A3, r25 ; 0x8003a3 <_Kd+0x3> SERIAL_PROTOCOLLNPGM(" Classic PID "); 23770: 83 eb ldi r24, 0xB3 ; 179 23772: 91 e9 ldi r25, 0x91 ; 145 23774: 0e 94 49 72 call 0xe492 ; 0xe492 SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(_Kp); 23778: 8d ea ldi r24, 0xAD ; 173 2377a: 91 e9 ldi r25, 0x91 ; 145 2377c: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 23780: 60 91 a8 03 lds r22, 0x03A8 ; 0x8003a8 <_Kp> 23784: 70 91 a9 03 lds r23, 0x03A9 ; 0x8003a9 <_Kp+0x1> 23788: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa <_Kp+0x2> 2378c: 90 91 ab 03 lds r25, 0x03AB ; 0x8003ab <_Kp+0x3> 23790: 0f 94 45 42 call 0x2848a ; 0x2848a SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); 23794: 87 ea ldi r24, 0xA7 ; 167 23796: 91 e9 ldi r25, 0x91 ; 145 23798: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 2379c: 60 91 a4 03 lds r22, 0x03A4 ; 0x8003a4 <_Ki> 237a0: 70 91 a5 03 lds r23, 0x03A5 ; 0x8003a5 <_Ki+0x1> 237a4: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 <_Ki+0x2> 237a8: 90 91 a7 03 lds r25, 0x03A7 ; 0x8003a7 <_Ki+0x3> 237ac: 0f 94 45 42 call 0x2848a ; 0x2848a SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); 237b0: 81 ea ldi r24, 0xA1 ; 161 237b2: 91 e9 ldi r25, 0x91 ; 145 237b4: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 237b8: 60 91 a0 03 lds r22, 0x03A0 ; 0x8003a0 <_Kd> 237bc: 70 91 a1 03 lds r23, 0x03A1 ; 0x8003a1 <_Kd+0x1> 237c0: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 <_Kd+0x2> 237c4: 90 91 a3 03 lds r25, 0x03A3 ; 0x8003a3 <_Kd+0x3> 237c8: 0f 94 45 42 call 0x2848a ; 0x2848a 237cc: 89 81 ldd r24, Y+1 ; 0x01 237ce: 9a 81 ldd r25, Y+2 ; 0x02 237d0: ab 81 ldd r26, Y+3 ; 0x03 237d2: bc 81 ldd r27, Y+4 ; 0x04 237d4: 8c 0d add r24, r12 237d6: 9d 1d adc r25, r13 237d8: ae 1d adc r26, r14 237da: bf 1d adc r27, r15 237dc: b5 95 asr r27 237de: a7 95 ror r26 237e0: 97 95 ror r25 237e2: 87 95 ror r24 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); */ } } if (extruder<0) 237e4: 21 14 cp r2, r1 237e6: 31 04 cpc r3, r1 237e8: 09 f4 brne .+2 ; 0x237ec 237ea: 45 c0 rjmp .+138 ; 0x23876 { soft_pwm_bed = (bias + d) >> 1; 237ec: 80 93 5b 06 sts 0x065B, r24 ; 0x80065b } else soft_pwm[extruder] = (bias + d) >> 1; pid_cycle++; 237f0: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 237f4: 90 91 70 06 lds r25, 0x0670 ; 0x800670 237f8: 01 96 adiw r24, 0x01 ; 1 237fa: 90 93 70 06 sts 0x0670, r25 ; 0x800670 237fe: 80 93 6f 06 sts 0x066F, r24 ; 0x80066f min=temp; 23802: 3a 85 ldd r19, Y+10 ; 0x0a 23804: 3a 8b std Y+18, r19 ; 0x12 23806: 4b 85 ldd r20, Y+11 ; 0x0b 23808: 4b 8b std Y+19, r20 ; 0x13 2380a: 5c 85 ldd r21, Y+12 ; 0x0c 2380c: 5c 8b std Y+20, r21 ; 0x14 2380e: 8d 85 ldd r24, Y+13 ; 0x0d 23810: 8d 8b std Y+21, r24 ; 0x15 max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; 23812: 98 a5 ldd r25, Y+40 ; 0x28 23814: 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)) { 23816: 20 e0 ldi r18, 0x00 ; 0 23818: 30 e0 ldi r19, 0x00 ; 0 2381a: 40 ea ldi r20, 0xA0 ; 160 2381c: 51 e4 ldi r21, 0x41 ; 65 2381e: 6a 85 ldd r22, Y+10 ; 0x0a 23820: 7b 85 ldd r23, Y+11 ; 0x0b 23822: 8c 85 ldd r24, Y+12 ; 0x0c 23824: 9d 85 ldd r25, Y+13 ; 0x0d 23826: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2382a: 98 01 movw r18, r16 2382c: 48 a9 ldd r20, Y+48 ; 0x30 2382e: 5f a5 ldd r21, Y+47 ; 0x2f 23830: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 23834: 87 ff sbrs r24, 7 23836: 22 c0 rjmp .+68 ; 0x2387c SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); 23838: 87 e7 ldi r24, 0x77 ; 119 2383a: 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"); 2383c: 0e 94 49 72 call 0xe492 ; 0xe492 pid_tuning_finished = true; 23840: 81 e0 ldi r24, 0x01 ; 1 23842: 80 93 41 02 sts 0x0241, r24 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.423> pid_cycle = 0; 23846: 10 92 70 06 sts 0x0670, r1 ; 0x800670 2384a: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f 2384e: 98 c0 rjmp .+304 ; 0x23980 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); 23850: 34 e1 ldi r19, 0x14 ; 20 23852: c3 2e mov r12, r19 23854: d1 2c mov r13, r1 23856: e1 2c mov r14, r1 23858: f1 2c mov r15, r1 2385a: 24 e1 ldi r18, 0x14 ; 20 2385c: 30 e0 ldi r19, 0x00 ; 0 2385e: 40 e0 ldi r20, 0x00 ; 0 23860: 50 e0 ldi r21, 0x00 ; 0 23862: 29 83 std Y+1, r18 ; 0x01 23864: 3a 83 std Y+2, r19 ; 0x02 23866: 4b 83 std Y+3, r20 ; 0x03 23868: 5c 83 std Y+4, r21 ; 0x04 2386a: d5 ce rjmp .-598 ; 0x23616 2386c: c9 82 std Y+1, r12 ; 0x01 2386e: da 82 std Y+2, r13 ; 0x02 23870: eb 82 std Y+3, r14 ; 0x03 23872: fc 82 std Y+4, r15 ; 0x04 23874: d0 ce rjmp .-608 ; 0x23616 if (extruder<0) { soft_pwm_bed = (bias + d) >> 1; } else soft_pwm[extruder] = (bias + d) >> 1; 23876: 80 93 62 06 sts 0x0662, r24 ; 0x800662 <_ZL8soft_pwm.lto_priv.506> 2387a: ba cf rjmp .-140 ; 0x237f0 SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); pid_tuning_finished = true; pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { 2387c: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 23880: 28 a1 ldd r18, Y+32 ; 0x20 23882: 39 a1 ldd r19, Y+33 ; 0x21 23884: 4a a1 ldd r20, Y+34 ; 0x22 23886: 5b a1 ldd r21, Y+35 ; 0x23 23888: 62 1b sub r22, r18 2388a: 73 0b sbc r23, r19 2388c: 84 0b sbc r24, r20 2388e: 95 0b sbc r25, r21 23890: 61 3d cpi r22, 0xD1 ; 209 23892: 77 40 sbci r23, 0x07 ; 7 23894: 81 05 cpc r24, r1 23896: 91 05 cpc r25, r1 23898: 58 f1 brcs .+86 ; 0x238f0 int p; if (extruder<0){ p=soft_pwm_bed; 2389a: a0 90 5b 06 lds r10, 0x065B ; 0x80065b 2389e: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("B:"); 238a0: 84 e7 ldi r24, 0x74 ; 116 238a2: 91 e9 ldi r25, 0x91 ; 145 pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { int p; if (extruder<0){ 238a4: 21 14 cp r2, r1 238a6: 31 04 cpc r3, r1 238a8: 29 f4 brne .+10 ; 0x238b4 p=soft_pwm_bed; SERIAL_PROTOCOLPGM("B:"); }else{ p=soft_pwm[extruder]; 238aa: a0 90 62 06 lds r10, 0x0662 ; 0x800662 <_ZL8soft_pwm.lto_priv.506> 238ae: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("T:"); 238b0: 81 e7 ldi r24, 0x71 ; 113 238b2: 91 e9 ldi r25, 0x91 ; 145 238b4: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 238b8: 42 e0 ldi r20, 0x02 ; 2 238ba: b8 01 movw r22, r16 238bc: 88 a9 ldd r24, Y+48 ; 0x30 238be: 9f a5 ldd r25, Y+47 ; 0x2f 238c0: 0f 94 08 98 call 0x33010 ; 0x33010 } SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); 238c4: 8d e6 ldi r24, 0x6D ; 109 238c6: 91 e9 ldi r25, 0x91 ; 145 238c8: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_PROTOCOLLN(p); 238cc: c5 01 movw r24, r10 238ce: 0f 94 62 42 call 0x284c4 ; 0x284c4 if (safety_check_cycles == 0) { //save ambient temp 238d2: 4d 81 ldd r20, Y+5 ; 0x05 238d4: 44 23 and r20, r20 238d6: 09 f4 brne .+2 ; 0x238da 238d8: 6c c0 rjmp .+216 ; 0x239b2 temp_ambient = input; //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; } else if (safety_check_cycles < safety_check_cycles_count) { //delay 238da: 5f 8d ldd r21, Y+31 ; 0x1f 238dc: 45 17 cp r20, r21 238de: 70 f5 brcc .+92 ; 0x2393c safety_check_cycles++; 238e0: 4f 5f subi r20, 0xFF ; 255 238e2: 4d 83 std Y+5, r20 ; 0x05 temp_runaway_stop(false, (extruder<0)); pid_tuning_finished = true; return; } } temp_millis = _millis(); 238e4: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 238e8: 68 a3 std Y+32, r22 ; 0x20 238ea: 79 a3 std Y+33, r23 ; 0x21 238ec: 8a a3 std Y+34, r24 ; 0x22 238ee: 9b a3 std Y+35, r25 ; 0x23 } if(((_millis() - t1) + (_millis() - t2)) > (10L*60L*1000L*2L)) { 238f0: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 238f4: 4b 01 movw r8, r22 238f6: 5c 01 movw r10, r24 238f8: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 238fc: 4e 80 ldd r4, Y+6 ; 0x06 238fe: 5f 80 ldd r5, Y+7 ; 0x07 23900: 68 84 ldd r6, Y+8 ; 0x08 23902: 79 84 ldd r7, Y+9 ; 0x09 23904: 2e 85 ldd r18, Y+14 ; 0x0e 23906: 3f 85 ldd r19, Y+15 ; 0x0f 23908: 48 89 ldd r20, Y+16 ; 0x10 2390a: 59 89 ldd r21, Y+17 ; 0x11 2390c: 42 0e add r4, r18 2390e: 53 1e adc r5, r19 23910: 64 1e adc r6, r20 23912: 75 1e adc r7, r21 23914: 84 18 sub r8, r4 23916: 95 08 sbc r9, r5 23918: a6 08 sbc r10, r6 2391a: b7 08 sbc r11, r7 2391c: 86 0e add r8, r22 2391e: 97 1e adc r9, r23 23920: a8 1e adc r10, r24 23922: b9 1e adc r11, r25 23924: 31 e8 ldi r19, 0x81 ; 129 23926: 83 16 cp r8, r19 23928: 3f e4 ldi r19, 0x4F ; 79 2392a: 93 06 cpc r9, r19 2392c: 32 e1 ldi r19, 0x12 ; 18 2392e: a3 06 cpc r10, r19 23930: b1 04 cpc r11, r1 23932: 08 f4 brcc .+2 ; 0x23936 23934: 47 c0 rjmp .+142 ; 0x239c4 SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); 23936: 80 e5 ldi r24, 0x50 ; 80 23938: 91 e9 ldi r25, 0x91 ; 145 2393a: 80 cf rjmp .-256 ; 0x2383c 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 2393c: 8d 81 ldd r24, Y+5 ; 0x05 2393e: 9f 8d ldd r25, Y+31 ; 0x1f 23940: 89 13 cpse r24, r25 23942: d0 cf rjmp .-96 ; 0x238e4 safety_check_cycles++; 23944: 8f 5f subi r24, 0xFF ; 255 23946: 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) { 23948: 2b a5 ldd r18, Y+43 ; 0x2b 2394a: 3c a5 ldd r19, Y+44 ; 0x2c 2394c: 4d a5 ldd r20, Y+45 ; 0x2d 2394e: 5e a5 ldd r21, Y+46 ; 0x2e 23950: b8 01 movw r22, r16 23952: 88 a9 ldd r24, Y+48 ; 0x30 23954: 9f a5 ldd r25, Y+47 ; 0x2f 23956: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 2395a: 9f 77 andi r25, 0x7F ; 127 2395c: 20 e0 ldi r18, 0x00 ; 0 2395e: 30 e0 ldi r19, 0x00 ; 0 23960: 40 ea ldi r20, 0xA0 ; 160 23962: 50 e4 ldi r21, 0x40 ; 64 23964: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 23968: 87 ff sbrs r24, 7 2396a: bc cf rjmp .-136 ; 0x238e4 temp_runaway_stop(false, (extruder<0)); 2396c: 63 2d mov r22, r3 2396e: 66 1f adc r22, r22 23970: 66 27 eor r22, r22 23972: 66 1f adc r22, r22 23974: 80 e0 ldi r24, 0x00 ; 0 23976: 0f 94 cb 09 call 0x21396 ; 0x21396 pid_tuning_finished = true; 2397a: 81 e0 ldi r24, 0x01 ; 1 2397c: 80 93 41 02 sts 0x0241, r24 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.423> pid_cycle = 0; return; } lcd_update(0); } } 23980: e0 96 adiw r28, 0x30 ; 48 23982: 0f b6 in r0, 0x3f ; 63 23984: f8 94 cli 23986: de bf out 0x3e, r29 ; 62 23988: 0f be out 0x3f, r0 ; 63 2398a: cd bf out 0x3d, r28 ; 61 2398c: df 91 pop r29 2398e: cf 91 pop r28 23990: 1f 91 pop r17 23992: 0f 91 pop r16 23994: ff 90 pop r15 23996: ef 90 pop r14 23998: df 90 pop r13 2399a: cf 90 pop r12 2399c: bf 90 pop r11 2399e: af 90 pop r10 239a0: 9f 90 pop r9 239a2: 8f 90 pop r8 239a4: 7f 90 pop r7 239a6: 6f 90 pop r6 239a8: 5f 90 pop r5 239aa: 4f 90 pop r4 239ac: 3f 90 pop r3 239ae: 2f 90 pop r2 239b0: 08 95 ret SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); SERIAL_PROTOCOLLN(p); if (safety_check_cycles == 0) { //save ambient temp temp_ambient = input; 239b2: 0b a7 std Y+43, r16 ; 0x2b 239b4: 1c a7 std Y+44, r17 ; 0x2c 239b6: a8 a9 ldd r26, Y+48 ; 0x30 239b8: ad a7 std Y+45, r26 ; 0x2d 239ba: bf a5 ldd r27, Y+47 ; 0x2f 239bc: be a7 std Y+46, r27 ; 0x2e //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; 239be: 21 e0 ldi r18, 0x01 ; 1 239c0: 2d 83 std Y+5, r18 ; 0x05 239c2: 90 cf rjmp .-224 ; 0x238e4 SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); pid_tuning_finished = true; pid_cycle = 0; return; } if(pid_cycle > ncycles) { 239c4: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 239c8: 90 91 70 06 lds r25, 0x0670 ; 0x800670 239cc: 49 a5 ldd r20, Y+41 ; 0x29 239ce: 5a a5 ldd r21, Y+42 ; 0x2a 239d0: 48 17 cp r20, r24 239d2: 59 07 cpc r21, r25 239d4: 1c f4 brge .+6 ; 0x239dc SERIAL_PROTOCOLLNPGM("PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"); 239d6: 84 ef ldi r24, 0xF4 ; 244 239d8: 90 e9 ldi r25, 0x90 ; 144 239da: 30 cf rjmp .-416 ; 0x2383c pid_tuning_finished = true; pid_cycle = 0; return; } lcd_update(0); 239dc: 80 e0 ldi r24, 0x00 ; 0 239de: 0e 94 38 69 call 0xd270 ; 0xd270 239e2: e6 cc rjmp .-1588 ; 0x233b0 000239e4 : startTimestamp = 0; stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { 239e4: 0f 93 push r16 239e6: 1f 93 push r17 return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 239e8: 80 91 59 03 lds r24, 0x0359 ; 0x800359 239ec: 81 30 cpi r24, 0x01 ; 1 239ee: 19 f5 brne .+70 ; 0x23a36 239f0: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 239f4: 00 91 e9 05 lds r16, 0x05E9 ; 0x8005e9 239f8: 10 91 ea 05 lds r17, 0x05EA ; 0x8005ea 239fc: 20 91 eb 05 lds r18, 0x05EB ; 0x8005eb 23a00: 30 91 ec 05 lds r19, 0x05EC ; 0x8005ec 23a04: 60 1b sub r22, r16 23a06: 71 0b sbc r23, r17 23a08: 82 0b sbc r24, r18 23a0a: 93 0b sbc r25, r19 23a0c: 28 ee ldi r18, 0xE8 ; 232 23a0e: 33 e0 ldi r19, 0x03 ; 3 23a10: 40 e0 ldi r20, 0x00 ; 0 23a12: 50 e0 ldi r21, 0x00 ; 0 23a14: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> 23a18: 60 91 e5 05 lds r22, 0x05E5 ; 0x8005e5 23a1c: 70 91 e6 05 lds r23, 0x05E6 ; 0x8005e6 23a20: 80 91 e7 05 lds r24, 0x05E7 ; 0x8005e7 23a24: 90 91 e8 05 lds r25, 0x05E8 ; 0x8005e8 23a28: 62 0f add r22, r18 23a2a: 73 1f adc r23, r19 23a2c: 84 1f adc r24, r20 23a2e: 95 1f adc r25, r21 } 23a30: 1f 91 pop r17 23a32: 0f 91 pop r16 23a34: 08 95 ret stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 23a36: 60 91 78 06 lds r22, 0x0678 ; 0x800678 23a3a: 70 91 79 06 lds r23, 0x0679 ; 0x800679 23a3e: 80 91 7a 06 lds r24, 0x067A ; 0x80067a 23a42: 90 91 7b 06 lds r25, 0x067B ; 0x80067b 23a46: d6 cf rjmp .-84 ; 0x239f4 00023a48 : //! |Total print time: | MSG_TOTAL_PRINT_TIME c=19 //! | 00d 00h 00m | //! ---------------------- //! @endcode void lcd_menu_statistics() { 23a48: 4f 92 push r4 23a4a: 5f 92 push r5 23a4c: 6f 92 push r6 23a4e: 7f 92 push r7 23a50: 8f 92 push r8 23a52: 9f 92 push r9 23a54: af 92 push r10 23a56: bf 92 push r11 23a58: cf 92 push r12 23a5a: df 92 push r13 23a5c: ef 92 push r14 23a5e: ff 92 push r15 23a60: 0f 93 push r16 23a62: 1f 93 push r17 23a64: cf 93 push r28 23a66: df 93 push r29 23a68: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 lcd_timeoutToStatus.stop(); //infinite timeout if (printJobOngoing()) 23a6c: 0e 94 be 60 call 0xc17c ; 0xc17c 23a70: 88 23 and r24, r24 23a72: 09 f4 brne .+2 ; 0x23a76 23a74: 6e c0 rjmp .+220 ; 0x23b52 { const float _met = ((float)total_filament_used) / (100000.f); 23a76: 60 91 84 06 lds r22, 0x0684 ; 0x800684 23a7a: 70 91 85 06 lds r23, 0x0685 ; 0x800685 23a7e: 80 91 86 06 lds r24, 0x0686 ; 0x800686 23a82: 90 91 87 06 lds r25, 0x0687 ; 0x800687 23a86: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 23a8a: 20 e0 ldi r18, 0x00 ; 0 23a8c: 30 e5 ldi r19, 0x50 ; 80 23a8e: 43 ec ldi r20, 0xC3 ; 195 23a90: 57 e4 ldi r21, 0x47 ; 71 23a92: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 23a96: 56 2e mov r5, r22 23a98: 47 2e mov r4, r23 23a9a: ec 01 movw r28, r24 const uint32_t _t = print_job_timer.duration(); 23a9c: 0f 94 f2 1c call 0x239e4 ; 0x239e4 23aa0: 6b 01 movw r12, r22 23aa2: 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(); 23aa4: 0e 94 9d 69 call 0xd33a ; 0xd33a lcd_printf_P(_N( 23aa8: 83 e1 ldi r24, 0x13 ; 19 23aaa: 9b e4 ldi r25, 0x4B ; 75 23aac: 0e 94 a7 6c call 0xd94e ; 0xd94e 23ab0: 18 2f mov r17, r24 23ab2: 09 2f mov r16, r25 23ab4: 83 e0 ldi r24, 0x03 ; 3 23ab6: 9b e4 ldi r25, 0x4B ; 75 23ab8: 0e 94 a7 6c call 0xd94e ; 0xd94e 23abc: 78 2e mov r7, r24 23abe: 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; 23ac0: 8c e3 ldi r24, 0x3C ; 60 23ac2: 88 2e mov r8, r24 23ac4: 91 2c mov r9, r1 23ac6: a1 2c mov r10, r1 23ac8: b1 2c mov r11, r1 23aca: c7 01 movw r24, r14 23acc: b6 01 movw r22, r12 23ace: a5 01 movw r20, r10 23ad0: 94 01 movw r18, r8 23ad2: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 23ad6: 7f 93 push r23 23ad8: 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; 23ada: ca 01 movw r24, r20 23adc: b9 01 movw r22, r18 23ade: a5 01 movw r20, r10 23ae0: 94 01 movw r18, r8 23ae2: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 23ae6: 7f 93 push r23 23ae8: 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; 23aea: c7 01 movw r24, r14 23aec: b6 01 movw r22, r12 23aee: 20 e1 ldi r18, 0x10 ; 16 23af0: 3e e0 ldi r19, 0x0E ; 14 23af2: 40 e0 ldi r20, 0x00 ; 0 23af4: 50 e0 ldi r21, 0x00 ; 0 23af6: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> const uint8_t _m = (_t / 60) % 60; const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 23afa: 5f 93 push r21 23afc: 4f 93 push r20 23afe: 3f 93 push r19 23b00: 2f 93 push r18 23b02: 0f 93 push r16 23b04: 1f 93 push r17 23b06: df 93 push r29 23b08: cf 93 push r28 23b0a: 4f 92 push r4 23b0c: 5f 92 push r5 23b0e: 6f 92 push r6 23b10: 7f 92 push r7 23b12: 8c eb ldi r24, 0xBC ; 188 23b14: 9a e6 ldi r25, 0x6A ; 106 23b16: 9f 93 push r25 23b18: 8f 93 push r24 23b1a: 0e 94 4a 69 call 0xd294 ; 0xd294 "%S:\n" "%10ldh %02dm %02ds" ), _T(MSG_FILAMENT_USED), _met, _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); 23b1e: 8d b7 in r24, 0x3d ; 61 23b20: 9e b7 in r25, 0x3e ; 62 23b22: 42 96 adiw r24, 0x12 ; 18 23b24: 0f b6 in r0, 0x3f ; 63 23b26: f8 94 cli 23b28: 9e bf out 0x3e, r25 ; 62 23b2a: 0f be out 0x3f, r0 ; 63 23b2c: 8d bf out 0x3d, r24 ; 61 ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); } } 23b2e: df 91 pop r29 23b30: cf 91 pop r28 23b32: 1f 91 pop r17 23b34: 0f 91 pop r16 23b36: ff 90 pop r15 23b38: ef 90 pop r14 23b3a: df 90 pop r13 23b3c: cf 90 pop r12 23b3e: bf 90 pop r11 23b40: af 90 pop r10 23b42: 9f 90 pop r9 23b44: 8f 90 pop r8 23b46: 7f 90 pop r7 23b48: 6f 90 pop r6 23b4a: 5f 90 pop r5 23b4c: 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(); 23b4e: 0d 94 e5 96 jmp 0x32dca ; 0x32dca _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); } else { uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in centimeters 23b52: 81 ef ldi r24, 0xF1 ; 241 23b54: 9f e0 ldi r25, 0x0F ; 15 23b56: 0f 94 a3 a0 call 0x34146 ; 0x34146 23b5a: 2b 01 movw r4, r22 23b5c: 3c 01 movw r6, r24 uint32_t _time = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); // in minutes 23b5e: 8d ee ldi r24, 0xED ; 237 23b60: 9f e0 ldi r25, 0x0F ; 15 23b62: 0f 94 a3 a0 call 0x34146 ; 0x34146 23b66: 6b 01 movw r12, r22 23b68: 7c 01 movw r14, r24 float _filament_m = (float)_filament/100; _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); 23b6a: 0e 94 9d 69 call 0xd33a ; 0xd33a lcd_printf_P(_N( 23b6e: 80 ef ldi r24, 0xF0 ; 240 23b70: 9a e4 ldi r25, 0x4A ; 74 23b72: 0e 94 a7 6c call 0xd94e ; 0xd94e 23b76: 98 2e mov r9, r24 23b78: 89 2e mov r8, r25 23b7a: 8f ed ldi r24, 0xDF ; 223 23b7c: 9a e4 ldi r25, 0x4A ; 74 23b7e: 0e 94 a7 6c call 0xd94e ; 0xd94e 23b82: b8 2e mov r11, r24 23b84: 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; 23b86: c7 01 movw r24, r14 23b88: b6 01 movw r22, r12 23b8a: 2c e3 ldi r18, 0x3C ; 60 23b8c: 30 e0 ldi r19, 0x00 ; 0 23b8e: 40 e0 ldi r20, 0x00 ; 0 23b90: 50 e0 ldi r21, 0x00 ; 0 23b92: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 23b96: 7f 93 push r23 23b98: 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; 23b9a: ca 01 movw r24, r20 23b9c: b9 01 movw r22, r18 23b9e: 28 e1 ldi r18, 0x18 ; 24 23ba0: 30 e0 ldi r19, 0x00 ; 0 23ba2: 40 e0 ldi r20, 0x00 ; 0 23ba4: 50 e0 ldi r21, 0x00 ; 0 23ba6: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 23baa: 7f 93 push r23 23bac: 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; 23bae: c7 01 movw r24, r14 23bb0: b6 01 movw r22, r12 23bb2: 20 ea ldi r18, 0xA0 ; 160 23bb4: 35 e0 ldi r19, 0x05 ; 5 23bb6: 40 e0 ldi r20, 0x00 ; 0 23bb8: 50 e0 ldi r21, 0x00 ; 0 23bba: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 23bbe: 5f 93 push r21 23bc0: 4f 93 push r20 23bc2: 3f 93 push r19 23bc4: 2f 93 push r18 23bc6: 8f 92 push r8 23bc8: 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; 23bca: c3 01 movw r24, r6 23bcc: b2 01 movw r22, r4 23bce: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 23bd2: 20 e0 ldi r18, 0x00 ; 0 23bd4: 30 e0 ldi r19, 0x00 ; 0 23bd6: 48 ec ldi r20, 0xC8 ; 200 23bd8: 52 e4 ldi r21, 0x42 ; 66 23bda: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 23bde: 9f 93 push r25 23be0: 8f 93 push r24 23be2: 7f 93 push r23 23be4: 6f 93 push r22 23be6: af 92 push r10 23be8: bf 92 push r11 23bea: 88 e9 ldi r24, 0x98 ; 152 23bec: 9a e6 ldi r25, 0x6A ; 106 23bee: 9f 93 push r25 23bf0: 8f 93 push r24 23bf2: 0e 94 4a 69 call 0xd294 ; 0xd294 "%S:\n" "%10ldd %02dh %02dm" ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); 23bf6: 8d b7 in r24, 0x3d ; 61 23bf8: 9e b7 in r25, 0x3e ; 62 23bfa: 42 96 adiw r24, 0x12 ; 18 23bfc: 0f b6 in r0, 0x3f ; 63 23bfe: f8 94 cli 23c00: 9e bf out 0x3e, r25 ; 62 23c02: 0f be out 0x3f, r0 ; 63 23c04: 8d bf out 0x3d, r24 ; 61 23c06: 93 cf rjmp .-218 ; 0x23b2e 00023c08 : 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()") { 23c08: cf 92 push r12 23c0a: df 92 push r13 23c0c: ef 92 push r14 23c0e: ff 92 push r15 23c10: 0f 93 push r16 23c12: 1f 93 push r17 23c14: cf 93 push r28 23c16: df 93 push r29 23c18: 00 d0 rcall .+0 ; 0x23c1a 23c1a: 00 d0 rcall .+0 ; 0x23c1c 23c1c: 1f 92 push r1 23c1e: 1f 92 push r1 23c20: cd b7 in r28, 0x3d ; 61 23c22: de b7 in r29, 0x3e ; 62 static uint8_t lcd_status_update_delay = 0; #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) 23c24: 80 91 06 05 lds r24, 0x0506 ; 0x800506 23c28: 90 91 07 05 lds r25, 0x0507 ; 0x800507 23c2c: 00 97 sbiw r24, 0x00 ; 0 23c2e: e1 f1 breq .+120 ; 0x23ca8 { const int16_t initial_feedmultiply = feedmultiply; 23c30: 20 91 8e 02 lds r18, 0x028E ; 0x80028e 23c34: 30 91 8f 02 lds r19, 0x028F ; 0x80028f // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 23c38: 24 36 cpi r18, 0x64 ; 100 23c3a: 31 05 cpc r19, r1 23c3c: 4c f4 brge .+18 ; 0x23c50 23c3e: ac 01 movw r20, r24 23c40: 42 0f add r20, r18 23c42: 53 1f adc r21, r19 23c44: 45 36 cpi r20, 0x65 ; 101 23c46: 51 05 cpc r21, r1 23c48: 6c f4 brge .+26 ; 0x23c64 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; 23c4a: 82 0f add r24, r18 23c4c: 93 1f adc r25, r19 23c4e: 0c c0 rjmp .+24 ; 0x23c68 #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) { const int16_t initial_feedmultiply = feedmultiply; // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 23c50: 24 36 cpi r18, 0x64 ; 100 23c52: 31 05 cpc r19, r1 23c54: 09 f4 brne .+2 ; 0x23c58 23c56: 55 c0 rjmp .+170 ; 0x23d02 (feedmultiply > 100 && (feedmultiply + lcd_encoder) < 100)) 23c58: ac 01 movw r20, r24 23c5a: 42 0f add r20, r18 23c5c: 53 1f adc r21, r19 23c5e: 44 36 cpi r20, 0x64 ; 100 23c60: 51 05 cpc r21, r1 23c62: 9c f7 brge .-26 ; 0x23c4a { feedmultiply = 100; 23c64: 84 e6 ldi r24, 0x64 ; 100 23c66: 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; 23c68: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 23c6c: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e if (initial_feedmultiply != feedmultiply) { 23c70: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 23c74: 90 91 8f 02 lds r25, 0x028F ; 0x80028f 23c78: 82 17 cp r24, r18 23c7a: 93 07 cpc r25, r19 23c7c: a9 f0 breq .+42 ; 0x23ca8 feedmultiply = constrain(feedmultiply, 10, 999); 23c7e: 88 3e cpi r24, 0xE8 ; 232 23c80: 53 e0 ldi r21, 0x03 ; 3 23c82: 95 07 cpc r25, r21 23c84: 14 f0 brlt .+4 ; 0x23c8a 23c86: 87 ee ldi r24, 0xE7 ; 231 23c88: 93 e0 ldi r25, 0x03 ; 3 23c8a: 8a 30 cpi r24, 0x0A ; 10 23c8c: 91 05 cpc r25, r1 23c8e: 14 f4 brge .+4 ; 0x23c94 23c90: 8a e0 ldi r24, 0x0A ; 10 23c92: 90 e0 ldi r25, 0x00 ; 0 23c94: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 23c98: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e lcd_encoder = 0; // Consume rotation event 23c9c: 10 92 07 05 sts 0x0507, r1 ; 0x800507 23ca0: 10 92 06 05 sts 0x0506, r1 ; 0x800506 refresh_saved_feedrate_multiplier_in_ram(); 23ca4: 0e 94 bb 5e call 0xbd76 ; 0xbd76 } } #endif //ULTIPANEL_FEEDMULTIPLY if (lcd_draw_update) { 23ca8: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 23cac: 81 11 cpse r24, r1 // Update the status screen immediately lcd_status_update_delay = 0; 23cae: 10 92 77 06 sts 0x0677, r1 ; 0x800677 } if (lcd_status_update_delay) 23cb2: 10 91 77 06 lds r17, 0x0677 ; 0x800677 23cb6: 11 23 and r17, r17 23cb8: 91 f1 breq .+100 ; 0x23d1e lcd_status_update_delay--; 23cba: 2f ef ldi r18, 0xFF ; 255 23cbc: 21 0f add r18, r17 23cbe: 20 93 77 06 sts 0x0677, r18 ; 0x800677 if (lcd_commands_type != LcdCommands::Idle) lcd_commands(); } if (!menu_is_any_block() && lcd_clicked()) { 23cc2: 80 91 cd 11 lds r24, 0x11CD ; 0x8011cd 23cc6: 81 11 cpse r24, r1 23cc8: 0d c0 rjmp .+26 ; 0x23ce4 23cca: 0e 94 8e 6b call 0xd71c ; 0xd71c 23cce: 88 23 and r24, r24 23cd0: 49 f0 breq .+18 ; 0x23ce4 menu_depth = 0; //redundant, as already done in lcd_return_to_status(), just to be sure 23cd2: 10 92 ad 03 sts 0x03AD, r1 ; 0x8003ad menu_submenu(lcd_main_menu); 23cd6: 60 e0 ldi r22, 0x00 ; 0 23cd8: 8f ef ldi r24, 0xFF ; 255 23cda: 93 ec ldi r25, 0xC3 ; 195 23cdc: 0f 94 e8 94 call 0x329d0 ; 0x329d0 lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 23ce0: 0e 94 1d 6a call 0xd43a ; 0xd43a } } 23ce4: 28 96 adiw r28, 0x08 ; 8 23ce6: 0f b6 in r0, 0x3f ; 63 23ce8: f8 94 cli 23cea: de bf out 0x3e, r29 ; 62 23cec: 0f be out 0x3f, r0 ; 63 23cee: cd bf out 0x3d, r28 ; 61 23cf0: df 91 pop r29 23cf2: cf 91 pop r28 23cf4: 1f 91 pop r17 23cf6: 0f 91 pop r16 23cf8: ff 90 pop r15 23cfa: ef 90 pop r14 23cfc: df 90 pop r13 23cfe: cf 90 pop r12 23d00: 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) { 23d02: 8b 30 cpi r24, 0x0B ; 11 23d04: 91 05 cpc r25, r1 23d06: 1c f0 brlt .+6 ; 0x23d0e feedmultiply += lcd_encoder - ENCODER_FEEDRATE_DEADZONE; 23d08: 86 5a subi r24, 0xA6 ; 166 23d0a: 9f 4f sbci r25, 0xFF ; 255 23d0c: ad cf rjmp .-166 ; 0x23c68 } else if (feedmultiply == 100 && lcd_encoder < -ENCODER_FEEDRATE_DEADZONE) { 23d0e: 86 3f cpi r24, 0xF6 ; 246 23d10: 4f ef ldi r20, 0xFF ; 255 23d12: 94 07 cpc r25, r20 23d14: 0c f0 brlt .+2 ; 0x23d18 23d16: ac cf rjmp .-168 ; 0x23c70 feedmultiply += lcd_encoder + ENCODER_FEEDRATE_DEADZONE; 23d18: 82 59 subi r24, 0x92 ; 146 23d1a: 9f 4f sbci r25, 0xFF ; 255 23d1c: a5 cf rjmp .-182 ; 0x23c68 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; 23d1e: 6a e0 ldi r22, 0x0A ; 10 23d20: 60 93 77 06 sts 0x0677, r22 ; 0x800677 ReInitLCD++; 23d24: 80 91 76 06 lds r24, 0x0676 ; 0x800676 23d28: 8f 5f subi r24, 0xFF ; 255 23d2a: 80 93 76 06 sts 0x0676, r24 ; 0x800676 if (ReInitLCD == 30) 23d2e: 8e 31 cpi r24, 0x1E ; 30 23d30: 09 f0 breq .+2 ; 0x23d34 23d32: 9f c0 rjmp .+318 ; 0x23e72 { ReInitLCD = 0 ; 23d34: 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(); 23d38: 0e 94 1d 6a call 0xd43a ; 0xd43a lcd_status_message_idx = 0; // Re-draw message from beginning 23d3c: 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(); 23d40: 0e 94 25 69 call 0xd24a ; 0xd24a lcd_home(); //line 0 23d44: 0e 94 9d 69 call 0xd33a ; 0xd33a return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 23d48: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 23d4c: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 23d50: 07 2e mov r0, r23 23d52: 00 0c add r0, r0 23d54: 88 0b sbc r24, r24 23d56: 99 0b sbc r25, r25 23d58: 0f 94 29 9b call 0x33652 ; 0x33652 <__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)); 23d5c: 20 e0 ldi r18, 0x00 ; 0 23d5e: 30 e0 ldi r19, 0x00 ; 0 23d60: 40 e0 ldi r20, 0x00 ; 0 23d62: 5f e3 ldi r21, 0x3F ; 63 23d64: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 23d68: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 23d6c: 6b 01 movw r12, r22 23d6e: 20 e0 ldi r18, 0x00 ; 0 23d70: 30 e0 ldi r19, 0x00 ; 0 23d72: 40 e0 ldi r20, 0x00 ; 0 23d74: 5f e3 ldi r21, 0x3F ; 63 23d76: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 23d7a: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 23d7e: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 23d82: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 23d86: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 23d8a: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 23d8e: a6 01 movw r20, r12 23d90: 82 e8 ldi r24, 0x82 ; 130 23d92: 0f 94 19 07 call 0x20e32 ; 0x20e32 lcd_space(3); //3 spaces 23d96: 83 e0 ldi r24, 0x03 ; 3 23d98: 0e 94 67 69 call 0xd2ce ; 0xd2ce } // Print Z-coordinate (8 chars total) void lcdui_print_Z_coord(void) { if (custom_message_type == CustomMsg::MeshBedLeveling) 23d9c: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 23da0: 81 30 cpi r24, 0x01 ; 1 23da2: 09 f0 breq .+2 ; 0x23da6 23da4: 6e c0 rjmp .+220 ; 0x23e82 lcd_puts_P(_N("Z --- ")); 23da6: 85 ee ldi r24, 0xE5 ; 229 23da8: 99 e6 ldi r25, 0x69 ; 105 23daa: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 lcd_space(3); //3 spaces //Print Z-coordinate (8 chars total) lcdui_print_Z_coord(); lcd_set_cursor(0, 1); //line 1 23dae: 61 e0 ldi r22, 0x01 ; 1 23db0: 80 e0 ldi r24, 0x00 ; 0 23db2: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 23db6: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 23dba: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee 23dbe: 07 2e mov r0, r23 23dc0: 00 0c add r0, r0 23dc2: 88 0b sbc r24, r24 23dc4: 99 0b sbc r25, r25 23dc6: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> //Print the Bed temperature (9 chars total) lcdui_print_temp(LCD_STR_BEDTEMP[0], (int)(degBed() + 0.5), (int)(degTargetBed() + 0.5)); 23dca: 20 e0 ldi r18, 0x00 ; 0 23dcc: 30 e0 ldi r19, 0x00 ; 0 23dce: 40 e0 ldi r20, 0x00 ; 0 23dd0: 5f e3 ldi r21, 0x3F ; 63 23dd2: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 23dd6: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 23dda: 6b 01 movw r12, r22 23ddc: 20 e0 ldi r18, 0x00 ; 0 23dde: 30 e0 ldi r19, 0x00 ; 0 23de0: 40 e0 ldi r20, 0x00 ; 0 23de2: 5f e3 ldi r21, 0x3F ; 63 23de4: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 23de8: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 23dec: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 23df0: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 23df4: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 23df8: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 23dfc: a6 01 movw r20, r12 23dfe: 80 e8 ldi r24, 0x80 ; 128 23e00: 0f 94 19 07 call 0x20e32 ; 0x20e32 lcd_space(3); //3 spaces 23e04: 83 e0 ldi r24, 0x03 ; 3 23e06: 0e 94 67 69 call 0xd2ce ; 0xd2ce #endif // PLANNER_DIAGNOSTICS // Print feedrate (8 chars total) void lcdui_print_feedrate(void) { int chars = lcd_printf_P(_N(LCD_STR_FEEDRATE "%3d%%"), feedmultiply); 23e0a: 80 91 8f 02 lds r24, 0x028F ; 0x80028f 23e0e: 8f 93 push r24 23e10: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 23e14: 8f 93 push r24 23e16: 8e ee ldi r24, 0xEE ; 238 23e18: 99 e6 ldi r25, 0x69 ; 105 23e1a: 9f 93 push r25 23e1c: 8f 93 push r24 23e1e: 0e 94 4a 69 call 0xd294 ; 0xd294 lcd_space(8 - chars); 23e22: 98 e0 ldi r25, 0x08 ; 8 23e24: 98 1b sub r25, r24 23e26: 89 2f mov r24, r25 23e28: 0e 94 67 69 call 0xd2ce ; 0xd2ce #else // PLANNER_DIAGNOSTICS //Print Feedrate (8 chars) lcdui_print_feedrate(); #endif // PLANNER_DIAGNOSTICS lcd_set_cursor(0, 2); //line 2 23e2c: 62 e0 ldi r22, 0x02 ; 2 23e2e: 80 e0 ldi r24, 0x00 ; 0 23e30: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 } // 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(" ")); 23e34: 0f 90 pop r0 23e36: 0f 90 pop r0 23e38: 0f 90 pop r0 23e3a: 0f 90 pop r0 23e3c: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 23e40: e0 90 6a 13 lds r14, 0x136A ; 0x80136a 23e44: 81 11 cpse r24, r1 23e46: 3e c0 rjmp .+124 ; 0x23ec4 23e48: 21 e0 ldi r18, 0x01 ; 1 23e4a: c2 2e mov r12, r18 23e4c: 2a e6 ldi r18, 0x6A ; 106 23e4e: d2 2e mov r13, r18 23e50: e1 10 cpse r14, r1 23e52: 3c c0 rjmp .+120 ; 0x23ecc 23e54: 85 e0 ldi r24, 0x05 ; 5 23e56: c8 2e mov r12, r24 23e58: 8a e6 ldi r24, 0x6A ; 106 23e5a: d8 2e mov r13, r24 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 23e5c: 0e 94 0f 61 call 0xc21e ; 0xc21e 23e60: f8 2e mov r15, r24 23e62: 88 23 and r24, r24 23e64: d9 f1 breq .+118 ; 0x23edc 23e66: 80 91 71 02 lds r24, 0x0271 ; 0x800271 23e6a: 8f 3f cpi r24, 0xFF ; 255 23e6c: 89 f5 brne .+98 ; 0x23ed0 23e6e: f1 2c mov r15, r1 23e70: 35 c0 rjmp .+106 ; 0x23edc ReInitLCD = 0 ; lcdui_refresh(); } else { if ((ReInitLCD % 10) == 0) 23e72: 0f 94 56 a1 call 0x342ac ; 0x342ac <__divmodqi4> 23e76: 91 11 cpse r25, r1 23e78: 63 cf rjmp .-314 ; 0x23d40 lcd_begin(1); } void lcd_refresh_noclear(void) { lcd_begin(0); 23e7a: 80 e0 ldi r24, 0x00 ; 0 23e7c: 0e 94 dc 69 call 0xd3b8 ; 0xd3b8 23e80: 5d cf rjmp .-326 ; 0x23d3c 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]?' ':'?'); 23e82: 80 91 a5 06 lds r24, 0x06A5 ; 0x8006a5 23e86: 88 23 and r24, r24 23e88: d9 f0 breq .+54 ; 0x23ec0 23e8a: 80 e2 ldi r24, 0x20 ; 32 23e8c: 1f 92 push r1 23e8e: 8f 93 push r24 23e90: 80 91 00 12 lds r24, 0x1200 ; 0x801200 23e94: 8f 93 push r24 23e96: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 23e9a: 8f 93 push r24 23e9c: 80 91 fe 11 lds r24, 0x11FE ; 0x8011fe 23ea0: 8f 93 push r24 23ea2: 80 91 fd 11 lds r24, 0x11FD ; 0x8011fd 23ea6: 8f 93 push r24 23ea8: 8c ed ldi r24, 0xDC ; 220 23eaa: 99 e6 ldi r25, 0x69 ; 105 23eac: 9f 93 push r25 23eae: 8f 93 push r24 23eb0: 0e 94 4a 69 call 0xd294 ; 0xd294 23eb4: 0f b6 in r0, 0x3f ; 63 23eb6: f8 94 cli 23eb8: de bf out 0x3e, r29 ; 62 23eba: 0f be out 0x3f, r0 ; 63 23ebc: cd bf out 0x3d, r28 ; 61 23ebe: 77 cf rjmp .-274 ; 0x23dae 23ec0: 8f e3 ldi r24, 0x3F ; 63 23ec2: e4 cf rjmp .-56 ; 0x23e8c } // 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(" ")); 23ec4: 99 e0 ldi r25, 0x09 ; 9 23ec6: c9 2e mov r12, r25 23ec8: 9a e6 ldi r25, 0x6A ; 106 23eca: d9 2e mov r13, r25 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 23ecc: ee 20 and r14, r14 23ece: 31 f2 breq .-116 ; 0x23e5c if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 23ed0: 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)); 23ed4: ff 24 eor r15, r15 23ed6: f3 94 inc r15 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 23ed8: 88 23 and r24, r24 23eda: 99 f1 breq .+102 ; 0x23f42 { const int8_t sheetNR = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 23edc: 81 ea ldi r24, 0xA1 ; 161 23ede: 9d e0 ldi r25, 0x0D ; 13 23ee0: 0f 94 9b a0 call 0x34136 ; 0x34136 23ee4: 08 2f mov r16, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheetNR); 23ee6: 0e 94 1c 6f call 0xde38 ; 0xde38 if ((nextSheet >= 0) && (sheetNR != nextSheet)) 23eea: 87 fd sbrc r24, 7 23eec: 2a c0 rjmp .+84 ; 0x23f42 23eee: 08 17 cp r16, r24 23ef0: 41 f1 breq .+80 ; 0x23f42 { char sheet[8]; eeprom_read_block(sheet, EEPROM_Sheets_base->s[sheetNR].name, 7); 23ef2: 9b e0 ldi r25, 0x0B ; 11 23ef4: 09 02 muls r16, r25 23ef6: b0 01 movw r22, r0 23ef8: 11 24 eor r1, r1 23efa: 67 5b subi r22, 0xB7 ; 183 23efc: 72 4f sbci r23, 0xF2 ; 242 23efe: 47 e0 ldi r20, 0x07 ; 7 23f00: 50 e0 ldi r21, 0x00 ; 0 23f02: 8e 01 movw r16, r28 23f04: 0f 5f subi r16, 0xFF ; 255 23f06: 1f 4f sbci r17, 0xFF ; 255 23f08: c8 01 movw r24, r16 23f0a: 0f 94 8b a0 call 0x34116 ; 0x34116 sheet[7] = '\0'; 23f0e: 18 86 std Y+8, r1 ; 0x08 lcd_printf_P(PSTR("%-7s"),sheet); 23f10: 1f 93 push r17 23f12: 0f 93 push r16 23f14: 89 ec ldi r24, 0xC9 ; 201 23f16: 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()); 23f18: 9f 93 push r25 23f1a: 8f 93 push r24 23f1c: 0e 94 4a 69 call 0xd294 ; 0xd294 23f20: 0f 90 pop r0 23f22: 0f 90 pop r0 23f24: 0f 90 pop r0 23f26: 0f 90 pop r0 lcd_set_cursor(0, 2); //line 2 //Print SD status (7 chars) lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { 23f28: 80 91 94 12 lds r24, 0x1294 ; 0x801294 23f2c: 81 30 cpi r24, 0x01 ; 1 23f2e: 09 f0 breq .+2 ; 0x23f32 23f30: 5a c0 rjmp .+180 ; 0x23fe6 // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); 23f32: 0f 94 56 0d call 0x21aac ; 0x21aac 23f36: 95 e0 ldi r25, 0x05 ; 5 23f38: 98 1b sub r25, r24 23f3a: 89 2f mov r24, r25 } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 23f3c: 0e 94 67 69 call 0xd2ce ; 0xd2ce 23f40: 5f c0 rjmp .+190 ; 0x24000 lcd_printf_P(PSTR("%-7s"),sheet); return; //do not also print the percentage } } if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) 23f42: e1 10 cpse r14, r1 23f44: 04 c0 rjmp .+8 ; 0x23f4e 23f46: 80 91 5a 03 lds r24, 0x035A ; 0x80035a <_ZL9M79_timer.lto_priv.419> 23f4a: 81 11 cpse r24, r1 23f4c: 42 c0 rjmp .+132 ; 0x23fd2 // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); 23f4e: df 92 push r13 23f50: cf 92 push r12 23f52: 85 ec ldi r24, 0xC5 ; 197 23f54: 94 e9 ldi r25, 0x94 ; 148 23f56: 9f 93 push r25 23f58: 8f 93 push r24 23f5a: 0e 94 4a 69 call 0xd294 ; 0xd294 23f5e: 0f 90 pop r0 23f60: 0f 90 pop r0 23f62: 0f 90 pop r0 23f64: 0f 90 pop r0 else if (print_percent_done_silent <= 100) { percent_done = print_percent_done_silent; } #else if (print_percent_done_normal <= 100) 23f66: 80 91 71 02 lds r24, 0x0271 ; 0x800271 23f6a: 85 36 cpi r24, 0x65 ; 101 23f6c: d0 f1 brcs .+116 ; 0x23fe2 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;}; 23f6e: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 23f72: 88 23 and r24, r24 23f74: 19 f1 breq .+70 ; 0x23fbc 23f76: 80 91 77 16 lds r24, 0x1677 ; 0x801677 23f7a: 90 91 78 16 lds r25, 0x1678 ; 0x801678 23f7e: a0 91 79 16 lds r26, 0x1679 ; 0x801679 23f82: b0 91 7a 16 lds r27, 0x167A ; 0x80167a 23f86: 00 97 sbiw r24, 0x00 ; 0 23f88: a1 05 cpc r26, r1 23f8a: b1 05 cpc r27, r1 23f8c: b9 f0 breq .+46 ; 0x23fbc 23f8e: bc 01 movw r22, r24 23f90: cd 01 movw r24, r26 23f92: 6d 59 subi r22, 0x9D ; 157 23f94: 7f 4f sbci r23, 0xFF ; 255 23f96: 8f 4f sbci r24, 0xFF ; 255 23f98: 9f 4f sbci r25, 0xFF ; 255 23f9a: 24 e6 ldi r18, 0x64 ; 100 23f9c: 30 e0 ldi r19, 0x00 ; 0 23f9e: 40 e0 ldi r20, 0x00 ; 0 23fa0: 50 e0 ldi r21, 0x00 ; 0 23fa2: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> 23fa6: 60 91 7e 16 lds r22, 0x167E ; 0x80167e 23faa: 70 91 7f 16 lds r23, 0x167F ; 0x80167f 23fae: 80 91 80 16 lds r24, 0x1680 ; 0x801680 23fb2: 90 91 81 16 lds r25, 0x1681 ; 0x801681 23fb6: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> 23fba: 12 2f mov r17, r18 } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 23fbc: 21 2f mov r18, r17 23fbe: 30 e0 ldi r19, 0x00 ; 0 23fc0: 8b ef ldi r24, 0xFB ; 251 23fc2: 99 e6 ldi r25, 0x69 ; 105 23fc4: f1 10 cpse r15, r1 23fc6: 02 c0 rjmp .+4 ; 0x23fcc 23fc8: 85 ef ldi r24, 0xF5 ; 245 23fca: 99 e6 ldi r25, 0x69 ; 105 23fcc: 3f 93 push r19 23fce: 2f 93 push r18 23fd0: a3 cf rjmp .-186 ; 0x23f18 if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) { // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space 23fd2: 81 e0 ldi r24, 0x01 ; 1 23fd4: 0e 94 67 69 call 0xd2ce ; 0xd2ce lcd_print(hostName); // Two characters 23fd8: 82 e7 ldi r24, 0x72 ; 114 23fda: 96 e0 ldi r25, 0x06 ; 6 23fdc: 0e 94 78 6b call 0xd6f0 ; 0xd6f0 23fe0: c2 cf rjmp .-124 ; 0x23f66 23fe2: 18 2f mov r17, r24 23fe4: eb cf rjmp .-42 ; 0x23fbc lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { 23fe6: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 23fea: 88 23 and r24, r24 23fec: 09 f4 brne .+2 ; 0x23ff0 23fee: a5 c0 rjmp .+330 ; 0x2413a } // Print farm number (5 chars total) static void lcdui_print_farm(void) { lcd_printf_P(_N(" FRM ")); 23ff0: 8d e0 ldi r24, 0x0D ; 13 23ff2: 9a e6 ldi r25, 0x6A ; 106 23ff4: 9f 93 push r25 23ff6: 8f 93 push r24 23ff8: 0e 94 4a 69 call 0xd294 ; 0xd294 23ffc: 0f 90 pop r0 23ffe: 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()) { 24000: 0e 94 0f 61 call 0xc21e ; 0xc21e 24004: 88 23 and r24, r24 24006: 09 f4 brne .+2 ; 0x2400a 24008: ac c0 rjmp .+344 ; 0x24162 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) 2400a: c0 90 74 02 lds r12, 0x0274 ; 0x800274 2400e: 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) 24012: e0 90 72 02 lds r14, 0x0272 ; 0x800272 24016: f0 90 73 02 lds r15, 0x0273 ; 0x800273 #ifdef TMC2130 } #endif //TMC2130 //#ifdef CLOCK_INTERVAL_TIME if (clock_interval == CLOCK_INTERVAL_TIME*2) 2401a: 80 91 75 06 lds r24, 0x0675 ; 0x800675 2401e: 8a 30 cpi r24, 0x0A ; 10 24020: 11 f4 brne .+4 ; 0x24026 clock_interval = 0; 24022: 10 92 75 06 sts 0x0675, r1 ; 0x800675 clock_interval++; 24026: 80 91 75 06 lds r24, 0x0675 ; 0x800675 2402a: 8f 5f subi r24, 0xFF ; 255 2402c: 80 93 75 06 sts 0x0675, r24 ; 0x800675 if (print_tc != PRINT_TIME_REMAINING_INIT && clock_interval > CLOCK_INTERVAL_TIME) { 24030: 2f ef ldi r18, 0xFF ; 255 24032: e2 16 cp r14, r18 24034: f2 06 cpc r15, r18 24036: 21 f0 breq .+8 ; 0x24040 24038: 97 01 movw r18, r14 print_t = print_tc; suff = 'C'; 2403a: 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) { 2403c: 86 30 cpi r24, 0x06 ; 6 2403e: 70 f4 brcc .+28 ; 0x2405c print_t = print_tc; suff = 'C'; } else //#endif //CLOCK_INTERVAL_TIME if (print_tr != PRINT_TIME_REMAINING_INIT) { 24040: 3f ef ldi r19, 0xFF ; 255 24042: c3 16 cp r12, r19 24044: d3 06 cpc r13, r19 24046: 09 f0 breq .+2 ; 0x2404a 24048: 7a c0 rjmp .+244 ; 0x2413e print_t = print_tr; suff = 'R'; } else print_t = print_job_timer.duration() / 60; 2404a: 0f 94 f2 1c call 0x239e4 ; 0x239e4 2404e: 2c e3 ldi r18, 0x3C ; 60 24050: 30 e0 ldi r19, 0x00 ; 0 24052: 40 e0 ldi r20, 0x00 ; 0 24054: 50 e0 ldi r21, 0x00 ; 0 24056: 0f 94 0e a1 call 0x3421c ; 0x3421c <__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 = ' '; 2405a: 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)) { 2405c: 40 91 8e 02 lds r20, 0x028E ; 0x80028e 24060: 50 91 8f 02 lds r21, 0x028F ; 0x80028f 24064: 44 36 cpi r20, 0x64 ; 100 24066: 51 05 cpc r21, r1 24068: 09 f4 brne .+2 ; 0x2406c 2406a: 6c c0 rjmp .+216 ; 0x24144 2406c: c2 16 cp r12, r18 2406e: d3 06 cpc r13, r19 24070: 21 f0 breq .+8 ; 0x2407a 24072: e2 16 cp r14, r18 24074: f3 06 cpc r15, r19 24076: 09 f0 breq .+2 ; 0x2407a 24078: 65 c0 rjmp .+202 ; 0x24144 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); 2407a: a4 e6 ldi r26, 0x64 ; 100 2407c: b0 e0 ldi r27, 0x00 ; 0 2407e: 0f 94 3b a1 call 0x34276 ; 0x34276 <__umulhisi3> 24082: 9a 01 movw r18, r20 24084: 55 0f add r21, r21 24086: 44 0b sbc r20, r20 24088: 55 0b sbc r21, r21 2408a: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> suff = 'R'; } else print_t = print_job_timer.duration() / 60; if (feedmultiply != 100 && (print_t == print_tr || print_t == print_tc)) { suff_doubt = '?'; 2408e: 4f e3 ldi r20, 0x3F ; 63 24090: e4 2e mov r14, r20 24092: 04 2e mov r0, r20 24094: 00 0c add r0, r0 24096: ff 08 sbc r15, r15 24098: e1 2f mov r30, r17 2409a: 01 2e mov r0, r17 2409c: 00 0c add r0, r0 2409e: ff 0b sbc r31, r31 240a0: c9 01 movw r24, r18 240a2: 6c e3 ldi r22, 0x3C ; 60 240a4: 70 e0 ldi r23, 0x00 ; 0 240a6: 0f 94 64 a1 call 0x342c8 ; 0x342c8 <__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 240aa: 20 37 cpi r18, 0x70 ; 112 240ac: 37 41 sbci r19, 0x17 ; 23 240ae: 08 f0 brcs .+2 ; 0x240b2 240b0: 4b c0 rjmp .+150 ; 0x24148 chars = lcd_printf_P(_N(LCD_STR_CLOCK "%02u:%02u%c%c"), print_t / 60, print_t % 60, suff, suff_doubt); 240b2: ff 92 push r15 240b4: 4f 93 push r20 240b6: ff 93 push r31 240b8: 1f 93 push r17 240ba: 9f 93 push r25 240bc: 8f 93 push r24 240be: 7f 93 push r23 240c0: 6f 93 push r22 240c2: 87 e2 ldi r24, 0x27 ; 39 240c4: 9a e6 ldi r25, 0x6A ; 106 240c6: 9f 93 push r25 240c8: 8f 93 push r24 240ca: 0e 94 4a 69 call 0xd294 ; 0xd294 else //time>=100h chars = lcd_printf_P(_N(LCD_STR_CLOCK "%3uh %c%c"), print_t / 60, suff, suff_doubt); 240ce: 0f b6 in r0, 0x3f ; 63 240d0: f8 94 cli 240d2: de bf out 0x3e, r29 ; 62 240d4: 0f be out 0x3f, r0 ; 63 240d6: 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); 240d8: 98 e0 ldi r25, 0x08 ; 8 240da: 98 1b sub r25, r24 240dc: 89 2f mov r24, r25 240de: 0e 94 67 69 call 0xd2ce ; 0xd2ce #else //Print time (8chars) lcdui_print_time(); #endif //CMD_DIAGNOSTICS lcd_set_cursor(0, 3); //line 3 240e2: 63 e0 ldi r22, 0x03 ; 3 240e4: 80 e0 ldi r24, 0x00 ; 0 240e6: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 #ifndef DEBUG_DISABLE_LCD_STATUS_LINE lcdui_print_status_line(); 240ea: 0f 94 ad 10 call 0x2215a ; 0x2215a } SERIAL_ECHOLN('}'); } void prusa_statistics_update_from_status_screen() { if (farm_mode) { 240ee: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 240f2: 88 23 and r24, r24 240f4: b1 f0 breq .+44 ; 0x24122 farm_timer--; 240f6: 80 91 76 02 lds r24, 0x0276 ; 0x800276 <_ZL10farm_timer.lto_priv.447> 240fa: 81 50 subi r24, 0x01 ; 1 if (farm_timer < 1) { 240fc: d9 f1 breq .+118 ; 0x24174 SERIAL_ECHOLN('}'); } void prusa_statistics_update_from_status_screen() { if (farm_mode) { farm_timer--; 240fe: 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) { 24102: 80 91 76 02 lds r24, 0x0276 ; 0x800276 <_ZL10farm_timer.lto_priv.447> 24106: 85 30 cpi r24, 0x05 ; 5 24108: e1 f1 breq .+120 ; 0x24182 2410a: 88 30 cpi r24, 0x08 ; 8 2410c: 51 f4 brne .+20 ; 0x24122 case 8: prusa_statistics(21); 2410e: 85 e1 ldi r24, 0x15 ; 21 24110: 0f 94 be 98 call 0x3317c ; 0x3317c if(eFilamentAction != FilamentAction::None) 24114: 80 91 62 03 lds r24, 0x0362 ; 0x800362 24118: 88 23 and r24, r24 2411a: 19 f0 breq .+6 ; 0x24122 prusa_statistics(22); 2411c: 86 e1 ldi r24, 0x16 ; 22 break; case 5: if (IS_SD_PRINTING) prusa_statistics(20); 2411e: 0f 94 be 98 call 0x3317c ; 0x3317c lcdui_print_status_screen(); prusa_statistics_update_from_status_screen(); if (lcd_commands_type != LcdCommands::Idle) 24122: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 24126: 88 23 and r24, r24 24128: 09 f4 brne .+2 ; 0x2412c 2412a: cb cd rjmp .-1130 ; 0x23cc2 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) { 2412c: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 24130: 81 11 cpse r24, r1 24132: c7 cd rjmp .-1138 ; 0x23cc2 24134: 0e 94 aa e6 call 0x1cd54 ; 0x1cd54 24138: c4 cd rjmp .-1144 ; 0x23cc2 lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 2413a: 85 e0 ldi r24, 0x05 ; 5 2413c: ff ce rjmp .-514 ; 0x23f3c 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) { 2413e: 96 01 movw r18, r12 print_t = print_tr; suff = 'R'; 24140: 12 e5 ldi r17, 0x52 ; 82 24142: 8c cf rjmp .-232 ; 0x2405c 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 = ' '; 24144: 40 e2 ldi r20, 0x20 ; 32 24146: a4 cf rjmp .-184 ; 0x24090 } 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); 24148: ff 92 push r15 2414a: 4f 93 push r20 2414c: ff 93 push r31 2414e: 1f 93 push r17 24150: 7f 93 push r23 24152: 6f 93 push r22 24154: 8c e1 ldi r24, 0x1C ; 28 24156: 9a e6 ldi r25, 0x6A ; 106 24158: 9f 93 push r25 2415a: 8f 93 push r24 2415c: 0e 94 4a 69 call 0xd294 ; 0xd294 24160: b6 cf rjmp .-148 ; 0x240ce } 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 "--:-- ")); 24162: 83 e1 ldi r24, 0x13 ; 19 24164: 9a e6 ldi r25, 0x6A ; 106 24166: 9f 93 push r25 24168: 8f 93 push r24 2416a: 0e 94 4a 69 call 0xd294 ; 0xd294 2416e: 0f 90 pop r0 24170: 0f 90 pop r0 24172: b2 cf rjmp .-156 ; 0x240d8 void prusa_statistics_update_from_status_screen() { if (farm_mode) { farm_timer--; if (farm_timer < 1) { farm_timer = 10; 24174: 8a e0 ldi r24, 0x0A ; 10 24176: 80 93 76 02 sts 0x0276, r24 ; 0x800276 <_ZL10farm_timer.lto_priv.447> prusa_statistics(0); 2417a: 80 e0 ldi r24, 0x00 ; 0 2417c: 0f 94 be 98 call 0x3317c ; 0x3317c 24180: c0 cf rjmp .-128 ; 0x24102 prusa_statistics(21); if(eFilamentAction != FilamentAction::None) prusa_statistics(22); break; case 5: if (IS_SD_PRINTING) 24182: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 24186: 88 23 and r24, r24 24188: 61 f2 breq .-104 ; 0x24122 prusa_statistics(20); 2418a: 84 e1 ldi r24, 0x14 ; 20 2418c: c8 cf rjmp .-112 ; 0x2411e 0002418e : reset(); if ((accumulator = with_time)) state = RUNNING; } void Stopwatch::reset() { state = STOPPED; 2418e: 10 92 59 03 sts 0x0359, r1 ; 0x800359 startTimestamp = 0; 24192: 10 92 e9 05 sts 0x05E9, r1 ; 0x8005e9 24196: 10 92 ea 05 sts 0x05EA, r1 ; 0x8005ea 2419a: 10 92 eb 05 sts 0x05EB, r1 ; 0x8005eb 2419e: 10 92 ec 05 sts 0x05EC, r1 ; 0x8005ec stopTimestamp = 0; 241a2: 10 92 78 06 sts 0x0678, r1 ; 0x800678 241a6: 10 92 79 06 sts 0x0679, r1 ; 0x800679 241aa: 10 92 7a 06 sts 0x067A, r1 ; 0x80067a 241ae: 10 92 7b 06 sts 0x067B, r1 ; 0x80067b accumulator = 0; 241b2: 10 92 e5 05 sts 0x05E5, r1 ; 0x8005e5 241b6: 10 92 e6 05 sts 0x05E6, r1 ; 0x8005e6 241ba: 10 92 e7 05 sts 0x05E7, r1 ; 0x8005e7 241be: 10 92 e8 05 sts 0x05E8, r1 ; 0x8005e8 } 241c2: 08 95 ret 000241c4 : /** * @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; } 241c4: 80 91 59 03 lds r24, 0x0359 ; 0x800359 } else return false; } bool Stopwatch::start() { if (!isRunning()) { 241c8: 81 30 cpi r24, 0x01 ; 1 241ca: f1 f0 breq .+60 ; 0x24208 if (isPaused()) accumulator = duration(); 241cc: 82 30 cpi r24, 0x02 ; 2 241ce: c9 f4 brne .+50 ; 0x24202 241d0: 0f 94 f2 1c call 0x239e4 ; 0x239e4 241d4: 60 93 e5 05 sts 0x05E5, r22 ; 0x8005e5 241d8: 70 93 e6 05 sts 0x05E6, r23 ; 0x8005e6 241dc: 80 93 e7 05 sts 0x05E7, r24 ; 0x8005e7 241e0: 90 93 e8 05 sts 0x05E8, r25 ; 0x8005e8 else reset(); state = RUNNING; 241e4: 81 e0 ldi r24, 0x01 ; 1 241e6: 80 93 59 03 sts 0x0359, r24 ; 0x800359 startTimestamp = _millis(); 241ea: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 241ee: 60 93 e9 05 sts 0x05E9, r22 ; 0x8005e9 241f2: 70 93 ea 05 sts 0x05EA, r23 ; 0x8005ea 241f6: 80 93 eb 05 sts 0x05EB, r24 ; 0x8005eb 241fa: 90 93 ec 05 sts 0x05EC, r25 ; 0x8005ec 241fe: 81 e0 ldi r24, 0x01 ; 1 24200: 08 95 ret } bool Stopwatch::start() { if (!isRunning()) { if (isPaused()) accumulator = duration(); else reset(); 24202: 0f 94 c7 20 call 0x2418e ; 0x2418e 24206: ee cf rjmp .-36 ; 0x241e4 state = RUNNING; startTimestamp = _millis(); return true; } else return false; 24208: 80 e0 ldi r24, 0x00 ; 0 } 2420a: 08 95 ret 0002420c : uint32_t Stopwatch::accumulator; uint32_t Stopwatch::startTimestamp; uint32_t Stopwatch::stopTimestamp; bool Stopwatch::stop() { if (isRunning() || isPaused()) { 2420c: 80 91 59 03 lds r24, 0x0359 ; 0x800359 24210: 81 50 subi r24, 0x01 ; 1 24212: 82 30 cpi r24, 0x02 ; 2 24214: 70 f4 brcc .+28 ; 0x24232 state = STOPPED; 24216: 10 92 59 03 sts 0x0359, r1 ; 0x800359 stopTimestamp = _millis(); 2421a: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 2421e: 60 93 78 06 sts 0x0678, r22 ; 0x800678 24222: 70 93 79 06 sts 0x0679, r23 ; 0x800679 24226: 80 93 7a 06 sts 0x067A, r24 ; 0x80067a 2422a: 90 93 7b 06 sts 0x067B, r25 ; 0x80067b 2422e: 81 e0 ldi r24, 0x01 ; 1 24230: 08 95 ret return true; } else return false; 24232: 80 e0 ldi r24, 0x00 ; 0 } 24234: 08 95 ret 00024236 : #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); 24236: 2f ef ldi r18, 0xFF ; 255 24238: 30 e0 ldi r19, 0x00 ; 0 2423a: dc 01 movw r26, r24 2423c: 0f 94 bb a1 call 0x34376 ; 0x34376 <__usmulhisi3> 24240: 20 ed ldi r18, 0xD0 ; 208 24242: 37 e0 ldi r19, 0x07 ; 7 24244: 40 e0 ldi r20, 0x00 ; 0 24246: 50 e0 ldi r21, 0x00 ; 0 24248: 0f 94 8c a1 call 0x34318 ; 0x34318 <__divmodsi4> 2424c: b9 01 movw r22, r18 2424e: 8c e2 ldi r24, 0x2C ; 44 24250: 0c 94 6e c0 jmp 0x180dc ; 0x180dc 00024254 : case 16: microstep_ms(driver,MICROSTEP16); break; } } void microstep_readings() { 24254: cf 93 push r28 24256: df 93 push r29 SERIAL_PROTOCOLLNPGM("MS1,MS2 Pins"); 24258: 87 ee ldi r24, 0xE7 ; 231 2425a: 90 e9 ldi r25, 0x90 ; 144 2425c: 0e 94 49 72 call 0xe492 ; 0xe492 SERIAL_PROTOCOLPGM("X: "); 24260: 83 ee ldi r24, 0xE3 ; 227 24262: 90 e9 ldi r25, 0x90 ; 144 24264: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_PROTOCOL( READ(X_MS1_PIN)); 24268: 62 b3 in r22, 0x12 ; 18 2426a: 66 95 lsr r22 2426c: 61 70 andi r22, 0x01 ; 1 2426e: 70 e0 ldi r23, 0x00 ; 0 24270: 90 e0 ldi r25, 0x00 ; 0 24272: 80 e0 ldi r24, 0x00 ; 0 24274: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_PROTOCOLLN( READ(X_MS2_PIN)); 24278: 82 b3 in r24, 0x12 ; 18 2427a: 81 70 andi r24, 0x01 ; 1 2427c: 90 e0 ldi r25, 0x00 ; 0 2427e: 0f 94 62 42 call 0x284c4 ; 0x284c4 SERIAL_PROTOCOLPGM("Y: "); 24282: 8f ed ldi r24, 0xDF ; 223 24284: 90 e9 ldi r25, 0x90 ; 144 24286: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_PROTOCOL( READ(Y_MS1_PIN)); 2428a: c6 e0 ldi r28, 0x06 ; 6 2428c: d1 e0 ldi r29, 0x01 ; 1 2428e: 68 81 ld r22, Y 24290: 06 2e mov r0, r22 24292: 00 0c add r0, r0 24294: 77 0b sbc r23, r23 24296: 88 0b sbc r24, r24 24298: 99 0b sbc r25, r25 2429a: 66 27 eor r22, r22 2429c: 97 fd sbrc r25, 7 2429e: 63 95 inc r22 242a0: 77 27 eor r23, r23 242a2: 88 27 eor r24, r24 242a4: 99 27 eor r25, r25 242a6: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_PROTOCOLLN( READ(Y_MS2_PIN)); 242aa: 82 b3 in r24, 0x12 ; 18 242ac: 82 fb bst r24, 2 242ae: 88 27 eor r24, r24 242b0: 80 f9 bld r24, 0 242b2: 90 e0 ldi r25, 0x00 ; 0 242b4: 0f 94 62 42 call 0x284c4 ; 0x284c4 SERIAL_PROTOCOLPGM("Z: "); 242b8: 8b ed ldi r24, 0xDB ; 219 242ba: 90 e9 ldi r25, 0x90 ; 144 242bc: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_PROTOCOL( READ(Z_MS1_PIN)); 242c0: 68 81 ld r22, Y 242c2: 66 fb bst r22, 6 242c4: 66 27 eor r22, r22 242c6: 60 f9 bld r22, 0 242c8: 70 e0 ldi r23, 0x00 ; 0 242ca: 90 e0 ldi r25, 0x00 ; 0 242cc: 80 e0 ldi r24, 0x00 ; 0 242ce: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_PROTOCOLLN( READ(Z_MS2_PIN)); 242d2: 88 81 ld r24, Y 242d4: 85 fb bst r24, 5 242d6: 88 27 eor r24, r24 242d8: 80 f9 bld r24, 0 242da: 90 e0 ldi r25, 0x00 ; 0 242dc: 0f 94 62 42 call 0x284c4 ; 0x284c4 SERIAL_PROTOCOLPGM("E0: "); 242e0: 86 ed ldi r24, 0xD6 ; 214 242e2: 90 e9 ldi r25, 0x90 ; 144 242e4: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_PROTOCOL( READ(E0_MS1_PIN)); 242e8: 68 81 ld r22, Y 242ea: 63 fb bst r22, 3 242ec: 66 27 eor r22, r22 242ee: 60 f9 bld r22, 0 242f0: 70 e0 ldi r23, 0x00 ; 0 242f2: 90 e0 ldi r25, 0x00 ; 0 242f4: 80 e0 ldi r24, 0x00 ; 0 242f6: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_PROTOCOLLN( READ(E0_MS2_PIN)); 242fa: 88 81 ld r24, Y 242fc: 82 95 swap r24 242fe: 81 70 andi r24, 0x01 ; 1 24300: 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 } 24302: df 91 pop r29 24304: 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)); 24306: 0d 94 62 42 jmp 0x284c4 ; 0x284c4 0002430a : #endif } void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2) { if(ms1 > -1) switch(driver) 2430a: 67 fd sbrc r22, 7 2430c: 08 c0 rjmp .+16 ; 0x2431e 2430e: 81 30 cpi r24, 0x01 ; 1 24310: 21 f1 breq .+72 ; 0x2435a 24312: d8 f0 brcs .+54 ; 0x2434a 24314: 82 30 cpi r24, 0x02 ; 2 24316: 99 f1 breq .+102 ; 0x2437e 24318: 83 30 cpi r24, 0x03 ; 3 2431a: 09 f4 brne .+2 ; 0x2431e 2431c: 42 c0 rjmp .+132 ; 0x243a2 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) 2431e: 47 fd sbrc r20, 7 24320: 4c c0 rjmp .+152 ; 0x243ba 24322: 81 30 cpi r24, 0x01 ; 1 24324: 09 f4 brne .+2 ; 0x24328 24326: 55 c0 rjmp .+170 ; 0x243d2 24328: 08 f4 brcc .+2 ; 0x2432c 2432a: 4d c0 rjmp .+154 ; 0x243c6 2432c: 82 30 cpi r24, 0x02 ; 2 2432e: 09 f4 brne .+2 ; 0x24332 24330: 56 c0 rjmp .+172 ; 0x243de 24332: 83 30 cpi r24, 0x03 ; 3 24334: 09 f0 breq .+2 ; 0x24338 24336: 41 c0 rjmp .+130 ; 0x243ba { 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; 24338: 9f b7 in r25, 0x3f ; 63 2433a: 44 23 and r20, r20 2433c: 09 f4 brne .+2 ; 0x24340 2433e: 5f c0 rjmp .+190 ; 0x243fe 24340: f8 94 cli 24342: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24346: 80 61 ori r24, 0x10 ; 16 24348: 51 c0 rjmp .+162 ; 0x243ec 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; 2434a: 66 23 and r22, r22 2434c: 21 f0 breq .+8 ; 0x24356 2434e: 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) 24350: 47 ff sbrs r20, 7 24352: 39 c0 rjmp .+114 ; 0x243c6 24354: 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; 24356: a1 98 cbi 0x14, 1 ; 20 24358: fb cf rjmp .-10 ; 0x24350 case 1: WRITE( Y_MS1_PIN,ms1); break; 2435a: 9f b7 in r25, 0x3f ; 63 2435c: 66 23 and r22, r22 2435e: 51 f0 breq .+20 ; 0x24374 24360: f8 94 cli 24362: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24366: 80 68 ori r24, 0x80 ; 128 24368: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2436c: 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) 2436e: 47 ff sbrs r20, 7 24370: 30 c0 rjmp .+96 ; 0x243d2 24372: 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; 24374: f8 94 cli 24376: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2437a: 8f 77 andi r24, 0x7F ; 127 2437c: f5 cf rjmp .-22 ; 0x24368 case 2: WRITE( Z_MS1_PIN,ms1); break; 2437e: 9f b7 in r25, 0x3f ; 63 24380: 66 23 and r22, r22 24382: 51 f0 breq .+20 ; 0x24398 24384: f8 94 cli 24386: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2438a: 80 64 ori r24, 0x40 ; 64 2438c: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24390: 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) 24392: 47 ff sbrs r20, 7 24394: 24 c0 rjmp .+72 ; 0x243de 24396: 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; 24398: f8 94 cli 2439a: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2439e: 8f 7b andi r24, 0xBF ; 191 243a0: f5 cf rjmp .-22 ; 0x2438c case 3: WRITE(E0_MS1_PIN,ms1); break; 243a2: 9f b7 in r25, 0x3f ; 63 243a4: 66 23 and r22, r22 243a6: 51 f0 breq .+20 ; 0x243bc 243a8: f8 94 cli 243aa: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 243ae: 88 60 ori r24, 0x08 ; 8 243b0: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 243b4: 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) 243b6: 47 ff sbrs r20, 7 243b8: bf cf rjmp .-130 ; 0x24338 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 } } 243ba: 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; 243bc: f8 94 cli 243be: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 243c2: 87 7f andi r24, 0xF7 ; 247 243c4: f5 cf rjmp .-22 ; 0x243b0 case 4: WRITE(E1_MS1_PIN,ms1); break; #endif } if(ms2 > -1) switch(driver) { case 0: WRITE( X_MS2_PIN,ms2); break; 243c6: 44 23 and r20, r20 243c8: 11 f0 breq .+4 ; 0x243ce 243ca: a0 9a sbi 0x14, 0 ; 20 243cc: 08 95 ret 243ce: a0 98 cbi 0x14, 0 ; 20 243d0: 08 95 ret case 1: WRITE( Y_MS2_PIN,ms2); break; 243d2: 44 23 and r20, r20 243d4: 11 f0 breq .+4 ; 0x243da 243d6: a2 9a sbi 0x14, 2 ; 20 243d8: 08 95 ret 243da: a2 98 cbi 0x14, 2 ; 20 243dc: 08 95 ret case 2: WRITE( Z_MS2_PIN,ms2); break; 243de: 9f b7 in r25, 0x3f ; 63 243e0: 44 23 and r20, r20 243e2: 41 f0 breq .+16 ; 0x243f4 243e4: f8 94 cli 243e6: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 243ea: 80 62 ori r24, 0x20 ; 32 243ec: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 243f0: 9f bf out 0x3f, r25 ; 63 243f2: 08 95 ret 243f4: f8 94 cli 243f6: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 243fa: 8f 7d andi r24, 0xDF ; 223 243fc: f7 cf rjmp .-18 ; 0x243ec case 3: WRITE(E0_MS2_PIN,ms2); break; 243fe: f8 94 cli 24400: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24404: 8f 7e andi r24, 0xEF ; 239 24406: f2 cf rjmp .-28 ; 0x243ec 00024408 : } } void microstep_mode(uint8_t driver, uint8_t stepping_mode) { switch(stepping_mode) 24408: 64 30 cpi r22, 0x04 ; 4 2440a: 81 f0 breq .+32 ; 0x2442c 2440c: 30 f4 brcc .+12 ; 0x2441a 2440e: 61 30 cpi r22, 0x01 ; 1 24410: 49 f0 breq .+18 ; 0x24424 { case 1: microstep_ms(driver,MICROSTEP1); break; case 2: microstep_ms(driver,MICROSTEP2); break; 24412: 40 e0 ldi r20, 0x00 ; 0 } } void microstep_mode(uint8_t driver, uint8_t stepping_mode) { switch(stepping_mode) 24414: 62 30 cpi r22, 0x02 ; 2 24416: 69 f0 breq .+26 ; 0x24432 24418: 08 95 ret 2441a: 68 30 cpi r22, 0x08 ; 8 2441c: 49 f0 breq .+18 ; 0x24430 2441e: 60 31 cpi r22, 0x10 ; 16 24420: 39 f0 breq .+14 ; 0x24430 24422: 08 95 ret { case 1: microstep_ms(driver,MICROSTEP1); break; 24424: 40 e0 ldi r20, 0x00 ; 0 case 2: microstep_ms(driver,MICROSTEP2); break; case 4: microstep_ms(driver,MICROSTEP4); break; 24426: 60 e0 ldi r22, 0x00 ; 0 case 8: microstep_ms(driver,MICROSTEP8); break; 24428: 0d 94 85 21 jmp 0x2430a ; 0x2430a { switch(stepping_mode) { case 1: microstep_ms(driver,MICROSTEP1); break; case 2: microstep_ms(driver,MICROSTEP2); break; case 4: microstep_ms(driver,MICROSTEP4); break; 2442c: 41 e0 ldi r20, 0x01 ; 1 2442e: fb cf rjmp .-10 ; 0x24426 case 8: microstep_ms(driver,MICROSTEP8); break; 24430: 41 e0 ldi r20, 0x01 ; 1 24432: 61 e0 ldi r22, 0x01 ; 1 24434: f9 cf rjmp .-14 ; 0x24428 00024436 : #endif } #ifdef MOTOR_CURRENT_PWM_XY_PIN void st_current_set(uint8_t driver, int current) { 24436: db 01 movw r26, r22 if (driver == 0) analogWrite(MOTOR_CURRENT_PWM_XY_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 24438: 81 11 cpse r24, r1 2443a: 0e c0 rjmp .+28 ; 0x24458 2443c: 2f ef ldi r18, 0xFF ; 255 2443e: 30 e0 ldi r19, 0x00 ; 0 24440: 0f 94 bb a1 call 0x34376 ; 0x34376 <__usmulhisi3> 24444: 20 ed ldi r18, 0xD0 ; 208 24446: 37 e0 ldi r19, 0x07 ; 7 24448: 40 e0 ldi r20, 0x00 ; 0 2444a: 50 e0 ldi r21, 0x00 ; 0 2444c: 0f 94 8c a1 call 0x34318 ; 0x34318 <__divmodsi4> 24450: b9 01 movw r22, r18 24452: 8e e2 ldi r24, 0x2E ; 46 if (driver == 1) analogWrite(MOTOR_CURRENT_PWM_Z_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 24454: 0c 94 6e c0 jmp 0x180dc ; 0x180dc 24458: 81 30 cpi r24, 0x01 ; 1 2445a: 69 f4 brne .+26 ; 0x24476 2445c: 2f ef ldi r18, 0xFF ; 255 2445e: 30 e0 ldi r19, 0x00 ; 0 24460: 0f 94 bb a1 call 0x34376 ; 0x34376 <__usmulhisi3> 24464: 20 ed ldi r18, 0xD0 ; 208 24466: 37 e0 ldi r19, 0x07 ; 7 24468: 40 e0 ldi r20, 0x00 ; 0 2446a: 50 e0 ldi r21, 0x00 ; 0 2446c: 0f 94 8c a1 call 0x34318 ; 0x34318 <__divmodsi4> 24470: b9 01 movw r22, r18 24472: 8d e2 ldi r24, 0x2D ; 45 24474: ef cf rjmp .-34 ; 0x24454 if (driver == 2) analogWrite(MOTOR_CURRENT_PWM_E_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 24476: 82 30 cpi r24, 0x02 ; 2 24478: 19 f4 brne .+6 ; 0x24480 2447a: cb 01 movw r24, r22 2447c: 0d 94 1b 21 jmp 0x24236 ; 0x24236 } 24480: 08 95 ret 00024482 : #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); 24482: 8f ef ldi r24, 0xFF ; 255 24484: 9f e0 ldi r25, 0x0F ; 15 24486: 0f 94 9b a0 call 0x34136 ; 0x34136 SilentModeMenu = SilentMode; 2448a: 80 93 89 03 sts 0x0389, r24 ; 0x800389 SET_OUTPUT(MOTOR_CURRENT_PWM_XY_PIN); 2448e: 90 91 0a 01 lds r25, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 24492: 98 60 ori r25, 0x08 ; 8 24494: 90 93 0a 01 sts 0x010A, r25 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> SET_OUTPUT(MOTOR_CURRENT_PWM_Z_PIN); 24498: 90 91 0a 01 lds r25, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 2449c: 90 61 ori r25, 0x10 ; 16 2449e: 90 93 0a 01 sts 0x010A, r25 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> SET_OUTPUT(MOTOR_CURRENT_PWM_E_PIN); 244a2: 90 91 0a 01 lds r25, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 244a6: 90 62 ori r25, 0x20 ; 32 244a8: 90 93 0a 01 sts 0x010A, r25 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> if((SilentMode == SILENT_MODE_OFF) || (farm_mode) ){ 244ac: 88 23 and r24, r24 244ae: 21 f0 breq .+8 ; 0x244b8 244b0: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 244b4: 88 23 and r24, r24 244b6: 59 f1 breq .+86 ; 0x2450e motor_current_setting[0] = motor_current_setting_loud[0]; 244b8: 8c e1 ldi r24, 0x1C ; 28 244ba: 92 e0 ldi r25, 0x02 ; 2 244bc: 90 93 62 02 sts 0x0262, r25 ; 0x800262 244c0: 80 93 61 02 sts 0x0261, r24 ; 0x800261 motor_current_setting[1] = motor_current_setting_loud[1]; 244c4: 8e e3 ldi r24, 0x3E ; 62 244c6: 93 e0 ldi r25, 0x03 ; 3 244c8: 90 93 64 02 sts 0x0264, r25 ; 0x800264 244cc: 80 93 63 02 sts 0x0263, r24 ; 0x800263 motor_current_setting[2] = motor_current_setting_loud[2]; 244d0: 84 ef ldi r24, 0xF4 ; 244 244d2: 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]; 244d4: 90 93 66 02 sts 0x0266, r25 ; 0x800266 244d8: 80 93 65 02 sts 0x0265, r24 ; 0x800265 } st_current_set(0, motor_current_setting[0]); 244dc: 60 91 61 02 lds r22, 0x0261 ; 0x800261 244e0: 70 91 62 02 lds r23, 0x0262 ; 0x800262 244e4: 80 e0 ldi r24, 0x00 ; 0 244e6: 0f 94 1b 22 call 0x24436 ; 0x24436 st_current_set(1, motor_current_setting[1]); 244ea: 6e e3 ldi r22, 0x3E ; 62 244ec: 73 e0 ldi r23, 0x03 ; 3 244ee: 81 e0 ldi r24, 0x01 ; 1 244f0: 0f 94 1b 22 call 0x24436 ; 0x24436 244f4: 80 91 65 02 lds r24, 0x0265 ; 0x800265 244f8: 90 91 66 02 lds r25, 0x0266 ; 0x800266 244fc: 0f 94 1b 21 call 0x24236 ; 0x24236 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); 24500: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 24504: 88 7f andi r24, 0xF8 ; 248 24506: 81 60 ori r24, 0x01 ; 1 24508: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> #endif } 2450c: 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]; 2450e: 8e e0 ldi r24, 0x0E ; 14 24510: 91 e0 ldi r25, 0x01 ; 1 24512: 90 93 62 02 sts 0x0262, r25 ; 0x800262 24516: 80 93 61 02 sts 0x0261, r24 ; 0x800261 motor_current_setting[1] = motor_current_setting_silent[1]; 2451a: 8e e3 ldi r24, 0x3E ; 62 2451c: 93 e0 ldi r25, 0x03 ; 3 2451e: 90 93 64 02 sts 0x0264, r25 ; 0x800264 24522: 80 93 63 02 sts 0x0263, r24 ; 0x800263 motor_current_setting[2] = motor_current_setting_silent[2]; 24526: 82 ec ldi r24, 0xC2 ; 194 24528: 91 e0 ldi r25, 0x01 ; 1 2452a: d4 cf rjmp .-88 ; 0x244d4 0002452c : eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); } #endif //MMU_FORCE_STEALTH_MODE static void lcd_silent_mode_set() { switch (SilentModeMenu) { 2452c: 80 91 89 03 lds r24, 0x0389 ; 0x800389 24530: 88 23 and r24, r24 24532: 21 f0 breq .+8 ; 0x2453c 24534: 81 30 cpi r24, 0x01 ; 1 24536: 69 f4 brne .+26 ; 0x24552 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; 24538: 82 e0 ldi r24, 0x02 ; 2 2453a: 01 c0 rjmp .+2 ; 0x2453e #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; 2453c: 81 e0 ldi r24, 0x01 ; 1 case SILENT_MODE_SILENT: SilentModeMenu = SILENT_MODE_AUTO; break; 2453e: 80 93 89 03 sts 0x0389, r24 ; 0x800389 24542: 60 91 89 03 lds r22, 0x0389 ; 0x800389 24546: 8f ef ldi r24, 0xFF ; 255 24548: 9f e0 ldi r25, 0x0F ; 15 2454a: 0f 94 bf a0 call 0x3417e ; 0x3417e // 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(); 2454e: 0d 94 41 22 jmp 0x24482 ; 0x24482 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; 24552: 10 92 89 03 sts 0x0389, r1 ; 0x800389 24556: f5 cf rjmp .-22 ; 0x24542 00024558 : } long st_get_position(uint8_t axis) { long count_pos; CRITICAL_SECTION_START; 24558: 2f b7 in r18, 0x3f ; 63 2455a: f8 94 cli count_pos = count_position[axis]; 2455c: 94 e0 ldi r25, 0x04 ; 4 2455e: 89 9f mul r24, r25 24560: f0 01 movw r30, r0 24562: 11 24 eor r1, r1 24564: ea 54 subi r30, 0x4A ; 74 24566: f9 4f sbci r31, 0xF9 ; 249 24568: 60 81 ld r22, Z 2456a: 71 81 ldd r23, Z+1 ; 0x01 2456c: 82 81 ldd r24, Z+2 ; 0x02 2456e: 93 81 ldd r25, Z+3 ; 0x03 CRITICAL_SECTION_END; 24570: 2f bf out 0x3f, r18 ; 63 return count_pos; } 24572: 08 95 ret 00024574 : y = count_position[Y_AXIS]; CRITICAL_SECTION_END; } float st_get_position_mm(uint8_t axis) { 24574: cf 93 push r28 24576: c8 2f mov r28, r24 float steper_position_in_steps = st_get_position(axis); 24578: 0f 94 ac 22 call 0x24558 ; 0x24558 2457c: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> return steper_position_in_steps / cs.axis_steps_per_mm[axis]; 24580: 24 e0 ldi r18, 0x04 ; 4 24582: c2 9f mul r28, r18 24584: f0 01 movw r30, r0 24586: 11 24 eor r1, r1 24588: ea 5c subi r30, 0xCA ; 202 2458a: fb 4f sbci r31, 0xFB ; 251 2458c: 20 81 ld r18, Z 2458e: 31 81 ldd r19, Z+1 ; 0x01 24590: 42 81 ldd r20, Z+2 ; 0x02 24592: 53 81 ldd r21, Z+3 ; 0x03 24594: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> } 24598: cf 91 pop r28 2459a: 08 95 ret 0002459c : 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); 2459c: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 245a0: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 // Block until all buffered steps are executed void st_synchronize() { while(blocks_queued()) 245a4: 98 17 cp r25, r24 245a6: 29 f0 breq .+10 ; 0x245b2 manage_inactivity(true); lcd_update(0); } #else //TMC2130 // Vojtech: Don't disable motors inside the planner! delay_keep_alive(0); 245a8: 90 e0 ldi r25, 0x00 ; 0 245aa: 80 e0 ldi r24, 0x00 ; 0 245ac: 0e 94 45 7c call 0xf88a ; 0xf88a 245b0: f5 cf rjmp .-22 ; 0x2459c #endif //TMC2130 } } 245b2: 08 95 ret 000245b4 : void st_reset_timer() { // Clear a possible pending interrupt on OCR1A overflow. TIFR1 |= 1 << OCF1A; 245b4: b1 9a sbi 0x16, 1 ; 22 // Reset the counter. TCNT1 = 0; 245b6: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 245ba: 10 92 84 00 sts 0x0084, r1 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> // Wake up after 1ms from now. OCR1A = 2000; 245be: 80 ed ldi r24, 0xD0 ; 208 245c0: 97 e0 ldi r25, 0x07 ; 7 245c2: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 245c6: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> #ifdef LIN_ADVANCE nextMainISR = 0; 245ca: 10 92 1d 04 sts 0x041D, r1 ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 245ce: 10 92 1c 04 sts 0x041C, r1 ; 0x80041c <_ZL11nextMainISR.lto_priv.435> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 245d2: 80 91 1a 04 lds r24, 0x041A ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> 245d6: 90 91 1b 04 lds r25, 0x041B ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 245da: 01 97 sbiw r24, 0x01 ; 1 245dc: 8e 3f cpi r24, 0xFE ; 254 245de: 9f 4f sbci r25, 0xFF ; 255 245e0: 20 f4 brcc .+8 ; 0x245ea nextAdvanceISR = 0; 245e2: 10 92 1b 04 sts 0x041B, r1 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 245e6: 10 92 1a 04 sts 0x041A, r1 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> #endif } 245ea: 08 95 ret 000245ec <__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) { 245ec: 1f 92 push r1 245ee: 0f 92 push r0 245f0: 0f b6 in r0, 0x3f ; 63 245f2: 0f 92 push r0 245f4: 11 24 eor r1, r1 245f6: 0b b6 in r0, 0x3b ; 59 245f8: 0f 92 push r0 245fa: 4f 92 push r4 245fc: 5f 92 push r5 245fe: 6f 92 push r6 24600: 7f 92 push r7 24602: 8f 92 push r8 24604: cf 92 push r12 24606: df 92 push r13 24608: ef 92 push r14 2460a: ff 92 push r15 2460c: 1f 93 push r17 2460e: 2f 93 push r18 24610: 3f 93 push r19 24612: 4f 93 push r20 24614: 5f 93 push r21 24616: 6f 93 push r22 24618: 7f 93 push r23 2461a: 8f 93 push r24 2461c: 9f 93 push r25 2461e: af 93 push r26 24620: bf 93 push r27 24622: cf 93 push r28 24624: df 93 push r29 24626: ef 93 push r30 24628: ff 93 push r31 } } FORCE_INLINE void advance_isr_scheduler() { // Integrate the final timer value, accounting for scheduling adjustments if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 2462a: 80 91 1a 04 lds r24, 0x041A ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> 2462e: 90 91 1b 04 lds r25, 0x041B ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 24632: 9c 01 movw r18, r24 24634: 21 50 subi r18, 0x01 ; 1 24636: 31 09 sbc r19, r1 24638: 2e 3f cpi r18, 0xFE ; 254 2463a: 3f 4f sbci r19, 0xFF ; 255 2463c: 90 f4 brcc .+36 ; 0x24662 <__vector_17+0x76> { if(nextAdvanceISR > OCR1A) 2463e: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 24642: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 24646: 28 17 cp r18, r24 24648: 39 07 cpc r19, r25 2464a: 08 f0 brcs .+2 ; 0x2464e <__vector_17+0x62> 2464c: f9 c0 rjmp .+498 ; 0x24840 <__vector_17+0x254> nextAdvanceISR -= OCR1A; 2464e: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 24652: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 24656: 82 1b sub r24, r18 24658: 93 0b sbc r25, r19 2465a: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 2465e: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> else nextAdvanceISR = 0; } if(nextMainISR > OCR1A) 24662: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 24666: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2466a: 80 91 1c 04 lds r24, 0x041C ; 0x80041c <_ZL11nextMainISR.lto_priv.435> 2466e: 90 91 1d 04 lds r25, 0x041D ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 24672: 28 17 cp r18, r24 24674: 39 07 cpc r19, r25 24676: 08 f0 brcs .+2 ; 0x2467a <__vector_17+0x8e> 24678: e8 c0 rjmp .+464 ; 0x2484a <__vector_17+0x25e> nextMainISR -= OCR1A; 2467a: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2467e: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 24682: 82 1b sub r24, r18 24684: 93 0b sbc r25, r19 24686: 90 93 1d 04 sts 0x041D, r25 ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 2468a: 80 93 1c 04 sts 0x041C, r24 ; 0x80041c <_ZL11nextMainISR.lto_priv.435> else nextMainISR = 0; // Run main stepping ISR if flagged if (!nextMainISR) 2468e: 80 91 1c 04 lds r24, 0x041C ; 0x80041c <_ZL11nextMainISR.lto_priv.435> 24692: 90 91 1d 04 lds r25, 0x041D ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 24696: 89 2b or r24, r25 24698: 11 f0 breq .+4 ; 0x2469e <__vector_17+0xb2> 2469a: 0d 94 e1 2b jmp 0x257c2 ; 0x257c2 <__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) 2469e: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 246a2: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 246a6: 30 97 sbiw r30, 0x00 ; 0 246a8: 09 f0 breq .+2 ; 0x246ac <__vector_17+0xc0> 246aa: 82 c1 rjmp .+772 ; 0x249b0 <__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) { 246ac: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 246b0: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 246b4: 98 17 cp r25, r24 246b6: 09 f4 brne .+2 ; 0x246ba <__vector_17+0xce> 246b8: 35 c3 rjmp .+1642 ; 0x24d24 <__vector_17+0x738> return(NULL); } block_t *block = &block_buffer[block_buffer_tail]; 246ba: c0 91 a9 0d lds r28, 0x0DA9 ; 0x800da9 246be: 2c 2f mov r18, r28 246c0: 30 e0 ldi r19, 0x00 ; 0 246c2: 5e e6 ldi r21, 0x6E ; 110 246c4: c5 9f mul r28, r21 246c6: e0 01 movw r28, r0 246c8: 11 24 eor r1, r1 246ca: c8 53 subi r28, 0x38 ; 56 246cc: d9 4f sbci r29, 0xF9 ; 249 block->busy = true; 246ce: fe 01 movw r30, r28 246d0: e9 5b subi r30, 0xB9 ; 185 246d2: ff 4f sbci r31, 0xFF ; 255 246d4: 41 e0 ldi r20, 0x01 ; 1 246d6: 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(); 246d8: d0 93 e5 11 sts 0x11E5, r29 ; 0x8011e5 246dc: c0 93 e4 11 sts 0x11E4, r28 ; 0x8011e4 if (current_block != NULL) { 246e0: 20 97 sbiw r28, 0x00 ; 0 246e2: 09 f4 brne .+2 ; 0x246e6 <__vector_17+0xfa> 246e4: 1f c3 rjmp .+1598 ; 0x24d24 <__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; 246e6: 10 92 e1 05 sts 0x05E1, r1 ; 0x8005e1 246ea: 10 92 e2 05 sts 0x05E2, r1 ; 0x8005e2 246ee: 10 92 e3 05 sts 0x05E3, r1 ; 0x8005e3 246f2: 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; 246f6: 10 92 e0 05 sts 0x05E0, r1 ; 0x8005e0 acc_step_rate = uint16_t(current_block->initial_rate); 246fa: 8a ad ldd r24, Y+58 ; 0x3a 246fc: 9b ad ldd r25, Y+59 ; 0x3b 246fe: 90 93 df 05 sts 0x05DF, r25 ; 0x8005df 24702: 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; 24706: 81 34 cpi r24, 0x41 ; 65 24708: ac e9 ldi r26, 0x9C ; 156 2470a: 9a 07 cpc r25, r26 2470c: 08 f0 brcs .+2 ; 0x24710 <__vector_17+0x124> 2470e: a2 c0 rjmp .+324 ; 0x24854 <__vector_17+0x268> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 24710: 81 32 cpi r24, 0x21 ; 33 24712: be e4 ldi r27, 0x4E ; 78 24714: 9b 07 cpc r25, r27 24716: 08 f4 brcc .+2 ; 0x2471a <__vector_17+0x12e> 24718: a0 c0 rjmp .+320 ; 0x2485a <__vector_17+0x26e> step_rate = (step_rate >> 2)&0x3fff; 2471a: 96 95 lsr r25 2471c: 87 95 ror r24 2471e: 96 95 lsr r25 24720: 87 95 ror r24 step_loops = 4; 24722: 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; 24724: 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 24728: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2472a: 81 15 cp r24, r1 2472c: f8 e0 ldi r31, 0x08 ; 8 2472e: 9f 07 cpc r25, r31 24730: 08 f4 brcc .+2 ; 0x24734 <__vector_17+0x148> 24732: a4 c0 rjmp .+328 ; 0x2487c <__vector_17+0x290> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 24734: e9 2f mov r30, r25 24736: ff 27 eor r31, r31 24738: ee 0f add r30, r30 2473a: ff 1f adc r31, r31 2473c: ee 0f add r30, r30 2473e: ff 1f adc r31, r31 24740: af 01 movw r20, r30 24742: 4a 52 subi r20, 0x2A ; 42 24744: 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); 24746: fa 01 movw r30, r20 24748: 32 96 adiw r30, 0x02 ; 2 2474a: a5 91 lpm r26, Z+ 2474c: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2474e: fa 01 movw r30, r20 24750: 45 91 lpm r20, Z+ 24752: 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. ); 24754: b8 9f mul r27, r24 24756: b0 01 movw r22, r0 24758: a8 9f mul r26, r24 2475a: 00 0c add r0, r0 2475c: 61 1d adc r22, r1 2475e: 11 24 eor r1, r1 24760: 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); 24762: 46 1b sub r20, r22 24764: 57 0b sbc r21, r23 acceleration_time = calc_timer(acc_step_rate, step_loops); 24766: ca 01 movw r24, r20 24768: 44 36 cpi r20, 0x64 ; 100 2476a: 51 05 cpc r21, r1 2476c: 10 f4 brcc .+4 ; 0x24772 <__vector_17+0x186> 2476e: 84 e6 ldi r24, 0x64 ; 100 24770: 90 e0 ldi r25, 0x00 ; 0 24772: b0 e0 ldi r27, 0x00 ; 0 24774: a0 e0 ldi r26, 0x00 ; 0 24776: 80 93 d9 05 sts 0x05D9, r24 ; 0x8005d9 2477a: 90 93 da 05 sts 0x05DA, r25 ; 0x8005da 2477e: a0 93 db 05 sts 0x05DB, r26 ; 0x8005db 24782: b0 93 dc 05 sts 0x05DC, r27 ; 0x8005dc #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 24786: 4e e6 ldi r20, 0x6E ; 110 24788: 42 9f mul r20, r18 2478a: c0 01 movw r24, r0 2478c: 43 9f mul r20, r19 2478e: 90 0d add r25, r0 24790: 11 24 eor r1, r1 24792: 88 53 subi r24, 0x38 ; 56 24794: 99 4f sbci r25, 0xF9 ; 249 24796: fc 01 movw r30, r24 24798: e4 5b subi r30, 0xB4 ; 180 2479a: ff 4f sbci r31, 0xFF ; 255 2479c: 40 81 ld r20, Z 2479e: 44 23 and r20, r20 247a0: 49 f0 breq .+18 ; 0x247b4 <__vector_17+0x1c8> target_adv_steps = current_block->max_adv_steps; 247a2: 81 5b subi r24, 0xB1 ; 177 247a4: 9f 4f sbci r25, 0xFF ; 255 247a6: dc 01 movw r26, r24 247a8: 8d 91 ld r24, X+ 247aa: 9c 91 ld r25, X 247ac: 90 93 d8 05 sts 0x05D8, r25 ; 0x8005d8 247b0: 80 93 d7 05 sts 0x05D7, r24 ; 0x8005d7 } e_steps = 0; 247b4: 10 92 d6 05 sts 0x05D6, r1 ; 0x8005d6 nextAdvanceISR = ADV_NEVER; 247b8: 8f ef ldi r24, 0xFF ; 255 247ba: 9f ef ldi r25, 0xFF ; 255 247bc: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 247c0: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> LA_phase = -1; 247c4: 80 93 d5 05 sts 0x05D5, r24 ; 0x8005d5 #endif if (current_block->flag & BLOCK_FLAG_E_RESET) { 247c8: 8e e6 ldi r24, 0x6E ; 110 247ca: 82 9f mul r24, r18 247cc: f0 01 movw r30, r0 247ce: 83 9f mul r24, r19 247d0: f0 0d add r31, r0 247d2: 11 24 eor r1, r1 247d4: e8 53 subi r30, 0x38 ; 56 247d6: f9 4f sbci r31, 0xF9 ; 249 247d8: 85 a9 ldd r24, Z+53 ; 0x35 247da: 84 ff sbrs r24, 4 247dc: 08 c0 rjmp .+16 ; 0x247ee <__vector_17+0x202> count_position[E_AXIS] = 0; 247de: 10 92 c2 06 sts 0x06C2, r1 ; 0x8006c2 247e2: 10 92 c3 06 sts 0x06C3, r1 ; 0x8006c3 247e6: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 247ea: 10 92 c5 06 sts 0x06C5, r1 ; 0x8006c5 } if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) { 247ee: 83 ff sbrs r24, 3 247f0: 61 c0 rjmp .+194 ; 0x248b4 <__vector_17+0x2c8> const int16_t value = -(current_block->step_event_count.lo >> 1); 247f2: 8e e6 ldi r24, 0x6E ; 110 247f4: 82 9f mul r24, r18 247f6: f0 01 movw r30, r0 247f8: 83 9f mul r24, r19 247fa: f0 0d add r31, r0 247fc: 11 24 eor r1, r1 247fe: e8 53 subi r30, 0x38 ; 56 24800: f9 4f sbci r31, 0xF9 ; 249 24802: 80 89 ldd r24, Z+16 ; 0x10 24804: 91 89 ldd r25, Z+17 ; 0x11 24806: 96 95 lsr r25 24808: 87 95 ror r24 2480a: 91 95 neg r25 2480c: 81 95 neg r24 2480e: 91 09 sbc r25, r1 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].lo = value; 24810: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 24814: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 24818: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 2481c: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 24820: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 24824: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd 24828: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 2482c: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].lo != 0; 24830: 81 e0 ldi r24, 0x01 ; 1 24832: 24 85 ldd r18, Z+12 ; 0x0c 24834: 35 85 ldd r19, Z+13 ; 0x0d 24836: 23 2b or r18, r19 24838: 09 f0 breq .+2 ; 0x2483c <__vector_17+0x250> 2483a: 7d c0 rjmp .+250 ; 0x24936 <__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; 2483c: 80 e0 ldi r24, 0x00 ; 0 2483e: 7b c0 rjmp .+246 ; 0x24936 <__vector_17+0x34a> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) { if(nextAdvanceISR > OCR1A) nextAdvanceISR -= OCR1A; else nextAdvanceISR = 0; 24840: 10 92 1b 04 sts 0x041B, r1 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 24844: 10 92 1a 04 sts 0x041A, r1 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> 24848: 0c cf rjmp .-488 ; 0x24662 <__vector_17+0x76> } if(nextMainISR > OCR1A) nextMainISR -= OCR1A; else nextMainISR = 0; 2484a: 10 92 1d 04 sts 0x041D, r1 ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 2484e: 10 92 1c 04 sts 0x041C, r1 ; 0x80041c <_ZL11nextMainISR.lto_priv.435> 24852: 1d cf rjmp .-454 ; 0x2468e <__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; 24854: 80 e4 ldi r24, 0x40 ; 64 24856: 9c e9 ldi r25, 0x9C ; 156 24858: 60 cf rjmp .-320 ; 0x2471a <__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 2485a: 81 31 cpi r24, 0x11 ; 17 2485c: e7 e2 ldi r30, 0x27 ; 39 2485e: 9e 07 cpc r25, r30 24860: 20 f0 brcs .+8 ; 0x2486a <__vector_17+0x27e> step_rate = (step_rate >> 1)&0x7fff; 24862: 96 95 lsr r25 24864: 87 95 ror r24 step_loops = 2; 24866: 42 e0 ldi r20, 0x02 ; 2 24868: 5d cf rjmp .-326 ; 0x24724 <__vector_17+0x138> } else { step_loops = 1; 2486a: 40 93 dd 05 sts 0x05DD, r20 ; 0x8005dd 2486e: 80 32 cpi r24, 0x20 ; 32 24870: 91 05 cpc r25, r1 24872: 08 f0 brcs .+2 ; 0x24876 <__vector_17+0x28a> 24874: 59 cf rjmp .-334 ; 0x24728 <__vector_17+0x13c> 24876: 80 e2 ldi r24, 0x20 ; 32 24878: 90 e0 ldi r25, 0x00 ; 0 2487a: 56 cf rjmp .-340 ; 0x24728 <__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; 2487c: bc 01 movw r22, r24 2487e: 76 95 lsr r23 24880: 67 95 ror r22 24882: 6c 7f andi r22, 0xFC ; 252 24884: 6a 52 subi r22, 0x2A ; 42 24886: 77 47 sbci r23, 0x77 ; 119 timer = (unsigned short)pgm_read_word_near(table_address); 24888: fb 01 movw r30, r22 2488a: 45 91 lpm r20, Z+ 2488c: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2488e: fb 01 movw r30, r22 24890: 32 96 adiw r30, 0x02 ; 2 24892: a5 91 lpm r26, Z+ 24894: b4 91 lpm r27, Z 24896: 87 70 andi r24, 0x07 ; 7 24898: 99 27 eor r25, r25 2489a: 8a 9f mul r24, r26 2489c: b0 01 movw r22, r0 2489e: 8b 9f mul r24, r27 248a0: 70 0d add r23, r0 248a2: 9a 9f mul r25, r26 248a4: 70 0d add r23, r0 248a6: 11 24 eor r1, r1 248a8: e3 e0 ldi r30, 0x03 ; 3 248aa: 76 95 lsr r23 248ac: 67 95 ror r22 248ae: ea 95 dec r30 248b0: e1 f7 brne .-8 ; 0x248aa <__vector_17+0x2be> 248b2: 57 cf rjmp .-338 ; 0x24762 <__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); 248b4: 8e e6 ldi r24, 0x6E ; 110 248b6: 82 9f mul r24, r18 248b8: f0 01 movw r30, r0 248ba: 83 9f mul r24, r19 248bc: f0 0d add r31, r0 248be: 11 24 eor r1, r1 248c0: e8 53 subi r30, 0x38 ; 56 248c2: f9 4f sbci r31, 0xF9 ; 249 248c4: 80 89 ldd r24, Z+16 ; 0x10 248c6: 91 89 ldd r25, Z+17 ; 0x11 248c8: a2 89 ldd r26, Z+18 ; 0x12 248ca: b3 89 ldd r27, Z+19 ; 0x13 248cc: b6 95 lsr r27 248ce: a7 95 ror r26 248d0: 97 95 ror r25 248d2: 87 95 ror r24 248d4: b0 95 com r27 248d6: a0 95 com r26 248d8: 90 95 com r25 248da: 81 95 neg r24 248dc: 9f 4f sbci r25, 0xFF ; 255 248de: af 4f sbci r26, 0xFF ; 255 248e0: bf 4f sbci r27, 0xFF ; 255 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].wide = value; 248e2: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 248e6: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 248ea: a0 93 c7 05 sts 0x05C7, r26 ; 0x8005c7 248ee: b0 93 c8 05 sts 0x05C8, r27 ; 0x8005c8 248f2: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 248f6: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 248fa: a0 93 cb 05 sts 0x05CB, r26 ; 0x8005cb 248fe: b0 93 cc 05 sts 0x05CC, r27 ; 0x8005cc 24902: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd 24906: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 2490a: a0 93 cf 05 sts 0x05CF, r26 ; 0x8005cf 2490e: b0 93 d0 05 sts 0x05D0, r27 ; 0x8005d0 24912: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 24916: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 2491a: a0 93 d3 05 sts 0x05D3, r26 ; 0x8005d3 2491e: b0 93 d4 05 sts 0x05D4, r27 ; 0x8005d4 } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].wide != 0; 24922: 81 e0 ldi r24, 0x01 ; 1 24924: 44 85 ldd r20, Z+12 ; 0x0c 24926: 55 85 ldd r21, Z+13 ; 0x0d 24928: 66 85 ldd r22, Z+14 ; 0x0e 2492a: 77 85 ldd r23, Z+15 ; 0x0f 2492c: 45 2b or r20, r21 2492e: 46 2b or r20, r22 24930: 47 2b or r20, r23 24932: 09 f4 brne .+2 ; 0x24936 <__vector_17+0x34a> 24934: 83 cf rjmp .-250 ; 0x2483c <__vector_17+0x250> 24936: 80 93 c4 05 sts 0x05C4, r24 ; 0x8005c4 #endif } step_events_completed.wide = 0; 2493a: 10 92 c0 05 sts 0x05C0, r1 ; 0x8005c0 2493e: 10 92 c1 05 sts 0x05C1, r1 ; 0x8005c1 24942: 10 92 c2 05 sts 0x05C2, r1 ; 0x8005c2 24946: 10 92 c3 05 sts 0x05C3, r1 ; 0x8005c3 // Set directions. out_bits = current_block->direction_bits; 2494a: 88 8d ldd r24, Y+24 ; 0x18 2494c: 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); 24954: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24958: 8d 7f andi r24, 0xFD ; 253 2495a: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=-1; 2495e: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(X_DIR_PIN, !INVERT_X_DIR); count_direction[X_AXIS]=1; 24960: 80 93 5d 02 sts 0x025D, r24 ; 0x80025d } if((out_bits & (1< 24968: 81 ff sbrs r24, 1 2496a: cc c1 rjmp .+920 ; 0x24d04 <__vector_17+0x718> WRITE_NC(Y_DIR_PIN, INVERT_Y_DIR); 2496c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24970: 8e 7f andi r24, 0xFE ; 254 24972: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=-1; 24976: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(Y_DIR_PIN, !INVERT_Y_DIR); count_direction[Y_AXIS]=1; 24978: 80 93 5e 02 sts 0x025E, r24 ; 0x80025e } if ((out_bits & (1< 24980: 82 ff sbrs r24, 2 24982: c7 c1 rjmp .+910 ; 0x24d12 <__vector_17+0x726> WRITE_NC(Z_DIR_PIN,INVERT_Z_DIR); 24984: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24988: 8b 7f andi r24, 0xFB ; 251 2498a: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=-1; 2498e: 8f ef ldi r24, 0xFF ; 255 } else { // +direction WRITE_NC(Z_DIR_PIN,!INVERT_Z_DIR); count_direction[Z_AXIS]=1; 24990: 80 93 5f 02 sts 0x025F, r24 ; 0x80025f } if ((out_bits & (1 << E_AXIS)) != 0) { // -direction 24994: 80 91 bf 05 lds r24, 0x05BF ; 0x8005bf 24998: 83 ff sbrs r24, 3 2499a: c2 c1 rjmp .+900 ; 0x24d20 <__vector_17+0x734> #ifndef LIN_ADVANCE WRITE(E0_DIR_PIN, INVERT_E0_DIR); #endif /* LIN_ADVANCE */ count_direction[E_AXIS] = -1; 2499c: 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; 2499e: 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) 249a2: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 249a6: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 249aa: 30 97 sbiw r30, 0x00 ; 0 249ac: 09 f4 brne .+2 ; 0x249b0 <__vector_17+0x3c4> 249ae: 09 c7 rjmp .+3602 ; 0x257c2 <__vector_17+0x11d6> } // Check limit switches. FORCE_INLINE void stepper_check_endstops() { if(check_endstops) 249b0: 80 91 77 02 lds r24, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.364> 249b4: 50 91 bc 05 lds r21, 0x05BC ; 0x8005bc 249b8: 88 23 and r24, r24 249ba: 09 f4 brne .+2 ; 0x249be <__vector_17+0x3d2> 249bc: 6c c0 rjmp .+216 ; 0x24a96 <__vector_17+0x4aa> { uint8_t _endstop_hit = endstop_hit; 249be: 20 91 2c 04 lds r18, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.439> uint8_t _endstop = endstop; 249c2: 80 91 be 05 lds r24, 0x05BE ; 0x8005be uint8_t _old_endstop = old_endstop; 249c6: 90 91 bd 05 lds r25, 0x05BD ; 0x8005bd #ifndef COREXY if ((out_bits & (1< 249ce: 30 ff sbrs r19, 0 249d0: 1d c0 rjmp .+58 ; 0x24a0c <__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)); 249d2: 1e 9b sbis 0x03, 6 ; 3 249d4: c6 c1 rjmp .+908 ; 0x24d62 <__vector_17+0x776> 249d6: 81 60 ori r24, 0x01 ; 1 #endif if((_endstop & _old_endstop & _BV(X_AXIS)) && (current_block->steps[X_AXIS].wide > 0)) { 249d8: 49 2f mov r20, r25 249da: 41 70 andi r20, 0x01 ; 1 249dc: 48 23 and r20, r24 249de: b1 f0 breq .+44 ; 0x24a0c <__vector_17+0x420> 249e0: c0 80 ld r12, Z 249e2: d1 80 ldd r13, Z+1 ; 0x01 249e4: e2 80 ldd r14, Z+2 ; 0x02 249e6: f3 80 ldd r15, Z+3 ; 0x03 249e8: 1c 14 cp r1, r12 249ea: 1d 04 cpc r1, r13 249ec: 1e 04 cpc r1, r14 249ee: 1f 04 cpc r1, r15 249f0: 6c f4 brge .+26 ; 0x24a0c <__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); 249f2: 21 60 ori r18, 0x01 ; 1 step_events_completed.wide = current_block->step_event_count.wide; 249f4: c0 88 ldd r12, Z+16 ; 0x10 249f6: d1 88 ldd r13, Z+17 ; 0x11 249f8: e2 88 ldd r14, Z+18 ; 0x12 249fa: f3 88 ldd r15, Z+19 ; 0x13 249fc: c0 92 c0 05 sts 0x05C0, r12 ; 0x8005c0 24a00: d0 92 c1 05 sts 0x05C1, r13 ; 0x8005c1 24a04: e0 92 c2 05 sts 0x05C2, r14 ; 0x8005c2 24a08: 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)); 24a10: 1d 9b sbis 0x03, 5 ; 3 24a12: a9 c1 rjmp .+850 ; 0x24d66 <__vector_17+0x77a> 24a14: 82 60 ori r24, 0x02 ; 2 #endif if((_endstop & _old_endstop & _BV(Y_AXIS)) && (current_block->steps[Y_AXIS].wide > 0)) { 24a16: 49 2f mov r20, r25 24a18: 42 70 andi r20, 0x02 ; 2 24a1a: 48 23 and r20, r24 24a1c: b1 f0 breq .+44 ; 0x24a4a <__vector_17+0x45e> 24a1e: c4 80 ldd r12, Z+4 ; 0x04 24a20: d5 80 ldd r13, Z+5 ; 0x05 24a22: e6 80 ldd r14, Z+6 ; 0x06 24a24: f7 80 ldd r15, Z+7 ; 0x07 24a26: 1c 14 cp r1, r12 24a28: 1d 04 cpc r1, r13 24a2a: 1e 04 cpc r1, r14 24a2c: 1f 04 cpc r1, r15 24a2e: 6c f4 brge .+26 ; 0x24a4a <__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); 24a30: 22 60 ori r18, 0x02 ; 2 step_events_completed.wide = current_block->step_event_count.wide; 24a32: c0 88 ldd r12, Z+16 ; 0x10 24a34: d1 88 ldd r13, Z+17 ; 0x11 24a36: e2 88 ldd r14, Z+18 ; 0x12 24a38: f3 88 ldd r15, Z+19 ; 0x13 24a3a: c0 92 c0 05 sts 0x05C0, r12 ; 0x8005c0 24a3e: d0 92 c1 05 sts 0x05C1, r13 ; 0x8005c1 24a42: e0 92 c2 05 sts 0x05C2, r14 ; 0x8005c2 24a46: 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) { 24a4e: 51 11 cpse r21, r1 24a50: 1c c0 rjmp .+56 ; 0x24a8a <__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)); 24a52: 1c 9b sbis 0x03, 4 ; 3 24a54: 8a c1 rjmp .+788 ; 0x24d6a <__vector_17+0x77e> 24a56: 84 60 ori r24, 0x04 ; 4 #endif //TMC2130_SG_HOMING if((_endstop & _old_endstop & _BV(Z_AXIS)) && (current_block->steps[Z_AXIS].wide > 0)) { 24a58: 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)) { 24a5a: 98 23 and r25, r24 24a5c: b1 f0 breq .+44 ; 0x24a8a <__vector_17+0x49e> 24a5e: c0 84 ldd r12, Z+8 ; 0x08 24a60: d1 84 ldd r13, Z+9 ; 0x09 24a62: e2 84 ldd r14, Z+10 ; 0x0a 24a64: f3 84 ldd r15, Z+11 ; 0x0b 24a66: 1c 14 cp r1, r12 24a68: 1d 04 cpc r1, r13 24a6a: 1e 04 cpc r1, r14 24a6c: 1f 04 cpc r1, r15 24a6e: 6c f4 brge .+26 ; 0x24a8a <__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); 24a70: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 24a72: c0 88 ldd r12, Z+16 ; 0x10 24a74: d1 88 ldd r13, Z+17 ; 0x11 24a76: e2 88 ldd r14, Z+18 ; 0x12 24a78: f3 88 ldd r15, Z+19 ; 0x13 24a7a: c0 92 c0 05 sts 0x05C0, r12 ; 0x8005c0 24a7e: d0 92 c1 05 sts 0x05C1, r13 ; 0x8005c1 24a82: e0 92 c2 05 sts 0x05C2, r14 ; 0x8005c2 24a86: f0 92 c3 05 sts 0x05C3, r15 ; 0x8005c3 } #endif } endstop = _endstop; 24a8a: 80 93 be 05 sts 0x05BE, r24 ; 0x8005be old_endstop = _endstop; //apply current endstop state to the old endstop 24a8e: 80 93 bd 05 sts 0x05BD, r24 ; 0x8005bd endstop_hit = _endstop_hit; 24a92: 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) { 24a96: 55 23 and r21, r21 24a98: f9 f0 breq .+62 ; 0x24ad8 <__vector_17+0x4ec> uint8_t _endstop_hit = endstop_hit; 24a9a: 20 91 2c 04 lds r18, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.439> uint8_t _endstop = endstop; 24a9e: 80 91 be 05 lds r24, 0x05BE ; 0x8005be uint8_t _old_endstop = old_endstop; 24aa2: 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)); 24aa6: 1c 9b sbis 0x03, 4 ; 3 24aa8: 69 c1 rjmp .+722 ; 0x24d7c <__vector_17+0x790> 24aaa: 84 60 ori r24, 0x04 ; 4 #endif //TMC2130_SG_HOMING if(_endstop & _old_endstop & _BV(Z_AXIS)) { 24aac: 94 70 andi r25, 0x04 ; 4 24aae: 98 23 and r25, r24 24ab0: 69 f0 breq .+26 ; 0x24acc <__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); 24ab2: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 24ab4: 40 89 ldd r20, Z+16 ; 0x10 24ab6: 51 89 ldd r21, Z+17 ; 0x11 24ab8: 62 89 ldd r22, Z+18 ; 0x12 24aba: 73 89 ldd r23, Z+19 ; 0x13 24abc: 40 93 c0 05 sts 0x05C0, r20 ; 0x8005c0 24ac0: 50 93 c1 05 sts 0x05C1, r21 ; 0x8005c1 24ac4: 60 93 c2 05 sts 0x05C2, r22 ; 0x8005c2 24ac8: 70 93 c3 05 sts 0x05C3, r23 ; 0x8005c3 } endstop = _endstop; 24acc: 80 93 be 05 sts 0x05BE, r24 ; 0x8005be old_endstop = _endstop; //apply current endstop state to the old endstop 24ad0: 80 93 bd 05 sts 0x05BD, r24 ; 0x8005bd endstop_hit = _endstop_hit; 24ad4: 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) 24ad8: 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) 24ada: c0 e0 ldi r28, 0x00 ; 0 stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 24adc: 83 ff sbrs r24, 3 24ade: 50 c1 rjmp .+672 ; 0x24d80 <__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) 24ae0: 80 91 dd 05 lds r24, 0x05DD ; 0x8005dd 24ae4: c8 17 cp r28, r24 24ae6: 08 f0 brcs .+2 ; 0x24aea <__vector_17+0x4fe> 24ae8: bd c2 rjmp .+1402 ; 0x25064 <__vector_17+0xa78> MSerial.checkRx(); // Check for serial chars. 24aea: 0e 94 ef fb call 0x1f7de ; 0x1f7de // Step in X axis counter[X_AXIS].lo += current_block->steps[X_AXIS].lo; 24aee: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24af2: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24af6: 80 81 ld r24, Z 24af8: 91 81 ldd r25, Z+1 ; 0x01 24afa: 20 91 c5 05 lds r18, 0x05C5 ; 0x8005c5 24afe: 30 91 c6 05 lds r19, 0x05C6 ; 0x8005c6 24b02: 82 0f add r24, r18 24b04: 93 1f adc r25, r19 24b06: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 24b0a: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 if (counter[X_AXIS].lo > 0) { 24b0e: 18 16 cp r1, r24 24b10: 19 06 cpc r1, r25 24b12: 6c f5 brge .+90 ; 0x24b6e <__vector_17+0x582> STEP_NC_HI(X_AXIS); 24b14: 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; 24b16: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24b1a: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24b1e: 80 91 c5 05 lds r24, 0x05C5 ; 0x8005c5 24b22: 90 91 c6 05 lds r25, 0x05C6 ; 0x8005c6 24b26: 20 89 ldd r18, Z+16 ; 0x10 24b28: 31 89 ldd r19, Z+17 ; 0x11 24b2a: 82 1b sub r24, r18 24b2c: 93 0b sbc r25, r19 24b2e: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 24b32: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 count_position[X_AXIS]+=count_direction[X_AXIS]; 24b36: 90 91 5d 02 lds r25, 0x025D ; 0x80025d 24b3a: 40 91 b6 06 lds r20, 0x06B6 ; 0x8006b6 24b3e: 50 91 b7 06 lds r21, 0x06B7 ; 0x8006b7 24b42: 60 91 b8 06 lds r22, 0x06B8 ; 0x8006b8 24b46: 70 91 b9 06 lds r23, 0x06B9 ; 0x8006b9 24b4a: 89 2f mov r24, r25 24b4c: 99 0f add r25, r25 24b4e: 99 0b sbc r25, r25 24b50: aa 0b sbc r26, r26 24b52: bb 0b sbc r27, r27 24b54: 84 0f add r24, r20 24b56: 95 1f adc r25, r21 24b58: a6 1f adc r26, r22 24b5a: b7 1f adc r27, r23 24b5c: 80 93 b6 06 sts 0x06B6, r24 ; 0x8006b6 24b60: 90 93 b7 06 sts 0x06B7, r25 ; 0x8006b7 24b64: a0 93 b8 06 sts 0x06B8, r26 ; 0x8006b8 24b68: b0 93 b9 06 sts 0x06B9, r27 ; 0x8006b9 STEP_NC_LO(X_AXIS); 24b6c: 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; 24b6e: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24b72: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24b76: 84 81 ldd r24, Z+4 ; 0x04 24b78: 95 81 ldd r25, Z+5 ; 0x05 24b7a: 20 91 c9 05 lds r18, 0x05C9 ; 0x8005c9 24b7e: 30 91 ca 05 lds r19, 0x05CA ; 0x8005ca 24b82: 82 0f add r24, r18 24b84: 93 1f adc r25, r19 24b86: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 24b8a: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 if (counter[Y_AXIS].lo > 0) { 24b8e: 18 16 cp r1, r24 24b90: 19 06 cpc r1, r25 24b92: 4c f5 brge .+82 ; 0x24be6 <__vector_17+0x5fa> STEP_NC_HI(Y_AXIS); 24b94: 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; 24b96: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24b9a: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24b9e: 20 89 ldd r18, Z+16 ; 0x10 24ba0: 31 89 ldd r19, Z+17 ; 0x11 24ba2: 82 1b sub r24, r18 24ba4: 93 0b sbc r25, r19 24ba6: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 24baa: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 24bae: 90 91 5e 02 lds r25, 0x025E ; 0x80025e 24bb2: 40 91 ba 06 lds r20, 0x06BA ; 0x8006ba 24bb6: 50 91 bb 06 lds r21, 0x06BB ; 0x8006bb 24bba: 60 91 bc 06 lds r22, 0x06BC ; 0x8006bc 24bbe: 70 91 bd 06 lds r23, 0x06BD ; 0x8006bd 24bc2: 89 2f mov r24, r25 24bc4: 99 0f add r25, r25 24bc6: 99 0b sbc r25, r25 24bc8: aa 0b sbc r26, r26 24bca: bb 0b sbc r27, r27 24bcc: 84 0f add r24, r20 24bce: 95 1f adc r25, r21 24bd0: a6 1f adc r26, r22 24bd2: b7 1f adc r27, r23 24bd4: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 24bd8: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb 24bdc: a0 93 bc 06 sts 0x06BC, r26 ; 0x8006bc 24be0: b0 93 bd 06 sts 0x06BD, r27 ; 0x8006bd STEP_NC_LO(Y_AXIS); 24be4: 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; 24be6: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24bea: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24bee: 80 85 ldd r24, Z+8 ; 0x08 24bf0: 91 85 ldd r25, Z+9 ; 0x09 24bf2: 20 91 cd 05 lds r18, 0x05CD ; 0x8005cd 24bf6: 30 91 ce 05 lds r19, 0x05CE ; 0x8005ce 24bfa: 82 0f add r24, r18 24bfc: 93 1f adc r25, r19 24bfe: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 24c02: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd if (counter[Z_AXIS].lo > 0) { 24c06: 18 16 cp r1, r24 24c08: 19 06 cpc r1, r25 24c0a: 4c f5 brge .+82 ; 0x24c5e <__vector_17+0x672> STEP_NC_HI(Z_AXIS); 24c0c: 42 9a sbi 0x08, 2 ; 8 counter[Z_AXIS].lo -= current_block->step_event_count.lo; 24c0e: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24c12: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24c16: 20 89 ldd r18, Z+16 ; 0x10 24c18: 31 89 ldd r19, Z+17 ; 0x11 24c1a: 82 1b sub r24, r18 24c1c: 93 0b sbc r25, r19 24c1e: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 24c22: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd count_position[Z_AXIS]+=count_direction[Z_AXIS]; 24c26: 90 91 5f 02 lds r25, 0x025F ; 0x80025f 24c2a: 40 91 be 06 lds r20, 0x06BE ; 0x8006be 24c2e: 50 91 bf 06 lds r21, 0x06BF ; 0x8006bf 24c32: 60 91 c0 06 lds r22, 0x06C0 ; 0x8006c0 24c36: 70 91 c1 06 lds r23, 0x06C1 ; 0x8006c1 24c3a: 89 2f mov r24, r25 24c3c: 99 0f add r25, r25 24c3e: 99 0b sbc r25, r25 24c40: aa 0b sbc r26, r26 24c42: bb 0b sbc r27, r27 24c44: 84 0f add r24, r20 24c46: 95 1f adc r25, r21 24c48: a6 1f adc r26, r22 24c4a: b7 1f adc r27, r23 24c4c: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 24c50: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 24c54: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 24c58: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 STEP_NC_LO(Z_AXIS); 24c5c: 42 98 cbi 0x08, 2 ; 8 } // Step in E axis counter[E_AXIS].lo += current_block->steps[E_AXIS].lo; 24c5e: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24c62: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24c66: 80 91 d1 05 lds r24, 0x05D1 ; 0x8005d1 24c6a: 90 91 d2 05 lds r25, 0x05D2 ; 0x8005d2 24c6e: 24 85 ldd r18, Z+12 ; 0x0c 24c70: 35 85 ldd r19, Z+13 ; 0x0d 24c72: 82 0f add r24, r18 24c74: 93 1f adc r25, r19 24c76: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 24c7a: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 24c7e: 20 89 ldd r18, Z+16 ; 0x10 24c80: 31 89 ldd r19, Z+17 ; 0x11 if (counter[E_AXIS].lo > 0) { 24c82: 18 16 cp r1, r24 24c84: 19 06 cpc r1, r25 24c86: 44 f5 brge .+80 ; 0x24cd8 <__vector_17+0x6ec> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].lo -= current_block->step_event_count.lo; 24c88: 82 1b sub r24, r18 24c8a: 93 0b sbc r25, r19 24c8c: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 24c90: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 count_position[E_AXIS] += count_direction[E_AXIS]; 24c94: 90 91 60 02 lds r25, 0x0260 ; 0x800260 24c98: 40 91 c2 06 lds r20, 0x06C2 ; 0x8006c2 24c9c: 50 91 c3 06 lds r21, 0x06C3 ; 0x8006c3 24ca0: 60 91 c4 06 lds r22, 0x06C4 ; 0x8006c4 24ca4: 70 91 c5 06 lds r23, 0x06C5 ; 0x8006c5 24ca8: 89 2f mov r24, r25 24caa: 99 0f add r25, r25 24cac: 99 0b sbc r25, r25 24cae: aa 0b sbc r26, r26 24cb0: bb 0b sbc r27, r27 24cb2: 84 0f add r24, r20 24cb4: 95 1f adc r25, r21 24cb6: a6 1f adc r26, r22 24cb8: b7 1f adc r27, r23 24cba: 80 93 c2 06 sts 0x06C2, r24 ; 0x8006c2 24cbe: 90 93 c3 06 sts 0x06C3, r25 ; 0x8006c3 24cc2: a0 93 c4 06 sts 0x06C4, r26 ; 0x8006c4 24cc6: b0 93 c5 06 sts 0x06C5, r27 ; 0x8006c5 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 24cca: 90 91 60 02 lds r25, 0x0260 ; 0x800260 24cce: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 24cd2: 89 0f add r24, r25 24cd4: 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) 24cd8: 80 91 c0 05 lds r24, 0x05C0 ; 0x8005c0 24cdc: 90 91 c1 05 lds r25, 0x05C1 ; 0x8005c1 24ce0: 01 96 adiw r24, 0x01 ; 1 24ce2: 90 93 c1 05 sts 0x05C1, r25 ; 0x8005c1 24ce6: 80 93 c0 05 sts 0x05C0, r24 ; 0x8005c0 24cea: 82 17 cp r24, r18 24cec: 93 07 cpc r25, r19 24cee: 08 f0 brcs .+2 ; 0x24cf2 <__vector_17+0x706> 24cf0: b9 c1 rjmp .+882 ; 0x25064 <__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) 24cf2: cf 5f subi r28, 0xFF ; 255 24cf4: f5 ce rjmp .-534 ; 0x24ae0 <__vector_17+0x4f4> // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY) if((out_bits & (1< 24cfa: 82 60 ori r24, 0x02 ; 2 24cfc: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=1; 24d00: 81 e0 ldi r24, 0x01 ; 1 24d02: 2e ce rjmp .-932 ; 0x24960 <__vector_17+0x374> } if((out_bits & (1< 24d08: 81 60 ori r24, 0x01 ; 1 24d0a: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=1; 24d0e: 81 e0 ldi r24, 0x01 ; 1 24d10: 33 ce rjmp .-922 ; 0x24978 <__vector_17+0x38c> } if ((out_bits & (1< 24d16: 84 60 ori r24, 0x04 ; 4 24d18: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=1; 24d1c: 81 e0 ldi r24, 0x01 ; 1 24d1e: 38 ce rjmp .-912 ; 0x24990 <__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; 24d20: 81 e0 ldi r24, 0x01 ; 1 24d22: 3d ce rjmp .-902 ; 0x2499e <__vector_17+0x3b2> } } else { _NEXT_ISR(2000); // 1kHz. 24d24: 80 ed ldi r24, 0xD0 ; 208 24d26: 97 e0 ldi r25, 0x07 ; 7 24d28: 90 93 1d 04 sts 0x041D, r25 ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 24d2c: 80 93 1c 04 sts 0x041C, r24 ; 0x80041c <_ZL11nextMainISR.lto_priv.435> 24d30: 90 93 19 04 sts 0x0419, r25 ; 0x800419 <_ZL9main_Rate.lto_priv.437+0x1> 24d34: 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; 24d38: 8f ef ldi r24, 0xFF ; 255 24d3a: 9f ef ldi r25, 0xFF ; 255 24d3c: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 24d40: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> e_steps = 0; 24d44: 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) 24d48: 80 91 16 04 lds r24, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> 24d4c: 90 91 17 04 lds r25, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 24d50: 00 97 sbiw r24, 0x00 ; 0 24d52: 09 f4 brne .+2 ; 0x24d56 <__vector_17+0x76a> 24d54: 26 ce rjmp .-948 ; 0x249a2 <__vector_17+0x3b6> --current_adv_steps; 24d56: 01 97 sbiw r24, 0x01 ; 1 24d58: 90 93 17 04 sts 0x0417, r25 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 24d5c: 80 93 16 04 sts 0x0416, r24 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> 24d60: 20 ce rjmp .-960 ; 0x249a2 <__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)); 24d62: 8e 7f andi r24, 0xFE ; 254 24d64: 39 ce rjmp .-910 ; 0x249d8 <__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)); 24d66: 8d 7f andi r24, 0xFD ; 253 24d68: 56 ce rjmp .-852 ; 0x24a16 <__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)); 24d6a: 8b 7f andi r24, 0xFB ; 251 24d6c: 75 ce rjmp .-790 ; 0x24a58 <__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)); 24d6e: 01 99 sbic 0x00, 1 ; 0 24d70: 03 c0 rjmp .+6 ; 0x24d78 <__vector_17+0x78c> 24d72: 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)) { 24d74: 90 74 andi r25, 0x40 ; 64 24d76: 71 ce rjmp .-798 ; 0x24a5a <__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)); 24d78: 8f 7b andi r24, 0xBF ; 191 24d7a: fc cf rjmp .-8 ; 0x24d74 <__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)); 24d7c: 8b 7f andi r24, 0xFB ; 251 24d7e: 96 ce rjmp .-724 ; 0x24aac <__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) 24d80: 80 91 dd 05 lds r24, 0x05DD ; 0x8005dd 24d84: c8 17 cp r28, r24 24d86: 08 f0 brcs .+2 ; 0x24d8a <__vector_17+0x79e> 24d88: 6d c1 rjmp .+730 ; 0x25064 <__vector_17+0xa78> MSerial.checkRx(); // Check for serial chars. 24d8a: 0e 94 ef fb call 0x1f7de ; 0x1f7de // Step in X axis counter[X_AXIS].wide += current_block->steps[X_AXIS].wide; 24d8e: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24d92: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24d96: 80 81 ld r24, Z 24d98: 91 81 ldd r25, Z+1 ; 0x01 24d9a: a2 81 ldd r26, Z+2 ; 0x02 24d9c: b3 81 ldd r27, Z+3 ; 0x03 24d9e: 40 91 c5 05 lds r20, 0x05C5 ; 0x8005c5 24da2: 50 91 c6 05 lds r21, 0x05C6 ; 0x8005c6 24da6: 60 91 c7 05 lds r22, 0x05C7 ; 0x8005c7 24daa: 70 91 c8 05 lds r23, 0x05C8 ; 0x8005c8 24dae: 84 0f add r24, r20 24db0: 95 1f adc r25, r21 24db2: a6 1f adc r26, r22 24db4: b7 1f adc r27, r23 24db6: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 24dba: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 24dbe: a0 93 c7 05 sts 0x05C7, r26 ; 0x8005c7 24dc2: b0 93 c8 05 sts 0x05C8, r27 ; 0x8005c8 if (counter[X_AXIS].wide > 0) { 24dc6: 18 16 cp r1, r24 24dc8: 19 06 cpc r1, r25 24dca: 1a 06 cpc r1, r26 24dcc: 1b 06 cpc r1, r27 24dce: cc f5 brge .+114 ; 0x24e42 <__vector_17+0x856> STEP_NC_HI(X_AXIS); 24dd0: 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; 24dd2: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24dd6: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24dda: 80 91 c5 05 lds r24, 0x05C5 ; 0x8005c5 24dde: 90 91 c6 05 lds r25, 0x05C6 ; 0x8005c6 24de2: a0 91 c7 05 lds r26, 0x05C7 ; 0x8005c7 24de6: b0 91 c8 05 lds r27, 0x05C8 ; 0x8005c8 24dea: 40 89 ldd r20, Z+16 ; 0x10 24dec: 51 89 ldd r21, Z+17 ; 0x11 24dee: 62 89 ldd r22, Z+18 ; 0x12 24df0: 73 89 ldd r23, Z+19 ; 0x13 24df2: 84 1b sub r24, r20 24df4: 95 0b sbc r25, r21 24df6: a6 0b sbc r26, r22 24df8: b7 0b sbc r27, r23 24dfa: 80 93 c5 05 sts 0x05C5, r24 ; 0x8005c5 24dfe: 90 93 c6 05 sts 0x05C6, r25 ; 0x8005c6 24e02: a0 93 c7 05 sts 0x05C7, r26 ; 0x8005c7 24e06: b0 93 c8 05 sts 0x05C8, r27 ; 0x8005c8 count_position[X_AXIS]+=count_direction[X_AXIS]; 24e0a: 90 91 5d 02 lds r25, 0x025D ; 0x80025d 24e0e: 40 91 b6 06 lds r20, 0x06B6 ; 0x8006b6 24e12: 50 91 b7 06 lds r21, 0x06B7 ; 0x8006b7 24e16: 60 91 b8 06 lds r22, 0x06B8 ; 0x8006b8 24e1a: 70 91 b9 06 lds r23, 0x06B9 ; 0x8006b9 24e1e: 89 2f mov r24, r25 24e20: 99 0f add r25, r25 24e22: 99 0b sbc r25, r25 24e24: aa 0b sbc r26, r26 24e26: bb 0b sbc r27, r27 24e28: 84 0f add r24, r20 24e2a: 95 1f adc r25, r21 24e2c: a6 1f adc r26, r22 24e2e: b7 1f adc r27, r23 24e30: 80 93 b6 06 sts 0x06B6, r24 ; 0x8006b6 24e34: 90 93 b7 06 sts 0x06B7, r25 ; 0x8006b7 24e38: a0 93 b8 06 sts 0x06B8, r26 ; 0x8006b8 24e3c: b0 93 b9 06 sts 0x06B9, r27 ; 0x8006b9 STEP_NC_LO(X_AXIS); 24e40: 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; 24e42: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24e46: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24e4a: 84 81 ldd r24, Z+4 ; 0x04 24e4c: 95 81 ldd r25, Z+5 ; 0x05 24e4e: a6 81 ldd r26, Z+6 ; 0x06 24e50: b7 81 ldd r27, Z+7 ; 0x07 24e52: 40 91 c9 05 lds r20, 0x05C9 ; 0x8005c9 24e56: 50 91 ca 05 lds r21, 0x05CA ; 0x8005ca 24e5a: 60 91 cb 05 lds r22, 0x05CB ; 0x8005cb 24e5e: 70 91 cc 05 lds r23, 0x05CC ; 0x8005cc 24e62: 84 0f add r24, r20 24e64: 95 1f adc r25, r21 24e66: a6 1f adc r26, r22 24e68: b7 1f adc r27, r23 24e6a: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 24e6e: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 24e72: a0 93 cb 05 sts 0x05CB, r26 ; 0x8005cb 24e76: b0 93 cc 05 sts 0x05CC, r27 ; 0x8005cc if (counter[Y_AXIS].wide > 0) { 24e7a: 18 16 cp r1, r24 24e7c: 19 06 cpc r1, r25 24e7e: 1a 06 cpc r1, r26 24e80: 1b 06 cpc r1, r27 24e82: 8c f5 brge .+98 ; 0x24ee6 <__vector_17+0x8fa> STEP_NC_HI(Y_AXIS); 24e84: 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; 24e86: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24e8a: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24e8e: 40 89 ldd r20, Z+16 ; 0x10 24e90: 51 89 ldd r21, Z+17 ; 0x11 24e92: 62 89 ldd r22, Z+18 ; 0x12 24e94: 73 89 ldd r23, Z+19 ; 0x13 24e96: 84 1b sub r24, r20 24e98: 95 0b sbc r25, r21 24e9a: a6 0b sbc r26, r22 24e9c: b7 0b sbc r27, r23 24e9e: 80 93 c9 05 sts 0x05C9, r24 ; 0x8005c9 24ea2: 90 93 ca 05 sts 0x05CA, r25 ; 0x8005ca 24ea6: a0 93 cb 05 sts 0x05CB, r26 ; 0x8005cb 24eaa: b0 93 cc 05 sts 0x05CC, r27 ; 0x8005cc count_position[Y_AXIS]+=count_direction[Y_AXIS]; 24eae: 90 91 5e 02 lds r25, 0x025E ; 0x80025e 24eb2: 40 91 ba 06 lds r20, 0x06BA ; 0x8006ba 24eb6: 50 91 bb 06 lds r21, 0x06BB ; 0x8006bb 24eba: 60 91 bc 06 lds r22, 0x06BC ; 0x8006bc 24ebe: 70 91 bd 06 lds r23, 0x06BD ; 0x8006bd 24ec2: 89 2f mov r24, r25 24ec4: 99 0f add r25, r25 24ec6: 99 0b sbc r25, r25 24ec8: aa 0b sbc r26, r26 24eca: bb 0b sbc r27, r27 24ecc: 84 0f add r24, r20 24ece: 95 1f adc r25, r21 24ed0: a6 1f adc r26, r22 24ed2: b7 1f adc r27, r23 24ed4: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 24ed8: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb 24edc: a0 93 bc 06 sts 0x06BC, r26 ; 0x8006bc 24ee0: b0 93 bd 06 sts 0x06BD, r27 ; 0x8006bd STEP_NC_LO(Y_AXIS); 24ee4: 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; 24ee6: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24eea: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24eee: 80 85 ldd r24, Z+8 ; 0x08 24ef0: 91 85 ldd r25, Z+9 ; 0x09 24ef2: a2 85 ldd r26, Z+10 ; 0x0a 24ef4: b3 85 ldd r27, Z+11 ; 0x0b 24ef6: 40 91 cd 05 lds r20, 0x05CD ; 0x8005cd 24efa: 50 91 ce 05 lds r21, 0x05CE ; 0x8005ce 24efe: 60 91 cf 05 lds r22, 0x05CF ; 0x8005cf 24f02: 70 91 d0 05 lds r23, 0x05D0 ; 0x8005d0 24f06: 84 0f add r24, r20 24f08: 95 1f adc r25, r21 24f0a: a6 1f adc r26, r22 24f0c: b7 1f adc r27, r23 24f0e: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd 24f12: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 24f16: a0 93 cf 05 sts 0x05CF, r26 ; 0x8005cf 24f1a: b0 93 d0 05 sts 0x05D0, r27 ; 0x8005d0 if (counter[Z_AXIS].wide > 0) { 24f1e: 18 16 cp r1, r24 24f20: 19 06 cpc r1, r25 24f22: 1a 06 cpc r1, r26 24f24: 1b 06 cpc r1, r27 24f26: 8c f5 brge .+98 ; 0x24f8a <__vector_17+0x99e> STEP_NC_HI(Z_AXIS); 24f28: 42 9a sbi 0x08, 2 ; 8 counter[Z_AXIS].wide -= current_block->step_event_count.wide; 24f2a: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24f2e: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24f32: 40 89 ldd r20, Z+16 ; 0x10 24f34: 51 89 ldd r21, Z+17 ; 0x11 24f36: 62 89 ldd r22, Z+18 ; 0x12 24f38: 73 89 ldd r23, Z+19 ; 0x13 24f3a: 84 1b sub r24, r20 24f3c: 95 0b sbc r25, r21 24f3e: a6 0b sbc r26, r22 24f40: b7 0b sbc r27, r23 24f42: 80 93 cd 05 sts 0x05CD, r24 ; 0x8005cd 24f46: 90 93 ce 05 sts 0x05CE, r25 ; 0x8005ce 24f4a: a0 93 cf 05 sts 0x05CF, r26 ; 0x8005cf 24f4e: b0 93 d0 05 sts 0x05D0, r27 ; 0x8005d0 count_position[Z_AXIS]+=count_direction[Z_AXIS]; 24f52: 90 91 5f 02 lds r25, 0x025F ; 0x80025f 24f56: 40 91 be 06 lds r20, 0x06BE ; 0x8006be 24f5a: 50 91 bf 06 lds r21, 0x06BF ; 0x8006bf 24f5e: 60 91 c0 06 lds r22, 0x06C0 ; 0x8006c0 24f62: 70 91 c1 06 lds r23, 0x06C1 ; 0x8006c1 24f66: 89 2f mov r24, r25 24f68: 99 0f add r25, r25 24f6a: 99 0b sbc r25, r25 24f6c: aa 0b sbc r26, r26 24f6e: bb 0b sbc r27, r27 24f70: 84 0f add r24, r20 24f72: 95 1f adc r25, r21 24f74: a6 1f adc r26, r22 24f76: b7 1f adc r27, r23 24f78: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 24f7c: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 24f80: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 24f84: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 STEP_NC_LO(Z_AXIS); 24f88: 42 98 cbi 0x08, 2 ; 8 } // Step in E axis counter[E_AXIS].wide += current_block->steps[E_AXIS].wide; 24f8a: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 24f8e: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 24f92: 80 91 d1 05 lds r24, 0x05D1 ; 0x8005d1 24f96: 90 91 d2 05 lds r25, 0x05D2 ; 0x8005d2 24f9a: a0 91 d3 05 lds r26, 0x05D3 ; 0x8005d3 24f9e: b0 91 d4 05 lds r27, 0x05D4 ; 0x8005d4 24fa2: 44 85 ldd r20, Z+12 ; 0x0c 24fa4: 55 85 ldd r21, Z+13 ; 0x0d 24fa6: 66 85 ldd r22, Z+14 ; 0x0e 24fa8: 77 85 ldd r23, Z+15 ; 0x0f 24faa: 84 0f add r24, r20 24fac: 95 1f adc r25, r21 24fae: a6 1f adc r26, r22 24fb0: b7 1f adc r27, r23 24fb2: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 24fb6: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 24fba: a0 93 d3 05 sts 0x05D3, r26 ; 0x8005d3 24fbe: b0 93 d4 05 sts 0x05D4, r27 ; 0x8005d4 24fc2: 40 89 ldd r20, Z+16 ; 0x10 24fc4: 51 89 ldd r21, Z+17 ; 0x11 24fc6: 62 89 ldd r22, Z+18 ; 0x12 24fc8: 73 89 ldd r23, Z+19 ; 0x13 if (counter[E_AXIS].wide > 0) { 24fca: 18 16 cp r1, r24 24fcc: 19 06 cpc r1, r25 24fce: 1a 06 cpc r1, r26 24fd0: 1b 06 cpc r1, r27 24fd2: 74 f5 brge .+92 ; 0x25030 <__vector_17+0xa44> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].wide -= current_block->step_event_count.wide; 24fd4: 84 1b sub r24, r20 24fd6: 95 0b sbc r25, r21 24fd8: a6 0b sbc r26, r22 24fda: b7 0b sbc r27, r23 24fdc: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 24fe0: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 24fe4: a0 93 d3 05 sts 0x05D3, r26 ; 0x8005d3 24fe8: b0 93 d4 05 sts 0x05D4, r27 ; 0x8005d4 count_position[E_AXIS] += count_direction[E_AXIS]; 24fec: 90 91 60 02 lds r25, 0x0260 ; 0x800260 24ff0: c0 90 c2 06 lds r12, 0x06C2 ; 0x8006c2 24ff4: d0 90 c3 06 lds r13, 0x06C3 ; 0x8006c3 24ff8: e0 90 c4 06 lds r14, 0x06C4 ; 0x8006c4 24ffc: f0 90 c5 06 lds r15, 0x06C5 ; 0x8006c5 25000: 89 2f mov r24, r25 25002: 99 0f add r25, r25 25004: 99 0b sbc r25, r25 25006: aa 0b sbc r26, r26 25008: bb 0b sbc r27, r27 2500a: 8c 0d add r24, r12 2500c: 9d 1d adc r25, r13 2500e: ae 1d adc r26, r14 25010: bf 1d adc r27, r15 25012: 80 93 c2 06 sts 0x06C2, r24 ; 0x8006c2 25016: 90 93 c3 06 sts 0x06C3, r25 ; 0x8006c3 2501a: a0 93 c4 06 sts 0x06C4, r26 ; 0x8006c4 2501e: b0 93 c5 06 sts 0x06C5, r27 ; 0x8006c5 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 25022: 90 91 60 02 lds r25, 0x0260 ; 0x800260 25026: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 2502a: 89 0f add r24, r25 2502c: 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) 25030: 80 91 c0 05 lds r24, 0x05C0 ; 0x8005c0 25034: 90 91 c1 05 lds r25, 0x05C1 ; 0x8005c1 25038: a0 91 c2 05 lds r26, 0x05C2 ; 0x8005c2 2503c: b0 91 c3 05 lds r27, 0x05C3 ; 0x8005c3 25040: 01 96 adiw r24, 0x01 ; 1 25042: a1 1d adc r26, r1 25044: b1 1d adc r27, r1 25046: 80 93 c0 05 sts 0x05C0, r24 ; 0x8005c0 2504a: 90 93 c1 05 sts 0x05C1, r25 ; 0x8005c1 2504e: a0 93 c2 05 sts 0x05C2, r26 ; 0x8005c2 25052: b0 93 c3 05 sts 0x05C3, r27 ; 0x8005c3 25056: 84 17 cp r24, r20 25058: 95 07 cpc r25, r21 2505a: a6 07 cpc r26, r22 2505c: b7 07 cpc r27, r23 2505e: 10 f4 brcc .+4 ; 0x25064 <__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) 25060: cf 5f subi r28, 0xFF ; 255 25062: 8e ce rjmp .-740 ; 0x24d80 <__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); 25064: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 25068: 88 23 and r24, r24 2506a: 39 f0 breq .+14 ; 0x2507a <__vector_17+0xa8e> 2506c: 87 ff sbrs r24, 7 2506e: f2 c0 rjmp .+484 ; 0x25254 <__vector_17+0xc68> 25070: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 25074: 80 64 ori r24, 0x40 ; 64 25076: 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) { 2507a: 40 91 c0 05 lds r20, 0x05C0 ; 0x8005c0 2507e: 50 91 c1 05 lds r21, 0x05C1 ; 0x8005c1 25082: 60 91 c2 05 lds r22, 0x05C2 ; 0x8005c2 25086: 70 91 c3 05 lds r23, 0x05C3 ; 0x8005c3 2508a: c0 91 e4 11 lds r28, 0x11E4 ; 0x8011e4 2508e: d0 91 e5 11 lds r29, 0x11E5 ; 0x8011e5 25092: 89 8d ldd r24, Y+25 ; 0x19 25094: 9a 8d ldd r25, Y+26 ; 0x1a 25096: ab 8d ldd r26, Y+27 ; 0x1b 25098: bc 8d ldd r27, Y+28 ; 0x1c 2509a: 84 17 cp r24, r20 2509c: 95 07 cpc r25, r21 2509e: a6 07 cpc r26, r22 250a0: b7 07 cpc r27, r23 250a2: 08 f4 brcc .+2 ; 0x250a6 <__vector_17+0xaba> 250a4: 37 c1 rjmp .+622 ; 0x25314 <__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); 250a6: c0 90 d9 05 lds r12, 0x05D9 ; 0x8005d9 250aa: d0 90 da 05 lds r13, 0x05DA ; 0x8005da 250ae: e0 90 db 05 lds r14, 0x05DB ; 0x8005db 250b2: 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. ); 250b6: 2c 89 ldd r18, Y+20 ; 0x14 250b8: 3d 89 ldd r19, Y+21 ; 0x15 250ba: 4e 89 ldd r20, Y+22 ; 0x16 250bc: aa 27 eor r26, r26 250be: c3 9e mul r12, r19 250c0: b1 2d mov r27, r1 250c2: d4 9e mul r13, r20 250c4: c0 01 movw r24, r0 250c6: e4 9e mul r14, r20 250c8: 90 0d add r25, r0 250ca: e3 9e mul r14, r19 250cc: 80 0d add r24, r0 250ce: 91 1d adc r25, r1 250d0: c4 9e mul r12, r20 250d2: b0 0d add r27, r0 250d4: 81 1d adc r24, r1 250d6: 9a 1f adc r25, r26 250d8: d3 9e mul r13, r19 250da: b0 0d add r27, r0 250dc: 81 1d adc r24, r1 250de: 9a 1f adc r25, r26 250e0: e2 9e mul r14, r18 250e2: b0 0d add r27, r0 250e4: 81 1d adc r24, r1 250e6: 9a 1f adc r25, r26 250e8: d2 9e mul r13, r18 250ea: b1 0d add r27, r1 250ec: 8a 1f adc r24, r26 250ee: 9a 1f adc r25, r26 250f0: bb 0f add r27, r27 250f2: 8a 1f adc r24, r26 250f4: 9a 1f adc r25, r26 250f6: 11 24 eor r1, r1 acc_step_rate += uint16_t(current_block->initial_rate); 250f8: 2a ad ldd r18, Y+58 ; 0x3a 250fa: 3b ad ldd r19, Y+59 ; 0x3b 250fc: 82 0f add r24, r18 250fe: 93 1f adc r25, r19 25100: 90 93 df 05 sts 0x05DF, r25 ; 0x8005df 25104: 80 93 de 05 sts 0x05DE, r24 ; 0x8005de // upper limit if(acc_step_rate > uint16_t(current_block->nominal_rate)) 25108: 2e a9 ldd r18, Y+54 ; 0x36 2510a: 3f a9 ldd r19, Y+55 ; 0x37 2510c: 28 17 cp r18, r24 2510e: 39 07 cpc r19, r25 25110: 20 f4 brcc .+8 ; 0x2511a <__vector_17+0xb2e> acc_step_rate = current_block->nominal_rate; 25112: 30 93 df 05 sts 0x05DF, r19 ; 0x8005df 25116: 20 93 de 05 sts 0x05DE, r18 ; 0x8005de // step_rate to timer interval uint16_t timer = calc_timer(acc_step_rate, step_loops); 2511a: 80 91 de 05 lds r24, 0x05DE ; 0x8005de 2511e: 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; 25122: 81 34 cpi r24, 0x41 ; 65 25124: bc e9 ldi r27, 0x9C ; 156 25126: 9b 07 cpc r25, r27 25128: 08 f0 brcs .+2 ; 0x2512c <__vector_17+0xb40> 2512a: 98 c0 rjmp .+304 ; 0x2525c <__vector_17+0xc70> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2512c: 81 32 cpi r24, 0x21 ; 33 2512e: ee e4 ldi r30, 0x4E ; 78 25130: 9e 07 cpc r25, r30 25132: 08 f4 brcc .+2 ; 0x25136 <__vector_17+0xb4a> 25134: 96 c0 rjmp .+300 ; 0x25262 <__vector_17+0xc76> step_rate = (step_rate >> 2)&0x3fff; 25136: 96 95 lsr r25 25138: 87 95 ror r24 2513a: 96 95 lsr r25 2513c: 87 95 ror r24 step_loops = 4; 2513e: 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; 25140: 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 25144: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 25146: 81 15 cp r24, r1 25148: 28 e0 ldi r18, 0x08 ; 8 2514a: 92 07 cpc r25, r18 2514c: 08 f4 brcc .+2 ; 0x25150 <__vector_17+0xb64> 2514e: 9b c0 rjmp .+310 ; 0x25286 <__vector_17+0xc9a> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 25150: e9 2f mov r30, r25 25152: ff 27 eor r31, r31 25154: ee 0f add r30, r30 25156: ff 1f adc r31, r31 25158: ee 0f add r30, r30 2515a: ff 1f adc r31, r31 2515c: 9f 01 movw r18, r30 2515e: 2a 52 subi r18, 0x2A ; 42 25160: 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); 25162: f9 01 movw r30, r18 25164: 32 96 adiw r30, 0x02 ; 2 25166: 45 91 lpm r20, Z+ 25168: 54 91 lpm r21, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2516a: f9 01 movw r30, r18 2516c: 25 91 lpm r18, Z+ 2516e: 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. ); 25170: 58 9f mul r21, r24 25172: b0 01 movw r22, r0 25174: 48 9f mul r20, r24 25176: 00 0c add r0, r0 25178: 61 1d adc r22, r1 2517a: 11 24 eor r1, r1 2517c: 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); 2517e: 26 1b sub r18, r22 25180: 37 0b sbc r19, r23 25182: c9 01 movw r24, r18 25184: 24 36 cpi r18, 0x64 ; 100 25186: 31 05 cpc r19, r1 25188: 10 f4 brcc .+4 ; 0x2518e <__vector_17+0xba2> 2518a: 84 e6 ldi r24, 0x64 ; 100 2518c: 90 e0 ldi r25, 0x00 ; 0 _NEXT_ISR(timer); 2518e: 90 93 1d 04 sts 0x041D, r25 ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 25192: 80 93 1c 04 sts 0x041C, r24 ; 0x80041c <_ZL11nextMainISR.lto_priv.435> 25196: 90 93 19 04 sts 0x0419, r25 ; 0x800419 <_ZL9main_Rate.lto_priv.437+0x1> 2519a: 80 93 18 04 sts 0x0418, r24 ; 0x800418 <_ZL9main_Rate.lto_priv.437> acceleration_time += timer; 2519e: c8 0e add r12, r24 251a0: d9 1e adc r13, r25 251a2: e1 1c adc r14, r1 251a4: f1 1c adc r15, r1 251a6: c0 92 d9 05 sts 0x05D9, r12 ; 0x8005d9 251aa: d0 92 da 05 sts 0x05DA, r13 ; 0x8005da 251ae: e0 92 db 05 sts 0x05DB, r14 ; 0x8005db 251b2: f0 92 dc 05 sts 0x05DC, r15 ; 0x8005dc #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 251b6: fe 01 movw r30, r28 251b8: e4 5b subi r30, 0xB4 ; 180 251ba: ff 4f sbci r31, 0xFF ; 255 251bc: 80 81 ld r24, Z 251be: 81 11 cpse r24, r1 251c0: 80 c0 rjmp .+256 ; 0x252c2 <__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; 251c2: 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) { 251c4: 80 ff sbrs r24, 0 251c6: 16 c0 rjmp .+44 ; 0x251f4 <__vector_17+0xc08> LA_phase = -1; 251c8: 9f ef ldi r25, 0xFF ; 255 251ca: 90 93 d5 05 sts 0x05D5, r25 ; 0x8005d5 if (current_adv_steps == target_adv_steps) { 251ce: e0 91 16 04 lds r30, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> 251d2: f0 91 17 04 lds r31, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 251d6: 20 91 d7 05 lds r18, 0x05D7 ; 0x8005d7 251da: 30 91 d8 05 lds r19, 0x05D8 ; 0x8005d8 251de: e2 17 cp r30, r18 251e0: f3 07 cpc r31, r19 251e2: 09 f0 breq .+2 ; 0x251e6 <__vector_17+0xbfa> 251e4: 27 c2 rjmp .+1102 ; 0x25634 <__vector_17+0x1048> // nothing to be done in this phase, cancel any pending eisr la_state = 0; nextAdvanceISR = ADV_NEVER; 251e6: 8f ef ldi r24, 0xFF ; 255 251e8: 9f ef ldi r25, 0xFF ; 255 251ea: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 251ee: 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; 251f2: 80 e0 ldi r24, 0x00 ; 0 eISR_Err += current_block->advance_rate; LA_phase = 0; } } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { 251f4: 80 fd sbrc r24, 0 251f6: 07 c0 rjmp .+14 ; 0x25206 <__vector_17+0xc1a> 251f8: 80 91 1a 04 lds r24, 0x041A ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> 251fc: 90 91 1b 04 lds r25, 0x041B ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 25200: 01 96 adiw r24, 0x01 ; 1 25202: 09 f4 brne .+2 ; 0x25206 <__vector_17+0xc1a> 25204: b7 c2 rjmp .+1390 ; 0x25774 <__vector_17+0x1188> // update timers & phase for the next iteration advance_spread(main_Rate); 25206: e0 91 18 04 lds r30, 0x0418 ; 0x800418 <_ZL9main_Rate.lto_priv.437> 2520a: 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; 2520e: 80 91 b6 05 lds r24, 0x05B6 ; 0x8005b6 25212: 90 91 b7 05 lds r25, 0x05B7 ; 0x8005b7 25216: a0 91 b8 05 lds r26, 0x05B8 ; 0x8005b8 2521a: b0 91 b9 05 lds r27, 0x05B9 ; 0x8005b9 2521e: 2c 01 movw r4, r24 25220: 3d 01 movw r6, r26 25222: 4e 0e add r4, r30 25224: 5f 1e adc r5, r31 25226: 61 1c adc r6, r1 25228: 71 1c adc r7, r1 uint8_t ticks = 0; while(eISR_Err >= current_block->advance_rate) 2522a: 9e 01 movw r18, r28 2522c: 23 5b subi r18, 0xB3 ; 179 2522e: 3f 4f sbci r19, 0xFF ; 255 25230: d9 01 movw r26, r18 25232: cd 90 ld r12, X+ 25234: dc 90 ld r13, X 25236: f1 2c mov r15, r1 25238: e1 2c mov r14, r1 FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; uint8_t ticks = 0; 2523a: 60 e0 ldi r22, 0x00 ; 0 while(eISR_Err >= current_block->advance_rate) 2523c: 4c 14 cp r4, r12 2523e: 5d 04 cpc r5, r13 25240: 6e 04 cpc r6, r14 25242: 7f 04 cpc r7, r15 25244: 08 f4 brcc .+2 ; 0x25248 <__vector_17+0xc5c> 25246: 26 c2 rjmp .+1100 ; 0x25694 <__vector_17+0x10a8> { ++ticks; 25248: 6f 5f subi r22, 0xFF ; 255 eISR_Err -= current_block->advance_rate; 2524a: 4c 18 sub r4, r12 2524c: 5d 08 sbc r5, r13 2524e: 6e 08 sbc r6, r14 25250: 7f 08 sbc r7, r15 25252: f4 cf rjmp .-24 ; 0x2523c <__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); 25254: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 25258: 8f 7b andi r24, 0xBF ; 191 2525a: 0d cf rjmp .-486 ; 0x25076 <__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; 2525c: 80 e4 ldi r24, 0x40 ; 64 2525e: 9c e9 ldi r25, 0x9C ; 156 25260: 6a cf rjmp .-300 ; 0x25136 <__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 25262: 81 31 cpi r24, 0x11 ; 17 25264: f7 e2 ldi r31, 0x27 ; 39 25266: 9f 07 cpc r25, r31 25268: 20 f0 brcs .+8 ; 0x25272 <__vector_17+0xc86> step_rate = (step_rate >> 1)&0x7fff; 2526a: 96 95 lsr r25 2526c: 87 95 ror r24 step_loops = 2; 2526e: 22 e0 ldi r18, 0x02 ; 2 25270: 67 cf rjmp .-306 ; 0x25140 <__vector_17+0xb54> } else { step_loops = 1; 25272: 21 e0 ldi r18, 0x01 ; 1 25274: 20 93 dd 05 sts 0x05DD, r18 ; 0x8005dd 25278: 80 32 cpi r24, 0x20 ; 32 2527a: 91 05 cpc r25, r1 2527c: 08 f0 brcs .+2 ; 0x25280 <__vector_17+0xc94> 2527e: 62 cf rjmp .-316 ; 0x25144 <__vector_17+0xb58> 25280: 80 e2 ldi r24, 0x20 ; 32 25282: 90 e0 ldi r25, 0x00 ; 0 25284: 5f cf rjmp .-322 ; 0x25144 <__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; 25286: ac 01 movw r20, r24 25288: 56 95 lsr r21 2528a: 47 95 ror r20 2528c: 4c 7f andi r20, 0xFC ; 252 2528e: 4a 52 subi r20, 0x2A ; 42 25290: 57 47 sbci r21, 0x77 ; 119 timer = (unsigned short)pgm_read_word_near(table_address); 25292: fa 01 movw r30, r20 25294: 25 91 lpm r18, Z+ 25296: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 25298: fa 01 movw r30, r20 2529a: 32 96 adiw r30, 0x02 ; 2 2529c: 65 91 lpm r22, Z+ 2529e: 74 91 lpm r23, Z 252a0: 87 70 andi r24, 0x07 ; 7 252a2: 99 27 eor r25, r25 252a4: 86 9f mul r24, r22 252a6: a0 01 movw r20, r0 252a8: 87 9f mul r24, r23 252aa: 50 0d add r21, r0 252ac: 96 9f mul r25, r22 252ae: 50 0d add r21, r0 252b0: 11 24 eor r1, r1 252b2: 73 e0 ldi r23, 0x03 ; 3 252b4: 56 95 lsr r21 252b6: 47 95 ror r20 252b8: 7a 95 dec r23 252ba: e1 f7 brne .-8 ; 0x252b4 <__vector_17+0xcc8> 252bc: 24 1b sub r18, r20 252be: 35 0b sbc r19, r21 252c0: 60 cf rjmp .-320 ; 0x25182 <__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) { 252c2: 40 91 c0 05 lds r20, 0x05C0 ; 0x8005c0 252c6: 50 91 c1 05 lds r21, 0x05C1 ; 0x8005c1 252ca: 60 91 c2 05 lds r22, 0x05C2 ; 0x8005c2 252ce: 70 91 c3 05 lds r23, 0x05C3 ; 0x8005c3 252d2: 80 91 dd 05 lds r24, 0x05DD ; 0x8005dd 252d6: 90 e0 ldi r25, 0x00 ; 0 252d8: b0 e0 ldi r27, 0x00 ; 0 252da: a0 e0 ldi r26, 0x00 ; 0 252dc: 84 17 cp r24, r20 252de: 95 07 cpc r25, r21 252e0: a6 07 cpc r26, r22 252e2: b7 07 cpc r27, r23 252e4: 08 f4 brcc .+2 ; 0x252e8 <__vector_17+0xcfc> 252e6: 6d cf rjmp .-294 ; 0x251c2 <__vector_17+0xbd6> la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps > target_adv_steps) 252e8: 80 91 c4 05 lds r24, 0x05C4 ; 0x8005c4 252ec: 81 11 cpse r24, r1 252ee: 02 c0 rjmp .+4 ; 0x252f4 <__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; 252f0: 83 e0 ldi r24, 0x03 ; 3 252f2: 68 cf rjmp .-304 ; 0x251c4 <__vector_17+0xbd8> if (e_extruding && current_adv_steps > target_adv_steps) 252f4: 80 91 16 04 lds r24, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> 252f8: 90 91 17 04 lds r25, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 252fc: 20 91 d7 05 lds r18, 0x05D7 ; 0x8005d7 25300: 30 91 d8 05 lds r19, 0x05D8 ; 0x8005d8 25304: 28 17 cp r18, r24 25306: 39 07 cpc r19, r25 25308: 98 f7 brcc .-26 ; 0x252f0 <__vector_17+0xd04> target_adv_steps = current_adv_steps; 2530a: 90 93 d8 05 sts 0x05D8, r25 ; 0x8005d8 2530e: 80 93 d7 05 sts 0x05D7, r24 ; 0x8005d7 25312: ee cf rjmp .-36 ; 0x252f0 <__vector_17+0xd04> } } #endif } else if (step_events_completed.wide > current_block->decelerate_after) { 25314: 80 91 c0 05 lds r24, 0x05C0 ; 0x8005c0 25318: 90 91 c1 05 lds r25, 0x05C1 ; 0x8005c1 2531c: a0 91 c2 05 lds r26, 0x05C2 ; 0x8005c2 25320: b0 91 c3 05 lds r27, 0x05C3 ; 0x8005c3 25324: 4d 8d ldd r20, Y+29 ; 0x1d 25326: 5e 8d ldd r21, Y+30 ; 0x1e 25328: 6f 8d ldd r22, Y+31 ; 0x1f 2532a: 78 a1 ldd r23, Y+32 ; 0x20 2532c: 48 17 cp r20, r24 2532e: 59 07 cpc r21, r25 25330: 6a 07 cpc r22, r26 25332: 7b 07 cpc r23, r27 25334: 08 f0 brcs .+2 ; 0x25338 <__vector_17+0xd4c> 25336: e3 c0 rjmp .+454 ; 0x254fe <__vector_17+0xf12> uint16_t step_rate = MUL24x24R24(deceleration_time, current_block->acceleration_rate); 25338: c0 90 e1 05 lds r12, 0x05E1 ; 0x8005e1 2533c: d0 90 e2 05 lds r13, 0x05E2 ; 0x8005e2 25340: e0 90 e3 05 lds r14, 0x05E3 ; 0x8005e3 25344: 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. ); 25348: 6c 88 ldd r6, Y+20 ; 0x14 2534a: 7d 88 ldd r7, Y+21 ; 0x15 2534c: 8e 88 ldd r8, Y+22 ; 0x16 2534e: aa 27 eor r26, r26 25350: c7 9c mul r12, r7 25352: b1 2d mov r27, r1 25354: d8 9c mul r13, r8 25356: f0 01 movw r30, r0 25358: e8 9c mul r14, r8 2535a: f0 0d add r31, r0 2535c: e7 9c mul r14, r7 2535e: e0 0d add r30, r0 25360: f1 1d adc r31, r1 25362: c8 9c mul r12, r8 25364: b0 0d add r27, r0 25366: e1 1d adc r30, r1 25368: fa 1f adc r31, r26 2536a: d7 9c mul r13, r7 2536c: b0 0d add r27, r0 2536e: e1 1d adc r30, r1 25370: fa 1f adc r31, r26 25372: e6 9c mul r14, r6 25374: b0 0d add r27, r0 25376: e1 1d adc r30, r1 25378: fa 1f adc r31, r26 2537a: d6 9c mul r13, r6 2537c: b1 0d add r27, r1 2537e: ea 1f adc r30, r26 25380: fa 1f adc r31, r26 25382: bb 0f add r27, r27 25384: ea 1f adc r30, r26 25386: fa 1f adc r31, r26 25388: 11 24 eor r1, r1 if (step_rate > acc_step_rate) { // Check step_rate stays positive 2538a: 20 91 de 05 lds r18, 0x05DE ; 0x8005de 2538e: 30 91 df 05 lds r19, 0x05DF ; 0x8005df 25392: 8e ad ldd r24, Y+62 ; 0x3e 25394: 9f ad ldd r25, Y+63 ; 0x3f 25396: 2e 17 cp r18, r30 25398: 3f 07 cpc r19, r31 2539a: 30 f0 brcs .+12 ; 0x253a8 <__vector_17+0xdbc> step_rate = uint16_t(current_block->final_rate); } else { step_rate = acc_step_rate - step_rate; // Decelerate from acceleration end point. 2539c: 2e 1b sub r18, r30 2539e: 3f 0b sbc r19, r31 253a0: 82 17 cp r24, r18 253a2: 93 07 cpc r25, r19 253a4: 08 f4 brcc .+2 ; 0x253a8 <__vector_17+0xdbc> 253a6: 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; 253a8: 81 34 cpi r24, 0x41 ; 65 253aa: ac e9 ldi r26, 0x9C ; 156 253ac: 9a 07 cpc r25, r26 253ae: 08 f0 brcs .+2 ; 0x253b2 <__vector_17+0xdc6> 253b0: 75 c0 rjmp .+234 ; 0x2549c <__vector_17+0xeb0> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 253b2: 81 32 cpi r24, 0x21 ; 33 253b4: be e4 ldi r27, 0x4E ; 78 253b6: 9b 07 cpc r25, r27 253b8: 08 f4 brcc .+2 ; 0x253bc <__vector_17+0xdd0> 253ba: 73 c0 rjmp .+230 ; 0x254a2 <__vector_17+0xeb6> step_rate = (step_rate >> 2)&0x3fff; 253bc: 96 95 lsr r25 253be: 87 95 ror r24 253c0: 96 95 lsr r25 253c2: 87 95 ror r24 step_loops = 4; 253c4: 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; 253c6: 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 253ca: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 253cc: 81 15 cp r24, r1 253ce: f8 e0 ldi r31, 0x08 ; 8 253d0: 9f 07 cpc r25, r31 253d2: 08 f4 brcc .+2 ; 0x253d6 <__vector_17+0xdea> 253d4: 78 c0 rjmp .+240 ; 0x254c6 <__vector_17+0xeda> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 253d6: e9 2f mov r30, r25 253d8: ff 27 eor r31, r31 253da: ee 0f add r30, r30 253dc: ff 1f adc r31, r31 253de: ee 0f add r30, r30 253e0: ff 1f adc r31, r31 253e2: 9f 01 movw r18, r30 253e4: 2a 52 subi r18, 0x2A ; 42 253e6: 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); 253e8: f9 01 movw r30, r18 253ea: 32 96 adiw r30, 0x02 ; 2 253ec: a5 91 lpm r26, Z+ 253ee: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 253f0: f9 01 movw r30, r18 253f2: 25 91 lpm r18, Z+ 253f4: 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. ); 253f6: b8 9f mul r27, r24 253f8: f0 01 movw r30, r0 253fa: a8 9f mul r26, r24 253fc: 00 0c add r0, r0 253fe: e1 1d adc r30, r1 25400: 11 24 eor r1, r1 25402: 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); 25404: 2e 1b sub r18, r30 25406: 3f 0b sbc r19, r31 25408: c9 01 movw r24, r18 2540a: 24 36 cpi r18, 0x64 ; 100 2540c: 31 05 cpc r19, r1 2540e: 10 f4 brcc .+4 ; 0x25414 <__vector_17+0xe28> 25410: 84 e6 ldi r24, 0x64 ; 100 25412: 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); 25414: 90 93 1d 04 sts 0x041D, r25 ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 25418: 80 93 1c 04 sts 0x041C, r24 ; 0x80041c <_ZL11nextMainISR.lto_priv.435> 2541c: 90 93 19 04 sts 0x0419, r25 ; 0x800419 <_ZL9main_Rate.lto_priv.437+0x1> 25420: 80 93 18 04 sts 0x0418, r24 ; 0x800418 <_ZL9main_Rate.lto_priv.437> deceleration_time += timer; 25424: c8 0e add r12, r24 25426: d9 1e adc r13, r25 25428: e1 1c adc r14, r1 2542a: f1 1c adc r15, r1 2542c: c0 92 e1 05 sts 0x05E1, r12 ; 0x8005e1 25430: d0 92 e2 05 sts 0x05E2, r13 ; 0x8005e2 25434: e0 92 e3 05 sts 0x05E3, r14 ; 0x8005e3 25438: f0 92 e4 05 sts 0x05E4, r15 ; 0x8005e4 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2543c: fe 01 movw r30, r28 2543e: e4 5b subi r30, 0xB4 ; 180 25440: ff 4f sbci r31, 0xFF ; 255 25442: 80 81 ld r24, Z 25444: 88 23 and r24, r24 25446: 09 f4 brne .+2 ; 0x2544a <__vector_17+0xe5e> 25448: bc ce rjmp .-648 ; 0x251c2 <__vector_17+0xbd6> if (step_events_completed.wide <= current_block->decelerate_after + step_loops) { 2544a: 80 91 c0 05 lds r24, 0x05C0 ; 0x8005c0 2544e: 90 91 c1 05 lds r25, 0x05C1 ; 0x8005c1 25452: a0 91 c2 05 lds r26, 0x05C2 ; 0x8005c2 25456: b0 91 c3 05 lds r27, 0x05C3 ; 0x8005c3 2545a: 20 91 dd 05 lds r18, 0x05DD ; 0x8005dd 2545e: 42 0f add r20, r18 25460: 51 1d adc r21, r1 25462: 61 1d adc r22, r1 25464: 71 1d adc r23, r1 25466: 48 17 cp r20, r24 25468: 59 07 cpc r21, r25 2546a: 6a 07 cpc r22, r26 2546c: 7b 07 cpc r23, r27 2546e: 08 f4 brcc .+2 ; 0x25472 <__vector_17+0xe86> 25470: a8 ce rjmp .-688 ; 0x251c2 <__vector_17+0xbd6> target_adv_steps = current_block->final_adv_steps; 25472: 35 96 adiw r30, 0x05 ; 5 25474: 20 81 ld r18, Z 25476: 31 81 ldd r19, Z+1 ; 0x01 25478: 30 93 d8 05 sts 0x05D8, r19 ; 0x8005d8 2547c: 20 93 d7 05 sts 0x05D7, r18 ; 0x8005d7 la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps < target_adv_steps) 25480: 80 91 c4 05 lds r24, 0x05C4 ; 0x8005c4 25484: 88 23 and r24, r24 25486: 09 f4 brne .+2 ; 0x2548a <__vector_17+0xe9e> 25488: 33 cf rjmp .-410 ; 0x252f0 <__vector_17+0xd04> 2548a: 80 91 16 04 lds r24, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> 2548e: 90 91 17 04 lds r25, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 25492: 82 17 cp r24, r18 25494: 93 07 cpc r25, r19 25496: 08 f0 brcs .+2 ; 0x2549a <__vector_17+0xeae> 25498: 2b cf rjmp .-426 ; 0x252f0 <__vector_17+0xd04> 2549a: 37 cf rjmp .-402 ; 0x2530a <__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; 2549c: 80 e4 ldi r24, 0x40 ; 64 2549e: 9c e9 ldi r25, 0x9C ; 156 254a0: 8d cf rjmp .-230 ; 0x253bc <__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 254a2: 81 31 cpi r24, 0x11 ; 17 254a4: e7 e2 ldi r30, 0x27 ; 39 254a6: 9e 07 cpc r25, r30 254a8: 20 f0 brcs .+8 ; 0x254b2 <__vector_17+0xec6> step_rate = (step_rate >> 1)&0x7fff; 254aa: 96 95 lsr r25 254ac: 87 95 ror r24 step_loops = 2; 254ae: 22 e0 ldi r18, 0x02 ; 2 254b0: 8a cf rjmp .-236 ; 0x253c6 <__vector_17+0xdda> } else { step_loops = 1; 254b2: 21 e0 ldi r18, 0x01 ; 1 254b4: 20 93 dd 05 sts 0x05DD, r18 ; 0x8005dd 254b8: 80 32 cpi r24, 0x20 ; 32 254ba: 91 05 cpc r25, r1 254bc: 08 f0 brcs .+2 ; 0x254c0 <__vector_17+0xed4> 254be: 85 cf rjmp .-246 ; 0x253ca <__vector_17+0xdde> 254c0: 80 e2 ldi r24, 0x20 ; 32 254c2: 90 e0 ldi r25, 0x00 ; 0 254c4: 82 cf rjmp .-252 ; 0x253ca <__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; 254c6: dc 01 movw r26, r24 254c8: b6 95 lsr r27 254ca: a7 95 ror r26 254cc: ac 7f andi r26, 0xFC ; 252 254ce: aa 52 subi r26, 0x2A ; 42 254d0: b7 47 sbci r27, 0x77 ; 119 timer = (unsigned short)pgm_read_word_near(table_address); 254d2: fd 01 movw r30, r26 254d4: 25 91 lpm r18, Z+ 254d6: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 254d8: fd 01 movw r30, r26 254da: 32 96 adiw r30, 0x02 ; 2 254dc: a5 91 lpm r26, Z+ 254de: b4 91 lpm r27, Z 254e0: 87 70 andi r24, 0x07 ; 7 254e2: 99 27 eor r25, r25 254e4: 8a 9f mul r24, r26 254e6: f0 01 movw r30, r0 254e8: 8b 9f mul r24, r27 254ea: f0 0d add r31, r0 254ec: 9a 9f mul r25, r26 254ee: f0 0d add r31, r0 254f0: 11 24 eor r1, r1 254f2: a3 e0 ldi r26, 0x03 ; 3 254f4: f6 95 lsr r31 254f6: e7 95 ror r30 254f8: aa 95 dec r26 254fa: e1 f7 brne .-8 ; 0x254f4 <__vector_17+0xf08> 254fc: 83 cf rjmp .-250 ; 0x25404 <__vector_17+0xe18> } } #endif } else { if (! step_loops_nominal) { 254fe: 80 91 e0 05 lds r24, 0x05E0 ; 0x8005e0 25502: 88 23 and r24, r24 25504: 71 f0 breq .+28 ; 0x25522 <__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; 25506: 80 e0 ldi r24, 0x00 ; 0 if (e_extruding) target_adv_steps = current_adv_steps; } #endif } _NEXT_ISR(OCR1A_nominal); 25508: 20 91 ba 05 lds r18, 0x05BA ; 0x8005ba 2550c: 30 91 bb 05 lds r19, 0x05BB ; 0x8005bb 25510: 30 93 1d 04 sts 0x041D, r19 ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 25514: 20 93 1c 04 sts 0x041C, r18 ; 0x80041c <_ZL11nextMainISR.lto_priv.435> 25518: 30 93 19 04 sts 0x0419, r19 ; 0x800419 <_ZL9main_Rate.lto_priv.437+0x1> 2551c: 20 93 18 04 sts 0x0418, r18 ; 0x800418 <_ZL9main_Rate.lto_priv.437> 25520: 51 ce rjmp .-862 ; 0x251c4 <__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); 25522: 8e a9 ldd r24, Y+54 ; 0x36 25524: 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; 25526: 81 34 cpi r24, 0x41 ; 65 25528: 2c e9 ldi r18, 0x9C ; 156 2552a: 92 07 cpc r25, r18 2552c: 08 f0 brcs .+2 ; 0x25530 <__vector_17+0xf44> 2552e: 4e c0 rjmp .+156 ; 0x255cc <__vector_17+0xfe0> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 25530: 81 32 cpi r24, 0x21 ; 33 25532: 4e e4 ldi r20, 0x4E ; 78 25534: 94 07 cpc r25, r20 25536: 08 f4 brcc .+2 ; 0x2553a <__vector_17+0xf4e> 25538: 4c c0 rjmp .+152 ; 0x255d2 <__vector_17+0xfe6> step_rate = (step_rate >> 2)&0x3fff; 2553a: 96 95 lsr r25 2553c: 87 95 ror r24 2553e: 96 95 lsr r25 25540: 87 95 ror r24 step_loops = 4; 25542: 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; 25544: 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 25548: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2554a: 81 15 cp r24, r1 2554c: a8 e0 ldi r26, 0x08 ; 8 2554e: 9a 07 cpc r25, r26 25550: 08 f4 brcc .+2 ; 0x25554 <__vector_17+0xf68> 25552: 51 c0 rjmp .+162 ; 0x255f6 <__vector_17+0x100a> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 25554: e9 2f mov r30, r25 25556: ff 27 eor r31, r31 25558: ee 0f add r30, r30 2555a: ff 1f adc r31, r31 2555c: ee 0f add r30, r30 2555e: ff 1f adc r31, r31 25560: 9f 01 movw r18, r30 25562: 2a 52 subi r18, 0x2A ; 42 25564: 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); 25566: f9 01 movw r30, r18 25568: 32 96 adiw r30, 0x02 ; 2 2556a: 65 91 lpm r22, Z+ 2556c: 74 91 lpm r23, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2556e: f9 01 movw r30, r18 25570: 25 91 lpm r18, Z+ 25572: 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. ); 25574: 78 9f mul r23, r24 25576: a0 01 movw r20, r0 25578: 68 9f mul r22, r24 2557a: 00 0c add r0, r0 2557c: 41 1d adc r20, r1 2557e: 11 24 eor r1, r1 25580: 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); 25582: c9 01 movw r24, r18 25584: 84 1b sub r24, r20 25586: 95 0b sbc r25, r21 25588: 84 36 cpi r24, 0x64 ; 100 2558a: 91 05 cpc r25, r1 2558c: 10 f4 brcc .+4 ; 0x25592 <__vector_17+0xfa6> 2558e: 84 e6 ldi r24, 0x64 ; 100 25590: 90 e0 ldi r25, 0x00 ; 0 25592: 90 93 bb 05 sts 0x05BB, r25 ; 0x8005bb 25596: 80 93 ba 05 sts 0x05BA, r24 ; 0x8005ba step_loops_nominal = step_loops; 2559a: 80 91 dd 05 lds r24, 0x05DD ; 0x8005dd 2559e: 80 93 e0 05 sts 0x05E0, r24 ; 0x8005e0 #ifdef LIN_ADVANCE if(current_block->use_advance_lead) { 255a2: fe 01 movw r30, r28 255a4: e4 5b subi r30, 0xB4 ; 180 255a6: ff 4f sbci r31, 0xFF ; 255 255a8: 80 81 ld r24, Z 255aa: 88 23 and r24, r24 255ac: 09 f4 brne .+2 ; 0x255b0 <__vector_17+0xfc4> 255ae: ab cf rjmp .-170 ; 0x25506 <__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) 255b0: 80 91 c4 05 lds r24, 0x05C4 ; 0x8005c4 255b4: 88 23 and r24, r24 255b6: 41 f0 breq .+16 ; 0x255c8 <__vector_17+0xfdc> target_adv_steps = current_adv_steps; 255b8: 80 91 16 04 lds r24, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> 255bc: 90 91 17 04 lds r25, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 255c0: 90 93 d8 05 sts 0x05D8, r25 ; 0x8005d8 255c4: 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; 255c8: 81 e0 ldi r24, 0x01 ; 1 255ca: 9e cf rjmp .-196 ; 0x25508 <__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; 255cc: 80 e4 ldi r24, 0x40 ; 64 255ce: 9c e9 ldi r25, 0x9C ; 156 255d0: b4 cf rjmp .-152 ; 0x2553a <__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 255d2: 81 31 cpi r24, 0x11 ; 17 255d4: 57 e2 ldi r21, 0x27 ; 39 255d6: 95 07 cpc r25, r21 255d8: 20 f0 brcs .+8 ; 0x255e2 <__vector_17+0xff6> step_rate = (step_rate >> 1)&0x7fff; 255da: 96 95 lsr r25 255dc: 87 95 ror r24 step_loops = 2; 255de: 22 e0 ldi r18, 0x02 ; 2 255e0: b1 cf rjmp .-158 ; 0x25544 <__vector_17+0xf58> } else { step_loops = 1; 255e2: 21 e0 ldi r18, 0x01 ; 1 255e4: 20 93 dd 05 sts 0x05DD, r18 ; 0x8005dd 255e8: 80 32 cpi r24, 0x20 ; 32 255ea: 91 05 cpc r25, r1 255ec: 08 f0 brcs .+2 ; 0x255f0 <__vector_17+0x1004> 255ee: ac cf rjmp .-168 ; 0x25548 <__vector_17+0xf5c> 255f0: 80 e2 ldi r24, 0x20 ; 32 255f2: 90 e0 ldi r25, 0x00 ; 0 255f4: a9 cf rjmp .-174 ; 0x25548 <__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; 255f6: 9c 01 movw r18, r24 255f8: 36 95 lsr r19 255fa: 27 95 ror r18 255fc: 2c 7f andi r18, 0xFC ; 252 255fe: 2a 52 subi r18, 0x2A ; 42 25600: 37 47 sbci r19, 0x77 ; 119 timer = (unsigned short)pgm_read_word_near(table_address); 25602: f9 01 movw r30, r18 25604: 45 91 lpm r20, Z+ 25606: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 25608: f9 01 movw r30, r18 2560a: 32 96 adiw r30, 0x02 ; 2 2560c: 65 91 lpm r22, Z+ 2560e: 74 91 lpm r23, Z 25610: 87 70 andi r24, 0x07 ; 7 25612: 99 27 eor r25, r25 25614: 86 9f mul r24, r22 25616: 90 01 movw r18, r0 25618: 87 9f mul r24, r23 2561a: 30 0d add r19, r0 2561c: 96 9f mul r25, r22 2561e: 30 0d add r19, r0 25620: 11 24 eor r1, r1 25622: a3 e0 ldi r26, 0x03 ; 3 25624: 36 95 lsr r19 25626: 27 95 ror r18 25628: aa 95 dec r26 2562a: e1 f7 brne .-8 ; 0x25624 <__vector_17+0x1038> 2562c: ca 01 movw r24, r20 2562e: 82 1b sub r24, r18 25630: 93 0b sbc r25, r19 25632: aa cf rjmp .-172 ; 0x25588 <__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; 25634: de 01 movw r26, r28 25636: a3 5b subi r26, 0xB3 ; 179 25638: bf 4f sbci r27, 0xFF ; 255 2563a: 4d 91 ld r20, X+ 2563c: 5c 91 ld r21, X 2563e: 11 97 sbiw r26, 0x01 ; 1 25640: 70 e0 ldi r23, 0x00 ; 0 25642: 60 e0 ldi r22, 0x00 ; 0 25644: 40 93 b6 05 sts 0x05B6, r20 ; 0x8005b6 25648: 50 93 b7 05 sts 0x05B7, r21 ; 0x8005b7 2564c: 60 93 b8 05 sts 0x05B8, r22 ; 0x8005b8 25650: 70 93 b9 05 sts 0x05B9, r23 ; 0x8005b9 e_step_loops = current_block->advance_step_loops; 25654: 16 96 adiw r26, 0x06 ; 6 25656: 9c 91 ld r25, X 25658: 90 93 b5 05 sts 0x05B5, r25 ; 0x8005b5 if ((la_state & ADV_ACC_VARY) && e_extruding && (current_adv_steps > target_adv_steps)) { 2565c: 98 2f mov r25, r24 2565e: 92 70 andi r25, 0x02 ; 2 25660: 09 f4 brne .+2 ; 0x25664 <__vector_17+0x1078> 25662: c8 cd rjmp .-1136 ; 0x251f4 <__vector_17+0xc08> 25664: 90 91 c4 05 lds r25, 0x05C4 ; 0x8005c4 25668: 99 23 and r25, r25 2566a: 09 f4 brne .+2 ; 0x2566e <__vector_17+0x1082> 2566c: c3 cd rjmp .-1146 ; 0x251f4 <__vector_17+0xc08> 2566e: 2e 17 cp r18, r30 25670: 3f 07 cpc r19, r31 25672: 08 f0 brcs .+2 ; 0x25676 <__vector_17+0x108a> 25674: bf cd rjmp .-1154 ; 0x251f4 <__vector_17+0xc08> // LA could reverse the direction of extrusion in this phase eISR_Err += current_block->advance_rate; 25676: 44 0f add r20, r20 25678: 55 1f adc r21, r21 2567a: 66 1f adc r22, r22 2567c: 77 1f adc r23, r23 2567e: 40 93 b6 05 sts 0x05B6, r20 ; 0x8005b6 25682: 50 93 b7 05 sts 0x05B7, r21 ; 0x8005b7 25686: 60 93 b8 05 sts 0x05B8, r22 ; 0x8005b8 2568a: 70 93 b9 05 sts 0x05B9, r23 ; 0x8005b9 LA_phase = 0; 2568e: 10 92 d5 05 sts 0x05D5, r1 ; 0x8005d5 25692: b0 cd rjmp .-1184 ; 0x251f4 <__vector_17+0xc08> 25694: 40 92 b6 05 sts 0x05B6, r4 ; 0x8005b6 25698: 50 92 b7 05 sts 0x05B7, r5 ; 0x8005b7 2569c: 60 92 b8 05 sts 0x05B8, r6 ; 0x8005b8 256a0: 70 92 b9 05 sts 0x05B9, r7 ; 0x8005b9 while(eISR_Err >= current_block->advance_rate) { ++ticks; eISR_Err -= current_block->advance_rate; } if(!ticks) 256a4: 61 11 cpse r22, r1 256a6: 1d c0 rjmp .+58 ; 0x256e2 <__vector_17+0x10f6> { eISR_Rate = timer; 256a8: f0 93 b4 05 sts 0x05B4, r31 ; 0x8005b4 256ac: e0 93 b3 05 sts 0x05B3, r30 ; 0x8005b3 nextAdvanceISR = timer; 256b0: f0 93 1b 04 sts 0x041B, r31 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 256b4: 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) { 256b8: 80 91 d5 05 lds r24, 0x05D5 ; 0x8005d5 256bc: 87 fd sbrc r24, 7 256be: 5a c0 rjmp .+180 ; 0x25774 <__vector_17+0x1188> if (step_loops == e_step_loops) 256c0: 80 91 dd 05 lds r24, 0x05DD ; 0x8005dd 256c4: 10 91 b5 05 lds r17, 0x05B5 ; 0x8005b5 256c8: c3 5b subi r28, 0xB3 ; 179 256ca: df 4f sbci r29, 0xFF ; 255 256cc: 28 81 ld r18, Y 256ce: 39 81 ldd r19, Y+1 ; 0x01 256d0: 81 13 cpse r24, r17 256d2: 35 c0 rjmp .+106 ; 0x2573e <__vector_17+0x1152> LA_phase = (current_block->advance_rate < main_Rate); 256d4: 81 e0 ldi r24, 0x01 ; 1 256d6: 2e 17 cp r18, r30 256d8: 3f 07 cpc r19, r31 256da: 08 f4 brcc .+2 ; 0x256de <__vector_17+0x10f2> 256dc: 49 c0 rjmp .+146 ; 0x25770 <__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); 256de: 80 e0 ldi r24, 0x00 ; 0 256e0: 47 c0 rjmp .+142 ; 0x25770 <__vector_17+0x1184> eISR_Rate = timer; nextAdvanceISR = timer; return; } if (ticks <= 3) 256e2: 64 30 cpi r22, 0x04 ; 4 256e4: 28 f5 brcc .+74 ; 0x25730 <__vector_17+0x1144> eISR_Rate = fastdiv(timer, ticks + 1); 256e6: 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); 256e8: 63 30 cpi r22, 0x03 ; 3 256ea: a9 f0 breq .+42 ; 0x25716 <__vector_17+0x112a> 256ec: 66 95 lsr r22 256ee: af 01 movw r20, r30 256f0: 02 c0 rjmp .+4 ; 0x256f6 <__vector_17+0x110a> 256f2: 56 95 lsr r21 256f4: 47 95 ror r20 256f6: 6a 95 dec r22 256f8: e2 f7 brpl .-8 ; 0x256f2 <__vector_17+0x1106> 256fa: 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); 256fc: 70 93 b4 05 sts 0x05B4, r23 ; 0x8005b4 25700: 60 93 b3 05 sts 0x05B3, r22 ; 0x8005b3 } nextAdvanceISR = eISR_Rate; 25704: 80 91 b3 05 lds r24, 0x05B3 ; 0x8005b3 25708: 90 91 b4 05 lds r25, 0x05B4 ; 0x8005b4 2570c: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 25710: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> 25714: d1 cf rjmp .-94 ; 0x256b8 <__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; 25716: 9f 01 movw r18, r30 25718: ab ea ldi r26, 0xAB ; 171 2571a: ba ea ldi r27, 0xAA ; 170 2571c: 0f 94 3b a1 call 0x34276 ; 0x34276 <__umulhisi3> 25720: 41 e1 ldi r20, 0x11 ; 17 25722: 96 95 lsr r25 25724: 87 95 ror r24 25726: 77 95 ror r23 25728: 67 95 ror r22 2572a: 4a 95 dec r20 2572c: d1 f7 brne .-12 ; 0x25722 <__vector_17+0x1136> 2572e: e6 cf rjmp .-52 ; 0x256fc <__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); 25730: 70 e0 ldi r23, 0x00 ; 0 25732: 6f 5f subi r22, 0xFF ; 255 25734: 7f 4f sbci r23, 0xFF ; 255 25736: cf 01 movw r24, r30 25738: 0f 94 64 a1 call 0x342c8 ; 0x342c8 <__udivmodhi4> 2573c: df cf rjmp .-66 ; 0x256fc <__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); 2573e: 83 30 cpi r24, 0x03 ; 3 25740: 09 f4 brne .+2 ; 0x25744 <__vector_17+0x1158> 25742: a2 c0 rjmp .+324 ; 0x25888 <__vector_17+0x129c> 25744: 86 95 lsr r24 25746: a9 01 movw r20, r18 25748: 02 c0 rjmp .+4 ; 0x2574e <__vector_17+0x1162> 2574a: 56 95 lsr r21 2574c: 47 95 ror r20 2574e: 8a 95 dec r24 25750: e2 f7 brpl .-8 ; 0x2574a <__vector_17+0x115e> 25752: 13 30 cpi r17, 0x03 ; 3 25754: 09 f4 brne .+2 ; 0x25758 <__vector_17+0x116c> 25756: a6 c0 rjmp .+332 ; 0x258a4 <__vector_17+0x12b8> 25758: 16 95 lsr r17 2575a: bf 01 movw r22, r30 2575c: 02 c0 rjmp .+4 ; 0x25762 <__vector_17+0x1176> 2575e: 76 95 lsr r23 25760: 67 95 ror r22 25762: 1a 95 dec r17 25764: e2 f7 brpl .-8 ; 0x2575e <__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); 25766: 81 e0 ldi r24, 0x01 ; 1 25768: 46 17 cp r20, r22 2576a: 57 07 cpc r21, r23 2576c: 08 f0 brcs .+2 ; 0x25770 <__vector_17+0x1184> 2576e: b7 cf rjmp .-146 ; 0x256de <__vector_17+0x10f2> 25770: 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(); 25774: 0e 94 ef fb call 0x1f7de ; 0x1f7de #endif // If current block is finished, reset pointer if (step_events_completed.wide >= current_block->step_event_count.wide) { 25778: 40 91 c0 05 lds r20, 0x05C0 ; 0x8005c0 2577c: 50 91 c1 05 lds r21, 0x05C1 ; 0x8005c1 25780: 60 91 c2 05 lds r22, 0x05C2 ; 0x8005c2 25784: 70 91 c3 05 lds r23, 0x05C3 ; 0x8005c3 25788: e0 91 e4 11 lds r30, 0x11E4 ; 0x8011e4 2578c: f0 91 e5 11 lds r31, 0x11E5 ; 0x8011e5 25790: 80 89 ldd r24, Z+16 ; 0x10 25792: 91 89 ldd r25, Z+17 ; 0x11 25794: a2 89 ldd r26, Z+18 ; 0x12 25796: b3 89 ldd r27, Z+19 ; 0x13 25798: 48 17 cp r20, r24 2579a: 59 07 cpc r21, r25 2579c: 6a 07 cpc r22, r26 2579e: 7b 07 cpc r23, r27 257a0: 80 f0 brcs .+32 ; 0x257c2 <__vector_17+0x11d6> current_block = NULL; 257a2: 10 92 e5 11 sts 0x11E5, r1 ; 0x8011e5 257a6: 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) { 257aa: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 257ae: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 257b2: 98 17 cp r25, r24 257b4: 31 f0 breq .+12 ; 0x257c2 <__vector_17+0x11d6> block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 257b6: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 257ba: 8f 5f subi r24, 0xFF ; 255 257bc: 8f 70 andi r24, 0x0F ; 15 257be: 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; 257c2: 60 91 1a 04 lds r22, 0x041A ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> 257c6: 70 91 1b 04 lds r23, 0x041B ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> if (eisr) 257ca: 61 15 cp r22, r1 257cc: 71 05 cpc r23, r1 257ce: 09 f0 breq .+2 ; 0x257d2 <__vector_17+0x11e6> 257d0: 46 c0 rjmp .+140 ; 0x2585e <__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) { 257d2: 40 91 16 04 lds r20, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> 257d6: 50 91 17 04 lds r21, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 257da: 20 91 d7 05 lds r18, 0x05D7 ; 0x8005d7 257de: 30 91 d8 05 lds r19, 0x05D8 ; 0x8005d8 257e2: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 257e6: 24 17 cp r18, r20 257e8: 35 07 cpc r19, r21 257ea: 08 f0 brcs .+2 ; 0x257ee <__vector_17+0x1202> 257ec: 6c c0 rjmp .+216 ; 0x258c6 <__vector_17+0x12da> // decompression if (e_step_loops != 1) { 257ee: 90 91 b5 05 lds r25, 0x05B5 ; 0x8005b5 257f2: 91 30 cpi r25, 0x01 ; 1 257f4: 41 f0 breq .+16 ; 0x25806 <__vector_17+0x121a> uint16_t d_steps = current_adv_steps - target_adv_steps; 257f6: 42 1b sub r20, r18 257f8: 53 0b sbc r21, r19 if (d_steps < e_step_loops) 257fa: 94 17 cp r25, r20 257fc: 15 06 cpc r1, r21 257fe: 19 f0 breq .+6 ; 0x25806 <__vector_17+0x121a> 25800: 10 f0 brcs .+4 ; 0x25806 <__vector_17+0x121a> e_step_loops = d_steps; 25802: 40 93 b5 05 sts 0x05B5, r20 ; 0x8005b5 } e_steps -= e_step_loops; 25806: 90 91 b5 05 lds r25, 0x05B5 ; 0x8005b5 2580a: 89 1b sub r24, r25 2580c: 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); 25810: 88 23 and r24, r24 25812: 39 f0 breq .+14 ; 0x25822 <__vector_17+0x1236> 25814: 87 ff sbrs r24, 7 25816: 53 c0 rjmp .+166 ; 0x258be <__vector_17+0x12d2> 25818: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2581c: 80 64 ori r24, 0x40 ; 64 2581e: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps -= e_step_loops; 25822: 20 91 b5 05 lds r18, 0x05B5 ; 0x8005b5 25826: 80 91 16 04 lds r24, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> 2582a: 90 91 17 04 lds r25, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 2582e: 82 1b sub r24, r18 25830: 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; 25832: 90 93 17 04 sts 0x0417, r25 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 25836: 80 93 16 04 sts 0x0416, r24 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> } if (current_adv_steps == target_adv_steps) { 2583a: 20 91 16 04 lds r18, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> 2583e: 30 91 17 04 lds r19, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 25842: 80 91 d7 05 lds r24, 0x05D7 ; 0x8005d7 25846: 90 91 d8 05 lds r25, 0x05D8 ; 0x8005d8 2584a: 28 17 cp r18, r24 2584c: 39 07 cpc r19, r25 2584e: 09 f0 breq .+2 ; 0x25852 <__vector_17+0x1266> 25850: 66 c0 rjmp .+204 ; 0x2591e <__vector_17+0x1332> // advance steps completed nextAdvanceISR = ADV_NEVER; 25852: 8f ef ldi r24, 0xFF ; 255 25854: 9f ef ldi r25, 0xFF ; 255 } else { // schedule another tick nextAdvanceISR = eISR_Rate; 25856: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 2585a: 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)) { 2585e: 40 91 d6 05 lds r20, 0x05D6 ; 0x8005d6 25862: 41 11 cpse r20, r1 25864: 61 c0 rjmp .+194 ; 0x25928 <__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) 25866: 80 91 1a 04 lds r24, 0x041A ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> 2586a: 90 91 1b 04 lds r25, 0x041B ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 2586e: 20 91 1c 04 lds r18, 0x041C ; 0x80041c <_ZL11nextMainISR.lto_priv.435> 25872: 30 91 1d 04 lds r19, 0x041D ; 0x80041d <_ZL11nextMainISR.lto_priv.435+0x1> 25876: 8f 3f cpi r24, 0xFF ; 255 25878: 98 07 cpc r25, r24 2587a: 09 f0 breq .+2 ; 0x2587e <__vector_17+0x1292> 2587c: 88 c0 rjmp .+272 ; 0x2598e <__vector_17+0x13a2> OCR1A = nextAdvanceISR; else OCR1A = nextMainISR; 2587e: 30 93 89 00 sts 0x0089, r19 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 25882: 20 93 88 00 sts 0x0088, r18 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 25886: 8e c0 rjmp .+284 ; 0x259a4 <__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; 25888: ab ea ldi r26, 0xAB ; 171 2588a: ba ea ldi r27, 0xAA ; 170 2588c: 0f 94 3b a1 call 0x34276 ; 0x34276 <__umulhisi3> 25890: ab 01 movw r20, r22 25892: bc 01 movw r22, r24 25894: 31 e1 ldi r19, 0x11 ; 17 25896: 76 95 lsr r23 25898: 67 95 ror r22 2589a: 57 95 ror r21 2589c: 47 95 ror r20 2589e: 3a 95 dec r19 258a0: d1 f7 brne .-12 ; 0x25896 <__vector_17+0x12aa> 258a2: 57 cf rjmp .-338 ; 0x25752 <__vector_17+0x1166> 258a4: 9f 01 movw r18, r30 258a6: ab ea ldi r26, 0xAB ; 171 258a8: ba ea ldi r27, 0xAA ; 170 258aa: 0f 94 3b a1 call 0x34276 ; 0x34276 <__umulhisi3> 258ae: 21 e1 ldi r18, 0x11 ; 17 258b0: 96 95 lsr r25 258b2: 87 95 ror r24 258b4: 77 95 ror r23 258b6: 67 95 ror r22 258b8: 2a 95 dec r18 258ba: d1 f7 brne .-12 ; 0x258b0 <__vector_17+0x12c4> 258bc: 54 cf rjmp .-344 ; 0x25766 <__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); 258be: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 258c2: 8f 7b andi r24, 0xBF ; 191 258c4: ac cf rjmp .-168 ; 0x2581e <__vector_17+0x1232> current_adv_steps -= e_step_loops; } else if (current_adv_steps < target_adv_steps) { 258c6: 42 17 cp r20, r18 258c8: 53 07 cpc r21, r19 258ca: 08 f0 brcs .+2 ; 0x258ce <__vector_17+0x12e2> 258cc: b6 cf rjmp .-148 ; 0x2583a <__vector_17+0x124e> // compression if (e_step_loops != 1) { 258ce: 90 91 b5 05 lds r25, 0x05B5 ; 0x8005b5 258d2: 91 30 cpi r25, 0x01 ; 1 258d4: 41 f0 breq .+16 ; 0x258e6 <__vector_17+0x12fa> uint16_t d_steps = target_adv_steps - current_adv_steps; 258d6: 24 1b sub r18, r20 258d8: 35 0b sbc r19, r21 if (d_steps < e_step_loops) 258da: 92 17 cp r25, r18 258dc: 13 06 cpc r1, r19 258de: 19 f0 breq .+6 ; 0x258e6 <__vector_17+0x12fa> 258e0: 10 f0 brcs .+4 ; 0x258e6 <__vector_17+0x12fa> e_step_loops = d_steps; 258e2: 20 93 b5 05 sts 0x05B5, r18 ; 0x8005b5 } e_steps += e_step_loops; 258e6: 90 91 b5 05 lds r25, 0x05B5 ; 0x8005b5 258ea: 89 0f add r24, r25 258ec: 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); 258f0: 88 23 and r24, r24 258f2: 39 f0 breq .+14 ; 0x25902 <__vector_17+0x1316> 258f4: 87 ff sbrs r24, 7 258f6: 0f c0 rjmp .+30 ; 0x25916 <__vector_17+0x132a> 258f8: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 258fc: 80 64 ori r24, 0x40 ; 64 258fe: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps += e_step_loops; 25902: 80 91 b5 05 lds r24, 0x05B5 ; 0x8005b5 25906: 20 91 16 04 lds r18, 0x0416 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> 2590a: 30 91 17 04 lds r19, 0x0417 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 2590e: 82 0f add r24, r18 25910: 93 2f mov r25, r19 25912: 91 1d adc r25, r1 25914: 8e cf rjmp .-228 ; 0x25832 <__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); 25916: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2591a: 8f 7b andi r24, 0xBF ; 191 2591c: f0 cf rjmp .-32 ; 0x258fe <__vector_17+0x1312> // advance steps completed nextAdvanceISR = ADV_NEVER; } else { // schedule another tick nextAdvanceISR = eISR_Rate; 2591e: 80 91 b3 05 lds r24, 0x05B3 ; 0x8005b3 25922: 90 91 b4 05 lds r25, 0x05B4 ; 0x8005b4 25926: 97 cf rjmp .-210 ; 0x25856 <__vector_17+0x126a> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 25928: 80 91 d5 05 lds r24, 0x05D5 ; 0x8005d5 2592c: 87 fd sbrc r24, 7 2592e: 0e c0 rjmp .+28 ; 0x2594c <__vector_17+0x1360> 25930: 08 2e mov r0, r24 25932: 00 0c add r0, r0 25934: 99 0b sbc r25, r25 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 25936: 21 e0 ldi r18, 0x01 ; 1 25938: 30 e0 ldi r19, 0x00 ; 0 2593a: 61 15 cp r22, r1 2593c: 71 05 cpc r23, r1 2593e: 11 f0 breq .+4 ; 0x25944 <__vector_17+0x1358> 25940: 30 e0 ldi r19, 0x00 ; 0 25942: 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)) { 25944: 82 17 cp r24, r18 25946: 93 07 cpc r25, r19 25948: 09 f0 breq .+2 ; 0x2594c <__vector_17+0x1360> 2594a: 8d cf rjmp .-230 ; 0x25866 <__vector_17+0x127a> uint8_t max_ticks = (eisr? e_step_loops: step_loops); 2594c: 20 91 b5 05 lds r18, 0x05B5 ; 0x8005b5 25950: 67 2b or r22, r23 25952: 11 f0 breq .+4 ; 0x25958 <__vector_17+0x136c> 25954: 20 91 dd 05 lds r18, 0x05DD ; 0x8005dd max_ticks = min(abs(e_steps), max_ticks); 25958: 84 2f mov r24, r20 2595a: 04 2e mov r0, r20 2595c: 00 0c add r0, r0 2595e: 99 0b sbc r25, r25 25960: 97 ff sbrs r25, 7 25962: 03 c0 rjmp .+6 ; 0x2596a <__vector_17+0x137e> 25964: 91 95 neg r25 25966: 81 95 neg r24 25968: 91 09 sbc r25, r1 2596a: 30 e0 ldi r19, 0x00 ; 0 2596c: 28 17 cp r18, r24 2596e: 39 07 cpc r19, r25 25970: 0c f4 brge .+2 ; 0x25974 <__vector_17+0x1388> 25972: c9 01 movw r24, r18 25974: 21 e0 ldi r18, 0x01 ; 1 25976: 47 ff sbrs r20, 7 25978: 2f ef ldi r18, 0xFF ; 255 bool rev = (e_steps < 0); do { STEP_NC_HI(E_AXIS); 2597a: 43 9a sbi 0x08, 3 ; 8 e_steps += (rev? 1: -1); 2597c: 90 91 d6 05 lds r25, 0x05D6 ; 0x8005d6 25980: 92 0f add r25, r18 25982: 90 93 d6 05 sts 0x05D6, r25 ; 0x8005d6 STEP_NC_LO(E_AXIS); 25986: 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); 25988: 81 50 subi r24, 0x01 ; 1 2598a: b9 f7 brne .-18 ; 0x2597a <__vector_17+0x138e> 2598c: 6c cf rjmp .-296 ; 0x25866 <__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) 2598e: ac 01 movw r20, r24 25990: 48 5d subi r20, 0xD8 ; 216 25992: 5f 4f sbci r21, 0xFF ; 255 25994: 42 17 cp r20, r18 25996: 53 07 cpc r21, r19 25998: 08 f0 brcs .+2 ; 0x2599c <__vector_17+0x13b0> 2599a: 71 cf rjmp .-286 ; 0x2587e <__vector_17+0x1292> OCR1A = nextAdvanceISR; 2599c: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 259a0: 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) { 259a4: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 259a8: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 259ac: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 259b0: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 259b4: 40 96 adiw r24, 0x10 ; 16 259b6: 28 17 cp r18, r24 259b8: 39 07 cpc r19, r25 259ba: 48 f4 brcc .+18 ; 0x259ce <__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; 259bc: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 259c0: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 259c4: 40 96 adiw r24, 0x10 ; 16 259c6: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 259ca: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> } } 259ce: ff 91 pop r31 259d0: ef 91 pop r30 259d2: df 91 pop r29 259d4: cf 91 pop r28 259d6: bf 91 pop r27 259d8: af 91 pop r26 259da: 9f 91 pop r25 259dc: 8f 91 pop r24 259de: 7f 91 pop r23 259e0: 6f 91 pop r22 259e2: 5f 91 pop r21 259e4: 4f 91 pop r20 259e6: 3f 91 pop r19 259e8: 2f 91 pop r18 259ea: 1f 91 pop r17 259ec: ff 90 pop r15 259ee: ef 90 pop r14 259f0: df 90 pop r13 259f2: cf 90 pop r12 259f4: 8f 90 pop r8 259f6: 7f 90 pop r7 259f8: 6f 90 pop r6 259fa: 5f 90 pop r5 259fc: 4f 90 pop r4 259fe: 0f 90 pop r0 25a00: 0b be out 0x3b, r0 ; 59 25a02: 0f 90 pop r0 25a04: 0f be out 0x3f, r0 ; 63 25a06: 0f 90 pop r0 25a08: 1f 90 pop r1 25a0a: 18 95 reti 00025a0c : return old; } bool enable_z_endstop(bool check) { bool old = check_z_endstop; 25a0c: 90 91 bc 05 lds r25, 0x05BC ; 0x8005bc check_z_endstop = check; 25a10: 80 93 bc 05 sts 0x05BC, r24 ; 0x8005bc CRITICAL_SECTION_START; 25a14: 2f b7 in r18, 0x3f ; 63 25a16: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 25a18: 80 91 2c 04 lds r24, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.439> 25a1c: 8b 7f andi r24, 0xFB ; 251 25a1e: 80 93 2c 04 sts 0x042C, r24 ; 0x80042c <_ZL11endstop_hit.lto_priv.439> CRITICAL_SECTION_END; 25a22: 2f bf out 0x3f, r18 ; 63 return old; } 25a24: 89 2f mov r24, r25 25a26: 08 95 ret 00025a28 : return old; } bool endstop_z_hit_on_purpose() { bool hit = endstop_hit & _BV(Z_AXIS); 25a28: 80 91 2c 04 lds r24, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.439> CRITICAL_SECTION_START; 25a2c: 2f b7 in r18, 0x3f ; 63 25a2e: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 25a30: 90 91 2c 04 lds r25, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.439> 25a34: 9b 7f andi r25, 0xFB ; 251 25a36: 90 93 2c 04 sts 0x042C, r25 ; 0x80042c <_ZL11endstop_hit.lto_priv.439> CRITICAL_SECTION_END; 25a3a: 2f bf out 0x3f, r18 ; 63 return hit; } 25a3c: 82 fb bst r24, 2 25a3e: 88 27 eor r24, r24 25a40: 80 f9 bld r24, 0 25a42: 08 95 ret 00025a44 : } } bool endstops_hit_on_purpose() { uint8_t old = endstop_hit; 25a44: 90 91 2c 04 lds r25, 0x042C ; 0x80042c <_ZL11endstop_hit.lto_priv.439> endstop_hit = 0; 25a48: 10 92 2c 04 sts 0x042C, r1 ; 0x80042c <_ZL11endstop_hit.lto_priv.439> return old; 25a4c: 81 e0 ldi r24, 0x01 ; 1 25a4e: 91 11 cpse r25, r1 25a50: 01 c0 rjmp .+2 ; 0x25a54 25a52: 80 e0 ldi r24, 0x00 ; 0 } 25a54: 08 95 ret 00025a56 : } } void Sound_MakeSound(eSOUND_TYPE eSoundType) { switch(eSoundMode) 25a56: 90 91 15 04 lds r25, 0x0415 ; 0x800415 25a5a: 91 30 cpi r25, 0x01 ; 1 25a5c: a1 f0 breq .+40 ; 0x25a86 25a5e: 28 f0 brcs .+10 ; 0x25a6a 25a60: 92 30 cpi r25, 0x02 ; 2 25a62: a9 f0 breq .+42 ; 0x25a8e 25a64: 93 30 cpi r25, 0x03 ; 3 25a66: c1 f0 breq .+48 ; 0x25a98 25a68: 08 95 ret { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) 25a6a: 81 11 cpse r24, r1 25a6c: 02 c0 rjmp .+4 ; 0x25a72 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(); 25a6e: 0c 94 57 fc jmp 0x1f8ae ; 0x1f8ae switch(eSoundMode) { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 25a72: 82 30 cpi r24, 0x02 ; 2 25a74: 11 f4 brne .+4 ; 0x25a7a break; case e_SOUND_MODE_BLIND: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) Sound_DoSound_Prompt(); 25a76: 0d 94 0a 0a jmp 0x21414 ; 0x21414 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) 25a7a: 85 30 cpi r24, 0x05 ; 5 25a7c: 09 f0 breq .+2 ; 0x25a80 25a7e: 4d c0 rjmp .+154 ; 0x25b1a Sound_DoSound_Alert(false); 25a80: 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); 25a82: 0c 94 35 fc jmp 0x1f86a ; 0x1f86a 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) 25a86: 88 23 and r24, r24 25a88: 91 f3 breq .-28 ; 0x25a6e Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 25a8a: 82 30 cpi r24, 0x02 ; 2 25a8c: a1 f3 breq .-24 ; 0x25a76 Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 25a8e: 85 30 cpi r24, 0x05 ; 5 25a90: 09 f0 breq .+2 ; 0x25a94 25a92: 43 c0 rjmp .+134 ; 0x25b1a Sound_DoSound_Alert(true); 25a94: 81 e0 ldi r24, 0x01 ; 1 25a96: f5 cf rjmp .-22 ; 0x25a82 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) 25a98: 88 23 and r24, r24 25a9a: 49 f3 breq .-46 ; 0x25a6e Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 25a9c: 82 30 cpi r24, 0x02 ; 2 25a9e: 59 f3 breq .-42 ; 0x25a76 Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 25aa0: 85 30 cpi r24, 0x05 ; 5 25aa2: 71 f3 breq .-36 ; 0x25a80 Sound_DoSound_Alert(false); if(eSoundType==e_SOUND_TYPE_EncoderMove) 25aa4: 86 30 cpi r24, 0x06 ; 6 25aa6: e1 f4 brne .+56 ; 0x25ae0 25aa8: 85 e0 ldi r24, 0x05 ; 5 25aaa: 27 e2 ldi r18, 0x27 ; 39 25aac: 31 e0 ldi r19, 0x01 ; 1 { uint8_t nI; for(nI=0;nI<5;nI++) { WRITE(BEEPER,HIGH); 25aae: 4f b7 in r20, 0x3f ; 63 25ab0: f8 94 cli 25ab2: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 25ab6: 94 60 ori r25, 0x04 ; 4 25ab8: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 25abc: 4f bf out 0x3f, r20 ; 63 25abe: f9 01 movw r30, r18 25ac0: 31 97 sbiw r30, 0x01 ; 1 25ac2: f1 f7 brne .-4 ; 0x25ac0 delayMicroseconds(75); WRITE(BEEPER,LOW); 25ac4: 4f b7 in r20, 0x3f ; 63 25ac6: f8 94 cli 25ac8: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 25acc: 9b 7f andi r25, 0xFB ; 251 25ace: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 25ad2: 4f bf out 0x3f, r20 ; 63 25ad4: f9 01 movw r30, r18 25ad6: 31 97 sbiw r30, 0x01 ; 1 25ad8: f1 f7 brne .-4 ; 0x25ad6 25ada: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Encoder_Move(void) { uint8_t nI; for(nI=0;nI<5;nI++) 25adc: 41 f7 brne .-48 ; 0x25aae 25ade: 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) 25ae0: 87 30 cpi r24, 0x07 ; 7 25ae2: d9 f4 brne .+54 ; 0x25b1a 25ae4: 84 e1 ldi r24, 0x14 ; 20 25ae6: 23 e7 ldi r18, 0x73 ; 115 25ae8: 31 e0 ldi r19, 0x01 ; 1 backlight_wake(1); uint8_t nI; for(nI=0; nI<20; nI++) { WRITE(BEEPER,HIGH); 25aea: 4f b7 in r20, 0x3f ; 63 25aec: f8 94 cli 25aee: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 25af2: 94 60 ori r25, 0x04 ; 4 25af4: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 25af8: 4f bf out 0x3f, r20 ; 63 25afa: f9 01 movw r30, r18 25afc: 31 97 sbiw r30, 0x01 ; 1 25afe: f1 f7 brne .-4 ; 0x25afc delayMicroseconds(94); WRITE(BEEPER,LOW); 25b00: 4f b7 in r20, 0x3f ; 63 25b02: f8 94 cli 25b04: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 25b08: 9b 7f andi r25, 0xFB ; 251 25b0a: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 25b0e: 4f bf out 0x3f, r20 ; 63 25b10: f9 01 movw r30, r18 25b12: 31 97 sbiw r30, 0x01 ; 1 25b14: f1 f7 brne .-4 ; 0x25b12 25b16: 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++) 25b18: 41 f7 brne .-48 ; 0x25aea Sound_DoSound_Blind_Alert(); break; default: break; } } 25b1a: 08 95 ret 00025b1c : //! @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 ) { 25b1c: 2f 92 push r2 25b1e: 3f 92 push r3 25b20: 4f 92 push r4 25b22: 5f 92 push r5 25b24: 6f 92 push r6 25b26: 7f 92 push r7 25b28: 8f 92 push r8 25b2a: 9f 92 push r9 25b2c: af 92 push r10 25b2e: bf 92 push r11 25b30: cf 92 push r12 25b32: df 92 push r13 25b34: ef 92 push r14 25b36: ff 92 push r15 25b38: 0f 93 push r16 25b3a: 1f 93 push r17 25b3c: cf 93 push r28 25b3e: df 93 push r29 25b40: 00 d0 rcall .+0 ; 0x25b42 25b42: 00 d0 rcall .+0 ; 0x25b44 25b44: cd b7 in r28, 0x3d ; 61 25b46: de b7 in r29, 0x3e ; 62 25b48: 5c 01 movw r10, r24 25b4a: 6c 83 std Y+4, r22 ; 0x04 25b4c: 34 2e mov r3, r20 25b4e: 3b 83 std Y+3, r19 ; 0x03 25b50: 2a 83 std Y+2, r18 ; 0x02 25b52: 48 01 movw r8, r16 25b54: 2c 2c mov r2, r12 const char *msg_next = msg ? lcd_display_message_fullscreen_P(msg) : NULL; 25b56: 00 97 sbiw r24, 0x00 ; 0 25b58: 09 f0 breq .+2 ; 0x25b5c 25b5a: 51 c0 rjmp .+162 ; 0x25bfe 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); 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 d1 0a call 0x215a2 ; 0x215a2 25b6c: d1 2c mov r13, r1 25b6e: c1 2c mov r12, r1 } // Wait for user confirmation or a timeout. unsigned long previous_millis_cmd = _millis(); 25b70: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 25b74: 2b 01 movw r4, r22 25b76: 3c 01 movw r6, r24 lcd_consume_click(); 25b78: 0e 94 89 6b call 0xd712 ; 0xd712 KEEPALIVE_STATE(PAUSED_FOR_USER); 25b7c: 84 e0 ldi r24, 0x04 ; 4 25b7e: 80 93 78 02 sts 0x0278, r24 ; 0x800278 25b82: de 82 std Y+6, r13 ; 0x06 25b84: cd 82 std Y+5, r12 ; 0x05 25b86: 24 e6 ldi r18, 0x64 ; 100 25b88: 29 83 std Y+1, r18 ; 0x01 for (;;) { for (uint8_t i = 0; i < 100; ++i) { delay_keep_alive(50); 25b8a: 82 e3 ldi r24, 0x32 ; 50 25b8c: 90 e0 ldi r25, 0x00 ; 0 25b8e: 0e 94 45 7c call 0xf88a ; 0xf88a if (allow_timeouting && _millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS) { 25b92: 3c 81 ldd r19, Y+4 ; 0x04 25b94: 31 11 cpse r19, r1 25b96: 3a c0 rjmp .+116 ; 0x25c0c current_selection = LCD_BUTTON_TIMEOUT; goto exit; } if (lcd_encoder) { 25b98: 80 91 06 05 lds r24, 0x0506 ; 0x800506 25b9c: 90 91 07 05 lds r25, 0x0507 ; 0x800507 25ba0: 00 97 sbiw r24, 0x00 ; 0 25ba2: 09 f0 breq .+2 ; 0x25ba6 25ba4: 42 c0 rjmp .+132 ; 0x25c2a } else { Sound_MakeSound(e_SOUND_TYPE_BlindAlert); break; // turning knob skips waiting loop } } if (lcd_clicked()) { 25ba6: 0e 94 8e 6b call 0xd71c ; 0xd71c 25baa: 88 23 and r24, r24 25bac: 09 f4 brne .+2 ; 0x25bb0 25bae: 67 c0 rjmp .+206 ; 0x25c7e if (msg_next == NULL) { 25bb0: 8d 81 ldd r24, Y+5 ; 0x05 25bb2: 9e 81 ldd r25, Y+6 ; 0x06 25bb4: 89 2b or r24, r25 25bb6: 09 f0 breq .+2 ; 0x25bba 25bb8: 5e c0 rjmp .+188 ; 0x25c76 if (msg_next == NULL) { lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); } } exit: KEEPALIVE_STATE(IN_HANDLER); 25bba: 82 e0 ldi r24, 0x02 ; 2 25bbc: 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; 25bc0: 91 e0 ldi r25, 0x01 ; 1 25bc2: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c lcd_draw_update = 2; 25bc6: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b return current_selection; } 25bca: 83 2d mov r24, r3 25bcc: 26 96 adiw r28, 0x06 ; 6 25bce: 0f b6 in r0, 0x3f ; 63 25bd0: f8 94 cli 25bd2: de bf out 0x3e, r29 ; 62 25bd4: 0f be out 0x3f, r0 ; 63 25bd6: cd bf out 0x3d, r28 ; 61 25bd8: df 91 pop r29 25bda: cf 91 pop r28 25bdc: 1f 91 pop r17 25bde: 0f 91 pop r16 25be0: ff 90 pop r15 25be2: ef 90 pop r14 25be4: df 90 pop r13 25be6: cf 90 pop r12 25be8: bf 90 pop r11 25bea: af 90 pop r10 25bec: 9f 90 pop r9 25bee: 8f 90 pop r8 25bf0: 7f 90 pop r7 25bf2: 6f 90 pop r6 25bf4: 5f 90 pop r5 25bf6: 4f 90 pop r4 25bf8: 3f 90 pop r3 25bfa: 2f 90 pop r2 25bfc: 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; 25bfe: 0f 94 22 0b call 0x21644 ; 0x21644 25c02: 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) { 25c04: 89 2b or r24, r25 25c06: 09 f0 breq .+2 ; 0x25c0a 25c08: b3 cf rjmp .-154 ; 0x25b70 25c0a: a8 cf rjmp .-176 ; 0x25b5c 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) { 25c0c: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 25c10: 64 19 sub r22, r4 25c12: 75 09 sbc r23, r5 25c14: 86 09 sbc r24, r6 25c16: 97 09 sbc r25, r7 25c18: 61 33 cpi r22, 0x31 ; 49 25c1a: 75 47 sbci r23, 0x75 ; 117 25c1c: 81 05 cpc r24, r1 25c1e: 91 05 cpc r25, r1 25c20: 08 f4 brcc .+2 ; 0x25c24 25c22: ba cf rjmp .-140 ; 0x25b98 current_selection = LCD_BUTTON_TIMEOUT; 25c24: 33 24 eor r3, r3 25c26: 3a 94 dec r3 25c28: c8 cf rjmp .-112 ; 0x25bba goto exit; } if (lcd_encoder) { if (msg_next == NULL) { 25c2a: 2d 81 ldd r18, Y+5 ; 0x05 25c2c: 3e 81 ldd r19, Y+6 ; 0x06 25c2e: 23 2b or r18, r19 25c30: f9 f4 brne .+62 ; 0x25c70 if (third_choice) { // third_choice is not nullptr, safe to dereference 25c32: e1 14 cp r14, r1 25c34: f1 04 cpc r15, r1 25c36: b1 f0 breq .+44 ; 0x25c64 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 25c38: 97 ff sbrs r25, 7 25c3a: 0f c0 rjmp .+30 ; 0x25c5a 25c3c: 31 10 cpse r3, r1 // Rotating knob counter clockwise current_selection--; 25c3e: 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); 25c40: 87 01 movw r16, r14 25c42: 22 2d mov r18, r2 25c44: a4 01 movw r20, r8 25c46: 6a 81 ldd r22, Y+2 ; 0x02 25c48: 7b 81 ldd r23, Y+3 ; 0x03 25c4a: 83 2d mov r24, r3 25c4c: 0f 94 d1 0a call 0x215a2 ; 0x215a2 lcd_encoder = 0; 25c50: 10 92 07 05 sts 0x0507, r1 ; 0x800507 25c54: 10 92 06 05 sts 0x0506, r1 ; 0x800506 25c58: a6 cf rjmp .-180 ; 0x25ba6 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) { 25c5a: 32 e0 ldi r19, 0x02 ; 2 25c5c: 33 16 cp r3, r19 25c5e: 81 f3 breq .-32 ; 0x25c40 // Rotating knob clockwise current_selection++; 25c60: 33 94 inc r3 25c62: ee cf rjmp .-36 ; 0x25c40 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 25c64: 39 2e mov r3, r25 25c66: 30 94 com r3 25c68: 33 1c adc r3, r3 25c6a: 33 24 eor r3, r3 25c6c: 33 1c adc r3, r3 25c6e: e8 cf rjmp .-48 ; 0x25c40 } } 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); 25c70: 87 e0 ldi r24, 0x07 ; 7 25c72: 0f 94 2b 2d call 0x25a56 ; 0x25a56 goto exit; } else break; } } if (multi_screen) { 25c76: c1 14 cp r12, r1 25c78: d1 04 cpc r13, r1 25c7a: 79 f4 brne .+30 ; 0x25c9a 25c7c: 84 cf rjmp .-248 ; 0x25b86 25c7e: 99 81 ldd r25, Y+1 ; 0x01 25c80: 91 50 subi r25, 0x01 ; 1 25c82: 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) { 25c84: 91 11 cpse r25, r1 25c86: 81 cf rjmp .-254 ; 0x25b8a goto exit; } else break; } } if (multi_screen) { 25c88: c1 14 cp r12, r1 25c8a: d1 04 cpc r13, r1 25c8c: 61 f0 breq .+24 ; 0x25ca6 if (msg_next == NULL) { 25c8e: 2d 81 ldd r18, Y+5 ; 0x05 25c90: 3e 81 ldd r19, Y+6 ; 0x06 25c92: 23 2b or r18, r19 25c94: 11 f4 brne .+4 ; 0x25c9a 25c96: be 82 std Y+6, r11 ; 0x06 25c98: ad 82 std Y+5, r10 ; 0x05 msg_next = msg; } msg_next = lcd_display_message_fullscreen_P(msg_next); 25c9a: 8d 81 ldd r24, Y+5 ; 0x05 25c9c: 9e 81 ldd r25, Y+6 ; 0x06 25c9e: 0f 94 22 0b call 0x21644 ; 0x21644 25ca2: 9e 83 std Y+6, r25 ; 0x06 25ca4: 8d 83 std Y+5, r24 ; 0x05 } if (msg_next == NULL) { 25ca6: 8d 81 ldd r24, Y+5 ; 0x05 25ca8: 9e 81 ldd r25, Y+6 ; 0x06 25caa: 89 2b or r24, r25 25cac: 09 f0 breq .+2 ; 0x25cb0 25cae: 6b cf rjmp .-298 ; 0x25b86 lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); 25cb0: 87 01 movw r16, r14 25cb2: 22 2d mov r18, r2 25cb4: a4 01 movw r20, r8 25cb6: 6a 81 ldd r22, Y+2 ; 0x02 25cb8: 7b 81 ldd r23, Y+3 ; 0x03 25cba: 83 2d mov r24, r3 25cbc: 0f 94 d1 0a call 0x215a2 ; 0x215a2 25cc0: 62 cf rjmp .-316 ; 0x25b86 00025cc2 : //! @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) { 25cc2: bf 92 push r11 25cc4: cf 92 push r12 25cc6: df 92 push r13 25cc8: ef 92 push r14 25cca: ff 92 push r15 25ccc: 0f 93 push r16 25cce: 1f 93 push r17 25cd0: cf 93 push r28 25cd2: df 93 push r29 25cd4: ec 01 movw r28, r24 25cd6: d6 2e mov r13, r22 25cd8: 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); 25cda: 85 ee ldi r24, 0xE5 ; 229 25cdc: 9d e4 ldi r25, 0x4D ; 77 25cde: 0e 94 a7 6c call 0xd94e ; 0xd94e 25ce2: 8c 01 movw r16, r24 25ce4: 86 e3 ldi r24, 0x36 ; 54 25ce6: 95 e5 ldi r25, 0x55 ; 85 25ce8: 0e 94 a7 6c call 0xd94e ; 0xd94e 25cec: 2a e0 ldi r18, 0x0A ; 10 25cee: c2 2e mov r12, r18 25cf0: f1 2c mov r15, r1 25cf2: e1 2c mov r14, r1 25cf4: 9c 01 movw r18, r24 25cf6: 4b 2d mov r20, r11 25cf8: 6d 2d mov r22, r13 25cfa: ce 01 movw r24, r28 25cfc: 0f 94 8e 2d call 0x25b1c ; 0x25b1c } 25d00: df 91 pop r29 25d02: cf 91 pop r28 25d04: 1f 91 pop r17 25d06: 0f 91 pop r16 25d08: ff 90 pop r15 25d0a: ef 90 pop r14 25d0c: df 90 pop r13 25d0e: cf 90 pop r12 25d10: bf 90 pop r11 25d12: 08 95 ret 00025d14 : //! @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) { 25d14: bf 92 push r11 25d16: cf 92 push r12 25d18: df 92 push r13 25d1a: ef 92 push r14 25d1c: ff 92 push r15 25d1e: 0f 93 push r16 25d20: 1f 93 push r17 25d22: cf 93 push r28 25d24: df 93 push r29 25d26: ec 01 movw r28, r24 25d28: d6 2e mov r13, r22 25d2a: 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); 25d2c: 88 eb ldi r24, 0xB8 ; 184 25d2e: 9d e3 ldi r25, 0x3D ; 61 25d30: 0e 94 a7 6c call 0xd94e ; 0xd94e 25d34: 8c 01 movw r16, r24 25d36: 82 eb ldi r24, 0xB2 ; 178 25d38: 9d e3 ldi r25, 0x3D ; 61 25d3a: 0e 94 a7 6c call 0xd94e ; 0xd94e 25d3e: 2a e0 ldi r18, 0x0A ; 10 25d40: c2 2e mov r12, r18 25d42: f1 2c mov r15, r1 25d44: e1 2c mov r14, r1 25d46: 9c 01 movw r18, r24 25d48: 4b 2d mov r20, r11 25d4a: 6d 2d mov r22, r13 25d4c: ce 01 movw r24, r28 25d4e: 0f 94 8e 2d call 0x25b1c ; 0x25b1c } 25d52: df 91 pop r29 25d54: cf 91 pop r28 25d56: 1f 91 pop r17 25d58: 0f 91 pop r16 25d5a: ff 90 pop r15 25d5c: ef 90 pop r14 25d5e: df 90 pop r13 25d60: cf 90 pop r12 25d62: bf 90 pop r11 25d64: 08 95 ret 00025d66 : //! ---------------------- | ---------------- //! 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) { 25d66: af 92 push r10 25d68: bf 92 push r11 25d6a: cf 92 push r12 25d6c: df 92 push r13 25d6e: ef 92 push r14 25d70: ff 92 push r15 25d72: 0f 93 push r16 25d74: 1f 93 push r17 25d76: cf 93 push r28 25d78: 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); 25d7a: 88 23 and r24, r24 25d7c: 29 f0 breq .+10 ; 0x25d88 25d7e: 61 e0 ldi r22, 0x01 ; 1 25d80: 8f e5 ldi r24, 0x5F ; 95 25d82: 9f e0 ldi r25, 0x0F ; 15 25d84: 0f 94 bf a0 call 0x3417e ; 0x3417e FORCE_BL_ON_START; while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 25d88: 88 e2 ldi r24, 0x28 ; 40 25d8a: e8 2e mov r14, r24 25d8c: 88 e9 ldi r24, 0x98 ; 152 25d8e: f8 2e mov r15, r24 }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 25d90: 97 ed ldi r25, 0xD7 ; 215 25d92: c9 2e mov r12, r25 25d94: d1 2c mov r13, r1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 25d96: 2c e3 ldi r18, 0x3C ; 60 25d98: a2 2e mov r10, r18 25d9a: b1 2c mov r11, r1 25d9c: 0c 2f mov r16, r28 25d9e: 10 e0 ldi r17, 0x00 ; 0 25da0: 1f 92 push r1 25da2: cf 93 push r28 25da4: ff 92 push r15 25da6: ef 92 push r14 25da8: 0f 94 5d 9f call 0x33eba ; 0x33eba switch (state) { 25dac: 0f 90 pop r0 25dae: 0f 90 pop r0 25db0: 0f 90 pop r0 25db2: 0f 90 pop r0 25db4: ef ef ldi r30, 0xFF ; 255 25db6: ec 0f add r30, r28 25db8: ed 30 cpi r30, 0x0D ; 13 25dba: a0 f4 brcc .+40 ; 0x25de4 25dbc: f0 e0 ldi r31, 0x00 ; 0 25dbe: 88 27 eor r24, r24 25dc0: eb 51 subi r30, 0x1B ; 27 25dc2: f1 4d sbci r31, 0xD1 ; 209 25dc4: 8e 4f sbci r24, 0xFE ; 254 25dc6: 0d 94 ab a1 jmp 0x34356 ; 0x34356 <__tablejump2__> 25dca: f5 36 cpi r31, 0x65 ; 101 25dcc: 5f 37 cpi r21, 0x7F ; 127 25dce: 81 37 cpi r24, 0x71 ; 113 25dd0: 53 38 cpi r21, 0x83 ; 131 25dd2: ef 37 cpi r30, 0x7F ; 127 25dd4: c9 36 cpi r28, 0x69 ; 105 25dd6: 81 38 cpi r24, 0x81 ; 129 25dd8: 5f 38 cpi r21, 0x8F ; 143 25dda: 3f 38 cpi r19, 0x8F ; 143 25ddc: 1b 38 cpi r17, 0x8B ; 139 25dde: e5 37 cpi r30, 0x75 ; 117 25de0: e5 36 cpi r30, 0x65 ; 101 25de2: e5 36 cpi r30, 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; 25de4: 10 92 e7 11 sts 0x11E7, r1 ; 0x8011e7 if( eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)==2){ 25de8: 8f e5 ldi r24, 0x5F ; 95 25dea: 9f e0 ldi r25, 0x0F ; 15 25dec: 0f 94 9b a0 call 0x34136 ; 0x34136 25df0: 82 30 cpi r24, 0x02 ; 2 25df2: 39 f4 brne .+14 ; 0x25e02 // printer pre-assembled: finish remaining steps lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_WELCOME_SHIPPING)); 25df4: 8d e7 ldi r24, 0x7D ; 125 25df6: 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)); 25df8: 0e 94 a7 6c call 0xd94e ; 0xd94e 25dfc: 0f 94 a9 0b call 0x21752 ; 0x21752 25e00: 0f c0 rjmp .+30 ; 0x25e20 // 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); 25e02: 88 e1 ldi r24, 0x18 ; 24 25e04: 94 e5 ldi r25, 0x54 ; 84 25e06: 0e 94 a7 6c call 0xd94e ; 0xd94e 25e0a: 40 e0 ldi r20, 0x00 ; 0 25e0c: 60 e0 ldi r22, 0x00 ; 0 25e0e: 0f 94 8a 2e call 0x25d14 ; 0x25d14 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 25e12: 81 11 cpse r24, r1 25e14: 07 c0 rjmp .+14 ; 0x25e24 25e16: 61 e0 ldi r22, 0x01 ; 1 25e18: 8f e5 ldi r24, 0x5F ; 95 25e1a: 9f e0 ldi r25, 0x0F ; 15 25e1c: 0f 94 bf a0 call 0x3417e ; 0x3417e state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); state = S::Restore; 25e20: c1 e0 ldi r28, 0x01 ; 1 25e22: bc cf rjmp .-136 ; 0x25d9c 25e24: 60 e0 ldi r22, 0x00 ; 0 25e26: 8f e5 ldi r24, 0x5F ; 95 25e28: 9f e0 ldi r25, 0x0F ; 15 25e2a: 0f 94 bf a0 call 0x3417e ; 0x3417e 25e2e: 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); 25e30: 10 e0 ldi r17, 0x00 ; 0 25e32: 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); 25e34: 1f 93 push r17 25e36: 0f 93 push r16 25e38: 8e e3 ldi r24, 0x3E ; 62 25e3a: 9b e6 ldi r25, 0x6B ; 107 25e3c: 9f 93 push r25 25e3e: 8f 93 push r24 25e40: 0f 94 5d 9f call 0x33eba ; 0x33eba switch (state) { 25e44: 0f 90 pop r0 25e46: 0f 90 pop r0 25e48: 0f 90 pop r0 25e4a: 0f 90 pop r0 25e4c: cc 30 cpi r28, 0x0C ; 12 25e4e: 09 f4 brne .+2 ; 0x25e52 25e50: ed c0 rjmp .+474 ; 0x2602c 25e52: cd 30 cpi r28, 0x0D ; 13 25e54: 09 f4 brne .+2 ; 0x25e58 25e56: ff c0 rjmp .+510 ; 0x26056 case S::Run: // user interrupted msg = _T(MSG_WIZARD_QUIT); 25e58: 87 e7 ldi r24, 0x77 ; 119 25e5a: 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) { 25e5c: cc 23 and r28, r28 25e5e: 09 f4 brne .+2 ; 0x25e62 25e60: fc c0 rjmp .+504 ; 0x2605a break; } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); 25e62: 81 e0 ldi r24, 0x01 ; 1 25e64: 0e 94 b6 69 call 0xd36c ; 0xd36c lcd_update(2); 25e68: 82 e0 ldi r24, 0x02 ; 2 } 25e6a: cf 91 pop r28 25e6c: 1f 91 pop r17 25e6e: 0f 91 pop r16 25e70: ff 90 pop r15 25e72: ef 90 pop r14 25e74: df 90 pop r13 25e76: cf 90 pop r12 25e78: bf 90 pop r11 25e7a: af 90 pop r10 } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); lcd_update(2); 25e7c: 0c 94 38 69 jmp 0xd270 ; 0xd270 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 25e80: 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)) { 25e84: 81 e0 ldi r24, 0x01 ; 1 25e86: 0e 94 52 d8 call 0x1b0a4 ; 0x1b0a4 state = S::Selftest; 25e8a: 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)) { 25e8c: 88 23 and r24, r24 25e8e: 09 f4 brne .+2 ; 0x25e92 25e90: 85 cf rjmp .-246 ; 0x25d9c state = S::Selftest; } else if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 25e92: 82 e0 ldi r24, 0x02 ; 2 25e94: 0e 94 52 d8 call 0x1b0a4 ; 0x1b0a4 // S::Xyz *includes* S::Z so it needs to come before // to avoid repeating Z alignment state = S::Xyz; 25e98: 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)) { 25e9a: 88 23 and r24, r24 25e9c: 09 f4 brne .+2 ; 0x25ea0 25e9e: 7e cf rjmp .-260 ; 0x25d9c // 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)) { 25ea0: 84 e0 ldi r24, 0x04 ; 4 25ea2: 0e 94 52 d8 call 0x1b0a4 ; 0x1b0a4 state = S::Z; 25ea6: 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)) { 25ea8: 88 23 and r24, r24 25eaa: 09 f4 brne .+2 ; 0x25eae 25eac: 77 cf rjmp .-274 ; 0x25d9c 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)) { 25eae: 80 e1 ldi r24, 0x10 ; 16 25eb0: 0e 94 52 d8 call 0x1b0a4 ; 0x1b0a4 state = S::IsFil; 25eb4: 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)) { 25eb6: 88 23 and r24, r24 25eb8: 09 f4 brne .+2 ; 0x25ebc 25eba: 70 cf rjmp .-288 ; 0x25d9c state = S::IsFil; } else { // all required steps completed, finish successfully state = S::Finish; 25ebc: cc e0 ldi r28, 0x0C ; 12 25ebe: 6e cf rjmp .-292 ; 0x25d9c } break; case S::Selftest: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_SELFTEST)); 25ec0: 8f ec ldi r24, 0xCF ; 207 25ec2: 93 e5 ldi r25, 0x53 ; 83 25ec4: 0e 94 a7 6c call 0xd94e ; 0xd94e 25ec8: 0f 94 a9 0b call 0x21752 ; 0x21752 wizard_event = lcd_selftest(); 25ecc: 0e 94 2b f4 call 0x1e856 ; 0x1e856 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); 25ed0: 81 11 cpse r24, r1 25ed2: a6 cf rjmp .-180 ; 0x25e20 } 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); 25ed4: cd e0 ldi r28, 0x0D ; 13 25ed6: 62 cf rjmp .-316 ; 0x25d9c break; case S::Xyz: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_XYZ_CAL)); 25ed8: 81 e9 ldi r24, 0x91 ; 145 25eda: 93 e5 ldi r25, 0x53 ; 83 25edc: 0e 94 a7 6c call 0xd94e ; 0xd94e 25ee0: 0f 94 a9 0b call 0x21752 ; 0x21752 wizard_event = gcode_M45(false, 0); 25ee4: 80 e0 ldi r24, 0x00 ; 0 25ee6: 0e 94 90 c6 call 0x18d20 ; 0x18d20 25eea: f2 cf rjmp .-28 ; 0x25ed0 state = (wizard_event ? S::Restore : S::Failed); break; case S::Z: lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_SHIPPING_HELPERS)); 25eec: 89 e6 ldi r24, 0x69 ; 105 25eee: 93 e5 ldi r25, 0x53 ; 83 25ef0: 0e 94 a7 6c call 0xd94e ; 0xd94e 25ef4: 0f 94 a9 0b call 0x21752 ; 0x21752 lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_TEST_PRINT)); 25ef8: 8b e3 ldi r24, 0x3B ; 59 25efa: 93 e5 ldi r25, 0x53 ; 83 25efc: 0e 94 a7 6c call 0xd94e ; 0xd94e 25f00: 0f 94 a9 0b call 0x21752 ; 0x21752 lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_Z_CAL)); 25f04: 8b e1 ldi r24, 0x1B ; 27 25f06: 93 e5 ldi r25, 0x53 ; 83 25f08: 0e 94 a7 6c call 0xd94e ; 0xd94e 25f0c: 0f 94 a9 0b call 0x21752 ; 0x21752 wizard_event = gcode_M45(true, 0); 25f10: 81 e0 ldi r24, 0x01 ; 1 25f12: 0e 94 90 c6 call 0x18d20 ; 0x18d20 if (!wizard_event) { 25f16: 88 23 and r24, r24 25f18: e9 f2 breq .-70 ; 0x25ed4 state = S::Failed; } else { raise_z_above(MIN_Z_FOR_SWAP); 25f1a: 60 e0 ldi r22, 0x00 ; 0 25f1c: 70 e0 ldi r23, 0x00 ; 0 25f1e: 88 ed ldi r24, 0xD8 ; 216 25f20: 91 e4 ldi r25, 0x41 ; 65 25f22: 0e 94 35 67 call 0xce6a ; 0xce6a if(!MMU2::mmu2.Enabled()) { 25f26: 80 91 94 12 lds r24, 0x1294 ; 0x801294 25f2a: 81 30 cpi r24, 0x01 ; 1 25f2c: 09 f4 brne .+2 ; 0x25f30 25f2e: 78 cf rjmp .-272 ; 0x25e20 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 25f30: d0 92 f2 11 sts 0x11F2, r13 ; 0x8011f2 25f34: 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)); 25f38: 86 ef ldi r24, 0xF6 ; 246 25f3a: 92 e5 ldi r25, 0x52 ; 82 25f3c: 0e 94 a7 6c call 0xd94e ; 0xd94e 25f40: 0f 94 22 0b call 0x21644 ; 0x21644 wait_preheat(); 25f44: 0f 94 2f 0b call 0x2165e ; 0x2165e unload_filament(FILAMENTCHANGE_FINALRETRACT); // unload current filament 25f48: 60 e0 ldi r22, 0x00 ; 0 25f4a: 70 e0 ldi r23, 0x00 ; 0 25f4c: cb 01 movw r24, r22 25f4e: 0e 94 86 f0 call 0x1e10c ; 0x1e10c lcd_wizard_load(); // load filament 25f52: 0f 94 12 0c call 0x21824 ; 0x21824 25f56: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 25f5a: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 25f5e: 60 cf rjmp .-320 ; 0x25e20 25f60: d0 92 f2 11 sts 0x11F2, r13 ; 0x8011f2 25f64: c0 92 f1 11 sts 0x11F1, r12 ; 0x8011f1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 25f68: b0 92 ee 11 sts 0x11EE, r11 ; 0x8011ee 25f6c: 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); 25f70: 80 ee ldi r24, 0xE0 ; 224 25f72: 92 e5 ldi r25, 0x52 ; 82 25f74: 0e 94 a7 6c call 0xd94e ; 0xd94e 25f78: 41 e0 ldi r20, 0x01 ; 1 25f7a: 60 e0 ldi r22, 0x00 ; 0 25f7c: 0f 94 8a 2e call 0x25d14 ; 0x25d14 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 25f80: 88 23 and r24, r24 25f82: 09 f1 breq .+66 ; 0x25fc6 state = S::Lay1CalCold; } else { // MIDDLE_BUTTON_CHOICE if(MMU2::mmu2.Enabled()) state = S::LoadFilCold; 25f84: 80 91 94 12 lds r24, 0x1294 ; 0x801294 25f88: c7 e0 ldi r28, 0x07 ; 7 25f8a: 81 30 cpi r24, 0x01 ; 1 25f8c: 09 f4 brne .+2 ; 0x25f90 25f8e: 06 cf rjmp .-500 ; 0x25d9c else state = S::Preheat; 25f90: c6 e0 ldi r28, 0x06 ; 6 25f92: 04 cf rjmp .-504 ; 0x25d9c } break; case S::Preheat: menu_goto(lcd_preheat_menu, 0, true); 25f94: 20 e0 ldi r18, 0x00 ; 0 25f96: 41 e0 ldi r20, 0x01 ; 1 25f98: 70 e0 ldi r23, 0x00 ; 0 25f9a: 60 e0 ldi r22, 0x00 ; 0 25f9c: 8b e8 ldi r24, 0x8B ; 139 25f9e: 98 e3 ldi r25, 0x38 ; 56 25fa0: 0f 94 a5 93 call 0x3274a ; 0x3274a lcd_show_fullscreen_message_and_wait_P(_T(MSG_SEL_PREHEAT_TEMP)); 25fa4: 8f e9 ldi r24, 0x9F ; 159 25fa6: 92 e5 ldi r25, 0x52 ; 82 25fa8: 0e 94 a7 6c call 0xd94e ; 0xd94e 25fac: 0f 94 a9 0b call 0x21752 ; 0x21752 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); 25fb0: 06 e0 ldi r16, 0x06 ; 6 25fb2: 10 e0 ldi r17, 0x00 ; 0 25fb4: 3f cf rjmp .-386 ; 0x25e34 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(); 25fb6: 0f 94 2f 0b call 0x2165e ; 0x2165e lcd_wizard_load(); 25fba: 0f 94 12 0c call 0x21824 ; 0x21824 state = S::Lay1CalHot; 25fbe: ca e0 ldi r28, 0x0A ; 10 25fc0: ed ce rjmp .-550 ; 0x25d9c break; case S::LoadFilCold: lcd_wizard_load(); 25fc2: 0f 94 12 0c call 0x21824 ; 0x21824 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; 25fc6: c9 e0 ldi r28, 0x09 ; 9 25fc8: e9 ce rjmp .-558 ; 0x25d9c case S::LoadFilCold: lcd_wizard_load(); state = S::Lay1CalCold; break; case S::Lay1CalCold: wizard_lay1cal_message(true); 25fca: 81 e0 ldi r24, 0x01 ; 1 25fcc: 0f 94 f4 0b call 0x217e8 ; 0x217e8 menu_goto(lcd_v2_calibration, 0, true); 25fd0: 20 e0 ldi r18, 0x00 ; 0 25fd2: 41 e0 ldi r20, 0x01 ; 1 25fd4: 70 e0 ldi r23, 0x00 ; 0 25fd6: 60 e0 ldi r22, 0x00 ; 0 25fd8: 8f ed ldi r24, 0xDF ; 223 25fda: 96 e3 ldi r25, 0x36 ; 54 25fdc: 0f 94 a5 93 call 0x3274a ; 0x3274a 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); 25fe0: 09 e0 ldi r16, 0x09 ; 9 25fe2: 10 e0 ldi r17, 0x00 ; 0 25fe4: 27 cf rjmp .-434 ; 0x25e34 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); 25fe6: 80 e0 ldi r24, 0x00 ; 0 25fe8: 0f 94 f4 0b call 0x217e8 ; 0x217e8 lcd_commands_type = LcdCommands::Layer1Cal; 25fec: 84 e0 ldi r24, 0x04 ; 4 25fee: 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); 25ff2: 0a e0 ldi r16, 0x0A ; 10 25ff4: 10 e0 ldi r17, 0x00 ; 0 25ff6: 1e cf rjmp .-452 ; 0x25e34 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); 25ff8: 8c e4 ldi r24, 0x4C ; 76 25ffa: 92 e5 ldi r25, 0x52 ; 82 25ffc: 0e 94 a7 6c call 0xd94e ; 0xd94e 26000: 41 e0 ldi r20, 0x01 ; 1 26002: 60 e0 ldi r22, 0x00 ; 0 26004: 0f 94 8a 2e call 0x25d14 ; 0x25d14 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) 26008: 81 11 cpse r24, r1 2600a: 07 c0 rjmp .+14 ; 0x2601a { lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_CLEAN_HEATBED)); 2600c: 8c e1 ldi r24, 0x1C ; 28 2600e: 92 e5 ldi r25, 0x52 ; 82 26010: 0e 94 a7 6c call 0xd94e ; 0xd94e 26014: 0f 94 a9 0b call 0x21752 ; 0x21752 26018: d6 cf rjmp .-84 ; 0x25fc6 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); 2601a: 86 eb ldi r24, 0xB6 ; 182 2601c: 91 e5 ldi r25, 0x51 ; 81 2601e: ec ce rjmp .-552 ; 0x25df8 26020: 60 e0 ldi r22, 0x00 ; 0 26022: 8f e5 ldi r24, 0x5F ; 95 26024: 9f e0 ldi r25, 0x0F ; 15 26026: 0f 94 bf a0 call 0x3417e ; 0x3417e 2602a: 04 cf rjmp .-504 ; 0x25e34 msg = _T(MSG_WIZARD_QUIT); break; case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); 2602c: 88 e5 ldi r24, 0x58 ; 88 2602e: 91 e5 ldi r25, 0x51 ; 81 26030: 0e 94 a7 6c call 0xd94e ; 0xd94e 26034: 8c 01 movw r16, r24 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 26036: 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); 2603a: 87 e6 ldi r24, 0x67 ; 103 2603c: 9b e6 ldi r25, 0x6B ; 107 2603e: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 lcd_return_to_status(); 26042: 0e 94 6d fe call 0x1fcda ; 0x1fcda default: // exiting for later re-entry break; } if (msg) { 26046: 01 15 cp r16, r1 26048: 11 05 cpc r17, r1 2604a: 09 f4 brne .+2 ; 0x2604e 2604c: 0a cf rjmp .-492 ; 0x25e62 lcd_show_fullscreen_message_and_wait_P(msg); 2604e: c8 01 movw r24, r16 26050: 0f 94 a9 0b call 0x21752 ; 0x21752 26054: 06 cf rjmp .-500 ; 0x25e62 lcd_return_to_status(); break; case S::Failed: // aborted due to failure msg = _T(MSG_WIZARD_CALIBRATION_FAILED); 26056: 86 ef ldi r24, 0xF6 ; 246 26058: 90 e5 ldi r25, 0x50 ; 80 2605a: 0e 94 a7 6c call 0xd94e ; 0xd94e 2605e: 8c 01 movw r16, r24 26060: f2 cf rjmp .-28 ; 0x26046 00026062 : menu_goto(lcd_generic_preheat_menu, 0, true); } void lcd_wizard() { bool result = true; if (calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 26062: 87 e1 ldi r24, 0x17 ; 23 26064: 0e 94 52 d8 call 0x1b0a4 ; 0x1b0a4 26068: 81 11 cpse r24, r1 2606a: 06 c0 rjmp .+12 ; 0x26078 // 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); 2606c: 87 e1 ldi r24, 0x17 ; 23 2606e: 0e 94 2e c6 call 0x18c5c ; 0x18c5c lcd_wizard(WizState::Run); 26072: 80 e0 ldi r24, 0x00 ; 0 26074: 0d 94 b3 2e jmp 0x25d66 ; 0x25d66 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); 26078: 8e ee ldi r24, 0xEE ; 238 2607a: 9d e4 ldi r25, 0x4D ; 77 2607c: 0e 94 a7 6c call 0xd94e ; 0xd94e 26080: 41 e0 ldi r20, 0x01 ; 1 26082: 60 e0 ldi r22, 0x00 ; 0 26084: 0f 94 61 2e call 0x25cc2 ; 0x25cc2 } if (result) { 26088: 88 23 and r24, r24 2608a: 81 f3 breq .-32 ; 0x2606c calibration_status_clear(CALIBRATION_WIZARD_STEPS); lcd_wizard(WizState::Run); } else { lcd_return_to_status(); 2608c: 0e 94 6d fe call 0x1fcda ; 0x1fcda lcd_update_enable(true); 26090: 81 e0 ldi r24, 0x01 ; 1 26092: 0e 94 b6 69 call 0xd36c ; 0xd36c lcd_update(2); 26096: 82 e0 ldi r24, 0x02 ; 2 26098: 0c 94 38 69 jmp 0xd270 ; 0xd270 0002609c : if (result == LCD_LEFT_BUTTON_CHOICE) { lcd_mesh_calibration_z(); } } void prompt_steel_sheet_on_bed(bool wantedState) { 2609c: cf 93 push r28 2609e: 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); 260a0: 89 ed ldi r24, 0xD9 ; 217 260a2: 90 e5 ldi r25, 0x50 ; 80 260a4: 0e 94 a7 6c call 0xd94e ; 0xd94e 260a8: 41 e0 ldi r20, 0x01 ; 1 260aa: 4c 27 eor r20, r28 260ac: 60 e0 ldi r22, 0x00 ; 0 260ae: 0f 94 8a 2e call 0x25d14 ; 0x25d14 260b2: 91 e0 ldi r25, 0x01 ; 1 260b4: 81 11 cpse r24, r1 260b6: 90 e0 ldi r25, 0x00 ; 0 if (sheetIsOnBed != wantedState) { 260b8: c9 17 cp r28, r25 260ba: 59 f0 breq .+22 ; 0x260d2 lcd_show_fullscreen_message_and_wait_P(_T(wantedState ? MSG_PLACE_STEEL_SHEET : MSG_REMOVE_STEEL_SHEET)); 260bc: 8f ea ldi r24, 0xAF ; 175 260be: 90 e5 ldi r25, 0x50 ; 80 260c0: cc 23 and r28, r28 260c2: 11 f0 breq .+4 ; 0x260c8 260c4: 82 e5 ldi r24, 0x52 ; 82 260c6: 96 e4 ldi r25, 0x46 ; 70 260c8: 0e 94 a7 6c call 0xd94e ; 0xd94e } #endif //STEEL_SHEET } 260cc: 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)); 260ce: 0d 94 a9 0b jmp 0x21752 ; 0x21752 } #endif //STEEL_SHEET } 260d2: cf 91 pop r28 260d4: 08 95 ret 000260d6 : } lcd_show_fullscreen_message_and_wait_P( _T(MSG_WIZARD_V2_CAL_2)); } void lcd_z_calibration_prompt(bool allowTimeouting) { 260d6: cf 93 push r28 260d8: c8 2f mov r28, r24 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_Z_CALIBRATION_PROMPT), allowTimeouting, 0); 260da: 86 e8 ldi r24, 0x86 ; 134 260dc: 90 e5 ldi r25, 0x50 ; 80 260de: 0e 94 a7 6c call 0xd94e ; 0xd94e 260e2: 40 e0 ldi r20, 0x00 ; 0 260e4: 6c 2f mov r22, r28 260e6: 0f 94 8a 2e call 0x25d14 ; 0x25d14 if (result == LCD_LEFT_BUTTON_CHOICE) { 260ea: 81 11 cpse r24, r1 260ec: 03 c0 rjmp .+6 ; 0x260f4 lcd_mesh_calibration_z(); } } 260ee: 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(); 260f0: 0c 94 af fe jmp 0x1fd5e ; 0x1fd5e } } 260f4: cf 91 pop r28 260f6: 08 95 ret 000260f8 : _delay(2000); lcd_clear(); } void lcd_load_filament_color_check() { 260f8: cf 92 push r12 260fa: ef 92 push r14 260fc: ff 92 push r15 260fe: 0f 93 push r16 26100: 1f 93 push r17 26102: cf 93 push r28 26104: 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); 26106: 82 eb ldi r24, 0xB2 ; 178 26108: 9d e3 ldi r25, 0x3D ; 61 2610a: 0e 94 a7 6c call 0xd94e ; 0xd94e 2610e: 0f 94 59 9e call 0x33cb2 ; 0x33cb2 <__strlen_P> 26112: c8 2e mov r12, r24 26114: 8a e8 ldi r24, 0x8A ; 138 26116: 9a e4 ldi r25, 0x4A ; 74 26118: 0e 94 a7 6c call 0xd94e ; 0xd94e 2611c: 7c 01 movw r14, r24 2611e: 88 eb ldi r24, 0xB8 ; 184 26120: 9d e3 ldi r25, 0x3D ; 61 26122: 0e 94 a7 6c call 0xd94e ; 0xd94e 26126: 8c 01 movw r16, r24 26128: 82 eb ldi r24, 0xB2 ; 178 2612a: 9d e3 ldi r25, 0x3D ; 61 2612c: 0e 94 a7 6c call 0xd94e ; 0xd94e 26130: ec 01 movw r28, r24 26132: 8f e5 ldi r24, 0x5F ; 95 26134: 9a e4 ldi r25, 0x4A ; 74 26136: 0e 94 a7 6c call 0xd94e ; 0xd94e 2613a: c3 94 inc r12 2613c: c3 94 inc r12 2613e: 9e 01 movw r18, r28 26140: 40 e0 ldi r20, 0x00 ; 0 26142: 60 e0 ldi r22, 0x00 ; 0 26144: 0f 94 8e 2d call 0x25b1c ; 0x25b1c while (clean == LCD_MIDDLE_BUTTON_CHOICE) { 26148: 81 30 cpi r24, 0x01 ; 1 2614a: 29 f4 brne .+10 ; 0x26156 load_filament_final_feed(); 2614c: 0e 94 6b 5e call 0xbcd6 ; 0xbcd6 st_synchronize(); 26150: 0f 94 ce 22 call 0x2459c ; 0x2459c 26154: d8 cf rjmp .-80 ; 0x26106 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) { 26156: 82 30 cpi r24, 0x02 ; 2 26158: 61 f4 brne .+24 ; 0x26172 unload_filament(FILAMENTCHANGE_FINALRETRACT); 2615a: 60 e0 ldi r22, 0x00 ; 0 2615c: 70 e0 ldi r23, 0x00 ; 0 2615e: cb 01 movw r24, r22 } } 26160: df 91 pop r29 26162: cf 91 pop r28 26164: 1f 91 pop r17 26166: 0f 91 pop r16 26168: ff 90 pop r15 2616a: ef 90 pop r14 2616c: 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); 2616e: 0c 94 86 f0 jmp 0x1e10c ; 0x1e10c } } 26172: df 91 pop r29 26174: cf 91 pop r28 26176: 1f 91 pop r17 26178: 0f 91 pop r16 2617a: ff 90 pop r15 2617c: ef 90 pop r14 2617e: cf 90 pop r12 26180: 08 95 ret 00026182 : static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); } void mFilamentItem(uint16_t nTemp, uint16_t nTempBed) { 26182: 0f 93 push r16 26184: 1f 93 push r17 26186: cf 93 push r28 26188: df 93 push r29 2618a: 8c 01 movw r16, r24 2618c: 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; 2618e: 90 93 f2 11 sts 0x11F2, r25 ; 0x8011f2 26192: 80 93 f1 11 sts 0x11F1, r24 ; 0x8011f1 setTargetHotend((float)nTemp); if (!shouldPreheatOnlyNozzle()) setTargetBed((float)nTempBed); 26196: 0e 94 39 fe call 0x1fc72 ; 0x1fc72 2619a: 81 11 cpse r24, r1 2619c: 04 c0 rjmp .+8 ; 0x261a6 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2619e: d0 93 ee 11 sts 0x11EE, r29 ; 0x8011ee 261a2: c0 93 ed 11 sts 0x11ED, r28 ; 0x8011ed { const FilamentAction action = eFilamentAction; 261a6: c0 91 62 03 lds r28, 0x0362 ; 0x800362 if (action == FilamentAction::Preheat || action == FilamentAction::Lay1Cal) 261aa: 87 ef ldi r24, 0xF7 ; 247 261ac: 8c 0f add r24, r28 261ae: 82 30 cpi r24, 0x02 ; 2 261b0: f8 f4 brcc .+62 ; 0x261f0 { lcd_return_to_status(); 261b2: 0e 94 6d fe call 0x1fcda ; 0x1fcda if (action == FilamentAction::Lay1Cal) 261b6: ca 30 cpi r28, 0x0A ; 10 261b8: 41 f4 brne .+16 ; 0x261ca { lcd_commands_type = LcdCommands::Layer1Cal; 261ba: 84 e0 ldi r24, 0x04 ; 4 261bc: 80 93 c8 0d sts 0x0DC8, r24 ; 0x800dc8 } menu_back(); clearFilamentAction(); } } } 261c0: df 91 pop r29 261c2: cf 91 pop r28 261c4: 1f 91 pop r17 261c6: 0f 91 pop r16 261c8: 08 95 ret { lcd_commands_type = LcdCommands::Layer1Cal; } else { raise_z_above(MIN_Z_FOR_PREHEAT); 261ca: 60 e0 ldi r22, 0x00 ; 0 261cc: 70 e0 ldi r23, 0x00 ; 0 261ce: 80 e2 ldi r24, 0x20 ; 32 261d0: 91 e4 ldi r25, 0x41 ; 65 261d2: 0e 94 35 67 call 0xce6a ; 0xce6a if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 261d6: 8f e5 ldi r24, 0x5F ; 95 261d8: 9f e0 ldi r25, 0x0F ; 15 261da: 0f 94 9b a0 call 0x34136 ; 0x34136 261de: 88 23 and r24, r24 261e0: 79 f3 breq .-34 ; 0x261c0 lcd_wizard(WizState::LoadFilHot); 261e2: 88 e0 ldi r24, 0x08 ; 8 } menu_back(); clearFilamentAction(); } } } 261e4: df 91 pop r29 261e6: cf 91 pop r28 261e8: 1f 91 pop r17 261ea: 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); 261ec: 0d 94 b3 2e jmp 0x25d66 ; 0x25d66 261f0: 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) 261f4: 80 91 83 06 lds r24, 0x0683 ; 0x800683 261f8: 81 11 cpse r24, r1 261fa: 12 c0 rjmp .+36 ; 0x26220 261fc: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 26200: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 26204: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 26208: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 2620c: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 26210: 60 1b sub r22, r16 26212: 71 0b sbc r23, r17 26214: 6c 5f subi r22, 0xFC ; 252 26216: 7f 4f sbci r23, 0xFF ; 255 26218: 69 30 cpi r22, 0x09 ; 9 2621a: 71 05 cpc r23, r1 2621c: 08 f0 brcs .+2 ; 0x26220 2621e: 60 c0 rjmp .+192 ; 0x262e0 { menu_func_t filamentActionMenu = nullptr; switch (eFilamentAction) 26220: c1 50 subi r28, 0x01 ; 1 26222: c8 30 cpi r28, 0x08 ; 8 26224: 88 f5 brcc .+98 ; 0x26288 26226: ec 2f mov r30, r28 26228: f0 e0 ldi r31, 0x00 ; 0 2622a: 88 27 eor r24, r24 2622c: e5 5e subi r30, 0xE5 ; 229 2622e: fe 4c sbci r31, 0xCE ; 206 26230: 8e 4f sbci r24, 0xFE ; 254 26232: 0d 94 ab a1 jmp 0x34356 ; 0x34356 <__tablejump2__> 26236: 47 37 cpi r20, 0x77 ; 119 26238: 47 37 cpi r20, 0x77 ; 119 2623a: 47 37 cpi r20, 0x77 ; 119 2623c: 97 38 cpi r25, 0x87 ; 135 2623e: 6b 38 cpi r22, 0x8B ; 139 26240: 51 37 cpi r21, 0x71 ; 113 26242: 41 38 cpi r20, 0x81 ; 129 26244: 1f 38 cpi r17, 0x8F ; 143 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament } break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; 26246: c5 e6 ldi r28, 0x65 ; 101 26248: dc eb ldi r29, 0xBC ; 188 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: // handled earlier break; } if (bFilamentWaitingFlag) { 2624a: 80 91 81 06 lds r24, 0x0681 ; 0x800681 2624e: 88 23 and r24, r24 26250: 29 f0 breq .+10 ; 0x2625c Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 26252: 82 e0 ldi r24, 0x02 ; 2 26254: 0f 94 2b 2d call 0x25a56 ; 0x25a56 bFilamentWaitingFlag = false; 26258: 10 92 81 06 sts 0x0681, r1 ; 0x800681 } if (filamentActionMenu) { 2625c: 20 97 sbiw r28, 0x00 ; 0 2625e: 09 f4 brne .+2 ; 0x26262 26260: af cf rjmp .-162 ; 0x261c0 // Reset the menu stack and filament action before entering action menu mFilamentResetMenuStack(); 26262: 0f 94 10 07 call 0x20e20 ; 0x20e20 // The menu should clear eFilamentAction when the // 'action' is done menu_submenu(filamentActionMenu, true); 26266: 61 e0 ldi r22, 0x01 ; 1 26268: ce 01 movw r24, r28 } menu_back(); clearFilamentAction(); } } } 2626a: df 91 pop r29 2626c: cf 91 pop r28 2626e: 1f 91 pop r17 26270: 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); 26272: 0d 94 e8 94 jmp 0x329d0 ; 0x329d0 switch (eFilamentAction) { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); 26276: 80 91 81 06 lds r24, 0x0681 ; 0x800681 2627a: 88 23 and r24, r24 2627c: 41 f0 breq .+16 ; 0x2628e 2627e: 61 e0 ldi r22, 0x01 ; 1 26280: 87 eb ldi r24, 0xB7 ; 183 26282: 96 e3 ldi r25, 0x36 ; 54 26284: 0f 94 e8 94 call 0x329d0 ; 0x329d0 // 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; 26288: d0 e0 ldi r29, 0x00 ; 0 2628a: c0 e0 ldi r28, 0x00 ; 0 2628c: de cf rjmp .-68 ; 0x2624a case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); else { mFilamentResetMenuStack(); 2628e: 0f 94 10 07 call 0x20e20 ; 0x20e20 if (eFilamentAction == FilamentAction::AutoLoad) { 26292: 80 91 62 03 lds r24, 0x0362 ; 0x800362 26296: 82 30 cpi r24, 0x02 ; 2 26298: 19 f4 brne .+6 ; 0x262a0 // loading no longer cancellable eFilamentAction = FilamentAction::Load; 2629a: 81 e0 ldi r24, 0x01 ; 1 2629c: 80 93 62 03 sts 0x0362, r24 ; 0x800362 } if (eFilamentAction == FilamentAction::Load) 262a0: 80 91 62 03 lds r24, 0x0362 ; 0x800362 262a4: 81 30 cpi r24, 0x01 ; 1 262a6: 31 f4 brne .+12 ; 0x262b4 enquecommand_P(MSG_M701); // load filament 262a8: 61 e0 ldi r22, 0x01 ; 1 262aa: 83 e9 ldi r24, 0x93 ; 147 262ac: 9a e6 ldi r25, 0x6A ; 106 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament 262ae: 0e 94 ac 7c call 0xf958 ; 0xf958 262b2: ea cf rjmp .-44 ; 0x26288 eFilamentAction = FilamentAction::Load; } if (eFilamentAction == FilamentAction::Load) enquecommand_P(MSG_M701); // load filament else if (eFilamentAction == FilamentAction::UnLoad) 262b4: 83 30 cpi r24, 0x03 ; 3 262b6: 41 f7 brne .-48 ; 0x26288 enquecommand_P(MSG_M702); // unload filament 262b8: 61 e0 ldi r22, 0x01 ; 1 262ba: 8d e0 ldi r24, 0x0D ; 13 262bc: 98 e6 ldi r25, 0x68 ; 104 262be: f7 cf rjmp .-18 ; 0x262ae break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; break; case FilamentAction::MmuLoadingTest: filamentActionMenu = mmu_loading_test_menu; 262c0: cf ed ldi r28, 0xDF ; 223 262c2: db eb ldi r29, 0xBB ; 187 262c4: c2 cf rjmp .-124 ; 0x2624a break; case FilamentAction::MmuUnLoad: mFilamentResetMenuStack(); 262c6: 0f 94 10 07 call 0x20e20 ; 0x20e20 MMU2::mmu2.unload(); 262ca: 0f 94 52 6b call 0x2d6a4 ; 0x2d6a4 // 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(); 262ce: 0f 94 91 0c call 0x21922 ; 0x21922 262d2: da cf rjmp .-76 ; 0x26288 break; case FilamentAction::MmuEject: filamentActionMenu = mmu_fil_eject_menu; 262d4: cd e5 ldi r28, 0x5D ; 93 262d6: dc eb ldi r29, 0xBC ; 188 262d8: b8 cf rjmp .-144 ; 0x2624a break; case FilamentAction::MmuCut: #ifdef MMU_HAS_CUTTER filamentActionMenu = mmu_cut_filament_menu; 262da: c5 e5 ldi r28, 0x55 ; 85 262dc: dc eb ldi r29, 0xBC ; 188 262de: b5 cf rjmp .-150 ; 0x2624a menu_submenu(filamentActionMenu, true); } } else // still preheating, continue updating LCD UI { if (!bFilamentWaitingFlag || lcd_draw_update) 262e0: 80 91 81 06 lds r24, 0x0681 ; 0x800681 262e4: 88 23 and r24, r24 262e6: 21 f0 breq .+8 ; 0x262f0 262e8: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 262ec: 88 23 and r24, r24 262ee: a1 f1 breq .+104 ; 0x26358 // 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; 262f0: 81 e0 ldi r24, 0x01 ; 1 262f2: 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; 262f6: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b lcd_clear(); 262fa: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_puts_at_P(0,3, PSTR(">")); 262fe: 41 e0 ldi r20, 0x01 ; 1 26300: 56 e9 ldi r21, 0x96 ; 150 26302: 63 e0 ldi r22, 0x03 ; 3 26304: 80 e0 ldi r24, 0x00 ; 0 26306: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_puts_at_P(1, 3, _T(MSG_CANCEL)); 2630a: 85 ee ldi r24, 0xE5 ; 229 2630c: 9d e4 ldi r25, 0x4D ; 77 2630e: 0e 94 a7 6c call 0xd94e ; 0xd94e 26312: ac 01 movw r20, r24 26314: 63 e0 ldi r22, 0x03 ; 3 26316: 81 e0 ldi r24, 0x01 ; 1 26318: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_set_cursor(0, 1); 2631c: 61 e0 ldi r22, 0x01 ; 1 2631e: 80 e0 ldi r24, 0x00 ; 0 26320: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 switch (eFilamentAction) 26324: e0 91 62 03 lds r30, 0x0362 ; 0x800362 26328: e1 50 subi r30, 0x01 ; 1 2632a: e8 30 cpi r30, 0x08 ; 8 2632c: a8 f4 brcc .+42 ; 0x26358 2632e: f0 e0 ldi r31, 0x00 ; 0 26330: 88 27 eor r24, r24 26332: e2 56 subi r30, 0x62 ; 98 26334: fe 4c sbci r31, 0xCE ; 206 26336: 8e 4f sbci r24, 0xFE ; 254 26338: 0d 94 ab a1 jmp 0x34356 ; 0x34356 <__tablejump2__> 2633c: d1 37 cpi r29, 0x71 ; 113 2633e: d1 37 cpi r29, 0x71 ; 113 26340: 9b 37 cpi r25, 0x7B ; 123 26342: d1 37 cpi r29, 0x71 ; 113 26344: 9b 37 cpi r25, 0x7B ; 123 26346: 47 38 cpi r20, 0x87 ; 135 26348: 2f 38 cpi r18, 0x8F ; 143 2634a: d1 37 cpi r29, 0x71 ; 113 { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_PREHEATING_TO_LOAD)); 2634c: 8f e3 ldi r24, 0x3F ; 63 2634e: 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)); 26350: 0e 94 a7 6c call 0xd94e ; 0xd94e 26354: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 // handled earlier break; } } if (bFilamentWaitingFlag) { 26358: 80 91 81 06 lds r24, 0x0681 ; 0x800681 2635c: 81 11 cpse r24, r1 lcd_print_target_temps_first_line(); 2635e: 0f 94 37 07 call 0x20e6e ; 0x20e6e } if (lcd_clicked()) 26362: 0e 94 8e 6b call 0xd71c ; 0xd71c 26366: 88 23 and r24, r24 26368: 09 f4 brne .+2 ; 0x2636c 2636a: 2a cf rjmp .-428 ; 0x261c0 { // Filament action canceled while preheating bFilamentWaitingFlag = false; 2636c: 10 92 81 06 sts 0x0681, r1 ; 0x800681 if (!bFilamentPreheatState) 26370: 80 91 82 06 lds r24, 0x0682 ; 0x800682 26374: 81 11 cpse r24, r1 26376: 0e c0 rjmp .+28 ; 0x26394 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 26378: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 2637c: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 { setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); 26380: 0e 94 b3 60 call 0xc166 ; 0xc166 26384: 81 11 cpse r24, r1 26386: 04 c0 rjmp .+8 ; 0x26390 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 26388: 10 92 ee 11 sts 0x11EE, r1 ; 0x8011ee 2638c: 10 92 ed 11 sts 0x11ED, r1 ; 0x8011ed menu_back(); 26390: 0f 94 43 96 call 0x32c86 ; 0x32c86 } menu_back(); 26394: 0f 94 43 96 call 0x32c86 ; 0x32c86 clearFilamentAction(); } } } 26398: df 91 pop r29 2639a: cf 91 pop r28 2639c: 1f 91 pop r17 2639e: 0f 91 pop r16 setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); menu_back(); } menu_back(); clearFilamentAction(); 263a0: 0d 94 91 0c jmp 0x21922 ; 0x21922 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)); 263a4: 88 e2 ldi r24, 0x28 ; 40 263a6: 9a e4 ldi r25, 0x4A ; 74 263a8: d3 cf rjmp .-90 ; 0x26350 break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); 263aa: 82 e1 ldi r24, 0x12 ; 18 263ac: 9a e4 ldi r25, 0x4A ; 74 263ae: d0 cf rjmp .-96 ; 0x26350 break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 263b0: 8e ef ldi r24, 0xFE ; 254 263b2: 99 e4 ldi r25, 0x49 ; 73 263b4: cd cf rjmp .-102 ; 0x26350 000263b6 : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 263b6: 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) ); 263ba: 40 91 94 12 lds r20, 0x1294 ; 0x801294 263be: 20 91 f1 11 lds r18, 0x11F1 ; 0x8011f1 263c2: 30 91 f2 11 lds r19, 0x11F2 ; 0x8011f2 263c6: 41 30 cpi r20, 0x01 ; 1 263c8: 59 f0 breq .+22 ; 0x263e0 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() 263ca: 10 92 83 06 sts 0x0683, r1 ; 0x800683 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { 263ce: 80 91 57 02 lds r24, 0x0257 ; 0x800257 263d2: 90 91 58 02 lds r25, 0x0258 ; 0x800258 263d6: 28 17 cp r18, r24 263d8: 39 07 cpc r19, r25 263da: 5c f4 brge .+22 ; 0x263f2 bFilamentPreheatState = true; mFilamentItem(target_temperature[0], target_temperature_bed); bFilamentSkipPreheat = false; // Reset flag } else { lcd_generic_preheat_menu(); 263dc: 0d 94 94 0c jmp 0x21928 ; 0x21928 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() 263e0: 90 91 6a 12 lds r25, 0x126A ; 0x80126a 263e4: 91 11 cpse r25, r1 263e6: f1 cf rjmp .-30 ; 0x263ca && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); 263e8: 86 50 subi r24, 0x06 ; 6 263ea: 82 30 cpi r24, 0x02 ; 2 263ec: 70 f7 brcc .-36 ; 0x263ca 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() 263ee: 40 93 83 06 sts 0x0683, r20 ; 0x800683 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { bFilamentPreheatState = true; 263f2: 81 e0 ldi r24, 0x01 ; 1 263f4: 80 93 82 06 sts 0x0682, r24 ; 0x800682 mFilamentItem(target_temperature[0], target_temperature_bed); 263f8: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 263fc: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee 26400: c9 01 movw r24, r18 26402: 0f 94 c1 30 call 0x26182 ; 0x26182 bFilamentSkipPreheat = false; // Reset flag 26406: 10 92 83 06 sts 0x0683, r1 ; 0x800683 } else { lcd_generic_preheat_menu(); } } 2640a: 08 95 ret 0002640c : { preheat_or_continue(FilamentAction::Load); } void lcd_AutoLoadFilament() { preheat_or_continue(FilamentAction::AutoLoad); 2640c: 82 e0 ldi r24, 0x02 ; 2 2640e: 0d 94 db 31 jmp 0x263b6 ; 0x263b6 00026412 : } } static void lcd_LoadFilament() { preheat_or_continue(FilamentAction::Load); 26412: 81 e0 ldi r24, 0x01 ; 1 26414: 0d 94 db 31 jmp 0x263b6 ; 0x263b6 00026418 : MENU_END(); } static void lcd_unLoadFilament() { preheat_or_continue(FilamentAction::UnLoad); 26418: 83 e0 ldi r24, 0x03 ; 3 2641a: 0d 94 db 31 jmp 0x263b6 ; 0x263b6 0002641e : } } static void mFilamentItem_farm() { bFilamentPreheatState = false; 2641e: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, FARM_PREHEAT_HPB_TEMP); 26422: 60 e5 ldi r22, 0x50 ; 80 26424: 70 e0 ldi r23, 0x00 ; 0 26426: 8a ef ldi r24, 0xFA ; 250 26428: 90 e0 ldi r25, 0x00 ; 0 2642a: 0d 94 c1 30 jmp 0x26182 ; 0x26182 0002642e : } static void mFilamentItem_farm_nozzle() { bFilamentPreheatState = false; 2642e: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, 0); 26432: 70 e0 ldi r23, 0x00 ; 0 26434: 60 e0 ldi r22, 0x00 ; 0 26436: 8a ef ldi r24, 0xFA ; 250 26438: 90 e0 ldi r25, 0x00 ; 0 2643a: 0d 94 c1 30 jmp 0x26182 ; 0x26182 0002643e : } static void mFilamentItem_PLA() { bFilamentPreheatState = false; 2643e: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PLA_PREHEAT_HOTEND_TEMP, PLA_PREHEAT_HPB_TEMP); 26442: 6c e3 ldi r22, 0x3C ; 60 26444: 70 e0 ldi r23, 0x00 ; 0 26446: 87 ed ldi r24, 0xD7 ; 215 26448: 90 e0 ldi r25, 0x00 ; 0 2644a: 0d 94 c1 30 jmp 0x26182 ; 0x26182 0002644e : } static void mFilamentItem_PET() { bFilamentPreheatState = false; 2644e: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PET_PREHEAT_HOTEND_TEMP, PET_PREHEAT_HPB_TEMP); 26452: 65 e5 ldi r22, 0x55 ; 85 26454: 70 e0 ldi r23, 0x00 ; 0 26456: 86 ee ldi r24, 0xE6 ; 230 26458: 90 e0 ldi r25, 0x00 ; 0 2645a: 0d 94 c1 30 jmp 0x26182 ; 0x26182 0002645e : } static void mFilamentItem_ASA() { bFilamentPreheatState = false; 2645e: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(ASA_PREHEAT_HOTEND_TEMP, ASA_PREHEAT_HPB_TEMP); 26462: 69 e6 ldi r22, 0x69 ; 105 26464: 70 e0 ldi r23, 0x00 ; 0 26466: 84 e0 ldi r24, 0x04 ; 4 26468: 91 e0 ldi r25, 0x01 ; 1 2646a: 0d 94 c1 30 jmp 0x26182 ; 0x26182 0002646e : } static void mFilamentItem_PC() { bFilamentPreheatState = false; 2646e: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); 26472: 69 e6 ldi r22, 0x69 ; 105 26474: 70 e0 ldi r23, 0x00 ; 0 26476: 83 e1 ldi r24, 0x13 ; 19 26478: 91 e0 ldi r25, 0x01 ; 1 2647a: 0d 94 c1 30 jmp 0x26182 ; 0x26182 0002647e : mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); } static void mFilamentItem_PVB() { bFilamentPreheatState = false; 2647e: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); 26482: 6b e4 ldi r22, 0x4B ; 75 26484: 70 e0 ldi r23, 0x00 ; 0 26486: 87 ed ldi r24, 0xD7 ; 215 26488: 90 e0 ldi r25, 0x00 ; 0 2648a: 0d 94 c1 30 jmp 0x26182 ; 0x26182 0002648e : mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); } static void mFilamentItem_PA() { bFilamentPreheatState = false; 2648e: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); 26492: 6a e5 ldi r22, 0x5A ; 90 26494: 70 e0 ldi r23, 0x00 ; 0 26496: 83 e1 ldi r24, 0x13 ; 19 26498: 91 e0 ldi r25, 0x01 ; 1 2649a: 0d 94 c1 30 jmp 0x26182 ; 0x26182 0002649e : mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); } static void mFilamentItem_ABS() { bFilamentPreheatState = false; 2649e: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); 264a2: 64 e6 ldi r22, 0x64 ; 100 264a4: 70 e0 ldi r23, 0x00 ; 0 264a6: 8f ef ldi r24, 0xFF ; 255 264a8: 90 e0 ldi r25, 0x00 ; 0 264aa: 0d 94 c1 30 jmp 0x26182 ; 0x26182 000264ae : mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); } static void mFilamentItem_HIPS() { bFilamentPreheatState = false; 264ae: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(HIPS_PREHEAT_HOTEND_TEMP, HIPS_PREHEAT_HPB_TEMP); 264b2: 64 e6 ldi r22, 0x64 ; 100 264b4: 70 e0 ldi r23, 0x00 ; 0 264b6: 8c ed ldi r24, 0xDC ; 220 264b8: 90 e0 ldi r25, 0x00 ; 0 264ba: 0d 94 c1 30 jmp 0x26182 ; 0x26182 000264be : } static void mFilamentItem_PP() { bFilamentPreheatState = false; 264be: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(PP_PREHEAT_HOTEND_TEMP, PP_PREHEAT_HPB_TEMP); 264c2: 64 e6 ldi r22, 0x64 ; 100 264c4: 70 e0 ldi r23, 0x00 ; 0 264c6: 8e ef ldi r24, 0xFE ; 254 264c8: 90 e0 ldi r25, 0x00 ; 0 264ca: 0d 94 c1 30 jmp 0x26182 ; 0x26182 000264ce : } static void mFilamentItem_FLEX() { bFilamentPreheatState = false; 264ce: 10 92 82 06 sts 0x0682, r1 ; 0x800682 mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); 264d2: 62 e3 ldi r22, 0x32 ; 50 264d4: 70 e0 ldi r23, 0x00 ; 0 264d6: 80 ef ldi r24, 0xF0 ; 240 264d8: 90 e0 ldi r25, 0x00 ; 0 264da: 0d 94 c1 30 jmp 0x26182 ; 0x26182 000264de : } 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){ 264de: cf 92 push r12 264e0: df 92 push r13 264e2: ef 92 push r14 264e4: ff 92 push r15 if (critical || eSoundMode != e_SOUND_MODE_SILENT) { 264e6: 41 11 cpse r20, r1 264e8: 04 c0 rjmp .+8 ; 0x264f2 264ea: 20 91 15 04 lds r18, 0x0415 ; 0x800415 264ee: 22 30 cpi r18, 0x02 ; 2 264f0: d1 f0 breq .+52 ; 0x26526 264f2: 9b 01 movw r18, r22 264f4: 6c 01 movw r12, r24 264f6: f1 2c mov r15, r1 264f8: e1 2c mov r14, r1 if(!tone_) { 264fa: 67 2b or r22, r23 264fc: c9 f4 brne .+50 ; 0x26530 WRITE(BEEPER, HIGH); 264fe: 9f b7 in r25, 0x3f ; 63 26500: f8 94 cli 26502: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 26506: 84 60 ori r24, 0x04 ; 4 26508: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2650c: 9f bf out 0x3f, r25 ; 63 _delay(ms); 2650e: c7 01 movw r24, r14 26510: b6 01 movw r22, r12 26512: 0f 94 03 0e call 0x21c06 ; 0x21c06 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); 26516: 9f b7 in r25, 0x3f ; 63 26518: f8 94 cli 2651a: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2651e: 8b 7f andi r24, 0xFB ; 251 26520: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 26524: 9f bf out 0x3f, r25 ; 63 _tone(BEEPER, tone_); _delay(ms); _noTone(BEEPER); } } } 26526: ff 90 pop r15 26528: ef 90 pop r14 2652a: df 90 pop r13 2652c: cf 90 pop r12 2652e: 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); 26530: 22 0f add r18, r18 26532: 33 1f adc r19, r19 26534: 50 e0 ldi r21, 0x00 ; 0 26536: 40 e0 ldi r20, 0x00 ; 0 26538: 60 e0 ldi r22, 0x00 ; 0 2653a: 74 e2 ldi r23, 0x24 ; 36 2653c: 84 ef ldi r24, 0xF4 ; 244 2653e: 90 e0 ldi r25, 0x00 ; 0 26540: 0f 94 8c a1 call 0x34318 ; 0x34318 <__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; 26544: 91 e0 ldi r25, 0x01 ; 1 uint32_t pwm_freq = F_CPU / (2 * frequency); if (pwm_freq > UINT16_MAX) { 26546: 21 15 cp r18, r1 26548: 31 05 cpc r19, r1 2654a: 81 e0 ldi r24, 0x01 ; 1 2654c: 48 07 cpc r20, r24 2654e: 51 05 cpc r21, r1 26550: 44 f0 brlt .+16 ; 0x26562 pwm_freq /= 64; // Increase prescaler to 64 26552: 86 e0 ldi r24, 0x06 ; 6 26554: 56 95 lsr r21 26556: 47 95 ror r20 26558: 37 95 ror r19 2655a: 27 95 ror r18 2655c: 8a 95 dec r24 2655e: d1 f7 brne .-12 ; 0x26554 prescalarbits = 0b011; 26560: 93 e0 ldi r25, 0x03 ; 3 } uint16_t ocr = pwm_freq - 1; 26562: 21 50 subi r18, 0x01 ; 1 26564: 31 09 sbc r19, r1 CRITICAL_SECTION_START; 26566: 4f b7 in r20, 0x3f ; 63 26568: f8 94 cli // Set calcualted prescaler TCCR4B = (TCCR4B & 0b11111000) | prescalarbits; 2656a: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 2656e: 88 7f andi r24, 0xF8 ; 248 26570: 89 2b or r24, r25 26572: 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); 26576: 60 91 ac 00 lds r22, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 2657a: 70 91 ad 00 lds r23, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2657e: 26 9f mul r18, r22 26580: c0 01 movw r24, r0 26582: 27 9f mul r18, r23 26584: 90 0d add r25, r0 26586: 36 9f mul r19, r22 26588: 90 0d add r25, r0 2658a: 11 24 eor r1, r1 2658c: 50 91 72 00 lds r21, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 26590: 6f ef ldi r22, 0xFF ; 255 26592: 70 e0 ldi r23, 0x00 ; 0 26594: 51 ff sbrs r21, 1 26596: 04 c0 rjmp .+8 ; 0x265a0 26598: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 2659c: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 265a0: 0f 94 64 a1 call 0x342c8 ; 0x342c8 <__udivmodhi4> 265a4: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 265a8: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN // Set calcualted ocr OCR4A = ocr; 265ac: 30 93 a9 00 sts 0x00A9, r19 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 265b0: 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); 265b4: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 265b8: 83 60 ori r24, 0x03 ; 3 265ba: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 265be: 4f bf out 0x3f, r20 ; 63 WRITE(BEEPER, HIGH); _delay(ms); WRITE(BEEPER, LOW); } else { _tone(BEEPER, tone_); _delay(ms); 265c0: c7 01 movw r24, r14 265c2: b6 01 movw r22, r12 265c4: 0f 94 03 0e call 0x21c06 ; 0x21c06 } void noTone4(_UNUSED uint8_t _pin) { CRITICAL_SECTION_START; 265c8: 2f b7 in r18, 0x3f ; 63 265ca: f8 94 cli // Revert prescaler to CLK/1024 TCCR4B = (TCCR4B & 0b11111000) | _BV(CS42) | _BV(CS40); 265cc: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 265d0: 88 7f andi r24, 0xF8 ; 248 265d2: 85 60 ori r24, 0x05 ; 5 265d4: 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); 265d8: 40 91 ac 00 lds r20, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 265dc: 50 91 ad 00 lds r21, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 265e0: 3f ef ldi r19, 0xFF ; 255 265e2: 34 9f mul r19, r20 265e4: c0 01 movw r24, r0 265e6: 35 9f mul r19, r21 265e8: 90 0d add r25, r0 265ea: 11 24 eor r1, r1 265ec: 30 91 72 00 lds r19, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 265f0: 6f ef ldi r22, 0xFF ; 255 265f2: 70 e0 ldi r23, 0x00 ; 0 265f4: 31 ff sbrs r19, 1 265f6: 04 c0 rjmp .+8 ; 0x26600 265f8: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 265fc: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 26600: 0f 94 64 a1 call 0x342c8 ; 0x342c8 <__udivmodhi4> 26604: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 26608: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN OCR4A = 255U; 2660c: 8f ef ldi r24, 0xFF ; 255 2660e: 90 e0 ldi r25, 0x00 ; 0 26610: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 26614: 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)); 26618: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2661c: 8c 7f andi r24, 0xFC ; 252 2661e: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 26622: 2f bf out 0x3f, r18 ; 63 26624: 78 cf rjmp .-272 ; 0x26516 00026626 : } void handle_temp_error(); void manage_heater() { 26626: cf 92 push r12 26628: df 92 push r13 2662a: ef 92 push r14 2662c: ff 92 push r15 2662e: 0f 93 push r16 26630: 1f 93 push r17 26632: cf 93 push r28 26634: df 93 push r29 26636: 1f 92 push r1 26638: 1f 92 push r1 2663a: cd b7 in r28, 0x3d ; 61 2663c: de b7 in r29, 0x3e ; 62 #ifdef WATCHDOG wdt_reset(); 2663e: 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) 26640: 80 91 42 06 lds r24, 0x0642 ; 0x800642 26644: 88 23 and r24, r24 26646: 09 f4 brne .+2 ; 0x2664a 26648: 29 c2 rjmp .+1106 ; 0x26a9c return; // syncronize temperatures with isr updateTemperatures(); 2664a: 0e 94 26 fb call 0x1f64c ; 0x1f64c if(thermal_model::warning_state.warning) thermal_model::handle_warning(); #endif // handle temperature errors if(temp_error_state.v) 2664e: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 26652: 88 23 and r24, r24 26654: 89 f1 breq .+98 ; 0x266b8 #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 26656: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 2665a: 82 95 swap r24 2665c: 86 95 lsr r24 2665e: 87 70 andi r24, 0x07 ; 7 26660: 81 30 cpi r24, 0x01 ; 1 26662: 01 f1 breq .+64 ; 0x266a4 26664: 08 f4 brcc .+2 ; 0x26668 26666: be c1 rjmp .+892 ; 0x269e4 26668: 84 30 cpi r24, 0x04 ; 4 2666a: 30 f5 brcc .+76 ; 0x266b8 #endif } break; case TempErrorType::preheat: case TempErrorType::runaway: switch((TempErrorSource)temp_error_state.source) { 2666c: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 26670: 86 95 lsr r24 26672: 86 95 lsr r24 26674: 83 70 andi r24, 0x03 ; 3 26676: 82 30 cpi r24, 0x02 ; 2 26678: f8 f4 brcc .+62 ; 0x266b8 case TempErrorSource::hotend: case TempErrorSource::bed: temp_runaway_stop( ((TempErrorType)temp_error_state.type == TempErrorType::preheat), ((TempErrorSource)temp_error_state.source == TempErrorSource::bed)); 2667a: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 2667e: 86 95 lsr r24 26680: 86 95 lsr r24 26682: 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), 26684: 90 91 9a 03 lds r25, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 26688: 92 95 swap r25 2668a: 96 95 lsr r25 2668c: 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( 2668e: 61 e0 ldi r22, 0x01 ; 1 26690: 81 30 cpi r24, 0x01 ; 1 26692: 09 f0 breq .+2 ; 0x26696 26694: 60 e0 ldi r22, 0x00 ; 0 26696: 81 e0 ldi r24, 0x01 ; 1 26698: 92 30 cpi r25, 0x02 ; 2 2669a: 09 f0 breq .+2 ; 0x2669e 2669c: 80 e0 ldi r24, 0x00 ; 0 2669e: 0f 94 cb 09 call 0x21396 ; 0x21396 266a2: 0a c0 rjmp .+20 ; 0x266b8 void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { case TempErrorType::min: switch((TempErrorSource)temp_error_state.source) { 266a4: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 266a8: 86 95 lsr r24 266aa: 86 95 lsr r24 266ac: 83 70 andi r24, 0x03 ; 3 266ae: 09 f4 brne .+2 ; 0x266b2 266b0: 4b c1 rjmp .+662 ; 0x26948 266b2: 81 30 cpi r24, 0x01 ; 1 266b4: 09 f4 brne .+2 ; 0x266b8 266b6: 79 c1 rjmp .+754 ; 0x269aa #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)) { 266b8: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 266bc: 00 91 8d 16 lds r16, 0x168D ; 0x80168d 266c0: 10 91 8e 16 lds r17, 0x168E ; 0x80168e 266c4: 20 91 8f 16 lds r18, 0x168F ; 0x80168f 266c8: 30 91 90 16 lds r19, 0x1690 ; 0x801690 266cc: 60 1b sub r22, r16 266ce: 71 0b sbc r23, r17 266d0: 82 0b sbc r24, r18 266d2: 93 0b sbc r25, r19 266d4: 69 38 cpi r22, 0x89 ; 137 266d6: 73 41 sbci r23, 0x13 ; 19 266d8: 81 05 cpc r24, r1 266da: 91 05 cpc r25, r1 266dc: d0 f0 brcs .+52 ; 0x26712 266de: 80 91 84 03 lds r24, 0x0384 ; 0x800384 266e2: 81 11 cpse r24, r1 266e4: 16 c0 rjmp .+44 ; 0x26712 extruder_autofan_last_check = _millis(); 266e6: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 266ea: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d 266ee: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e 266f2: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f 266f6: 90 93 90 16 sts 0x1690, r25 ; 0x801690 fanSpeedBckp = fanSpeedSoftPwm; 266fa: 80 91 05 05 lds r24, 0x0505 ; 0x800505 266fe: 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 26702: 8b 34 cpi r24, 0x4B ; 75 26704: 18 f0 brcs .+6 ; 0x2670c // printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = 255; 26706: 8f ef ldi r24, 0xFF ; 255 26708: 80 93 05 05 sts 0x0505, r24 ; 0x800505 } fan_measuring = true; 2670c: 81 e0 ldi r24, 0x01 ; 1 2670e: 80 93 84 03 sts 0x0384, r24 ; 0x800384 } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { 26712: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 26716: 00 91 8d 16 lds r16, 0x168D ; 0x80168d 2671a: 10 91 8e 16 lds r17, 0x168E ; 0x80168e 2671e: 20 91 8f 16 lds r18, 0x168F ; 0x80168f 26722: 30 91 90 16 lds r19, 0x1690 ; 0x801690 26726: 60 1b sub r22, r16 26728: 71 0b sbc r23, r17 2672a: 82 0b sbc r24, r18 2672c: 93 0b sbc r25, r19 2672e: 65 36 cpi r22, 0x65 ; 101 26730: 71 05 cpc r23, r1 26732: 81 05 cpc r24, r1 26734: 91 05 cpc r25, r1 26736: 08 f4 brcc .+2 ; 0x2673a 26738: a5 c1 rjmp .+842 ; 0x26a84 2673a: 80 91 84 03 lds r24, 0x0384 ; 0x800384 2673e: 88 23 and r24, r24 26740: 09 f4 brne .+2 ; 0x26744 26742: a0 c1 rjmp .+832 ; 0x26a84 #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))); 26744: 60 91 22 06 lds r22, 0x0622 ; 0x800622 26748: 70 91 23 06 lds r23, 0x0623 ; 0x800623 2674c: 07 2e mov r0, r23 2674e: 00 0c add r0, r0 26750: 88 0b sbc r24, r24 26752: 99 0b sbc r25, r25 26754: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 26758: 6b 01 movw r12, r22 2675a: 7c 01 movw r14, r24 2675c: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 26760: 00 91 8d 16 lds r16, 0x168D ; 0x80168d 26764: 10 91 8e 16 lds r17, 0x168E ; 0x80168e 26768: 20 91 8f 16 lds r18, 0x168F ; 0x80168f 2676c: 30 91 90 16 lds r19, 0x1690 ; 0x801690 26770: 60 1b sub r22, r16 26772: 71 0b sbc r23, r17 26774: 82 0b sbc r24, r18 26776: 93 0b sbc r25, r19 26778: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 2677c: 9b 01 movw r18, r22 2677e: ac 01 movw r20, r24 26780: 60 e0 ldi r22, 0x00 ; 0 26782: 70 e0 ldi r23, 0x00 ; 0 26784: 8a e7 ldi r24, 0x7A ; 122 26786: 93 e4 ldi r25, 0x43 ; 67 26788: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2678c: a7 01 movw r20, r14 2678e: 96 01 movw r18, r12 26790: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 26794: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 26798: 70 93 86 03 sts 0x0386, r23 ; 0x800386 2679c: 60 93 85 03 sts 0x0385, r22 ; 0x800385 fan_speed[1] = (fan_edge_counter[1] * (float(250) / (_millis() - extruder_autofan_last_check))); 267a0: 60 91 24 06 lds r22, 0x0624 ; 0x800624 267a4: 70 91 25 06 lds r23, 0x0625 ; 0x800625 267a8: 07 2e mov r0, r23 267aa: 00 0c add r0, r0 267ac: 88 0b sbc r24, r24 267ae: 99 0b sbc r25, r25 267b0: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 267b4: 6b 01 movw r12, r22 267b6: 7c 01 movw r14, r24 267b8: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 267bc: 00 91 8d 16 lds r16, 0x168D ; 0x80168d 267c0: 10 91 8e 16 lds r17, 0x168E ; 0x80168e 267c4: 20 91 8f 16 lds r18, 0x168F ; 0x80168f 267c8: 30 91 90 16 lds r19, 0x1690 ; 0x801690 267cc: 60 1b sub r22, r16 267ce: 71 0b sbc r23, r17 267d0: 82 0b sbc r24, r18 267d2: 93 0b sbc r25, r19 267d4: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 267d8: 9b 01 movw r18, r22 267da: ac 01 movw r20, r24 267dc: 60 e0 ldi r22, 0x00 ; 0 267de: 70 e0 ldi r23, 0x00 ; 0 267e0: 8a e7 ldi r24, 0x7A ; 122 267e2: 93 e4 ldi r25, 0x43 ; 67 267e4: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 267e8: a7 01 movw r20, r14 267ea: 96 01 movw r18, r12 267ec: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 267f0: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 267f4: 70 93 88 03 sts 0x0388, r23 ; 0x800388 267f8: 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; 267fc: 10 92 23 06 sts 0x0623, r1 ; 0x800623 26800: 10 92 22 06 sts 0x0622, r1 ; 0x800622 fan_edge_counter[1] = 0; 26804: 10 92 25 06 sts 0x0625, r1 ; 0x800625 26808: 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) 2680c: 83 e0 ldi r24, 0x03 ; 3 2680e: 8a 83 std Y+2, r24 ; 0x02 max_fan_errors[0] = 2; // 10 seconds (Hotend fan) 26810: 82 e0 ldi r24, 0x02 ; 2 26812: 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) 26814: 80 91 40 02 lds r24, 0x0240 ; 0x800240 26818: 88 23 and r24, r24 2681a: 51 f0 breq .+20 ; 0x26830 fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0); 2681c: 87 e8 ldi r24, 0x87 ; 135 2681e: 9f e0 ldi r25, 0x0F ; 15 26820: 0f 94 9b a0 call 0x34136 ; 0x34136 26824: 91 e0 ldi r25, 0x01 ; 1 26826: 81 11 cpse r24, r1 26828: 01 c0 rjmp .+2 ; 0x2682c 2682a: 90 e0 ldi r25, 0x00 ; 0 2682c: 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]++;} 26830: 80 91 85 03 lds r24, 0x0385 ; 0x800385 26834: 90 91 86 03 lds r25, 0x0386 ; 0x800386 26838: 44 97 sbiw r24, 0x14 ; 20 2683a: 0c f0 brlt .+2 ; 0x2683e 2683c: f2 c0 rjmp .+484 ; 0x26a22 2683e: 20 e0 ldi r18, 0x00 ; 0 26840: 30 e0 ldi r19, 0x00 ; 0 26842: 48 e4 ldi r20, 0x48 ; 72 26844: 52 e4 ldi r21, 0x42 ; 66 26846: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 2684a: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 2684e: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 26852: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 26856: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 2685a: 18 16 cp r1, r24 2685c: 0c f0 brlt .+2 ; 0x26860 2685e: e1 c0 rjmp .+450 ; 0x26a22 26860: 80 91 ed 05 lds r24, 0x05ED ; 0x8005ed 26864: 8f 5f subi r24, 0xFF ; 255 26866: 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){ 2686a: 80 91 ed 05 lds r24, 0x05ED ; 0x8005ed 2686e: 81 11 cpse r24, r1 26870: 0b c0 rjmp .+22 ; 0x26888 26872: 80 91 ee 05 lds r24, 0x05EE ; 0x8005ee 26876: 81 11 cpse r24, r1 26878: 07 c0 rjmp .+14 ; 0x26888 2687a: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 2687e: 82 30 cpi r24, 0x02 ; 2 26880: 19 f4 brne .+6 ; 0x26888 // we may even send some info to the LCD from here fan_check_error = EFCE_FIXED; 26882: 81 e0 ldi r24, 0x01 ; 1 26884: 80 93 9c 03 sts 0x039C, r24 ; 0x80039c } if ((fan_check_error == EFCE_FIXED) && !printer_active()){ 26888: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 2688c: 81 30 cpi r24, 0x01 ; 1 2688e: 61 f4 brne .+24 ; 0x268a8 26890: 0e 94 0f 61 call 0xc21e ; 0xc21e 26894: 81 11 cpse r24, r1 26896: 08 c0 rjmp .+16 ; 0x268a8 fan_check_error = EFCE_OK; //if the issue is fixed while the printer is doing nothing, reenable processing immediately. 26898: 10 92 9c 03 sts 0x039C, r1 ; 0x80039c lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 2689c: 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 268a0: 87 e6 ldi r24, 0x67 ; 103 268a2: 9b e6 ldi r25, 0x6B ; 107 268a4: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 } if (fans_check_enabled && (fan_check_error != EFCE_REPORTED)) 268a8: 80 91 40 02 lds r24, 0x0240 ; 0x800240 268ac: 88 23 and r24, r24 268ae: 09 f4 brne .+2 ; 0x268b2 268b0: d9 c0 rjmp .+434 ; 0x26a64 268b2: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 268b6: 82 30 cpi r24, 0x02 ; 2 268b8: 09 f4 brne .+2 ; 0x268bc 268ba: d4 c0 rjmp .+424 ; 0x26a64 268bc: 8d ee ldi r24, 0xED ; 237 268be: e8 2e mov r14, r24 268c0: 85 e0 ldi r24, 0x05 ; 5 268c2: f8 2e mov r15, r24 268c4: ce 01 movw r24, r28 268c6: 01 96 adiw r24, 0x01 ; 1 268c8: 6c 01 movw r12, r24 { for (uint8_t fan = 0; fan < 2; fan++) 268ca: 10 e0 ldi r17, 0x00 ; 0 } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; fan_check_error = EFCE_REPORTED; 268cc: 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]) 268ce: f7 01 movw r30, r14 268d0: 91 91 ld r25, Z+ 268d2: 7f 01 movw r14, r30 268d4: f6 01 movw r30, r12 268d6: 81 91 ld r24, Z+ 268d8: 6f 01 movw r12, r30 268da: 89 17 cp r24, r25 268dc: 80 f5 brcc .+96 ; 0x2693e { fan_speed_errors[fan] = 0; 268de: f7 01 movw r30, r14 268e0: 31 97 sbiw r30, 0x01 ; 1 268e2: 10 82 st Z, r1 LCD_ALERTMESSAGERPGM(lcdMsg); } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; 268e4: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 268e8: 82 30 cpi r24, 0x02 ; 2 268ea: 49 f1 breq .+82 ; 0x2693e fan_check_error = EFCE_REPORTED; 268ec: 00 93 9c 03 sts 0x039C, r16 ; 0x80039c if (printJobOngoing()) { 268f0: 0e 94 be 60 call 0xc17c ; 0xc17c 268f4: 88 23 and r24, r24 268f6: 09 f4 brne .+2 ; 0x268fa 268f8: 9a c0 rjmp .+308 ; 0x26a2e // A print is ongoing, pause the print normally if(!printingIsPaused()) { 268fa: 0e 94 b3 60 call 0xc166 ; 0xc166 268fe: 81 11 cpse r24, r1 26900: 07 c0 rjmp .+14 ; 0x26910 if (usb_timer.running()) 26902: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 26906: 88 23 and r24, r24 26908: 09 f4 brne .+2 ; 0x2690c 2690a: 8e c0 rjmp .+284 ; 0x26a28 lcd_pause_usb_print(); 2690c: 0f 94 7f 04 call 0x208fe ; 0x208fe else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; } switch (_fan) { 26910: 11 30 cpi r17, 0x01 ; 1 26912: 09 f4 brne .+2 ; 0x26916 26914: 93 c0 rjmp .+294 ; 0x26a3c //! 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); 26916: 85 e2 ldi r24, 0x25 ; 37 26918: 92 e9 ldi r25, 0x92 ; 146 2691a: 0e 94 49 72 call 0xe492 ; 0xe492 if (get_message_level() == 0) { 2691e: 80 91 8e 03 lds r24, 0x038E ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.408> 26922: 81 11 cpse r24, r1 26924: 0c c0 rjmp .+24 ; 0x2693e Sound_MakeCustom(200,0,true); 26926: 41 e0 ldi r20, 0x01 ; 1 26928: 70 e0 ldi r23, 0x00 ; 0 2692a: 60 e0 ldi r22, 0x00 ; 0 2692c: 88 ec ldi r24, 0xC8 ; 200 2692e: 90 e0 ldi r25, 0x00 ; 0 26930: 0f 94 6f 32 call 0x264de ; 0x264de LCD_ALERTMESSAGERPGM(lcdMsg); 26934: 62 e0 ldi r22, 0x02 ; 2 26936: 87 e6 ldi r24, 0x67 ; 103 26938: 97 e6 ldi r25, 0x67 ; 103 2693a: 0e 94 35 e2 call 0x1c46a ; 0x1c46a 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++) 2693e: 11 30 cpi r17, 0x01 ; 1 26940: 09 f4 brne .+2 ; 0x26944 26942: 90 c0 rjmp .+288 ; 0x26a64 26944: 11 e0 ldi r17, 0x01 ; 1 26946: c3 cf rjmp .-122 ; 0x268ce case TempErrorSource::hotend: if(temp_error_state.assert) { 26948: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 2694c: 81 ff sbrs r24, 1 2694e: 12 c0 rjmp .+36 ; 0x26974 min_temp_error(temp_error_state.index); 26950: 60 91 9a 03 lds r22, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 26954: 62 95 swap r22 26956: 61 70 andi r22, 0x01 ; 1 #endif } static void min_temp_error(uint8_t e) { static const char err[] PROGMEM = "MINTEMP"; if(IsStopped() == false) { 26958: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 2695c: 81 11 cpse r24, r1 2695e: 07 c0 rjmp .+14 ; 0x2696e temp_error_messagepgm(err, e); 26960: 80 e8 ldi r24, 0x80 ; 128 26962: 92 e9 ldi r25, 0x92 ; 146 26964: 0f 94 37 12 call 0x2246e ; 0x2246e prusa_statistics(92); 26968: 8c e5 ldi r24, 0x5C ; 92 2696a: 0f 94 be 98 call 0x3317c ; 0x3317c } ThermalStop(); 2696e: 0f 94 ed 43 call 0x287da ; 0x287da 26972: a2 ce rjmp .-700 ; 0x266b8 // 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); 26974: 60 91 db 03 lds r22, 0x03DB ; 0x8003db <_ZL8minttemp.lto_priv.424> 26978: 70 91 dc 03 lds r23, 0x03DC ; 0x8003dc <_ZL8minttemp.lto_priv.424+0x1> 2697c: 6b 5f subi r22, 0xFB ; 251 2697e: 7f 4f sbci r23, 0xFF ; 255 26980: 07 2e mov r0, r23 26982: 00 0c add r0, r0 26984: 88 0b sbc r24, r24 26986: 99 0b sbc r25, r25 26988: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2698c: 8b 01 movw r16, r22 2698e: 9c 01 movw r18, r24 26990: 40 91 c4 0d lds r20, 0x0DC4 ; 0x800dc4 26994: 50 91 c5 0d lds r21, 0x0DC5 ; 0x800dc5 26998: 60 91 c6 0d lds r22, 0x0DC6 ; 0x800dc6 2699c: 70 91 c7 0d lds r23, 0x0DC7 ; 0x800dc7 269a0: 8c e6 ldi r24, 0x6C ; 108 269a2: 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); 269a4: 0f 94 92 09 call 0x21324 ; 0x21324 269a8: 87 ce rjmp .-754 ; 0x266b8 // 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) { 269aa: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 269ae: 81 ff sbrs r24, 1 269b0: 0a c0 rjmp .+20 ; 0x269c6 ThermalStop(); } static void bed_min_temp_error(void) { static const char err[] PROGMEM = "MINTEMP BED"; if(IsStopped() == false) { 269b2: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 269b6: 81 11 cpse r24, r1 269b8: da cf rjmp .-76 ; 0x2696e temp_error_messagepgm(err); 269ba: 61 e0 ldi r22, 0x01 ; 1 269bc: 84 e7 ldi r24, 0x74 ; 116 269be: 92 e9 ldi r25, 0x92 ; 146 ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { temp_error_messagepgm(PSTR("MAXTEMP BED")); 269c0: 0f 94 37 12 call 0x2246e ; 0x2246e 269c4: d4 cf rjmp .-88 ; 0x2696e 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); 269c6: 40 91 8a 03 lds r20, 0x038A ; 0x80038a 269ca: 50 91 8b 03 lds r21, 0x038B ; 0x80038b 269ce: 60 91 8c 03 lds r22, 0x038C ; 0x80038c 269d2: 70 91 8d 03 lds r23, 0x038D ; 0x80038d 269d6: 00 e0 ldi r16, 0x00 ; 0 269d8: 10 e0 ldi r17, 0x00 ; 0 269da: 2c e0 ldi r18, 0x0C ; 12 269dc: 32 e4 ldi r19, 0x42 ; 66 269de: 88 e6 ldi r24, 0x68 ; 104 269e0: 92 e0 ldi r25, 0x02 ; 2 269e2: e0 cf rjmp .-64 ; 0x269a4 break; #endif } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { 269e4: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 269e8: 86 95 lsr r24 269ea: 86 95 lsr r24 269ec: 83 70 andi r24, 0x03 ; 3 269ee: 59 f0 breq .+22 ; 0x26a06 269f0: 81 30 cpi r24, 0x01 ; 1 269f2: 09 f0 breq .+2 ; 0x269f6 269f4: 61 ce rjmp .-830 ; 0x266b8 } ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { 269f6: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 269fa: 81 11 cpse r24, r1 269fc: b8 cf rjmp .-144 ; 0x2696e temp_error_messagepgm(PSTR("MAXTEMP BED")); 269fe: 61 e0 ldi r22, 0x01 ; 1 26a00: 80 e9 ldi r24, 0x90 ; 144 26a02: 92 e9 ldi r25, 0x92 ; 146 26a04: dd cf rjmp .-70 ; 0x269c0 } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { case TempErrorSource::hotend: max_temp_error(temp_error_state.index); 26a06: 60 91 9a 03 lds r22, 0x039A ; 0x80039a <_ZL16temp_error_state.lto_priv.422> 26a0a: 62 95 swap r22 26a0c: 61 70 andi r22, 0x01 ; 1 SERIAL_ERRORLNPGM(" triggered!"); } static void max_temp_error(uint8_t e) { if(IsStopped() == false) { 26a0e: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 26a12: 81 11 cpse r24, r1 26a14: ac cf rjmp .-168 ; 0x2696e temp_error_messagepgm(PSTR("MAXTEMP"), e); 26a16: 88 e8 ldi r24, 0x88 ; 136 26a18: 92 e9 ldi r25, 0x92 ; 146 26a1a: 0f 94 37 12 call 0x2246e ; 0x2246e prusa_statistics(93); 26a1e: 8d e5 ldi r24, 0x5D ; 93 26a20: a4 cf rjmp .-184 ; 0x2696a 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; 26a22: 10 92 ed 05 sts 0x05ED, r1 ; 0x8005ed 26a26: 21 cf rjmp .-446 ; 0x2686a // A print is ongoing, pause the print normally if(!printingIsPaused()) { if (usb_timer.running()) lcd_pause_usb_print(); else lcd_pause_print(); 26a28: 0f 94 08 10 call 0x22010 ; 0x22010 26a2c: 71 cf rjmp .-286 ; 0x26910 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 26a2e: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 26a32: 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; 26a36: 10 92 99 03 sts 0x0399, r1 ; 0x800399 26a3a: 6a cf rjmp .-300 ; 0x26910 //! 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); 26a3c: 8d e4 ldi r24, 0x4D ; 77 26a3e: 92 e9 ldi r25, 0x92 ; 146 26a40: 0e 94 49 72 call 0xe492 ; 0xe492 if (get_message_level() == 0) { 26a44: 80 91 8e 03 lds r24, 0x038E ; 0x80038e <_ZL24lcd_status_message_level.lto_priv.408> 26a48: 81 11 cpse r24, r1 26a4a: 0c c0 rjmp .+24 ; 0x26a64 Sound_MakeCustom(200,0,true); 26a4c: 41 e0 ldi r20, 0x01 ; 1 26a4e: 70 e0 ldi r23, 0x00 ; 0 26a50: 60 e0 ldi r22, 0x00 ; 0 26a52: 88 ec ldi r24, 0xC8 ; 200 26a54: 90 e0 ldi r25, 0x00 ; 0 26a56: 0f 94 6f 32 call 0x264de ; 0x264de LCD_ALERTMESSAGERPGM(lcdMsg); 26a5a: 62 e0 ldi r22, 0x02 ; 2 26a5c: 8e eb ldi r24, 0xBE ; 190 26a5e: 99 e6 ldi r25, 0x69 ; 105 26a60: 0e 94 35 e2 call 0x1c46a ; 0x1c46a } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { countFanSpeed(); checkFanSpeed(); //printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = fanSpeedBckp; 26a64: 80 91 67 02 lds r24, 0x0267 ; 0x800267 26a68: 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(); 26a6c: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 26a70: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d 26a74: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e 26a78: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f 26a7c: 90 93 90 16 sts 0x1690, r25 ; 0x801690 fan_measuring = false; 26a80: 10 92 84 03 sts 0x0384, r1 ; 0x800384 checkFans(); #ifdef THERMAL_MODEL_DEBUG thermal_model::log_usr(); #endif } 26a84: 0f 90 pop r0 26a86: 0f 90 pop r0 26a88: df 91 pop r29 26a8a: cf 91 pop r28 26a8c: 1f 91 pop r17 26a8e: 0f 91 pop r16 26a90: ff 90 pop r15 26a92: ef 90 pop r14 26a94: df 90 pop r13 26a96: cf 90 pop r12 } #endif //FANCHECK checkExtruderAutoFans(); 26a98: 0c 94 81 6e jmp 0xdd02 ; 0xdd02 26a9c: 0f 90 pop r0 26a9e: 0f 90 pop r0 26aa0: df 91 pop r29 26aa2: cf 91 pop r28 26aa4: 1f 91 pop r17 26aa6: 0f 91 pop r16 26aa8: ff 90 pop r15 26aaa: ef 90 pop r14 26aac: df 90 pop r13 26aae: cf 90 pop r12 26ab0: 08 95 ret 00026ab2 : } bool lcd_wait_for_click_delay(uint16_t nDelay) // nDelay :: timeout [s] (0 ~ no timeout) // true ~ clicked, false ~ delayed { 26ab2: 4f 92 push r4 26ab4: 5f 92 push r5 26ab6: 6f 92 push r6 26ab8: 7f 92 push r7 26aba: 8f 92 push r8 26abc: 9f 92 push r9 26abe: af 92 push r10 26ac0: bf 92 push r11 26ac2: cf 92 push r12 26ac4: df 92 push r13 26ac6: ef 92 push r14 26ac8: ff 92 push r15 26aca: 0f 93 push r16 26acc: 1f 93 push r17 26ace: cf 93 push r28 26ad0: 8c 01 movw r16, r24 bool bDelayed; long nTime0 = _millis()/1000; 26ad2: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 26ad6: 28 ee ldi r18, 0xE8 ; 232 26ad8: 33 e0 ldi r19, 0x03 ; 3 26ada: 40 e0 ldi r20, 0x00 ; 0 26adc: 50 e0 ldi r21, 0x00 ; 0 26ade: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> 26ae2: 69 01 movw r12, r18 26ae4: 7a 01 movw r14, r20 lcd_consume_click(); 26ae6: 0e 94 89 6b call 0xd712 ; 0xd712 KEEPALIVE_STATE(PAUSED_FOR_USER); 26aea: 84 e0 ldi r24, 0x04 ; 4 26aec: 80 93 78 02 sts 0x0278, r24 ; 0x800278 for (;;) { manage_heater(); manage_inactivity(true); bDelayed = ((_millis()/1000-nTime0) > nDelay); 26af0: 88 ee ldi r24, 0xE8 ; 232 26af2: 88 2e mov r8, r24 26af4: 83 e0 ldi r24, 0x03 ; 3 26af6: 98 2e mov r9, r24 26af8: a1 2c mov r10, r1 26afa: b1 2c mov r11, r1 26afc: 28 01 movw r4, r16 26afe: 71 2c mov r7, r1 26b00: 61 2c mov r6, r1 bool bDelayed; long nTime0 = _millis()/1000; lcd_consume_click(); KEEPALIVE_STATE(PAUSED_FOR_USER); for (;;) { manage_heater(); 26b02: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(true); 26b06: 81 e0 ldi r24, 0x01 ; 1 26b08: 0e 94 fe 79 call 0xf3fc ; 0xf3fc bDelayed = ((_millis()/1000-nTime0) > nDelay); 26b0c: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 26b10: a5 01 movw r20, r10 26b12: 94 01 movw r18, r8 26b14: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> 26b18: 2c 19 sub r18, r12 26b1a: 3d 09 sbc r19, r13 26b1c: 4e 09 sbc r20, r14 26b1e: 5f 09 sbc r21, r15 bDelayed = (bDelayed && (nDelay != 0)); // 0 ~ no timeout, always waiting for click 26b20: 42 16 cp r4, r18 26b22: 53 06 cpc r5, r19 26b24: 64 06 cpc r6, r20 26b26: 75 06 cpc r7, r21 26b28: 20 f4 brcc .+8 ; 0x26b32 26b2a: c1 e0 ldi r28, 0x01 ; 1 26b2c: 01 15 cp r16, r1 26b2e: 11 05 cpc r17, r1 26b30: 09 f4 brne .+2 ; 0x26b34 26b32: c0 e0 ldi r28, 0x00 ; 0 if (lcd_clicked() || bDelayed) { 26b34: 0e 94 8e 6b call 0xd71c ; 0xd71c 26b38: 81 11 cpse r24, r1 26b3a: 02 c0 rjmp .+4 ; 0x26b40 26b3c: cc 23 and r28, r28 26b3e: 09 f3 breq .-62 ; 0x26b02 KEEPALIVE_STATE(IN_HANDLER); 26b40: 82 e0 ldi r24, 0x02 ; 2 26b42: 80 93 78 02 sts 0x0278, r24 ; 0x800278 return(!bDelayed); } } } 26b46: 81 e0 ldi r24, 0x01 ; 1 26b48: 8c 27 eor r24, r28 26b4a: cf 91 pop r28 26b4c: 1f 91 pop r17 26b4e: 0f 91 pop r16 26b50: ff 90 pop r15 26b52: ef 90 pop r14 26b54: df 90 pop r13 26b56: cf 90 pop r12 26b58: bf 90 pop r11 26b5a: af 90 pop r10 26b5c: 9f 90 pop r9 26b5e: 8f 90 pop r8 26b60: 7f 90 pop r7 26b62: 6f 90 pop r6 26b64: 5f 90 pop r5 26b66: 4f 90 pop r4 26b68: 08 95 ret 00026b6a : // 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) { 26b6a: 9f 92 push r9 26b6c: af 92 push r10 26b6e: bf 92 push r11 26b70: cf 92 push r12 26b72: df 92 push r13 26b74: ef 92 push r14 26b76: ff 92 push r15 26b78: 0f 93 push r16 26b7a: 1f 93 push r17 26b7c: cf 93 push r28 26b7e: df 93 push r29 26b80: 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; 26b82: 10 92 fd 11 sts 0x11FD, r1 ; 0x8011fd 26b86: 10 92 fe 11 sts 0x11FE, r1 ; 0x8011fe 26b8a: 10 92 ff 11 sts 0x11FF, r1 ; 0x8011ff 26b8e: 10 92 00 12 sts 0x1200, r1 ; 0x801200 plan_set_position_curposXYZE(); 26b92: 0f 94 ef 83 call 0x307de ; 0x307de // Until confirmed by the confirmation dialog. for (;;) { const char *msg = only_z ? _T(MSG_MOVE_CARRIAGE_TO_THE_TOP_Z) 26b96: 86 e9 ldi r24, 0x96 ; 150 26b98: 9c e4 ldi r25, 0x4C ; 76 26b9a: 91 10 cpse r9, r1 26b9c: 02 c0 rjmp .+4 ; 0x26ba2 26b9e: 83 e3 ldi r24, 0x33 ; 51 26ba0: 9c e4 ldi r25, 0x4C ; 76 26ba2: 0e 94 a7 6c call 0xd94e ; 0xd94e 26ba6: b8 2e mov r11, r24 26ba8: a9 2e mov r10, r25 : _T(MSG_MOVE_CARRIAGE_TO_THE_TOP); const char *msg_next = lcd_display_message_fullscreen_P(msg); 26baa: 0f 94 22 0b call 0x21644 ; 0x21644 26bae: 8c 01 movw r16, r24 const bool multi_screen = msg_next != NULL; unsigned long previous_millis_msg = _millis(); 26bb0: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 26bb4: 6b 01 movw r12, r22 26bb6: 7c 01 movw r14, r24 // Until the user finishes the z up movement. lcd_encoder = 0; 26bb8: 10 92 07 05 sts 0x0507, r1 ; 0x800507 26bbc: 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); 26bc0: 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(); 26bc2: 0f 94 13 33 call 0x26626 ; 0x26626 manage_inactivity(true); 26bc6: 81 e0 ldi r24, 0x01 ; 1 26bc8: 0e 94 fe 79 call 0xf3fc ; 0xf3fc if (lcd_encoder) { 26bcc: 80 91 06 05 lds r24, 0x0506 ; 0x800506 26bd0: 90 91 07 05 lds r25, 0x0507 ; 0x800507 26bd4: 89 2b or r24, r25 26bd6: d9 f1 breq .+118 ; 0x26c4e _delay(50); 26bd8: 62 e3 ldi r22, 0x32 ; 50 26bda: 70 e0 ldi r23, 0x00 ; 0 26bdc: 80 e0 ldi r24, 0x00 ; 0 26bde: 90 e0 ldi r25, 0x00 ; 0 26be0: 0f 94 03 0e call 0x21c06 ; 0x21c06 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; 26be4: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 if (++ next_block_index == BLOCK_BUFFER_SIZE) 26be8: 8f 5f subi r24, 0xFF ; 255 26bea: 80 31 cpi r24, 0x10 ; 16 26bec: 09 f4 brne .+2 ; 0x26bf0 next_block_index = 0; 26bee: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 26bf0: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 if (! planner_queue_full()) { 26bf4: 98 17 cp r25, r24 26bf6: 59 f1 breq .+86 ; 0x26c4e // Only move up, whatever direction the user rotates the encoder. current_position[Z_AXIS] += abs(lcd_encoder); 26bf8: 60 91 06 05 lds r22, 0x0506 ; 0x800506 26bfc: 70 91 07 05 lds r23, 0x0507 ; 0x800507 26c00: 77 ff sbrs r23, 7 26c02: 03 c0 rjmp .+6 ; 0x26c0a 26c04: 71 95 neg r23 26c06: 61 95 neg r22 26c08: 71 09 sbc r23, r1 26c0a: 07 2e mov r0, r23 26c0c: 00 0c add r0, r0 26c0e: 88 0b sbc r24, r24 26c10: 99 0b sbc r25, r25 26c12: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 26c16: 20 91 fd 11 lds r18, 0x11FD ; 0x8011fd 26c1a: 30 91 fe 11 lds r19, 0x11FE ; 0x8011fe 26c1e: 40 91 ff 11 lds r20, 0x11FF ; 0x8011ff 26c22: 50 91 00 12 lds r21, 0x1200 ; 0x801200 26c26: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 26c2a: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 26c2e: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 26c32: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 26c36: 90 93 00 12 sts 0x1200, r25 ; 0x801200 lcd_encoder = 0; 26c3a: 10 92 07 05 sts 0x0507, r1 ; 0x800507 26c3e: 10 92 06 05 sts 0x0506, r1 ; 0x800506 plan_buffer_line_curposXYZE(manual_feedrate[Z_AXIS] / 60); 26c42: 65 e5 ldi r22, 0x55 ; 85 26c44: 75 e5 ldi r23, 0x55 ; 85 26c46: 85 e8 ldi r24, 0x85 ; 133 26c48: 91 e4 ldi r25, 0x41 ; 65 26c4a: 0f 94 2f 85 call 0x30a5e ; 0x30a5e } } if (lcd_clicked()) { 26c4e: 0e 94 8e 6b call 0xd71c ; 0xd71c 26c52: 88 23 and r24, r24 26c54: c9 f1 breq .+114 ; 0x26cc8 // Abort a move if in progress. planner_abort_hard(); 26c56: 0f 94 a9 86 call 0x30d52 ; 0x30d52 planner_aborted = false; 26c5a: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac while (lcd_clicked()) ; 26c5e: 0e 94 8e 6b call 0xd71c ; 0xd71c 26c62: 81 11 cpse r24, r1 26c64: fc cf rjmp .-8 ; 0x26c5e _delay(10); 26c66: 6a e0 ldi r22, 0x0A ; 10 26c68: 70 e0 ldi r23, 0x00 ; 0 26c6a: 80 e0 ldi r24, 0x00 ; 0 26c6c: 90 e0 ldi r25, 0x00 ; 0 26c6e: 0f 94 03 0e call 0x21c06 ; 0x21c06 while (lcd_clicked()) ; 26c72: 0e 94 8e 6b call 0xd71c ; 0xd71c 26c76: 81 11 cpse r24, r1 26c78: fc cf rjmp .-8 ; 0x26c72 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); 26c7a: 8a e0 ldi r24, 0x0A ; 10 26c7c: 9c e4 ldi r25, 0x4C ; 76 26c7e: 0e 94 a7 6c call 0xd94e ; 0xd94e 26c82: 41 e0 ldi r20, 0x01 ; 1 26c84: 60 e0 ldi r22, 0x00 ; 0 26c86: 0f 94 8a 2e call 0x25d14 ; 0x25d14 if (result == LCD_BUTTON_TIMEOUT) 26c8a: 8f 3f cpi r24, 0xFF ; 255 26c8c: d1 f1 breq .+116 ; 0x26d02 goto canceled; else if (result == LCD_LEFT_BUTTON_CHOICE) 26c8e: 81 11 cpse r24, r1 26c90: 82 cf rjmp .-252 ; 0x26b96 // 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; 26c92: 80 e0 ldi r24, 0x00 ; 0 26c94: 90 e0 ldi r25, 0x00 ; 0 26c96: a6 e5 ldi r26, 0x56 ; 86 26c98: b3 e4 ldi r27, 0x43 ; 67 26c9a: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 26c9e: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 26ca2: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 26ca6: b0 93 00 12 sts 0x1200, r27 ; 0x801200 } plan_set_position_curposXYZE(); 26caa: 0f 94 ef 83 call 0x307de ; 0x307de return true; 26cae: 81 e0 ldi r24, 0x01 ; 1 canceled: return false; } 26cb0: df 91 pop r29 26cb2: cf 91 pop r28 26cb4: 1f 91 pop r17 26cb6: 0f 91 pop r16 26cb8: ff 90 pop r15 26cba: ef 90 pop r14 26cbc: df 90 pop r13 26cbe: cf 90 pop r12 26cc0: bf 90 pop r11 26cc2: af 90 pop r10 26cc4: 9f 90 pop r9 26cc6: 08 95 ret while (lcd_clicked()) ; _delay(10); while (lcd_clicked()) ; break; } if (multi_screen && _millis() - previous_millis_msg > 5000) { 26cc8: 01 15 cp r16, r1 26cca: 11 05 cpc r17, r1 26ccc: 09 f4 brne .+2 ; 0x26cd0 26cce: 79 cf rjmp .-270 ; 0x26bc2 26cd0: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 26cd4: 6c 19 sub r22, r12 26cd6: 7d 09 sbc r23, r13 26cd8: 8e 09 sbc r24, r14 26cda: 9f 09 sbc r25, r15 26cdc: 69 38 cpi r22, 0x89 ; 137 26cde: 73 41 sbci r23, 0x13 ; 19 26ce0: 81 05 cpc r24, r1 26ce2: 91 05 cpc r25, r1 26ce4: 08 f4 brcc .+2 ; 0x26ce8 26ce6: 6d cf rjmp .-294 ; 0x26bc2 if (msg_next == NULL) 26ce8: 20 97 sbiw r28, 0x00 ; 0 26cea: 11 f4 brne .+4 ; 0x26cf0 msg_next = msg; 26cec: cb 2d mov r28, r11 26cee: da 2d mov r29, r10 msg_next = lcd_display_message_fullscreen_P(msg_next); 26cf0: ce 01 movw r24, r28 26cf2: 0f 94 22 0b call 0x21644 ; 0x21644 26cf6: ec 01 movw r28, r24 previous_millis_msg = _millis(); 26cf8: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 26cfc: 6b 01 movw r12, r22 26cfe: 7c 01 movw r14, r24 26d00: 60 cf rjmp .-320 ; 0x26bc2 } plan_set_position_curposXYZE(); return true; canceled: return false; 26d02: 80 e0 ldi r24, 0x00 ; 0 26d04: d5 cf rjmp .-86 ; 0x26cb0 00026d06 : /// 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() { 26d06: cf 93 push r28 #if BEEPER > 0 if (eSoundMode == e_SOUND_MODE_SILENT) return; 26d08: c0 91 15 04 lds r28, 0x0415 ; 0x800415 26d0c: c2 30 cpi r28, 0x02 ; 2 26d0e: 59 f1 breq .+86 ; 0x26d66 // Handle case where only one beep is needed if (eSoundMode == e_SOUND_MODE_ONCE) { 26d10: c1 30 cpi r28, 0x01 ; 1 26d12: 69 f4 brne .+26 ; 0x26d2e if (bFirst) return; 26d14: 80 91 2e 05 lds r24, 0x052E ; 0x80052e <_ZL6bFirst.lto_priv.457> 26d18: 81 11 cpse r24, r1 26d1a: 25 c0 rjmp .+74 ; 0x26d66 Sound_MakeCustom(80, 0, false); 26d1c: 40 e0 ldi r20, 0x00 ; 0 26d1e: 70 e0 ldi r23, 0x00 ; 0 26d20: 60 e0 ldi r22, 0x00 ; 0 26d22: 80 e5 ldi r24, 0x50 ; 80 26d24: 90 e0 ldi r25, 0x00 ; 0 26d26: 0f 94 6f 32 call 0x264de ; 0x264de bFirst = true; 26d2a: 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)) { 26d2e: 60 ed ldi r22, 0xD0 ; 208 26d30: 77 e0 ldi r23, 0x07 ; 7 26d32: 8b e2 ldi r24, 0x2B ; 43 26d34: 95 e0 ldi r25, 0x05 ; 5 26d36: 0f 94 57 10 call 0x220ae ; 0x220ae ::expired_cont(unsigned short)> 26d3a: 88 23 and r24, r24 26d3c: a1 f0 breq .+40 ; 0x26d66 beep_timer.start(); 26d3e: 8b e2 ldi r24, 0x2B ; 43 26d40: 95 e0 ldi r25, 0x05 ; 5 26d42: 0f 94 5e 10 call 0x220bc ; 0x220bc ::start()> if (eSoundMode == e_SOUND_MODE_LOUD) { 26d46: 80 91 15 04 lds r24, 0x0415 ; 0x800415 26d4a: 81 11 cpse r24, r1 26d4c: 08 c0 rjmp .+16 ; 0x26d5e Sound_MakeCustom(80, 0, false); 26d4e: 40 e0 ldi r20, 0x00 ; 0 26d50: 70 e0 ldi r23, 0x00 ; 0 26d52: 60 e0 ldi r22, 0x00 ; 0 26d54: 80 e5 ldi r24, 0x50 ; 80 26d56: 90 e0 ldi r25, 0x00 ; 0 // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } } #endif // BEEPER > 0 } 26d58: 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); 26d5a: 0d 94 6f 32 jmp 0x264de ; 0x264de } else { // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 26d5e: 80 e0 ldi r24, 0x00 ; 0 } } #endif // BEEPER > 0 } 26d60: 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); 26d62: 0d 94 2b 2d jmp 0x25a56 ; 0x25a56 } } #endif // BEEPER > 0 } 26d66: cf 91 pop r28 26d68: 08 95 ret 00026d6a : { #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; 26d6a: 98 b1 in r25, 0x08 ; 8 26d6c: 90 7f andi r25, 0xF0 ; 240 PORTC = portC | (axes_mask & 0x0f); //set step signals by mask 26d6e: 89 2b or r24, r25 26d70: 88 b9 out 0x08, r24 ; 8 asm("nop"); 26d72: 00 00 nop PORTC = portC; //set step signals to zero 26d74: 98 b9 out 0x08, r25 ; 8 asm("nop"); 26d76: 00 00 nop #endif #endif //((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3) || (MOTHERBOARD == BOARD_EINSY_1_0a)) } 26d78: 08 95 ret 00026d7a : sm4_calc_delay_cb_t sm4_calc_delay_cb = 0; void sm4_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 26d7a: 82 30 cpi r24, 0x02 ; 2 26d7c: b9 f0 breq .+46 ; 0x26dac 26d7e: 83 30 cpi r24, 0x03 ; 3 26d80: e9 f0 breq .+58 ; 0x26dbc 26d82: 81 30 cpi r24, 0x01 ; 1 26d84: 59 f0 breq .+22 ; 0x26d9c { #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; 26d86: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 26d8a: 61 11 cpse r22, r1 26d8c: 05 c0 rjmp .+10 ; 0x26d98 26d8e: 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; 26d90: 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"); 26d94: 00 00 nop } 26d96: 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; 26d98: 8d 7f andi r24, 0xFD ; 253 26d9a: fa cf rjmp .-12 ; 0x26d90 case 1: if (dir == INVERT_Y_DIR) PORTL |= 1; else PORTL &= ~1; break; 26d9c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 26da0: 61 11 cpse r22, r1 26da2: 02 c0 rjmp .+4 ; 0x26da8 26da4: 81 60 ori r24, 0x01 ; 1 26da6: f4 cf rjmp .-24 ; 0x26d90 26da8: 8e 7f andi r24, 0xFE ; 254 26daa: f2 cf rjmp .-28 ; 0x26d90 case 2: if (dir == INVERT_Z_DIR) PORTL |= 4; else PORTL &= ~4; break; 26dac: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 26db0: 61 11 cpse r22, r1 26db2: 02 c0 rjmp .+4 ; 0x26db8 26db4: 84 60 ori r24, 0x04 ; 4 26db6: ec cf rjmp .-40 ; 0x26d90 26db8: 8b 7f andi r24, 0xFB ; 251 26dba: ea cf rjmp .-44 ; 0x26d90 case 3: if (dir == INVERT_E0_DIR) PORTL |= 64; else PORTL &= ~64; break; 26dbc: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 26dc0: 61 30 cpi r22, 0x01 ; 1 26dc2: 11 f4 brne .+4 ; 0x26dc8 26dc4: 80 64 ori r24, 0x40 ; 64 26dc6: e4 cf rjmp .-56 ; 0x26d90 26dc8: 8f 7b andi r24, 0xBF ; 191 26dca: e2 cf rjmp .-60 ; 0x26d90 00026dcc : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { 26dcc: cf 93 push r28 if (cacheDirty_) { 26dce: 80 91 d5 0d lds r24, 0x0DD5 ; 0x800dd5 } cacheMirrorBlock_ = 0; } cacheDirty_ = 0; } return true; 26dd2: c1 e0 ldi r28, 0x01 ; 1 fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { if (cacheDirty_) { 26dd4: 88 23 and r24, r24 26dd6: a1 f0 breq .+40 ; 0x26e00 if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { 26dd8: 40 91 cd 0d lds r20, 0x0DCD ; 0x800dcd 26ddc: 50 91 ce 0d lds r21, 0x0DCE ; 0x800dce 26de0: 60 91 cf 0d lds r22, 0x0DCF ; 0x800dcf 26de4: 70 91 d0 0d lds r23, 0x0DD0 ; 0x800dd0 26de8: 29 ed ldi r18, 0xD9 ; 217 26dea: 3d e0 ldi r19, 0x0D ; 13 26dec: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 26df0: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 26df4: 0f 94 0e 71 call 0x2e21c ; 0x2e21c 26df8: c8 2f mov r28, r24 26dfa: 81 11 cpse r24, r1 26dfc: 04 c0 rjmp .+8 ; 0x26e06 cacheDirty_ = 0; } return true; fail: return false; 26dfe: c0 e0 ldi r28, 0x00 ; 0 } 26e00: 8c 2f mov r24, r28 26e02: cf 91 pop r28 26e04: 08 95 ret if (cacheDirty_) { if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { goto fail; } // mirror FAT tables if (cacheMirrorBlock_) { 26e06: 40 91 d1 0d lds r20, 0x0DD1 ; 0x800dd1 26e0a: 50 91 d2 0d lds r21, 0x0DD2 ; 0x800dd2 26e0e: 60 91 d3 0d lds r22, 0x0DD3 ; 0x800dd3 26e12: 70 91 d4 0d lds r23, 0x0DD4 ; 0x800dd4 26e16: 41 15 cp r20, r1 26e18: 51 05 cpc r21, r1 26e1a: 61 05 cpc r22, r1 26e1c: 71 05 cpc r23, r1 26e1e: 91 f0 breq .+36 ; 0x26e44 if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) { 26e20: 29 ed ldi r18, 0xD9 ; 217 26e22: 3d e0 ldi r19, 0x0D ; 13 26e24: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 26e28: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 26e2c: 0f 94 0e 71 call 0x2e21c ; 0x2e21c 26e30: 88 23 and r24, r24 26e32: 29 f3 breq .-54 ; 0x26dfe goto fail; } cacheMirrorBlock_ = 0; 26e34: 10 92 d1 0d sts 0x0DD1, r1 ; 0x800dd1 26e38: 10 92 d2 0d sts 0x0DD2, r1 ; 0x800dd2 26e3c: 10 92 d3 0d sts 0x0DD3, r1 ; 0x800dd3 26e40: 10 92 d4 0d sts 0x0DD4, r1 ; 0x800dd4 } cacheDirty_ = 0; 26e44: 10 92 d5 0d sts 0x0DD5, r1 ; 0x800dd5 26e48: db cf rjmp .-74 ; 0x26e00 00026e4a : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) { 26e4a: cf 92 push r12 26e4c: df 92 push r13 26e4e: ef 92 push r14 26e50: ff 92 push r15 26e52: cf 93 push r28 26e54: 6b 01 movw r12, r22 26e56: 7c 01 movw r14, r24 26e58: c4 2f mov r28, r20 if (cacheBlockNumber_ != blockNumber) { 26e5a: 80 91 cd 0d lds r24, 0x0DCD ; 0x800dcd 26e5e: 90 91 ce 0d lds r25, 0x0DCE ; 0x800dce 26e62: a0 91 cf 0d lds r26, 0x0DCF ; 0x800dcf 26e66: b0 91 d0 0d lds r27, 0x0DD0 ; 0x800dd0 26e6a: 8c 15 cp r24, r12 26e6c: 9d 05 cpc r25, r13 26e6e: ae 05 cpc r26, r14 26e70: bf 05 cpc r27, r15 26e72: 01 f1 breq .+64 ; 0x26eb4 if (!cacheFlush()) goto fail; 26e74: 0f 94 e6 36 call 0x26dcc ; 0x26dcc 26e78: 81 11 cpse r24, r1 26e7a: 08 c0 rjmp .+16 ; 0x26e8c } if (dirty) cacheDirty_ = true; return true; fail: return false; 26e7c: c0 e0 ldi r28, 0x00 ; 0 } 26e7e: 8c 2f mov r24, r28 26e80: cf 91 pop r28 26e82: ff 90 pop r15 26e84: ef 90 pop r14 26e86: df 90 pop r13 26e88: cf 90 pop r12 26e8a: 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; 26e8c: 29 ed ldi r18, 0xD9 ; 217 26e8e: 3d e0 ldi r19, 0x0D ; 13 26e90: b7 01 movw r22, r14 26e92: a6 01 movw r20, r12 26e94: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 26e98: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 26e9c: 0f 94 72 71 call 0x2e2e4 ; 0x2e2e4 26ea0: 88 23 and r24, r24 26ea2: 61 f3 breq .-40 ; 0x26e7c cacheBlockNumber_ = blockNumber; 26ea4: c0 92 cd 0d sts 0x0DCD, r12 ; 0x800dcd 26ea8: d0 92 ce 0d sts 0x0DCE, r13 ; 0x800dce 26eac: e0 92 cf 0d sts 0x0DCF, r14 ; 0x800dcf 26eb0: f0 92 d0 0d sts 0x0DD0, r15 ; 0x800dd0 } if (dirty) cacheDirty_ = true; 26eb4: cc 23 and r28, r28 26eb6: 21 f0 breq .+8 ; 0x26ec0 26eb8: 81 e0 ldi r24, 0x01 ; 1 26eba: 80 93 d5 0d sts 0x0DD5, r24 ; 0x800dd5 26ebe: df cf rjmp .-66 ; 0x26e7e return true; 26ec0: c1 e0 ldi r28, 0x01 ; 1 26ec2: dd cf rjmp .-70 ; 0x26e7e 00026ec4 : fail: return false; } //------------------------------------------------------------------------------ // Store a FAT entry bool SdVolume::fatPut(uint32_t cluster, uint32_t value) { 26ec4: 4f 92 push r4 26ec6: 5f 92 push r5 26ec8: 6f 92 push r6 26eca: 7f 92 push r7 26ecc: 8f 92 push r8 26ece: 9f 92 push r9 26ed0: af 92 push r10 26ed2: bf 92 push r11 26ed4: cf 92 push r12 26ed6: df 92 push r13 26ed8: ef 92 push r14 26eda: ff 92 push r15 26edc: 0f 93 push r16 26ede: 1f 93 push r17 26ee0: cf 93 push r28 26ee2: df 93 push r29 26ee4: ec 01 movw r28, r24 uint32_t lba; // error if reserved cluster if (cluster < 2) goto fail; 26ee6: 42 30 cpi r20, 0x02 ; 2 26ee8: 51 05 cpc r21, r1 26eea: 61 05 cpc r22, r1 26eec: 71 05 cpc r23, r1 26eee: 90 f4 brcc .+36 ; 0x26f14 // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; return true; fail: return false; 26ef0: 80 e0 ldi r24, 0x00 ; 0 } 26ef2: df 91 pop r29 26ef4: cf 91 pop r28 26ef6: 1f 91 pop r17 26ef8: 0f 91 pop r16 26efa: ff 90 pop r15 26efc: ef 90 pop r14 26efe: df 90 pop r13 26f00: cf 90 pop r12 26f02: bf 90 pop r11 26f04: af 90 pop r10 26f06: 9f 90 pop r9 26f08: 8f 90 pop r8 26f0a: 7f 90 pop r7 26f0c: 6f 90 pop r6 26f0e: 5f 90 pop r5 26f10: 4f 90 pop r4 26f12: 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; 26f14: 89 85 ldd r24, Y+9 ; 0x09 26f16: 9a 85 ldd r25, Y+10 ; 0x0a 26f18: ab 85 ldd r26, Y+11 ; 0x0b 26f1a: bc 85 ldd r27, Y+12 ; 0x0c 26f1c: 01 96 adiw r24, 0x01 ; 1 26f1e: a1 1d adc r26, r1 26f20: b1 1d adc r27, r1 26f22: 84 17 cp r24, r20 26f24: 95 07 cpc r25, r21 26f26: a6 07 cpc r26, r22 26f28: b7 07 cpc r27, r23 26f2a: 10 f3 brcs .-60 ; 0x26ef0 tmp = ((cacheBuffer_.data[index] & 0XF0)) | tmp >> 4; } cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { 26f2c: 8f 89 ldd r24, Y+23 ; 0x17 26f2e: 80 31 cpi r24, 0x10 ; 16 26f30: c9 f5 brne .+114 ; 0x26fa4 lba = fatStartBlock_ + (cluster >> 8); 26f32: 85 2e mov r8, r21 26f34: 96 2e mov r9, r22 26f36: a7 2e mov r10, r23 26f38: bb 24 eor r11, r11 26f3a: 8b 89 ldd r24, Y+19 ; 0x13 26f3c: 9c 89 ldd r25, Y+20 ; 0x14 26f3e: ad 89 ldd r26, Y+21 ; 0x15 26f40: be 89 ldd r27, Y+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 26f42: 88 0e add r8, r24 26f44: 99 1e adc r9, r25 26f46: aa 1e adc r10, r26 26f48: bb 1e adc r11, r27 26f4a: 28 01 movw r4, r16 26f4c: 39 01 movw r6, r18 26f4e: 6a 01 movw r12, r20 26f50: 7b 01 movw r14, r22 } else { goto fail; } if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; 26f52: 41 e0 ldi r20, 0x01 ; 1 26f54: c5 01 movw r24, r10 26f56: b4 01 movw r22, r8 26f58: 0f 94 25 37 call 0x26e4a ; 0x26e4a 26f5c: 88 23 and r24, r24 26f5e: 41 f2 breq .-112 ; 0x26ef0 // store entry if (fatType_ == 16) { 26f60: 9f 89 ldd r25, Y+23 ; 0x17 26f62: 90 31 cpi r25, 0x10 ; 16 26f64: 81 f5 brne .+96 ; 0x26fc6 cacheBuffer_.fat16[cluster & 0XFF] = value; 26f66: dd 24 eor r13, r13 26f68: ee 24 eor r14, r14 26f6a: ff 24 eor r15, r15 26f6c: f6 01 movw r30, r12 26f6e: ee 0f add r30, r30 26f70: ff 1f adc r31, r31 26f72: e7 52 subi r30, 0x27 ; 39 26f74: f2 4f sbci r31, 0xF2 ; 242 26f76: 11 83 std Z+1, r17 ; 0x01 26f78: 00 83 st Z, r16 } else { cacheBuffer_.fat32[cluster & 0X7F] = value; } // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; 26f7a: 9a 89 ldd r25, Y+18 ; 0x12 26f7c: 92 30 cpi r25, 0x02 ; 2 26f7e: 08 f4 brcc .+2 ; 0x26f82 26f80: b8 cf rjmp .-144 ; 0x26ef2 26f82: 4d 81 ldd r20, Y+5 ; 0x05 26f84: 5e 81 ldd r21, Y+6 ; 0x06 26f86: 6f 81 ldd r22, Y+7 ; 0x07 26f88: 78 85 ldd r23, Y+8 ; 0x08 26f8a: 84 0e add r8, r20 26f8c: 95 1e adc r9, r21 26f8e: a6 1e adc r10, r22 26f90: b7 1e adc r11, r23 26f92: 80 92 d1 0d sts 0x0DD1, r8 ; 0x800dd1 26f96: 90 92 d2 0d sts 0x0DD2, r9 ; 0x800dd2 26f9a: a0 92 d3 0d sts 0x0DD3, r10 ; 0x800dd3 26f9e: b0 92 d4 0d sts 0x0DD4, r11 ; 0x800dd4 26fa2: a7 cf rjmp .-178 ; 0x26ef2 cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 26fa4: 80 32 cpi r24, 0x20 ; 32 26fa6: 09 f0 breq .+2 ; 0x26faa 26fa8: a3 cf rjmp .-186 ; 0x26ef0 lba = fatStartBlock_ + (cluster >> 7); 26faa: 8b 89 ldd r24, Y+19 ; 0x13 26fac: 9c 89 ldd r25, Y+20 ; 0x14 26fae: ad 89 ldd r26, Y+21 ; 0x15 26fb0: be 89 ldd r27, Y+22 ; 0x16 26fb2: 4a 01 movw r8, r20 26fb4: 5b 01 movw r10, r22 26fb6: e7 e0 ldi r30, 0x07 ; 7 26fb8: b6 94 lsr r11 26fba: a7 94 ror r10 26fbc: 97 94 ror r9 26fbe: 87 94 ror r8 26fc0: ea 95 dec r30 26fc2: d1 f7 brne .-12 ; 0x26fb8 26fc4: be cf rjmp .-132 ; 0x26f42 if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; // store entry if (fatType_ == 16) { cacheBuffer_.fat16[cluster & 0XFF] = value; } else { cacheBuffer_.fat32[cluster & 0X7F] = value; 26fc6: e8 94 clt 26fc8: c7 f8 bld r12, 7 26fca: dd 24 eor r13, r13 26fcc: ee 24 eor r14, r14 26fce: ff 24 eor r15, r15 26fd0: f6 01 movw r30, r12 26fd2: ee 0f add r30, r30 26fd4: ff 1f adc r31, r31 26fd6: ee 0f add r30, r30 26fd8: ff 1f adc r31, r31 26fda: e7 52 subi r30, 0x27 ; 39 26fdc: f2 4f sbci r31, 0xF2 ; 242 26fde: 40 82 st Z, r4 26fe0: 51 82 std Z+1, r5 ; 0x01 26fe2: 62 82 std Z+2, r6 ; 0x02 26fe4: 73 82 std Z+3, r7 ; 0x03 26fe6: c9 cf rjmp .-110 ; 0x26f7a 00026fe8 : fail: return false; } //------------------------------------------------------------------------------ // Fetch a FAT entry bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) { 26fe8: cf 92 push r12 26fea: df 92 push r13 26fec: ef 92 push r14 26fee: ff 92 push r15 26ff0: 0f 93 push r16 26ff2: 1f 93 push r17 26ff4: cf 93 push r28 26ff6: df 93 push r29 26ff8: fc 01 movw r30, r24 uint32_t lba; if (cluster > (clusterCount_ + 1)) goto fail; 26ffa: 81 85 ldd r24, Z+9 ; 0x09 26ffc: 92 85 ldd r25, Z+10 ; 0x0a 26ffe: a3 85 ldd r26, Z+11 ; 0x0b 27000: b4 85 ldd r27, Z+12 ; 0x0c 27002: 01 96 adiw r24, 0x01 ; 1 27004: a1 1d adc r26, r1 27006: b1 1d adc r27, r1 27008: 84 17 cp r24, r20 2700a: 95 07 cpc r25, r21 2700c: a6 07 cpc r26, r22 2700e: b7 07 cpc r27, r23 27010: 50 f4 brcc .+20 ; 0x27026 *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; } return true; fail: return false; 27012: 80 e0 ldi r24, 0x00 ; 0 } 27014: df 91 pop r29 27016: cf 91 pop r28 27018: 1f 91 pop r17 2701a: 0f 91 pop r16 2701c: ff 90 pop r15 2701e: ef 90 pop r14 27020: df 90 pop r13 27022: cf 90 pop r12 27024: 08 95 ret } tmp |= cacheBuffer_.data[index] << 8; *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { 27026: 87 89 ldd r24, Z+23 ; 0x17 27028: 80 31 cpi r24, 0x10 ; 16 2702a: a9 f5 brne .+106 ; 0x27096 lba = fatStartBlock_ + (cluster >> 8); 2702c: bb 27 eor r27, r27 2702e: a7 2f mov r26, r23 27030: 96 2f mov r25, r22 27032: 85 2f mov r24, r21 27034: c3 88 ldd r12, Z+19 ; 0x13 27036: d4 88 ldd r13, Z+20 ; 0x14 27038: e5 88 ldd r14, Z+21 ; 0x15 2703a: f6 88 ldd r15, Z+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 2703c: 8c 0d add r24, r12 2703e: 9d 1d adc r25, r13 27040: ae 1d adc r26, r14 27042: bf 1d adc r27, r15 27044: e9 01 movw r28, r18 27046: 6a 01 movw r12, r20 27048: 7b 01 movw r14, r22 2704a: 8f 01 movw r16, r30 } else { goto fail; } if (lba != cacheBlockNumber_) { 2704c: 40 91 cd 0d lds r20, 0x0DCD ; 0x800dcd 27050: 50 91 ce 0d lds r21, 0x0DCE ; 0x800dce 27054: 60 91 cf 0d lds r22, 0x0DCF ; 0x800dcf 27058: 70 91 d0 0d lds r23, 0x0DD0 ; 0x800dd0 2705c: 84 17 cp r24, r20 2705e: 95 07 cpc r25, r21 27060: a6 07 cpc r26, r22 27062: b7 07 cpc r27, r23 27064: 49 f5 brne .+82 ; 0x270b8 if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; } if (fatType_ == 16) { 27066: f8 01 movw r30, r16 27068: 87 89 ldd r24, Z+23 ; 0x17 2706a: 80 31 cpi r24, 0x10 ; 16 2706c: 69 f5 brne .+90 ; 0x270c8 *value = cacheBuffer_.fat16[cluster & 0XFF]; 2706e: b7 01 movw r22, r14 27070: a6 01 movw r20, r12 27072: 55 27 eor r21, r21 27074: 66 27 eor r22, r22 27076: 77 27 eor r23, r23 27078: 44 0f add r20, r20 2707a: 55 1f adc r21, r21 2707c: 47 52 subi r20, 0x27 ; 39 2707e: 52 4f sbci r21, 0xF2 ; 242 27080: fa 01 movw r30, r20 27082: 80 81 ld r24, Z 27084: 91 81 ldd r25, Z+1 ; 0x01 27086: b0 e0 ldi r27, 0x00 ; 0 27088: a0 e0 ldi r26, 0x00 ; 0 } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2708a: 88 83 st Y, r24 2708c: 99 83 std Y+1, r25 ; 0x01 2708e: aa 83 std Y+2, r26 ; 0x02 27090: bb 83 std Y+3, r27 ; 0x03 27092: 81 e0 ldi r24, 0x01 ; 1 27094: bf cf rjmp .-130 ; 0x27014 *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 27096: 80 32 cpi r24, 0x20 ; 32 27098: 09 f0 breq .+2 ; 0x2709c 2709a: bb cf rjmp .-138 ; 0x27012 lba = fatStartBlock_ + (cluster >> 7); 2709c: c3 88 ldd r12, Z+19 ; 0x13 2709e: d4 88 ldd r13, Z+20 ; 0x14 270a0: e5 88 ldd r14, Z+21 ; 0x15 270a2: f6 88 ldd r15, Z+22 ; 0x16 270a4: db 01 movw r26, r22 270a6: ca 01 movw r24, r20 270a8: c7 e0 ldi r28, 0x07 ; 7 270aa: b6 95 lsr r27 270ac: a7 95 ror r26 270ae: 97 95 ror r25 270b0: 87 95 ror r24 270b2: ca 95 dec r28 270b4: d1 f7 brne .-12 ; 0x270aa 270b6: c2 cf rjmp .-124 ; 0x2703c } else { goto fail; } if (lba != cacheBlockNumber_) { if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; 270b8: 40 e0 ldi r20, 0x00 ; 0 270ba: bc 01 movw r22, r24 270bc: cd 01 movw r24, r26 270be: 0f 94 25 37 call 0x26e4a ; 0x26e4a 270c2: 81 11 cpse r24, r1 270c4: d0 cf rjmp .-96 ; 0x27066 270c6: a5 cf rjmp .-182 ; 0x27012 } if (fatType_ == 16) { *value = cacheBuffer_.fat16[cluster & 0XFF]; } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 270c8: b7 01 movw r22, r14 270ca: a6 01 movw r20, r12 270cc: 4f 77 andi r20, 0x7F ; 127 270ce: 55 27 eor r21, r21 270d0: 66 27 eor r22, r22 270d2: 77 27 eor r23, r23 270d4: 44 0f add r20, r20 270d6: 55 1f adc r21, r21 270d8: 44 0f add r20, r20 270da: 55 1f adc r21, r21 270dc: 47 52 subi r20, 0x27 ; 39 270de: 52 4f sbci r21, 0xF2 ; 242 270e0: fa 01 movw r30, r20 270e2: 80 81 ld r24, Z 270e4: 91 81 ldd r25, Z+1 ; 0x01 270e6: a2 81 ldd r26, Z+2 ; 0x02 270e8: b3 81 ldd r27, Z+3 ; 0x03 270ea: bf 70 andi r27, 0x0F ; 15 270ec: ce cf rjmp .-100 ; 0x2708a 000270ee : fail: return false; } //------------------------------------------------------------------------------ // return the size in bytes of a cluster chain bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { 270ee: 4f 92 push r4 270f0: 5f 92 push r5 270f2: 6f 92 push r6 270f4: 7f 92 push r7 270f6: af 92 push r10 270f8: bf 92 push r11 270fa: cf 92 push r12 270fc: df 92 push r13 270fe: ef 92 push r14 27100: ff 92 push r15 27102: 0f 93 push r16 27104: 1f 93 push r17 27106: cf 93 push r28 27108: df 93 push r29 2710a: 00 d0 rcall .+0 ; 0x2710c 2710c: 1f 92 push r1 2710e: cd b7 in r28, 0x3d ; 61 27110: de b7 in r29, 0x3e ; 62 27112: 8c 01 movw r16, r24 27114: 49 83 std Y+1, r20 ; 0x01 27116: 5a 83 std Y+2, r21 ; 0x02 27118: 6b 83 std Y+3, r22 ; 0x03 2711a: 7c 83 std Y+4, r23 ; 0x04 2711c: 59 01 movw r10, r18 uint32_t s = 0; 2711e: c1 2c mov r12, r1 27120: d1 2c mov r13, r1 27122: 76 01 movw r14, r12 do { if (!fatGet(cluster, &cluster)) goto fail; s += 512UL << clusterSizeShift_; 27124: 41 2c mov r4, r1 27126: 82 e0 ldi r24, 0x02 ; 2 27128: 58 2e mov r5, r24 2712a: 61 2c mov r6, r1 2712c: 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; 2712e: 49 81 ldd r20, Y+1 ; 0x01 27130: 5a 81 ldd r21, Y+2 ; 0x02 27132: 6b 81 ldd r22, Y+3 ; 0x03 27134: 7c 81 ldd r23, Y+4 ; 0x04 27136: 9e 01 movw r18, r28 27138: 2f 5f subi r18, 0xFF ; 255 2713a: 3f 4f sbci r19, 0xFF ; 255 2713c: c8 01 movw r24, r16 2713e: 0f 94 f4 37 call 0x26fe8 ; 0x26fe8 27142: 88 23 and r24, r24 27144: 19 f1 breq .+70 ; 0x2718c s += 512UL << clusterSizeShift_; 27146: f8 01 movw r30, r16 27148: 85 85 ldd r24, Z+13 ; 0x0d 2714a: a3 01 movw r20, r6 2714c: 92 01 movw r18, r4 2714e: 04 c0 rjmp .+8 ; 0x27158 27150: 22 0f add r18, r18 27152: 33 1f adc r19, r19 27154: 44 1f adc r20, r20 27156: 55 1f adc r21, r21 27158: 8a 95 dec r24 2715a: d2 f7 brpl .-12 ; 0x27150 2715c: da 01 movw r26, r20 2715e: c9 01 movw r24, r18 27160: c8 0e add r12, r24 27162: d9 1e adc r13, r25 27164: ea 1e adc r14, r26 27166: fb 1e adc r15, r27 } while (!isEOC(cluster)); 27168: 49 81 ldd r20, Y+1 ; 0x01 2716a: 5a 81 ldd r21, Y+2 ; 0x02 2716c: 6b 81 ldd r22, Y+3 ; 0x03 2716e: 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; 27170: 87 89 ldd r24, Z+23 ; 0x17 27172: 80 31 cpi r24, 0x10 ; 16 27174: f1 f4 brne .+60 ; 0x271b2 27176: 81 e0 ldi r24, 0x01 ; 1 27178: 48 3f cpi r20, 0xF8 ; 248 2717a: 5f 4f sbci r21, 0xFF ; 255 2717c: 61 05 cpc r22, r1 2717e: 71 05 cpc r23, r1 27180: b0 f2 brcs .-84 ; 0x2712e *size = s; 27182: f5 01 movw r30, r10 27184: c0 82 st Z, r12 27186: d1 82 std Z+1, r13 ; 0x01 27188: e2 82 std Z+2, r14 ; 0x02 2718a: f3 82 std Z+3, r15 ; 0x03 return true; fail: return false; } 2718c: 0f 90 pop r0 2718e: 0f 90 pop r0 27190: 0f 90 pop r0 27192: 0f 90 pop r0 27194: df 91 pop r29 27196: cf 91 pop r28 27198: 1f 91 pop r17 2719a: 0f 91 pop r16 2719c: ff 90 pop r15 2719e: ef 90 pop r14 271a0: df 90 pop r13 271a2: cf 90 pop r12 271a4: bf 90 pop r11 271a6: af 90 pop r10 271a8: 7f 90 pop r7 271aa: 6f 90 pop r6 271ac: 5f 90 pop r5 271ae: 4f 90 pop r4 271b0: 08 95 ret return cluster >= FAT32EOC_MIN; 271b2: 81 e0 ldi r24, 0x01 ; 1 271b4: 48 3f cpi r20, 0xF8 ; 248 271b6: 5f 4f sbci r21, 0xFF ; 255 271b8: 6f 4f sbci r22, 0xFF ; 255 271ba: 7f 40 sbci r23, 0x0F ; 15 271bc: 08 f4 brcc .+2 ; 0x271c0 271be: b7 cf rjmp .-146 ; 0x2712e 271c0: e0 cf rjmp .-64 ; 0x27182 000271c2 : vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; } bool SdFile::gfComputeNextFileBlock() { 271c2: cf 92 push r12 271c4: df 92 push r13 271c6: ef 92 push r14 271c8: ff 92 push r15 271ca: 1f 93 push r17 271cc: cf 93 push r28 271ce: df 93 push r29 271d0: ec 01 movw r28, r24 271d2: eb 81 ldd r30, Y+3 ; 0x03 // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 271d4: e1 11 cpse r30, r1 271d6: 09 c0 rjmp .+18 ; 0x271ea 271d8: 80 e0 ldi r24, 0x00 ; 0 } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; } return true; } 271da: df 91 pop r29 271dc: cf 91 pop r28 271de: 1f 91 pop r17 271e0: ff 90 pop r15 271e2: ef 90 pop r14 271e4: df 90 pop r13 271e6: cf 90 pop r12 271e8: 08 95 ret return true; } bool SdFile::gfComputeNextFileBlock() { // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 271ea: 89 81 ldd r24, Y+1 ; 0x01 271ec: 80 ff sbrs r24, 0 271ee: f4 cf rjmp .-24 ; 0x271d8 gfOffset = curPosition_ & 0X1FF; // offset in block 271f0: 48 85 ldd r20, Y+8 ; 0x08 271f2: 59 85 ldd r21, Y+9 ; 0x09 271f4: 6a 85 ldd r22, Y+10 ; 0x0a 271f6: 7b 85 ldd r23, Y+11 ; 0x0b 271f8: 9a 01 movw r18, r20 271fa: 31 70 andi r19, 0x01 ; 1 271fc: 3a a3 std Y+34, r19 ; 0x22 271fe: 29 a3 std Y+33, r18 ; 0x21 27200: 89 8d ldd r24, Y+25 ; 0x19 27202: 9a 8d ldd r25, Y+26 ; 0x1a 27204: 6a 01 movw r12, r20 27206: 7b 01 movw r14, r22 27208: f9 e0 ldi r31, 0x09 ; 9 2720a: f6 94 lsr r15 2720c: e7 94 ror r14 2720e: d7 94 ror r13 27210: c7 94 ror r12 27212: fa 95 dec r31 27214: d1 f7 brne .-12 ; 0x2720a if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 27216: e2 30 cpi r30, 0x02 ; 2 27218: 79 f4 brne .+30 ; 0x27238 // 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); 2721a: fc 01 movw r30, r24 2721c: 82 8d ldd r24, Z+26 ; 0x1a 2721e: 93 8d ldd r25, Z+27 ; 0x1b 27220: a4 8d ldd r26, Z+28 ; 0x1c 27222: b5 8d ldd r27, Z+29 ; 0x1d 27224: 8c 0d add r24, r12 27226: 9d 1d adc r25, r13 27228: ae 1d adc r26, r14 2722a: bf 1d adc r27, r15 } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; 2722c: 8d 8f std Y+29, r24 ; 0x1d 2722e: 9e 8f std Y+30, r25 ; 0x1e 27230: af 8f std Y+31, r26 ; 0x1f 27232: b8 a3 std Y+32, r27 ; 0x20 } return true; 27234: 81 e0 ldi r24, 0x01 ; 1 27236: d1 cf rjmp .-94 ; 0x271da 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);} 27238: fc 01 movw r30, r24 2723a: 14 81 ldd r17, Z+4 ; 0x04 2723c: 11 50 subi r17, 0x01 ; 1 2723e: 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) { 27240: 23 2b or r18, r19 27242: 71 f4 brne .+28 ; 0x27260 27244: 11 11 cpse r17, r1 27246: 0c c0 rjmp .+24 ; 0x27260 // start of new cluster if (curPosition_ == 0) { 27248: 45 2b or r20, r21 2724a: 46 2b or r20, r22 2724c: 47 2b or r20, r23 2724e: 31 f5 brne .+76 ; 0x2729c // use first cluster in file curCluster_ = firstCluster_; 27250: 8d 89 ldd r24, Y+21 ; 0x15 27252: 9e 89 ldd r25, Y+22 ; 0x16 27254: af 89 ldd r26, Y+23 ; 0x17 27256: b8 8d ldd r27, Y+24 ; 0x18 27258: 8c 83 std Y+4, r24 ; 0x04 2725a: 9d 83 std Y+5, r25 ; 0x05 2725c: ae 83 std Y+6, r26 ; 0x06 2725e: 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; 27260: e9 8d ldd r30, Y+25 ; 0x19 27262: fa 8d ldd r31, Y+26 ; 0x1a uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 27264: 8c 81 ldd r24, Y+4 ; 0x04 27266: 9d 81 ldd r25, Y+5 ; 0x05 27268: ae 81 ldd r26, Y+6 ; 0x06 2726a: bf 81 ldd r27, Y+7 ; 0x07 2726c: 02 97 sbiw r24, 0x02 ; 2 2726e: a1 09 sbc r26, r1 27270: b1 09 sbc r27, r1 27272: 25 85 ldd r18, Z+13 ; 0x0d 27274: 04 c0 rjmp .+8 ; 0x2727e 27276: 88 0f add r24, r24 27278: 99 1f adc r25, r25 2727a: aa 1f adc r26, r26 2727c: bb 1f adc r27, r27 2727e: 2a 95 dec r18 27280: d2 f7 brpl .-12 ; 0x27276 27282: 46 85 ldd r20, Z+14 ; 0x0e 27284: 57 85 ldd r21, Z+15 ; 0x0f 27286: 60 89 ldd r22, Z+16 ; 0x10 27288: 71 89 ldd r23, Z+17 ; 0x11 2728a: 84 0f add r24, r20 2728c: 95 1f adc r25, r21 2728e: a6 1f adc r26, r22 27290: b7 1f adc r27, r23 27292: 81 0f add r24, r17 27294: 91 1d adc r25, r1 27296: a1 1d adc r26, r1 27298: b1 1d adc r27, r1 2729a: c8 cf rjmp .-112 ; 0x2722c if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; 2729c: 4c 81 ldd r20, Y+4 ; 0x04 2729e: 5d 81 ldd r21, Y+5 ; 0x05 272a0: 6e 81 ldd r22, Y+6 ; 0x06 272a2: 7f 81 ldd r23, Y+7 ; 0x07 272a4: 9e 01 movw r18, r28 272a6: 2c 5f subi r18, 0xFC ; 252 272a8: 3f 4f sbci r19, 0xFF ; 255 272aa: 0f 94 f4 37 call 0x26fe8 ; 0x26fe8 272ae: 81 11 cpse r24, r1 272b0: d7 cf rjmp .-82 ; 0x27260 272b2: 92 cf rjmp .-220 ; 0x271d8 000272b4 : * 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) { 272b4: df 92 push r13 272b6: ef 92 push r14 272b8: ff 92 push r15 272ba: 0f 93 push r16 272bc: 1f 93 push r17 272be: cf 93 push r28 272c0: df 93 push r29 272c2: 8c 01 movw r16, r24 272c4: eb 01 movw r28, r22 272c6: 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; 272c8: 8d e0 ldi r24, 0x0D ; 13 272ca: d8 2e mov r13, r24 { longFilename[0] = '\0'; } while (1) { n = read(dir, sizeof(dir_t)); 272cc: 40 e2 ldi r20, 0x20 ; 32 272ce: 50 e0 ldi r21, 0x00 ; 0 272d0: be 01 movw r22, r28 272d2: c8 01 movw r24, r16 272d4: 0f 94 2b 72 call 0x2e456 ; 0x2e456 if (n != sizeof(dir_t)) return n == 0 ? 0 : -1; 272d8: 80 32 cpi r24, 0x20 ; 32 272da: 91 05 cpc r25, r1 272dc: 71 f0 breq .+28 ; 0x272fa 272de: 21 e0 ldi r18, 0x01 ; 1 272e0: 89 2b or r24, r25 272e2: 09 f4 brne .+2 ; 0x272e6 272e4: 20 e0 ldi r18, 0x00 ; 0 272e6: 82 2f mov r24, r18 272e8: 81 95 neg r24 } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; } } 272ea: df 91 pop r29 272ec: cf 91 pop r28 272ee: 1f 91 pop r17 272f0: 0f 91 pop r16 272f2: ff 90 pop r15 272f4: ef 90 pop r14 272f6: df 90 pop r13 272f8: 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; 272fa: 28 81 ld r18, Y 272fc: 22 23 and r18, r18 272fe: 09 f4 brne .+2 ; 0x27302 27300: 3f c0 rjmp .+126 ; 0x27380 // skip empty entries and entry for . and .. if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') continue; 27302: 25 3e cpi r18, 0xE5 ; 229 27304: 19 f3 breq .-58 ; 0x272cc 27306: 2e 32 cpi r18, 0x2E ; 46 27308: 09 f3 breq .-62 ; 0x272cc //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) 2730a: 3b 85 ldd r19, Y+11 ; 0x0b 2730c: 3f 73 andi r19, 0x3F ; 63 2730e: 3f 30 cpi r19, 0x0F ; 15 27310: 99 f5 brne .+102 ; 0x27378 27312: e1 14 cp r14, r1 27314: f1 04 cpc r15, r1 27316: 81 f1 breq .+96 ; 0x27378 { 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) 27318: 4a 8d ldd r20, Y+26 ; 0x1a 2731a: 5b 8d ldd r21, Y+27 ; 0x1b 2731c: 45 2b or r20, r21 2731e: 61 f5 brne .+88 ; 0x27378 27320: 2f 71 andi r18, 0x1F ; 31 27322: 3f ef ldi r19, 0xFF ; 255 27324: 32 0f add r19, r18 27326: 34 30 cpi r19, 0x04 ; 4 27328: 38 f5 brcc .+78 ; 0x27378 { //TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table. n = ((VFAT->sequenceNumber & 0x1F) - 1) * 13; 2732a: 21 50 subi r18, 0x01 ; 1 2732c: 33 0b sbc r19, r19 2732e: d2 9e mul r13, r18 27330: c0 01 movw r24, r0 27332: d3 9e mul r13, r19 27334: 90 0d add r25, r0 27336: 11 24 eor r1, r1 longFilename[n+0] = VFAT->name1[0]; 27338: f7 01 movw r30, r14 2733a: e8 0f add r30, r24 2733c: f9 1f adc r31, r25 2733e: 29 81 ldd r18, Y+1 ; 0x01 27340: 20 83 st Z, r18 longFilename[n+1] = VFAT->name1[1]; 27342: 2b 81 ldd r18, Y+3 ; 0x03 27344: 21 83 std Z+1, r18 ; 0x01 longFilename[n+2] = VFAT->name1[2]; 27346: 2d 81 ldd r18, Y+5 ; 0x05 27348: 22 83 std Z+2, r18 ; 0x02 longFilename[n+3] = VFAT->name1[3]; 2734a: 2f 81 ldd r18, Y+7 ; 0x07 2734c: 23 83 std Z+3, r18 ; 0x03 longFilename[n+4] = VFAT->name1[4]; 2734e: 29 85 ldd r18, Y+9 ; 0x09 27350: 24 83 std Z+4, r18 ; 0x04 longFilename[n+5] = VFAT->name2[0]; 27352: 2e 85 ldd r18, Y+14 ; 0x0e 27354: 25 83 std Z+5, r18 ; 0x05 longFilename[n+6] = VFAT->name2[1]; 27356: 28 89 ldd r18, Y+16 ; 0x10 27358: 26 83 std Z+6, r18 ; 0x06 longFilename[n+7] = VFAT->name2[2]; 2735a: 2a 89 ldd r18, Y+18 ; 0x12 2735c: 27 83 std Z+7, r18 ; 0x07 longFilename[n+8] = VFAT->name2[3]; 2735e: 2c 89 ldd r18, Y+20 ; 0x14 27360: 20 87 std Z+8, r18 ; 0x08 longFilename[n+9] = VFAT->name2[4]; 27362: 2e 89 ldd r18, Y+22 ; 0x16 27364: 21 87 std Z+9, r18 ; 0x09 longFilename[n+10] = VFAT->name2[5]; 27366: 28 8d ldd r18, Y+24 ; 0x18 27368: 22 87 std Z+10, r18 ; 0x0a longFilename[n+11] = VFAT->name3[0]; 2736a: 2c 8d ldd r18, Y+28 ; 0x1c 2736c: 23 87 std Z+11, r18 ; 0x0b longFilename[n+12] = VFAT->name3[1]; 2736e: 2e 8d ldd r18, Y+30 ; 0x1e 27370: 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) 27372: 28 81 ld r18, Y 27374: 26 fd sbrc r18, 6 longFilename[n+13] = '\0'; 27376: 15 86 std Z+13, r1 ; 0x0d } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; 27378: 2b 85 ldd r18, Y+11 ; 0x0b 2737a: 23 fd sbrc r18, 3 2737c: a7 cf rjmp .-178 ; 0x272cc 2737e: b5 cf rjmp .-150 ; 0x272ea 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; 27380: 80 e0 ldi r24, 0x00 ; 0 27382: b3 cf rjmp .-154 ; 0x272ea 00027384 : * \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() { 27384: cf 93 push r28 27386: df 93 push r29 27388: ec 01 movw r28, r24 // only allow open files and directories if (!isOpen()) goto fail; 2738a: 8b 81 ldd r24, Y+3 ; 0x03 2738c: 88 23 and r24, r24 2738e: 49 f1 breq .+82 ; 0x273e2 if (flags_ & F_FILE_DIR_DIRTY) { 27390: 89 81 ldd r24, Y+1 ; 0x01 27392: 87 ff sbrs r24, 7 27394: 22 c0 rjmp .+68 ; 0x273da dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 27396: 61 e0 ldi r22, 0x01 ; 1 27398: ce 01 movw r24, r28 2739a: 0f 94 5a 6f call 0x2deb4 ; 0x2deb4 2739e: fc 01 movw r30, r24 // check for deleted by another open file object if (!d || d->name[0] == DIR_NAME_DELETED) goto fail; 273a0: 89 2b or r24, r25 273a2: f9 f0 breq .+62 ; 0x273e2 273a4: 80 81 ld r24, Z 273a6: 85 3e cpi r24, 0xE5 ; 229 273a8: e1 f0 breq .+56 ; 0x273e2 // do not set filesize for dir files if (!isDir()) d->fileSize = fileSize_; 273aa: 8b 81 ldd r24, Y+3 ; 0x03 273ac: 82 30 cpi r24, 0x02 ; 2 273ae: 40 f4 brcc .+16 ; 0x273c0 273b0: 89 89 ldd r24, Y+17 ; 0x11 273b2: 9a 89 ldd r25, Y+18 ; 0x12 273b4: ab 89 ldd r26, Y+19 ; 0x13 273b6: bc 89 ldd r27, Y+20 ; 0x14 273b8: 84 8f std Z+28, r24 ; 0x1c 273ba: 95 8f std Z+29, r25 ; 0x1d 273bc: a6 8f std Z+30, r26 ; 0x1e 273be: b7 8f std Z+31, r27 ; 0x1f // update first cluster fields d->firstClusterLow = firstCluster_ & 0XFFFF; 273c0: 8d 89 ldd r24, Y+21 ; 0x15 273c2: 9e 89 ldd r25, Y+22 ; 0x16 273c4: 93 8f std Z+27, r25 ; 0x1b 273c6: 82 8f std Z+26, r24 ; 0x1a d->firstClusterHigh = firstCluster_ >> 16; 273c8: 8d 89 ldd r24, Y+21 ; 0x15 273ca: 9e 89 ldd r25, Y+22 ; 0x16 273cc: af 89 ldd r26, Y+23 ; 0x17 273ce: b8 8d ldd r27, Y+24 ; 0x18 273d0: b5 8b std Z+21, r27 ; 0x15 273d2: 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; 273d4: 89 81 ldd r24, Y+1 ; 0x01 273d6: 8f 77 andi r24, 0x7F ; 127 273d8: 89 83 std Y+1, r24 ; 0x01 return vol_->cacheFlush(); fail: writeError = true; return false; } 273da: df 91 pop r29 273dc: cf 91 pop r28 d->lastAccessDate = d->lastWriteDate; } // clear directory dirty flags_ &= ~F_FILE_DIR_DIRTY; } return vol_->cacheFlush(); 273de: 0d 94 e6 36 jmp 0x26dcc ; 0x26dcc fail: writeError = true; 273e2: 81 e0 ldi r24, 0x01 ; 1 273e4: 88 83 st Y, r24 return false; } 273e6: 80 e0 ldi r24, 0x00 ; 0 273e8: df 91 pop r29 273ea: cf 91 pop r28 273ec: 08 95 ret 000273ee : * \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) { 273ee: 8f 92 push r8 273f0: 9f 92 push r9 273f2: af 92 push r10 273f4: bf 92 push r11 273f6: cf 92 push r12 273f8: df 92 push r13 273fa: ef 92 push r14 273fc: ff 92 push r15 273fe: 0f 93 push r16 27400: 1f 93 push r17 27402: cf 93 push r28 27404: df 93 push r29 27406: ec 01 movw r28, r24 27408: 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; 2740a: 81 11 cpse r24, r1 2740c: 0e c0 rjmp .+28 ; 0x2742a done: return true; fail: return false; 2740e: 80 e0 ldi r24, 0x00 ; 0 } 27410: df 91 pop r29 27412: cf 91 pop r28 27414: 1f 91 pop r17 27416: 0f 91 pop r16 27418: ff 90 pop r15 2741a: ef 90 pop r14 2741c: df 90 pop r13 2741e: cf 90 pop r12 27420: bf 90 pop r11 27422: af 90 pop r10 27424: 9f 90 pop r9 27426: 8f 90 pop r8 27428: 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; 2742a: 09 89 ldd r16, Y+17 ; 0x11 2742c: 1a 89 ldd r17, Y+18 ; 0x12 2742e: 2b 89 ldd r18, Y+19 ; 0x13 27430: 3c 89 ldd r19, Y+20 ; 0x14 27432: 04 17 cp r16, r20 27434: 15 07 cpc r17, r21 27436: 26 07 cpc r18, r22 27438: 37 07 cpc r19, r23 2743a: 48 f3 brcs .-46 ; 0x2740e 2743c: 4a 01 movw r8, r20 2743e: 5b 01 movw r10, r22 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 27440: 82 30 cpi r24, 0x02 ; 2 27442: 31 f4 brne .+12 ; 0x27450 curPosition_ = pos; 27444: 88 86 std Y+8, r8 ; 0x08 27446: 99 86 std Y+9, r9 ; 0x09 27448: aa 86 std Y+10, r10 ; 0x0a 2744a: bb 86 std Y+11, r11 ; 0x0b if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; } curPosition_ = pos; done: return true; 2744c: 81 e0 ldi r24, 0x01 ; 1 2744e: e0 cf rjmp .-64 ; 0x27410 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { curPosition_ = pos; goto done; } if (pos == 0) { 27450: 81 14 cp r8, r1 27452: 91 04 cpc r9, r1 27454: a1 04 cpc r10, r1 27456: b1 04 cpc r11, r1 27458: 49 f4 brne .+18 ; 0x2746c // set position to start of file curCluster_ = 0; 2745a: 1c 82 std Y+4, r1 ; 0x04 2745c: 1d 82 std Y+5, r1 ; 0x05 2745e: 1e 82 std Y+6, r1 ; 0x06 27460: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 27462: 18 86 std Y+8, r1 ; 0x08 27464: 19 86 std Y+9, r1 ; 0x09 27466: 1a 86 std Y+10, r1 ; 0x0a 27468: 1b 86 std Y+11, r1 ; 0x0b 2746a: f0 cf rjmp .-32 ; 0x2744c goto done; } // calculate cluster index for cur and new position nCur = (curPosition_ - 1) >> (vol_->clusterSizeShift_ + 9); 2746c: 08 85 ldd r16, Y+8 ; 0x08 2746e: 19 85 ldd r17, Y+9 ; 0x09 27470: 2a 85 ldd r18, Y+10 ; 0x0a 27472: 3b 85 ldd r19, Y+11 ; 0x0b 27474: e9 8d ldd r30, Y+25 ; 0x19 27476: fa 8d ldd r31, Y+26 ; 0x1a 27478: 85 85 ldd r24, Z+13 ; 0x0d 2747a: 90 e0 ldi r25, 0x00 ; 0 2747c: 09 96 adiw r24, 0x09 ; 9 2747e: b9 01 movw r22, r18 27480: a8 01 movw r20, r16 27482: 41 50 subi r20, 0x01 ; 1 27484: 51 09 sbc r21, r1 27486: 61 09 sbc r22, r1 27488: 71 09 sbc r23, r1 2748a: 08 2e mov r0, r24 2748c: 04 c0 rjmp .+8 ; 0x27496 2748e: 76 95 lsr r23 27490: 67 95 ror r22 27492: 57 95 ror r21 27494: 47 95 ror r20 27496: 0a 94 dec r0 27498: d2 f7 brpl .-12 ; 0x2748e nNew = (pos - 1) >> (vol_->clusterSizeShift_ + 9); 2749a: 75 01 movw r14, r10 2749c: 64 01 movw r12, r8 2749e: e1 e0 ldi r30, 0x01 ; 1 274a0: ce 1a sub r12, r30 274a2: d1 08 sbc r13, r1 274a4: e1 08 sbc r14, r1 274a6: f1 08 sbc r15, r1 274a8: 04 c0 rjmp .+8 ; 0x274b2 274aa: f6 94 lsr r15 274ac: e7 94 ror r14 274ae: d7 94 ror r13 274b0: c7 94 ror r12 274b2: 8a 95 dec r24 274b4: d2 f7 brpl .-12 ; 0x274aa if (nNew < nCur || curPosition_ == 0) { 274b6: c4 16 cp r12, r20 274b8: d5 06 cpc r13, r21 274ba: e6 06 cpc r14, r22 274bc: f7 06 cpc r15, r23 274be: 20 f0 brcs .+8 ; 0x274c8 274c0: 01 2b or r16, r17 274c2: 02 2b or r16, r18 274c4: 03 2b or r16, r19 274c6: 11 f5 brne .+68 ; 0x2750c // must follow chain from first cluster curCluster_ = firstCluster_; 274c8: 8d 89 ldd r24, Y+21 ; 0x15 274ca: 9e 89 ldd r25, Y+22 ; 0x16 274cc: af 89 ldd r26, Y+23 ; 0x17 274ce: b8 8d ldd r27, Y+24 ; 0x18 274d0: 8c 83 std Y+4, r24 ; 0x04 274d2: 9d 83 std Y+5, r25 ; 0x05 274d4: ae 83 std Y+6, r26 ; 0x06 274d6: bf 83 std Y+7, r27 ; 0x07 } else { // advance from curPosition nNew -= nCur; } while (nNew--) { if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 274d8: 8e 01 movw r16, r28 274da: 0c 5f subi r16, 0xFC ; 252 274dc: 1f 4f sbci r17, 0xFF ; 255 curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; } while (nNew--) { 274de: c1 14 cp r12, r1 274e0: d1 04 cpc r13, r1 274e2: e1 04 cpc r14, r1 274e4: f1 04 cpc r15, r1 274e6: 09 f4 brne .+2 ; 0x274ea 274e8: ad cf rjmp .-166 ; 0x27444 if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 274ea: 4c 81 ldd r20, Y+4 ; 0x04 274ec: 5d 81 ldd r21, Y+5 ; 0x05 274ee: 6e 81 ldd r22, Y+6 ; 0x06 274f0: 7f 81 ldd r23, Y+7 ; 0x07 274f2: 98 01 movw r18, r16 274f4: 89 8d ldd r24, Y+25 ; 0x19 274f6: 9a 8d ldd r25, Y+26 ; 0x1a 274f8: 0f 94 f4 37 call 0x26fe8 ; 0x26fe8 274fc: 91 e0 ldi r25, 0x01 ; 1 274fe: c9 1a sub r12, r25 27500: d1 08 sbc r13, r1 27502: e1 08 sbc r14, r1 27504: f1 08 sbc r15, r1 27506: 81 11 cpse r24, r1 27508: ea cf rjmp .-44 ; 0x274de 2750a: 81 cf rjmp .-254 ; 0x2740e if (nNew < nCur || curPosition_ == 0) { // must follow chain from first cluster curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; 2750c: c4 1a sub r12, r20 2750e: d5 0a sbc r13, r21 27510: e6 0a sbc r14, r22 27512: f7 0a sbc r15, r23 27514: e1 cf rjmp .-62 ; 0x274d8 00027516 : 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() { 27516: cf 93 push r28 27518: df 93 push r29 if (MMU2::mmu2.Enabled()) { 2751a: 80 91 94 12 lds r24, 0x1294 ; 0x801294 2751e: 81 30 cpi r24, 0x01 ; 1 27520: e9 f4 brne .+58 ; 0x2755c const uint8_t filament = choose_menu_P( 27522: 85 ee ldi r24, 0xE5 ; 229 27524: 9d e4 ldi r25, 0x4D ; 77 27526: 0e 94 a7 6c call 0xd94e ; 0xd94e 2752a: ec 01 movw r28, r24 2752c: 84 e2 ldi r24, 0x24 ; 36 2752e: 9e e3 ldi r25, 0x3E ; 62 27530: 0e 94 a7 6c call 0xd94e ; 0xd94e _T(MSG_SELECT_FILAMENT), MSG_FILAMENT,_T(MSG_CANCEL)); 27534: be 01 movw r22, r28 27536: 0e 94 e7 bc call 0x179ce ; 0x179ce if (filament < MMU_FILAMENT_COUNT) { 2753a: 85 30 cpi r24, 0x05 ; 5 2753c: a0 f5 brcc .+104 ; 0x275a6 lay1cal_filament = filament; 2753e: 80 93 af 03 sts 0x03AF, r24 ; 0x8003af <_ZL16lay1cal_filament.lto_priv.409> return; } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; 27542: 8a e0 ldi r24, 0x0A ; 10 27544: 80 93 62 03 sts 0x0362, r24 ; 0x800362 menu_goto(lcd_generic_preheat_menu, 0, true); 27548: 20 e0 ldi r18, 0x00 ; 0 2754a: 41 e0 ldi r20, 0x01 ; 1 2754c: 70 e0 ldi r23, 0x00 ; 0 2754e: 60 e0 ldi r22, 0x00 ; 0 27550: 87 e0 ldi r24, 0x07 ; 7 27552: 97 e3 ldi r25, 0x37 ; 55 } 27554: df 91 pop r29 27556: cf 91 pop r28 } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); 27558: 0d 94 a5 93 jmp 0x3274a ; 0x3274a menu_back(); return; } } #ifdef FILAMENT_SENSOR else if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 2755c: 8f e5 ldi r24, 0x5F ; 95 2755e: 9f e0 ldi r25, 0x0F ; 15 27560: 0f 94 9b a0 call 0x34136 ; 0x34136 27564: 81 11 cpse r24, r1 27566: ed cf rjmp .-38 ; 0x27542 { bool loaded = false; if (fsensor.isReady()) { 27568: 80 91 84 16 lds r24, 0x1684 ; 0x801684 2756c: 82 30 cpi r24, 0x02 ; 2 2756e: f9 f4 brne .+62 ; 0x275ae loaded = fsensor.getFilamentPresent(); 27570: 0e 94 f9 c3 call 0x187f2 ; 0x187f2 27574: 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) { 27576: 91 11 cpse r25, r1 27578: e4 cf rjmp .-56 ; 0x27542 lcd_display_message_fullscreen_P(_T(MSG_PLEASE_LOAD_PLA)); 2757a: 87 ec ldi r24, 0xC7 ; 199 2757c: 9d e4 ldi r25, 0x4D ; 77 2757e: 0e 94 a7 6c call 0xd94e ; 0xd94e 27582: 0f 94 22 0b call 0x21644 ; 0x21644 lcd_consume_click(); 27586: 0e 94 89 6b call 0xd712 ; 0xd712 2758a: c4 e1 ldi r28, 0x14 ; 20 for (uint_least8_t i = 0; i < 20; i++) { //wait max. 2s delay_keep_alive(100); 2758c: 84 e6 ldi r24, 0x64 ; 100 2758e: 90 e0 ldi r25, 0x00 ; 0 27590: 0e 94 45 7c call 0xf88a ; 0xf88a if (lcd_clicked()) { 27594: 0e 94 8e 6b call 0xd71c ; 0xd71c 27598: 81 11 cpse r24, r1 2759a: 02 c0 rjmp .+4 ; 0x275a0 2759c: 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 2759e: b1 f7 brne .-20 ; 0x2758c delay_keep_alive(100); if (lcd_clicked()) { break; } } lcd_update_enabled = true; 275a0: 81 e0 ldi r24, 0x01 ; 1 275a2: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); } 275a6: df 91 pop r29 275a8: cf 91 pop r28 if (lcd_clicked()) { break; } } lcd_update_enabled = true; menu_back(); 275aa: 0d 94 43 96 jmp 0x32c86 ; 0x32c86 { 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); 275ae: 80 ee ldi r24, 0xE0 ; 224 275b0: 92 e5 ldi r25, 0x52 ; 82 275b2: 0e 94 a7 6c call 0xd94e ; 0xd94e 275b6: 41 e0 ldi r20, 0x01 ; 1 275b8: 60 e0 ldi r22, 0x00 ; 0 275ba: 0f 94 8a 2e call 0x25d14 ; 0x25d14 275be: 91 e0 ldi r25, 0x01 ; 1 275c0: 81 11 cpse r24, r1 275c2: 90 e0 ldi r25, 0x00 ; 0 lcd_update_enabled = true; 275c4: 81 e0 ldi r24, 0x01 ; 1 275c6: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c 275ca: d5 cf rjmp .-86 ; 0x27576 000275cc : 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()") { 275cc: cf 93 push r28 275ce: 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); 275d2: c3 b1 in r28, 0x03 ; 3 lcd_puts_at_P(0, 0, MSG_PINDA); 275d4: 48 e3 ldi r20, 0x38 ; 56 275d6: 5b e6 ldi r21, 0x6B ; 107 275d8: 60 e0 ldi r22, 0x00 ; 0 275da: 80 e0 ldi r24, 0x00 ; 0 275dc: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_set_cursor(LCD_WIDTH - 14, 0); 275e0: 60 e0 ldi r22, 0x00 ; 0 275e2: 86 e0 ldi r24, 0x06 ; 6 275e4: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_print_state(pinda_state); 275e8: c4 fb bst r28, 4 275ea: 88 27 eor r24, r24 275ec: 80 f9 bld r24, 0 275ee: 0f 94 34 03 call 0x20668 ; 0x20668 if (MMU2::mmu2.Enabled()) { 275f2: 80 91 94 12 lds r24, 0x1294 ; 0x801294 275f6: 81 30 cpi r24, 0x01 ; 1 275f8: 99 f4 brne .+38 ; 0x27620 inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 275fa: c1 e0 ldi r28, 0x01 ; 1 275fc: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 27600: 81 11 cpse r24, r1 27602: 01 c0 rjmp .+2 ; 0x27606 27604: 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 27606: 42 e3 ldi r20, 0x32 ; 50 27608: 5b e6 ldi r21, 0x6B ; 107 2760a: 60 e0 ldi r22, 0x00 ; 0 2760c: 8a e0 ldi r24, 0x0A ; 10 2760e: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_set_cursor(LCD_WIDTH - 3, 0); 27612: 60 e0 ldi r22, 0x00 ; 0 27614: 81 e1 ldi r24, 0x11 ; 17 27616: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_print_state(finda_state); 2761a: 8c 2f mov r24, r28 2761c: 0f 94 34 03 call 0x20668 ; 0x20668 } #ifdef FILAMENT_SENSOR idler_state = fsensor.getFilamentPresent(); 27620: 0e 94 f9 c3 call 0x187f2 ; 0x187f2 27624: c8 2f mov r28, r24 lcd_puts_at_P(0, 1, _T(MSG_FSENSOR)); 27626: 8d e4 ldi r24, 0x4D ; 77 27628: 9d e3 ldi r25, 0x3D ; 61 2762a: 0e 94 a7 6c call 0xd94e ; 0xd94e 2762e: ac 01 movw r20, r24 27630: 61 e0 ldi r22, 0x01 ; 1 27632: 80 e0 ldi r24, 0x00 ; 0 27634: 0e 94 85 69 call 0xd30a ; 0xd30a lcd_set_cursor(LCD_WIDTH - 3, 1); 27638: 61 e0 ldi r22, 0x01 ; 1 2763a: 81 e1 ldi r24, 0x11 ; 17 2763c: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_print_state(idler_state); 27640: 8c 2f mov r24, r28 27642: 0f 94 34 03 call 0x20668 ; 0x20668 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(); } 27646: 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(); 27648: 0d 94 e5 96 jmp 0x32dca ; 0x32dca 0002764c : } // 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; 2764c: e2 e0 ldi r30, 0x02 ; 2 2764e: f6 e1 ldi r31, 0x16 ; 22 27650: 40 81 ld r20, Z 27652: 51 81 ldd r21, Z+1 ; 0x01 27654: 62 81 ldd r22, Z+2 ; 0x02 27656: 73 81 ldd r23, Z+3 ; 0x03 27658: 48 0f add r20, r24 2765a: 59 1f adc r21, r25 2765c: 61 1d adc r22, r1 2765e: 71 1d adc r23, r1 27660: 40 83 st Z, r20 27662: 51 83 std Z+1, r21 ; 0x01 27664: 62 83 std Z+2, r22 ; 0x02 27666: 73 83 std Z+3, r23 ; 0x03 } 27668: 08 95 ret 0002766a : 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){ 2766a: 2f 92 push r2 2766c: 3f 92 push r3 2766e: 4f 92 push r4 27670: 5f 92 push r5 27672: 6f 92 push r6 27674: 7f 92 push r7 27676: 8f 92 push r8 27678: 9f 92 push r9 2767a: af 92 push r10 2767c: bf 92 push r11 2767e: cf 92 push r12 27680: df 92 push r13 27682: ef 92 push r14 27684: ff 92 push r15 27686: 0f 93 push r16 27688: 1f 93 push r17 2768a: cf 93 push r28 2768c: df 93 push r29 2768e: 00 d0 rcall .+0 ; 0x27690 27690: 1f 92 push r1 27692: 1f 92 push r1 27694: cd b7 in r28, 0x3d ; 61 27696: de b7 in r29, 0x3e ; 62 27698: 1c 01 movw r2, r24 2769a: 2a 01 movw r4, r20 2769c: 3b 01 movw r6, r22 2769e: 00 e2 ldi r16, 0x20 ; 32 276a0: 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){ 276a2: 19 82 std Y+1, r1 ; 0x01 276a4: 99 81 ldd r25, Y+1 ; 0x01 276a6: 89 2f mov r24, r25 276a8: 90 e0 ldi r25, 0x00 ; 0 276aa: 9b 83 std Y+3, r25 ; 0x03 276ac: 8a 83 std Y+2, r24 ; 0x02 276ae: 80 17 cp r24, r16 276b0: 91 07 cpc r25, r17 276b2: 9c f5 brge .+102 ; 0x2771a if (points[j] > points[j + 1]) 276b4: 88 0f add r24, r24 276b6: 99 1f adc r25, r25 276b8: 88 0f add r24, r24 276ba: 99 1f adc r25, r25 276bc: 9d 83 std Y+5, r25 ; 0x05 276be: 8c 83 std Y+4, r24 ; 0x04 276c0: 82 0d add r24, r2 276c2: 93 1d adc r25, r3 276c4: 9b 83 std Y+3, r25 ; 0x03 276c6: 8a 83 std Y+2, r24 ; 0x02 276c8: fc 01 movw r30, r24 276ca: c0 80 ld r12, Z 276cc: d1 80 ldd r13, Z+1 ; 0x01 276ce: e2 80 ldd r14, Z+2 ; 0x02 276d0: f3 80 ldd r15, Z+3 ; 0x03 276d2: 8c 81 ldd r24, Y+4 ; 0x04 276d4: 9d 81 ldd r25, Y+5 ; 0x05 276d6: 04 96 adiw r24, 0x04 ; 4 276d8: 82 0d add r24, r2 276da: 93 1d adc r25, r3 276dc: 9d 83 std Y+5, r25 ; 0x05 276de: 8c 83 std Y+4, r24 ; 0x04 276e0: fc 01 movw r30, r24 276e2: 80 80 ld r8, Z 276e4: 91 80 ldd r9, Z+1 ; 0x01 276e6: a2 80 ldd r10, Z+2 ; 0x02 276e8: b3 80 ldd r11, Z+3 ; 0x03 276ea: a5 01 movw r20, r10 276ec: 94 01 movw r18, r8 276ee: c7 01 movw r24, r14 276f0: b6 01 movw r22, r12 276f2: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 276f6: 18 16 cp r1, r24 276f8: 64 f4 brge .+24 ; 0x27712 SWAP(points[j], points[j + 1]); 276fa: ea 81 ldd r30, Y+2 ; 0x02 276fc: fb 81 ldd r31, Y+3 ; 0x03 276fe: 80 82 st Z, r8 27700: 91 82 std Z+1, r9 ; 0x01 27702: a2 82 std Z+2, r10 ; 0x02 27704: b3 82 std Z+3, r11 ; 0x03 27706: ec 81 ldd r30, Y+4 ; 0x04 27708: fd 81 ldd r31, Y+5 ; 0x05 2770a: c0 82 st Z, r12 2770c: d1 82 std Z+1, r13 ; 0x01 2770e: e2 82 std Z+2, r14 ; 0x02 27710: 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){ 27712: f9 81 ldd r31, Y+1 ; 0x01 27714: ff 5f subi r31, 0xFF ; 255 27716: f9 83 std Y+1, r31 ; 0x01 27718: c5 cf rjmp .-118 ; 0x276a4 2771a: 01 50 subi r16, 0x01 ; 1 2771c: 11 09 sbc r17, r1 2771e: 08 f6 brcc .-126 ; 0x276a2 /// 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]; 27720: f1 01 movw r30, r2 27722: e0 5c subi r30, 0xC0 ; 192 27724: 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); 27726: 20 81 ld r18, Z 27728: 31 81 ldd r19, Z+1 ; 0x01 2772a: 42 81 ldd r20, Z+2 ; 0x02 2772c: 53 81 ldd r21, Z+3 ; 0x03 2772e: c3 01 movw r24, r6 27730: b2 01 movw r22, r4 27732: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 27736: 6b 01 movw r12, r22 27738: 7c 01 movw r14, r24 2773a: 20 e0 ldi r18, 0x00 ; 0 2773c: 30 e0 ldi r19, 0x00 ; 0 2773e: 40 e0 ldi r20, 0x00 ; 0 27740: 5f eb ldi r21, 0xBF ; 191 27742: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 27746: 87 fd sbrc r24, 7 27748: 10 c0 rjmp .+32 ; 0x2776a 2774a: 20 e0 ldi r18, 0x00 ; 0 2774c: 30 e0 ldi r19, 0x00 ; 0 2774e: 40 e0 ldi r20, 0x00 ; 0 27750: 5f e3 ldi r21, 0x3F ; 63 27752: c7 01 movw r24, r14 27754: b6 01 movw r22, r12 27756: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 2775a: 18 16 cp r1, r24 2775c: 5c f4 brge .+22 ; 0x27774 2775e: c1 2c mov r12, r1 27760: d1 2c mov r13, r1 27762: e1 2c mov r14, r1 27764: 8f e3 ldi r24, 0x3F ; 63 27766: f8 2e mov r15, r24 27768: 05 c0 rjmp .+10 ; 0x27774 2776a: c1 2c mov r12, r1 2776c: d1 2c mov r13, r1 2776e: e1 2c mov r14, r1 27770: 9f eb ldi r25, 0xBF ; 191 27772: f9 2e mov r15, r25 } 27774: c7 01 movw r24, r14 27776: b6 01 movw r22, r12 27778: 0f 90 pop r0 2777a: 0f 90 pop r0 2777c: 0f 90 pop r0 2777e: 0f 90 pop r0 27780: 0f 90 pop r0 27782: df 91 pop r29 27784: cf 91 pop r28 27786: 1f 91 pop r17 27788: 0f 91 pop r16 2778a: ff 90 pop r15 2778c: ef 90 pop r14 2778e: df 90 pop r13 27790: cf 90 pop r12 27792: bf 90 pop r11 27794: af 90 pop r10 27796: 9f 90 pop r9 27798: 8f 90 pop r8 2779a: 7f 90 pop r7 2779c: 6f 90 pop r6 2779e: 5f 90 pop r5 277a0: 4f 90 pop r4 277a2: 3f 90 pop r3 277a4: 2f 90 pop r2 277a6: 08 95 ret 000277a8 : bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); } void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); 277a8: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 277ac: 60 93 34 12 sts 0x1234, r22 ; 0x801234 277b0: 70 93 35 12 sts 0x1235, r23 ; 0x801235 277b4: 80 93 36 12 sts 0x1236, r24 ; 0x801236 277b8: 90 93 37 12 sts 0x1237, r25 ; 0x801237 } 277bc: 08 95 ret 000277be : } return (uint8_t)ReqMsg().code; } void ProtocolLogic::DecrementRetryAttempts() { if (inAutoRetry && retryAttempts) { 277be: 80 91 7a 12 lds r24, 0x127A ; 0x80127a 277c2: 88 23 and r24, r24 277c4: 69 f0 breq .+26 ; 0x277e0 277c6: 80 91 79 12 lds r24, 0x1279 ; 0x801279 277ca: 88 23 and r24, r24 277cc: 49 f0 breq .+18 ; 0x277e0 SERIAL_ECHOLNPGM("DecrementRetryAttempts"); 277ce: 88 ed ldi r24, 0xD8 ; 216 277d0: 9c e9 ldi r25, 0x9C ; 156 277d2: 0e 94 49 72 call 0xe492 ; 0xe492 retryAttempts--; 277d6: 80 91 79 12 lds r24, 0x1279 ; 0x801279 277da: 81 50 subi r24, 0x01 ; 1 277dc: 80 93 79 12 sts 0x1279, r24 ; 0x801279 } } 277e0: 08 95 ret 000277e2 : MMU2_ECHO_MSGLN(tmp); } strncpy(lastMsg, tmp, rqs); } void ProtocolLogic::LogError(const char *reason_P) { 277e2: 9f 92 push r9 277e4: af 92 push r10 277e6: bf 92 push r11 277e8: cf 92 push r12 277ea: df 92 push r13 277ec: ef 92 push r14 277ee: ff 92 push r15 277f0: 0f 93 push r16 277f2: 1f 93 push r17 277f4: cf 93 push r28 277f6: df 93 push r29 277f8: cd b7 in r28, 0x3d ; 61 277fa: de b7 in r29, 0x3e ; 62 277fc: e0 97 sbiw r28, 0x30 ; 48 277fe: 0f b6 in r0, 0x3f ; 63 27800: f8 94 cli 27802: de bf out 0x3e, r29 ; 62 27804: 0f be out 0x3f, r0 ; 63 27806: cd bf out 0x3d, r28 ; 61 27808: 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()]; 2780a: e0 90 62 12 lds r14, 0x1262 ; 0x801262 2780e: fe 01 movw r30, r28 27810: 31 96 adiw r30, 0x01 ; 1 27812: 21 e0 ldi r18, 0x01 ; 1 27814: 30 e0 ldi r19, 0x00 ; 0 27816: 5f 01 movw r10, r30 27818: f1 2c mov r15, r1 2781a: 40 e1 ldi r20, 0x10 ; 16 2781c: c4 2e mov r12, r20 2781e: d1 2c mov r13, r1 dst[i * 3] = NibbleToChar(b >> 4); dst[i * 3 + 1] = NibbleToChar(b & 0xf); dst[i * 3 + 2] = ' '; 27820: 50 e2 ldi r21, 0x20 ; 32 27822: 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()]; 27824: c7 01 movw r24, r14 27826: 82 1b sub r24, r18 27828: 93 0b sbc r25, r19 2782a: b6 01 movw r22, r12 2782c: 0f 94 78 a1 call 0x342f0 ; 0x342f0 <__divmodhi4> 27830: dc 01 movw r26, r24 27832: bb 27 eor r27, r27 27834: ab 5d subi r26, 0xDB ; 219 27836: bd 4e sbci r27, 0xED ; 237 27838: 9d 96 adiw r26, 0x2d ; 45 2783a: 8c 91 ld r24, X dst[i * 3] = NibbleToChar(b >> 4); 2783c: 48 2f mov r20, r24 2783e: 50 e0 ldi r21, 0x00 ; 0 27840: 94 e0 ldi r25, 0x04 ; 4 27842: 55 95 asr r21 27844: 47 95 ror r20 27846: 9a 95 dec r25 27848: e1 f7 brne .-8 ; 0x27842 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2784a: 96 ef ldi r25, 0xF6 ; 246 2784c: 94 0f add r25, r20 2784e: 96 30 cpi r25, 0x06 ; 6 27850: a8 f1 brcs .+106 ; 0x278bc case 5: case 6: case 7: case 8: case 9: return c + '0'; 27852: 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); 27854: 40 83 st Z, r20 dst[i * 3 + 1] = NibbleToChar(b & 0xf); 27856: 8f 70 andi r24, 0x0F ; 15 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 27858: 96 ef ldi r25, 0xF6 ; 246 2785a: 98 0f add r25, r24 2785c: 96 30 cpi r25, 0x06 ; 6 2785e: 80 f1 brcs .+96 ; 0x278c0 case 5: case 6: case 7: case 8: case 9: return c + '0'; 27860: 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); 27862: 81 83 std Z+1, r24 ; 0x01 dst[i * 3 + 2] = ' '; 27864: 92 82 std Z+2, r9 ; 0x02 27866: 2f 5f subi r18, 0xFF ; 255 27868: 3f 4f sbci r19, 0xFF ; 255 2786a: 33 96 adiw r30, 0x03 ; 3 return 0; } } void ProtocolLogic::FormatLastReceivedBytes(char *dst) { for (uint8_t i = 0; i < lastReceivedBytes.size(); ++i) { 2786c: 21 31 cpi r18, 0x11 ; 17 2786e: 31 05 cpc r19, r1 27870: c9 f6 brne .-78 ; 0x27824 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 27872: 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); 27874: 81 e6 ldi r24, 0x61 ; 97 27876: 9d e9 ldi r25, 0x9D ; 157 27878: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 2787c: 8b e5 ldi r24, 0x5B ; 91 2787e: 9d e9 ldi r25, 0x9D ; 157 27880: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 27884: c8 01 movw r24, r16 27886: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOPGM(", last bytes: "); 2788a: 83 e0 ldi r24, 0x03 ; 3 2788c: 9d e9 ldi r25, 0x9D ; 157 2788e: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLN(lrb); 27892: c5 01 movw r24, r10 27894: 0f 94 bc 99 call 0x33378 ; 0x33378 } 27898: e0 96 adiw r28, 0x30 ; 48 2789a: 0f b6 in r0, 0x3f ; 63 2789c: f8 94 cli 2789e: de bf out 0x3e, r29 ; 62 278a0: 0f be out 0x3f, r0 ; 63 278a2: cd bf out 0x3d, r28 ; 61 278a4: df 91 pop r29 278a6: cf 91 pop r28 278a8: 1f 91 pop r17 278aa: 0f 91 pop r16 278ac: ff 90 pop r15 278ae: ef 90 pop r14 278b0: df 90 pop r13 278b2: cf 90 pop r12 278b4: bf 90 pop r11 278b6: af 90 pop r10 278b8: 9f 90 pop r9 278ba: 08 95 ret case 11: case 12: case 13: case 14: case 15: return (c - 10) + 'a'; 278bc: 49 5a subi r20, 0xA9 ; 169 278be: ca cf rjmp .-108 ; 0x27854 278c0: 89 5a subi r24, 0xA9 ; 169 278c2: cf cf rjmp .-98 ; 0x27862 000278c4 : char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { 278c4: 9c 01 movw r18, r24 SERIAL_ECHOLNPGM("RSTCommTimeout"); dataTO.Reset(); } bool DropOutFilter::Record(StepStatus ss) { if (occurrences == maxOccurrences) { 278c6: 90 91 39 12 lds r25, 0x1239 ; 0x801239 278ca: 9a 30 cpi r25, 0x0A ; 10 278cc: 11 f4 brne .+4 ; 0x278d2 cause = ss; 278ce: 60 93 38 12 sts 0x1238, r22 ; 0x801238 } --occurrences; 278d2: 91 50 subi r25, 0x01 ; 1 278d4: 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)) { 278d8: 91 11 cpse r25, r1 278da: 0d c0 rjmp .+26 ; 0x278f6 278dc: c9 01 movw r24, r18 LogError(msg_P); 278de: 0f 94 f1 3b call 0x277e2 ; 0x277e2 SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 278e2: 84 ef ldi r24, 0xF4 ; 244 278e4: 9c e9 ldi r25, 0x9C ; 156 278e6: 0e 94 49 72 call 0xe492 ; 0xe492 /// @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; } 278ea: 8a e0 ldi r24, 0x0A ; 10 278ec: 80 93 39 12 sts 0x1239, r24 ; 0x801239 278f0: 80 91 38 12 lds r24, 0x1238 ; 0x801238 278f4: 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 278f6: 80 e0 ldi r24, 0x00 ; 0 } } 278f8: 08 95 ret 000278fa : } *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) { 278fa: cf 93 push r28 278fc: df 93 push r29 278fe: cd b7 in r28, 0x3d ; 61 27900: de b7 in r29, 0x3e ; 62 27902: 2e 97 sbiw r28, 0x0e ; 14 27904: 0f b6 in r0, 0x3f ; 63 27906: f8 94 cli 27908: de bf out 0x3e, r29 ; 62 2790a: 0f be out 0x3f, r0 ; 63 2790c: cd bf out 0x3d, r28 ; 61 constexpr uint_fast8_t rqs = modules::protocol::Protocol::MaxRequestSize() + 1; char tmp[rqs] = ">"; 2790e: 2e e3 ldi r18, 0x3E ; 62 27910: 30 e0 ldi r19, 0x00 ; 0 27912: 3a 83 std Y+2, r19 ; 0x02 27914: 29 83 std Y+1, r18 ; 0x01 27916: fe 01 movw r30, r28 27918: 33 96 adiw r30, 0x03 ; 3 2791a: 2c e0 ldi r18, 0x0C ; 12 2791c: df 01 movw r26, r30 2791e: 1d 92 st X+, r1 27920: 2a 95 dec r18 27922: e9 f7 brne .-6 ; 0x2791e 27924: de 01 movw r26, r28 27926: 12 96 adiw r26, 0x02 ; 2 27928: 48 2f mov r20, r24 2792a: fc 01 movw r30, r24 2792c: 9d 01 movw r18, r26 static char lastMsg[rqs] = ""; for (uint8_t i = 0; i < size; ++i) { 2792e: 8e 2f mov r24, r30 27930: 84 1b sub r24, r20 27932: 86 17 cp r24, r22 27934: 40 f4 brcc .+16 ; 0x27946 uint8_t b = txbuff[i]; 27936: 81 91 ld r24, Z+ // Check for printable character, including space if (b < 32 || b > 127) { 27938: 90 ee ldi r25, 0xE0 ; 224 2793a: 98 0f add r25, r24 2793c: 90 36 cpi r25, 0x60 ; 96 2793e: 08 f0 brcs .+2 ; 0x27942 b = '.'; 27940: 8e e2 ldi r24, 0x2E ; 46 } tmp[i + 1] = b; 27942: 8d 93 st X+, r24 27944: f4 cf rjmp .-24 ; 0x2792e } tmp[size + 1] = 0; 27946: f9 01 movw r30, r18 27948: e6 0f add r30, r22 2794a: f1 1d adc r31, r1 2794c: 10 82 st Z, r1 if (!strncmp_P(tmp, PSTR(">S0*c6."), rqs) && !strncmp(lastMsg, tmp, rqs)) { 2794e: 4e e0 ldi r20, 0x0E ; 14 27950: 50 e0 ldi r21, 0x00 ; 0 27952: 67 e6 ldi r22, 0x67 ; 103 27954: 7d e9 ldi r23, 0x9D ; 157 27956: ce 01 movw r24, r28 27958: 01 96 adiw r24, 0x01 ; 1 2795a: 0f 94 7a 9e call 0x33cf4 ; 0x33cf4 2795e: 89 2b or r24, r25 27960: 59 f4 brne .+22 ; 0x27978 27962: 4e e0 ldi r20, 0x0E ; 14 27964: 50 e0 ldi r21, 0x00 ; 0 27966: be 01 movw r22, r28 27968: 6f 5f subi r22, 0xFF ; 255 2796a: 7f 4f sbci r23, 0xFF ; 255 2796c: 85 e1 ldi r24, 0x15 ; 21 2796e: 92 e1 ldi r25, 0x12 ; 18 27970: 0f 94 0d a7 call 0x34e1a ; 0x34e1a 27974: 89 2b or r24, r25 27976: 61 f0 breq .+24 ; 0x27990 // 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); 27978: 81 e6 ldi r24, 0x61 ; 97 2797a: 9d e9 ldi r25, 0x9D ; 157 2797c: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 27980: 8b e5 ldi r24, 0x5B ; 91 27982: 9d e9 ldi r25, 0x9D ; 157 27984: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 27988: ce 01 movw r24, r28 2798a: 01 96 adiw r24, 0x01 ; 1 2798c: 0f 94 bc 99 call 0x33378 ; 0x33378 } strncpy(lastMsg, tmp, rqs); 27990: 4e e0 ldi r20, 0x0E ; 14 27992: 50 e0 ldi r21, 0x00 ; 0 27994: be 01 movw r22, r28 27996: 6f 5f subi r22, 0xFF ; 255 27998: 7f 4f sbci r23, 0xFF ; 255 2799a: 85 e1 ldi r24, 0x15 ; 21 2799c: 92 e1 ldi r25, 0x12 ; 18 2799e: 0f 94 1b a7 call 0x34e36 ; 0x34e36 } 279a2: 2e 96 adiw r28, 0x0e ; 14 279a4: 0f b6 in r0, 0x3f ; 63 279a6: f8 94 cli 279a8: de bf out 0x3e, r29 ; 62 279aa: 0f be out 0x3f, r0 ; 63 279ac: cd bf out 0x3d, r28 ; 61 279ae: df 91 pop r29 279b0: cf 91 pop r28 279b2: 08 95 ret 000279b4 : return CommunicationTimeout; } return Processing; } void ProtocolLogic::SendMsg(RequestMsg rq) { 279b4: cf 92 push r12 279b6: df 92 push r13 279b8: ef 92 push r14 279ba: ff 92 push r15 279bc: 1f 93 push r17 279be: cf 93 push r28 279c0: df 93 push r29 279c2: cd b7 in r28, 0x3d ; 61 279c4: de b7 in r29, 0x3e ; 62 279c6: 62 97 sbiw r28, 0x12 ; 18 279c8: 0f b6 in r0, 0x3f ; 63 279ca: f8 94 cli 279cc: de bf out 0x3e, r29 ; 62 279ce: 0f be out 0x3f, r0 ; 63 279d0: cd bf out 0x3d, r28 ; 61 279d2: 4e 87 std Y+14, r20 ; 0x0e 279d4: 5f 87 std Y+15, r21 ; 0x0f 279d6: 68 8b std Y+16, r22 ; 0x10 279d8: 79 8b std Y+17, r23 ; 0x11 279da: 8a 8b std Y+18, r24 ; 0x12 } } } uint8_t Protocol::EncodeRequest(const RequestMsg &msg, uint8_t *txbuff) { txbuff[0] = (uint8_t)msg.code; 279dc: 49 83 std Y+1, r20 ; 0x01 uint8_t i = 1 + UInt8ToHex(msg.value, txbuff + 1); 279de: 85 2f mov r24, r21 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 279e0: 51 11 cpse r21, r1 279e2: 31 c0 rjmp .+98 ; 0x27a46 *dst = '0'; 279e4: 80 e3 ldi r24, 0x30 ; 48 279e6: 8a 83 std Y+2, r24 ; 0x02 return 1; 279e8: 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); 279ea: e1 e0 ldi r30, 0x01 ; 1 279ec: e1 0f add r30, r17 279ee: 81 e0 ldi r24, 0x01 ; 1 279f0: 90 e0 ldi r25, 0x00 ; 0 279f2: 8c 0f add r24, r28 279f4: 9d 1f adc r25, r29 279f6: 8e 0f add r24, r30 279f8: 91 1d adc r25, r1 279fa: fc 01 movw r30, r24 279fc: 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 279fe: 9a e2 ldi r25, 0x2A ; 42 27a00: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 27a02: 81 11 cpse r24, r1 27a04: 27 c0 rjmp .+78 ; 0x27a54 *dst = '0'; 27a06: 80 e3 ldi r24, 0x30 ; 48 27a08: 81 83 std Z+1, r24 ; 0x01 return 1; 27a0a: 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); 27a0c: 1e 5f subi r17, 0xFE ; 254 27a0e: 18 0f add r17, r24 txbuff[i] = '\n'; 27a10: e1 e0 ldi r30, 0x01 ; 1 27a12: f0 e0 ldi r31, 0x00 ; 0 27a14: ec 0f add r30, r28 27a16: fd 1f adc r31, r29 27a18: e1 0f add r30, r17 27a1a: f1 1d adc r31, r1 27a1c: 8a e0 ldi r24, 0x0A ; 10 27a1e: 80 83 st Z, r24 ++i; 27a20: 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); 27a22: fe 01 movw r30, r28 27a24: 31 96 adiw r30, 0x01 ; 1 27a26: 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--){ 27a28: 6f 01 movw r12, r30 27a2a: c1 0e add r12, r17 27a2c: d1 1c adc r13, r1 27a2e: ec 14 cp r14, r12 27a30: fd 04 cpc r15, r13 27a32: b1 f0 breq .+44 ; 0x27a60 fputc(*buffer, uart2io); 27a34: f7 01 movw r30, r14 27a36: 81 91 ld r24, Z+ 27a38: 7f 01 movw r14, r30 27a3a: 67 e0 ldi r22, 0x07 ; 7 27a3c: 72 e1 ldi r23, 0x12 ; 18 27a3e: 90 e0 ldi r25, 0x00 ; 0 27a40: 0f 94 03 9f call 0x33e06 ; 0x33e06 27a44: f4 cf rjmp .-24 ; 0x27a2e 27a46: be 01 movw r22, r28 27a48: 6e 5f subi r22, 0xFE ; 254 27a4a: 7f 4f sbci r23, 0xFF ; 255 27a4c: 0f 94 62 87 call 0x30ec4 ; 0x30ec4 27a50: 18 2f mov r17, r24 27a52: cb cf rjmp .-106 ; 0x279ea 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); 27a54: bf 01 movw r22, r30 27a56: 6f 5f subi r22, 0xFF ; 255 27a58: 7f 4f sbci r23, 0xFF ; 255 27a5a: 0f 94 62 87 call 0x30ec4 ; 0x30ec4 27a5e: d6 cf rjmp .-84 ; 0x27a0c LogRequestMsg(txbuff, len); 27a60: 61 2f mov r22, r17 27a62: ce 01 movw r24, r28 27a64: 01 96 adiw r24, 0x01 ; 1 27a66: 0f 94 7d 3c call 0x278fa ; 0x278fa RecordUARTActivity(); 27a6a: 0f 94 d4 3b call 0x277a8 ; 0x277a8 } 27a6e: 62 96 adiw r28, 0x12 ; 18 27a70: 0f b6 in r0, 0x3f ; 63 27a72: f8 94 cli 27a74: de bf out 0x3e, r29 ; 62 27a76: 0f be out 0x3f, r0 ; 63 27a78: cd bf out 0x3d, r28 ; 61 27a7a: df 91 pop r29 27a7c: cf 91 pop r28 27a7e: 1f 91 pop r17 27a80: ff 90 pop r15 27a82: ef 90 pop r14 27a84: df 90 pop r13 27a86: cf 90 pop r12 27a88: 08 95 ret 00027a8a : 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) { 27a8a: 8f 92 push r8 27a8c: 9f 92 push r9 27a8e: af 92 push r10 27a90: bf 92 push r11 27a92: df 92 push r13 27a94: ef 92 push r14 27a96: ff 92 push r15 27a98: 0f 93 push r16 27a9a: 1f 93 push r17 27a9c: cf 93 push r28 27a9e: df 93 push r29 27aa0: cd b7 in r28, 0x3d ; 61 27aa2: de b7 in r29, 0x3e ; 62 27aa4: 67 97 sbiw r28, 0x17 ; 23 27aa6: 0f b6 in r0, 0x3f ; 63 27aa8: f8 94 cli 27aaa: de bf out 0x3e, r29 ; 62 27aac: 0f be out 0x3f, r0 ; 63 27aae: cd bf out 0x3d, r28 ; 61 27ab0: 18 2f mov r17, r24 27ab2: 7b 01 movw r14, r22 27ab4: d4 2e mov r13, r20 27ab6: 07 e5 ldi r16, 0x57 ; 87 27ab8: 0b 8b std Y+19, r16 ; 0x13 27aba: 8c 8b std Y+20, r24 ; 0x14 27abc: 7e 8b std Y+22, r23 ; 0x16 27abe: 6d 8b std Y+21, r22 ; 0x15 27ac0: ce 01 movw r24, r28 27ac2: 43 96 adiw r24, 0x13 ; 19 27ac4: 0f 94 8e 87 call 0x30f1c ; 0x30f1c 27ac8: 8f 8b std Y+23, r24 ; 0x17 27aca: 0e 87 std Y+14, r16 ; 0x0e 27acc: 1f 87 std Y+15, r17 ; 0x0f 27ace: f9 8a std Y+17, r15 ; 0x11 27ad0: e8 8a std Y+16, r14 ; 0x10 27ad2: ce 01 movw r24, r28 27ad4: 0e 96 adiw r24, 0x0e ; 14 27ad6: 0f 94 8e 87 call 0x30f1c ; 0x30f1c 27ada: 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; 27adc: 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) { 27ade: 11 11 cpse r17, r1 27ae0: 27 c0 rjmp .+78 ; 0x27b30 *dst = '0'; 27ae2: 80 e3 ldi r24, 0x30 ; 48 27ae4: 8a 83 std Y+2, r24 ; 0x02 return 1; 27ae6: 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); 27ae8: e1 e0 ldi r30, 0x01 ; 1 27aea: e8 0f add r30, r24 dst[i] = ' '; 27aec: 21 e0 ldi r18, 0x01 ; 1 27aee: 30 e0 ldi r19, 0x00 ; 0 27af0: 2c 0f add r18, r28 27af2: 3d 1f adc r19, r29 27af4: 2e 0f add r18, r30 27af6: 31 1d adc r19, r1 27af8: f9 01 movw r30, r18 27afa: 90 e2 ldi r25, 0x20 ; 32 27afc: 90 83 st Z, r25 return i + 1; 27afe: 02 e0 ldi r16, 0x02 ; 2 27b00: 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); 27b02: aa 24 eor r10, r10 27b04: a3 94 inc r10 27b06: b1 2c mov r11, r1 27b08: ac 0e add r10, r28 27b0a: bd 1e adc r11, r29 27b0c: a0 0e add r10, r16 27b0e: 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) { 27b10: e1 14 cp r14, r1 27b12: f1 04 cpc r15, r1 27b14: 39 f1 breq .+78 ; 0x27b64 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; 27b16: 14 e0 ldi r17, 0x04 ; 4 while ((value & topNibbleMask) == 0) { 27b18: c7 01 movw r24, r14 27b1a: 88 27 eor r24, r24 27b1c: 90 7f andi r25, 0xF0 ; 240 27b1e: 89 2b or r24, r25 27b20: 71 f4 brne .+28 ; 0x27b3e value <<= 4U; 27b22: 24 e0 ldi r18, 0x04 ; 4 27b24: ee 0c add r14, r14 27b26: ff 1c adc r15, r15 27b28: 2a 95 dec r18 27b2a: e1 f7 brne .-8 ; 0x27b24 --charsOut; 27b2c: 11 50 subi r17, 0x01 ; 1 27b2e: f4 cf rjmp .-24 ; 0x27b18 27b30: be 01 movw r22, r28 27b32: 6e 5f subi r22, 0xFE ; 254 27b34: 7f 4f sbci r23, 0xFF ; 255 27b36: 81 2f mov r24, r17 27b38: 0f 94 62 87 call 0x30ec4 ; 0x30ec4 27b3c: d5 cf rjmp .-86 ; 0x27ae8 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; while ((value & topNibbleMask) == 0) { 27b3e: 45 01 movw r8, r10 value <<= 4U; --charsOut; } for (uint8_t i = 0; i < charsOut; ++i) { 27b40: 88 2d mov r24, r8 27b42: 8a 19 sub r24, r10 27b44: 81 17 cp r24, r17 27b46: 90 f4 brcc .+36 ; 0x27b6c uint8_t n = (value & topNibbleMask) >> (8U + 4U); value <<= 4U; *dst = Nibble2Char(n); 27b48: 8f 2d mov r24, r15 27b4a: 82 95 swap r24 27b4c: 8f 70 andi r24, 0x0F ; 15 27b4e: 94 e0 ldi r25, 0x04 ; 4 27b50: ee 0c add r14, r14 27b52: ff 1c adc r15, r15 27b54: 9a 95 dec r25 27b56: e1 f7 brne .-8 ; 0x27b50 27b58: 0f 94 58 87 call 0x30eb0 ; 0x30eb0 27b5c: f4 01 movw r30, r8 27b5e: 81 93 st Z+, r24 27b60: 4f 01 movw r8, r30 27b62: ee cf rjmp .-36 ; 0x27b40 } uint8_t Protocol::UInt16ToHex(uint16_t value, uint8_t *dst) { constexpr uint16_t topNibbleMask = 0xf000; if (value == 0) { *dst = '0'; 27b64: 80 e3 ldi r24, 0x30 ; 48 27b66: f5 01 movw r30, r10 27b68: 80 83 st Z, r24 return 1; 27b6a: 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); 27b6c: 10 0f add r17, r16 i += AppendCRC(msg.CRC(), txbuff + i); 27b6e: e1 e0 ldi r30, 0x01 ; 1 27b70: f0 e0 ldi r31, 0x00 ; 0 27b72: ec 0f add r30, r28 27b74: fd 1f adc r31, r29 27b76: e1 0f add r30, r17 27b78: f1 1d adc r31, r1 27b7a: 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 27b7c: 9a e2 ldi r25, 0x2A ; 42 27b7e: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 27b80: 81 11 cpse r24, r1 27b82: 21 c0 rjmp .+66 ; 0x27bc6 *dst = '0'; 27b84: 80 e3 ldi r24, 0x30 ; 48 27b86: 81 83 std Z+1, r24 ; 0x01 return 1; 27b88: 81 e0 ldi r24, 0x01 ; 1 27b8a: 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); 27b8c: 18 0f add r17, r24 txbuff[i] = '\n'; 27b8e: e1 e0 ldi r30, 0x01 ; 1 27b90: f0 e0 ldi r31, 0x00 ; 0 27b92: ec 0f add r30, r28 27b94: fd 1f adc r31, r29 27b96: e1 0f add r30, r17 27b98: f1 1d adc r31, r1 27b9a: 8a e0 ldi r24, 0x0A ; 10 27b9c: 80 83 st Z, r24 ++i; 27b9e: 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); 27ba0: 9e 01 movw r18, r28 27ba2: 2f 5f subi r18, 0xFF ; 255 27ba4: 3f 4f sbci r19, 0xFF ; 255 27ba6: 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--){ 27ba8: 59 01 movw r10, r18 27baa: a1 0e add r10, r17 27bac: b1 1c adc r11, r1 27bae: ea 14 cp r14, r10 27bb0: fb 04 cpc r15, r11 27bb2: 79 f0 breq .+30 ; 0x27bd2 fputc(*buffer, uart2io); 27bb4: f7 01 movw r30, r14 27bb6: 81 91 ld r24, Z+ 27bb8: 7f 01 movw r14, r30 27bba: 67 e0 ldi r22, 0x07 ; 7 27bbc: 72 e1 ldi r23, 0x12 ; 18 27bbe: 90 e0 ldi r25, 0x00 ; 0 27bc0: 0f 94 03 9f call 0x33e06 ; 0x33e06 27bc4: f4 cf rjmp .-24 ; 0x27bae 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); 27bc6: bf 01 movw r22, r30 27bc8: 6f 5f subi r22, 0xFF ; 255 27bca: 7f 4f sbci r23, 0xFF ; 255 27bcc: 0f 94 62 87 call 0x30ec4 ; 0x30ec4 27bd0: dc cf rjmp .-72 ; 0x27b8a LogRequestMsg(txbuff, len); 27bd2: 61 2f mov r22, r17 27bd4: ce 01 movw r24, r28 27bd6: 01 96 adiw r24, 0x01 ; 1 27bd8: 0f 94 7d 3c call 0x278fa ; 0x278fa RecordUARTActivity(); 27bdc: 0f 94 d4 3b call 0x277a8 ; 0x277a8 scopeState = nextState; } void ProtocolLogic::SendWriteRegister(uint8_t index, uint16_t value, ScopeState nextState) { SendWriteMsg(RequestMsg(RequestMsgCodes::Write, index, value)); scopeState = nextState; 27be0: d0 92 28 12 sts 0x1228, r13 ; 0x801228 } 27be4: 67 96 adiw r28, 0x17 ; 23 27be6: 0f b6 in r0, 0x3f ; 63 27be8: f8 94 cli 27bea: de bf out 0x3e, r29 ; 62 27bec: 0f be out 0x3f, r0 ; 63 27bee: cd bf out 0x3d, r28 ; 61 27bf0: df 91 pop r29 27bf2: cf 91 pop r28 27bf4: 1f 91 pop r17 27bf6: 0f 91 pop r16 27bf8: ff 90 pop r15 27bfa: ef 90 pop r14 27bfc: df 90 pop r13 27bfe: bf 90 pop r11 27c00: af 90 pop r10 27c02: 9f 90 pop r9 27c04: 8f 90 pop r8 27c06: 08 95 ret 00027c08 : regIndex = 0; SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; 27c08: 20 91 73 12 lds r18, 0x1273 ; 0x801273 27c0c: 2f 5f subi r18, 0xFF ; 255 27c0e: 20 93 73 12 sts 0x1273, r18 ; 0x801273 if (regIndex >= initRegs8Count) { 27c12: 22 30 cpi r18, 0x02 ; 2 27c14: 78 f4 brcc .+30 ; 0x27c34 return true; } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 27c16: 30 e0 ldi r19, 0x00 ; 0 27c18: f9 01 movw r30, r18 27c1a: ee 50 subi r30, 0x0E ; 14 27c1c: f3 46 sbci r31, 0x63 ; 99 27c1e: 84 91 lpm r24, Z 27c20: 2f 58 subi r18, 0x8F ; 143 27c22: 3d 4e sbci r19, 0xED ; 237 27c24: f9 01 movw r30, r18 27c26: 60 81 ld r22, Z 27c28: 70 e0 ldi r23, 0x00 ; 0 27c2a: 49 e0 ldi r20, 0x09 ; 9 27c2c: 0f 94 45 3d call 0x27a8a ; 0x27a8a } return false; 27c30: 80 e0 ldi r24, 0x00 ; 0 27c32: 08 95 ret } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; if (regIndex >= initRegs8Count) { return true; 27c34: 81 e0 ldi r24, 0x01 ; 1 } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } 27c36: 08 95 ret 00027c38 : * \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) { 27c38: 8f 92 push r8 27c3a: 9f 92 push r9 27c3c: af 92 push r10 27c3e: bf 92 push r11 27c40: cf 92 push r12 27c42: df 92 push r13 27c44: ef 92 push r14 27c46: ff 92 push r15 27c48: cf 93 push r28 27c4a: df 93 push r29 uint32_t totalBlocks; uint32_t volumeStartBlock = 0; fat32_boot_t* fbs; sdCard_ = dev; 27c4c: 27 ed ldi r18, 0xD7 ; 215 27c4e: 35 e1 ldi r19, 0x15 ; 21 27c50: 30 93 d7 0d sts 0x0DD7, r19 ; 0x800dd7 27c54: 20 93 d6 0d sts 0x0DD6, r18 ; 0x800dd6 fatType_ = 0; 27c58: 10 92 f3 15 sts 0x15F3, r1 ; 0x8015f3 allocSearchStart_ = 2; 27c5c: 42 e0 ldi r20, 0x02 ; 2 27c5e: 50 e0 ldi r21, 0x00 ; 0 27c60: 60 e0 ldi r22, 0x00 ; 0 27c62: 70 e0 ldi r23, 0x00 ; 0 27c64: 40 93 dc 15 sts 0x15DC, r20 ; 0x8015dc 27c68: 50 93 dd 15 sts 0x15DD, r21 ; 0x8015dd 27c6c: 60 93 de 15 sts 0x15DE, r22 ; 0x8015de 27c70: 70 93 df 15 sts 0x15DF, r23 ; 0x8015df cacheDirty_ = 0; // cacheFlush() will write block if true 27c74: 10 92 d5 0d sts 0x0DD5, r1 ; 0x800dd5 cacheMirrorBlock_ = 0; 27c78: 10 92 d1 0d sts 0x0DD1, r1 ; 0x800dd1 27c7c: 10 92 d2 0d sts 0x0DD2, r1 ; 0x800dd2 27c80: 10 92 d3 0d sts 0x0DD3, r1 ; 0x800dd3 27c84: 10 92 d4 0d sts 0x0DD4, r1 ; 0x800dd4 cacheBlockNumber_ = 0XFFFFFFFF; 27c88: 4f ef ldi r20, 0xFF ; 255 27c8a: 5f ef ldi r21, 0xFF ; 255 27c8c: ba 01 movw r22, r20 27c8e: 40 93 cd 0d sts 0x0DCD, r20 ; 0x800dcd 27c92: 50 93 ce 0d sts 0x0DCE, r21 ; 0x800dce 27c96: 60 93 cf 0d sts 0x0DCF, r22 ; 0x800dcf 27c9a: 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) { 27c9e: 88 23 and r24, r24 27ca0: 09 f4 brne .+2 ; 0x27ca4 27ca2: 70 c0 rjmp .+224 ; 0x27d84 if (part > 4)goto fail; if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 27ca4: 40 e0 ldi r20, 0x00 ; 0 27ca6: 60 e0 ldi r22, 0x00 ; 0 27ca8: 70 e0 ldi r23, 0x00 ; 0 27caa: cb 01 movw r24, r22 27cac: 0f 94 25 37 call 0x26e4a ; 0x26e4a 27cb0: 81 11 cpse r24, r1 27cb2: 0d c0 rjmp .+26 ; 0x27cce fatType_ = 32; } return true; fail: return false; 27cb4: c0 e0 ldi r28, 0x00 ; 0 } 27cb6: 8c 2f mov r24, r28 27cb8: df 91 pop r29 27cba: cf 91 pop r28 27cbc: ff 90 pop r15 27cbe: ef 90 pop r14 27cc0: df 90 pop r13 27cc2: cf 90 pop r12 27cc4: bf 90 pop r11 27cc6: af 90 pop r10 27cc8: 9f 90 pop r9 27cca: 8f 90 pop r8 27ccc: 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 || 27cce: 80 91 97 0f lds r24, 0x0F97 ; 0x800f97 27cd2: 8f 77 andi r24, 0x7F ; 127 27cd4: 79 f7 brne .-34 ; 0x27cb4 27cd6: 80 91 a3 0f lds r24, 0x0FA3 ; 0x800fa3 27cda: 90 91 a4 0f lds r25, 0x0FA4 ; 0x800fa4 27cde: a0 91 a5 0f lds r26, 0x0FA5 ; 0x800fa5 27ce2: b0 91 a6 0f lds r27, 0x0FA6 ; 0x800fa6 27ce6: 84 36 cpi r24, 0x64 ; 100 27ce8: 91 05 cpc r25, r1 27cea: a1 05 cpc r26, r1 27cec: b1 05 cpc r27, r1 27cee: 10 f3 brcs .-60 ; 0x27cb4 p->totalSectors < 100 || p->firstSector == 0) { 27cf0: c0 90 9f 0f lds r12, 0x0F9F ; 0x800f9f 27cf4: d0 90 a0 0f lds r13, 0x0FA0 ; 0x800fa0 27cf8: e0 90 a1 0f lds r14, 0x0FA1 ; 0x800fa1 27cfc: 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 || 27d00: c1 14 cp r12, r1 27d02: d1 04 cpc r13, r1 27d04: e1 04 cpc r14, r1 27d06: f1 04 cpc r15, r1 27d08: a9 f2 breq .-86 ; 0x27cb4 // not a valid partition goto fail; } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 27d0a: 40 e0 ldi r20, 0x00 ; 0 27d0c: c7 01 movw r24, r14 27d0e: b6 01 movw r22, r12 27d10: 0f 94 25 37 call 0x26e4a ; 0x26e4a 27d14: c8 2f mov r28, r24 27d16: 88 23 and r24, r24 27d18: 69 f2 breq .-102 ; 0x27cb4 fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 27d1a: 80 91 e4 0d lds r24, 0x0DE4 ; 0x800de4 27d1e: 90 91 e5 0d lds r25, 0x0DE5 ; 0x800de5 27d22: 81 15 cp r24, r1 27d24: 92 40 sbci r25, 0x02 ; 2 27d26: 31 f6 brne .-116 ; 0x27cb4 fbs->fatCount == 0 || 27d28: 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 || 27d2c: aa 23 and r26, r26 27d2e: 11 f2 breq .-124 ; 0x27cb4 fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 27d30: 60 91 e7 0d lds r22, 0x0DE7 ; 0x800de7 27d34: 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 || 27d38: 61 15 cp r22, r1 27d3a: 71 05 cpc r23, r1 27d3c: 09 f4 brne .+2 ; 0x27d40 27d3e: ba cf rjmp .-140 ; 0x27cb4 fbs->reservedSectorCount == 0 || fbs->sectorsPerCluster == 0) { 27d40: 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 || 27d44: 22 23 and r18, r18 27d46: 09 f4 brne .+2 ; 0x27d4a 27d48: b5 cf rjmp .-150 ; 0x27cb4 fbs->sectorsPerCluster == 0) { // not valid FAT volume goto fail; } fatCount_ = fbs->fatCount; 27d4a: a0 93 ee 15 sts 0x15EE, r26 ; 0x8015ee blocksPerCluster_ = fbs->sectorsPerCluster; 27d4e: 20 93 e0 15 sts 0x15E0, r18 ; 0x8015e0 // determine shift that is same as multiply by blocksPerCluster_ clusterSizeShift_ = 0; 27d52: 90 e0 ldi r25, 0x00 ; 0 27d54: 80 e0 ldi r24, 0x00 ; 0 while (blocksPerCluster_ != (1 << clusterSizeShift_)) { 27d56: 30 e0 ldi r19, 0x00 ; 0 27d58: e1 e0 ldi r30, 0x01 ; 1 27d5a: f0 e0 ldi r31, 0x00 ; 0 27d5c: d8 2f mov r29, r24 27d5e: af 01 movw r20, r30 27d60: 08 2e mov r0, r24 27d62: 02 c0 rjmp .+4 ; 0x27d68 27d64: 44 0f add r20, r20 27d66: 55 1f adc r21, r21 27d68: 0a 94 dec r0 27d6a: e2 f7 brpl .-8 ; 0x27d64 27d6c: 24 17 cp r18, r20 27d6e: 35 07 cpc r19, r21 27d70: 69 f0 breq .+26 ; 0x27d8c 27d72: 41 e0 ldi r20, 0x01 ; 1 27d74: 48 0f add r20, r24 27d76: 01 96 adiw r24, 0x01 ; 1 // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; 27d78: 89 30 cpi r24, 0x09 ; 9 27d7a: 91 05 cpc r25, r1 27d7c: 79 f7 brne .-34 ; 0x27d5c 27d7e: 40 93 e9 15 sts 0x15E9, r20 ; 0x8015e9 27d82: 98 cf rjmp .-208 ; 0x27cb4 * 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; 27d84: c1 2c mov r12, r1 27d86: d1 2c mov r13, r1 27d88: 76 01 movw r14, r12 27d8a: bf cf rjmp .-130 ; 0x27d0a 27d8c: 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 ? 27d90: 20 91 ef 0d lds r18, 0x0DEF ; 0x800def 27d94: 30 91 f0 0d lds r19, 0x0DF0 ; 0x800df0 27d98: 50 e0 ldi r21, 0x00 ; 0 27d9a: 40 e0 ldi r20, 0x00 ; 0 27d9c: 21 15 cp r18, r1 27d9e: 31 05 cpc r19, r1 27da0: 41 f4 brne .+16 ; 0x27db2 27da2: 20 91 fd 0d lds r18, 0x0DFD ; 0x800dfd 27da6: 30 91 fe 0d lds r19, 0x0DFE ; 0x800dfe 27daa: 40 91 ff 0d lds r20, 0x0DFF ; 0x800dff 27dae: 50 91 00 0e lds r21, 0x0E00 ; 0x800e00 27db2: 20 93 e1 15 sts 0x15E1, r18 ; 0x8015e1 27db6: 30 93 e2 15 sts 0x15E2, r19 ; 0x8015e2 27dba: 40 93 e3 15 sts 0x15E3, r20 ; 0x8015e3 27dbe: 50 93 e4 15 sts 0x15E4, r21 ; 0x8015e4 fbs->sectorsPerFat16 : fbs->sectorsPerFat32; fatStartBlock_ = volumeStartBlock + fbs->reservedSectorCount; 27dc2: 46 01 movw r8, r12 27dc4: 57 01 movw r10, r14 27dc6: 86 0e add r8, r22 27dc8: 97 1e adc r9, r23 27dca: a1 1c adc r10, r1 27dcc: b1 1c adc r11, r1 27dce: 80 92 ef 15 sts 0x15EF, r8 ; 0x8015ef 27dd2: 90 92 f0 15 sts 0x15F0, r9 ; 0x8015f0 27dd6: a0 92 f1 15 sts 0x15F1, r10 ; 0x8015f1 27dda: b0 92 f2 15 sts 0x15F2, r11 ; 0x8015f2 // count for FAT16 zero for FAT32 rootDirEntryCount_ = fbs->rootDirEntryCount; 27dde: e0 91 ea 0d lds r30, 0x0DEA ; 0x800dea 27de2: f0 91 eb 0d lds r31, 0x0DEB ; 0x800deb 27de6: f0 93 f5 15 sts 0x15F5, r31 ; 0x8015f5 27dea: e0 93 f4 15 sts 0x15F4, r30 ; 0x8015f4 // directory start for FAT16 dataStart for FAT32 rootDirStart_ = fatStartBlock_ + fbs->fatCount * blocksPerFat_; 27dee: b0 e0 ldi r27, 0x00 ; 0 27df0: 0f 94 30 a1 call 0x34260 ; 0x34260 <__muluhisi3> 27df4: dc 01 movw r26, r24 27df6: cb 01 movw r24, r22 27df8: 88 0d add r24, r8 27dfa: 99 1d adc r25, r9 27dfc: aa 1d adc r26, r10 27dfe: bb 1d adc r27, r11 27e00: 80 93 f6 15 sts 0x15F6, r24 ; 0x8015f6 27e04: 90 93 f7 15 sts 0x15F7, r25 ; 0x8015f7 27e08: a0 93 f8 15 sts 0x15F8, r26 ; 0x8015f8 27e0c: b0 93 f9 15 sts 0x15F9, r27 ; 0x8015f9 // data start for FAT16 and FAT32 dataStartBlock_ = rootDirStart_ + ((32 * fbs->rootDirEntryCount + 511)/512); 27e10: 25 e0 ldi r18, 0x05 ; 5 27e12: ee 0f add r30, r30 27e14: ff 1f adc r31, r31 27e16: 2a 95 dec r18 27e18: e1 f7 brne .-8 ; 0x27e12 27e1a: e1 50 subi r30, 0x01 ; 1 27e1c: fe 4f sbci r31, 0xFE ; 254 27e1e: ef 2f mov r30, r31 27e20: ff 27 eor r31, r31 27e22: e6 95 lsr r30 27e24: 8e 0f add r24, r30 27e26: 9f 1f adc r25, r31 27e28: a1 1d adc r26, r1 27e2a: b1 1d adc r27, r1 27e2c: 80 93 ea 15 sts 0x15EA, r24 ; 0x8015ea 27e30: 90 93 eb 15 sts 0x15EB, r25 ; 0x8015eb 27e34: a0 93 ec 15 sts 0x15EC, r26 ; 0x8015ec 27e38: b0 93 ed 15 sts 0x15ED, r27 ; 0x8015ed // total blocks for FAT16 or FAT32 totalBlocks = fbs->totalSectors16 ? 27e3c: 80 90 ec 0d lds r8, 0x0DEC ; 0x800dec 27e40: 90 90 ed 0d lds r9, 0x0DED ; 0x800ded 27e44: b1 2c mov r11, r1 27e46: a1 2c mov r10, r1 27e48: 81 14 cp r8, r1 27e4a: 91 04 cpc r9, r1 27e4c: 41 f4 brne .+16 ; 0x27e5e 27e4e: 80 90 f9 0d lds r8, 0x0DF9 ; 0x800df9 27e52: 90 90 fa 0d lds r9, 0x0DFA ; 0x800dfa 27e56: a0 90 fb 0d lds r10, 0x0DFB ; 0x800dfb 27e5a: b0 90 fc 0d lds r11, 0x0DFC ; 0x800dfc fbs->totalSectors16 : fbs->totalSectors32; // total data blocks clusterCount_ = totalBlocks - (dataStartBlock_ - volumeStartBlock); 27e5e: c8 1a sub r12, r24 27e60: d9 0a sbc r13, r25 27e62: ea 0a sbc r14, r26 27e64: fb 0a sbc r15, r27 27e66: c8 0c add r12, r8 27e68: d9 1c adc r13, r9 27e6a: ea 1c adc r14, r10 27e6c: fb 1c adc r15, r11 // divide by cluster size to get cluster count clusterCount_ >>= clusterSizeShift_; 27e6e: 04 c0 rjmp .+8 ; 0x27e78 27e70: f6 94 lsr r15 27e72: e7 94 ror r14 27e74: d7 94 ror r13 27e76: c7 94 ror r12 27e78: da 95 dec r29 27e7a: d2 f7 brpl .-12 ; 0x27e70 27e7c: c0 92 e5 15 sts 0x15E5, r12 ; 0x8015e5 27e80: d0 92 e6 15 sts 0x15E6, r13 ; 0x8015e6 27e84: e0 92 e7 15 sts 0x15E7, r14 ; 0x8015e7 27e88: f0 92 e8 15 sts 0x15E8, r15 ; 0x8015e8 // FAT type is determined by cluster count if (clusterCount_ < 4085) { 27e8c: 85 ef ldi r24, 0xF5 ; 245 27e8e: c8 16 cp r12, r24 27e90: 8f e0 ldi r24, 0x0F ; 15 27e92: d8 06 cpc r13, r24 27e94: e1 04 cpc r14, r1 27e96: f1 04 cpc r15, r1 27e98: 20 f4 brcc .+8 ; 0x27ea2 fatType_ = 12; 27e9a: 8c e0 ldi r24, 0x0C ; 12 27e9c: 80 93 f3 15 sts 0x15F3, r24 ; 0x8015f3 27ea0: 09 cf rjmp .-494 ; 0x27cb4 if (!FAT12_SUPPORT) goto fail; } else if (clusterCount_ < 65525) { fatType_ = 16; 27ea2: 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) { 27ea4: 25 ef ldi r18, 0xF5 ; 245 27ea6: c2 16 cp r12, r18 27ea8: 2f ef ldi r18, 0xFF ; 255 27eaa: d2 06 cpc r13, r18 27eac: e1 04 cpc r14, r1 27eae: f1 04 cpc r15, r1 27eb0: 88 f0 brcs .+34 ; 0x27ed4 fatType_ = 16; } else { rootDirStart_ = fbs->fat32RootCluster; 27eb2: 80 91 05 0e lds r24, 0x0E05 ; 0x800e05 27eb6: 90 91 06 0e lds r25, 0x0E06 ; 0x800e06 27eba: a0 91 07 0e lds r26, 0x0E07 ; 0x800e07 27ebe: b0 91 08 0e lds r27, 0x0E08 ; 0x800e08 27ec2: 80 93 f6 15 sts 0x15F6, r24 ; 0x8015f6 27ec6: 90 93 f7 15 sts 0x15F7, r25 ; 0x8015f7 27eca: a0 93 f8 15 sts 0x15F8, r26 ; 0x8015f8 27ece: b0 93 f9 15 sts 0x15F9, r27 ; 0x8015f9 fatType_ = 32; 27ed2: 80 e2 ldi r24, 0x20 ; 32 27ed4: 80 93 f3 15 sts 0x15F3, r24 ; 0x8015f3 27ed8: ee ce rjmp .-548 ; 0x27cb6 00027eda : // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; return -1; } bool SdFile::gfEnsureBlock(){ 27eda: 0f 93 push r16 27edc: 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_ ){ 27ede: 60 91 17 16 lds r22, 0x1617 ; 0x801617 27ee2: 70 91 18 16 lds r23, 0x1618 ; 0x801618 27ee6: 80 91 19 16 lds r24, 0x1619 ; 0x801619 27eea: 90 91 1a 16 lds r25, 0x161A ; 0x80161a 27eee: 00 91 cd 0d lds r16, 0x0DCD ; 0x800dcd 27ef2: 10 91 ce 0d lds r17, 0x0DCE ; 0x800dce 27ef6: 20 91 cf 0d lds r18, 0x0DCF ; 0x800dcf 27efa: 30 91 d0 0d lds r19, 0x0DD0 ; 0x800dd0 27efe: 60 17 cp r22, r16 27f00: 71 07 cpc r23, r17 27f02: 82 07 cpc r24, r18 27f04: 93 07 cpc r25, r19 27f06: 39 f1 breq .+78 ; 0x27f56 if ( ! vol_->cacheRawBlock(gfBlock, SdVolume::CACHE_FOR_READ)){ 27f08: 40 e0 ldi r20, 0x00 ; 0 27f0a: 0f 94 25 37 call 0x26e4a ; 0x26e4a 27f0e: 88 23 and r24, r24 27f10: f9 f0 breq .+62 ; 0x27f50 return false; } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; 27f12: 20 91 1b 16 lds r18, 0x161B ; 0x80161b 27f16: 30 91 1c 16 lds r19, 0x161C ; 0x80161c 27f1a: 40 91 0b 16 lds r20, 0x160B ; 0x80160b 27f1e: 50 91 0c 16 lds r21, 0x160C ; 0x80160c 27f22: 60 91 0d 16 lds r22, 0x160D ; 0x80160d 27f26: 70 91 0e 16 lds r23, 0x160E ; 0x80160e 27f2a: 42 1b sub r20, r18 27f2c: 53 0b sbc r21, r19 27f2e: 61 09 sbc r22, r1 27f30: 71 09 sbc r23, r1 vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; 27f32: 41 30 cpi r20, 0x01 ; 1 27f34: 92 e0 ldi r25, 0x02 ; 2 27f36: 59 07 cpc r21, r25 27f38: 61 05 cpc r22, r1 27f3a: 71 05 cpc r23, r1 27f3c: 20 f0 brcs .+8 ; 0x27f46 27f3e: 40 e0 ldi r20, 0x00 ; 0 27f40: 52 e0 ldi r21, 0x02 ; 2 27f42: 60 e0 ldi r22, 0x00 ; 0 27f44: 70 e0 ldi r23, 0x00 ; 0 27f46: 47 52 subi r20, 0x27 ; 39 27f48: 52 4f sbci r21, 0xF2 ; 242 27f4a: 9a e0 ldi r25, 0x0A ; 10 27f4c: fa 01 movw r30, r20 27f4e: 90 83 st Z, r25 } return true; } 27f50: 1f 91 pop r17 27f52: 0f 91 pop r16 27f54: 08 95 ret } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; 27f56: 81 e0 ldi r24, 0x01 ; 1 27f58: fb cf rjmp .-10 ; 0x27f50 00027f5a : break; } } void __attribute__((noinline)) MMU2::HelpUnloadToFinda() { extruder_move(-MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH, MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE); 27f5a: 20 e0 ldi r18, 0x00 ; 0 27f5c: 30 e0 ldi r19, 0x00 ; 0 27f5e: 40 ea ldi r20, 0xA0 ; 160 27f60: 52 e4 ldi r21, 0x42 ; 66 27f62: 60 e0 ldi r22, 0x00 ; 0 27f64: 70 e0 ldi r23, 0x00 ; 0 27f66: 80 ea ldi r24, 0xA0 ; 160 27f68: 92 ec ldi r25, 0xC2 ; 194 27f6a: 0d 94 c1 87 jmp 0x30f82 ; 0x30f82 00027f6e : void MMU2::Home(uint8_t mode) { logic.Home(mode); } void MMU2::SaveHotendTemp(bool turn_off_nozzle) { if (mmu_print_saved & SavedState::Cooldown) { 27f6e: 90 91 95 12 lds r25, 0x1295 ; 0x801295 27f72: 91 fd sbrc r25, 1 27f74: 17 c0 rjmp .+46 ; 0x27fa4 return; } if (turn_off_nozzle && !(mmu_print_saved & SavedState::CooldownPending)) { 27f76: 88 23 and r24, r24 27f78: a9 f0 breq .+42 ; 0x27fa4 27f7a: 92 fd sbrc r25, 2 27f7c: 13 c0 rjmp .+38 ; 0x27fa4 Disable_E0(); 27f7e: 0f 94 bf 87 call 0x30f7e ; 0x30f7e resume_hotend_temp = thermal_degTargetHotend(); 27f82: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 27f86: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 27f8a: 90 93 8a 12 sts 0x128A, r25 ; 0x80128a 27f8e: 80 93 89 12 sts 0x1289, r24 ; 0x801289 mmu_print_saved |= SavedState::CooldownPending; 27f92: 80 91 95 12 lds r24, 0x1295 ; 0x801295 27f96: 84 60 ori r24, 0x04 ; 4 27f98: 80 93 95 12 sts 0x1295, r24 ; 0x801295 LogEchoEvent_P(PSTR("Heater cooldown pending")); 27f9c: 84 ed ldi r24, 0xD4 ; 212 27f9e: 99 e9 ldi r25, 0x99 ; 153 27fa0: 0d 94 e5 87 jmp 0x30fca ; 0x30fca } } 27fa4: 08 95 ret 00027fa6 : ScreenClear(); } } void MMU2::ResumeUnpark() { if (mmu_print_saved & SavedState::ParkExtruder) { 27fa6: 80 91 95 12 lds r24, 0x1295 ; 0x801295 27faa: 80 ff sbrs r24, 0 27fac: 45 c0 rjmp .+138 ; 0x28038 LogEchoEvent_P(PSTR("Resuming XYZ")); 27fae: 8c ee ldi r24, 0xEC ; 236 27fb0: 99 e9 ldi r25, 0x99 ; 153 27fb2: 0f 94 e5 87 call 0x30fca ; 0x30fca // 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)); 27fb6: 80 91 81 12 lds r24, 0x1281 ; 0x801281 27fba: 90 91 82 12 lds r25, 0x1282 ; 0x801282 27fbe: a0 91 83 12 lds r26, 0x1283 ; 0x801283 27fc2: 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; 27fc6: 40 91 7d 12 lds r20, 0x127D ; 0x80127d 27fca: 50 91 7e 12 lds r21, 0x127E ; 0x80127e 27fce: 60 91 7f 12 lds r22, 0x127F ; 0x80127f 27fd2: 70 91 80 12 lds r23, 0x1280 ; 0x801280 27fd6: 40 93 f5 11 sts 0x11F5, r20 ; 0x8011f5 27fda: 50 93 f6 11 sts 0x11F6, r21 ; 0x8011f6 27fde: 60 93 f7 11 sts 0x11F7, r22 ; 0x8011f7 27fe2: 70 93 f8 11 sts 0x11F8, r23 ; 0x8011f8 current_position[Y_AXIS] = ry; 27fe6: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 27fea: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 27fee: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 27ff2: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc planner_line_to_current_position_sync(feedRate_mm_s); 27ff6: 60 e0 ldi r22, 0x00 ; 0 27ff8: 70 e0 ldi r23, 0x00 ; 0 27ffa: 88 e4 ldi r24, 0x48 ; 72 27ffc: 92 e4 ldi r25, 0x42 ; 66 27ffe: 0f 94 e1 87 call 0x30fc2 ; 0x30fc2 } void motion_do_blocking_move_to_z(float z, float feedRate_mm_s) { current_position[Z_AXIS] = z; 28002: 80 91 85 12 lds r24, 0x1285 ; 0x801285 28006: 90 91 86 12 lds r25, 0x1286 ; 0x801286 2800a: a0 91 87 12 lds r26, 0x1287 ; 0x801287 2800e: b0 91 88 12 lds r27, 0x1288 ; 0x801288 28012: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 28016: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 2801a: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 2801e: b0 93 00 12 sts 0x1200, r27 ; 0x801200 planner_line_to_current_position_sync(feedRate_mm_s); 28022: 60 e0 ldi r22, 0x00 ; 0 28024: 70 e0 ldi r23, 0x00 ; 0 28026: 80 e7 ldi r24, 0x70 ; 112 28028: 91 e4 ldi r25, 0x41 ; 65 2802a: 0f 94 e1 87 call 0x30fc2 ; 0x30fc2 // 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); 2802e: 80 91 95 12 lds r24, 0x1295 ; 0x801295 28032: 8e 7f andi r24, 0xFE ; 254 28034: 80 93 95 12 sts 0x1295, r24 ; 0x801295 } } 28038: 08 95 ret 0002803a : mmu_print_saved |= SavedState::CooldownPending; LogEchoEvent_P(PSTR("Heater cooldown pending")); } } void MMU2::SaveAndPark(bool move_axes) { 2803a: 0f 93 push r16 2803c: 1f 93 push r17 2803e: cf 93 push r28 if (mmu_print_saved == SavedState::None) { // First occurrence. Save current position, park print head, disable nozzle heater. 28040: 90 91 95 12 lds r25, 0x1295 ; 0x801295 28044: 91 11 cpse r25, r1 28046: 72 c0 rjmp .+228 ; 0x2812c 28048: c8 2f mov r28, r24 LogEchoEvent_P(PSTR("Saving and parking")); 2804a: 81 ec ldi r24, 0xC1 ; 193 2804c: 99 e9 ldi r25, 0x99 ; 153 2804e: 0f 94 e5 87 call 0x30fca ; 0x30fca Disable_E0(); 28052: 0f 94 bf 87 call 0x30f7e ; 0x30f7e bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 28056: 0f 94 ce 22 call 0x2459c ; 0x2459c /// 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; 2805a: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 2805e: 81 11 cpse r24, r1 28060: 02 c0 rjmp .+4 ; 0x28066 28062: 0e 94 24 5e call 0xbc48 ; 0xbc48 // 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) { 28066: cc 23 and r28, r28 28068: 09 f4 brne .+2 ; 0x2806c 2806a: 60 c0 rjmp .+192 ; 0x2812c mmu_print_saved |= SavedState::ParkExtruder; 2806c: 80 91 95 12 lds r24, 0x1295 ; 0x801295 28070: 81 60 ori r24, 0x01 ; 1 28072: 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]); 28076: 80 91 fd 11 lds r24, 0x11FD ; 0x8011fd 2807a: 90 91 fe 11 lds r25, 0x11FE ; 0x8011fe 2807e: a0 91 ff 11 lds r26, 0x11FF ; 0x8011ff 28082: b0 91 00 12 lds r27, 0x1200 ; 0x801200 28086: 40 91 f9 11 lds r20, 0x11F9 ; 0x8011f9 2808a: 50 91 fa 11 lds r21, 0x11FA ; 0x8011fa 2808e: 60 91 fb 11 lds r22, 0x11FB ; 0x8011fb 28092: 70 91 fc 11 lds r23, 0x11FC ; 0x8011fc resume_position = planner_current_position(); // save current pos 28096: 00 91 f5 11 lds r16, 0x11F5 ; 0x8011f5 2809a: 10 91 f6 11 lds r17, 0x11F6 ; 0x8011f6 2809e: 20 91 f7 11 lds r18, 0x11F7 ; 0x8011f7 280a2: 30 91 f8 11 lds r19, 0x11F8 ; 0x8011f8 280a6: 00 93 7d 12 sts 0x127D, r16 ; 0x80127d 280aa: 10 93 7e 12 sts 0x127E, r17 ; 0x80127e 280ae: 20 93 7f 12 sts 0x127F, r18 ; 0x80127f 280b2: 30 93 80 12 sts 0x1280, r19 ; 0x801280 280b6: 40 93 81 12 sts 0x1281, r20 ; 0x801281 280ba: 50 93 82 12 sts 0x1282, r21 ; 0x801282 280be: 60 93 83 12 sts 0x1283, r22 ; 0x801283 280c2: 70 93 84 12 sts 0x1284, r23 ; 0x801284 280c6: 80 93 85 12 sts 0x1285, r24 ; 0x801285 280ca: 90 93 86 12 sts 0x1286, r25 ; 0x801286 280ce: a0 93 87 12 sts 0x1287, r26 ; 0x801287 280d2: 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); 280d6: 60 e0 ldi r22, 0x00 ; 0 280d8: 70 e0 ldi r23, 0x00 ; 0 280da: 80 ea ldi r24, 0xA0 ; 160 280dc: 91 e4 ldi r25, 0x41 ; 65 280de: 0e 94 d3 66 call 0xcda6 ; 0xcda6 void Disable_E0() { disable_e0(); } bool all_axes_homed() { return axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]; 280e2: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 280e6: 88 23 and r24, r24 280e8: 09 f1 breq .+66 ; 0x2812c 280ea: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 280ee: 88 23 and r24, r24 280f0: e9 f0 breq .+58 ; 0x2812c 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; 280f2: 80 e0 ldi r24, 0x00 ; 0 280f4: 90 e0 ldi r25, 0x00 ; 0 280f6: aa ef ldi r26, 0xFA ; 250 280f8: b2 e4 ldi r27, 0x42 ; 66 280fa: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 280fe: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 28102: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 28106: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = MMU_ERR_Y_PAUSE_POS; 2810a: 10 92 f9 11 sts 0x11F9, r1 ; 0x8011f9 2810e: 10 92 fa 11 sts 0x11FA, r1 ; 0x8011fa 28112: 10 92 fb 11 sts 0x11FB, r1 ; 0x8011fb 28116: 10 92 fc 11 sts 0x11FC, r1 ; 0x8011fc planner_line_to_current_position_sync(NOZZLE_PARK_XY_FEEDRATE); 2811a: 60 e0 ldi r22, 0x00 ; 0 2811c: 70 e0 ldi r23, 0x00 ; 0 2811e: 88 e4 ldi r24, 0x48 ; 72 28120: 92 e4 ldi r25, 0x42 ; 66 if (all_axes_homed()) { nozzle_park(); } } } } 28122: cf 91 pop r28 28124: 1f 91 pop r17 28126: 0f 91 pop r16 28128: 0d 94 e1 87 jmp 0x30fc2 ; 0x30fc2 2812c: cf 91 pop r28 2812e: 1f 91 pop r17 28130: 0f 91 pop r16 28132: 08 95 ret 00028134 : 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){ 28134: ef 92 push r14 28136: ff 92 push r15 28138: 0f 93 push r16 2813a: 1f 93 push r17 2813c: cf 93 push r28 2813e: df 93 push r29 28140: 1f 92 push r1 28142: 1f 92 push r1 28144: cd b7 in r28, 0x3d ; 61 28146: de b7 in r29, 0x3e ; 62 28148: f8 2e mov r15, r24 2814a: e6 2e mov r14, r22 if (steps == 0) return; uint16_t current_delay_us = MAX_DELAY; 2814c: 80 e1 ldi r24, 0x10 ; 16 2814e: 97 e2 ldi r25, 0x27 ; 39 28150: 9a 83 std Y+2, r25 ; 0x02 28152: 89 83 std Y+1, r24 ; 0x01 const uint16_t half = steps / 2; 28154: 8a 01 movw r16, r20 28156: 16 95 lsr r17 28158: 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); 2815a: 8f 2d mov r24, r15 2815c: 0e 94 76 c2 call 0x184ec ; 0x184ec while (steps--){ 28160: 01 50 subi r16, 0x01 ; 1 28162: 11 09 sbc r17, r1 28164: 78 f0 brcs .+30 ; 0x28184 accelerate_1_step(axes, acc, delay_us, min_delay_us); 28166: 28 ec ldi r18, 0xC8 ; 200 28168: 30 e0 ldi r19, 0x00 ; 0 2816a: ae 01 movw r20, r28 2816c: 4f 5f subi r20, 0xFF ; 255 2816e: 5f 4f sbci r21, 0xFF ; 255 28170: 68 ee ldi r22, 0xE8 ; 232 28172: 73 e0 ldi r23, 0x03 ; 3 28174: 8f 2d mov r24, r15 28176: 0e 94 45 c1 call 0x1828a ; 0x1828a update_position_1_step(axes, dir); 2817a: 6e 2d mov r22, r14 2817c: 8f 2d mov r24, r15 2817e: 0e 94 8f c2 call 0x1851e ; 0x1851e 28182: ee cf rjmp .-36 ; 0x28160 } /// \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); 28184: 6e 2d mov r22, r14 28186: 8f 2d mov r24, r15 28188: 0e 94 76 c2 call 0x184ec ; 0x184ec 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); } 2818c: 0f 90 pop r0 2818e: 0f 90 pop r0 28190: df 91 pop r29 28192: cf 91 pop r28 28194: 1f 91 pop r17 28196: 0f 91 pop r16 28198: ff 90 pop r15 2819a: ef 90 pop r14 2819c: 08 95 ret 0002819e : 2819e: ef 92 push r14 281a0: ff 92 push r15 281a2: 0f 93 push r16 281a4: 1f 93 push r17 281a6: cf 93 push r28 281a8: df 93 push r29 281aa: cd b7 in r28, 0x3d ; 61 281ac: de b7 in r29, 0x3e ; 62 281ae: 2f 97 sbiw r28, 0x0f ; 15 281b0: 0f b6 in r0, 0x3f ; 63 281b2: f8 94 cli 281b4: de bf out 0x3e, r29 ; 62 281b6: 0f be out 0x3f, r0 ; 63 281b8: cd bf out 0x3d, r28 ; 61 281ba: 10 92 23 12 sts 0x1223, r1 ; 0x801223 281be: 05 e2 ldi r16, 0x25 ; 37 281c0: 12 e1 ldi r17, 0x12 ; 18 281c2: ee 24 eor r14, r14 281c4: e3 94 inc r14 281c6: f1 2c mov r15, r1 281c8: d8 01 movw r26, r16 281ca: 11 96 adiw r26, 0x01 ; 1 281cc: fc 92 st X, r15 281ce: ee 92 st -X, r14 281d0: 12 96 adiw r26, 0x02 ; 2 281d2: 1c 92 st X, r1 281d4: 12 97 sbiw r26, 0x02 ; 2 281d6: 82 e8 ldi r24, 0x82 ; 130 281d8: 13 96 adiw r26, 0x03 ; 3 281da: 8c 93 st X, r24 281dc: 40 e0 ldi r20, 0x00 ; 0 281de: 60 e0 ldi r22, 0x00 ; 0 281e0: 8a e2 ldi r24, 0x2A ; 42 281e2: 92 e1 ldi r25, 0x12 ; 18 281e4: 0f 94 b2 87 call 0x30f64 ; 0x30f64 281e8: 40 e0 ldi r20, 0x00 ; 0 281ea: 60 e0 ldi r22, 0x00 ; 0 281ec: 8f e2 ldi r24, 0x2F ; 47 281ee: 92 e1 ldi r25, 0x12 ; 18 281f0: 0f 94 b2 87 call 0x30f64 ; 0x30f64 281f4: f8 01 movw r30, r16 281f6: 17 86 std Z+15, r1 ; 0x0f 281f8: 10 8a std Z+16, r1 ; 0x10 281fa: 11 8a std Z+17, r1 ; 0x11 281fc: 12 8a std Z+18, r1 ; 0x12 281fe: 13 8a std Z+19, r1 ; 0x13 28200: 8a e0 ldi r24, 0x0A ; 10 28202: 84 8b std Z+20, r24 ; 0x14 28204: 40 e0 ldi r20, 0x00 ; 0 28206: 60 e0 ldi r22, 0x00 ; 0 28208: ce 01 movw r24, r28 2820a: 01 96 adiw r24, 0x01 ; 1 2820c: 0f 94 b2 87 call 0x30f64 ; 0x30f64 28210: 85 e0 ldi r24, 0x05 ; 5 28212: fe 01 movw r30, r28 28214: 31 96 adiw r30, 0x01 ; 1 28216: de 01 movw r26, r28 28218: 16 96 adiw r26, 0x06 ; 6 2821a: 01 90 ld r0, Z+ 2821c: 0d 92 st X+, r0 2821e: 8a 95 dec r24 28220: e1 f7 brne .-8 ; 0x2821a 28222: 85 e0 ldi r24, 0x05 ; 5 28224: fe 01 movw r30, r28 28226: 36 96 adiw r30, 0x06 ; 6 28228: aa e3 ldi r26, 0x3A ; 58 2822a: b2 e1 ldi r27, 0x12 ; 18 2822c: 01 90 ld r0, Z+ 2822e: 0d 92 st X+, r0 28230: 8a 95 dec r24 28232: e1 f7 brne .-8 ; 0x2822c 28234: d8 01 movw r26, r16 28236: 5a 96 adiw r26, 0x1a ; 26 28238: 1c 92 st X, r1 2823a: 5a 97 sbiw r26, 0x1a ; 26 2823c: 5c 96 adiw r26, 0x1c ; 28 2823e: 1c 92 st X, r1 28240: 1e 92 st -X, r1 28242: 5b 97 sbiw r26, 0x1b ; 27 28244: 8a e3 ldi r24, 0x3A ; 58 28246: 92 e1 ldi r25, 0x12 ; 18 28248: 0f 94 a1 87 call 0x30f42 ; 0x30f42 2824c: f8 01 movw r30, r16 2824e: 81 8f std Z+25, r24 ; 0x19 28250: 15 8e std Z+29, r1 ; 0x1d 28252: 16 8e std Z+30, r1 ; 0x1e 28254: 40 e0 ldi r20, 0x00 ; 0 28256: 60 e0 ldi r22, 0x00 ; 0 28258: 84 e4 ldi r24, 0x44 ; 68 2825a: 92 e1 ldi r25, 0x12 ; 18 2825c: 0f 94 b2 87 call 0x30f64 ; 0x30f64 28260: d8 01 movw r26, r16 28262: 94 96 adiw r26, 0x24 ; 36 28264: 1c 92 st X, r1 28266: 40 e0 ldi r20, 0x00 ; 0 28268: 60 e0 ldi r22, 0x00 ; 0 2826a: ce 01 movw r24, r28 2826c: 0b 96 adiw r24, 0x0b ; 11 2826e: 0f 94 b2 87 call 0x30f64 ; 0x30f64 28272: 85 e0 ldi r24, 0x05 ; 5 28274: fe 01 movw r30, r28 28276: 3b 96 adiw r30, 0x0b ; 11 28278: de 01 movw r26, r28 2827a: 11 96 adiw r26, 0x01 ; 1 2827c: 01 90 ld r0, Z+ 2827e: 0d 92 st X+, r0 28280: 8a 95 dec r24 28282: e1 f7 brne .-8 ; 0x2827c 28284: 85 e0 ldi r24, 0x05 ; 5 28286: fe 01 movw r30, r28 28288: 31 96 adiw r30, 0x01 ; 1 2828a: aa e4 ldi r26, 0x4A ; 74 2828c: b2 e1 ldi r27, 0x12 ; 18 2828e: 01 90 ld r0, Z+ 28290: 0d 92 st X+, r0 28292: 8a 95 dec r24 28294: e1 f7 brne .-8 ; 0x2828e 28296: f8 01 movw r30, r16 28298: 12 a6 std Z+42, r1 ; 0x2a 2829a: 14 a6 std Z+44, r1 ; 0x2c 2829c: 13 a6 std Z+43, r1 ; 0x2b 2829e: 8a e4 ldi r24, 0x4A ; 74 282a0: 92 e1 ldi r25, 0x12 ; 18 282a2: 0f 94 a1 87 call 0x30f42 ; 0x30f42 282a6: d8 01 movw r26, r16 282a8: 99 96 adiw r26, 0x29 ; 41 282aa: 8c 93 st X, r24 282ac: 99 97 sbiw r26, 0x29 ; 41 282ae: dd 96 adiw r26, 0x3d ; 61 282b0: 1c 92 st X, r1 282b2: dd 97 sbiw r26, 0x3d ; 61 282b4: 84 e2 ldi r24, 0x24 ; 36 282b6: 92 e1 ldi r25, 0x12 ; 18 282b8: df 96 adiw r26, 0x3f ; 63 282ba: 9c 93 st X, r25 282bc: 8e 93 st -X, r24 282be: de 97 sbiw r26, 0x3e ; 62 282c0: f0 92 66 12 sts 0x1266, r15 ; 0x801266 282c4: e0 92 65 12 sts 0x1265, r14 ; 0x801265 282c8: 10 92 67 12 sts 0x1267, r1 ; 0x801267 282cc: 1f ef ldi r17, 0xFF ; 255 282ce: 10 93 68 12 sts 0x1268, r17 ; 0x801268 282d2: 0f 94 f5 87 call 0x30fea ; 0x30fea 282d6: 80 93 69 12 sts 0x1269, r24 ; 0x801269 282da: 10 92 6a 12 sts 0x126A, r1 ; 0x80126a 282de: 10 92 6b 12 sts 0x126B, r1 ; 0x80126b 282e2: 10 92 6c 12 sts 0x126C, r1 ; 0x80126c 282e6: 10 92 6e 12 sts 0x126E, r1 ; 0x80126e 282ea: 10 92 6d 12 sts 0x126D, r1 ; 0x80126d 282ee: 10 92 70 12 sts 0x1270, r1 ; 0x801270 282f2: 10 92 6f 12 sts 0x126F, r1 ; 0x80126f 282f6: 10 92 73 12 sts 0x1273, r1 ; 0x801273 282fa: 10 92 74 12 sts 0x1274, r1 ; 0x801274 282fe: 10 92 75 12 sts 0x1275, r1 ; 0x801275 28302: 10 92 76 12 sts 0x1276, r1 ; 0x801276 28306: 83 e0 ldi r24, 0x03 ; 3 28308: 80 93 79 12 sts 0x1279, r24 ; 0x801279 2830c: 10 92 7a 12 sts 0x127A, r1 ; 0x80127a 28310: 85 e0 ldi r24, 0x05 ; 5 28312: 80 93 71 12 sts 0x1271, r24 ; 0x801271 28316: 84 e1 ldi r24, 0x14 ; 20 28318: 80 93 72 12 sts 0x1272, r24 ; 0x801272 2831c: 83 e6 ldi r24, 0x63 ; 99 2831e: 80 93 7b 12 sts 0x127B, r24 ; 0x80127b 28322: 80 93 7c 12 sts 0x127C, r24 ; 0x80127c 28326: 10 92 7d 12 sts 0x127D, r1 ; 0x80127d 2832a: 10 92 7e 12 sts 0x127E, r1 ; 0x80127e 2832e: 10 92 7f 12 sts 0x127F, r1 ; 0x80127f 28332: 10 92 80 12 sts 0x1280, r1 ; 0x801280 28336: 10 92 81 12 sts 0x1281, r1 ; 0x801281 2833a: 10 92 82 12 sts 0x1282, r1 ; 0x801282 2833e: 10 92 83 12 sts 0x1283, r1 ; 0x801283 28342: 10 92 84 12 sts 0x1284, r1 ; 0x801284 28346: 10 92 85 12 sts 0x1285, r1 ; 0x801285 2834a: 10 92 86 12 sts 0x1286, r1 ; 0x801286 2834e: 10 92 87 12 sts 0x1287, r1 ; 0x801287 28352: 10 92 88 12 sts 0x1288, r1 ; 0x801288 28356: 10 92 8a 12 sts 0x128A, r1 ; 0x80128a 2835a: 10 92 89 12 sts 0x1289, r1 ; 0x801289 2835e: 10 92 8b 12 sts 0x128B, r1 ; 0x80128b 28362: 8e e2 ldi r24, 0x2E ; 46 28364: 90 e8 ldi r25, 0x80 ; 128 28366: 90 93 8d 12 sts 0x128D, r25 ; 0x80128d 2836a: 80 93 8c 12 sts 0x128C, r24 ; 0x80128c 2836e: 10 93 8e 12 sts 0x128E, r17 ; 0x80128e 28372: 10 93 8f 12 sts 0x128F, r17 ; 0x80128f 28376: 10 92 91 12 sts 0x1291, r1 ; 0x801291 2837a: 10 92 90 12 sts 0x1290, r1 ; 0x801290 2837e: 10 93 92 12 sts 0x1292, r17 ; 0x801292 28382: 82 e0 ldi r24, 0x02 ; 2 28384: 80 93 93 12 sts 0x1293, r24 ; 0x801293 28388: 10 92 94 12 sts 0x1294, r1 ; 0x801294 2838c: 10 92 95 12 sts 0x1295, r1 ; 0x801295 28390: 10 92 96 12 sts 0x1296, r1 ; 0x801296 28394: 10 92 97 12 sts 0x1297, r1 ; 0x801297 28398: 10 92 99 12 sts 0x1299, r1 ; 0x801299 2839c: 10 92 98 12 sts 0x1298, r1 ; 0x801298 283a0: 10 92 9b 12 sts 0x129B, r1 ; 0x80129b 283a4: 10 92 9a 12 sts 0x129A, r1 ; 0x80129a 283a8: 0f 94 b0 56 call 0x2ad60 ; 0x2ad60 283ac: e8 e6 ldi r30, 0x68 ; 104 283ae: f3 e1 ldi r31, 0x13 ; 19 283b0: 10 92 f0 13 sts 0x13F0, r1 ; 0x8013f0 283b4: 10 92 f3 13 sts 0x13F3, r1 ; 0x8013f3 283b8: 10 92 15 14 sts 0x1415, r1 ; 0x801415 283bc: 10 92 18 14 sts 0x1418, r1 ; 0x801418 283c0: 89 e1 ldi r24, 0x19 ; 25 283c2: 80 93 d7 15 sts 0x15D7, r24 ; 0x8015d7 283c6: 10 92 da 15 sts 0x15DA, r1 ; 0x8015da 283ca: 10 92 db 15 sts 0x15DB, r1 ; 0x8015db 283ce: 10 92 f3 15 sts 0x15F3, r1 ; 0x8015f3 283d2: 10 92 fa 15 sts 0x15FA, r1 ; 0x8015fa 283d6: 10 92 fd 15 sts 0x15FD, r1 ; 0x8015fd 283da: 10 92 7b 16 sts 0x167B, r1 ; 0x80167b 283de: 10 92 7d 16 sts 0x167D, r1 ; 0x80167d 283e2: 10 92 7c 16 sts 0x167C, r1 ; 0x80167c 283e6: 10 92 0c 15 sts 0x150C, r1 ; 0x80150c 283ea: 10 92 0b 15 sts 0x150B, r1 ; 0x80150b 283ee: 10 92 77 16 sts 0x1677, r1 ; 0x801677 283f2: 10 92 78 16 sts 0x1678, r1 ; 0x801678 283f6: 10 92 79 16 sts 0x1679, r1 ; 0x801679 283fa: 10 92 7a 16 sts 0x167A, r1 ; 0x80167a 283fe: 10 92 7e 16 sts 0x167E, r1 ; 0x80167e 28402: 10 92 7f 16 sts 0x167F, r1 ; 0x80167f 28406: 10 92 80 16 sts 0x1680, r1 ; 0x801680 2840a: 10 92 81 16 sts 0x1681, r1 ; 0x801681 2840e: 12 82 std Z+2, r1 ; 0x02 28410: 13 82 std Z+3, r1 ; 0x03 28412: 10 82 st Z, r1 28414: 11 82 std Z+1, r1 ; 0x01 28416: 10 92 0a 15 sts 0x150A, r1 ; 0x80150a 2841a: 10 92 1d 16 sts 0x161D, r1 ; 0x80161d 2841e: e8 e3 ldi r30, 0x38 ; 56 28420: f4 e1 ldi r31, 0x14 ; 20 28422: 82 ed ldi r24, 0xD2 ; 210 28424: df 01 movw r26, r30 28426: 1d 92 st X+, r1 28428: 8a 95 dec r24 2842a: e9 f7 brne .-6 ; 0x28426 2842c: 10 92 b9 13 sts 0x13B9, r1 ; 0x8013b9 28430: 10 92 b8 13 sts 0x13B8, r1 ; 0x8013b8 28434: 10 92 b7 13 sts 0x13B7, r1 ; 0x8013b7 28438: 8b e7 ldi r24, 0x7B ; 123 2843a: 96 e1 ldi r25, 0x16 ; 22 2843c: 0f 94 5e 10 call 0x220bc ; 0x220bc ::start()> 28440: e1 e6 ldi r30, 0x61 ; 97 28442: f3 e1 ldi r31, 0x13 ; 19 28444: 11 82 std Z+1, r1 ; 0x01 28446: 12 82 std Z+2, r1 ; 0x02 28448: 13 82 std Z+3, r1 ; 0x03 2844a: 14 82 std Z+4, r1 ; 0x04 2844c: 15 82 std Z+5, r1 ; 0x05 2844e: 16 82 std Z+6, r1 ; 0x06 28450: 10 83 st Z, r17 28452: e4 e8 ldi r30, 0x84 ; 132 28454: f6 e1 ldi r31, 0x16 ; 22 28456: 15 82 std Z+5, r1 ; 0x05 28458: 17 82 std Z+7, r1 ; 0x07 2845a: 16 82 std Z+6, r1 ; 0x06 2845c: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 28460: 60 93 8d 16 sts 0x168D, r22 ; 0x80168d 28464: 70 93 8e 16 sts 0x168E, r23 ; 0x80168e 28468: 80 93 8f 16 sts 0x168F, r24 ; 0x80168f 2846c: 90 93 90 16 sts 0x1690, r25 ; 0x801690 28470: 2f 96 adiw r28, 0x0f ; 15 28472: 0f b6 in r0, 0x3f ; 63 28474: f8 94 cli 28476: de bf out 0x3e, r29 ; 62 28478: 0f be out 0x3f, r0 ; 63 2847a: cd bf out 0x3d, r28 ; 61 2847c: df 91 pop r29 2847e: cf 91 pop r28 28480: 1f 91 pop r17 28482: 0f 91 pop r16 28484: ff 90 pop r15 28486: ef 90 pop r14 28488: 08 95 ret 0002848a : 2848a: 42 e0 ldi r20, 0x02 ; 2 2848c: 0f 94 08 98 call 0x33010 ; 0x33010 } void MarlinSerial::println(double n, int digits) { print(n, digits); println(); 28490: 0d 94 bb 98 jmp 0x33176 ; 0x33176 00028494 : 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; 28494: 80 91 7b 12 lds r24, 0x127B ; 0x80127b 28498: 83 36 cpi r24, 0x63 ; 99 2849a: 09 f4 brne .+2 ; 0x2849e 2849c: 8f ef ldi r24, 0xFF ; 255 } 2849e: 08 95 ret 000284a0 : , tmcFailures(0) { } void MMU2::Status() { // Useful information to see during bootup and change state SERIAL_ECHOPGM("MMU is "); 284a0: 8f e6 ldi r24, 0x6F ; 111 284a2: 9d e9 ldi r25, 0x9D ; 157 284a4: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_MMU_ENABLED, 0); 284a8: 60 e0 ldi r22, 0x00 ; 0 284aa: 8c ea ldi r24, 0xAC ; 172 284ac: 9c e0 ldi r25, 0x0C ; 12 284ae: 0e 94 e3 6e call 0xddc6 ; 0xddc6 if (status == 1) { 284b2: 81 30 cpi r24, 0x01 ; 1 284b4: 21 f4 brne .+8 ; 0x284be SERIAL_ECHOLNRPGM(_O(MSG_ON)); 284b6: 81 eb ldi r24, 0xB1 ; 177 284b8: 9a e5 ldi r25, 0x5A ; 90 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 284ba: 0c 94 49 72 jmp 0xe492 ; 0xe492 284be: 8b ea ldi r24, 0xAB ; 171 284c0: 9a e5 ldi r25, 0x5A ; 90 284c2: fb cf rjmp .-10 ; 0x284ba 000284c4 : print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 284c4: bc 01 movw r22, r24 284c6: 99 0f add r25, r25 284c8: 88 0b sbc r24, r24 284ca: 99 0b sbc r25, r25 284cc: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 } void MarlinSerial::println(int n, int base) { print(n, base); println(); 284d0: 0d 94 bb 98 jmp 0x33176 ; 0x33176 000284d4 : 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){ 284d4: cf 93 push r28 284d6: c8 2f mov r28, r24 extruder = ex; 284d8: 80 93 7b 12 sts 0x127B, r24 ; 0x80127b MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); 284dc: 81 e6 ldi r24, 0x61 ; 97 284de: 9d e9 ldi r25, 0x9D ; 157 284e0: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 284e4: 85 e5 ldi r24, 0x55 ; 85 284e6: 9d e9 ldi r25, 0x9D ; 157 284e8: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 284ec: 8b e4 ldi r24, 0x4B ; 75 284ee: 9d e9 ldi r25, 0x9D ; 157 284f0: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLN((int)ex); 284f4: 8c 2f mov r24, r28 284f6: 90 e0 ldi r25, 0x00 ; 0 } 284f8: cf 91 pop r28 } void MMU2::SetCurrentTool(uint8_t ex){ extruder = ex; MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); 284fa: 0d 94 62 42 jmp 0x284c4 ; 0x284c4 000284fe : return 0; } } //------------------------------------------------------------------------------ void Sd2Card::chipSelectHigh() { WRITE(SDSS, 1); 284fe: 28 9a sbi 0x05, 0 ; 5 } 28500: 08 95 ret 00028502 : spiRate_ = sckRateID; return true; } //------------------------------------------------------------------------------ // wait for card to go not busy bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) { 28502: 0f 93 push r16 28504: 1f 93 push r17 28506: cf 93 push r28 28508: df 93 push r29 2850a: ec 01 movw r28, r24 uint16_t t0 = _millis(); 2850c: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 28510: 8b 01 movw r16, r22 while (spiRec() != 0XFF) { 28512: 0f 94 ae 70 call 0x2e15c ; 0x2e15c 28516: 8f 3f cpi r24, 0xFF ; 255 28518: 69 f0 breq .+26 ; 0x28534 if (((uint16_t)_millis() - t0) >= timeoutMillis) goto fail; 2851a: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 2851e: 60 1b sub r22, r16 28520: 71 0b sbc r23, r17 28522: 6c 17 cp r22, r28 28524: 7d 07 cpc r23, r29 28526: a8 f3 brcs .-22 ; 0x28512 } return true; fail: return false; 28528: 80 e0 ldi r24, 0x00 ; 0 } 2852a: df 91 pop r29 2852c: cf 91 pop r28 2852e: 1f 91 pop r17 28530: 0f 91 pop r16 28532: 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; 28534: 81 e0 ldi r24, 0x01 ; 1 28536: f9 cf rjmp .-14 ; 0x2852a 00028538 : lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 28538: 8a ef ldi r24, 0xFA ; 250 2853a: 95 e1 ldi r25, 0x15 ; 21 2853c: 0f 94 c2 39 call 0x27384 ; 0x27384 file.close(); 28540: 8a ef ldi r24, 0xFA ; 250 28542: 95 e1 ldi r25, 0x15 ; 21 28544: 0f 94 51 6f call 0x2dea2 ; 0x2dea2 saving = false; 28548: e8 e6 ldi r30, 0x68 ; 104 2854a: f3 e1 ldi r31, 0x13 ; 19 2854c: 10 82 st Z, r1 logging = false; 2854e: 11 82 std Z+1, r1 ; 0x01 // so one can unplug the printer and continue printing the next day. } } 28550: 08 95 ret 00028552 : //! 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) 28552: cf 92 push r12 28554: df 92 push r13 28556: ef 92 push r14 28558: ff 92 push r15 2855a: 0f 93 push r16 2855c: 1f 93 push r17 2855e: cf 93 push r28 28560: df 93 push r29 28562: eb 01 movw r28, r22 28564: 18 2f mov r17, r24 28566: 09 2f mov r16, r25 { if (saved_printing) return; cli(); 28568: f8 94 cli void save_print_file_state() { uint8_t nlines; uint16_t sdlen_cmdqueue; uint16_t sdlen_planner; if (card.sdprinting) { 2856a: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 2856e: 88 23 and r24, r24 28570: 09 f4 brne .+2 ; 0x28574 28572: d8 c0 rjmp .+432 ; 0x28724 saved_sdpos = sdpos_atomic; //atomic sd position of last command added in queue 28574: 80 91 dc 11 lds r24, 0x11DC ; 0x8011dc 28578: 90 91 dd 11 lds r25, 0x11DD ; 0x8011dd 2857c: a0 91 de 11 lds r26, 0x11DE ; 0x8011de 28580: b0 91 df 11 lds r27, 0x11DF ; 0x8011df 28584: 80 93 d8 11 sts 0x11D8, r24 ; 0x8011d8 28588: 90 93 d9 11 sts 0x11D9, r25 ; 0x8011d9 2858c: a0 93 da 11 sts 0x11DA, r26 ; 0x8011da 28590: b0 93 db 11 sts 0x11DB, r27 ; 0x8011db sdlen_planner = planner_calc_sd_length(); //length of sd commands in planner 28594: 0f 94 24 75 call 0x2ea48 ; 0x2ea48 saved_sdpos -= sdlen_planner; 28598: c0 90 d8 11 lds r12, 0x11D8 ; 0x8011d8 2859c: d0 90 d9 11 lds r13, 0x11D9 ; 0x8011d9 285a0: e0 90 da 11 lds r14, 0x11DA ; 0x8011da 285a4: f0 90 db 11 lds r15, 0x11DB ; 0x8011db 285a8: c8 1a sub r12, r24 285aa: d9 0a sbc r13, r25 285ac: e1 08 sbc r14, r1 285ae: f1 08 sbc r15, r1 285b0: c0 92 d8 11 sts 0x11D8, r12 ; 0x8011d8 285b4: d0 92 d9 11 sts 0x11D9, r13 ; 0x8011d9 285b8: e0 92 da 11 sts 0x11DA, r14 ; 0x8011da 285bc: f0 92 db 11 sts 0x11DB, r15 ; 0x8011db sdlen_cmdqueue = cmdqueue_calc_sd_length(); //length of sd commands in cmdqueue 285c0: 0e 94 89 6f call 0xdf12 ; 0xdf12 saved_sdpos -= sdlen_cmdqueue; 285c4: c8 1a sub r12, r24 285c6: d9 0a sbc r13, r25 285c8: e1 08 sbc r14, r1 285ca: f1 08 sbc r15, r1 285cc: c0 92 d8 11 sts 0x11D8, r12 ; 0x8011d8 285d0: d0 92 d9 11 sts 0x11D9, r13 ; 0x8011d9 285d4: e0 92 da 11 sts 0x11DA, r14 ; 0x8011da 285d8: f0 92 db 11 sts 0x11DB, r15 ; 0x8011db saved_printing_type = PowerPanic::PRINT_TYPE_SD; 285dc: 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; 285e0: 20 91 06 12 lds r18, 0x1206 ; 0x801206 285e4: f0 90 05 12 lds r15, 0x1205 ; 0x801205 285e8: 21 11 cpse r18, r1 285ea: 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)) 285ec: 80 91 e4 11 lds r24, 0x11E4 ; 0x8011e4 285f0: 90 91 e5 11 lds r25, 0x11E5 ; 0x8011e5 285f4: 00 97 sbiw r24, 0x00 ; 0 285f6: 09 f4 brne .+2 ; 0x285fa 285f8: d1 c0 rjmp .+418 ; 0x2879c 285fa: 21 11 cpse r18, r1 285fc: cf c0 rjmp .+414 ; 0x2879c 285fe: 20 91 05 12 lds r18, 0x1205 ; 0x801205 28602: 21 11 cpse r18, r1 28604: cb c0 rjmp .+406 ; 0x2879c { memcpy(saved_start_position, current_block->gcode_start_position, sizeof(saved_start_position)); 28606: fc 01 movw r30, r24 28608: e8 5a subi r30, 0xA8 ; 168 2860a: ff 4f sbci r31, 0xFF ; 255 2860c: 20 e1 ldi r18, 0x10 ; 16 2860e: ae e7 ldi r26, 0x7E ; 126 28610: b2 e0 ldi r27, 0x02 ; 2 28612: 01 90 ld r0, Z+ 28614: 0d 92 st X+, r0 28616: 2a 95 dec r18 28618: e1 f7 brne .-8 ; 0x28612 saved_feedrate2 = current_block->gcode_feedrate; 2861a: fc 01 movw r30, r24 2861c: e6 59 subi r30, 0x96 ; 150 2861e: ff 4f sbci r31, 0xFF ; 255 28620: 20 81 ld r18, Z 28622: 31 81 ldd r19, Z+1 ; 0x01 28624: 30 93 e3 11 sts 0x11E3, r19 ; 0x8011e3 28628: 20 93 e2 11 sts 0x11E2, r18 ; 0x8011e2 saved_segment_idx = current_block->segment_idx; 2862c: 88 59 subi r24, 0x98 ; 152 2862e: 9f 4f sbci r25, 0xFF ; 255 28630: fc 01 movw r30, r24 28632: 80 81 ld r24, Z 28634: 91 81 ldd r25, Z+1 ; 0x01 28636: 90 93 e1 11 sts 0x11E1, r25 ; 0x8011e1 2863a: 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 2863e: 0f 94 a9 86 call 0x30d52 ; 0x30d52 memcpy(saved_pos, current_position, sizeof(saved_pos)); 28642: 80 e1 ldi r24, 0x10 ; 16 28644: e5 ef ldi r30, 0xF5 ; 245 28646: f1 e1 ldi r31, 0x11 ; 17 28648: a0 e9 ldi r26, 0x90 ; 144 2864a: b2 e0 ldi r27, 0x02 ; 2 2864c: 01 90 ld r0, Z+ 2864e: 0d 92 st X+, r0 28650: 8a 95 dec r24 28652: e1 f7 brne .-8 ; 0x2864c if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 28654: ff 20 and r15, r15 28656: 61 f0 breq .+24 ; 0x28670 28658: 80 e0 ldi r24, 0x00 ; 0 2865a: 90 e0 ldi r25, 0x00 ; 0 2865c: a0 e8 ldi r26, 0x80 ; 128 2865e: bf eb ldi r27, 0xBF ; 191 28660: 80 93 90 02 sts 0x0290, r24 ; 0x800290 28664: 90 93 91 02 sts 0x0291, r25 ; 0x800291 28668: a0 93 92 02 sts 0x0292, r26 ; 0x800292 2866c: b0 93 93 02 sts 0x0293, r27 ; 0x800293 saved_feedmultiply2 = feedmultiply; //save feedmultiply 28670: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 28674: 90 91 8f 02 lds r25, 0x028F ; 0x80028f 28678: 90 93 f4 11 sts 0x11F4, r25 ; 0x8011f4 <_ZL19saved_feedmultiply2.lto_priv.502+0x1> 2867c: 80 93 f3 11 sts 0x11F3, r24 ; 0x8011f3 <_ZL19saved_feedmultiply2.lto_priv.502> saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); 28680: 80 91 f1 11 lds r24, 0x11F1 ; 0x8011f1 28684: 90 91 f2 11 lds r25, 0x11F2 ; 0x8011f2 28688: 90 93 f0 11 sts 0x11F0, r25 ; 0x8011f0 2868c: 80 93 ef 11 sts 0x11EF, r24 ; 0x8011ef saved_bed_temperature = (uint8_t)degTargetBed(); 28690: 80 91 ed 11 lds r24, 0x11ED ; 0x8011ed 28694: 80 93 ec 11 sts 0x11EC, r24 ; 0x8011ec saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 28698: 80 91 eb 11 lds r24, 0x11EB ; 0x8011eb 2869c: 83 fb bst r24, 3 2869e: 88 27 eor r24, r24 286a0: 80 f9 bld r24, 0 286a2: 80 93 ea 11 sts 0x11EA, r24 ; 0x8011ea saved_fan_speed = fanSpeed; 286a6: 80 91 e9 11 lds r24, 0x11E9 ; 0x8011e9 286aa: 80 93 e8 11 sts 0x11E8, r24 ; 0x8011e8 cmdqueue_reset(); //empty cmdqueue 286ae: 0e 94 16 73 call 0xe62c ; 0xe62c card.sdprinting = false; 286b2: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a // card.closefile(); saved_printing = true; 286b6: 81 e0 ldi r24, 0x01 ; 1 286b8: 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(); 286bc: 0f 94 da 22 call 0x245b4 ; 0x245b4 sei(); 286c0: 78 94 sei if ((z_move != 0) || (e_move != 0)) { // extruder or z move 286c2: 20 e0 ldi r18, 0x00 ; 0 286c4: 30 e0 ldi r19, 0x00 ; 0 286c6: a9 01 movw r20, r18 286c8: f8 01 movw r30, r16 286ca: 6c 2f mov r22, r28 286cc: 7d 2f mov r23, r29 286ce: 8f 2f mov r24, r31 286d0: 90 2f mov r25, r16 286d2: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 286d6: 88 23 and r24, r24 286d8: e1 f0 breq .+56 ; 0x28712 // move away from the print. if(e_move) { // First unretract (relative extrusion) if(!saved_extruder_relative_mode){ 286da: 80 91 ea 11 lds r24, 0x11EA ; 0x8011ea 286de: 81 11 cpse r24, r1 286e0: 05 c0 rjmp .+10 ; 0x286ec enquecommand_P(MSG_M83); 286e2: 61 e0 ldi r22, 0x01 ; 1 286e4: 85 e3 ldi r24, 0x35 ; 53 286e6: 9c e6 ldi r25, 0x6C ; 108 286e8: 0e 94 ac 7c call 0xf958 ; 0xf958 // 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); 286ec: 0f 93 push r16 286ee: 1f 93 push r17 286f0: df 93 push r29 286f2: cf 93 push r28 286f4: 85 e2 ldi r24, 0x25 ; 37 286f6: 9c e6 ldi r25, 0x6C ; 108 286f8: 9f 93 push r25 286fa: 8f 93 push r24 286fc: 0e 94 4a 7d call 0xfa94 ; 0xfa94 28700: 81 e0 ldi r24, 0x01 ; 1 28702: 80 93 e6 11 sts 0x11E6, r24 ; 0x8011e6 28706: 0f 90 pop r0 28708: 0f 90 pop r0 2870a: 0f 90 pop r0 2870c: 0f 90 pop r0 2870e: 0f 90 pop r0 28710: 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(); } } 28712: df 91 pop r29 28714: cf 91 pop r28 28716: 1f 91 pop r17 28718: 0f 91 pop r16 2871a: ff 90 pop r15 2871c: ef 90 pop r14 2871e: df 90 pop r13 28720: cf 90 pop r12 28722: 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 28724: 80 91 d5 11 lds r24, 0x11D5 ; 0x8011d5 28728: 88 23 and r24, r24 2872a: b1 f1 breq .+108 ; 0x28798 saved_sdpos = gcode_LastN; //start with line number of command added recently to cmd queue 2872c: 80 91 d1 11 lds r24, 0x11D1 ; 0x8011d1 28730: 90 91 d2 11 lds r25, 0x11D2 ; 0x8011d2 28734: a0 91 d3 11 lds r26, 0x11D3 ; 0x8011d3 28738: b0 91 d4 11 lds r27, 0x11D4 ; 0x8011d4 2873c: 80 93 d8 11 sts 0x11D8, r24 ; 0x8011d8 28740: 90 93 d9 11 sts 0x11D9, r25 ; 0x8011d9 28744: a0 93 da 11 sts 0x11DA, r26 ; 0x8011da 28748: 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 2874c: 0f 94 24 75 call 0x2ea48 ; 0x2ea48 saved_sdpos -= nlines; 28750: 40 91 d8 11 lds r20, 0x11D8 ; 0x8011d8 28754: 50 91 d9 11 lds r21, 0x11D9 ; 0x8011d9 28758: 60 91 da 11 lds r22, 0x11DA ; 0x8011da 2875c: 70 91 db 11 lds r23, 0x11DB ; 0x8011db 28760: 48 1b sub r20, r24 28762: 51 09 sbc r21, r1 28764: 61 09 sbc r22, r1 28766: 71 09 sbc r23, r1 saved_sdpos -= buflen; //number of blocks in cmd buffer 28768: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 2876c: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 28770: 09 2e mov r0, r25 28772: 00 0c add r0, r0 28774: aa 0b sbc r26, r26 28776: bb 0b sbc r27, r27 28778: 48 1b sub r20, r24 2877a: 59 0b sbc r21, r25 2877c: 6a 0b sbc r22, r26 2877e: 7b 0b sbc r23, r27 28780: 40 93 d8 11 sts 0x11D8, r20 ; 0x8011d8 28784: 50 93 d9 11 sts 0x11D9, r21 ; 0x8011d9 28788: 60 93 da 11 sts 0x11DA, r22 ; 0x8011da 2878c: 70 93 db 11 sts 0x11DB, r23 ; 0x8011db saved_printing_type = PowerPanic::PRINT_TYPE_HOST; 28790: 81 e0 ldi r24, 0x01 ; 1 } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; 28792: 80 93 79 02 sts 0x0279, r24 ; 0x800279 28796: 24 cf rjmp .-440 ; 0x285e0 28798: 82 e0 ldi r24, 0x02 ; 2 2879a: fb cf rjmp .-10 ; 0x28792 saved_feedrate2 = current_block->gcode_feedrate; saved_segment_idx = current_block->segment_idx; } else { saved_start_position[0] = SAVED_START_POSITION_UNSET; 2879c: 80 e0 ldi r24, 0x00 ; 0 2879e: 90 e0 ldi r25, 0x00 ; 0 287a0: a0 e8 ldi r26, 0x80 ; 128 287a2: bf eb ldi r27, 0xBF ; 191 287a4: 80 93 7e 02 sts 0x027E, r24 ; 0x80027e 287a8: 90 93 7f 02 sts 0x027F, r25 ; 0x80027f 287ac: a0 93 80 02 sts 0x0280, r26 ; 0x800280 287b0: b0 93 81 02 sts 0x0281, r27 ; 0x800281 saved_feedrate2 = feedrate; 287b4: 60 91 7a 02 lds r22, 0x027A ; 0x80027a 287b8: 70 91 7b 02 lds r23, 0x027B ; 0x80027b 287bc: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 287c0: 90 91 7d 02 lds r25, 0x027D ; 0x80027d 287c4: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 287c8: 70 93 e3 11 sts 0x11E3, r23 ; 0x8011e3 287cc: 60 93 e2 11 sts 0x11E2, r22 ; 0x8011e2 saved_segment_idx = 0; 287d0: 10 92 e1 11 sts 0x11E1, r1 ; 0x8011e1 287d4: 10 92 e0 11 sts 0x11E0, r1 ; 0x8011e0 287d8: 32 cf rjmp .-412 ; 0x2863e 000287da : // "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) { 287da: 80 91 ce 11 lds r24, 0x11CE ; 0x8011ce 287de: 81 11 cpse r24, r1 287e0: 24 c0 rjmp .+72 ; 0x2882a Stopped = true; 287e2: 81 e0 ldi r24, 0x01 ; 1 287e4: 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); 287e8: 61 e0 ldi r22, 0x01 ; 1 287ea: 80 e0 ldi r24, 0x00 ; 0 287ec: 0e 94 cc ef call 0x1df98 ; 0x1df98 } // Report the error on the serial serialprintPGM(allow_recovery ? echomagic : errormagic); 287f0: 84 e4 ldi r24, 0x44 ; 68 287f2: 9d e9 ldi r25, 0x9D ; 157 287f4: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ERRORLNRPGM(MSG_ERR_STOPPED); 287f8: 80 ef ldi r24, 0xF0 ; 240 287fa: 9b e6 ldi r25, 0x6B ; 107 287fc: 0e 94 49 72 call 0xe492 ; 0xe492 // 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)); 28800: 8e e9 ldi r24, 0x9E ; 158 28802: 9a e5 ldi r25, 0x5A ; 90 28804: 0e 94 a7 6c call 0xd94e ; 0xd94e 28808: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 // 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); 2880c: 9f b7 in r25, 0x3f ; 63 2880e: f8 94 cli 28810: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 28814: 84 60 ori r24, 0x04 ; 4 28816: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2881a: 9f bf out 0x3f, r25 ; 63 // Always return to the status screen to ensure the NEW error is immediately shown. lcd_return_to_status(); 2881c: 0e 94 6d fe call 0x1fcda ; 0x1fcda if(!allow_recovery) { // prevent menu access for all fatal errors menu_set_block(MENU_BLOCK_THERMAL_ERROR); 28820: 80 91 cd 11 lds r24, 0x11CD ; 0x8011cd 28824: 81 60 ori r24, 0x01 ; 1 28826: 80 93 cd 11 sts 0x11CD, r24 ; 0x8011cd } } } 2882a: 08 95 ret 0002882c : bool cmd_buffer_empty() { return (buflen == 0); } void enquecommand_front(const char *cmd, bool from_progmem) 2882c: 0f 93 push r16 2882e: 1f 93 push r17 28830: cf 93 push r28 28832: df 93 push r29 28834: ec 01 movw r28, r24 28836: 0f 94 59 9e call 0x33cb2 ; 0x33cb2 <__strlen_P> 2883a: 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) 2883c: 80 36 cpi r24, 0x60 ; 96 2883e: 91 05 cpc r25, r1 28840: 08 f0 brcs .+2 ; 0x28844 28842: 85 c0 rjmp .+266 ; 0x2894e return false; // Remove the currently processed command from the queue. if (! cmdbuffer_front_already_processed) { 28844: 80 91 e6 11 lds r24, 0x11E6 ; 0x8011e6 28848: 81 11 cpse r24, r1 2884a: 05 c0 rjmp .+10 ; 0x28856 cmdqueue_pop_front(); 2884c: 0e 94 c9 6f call 0xdf92 ; 0xdf92 cmdbuffer_front_already_processed = true; 28850: 81 e0 ldi r24, 0x01 ; 1 28852: 80 93 e6 11 sts 0x11E6, r24 ; 0x8011e6 } if (bufindr == bufindw && buflen > 0) 28856: 40 91 cb 11 lds r20, 0x11CB ; 0x8011cb 2885a: 50 91 cc 11 lds r21, 0x11CC ; 0x8011cc 2885e: 80 91 dc 0f lds r24, 0x0FDC ; 0x800fdc <_ZL7bufindw.lto_priv.516> 28862: 90 91 dd 0f lds r25, 0x0FDD ; 0x800fdd <_ZL7bufindw.lto_priv.516+0x1> 28866: 48 17 cp r20, r24 28868: 59 07 cpc r21, r25 2886a: 41 f4 brne .+16 ; 0x2887c 2886c: 20 91 cf 11 lds r18, 0x11CF ; 0x8011cf 28870: 30 91 d0 11 lds r19, 0x11D0 ; 0x8011d0 28874: 12 16 cp r1, r18 28876: 13 06 cpc r1, r19 28878: 0c f4 brge .+2 ; 0x2887c 2887a: 69 c0 rjmp .+210 ; 0x2894e // 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; 2887c: 20 91 da 0f lds r18, 0x0FDA ; 0x800fda 28880: 30 91 db 0f lds r19, 0x0FDB ; 0x800fdb 28884: 12 16 cp r1, r18 28886: 13 06 cpc r1, r19 28888: 0c f0 brlt .+2 ; 0x2888c 2888a: 41 c0 rjmp .+130 ; 0x2890e 2888c: 9c 01 movw r18, r24 2888e: 2f 59 subi r18, 0x9F ; 159 28890: 3f 4f sbci r19, 0xFF ; 255 if (bufindw < bufindr) { 28892: 84 17 cp r24, r20 28894: 95 07 cpc r25, r21 28896: e8 f5 brcc .+122 ; 0x28912 int bufindr_new = bufindr - len_asked - (1 + CMDHDRSIZE); 28898: 44 50 subi r20, 0x04 ; 4 2889a: 51 09 sbc r21, r1 2889c: 40 1b sub r20, r16 2889e: 51 0b sbc r21, r17 // Simple case. There is a contiguous space between the write buffer and the read buffer. if (endw <= bufindr_new) { 288a0: 42 17 cp r20, r18 288a2: 53 07 cpc r21, r19 288a4: 0c f4 brge .+2 ; 0x288a8 288a6: 53 c0 rjmp .+166 ; 0x2894e } } 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); 288a8: 50 93 cc 11 sts 0x11CC, r21 ; 0x8011cc 288ac: 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; 288b0: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 288b4: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc 288b8: fc 01 movw r30, r24 288ba: e2 52 subi r30, 0x22 ; 34 288bc: f0 4f sbci r31, 0xF0 ; 240 288be: 23 e0 ldi r18, 0x03 ; 3 288c0: 20 83 st Z, r18 if (from_progmem) strcpy_P(cmdbuffer + bufindr + CMDHDRSIZE, cmd); 288c2: be 01 movw r22, r28 288c4: 8f 51 subi r24, 0x1F ; 31 288c6: 90 4f sbci r25, 0xF0 ; 240 288c8: 0f 94 52 9e call 0x33ca4 ; 0x33ca4 else strcpy(cmdbuffer + bufindr + CMDHDRSIZE, cmd); ++ buflen; 288cc: 80 91 cf 11 lds r24, 0x11CF ; 0x8011cf 288d0: 90 91 d0 11 lds r25, 0x11D0 ; 0x8011d0 288d4: 01 96 adiw r24, 0x01 ; 1 288d6: 90 93 d0 11 sts 0x11D0, r25 ; 0x8011d0 288da: 80 93 cf 11 sts 0x11CF, r24 ; 0x8011cf SERIAL_ECHO_START; 288de: 81 e6 ldi r24, 0x61 ; 97 288e0: 9d e9 ldi r25, 0x9D ; 157 288e2: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHORPGM(enqueingFront); 288e6: 8b e2 ldi r24, 0x2B ; 43 288e8: 9d e9 ldi r25, 0x9D ; 157 288ea: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHO(cmdbuffer + bufindr + CMDHDRSIZE); 288ee: 80 91 cb 11 lds r24, 0x11CB ; 0x8011cb 288f2: 90 91 cc 11 lds r25, 0x11CC ; 0x8011cc } }*/ static FORCE_INLINE void print(const char *str) { write(str); 288f6: 8f 51 subi r24, 0x1F ; 31 288f8: 90 4f sbci r25, 0xF0 ; 240 288fa: 0e 94 a0 7c call 0xf940 ; 0xf940 SERIAL_ECHOLNPGM("\""); 288fe: 89 e2 ldi r24, 0x29 ; 41 28900: 9d e9 ldi r25, 0x9D ; 157 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 28902: df 91 pop r29 28904: cf 91 pop r28 28906: 1f 91 pop r17 28908: 0f 91 pop r16 SERIAL_ECHORPGM(enqueingFront); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2890a: 0c 94 49 72 jmp 0xe492 ; 0xe492 // 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) 2890e: 9c 01 movw r18, r24 28910: c0 cf rjmp .-128 ; 0x28892 bufindr = bufindr_new; return true; } } else { // Otherwise the free space is split between the start and end. if (len_asked + (1 + CMDHDRSIZE) <= bufindr) { 28912: c8 01 movw r24, r16 28914: 04 96 adiw r24, 0x04 ; 4 28916: 48 17 cp r20, r24 28918: 59 07 cpc r21, r25 2891a: 28 f0 brcs .+10 ; 0x28926 // Could fit at the start. bufindr -= len_asked + (1 + CMDHDRSIZE); 2891c: 44 50 subi r20, 0x04 ; 4 2891e: 51 09 sbc r21, r1 28920: 40 1b sub r20, r16 28922: 51 0b sbc r21, r17 28924: c1 cf rjmp .-126 ; 0x288a8 return true; } int bufindr_new = sizeof(cmdbuffer) - len_asked - (1 + CMDHDRSIZE); 28926: 89 ee ldi r24, 0xE9 ; 233 28928: 91 e0 ldi r25, 0x01 ; 1 2892a: bc 01 movw r22, r24 2892c: 60 1b sub r22, r16 2892e: 71 0b sbc r23, r17 28930: 8b 01 movw r16, r22 if (endw <= bufindr_new) { 28932: 62 17 cp r22, r18 28934: 73 07 cpc r23, r19 28936: 5c f0 brlt .+22 ; 0x2894e memset(cmdbuffer, 0, bufindr); 28938: 70 e0 ldi r23, 0x00 ; 0 2893a: 60 e0 ldi r22, 0x00 ; 0 2893c: 8e ed ldi r24, 0xDE ; 222 2893e: 9f e0 ldi r25, 0x0F ; 15 28940: 0f 94 cd a6 call 0x34d9a ; 0x34d9a bufindr = bufindr_new; 28944: 10 93 cc 11 sts 0x11CC, r17 ; 0x8011cc 28948: 00 93 cb 11 sts 0x11CB, r16 ; 0x8011cb 2894c: b1 cf rjmp .-158 ; 0x288b0 SERIAL_ECHOLNPGM("\""); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 2894e: 84 e4 ldi r24, 0x44 ; 68 28950: 9d e9 ldi r25, 0x9D ; 157 28952: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHORPGM(enqueingFront); 28956: 8b e2 ldi r24, 0x2B ; 43 28958: 9d e9 ldi r25, 0x9D ; 157 2895a: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 2895e: ce 01 movw r24, r28 28960: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 28964: 82 e1 ldi r24, 0x12 ; 18 28966: 9d e9 ldi r25, 0x9D ; 157 28968: cc cf rjmp .-104 ; 0x28902 0002896a : } else { return false; } } bool SdFile::seekSetFilteredGcode(uint32_t pos){ 2896a: ab 01 movw r20, r22 2896c: bc 01 movw r22, r24 if(! seekSet(pos) )return false; 2896e: 8a ef ldi r24, 0xFA ; 250 28970: 95 e1 ldi r25, 0x15 ; 21 28972: 0f 94 f7 39 call 0x273ee ; 0x273ee 28976: 81 11 cpse r24, r1 28978: 02 c0 rjmp .+4 ; 0x2897e 2897a: 80 e0 ldi r24, 0x00 ; 0 2897c: 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() ) 2897e: 8a ef ldi r24, 0xFA ; 250 28980: 95 e1 ldi r25, 0x15 ; 21 28982: 0f 94 e1 38 call 0x271c2 ; 0x271c2 28986: 88 23 and r24, r24 28988: c1 f3 breq .-16 ; 0x2897a 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; 2898a: 20 91 1b 16 lds r18, 0x161B ; 0x80161b 2898e: 30 91 1c 16 lds r19, 0x161C ; 0x80161c 28992: 27 52 subi r18, 0x27 ; 39 28994: 32 4f sbci r19, 0xF2 ; 242 28996: 30 93 16 16 sts 0x1616, r19 ; 0x801616 2899a: 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; } 2899e: 08 95 ret 000289a0 : SERIAL_PROTOCOLLNPGM("An error while writing to the SD Card."); } } void CardReader::checkautostart(bool force) 289a0: 8f 92 push r8 289a2: 9f 92 push r9 289a4: af 92 push r10 289a6: bf 92 push r11 289a8: cf 92 push r12 289aa: df 92 push r13 289ac: ef 92 push r14 289ae: ff 92 push r15 289b0: 0f 93 push r16 289b2: 1f 93 push r17 289b4: cf 93 push r28 289b6: df 93 push r29 289b8: cd b7 in r28, 0x3d ; 61 289ba: de b7 in r29, 0x3e ; 62 289bc: ee 97 sbiw r28, 0x3e ; 62 289be: 0f b6 in r0, 0x3f ; 63 289c0: f8 94 cli 289c2: de bf out 0x3e, r29 ; 62 289c4: 0f be out 0x3f, r0 ; 63 289c6: cd bf out 0x3d, r28 ; 61 if(!mounted) //fail return; } char autoname[30]; sprintf_P(autoname, PSTR("auto%i.g"), lastnr); 289c8: 80 91 b8 13 lds r24, 0x13B8 ; 0x8013b8 289cc: 8f 93 push r24 289ce: 80 91 b7 13 lds r24, 0x13B7 ; 0x8013b7 289d2: 8f 93 push r24 289d4: 8d ec ldi r24, 0xCD ; 205 289d6: 9c e9 ldi r25, 0x9C ; 156 289d8: 9f 93 push r25 289da: 8f 93 push r24 289dc: 8e 01 movw r16, r28 289de: 0f 5d subi r16, 0xDF ; 223 289e0: 1f 4f sbci r17, 0xFF ; 255 289e2: 1f 93 push r17 289e4: 0f 93 push r16 289e6: 0f 94 b2 9f call 0x33f64 ; 0x33f64 289ea: 0f 90 pop r0 289ec: 0f 90 pop r0 289ee: 0f 90 pop r0 289f0: 0f 90 pop r0 289f2: 0f 90 pop r0 289f4: 0f 90 pop r0 for(int8_t i=0;i<(int8_t)strlen(autoname);i++) 289f6: f1 2c mov r15, r1 289f8: f8 01 movw r30, r16 289fa: 01 90 ld r0, Z+ 289fc: 00 20 and r0, r0 289fe: e9 f7 brne .-6 ; 0x289fa 28a00: 31 97 sbiw r30, 0x01 ; 1 28a02: e0 1b sub r30, r16 28a04: f1 0b sbc r31, r17 28a06: fe 16 cp r15, r30 28a08: 84 f4 brge .+32 ; 0x28a2a autoname[i]=tolower(autoname[i]); 28a0a: 68 01 movw r12, r16 28a0c: cf 0c add r12, r15 28a0e: d1 1c adc r13, r1 28a10: f7 fc sbrc r15, 7 28a12: da 94 dec r13 28a14: f6 01 movw r30, r12 28a16: 80 81 ld r24, Z 28a18: 08 2e mov r0, r24 28a1a: 00 0c add r0, r0 28a1c: 99 0b sbc r25, r25 28a1e: 0f 94 af a6 call 0x34d5e ; 0x34d5e 28a22: f6 01 movw r30, r12 28a24: 80 83 st Z, r24 28a26: f3 94 inc r15 28a28: e7 cf rjmp .-50 ; 0x289f8 dir_t p; root.rewind(); 28a2a: 80 ef ldi r24, 0xF0 ; 240 28a2c: 93 e1 ldi r25, 0x13 ; 19 28a2e: 0e 94 2c 70 call 0xe058 ; 0xe058 bool found=false; 28a32: a1 2c mov r10, r1 28a34: ce 01 movw r24, r28 28a36: 01 96 adiw r24, 0x01 ; 1 28a38: 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); 28a3a: 89 ee ldi r24, 0xE9 ; 233 28a3c: c8 2e mov r12, r24 28a3e: 8b e6 ldi r24, 0x6B ; 107 28a40: 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; 28a42: 80 91 f3 13 lds r24, 0x13F3 ; 0x8013f3 28a46: 82 30 cpi r24, 0x02 ; 2 28a48: 08 f4 brcc .+2 ; 0x28a4c 28a4a: 50 c0 rjmp .+160 ; 0x28aec 28a4c: 80 91 f8 13 lds r24, 0x13F8 ; 0x8013f8 28a50: 90 91 f9 13 lds r25, 0x13F9 ; 0x8013f9 28a54: a0 91 fa 13 lds r26, 0x13FA ; 0x8013fa 28a58: b0 91 fb 13 lds r27, 0x13FB ; 0x8013fb 28a5c: 8f 71 andi r24, 0x1F ; 31 28a5e: 99 27 eor r25, r25 28a60: aa 27 eor r26, r26 28a62: bb 27 eor r27, r27 28a64: 89 2b or r24, r25 28a66: 8a 2b or r24, r26 28a68: 8b 2b or r24, r27 28a6a: 09 f0 breq .+2 ; 0x28a6e 28a6c: 3f c0 rjmp .+126 ; 0x28aec 28a6e: 50 e0 ldi r21, 0x00 ; 0 28a70: 40 e0 ldi r20, 0x00 ; 0 28a72: b7 01 movw r22, r14 28a74: 80 ef ldi r24, 0xF0 ; 240 28a76: 93 e1 ldi r25, 0x13 ; 19 28a78: 0f 94 5a 39 call 0x272b4 ; 0x272b4 dir_t p; root.rewind(); bool found=false; while (root.readDir(p, NULL) > 0) 28a7c: 18 16 cp r1, r24 28a7e: b4 f5 brge .+108 ; 0x28aec { for(int8_t i=0;i<(int8_t)strlen((char*)p.name);i++) 28a80: b1 2c mov r11, r1 28a82: f7 01 movw r30, r14 28a84: 01 90 ld r0, Z+ 28a86: 00 20 and r0, r0 28a88: e9 f7 brne .-6 ; 0x28a84 28a8a: 31 97 sbiw r30, 0x01 ; 1 28a8c: ee 19 sub r30, r14 28a8e: ff 09 sbc r31, r15 28a90: be 16 cp r11, r30 28a92: 74 f4 brge .+28 ; 0x28ab0 p.name[i]=tolower(p.name[i]); 28a94: 47 01 movw r8, r14 28a96: 8b 0c add r8, r11 28a98: 91 1c adc r9, r1 28a9a: b7 fc sbrc r11, 7 28a9c: 9a 94 dec r9 28a9e: f4 01 movw r30, r8 28aa0: 80 81 ld r24, Z 28aa2: 90 e0 ldi r25, 0x00 ; 0 28aa4: 0f 94 af a6 call 0x34d5e ; 0x34d5e 28aa8: f4 01 movw r30, r8 28aaa: 80 83 st Z, r24 28aac: b3 94 inc r11 28aae: e9 cf rjmp .-46 ; 0x28a82 //Serial.print((char*)p.name); //Serial.print(" "); //Serial.println(autoname); if(p.name[9]!='~') //skip safety copies 28ab0: 8a 85 ldd r24, Y+10 ; 0x0a 28ab2: 8e 37 cpi r24, 0x7E ; 126 28ab4: 31 f2 breq .-116 ; 0x28a42 if(strncmp((char*)p.name,autoname,5)==0) 28ab6: 45 e0 ldi r20, 0x05 ; 5 28ab8: 50 e0 ldi r21, 0x00 ; 0 28aba: b8 01 movw r22, r16 28abc: c7 01 movw r24, r14 28abe: 0f 94 0d a7 call 0x34e1a ; 0x34e1a 28ac2: 89 2b or r24, r25 28ac4: 09 f0 breq .+2 ; 0x28ac8 28ac6: bd cf rjmp .-134 ; 0x28a42 { // M23: Select SD file enquecommandf_P(MSG_M23, autoname); 28ac8: 1f 93 push r17 28aca: 0f 93 push r16 28acc: df 92 push r13 28ace: cf 92 push r12 28ad0: 0e 94 4a 7d call 0xfa94 ; 0xfa94 // M24: Start/resume SD print enquecommand_P(MSG_M24); 28ad4: 61 e0 ldi r22, 0x01 ; 1 28ad6: 85 ee ldi r24, 0xE5 ; 229 28ad8: 9b e6 ldi r25, 0x6B ; 107 28ada: 0e 94 ac 7c call 0xf958 ; 0xf958 28ade: 0f 90 pop r0 28ae0: 0f 90 pop r0 28ae2: 0f 90 pop r0 28ae4: 0f 90 pop r0 found=true; 28ae6: aa 24 eor r10, r10 28ae8: a3 94 inc r10 28aea: ab cf rjmp .-170 ; 0x28a42 } } if(!found) lastnr=-1; 28aec: 8f ef ldi r24, 0xFF ; 255 28aee: 9f ef ldi r25, 0xFF ; 255 // M24: Start/resume SD print enquecommand_P(MSG_M24); found=true; } } if(!found) 28af0: aa 20 and r10, r10 28af2: 29 f0 breq .+10 ; 0x28afe lastnr=-1; else lastnr++; 28af4: 80 91 b7 13 lds r24, 0x13B7 ; 0x8013b7 28af8: 90 91 b8 13 lds r25, 0x13B8 ; 0x8013b8 28afc: 01 96 adiw r24, 0x01 ; 1 28afe: 90 93 b8 13 sts 0x13B8, r25 ; 0x8013b8 28b02: 80 93 b7 13 sts 0x13B7, r24 ; 0x8013b7 } 28b06: ee 96 adiw r28, 0x3e ; 62 28b08: 0f b6 in r0, 0x3f ; 63 28b0a: f8 94 cli 28b0c: de bf out 0x3e, r29 ; 62 28b0e: 0f be out 0x3f, r0 ; 63 28b10: cd bf out 0x3d, r28 ; 61 28b12: df 91 pop r29 28b14: cf 91 pop r28 28b16: 1f 91 pop r17 28b18: 0f 91 pop r16 28b1a: ff 90 pop r15 28b1c: ef 90 pop r14 28b1e: df 90 pop r13 28b20: cf 90 pop r12 28b22: bf 90 pop r11 28b24: af 90 pop r10 28b26: 9f 90 pop r9 28b28: 8f 90 pop r8 28b2a: 08 95 ret 00028b2c : * \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) { 28b2c: 8f 92 push r8 28b2e: 9f 92 push r9 28b30: af 92 push r10 28b32: bf 92 push r11 28b34: cf 92 push r12 28b36: df 92 push r13 28b38: ef 92 push r14 28b3a: ff 92 push r15 28b3c: 0f 93 push r16 28b3e: 1f 93 push r17 28b40: cf 93 push r28 28b42: df 93 push r29 28b44: 00 d0 rcall .+0 ; 0x28b46 28b46: 1f 92 push r1 28b48: cd b7 in r28, 0x3d ; 61 28b4a: de b7 in r29, 0x3e ; 62 28b4c: fc 01 movw r30, r24 uint32_t newPos; // error if not a normal file or read-only if (!isFile() || !(flags_ & O_WRITE)) goto fail; 28b4e: 83 81 ldd r24, Z+3 ; 0x03 28b50: 81 30 cpi r24, 0x01 ; 1 28b52: 11 f0 breq .+4 ; 0x28b58 // set file to correct position return seekSet(newPos); fail: return false; 28b54: 80 e0 ldi r24, 0x00 ; 0 28b56: 60 c0 rjmp .+192 ; 0x28c18 * \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; 28b58: 81 81 ldd r24, Z+1 ; 0x01 28b5a: 81 ff sbrs r24, 1 28b5c: fb cf rjmp .-10 ; 0x28b54 // 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; 28b5e: 81 89 ldd r24, Z+17 ; 0x11 28b60: 92 89 ldd r25, Z+18 ; 0x12 28b62: a3 89 ldd r26, Z+19 ; 0x13 28b64: b4 89 ldd r27, Z+20 ; 0x14 28b66: 89 2b or r24, r25 28b68: 8a 2b or r24, r26 28b6a: 8b 2b or r24, r27 28b6c: 09 f4 brne .+2 ; 0x28b70 28b6e: 6e c0 rjmp .+220 ; 0x28c4c 28b70: 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; 28b72: 40 e0 ldi r20, 0x00 ; 0 28b74: 50 e0 ldi r21, 0x00 ; 0 28b76: ba 01 movw r22, r20 28b78: cf 01 movw r24, r30 28b7a: 0f 94 f7 39 call 0x273ee ; 0x273ee 28b7e: 88 23 and r24, r24 28b80: 49 f3 breq .-46 ; 0x28b54 if (length == 0) { // free all clusters if (!vol_->freeChain(firstCluster_)) goto fail; 28b82: f7 01 movw r30, r14 28b84: c1 8c ldd r12, Z+25 ; 0x19 28b86: d2 8c ldd r13, Z+26 ; 0x1a 28b88: 85 88 ldd r8, Z+21 ; 0x15 28b8a: 96 88 ldd r9, Z+22 ; 0x16 28b8c: a7 88 ldd r10, Z+23 ; 0x17 28b8e: 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; 28b90: 82 e0 ldi r24, 0x02 ; 2 28b92: 90 e0 ldi r25, 0x00 ; 0 28b94: a0 e0 ldi r26, 0x00 ; 0 28b96: b0 e0 ldi r27, 0x00 ; 0 28b98: f6 01 movw r30, r12 28b9a: 80 83 st Z, r24 28b9c: 91 83 std Z+1, r25 ; 0x01 28b9e: a2 83 std Z+2, r26 ; 0x02 28ba0: b3 83 std Z+3, r27 ; 0x03 do { if (!fatGet(cluster, &next)) goto fail; 28ba2: 9e 01 movw r18, r28 28ba4: 2f 5f subi r18, 0xFF ; 255 28ba6: 3f 4f sbci r19, 0xFF ; 255 28ba8: b5 01 movw r22, r10 28baa: a4 01 movw r20, r8 28bac: c6 01 movw r24, r12 28bae: 0f 94 f4 37 call 0x26fe8 ; 0x26fe8 28bb2: 88 23 and r24, r24 28bb4: 79 f2 breq .-98 ; 0x28b54 // free cluster if (!fatPut(cluster, 0)) goto fail; 28bb6: 00 e0 ldi r16, 0x00 ; 0 28bb8: 10 e0 ldi r17, 0x00 ; 0 28bba: 98 01 movw r18, r16 28bbc: b5 01 movw r22, r10 28bbe: a4 01 movw r20, r8 28bc0: c6 01 movw r24, r12 28bc2: 0f 94 62 37 call 0x26ec4 ; 0x26ec4 28bc6: 88 23 and r24, r24 28bc8: 29 f2 breq .-118 ; 0x28b54 cluster = next; 28bca: 89 80 ldd r8, Y+1 ; 0x01 28bcc: 9a 80 ldd r9, Y+2 ; 0x02 28bce: ab 80 ldd r10, Y+3 ; 0x03 28bd0: 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; 28bd2: f6 01 movw r30, r12 28bd4: 87 89 ldd r24, Z+23 ; 0x17 28bd6: 80 31 cpi r24, 0x10 ; 16 28bd8: 81 f5 brne .+96 ; 0x28c3a 28bda: f8 ef ldi r31, 0xF8 ; 248 28bdc: 8f 16 cp r8, r31 28bde: ff ef ldi r31, 0xFF ; 255 28be0: 9f 06 cpc r9, r31 28be2: a1 04 cpc r10, r1 28be4: b1 04 cpc r11, r1 28be6: e8 f2 brcs .-70 ; 0x28ba2 firstCluster_ = 0; 28be8: f7 01 movw r30, r14 28bea: 15 8a std Z+21, r1 ; 0x15 28bec: 16 8a std Z+22, r1 ; 0x16 28bee: 17 8a std Z+23, r1 ; 0x17 28bf0: 10 8e std Z+24, r1 ; 0x18 // current cluster is end of chain if (!vol_->fatPutEOC(curCluster_)) goto fail; } } fileSize_ = length; 28bf2: 11 8a std Z+17, r1 ; 0x11 28bf4: 12 8a std Z+18, r1 ; 0x12 28bf6: 13 8a std Z+19, r1 ; 0x13 28bf8: 14 8a std Z+20, r1 ; 0x14 // need to update directory entry flags_ |= F_FILE_DIR_DIRTY; 28bfa: 81 81 ldd r24, Z+1 ; 0x01 28bfc: 80 68 ori r24, 0x80 ; 128 28bfe: 81 83 std Z+1, r24 ; 0x01 if (!sync()) goto fail; 28c00: c7 01 movw r24, r14 28c02: 0f 94 c2 39 call 0x27384 ; 0x27384 28c06: 88 23 and r24, r24 28c08: 09 f4 brne .+2 ; 0x28c0c 28c0a: a4 cf rjmp .-184 ; 0x28b54 // set file to correct position return seekSet(newPos); 28c0c: 40 e0 ldi r20, 0x00 ; 0 28c0e: 50 e0 ldi r21, 0x00 ; 0 28c10: ba 01 movw r22, r20 28c12: c7 01 movw r24, r14 28c14: 0f 94 f7 39 call 0x273ee ; 0x273ee fail: return false; } 28c18: 0f 90 pop r0 28c1a: 0f 90 pop r0 28c1c: 0f 90 pop r0 28c1e: 0f 90 pop r0 28c20: df 91 pop r29 28c22: cf 91 pop r28 28c24: 1f 91 pop r17 28c26: 0f 91 pop r16 28c28: ff 90 pop r15 28c2a: ef 90 pop r14 28c2c: df 90 pop r13 28c2e: cf 90 pop r12 28c30: bf 90 pop r11 28c32: af 90 pop r10 28c34: 9f 90 pop r9 28c36: 8f 90 pop r8 28c38: 08 95 ret return cluster >= FAT32EOC_MIN; 28c3a: 88 ef ldi r24, 0xF8 ; 248 28c3c: 88 16 cp r8, r24 28c3e: 8f ef ldi r24, 0xFF ; 255 28c40: 98 06 cpc r9, r24 28c42: a8 06 cpc r10, r24 28c44: 8f e0 ldi r24, 0x0F ; 15 28c46: b8 06 cpc r11, r24 28c48: 78 f6 brcc .-98 ; 0x28be8 28c4a: ab cf rjmp .-170 ; 0x28ba2 // 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; 28c4c: 81 e0 ldi r24, 0x01 ; 1 28c4e: e4 cf rjmp .-56 ; 0x28c18 00028c50 : +* 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) { 28c50: 2f 92 push r2 28c52: 3f 92 push r3 28c54: 4f 92 push r4 28c56: 5f 92 push r5 28c58: 6f 92 push r6 28c5a: 7f 92 push r7 28c5c: 8f 92 push r8 28c5e: 9f 92 push r9 28c60: af 92 push r10 28c62: bf 92 push r11 28c64: cf 92 push r12 28c66: df 92 push r13 28c68: ef 92 push r14 28c6a: ff 92 push r15 28c6c: 0f 93 push r16 28c6e: 1f 93 push r17 28c70: cf 93 push r28 28c72: df 93 push r29 28c74: cd b7 in r28, 0x3d ; 61 28c76: de b7 in r29, 0x3e ; 62 28c78: c6 57 subi r28, 0x76 ; 118 28c7a: d1 09 sbc r29, r1 28c7c: 0f b6 in r0, 0x3f ; 63 28c7e: f8 94 cli 28c80: de bf out 0x3e, r29 ; 62 28c82: 0f be out 0x3f, r0 ; 63 28c84: cd bf out 0x3d, r28 ; 61 28c86: 4c 01 movw r8, r24 28c88: 6b 01 movw r12, r22 28c8a: 3a 01 movw r6, r20 28c8c: e5 96 adiw r28, 0x35 ; 53 28c8e: 2f af std Y+63, r18 ; 0x3f 28c90: e5 97 sbiw r28, 0x35 ; 53 28c92: 50 2e mov r5, r16 cnt++; break; } } } // while readDir } 28c94: 2d b6 in r2, 0x3d ; 61 28c96: 3e b6 in r3, 0x3e ; 62 28c98: 10 2f mov r17, r16 28c9a: 11 70 andi r17, 0x01 ; 1 static uint8_t recursionCnt = 0; // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} 28c9c: 80 91 d8 0d lds r24, 0x0DD8 ; 0x800dd8 28ca0: 8f 5f subi r24, 0xFF ; 255 28ca2: 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()) { 28ca6: fb 01 movw r30, r22 28ca8: 80 85 ldd r24, Z+8 ; 0x08 28caa: 91 85 ldd r25, Z+9 ; 0x09 28cac: a2 85 ldd r26, Z+10 ; 0x0a 28cae: b3 85 ldd r27, Z+11 ; 0x0b 28cb0: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d 28cb4: 90 93 7e 13 sts 0x137E, r25 ; 0x80137e 28cb8: a0 93 7f 13 sts 0x137F, r26 ; 0x80137f 28cbc: b0 93 80 13 sts 0x1380, r27 ; 0x801380 _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} } recursionCntIncrementer; dir_t p; uint8_t cnt = 0; 28cc0: 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); 28cc2: 5e 01 movw r10, r28 28cc4: f7 e6 ldi r31, 0x67 ; 103 28cc6: af 0e add r10, r31 28cc8: 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; 28cca: f6 01 movw r30, r12 28ccc: 83 81 ldd r24, Z+3 ; 0x03 28cce: 82 30 cpi r24, 0x02 ; 2 28cd0: 08 f4 brcc .+2 ; 0x28cd4 28cd2: c0 c1 rjmp .+896 ; 0x29054 28cd4: 80 85 ldd r24, Z+8 ; 0x08 28cd6: 91 85 ldd r25, Z+9 ; 0x09 28cd8: a2 85 ldd r26, Z+10 ; 0x0a 28cda: b3 85 ldd r27, Z+11 ; 0x0b 28cdc: 8f 71 andi r24, 0x1F ; 31 28cde: 99 27 eor r25, r25 28ce0: aa 27 eor r26, r26 28ce2: bb 27 eor r27, r27 28ce4: 89 2b or r24, r25 28ce6: 8a 2b or r24, r26 28ce8: 8b 2b or r24, r27 28cea: 09 f0 breq .+2 ; 0x28cee 28cec: b3 c1 rjmp .+870 ; 0x29054 //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'; 28cee: 10 92 81 13 sts 0x1381, r1 ; 0x801381 28cf2: 41 e8 ldi r20, 0x81 ; 129 28cf4: 53 e1 ldi r21, 0x13 ; 19 28cf6: be 01 movw r22, r28 28cf8: 69 5b subi r22, 0xB9 ; 185 28cfa: 7f 4f sbci r23, 0xFF ; 255 28cfc: c6 01 movw r24, r12 28cfe: 0f 94 5a 39 call 0x272b4 ; 0x272b4 } 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()) { 28d02: 18 16 cp r1, r24 28d04: 0c f0 brlt .+2 ; 0x28d08 28d06: a6 c1 rjmp .+844 ; 0x29054 if (recursionCnt > MAX_DIR_DEPTH) 28d08: 80 91 d8 0d lds r24, 0x0DD8 ; 0x800dd8 28d0c: 87 30 cpi r24, 0x07 ; 7 28d0e: 08 f0 brcs .+2 ; 0x28d12 28d10: a1 c1 rjmp .+834 ; 0x29054 return; uint8_t pn0 = p.name[0]; 28d12: 28 96 adiw r28, 0x08 ; 8 28d14: 8f ad ldd r24, Y+63 ; 0x3f 28d16: 28 97 sbiw r28, 0x08 ; 8 if (pn0 == DIR_NAME_FREE) break; 28d18: 88 23 and r24, r24 28d1a: 09 f4 brne .+2 ; 0x28d1e 28d1c: 9b c1 rjmp .+822 ; 0x29054 if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue; 28d1e: 85 3e cpi r24, 0xE5 ; 229 28d20: 09 f4 brne .+2 ; 0x28d24 28d22: 39 c1 rjmp .+626 ; 0x28f96 28d24: 8e 32 cpi r24, 0x2E ; 46 28d26: 09 f4 brne .+2 ; 0x28d2a 28d28: 36 c1 rjmp .+620 ; 0x28f96 if (longFilename[0] == '.') continue; 28d2a: 80 91 81 13 lds r24, 0x1381 ; 0x801381 28d2e: 8e 32 cpi r24, 0x2E ; 46 28d30: 09 f4 brne .+2 ; 0x28d34 28d32: 31 c1 rjmp .+610 ; 0x28f96 28d34: 63 96 adiw r28, 0x13 ; 19 28d36: 8f ad ldd r24, Y+63 ; 0x3f 28d38: 63 97 sbiw r28, 0x13 ; 19 if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; 28d3a: 98 2f mov r25, r24 28d3c: 9a 70 andi r25, 0x0A ; 10 28d3e: 09 f0 breq .+2 ; 0x28d42 28d40: 2a c1 rjmp .+596 ; 0x28f96 28d42: 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; 28d44: 91 e0 ldi r25, 0x01 ; 1 28d46: 80 31 cpi r24, 0x10 ; 16 28d48: 19 f0 breq .+6 ; 0x28d50 28d4a: 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 28d4c: 80 31 cpi r24, 0x10 ; 16 28d4e: 31 f4 brne .+12 ; 0x28d5c 28d50: e5 96 adiw r28, 0x35 ; 53 28d52: ff ad ldd r31, Y+63 ; 0x3f 28d54: e5 97 sbiw r28, 0x35 ; 53 28d56: ff 23 and r31, r31 28d58: 09 f4 brne .+2 ; 0x28d5c 28d5a: 94 c0 rjmp .+296 ; 0x28e84 if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); } else { filenameIsDir = DIR_IS_SUBDIR(&p); 28d5c: 90 93 b6 13 sts 0x13B6, r25 ; 0x8013b6 if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; 28d60: 80 31 cpi r24, 0x10 ; 16 28d62: 61 f0 breq .+24 ; 0x28d7c 28d64: 60 96 adiw r28, 0x10 ; 16 28d66: 8f ad ldd r24, Y+63 ; 0x3f 28d68: 60 97 sbiw r28, 0x10 ; 16 28d6a: 87 34 cpi r24, 0x47 ; 71 28d6c: 09 f0 breq .+2 ; 0x28d70 28d6e: 13 c1 rjmp .+550 ; 0x28f96 28d70: 61 96 adiw r28, 0x11 ; 17 28d72: 8f ad ldd r24, Y+63 ; 0x3f 28d74: 61 97 sbiw r28, 0x11 ; 17 28d76: 8e 37 cpi r24, 0x7E ; 126 28d78: 09 f4 brne .+2 ; 0x28d7c 28d7a: 0d c1 rjmp .+538 ; 0x28f96 switch (lsAction) { 28d7c: e5 96 adiw r28, 0x35 ; 53 28d7e: ff ad ldd r31, Y+63 ; 0x3f 28d80: e5 97 sbiw r28, 0x35 ; 53 28d82: f1 30 cpi r31, 0x01 ; 1 28d84: 09 f4 brne .+2 ; 0x28d88 28d86: 1b c1 rjmp .+566 ; 0x28fbe 28d88: f2 30 cpi r31, 0x02 ; 2 28d8a: 09 f4 brne .+2 ; 0x28d8e 28d8c: 25 c1 rjmp .+586 ; 0x28fd8 case LS_Count: nrFiles++; break; case LS_SerialPrint: createFilename(filename, p); 28d8e: be 01 movw r22, r28 28d90: 69 5b subi r22, 0xB9 ; 185 28d92: 7f 4f sbci r23, 0xFF ; 255 28d94: 8c e6 ldi r24, 0x6C ; 108 28d96: 93 e1 ldi r25, 0x13 ; 19 28d98: 0e 94 16 70 call 0xe02c ; 0xe02c 28d9c: c4 01 movw r24, r8 28d9e: 0e 94 a0 7c call 0xf940 ; 0xf940 28da2: 8c e6 ldi r24, 0x6C ; 108 28da4: 93 e1 ldi r25, 0x13 ; 19 28da6: 0e 94 a0 7c call 0xf940 ; 0xf940 SERIAL_PROTOCOL(prepend); SERIAL_PROTOCOL(filename); MYSERIAL.write(' '); 28daa: 80 e2 ldi r24, 0x20 ; 32 28dac: 0e 94 37 70 call 0xe06e ; 0xe06e } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 28db0: a7 96 adiw r28, 0x27 ; 39 28db2: 6c ad ldd r22, Y+60 ; 0x3c 28db4: 7d ad ldd r23, Y+61 ; 0x3d 28db6: 8e ad ldd r24, Y+62 ; 0x3e 28db8: 9f ad ldd r25, Y+63 ; 0x3f 28dba: a7 97 sbiw r28, 0x27 ; 39 28dbc: 4a e0 ldi r20, 0x0A ; 10 28dbe: 0f 94 eb 96 call 0x32dd6 ; 0x32dd6 SERIAL_PROTOCOL(p.fileSize); if (lsParams.timestamp) 28dc2: 51 fe sbrs r5, 1 28dc4: 45 c0 rjmp .+138 ; 0x28e50 { crmodDate = p.lastWriteDate; 28dc6: a1 96 adiw r28, 0x21 ; 33 28dc8: 2e ad ldd r18, Y+62 ; 0x3e 28dca: 3f ad ldd r19, Y+63 ; 0x3f 28dcc: a1 97 sbiw r28, 0x21 ; 33 28dce: 30 93 7c 13 sts 0x137C, r19 ; 0x80137c 28dd2: 20 93 7b 13 sts 0x137B, r18 ; 0x80137b crmodTime = p.lastWriteTime; 28dd6: 6f 96 adiw r28, 0x1f ; 31 28dd8: 4e ad ldd r20, Y+62 ; 0x3e 28dda: 5f ad ldd r21, Y+63 ; 0x3f 28ddc: 6f 97 sbiw r28, 0x1f ; 31 28dde: 50 93 7a 13 sts 0x137A, r21 ; 0x80137a 28de2: 40 93 79 13 sts 0x1379, r20 ; 0x801379 if( crmodDate < p.creationDate || ( crmodDate == p.creationDate && crmodTime < p.creationTime ) ){ 28de6: 69 96 adiw r28, 0x19 ; 25 28de8: 8e ad ldd r24, Y+62 ; 0x3e 28dea: 9f ad ldd r25, Y+63 ; 0x3f 28dec: 69 97 sbiw r28, 0x19 ; 25 28dee: 28 17 cp r18, r24 28df0: 39 07 cpc r19, r25 28df2: 50 f0 brcs .+20 ; 0x28e08 28df4: 28 17 cp r18, r24 28df6: 39 07 cpc r19, r25 28df8: 99 f4 brne .+38 ; 0x28e20 28dfa: 67 96 adiw r28, 0x17 ; 23 28dfc: 2e ad ldd r18, Y+62 ; 0x3e 28dfe: 3f ad ldd r19, Y+63 ; 0x3f 28e00: 67 97 sbiw r28, 0x17 ; 23 28e02: 42 17 cp r20, r18 28e04: 53 07 cpc r21, r19 28e06: 60 f4 brcc .+24 ; 0x28e20 crmodDate = p.creationDate; 28e08: 90 93 7c 13 sts 0x137C, r25 ; 0x80137c 28e0c: 80 93 7b 13 sts 0x137B, r24 ; 0x80137b crmodTime = p.creationTime; 28e10: 67 96 adiw r28, 0x17 ; 23 28e12: 8e ad ldd r24, Y+62 ; 0x3e 28e14: 9f ad ldd r25, Y+63 ; 0x3f 28e16: 67 97 sbiw r28, 0x17 ; 23 28e18: 90 93 7a 13 sts 0x137A, r25 ; 0x80137a 28e1c: 80 93 79 13 sts 0x1379, r24 ; 0x801379 } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); 28e20: 80 91 7c 13 lds r24, 0x137C ; 0x80137c 28e24: 8f 93 push r24 28e26: 80 91 7b 13 lds r24, 0x137B ; 0x80137b 28e2a: 8f 93 push r24 28e2c: 80 91 7a 13 lds r24, 0x137A ; 0x80137a 28e30: 8f 93 push r24 28e32: 80 91 79 13 lds r24, 0x1379 ; 0x801379 28e36: 8f 93 push r24 28e38: 2a ea ldi r18, 0xAA ; 170 28e3a: 3c e9 ldi r19, 0x9C ; 156 28e3c: 3f 93 push r19 28e3e: 2f 93 push r18 28e40: 0f 94 5d 9f call 0x33eba ; 0x33eba 28e44: 0f 90 pop r0 28e46: 0f 90 pop r0 28e48: 0f 90 pop r0 28e4a: 0f 90 pop r0 28e4c: 0f 90 pop r0 28e4e: 0f 90 pop r0 } if (lsParams.LFN) 28e50: 11 23 and r17, r17 28e52: 99 f0 breq .+38 ; 0x28e7a printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 28e54: 80 91 81 13 lds r24, 0x1381 ; 0x801381 28e58: 88 23 and r24, r24 28e5a: 09 f4 brne .+2 ; 0x28e5e 28e5c: ba c0 rjmp .+372 ; 0x28fd2 28e5e: 81 e8 ldi r24, 0x81 ; 129 28e60: 93 e1 ldi r25, 0x13 ; 19 28e62: 9f 93 push r25 28e64: 8f 93 push r24 28e66: e4 ea ldi r30, 0xA4 ; 164 28e68: fc e9 ldi r31, 0x9C ; 156 28e6a: ff 93 push r31 28e6c: ef 93 push r30 28e6e: 0f 94 5d 9f call 0x33eba ; 0x33eba 28e72: 0f 90 pop r0 28e74: 0f 90 pop r0 28e76: 0f 90 pop r0 28e78: 0f 90 pop r0 SERIAL_PROTOCOLLN(); 28e7a: 0f 94 bb 98 call 0x33176 ; 0x33176 manage_heater(); 28e7e: 0f 94 13 33 call 0x26626 ; 0x26626 28e82: 89 c0 rjmp .+274 ; 0x28f96 } lsDive(path, dir, NULL, lsAction, lsParams); // close() is done automatically by destructor of SdFile if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); 28e84: 2d b7 in r18, 0x3d ; 61 28e86: 3e b7 in r19, 0x3e ; 62 28e88: e7 96 adiw r28, 0x37 ; 55 28e8a: 3f af std Y+63, r19 ; 0x3f 28e8c: 2e af std Y+62, r18 ; 0x3e 28e8e: 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); 28e90: be 01 movw r22, r28 28e92: 69 5b subi r22, 0xB9 ; 185 28e94: 7f 4f sbci r23, 0xFF ; 255 28e96: c5 01 movw r24, r10 28e98: 0e 94 16 70 call 0xe02c ; 0xe02c // Allocate enough stack space for the full path to a folder, trailing slash, and nul bool prepend_is_empty = (prepend[0] == '\0'); 28e9c: f4 01 movw r30, r8 28e9e: 80 81 ld r24, Z int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(lfilename) + 1 + 1; 28ea0: 88 23 and r24, r24 28ea2: 09 f4 brne .+2 ; 0x28ea6 28ea4: 86 c0 rjmp .+268 ; 0x28fb2 28ea6: 01 90 ld r0, Z+ 28ea8: 00 20 and r0, r0 28eaa: e9 f7 brne .-6 ; 0x28ea6 28eac: 31 97 sbiw r30, 0x01 ; 1 28eae: e8 19 sub r30, r8 28eb0: f9 09 sbc r31, r9 28eb2: d5 01 movw r26, r10 28eb4: 0d 90 ld r0, X+ 28eb6: 00 20 and r0, r0 28eb8: e9 f7 brne .-6 ; 0x28eb4 28eba: ea 19 sub r30, r10 28ebc: fb 09 sbc r31, r11 char path[len]; 28ebe: ea 0f add r30, r26 28ec0: fb 1f adc r31, r27 28ec2: 31 96 adiw r30, 0x01 ; 1 28ec4: 2d b7 in r18, 0x3d ; 61 28ec6: 3e b7 in r19, 0x3e ; 62 28ec8: 2e 1b sub r18, r30 28eca: 3f 0b sbc r19, r31 28ecc: 0f b6 in r0, 0x3f ; 63 28ece: f8 94 cli 28ed0: 3e bf out 0x3e, r19 ; 62 28ed2: 0f be out 0x3f, r0 ; 63 28ed4: 2d bf out 0x3d, r18 ; 61 28ed6: ed b7 in r30, 0x3d ; 61 28ed8: fe b7 in r31, 0x3e ; 62 28eda: 31 96 adiw r30, 0x01 ; 1 28edc: 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 28ede: 61 ef ldi r22, 0xF1 ; 241 28ee0: 72 e0 ldi r23, 0x02 ; 2 28ee2: 81 11 cpse r24, r1 28ee4: b4 01 movw r22, r8 28ee6: c7 01 movw r24, r14 28ee8: 0f 94 06 a7 call 0x34e0c ; 0x34e0c strcat(path, lfilename); // FILENAME_LENGTH-1 characters maximum 28eec: b5 01 movw r22, r10 28eee: c7 01 movw r24, r14 28ef0: 0f 94 e7 a6 call 0x34dce ; 0x34dce strcat(path, "/"); // 1 character 28ef4: 61 ef ldi r22, 0xF1 ; 241 28ef6: 72 e0 ldi r23, 0x02 ; 2 28ef8: c7 01 movw r24, r14 28efa: 0f 94 e7 a6 call 0x34dce ; 0x34dce // Serial.print(path); // Get a new directory object using the full path // and dive recursively into it. if (lsParams.LFN) 28efe: 11 23 and r17, r17 28f00: a9 f0 breq .+42 ; 0x28f2c printf_P(PSTR("DIR_ENTER: %s \"%s\"\n"), path, longFilename[0] ? longFilename : lfilename); 28f02: 80 91 81 13 lds r24, 0x1381 ; 0x801381 28f06: 81 11 cpse r24, r1 28f08: 57 c0 rjmp .+174 ; 0x28fb8 28f0a: c5 01 movw r24, r10 28f0c: 9f 93 push r25 28f0e: 8f 93 push r24 28f10: ff 92 push r15 28f12: ef 92 push r14 28f14: 29 eb ldi r18, 0xB9 ; 185 28f16: 3c e9 ldi r19, 0x9C ; 156 28f18: 3f 93 push r19 28f1a: 2f 93 push r18 28f1c: 0f 94 5d 9f call 0x33eba ; 0x33eba 28f20: 0f 90 pop r0 28f22: 0f 90 pop r0 28f24: 0f 90 pop r0 28f26: 0f 90 pop r0 28f28: 0f 90 pop r0 28f2a: 0f 90 pop r0 28f2c: 1c a2 std Y+36, r1 ; 0x24 28f2e: 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); 28f30: 21 e0 ldi r18, 0x01 ; 1 28f32: a5 01 movw r20, r10 28f34: b6 01 movw r22, r12 28f36: ce 01 movw r24, r28 28f38: 84 96 adiw r24, 0x24 ; 36 28f3a: 0f 94 48 9a call 0x33490 ; 0x33490 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); 28f3e: 83 e2 ldi r24, 0x23 ; 35 28f40: fe 01 movw r30, r28 28f42: b4 96 adiw r30, 0x24 ; 36 28f44: de 01 movw r26, r28 28f46: 11 96 adiw r26, 0x01 ; 1 28f48: 01 90 ld r0, Z+ 28f4a: 0d 92 st X+, r0 28f4c: 8a 95 dec r24 28f4e: e1 f7 brne .-8 ; 0x28f48 28f50: 10 fb bst r17, 0 28f52: 50 f8 bld r5, 0 28f54: 05 2d mov r16, r5 28f56: 20 e0 ldi r18, 0x00 ; 0 28f58: 50 e0 ldi r21, 0x00 ; 0 28f5a: 40 e0 ldi r20, 0x00 ; 0 28f5c: be 01 movw r22, r28 28f5e: 6f 5f subi r22, 0xFF ; 255 28f60: 7f 4f sbci r23, 0xFF ; 255 28f62: c7 01 movw r24, r14 28f64: 0f 94 28 46 call 0x28c50 ; 0x28c50 28f68: ce 01 movw r24, r28 28f6a: 01 96 adiw r24, 0x01 ; 1 28f6c: 0e 94 31 70 call 0xe062 ; 0xe062 // close() is done automatically by destructor of SdFile if (lsParams.LFN) 28f70: 11 23 and r17, r17 28f72: 21 f0 breq .+8 ; 0x28f7c puts_P(PSTR("DIR_EXIT")); 28f74: 80 eb ldi r24, 0xB0 ; 176 28f76: 9c e9 ldi r25, 0x9C ; 156 28f78: 0f 94 84 9f call 0x33f08 ; 0x33f08 28f7c: ce 01 movw r24, r28 28f7e: 84 96 adiw r24, 0x24 ; 36 28f80: 0e 94 31 70 call 0xe062 ; 0xe062 28f84: e7 96 adiw r28, 0x37 ; 55 28f86: ee ad ldd r30, Y+62 ; 0x3e 28f88: ff ad ldd r31, Y+63 ; 0x3f 28f8a: e7 97 sbiw r28, 0x37 ; 55 28f8c: 0f b6 in r0, 0x3f ; 63 28f8e: f8 94 cli 28f90: fe bf out 0x3e, r31 ; 62 28f92: 0f be out 0x3f, r0 ; 63 28f94: 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()) { 28f96: f6 01 movw r30, r12 28f98: 80 85 ldd r24, Z+8 ; 0x08 28f9a: 91 85 ldd r25, Z+9 ; 0x09 28f9c: a2 85 ldd r26, Z+10 ; 0x0a 28f9e: b3 85 ldd r27, Z+11 ; 0x0b 28fa0: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d 28fa4: 90 93 7e 13 sts 0x137E, r25 ; 0x80137e 28fa8: a0 93 7f 13 sts 0x137F, r26 ; 0x80137f 28fac: b0 93 80 13 sts 0x1380, r27 ; 0x801380 28fb0: 8c ce rjmp .-744 ; 0x28cca // 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; 28fb2: e1 e0 ldi r30, 0x01 ; 1 28fb4: f0 e0 ldi r31, 0x00 ; 0 28fb6: 7d cf rjmp .-262 ; 0x28eb2 // 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); 28fb8: 81 e8 ldi r24, 0x81 ; 129 28fba: 93 e1 ldi r25, 0x13 ; 19 28fbc: a7 cf rjmp .-178 ; 0x28f0c else { filenameIsDir = DIR_IS_SUBDIR(&p); if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; switch (lsAction) { case LS_Count: nrFiles++; 28fbe: 80 91 82 16 lds r24, 0x1682 ; 0x801682 28fc2: 90 91 83 16 lds r25, 0x1683 ; 0x801683 28fc6: 01 96 adiw r24, 0x01 ; 1 28fc8: 90 93 83 16 sts 0x1683, r25 ; 0x801683 28fcc: 80 93 82 16 sts 0x1682, r24 ; 0x801682 28fd0: e2 cf rjmp .-60 ; 0x28f96 } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); } if (lsParams.LFN) printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 28fd2: 8c e6 ldi r24, 0x6C ; 108 28fd4: 93 e1 ldi r25, 0x13 ; 19 28fd6: 45 cf rjmp .-374 ; 0x28e62 manage_heater(); break; case LS_GetFilename: //SERIAL_ECHOPGM("File: "); createFilename(filename, p); 28fd8: be 01 movw r22, r28 28fda: 69 5b subi r22, 0xB9 ; 185 28fdc: 7f 4f sbci r23, 0xFF ; 255 28fde: 8c e6 ldi r24, 0x6C ; 108 28fe0: 93 e1 ldi r25, 0x13 ; 19 28fe2: 0e 94 16 70 call 0xe02c ; 0xe02c SERIAL_ECHOPGM("Creation date: "); MYSERIAL.println(p.creationDate); SERIAL_ECHOPGM("Access date: "); MYSERIAL.println(p.lastAccessDate); SERIAL_ECHOLNPGM("");*/ crmodDate = p.lastWriteDate; 28fe6: a1 96 adiw r28, 0x21 ; 33 28fe8: 2e ad ldd r18, Y+62 ; 0x3e 28fea: 3f ad ldd r19, Y+63 ; 0x3f 28fec: a1 97 sbiw r28, 0x21 ; 33 28fee: 30 93 7c 13 sts 0x137C, r19 ; 0x80137c 28ff2: 20 93 7b 13 sts 0x137B, r18 ; 0x80137b crmodTime = p.lastWriteTime; 28ff6: 6f 96 adiw r28, 0x1f ; 31 28ff8: 4e ad ldd r20, Y+62 ; 0x3e 28ffa: 5f ad ldd r21, Y+63 ; 0x3f 28ffc: 6f 97 sbiw r28, 0x1f ; 31 28ffe: 50 93 7a 13 sts 0x137A, r21 ; 0x80137a 29002: 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 ) ){ 29006: 69 96 adiw r28, 0x19 ; 25 29008: 8e ad ldd r24, Y+62 ; 0x3e 2900a: 9f ad ldd r25, Y+63 ; 0x3f 2900c: 69 97 sbiw r28, 0x19 ; 25 2900e: 28 17 cp r18, r24 29010: 39 07 cpc r19, r25 29012: 50 f0 brcs .+20 ; 0x29028 29014: 28 17 cp r18, r24 29016: 39 07 cpc r19, r25 29018: 99 f4 brne .+38 ; 0x29040 2901a: 67 96 adiw r28, 0x17 ; 23 2901c: 2e ad ldd r18, Y+62 ; 0x3e 2901e: 3f ad ldd r19, Y+63 ; 0x3f 29020: 67 97 sbiw r28, 0x17 ; 23 29022: 42 17 cp r20, r18 29024: 53 07 cpc r21, r19 29026: 60 f4 brcc .+24 ; 0x29040 crmodDate = p.creationDate; 29028: 90 93 7c 13 sts 0x137C, r25 ; 0x80137c 2902c: 80 93 7b 13 sts 0x137B, r24 ; 0x80137b crmodTime = p.creationTime; 29030: 67 96 adiw r28, 0x17 ; 23 29032: 8e ad ldd r24, Y+62 ; 0x3e 29034: 9f ad ldd r25, Y+63 ; 0x3f 29036: 67 97 sbiw r28, 0x17 ; 23 29038: 90 93 7a 13 sts 0x137A, r25 ; 0x80137a 2903c: 80 93 79 13 sts 0x1379, r24 ; 0x801379 } //writeDate = p.lastAccessDate; if (match != NULL) { 29040: 61 14 cp r6, r1 29042: 71 04 cpc r7, r1 29044: 59 f1 breq .+86 ; 0x2909c if (strcasecmp(match, filename) == 0) return; 29046: 6c e6 ldi r22, 0x6C ; 108 29048: 73 e1 ldi r23, 0x13 ; 19 2904a: c3 01 movw r24, r6 2904c: 0f 94 d4 a6 call 0x34da8 ; 0x34da8 29050: 89 2b or r24, r25 29052: 59 f5 brne .+86 ; 0x290aa // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} 29054: 80 91 d8 0d lds r24, 0x0DD8 ; 0x800dd8 29058: 81 50 subi r24, 0x01 ; 1 2905a: 80 93 d8 0d sts 0x0DD8, r24 ; 0x800dd8 cnt++; break; } } } // while readDir } 2905e: 0f b6 in r0, 0x3f ; 63 29060: f8 94 cli 29062: 3e be out 0x3e, r3 ; 62 29064: 0f be out 0x3f, r0 ; 63 29066: 2d be out 0x3d, r2 ; 61 29068: ca 58 subi r28, 0x8A ; 138 2906a: df 4f sbci r29, 0xFF ; 255 2906c: 0f b6 in r0, 0x3f ; 63 2906e: f8 94 cli 29070: de bf out 0x3e, r29 ; 62 29072: 0f be out 0x3f, r0 ; 63 29074: cd bf out 0x3d, r28 ; 61 29076: df 91 pop r29 29078: cf 91 pop r28 2907a: 1f 91 pop r17 2907c: 0f 91 pop r16 2907e: ff 90 pop r15 29080: ef 90 pop r14 29082: df 90 pop r13 29084: cf 90 pop r12 29086: bf 90 pop r11 29088: af 90 pop r10 2908a: 9f 90 pop r9 2908c: 8f 90 pop r8 2908e: 7f 90 pop r7 29090: 6f 90 pop r6 29092: 5f 90 pop r5 29094: 4f 90 pop r4 29096: 3f 90 pop r3 29098: 2f 90 pop r2 2909a: 08 95 ret } //writeDate = p.lastAccessDate; if (match != NULL) { if (strcasecmp(match, filename) == 0) return; } else if (cnt == nrFiles) return; 2909c: 80 91 82 16 lds r24, 0x1682 ; 0x801682 290a0: 90 91 83 16 lds r25, 0x1683 ; 0x801683 290a4: 48 16 cp r4, r24 290a6: 19 06 cpc r1, r25 290a8: a9 f2 breq .-86 ; 0x29054 cnt++; 290aa: 43 94 inc r4 290ac: 74 cf rjmp .-280 ; 0x28f96 000290ae : } } void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) 290ae: cf 92 push r12 290b0: df 92 push r13 290b2: ef 92 push r14 290b4: ff 92 push r15 290b6: 0f 93 push r16 290b8: cf 93 push r28 290ba: df 93 push r29 290bc: cd b7 in r28, 0x3d ; 61 290be: de b7 in r29, 0x3e ; 62 290c0: a3 97 sbiw r28, 0x23 ; 35 290c2: 0f b6 in r0, 0x3f ; 63 290c4: f8 94 cli 290c6: de bf out 0x3e, r29 ; 62 290c8: 0f be out 0x3f, r0 ; 63 290ca: cd bf out 0x3d, r28 ; 61 290cc: 6c 01 movw r12, r24 { curDir=&workDir; 290ce: 83 e1 ldi r24, 0x13 ; 19 290d0: e8 2e mov r14, r24 290d2: 84 e1 ldi r24, 0x14 ; 20 290d4: f8 2e mov r15, r24 290d6: 85 e1 ldi r24, 0x15 ; 21 290d8: 94 e1 ldi r25, 0x14 ; 20 290da: d7 01 movw r26, r14 290dc: 8d 93 st X+, r24 290de: 9c 93 st X, r25 nrFiles=nr; 290e0: 10 92 83 16 sts 0x1683, r1 ; 0x801683 290e4: 10 92 82 16 sts 0x1682, r1 ; 0x801682 curDir->rewind(); 290e8: 0e 94 2c 70 call 0xe058 ; 0xe058 }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 290ec: 00 e0 ldi r16, 0x00 ; 0 290ee: 0e 7f andi r16, 0xFE ; 254 290f0: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir,match, LS_GetFilename); 290f2: d7 01 movw r26, r14 290f4: ed 91 ld r30, X+ 290f6: fc 91 ld r31, X 290f8: 83 e2 ldi r24, 0x23 ; 35 290fa: de 01 movw r26, r28 290fc: 11 96 adiw r26, 0x01 ; 1 290fe: 01 90 ld r0, Z+ 29100: 0d 92 st X+, r0 29102: 8a 95 dec r24 29104: e1 f7 brne .-8 ; 0x290fe 29106: 22 e0 ldi r18, 0x02 ; 2 29108: a6 01 movw r20, r12 2910a: be 01 movw r22, r28 2910c: 6f 5f subi r22, 0xFF ; 255 2910e: 7f 4f sbci r23, 0xFF ; 255 29110: 8a ed ldi r24, 0xDA ; 218 29112: 92 e0 ldi r25, 0x02 ; 2 29114: 0f 94 28 46 call 0x28c50 ; 0x28c50 29118: ce 01 movw r24, r28 2911a: 01 96 adiw r24, 0x01 ; 1 2911c: 0e 94 31 70 call 0xe062 ; 0xe062 } 29120: a3 96 adiw r28, 0x23 ; 35 29122: 0f b6 in r0, 0x3f ; 63 29124: f8 94 cli 29126: de bf out 0x3e, r29 ; 62 29128: 0f be out 0x3f, r0 ; 63 2912a: cd bf out 0x3d, r28 ; 61 2912c: df 91 pop r29 2912e: cf 91 pop r28 29130: 0f 91 pop r16 29132: ff 90 pop r15 29134: ef 90 pop r14 29136: df 90 pop r13 29138: cf 90 pop r12 2913a: 08 95 ret 0002913c : void CardReader::getfilename_simple(uint16_t entry, const char * const match/*=NULL*/) 2913c: ef 92 push r14 2913e: ff 92 push r15 29140: 0f 93 push r16 29142: cf 93 push r28 29144: df 93 push r29 29146: cd b7 in r28, 0x3d ; 61 29148: de b7 in r29, 0x3e ; 62 2914a: a3 97 sbiw r28, 0x23 ; 35 2914c: 0f b6 in r0, 0x3f ; 63 2914e: f8 94 cli 29150: de bf out 0x3e, r29 ; 62 29152: 0f be out 0x3f, r0 ; 63 29154: cd bf out 0x3d, r28 ; 61 { curDir = &workDir; 29156: 23 e1 ldi r18, 0x13 ; 19 29158: e2 2e mov r14, r18 2915a: 24 e1 ldi r18, 0x14 ; 20 2915c: f2 2e mov r15, r18 2915e: 25 e1 ldi r18, 0x15 ; 21 29160: 34 e1 ldi r19, 0x14 ; 20 29162: d7 01 movw r26, r14 29164: 2d 93 st X+, r18 29166: 3c 93 st X, r19 nrFiles = 0; 29168: 10 92 83 16 sts 0x1683, r1 ; 0x801683 2916c: 10 92 82 16 sts 0x1682, r1 ; 0x801682 curDir->seekSet((uint32_t)entry << 5); 29170: b0 e0 ldi r27, 0x00 ; 0 29172: a0 e0 ldi r26, 0x00 ; 0 29174: ac 01 movw r20, r24 29176: bd 01 movw r22, r26 29178: e5 e0 ldi r30, 0x05 ; 5 2917a: 44 0f add r20, r20 2917c: 55 1f adc r21, r21 2917e: 66 1f adc r22, r22 29180: 77 1f adc r23, r23 29182: ea 95 dec r30 29184: d1 f7 brne .-12 ; 0x2917a 29186: c9 01 movw r24, r18 29188: 0f 94 f7 39 call 0x273ee ; 0x273ee 2918c: 00 e0 ldi r16, 0x00 ; 0 2918e: 0e 7f andi r16, 0xFE ; 254 29190: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 29192: d7 01 movw r26, r14 29194: ed 91 ld r30, X+ 29196: fc 91 ld r31, X 29198: 83 e2 ldi r24, 0x23 ; 35 2919a: de 01 movw r26, r28 2919c: 11 96 adiw r26, 0x01 ; 1 2919e: 01 90 ld r0, Z+ 291a0: 0d 92 st X+, r0 291a2: 8a 95 dec r24 291a4: e1 f7 brne .-8 ; 0x2919e 291a6: 22 e0 ldi r18, 0x02 ; 2 291a8: 50 e0 ldi r21, 0x00 ; 0 291aa: 40 e0 ldi r20, 0x00 ; 0 291ac: be 01 movw r22, r28 291ae: 6f 5f subi r22, 0xFF ; 255 291b0: 7f 4f sbci r23, 0xFF ; 255 291b2: 8a ed ldi r24, 0xDA ; 218 291b4: 92 e0 ldi r25, 0x02 ; 2 291b6: 0f 94 28 46 call 0x28c50 ; 0x28c50 291ba: ce 01 movw r24, r28 291bc: 01 96 adiw r24, 0x01 ; 1 291be: 0e 94 31 70 call 0xe062 ; 0xe062 } 291c2: a3 96 adiw r28, 0x23 ; 35 291c4: 0f b6 in r0, 0x3f ; 63 291c6: f8 94 cli 291c8: de bf out 0x3e, r29 ; 62 291ca: 0f be out 0x3f, r0 ; 63 291cc: cd bf out 0x3d, r28 ; 61 291ce: df 91 pop r29 291d0: cf 91 pop r28 291d2: 0f 91 pop r16 291d4: ff 90 pop r15 291d6: ef 90 pop r14 291d8: 08 95 ret 000291da : nrFiles = 1; curDir->seekSet(position); lsDive("", *curDir, match, LS_GetFilename); } uint16_t CardReader::getnrfilenames() 291da: cf 92 push r12 291dc: df 92 push r13 291de: ef 92 push r14 291e0: ff 92 push r15 291e2: 0f 93 push r16 291e4: cf 93 push r28 291e6: df 93 push r29 291e8: cd b7 in r28, 0x3d ; 61 291ea: de b7 in r29, 0x3e ; 62 291ec: a3 97 sbiw r28, 0x23 ; 35 291ee: 0f b6 in r0, 0x3f ; 63 291f0: f8 94 cli 291f2: de bf out 0x3e, r29 ; 62 291f4: 0f be out 0x3f, r0 ; 63 291f6: cd bf out 0x3d, r28 ; 61 { curDir=&workDir; 291f8: 83 e1 ldi r24, 0x13 ; 19 291fa: c8 2e mov r12, r24 291fc: 84 e1 ldi r24, 0x14 ; 20 291fe: d8 2e mov r13, r24 29200: 85 e1 ldi r24, 0x15 ; 21 29202: 94 e1 ldi r25, 0x14 ; 20 29204: d6 01 movw r26, r12 29206: 8d 93 st X+, r24 29208: 9c 93 st X, r25 nrFiles=0; 2920a: 22 e8 ldi r18, 0x82 ; 130 2920c: e2 2e mov r14, r18 2920e: 26 e1 ldi r18, 0x16 ; 22 29210: f2 2e mov r15, r18 29212: f7 01 movw r30, r14 29214: 11 82 std Z+1, r1 ; 0x01 29216: 10 82 st Z, r1 curDir->rewind(); 29218: 0e 94 2c 70 call 0xe058 ; 0xe058 2921c: 00 e0 ldi r16, 0x00 ; 0 2921e: 0e 7f andi r16, 0xFE ; 254 29220: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir, NULL, LS_Count); 29222: d6 01 movw r26, r12 29224: ed 91 ld r30, X+ 29226: fc 91 ld r31, X 29228: 83 e2 ldi r24, 0x23 ; 35 2922a: de 01 movw r26, r28 2922c: 11 96 adiw r26, 0x01 ; 1 2922e: 01 90 ld r0, Z+ 29230: 0d 92 st X+, r0 29232: 8a 95 dec r24 29234: e1 f7 brne .-8 ; 0x2922e 29236: 21 e0 ldi r18, 0x01 ; 1 29238: 50 e0 ldi r21, 0x00 ; 0 2923a: 40 e0 ldi r20, 0x00 ; 0 2923c: be 01 movw r22, r28 2923e: 6f 5f subi r22, 0xFF ; 255 29240: 7f 4f sbci r23, 0xFF ; 255 29242: 8a ed ldi r24, 0xDA ; 218 29244: 92 e0 ldi r25, 0x02 ; 2 29246: 0f 94 28 46 call 0x28c50 ; 0x28c50 2924a: ce 01 movw r24, r28 2924c: 01 96 adiw r24, 0x01 ; 1 2924e: 0e 94 31 70 call 0xe062 ; 0xe062 //SERIAL_ECHOLN(nrFiles); return nrFiles; } 29252: f7 01 movw r30, r14 29254: 80 81 ld r24, Z 29256: 91 81 ldd r25, Z+1 ; 0x01 29258: a3 96 adiw r28, 0x23 ; 35 2925a: 0f b6 in r0, 0x3f ; 63 2925c: f8 94 cli 2925e: de bf out 0x3e, r29 ; 62 29260: 0f be out 0x3f, r0 ; 63 29262: cd bf out 0x3d, r28 ; 61 29264: df 91 pop r29 29266: cf 91 pop r28 29268: 0f 91 pop r16 2926a: ff 90 pop r15 2926c: ef 90 pop r14 2926e: df 90 pop r13 29270: cf 90 pop r12 29272: 08 95 ret 00029274 : file.getFilename(t); else t[0]=0; } void CardReader::printAbsFilenameFast() 29274: cf 93 push r28 29276: df 93 push r29 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 29278: 8f e2 ldi r24, 0x2F ; 47 2927a: 0e 94 37 70 call 0xe06e ; 0xe06e { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2927e: c0 e0 ldi r28, 0x00 ; 0 { SERIAL_PROTOCOL(dir_names[i]); 29280: d9 e0 ldi r29, 0x09 ; 9 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 29282: 80 91 0a 15 lds r24, 0x150A ; 0x80150a 29286: c8 17 cp r28, r24 29288: 60 f4 brcc .+24 ; 0x292a2 { SERIAL_PROTOCOL(dir_names[i]); 2928a: cd 9f mul r28, r29 2928c: c0 01 movw r24, r0 2928e: 11 24 eor r1, r1 29290: 86 54 subi r24, 0x46 ; 70 29292: 9c 4e sbci r25, 0xEC ; 236 29294: 0e 94 a0 7c call 0xf940 ; 0xf940 29298: 8f e2 ldi r24, 0x2F ; 47 2929a: 0e 94 37 70 call 0xe06e ; 0xe06e } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2929e: cf 5f subi r28, 0xFF ; 255 292a0: f0 cf rjmp .-32 ; 0x29282 { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 292a2: 80 91 81 13 lds r24, 0x1381 ; 0x801381 292a6: 81 11 cpse r24, r1 292a8: 06 c0 rjmp .+12 ; 0x292b6 292aa: 8c e6 ldi r24, 0x6C ; 108 292ac: 93 e1 ldi r25, 0x13 ; 19 } 292ae: df 91 pop r29 292b0: cf 91 pop r28 292b2: 0c 94 a0 7c jmp 0xf940 ; 0xf940 for (uint8_t i = 0; i < getWorkDirDepth(); i++) { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 292b6: 81 e8 ldi r24, 0x81 ; 129 292b8: 93 e1 ldi r25, 0x13 ; 19 292ba: f9 cf rjmp .-14 ; 0x292ae 000292bc : 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) { 292bc: cf 92 push r12 292be: df 92 push r13 292c0: ef 92 push r14 292c2: ff 92 push r15 292c4: 6b 01 movw r12, r22 292c6: 7c 01 movw r14, r24 eeprom_write_dword_notify(__p, eeprom_read_dword(__p) + add); 292c8: 88 ea ldi r24, 0xA8 ; 168 292ca: 9c e0 ldi r25, 0x0C ; 12 292cc: 0f 94 a3 a0 call 0x34146 ; 0x34146 292d0: ab 01 movw r20, r22 292d2: bc 01 movw r22, r24 292d4: 4c 0d add r20, r12 292d6: 5d 1d adc r21, r13 292d8: 6e 1d adc r22, r14 292da: 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); 292dc: 88 ea ldi r24, 0xA8 ; 168 292de: 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); } 292e0: ff 90 pop r15 292e2: ef 90 pop r14 292e4: df 90 pop r13 292e6: 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); 292e8: 0d 94 f1 a0 jmp 0x341e2 ; 0x341e2 000292ec : return def; } return val; } uint32_t __attribute__((noinline)) eeprom_init_default_dword(uint32_t *__p, uint32_t def) { 292ec: cf 93 push r28 292ee: df 93 push r29 292f0: ec 01 movw r28, r24 uint32_t val = eeprom_read_dword(__p); 292f2: 0f 94 a3 a0 call 0x34146 ; 0x34146 if (val == EEPROM_EMPTY_VALUE32) { 292f6: 6f 3f cpi r22, 0xFF ; 255 292f8: 2f ef ldi r18, 0xFF ; 255 292fa: 72 07 cpc r23, r18 292fc: 82 07 cpc r24, r18 292fe: 92 07 cpc r25, r18 29300: 49 f4 brne .+18 ; 0x29314 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); 29302: 40 e0 ldi r20, 0x00 ; 0 29304: 50 e0 ldi r21, 0x00 ; 0 29306: ba 01 movw r22, r20 29308: ce 01 movw r24, r28 2930a: 0f 94 f1 a0 call 0x341e2 ; 0x341e2 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; 2930e: 60 e0 ldi r22, 0x00 ; 0 29310: 70 e0 ldi r23, 0x00 ; 0 29312: cb 01 movw r24, r22 } return val; } 29314: df 91 pop r29 29316: cf 91 pop r28 29318: 08 95 ret 0002931a : : "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(){ 2931a: 0f 93 push r16 2931c: 1f 93 push r17 2931e: cf 93 push r28 29320: df 93 push r29 if( ! gfEnsureBlock() ){ 29322: 0f 94 6d 3f call 0x27eda ; 0x27eda 29326: 88 23 and r24, r24 29328: 39 f1 breq .+78 ; 0x29378 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; 2932a: 20 91 15 16 lds r18, 0x1615 ; 0x801615 2932e: 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; 29332: 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; 29334: 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 == ';' ){ 29336: 88 81 ld r24, Y 29338: 8b 33 cpi r24, 0x3B ; 59 2933a: 51 f5 brne .+84 ; 0x29390 // 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); 2933c: fe 01 movw r30, r28 0002933e : 2933e: 61 91 ld r22, Z+ 29340: 6a 30 cpi r22, 0x0A ; 10 29342: e9 f7 brne .-6 ; 0x2933e 29344: ef 01 movw r28, r30 // found a newline, prepare the next block if block cache end reached if( rdPtr - blockBuffBegin > 512 ){ 29346: cf 01 movw r24, r30 29348: 89 5d subi r24, 0xD9 ; 217 2934a: 9d 40 sbci r25, 0x0D ; 13 2934c: 81 30 cpi r24, 0x01 ; 1 2934e: 92 40 sbci r25, 0x02 ; 2 29350: e4 f0 brlt .+56 ; 0x2938a // at the end of block cache, fill new data in gfUpdateCurrentPosition( rdPtr - start - 1 ); 29352: ce 01 movw r24, r28 29354: 82 1b sub r24, r18 29356: 93 0b sbc r25, r19 29358: 01 97 sbiw r24, 0x01 ; 1 2935a: 0f 94 26 3b call 0x2764c ; 0x2764c if( ! gfComputeNextFileBlock() )goto eof_or_fail; 2935e: 8a ef ldi r24, 0xFA ; 250 29360: 95 e1 ldi r25, 0x15 ; 21 29362: 0f 94 e1 38 call 0x271c2 ; 0x271c2 29366: 88 23 and r24, r24 29368: 39 f0 breq .+14 ; 0x29378 if( ! gfEnsureBlock() )goto eof_or_fail; // fetch it into RAM 2936a: 0f 94 6d 3f call 0x27eda ; 0x27eda rdPtr = start = blockBuffBegin; 2936e: 29 ed ldi r18, 0xD9 ; 217 29370: 3d e0 ldi r19, 0x0D ; 13 29372: 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 29374: 81 11 cpse r24, r1 29376: e2 cf rjmp .-60 ; 0x2933c } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 29378: 89 ed ldi r24, 0xD9 ; 217 2937a: 9f e0 ldi r25, 0x0F ; 15 2937c: 90 93 16 16 sts 0x1616, r25 ; 0x801616 29380: 80 93 15 16 sts 0x1615, r24 ; 0x801615 return -1; 29384: cf ef ldi r28, 0xFF ; 255 29386: df ef ldi r29, 0xFF ; 255 29388: 34 c0 rjmp .+104 ; 0x293f2 2938a: 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){ 2938c: c1 f5 brne .+112 ; 0x293fe // 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 2938e: 21 97 sbiw r28, 0x01 ; 1 } } } emit_char: { gfUpdateCurrentPosition( rdPtr - start + 1 ); 29390: ce 01 movw r24, r28 29392: 82 1b sub r24, r18 29394: 93 0b sbc r25, r19 29396: 01 96 adiw r24, 0x01 ; 1 29398: 0f 94 26 3b call 0x2764c ; 0x2764c int16_t rv = *rdPtr++; 2939c: ce 01 movw r24, r28 2939e: 01 96 adiw r24, 0x01 ; 1 293a0: c8 81 ld r28, Y 293a2: d0 e0 ldi r29, 0x00 ; 0 if( curPosition_ >= fileSize_ ){ 293a4: 00 91 02 16 lds r16, 0x1602 ; 0x801602 293a8: 10 91 03 16 lds r17, 0x1603 ; 0x801603 293ac: 20 91 04 16 lds r18, 0x1604 ; 0x801604 293b0: 30 91 05 16 lds r19, 0x1605 ; 0x801605 293b4: 40 91 0b 16 lds r20, 0x160B ; 0x80160b 293b8: 50 91 0c 16 lds r21, 0x160C ; 0x80160c 293bc: 60 91 0d 16 lds r22, 0x160D ; 0x80160d 293c0: 70 91 0e 16 lds r23, 0x160E ; 0x80160e 293c4: 04 17 cp r16, r20 293c6: 15 07 cpc r17, r21 293c8: 26 07 cpc r18, r22 293ca: 37 07 cpc r19, r23 293cc: a8 f6 brcc .-86 ; 0x29378 // past the end of file goto eof_or_fail; } else if( rdPtr - blockBuffBegin >= 512 ){ 293ce: 9c 01 movw r18, r24 293d0: 29 5d subi r18, 0xD9 ; 217 293d2: 3d 40 sbci r19, 0x0D ; 13 293d4: 21 15 cp r18, r1 293d6: 32 40 sbci r19, 0x02 ; 2 293d8: 44 f0 brlt .+16 ; 0x293ea // past the end of current bufferred block - prepare the next one... if( ! gfComputeNextFileBlock() )goto eof_or_fail; 293da: 8a ef ldi r24, 0xFA ; 250 293dc: 95 e1 ldi r25, 0x15 ; 21 293de: 0f 94 e1 38 call 0x271c2 ; 0x271c2 293e2: 88 23 and r24, r24 293e4: 49 f2 breq .-110 ; 0x29378 // don't need to force fetch the block here, it will get loaded on the next call rdPtr = blockBuffBegin; 293e6: 89 ed ldi r24, 0xD9 ; 217 293e8: 9d e0 ldi r25, 0x0D ; 13 } // save the current read ptr for the next run gfReadPtr = rdPtr; 293ea: 90 93 16 16 sts 0x1616, r25 ; 0x801616 293ee: 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; } 293f2: ce 01 movw r24, r28 293f4: df 91 pop r29 293f6: cf 91 pop r28 293f8: 1f 91 pop r17 293fa: 0f 91 pop r16 293fc: 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 == ';' ){ 293fe: 88 81 ld r24, Y 29400: 8b 33 cpi r24, 0x3B ; 59 29402: 09 f4 brne .+2 ; 0x29406 29404: 98 cf rjmp .-208 ; 0x29336 29406: c3 cf rjmp .-122 ; 0x2938e 00029408 : * 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() { 29408: 2f 92 push r2 2940a: 3f 92 push r3 2940c: 4f 92 push r4 2940e: 5f 92 push r5 29410: 6f 92 push r6 29412: 7f 92 push r7 29414: 8f 92 push r8 29416: 9f 92 push r9 29418: af 92 push r10 2941a: bf 92 push r11 2941c: cf 92 push r12 2941e: df 92 push r13 29420: ef 92 push r14 29422: ff 92 push r15 29424: 0f 93 push r16 29426: 1f 93 push r17 29428: cf 93 push r28 2942a: df 93 push r29 2942c: cd b7 in r28, 0x3d ; 61 2942e: de b7 in r29, 0x3e ; 62 29430: ed 97 sbiw r28, 0x3d ; 61 29432: 0f b6 in r0, 0x3f ; 63 29434: f8 94 cli 29436: de bf out 0x3e, r29 ; 62 29438: 0f be out 0x3f, r0 ; 63 2943a: cd bf out 0x3d, r28 ; 61 KEEPALIVE_STATE(NOT_BUSY); } void CardReader::flush_presort() { sort_count = 0; 2943c: 10 92 0c 15 sts 0x150C, r1 ; 0x80150c 29440: 10 92 0b 15 sts 0x150B, r1 ; 0x80150b lastSortedFilePosition = 0; 29444: 10 92 d6 15 sts 0x15D6, r1 ; 0x8015d6 29448: 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 2944c: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 29450: 80 fd sbrc r24, 0 29452: f7 c0 rjmp .+494 ; 0x29642 uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 29454: 89 e0 ldi r24, 0x09 ; 9 29456: 9f e0 ldi r25, 0x0F ; 15 29458: 0f 94 9b a0 call 0x34136 ; 0x34136 2945c: 38 2e mov r3, r24 KEEPALIVE_STATE(IN_HANDLER); 2945e: 82 e0 ldi r24, 0x02 ; 2 29460: 80 93 78 02 sts 0x0278, r24 ; 0x800278 // If there are files, sort up to the limit uint16_t fileCnt = getnrfilenames(); 29464: 0f 94 ed 48 call 0x291da ; 0x291da 29468: 6c 01 movw r12, r24 if (fileCnt > 0) { 2946a: 00 97 sbiw r24, 0x00 ; 0 2946c: 09 f4 brne .+2 ; 0x29470 2946e: e6 c0 rjmp .+460 ; 0x2963c // Never sort more than the max allowed // If you use folders to organize, 20 may be enough if (fileCnt > SDSORT_LIMIT) { 29470: 85 36 cpi r24, 0x65 ; 101 29472: 91 05 cpc r25, r1 29474: 80 f0 brcs .+32 ; 0x29496 if ((sdSort != SD_SORT_NONE) && !farm_mode) { 29476: 32 e0 ldi r19, 0x02 ; 2 29478: 33 16 cp r3, r19 2947a: 51 f0 breq .+20 ; 0x29490 2947c: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 29480: 81 11 cpse r24, r1 29482: 06 c0 rjmp .+12 ; 0x29490 lcd_show_fullscreen_message_and_wait_P(_T(MSG_FILE_CNT)); 29484: 8b e4 ldi r24, 0x4B ; 75 29486: 9a e5 ldi r25, 0x5A ; 90 29488: 0e 94 a7 6c call 0xd94e ; 0xd94e 2948c: 0f 94 a9 0b call 0x21752 ; 0x21752 } fileCnt = SDSORT_LIMIT; 29490: f4 e6 ldi r31, 0x64 ; 100 29492: cf 2e mov r12, r31 29494: d1 2c mov r13, r1 } sort_count = fileCnt; 29496: d0 92 0c 15 sts 0x150C, r13 ; 0x80150c 2949a: c0 92 0b 15 sts 0x150B, r12 ; 0x80150b 2949e: 6d e0 ldi r22, 0x0D ; 13 294a0: 66 2e mov r6, r22 294a2: 65 e1 ldi r22, 0x15 ; 21 294a4: 76 2e mov r7, r22 // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 294a6: f1 2c mov r15, r1 294a8: e1 2c mov r14, r1 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 294aa: 75 e1 ldi r23, 0x15 ; 21 294ac: a7 2e mov r10, r23 294ae: 74 e1 ldi r23, 0x14 ; 20 294b0: b7 2e mov r11, r23 nrFiles = 1; 294b2: 88 24 eor r8, r8 294b4: 83 94 inc r8 294b6: 91 2c mov r9, r1 sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { if (!IS_SD_INSERTED) return; 294b8: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 294bc: 80 fd sbrc r24, 0 294be: c1 c0 rjmp .+386 ; 0x29642 manage_heater(); 294c0: 0f 94 13 33 call 0x26626 ; 0x26626 if (i == 0) 294c4: e1 14 cp r14, r1 294c6: f1 04 cpc r15, r1 294c8: 09 f0 breq .+2 ; 0x294cc 294ca: d4 c0 rjmp .+424 ; 0x29674 getfilename(0); 294cc: 90 e0 ldi r25, 0x00 ; 0 294ce: 80 e0 ldi r24, 0x00 ; 0 294d0: 0f 94 57 48 call 0x290ae ; 0x290ae else getfilename_next(position); sort_entries[i] = position >> 5; 294d4: 80 91 7d 13 lds r24, 0x137D ; 0x80137d 294d8: 90 91 7e 13 lds r25, 0x137E ; 0x80137e 294dc: a0 91 7f 13 lds r26, 0x137F ; 0x80137f 294e0: b0 91 80 13 lds r27, 0x1380 ; 0x801380 294e4: 55 e0 ldi r21, 0x05 ; 5 294e6: b6 95 lsr r27 294e8: a7 95 ror r26 294ea: 97 95 ror r25 294ec: 87 95 ror r24 294ee: 5a 95 dec r21 294f0: d1 f7 brne .-12 ; 0x294e6 294f2: f3 01 movw r30, r6 294f4: 81 93 st Z+, r24 294f6: 91 93 st Z+, r25 294f8: 3f 01 movw r6, r30 } sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 294fa: ff ef ldi r31, 0xFF ; 255 294fc: ef 1a sub r14, r31 294fe: ff 0a sbc r15, r31 29500: ce 14 cp r12, r14 29502: df 04 cpc r13, r15 29504: c9 f6 brne .-78 ; 0x294b8 else getfilename_next(position); sort_entries[i] = position >> 5; } if ((fileCnt > 1) && (sdSort != SD_SORT_NONE) && !farm_mode) { 29506: 21 e0 ldi r18, 0x01 ; 1 29508: e2 16 cp r14, r18 2950a: f1 04 cpc r15, r1 2950c: 09 f4 brne .+2 ; 0x29510 2950e: 96 c0 rjmp .+300 ; 0x2963c 29510: 32 e0 ldi r19, 0x02 ; 2 29512: 33 16 cp r3, r19 29514: 09 f4 brne .+2 ; 0x29518 29516: 92 c0 rjmp .+292 ; 0x2963c 29518: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 2951c: 21 11 cpse r18, r1 2951e: 8e c0 rjmp .+284 ; 0x2963c #ifdef SORTING_SPEEDTEST LongTimer sortingSpeedtestTimer; sortingSpeedtestTimer.start(); #endif //SORTING_SPEEDTEST lastSortedFilePosition = position >> 5; 29520: 90 93 d6 15 sts 0x15D6, r25 ; 0x8015d6 29524: 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)); 29528: 8b e3 ldi r24, 0x3B ; 59 2952a: 9a e5 ldi r25, 0x5A ; 90 2952c: 0e 94 a7 6c call 0xd94e ; 0xd94e 29530: ee 9c mul r14, r14 29532: 90 01 movw r18, r0 29534: ef 9c mul r14, r15 29536: 30 0d add r19, r0 29538: 30 0d add r19, r0 2953a: 11 24 eor r1, r1 2953c: bc 01 movw r22, r24 2953e: c9 01 movw r24, r18 29540: 96 95 lsr r25 29542: 87 95 ror r24 29544: 0f 94 dd 91 call 0x323ba ; 0x323ba 29548: 3f e0 ldi r19, 0x0F ; 15 2954a: a3 2e mov r10, r19 2954c: 35 e1 ldi r19, 0x15 ; 21 2954e: 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; 29550: 91 2c mov r9, r1 29552: 81 2c mov r8, r1 menu_progressbar_init(fileCnt * fileCnt / 2, _T(MSG_SORTING_FILES)); for (uint16_t i = 1; i < fileCnt; ++i){ 29554: cc 24 eor r12, r12 29556: c3 94 inc r12 29558: d1 2c mov r13, r1 // if (!IS_SD_INSERTED) return; menu_progressbar_update(counter); 2955a: c4 01 movw r24, r8 2955c: 0f 94 ae 91 call 0x3235c ; 0x3235c counter += i; 29560: 8c 0c add r8, r12 29562: 9d 1c adc r9, r13 /// pop the position const uint16_t o1 = sort_entries[i]; 29564: f5 01 movw r30, r10 29566: 01 90 ld r0, Z+ 29568: f0 81 ld r31, Z 2956a: e0 2d mov r30, r0 2956c: f9 af std Y+57, r31 ; 0x39 2956e: e8 af std Y+56, r30 ; 0x38 getfilename_simple(o1); 29570: cf 01 movw r24, r30 29572: 0f 94 9e 48 call 0x2913c ; 0x2913c strcpy(name1, LONGEST_FILENAME); // save (or getfilename below will trounce it) 29576: 80 91 81 13 lds r24, 0x1381 ; 0x801381 2957a: 6c e6 ldi r22, 0x6C ; 108 2957c: 73 e1 ldi r23, 0x13 ; 19 2957e: 88 23 and r24, r24 29580: 11 f0 breq .+4 ; 0x29586 29582: 61 e8 ldi r22, 0x81 ; 129 29584: 73 e1 ldi r23, 0x13 ; 19 29586: ce 01 movw r24, r28 29588: 01 96 adiw r24, 0x01 ; 1 2958a: 0f 94 06 a7 call 0x34e0c ; 0x34e0c crmod_date_bckp = crmodDate; 2958e: 60 90 7b 13 lds r6, 0x137B ; 0x80137b 29592: 70 90 7c 13 lds r7, 0x137C ; 0x80137c crmod_time_bckp = crmodTime; 29596: 20 91 79 13 lds r18, 0x1379 ; 0x801379 2959a: 30 91 7a 13 lds r19, 0x137A ; 0x80137a 2959e: 3b af std Y+59, r19 ; 0x3b 295a0: 2a af std Y+58, r18 ; 0x3a #if HAS_FOLDER_SORTING bool dir1 = filenameIsDir; 295a2: 20 90 b6 13 lds r2, 0x13B6 ; 0x8013b6 295a6: bf aa std Y+55, r11 ; 0x37 295a8: ae aa std Y+54, r10 ; 0x36 295aa: 86 01 movw r16, r12 #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ if (!IS_SD_INSERTED) return; 295ac: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 295b0: 80 fd sbrc r24, 0 295b2: 47 c0 rjmp .+142 ; 0x29642 printf_P(PSTR("%2u "), sort_entries[z]); } MYSERIAL.println(); #endif manage_heater(); 295b4: 0f 94 13 33 call 0x26626 ; 0x26626 const uint16_t o2 = sort_entries[j - 1]; 295b8: c8 01 movw r24, r16 295ba: 01 97 sbiw r24, 0x01 ; 1 295bc: 9d af std Y+61, r25 ; 0x3d 295be: 8c af std Y+60, r24 ; 0x3c 295c0: ee a9 ldd r30, Y+54 ; 0x36 295c2: ff a9 ldd r31, Y+55 ; 0x37 295c4: 52 90 ld r5, -Z 295c6: 42 90 ld r4, -Z 295c8: ff ab std Y+55, r31 ; 0x37 295ca: ee ab std Y+54, r30 ; 0x36 getfilename_simple(o2); 295cc: c2 01 movw r24, r4 295ce: 0f 94 9e 48 call 0x2913c ; 0x2913c char *name2 = LONGEST_FILENAME; // use the string in-place 295d2: 80 91 81 13 lds r24, 0x1381 ; 0x801381 295d6: 6c e6 ldi r22, 0x6C ; 108 295d8: 73 e1 ldi r23, 0x13 ; 19 295da: 88 23 and r24, r24 295dc: 11 f0 breq .+4 ; 0x295e2 295de: 61 e8 ldi r22, 0x81 ; 129 295e0: 73 e1 ldi r23, 0x13 ; 19 // Sort the current pair according to settings. if ( 295e2: 31 10 cpse r3, r1 295e4: 8a c0 rjmp .+276 ; 0x296fa 295e6: 80 91 b6 13 lds r24, 0x13B6 ; 0x8013b6 295ea: 28 12 cpse r2, r24 295ec: 83 c0 rjmp .+262 ; 0x296f4 #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 295ee: 80 91 7b 13 lds r24, 0x137B ; 0x80137b 295f2: 90 91 7c 13 lds r25, 0x137C ; 0x80137c 295f6: 68 16 cp r6, r24 295f8: 79 06 cpc r7, r25 295fa: 09 f0 breq .+2 ; 0x295fe 295fc: 6c c0 rjmp .+216 ; 0x296d6 295fe: 80 91 79 13 lds r24, 0x1379 ; 0x801379 29602: 90 91 7a 13 lds r25, 0x137A ; 0x80137a 29606: 2a ad ldd r18, Y+58 ; 0x3a 29608: 3b ad ldd r19, Y+59 ; 0x3b 2960a: 82 17 cp r24, r18 2960c: 93 07 cpc r25, r19 2960e: 08 f0 brcs .+2 ; 0x29612 29610: 66 c0 rjmp .+204 ; 0x296de #endif sort_entries[j] = o2; } } /// place the position sort_entries[j] = o1; 29612: 00 0f add r16, r16 29614: 11 1f adc r17, r17 29616: f8 01 movw r30, r16 29618: e3 5f subi r30, 0xF3 ; 243 2961a: fa 4e sbci r31, 0xEA ; 234 2961c: 28 ad ldd r18, Y+56 ; 0x38 2961e: 39 ad ldd r19, Y+57 ; 0x39 29620: 31 83 std Z+1, r19 ; 0x01 29622: 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){ 29624: 3f ef ldi r19, 0xFF ; 255 29626: c3 1a sub r12, r19 29628: d3 0a sbc r13, r19 2962a: 82 e0 ldi r24, 0x02 ; 2 2962c: a8 0e add r10, r24 2962e: b1 1c adc r11, r1 29630: ec 14 cp r14, r12 29632: fd 04 cpc r15, r13 29634: 09 f0 breq .+2 ; 0x29638 29636: 91 cf rjmp .-222 ; 0x2955a for (uint16_t z = 0; z < fileCnt; z++) printf_P(PSTR("%2u "), sort_entries[z]); SERIAL_PROTOCOLLN(); #endif menu_progressbar_finish(); 29638: 0f 94 cf 91 call 0x3239e ; 0x3239e } } KEEPALIVE_STATE(NOT_BUSY); 2963c: 81 e0 ldi r24, 0x01 ; 1 2963e: 80 93 78 02 sts 0x0278, r24 ; 0x800278 } 29642: ed 96 adiw r28, 0x3d ; 61 29644: 0f b6 in r0, 0x3f ; 63 29646: f8 94 cli 29648: de bf out 0x3e, r29 ; 62 2964a: 0f be out 0x3f, r0 ; 63 2964c: cd bf out 0x3d, r28 ; 61 2964e: df 91 pop r29 29650: cf 91 pop r28 29652: 1f 91 pop r17 29654: 0f 91 pop r16 29656: ff 90 pop r15 29658: ef 90 pop r14 2965a: df 90 pop r13 2965c: cf 90 pop r12 2965e: bf 90 pop r11 29660: af 90 pop r10 29662: 9f 90 pop r9 29664: 8f 90 pop r8 29666: 7f 90 pop r7 29668: 6f 90 pop r6 2966a: 5f 90 pop r5 2966c: 4f 90 pop r4 2966e: 3f 90 pop r3 29670: 2f 90 pop r2 29672: 08 95 ret if (!IS_SD_INSERTED) return; manage_heater(); if (i == 0) getfilename(0); else getfilename_next(position); 29674: 40 91 7d 13 lds r20, 0x137D ; 0x80137d 29678: 50 91 7e 13 lds r21, 0x137E ; 0x80137e 2967c: 60 91 7f 13 lds r22, 0x137F ; 0x80137f 29680: 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; 29684: b0 92 14 14 sts 0x1414, r11 ; 0x801414 29688: a0 92 13 14 sts 0x1413, r10 ; 0x801413 nrFiles = 1; 2968c: 90 92 83 16 sts 0x1683, r9 ; 0x801683 29690: 80 92 82 16 sts 0x1682, r8 ; 0x801682 curDir->seekSet(position); 29694: 85 e1 ldi r24, 0x15 ; 21 29696: 94 e1 ldi r25, 0x14 ; 20 29698: 0f 94 f7 39 call 0x273ee ; 0x273ee 2969c: 1e 7f andi r17, 0xFE ; 254 2969e: 1d 7f andi r17, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 296a0: e0 91 13 14 lds r30, 0x1413 ; 0x801413 296a4: f0 91 14 14 lds r31, 0x1414 ; 0x801414 296a8: 83 e2 ldi r24, 0x23 ; 35 296aa: de 01 movw r26, r28 296ac: 11 96 adiw r26, 0x01 ; 1 296ae: 01 90 ld r0, Z+ 296b0: 0d 92 st X+, r0 296b2: 8a 95 dec r24 296b4: e1 f7 brne .-8 ; 0x296ae 296b6: 01 2f mov r16, r17 296b8: 22 e0 ldi r18, 0x02 ; 2 296ba: 50 e0 ldi r21, 0x00 ; 0 296bc: 40 e0 ldi r20, 0x00 ; 0 296be: be 01 movw r22, r28 296c0: 6f 5f subi r22, 0xFF ; 255 296c2: 7f 4f sbci r23, 0xFF ; 255 296c4: 8a ed ldi r24, 0xDA ; 218 296c6: 92 e0 ldi r25, 0x02 ; 2 296c8: 0f 94 28 46 call 0x28c50 ; 0x28c50 296cc: ce 01 movw r24, r28 296ce: 01 96 adiw r24, 0x01 ; 1 296d0: 0e 94 31 70 call 0xe062 ; 0xe062 296d4: ff ce rjmp .-514 ; 0x294d4 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)) 296d6: 86 15 cp r24, r6 296d8: 97 05 cpc r25, r7 296da: 08 f4 brcc .+2 ; 0x296de 296dc: 9a cf rjmp .-204 ; 0x29612 break; } else { #ifdef SORTING_DUMP puts_P(PSTR("shift")); #endif sort_entries[j] = o2; 296de: ee a9 ldd r30, Y+54 ; 0x36 296e0: ff a9 ldd r31, Y+55 ; 0x37 296e2: 53 82 std Z+3, r5 ; 0x03 296e4: 42 82 std Z+2, r4 ; 0x02 296e6: 0c ad ldd r16, Y+60 ; 0x3c 296e8: 1d ad ldd r17, Y+61 ; 0x3d bool dir1 = filenameIsDir; #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ 296ea: 01 15 cp r16, r1 296ec: 11 05 cpc r17, r1 296ee: 09 f0 breq .+2 ; 0x296f2 296f0: 5d cf rjmp .-326 ; 0x295ac 296f2: 8f cf rjmp .-226 ; 0x29612 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)) 296f4: 22 20 and r2, r2 296f6: 99 f3 breq .-26 ; 0x296de 296f8: 8c cf rjmp .-232 ; 0x29612 296fa: 31 e0 ldi r19, 0x01 ; 1 296fc: 33 12 cpse r3, r19 296fe: ef cf rjmp .-34 ; 0x296de getfilename_simple(o2); char *name2 = LONGEST_FILENAME; // use the string in-place // Sort the current pair according to settings. if ( 29700: 80 91 b6 13 lds r24, 0x13B6 ; 0x8013b6 29704: 28 12 cpse r2, r24 29706: 07 c0 rjmp .+14 ; 0x29716 #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 29708: ce 01 movw r24, r28 2970a: 01 96 adiw r24, 0x01 ; 1 2970c: 0f 94 d4 a6 call 0x34da8 ; 0x34da8 29710: 97 fd sbrc r25, 7 29712: e5 cf rjmp .-54 ; 0x296de 29714: 7e cf rjmp .-260 ; 0x29612 29716: 21 10 cpse r2, r1 29718: e2 cf rjmp .-60 ; 0x296de 2971a: 7b cf rjmp .-266 ; 0x29612 0002971c : lsDive("",*curDir, NULL, LS_Count); //SERIAL_ECHOLN(nrFiles); return nrFiles; } bool CardReader::chdir(const char * relpath, bool doPresort) 2971c: cf 92 push r12 2971e: df 92 push r13 29720: ef 92 push r14 29722: ff 92 push r15 29724: 0f 93 push r16 29726: 1f 93 push r17 29728: cf 93 push r28 2972a: df 93 push r29 2972c: cd b7 in r28, 0x3d ; 61 2972e: de b7 in r29, 0x3e ; 62 29730: a3 97 sbiw r28, 0x23 ; 35 29732: 0f b6 in r0, 0x3f ; 63 29734: f8 94 cli 29736: de bf out 0x3e, r29 ; 62 29738: 0f be out 0x3f, r0 ; 63 2973a: cd bf out 0x3d, r28 ; 61 2973c: 7c 01 movw r14, r24 2973e: 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) {} 29740: 19 82 std Y+1, r1 ; 0x01 29742: 1c 82 std Y+4, r1 ; 0x04 { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 29744: 80 91 18 14 lds r24, 0x1418 ; 0x801418 parent=&workDir; 29748: 95 e1 ldi r25, 0x15 ; 21 2974a: c9 2e mov r12, r25 2974c: 94 e1 ldi r25, 0x14 ; 20 2974e: d9 2e mov r13, r25 bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 29750: 81 11 cpse r24, r1 29752: 04 c0 rjmp .+8 ; 0x2975c } bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; 29754: 80 ef ldi r24, 0xF0 ; 240 29756: c8 2e mov r12, r24 29758: 83 e1 ldi r24, 0x13 ; 19 2975a: 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); 2975c: 21 e0 ldi r18, 0x01 ; 1 2975e: a7 01 movw r20, r14 29760: b6 01 movw r22, r12 29762: ce 01 movw r24, r28 29764: 01 96 adiw r24, 0x01 ; 1 29766: 0f 94 48 9a call 0x33490 ; 0x33490 2976a: 18 2f mov r17, r24 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) 2976c: 88 23 and r24, r24 2976e: 21 f1 breq .+72 ; 0x297b8 29770: 80 91 0a 15 lds r24, 0x150A ; 0x80150a 29774: 85 30 cpi r24, 0x05 ; 5 29776: 00 f5 brcc .+64 ; 0x297b8 SERIAL_ECHOLN(relpath); return 0; } else { strcpy(dir_names[workDirDepth], relpath); 29778: 29 e0 ldi r18, 0x09 ; 9 2977a: 82 9f mul r24, r18 2977c: c0 01 movw r24, r0 2977e: 11 24 eor r1, r1 29780: b7 01 movw r22, r14 29782: 86 54 subi r24, 0x46 ; 70 29784: 9c 4e sbci r25, 0xEC ; 236 29786: 0f 94 06 a7 call 0x34e0c ; 0x34e0c puts(relpath); 2978a: c7 01 movw r24, r14 2978c: 0f 94 2a a7 call 0x34e54 ; 0x34e54 if (workDirDepth < MAX_DIR_DEPTH) { 29790: 80 91 0a 15 lds r24, 0x150A ; 0x80150a 29794: 86 30 cpi r24, 0x06 ; 6 29796: 80 f1 brcs .+96 ; 0x297f8 for (uint8_t d = ++workDirDepth; d--;) workDirParents[d+1] = workDirParents[d]; workDirParents[0]=*parent; } workDir=newfile; 29798: 83 e2 ldi r24, 0x23 ; 35 2979a: fe 01 movw r30, r28 2979c: 31 96 adiw r30, 0x01 ; 1 2979e: a5 e1 ldi r26, 0x15 ; 21 297a0: b4 e1 ldi r27, 0x14 ; 20 297a2: 01 90 ld r0, Z+ 297a4: 0d 92 st X+, r0 297a6: 8a 95 dec r24 297a8: e1 f7 brne .-8 ; 0x297a2 #ifdef SDCARD_SORT_ALPHA if (doPresort) 297aa: 00 23 and r16, r16 297ac: 09 f4 brne .+2 ; 0x297b0 297ae: 4c c0 rjmp .+152 ; 0x29848 presort(); 297b0: 0f 94 04 4a call 0x29408 ; 0x29408 else presort_flag = true; #endif return 1; 297b4: 10 2f mov r17, r16 297b6: 0c c0 rjmp .+24 ; 0x297d0 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) { SERIAL_ECHO_START; 297b8: 81 e6 ldi r24, 0x61 ; 97 297ba: 9d e9 ldi r25, 0x9D ; 157 297bc: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHORPGM(_n("Cannot enter subdir: "));////MSG_SD_CANT_ENTER_SUBDIR 297c0: 8f ec ldi r24, 0xCF ; 207 297c2: 9b e6 ldi r25, 0x6B ; 107 297c4: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLN(relpath); 297c8: c7 01 movw r24, r14 297ca: 0f 94 bc 99 call 0x33378 ; 0x33378 return 0; 297ce: 10 e0 ldi r17, 0x00 ; 0 297d0: ce 01 movw r24, r28 297d2: 01 96 adiw r24, 0x01 ; 1 297d4: 0e 94 31 70 call 0xe062 ; 0xe062 else presort_flag = true; #endif return 1; } } 297d8: 81 2f mov r24, r17 297da: a3 96 adiw r28, 0x23 ; 35 297dc: 0f b6 in r0, 0x3f ; 63 297de: f8 94 cli 297e0: de bf out 0x3e, r29 ; 62 297e2: 0f be out 0x3f, r0 ; 63 297e4: cd bf out 0x3d, r28 ; 61 297e6: df 91 pop r29 297e8: cf 91 pop r28 297ea: 1f 91 pop r17 297ec: 0f 91 pop r16 297ee: ff 90 pop r15 297f0: ef 90 pop r14 297f2: df 90 pop r13 297f4: cf 90 pop r12 297f6: 08 95 ret { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 297f8: 8f 5f subi r24, 0xFF ; 255 297fa: 80 93 0a 15 sts 0x150A, r24 ; 0x80150a workDirParents[d+1] = workDirParents[d]; 297fe: 93 e2 ldi r25, 0x23 ; 35 { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 29800: 81 50 subi r24, 0x01 ; 1 29802: c8 f0 brcs .+50 ; 0x29836 workDirParents[d+1] = workDirParents[d]; 29804: 28 2f mov r18, r24 29806: 30 e0 ldi r19, 0x00 ; 0 29808: a9 01 movw r20, r18 2980a: 4f 5f subi r20, 0xFF ; 255 2980c: 5f 4f sbci r21, 0xFF ; 255 2980e: 94 9f mul r25, r20 29810: d0 01 movw r26, r0 29812: 95 9f mul r25, r21 29814: b0 0d add r27, r0 29816: 11 24 eor r1, r1 29818: a8 5c subi r26, 0xC8 ; 200 2981a: bb 4e sbci r27, 0xEB ; 235 2981c: 92 9f mul r25, r18 2981e: f0 01 movw r30, r0 29820: 93 9f mul r25, r19 29822: f0 0d add r31, r0 29824: 11 24 eor r1, r1 29826: e8 5c subi r30, 0xC8 ; 200 29828: fb 4e sbci r31, 0xEB ; 235 2982a: 29 2f mov r18, r25 2982c: 01 90 ld r0, Z+ 2982e: 0d 92 st X+, r0 29830: 2a 95 dec r18 29832: e1 f7 brne .-8 ; 0x2982c 29834: e5 cf rjmp .-54 ; 0x29800 workDirParents[0]=*parent; 29836: 83 e2 ldi r24, 0x23 ; 35 29838: f6 01 movw r30, r12 2983a: a8 e3 ldi r26, 0x38 ; 56 2983c: b4 e1 ldi r27, 0x14 ; 20 2983e: 01 90 ld r0, Z+ 29840: 0d 92 st X+, r0 29842: 8a 95 dec r24 29844: e1 f7 brne .-8 ; 0x2983e 29846: a8 cf rjmp .-176 ; 0x29798 #ifdef SDCARD_SORT_ALPHA if (doPresort) presort(); else presort_flag = true; 29848: 81 e0 ldi r24, 0x01 ; 1 2984a: 80 93 b9 13 sts 0x13B9, r24 ; 0x8013b9 2984e: c0 cf rjmp .-128 ; 0x297d0 00029850 : } } void __attribute__((noinline)) CardReader::cdroot(bool doPresort) { workDir=root; 29850: 93 e2 ldi r25, 0x23 ; 35 29852: e0 ef ldi r30, 0xF0 ; 240 29854: f3 e1 ldi r31, 0x13 ; 19 29856: a5 e1 ldi r26, 0x15 ; 21 29858: b4 e1 ldi r27, 0x14 ; 20 2985a: 01 90 ld r0, Z+ 2985c: 0d 92 st X+, r0 2985e: 9a 95 dec r25 29860: e1 f7 brne .-8 ; 0x2985a workDirDepth = 0; 29862: 10 92 0a 15 sts 0x150A, r1 ; 0x80150a curDir=&workDir; 29866: 25 e1 ldi r18, 0x15 ; 21 29868: 34 e1 ldi r19, 0x14 ; 20 2986a: 30 93 14 14 sts 0x1414, r19 ; 0x801414 2986e: 20 93 13 14 sts 0x1413, r18 ; 0x801413 #ifdef SDCARD_SORT_ALPHA if (doPresort) 29872: 81 11 cpse r24, r1 presort(); 29874: 0d 94 04 4a jmp 0x29408 ; 0x29408 else presort_flag = true; 29878: 81 e0 ldi r24, 0x01 ; 1 2987a: 80 93 b9 13 sts 0x13B9, r24 ; 0x8013b9 #endif } 2987e: 08 95 ret 00029880 : * * @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) 29880: 8f 92 push r8 29882: 9f 92 push r9 29884: af 92 push r10 29886: bf 92 push r11 29888: cf 92 push r12 2988a: df 92 push r13 2988c: ef 92 push r14 2988e: ff 92 push r15 29890: 0f 93 push r16 29892: 1f 93 push r17 29894: cf 93 push r28 29896: df 93 push r29 29898: cd b7 in r28, 0x3d ; 61 2989a: de b7 in r29, 0x3e ; 62 2989c: 2d 97 sbiw r28, 0x0d ; 13 2989e: 0f b6 in r0, 0x3f ; 63 298a0: f8 94 cli 298a2: de bf out 0x3e, r29 ; 62 298a4: 0f be out 0x3f, r0 ; 63 298a6: cd bf out 0x3d, r28 ; 61 { curDir=&root; 298a8: 20 ef ldi r18, 0xF0 ; 240 298aa: 33 e1 ldi r19, 0x13 ; 19 298ac: 30 93 14 14 sts 0x1414, r19 ; 0x801414 298b0: 20 93 13 14 sts 0x1413, r18 ; 0x801413 if (!fileName) 298b4: dc 01 movw r26, r24 298b6: ed 91 ld r30, X+ 298b8: fc 91 ld r31, X 298ba: 30 97 sbiw r30, 0x00 ; 0 298bc: a1 f4 brne .+40 ; 0x298e6 } else //relative path { curDir = &workDir; } return 1; 298be: 81 e0 ldi r24, 0x01 ; 1 } 298c0: 2d 96 adiw r28, 0x0d ; 13 298c2: 0f b6 in r0, 0x3f ; 63 298c4: f8 94 cli 298c6: de bf out 0x3e, r29 ; 62 298c8: 0f be out 0x3f, r0 ; 63 298ca: cd bf out 0x3d, r28 ; 61 298cc: df 91 pop r29 298ce: cf 91 pop r28 298d0: 1f 91 pop r17 298d2: 0f 91 pop r16 298d4: ff 90 pop r15 298d6: ef 90 pop r14 298d8: df 90 pop r13 298da: cf 90 pop r12 298dc: bf 90 pop r11 298de: af 90 pop r10 298e0: 9f 90 pop r9 298e2: 8f 90 pop r8 298e4: 08 95 ret curDir=&root; if (!fileName) return 1; const char *dirname_start, *dirname_end; if (fileName[0] == '/') // absolute path 298e6: 20 81 ld r18, Z 298e8: 2f 32 cpi r18, 0x2F ; 47 298ea: 09 f0 breq .+2 ; 0x298ee 298ec: 47 c0 rjmp .+142 ; 0x2997c 298ee: 6c 01 movw r12, r24 { cdroot(false); 298f0: 80 e0 ldi r24, 0x00 ; 0 298f2: 0f 94 28 4c call 0x29850 ; 0x29850 dirname_start = fileName + 1; 298f6: f6 01 movw r30, r12 298f8: 00 81 ld r16, Z 298fa: 11 81 ldd r17, Z+1 ; 0x01 298fc: 0f 5f subi r16, 0xFF ; 255 298fe: 1f 4f sbci r17, 0xFF ; 255 strncpy(subdirname, dirname_start, len); subdirname[len] = 0; if (!chdir(subdirname, false)) return 0; curDir = &workDir; 29900: 95 e1 ldi r25, 0x15 ; 21 29902: 89 2e mov r8, r25 29904: 94 e1 ldi r25, 0x14 ; 20 29906: 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) 29908: d8 01 movw r26, r16 2990a: 8c 91 ld r24, X 2990c: 88 23 and r24, r24 2990e: b9 f2 breq .-82 ; 0x298be { dirname_end = strchr(dirname_start, '/'); 29910: 6f e2 ldi r22, 0x2F ; 47 29912: 70 e0 ldi r23, 0x00 ; 0 29914: c8 01 movw r24, r16 29916: 0f 94 f2 a6 call 0x34de4 ; 0x34de4 2991a: 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) 2991c: 00 97 sbiw r24, 0x00 ; 0 2991e: 51 f1 breq .+84 ; 0x29974 29920: 08 17 cp r16, r24 29922: 19 07 cpc r17, r25 29924: 38 f5 brcc .+78 ; 0x29974 { 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); 29926: 7c 01 movw r14, r24 29928: e0 1a sub r14, r16 2992a: f1 0a sbc r15, r17 2992c: bd e0 ldi r27, 0x0D ; 13 2992e: eb 16 cp r14, r27 29930: f1 04 cpc r15, r1 29932: 18 f0 brcs .+6 ; 0x2993a 29934: 8c e0 ldi r24, 0x0C ; 12 29936: e8 2e mov r14, r24 29938: f1 2c mov r15, r1 strncpy(subdirname, dirname_start, len); 2993a: a7 01 movw r20, r14 2993c: b8 01 movw r22, r16 2993e: ce 01 movw r24, r28 29940: 01 96 adiw r24, 0x01 ; 1 29942: 0f 94 1b a7 call 0x34e36 ; 0x34e36 subdirname[len] = 0; 29946: e1 e0 ldi r30, 0x01 ; 1 29948: f0 e0 ldi r31, 0x00 ; 0 2994a: ec 0f add r30, r28 2994c: fd 1f adc r31, r29 2994e: ee 0d add r30, r14 29950: ff 1d adc r31, r15 29952: 10 82 st Z, r1 if (!chdir(subdirname, false)) 29954: 60 e0 ldi r22, 0x00 ; 0 29956: ce 01 movw r24, r28 29958: 01 96 adiw r24, 0x01 ; 1 2995a: 0f 94 8e 4b call 0x2971c ; 0x2971c 2995e: 88 23 and r24, r24 29960: 09 f4 brne .+2 ; 0x29964 29962: ae cf rjmp .-164 ; 0x298c0 return 0; curDir = &workDir; 29964: 90 92 14 14 sts 0x1414, r9 ; 0x801414 29968: 80 92 13 14 sts 0x1413, r8 ; 0x801413 dirname_start = dirname_end + 1; 2996c: 85 01 movw r16, r10 2996e: 0f 5f subi r16, 0xFF ; 255 29970: 1f 4f sbci r17, 0xFF ; 255 29972: ca cf rjmp .-108 ; 0x29908 } else // the reminder after all /fsa/fdsa/ is the filename { fileName = dirname_start; 29974: f6 01 movw r30, r12 29976: 11 83 std Z+1, r17 ; 0x01 29978: 00 83 st Z, r16 2997a: a1 cf rjmp .-190 ; 0x298be } } else //relative path { curDir = &workDir; 2997c: 85 e1 ldi r24, 0x15 ; 21 2997e: 94 e1 ldi r25, 0x14 ; 20 29980: 90 93 14 14 sts 0x1414, r25 ; 0x801414 29984: 80 93 13 14 sts 0x1413, r24 ; 0x801413 29988: 9a cf rjmp .-204 ; 0x298be 0002998a : 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*/){ 2998a: bf 92 push r11 2998c: cf 92 push r12 2998e: df 92 push r13 29990: ef 92 push r14 29992: ff 92 push r15 29994: 0f 93 push r16 29996: 1f 93 push r17 29998: cf 93 push r28 2999a: df 93 push r29 2999c: 1f 92 push r1 2999e: 1f 92 push r1 299a0: cd b7 in r28, 0x3d ; 61 299a2: de b7 in r29, 0x3e ; 62 if(!mounted) 299a4: 20 91 6b 13 lds r18, 0x136B ; 0x80136b 299a8: 22 23 and r18, r18 299aa: 09 f4 brne .+2 ; 0x299ae 299ac: ef c0 rjmp .+478 ; 0x29b8c 299ae: 7c 01 movw r14, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 299b0: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 299b4: 88 23 and r24, r24 299b6: 09 f4 brne .+2 ; 0x299ba 299b8: 04 c1 rjmp .+520 ; 0x29bc2 if(!replace_current){ 299ba: 61 11 cpse r22, r1 299bc: f6 c0 rjmp .+492 ; 0x29baa if((int)file_subcall_ctr>(int)SD_PROCEDURE_DEPTH-1){ 299be: d0 90 1d 16 lds r13, 0x161D ; 0x80161d 299c2: dd 20 and r13, r13 299c4: 21 f0 breq .+8 ; 0x299ce // 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); 299c6: 8f e6 ldi r24, 0x6F ; 111 299c8: 9c e9 ldi r25, 0x9C ; 156 299ca: 0e 94 d5 72 call 0xe5aa ; 0xe5aa return; } SERIAL_ECHO_START; 299ce: 81 e6 ldi r24, 0x61 ; 97 299d0: 9d e9 ldi r25, 0x9D ; 157 299d2: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHORPGM(ofSubroutineCallTgt); 299d6: 86 e5 ldi r24, 0x56 ; 86 299d8: 9c e9 ldi r25, 0x9C ; 156 299da: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 299de: c7 01 movw r24, r14 299e0: 0e 94 a0 7c call 0xf940 ; 0xf940 SERIAL_ECHO(name); SERIAL_ECHORPGM(ofParent); 299e4: 8b e4 ldi r24, 0x4B ; 75 299e6: 9c e9 ldi r25, 0x9C ; 156 299e8: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); 299ec: 00 91 1d 16 lds r16, 0x161D ; 0x80161d 299f0: 25 e5 ldi r18, 0x55 ; 85 299f2: 02 9f mul r16, r18 299f4: 80 01 movw r16, r0 299f6: 11 24 eor r1, r1 } void CardReader::getAbsFilename(char *t) { uint8_t cnt=0; *t='/';t++;cnt++; 299f8: 0e 5d subi r16, 0xDE ; 222 299fa: 19 4e sbci r17, 0xE9 ; 233 299fc: 8f e2 ldi r24, 0x2F ; 47 299fe: f8 01 movw r30, r16 29a00: 81 93 st Z+, r24 29a02: 8f 01 movw r16, r30 29a04: cc 24 eor r12, r12 29a06: c3 94 inc r12 for(uint8_t i=0;i 29a10: d8 16 cp r13, r24 29a12: b0 f4 brcc .+44 ; 0x29a40 { workDirParents[i].getFilename(t); //SDBaseFile.getfilename! 29a14: db 9c mul r13, r11 29a16: c0 01 movw r24, r0 29a18: 11 24 eor r1, r1 29a1a: b8 01 movw r22, r16 29a1c: 88 5c subi r24, 0xC8 ; 200 29a1e: 9b 4e sbci r25, 0xEB ; 235 29a20: 0f 94 74 6f call 0x2dee8 ; 0x2dee8 29a24: c8 01 movw r24, r16 29a26: 8c 01 movw r16, r24 29a28: 01 96 adiw r24, 0x01 ; 1 while(*t!=0 && cnt< MAXPATHNAMELENGTH) 29a2a: f8 01 movw r30, r16 29a2c: 20 81 ld r18, Z 29a2e: 22 23 and r18, r18 29a30: 29 f0 breq .+10 ; 0x29a3c 29a32: f4 e5 ldi r31, 0x54 ; 84 29a34: fc 15 cp r31, r12 29a36: 10 f0 brcs .+4 ; 0x29a3c {t++;cnt++;} //crawl counter forward. 29a38: c3 94 inc r12 29a3a: f5 cf rjmp .-22 ; 0x29a26 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) 29a40: 27 e4 ldi r18, 0x47 ; 71 29a42: 2c 15 cp r18, r12 29a44: 08 f4 brcc .+2 ; 0x29a48 29a46: ae c0 rjmp .+348 ; 0x29ba4 file.getFilename(t); 29a48: b8 01 movw r22, r16 29a4a: 8a ef ldi r24, 0xFA ; 250 29a4c: 95 e1 ldi r25, 0x15 ; 21 29a4e: 0f 94 74 6f call 0x2dee8 ; 0x2dee8 SERIAL_ECHORPGM(ofParent); //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); SERIAL_ECHO(filenames[file_subcall_ctr]); 29a52: 80 91 1d 16 lds r24, 0x161D ; 0x80161d 29a56: f5 e5 ldi r31, 0x55 ; 85 29a58: 8f 9f mul r24, r31 29a5a: c0 01 movw r24, r0 29a5c: 11 24 eor r1, r1 29a5e: 8e 5d subi r24, 0xDE ; 222 29a60: 99 4e sbci r25, 0xE9 ; 233 29a62: 0e 94 a0 7c call 0xf940 ; 0xf940 SERIAL_ECHORPGM(ofPos); 29a66: 85 e4 ldi r24, 0x45 ; 69 29a68: 9c e9 ldi r25, 0x9C ; 156 29a6a: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 29a6e: 60 91 7e 16 lds r22, 0x167E ; 0x80167e 29a72: 70 91 7f 16 lds r23, 0x167F ; 0x80167f 29a76: 80 91 80 16 lds r24, 0x1680 ; 0x801680 29a7a: 90 91 81 16 lds r25, 0x1681 ; 0x801681 29a7e: 4a e0 ldi r20, 0x0A ; 10 29a80: 0f 94 eb 96 call 0x32dd6 ; 0x32dd6 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 29a84: 0f 94 bb 98 call 0x33176 ; 0x33176 SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; 29a88: 80 91 1d 16 lds r24, 0x161D ; 0x80161d 29a8c: 24 e0 ldi r18, 0x04 ; 4 29a8e: 82 9f mul r24, r18 29a90: f0 01 movw r30, r0 29a92: 11 24 eor r1, r1 29a94: e2 5e subi r30, 0xE2 ; 226 29a96: f9 4e sbci r31, 0xE9 ; 233 29a98: 40 91 7e 16 lds r20, 0x167E ; 0x80167e 29a9c: 50 91 7f 16 lds r21, 0x167F ; 0x80167f 29aa0: 60 91 80 16 lds r22, 0x1680 ; 0x801680 29aa4: 70 91 81 16 lds r23, 0x1681 ; 0x801681 29aa8: 40 83 st Z, r20 29aaa: 51 83 std Z+1, r21 ; 0x01 29aac: 62 83 std Z+2, r22 ; 0x02 29aae: 73 83 std Z+3, r23 ; 0x03 file_subcall_ctr++; 29ab0: 8f 5f subi r24, 0xFF ; 255 29ab2: 80 93 1d 16 sts 0x161D, r24 ; 0x80161d } else { SERIAL_ECHO_START; SERIAL_ECHORPGM(ofNowDoingFile); SERIAL_ECHOLN(name); } file.close(); 29ab6: 8a ef ldi r24, 0xFA ; 250 29ab8: 95 e1 ldi r25, 0x15 ; 21 29aba: 0f 94 51 6f call 0x2dea2 ; 0x2dea2 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; 29abe: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a const char *fname=name; 29ac2: fa 82 std Y+2, r15 ; 0x02 29ac4: e9 82 std Y+1, r14 ; 0x01 if (!diveSubfolder(fname)) 29ac6: ce 01 movw r24, r28 29ac8: 01 96 adiw r24, 0x01 ; 1 29aca: 0f 94 40 4c call 0x29880 ; 0x29880 29ace: 88 23 and r24, r24 29ad0: 09 f4 brne .+2 ; 0x29ad4 29ad2: 5c c0 rjmp .+184 ; 0x29b8c */ 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) ){ 29ad4: 49 81 ldd r20, Y+1 ; 0x01 29ad6: 5a 81 ldd r21, Y+2 ; 0x02 29ad8: 60 91 13 14 lds r22, 0x1413 ; 0x801413 29adc: 70 91 14 14 lds r23, 0x1414 ; 0x801414 29ae0: 21 e0 ldi r18, 0x01 ; 1 29ae2: 8a ef ldi r24, 0xFA ; 250 29ae4: 95 e1 ldi r25, 0x15 ; 21 29ae6: 0f 94 48 9a call 0x33490 ; 0x33490 29aea: 88 23 and r24, r24 29aec: 09 f4 brne .+2 ; 0x29af0 29aee: 77 c0 rjmp .+238 ; 0x29bde // compute the block to start with if( ! gfComputeNextFileBlock() ) 29af0: 8a ef ldi r24, 0xFA ; 250 29af2: 95 e1 ldi r25, 0x15 ; 21 29af4: 0f 94 e1 38 call 0x271c2 ; 0x271c2 29af8: 88 23 and r24, r24 29afa: 09 f4 brne .+2 ; 0x29afe 29afc: 70 c0 rjmp .+224 ; 0x29bde 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; 29afe: 80 91 1b 16 lds r24, 0x161B ; 0x80161b 29b02: 90 91 1c 16 lds r25, 0x161C ; 0x80161c 29b06: 87 52 subi r24, 0x27 ; 39 29b08: 92 4f sbci r25, 0xF2 ; 242 29b0a: 90 93 16 16 sts 0x1616, r25 ; 0x801616 29b0e: 80 93 15 16 sts 0x1615, r24 ; 0x801615 return; if (file.openFilteredGcode(curDir, fname)) { getfilename(0, fname); 29b12: 89 81 ldd r24, Y+1 ; 0x01 29b14: 9a 81 ldd r25, Y+2 ; 0x02 29b16: 0f 94 57 48 call 0x290ae ; 0x290ae filesize = file.fileSize(); 29b1a: 80 91 0b 16 lds r24, 0x160B ; 0x80160b 29b1e: 90 91 0c 16 lds r25, 0x160C ; 0x80160c 29b22: a0 91 0d 16 lds r26, 0x160D ; 0x80160d 29b26: b0 91 0e 16 lds r27, 0x160E ; 0x80160e 29b2a: 80 93 77 16 sts 0x1677, r24 ; 0x801677 29b2e: 90 93 78 16 sts 0x1678, r25 ; 0x801678 29b32: a0 93 79 16 sts 0x1679, r26 ; 0x801679 29b36: b0 93 7a 16 sts 0x167A, r27 ; 0x80167a SERIAL_PROTOCOLRPGM(ofFileOpened);////MSG_SD_FILE_OPENED 29b3a: 85 e1 ldi r24, 0x15 ; 21 29b3c: 9c e9 ldi r25, 0x9C ; 156 29b3e: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 printAbsFilenameFast(); 29b42: 0f 94 3a 49 call 0x29274 ; 0x29274 SERIAL_PROTOCOLRPGM(ofSize);////MSG_SD_SIZE 29b46: 8d e0 ldi r24, 0x0D ; 13 29b48: 9c e9 ldi r25, 0x9C ; 156 29b4a: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 29b4e: 60 91 77 16 lds r22, 0x1677 ; 0x801677 29b52: 70 91 78 16 lds r23, 0x1678 ; 0x801678 29b56: 80 91 79 16 lds r24, 0x1679 ; 0x801679 29b5a: 90 91 7a 16 lds r25, 0x167A ; 0x80167a 29b5e: 4a e0 ldi r20, 0x0A ; 10 29b60: 0f 94 eb 96 call 0x32dd6 ; 0x32dd6 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 29b64: 0f 94 bb 98 call 0x33176 ; 0x33176 SERIAL_PROTOCOLLN(filesize); sdpos = 0; 29b68: 10 92 7e 16 sts 0x167E, r1 ; 0x80167e 29b6c: 10 92 7f 16 sts 0x167F, r1 ; 0x80167f 29b70: 10 92 80 16 sts 0x1680, r1 ; 0x801680 29b74: 10 92 81 16 sts 0x1681, r1 ; 0x801681 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 29b78: 8f ef ldi r24, 0xFF ; 255 29b7a: 9b e9 ldi r25, 0x9B ; 155 29b7c: 0e 94 49 72 call 0xe492 ; 0xe492 lcd_setstatuspgm(ofFileSelected); 29b80: 8f ef ldi r24, 0xFF ; 255 29b82: 9b e9 ldi r25, 0x9B ; 155 29b84: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 scrollstuff = 0; 29b88: 10 92 cc 0d sts 0x0DCC, r1 ; 0x800dcc } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } 29b8c: 0f 90 pop r0 29b8e: 0f 90 pop r0 29b90: df 91 pop r29 29b92: cf 91 pop r28 29b94: 1f 91 pop r17 29b96: 0f 91 pop r16 29b98: ff 90 pop r15 29b9a: ef 90 pop r14 29b9c: df 90 pop r13 29b9e: cf 90 pop r12 29ba0: bf 90 pop r11 29ba2: 08 95 ret {t++;cnt++;} //crawl counter forward. } if(cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH) file.getFilename(t); else t[0]=0; 29ba4: f8 01 movw r30, r16 29ba6: 10 82 st Z, r1 29ba8: 54 cf rjmp .-344 ; 0x29a52 SERIAL_ECHORPGM(ofPos); SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; } else { SERIAL_ECHO_START; 29baa: 81 e6 ldi r24, 0x61 ; 97 29bac: 9d e9 ldi r25, 0x9D ; 157 29bae: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHORPGM(ofNowDoingFile); 29bb2: 84 e3 ldi r24, 0x34 ; 52 29bb4: 9c e9 ldi r25, 0x9C ; 156 29bb6: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLN(name); 29bba: c7 01 movw r24, r14 29bbc: 0f 94 bc 99 call 0x33378 ; 0x33378 29bc0: 7a cf rjmp .-268 ; 0x29ab6 } file.close(); } else { //opening fresh file file_subcall_ctr=0; //resetting procedure depth in case user cancels print while in procedure 29bc2: 10 92 1d 16 sts 0x161D, r1 ; 0x80161d SERIAL_ECHO_START; 29bc6: 81 e6 ldi r24, 0x61 ; 97 29bc8: 9d e9 ldi r25, 0x9D ; 157 29bca: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHORPGM(ofNowFreshFile); 29bce: 83 e2 ldi r24, 0x23 ; 35 29bd0: 9c e9 ldi r25, 0x9C ; 156 29bd2: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLN(name); 29bd6: c7 01 movw r24, r14 29bd8: 0f 94 bc 99 call 0x33378 ; 0x33378 29bdc: 70 cf rjmp .-288 ; 0x29abe SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 29bde: 8b eb ldi r24, 0xBB ; 187 29be0: 9b e6 ldi r25, 0x6B ; 107 29be2: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 29be6: 89 81 ldd r24, Y+1 ; 0x01 29be8: 9a 81 ldd r25, Y+2 ; 0x02 29bea: 0e 94 a0 7c call 0xf940 ; 0xf940 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 29bee: 8e e2 ldi r24, 0x2E ; 46 29bf0: 0e 94 37 70 call 0xe06e ; 0xe06e } void MarlinSerial::println(char c, int base) { print(c, base); println(); 29bf4: 0f 94 bb 98 call 0x33176 ; 0x33176 29bf8: c9 cf rjmp .-110 ; 0x29b8c 00029bfa : void CardReader::printingHasFinished() { st_synchronize(); 29bfa: 0f 94 ce 22 call 0x2459c ; 0x2459c file.close(); 29bfe: 8a ef ldi r24, 0xFA ; 250 29c00: 95 e1 ldi r25, 0x15 ; 21 29c02: 0f 94 51 6f call 0x2dea2 ; 0x2dea2 if(file_subcall_ctr>0) //heading up to a parent file that called current as a procedure. 29c06: 80 91 1d 16 lds r24, 0x161D ; 0x80161d 29c0a: 88 23 and r24, r24 29c0c: 69 f1 breq .+90 ; 0x29c68 { file_subcall_ctr--; 29c0e: 81 50 subi r24, 0x01 ; 1 29c10: 80 93 1d 16 sts 0x161D, r24 ; 0x80161d openFileReadFilteredGcode(filenames[file_subcall_ctr],true); 29c14: 25 e5 ldi r18, 0x55 ; 85 29c16: 82 9f mul r24, r18 29c18: c0 01 movw r24, r0 29c1a: 11 24 eor r1, r1 29c1c: 61 e0 ldi r22, 0x01 ; 1 29c1e: 8e 5d subi r24, 0xDE ; 222 29c20: 99 4e sbci r25, 0xE9 ; 233 29c22: 0f 94 c5 4c call 0x2998a ; 0x2998a setIndex(filespos[file_subcall_ctr]); 29c26: e0 91 1d 16 lds r30, 0x161D ; 0x80161d 29c2a: 84 e0 ldi r24, 0x04 ; 4 29c2c: e8 9f mul r30, r24 29c2e: f0 01 movw r30, r0 29c30: 11 24 eor r1, r1 29c32: e2 5e subi r30, 0xE2 ; 226 29c34: f9 4e sbci r31, 0xE9 ; 233 29c36: 60 81 ld r22, Z 29c38: 71 81 ldd r23, Z+1 ; 0x01 29c3a: 82 81 ldd r24, Z+2 ; 0x02 29c3c: 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);}; 29c3e: 60 93 7e 16 sts 0x167E, r22 ; 0x80167e 29c42: 70 93 7f 16 sts 0x167F, r23 ; 0x80167f 29c46: 80 93 80 16 sts 0x1680, r24 ; 0x801680 29c4a: 90 93 81 16 sts 0x1681, r25 ; 0x801681 29c4e: 0f 94 b5 44 call 0x2896a ; 0x2896a SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 29c52: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 29c56: 88 23 and r24, r24 29c58: 71 f0 breq .+28 ; 0x29c76 { sdprinting = true; 29c5a: 81 e0 ldi r24, 0x01 ; 1 29c5c: 80 93 6a 13 sts 0x136A, r24 ; 0x80136a 29c60: 85 e0 ldi r24, 0x05 ; 5 29c62: 80 93 cb 0d sts 0x0DCB, r24 ; 0x800dcb <_ZL13printer_state.lto_priv.367> 29c66: 08 95 ret setIndex(filespos[file_subcall_ctr]); startFileprint(); } else { sdprinting = false; 29c68: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a 29c6c: 83 e0 ldi r24, 0x03 ; 3 29c6e: 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(); 29c72: 0c 94 2f 74 jmp 0xe85e ; 0xe85e autotempShutdown(); #ifdef SDCARD_SORT_ALPHA //presort(); #endif } } 29c76: 08 95 ret 00029c78 : root.rewind(); lsDive("",root, NULL, LS_SerialPrint, params); } void CardReader::mount(bool doPresort/* = true*/) 29c78: cf 92 push r12 29c7a: df 92 push r13 29c7c: ef 92 push r14 29c7e: ff 92 push r15 29c80: 0f 93 push r16 29c82: 1f 93 push r17 29c84: cf 93 push r28 29c86: df 93 push r29 29c88: 08 2f mov r16, r24 { mounted = false; 29c8a: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b if(root.isOpen()) 29c8e: 80 91 f3 13 lds r24, 0x13F3 ; 0x8013f3 29c92: 88 23 and r24, r24 29c94: 21 f0 breq .+8 ; 0x29c9e root.close(); 29c96: 80 ef ldi r24, 0xF0 ; 240 29c98: 93 e1 ldi r25, 0x13 ; 19 29c9a: 0f 94 51 6f call 0x2dea2 ; 0x2dea2 * \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; 29c9e: 10 92 da 15 sts 0x15DA, r1 ; 0x8015da 29ca2: 10 92 d7 15 sts 0x15D7, r1 ; 0x8015d7 // 16-bit init start time allows over a minute uint16_t t0 = (uint16_t)_millis(); 29ca6: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 29caa: eb 01 movw r28, r22 uint32_t arg; // set pin modes chipSelectHigh(); 29cac: 0f 94 7f 42 call 0x284fe ; 0x284fe SET_OUTPUT(SDSS); 29cb0: 20 9a sbi 0x04, 0 ; 4 SET_INPUT(MISO); 29cb2: 23 98 cbi 0x04, 3 ; 4 SET_OUTPUT(MOSI); 29cb4: 22 9a sbi 0x04, 2 ; 4 SET_OUTPUT(SCK); 29cb6: 21 9a sbi 0x04, 1 ; 4 #ifndef SOFTWARE_SPI // SS must be in output mode even it is not chip select SET_OUTPUT(SS); 29cb8: 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); 29cba: 28 9a sbi 0x05, 0 ; 5 #endif // SET_SPI_SS_HIGH // set SCK rate for initialization commands spiRate_ = SPI_SD_INIT_RATE; 29cbc: 85 e0 ldi r24, 0x05 ; 5 29cbe: 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); 29cc2: 82 e5 ldi r24, 0x52 ; 82 29cc4: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 29cc6: 1d bc out 0x2d, r1 ; 45 29cc8: 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); 29cca: 8f ef ldi r24, 0xFF ; 255 29ccc: 0f 94 a9 70 call 0x2e152 ; 0x2e152 29cd0: 11 50 subi r17, 0x01 ; 1 29cd2: d9 f7 brne .-10 ; 0x29cca WRITE(MISO, 1); // temporarily enable the MISO line pullup 29cd4: 2b 9a sbi 0x05, 3 ; 5 // command to go idle in SPI mode while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { 29cd6: 20 e0 ldi r18, 0x00 ; 0 29cd8: 30 e0 ldi r19, 0x00 ; 0 29cda: a9 01 movw r20, r18 29cdc: 60 e0 ldi r22, 0x00 ; 0 29cde: 87 ed ldi r24, 0xD7 ; 215 29ce0: 95 e1 ldi r25, 0x15 ; 21 29ce2: 0f 94 b5 70 call 0x2e16a ; 0x2e16a 29ce6: 80 93 d9 15 sts 0x15D9, r24 ; 0x8015d9 29cea: 81 30 cpi r24, 0x01 ; 1 29cec: 61 f0 breq .+24 ; 0x29d06 if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 29cee: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 29cf2: 6c 1b sub r22, r28 29cf4: 7d 0b sbc r23, r29 29cf6: 61 3d cpi r22, 0xD1 ; 209 29cf8: 77 40 sbci r23, 0x07 ; 7 29cfa: 68 f3 brcs .-38 ; 0x29cd6 WRITE(MISO, 0); // disable the MISO line pullup 29cfc: 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;} 29cfe: 81 e0 ldi r24, 0x01 ; 1 29d00: 80 93 d7 15 sts 0x15D7, r24 ; 0x8015d7 29d04: 22 c0 rjmp .+68 ; 0x29d4a error(SD_CARD_ERROR_CMD0); goto fail; } } WRITE(MISO, 0); // disable the MISO line pullup 29d06: 2b 98 cbi 0x05, 3 ; 5 // send 0xFF until 0xFF received to give card some clock cycles t0 = (uint16_t)_millis(); 29d08: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 29d0c: eb 01 movw r28, r22 SERIAL_ECHOLNRPGM(PSTR("Sending 0xFF")); 29d0e: 82 ef ldi r24, 0xF2 ; 242 29d10: 9b e9 ldi r25, 0x9B ; 155 29d12: 0e 94 49 72 call 0xe492 ; 0xe492 spiSend(0XFF); 29d16: 8f ef ldi r24, 0xFF ; 255 29d18: 0f 94 a9 70 call 0x2e152 ; 0x2e152 while ((status_ = spiRec()) != 0xFF) 29d1c: 0f 94 ae 70 call 0x2e15c ; 0x2e15c 29d20: 80 93 d9 15 sts 0x15D9, r24 ; 0x8015d9 29d24: 8f 3f cpi r24, 0xFF ; 255 29d26: 59 f1 breq .+86 ; 0x29d7e { spiSend(0XFF); 29d28: 8f ef ldi r24, 0xFF ; 255 29d2a: 0f 94 a9 70 call 0x2e152 ; 0x2e152 if (((uint16_t)_millis() - t0) > SD_CARD_ERROR_FF_TIMEOUT) 29d2e: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 29d32: 6c 1b sub r22, r28 29d34: 7d 0b sbc r23, r29 29d36: 62 32 cpi r22, 0x22 ; 34 29d38: 71 05 cpc r23, r1 29d3a: 80 f3 brcs .-32 ; 0x29d1c 29d3c: 82 e0 ldi r24, 0x02 ; 2 29d3e: 80 93 d7 15 sts 0x15D7, r24 ; 0x8015d7 { error(SD_CARD_ERROR_CMD8); SERIAL_ECHOLNRPGM(PSTR("No 0xFF received")); 29d42: 81 ee ldi r24, 0xE1 ; 225 29d44: 9b e9 ldi r25, 0x9B ; 155 29d46: 0e 94 49 72 call 0xe492 ; 0xe492 #else // SOFTWARE_SPI return true; #endif // SOFTWARE_SPI fail: chipSelectHigh(); 29d4a: 0f 94 7f 42 call 0x284fe ; 0x284fe #else if (!card.init(SPI_FULL_SPEED) ) #endif { SERIAL_ECHO_START; 29d4e: 81 e6 ldi r24, 0x61 ; 97 29d50: 9d e9 ldi r25, 0x9D ; 157 29d52: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL 29d56: 8e ea ldi r24, 0xAE ; 174 29d58: 9b e6 ldi r25, 0x6B ; 107 } else { mounted = true; SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 29d5a: 0e 94 49 72 call 0xe492 ; 0xe492 } if (mounted) 29d5e: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 29d62: 88 23 and r24, r24 29d64: 09 f4 brne .+2 ; 0x29d68 29d66: 9a c0 rjmp .+308 ; 0x29e9c { cdroot(doPresort); 29d68: 80 2f mov r24, r16 } } 29d6a: df 91 pop r29 29d6c: cf 91 pop r28 29d6e: 1f 91 pop r17 29d70: 0f 91 pop r16 29d72: ff 90 pop r15 29d74: ef 90 pop r14 29d76: df 90 pop r13 29d78: cf 90 pop r12 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK } if (mounted) { cdroot(doPresort); 29d7a: 0d 94 28 4c jmp 0x29850 ; 0x29850 goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 29d7e: 2a ea ldi r18, 0xAA ; 170 29d80: 31 e0 ldi r19, 0x01 ; 1 29d82: 40 e0 ldi r20, 0x00 ; 0 29d84: 50 e0 ldi r21, 0x00 ; 0 29d86: 68 e0 ldi r22, 0x08 ; 8 29d88: 87 ed ldi r24, 0xD7 ; 215 29d8a: 95 e1 ldi r25, 0x15 ; 21 29d8c: 0f 94 b5 70 call 0x2e16a ; 0x2e16a 29d90: 82 ff sbrs r24, 2 29d92: 2b c0 rjmp .+86 ; 0x29dea 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;} 29d94: 81 e0 ldi r24, 0x01 ; 1 29d96: 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; 29d9a: 80 91 da 15 lds r24, 0x15DA ; 0x8015da 29d9e: c1 2c mov r12, r1 29da0: d1 2c mov r13, r1 29da2: 76 01 movw r14, r12 29da4: 82 30 cpi r24, 0x02 ; 2 29da6: 29 f4 brne .+10 ; 0x29db2 29da8: c1 2c mov r12, r1 29daa: d1 2c mov r13, r1 29dac: e1 2c mov r14, r1 29dae: 80 e4 ldi r24, 0x40 ; 64 29db0: 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); 29db2: 20 e0 ldi r18, 0x00 ; 0 29db4: 30 e0 ldi r19, 0x00 ; 0 29db6: a9 01 movw r20, r18 29db8: 67 e3 ldi r22, 0x37 ; 55 29dba: 87 ed ldi r24, 0xD7 ; 215 29dbc: 95 e1 ldi r25, 0x15 ; 21 29dbe: 0f 94 b5 70 call 0x2e16a ; 0x2e16a return cardCommand(cmd, arg); 29dc2: a7 01 movw r20, r14 29dc4: 96 01 movw r18, r12 29dc6: 69 e2 ldi r22, 0x29 ; 41 29dc8: 87 ed ldi r24, 0xD7 ; 215 29dca: 95 e1 ldi r25, 0x15 ; 21 29dcc: 0f 94 b5 70 call 0x2e16a ; 0x2e16a while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) { 29dd0: 80 93 d9 15 sts 0x15D9, r24 ; 0x8015d9 29dd4: 88 23 and r24, r24 29dd6: b1 f0 breq .+44 ; 0x29e04 // check for timeout if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 29dd8: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 29ddc: 6c 1b sub r22, r28 29dde: 7d 0b sbc r23, r29 29de0: 61 3d cpi r22, 0xD1 ; 209 29de2: 77 40 sbci r23, 0x07 ; 7 29de4: 30 f3 brcs .-52 ; 0x29db2 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 29de6: 8a e0 ldi r24, 0x0A ; 10 29de8: 8b cf rjmp .-234 ; 0x29d00 goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 29dea: 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(); 29dec: 0f 94 ae 70 call 0x2e15c ; 0x2e15c 29df0: 80 93 d9 15 sts 0x15D9, r24 ; 0x8015d9 29df4: 11 50 subi r17, 0x01 ; 1 29df6: d1 f7 brne .-12 ; 0x29dec if (status_ != 0XAA) { 29df8: 8a 3a cpi r24, 0xAA ; 170 29dfa: 11 f0 breq .+4 ; 0x29e00 29dfc: 82 e0 ldi r24, 0x02 ; 2 29dfe: 80 cf rjmp .-256 ; 0x29d00 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;} 29e00: 82 e0 ldi r24, 0x02 ; 2 29e02: c9 cf rjmp .-110 ; 0x29d96 error(SD_CARD_ERROR_ACMD41); goto fail; } } // if SD2 read OCR register to check for SDHC card if (type() == SD_CARD_TYPE_SD2) { 29e04: 80 91 da 15 lds r24, 0x15DA ; 0x8015da 29e08: 82 30 cpi r24, 0x02 ; 2 29e0a: d1 f4 brne .+52 ; 0x29e40 if (cardCommand(CMD58, 0)) { 29e0c: 20 e0 ldi r18, 0x00 ; 0 29e0e: 30 e0 ldi r19, 0x00 ; 0 29e10: a9 01 movw r20, r18 29e12: 6a e3 ldi r22, 0x3A ; 58 29e14: 87 ed ldi r24, 0xD7 ; 215 29e16: 95 e1 ldi r25, 0x15 ; 21 29e18: 0f 94 b5 70 call 0x2e16a ; 0x2e16a 29e1c: 88 23 and r24, r24 29e1e: 11 f0 breq .+4 ; 0x29e24 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 29e20: 88 e0 ldi r24, 0x08 ; 8 29e22: 6e cf rjmp .-292 ; 0x29d00 error(SD_CARD_ERROR_CMD58); goto fail; } if ((spiRec() & 0XC0) == 0XC0) type(SD_CARD_TYPE_SDHC); 29e24: 0f 94 ae 70 call 0x2e15c ; 0x2e15c 29e28: 80 7c andi r24, 0xC0 ; 192 29e2a: 80 3c cpi r24, 0xC0 ; 192 29e2c: 19 f4 brne .+6 ; 0x29e34 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;} 29e2e: 83 e0 ldi r24, 0x03 ; 3 29e30: 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(); 29e34: 0f 94 ae 70 call 0x2e15c ; 0x2e15c 29e38: 0f 94 ae 70 call 0x2e15c ; 0x2e15c 29e3c: 0f 94 ae 70 call 0x2e15c ; 0x2e15c } chipSelectHigh(); 29e40: 0f 94 7f 42 call 0x284fe ; 0x284fe bool Sd2Card::setSckRate(uint8_t sckRateID) { if (sckRateID > 6) { error(SD_CARD_ERROR_SCK_RATE); return false; } spiRate_ = sckRateID; 29e44: 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);} 29e48: 81 e0 ldi r24, 0x01 ; 1 29e4a: 0f 94 1c 3e call 0x27c38 ; 0x27c38 29e4e: 81 11 cpse r24, r1 29e50: 0c c0 rjmp .+24 ; 0x29e6a 29e52: 80 e0 ldi r24, 0x00 ; 0 29e54: 0f 94 1c 3e call 0x27c38 ; 0x27c38 #endif { SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL } else if (!volume.init(&card)) 29e58: 81 11 cpse r24, r1 29e5a: 07 c0 rjmp .+14 ; 0x29e6a { SERIAL_ERROR_START; 29e5c: 84 e4 ldi r24, 0x44 ; 68 29e5e: 9d e9 ldi r25, 0x9D ; 157 29e60: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ERRORLNRPGM(_n("volume.init failed"));////MSG_SD_VOL_INIT_FAIL 29e64: 8b e9 ldi r24, 0x9B ; 155 29e66: 9b e6 ldi r25, 0x6B ; 107 29e68: 78 cf rjmp .-272 ; 0x29d5a } else if (!root.openRoot(&volume)) 29e6a: 6c ed ldi r22, 0xDC ; 220 29e6c: 75 e1 ldi r23, 0x15 ; 21 29e6e: 80 ef ldi r24, 0xF0 ; 240 29e70: 93 e1 ldi r25, 0x13 ; 19 29e72: 0f 94 01 6f call 0x2de02 ; 0x2de02 29e76: 81 11 cpse r24, r1 29e78: 07 c0 rjmp .+14 ; 0x29e88 { SERIAL_ERROR_START; 29e7a: 84 e4 ldi r24, 0x44 ; 68 29e7c: 9d e9 ldi r25, 0x9D ; 157 29e7e: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ERRORLNRPGM(_n("openRoot failed"));////MSG_SD_OPENROOT_FAIL 29e82: 8b e8 ldi r24, 0x8B ; 139 29e84: 9b e6 ldi r25, 0x6B ; 107 29e86: 69 cf rjmp .-302 ; 0x29d5a } else { mounted = true; 29e88: 81 e0 ldi r24, 0x01 ; 1 29e8a: 80 93 6b 13 sts 0x136B, r24 ; 0x80136b SERIAL_ECHO_START; 29e8e: 81 e6 ldi r24, 0x61 ; 97 29e90: 9d e9 ldi r25, 0x9D ; 157 29e92: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 29e96: 80 e8 ldi r24, 0x80 ; 128 29e98: 9b e6 ldi r25, 0x6B ; 107 29e9a: 5f cf rjmp .-322 ; 0x29d5a if (mounted) { cdroot(doPresort); } } 29e9c: df 91 pop r29 29e9e: cf 91 pop r28 29ea0: 1f 91 pop r17 29ea2: 0f 91 pop r16 29ea4: ff 90 pop r15 29ea6: ef 90 pop r14 29ea8: df 90 pop r13 29eaa: cf 90 pop r12 29eac: 08 95 ret 00029eae : ms = 0; } } } static void wait_for_heater(long codenum, uint8_t extruder) { 29eae: 4f 92 push r4 29eb0: 5f 92 push r5 29eb2: 6f 92 push r6 29eb4: 7f 92 push r7 29eb6: 8f 92 push r8 29eb8: 9f 92 push r9 29eba: af 92 push r10 29ebc: bf 92 push r11 29ebe: cf 92 push r12 29ec0: df 92 push r13 29ec2: ef 92 push r14 29ec4: ff 92 push r15 29ec6: 4b 01 movw r8, r22 29ec8: 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]; 29eca: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 29ece: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 29ed2: 07 2e mov r0, r23 29ed4: 00 0c add r0, r0 29ed6: 88 0b sbc r24, r24 29ed8: 99 0b sbc r25, r25 29eda: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> if (!degTargetHotend(extruder)) 29ede: 20 e0 ldi r18, 0x00 ; 0 29ee0: 30 e0 ldi r19, 0x00 ; 0 29ee2: a9 01 movw r20, r18 29ee4: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 29ee8: 88 23 and r24, r24 29eea: d1 f0 breq .+52 ; 0x29f20 #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; 29eec: 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; 29ef0: cc 24 eor r12, r12 29ef2: ca 94 dec r12 29ef4: dc 2c mov r13, r12 29ef6: 76 01 movw r14, r12 #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); if (residencyStart > -1) { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 29ef8: 98 ee ldi r25, 0xE8 ; 232 29efa: 49 2e mov r4, r25 29efc: 93 e0 ldi r25, 0x03 ; 3 29efe: 59 2e mov r5, r25 29f00: 61 2c mov r6, r1 29f02: 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) || 29f04: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 <_ZL13cancel_heatup.lto_priv.377> 29f08: 81 11 cpse r24, r1 29f0a: 0a c0 rjmp .+20 ; 0x29f20 29f0c: 2f ef ldi r18, 0xFF ; 255 29f0e: c2 16 cp r12, r18 29f10: d2 06 cpc r13, r18 29f12: e2 06 cpc r14, r18 29f14: f2 06 cpc r15, r18 29f16: 89 f4 brne .+34 ; 0x29f3a (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) { 29f18: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 29f1c: 82 30 cpi r24, 0x02 ; 2 29f1e: b9 f4 brne .+46 ; 0x29f4e { residencyStart = _millis(); } #endif //TEMP_RESIDENCY_TIME } } 29f20: ff 90 pop r15 29f22: ef 90 pop r14 29f24: df 90 pop r13 29f26: cf 90 pop r12 29f28: bf 90 pop r11 29f2a: af 90 pop r10 29f2c: 9f 90 pop r9 29f2e: 8f 90 pop r8 29f30: 7f 90 pop r7 29f32: 6f 90 pop r6 29f34: 5f 90 pop r5 29f36: 4f 90 pop r4 29f38: 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) || 29f3a: f7 fc sbrc r15, 7 29f3c: f1 cf rjmp .-30 ; 0x29f20 (residencyStart >= 0 && (((unsigned int)(_millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL))))) { 29f3e: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 29f42: 6c 19 sub r22, r12 29f44: 7d 09 sbc r23, r13 29f46: 68 3b cpi r22, 0xB8 ; 184 29f48: 7b 40 sbci r23, 0x0B ; 11 29f4a: 30 f3 brcs .-52 ; 0x29f18 29f4c: e9 cf rjmp .-46 ; 0x29f20 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) 29f4e: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 29f52: 68 19 sub r22, r8 29f54: 79 09 sbc r23, r9 29f56: 8a 09 sbc r24, r10 29f58: 9b 09 sbc r25, r11 29f5a: 69 3e cpi r22, 0xE9 ; 233 29f5c: 73 40 sbci r23, 0x03 ; 3 29f5e: 81 05 cpc r24, r1 29f60: 91 05 cpc r25, r1 29f62: 08 f4 brcc .+2 ; 0x29f66 29f64: 42 c0 rjmp .+132 ; 0x29fea { //Print Temp Reading and remaining time every 1 second while heating up/cooling down if (!farm_mode) { 29f66: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 29f6a: 81 11 cpse r24, r1 29f6c: 3a c0 rjmp .+116 ; 0x29fe2 SERIAL_PROTOCOLPGM("T:"); 29f6e: 8e ed ldi r24, 0xDE ; 222 29f70: 9b e9 ldi r25, 0x9B ; 155 29f72: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 29f76: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 29f7a: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 29f7e: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 29f82: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 29f86: 41 e0 ldi r20, 0x01 ; 1 29f88: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_PROTOCOL_F(degHotend(extruder), 1); SERIAL_PROTOCOLPGM(" E:"); 29f8c: 8a ed ldi r24, 0xDA ; 218 29f8e: 9b e9 ldi r25, 0x9B ; 155 29f90: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 29f94: 60 e0 ldi r22, 0x00 ; 0 29f96: 70 e0 ldi r23, 0x00 ; 0 29f98: cb 01 movw r24, r22 29f9a: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_PROTOCOL((int)extruder); #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); 29f9e: 86 ed ldi r24, 0xD6 ; 214 29fa0: 9b e9 ldi r25, 0x9B ; 155 29fa2: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 if (residencyStart > -1) 29fa6: f7 fc sbrc r15, 7 29fa8: 52 c0 rjmp .+164 ; 0x2a04e { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 29faa: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 29fae: 46 01 movw r8, r12 29fb0: 57 01 movw r10, r14 29fb2: 58 eb ldi r21, 0xB8 ; 184 29fb4: 85 0e add r8, r21 29fb6: 5b e0 ldi r21, 0x0B ; 11 29fb8: 95 1e adc r9, r21 29fba: a1 1c adc r10, r1 29fbc: b1 1c adc r11, r1 29fbe: a5 01 movw r20, r10 29fc0: 94 01 movw r18, r8 29fc2: 26 1b sub r18, r22 29fc4: 37 0b sbc r19, r23 29fc6: 48 0b sbc r20, r24 29fc8: 59 0b sbc r21, r25 29fca: ca 01 movw r24, r20 29fcc: b9 01 movw r22, r18 29fce: a3 01 movw r20, r6 29fd0: 92 01 movw r18, r4 29fd2: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> 29fd6: ca 01 movw r24, r20 29fd8: b9 01 movw r22, r18 29fda: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 29fde: 0f 94 bb 98 call 0x33176 ; 0x33176 } } #else SERIAL_PROTOCOLLN(); #endif codenum = _millis(); 29fe2: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 29fe6: 4b 01 movw r8, r22 29fe8: 5c 01 movw r10, r24 } delay_keep_alive(0); //do not disable steppers 29fea: 90 e0 ldi r25, 0x00 ; 0 29fec: 80 e0 ldi r24, 0x00 ; 0 29fee: 0e 94 45 7c call 0xf88a ; 0xf88a #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))) || 29ff2: 3f ef ldi r19, 0xFF ; 255 29ff4: c3 16 cp r12, r19 29ff6: d3 06 cpc r13, r19 29ff8: e3 06 cpc r14, r19 29ffa: f3 06 cpc r15, r19 29ffc: 09 f0 breq .+2 ; 0x2a000 29ffe: 46 c0 rjmp .+140 ; 0x2a08c } 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))) || 2a000: 80 91 c3 0d lds r24, 0x0DC3 ; 0x800dc3 <_ZL16target_direction.lto_priv.494> 2a004: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 2a008: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 2a00c: 88 23 and r24, r24 2a00e: 19 f1 breq .+70 ; 0x2a056 2a010: 07 2e mov r0, r23 2a012: 00 0c add r0, r0 2a014: 88 0b sbc r24, r24 2a016: 99 0b sbc r25, r25 2a018: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2a01c: 20 e0 ldi r18, 0x00 ; 0 2a01e: 30 e0 ldi r19, 0x00 ; 0 2a020: 40 e8 ldi r20, 0x80 ; 128 2a022: 5f e3 ldi r21, 0x3F ; 63 2a024: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 2a028: 9b 01 movw r18, r22 2a02a: ac 01 movw r20, r24 2a02c: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 2a030: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 2a034: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 2a038: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 2a03c: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 2a040: 87 fd sbrc r24, 7 2a042: 60 cf rjmp .-320 ; 0x29f04 (residencyStart == -1 && !target_direction && (degHotend(extruder) <= (degTargetHotend(extruder) + TEMP_WINDOW))) || (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) { residencyStart = _millis(); 2a044: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 2a048: 6b 01 movw r12, r22 2a04a: 7c 01 movw r14, r24 2a04c: 5b cf rjmp .-330 ; 0x29f04 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2a04e: 8f e3 ldi r24, 0x3F ; 63 2a050: 0e 94 37 70 call 0xe06e ; 0xe06e 2a054: c4 cf rjmp .-120 ; 0x29fde 2a056: 07 2e mov r0, r23 2a058: 00 0c add r0, r0 2a05a: 88 0b sbc r24, r24 2a05c: 99 0b sbc r25, r25 2a05e: 0f 94 29 9b call 0x33652 ; 0x33652 <__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))) || 2a062: 20 e0 ldi r18, 0x00 ; 0 2a064: 30 e0 ldi r19, 0x00 ; 0 2a066: 40 e8 ldi r20, 0x80 ; 128 2a068: 5f e3 ldi r21, 0x3F ; 63 2a06a: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2a06e: 9b 01 movw r18, r22 2a070: ac 01 movw r20, r24 2a072: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 2a076: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 2a07a: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 2a07e: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 2a082: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 2a086: 18 16 cp r1, r24 2a088: ec f6 brge .-70 ; 0x2a044 2a08a: 3c cf rjmp .-392 ; 0x29f04 2a08c: f7 fc sbrc r15, 7 2a08e: 3a cf rjmp .-396 ; 0x29f04 2a090: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 2a094: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 2a098: 07 2e mov r0, r23 2a09a: 00 0c add r0, r0 2a09c: 88 0b sbc r24, r24 2a09e: 99 0b sbc r25, r25 2a0a0: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2a0a4: 9b 01 movw r18, r22 2a0a6: ac 01 movw r20, r24 (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) 2a0a8: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 2a0ac: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 2a0b0: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 2a0b4: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 2a0b8: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 2a0bc: 9f 77 andi r25, 0x7F ; 127 2a0be: 20 e0 ldi r18, 0x00 ; 0 2a0c0: 30 e0 ldi r19, 0x00 ; 0 2a0c2: 40 ea ldi r20, 0xA0 ; 160 2a0c4: 50 e4 ldi r21, 0x40 ; 64 2a0c6: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 2a0ca: 18 16 cp r1, r24 2a0cc: 0c f0 brlt .+2 ; 0x2a0d0 2a0ce: 1a cf rjmp .-460 ; 0x29f04 2a0d0: b9 cf rjmp .-142 ; 0x2a044 0002a0d2 : // 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) { 2a0d2: 1f 93 push r17 2a0d4: cf 93 push r28 2a0d6: df 93 push r29 2a0d8: ec 01 movw r28, r24 2a0da: 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()) { 2a0dc: 80 91 67 12 lds r24, 0x1267 ; 0x801267 2a0e0: 83 30 cpi r24, 0x03 ; 3 2a0e2: 09 f4 brne .+2 ; 0x2a0e6 2a0e4: 4e c0 rjmp .+156 ; 0x2a182 2a0e6: 8c 31 cpi r24, 0x1C ; 28 2a0e8: 09 f4 brne .+2 ; 0x2a0ec 2a0ea: 52 c0 rjmp .+164 ; 0x2a190 break; default: break; } if (ec != lastErrorCode) { // deduplicate: only report changes in error codes into the log 2a0ec: 80 91 8c 12 lds r24, 0x128C ; 0x80128c 2a0f0: 90 91 8d 12 lds r25, 0x128D ; 0x80128d 2a0f4: 8c 17 cp r24, r28 2a0f6: 9d 07 cpc r25, r29 2a0f8: 79 f1 breq .+94 ; 0x2a158 lastErrorCode = ec; 2a0fa: d0 93 8d 12 sts 0x128D, r29 ; 0x80128d 2a0fe: c0 93 8c 12 sts 0x128C, r28 ; 0x80128c lastErrorSource = res; 2a102: 10 93 8e 12 sts 0x128E, r17 ; 0x80128e LogErrorEvent_P(_O(PrusaErrorTitle(PrusaErrorCodeIndex(ec)))); 2a106: ce 01 movw r24, r28 2a108: 0f 94 f7 87 call 0x30fee ; 0x30fee 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); 2a10c: e8 2f mov r30, r24 2a10e: f0 e0 ldi r31, 0x00 ; 0 2a110: ee 0f add r30, r30 2a112: ff 1f adc r31, r31 2a114: e9 50 subi r30, 0x09 ; 9 2a116: f5 46 sbci r31, 0x65 ; 101 2a118: 85 91 lpm r24, Z+ 2a11a: 94 91 lpm r25, Z 2a11c: 02 96 adiw r24, 0x02 ; 2 2a11e: 0f 94 e5 87 call 0x30fca ; 0x30fca if (ec != ErrorCode::OK && ec != ErrorCode::FILAMENT_EJECTED && ec != ErrorCode::FILAMENT_CHANGE) { 2a122: c1 30 cpi r28, 0x01 ; 1 2a124: d1 05 cpc r29, r1 2a126: c1 f0 breq .+48 ; 0x2a158 2a128: cc 30 cpi r28, 0x0C ; 12 2a12a: 80 e8 ldi r24, 0x80 ; 128 2a12c: d8 07 cpc r29, r24 2a12e: a1 f0 breq .+40 ; 0x2a158 2a130: c9 32 cpi r28, 0x29 ; 41 2a132: 80 e8 ldi r24, 0x80 ; 128 2a134: d8 07 cpc r29, r24 2a136: 81 f0 breq .+32 ; 0x2a158 IncrementMMUFails(); 2a138: 0f 94 16 87 call 0x30e2c ; 0x30e2c | (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 2a13c: ce 01 movw r24, r28 2a13e: 88 27 eor r24, r24 2a140: 9e 77 andi r25, 0x7E ; 126 2a142: 89 2b or r24, r25 2a144: 49 f0 breq .+18 ; 0x2a158 /// Set toolchange counter to zero inline void ClearToolChangeCounter() { toolchange_counter = 0; }; inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } 2a146: 80 91 9a 12 lds r24, 0x129A ; 0x80129a 2a14a: 90 91 9b 12 lds r25, 0x129B ; 0x80129b 2a14e: 01 96 adiw r24, 0x01 ; 1 2a150: 90 93 9b 12 sts 0x129B, r25 ; 0x80129b 2a154: 80 93 9a 12 sts 0x129A, r24 ; 0x80129a return true; } } bool MMU2::RetryIfPossible(ErrorCode ec) { if (logic.RetryAttempts()) { 2a158: 80 91 79 12 lds r24, 0x1279 ; 0x801279 2a15c: 88 23 and r24, r24 2a15e: d9 f0 breq .+54 ; 0x2a196 return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 2a160: 11 e0 ldi r17, 0x01 ; 1 2a162: 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) { 2a166: ce 01 movw r24, r28 2a168: 0f 94 82 8a call 0x31504 ; 0x31504 2a16c: 8f 3f cpi r24, 0xFF ; 255 2a16e: 99 f0 breq .+38 ; 0x2a196 void ResetCommunicationTimeoutAttempts(); constexpr bool InAutoRetry() const { return inAutoRetry; } void SetInAutoRetry(bool iar) { inAutoRetry = iar; 2a170: 10 93 7a 12 sts 0x127A, r17 ; 0x80127a logic.SetInAutoRetry(true); SERIAL_ECHOLNPGM("RetryButtonPressed"); 2a174: 84 ee ldi r24, 0xE4 ; 228 2a176: 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"); } 2a178: df 91 pop r29 2a17a: cf 91 pop r28 2a17c: 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"); 2a17e: 0c 94 49 72 jmp 0xe492 ; 0xe492 // 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; 2a182: 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(); 2a186: 0f 94 a9 86 call 0x30d52 ; 0x30d52 // 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; 2a18a: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac 2a18e: ae cf rjmp .-164 ; 0x2a0ec 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; 2a190: 10 92 96 12 sts 0x1296, r1 ; 0x801296 2a194: f8 cf rjmp .-16 ; 0x2a186 2a196: 10 92 7a 12 sts 0x127A, r1 ; 0x80127a bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 2a19a: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.458> 2a19e: 81 11 cpse r24, r1 2a1a0: 06 c0 rjmp .+12 ; 0x2a1ae 2a1a2: 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"); } 2a1a4: df 91 pop r29 2a1a6: cf 91 pop r28 2a1a8: 1f 91 pop r17 2a1aa: 0d 94 48 89 jmp 0x31290 ; 0x31290 2a1ae: df 91 pop r29 2a1b0: cf 91 pop r28 2a1b2: 1f 91 pop r17 2a1b4: 08 95 ret 0002a1b6 : * \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) { 2a1b6: 2f 92 push r2 2a1b8: 3f 92 push r3 2a1ba: 4f 92 push r4 2a1bc: 5f 92 push r5 2a1be: 6f 92 push r6 2a1c0: 7f 92 push r7 2a1c2: 8f 92 push r8 2a1c4: 9f 92 push r9 2a1c6: af 92 push r10 2a1c8: bf 92 push r11 2a1ca: cf 92 push r12 2a1cc: df 92 push r13 2a1ce: ef 92 push r14 2a1d0: ff 92 push r15 2a1d2: 0f 93 push r16 2a1d4: 1f 93 push r17 2a1d6: cf 93 push r28 2a1d8: df 93 push r29 2a1da: 00 d0 rcall .+0 ; 0x2a1dc 2a1dc: 1f 92 push r1 2a1de: cd b7 in r28, 0x3d ; 61 2a1e0: de b7 in r29, 0x3e ; 62 2a1e2: 5c 01 movw r10, r24 2a1e4: 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; 2a1e6: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 2a1ea: 81 30 cpi r24, 0x01 ; 1 2a1ec: 09 f0 breq .+2 ; 0x2a1f0 2a1ee: de c0 rjmp .+444 ; 0x2a3ac 2a1f0: 80 91 fb 15 lds r24, 0x15FB ; 0x8015fb 2a1f4: 81 ff sbrs r24, 1 2a1f6: da c0 rjmp .+436 ; 0x2a3ac // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { 2a1f8: 82 fd sbrc r24, 2 2a1fa: bc c0 rjmp .+376 ; 0x2a374 * \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) { 2a1fc: 74 01 movw r14, r8 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 2a1fe: 21 2c mov r2, r1 2a200: 32 e0 ldi r19, 0x02 ; 2 2a202: 33 2e mov r3, r19 2a204: 00 91 02 16 lds r16, 0x1602 ; 0x801602 2a208: 10 91 03 16 lds r17, 0x1603 ; 0x801603 2a20c: 20 91 04 16 lds r18, 0x1604 ; 0x801604 2a210: 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) { 2a214: e1 14 cp r14, r1 2a216: f1 04 cpc r15, r1 2a218: 09 f4 brne .+2 ; 0x2a21c 2a21a: 30 c1 rjmp .+608 ; 0x2a47c uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); 2a21c: 80 91 13 16 lds r24, 0x1613 ; 0x801613 2a220: 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);} 2a224: dc 01 movw r26, r24 2a226: 14 96 adiw r26, 0x04 ; 4 2a228: 7c 90 ld r7, X 2a22a: 7a 94 dec r7 2a22c: b9 01 movw r22, r18 2a22e: a8 01 movw r20, r16 2a230: 29 e0 ldi r18, 0x09 ; 9 2a232: 76 95 lsr r23 2a234: 67 95 ror r22 2a236: 57 95 ror r21 2a238: 47 95 ror r20 2a23a: 2a 95 dec r18 2a23c: d1 f7 brne .-12 ; 0x2a232 2a23e: 74 22 and r7, r20 uint16_t blockOffset = curPosition_ & 0X1FF; 2a240: 11 70 andi r17, 0x01 ; 1 if (blockOfCluster == 0 && blockOffset == 0) { 2a242: 71 10 cpse r7, r1 2a244: 25 c0 rjmp .+74 ; 0x2a290 2a246: 01 15 cp r16, r1 2a248: 11 05 cpc r17, r1 2a24a: 11 f5 brne .+68 ; 0x2a290 2a24c: 40 91 fe 15 lds r20, 0x15FE ; 0x8015fe 2a250: 50 91 ff 15 lds r21, 0x15FF ; 0x8015ff 2a254: 60 91 00 16 lds r22, 0x1600 ; 0x801600 2a258: 70 91 01 16 lds r23, 0x1601 ; 0x801601 // start of new cluster if (curCluster_ == 0) { 2a25c: 41 15 cp r20, r1 2a25e: 51 05 cpc r21, r1 2a260: 61 05 cpc r22, r1 2a262: 71 05 cpc r23, r1 2a264: 09 f0 breq .+2 ; 0x2a268 2a266: a8 c0 rjmp .+336 ; 0x2a3b8 if (firstCluster_ == 0) { 2a268: 80 91 0f 16 lds r24, 0x160F ; 0x80160f 2a26c: 90 91 10 16 lds r25, 0x1610 ; 0x801610 2a270: a0 91 11 16 lds r26, 0x1611 ; 0x801611 2a274: b0 91 12 16 lds r27, 0x1612 ; 0x801612 2a278: 00 97 sbiw r24, 0x00 ; 0 2a27a: a1 05 cpc r26, r1 2a27c: b1 05 cpc r27, r1 2a27e: 09 f0 breq .+2 ; 0x2a282 2a280: b4 c0 rjmp .+360 ; 0x2a3ea } 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; 2a282: 8a ef ldi r24, 0xFA ; 250 2a284: 95 e1 ldi r25, 0x15 ; 21 2a286: 0f 94 ae 6f call 0x2df5c ; 0x2df5c 2a28a: 88 23 and r24, r24 2a28c: 09 f4 brne .+2 ; 0x2a290 2a28e: 8e c0 rjmp .+284 ; 0x2a3ac curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 2a290: c1 01 movw r24, r2 2a292: 80 1b sub r24, r16 2a294: 91 0b sbc r25, r17 2a296: 67 01 movw r12, r14 2a298: 8e 15 cp r24, r14 2a29a: 9f 05 cpc r25, r15 2a29c: 08 f4 brcc .+2 ; 0x2a2a0 2a29e: 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; 2a2a0: e0 91 13 16 lds r30, 0x1613 ; 0x801613 2a2a4: f0 91 14 16 lds r31, 0x1614 ; 0x801614 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2a2a8: 80 91 fe 15 lds r24, 0x15FE ; 0x8015fe 2a2ac: 90 91 ff 15 lds r25, 0x15FF ; 0x8015ff 2a2b0: a0 91 00 16 lds r26, 0x1600 ; 0x801600 2a2b4: b0 91 01 16 lds r27, 0x1601 ; 0x801601 2a2b8: 02 97 sbiw r24, 0x02 ; 2 2a2ba: a1 09 sbc r26, r1 2a2bc: b1 09 sbc r27, r1 2a2be: 25 85 ldd r18, Z+13 ; 0x0d 2a2c0: 04 c0 rjmp .+8 ; 0x2a2ca 2a2c2: 88 0f add r24, r24 2a2c4: 99 1f adc r25, r25 2a2c6: aa 1f adc r26, r26 2a2c8: bb 1f adc r27, r27 2a2ca: 2a 95 dec r18 2a2cc: d2 f7 brpl .-12 ; 0x2a2c2 2a2ce: 46 85 ldd r20, Z+14 ; 0x0e 2a2d0: 57 85 ldd r21, Z+15 ; 0x0f 2a2d2: 60 89 ldd r22, Z+16 ; 0x10 2a2d4: 71 89 ldd r23, Z+17 ; 0x11 2a2d6: 84 0f add r24, r20 2a2d8: 95 1f adc r25, r21 2a2da: a6 1f adc r26, r22 2a2dc: b7 1f adc r27, r23 2a2de: 9c 01 movw r18, r24 2a2e0: ad 01 movw r20, r26 2a2e2: 27 0d add r18, r7 2a2e4: 31 1d adc r19, r1 2a2e6: 41 1d adc r20, r1 2a2e8: 51 1d adc r21, r1 2a2ea: 29 01 movw r4, r18 2a2ec: 3a 01 movw r6, r20 if (n == 512) { 2a2ee: c1 14 cp r12, r1 2a2f0: 32 e0 ldi r19, 0x02 ; 2 2a2f2: d3 06 cpc r13, r19 2a2f4: 09 f0 breq .+2 ; 0x2a2f8 2a2f6: 8a c0 rjmp .+276 ; 0x2a40c // full block - don't need to use cache if (vol_->cacheBlockNumber() == block) { 2a2f8: 80 91 cd 0d lds r24, 0x0DCD ; 0x800dcd 2a2fc: 90 91 ce 0d lds r25, 0x0DCE ; 0x800dce 2a300: a0 91 cf 0d lds r26, 0x0DCF ; 0x800dcf 2a304: b0 91 d0 0d lds r27, 0x0DD0 ; 0x800dd0 2a308: 48 16 cp r4, r24 2a30a: 59 06 cpc r5, r25 2a30c: 6a 06 cpc r6, r26 2a30e: 7b 06 cpc r7, r27 2a310: 69 f4 brne .+26 ; 0x2a32c 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; 2a312: 10 92 d5 0d sts 0x0DD5, r1 ; 0x800dd5 cacheBlockNumber_ = blockNumber; 2a316: 8f ef ldi r24, 0xFF ; 255 2a318: 9f ef ldi r25, 0xFF ; 255 2a31a: dc 01 movw r26, r24 2a31c: 80 93 cd 0d sts 0x0DCD, r24 ; 0x800dcd 2a320: 90 93 ce 0d sts 0x0DCE, r25 ; 0x800dce 2a324: a0 93 cf 0d sts 0x0DCF, r26 ; 0x800dcf 2a328: 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); 2a32c: 95 01 movw r18, r10 2a32e: b3 01 movw r22, r6 2a330: a2 01 movw r20, r4 2a332: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 2a336: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 2a33a: 0f 94 0e 71 call 0x2e21c ; 0x2e21c // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; 2a33e: 88 23 and r24, r24 2a340: a9 f1 breq .+106 ; 0x2a3ac if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto fail; } uint8_t* dst = vol_->cache()->data + blockOffset; memcpy(dst, src, n); } curPosition_ += n; 2a342: 80 91 02 16 lds r24, 0x1602 ; 0x801602 2a346: 90 91 03 16 lds r25, 0x1603 ; 0x801603 2a34a: a0 91 04 16 lds r26, 0x1604 ; 0x801604 2a34e: b0 91 05 16 lds r27, 0x1605 ; 0x801605 2a352: 8c 0d add r24, r12 2a354: 9d 1d adc r25, r13 2a356: a1 1d adc r26, r1 2a358: b1 1d adc r27, r1 2a35a: 80 93 02 16 sts 0x1602, r24 ; 0x801602 2a35e: 90 93 03 16 sts 0x1603, r25 ; 0x801603 2a362: a0 93 04 16 sts 0x1604, r26 ; 0x801604 2a366: b0 93 05 16 sts 0x1605, r27 ; 0x801605 src += n; 2a36a: ac 0c add r10, r12 2a36c: bd 1c adc r11, r13 nToWrite -= n; 2a36e: ec 18 sub r14, r12 2a370: fd 08 sbc r15, r13 2a372: 48 cf rjmp .-368 ; 0x2a204 // 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_) { 2a374: 40 91 0b 16 lds r20, 0x160B ; 0x80160b 2a378: 50 91 0c 16 lds r21, 0x160C ; 0x80160c 2a37c: 60 91 0d 16 lds r22, 0x160D ; 0x80160d 2a380: 70 91 0e 16 lds r23, 0x160E ; 0x80160e 2a384: 80 91 02 16 lds r24, 0x1602 ; 0x801602 2a388: 90 91 03 16 lds r25, 0x1603 ; 0x801603 2a38c: a0 91 04 16 lds r26, 0x1604 ; 0x801604 2a390: b0 91 05 16 lds r27, 0x1605 ; 0x801605 2a394: 48 17 cp r20, r24 2a396: 59 07 cpc r21, r25 2a398: 6a 07 cpc r22, r26 2a39a: 7b 07 cpc r23, r27 2a39c: 09 f4 brne .+2 ; 0x2a3a0 2a39e: 2e cf rjmp .-420 ; 0x2a1fc } /** 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);} 2a3a0: 8a ef ldi r24, 0xFA ; 250 2a3a2: 95 e1 ldi r25, 0x15 ; 21 2a3a4: 0f 94 f7 39 call 0x273ee ; 0x273ee if (!seekEnd()) goto fail; 2a3a8: 81 11 cpse r24, r1 2a3aa: 28 cf rjmp .-432 ; 0x2a1fc } return nbyte; fail: // return for write error writeError = true; 2a3ac: 81 e0 ldi r24, 0x01 ; 1 2a3ae: 80 93 fa 15 sts 0x15FA, r24 ; 0x8015fa return -1; 2a3b2: 8f ef ldi r24, 0xFF ; 255 2a3b4: 9f ef ldi r25, 0xFF ; 255 2a3b6: 81 c0 rjmp .+258 ; 0x2a4ba } else { curCluster_ = firstCluster_; } } else { uint32_t next; if (!vol_->fatGet(curCluster_, &next)) goto fail; 2a3b8: 9e 01 movw r18, r28 2a3ba: 2f 5f subi r18, 0xFF ; 255 2a3bc: 3f 4f sbci r19, 0xFF ; 255 2a3be: 0f 94 f4 37 call 0x26fe8 ; 0x26fe8 2a3c2: 88 23 and r24, r24 2a3c4: 99 f3 breq .-26 ; 0x2a3ac if (vol_->isEOC(next)) { 2a3c6: 89 81 ldd r24, Y+1 ; 0x01 2a3c8: 9a 81 ldd r25, Y+2 ; 0x02 2a3ca: ab 81 ldd r26, Y+3 ; 0x03 2a3cc: 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; 2a3ce: e0 91 13 16 lds r30, 0x1613 ; 0x801613 2a3d2: f0 91 14 16 lds r31, 0x1614 ; 0x801614 2a3d6: 27 89 ldd r18, Z+23 ; 0x17 2a3d8: 20 31 cpi r18, 0x10 ; 16 2a3da: 81 f4 brne .+32 ; 0x2a3fc 2a3dc: 88 3f cpi r24, 0xF8 ; 248 2a3de: ef ef ldi r30, 0xFF ; 255 2a3e0: 9e 07 cpc r25, r30 2a3e2: a1 05 cpc r26, r1 2a3e4: b1 05 cpc r27, r1 2a3e6: 08 f0 brcs .+2 ; 0x2a3ea 2a3e8: 4c cf rjmp .-360 ; 0x2a282 // add cluster if at end of chain if (!addCluster()) goto fail; } else { curCluster_ = next; 2a3ea: 80 93 fe 15 sts 0x15FE, r24 ; 0x8015fe 2a3ee: 90 93 ff 15 sts 0x15FF, r25 ; 0x8015ff 2a3f2: a0 93 00 16 sts 0x1600, r26 ; 0x801600 2a3f6: b0 93 01 16 sts 0x1601, r27 ; 0x801601 2a3fa: 4a cf rjmp .-364 ; 0x2a290 return cluster >= FAT32EOC_MIN; 2a3fc: 88 3f cpi r24, 0xF8 ; 248 2a3fe: ff ef ldi r31, 0xFF ; 255 2a400: 9f 07 cpc r25, r31 2a402: af 07 cpc r26, r31 2a404: ff e0 ldi r31, 0x0F ; 15 2a406: bf 07 cpc r27, r31 2a408: 80 f3 brcs .-32 ; 0x2a3ea 2a40a: 3b cf rjmp .-394 ; 0x2a282 // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; } else { if (blockOffset == 0 && curPosition_ >= fileSize_) { 2a40c: 01 15 cp r16, r1 2a40e: 11 05 cpc r17, r1 2a410: 69 f5 brne .+90 ; 0x2a46c 2a412: 40 91 02 16 lds r20, 0x1602 ; 0x801602 2a416: 50 91 03 16 lds r21, 0x1603 ; 0x801603 2a41a: 60 91 04 16 lds r22, 0x1604 ; 0x801604 2a41e: 70 91 05 16 lds r23, 0x1605 ; 0x801605 2a422: 80 91 0b 16 lds r24, 0x160B ; 0x80160b 2a426: 90 91 0c 16 lds r25, 0x160C ; 0x80160c 2a42a: a0 91 0d 16 lds r26, 0x160D ; 0x80160d 2a42e: b0 91 0e 16 lds r27, 0x160E ; 0x80160e 2a432: 48 17 cp r20, r24 2a434: 59 07 cpc r21, r25 2a436: 6a 07 cpc r22, r26 2a438: 7b 07 cpc r23, r27 2a43a: c0 f0 brcs .+48 ; 0x2a46c // start of new block don't need to read into cache if (!vol_->cacheFlush()) goto fail; 2a43c: 0f 94 e6 36 call 0x26dcc ; 0x26dcc 2a440: 88 23 and r24, r24 2a442: 09 f4 brne .+2 ; 0x2a446 2a444: b3 cf rjmp .-154 ; 0x2a3ac 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; 2a446: 81 e0 ldi r24, 0x01 ; 1 2a448: 80 93 d5 0d sts 0x0DD5, r24 ; 0x800dd5 cacheBlockNumber_ = blockNumber; 2a44c: 40 92 cd 0d sts 0x0DCD, r4 ; 0x800dcd 2a450: 50 92 ce 0d sts 0x0DCE, r5 ; 0x800dce 2a454: 60 92 cf 0d sts 0x0DCF, r6 ; 0x800dcf 2a458: 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); 2a45c: a6 01 movw r20, r12 2a45e: b5 01 movw r22, r10 2a460: c8 01 movw r24, r16 2a462: 87 52 subi r24, 0x27 ; 39 2a464: 92 4f sbci r25, 0xF2 ; 242 2a466: 0f 94 c4 a6 call 0x34d88 ; 0x34d88 2a46a: 6b cf rjmp .-298 ; 0x2a342 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; 2a46c: 41 e0 ldi r20, 0x01 ; 1 2a46e: c3 01 movw r24, r6 2a470: b2 01 movw r22, r4 2a472: 0f 94 25 37 call 0x26e4a ; 0x26e4a 2a476: 81 11 cpse r24, r1 2a478: f1 cf rjmp .-30 ; 0x2a45c 2a47a: 98 cf rjmp .-208 ; 0x2a3ac } curPosition_ += n; src += n; nToWrite -= n; } if (curPosition_ > fileSize_) { 2a47c: 80 91 0b 16 lds r24, 0x160B ; 0x80160b 2a480: 90 91 0c 16 lds r25, 0x160C ; 0x80160c 2a484: a0 91 0d 16 lds r26, 0x160D ; 0x80160d 2a488: b0 91 0e 16 lds r27, 0x160E ; 0x80160e 2a48c: 80 17 cp r24, r16 2a48e: 91 07 cpc r25, r17 2a490: a2 07 cpc r26, r18 2a492: b3 07 cpc r27, r19 2a494: 68 f4 brcc .+26 ; 0x2a4b0 2a496: 80 91 fb 15 lds r24, 0x15FB ; 0x8015fb // update fileSize and insure sync will update dir entry fileSize_ = curPosition_; 2a49a: 00 93 0b 16 sts 0x160B, r16 ; 0x80160b 2a49e: 10 93 0c 16 sts 0x160C, r17 ; 0x80160c 2a4a2: 20 93 0d 16 sts 0x160D, r18 ; 0x80160d 2a4a6: 30 93 0e 16 sts 0x160E, r19 ; 0x80160e flags_ |= F_FILE_DIR_DIRTY; 2a4aa: 80 68 ori r24, 0x80 ; 128 2a4ac: 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) { 2a4b0: 80 91 fb 15 lds r24, 0x15FB ; 0x8015fb 2a4b4: 83 fd sbrc r24, 3 2a4b6: 18 c0 rjmp .+48 ; 0x2a4e8 if (!sync()) goto fail; } return nbyte; 2a4b8: c4 01 movw r24, r8 fail: // return for write error writeError = true; return -1; } 2a4ba: 0f 90 pop r0 2a4bc: 0f 90 pop r0 2a4be: 0f 90 pop r0 2a4c0: 0f 90 pop r0 2a4c2: df 91 pop r29 2a4c4: cf 91 pop r28 2a4c6: 1f 91 pop r17 2a4c8: 0f 91 pop r16 2a4ca: ff 90 pop r15 2a4cc: ef 90 pop r14 2a4ce: df 90 pop r13 2a4d0: cf 90 pop r12 2a4d2: bf 90 pop r11 2a4d4: af 90 pop r10 2a4d6: 9f 90 pop r9 2a4d8: 8f 90 pop r8 2a4da: 7f 90 pop r7 2a4dc: 6f 90 pop r6 2a4de: 5f 90 pop r5 2a4e0: 4f 90 pop r4 2a4e2: 3f 90 pop r3 2a4e4: 2f 90 pop r2 2a4e6: 08 95 ret // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { if (!sync()) goto fail; 2a4e8: 8a ef ldi r24, 0xFA ; 250 2a4ea: 95 e1 ldi r25, 0x15 ; 21 2a4ec: 0f 94 c2 39 call 0x27384 ; 0x27384 2a4f0: 81 11 cpse r24, r1 2a4f2: e2 cf rjmp .-60 ; 0x2a4b8 2a4f4: 5b cf rjmp .-330 ; 0x2a3ac 0002a4f6 : #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) { 2a4f6: 0f 93 push r16 2a4f8: cf 93 push r28 2a4fa: df 93 push r29 2a4fc: cd b7 in r28, 0x3d ; 61 2a4fe: de b7 in r29, 0x3e ; 62 2a500: a3 97 sbiw r28, 0x23 ; 35 2a502: 0f b6 in r0, 0x3f ; 63 2a504: f8 94 cli 2a506: de bf out 0x3e, r29 ; 62 2a508: 0f be out 0x3f, r0 ; 63 2a50a: cd bf out 0x3d, r28 ; 61 if (nr < sort_count) 2a50c: 20 91 0b 15 lds r18, 0x150B ; 0x80150b 2a510: 30 91 0c 15 lds r19, 0x150C ; 0x80150c 2a514: 82 17 cp r24, r18 2a516: 93 07 cpc r25, r19 2a518: d8 f4 brcc .+54 ; 0x2a550 getfilename_simple(sort_entries[(sdSort == SD_SORT_ALPHA) ? (sort_count - nr - 1) : nr]); 2a51a: 61 30 cpi r22, 0x01 ; 1 2a51c: 31 f4 brne .+12 ; 0x2a52a 2a51e: 21 50 subi r18, 0x01 ; 1 2a520: 31 09 sbc r19, r1 2a522: a9 01 movw r20, r18 2a524: 48 1b sub r20, r24 2a526: 59 0b sbc r21, r25 2a528: ca 01 movw r24, r20 2a52a: 88 0f add r24, r24 2a52c: 99 1f adc r25, r25 2a52e: fc 01 movw r30, r24 2a530: e3 5f subi r30, 0xF3 ; 243 2a532: fa 4e sbci r31, 0xEA ; 234 2a534: 80 81 ld r24, Z 2a536: 91 81 ldd r25, Z+1 ; 0x01 2a538: 0f 94 9e 48 call 0x2913c ; 0x2913c else getfilename_afterMaxSorting(nr); } 2a53c: a3 96 adiw r28, 0x23 ; 35 2a53e: 0f b6 in r0, 0x3f ; 63 2a540: f8 94 cli 2a542: de bf out 0x3e, r29 ; 62 2a544: 0f be out 0x3f, r0 ; 63 2a546: cd bf out 0x3d, r28 ; 61 2a548: df 91 pop r29 2a54a: cf 91 pop r28 2a54c: 0f 91 pop r16 2a54e: 08 95 ret void CardReader::getfilename_afterMaxSorting(uint16_t entry, const char * const match/*=NULL*/) { curDir = &workDir; 2a550: 45 e1 ldi r20, 0x15 ; 21 2a552: 54 e1 ldi r21, 0x14 ; 20 2a554: 50 93 14 14 sts 0x1414, r21 ; 0x801414 2a558: 40 93 13 14 sts 0x1413, r20 ; 0x801413 nrFiles = entry - sort_count + 1; 2a55c: 82 1b sub r24, r18 2a55e: 93 0b sbc r25, r19 2a560: 01 96 adiw r24, 0x01 ; 1 2a562: 90 93 83 16 sts 0x1683, r25 ; 0x801683 2a566: 80 93 82 16 sts 0x1682, r24 ; 0x801682 curDir->seekSet(lastSortedFilePosition << 5); 2a56a: 40 91 d5 15 lds r20, 0x15D5 ; 0x8015d5 2a56e: 50 91 d6 15 lds r21, 0x15D6 ; 0x8015d6 2a572: 85 e0 ldi r24, 0x05 ; 5 2a574: 44 0f add r20, r20 2a576: 55 1f adc r21, r21 2a578: 8a 95 dec r24 2a57a: e1 f7 brne .-8 ; 0x2a574 2a57c: 70 e0 ldi r23, 0x00 ; 0 2a57e: 60 e0 ldi r22, 0x00 ; 0 2a580: 85 e1 ldi r24, 0x15 ; 21 2a582: 94 e1 ldi r25, 0x14 ; 20 2a584: 0f 94 f7 39 call 0x273ee ; 0x273ee }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 2a588: 00 e0 ldi r16, 0x00 ; 0 2a58a: 0e 7f andi r16, 0xFE ; 254 2a58c: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2a58e: e0 91 13 14 lds r30, 0x1413 ; 0x801413 2a592: f0 91 14 14 lds r31, 0x1414 ; 0x801414 2a596: 83 e2 ldi r24, 0x23 ; 35 2a598: de 01 movw r26, r28 2a59a: 11 96 adiw r26, 0x01 ; 1 2a59c: 01 90 ld r0, Z+ 2a59e: 0d 92 st X+, r0 2a5a0: 8a 95 dec r24 2a5a2: e1 f7 brne .-8 ; 0x2a59c 2a5a4: 22 e0 ldi r18, 0x02 ; 2 2a5a6: 50 e0 ldi r21, 0x00 ; 0 2a5a8: 40 e0 ldi r20, 0x00 ; 0 2a5aa: be 01 movw r22, r28 2a5ac: 6f 5f subi r22, 0xFF ; 255 2a5ae: 7f 4f sbci r23, 0xFF ; 255 2a5b0: 8a ed ldi r24, 0xDA ; 218 2a5b2: 92 e0 ldi r25, 0x02 ; 2 2a5b4: 0f 94 28 46 call 0x28c50 ; 0x28c50 2a5b8: ce 01 movw r24, r28 2a5ba: 01 96 adiw r24, 0x01 ; 1 2a5bc: 0e 94 31 70 call 0xe062 ; 0xe062 2a5c0: bd cf rjmp .-134 ; 0x2a53c 0002a5c2 : SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } void CardReader::openFileWrite(const char* name) 2a5c2: 0f 93 push r16 2a5c4: 1f 93 push r17 2a5c6: cf 93 push r28 2a5c8: df 93 push r29 2a5ca: 1f 92 push r1 2a5cc: 1f 92 push r1 2a5ce: cd b7 in r28, 0x3d ; 61 2a5d0: de b7 in r29, 0x3e ; 62 { if(!mounted) 2a5d2: 20 91 6b 13 lds r18, 0x136B ; 0x80136b 2a5d6: 22 23 and r18, r18 2a5d8: 69 f1 breq .+90 ; 0x2a634 2a5da: 8c 01 movw r16, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 2a5dc: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 2a5e0: 88 23 and r24, r24 2a5e2: 79 f1 breq .+94 ; 0x2a642 SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; file.close(); #else SERIAL_ECHOLNPGM("File already opened"); 2a5e4: 8b e0 ldi r24, 0x0B ; 11 2a5e6: 9a e9 ldi r25, 0x9A ; 154 2a5e8: 0e 94 49 72 call 0xe492 ; 0xe492 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; 2a5ec: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a const char *fname=name; 2a5f0: 1a 83 std Y+2, r17 ; 0x02 2a5f2: 09 83 std Y+1, r16 ; 0x01 if (!diveSubfolder(fname)) 2a5f4: ce 01 movw r24, r28 2a5f6: 01 96 adiw r24, 0x01 ; 1 2a5f8: 0f 94 40 4c call 0x29880 ; 0x29880 2a5fc: 88 23 and r24, r24 2a5fe: d1 f0 breq .+52 ; 0x2a634 return; //write if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)){ 2a600: 49 81 ldd r20, Y+1 ; 0x01 2a602: 5a 81 ldd r21, Y+2 ; 0x02 2a604: 60 91 13 14 lds r22, 0x1413 ; 0x801413 2a608: 70 91 14 14 lds r23, 0x1414 ; 0x801414 2a60c: 26 e5 ldi r18, 0x56 ; 86 2a60e: 8a ef ldi r24, 0xFA ; 250 2a610: 95 e1 ldi r25, 0x15 ; 21 2a612: 0f 94 48 9a call 0x33490 ; 0x33490 2a616: 81 11 cpse r24, r1 2a618: 22 c0 rjmp .+68 ; 0x2a65e SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 2a61a: 8b eb ldi r24, 0xBB ; 187 2a61c: 9b e6 ldi r25, 0x6B ; 107 2a61e: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 2a622: 89 81 ldd r24, Y+1 ; 0x01 2a624: 9a 81 ldd r25, Y+2 ; 0x02 2a626: 0e 94 a0 7c call 0xf940 ; 0xf940 2a62a: 8e e2 ldi r24, 0x2E ; 46 2a62c: 0e 94 37 70 call 0xe06e ; 0xe06e } void MarlinSerial::println(char c, int base) { print(c, base); println(); 2a630: 0f 94 bb 98 call 0x33176 ; 0x33176 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } } 2a634: 0f 90 pop r0 2a636: 0f 90 pop r0 2a638: df 91 pop r29 2a63a: cf 91 pop r28 2a63c: 1f 91 pop r17 2a63e: 0f 91 pop r16 2a640: 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 2a642: 10 92 1d 16 sts 0x161D, r1 ; 0x80161d SERIAL_ECHO_START; 2a646: 81 e6 ldi r24, 0x61 ; 97 2a648: 9d e9 ldi r25, 0x9D ; 157 2a64a: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHORPGM(ofNowFreshFile); 2a64e: 83 e2 ldi r24, 0x23 ; 35 2a650: 9c e9 ldi r25, 0x9C ; 156 2a652: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLN(name); 2a656: c8 01 movw r24, r16 2a658: 0f 94 bc 99 call 0x33378 ; 0x33378 2a65c: c7 cf rjmp .-114 ; 0x2a5ec 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; 2a65e: 81 e0 ldi r24, 0x01 ; 1 2a660: 80 93 68 13 sts 0x1368, r24 ; 0x801368 getfilename(0, fname); 2a664: 89 81 ldd r24, Y+1 ; 0x01 2a666: 9a 81 ldd r25, Y+2 ; 0x02 2a668: 0f 94 57 48 call 0x290ae ; 0x290ae SERIAL_PROTOCOLRPGM(ofWritingToFile);////MSG_SD_WRITE_TO_FILE 2a66c: 89 ef ldi r24, 0xF9 ; 249 2a66e: 99 e9 ldi r25, 0x99 ; 153 2a670: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 printAbsFilenameFast(); 2a674: 0f 94 3a 49 call 0x29274 ; 0x29274 SERIAL_PROTOCOLLN(); 2a678: 0f 94 bb 98 call 0x33176 ; 0x33176 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 2a67c: 8f ef ldi r24, 0xFF ; 255 2a67e: 9b e9 ldi r25, 0x9B ; 155 2a680: 0e 94 49 72 call 0xe492 ; 0xe492 lcd_setstatuspgm(ofFileSelected); 2a684: 8f ef ldi r24, 0xFF ; 255 2a686: 9b e9 ldi r25, 0x9B ; 155 2a688: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 scrollstuff = 0; 2a68c: 10 92 cc 0d sts 0x0DCC, r1 ; 0x800dcc 2a690: d1 cf rjmp .-94 ; 0x2a634 0002a692 : //presort(); #endif } } bool CardReader::ToshibaFlashAir_GetIP(uint8_t *ip) 2a692: 0f 93 push r16 2a694: 1f 93 push r17 2a696: cf 93 push r28 2a698: df 93 push r29 2a69a: ec 01 movw r28, r24 { memset(ip, 0, 4); 2a69c: 84 e0 ldi r24, 0x04 ; 4 2a69e: fe 01 movw r30, r28 2a6a0: 11 92 st Z+, r1 2a6a2: 8a 95 dec r24 2a6a4: e9 f7 brne .-6 ; 0x2a6a0 /** 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 2a6a6: 23 e0 ldi r18, 0x03 ; 3 2a6a8: 30 ea ldi r19, 0xA0 ; 160 2a6aa: 4a e0 ldi r20, 0x0A ; 10 2a6ac: 50 e9 ldi r21, 0x90 ; 144 2a6ae: 60 e3 ldi r22, 0x30 ; 48 2a6b0: 87 ed ldi r24, 0xD7 ; 215 2a6b2: 95 e1 ldi r25, 0x15 ; 21 2a6b4: 0f 94 b5 70 call 0x2e16a ; 0x2e16a 2a6b8: 88 23 and r24, r24 2a6ba: 91 f0 breq .+36 ; 0x2a6e0 2a6bc: 23 e0 ldi r18, 0x03 ; 3 2a6be: 30 ea ldi r19, 0xA0 ; 160 2a6c0: 4a e0 ldi r20, 0x0A ; 10 2a6c2: 50 e9 ldi r21, 0x90 ; 144 2a6c4: 61 e1 ldi r22, 0x11 ; 17 2a6c6: 87 ed ldi r24, 0xD7 ; 215 2a6c8: 95 e1 ldi r25, 0x15 ; 21 2a6ca: 0f 94 b5 70 call 0x2e16a ; 0x2e16a 2a6ce: 88 23 and r24, r24 2a6d0: 39 f0 breq .+14 ; 0x2a6e0 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 2a6d2: 80 e8 ldi r24, 0x80 ; 128 2a6d4: 80 93 d7 15 sts 0x15D7, r24 ; 0x8015d7 chipSelectHigh(); spiSend(0xFF); // dummy clock to force FlashAir finish the command. return true; fail: chipSelectHigh(); 2a6d8: 0f 94 7f 42 call 0x284fe ; 0x284fe return false; 2a6dc: 80 e0 ldi r24, 0x00 ; 0 2a6de: 2f c0 rjmp .+94 ; 0x2a73e //------------------------------------------------------------------------------ /** 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(); 2a6e0: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 2a6e4: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 2a6e6: 0f 94 ae 70 call 0x2e15c ; 0x2e15c 2a6ea: 80 93 d9 15 sts 0x15D9, r24 ; 0x8015d9 2a6ee: 8f 3f cpi r24, 0xFF ; 255 2a6f0: 69 f4 brne .+26 ; 0x2a70c if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 2a6f2: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 2a6f6: 60 1b sub r22, r16 2a6f8: 71 0b sbc r23, r17 2a6fa: 6d 32 cpi r22, 0x2D ; 45 2a6fc: 71 40 sbci r23, 0x01 ; 1 2a6fe: 98 f3 brcs .-26 ; 0x2a6e6 2a700: 81 e1 ldi r24, 0x11 ; 17 2a702: 80 93 d7 15 sts 0x15D7, r24 ; 0x8015d7 goto fail; } return true; fail: chipSelectHigh(); 2a706: 0f 94 7f 42 call 0x284fe ; 0x284fe 2a70a: e6 cf rjmp .-52 ; 0x2a6d8 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 2a70c: 8e 3f cpi r24, 0xFE ; 254 2a70e: 11 f0 breq .+4 ; 0x2a714 2a710: 8f e0 ldi r24, 0x0F ; 15 2a712: f7 cf rjmp .-18 ; 0x2a702 2a714: 8e 01 movw r16, r28 2a716: 0c 5f subi r16, 0xFC ; 252 2a718: 1f 4f sbci r17, 0xFF ; 255 goto fail; } // receive data for (i = 0; i < count; ++i) { dst[i] = spiRec(); 2a71a: 0f 94 ae 70 call 0x2e15c ; 0x2e15c 2a71e: 89 93 st Y+, r24 if (!waitStartBlock()) { goto fail; } // receive data for (i = 0; i < count; ++i) { 2a720: c0 17 cp r28, r16 2a722: d1 07 cpc r29, r17 2a724: d1 f7 brne .-12 ; 0x2a71a 2a726: ce ef ldi r28, 0xFE ; 254 2a728: d1 e0 ldi r29, 0x01 ; 1 dst[i] = spiRec(); } // skip dummy bytes and 16-bit crc. for (; i < 514; ++i) { spiRec(); 2a72a: 0f 94 ae 70 call 0x2e15c ; 0x2e15c 2a72e: 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) { 2a730: e1 f7 brne .-8 ; 0x2a72a spiRec(); } chipSelectHigh(); 2a732: 0f 94 7f 42 call 0x284fe ; 0x284fe spiSend(0xFF); // dummy clock to force FlashAir finish the command. 2a736: 8f ef ldi r24, 0xFF ; 255 2a738: 0f 94 a9 70 call 0x2e152 ; 0x2e152 2a73c: 81 e0 ldi r24, 0x01 ; 1 return card.readExtMemory(1, 1, 0x400+0x150, 4, ip); } 2a73e: df 91 pop r29 2a740: cf 91 pop r28 2a742: 1f 91 pop r17 2a744: 0f 91 pop r16 2a746: 08 95 ret 0002a748 : } 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) 2a748: cf 92 push r12 2a74a: df 92 push r13 2a74c: ef 92 push r14 2a74e: ff 92 push r15 2a750: 0f 93 push r16 2a752: 1f 93 push r17 2a754: cf 93 push r28 2a756: df 93 push r29 2a758: ec 01 movw r28, r24 2a75a: 8b 01 movw r16, r22 2a75c: 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) 2a75e: 01 15 cp r16, r1 2a760: 11 05 cpc r17, r1 2a762: 09 f4 brne .+2 ; 0x2a766 2a764: 41 c0 rjmp .+130 ; 0x2a7e8 void print_hex_word(daddr_t val) { #if DADDR_SIZE > 16 print_hex_byte((val >> 16) & 0xFF); #endif print_hex_byte((val >> 8) & 0xFF); 2a766: 8d 2f mov r24, r29 2a768: 0e 94 7e 6f call 0xdefc ; 0xdefc print_hex_byte(val & 0xFF); 2a76c: 8c 2f mov r24, r28 2a76e: 0e 94 7e 6f call 0xdefc ; 0xdefc XFLASH_SPI_ENTER(); #endif while (count) { print_hex_word(address); putchar(' '); 2a772: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> 2a776: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> 2a77a: 80 e2 ldi r24, 0x20 ; 32 2a77c: 90 e0 ldi r25, 0x00 ; 0 2a77e: 0f 94 03 9f call 0x33e06 ; 0x33e06 2a782: 6e 01 movw r12, r28 2a784: 80 e1 ldi r24, 0x10 ; 16 2a786: c8 0e add r12, r24 2a788: d1 1c adc r13, r1 uint8_t count_line = countperline; while (count && count_line) { uint8_t data = 0; switch (type) 2a78a: 81 e0 ldi r24, 0x01 ; 1 2a78c: e8 16 cp r14, r24 2a78e: 39 f1 breq .+78 ; 0x2a7de { case dcode_mem_t::sram: data = *((uint8_t*)address); break; 2a790: 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; 2a792: 21 96 adiw r28, 0x01 ; 1 putchar(' '); 2a794: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> 2a798: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> 2a79c: 80 e2 ldi r24, 0x20 ; 32 2a79e: 90 e0 ldi r25, 0x00 ; 0 2a7a0: 0f 94 03 9f call 0x33e06 ; 0x33e06 print_hex_byte(data); 2a7a4: 8f 2d mov r24, r15 2a7a6: 0e 94 7e 6f call 0xdefc ; 0xdefc count_line--; count--; 2a7aa: 01 50 subi r16, 0x01 ; 1 2a7ac: 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)) 2a7ae: 0f b6 in r0, 0x3f ; 63 2a7b0: 07 fe sbrs r0, 7 2a7b2: 06 c0 rjmp .+12 ; 0x2a7c0 2a7b4: c8 01 movw r24, r16 2a7b6: 9f 71 andi r25, 0x1F ; 31 2a7b8: 89 2b or r24, r25 2a7ba: 29 f4 brne .+10 ; 0x2a7c6 manage_heater(); 2a7bc: 0f 94 13 33 call 0x26626 ; 0x26626 while (count) { print_hex_word(address); putchar(' '); uint8_t count_line = countperline; while (count && count_line) 2a7c0: 01 15 cp r16, r1 2a7c2: 11 05 cpc r17, r1 2a7c4: 19 f0 breq .+6 ; 0x2a7cc 2a7c6: cc 15 cp r28, r12 2a7c8: dd 05 cpc r29, r13 2a7ca: f9 f6 brne .-66 ; 0x2a78a // 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'); 2a7cc: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> 2a7d0: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> 2a7d4: 8a e0 ldi r24, 0x0A ; 10 2a7d6: 90 e0 ldi r25, 0x00 ; 0 2a7d8: 0f 94 03 9f call 0x33e06 ; 0x33e06 2a7dc: c0 cf rjmp .-128 ; 0x2a75e { 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; 2a7de: ce 01 movw r24, r28 2a7e0: 0f 94 9b a0 call 0x34136 ; 0x34136 2a7e4: f8 2e mov r15, r24 2a7e6: d5 cf rjmp .-86 ; 0x2a792 if((SREG & (1 << SREG_I)) && !((uint16_t)count % 8192)) manage_heater(); } putchar('\n'); } } 2a7e8: df 91 pop r29 2a7ea: cf 91 pop r28 2a7ec: 1f 91 pop r17 2a7ee: 0f 91 pop r16 2a7f0: ff 90 pop r15 2a7f2: ef 90 pop r14 2a7f4: df 90 pop r13 2a7f6: cf 90 pop r12 2a7f8: 08 95 ret 0002a7fa : ; // } #if (FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) void IR_sensor::init() { if (state == State::error) { 2a7fa: 80 91 84 16 lds r24, 0x1684 ; 0x801684 2a7fe: 83 30 cpi r24, 0x03 ; 3 2a800: 21 f4 brne .+8 ; 0x2a80a 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 2a802: 51 98 cbi 0x0a, 1 ; 10 WRITE(IR_SENSOR_PIN, 0); // no pullup 2a804: 59 98 cbi 0x0b, 1 ; 11 state = State::disabled; 2a806: 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 2a80a: 51 98 cbi 0x0a, 1 ; 10 WRITE(IR_SENSOR_PIN, 1); // pullup 2a80c: 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(); } 2a80e: 84 e8 ldi r24, 0x84 ; 132 2a810: 96 e1 ldi r25, 0x16 ; 22 2a812: 0c 94 e6 6d jmp 0xdbcc ; 0xdbcc 0002a816 : //! //! @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) 2a816: cf 92 push r12 2a818: df 92 push r13 2a81a: ef 92 push r14 2a81c: ff 92 push r15 2a81e: 69 01 movw r12, r18 2a820: 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); 2a822: 2d ec ldi r18, 0xCD ; 205 2a824: 3c ec ldi r19, 0xCC ; 204 2a826: 4c e4 ldi r20, 0x4C ; 76 2a828: 5e e3 ldi r21, 0x3E ; 62 2a82a: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 2a82e: 2d ec ldi r18, 0xCD ; 205 2a830: 3c ec ldi r19, 0xCC ; 204 2a832: 4c e4 ldi r20, 0x4C ; 76 2a834: 5e e3 ldi r21, 0x3E ; 62 2a836: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2a83a: 2d ef ldi r18, 0xFD ; 253 2a83c: 3d ea ldi r19, 0xAD ; 173 2a83e: 40 e0 ldi r20, 0x00 ; 0 2a840: 5d e3 ldi r21, 0x3D ; 61 2a842: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2a846: a7 01 movw r20, r14 2a848: 96 01 movw r18, r12 2a84a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2a84e: 24 e2 ldi r18, 0x24 ; 36 2a850: 30 ef ldi r19, 0xF0 ; 240 2a852: 49 e1 ldi r20, 0x19 ; 25 2a854: 50 e4 ldi r21, 0x40 ; 64 2a856: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> } 2a85a: ff 90 pop r15 2a85c: ef 90 pop r14 2a85e: df 90 pop r13 2a860: cf 90 pop r12 2a862: 08 95 ret 0002a864 : } } void st_set_position(const long *pos) { CRITICAL_SECTION_START; 2a864: 9f b7 in r25, 0x3f ; 63 2a866: 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)); 2a868: 80 e1 ldi r24, 0x10 ; 16 2a86a: e6 ea ldi r30, 0xA6 ; 166 2a86c: f6 e0 ldi r31, 0x06 ; 6 2a86e: a6 eb ldi r26, 0xB6 ; 182 2a870: b6 e0 ldi r27, 0x06 ; 6 2a872: 01 90 ld r0, Z+ 2a874: 0d 92 st X+, r0 2a876: 8a 95 dec r24 2a878: e1 f7 brne .-8 ; 0x2a872 CRITICAL_SECTION_END; 2a87a: 9f bf out 0x3f, r25 ; 63 } 2a87c: 08 95 ret 0002a87e : #include "sound.h" namespace MMU2 { void BeginReport(CommandInProgress /*cip*/, ProgressCode ec) { custom_message_type = CustomMsg::MMUProgress; 2a87e: 89 e0 ldi r24, 0x09 ; 9 2a880: 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])) 2a884: e1 e2 ldi r30, 0x21 ; 33 2a886: fa e9 ldi r31, 0x9A ; 154 2a888: 85 91 lpm r24, Z+ 2a88a: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 2a88c: 0e 94 a7 6c call 0xd94e ; 0xd94e 2a890: 0c 94 99 e6 jmp 0x1cd32 ; 0x1cd32 0002a894 : 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) { 2a894: 1f 93 push r17 2a896: cf 93 push r28 2a898: df 93 push r29 2a89a: ec 01 movw r28, r24 2a89c: 16 2f mov r17, r22 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2a89e: 0f 94 ce 22 call 0x2459c ; 0x2459c 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))); 2a8a2: fe 01 movw r30, r28 2a8a4: 34 96 adiw r30, 0x04 ; 4 2a8a6: 25 91 lpm r18, Z+ 2a8a8: 35 91 lpm r19, Z+ 2a8aa: 45 91 lpm r20, Z+ 2a8ac: 54 91 lpm r21, Z 2a8ae: fe 01 movw r30, r28 2a8b0: 65 91 lpm r22, Z+ 2a8b2: 75 91 lpm r23, Z+ 2a8b4: 85 91 lpm r24, Z+ 2a8b6: 94 91 lpm r25, Z 2a8b8: 0f 94 c1 87 call 0x30f82 ; 0x30f82 step++; 2a8bc: 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) { 2a8be: 11 50 subi r17, 0x01 ; 1 2a8c0: 81 f7 brne .-32 ; 0x2a8a2 2a8c2: 0f 94 ce 22 call 0x2459c ; 0x2459c // 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(); } 2a8c6: df 91 pop r29 2a8c8: cf 91 pop r28 2a8ca: 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(); 2a8cc: 0d 94 bf 87 jmp 0x30f7e ; 0x30f7e 0002a8d0 : } void EndReport(CommandInProgress /*cip*/, ProgressCode /*ec*/) { // clear the status msg line - let the printed filename get visible again if (!printJobOngoing()) { 2a8d0: 0e 94 be 60 call 0xc17c ; 0xc17c 2a8d4: 81 11 cpse r24, r1 2a8d6: 04 c0 rjmp .+8 ; 0x2a8e0 lcd_setstatuspgm(MSG_WELCOME); 2a8d8: 87 e6 ldi r24, 0x67 ; 103 2a8da: 9b e6 ldi r25, 0x6B ; 107 2a8dc: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 } custom_message_type = CustomMsg::Status; 2a8e0: 10 92 c7 06 sts 0x06C7, r1 ; 0x8006c7 } 2a8e4: 08 95 ret 0002a8e6 : EndReport(cip, ProgressCode::OK); } }; bool MMU2::WaitForMMUReady() { switch (State()) { 2a8e6: 80 91 94 12 lds r24, 0x1294 ; 0x801294 2a8ea: 88 23 and r24, r24 2a8ec: 11 f0 breq .+4 ; 0x2a8f2 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; 2a8ee: 81 e0 ldi r24, 0x01 ; 1 2a8f0: 08 95 ret }; bool MMU2::WaitForMMUReady() { switch (State()) { case xState::Stopped: return false; 2a8f2: 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; } } 2a8f4: 08 95 ret 0002a8f6 : } #ifdef TMC2130 void homeaxis(uint8_t axis, uint8_t cnt, uint8_t* pstep) #else void homeaxis(uint8_t axis, uint8_t cnt) 2a8f6: 2f 92 push r2 2a8f8: 3f 92 push r3 2a8fa: 4f 92 push r4 2a8fc: 5f 92 push r5 2a8fe: 6f 92 push r6 2a900: 7f 92 push r7 2a902: 8f 92 push r8 2a904: 9f 92 push r9 2a906: af 92 push r10 2a908: bf 92 push r11 2a90a: cf 92 push r12 2a90c: df 92 push r13 2a90e: ef 92 push r14 2a910: ff 92 push r15 2a912: 0f 93 push r16 2a914: 1f 93 push r17 2a916: cf 93 push r28 2a918: df 93 push r29 2a91a: 00 d0 rcall .+0 ; 0x2a91c 2a91c: 00 d0 rcall .+0 ; 0x2a91e 2a91e: 00 d0 rcall .+0 ; 0x2a920 2a920: 1f 92 push r1 2a922: 1f 92 push r1 2a924: cd b7 in r28, 0x3d ; 61 2a926: de b7 in r29, 0x3e ; 62 2a928: 8b 83 std Y+3, r24 ; 0x03 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 2a92a: 20 91 77 02 lds r18, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.364> 2a92e: 2d 83 std Y+5, r18 ; 0x05 check_endstops = check; 2a930: 81 e0 ldi r24, 0x01 ; 1 2a932: 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) 2a936: 9b 81 ldd r25, Y+3 ; 0x03 2a938: 92 30 cpi r25, 0x02 ; 2 2a93a: 09 f4 brne .+2 ; 0x2a93e 2a93c: 5b c1 rjmp .+694 ; 0x2abf4 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); 2a93e: a9 2f mov r26, r25 2a940: b0 e0 ldi r27, 0x00 ; 0 2a942: ba 83 std Y+2, r27 ; 0x02 2a944: a9 83 std Y+1, r26 ; 0x01 2a946: fd 01 movw r30, r26 2a948: e0 51 subi r30, 0x10 ; 16 2a94a: 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); 2a94c: 24 91 lpm r18, Z 2a94e: 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]; 2a950: 8d 01 movw r16, r26 2a952: 00 0f add r16, r16 2a954: 11 1f adc r17, r17 2a956: 00 0f add r16, r16 2a958: 11 1f adc r17, r17 2a95a: f8 01 movw r30, r16 2a95c: ed 50 subi r30, 0x0D ; 13 2a95e: fd 4f sbci r31, 0xFD ; 253 2a960: 40 80 ld r4, Z 2a962: 51 80 ldd r5, Z+1 ; 0x01 2a964: 62 80 ldd r6, Z+2 ; 0x02 2a966: 73 80 ldd r7, Z+3 ; 0x03 2a968: 40 92 7a 02 sts 0x027A, r4 ; 0x80027a 2a96c: 50 92 7b 02 sts 0x027B, r5 ; 0x80027b 2a970: 60 92 7c 02 sts 0x027C, r6 ; 0x80027c 2a974: 70 92 7d 02 sts 0x027D, r7 ; 0x80027d float feedrate_mm_s = get_feedrate_mm_s(feedrate); 2a978: c3 01 movw r24, r6 2a97a: b2 01 movw r22, r4 2a97c: 0e 94 c3 5f call 0xbf86 ; 0xbf86 2a980: 4b 01 movw r8, r22 2a982: 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; 2a984: c8 01 movw r24, r16 2a986: 8b 50 subi r24, 0x0B ; 11 2a988: 9e 4e sbci r25, 0xEE ; 238 2a98a: 1c 01 movw r2, r24 2a98c: dc 01 movw r26, r24 2a98e: 1d 92 st X+, r1 2a990: 1d 92 st X+, r1 2a992: 1d 92 st X+, r1 2a994: 1c 92 st X, r1 2a996: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); 2a998: 0f 94 ef 83 call 0x307de ; 0x307de set_destination_to_current(); 2a99c: 0e 94 2c 61 call 0xc258 ; 0xc258 // destination[axis] = 11.f; destination[axis] = -3.f * axis_home_dir; 2a9a0: bc 81 ldd r27, Y+4 ; 0x04 2a9a2: 6b 2f mov r22, r27 2a9a4: bb 0f add r27, r27 2a9a6: 77 0b sbc r23, r23 2a9a8: 88 0b sbc r24, r24 2a9aa: 99 0b sbc r25, r25 2a9ac: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2a9b0: 6b 01 movw r12, r22 2a9b2: 7c 01 movw r14, r24 2a9b4: f8 01 movw r30, r16 2a9b6: ed 56 subi r30, 0x6D ; 109 2a9b8: f9 4f sbci r31, 0xF9 ; 249 2a9ba: fb 87 std Y+11, r31 ; 0x0b 2a9bc: ea 87 std Y+10, r30 ; 0x0a 2a9be: 20 e0 ldi r18, 0x00 ; 0 2a9c0: 30 e0 ldi r19, 0x00 ; 0 2a9c2: 40 e4 ldi r20, 0x40 ; 64 2a9c4: 50 ec ldi r21, 0xC0 ; 192 2a9c6: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2a9ca: aa 85 ldd r26, Y+10 ; 0x0a 2a9cc: bb 85 ldd r27, Y+11 ; 0x0b 2a9ce: 6d 93 st X+, r22 2a9d0: 7d 93 st X+, r23 2a9d2: 8d 93 st X+, r24 2a9d4: 9c 93 st X, r25 2a9d6: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2a9d8: c5 01 movw r24, r10 2a9da: b4 01 movw r22, r8 2a9dc: 0f 94 fc 84 call 0x309f8 ; 0x309f8 st_synchronize(); 2a9e0: 0f 94 ce 22 call 0x2459c ; 0x2459c // Move away from the possible collision with opposite endstop with the collision detection disabled. endstops_hit_on_purpose(); 2a9e4: 0f 94 22 2d call 0x25a44 ; 0x25a44 2a9e8: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.364> enable_endstops(false); current_position[axis] = 0; 2a9ec: f1 01 movw r30, r2 2a9ee: 10 82 st Z, r1 2a9f0: 11 82 std Z+1, r1 ; 0x01 2a9f2: 12 82 std Z+2, r1 ; 0x02 2a9f4: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 2a9f6: 0f 94 ef 83 call 0x307de ; 0x307de destination[axis] = 1. * axis_home_dir; 2a9fa: aa 85 ldd r26, Y+10 ; 0x0a 2a9fc: bb 85 ldd r27, Y+11 ; 0x0b 2a9fe: cd 92 st X+, r12 2aa00: dd 92 st X+, r13 2aa02: ed 92 st X+, r14 2aa04: fc 92 st X, r15 2aa06: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2aa08: c5 01 movw r24, r10 2aa0a: b4 01 movw r22, r8 2aa0c: 0f 94 fc 84 call 0x309f8 ; 0x309f8 st_synchronize(); 2aa10: 0f 94 ce 22 call 0x2459c ; 0x2459c 2aa14: b1 e0 ldi r27, 0x01 ; 1 2aa16: 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); 2aa1a: f8 01 movw r30, r16 2aa1c: ec 51 subi r30, 0x1C ; 28 2aa1e: 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); 2aa20: 85 91 lpm r24, Z+ 2aa22: 95 91 lpm r25, Z+ 2aa24: a5 91 lpm r26, Z+ 2aa26: b4 91 lpm r27, Z 2aa28: 8e 83 std Y+6, r24 ; 0x06 2aa2a: 9f 83 std Y+7, r25 ; 0x07 2aa2c: a8 87 std Y+8, r26 ; 0x08 2aa2e: 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); 2aa30: 2d ec ldi r18, 0xCD ; 205 2aa32: 3c ec ldi r19, 0xCC ; 204 2aa34: 4c e8 ldi r20, 0x8C ; 140 2aa36: 5f e3 ldi r21, 0x3F ; 63 2aa38: c7 01 movw r24, r14 2aa3a: b6 01 movw r22, r12 2aa3c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2aa40: 2e 81 ldd r18, Y+6 ; 0x06 2aa42: 3f 81 ldd r19, Y+7 ; 0x07 2aa44: 48 85 ldd r20, Y+8 ; 0x08 2aa46: 59 85 ldd r21, Y+9 ; 0x09 2aa48: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2aa4c: aa 85 ldd r26, Y+10 ; 0x0a 2aa4e: bb 85 ldd r27, Y+11 ; 0x0b 2aa50: 6d 93 st X+, r22 2aa52: 7d 93 st X+, r23 2aa54: 8d 93 st X+, r24 2aa56: 9c 93 st X, r25 2aa58: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2aa5a: c5 01 movw r24, r10 2aa5c: b4 01 movw r22, r8 2aa5e: 0f 94 fc 84 call 0x309f8 ; 0x309f8 st_synchronize(); 2aa62: 0f 94 ce 22 call 0x2459c ; 0x2459c 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(); 2aa66: 0f 94 22 2d call 0x25a44 ; 0x25a44 2aa6a: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.364> enable_endstops(false); current_position[axis] = 0; 2aa6e: f1 01 movw r30, r2 2aa70: 10 82 st Z, r1 2aa72: 11 82 std Z+1, r1 ; 0x01 2aa74: 12 82 std Z+2, r1 ; 0x02 2aa76: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 2aa78: 0f 94 ef 83 call 0x307de ; 0x307de destination[axis] = -10.f * axis_home_dir; 2aa7c: 20 e0 ldi r18, 0x00 ; 0 2aa7e: 30 e0 ldi r19, 0x00 ; 0 2aa80: 40 e2 ldi r20, 0x20 ; 32 2aa82: 51 ec ldi r21, 0xC1 ; 193 2aa84: c7 01 movw r24, r14 2aa86: b6 01 movw r22, r12 2aa88: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2aa8c: aa 85 ldd r26, Y+10 ; 0x0a 2aa8e: bb 85 ldd r27, Y+11 ; 0x0b 2aa90: 6d 93 st X+, r22 2aa92: 7d 93 st X+, r23 2aa94: 8d 93 st X+, r24 2aa96: 9c 93 st X, r25 2aa98: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2aa9a: c5 01 movw r24, r10 2aa9c: b4 01 movw r22, r8 2aa9e: 0f 94 fc 84 call 0x309f8 ; 0x309f8 st_synchronize(); 2aaa2: 0f 94 ce 22 call 0x2459c ; 0x2459c endstops_hit_on_purpose(); 2aaa6: 0f 94 22 2d call 0x25a44 ; 0x25a44 2aaaa: b1 e0 ldi r27, 0x01 ; 1 2aaac: 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; 2aab0: 20 e0 ldi r18, 0x00 ; 0 2aab2: 30 e0 ldi r19, 0x00 ; 0 2aab4: 40 e3 ldi r20, 0x30 ; 48 2aab6: 51 e4 ldi r21, 0x41 ; 65 2aab8: c7 01 movw r24, r14 2aaba: b6 01 movw r22, r12 2aabc: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2aac0: ea 85 ldd r30, Y+10 ; 0x0a 2aac2: fb 85 ldd r31, Y+11 ; 0x0b 2aac4: 60 83 st Z, r22 2aac6: 71 83 std Z+1, r23 ; 0x01 2aac8: 82 83 std Z+2, r24 ; 0x02 2aaca: 93 83 std Z+3, r25 ; 0x03 #ifdef TMC2130 feedrate = homing_feedrate[axis]; #else //TMC2130 feedrate = homing_feedrate[axis] / 2; 2aacc: 20 e0 ldi r18, 0x00 ; 0 2aace: 30 e0 ldi r19, 0x00 ; 0 2aad0: 40 e0 ldi r20, 0x00 ; 0 2aad2: 5f e3 ldi r21, 0x3F ; 63 2aad4: c3 01 movw r24, r6 2aad6: b2 01 movw r22, r4 2aad8: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2aadc: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a 2aae0: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b 2aae4: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 2aae8: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d feedrate_mm_s = get_feedrate_mm_s(feedrate); 2aaec: 0e 94 c3 5f call 0xbf86 ; 0xbf86 2aaf0: 6b 01 movw r12, r22 2aaf2: 7c 01 movw r14, r24 #endif //TMC2130 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2aaf4: 0f 94 fc 84 call 0x309f8 ; 0x309f8 st_synchronize(); 2aaf8: 0f 94 ce 22 call 0x2459c ; 0x2459c 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(); 2aafc: 0f 94 22 2d call 0x25a44 ; 0x25a44 2ab00: 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); 2ab04: 8b 81 ldd r24, Y+3 ; 0x03 2ab06: 0e 94 0d 60 call 0xc01a ; 0xc01a axis_known_position[axis] = true; 2ab0a: e9 81 ldd r30, Y+1 ; 0x01 2ab0c: fa 81 ldd r31, Y+2 ; 0x02 2ab0e: ed 55 subi r30, 0x5D ; 93 2ab10: f9 4f sbci r31, 0xF9 ; 249 2ab12: 21 e0 ldi r18, 0x01 ; 1 2ab14: 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; 2ab16: 8c 81 ldd r24, Y+4 ; 0x04 2ab18: 99 27 eor r25, r25 2ab1a: 81 95 neg r24 2ab1c: 0c f4 brge .+2 ; 0x2ab20 2ab1e: 90 95 com r25 2ab20: bc 01 movw r22, r24 2ab22: 07 2e mov r0, r23 2ab24: 00 0c add r0, r0 2ab26: 88 0b sbc r24, r24 2ab28: 99 0b sbc r25, r25 2ab2a: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2ab2e: 2a e0 ldi r18, 0x0A ; 10 2ab30: 37 ed ldi r19, 0xD7 ; 215 2ab32: 43 e2 ldi r20, 0x23 ; 35 2ab34: 5c e3 ldi r21, 0x3C ; 60 2ab36: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2ab3a: 20 e0 ldi r18, 0x00 ; 0 2ab3c: 30 e0 ldi r19, 0x00 ; 0 2ab3e: 40 e8 ldi r20, 0x80 ; 128 2ab40: 52 e4 ldi r21, 0x42 ; 66 2ab42: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2ab46: 4b 01 movw r8, r22 2ab48: 5c 01 movw r10, r24 #endif //TMC2130 current_position[axis] -= dist; 2ab4a: ac 01 movw r20, r24 2ab4c: 9b 01 movw r18, r22 2ab4e: d1 01 movw r26, r2 2ab50: 6d 91 ld r22, X+ 2ab52: 7d 91 ld r23, X+ 2ab54: 8d 91 ld r24, X+ 2ab56: 9c 91 ld r25, X 2ab58: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 2ab5c: f1 01 movw r30, r2 2ab5e: 60 83 st Z, r22 2ab60: 71 83 std Z+1, r23 ; 0x01 2ab62: 82 83 std Z+2, r24 ; 0x02 2ab64: 93 83 std Z+3, r25 ; 0x03 plan_set_position_curposXYZE(); 2ab66: 0f 94 ef 83 call 0x307de ; 0x307de current_position[axis] += dist; 2ab6a: d1 01 movw r26, r2 2ab6c: 2d 91 ld r18, X+ 2ab6e: 3d 91 ld r19, X+ 2ab70: 4d 91 ld r20, X+ 2ab72: 5c 91 ld r21, X 2ab74: c5 01 movw r24, r10 2ab76: b4 01 movw r22, r8 2ab78: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2ab7c: f1 01 movw r30, r2 2ab7e: 60 83 st Z, r22 2ab80: 71 83 std Z+1, r23 ; 0x01 2ab82: 82 83 std Z+2, r24 ; 0x02 2ab84: 93 83 std Z+3, r25 ; 0x03 destination[axis] = current_position[axis]; 2ab86: aa 85 ldd r26, Y+10 ; 0x0a 2ab88: bb 85 ldd r27, Y+11 ; 0x0b 2ab8a: 6d 93 st X+, r22 2ab8c: 7d 93 st X+, r23 2ab8e: 8d 93 st X+, r24 2ab90: 9c 93 st X, r25 2ab92: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(0.5f*feedrate_mm_s); 2ab94: 20 e0 ldi r18, 0x00 ; 0 2ab96: 30 e0 ldi r19, 0x00 ; 0 2ab98: 40 e0 ldi r20, 0x00 ; 0 2ab9a: 5f e3 ldi r21, 0x3F ; 63 2ab9c: c7 01 movw r24, r14 2ab9e: b6 01 movw r22, r12 2aba0: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2aba4: 0f 94 fc 84 call 0x309f8 ; 0x309f8 st_synchronize(); 2aba8: 0f 94 ce 22 call 0x2459c ; 0x2459c feedrate = 0.0; 2abac: 10 92 7a 02 sts 0x027A, r1 ; 0x80027a 2abb0: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b 2abb4: 10 92 7c 02 sts 0x027C, r1 ; 0x80027c 2abb8: 10 92 7d 02 sts 0x027D, r1 ; 0x80027d 2abbc: 2d 81 ldd r18, Y+5 ; 0x05 2abbe: 20 93 77 02 sts 0x0277, r18 ; 0x800277 <_ZL14check_endstops.lto_priv.364> #ifdef TMC2130 FORCE_HIGH_POWER_END; #endif } enable_endstops(endstops_enabled); } 2abc2: 2b 96 adiw r28, 0x0b ; 11 2abc4: 0f b6 in r0, 0x3f ; 63 2abc6: f8 94 cli 2abc8: de bf out 0x3e, r29 ; 62 2abca: 0f be out 0x3f, r0 ; 63 2abcc: cd bf out 0x3d, r28 ; 61 2abce: df 91 pop r29 2abd0: cf 91 pop r28 2abd2: 1f 91 pop r17 2abd4: 0f 91 pop r16 2abd6: ff 90 pop r15 2abd8: ef 90 pop r14 2abda: df 90 pop r13 2abdc: cf 90 pop r12 2abde: bf 90 pop r11 2abe0: af 90 pop r10 2abe2: 9f 90 pop r9 2abe4: 8f 90 pop r8 2abe6: 7f 90 pop r7 2abe8: 6f 90 pop r6 2abea: 5f 90 pop r5 2abec: 4f 90 pop r4 2abee: 3f 90 pop r3 2abf0: 2f 90 pop r2 2abf2: 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); 2abf4: e2 ef ldi r30, 0xF2 ; 242 2abf6: f8 e9 ldi r31, 0x98 ; 152 2abf8: b4 91 lpm r27, Z 2abfa: 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; 2abfc: 10 92 fd 11 sts 0x11FD, r1 ; 0x8011fd 2ac00: 10 92 fe 11 sts 0x11FE, r1 ; 0x8011fe 2ac04: 10 92 ff 11 sts 0x11FF, r1 ; 0x8011ff 2ac08: 10 92 00 12 sts 0x1200, r1 ; 0x801200 plan_set_position_curposXYZE(); 2ac0c: 0f 94 ef 83 call 0x307de ; 0x307de #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); 2ac10: ec ee ldi r30, 0xEC ; 236 2ac12: f8 e9 ldi r31, 0x98 ; 152 2ac14: 85 90 lpm r8, Z+ 2ac16: 95 90 lpm r9, Z+ 2ac18: a5 90 lpm r10, Z+ 2ac1a: 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; 2ac1c: e9 81 ldd r30, Y+1 ; 0x01 2ac1e: 6e 2f mov r22, r30 2ac20: ee 0f add r30, r30 2ac22: 77 0b sbc r23, r23 2ac24: 88 0b sbc r24, r24 2ac26: 99 0b sbc r25, r25 2ac28: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2ac2c: 6b 01 movw r12, r22 2ac2e: 7c 01 movw r14, r24 2ac30: 20 e0 ldi r18, 0x00 ; 0 2ac32: 30 e0 ldi r19, 0x00 ; 0 2ac34: 40 ec ldi r20, 0xC0 ; 192 2ac36: 5f e3 ldi r21, 0x3F ; 63 2ac38: c5 01 movw r24, r10 2ac3a: b4 01 movw r22, r8 2ac3c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2ac40: a7 01 movw r20, r14 2ac42: 96 01 movw r18, r12 2ac44: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2ac48: 60 93 9b 06 sts 0x069B, r22 ; 0x80069b 2ac4c: 70 93 9c 06 sts 0x069C, r23 ; 0x80069c 2ac50: 80 93 9d 06 sts 0x069D, r24 ; 0x80069d 2ac54: 90 93 9e 06 sts 0x069E, r25 ; 0x80069e feedrate = homing_feedrate[axis]; 2ac58: 80 e0 ldi r24, 0x00 ; 0 2ac5a: 90 e0 ldi r25, 0x00 ; 0 2ac5c: a8 e4 ldi r26, 0x48 ; 72 2ac5e: b4 e4 ldi r27, 0x44 ; 68 2ac60: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a 2ac64: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b 2ac68: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c 2ac6c: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d float feedrate_mm_s = get_feedrate_mm_s(feedrate); 2ac70: bc 01 movw r22, r24 2ac72: cd 01 movw r24, r26 2ac74: 0e 94 c3 5f call 0xbf86 ; 0xbf86 2ac78: 4b 01 movw r8, r22 2ac7a: 5c 01 movw r10, r24 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2ac7c: 0f 94 fc 84 call 0x309f8 ; 0x309f8 st_synchronize(); 2ac80: 0f 94 ce 22 call 0x2459c ; 0x2459c #ifdef TMC2130 check_Z_crash(); #endif //TMC2130 current_position[axis] = 0; 2ac84: 10 92 fd 11 sts 0x11FD, r1 ; 0x8011fd 2ac88: 10 92 fe 11 sts 0x11FE, r1 ; 0x8011fe 2ac8c: 10 92 ff 11 sts 0x11FF, r1 ; 0x8011ff 2ac90: 10 92 00 12 sts 0x1200, r1 ; 0x801200 plan_set_position_curposXYZE(); 2ac94: 0f 94 ef 83 call 0x307de ; 0x307de #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); 2ac98: 00 ee ldi r16, 0xE0 ; 224 2ac9a: 18 e9 ldi r17, 0x98 ; 152 2ac9c: f8 01 movw r30, r16 2ac9e: 65 91 lpm r22, Z+ 2aca0: 75 91 lpm r23, Z+ 2aca2: 85 91 lpm r24, Z+ 2aca4: 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; 2aca6: 90 58 subi r25, 0x80 ; 128 2aca8: a7 01 movw r20, r14 2acaa: 96 01 movw r18, r12 2acac: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2acb0: 60 93 9b 06 sts 0x069B, r22 ; 0x80069b 2acb4: 70 93 9c 06 sts 0x069C, r23 ; 0x80069c 2acb8: 80 93 9d 06 sts 0x069D, r24 ; 0x80069d 2acbc: 90 93 9e 06 sts 0x069E, r25 ; 0x80069e plan_buffer_line_destinationXYZE(feedrate_mm_s); 2acc0: c5 01 movw r24, r10 2acc2: b4 01 movw r22, r8 2acc4: 0f 94 fc 84 call 0x309f8 ; 0x309f8 st_synchronize(); 2acc8: 0f 94 ce 22 call 0x2459c ; 0x2459c #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); 2accc: f8 01 movw r30, r16 2acce: 65 91 lpm r22, Z+ 2acd0: 75 91 lpm r23, Z+ 2acd2: 85 91 lpm r24, Z+ 2acd4: 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; 2acd6: 9b 01 movw r18, r22 2acd8: ac 01 movw r20, r24 2acda: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2acde: a7 01 movw r20, r14 2ace0: 96 01 movw r18, r12 2ace2: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2ace6: 60 93 9b 06 sts 0x069B, r22 ; 0x80069b 2acea: 70 93 9c 06 sts 0x069C, r23 ; 0x80069c 2acee: 80 93 9d 06 sts 0x069D, r24 ; 0x80069d 2acf2: 90 93 9e 06 sts 0x069E, r25 ; 0x80069e feedrate = homing_feedrate[axis] / 2; 2acf6: 80 e0 ldi r24, 0x00 ; 0 2acf8: 90 e0 ldi r25, 0x00 ; 0 2acfa: a8 ec ldi r26, 0xC8 ; 200 2acfc: b3 e4 ldi r27, 0x43 ; 67 2acfe: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a 2ad02: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b 2ad06: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c 2ad0a: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d feedrate_mm_s = get_feedrate_mm_s(feedrate); 2ad0e: bc 01 movw r22, r24 2ad10: cd 01 movw r24, r26 2ad12: 0e 94 c3 5f call 0xbf86 ; 0xbf86 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2ad16: 0f 94 fc 84 call 0x309f8 ; 0x309f8 st_synchronize(); 2ad1a: 0f 94 ce 22 call 0x2459c ; 0x2459c #ifdef TMC2130 check_Z_crash(); #endif //TMC2130 axis_is_at_home(axis); 2ad1e: 82 e0 ldi r24, 0x02 ; 2 2ad20: 0e 94 0d 60 call 0xc01a ; 0xc01a destination[axis] = current_position[axis]; 2ad24: 80 91 fd 11 lds r24, 0x11FD ; 0x8011fd 2ad28: 90 91 fe 11 lds r25, 0x11FE ; 0x8011fe 2ad2c: a0 91 ff 11 lds r26, 0x11FF ; 0x8011ff 2ad30: b0 91 00 12 lds r27, 0x1200 ; 0x801200 2ad34: 80 93 9b 06 sts 0x069B, r24 ; 0x80069b 2ad38: 90 93 9c 06 sts 0x069C, r25 ; 0x80069c 2ad3c: a0 93 9d 06 sts 0x069D, r26 ; 0x80069d 2ad40: b0 93 9e 06 sts 0x069E, r27 ; 0x80069e feedrate = 0.0; 2ad44: 10 92 7a 02 sts 0x027A, r1 ; 0x80027a 2ad48: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b 2ad4c: 10 92 7c 02 sts 0x027C, r1 ; 0x80027c 2ad50: 10 92 7d 02 sts 0x027D, r1 ; 0x80027d endstops_hit_on_purpose(); 2ad54: 0f 94 22 2d call 0x25a44 ; 0x25a44 axis_known_position[axis] = true; 2ad58: f1 e0 ldi r31, 0x01 ; 1 2ad5a: f0 93 a5 06 sts 0x06A5, r31 ; 0x8006a5 2ad5e: 2e cf rjmp .-420 ; 0x2abbc 0002ad60 : #ifdef MESH_BED_LEVELING mesh_bed_leveling mbl; void mesh_bed_leveling::reset() { active = 0; 2ad60: 10 92 9c 12 sts 0x129C, r1 ; 0x80129c memset(z_values, 0, sizeof(z_values)); 2ad64: ed e9 ldi r30, 0x9D ; 157 2ad66: f2 e1 ldi r31, 0x12 ; 18 2ad68: 84 ec ldi r24, 0xC4 ; 196 2ad6a: df 01 movw r26, r30 2ad6c: 1d 92 st X+, r1 2ad6e: 8a 95 dec r24 2ad70: e9 f7 brne .-6 ; 0x2ad6c } 2ad72: 08 95 ret 0002ad74 : 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 2ad74: 2f 92 push r2 2ad76: 3f 92 push r3 2ad78: 4f 92 push r4 2ad7a: 5f 92 push r5 2ad7c: 6f 92 push r6 2ad7e: 7f 92 push r7 2ad80: 8f 92 push r8 2ad82: 9f 92 push r9 2ad84: af 92 push r10 2ad86: bf 92 push r11 2ad88: cf 92 push r12 2ad8a: df 92 push r13 2ad8c: ef 92 push r14 2ad8e: ff 92 push r15 2ad90: 0f 93 push r16 2ad92: 1f 93 push r17 2ad94: cf 93 push r28 2ad96: df 93 push r29 2ad98: 00 d0 rcall .+0 ; 0x2ad9a 2ad9a: cd b7 in r28, 0x3d ; 61 2ad9c: de b7 in r29, 0x3e ; 62 2ad9e: 4b 01 movw r8, r22 2ada0: 5c 01 movw r10, r24 2ada2: 04 2f mov r16, r20 verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; bedPWMDisabled = 1; 2ada4: 81 e0 ldi r24, 0x01 ; 1 2ada6: 80 93 92 06 sts 0x0692, r24 ; 0x800692 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 2adaa: 20 91 77 02 lds r18, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.364> 2adae: 29 83 std Y+1, r18 ; 0x01 check_endstops = check; 2adb0: 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); 2adb4: 80 e0 ldi r24, 0x00 ; 0 2adb6: 0f 94 06 2d call 0x25a0c ; 0x25a0c 2adba: 18 2f mov r17, r24 float z = 0.f; endstop_z_hit_on_purpose(); 2adbc: 0f 94 14 2d call 0x25a28 ; 0x25a28 // move down until you find the bed current_position[Z_AXIS] = minimum_z; 2adc0: 80 92 fd 11 sts 0x11FD, r8 ; 0x8011fd 2adc4: 90 92 fe 11 sts 0x11FE, r9 ; 0x8011fe 2adc8: a0 92 ff 11 sts 0x11FF, r10 ; 0x8011ff 2adcc: b0 92 00 12 sts 0x1200, r11 ; 0x801200 go_to_current(homing_feedrate[Z_AXIS]/60); 2add0: 65 e5 ldi r22, 0x55 ; 85 2add2: 75 e5 ldi r23, 0x55 ; 85 2add4: 85 e5 ldi r24, 0x55 ; 85 2add6: 91 e4 ldi r25, 0x41 ; 65 2add8: 0f 94 e1 87 call 0x30fc2 ; 0x30fc2 // 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(); 2addc: 0f 94 0f 8e call 0x31c1e ; 0x31c1e if (! endstop_z_hit_on_purpose()) 2ade0: 0f 94 14 2d call 0x25a28 ; 0x25a28 2ade4: 8b 83 std Y+3, r24 ; 0x03 2ade6: 88 23 and r24, r24 2ade8: 09 f4 brne .+2 ; 0x2adec 2adea: eb c0 rjmp .+470 ; 0x2afc2 { //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) 2adec: 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; 2adee: c1 2c mov r12, r1 2adf0: d1 2c mov r13, r1 2adf2: 76 01 movw r14, r12 #ifdef SUPPORT_VERBOSITY verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; 2adf4: 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) 2adf6: 8a 81 ldd r24, Y+2 ; 0x02 2adf8: 80 17 cp r24, r16 2adfa: 08 f0 brcs .+2 ; 0x2adfe 2adfc: a4 c0 rjmp .+328 ; 0x2af46 { current_position[Z_AXIS] += high_deviation_occured ? 0.5 : 0.2; 2adfe: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 2ae02: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 2ae06: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 2ae0a: 90 91 00 12 lds r25, 0x1200 ; 0x801200 2ae0e: 20 e0 ldi r18, 0x00 ; 0 2ae10: 30 e0 ldi r19, 0x00 ; 0 2ae12: 40 e0 ldi r20, 0x00 ; 0 2ae14: 5f e3 ldi r21, 0x3F ; 63 2ae16: 31 10 cpse r3, r1 2ae18: 04 c0 rjmp .+8 ; 0x2ae22 2ae1a: 2d ec ldi r18, 0xCD ; 205 2ae1c: 3c ec ldi r19, 0xCC ; 204 2ae1e: 4c e4 ldi r20, 0x4C ; 76 2ae20: 5e e3 ldi r21, 0x3E ; 62 2ae22: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2ae26: 2b 01 movw r4, r22 2ae28: 3c 01 movw r6, r24 2ae2a: 40 92 fd 11 sts 0x11FD, r4 ; 0x8011fd 2ae2e: 50 92 fe 11 sts 0x11FE, r5 ; 0x8011fe 2ae32: 60 92 ff 11 sts 0x11FF, r6 ; 0x8011ff 2ae36: 70 92 00 12 sts 0x1200, r7 ; 0x801200 float z_bckp = current_position[Z_AXIS]; go_to_current(homing_feedrate[Z_AXIS]/60); 2ae3a: 65 e5 ldi r22, 0x55 ; 85 2ae3c: 75 e5 ldi r23, 0x55 ; 85 2ae3e: 85 e5 ldi r24, 0x55 ; 85 2ae40: 91 e4 ldi r25, 0x41 ; 65 2ae42: 0f 94 e1 87 call 0x30fc2 ; 0x30fc2 // Move back down slowly to find bed. current_position[Z_AXIS] = minimum_z; 2ae46: 80 92 fd 11 sts 0x11FD, r8 ; 0x8011fd 2ae4a: 90 92 fe 11 sts 0x11FE, r9 ; 0x8011fe 2ae4e: a0 92 ff 11 sts 0x11FF, r10 ; 0x8011ff 2ae52: 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)); 2ae56: 65 e5 ldi r22, 0x55 ; 85 2ae58: 75 e5 ldi r23, 0x55 ; 85 2ae5a: 85 e5 ldi r24, 0x55 ; 85 2ae5c: 90 e4 ldi r25, 0x40 ; 64 2ae5e: 0f 94 e1 87 call 0x30fc2 ; 0x30fc2 // 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(); 2ae62: 0f 94 0f 8e call 0x31c1e ; 0x31c1e //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) { 2ae66: a3 01 movw r20, r6 2ae68: 92 01 movw r18, r4 2ae6a: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 2ae6e: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 2ae72: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 2ae76: 90 91 00 12 lds r25, 0x1200 ; 0x801200 2ae7a: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 2ae7e: 9f 77 andi r25, 0x7F ; 127 2ae80: 2d ec ldi r18, 0xCD ; 205 2ae82: 3c ec ldi r19, 0xCC ; 204 2ae84: 4c ec ldi r20, 0xCC ; 204 2ae86: 5c e3 ldi r21, 0x3C ; 60 2ae88: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 2ae8c: 87 ff sbrs r24, 7 2ae8e: 16 c0 rjmp .+44 ; 0x2aebc //printf_P(PSTR("PINDA triggered immediately, move Z higher and repeat measurement\n")); raise_z(0.5); 2ae90: 60 e0 ldi r22, 0x00 ; 0 2ae92: 70 e0 ldi r23, 0x00 ; 0 2ae94: 80 e0 ldi r24, 0x00 ; 0 2ae96: 9f e3 ldi r25, 0x3F ; 63 2ae98: 0e 94 d3 66 call 0xcda6 ; 0xcda6 current_position[Z_AXIS] = minimum_z; 2ae9c: 80 92 fd 11 sts 0x11FD, r8 ; 0x8011fd 2aea0: 90 92 fe 11 sts 0x11FE, r9 ; 0x8011fe 2aea4: a0 92 ff 11 sts 0x11FF, r10 ; 0x8011ff 2aea8: b0 92 00 12 sts 0x1200, r11 ; 0x801200 go_to_current(homing_feedrate[Z_AXIS]/(4*60)); 2aeac: 65 e5 ldi r22, 0x55 ; 85 2aeae: 75 e5 ldi r23, 0x55 ; 85 2aeb0: 85 e5 ldi r24, 0x55 ; 85 2aeb2: 90 e4 ldi r25, 0x40 ; 64 2aeb4: 0f 94 e1 87 call 0x30fc2 ; 0x30fc2 // 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(); 2aeb8: 0f 94 0f 8e call 0x31c1e ; 0x31c1e } if (!endstop_z_hit_on_purpose()) 2aebc: 0f 94 14 2d call 0x25a28 ; 0x25a28 2aec0: 28 2e mov r2, r24 2aec2: 88 23 and r24, r24 2aec4: 09 f4 brne .+2 ; 0x2aec8 2aec6: 7d c0 rjmp .+250 ; 0x2afc2 2aec8: 40 90 fd 11 lds r4, 0x11FD ; 0x8011fd 2aecc: 50 90 fe 11 lds r5, 0x11FE ; 0x8011fe 2aed0: 60 90 ff 11 lds r6, 0x11FF ; 0x8011ff 2aed4: 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; 2aed8: 9a 81 ldd r25, Y+2 ; 0x02 2aeda: 99 23 and r25, r25 2aedc: d9 f0 breq .+54 ; 0x2af14 2aede: 69 2f mov r22, r25 2aee0: 70 e0 ldi r23, 0x00 ; 0 2aee2: 90 e0 ldi r25, 0x00 ; 0 2aee4: 80 e0 ldi r24, 0x00 ; 0 2aee6: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2aeea: 9b 01 movw r18, r22 2aeec: ac 01 movw r20, r24 2aeee: c7 01 movw r24, r14 2aef0: b6 01 movw r22, r12 2aef2: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2aef6: 9b 01 movw r18, r22 2aef8: ac 01 movw r20, r24 2aefa: c3 01 movw r24, r6 2aefc: b2 01 movw r22, r4 2aefe: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 2af02: 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 2af04: 2d ec ldi r18, 0xCD ; 205 2af06: 3c ec ldi r19, 0xCC ; 204 2af08: 4c e4 ldi r20, 0x4C ; 76 2af0a: 5d e3 ldi r21, 0x3D ; 61 2af0c: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 2af10: 18 16 cp r1, r24 2af12: 64 f0 brlt .+24 ; 0x2af2c #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]; 2af14: a3 01 movw r20, r6 2af16: 92 01 movw r18, r4 2af18: c7 01 movw r24, r14 2af1a: b6 01 movw r22, r12 2af1c: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2af20: 6b 01 movw r12, r22 2af22: 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) 2af24: 8a 81 ldd r24, Y+2 ; 0x02 2af26: 8f 5f subi r24, 0xFF ; 255 2af28: 8a 83 std Y+2, r24 ; 0x02 2af2a: 65 cf rjmp .-310 ; 0x2adf6 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 2af2c: 31 10 cpse r3, r1 2af2e: 49 c0 rjmp .+146 ; 0x2afc2 //printf_P(PSTR("high dev. first occurence\n")); delay_keep_alive(500); //damping 2af30: 84 ef ldi r24, 0xF4 ; 244 2af32: 91 e0 ldi r25, 0x01 ; 1 2af34: 0e 94 45 7c call 0xf88a ; 0xf88a //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; 2af38: 32 2c mov r3, r2 i = -1; 2af3a: 2f ef ldi r18, 0xFF ; 255 2af3c: 2a 83 std Y+2, r18 ; 0x02 z = 0; 2af3e: c1 2c mov r12, r1 2af40: d1 2c mov r13, r1 2af42: 76 01 movw r14, r12 2af44: ef cf rjmp .-34 ; 0x2af24 } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; if (n_iter > 1) 2af46: 02 30 cpi r16, 0x02 ; 2 2af48: 38 f5 brcc .+78 ; 0x2af98 goto error; } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; 2af4a: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 2af4e: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 2af52: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 2af56: f0 92 00 12 sts 0x1200, r15 ; 0x801200 2af5a: 99 81 ldd r25, Y+1 ; 0x01 2af5c: 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); 2af60: 81 2f mov r24, r17 2af62: 0f 94 06 2d call 0x25a0c ; 0x25a0c // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 3"); #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; 2af66: 10 92 92 06 sts 0x0692, r1 ; 0x800692 #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; return false; } 2af6a: 8b 81 ldd r24, Y+3 ; 0x03 2af6c: 0f 90 pop r0 2af6e: 0f 90 pop r0 2af70: 0f 90 pop r0 2af72: df 91 pop r29 2af74: cf 91 pop r28 2af76: 1f 91 pop r17 2af78: 0f 91 pop r16 2af7a: ff 90 pop r15 2af7c: ef 90 pop r14 2af7e: df 90 pop r13 2af80: cf 90 pop r12 2af82: bf 90 pop r11 2af84: af 90 pop r10 2af86: 9f 90 pop r9 2af88: 8f 90 pop r8 2af8a: 7f 90 pop r7 2af8c: 6f 90 pop r6 2af8e: 5f 90 pop r5 2af90: 4f 90 pop r4 2af92: 3f 90 pop r3 2af94: 2f 90 pop r2 2af96: 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); 2af98: 60 2f mov r22, r16 2af9a: 70 e0 ldi r23, 0x00 ; 0 2af9c: 90 e0 ldi r25, 0x00 ; 0 2af9e: 80 e0 ldi r24, 0x00 ; 0 2afa0: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 2afa4: 9b 01 movw r18, r22 2afa6: ac 01 movw r20, r24 2afa8: c7 01 movw r24, r14 2afaa: b6 01 movw r22, r12 2afac: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2afb0: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 2afb4: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 2afb8: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 2afbc: 90 93 00 12 sts 0x1200, r25 ; 0x801200 2afc0: cc cf rjmp .-104 ; 0x2af5a 2afc2: 29 81 ldd r18, Y+1 ; 0x01 2afc4: 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); 2afc8: 81 2f mov r24, r17 2afca: 0f 94 06 2d call 0x25a0c ; 0x25a0c #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; 2afce: 10 92 92 06 sts 0x0692, r1 ; 0x800692 return false; 2afd2: 1b 82 std Y+3, r1 ; 0x03 2afd4: ca cf rjmp .-108 ; 0x2af6a 0002afd6 : /// 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){ 2afd6: 2f 92 push r2 2afd8: 3f 92 push r3 2afda: 4f 92 push r4 2afdc: 5f 92 push r5 2afde: 6f 92 push r6 2afe0: 7f 92 push r7 2afe2: 8f 92 push r8 2afe4: 9f 92 push r9 2afe6: af 92 push r10 2afe8: bf 92 push r11 2afea: cf 92 push r12 2afec: df 92 push r13 2afee: ef 92 push r14 2aff0: ff 92 push r15 2aff2: 0f 93 push r16 2aff4: 1f 93 push r17 2aff6: cf 93 push r28 2aff8: df 93 push r29 2affa: cd b7 in r28, 0x3d ; 61 2affc: de b7 in r29, 0x3e ; 62 2affe: cd 5b subi r28, 0xBD ; 189 2b000: d1 40 sbci r29, 0x01 ; 1 2b002: 0f b6 in r0, 0x3f ; 63 2b004: f8 94 cli 2b006: de bf out 0x3e, r29 ; 62 2b008: 0f be out 0x3f, r0 ; 63 2b00a: cd bf out 0x3d, r28 ; 61 2b00c: c3 57 subi r28, 0x73 ; 115 2b00e: de 4f sbci r29, 0xFE ; 254 2b010: 99 83 std Y+1, r25 ; 0x01 2b012: 88 83 st Y, r24 2b014: cd 58 subi r28, 0x8D ; 141 2b016: d1 40 sbci r29, 0x01 ; 1 2b018: c1 57 subi r28, 0x71 ; 113 2b01a: de 4f sbci r29, 0xFE ; 254 2b01c: 79 83 std Y+1, r23 ; 0x01 2b01e: 68 83 st Y, r22 2b020: cf 58 subi r28, 0x8F ; 143 2b022: d1 40 sbci r29, 0x01 ; 1 2b024: ce 56 subi r28, 0x6E ; 110 2b026: de 4f sbci r29, 0xFE ; 254 2b028: 59 83 std Y+1, r21 ; 0x01 2b02a: 48 83 st Y, r20 2b02c: c2 59 subi r28, 0x92 ; 146 2b02e: d1 40 sbci r29, 0x01 ; 1 2b030: 84 e1 ldi r24, 0x14 ; 20 2b032: cf 56 subi r28, 0x6F ; 111 2b034: de 4f sbci r29, 0xFE ; 254 2b036: 88 83 st Y, r24 2b038: c1 59 subi r28, 0x91 ; 145 2b03a: 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; 2b03c: ce 56 subi r28, 0x6E ; 110 2b03e: de 4f sbci r29, 0xFE ; 254 2b040: a8 81 ld r26, Y 2b042: b9 81 ldd r27, Y+1 ; 0x01 2b044: c2 59 subi r28, 0x92 ; 146 2b046: d1 40 sbci r29, 0x01 ; 1 2b048: 8d 91 ld r24, X+ 2b04a: 9d 91 ld r25, X+ 2b04c: 0d 90 ld r0, X+ 2b04e: bc 91 ld r27, X 2b050: a0 2d mov r26, r0 2b052: c6 56 subi r28, 0x66 ; 102 2b054: de 4f sbci r29, 0xFE ; 254 2b056: 88 83 st Y, r24 2b058: 99 83 std Y+1, r25 ; 0x01 2b05a: aa 83 std Y+2, r26 ; 0x02 2b05c: bb 83 std Y+3, r27 ; 0x03 2b05e: ca 59 subi r28, 0x9A ; 154 2b060: d1 40 sbci r29, 0x01 ; 1 2b062: c1 57 subi r28, 0x71 ; 113 2b064: de 4f sbci r29, 0xFE ; 254 2b066: a8 81 ld r26, Y 2b068: b9 81 ldd r27, Y+1 ; 0x01 2b06a: cf 58 subi r28, 0x8F ; 143 2b06c: d1 40 sbci r29, 0x01 ; 1 2b06e: 8d 91 ld r24, X+ 2b070: 9d 91 ld r25, X+ 2b072: 0d 90 ld r0, X+ 2b074: bc 91 ld r27, X 2b076: a0 2d mov r26, r0 2b078: ca 54 subi r28, 0x4A ; 74 2b07a: de 4f sbci r29, 0xFE ; 254 2b07c: 88 83 st Y, r24 2b07e: 99 83 std Y+1, r25 ; 0x01 2b080: aa 83 std Y+2, r26 ; 0x02 2b082: bb 83 std Y+3, r27 ; 0x03 2b084: c6 5b subi r28, 0xB6 ; 182 2b086: d1 40 sbci r29, 0x01 ; 1 2b088: c3 57 subi r28, 0x73 ; 115 2b08a: de 4f sbci r29, 0xFE ; 254 2b08c: a8 81 ld r26, Y 2b08e: b9 81 ldd r27, Y+1 ; 0x01 2b090: cd 58 subi r28, 0x8D ; 141 2b092: d1 40 sbci r29, 0x01 ; 1 2b094: 8d 91 ld r24, X+ 2b096: 9d 91 ld r25, X+ 2b098: 0d 90 ld r0, X+ 2b09a: bc 91 ld r27, X 2b09c: a0 2d mov r26, r0 2b09e: c6 54 subi r28, 0x46 ; 70 2b0a0: de 4f sbci r29, 0xFE ; 254 2b0a2: 88 83 st Y, r24 2b0a4: 99 83 std Y+1, r25 ; 0x01 2b0a6: aa 83 std Y+2, r26 ; 0x02 2b0a8: bb 83 std Y+3, r27 ; 0x03 2b0aa: ca 5b subi r28, 0xBA ; 186 2b0ac: d1 40 sbci r29, 0x01 ; 1 2b0ae: fe 01 movw r30, r28 2b0b0: e7 5f subi r30, 0xF7 ; 247 2b0b2: fe 4f sbci r31, 0xFE ; 254 2b0b4: c8 55 subi r28, 0x58 ; 88 2b0b6: de 4f sbci r29, 0xFE ; 254 2b0b8: f9 83 std Y+1, r31 ; 0x01 2b0ba: e8 83 st Y, r30 2b0bc: c8 5a subi r28, 0xA8 ; 168 2b0be: d1 40 sbci r29, 0x01 ; 1 2b0c0: ce 01 movw r24, r28 2b0c2: 8b 57 subi r24, 0x7B ; 123 2b0c4: 9f 4f sbci r25, 0xFF ; 255 2b0c6: ca 55 subi r28, 0x5A ; 90 2b0c8: de 4f sbci r29, 0xFE ; 254 2b0ca: 99 83 std Y+1, r25 ; 0x01 2b0cc: 88 83 st Y, r24 2b0ce: c6 5a subi r28, 0xA6 ; 166 2b0d0: d1 40 sbci r29, 0x01 ; 1 2b0d2: de 01 movw r26, r28 2b0d4: 11 96 adiw r26, 0x01 ; 1 2b0d6: c8 56 subi r28, 0x68 ; 104 2b0d8: de 4f sbci r29, 0xFE ; 254 2b0da: b9 83 std Y+1, r27 ; 0x01 2b0dc: a8 83 st Y, r26 2b0de: c8 59 subi r28, 0x98 ; 152 2b0e0: d1 40 sbci r29, 0x01 ; 1 2b0e2: 31 2c mov r3, r1 2b0e4: 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; 2b0e6: b1 01 movw r22, r2 2b0e8: 03 2c mov r0, r3 2b0ea: 00 0c add r0, r0 2b0ec: 88 0b sbc r24, r24 2b0ee: 99 0b sbc r25, r25 2b0f0: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2b0f4: 2a e1 ldi r18, 0x1A ; 26 2b0f6: 38 ef ldi r19, 0xF8 ; 248 2b0f8: 42 e4 ldi r20, 0x42 ; 66 2b0fa: 5e e3 ldi r21, 0x3E ; 62 2b0fc: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2b100: 6b 01 movw r12, r22 2b102: 7c 01 movw r14, r24 const float height = get_value(matrix_32x32, r * cos(angle) + x, r * sin(angle) + y) - target_z; 2b104: 0f 94 83 a5 call 0x34b06 ; 0x34b06 2b108: c2 56 subi r28, 0x62 ; 98 2b10a: de 4f sbci r29, 0xFE ; 254 2b10c: 68 83 st Y, r22 2b10e: 79 83 std Y+1, r23 ; 0x01 2b110: 8a 83 std Y+2, r24 ; 0x02 2b112: 9b 83 std Y+3, r25 ; 0x03 2b114: ce 59 subi r28, 0x9E ; 158 2b116: d1 40 sbci r29, 0x01 ; 1 2b118: c7 01 movw r24, r14 2b11a: b6 01 movw r22, r12 2b11c: 0f 94 bd a2 call 0x3457a ; 0x3457a 2b120: ce 55 subi r28, 0x5E ; 94 2b122: de 4f sbci r29, 0xFE ; 254 2b124: 68 83 st Y, r22 2b126: 79 83 std Y+1, r23 ; 0x01 2b128: 8a 83 std Y+2, r24 ; 0x02 2b12a: 9b 83 std Y+3, r25 ; 0x03 2b12c: c2 5a subi r28, 0xA2 ; 162 2b12e: d1 40 sbci r29, 0x01 ; 1 2b130: 9b 01 movw r18, r22 2b132: ac 01 movw r20, r24 2b134: c6 56 subi r28, 0x66 ; 102 2b136: de 4f sbci r29, 0xFE ; 254 2b138: 68 81 ld r22, Y 2b13a: 79 81 ldd r23, Y+1 ; 0x01 2b13c: 8a 81 ldd r24, Y+2 ; 0x02 2b13e: 9b 81 ldd r25, Y+3 ; 0x03 2b140: ca 59 subi r28, 0x9A ; 154 2b142: d1 40 sbci r29, 0x01 ; 1 2b144: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2b148: c6 54 subi r28, 0x46 ; 70 2b14a: de 4f sbci r29, 0xFE ; 254 2b14c: 28 81 ld r18, Y 2b14e: 39 81 ldd r19, Y+1 ; 0x01 2b150: 4a 81 ldd r20, Y+2 ; 0x02 2b152: 5b 81 ldd r21, Y+3 ; 0x03 2b154: ca 5b subi r28, 0xBA ; 186 2b156: d1 40 sbci r29, 0x01 ; 1 2b158: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2b15c: 6b 01 movw r12, r22 2b15e: 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) 2b160: 20 e0 ldi r18, 0x00 ; 0 2b162: 30 e0 ldi r19, 0x00 ; 0 2b164: a9 01 movw r20, r18 2b166: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 2b16a: 18 16 cp r1, r24 2b16c: 0c f0 brlt .+2 ; 0x2b170 2b16e: 7a c2 rjmp .+1268 ; 0x2b664 // 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; 2b170: c2 56 subi r28, 0x62 ; 98 2b172: de 4f sbci r29, 0xFE ; 254 2b174: 28 81 ld r18, Y 2b176: 39 81 ldd r19, Y+1 ; 0x01 2b178: 4a 81 ldd r20, Y+2 ; 0x02 2b17a: 5b 81 ldd r21, Y+3 ; 0x03 2b17c: ce 59 subi r28, 0x9E ; 158 2b17e: d1 40 sbci r29, 0x01 ; 1 2b180: c6 56 subi r28, 0x66 ; 102 2b182: de 4f sbci r29, 0xFE ; 254 2b184: 68 81 ld r22, Y 2b186: 79 81 ldd r23, Y+1 ; 0x01 2b188: 8a 81 ldd r24, Y+2 ; 0x02 2b18a: 9b 81 ldd r25, Y+3 ; 0x03 2b18c: ca 59 subi r28, 0x9A ; 154 2b18e: d1 40 sbci r29, 0x01 ; 1 2b190: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2b194: ca 54 subi r28, 0x4A ; 74 2b196: de 4f sbci r29, 0xFE ; 254 2b198: 28 81 ld r18, Y 2b19a: 39 81 ldd r19, Y+1 ; 0x01 2b19c: 4a 81 ldd r20, Y+2 ; 0x02 2b19e: 5b 81 ldd r21, Y+3 ; 0x03 2b1a0: c6 5b subi r28, 0xB6 ; 182 2b1a2: d1 40 sbci r29, 0x01 ; 1 2b1a4: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2b1a8: 4b 01 movw r8, r22 2b1aa: 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) 2b1ac: 20 e0 ldi r18, 0x00 ; 0 2b1ae: 30 e0 ldi r19, 0x00 ; 0 2b1b0: a9 01 movw r20, r18 2b1b2: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 2b1b6: 18 16 cp r1, r24 2b1b8: 0c f0 brlt .+2 ; 0x2b1bc 2b1ba: 54 c2 rjmp .+1192 ; 0x2b664 2b1bc: 20 e0 ldi r18, 0x00 ; 0 2b1be: 30 e0 ldi r19, 0x00 ; 0 2b1c0: 48 ef ldi r20, 0xF8 ; 248 2b1c2: 51 e4 ldi r21, 0x41 ; 65 2b1c4: c7 01 movw r24, r14 2b1c6: b6 01 movw r22, r12 2b1c8: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 2b1cc: 87 ff sbrs r24, 7 2b1ce: 4a c2 rjmp .+1172 ; 0x2b664 2b1d0: 20 e0 ldi r18, 0x00 ; 0 2b1d2: 30 e0 ldi r19, 0x00 ; 0 2b1d4: 48 ef ldi r20, 0xF8 ; 248 2b1d6: 51 e4 ldi r21, 0x41 ; 65 2b1d8: c5 01 movw r24, r10 2b1da: b4 01 movw r22, r8 2b1dc: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 2b1e0: 87 ff sbrs r24, 7 2b1e2: 40 c2 rjmp .+1152 ; 0x2b664 return 0; /// calculate weights of nearby points const float wc1 = c - floor(c); 2b1e4: c7 01 movw r24, r14 2b1e6: b6 01 movw r22, r12 2b1e8: 0f 94 6a a3 call 0x346d4 ; 0x346d4 2b1ec: 9b 01 movw r18, r22 2b1ee: ac 01 movw r20, r24 2b1f0: c7 01 movw r24, r14 2b1f2: b6 01 movw r22, r12 2b1f4: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 2b1f8: 2b 01 movw r4, r22 2b1fa: 3c 01 movw r6, r24 const float wr1 = r - floor(r); 2b1fc: c5 01 movw r24, r10 2b1fe: b4 01 movw r22, r8 2b200: 0f 94 6a a3 call 0x346d4 ; 0x346d4 2b204: 9b 01 movw r18, r22 2b206: ac 01 movw r20, r24 2b208: c5 01 movw r24, r10 2b20a: b4 01 movw r22, r8 2b20c: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 2b210: cc 56 subi r28, 0x6C ; 108 2b212: de 4f sbci r29, 0xFE ; 254 2b214: 68 83 st Y, r22 2b216: 79 83 std Y+1, r23 ; 0x01 2b218: 8a 83 std Y+2, r24 ; 0x02 2b21a: 9b 83 std Y+3, r25 ; 0x03 2b21c: c4 59 subi r28, 0x94 ; 148 2b21e: d1 40 sbci r29, 0x01 ; 1 const float wc0 = 1 - wc1; 2b220: a3 01 movw r20, r6 2b222: 92 01 movw r18, r4 2b224: 60 e0 ldi r22, 0x00 ; 0 2b226: 70 e0 ldi r23, 0x00 ; 0 2b228: 80 e8 ldi r24, 0x80 ; 128 2b22a: 9f e3 ldi r25, 0x3F ; 63 2b22c: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 2b230: c2 55 subi r28, 0x52 ; 82 2b232: de 4f sbci r29, 0xFE ; 254 2b234: 68 83 st Y, r22 2b236: 79 83 std Y+1, r23 ; 0x01 2b238: 8a 83 std Y+2, r24 ; 0x02 2b23a: 9b 83 std Y+3, r25 ; 0x03 2b23c: ce 5a subi r28, 0xAE ; 174 2b23e: d1 40 sbci r29, 0x01 ; 1 const float wr0 = 1 - wr1; 2b240: cc 56 subi r28, 0x6C ; 108 2b242: de 4f sbci r29, 0xFE ; 254 2b244: 28 81 ld r18, Y 2b246: 39 81 ldd r19, Y+1 ; 0x01 2b248: 4a 81 ldd r20, Y+2 ; 0x02 2b24a: 5b 81 ldd r21, Y+3 ; 0x03 2b24c: c4 59 subi r28, 0x94 ; 148 2b24e: d1 40 sbci r29, 0x01 ; 1 2b250: 60 e0 ldi r22, 0x00 ; 0 2b252: 70 e0 ldi r23, 0x00 ; 0 2b254: 80 e8 ldi r24, 0x80 ; 128 2b256: 9f e3 ldi r25, 0x3F ; 63 2b258: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 2b25c: ce 54 subi r28, 0x4E ; 78 2b25e: de 4f sbci r29, 0xFE ; 254 2b260: 68 83 st Y, r22 2b262: 79 83 std Y+1, r23 ; 0x01 2b264: 8a 83 std Y+2, r24 ; 0x02 2b266: 9b 83 std Y+3, r25 ; 0x03 2b268: c2 5b subi r28, 0xB2 ; 178 2b26a: 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; 2b26c: c7 01 movw r24, r14 2b26e: b6 01 movw r22, r12 2b270: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 2b274: 6b 01 movw r12, r22 const uint16_t c1 = c0 + 1; 2b276: fb 01 movw r30, r22 2b278: 31 96 adiw r30, 0x01 ; 1 2b27a: c6 55 subi r28, 0x56 ; 86 2b27c: de 4f sbci r29, 0xFE ; 254 2b27e: f9 83 std Y+1, r31 ; 0x01 2b280: e8 83 st Y, r30 2b282: ca 5a subi r28, 0xAA ; 170 2b284: d1 40 sbci r29, 0x01 ; 1 const uint16_t r0 = r; 2b286: c5 01 movw r24, r10 2b288: b4 01 movw r22, r8 2b28a: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> const uint16_t r1 = r0 + 1; const uint16_t idx00 = c0 + 32 * r0; 2b28e: 8b 01 movw r16, r22 2b290: 95 e0 ldi r25, 0x05 ; 5 2b292: 00 0f add r16, r16 2b294: 11 1f adc r17, r17 2b296: 9a 95 dec r25 2b298: e1 f7 brne .-8 ; 0x2b292 const uint16_t idx01 = c0 + 32 * r1; 2b29a: c8 01 movw r24, r16 2b29c: 80 96 adiw r24, 0x20 ; 32 2b29e: c4 55 subi r28, 0x54 ; 84 2b2a0: de 4f sbci r29, 0xFE ; 254 2b2a2: 99 83 std Y+1, r25 ; 0x01 2b2a4: 88 83 st Y, r24 2b2a6: cc 5a subi r28, 0xAC ; 172 2b2a8: 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]; 2b2aa: f8 01 movw r30, r16 2b2ac: ec 0d add r30, r12 2b2ae: fd 1d adc r31, r13 2b2b0: e8 53 subi r30, 0x38 ; 56 2b2b2: f9 4f sbci r31, 0xF9 ; 249 2b2b4: 60 81 ld r22, Z 2b2b6: 70 e0 ldi r23, 0x00 ; 0 2b2b8: 90 e0 ldi r25, 0x00 ; 0 2b2ba: 80 e0 ldi r24, 0x00 ; 0 2b2bc: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2b2c0: 4b 01 movw r8, r22 2b2c2: 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; 2b2c4: ce 54 subi r28, 0x4E ; 78 2b2c6: de 4f sbci r29, 0xFE ; 254 2b2c8: 28 81 ld r18, Y 2b2ca: 39 81 ldd r19, Y+1 ; 0x01 2b2cc: 4a 81 ldd r20, Y+2 ; 0x02 2b2ce: 5b 81 ldd r21, Y+3 ; 0x03 2b2d0: c2 5b subi r28, 0xB2 ; 178 2b2d2: d1 40 sbci r29, 0x01 ; 1 2b2d4: c2 55 subi r28, 0x52 ; 82 2b2d6: de 4f sbci r29, 0xFE ; 254 2b2d8: 68 81 ld r22, Y 2b2da: 79 81 ldd r23, Y+1 ; 0x01 2b2dc: 8a 81 ldd r24, Y+2 ; 0x02 2b2de: 9b 81 ldd r25, Y+3 ; 0x03 2b2e0: ce 5a subi r28, 0xAE ; 174 2b2e2: d1 40 sbci r29, 0x01 ; 1 2b2e4: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2b2e8: 9b 01 movw r18, r22 2b2ea: 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]; 2b2ec: c5 01 movw r24, r10 2b2ee: b4 01 movw r22, r8 2b2f0: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2b2f4: 4b 01 movw r8, r22 2b2f6: 5c 01 movw r10, r24 2b2f8: c4 55 subi r28, 0x54 ; 84 2b2fa: de 4f sbci r29, 0xFE ; 254 2b2fc: e8 81 ld r30, Y 2b2fe: f9 81 ldd r31, Y+1 ; 0x01 2b300: cc 5a subi r28, 0xAC ; 172 2b302: d1 40 sbci r29, 0x01 ; 1 2b304: ec 0d add r30, r12 2b306: fd 1d adc r31, r13 2b308: e8 53 subi r30, 0x38 ; 56 2b30a: f9 4f sbci r31, 0xF9 ; 249 2b30c: 60 81 ld r22, Z 2b30e: 70 e0 ldi r23, 0x00 ; 0 2b310: 90 e0 ldi r25, 0x00 ; 0 2b312: 80 e0 ldi r24, 0x00 ; 0 2b314: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2b318: 6b 01 movw r12, r22 2b31a: 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; 2b31c: c2 55 subi r28, 0x52 ; 82 2b31e: de 4f sbci r29, 0xFE ; 254 2b320: 28 81 ld r18, Y 2b322: 39 81 ldd r19, Y+1 ; 0x01 2b324: 4a 81 ldd r20, Y+2 ; 0x02 2b326: 5b 81 ldd r21, Y+3 ; 0x03 2b328: ce 5a subi r28, 0xAE ; 174 2b32a: d1 40 sbci r29, 0x01 ; 1 2b32c: cc 56 subi r28, 0x6C ; 108 2b32e: de 4f sbci r29, 0xFE ; 254 2b330: 68 81 ld r22, Y 2b332: 79 81 ldd r23, Y+1 ; 0x01 2b334: 8a 81 ldd r24, Y+2 ; 0x02 2b336: 9b 81 ldd r25, Y+3 ; 0x03 2b338: c4 59 subi r28, 0x94 ; 148 2b33a: d1 40 sbci r29, 0x01 ; 1 2b33c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2b340: 9b 01 movw r18, r22 2b342: 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]; 2b344: c7 01 movw r24, r14 2b346: b6 01 movw r22, r12 2b348: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2b34c: 9b 01 movw r18, r22 2b34e: ac 01 movw r20, r24 2b350: c5 01 movw r24, r10 2b352: b4 01 movw r22, r8 2b354: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2b358: 6b 01 movw r12, r22 2b35a: 7c 01 movw r14, r24 2b35c: c6 55 subi r28, 0x56 ; 86 2b35e: de 4f sbci r29, 0xFE ; 254 2b360: a8 81 ld r26, Y 2b362: b9 81 ldd r27, Y+1 ; 0x01 2b364: ca 5a subi r28, 0xAA ; 170 2b366: d1 40 sbci r29, 0x01 ; 1 2b368: 0a 0f add r16, r26 2b36a: 1b 1f adc r17, r27 2b36c: f8 01 movw r30, r16 2b36e: e8 53 subi r30, 0x38 ; 56 2b370: f9 4f sbci r31, 0xF9 ; 249 2b372: 60 81 ld r22, Z 2b374: 70 e0 ldi r23, 0x00 ; 0 2b376: 90 e0 ldi r25, 0x00 ; 0 2b378: 80 e0 ldi r24, 0x00 ; 0 2b37a: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2b37e: 4b 01 movw r8, r22 2b380: 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; 2b382: ce 54 subi r28, 0x4E ; 78 2b384: de 4f sbci r29, 0xFE ; 254 2b386: 28 81 ld r18, Y 2b388: 39 81 ldd r19, Y+1 ; 0x01 2b38a: 4a 81 ldd r20, Y+2 ; 0x02 2b38c: 5b 81 ldd r21, Y+3 ; 0x03 2b38e: c2 5b subi r28, 0xB2 ; 178 2b390: d1 40 sbci r29, 0x01 ; 1 2b392: c3 01 movw r24, r6 2b394: b2 01 movw r22, r4 2b396: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2b39a: 9b 01 movw r18, r22 2b39c: 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]; 2b39e: c5 01 movw r24, r10 2b3a0: b4 01 movw r22, r8 2b3a2: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2b3a6: 9b 01 movw r18, r22 2b3a8: ac 01 movw r20, r24 2b3aa: c7 01 movw r24, r14 2b3ac: b6 01 movw r22, r12 2b3ae: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2b3b2: 6b 01 movw r12, r22 2b3b4: 7c 01 movw r14, r24 2b3b6: c6 55 subi r28, 0x56 ; 86 2b3b8: de 4f sbci r29, 0xFE ; 254 2b3ba: e8 81 ld r30, Y 2b3bc: f9 81 ldd r31, Y+1 ; 0x01 2b3be: ca 5a subi r28, 0xAA ; 170 2b3c0: d1 40 sbci r29, 0x01 ; 1 2b3c2: c4 55 subi r28, 0x54 ; 84 2b3c4: de 4f sbci r29, 0xFE ; 254 2b3c6: 88 81 ld r24, Y 2b3c8: 99 81 ldd r25, Y+1 ; 0x01 2b3ca: cc 5a subi r28, 0xAC ; 172 2b3cc: d1 40 sbci r29, 0x01 ; 1 2b3ce: e8 0f add r30, r24 2b3d0: f9 1f adc r31, r25 2b3d2: e8 53 subi r30, 0x38 ; 56 2b3d4: f9 4f sbci r31, 0xF9 ; 249 2b3d6: 60 81 ld r22, Z 2b3d8: 70 e0 ldi r23, 0x00 ; 0 2b3da: 90 e0 ldi r25, 0x00 ; 0 2b3dc: 80 e0 ldi r24, 0x00 ; 0 2b3de: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2b3e2: 4b 01 movw r8, r22 2b3e4: 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; 2b3e6: cc 56 subi r28, 0x6C ; 108 2b3e8: de 4f sbci r29, 0xFE ; 254 2b3ea: 28 81 ld r18, Y 2b3ec: 39 81 ldd r19, Y+1 ; 0x01 2b3ee: 4a 81 ldd r20, Y+2 ; 0x02 2b3f0: 5b 81 ldd r21, Y+3 ; 0x03 2b3f2: c4 59 subi r28, 0x94 ; 148 2b3f4: d1 40 sbci r29, 0x01 ; 1 2b3f6: c3 01 movw r24, r6 2b3f8: b2 01 movw r22, r4 2b3fa: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2b3fe: 9b 01 movw r18, r22 2b400: 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]; 2b402: c5 01 movw r24, r10 2b404: b4 01 movw r22, r8 2b406: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2b40a: 9b 01 movw r18, r22 2b40c: ac 01 movw r20, r24 2b40e: c7 01 movw r24, r14 2b410: b6 01 movw r22, r12 2b412: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__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; 2b416: 20 e0 ldi r18, 0x00 ; 0 2b418: 30 e0 ldi r19, 0x00 ; 0 2b41a: 40 e0 ldi r20, 0x00 ; 0 2b41c: 52 e4 ldi r21, 0x42 ; 66 2b41e: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 2b422: 6b 01 movw r12, r22 2b424: 7c 01 movw r14, r24 // DBG(_n("%f "), point); shifts_x[p] = cos(angle) * height; 2b426: ac 01 movw r20, r24 2b428: 9b 01 movw r18, r22 2b42a: ce 55 subi r28, 0x5E ; 94 2b42c: de 4f sbci r29, 0xFE ; 254 2b42e: 68 81 ld r22, Y 2b430: 79 81 ldd r23, Y+1 ; 0x01 2b432: 8a 81 ldd r24, Y+2 ; 0x02 2b434: 9b 81 ldd r25, Y+3 ; 0x03 2b436: c2 5a subi r28, 0xA2 ; 162 2b438: d1 40 sbci r29, 0x01 ; 1 2b43a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2b43e: c8 55 subi r28, 0x58 ; 88 2b440: de 4f sbci r29, 0xFE ; 254 2b442: a8 81 ld r26, Y 2b444: b9 81 ldd r27, Y+1 ; 0x01 2b446: c8 5a subi r28, 0xA8 ; 168 2b448: d1 40 sbci r29, 0x01 ; 1 2b44a: 6d 93 st X+, r22 2b44c: 7d 93 st X+, r23 2b44e: 8d 93 st X+, r24 2b450: 9d 93 st X+, r25 2b452: c8 55 subi r28, 0x58 ; 88 2b454: de 4f sbci r29, 0xFE ; 254 2b456: b9 83 std Y+1, r27 ; 0x01 2b458: a8 83 st Y, r26 2b45a: c8 5a subi r28, 0xA8 ; 168 2b45c: d1 40 sbci r29, 0x01 ; 1 shifts_y[p] = sin(angle) * height; 2b45e: a7 01 movw r20, r14 2b460: 96 01 movw r18, r12 2b462: c2 56 subi r28, 0x62 ; 98 2b464: de 4f sbci r29, 0xFE ; 254 2b466: 68 81 ld r22, Y 2b468: 79 81 ldd r23, Y+1 ; 0x01 2b46a: 8a 81 ldd r24, Y+2 ; 0x02 2b46c: 9b 81 ldd r25, Y+3 ; 0x03 2b46e: ce 59 subi r28, 0x9E ; 158 2b470: d1 40 sbci r29, 0x01 ; 1 2b472: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2b476: ca 55 subi r28, 0x5A ; 90 2b478: de 4f sbci r29, 0xFE ; 254 2b47a: e8 81 ld r30, Y 2b47c: f9 81 ldd r31, Y+1 ; 0x01 2b47e: c6 5a subi r28, 0xA6 ; 166 2b480: d1 40 sbci r29, 0x01 ; 1 2b482: 61 93 st Z+, r22 2b484: 71 93 st Z+, r23 2b486: 81 93 st Z+, r24 2b488: 91 93 st Z+, r25 2b48a: ca 55 subi r28, 0x5A ; 90 2b48c: de 4f sbci r29, 0xFE ; 254 2b48e: f9 83 std Y+1, r31 ; 0x01 2b490: e8 83 st Y, r30 2b492: c6 5a subi r28, 0xA6 ; 166 2b494: d1 40 sbci r29, 0x01 ; 1 shifts_r[p] = height; 2b496: c8 56 subi r28, 0x68 ; 104 2b498: de 4f sbci r29, 0xFE ; 254 2b49a: a8 81 ld r26, Y 2b49c: b9 81 ldd r27, Y+1 ; 0x01 2b49e: c8 59 subi r28, 0x98 ; 152 2b4a0: d1 40 sbci r29, 0x01 ; 1 2b4a2: cd 92 st X+, r12 2b4a4: dd 92 st X+, r13 2b4a6: ed 92 st X+, r14 2b4a8: fd 92 st X+, r15 2b4aa: c8 56 subi r28, 0x68 ; 104 2b4ac: de 4f sbci r29, 0xFE ; 254 2b4ae: b9 83 std Y+1, r27 ; 0x01 2b4b0: a8 83 st Y, r26 2b4b2: c8 59 subi r28, 0x98 ; 152 2b4b4: d1 40 sbci r29, 0x01 ; 1 2b4b6: bf ef ldi r27, 0xFF ; 255 2b4b8: 2b 1a sub r2, r27 2b4ba: 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){ 2b4bc: e1 e2 ldi r30, 0x21 ; 33 2b4be: 2e 16 cp r2, r30 2b4c0: 31 04 cpc r3, r1 2b4c2: 09 f0 breq .+2 ; 0x2b4c6 2b4c4: 10 ce rjmp .-992 ; 0x2b0e6 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); 2b4c6: 40 e0 ldi r20, 0x00 ; 0 2b4c8: 50 e0 ldi r21, 0x00 ; 0 2b4ca: 60 e0 ldi r22, 0x00 ; 0 2b4cc: 7d e3 ldi r23, 0x3D ; 61 2b4ce: ce 01 movw r24, r28 2b4d0: 87 5f subi r24, 0xF7 ; 247 2b4d2: 9e 4f sbci r25, 0xFE ; 254 2b4d4: 0f 94 35 3b call 0x2766a ; 0x2766a 2b4d8: 9b 01 movw r18, r22 2b4da: ac 01 movw r20, r24 2b4dc: c3 57 subi r28, 0x73 ; 115 2b4de: de 4f sbci r29, 0xFE ; 254 2b4e0: a8 81 ld r26, Y 2b4e2: b9 81 ldd r27, Y+1 ; 0x01 2b4e4: cd 58 subi r28, 0x8D ; 141 2b4e6: d1 40 sbci r29, 0x01 ; 1 2b4e8: 6d 91 ld r22, X+ 2b4ea: 7d 91 ld r23, X+ 2b4ec: 8d 91 ld r24, X+ 2b4ee: 9c 91 ld r25, X 2b4f0: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2b4f4: c3 57 subi r28, 0x73 ; 115 2b4f6: de 4f sbci r29, 0xFE ; 254 2b4f8: e8 81 ld r30, Y 2b4fa: f9 81 ldd r31, Y+1 ; 0x01 2b4fc: cd 58 subi r28, 0x8D ; 141 2b4fe: d1 40 sbci r29, 0x01 ; 1 2b500: 60 83 st Z, r22 2b502: 71 83 std Z+1, r23 ; 0x01 2b504: 82 83 std Z+2, r24 ; 0x02 2b506: 93 83 std Z+3, r25 ; 0x03 y += CLAMP_median(shifts_y, blocks, norm); 2b508: 40 e0 ldi r20, 0x00 ; 0 2b50a: 50 e0 ldi r21, 0x00 ; 0 2b50c: 60 e0 ldi r22, 0x00 ; 0 2b50e: 7d e3 ldi r23, 0x3D ; 61 2b510: ce 01 movw r24, r28 2b512: 8b 57 subi r24, 0x7B ; 123 2b514: 9f 4f sbci r25, 0xFF ; 255 2b516: 0f 94 35 3b call 0x2766a ; 0x2766a 2b51a: 9b 01 movw r18, r22 2b51c: ac 01 movw r20, r24 2b51e: c1 57 subi r28, 0x71 ; 113 2b520: de 4f sbci r29, 0xFE ; 254 2b522: a8 81 ld r26, Y 2b524: b9 81 ldd r27, Y+1 ; 0x01 2b526: cf 58 subi r28, 0x8F ; 143 2b528: d1 40 sbci r29, 0x01 ; 1 2b52a: 6d 91 ld r22, X+ 2b52c: 7d 91 ld r23, X+ 2b52e: 8d 91 ld r24, X+ 2b530: 9c 91 ld r25, X 2b532: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2b536: c1 57 subi r28, 0x71 ; 113 2b538: de 4f sbci r29, 0xFE ; 254 2b53a: e8 81 ld r30, Y 2b53c: f9 81 ldd r31, Y+1 ; 0x01 2b53e: cf 58 subi r28, 0x8F ; 143 2b540: d1 40 sbci r29, 0x01 ; 1 2b542: 60 83 st Z, r22 2b544: 71 83 std Z+1, r23 ; 0x01 2b546: 82 83 std Z+2, r24 ; 0x02 2b548: 93 83 std Z+3, r25 ; 0x03 r += CLAMP_median(shifts_r, blocks, norm * .5f); 2b54a: 40 e0 ldi r20, 0x00 ; 0 2b54c: 50 e0 ldi r21, 0x00 ; 0 2b54e: 60 e8 ldi r22, 0x80 ; 128 2b550: 7c e3 ldi r23, 0x3C ; 60 2b552: ce 01 movw r24, r28 2b554: 01 96 adiw r24, 0x01 ; 1 2b556: 0f 94 35 3b call 0x2766a ; 0x2766a 2b55a: ce 56 subi r28, 0x6E ; 110 2b55c: de 4f sbci r29, 0xFE ; 254 2b55e: a8 81 ld r26, Y 2b560: b9 81 ldd r27, Y+1 ; 0x01 2b562: c2 59 subi r28, 0x92 ; 146 2b564: d1 40 sbci r29, 0x01 ; 1 2b566: 2d 91 ld r18, X+ 2b568: 3d 91 ld r19, X+ 2b56a: 4d 91 ld r20, X+ 2b56c: 5c 91 ld r21, X 2b56e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2b572: 16 2f mov r17, r22 2b574: 07 2f mov r16, r23 2b576: f8 2e mov r15, r24 2b578: e9 2e mov r14, r25 r = MAX(2, r); 2b57a: 20 e0 ldi r18, 0x00 ; 0 2b57c: 30 e0 ldi r19, 0x00 ; 0 2b57e: 40 e0 ldi r20, 0x00 ; 0 2b580: 50 e4 ldi r21, 0x40 ; 64 2b582: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 2b586: 18 16 cp r1, r24 2b588: 2c f0 brlt .+10 ; 0x2b594 2b58a: 10 e0 ldi r17, 0x00 ; 0 2b58c: 00 e0 ldi r16, 0x00 ; 0 2b58e: f1 2c mov r15, r1 2b590: 80 e4 ldi r24, 0x40 ; 64 2b592: e8 2e mov r14, r24 2b594: a8 01 movw r20, r16 2b596: 97 01 movw r18, r14 2b598: 85 2f mov r24, r21 2b59a: 90 2f mov r25, r16 2b59c: a3 2f mov r26, r19 2b59e: be 2d mov r27, r14 2b5a0: ce 56 subi r28, 0x6E ; 110 2b5a2: de 4f sbci r29, 0xFE ; 254 2b5a4: e8 81 ld r30, Y 2b5a6: f9 81 ldd r31, Y+1 ; 0x01 2b5a8: c2 59 subi r28, 0x92 ; 146 2b5aa: d1 40 sbci r29, 0x01 ; 1 2b5ac: 80 83 st Z, r24 2b5ae: 91 83 std Z+1, r25 ; 0x01 2b5b0: a2 83 std Z+2, r26 ; 0x02 2b5b2: b3 83 std Z+3, r27 ; 0x03 2b5b4: cf 56 subi r28, 0x6F ; 111 2b5b6: de 4f sbci r29, 0xFE ; 254 2b5b8: f8 81 ld r31, Y 2b5ba: c1 59 subi r28, 0x91 ; 145 2b5bc: d1 40 sbci r29, 0x01 ; 1 2b5be: f1 50 subi r31, 0x01 ; 1 2b5c0: cf 56 subi r28, 0x6F ; 111 2b5c2: de 4f sbci r29, 0xFE ; 254 2b5c4: f8 83 st Y, r31 2b5c6: c1 59 subi r28, 0x91 ; 145 2b5c8: 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){ 2b5ca: f1 11 cpse r31, r1 2b5cc: 37 cd rjmp .-1426 ; 0x2b03c r = MAX(2, r); } //@size=118 DBG(_n(" [%f, %f][%f] final circle\n"), x, y, r); 2b5ce: ef 92 push r14 2b5d0: ff 92 push r15 2b5d2: 0f 93 push r16 2b5d4: 1f 93 push r17 2b5d6: c1 57 subi r28, 0x71 ; 113 2b5d8: de 4f sbci r29, 0xFE ; 254 2b5da: a8 81 ld r26, Y 2b5dc: b9 81 ldd r27, Y+1 ; 0x01 2b5de: cf 58 subi r28, 0x8F ; 143 2b5e0: d1 40 sbci r29, 0x01 ; 1 2b5e2: 13 96 adiw r26, 0x03 ; 3 2b5e4: 8c 91 ld r24, X 2b5e6: 13 97 sbiw r26, 0x03 ; 3 2b5e8: 8f 93 push r24 2b5ea: 12 96 adiw r26, 0x02 ; 2 2b5ec: 8c 91 ld r24, X 2b5ee: 12 97 sbiw r26, 0x02 ; 2 2b5f0: 8f 93 push r24 2b5f2: 11 96 adiw r26, 0x01 ; 1 2b5f4: 8c 91 ld r24, X 2b5f6: 11 97 sbiw r26, 0x01 ; 1 2b5f8: 8f 93 push r24 2b5fa: 8c 91 ld r24, X 2b5fc: 8f 93 push r24 2b5fe: c3 57 subi r28, 0x73 ; 115 2b600: de 4f sbci r29, 0xFE ; 254 2b602: e8 81 ld r30, Y 2b604: f9 81 ldd r31, Y+1 ; 0x01 2b606: cd 58 subi r28, 0x8D ; 141 2b608: d1 40 sbci r29, 0x01 ; 1 2b60a: 83 81 ldd r24, Z+3 ; 0x03 2b60c: 8f 93 push r24 2b60e: 82 81 ldd r24, Z+2 ; 0x02 2b610: 8f 93 push r24 2b612: 81 81 ldd r24, Z+1 ; 0x01 2b614: 8f 93 push r24 2b616: 80 81 ld r24, Z 2b618: 8f 93 push r24 2b61a: 8c eb ldi r24, 0xBC ; 188 2b61c: 98 e9 ldi r25, 0x98 ; 152 2b61e: 9f 93 push r25 2b620: 8f 93 push r24 2b622: 0f 94 5d 9f call 0x33eba ; 0x33eba 2b626: 0f b6 in r0, 0x3f ; 63 2b628: f8 94 cli 2b62a: de bf out 0x3e, r29 ; 62 2b62c: 0f be out 0x3f, r0 ; 63 2b62e: cd bf out 0x3d, r28 ; 61 } 2b630: c3 54 subi r28, 0x43 ; 67 2b632: de 4f sbci r29, 0xFE ; 254 2b634: 0f b6 in r0, 0x3f ; 63 2b636: f8 94 cli 2b638: de bf out 0x3e, r29 ; 62 2b63a: 0f be out 0x3f, r0 ; 63 2b63c: cd bf out 0x3d, r28 ; 61 2b63e: df 91 pop r29 2b640: cf 91 pop r28 2b642: 1f 91 pop r17 2b644: 0f 91 pop r16 2b646: ff 90 pop r15 2b648: ef 90 pop r14 2b64a: df 90 pop r13 2b64c: cf 90 pop r12 2b64e: bf 90 pop r11 2b650: af 90 pop r10 2b652: 9f 90 pop r9 2b654: 8f 90 pop r8 2b656: 7f 90 pop r7 2b658: 6f 90 pop r6 2b65a: 5f 90 pop r5 2b65c: 4f 90 pop r4 2b65e: 3f 90 pop r3 2b660: 2f 90 pop r2 2b662: 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; 2b664: 60 e0 ldi r22, 0x00 ; 0 2b666: 70 e0 ldi r23, 0x00 ; 0 2b668: cb 01 movw r24, r22 2b66a: d5 ce rjmp .-598 ; 0x2b416 0002b66c : } /// 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){ 2b66c: 2f 92 push r2 2b66e: 3f 92 push r3 2b670: 4f 92 push r4 2b672: 5f 92 push r5 2b674: 6f 92 push r6 2b676: 7f 92 push r7 2b678: 8f 92 push r8 2b67a: 9f 92 push r9 2b67c: af 92 push r10 2b67e: bf 92 push r11 2b680: cf 92 push r12 2b682: df 92 push r13 2b684: ef 92 push r14 2b686: ff 92 push r15 2b688: 0f 93 push r16 2b68a: 1f 93 push r17 2b68c: cf 93 push r28 2b68e: df 93 push r29 2b690: 00 d0 rcall .+0 ; 0x2b692 2b692: 1f 92 push r1 2b694: 1f 92 push r1 2b696: cd b7 in r28, 0x3d ; 61 2b698: de b7 in r29, 0x3e ; 62 2b69a: 2b 01 movw r4, r22 2b69c: 1a 01 movw r2, r20 2b69e: f1 2c mov r15, r1 2b6a0: 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; 2b6a2: 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; 2b6a4: 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; 2b6a6: 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){ 2b6a8: 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); 2b6aa: 66 24 eor r6, r6 2b6ac: 63 94 inc r6 2b6ae: 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){ 2b6b0: 70 e0 ldi r23, 0x00 ; 0 2b6b2: 60 e0 ldi r22, 0x00 ; 0 2b6b4: 97 01 movw r18, r14 2b6b6: 28 53 subi r18, 0x38 ; 56 2b6b8: 39 4f sbci r19, 0xF9 ; 249 2b6ba: 3a 83 std Y+2, r19 ; 0x02 2b6bc: 29 83 std Y+1, r18 ; 0x01 2b6be: 86 2e mov r8, r22 2b6c0: c9 80 ldd r12, Y+1 ; 0x01 2b6c2: da 80 ldd r13, Y+2 ; 0x02 2b6c4: c6 0e add r12, r22 2b6c6: d7 1e adc r13, r23 2b6c8: 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; 2b6ca: 00 e0 ldi r16, 0x00 ; 0 for (uint8_t i = 0; i < 12; ++i){ 2b6cc: 40 e0 ldi r20, 0x00 ; 0 2b6ce: 30 e0 ldi r19, 0x00 ; 0 2b6d0: 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; 2b6d2: ae ef ldi r26, 0xFE ; 254 2b6d4: a4 0f add r26, r20 2b6d6: 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; 2b6d8: 44 23 and r20, r20 2b6da: 19 f0 breq .+6 ; 0x2b6e2 2b6dc: 4b 30 cpi r20, 0x0B ; 11 2b6de: 09 f0 breq .+2 ; 0x2b6e2 2b6e0: 7d c0 rjmp .+250 ; 0x2b7dc 2b6e2: ae ef ldi r26, 0xFE ; 254 2b6e4: a2 0f add r26, r18 2b6e6: a8 30 cpi r26, 0x08 ; 8 2b6e8: 08 f4 brcc .+2 ; 0x2b6ec 2b6ea: 7a c0 rjmp .+244 ; 0x2b7e0 2b6ec: 2f 5f subi r18, 0xFF ; 255 2b6ee: 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){ 2b6f0: 2c 30 cpi r18, 0x0C ; 12 2b6f2: 31 05 cpc r19, r1 2b6f4: 89 f7 brne .-30 ; 0x2b6d8 /// 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){ 2b6f6: 4f 5f subi r20, 0xFF ; 255 2b6f8: 20 e2 ldi r18, 0x20 ; 32 2b6fa: c2 0e add r12, r18 2b6fc: d1 1c adc r13, r1 2b6fe: 32 96 adiw r30, 0x02 ; 2 2b700: 4c 30 cpi r20, 0x0C ; 12 2b702: 29 f7 brne .-54 ; 0x2b6ce // 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){ 2b704: 3c 81 ldd r19, Y+4 ; 0x04 2b706: 30 17 cp r19, r16 2b708: 18 f4 brcc .+6 ; 0x2b710 2b70a: 0c 83 std Y+4, r16 ; 0x04 2b70c: 5d 83 std Y+5, r21 ; 0x05 2b70e: 18 2d mov r17, r8 2b710: 6f 5f subi r22, 0xFF ; 255 2b712: 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){ 2b714: 64 31 cpi r22, 0x14 ; 20 2b716: 71 05 cpc r23, r1 2b718: 91 f6 brne .-92 ; 0x2b6be 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){ 2b71a: 5f 5f subi r21, 0xFF ; 255 2b71c: a0 e2 ldi r26, 0x20 ; 32 2b71e: ea 0e add r14, r26 2b720: f1 1c adc r15, r1 2b722: 54 31 cpi r21, 0x14 ; 20 2b724: 29 f6 brne .-118 ; 0x2b6b0 // 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); 2b726: ec 81 ldd r30, Y+4 ; 0x04 2b728: 6e 2f mov r22, r30 2b72a: 70 e0 ldi r23, 0x00 ; 0 2b72c: 90 e0 ldi r25, 0x00 ; 0 2b72e: 80 e0 ldi r24, 0x00 ; 0 2b730: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2b734: 23 ec ldi r18, 0xC3 ; 195 2b736: 35 ef ldi r19, 0xF5 ; 245 2b738: 48 ea ldi r20, 0xA8 ; 168 2b73a: 5f e3 ldi r21, 0x3F ; 63 2b73c: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2b740: 9f 93 push r25 2b742: 8f 93 push r24 2b744: 7f 93 push r23 2b746: 6f 93 push r22 2b748: fd 81 ldd r31, Y+5 ; 0x05 2b74a: 6f 2f mov r22, r31 2b74c: 70 e0 ldi r23, 0x00 ; 0 2b74e: 90 e0 ldi r25, 0x00 ; 0 2b750: 80 e0 ldi r24, 0x00 ; 0 2b752: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2b756: 20 e0 ldi r18, 0x00 ; 0 2b758: 30 e0 ldi r19, 0x00 ; 0 2b75a: 40 eb ldi r20, 0xB0 ; 176 2b75c: 50 e4 ldi r21, 0x40 ; 64 2b75e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2b762: 9f 93 push r25 2b764: 8f 93 push r24 2b766: 7f 93 push r23 2b768: 6f 93 push r22 2b76a: 61 2f mov r22, r17 2b76c: 70 e0 ldi r23, 0x00 ; 0 2b76e: 90 e0 ldi r25, 0x00 ; 0 2b770: 80 e0 ldi r24, 0x00 ; 0 2b772: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2b776: 20 e0 ldi r18, 0x00 ; 0 2b778: 30 e0 ldi r19, 0x00 ; 0 2b77a: 40 eb ldi r20, 0xB0 ; 176 2b77c: 50 e4 ldi r21, 0x40 ; 64 2b77e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2b782: 9f 93 push r25 2b784: 8f 93 push r24 2b786: 7f 93 push r23 2b788: 6f 93 push r22 2b78a: 88 e9 ldi r24, 0x98 ; 152 2b78c: 98 e9 ldi r25, 0x98 ; 152 2b78e: 9f 93 push r25 2b790: 8f 93 push r24 2b792: 0f 94 5d 9f call 0x33eba ; 0x33eba *pc = max_c; 2b796: f2 01 movw r30, r4 2b798: 10 83 st Z, r17 *pr = max_r; 2b79a: 2d 81 ldd r18, Y+5 ; 0x05 2b79c: f1 01 movw r30, r2 2b79e: 20 83 st Z, r18 2b7a0: 0f b6 in r0, 0x3f ; 63 2b7a2: f8 94 cli 2b7a4: de bf out 0x3e, r29 ; 62 2b7a6: 0f be out 0x3f, r0 ; 63 2b7a8: cd bf out 0x3d, r28 ; 61 return max_match; } 2b7aa: 8c 81 ldd r24, Y+4 ; 0x04 2b7ac: 0f 90 pop r0 2b7ae: 0f 90 pop r0 2b7b0: 0f 90 pop r0 2b7b2: 0f 90 pop r0 2b7b4: 0f 90 pop r0 2b7b6: df 91 pop r29 2b7b8: cf 91 pop r28 2b7ba: 1f 91 pop r17 2b7bc: 0f 91 pop r16 2b7be: ff 90 pop r15 2b7c0: ef 90 pop r14 2b7c2: df 90 pop r13 2b7c4: cf 90 pop r12 2b7c6: bf 90 pop r11 2b7c8: af 90 pop r10 2b7ca: 9f 90 pop r9 2b7cc: 8f 90 pop r8 2b7ce: 7f 90 pop r7 2b7d0: 6f 90 pop r6 2b7d2: 5f 90 pop r5 2b7d4: 4f 90 pop r4 2b7d6: 3f 90 pop r3 2b7d8: 2f 90 pop r2 2b7da: 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; 2b7dc: 22 23 and r18, r18 2b7de: 11 f0 breq .+4 ; 0x2b7e4 2b7e0: 2b 30 cpi r18, 0x0B ; 11 2b7e2: 21 f4 brne .+8 ; 0x2b7ec 2b7e4: ab 81 ldd r26, Y+3 ; 0x03 2b7e6: a8 30 cpi r26, 0x08 ; 8 2b7e8: 08 f0 brcs .+2 ; 0x2b7ec 2b7ea: 80 cf rjmp .-256 ; 0x2b6ec const uint16_t idx = (c + j) + 32 * ((uint16_t)r + i); const bool high_pix = pixels[idx] > thr; 2b7ec: 99 24 eor r9, r9 2b7ee: 93 94 inc r9 2b7f0: d6 01 movw r26, r12 2b7f2: a2 0f add r26, r18 2b7f4: b3 1f adc r27, r19 2b7f6: ac 91 ld r26, X 2b7f8: a1 31 cpi r26, 0x11 ; 17 2b7fa: 08 f4 brcc .+2 ; 0x2b7fe 2b7fc: 91 2c mov r9, r1 const bool high_pat = pattern[i] & (1 << j); 2b7fe: a0 80 ld r10, Z 2b800: b1 80 ldd r11, Z+1 ; 0x01 2b802: d3 01 movw r26, r6 2b804: 02 2e mov r0, r18 2b806: 02 c0 rjmp .+4 ; 0x2b80c 2b808: aa 0f add r26, r26 2b80a: bb 1f adc r27, r27 2b80c: 0a 94 dec r0 2b80e: e2 f7 brpl .-8 ; 0x2b808 2b810: aa 21 and r26, r10 2b812: bb 21 and r27, r11 2b814: bb 24 eor r11, r11 2b816: b3 94 inc r11 2b818: ab 2b or r26, r27 2b81a: 09 f4 brne .+2 ; 0x2b81e 2b81c: b1 2c mov r11, r1 if (high_pix == high_pat) 2b81e: 9b 10 cpse r9, r11 2b820: 65 cf rjmp .-310 ; 0x2b6ec match++; 2b822: 0f 5f subi r16, 0xFF ; 255 2b824: 63 cf rjmp .-314 ; 0x2b6ec 0002b826 : 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){ 2b826: 2f 92 push r2 2b828: 3f 92 push r3 2b82a: 4f 92 push r4 2b82c: 5f 92 push r5 2b82e: 6f 92 push r6 2b830: 7f 92 push r7 2b832: 8f 92 push r8 2b834: 9f 92 push r9 2b836: af 92 push r10 2b838: bf 92 push r11 2b83a: cf 92 push r12 2b83c: df 92 push r13 2b83e: ef 92 push r14 2b840: ff 92 push r15 2b842: 0f 93 push r16 2b844: 1f 93 push r17 2b846: cf 93 push r28 2b848: df 93 push r29 2b84a: cd b7 in r28, 0x3d ; 61 2b84c: de b7 in r29, 0x3e ; 62 2b84e: ca 55 subi r28, 0x5A ; 90 2b850: d1 09 sbc r29, r1 2b852: 0f b6 in r0, 0x3f ; 63 2b854: f8 94 cli 2b856: de bf out 0x3e, r29 ; 62 2b858: 0f be out 0x3f, r0 ; 63 2b85a: cd bf out 0x3d, r28 ; 61 2b85c: 63 96 adiw r28, 0x13 ; 19 2b85e: 9f af std Y+63, r25 ; 0x3f 2b860: 8e af std Y+62, r24 ; 0x3e 2b862: 63 97 sbiw r28, 0x13 ; 19 2b864: 8b 01 movw r16, r22 2b866: 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 2b868: 7e 01 movw r14, r28 2b86a: 25 e4 ldi r18, 0x45 ; 69 2b86c: e2 0e add r14, r18 2b86e: f1 1c adc r15, r1 2b870: 80 e1 ldi r24, 0x10 ; 16 2b872: 97 e2 ldi r25, 0x27 ; 39 2b874: f7 01 movw r30, r14 2b876: 91 83 std Z+1, r25 ; 0x01 2b878: 80 83 st Z, r24 int16_t start_z; uint16_t steps_to_go; DBG(_n("Scan countdown: ")); 2b87a: 87 e8 ldi r24, 0x87 ; 135 2b87c: 98 e9 ldi r25, 0x98 ; 152 2b87e: 9f 93 push r25 2b880: 8f 93 push r24 2b882: 0f 94 5d 9f call 0x33eba ; 0x33eba 2b886: 28 ec ldi r18, 0xC8 ; 200 2b888: 36 e0 ldi r19, 0x06 ; 6 2b88a: 61 96 adiw r28, 0x11 ; 17 2b88c: 3f af std Y+63, r19 ; 0x3f 2b88e: 2e af std Y+62, r18 ; 0x3e 2b890: 61 97 sbiw r28, 0x11 ; 17 2b892: c8 01 movw r24, r16 2b894: 80 5e subi r24, 0xE0 ; 224 2b896: 93 40 sbci r25, 0x03 ; 3 2b898: 2b 96 adiw r28, 0x0b ; 11 2b89a: 9f af std Y+63, r25 ; 0x3f 2b89c: 8e af std Y+62, r24 ; 0x3e 2b89e: 2b 97 sbiw r28, 0x0b ; 11 2b8a0: 0f 90 pop r0 2b8a2: 0f 90 pop r0 2b8a4: e0 e4 ldi r30, 0x40 ; 64 2b8a6: f0 e0 ldi r31, 0x00 ; 0 2b8a8: 29 96 adiw r28, 0x09 ; 9 2b8aa: ff af std Y+63, r31 ; 0x3f 2b8ac: ee af std Y+62, r30 ; 0x3e 2b8ae: 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); 2b8b0: 63 96 adiw r28, 0x13 ; 19 2b8b2: 2e ad ldd r18, Y+62 ; 0x3e 2b8b4: 3f ad ldd r19, Y+63 ; 0x3f 2b8b6: 63 97 sbiw r28, 0x13 ; 19 2b8b8: 20 5e subi r18, 0xE0 ; 224 2b8ba: 33 40 sbci r19, 0x03 ; 3 2b8bc: 69 96 adiw r28, 0x19 ; 25 2b8be: 3f af std Y+63, r19 ; 0x3f 2b8c0: 2e af std Y+62, r18 ; 0x3e 2b8c2: 69 97 sbiw r28, 0x19 ; 25 2b8c4: 29 96 adiw r28, 0x09 ; 9 2b8c6: 4e ac ldd r4, Y+62 ; 0x3e 2b8c8: 5f ac ldd r5, Y+63 ; 0x3f 2b8ca: 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){ 2b8cc: 31 2c mov r3, r1 go_manhattan((d & 1) ? (cx + 992) : (cx - 992), cy - 992 + r * 64, _Z, Z_ACCEL, Z_MIN_DELAY); 2b8ce: 63 96 adiw r28, 0x13 ; 19 2b8d0: 8e ad ldd r24, Y+62 ; 0x3e 2b8d2: 9f ad ldd r25, Y+63 ; 0x3f 2b8d4: 63 97 sbiw r28, 0x13 ; 19 2b8d6: 80 52 subi r24, 0x20 ; 32 2b8d8: 9c 4f sbci r25, 0xFC ; 252 2b8da: 6b 96 adiw r28, 0x1b ; 27 2b8dc: 9f af std Y+63, r25 ; 0x3f 2b8de: 8e af std Y+62, r24 ; 0x3e 2b8e0: 6b 97 sbiw r28, 0x1b ; 27 2b8e2: 60 90 be 06 lds r6, 0x06BE ; 0x8006be 2b8e6: 70 90 bf 06 lds r7, 0x06BF ; 0x8006bf 2b8ea: 80 90 c0 06 lds r8, 0x06C0 ; 0x8006c0 2b8ee: 90 90 c1 06 lds r9, 0x06C1 ; 0x8006c1 2b8f2: 6b 96 adiw r28, 0x1b ; 27 2b8f4: ae ac ldd r10, Y+62 ; 0x3e 2b8f6: bf ac ldd r11, Y+63 ; 0x3f 2b8f8: 6b 97 sbiw r28, 0x1b ; 27 2b8fa: 31 10 cpse r3, r1 2b8fc: 04 c0 rjmp .+8 ; 0x2b906 2b8fe: 69 96 adiw r28, 0x19 ; 25 2b900: ae ac ldd r10, Y+62 ; 0x3e 2b902: bf ac ldd r11, Y+63 ; 0x3f 2b904: 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; 2b906: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 2b90a: 90 91 b7 06 lds r25, 0x06B7 ; 0x8006b7 2b90e: a0 91 b8 06 lds r26, 0x06B8 ; 0x8006b8 2b912: b0 91 b9 06 lds r27, 0x06B9 ; 0x8006b9 2b916: f5 01 movw r30, r10 2b918: e8 1b sub r30, r24 2b91a: f9 0b sbc r31, r25 2b91c: 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) 2b91e: 71 f0 breq .+28 ; 0x2b93c 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)); 2b920: af 01 movw r20, r30 2b922: f7 ff sbrs r31, 7 2b924: 04 c0 rjmp .+8 ; 0x2b92e 2b926: 44 27 eor r20, r20 2b928: 55 27 eor r21, r21 2b92a: 4e 1b sub r20, r30 2b92c: 5f 0b sbc r21, r31 2b92e: 69 2f mov r22, r25 2b930: 66 1f adc r22, r22 2b932: 66 27 eor r22, r22 2b934: 66 1f adc r22, r22 2b936: 81 e0 ldi r24, 0x01 ; 1 2b938: 0f 94 9a 40 call 0x28134 ; 0x28134 // DBG(_n("y %d -> %d, "), y, _Y); length = y - _Y; 2b93c: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 2b940: 90 91 bb 06 lds r25, 0x06BB ; 0x8006bb 2b944: a0 91 bc 06 lds r26, 0x06BC ; 0x8006bc 2b948: b0 91 bd 06 lds r27, 0x06BD ; 0x8006bd 2b94c: 2b 96 adiw r28, 0x0b ; 11 2b94e: 4e ad ldd r20, Y+62 ; 0x3e 2b950: 5f ad ldd r21, Y+63 ; 0x3f 2b952: 2b 97 sbiw r28, 0x0b ; 11 2b954: 48 1b sub r20, r24 2b956: 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)); 2b958: 57 fd sbrc r21, 7 2b95a: b2 c0 rjmp .+356 ; 0x2bac0 2b95c: 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) 2b95e: 41 15 cp r20, r1 2b960: 51 05 cpc r21, r1 2b962: 09 f0 breq .+2 ; 0x2b966 2b964: ae c0 rjmp .+348 ; 0x2bac2 // 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; 2b966: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2b96a: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2b96e: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2b972: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2b976: 68 1a sub r6, r24 2b978: 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)); 2b97a: 77 fc sbrc r7, 7 2b97c: ab c0 rjmp .+342 ; 0x2bad4 2b97e: 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) 2b980: 61 14 cp r6, r1 2b982: 71 04 cpc r7, r1 2b984: 09 f0 breq .+2 ; 0x2b988 2b986: a7 c0 rjmp .+334 ; 0x2bad6 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); 2b988: 40 91 be 06 lds r20, 0x06BE ; 0x8006be 2b98c: 50 91 bf 06 lds r21, 0x06BF ; 0x8006bf 2b990: 60 91 c0 06 lds r22, 0x06C0 ; 0x8006c0 2b994: 70 91 c1 06 lds r23, 0x06C1 ; 0x8006c1 2b998: 00 e0 ldi r16, 0x00 ; 0 2b99a: 28 ec ldi r18, 0xC8 ; 200 2b99c: 30 e0 ldi r19, 0x00 ; 0 2b99e: 2b 96 adiw r28, 0x0b ; 11 2b9a0: 6e ad ldd r22, Y+62 ; 0x3e 2b9a2: 7f ad ldd r23, Y+63 ; 0x3f 2b9a4: 2b 97 sbiw r28, 0x0b ; 11 2b9a6: c5 01 movw r24, r10 2b9a8: 0e 94 cf c2 call 0x1859e ; 0x1859e sm4_set_dir(X_AXIS, d); 2b9ac: 63 2d mov r22, r3 2b9ae: 80 e0 ldi r24, 0x00 ; 0 2b9b0: 0f 94 bd 36 call 0x26d7a ; 0x26d7a //@size=242 DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep host connection alive 2b9b4: 5f 92 push r5 2b9b6: 4f 92 push r4 2b9b8: 83 e8 ldi r24, 0x83 ; 131 2b9ba: 98 e9 ldi r25, 0x98 ; 152 2b9bc: 9f 93 push r25 2b9be: 8f 93 push r24 2b9c0: 0f 94 5d 9f call 0x33eba ; 0x33eba lcd_set_cursor(4,3); 2b9c4: 63 e0 ldi r22, 0x03 ; 3 2b9c6: 84 e0 ldi r24, 0x04 ; 4 2b9c8: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_printf_P(PSTR("Countdown: %d "),64 - (r * 2 + d)); ////MSG_COUNTDOWN c=12 2b9cc: 5f 92 push r5 2b9ce: 4f 92 push r4 2b9d0: 84 e7 ldi r24, 0x74 ; 116 2b9d2: 98 e9 ldi r25, 0x98 ; 152 2b9d4: 9f 93 push r25 2b9d6: 8f 93 push r24 2b9d8: 0e 94 4a 69 call 0xd294 ; 0xd294 2b9dc: 0f b6 in r0, 0x3f ; 63 2b9de: f8 94 cli 2b9e0: de bf out 0x3e, r29 ; 62 2b9e2: 0f be out 0x3f, r0 ; 63 2b9e4: cd bf out 0x3d, r28 ; 61 2b9e6: 21 e0 ldi r18, 0x01 ; 1 2b9e8: 30 e0 ldi r19, 0x00 ; 0 2b9ea: 31 10 cpse r3, r1 2b9ec: 02 c0 rjmp .+4 ; 0x2b9f2 2b9ee: 2f ef ldi r18, 0xFF ; 255 2b9f0: 3f ef ldi r19, 0xFF ; 255 2b9f2: 40 ec ldi r20, 0xC0 ; 192 2b9f4: 42 03 mulsu r20, r18 2b9f6: c0 01 movw r24, r0 2b9f8: 43 9f mul r20, r19 2b9fa: 90 0d add r25, r0 2b9fc: 11 24 eor r1, r1 2b9fe: 67 96 adiw r28, 0x17 ; 23 2ba00: 9f af std Y+63, r25 ; 0x3f 2ba02: 8e af std Y+62, r24 ; 0x3e 2ba04: 67 97 sbiw r28, 0x17 ; 23 2ba06: 40 ee ldi r20, 0xE0 ; 224 2ba08: 53 e0 ldi r21, 0x03 ; 3 2ba0a: 24 9f mul r18, r20 2ba0c: 40 01 movw r8, r0 2ba0e: 25 9f mul r18, r21 2ba10: 90 0c add r9, r0 2ba12: 34 9f mul r19, r20 2ba14: 90 0c add r9, r0 2ba16: 11 24 eor r1, r1 2ba18: 63 96 adiw r28, 0x13 ; 19 2ba1a: ee ad ldd r30, Y+62 ; 0x3e 2ba1c: ff ad ldd r31, Y+63 ; 0x3f 2ba1e: 63 97 sbiw r28, 0x13 ; 19 2ba20: 8e 0e add r8, r30 2ba22: 9f 1e adc r9, r31 2ba24: 9e 01 movw r18, r28 2ba26: 2f 5f subi r18, 0xFF ; 255 2ba28: 3f 4f sbci r19, 0xFF ; 255 2ba2a: 2d 96 adiw r28, 0x0d ; 13 2ba2c: 3f af std Y+63, r19 ; 0x3f 2ba2e: 2e af std Y+62, r18 ; 0x3e 2ba30: 2d 97 sbiw r28, 0x0d ; 13 2ba32: 61 96 adiw r28, 0x11 ; 17 2ba34: 8e ad ldd r24, Y+62 ; 0x3e 2ba36: 9f ad ldd r25, Y+63 ; 0x3f 2ba38: 61 97 sbiw r28, 0x11 ; 17 2ba3a: 2f 96 adiw r28, 0x0f ; 15 2ba3c: 9f af std Y+63, r25 ; 0x3f 2ba3e: 8e af std Y+62, r24 ; 0x3e 2ba40: 2f 97 sbiw r28, 0x0f ; 15 2ba42: 71 2c mov r7, r1 2ba44: 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; 2ba46: e0 e1 ldi r30, 0x10 ; 16 2ba48: f7 e2 ldi r31, 0x27 ; 39 2ba4a: 27 96 adiw r28, 0x07 ; 7 2ba4c: ff af std Y+63, r31 ; 0x3f 2ba4e: ee af std Y+62, r30 ; 0x3e 2ba50: 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); 2ba52: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 2ba56: 90 91 b7 06 lds r25, 0x06B7 ; 0x8006b7 2ba5a: a0 91 b8 06 lds r26, 0x06B8 ; 0x8006b8 2ba5e: b0 91 b9 06 lds r27, 0x06B9 ; 0x8006b9 2ba62: 84 01 movw r16, r8 2ba64: 08 1b sub r16, r24 2ba66: 19 0b sbc r17, r25 2ba68: 17 ff sbrs r17, 7 2ba6a: 03 c0 rjmp .+6 ; 0x2ba72 2ba6c: 11 95 neg r17 2ba6e: 01 95 neg r16 2ba70: 11 09 sbc r17, r1 const int16_t half_x = length_x / 2; 2ba72: 98 01 movw r18, r16 2ba74: 35 95 asr r19 2ba76: 27 95 ror r18 2ba78: 65 96 adiw r28, 0x15 ; 21 2ba7a: 3f af std Y+63, r19 ; 0x3f 2ba7c: 2e af std Y+62, r18 ; 0x3e 2ba7e: 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; 2ba80: 1c 9b sbis 0x03, 4 ; 3 2ba82: 33 c0 rjmp .+102 ; 0x2baea 2ba84: 45 e0 ldi r20, 0x05 ; 5 2ba86: 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); 2ba88: 65 96 adiw r28, 0x15 ; 21 2ba8a: ae ac ldd r10, Y+62 ; 0x3e 2ba8c: bf ac ldd r11, Y+63 ; 0x3f 2ba8e: 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); 2ba90: 63 2d mov r22, r3 2ba92: 82 2d mov r24, r2 2ba94: 0e 94 76 c2 call 0x184ec ; 0x184ec while (steps--){ 2ba98: 31 e0 ldi r19, 0x01 ; 1 2ba9a: a3 1a sub r10, r19 2ba9c: b1 08 sbc r11, r1 2ba9e: 40 f1 brcs .+80 ; 0x2baf0 accelerate_1_step(axes, acc, delay_us, min_delay_us); 2baa0: 28 ec ldi r18, 0xC8 ; 200 2baa2: 30 e0 ldi r19, 0x00 ; 0 2baa4: a7 01 movw r20, r14 2baa6: 68 ee ldi r22, 0xE8 ; 232 2baa8: 73 e0 ldi r23, 0x03 ; 3 2baaa: 82 2d mov r24, r2 2baac: 0e 94 45 c1 call 0x1828a ; 0x1828a update_position_1_step(axes, dir); 2bab0: 63 2d mov r22, r3 2bab2: 82 2d mov r24, r2 2bab4: 0e 94 8f c2 call 0x1851e ; 0x1851e 2bab8: ef cf rjmp .-34 ; 0x2ba98 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){ 2baba: 33 24 eor r3, r3 2babc: 33 94 inc r3 2babe: 11 cf rjmp .-478 ; 0x2b8e2 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)); 2bac0: 62 e0 ldi r22, 0x02 ; 2 2bac2: 57 ff sbrs r21, 7 2bac4: 03 c0 rjmp .+6 ; 0x2bacc 2bac6: 51 95 neg r21 2bac8: 41 95 neg r20 2baca: 51 09 sbc r21, r1 2bacc: 82 e0 ldi r24, 0x02 ; 2 2bace: 0f 94 9a 40 call 0x28134 ; 0x28134 2bad2: 49 cf rjmp .-366 ; 0x2b966 // 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)); 2bad4: 64 e0 ldi r22, 0x04 ; 4 2bad6: a3 01 movw r20, r6 2bad8: 77 fe sbrs r7, 7 2bada: 03 c0 rjmp .+6 ; 0x2bae2 2badc: 51 95 neg r21 2bade: 41 95 neg r20 2bae0: 51 09 sbc r21, r1 2bae2: 84 e0 ldi r24, 0x04 ; 4 2bae4: 0f 94 9a 40 call 0x28134 ; 0x28134 2bae8: 4f cf rjmp .-354 ; 0x2b988 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; 2baea: 22 24 eor r2, r2 2baec: 23 94 inc r2 2baee: cc cf rjmp .-104 ; 0x2ba88 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); 2baf0: 65 96 adiw r28, 0x15 ; 21 2baf2: ee ad ldd r30, Y+62 ; 0x3e 2baf4: ff ad ldd r31, Y+63 ; 0x3f 2baf6: 65 97 sbiw r28, 0x15 ; 21 2baf8: 0e 1b sub r16, r30 2bafa: 1f 0b sbc r17, r31 2bafc: 23 96 adiw r28, 0x03 ; 3 2bafe: 1f af std Y+63, r17 ; 0x3f 2bb00: 0e af std Y+62, r16 ; 0x3e 2bb02: 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); 2bb04: 63 2d mov r22, r3 2bb06: 82 2d mov r24, r2 2bb08: 0e 94 76 c2 call 0x184ec ; 0x184ec while (go_and_stop_1_step(axes, dec, delay_us, steps)){ 2bb0c: 9e 01 movw r18, r28 2bb0e: 2f 5b subi r18, 0xBF ; 191 2bb10: 3f 4f sbci r19, 0xFF ; 255 2bb12: a7 01 movw r20, r14 2bb14: 68 ee ldi r22, 0xE8 ; 232 2bb16: 73 e0 ldi r23, 0x03 ; 3 2bb18: 82 2d mov r24, r2 2bb1a: 0e 94 ec c1 call 0x183d8 ; 0x183d8 2bb1e: 88 23 and r24, r24 2bb20: 29 f0 breq .+10 ; 0x2bb2c update_position_1_step(axes, dir); 2bb22: 63 2d mov r22, r3 2bb24: 82 2d mov r24, r2 2bb26: 0e 94 8f c2 call 0x1851e ; 0x1851e 2bb2a: f0 cf rjmp .-32 ; 0x2bb0c z_trig = min_z; /// move up to un-trigger (surpress hysteresis) sm4_set_dir(Z_AXIS, Z_PLUS); 2bb2c: 60 e0 ldi r22, 0x00 ; 0 2bb2e: 82 e0 ldi r24, 0x02 ; 2 2bb30: 0f 94 bd 36 call 0x26d7a ; 0x26d7a /// speed up from stop, go half the way current_delay_us = MAX_DELAY; 2bb34: 20 e1 ldi r18, 0x10 ; 16 2bb36: 37 e2 ldi r19, 0x27 ; 39 2bb38: 27 96 adiw r28, 0x07 ; 7 2bb3a: 3f af std Y+63, r19 ; 0x3f 2bb3c: 2e af std Y+62, r18 ; 0x3e 2bb3e: 27 97 sbiw r28, 0x07 ; 7 for (start_z = _Z; _Z < (max_z + start_z) / 2; ++_Z_){ 2bb40: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 2bb44: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 2bb48: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 2bb4c: 30 91 c1 06 lds r19, 0x06C1 ; 0x8006c1 2bb50: 00 5a subi r16, 0xA0 ; 160 2bb52: 16 4f sbci r17, 0xF6 ; 246 2bb54: 17 ff sbrs r17, 7 2bb56: 02 c0 rjmp .+4 ; 0x2bb5c 2bb58: 0f 5f subi r16, 0xFF ; 255 2bb5a: 1f 4f sbci r17, 0xFF ; 255 2bb5c: 15 95 asr r17 2bb5e: 07 95 ror r16 2bb60: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bb64: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bb68: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bb6c: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bb70: 80 17 cp r24, r16 2bb72: 91 07 cpc r25, r17 2bb74: f4 f4 brge .+60 ; 0x2bbb2 if (!_PINDA){ 2bb76: 1c 9b sbis 0x03, 4 ; 3 2bb78: 1c c0 rjmp .+56 ; 0x2bbb2 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); 2bb7a: 28 ec ldi r18, 0xC8 ; 200 2bb7c: 30 e0 ldi r19, 0x00 ; 0 2bb7e: a7 01 movw r20, r14 2bb80: 68 ee ldi r22, 0xE8 ; 232 2bb82: 73 e0 ldi r23, 0x03 ; 3 2bb84: 84 e0 ldi r24, 0x04 ; 4 2bb86: 0e 94 45 c1 call 0x1828a ; 0x1828a /// 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_){ 2bb8a: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bb8e: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bb92: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bb96: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bb9a: 01 96 adiw r24, 0x01 ; 1 2bb9c: a1 1d adc r26, r1 2bb9e: b1 1d adc r27, r1 2bba0: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 2bba4: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 2bba8: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 2bbac: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 2bbb0: d7 cf rjmp .-82 ; 0x2bb60 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } if (_PINDA){ 2bbb2: 1c 9b sbis 0x03, 4 ; 3 2bbb4: 3f c0 rjmp .+126 ; 0x2bc34 steps_to_go = MAX(0, max_z - _Z); 2bbb6: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bbba: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bbbe: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bbc2: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bbc6: e0 e6 ldi r30, 0x60 ; 96 2bbc8: f9 e0 ldi r31, 0x09 ; 9 2bbca: e8 1b sub r30, r24 2bbcc: f9 0b sbc r31, r25 2bbce: cf 01 movw r24, r30 2bbd0: f7 ff sbrs r31, 7 2bbd2: 02 c0 rjmp .+4 ; 0x2bbd8 2bbd4: 90 e0 ldi r25, 0x00 ; 0 2bbd6: 80 e0 ldi r24, 0x00 ; 0 2bbd8: 25 96 adiw r28, 0x05 ; 5 2bbda: 9f af std Y+63, r25 ; 0x3f 2bbdc: 8e af std Y+62, r24 ; 0x3e 2bbde: 25 97 sbiw r28, 0x05 ; 5 while (_PINDA && _Z < max_z){ 2bbe0: 1c 9b sbis 0x03, 4 ; 3 2bbe2: 28 c0 rjmp .+80 ; 0x2bc34 2bbe4: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bbe8: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bbec: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bbf0: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bbf4: 80 36 cpi r24, 0x60 ; 96 2bbf6: 99 40 sbci r25, 0x09 ; 9 2bbf8: ec f4 brge .+58 ; 0x2bc34 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); 2bbfa: 9e 01 movw r18, r28 2bbfc: 2d 5b subi r18, 0xBD ; 189 2bbfe: 3f 4f sbci r19, 0xFF ; 255 2bc00: a7 01 movw r20, r14 2bc02: 68 ee ldi r22, 0xE8 ; 232 2bc04: 73 e0 ldi r23, 0x03 ; 3 2bc06: 84 e0 ldi r24, 0x04 ; 4 2bc08: 0e 94 ec c1 call 0x183d8 ; 0x183d8 ++_Z_; 2bc0c: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bc10: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bc14: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bc18: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bc1c: 01 96 adiw r24, 0x01 ; 1 2bc1e: a1 1d adc r26, r1 2bc20: b1 1d adc r27, r1 2bc22: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 2bc26: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 2bc2a: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 2bc2e: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 2bc32: d6 cf rjmp .-84 ; 0x2bbe0 /// \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); 2bc34: 60 e0 ldi r22, 0x00 ; 0 2bc36: 84 e0 ldi r24, 0x04 ; 4 2bc38: 0e 94 76 c2 call 0x184ec ; 0x184ec while (delay_us < MAX_DELAY){ 2bc3c: f7 01 movw r30, r14 2bc3e: 20 81 ld r18, Z 2bc40: 31 81 ldd r19, Z+1 ; 0x01 2bc42: 20 31 cpi r18, 0x10 ; 16 2bc44: f7 e2 ldi r31, 0x27 ; 39 2bc46: 3f 07 cpc r19, r31 2bc48: 58 f4 brcc .+22 ; 0x2bc60 accelerate_1_step(axes, -dec, delay_us, delay_us); 2bc4a: a7 01 movw r20, r14 2bc4c: 68 e1 ldi r22, 0x18 ; 24 2bc4e: 7c ef ldi r23, 0xFC ; 252 2bc50: 84 e0 ldi r24, 0x04 ; 4 2bc52: 0e 94 45 c1 call 0x1828a ; 0x1828a update_position_1_step(axes, dir); 2bc56: 60 e0 ldi r22, 0x00 ; 0 2bc58: 84 e0 ldi r24, 0x04 ; 4 2bc5a: 0e 94 8f c2 call 0x1851e ; 0x1851e 2bc5e: ee cf rjmp .-36 ; 0x2bc3c } } stop_smoothly(Z_AXIS_MASK, Z_PLUS_MASK, Z_ACCEL, current_delay_us); /// move down to trigger sm4_set_dir(Z_AXIS, Z_MINUS); 2bc60: 61 e0 ldi r22, 0x01 ; 1 2bc62: 82 e0 ldi r24, 0x02 ; 2 2bc64: 0f 94 bd 36 call 0x26d7a ; 0x26d7a /// speed up current_delay_us = MAX_DELAY; 2bc68: 20 e1 ldi r18, 0x10 ; 16 2bc6a: 37 e2 ldi r19, 0x27 ; 39 2bc6c: f7 01 movw r30, r14 2bc6e: 31 83 std Z+1, r19 ; 0x01 2bc70: 20 83 st Z, r18 for (start_z = _Z; _Z > (min_z + start_z) / 2; --_Z_){ 2bc72: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 2bc76: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 2bc7a: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 2bc7e: 30 91 c1 06 lds r19, 0x06C1 ; 0x8006c1 2bc82: 0c 0d add r16, r12 2bc84: 1d 1d adc r17, r13 2bc86: 17 ff sbrs r17, 7 2bc88: 02 c0 rjmp .+4 ; 0x2bc8e 2bc8a: 0f 5f subi r16, 0xFF ; 255 2bc8c: 1f 4f sbci r17, 0xFF ; 255 2bc8e: 15 95 asr r17 2bc90: 07 95 ror r16 2bc92: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bc96: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bc9a: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bc9e: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bca2: 08 17 cp r16, r24 2bca4: 19 07 cpc r17, r25 2bca6: 0c f0 brlt .+2 ; 0x2bcaa 2bca8: d9 c0 rjmp .+434 ; 0x2be5c if (_PINDA){ 2bcaa: 1c 9b sbis 0x03, 4 ; 3 2bcac: bb c0 rjmp .+374 ; 0x2be24 z_trig = _Z; 2bcae: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 2bcb2: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 2bcb6: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 2bcba: 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){ 2bcbe: 1c 99 sbic 0x03, 4 ; 3 2bcc0: 28 c0 rjmp .+80 ; 0x2bd12 steps_to_go = MAX(0, _Z - min_z); 2bcc2: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bcc6: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bcca: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bcce: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bcd2: 8c 19 sub r24, r12 2bcd4: 9d 09 sbc r25, r13 2bcd6: 97 ff sbrs r25, 7 2bcd8: 02 c0 rjmp .+4 ; 0x2bcde 2bcda: 90 e0 ldi r25, 0x00 ; 0 2bcdc: 80 e0 ldi r24, 0x00 ; 0 2bcde: 25 96 adiw r28, 0x05 ; 5 2bce0: 9f af std Y+63, r25 ; 0x3f 2bce2: 8e af std Y+62, r24 ; 0x3e 2bce4: 25 97 sbiw r28, 0x05 ; 5 while (!_PINDA && _Z > min_z){ 2bce6: 1c 99 sbic 0x03, 4 ; 3 2bce8: 0c c0 rjmp .+24 ; 0x2bd02 2bcea: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bcee: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bcf2: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bcf6: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bcfa: c8 16 cp r12, r24 2bcfc: d9 06 cpc r13, r25 2bcfe: 0c f4 brge .+2 ; 0x2bd02 2bd00: af c0 rjmp .+350 ; 0x2be60 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); --_Z_; } z_trig = _Z; 2bd02: 00 91 be 06 lds r16, 0x06BE ; 0x8006be 2bd06: 10 91 bf 06 lds r17, 0x06BF ; 0x8006bf 2bd0a: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 2bd0e: 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){ 2bd12: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2bd16: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2bd1a: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2bd1e: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2bd22: c8 16 cp r12, r24 2bd24: d9 06 cpc r13, r25 2bd26: 3c f4 brge .+14 ; 0x2bd36 2bd28: f7 01 movw r30, r14 2bd2a: 80 81 ld r24, Z 2bd2c: 91 81 ldd r25, Z+1 ; 0x01 2bd2e: 80 31 cpi r24, 0x10 ; 16 2bd30: 97 42 sbci r25, 0x27 ; 39 2bd32: 08 f4 brcc .+2 ; 0x2bd36 2bd34: b2 c0 rjmp .+356 ; 0x2be9a 2bd36: 0c 19 sub r16, r12 2bd38: 1d 09 sbc r17, r13 accelerate_1_step(Z_AXIS_MASK, -Z_ACCEL, current_delay_us, Z_MIN_DELAY); --_Z_; } if (d == 0){ 2bd3a: 31 10 cpse r3, r1 2bd3c: ca c0 rjmp .+404 ; 0x2bed2 line_buffer[c] = (uint16_t)(z_trig - min_z); 2bd3e: f3 01 movw r30, r6 2bd40: ee 0f add r30, r30 2bd42: ff 1f adc r31, r31 2bd44: 21 e0 ldi r18, 0x01 ; 1 2bd46: 30 e0 ldi r19, 0x00 ; 0 2bd48: 2c 0f add r18, r28 2bd4a: 3d 1f adc r19, r29 2bd4c: e2 0f add r30, r18 2bd4e: f3 1f adc r31, r19 2bd50: 11 83 std Z+1, r17 ; 0x01 2bd52: 00 83 st Z, r16 2bd54: ff ef ldi r31, 0xFF ; 255 2bd56: 6f 1a sub r6, r31 2bd58: 7f 0a sbc r7, r31 2bd5a: 67 96 adiw r28, 0x17 ; 23 2bd5c: 2e ad ldd r18, Y+62 ; 0x3e 2bd5e: 3f ad ldd r19, Y+63 ; 0x3f 2bd60: 67 97 sbiw r28, 0x17 ; 23 2bd62: 82 0e add r8, r18 2bd64: 93 1e adc r9, r19 2bd66: 2d 96 adiw r28, 0x0d ; 13 2bd68: 8e ad ldd r24, Y+62 ; 0x3e 2bd6a: 9f ad ldd r25, Y+63 ; 0x3f 2bd6c: 2d 97 sbiw r28, 0x0d ; 13 2bd6e: 02 97 sbiw r24, 0x02 ; 2 2bd70: 2d 96 adiw r28, 0x0d ; 13 2bd72: 9f af std Y+63, r25 ; 0x3f 2bd74: 8e af std Y+62, r24 ; 0x3e 2bd76: 2d 97 sbiw r28, 0x0d ; 13 2bd78: 2f 96 adiw r28, 0x0f ; 15 2bd7a: ee ad ldd r30, Y+62 ; 0x3e 2bd7c: ff ad ldd r31, Y+63 ; 0x3f 2bd7e: 2f 97 sbiw r28, 0x0f ; 15 2bd80: 31 97 sbiw r30, 0x01 ; 1 2bd82: 2f 96 adiw r28, 0x0f ; 15 2bd84: ff af std Y+63, r31 ; 0x3f 2bd86: ee af std Y+62, r30 ; 0x3e 2bd88: 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 2bd8a: f0 e2 ldi r31, 0x20 ; 32 2bd8c: 6f 16 cp r6, r31 2bd8e: 71 04 cpc r7, r1 2bd90: 09 f0 breq .+2 ; 0x2bd94 2bd92: 59 ce rjmp .-846 ; 0x2ba46 2bd94: 21 e0 ldi r18, 0x01 ; 1 2bd96: 42 1a sub r4, r18 2bd98: 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){ 2bd9a: 31 e0 ldi r19, 0x01 ; 1 2bd9c: 33 12 cpse r3, r19 2bd9e: 8d ce rjmp .-742 ; 0x2baba 2bda0: 61 96 adiw r28, 0x11 ; 17 2bda2: 8e ad ldd r24, Y+62 ; 0x3e 2bda4: 9f ad ldd r25, Y+63 ; 0x3f 2bda6: 61 97 sbiw r28, 0x11 ; 17 2bda8: 80 96 adiw r24, 0x20 ; 32 2bdaa: 61 96 adiw r28, 0x11 ; 17 2bdac: 9f af std Y+63, r25 ; 0x3f 2bdae: 8e af std Y+62, r24 ; 0x3e 2bdb0: 61 97 sbiw r28, 0x11 ; 17 2bdb2: 2b 96 adiw r28, 0x0b ; 11 2bdb4: ee ad ldd r30, Y+62 ; 0x3e 2bdb6: ff ad ldd r31, Y+63 ; 0x3f 2bdb8: 2b 97 sbiw r28, 0x0b ; 11 2bdba: e0 5c subi r30, 0xC0 ; 192 2bdbc: ff 4f sbci r31, 0xFF ; 255 2bdbe: 2b 96 adiw r28, 0x0b ; 11 2bdc0: ff af std Y+63, r31 ; 0x3f 2bdc2: ee af std Y+62, r30 ; 0x3e 2bdc4: 2b 97 sbiw r28, 0x0b ; 11 2bdc6: 29 96 adiw r28, 0x09 ; 9 2bdc8: 2e ad ldd r18, Y+62 ; 0x3e 2bdca: 3f ad ldd r19, Y+63 ; 0x3f 2bdcc: 29 97 sbiw r28, 0x09 ; 9 2bdce: 22 50 subi r18, 0x02 ; 2 2bdd0: 31 09 sbc r19, r1 2bdd2: 29 96 adiw r28, 0x09 ; 9 2bdd4: 3f af std Y+63, r19 ; 0x3f 2bdd6: 2e af std Y+62, r18 ; 0x3e 2bdd8: 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 2bdda: 23 2b or r18, r19 2bddc: 09 f0 breq .+2 ; 0x2bde0 2bdde: 72 cd rjmp .-1308 ; 0x2b8c4 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); 2bde0: 82 e7 ldi r24, 0x72 ; 114 2bde2: 98 e9 ldi r25, 0x98 ; 152 2bde4: 9f 93 push r25 2bde6: 8f 93 push r24 2bde8: 0f 94 5d 9f call 0x33eba ; 0x33eba 2bdec: 0f 90 pop r0 2bdee: 0f 90 pop r0 } 2bdf0: c6 5a subi r28, 0xA6 ; 166 2bdf2: df 4f sbci r29, 0xFF ; 255 2bdf4: 0f b6 in r0, 0x3f ; 63 2bdf6: f8 94 cli 2bdf8: de bf out 0x3e, r29 ; 62 2bdfa: 0f be out 0x3f, r0 ; 63 2bdfc: cd bf out 0x3d, r28 ; 61 2bdfe: df 91 pop r29 2be00: cf 91 pop r28 2be02: 1f 91 pop r17 2be04: 0f 91 pop r16 2be06: ff 90 pop r15 2be08: ef 90 pop r14 2be0a: df 90 pop r13 2be0c: cf 90 pop r12 2be0e: bf 90 pop r11 2be10: af 90 pop r10 2be12: 9f 90 pop r9 2be14: 8f 90 pop r8 2be16: 7f 90 pop r7 2be18: 6f 90 pop r6 2be1a: 5f 90 pop r5 2be1c: 4f 90 pop r4 2be1e: 3f 90 pop r3 2be20: 2f 90 pop r2 2be22: 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); 2be24: 28 ec ldi r18, 0xC8 ; 200 2be26: 30 e0 ldi r19, 0x00 ; 0 2be28: a7 01 movw r20, r14 2be2a: 68 ee ldi r22, 0xE8 ; 232 2be2c: 73 e0 ldi r23, 0x03 ; 3 2be2e: 84 e0 ldi r24, 0x04 ; 4 2be30: 0e 94 45 c1 call 0x1828a ; 0x1828a /// 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_){ 2be34: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2be38: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2be3c: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2be40: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2be44: 01 97 sbiw r24, 0x01 ; 1 2be46: a1 09 sbc r26, r1 2be48: b1 09 sbc r27, r1 2be4a: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 2be4e: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 2be52: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 2be56: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 2be5a: 1b cf rjmp .-458 ; 0x2bc92 2be5c: 86 01 movw r16, r12 2be5e: 2f cf rjmp .-418 ; 0x2bcbe } /// 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); 2be60: 9e 01 movw r18, r28 2be62: 2d 5b subi r18, 0xBD ; 189 2be64: 3f 4f sbci r19, 0xFF ; 255 2be66: a7 01 movw r20, r14 2be68: 68 ee ldi r22, 0xE8 ; 232 2be6a: 73 e0 ldi r23, 0x03 ; 3 2be6c: 84 e0 ldi r24, 0x04 ; 4 2be6e: 0e 94 ec c1 call 0x183d8 ; 0x183d8 --_Z_; 2be72: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2be76: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2be7a: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2be7e: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2be82: 01 97 sbiw r24, 0x01 ; 1 2be84: a1 09 sbc r26, r1 2be86: b1 09 sbc r27, r1 2be88: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 2be8c: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 2be90: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 2be94: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 2be98: 26 cf rjmp .-436 ; 0x2bce6 } 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); 2be9a: 28 ec ldi r18, 0xC8 ; 200 2be9c: 30 e0 ldi r19, 0x00 ; 0 2be9e: a7 01 movw r20, r14 2bea0: 68 e1 ldi r22, 0x18 ; 24 2bea2: 7c ef ldi r23, 0xFC ; 252 2bea4: 84 e0 ldi r24, 0x04 ; 4 2bea6: 0e 94 45 c1 call 0x1828a ; 0x1828a --_Z_; 2beaa: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 2beae: 90 91 bf 06 lds r25, 0x06BF ; 0x8006bf 2beb2: a0 91 c0 06 lds r26, 0x06C0 ; 0x8006c0 2beb6: b0 91 c1 06 lds r27, 0x06C1 ; 0x8006c1 2beba: 01 97 sbiw r24, 0x01 ; 1 2bebc: a1 09 sbc r26, r1 2bebe: b1 09 sbc r27, r1 2bec0: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 2bec4: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf 2bec8: a0 93 c0 06 sts 0x06C0, r26 ; 0x8006c0 2becc: b0 93 c1 06 sts 0x06C1, r27 ; 0x8006c1 2bed0: 20 cf rjmp .-448 ; 0x2bd12 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); 2bed2: 2d 96 adiw r28, 0x0d ; 13 2bed4: ee ad ldd r30, Y+62 ; 0x3e 2bed6: ff ad ldd r31, Y+63 ; 0x3f 2bed8: 2d 97 sbiw r28, 0x0d ; 13 2beda: 86 ad ldd r24, Z+62 ; 0x3e 2bedc: 97 ad ldd r25, Z+63 ; 0x3f 2bede: 01 2e mov r0, r17 2bee0: 00 0c add r0, r0 2bee2: 22 0b sbc r18, r18 2bee4: 33 0b sbc r19, r19 2bee6: 08 0f add r16, r24 2bee8: 19 1f adc r17, r25 2beea: 21 1d adc r18, r1 2beec: 31 1d adc r19, r1 2beee: 36 95 lsr r19 2bef0: 27 95 ror r18 2bef2: 17 95 ror r17 2bef4: 07 95 ror r16 2bef6: 0f 3f cpi r16, 0xFF ; 255 2bef8: 11 05 cpc r17, r1 2befa: 21 05 cpc r18, r1 2befc: 31 05 cpc r19, r1 2befe: 29 f0 breq .+10 ; 0x2bf0a 2bf00: 20 f0 brcs .+8 ; 0x2bf0a 2bf02: 0f ef ldi r16, 0xFF ; 255 2bf04: 10 e0 ldi r17, 0x00 ; 0 2bf06: 20 e0 ldi r18, 0x00 ; 0 2bf08: 30 e0 ldi r19, 0x00 ; 0 2bf0a: 2f 96 adiw r28, 0x0f ; 15 2bf0c: ee ad ldd r30, Y+62 ; 0x3e 2bf0e: ff ad ldd r31, Y+63 ; 0x3f 2bf10: 2f 97 sbiw r28, 0x0f ; 15 2bf12: 07 8f std Z+31, r16 ; 0x1f 2bf14: 1f cf rjmp .-450 ; 0x2bd54 0002bf16 : /// 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) 2bf16: 2f 92 push r2 2bf18: 3f 92 push r3 2bf1a: 4f 92 push r4 2bf1c: 5f 92 push r5 2bf1e: 6f 92 push r6 2bf20: 7f 92 push r7 2bf22: 8f 92 push r8 2bf24: 9f 92 push r9 2bf26: af 92 push r10 2bf28: bf 92 push r11 2bf2a: cf 92 push r12 2bf2c: df 92 push r13 2bf2e: ef 92 push r14 2bf30: ff 92 push r15 2bf32: 0f 93 push r16 2bf34: 1f 93 push r17 2bf36: cf 93 push r28 2bf38: df 93 push r29 2bf3a: cd b7 in r28, 0x3d ; 61 2bf3c: de b7 in r29, 0x3e ; 62 2bf3e: 6c 97 sbiw r28, 0x1c ; 28 2bf40: 0f b6 in r0, 0x3f ; 63 2bf42: f8 94 cli 2bf44: de bf out 0x3e, r29 ; 62 2bf46: 0f be out 0x3f, r0 ; 63 2bf48: cd bf out 0x3d, r28 ; 61 2bf4a: 6c 01 movw r12, r24 2bf4c: 5b 01 movw r10, r22 2bf4e: 4a 01 movw r8, r20 2bf50: 19 01 movw r2, r18 2bf52: 18 87 std Y+8, r17 ; 0x08 2bf54: 0f 83 std Y+7, r16 ; 0x07 2bf56: fa 82 std Y+2, r15 ; 0x02 2bf58: 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; 2bf5a: d7 01 movw r26, r14 2bf5c: 8d 91 ld r24, X+ 2bf5e: 9c 91 ld r25, X 2bf60: 60 ed ldi r22, 0xD0 ; 208 2bf62: 72 e0 ldi r23, 0x02 ; 2 2bf64: 0f 94 64 a1 call 0x342c8 ; 0x342c8 <__udivmodhi4> 2bf68: 9c 8f std Y+28, r25 ; 0x1c 2bf6a: 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); 2bf6c: 9f 93 push r25 2bf6e: 8f 93 push r24 2bf70: 3f 92 push r3 2bf72: 2f 93 push r18 2bf74: 1f 92 push r1 2bf76: 84 e6 ldi r24, 0x64 ; 100 2bf78: 8f 93 push r24 2bf7a: 9f 92 push r9 2bf7c: 8f 92 push r8 2bf7e: bf 92 push r11 2bf80: af 92 push r10 2bf82: df 92 push r13 2bf84: cf 92 push r12 2bf86: 8a e3 ldi r24, 0x3A ; 58 2bf88: 98 e9 ldi r25, 0x98 ; 152 2bf8a: 9f 93 push r25 2bf8c: 8f 93 push r24 2bf8e: 0f 94 5d 9f call 0x33eba ; 0x33eba 2bf92: 0f b6 in r0, 0x3f ; 63 2bf94: f8 94 cli 2bf96: de bf out 0x3e, r29 ; 62 2bf98: 0f be out 0x3f, r0 ; 63 2bf9a: 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; 2bf9c: 22 27 eor r18, r18 2bf9e: 33 27 eor r19, r19 2bfa0: 22 19 sub r18, r2 2bfa2: 33 09 sbc r19, r3 2bfa4: 3a 8f std Y+26, r19 ; 0x1a 2bfa6: 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)); 2bfa8: c4 01 movw r24, r8 2bfaa: 99 0c add r9, r9 2bfac: aa 0b sbc r26, r26 2bfae: bb 0b sbc r27, r27 2bfb0: 89 87 std Y+9, r24 ; 0x09 2bfb2: 9a 87 std Y+10, r25 ; 0x0a 2bfb4: ab 87 std Y+11, r26 ; 0x0b 2bfb6: 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)); 2bfb8: 95 01 movw r18, r10 2bfba: bb 0c add r11, r11 2bfbc: 44 0b sbc r20, r20 2bfbe: 55 0b sbc r21, r21 2bfc0: 29 8b std Y+17, r18 ; 0x11 2bfc2: 3a 8b std Y+18, r19 ; 0x12 2bfc4: 4b 8b std Y+19, r20 ; 0x13 2bfc6: 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)); 2bfc8: c6 01 movw r24, r12 2bfca: dd 0c add r13, r13 2bfcc: aa 0b sbc r26, r26 2bfce: bb 0b sbc r27, r27 2bfd0: 8d 8b std Y+21, r24 ; 0x15 2bfd2: 9e 8b std Y+22, r25 ; 0x16 2bfd4: af 8b std Y+23, r26 ; 0x17 2bfd6: b8 8f std Y+24, r27 ; 0x18 // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) { if (radius > 0) 2bfd8: 12 14 cp r1, r2 2bfda: 13 04 cpc r1, r3 2bfdc: 0c f0 brlt .+2 ; 0x2bfe0 2bfde: ba c0 rjmp .+372 ; 0x2c154 { dad = dad_max - (ad / k); 2bfe0: 8b 8d ldd r24, Y+27 ; 0x1b 2bfe2: 9c 8d ldd r25, Y+28 ; 0x1c 2bfe4: 6c e3 ldi r22, 0x3C ; 60 2bfe6: 70 e0 ldi r23, 0x00 ; 0 2bfe8: 0f 94 64 a1 call 0x342c8 ; 0x342c8 <__udivmodhi4> 2bfec: 10 e1 ldi r17, 0x10 ; 16 2bfee: 16 1b sub r17, r22 r = (float)(((uint32_t)ad) * radius) / 720; 2bff0: 2b 8d ldd r18, Y+27 ; 0x1b 2bff2: 3c 8d ldd r19, Y+28 ; 0x1c 2bff4: d1 01 movw r26, r2 } else { dad = dad_max - ((719 - ad) / k); r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2bff6: 0f 94 bb a1 call 0x34376 ; 0x34376 <__usmulhisi3> 2bffa: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 2bffe: 20 e0 ldi r18, 0x00 ; 0 2c000: 30 e0 ldi r19, 0x00 ; 0 2c002: 44 e3 ldi r20, 0x34 ; 52 2c004: 54 e4 ldi r21, 0x44 ; 68 2c006: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2c00a: 6b 01 movw r12, r22 2c00c: 7c 01 movw r14, r24 } ar = radians(ad + rotation); 2c00e: 6f 81 ldd r22, Y+7 ; 0x07 2c010: 78 85 ldd r23, Y+8 ; 0x08 2c012: eb 8d ldd r30, Y+27 ; 0x1b 2c014: fc 8d ldd r31, Y+28 ; 0x1c 2c016: 6e 0f add r22, r30 2c018: 7f 1f adc r23, r31 2c01a: 90 e0 ldi r25, 0x00 ; 0 2c01c: 80 e0 ldi r24, 0x00 ; 0 2c01e: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 2c022: 25 e3 ldi r18, 0x35 ; 53 2c024: 3a ef ldi r19, 0xFA ; 250 2c026: 4e e8 ldi r20, 0x8E ; 142 2c028: 5c e3 ldi r21, 0x3C ; 60 2c02a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2c02e: 4b 01 movw r8, r22 2c030: 5c 01 movw r10, r24 int x = (int)(cx + (cos(ar) * r)); 2c032: 0f 94 bd a2 call 0x3457a ; 0x3457a 2c036: 6b 83 std Y+3, r22 ; 0x03 2c038: 7c 83 std Y+4, r23 ; 0x04 2c03a: 8d 83 std Y+5, r24 ; 0x05 2c03c: 9e 83 std Y+6, r25 ; 0x06 int y = (int)(cy + (sin(ar) * r)); 2c03e: c5 01 movw r24, r10 2c040: b4 01 movw r22, r8 2c042: 0f 94 83 a5 call 0x34b06 ; 0x34b06 2c046: 2b 01 movw r4, r22 2c048: 3c 01 movw r6, r24 int z = (int)(z0 - ((float)((int32_t)dz * ad) / 720)); 2c04a: 69 85 ldd r22, Y+9 ; 0x09 2c04c: 7a 85 ldd r23, Y+10 ; 0x0a 2c04e: 8b 85 ldd r24, Y+11 ; 0x0b 2c050: 9c 85 ldd r25, Y+12 ; 0x0c 2c052: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2c056: 4b 01 movw r8, r22 2c058: 5c 01 movw r10, r24 2c05a: 2b 8d ldd r18, Y+27 ; 0x1b 2c05c: 3c 8d ldd r19, Y+28 ; 0x1c 2c05e: a4 e6 ldi r26, 0x64 ; 100 2c060: b0 e0 ldi r27, 0x00 ; 0 2c062: 0f 94 3b a1 call 0x34276 ; 0x34276 <__umulhisi3> 2c066: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2c06a: 20 e0 ldi r18, 0x00 ; 0 2c06c: 30 e0 ldi r19, 0x00 ; 0 2c06e: 44 e3 ldi r20, 0x34 ; 52 2c070: 54 e4 ldi r21, 0x44 ; 68 2c072: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2c076: 9b 01 movw r18, r22 2c078: ac 01 movw r20, r24 2c07a: c5 01 movw r24, r10 2c07c: b4 01 movw r22, r8 2c07e: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 2c082: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 2c086: 6d 87 std Y+13, r22 ; 0x0d 2c088: 7e 87 std Y+14, r23 ; 0x0e 2c08a: 8f 87 std Y+15, r24 ; 0x0f 2c08c: 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)); 2c08e: 69 89 ldd r22, Y+17 ; 0x11 2c090: 7a 89 ldd r23, Y+18 ; 0x12 2c092: 8b 89 ldd r24, Y+19 ; 0x13 2c094: 9c 89 ldd r25, Y+20 ; 0x14 2c096: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2c09a: 4b 01 movw r8, r22 2c09c: 5c 01 movw r10, r24 2c09e: a3 01 movw r20, r6 2c0a0: 92 01 movw r18, r4 2c0a2: c7 01 movw r24, r14 2c0a4: b6 01 movw r22, r12 2c0a6: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2c0aa: 9b 01 movw r18, r22 2c0ac: ac 01 movw r20, r24 2c0ae: c5 01 movw r24, r10 2c0b0: b4 01 movw r22, r8 2c0b2: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2c0b6: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 2c0ba: 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)); 2c0bc: 6d 89 ldd r22, Y+21 ; 0x15 2c0be: 7e 89 ldd r23, Y+22 ; 0x16 2c0c0: 8f 89 ldd r24, Y+23 ; 0x17 2c0c2: 98 8d ldd r25, Y+24 ; 0x18 2c0c4: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2c0c8: 2b 01 movw r4, r22 2c0ca: 3c 01 movw r6, r24 2c0cc: a7 01 movw r20, r14 2c0ce: 96 01 movw r18, r12 2c0d0: 6b 81 ldd r22, Y+3 ; 0x03 2c0d2: 7c 81 ldd r23, Y+4 ; 0x04 2c0d4: 8d 81 ldd r24, Y+5 ; 0x05 2c0d6: 9e 81 ldd r25, Y+6 ; 0x06 2c0d8: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2c0dc: 9b 01 movw r18, r22 2c0de: ac 01 movw r20, r24 2c0e0: c3 01 movw r24, r6 2c0e2: b2 01 movw r22, r4 2c0e4: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2c0e8: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 2c0ec: 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)) 2c0ee: 01 e0 ldi r16, 0x01 ; 1 2c0f0: 20 e4 ldi r18, 0x40 ; 64 2c0f2: 31 e0 ldi r19, 0x01 ; 1 2c0f4: 4d 85 ldd r20, Y+13 ; 0x0d 2c0f6: 5e 85 ldd r21, Y+14 ; 0x0e 2c0f8: b4 01 movw r22, r8 2c0fa: 0e 94 cf c2 call 0x1859e ; 0x1859e 2c0fe: 21 2f mov r18, r17 2c100: 30 e0 ldi r19, 0x00 ; 0 2c102: 88 23 and r24, r24 2c104: b9 f1 breq .+110 ; 0x2c174 2c106: 4b 8d ldd r20, Y+27 ; 0x1b 2c108: 5c 8d ldd r21, Y+28 ; 0x1c 2c10a: 42 0f add r20, r18 2c10c: 53 1f adc r21, r19 { ad += dad + 1; 2c10e: 4f 5f subi r20, 0xFF ; 255 2c110: 5f 4f sbci r21, 0xFF ; 255 2c112: 5c 8f std Y+28, r21 ; 0x1c 2c114: 4b 8f std Y+27, r20 ; 0x1b ret = true; break; } ad += dad; } if (pad) *pad = ad; 2c116: eb 8d ldd r30, Y+27 ; 0x1b 2c118: fc 8d ldd r31, Y+28 ; 0x1c 2c11a: a9 81 ldd r26, Y+1 ; 0x01 2c11c: ba 81 ldd r27, Y+2 ; 0x02 2c11e: ed 93 st X+, r30 2c120: fc 93 st X, r31 // if(ret){ // lcd_set_cursor(0, 4); // lcd_print(" "); // } return ret; } 2c122: 6c 96 adiw r28, 0x1c ; 28 2c124: 0f b6 in r0, 0x3f ; 63 2c126: f8 94 cli 2c128: de bf out 0x3e, r29 ; 62 2c12a: 0f be out 0x3f, r0 ; 63 2c12c: cd bf out 0x3d, r28 ; 61 2c12e: df 91 pop r29 2c130: cf 91 pop r28 2c132: 1f 91 pop r17 2c134: 0f 91 pop r16 2c136: ff 90 pop r15 2c138: ef 90 pop r14 2c13a: df 90 pop r13 2c13c: cf 90 pop r12 2c13e: bf 90 pop r11 2c140: af 90 pop r10 2c142: 9f 90 pop r9 2c144: 8f 90 pop r8 2c146: 7f 90 pop r7 2c148: 6f 90 pop r6 2c14a: 5f 90 pop r5 2c14c: 4f 90 pop r4 2c14e: 3f 90 pop r3 2c150: 2f 90 pop r2 2c152: 08 95 ret dad = dad_max - (ad / k); r = (float)(((uint32_t)ad) * radius) / 720; } else { dad = dad_max - ((719 - ad) / k); 2c154: 2f ec ldi r18, 0xCF ; 207 2c156: 32 e0 ldi r19, 0x02 ; 2 2c158: ab 8d ldd r26, Y+27 ; 0x1b 2c15a: bc 8d ldd r27, Y+28 ; 0x1c 2c15c: 2a 1b sub r18, r26 2c15e: 3b 0b sbc r19, r27 2c160: c9 01 movw r24, r18 2c162: 6c e3 ldi r22, 0x3C ; 60 2c164: 70 e0 ldi r23, 0x00 ; 0 2c166: 0f 94 64 a1 call 0x342c8 ; 0x342c8 <__udivmodhi4> 2c16a: 10 e1 ldi r17, 0x10 ; 16 2c16c: 16 1b sub r17, r22 r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2c16e: a9 8d ldd r26, Y+25 ; 0x19 2c170: ba 8d ldd r27, Y+26 ; 0x1a 2c172: 41 cf rjmp .-382 ; 0x2bff6 // lcd_set_cursor(0, 4); // char text[10]; // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) 2c174: 2f 5f subi r18, 0xFF ; 255 2c176: 3f 4f sbci r19, 0xFF ; 255 2c178: ab 8d ldd r26, Y+27 ; 0x1b 2c17a: bc 8d ldd r27, Y+28 ; 0x1c 2c17c: a2 0f add r26, r18 2c17e: b3 1f adc r27, r19 2c180: bc 8f std Y+28, r27 ; 0x1c 2c182: ab 8f std Y+27, r26 ; 0x1b 2c184: a0 3d cpi r26, 0xD0 ; 208 2c186: b2 40 sbci r27, 0x02 ; 2 2c188: 08 f4 brcc .+2 ; 0x2c18c 2c18a: 26 cf rjmp .-436 ; 0x2bfd8 2c18c: c4 cf rjmp .-120 ; 0x2c116 0002c18e : float mesh_bed_leveling::get_z(float x, float y) { 2c18e: 2f 92 push r2 2c190: 3f 92 push r3 2c192: 4f 92 push r4 2c194: 5f 92 push r5 2c196: 6f 92 push r6 2c198: 7f 92 push r7 2c19a: 8f 92 push r8 2c19c: 9f 92 push r9 2c19e: af 92 push r10 2c1a0: bf 92 push r11 2c1a2: cf 92 push r12 2c1a4: df 92 push r13 2c1a6: ef 92 push r14 2c1a8: ff 92 push r15 2c1aa: 0f 93 push r16 2c1ac: 1f 93 push r17 2c1ae: cf 93 push r28 2c1b0: df 93 push r29 2c1b2: 00 d0 rcall .+0 ; 0x2c1b4 2c1b4: 00 d0 rcall .+0 ; 0x2c1b6 2c1b6: 00 d0 rcall .+0 ; 0x2c1b8 2c1b8: 1f 92 push r1 2c1ba: cd b7 in r28, 0x3d ; 61 2c1bc: de b7 in r29, 0x3e ; 62 2c1be: 2b 01 movw r4, r22 2c1c0: 3c 01 movw r6, r24 2c1c2: 49 01 movw r8, r18 2c1c4: 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)); 2c1c6: 20 e0 ldi r18, 0x00 ; 0 2c1c8: 30 e0 ldi r19, 0x00 ; 0 2c1ca: 40 ec ldi r20, 0xC0 ; 192 2c1cc: 51 e4 ldi r21, 0x41 ; 65 2c1ce: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 2c1d2: 20 e0 ldi r18, 0x00 ; 0 2c1d4: 30 e0 ldi r19, 0x00 ; 0 2c1d6: 48 e0 ldi r20, 0x08 ; 8 2c1d8: 52 e4 ldi r21, 0x42 ; 66 2c1da: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2c1de: 6b 01 movw r12, r22 2c1e0: 7c 01 movw r14, r24 2c1e2: 0f 94 6a a3 call 0x346d4 ; 0x346d4 2c1e6: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> if (i < 0) { i = 0; 2c1ea: 31 2c mov r3, r1 2c1ec: 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) { 2c1ee: 77 fd sbrc r23, 7 2c1f0: 1e c0 rjmp .+60 ; 0x2c22e 2c1f2: 1b 01 movw r2, r22 2c1f4: 66 30 cpi r22, 0x06 ; 6 2c1f6: 71 05 cpc r23, r1 2c1f8: 1c f0 brlt .+6 ; 0x2c200 2c1fa: 45 e0 ldi r20, 0x05 ; 5 2c1fc: 24 2e mov r2, r20 2c1fe: 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; } 2c200: 82 2d mov r24, r2 2c202: 0f 94 24 8c call 0x31848 ; 0x31848 2c206: 20 e0 ldi r18, 0x00 ; 0 2c208: 30 e0 ldi r19, 0x00 ; 0 2c20a: 48 eb ldi r20, 0xB8 ; 184 2c20c: 51 e4 ldi r21, 0x41 ; 65 2c20e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2c212: 9b 01 movw r18, r22 2c214: 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; 2c216: c3 01 movw r24, r6 2c218: b2 01 movw r22, r4 2c21a: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 2c21e: 20 e0 ldi r18, 0x00 ; 0 2c220: 30 e0 ldi r19, 0x00 ; 0 2c222: 48 e0 ldi r20, 0x08 ; 8 2c224: 52 e4 ldi r21, 0x42 ; 66 2c226: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2c22a: 6b 01 movw r12, r22 2c22c: 7c 01 movw r14, r24 } j = int(floor((y - (BED_Y0 + Y_PROBE_OFFSET_FROM_EXTRUDER)) / y_mesh_density)); 2c22e: 20 e0 ldi r18, 0x00 ; 0 2c230: 30 e0 ldi r19, 0x00 ; 0 2c232: 40 ec ldi r20, 0xC0 ; 192 2c234: 50 e4 ldi r21, 0x40 ; 64 2c236: c5 01 movw r24, r10 2c238: b4 01 movw r22, r8 2c23a: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 2c23e: 20 e0 ldi r18, 0x00 ; 0 2c240: 30 e0 ldi r19, 0x00 ; 0 2c242: 48 e0 ldi r20, 0x08 ; 8 2c244: 52 e4 ldi r21, 0x42 ; 66 2c246: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2c24a: 69 83 std Y+1, r22 ; 0x01 2c24c: 7a 83 std Y+2, r23 ; 0x02 2c24e: 8b 83 std Y+3, r24 ; 0x03 2c250: 9c 83 std Y+4, r25 ; 0x04 2c252: 0f 94 6a a3 call 0x346d4 ; 0x346d4 2c256: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> if (j < 0) { 2c25a: 77 fd sbrc r23, 7 2c25c: da c0 rjmp .+436 ; 0x2c412 2c25e: 7a 87 std Y+10, r23 ; 0x0a 2c260: 69 87 std Y+9, r22 ; 0x09 2c262: 66 30 cpi r22, 0x06 ; 6 2c264: 71 05 cpc r23, r1 2c266: 24 f0 brlt .+8 ; 0x2c270 2c268: e5 e0 ldi r30, 0x05 ; 5 2c26a: f0 e0 ldi r31, 0x00 ; 0 2c26c: fa 87 std Y+10, r31 ; 0x0a 2c26e: e9 87 std Y+9, r30 ; 0x09 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 2c270: 89 85 ldd r24, Y+9 ; 0x09 2c272: 0f 94 24 8c call 0x31848 ; 0x31848 2c276: 20 e0 ldi r18, 0x00 ; 0 2c278: 30 e0 ldi r19, 0x00 ; 0 2c27a: 40 ea ldi r20, 0xA0 ; 160 2c27c: 50 e4 ldi r21, 0x40 ; 64 2c27e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2c282: 9b 01 movw r18, r22 2c284: 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; 2c286: c5 01 movw r24, r10 2c288: b4 01 movw r22, r8 2c28a: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 2c28e: 20 e0 ldi r18, 0x00 ; 0 2c290: 30 e0 ldi r19, 0x00 ; 0 2c292: 48 e0 ldi r20, 0x08 ; 8 2c294: 52 e4 ldi r21, 0x42 ; 66 2c296: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2c29a: 69 83 std Y+1, r22 ; 0x01 2c29c: 7a 83 std Y+2, r23 ; 0x02 2c29e: 8b 83 std Y+3, r24 ; 0x03 2c2a0: 9c 83 std Y+4, r25 ; 0x04 } float si = 1.f-s; 2c2a2: a7 01 movw r20, r14 2c2a4: 96 01 movw r18, r12 2c2a6: 60 e0 ldi r22, 0x00 ; 0 2c2a8: 70 e0 ldi r23, 0x00 ; 0 2c2aa: 80 e8 ldi r24, 0x80 ; 128 2c2ac: 9f e3 ldi r25, 0x3F ; 63 2c2ae: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 2c2b2: 2b 01 movw r4, r22 2c2b4: 3c 01 movw r6, r24 float z0 = si * z_values[j ][i] + s * z_values[j ][i+1]; 2c2b6: 91 01 movw r18, r2 2c2b8: 2f 5f subi r18, 0xFF ; 255 2c2ba: 3f 4f sbci r19, 0xFF ; 255 2c2bc: 3e 83 std Y+6, r19 ; 0x06 2c2be: 2d 83 std Y+5, r18 ; 0x05 float z1 = si * z_values[j+1][i] + s * z_values[j+1][i+1]; 2c2c0: 89 85 ldd r24, Y+9 ; 0x09 2c2c2: 9a 85 ldd r25, Y+10 ; 0x0a 2c2c4: 01 96 adiw r24, 0x01 ; 1 2c2c6: 98 87 std Y+8, r25 ; 0x08 2c2c8: 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]; 2c2ca: 27 e0 ldi r18, 0x07 ; 7 2c2cc: e9 85 ldd r30, Y+9 ; 0x09 2c2ce: fa 85 ldd r31, Y+10 ; 0x0a 2c2d0: 2e 9f mul r18, r30 2c2d2: 80 01 movw r16, r0 2c2d4: 2f 9f mul r18, r31 2c2d6: 10 0d add r17, r0 2c2d8: 11 24 eor r1, r1 2c2da: f8 01 movw r30, r16 2c2dc: e2 0d add r30, r2 2c2de: f3 1d adc r31, r3 2c2e0: ee 0f add r30, r30 2c2e2: ff 1f adc r31, r31 2c2e4: ee 0f add r30, r30 2c2e6: ff 1f adc r31, r31 2c2e8: e4 56 subi r30, 0x64 ; 100 2c2ea: fd 4e sbci r31, 0xED ; 237 2c2ec: 21 81 ldd r18, Z+1 ; 0x01 2c2ee: 32 81 ldd r19, Z+2 ; 0x02 2c2f0: 43 81 ldd r20, Z+3 ; 0x03 2c2f2: 54 81 ldd r21, Z+4 ; 0x04 2c2f4: c3 01 movw r24, r6 2c2f6: b2 01 movw r22, r4 2c2f8: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2c2fc: 4b 01 movw r8, r22 2c2fe: 5c 01 movw r10, r24 2c300: ed 81 ldd r30, Y+5 ; 0x05 2c302: fe 81 ldd r31, Y+6 ; 0x06 2c304: e0 0f add r30, r16 2c306: f1 1f adc r31, r17 2c308: ee 0f add r30, r30 2c30a: ff 1f adc r31, r31 2c30c: ee 0f add r30, r30 2c30e: ff 1f adc r31, r31 2c310: e4 56 subi r30, 0x64 ; 100 2c312: fd 4e sbci r31, 0xED ; 237 2c314: 21 81 ldd r18, Z+1 ; 0x01 2c316: 32 81 ldd r19, Z+2 ; 0x02 2c318: 43 81 ldd r20, Z+3 ; 0x03 2c31a: 54 81 ldd r21, Z+4 ; 0x04 2c31c: c7 01 movw r24, r14 2c31e: b6 01 movw r22, r12 2c320: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2c324: 9b 01 movw r18, r22 2c326: ac 01 movw r20, r24 2c328: c5 01 movw r24, r10 2c32a: b4 01 movw r22, r8 2c32c: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2c330: 4b 01 movw r8, r22 2c332: 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; 2c334: 29 81 ldd r18, Y+1 ; 0x01 2c336: 3a 81 ldd r19, Y+2 ; 0x02 2c338: 4b 81 ldd r20, Y+3 ; 0x03 2c33a: 5c 81 ldd r21, Y+4 ; 0x04 2c33c: 60 e0 ldi r22, 0x00 ; 0 2c33e: 70 e0 ldi r23, 0x00 ; 0 2c340: 80 e8 ldi r24, 0x80 ; 128 2c342: 9f e3 ldi r25, 0x3F ; 63 2c344: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 2c348: 9b 01 movw r18, r22 2c34a: ac 01 movw r20, r24 2c34c: c5 01 movw r24, r10 2c34e: b4 01 movw r22, r8 2c350: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2c354: 4b 01 movw r8, r22 2c356: 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]; 2c358: 27 e0 ldi r18, 0x07 ; 7 2c35a: ef 81 ldd r30, Y+7 ; 0x07 2c35c: f8 85 ldd r31, Y+8 ; 0x08 2c35e: 2e 9f mul r18, r30 2c360: c0 01 movw r24, r0 2c362: 2f 9f mul r18, r31 2c364: 90 0d add r25, r0 2c366: 11 24 eor r1, r1 2c368: 9a 87 std Y+10, r25 ; 0x0a 2c36a: 89 87 std Y+9, r24 ; 0x09 2c36c: fc 01 movw r30, r24 2c36e: e2 0d add r30, r2 2c370: f3 1d adc r31, r3 2c372: ee 0f add r30, r30 2c374: ff 1f adc r31, r31 2c376: ee 0f add r30, r30 2c378: ff 1f adc r31, r31 2c37a: e4 56 subi r30, 0x64 ; 100 2c37c: fd 4e sbci r31, 0xED ; 237 2c37e: 21 81 ldd r18, Z+1 ; 0x01 2c380: 32 81 ldd r19, Z+2 ; 0x02 2c382: 43 81 ldd r20, Z+3 ; 0x03 2c384: 54 81 ldd r21, Z+4 ; 0x04 2c386: c3 01 movw r24, r6 2c388: b2 01 movw r22, r4 2c38a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2c38e: 2b 01 movw r4, r22 2c390: 3c 01 movw r6, r24 2c392: 89 85 ldd r24, Y+9 ; 0x09 2c394: 9a 85 ldd r25, Y+10 ; 0x0a 2c396: ed 81 ldd r30, Y+5 ; 0x05 2c398: fe 81 ldd r31, Y+6 ; 0x06 2c39a: 8e 0f add r24, r30 2c39c: 9f 1f adc r25, r31 2c39e: 88 0f add r24, r24 2c3a0: 99 1f adc r25, r25 2c3a2: 88 0f add r24, r24 2c3a4: 99 1f adc r25, r25 2c3a6: 84 56 subi r24, 0x64 ; 100 2c3a8: 9d 4e sbci r25, 0xED ; 237 2c3aa: fc 01 movw r30, r24 2c3ac: 21 81 ldd r18, Z+1 ; 0x01 2c3ae: 32 81 ldd r19, Z+2 ; 0x02 2c3b0: 43 81 ldd r20, Z+3 ; 0x03 2c3b2: 54 81 ldd r21, Z+4 ; 0x04 2c3b4: c7 01 movw r24, r14 2c3b6: b6 01 movw r22, r12 2c3b8: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2c3bc: 9b 01 movw r18, r22 2c3be: ac 01 movw r20, r24 2c3c0: c3 01 movw r24, r6 2c3c2: b2 01 movw r22, r4 2c3c4: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> return (1.f-t) * z0 + t * z1; 2c3c8: 29 81 ldd r18, Y+1 ; 0x01 2c3ca: 3a 81 ldd r19, Y+2 ; 0x02 2c3cc: 4b 81 ldd r20, Y+3 ; 0x03 2c3ce: 5c 81 ldd r21, Y+4 ; 0x04 2c3d0: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2c3d4: 9b 01 movw r18, r22 2c3d6: ac 01 movw r20, r24 2c3d8: c5 01 movw r24, r10 2c3da: b4 01 movw r22, r8 2c3dc: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> } 2c3e0: 2a 96 adiw r28, 0x0a ; 10 2c3e2: 0f b6 in r0, 0x3f ; 63 2c3e4: f8 94 cli 2c3e6: de bf out 0x3e, r29 ; 62 2c3e8: 0f be out 0x3f, r0 ; 63 2c3ea: cd bf out 0x3d, r28 ; 61 2c3ec: df 91 pop r29 2c3ee: cf 91 pop r28 2c3f0: 1f 91 pop r17 2c3f2: 0f 91 pop r16 2c3f4: ff 90 pop r15 2c3f6: ef 90 pop r14 2c3f8: df 90 pop r13 2c3fa: cf 90 pop r12 2c3fc: bf 90 pop r11 2c3fe: af 90 pop r10 2c400: 9f 90 pop r9 2c402: 8f 90 pop r8 2c404: 7f 90 pop r7 2c406: 6f 90 pop r6 2c408: 5f 90 pop r5 2c40a: 4f 90 pop r4 2c40c: 3f 90 pop r3 2c40e: 2f 90 pop r2 2c410: 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; 2c412: 1a 86 std Y+10, r1 ; 0x0a 2c414: 19 86 std Y+9, r1 ; 0x09 2c416: 45 cf rjmp .-374 ; 0x2c2a2 0002c418 : 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) { 2c418: 1f 93 push r17 2c41a: cf 93 push r28 2c41c: df 93 push r29 2c41e: 00 d0 rcall .+0 ; 0x2c420 2c420: 1f 92 push r1 2c422: 1f 92 push r1 2c424: cd b7 in r28, 0x3d ; 61 2c426: de b7 in r29, 0x3e ; 62 2c428: 16 2f mov r17, r22 SendMsg(RequestMsg(RequestMsgCodes::Read, index)); 2c42a: 48 2f mov r20, r24 2c42c: 62 e5 ldi r22, 0x52 ; 82 2c42e: ce 01 movw r24, r28 2c430: 01 96 adiw r24, 0x01 ; 1 2c432: 0f 94 b2 87 call 0x30f64 ; 0x30f64 2c436: 49 81 ldd r20, Y+1 ; 0x01 2c438: 5a 81 ldd r21, Y+2 ; 0x02 2c43a: 6b 81 ldd r22, Y+3 ; 0x03 2c43c: 7c 81 ldd r23, Y+4 ; 0x04 2c43e: 8d 81 ldd r24, Y+5 ; 0x05 2c440: 0f 94 da 3c call 0x279b4 ; 0x279b4 scopeState = nextState; 2c444: 10 93 28 12 sts 0x1228, r17 ; 0x801228 } 2c448: 0f 90 pop r0 2c44a: 0f 90 pop r0 2c44c: 0f 90 pop r0 2c44e: 0f 90 pop r0 2c450: 0f 90 pop r0 2c452: df 91 pop r29 2c454: cf 91 pop r28 2c456: 1f 91 pop r17 2c458: 08 95 ret 0002c45a : SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); scopeState = ScopeState::QuerySent; } void ProtocolLogic::StartReading8bitRegisters() { regIndex = 0; 2c45a: 10 92 73 12 sts 0x1273, r1 ; 0x801273 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); 2c45e: ef ee ldi r30, 0xEF ; 239 2c460: fc e9 ldi r31, 0x9C ; 156 2c462: 84 91 lpm r24, Z 2c464: 67 e0 ldi r22, 0x07 ; 7 2c466: 0d 94 0c 62 jmp 0x2c418 ; 0x2c418 0002c46a : regIndex = 0; SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); } ProtocolLogic::ScopeState __attribute__((noinline)) ProtocolLogic::ProcessRead16bitRegister(ProtocolLogic::ScopeState stateAtEnd) { regs16[regIndex] = rsp.paramValue; 2c46a: e0 91 73 12 lds r30, 0x1273 ; 0x801273 2c46e: ae 2f mov r26, r30 2c470: b0 e0 ldi r27, 0x00 ; 0 2c472: aa 0f add r26, r26 2c474: bb 1f adc r27, r27 2c476: a3 59 subi r26, 0x93 ; 147 2c478: bd 4e sbci r27, 0xED ; 237 2c47a: 20 91 40 12 lds r18, 0x1240 ; 0x801240 2c47e: 30 91 41 12 lds r19, 0x1241 ; 0x801241 2c482: 2d 93 st X+, r18 2c484: 3c 93 st X, r19 ++regIndex; 2c486: ef 5f subi r30, 0xFF ; 255 2c488: e0 93 73 12 sts 0x1273, r30 ; 0x801273 if (regIndex >= regs16Count) { 2c48c: e2 30 cpi r30, 0x02 ; 2 2c48e: 40 f4 brcc .+16 ; 0x2c4a0 return stateAtEnd; } else { SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 2c490: f0 e0 ldi r31, 0x00 ; 0 2c492: ea 52 subi r30, 0x2A ; 42 2c494: f3 46 sbci r31, 0x63 ; 99 2c496: 84 91 lpm r24, Z 2c498: 68 e0 ldi r22, 0x08 ; 8 2c49a: 0f 94 0c 62 call 0x2c418 ; 0x2c418 } return ScopeState::Reading16bitRegisters; 2c49e: 88 e0 ldi r24, 0x08 ; 8 } 2c4a0: 08 95 ret 0002c4a2 : regIndex = 0; SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } void ProtocolLogic::ProcessRead8bitRegister() { regs8[regIndex] = rsp.paramValue; 2c4a2: e0 91 73 12 lds r30, 0x1273 ; 0x801273 2c4a6: ae 2f mov r26, r30 2c4a8: b0 e0 ldi r27, 0x00 ; 0 2c4aa: a6 59 subi r26, 0x96 ; 150 2c4ac: bd 4e sbci r27, 0xED ; 237 2c4ae: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2c4b2: 8c 93 st X, r24 ++regIndex; 2c4b4: ef 5f subi r30, 0xFF ; 255 2c4b6: e0 93 73 12 sts 0x1273, r30 ; 0x801273 if (regIndex >= regs8Count) { 2c4ba: e3 30 cpi r30, 0x03 ; 3 2c4bc: 40 f0 brcs .+16 ; 0x2c4ce SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } } void ProtocolLogic::StartReading16bitRegisters() { regIndex = 0; 2c4be: 10 92 73 12 sts 0x1273, r1 ; 0x801273 SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 2c4c2: e6 ed ldi r30, 0xD6 ; 214 2c4c4: fc e9 ldi r31, 0x9C ; 156 2c4c6: 84 91 lpm r24, Z 2c4c8: 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); 2c4ca: 0d 94 0c 62 jmp 0x2c418 ; 0x2c418 2c4ce: f0 e0 ldi r31, 0x00 ; 0 2c4d0: e1 51 subi r30, 0x11 ; 17 2c4d2: f3 46 sbci r31, 0x63 ; 99 2c4d4: 84 91 lpm r24, Z 2c4d6: 67 e0 ldi r22, 0x07 ; 7 2c4d8: f8 cf rjmp .-16 ; 0x2c4ca 0002c4da : if (!ExpectsResponse()) { ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { 2c4da: cf 93 push r28 2c4dc: df 93 push r29 2c4de: 00 d0 rcall .+0 ; 0x2c4e0 2c4e0: 00 d0 rcall .+0 ; 0x2c4e2 2c4e2: 00 d0 rcall .+0 ; 0x2c4e4 2c4e4: 1f 92 push r1 2c4e6: cd b7 in r28, 0x3d ; 61 2c4e8: de b7 in r29, 0x3e ; 62 switch (plannedRq.code) { 2c4ea: 80 91 2f 12 lds r24, 0x122F ; 0x80122f 2c4ee: 82 34 cpi r24, 0x42 ; 66 2c4f0: 09 f4 brne .+2 ; 0x2c4f4 2c4f2: 46 c0 rjmp .+140 ; 0x2c580 2c4f4: b8 f5 brcc .+110 ; 0x2c564 2c4f6: 88 23 and r24, r24 2c4f8: 09 f4 brne .+2 ; 0x2c4fc 2c4fa: 72 c0 rjmp .+228 ; 0x2c5e0 plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; default: // commands currentScope = Scope::Command; 2c4fc: 84 e0 ldi r24, 0x04 ; 4 2c4fe: 80 93 27 12 sts 0x1227, r24 ; 0x801227 2c502: 85 e0 ldi r24, 0x05 ; 5 2c504: ef e2 ldi r30, 0x2F ; 47 2c506: f2 e1 ldi r31, 0x12 ; 18 2c508: de 01 movw r26, r28 2c50a: 16 96 adiw r26, 0x06 ; 6 2c50c: 01 90 ld r0, Z+ 2c50e: 0d 92 st X+, r0 2c510: 8a 95 dec r24 2c512: e1 f7 brne .-8 ; 0x2c50c StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 2c514: 85 e0 ldi r24, 0x05 ; 5 2c516: fe 01 movw r30, r28 2c518: 36 96 adiw r30, 0x06 ; 6 2c51a: aa e2 ldi r26, 0x2A ; 42 2c51c: b2 e1 ldi r27, 0x12 ; 18 2c51e: 01 90 ld r0, Z+ 2c520: 0d 92 st X+, r0 2c522: 8a 95 dec r24 2c524: e1 f7 brne .-8 ; 0x2c51e SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); 2c526: 40 e0 ldi r20, 0x00 ; 0 2c528: 60 e0 ldi r22, 0x00 ; 0 2c52a: ce 01 movw r24, r28 2c52c: 01 96 adiw r24, 0x01 ; 1 2c52e: 0f 94 b2 87 call 0x30f64 ; 0x30f64 2c532: 85 e0 ldi r24, 0x05 ; 5 2c534: fe 01 movw r30, r28 2c536: 31 96 adiw r30, 0x01 ; 1 2c538: af e2 ldi r26, 0x2F ; 47 2c53a: b2 e1 ldi r27, 0x12 ; 18 2c53c: 01 90 ld r0, Z+ 2c53e: 0d 92 st X+, r0 2c540: 8a 95 dec r24 2c542: e1 f7 brne .-8 ; 0x2c53c void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 2c544: 85 e0 ldi r24, 0x05 ; 5 2c546: 80 93 28 12 sts 0x1228, r24 ; 0x801228 SendMsg(rq); 2c54a: 40 91 2a 12 lds r20, 0x122A ; 0x80122a 2c54e: 50 91 2b 12 lds r21, 0x122B ; 0x80122b 2c552: 60 91 2c 12 lds r22, 0x122C ; 0x80122c 2c556: 70 91 2d 12 lds r23, 0x122D ; 0x80122d 2c55a: 80 91 2e 12 lds r24, 0x122E ; 0x80122e 2c55e: 0f 94 da 3c call 0x279b4 ; 0x279b4 2c562: 2e c0 rjmp .+92 ; 0x2c5c0 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { switch (plannedRq.code) { 2c564: 82 35 cpi r24, 0x52 ; 82 2c566: b1 f1 breq .+108 ; 0x2c5d4 2c568: 87 35 cpi r24, 0x57 ; 87 2c56a: 41 f6 brne .-112 ; 0x2c4fc 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); 2c56c: 60 91 31 12 lds r22, 0x1231 ; 0x801231 2c570: 70 91 32 12 lds r23, 0x1232 ; 0x801232 2c574: 4c e0 ldi r20, 0x0C ; 12 2c576: 80 91 30 12 lds r24, 0x1230 ; 0x801230 2c57a: 0f 94 45 3d call 0x27a8a ; 0x27a8a 2c57e: 11 c0 rjmp .+34 ; 0x2c5a2 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); scopeState = ScopeState::FilamentSensorStateSent; } void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); 2c580: 40 91 30 12 lds r20, 0x1230 ; 0x801230 2c584: 62 e4 ldi r22, 0x42 ; 66 2c586: ce 01 movw r24, r28 2c588: 01 96 adiw r24, 0x01 ; 1 2c58a: 0f 94 b2 87 call 0x30f64 ; 0x30f64 2c58e: 49 81 ldd r20, Y+1 ; 0x01 2c590: 5a 81 ldd r21, Y+2 ; 0x02 2c592: 6b 81 ldd r22, Y+3 ; 0x03 2c594: 7c 81 ldd r23, Y+4 ; 0x04 2c596: 8d 81 ldd r24, Y+5 ; 0x05 2c598: 0f 94 da 3c call 0x279b4 ; 0x279b4 scopeState = ScopeState::ButtonSent; 2c59c: 8a e0 ldi r24, 0x0A ; 10 2c59e: 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); 2c5a2: 40 e0 ldi r20, 0x00 ; 0 2c5a4: 60 e0 ldi r22, 0x00 ; 0 2c5a6: ce 01 movw r24, r28 2c5a8: 01 96 adiw r24, 0x01 ; 1 2c5aa: 0f 94 b2 87 call 0x30f64 ; 0x30f64 2c5ae: 85 e0 ldi r24, 0x05 ; 5 2c5b0: fe 01 movw r30, r28 2c5b2: 31 96 adiw r30, 0x01 ; 1 2c5b4: af e2 ldi r26, 0x2F ; 47 2c5b6: b2 e1 ldi r27, 0x12 ; 18 2c5b8: 01 90 ld r0, Z+ 2c5ba: 0d 92 st X+, r0 2c5bc: 8a 95 dec r24 2c5be: e1 f7 brne .-8 ; 0x2c5b8 default: // commands currentScope = Scope::Command; SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); CommandRestart(); return true; 2c5c0: 81 e0 ldi r24, 0x01 ; 1 } } 2c5c2: 2a 96 adiw r28, 0x0a ; 10 2c5c4: 0f b6 in r0, 0x3f ; 63 2c5c6: f8 94 cli 2c5c8: de bf out 0x3e, r29 ; 62 2c5ca: 0f be out 0x3f, r0 ; 63 2c5cc: cd bf out 0x3d, r28 ; 61 2c5ce: df 91 pop r29 2c5d0: cf 91 pop r28 2c5d2: 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); 2c5d4: 6b e0 ldi r22, 0x0B ; 11 2c5d6: 80 91 30 12 lds r24, 0x1230 ; 0x801230 2c5da: 0f 94 0c 62 call 0x2c418 ; 0x2c418 2c5de: e1 cf rjmp .-62 ; 0x2c5a2 case RequestMsgCodes::Write: SendWriteRegister(plannedRq.value, plannedRq.value2, ScopeState::WriteRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; 2c5e0: 80 e0 ldi r24, 0x00 ; 0 2c5e2: ef cf rjmp .-34 ; 0x2c5c2 0002c5e4 : void ProtocolLogic::WriteRegister(uint8_t address, uint16_t data) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Write, address, data)); } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { 2c5e4: cf 93 push r28 2c5e6: df 93 push r29 2c5e8: 00 d0 rcall .+0 ; 0x2c5ea 2c5ea: 1f 92 push r1 2c5ec: 1f 92 push r1 2c5ee: cd b7 in r28, 0x3d ; 61 2c5f0: de b7 in r29, 0x3e ; 62 2c5f2: 49 83 std Y+1, r20 ; 0x01 2c5f4: 5a 83 std Y+2, r21 ; 0x02 2c5f6: 6b 83 std Y+3, r22 ; 0x03 2c5f8: 7c 83 std Y+4, r23 ; 0x04 2c5fa: 8d 83 std Y+5, r24 ; 0x05 plannedRq = rq; 2c5fc: 85 e0 ldi r24, 0x05 ; 5 2c5fe: fe 01 movw r30, r28 2c600: 31 96 adiw r30, 0x01 ; 1 2c602: af e2 ldi r26, 0x2F ; 47 2c604: b2 e1 ldi r27, 0x12 ; 18 2c606: 01 90 ld r0, Z+ 2c608: 0d 92 st X+, r0 2c60a: 8a 95 dec r24 2c60c: e1 f7 brne .-8 ; 0x2c606 if (!ExpectsResponse()) { 2c60e: 80 91 28 12 lds r24, 0x1228 ; 0x801228 2c612: 87 ff sbrs r24, 7 2c614: 09 c0 rjmp .+18 ; 0x2c628 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } 2c616: 0f 90 pop r0 2c618: 0f 90 pop r0 2c61a: 0f 90 pop r0 2c61c: 0f 90 pop r0 2c61e: 0f 90 pop r0 2c620: df 91 pop r29 2c622: cf 91 pop r28 } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { plannedRq = rq; if (!ExpectsResponse()) { ActivatePlannedRequest(); 2c624: 0d 94 6d 62 jmp 0x2c4da ; 0x2c4da } // otherwise wait for an empty window to activate the request } 2c628: 0f 90 pop r0 2c62a: 0f 90 pop r0 2c62c: 0f 90 pop r0 2c62e: 0f 90 pop r0 2c630: 0f 90 pop r0 2c632: df 91 pop r29 2c634: cf 91 pop r28 2c636: 08 95 ret 0002c638 : void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); } void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { 2c638: cf 93 push r28 2c63a: df 93 push r29 2c63c: 00 d0 rcall .+0 ; 0x2c63e 2c63e: 1f 92 push r1 2c640: 1f 92 push r1 2c642: cd b7 in r28, 0x3d ; 61 2c644: de b7 in r29, 0x3e ; 62 PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); 2c646: 48 2f mov r20, r24 2c648: 68 e5 ldi r22, 0x58 ; 88 2c64a: ce 01 movw r24, r28 2c64c: 01 96 adiw r24, 0x01 ; 1 2c64e: 0f 94 b2 87 call 0x30f64 ; 0x30f64 2c652: 49 81 ldd r20, Y+1 ; 0x01 2c654: 5a 81 ldd r21, Y+2 ; 0x02 2c656: 6b 81 ldd r22, Y+3 ; 0x03 2c658: 7c 81 ldd r23, Y+4 ; 0x04 2c65a: 8d 81 ldd r24, Y+5 ; 0x05 2c65c: 0f 94 f2 62 call 0x2c5e4 ; 0x2c5e4 } 2c660: 0f 90 pop r0 2c662: 0f 90 pop r0 2c664: 0f 90 pop r0 2c666: 0f 90 pop r0 2c668: 0f 90 pop r0 2c66a: df 91 pop r29 2c66c: cf 91 pop r28 2c66e: 08 95 ret 0002c670 : void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); scopeState = ScopeState::ButtonSent; } void ProtocolLogic::SendVersion(uint8_t stage) { 2c670: 1f 93 push r17 2c672: cf 93 push r28 2c674: df 93 push r29 2c676: 00 d0 rcall .+0 ; 0x2c678 2c678: 1f 92 push r1 2c67a: 1f 92 push r1 2c67c: cd b7 in r28, 0x3d ; 61 2c67e: de b7 in r29, 0x3e ; 62 2c680: 18 2f mov r17, r24 SendMsg(RequestMsg(RequestMsgCodes::Version, stage)); 2c682: 48 2f mov r20, r24 2c684: 63 e5 ldi r22, 0x53 ; 83 2c686: ce 01 movw r24, r28 2c688: 01 96 adiw r24, 0x01 ; 1 2c68a: 0f 94 b2 87 call 0x30f64 ; 0x30f64 2c68e: 49 81 ldd r20, Y+1 ; 0x01 2c690: 5a 81 ldd r21, Y+2 ; 0x02 2c692: 6b 81 ldd r22, Y+3 ; 0x03 2c694: 7c 81 ldd r23, Y+4 ; 0x04 2c696: 8d 81 ldd r24, Y+5 ; 0x05 2c698: 0f 94 da 3c call 0x279b4 ; 0x279b4 scopeState = (ScopeState)((uint_fast8_t)ScopeState::S0Sent + stage); 2c69c: 10 93 28 12 sts 0x1228, r17 ; 0x801228 } 2c6a0: 0f 90 pop r0 2c6a2: 0f 90 pop r0 2c6a4: 0f 90 pop r0 2c6a6: 0f 90 pop r0 2c6a8: 0f 90 pop r0 2c6aa: df 91 pop r29 2c6ac: cf 91 pop r28 2c6ae: 1f 91 pop r17 2c6b0: 08 95 ret 0002c6b2 : } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); } } void MMU2::Start() { 2c6b2: 1f 93 push r17 2c6b4: cf 93 push r28 2c6b6: df 93 push r29 } //uart init (io + FILE stream) void uart2_init(uint32_t baudRate) { DDRH &= ~0x01; 2c6b8: e1 e0 ldi r30, 0x01 ; 1 2c6ba: f1 e0 ldi r31, 0x01 ; 1 2c6bc: 80 81 ld r24, Z 2c6be: 8e 7f andi r24, 0xFE ; 254 2c6c0: 80 83 st Z, r24 PORTH |= 0x01; 2c6c2: e2 e0 ldi r30, 0x02 ; 2 2c6c4: f1 e0 ldi r31, 0x01 ; 1 2c6c6: 80 81 ld r24, Z 2c6c8: 81 60 ori r24, 0x01 ; 1 2c6ca: 80 83 st Z, r24 //#include void rbuf_ini(uint8_t* ptr, uint8_t l) { ptr[0] = l; 2c6cc: ef ea ldi r30, 0xAF ; 175 2c6ce: fd e0 ldi r31, 0x0D ; 13 2c6d0: 90 e1 ldi r25, 0x10 ; 16 2c6d2: 90 83 st Z, r25 ptr[1] = 0; 2c6d4: 11 82 std Z+1, r1 ; 0x01 ptr[2] = 0; 2c6d6: 12 82 std Z+2, r1 ; 0x02 rbuf_ini(uart2_ibuf, sizeof(uart2_ibuf) - 4); UCSR2A |= (1 << U2X2); // baudrate multiplier 2c6d8: e0 ed ldi r30, 0xD0 ; 208 2c6da: f0 e0 ldi r31, 0x00 ; 0 2c6dc: 80 81 ld r24, Z 2c6de: 82 60 ori r24, 0x02 ; 2 2c6e0: 80 83 st Z, r24 UBRR2L = UART_BAUD_SELECT(baudRate, F_CPU); // select baudrate 2c6e2: 90 93 d4 00 sts 0x00D4, r25 ; 0x8000d4 <__TEXT_REGION_LENGTH__+0x7c20d4> UCSR2B = (1 << RXEN2) | (1 << TXEN2); // enable receiver and transmitter 2c6e6: e1 ed ldi r30, 0xD1 ; 209 2c6e8: f0 e0 ldi r31, 0x00 ; 0 2c6ea: 88 e1 ldi r24, 0x18 ; 24 2c6ec: 80 83 st Z, r24 UCSR2B |= (1 << RXCIE2); // enable rx interrupt 2c6ee: 80 81 ld r24, Z 2c6f0: 80 68 ori r24, 0x80 ; 128 2c6f2: 80 83 st Z, r24 fdev_setup_stream(uart2io, uart2_putchar, uart2_getchar, _FDEV_SETUP_WRITE | _FDEV_SETUP_READ); //setup uart2 i/o stream 2c6f4: e7 e0 ldi r30, 0x07 ; 7 2c6f6: f2 e1 ldi r31, 0x12 ; 18 2c6f8: 83 e2 ldi r24, 0x23 ; 35 2c6fa: 98 ef ldi r25, 0xF8 ; 248 2c6fc: 91 87 std Z+9, r25 ; 0x09 2c6fe: 80 87 std Z+8, r24 ; 0x08 2c700: 8b e0 ldi r24, 0x0B ; 11 2c702: 98 ef ldi r25, 0xF8 ; 248 2c704: 93 87 std Z+11, r25 ; 0x0b 2c706: 82 87 std Z+10, r24 ; 0x0a 2c708: 13 e0 ldi r17, 0x03 ; 3 2c70a: 13 83 std Z+3, r17 ; 0x03 2c70c: 15 86 std Z+13, r1 ; 0x0d 2c70e: 14 86 std Z+12, r1 ; 0x0c break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 2c710: 80 e0 ldi r24, 0x00 ; 0 2c712: 0f 94 1c 63 call 0x2c638 ; 0x2c638 mmu2Serial.begin(MMU_BAUD); PowerOn(); mmu2Serial.flush(); // make sure the UART buffer is clear before starting communication SetCurrentTool(MMU2_NO_TOOL); 2c716: 83 e6 ldi r24, 0x63 ; 99 2c718: 0f 94 6a 42 call 0x284d4 ; 0x284d4 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 2c71c: 8f e6 ldi r24, 0x6F ; 111 2c71e: 9b e9 ldi r25, 0x9B ; 155 2c720: 0e 94 49 72 call 0xe492 ; 0xe492 retryAttempts = MAX_RETRIES; 2c724: c5 e2 ldi r28, 0x25 ; 37 2c726: d2 e1 ldi r29, 0x12 ; 18 2c728: 10 93 79 12 sts 0x1279, r17 ; 0x801279 } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 2c72c: 84 ef ldi r24, 0xF4 ; 244 2c72e: 9c e9 ldi r25, 0x9C ; 156 2c730: 0e 94 49 72 call 0xe492 ; 0xe492 /// @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; } 2c734: 8a e0 ldi r24, 0x0A ; 10 2c736: 8c 8b std Y+20, r24 ; 0x14 // start the communication logic.ResetRetryAttempts(); logic.ResetCommunicationTimeoutAttempts(); state = xState::Connecting; 2c738: 82 e0 ldi r24, 0x02 ; 2 2c73a: 80 93 94 12 sts 0x1294, r24 ; 0x801294 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 2c73e: 81 e0 ldi r24, 0x01 ; 1 2c740: 8d 8f std Y+29, r24 ; 0x1d currentScope = Scope::StartSeq; 2c742: 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; 2c744: 1c a2 std Y+36, r1 ; 0x24 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 2c746: 86 e0 ldi r24, 0x06 ; 6 2c748: 8c 83 std Y+4, r24 ; 0x04 SendVersion(0); 2c74a: 80 e0 ldi r24, 0x00 ; 0 logic.Start(); } 2c74c: df 91 pop r29 2c74e: cf 91 pop r28 2c750: 1f 91 pop r17 2c752: 0d 94 38 63 jmp 0x2c670 ; 0x2c670 0002c756 : if (fs != lastFSensor) { SendAndUpdateFilamentSensor(); } } void ProtocolLogic::SendQuery() { 2c756: cf 93 push r28 2c758: df 93 push r29 2c75a: 00 d0 rcall .+0 ; 0x2c75c 2c75c: 1f 92 push r1 2c75e: 1f 92 push r1 2c760: cd b7 in r28, 0x3d ; 61 2c762: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); 2c764: 40 e0 ldi r20, 0x00 ; 0 2c766: 61 e5 ldi r22, 0x51 ; 81 2c768: ce 01 movw r24, r28 2c76a: 01 96 adiw r24, 0x01 ; 1 2c76c: 0f 94 b2 87 call 0x30f64 ; 0x30f64 2c770: 49 81 ldd r20, Y+1 ; 0x01 2c772: 5a 81 ldd r21, Y+2 ; 0x02 2c774: 6b 81 ldd r22, Y+3 ; 0x03 2c776: 7c 81 ldd r23, Y+4 ; 0x04 2c778: 8d 81 ldd r24, Y+5 ; 0x05 2c77a: 0f 94 da 3c call 0x279b4 ; 0x279b4 scopeState = ScopeState::QuerySent; 2c77e: 84 e0 ldi r24, 0x04 ; 4 2c780: 80 93 28 12 sts 0x1228, r24 ; 0x801228 } 2c784: 0f 90 pop r0 2c786: 0f 90 pop r0 2c788: 0f 90 pop r0 2c78a: 0f 90 pop r0 2c78c: 0f 90 pop r0 2c78e: df 91 pop r29 2c790: cf 91 pop r28 2c792: 08 95 ret 0002c794 : SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } void ProtocolLogic::SendAndUpdateFilamentSensor() { 2c794: cf 93 push r28 2c796: df 93 push r29 2c798: 00 d0 rcall .+0 ; 0x2c79a 2c79a: 1f 92 push r1 2c79c: 1f 92 push r1 2c79e: cd b7 in r28, 0x3d ; 61 2c7a0: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); 2c7a2: 0f 94 f5 87 call 0x30fea ; 0x30fea 2c7a6: 80 93 69 12 sts 0x1269, r24 ; 0x801269 2c7aa: 48 2f mov r20, r24 2c7ac: 66 e6 ldi r22, 0x66 ; 102 2c7ae: ce 01 movw r24, r28 2c7b0: 01 96 adiw r24, 0x01 ; 1 2c7b2: 0f 94 b2 87 call 0x30f64 ; 0x30f64 2c7b6: 49 81 ldd r20, Y+1 ; 0x01 2c7b8: 5a 81 ldd r21, Y+2 ; 0x02 2c7ba: 6b 81 ldd r22, Y+3 ; 0x03 2c7bc: 7c 81 ldd r23, Y+4 ; 0x04 2c7be: 8d 81 ldd r24, Y+5 ; 0x05 2c7c0: 0f 94 da 3c call 0x279b4 ; 0x279b4 scopeState = ScopeState::FilamentSensorStateSent; 2c7c4: 86 e0 ldi r24, 0x06 ; 6 2c7c6: 80 93 28 12 sts 0x1228, r24 ; 0x801228 } 2c7ca: 0f 90 pop r0 2c7cc: 0f 90 pop r0 2c7ce: 0f 90 pop r0 2c7d0: 0f 90 pop r0 2c7d2: 0f 90 pop r0 2c7d4: df 91 pop r29 2c7d6: cf 91 pop r28 2c7d8: 08 95 ret 0002c7da : CheckAndReportAsyncEvents(); } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { 2c7da: cf 93 push r28 2c7dc: df 93 push r29 2c7de: 00 d0 rcall .+0 ; 0x2c7e0 2c7e0: 1f 92 push r1 2c7e2: 1f 92 push r1 2c7e4: cd b7 in r28, 0x3d ; 61 2c7e6: de b7 in r29, 0x3e ; 62 switch (rsp.paramCode) { 2c7e8: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2c7ec: 85 34 cpi r24, 0x45 ; 69 2c7ee: f1 f0 breq .+60 ; 0x2c82c 2c7f0: 20 f4 brcc .+8 ; 0x2c7fa 2c7f2: 82 34 cpi r24, 0x42 ; 66 2c7f4: 51 f1 breq .+84 ; 0x2c84a } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; } default: return ProtocolError; 2c7f6: 85 e0 ldi r24, 0x05 ; 5 2c7f8: 11 c0 rjmp .+34 ; 0x2c81c } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { switch (rsp.paramCode) { 2c7fa: 86 34 cpi r24, 0x46 ; 70 2c7fc: 71 f1 breq .+92 ; 0x2c85a 2c7fe: 80 35 cpi r24, 0x50 ; 80 2c800: d1 f7 brne .-12 ; 0x2c7f6 case ResponseMsgParamCodes::Processing: progressCode = static_cast(rsp.paramValue); 2c802: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2c806: 80 93 67 12 sts 0x1267, r24 ; 0x801267 errorCode = ErrorCode::OK; 2c80a: 81 e0 ldi r24, 0x01 ; 1 2c80c: 90 e0 ldi r25, 0x00 ; 0 2c80e: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2c812: 80 93 65 12 sts 0x1265, r24 ; 0x801265 SendAndUpdateFilamentSensor(); // keep on reporting the state of fsensor regularly 2c816: 0f 94 ca 63 call 0x2c794 ; 0x2c794 return Processing; 2c81a: 80 e0 ldi r24, 0x00 ; 0 return Interrupted; } default: return ProtocolError; } } 2c81c: 0f 90 pop r0 2c81e: 0f 90 pop r0 2c820: 0f 90 pop r0 2c822: 0f 90 pop r0 2c824: 0f 90 pop r0 2c826: df 91 pop r29 2c828: cf 91 pop r28 2c82a: 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; 2c82c: 8c e0 ldi r24, 0x0C ; 12 2c82e: 80 93 67 12 sts 0x1267, r24 ; 0x801267 errorCode = static_cast(rsp.paramValue); 2c832: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2c836: 90 91 41 12 lds r25, 0x1241 ; 0x801241 2c83a: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2c83e: 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(); 2c842: 0f 94 ca 63 call 0x2c794 ; 0x2c794 return CommandError; 2c846: 87 e0 ldi r24, 0x07 ; 7 2c848: e9 cf rjmp .-46 ; 0x2c81c 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); 2c84a: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2c84e: 80 93 68 12 sts 0x1268, r24 ; 0x801268 SendAndUpdateFilamentSensor(); 2c852: 0f 94 ca 63 call 0x2c794 ; 0x2c794 return ButtonPushed; 2c856: 8b e0 ldi r24, 0x0B ; 11 2c858: e1 cf rjmp .-62 ; 0x2c81c 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) { 2c85a: 90 91 2a 12 lds r25, 0x122A ; 0x80122a 2c85e: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 2c862: 98 13 cpse r25, r24 2c864: 22 c0 rjmp .+68 ; 0x2c8aa 2c866: 90 91 2b 12 lds r25, 0x122B ; 0x80122b 2c86a: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 2c86e: 98 13 cpse r25, r24 2c870: 1c c0 rjmp .+56 ; 0x2c8aa progressCode = ProgressCode::OK; 2c872: 10 92 67 12 sts 0x1267, r1 ; 0x801267 errorCode = ErrorCode::OK; 2c876: 81 e0 ldi r24, 0x01 ; 1 2c878: 90 e0 ldi r25, 0x00 ; 0 2c87a: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2c87e: 80 93 65 12 sts 0x1265, r24 ; 0x801265 scopeState = ScopeState::Ready; 2c882: 82 e8 ldi r24, 0x82 ; 130 2c884: 80 93 28 12 sts 0x1228, r24 ; 0x801228 rq = RequestMsg(RequestMsgCodes::unknown, 0); // clear the successfully finished request 2c888: 40 e0 ldi r20, 0x00 ; 0 2c88a: 60 e0 ldi r22, 0x00 ; 0 2c88c: ce 01 movw r24, r28 2c88e: 01 96 adiw r24, 0x01 ; 1 2c890: 0f 94 b2 87 call 0x30f64 ; 0x30f64 2c894: 85 e0 ldi r24, 0x05 ; 5 2c896: fe 01 movw r30, r28 2c898: 31 96 adiw r30, 0x01 ; 1 2c89a: aa e2 ldi r26, 0x2A ; 42 2c89c: b2 e1 ldi r27, 0x12 ; 18 2c89e: 01 90 ld r0, Z+ 2c8a0: 0d 92 st X+, r0 2c8a2: 8a 95 dec r24 2c8a4: e1 f7 brne .-8 ; 0x2c89e 2c8a6: 82 e0 ldi r24, 0x02 ; 2 2c8a8: b9 cf rjmp .-142 ; 0x2c81c return Finished; } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; 2c8aa: 83 e0 ldi r24, 0x03 ; 3 2c8ac: b7 cf rjmp .-146 ; 0x2c81c 0002c8ae : mmu_print_saved &= ~(SavedState::ParkExtruder); } } void MMU2::CheckUserInput() { 2c8ae: 1f 93 push r17 2c8b0: cf 93 push r28 2c8b2: df 93 push r29 2c8b4: 00 d0 rcall .+0 ; 0x2c8b6 2c8b6: 1f 92 push r1 2c8b8: 1f 92 push r1 2c8ba: cd b7 in r28, 0x3d ; 61 2c8bc: de b7 in r29, 0x3e ; 62 const char *PrusaErrorButtonMore() { return MSG_BTN_MORE; } Buttons ButtonPressed(ErrorCode ec) { if (buttonSelectedOperation == ButtonOperations::NoOperation) { 2c8be: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> 2c8c2: 81 11 cpse r24, r1 2c8c4: 2a c0 rjmp .+84 ; 0x2c91a auto btn = ButtonPressed(lastErrorCode); // Was a button pressed on the MMU itself instead of the LCD? if (btn == Buttons::NoButton && lastButton != Buttons::NoButton) { 2c8c6: 10 91 8f 12 lds r17, 0x128F ; 0x80128f 2c8ca: 1f 3f cpi r17, 0xFF ; 255 2c8cc: 91 f5 brne .+100 ; 0x2c932 btn = lastButton; lastButton = Buttons::NoButton; // Clear it. } if (mmu2.MMULastErrorSource() == ErrorSourcePrinter && btn != Buttons::NoButton) { 2c8ce: 80 91 8e 12 lds r24, 0x128E ; 0x80128e 2c8d2: 81 11 cpse r24, r1 2c8d4: 60 c0 rjmp .+192 ; 0x2c996 2c8d6: 1f 3f cpi r17, 0xFF ; 255 2c8d8: b9 f0 breq .+46 ; 0x2c908 inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; } inline void ClearPrinterError() { explicitPrinterError = ErrorCode::OK; 2c8da: 81 e0 ldi r24, 0x01 ; 1 2c8dc: 90 e0 ldi r25, 0x00 ; 0 2c8de: 90 93 26 12 sts 0x1226, r25 ; 0x801226 2c8e2: 80 93 25 12 sts 0x1225, r24 ; 0x801225 } } void ClearPrinterError() { logic.ClearPrinterError(); lastErrorCode = ErrorCode::OK; 2c8e6: 90 93 8d 12 sts 0x128D, r25 ; 0x80128d 2c8ea: 80 93 8c 12 sts 0x128C, r24 ; 0x80128c lastErrorSource = ErrorSource::ErrorSourceNone; 2c8ee: 8f ef ldi r24, 0xFF ; 255 2c8f0: 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) { 2c8f4: 13 30 cpi r17, 0x03 ; 3 2c8f6: 09 f4 brne .+2 ; 0x2c8fa 2c8f8: 82 c0 rjmp .+260 ; 0x2c9fe 2c8fa: f8 f0 brcs .+62 ; 0x2c93a 2c8fc: 16 30 cpi r17, 0x06 ; 6 2c8fe: 08 f4 brcc .+2 ; 0x2c902 2c900: 7b c0 rjmp .+246 ; 0x2c9f8 2c902: 17 30 cpi r17, 0x07 ; 7 2c904: 09 f4 brne .+2 ; 0x2c908 2c906: 7f c0 rjmp .+254 ; 0x2ca06 // @@TODO not sure if we shall handle this high level operation at this spot break; default: break; } } 2c908: 0f 90 pop r0 2c90a: 0f 90 pop r0 2c90c: 0f 90 pop r0 2c90e: 0f 90 pop r0 2c910: 0f 90 pop r0 2c912: df 91 pop r29 2c914: cf 91 pop r28 2c916: 1f 91 pop r17 2c918: 08 95 ret return Buttons::NoButton; // no button } const auto result = ButtonAvailable(ec); 2c91a: 80 91 8c 12 lds r24, 0x128C ; 0x80128c 2c91e: 90 91 8d 12 lds r25, 0x128D ; 0x80128d 2c922: 0f 94 82 8a call 0x31504 ; 0x31504 2c926: 18 2f mov r17, r24 buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation 2c928: 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) { 2c92c: 8f 3f cpi r24, 0xFF ; 255 2c92e: 79 f6 brne .-98 ; 0x2c8ce 2c930: ca cf rjmp .-108 ; 0x2c8c6 btn = lastButton; lastButton = Buttons::NoButton; // Clear it. 2c932: 8f ef ldi r24, 0xFF ; 255 2c934: 80 93 8f 12 sts 0x128F, r24 ; 0x80128f 2c938: ca cf rjmp .-108 ; 0x2c8ce switch (btn) { case Buttons::Left: case Buttons::Middle: case Buttons::Right: SERIAL_ECHOPGM("CheckUserInput-btnLMR "); 2c93a: 88 e5 ldi r24, 0x58 ; 88 2c93c: 9b e9 ldi r25, 0x9B ; 155 2c93e: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLN((int)buttons_to_uint8t(btn)); 2c942: 81 2f mov r24, r17 2c944: 90 e0 ldi r25, 0x00 ; 0 2c946: 0f 94 62 42 call 0x284c4 ; 0x284c4 ResumeHotendTemp(); // Recover the hotend temp before we attempt to do anything else... 2c94a: 0f 94 25 6a call 0x2d44a ; 0x2d44a if (mmu2.MMULastErrorSource() == ErrorSourceMMU) { 2c94e: 80 91 8e 12 lds r24, 0x128E ; 0x80128e 2c952: 81 30 cpi r24, 0x01 ; 1 2c954: 89 f4 brne .+34 ; 0x2c978 ScreenUpdateEnable(); return true; } void MMU2::Button(uint8_t index) { LogEchoEvent_P(PSTR("Button")); 2c956: 81 e5 ldi r24, 0x51 ; 81 2c958: 9b e9 ldi r25, 0x9B ; 155 2c95a: 0f 94 e5 87 call 0x30fca ; 0x30fca void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); } void ProtocolLogic::Button(uint8_t index) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Button, index)); 2c95e: 41 2f mov r20, r17 2c960: 62 e4 ldi r22, 0x42 ; 66 2c962: ce 01 movw r24, r28 2c964: 01 96 adiw r24, 0x01 ; 1 2c966: 0f 94 b2 87 call 0x30f64 ; 0x30f64 2c96a: 49 81 ldd r20, Y+1 ; 0x01 2c96c: 5a 81 ldd r21, Y+2 ; 0x02 2c96e: 6b 81 ldd r22, Y+3 ; 0x03 2c970: 7c 81 ldd r23, Y+4 ; 0x04 2c972: 8d 81 ldd r24, Y+5 ; 0x05 2c974: 0f 94 f2 62 call 0x2c5e4 ; 0x2c5e4 } // 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) { 2c978: 80 91 8c 12 lds r24, 0x128C ; 0x80128c 2c97c: 90 91 8d 12 lds r25, 0x128D ; 0x80128d 2c980: 84 30 cpi r24, 0x04 ; 4 2c982: 20 e8 ldi r18, 0x80 ; 128 2c984: 92 07 cpc r25, r18 2c986: 21 f0 breq .+8 ; 0x2c990 2c988: 89 30 cpi r24, 0x09 ; 9 2c98a: 90 48 sbci r25, 0x80 ; 128 2c98c: 09 f0 breq .+2 ; 0x2c990 2c98e: bc cf rjmp .-136 ; 0x2c908 case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: case ErrorCode::FSENSOR_TOO_EARLY: HelpUnloadToFinda(); 2c990: 0f 94 ad 3f call 0x27f5a ; 0x27f5a 2c994: b9 cf rjmp .-142 ; 0x2c908 // 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) { 2c996: 19 30 cpi r17, 0x09 ; 9 2c998: 08 f0 brcs .+2 ; 0x2c99c 2c99a: b6 cf rjmp .-148 ; 0x2c908 2c99c: e1 2f mov r30, r17 2c99e: f0 e0 ldi r31, 0x00 ; 0 2c9a0: 88 27 eor r24, r24 2c9a2: ea 52 subi r30, 0x2A ; 42 2c9a4: fb 49 sbci r31, 0x9B ; 155 2c9a6: 8e 4f sbci r24, 0xFE ; 254 2c9a8: 0d 94 ab a1 jmp 0x34356 ; 0x34356 <__tablejump2__> 2c9ac: 75 38 cpi r23, 0x85 ; 133 2c9ae: 75 38 cpi r23, 0x85 ; 133 2c9b0: 75 38 cpi r23, 0x85 ; 133 2c9b2: 19 38 cpi r17, 0x89 ; 137 2c9b4: 49 37 cpi r20, 0x79 ; 121 2c9b6: 49 37 cpi r20, 0x79 ; 121 2c9b8: 37 37 cpi r19, 0x77 ; 119 2c9ba: d7 37 cpi r29, 0x77 ; 119 2c9bc: a9 37 cpi r26, 0x79 ; 121 logic.Stop(); mmu2Serial.close(); } void MMU2::Tune() { switch (lastErrorCode) { 2c9be: 80 91 8c 12 lds r24, 0x128C ; 0x80128c 2c9c2: 90 91 8d 12 lds r25, 0x128D ; 0x80128d 2c9c6: 87 38 cpi r24, 0x87 ; 135 2c9c8: 20 e8 ldi r18, 0x80 ; 128 2c9ca: 92 07 cpc r25, r18 2c9cc: 21 f0 breq .+8 ; 0x2c9d6 2c9ce: 87 30 cpi r24, 0x07 ; 7 2c9d0: 91 48 sbci r25, 0x81 ; 129 2c9d2: 09 f0 breq .+2 ; 0x2c9d6 2c9d4: 99 cf rjmp .-206 ; 0x2c908 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 2c9d6: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2c9da: 84 30 cpi r24, 0x04 ; 4 2c9dc: 21 f4 brne .+8 ; 0x2c9e6 ); MENU_END(); } void tuneIdlerStallguardThreshold() { if ((CommandInProgress)mmu2.GetCommandInProgress() != NoCommand) 2c9de: 80 91 2a 12 lds r24, 0x122A ; 0x80122a 2c9e2: 81 11 cpse r24, r1 2c9e4: 91 cf rjmp .-222 ; 0x2c908 // homing fails during toolchange. // To save the print, make the Tune button unresponsive for now. return; } putErrorScreenToSleep = true; 2c9e6: 81 e0 ldi r24, 0x01 ; 1 2c9e8: 80 93 ad 0d sts 0x0DAD, r24 ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.458> menu_submenu(tuneIdlerStallguardThresholdMenu); 2c9ec: 60 e0 ldi r22, 0x00 ; 0 2c9ee: 89 e8 ldi r24, 0x89 ; 137 2c9f0: 97 e3 ldi r25, 0x37 ; 55 2c9f2: 0f 94 e8 94 call 0x329d0 ; 0x329d0 2c9f6: 88 cf rjmp .-240 ; 0x2c908 } /// @brief Queue a button operation which the printer can act upon /// @param btn Button operation inline void SetPrinterButtonOperation(Buttons btn) { printerButtonOperation = btn; 2c9f8: 10 93 92 12 sts 0x1292, r17 ; 0x801292 2c9fc: 85 cf rjmp .-246 ; 0x2c908 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 2c9fe: 80 e0 ldi r24, 0x00 ; 0 2ca00: 0f 94 1c 63 call 0x2c638 ; 0x2c638 2ca04: 81 cf rjmp .-254 ; 0x2c908 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 2ca06: 10 92 94 12 sts 0x1294, r1 ; 0x801294 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 2ca0a: 10 92 42 12 sts 0x1242, r1 ; 0x801242 currentScope = Scope::Stopped; 2ca0e: 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); 2ca12: 60 e0 ldi r22, 0x00 ; 0 2ca14: 8c ea ldi r24, 0xAC ; 172 2ca16: 9c e0 ldi r25, 0x0C ; 12 2ca18: 0f 94 bf a0 call 0x3417e ; 0x3417e } /// Disables MMU in EEPROM void DisableMMUInSettings() { eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); 2ca1c: 0f 94 50 42 call 0x284a0 ; 0x284a0 2ca20: 73 cf rjmp .-282 ; 0x2c908 0002ca22 : avoidRecursion = true; mmu_loop_inner(true); avoidRecursion = false; } void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) { 2ca22: 4f 92 push r4 2ca24: 5f 92 push r5 2ca26: 6f 92 push r6 2ca28: 7f 92 push r7 2ca2a: 8f 92 push r8 2ca2c: 9f 92 push r9 2ca2e: af 92 push r10 2ca30: bf 92 push r11 2ca32: cf 92 push r12 2ca34: df 92 push r13 2ca36: ef 92 push r14 2ca38: ff 92 push r15 2ca3a: 0f 93 push r16 2ca3c: 1f 93 push r17 2ca3e: cf 93 push r28 2ca40: df 93 push r29 2ca42: cd b7 in r28, 0x3d ; 61 2ca44: de b7 in r29, 0x3e ; 62 2ca46: a0 97 sbiw r28, 0x20 ; 32 2ca48: 0f b6 in r0, 0x3f ; 63 2ca4a: f8 94 cli 2ca4c: de bf out 0x3e, r29 ; 62 2ca4e: 0f be out 0x3f, r0 ; 63 2ca50: cd bf out 0x3d, r28 ; 61 2ca52: 08 2f mov r16, r24 } } StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); 2ca54: 0f 94 57 64 call 0x2c8ae ; 0x2c8ae DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); } StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately 2ca58: 80 91 28 12 lds r24, 0x1228 ; 0x801228 2ca5c: 87 fd sbrc r24, 7 ActivatePlannedRequest(); 2ca5e: 0f 94 6d 62 call 0x2c4da ; 0x2c4da 2ca62: 90 91 28 12 lds r25, 0x1228 ; 0x801228 } return Processing; } StepStatus ProtocolLogic::ScopeStep() { if (!ExpectsResponse()) { 2ca66: 97 ff sbrs r25, 7 2ca68: 7d c0 rjmp .+250 ; 0x2cb64 // we are waiting for something switch (currentScope) { 2ca6a: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2ca6e: 82 30 cpi r24, 0x02 ; 2 2ca70: b1 f0 breq .+44 ; 0x2ca9e 2ca72: 08 f4 brcc .+2 ; 0x2ca76 2ca74: 75 c0 rjmp .+234 ; 0x2cb60 2ca76: 83 30 cpi r24, 0x03 ; 3 2ca78: e1 f1 breq .+120 ; 0x2caf2 2ca7a: 84 30 cpi r24, 0x04 ; 4 2ca7c: 09 f4 brne .+2 ; 0x2ca80 2ca7e: 54 c0 rjmp .+168 ; 0x2cb28 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 2ca80: 0f 94 6d 62 call 0x2c4da ; 0x2c4da 2ca84: 81 11 cpse r24, r1 2ca86: 6b c3 rjmp .+1750 ; 0x2d15e // and we have just received a response to a Q0 message about a command progress return ProcessCommandQueryResponse(); } void ProtocolLogic::SwitchToIdle() { state = State::Running; 2ca88: 82 e0 ldi r24, 0x02 ; 2 2ca8a: 80 93 42 12 sts 0x1242, r24 ; 0x801242 currentScope = Scope::Idle; 2ca8e: 83 e0 ldi r24, 0x03 ; 3 2ca90: 80 93 27 12 sts 0x1227, r24 ; 0x801227 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 2ca94: 82 e8 ldi r24, 0x82 ; 130 2ca96: 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()) { 2ca9a: 12 e0 ldi r17, 0x02 ; 2 2ca9c: db c2 rjmp .+1462 ; 0x2d054 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 2ca9e: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 2caa2: ab 01 movw r20, r22 2caa4: bc 01 movw r22, r24 2caa6: 80 91 34 12 lds r24, 0x1234 ; 0x801234 2caaa: 90 91 35 12 lds r25, 0x1235 ; 0x801235 2caae: a0 91 36 12 lds r26, 0x1236 ; 0x801236 2cab2: b0 91 37 12 lds r27, 0x1237 ; 0x801237 2cab6: 88 51 subi r24, 0x18 ; 24 2cab8: 9c 4f sbci r25, 0xFC ; 252 2caba: af 4f sbci r26, 0xFF ; 255 2cabc: 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 2cabe: 48 17 cp r20, r24 2cac0: 59 07 cpc r21, r25 2cac2: 6a 07 cpc r22, r26 2cac4: 7b 07 cpc r23, r27 2cac6: 08 f4 brcc .+2 ; 0x2caca 2cac8: 4b c0 rjmp .+150 ; 0x2cb60 void MMU2Serial::close() { // @@TODO - probably turn off the UART } int MMU2Serial::read() { return fgetc(uart2io); 2caca: 87 e0 ldi r24, 0x07 ; 7 2cacc: 92 e1 ldi r25, 0x12 ; 18 2cace: 0f 94 c7 9e call 0x33d8e ; 0x33d8e while (uart->read() != -1) 2cad2: 01 96 adiw r24, 0x01 ; 1 2cad4: d1 f7 brne .-12 ; 0x2caca initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 2cad6: 81 e0 ldi r24, 0x01 ; 1 2cad8: 80 93 42 12 sts 0x1242, r24 ; 0x801242 currentScope = Scope::StartSeq; 2cadc: 80 93 27 12 sts 0x1227, r24 ; 0x801227 2cae0: 10 92 49 12 sts 0x1249, r1 ; 0x801249 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 2cae4: 86 e0 ldi r24, 0x06 ; 6 2cae6: 80 93 29 12 sts 0x1229, r24 ; 0x801229 SendVersion(0); 2caea: 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); 2caec: 0f 94 38 63 call 0x2c670 ; 0x2c670 2caf0: 37 c0 rjmp .+110 ; 0x2cb60 } return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout 2caf2: 92 38 cpi r25, 0x82 ; 130 2caf4: 29 f6 brne .-118 ; 0x2ca80 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 2caf6: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 2cafa: ab 01 movw r20, r22 2cafc: bc 01 movw r22, r24 2cafe: 80 91 34 12 lds r24, 0x1234 ; 0x801234 2cb02: 90 91 35 12 lds r25, 0x1235 ; 0x801235 2cb06: a0 91 36 12 lds r26, 0x1236 ; 0x801236 2cb0a: b0 91 37 12 lds r27, 0x1237 ; 0x801237 2cb0e: 88 51 subi r24, 0x18 ; 24 2cb10: 9c 4f sbci r25, 0xFC ; 252 2cb12: af 4f sbci r26, 0xFF ; 255 2cb14: bf 4f sbci r27, 0xFF ; 255 return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout if (Elapsed(heartBeatPeriod)) { 2cb16: 48 17 cp r20, r24 2cb18: 59 07 cpc r21, r25 2cb1a: 6a 07 cpc r22, r26 2cb1c: 7b 07 cpc r23, r27 2cb1e: 08 f4 brcc .+2 ; 0x2cb22 2cb20: af cf rjmp .-162 ; 0x2ca80 void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; currentScope = Scope::Idle; IdleRestart(); SendQuery(); // force sending Q0 immediately 2cb22: 0f 94 ab 63 call 0x2c756 ; 0x2c756 2cb26: 1c c0 rjmp .+56 ; 0x2cb60 } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 2cb28: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 2cb2c: ab 01 movw r20, r22 2cb2e: bc 01 movw r22, r24 2cb30: 80 91 34 12 lds r24, 0x1234 ; 0x801234 2cb34: 90 91 35 12 lds r25, 0x1235 ; 0x801235 2cb38: a0 91 36 12 lds r26, 0x1236 ; 0x801236 2cb3c: b0 91 37 12 lds r27, 0x1237 ; 0x801237 2cb40: 88 51 subi r24, 0x18 ; 24 2cb42: 9c 4f sbci r25, 0xFC ; 252 2cb44: af 4f sbci r26, 0xFF ; 255 2cb46: bf 4f sbci r27, 0xFF ; 255 } return Processing; } StepStatus ProtocolLogic::CommandWait() { if (Elapsed(heartBeatPeriod)) { 2cb48: 48 17 cp r20, r24 2cb4a: 59 07 cpc r21, r25 2cb4c: 6a 07 cpc r22, r26 2cb4e: 7b 07 cpc r23, r27 2cb50: 40 f7 brcc .-48 ; 0x2cb22 }; 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(); 2cb52: 0f 94 f5 87 call 0x30fea ; 0x30fea if (fs != lastFSensor) { 2cb56: 90 91 69 12 lds r25, 0x1269 ; 0x801269 2cb5a: 89 13 cpse r24, r25 SendAndUpdateFilamentSensor(); 2cb5c: 0f 94 ca 63 call 0x2c794 ; 0x2c794 // 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; 2cb60: 10 e0 ldi r17, 0x00 ; 0 2cb62: 78 c2 rjmp .+1264 ; 0x2d054 StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; int c = -1; OldMMUFWDetector oldMMUh4x0r; // old MMU FW hacker ;) 2cb64: a1 2c mov r10, r1 return State::SomethingElse; } }; StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; 2cb66: d1 2c mov r13, r1 2cb68: 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; 2cb6a: 99 24 eor r9, r9 2cb6c: 93 94 inc r9 responseMsg.paramCode = (ResponseMsgParamCodes)c; responseMsg.paramValue = 0; return DecodeStatus::NeedMoreData; default: responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 2cb6e: 55 e0 ldi r21, 0x05 ; 5 2cb70: b5 2e mov r11, r21 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 2cb72: 63 e0 ldi r22, 0x03 ; 3 2cb74: 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; 2cb76: 74 e0 ldi r23, 0x04 ; 4 2cb78: 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; 2cb7a: e2 e0 ldi r30, 0x02 ; 2 2cb7c: 6e 2e mov r6, r30 2cb7e: 66 c0 rjmp .+204 ; 0x2cc4c ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 2cb80: 23 30 cpi r18, 0x03 ; 3 2cb82: 09 f4 brne .+2 ; 0x2cb86 2cb84: e0 c0 rjmp .+448 ; 0x2cd46 2cb86: 24 30 cpi r18, 0x04 ; 4 2cb88: 09 f0 breq .+2 ; 0x2cb8c 2cb8a: 83 c0 rjmp .+262 ; 0x2cc92 } 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'); 2cb8c: 20 ed ldi r18, 0xD0 ; 208 2cb8e: 28 0f add r18, r24 2cb90: 2a 30 cpi r18, 0x0A ; 10 2cb92: 08 f4 brcc .+2 ; 0x2cb96 2cb94: f8 c0 rjmp .+496 ; 0x2cd86 2cb96: 2f e9 ldi r18, 0x9F ; 159 2cb98: 28 0f add r18, r24 2cb9a: 26 30 cpi r18, 0x06 ; 6 2cb9c: 08 f4 brcc .+2 ; 0x2cba0 2cb9e: f3 c0 rjmp .+486 ; 0x2cd86 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 2cba0: 8a 30 cpi r24, 0x0A ; 10 2cba2: 09 f0 breq .+2 ; 0x2cba6 2cba4: fa c0 rjmp .+500 ; 0x2cd9a 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()) { 2cba6: 40 90 4e 12 lds r4, 0x124E ; 0x80124e 2cbaa: 8a e4 ldi r24, 0x4A ; 74 2cbac: 92 e1 ldi r25, 0x12 ; 18 2cbae: 0f 94 a1 87 call 0x30f42 ; 0x30f42 2cbb2: 48 12 cpse r4, r24 2cbb4: b8 c0 rjmp .+368 ; 0x2cd26 // CRC mismatch responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; return DecodeStatus::Error; } else { rspState = ResponseStates::RequestCode; 2cbb6: 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; } 2cbba: 88 e0 ldi r24, 0x08 ; 8 2cbbc: ea e4 ldi r30, 0x4A ; 74 2cbbe: f2 e1 ldi r31, 0x12 ; 18 2cbc0: de 01 movw r26, r28 2cbc2: 51 96 adiw r26, 0x11 ; 17 2cbc4: 01 90 ld r0, Z+ 2cbc6: 0d 92 st X+, r0 2cbc8: 8a 95 dec r24 2cbca: e1 f7 brne .-8 ; 0x2cbc4 2cbcc: 88 e0 ldi r24, 0x08 ; 8 2cbce: fe 01 movw r30, r28 2cbd0: 71 96 adiw r30, 0x11 ; 17 2cbd2: de 01 movw r26, r28 2cbd4: 59 96 adiw r26, 0x19 ; 25 2cbd6: 01 90 ld r0, Z+ 2cbd8: 0d 92 st X+, r0 2cbda: 8a 95 dec r24 2cbdc: e1 f7 brne .-8 ; 0x2cbd6 while ((c = uart->read()) >= 0) { ++bytesConsumed; RecordReceivedByte(c); switch (protocol.DecodeResponse(c)) { case DecodeStatus::MessageCompleted: rsp = protocol.GetResponseMsg(); 2cbde: 88 e0 ldi r24, 0x08 ; 8 2cbe0: fe 01 movw r30, r28 2cbe2: 79 96 adiw r30, 0x19 ; 25 2cbe4: aa e3 ldi r26, 0x3A ; 58 2cbe6: b2 e1 ldi r27, 0x12 ; 18 2cbe8: 01 90 ld r0, Z+ 2cbea: 0d 92 st X+, r0 2cbec: 8a 95 dec r24 2cbee: e1 f7 brne .-8 ; 0x2cbe8 } dst[(lastReceivedBytes.size() - 1) * 3 + 2] = 0; // terminate properly } void ProtocolLogic::FormatLastResponseMsgAndClearLRB(char *dst) { *dst++ = '<'; 2cbf0: 8c e3 ldi r24, 0x3C ; 60 2cbf2: 89 83 std Y+1, r24 ; 0x01 2cbf4: fe 01 movw r30, r28 2cbf6: 32 96 adiw r30, 0x02 ; 2 2cbf8: a2 e5 ldi r26, 0x52 ; 82 2cbfa: b2 e1 ldi r27, 0x12 ; 18 for (uint8_t i = 0; i < lrb; ++i) { 2cbfc: 20 e0 ldi r18, 0x00 ; 0 2cbfe: cf 01 movw r24, r30 2cc00: 52 16 cp r5, r18 2cc02: 09 f4 brne .+2 ; 0x2cc06 2cc04: cd c0 rjmp .+410 ; 0x2cda0 uint8_t b = lastReceivedBytes[i]; 2cc06: 3d 91 ld r19, X+ // Check for printable character, including space if (b < 32 || b > 127) { 2cc08: 40 ee ldi r20, 0xE0 ; 224 2cc0a: 43 0f add r20, r19 2cc0c: 40 36 cpi r20, 0x60 ; 96 2cc0e: 08 f0 brcs .+2 ; 0x2cc12 b = '.'; 2cc10: 3e e2 ldi r19, 0x2E ; 46 } *dst++ = b; 2cc12: 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) { 2cc14: 2f 5f subi r18, 0xFF ; 255 2cc16: f4 cf rjmp .-24 ; 0x2cc00 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 2cc18: 8e 34 cpi r24, 0x4E ; 78 2cc1a: 08 f0 brcs .+2 ; 0x2cc1e 2cc1c: 56 c0 rjmp .+172 ; 0x2ccca 2cc1e: 8b 34 cpi r24, 0x4B ; 75 2cc20: 08 f0 brcs .+2 ; 0x2cc24 2cc22: 46 c0 rjmp .+140 ; 0x2ccb0 2cc24: 82 34 cpi r24, 0x42 ; 66 2cc26: 09 f4 brne .+2 ; 0x2cc2a 2cc28: 43 c0 rjmp .+134 ; 0x2ccb0 2cc2a: e0 f5 brcc .+120 ; 0x2cca4 2cc2c: 8a 30 cpi r24, 0x0A ; 10 2cc2e: 59 f0 breq .+22 ; 0x2cc46 2cc30: 8d 30 cpi r24, 0x0D ; 13 2cc32: 49 f0 breq .+18 ; 0x2cc46 } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 2cc34: 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') { 2cc38: a1 10 cpse r10, r1 2cc3a: 05 c1 rjmp .+522 ; 0x2ce46 2cc3c: 1f 36 cpi r17, 0x6F ; 111 2cc3e: 09 f0 breq .+2 ; 0x2cc42 2cc40: fe c3 rjmp .+2044 ; 0x2d43e ++ok; 2cc42: aa 24 eor r10, r10 2cc44: 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; 2cc46: 4f ef ldi r20, 0xFF ; 255 2cc48: c4 1a sub r12, r20 2cc4a: d4 0a sbc r13, r20 2cc4c: 87 e0 ldi r24, 0x07 ; 7 2cc4e: 92 e1 ldi r25, 0x12 ; 18 2cc50: 0f 94 c7 9e call 0x33d8e ; 0x33d8e 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) { 2cc54: 97 fd sbrc r25, 7 2cc56: 00 c1 rjmp .+512 ; 0x2ce58 ++bytesConsumed; RecordReceivedByte(c); 2cc58: 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]; 2cc5a: 20 91 62 12 lds r18, 0x1262 ; 0x801262 2cc5e: 30 e0 ldi r19, 0x00 ; 0 void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); } void ProtocolLogic::RecordReceivedByte(uint8_t c) { lastReceivedBytes[lrb] = c; 2cc60: f9 01 movw r30, r18 2cc62: eb 5d subi r30, 0xDB ; 219 2cc64: fd 4e sbci r31, 0xED ; 237 2cc66: 85 a7 std Z+45, r24 ; 0x2d lrb = (lrb + 1) % lastReceivedBytes.size(); 2cc68: 79 01 movw r14, r18 2cc6a: ef ef ldi r30, 0xFF ; 255 2cc6c: ee 1a sub r14, r30 2cc6e: fe 0a sbc r15, r30 2cc70: ff e0 ldi r31, 0x0F ; 15 2cc72: ef 22 and r14, r31 2cc74: ff 24 eor r15, r15 2cc76: 5e 2c mov r5, r14 2cc78: e0 92 62 12 sts 0x1262, r14 ; 0x801262 ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 2cc7c: 20 91 49 12 lds r18, 0x1249 ; 0x801249 2cc80: 22 30 cpi r18, 0x02 ; 2 2cc82: 09 f4 brne .+2 ; 0x2cc86 2cc84: 48 c0 rjmp .+144 ; 0x2cd16 2cc86: 08 f0 brcs .+2 ; 0x2cc8a 2cc88: 7b cf rjmp .-266 ; 0x2cb80 2cc8a: 22 23 and r18, r18 2cc8c: 29 f2 breq .-118 ; 0x2cc18 2cc8e: 21 30 cpi r18, 0x01 ; 1 2cc90: 51 f1 breq .+84 ; 0x2cce6 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 2cc92: 1a 30 cpi r17, 0x0A ; 10 2cc94: 09 f4 brne .+2 ; 0x2cc98 2cc96: 8f cf rjmp .-226 ; 0x2cbb6 2cc98: 1d 30 cpi r17, 0x0D ; 13 2cc9a: 09 f4 brne .+2 ; 0x2cc9e 2cc9c: 8c cf rjmp .-232 ; 0x2cbb6 default: //case error: if (IsNewLine(c)) { rspState = ResponseStates::RequestCode; return DecodeStatus::MessageCompleted; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 2cc9e: 10 92 4f 12 sts 0x124F, r1 ; 0x80124f 2cca2: ca cf rjmp .-108 ; 0x2cc38 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 2cca4: 85 34 cpi r24, 0x45 ; 69 2cca6: 30 f2 brcs .-116 ; 0x2cc34 2cca8: 87 34 cpi r24, 0x47 ; 71 2ccaa: 10 f0 brcs .+4 ; 0x2ccb0 2ccac: 88 34 cpi r24, 0x48 ; 72 2ccae: 11 f6 brne .-124 ; 0x2cc34 case 'K': case 'F': case 'f': case 'H': case 'R': responseMsg.request.code = (RequestMsgCodes)c; 2ccb0: 80 93 4a 12 sts 0x124A, r24 ; 0x80124a responseMsg.request.value = 0; 2ccb4: 10 92 4b 12 sts 0x124B, r1 ; 0x80124b responseMsg.request.value2 = 0; 2ccb8: 10 92 4d 12 sts 0x124D, r1 ; 0x80124d 2ccbc: 10 92 4c 12 sts 0x124C, r1 ; 0x80124c responseMsg.request.crc8 = 0; 2ccc0: 10 92 4e 12 sts 0x124E, r1 ; 0x80124e rspState = ResponseStates::RequestValue; 2ccc4: 90 92 49 12 sts 0x1249, r9 ; 0x801249 2ccc8: be cf rjmp .-132 ; 0x2cc46 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 2ccca: 89 35 cpi r24, 0x59 ; 89 2cccc: 40 f4 brcc .+16 ; 0x2ccde 2ccce: 87 35 cpi r24, 0x57 ; 87 2ccd0: 78 f7 brcc .-34 ; 0x2ccb0 2ccd2: 20 eb ldi r18, 0xB0 ; 176 2ccd4: 28 0f add r18, r24 2ccd6: 26 30 cpi r18, 0x06 ; 6 2ccd8: 08 f0 brcs .+2 ; 0x2ccdc 2ccda: ac cf rjmp .-168 ; 0x2cc34 2ccdc: e9 cf rjmp .-46 ; 0x2ccb0 2ccde: 86 36 cpi r24, 0x66 ; 102 2cce0: 09 f0 breq .+2 ; 0x2cce4 2cce2: a8 cf rjmp .-176 ; 0x2cc34 2cce4: e5 cf rjmp .-54 ; 0x2ccb0 } 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'); 2cce6: 20 ed ldi r18, 0xD0 ; 208 2cce8: 28 0f add r18, r24 2ccea: 2a 30 cpi r18, 0x0A ; 10 2ccec: 50 f0 brcs .+20 ; 0x2cd02 2ccee: 2f e9 ldi r18, 0x9F ; 159 2ccf0: 28 0f add r18, r24 2ccf2: 26 30 cpi r18, 0x06 ; 6 2ccf4: 30 f0 brcs .+12 ; 0x2cd02 case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (c == ' ') { 2ccf6: 80 32 cpi r24, 0x20 ; 32 2ccf8: 09 f0 breq .+2 ; 0x2ccfc 2ccfa: 9c cf rjmp .-200 ; 0x2cc34 rspState = ResponseStates::ParamCode; 2ccfc: 60 92 49 12 sts 0x1249, r6 ; 0x801249 2cd00: a2 cf rjmp .-188 ; 0x2cc46 return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); 2cd02: 0f 94 80 87 call 0x30f00 ; 0x30f00 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; 2cd06: 90 91 4b 12 lds r25, 0x124B ; 0x80124b 2cd0a: 92 95 swap r25 2cd0c: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.value += Char2Nibble(c); 2cd0e: 89 0f add r24, r25 2cd10: 80 93 4b 12 sts 0x124B, r24 ; 0x80124b 2cd14: 98 cf rjmp .-208 ; 0x2cc46 } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 2cd16: 87 34 cpi r24, 0x47 ; 71 2cd18: 48 f4 brcc .+18 ; 0x2cd2c 2cd1a: 85 34 cpi r24, 0x45 ; 69 2cd1c: 58 f4 brcc .+22 ; 0x2cd34 2cd1e: 2f eb ldi r18, 0xBF ; 191 2cd20: 28 0f add r18, r24 2cd22: 22 30 cpi r18, 0x02 ; 2 2cd24: 38 f0 brcs .+14 ; 0x2cd34 return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 2cd26: 10 92 4f 12 sts 0x124F, r1 ; 0x80124f 2cd2a: 84 cf rjmp .-248 ; 0x2cc34 } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 2cd2c: 80 35 cpi r24, 0x50 ; 80 2cd2e: 11 f0 breq .+4 ; 0x2cd34 2cd30: 82 35 cpi r24, 0x52 ; 82 2cd32: c9 f7 brne .-14 ; 0x2cd26 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 2cd34: 80 92 49 12 sts 0x1249, r8 ; 0x801249 responseMsg.paramCode = (ResponseMsgParamCodes)c; 2cd38: 80 93 4f 12 sts 0x124F, r24 ; 0x80124f responseMsg.paramValue = 0; 2cd3c: 10 92 51 12 sts 0x1251, r1 ; 0x801251 2cd40: 10 92 50 12 sts 0x1250, r1 ; 0x801250 2cd44: 80 cf rjmp .-256 ; 0x2cc46 2cd46: 20 ed ldi r18, 0xD0 ; 208 2cd48: 28 0f add r18, r24 2cd4a: 2a 30 cpi r18, 0x0A ; 10 2cd4c: 48 f0 brcs .+18 ; 0x2cd60 2cd4e: 2f e9 ldi r18, 0x9F ; 159 2cd50: 28 0f add r18, r24 2cd52: 26 30 cpi r18, 0x06 ; 6 2cd54: 28 f0 brcs .+10 ; 0x2cd60 case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { 2cd56: 8a 32 cpi r24, 0x2A ; 42 2cd58: 31 f7 brne .-52 ; 0x2cd26 rspState = ResponseStates::CRC; 2cd5a: 70 92 49 12 sts 0x1249, r7 ; 0x801249 2cd5e: 73 cf rjmp .-282 ; 0x2cc46 return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); 2cd60: 0f 94 80 87 call 0x30f00 ; 0x30f00 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; 2cd64: 20 91 50 12 lds r18, 0x1250 ; 0x801250 2cd68: 30 91 51 12 lds r19, 0x1251 ; 0x801251 2cd6c: 44 e0 ldi r20, 0x04 ; 4 2cd6e: 22 0f add r18, r18 2cd70: 33 1f adc r19, r19 2cd72: 4a 95 dec r20 2cd74: e1 f7 brne .-8 ; 0x2cd6e responseMsg.paramValue += Char2Nibble(c); 2cd76: 82 0f add r24, r18 2cd78: 93 2f mov r25, r19 2cd7a: 91 1d adc r25, r1 2cd7c: 90 93 51 12 sts 0x1251, r25 ; 0x801251 2cd80: 80 93 50 12 sts 0x1250, r24 ; 0x801250 2cd84: 60 cf rjmp .-320 ; 0x2cc46 return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; responseMsg.request.crc8 += Char2Nibble(c); 2cd86: 0f 94 80 87 call 0x30f00 ; 0x30f00 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; 2cd8a: 90 91 4e 12 lds r25, 0x124E ; 0x80124e 2cd8e: 92 95 swap r25 2cd90: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.crc8 += Char2Nibble(c); 2cd92: 89 0f add r24, r25 2cd94: 80 93 4e 12 sts 0x124E, r24 ; 0x80124e 2cd98: 56 cf rjmp .-340 ; 0x2cc46 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 2cd9a: 8d 30 cpi r24, 0x0D ; 13 2cd9c: 21 f6 brne .-120 ; 0x2cd26 2cd9e: 03 cf rjmp .-506 ; 0x2cba6 if (b < 32 || b > 127) { b = '.'; } *dst++ = b; } *dst = 0; // terminate properly 2cda0: e8 0e add r14, r24 2cda2: f9 1e adc r15, r25 2cda4: f7 01 movw r30, r14 2cda6: 10 82 st Z, r1 lrb = 0; // reset the input buffer index in case of a clean message 2cda8: 10 92 62 12 sts 0x1262, r1 ; 0x801262 } void ProtocolLogic::LogResponse() { char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); 2cdac: 81 e6 ldi r24, 0x61 ; 97 2cdae: 9d e9 ldi r25, 0x9D ; 157 2cdb0: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 2cdb4: 8b e5 ldi r24, 0x5B ; 91 2cdb6: 9d e9 ldi r25, 0x9D ; 157 2cdb8: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 2cdbc: ce 01 movw r24, r28 2cdbe: 01 96 adiw r24, 0x01 ; 1 2cdc0: 0f 94 bc 99 call 0x33378 ; 0x33378 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 2cdc4: 0f 94 d4 3b call 0x277a8 ; 0x277a8 if (auto expmsg = ExpectingMessage(); expmsg != MessageReady) { // this whole statement takes 12B return expmsg; } // process message switch (currentScope) { 2cdc8: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2cdcc: 81 30 cpi r24, 0x01 ; 1 2cdce: 09 f4 brne .+2 ; 0x2cdd2 2cdd0: 74 c0 rjmp .+232 ; 0x2ceba 2cdd2: 08 f4 brcc .+2 ; 0x2cdd6 2cdd4: c5 ce rjmp .-630 ; 0x2cb60 2cdd6: 83 30 cpi r24, 0x03 ; 3 2cdd8: 09 f4 brne .+2 ; 0x2cddc 2cdda: d1 c0 rjmp .+418 ; 0x2cf7e 2cddc: 84 30 cpi r24, 0x04 ; 4 2cdde: 09 f0 breq .+2 ; 0x2cde2 2cde0: 4f ce rjmp .-866 ; 0x2ca80 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 2cde2: 80 91 28 12 lds r24, 0x1228 ; 0x801228 2cde6: 86 30 cpi r24, 0x06 ; 6 2cde8: 09 f4 brne .+2 ; 0x2cdec 2cdea: 6c c1 rjmp .+728 ; 0x2d0c4 2cdec: 08 f0 brcs .+2 ; 0x2cdf0 2cdee: 93 c1 rjmp .+806 ; 0x2d116 2cdf0: 84 30 cpi r24, 0x04 ; 4 2cdf2: 09 f4 brne .+2 ; 0x2cdf6 2cdf4: 09 c1 rjmp .+530 ; 0x2d008 2cdf6: 85 30 cpi r24, 0x05 ; 5 2cdf8: 09 f0 breq .+2 ; 0x2cdfc 2cdfa: cc c0 rjmp .+408 ; 0x2cf94 case ScopeState::CommandSent: { switch (rsp.paramCode) { // the response should be either accepted or rejected 2cdfc: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2ce00: 81 34 cpi r24, 0x41 ; 65 2ce02: 09 f4 brne .+2 ; 0x2ce06 2ce04: 96 c1 rjmp .+812 ; 0x2d132 2ce06: 82 35 cpi r24, 0x52 ; 82 2ce08: 09 f0 breq .+2 ; 0x2ce0c 2ce0a: c4 c0 rjmp .+392 ; 0x2cf94 errorCode = ErrorCode::RUNNING; scopeState = ScopeState::Wait; break; case ResponseMsgParamCodes::Rejected: // rejected - should normally not happen, but report the error up progressCode = ProgressCode::OK; 2ce0c: 10 92 67 12 sts 0x1267, r1 ; 0x801267 errorCode = ErrorCode::PROTOCOL_ERROR; 2ce10: 8d e2 ldi r24, 0x2D ; 45 2ce12: 90 e8 ldi r25, 0x80 ; 128 2ce14: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2ce18: 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")); 2ce1c: 81 ec ldi r24, 0xC1 ; 193 2ce1e: 9a e9 ldi r25, 0x9A ; 154 2ce20: 0f 94 f1 3b call 0x277e2 ; 0x277e2 void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 2ce24: 85 e0 ldi r24, 0x05 ; 5 2ce26: 80 93 28 12 sts 0x1228, r24 ; 0x801228 SendMsg(rq); 2ce2a: 40 91 2a 12 lds r20, 0x122A ; 0x80122a 2ce2e: 50 91 2b 12 lds r21, 0x122B ; 0x80122b 2ce32: 60 91 2c 12 lds r22, 0x122C ; 0x80122c 2ce36: 70 91 2d 12 lds r23, 0x122D ; 0x80122d 2ce3a: 80 91 2e 12 lds r24, 0x122E ; 0x80122e 2ce3e: 0f 94 da 3c call 0x279b4 ; 0x279b4 2ce42: 16 e0 ldi r17, 0x06 ; 6 2ce44: 07 c1 rjmp .+526 ; 0x2d054 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') { 2ce46: 1b 36 cpi r17, 0x6B ; 107 2ce48: 09 f0 breq .+2 ; 0x2ce4c 2ce4a: f9 c2 rjmp .+1522 ; 0x2d43e 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")); 2ce4c: 82 ea ldi r24, 0xA2 ; 162 2ce4e: 9a e9 ldi r25, 0x9A ; 154 2ce50: 0f 94 f1 3b call 0x277e2 ; 0x277e2 2ce54: 18 e0 ldi r17, 0x08 ; 8 2ce56: fe c0 rjmp .+508 ; 0x2d054 default: RecordUARTActivity(); // something has happened on the UART, update the timeout record return ProtocolError; } } if (bytesConsumed != 0) { 2ce58: cd 28 or r12, r13 2ce5a: 19 f0 breq .+6 ; 0x2ce62 RecordUARTActivity(); // something has happened on the UART, update the timeout record 2ce5c: 0f 94 d4 3b call 0x277a8 ; 0x277a8 2ce60: 7f ce rjmp .-770 ; 0x2cb60 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 2ce62: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 2ce66: ab 01 movw r20, r22 2ce68: bc 01 movw r22, r24 2ce6a: 80 91 34 12 lds r24, 0x1234 ; 0x801234 2ce6e: 90 91 35 12 lds r25, 0x1235 ; 0x801235 2ce72: a0 91 36 12 lds r26, 0x1236 ; 0x801236 2ce76: b0 91 37 12 lds r27, 0x1237 ; 0x801237 2ce7a: 80 53 subi r24, 0x30 ; 48 2ce7c: 98 4f sbci r25, 0xF8 ; 248 2ce7e: af 4f sbci r26, 0xFF ; 255 2ce80: 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) { 2ce82: 48 17 cp r20, r24 2ce84: 59 07 cpc r21, r25 2ce86: 6a 07 cpc r22, r26 2ce88: 7b 07 cpc r23, r27 2ce8a: 08 f4 brcc .+2 ; 0x2ce8e 2ce8c: 69 ce rjmp .-814 ; 0x2cb60 2ce8e: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2ce92: 88 23 and r24, r24 2ce94: 09 f4 brne .+2 ; 0x2ce98 2ce96: 64 ce rjmp .-824 ; 0x2cb60 rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 2ce98: 10 92 49 12 sts 0x1249, r1 ; 0x801249 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 2ce9c: 81 e0 ldi r24, 0x01 ; 1 2ce9e: 80 93 42 12 sts 0x1242, r24 ; 0x801242 currentScope = Scope::StartSeq; 2cea2: 80 93 27 12 sts 0x1227, r24 ; 0x801227 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 2cea6: 86 e0 ldi r24, 0x06 ; 6 2cea8: 80 93 29 12 sts 0x1229, r24 ; 0x801229 SendVersion(0); 2ceac: 80 e0 ldi r24, 0x00 ; 0 2ceae: 0f 94 38 63 call 0x2c670 ; 0x2c670 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 2ceb2: 64 e0 ldi r22, 0x04 ; 4 2ceb4: 8a e7 ldi r24, 0x7A ; 122 2ceb6: 9a e9 ldi r25, 0x9A ; 154 2ceb8: 79 c0 rjmp .+242 ; 0x2cfac return Finished; } StepStatus ProtocolLogic::StartSeqStep() { // solve initial handshake switch (scopeState) { 2ceba: 10 91 28 12 lds r17, 0x1228 ; 0x801228 2cebe: 13 30 cpi r17, 0x03 ; 3 2cec0: b1 f1 breq .+108 ; 0x2cf2e 2cec2: 60 f0 brcs .+24 ; 0x2cedc 2cec4: 16 30 cpi r17, 0x06 ; 6 2cec6: 09 f4 brne .+2 ; 0x2ceca 2cec8: 50 c0 rjmp .+160 ; 0x2cf6a 2ceca: 19 30 cpi r17, 0x09 ; 9 2cecc: 09 f0 breq .+2 ; 0x2ced0 2cece: be cf rjmp .-132 ; 0x2ce4c // Start General Interrogation after line up - initial parametrization is started StartWritingInitRegisters(); } return Processing; case ScopeState::WritingInitRegisters: if (ProcessWritingInitRegister()) { 2ced0: 0f 94 04 3e call 0x27c08 ; 0x27c08 2ced4: 88 23 and r24, r24 2ced6: 09 f4 brne .+2 ; 0x2ceda 2ced8: 43 ce rjmp .-890 ; 0x2cb60 2ceda: 40 ce rjmp .-896 ; 0x2cb5c void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; } StepStatus ProtocolLogic::ProcessVersionResponse(uint8_t stage) { if (rsp.request.code != RequestMsgCodes::Version || rsp.request.value != stage) { 2cedc: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 2cee0: 83 35 cpi r24, 0x53 ; 83 2cee2: 21 f4 brne .+8 ; 0x2ceec 2cee4: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 2cee8: 18 17 cp r17, r24 2ceea: 11 f0 breq .+4 ; 0x2cef0 mmuFwVersion[stage] = rsp.paramValue; if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { if (--retries == 0) { return VersionMismatch; } else { SendVersion(stage); 2ceec: 81 2f mov r24, r17 2ceee: fe cd rjmp .-1028 ; 0x2caec 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; 2cef0: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2cef4: e1 2f mov r30, r17 2cef6: f0 e0 ldi r31, 0x00 ; 0 2cef8: df 01 movw r26, r30 2cefa: ac 58 subi r26, 0x8C ; 140 2cefc: bd 4e sbci r27, 0xED ; 237 2cefe: 8c 93 st X, r24 if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { 2cf00: e1 56 subi r30, 0x61 ; 97 2cf02: f5 46 sbci r31, 0x65 ; 101 2cf04: e4 91 lpm r30, Z 2cf06: 8e 17 cp r24, r30 2cf08: 41 f0 breq .+16 ; 0x2cf1a if (--retries == 0) { 2cf0a: 80 91 29 12 lds r24, 0x1229 ; 0x801229 2cf0e: 81 50 subi r24, 0x01 ; 1 2cf10: 80 93 29 12 sts 0x1229, r24 ; 0x801229 2cf14: 81 11 cpse r24, r1 2cf16: ea cf rjmp .-44 ; 0x2ceec 2cf18: 99 cf rjmp .-206 ; 0x2ce4c SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 2cf1a: 84 ef ldi r24, 0xF4 ; 244 2cf1c: 9c e9 ldi r25, 0x9C ; 156 2cf1e: 0e 94 49 72 call 0xe492 ; 0xe492 /// @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; } 2cf22: 8a e0 ldi r24, 0x0A ; 10 2cf24: 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); 2cf28: 81 e0 ldi r24, 0x01 ; 1 2cf2a: 81 0f add r24, r17 2cf2c: df cd rjmp .-1090 ; 0x2caec 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) { 2cf2e: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 2cf32: 83 35 cpi r24, 0x53 ; 83 2cf34: 21 f4 brne .+8 ; 0x2cf3e 2cf36: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 2cf3a: 83 30 cpi r24, 0x03 ; 3 2cf3c: 11 f0 breq .+4 ; 0x2cf42 // got a response to something else - protocol corruption probably, repeat the query OR restart the comm by issuing S0? SendVersion(3); 2cf3e: 83 e0 ldi r24, 0x03 ; 3 2cf40: d5 cd rjmp .-1110 ; 0x2caec } else { mmuFwVersionBuild = rsp.paramValue; // just register the build number 2cf42: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2cf46: 90 91 41 12 lds r25, 0x1241 ; 0x801241 2cf4a: 90 93 78 12 sts 0x1278, r25 ; 0x801278 2cf4e: 80 93 77 12 sts 0x1277, r24 ; 0x801277 } return ScopeState::Reading16bitRegisters; } void ProtocolLogic::StartWritingInitRegisters() { regIndex = 0; 2cf52: 10 92 73 12 sts 0x1273, r1 ; 0x801273 SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 2cf56: e2 ef ldi r30, 0xF2 ; 242 2cf58: fc e9 ldi r31, 0x9C ; 156 2cf5a: 84 91 lpm r24, Z 2cf5c: 60 91 71 12 lds r22, 0x1271 ; 0x801271 2cf60: 70 e0 ldi r23, 0x00 ; 0 2cf62: 49 e0 ldi r20, 0x09 ; 9 2cf64: 0f 94 45 3d call 0x27a8a ; 0x27a8a 2cf68: fb cd rjmp .-1034 ; 0x2cb60 currentScope = Scope::Idle; IdleRestart(); } void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; 2cf6a: 82 e0 ldi r24, 0x02 ; 2 2cf6c: 80 93 42 12 sts 0x1242, r24 ; 0x801242 currentScope = Scope::Idle; 2cf70: 83 e0 ldi r24, 0x03 ; 3 2cf72: 80 93 27 12 sts 0x1227, r24 ; 0x801227 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 2cf76: 82 e8 ldi r24, 0x82 ; 130 2cf78: 80 93 28 12 sts 0x1228, r24 ; 0x801228 2cf7c: d2 cd rjmp .-1116 ; 0x2cb22 } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 2cf7e: 80 91 28 12 lds r24, 0x1228 ; 0x801228 2cf82: 88 30 cpi r24, 0x08 ; 8 2cf84: 09 f4 brne .+2 ; 0x2cf88 2cf86: b7 c0 rjmp .+366 ; 0x2d0f6 2cf88: a8 f4 brcc .+42 ; 0x2cfb4 2cf8a: 84 30 cpi r24, 0x04 ; 4 2cf8c: d9 f0 breq .+54 ; 0x2cfc4 2cf8e: 87 30 cpi r24, 0x07 ; 7 2cf90: 09 f4 brne .+2 ; 0x2cf94 2cf92: ae c0 rjmp .+348 ; 0x2d0f0 return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); } StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; 2cf94: 81 e0 ldi r24, 0x01 ; 1 2cf96: 80 93 42 12 sts 0x1242, r24 ; 0x801242 currentScope = Scope::DelayedRestart; 2cf9a: 82 e0 ldi r24, 0x02 ; 2 2cf9c: 80 93 27 12 sts 0x1227, r24 ; 0x801227 retries = maxRetries; SendVersion(0); } void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; 2cfa0: 83 e8 ldi r24, 0x83 ; 131 2cfa2: 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); 2cfa6: 65 e0 ldi r22, 0x05 ; 5 2cfa8: 80 e9 ldi r24, 0x90 ; 144 2cfaa: 9a e9 ldi r25, 0x9A ; 154 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 2cfac: 0f 94 62 3c call 0x278c4 ; 0x278c4 2cfb0: 18 2f mov r17, r24 2cfb2: 50 c0 rjmp .+160 ; 0x2d054 } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 2cfb4: 8a 30 cpi r24, 0x0A ; 10 2cfb6: 09 f4 brne .+2 ; 0x2cfba 2cfb8: a7 c0 rjmp .+334 ; 0x2d108 2cfba: 60 f3 brcs .-40 ; 0x2cf94 2cfbc: 8d 30 cpi r24, 0x0D ; 13 2cfbe: 08 f4 brcc .+2 ; 0x2cfc2 2cfc0: 5f cd rjmp .-1346 ; 0x2ca80 2cfc2: e8 cf rjmp .-48 ; 0x2cf94 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) { 2cfc4: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 2cfc8: 8e 34 cpi r24, 0x4E ; 78 2cfca: 60 f5 brcc .+88 ; 0x2d024 2cfcc: 8b 34 cpi r24, 0x4B ; 75 2cfce: 10 f4 brcc .+4 ; 0x2cfd4 2cfd0: 85 34 cpi r24, 0x45 ; 69 2cfd2: 01 f7 brne .-64 ; 0x2cf94 case RequestMsgCodes::Eject: case RequestMsgCodes::Load: case RequestMsgCodes::Mode: case RequestMsgCodes::Tool: case RequestMsgCodes::Unload: if (rsp.paramCode != ResponseMsgParamCodes::Finished) { 2cfd4: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2cfd8: 86 34 cpi r24, 0x46 ; 70 2cfda: 09 f4 brne .+2 ; 0x2cfde 2cfdc: 73 c0 rjmp .+230 ; 0x2d0c4 return true; } } StepStatus ProtocolLogic::SwitchFromIdleToCommand() { currentScope = Scope::Command; 2cfde: 84 e0 ldi r24, 0x04 ; 4 2cfe0: 80 93 27 12 sts 0x1227, r24 ; 0x801227 2cfe4: 85 e0 ldi r24, 0x05 ; 5 2cfe6: ea e3 ldi r30, 0x3A ; 58 2cfe8: f2 e1 ldi r31, 0x12 ; 18 2cfea: de 01 movw r26, r28 2cfec: 11 96 adiw r26, 0x01 ; 1 2cfee: 01 90 ld r0, Z+ 2cff0: 0d 92 st X+, r0 2cff2: 8a 95 dec r24 2cff4: e1 f7 brne .-8 ; 0x2cfee StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 2cff6: 85 e0 ldi r24, 0x05 ; 5 2cff8: fe 01 movw r30, r28 2cffa: 31 96 adiw r30, 0x01 ; 1 2cffc: aa e2 ldi r26, 0x2A ; 42 2cffe: b2 e1 ldi r27, 0x12 ; 18 2d000: 01 90 ld r0, Z+ 2d002: 0d 92 st X+, r0 2d004: 8a 95 dec r24 2d006: e1 f7 brne .-8 ; 0x2d000 default: return ProtocolError; } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); 2d008: 0f 94 ed 63 call 0x2c7da ; 0x2c7da 2d00c: 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) { 2d00e: 85 30 cpi r24, 0x05 ; 5 2d010: 09 f2 breq .-126 ; 0x2cf94 2d012: 08 f0 brcs .+2 ; 0x2d016 2d014: 9c c0 rjmp .+312 ; 0x2d14e 2d016: 82 30 cpi r24, 0x02 ; 2 2d018: 09 f4 brne .+2 ; 0x2d01c 2d01a: 32 cd rjmp .-1436 ; 0x2ca80 2d01c: 84 30 cpi r24, 0x04 ; 4 2d01e: 09 f4 brne .+2 ; 0x2d022 2d020: 3b cf rjmp .-394 ; 0x2ce98 2d022: 18 c0 rjmp .+48 ; 0x2d054 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) { 2d024: 84 35 cpi r24, 0x54 ; 84 2d026: 08 f4 brcc .+2 ; 0x2d02a 2d028: b5 cf rjmp .-150 ; 0x2cf94 2d02a: 86 35 cpi r24, 0x56 ; 86 2d02c: 98 f2 brcs .-90 ; 0x2cfd4 2d02e: 88 35 cpi r24, 0x58 ; 88 2d030: 09 f0 breq .+2 ; 0x2d034 2d032: b0 cf rjmp .-160 ; 0x2cf94 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) { 2d034: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2d038: 86 34 cpi r24, 0x46 ; 70 2d03a: 89 f1 breq .+98 ; 0x2d09e 2d03c: 80 35 cpi r24, 0x50 ; 80 2d03e: c1 f1 breq .+112 ; 0x2d0b0 2d040: 82 34 cpi r24, 0x42 ; 66 2d042: 09 f0 breq .+2 ; 0x2d046 2d044: 42 c0 rjmp .+132 ; 0x2d0ca 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); 2d046: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2d04a: 80 93 68 12 sts 0x1268, r24 ; 0x801268 StartReading8bitRegisters(); 2d04e: 0f 94 2d 62 call 0x2c45a ; 0x2c45a return ButtonPushed; 2d052: 1b e0 ldi r17, 0x0B ; 11 2d054: 80 91 25 12 lds r24, 0x1225 ; 0x801225 2d058: 90 91 26 12 lds r25, 0x1226 ; 0x801226 break; default: break; } // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; 2d05c: 81 30 cpi r24, 0x01 ; 1 2d05e: 91 05 cpc r25, r1 2d060: 09 f0 breq .+2 ; 0x2d064 2d062: f0 c1 rjmp .+992 ; 0x2d444 const StepStatus ss = logic.Step(); switch (ss) { 2d064: 12 30 cpi r17, 0x02 ; 2 2d066: 09 f4 brne .+2 ; 0x2d06a 2d068: 90 c0 rjmp .+288 ; 0x2d18a 2d06a: 08 f0 brcs .+2 ; 0x2d06e 2d06c: 7d c0 rjmp .+250 ; 0x2d168 2d06e: 11 23 and r17, r17 2d070: 09 f4 brne .+2 ; 0x2d074 2d072: 1a c1 rjmp .+564 ; 0x2d2a8 case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 2d074: 00 23 and r16, r16 2d076: 09 f4 brne .+2 ; 0x2d07a 2d078: e6 c0 rjmp .+460 ; 0x2d246 switch (ss) { 2d07a: 17 30 cpi r17, 0x07 ; 7 2d07c: 09 f4 brne .+2 ; 0x2d080 2d07e: c6 c1 rjmp .+908 ; 0x2d40c 2d080: 08 f0 brcs .+2 ; 0x2d084 2d082: ba c1 rjmp .+884 ; 0x2d3f8 2d084: 14 30 cpi r17, 0x04 ; 4 2d086: 09 f4 brne .+2 ; 0x2d08a 2d088: c9 c1 rjmp .+914 ; 0x2d41c 2d08a: 15 30 cpi r17, 0x05 ; 5 2d08c: 09 f0 breq .+2 ; 0x2d090 2d08e: db c0 rjmp .+438 ; 0x2d246 state = xState::Connecting; ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); break; case ProtocolError: state = xState::Connecting; 2d090: 82 e0 ldi r24, 0x02 ; 2 2d092: 80 93 94 12 sts 0x1294, r24 ; 0x801294 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); 2d096: 60 e0 ldi r22, 0x00 ; 0 2d098: 8d e2 ldi r24, 0x2D ; 45 2d09a: 90 e8 ldi r25, 0x80 ; 128 2d09c: bc c1 rjmp .+888 ; 0x2d416 // 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) { 2d09e: 80 91 2a 12 lds r24, 0x122A ; 0x80122a 2d0a2: 88 23 and r24, r24 2d0a4: 29 f0 breq .+10 ; 0x2d0b0 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 2d0a6: 82 e8 ldi r24, 0x82 ; 130 2d0a8: 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; 2d0ac: 13 e0 ldi r17, 0x03 ; 3 2d0ae: d2 cf rjmp .-92 ; 0x2d054 } [[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); 2d0b0: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2d0b4: 80 93 67 12 sts 0x1267, r24 ; 0x801267 errorCode = ErrorCode::OK; 2d0b8: 81 e0 ldi r24, 0x01 ; 1 2d0ba: 90 e0 ldi r25, 0x00 ; 0 2d0bc: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2d0c0: 80 93 65 12 sts 0x1265, r24 ; 0x801265 } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); case ScopeState::FilamentSensorStateSent: StartReading8bitRegisters(); 2d0c4: 0f 94 2d 62 call 0x2c45a ; 0x2c45a 2d0c8: 4b cd rjmp .-1386 ; 0x2cb60 // 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; 2d0ca: 8c e0 ldi r24, 0x0C ; 12 2d0cc: 80 93 67 12 sts 0x1267, r24 ; 0x801267 errorCode = static_cast(rsp.paramValue); 2d0d0: 80 91 40 12 lds r24, 0x1240 ; 0x801240 2d0d4: 90 91 41 12 lds r25, 0x1241 ; 0x801241 2d0d8: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2d0dc: 80 93 65 12 sts 0x1265, r24 ; 0x801265 StartReading8bitRegisters(); // continue Idle state without restarting the communication 2d0e0: 0f 94 2d 62 call 0x2c45a ; 0x2c45a // @@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")); 2d0e4: 83 eb ldi r24, 0xB3 ; 179 2d0e6: 9a e9 ldi r25, 0x9A ; 154 2d0e8: 0f 94 f1 3b call 0x277e2 ; 0x277e2 2d0ec: 17 e0 ldi r17, 0x07 ; 7 2d0ee: b2 cf rjmp .-156 ; 0x2d054 return ProtocolError; } StartReading8bitRegisters(); return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); 2d0f0: 0f 94 51 62 call 0x2c4a2 ; 0x2c4a2 2d0f4: 35 cd rjmp .-1430 ; 0x2cb60 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Ready); 2d0f6: 82 e8 ldi r24, 0x82 ; 130 2d0f8: 0f 94 35 62 call 0x2c46a ; 0x2c46a 2d0fc: 80 93 28 12 sts 0x1228, r24 ; 0x801228 return scopeState == ScopeState::Ready ? Finished : Processing; 2d100: 82 38 cpi r24, 0x82 ; 130 2d102: 09 f0 breq .+2 ; 0x2d106 2d104: 2d cd rjmp .-1446 ; 0x2cb60 2d106: bc cc rjmp .-1672 ; 0x2ca80 case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 2d108: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2d10c: 81 34 cpi r24, 0x41 ; 65 2d10e: d1 f6 brne .-76 ; 0x2d0c4 // Button was accepted, decrement the retry. DecrementRetryAttempts(); 2d110: 0f 94 df 3b call 0x277be ; 0x277be 2d114: d7 cf rjmp .-82 ; 0x2d0c4 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 2d116: 88 30 cpi r24, 0x08 ; 8 2d118: b1 f0 breq .+44 ; 0x2d146 2d11a: 50 f3 brcs .-44 ; 0x2d0f0 2d11c: 8a 30 cpi r24, 0x0A ; 10 2d11e: 09 f0 breq .+2 ; 0x2d122 2d120: 39 cf rjmp .-398 ; 0x2cf94 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); return Processing; case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 2d122: 80 91 3f 12 lds r24, 0x123F ; 0x80123f 2d126: 81 34 cpi r24, 0x41 ; 65 2d128: 09 f0 breq .+2 ; 0x2d12c 2d12a: 18 cd rjmp .-1488 ; 0x2cb5c // Button was accepted, decrement the retry. DecrementRetryAttempts(); 2d12c: 0f 94 df 3b call 0x277be ; 0x277be 2d130: 15 cd rjmp .-1494 ; 0x2cb5c 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; 2d132: 10 92 67 12 sts 0x1267, r1 ; 0x801267 errorCode = ErrorCode::RUNNING; 2d136: 10 92 66 12 sts 0x1266, r1 ; 0x801266 2d13a: 10 92 65 12 sts 0x1265, r1 ; 0x801265 scopeState = ScopeState::Wait; 2d13e: 81 e8 ldi r24, 0x81 ; 129 return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); 2d140: 80 93 28 12 sts 0x1228, r24 ; 0x801228 2d144: 0d cd rjmp .-1510 ; 0x2cb60 2d146: 81 e8 ldi r24, 0x81 ; 129 2d148: 0f 94 35 62 call 0x2c46a ; 0x2c46a 2d14c: f9 cf rjmp .-14 ; 0x2d140 StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately ActivatePlannedRequest(); } auto currentStatus = ScopeStep(); switch (currentStatus) { 2d14e: 87 30 cpi r24, 0x07 ; 7 2d150: 49 f2 breq .-110 ; 0x2d0e4 2d152: 08 f4 brcc .+2 ; 0x2d156 2d154: 63 ce rjmp .-826 ; 0x2ce1c 2d156: 88 30 cpi r24, 0x08 ; 8 2d158: 09 f4 brne .+2 ; 0x2d15c 2d15a: 78 ce rjmp .-784 ; 0x2ce4c 2d15c: 7b cf rjmp .-266 ; 0x2d054 // 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()) { 2d15e: 80 91 28 12 lds r24, 0x1228 ; 0x801228 2d162: 87 fd sbrc r24, 7 2d164: 9a cc rjmp .-1740 ; 0x2ca9a 2d166: fc cc rjmp .-1544 ; 0x2cb60 StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); const StepStatus ss = logic.Step(); switch (ss) { 2d168: 13 30 cpi r17, 0x03 ; 3 2d16a: 09 f4 brne .+2 ; 0x2d16e 2d16c: 6c c0 rjmp .+216 ; 0x2d246 2d16e: 1b 30 cpi r17, 0x0B ; 11 2d170: 09 f0 breq .+2 ; 0x2d174 2d172: 80 cf rjmp .-256 ; 0x2d074 case Processing: OnMMUProgressMsg(logic.Progress()); break; case ButtonPushed: lastButton = logic.Button(); 2d174: 80 91 68 12 lds r24, 0x1268 ; 0x801268 2d178: 80 93 8f 12 sts 0x128F, r24 ; 0x80128f LogEchoEvent_P(PSTR("MMU Button pushed")); 2d17c: 82 ed ldi r24, 0xD2 ; 210 2d17e: 9a e9 ldi r25, 0x9A ; 154 2d180: 0f 94 e5 87 call 0x30fca ; 0x30fca CheckUserInput(); // Process the button immediately 2d184: 0f 94 57 64 call 0x2c8ae ; 0x2c8ae 2d188: 5e c0 rjmp .+188 ; 0x2d246 CheckErrorScreenUserInput(); } void MMU2::CheckFINDARunout() { // Check for FINDA filament runout if (!FindaDetectsFilament() && check_fsensor()) { // Check if we have filament runout detected from sensors 2d18a: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 2d18e: 81 11 cpse r24, r1 2d190: 5a c0 rjmp .+180 ; 0x2d246 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() 2d192: 0e 94 be 60 call 0xc17c ; 0xc17c && mcode_in_progress != 600 && !saved_printing && !mesh_bed_leveling_flag && !homing_flag && e_active(); 2d196: 88 23 and r24, r24 2d198: 09 f4 brne .+2 ; 0x2d19c 2d19a: 55 c0 rjmp .+170 ; 0x2d246 } // Currently only used in one place, allowed to be inlined bool check_fsensor() { return printJobOngoing() && mcode_in_progress != 600 2d19c: 80 91 aa 0d lds r24, 0x0DAA ; 0x800daa <_ZL17mcode_in_progress.lto_priv.493> 2d1a0: 90 91 ab 0d lds r25, 0x0DAB ; 0x800dab <_ZL17mcode_in_progress.lto_priv.493+0x1> 2d1a4: 88 35 cpi r24, 0x58 ; 88 2d1a6: 92 40 sbci r25, 0x02 ; 2 2d1a8: 09 f4 brne .+2 ; 0x2d1ac 2d1aa: 4d c0 rjmp .+154 ; 0x2d246 && !saved_printing 2d1ac: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 2d1b0: 81 11 cpse r24, r1 2d1b2: 49 c0 rjmp .+146 ; 0x2d246 && !mesh_bed_leveling_flag 2d1b4: 80 91 06 12 lds r24, 0x1206 ; 0x801206 2d1b8: 81 11 cpse r24, r1 2d1ba: 45 c0 rjmp .+138 ; 0x2d246 && !homing_flag 2d1bc: 80 91 05 12 lds r24, 0x1205 ; 0x801205 2d1c0: 81 11 cpse r24, r1 2d1c2: 41 c0 rjmp .+130 ; 0x2d246 bool e_active() { unsigned char e_active = 0; block_t *block; if(block_buffer_tail != block_buffer_head) 2d1c4: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 2d1c8: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 2d1cc: 98 17 cp r25, r24 2d1ce: d9 f1 breq .+118 ; 0x2d246 { uint8_t block_index = block_buffer_tail; 2d1d0: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 } #endif bool e_active() { unsigned char e_active = 0; 2d1d4: 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++; 2d1d6: 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) 2d1d8: 30 91 a8 0d lds r19, 0x0DA8 ; 0x800da8 2d1dc: 38 17 cp r19, r24 2d1de: 89 f0 breq .+34 ; 0x2d202 { block = &block_buffer[block_index]; if(block->steps[E_AXIS].wide != 0) e_active++; 2d1e0: 28 9f mul r18, r24 2d1e2: f0 01 movw r30, r0 2d1e4: 11 24 eor r1, r1 2d1e6: e8 53 subi r30, 0x38 ; 56 2d1e8: f9 4f sbci r31, 0xF9 ; 249 2d1ea: 44 85 ldd r20, Z+12 ; 0x0c 2d1ec: 55 85 ldd r21, Z+13 ; 0x0d 2d1ee: 66 85 ldd r22, Z+14 ; 0x0e 2d1f0: 77 85 ldd r23, Z+15 ; 0x0f 2d1f2: 45 2b or r20, r21 2d1f4: 46 2b or r20, r22 2d1f6: 47 2b or r20, r23 2d1f8: 09 f0 breq .+2 ; 0x2d1fc 2d1fa: 9f 5f subi r25, 0xFF ; 255 block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1); 2d1fc: 8f 5f subi r24, 0xFF ; 255 2d1fe: 8f 70 andi r24, 0x0F ; 15 2d200: eb cf rjmp .-42 ; 0x2d1d8 && e_active(); 2d202: 99 23 and r25, r25 2d204: 01 f1 breq .+64 ; 0x2d246 SERIAL_ECHOLNPGM("FINDA filament runout!"); 2d206: 83 e6 ldi r24, 0x63 ; 99 2d208: 9a e9 ldi r25, 0x9A ; 154 2d20a: 0e 94 49 72 call 0xe492 ; 0xe492 //! //! @param z_move //! @param e_move void stop_and_save_print_to_ram(float z_move, float e_move) { if (saved_printing) return; 2d20e: 80 91 e7 11 lds r24, 0x11E7 ; 0x8011e7 2d212: 81 11 cpse r24, r1 2d214: 05 c0 rjmp .+10 ; 0x2d220 2d216: 60 e0 ldi r22, 0x00 ; 0 2d218: 70 e0 ldi r23, 0x00 ; 0 2d21a: cb 01 movw r24, r22 2d21c: 0f 94 a9 42 call 0x28552 ; 0x28552 marlin_stop_and_save_print_to_ram(); restore_print_from_ram_and_continue(0); 2d220: 60 e0 ldi r22, 0x00 ; 0 2d222: 70 e0 ldi r23, 0x00 ; 0 2d224: cb 01 movw r24, r22 2d226: 0e 94 36 61 call 0xc26c ; 0xc26c 2d22a: 86 ed ldi r24, 0xD6 ; 214 2d22c: 9e e0 ldi r25, 0x0E ; 14 2d22e: 0f 94 9b a0 call 0x34136 ; 0x34136 2d232: 81 30 cpi r24, 0x01 ; 1 2d234: 21 f4 brne .+8 ; 0x2d23e if (SpoolJoin::spooljoin.isSpoolJoinEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN){ // Can't auto if F=? 2d236: 0f 94 4a 42 call 0x28494 ; 0x28494 2d23a: 8f 3f cpi r24, 0xFF ; 255 2d23c: 91 f5 brne .+100 ; 0x2d2a2 enquecommand_front_P(PSTR("M600 AUTO")); // save print and run M600 command } else { enquecommand_front_P(MSG_M600); // save print and run M600 command 2d23e: 8b e7 ldi r24, 0x7B ; 123 2d240: 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 2d242: 0f 94 16 44 call 0x2882c ; 0x2882c break; } } } if (logic.Running()) { 2d246: 80 91 42 12 lds r24, 0x1242 ; 0x801242 2d24a: 82 30 cpi r24, 0x02 ; 2 2d24c: 19 f4 brne .+6 ; 0x2d254 state = xState::Active; 2d24e: 81 e0 ldi r24, 0x01 ; 1 2d250: 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 2d254: 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) { 2d258: 80 91 c6 06 lds r24, 0x06C6 ; 0x8006c6 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.452> 2d25c: 88 23 and r24, r24 2d25e: 51 f0 breq .+20 ; 0x2d274 bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 2d260: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.458> 2d264: 81 11 cpse r24, r1 2d266: 06 c0 rjmp .+12 ; 0x2d274 2d268: 80 91 8c 12 lds r24, 0x128C ; 0x80128c 2d26c: 90 91 8d 12 lds r25, 0x128D ; 0x80128d 2d270: 0f 94 48 89 call 0x31290 ; 0x31290 CheckErrorScreenUserInput(); } 2d274: a0 96 adiw r28, 0x20 ; 32 2d276: 0f b6 in r0, 0x3f ; 63 2d278: f8 94 cli 2d27a: de bf out 0x3e, r29 ; 62 2d27c: 0f be out 0x3f, r0 ; 63 2d27e: cd bf out 0x3d, r28 ; 61 2d280: df 91 pop r29 2d282: cf 91 pop r28 2d284: 1f 91 pop r17 2d286: 0f 91 pop r16 2d288: ff 90 pop r15 2d28a: ef 90 pop r14 2d28c: df 90 pop r13 2d28e: cf 90 pop r12 2d290: bf 90 pop r11 2d292: af 90 pop r10 2d294: 9f 90 pop r9 2d296: 8f 90 pop r8 2d298: 7f 90 pop r7 2d29a: 6f 90 pop r6 2d29c: 5f 90 pop r5 2d29e: 4f 90 pop r4 2d2a0: 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 2d2a2: 89 e5 ldi r24, 0x59 ; 89 2d2a4: 9a e9 ldi r25, 0x9A ; 154 2d2a6: cd cf rjmp .-102 ; 0x2d242 2d2a8: 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) { 2d2ac: 80 91 8b 12 lds r24, 0x128B ; 0x80128b 2d2b0: 08 17 cp r16, r24 2d2b2: 09 f4 brne .+2 ; 0x2d2b6 2d2b4: 49 c0 rjmp .+146 ; 0x2d348 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 2d2b6: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2d2ba: 84 30 cpi r24, 0x04 ; 4 2d2bc: b9 f4 brne .+46 ; 0x2d2ec break; } } void ReportProgressHook(CommandInProgress cip, ProgressCode ec) { if (cip != CommandInProgress::NoCommand) { 2d2be: 80 91 2a 12 lds r24, 0x122A ; 0x80122a 2d2c2: 88 23 and r24, r24 2d2c4: 99 f0 breq .+38 ; 0x2d2ec custom_message_type = CustomMsg::MMUProgress; 2d2c6: 89 e0 ldi r24, 0x09 ; 9 2d2c8: 80 93 c7 06 sts 0x06C7, r24 ; 0x8006c7 : static_cast(pgm_read_ptr(&progressTexts[0])); 2d2cc: ef e1 ldi r30, 0x1F ; 31 2d2ce: 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])) 2d2d0: 0e 31 cpi r16, 0x1E ; 30 2d2d2: 30 f4 brcc .+12 ; 0x2d2e0 2d2d4: e0 2f mov r30, r16 2d2d6: f0 e0 ldi r31, 0x00 ; 0 2d2d8: ee 0f add r30, r30 2d2da: ff 1f adc r31, r31 2d2dc: e1 5e subi r30, 0xE1 ; 225 2d2de: f5 46 sbci r31, 0x65 ; 101 : static_cast(pgm_read_ptr(&progressTexts[0])); 2d2e0: 85 91 lpm r24, Z+ 2d2e2: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 2d2e4: 0e 94 a7 6c call 0xd94e ; 0xd94e 2d2e8: 0e 94 99 e6 call 0x1cd32 ; 0x1cd32 2d2ec: ef e1 ldi r30, 0x1F ; 31 2d2ee: 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])) 2d2f0: 0e 31 cpi r16, 0x1E ; 30 2d2f2: 30 f4 brcc .+12 ; 0x2d300 2d2f4: e0 2f mov r30, r16 2d2f6: f0 e0 ldi r31, 0x00 ; 0 2d2f8: ee 0f add r30, r30 2d2fa: ff 1f adc r31, r31 2d2fc: e1 5e subi r30, 0xE1 ; 225 2d2fe: f5 46 sbci r31, 0x65 ; 101 : static_cast(pgm_read_ptr(&progressTexts[0])); 2d300: 85 91 lpm r24, Z+ 2d302: 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))); 2d304: 02 96 adiw r24, 0x02 ; 2 2d306: 0f 94 e5 87 call 0x30fca ; 0x30fca } } void MMU2::OnMMUProgressMsgChanged(ProgressCode pc) { ReportProgress(pc); lastProgressCode = pc; 2d30a: 00 93 8b 12 sts 0x128B, r16 ; 0x80128b switch (pc) { 2d30e: 03 30 cpi r16, 0x03 ; 3 2d310: 49 f0 breq .+18 ; 0x2d324 2d312: 0c 31 cpi r16, 0x1C ; 28 2d314: 09 f0 breq .+2 ; 0x2d318 2d316: 97 cf rjmp .-210 ; 0x2d246 2d318: 0f 94 ce 22 call 0x2459c ; 0x2459c } break; case ProgressCode::FeedingToFSensor: // prepare for the movement of the E-motor planner_synchronize(); loadFilamentStarted = true; 2d31c: 81 e0 ldi r24, 0x01 ; 1 2d31e: 80 93 96 12 sts 0x1296, r24 ; 0x801296 2d322: 91 cf rjmp .-222 ; 0x2d246 2d324: 80 91 27 12 lds r24, 0x1227 ; 0x801227 2d328: 84 30 cpi r24, 0x04 ; 4 2d32a: 31 f4 brne .+12 ; 0x2d338 ReportProgress(pc); lastProgressCode = pc; switch (pc) { case ProgressCode::UnloadingToFinda: if ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::UnloadFilament || ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::ToolChange)) { 2d32c: 80 91 2a 12 lds r24, 0x122A ; 0x80122a 2d330: 84 55 subi r24, 0x54 ; 84 2d332: 82 30 cpi r24, 0x02 ; 2 2d334: 08 f4 brcc .+2 ; 0x2d338 2d336: 87 cf rjmp .-242 ; 0x2d246 2d338: 0f 94 ce 22 call 0x2459c ; 0x2459c // 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; 2d33c: 81 e0 ldi r24, 0x01 ; 1 2d33e: 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(); 2d342: 0f 94 ad 3f call 0x27f5a ; 0x27f5a 2d346: 7f cf rjmp .-258 ; 0x2d246 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) { 2d348: 03 30 cpi r16, 0x03 ; 3 2d34a: 71 f1 breq .+92 ; 0x2d3a8 2d34c: 0c 31 cpi r16, 0x1C ; 28 2d34e: 09 f0 breq .+2 ; 0x2d352 2d350: 7a cf rjmp .-268 ; 0x2d246 unloadFilamentStarted = false; } } break; case ProgressCode::FeedingToFSensor: if (loadFilamentStarted) { 2d352: 80 91 96 12 lds r24, 0x1296 ; 0x801296 2d356: 88 23 and r24, r24 2d358: 09 f4 brne .+2 ; 0x2d35c 2d35a: 75 cf rjmp .-278 ; 0x2d246 switch (WhereIsFilament()) { 2d35c: 0f 94 f5 87 call 0x30fea ; 0x30fea 2d360: 88 23 and r24, r24 2d362: b1 f1 breq .+108 ; 0x2d3d0 2d364: 81 30 cpi r24, 0x01 ; 1 2d366: 09 f0 breq .+2 ; 0x2d36a 2d368: 6e cf rjmp .-292 ; 0x2d246 case FilamentState::AT_FSENSOR: // fsensor triggered, finish FeedingToExtruder state loadFilamentStarted = false; 2d36a: 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(); 2d36e: 0f 94 a9 86 call 0x30d52 ; 0x30d52 // 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; 2d372: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac planner_abort_queued_moves(); { extruder_move(logic.ExtraLoadDistance() + 2, logic.PulleySlowFeedRate()); 2d376: 60 91 72 12 lds r22, 0x1272 ; 0x801272 2d37a: 70 e0 ldi r23, 0x00 ; 0 2d37c: 90 e0 ldi r25, 0x00 ; 0 2d37e: 80 e0 ldi r24, 0x00 ; 0 2d380: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 2d384: 6b 01 movw r12, r22 2d386: 7c 01 movw r14, r24 2d388: 60 91 71 12 lds r22, 0x1271 ; 0x801271 2d38c: 70 e0 ldi r23, 0x00 ; 0 2d38e: 6e 5f subi r22, 0xFE ; 254 2d390: 7f 4f sbci r23, 0xFF ; 255 2d392: 07 2e mov r0, r23 2d394: 00 0c add r0, r0 2d396: 88 0b sbc r24, r24 2d398: 99 0b sbc r25, r25 2d39a: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2d39e: a7 01 movw r20, r14 2d3a0: 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()); 2d3a2: 0f 94 c1 87 call 0x30f82 ; 0x30f82 2d3a6: 4f cf rjmp .-354 ; 0x2d246 } 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 2d3a8: 80 91 97 12 lds r24, 0x1297 ; 0x801297 2d3ac: 88 23 and r24, r24 2d3ae: 09 f4 brne .+2 ; 0x2d3b2 2d3b0: 4a cf rjmp .-364 ; 0x2d246 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); 2d3b2: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 2d3b6: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 2d3ba: 98 13 cpse r25, r24 2d3bc: 44 cf rjmp .-376 ; 0x2d246 switch (WhereIsFilament()) { 2d3be: 0f 94 f5 87 call 0x30fea ; 0x30fea 2d3c2: 81 50 subi r24, 0x01 ; 1 2d3c4: 83 30 cpi r24, 0x03 ; 3 2d3c6: 08 f4 brcc .+2 ; 0x2d3ca 2d3c8: bc cf rjmp .-136 ; 0x2d342 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; 2d3ca: 10 92 97 12 sts 0x1297, r1 ; 0x801297 2d3ce: 3b cf rjmp .-394 ; 0x2d246 2d3d0: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 2d3d4: 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 2d3d8: 98 13 cpse r25, r24 2d3da: 35 cf rjmp .-406 ; 0x2d246 // 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()); 2d3dc: 60 91 72 12 lds r22, 0x1272 ; 0x801272 2d3e0: 70 e0 ldi r23, 0x00 ; 0 2d3e2: 90 e0 ldi r25, 0x00 ; 0 2d3e4: 80 e0 ldi r24, 0x00 ; 0 2d3e6: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 2d3ea: 9b 01 movw r18, r22 2d3ec: ac 01 movw r20, r24 2d3ee: 60 e0 ldi r22, 0x00 ; 0 2d3f0: 70 e0 ldi r23, 0x00 ; 0 2d3f2: 8f ea ldi r24, 0xAF ; 175 2d3f4: 93 e4 ldi r25, 0x43 ; 67 2d3f6: d5 cf rjmp .-86 ; 0x2d3a2 // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { switch (ss) { 2d3f8: 18 30 cpi r17, 0x08 ; 8 2d3fa: b9 f0 breq .+46 ; 0x2d42a 2d3fc: 19 30 cpi r17, 0x09 ; 9 2d3fe: 09 f0 breq .+2 ; 0x2d402 2d400: 22 cf rjmp .-444 ; 0x2d246 StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); break; case PrinterError: ReportError(logic.PrinterError(), ErrorSourcePrinter); 2d402: 60 e0 ldi r22, 0x00 ; 0 2d404: 0f 94 69 50 call 0x2a0d2 ; 0x2a0d2 2d408: 19 e0 ldi r17, 0x09 ; 9 2d40a: 1d cf rjmp .-454 ; 0x2d246 default: if (reportErrors) { switch (ss) { case CommandError: ReportError(logic.Error(), ErrorSourceMMU); 2d40c: 61 e0 ldi r22, 0x01 ; 1 2d40e: 80 91 65 12 lds r24, 0x1265 ; 0x801265 2d412: 90 91 66 12 lds r25, 0x1266 ; 0x801266 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 2d416: 0f 94 69 50 call 0x2a0d2 ; 0x2a0d2 2d41a: 15 cf rjmp .-470 ; 0x2d246 case CommandError: ReportError(logic.Error(), ErrorSourceMMU); break; case CommunicationTimeout: state = xState::Connecting; 2d41c: 82 e0 ldi r24, 0x02 ; 2 2d41e: 80 93 94 12 sts 0x1294, r24 ; 0x801294 ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); 2d422: 60 e0 ldi r22, 0x00 ; 0 2d424: 8e e2 ldi r24, 0x2E ; 46 2d426: 90 e8 ldi r25, 0x80 ; 128 2d428: f6 cf rjmp .-20 ; 0x2d416 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 2d42a: 10 92 94 12 sts 0x1294, r1 ; 0x801294 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 2d42e: 10 92 42 12 sts 0x1242, r1 ; 0x801242 currentScope = Scope::Stopped; 2d432: 10 92 27 12 sts 0x1227, r1 ; 0x801227 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 2d436: 60 e0 ldi r22, 0x00 ; 0 2d438: 8c e2 ldi r24, 0x2C ; 44 2d43a: 90 e8 ldi r25, 0x80 ; 128 2d43c: ec cf rjmp .-40 ; 0x2d416 break; } } [[fallthrough]]; // otherwise default: RecordUARTActivity(); // something has happened on the UART, update the timeout record 2d43e: 0f 94 d4 3b call 0x277a8 ; 0x277a8 2d442: a8 cd rjmp .-1200 ; 0x2cf94 case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 2d444: 00 23 and r16, r16 2d446: 01 f3 breq .-64 ; 0x2d408 2d448: dc cf rjmp .-72 ; 0x2d402 0002d44a : } } } void MMU2::ResumeHotendTemp() { if ((mmu_print_saved & SavedState::CooldownPending)) { 2d44a: 80 91 95 12 lds r24, 0x1295 ; 0x801295 2d44e: 82 ff sbrs r24, 2 2d450: 07 c0 rjmp .+14 ; 0x2d460 // Clear the "pending" flag if we haven't cooled yet. mmu_print_saved &= ~(SavedState::CooldownPending); 2d452: 8b 7f andi r24, 0xFB ; 251 2d454: 80 93 95 12 sts 0x1295, r24 ; 0x801295 LogEchoEvent_P(PSTR("Cooldown flag cleared")); 2d458: 80 ec ldi r24, 0xC0 ; 192 2d45a: 9b e9 ldi r25, 0x9B ; 155 2d45c: 0f 94 e5 87 call 0x30fca ; 0x30fca } if ((mmu_print_saved & SavedState::Cooldown) && resume_hotend_temp) { 2d460: 80 91 95 12 lds r24, 0x1295 ; 0x801295 2d464: 81 ff sbrs r24, 1 2d466: 52 c0 rjmp .+164 ; 0x2d50c 2d468: 80 91 89 12 lds r24, 0x1289 ; 0x801289 2d46c: 90 91 8a 12 lds r25, 0x128A ; 0x80128a 2d470: 89 2b or r24, r25 2d472: 09 f4 brne .+2 ; 0x2d476 2d474: 4b c0 rjmp .+150 ; 0x2d50c LogEchoEvent_P(PSTR("Resuming Temp")); 2d476: 82 eb ldi r24, 0xB2 ; 178 2d478: 9b e9 ldi r25, 0x9B ; 155 2d47a: 0f 94 e5 87 call 0x30fca ; 0x30fca // @@TODO MMU2_ECHO_MSGRPGM(PSTR("Restoring hotend temperature ")); SERIAL_ECHOLN(resume_hotend_temp); 2d47e: 80 91 89 12 lds r24, 0x1289 ; 0x801289 2d482: 90 91 8a 12 lds r25, 0x128A ; 0x80128a 2d486: 0f 94 62 42 call 0x284c4 ; 0x284c4 mmu_print_saved &= ~(SavedState::Cooldown); 2d48a: 80 91 95 12 lds r24, 0x1295 ; 0x801295 2d48e: 8d 7f andi r24, 0xFD ; 253 2d490: 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; 2d494: 80 91 89 12 lds r24, 0x1289 ; 0x801289 2d498: 90 91 8a 12 lds r25, 0x128A ; 0x80128a 2d49c: 90 93 f2 11 sts 0x11F2, r25 ; 0x8011f2 2d4a0: 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)); 2d4a4: 85 e1 ldi r24, 0x15 ; 21 2d4a6: 9a e5 ldi r25, 0x5A ; 90 2d4a8: 0e 94 a7 6c call 0xd94e ; 0xd94e 2d4ac: 0f 94 22 0b call 0x21644 ; 0x21644 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)); 2d4b0: 42 e8 ldi r20, 0x82 ; 130 2d4b2: 5b e9 ldi r21, 0x9B ; 155 2d4b4: 62 e0 ldi r22, 0x02 ; 2 2d4b6: 80 e0 ldi r24, 0x00 ; 0 2d4b8: 0e 94 85 69 call 0xd30a ; 0xd30a int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 2d4bc: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 2d4c0: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 2d4c4: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 2d4c8: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 2d4cc: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 2d4d0: 20 91 f1 11 lds r18, 0x11F1 ; 0x8011f1 2d4d4: 30 91 f2 11 lds r19, 0x11F2 ; 0x8011f2 2d4d8: c9 01 movw r24, r18 2d4da: 86 1b sub r24, r22 2d4dc: 97 0b sbc r25, r23 2d4de: 06 97 sbiw r24, 0x06 ; 6 2d4e0: 6c f0 brlt .+26 ; 0x2d4fc void marlin_manage_heater() { manage_heater(); } void marlin_manage_inactivity(bool ignore_stepper_queue) { manage_inactivity(ignore_stepper_queue); 2d4e2: 81 e0 ldi r24, 0x01 ; 1 2d4e4: 0e 94 fe 79 call 0xf3fc ; 0xf3fc 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); 2d4e8: 80 e0 ldi r24, 0x00 ; 0 2d4ea: 0f 94 11 65 call 0x2ca22 ; 0x2ca22 ReportErrorHookDynamicRender(); 2d4ee: 0f 94 1e 87 call 0x30e3c ; 0x30e3c void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 2d4f2: 84 e6 ldi r24, 0x64 ; 100 2d4f4: 90 e0 ldi r25, 0x00 ; 0 2d4f6: 0e 94 45 7c call 0xf88a ; 0xf88a 2d4fa: e0 cf rjmp .-64 ; 0x2d4bc }); ScreenUpdateEnable(); // temporary hack to stop this locking the printer... 2d4fc: 0f 94 f4 86 call 0x30de8 ; 0x30de8 LogEchoEvent_P(PSTR("Hotend temperature reached")); 2d500: 87 e9 ldi r24, 0x97 ; 151 2d502: 9b e9 ldi r25, 0x9B ; 155 2d504: 0f 94 e5 87 call 0x30fca ; 0x30fca void ScreenUpdateEnable(){ lcd_update_enable(true); } void ScreenClear(){ lcd_clear(); 2d508: 0c 94 a4 69 jmp 0xd348 ; 0xd348 ScreenClear(); } } 2d50c: 08 95 ret 0002d50e : /// 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) { 2d50e: 0f 93 push r16 2d510: 1f 93 push r17 2d512: cf 93 push r28 2d514: df 93 push r29 2d516: 00 d0 rcall .+0 ; 0x2d518 2d518: 1f 92 push r1 2d51a: 1f 92 push r1 2d51c: cd b7 in r28, 0x3d ; 61 2d51e: de b7 in r29, 0x3e ; 62 2d520: 18 2f mov r17, r24 2d522: 06 2f mov r16, r22 mmu_print_saved = SavedState::None; 2d524: 10 92 95 12 sts 0x1295, r1 ; 0x801295 MARLIN_KEEPALIVE_STATE_IN_PROCESS; 2d528: 83 e0 ldi r24, 0x03 ; 3 2d52a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 LongTimer nozzleTimeout; 2d52e: 19 82 std Y+1, r1 ; 0x01 2d530: 1a 82 std Y+2, r1 ; 0x02 2d532: 1b 82 std Y+3, r1 ; 0x03 2d534: 1c 82 std Y+4, r1 ; 0x04 2d536: 1d 82 std Y+5, r1 ; 0x05 2d538: 90 e0 ldi r25, 0x00 ; 0 2d53a: 80 e0 ldi r24, 0x00 ; 0 2d53c: 0e 94 45 7c call 0xf88a ; 0xf88a // - 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) { 2d540: 90 91 95 12 lds r25, 0x1295 ; 0x801295 2d544: 89 81 ldd r24, Y+1 ; 0x01 2d546: 92 ff sbrs r25, 2 2d548: 37 c0 rjmp .+110 ; 0x2d5b8 if (!nozzleTimeout.running()) { 2d54a: 81 11 cpse r24, r1 2d54c: 1e c0 rjmp .+60 ; 0x2d58a nozzleTimeout.start(); 2d54e: ce 01 movw r24, r28 2d550: 01 96 adiw r24, 0x01 ; 1 2d552: 0f 94 29 12 call 0x22452 ; 0x22452 ::start()> LogEchoEvent_P(PSTR("Cooling Timeout started")); 2d556: 89 ea ldi r24, 0xA9 ; 169 2d558: 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")); 2d55a: 0f 94 e5 87 call 0x30fca ; 0x30fca } switch (logicStepLastStatus) { 2d55e: e0 91 93 12 lds r30, 0x1293 ; 0x801293 2d562: e2 50 subi r30, 0x02 ; 2 2d564: ea 30 cpi r30, 0x0A ; 10 2d566: 40 f7 brcc .-48 ; 0x2d538 2d568: f0 e0 ldi r31, 0x00 ; 0 2d56a: 88 27 eor r24, r24 2d56c: e5 54 subi r30, 0x45 ; 69 2d56e: f5 49 sbci r31, 0x95 ; 149 2d570: 8e 4f sbci r24, 0xFE ; 254 2d572: 0d 94 ab a1 jmp 0x34356 ; 0x34356 <__tablejump2__> 2d576: 85 37 cpi r24, 0x75 ; 117 2d578: ff 37 cpi r31, 0x7F ; 127 2d57a: e9 37 cpi r30, 0x79 ; 121 2d57c: e9 37 cpi r30, 0x79 ; 121 2d57e: 65 38 cpi r22, 0x85 ; 133 2d580: e9 37 cpi r30, 0x79 ; 121 2d582: 43 37 cpi r20, 0x73 ; 115 2d584: 71 38 cpi r23, 0x81 ; 129 2d586: 05 38 cpi r16, 0x85 ; 133 2d588: e9 37 cpi r30, 0x79 ; 121 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. 2d58a: 40 e4 ldi r20, 0x40 ; 64 2d58c: 57 e7 ldi r21, 0x77 ; 119 2d58e: 6b e1 ldi r22, 0x1B ; 27 2d590: 70 e0 ldi r23, 0x00 ; 0 2d592: ce 01 movw r24, r28 2d594: 01 96 adiw r24, 0x01 ; 1 2d596: 0f 94 6a 10 call 0x220d4 ; 0x220d4 ::expired(unsigned long)> 2d59a: 88 23 and r24, r24 2d59c: 01 f3 breq .-64 ; 0x2d55e mmu_print_saved &= ~(SavedState::CooldownPending); 2d59e: 80 91 95 12 lds r24, 0x1295 ; 0x801295 2d5a2: 8b 7f andi r24, 0xFB ; 251 mmu_print_saved |= SavedState::Cooldown; 2d5a4: 82 60 ori r24, 0x02 ; 2 2d5a6: 80 93 95 12 sts 0x1295, r24 ; 0x801295 2d5aa: 10 92 f2 11 sts 0x11F2, r1 ; 0x8011f2 2d5ae: 10 92 f1 11 sts 0x11F1, r1 ; 0x8011f1 thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); 2d5b2: 89 e9 ldi r24, 0x99 ; 153 2d5b4: 99 e9 ldi r25, 0x99 ; 153 2d5b6: d1 cf rjmp .-94 ; 0x2d55a } } else if (nozzleTimeout.running()) { 2d5b8: 88 23 and r24, r24 2d5ba: 89 f2 breq .-94 ; 0x2d55e 2d5bc: 19 82 std Y+1, r1 ; 0x01 nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 2d5be: 83 e8 ldi r24, 0x83 ; 131 2d5c0: 99 e9 ldi r25, 0x99 ; 153 2d5c2: cb cf rjmp .-106 ; 0x2d55a 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(); 2d5c4: 0f 94 25 6a call 0x2d44a ; 0x2d44a ResumeUnpark(); // We can now travel back to the tower or wherever we were when we saved. 2d5c8: 0f 94 d3 3f call 0x27fa6 ; 0x27fa6 if (!TuneMenuEntered()) { 2d5cc: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.458> 2d5d0: 81 11 cpse r24, r1 2d5d2: 07 c0 rjmp .+14 ; 0x2d5e2 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 2d5d4: 8f e6 ldi r24, 0x6F ; 111 2d5d6: 9b e9 ldi r25, 0x9B ; 155 2d5d8: 0e 94 49 72 call 0xe492 ; 0xe492 retryAttempts = MAX_RETRIES; 2d5dc: 83 e0 ldi r24, 0x03 ; 3 2d5de: 80 93 79 12 sts 0x1279, r24 ; 0x801279 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2d5e2: 0f 94 ce 22 call 0x2459c ; 0x2459c 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; 2d5e6: 81 e0 ldi r24, 0x01 ; 1 case Processing: // wait for the MMU to respond default: break; } } } 2d5e8: 0f 90 pop r0 2d5ea: 0f 90 pop r0 2d5ec: 0f 90 pop r0 2d5ee: 0f 90 pop r0 2d5f0: 0f 90 pop r0 2d5f2: df 91 pop r29 2d5f4: cf 91 pop r28 2d5f6: 1f 91 pop r17 2d5f8: 0f 91 pop r16 2d5fa: 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(); 2d5fc: 0f 94 57 64 call 0x2c8ae ; 0x2c8ae 2d600: f2 cf rjmp .-28 ; 0x2d5e6 break; case CommandError: case CommunicationTimeout: case ProtocolError: case ButtonPushed: if (!logic.InAutoRetry()) { 2d602: 80 91 7a 12 lds r24, 0x127A ; 0x80127a 2d606: 81 11 cpse r24, r1 2d608: 97 cf rjmp .-210 ; 0x2d538 // Don't proceed to the park/save if we are doing an autoretry. SaveAndPark(move_axes); 2d60a: 81 2f mov r24, r17 2d60c: 0f 94 1d 40 call 0x2803a ; 0x2803a SaveHotendTemp(turn_off_nozzle); 2d610: 80 2f mov r24, r16 2d612: 0f 94 b7 3f call 0x27f6e ; 0x27f6e CheckUserInput(); 2d616: 0f 94 57 64 call 0x2c8ae ; 0x2c8ae 2d61a: 8e cf rjmp .-228 ; 0x2d538 } 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(); 2d61c: 0f 94 25 6a call 0x2d44a ; 0x2d44a ResumeUnpark(); 2d620: 0f 94 d3 3f call 0x27fa6 ; 0x27fa6 2d624: 89 cf rjmp .-238 ; 0x2d538 } planner_synchronize(); return true; case Interrupted: // now what :D ... big bad ... ramming, unload, retry the whole command originally issued return false; 2d626: 80 e0 ldi r24, 0x00 ; 0 2d628: df cf rjmp .-66 ; 0x2d5e8 0002d62a : } // true, true); -- Comment: how is it possible for a filament type set to fail? return true; } void MMU2::UnloadInner() { 2d62a: cf 93 push r28 2d62c: df 93 push r29 2d62e: 00 d0 rcall .+0 ; 0x2d630 2d630: 1f 92 push r1 2d632: 1f 92 push r1 2d634: cd b7 in r28, 0x3d ; 61 2d636: 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; 2d638: 10 92 86 16 sts 0x1686, r1 ; 0x801686 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 2d63c: 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)); 2d640: 62 e1 ldi r22, 0x12 ; 18 2d642: 83 ef ldi r24, 0xF3 ; 243 2d644: 98 e9 ldi r25, 0x98 ; 152 2d646: 0f 94 4a 54 call 0x2a894 ; 0x2a894 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(); 2d64a: 0f 94 bf 87 call 0x30f7e ; 0x30f7e void ProtocolLogic::Statistics() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Version, 3)); } void ProtocolLogic::UnloadFilament() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Unload, 0)); 2d64e: 40 e0 ldi r20, 0x00 ; 0 2d650: 65 e5 ldi r22, 0x55 ; 85 2d652: ce 01 movw r24, r28 2d654: 01 96 adiw r24, 0x01 ; 1 2d656: 0f 94 b2 87 call 0x30f64 ; 0x30f64 2d65a: 49 81 ldd r20, Y+1 ; 0x01 2d65c: 5a 81 ldd r21, Y+2 ; 0x02 2d65e: 6b 81 ldd r22, Y+3 ; 0x03 2d660: 7c 81 ldd r23, Y+4 ; 0x04 2d662: 8d 81 ldd r24, Y+5 ; 0x05 2d664: 0f 94 f2 62 call 0x2c5e4 ; 0x2c5e4 logic.UnloadFilament(); if (manage_response(false, true)) { 2d668: 61 e0 ldi r22, 0x01 ; 1 2d66a: 80 e0 ldi r24, 0x00 ; 0 2d66c: 0f 94 87 6a call 0x2d50e ; 0x2d50e 2d670: 81 11 cpse r24, r1 2d672: 03 c0 rjmp .+6 ; 0x2d67a break; } IncrementMMUFails(); 2d674: 0f 94 16 87 call 0x30e2c ; 0x30e2c 2d678: e8 cf rjmp .-48 ; 0x2d64a 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); 2d67a: 83 e0 ldi r24, 0x03 ; 3 2d67c: 0f 94 2b 2d call 0x25a56 ; 0x25a56 } MakeSound(Confirm); // no active tool SetCurrentTool(MMU2_NO_TOOL); 2d680: 83 e6 ldi r24, 0x63 ; 99 2d682: 0f 94 6a 42 call 0x284d4 ; 0x284d4 tool_change_extruder = MMU2_NO_TOOL; 2d686: 83 e6 ldi r24, 0x63 ; 99 2d688: 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(); } 2d68c: 84 e8 ldi r24, 0x84 ; 132 2d68e: 96 e1 ldi r25, 0x16 ; 22 2d690: 0e 94 e6 6d call 0xdbcc ; 0xdbcc } 2d694: 0f 90 pop r0 2d696: 0f 90 pop r0 2d698: 0f 90 pop r0 2d69a: 0f 90 pop r0 2d69c: 0f 90 pop r0 2d69e: df 91 pop r29 2d6a0: cf 91 pop r28 2d6a2: 08 95 ret 0002d6a4 : bool MMU2::unload() { 2d6a4: cf 93 push r28 if (!WaitForMMUReady()) { 2d6a6: 0f 94 73 54 call 0x2a8e6 ; 0x2a8e6 2d6aa: c8 2f mov r28, r24 2d6ac: 88 23 and r24, r24 2d6ae: 79 f0 breq .+30 ; 0x2d6ce safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 2d6b0: 88 ec ldi r24, 0xC8 ; 200 2d6b2: 90 e0 ldi r25, 0x00 ; 0 2d6b4: 0f 94 3e 8b call 0x3167c ; 0x3167c (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.356]> 2d6b8: 82 e0 ldi r24, 0x02 ; 2 2d6ba: 0f 94 2b 2d call 0x25a56 ; 0x25a56 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 2d6be: 0f 94 3f 54 call 0x2a87e ; 0x2a87e WaitForHotendTargetTempBeep(); { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); 2d6c2: 0f 94 15 6b call 0x2d62a ; 0x2d62a explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 2d6c6: 0f 94 68 54 call 0x2a8d0 ; 0x2a8d0 { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); } ScreenUpdateEnable(); 2d6ca: 0f 94 f4 86 call 0x30de8 ; 0x30de8 return true; } 2d6ce: 8c 2f mov r24, r28 2d6d0: cf 91 pop r28 2d6d2: 08 95 ret 0002d6d4 : unload(); ScreenUpdateEnable(); return true; } bool MMU2::load_filament(uint8_t slot) { 2d6d4: 0f 93 push r16 2d6d6: 1f 93 push r17 2d6d8: cf 93 push r28 2d6da: df 93 push r29 2d6dc: 00 d0 rcall .+0 ; 0x2d6de 2d6de: 1f 92 push r1 2d6e0: 1f 92 push r1 2d6e2: cd b7 in r28, 0x3d ; 61 2d6e4: de b7 in r29, 0x3e ; 62 2d6e6: 08 2f mov r16, r24 if (!WaitForMMUReady()) { 2d6e8: 0f 94 73 54 call 0x2a8e6 ; 0x2a8e6 2d6ec: 18 2f mov r17, r24 2d6ee: 88 23 and r24, r24 2d6f0: 49 f1 breq .+82 ; 0x2d744 void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 2d6f2: 82 e0 ldi r24, 0x02 ; 2 2d6f4: 9a e5 ldi r25, 0x5A ; 90 2d6f6: 0e 94 a7 6c call 0xd94e ; 0xd94e 2d6fa: 60 2f mov r22, r16 2d6fc: 0f 94 f7 86 call 0x30dee ; 0x30dee struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 2d700: 0f 94 3f 54 call 0x2a87e ; 0x2a87e FullScreenMsgLoad(slot); { ReportingRAII rep(CommandInProgress::LoadFilament); for (;;) { Disable_E0(); 2d704: 0f 94 bf 87 call 0x30f7e ; 0x30f7e } void ProtocolLogic::LoadFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Load, slot)); 2d708: 40 2f mov r20, r16 2d70a: 6c e4 ldi r22, 0x4C ; 76 2d70c: ce 01 movw r24, r28 2d70e: 01 96 adiw r24, 0x01 ; 1 2d710: 0f 94 b2 87 call 0x30f64 ; 0x30f64 2d714: 49 81 ldd r20, Y+1 ; 0x01 2d716: 5a 81 ldd r21, Y+2 ; 0x02 2d718: 6b 81 ldd r22, Y+3 ; 0x03 2d71a: 7c 81 ldd r23, Y+4 ; 0x04 2d71c: 8d 81 ldd r24, Y+5 ; 0x05 2d71e: 0f 94 f2 62 call 0x2c5e4 ; 0x2c5e4 logic.LoadFilament(slot); if (manage_response(false, false)) { 2d722: 60 e0 ldi r22, 0x00 ; 0 2d724: 80 e0 ldi r24, 0x00 ; 0 2d726: 0f 94 87 6a call 0x2d50e ; 0x2d50e 2d72a: 18 2f mov r17, r24 2d72c: 81 11 cpse r24, r1 2d72e: 03 c0 rjmp .+6 ; 0x2d736 break; } IncrementMMUFails(); 2d730: 0f 94 16 87 call 0x30e2c ; 0x30e2c 2d734: e7 cf rjmp .-50 ; 0x2d704 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); 2d736: 83 e0 ldi r24, 0x03 ; 3 2d738: 0f 94 2b 2d call 0x25a56 ; 0x25a56 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 2d73c: 0f 94 68 54 call 0x2a8d0 ; 0x2a8d0 } IncrementMMUFails(); } MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 2d740: 0f 94 f4 86 call 0x30de8 ; 0x30de8 return true; } 2d744: 81 2f mov r24, r17 2d746: 0f 90 pop r0 2d748: 0f 90 pop r0 2d74a: 0f 90 pop r0 2d74c: 0f 90 pop r0 2d74e: 0f 90 pop r0 2d750: df 91 pop r29 2d752: cf 91 pop r28 2d754: 1f 91 pop r17 2d756: 0f 91 pop r16 2d758: 08 95 ret 0002d75a : } ScreenUpdateEnable(); return true; } bool MMU2::eject_filament(uint8_t slot, bool enableFullScreenMsg /* = true */) { 2d75a: ff 92 push r15 2d75c: 0f 93 push r16 2d75e: 1f 93 push r17 2d760: cf 93 push r28 2d762: df 93 push r29 2d764: 00 d0 rcall .+0 ; 0x2d766 2d766: 1f 92 push r1 2d768: 1f 92 push r1 2d76a: cd b7 in r28, 0x3d ; 61 2d76c: de b7 in r29, 0x3e ; 62 2d76e: 08 2f mov r16, r24 2d770: f6 2e mov r15, r22 if (!WaitForMMUReady()) { 2d772: 0f 94 73 54 call 0x2a8e6 ; 0x2a8e6 2d776: 18 2f mov r17, r24 2d778: 88 23 and r24, r24 2d77a: b1 f1 breq .+108 ; 0x2d7e8 return false; } if (enableFullScreenMsg) { 2d77c: ff 20 and r15, r15 2d77e: 39 f0 breq .+14 ; 0x2d78e void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); } void FullScreenMsgEject(uint8_t slot){ FullScreenMsg(_T(MSG_EJECT_FROM_MMU), slot); 2d780: 81 ef ldi r24, 0xF1 ; 241 2d782: 99 e5 ldi r25, 0x59 ; 89 2d784: 0e 94 a7 6c call 0xd94e ; 0xd94e 2d788: 60 2f mov r22, r16 2d78a: 0f 94 f7 86 call 0x30dee ; 0x30dee FullScreenMsgEject(slot); } { if (FindaDetectsFilament()) { 2d78e: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 2d792: 81 11 cpse r24, r1 unload(); 2d794: 0f 94 52 6b call 0x2d6a4 ; 0x2d6a4 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 2d798: 0f 94 3f 54 call 0x2a87e ; 0x2a87e unload(); } ReportingRAII rep(CommandInProgress::EjectFilament); for (;;) { Disable_E0(); 2d79c: 0f 94 bf 87 call 0x30f7e ; 0x30f7e } void ProtocolLogic::EjectFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Eject, slot)); 2d7a0: 40 2f mov r20, r16 2d7a2: 65 e4 ldi r22, 0x45 ; 69 2d7a4: ce 01 movw r24, r28 2d7a6: 01 96 adiw r24, 0x01 ; 1 2d7a8: 0f 94 b2 87 call 0x30f64 ; 0x30f64 2d7ac: 49 81 ldd r20, Y+1 ; 0x01 2d7ae: 5a 81 ldd r21, Y+2 ; 0x02 2d7b0: 6b 81 ldd r22, Y+3 ; 0x03 2d7b2: 7c 81 ldd r23, Y+4 ; 0x04 2d7b4: 8d 81 ldd r24, Y+5 ; 0x05 2d7b6: 0f 94 f2 62 call 0x2c5e4 ; 0x2c5e4 logic.EjectFilament(slot); if (manage_response(false, true)) { 2d7ba: 61 e0 ldi r22, 0x01 ; 1 2d7bc: 80 e0 ldi r24, 0x00 ; 0 2d7be: 0f 94 87 6a call 0x2d50e ; 0x2d50e 2d7c2: 18 2f mov r17, r24 2d7c4: 81 11 cpse r24, r1 2d7c6: 03 c0 rjmp .+6 ; 0x2d7ce break; } IncrementMMUFails(); 2d7c8: 0f 94 16 87 call 0x30e2c ; 0x30e2c 2d7cc: e7 cf rjmp .-50 ; 0x2d79c } SetCurrentTool(MMU2_NO_TOOL); 2d7ce: 83 e6 ldi r24, 0x63 ; 99 2d7d0: 0f 94 6a 42 call 0x284d4 ; 0x284d4 tool_change_extruder = MMU2_NO_TOOL; 2d7d4: 83 e6 ldi r24, 0x63 ; 99 2d7d6: 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); 2d7da: 83 e0 ldi r24, 0x03 ; 3 2d7dc: 0f 94 2b 2d call 0x25a56 ; 0x25a56 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 2d7e0: 0f 94 68 54 call 0x2a8d0 ; 0x2a8d0 } SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(Confirm); } ScreenUpdateEnable(); 2d7e4: 0f 94 f4 86 call 0x30de8 ; 0x30de8 return true; } 2d7e8: 81 2f mov r24, r17 2d7ea: 0f 90 pop r0 2d7ec: 0f 90 pop r0 2d7ee: 0f 90 pop r0 2d7f0: 0f 90 pop r0 2d7f2: 0f 90 pop r0 2d7f4: df 91 pop r29 2d7f6: cf 91 pop r28 2d7f8: 1f 91 pop r17 2d7fa: 0f 91 pop r16 2d7fc: ff 90 pop r15 2d7fe: 08 95 ret 0002d800 : ScreenUpdateEnable(); return true; } void MMU2::CutFilamentInner(uint8_t slot) { 2d800: 1f 93 push r17 2d802: cf 93 push r28 2d804: df 93 push r29 2d806: 00 d0 rcall .+0 ; 0x2d808 2d808: 1f 92 push r1 2d80a: 1f 92 push r1 2d80c: cd b7 in r28, 0x3d ; 61 2d80e: de b7 in r29, 0x3e ; 62 2d810: 18 2f mov r17, r24 for (;;) { Disable_E0(); 2d812: 0f 94 bf 87 call 0x30f7e ; 0x30f7e } void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); 2d816: 41 2f mov r20, r17 2d818: 6b e4 ldi r22, 0x4B ; 75 2d81a: ce 01 movw r24, r28 2d81c: 01 96 adiw r24, 0x01 ; 1 2d81e: 0f 94 b2 87 call 0x30f64 ; 0x30f64 2d822: 49 81 ldd r20, Y+1 ; 0x01 2d824: 5a 81 ldd r21, Y+2 ; 0x02 2d826: 6b 81 ldd r22, Y+3 ; 0x03 2d828: 7c 81 ldd r23, Y+4 ; 0x04 2d82a: 8d 81 ldd r24, Y+5 ; 0x05 2d82c: 0f 94 f2 62 call 0x2c5e4 ; 0x2c5e4 logic.CutFilament(slot); if (manage_response(false, true)) { 2d830: 61 e0 ldi r22, 0x01 ; 1 2d832: 80 e0 ldi r24, 0x00 ; 0 2d834: 0f 94 87 6a call 0x2d50e ; 0x2d50e 2d838: 81 11 cpse r24, r1 2d83a: 03 c0 rjmp .+6 ; 0x2d842 break; } IncrementMMUFails(); 2d83c: 0f 94 16 87 call 0x30e2c ; 0x30e2c 2d840: e8 cf rjmp .-48 ; 0x2d812 } } 2d842: 0f 90 pop r0 2d844: 0f 90 pop r0 2d846: 0f 90 pop r0 2d848: 0f 90 pop r0 2d84a: 0f 90 pop r0 2d84c: df 91 pop r29 2d84e: cf 91 pop r28 2d850: 1f 91 pop r17 2d852: 08 95 ret 0002d854 : bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { 2d854: cf 93 push r28 2d856: c8 2f mov r28, r24 lcd_print(' '); lcd_print(slot + 1); } void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); 2d858: 82 ee ldi r24, 0xE2 ; 226 2d85a: 99 e5 ldi r25, 0x59 ; 89 2d85c: 0e 94 a7 6c call 0xd94e ; 0xd94e 2d860: 6c 2f mov r22, r28 2d862: 0f 94 f7 86 call 0x30dee ; 0x30dee if (enableFullScreenMsg) { FullScreenMsgCut(slot); } { if (FindaDetectsFilament()) { 2d866: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 2d86a: 81 11 cpse r24, r1 unload(); 2d86c: 0f 94 52 6b call 0x2d6a4 ; 0x2d6a4 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 2d870: 0f 94 3f 54 call 0x2a87e ; 0x2a87e if (FindaDetectsFilament()) { unload(); } ReportingRAII rep(CommandInProgress::CutFilament); CutFilamentInner(slot); 2d874: 8c 2f mov r24, r28 2d876: 0f 94 00 6c call 0x2d800 ; 0x2d800 SetCurrentTool(MMU2_NO_TOOL); 2d87a: 83 e6 ldi r24, 0x63 ; 99 2d87c: 0f 94 6a 42 call 0x284d4 ; 0x284d4 tool_change_extruder = MMU2_NO_TOOL; 2d880: 83 e6 ldi r24, 0x63 ; 99 2d882: 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); 2d886: 83 e0 ldi r24, 0x03 ; 3 2d888: 0f 94 2b 2d call 0x25a56 ; 0x25a56 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 2d88c: 0f 94 68 54 call 0x2a8d0 ; 0x2a8d0 CutFilamentInner(slot); SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 2d890: 0f 94 f4 86 call 0x30de8 ; 0x30de8 return true; } 2d894: 81 e0 ldi r24, 0x01 ; 1 2d896: cf 91 pop r28 2d898: 08 95 ret 0002d89a : /// 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; 2d89a: 86 27 eor r24, r22 2d89c: 98 e0 ldi r25, 0x08 ; 8 for (uint8_t i = 0; i < 8; i++) { if ((data & 0x80U) != 0) { data <<= 1U; data ^= 0x07U; 2d89e: 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) { 2d8a0: 38 2f mov r19, r24 2d8a2: 88 0f add r24, r24 2d8a4: 37 fd sbrc r19, 7 data <<= 1U; data ^= 0x07U; 2d8a6: 82 27 eor r24, r18 2d8a8: 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++) { 2d8aa: d1 f7 brne .-12 ; 0x2d8a0 } else { data <<= 1U; } } return data; } 2d8ac: 08 95 ret 0002d8ae : SERIAL_ECHO(_status); SERIAL_ECHO(']'); } static void prusa_stat_farm_number() { SERIAL_ECHOPGM("[PFN:0]"); 2d8ae: 89 ef ldi r24, 0xF9 ; 249 2d8b0: 9e e9 ldi r25, 0x9E ; 158 2d8b2: 0c 94 50 70 jmp 0xe0a0 ; 0xe0a0 0002d8b6 : prusa_stat_printerstatus(statnr); prusa_stat_farm_number(); prusa_stat_printinfo(); } static void prusa_stat_printerstatus(uint8_t _status) { 2d8b6: cf 93 push r28 2d8b8: c8 2f mov r28, r24 SERIAL_ECHOPGM("[PRN:"); 2d8ba: 83 ef ldi r24, 0xF3 ; 243 2d8bc: 9e e9 ldi r25, 0x9E ; 158 2d8be: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 2d8c2: 8c 2f mov r24, r28 2d8c4: 0e 94 37 70 call 0xe06e ; 0xe06e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2d8c8: 8d e5 ldi r24, 0x5D ; 93 SERIAL_ECHO(_status); SERIAL_ECHO(']'); } 2d8ca: cf 91 pop r28 2d8cc: 0c 94 37 70 jmp 0xe06e ; 0xe06e 0002d8d0 : #ifdef PRUSA_M28 static void trace(); #endif static void prusa_statistics_err(char c) { 2d8d0: cf 93 push r28 2d8d2: c8 2f mov r28, r24 SERIAL_ECHOPGM("{[ERR:"); 2d8d4: 8c eb ldi r24, 0xBC ; 188 2d8d6: 9e e9 ldi r25, 0x9E ; 158 2d8d8: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 2d8dc: 8c 2f mov r24, r28 2d8de: 0e 94 37 70 call 0xe06e ; 0xe06e 2d8e2: 8d e5 ldi r24, 0x5D ; 93 2d8e4: 0e 94 37 70 call 0xe06e ; 0xe06e SERIAL_ECHO(c); SERIAL_ECHO(']'); prusa_stat_farm_number(); } 2d8e8: cf 91 pop r28 static void prusa_statistics_err(char c) { SERIAL_ECHOPGM("{[ERR:"); SERIAL_ECHO(c); SERIAL_ECHO(']'); prusa_stat_farm_number(); 2d8ea: 0d 94 57 6c jmp 0x2d8ae ; 0x2d8ae 0002d8ee : // 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) { 2d8ee: 2f 92 push r2 2d8f0: 3f 92 push r3 2d8f2: 4f 92 push r4 2d8f4: 5f 92 push r5 2d8f6: 6f 92 push r6 2d8f8: 7f 92 push r7 2d8fa: 8f 92 push r8 2d8fc: 9f 92 push r9 2d8fe: af 92 push r10 2d900: bf 92 push r11 2d902: cf 92 push r12 2d904: df 92 push r13 2d906: ef 92 push r14 2d908: ff 92 push r15 2d90a: 0f 93 push r16 2d90c: 1f 93 push r17 2d90e: cf 93 push r28 2d910: df 93 push r29 2d912: cd b7 in r28, 0x3d ; 61 2d914: de b7 in r29, 0x3e ; 62 2d916: a1 97 sbiw r28, 0x21 ; 33 2d918: 0f b6 in r0, 0x3f ; 63 2d91a: f8 94 cli 2d91c: de bf out 0x3e, r29 ; 62 2d91e: 0f be out 0x3f, r0 ; 63 2d920: cd bf out 0x3d, r28 ; 61 2d922: 1c 01 movw r2, r24 2d924: 48 01 movw r8, r16 2d926: 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) 2d928: fc 01 movw r30, r24 2d92a: e8 5b subi r30, 0xB8 ; 184 2d92c: ff 4f sbci r31, 0xFF ; 255 2d92e: c0 80 ld r12, Z 2d930: d1 80 ldd r13, Z+1 ; 0x01 2d932: e2 80 ldd r14, Z+2 ; 0x02 2d934: f3 80 ldd r15, Z+3 ; 0x03 2d936: 9a 01 movw r18, r20 2d938: ab 01 movw r20, r22 2d93a: c7 01 movw r24, r14 2d93c: b6 01 movw r22, r12 2d93e: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2d942: 0f 94 a1 a2 call 0x34542 ; 0x34542 2d946: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 2d94a: 8b 01 movw r16, r22 2d94c: 8d 83 std Y+5, r24 ; 0x05 2d94e: 99 83 std Y+1, r25 ; 0x01 uint32_t final_rate = ceil(exit_speed * block->speed_factor); // (step/min) 2d950: a5 01 movw r20, r10 2d952: 94 01 movw r18, r8 2d954: c7 01 movw r24, r14 2d956: b6 01 movw r22, r12 2d958: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2d95c: 0f 94 a1 a2 call 0x34542 ; 0x34542 2d960: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 2d964: 36 2f mov r19, r22 2d966: 27 2f mov r18, r23 2d968: a8 01 movw r20, r16 2d96a: 6d 81 ldd r22, Y+5 ; 0x05 2d96c: 79 81 ldd r23, Y+1 ; 0x01 2d96e: 48 37 cpi r20, 0x78 ; 120 2d970: 51 05 cpc r21, r1 2d972: 61 05 cpc r22, r1 2d974: 71 05 cpc r23, r1 2d976: 20 f4 brcc .+8 ; 0x2d980 2d978: 48 e7 ldi r20, 0x78 ; 120 2d97a: 50 e0 ldi r21, 0x00 ; 0 2d97c: 60 e0 ldi r22, 0x00 ; 0 2d97e: 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) 2d980: d1 01 movw r26, r2 2d982: d6 96 adiw r26, 0x36 ; 54 2d984: 8d 90 ld r8, X+ 2d986: 9d 90 ld r9, X+ 2d988: ad 90 ld r10, X+ 2d98a: bc 90 ld r11, X 2d98c: d9 97 sbiw r26, 0x39 ; 57 2d98e: 8f 8a std Y+23, r8 ; 0x17 2d990: 98 8e std Y+24, r9 ; 0x18 2d992: a9 8e std Y+25, r10 ; 0x19 2d994: ba 8e std Y+26, r11 ; 0x1a 2d996: 48 15 cp r20, r8 2d998: 59 05 cpc r21, r9 2d99a: 6a 05 cpc r22, r10 2d99c: 7b 05 cpc r23, r11 2d99e: 20 f4 brcc .+8 ; 0x2d9a8 2d9a0: 4f 8b std Y+23, r20 ; 0x17 2d9a2: 58 8f std Y+24, r21 ; 0x18 2d9a4: 69 8f std Y+25, r22 ; 0x19 2d9a6: 7a 8f std Y+26, r23 ; 0x1a 2d9a8: 43 2f mov r20, r19 2d9aa: 52 2f mov r21, r18 2d9ac: bc 01 movw r22, r24 2d9ae: 48 37 cpi r20, 0x78 ; 120 2d9b0: 51 05 cpc r21, r1 2d9b2: 61 05 cpc r22, r1 2d9b4: 71 05 cpc r23, r1 2d9b6: 20 f4 brcc .+8 ; 0x2d9c0 2d9b8: 48 e7 ldi r20, 0x78 ; 120 2d9ba: 50 e0 ldi r21, 0x00 ; 0 2d9bc: 60 e0 ldi r22, 0x00 ; 0 2d9be: 70 e0 ldi r23, 0x00 ; 0 2d9c0: 18 2d mov r17, r8 2d9c2: 09 2d mov r16, r9 2d9c4: a9 a2 std Y+33, r10 ; 0x21 2d9c6: b8 a2 std Y+32, r11 ; 0x20 2d9c8: 48 15 cp r20, r8 2d9ca: 59 05 cpc r21, r9 2d9cc: 6a 05 cpc r22, r10 2d9ce: 7b 05 cpc r23, r11 2d9d0: 20 f4 brcc .+8 ; 0x2d9da 2d9d2: 14 2f mov r17, r20 2d9d4: 05 2f mov r16, r21 2d9d6: 69 a3 std Y+33, r22 ; 0x21 2d9d8: 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; 2d9da: f1 01 movw r30, r2 2d9dc: ee 5b subi r30, 0xBE ; 190 2d9de: ff 4f sbci r31, 0xFF ; 255 2d9e0: c0 80 ld r12, Z 2d9e2: d1 80 ldd r13, Z+1 ; 0x01 2d9e4: e2 80 ldd r14, Z+2 ; 0x02 2d9e6: f3 80 ldd r15, Z+3 ; 0x03 2d9e8: cd 82 std Y+5, r12 ; 0x05 2d9ea: de 82 std Y+6, r13 ; 0x06 2d9ec: ef 82 std Y+7, r14 ; 0x07 2d9ee: f8 86 std Y+8, r15 ; 0x08 if (acceleration == 0) 2d9f0: cd 28 or r12, r13 2d9f2: ce 28 or r12, r14 2d9f4: cf 28 or r12, r15 2d9f6: 41 f4 brne .+16 ; 0x2da08 // Don't allow zero acceleration. acceleration = 1; 2d9f8: c1 2c mov r12, r1 2d9fa: d1 2c mov r13, r1 2d9fc: 76 01 movw r14, r12 2d9fe: c3 94 inc r12 2da00: cd 82 std Y+5, r12 ; 0x05 2da02: de 82 std Y+6, r13 ; 0x06 2da04: ef 82 std Y+7, r14 ; 0x07 2da06: 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; 2da08: 2f 89 ldd r18, Y+23 ; 0x17 2da0a: 38 8d ldd r19, Y+24 ; 0x18 2da0c: 49 8d ldd r20, Y+25 ; 0x19 2da0e: 5a 8d ldd r21, Y+26 ; 0x1a 2da10: b9 01 movw r22, r18 2da12: ca 01 movw r24, r20 2da14: 0f 94 fe a0 call 0x341fc ; 0x341fc <__mulsi3> 2da18: 6d 87 std Y+13, r22 ; 0x0d 2da1a: 7e 87 std Y+14, r23 ; 0x0e 2da1c: 8f 87 std Y+15, r24 ; 0x0f 2da1e: 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; 2da20: a5 01 movw r20, r10 2da22: 94 01 movw r18, r8 2da24: c5 01 movw r24, r10 2da26: b4 01 movw r22, r8 2da28: 0f 94 fe a0 call 0x341fc ; 0x341fc <__mulsi3> 2da2c: 2b 01 movw r4, r22 2da2e: 3c 01 movw r6, r24 uint32_t final_rate_sqr = final_rate*final_rate; 2da30: 21 2f mov r18, r17 2da32: 30 2f mov r19, r16 2da34: 49 a1 ldd r20, Y+33 ; 0x21 2da36: 58 a1 ldd r21, Y+32 ; 0x20 2da38: 61 2f mov r22, r17 2da3a: 70 2f mov r23, r16 2da3c: ca 01 movw r24, r20 2da3e: 0f 94 fe a0 call 0x341fc ; 0x341fc <__mulsi3> 2da42: 69 8b std Y+17, r22 ; 0x11 2da44: 7a 8b std Y+18, r23 ; 0x12 2da46: 8b 8b std Y+19, r24 ; 0x13 2da48: 9c 8b std Y+20, r25 ; 0x14 uint32_t acceleration_x2 = acceleration << 1; 2da4a: cd 80 ldd r12, Y+5 ; 0x05 2da4c: de 80 ldd r13, Y+6 ; 0x06 2da4e: ef 80 ldd r14, Y+7 ; 0x07 2da50: f8 84 ldd r15, Y+8 ; 0x08 2da52: cc 0c add r12, r12 2da54: dd 1c adc r13, r13 2da56: ee 1c adc r14, r14 2da58: ff 1c adc r15, r15 2da5a: c9 86 std Y+9, r12 ; 0x09 2da5c: da 86 std Y+10, r13 ; 0x0a 2da5e: eb 86 std Y+11, r14 ; 0x0b 2da60: 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; 2da62: c3 01 movw r24, r6 2da64: b2 01 movw r22, r4 2da66: 61 50 subi r22, 0x01 ; 1 2da68: 71 09 sbc r23, r1 2da6a: 81 09 sbc r24, r1 2da6c: 91 09 sbc r25, r1 2da6e: cd 84 ldd r12, Y+13 ; 0x0d 2da70: de 84 ldd r13, Y+14 ; 0x0e 2da72: ef 84 ldd r14, Y+15 ; 0x0f 2da74: f8 88 ldd r15, Y+16 ; 0x10 2da76: 6c 19 sub r22, r12 2da78: 7d 09 sbc r23, r13 2da7a: 8e 09 sbc r24, r14 2da7c: 9f 09 sbc r25, r15 2da7e: c9 84 ldd r12, Y+9 ; 0x09 2da80: da 84 ldd r13, Y+10 ; 0x0a 2da82: eb 84 ldd r14, Y+11 ; 0x0b 2da84: fc 84 ldd r15, Y+12 ; 0x0c 2da86: 6c 0d add r22, r12 2da88: 7d 1d adc r23, r13 2da8a: 8e 1d adc r24, r14 2da8c: 9f 1d adc r25, r15 2da8e: a7 01 movw r20, r14 2da90: 96 01 movw r18, r12 2da92: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> 2da96: 69 01 movw r12, r18 2da98: 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; 2da9a: c3 01 movw r24, r6 2da9c: b2 01 movw r22, r4 2da9e: 29 89 ldd r18, Y+17 ; 0x11 2daa0: 3a 89 ldd r19, Y+18 ; 0x12 2daa2: 4b 89 ldd r20, Y+19 ; 0x13 2daa4: 5c 89 ldd r21, Y+20 ; 0x14 2daa6: 62 1b sub r22, r18 2daa8: 73 0b sbc r23, r19 2daaa: 84 0b sbc r24, r20 2daac: 95 0b sbc r25, r21 2daae: 29 85 ldd r18, Y+9 ; 0x09 2dab0: 3a 85 ldd r19, Y+10 ; 0x0a 2dab2: 4b 85 ldd r20, Y+11 ; 0x0b 2dab4: 5c 85 ldd r21, Y+12 ; 0x0c 2dab6: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> 2daba: 29 01 movw r4, r18 2dabc: 3a 01 movw r6, r20 uint32_t accel_decel_steps = accelerate_steps + decelerate_steps; 2dabe: d7 01 movw r26, r14 2dac0: c6 01 movw r24, r12 2dac2: 84 0d add r24, r4 2dac4: 95 1d adc r25, r5 2dac6: a6 1d adc r26, r6 2dac8: b7 1d adc r27, r7 2daca: 8c 8f std Y+28, r24 ; 0x1c 2dacc: 9d 8f std Y+29, r25 ; 0x1d 2dace: ae 8f std Y+30, r26 ; 0x1e 2dad0: 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) { 2dad2: f1 01 movw r30, r2 2dad4: e4 5b subi r30, 0xB4 ; 180 2dad6: ff 4f sbci r31, 0xFF ; 255 2dad8: 90 81 ld r25, Z 2dada: 9b 8f std Y+27, r25 ; 0x1b 2dadc: 99 23 and r25, r25 2dade: 09 f4 brne .+2 ; 0x2dae2 2dae0: 8d c0 rjmp .+282 ; 0x2dbfc final_adv_steps = final_rate * block->adv_comp; 2dae2: 61 2f mov r22, r17 2dae4: 70 2f mov r23, r16 2dae6: 89 a1 ldd r24, Y+33 ; 0x21 2dae8: 98 a1 ldd r25, Y+32 ; 0x20 2daea: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 2daee: f1 01 movw r30, r2 2daf0: ec 5a subi r30, 0xAC ; 172 2daf2: ff 4f sbci r31, 0xFF ; 255 2daf4: 20 81 ld r18, Z 2daf6: 31 81 ldd r19, Z+1 ; 0x01 2daf8: 42 81 ldd r20, Z+2 ; 0x02 2dafa: 53 81 ldd r21, Z+3 ; 0x03 2dafc: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2db00: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 2db04: 6d 8b std Y+21, r22 ; 0x15 2db06: 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) { 2db08: d1 01 movw r26, r2 2db0a: 50 96 adiw r26, 0x10 ; 16 2db0c: 2d 91 ld r18, X+ 2db0e: 3d 91 ld r19, X+ 2db10: 4d 91 ld r20, X+ 2db12: 5c 91 ld r21, X 2db14: 53 97 sbiw r26, 0x13 ; 19 2db16: 29 83 std Y+1, r18 ; 0x01 2db18: 3a 83 std Y+2, r19 ; 0x02 2db1a: 4b 83 std Y+3, r20 ; 0x03 2db1c: 5c 83 std Y+4, r21 ; 0x04 2db1e: 8c 8d ldd r24, Y+28 ; 0x1c 2db20: 9d 8d ldd r25, Y+29 ; 0x1d 2db22: ae 8d ldd r26, Y+30 ; 0x1e 2db24: bf 8d ldd r27, Y+31 ; 0x1f 2db26: 82 17 cp r24, r18 2db28: 93 07 cpc r25, r19 2db2a: a4 07 cpc r26, r20 2db2c: b5 07 cpc r27, r21 2db2e: 08 f0 brcs .+2 ; 0x2db32 2db30: 68 c0 rjmp .+208 ; 0x2dc02 plateau_steps = block->step_event_count.wide - accel_decel_steps; 2db32: 29 01 movw r4, r18 2db34: 3a 01 movw r6, r20 2db36: 48 1a sub r4, r24 2db38: 59 0a sbc r5, r25 2db3a: 6a 0a sbc r6, r26 2db3c: 7b 0a sbc r7, r27 #ifdef LIN_ADVANCE if (block->use_advance_lead) 2db3e: 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; 2db40: 40 e0 ldi r20, 0x00 ; 0 2db42: 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) 2db44: 99 23 and r25, r25 2db46: 89 f0 breq .+34 ; 0x2db6a max_adv_steps = block->nominal_rate * block->adv_comp; 2db48: c5 01 movw r24, r10 2db4a: b4 01 movw r22, r8 2db4c: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 2db50: f1 01 movw r30, r2 2db52: ec 5a subi r30, 0xAC ; 172 2db54: ff 4f sbci r31, 0xFF ; 255 2db56: 20 81 ld r18, Z 2db58: 31 81 ldd r19, Z+1 ; 0x01 2db5a: 42 81 ldd r20, Z+2 ; 0x02 2db5c: 53 81 ldd r21, Z+3 ; 0x03 2db5e: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2db62: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 2db66: 46 2f mov r20, r22 2db68: 87 2f mov r24, r23 } } #endif } CRITICAL_SECTION_START; // Fill variables used by the stepper in a critical section 2db6a: 3f b7 in r19, 0x3f ; 63 2db6c: 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. 2db6e: f1 01 movw r30, r2 2db70: e9 5b subi r30, 0xB9 ; 185 2db72: ff 4f sbci r31, 0xFF ; 255 2db74: 20 81 ld r18, Z 2db76: 21 11 cpse r18, r1 2db78: 27 c0 rjmp .+78 ; 0x2dbc8 block->accelerate_until = accelerate_steps; 2db7a: d1 01 movw r26, r2 2db7c: 59 96 adiw r26, 0x19 ; 25 2db7e: cd 92 st X+, r12 2db80: dd 92 st X+, r13 2db82: ed 92 st X+, r14 2db84: fc 92 st X, r15 2db86: 5c 97 sbiw r26, 0x1c ; 28 block->decelerate_after = accelerate_steps+plateau_steps; 2db88: c4 0c add r12, r4 2db8a: d5 1c adc r13, r5 2db8c: e6 1c adc r14, r6 2db8e: f7 1c adc r15, r7 2db90: f1 01 movw r30, r2 2db92: c5 8e std Z+29, r12 ; 0x1d 2db94: d6 8e std Z+30, r13 ; 0x1e 2db96: e7 8e std Z+31, r14 ; 0x1f 2db98: f0 a2 std Z+32, r15 ; 0x20 block->initial_rate = initial_rate; 2db9a: cf 88 ldd r12, Y+23 ; 0x17 2db9c: c2 ae std Z+58, r12 ; 0x3a 2db9e: d8 8c ldd r13, Y+24 ; 0x18 2dba0: d3 ae std Z+59, r13 ; 0x3b 2dba2: e9 8c ldd r14, Y+25 ; 0x19 2dba4: e4 ae std Z+60, r14 ; 0x3c 2dba6: fa 8c ldd r15, Y+26 ; 0x1a 2dba8: f5 ae std Z+61, r15 ; 0x3d block->final_rate = final_rate; 2dbaa: fe 96 adiw r30, 0x3e ; 62 2dbac: 10 83 st Z, r17 2dbae: 01 83 std Z+1, r16 ; 0x01 2dbb0: c9 a0 ldd r12, Y+33 ; 0x21 2dbb2: c2 82 std Z+2, r12 ; 0x02 2dbb4: d8 a0 ldd r13, Y+32 ; 0x20 2dbb6: d3 82 std Z+3, r13 ; 0x03 #ifdef LIN_ADVANCE block->final_adv_steps = final_adv_steps; 2dbb8: 73 96 adiw r30, 0x13 ; 19 2dbba: ed 88 ldd r14, Y+21 ; 0x15 2dbbc: e0 82 st Z, r14 2dbbe: fe 88 ldd r15, Y+22 ; 0x16 2dbc0: f1 82 std Z+1, r15 ; 0x01 block->max_adv_steps = max_adv_steps; 2dbc2: 32 97 sbiw r30, 0x02 ; 2 2dbc4: 40 83 st Z, r20 2dbc6: 81 83 std Z+1, r24 ; 0x01 #endif } CRITICAL_SECTION_END; 2dbc8: 3f bf out 0x3f, r19 ; 63 } 2dbca: a1 96 adiw r28, 0x21 ; 33 2dbcc: 0f b6 in r0, 0x3f ; 63 2dbce: f8 94 cli 2dbd0: de bf out 0x3e, r29 ; 62 2dbd2: 0f be out 0x3f, r0 ; 63 2dbd4: cd bf out 0x3d, r28 ; 61 2dbd6: df 91 pop r29 2dbd8: cf 91 pop r28 2dbda: 1f 91 pop r17 2dbdc: 0f 91 pop r16 2dbde: ff 90 pop r15 2dbe0: ef 90 pop r14 2dbe2: df 90 pop r13 2dbe4: cf 90 pop r12 2dbe6: bf 90 pop r11 2dbe8: af 90 pop r10 2dbea: 9f 90 pop r9 2dbec: 8f 90 pop r8 2dbee: 7f 90 pop r7 2dbf0: 6f 90 pop r6 2dbf2: 5f 90 pop r5 2dbf4: 4f 90 pop r4 2dbf6: 3f 90 pop r3 2dbf8: 2f 90 pop r2 2dbfa: 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; 2dbfc: 1d 8a std Y+21, r1 ; 0x15 2dbfe: 1e 8a std Y+22, r1 ; 0x16 2dc00: 83 cf rjmp .-250 ; 0x2db08 #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; 2dc02: 2d 81 ldd r18, Y+5 ; 0x05 2dc04: 3e 81 ldd r19, Y+6 ; 0x06 2dc06: 4f 81 ldd r20, Y+7 ; 0x07 2dc08: 58 85 ldd r21, Y+8 ; 0x08 2dc0a: 82 e0 ldi r24, 0x02 ; 2 2dc0c: 22 0f add r18, r18 2dc0e: 33 1f adc r19, r19 2dc10: 44 1f adc r20, r20 2dc12: 55 1f adc r21, r21 2dc14: 8a 95 dec r24 2dc16: d1 f7 brne .-12 ; 0x2dc0c 2dc18: 89 81 ldd r24, Y+1 ; 0x01 2dc1a: 9a 81 ldd r25, Y+2 ; 0x02 2dc1c: ab 81 ldd r26, Y+3 ; 0x03 2dc1e: bc 81 ldd r27, Y+4 ; 0x04 2dc20: 81 70 andi r24, 0x01 ; 1 2dc22: 99 27 eor r25, r25 2dc24: aa 27 eor r26, r26 2dc26: bb 27 eor r27, r27 2dc28: 8d 83 std Y+5, r24 ; 0x05 2dc2a: 9e 83 std Y+6, r25 ; 0x06 2dc2c: af 83 std Y+7, r26 ; 0x07 2dc2e: b8 87 std Y+8, r27 ; 0x08 2dc30: 89 80 ldd r8, Y+1 ; 0x01 2dc32: 9a 80 ldd r9, Y+2 ; 0x02 2dc34: ab 80 ldd r10, Y+3 ; 0x03 2dc36: bc 80 ldd r11, Y+4 ; 0x04 2dc38: b6 94 lsr r11 2dc3a: a7 94 ror r10 2dc3c: 97 94 ror r9 2dc3e: 87 94 ror r8 // Avoid negative numbers if (final_rate_sqr >= initial_rate_sqr) { 2dc40: cd 84 ldd r12, Y+13 ; 0x0d 2dc42: de 84 ldd r13, Y+14 ; 0x0e 2dc44: ef 84 ldd r14, Y+15 ; 0x0f 2dc46: f8 88 ldd r15, Y+16 ; 0x10 2dc48: 89 89 ldd r24, Y+17 ; 0x11 2dc4a: 9a 89 ldd r25, Y+18 ; 0x12 2dc4c: ab 89 ldd r26, Y+19 ; 0x13 2dc4e: bc 89 ldd r27, Y+20 ; 0x14 2dc50: 8c 15 cp r24, r12 2dc52: 9d 05 cpc r25, r13 2dc54: ae 05 cpc r26, r14 2dc56: bf 05 cpc r27, r15 2dc58: 08 f4 brcc .+2 ; 0x2dc5c 2dc5a: 6f c0 rjmp .+222 ; 0x2dd3a // 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; 2dc5c: 6c 01 movw r12, r24 2dc5e: 7d 01 movw r14, r26 2dc60: 91 e0 ldi r25, 0x01 ; 1 2dc62: c9 1a sub r12, r25 2dc64: d1 08 sbc r13, r1 2dc66: e1 08 sbc r14, r1 2dc68: f1 08 sbc r15, r1 2dc6a: 8d 85 ldd r24, Y+13 ; 0x0d 2dc6c: 9e 85 ldd r25, Y+14 ; 0x0e 2dc6e: af 85 ldd r26, Y+15 ; 0x0f 2dc70: b8 89 ldd r27, Y+16 ; 0x10 2dc72: c8 1a sub r12, r24 2dc74: d9 0a sbc r13, r25 2dc76: ea 0a sbc r14, r26 2dc78: fb 0a sbc r15, r27 2dc7a: c7 01 movw r24, r14 2dc7c: b6 01 movw r22, r12 2dc7e: 62 0f add r22, r18 2dc80: 73 1f adc r23, r19 2dc82: 84 1f adc r24, r20 2dc84: 95 1f adc r25, r21 if (block->step_event_count.wide & 1) 2dc86: cd 80 ldd r12, Y+5 ; 0x05 2dc88: de 80 ldd r13, Y+6 ; 0x06 2dc8a: ef 80 ldd r14, Y+7 ; 0x07 2dc8c: f8 84 ldd r15, Y+8 ; 0x08 2dc8e: cd 28 or r12, r13 2dc90: ce 28 or r12, r14 2dc92: cf 28 or r12, r15 2dc94: 41 f0 breq .+16 ; 0x2dca6 accelerate_steps += acceleration_x2; 2dc96: c9 84 ldd r12, Y+9 ; 0x09 2dc98: da 84 ldd r13, Y+10 ; 0x0a 2dc9a: eb 84 ldd r14, Y+11 ; 0x0b 2dc9c: fc 84 ldd r15, Y+12 ; 0x0c 2dc9e: 6c 0d add r22, r12 2dca0: 7d 1d adc r23, r13 2dca2: 8e 1d adc r24, r14 2dca4: 9f 1d adc r25, r15 accelerate_steps /= acceleration_x4; 2dca6: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> 2dcaa: 75 01 movw r14, r10 2dcac: 64 01 movw r12, r8 2dcae: c2 0e add r12, r18 2dcb0: d3 1e adc r13, r19 2dcb2: e4 1e adc r14, r20 2dcb4: f5 1e adc r15, r21 2dcb6: 29 81 ldd r18, Y+1 ; 0x01 2dcb8: 3a 81 ldd r19, Y+2 ; 0x02 2dcba: 4b 81 ldd r20, Y+3 ; 0x03 2dcbc: 5c 81 ldd r21, Y+4 ; 0x04 2dcbe: 2c 15 cp r18, r12 2dcc0: 3d 05 cpc r19, r13 2dcc2: 4e 05 cpc r20, r14 2dcc4: 5f 05 cpc r21, r15 2dcc6: 10 f4 brcc .+4 ; 0x2dccc 2dcc8: 69 01 movw r12, r18 2dcca: 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) { 2dccc: 2b 8d ldd r18, Y+27 ; 0x1b 2dcce: 22 23 and r18, r18 2dcd0: 09 f4 brne .+2 ; 0x2dcd4 2dcd2: 69 c0 rjmp .+210 ; 0x2dda6 if(!accelerate_steps || !decelerate_steps) { 2dcd4: c1 14 cp r12, r1 2dcd6: d1 04 cpc r13, r1 2dcd8: e1 04 cpc r14, r1 2dcda: f1 04 cpc r15, r1 2dcdc: 09 f4 brne .+2 ; 0x2dce0 2dcde: 66 c0 rjmp .+204 ; 0x2ddac // 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; 2dce0: 4d 89 ldd r20, Y+21 ; 0x15 2dce2: 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) { 2dce4: 41 14 cp r4, r1 2dce6: 51 04 cpc r5, r1 2dce8: 61 04 cpc r6, r1 2dcea: 71 04 cpc r7, r1 2dcec: 09 f4 brne .+2 ; 0x2dcf0 2dcee: 3d cf rjmp .-390 ; 0x2db6a // 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); 2dcf0: a7 01 movw r20, r14 2dcf2: 96 01 movw r18, r12 2dcf4: 69 85 ldd r22, Y+9 ; 0x09 2dcf6: 7a 85 ldd r23, Y+10 ; 0x0a 2dcf8: 8b 85 ldd r24, Y+11 ; 0x0b 2dcfa: 9c 85 ldd r25, Y+12 ; 0x0c 2dcfc: 0f 94 fe a0 call 0x341fc ; 0x341fc <__mulsi3> 2dd00: 2d 85 ldd r18, Y+13 ; 0x0d 2dd02: 3e 85 ldd r19, Y+14 ; 0x0e 2dd04: 4f 85 ldd r20, Y+15 ; 0x0f 2dd06: 58 89 ldd r21, Y+16 ; 0x10 2dd08: 62 0f add r22, r18 2dd0a: 73 1f adc r23, r19 2dd0c: 84 1f adc r24, r20 2dd0e: 95 1f adc r25, r21 2dd10: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 2dd14: 0f 94 91 a5 call 0x34b22 ; 0x34b22 max_adv_steps = max_rate * block->adv_comp; 2dd18: f1 01 movw r30, r2 2dd1a: ec 5a subi r30, 0xAC ; 172 2dd1c: ff 4f sbci r31, 0xFF ; 255 2dd1e: 20 81 ld r18, Z 2dd20: 31 81 ldd r19, Z+1 ; 0x01 2dd22: 42 81 ldd r20, Z+2 ; 0x02 2dd24: 53 81 ldd r21, Z+3 ; 0x03 2dd26: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2dd2a: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 2dd2e: 46 2f mov r20, r22 2dd30: 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; 2dd32: 41 2c mov r4, r1 2dd34: 51 2c mov r5, r1 2dd36: 32 01 movw r6, r4 2dd38: 18 cf rjmp .-464 ; 0x2db6a 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; 2dd3a: 6d 85 ldd r22, Y+13 ; 0x0d 2dd3c: 7e 85 ldd r23, Y+14 ; 0x0e 2dd3e: 8f 85 ldd r24, Y+15 ; 0x0f 2dd40: 98 89 ldd r25, Y+16 ; 0x10 2dd42: c9 88 ldd r12, Y+17 ; 0x11 2dd44: da 88 ldd r13, Y+18 ; 0x12 2dd46: eb 88 ldd r14, Y+19 ; 0x13 2dd48: fc 88 ldd r15, Y+20 ; 0x14 2dd4a: 6c 19 sub r22, r12 2dd4c: 7d 09 sbc r23, r13 2dd4e: 8e 09 sbc r24, r14 2dd50: 9f 09 sbc r25, r15 if (block->step_event_count.wide & 1) 2dd52: cd 80 ldd r12, Y+5 ; 0x05 2dd54: de 80 ldd r13, Y+6 ; 0x06 2dd56: ef 80 ldd r14, Y+7 ; 0x07 2dd58: f8 84 ldd r15, Y+8 ; 0x08 2dd5a: cd 28 or r12, r13 2dd5c: ce 28 or r12, r14 2dd5e: cf 28 or r12, r15 2dd60: 41 f0 breq .+16 ; 0x2dd72 decelerate_steps += acceleration_x2; 2dd62: c9 84 ldd r12, Y+9 ; 0x09 2dd64: da 84 ldd r13, Y+10 ; 0x0a 2dd66: eb 84 ldd r14, Y+11 ; 0x0b 2dd68: fc 84 ldd r15, Y+12 ; 0x0c 2dd6a: 6c 0d add r22, r12 2dd6c: 7d 1d adc r23, r13 2dd6e: 8e 1d adc r24, r14 2dd70: 9f 1d adc r25, r15 decelerate_steps /= acceleration_x4; 2dd72: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> decelerate_steps += (block->step_event_count.wide >> 1); 2dd76: 82 0e add r8, r18 2dd78: 93 1e adc r9, r19 2dd7a: a4 1e adc r10, r20 2dd7c: b5 1e adc r11, r21 2dd7e: 49 80 ldd r4, Y+1 ; 0x01 2dd80: 5a 80 ldd r5, Y+2 ; 0x02 2dd82: 6b 80 ldd r6, Y+3 ; 0x03 2dd84: 7c 80 ldd r7, Y+4 ; 0x04 2dd86: 84 14 cp r8, r4 2dd88: 95 04 cpc r9, r5 2dd8a: a6 04 cpc r10, r6 2dd8c: b7 04 cpc r11, r7 2dd8e: 10 f4 brcc .+4 ; 0x2dd94 2dd90: 24 01 movw r4, r8 2dd92: 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; 2dd94: c9 80 ldd r12, Y+1 ; 0x01 2dd96: da 80 ldd r13, Y+2 ; 0x02 2dd98: eb 80 ldd r14, Y+3 ; 0x03 2dd9a: fc 80 ldd r15, Y+4 ; 0x04 2dd9c: c4 18 sub r12, r4 2dd9e: d5 08 sbc r13, r5 2dda0: e6 08 sbc r14, r6 2dda2: f7 08 sbc r15, r7 2dda4: 93 cf rjmp .-218 ; 0x2dccc // 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; 2dda6: 40 e0 ldi r20, 0x00 ; 0 2dda8: 80 e0 ldi r24, 0x00 ; 0 2ddaa: c3 cf rjmp .-122 ; 0x2dd32 #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; 2ddac: 4d 89 ldd r20, Y+21 ; 0x15 2ddae: 8e 89 ldd r24, Y+22 ; 0x16 2ddb0: c0 cf rjmp .-128 ; 0x2dd32 0002ddb2 : /// @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) { 2ddb2: 0f 93 push r16 2ddb4: 1f 93 push r17 2ddb6: cf 93 push r28 2ddb8: df 93 push r29 2ddba: eb 01 movw r28, r22 2ddbc: 14 2f mov r17, r20 2ddbe: 05 2f mov r16, r21 lcd_putc(chr); 2ddc0: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 lcd_puts_P(str); 2ddc4: ce 01 movw r24, r28 2ddc6: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 lcd_putc(':'); 2ddca: 8a e3 ldi r24, 0x3A ; 58 2ddcc: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 2ddd0: ce 01 movw r24, r28 2ddd2: 0f 94 59 9e call 0x33cb2 ; 0x33cb2 <__strlen_P> // Padding to compensate variable string length const uint8_t len = strlen_P(str); lcd_space((LCD_WIDTH - 4) - (2 + len)); 2ddd6: 9e e0 ldi r25, 0x0E ; 14 2ddd8: 98 1b sub r25, r24 2ddda: 89 2f mov r24, r25 2dddc: 0e 94 67 69 call 0xd2ce ; 0xd2ce // Right adjusted value lcd_printf_P(PSTR("%4d"), val); 2dde0: 0f 93 push r16 2dde2: 1f 93 push r17 2dde4: 8e e7 ldi r24, 0x7E ; 126 2dde6: 9d e9 ldi r25, 0x9D ; 157 2dde8: 9f 93 push r25 2ddea: 8f 93 push r24 2ddec: 0e 94 4a 69 call 0xd294 ; 0xd294 2ddf0: 0f 90 pop r0 2ddf2: 0f 90 pop r0 2ddf4: 0f 90 pop r0 2ddf6: 0f 90 pop r0 } 2ddf8: df 91 pop r29 2ddfa: cf 91 pop r28 2ddfc: 1f 91 pop r17 2ddfe: 0f 91 pop r16 2de00: 08 95 ret 0002de02 : * \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) { 2de02: 0f 93 push r16 2de04: 1f 93 push r17 2de06: cf 93 push r28 2de08: df 93 push r29 // error if file is already open if (isOpen()) goto fail; 2de0a: fc 01 movw r30, r24 2de0c: 23 81 ldd r18, Z+3 ; 0x03 2de0e: 22 23 and r18, r18 2de10: 31 f0 breq .+12 ; 0x2de1e dirBlock_ = 0; dirIndex_ = 0; return true; fail: return false; 2de12: 80 e0 ldi r24, 0x00 ; 0 } 2de14: df 91 pop r29 2de16: cf 91 pop r28 2de18: 1f 91 pop r17 2de1a: 0f 91 pop r16 2de1c: 08 95 ret 2de1e: 8b 01 movw r16, r22 2de20: ec 01 movw r28, r24 2de22: fb 01 movw r30, r22 2de24: 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)) { 2de26: 80 31 cpi r24, 0x10 ; 16 2de28: 39 f5 brne .+78 ; 0x2de78 type_ = FAT_FILE_TYPE_ROOT_FIXED; 2de2a: 82 e0 ldi r24, 0x02 ; 2 2de2c: 8b 83 std Y+3, r24 ; 0x03 firstCluster_ = 0; 2de2e: 1d 8a std Y+21, r1 ; 0x15 2de30: 1e 8a std Y+22, r1 ; 0x16 2de32: 1f 8a std Y+23, r1 ; 0x17 2de34: 18 8e std Y+24, r1 ; 0x18 fileSize_ = 32 * vol->rootDirEntryCount(); 2de36: 80 8d ldd r24, Z+24 ; 0x18 2de38: 91 8d ldd r25, Z+25 ; 0x19 2de3a: b0 e0 ldi r27, 0x00 ; 0 2de3c: a0 e0 ldi r26, 0x00 ; 0 2de3e: 25 e0 ldi r18, 0x05 ; 5 2de40: 88 0f add r24, r24 2de42: 99 1f adc r25, r25 2de44: aa 1f adc r26, r26 2de46: bb 1f adc r27, r27 2de48: 2a 95 dec r18 2de4a: d1 f7 brne .-12 ; 0x2de40 2de4c: 89 8b std Y+17, r24 ; 0x11 2de4e: 9a 8b std Y+18, r25 ; 0x12 2de50: ab 8b std Y+19, r26 ; 0x13 2de52: 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; 2de54: 1a 8f std Y+26, r17 ; 0x1a 2de56: 09 8f std Y+25, r16 ; 0x19 // read only flags_ = O_READ; 2de58: 81 e0 ldi r24, 0x01 ; 1 2de5a: 89 83 std Y+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 2de5c: 1c 82 std Y+4, r1 ; 0x04 2de5e: 1d 82 std Y+5, r1 ; 0x05 2de60: 1e 82 std Y+6, r1 ; 0x06 2de62: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 2de64: 18 86 std Y+8, r1 ; 0x08 2de66: 19 86 std Y+9, r1 ; 0x09 2de68: 1a 86 std Y+10, r1 ; 0x0a 2de6a: 1b 86 std Y+11, r1 ; 0x0b // root has no directory entry dirBlock_ = 0; 2de6c: 1c 86 std Y+12, r1 ; 0x0c 2de6e: 1d 86 std Y+13, r1 ; 0x0d 2de70: 1e 86 std Y+14, r1 ; 0x0e 2de72: 1f 86 std Y+15, r1 ; 0x0f dirIndex_ = 0; 2de74: 18 8a std Y+16, r1 ; 0x10 2de76: ce cf rjmp .-100 ; 0x2de14 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) { 2de78: 80 32 cpi r24, 0x20 ; 32 2de7a: 59 f6 brne .-106 ; 0x2de12 type_ = FAT_FILE_TYPE_ROOT32; 2de7c: 83 e0 ldi r24, 0x03 ; 3 2de7e: 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_;} 2de80: 42 8d ldd r20, Z+26 ; 0x1a 2de82: 53 8d ldd r21, Z+27 ; 0x1b 2de84: 64 8d ldd r22, Z+28 ; 0x1c 2de86: 75 8d ldd r23, Z+29 ; 0x1d firstCluster_ = vol->rootDirStart(); 2de88: 4d 8b std Y+21, r20 ; 0x15 2de8a: 5e 8b std Y+22, r21 ; 0x16 2de8c: 6f 8b std Y+23, r22 ; 0x17 2de8e: 78 8f std Y+24, r23 ; 0x18 if (!vol->chainSize(firstCluster_, &fileSize_)) goto fail; 2de90: 9e 01 movw r18, r28 2de92: 2f 5e subi r18, 0xEF ; 239 2de94: 3f 4f sbci r19, 0xFF ; 255 2de96: c8 01 movw r24, r16 2de98: 0f 94 77 38 call 0x270ee ; 0x270ee 2de9c: 81 11 cpse r24, r1 2de9e: da cf rjmp .-76 ; 0x2de54 2dea0: b8 cf rjmp .-144 ; 0x2de12 0002dea2 : * * \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() { 2dea2: cf 93 push r28 2dea4: df 93 push r29 2dea6: ec 01 movw r28, r24 bool rtn = sync(); 2dea8: 0f 94 c2 39 call 0x27384 ; 0x27384 type_ = FAT_FILE_TYPE_CLOSED; 2deac: 1b 82 std Y+3, r1 ; 0x03 return rtn; } 2deae: df 91 pop r29 2deb0: cf 91 pop r28 2deb2: 08 95 ret 0002deb4 : return false; } //------------------------------------------------------------------------------ // cache a file's directory entry // return pointer to cached entry or null for failure dir_t* SdBaseFile::cacheDirEntry(uint8_t action) { 2deb4: cf 93 push r28 2deb6: df 93 push r29 2deb8: ec 01 movw r28, r24 if (!vol_->cacheRawBlock(dirBlock_, action)) goto fail; 2deba: 46 2f mov r20, r22 2debc: 41 70 andi r20, 0x01 ; 1 2debe: 6c 85 ldd r22, Y+12 ; 0x0c 2dec0: 7d 85 ldd r23, Y+13 ; 0x0d 2dec2: 8e 85 ldd r24, Y+14 ; 0x0e 2dec4: 9f 85 ldd r25, Y+15 ; 0x0f 2dec6: 0f 94 25 37 call 0x26e4a ; 0x26e4a 2deca: 88 23 and r24, r24 2decc: 51 f0 breq .+20 ; 0x2dee2 return vol_->cache()->dir + dirIndex_; 2dece: 88 89 ldd r24, Y+16 ; 0x10 2ded0: 20 e2 ldi r18, 0x20 ; 32 2ded2: 82 9f mul r24, r18 2ded4: c0 01 movw r24, r0 2ded6: 11 24 eor r1, r1 2ded8: 87 52 subi r24, 0x27 ; 39 2deda: 92 4f sbci r25, 0xF2 ; 242 fail: return 0; } 2dedc: df 91 pop r29 2dede: cf 91 pop r28 2dee0: 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; 2dee2: 90 e0 ldi r25, 0x00 ; 0 2dee4: 80 e0 ldi r24, 0x00 ; 0 2dee6: fa cf rjmp .-12 ; 0x2dedc 0002dee8 : * \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) { 2dee8: cf 93 push r28 2deea: df 93 push r29 2deec: eb 01 movw r28, r22 2deee: fc 01 movw r30, r24 2def0: 23 81 ldd r18, Z+3 ; 0x03 if (!isOpen()) return false; 2def2: 21 11 cpse r18, r1 2def4: 04 c0 rjmp .+8 ; 0x2defe 2def6: 80 e0 ldi r24, 0x00 ; 0 if (!p) return false; // format name dirName(*p, name); return true; } 2def8: df 91 pop r29 2defa: cf 91 pop r28 2defc: 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; 2defe: 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()) { 2df00: 22 30 cpi r18, 0x02 ; 2 2df02: 28 f4 brcc .+10 ; 0x2df0e name[0] = '/'; 2df04: 8f e2 ldi r24, 0x2F ; 47 2df06: 88 83 st Y, r24 name[1] = '\0'; 2df08: 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; 2df0a: 81 e0 ldi r24, 0x01 ; 1 2df0c: f5 cf rjmp .-22 ; 0x2def8 name[0] = '/'; name[1] = '\0'; return true; } // cache entry dir_t* p = cacheDirEntry(SdVolume::CACHE_FOR_READ); 2df0e: 60 e0 ldi r22, 0x00 ; 0 2df10: 0f 94 5a 6f call 0x2deb4 ; 0x2deb4 if (!p) return false; 2df14: 00 97 sbiw r24, 0x00 ; 0 2df16: 79 f3 breq .-34 ; 0x2def6 2df18: 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; 2df1a: 60 e0 ldi r22, 0x00 ; 0 for (uint8_t i = 0; i < 11; i++) { 2df1c: 80 e0 ldi r24, 0x00 ; 0 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; 2df1e: 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; 2df20: 2d 91 ld r18, X+ 2df22: 20 32 cpi r18, 0x20 ; 32 2df24: 99 f0 breq .+38 ; 0x2df4c if (i == 8) name[j++] = '.'; 2df26: 88 30 cpi r24, 0x08 ; 8 2df28: 31 f4 brne .+12 ; 0x2df36 2df2a: 9e 01 movw r18, r28 2df2c: 26 0f add r18, r22 2df2e: 31 1d adc r19, r1 2df30: f9 01 movw r30, r18 2df32: 90 83 st Z, r25 2df34: 6f 5f subi r22, 0xFF ; 255 name[j++] = dir.name[i]; 2df36: 9e 01 movw r18, r28 2df38: 26 0f add r18, r22 2df3a: 31 1d adc r19, r1 2df3c: ad 01 movw r20, r26 2df3e: 41 50 subi r20, 0x01 ; 1 2df40: 51 09 sbc r21, r1 2df42: fa 01 movw r30, r20 2df44: 40 81 ld r20, Z 2df46: f9 01 movw r30, r18 2df48: 40 83 st Z, r20 2df4a: 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++) { 2df4c: 8f 5f subi r24, 0xFF ; 255 2df4e: 8b 30 cpi r24, 0x0B ; 11 2df50: 39 f7 brne .-50 ; 0x2df20 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; name[j++] = dir.name[i]; } name[j] = 0; 2df52: fe 01 movw r30, r28 2df54: e6 0f add r30, r22 2df56: f1 1d adc r31, r1 2df58: 10 82 st Z, r1 2df5a: d7 cf rjmp .-82 ; 0x2df0a 0002df5c : 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() { 2df5c: 3f 92 push r3 2df5e: 4f 92 push r4 2df60: 5f 92 push r5 2df62: 6f 92 push r6 2df64: 7f 92 push r7 2df66: 8f 92 push r8 2df68: 9f 92 push r9 2df6a: af 92 push r10 2df6c: bf 92 push r11 2df6e: cf 92 push r12 2df70: df 92 push r13 2df72: ef 92 push r14 2df74: ff 92 push r15 2df76: 0f 93 push r16 2df78: 1f 93 push r17 2df7a: cf 93 push r28 2df7c: df 93 push r29 2df7e: cd b7 in r28, 0x3d ; 61 2df80: de b7 in r29, 0x3e ; 62 2df82: 2c 97 sbiw r28, 0x0c ; 12 2df84: 0f b6 in r0, 0x3f ; 63 2df86: f8 94 cli 2df88: de bf out 0x3e, r29 ; 62 2df8a: 0f be out 0x3f, r0 ; 63 2df8c: cd bf out 0x3d, r28 ; 61 2df8e: 5c 01 movw r10, r24 if (!vol_->allocContiguous(1, &curCluster_)) goto fail; 2df90: dc 01 movw r26, r24 2df92: 59 96 adiw r26, 0x19 ; 25 2df94: 8d 90 ld r8, X+ 2df96: 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; 2df98: f4 01 movw r30, r8 2df9a: 81 85 ldd r24, Z+9 ; 0x09 2df9c: 92 85 ldd r25, Z+10 ; 0x0a 2df9e: a3 85 ldd r26, Z+11 ; 0x0b 2dfa0: b4 85 ldd r27, Z+12 ; 0x0c 2dfa2: 9c 01 movw r18, r24 2dfa4: ad 01 movw r20, r26 2dfa6: 2f 5f subi r18, 0xFF ; 255 2dfa8: 3f 4f sbci r19, 0xFF ; 255 2dfaa: 4f 4f sbci r20, 0xFF ; 255 2dfac: 5f 4f sbci r21, 0xFF ; 255 2dfae: 29 87 std Y+9, r18 ; 0x09 2dfb0: 3a 87 std Y+10, r19 ; 0x0a 2dfb2: 4b 87 std Y+11, r20 ; 0x0b 2dfb4: 5c 87 std Y+12, r21 ; 0x0c // flag to save place to start next search bool setStart; // set search start cluster if (*curCluster) { 2dfb6: d5 01 movw r26, r10 2dfb8: 14 96 adiw r26, 0x04 ; 4 2dfba: 4d 90 ld r4, X+ 2dfbc: 5d 90 ld r5, X+ 2dfbe: 6d 90 ld r6, X+ 2dfc0: 7c 90 ld r7, X 2dfc2: 17 97 sbiw r26, 0x07 ; 7 2dfc4: 41 14 cp r4, r1 2dfc6: 51 04 cpc r5, r1 2dfc8: 61 04 cpc r6, r1 2dfca: 71 04 cpc r7, r1 2dfcc: 09 f4 brne .+2 ; 0x2dfd0 2dfce: 59 c0 rjmp .+178 ; 0x2e082 // try to make file contiguous bgnCluster = *curCluster + 1; 2dfd0: bf ef ldi r27, 0xFF ; 255 2dfd2: 4b 1a sub r4, r27 2dfd4: 5b 0a sbc r5, r27 2dfd6: 6b 0a sbc r6, r27 2dfd8: 7b 0a sbc r7, r27 // don't save new start location setStart = false; 2dfda: 31 2c mov r3, r1 // save next search start if one cluster setStart = count == 1; } // end of group endCluster = bgnCluster; 2dfdc: 73 01 movw r14, r6 2dfde: 62 01 movw r12, r4 // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 2dfe0: 1d 82 std Y+5, r1 ; 0x05 2dfe2: 1e 82 std Y+6, r1 ; 0x06 2dfe4: 1f 82 std Y+7, r1 ; 0x07 2dfe6: 18 86 std Y+8, r1 ; 0x08 // can't find space checked all clusters if (n >= clusterCount_) goto fail; 2dfe8: f4 01 movw r30, r8 2dfea: 81 85 ldd r24, Z+9 ; 0x09 2dfec: 92 85 ldd r25, Z+10 ; 0x0a 2dfee: a3 85 ldd r26, Z+11 ; 0x0b 2dff0: b4 85 ldd r27, Z+12 ; 0x0c 2dff2: 2d 81 ldd r18, Y+5 ; 0x05 2dff4: 3e 81 ldd r19, Y+6 ; 0x06 2dff6: 4f 81 ldd r20, Y+7 ; 0x07 2dff8: 58 85 ldd r21, Y+8 ; 0x08 2dffa: 28 17 cp r18, r24 2dffc: 39 07 cpc r19, r25 2dffe: 4a 07 cpc r20, r26 2e000: 5b 07 cpc r21, r27 2e002: 08 f0 brcs .+2 ; 0x2e006 2e004: 56 c0 rjmp .+172 ; 0x2e0b2 // past end - start from beginning of FAT if (endCluster > fatEnd) { 2e006: 89 85 ldd r24, Y+9 ; 0x09 2e008: 9a 85 ldd r25, Y+10 ; 0x0a 2e00a: ab 85 ldd r26, Y+11 ; 0x0b 2e00c: bc 85 ldd r27, Y+12 ; 0x0c 2e00e: 8c 15 cp r24, r12 2e010: 9d 05 cpc r25, r13 2e012: ae 05 cpc r26, r14 2e014: bf 05 cpc r27, r15 2e016: 50 f4 brcc .+20 ; 0x2e02c bgnCluster = endCluster = 2; 2e018: 82 e0 ldi r24, 0x02 ; 2 2e01a: c8 2e mov r12, r24 2e01c: d1 2c mov r13, r1 2e01e: e1 2c mov r14, r1 2e020: f1 2c mov r15, r1 2e022: 92 e0 ldi r25, 0x02 ; 2 2e024: 49 2e mov r4, r25 2e026: 51 2c mov r5, r1 2e028: 61 2c mov r6, r1 2e02a: 71 2c mov r7, r1 } uint32_t f; if (!fatGet(endCluster, &f)) goto fail; 2e02c: 9e 01 movw r18, r28 2e02e: 2f 5f subi r18, 0xFF ; 255 2e030: 3f 4f sbci r19, 0xFF ; 255 2e032: b7 01 movw r22, r14 2e034: a6 01 movw r20, r12 2e036: c4 01 movw r24, r8 2e038: 0f 94 f4 37 call 0x26fe8 ; 0x26fe8 2e03c: 88 23 and r24, r24 2e03e: c9 f1 breq .+114 ; 0x2e0b2 if (f != 0) { 2e040: 89 81 ldd r24, Y+1 ; 0x01 2e042: 9a 81 ldd r25, Y+2 ; 0x02 2e044: ab 81 ldd r26, Y+3 ; 0x03 2e046: bc 81 ldd r27, Y+4 ; 0x04 2e048: 89 2b or r24, r25 2e04a: 8a 2b or r24, r26 2e04c: 8b 2b or r24, r27 2e04e: 01 f1 breq .+64 ; 0x2e090 // cluster in use try next cluster as bgnCluster bgnCluster = endCluster + 1; 2e050: 26 01 movw r4, r12 2e052: 37 01 movw r6, r14 2e054: 9f ef ldi r25, 0xFF ; 255 2e056: 49 1a sub r4, r25 2e058: 59 0a sbc r5, r25 2e05a: 69 0a sbc r6, r25 2e05c: 79 0a sbc r7, r25 } // end of group endCluster = bgnCluster; // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 2e05e: 2d 81 ldd r18, Y+5 ; 0x05 2e060: 3e 81 ldd r19, Y+6 ; 0x06 2e062: 4f 81 ldd r20, Y+7 ; 0x07 2e064: 58 85 ldd r21, Y+8 ; 0x08 2e066: 2f 5f subi r18, 0xFF ; 255 2e068: 3f 4f sbci r19, 0xFF ; 255 2e06a: 4f 4f sbci r20, 0xFF ; 255 2e06c: 5f 4f sbci r21, 0xFF ; 255 2e06e: 2d 83 std Y+5, r18 ; 0x05 2e070: 3e 83 std Y+6, r19 ; 0x06 2e072: 4f 83 std Y+7, r20 ; 0x07 2e074: 58 87 std Y+8, r21 ; 0x08 2e076: 3f ef ldi r19, 0xFF ; 255 2e078: c3 1a sub r12, r19 2e07a: d3 0a sbc r13, r19 2e07c: e3 0a sbc r14, r19 2e07e: f3 0a sbc r15, r19 2e080: b3 cf rjmp .-154 ; 0x2dfe8 // don't save new start location setStart = false; } else { // start at likely place for free cluster bgnCluster = allocSearchStart_; 2e082: 40 80 ld r4, Z 2e084: 51 80 ldd r5, Z+1 ; 0x01 2e086: 62 80 ldd r6, Z+2 ; 0x02 2e088: 73 80 ldd r7, Z+3 ; 0x03 // save next search start if one cluster setStart = count == 1; 2e08a: 33 24 eor r3, r3 2e08c: 33 94 inc r3 2e08e: a6 cf rjmp .-180 ; 0x2dfdc 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) { 2e090: c4 14 cp r12, r4 2e092: d5 04 cpc r13, r5 2e094: e6 04 cpc r14, r6 2e096: f7 04 cpc r15, r7 2e098: 11 f7 brne .-60 ; 0x2e05e 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); 2e09a: 0f ef ldi r16, 0xFF ; 255 2e09c: 1f ef ldi r17, 0xFF ; 255 2e09e: 2f ef ldi r18, 0xFF ; 255 2e0a0: 3f e0 ldi r19, 0x0F ; 15 2e0a2: b7 01 movw r22, r14 2e0a4: a6 01 movw r20, r12 2e0a6: c4 01 movw r24, r8 2e0a8: 0f 94 62 37 call 0x26ec4 ; 0x26ec4 2e0ac: 78 2e mov r7, r24 // done - found space break; } } // mark end of chain if (!fatPutEOC(endCluster)) goto fail; 2e0ae: 81 11 cpse r24, r1 2e0b0: 1a c0 rjmp .+52 ; 0x2e0e6 flags_ |= F_FILE_DIR_DIRTY; } return true; fail: return false; 2e0b2: 71 2c mov r7, r1 } 2e0b4: 87 2d mov r24, r7 2e0b6: 2c 96 adiw r28, 0x0c ; 12 2e0b8: 0f b6 in r0, 0x3f ; 63 2e0ba: f8 94 cli 2e0bc: de bf out 0x3e, r29 ; 62 2e0be: 0f be out 0x3f, r0 ; 63 2e0c0: cd bf out 0x3d, r28 ; 61 2e0c2: df 91 pop r29 2e0c4: cf 91 pop r28 2e0c6: 1f 91 pop r17 2e0c8: 0f 91 pop r16 2e0ca: ff 90 pop r15 2e0cc: ef 90 pop r14 2e0ce: df 90 pop r13 2e0d0: cf 90 pop r12 2e0d2: bf 90 pop r11 2e0d4: af 90 pop r10 2e0d6: 9f 90 pop r9 2e0d8: 8f 90 pop r8 2e0da: 7f 90 pop r7 2e0dc: 6f 90 pop r6 2e0de: 5f 90 pop r5 2e0e0: 4f 90 pop r4 2e0e2: 3f 90 pop r3 2e0e4: 08 95 ret // link clusters while (endCluster > bgnCluster) { if (!fatPut(endCluster - 1, endCluster)) goto fail; endCluster--; } if (*curCluster != 0) { 2e0e6: f5 01 movw r30, r10 2e0e8: 44 81 ldd r20, Z+4 ; 0x04 2e0ea: 55 81 ldd r21, Z+5 ; 0x05 2e0ec: 66 81 ldd r22, Z+6 ; 0x06 2e0ee: 77 81 ldd r23, Z+7 ; 0x07 2e0f0: 41 15 cp r20, r1 2e0f2: 51 05 cpc r21, r1 2e0f4: 61 05 cpc r22, r1 2e0f6: 71 05 cpc r23, r1 2e0f8: 39 f0 breq .+14 ; 0x2e108 // connect chains if (!fatPut(*curCluster, bgnCluster)) goto fail; 2e0fa: 97 01 movw r18, r14 2e0fc: 86 01 movw r16, r12 2e0fe: c4 01 movw r24, r8 2e100: 0f 94 62 37 call 0x26ec4 ; 0x26ec4 2e104: 88 23 and r24, r24 2e106: a9 f2 breq .-86 ; 0x2e0b2 } // return first cluster number to caller *curCluster = bgnCluster; 2e108: d5 01 movw r26, r10 2e10a: 14 96 adiw r26, 0x04 ; 4 2e10c: cd 92 st X+, r12 2e10e: dd 92 st X+, r13 2e110: ed 92 st X+, r14 2e112: fc 92 st X, r15 2e114: 17 97 sbiw r26, 0x07 ; 7 // remember possible next free cluster if (setStart) allocSearchStart_ = bgnCluster + 1; 2e116: 33 20 and r3, r3 2e118: 51 f0 breq .+20 ; 0x2e12e 2e11a: d7 01 movw r26, r14 2e11c: c6 01 movw r24, r12 2e11e: 01 96 adiw r24, 0x01 ; 1 2e120: a1 1d adc r26, r1 2e122: b1 1d adc r27, r1 2e124: f4 01 movw r30, r8 2e126: 80 83 st Z, r24 2e128: 91 83 std Z+1, r25 ; 0x01 2e12a: a2 83 std Z+2, r26 ; 0x02 2e12c: 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) { 2e12e: f5 01 movw r30, r10 2e130: 85 89 ldd r24, Z+21 ; 0x15 2e132: 96 89 ldd r25, Z+22 ; 0x16 2e134: a7 89 ldd r26, Z+23 ; 0x17 2e136: b0 8d ldd r27, Z+24 ; 0x18 2e138: 89 2b or r24, r25 2e13a: 8a 2b or r24, r26 2e13c: 8b 2b or r24, r27 2e13e: 09 f0 breq .+2 ; 0x2e142 2e140: b9 cf rjmp .-142 ; 0x2e0b4 firstCluster_ = curCluster_; 2e142: c5 8a std Z+21, r12 ; 0x15 2e144: d6 8a std Z+22, r13 ; 0x16 2e146: e7 8a std Z+23, r14 ; 0x17 2e148: f0 8e std Z+24, r15 ; 0x18 flags_ |= F_FILE_DIR_DIRTY; 2e14a: 81 81 ldd r24, Z+1 ; 0x01 2e14c: 80 68 ori r24, 0x80 ; 128 2e14e: 81 83 std Z+1, r24 ; 0x01 2e150: b1 cf rjmp .-158 ; 0x2e0b4 0002e152 : buf[nbyte] = SPDR; } //------------------------------------------------------------------------------ /** SPI send a byte */ static void spiSend(uint8_t b) { SPDR = b; 2e152: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e154: 0d b4 in r0, 0x2d ; 45 2e156: 07 fe sbrs r0, 7 2e158: fd cf rjmp .-6 ; 0x2e154 } 2e15a: 08 95 ret 0002e15c : SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; } //------------------------------------------------------------------------------ /** SPI receive a byte */ static uint8_t spiRec() { SPDR = 0XFF; 2e15c: 8f ef ldi r24, 0xFF ; 255 2e15e: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e160: 0d b4 in r0, 0x2d ; 45 2e162: 07 fe sbrs r0, 7 2e164: fd cf rjmp .-6 ; 0x2e160 return SPDR; 2e166: 8e b5 in r24, 0x2e ; 46 } 2e168: 08 95 ret 0002e16a : } } #endif // SOFTWARE_SPI //------------------------------------------------------------------------------ // send command and return error code. Return zero for OK uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) { 2e16a: 8f 92 push r8 2e16c: 9f 92 push r9 2e16e: af 92 push r10 2e170: bf 92 push r11 2e172: ef 92 push r14 2e174: ff 92 push r15 2e176: 0f 93 push r16 2e178: 1f 93 push r17 2e17a: cf 93 push r28 2e17c: 7c 01 movw r14, r24 2e17e: c6 2f mov r28, r22 2e180: 49 01 movw r8, r18 2e182: 5a 01 movw r10, r20 WRITE(SDSS, 1); } //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); 2e184: fc 01 movw r30, r24 2e186: 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); 2e188: 89 2f mov r24, r25 2e18a: 80 6a ori r24, 0xA0 ; 160 2e18c: 86 95 lsr r24 2e18e: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 2e190: 90 fd sbrc r25, 0 2e192: 03 c0 rjmp .+6 ; 0x2e19a 2e194: 81 e0 ldi r24, 0x01 ; 1 2e196: 96 30 cpi r25, 0x06 ; 6 2e198: 09 f4 brne .+2 ; 0x2e19c 2e19a: 80 e0 ldi r24, 0x00 ; 0 2e19c: 8d bd out 0x2d, r24 ; 45 //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); #endif // SOFTWARE_SPI WRITE(SDSS, 0); 2e19e: 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); 2e1a0: 8c e2 ldi r24, 0x2C ; 44 2e1a2: 91 e0 ldi r25, 0x01 ; 1 2e1a4: 0f 94 81 42 call 0x28502 ; 0x28502 // send command spiSend(cmd | 0x40); 2e1a8: 8c 2f mov r24, r28 2e1aa: 80 64 ori r24, 0x40 ; 64 2e1ac: 0f 94 a9 70 call 0x2e152 ; 0x2e152 2e1b0: 08 e1 ldi r16, 0x18 ; 24 2e1b2: 10 e0 ldi r17, 0x00 ; 0 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); 2e1b4: d5 01 movw r26, r10 2e1b6: c4 01 movw r24, r8 2e1b8: 00 2e mov r0, r16 2e1ba: 04 c0 rjmp .+8 ; 0x2e1c4 2e1bc: b6 95 lsr r27 2e1be: a7 95 ror r26 2e1c0: 97 95 ror r25 2e1c2: 87 95 ror r24 2e1c4: 0a 94 dec r0 2e1c6: d2 f7 brpl .-12 ; 0x2e1bc 2e1c8: 0f 94 a9 70 call 0x2e152 ; 0x2e152 2e1cc: 08 50 subi r16, 0x08 ; 8 2e1ce: 11 09 sbc r17, r1 2e1d0: 08 3f cpi r16, 0xF8 ; 248 2e1d2: ff ef ldi r31, 0xFF ; 255 2e1d4: 1f 07 cpc r17, r31 2e1d6: 71 f7 brne .-36 ; 0x2e1b4 // send CRC uint8_t crc = 0XFF; if (cmd == CMD0) crc = 0X95; // correct crc for CMD0 with arg 0 2e1d8: 85 e9 ldi r24, 0x95 ; 149 2e1da: cc 23 and r28, r28 2e1dc: 21 f0 breq .+8 ; 0x2e1e6 if (cmd == CMD8) crc = 0X87; // correct crc for CMD8 with arg 0X1AA 2e1de: 87 e8 ldi r24, 0x87 ; 135 2e1e0: c8 30 cpi r28, 0x08 ; 8 2e1e2: 09 f0 breq .+2 ; 0x2e1e6 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 2e1e4: 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); 2e1e6: 0f 94 a9 70 call 0x2e152 ; 0x2e152 // skip stuff byte for stop read if (cmd == CMD12) spiRec(); 2e1ea: cc 30 cpi r28, 0x0C ; 12 2e1ec: 11 f4 brne .+4 ; 0x2e1f2 2e1ee: 0f 94 ae 70 call 0x2e15c ; 0x2e15c // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 2e1f2: 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 */ } 2e1f4: 0f 94 ae 70 call 0x2e15c ; 0x2e15c 2e1f8: f7 01 movw r30, r14 2e1fa: 82 83 std Z+2, r24 ; 0x02 2e1fc: 87 ff sbrs r24, 7 2e1fe: 04 c0 rjmp .+8 ; 0x2e208 2e200: cf 3f cpi r28, 0xFF ; 255 2e202: 11 f0 breq .+4 ; 0x2e208 2e204: cf 5f subi r28, 0xFF ; 255 2e206: f6 cf rjmp .-20 ; 0x2e1f4 return status_; } 2e208: cf 91 pop r28 2e20a: 1f 91 pop r17 2e20c: 0f 91 pop r16 2e20e: ff 90 pop r15 2e210: ef 90 pop r14 2e212: bf 90 pop r11 2e214: af 90 pop r10 2e216: 9f 90 pop r9 2e218: 8f 90 pop r8 2e21a: 08 95 ret 0002e21c : * \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) { 2e21c: 0f 93 push r16 2e21e: 1f 93 push r17 2e220: cf 93 push r28 2e222: df 93 push r29 2e224: ec 01 movw r28, r24 2e226: 89 01 movw r16, r18 // use address if not SDHC card if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; 2e228: 8b 81 ldd r24, Y+3 ; 0x03 2e22a: 83 30 cpi r24, 0x03 ; 3 2e22c: 39 f0 breq .+14 ; 0x2e23c 2e22e: 89 e0 ldi r24, 0x09 ; 9 2e230: 44 0f add r20, r20 2e232: 55 1f adc r21, r21 2e234: 66 1f adc r22, r22 2e236: 77 1f adc r23, r23 2e238: 8a 95 dec r24 2e23a: d1 f7 brne .-12 ; 0x2e230 if (cardCommand(CMD24, blockNumber)) { 2e23c: 9a 01 movw r18, r20 2e23e: ab 01 movw r20, r22 2e240: 68 e1 ldi r22, 0x18 ; 24 2e242: ce 01 movw r24, r28 2e244: 0f 94 b5 70 call 0x2e16a ; 0x2e16a 2e248: 88 23 and r24, r24 2e24a: 19 f0 breq .+6 ; 0x2e252 2e24c: 86 e0 ldi r24, 0x06 ; 6 2e24e: 88 83 st Y, r24 2e250: 39 c0 rjmp .+114 ; 0x2e2c4 } //------------------------------------------------------------------------------ /** 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; 2e252: 8e ef ldi r24, 0xFE ; 254 2e254: 8e bd out 0x2e, r24 ; 46 2e256: f8 01 movw r30, r16 2e258: c8 01 movw r24, r16 2e25a: 9e 5f subi r25, 0xFE ; 254 for (uint16_t i = 0; i < 512; i += 2) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e25c: 0d b4 in r0, 0x2d ; 45 2e25e: 07 fe sbrs r0, 7 2e260: fd cf rjmp .-6 ; 0x2e25c SPDR = buf[i]; 2e262: 20 81 ld r18, Z 2e264: 2e bd out 0x2e, r18 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e266: 0d b4 in r0, 0x2d ; 45 2e268: 07 fe sbrs r0, 7 2e26a: fd cf rjmp .-6 ; 0x2e266 SPDR = buf[i + 1]; 2e26c: 21 81 ldd r18, Z+1 ; 0x01 2e26e: 2e bd out 0x2e, r18 ; 46 2e270: 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) { 2e272: e8 17 cp r30, r24 2e274: f9 07 cpc r31, r25 2e276: 91 f7 brne .-28 ; 0x2e25c 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 */ } 2e278: 0d b4 in r0, 0x2d ; 45 2e27a: 07 fe sbrs r0, 7 2e27c: fd cf rjmp .-6 ; 0x2e278 //------------------------------------------------------------------------------ // 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 2e27e: 8f ef ldi r24, 0xFF ; 255 2e280: 0f 94 a9 70 call 0x2e152 ; 0x2e152 spiSend(0xff); // dummy crc 2e284: 8f ef ldi r24, 0xFF ; 255 2e286: 0f 94 a9 70 call 0x2e152 ; 0x2e152 status_ = spiRec(); 2e28a: 0f 94 ae 70 call 0x2e15c ; 0x2e15c 2e28e: 8a 83 std Y+2, r24 ; 0x02 if ((status_ & DATA_RES_MASK) != DATA_RES_ACCEPTED) { 2e290: 8f 71 andi r24, 0x1F ; 31 2e292: 85 30 cpi r24, 0x05 ; 5 2e294: 99 f4 brne .+38 ; 0x2e2bc goto fail; } if (!writeData(DATA_START_BLOCK, src)) goto fail; // wait for flash programming to complete if (!waitNotBusy(SD_WRITE_TIMEOUT)) { 2e296: 88 e5 ldi r24, 0x58 ; 88 2e298: 92 e0 ldi r25, 0x02 ; 2 2e29a: 0f 94 81 42 call 0x28502 ; 0x28502 2e29e: 18 2f mov r17, r24 2e2a0: 87 e1 ldi r24, 0x17 ; 23 2e2a2: 11 23 and r17, r17 2e2a4: a1 f2 breq .-88 ; 0x2e24e error(SD_CARD_ERROR_WRITE_TIMEOUT); goto fail; } // response is r2 so get and check two bytes for nonzero if (cardCommand(CMD13, 0) || spiRec()) { 2e2a6: 20 e0 ldi r18, 0x00 ; 0 2e2a8: 30 e0 ldi r19, 0x00 ; 0 2e2aa: a9 01 movw r20, r18 2e2ac: 6d e0 ldi r22, 0x0D ; 13 2e2ae: ce 01 movw r24, r28 2e2b0: 0f 94 b5 70 call 0x2e16a ; 0x2e16a 2e2b4: 88 23 and r24, r24 2e2b6: 51 f0 breq .+20 ; 0x2e2cc 2e2b8: 86 e1 ldi r24, 0x16 ; 22 2e2ba: c9 cf rjmp .-110 ; 0x2e24e 2e2bc: 83 e1 ldi r24, 0x13 ; 19 2e2be: 88 83 st Y, r24 goto fail; } return true; fail: chipSelectHigh(); 2e2c0: 0f 94 7f 42 call 0x284fe ; 0x284fe } chipSelectHigh(); return true; fail: chipSelectHigh(); 2e2c4: 0f 94 7f 42 call 0x284fe ; 0x284fe return false; 2e2c8: 10 e0 ldi r17, 0x00 ; 0 2e2ca: 06 c0 rjmp .+12 ; 0x2e2d8 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()) { 2e2cc: 0f 94 ae 70 call 0x2e15c ; 0x2e15c 2e2d0: 81 11 cpse r24, r1 2e2d2: f2 cf rjmp .-28 ; 0x2e2b8 error(SD_CARD_ERROR_WRITE_PROGRAMMING); goto fail; } chipSelectHigh(); 2e2d4: 0f 94 7f 42 call 0x284fe ; 0x284fe return true; fail: chipSelectHigh(); return false; } 2e2d8: 81 2f mov r24, r17 2e2da: df 91 pop r29 2e2dc: cf 91 pop r28 2e2de: 1f 91 pop r17 2e2e0: 0f 91 pop r16 2e2e2: 08 95 ret 0002e2e4 : * \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) { 2e2e4: 2f 92 push r2 2e2e6: 3f 92 push r3 2e2e8: 4f 92 push r4 2e2ea: 5f 92 push r5 2e2ec: 6f 92 push r6 2e2ee: 7f 92 push r7 2e2f0: 8f 92 push r8 2e2f2: 9f 92 push r9 2e2f4: af 92 push r10 2e2f6: bf 92 push r11 2e2f8: cf 92 push r12 2e2fa: df 92 push r13 2e2fc: ef 92 push r14 2e2fe: ff 92 push r15 2e300: 0f 93 push r16 2e302: 1f 93 push r17 2e304: cf 93 push r28 2e306: df 93 push r29 2e308: ec 01 movw r28, r24 2e30a: 2a 01 movw r4, r20 2e30c: 3b 01 movw r6, r22 2e30e: 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; 2e310: 8b 81 ldd r24, Y+3 ; 0x03 2e312: 83 30 cpi r24, 0x03 ; 3 2e314: 39 f0 breq .+14 ; 0x2e324 2e316: 69 e0 ldi r22, 0x09 ; 9 2e318: 44 0c add r4, r4 2e31a: 55 1c adc r5, r5 2e31c: 66 1c adc r6, r6 2e31e: 77 1c adc r7, r7 2e320: 6a 95 dec r22 2e322: d1 f7 brne .-12 ; 0x2e318 retry2: 2e324: 43 e0 ldi r20, 0x03 ; 3 2e326: 94 2e mov r9, r20 2e328: 56 01 movw r10, r12 2e32a: 81 e0 ldi r24, 0x01 ; 1 2e32c: a8 1a sub r10, r24 2e32e: 8e ef ldi r24, 0xFE ; 254 2e330: b8 0a sbc r11, r24 2e332: 16 01 movw r2, r12 2e334: ee ef ldi r30, 0xFE ; 254 2e336: 3e 1a sub r3, r30 2e338: 54 e0 ldi r21, 0x04 ; 4 2e33a: 85 2e mov r8, r21 retryCnt --; 2e33c: 9a 94 dec r9 if (cardCommand(CMD17, blockNumber)) { 2e33e: a3 01 movw r20, r6 2e340: 92 01 movw r18, r4 2e342: 61 e1 ldi r22, 0x11 ; 17 2e344: ce 01 movw r24, r28 2e346: 0f 94 b5 70 call 0x2e16a ; 0x2e16a 2e34a: 88 23 and r24, r24 2e34c: 79 f0 breq .+30 ; 0x2e36c 2e34e: 88 82 st Y, r8 error(SD_CARD_ERROR_CMD17); if (retryCnt > 0) goto retry; 2e350: 99 20 and r9, r9 2e352: 09 f4 brne .+2 ; 0x2e356 2e354: 7a c0 rjmp .+244 ; 0x2e44a if (retryCnt > 0) goto retry; goto fail; } return true; retry: chipSelectHigh(); 2e356: 0f 94 7f 42 call 0x284fe ; 0x284fe cardCommand(CMD12, 0);//Try sending a stop command, but ignore the result. 2e35a: 20 e0 ldi r18, 0x00 ; 0 2e35c: 30 e0 ldi r19, 0x00 ; 0 2e35e: a9 01 movw r20, r18 2e360: 6c e0 ldi r22, 0x0C ; 12 2e362: ce 01 movw r24, r28 2e364: 0f 94 b5 70 call 0x2e16a ; 0x2e16a errorCode_ = 0; 2e368: 18 82 st Y, r1 2e36a: e8 cf rjmp .-48 ; 0x2e33c #endif //------------------------------------------------------------------------------ bool Sd2Card::readData(uint8_t* dst, uint16_t count) { // wait for start block token uint16_t t0 = _millis(); 2e36c: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 2e370: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 2e372: 0f 94 ae 70 call 0x2e15c ; 0x2e15c 2e376: 8a 83 std Y+2, r24 ; 0x02 2e378: 8f 3f cpi r24, 0xFF ; 255 2e37a: 91 f4 brne .+36 ; 0x2e3a0 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 2e37c: 0f 94 fc 0f call 0x21ff8 ; 0x21ff8 2e380: 60 1b sub r22, r16 2e382: 71 0b sbc r23, r17 2e384: 6d 32 cpi r22, 0x2D ; 45 2e386: 71 40 sbci r23, 0x01 ; 1 2e388: a0 f3 brcs .-24 ; 0x2e372 2e38a: 81 e1 ldi r24, 0x11 ; 17 2e38c: 88 83 st Y, r24 if (flash_air_compatible_) spiSend(0XFF); return true; fail: chipSelectHigh(); 2e38e: 0f 94 7f 42 call 0x284fe ; 0x284fe // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 2e392: 8c 81 ldd r24, Y+4 ; 0x04 2e394: 88 23 and r24, r24 2e396: e1 f2 breq .-72 ; 0x2e350 spiSend(0XFF); 2e398: 8f ef ldi r24, 0xFF ; 255 2e39a: 0f 94 a9 70 call 0x2e152 ; 0x2e152 2e39e: d8 cf rjmp .-80 ; 0x2e350 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 2e3a0: 8e 3f cpi r24, 0xFE ; 254 2e3a2: 11 f0 breq .+4 ; 0x2e3a8 2e3a4: 8f e0 ldi r24, 0x0F ; 15 2e3a6: f2 cf rjmp .-28 ; 0x2e38c //------------------------------------------------------------------------------ /** 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; 2e3a8: 8f ef ldi r24, 0xFF ; 255 2e3aa: 8e bd out 0x2e, r24 ; 46 2e3ac: d6 01 movw r26, r12 2e3ae: f6 01 movw r30, r12 for (uint16_t i = 0; i < nbyte; i++) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e3b0: 0d b4 in r0, 0x2d ; 45 2e3b2: 07 fe sbrs r0, 7 2e3b4: fd cf rjmp .-6 ; 0x2e3b0 buf[i] = SPDR; 2e3b6: 9e b5 in r25, 0x2e ; 46 2e3b8: 91 93 st Z+, r25 SPDR = 0XFF; 2e3ba: 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++) { 2e3bc: ea 15 cp r30, r10 2e3be: fb 05 cpc r31, r11 2e3c0: b9 f7 brne .-18 ; 0x2e3b0 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } buf[i] = SPDR; SPDR = 0XFF; } while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2e3c2: 0d b4 in r0, 0x2d ; 45 2e3c4: 07 fe sbrs r0, 7 2e3c6: fd cf rjmp .-6 ; 0x2e3c2 buf[nbyte] = SPDR; 2e3c8: 8e b5 in r24, 0x2e ; 46 2e3ca: f5 01 movw r30, r10 2e3cc: 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; 2e3ce: f1 2c mov r15, r1 2e3d0: 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); 2e3d2: 8d 91 ld r24, X+ 2e3d4: ef 2d mov r30, r15 2e3d6: ff 27 eor r31, r31 2e3d8: e8 27 eor r30, r24 2e3da: ee 0f add r30, r30 2e3dc: ff 1f adc r31, r31 2e3de: ee 59 subi r30, 0x9E ; 158 2e3e0: f0 46 sbci r31, 0x60 ; 96 2e3e2: 85 91 lpm r24, Z+ 2e3e4: 94 91 lpm r25, Z 2e3e6: fe 2c mov r15, r14 2e3e8: ee 24 eor r14, r14 2e3ea: e8 26 eor r14, r24 2e3ec: 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++) { 2e3ee: 2a 16 cp r2, r26 2e3f0: 3b 06 cpc r3, r27 2e3f2: 79 f7 brne .-34 ; 0x2e3d2 spiRead(dst, count); #ifdef SD_CHECK_AND_RETRY { uint16_t calcCrc = CRC_CCITT(dst, count); uint16_t recvCrc = spiRec() << 8; 2e3f4: 0f 94 ae 70 call 0x2e15c ; 0x2e15c 2e3f8: 08 2f mov r16, r24 2e3fa: 10 e0 ldi r17, 0x00 ; 0 2e3fc: 10 2f mov r17, r16 2e3fe: 00 27 eor r16, r16 recvCrc |= spiRec(); 2e400: 0f 94 ae 70 call 0x2e15c ; 0x2e15c 2e404: 08 2b or r16, r24 if (calcCrc != recvCrc) 2e406: 0e 15 cp r16, r14 2e408: 1f 05 cpc r17, r15 2e40a: 19 f0 breq .+6 ; 0x2e412 2e40c: f0 e2 ldi r31, 0x20 ; 32 2e40e: f8 83 st Y, r31 2e410: be cf rjmp .-132 ; 0x2e38e #else // discard CRC spiRec(); spiRec(); #endif chipSelectHigh(); 2e412: 0f 94 7f 42 call 0x284fe ; 0x284fe // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 2e416: cc 81 ldd r28, Y+4 ; 0x04 2e418: cc 23 and r28, r28 2e41a: d9 f0 breq .+54 ; 0x2e452 spiSend(0XFF); 2e41c: 8f ef ldi r24, 0xFF ; 255 2e41e: 0f 94 a9 70 call 0x2e152 ; 0x2e152 #endif fail: chipSelectHigh(); return false; } 2e422: 8c 2f mov r24, r28 2e424: df 91 pop r29 2e426: cf 91 pop r28 2e428: 1f 91 pop r17 2e42a: 0f 91 pop r16 2e42c: ff 90 pop r15 2e42e: ef 90 pop r14 2e430: df 90 pop r13 2e432: cf 90 pop r12 2e434: bf 90 pop r11 2e436: af 90 pop r10 2e438: 9f 90 pop r9 2e43a: 8f 90 pop r8 2e43c: 7f 90 pop r7 2e43e: 6f 90 pop r6 2e440: 5f 90 pop r5 2e442: 4f 90 pop r4 2e444: 3f 90 pop r3 2e446: 2f 90 pop r2 2e448: 08 95 ret } return readData(dst, 512); #endif fail: chipSelectHigh(); 2e44a: 0f 94 7f 42 call 0x284fe ; 0x284fe return false; 2e44e: c0 e0 ldi r28, 0x00 ; 0 2e450: e8 cf rjmp .-48 ; 0x2e422 if (!readData(dst, 512)) { if (retryCnt > 0) goto retry; goto fail; } return true; 2e452: c1 e0 ldi r28, 0x01 ; 1 2e454: e6 cf rjmp .-52 ; 0x2e422 0002e456 : * 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) { 2e456: 2f 92 push r2 2e458: 3f 92 push r3 2e45a: 4f 92 push r4 2e45c: 5f 92 push r5 2e45e: 6f 92 push r6 2e460: 7f 92 push r7 2e462: 8f 92 push r8 2e464: 9f 92 push r9 2e466: af 92 push r10 2e468: bf 92 push r11 2e46a: cf 92 push r12 2e46c: df 92 push r13 2e46e: ef 92 push r14 2e470: ff 92 push r15 2e472: 0f 93 push r16 2e474: 1f 93 push r17 2e476: cf 93 push r28 2e478: df 93 push r29 2e47a: 00 d0 rcall .+0 ; 0x2e47c 2e47c: 1f 92 push r1 2e47e: cd b7 in r28, 0x3d ; 61 2e480: de b7 in r29, 0x3e ; 62 2e482: 9c 83 std Y+4, r25 ; 0x04 2e484: 8b 83 std Y+3, r24 ; 0x03 2e486: 4b 01 movw r8, r22 2e488: 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; 2e48a: dc 01 movw r26, r24 2e48c: 13 96 adiw r26, 0x03 ; 3 2e48e: 8c 91 ld r24, X 2e490: 81 11 cpse r24, r1 2e492: 19 c0 rjmp .+50 ; 0x2e4c6 toRead -= n; } return nbyte; fail: return -1; 2e494: 8f ef ldi r24, 0xFF ; 255 2e496: 9f ef ldi r25, 0xFF ; 255 } 2e498: 0f 90 pop r0 2e49a: 0f 90 pop r0 2e49c: 0f 90 pop r0 2e49e: 0f 90 pop r0 2e4a0: df 91 pop r29 2e4a2: cf 91 pop r28 2e4a4: 1f 91 pop r17 2e4a6: 0f 91 pop r16 2e4a8: ff 90 pop r15 2e4aa: ef 90 pop r14 2e4ac: df 90 pop r13 2e4ae: cf 90 pop r12 2e4b0: bf 90 pop r11 2e4b2: af 90 pop r10 2e4b4: 9f 90 pop r9 2e4b6: 8f 90 pop r8 2e4b8: 7f 90 pop r7 2e4ba: 6f 90 pop r6 2e4bc: 5f 90 pop r5 2e4be: 4f 90 pop r4 2e4c0: 3f 90 pop r3 2e4c2: 2f 90 pop r2 2e4c4: 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; 2e4c6: eb 81 ldd r30, Y+3 ; 0x03 2e4c8: fc 81 ldd r31, Y+4 ; 0x04 2e4ca: 81 81 ldd r24, Z+1 ; 0x01 2e4cc: 80 ff sbrs r24, 0 2e4ce: e2 cf rjmp .-60 ; 0x2e494 // max bytes left in file if (nbyte >= (fileSize_ - curPosition_)) { 2e4d0: 01 89 ldd r16, Z+17 ; 0x11 2e4d2: 12 89 ldd r17, Z+18 ; 0x12 2e4d4: 23 89 ldd r18, Z+19 ; 0x13 2e4d6: 34 89 ldd r19, Z+20 ; 0x14 2e4d8: 40 85 ldd r20, Z+8 ; 0x08 2e4da: 51 85 ldd r21, Z+9 ; 0x09 2e4dc: 62 85 ldd r22, Z+10 ; 0x0a 2e4de: 73 85 ldd r23, Z+11 ; 0x0b 2e4e0: c7 01 movw r24, r14 2e4e2: b0 e0 ldi r27, 0x00 ; 0 2e4e4: a0 e0 ldi r26, 0x00 ; 0 2e4e6: 28 01 movw r4, r16 2e4e8: 39 01 movw r6, r18 2e4ea: 44 1a sub r4, r20 2e4ec: 55 0a sbc r5, r21 2e4ee: 66 0a sbc r6, r22 2e4f0: 77 0a sbc r7, r23 2e4f2: 84 15 cp r24, r4 2e4f4: 95 05 cpc r25, r5 2e4f6: a6 05 cpc r26, r6 2e4f8: b7 05 cpc r27, r7 2e4fa: 18 f0 brcs .+6 ; 0x2e502 nbyte = fileSize_ - curPosition_; 2e4fc: 78 01 movw r14, r16 2e4fe: e4 1a sub r14, r20 2e500: f5 0a sbc r15, r21 } // amount left to read toRead = nbyte; 2e502: 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; 2e504: 8b 81 ldd r24, Y+3 ; 0x03 2e506: 9c 81 ldd r25, Y+4 ; 0x04 2e508: 04 96 adiw r24, 0x04 ; 4 2e50a: 9a 83 std Y+2, r25 ; 0x02 2e50c: 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; 2e50e: 61 2c mov r6, r1 2e510: 32 e0 ldi r19, 0x02 ; 2 2e512: 73 2e mov r7, r19 if (nbyte >= (fileSize_ - curPosition_)) { nbyte = fileSize_ - curPosition_; } // amount left to read toRead = nbyte; while (toRead > 0) { 2e514: c1 14 cp r12, r1 2e516: d1 04 cpc r13, r1 2e518: 09 f4 brne .+2 ; 0x2e51c 2e51a: b7 c0 rjmp .+366 ; 0x2e68a offset = curPosition_ & 0X1FF; // offset in block 2e51c: ab 81 ldd r26, Y+3 ; 0x03 2e51e: bc 81 ldd r27, Y+4 ; 0x04 2e520: 18 96 adiw r26, 0x08 ; 8 2e522: 4d 91 ld r20, X+ 2e524: 5d 91 ld r21, X+ 2e526: 6d 91 ld r22, X+ 2e528: 7c 91 ld r23, X 2e52a: 1b 97 sbiw r26, 0x0b ; 11 2e52c: 5a 01 movw r10, r20 2e52e: b1 e0 ldi r27, 0x01 ; 1 2e530: bb 22 and r11, r27 2e532: eb 81 ldd r30, Y+3 ; 0x03 2e534: fc 81 ldd r31, Y+4 ; 0x04 2e536: 81 8d ldd r24, Z+25 ; 0x19 2e538: 92 8d ldd r25, Z+26 ; 0x1a 2e53a: 1a 01 movw r2, r20 2e53c: 2b 01 movw r4, r22 2e53e: 29 e0 ldi r18, 0x09 ; 9 2e540: 56 94 lsr r5 2e542: 47 94 ror r4 2e544: 37 94 ror r3 2e546: 27 94 ror r2 2e548: 2a 95 dec r18 2e54a: d1 f7 brne .-12 ; 0x2e540 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2e54c: 23 81 ldd r18, Z+3 ; 0x03 2e54e: 22 30 cpi r18, 0x02 ; 2 2e550: 91 f5 brne .+100 ; 0x2e5b6 block = vol_->rootDirStart() + (curPosition_ >> 9); 2e552: dc 01 movw r26, r24 2e554: 5a 96 adiw r26, 0x1a ; 26 2e556: 6d 91 ld r22, X+ 2e558: 7d 91 ld r23, X+ 2e55a: 8d 91 ld r24, X+ 2e55c: 9c 91 ld r25, X 2e55e: 5d 97 sbiw r26, 0x1d ; 29 2e560: 62 0d add r22, r2 2e562: 73 1d adc r23, r3 2e564: 84 1d adc r24, r4 2e566: 95 1d adc r25, r5 2e568: 83 01 movw r16, r6 2e56a: 0a 19 sub r16, r10 2e56c: 1b 09 sbc r17, r11 2e56e: c0 16 cp r12, r16 2e570: d1 06 cpc r13, r17 2e572: 08 f4 brcc .+2 ; 0x2e576 2e574: 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()) { 2e576: 01 15 cp r16, r1 2e578: b2 e0 ldi r27, 0x02 ; 2 2e57a: 1b 07 cpc r17, r27 2e57c: 71 f4 brne .+28 ; 0x2e59a 2e57e: 20 91 cd 0d lds r18, 0x0DCD ; 0x800dcd 2e582: 30 91 ce 0d lds r19, 0x0DCE ; 0x800dce 2e586: 40 91 cf 0d lds r20, 0x0DCF ; 0x800dcf 2e58a: 50 91 d0 0d lds r21, 0x0DD0 ; 0x800dd0 2e58e: 62 17 cp r22, r18 2e590: 73 07 cpc r23, r19 2e592: 84 07 cpc r24, r20 2e594: 95 07 cpc r25, r21 2e596: 09 f0 breq .+2 ; 0x2e59a 2e598: 59 c0 rjmp .+178 ; 0x2e64c 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; 2e59a: 40 e0 ldi r20, 0x00 ; 0 2e59c: 0f 94 25 37 call 0x26e4a ; 0x26e4a 2e5a0: 88 23 and r24, r24 2e5a2: 09 f4 brne .+2 ; 0x2e5a6 2e5a4: 77 cf rjmp .-274 ; 0x2e494 uint8_t* src = vol_->cache()->data + offset; 2e5a6: b5 01 movw r22, r10 2e5a8: 67 52 subi r22, 0x27 ; 39 2e5aa: 72 4f sbci r23, 0xF2 ; 242 memcpy(dst, src, n); 2e5ac: a8 01 movw r20, r16 2e5ae: c4 01 movw r24, r8 2e5b0: 0f 94 c4 a6 call 0x34d88 ; 0x34d88 2e5b4: 57 c0 rjmp .+174 ; 0x2e664 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);} 2e5b6: fc 01 movw r30, r24 2e5b8: 14 81 ldd r17, Z+4 ; 0x04 2e5ba: 11 50 subi r17, 0x01 ; 1 2e5bc: 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) { 2e5be: a1 14 cp r10, r1 2e5c0: b1 04 cpc r11, r1 2e5c2: 81 f4 brne .+32 ; 0x2e5e4 2e5c4: 11 11 cpse r17, r1 2e5c6: 0e c0 rjmp .+28 ; 0x2e5e4 // start of new cluster if (curPosition_ == 0) { 2e5c8: 45 2b or r20, r21 2e5ca: 46 2b or r20, r22 2e5cc: 47 2b or r20, r23 2e5ce: 79 f5 brne .+94 ; 0x2e62e // use first cluster in file curCluster_ = firstCluster_; 2e5d0: eb 81 ldd r30, Y+3 ; 0x03 2e5d2: fc 81 ldd r31, Y+4 ; 0x04 2e5d4: 85 89 ldd r24, Z+21 ; 0x15 2e5d6: 96 89 ldd r25, Z+22 ; 0x16 2e5d8: a7 89 ldd r26, Z+23 ; 0x17 2e5da: b0 8d ldd r27, Z+24 ; 0x18 2e5dc: 84 83 std Z+4, r24 ; 0x04 2e5de: 95 83 std Z+5, r25 ; 0x05 2e5e0: a6 83 std Z+6, r26 ; 0x06 2e5e2: 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; 2e5e4: ab 81 ldd r26, Y+3 ; 0x03 2e5e6: bc 81 ldd r27, Y+4 ; 0x04 2e5e8: 59 96 adiw r26, 0x19 ; 25 2e5ea: ed 91 ld r30, X+ 2e5ec: fc 91 ld r31, X 2e5ee: 5a 97 sbiw r26, 0x1a ; 26 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2e5f0: 14 96 adiw r26, 0x04 ; 4 2e5f2: 6d 91 ld r22, X+ 2e5f4: 7d 91 ld r23, X+ 2e5f6: 8d 91 ld r24, X+ 2e5f8: 9c 91 ld r25, X 2e5fa: 17 97 sbiw r26, 0x07 ; 7 2e5fc: 62 50 subi r22, 0x02 ; 2 2e5fe: 71 09 sbc r23, r1 2e600: 81 09 sbc r24, r1 2e602: 91 09 sbc r25, r1 2e604: 25 85 ldd r18, Z+13 ; 0x0d 2e606: 04 c0 rjmp .+8 ; 0x2e610 2e608: 66 0f add r22, r22 2e60a: 77 1f adc r23, r23 2e60c: 88 1f adc r24, r24 2e60e: 99 1f adc r25, r25 2e610: 2a 95 dec r18 2e612: d2 f7 brpl .-12 ; 0x2e608 2e614: 26 85 ldd r18, Z+14 ; 0x0e 2e616: 37 85 ldd r19, Z+15 ; 0x0f 2e618: 40 89 ldd r20, Z+16 ; 0x10 2e61a: 51 89 ldd r21, Z+17 ; 0x11 2e61c: 62 0f add r22, r18 2e61e: 73 1f adc r23, r19 2e620: 84 1f adc r24, r20 2e622: 95 1f adc r25, r21 2e624: 61 0f add r22, r17 2e626: 71 1d adc r23, r1 2e628: 81 1d adc r24, r1 2e62a: 91 1d adc r25, r1 2e62c: 9d cf rjmp .-198 ; 0x2e568 if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2e62e: ab 81 ldd r26, Y+3 ; 0x03 2e630: bc 81 ldd r27, Y+4 ; 0x04 2e632: 14 96 adiw r26, 0x04 ; 4 2e634: 4d 91 ld r20, X+ 2e636: 5d 91 ld r21, X+ 2e638: 6d 91 ld r22, X+ 2e63a: 7c 91 ld r23, X 2e63c: 17 97 sbiw r26, 0x07 ; 7 2e63e: 29 81 ldd r18, Y+1 ; 0x01 2e640: 3a 81 ldd r19, Y+2 ; 0x02 2e642: 0f 94 f4 37 call 0x26fe8 ; 0x26fe8 2e646: 81 11 cpse r24, r1 2e648: cd cf rjmp .-102 ; 0x2e5e4 2e64a: 24 cf rjmp .-440 ; 0x2e494 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);} 2e64c: 94 01 movw r18, r8 2e64e: ab 01 movw r20, r22 2e650: bc 01 movw r22, r24 2e652: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 2e656: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 2e65a: 0f 94 72 71 call 0x2e2e4 ; 0x2e2e4 // 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; 2e65e: 88 23 and r24, r24 2e660: 09 f4 brne .+2 ; 0x2e664 2e662: 18 cf rjmp .-464 ; 0x2e494 // 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; 2e664: 80 0e add r8, r16 2e666: 91 1e adc r9, r17 curPosition_ += n; 2e668: eb 81 ldd r30, Y+3 ; 0x03 2e66a: fc 81 ldd r31, Y+4 ; 0x04 2e66c: 80 85 ldd r24, Z+8 ; 0x08 2e66e: 91 85 ldd r25, Z+9 ; 0x09 2e670: a2 85 ldd r26, Z+10 ; 0x0a 2e672: b3 85 ldd r27, Z+11 ; 0x0b 2e674: 80 0f add r24, r16 2e676: 91 1f adc r25, r17 2e678: a1 1d adc r26, r1 2e67a: b1 1d adc r27, r1 2e67c: 80 87 std Z+8, r24 ; 0x08 2e67e: 91 87 std Z+9, r25 ; 0x09 2e680: a2 87 std Z+10, r26 ; 0x0a 2e682: b3 87 std Z+11, r27 ; 0x0b toRead -= n; 2e684: c0 1a sub r12, r16 2e686: d1 0a sbc r13, r17 2e688: 45 cf rjmp .-374 ; 0x2e514 } return nbyte; 2e68a: c7 01 movw r24, r14 2e68c: 05 cf rjmp .-502 ; 0x2e498 0002e68e : return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 2e68e: 4f 92 push r4 2e690: 5f 92 push r5 2e692: 6f 92 push r6 2e694: 7f 92 push r7 2e696: af 92 push r10 2e698: bf 92 push r11 2e69a: cf 92 push r12 2e69c: df 92 push r13 2e69e: ef 92 push r14 2e6a0: ff 92 push r15 2e6a2: 0f 93 push r16 2e6a4: 1f 93 push r17 2e6a6: cf 93 push r28 2e6a8: df 93 push r29 2e6aa: 1f 92 push r1 2e6ac: cd b7 in r28, 0x3d ; 61 2e6ae: de b7 in r29, 0x3e ; 62 2e6b0: 8c 01 movw r16, r24 2e6b2: 7b 01 movw r14, r22 2e6b4: 5a 01 movw r10, r20 2e6b6: c2 2e mov r12, r18 bool emptyFound = false; bool fileFound = false; uint8_t index; dir_t* p; vol_ = dirFile->vol_; 2e6b8: db 01 movw r26, r22 2e6ba: 59 96 adiw r26, 0x19 ; 25 2e6bc: 8d 91 ld r24, X+ 2e6be: 9c 91 ld r25, X 2e6c0: f8 01 movw r30, r16 2e6c2: 92 8f std Z+26, r25 ; 0x1a 2e6c4: 81 8f std Z+25, r24 ; 0x19 dirFile->rewind(); 2e6c6: cb 01 movw r24, r22 2e6c8: 0e 94 2c 70 call 0xe058 ; 0xe058 } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { bool emptyFound = false; 2e6cc: 71 2c mov r7, r1 vol_ = dirFile->vol_; dirFile->rewind(); // search for file while (dirFile->curPosition_ < dirFile->fileSize_) { 2e6ce: f7 01 movw r30, r14 2e6d0: 80 85 ldd r24, Z+8 ; 0x08 2e6d2: 91 85 ldd r25, Z+9 ; 0x09 2e6d4: a2 85 ldd r26, Z+10 ; 0x0a 2e6d6: b3 85 ldd r27, Z+11 ; 0x0b 2e6d8: 41 89 ldd r20, Z+17 ; 0x11 2e6da: 52 89 ldd r21, Z+18 ; 0x12 2e6dc: 63 89 ldd r22, Z+19 ; 0x13 2e6de: 74 89 ldd r23, Z+20 ; 0x14 2e6e0: 84 17 cp r24, r20 2e6e2: 95 07 cpc r25, r21 2e6e4: a6 07 cpc r26, r22 2e6e6: b7 07 cpc r27, r23 2e6e8: 08 f0 brcs .+2 ; 0x2e6ec 2e6ea: 52 c0 rjmp .+164 ; 0x2e790 index = 0XF & (dirFile->curPosition_ >> 5); 2e6ec: 55 e0 ldi r21, 0x05 ; 5 2e6ee: b6 95 lsr r27 2e6f0: a7 95 ror r26 2e6f2: 97 95 ror r25 2e6f4: 87 95 ror r24 2e6f6: 5a 95 dec r21 2e6f8: d1 f7 brne .-12 ; 0x2e6ee 2e6fa: f8 2f mov r31, r24 2e6fc: ff 70 andi r31, 0x0F ; 15 2e6fe: 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; 2e700: d7 01 movw r26, r14 2e702: 13 96 adiw r26, 0x03 ; 3 2e704: 8c 91 ld r24, X 2e706: 82 30 cpi r24, 0x02 ; 2 2e708: 10 f4 brcc .+4 ; 0x2e70e if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; return false; 2e70a: 80 e0 ldi r24, 0x00 ; 0 2e70c: db c0 rjmp .+438 ; 0x2e8c4 * \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; 2e70e: 41 e0 ldi r20, 0x01 ; 1 2e710: 50 e0 ldi r21, 0x00 ; 0 2e712: be 01 movw r22, r28 2e714: 6f 5f subi r22, 0xFF ; 255 2e716: 7f 4f sbci r23, 0xFF ; 255 2e718: c7 01 movw r24, r14 2e71a: 0f 94 2b 72 call 0x2e456 ; 0x2e456 2e71e: 01 97 sbiw r24, 0x01 ; 1 2e720: a1 f7 brne .-24 ; 0x2e70a // use read to locate and cache block if (read() < 0) goto fail; // advance to next entry curPosition_ += 31; 2e722: f7 01 movw r30, r14 2e724: 80 85 ldd r24, Z+8 ; 0x08 2e726: 91 85 ldd r25, Z+9 ; 0x09 2e728: a2 85 ldd r26, Z+10 ; 0x0a 2e72a: b3 85 ldd r27, Z+11 ; 0x0b 2e72c: 4f 96 adiw r24, 0x1f ; 31 2e72e: a1 1d adc r26, r1 2e730: b1 1d adc r27, r1 2e732: 80 87 std Z+8, r24 ; 0x08 2e734: 91 87 std Z+9, r25 ; 0x09 2e736: a2 87 std Z+10, r26 ; 0x0a 2e738: b3 87 std Z+11, r27 ; 0x0b // return pointer to entry return vol_->cache()->dir + i; 2e73a: f0 e2 ldi r31, 0x20 ; 32 2e73c: df 9e mul r13, r31 2e73e: b0 01 movw r22, r0 2e740: 11 24 eor r1, r1 2e742: 67 52 subi r22, 0x27 ; 39 2e744: 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; 2e746: 61 15 cp r22, r1 2e748: 71 05 cpc r23, r1 2e74a: f9 f2 breq .-66 ; 0x2e70a if (p->name[0] == DIR_NAME_FREE || p->name[0] == DIR_NAME_DELETED) { 2e74c: db 01 movw r26, r22 2e74e: 8c 91 ld r24, X 2e750: 88 23 and r24, r24 2e752: 41 f0 breq .+16 ; 0x2e764 2e754: 85 3e cpi r24, 0xE5 ; 229 2e756: 09 f0 breq .+2 ; 0x2e75a 2e758: 4c c0 rjmp .+152 ; 0x2e7f2 // remember first empty slot if (!emptyFound) { 2e75a: 77 20 and r7, r7 2e75c: 29 f0 breq .+10 ; 0x2e768 return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 2e75e: 77 24 eor r7, r7 2e760: 73 94 inc r7 2e762: b5 cf rjmp .-150 ; 0x2e6ce 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) { 2e764: 71 10 cpse r7, r1 2e766: 0e c0 rjmp .+28 ; 0x2e784 dirBlock_ = dirFile->vol_->cacheBlockNumber(); 2e768: 80 91 cd 0d lds r24, 0x0DCD ; 0x800dcd 2e76c: 90 91 ce 0d lds r25, 0x0DCE ; 0x800dce 2e770: a0 91 cf 0d lds r26, 0x0DCF ; 0x800dcf 2e774: b0 91 d0 0d lds r27, 0x0DD0 ; 0x800dd0 2e778: f8 01 movw r30, r16 2e77a: 84 87 std Z+12, r24 ; 0x0c 2e77c: 95 87 std Z+13, r25 ; 0x0d 2e77e: a6 87 std Z+14, r26 ; 0x0e 2e780: b7 87 std Z+15, r27 ; 0x0f dirIndex_ = index; 2e782: d0 8a std Z+16, r13 ; 0x10 emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; 2e784: db 01 movw r26, r22 2e786: 8c 91 ld r24, X 2e788: 81 11 cpse r24, r1 2e78a: e9 cf rjmp .-46 ; 0x2e75e 2e78c: 77 24 eor r7, r7 2e78e: 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; 2e790: 8c 2d mov r24, r12 2e792: 82 74 andi r24, 0x42 ; 66 2e794: 82 34 cpi r24, 0x42 ; 66 2e796: 09 f0 breq .+2 ; 0x2e79a 2e798: b8 cf rjmp .-144 ; 0x2e70a if (emptyFound) { 2e79a: 77 20 and r7, r7 2e79c: 09 f4 brne .+2 ; 0x2e7a0 2e79e: a2 c0 rjmp .+324 ; 0x2e8e4 index = dirIndex_; 2e7a0: f8 01 movw r30, r16 2e7a2: d0 88 ldd r13, Z+16 ; 0x10 p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 2e7a4: 61 e0 ldi r22, 0x01 ; 1 2e7a6: c8 01 movw r24, r16 2e7a8: 0f 94 5a 6f call 0x2deb4 ; 0x2deb4 if (!p) goto fail; 2e7ac: 00 97 sbiw r24, 0x00 ; 0 2e7ae: 09 f4 brne .+2 ; 0x2e7b2 2e7b0: ac cf rjmp .-168 ; 0x2e70a // use first entry in cluster p = dirFile->vol_->cache()->dir; index = 0; } // initialize as empty file memset(p, 0, sizeof(dir_t)); 2e7b2: 20 e2 ldi r18, 0x20 ; 32 2e7b4: dc 01 movw r26, r24 2e7b6: 1d 92 st X+, r1 2e7b8: 2a 95 dec r18 2e7ba: e9 f7 brne .-6 ; 0x2e7b6 memcpy(p->name, dname, 11); 2e7bc: 2b e0 ldi r18, 0x0B ; 11 2e7be: f5 01 movw r30, r10 2e7c0: dc 01 movw r26, r24 2e7c2: 01 90 ld r0, Z+ 2e7c4: 0d 92 st X+, r0 2e7c6: 2a 95 dec r18 2e7c8: e1 f7 brne .-8 ; 0x2e7c2 if (dateTime_) { // call user date/time function dateTime_(&p->creationDate, &p->creationTime); } else { // use default date/time p->creationDate = FAT_DEFAULT_DATE; 2e7ca: 21 e2 ldi r18, 0x21 ; 33 2e7cc: 38 e2 ldi r19, 0x28 ; 40 2e7ce: fc 01 movw r30, r24 2e7d0: 31 8b std Z+17, r19 ; 0x11 2e7d2: 20 8b std Z+16, r18 ; 0x10 p->creationTime = FAT_DEFAULT_TIME; 2e7d4: 40 e0 ldi r20, 0x00 ; 0 2e7d6: 58 e0 ldi r21, 0x08 ; 8 2e7d8: 57 87 std Z+15, r21 ; 0x0f 2e7da: 46 87 std Z+14, r20 ; 0x0e } p->lastAccessDate = p->creationDate; 2e7dc: 33 8b std Z+19, r19 ; 0x13 2e7de: 22 8b std Z+18, r18 ; 0x12 p->lastWriteDate = p->creationDate; 2e7e0: 31 8f std Z+25, r19 ; 0x19 2e7e2: 20 8f std Z+24, r18 ; 0x18 p->lastWriteTime = p->creationTime; 2e7e4: 57 8b std Z+23, r21 ; 0x17 2e7e6: 46 8b std Z+22, r20 ; 0x16 // write entry to SD if (!dirFile->vol_->cacheFlush()) goto fail; 2e7e8: 0f 94 e6 36 call 0x26dcc ; 0x26dcc 2e7ec: 81 11 cpse r24, r1 2e7ee: 09 c0 rjmp .+18 ; 0x2e802 2e7f0: 8c cf rjmp .-232 ; 0x2e70a dirIndex_ = index; emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; } else if (!memcmp(dname, p->name, 11)) { 2e7f2: 4b e0 ldi r20, 0x0B ; 11 2e7f4: 50 e0 ldi r21, 0x00 ; 0 2e7f6: c5 01 movw r24, r10 2e7f8: 0f 94 b7 a6 call 0x34d6e ; 0x34d6e 2e7fc: 89 2b or r24, r25 2e7fe: 09 f0 breq .+2 ; 0x2e802 2e800: 66 cf rjmp .-308 ; 0x2e6ce } //------------------------------------------------------------------------------ // 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]; 2e802: f0 e2 ldi r31, 0x20 ; 32 2e804: df 9e mul r13, r31 2e806: d0 01 movw r26, r0 2e808: 11 24 eor r1, r1 2e80a: 9d 01 movw r18, r26 2e80c: 27 52 subi r18, 0x27 ; 39 2e80e: 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)) { 2e810: f9 01 movw r30, r18 2e812: 83 85 ldd r24, Z+11 ; 0x0b 2e814: 81 71 andi r24, 0x11 ; 17 2e816: 21 f0 breq .+8 ; 0x2e820 if (oflag & (O_WRITE | O_TRUNC)) goto fail; 2e818: 8c 2d mov r24, r12 2e81a: 82 71 andi r24, 0x12 ; 18 2e81c: 09 f0 breq .+2 ; 0x2e820 2e81e: fc c0 rjmp .+504 ; 0x2ea18 } //------------------------------------------------------------------------------ // 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]; 2e820: f8 01 movw r30, r16 2e822: 81 8d ldd r24, Z+25 ; 0x19 2e824: 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(); 2e826: 40 91 cd 0d lds r20, 0x0DCD ; 0x800dcd 2e82a: 50 91 ce 0d lds r21, 0x0DCE ; 0x800dce 2e82e: 60 91 cf 0d lds r22, 0x0DCF ; 0x800dcf 2e832: 70 91 d0 0d lds r23, 0x0DD0 ; 0x800dd0 2e836: 44 87 std Z+12, r20 ; 0x0c 2e838: 55 87 std Z+13, r21 ; 0x0d 2e83a: 66 87 std Z+14, r22 ; 0x0e 2e83c: 77 87 std Z+15, r23 ; 0x0f dirIndex_ = dirIndex; 2e83e: d0 8a std Z+16, r13 ; 0x10 // copy first cluster number for directory fields firstCluster_ = (uint32_t)p->firstClusterHigh << 16; 2e840: fd 01 movw r30, r26 2e842: e7 52 subi r30, 0x27 ; 39 2e844: f2 4f sbci r31, 0xF2 ; 242 2e846: 44 88 ldd r4, Z+20 ; 0x14 2e848: 55 88 ldd r5, Z+21 ; 0x15 2e84a: 71 2c mov r7, r1 2e84c: 61 2c mov r6, r1 2e84e: 32 01 movw r6, r4 2e850: 55 24 eor r5, r5 2e852: 44 24 eor r4, r4 2e854: d8 01 movw r26, r16 2e856: 55 96 adiw r26, 0x15 ; 21 2e858: 4d 92 st X+, r4 2e85a: 5d 92 st X+, r5 2e85c: 6d 92 st X+, r6 2e85e: 7c 92 st X, r7 2e860: 58 97 sbiw r26, 0x18 ; 24 firstCluster_ |= p->firstClusterLow; 2e862: 42 8d ldd r20, Z+26 ; 0x1a 2e864: 53 8d ldd r21, Z+27 ; 0x1b 2e866: 70 e0 ldi r23, 0x00 ; 0 2e868: 60 e0 ldi r22, 0x00 ; 0 2e86a: 44 29 or r20, r4 2e86c: 55 29 or r21, r5 2e86e: 66 29 or r22, r6 2e870: 77 29 or r23, r7 2e872: 55 96 adiw r26, 0x15 ; 21 2e874: 4d 93 st X+, r20 2e876: 5d 93 st X+, r21 2e878: 6d 93 st X+, r22 2e87a: 7c 93 st X, r23 2e87c: 58 97 sbiw r26, 0x18 ; 24 2e87e: d9 01 movw r26, r18 2e880: 1b 96 adiw r26, 0x0b ; 11 2e882: 2c 91 ld r18, X 2e884: 28 71 andi r18, 0x18 ; 24 // make sure it is a normal file or subdirectory if (DIR_IS_FILE(p)) { 2e886: 09 f0 breq .+2 ; 0x2e88a 2e888: b9 c0 rjmp .+370 ; 0x2e9fc fileSize_ = p->fileSize; 2e88a: 84 8d ldd r24, Z+28 ; 0x1c 2e88c: 95 8d ldd r25, Z+29 ; 0x1d 2e88e: a6 8d ldd r26, Z+30 ; 0x1e 2e890: b7 8d ldd r27, Z+31 ; 0x1f 2e892: f8 01 movw r30, r16 2e894: 81 8b std Z+17, r24 ; 0x11 2e896: 92 8b std Z+18, r25 ; 0x12 2e898: a3 8b std Z+19, r26 ; 0x13 2e89a: b4 8b std Z+20, r27 ; 0x14 type_ = FAT_FILE_TYPE_NORMAL; 2e89c: 81 e0 ldi r24, 0x01 ; 1 2e89e: 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; 2e8a0: 8c 2d mov r24, r12 2e8a2: 8f 70 andi r24, 0x0F ; 15 2e8a4: f8 01 movw r30, r16 2e8a6: 81 83 std Z+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 2e8a8: 14 82 std Z+4, r1 ; 0x04 2e8aa: 15 82 std Z+5, r1 ; 0x05 2e8ac: 16 82 std Z+6, r1 ; 0x06 2e8ae: 17 82 std Z+7, r1 ; 0x07 curPosition_ = 0; 2e8b0: 10 86 std Z+8, r1 ; 0x08 2e8b2: 11 86 std Z+9, r1 ; 0x09 2e8b4: 12 86 std Z+10, r1 ; 0x0a 2e8b6: 13 86 std Z+11, r1 ; 0x0b if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; 2e8b8: 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; 2e8ba: c4 fe sbrs r12, 4 2e8bc: 03 c0 rjmp .+6 ; 0x2e8c4 2e8be: c8 01 movw r24, r16 2e8c0: 0f 94 96 45 call 0x28b2c ; 0x28b2c // open entry in cache return openCachedEntry(index, oflag); fail: return false; } 2e8c4: 0f 90 pop r0 2e8c6: df 91 pop r29 2e8c8: cf 91 pop r28 2e8ca: 1f 91 pop r17 2e8cc: 0f 91 pop r16 2e8ce: ff 90 pop r15 2e8d0: ef 90 pop r14 2e8d2: df 90 pop r13 2e8d4: cf 90 pop r12 2e8d6: bf 90 pop r11 2e8d8: af 90 pop r10 2e8da: 7f 90 pop r7 2e8dc: 6f 90 pop r6 2e8de: 5f 90 pop r5 2e8e0: 4f 90 pop r4 2e8e2: 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; 2e8e4: d7 01 movw r26, r14 2e8e6: 13 96 adiw r26, 0x03 ; 3 2e8e8: 8c 91 ld r24, X 2e8ea: 13 97 sbiw r26, 0x03 ; 3 2e8ec: 82 30 cpi r24, 0x02 ; 2 2e8ee: 09 f4 brne .+2 ; 0x2e8f2 2e8f0: 0c cf rjmp .-488 ; 0x2e70a // 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; 2e8f2: 51 96 adiw r26, 0x11 ; 17 2e8f4: 8d 91 ld r24, X+ 2e8f6: 9d 91 ld r25, X+ 2e8f8: 0d 90 ld r0, X+ 2e8fa: bc 91 ld r27, X 2e8fc: a0 2d mov r26, r0 2e8fe: 80 3e cpi r24, 0xE0 ; 224 2e900: 9f 4f sbci r25, 0xFF ; 255 2e902: af 41 sbci r26, 0x1F ; 31 2e904: b1 05 cpc r27, r1 2e906: 08 f0 brcs .+2 ; 0x2e90a 2e908: 00 cf rjmp .-512 ; 0x2e70a if (!addCluster()) goto fail; 2e90a: c7 01 movw r24, r14 2e90c: 0f 94 ae 6f call 0x2df5c ; 0x2df5c 2e910: 88 23 and r24, r24 2e912: 09 f4 brne .+2 ; 0x2e916 2e914: fa ce rjmp .-524 ; 0x2e70a if (!vol_->cacheFlush()) goto fail; 2e916: 0f 94 e6 36 call 0x26dcc ; 0x26dcc 2e91a: 88 23 and r24, r24 2e91c: 09 f4 brne .+2 ; 0x2e920 2e91e: f5 ce rjmp .-534 ; 0x2e70a block = vol_->clusterStartBlock(curCluster_); 2e920: d7 01 movw r26, r14 2e922: 59 96 adiw r26, 0x19 ; 25 2e924: ed 91 ld r30, X+ 2e926: fc 91 ld r31, X 2e928: 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_);} 2e92a: 14 96 adiw r26, 0x04 ; 4 2e92c: 4d 90 ld r4, X+ 2e92e: 5d 90 ld r5, X+ 2e930: 6d 90 ld r6, X+ 2e932: 7c 90 ld r7, X 2e934: 17 97 sbiw r26, 0x07 ; 7 2e936: b2 e0 ldi r27, 0x02 ; 2 2e938: 4b 1a sub r4, r27 2e93a: 51 08 sbc r5, r1 2e93c: 61 08 sbc r6, r1 2e93e: 71 08 sbc r7, r1 2e940: 85 85 ldd r24, Z+13 ; 0x0d 2e942: 04 c0 rjmp .+8 ; 0x2e94c 2e944: 44 0c add r4, r4 2e946: 55 1c adc r5, r5 2e948: 66 1c adc r6, r6 2e94a: 77 1c adc r7, r7 2e94c: 8a 95 dec r24 2e94e: d2 f7 brpl .-12 ; 0x2e944 2e950: 86 85 ldd r24, Z+14 ; 0x0e 2e952: 97 85 ldd r25, Z+15 ; 0x0f 2e954: a0 89 ldd r26, Z+16 ; 0x10 2e956: b1 89 ldd r27, Z+17 ; 0x11 2e958: 48 0e add r4, r24 2e95a: 59 1e adc r5, r25 2e95c: 6a 1e adc r6, r26 2e95e: 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; 2e960: 81 e0 ldi r24, 0x01 ; 1 2e962: 80 93 d5 0d sts 0x0DD5, r24 ; 0x800dd5 cacheBlockNumber_ = blockNumber; 2e966: 40 92 cd 0d sts 0x0DCD, r4 ; 0x800dcd 2e96a: 50 92 ce 0d sts 0x0DCE, r5 ; 0x800dce 2e96e: 60 92 cf 0d sts 0x0DCF, r6 ; 0x800dcf 2e972: 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); 2e976: e9 ed ldi r30, 0xD9 ; 217 2e978: fd e0 ldi r31, 0x0D ; 13 2e97a: 80 e0 ldi r24, 0x00 ; 0 2e97c: 92 e0 ldi r25, 0x02 ; 2 2e97e: df 01 movw r26, r30 2e980: 9c 01 movw r18, r24 2e982: 1d 92 st X+, r1 2e984: 21 50 subi r18, 0x01 ; 1 2e986: 30 40 sbci r19, 0x00 ; 0 2e988: e1 f7 brne .-8 ; 0x2e982 // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 2e98a: dd 24 eor r13, r13 2e98c: d3 94 inc r13 2e98e: d7 01 movw r26, r14 2e990: 59 96 adiw r26, 0x19 ; 25 2e992: ed 91 ld r30, X+ 2e994: fc 91 ld r31, X 2e996: 84 81 ldd r24, Z+4 ; 0x04 2e998: d8 16 cp r13, r24 2e99a: 98 f4 brcc .+38 ; 0x2e9c2 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); 2e99c: 29 ed ldi r18, 0xD9 ; 217 2e99e: 3d e0 ldi r19, 0x0D ; 13 2e9a0: b3 01 movw r22, r6 2e9a2: a2 01 movw r20, r4 2e9a4: 4d 0d add r20, r13 2e9a6: 51 1d adc r21, r1 2e9a8: 61 1d adc r22, r1 2e9aa: 71 1d adc r23, r1 2e9ac: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 2e9b0: 90 91 d7 0d lds r25, 0x0DD7 ; 0x800dd7 2e9b4: 0f 94 0e 71 call 0x2e21c ; 0x2e21c if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; 2e9b8: 88 23 and r24, r24 2e9ba: 09 f4 brne .+2 ; 0x2e9be 2e9bc: a6 ce rjmp .-692 ; 0x2e70a // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 2e9be: d3 94 inc r13 2e9c0: e6 cf rjmp .-52 ; 0x2e98e if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; } // Increase directory file size by cluster size fileSize_ += 512UL << vol_->clusterSizeShift_; 2e9c2: 25 85 ldd r18, Z+13 ; 0x0d 2e9c4: 80 e0 ldi r24, 0x00 ; 0 2e9c6: 92 e0 ldi r25, 0x02 ; 2 2e9c8: a0 e0 ldi r26, 0x00 ; 0 2e9ca: b0 e0 ldi r27, 0x00 ; 0 2e9cc: 04 c0 rjmp .+8 ; 0x2e9d6 2e9ce: 88 0f add r24, r24 2e9d0: 99 1f adc r25, r25 2e9d2: aa 1f adc r26, r26 2e9d4: bb 1f adc r27, r27 2e9d6: 2a 95 dec r18 2e9d8: d2 f7 brpl .-12 ; 0x2e9ce 2e9da: f7 01 movw r30, r14 2e9dc: 41 89 ldd r20, Z+17 ; 0x11 2e9de: 52 89 ldd r21, Z+18 ; 0x12 2e9e0: 63 89 ldd r22, Z+19 ; 0x13 2e9e2: 74 89 ldd r23, Z+20 ; 0x14 2e9e4: 84 0f add r24, r20 2e9e6: 95 1f adc r25, r21 2e9e8: a6 1f adc r26, r22 2e9ea: b7 1f adc r27, r23 2e9ec: 81 8b std Z+17, r24 ; 0x11 2e9ee: 92 8b std Z+18, r25 ; 0x12 2e9f0: a3 8b std Z+19, r26 ; 0x13 2e9f2: 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; 2e9f4: 89 ed ldi r24, 0xD9 ; 217 2e9f6: 9d e0 ldi r25, 0x0D ; 13 index = 0; 2e9f8: d1 2c mov r13, r1 2e9fa: db ce rjmp .-586 ; 0x2e7b2 // 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)) { 2e9fc: 20 31 cpi r18, 0x10 ; 16 2e9fe: 61 f4 brne .+24 ; 0x2ea18 if (!vol_->chainSize(firstCluster_, &fileSize_)) goto fail; 2ea00: 98 01 movw r18, r16 2ea02: 2f 5e subi r18, 0xEF ; 239 2ea04: 3f 4f sbci r19, 0xFF ; 255 2ea06: 0f 94 77 38 call 0x270ee ; 0x270ee 2ea0a: 88 23 and r24, r24 2ea0c: 29 f0 breq .+10 ; 0x2ea18 type_ = FAT_FILE_TYPE_SUBDIR; 2ea0e: 84 e0 ldi r24, 0x04 ; 4 2ea10: d8 01 movw r26, r16 2ea12: 13 96 adiw r26, 0x03 ; 3 2ea14: 8c 93 st X, r24 2ea16: 44 cf rjmp .-376 ; 0x2e8a0 curPosition_ = 0; if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; 2ea18: d8 01 movw r26, r16 2ea1a: 13 96 adiw r26, 0x03 ; 3 2ea1c: 1c 92 st X, r1 2ea1e: 75 ce rjmp .-790 ; 0x2e70a 0002ea20 : } #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; } 2ea20: 20 91 cb 11 lds r18, 0x11CB ; 0x8011cb 2ea24: 30 91 cc 11 lds r19, 0x11CC ; 0x8011cc 2ea28: bc 01 movw r22, r24 2ea2a: c9 01 movw r24, r18 2ea2c: 8f 51 subi r24, 0x1F ; 31 2ea2e: 90 4f sbci r25, 0xF0 ; 240 2ea30: 0f 94 a2 9e call 0x33d44 ; 0x33d44 2ea34: 9c 01 movw r18, r24 2ea36: 90 93 f6 16 sts 0x16F6, r25 ; 0x8016f6 2ea3a: 80 93 f5 16 sts 0x16F5, r24 ; 0x8016f5 2ea3e: 81 e0 ldi r24, 0x01 ; 1 2ea40: 23 2b or r18, r19 2ea42: 09 f4 brne .+2 ; 0x2ea46 2ea44: 80 e0 ldi r24, 0x00 ; 0 2ea46: 08 95 ret 0002ea48 : } } uint16_t planner_calc_sd_length() { uint8_t _block_buffer_head = block_buffer_head; 2ea48: 60 91 a8 0d lds r22, 0x0DA8 ; 0x800da8 uint8_t _block_buffer_tail = block_buffer_tail; 2ea4c: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 uint16_t sdlen = 0; 2ea50: 30 e0 ldi r19, 0x00 ; 0 2ea52: 20 e0 ldi r18, 0x00 ; 0 while (_block_buffer_head != _block_buffer_tail) { sdlen += block_buffer[_block_buffer_tail].sdlen; 2ea54: 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) 2ea56: 96 17 cp r25, r22 2ea58: 61 f0 breq .+24 ; 0x2ea72 { sdlen += block_buffer[_block_buffer_tail].sdlen; 2ea5a: 89 9f mul r24, r25 2ea5c: f0 01 movw r30, r0 2ea5e: 11 24 eor r1, r1 2ea60: ec 5c subi r30, 0xCC ; 204 2ea62: f8 4f sbci r31, 0xF8 ; 248 2ea64: 40 81 ld r20, Z 2ea66: 51 81 ldd r21, Z+1 ; 0x01 2ea68: 24 0f add r18, r20 2ea6a: 35 1f adc r19, r21 _block_buffer_tail = (_block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 2ea6c: 9f 5f subi r25, 0xFF ; 255 2ea6e: 9f 70 andi r25, 0x0F ; 15 2ea70: f2 cf rjmp .-28 ; 0x2ea56 } return sdlen; } 2ea72: c9 01 movw r24, r18 2ea74: 08 95 ret 0002ea76 : } #endif /* PLANNER_DIAGNOSTICS */ void planner_add_sd_length(uint16_t sdlen) { if (block_buffer_head != block_buffer_tail) { 2ea76: 30 91 a8 0d lds r19, 0x0DA8 ; 0x800da8 2ea7a: 20 91 a9 0d lds r18, 0x0DA9 ; 0x800da9 2ea7e: 32 17 cp r19, r18 2ea80: 91 f0 breq .+36 ; 0x2eaa6 // 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; 2ea82: 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) 2ea86: e1 11 cpse r30, r1 2ea88: 01 c0 rjmp .+2 ; 0x2ea8c block_index = BLOCK_BUFFER_SIZE; 2ea8a: e0 e1 ldi r30, 0x10 ; 16 -- block_index; 2ea8c: 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; 2ea8e: 2e e6 ldi r18, 0x6E ; 110 2ea90: e2 9f mul r30, r18 2ea92: f0 01 movw r30, r0 2ea94: 11 24 eor r1, r1 2ea96: ec 5c subi r30, 0xCC ; 204 2ea98: f8 4f sbci r31, 0xF8 ; 248 2ea9a: 20 81 ld r18, Z 2ea9c: 31 81 ldd r19, Z+1 ; 0x01 2ea9e: 82 0f add r24, r18 2eaa0: 93 1f adc r25, r19 2eaa2: 91 83 std Z+1, r25 ; 0x01 2eaa4: 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. } } 2eaa6: 08 95 ret 0002eaa8 : } #endif //PREVENT_DANGEROUS_EXTRUDE // Calculate the steps/s^2 acceleration rates, based on the mm/s^s void reset_acceleration_rates() { 2eaa8: cf 92 push r12 2eaaa: df 92 push r13 2eaac: ef 92 push r14 2eaae: ff 92 push r15 2eab0: 0f 93 push r16 2eab2: 1f 93 push r17 2eab4: cf 93 push r28 2eab6: df 93 push r29 2eab8: 06 e3 ldi r16, 0x36 ; 54 2eaba: 14 e0 ldi r17, 0x04 ; 4 2eabc: c5 ee ldi r28, 0xE5 ; 229 2eabe: d6 e1 ldi r29, 0x16 ; 22 2eac0: 85 ef ldi r24, 0xF5 ; 245 2eac2: c8 2e mov r12, r24 2eac4: 86 e1 ldi r24, 0x16 ; 22 2eac6: d8 2e mov r13, r24 2eac8: 78 01 movw r14, r16 2eaca: 0c 5f subi r16, 0xFC ; 252 2eacc: 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]; 2eace: f7 01 movw r30, r14 2ead0: 60 a1 ldd r22, Z+32 ; 0x20 2ead2: 71 a1 ldd r23, Z+33 ; 0x21 2ead4: 82 a1 ldd r24, Z+34 ; 0x22 2ead6: 93 a1 ldd r25, Z+35 ; 0x23 2ead8: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 2eadc: f7 01 movw r30, r14 2eade: 20 81 ld r18, Z 2eae0: 31 81 ldd r19, Z+1 ; 0x01 2eae2: 42 81 ldd r20, Z+2 ; 0x02 2eae4: 53 81 ldd r21, Z+3 ; 0x03 2eae6: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2eaea: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 2eaee: 69 93 st Y+, r22 2eaf0: 79 93 st Y+, r23 2eaf2: 89 93 st Y+, r24 2eaf4: 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++) 2eaf6: cc 16 cp r12, r28 2eaf8: dd 06 cpc r13, r29 2eafa: 31 f7 brne .-52 ; 0x2eac8 max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * cs.axis_steps_per_mm[i]; } 2eafc: df 91 pop r29 2eafe: cf 91 pop r28 2eb00: 1f 91 pop r17 2eb02: 0f 91 pop r16 2eb04: ff 90 pop r15 2eb06: ef 90 pop r14 2eb08: df 90 pop r13 2eb0a: cf 90 pop r12 2eb0c: 08 95 ret 0002eb0e : } void plan_set_e_position(const float &e) { #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 2eb0e: fc 01 movw r30, r24 2eb10: 40 81 ld r20, Z 2eb12: 51 81 ldd r21, Z+1 ; 0x01 2eb14: 62 81 ldd r22, Z+2 ; 0x02 2eb16: 73 81 ldd r23, Z+3 ; 0x03 2eb18: 40 93 10 04 sts 0x0410, r20 ; 0x800410 2eb1c: 50 93 11 04 sts 0x0411, r21 ; 0x800411 2eb20: 60 93 12 04 sts 0x0412, r22 ; 0x800412 2eb24: 70 93 13 04 sts 0x0413, r23 ; 0x800413 #endif position[E_AXIS] = lround(e*cs.axis_steps_per_mm[E_AXIS]); 2eb28: 20 91 42 04 lds r18, 0x0442 ; 0x800442 2eb2c: 30 91 43 04 lds r19, 0x0443 ; 0x800443 2eb30: 40 91 44 04 lds r20, 0x0444 ; 0x800444 2eb34: 50 91 45 04 lds r21, 0x0445 ; 0x800445 2eb38: 60 81 ld r22, Z 2eb3a: 71 81 ldd r23, Z+1 ; 0x01 2eb3c: 82 81 ldd r24, Z+2 ; 0x02 2eb3e: 93 81 ldd r25, Z+3 ; 0x03 2eb40: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2eb44: 0f 94 00 a5 call 0x34a00 ; 0x34a00 2eb48: e6 ea ldi r30, 0xA6 ; 166 2eb4a: f6 e0 ldi r31, 0x06 ; 6 2eb4c: 64 87 std Z+12, r22 ; 0x0c 2eb4e: 75 87 std Z+13, r23 ; 0x0d 2eb50: 86 87 std Z+14, r24 ; 0x0e 2eb52: 97 87 std Z+15, r25 ; 0x0f CRITICAL_SECTION_END; } void st_set_e_position(const long &e) { CRITICAL_SECTION_START; 2eb54: 8f b7 in r24, 0x3f ; 63 2eb56: f8 94 cli count_position[E_AXIS] = e; 2eb58: 44 85 ldd r20, Z+12 ; 0x0c 2eb5a: 55 85 ldd r21, Z+13 ; 0x0d 2eb5c: 66 85 ldd r22, Z+14 ; 0x0e 2eb5e: 77 85 ldd r23, Z+15 ; 0x0f 2eb60: 40 93 c2 06 sts 0x06C2, r20 ; 0x8006c2 2eb64: 50 93 c3 06 sts 0x06C3, r21 ; 0x8006c3 2eb68: 60 93 c4 06 sts 0x06C4, r22 ; 0x8006c4 2eb6c: 70 93 c5 06 sts 0x06C5, r23 ; 0x8006c5 CRITICAL_SECTION_END; 2eb70: 8f bf out 0x3f, r24 ; 63 st_set_e_position(position[E_AXIS]); } 2eb72: 08 95 ret 0002eb74 : // 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; 2eb74: fc 01 movw r30, r24 2eb76: 40 81 ld r20, Z 2eb78: 51 81 ldd r21, Z+1 ; 0x01 2eb7a: 62 81 ldd r22, Z+2 ; 0x02 2eb7c: 73 81 ldd r23, Z+3 ; 0x03 2eb7e: 40 93 0c 04 sts 0x040C, r20 ; 0x80040c 2eb82: 50 93 0d 04 sts 0x040D, r21 ; 0x80040d 2eb86: 60 93 0e 04 sts 0x040E, r22 ; 0x80040e 2eb8a: 70 93 0f 04 sts 0x040F, r23 ; 0x80040f #endif position[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 2eb8e: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 2eb92: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 2eb96: 40 91 40 04 lds r20, 0x0440 ; 0x800440 2eb9a: 50 91 41 04 lds r21, 0x0441 ; 0x800441 2eb9e: 60 81 ld r22, Z 2eba0: 71 81 ldd r23, Z+1 ; 0x01 2eba2: 82 81 ldd r24, Z+2 ; 0x02 2eba4: 93 81 ldd r25, Z+3 ; 0x03 2eba6: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2ebaa: 0f 94 00 a5 call 0x34a00 ; 0x34a00 2ebae: 60 93 ae 06 sts 0x06AE, r22 ; 0x8006ae 2ebb2: 70 93 af 06 sts 0x06AF, r23 ; 0x8006af 2ebb6: 80 93 b0 06 sts 0x06B0, r24 ; 0x8006b0 2ebba: 90 93 b1 06 sts 0x06B1, r25 ; 0x8006b1 st_set_position(position); 2ebbe: 0d 94 32 54 jmp 0x2a864 ; 0x2a864 0002ebc2 : // 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) { 2ebc2: 2f 92 push r2 2ebc4: 3f 92 push r3 2ebc6: 4f 92 push r4 2ebc8: 5f 92 push r5 2ebca: 6f 92 push r6 2ebcc: 7f 92 push r7 2ebce: 8f 92 push r8 2ebd0: 9f 92 push r9 2ebd2: af 92 push r10 2ebd4: bf 92 push r11 2ebd6: cf 92 push r12 2ebd8: df 92 push r13 2ebda: ef 92 push r14 2ebdc: ff 92 push r15 2ebde: 0f 93 push r16 2ebe0: 1f 93 push r17 2ebe2: cf 93 push r28 2ebe4: df 93 push r29 2ebe6: cd b7 in r28, 0x3d ; 61 2ebe8: de b7 in r29, 0x3e ; 62 2ebea: c4 58 subi r28, 0x84 ; 132 2ebec: d1 09 sbc r29, r1 2ebee: 0f b6 in r0, 0x3f ; 63 2ebf0: f8 94 cli 2ebf2: de bf out 0x3e, r29 ; 62 2ebf4: 0f be out 0x3f, r0 ; 63 2ebf6: cd bf out 0x3d, r28 ; 61 2ebf8: 69 a3 std Y+33, r22 ; 0x21 2ebfa: 7a a3 std Y+34, r23 ; 0x22 2ebfc: 8b a3 std Y+35, r24 ; 0x23 2ebfe: 9c a3 std Y+36, r25 ; 0x24 2ec00: 2d a3 std Y+37, r18 ; 0x25 2ec02: 3e a3 std Y+38, r19 ; 0x26 2ec04: 4f a3 std Y+39, r20 ; 0x27 2ec06: 58 a7 std Y+40, r21 ; 0x28 2ec08: a7 96 adiw r28, 0x27 ; 39 2ec0a: ec ae std Y+60, r14 ; 0x3c 2ec0c: fd ae std Y+61, r15 ; 0x3d 2ec0e: 0e af std Y+62, r16 ; 0x3e 2ec10: 1f af std Y+63, r17 ; 0x3f 2ec12: a7 97 sbiw r28, 0x27 ; 39 2ec14: a9 96 adiw r28, 0x29 ; 41 2ec16: df ae std Y+63, r13 ; 0x3f 2ec18: ce ae std Y+62, r12 ; 0x3e 2ec1a: a9 97 sbiw r28, 0x29 ; 41 2ec1c: 89 ae std Y+57, r8 ; 0x39 2ec1e: 99 aa std Y+49, r9 ; 0x31 2ec20: ad ae std Y+61, r10 ; 0x3d 2ec22: bd aa std Y+53, r11 ; 0x35 2ec24: c6 56 subi r28, 0x66 ; 102 2ec26: df 4f sbci r29, 0xFF ; 255 2ec28: 08 81 ld r16, Y 2ec2a: 19 81 ldd r17, Y+1 ; 0x01 2ec2c: ca 59 subi r28, 0x9A ; 154 2ec2e: 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); 2ec30: 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) 2ec34: 8f 5f subi r24, 0xFF ; 255 2ec36: a0 96 adiw r28, 0x20 ; 32 2ec38: 8f af std Y+63, r24 ; 0x3f 2ec3a: a0 97 sbiw r28, 0x20 ; 32 2ec3c: 80 31 cpi r24, 0x10 ; 16 2ec3e: 19 f4 brne .+6 ; 0x2ec46 block_index = 0; 2ec40: a0 96 adiw r28, 0x20 ; 32 2ec42: 1f ae std Y+63, r1 ; 0x3f 2ec44: 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) { 2ec46: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 2ec4a: a0 96 adiw r28, 0x20 ; 32 2ec4c: 2f ad ldd r18, Y+63 ; 0x3f 2ec4e: a0 97 sbiw r28, 0x20 ; 32 2ec50: 82 13 cpse r24, r18 2ec52: 0f c0 rjmp .+30 ; 0x2ec72 do { manage_heater(); 2ec54: 0f 94 13 33 call 0x26626 ; 0x26626 // Vojtech: Don't disable motors inside the planner! manage_inactivity(false); 2ec58: 80 e0 ldi r24, 0x00 ; 0 2ec5a: 0e 94 fe 79 call 0xf3fc ; 0xf3fc lcd_update(0); 2ec5e: 80 e0 ldi r24, 0x00 ; 0 2ec60: 0e 94 38 69 call 0xd270 ; 0xd270 } while (block_buffer_tail == next_buffer_head); 2ec64: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 2ec68: a0 96 adiw r28, 0x20 ; 32 2ec6a: 3f ad ldd r19, Y+63 ; 0x3f 2ec6c: a0 97 sbiw r28, 0x20 ; 32 2ec6e: 83 17 cp r24, r19 2ec70: 89 f3 breq .-30 ; 0x2ec54 } #ifdef PLANNER_DIAGNOSTICS planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ if(planner_aborted) { 2ec72: 40 91 ac 0d lds r20, 0x0DAC ; 0x800dac 2ec76: a1 96 adiw r28, 0x21 ; 33 2ec78: 4f af std Y+63, r20 ; 0x3f 2ec7a: a1 97 sbiw r28, 0x21 ; 33 2ec7c: 44 23 and r20, r20 2ec7e: 11 f1 breq .+68 ; 0x2ecc4 // avoid planning the block early if aborted SERIAL_ECHO_START; 2ec80: 81 e6 ldi r24, 0x61 ; 97 2ec82: 9d e9 ldi r25, 0x9D ; 157 2ec84: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLNRPGM(_n("Move aborted")); 2ec88: 87 e7 ldi r24, 0x77 ; 119 2ec8a: 9c e6 ldi r25, 0x6C ; 108 2ec8c: 0e 94 49 72 call 0xe492 ; 0xe492 // 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(); } 2ec90: cc 57 subi r28, 0x7C ; 124 2ec92: df 4f sbci r29, 0xFF ; 255 2ec94: 0f b6 in r0, 0x3f ; 63 2ec96: f8 94 cli 2ec98: de bf out 0x3e, r29 ; 62 2ec9a: 0f be out 0x3f, r0 ; 63 2ec9c: cd bf out 0x3d, r28 ; 61 2ec9e: df 91 pop r29 2eca0: cf 91 pop r28 2eca2: 1f 91 pop r17 2eca4: 0f 91 pop r16 2eca6: ff 90 pop r15 2eca8: ef 90 pop r14 2ecaa: df 90 pop r13 2ecac: cf 90 pop r12 2ecae: bf 90 pop r11 2ecb0: af 90 pop r10 2ecb2: 9f 90 pop r9 2ecb4: 8f 90 pop r8 2ecb6: 7f 90 pop r7 2ecb8: 6f 90 pop r6 2ecba: 5f 90 pop r5 2ecbc: 4f 90 pop r4 2ecbe: 3f 90 pop r3 2ecc0: 2f 90 pop r2 2ecc2: 08 95 ret SERIAL_ECHOLNRPGM(_n("Move aborted")); return; } // Prepare to set up new block block_t *block = &block_buffer[block_buffer_head]; 2ecc4: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 2ecc8: 29 2e mov r2, r25 2ecca: 31 2c mov r3, r1 2eccc: 8e e6 ldi r24, 0x6E ; 110 2ecce: 98 9f mul r25, r24 2ecd0: d0 01 movw r26, r0 2ecd2: 11 24 eor r1, r1 2ecd4: a3 96 adiw r28, 0x23 ; 35 2ecd6: bf af std Y+63, r27 ; 0x3f 2ecd8: ae af std Y+62, r26 ; 0x3e 2ecda: 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; 2ecdc: cd 01 movw r24, r26 2ecde: 88 53 subi r24, 0x38 ; 56 2ece0: 99 4f sbci r25, 0xF9 ; 249 2ece2: fc 01 movw r30, r24 2ece4: e9 5b subi r30, 0xB9 ; 185 2ece6: ff 4f sbci r31, 0xFF ; 255 2ece8: 10 82 st Z, r1 // Set sdlen for calculating sd position block->sdlen = 0; 2ecea: 84 59 subi r24, 0x94 ; 148 2ecec: 9f 4f sbci r25, 0xFF ; 255 2ecee: fc 01 movw r30, r24 2ecf0: 11 82 std Z+1, r1 ; 0x01 2ecf2: 10 82 st Z, r1 // Save original start position of the move if (gcode_start_position) 2ecf4: 01 15 cp r16, r1 2ecf6: 11 05 cpc r17, r1 2ecf8: 11 f4 brne .+4 ; 0x2ecfe 2ecfa: 0d 94 ce 80 jmp 0x3019c ; 0x3019c memcpy(block->gcode_start_position, gcode_start_position, sizeof(block_t::gcode_start_position)); 2ecfe: 80 e1 ldi r24, 0x10 ; 16 2ed00: f8 01 movw r30, r16 2ed02: a0 5e subi r26, 0xE0 ; 224 2ed04: b8 4f sbci r27, 0xF8 ; 248 else memcpy(block->gcode_start_position, current_position, sizeof(block_t::gcode_start_position)); 2ed06: 01 90 ld r0, Z+ 2ed08: 0d 92 st X+, r0 2ed0a: 8a 95 dec r24 2ed0c: e1 f7 brne .-8 ; 0x2ed06 // Save the index of this segment (when a single G0/1/2/3 command plans multiple segments) block->segment_idx = segment_idx; 2ed0e: 8e e6 ldi r24, 0x6E ; 110 2ed10: 82 9d mul r24, r2 2ed12: 80 01 movw r16, r0 2ed14: 83 9d mul r24, r3 2ed16: 10 0d add r17, r0 2ed18: 11 24 eor r1, r1 2ed1a: 08 53 subi r16, 0x38 ; 56 2ed1c: 19 4f sbci r17, 0xF9 ; 249 2ed1e: f8 01 movw r30, r16 2ed20: e8 59 subi r30, 0x98 ; 152 2ed22: ff 4f sbci r31, 0xFF ; 255 2ed24: c4 56 subi r28, 0x64 ; 100 2ed26: df 4f sbci r29, 0xFF ; 255 2ed28: 88 81 ld r24, Y 2ed2a: 99 81 ldd r25, Y+1 ; 0x01 2ed2c: cc 59 subi r28, 0x9C ; 156 2ed2e: d0 40 sbci r29, 0x00 ; 0 2ed30: 91 83 std Z+1, r25 ; 0x01 2ed32: 80 83 st Z, r24 // Save the global feedrate at scheduling time block->gcode_feedrate = feedrate; 2ed34: 06 59 subi r16, 0x96 ; 150 2ed36: 1f 4f sbci r17, 0xFF ; 255 2ed38: 60 91 7a 02 lds r22, 0x027A ; 0x80027a 2ed3c: 70 91 7b 02 lds r23, 0x027B ; 0x80027b 2ed40: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 2ed44: 90 91 7d 02 lds r25, 0x027D ; 0x80027d 2ed48: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 2ed4c: d8 01 movw r26, r16 2ed4e: 6d 93 st X+, r22 2ed50: 7c 93 st X, r23 // Reset the starting E position when requested if (plan_reset_next_e_queue) 2ed52: 80 91 ef 03 lds r24, 0x03EF ; 0x8003ef <_ZL23plan_reset_next_e_queue.lto_priv.448> 2ed56: 88 23 and r24, r24 2ed58: a9 f0 breq .+42 ; 0x2ed84 { position[E_AXIS] = 0; 2ed5a: 10 92 b2 06 sts 0x06B2, r1 ; 0x8006b2 2ed5e: 10 92 b3 06 sts 0x06B3, r1 ; 0x8006b3 2ed62: 10 92 b4 06 sts 0x06B4, r1 ; 0x8006b4 2ed66: 10 92 b5 06 sts 0x06B5, r1 ; 0x8006b5 #ifdef LIN_ADVANCE position_float[E_AXIS] = 0; 2ed6a: 10 92 10 04 sts 0x0410, r1 ; 0x800410 2ed6e: 10 92 11 04 sts 0x0411, r1 ; 0x800411 2ed72: 10 92 12 04 sts 0x0412, r1 ; 0x800412 2ed76: 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; 2ed7a: 10 92 ef 03 sts 0x03EF, r1 ; 0x8003ef <_ZL23plan_reset_next_e_queue.lto_priv.448> plan_reset_next_e_sched = true; 2ed7e: 81 e0 ldi r24, 0x01 ; 1 2ed80: 80 93 ee 03 sts 0x03EE, r24 ; 0x8003ee <_ZL23plan_reset_next_e_sched.lto_priv.449> } // Apply the machine correction matrix. world2machine(x, y); 2ed84: be 01 movw r22, r28 2ed86: 6b 5d subi r22, 0xDB ; 219 2ed88: 7f 4f sbci r23, 0xFF ; 255 2ed8a: ce 01 movw r24, r28 2ed8c: 81 96 adiw r24, 0x21 ; 33 2ed8e: 0e 94 f4 62 call 0xc5e8 ; 0xc5e8 // 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]); 2ed92: c9 a0 ldd r12, Y+33 ; 0x21 2ed94: da a0 ldd r13, Y+34 ; 0x22 2ed96: eb a0 ldd r14, Y+35 ; 0x23 2ed98: fc a0 ldd r15, Y+36 ; 0x24 2ed9a: 20 91 36 04 lds r18, 0x0436 ; 0x800436 2ed9e: 30 91 37 04 lds r19, 0x0437 ; 0x800437 2eda2: 40 91 38 04 lds r20, 0x0438 ; 0x800438 2eda6: 50 91 39 04 lds r21, 0x0439 ; 0x800439 2edaa: c7 01 movw r24, r14 2edac: b6 01 movw r22, r12 2edae: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2edb2: 0f 94 00 a5 call 0x34a00 ; 0x34a00 2edb6: c3 58 subi r28, 0x83 ; 131 2edb8: df 4f sbci r29, 0xFF ; 255 2edba: 68 83 st Y, r22 2edbc: 79 83 std Y+1, r23 ; 0x01 2edbe: 8a 83 std Y+2, r24 ; 0x02 2edc0: 9b 83 std Y+3, r25 ; 0x03 2edc2: cd 57 subi r28, 0x7D ; 125 2edc4: d0 40 sbci r29, 0x00 ; 0 target[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 2edc6: 8d a0 ldd r8, Y+37 ; 0x25 2edc8: 9e a0 ldd r9, Y+38 ; 0x26 2edca: af a0 ldd r10, Y+39 ; 0x27 2edcc: b8 a4 ldd r11, Y+40 ; 0x28 2edce: 20 91 3a 04 lds r18, 0x043A ; 0x80043a 2edd2: 30 91 3b 04 lds r19, 0x043B ; 0x80043b 2edd6: 40 91 3c 04 lds r20, 0x043C ; 0x80043c 2edda: 50 91 3d 04 lds r21, 0x043D ; 0x80043d 2edde: c5 01 movw r24, r10 2ede0: b4 01 movw r22, r8 2ede2: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2ede6: 0f 94 00 a5 call 0x34a00 ; 0x34a00 2edea: cf 57 subi r28, 0x7F ; 127 2edec: df 4f sbci r29, 0xFF ; 255 2edee: 68 83 st Y, r22 2edf0: 79 83 std Y+1, r23 ; 0x01 2edf2: 8a 83 std Y+2, r24 ; 0x02 2edf4: 9b 83 std Y+3, r25 ; 0x03 2edf6: c1 58 subi r28, 0x81 ; 129 2edf8: d0 40 sbci r29, 0x00 ; 0 #ifdef MESH_BED_LEVELING if (mbl.active){ 2edfa: 80 91 9c 12 lds r24, 0x129C ; 0x80129c 2edfe: 88 23 and r24, r24 2ee00: 11 f4 brne .+4 ; 0x2ee06 2ee02: 0d 94 d5 80 jmp 0x301aa ; 0x301aa target[Z_AXIS] = lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]); 2ee06: a5 01 movw r20, r10 2ee08: 94 01 movw r18, r8 2ee0a: c7 01 movw r24, r14 2ee0c: b6 01 movw r22, r12 2ee0e: 0f 94 c7 60 call 0x2c18e ; 0x2c18e 2ee12: a7 96 adiw r28, 0x27 ; 39 2ee14: 2c ad ldd r18, Y+60 ; 0x3c 2ee16: 3d ad ldd r19, Y+61 ; 0x3d 2ee18: 4e ad ldd r20, Y+62 ; 0x3e 2ee1a: 5f ad ldd r21, Y+63 ; 0x3f 2ee1c: a7 97 sbiw r28, 0x27 ; 39 2ee1e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2ee22: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 2ee26: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 2ee2a: 40 91 40 04 lds r20, 0x0440 ; 0x800440 2ee2e: 50 91 41 04 lds r21, 0x0441 ; 0x800441 }else{ target[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 2ee32: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2ee36: 0f 94 00 a5 call 0x34a00 ; 0x34a00 2ee3a: e5 96 adiw r28, 0x35 ; 53 2ee3c: 6c af std Y+60, r22 ; 0x3c 2ee3e: 7d af std Y+61, r23 ; 0x3d 2ee40: 8e af std Y+62, r24 ; 0x3e 2ee42: 9f af std Y+63, r25 ; 0x3f 2ee44: 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]); 2ee46: a9 96 adiw r28, 0x29 ; 41 2ee48: ee ad ldd r30, Y+62 ; 0x3e 2ee4a: ff ad ldd r31, Y+63 ; 0x3f 2ee4c: a9 97 sbiw r28, 0x29 ; 41 2ee4e: 80 80 ld r8, Z 2ee50: 91 80 ldd r9, Z+1 ; 0x01 2ee52: a2 80 ldd r10, Z+2 ; 0x02 2ee54: b3 80 ldd r11, Z+3 ; 0x03 2ee56: 20 91 42 04 lds r18, 0x0442 ; 0x800442 2ee5a: 30 91 43 04 lds r19, 0x0443 ; 0x800443 2ee5e: 40 91 44 04 lds r20, 0x0444 ; 0x800444 2ee62: 50 91 45 04 lds r21, 0x0445 ; 0x800445 2ee66: c5 01 movw r24, r10 2ee68: b4 01 movw r22, r8 2ee6a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2ee6e: 0f 94 00 a5 call 0x34a00 ; 0x34a00 2ee72: ad 96 adiw r28, 0x2d ; 45 2ee74: 6c af std Y+60, r22 ; 0x3c 2ee76: 7d af std Y+61, r23 ; 0x3d 2ee78: 8e af std Y+62, r24 ; 0x3e 2ee7a: 9f af std Y+63, r25 ; 0x3f 2ee7c: 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]; 2ee7e: 80 91 b2 06 lds r24, 0x06B2 ; 0x8006b2 2ee82: 90 91 b3 06 lds r25, 0x06B3 ; 0x8006b3 2ee86: a0 91 b4 06 lds r26, 0x06B4 ; 0x8006b4 2ee8a: b0 91 b5 06 lds r27, 0x06B5 ; 0x8006b5 2ee8e: ad 96 adiw r28, 0x2d ; 45 2ee90: 4c ac ldd r4, Y+60 ; 0x3c 2ee92: 5d ac ldd r5, Y+61 ; 0x3d 2ee94: 6e ac ldd r6, Y+62 ; 0x3e 2ee96: 7f ac ldd r7, Y+63 ; 0x3f 2ee98: ad 97 sbiw r28, 0x2d ; 45 2ee9a: 48 1a sub r4, r24 2ee9c: 59 0a sbc r5, r25 2ee9e: 6a 0a sbc r6, r26 2eea0: 7b 0a sbc r7, r27 int32_t dx = target[X_AXIS] - position[X_AXIS]; 2eea2: 80 91 a6 06 lds r24, 0x06A6 ; 0x8006a6 2eea6: 90 91 a7 06 lds r25, 0x06A7 ; 0x8006a7 2eeaa: a0 91 a8 06 lds r26, 0x06A8 ; 0x8006a8 2eeae: b0 91 a9 06 lds r27, 0x06A9 ; 0x8006a9 2eeb2: c3 58 subi r28, 0x83 ; 131 2eeb4: df 4f sbci r29, 0xFF ; 255 2eeb6: c8 80 ld r12, Y 2eeb8: d9 80 ldd r13, Y+1 ; 0x01 2eeba: ea 80 ldd r14, Y+2 ; 0x02 2eebc: fb 80 ldd r15, Y+3 ; 0x03 2eebe: cd 57 subi r28, 0x7D ; 125 2eec0: d0 40 sbci r29, 0x00 ; 0 2eec2: c8 1a sub r12, r24 2eec4: d9 0a sbc r13, r25 2eec6: ea 0a sbc r14, r26 2eec8: fb 0a sbc r15, r27 int32_t dy = target[Y_AXIS] - position[Y_AXIS]; 2eeca: 80 91 aa 06 lds r24, 0x06AA ; 0x8006aa 2eece: 90 91 ab 06 lds r25, 0x06AB ; 0x8006ab 2eed2: a0 91 ac 06 lds r26, 0x06AC ; 0x8006ac 2eed6: b0 91 ad 06 lds r27, 0x06AD ; 0x8006ad 2eeda: cf 57 subi r28, 0x7F ; 127 2eedc: df 4f sbci r29, 0xFF ; 255 2eede: 28 81 ld r18, Y 2eee0: 39 81 ldd r19, Y+1 ; 0x01 2eee2: 4a 81 ldd r20, Y+2 ; 0x02 2eee4: 5b 81 ldd r21, Y+3 ; 0x03 2eee6: c1 58 subi r28, 0x81 ; 129 2eee8: d0 40 sbci r29, 0x00 ; 0 2eeea: 28 1b sub r18, r24 2eeec: 39 0b sbc r19, r25 2eeee: 4a 0b sbc r20, r26 2eef0: 5b 0b sbc r21, r27 2eef2: 29 a7 std Y+41, r18 ; 0x29 2eef4: 3a a7 std Y+42, r19 ; 0x2a 2eef6: 4b a7 std Y+43, r20 ; 0x2b 2eef8: 5c a7 std Y+44, r21 ; 0x2c int32_t dz = target[Z_AXIS] - position[Z_AXIS]; 2eefa: 80 91 ae 06 lds r24, 0x06AE ; 0x8006ae 2eefe: 90 91 af 06 lds r25, 0x06AF ; 0x8006af 2ef02: a0 91 b0 06 lds r26, 0x06B0 ; 0x8006b0 2ef06: b0 91 b1 06 lds r27, 0x06B1 ; 0x8006b1 2ef0a: e5 96 adiw r28, 0x35 ; 53 2ef0c: 2c ad ldd r18, Y+60 ; 0x3c 2ef0e: 3d ad ldd r19, Y+61 ; 0x3d 2ef10: 4e ad ldd r20, Y+62 ; 0x3e 2ef12: 5f ad ldd r21, Y+63 ; 0x3f 2ef14: e5 97 sbiw r28, 0x35 ; 53 2ef16: 28 1b sub r18, r24 2ef18: 39 0b sbc r19, r25 2ef1a: 4a 0b sbc r20, r26 2ef1c: 5b 0b sbc r21, r27 2ef1e: 2d a7 std Y+45, r18 ; 0x2d 2ef20: 3e a7 std Y+46, r19 ; 0x2e 2ef22: 4f a7 std Y+47, r20 ; 0x2f 2ef24: 58 ab std Y+48, r21 ; 0x30 #ifdef PREVENT_DANGEROUS_EXTRUDE if(de) 2ef26: 41 14 cp r4, r1 2ef28: 51 04 cpc r5, r1 2ef2a: 61 04 cpc r6, r1 2ef2c: 71 04 cpc r7, r1 2ef2e: 09 f4 brne .+2 ; 0x2ef32 2ef30: 80 c0 rjmp .+256 ; 0x2f032 { if((int)degHotend(active_extruder) 2ef36: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 2ef3a: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 2ef3e: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 2ef42: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 2ef46: 20 91 57 02 lds r18, 0x0257 ; 0x800257 2ef4a: 30 91 58 02 lds r19, 0x0258 ; 0x800258 2ef4e: 62 17 cp r22, r18 2ef50: 73 07 cpc r23, r19 2ef52: 0c f5 brge .+66 ; 0x2ef96 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 2ef54: ad 96 adiw r28, 0x2d ; 45 2ef56: 8c ad ldd r24, Y+60 ; 0x3c 2ef58: 9d ad ldd r25, Y+61 ; 0x3d 2ef5a: ae ad ldd r26, Y+62 ; 0x3e 2ef5c: bf ad ldd r27, Y+63 ; 0x3f 2ef5e: ad 97 sbiw r28, 0x2d ; 45 2ef60: 80 93 b2 06 sts 0x06B2, r24 ; 0x8006b2 2ef64: 90 93 b3 06 sts 0x06B3, r25 ; 0x8006b3 2ef68: a0 93 b4 06 sts 0x06B4, r26 ; 0x8006b4 2ef6c: b0 93 b5 06 sts 0x06B5, r27 ; 0x8006b5 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 2ef70: 80 92 10 04 sts 0x0410, r8 ; 0x800410 2ef74: 90 92 11 04 sts 0x0411, r9 ; 0x800411 2ef78: a0 92 12 04 sts 0x0412, r10 ; 0x800412 2ef7c: b0 92 13 04 sts 0x0413, r11 ; 0x800413 #endif de = 0; // no difference SERIAL_ECHO_START; 2ef80: 81 e6 ldi r24, 0x61 ; 97 2ef82: 9d e9 ldi r25, 0x9D ; 157 2ef84: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLNRPGM(_n(" cold extrusion prevented"));////MSG_ERR_COLD_EXTRUDE_STOP 2ef88: 8d e5 ldi r24, 0x5D ; 93 2ef8a: 9c e6 ldi r25, 0x6C ; 108 2ef8c: 0e 94 49 72 call 0xe492 ; 0xe492 { 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 2ef90: 41 2c mov r4, r1 2ef92: 51 2c mov r5, r1 2ef94: 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) 2ef96: c3 01 movw r24, r6 2ef98: b2 01 movw r22, r4 2ef9a: 77 fe sbrs r7, 7 2ef9c: 07 c0 rjmp .+14 ; 0x2efac 2ef9e: 66 27 eor r22, r22 2efa0: 77 27 eor r23, r23 2efa2: cb 01 movw r24, r22 2efa4: 64 19 sub r22, r4 2efa6: 75 09 sbc r23, r5 2efa8: 86 09 sbc r24, r6 2efaa: 97 09 sbc r25, r7 2efac: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2efb0: 4b 01 movw r8, r22 2efb2: 5c 01 movw r10, r24 2efb4: 20 e0 ldi r18, 0x00 ; 0 2efb6: 30 e0 ldi r19, 0x00 ; 0 2efb8: 48 ee ldi r20, 0xE8 ; 232 2efba: 53 e4 ldi r21, 0x43 ; 67 2efbc: 60 91 42 04 lds r22, 0x0442 ; 0x800442 2efc0: 70 91 43 04 lds r23, 0x0443 ; 0x800443 2efc4: 80 91 44 04 lds r24, 0x0444 ; 0x800444 2efc8: 90 91 45 04 lds r25, 0x0445 ; 0x800445 2efcc: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2efd0: 9b 01 movw r18, r22 2efd2: ac 01 movw r20, r24 2efd4: c5 01 movw r24, r10 2efd6: b4 01 movw r22, r8 2efd8: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 2efdc: 18 16 cp r1, r24 2efde: 4c f5 brge .+82 ; 0x2f032 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 2efe0: ad 96 adiw r28, 0x2d ; 45 2efe2: 2c ad ldd r18, Y+60 ; 0x3c 2efe4: 3d ad ldd r19, Y+61 ; 0x3d 2efe6: 4e ad ldd r20, Y+62 ; 0x3e 2efe8: 5f ad ldd r21, Y+63 ; 0x3f 2efea: ad 97 sbiw r28, 0x2d ; 45 2efec: 20 93 b2 06 sts 0x06B2, r18 ; 0x8006b2 2eff0: 30 93 b3 06 sts 0x06B3, r19 ; 0x8006b3 2eff4: 40 93 b4 06 sts 0x06B4, r20 ; 0x8006b4 2eff8: 50 93 b5 06 sts 0x06B5, r21 ; 0x8006b5 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 2effc: a9 96 adiw r28, 0x29 ; 41 2effe: ee ad ldd r30, Y+62 ; 0x3e 2f000: ff ad ldd r31, Y+63 ; 0x3f 2f002: a9 97 sbiw r28, 0x29 ; 41 2f004: 80 81 ld r24, Z 2f006: 91 81 ldd r25, Z+1 ; 0x01 2f008: a2 81 ldd r26, Z+2 ; 0x02 2f00a: b3 81 ldd r27, Z+3 ; 0x03 2f00c: 80 93 10 04 sts 0x0410, r24 ; 0x800410 2f010: 90 93 11 04 sts 0x0411, r25 ; 0x800411 2f014: a0 93 12 04 sts 0x0412, r26 ; 0x800412 2f018: b0 93 13 04 sts 0x0413, r27 ; 0x800413 #endif de = 0; // no difference SERIAL_ECHO_START; 2f01c: 81 e6 ldi r24, 0x61 ; 97 2f01e: 9d e9 ldi r25, 0x9D ; 157 2f020: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLNRPGM(_n(" too long extrusion prevented"));////MSG_ERR_LONG_EXTRUDE_STOP 2f024: 8f e3 ldi r24, 0x3F ; 63 2f026: 9c e6 ldi r25, 0x6C ; 108 2f028: 0e 94 49 72 call 0xe492 ; 0xe492 { 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 2f02c: 41 2c mov r4, r1 2f02e: 51 2c mov r5, r1 2f030: 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); 2f032: 8e e6 ldi r24, 0x6E ; 110 2f034: 82 9d mul r24, r2 2f036: f0 01 movw r30, r0 2f038: 83 9d mul r24, r3 2f03a: f0 0d add r31, r0 2f03c: 11 24 eor r1, r1 2f03e: e8 53 subi r30, 0x38 ; 56 2f040: f9 4f sbci r31, 0xF9 ; 249 2f042: d7 01 movw r26, r14 2f044: c6 01 movw r24, r12 2f046: f7 fe sbrs r15, 7 2f048: 07 c0 rjmp .+14 ; 0x2f058 2f04a: 88 27 eor r24, r24 2f04c: 99 27 eor r25, r25 2f04e: dc 01 movw r26, r24 2f050: 8c 19 sub r24, r12 2f052: 9d 09 sbc r25, r13 2f054: ae 09 sbc r26, r14 2f056: bf 09 sbc r27, r15 2f058: 80 83 st Z, r24 2f05a: 91 83 std Z+1, r25 ; 0x01 2f05c: a2 83 std Z+2, r26 ; 0x02 2f05e: b3 83 std Z+3, r27 ; 0x03 block->steps[Y_AXIS].wide = labs(dy); 2f060: 8e e6 ldi r24, 0x6E ; 110 2f062: 82 9d mul r24, r2 2f064: f0 01 movw r30, r0 2f066: 83 9d mul r24, r3 2f068: f0 0d add r31, r0 2f06a: 11 24 eor r1, r1 2f06c: e8 53 subi r30, 0x38 ; 56 2f06e: f9 4f sbci r31, 0xF9 ; 249 2f070: 89 a5 ldd r24, Y+41 ; 0x29 2f072: 9a a5 ldd r25, Y+42 ; 0x2a 2f074: ab a5 ldd r26, Y+43 ; 0x2b 2f076: bc a5 ldd r27, Y+44 ; 0x2c 2f078: b7 ff sbrs r27, 7 2f07a: 07 c0 rjmp .+14 ; 0x2f08a 2f07c: b0 95 com r27 2f07e: a0 95 com r26 2f080: 90 95 com r25 2f082: 81 95 neg r24 2f084: 9f 4f sbci r25, 0xFF ; 255 2f086: af 4f sbci r26, 0xFF ; 255 2f088: bf 4f sbci r27, 0xFF ; 255 2f08a: 84 83 std Z+4, r24 ; 0x04 2f08c: 95 83 std Z+5, r25 ; 0x05 2f08e: a6 83 std Z+6, r26 ; 0x06 2f090: 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); 2f092: 8e e6 ldi r24, 0x6E ; 110 2f094: 82 9d mul r24, r2 2f096: f0 01 movw r30, r0 2f098: 83 9d mul r24, r3 2f09a: f0 0d add r31, r0 2f09c: 11 24 eor r1, r1 2f09e: e8 53 subi r30, 0x38 ; 56 2f0a0: f9 4f sbci r31, 0xF9 ; 249 2f0a2: 8d a5 ldd r24, Y+45 ; 0x2d 2f0a4: 9e a5 ldd r25, Y+46 ; 0x2e 2f0a6: af a5 ldd r26, Y+47 ; 0x2f 2f0a8: b8 a9 ldd r27, Y+48 ; 0x30 2f0aa: b7 ff sbrs r27, 7 2f0ac: 07 c0 rjmp .+14 ; 0x2f0bc 2f0ae: b0 95 com r27 2f0b0: a0 95 com r26 2f0b2: 90 95 com r25 2f0b4: 81 95 neg r24 2f0b6: 9f 4f sbci r25, 0xFF ; 255 2f0b8: af 4f sbci r26, 0xFF ; 255 2f0ba: bf 4f sbci r27, 0xFF ; 255 2f0bc: 80 87 std Z+8, r24 ; 0x08 2f0be: 91 87 std Z+9, r25 ; 0x09 2f0c0: a2 87 std Z+10, r26 ; 0x0a 2f0c2: b3 87 std Z+11, r27 ; 0x0b block->steps[E_AXIS].wide = labs(de); 2f0c4: b3 01 movw r22, r6 2f0c6: a2 01 movw r20, r4 2f0c8: 77 fe sbrs r7, 7 2f0ca: 07 c0 rjmp .+14 ; 0x2f0da 2f0cc: 44 27 eor r20, r20 2f0ce: 55 27 eor r21, r21 2f0d0: ba 01 movw r22, r20 2f0d2: 44 19 sub r20, r4 2f0d4: 55 09 sbc r21, r5 2f0d6: 66 09 sbc r22, r6 2f0d8: 77 09 sbc r23, r7 2f0da: 8e e6 ldi r24, 0x6E ; 110 2f0dc: 82 9d mul r24, r2 2f0de: f0 01 movw r30, r0 2f0e0: 83 9d mul r24, r3 2f0e2: f0 0d add r31, r0 2f0e4: 11 24 eor r1, r1 2f0e6: e8 53 subi r30, 0x38 ; 56 2f0e8: f9 4f sbci r31, 0xF9 ; 249 2f0ea: 44 87 std Z+12, r20 ; 0x0c 2f0ec: 55 87 std Z+13, r21 ; 0x0d 2f0ee: 66 87 std Z+14, r22 ; 0x0e 2f0f0: 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))); 2f0f2: 00 81 ld r16, Z 2f0f4: 11 81 ldd r17, Z+1 ; 0x01 2f0f6: 22 81 ldd r18, Z+2 ; 0x02 2f0f8: 33 81 ldd r19, Z+3 ; 0x03 2f0fa: 84 81 ldd r24, Z+4 ; 0x04 2f0fc: 95 81 ldd r25, Z+5 ; 0x05 2f0fe: a6 81 ldd r26, Z+6 ; 0x06 2f100: b7 81 ldd r27, Z+7 ; 0x07 2f102: 80 17 cp r24, r16 2f104: 91 07 cpc r25, r17 2f106: a2 07 cpc r26, r18 2f108: b3 07 cpc r27, r19 2f10a: 14 f4 brge .+4 ; 0x2f110 2f10c: d9 01 movw r26, r18 2f10e: c8 01 movw r24, r16 2f110: ee e6 ldi r30, 0x6E ; 110 2f112: be 2e mov r11, r30 2f114: b2 9c mul r11, r2 2f116: f0 01 movw r30, r0 2f118: b3 9c mul r11, r3 2f11a: f0 0d add r31, r0 2f11c: 11 24 eor r1, r1 2f11e: e8 53 subi r30, 0x38 ; 56 2f120: f9 4f sbci r31, 0xF9 ; 249 2f122: 80 84 ldd r8, Z+8 ; 0x08 2f124: 91 84 ldd r9, Z+9 ; 0x09 2f126: a2 84 ldd r10, Z+10 ; 0x0a 2f128: b3 84 ldd r11, Z+11 ; 0x0b 2f12a: 88 15 cp r24, r8 2f12c: 99 05 cpc r25, r9 2f12e: aa 05 cpc r26, r10 2f130: bb 05 cpc r27, r11 2f132: 14 f4 brge .+4 ; 0x2f138 2f134: d5 01 movw r26, r10 2f136: c4 01 movw r24, r8 2f138: 84 17 cp r24, r20 2f13a: 95 07 cpc r25, r21 2f13c: a6 07 cpc r26, r22 2f13e: b7 07 cpc r27, r23 2f140: 14 f4 brge .+4 ; 0x2f146 2f142: db 01 movw r26, r22 2f144: ca 01 movw r24, r20 2f146: 4e e6 ldi r20, 0x6E ; 110 2f148: 42 9d mul r20, r2 2f14a: f0 01 movw r30, r0 2f14c: 43 9d mul r20, r3 2f14e: f0 0d add r31, r0 2f150: 11 24 eor r1, r1 2f152: e8 53 subi r30, 0x38 ; 56 2f154: f9 4f sbci r31, 0xF9 ; 249 2f156: 80 8b std Z+16, r24 ; 0x10 2f158: 91 8b std Z+17, r25 ; 0x11 2f15a: a2 8b std Z+18, r26 ; 0x12 2f15c: b3 8b std Z+19, r27 ; 0x13 // Bail if this is a zero-length block if (block->step_event_count.wide <= dropsegments) 2f15e: 06 97 sbiw r24, 0x06 ; 6 2f160: a1 05 cpc r26, r1 2f162: b1 05 cpc r27, r1 2f164: 0c f4 brge .+2 ; 0x2f168 2f166: 94 cd rjmp .-1240 ; 0x2ec90 planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ return; } block->fan_speed = fanSpeed; 2f168: 80 91 e9 11 lds r24, 0x11E9 ; 0x8011e9 2f16c: df 01 movw r26, r30 2f16e: aa 5b subi r26, 0xBA ; 186 2f170: bf 4f sbci r27, 0xFF ; 255 2f172: 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); 2f174: f7 fe sbrs r15, 7 2f176: 02 c0 rjmp .+4 ; 0x2f17c 2f178: 0d 94 e5 80 jmp 0x301ca ; 0x301ca } block->fan_speed = fanSpeed; // Compute direction bits for this block block->direction_bits = 0; 2f17c: 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); 2f17e: 89 a5 ldd r24, Y+41 ; 0x29 2f180: 9a a5 ldd r25, Y+42 ; 0x2a 2f182: ab a5 ldd r26, Y+43 ; 0x2b 2f184: bc a5 ldd r27, Y+44 ; 0x2c 2f186: b7 ff sbrs r27, 7 2f188: 0b c0 rjmp .+22 ; 0x2f1a0 2f18a: 8e e6 ldi r24, 0x6E ; 110 2f18c: 82 9d mul r24, r2 2f18e: f0 01 movw r30, r0 2f190: 83 9d mul r24, r3 2f192: f0 0d add r31, r0 2f194: 11 24 eor r1, r1 2f196: e8 53 subi r30, 0x38 ; 56 2f198: f9 4f sbci r31, 0xF9 ; 249 2f19a: 80 8d ldd r24, Z+24 ; 0x18 2f19c: 82 60 ori r24, 0x02 ; 2 2f19e: 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); 2f1a0: 8d a5 ldd r24, Y+45 ; 0x2d 2f1a2: 9e a5 ldd r25, Y+46 ; 0x2e 2f1a4: af a5 ldd r26, Y+47 ; 0x2f 2f1a6: b8 a9 ldd r27, Y+48 ; 0x30 2f1a8: b7 ff sbrs r27, 7 2f1aa: 0b c0 rjmp .+22 ; 0x2f1c2 2f1ac: 8e e6 ldi r24, 0x6E ; 110 2f1ae: 82 9d mul r24, r2 2f1b0: f0 01 movw r30, r0 2f1b2: 83 9d mul r24, r3 2f1b4: f0 0d add r31, r0 2f1b6: 11 24 eor r1, r1 2f1b8: e8 53 subi r30, 0x38 ; 56 2f1ba: f9 4f sbci r31, 0xF9 ; 249 2f1bc: 80 8d ldd r24, Z+24 ; 0x18 2f1be: 84 60 ori r24, 0x04 ; 4 2f1c0: 80 8f std Z+24, r24 ; 0x18 if (de < 0) block->direction_bits |= _BV(E_AXIS); 2f1c2: 77 fe sbrs r7, 7 2f1c4: 0b c0 rjmp .+22 ; 0x2f1dc 2f1c6: 8e e6 ldi r24, 0x6E ; 110 2f1c8: 82 9d mul r24, r2 2f1ca: f0 01 movw r30, r0 2f1cc: 83 9d mul r24, r3 2f1ce: f0 0d add r31, r0 2f1d0: 11 24 eor r1, r1 2f1d2: e8 53 subi r30, 0x38 ; 56 2f1d4: f9 4f sbci r31, 0xF9 ; 249 2f1d6: 80 8d ldd r24, Z+24 ; 0x18 2f1d8: 88 60 ori r24, 0x08 ; 8 2f1da: 80 8f std Z+24, r24 ; 0x18 { enable_x(); enable_y(); } #else if(block->steps[X_AXIS].wide != 0) enable_x(); 2f1dc: 01 2b or r16, r17 2f1de: 02 2b or r16, r18 2f1e0: 03 2b or r16, r19 2f1e2: 09 f0 breq .+2 ; 0x2f1e6 2f1e4: 17 98 cbi 0x02, 7 ; 2 if(block->steps[Y_AXIS].wide != 0) enable_y(); 2f1e6: 8e e6 ldi r24, 0x6E ; 110 2f1e8: 82 9d mul r24, r2 2f1ea: f0 01 movw r30, r0 2f1ec: 83 9d mul r24, r3 2f1ee: f0 0d add r31, r0 2f1f0: 11 24 eor r1, r1 2f1f2: e8 53 subi r30, 0x38 ; 56 2f1f4: f9 4f sbci r31, 0xF9 ; 249 2f1f6: 84 81 ldd r24, Z+4 ; 0x04 2f1f8: 95 81 ldd r25, Z+5 ; 0x05 2f1fa: a6 81 ldd r26, Z+6 ; 0x06 2f1fc: b7 81 ldd r27, Z+7 ; 0x07 2f1fe: 89 2b or r24, r25 2f200: 8a 2b or r24, r26 2f202: 8b 2b or r24, r27 2f204: 09 f0 breq .+2 ; 0x2f208 2f206: 16 98 cbi 0x02, 6 ; 2 #endif if(block->steps[Z_AXIS].wide != 0) enable_z(); 2f208: 8e e6 ldi r24, 0x6E ; 110 2f20a: 82 9d mul r24, r2 2f20c: f0 01 movw r30, r0 2f20e: 83 9d mul r24, r3 2f210: f0 0d add r31, r0 2f212: 11 24 eor r1, r1 2f214: e8 53 subi r30, 0x38 ; 56 2f216: f9 4f sbci r31, 0xF9 ; 249 2f218: 80 85 ldd r24, Z+8 ; 0x08 2f21a: 91 85 ldd r25, Z+9 ; 0x09 2f21c: a2 85 ldd r26, Z+10 ; 0x0a 2f21e: b3 85 ldd r27, Z+11 ; 0x0b 2f220: 89 2b or r24, r25 2f222: 8a 2b or r24, r26 2f224: 8b 2b or r24, r27 2f226: 09 f0 breq .+2 ; 0x2f22a 2f228: 15 98 cbi 0x02, 5 ; 2 if(block->steps[E_AXIS].wide != 0) enable_e0(); 2f22a: 8e e6 ldi r24, 0x6E ; 110 2f22c: 82 9d mul r24, r2 2f22e: f0 01 movw r30, r0 2f230: 83 9d mul r24, r3 2f232: f0 0d add r31, r0 2f234: 11 24 eor r1, r1 2f236: e8 53 subi r30, 0x38 ; 56 2f238: f9 4f sbci r31, 0xF9 ; 249 2f23a: 84 85 ldd r24, Z+12 ; 0x0c 2f23c: 95 85 ldd r25, Z+13 ; 0x0d 2f23e: a6 85 ldd r26, Z+14 ; 0x0e 2f240: b7 85 ldd r27, Z+15 ; 0x0f 2f242: 89 2b or r24, r25 2f244: 8a 2b or r24, r26 2f246: 8b 2b or r24, r27 2f248: 09 f0 breq .+2 ; 0x2f24c 2f24a: 14 98 cbi 0x02, 4 ; 2 if (block->steps[E_AXIS].wide == 0) 2f24c: 8e e6 ldi r24, 0x6E ; 110 2f24e: 82 9d mul r24, r2 2f250: f0 01 movw r30, r0 2f252: 83 9d mul r24, r3 2f254: f0 0d add r31, r0 2f256: 11 24 eor r1, r1 2f258: e8 53 subi r30, 0x38 ; 56 2f25a: f9 4f sbci r31, 0xF9 ; 249 2f25c: 24 85 ldd r18, Z+12 ; 0x0c 2f25e: 35 85 ldd r19, Z+13 ; 0x0d 2f260: 46 85 ldd r20, Z+14 ; 0x0e 2f262: 57 85 ldd r21, Z+15 ; 0x0f 2f264: 2a 96 adiw r28, 0x0a ; 10 2f266: 2c af std Y+60, r18 ; 0x3c 2f268: 3d af std Y+61, r19 ; 0x3d 2f26a: 4e af std Y+62, r20 ; 0x3e 2f26c: 5f af std Y+63, r21 ; 0x3f 2f26e: 2a 97 sbiw r28, 0x0a ; 10 2f270: 23 2b or r18, r19 2f272: 24 2b or r18, r20 2f274: 25 2b or r18, r21 2f276: 09 f0 breq .+2 ; 0x2f27a 2f278: ac c7 rjmp .+3928 ; 0x301d2 { if(feed_rate 2f27e: b0 90 73 04 lds r11, 0x0473 ; 0x800473 2f282: 00 91 74 04 lds r16, 0x0474 ; 0x800474 2f286: 10 91 75 04 lds r17, 0x0475 ; 0x800475 } else { if(feed_rate 2f29a: 18 16 cp r1, r24 2f29c: 24 f4 brge .+8 ; 0x2f2a6 2f29e: a9 ae std Y+57, r10 ; 0x39 2f2a0: b9 aa std Y+49, r11 ; 0x31 2f2a2: 0d af std Y+61, r16 ; 0x3d 2f2a4: 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]; 2f2a6: c7 01 movw r24, r14 2f2a8: b6 01 movw r22, r12 2f2aa: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2f2ae: 20 91 36 04 lds r18, 0x0436 ; 0x800436 2f2b2: 30 91 37 04 lds r19, 0x0437 ; 0x800437 2f2b6: 40 91 38 04 lds r20, 0x0438 ; 0x800438 2f2ba: 50 91 39 04 lds r21, 0x0439 ; 0x800439 2f2be: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2f2c2: 4b 01 movw r8, r22 2f2c4: 5c 01 movw r10, r24 2f2c6: 89 82 std Y+1, r8 ; 0x01 2f2c8: 9a 82 std Y+2, r9 ; 0x02 2f2ca: ab 82 std Y+3, r10 ; 0x03 2f2cc: bc 82 std Y+4, r11 ; 0x04 delta_mm[Y_AXIS] = dy / cs.axis_steps_per_mm[Y_AXIS]; 2f2ce: 69 a5 ldd r22, Y+41 ; 0x29 2f2d0: 7a a5 ldd r23, Y+42 ; 0x2a 2f2d2: 8b a5 ldd r24, Y+43 ; 0x2b 2f2d4: 9c a5 ldd r25, Y+44 ; 0x2c 2f2d6: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2f2da: 20 91 3a 04 lds r18, 0x043A ; 0x80043a 2f2de: 30 91 3b 04 lds r19, 0x043B ; 0x80043b 2f2e2: 40 91 3c 04 lds r20, 0x043C ; 0x80043c 2f2e6: 50 91 3d 04 lds r21, 0x043D ; 0x80043d 2f2ea: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2f2ee: 6b 01 movw r12, r22 2f2f0: 7c 01 movw r14, r24 2f2f2: cd 82 std Y+5, r12 ; 0x05 2f2f4: de 82 std Y+6, r13 ; 0x06 2f2f6: ef 82 std Y+7, r14 ; 0x07 2f2f8: 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]; 2f2fa: 6d a5 ldd r22, Y+45 ; 0x2d 2f2fc: 7e a5 ldd r23, Y+46 ; 0x2e 2f2fe: 8f a5 ldd r24, Y+47 ; 0x2f 2f300: 98 a9 ldd r25, Y+48 ; 0x30 2f302: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2f306: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 2f30a: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 2f30e: 40 91 40 04 lds r20, 0x0440 ; 0x800440 2f312: 50 91 41 04 lds r21, 0x0441 ; 0x800441 2f316: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2f31a: 22 96 adiw r28, 0x02 ; 2 2f31c: 6c af std Y+60, r22 ; 0x3c 2f31e: 7d af std Y+61, r23 ; 0x3d 2f320: 8e af std Y+62, r24 ; 0x3e 2f322: 9f af std Y+63, r25 ; 0x3f 2f324: 22 97 sbiw r28, 0x02 ; 2 2f326: 69 87 std Y+9, r22 ; 0x09 2f328: 7a 87 std Y+10, r23 ; 0x0a 2f32a: 8b 87 std Y+11, r24 ; 0x0b 2f32c: 9c 87 std Y+12, r25 ; 0x0c delta_mm[E_AXIS] = de / cs.axis_steps_per_mm[E_AXIS]; 2f32e: c3 01 movw r24, r6 2f330: b2 01 movw r22, r4 2f332: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 2f336: 20 91 42 04 lds r18, 0x0442 ; 0x800442 2f33a: 30 91 43 04 lds r19, 0x0443 ; 0x800443 2f33e: 40 91 44 04 lds r20, 0x0444 ; 0x800444 2f342: 50 91 45 04 lds r21, 0x0445 ; 0x800445 2f346: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2f34a: 26 96 adiw r28, 0x06 ; 6 2f34c: 6c af std Y+60, r22 ; 0x3c 2f34e: 7d af std Y+61, r23 ; 0x3d 2f350: 8e af std Y+62, r24 ; 0x3e 2f352: 9f af std Y+63, r25 ; 0x3f 2f354: 26 97 sbiw r28, 0x06 ; 6 2f356: 6d 87 std Y+13, r22 ; 0x0d 2f358: 7e 87 std Y+14, r23 ; 0x0e 2f35a: 8f 87 std Y+15, r24 ; 0x0f 2f35c: 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 ) 2f35e: 8e e6 ldi r24, 0x6E ; 110 2f360: 82 9d mul r24, r2 2f362: f0 01 movw r30, r0 2f364: 83 9d mul r24, r3 2f366: f0 0d add r31, r0 2f368: 11 24 eor r1, r1 2f36a: e8 53 subi r30, 0x38 ; 56 2f36c: f9 4f sbci r31, 0xF9 ; 249 2f36e: 80 81 ld r24, Z 2f370: 91 81 ldd r25, Z+1 ; 0x01 2f372: a2 81 ldd r26, Z+2 ; 0x02 2f374: b3 81 ldd r27, Z+3 ; 0x03 2f376: 2e 96 adiw r28, 0x0e ; 14 2f378: 8c af std Y+60, r24 ; 0x3c 2f37a: 9d af std Y+61, r25 ; 0x3d 2f37c: ae af std Y+62, r26 ; 0x3e 2f37e: bf af std Y+63, r27 ; 0x3f 2f380: 2e 97 sbiw r28, 0x0e ; 14 2f382: 06 97 sbiw r24, 0x06 ; 6 2f384: a1 05 cpc r26, r1 2f386: b1 05 cpc r27, r1 2f388: 0c f0 brlt .+2 ; 0x2f38c 2f38a: 2c c7 rjmp .+3672 ; 0x301e4 2f38c: 84 81 ldd r24, Z+4 ; 0x04 2f38e: 95 81 ldd r25, Z+5 ; 0x05 2f390: a6 81 ldd r26, Z+6 ; 0x06 2f392: b7 81 ldd r27, Z+7 ; 0x07 2f394: 06 97 sbiw r24, 0x06 ; 6 2f396: a1 05 cpc r26, r1 2f398: b1 05 cpc r27, r1 2f39a: 0c f0 brlt .+2 ; 0x2f39e 2f39c: 23 c7 rjmp .+3654 ; 0x301e4 2f39e: 80 85 ldd r24, Z+8 ; 0x08 2f3a0: 91 85 ldd r25, Z+9 ; 0x09 2f3a2: a2 85 ldd r26, Z+10 ; 0x0a 2f3a4: b3 85 ldd r27, Z+11 ; 0x0b 2f3a6: 06 97 sbiw r24, 0x06 ; 6 2f3a8: a1 05 cpc r26, r1 2f3aa: b1 05 cpc r27, r1 2f3ac: 0c f0 brlt .+2 ; 0x2f3b0 2f3ae: 1a c7 rjmp .+3636 ; 0x301e4 { block->millimeters = fabs(delta_mm[E_AXIS]); 2f3b0: 26 96 adiw r28, 0x06 ; 6 2f3b2: 8c ad ldd r24, Y+60 ; 0x3c 2f3b4: 9d ad ldd r25, Y+61 ; 0x3d 2f3b6: ae ad ldd r26, Y+62 ; 0x3e 2f3b8: bf ad ldd r27, Y+63 ; 0x3f 2f3ba: 26 97 sbiw r28, 0x06 ; 6 2f3bc: bf 77 andi r27, 0x7F ; 127 2f3be: 85 a7 std Z+45, r24 ; 0x2d 2f3c0: 96 a7 std Z+46, r25 ; 0x2e 2f3c2: a7 a7 std Z+47, r26 ; 0x2f 2f3c4: 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 2f3c6: 8e e6 ldi r24, 0x6E ; 110 2f3c8: 82 9d mul r24, r2 2f3ca: f0 01 movw r30, r0 2f3cc: 83 9d mul r24, r3 2f3ce: f0 0d add r31, r0 2f3d0: 11 24 eor r1, r1 2f3d2: e8 53 subi r30, 0x38 ; 56 2f3d4: f9 4f sbci r31, 0xF9 ; 249 2f3d6: 45 a4 ldd r4, Z+45 ; 0x2d 2f3d8: 56 a4 ldd r5, Z+46 ; 0x2e 2f3da: 67 a4 ldd r6, Z+47 ; 0x2f 2f3dc: 70 a8 ldd r7, Z+48 ; 0x30 2f3de: a3 01 movw r20, r6 2f3e0: 92 01 movw r18, r4 2f3e2: 60 e0 ldi r22, 0x00 ; 0 2f3e4: 70 e0 ldi r23, 0x00 ; 0 2f3e6: 80 e8 ldi r24, 0x80 ; 128 2f3e8: 9f e3 ldi r25, 0x3F ; 63 2f3ea: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> // Calculate speed in mm/second for each axis. No divide by zero due to previous checks. float inverse_second = feed_rate * inverse_millimeters; 2f3ee: 29 ad ldd r18, Y+57 ; 0x39 2f3f0: 39 a9 ldd r19, Y+49 ; 0x31 2f3f2: 4d ad ldd r20, Y+61 ; 0x3d 2f3f4: 5d a9 ldd r21, Y+53 ; 0x35 2f3f6: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2f3fa: 6b 01 movw r12, r22 2f3fc: 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); 2f3fe: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 2f402: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 2f406: 89 1b sub r24, r25 2f408: 8f 70 andi r24, 0x0F ; 15 2f40a: 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)) { 2f40c: 82 50 subi r24, 0x02 ; 2 2f40e: 86 30 cpi r24, 0x06 ; 6 2f410: 08 f0 brcs .+2 ; 0x2f414 2f412: 40 c0 rjmp .+128 ; 0x2f494 // segment time in micro seconds unsigned long segment_time = lround(1000000.0/inverse_second); 2f414: a7 01 movw r20, r14 2f416: 96 01 movw r18, r12 2f418: 60 e0 ldi r22, 0x00 ; 0 2f41a: 74 e2 ldi r23, 0x24 ; 36 2f41c: 84 e7 ldi r24, 0x74 ; 116 2f41e: 99 e4 ldi r25, 0x49 ; 73 2f420: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2f424: 0f 94 00 a5 call 0x34a00 ; 0x34a00 2f428: 4b 01 movw r8, r22 2f42a: 5c 01 movw r10, r24 if (segment_time < cs.min_segment_time_us) 2f42c: 80 91 76 04 lds r24, 0x0476 ; 0x800476 2f430: 90 91 77 04 lds r25, 0x0477 ; 0x800477 2f434: a0 91 78 04 lds r26, 0x0478 ; 0x800478 2f438: b0 91 79 04 lds r27, 0x0479 ; 0x800479 2f43c: 88 16 cp r8, r24 2f43e: 99 06 cpc r9, r25 2f440: aa 06 cpc r10, r26 2f442: bb 06 cpc r11, r27 2f444: 38 f5 brcc .+78 ; 0x2f494 // 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)); 2f446: bc 01 movw r22, r24 2f448: cd 01 movw r24, r26 2f44a: 68 19 sub r22, r8 2f44c: 79 09 sbc r23, r9 2f44e: 8a 09 sbc r24, r10 2f450: 9b 09 sbc r25, r11 2f452: 66 0f add r22, r22 2f454: 77 1f adc r23, r23 2f456: 88 1f adc r24, r24 2f458: 99 1f adc r25, r25 2f45a: ad ad ldd r26, Y+61 ; 0x3d 2f45c: 2a 2f mov r18, r26 2f45e: 30 e0 ldi r19, 0x00 ; 0 2f460: 50 e0 ldi r21, 0x00 ; 0 2f462: 40 e0 ldi r20, 0x00 ; 0 2f464: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> 2f468: ca 01 movw r24, r20 2f46a: b9 01 movw r22, r18 2f46c: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 2f470: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 2f474: 68 0d add r22, r8 2f476: 79 1d adc r23, r9 2f478: 8a 1d adc r24, r10 2f47a: 9b 1d adc r25, r11 2f47c: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 2f480: 9b 01 movw r18, r22 2f482: ac 01 movw r20, r24 2f484: 60 e0 ldi r22, 0x00 ; 0 2f486: 74 e2 ldi r23, 0x24 ; 36 2f488: 84 e7 ldi r24, 0x74 ; 116 2f48a: 99 e4 ldi r25, 0x49 ; 73 2f48c: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2f490: 6b 01 movw r12, r22 2f492: 7c 01 movw r14, r24 } #endif // SLOWDOWN block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0 2f494: a3 01 movw r20, r6 2f496: 92 01 movw r18, r4 2f498: c7 01 movw r24, r14 2f49a: b6 01 movw r22, r12 2f49c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2f4a0: 6d ab std Y+53, r22 ; 0x35 2f4a2: 7e ab std Y+54, r23 ; 0x36 2f4a4: 8f ab std Y+55, r24 ; 0x37 2f4a6: 98 af std Y+56, r25 ; 0x38 2f4a8: 8e e6 ldi r24, 0x6E ; 110 2f4aa: 82 9d mul r24, r2 2f4ac: 80 01 movw r16, r0 2f4ae: 83 9d mul r24, r3 2f4b0: 10 0d add r17, r0 2f4b2: 11 24 eor r1, r1 2f4b4: 08 53 subi r16, 0x38 ; 56 2f4b6: 19 4f sbci r17, 0xF9 ; 249 2f4b8: 2d a9 ldd r18, Y+53 ; 0x35 2f4ba: 3e a9 ldd r19, Y+54 ; 0x36 2f4bc: 4f a9 ldd r20, Y+55 ; 0x37 2f4be: 58 ad ldd r21, Y+56 ; 0x38 2f4c0: d8 01 movw r26, r16 2f4c2: 91 96 adiw r26, 0x21 ; 33 2f4c4: 2d 93 st X+, r18 2f4c6: 3d 93 st X+, r19 2f4c8: 4d 93 st X+, r20 2f4ca: 5c 93 st X, r21 2f4cc: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate = ceil(block->step_event_count.wide * inverse_second); // (step/sec) Always > 0 2f4ce: 50 96 adiw r26, 0x10 ; 16 2f4d0: 6d 91 ld r22, X+ 2f4d2: 7d 91 ld r23, X+ 2f4d4: 8d 91 ld r24, X+ 2f4d6: 9c 91 ld r25, X 2f4d8: 53 97 sbiw r26, 0x13 ; 19 2f4da: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 2f4de: 69 af std Y+57, r22 ; 0x39 2f4e0: 7a af std Y+58, r23 ; 0x3a 2f4e2: 8b af std Y+59, r24 ; 0x3b 2f4e4: 9c af std Y+60, r25 ; 0x3c 2f4e6: 9b 01 movw r18, r22 2f4e8: ac 01 movw r20, r24 2f4ea: c7 01 movw r24, r14 2f4ec: b6 01 movw r22, r12 2f4ee: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2f4f2: 0f 94 a1 a2 call 0x34542 ; 0x34542 2f4f6: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 2f4fa: 62 96 adiw r28, 0x12 ; 18 2f4fc: 6c af std Y+60, r22 ; 0x3c 2f4fe: 7d af std Y+61, r23 ; 0x3d 2f500: 8e af std Y+62, r24 ; 0x3e 2f502: 9f af std Y+63, r25 ; 0x3f 2f504: 62 97 sbiw r28, 0x12 ; 18 2f506: f8 01 movw r30, r16 2f508: 66 ab std Z+54, r22 ; 0x36 2f50a: 77 ab std Z+55, r23 ; 0x37 2f50c: 80 af std Z+56, r24 ; 0x38 2f50e: 91 af std Z+57, r25 ; 0x39 2f510: 9e 01 movw r18, r28 2f512: 2f 5f subi r18, 0xFF ; 255 2f514: 3f 4f sbci r19, 0xFF ; 255 2f516: 3a ab std Y+50, r19 ; 0x32 2f518: 29 ab std Y+49, r18 ; 0x31 2f51a: ae 01 movw r20, r28 2f51c: 4f 5e subi r20, 0xEF ; 239 2f51e: 5f 4f sbci r21, 0xFF ; 255 2f520: 6e 96 adiw r28, 0x1e ; 30 2f522: 5f af std Y+63, r21 ; 0x3f 2f524: 4e af std Y+62, r20 ; 0x3e 2f526: 6e 97 sbiw r28, 0x1e ; 30 2f528: 86 e4 ldi r24, 0x46 ; 70 2f52a: 94 e0 ldi r25, 0x04 ; 4 2f52c: 68 96 adiw r28, 0x18 ; 24 2f52e: 9f af std Y+63, r25 ; 0x3f 2f530: 8e af std Y+62, r24 ; 0x3e 2f532: 68 97 sbiw r28, 0x18 ; 24 2f534: 6c 96 adiw r28, 0x1c ; 28 2f536: 5f af std Y+63, r21 ; 0x3f 2f538: 4e af std Y+62, r20 ; 0x3e 2f53a: 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 2f53c: 19 a6 std Y+41, r1 ; 0x29 2f53e: 1d a6 std Y+45, r1 ; 0x2d 2f540: 00 e8 ldi r16, 0x80 ; 128 2f542: 1f e3 ldi r17, 0x3F ; 63 for(int i=0; i < 4; i++) { current_speed[i] = delta_mm[i] * inverse_second; 2f544: a9 a9 ldd r26, Y+49 ; 0x31 2f546: ba a9 ldd r27, Y+50 ; 0x32 2f548: 2d 91 ld r18, X+ 2f54a: 3d 91 ld r19, X+ 2f54c: 4d 91 ld r20, X+ 2f54e: 5d 91 ld r21, X+ 2f550: ba ab std Y+50, r27 ; 0x32 2f552: a9 ab std Y+49, r26 ; 0x31 2f554: c7 01 movw r24, r14 2f556: b6 01 movw r22, r12 2f558: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2f55c: 6c 96 adiw r28, 0x1c ; 28 2f55e: ee ad ldd r30, Y+62 ; 0x3e 2f560: ff ad ldd r31, Y+63 ; 0x3f 2f562: 6c 97 sbiw r28, 0x1c ; 28 2f564: 61 93 st Z+, r22 2f566: 71 93 st Z+, r23 2f568: 81 93 st Z+, r24 2f56a: 91 93 st Z+, r25 2f56c: 6c 96 adiw r28, 0x1c ; 28 2f56e: ff af std Y+63, r31 ; 0x3f 2f570: ee af std Y+62, r30 ; 0x3e 2f572: 6c 97 sbiw r28, 0x1c ; 28 if(fabs(current_speed[i]) > max_feedrate[i]) 2f574: 4b 01 movw r8, r22 2f576: 5c 01 movw r10, r24 2f578: e8 94 clt 2f57a: b7 f8 bld r11, 7 2f57c: 68 96 adiw r28, 0x18 ; 24 2f57e: ae ad ldd r26, Y+62 ; 0x3e 2f580: bf ad ldd r27, Y+63 ; 0x3f 2f582: 68 97 sbiw r28, 0x18 ; 24 2f584: 2d 91 ld r18, X+ 2f586: 3d 91 ld r19, X+ 2f588: 4d 91 ld r20, X+ 2f58a: 5d 91 ld r21, X+ 2f58c: 68 96 adiw r28, 0x18 ; 24 2f58e: bf af std Y+63, r27 ; 0x3f 2f590: ae af std Y+62, r26 ; 0x3e 2f592: 68 97 sbiw r28, 0x18 ; 24 2f594: 66 96 adiw r28, 0x16 ; 22 2f596: 2c af std Y+60, r18 ; 0x3c 2f598: 3d af std Y+61, r19 ; 0x3d 2f59a: 4e af std Y+62, r20 ; 0x3e 2f59c: 5f af std Y+63, r21 ; 0x3f 2f59e: 66 97 sbiw r28, 0x16 ; 22 2f5a0: c5 01 movw r24, r10 2f5a2: b4 01 movw r22, r8 2f5a4: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 2f5a8: 18 16 cp r1, r24 2f5aa: b4 f4 brge .+44 ; 0x2f5d8 { speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); 2f5ac: a5 01 movw r20, r10 2f5ae: 94 01 movw r18, r8 2f5b0: 66 96 adiw r28, 0x16 ; 22 2f5b2: 6c ad ldd r22, Y+60 ; 0x3c 2f5b4: 7d ad ldd r23, Y+61 ; 0x3d 2f5b6: 8e ad ldd r24, Y+62 ; 0x3e 2f5b8: 9f ad ldd r25, Y+63 ; 0x3f 2f5ba: 66 97 sbiw r28, 0x16 ; 22 2f5bc: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2f5c0: 4b 01 movw r8, r22 2f5c2: 5c 01 movw r10, r24 2f5c4: 29 a5 ldd r18, Y+41 ; 0x29 2f5c6: 3d a5 ldd r19, Y+45 ; 0x2d 2f5c8: a8 01 movw r20, r16 2f5ca: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 2f5ce: 18 16 cp r1, r24 2f5d0: 1c f0 brlt .+6 ; 0x2f5d8 2f5d2: 89 a6 std Y+41, r8 ; 0x29 2f5d4: 9d a6 std Y+45, r9 ; 0x2d 2f5d6: 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++) 2f5d8: 6e 96 adiw r28, 0x1e ; 30 2f5da: ee ad ldd r30, Y+62 ; 0x3e 2f5dc: ff ad ldd r31, Y+63 ; 0x3f 2f5de: 6e 97 sbiw r28, 0x1e ; 30 2f5e0: 29 a9 ldd r18, Y+49 ; 0x31 2f5e2: 3a a9 ldd r19, Y+50 ; 0x32 2f5e4: e2 17 cp r30, r18 2f5e6: f3 07 cpc r31, r19 2f5e8: 09 f0 breq .+2 ; 0x2f5ec 2f5ea: ac cf rjmp .-168 ; 0x2f544 speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); } } // Correct the speed if( speed_factor < 1.0) 2f5ec: 20 e0 ldi r18, 0x00 ; 0 2f5ee: 30 e0 ldi r19, 0x00 ; 0 2f5f0: 40 e8 ldi r20, 0x80 ; 128 2f5f2: 5f e3 ldi r21, 0x3F ; 63 2f5f4: 69 a5 ldd r22, Y+41 ; 0x29 2f5f6: 7d a5 ldd r23, Y+45 ; 0x2d 2f5f8: c8 01 movw r24, r16 2f5fa: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 2f5fe: 87 ff sbrs r24, 7 2f600: 50 c0 rjmp .+160 ; 0x2f6a2 2f602: 6e 96 adiw r28, 0x1e ; 30 2f604: ae ac ldd r10, Y+62 ; 0x3e 2f606: bf ac ldd r11, Y+63 ; 0x3f 2f608: 6e 97 sbiw r28, 0x1e ; 30 2f60a: 30 e1 ldi r19, 0x10 ; 16 2f60c: a3 0e add r10, r19 2f60e: b1 1c adc r11, r1 2f610: 6e 96 adiw r28, 0x1e ; 30 2f612: ce ac ldd r12, Y+62 ; 0x3e 2f614: df ac ldd r13, Y+63 ; 0x3f 2f616: 6e 97 sbiw r28, 0x1e ; 30 { for(unsigned char i=0; i < 4; i++) { current_speed[i] *= speed_factor; 2f618: d6 01 movw r26, r12 2f61a: 6d 91 ld r22, X+ 2f61c: 7d 91 ld r23, X+ 2f61e: 8d 91 ld r24, X+ 2f620: 9d 91 ld r25, X+ 2f622: 6d 01 movw r12, r26 2f624: 7d 01 movw r14, r26 2f626: b4 e0 ldi r27, 0x04 ; 4 2f628: eb 1a sub r14, r27 2f62a: f1 08 sbc r15, r1 2f62c: 29 a5 ldd r18, Y+41 ; 0x29 2f62e: 3d a5 ldd r19, Y+45 ; 0x2d 2f630: a8 01 movw r20, r16 2f632: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2f636: f7 01 movw r30, r14 2f638: 60 83 st Z, r22 2f63a: 71 83 std Z+1, r23 ; 0x01 2f63c: 82 83 std Z+2, r24 ; 0x02 2f63e: 93 83 std Z+3, r25 ; 0x03 } // Correct the speed if( speed_factor < 1.0) { for(unsigned char i=0; i < 4; i++) 2f640: ac 14 cp r10, r12 2f642: bd 04 cpc r11, r13 2f644: 49 f7 brne .-46 ; 0x2f618 { current_speed[i] *= speed_factor; } block->nominal_speed *= speed_factor; 2f646: 2e e6 ldi r18, 0x6E ; 110 2f648: 22 9d mul r18, r2 2f64a: c0 01 movw r24, r0 2f64c: 23 9d mul r18, r3 2f64e: 90 0d add r25, r0 2f650: 11 24 eor r1, r1 2f652: 9c 01 movw r18, r24 2f654: 28 53 subi r18, 0x38 ; 56 2f656: 39 4f sbci r19, 0xF9 ; 249 2f658: 79 01 movw r14, r18 2f65a: 29 a5 ldd r18, Y+41 ; 0x29 2f65c: 3d a5 ldd r19, Y+45 ; 0x2d 2f65e: a8 01 movw r20, r16 2f660: 6d a9 ldd r22, Y+53 ; 0x35 2f662: 7e a9 ldd r23, Y+54 ; 0x36 2f664: 8f a9 ldd r24, Y+55 ; 0x37 2f666: 98 ad ldd r25, Y+56 ; 0x38 2f668: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2f66c: d7 01 movw r26, r14 2f66e: 91 96 adiw r26, 0x21 ; 33 2f670: 6d 93 st X+, r22 2f672: 7d 93 st X+, r23 2f674: 8d 93 st X+, r24 2f676: 9c 93 st X, r25 2f678: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate *= speed_factor; 2f67a: 62 96 adiw r28, 0x12 ; 18 2f67c: 6c ad ldd r22, Y+60 ; 0x3c 2f67e: 7d ad ldd r23, Y+61 ; 0x3d 2f680: 8e ad ldd r24, Y+62 ; 0x3e 2f682: 9f ad ldd r25, Y+63 ; 0x3f 2f684: 62 97 sbiw r28, 0x12 ; 18 2f686: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 2f68a: 29 a5 ldd r18, Y+41 ; 0x29 2f68c: 3d a5 ldd r19, Y+45 ; 0x2d 2f68e: a8 01 movw r20, r16 2f690: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2f694: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 2f698: f7 01 movw r30, r14 2f69a: 66 ab std Z+54, r22 ; 0x36 2f69c: 77 ab std Z+55, r23 ; 0x37 2f69e: 80 af std Z+56, r24 ; 0x38 2f6a0: 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; 2f6a2: a3 01 movw r20, r6 2f6a4: 92 01 movw r18, r4 2f6a6: 69 ad ldd r22, Y+57 ; 0x39 2f6a8: 7a ad ldd r23, Y+58 ; 0x3a 2f6aa: 8b ad ldd r24, Y+59 ; 0x3b 2f6ac: 9c ad ldd r25, Y+60 ; 0x3c 2f6ae: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2f6b2: 69 a7 std Y+41, r22 ; 0x29 2f6b4: 7a a7 std Y+42, r23 ; 0x2a 2f6b6: 8b a7 std Y+43, r24 ; 0x2b 2f6b8: 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) 2f6ba: 2e 96 adiw r28, 0x0e ; 14 2f6bc: 2c ad ldd r18, Y+60 ; 0x3c 2f6be: 3d ad ldd r19, Y+61 ; 0x3d 2f6c0: 4e ad ldd r20, Y+62 ; 0x3e 2f6c2: 5f ad ldd r21, Y+63 ; 0x3f 2f6c4: 2e 97 sbiw r28, 0x0e ; 14 2f6c6: 23 2b or r18, r19 2f6c8: 24 2b or r18, r20 2f6ca: 25 2b or r18, r21 2f6cc: 09 f0 breq .+2 ; 0x2f6d0 2f6ce: b9 c5 rjmp .+2930 ; 0x30242 2f6d0: 8e e6 ldi r24, 0x6E ; 110 2f6d2: 82 9d mul r24, r2 2f6d4: 80 01 movw r16, r0 2f6d6: 83 9d mul r24, r3 2f6d8: 10 0d add r17, r0 2f6da: 11 24 eor r1, r1 2f6dc: 08 53 subi r16, 0x38 ; 56 2f6de: 19 4f sbci r17, 0xF9 ; 249 2f6e0: f8 01 movw r30, r16 2f6e2: 84 81 ldd r24, Z+4 ; 0x04 2f6e4: 95 81 ldd r25, Z+5 ; 0x05 2f6e6: a6 81 ldd r26, Z+6 ; 0x06 2f6e8: b7 81 ldd r27, Z+7 ; 0x07 2f6ea: 89 2b or r24, r25 2f6ec: 8a 2b or r24, r26 2f6ee: 8b 2b or r24, r27 2f6f0: 09 f0 breq .+2 ; 0x2f6f4 2f6f2: a7 c5 rjmp .+2894 ; 0x30242 2f6f4: 80 85 ldd r24, Z+8 ; 0x08 2f6f6: 91 85 ldd r25, Z+9 ; 0x09 2f6f8: a2 85 ldd r26, Z+10 ; 0x0a 2f6fa: b3 85 ldd r27, Z+11 ; 0x0b 2f6fc: 89 2b or r24, r25 2f6fe: 8a 2b or r24, r26 2f700: 8b 2b or r24, r27 2f702: 09 f0 breq .+2 ; 0x2f706 2f704: 9e c5 rjmp .+2876 ; 0x30242 { accel = ceil(cs.retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 2f706: 20 91 6a 04 lds r18, 0x046A ; 0x80046a 2f70a: 30 91 6b 04 lds r19, 0x046B ; 0x80046b 2f70e: 40 91 6c 04 lds r20, 0x046C ; 0x80046c 2f712: 50 91 6d 04 lds r21, 0x046D ; 0x80046d 2f716: 69 a5 ldd r22, Y+41 ; 0x29 2f718: 7a a5 ldd r23, Y+42 ; 0x2a 2f71a: 8b a5 ldd r24, Y+43 ; 0x2b 2f71c: 9c a5 ldd r25, Y+44 ; 0x2c 2f71e: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2f722: 0f 94 a1 a2 call 0x34542 ; 0x34542 2f726: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 2f72a: 2b 01 movw r4, r22 2f72c: 3c 01 movw r6, r24 #ifdef LIN_ADVANCE block->use_advance_lead = false; 2f72e: f8 01 movw r30, r16 2f730: e4 5b subi r30, 0xB4 ; 180 2f732: ff 4f sbci r31, 0xFF ; 255 2f734: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 2f736: 6a 96 adiw r28, 0x1a ; 26 2f738: 1c ae std Y+60, r1 ; 0x3c 2f73a: 1d ae std Y+61, r1 ; 0x3d 2f73c: 1e ae std Y+62, r1 ; 0x3e 2f73e: 1f ae std Y+63, r1 ; 0x3f 2f740: 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; 2f742: 8e e6 ldi r24, 0x6E ; 110 2f744: 82 9d mul r24, r2 2f746: 80 01 movw r16, r0 2f748: 83 9d mul r24, r3 2f74a: 10 0d add r17, r0 2f74c: 11 24 eor r1, r1 2f74e: 08 53 subi r16, 0x38 ; 56 2f750: 19 4f sbci r17, 0xF9 ; 249 2f752: f8 01 movw r30, r16 2f754: ee 5b subi r30, 0xBE ; 190 2f756: ff 4f sbci r31, 0xFF ; 255 2f758: 40 82 st Z, r4 2f75a: 51 82 std Z+1, r5 ; 0x01 2f75c: 62 82 std Z+2, r6 ; 0x02 2f75e: 73 82 std Z+3, r7 ; 0x03 block->acceleration = accel / steps_per_mm; 2f760: c3 01 movw r24, r6 2f762: b2 01 movw r22, r4 2f764: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 2f768: 6b 01 movw r12, r22 2f76a: 7c 01 movw r14, r24 2f76c: 29 a5 ldd r18, Y+41 ; 0x29 2f76e: 3a a5 ldd r19, Y+42 ; 0x2a 2f770: 4b a5 ldd r20, Y+43 ; 0x2b 2f772: 5c a5 ldd r21, Y+44 ; 0x2c 2f774: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2f778: e1 96 adiw r28, 0x31 ; 49 2f77a: 6c af std Y+60, r22 ; 0x3c 2f77c: 7d af std Y+61, r23 ; 0x3d 2f77e: 8e af std Y+62, r24 ; 0x3e 2f780: 9f af std Y+63, r25 ; 0x3f 2f782: e1 97 sbiw r28, 0x31 ; 49 2f784: f8 01 movw r30, r16 2f786: 61 ab std Z+49, r22 ; 0x31 2f788: 72 ab std Z+50, r23 ; 0x32 2f78a: 83 ab std Z+51, r24 ; 0x33 2f78c: 94 ab std Z+52, r25 ; 0x34 block->acceleration_rate = (uint32_t)(accel * (float(1UL << 24) / ((F_CPU) / 8.0f))); 2f78e: 2d eb ldi r18, 0xBD ; 189 2f790: 37 e3 ldi r19, 0x37 ; 55 2f792: 46 e0 ldi r20, 0x06 ; 6 2f794: 51 e4 ldi r21, 0x41 ; 65 2f796: c7 01 movw r24, r14 2f798: b6 01 movw r22, r12 2f79a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2f79e: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 2f7a2: d8 01 movw r26, r16 2f7a4: 54 96 adiw r26, 0x14 ; 20 2f7a6: 6d 93 st X+, r22 2f7a8: 7d 93 st X+, r23 2f7aa: 8d 93 st X+, r24 2f7ac: 9c 93 st X, r25 2f7ae: 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; 2f7b0: 91 96 adiw r26, 0x21 ; 33 2f7b2: bc 91 ld r27, X 2f7b4: 27 96 adiw r28, 0x07 ; 7 2f7b6: bf af std Y+63, r27 ; 0x3f 2f7b8: 27 97 sbiw r28, 0x07 ; 7 2f7ba: f8 01 movw r30, r16 2f7bc: f2 a1 ldd r31, Z+34 ; 0x22 2f7be: 2b 96 adiw r28, 0x0b ; 11 2f7c0: ff af std Y+63, r31 ; 0x3f 2f7c2: 2b 97 sbiw r28, 0x0b ; 11 2f7c4: d8 01 movw r26, r16 2f7c6: 93 96 adiw r26, 0x23 ; 35 2f7c8: bc 91 ld r27, X 2f7ca: 2f 96 adiw r28, 0x0f ; 15 2f7cc: bf af std Y+63, r27 ; 0x3f 2f7ce: 2f 97 sbiw r28, 0x0f ; 15 2f7d0: f8 01 movw r30, r16 2f7d2: f4 a1 ldd r31, Z+36 ; 0x24 2f7d4: 63 96 adiw r28, 0x13 ; 19 2f7d6: ff af std Y+63, r31 ; 0x3f 2f7d8: 63 97 sbiw r28, 0x13 ; 19 2f7da: 2a e7 ldi r18, 0x7A ; 122 2f7dc: 34 e0 ldi r19, 0x04 ; 4 2f7de: ed 96 adiw r28, 0x3d ; 61 2f7e0: 3f af std Y+63, r19 ; 0x3f 2f7e2: 2e af std Y+62, r18 ; 0x3e 2f7e4: ed 97 sbiw r28, 0x3d ; 61 2f7e6: 6e 96 adiw r28, 0x1e ; 30 2f7e8: 4e ac ldd r4, Y+62 ; 0x3e 2f7ea: 5f ac ldd r5, Y+63 ; 0x3f 2f7ec: 6e 97 sbiw r28, 0x1e ; 30 2f7ee: 30 e1 ldi r19, 0x10 ; 16 2f7f0: 43 0e add r4, r19 2f7f2: 51 1c adc r5, r1 2f7f4: 0a e7 ldi r16, 0x7A ; 122 2f7f6: 14 e0 ldi r17, 0x04 ; 4 2f7f8: 6e 96 adiw r28, 0x1e ; 30 2f7fa: 6e ac ldd r6, Y+62 ; 0x3e 2f7fc: 7f ac ldd r7, Y+63 ; 0x3f 2f7fe: 6e 97 sbiw r28, 0x1e ; 30 2f800: 27 96 adiw r28, 0x07 ; 7 2f802: 4f ad ldd r20, Y+63 ; 0x3f 2f804: 27 97 sbiw r28, 0x07 ; 7 2f806: 49 a7 std Y+41, r20 ; 0x29 2f808: 2b 96 adiw r28, 0x0b ; 11 2f80a: 5f ad ldd r21, Y+63 ; 0x3f 2f80c: 2b 97 sbiw r28, 0x0b ; 11 2f80e: 5d a7 std Y+45, r21 ; 0x2d 2f810: b9 af std Y+57, r27 ; 0x39 2f812: f9 ab std Y+49, r31 ; 0x31 bool limited = false; 2f814: 1d aa std Y+53, r1 ; 0x35 for (uint8_t axis = 0; axis < 4; ++ axis) { float jerk = fabs(current_speed[axis]); 2f816: d3 01 movw r26, r6 2f818: 8d 90 ld r8, X+ 2f81a: 9d 90 ld r9, X+ 2f81c: ad 90 ld r10, X+ 2f81e: bd 90 ld r11, X+ 2f820: 3d 01 movw r6, r26 2f822: e8 94 clt 2f824: b7 f8 bld r11, 7 if (jerk > cs.max_jerk[axis]) { 2f826: f8 01 movw r30, r16 2f828: c1 90 ld r12, Z+ 2f82a: d1 90 ld r13, Z+ 2f82c: e1 90 ld r14, Z+ 2f82e: f1 90 ld r15, Z+ 2f830: 8f 01 movw r16, r30 2f832: a5 01 movw r20, r10 2f834: 94 01 movw r18, r8 2f836: c7 01 movw r24, r14 2f838: b6 01 movw r22, r12 2f83a: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 2f83e: 87 ff sbrs r24, 7 2f840: 3a c0 rjmp .+116 ; 0x2f8b6 // The actual jerk is lower, if it has been limited by the XY jerk. if (limited) { 2f842: fd a9 ldd r31, Y+53 ; 0x35 2f844: ff 23 and r31, r31 2f846: 09 f4 brne .+2 ; 0x2f84a 2f848: 7e c6 rjmp .+3324 ; 0x30546 // 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; 2f84a: 29 a5 ldd r18, Y+41 ; 0x29 2f84c: 3d a5 ldd r19, Y+45 ; 0x2d 2f84e: 49 ad ldd r20, Y+57 ; 0x39 2f850: 59 a9 ldd r21, Y+49 ; 0x31 2f852: c5 01 movw r24, r10 2f854: b4 01 movw r22, r8 2f856: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2f85a: 4b 01 movw r8, r22 2f85c: 5c 01 movw r10, r24 float mjerk = cs.max_jerk[axis] * block->nominal_speed; 2f85e: a7 01 movw r20, r14 2f860: 96 01 movw r18, r12 2f862: 27 96 adiw r28, 0x07 ; 7 2f864: 6f ad ldd r22, Y+63 ; 0x3f 2f866: 27 97 sbiw r28, 0x07 ; 7 2f868: 2b 96 adiw r28, 0x0b ; 11 2f86a: 7f ad ldd r23, Y+63 ; 0x3f 2f86c: 2b 97 sbiw r28, 0x0b ; 11 2f86e: 2f 96 adiw r28, 0x0f ; 15 2f870: 8f ad ldd r24, Y+63 ; 0x3f 2f872: 2f 97 sbiw r28, 0x0f ; 15 2f874: 63 96 adiw r28, 0x13 ; 19 2f876: 9f ad ldd r25, Y+63 ; 0x3f 2f878: 63 97 sbiw r28, 0x13 ; 19 2f87a: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2f87e: 6b 01 movw r12, r22 2f880: 7c 01 movw r14, r24 if (jerk > mjerk) { 2f882: ac 01 movw r20, r24 2f884: 9b 01 movw r18, r22 2f886: c5 01 movw r24, r10 2f888: b4 01 movw r22, r8 2f88a: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 2f88e: 18 16 cp r1, r24 2f890: 94 f4 brge .+36 ; 0x2f8b6 safe_speed *= mjerk / jerk; 2f892: a5 01 movw r20, r10 2f894: 94 01 movw r18, r8 2f896: c7 01 movw r24, r14 2f898: b6 01 movw r22, r12 2f89a: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2f89e: 9b 01 movw r18, r22 2f8a0: ac 01 movw r20, r24 2f8a2: 69 a5 ldd r22, Y+41 ; 0x29 2f8a4: 7d a5 ldd r23, Y+45 ; 0x2d 2f8a6: 89 ad ldd r24, Y+57 ; 0x39 2f8a8: 99 a9 ldd r25, Y+49 ; 0x31 2f8aa: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2f8ae: 69 a7 std Y+41, r22 ; 0x29 2f8b0: 7d a7 std Y+45, r23 ; 0x2d 2f8b2: 89 af std Y+57, r24 ; 0x39 2f8b4: 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) { 2f8b6: 46 14 cp r4, r6 2f8b8: 57 04 cpc r5, r7 2f8ba: 09 f0 breq .+2 ; 0x2f8be 2f8bc: ac cf rjmp .-168 ; 0x2f816 } } } // Reset the block flag. block->flag = 0; 2f8be: 8e e6 ldi r24, 0x6E ; 110 2f8c0: 82 9d mul r24, r2 2f8c2: f0 01 movw r30, r0 2f8c4: 83 9d mul r24, r3 2f8c6: f0 0d add r31, r0 2f8c8: 11 24 eor r1, r1 2f8ca: e8 53 subi r30, 0x38 ; 56 2f8cc: f9 4f sbci r31, 0xF9 ; 249 2f8ce: 15 aa std Z+53, r1 ; 0x35 if (plan_reset_next_e_sched) 2f8d0: 80 91 ee 03 lds r24, 0x03EE ; 0x8003ee <_ZL23plan_reset_next_e_sched.lto_priv.449> 2f8d4: 88 23 and r24, r24 2f8d6: 21 f0 breq .+8 ; 0x2f8e0 { // finally propagate a pending reset block->flag |= BLOCK_FLAG_E_RESET; 2f8d8: 80 e1 ldi r24, 0x10 ; 16 2f8da: 85 ab std Z+53, r24 ; 0x35 plan_reset_next_e_sched = false; 2f8dc: 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) { 2f8e0: 3d ad ldd r19, Y+61 ; 0x3d 2f8e2: 32 30 cpi r19, 0x02 ; 2 2f8e4: 08 f4 brcc .+2 ; 0x2f8e8 2f8e6: 8f c6 rjmp .+3358 ; 0x30606 2f8e8: 40 91 f0 03 lds r20, 0x03F0 ; 0x8003f0 <_ZL22previous_nominal_speed.lto_priv.450> 2f8ec: 6b 96 adiw r28, 0x1b ; 27 2f8ee: 4f af std Y+63, r20 ; 0x3f 2f8f0: 6b 97 sbiw r28, 0x1b ; 27 2f8f2: 50 91 f1 03 lds r21, 0x03F1 ; 0x8003f1 <_ZL22previous_nominal_speed.lto_priv.450+0x1> 2f8f6: 6f 96 adiw r28, 0x1f ; 31 2f8f8: 5f af std Y+63, r21 ; 0x3f 2f8fa: 6f 97 sbiw r28, 0x1f ; 31 2f8fc: 00 91 f2 03 lds r16, 0x03F2 ; 0x8003f2 <_ZL22previous_nominal_speed.lto_priv.450+0x2> 2f900: 10 91 f3 03 lds r17, 0x03F3 ; 0x8003f3 <_ZL22previous_nominal_speed.lto_priv.450+0x3> 2f904: 27 e1 ldi r18, 0x17 ; 23 2f906: 37 eb ldi r19, 0xB7 ; 183 2f908: 41 ed ldi r20, 0xD1 ; 209 2f90a: 58 e3 ldi r21, 0x38 ; 56 2f90c: 6b 96 adiw r28, 0x1b ; 27 2f90e: 6f ad ldd r22, Y+63 ; 0x3f 2f910: 6b 97 sbiw r28, 0x1b ; 27 2f912: 6f 96 adiw r28, 0x1f ; 31 2f914: 7f ad ldd r23, Y+63 ; 0x3f 2f916: 6f 97 sbiw r28, 0x1f ; 31 2f918: c8 01 movw r24, r16 2f91a: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 2f91e: 18 16 cp r1, r24 2f920: 0c f0 brlt .+2 ; 0x2f924 2f922: 71 c6 rjmp .+3298 ; 0x30606 // 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); 2f924: 6b 96 adiw r28, 0x1b ; 27 2f926: 2f ad ldd r18, Y+63 ; 0x3f 2f928: 6b 97 sbiw r28, 0x1b ; 27 2f92a: 6f 96 adiw r28, 0x1f ; 31 2f92c: 3f ad ldd r19, Y+63 ; 0x3f 2f92e: 6f 97 sbiw r28, 0x1f ; 31 2f930: a8 01 movw r20, r16 2f932: 27 96 adiw r28, 0x07 ; 7 2f934: 6f ad ldd r22, Y+63 ; 0x3f 2f936: 27 97 sbiw r28, 0x07 ; 7 2f938: 2b 96 adiw r28, 0x0b ; 11 2f93a: 7f ad ldd r23, Y+63 ; 0x3f 2f93c: 2b 97 sbiw r28, 0x0b ; 11 2f93e: 2f 96 adiw r28, 0x0f ; 15 2f940: 8f ad ldd r24, Y+63 ; 0x3f 2f942: 2f 97 sbiw r28, 0x0f ; 15 2f944: 63 96 adiw r28, 0x13 ; 19 2f946: 9f ad ldd r25, Y+63 ; 0x3f 2f948: 63 97 sbiw r28, 0x13 ; 19 2f94a: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 2f94e: 87 ff sbrs r24, 7 2f950: 01 c6 rjmp .+3074 ; 0x30554 2f952: 6b 96 adiw r28, 0x1b ; 27 2f954: 2f ad ldd r18, Y+63 ; 0x3f 2f956: 6b 97 sbiw r28, 0x1b ; 27 2f958: 6f 96 adiw r28, 0x1f ; 31 2f95a: 3f ad ldd r19, Y+63 ; 0x3f 2f95c: 6f 97 sbiw r28, 0x1f ; 31 2f95e: a8 01 movw r20, r16 2f960: 27 96 adiw r28, 0x07 ; 7 2f962: 6f ad ldd r22, Y+63 ; 0x3f 2f964: 27 97 sbiw r28, 0x07 ; 7 2f966: 2b 96 adiw r28, 0x0b ; 11 2f968: 7f ad ldd r23, Y+63 ; 0x3f 2f96a: 2b 97 sbiw r28, 0x0b ; 11 2f96c: 2f 96 adiw r28, 0x0f ; 15 2f96e: 8f ad ldd r24, Y+63 ; 0x3f 2f970: 2f 97 sbiw r28, 0x0f ; 15 2f972: 63 96 adiw r28, 0x13 ; 19 2f974: 9f ad ldd r25, Y+63 ; 0x3f 2f976: 63 97 sbiw r28, 0x13 ; 19 2f978: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2f97c: eb 96 adiw r28, 0x3b ; 59 2f97e: 6c af std Y+60, r22 ; 0x3c 2f980: 7d af std Y+61, r23 ; 0x3d 2f982: 8e af std Y+62, r24 ; 0x3e 2f984: 9f af std Y+63, r25 ; 0x3f 2f986: 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; 2f988: 27 96 adiw r28, 0x07 ; 7 2f98a: 8f ad ldd r24, Y+63 ; 0x3f 2f98c: 27 97 sbiw r28, 0x07 ; 7 2f98e: 8d af std Y+61, r24 ; 0x3d 2f990: 2b 96 adiw r28, 0x0b ; 11 2f992: 9f ad ldd r25, Y+63 ; 0x3f 2f994: 2b 97 sbiw r28, 0x0b ; 11 2f996: 9d ab std Y+53, r25 ; 0x35 2f998: 2f 96 adiw r28, 0x0f ; 15 2f99a: af ad ldd r26, Y+63 ; 0x3f 2f99c: 2f 97 sbiw r28, 0x0f ; 15 2f99e: ae af std Y+62, r26 ; 0x3e 2f9a0: 63 96 adiw r28, 0x13 ; 19 2f9a2: bf ad ldd r27, Y+63 ; 0x3f 2f9a4: 63 97 sbiw r28, 0x13 ; 19 2f9a6: 23 96 adiw r28, 0x03 ; 3 2f9a8: bf af std Y+63, r27 ; 0x3f 2f9aa: 23 97 sbiw r28, 0x03 ; 3 2f9ac: 24 ef ldi r18, 0xF4 ; 244 2f9ae: 33 e0 ldi r19, 0x03 ; 3 2f9b0: e7 96 adiw r28, 0x37 ; 55 2f9b2: 3f af std Y+63, r19 ; 0x3f 2f9b4: 2e af std Y+62, r18 ; 0x3e 2f9b6: e7 97 sbiw r28, 0x37 ; 55 // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. float v_factor = 1.f; 2f9b8: 41 2c mov r4, r1 2f9ba: 51 2c mov r5, r1 2f9bc: 30 e8 ldi r19, 0x80 ; 128 2f9be: 63 2e mov r6, r19 2f9c0: 3f e3 ldi r19, 0x3F ; 63 2f9c2: 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]; 2f9c4: e7 96 adiw r28, 0x37 ; 55 2f9c6: ae ad ldd r26, Y+62 ; 0x3e 2f9c8: bf ad ldd r27, Y+63 ; 0x3f 2f9ca: e7 97 sbiw r28, 0x37 ; 55 2f9cc: 8d 90 ld r8, X+ 2f9ce: 9d 90 ld r9, X+ 2f9d0: ad 90 ld r10, X+ 2f9d2: bd 90 ld r11, X+ 2f9d4: e7 96 adiw r28, 0x37 ; 55 2f9d6: bf af std Y+63, r27 ; 0x3f 2f9d8: ae af std Y+62, r26 ; 0x3e 2f9da: e7 97 sbiw r28, 0x37 ; 55 float v_entry = current_speed [axis]; 2f9dc: 6e 96 adiw r28, 0x1e ; 30 2f9de: ee ad ldd r30, Y+62 ; 0x3e 2f9e0: ff ad ldd r31, Y+63 ; 0x3f 2f9e2: 6e 97 sbiw r28, 0x1e ; 30 2f9e4: c1 90 ld r12, Z+ 2f9e6: d1 90 ld r13, Z+ 2f9e8: e1 90 ld r14, Z+ 2f9ea: f1 90 ld r15, Z+ 2f9ec: 6e 96 adiw r28, 0x1e ; 30 2f9ee: ff af std Y+63, r31 ; 0x3f 2f9f0: ee af std Y+62, r30 ; 0x3e 2f9f2: 6e 97 sbiw r28, 0x1e ; 30 if (prev_speed_larger) 2f9f4: 6b 96 adiw r28, 0x1b ; 27 2f9f6: 2f ad ldd r18, Y+63 ; 0x3f 2f9f8: 6b 97 sbiw r28, 0x1b ; 27 2f9fa: 6f 96 adiw r28, 0x1f ; 31 2f9fc: 3f ad ldd r19, Y+63 ; 0x3f 2f9fe: 6f 97 sbiw r28, 0x1f ; 31 2fa00: a8 01 movw r20, r16 2fa02: 27 96 adiw r28, 0x07 ; 7 2fa04: 6f ad ldd r22, Y+63 ; 0x3f 2fa06: 27 97 sbiw r28, 0x07 ; 7 2fa08: 2b 96 adiw r28, 0x0b ; 11 2fa0a: 7f ad ldd r23, Y+63 ; 0x3f 2fa0c: 2b 97 sbiw r28, 0x0b ; 11 2fa0e: 2f 96 adiw r28, 0x0f ; 15 2fa10: 8f ad ldd r24, Y+63 ; 0x3f 2fa12: 2f 97 sbiw r28, 0x0f ; 15 2fa14: 63 96 adiw r28, 0x13 ; 19 2fa16: 9f ad ldd r25, Y+63 ; 0x3f 2fa18: 63 97 sbiw r28, 0x13 ; 19 2fa1a: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 2fa1e: 87 ff sbrs r24, 7 2fa20: 0c c0 rjmp .+24 ; 0x2fa3a v_exit *= smaller_speed_factor; 2fa22: eb 96 adiw r28, 0x3b ; 59 2fa24: 2c ad ldd r18, Y+60 ; 0x3c 2fa26: 3d ad ldd r19, Y+61 ; 0x3d 2fa28: 4e ad ldd r20, Y+62 ; 0x3e 2fa2a: 5f ad ldd r21, Y+63 ; 0x3f 2fa2c: eb 97 sbiw r28, 0x3b ; 59 2fa2e: c5 01 movw r24, r10 2fa30: b4 01 movw r22, r8 2fa32: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2fa36: 4b 01 movw r8, r22 2fa38: 5c 01 movw r10, r24 if (limited) { 2fa3a: a1 96 adiw r28, 0x21 ; 33 2fa3c: ff ad ldd r31, Y+63 ; 0x3f 2fa3e: a1 97 sbiw r28, 0x21 ; 33 2fa40: ff 23 and r31, r31 2fa42: 81 f0 breq .+32 ; 0x2fa64 v_exit *= v_factor; 2fa44: a3 01 movw r20, r6 2fa46: 92 01 movw r18, r4 2fa48: c5 01 movw r24, r10 2fa4a: b4 01 movw r22, r8 2fa4c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2fa50: 4b 01 movw r8, r22 2fa52: 5c 01 movw r10, r24 v_entry *= v_factor; 2fa54: a3 01 movw r20, r6 2fa56: 92 01 movw r18, r4 2fa58: c7 01 movw r24, r14 2fa5a: b6 01 movw r22, r12 2fa5c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2fa60: 6b 01 movw r12, r22 2fa62: 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) ? 2fa64: a7 01 movw r20, r14 2fa66: 96 01 movw r18, r12 2fa68: c5 01 movw r24, r10 2fa6a: b4 01 movw r22, r8 2fa6c: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> ((v_entry > 0.f || v_exit < 0.f) ? 2fa70: 20 e0 ldi r18, 0x00 ; 0 2fa72: 30 e0 ldi r19, 0x00 ; 0 2fa74: 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) ? 2fa76: 18 16 cp r1, r24 2fa78: 0c f0 brlt .+2 ; 0x2fa7c 2fa7a: a3 c5 rjmp .+2886 ; 0x305c2 ((v_entry > 0.f || v_exit < 0.f) ? 2fa7c: c7 01 movw r24, r14 2fa7e: b6 01 movw r22, r12 2fa80: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 2fa84: 18 16 cp r1, r24 2fa86: 4c f0 brlt .+18 ; 0x2fa9a 2fa88: 20 e0 ldi r18, 0x00 ; 0 2fa8a: 30 e0 ldi r19, 0x00 ; 0 2fa8c: a9 01 movw r20, r18 2fa8e: c5 01 movw r24, r10 2fa90: b4 01 movw r22, r8 2fa92: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 2fa96: 87 ff sbrs r24, 7 2fa98: 85 c5 rjmp .+2826 ; 0x305a4 2fa9a: a7 01 movw r20, r14 2fa9c: 96 01 movw r18, r12 2fa9e: c5 01 movw r24, r10 2faa0: 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) ? 2faa2: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 2faa6: 6b 01 movw r12, r22 2faa8: 7c 01 movw r14, r24 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); if (jerk > cs.max_jerk[axis]) { 2faaa: ed 96 adiw r28, 0x3d ; 61 2faac: ae ad ldd r26, Y+62 ; 0x3e 2faae: bf ad ldd r27, Y+63 ; 0x3f 2fab0: ed 97 sbiw r28, 0x3d ; 61 2fab2: 8d 90 ld r8, X+ 2fab4: 9d 90 ld r9, X+ 2fab6: ad 90 ld r10, X+ 2fab8: bd 90 ld r11, X+ 2faba: ed 96 adiw r28, 0x3d ; 61 2fabc: bf af std Y+63, r27 ; 0x3f 2fabe: ae af std Y+62, r26 ; 0x3e 2fac0: ed 97 sbiw r28, 0x3d ; 61 2fac2: a5 01 movw r20, r10 2fac4: 94 01 movw r18, r8 2fac6: c7 01 movw r24, r14 2fac8: b6 01 movw r22, r12 2faca: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 2face: 18 16 cp r1, r24 2fad0: 94 f4 brge .+36 ; 0x2faf6 v_factor *= cs.max_jerk[axis] / jerk; 2fad2: a7 01 movw r20, r14 2fad4: 96 01 movw r18, r12 2fad6: c5 01 movw r24, r10 2fad8: b4 01 movw r22, r8 2fada: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2fade: 9b 01 movw r18, r22 2fae0: ac 01 movw r20, r24 2fae2: c3 01 movw r24, r6 2fae4: b2 01 movw r22, r4 2fae6: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2faea: 2b 01 movw r4, r22 2faec: 3c 01 movw r6, r24 limited = true; 2faee: b1 e0 ldi r27, 0x01 ; 1 2faf0: a1 96 adiw r28, 0x21 ; 33 2faf2: bf af std Y+63, r27 ; 0x3f 2faf4: 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) { 2faf6: e4 e0 ldi r30, 0x04 ; 4 2faf8: f4 e0 ldi r31, 0x04 ; 4 2fafa: e7 96 adiw r28, 0x37 ; 55 2fafc: 2e ad ldd r18, Y+62 ; 0x3e 2fafe: 3f ad ldd r19, Y+63 ; 0x3f 2fb00: e7 97 sbiw r28, 0x37 ; 55 2fb02: e2 17 cp r30, r18 2fb04: f3 07 cpc r31, r19 2fb06: 09 f0 breq .+2 ; 0x2fb0a 2fb08: 5d cf rjmp .-326 ; 0x2f9c4 if (jerk > cs.max_jerk[axis]) { v_factor *= cs.max_jerk[axis] / jerk; limited = true; } } if (limited) 2fb0a: a1 96 adiw r28, 0x21 ; 33 2fb0c: 3f ad ldd r19, Y+63 ; 0x3f 2fb0e: a1 97 sbiw r28, 0x21 ; 33 2fb10: 33 23 and r19, r19 2fb12: 81 f0 breq .+32 ; 0x2fb34 vmax_junction *= v_factor; 2fb14: a3 01 movw r20, r6 2fb16: 92 01 movw r18, r4 2fb18: 6d ad ldd r22, Y+61 ; 0x3d 2fb1a: 7d a9 ldd r23, Y+53 ; 0x35 2fb1c: 8e ad ldd r24, Y+62 ; 0x3e 2fb1e: 23 96 adiw r28, 0x03 ; 3 2fb20: 9f ad ldd r25, Y+63 ; 0x3f 2fb22: 23 97 sbiw r28, 0x03 ; 3 2fb24: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2fb28: 6d af std Y+61, r22 ; 0x3d 2fb2a: 7d ab std Y+53, r23 ; 0x35 2fb2c: 8e af std Y+62, r24 ; 0x3e 2fb2e: 23 96 adiw r28, 0x03 ; 3 2fb30: 9f af std Y+63, r25 ; 0x3f 2fb32: 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; 2fb34: 24 ea ldi r18, 0xA4 ; 164 2fb36: 30 e7 ldi r19, 0x70 ; 112 2fb38: 4d e7 ldi r20, 0x7D ; 125 2fb3a: 5f e3 ldi r21, 0x3F ; 63 2fb3c: 6d ad ldd r22, Y+61 ; 0x3d 2fb3e: 7d a9 ldd r23, Y+53 ; 0x35 2fb40: 8e ad ldd r24, Y+62 ; 0x3e 2fb42: 23 96 adiw r28, 0x03 ; 3 2fb44: 9f ad ldd r25, Y+63 ; 0x3f 2fb46: 23 97 sbiw r28, 0x03 ; 3 2fb48: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2fb4c: 6b 01 movw r12, r22 2fb4e: 7c 01 movw r14, r24 if (previous_safe_speed > vmax_junction_threshold && safe_speed > vmax_junction_threshold) { 2fb50: ac 01 movw r20, r24 2fb52: 9b 01 movw r18, r22 2fb54: 60 91 dd 16 lds r22, 0x16DD ; 0x8016dd 2fb58: 70 91 de 16 lds r23, 0x16DE ; 0x8016de 2fb5c: 80 91 df 16 lds r24, 0x16DF ; 0x8016df 2fb60: 90 91 e0 16 lds r25, 0x16E0 ; 0x8016e0 2fb64: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 2fb68: 18 16 cp r1, r24 2fb6a: fc f4 brge .+62 ; 0x2fbaa 2fb6c: 29 a5 ldd r18, Y+41 ; 0x29 2fb6e: 3d a5 ldd r19, Y+45 ; 0x2d 2fb70: 49 ad ldd r20, Y+57 ; 0x39 2fb72: 59 a9 ldd r21, Y+49 ; 0x31 2fb74: c7 01 movw r24, r14 2fb76: b6 01 movw r22, r12 2fb78: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 2fb7c: 87 ff sbrs r24, 7 2fb7e: 15 c0 rjmp .+42 ; 0x2fbaa // 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; 2fb80: 8e e6 ldi r24, 0x6E ; 110 2fb82: 82 9d mul r24, r2 2fb84: f0 01 movw r30, r0 2fb86: 83 9d mul r24, r3 2fb88: f0 0d add r31, r0 2fb8a: 11 24 eor r1, r1 2fb8c: e8 53 subi r30, 0x38 ; 56 2fb8e: f9 4f sbci r31, 0xF9 ; 249 2fb90: 85 a9 ldd r24, Z+53 ; 0x35 2fb92: 84 60 ori r24, 0x04 ; 4 2fb94: 85 ab std Z+53, r24 ; 0x35 2fb96: 49 a5 ldd r20, Y+41 ; 0x29 2fb98: 4d af std Y+61, r20 ; 0x3d 2fb9a: 5d a5 ldd r21, Y+45 ; 0x2d 2fb9c: 5d ab std Y+53, r21 ; 0x35 2fb9e: 89 ad ldd r24, Y+57 ; 0x39 2fba0: 8e af std Y+62, r24 ; 0x3e 2fba2: 99 a9 ldd r25, Y+49 ; 0x31 2fba4: 23 96 adiw r28, 0x03 ; 3 2fba6: 9f af std Y+63, r25 ; 0x3f 2fba8: 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; 2fbaa: 8e e6 ldi r24, 0x6E ; 110 2fbac: 82 9d mul r24, r2 2fbae: 80 01 movw r16, r0 2fbb0: 83 9d mul r24, r3 2fbb2: 10 0d add r17, r0 2fbb4: 11 24 eor r1, r1 2fbb6: 08 53 subi r16, 0x38 ; 56 2fbb8: 19 4f sbci r17, 0xF9 ; 249 2fbba: 8d ad ldd r24, Y+61 ; 0x3d 2fbbc: 9d a9 ldd r25, Y+53 ; 0x35 2fbbe: ae ad ldd r26, Y+62 ; 0x3e 2fbc0: 23 96 adiw r28, 0x03 ; 3 2fbc2: bf ad ldd r27, Y+63 ; 0x3f 2fbc4: 23 97 sbiw r28, 0x03 ; 3 2fbc6: f8 01 movw r30, r16 2fbc8: 81 a7 std Z+41, r24 ; 0x29 2fbca: 92 a7 std Z+42, r25 ; 0x2a 2fbcc: a3 a7 std Z+43, r26 ; 0x2b 2fbce: 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); 2fbd0: 29 a5 ldd r18, Y+41 ; 0x29 2fbd2: 3d a5 ldd r19, Y+45 ; 0x2d 2fbd4: 49 ad ldd r20, Y+57 ; 0x39 2fbd6: 59 a9 ldd r21, Y+49 ; 0x31 2fbd8: 69 a5 ldd r22, Y+41 ; 0x29 2fbda: 7d a5 ldd r23, Y+45 ; 0x2d 2fbdc: 89 ad ldd r24, Y+57 ; 0x39 2fbde: 99 a9 ldd r25, Y+49 ; 0x31 2fbe0: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2fbe4: 6b 01 movw r12, r22 2fbe6: 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); 2fbe8: e1 96 adiw r28, 0x31 ; 49 2fbea: 6c ad ldd r22, Y+60 ; 0x3c 2fbec: 7d ad ldd r23, Y+61 ; 0x3d 2fbee: 8e ad ldd r24, Y+62 ; 0x3e 2fbf0: 9f ad ldd r25, Y+63 ; 0x3f 2fbf2: e1 97 sbiw r28, 0x31 ; 49 2fbf4: 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); 2fbf6: 9b 01 movw r18, r22 2fbf8: ac 01 movw r20, r24 2fbfa: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 2fbfe: d8 01 movw r26, r16 2fc00: 9d 96 adiw r26, 0x2d ; 45 2fc02: 2d 91 ld r18, X+ 2fc04: 3d 91 ld r19, X+ 2fc06: 4d 91 ld r20, X+ 2fc08: 5c 91 ld r21, X 2fc0a: d0 97 sbiw r26, 0x30 ; 48 2fc0c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2fc10: 9b 01 movw r18, r22 2fc12: ac 01 movw r20, r24 2fc14: c7 01 movw r24, r14 2fc16: b6 01 movw r22, r12 2fc18: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 2fc1c: 0f 94 91 a5 call 0x34b22 ; 0x34b22 2fc20: d6 2e mov r13, r22 2fc22: e7 2e mov r14, r23 2fc24: 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); 2fc26: 2d ad ldd r18, Y+61 ; 0x3d 2fc28: 3d a9 ldd r19, Y+53 ; 0x35 2fc2a: 4e ad ldd r20, Y+62 ; 0x3e 2fc2c: 23 96 adiw r28, 0x03 ; 3 2fc2e: 5f ad ldd r21, Y+63 ; 0x3f 2fc30: 23 97 sbiw r28, 0x03 ; 3 2fc32: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 2fc36: 18 16 cp r1, r24 2fc38: 34 f0 brlt .+12 ; 0x2fc46 2fc3a: dd ae std Y+61, r13 ; 0x3d 2fc3c: ed aa std Y+53, r14 ; 0x35 2fc3e: 0e af std Y+62, r16 ; 0x3e 2fc40: 23 96 adiw r28, 0x03 ; 3 2fc42: 1f af std Y+63, r17 ; 0x3f 2fc44: 23 97 sbiw r28, 0x03 ; 3 2fc46: 8e e6 ldi r24, 0x6E ; 110 2fc48: 82 9d mul r24, r2 2fc4a: f0 01 movw r30, r0 2fc4c: 83 9d mul r24, r3 2fc4e: f0 0d add r31, r0 2fc50: 11 24 eor r1, r1 2fc52: e8 53 subi r30, 0x38 ; 56 2fc54: f9 4f sbci r31, 0xF9 ; 249 2fc56: 8d ad ldd r24, Y+61 ; 0x3d 2fc58: 9d a9 ldd r25, Y+53 ; 0x35 2fc5a: ae ad ldd r26, Y+62 ; 0x3e 2fc5c: 23 96 adiw r28, 0x03 ; 3 2fc5e: bf ad ldd r27, Y+63 ; 0x3f 2fc60: 23 97 sbiw r28, 0x03 ; 3 2fc62: 85 a3 std Z+37, r24 ; 0x25 2fc64: 96 a3 std Z+38, r25 ; 0x26 2fc66: a7 a3 std Z+39, r26 ; 0x27 2fc68: 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; 2fc6a: f5 a8 ldd r15, Z+53 ; 0x35 2fc6c: 2d 2d mov r18, r13 2fc6e: 3e 2d mov r19, r14 2fc70: a8 01 movw r20, r16 2fc72: 27 96 adiw r28, 0x07 ; 7 2fc74: 6f ad ldd r22, Y+63 ; 0x3f 2fc76: 27 97 sbiw r28, 0x07 ; 7 2fc78: 2b 96 adiw r28, 0x0b ; 11 2fc7a: 7f ad ldd r23, Y+63 ; 0x3f 2fc7c: 2b 97 sbiw r28, 0x0b ; 11 2fc7e: 2f 96 adiw r28, 0x0f ; 15 2fc80: 8f ad ldd r24, Y+63 ; 0x3f 2fc82: 2f 97 sbiw r28, 0x0f ; 15 2fc84: 63 96 adiw r28, 0x13 ; 19 2fc86: 9f ad ldd r25, Y+63 ; 0x3f 2fc88: 63 97 sbiw r28, 0x13 ; 19 2fc8a: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 2fc8e: 18 16 cp r1, r24 2fc90: 0c f4 brge .+2 ; 0x2fc94 2fc92: cf c4 rjmp .+2462 ; 0x30632 2fc94: 83 e0 ldi r24, 0x03 ; 3 2fc96: 9e e6 ldi r25, 0x6E ; 110 2fc98: 92 9d mul r25, r2 2fc9a: 80 01 movw r16, r0 2fc9c: 93 9d mul r25, r3 2fc9e: 10 0d add r17, r0 2fca0: 11 24 eor r1, r1 2fca2: 08 53 subi r16, 0x38 ; 56 2fca4: 19 4f sbci r17, 0xF9 ; 249 2fca6: f8 2a or r15, r24 2fca8: f8 01 movw r30, r16 2fcaa: 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[] 2fcac: 80 e1 ldi r24, 0x10 ; 16 2fcae: fe 01 movw r30, r28 2fcb0: 71 96 adiw r30, 0x11 ; 17 2fcb2: a4 ef ldi r26, 0xF4 ; 244 2fcb4: b3 e0 ldi r27, 0x03 ; 3 2fcb6: 01 90 ld r0, Z+ 2fcb8: 0d 92 st X+, r0 2fcba: 8a 95 dec r24 2fcbc: e1 f7 brne .-8 ; 0x2fcb6 previous_nominal_speed = block->nominal_speed; 2fcbe: 27 96 adiw r28, 0x07 ; 7 2fcc0: 8f ad ldd r24, Y+63 ; 0x3f 2fcc2: 27 97 sbiw r28, 0x07 ; 7 2fcc4: 2b 96 adiw r28, 0x0b ; 11 2fcc6: 9f ad ldd r25, Y+63 ; 0x3f 2fcc8: 2b 97 sbiw r28, 0x0b ; 11 2fcca: 2f 96 adiw r28, 0x0f ; 15 2fccc: af ad ldd r26, Y+63 ; 0x3f 2fcce: 2f 97 sbiw r28, 0x0f ; 15 2fcd0: 63 96 adiw r28, 0x13 ; 19 2fcd2: bf ad ldd r27, Y+63 ; 0x3f 2fcd4: 63 97 sbiw r28, 0x13 ; 19 2fcd6: 80 93 f0 03 sts 0x03F0, r24 ; 0x8003f0 <_ZL22previous_nominal_speed.lto_priv.450> 2fcda: 90 93 f1 03 sts 0x03F1, r25 ; 0x8003f1 <_ZL22previous_nominal_speed.lto_priv.450+0x1> 2fcde: a0 93 f2 03 sts 0x03F2, r26 ; 0x8003f2 <_ZL22previous_nominal_speed.lto_priv.450+0x2> 2fce2: b0 93 f3 03 sts 0x03F3, r27 ; 0x8003f3 <_ZL22previous_nominal_speed.lto_priv.450+0x3> previous_safe_speed = safe_speed; 2fce6: 89 a5 ldd r24, Y+41 ; 0x29 2fce8: 9d a5 ldd r25, Y+45 ; 0x2d 2fcea: a9 ad ldd r26, Y+57 ; 0x39 2fcec: b9 a9 ldd r27, Y+49 ; 0x31 2fcee: 80 93 dd 16 sts 0x16DD, r24 ; 0x8016dd 2fcf2: 90 93 de 16 sts 0x16DE, r25 ; 0x8016de 2fcf6: a0 93 df 16 sts 0x16DF, r26 ; 0x8016df 2fcfa: 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; 2fcfe: d8 01 movw r26, r16 2fd00: d6 96 adiw r26, 0x36 ; 54 2fd02: 6d 91 ld r22, X+ 2fd04: 7d 91 ld r23, X+ 2fd06: 8d 91 ld r24, X+ 2fd08: 9c 91 ld r25, X 2fd0a: d9 97 sbiw r26, 0x39 ; 57 2fd0c: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 2fd10: 27 96 adiw r28, 0x07 ; 7 2fd12: 2f ad ldd r18, Y+63 ; 0x3f 2fd14: 27 97 sbiw r28, 0x07 ; 7 2fd16: 2b 96 adiw r28, 0x0b ; 11 2fd18: 3f ad ldd r19, Y+63 ; 0x3f 2fd1a: 2b 97 sbiw r28, 0x0b ; 11 2fd1c: 2f 96 adiw r28, 0x0f ; 15 2fd1e: 4f ad ldd r20, Y+63 ; 0x3f 2fd20: 2f 97 sbiw r28, 0x0f ; 15 2fd22: 63 96 adiw r28, 0x13 ; 19 2fd24: 5f ad ldd r21, Y+63 ; 0x3f 2fd26: 63 97 sbiw r28, 0x13 ; 19 2fd28: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2fd2c: 2b 01 movw r4, r22 2fd2e: 3c 01 movw r6, r24 2fd30: f8 01 movw r30, r16 2fd32: e8 5b subi r30, 0xB8 ; 184 2fd34: ff 4f sbci r31, 0xFF ; 255 2fd36: 40 82 st Z, r4 2fd38: 51 82 std Z+1, r5 ; 0x01 2fd3a: 62 82 std Z+2, r6 ; 0x02 2fd3c: 73 82 std Z+3, r7 ; 0x03 #ifdef LIN_ADVANCE if (block->use_advance_lead) { 2fd3e: 34 96 adiw r30, 0x04 ; 4 2fd40: 80 81 ld r24, Z 2fd42: 88 23 and r24, r24 2fd44: 09 f4 brne .+2 ; 0x2fd48 2fd46: 89 c0 rjmp .+274 ; 0x2fe5a // 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)) 2fd48: 20 91 e1 16 lds r18, 0x16E1 ; 0x8016e1 2fd4c: 30 91 e2 16 lds r19, 0x16E2 ; 0x8016e2 2fd50: 40 91 e3 16 lds r20, 0x16E3 ; 0x8016e3 2fd54: 50 91 e4 16 lds r21, 0x16E4 ; 0x8016e4 2fd58: 6a 96 adiw r28, 0x1a ; 26 2fd5a: 6c ad ldd r22, Y+60 ; 0x3c 2fd5c: 7d ad ldd r23, Y+61 ; 0x3d 2fd5e: 8e ad ldd r24, Y+62 ; 0x3e 2fd60: 9f ad ldd r25, Y+63 ; 0x3f 2fd62: 6a 97 sbiw r28, 0x1a ; 26 2fd64: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2fd68: 4b 01 movw r8, r22 2fd6a: 5c 01 movw r10, r24 2fd6c: c0 90 42 04 lds r12, 0x0442 ; 0x800442 2fd70: d0 90 43 04 lds r13, 0x0443 ; 0x800443 2fd74: e0 90 44 04 lds r14, 0x0444 ; 0x800444 2fd78: f0 90 45 04 lds r15, 0x0445 ; 0x800445 block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 2fd7c: 0c 5a subi r16, 0xAC ; 172 2fd7e: 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)) 2fd80: a7 01 movw r20, r14 2fd82: 96 01 movw r18, r12 2fd84: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 2fd88: a3 01 movw r20, r6 2fd8a: 92 01 movw r18, r4 2fd8c: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2fd90: f8 01 movw r30, r16 2fd92: 60 83 st Z, r22 2fd94: 71 83 std Z+1, r23 ; 0x01 2fd96: 82 83 std Z+2, r24 ; 0x02 2fd98: 93 83 std Z+3, r25 ; 0x03 float advance_speed; if (e_D_ratio > 0) 2fd9a: 20 e0 ldi r18, 0x00 ; 0 2fd9c: 30 e0 ldi r19, 0x00 ; 0 2fd9e: a9 01 movw r20, r18 2fda0: 6a 96 adiw r28, 0x1a ; 26 2fda2: 6c ad ldd r22, Y+60 ; 0x3c 2fda4: 7d ad ldd r23, Y+61 ; 0x3d 2fda6: 8e ad ldd r24, Y+62 ; 0x3e 2fda8: 9f ad ldd r25, Y+63 ; 0x3f 2fdaa: 6a 97 sbiw r28, 0x1a ; 26 2fdac: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 2fdb0: 18 16 cp r1, r24 2fdb2: 0c f0 brlt .+2 ; 0x2fdb6 2fdb4: 40 c4 rjmp .+2176 ; 0x30636 advance_speed = (extruder_advance_K * e_D_ratio * block->acceleration * cs.axis_steps_per_mm[E_AXIS]); 2fdb6: a5 01 movw r20, r10 2fdb8: 94 01 movw r18, r8 2fdba: e1 96 adiw r28, 0x31 ; 49 2fdbc: 6c ad ldd r22, Y+60 ; 0x3c 2fdbe: 7d ad ldd r23, Y+61 ; 0x3d 2fdc0: 8e ad ldd r24, Y+62 ; 0x3e 2fdc2: 9f ad ldd r25, Y+63 ; 0x3f 2fdc4: e1 97 sbiw r28, 0x31 ; 49 2fdc6: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2fdca: a7 01 movw r20, r14 2fdcc: 96 01 movw r18, r12 else advance_speed = cs.max_jerk[E_AXIS] * cs.axis_steps_per_mm[E_AXIS]; 2fdce: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2fdd2: 6b 01 movw r12, r22 2fdd4: 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; 2fdd6: 20 e0 ldi r18, 0x00 ; 0 2fdd8: 30 e4 ldi r19, 0x40 ; 64 2fdda: 4c e1 ldi r20, 0x1C ; 28 2fddc: 57 e4 ldi r21, 0x47 ; 71 2fdde: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 2fde2: 18 16 cp r1, r24 2fde4: 3c f4 brge .+14 ; 0x2fdf4 2fde6: c1 2c mov r12, r1 2fde8: 20 e4 ldi r18, 0x40 ; 64 2fdea: d2 2e mov r13, r18 2fdec: 2c e1 ldi r18, 0x1C ; 28 2fdee: e2 2e mov r14, r18 2fdf0: 27 e4 ldi r18, 0x47 ; 71 2fdf2: f2 2e mov r15, r18 float advance_rate = (F_CPU / 8.0) / advance_speed; 2fdf4: a7 01 movw r20, r14 2fdf6: 96 01 movw r18, r12 2fdf8: 60 e0 ldi r22, 0x00 ; 0 2fdfa: 74 e2 ldi r23, 0x24 ; 36 2fdfc: 84 ef ldi r24, 0xF4 ; 244 2fdfe: 99 e4 ldi r25, 0x49 ; 73 2fe00: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 2fe04: 4b 01 movw r8, r22 2fe06: 5c 01 movw r10, r24 if (advance_speed > 20000) { 2fe08: 20 e0 ldi r18, 0x00 ; 0 2fe0a: 30 e4 ldi r19, 0x40 ; 64 2fe0c: 4c e9 ldi r20, 0x9C ; 156 2fe0e: 56 e4 ldi r21, 0x46 ; 70 2fe10: c7 01 movw r24, r14 2fe12: b6 01 movw r22, r12 2fe14: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 2fe18: 18 16 cp r1, r24 2fe1a: 0c f0 brlt .+2 ; 0x2fe1e 2fe1c: 17 c4 rjmp .+2094 ; 0x3064c block->advance_rate = advance_rate * 4; 2fe1e: 8e e6 ldi r24, 0x6E ; 110 2fe20: 82 9d mul r24, r2 2fe22: 80 01 movw r16, r0 2fe24: 83 9d mul r24, r3 2fe26: 10 0d add r17, r0 2fe28: 11 24 eor r1, r1 2fe2a: 08 53 subi r16, 0x38 ; 56 2fe2c: 19 4f sbci r17, 0xF9 ; 249 2fe2e: 78 01 movw r14, r16 2fe30: fd e4 ldi r31, 0x4D ; 77 2fe32: ef 0e add r14, r31 2fe34: f1 1c adc r15, r1 2fe36: 20 e0 ldi r18, 0x00 ; 0 2fe38: 30 e0 ldi r19, 0x00 ; 0 2fe3a: 40 e8 ldi r20, 0x80 ; 128 2fe3c: 50 e4 ldi r21, 0x40 ; 64 2fe3e: c5 01 movw r24, r10 2fe40: b4 01 movw r22, r8 2fe42: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 2fe46: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 2fe4a: d7 01 movw r26, r14 2fe4c: 6d 93 st X+, r22 2fe4e: 7c 93 st X, r23 block->advance_step_loops = 4; 2fe50: f8 01 movw r30, r16 2fe52: ed 5a subi r30, 0xAD ; 173 2fe54: ff 4f sbci r31, 0xFF ; 255 2fe56: 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; 2fe58: 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); 2fe5a: 09 a5 ldd r16, Y+41 ; 0x29 2fe5c: 1d a5 ldd r17, Y+45 ; 0x2d 2fe5e: 29 ad ldd r18, Y+57 ; 0x39 2fe60: 39 a9 ldd r19, Y+49 ; 0x31 2fe62: 4d ad ldd r20, Y+61 ; 0x3d 2fe64: 5d a9 ldd r21, Y+53 ; 0x35 2fe66: 6e ad ldd r22, Y+62 ; 0x3e 2fe68: 23 96 adiw r28, 0x03 ; 3 2fe6a: 7f ad ldd r23, Y+63 ; 0x3f 2fe6c: 23 97 sbiw r28, 0x03 ; 3 2fe6e: a3 96 adiw r28, 0x23 ; 35 2fe70: 8e ad ldd r24, Y+62 ; 0x3e 2fe72: 9f ad ldd r25, Y+63 ; 0x3f 2fe74: a3 97 sbiw r28, 0x23 ; 35 2fe76: 88 53 subi r24, 0x38 ; 56 2fe78: 99 4f sbci r25, 0xF9 ; 249 2fe7a: 0f 94 77 6c call 0x2d8ee ; 0x2d8ee if (block->step_event_count.wide <= 32767) 2fe7e: 8e e6 ldi r24, 0x6E ; 110 2fe80: 82 9d mul r24, r2 2fe82: f0 01 movw r30, r0 2fe84: 83 9d mul r24, r3 2fe86: f0 0d add r31, r0 2fe88: 11 24 eor r1, r1 2fe8a: e8 53 subi r30, 0x38 ; 56 2fe8c: f9 4f sbci r31, 0xF9 ; 249 2fe8e: 80 89 ldd r24, Z+16 ; 0x10 2fe90: 91 89 ldd r25, Z+17 ; 0x11 2fe92: a2 89 ldd r26, Z+18 ; 0x12 2fe94: b3 89 ldd r27, Z+19 ; 0x13 2fe96: 81 15 cp r24, r1 2fe98: 90 48 sbci r25, 0x80 ; 128 2fe9a: a1 05 cpc r26, r1 2fe9c: b1 05 cpc r27, r1 2fe9e: 18 f4 brcc .+6 ; 0x2fea6 block->flag |= BLOCK_FLAG_DDA_LOWRES; 2fea0: 85 a9 ldd r24, Z+53 ; 0x35 2fea2: 88 60 ori r24, 0x08 ; 8 2fea4: 85 ab std Z+53, r24 ; 0x35 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 2fea6: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2fea8: 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; 2feaa: 90 91 ac 0d lds r25, 0x0DAC ; 0x800dac 2feae: 91 11 cpse r25, r1 2feb0: 93 c4 rjmp .+2342 ; 0x307d8 block_buffer_head = next_buffer_head; 2feb2: a0 96 adiw r28, 0x20 ; 32 2feb4: 3f ad ldd r19, Y+63 ; 0x3f 2feb6: a0 97 sbiw r28, 0x20 ; 32 2feb8: 30 93 a8 0d sts 0x0DA8, r19 ; 0x800da8 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2febc: 8f bf out 0x3f, r24 ; 63 } // Update position memcpy(position, target, sizeof(target)); // position[] = target[] 2febe: c3 58 subi r28, 0x83 ; 131 2fec0: df 4f sbci r29, 0xFF ; 255 2fec2: 88 81 ld r24, Y 2fec4: 99 81 ldd r25, Y+1 ; 0x01 2fec6: aa 81 ldd r26, Y+2 ; 0x02 2fec8: bb 81 ldd r27, Y+3 ; 0x03 2feca: cd 57 subi r28, 0x7D ; 125 2fecc: d0 40 sbci r29, 0x00 ; 0 2fece: 80 93 a6 06 sts 0x06A6, r24 ; 0x8006a6 2fed2: 90 93 a7 06 sts 0x06A7, r25 ; 0x8006a7 2fed6: a0 93 a8 06 sts 0x06A8, r26 ; 0x8006a8 2feda: b0 93 a9 06 sts 0x06A9, r27 ; 0x8006a9 2fede: cf 57 subi r28, 0x7F ; 127 2fee0: df 4f sbci r29, 0xFF ; 255 2fee2: 28 81 ld r18, Y 2fee4: 39 81 ldd r19, Y+1 ; 0x01 2fee6: 4a 81 ldd r20, Y+2 ; 0x02 2fee8: 5b 81 ldd r21, Y+3 ; 0x03 2feea: c1 58 subi r28, 0x81 ; 129 2feec: d0 40 sbci r29, 0x00 ; 0 2feee: 20 93 aa 06 sts 0x06AA, r18 ; 0x8006aa 2fef2: 30 93 ab 06 sts 0x06AB, r19 ; 0x8006ab 2fef6: 40 93 ac 06 sts 0x06AC, r20 ; 0x8006ac 2fefa: 50 93 ad 06 sts 0x06AD, r21 ; 0x8006ad 2fefe: e5 96 adiw r28, 0x35 ; 53 2ff00: 8c ad ldd r24, Y+60 ; 0x3c 2ff02: 9d ad ldd r25, Y+61 ; 0x3d 2ff04: ae ad ldd r26, Y+62 ; 0x3e 2ff06: bf ad ldd r27, Y+63 ; 0x3f 2ff08: e5 97 sbiw r28, 0x35 ; 53 2ff0a: 80 93 ae 06 sts 0x06AE, r24 ; 0x8006ae 2ff0e: 90 93 af 06 sts 0x06AF, r25 ; 0x8006af 2ff12: a0 93 b0 06 sts 0x06B0, r26 ; 0x8006b0 2ff16: b0 93 b1 06 sts 0x06B1, r27 ; 0x8006b1 2ff1a: ad 96 adiw r28, 0x2d ; 45 2ff1c: 2c ad ldd r18, Y+60 ; 0x3c 2ff1e: 3d ad ldd r19, Y+61 ; 0x3d 2ff20: 4e ad ldd r20, Y+62 ; 0x3e 2ff22: 5f ad ldd r21, Y+63 ; 0x3f 2ff24: ad 97 sbiw r28, 0x2d ; 45 2ff26: 20 93 b2 06 sts 0x06B2, r18 ; 0x8006b2 2ff2a: 30 93 b3 06 sts 0x06B3, r19 ; 0x8006b3 2ff2e: 40 93 b4 06 sts 0x06B4, r20 ; 0x8006b4 2ff32: 50 93 b5 06 sts 0x06B5, r21 ; 0x8006b5 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 2ff36: 89 a1 ldd r24, Y+33 ; 0x21 2ff38: 9a a1 ldd r25, Y+34 ; 0x22 2ff3a: ab a1 ldd r26, Y+35 ; 0x23 2ff3c: bc a1 ldd r27, Y+36 ; 0x24 2ff3e: 80 93 04 04 sts 0x0404, r24 ; 0x800404 2ff42: 90 93 05 04 sts 0x0405, r25 ; 0x800405 2ff46: a0 93 06 04 sts 0x0406, r26 ; 0x800406 2ff4a: b0 93 07 04 sts 0x0407, r27 ; 0x800407 position_float[Y_AXIS] = y; 2ff4e: 8d a1 ldd r24, Y+37 ; 0x25 2ff50: 9e a1 ldd r25, Y+38 ; 0x26 2ff52: af a1 ldd r26, Y+39 ; 0x27 2ff54: b8 a5 ldd r27, Y+40 ; 0x28 2ff56: 80 93 08 04 sts 0x0408, r24 ; 0x800408 2ff5a: 90 93 09 04 sts 0x0409, r25 ; 0x800409 2ff5e: a0 93 0a 04 sts 0x040A, r26 ; 0x80040a 2ff62: b0 93 0b 04 sts 0x040B, r27 ; 0x80040b position_float[Z_AXIS] = z; 2ff66: a7 96 adiw r28, 0x27 ; 39 2ff68: 8c ad ldd r24, Y+60 ; 0x3c 2ff6a: 9d ad ldd r25, Y+61 ; 0x3d 2ff6c: ae ad ldd r26, Y+62 ; 0x3e 2ff6e: bf ad ldd r27, Y+63 ; 0x3f 2ff70: a7 97 sbiw r28, 0x27 ; 39 2ff72: 80 93 0c 04 sts 0x040C, r24 ; 0x80040c 2ff76: 90 93 0d 04 sts 0x040D, r25 ; 0x80040d 2ff7a: a0 93 0e 04 sts 0x040E, r26 ; 0x80040e 2ff7e: b0 93 0f 04 sts 0x040F, r27 ; 0x80040f position_float[E_AXIS] = e; 2ff82: a9 96 adiw r28, 0x29 ; 41 2ff84: ee ad ldd r30, Y+62 ; 0x3e 2ff86: ff ad ldd r31, Y+63 ; 0x3f 2ff88: a9 97 sbiw r28, 0x29 ; 41 2ff8a: 80 81 ld r24, Z 2ff8c: 91 81 ldd r25, Z+1 ; 0x01 2ff8e: a2 81 ldd r26, Z+2 ; 0x02 2ff90: b3 81 ldd r27, Z+3 ; 0x03 2ff92: 80 93 10 04 sts 0x0410, r24 ; 0x800410 2ff96: 90 93 11 04 sts 0x0411, r25 ; 0x800411 2ff9a: a0 93 12 04 sts 0x0412, r26 ; 0x800412 2ff9e: 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; 2ffa2: 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); 2ffa6: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 2ffaa: 8f 19 sub r24, r15 2ffac: 8f 70 andi r24, 0x0F ; 15 if (n_blocks >= 3) { 2ffae: 83 30 cpi r24, 0x03 ; 3 2ffb0: 40 f1 brcs .+80 ; 0x30002 // Initialize the last tripple of blocks. block_index = prev_block_index(block_buffer_head); 2ffb2: 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) 2ffb6: 11 11 cpse r17, r1 2ffb8: 01 c0 rjmp .+2 ; 0x2ffbc block_index = BLOCK_BUFFER_SIZE; 2ffba: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 2ffbc: 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; 2ffbe: fe e6 ldi r31, 0x6E ; 110 2ffc0: 1f 9f mul r17, r31 2ffc2: c0 01 movw r24, r0 2ffc4: 11 24 eor r1, r1 2ffc6: 9c 01 movw r18, r24 2ffc8: 28 53 subi r18, 0x38 ; 56 2ffca: 39 4f sbci r19, 0xF9 ; 249 2ffcc: 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) 2ffce: 11 11 cpse r17, r1 2ffd0: 01 c0 rjmp .+2 ; 0x2ffd4 block_index = BLOCK_BUFFER_SIZE; 2ffd2: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 2ffd4: 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)); 2ffd6: 3e e6 ldi r19, 0x6E ; 110 2ffd8: 13 9f mul r17, r19 2ffda: c0 01 movw r24, r0 2ffdc: 11 24 eor r1, r1 2ffde: ac 01 movw r20, r24 2ffe0: 48 53 subi r20, 0x38 ; 56 2ffe2: 59 4f sbci r21, 0xF9 ; 249 2ffe4: 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)); 2ffe6: 9e e6 ldi r25, 0x6E ; 110 2ffe8: 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) { 2ffea: f1 16 cp r15, r17 2ffec: 69 f0 breq .+26 ; 0x30008 if (current->flag & BLOCK_FLAG_START_FROM_FULL_HALT) { 2ffee: d6 01 movw r26, r12 2fff0: d5 96 adiw r26, 0x35 ; 53 2fff2: 0c 91 ld r16, X 2fff4: 02 ff sbrs r16, 2 2fff6: 7e c3 rjmp .+1788 ; 0x306f4 // 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); 2fff8: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 2fffc: 81 1b sub r24, r17 2fffe: 8f 70 andi r24, 0x0F ; 15 30000: f1 2e mov r15, r17 } // SERIAL_ECHOLNPGM("planner_recalculate - 2"); // Forward pass and recalculate the trapezoids. if (n_blocks >= 2) { 30002: 82 30 cpi r24, 0x02 ; 2 30004: 08 f4 brcc .+2 ; 0x30008 30006: a3 c0 rjmp .+326 ; 0x3014e // 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; 30008: 3e e6 ldi r19, 0x6E ; 110 3000a: f3 9e mul r15, r19 3000c: c0 01 movw r24, r0 3000e: 11 24 eor r1, r1 30010: ac 01 movw r20, r24 30012: 48 53 subi r20, 0x38 ; 56 30014: 59 4f sbci r21, 0xF9 ; 249 30016: 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) 30018: f3 94 inc r15 3001a: 50 e1 ldi r21, 0x10 ; 16 3001c: f5 12 cpse r15, r21 3001e: 01 c0 rjmp .+2 ; 0x30022 block_index = 0; 30020: 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)); 30022: ae e6 ldi r26, 0x6E ; 110 30024: fa 9e mul r15, r26 30026: c0 01 movw r24, r0 30028: 11 24 eor r1, r1 3002a: fc 01 movw r30, r24 3002c: e8 53 subi r30, 0x38 ; 56 3002e: f9 4f sbci r31, 0xF9 ; 249 30030: 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)); 30032: 8e e6 ldi r24, 0x6E ; 110 30034: 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) { 30036: d5 01 movw r26, r10 30038: d5 96 adiw r26, 0x35 ; 53 3003a: 8c 91 ld r24, X 3003c: d5 97 sbiw r26, 0x35 ; 53 3003e: 81 fd sbrc r24, 1 30040: 5a c0 rjmp .+180 ; 0x300f6 30042: 95 96 adiw r26, 0x25 ; 37 30044: 4d 90 ld r4, X+ 30046: 5d 90 ld r5, X+ 30048: 6d 90 ld r6, X+ 3004a: 7c 90 ld r7, X 3004c: 98 97 sbiw r26, 0x28 ; 40 3004e: f6 01 movw r30, r12 30050: 95 a0 ldd r9, Z+37 ; 0x25 30052: e6 a0 ldd r14, Z+38 ; 0x26 30054: 07 a1 ldd r16, Z+39 ; 0x27 30056: 10 a5 ldd r17, Z+40 ; 0x28 30058: 29 2d mov r18, r9 3005a: 3e 2d mov r19, r14 3005c: a8 01 movw r20, r16 3005e: c3 01 movw r24, r6 30060: b2 01 movw r22, r4 30062: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 30066: 87 ff sbrs r24, 7 30068: 46 c0 rjmp .+140 ; 0x300f6 // 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); 3006a: a3 01 movw r20, r6 3006c: 92 01 movw r18, r4 3006e: c3 01 movw r24, r6 30070: b2 01 movw r22, r4 30072: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 30076: 2b 01 movw r4, r22 30078: 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)); 3007a: d5 01 movw r26, r10 3007c: d1 96 adiw r26, 0x31 ; 49 3007e: 6d 91 ld r22, X+ 30080: 7d 91 ld r23, X+ 30082: 8d 91 ld r24, X+ 30084: 9c 91 ld r25, X 30086: d4 97 sbiw r26, 0x34 ; 52 30088: 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); 3008a: 9b 01 movw r18, r22 3008c: ac 01 movw r20, r24 3008e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 30092: f5 01 movw r30, r10 30094: 25 a5 ldd r18, Z+45 ; 0x2d 30096: 36 a5 ldd r19, Z+46 ; 0x2e 30098: 47 a5 ldd r20, Z+47 ; 0x2f 3009a: 50 a9 ldd r21, Z+48 ; 0x30 3009c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 300a0: 9b 01 movw r18, r22 300a2: ac 01 movw r20, r24 300a4: c3 01 movw r24, r6 300a6: b2 01 movw r22, r4 300a8: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 300ac: 0f 94 91 a5 call 0x34b22 ; 0x34b22 300b0: 2b 01 movw r4, r22 300b2: 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)); 300b4: 9b 01 movw r18, r22 300b6: ac 01 movw r20, r24 300b8: 69 2d mov r22, r9 300ba: 7e 2d mov r23, r14 300bc: c8 01 movw r24, r16 300be: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 300c2: 87 ff sbrs r24, 7 300c4: 03 c0 rjmp .+6 ; 0x300cc 300c6: 49 2c mov r4, r9 300c8: 5e 2c mov r5, r14 300ca: 38 01 movw r6, r16 // Check for junction speed change if (current->entry_speed != entry_speed) { 300cc: 92 01 movw r18, r4 300ce: a3 01 movw r20, r6 300d0: 69 2d mov r22, r9 300d2: 7e 2d mov r23, r14 300d4: c8 01 movw r24, r16 300d6: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 300da: 88 23 and r24, r24 300dc: 61 f0 breq .+24 ; 0x300f6 300de: d6 01 movw r26, r12 300e0: d5 96 adiw r26, 0x35 ; 53 300e2: 2c 91 ld r18, X current->entry_speed = entry_speed; 300e4: c2 01 movw r24, r4 300e6: d3 01 movw r26, r6 300e8: f6 01 movw r30, r12 300ea: 85 a3 std Z+37, r24 ; 0x25 300ec: 96 a3 std Z+38, r25 ; 0x26 300ee: a7 a3 std Z+39, r26 ; 0x27 300f0: b0 a7 std Z+40, r27 ; 0x28 current->flag |= BLOCK_FLAG_RECALCULATE; 300f2: 21 60 ori r18, 0x01 ; 1 300f4: 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) { 300f6: d5 01 movw r26, r10 300f8: d5 96 adiw r26, 0x35 ; 53 300fa: 8c 91 ld r24, X 300fc: d5 97 sbiw r26, 0x35 ; 53 300fe: f6 01 movw r30, r12 30100: 95 a9 ldd r25, Z+53 ; 0x35 30102: 89 2b or r24, r25 30104: 80 ff sbrs r24, 0 30106: 14 c0 rjmp .+40 ; 0x30130 // NOTE: Entry and exit factors always > 0 by all previous logic operations. calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); 30108: 05 a1 ldd r16, Z+37 ; 0x25 3010a: 16 a1 ldd r17, Z+38 ; 0x26 3010c: 27 a1 ldd r18, Z+39 ; 0x27 3010e: 30 a5 ldd r19, Z+40 ; 0x28 30110: 95 96 adiw r26, 0x25 ; 37 30112: 4d 91 ld r20, X+ 30114: 5d 91 ld r21, X+ 30116: 6d 91 ld r22, X+ 30118: 7c 91 ld r23, X 3011a: 98 97 sbiw r26, 0x28 ; 40 3011c: c5 01 movw r24, r10 3011e: 0f 94 77 6c call 0x2d8ee ; 0x2d8ee // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; 30122: d5 01 movw r26, r10 30124: d5 96 adiw r26, 0x35 ; 53 30126: 8c 91 ld r24, X 30128: d5 97 sbiw r26, 0x35 ; 53 3012a: 8e 7f andi r24, 0xFE ; 254 3012c: d5 96 adiw r26, 0x35 ; 53 3012e: 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) 30130: f3 94 inc r15 30132: b0 e1 ldi r27, 0x10 ; 16 30134: fb 12 cpse r15, r27 30136: 01 c0 rjmp .+2 ; 0x3013a block_index = 0; 30138: 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)); 3013a: f8 9c mul r15, r8 3013c: c0 01 movw r24, r0 3013e: 11 24 eor r1, r1 30140: 88 53 subi r24, 0x38 ; 56 30142: 99 4f sbci r25, 0xF9 ; 249 } while (block_index != block_buffer_head); 30144: 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; 30148: 56 01 movw r10, r12 current = block_buffer + (block_index = next_block_index(block_index)); } while (block_index != block_buffer_head); 3014a: f2 12 cpse r15, r18 3014c: 43 c3 rjmp .+1670 ; 0x307d4 } // 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); 3014e: 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) 30152: 81 11 cpse r24, r1 30154: 01 c0 rjmp .+2 ; 0x30158 block_index = BLOCK_BUFFER_SIZE; 30156: 80 e1 ldi r24, 0x10 ; 16 -- block_index; 30158: 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); 3015a: ee e6 ldi r30, 0x6E ; 110 3015c: 8e 9f mul r24, r30 3015e: c0 01 movw r24, r0 30160: 11 24 eor r1, r1 30162: 9c 01 movw r18, r24 30164: 28 53 subi r18, 0x38 ; 56 30166: 39 4f sbci r19, 0xF9 ; 249 30168: 79 01 movw r14, r18 calculate_trapezoid_for_block(current, current->entry_speed, safe_final_speed); 3016a: d9 01 movw r26, r18 3016c: 95 96 adiw r26, 0x25 ; 37 3016e: 4d 91 ld r20, X+ 30170: 5d 91 ld r21, X+ 30172: 6d 91 ld r22, X+ 30174: 7c 91 ld r23, X 30176: 98 97 sbiw r26, 0x28 ; 40 30178: 09 a5 ldd r16, Y+41 ; 0x29 3017a: 1d a5 ldd r17, Y+45 ; 0x2d 3017c: 29 ad ldd r18, Y+57 ; 0x39 3017e: 39 a9 ldd r19, Y+49 ; 0x31 30180: c7 01 movw r24, r14 30182: 0f 94 77 6c call 0x2d8ee ; 0x2d8ee current->flag &= ~BLOCK_FLAG_RECALCULATE; 30186: f7 01 movw r30, r14 30188: 85 a9 ldd r24, Z+53 ; 0x35 3018a: 8e 7f andi r24, 0xFE ; 254 3018c: 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(); 3018e: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 30192: 82 60 ori r24, 0x02 ; 2 30194: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 30198: 0d 94 48 76 jmp 0x2ec90 ; 0x2ec90 // 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)); 3019c: a0 5e subi r26, 0xE0 ; 224 3019e: b8 4f sbci r27, 0xF8 ; 248 301a0: 80 e1 ldi r24, 0x10 ; 16 301a2: e5 ef ldi r30, 0xF5 ; 245 301a4: f1 e1 ldi r31, 0x11 ; 17 301a6: 0d 94 83 76 jmp 0x2ed06 ; 0x2ed06 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]); 301aa: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 301ae: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 301b2: 40 91 40 04 lds r20, 0x0440 ; 0x800440 301b6: 50 91 41 04 lds r21, 0x0441 ; 0x800441 301ba: a7 96 adiw r28, 0x27 ; 39 301bc: 6c ad ldd r22, Y+60 ; 0x3c 301be: 7d ad ldd r23, Y+61 ; 0x3d 301c0: 8e ad ldd r24, Y+62 ; 0x3e 301c2: 9f ad ldd r25, Y+63 ; 0x3f 301c4: a7 97 sbiw r28, 0x27 ; 39 301c6: 0d 94 19 77 jmp 0x2ee32 ; 0x2ee32 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); 301ca: 81 e0 ldi r24, 0x01 ; 1 301cc: 80 8f std Z+24, r24 ; 0x18 301ce: 0d 94 bf 78 jmp 0x2f17e ; 0x2f17e { if(feed_rate 301d6: b0 90 6f 04 lds r11, 0x046F ; 0x80046f 301da: 00 91 70 04 lds r16, 0x0470 ; 0x800470 301de: 10 91 71 04 lds r17, 0x0471 ; 0x800471 301e2: 53 c8 rjmp .-3930 ; 0x2f28a 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])); 301e4: c5 01 movw r24, r10 301e6: b4 01 movw r22, r8 301e8: 0f 94 64 9b call 0x336c8 ; 0x336c8 301ec: 4b 01 movw r8, r22 301ee: 5c 01 movw r10, r24 301f0: c7 01 movw r24, r14 301f2: b6 01 movw r22, r12 301f4: 0f 94 64 9b call 0x336c8 ; 0x336c8 301f8: 9b 01 movw r18, r22 301fa: ac 01 movw r20, r24 301fc: c5 01 movw r24, r10 301fe: b4 01 movw r22, r8 30200: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 30204: 6b 01 movw r12, r22 30206: 7c 01 movw r14, r24 30208: 22 96 adiw r28, 0x02 ; 2 3020a: 6c ad ldd r22, Y+60 ; 0x3c 3020c: 7d ad ldd r23, Y+61 ; 0x3d 3020e: 8e ad ldd r24, Y+62 ; 0x3e 30210: 9f ad ldd r25, Y+63 ; 0x3f 30212: 22 97 sbiw r28, 0x02 ; 2 30214: 0f 94 64 9b call 0x336c8 ; 0x336c8 30218: 9b 01 movw r18, r22 3021a: ac 01 movw r20, r24 3021c: c7 01 movw r24, r14 3021e: b6 01 movw r22, r12 30220: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 30224: 0f 94 91 a5 call 0x34b22 ; 0x34b22 30228: 2e e6 ldi r18, 0x6E ; 110 3022a: 22 9d mul r18, r2 3022c: f0 01 movw r30, r0 3022e: 23 9d mul r18, r3 30230: f0 0d add r31, r0 30232: 11 24 eor r1, r1 30234: e8 53 subi r30, 0x38 ; 56 30236: f9 4f sbci r31, 0xF9 ; 249 30238: 65 a7 std Z+45, r22 ; 0x2d 3023a: 76 a7 std Z+46, r23 ; 0x2e 3023c: 87 a7 std Z+47, r24 ; 0x2f 3023e: 90 ab std Z+48, r25 ; 0x30 30240: c2 c8 rjmp .-3708 ; 0x2f3c6 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 30242: 2a 96 adiw r28, 0x0a ; 10 30244: 2c ad ldd r18, Y+60 ; 0x3c 30246: 3d ad ldd r19, Y+61 ; 0x3d 30248: 4e ad ldd r20, Y+62 ; 0x3e 3024a: 5f ad ldd r21, Y+63 ; 0x3f 3024c: 2a 97 sbiw r28, 0x0a ; 10 3024e: 23 2b or r18, r19 30250: 24 2b or r18, r20 30252: 25 2b or r18, r21 30254: 09 f4 brne .+2 ; 0x30258 30256: 0e c1 rjmp .+540 ; 0x30474 30258: 60 91 66 04 lds r22, 0x0466 ; 0x800466 3025c: 70 91 67 04 lds r23, 0x0467 ; 0x800467 30260: 80 91 68 04 lds r24, 0x0468 ; 0x800468 30264: 90 91 69 04 lds r25, 0x0469 ; 0x800469 30268: 29 a5 ldd r18, Y+41 ; 0x29 3026a: 3a a5 ldd r19, Y+42 ; 0x2a 3026c: 4b a5 ldd r20, Y+43 ; 0x2b 3026e: 5c a5 ldd r21, Y+44 ; 0x2c 30270: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 30274: 0f 94 a1 a2 call 0x34542 ; 0x34542 30278: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 3027c: 2b 01 movw r4, r22 3027e: 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 30280: 80 91 e1 16 lds r24, 0x16E1 ; 0x8016e1 30284: 90 91 e2 16 lds r25, 0x16E2 ; 0x8016e2 30288: a0 91 e3 16 lds r26, 0x16E3 ; 0x8016e3 3028c: b0 91 e4 16 lds r27, 0x16E4 ; 0x8016e4 30290: 8d a7 std Y+45, r24 ; 0x2d 30292: 9e a7 std Y+46, r25 ; 0x2e 30294: af a7 std Y+47, r26 ; 0x2f 30296: b8 ab std Y+48, r27 ; 0x30 && delta_mm[E_AXIS] >= 0 && fabs(delta_mm[Z_AXIS]) < 0.5; 30298: 20 e0 ldi r18, 0x00 ; 0 3029a: 30 e0 ldi r19, 0x00 ; 0 3029c: a9 01 movw r20, r18 3029e: bc 01 movw r22, r24 302a0: cd 01 movw r24, r26 302a2: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 302a6: 18 16 cp r1, r24 302a8: 0c f0 brlt .+2 ; 0x302ac 302aa: ed c0 rjmp .+474 ; 0x30486 * 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 302ac: 20 e0 ldi r18, 0x00 ; 0 302ae: 30 e0 ldi r19, 0x00 ; 0 302b0: a9 01 movw r20, r18 302b2: 26 96 adiw r28, 0x06 ; 6 302b4: 6c ad ldd r22, Y+60 ; 0x3c 302b6: 7d ad ldd r23, Y+61 ; 0x3d 302b8: 8e ad ldd r24, Y+62 ; 0x3e 302ba: 9f ad ldd r25, Y+63 ; 0x3f 302bc: 26 97 sbiw r28, 0x06 ; 6 302be: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 302c2: 87 fd sbrc r24, 7 302c4: e0 c0 rjmp .+448 ; 0x30486 && fabs(delta_mm[Z_AXIS]) < 0.5; 302c6: 22 96 adiw r28, 0x02 ; 2 302c8: 6c ad ldd r22, Y+60 ; 0x3c 302ca: 7d ad ldd r23, Y+61 ; 0x3d 302cc: 8e ad ldd r24, Y+62 ; 0x3e 302ce: 9f ad ldd r25, Y+63 ; 0x3f 302d0: 22 97 sbiw r28, 0x02 ; 2 302d2: 9f 77 andi r25, 0x7F ; 127 302d4: 20 e0 ldi r18, 0x00 ; 0 302d6: 30 e0 ldi r19, 0x00 ; 0 302d8: 40 e0 ldi r20, 0x00 ; 0 302da: 5f e3 ldi r21, 0x3F ; 63 302dc: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 302e0: 87 ff sbrs r24, 7 302e2: d1 c0 rjmp .+418 ; 0x30486 * * 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 302e4: 8e e6 ldi r24, 0x6E ; 110 302e6: 82 9d mul r24, r2 302e8: 80 01 movw r16, r0 302ea: 83 9d mul r24, r3 302ec: 10 0d add r17, r0 302ee: 11 24 eor r1, r1 302f0: 0c 5e subi r16, 0xEC ; 236 302f2: 18 4f sbci r17, 0xF8 ; 248 302f4: 81 e0 ldi r24, 0x01 ; 1 302f6: d8 01 movw r26, r16 302f8: 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]) 302fa: 20 91 04 04 lds r18, 0x0404 ; 0x800404 302fe: 30 91 05 04 lds r19, 0x0405 ; 0x800405 30302: 40 91 06 04 lds r20, 0x0406 ; 0x800406 30306: 50 91 07 04 lds r21, 0x0407 ; 0x800407 3030a: 69 a1 ldd r22, Y+33 ; 0x21 3030c: 7a a1 ldd r23, Y+34 ; 0x22 3030e: 8b a1 ldd r24, Y+35 ; 0x23 30310: 9c a1 ldd r25, Y+36 ; 0x24 30312: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 30316: 69 ab std Y+49, r22 ; 0x31 30318: 7a ab std Y+50, r23 ; 0x32 3031a: 8b ab std Y+51, r24 ; 0x33 3031c: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 3031e: 20 91 08 04 lds r18, 0x0408 ; 0x800408 30322: 30 91 09 04 lds r19, 0x0409 ; 0x800409 30326: 40 91 0a 04 lds r20, 0x040A ; 0x80040a 3032a: 50 91 0b 04 lds r21, 0x040B ; 0x80040b 3032e: 6d a1 ldd r22, Y+37 ; 0x25 30330: 7e a1 ldd r23, Y+38 ; 0x26 30332: 8f a1 ldd r24, Y+39 ; 0x27 30334: 98 a5 ldd r25, Y+40 ; 0x28 30336: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 3033a: 4b 01 movw r8, r22 3033c: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 3033e: 20 91 0c 04 lds r18, 0x040C ; 0x80040c 30342: 30 91 0d 04 lds r19, 0x040D ; 0x80040d 30346: 40 91 0e 04 lds r20, 0x040E ; 0x80040e 3034a: 50 91 0f 04 lds r21, 0x040F ; 0x80040f 3034e: a7 96 adiw r28, 0x27 ; 39 30350: 6c ad ldd r22, Y+60 ; 0x3c 30352: 7d ad ldd r23, Y+61 ; 0x3d 30354: 8e ad ldd r24, Y+62 ; 0x3e 30356: 9f ad ldd r25, Y+63 ; 0x3f 30358: a7 97 sbiw r28, 0x27 ; 39 3035a: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 3035e: 6b 01 movw r12, r22 30360: 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]) 30362: 29 a9 ldd r18, Y+49 ; 0x31 30364: 3a a9 ldd r19, Y+50 ; 0x32 30366: 4b a9 ldd r20, Y+51 ; 0x33 30368: 5c a9 ldd r21, Y+52 ; 0x34 3036a: ca 01 movw r24, r20 3036c: b9 01 movw r22, r18 3036e: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 30372: 69 ab std Y+49, r22 ; 0x31 30374: 7a ab std Y+50, r23 ; 0x32 30376: 8b ab std Y+51, r24 ; 0x33 30378: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 3037a: a5 01 movw r20, r10 3037c: 94 01 movw r18, r8 3037e: c5 01 movw r24, r10 30380: b4 01 movw r22, r8 30382: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 30386: 9b 01 movw r18, r22 30388: ac 01 movw r20, r24 3038a: 69 a9 ldd r22, Y+49 ; 0x31 3038c: 7a a9 ldd r23, Y+50 ; 0x32 3038e: 8b a9 ldd r24, Y+51 ; 0x33 30390: 9c a9 ldd r25, Y+52 ; 0x34 30392: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 30396: 4b 01 movw r8, r22 30398: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 3039a: a7 01 movw r20, r14 3039c: 96 01 movw r18, r12 3039e: c7 01 movw r24, r14 303a0: b6 01 movw r22, r12 303a2: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 303a6: 9b 01 movw r18, r22 303a8: ac 01 movw r20, r24 303aa: c5 01 movw r24, r10 303ac: b4 01 movw r22, r8 303ae: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__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]) 303b2: 0f 94 91 a5 call 0x34b22 ; 0x34b22 303b6: 6b 01 movw r12, r22 303b8: 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]); 303ba: 20 91 10 04 lds r18, 0x0410 ; 0x800410 303be: 30 91 11 04 lds r19, 0x0411 ; 0x800411 303c2: 40 91 12 04 lds r20, 0x0412 ; 0x800412 303c6: 50 91 13 04 lds r21, 0x0413 ; 0x800413 303ca: a9 96 adiw r28, 0x29 ; 41 303cc: ee ad ldd r30, Y+62 ; 0x3e 303ce: ff ad ldd r31, Y+63 ; 0x3f 303d0: a9 97 sbiw r28, 0x29 ; 41 303d2: 60 81 ld r22, Z 303d4: 71 81 ldd r23, Z+1 ; 0x01 303d6: 82 81 ldd r24, Z+2 ; 0x02 303d8: 93 81 ldd r25, Z+3 ; 0x03 303da: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__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; 303de: a7 01 movw r20, r14 303e0: 96 01 movw r18, r12 303e2: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 303e6: 6a 96 adiw r28, 0x1a ; 26 303e8: 6c af std Y+60, r22 ; 0x3c 303ea: 7d af std Y+61, r23 ; 0x3d 303ec: 8e af std Y+62, r24 ; 0x3e 303ee: 9f af std Y+63, r25 ; 0x3f 303f0: 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) 303f2: 20 e0 ldi r18, 0x00 ; 0 303f4: 30 e0 ldi r19, 0x00 ; 0 303f6: 40 e4 ldi r20, 0x40 ; 64 303f8: 50 e4 ldi r21, 0x40 ; 64 303fa: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 303fe: 18 16 cp r1, r24 30400: 0c f4 brge .+2 ; 0x30404 30402: 9e c0 rjmp .+316 ; 0x30540 block->use_advance_lead = false; else if (e_D_ratio > 0) { 30404: 20 e0 ldi r18, 0x00 ; 0 30406: 30 e0 ldi r19, 0x00 ; 0 30408: a9 01 movw r20, r18 3040a: 6a 96 adiw r28, 0x1a ; 26 3040c: 6c ad ldd r22, Y+60 ; 0x3c 3040e: 7d ad ldd r23, Y+61 ; 0x3d 30410: 8e ad ldd r24, Y+62 ; 0x3e 30412: 9f ad ldd r25, Y+63 ; 0x3f 30414: 6a 97 sbiw r28, 0x1a ; 26 30416: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 3041a: 18 16 cp r1, r24 3041c: 0c f0 brlt .+2 ; 0x30420 3041e: 42 c0 rjmp .+132 ; 0x304a4 const uint32_t max_accel_steps_per_s2 = ceil(cs.max_jerk[E_AXIS] / (extruder_advance_K * e_D_ratio) * steps_per_mm); 30420: 6a 96 adiw r28, 0x1a ; 26 30422: 2c ad ldd r18, Y+60 ; 0x3c 30424: 3d ad ldd r19, Y+61 ; 0x3d 30426: 4e ad ldd r20, Y+62 ; 0x3e 30428: 5f ad ldd r21, Y+63 ; 0x3f 3042a: 6a 97 sbiw r28, 0x1a ; 26 3042c: 6d a5 ldd r22, Y+45 ; 0x2d 3042e: 7e a5 ldd r23, Y+46 ; 0x2e 30430: 8f a5 ldd r24, Y+47 ; 0x2f 30432: 98 a9 ldd r25, Y+48 ; 0x30 30434: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 30438: 9b 01 movw r18, r22 3043a: ac 01 movw r20, r24 3043c: 60 91 86 04 lds r22, 0x0486 ; 0x800486 30440: 70 91 87 04 lds r23, 0x0487 ; 0x800487 30444: 80 91 88 04 lds r24, 0x0488 ; 0x800488 30448: 90 91 89 04 lds r25, 0x0489 ; 0x800489 3044c: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 30450: 29 a5 ldd r18, Y+41 ; 0x29 30452: 3a a5 ldd r19, Y+42 ; 0x2a 30454: 4b a5 ldd r20, Y+43 ; 0x2b 30456: 5c a5 ldd r21, Y+44 ; 0x2c 30458: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 3045c: 0f 94 a1 a2 call 0x34542 ; 0x34542 30460: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 30464: 64 15 cp r22, r4 30466: 75 05 cpc r23, r5 30468: 86 05 cpc r24, r6 3046a: 97 05 cpc r25, r7 3046c: d8 f4 brcc .+54 ; 0x304a4 3046e: 2b 01 movw r4, r22 30470: 3c 01 movw r6, r24 30472: 18 c0 rjmp .+48 ; 0x304a4 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 30474: 60 91 f2 04 lds r22, 0x04F2 ; 0x8004f2 30478: 70 91 f3 04 lds r23, 0x04F3 ; 0x8004f3 3047c: 80 91 f4 04 lds r24, 0x04F4 ; 0x8004f4 30480: 90 91 f5 04 lds r25, 0x04F5 ; 0x8004f5 30484: f1 ce rjmp .-542 ; 0x30268 * * 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 30486: 8e e6 ldi r24, 0x6E ; 110 30488: 82 9d mul r24, r2 3048a: f0 01 movw r30, r0 3048c: 83 9d mul r24, r3 3048e: f0 0d add r31, r0 30490: 11 24 eor r1, r1 30492: ec 5e subi r30, 0xEC ; 236 30494: f8 4f sbci r31, 0xF8 ; 248 30496: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 30498: 6a 96 adiw r28, 0x1a ; 26 3049a: 1c ae std Y+60, r1 ; 0x3c 3049c: 1d ae std Y+61, r1 ; 0x3d 3049e: 1e ae std Y+62, r1 ; 0x3e 304a0: 1f ae std Y+63, r1 ; 0x3f 304a2: 6a 97 sbiw r28, 0x1a ; 26 304a4: 10 e0 ldi r17, 0x00 ; 0 304a6: 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) 304a8: a3 96 adiw r28, 0x23 ; 35 304aa: ee ad ldd r30, Y+62 ; 0x3e 304ac: ff ad ldd r31, Y+63 ; 0x3f 304ae: a3 97 sbiw r28, 0x23 ; 35 304b0: e0 0f add r30, r16 304b2: f1 1f adc r31, r17 304b4: e8 53 subi r30, 0x38 ; 56 304b6: f9 4f sbci r31, 0xF9 ; 249 304b8: c0 80 ld r12, Z 304ba: d1 80 ldd r13, Z+1 ; 0x01 304bc: e2 80 ldd r14, Z+2 ; 0x02 304be: f3 80 ldd r15, Z+3 ; 0x03 304c0: c1 14 cp r12, r1 304c2: d1 04 cpc r13, r1 304c4: e1 04 cpc r14, r1 304c6: f1 04 cpc r15, r1 304c8: a1 f1 breq .+104 ; 0x30532 304ca: f8 01 movw r30, r16 304cc: eb 51 subi r30, 0x1B ; 27 304ce: f9 4e sbci r31, 0xE9 ; 233 304d0: 60 81 ld r22, Z 304d2: 71 81 ldd r23, Z+1 ; 0x01 304d4: 82 81 ldd r24, Z+2 ; 0x02 304d6: 93 81 ldd r25, Z+3 ; 0x03 304d8: 64 15 cp r22, r4 304da: 75 05 cpc r23, r5 304dc: 86 05 cpc r24, r6 304de: 97 05 cpc r25, r7 304e0: 40 f5 brcc .+80 ; 0x30532 { const float max_possible = float(max_acceleration_steps_per_s2[axis]) * float(block->step_event_count.wide) / float(block->steps[axis].wide); 304e2: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 304e6: 29 ad ldd r18, Y+57 ; 0x39 304e8: 3a ad ldd r19, Y+58 ; 0x3a 304ea: 4b ad ldd r20, Y+59 ; 0x3b 304ec: 5c ad ldd r21, Y+60 ; 0x3c 304ee: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 304f2: 4b 01 movw r8, r22 304f4: 5c 01 movw r10, r24 304f6: c7 01 movw r24, r14 304f8: b6 01 movw r22, r12 304fa: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 304fe: 9b 01 movw r18, r22 30500: ac 01 movw r20, r24 30502: c5 01 movw r24, r10 30504: b4 01 movw r22, r8 30506: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 3050a: 6b 01 movw r12, r22 3050c: 7c 01 movw r14, r24 if (max_possible < accel) accel = max_possible; 3050e: c3 01 movw r24, r6 30510: b2 01 movw r22, r4 30512: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 30516: 9b 01 movw r18, r22 30518: ac 01 movw r20, r24 3051a: c7 01 movw r24, r14 3051c: b6 01 movw r22, r12 3051e: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 30522: 87 ff sbrs r24, 7 30524: 06 c0 rjmp .+12 ; 0x30532 30526: c7 01 movw r24, r14 30528: b6 01 movw r22, r12 3052a: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 3052e: 2b 01 movw r4, r22 30530: 3c 01 movw r6, r24 30532: 0c 5f subi r16, 0xFC ; 252 30534: 1f 4f sbci r17, 0xFF ; 255 } } #endif // Limit acceleration per axis for (uint8_t axis = 0; axis < NUM_AXIS; axis++) 30536: 00 31 cpi r16, 0x10 ; 16 30538: 11 05 cpc r17, r1 3053a: 09 f0 breq .+2 ; 0x3053e 3053c: b5 cf rjmp .-150 ; 0x304a8 3053e: 01 c9 rjmp .-3582 ; 0x2f742 // 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; 30540: d8 01 movw r26, r16 30542: 1c 92 st X, r1 30544: af cf rjmp .-162 ; 0x304a4 if (jerk > mjerk) { safe_speed *= mjerk / jerk; limited = true; } } else { safe_speed = cs.max_jerk[axis]; 30546: c9 a6 std Y+41, r12 ; 0x29 30548: dd a6 std Y+45, r13 ; 0x2d 3054a: e9 ae std Y+57, r14 ; 0x39 3054c: f9 aa std Y+49, r15 ; 0x31 limited = true; 3054e: 21 e0 ldi r18, 0x01 ; 1 30550: 2d ab std Y+53, r18 ; 0x35 30552: b1 c9 rjmp .-3230 ; 0x2f8b6 // 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); 30554: 27 96 adiw r28, 0x07 ; 7 30556: 2f ad ldd r18, Y+63 ; 0x3f 30558: 27 97 sbiw r28, 0x07 ; 7 3055a: 2b 96 adiw r28, 0x0b ; 11 3055c: 3f ad ldd r19, Y+63 ; 0x3f 3055e: 2b 97 sbiw r28, 0x0b ; 11 30560: 2f 96 adiw r28, 0x0f ; 15 30562: 4f ad ldd r20, Y+63 ; 0x3f 30564: 2f 97 sbiw r28, 0x0f ; 15 30566: 63 96 adiw r28, 0x13 ; 19 30568: 5f ad ldd r21, Y+63 ; 0x3f 3056a: 63 97 sbiw r28, 0x13 ; 19 3056c: 6b 96 adiw r28, 0x1b ; 27 3056e: 6f ad ldd r22, Y+63 ; 0x3f 30570: 6b 97 sbiw r28, 0x1b ; 27 30572: 6f 96 adiw r28, 0x1f ; 31 30574: 7f ad ldd r23, Y+63 ; 0x3f 30576: 6f 97 sbiw r28, 0x1f ; 31 30578: c8 01 movw r24, r16 3057a: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 3057e: eb 96 adiw r28, 0x3b ; 59 30580: 6c af std Y+60, r22 ; 0x3c 30582: 7d af std Y+61, r23 ; 0x3d 30584: 8e af std Y+62, r24 ; 0x3e 30586: 9f af std Y+63, r25 ; 0x3f 30588: 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; 3058a: 6b 96 adiw r28, 0x1b ; 27 3058c: ef ad ldd r30, Y+63 ; 0x3f 3058e: 6b 97 sbiw r28, 0x1b ; 27 30590: ed af std Y+61, r30 ; 0x3d 30592: 6f 96 adiw r28, 0x1f ; 31 30594: ff ad ldd r31, Y+63 ; 0x3f 30596: 6f 97 sbiw r28, 0x1f ; 31 30598: fd ab std Y+53, r31 ; 0x35 3059a: 0e af std Y+62, r16 ; 0x3e 3059c: 23 96 adiw r28, 0x03 ; 3 3059e: 1f af std Y+63, r17 ; 0x3f 305a0: 23 97 sbiw r28, 0x03 ; 3 305a2: 04 ca rjmp .-3064 ; 0x2f9ac (v_exit > v_entry) ? ((v_entry > 0.f || v_exit < 0.f) ? // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : 305a4: f7 fa bst r15, 7 305a6: f0 94 com r15 305a8: f7 f8 bld r15, 7 305aa: f0 94 com r15 305ac: a5 01 movw r20, r10 305ae: 94 01 movw r18, r8 305b0: c7 01 movw r24, r14 305b2: b6 01 movw r22, r12 305b4: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 305b8: 87 ff sbrs r24, 7 305ba: 77 ca rjmp .-2834 ; 0x2faaa // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 305bc: 75 01 movw r14, r10 305be: 64 01 movw r12, r8 305c0: 74 ca rjmp .-2840 ; 0x2faaa // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? 305c2: c7 01 movw r24, r14 305c4: b6 01 movw r22, r12 305c6: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 305ca: 87 fd sbrc r24, 7 305cc: 09 c0 rjmp .+18 ; 0x305e0 305ce: 20 e0 ldi r18, 0x00 ; 0 305d0: 30 e0 ldi r19, 0x00 ; 0 305d2: a9 01 movw r20, r18 305d4: c5 01 movw r24, r10 305d6: b4 01 movw r22, r8 305d8: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 305dc: 18 16 cp r1, r24 305de: 2c f4 brge .+10 ; 0x305ea 305e0: a5 01 movw r20, r10 305e2: 94 01 movw r18, r8 305e4: c7 01 movw r24, r14 305e6: b6 01 movw r22, r12 305e8: 5c ca rjmp .-2888 ; 0x2faa2 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 305ea: b7 fa bst r11, 7 305ec: b0 94 com r11 305ee: b7 f8 bld r11, 7 305f0: b0 94 com r11 305f2: a7 01 movw r20, r14 305f4: 96 01 movw r18, r12 305f6: c5 01 movw r24, r10 305f8: b4 01 movw r22, r8 305fa: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 305fe: 18 16 cp r1, r24 30600: 0c f0 brlt .+2 ; 0x30604 30602: 53 ca rjmp .-2906 ; 0x2faaa 30604: db cf rjmp .-74 ; 0x305bc // 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; 30606: 8e e6 ldi r24, 0x6E ; 110 30608: 82 9d mul r24, r2 3060a: f0 01 movw r30, r0 3060c: 83 9d mul r24, r3 3060e: f0 0d add r31, r0 30610: 11 24 eor r1, r1 30612: e8 53 subi r30, 0x38 ; 56 30614: f9 4f sbci r31, 0xF9 ; 249 30616: 85 a9 ldd r24, Z+53 ; 0x35 30618: 84 60 ori r24, 0x04 ; 4 3061a: 85 ab std Z+53, r24 ; 0x35 3061c: a9 a5 ldd r26, Y+41 ; 0x29 3061e: ad af std Y+61, r26 ; 0x3d 30620: bd a5 ldd r27, Y+45 ; 0x2d 30622: bd ab std Y+53, r27 ; 0x35 30624: e9 ad ldd r30, Y+57 ; 0x39 30626: ee af std Y+62, r30 ; 0x3e 30628: f9 a9 ldd r31, Y+49 ; 0x31 3062a: 23 96 adiw r28, 0x03 ; 3 3062c: ff af std Y+63, r31 ; 0x3f 3062e: 23 97 sbiw r28, 0x03 ; 3 30630: bc ca rjmp .-2696 ; 0x2fbaa // 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; 30632: 81 e0 ldi r24, 0x01 ; 1 30634: 30 cb rjmp .-2464 ; 0x2fc96 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]; 30636: 20 91 86 04 lds r18, 0x0486 ; 0x800486 3063a: 30 91 87 04 lds r19, 0x0487 ; 0x800487 3063e: 40 91 88 04 lds r20, 0x0488 ; 0x800488 30642: 50 91 89 04 lds r21, 0x0489 ; 0x800489 30646: c7 01 movw r24, r14 30648: b6 01 movw r22, r12 3064a: c1 cb rjmp .-2174 ; 0x2fdce 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) { 3064c: 20 e0 ldi r18, 0x00 ; 0 3064e: 30 e4 ldi r19, 0x40 ; 64 30650: 4c e1 ldi r20, 0x1C ; 28 30652: 56 e4 ldi r21, 0x46 ; 70 30654: c7 01 movw r24, r14 30656: b6 01 movw r22, r12 30658: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 3065c: 18 16 cp r1, r24 3065e: d4 f4 brge .+52 ; 0x30694 block->advance_rate = advance_rate * 2; 30660: 8e e6 ldi r24, 0x6E ; 110 30662: 82 9d mul r24, r2 30664: 80 01 movw r16, r0 30666: 83 9d mul r24, r3 30668: 10 0d add r17, r0 3066a: 11 24 eor r1, r1 3066c: 08 53 subi r16, 0x38 ; 56 3066e: 19 4f sbci r17, 0xF9 ; 249 30670: 78 01 movw r14, r16 30672: bd e4 ldi r27, 0x4D ; 77 30674: eb 0e add r14, r27 30676: f1 1c adc r15, r1 30678: a5 01 movw r20, r10 3067a: 94 01 movw r18, r8 3067c: c5 01 movw r24, r10 3067e: b4 01 movw r22, r8 30680: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 30684: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 30688: f7 01 movw r30, r14 3068a: 71 83 std Z+1, r23 ; 0x01 3068c: 60 83 st Z, r22 block->advance_step_loops = 2; 3068e: 36 96 adiw r30, 0x06 ; 6 30690: 82 e0 ldi r24, 0x02 ; 2 30692: e2 cb rjmp .-2108 ; 0x2fe58 } else { // never overflow the internal accumulator with very low rates if (advance_rate < UINT16_MAX) 30694: 20 e0 ldi r18, 0x00 ; 0 30696: 3f ef ldi r19, 0xFF ; 255 30698: 4f e7 ldi r20, 0x7F ; 127 3069a: 57 e4 ldi r21, 0x47 ; 71 3069c: c5 01 movw r24, r10 3069e: b4 01 movw r22, r8 306a0: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 306a4: 87 ff sbrs r24, 7 306a6: 19 c0 rjmp .+50 ; 0x306da block->advance_rate = advance_rate; 306a8: 8e e6 ldi r24, 0x6E ; 110 306aa: 82 9d mul r24, r2 306ac: 80 01 movw r16, r0 306ae: 83 9d mul r24, r3 306b0: 10 0d add r17, r0 306b2: 11 24 eor r1, r1 306b4: 0b 5e subi r16, 0xEB ; 235 306b6: 18 4f sbci r17, 0xF8 ; 248 306b8: c5 01 movw r24, r10 306ba: b4 01 movw r22, r8 306bc: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 306c0: d8 01 movw r26, r16 306c2: 6d 93 st X+, r22 306c4: 7c 93 st X, r23 else block->advance_rate = UINT16_MAX; block->advance_step_loops = 1; 306c6: 8e e6 ldi r24, 0x6E ; 110 306c8: 82 9d mul r24, r2 306ca: f0 01 movw r30, r0 306cc: 83 9d mul r24, r3 306ce: f0 0d add r31, r0 306d0: 11 24 eor r1, r1 306d2: e5 5e subi r30, 0xE5 ; 229 306d4: f8 4f sbci r31, 0xF8 ; 248 306d6: 81 e0 ldi r24, 0x01 ; 1 306d8: bf cb rjmp .-2178 ; 0x2fe58 { // 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; 306da: 8e e6 ldi r24, 0x6E ; 110 306dc: 82 9d mul r24, r2 306de: f0 01 movw r30, r0 306e0: 83 9d mul r24, r3 306e2: f0 0d add r31, r0 306e4: 11 24 eor r1, r1 306e6: eb 5e subi r30, 0xEB ; 235 306e8: f8 4f sbci r31, 0xF8 ; 248 306ea: 8f ef ldi r24, 0xFF ; 255 306ec: 9f ef ldi r25, 0xFF ; 255 306ee: 91 83 std Z+1, r25 ; 0x01 306f0: 80 83 st Z, r24 306f2: e9 cf rjmp .-46 ; 0x306c6 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) { 306f4: f6 01 movw r30, r12 306f6: 71 a4 ldd r7, Z+41 ; 0x29 306f8: 82 a4 ldd r8, Z+42 ; 0x2a 306fa: 93 a4 ldd r9, Z+43 ; 0x2b 306fc: e4 a4 ldd r14, Z+44 ; 0x2c 306fe: 27 2d mov r18, r7 30700: 38 2d mov r19, r8 30702: 49 2d mov r20, r9 30704: 5e 2d mov r21, r14 30706: 65 a1 ldd r22, Z+37 ; 0x25 30708: 76 a1 ldd r23, Z+38 ; 0x26 3070a: 87 a1 ldd r24, Z+39 ; 0x27 3070c: 90 a5 ldd r25, Z+40 ; 0x28 3070e: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 30712: 88 23 and r24, r24 30714: 09 f4 brne .+2 ; 0x30718 30716: 51 c0 rjmp .+162 ; 0x307ba // 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) ? 30718: 01 fd sbrc r16, 1 3071a: 44 c0 rjmp .+136 ; 0x307a4 3071c: d5 01 movw r26, r10 3071e: 95 96 adiw r26, 0x25 ; 37 30720: 2d 90 ld r2, X+ 30722: 3d 90 ld r3, X+ 30724: 4d 90 ld r4, X+ 30726: 5c 90 ld r5, X 30728: 98 97 sbiw r26, 0x28 ; 40 3072a: a2 01 movw r20, r4 3072c: 91 01 movw r18, r2 3072e: 67 2d mov r22, r7 30730: 78 2d mov r23, r8 30732: 89 2d mov r24, r9 30734: 9e 2d mov r25, r14 30736: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 3073a: 18 16 cp r1, r24 3073c: 9c f5 brge .+102 ; 0x307a4 // 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); 3073e: a2 01 movw r20, r4 30740: 91 01 movw r18, r2 30742: c2 01 movw r24, r4 30744: b1 01 movw r22, r2 30746: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 3074a: 1b 01 movw r2, r22 3074c: 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)); 3074e: f6 01 movw r30, r12 30750: 61 a9 ldd r22, Z+49 ; 0x31 30752: 72 a9 ldd r23, Z+50 ; 0x32 30754: 83 a9 ldd r24, Z+51 ; 0x33 30756: 94 a9 ldd r25, Z+52 ; 0x34 30758: 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); 3075a: 9b 01 movw r18, r22 3075c: ac 01 movw r20, r24 3075e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 30762: d6 01 movw r26, r12 30764: 9d 96 adiw r26, 0x2d ; 45 30766: 2d 91 ld r18, X+ 30768: 3d 91 ld r19, X+ 3076a: 4d 91 ld r20, X+ 3076c: 5c 91 ld r21, X 3076e: d0 97 sbiw r26, 0x30 ; 48 30770: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 30774: 9b 01 movw r18, r22 30776: ac 01 movw r20, r24 30778: c2 01 movw r24, r4 3077a: b1 01 movw r22, r2 3077c: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 30780: 0f 94 91 a5 call 0x34b22 ; 0x34b22 30784: 2b 01 movw r4, r22 30786: 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)); 30788: 9b 01 movw r18, r22 3078a: ac 01 movw r20, r24 3078c: 67 2d mov r22, r7 3078e: 78 2d mov r23, r8 30790: 89 2d mov r24, r9 30792: 9e 2d mov r25, r14 30794: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 30798: 87 fd sbrc r24, 7 3079a: 04 c0 rjmp .+8 ; 0x307a4 3079c: 74 2c mov r7, r4 3079e: 85 2c mov r8, r5 307a0: 9a 2c mov r9, r10 307a2: 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) ? 307a4: 87 2d mov r24, r7 307a6: 98 2d mov r25, r8 307a8: a9 2d mov r26, r9 307aa: be 2d mov r27, r14 307ac: f6 01 movw r30, r12 307ae: 85 a3 std Z+37, r24 ; 0x25 307b0: 96 a3 std Z+38, r25 ; 0x26 307b2: a7 a3 std Z+39, r26 ; 0x27 307b4: 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; 307b6: 01 60 ori r16, 0x01 ; 1 307b8: 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) 307ba: 11 11 cpse r17, r1 307bc: 01 c0 rjmp .+2 ; 0x307c0 block_index = BLOCK_BUFFER_SIZE; 307be: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 307c0: 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)); 307c2: 16 9d mul r17, r6 307c4: c0 01 movw r24, r0 307c6: 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; 307c8: 56 01 movw r10, r12 current = block_buffer + (block_index = prev_block_index(block_index)); 307ca: 9c 01 movw r18, r24 307cc: 28 53 subi r18, 0x38 ; 56 307ce: 39 4f sbci r19, 0xF9 ; 249 307d0: 69 01 movw r12, r18 307d2: 0b cc rjmp .-2026 ; 0x2ffea 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)); 307d4: 6c 01 movw r12, r24 307d6: 2f cc rjmp .-1954 ; 0x30036 307d8: 8f bf out 0x3f, r24 ; 63 __asm__ volatile ("" ::: "memory"); 307da: 0d 94 48 76 jmp 0x2ec90 ; 0x2ec90 000307de : 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(){ 307de: 4f 92 push r4 307e0: 5f 92 push r5 307e2: 6f 92 push r6 307e4: 7f 92 push r7 307e6: 8f 92 push r8 307e8: 9f 92 push r9 307ea: af 92 push r10 307ec: bf 92 push r11 307ee: cf 92 push r12 307f0: df 92 push r13 307f2: ef 92 push r14 307f4: ff 92 push r15 307f6: cf 93 push r28 307f8: df 93 push r29 307fa: cd b7 in r28, 0x3d ; 61 307fc: de b7 in r29, 0x3e ; 62 307fe: 2c 97 sbiw r28, 0x0c ; 12 30800: 0f b6 in r0, 0x3f ; 63 30802: f8 94 cli 30804: de bf out 0x3e, r29 ; 62 30806: 0f be out 0x3f, r0 ; 63 30808: 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]); 3080a: c0 90 fd 11 lds r12, 0x11FD ; 0x8011fd 3080e: d0 90 fe 11 lds r13, 0x11FE ; 0x8011fe 30812: e0 90 ff 11 lds r14, 0x11FF ; 0x8011ff 30816: f0 90 00 12 lds r15, 0x1200 ; 0x801200 3081a: 80 91 f9 11 lds r24, 0x11F9 ; 0x8011f9 3081e: 90 91 fa 11 lds r25, 0x11FA ; 0x8011fa 30822: a0 91 fb 11 lds r26, 0x11FB ; 0x8011fb 30826: b0 91 fc 11 lds r27, 0x11FC ; 0x8011fc 3082a: 40 91 f5 11 lds r20, 0x11F5 ; 0x8011f5 3082e: 50 91 f6 11 lds r21, 0x11F6 ; 0x8011f6 30832: 60 91 f7 11 lds r22, 0x11F7 ; 0x8011f7 30836: 70 91 f8 11 lds r23, 0x11F8 ; 0x8011f8 3083a: 4d 83 std Y+5, r20 ; 0x05 3083c: 5e 83 std Y+6, r21 ; 0x06 3083e: 6f 83 std Y+7, r22 ; 0x07 30840: 78 87 std Y+8, r23 ; 0x08 30842: 89 83 std Y+1, r24 ; 0x01 30844: 9a 83 std Y+2, r25 ; 0x02 30846: ab 83 std Y+3, r26 ; 0x03 30848: 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); 3084a: be 01 movw r22, r28 3084c: 6f 5f subi r22, 0xFF ; 255 3084e: 7f 4f sbci r23, 0xFF ; 255 30850: ce 01 movw r24, r28 30852: 05 96 adiw r24, 0x05 ; 5 30854: 0e 94 f4 62 call 0xc5e8 ; 0xc5e8 position[X_AXIS] = lround(x*cs.axis_steps_per_mm[X_AXIS]); 30858: 4d 80 ldd r4, Y+5 ; 0x05 3085a: 5e 80 ldd r5, Y+6 ; 0x06 3085c: 6f 80 ldd r6, Y+7 ; 0x07 3085e: 78 84 ldd r7, Y+8 ; 0x08 30860: 20 91 36 04 lds r18, 0x0436 ; 0x800436 30864: 30 91 37 04 lds r19, 0x0437 ; 0x800437 30868: 40 91 38 04 lds r20, 0x0438 ; 0x800438 3086c: 50 91 39 04 lds r21, 0x0439 ; 0x800439 30870: c3 01 movw r24, r6 30872: b2 01 movw r22, r4 30874: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 30878: 0f 94 00 a5 call 0x34a00 ; 0x34a00 3087c: 60 93 a6 06 sts 0x06A6, r22 ; 0x8006a6 30880: 70 93 a7 06 sts 0x06A7, r23 ; 0x8006a7 30884: 80 93 a8 06 sts 0x06A8, r24 ; 0x8006a8 30888: 90 93 a9 06 sts 0x06A9, r25 ; 0x8006a9 position[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 3088c: 89 80 ldd r8, Y+1 ; 0x01 3088e: 9a 80 ldd r9, Y+2 ; 0x02 30890: ab 80 ldd r10, Y+3 ; 0x03 30892: bc 80 ldd r11, Y+4 ; 0x04 30894: 20 91 3a 04 lds r18, 0x043A ; 0x80043a 30898: 30 91 3b 04 lds r19, 0x043B ; 0x80043b 3089c: 40 91 3c 04 lds r20, 0x043C ; 0x80043c 308a0: 50 91 3d 04 lds r21, 0x043D ; 0x80043d 308a4: c5 01 movw r24, r10 308a6: b4 01 movw r22, r8 308a8: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 308ac: 0f 94 00 a5 call 0x34a00 ; 0x34a00 308b0: 60 93 aa 06 sts 0x06AA, r22 ; 0x8006aa 308b4: 70 93 ab 06 sts 0x06AB, r23 ; 0x8006ab 308b8: 80 93 ac 06 sts 0x06AC, r24 ; 0x8006ac 308bc: 90 93 ad 06 sts 0x06AD, r25 ; 0x8006ad #ifdef MESH_BED_LEVELING position[Z_AXIS] = mbl.active ? 308c0: 80 91 9c 12 lds r24, 0x129C ; 0x80129c 308c4: 88 23 and r24, r24 308c6: 09 f4 brne .+2 ; 0x308ca 308c8: 8c c0 rjmp .+280 ; 0x309e2 lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]) : 308ca: a5 01 movw r20, r10 308cc: 94 01 movw r18, r8 308ce: c3 01 movw r24, r6 308d0: b2 01 movw r22, r4 308d2: 0f 94 c7 60 call 0x2c18e ; 0x2c18e 308d6: 9b 01 movw r18, r22 308d8: ac 01 movw r20, r24 308da: c7 01 movw r24, r14 308dc: b6 01 movw r22, r12 308de: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 308e2: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 308e6: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 308ea: 40 91 40 04 lds r20, 0x0440 ; 0x800440 308ee: 50 91 41 04 lds r21, 0x0441 ; 0x800441 lround(z*cs.axis_steps_per_mm[Z_AXIS]); 308f2: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__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 ? 308f6: 0f 94 00 a5 call 0x34a00 ; 0x34a00 308fa: 60 93 ae 06 sts 0x06AE, r22 ; 0x8006ae 308fe: 70 93 af 06 sts 0x06AF, r23 ; 0x8006af 30902: 80 93 b0 06 sts 0x06B0, r24 ; 0x8006b0 30906: 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]); 3090a: 80 91 01 12 lds r24, 0x1201 ; 0x801201 3090e: 90 91 02 12 lds r25, 0x1202 ; 0x801202 30912: a0 91 03 12 lds r26, 0x1203 ; 0x801203 30916: b0 91 04 12 lds r27, 0x1204 ; 0x801204 3091a: 89 87 std Y+9, r24 ; 0x09 3091c: 9a 87 std Y+10, r25 ; 0x0a 3091e: ab 87 std Y+11, r26 ; 0x0b 30920: bc 87 std Y+12, r27 ; 0x0c 30922: 20 91 42 04 lds r18, 0x0442 ; 0x800442 30926: 30 91 43 04 lds r19, 0x0443 ; 0x800443 3092a: 40 91 44 04 lds r20, 0x0444 ; 0x800444 3092e: 50 91 45 04 lds r21, 0x0445 ; 0x800445 30932: bc 01 movw r22, r24 30934: cd 01 movw r24, r26 30936: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 3093a: 0f 94 00 a5 call 0x34a00 ; 0x34a00 3093e: 60 93 b2 06 sts 0x06B2, r22 ; 0x8006b2 30942: 70 93 b3 06 sts 0x06B3, r23 ; 0x8006b3 30946: 80 93 b4 06 sts 0x06B4, r24 ; 0x8006b4 3094a: 90 93 b5 06 sts 0x06B5, r25 ; 0x8006b5 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 3094e: 40 92 04 04 sts 0x0404, r4 ; 0x800404 30952: 50 92 05 04 sts 0x0405, r5 ; 0x800405 30956: 60 92 06 04 sts 0x0406, r6 ; 0x800406 3095a: 70 92 07 04 sts 0x0407, r7 ; 0x800407 position_float[Y_AXIS] = y; 3095e: 80 92 08 04 sts 0x0408, r8 ; 0x800408 30962: 90 92 09 04 sts 0x0409, r9 ; 0x800409 30966: a0 92 0a 04 sts 0x040A, r10 ; 0x80040a 3096a: b0 92 0b 04 sts 0x040B, r11 ; 0x80040b position_float[Z_AXIS] = z; 3096e: c0 92 0c 04 sts 0x040C, r12 ; 0x80040c 30972: d0 92 0d 04 sts 0x040D, r13 ; 0x80040d 30976: e0 92 0e 04 sts 0x040E, r14 ; 0x80040e 3097a: f0 92 0f 04 sts 0x040F, r15 ; 0x80040f position_float[E_AXIS] = e; 3097e: 89 85 ldd r24, Y+9 ; 0x09 30980: 9a 85 ldd r25, Y+10 ; 0x0a 30982: ab 85 ldd r26, Y+11 ; 0x0b 30984: bc 85 ldd r27, Y+12 ; 0x0c 30986: 80 93 10 04 sts 0x0410, r24 ; 0x800410 3098a: 90 93 11 04 sts 0x0411, r25 ; 0x800411 3098e: a0 93 12 04 sts 0x0412, r26 ; 0x800412 30992: b0 93 13 04 sts 0x0413, r27 ; 0x800413 #endif st_set_position(position); 30996: 0f 94 32 54 call 0x2a864 ; 0x2a864 previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest. 3099a: 10 92 f0 03 sts 0x03F0, r1 ; 0x8003f0 <_ZL22previous_nominal_speed.lto_priv.450> 3099e: 10 92 f1 03 sts 0x03F1, r1 ; 0x8003f1 <_ZL22previous_nominal_speed.lto_priv.450+0x1> 309a2: 10 92 f2 03 sts 0x03F2, r1 ; 0x8003f2 <_ZL22previous_nominal_speed.lto_priv.450+0x2> 309a6: 10 92 f3 03 sts 0x03F3, r1 ; 0x8003f3 <_ZL22previous_nominal_speed.lto_priv.450+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 309aa: e4 ef ldi r30, 0xF4 ; 244 309ac: f3 e0 ldi r31, 0x03 ; 3 309ae: 80 e1 ldi r24, 0x10 ; 16 309b0: df 01 movw r26, r30 309b2: 1d 92 st X+, r1 309b4: 8a 95 dec r24 309b6: e9 f7 brne .-6 ; 0x309b2 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]); } 309b8: 2c 96 adiw r28, 0x0c ; 12 309ba: 0f b6 in r0, 0x3f ; 63 309bc: f8 94 cli 309be: de bf out 0x3e, r29 ; 62 309c0: 0f be out 0x3f, r0 ; 63 309c2: cd bf out 0x3d, r28 ; 61 309c4: df 91 pop r29 309c6: cf 91 pop r28 309c8: ff 90 pop r15 309ca: ef 90 pop r14 309cc: df 90 pop r13 309ce: cf 90 pop r12 309d0: bf 90 pop r11 309d2: af 90 pop r10 309d4: 9f 90 pop r9 309d6: 8f 90 pop r8 309d8: 7f 90 pop r7 309da: 6f 90 pop r6 309dc: 5f 90 pop r5 309de: 4f 90 pop r4 309e0: 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]); 309e2: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 309e6: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 309ea: 40 91 40 04 lds r20, 0x0440 ; 0x800440 309ee: 50 91 41 04 lds r21, 0x0441 ; 0x800441 309f2: c7 01 movw r24, r14 309f4: b6 01 movw r22, r12 309f6: 7d cf rjmp .-262 ; 0x308f2 000309f8 : 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) { 309f8: 8f 92 push r8 309fa: 9f 92 push r9 309fc: af 92 push r10 309fe: bf 92 push r11 30a00: cf 92 push r12 30a02: df 92 push r13 30a04: ef 92 push r14 30a06: ff 92 push r15 30a08: 0f 93 push r16 30a0a: 1f 93 push r17 30a0c: 4b 01 movw r8, r22 30a0e: 5c 01 movw r10, r24 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_rate); 30a10: e3 e9 ldi r30, 0x93 ; 147 30a12: f6 e0 ldi r31, 0x06 ; 6 30a14: e0 84 ldd r14, Z+8 ; 0x08 30a16: f1 84 ldd r15, Z+9 ; 0x09 30a18: 02 85 ldd r16, Z+10 ; 0x0a 30a1a: 13 85 ldd r17, Z+11 ; 0x0b 30a1c: 24 81 ldd r18, Z+4 ; 0x04 30a1e: 35 81 ldd r19, Z+5 ; 0x05 30a20: 46 81 ldd r20, Z+6 ; 0x06 30a22: 57 81 ldd r21, Z+7 ; 0x07 30a24: 60 81 ld r22, Z 30a26: 71 81 ldd r23, Z+1 ; 0x01 30a28: 82 81 ldd r24, Z+2 ; 0x02 30a2a: 93 81 ldd r25, Z+3 ; 0x03 30a2c: 1f 92 push r1 30a2e: 1f 92 push r1 30a30: 1f 92 push r1 30a32: 1f 92 push r1 30a34: ef e9 ldi r30, 0x9F ; 159 30a36: ce 2e mov r12, r30 30a38: e6 e0 ldi r30, 0x06 ; 6 30a3a: de 2e mov r13, r30 30a3c: 0f 94 e1 75 call 0x2ebc2 ; 0x2ebc2 30a40: 0f 90 pop r0 30a42: 0f 90 pop r0 30a44: 0f 90 pop r0 30a46: 0f 90 pop r0 } 30a48: 1f 91 pop r17 30a4a: 0f 91 pop r16 30a4c: ff 90 pop r15 30a4e: ef 90 pop r14 30a50: df 90 pop r13 30a52: cf 90 pop r12 30a54: bf 90 pop r11 30a56: af 90 pop r10 30a58: 9f 90 pop r9 30a5a: 8f 90 pop r8 30a5c: 08 95 ret 00030a5e : // Reset position sync requests plan_reset_next_e_queue = false; plan_reset_next_e_sched = false; } void plan_buffer_line_curposXYZE(float feed_rate) { 30a5e: 8f 92 push r8 30a60: 9f 92 push r9 30a62: af 92 push r10 30a64: bf 92 push r11 30a66: cf 92 push r12 30a68: df 92 push r13 30a6a: ef 92 push r14 30a6c: ff 92 push r15 30a6e: 0f 93 push r16 30a70: 1f 93 push r17 30a72: 4b 01 movw r8, r22 30a74: 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); 30a76: e5 ef ldi r30, 0xF5 ; 245 30a78: f1 e1 ldi r31, 0x11 ; 17 30a7a: e0 84 ldd r14, Z+8 ; 0x08 30a7c: f1 84 ldd r15, Z+9 ; 0x09 30a7e: 02 85 ldd r16, Z+10 ; 0x0a 30a80: 13 85 ldd r17, Z+11 ; 0x0b 30a82: 24 81 ldd r18, Z+4 ; 0x04 30a84: 35 81 ldd r19, Z+5 ; 0x05 30a86: 46 81 ldd r20, Z+6 ; 0x06 30a88: 57 81 ldd r21, Z+7 ; 0x07 30a8a: 60 81 ld r22, Z 30a8c: 71 81 ldd r23, Z+1 ; 0x01 30a8e: 82 81 ldd r24, Z+2 ; 0x02 30a90: 93 81 ldd r25, Z+3 ; 0x03 30a92: 1f 92 push r1 30a94: 1f 92 push r1 30a96: 1f 92 push r1 30a98: 1f 92 push r1 30a9a: e1 e0 ldi r30, 0x01 ; 1 30a9c: ce 2e mov r12, r30 30a9e: e2 e1 ldi r30, 0x12 ; 18 30aa0: de 2e mov r13, r30 30aa2: 0f 94 e1 75 call 0x2ebc2 ; 0x2ebc2 30aa6: 0f 90 pop r0 30aa8: 0f 90 pop r0 30aaa: 0f 90 pop r0 30aac: 0f 90 pop r0 } 30aae: 1f 91 pop r17 30ab0: 0f 91 pop r16 30ab2: ff 90 pop r15 30ab4: ef 90 pop r14 30ab6: df 90 pop r13 30ab8: cf 90 pop r12 30aba: bf 90 pop r11 30abc: af 90 pop r10 30abe: 9f 90 pop r9 30ac0: 8f 90 pop r8 30ac2: 08 95 ret 00030ac4 : #endif /* PLANNER_DIAGNOSTICS */ extern volatile uint32_t step_events_completed; // The number of step events executed in the current block void planner_reset_position() { 30ac4: 4f 92 push r4 30ac6: 5f 92 push r5 30ac8: 6f 92 push r6 30aca: 7f 92 push r7 30acc: 8f 92 push r8 30ace: 9f 92 push r9 30ad0: af 92 push r10 30ad2: bf 92 push r11 30ad4: cf 92 push r12 30ad6: df 92 push r13 30ad8: ef 92 push r14 30ada: ff 92 push r15 30adc: cf 93 push r28 // First update the planner's current position in the physical motor steps. position[X_AXIS] = st_get_position(X_AXIS); 30ade: 80 e0 ldi r24, 0x00 ; 0 30ae0: 0f 94 ac 22 call 0x24558 ; 0x24558 30ae4: 60 93 a6 06 sts 0x06A6, r22 ; 0x8006a6 30ae8: 70 93 a7 06 sts 0x06A7, r23 ; 0x8006a7 30aec: 80 93 a8 06 sts 0x06A8, r24 ; 0x8006a8 30af0: 90 93 a9 06 sts 0x06A9, r25 ; 0x8006a9 position[Y_AXIS] = st_get_position(Y_AXIS); 30af4: 81 e0 ldi r24, 0x01 ; 1 30af6: 0f 94 ac 22 call 0x24558 ; 0x24558 30afa: 60 93 aa 06 sts 0x06AA, r22 ; 0x8006aa 30afe: 70 93 ab 06 sts 0x06AB, r23 ; 0x8006ab 30b02: 80 93 ac 06 sts 0x06AC, r24 ; 0x8006ac 30b06: 90 93 ad 06 sts 0x06AD, r25 ; 0x8006ad position[Z_AXIS] = st_get_position(Z_AXIS); 30b0a: 82 e0 ldi r24, 0x02 ; 2 30b0c: 0f 94 ac 22 call 0x24558 ; 0x24558 30b10: 60 93 ae 06 sts 0x06AE, r22 ; 0x8006ae 30b14: 70 93 af 06 sts 0x06AF, r23 ; 0x8006af 30b18: 80 93 b0 06 sts 0x06B0, r24 ; 0x8006b0 30b1c: 90 93 b1 06 sts 0x06B1, r25 ; 0x8006b1 position[E_AXIS] = st_get_position(E_AXIS); 30b20: 83 e0 ldi r24, 0x03 ; 3 30b22: 0f 94 ac 22 call 0x24558 ; 0x24558 30b26: 60 93 b2 06 sts 0x06B2, r22 ; 0x8006b2 30b2a: 70 93 b3 06 sts 0x06B3, r23 ; 0x8006b3 30b2e: 80 93 b4 06 sts 0x06B4, r24 ; 0x8006b4 30b32: 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); 30b36: 80 e0 ldi r24, 0x00 ; 0 30b38: 0f 94 ba 22 call 0x24574 ; 0x24574 30b3c: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 30b40: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 30b44: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 30b48: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 30b4c: 81 e0 ldi r24, 0x01 ; 1 30b4e: 0f 94 ba 22 call 0x24574 ; 0x24574 30b52: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 30b56: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 30b5a: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 30b5e: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 30b62: 82 e0 ldi r24, 0x02 ; 2 30b64: 0f 94 ba 22 call 0x24574 ; 0x24574 30b68: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 30b6c: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 30b70: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 30b74: 90 93 00 12 sts 0x1200, r25 ; 0x801200 current_position[E_AXIS] = st_get_position_mm(E_AXIS); 30b78: 83 e0 ldi r24, 0x03 ; 3 30b7a: 0f 94 ba 22 call 0x24574 ; 0x24574 30b7e: 60 93 01 12 sts 0x1201, r22 ; 0x801201 30b82: 70 93 02 12 sts 0x1202, r23 ; 0x801202 30b86: 80 93 03 12 sts 0x1203, r24 ; 0x801203 30b8a: 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) { 30b8e: 80 91 9c 12 lds r24, 0x129C ; 0x80129c 30b92: 88 23 and r24, r24 30b94: 31 f1 breq .+76 ; 0x30be2 #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]); 30b96: 20 91 f9 11 lds r18, 0x11F9 ; 0x8011f9 30b9a: 30 91 fa 11 lds r19, 0x11FA ; 0x8011fa 30b9e: 40 91 fb 11 lds r20, 0x11FB ; 0x8011fb 30ba2: 50 91 fc 11 lds r21, 0x11FC ; 0x8011fc 30ba6: 60 91 f5 11 lds r22, 0x11F5 ; 0x8011f5 30baa: 70 91 f6 11 lds r23, 0x11F6 ; 0x8011f6 30bae: 80 91 f7 11 lds r24, 0x11F7 ; 0x8011f7 30bb2: 90 91 f8 11 lds r25, 0x11F8 ; 0x8011f8 30bb6: 0f 94 c7 60 call 0x2c18e ; 0x2c18e 30bba: 9b 01 movw r18, r22 30bbc: ac 01 movw r20, r24 30bbe: 60 91 fd 11 lds r22, 0x11FD ; 0x8011fd 30bc2: 70 91 fe 11 lds r23, 0x11FE ; 0x8011fe 30bc6: 80 91 ff 11 lds r24, 0x11FF ; 0x8011ff 30bca: 90 91 00 12 lds r25, 0x1200 ; 0x801200 30bce: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 30bd2: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 30bd6: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 30bda: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 30bde: 90 93 00 12 sts 0x1200, r25 ; 0x801200 } } inline void machine2world(float &x, float &y) { if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { 30be2: c0 91 dc 16 lds r28, 0x16DC ; 0x8016dc 30be6: cc 23 and r28, r28 30be8: 09 f4 brne .+2 ; 0x30bec 30bea: 9a c0 rjmp .+308 ; 0x30d20 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { 30bec: c0 ff sbrs r28, 0 30bee: 34 c0 rjmp .+104 ; 0x30c58 // Then add the offset. x -= world2machine_shift[0]; 30bf0: 20 91 d4 16 lds r18, 0x16D4 ; 0x8016d4 30bf4: 30 91 d5 16 lds r19, 0x16D5 ; 0x8016d5 30bf8: 40 91 d6 16 lds r20, 0x16D6 ; 0x8016d6 30bfc: 50 91 d7 16 lds r21, 0x16D7 ; 0x8016d7 30c00: 60 91 f5 11 lds r22, 0x11F5 ; 0x8011f5 30c04: 70 91 f6 11 lds r23, 0x11F6 ; 0x8011f6 30c08: 80 91 f7 11 lds r24, 0x11F7 ; 0x8011f7 30c0c: 90 91 f8 11 lds r25, 0x11F8 ; 0x8011f8 30c10: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 30c14: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 30c18: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 30c1c: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 30c20: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 y -= world2machine_shift[1]; 30c24: 20 91 d8 16 lds r18, 0x16D8 ; 0x8016d8 30c28: 30 91 d9 16 lds r19, 0x16D9 ; 0x8016d9 30c2c: 40 91 da 16 lds r20, 0x16DA ; 0x8016da 30c30: 50 91 db 16 lds r21, 0x16DB ; 0x8016db 30c34: 60 91 f9 11 lds r22, 0x11F9 ; 0x8011f9 30c38: 70 91 fa 11 lds r23, 0x11FA ; 0x8011fa 30c3c: 80 91 fb 11 lds r24, 0x11FB ; 0x8011fb 30c40: 90 91 fc 11 lds r25, 0x11FC ; 0x8011fc 30c44: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 30c48: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 30c4c: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 30c50: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 30c54: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { 30c58: c1 ff sbrs r28, 1 30c5a: 62 c0 rjmp .+196 ; 0x30d20 // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; 30c5c: 80 90 f5 11 lds r8, 0x11F5 ; 0x8011f5 30c60: 90 90 f6 11 lds r9, 0x11F6 ; 0x8011f6 30c64: a0 90 f7 11 lds r10, 0x11F7 ; 0x8011f7 30c68: b0 90 f8 11 lds r11, 0x11F8 ; 0x8011f8 30c6c: c0 90 f9 11 lds r12, 0x11F9 ; 0x8011f9 30c70: d0 90 fa 11 lds r13, 0x11FA ; 0x8011fa 30c74: e0 90 fb 11 lds r14, 0x11FB ; 0x8011fb 30c78: 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; 30c7c: 20 91 cc 16 lds r18, 0x16CC ; 0x8016cc 30c80: 30 91 cd 16 lds r19, 0x16CD ; 0x8016cd 30c84: 40 91 ce 16 lds r20, 0x16CE ; 0x8016ce 30c88: 50 91 cf 16 lds r21, 0x16CF ; 0x8016cf 30c8c: c5 01 movw r24, r10 30c8e: b4 01 movw r22, r8 30c90: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 30c94: 2b 01 movw r4, r22 30c96: 3c 01 movw r6, r24 30c98: 20 91 d0 16 lds r18, 0x16D0 ; 0x8016d0 30c9c: 30 91 d1 16 lds r19, 0x16D1 ; 0x8016d1 30ca0: 40 91 d2 16 lds r20, 0x16D2 ; 0x8016d2 30ca4: 50 91 d3 16 lds r21, 0x16D3 ; 0x8016d3 30ca8: c7 01 movw r24, r14 30caa: b6 01 movw r22, r12 30cac: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 30cb0: 9b 01 movw r18, r22 30cb2: ac 01 movw r20, r24 30cb4: c3 01 movw r24, r6 30cb6: b2 01 movw r22, r4 30cb8: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 30cbc: 2b 01 movw r4, r22 30cbe: 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; 30cc0: 20 91 c4 16 lds r18, 0x16C4 ; 0x8016c4 30cc4: 30 91 c5 16 lds r19, 0x16C5 ; 0x8016c5 30cc8: 40 91 c6 16 lds r20, 0x16C6 ; 0x8016c6 30ccc: 50 91 c7 16 lds r21, 0x16C7 ; 0x8016c7 30cd0: c5 01 movw r24, r10 30cd2: b4 01 movw r22, r8 30cd4: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 30cd8: 4b 01 movw r8, r22 30cda: 5c 01 movw r10, r24 30cdc: 20 91 c8 16 lds r18, 0x16C8 ; 0x8016c8 30ce0: 30 91 c9 16 lds r19, 0x16C9 ; 0x8016c9 30ce4: 40 91 ca 16 lds r20, 0x16CA ; 0x8016ca 30ce8: 50 91 cb 16 lds r21, 0x16CB ; 0x8016cb 30cec: c7 01 movw r24, r14 30cee: b6 01 movw r22, r12 30cf0: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 30cf4: 9b 01 movw r18, r22 30cf6: ac 01 movw r20, r24 30cf8: c5 01 movw r24, r10 30cfa: b4 01 movw r22, r8 30cfc: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; x = out_x; 30d00: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 30d04: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 30d08: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 30d0c: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 y = out_y; 30d10: 40 92 f9 11 sts 0x11F9, r4 ; 0x8011f9 30d14: 50 92 fa 11 sts 0x11FA, r5 ; 0x8011fa 30d18: 60 92 fb 11 sts 0x11FB, r6 ; 0x8011fb 30d1c: 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(); 30d20: 0e 94 2c 61 call 0xc258 ; 0xc258 #ifdef LIN_ADVANCE memcpy(position_float, current_position, sizeof(position_float)); 30d24: 80 e1 ldi r24, 0x10 ; 16 30d26: e5 ef ldi r30, 0xF5 ; 245 30d28: f1 e1 ldi r31, 0x11 ; 17 30d2a: a4 e0 ldi r26, 0x04 ; 4 30d2c: b4 e0 ldi r27, 0x04 ; 4 30d2e: 01 90 ld r0, Z+ 30d30: 0d 92 st X+, r0 30d32: 8a 95 dec r24 30d34: e1 f7 brne .-8 ; 0x30d2e #endif } 30d36: cf 91 pop r28 30d38: ff 90 pop r15 30d3a: ef 90 pop r14 30d3c: df 90 pop r13 30d3e: cf 90 pop r12 30d40: bf 90 pop r11 30d42: af 90 pop r10 30d44: 9f 90 pop r9 30d46: 8f 90 pop r8 30d48: 7f 90 pop r7 30d4a: 6f 90 pop r6 30d4c: 5f 90 pop r5 30d4e: 4f 90 pop r4 30d50: 08 95 ret 00030d52 : void planner_abort_hard() { // Abort the stepper routine and flush the planner queue. DISABLE_STEPPER_DRIVER_INTERRUPT(); 30d52: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 30d56: 8d 7f andi r24, 0xFD ; 253 30d58: 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(); 30d5c: 0f 94 62 85 call 0x30ac4 ; 0x30ac4 // Relay to planner wait routine that the current line shall be canceled. planner_aborted = true; 30d60: 81 e0 ldi r24, 0x01 ; 1 30d62: 80 93 ac 0d sts 0x0DAC, r24 ; 0x800dac } void quickStop() { DISABLE_STEPPER_DRIVER_INTERRUPT(); 30d66: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 30d6a: 8d 7f andi r24, 0xFD ; 253 30d6c: 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); 30d70: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 30d74: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 while (blocks_queued()) plan_discard_current_block(); 30d78: 98 17 cp r25, r24 30d7a: 69 f0 breq .+26 ; 0x30d96 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) { 30d7c: 90 91 a8 0d lds r25, 0x0DA8 ; 0x800da8 30d80: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 30d84: 98 17 cp r25, r24 30d86: a1 f3 breq .-24 ; 0x30d70 block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 30d88: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 30d8c: 8f 5f subi r24, 0xFF ; 255 30d8e: 8f 70 andi r24, 0x0F ; 15 30d90: 80 93 a9 0d sts 0x0DA9, r24 ; 0x800da9 30d94: ed cf rjmp .-38 ; 0x30d70 current_block = NULL; 30d96: 10 92 e5 11 sts 0x11E5, r1 ; 0x8011e5 30d9a: 10 92 e4 11 sts 0x11E4, r1 ; 0x8011e4 #ifdef LIN_ADVANCE nextAdvanceISR = ADV_NEVER; 30d9e: 8f ef ldi r24, 0xFF ; 255 30da0: 9f ef ldi r25, 0xFF ; 255 30da2: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14nextAdvanceISR.lto_priv.436+0x1> 30da6: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14nextAdvanceISR.lto_priv.436> current_adv_steps = 0; 30daa: 10 92 17 04 sts 0x0417, r1 ; 0x800417 <_ZL17current_adv_steps.lto_priv.438+0x1> 30dae: 10 92 16 04 sts 0x0416, r1 ; 0x800416 <_ZL17current_adv_steps.lto_priv.438> #endif st_reset_timer(); 30db2: 0f 94 da 22 call 0x245b4 ; 0x245b4 ENABLE_STEPPER_DRIVER_INTERRUPT(); 30db6: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 30dba: 82 60 ori r24, 0x02 ; 2 30dbc: 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; 30dc0: 10 92 f0 03 sts 0x03F0, r1 ; 0x8003f0 <_ZL22previous_nominal_speed.lto_priv.450> 30dc4: 10 92 f1 03 sts 0x03F1, r1 ; 0x8003f1 <_ZL22previous_nominal_speed.lto_priv.450+0x1> 30dc8: 10 92 f2 03 sts 0x03F2, r1 ; 0x8003f2 <_ZL22previous_nominal_speed.lto_priv.450+0x2> 30dcc: 10 92 f3 03 sts 0x03F3, r1 ; 0x8003f3 <_ZL22previous_nominal_speed.lto_priv.450+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 30dd0: e4 ef ldi r30, 0xF4 ; 244 30dd2: f3 e0 ldi r31, 0x03 ; 3 30dd4: 80 e1 ldi r24, 0x10 ; 16 30dd6: df 01 movw r26, r30 30dd8: 1d 92 st X+, r1 30dda: 8a 95 dec r24 30ddc: e9 f7 brne .-6 ; 0x30dd8 // Reset position sync requests plan_reset_next_e_queue = false; 30dde: 10 92 ef 03 sts 0x03EF, r1 ; 0x8003ef <_ZL23plan_reset_next_e_queue.lto_priv.448> plan_reset_next_e_sched = false; 30de2: 10 92 ee 03 sts 0x03EE, r1 ; 0x8003ee <_ZL23plan_reset_next_e_sched.lto_priv.449> } 30de6: 08 95 ret 00030de8 : void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); } void ScreenUpdateEnable(){ lcd_update_enable(true); 30de8: 81 e0 ldi r24, 0x01 ; 1 30dea: 0c 94 b6 69 jmp 0xd36c ; 0xd36c 00030dee : void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); } static void FullScreenMsg(const char *pgmS, uint8_t slot){ 30dee: 0f 93 push r16 30df0: 1f 93 push r17 30df2: cf 93 push r28 30df4: 8c 01 movw r16, r24 30df6: c6 2f mov r28, r22 lcd_update_enable(false); 30df8: 80 e0 ldi r24, 0x00 ; 0 30dfa: 0e 94 b6 69 call 0xd36c ; 0xd36c lcd_clear(); 30dfe: 0e 94 a4 69 call 0xd348 ; 0xd348 lcd_puts_at_P(0, 1, pgmS); 30e02: a8 01 movw r20, r16 30e04: 61 e0 ldi r22, 0x01 ; 1 30e06: 80 e0 ldi r24, 0x00 ; 0 30e08: 0e 94 85 69 call 0xd30a ; 0xd30a } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 30e0c: 80 e2 ldi r24, 0x20 ; 32 30e0e: 0e 94 20 6a call 0xd440 ; 0xd440 lcd_print(' '); lcd_print(slot + 1); 30e12: 6c 2f mov r22, r28 30e14: 70 e0 ldi r23, 0x00 ; 0 30e16: 6f 5f subi r22, 0xFF ; 255 30e18: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 30e1a: 07 2e mov r0, r23 30e1c: 00 0c add r0, r0 30e1e: 88 0b sbc r24, r24 30e20: 99 0b sbc r25, r25 } 30e22: cf 91 pop r28 30e24: 1f 91 pop r17 30e26: 0f 91 pop r16 30e28: 0c 94 2a 6b jmp 0xd654 ; 0xd654 00030e2c : 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); 30e2c: 82 ed ldi r24, 0xD2 ; 210 30e2e: 9e e0 ldi r25, 0x0E ; 14 30e30: 0e 94 02 6f call 0xde04 ; 0xde04 eeprom_increment_word((uint16_t *)EEPROM_MMU_FAIL_TOT); 30e34: 83 ed ldi r24, 0xD3 ; 211 30e36: 9e e0 ldi r25, 0x0E ; 14 30e38: 0c 94 f5 6e jmp 0xddea ; 0xddea 00030e3c : inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 30e3c: 41 e0 ldi r20, 0x01 ; 1 30e3e: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 30e42: 81 11 cpse r24, r1 30e44: 01 c0 rjmp .+2 ; 0x30e48 30e46: 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'); 30e48: 40 5d subi r20, 0xD0 ; 208 30e4a: 62 e0 ldi r22, 0x02 ; 2 30e4c: 83 e0 ldi r24, 0x03 ; 3 30e4e: 0e 94 91 69 call 0xd322 ; 0xd322 lcd_putc_at(8, 2, fsensor.getFilamentPresent() + '0'); 30e52: 0e 94 f9 c3 call 0x187f2 ; 0x187f2 30e56: 40 e3 ldi r20, 0x30 ; 48 30e58: 48 0f add r20, r24 30e5a: 62 e0 ldi r22, 0x02 ; 2 30e5c: 88 e0 ldi r24, 0x08 ; 8 30e5e: 0e 94 91 69 call 0xd322 ; 0xd322 // print active/changing filament slot lcd_set_cursor(10, 2); 30e62: 62 e0 ldi r22, 0x02 ; 2 30e64: 8a e0 ldi r24, 0x0A ; 10 30e66: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcdui_print_extruder(); 30e6a: 0f 94 56 0d call 0x21aac ; 0x21aac // Print active extruder temperature lcd_set_cursor(16, 2); 30e6e: 62 e0 ldi r22, 0x02 ; 2 30e70: 80 e1 ldi r24, 0x10 ; 16 30e72: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_printf_P(PSTR("%3d"), (int)(degHotend(0) + 0.5)); 30e76: 20 e0 ldi r18, 0x00 ; 0 30e78: 30 e0 ldi r19, 0x00 ; 0 30e7a: 40 e0 ldi r20, 0x00 ; 0 30e7c: 5f e3 ldi r21, 0x3F ; 63 30e7e: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 30e82: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 30e86: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 30e8a: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 30e8e: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 30e92: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> 30e96: 7f 93 push r23 30e98: 6f 93 push r22 30e9a: 8a ea ldi r24, 0xAA ; 170 30e9c: 9d e9 ldi r25, 0x9D ; 157 30e9e: 9f 93 push r25 30ea0: 8f 93 push r24 30ea2: 0e 94 4a 69 call 0xd294 ; 0xd294 30ea6: 0f 90 pop r0 30ea8: 0f 90 pop r0 30eaa: 0f 90 pop r0 30eac: 0f 90 pop r0 } 30eae: 08 95 ret 00030eb0 : return 0; } } static constexpr uint8_t Nibble2Char(uint8_t n) { switch (n) { 30eb0: 8a 30 cpi r24, 0x0A ; 10 30eb2: 20 f0 brcs .+8 ; 0x30ebc 30eb4: 80 31 cpi r24, 0x10 ; 16 30eb6: 20 f4 brcc .+8 ; 0x30ec0 case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; 30eb8: 89 5a subi r24, 0xA9 ; 169 30eba: 08 95 ret case 5: case 6: case 7: case 8: case 9: return n + '0'; 30ebc: 80 5d subi r24, 0xD0 ; 208 30ebe: 08 95 ret case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; default: return 0; 30ec0: 80 e0 ldi r24, 0x00 ; 0 } } 30ec2: 08 95 ret 00030ec4 : i += AppendCRC(rsp.CRC(), txbuff + i); txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { 30ec4: 0f 93 push r16 30ec6: 1f 93 push r17 30ec8: cf 93 push r28 30eca: df 93 push r29 30ecc: 08 2f mov r16, r24 30ece: eb 01 movw r28, r22 if (value == 0) { *dst = '0'; return 1; } uint8_t v = value >> 4U; 30ed0: 90 e0 ldi r25, 0x00 ; 0 30ed2: 24 e0 ldi r18, 0x04 ; 4 30ed4: 95 95 asr r25 30ed6: 87 95 ror r24 30ed8: 2a 95 dec r18 30eda: e1 f7 brne .-8 ; 0x30ed4 uint8_t charsOut = 1; 30edc: 11 e0 ldi r17, 0x01 ; 1 if (v != 0) { // skip the first '0' if any 30ede: 00 97 sbiw r24, 0x00 ; 0 30ee0: 21 f0 breq .+8 ; 0x30eea *dst = Nibble2Char(v); 30ee2: 0f 94 58 87 call 0x30eb0 ; 0x30eb0 30ee6: 89 93 st Y+, r24 ++dst; charsOut = 2; 30ee8: 12 e0 ldi r17, 0x02 ; 2 } v = value & 0xfU; *dst = Nibble2Char(v); 30eea: 80 2f mov r24, r16 30eec: 8f 70 andi r24, 0x0F ; 15 30eee: 0f 94 58 87 call 0x30eb0 ; 0x30eb0 30ef2: 88 83 st Y, r24 return charsOut; } 30ef4: 81 2f mov r24, r17 30ef6: df 91 pop r29 30ef8: cf 91 pop r28 30efa: 1f 91 pop r17 30efc: 0f 91 pop r16 30efe: 08 95 ret 00030f00 : } 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) { 30f00: 80 33 cpi r24, 0x30 ; 48 30f02: 30 f0 brcs .+12 ; 0x30f10 30f04: 8a 33 cpi r24, 0x3A ; 58 30f06: 30 f0 brcs .+12 ; 0x30f14 30f08: 9f e9 ldi r25, 0x9F ; 159 30f0a: 98 0f add r25, r24 30f0c: 96 30 cpi r25, 0x06 ; 6 30f0e: 20 f0 brcs .+8 ; 0x30f18 case 'd': case 'e': case 'f': return c - 'a' + 10; default: return 0; 30f10: 80 e0 ldi r24, 0x00 ; 0 } } 30f12: 08 95 ret case '5': case '6': case '7': case '8': case '9': return c - '0'; 30f14: 80 53 subi r24, 0x30 ; 48 30f16: 08 95 ret case 'b': case 'c': case 'd': case 'e': case 'f': return c - 'a' + 10; 30f18: 87 55 subi r24, 0x57 ; 87 30f1a: 08 95 ret 00030f1c : /// 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 { 30f1c: cf 93 push r28 30f1e: df 93 push r29 30f20: ec 01 movw r28, r24 uint8_t crc = 0; crc = modules::crc::CRC8::CCITT_updateCX(0, (uint8_t)code); 30f22: 68 81 ld r22, Y 30f24: 80 e0 ldi r24, 0x00 ; 0 30f26: 0f 94 4d 6c call 0x2d89a ; 0x2d89a crc = modules::crc::CRC8::CCITT_updateCX(crc, value); 30f2a: 69 81 ldd r22, Y+1 ; 0x01 30f2c: 0f 94 4d 6c call 0x2d89a ; 0x2d89a crc = modules::crc::CRC8::CCITT_updateW(crc, value2); 30f30: 6a 81 ldd r22, Y+2 ; 0x02 30f32: 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]); 30f34: 0f 94 4d 6c call 0x2d89a ; 0x2d89a 30f38: 6c 2f mov r22, r28 return crc; } 30f3a: df 91 pop r29 30f3c: cf 91 pop r28 30f3e: 0d 94 4d 6c jmp 0x2d89a ; 0x2d89a 00030f42 : 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 { 30f42: cf 93 push r28 30f44: df 93 push r29 30f46: ec 01 movw r28, r24 uint8_t crc = request.ComputeCRC8(); 30f48: 0f 94 8e 87 call 0x30f1c ; 0x30f1c crc = modules::crc::CRC8::CCITT_updateCX(crc, (uint8_t)paramCode); 30f4c: 6d 81 ldd r22, Y+5 ; 0x05 30f4e: 0f 94 4d 6c call 0x2d89a ; 0x2d89a crc = modules::crc::CRC8::CCITT_updateW(crc, paramValue); 30f52: 6e 81 ldd r22, Y+6 ; 0x06 30f54: cf 81 ldd r28, Y+7 ; 0x07 30f56: 0f 94 4d 6c call 0x2d89a ; 0x2d89a 30f5a: 6c 2f mov r22, r28 return crc; } 30f5c: df 91 pop r29 30f5e: cf 91 pop r28 30f60: 0d 94 4d 6c jmp 0x2d89a ; 0x2d89a 00030f64 : return crc; } /// @param code of the request message /// @param value of the request message inline constexpr RequestMsg(RequestMsgCodes code, uint8_t value) 30f64: cf 93 push r28 30f66: df 93 push r29 30f68: ec 01 movw r28, r24 : code(code) , value(value) , value2(0) , crc8(ComputeCRC8()) { 30f6a: 68 83 st Y, r22 30f6c: 49 83 std Y+1, r20 ; 0x01 30f6e: 1b 82 std Y+3, r1 ; 0x03 30f70: 1a 82 std Y+2, r1 ; 0x02 30f72: 0f 94 8e 87 call 0x30f1c ; 0x30f1c 30f76: 8c 83 std Y+4, r24 ; 0x04 } 30f78: df 91 pop r29 30f7a: cf 91 pop r28 30f7c: 08 95 ret 00030f7e : void Enable_E0() { enable_e0(); } void Disable_E0() { disable_e0(); 30f7e: 14 9a sbi 0x02, 4 ; 2 } 30f80: 08 95 ret 00030f82 : 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) { 30f82: cf 92 push r12 30f84: df 92 push r13 30f86: ef 92 push r14 30f88: ff 92 push r15 30f8a: cf 93 push r28 30f8c: df 93 push r29 30f8e: 69 01 movw r12, r18 30f90: 7a 01 movw r14, r20 current_position[E_AXIS] += delta; 30f92: c5 ef ldi r28, 0xF5 ; 245 30f94: d1 e1 ldi r29, 0x11 ; 17 30f96: 9b 01 movw r18, r22 30f98: ac 01 movw r20, r24 30f9a: 6c 85 ldd r22, Y+12 ; 0x0c 30f9c: 7d 85 ldd r23, Y+13 ; 0x0d 30f9e: 8e 85 ldd r24, Y+14 ; 0x0e 30fa0: 9f 85 ldd r25, Y+15 ; 0x0f 30fa2: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 30fa6: 6c 87 std Y+12, r22 ; 0x0c 30fa8: 7d 87 std Y+13, r23 ; 0x0d 30faa: 8e 87 std Y+14, r24 ; 0x0e 30fac: 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); 30fae: c7 01 movw r24, r14 30fb0: b6 01 movw r22, r12 } void extruder_move(float delta, float feedRate) { current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } 30fb2: df 91 pop r29 30fb4: cf 91 pop r28 30fb6: ff 90 pop r15 30fb8: ef 90 pop r14 30fba: df 90 pop r13 30fbc: 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); 30fbe: 0d 94 2f 85 jmp 0x30a5e ; 0x30a5e 00030fc2 : st_synchronize(); } static inline void go_to_current(float fr) { plan_buffer_line_curposXYZE(fr); 30fc2: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 30fc6: 0d 94 ce 22 jmp 0x2459c ; 0x2459c 00030fca : #include "mmu2_log.h" namespace MMU2 { void LogErrorEvent_P(const char *msg){ 30fca: cf 93 push r28 30fcc: df 93 push r29 30fce: ec 01 movw r28, r24 SERIAL_ECHO_START; //!@todo Decide MMU errors on serial line 30fd0: 81 e6 ldi r24, 0x61 ; 97 30fd2: 9d e9 ldi r25, 0x9D ; 157 30fd4: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_MMU2(); 30fd8: 84 ea ldi r24, 0xA4 ; 164 30fda: 9d e9 ldi r25, 0x9D ; 157 30fdc: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHOLNRPGM(msg); 30fe0: ce 01 movw r24, r28 } 30fe2: df 91 pop r29 30fe4: 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); 30fe6: 0c 94 49 72 jmp 0xe492 ; 0xe492 00030fea : #include "Filament_sensor.h" namespace MMU2 { FilamentState WhereIsFilament(){ return fsensor.getFilamentPresent() ? FilamentState::AT_FSENSOR : FilamentState::NOT_PRESENT; 30fea: 0c 94 f9 c3 jmp 0x187f2 ; 0x187f2 00030fee : constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 30fee: 89 32 cpi r24, 0x29 ; 41 30ff0: 20 e8 ldi r18, 0x80 ; 128 30ff2: 92 07 cpc r25, r18 30ff4: 09 f4 brne .+2 ; 0x30ff8 30ff6: 97 c0 rjmp .+302 ; 0x31126 30ff8: 08 f0 brcs .+2 ; 0x30ffc 30ffa: 48 c0 rjmp .+144 ; 0x3108c 30ffc: 86 30 cpi r24, 0x06 ; 6 30ffe: 60 e8 ldi r22, 0x80 ; 128 31000: 96 07 cpc r25, r22 31002: 09 f4 brne .+2 ; 0x31006 31004: 9a c0 rjmp .+308 ; 0x3113a 31006: 30 f5 brcc .+76 ; 0x31054 31008: 83 30 cpi r24, 0x03 ; 3 3100a: 40 e8 ldi r20, 0x80 ; 128 3100c: 94 07 cpc r25, r20 3100e: 09 f4 brne .+2 ; 0x31012 31010: 80 c0 rjmp .+256 ; 0x31112 31012: a8 f4 brcc .+42 ; 0x3103e 31014: 81 30 cpi r24, 0x01 ; 1 31016: 20 e8 ldi r18, 0x80 ; 128 31018: 92 07 cpc r25, r18 3101a: 09 f4 brne .+2 ; 0x3101e 3101c: 17 c1 rjmp .+558 ; 0x3124c 3101e: 82 30 cpi r24, 0x02 ; 2 31020: 40 e8 ldi r20, 0x80 ; 128 31022: 94 07 cpc r25, r20 31024: 09 f4 brne .+2 ; 0x31028 31026: 73 c0 rjmp .+230 ; 0x3110e 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); 31028: 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)) { 3102a: 86 ff sbrs r24, 6 3102c: 8e c0 rjmp .+284 ; 0x3114a 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); 3102e: 22 27 eor r18, r18 31030: 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) { 31032: 21 15 cp r18, r1 31034: 32 4c sbci r19, 0xC2 ; 194 31036: 09 f0 breq .+2 ; 0x3103a 31038: 9e c0 rjmp .+316 ; 0x31176 return FindErrorIndex(ERR_ELECTRICAL_MMU_PULLEY_SELFTEST_FAILED); 3103a: 8e e1 ldi r24, 0x1E ; 30 3103c: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 3103e: 84 30 cpi r24, 0x04 ; 4 31040: 60 e8 ldi r22, 0x80 ; 128 31042: 96 07 cpc r25, r22 31044: 09 f4 brne .+2 ; 0x31048 31046: 67 c0 rjmp .+206 ; 0x31116 31048: 85 30 cpi r24, 0x05 ; 5 3104a: 20 e8 ldi r18, 0x80 ; 128 3104c: 92 07 cpc r25, r18 3104e: 61 f7 brne .-40 ; 0x31028 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); 31050: 84 e2 ldi r24, 0x24 ; 36 31052: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 31054: 8a 30 cpi r24, 0x0A ; 10 31056: 40 e8 ldi r20, 0x80 ; 128 31058: 94 07 cpc r25, r20 3105a: 09 f4 brne .+2 ; 0x3105e 3105c: 5e c0 rjmp .+188 ; 0x3111a 3105e: 58 f4 brcc .+22 ; 0x31076 31060: 88 30 cpi r24, 0x08 ; 8 31062: 20 e8 ldi r18, 0x80 ; 128 31064: 92 07 cpc r25, r18 31066: 09 f4 brne .+2 ; 0x3106a 31068: 6e c0 rjmp .+220 ; 0x31146 3106a: 89 30 cpi r24, 0x09 ; 9 3106c: 40 e8 ldi r20, 0x80 ; 128 3106e: 94 07 cpc r25, r20 31070: d9 f6 brne .-74 ; 0x31028 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); 31072: 85 e0 ldi r24, 0x05 ; 5 31074: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 31076: 8c 30 cpi r24, 0x0C ; 12 31078: 60 e8 ldi r22, 0x80 ; 128 3107a: 96 07 cpc r25, r22 3107c: 09 f4 brne .+2 ; 0x31080 3107e: 51 c0 rjmp .+162 ; 0x31122 31080: 8d 30 cpi r24, 0x0D ; 13 31082: 20 e8 ldi r18, 0x80 ; 128 31084: 92 07 cpc r25, r18 31086: 81 f6 brne .-96 ; 0x31028 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); 31088: 81 e2 ldi r24, 0x21 ; 33 3108a: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 3108c: 8f 32 cpi r24, 0x2F ; 47 3108e: 40 e8 ldi r20, 0x80 ; 128 31090: 94 07 cpc r25, r20 31092: 09 f4 brne .+2 ; 0x31096 31094: 56 c0 rjmp .+172 ; 0x31142 31096: e0 f4 brcc .+56 ; 0x310d0 31098: 8c 32 cpi r24, 0x2C ; 44 3109a: 20 e8 ldi r18, 0x80 ; 128 3109c: 92 07 cpc r25, r18 3109e: 09 f4 brne .+2 ; 0x310a2 310a0: 4e c0 rjmp .+156 ; 0x3113e 310a2: 58 f4 brcc .+22 ; 0x310ba 310a4: 8a 32 cpi r24, 0x2A ; 42 310a6: 60 e8 ldi r22, 0x80 ; 128 310a8: 96 07 cpc r25, r22 310aa: c9 f1 breq .+114 ; 0x3111e 310ac: 8b 32 cpi r24, 0x2B ; 43 310ae: 20 e8 ldi r18, 0x80 ; 128 310b0: 92 07 cpc r25, r18 310b2: 09 f0 breq .+2 ; 0x310b6 310b4: b9 cf rjmp .-142 ; 0x31028 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); 310b6: 86 e2 ldi r24, 0x26 ; 38 310b8: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 310ba: 8d 32 cpi r24, 0x2D ; 45 310bc: 40 e8 ldi r20, 0x80 ; 128 310be: 94 07 cpc r25, r20 310c0: d1 f1 breq .+116 ; 0x31136 310c2: 8e 32 cpi r24, 0x2E ; 46 310c4: 60 e8 ldi r22, 0x80 ; 128 310c6: 96 07 cpc r25, r22 310c8: 09 f0 breq .+2 ; 0x310cc 310ca: ae cf rjmp .-164 ; 0x31028 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); 310cc: 82 e2 ldi r24, 0x22 ; 34 310ce: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 310d0: 87 38 cpi r24, 0x87 ; 135 310d2: 20 e8 ldi r18, 0x80 ; 128 310d4: 92 07 cpc r25, r18 310d6: 49 f1 breq .+82 ; 0x3112a 310d8: 58 f4 brcc .+22 ; 0x310f0 310da: 87 34 cpi r24, 0x47 ; 71 310dc: 60 e8 ldi r22, 0x80 ; 128 310de: 96 07 cpc r25, r22 310e0: 29 f0 breq .+10 ; 0x310ec 310e2: 8b 34 cpi r24, 0x4B ; 75 310e4: 20 e8 ldi r18, 0x80 ; 128 310e6: 92 07 cpc r25, r18 310e8: 09 f0 breq .+2 ; 0x310ec 310ea: 9e cf rjmp .-196 ; 0x31028 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); 310ec: 84 e0 ldi r24, 0x04 ; 4 310ee: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 310f0: 87 30 cpi r24, 0x07 ; 7 310f2: 41 e8 ldi r20, 0x81 ; 129 310f4: 94 07 cpc r25, r20 310f6: d9 f0 breq .+54 ; 0x3112e 310f8: 8b 30 cpi r24, 0x0B ; 11 310fa: 61 e8 ldi r22, 0x81 ; 129 310fc: 96 07 cpc r25, r22 310fe: c9 f0 breq .+50 ; 0x31132 31100: 8b 38 cpi r24, 0x8B ; 139 31102: 20 e8 ldi r18, 0x80 ; 128 31104: 92 07 cpc r25, r18 31106: 09 f0 breq .+2 ; 0x3110a 31108: 8f cf rjmp .-226 ; 0x31028 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); 3110a: 89 e0 ldi r24, 0x09 ; 9 3110c: 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); 3110e: 81 e0 ldi r24, 0x01 ; 1 31110: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER); 31112: 82 e0 ldi r24, 0x02 ; 2 31114: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK); 31116: 83 e0 ldi r24, 0x03 ; 3 31118: 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); 3111a: 86 e0 ldi r24, 0x06 ; 6 3111c: 08 95 ret case ErrorCode::LOAD_TO_EXTRUDER_FAILED: return FindErrorIndex(ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED); 3111e: 87 e0 ldi r24, 0x07 ; 7 31120: 08 95 ret case ErrorCode::FILAMENT_EJECTED: return FindErrorIndex(ERR_SYSTEM_FILAMENT_EJECTED); 31122: 8a e2 ldi r24, 0x2A ; 42 31124: 08 95 ret case ErrorCode::FILAMENT_CHANGE: return FindErrorIndex(ERR_SYSTEM_FILAMENT_CHANGE); 31126: 8b e2 ldi r24, 0x2B ; 43 31128: 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); 3112a: 88 e0 ldi r24, 0x08 ; 8 3112c: 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); 3112e: 8a e0 ldi r24, 0x0A ; 10 31130: 08 95 ret case ErrorCode::MOVE_IDLER_FAILED: return FindErrorIndex(ERR_MECHANICAL_IDLER_CANNOT_MOVE); 31132: 8b e0 ldi r24, 0x0B ; 11 31134: 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); 31136: 83 e2 ldi r24, 0x23 ; 35 31138: 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); 3113a: 85 e2 ldi r24, 0x25 ; 37 3113c: 08 95 ret case ErrorCode::QUEUE_FULL: return FindErrorIndex(ERR_SYSTEM_QUEUE_FULL); case ErrorCode::VERSION_MISMATCH: return FindErrorIndex(ERR_SYSTEM_FW_UPDATE_NEEDED); 3113e: 87 e2 ldi r24, 0x27 ; 39 31140: 08 95 ret case ErrorCode::INTERNAL: return FindErrorIndex(ERR_SYSTEM_FW_RUNTIME_ERROR); 31142: 88 e2 ldi r24, 0x28 ; 40 31144: 08 95 ret case ErrorCode::FINDA_VS_EEPROM_DISREPANCY: return FindErrorIndex(ERR_SYSTEM_UNLOAD_MANUALLY); 31146: 89 e2 ldi r24, 0x29 ; 41 31148: 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)) { 3114a: 87 ff sbrs r24, 7 3114c: 07 c0 rjmp .+14 ; 0x3115c 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); 3114e: 22 27 eor r18, r18 31150: 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) { 31152: 21 15 cp r18, r1 31154: 32 4c sbci r19, 0xC2 ; 194 31156: a1 f5 brne .+104 ; 0x311c0 return FindErrorIndex(ERR_ELECTRICAL_MMU_SELECTOR_SELFTEST_FAILED); 31158: 8f e1 ldi r24, 0x1F ; 31 3115a: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 3115c: 22 27 eor r18, r18 3115e: 31 70 andi r19, 0x01 ; 1 31160: 90 ff sbrs r25, 0 31162: 52 c0 rjmp .+164 ; 0x31208 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); 31164: ac 01 movw r20, r24 31166: 44 27 eor r20, r20 31168: 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) { 3116a: 41 15 cp r20, r1 3116c: 52 4c sbci r21, 0xC2 ; 194 3116e: 09 f0 breq .+2 ; 0x31172 31170: 4b c0 rjmp .+150 ; 0x31208 return FindErrorIndex(ERR_ELECTRICAL_MMU_IDLER_SELFTEST_FAILED); 31172: 80 e2 ldi r24, 0x20 ; 32 31174: 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; 31176: 9c 01 movw r18, r24 31178: 22 27 eor r18, r18 3117a: 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)) { 3117c: 23 2b or r18, r19 3117e: 09 f0 breq .+2 ; 0x31182 31180: 67 c0 rjmp .+206 ; 0x31250 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; 31182: 9c 01 movw r18, r24 31184: 22 27 eor r18, r18 31186: 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)) { 31188: 23 2b or r18, r19 3118a: 09 f0 breq .+2 ; 0x3118e 3118c: 63 c0 rjmp .+198 ; 0x31254 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; 3118e: 9c 01 movw r18, r24 31190: 22 27 eor r18, r18 31192: 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)) { 31194: 23 2b or r18, r19 31196: 09 f0 breq .+2 ; 0x3119a 31198: 5f c0 rjmp .+190 ; 0x31258 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; 3119a: 9c 01 movw r18, r24 3119c: 22 27 eor r18, r18 3119e: 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)) { 311a0: 23 2b or r18, r19 311a2: 09 f0 breq .+2 ; 0x311a6 311a4: 5b c0 rjmp .+182 ; 0x3125c 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; 311a6: 9c 01 movw r18, r24 311a8: 22 27 eor r18, r18 311aa: 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)) { 311ac: 23 2b or r18, r19 311ae: 09 f0 breq .+2 ; 0x311b2 311b0: 57 c0 rjmp .+174 ; 0x31260 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; 311b2: 88 27 eor r24, r24 311b4: 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)) { 311b6: 89 2b or r24, r25 311b8: 09 f4 brne .+2 ; 0x311bc 311ba: 68 c0 rjmp .+208 ; 0x3128c return FindErrorIndex(ERR_TEMPERATURE_TMC_PULLEY_OVERHEAT_ERROR); 311bc: 8f e0 ldi r24, 0x0F ; 15 311be: 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; 311c0: 9c 01 movw r18, r24 311c2: 22 27 eor r18, r18 311c4: 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)) { 311c6: 23 2b or r18, r19 311c8: 09 f0 breq .+2 ; 0x311cc 311ca: 4c c0 rjmp .+152 ; 0x31264 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; 311cc: 9c 01 movw r18, r24 311ce: 22 27 eor r18, r18 311d0: 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)) { 311d2: 23 2b or r18, r19 311d4: 09 f0 breq .+2 ; 0x311d8 311d6: 48 c0 rjmp .+144 ; 0x31268 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; 311d8: 9c 01 movw r18, r24 311da: 22 27 eor r18, r18 311dc: 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)) { 311de: 23 2b or r18, r19 311e0: 09 f0 breq .+2 ; 0x311e4 311e2: 44 c0 rjmp .+136 ; 0x3126c 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; 311e4: 9c 01 movw r18, r24 311e6: 22 27 eor r18, r18 311e8: 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)) { 311ea: 23 2b or r18, r19 311ec: 09 f0 breq .+2 ; 0x311f0 311ee: 40 c0 rjmp .+128 ; 0x31270 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; 311f0: 9c 01 movw r18, r24 311f2: 22 27 eor r18, r18 311f4: 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)) { 311f6: 23 2b or r18, r19 311f8: e9 f5 brne .+122 ; 0x31274 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; 311fa: 88 27 eor r24, r24 311fc: 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)) { 311fe: 89 2b or r24, r25 31200: 09 f4 brne .+2 ; 0x31204 31202: 44 c0 rjmp .+136 ; 0x3128c return FindErrorIndex(ERR_TEMPERATURE_TMC_SELECTOR_OVERHEAT_ERROR); 31204: 80 e1 ldi r24, 0x10 ; 16 31206: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 31208: 23 2b or r18, r19 3120a: 09 f4 brne .+2 ; 0x3120e 3120c: 3f c0 rjmp .+126 ; 0x3128c 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; 3120e: 9c 01 movw r18, r24 31210: 22 27 eor r18, r18 31212: 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)) { 31214: 23 2b or r18, r19 31216: 81 f5 brne .+96 ; 0x31278 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; 31218: 9c 01 movw r18, r24 3121a: 22 27 eor r18, r18 3121c: 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)) { 3121e: 23 2b or r18, r19 31220: 69 f5 brne .+90 ; 0x3127c 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; 31222: 9c 01 movw r18, r24 31224: 22 27 eor r18, r18 31226: 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)) { 31228: 23 2b or r18, r19 3122a: 51 f5 brne .+84 ; 0x31280 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; 3122c: 9c 01 movw r18, r24 3122e: 22 27 eor r18, r18 31230: 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)) { 31232: 23 2b or r18, r19 31234: 39 f5 brne .+78 ; 0x31284 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; 31236: 9c 01 movw r18, r24 31238: 22 27 eor r18, r18 3123a: 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)) { 3123c: 23 2b or r18, r19 3123e: 21 f5 brne .+72 ; 0x31288 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; 31240: 88 27 eor r24, r24 31242: 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)) { 31244: 89 2b or r24, r25 31246: 11 f1 breq .+68 ; 0x3128c return FindErrorIndex(ERR_TEMPERATURE_TMC_IDLER_OVERHEAT_ERROR); 31248: 81 e1 ldi r24, 0x11 ; 17 3124a: 08 95 ret } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { case ErrorCode::FINDA_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER); 3124c: 80 e0 ldi r24, 0x00 ; 0 3124e: 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); 31250: 82 e1 ldi r24, 0x12 ; 18 31252: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_RESET); 31254: 85 e1 ldi r24, 0x15 ; 21 31256: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_UNDERVOLTAGE_ERROR); 31258: 88 e1 ldi r24, 0x18 ; 24 3125a: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_SHORTED); 3125c: 8b e1 ldi r24, 0x1B ; 27 3125e: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_PULLEY_TOO_HOT); 31260: 8c e0 ldi r24, 0x0C ; 12 31262: 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); 31264: 83 e1 ldi r24, 0x13 ; 19 31266: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_RESET); 31268: 86 e1 ldi r24, 0x16 ; 22 3126a: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_UNDERVOLTAGE_ERROR); 3126c: 89 e1 ldi r24, 0x19 ; 25 3126e: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_SHORTED); 31270: 8c e1 ldi r24, 0x1C ; 28 31272: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT); 31274: 8d e0 ldi r24, 0x0D ; 13 31276: 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); 31278: 84 e1 ldi r24, 0x14 ; 20 3127a: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_RESET); 3127c: 87 e1 ldi r24, 0x17 ; 23 3127e: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_UNDERVOLTAGE_ERROR); 31280: 8a e1 ldi r24, 0x1A ; 26 31282: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_SHORTED); 31284: 8d e1 ldi r24, 0x1D ; 29 31286: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT); 31288: 8e e0 ldi r24, 0x0E ; 14 3128a: 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); 3128c: 8c e2 ldi r24, 0x2C ; 44 } 3128e: 08 95 ret 00031290 : bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { 31290: cf 92 push r12 31292: df 92 push r13 31294: ef 92 push r14 31296: ff 92 push r15 31298: 0f 93 push r16 3129a: 1f 93 push r17 3129c: cf 93 push r28 3129e: df 93 push r29 if (putErrorScreenToSleep) return; if (mmu2.MMUCurrentErrorCode() == ErrorCode::OK && mmu2.MMULastErrorSource() == MMU2::ErrorSourceMMU) { 312a0: 20 91 65 12 lds r18, 0x1265 ; 0x801265 312a4: 30 91 66 12 lds r19, 0x1266 ; 0x801266 312a8: 21 30 cpi r18, 0x01 ; 1 312aa: 31 05 cpc r19, r1 312ac: 39 f4 brne .+14 ; 0x312bc 312ae: 20 91 8e 12 lds r18, 0x128E ; 0x80128e 312b2: 21 30 cpi r18, 0x01 ; 1 312b4: 19 f4 brne .+6 ; 0x312bc // 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; 312b6: 22 e0 ldi r18, 0x02 ; 2 312b8: 20 93 c3 16 sts 0x16C3, r18 ; 0x8016c3 } const uint8_t ei = PrusaErrorCodeIndex((ErrorCode)ec); 312bc: 0f 94 f7 87 call 0x30fee ; 0x30fee 312c0: d8 2f mov r29, r24 switch ((uint8_t)ReportErrorHookState) { 312c2: 80 91 c3 16 lds r24, 0x16C3 ; 0x8016c3 312c6: 81 30 cpi r24, 0x01 ; 1 312c8: 09 f4 brne .+2 ; 0x312cc 312ca: 64 c0 rjmp .+200 ; 0x31394 312cc: 60 f0 brcs .+24 ; 0x312e6 312ce: 82 30 cpi r24, 0x02 ; 2 312d0: 09 f4 brne .+2 ; 0x312d4 312d2: f4 c0 rjmp .+488 ; 0x314bc ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; default: break; } } 312d4: df 91 pop r29 312d6: cf 91 pop r28 312d8: 1f 91 pop r17 312da: 0f 91 pop r16 312dc: ff 90 pop r15 312de: ef 90 pop r14 312e0: df 90 pop r13 312e2: cf 90 pop r12 312e4: 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); 312e6: 84 e0 ldi r24, 0x04 ; 4 312e8: 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); 312ec: 0d 2f mov r16, r29 312ee: 10 e0 ldi r17, 0x00 ; 0 312f0: f8 01 movw r30, r16 312f2: e2 5f subi r30, 0xF2 ; 242 312f4: f1 46 sbci r31, 0x61 ; 97 312f6: 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); 312f8: fc 2e mov r15, r28 312fa: f2 94 swap r15 312fc: 6f e0 ldi r22, 0x0F ; 15 312fe: f6 22 and r15, r22 const uint8_t button_op_middle = BUTTON_OP_MIDDLE(button_operation); 31300: 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); 31302: 80 e0 ldi r24, 0x00 ; 0 31304: 0e 94 b6 69 call 0xd36c ; 0xd36c lcd_clear(); 31308: 0e 94 a4 69 call 0xd348 ; 0xd348 // 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); 3130c: 00 0f add r16, r16 3130e: 11 1f adc r17, r17 31310: f8 01 movw r30, r16 31312: e5 5c subi r30, 0xC5 ; 197 31314: f1 46 sbci r31, 0x61 ; 97 31316: c5 90 lpm r12, Z+ 31318: d4 90 lpm r13, Z } const char *PrusaErrorTitle(uint8_t i) { return (const char *)pgm_read_ptr(errorTitles + i); 3131a: 09 50 subi r16, 0x09 ; 9 3131c: 15 46 sbci r17, 0x65 ; 101 3131e: f8 01 movw r30, r16 31320: 85 91 lpm r24, Z+ 31322: 94 91 lpm r25, Z // Print title and header lcd_printf_P(PSTR("%.20S\nprusa.io/04%hu"), _T(PrusaErrorTitle(ei)), PrusaErrorCode(ei) ); 31324: 0e 94 a7 6c call 0xd94e ; 0xd94e 31328: df 92 push r13 3132a: cf 92 push r12 3132c: 9f 93 push r25 3132e: 8f 93 push r24 31330: 87 ea ldi r24, 0xA7 ; 167 31332: 9e e9 ldi r25, 0x9E ; 158 31334: 9f 93 push r25 31336: 8f 93 push r24 31338: 0e 94 4a 69 call 0xd294 ; 0xd294 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)); 3133c: 42 e8 ldi r20, 0x82 ; 130 3133e: 5b e9 ldi r21, 0x9B ; 155 31340: 62 e0 ldi r22, 0x02 ; 2 31342: 80 e0 ldi r24, 0x00 ; 0 31344: 0e 94 85 69 call 0xd30a ; 0xd30a 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()); 31348: 0f 90 pop r0 3134a: 0f 90 pop r0 3134c: 0f 90 pop r0 3134e: 0f 90 pop r0 31350: 0f 90 pop r0 31352: 0f 90 pop r0 31354: f1 10 cpse r15, r1 31356: c6 c0 rjmp .+396 ; 0x314e4 31358: 10 e0 ldi r17, 0x00 ; 0 3135a: 00 e0 ldi r16, 0x00 ; 0 3135c: 42 e1 ldi r20, 0x12 ; 18 3135e: e4 2e mov r14, r20 31360: 5d e3 ldi r21, 0x3D ; 61 31362: c5 2e mov r12, r21 31364: 5c e6 ldi r21, 0x6C ; 108 31366: 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); 31368: ec 2f mov r30, r28 3136a: f0 e0 ldi r31, 0x00 ; 0 3136c: ee 0f add r30, r30 3136e: ff 1f adc r31, r31 31370: ed 56 subi r30, 0x6D ; 109 31372: f1 46 sbci r31, 0x61 ; 97 31374: 85 91 lpm r24, Z+ 31376: 94 91 lpm r25, Z 31378: 0e 94 a7 6c call 0xd94e ; 0xd94e 3137c: bc 01 movw r22, r24 3137e: 81 e0 ldi r24, 0x01 ; 1 31380: f1 10 cpse r15, r1 31382: 01 c0 rjmp .+2 ; 0x31386 31384: 80 e0 ldi r24, 0x00 ; 0 31386: 2e 2d mov r18, r14 31388: a6 01 movw r20, r12 3138a: 0f 94 d1 0a call 0x215a2 ; 0x215a2 switch ((uint8_t)ReportErrorHookState) { case (uint8_t)ReportErrorHookStates::RENDER_ERROR_SCREEN: KEEPALIVE_STATE(PAUSED_FOR_USER); ReportErrorHookStaticRender(ei); ReportErrorHookState = ReportErrorHookStates::MONITOR_SELECTION; 3138e: 81 e0 ldi r24, 0x01 ; 1 31390: 80 93 c3 16 sts 0x16C3, r24 ; 0x8016c3 [[fallthrough]]; case (uint8_t)ReportErrorHookStates::MONITOR_SELECTION: is_mmu_error_monitor_active = true; 31394: 81 e0 ldi r24, 0x01 ; 1 31396: 80 93 c6 06 sts 0x06C6, r24 ; 0x8006c6 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.452> ReportErrorHookDynamicRender(); // Render dynamic characters 3139a: 0f 94 1e 87 call 0x30e3c ; 0x30e3c sound_wait_for_user(); 3139e: 0f 94 83 36 call 0x26d06 ; 0x26d06 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); 313a2: 0d 2f mov r16, r29 313a4: 10 e0 ldi r17, 0x00 ; 0 313a6: f8 01 movw r30, r16 313a8: e2 5f subi r30, 0xF2 ; 242 313aa: f1 46 sbci r31, 0x61 ; 97 313ac: 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); 313ae: dc 2f mov r29, r28 313b0: d2 95 swap r29 313b2: 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; 313b4: 80 91 bb 16 lds r24, 0x16BB ; 0x8016bb 313b8: 81 11 cpse r24, r1 313ba: 09 c0 rjmp .+18 ; 0x313ce 313bc: 81 e0 ldi r24, 0x01 ; 1 313be: d1 11 cpse r29, r1 313c0: 01 c0 rjmp .+2 ; 0x313c4 313c2: 80 e0 ldi r24, 0x00 ; 0 313c4: 80 93 ba 16 sts 0x16BA, r24 ; 0x8016ba 313c8: 81 e0 ldi r24, 0x01 ; 1 313ca: 80 93 bb 16 sts 0x16BB, r24 ; 0x8016bb static int8_t choice_selected = -1; if (reset_button_selection) { 313ce: 80 91 b9 16 lds r24, 0x16B9 ; 0x8016b9 313d2: 88 23 and r24, r24 313d4: 41 f0 breq .+16 ; 0x313e6 // 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; 313d6: 81 e0 ldi r24, 0x01 ; 1 313d8: d1 11 cpse r29, r1 313da: 01 c0 rjmp .+2 ; 0x313de 313dc: 80 e0 ldi r24, 0x00 ; 0 313de: 80 93 ba 16 sts 0x16BA, r24 ; 0x8016ba choice_selected = -1; reset_button_selection = 0; 313e2: 10 92 b9 16 sts 0x16B9, r1 ; 0x8016b9 } // Check if knob was rotated if (lcd_encoder) { 313e6: 20 91 06 05 lds r18, 0x0506 ; 0x800506 313ea: 30 91 07 05 lds r19, 0x0507 ; 0x800507 313ee: 21 15 cp r18, r1 313f0: 31 05 cpc r19, r1 313f2: b9 f1 breq .+110 ; 0x31462 313f4: 80 91 ba 16 lds r24, 0x16BA ; 0x8016ba if (two_choices == false) { // third_choice is not nullptr, safe to dereference 313f8: dd 23 and r29, r29 313fa: 61 f0 breq .+24 ; 0x31414 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 313fc: 37 ff sbrs r19, 7 313fe: 06 c0 rjmp .+12 ; 0x3140c 31400: 88 23 and r24, r24 31402: 69 f0 breq .+26 ; 0x3141e // Rotating knob counter clockwise current_selection--; 31404: 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; 31406: 80 93 ba 16 sts 0x16BA, r24 ; 0x8016ba 3140a: 09 c0 rjmp .+18 ; 0x3141e 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) { 3140c: 82 30 cpi r24, 0x02 ; 2 3140e: 39 f0 breq .+14 ; 0x3141e // Rotating knob clockwise current_selection++; 31410: 8f 5f subi r24, 0xFF ; 255 31412: f9 cf rjmp .-14 ; 0x31406 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 31414: 37 ff sbrs r19, 7 31416: 41 c0 rjmp .+130 ; 0x3149a 31418: 81 11 cpse r24, r1 // Rotating knob counter clockwise current_selection = LCD_LEFT_BUTTON_CHOICE; 3141a: 10 92 ba 16 sts 0x16BA, r1 ; 0x8016ba //! ---------------------- //! |>(left) >(mid) | //! ---------------------- //! @endcode // lcd_putc_at(0, 3, current_selection == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 3141e: 80 91 ba 16 lds r24, 0x16BA ; 0x8016ba 31422: 4e e3 ldi r20, 0x3E ; 62 31424: 81 11 cpse r24, r1 31426: 40 e2 ldi r20, 0x20 ; 32 31428: 63 e0 ldi r22, 0x03 ; 3 3142a: 80 e0 ldi r24, 0x00 ; 0 3142c: 0e 94 91 69 call 0xd322 ; 0xd322 31430: 80 91 ba 16 lds r24, 0x16BA ; 0x8016ba if (two_choices == false) 31434: dd 23 and r29, r29 31436: b1 f1 breq .+108 ; 0x314a4 { lcd_putc_at(9, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 31438: 4e e3 ldi r20, 0x3E ; 62 3143a: 81 30 cpi r24, 0x01 ; 1 3143c: 09 f0 breq .+2 ; 0x31440 3143e: 40 e2 ldi r20, 0x20 ; 32 31440: 63 e0 ldi r22, 0x03 ; 3 31442: 89 e0 ldi r24, 0x09 ; 9 31444: 0e 94 91 69 call 0xd322 ; 0xd322 lcd_putc_at(18, 3, current_selection == LCD_RIGHT_BUTTON_CHOICE ? '>': ' '); 31448: 80 91 ba 16 lds r24, 0x16BA ; 0x8016ba 3144c: 82 30 cpi r24, 0x02 ; 2 3144e: 61 f5 brne .+88 ; 0x314a8 } else { // More button for two button screen lcd_putc_at(18, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 31450: 4e e3 ldi r20, 0x3E ; 62 31452: 63 e0 ldi r22, 0x03 ; 3 31454: 82 e1 ldi r24, 0x12 ; 18 31456: 0e 94 91 69 call 0xd322 ; 0xd322 } // Consume rotation event lcd_encoder = 0; 3145a: 10 92 07 05 sts 0x0507, r1 ; 0x800507 3145e: 10 92 06 05 sts 0x0506, r1 ; 0x800506 } // Check if knob was clicked and consume the event if (lcd_clicked()) { 31462: 0e 94 8e 6b call 0xd71c ; 0xd71c 31466: 88 23 and r24, r24 31468: 09 f4 brne .+2 ; 0x3146c 3146a: 34 cf rjmp .-408 ; 0x312d4 choice_selected = current_selection; 3146c: 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 31470: d1 11 cpse r29, r1 31472: 1c c0 rjmp .+56 ; 0x314ac 31474: 81 30 cpi r24, 0x01 ; 1 31476: 89 f5 brne .+98 ; 0x314da 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); 31478: f8 01 movw r30, r16 3147a: ee 0f add r30, r30 3147c: ff 1f adc r31, r31 3147e: ec 54 subi r30, 0x4C ; 76 31480: f2 46 sbci r31, 0x62 ; 98 31482: 85 91 lpm r24, Z+ 31484: 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))); 31486: 0e 94 a7 6c call 0xd94e ; 0xd94e 3148a: 0f 94 a9 0b call 0x21752 ; 0x21752 SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 3148e: 81 e0 ldi r24, 0x01 ; 1 31490: 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; 31494: 10 92 c3 16 sts 0x16C3, r1 ; 0x8016c3 31498: 1d cf rjmp .-454 ; 0x312d4 } } 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) { 3149a: 81 30 cpi r24, 0x01 ; 1 3149c: 09 f4 brne .+2 ; 0x314a0 3149e: bf cf rjmp .-130 ; 0x3141e // Rotating knob clockwise current_selection = LCD_MIDDLE_BUTTON_CHOICE; 314a0: 81 e0 ldi r24, 0x01 ; 1 314a2: b1 cf rjmp .-158 ; 0x31406 { 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 ? '>': ' '); 314a4: 81 30 cpi r24, 0x01 ; 1 314a6: a1 f2 breq .-88 ; 0x31450 314a8: 40 e2 ldi r20, 0x20 ; 32 314aa: d3 cf rjmp .-90 ; 0x31452 // 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 314ac: 82 30 cpi r24, 0x02 ; 2 314ae: 21 f3 breq .-56 ; 0x31478 { // 'More' show error description lcd_show_fullscreen_message_and_wait_P(_T(PrusaErrorDesc(ei))); ret = 1; } else if(choice_selected == LCD_MIDDLE_BUTTON_CHOICE) { 314b0: 81 30 cpi r24, 0x01 ; 1 314b2: 99 f4 brne .+38 ; 0x314da return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 314b4: 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; 314b8: 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); 314bc: 81 e0 ldi r24, 0x01 ; 1 314be: 0e 94 b6 69 call 0xd36c ; 0xd36c lcd_return_to_status(); 314c2: 0e 94 6d fe call 0x1fcda ; 0x1fcda 314c6: 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; 314ca: 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; 314ce: 10 92 c6 06 sts 0x06C6, r1 ; 0x8006c6 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.452> KEEPALIVE_STATE(IN_HANDLER); 314d2: 82 e0 ldi r24, 0x02 ; 2 314d4: 80 93 78 02 sts 0x0278, r24 ; 0x800278 314d8: dd cf rjmp .-70 ; 0x31494 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); 314da: cf 70 andi r28, 0x0F ; 15 314dc: 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; 314e0: 81 e0 ldi r24, 0x01 ; 1 314e2: ea cf rjmp .-44 ; 0x314b8 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); 314e4: ef 2d mov r30, r15 314e6: f0 e0 ldi r31, 0x00 ; 0 314e8: ee 0f add r30, r30 314ea: ff 1f adc r31, r31 314ec: ed 56 subi r30, 0x6D ; 109 314ee: f1 46 sbci r31, 0x61 ; 97 314f0: 85 91 lpm r24, Z+ 314f2: 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()); 314f4: 0e 94 a7 6c call 0xd94e ; 0xd94e 314f8: 6c 01 movw r12, r24 314fa: 0d e3 ldi r16, 0x3D ; 61 314fc: 1c e6 ldi r17, 0x6C ; 108 314fe: 99 e0 ldi r25, 0x09 ; 9 31500: e9 2e mov r14, r25 31502: 32 cf rjmp .-412 ; 0x31368 00031504 : buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation return result; } Buttons ButtonAvailable(ErrorCode ec) { uint8_t ei = PrusaErrorCodeIndex(ec); 31504: 0f 94 f7 87 call 0x30fee ; 0x30fee // 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); 31508: e8 2f mov r30, r24 3150a: f0 e0 ldi r31, 0x00 ; 0 3150c: ee 0f add r30, r30 3150e: ff 1f adc r31, r31 31510: e5 5c subi r30, 0xC5 ; 197 31512: f1 46 sbci r31, 0x61 ; 97 31514: 25 91 lpm r18, Z+ 31516: 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) ) { 31518: 23 33 cpi r18, 0x33 ; 51 3151a: 81 e0 ldi r24, 0x01 ; 1 3151c: 38 07 cpc r19, r24 3151e: 08 f0 brcs .+2 ; 0x31522 31520: 41 c0 rjmp .+130 ; 0x315a4 31522: 2d 32 cpi r18, 0x2D ; 45 31524: 81 e0 ldi r24, 0x01 ; 1 31526: 38 07 cpc r19, r24 31528: 78 f5 brcc .+94 ; 0x31588 3152a: 2e 37 cpi r18, 0x7E ; 126 3152c: 31 05 cpc r19, r1 3152e: 09 f4 brne .+2 ; 0x31532 31530: 83 c0 rjmp .+262 ; 0x31638 31532: f0 f4 brcc .+60 ; 0x31570 31534: 2c 36 cpi r18, 0x6C ; 108 31536: 31 05 cpc r19, r1 31538: 09 f4 brne .+2 ; 0x3153c 3153a: 85 c0 rjmp .+266 ; 0x31646 3153c: 30 f4 brcc .+12 ; 0x3154a 3153e: 25 36 cpi r18, 0x65 ; 101 31540: 31 05 cpc r19, r1 31542: 08 f0 brcs .+2 ; 0x31546 31544: 79 c0 rjmp .+242 ; 0x31638 default: break; } return Buttons::NoButton; 31546: 8f ef ldi r24, 0xFF ; 255 31548: 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) ) { 3154a: 24 37 cpi r18, 0x74 ; 116 3154c: 31 05 cpc r19, r1 3154e: 09 f4 brne .+2 ; 0x31552 31550: 73 c0 rjmp .+230 ; 0x31638 31552: 2d 37 cpi r18, 0x7D ; 125 31554: 31 05 cpc r19, r1 31556: 19 f0 breq .+6 ; 0x3155e 31558: 23 37 cpi r18, 0x73 ; 115 3155a: 31 05 cpc r19, r1 3155c: a1 f7 brne .-24 ; 0x31546 break; } break; case ERR_MECHANICAL_SELECTOR_CANNOT_HOME: case ERR_MECHANICAL_IDLER_CANNOT_HOME: switch (buttonSelectedOperation) { 3155e: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> 31562: 81 30 cpi r24, 0x01 ; 1 31564: 09 f4 brne .+2 ; 0x31568 31566: 6d c0 rjmp .+218 ; 0x31642 31568: 87 30 cpi r24, 0x07 ; 7 3156a: 69 f7 brne .-38 ; 0x31546 // may be allow move selector right and left in the future case ButtonOperations::Tune: // Tune Stallguard threshold return Buttons::TuneMMU; 3156c: 88 e0 ldi r24, 0x08 ; 8 3156e: 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) ) { 31570: 23 3d cpi r18, 0xD3 ; 211 31572: 31 05 cpc r19, r1 31574: 09 f4 brne .+2 ; 0x31578 31576: 6e c0 rjmp .+220 ; 0x31654 31578: 50 f4 brcc .+20 ; 0x3158e 3157a: 29 3c cpi r18, 0xC9 ; 201 3157c: 31 05 cpc r19, r1 3157e: 09 f4 brne .+2 ; 0x31582 31580: 69 c0 rjmp .+210 ; 0x31654 31582: 2a 3c cpi r18, 0xCA ; 202 31584: 31 05 cpc r19, r1 31586: f9 f6 brne .-66 ; 0x31546 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) { 31588: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> 3158c: 67 c0 rjmp .+206 ; 0x3165c // 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) ) { 3158e: 2d 3d cpi r18, 0xDD ; 221 31590: 31 05 cpc r19, r1 31592: 09 f4 brne .+2 ; 0x31596 31594: 5f c0 rjmp .+190 ; 0x31654 31596: 2e 3d cpi r18, 0xDE ; 222 31598: 31 05 cpc r19, r1 3159a: b1 f3 breq .-20 ; 0x31588 3159c: 24 3d cpi r18, 0xD4 ; 212 3159e: 31 05 cpc r19, r1 315a0: 91 f6 brne .-92 ; 0x31546 315a2: f2 cf rjmp .-28 ; 0x31588 315a4: 25 3f cpi r18, 0xF5 ; 245 315a6: 81 e0 ldi r24, 0x01 ; 1 315a8: 38 07 cpc r19, r24 315aa: 09 f4 brne .+2 ; 0x315ae 315ac: 5c c0 rjmp .+184 ; 0x31666 315ae: f8 f4 brcc .+62 ; 0x315ee 315b0: 26 34 cpi r18, 0x46 ; 70 315b2: 81 e0 ldi r24, 0x01 ; 1 315b4: 38 07 cpc r19, r24 315b6: 58 f4 brcc .+22 ; 0x315ce 315b8: 21 34 cpi r18, 0x41 ; 65 315ba: 81 e0 ldi r24, 0x01 ; 1 315bc: 38 07 cpc r19, r24 315be: 20 f7 brcc .-56 ; 0x31588 315c0: 27 53 subi r18, 0x37 ; 55 315c2: 31 40 sbci r19, 0x01 ; 1 315c4: 25 30 cpi r18, 0x05 ; 5 315c6: 31 05 cpc r19, r1 315c8: 08 f0 brcs .+2 ; 0x315cc 315ca: bd cf rjmp .-134 ; 0x31546 315cc: dd cf rjmp .-70 ; 0x31588 315ce: 21 59 subi r18, 0x91 ; 145 315d0: 31 40 sbci r19, 0x01 ; 1 315d2: 22 30 cpi r18, 0x02 ; 2 315d4: 31 05 cpc r19, r1 315d6: 08 f0 brcs .+2 ; 0x315da 315d8: b6 cf rjmp .-148 ; 0x31546 } break; case ERR_CONNECT_MMU_NOT_RESPONDING: case ERR_CONNECT_COMMUNICATION_ERROR: case ERR_SYSTEM_FW_UPDATE_NEEDED: switch (buttonSelectedOperation) { 315da: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> 315de: 83 30 cpi r24, 0x03 ; 3 315e0: 09 f4 brne .+2 ; 0x315e4 315e2: 3f c0 rjmp .+126 ; 0x31662 315e4: 89 30 cpi r24, 0x09 ; 9 315e6: 09 f0 breq .+2 ; 0x315ea 315e8: ae cf rjmp .-164 ; 0x31546 case ButtonOperations::DisableMMU: // "Disable" return Buttons::DisableMMU; 315ea: 87 e0 ldi r24, 0x07 ; 7 315ec: 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) ) { 315ee: 29 3f cpi r18, 0xF9 ; 249 315f0: 81 e0 ldi r24, 0x01 ; 1 315f2: 38 07 cpc r19, r24 315f4: 49 f2 breq .-110 ; 0x31588 315f6: 70 f4 brcc .+28 ; 0x31614 315f8: 27 3f cpi r18, 0xF7 ; 247 315fa: 81 e0 ldi r24, 0x01 ; 1 315fc: 38 07 cpc r19, r24 315fe: 21 f2 breq .-120 ; 0x31588 31600: 60 f7 brcc .-40 ; 0x315da break; } break; case ERR_SYSTEM_INVALID_TOOL: switch (buttonSelectedOperation) { 31602: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> 31606: 83 30 cpi r24, 0x03 ; 3 31608: 61 f1 breq .+88 ; 0x31662 3160a: 88 30 cpi r24, 0x08 ; 8 3160c: 09 f0 breq .+2 ; 0x31610 3160e: 9b cf rjmp .-202 ; 0x31546 case ButtonOperations::StopPrint: // "Stop print" return Buttons::StopPrint; 31610: 86 e0 ldi r24, 0x06 ; 6 31612: 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) ) { 31614: 2b 3f cpi r18, 0xFB ; 251 31616: 81 e0 ldi r24, 0x01 ; 1 31618: 38 07 cpc r19, r24 3161a: a9 f0 breq .+42 ; 0x31646 3161c: 68 f0 brcs .+26 ; 0x31638 3161e: 2c 3f cpi r18, 0xFC ; 252 31620: 31 40 sbci r19, 0x01 ; 1 31622: 09 f0 breq .+2 ; 0x31626 31624: 90 cf rjmp .-224 ; 0x31546 default: break; } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { 31626: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> 3162a: 85 30 cpi r24, 0x05 ; 5 3162c: 89 f0 breq .+34 ; 0x31650 3162e: 86 30 cpi r24, 0x06 ; 6 31630: 09 f0 breq .+2 ; 0x31634 31632: 89 cf rjmp .-238 ; 0x31546 case ButtonOperations::Load: return Buttons::Load; case ButtonOperations::Eject: return Buttons::Eject; 31634: 85 e0 ldi r24, 0x05 ; 5 31636: 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) { 31638: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> 3163c: 81 30 cpi r24, 0x01 ; 1 3163e: 09 f0 breq .+2 ; 0x31642 31640: 82 cf rjmp .-252 ; 0x31546 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; 31642: 81 e0 ldi r24, 0x01 ; 1 31644: 08 95 ret break; } break; case ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED: case ERR_SYSTEM_FILAMENT_EJECTED: switch (buttonSelectedOperation) { 31646: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> 3164a: 82 30 cpi r24, 0x02 ; 2 3164c: d1 f3 breq .-12 ; 0x31642 3164e: 7b cf rjmp .-266 ; 0x31546 } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { case ButtonOperations::Load: return Buttons::Load; 31650: 84 e0 ldi r24, 0x04 ; 4 31652: 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) { 31654: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> 31658: 82 30 cpi r24, 0x02 ; 2 3165a: 61 f0 breq .+24 ; 0x31674 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) { 3165c: 83 30 cpi r24, 0x03 ; 3 3165e: 09 f0 breq .+2 ; 0x31662 31660: 72 cf rjmp .-284 ; 0x31546 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; 31662: 83 e0 ldi r24, 0x03 ; 3 default: break; } return Buttons::NoButton; } 31664: 08 95 ret default: break; } break; case ERR_SYSTEM_FILAMENT_ALREADY_LOADED: switch (buttonSelectedOperation) { 31666: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.455> 3166a: 82 30 cpi r24, 0x02 ; 2 3166c: 29 f0 breq .+10 ; 0x31678 3166e: 84 30 cpi r24, 0x04 ; 4 31670: 09 f0 breq .+2 ; 0x31674 31672: 69 cf rjmp .-302 ; 0x31546 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; 31674: 82 e0 ldi r24, 0x02 ; 2 31676: 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; 31678: 80 e0 ldi r24, 0x00 ; 0 3167a: 08 95 ret 0003167c (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.356]>: #endif namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { 3167c: cf 93 push r28 3167e: df 93 push r29 31680: ec 01 movw r28, r24 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 31682: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 31686: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 3168a: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 3168e: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 31692: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 31696: 20 91 f1 11 lds r18, 0x11F1 ; 0x8011f1 3169a: 30 91 f2 11 lds r19, 0x11F2 ; 0x8011f2 3169e: c9 01 movw r24, r18 316a0: 86 1b sub r24, r22 316a2: 97 0b sbc r25, r23 316a4: 06 97 sbiw r24, 0x06 ; 6 316a6: 24 f0 brlt .+8 ; 0x316b0 (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); 316a8: ce 01 movw r24, r28 316aa: 0e 94 45 7c call 0xf88a ; 0xf88a 316ae: e9 cf rjmp .-46 ; 0x31682 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.356]+0x6> f(); safe_delay_keep_alive(delay); } } 316b0: df 91 pop r29 316b2: cf 91 pop r28 316b4: 08 95 ret 000316b6 : } //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) { 316b6: cf 93 push r28 316b8: df 93 push r29 316ba: 00 d0 rcall .+0 ; 0x316bc 316bc: 00 d0 rcall .+0 ; 0x316be 316be: 1f 92 push r1 316c0: cd b7 in r28, 0x3d ; 61 316c2: 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)) 316c4: 87 30 cpi r24, 0x07 ; 7 316c6: 50 f5 brcc .+84 ; 0x3171c 316c8: 67 30 cpi r22, 0x07 ; 7 316ca: 40 f5 brcc .+80 ; 0x3171c return false; uint8_t valid_points_mask[7] = { 316cc: 97 e0 ldi r25, 0x07 ; 7 316ce: ed eb ldi r30, 0xBD ; 189 316d0: f2 e0 ldi r31, 0x02 ; 2 316d2: de 01 movw r26, r28 316d4: 11 96 adiw r26, 0x01 ; 1 316d6: 01 90 ld r0, Z+ 316d8: 0d 92 st X+, r0 316da: 9a 95 dec r25 316dc: e1 f7 brne .-8 ; 0x316d6 0b1110111,//2 0b1111111,//1 0b1111111,//0 //[0,0] }; return (valid_points_mask[6 - iy] & (1 << (6 - ix))); 316de: 46 e0 ldi r20, 0x06 ; 6 316e0: 50 e0 ldi r21, 0x00 ; 0 316e2: fa 01 movw r30, r20 316e4: e6 1b sub r30, r22 316e6: f1 09 sbc r31, r1 316e8: 21 e0 ldi r18, 0x01 ; 1 316ea: 30 e0 ldi r19, 0x00 ; 0 316ec: 2c 0f add r18, r28 316ee: 3d 1f adc r19, r29 316f0: e2 0f add r30, r18 316f2: f3 1f adc r31, r19 316f4: 20 81 ld r18, Z 316f6: 30 e0 ldi r19, 0x00 ; 0 316f8: 48 1b sub r20, r24 316fa: 51 09 sbc r21, r1 316fc: c9 01 movw r24, r18 316fe: 02 c0 rjmp .+4 ; 0x31704 31700: 95 95 asr r25 31702: 87 95 ror r24 31704: 4a 95 dec r20 31706: e2 f7 brpl .-8 ; 0x31700 31708: 81 70 andi r24, 0x01 ; 1 } 3170a: 27 96 adiw r28, 0x07 ; 7 3170c: 0f b6 in r0, 0x3f ; 63 3170e: f8 94 cli 31710: de bf out 0x3e, r29 ; 62 31712: 0f be out 0x3f, r0 ; 63 31714: cd bf out 0x3d, r28 ; 61 31716: df 91 pop r29 31718: cf 91 pop r28 3171a: 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; 3171c: 80 e0 ldi r24, 0x00 ; 0 3171e: f5 cf rjmp .-22 ; 0x3170a 00031720 : #endif //NEW_XYZCAL // Shift a Z axis by a given delta. // To replace loading of the babystep correction. static void shift_z(float delta) { 31720: 0f 93 push r16 31722: 1f 93 push r17 31724: cf 93 push r28 31726: df 93 push r29 31728: 00 d0 rcall .+0 ; 0x3172a 3172a: 1f 92 push r1 3172c: cd b7 in r28, 0x3d ; 61 3172e: de b7 in r29, 0x3e ; 62 31730: 9b 01 movw r18, r22 31732: ac 01 movw r20, r24 const float curpos_z = current_position[Z_AXIS]; 31734: 05 ef ldi r16, 0xF5 ; 245 31736: 11 e1 ldi r17, 0x11 ; 17 31738: f8 01 movw r30, r16 3173a: 60 85 ldd r22, Z+8 ; 0x08 3173c: 71 85 ldd r23, Z+9 ; 0x09 3173e: 82 85 ldd r24, Z+10 ; 0x0a 31740: 93 85 ldd r25, Z+11 ; 0x0b 31742: 69 83 std Y+1, r22 ; 0x01 31744: 7a 83 std Y+2, r23 ; 0x02 31746: 8b 83 std Y+3, r24 ; 0x03 31748: 9c 83 std Y+4, r25 ; 0x04 current_position[Z_AXIS] -= delta; 3174a: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 3174e: f8 01 movw r30, r16 31750: 60 87 std Z+8, r22 ; 0x08 31752: 71 87 std Z+9, r23 ; 0x09 31754: 82 87 std Z+10, r24 ; 0x0a 31756: 93 87 std Z+11, r25 ; 0x0b plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 31758: 65 e5 ldi r22, 0x55 ; 85 3175a: 75 e5 ldi r23, 0x55 ; 85 3175c: 85 e5 ldi r24, 0x55 ; 85 3175e: 91 e4 ldi r25, 0x41 ; 65 31760: 0f 94 2f 85 call 0x30a5e ; 0x30a5e st_synchronize(); 31764: 0f 94 ce 22 call 0x2459c ; 0x2459c current_position[Z_AXIS] = curpos_z; 31768: 89 81 ldd r24, Y+1 ; 0x01 3176a: 9a 81 ldd r25, Y+2 ; 0x02 3176c: ab 81 ldd r26, Y+3 ; 0x03 3176e: bc 81 ldd r27, Y+4 ; 0x04 31770: f8 01 movw r30, r16 31772: 80 87 std Z+8, r24 ; 0x08 31774: 91 87 std Z+9, r25 ; 0x09 31776: a2 87 std Z+10, r26 ; 0x0a 31778: b3 87 std Z+11, r27 ; 0x0b plan_set_z_position(curpos_z); 3177a: ce 01 movw r24, r28 3177c: 01 96 adiw r24, 0x01 ; 1 3177e: 0f 94 ba 75 call 0x2eb74 ; 0x2eb74 } 31782: 0f 90 pop r0 31784: 0f 90 pop r0 31786: 0f 90 pop r0 31788: 0f 90 pop r0 3178a: df 91 pop r29 3178c: cf 91 pop r28 3178e: 1f 91 pop r17 31790: 0f 91 pop r16 31792: 08 95 ret 00031794 : 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])); 31794: 60 91 29 05 lds r22, 0x0529 ; 0x800529 <_ZL13babystepLoadZ.lto_priv.459> 31798: 70 91 2a 05 lds r23, 0x052A ; 0x80052a <_ZL13babystepLoadZ.lto_priv.459+0x1> 3179c: 07 2e mov r0, r23 3179e: 00 0c add r0, r0 317a0: 88 0b sbc r24, r24 317a2: 99 0b sbc r25, r25 317a4: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 317a8: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 317ac: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 317b0: 40 91 40 04 lds r20, 0x0440 ; 0x800440 317b4: 50 91 41 04 lds r21, 0x0441 ; 0x800441 317b8: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 317bc: 0f 94 90 8b call 0x31720 ; 0x31720 babystepLoadZ = 0; 317c0: 10 92 2a 05 sts 0x052A, r1 ; 0x80052a <_ZL13babystepLoadZ.lto_priv.459+0x1> 317c4: 10 92 29 05 sts 0x0529, r1 ; 0x800529 <_ZL13babystepLoadZ.lto_priv.459> } 317c8: 08 95 ret 000317ca : return sampled; } void go_home_with_z_lift() { 317ca: cf 93 push r28 317cc: df 93 push r29 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 317ce: 0e 94 bf 5f call 0xbf7e ; 0xbf7e // Go home. // First move up to a safe height. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 317d2: c5 ef ldi r28, 0xF5 ; 245 317d4: d1 e1 ldi r29, 0x11 ; 17 317d6: 80 e0 ldi r24, 0x00 ; 0 317d8: 90 e0 ldi r25, 0x00 ; 0 317da: a0 ea ldi r26, 0xA0 ; 160 317dc: b0 e4 ldi r27, 0x40 ; 64 317de: 88 87 std Y+8, r24 ; 0x08 317e0: 99 87 std Y+9, r25 ; 0x09 317e2: aa 87 std Y+10, r26 ; 0x0a 317e4: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 317e6: 65 e5 ldi r22, 0x55 ; 85 317e8: 75 e5 ldi r23, 0x55 ; 85 317ea: 85 e5 ldi r24, 0x55 ; 85 317ec: 91 e4 ldi r25, 0x41 ; 65 317ee: 0f 94 e1 87 call 0x30fc2 ; 0x30fc2 // Second move to XY [0, 0]. current_position[X_AXIS] = X_MIN_POS + 0.2; 317f2: 8d ec ldi r24, 0xCD ; 205 317f4: 9c ec ldi r25, 0xCC ; 204 317f6: ac e4 ldi r26, 0x4C ; 76 317f8: be e3 ldi r27, 0x3E ; 62 317fa: 88 83 st Y, r24 317fc: 99 83 std Y+1, r25 ; 0x01 317fe: aa 83 std Y+2, r26 ; 0x02 31800: bb 83 std Y+3, r27 ; 0x03 current_position[Y_AXIS] = Y_MIN_POS + 0.2; 31802: 83 e3 ldi r24, 0x33 ; 51 31804: 93 e3 ldi r25, 0x33 ; 51 31806: a3 e7 ldi r26, 0x73 ; 115 31808: b0 ec ldi r27, 0xC0 ; 192 3180a: 8c 83 std Y+4, r24 ; 0x04 3180c: 9d 83 std Y+5, r25 ; 0x05 3180e: ae 83 std Y+6, r26 ; 0x06 31810: bf 83 std Y+7, r27 ; 0x07 // Clamp to the physical coordinates. world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 31812: 69 ef ldi r22, 0xF9 ; 249 31814: 71 e1 ldi r23, 0x11 ; 17 31816: ce 01 movw r24, r28 31818: 0e 94 9c 63 call 0xc738 ; 0xc738 go_to_current((3 * homing_feedrate[X_AXIS]) / 60); 3181c: 60 e0 ldi r22, 0x00 ; 0 3181e: 70 e0 ldi r23, 0x00 ; 0 31820: 86 e1 ldi r24, 0x16 ; 22 31822: 93 e4 ldi r25, 0x43 ; 67 31824: 0f 94 e1 87 call 0x30fc2 ; 0x30fc2 // Third move up to a safe height. current_position[Z_AXIS] = Z_MIN_POS; 31828: 8a e9 ldi r24, 0x9A ; 154 3182a: 99 e9 ldi r25, 0x99 ; 153 3182c: a9 e1 ldi r26, 0x19 ; 25 3182e: be e3 ldi r27, 0x3E ; 62 31830: 88 87 std Y+8, r24 ; 0x08 31832: 99 87 std Y+9, r25 ; 0x09 31834: aa 87 std Y+10, r26 ; 0x0a 31836: bb 87 std Y+11, r27 ; 0x0b 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: df 91 pop r29 31842: 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); 31844: 0d 94 e1 87 jmp 0x30fc2 ; 0x30fc2 00031848 : #define MESH_BED_CALIBRATION_SHOW_LCD float __attribute__((noinline)) BED_X(const uint8_t col) { return ((float)col * x_mesh_density + BED_X0); 31848: 68 2f mov r22, r24 3184a: 70 e0 ldi r23, 0x00 ; 0 3184c: 90 e0 ldi r25, 0x00 ; 0 3184e: 80 e0 ldi r24, 0x00 ; 0 31850: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 31854: 20 e0 ldi r18, 0x00 ; 0 31856: 30 e0 ldi r19, 0x00 ; 0 31858: 48 e0 ldi r20, 0x08 ; 8 3185a: 52 e4 ldi r21, 0x42 ; 66 3185c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 31860: 20 e0 ldi r18, 0x00 ; 0 31862: 30 e0 ldi r19, 0x00 ; 0 31864: 40 e8 ldi r20, 0x80 ; 128 31866: 5f e3 ldi r21, 0x3F ; 63 31868: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> } 3186c: 08 95 ret 0003186e : // 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() { 3186e: 2f 92 push r2 31870: 3f 92 push r3 31872: 4f 92 push r4 31874: 5f 92 push r5 31876: 6f 92 push r6 31878: 7f 92 push r7 3187a: 8f 92 push r8 3187c: 9f 92 push r9 3187e: af 92 push r10 31880: bf 92 push r11 31882: cf 92 push r12 31884: df 92 push r13 31886: ef 92 push r14 31888: ff 92 push r15 3188a: 0f 93 push r16 3188c: 1f 93 push r17 3188e: cf 93 push r28 31890: df 93 push r29 31892: 00 d0 rcall .+0 ; 0x31894 31894: 00 d0 rcall .+0 ; 0x31896 31896: cd b7 in r28, 0x3d ; 61 31898: de b7 in r29, 0x3e ; 62 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 3189a: 80 91 77 02 lds r24, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.364> 3189e: 8c 83 std Y+4, r24 ; 0x04 check_endstops = check; 318a0: 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); 318a4: 80 e0 ldi r24, 0x00 ; 0 318a6: 0f 94 06 2d call 0x25a0c ; 0x25a0c 318aa: 8b 83 std Y+3, r24 ; 0x03 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 318ac: 0e 94 bf 5f call 0xbf7e ; 0xbf7e #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 318b0: 82 ed ldi r24, 0xD2 ; 210 318b2: 97 e4 ldi r25, 0x47 ; 71 318b4: 0e 94 a7 6c call 0xd94e ; 0xd94e 318b8: 0f 94 22 0b call 0x21644 ; 0x21644 // display "point xx of yy" lcd_puts_at_P(0,3,_n("1/9")); 318bc: 49 e3 ldi r20, 0x39 ; 57 318be: 5c e6 ldi r21, 0x6C ; 108 318c0: 63 e0 ldi r22, 0x03 ; 3 318c2: 80 e0 ldi r24, 0x00 ; 0 318c4: 0e 94 85 69 call 0xd30a ; 0xd30a 318c8: 81 e0 ldi r24, 0x01 ; 1 318ca: 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; 318ce: 80 e0 ldi r24, 0x00 ; 0 318d0: 90 e0 ldi r25, 0x00 ; 0 318d2: a0 ea ldi r26, 0xA0 ; 160 318d4: b0 e4 ldi r27, 0x40 ; 64 318d6: 80 93 fd 11 sts 0x11FD, r24 ; 0x8011fd 318da: 90 93 fe 11 sts 0x11FE, r25 ; 0x8011fe 318de: a0 93 ff 11 sts 0x11FF, r26 ; 0x8011ff 318e2: b0 93 00 12 sts 0x1200, r27 ; 0x801200 go_to_current(homing_feedrate[Z_AXIS]/60); 318e6: 65 e5 ldi r22, 0x55 ; 85 318e8: 75 e5 ldi r23, 0x55 ; 85 318ea: 85 e5 ldi r24, 0x55 ; 85 318ec: 91 e4 ldi r25, 0x41 ; 65 318ee: 0f 94 e1 87 call 0x30fc2 ; 0x30fc2 318f2: 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; 318f6: 80 e0 ldi r24, 0x00 ; 0 318f8: 90 e0 ldi r25, 0x00 ; 0 318fa: a0 e8 ldi r26, 0x80 ; 128 318fc: bf e3 ldi r27, 0x3F ; 63 318fe: 80 93 f5 11 sts 0x11F5, r24 ; 0x8011f5 31902: 90 93 f6 11 sts 0x11F6, r25 ; 0x8011f6 31906: a0 93 f7 11 sts 0x11F7, r26 ; 0x8011f7 3190a: b0 93 f8 11 sts 0x11F8, r27 ; 0x8011f8 current_position[Y_AXIS] = BED_Y0; 3190e: 80 93 f9 11 sts 0x11F9, r24 ; 0x8011f9 31912: 90 93 fa 11 sts 0x11FA, r25 ; 0x8011fa 31916: a0 93 fb 11 sts 0x11FB, r26 ; 0x8011fb 3191a: b0 93 fc 11 sts 0x11FC, r27 ; 0x8011fc world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 3191e: 69 ef ldi r22, 0xF9 ; 249 31920: 71 e1 ldi r23, 0x11 ; 17 31922: 85 ef ldi r24, 0xF5 ; 245 31924: 91 e1 ldi r25, 0x11 ; 17 31926: 0e 94 9c 63 call 0xc738 ; 0xc738 go_to_current(homing_feedrate[X_AXIS]/60); 3192a: 60 e0 ldi r22, 0x00 ; 0 3192c: 70 e0 ldi r23, 0x00 ; 0 3192e: 88 e4 ldi r24, 0x48 ; 72 31930: 92 e4 ldi r25, 0x42 ; 66 31932: 0f 94 e1 87 call 0x30fc2 ; 0x30fc2 set_destination_to_current(); 31936: 0e 94 2c 61 call 0xc258 ; 0xc258 homeaxis(Z_AXIS); 3193a: 82 e0 ldi r24, 0x02 ; 2 3193c: 0f 94 7b 54 call 0x2a8f6 ; 0x2a8f6 if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 31940: 43 e0 ldi r20, 0x03 ; 3 31942: 60 e0 ldi r22, 0x00 ; 0 31944: 70 e0 ldi r23, 0x00 ; 0 31946: 80 e2 ldi r24, 0x20 ; 32 31948: 91 ec ldi r25, 0xC1 ; 193 3194a: 0f 94 ba 56 call 0x2ad74 ; 0x2ad74 3194e: 81 11 cpse r24, r1 31950: 06 c0 rjmp .+12 ; 0x3195e 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)); 31952: 87 e2 ldi r24, 0x27 ; 39 31954: 92 e6 ldi r25, 0x62 ; 98 31956: 0e 94 a7 6c call 0xd94e ; 0xd94e 3195a: 0e 94 d5 72 call 0xe5aa ; 0xe5aa float get_z(float x, float y); void set_z(uint8_t ix, uint8_t iy, float z) { z_values[iy][ix] = z; } 3195e: 80 91 fd 11 lds r24, 0x11FD ; 0x8011fd 31962: 90 91 fe 11 lds r25, 0x11FE ; 0x8011fe 31966: a0 91 ff 11 lds r26, 0x11FF ; 0x8011ff 3196a: b0 91 00 12 lds r27, 0x1200 ; 0x801200 3196e: 80 93 9d 12 sts 0x129D, r24 ; 0x80129d 31972: 90 93 9e 12 sts 0x129E, r25 ; 0x80129e 31976: a0 93 9f 12 sts 0x129F, r26 ; 0x80129f 3197a: b0 93 a0 12 sts 0x12A0, r27 ; 0x8012a0 3197e: e2 e0 ldi r30, 0x02 ; 2 31980: f0 e0 ldi r31, 0x00 ; 0 31982: fa 83 std Y+2, r31 ; 0x02 31984: 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; 31986: c1 2c mov r12, r1 31988: d1 2c mov r13, r1 3198a: 30 ea ldi r19, 0xA0 ; 160 3198c: e3 2e mov r14, r19 3198e: 30 e4 ldi r19, 0x40 ; 64 31990: f3 2e mov r15, r19 go_to_current(homing_feedrate[Z_AXIS]/60); uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 31992: 43 e0 ldi r20, 0x03 ; 3 31994: 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 31996: 52 e0 ldi r21, 0x02 ; 2 31998: 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); 3199a: 0f e9 ldi r16, 0x9F ; 159 3199c: 1d e9 ldi r17, 0x9D ; 157 3199e: 67 e0 ldi r22, 0x07 ; 7 319a0: 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(); 319a2: 0e 94 bf 5f call 0xbf7e ; 0xbf7e // Print the decrasing ID of the measurement point. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 319a6: c0 92 fd 11 sts 0x11FD, r12 ; 0x8011fd 319aa: d0 92 fe 11 sts 0x11FE, r13 ; 0x8011fe 319ae: e0 92 ff 11 sts 0x11FF, r14 ; 0x8011ff 319b2: f0 92 00 12 sts 0x1200, r15 ; 0x801200 go_to_current(homing_feedrate[Z_AXIS]/60); 319b6: 65 e5 ldi r22, 0x55 ; 85 319b8: 75 e5 ldi r23, 0x55 ; 85 319ba: 85 e5 ldi r24, 0x55 ; 85 319bc: 91 e4 ldi r25, 0x41 ; 65 319be: 0f 94 e1 87 call 0x30fc2 ; 0x30fc2 uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 319c2: 29 81 ldd r18, Y+1 ; 0x01 319c4: 21 50 subi r18, 0x01 ; 1 319c6: 82 2f mov r24, r18 319c8: 6b 2d mov r22, r11 319ca: 0f 94 4a a1 call 0x34294 ; 0x34294 <__udivmodqi4> 319ce: 89 2e mov r8, r25 uint8_t iy = mesh_point / MESH_MEAS_NUM_X_POINTS; 319d0: 82 2f mov r24, r18 319d2: 0f 94 56 a1 call 0x342ac ; 0x342ac <__divmodqi4> 319d6: 78 2e mov r7, r24 if (iy & 1) ix = (MESH_MEAS_NUM_X_POINTS - 1) - ix; // Zig zag 319d8: 80 ff sbrs r24, 0 319da: 03 c0 rjmp .+6 ; 0x319e2 319dc: f9 2d mov r31, r9 319de: f8 19 sub r31, r8 319e0: 8f 2e mov r8, r31 current_position[X_AXIS] = BED_X(ix * 3); 319e2: 88 2d mov r24, r8 319e4: 88 0f add r24, r24 319e6: 88 0d add r24, r8 319e8: 0f 94 24 8c call 0x31848 ; 0x31848 319ec: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 319f0: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 319f4: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 319f8: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 current_position[Y_AXIS] = BED_Y(iy * 3); 319fc: 87 2d mov r24, r7 319fe: 88 0f add r24, r24 31a00: 87 0d add r24, r7 31a02: 0f 94 24 8c call 0x31848 ; 0x31848 31a06: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 31a0a: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 31a0e: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 31a12: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 31a16: 69 ef ldi r22, 0xF9 ; 249 31a18: 71 e1 ldi r23, 0x11 ; 17 31a1a: 85 ef ldi r24, 0xF5 ; 245 31a1c: 91 e1 ldi r25, 0x11 ; 17 31a1e: 0e 94 9c 63 call 0xc738 ; 0xc738 go_to_current(homing_feedrate[X_AXIS]/60); 31a22: 60 e0 ldi r22, 0x00 ; 0 31a24: 70 e0 ldi r23, 0x00 ; 0 31a26: 88 e4 ldi r24, 0x48 ; 72 31a28: 92 e4 ldi r25, 0x42 ; 66 31a2a: 0f 94 e1 87 call 0x30fc2 ; 0x30fc2 #ifdef MESH_BED_CALIBRATION_SHOW_LCD // display "point xx of yy" lcd_set_cursor(0, 3); 31a2e: 63 e0 ldi r22, 0x03 ; 3 31a30: 80 e0 ldi r24, 0x00 ; 0 31a32: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_printf_P(PSTR("%d/9"),mesh_point+1); 31a36: 8a 81 ldd r24, Y+2 ; 0x02 31a38: 8f 93 push r24 31a3a: 99 81 ldd r25, Y+1 ; 0x01 31a3c: 9f 93 push r25 31a3e: 1f 93 push r17 31a40: 0f 93 push r16 31a42: 0e 94 4a 69 call 0xd294 ; 0xd294 #endif /* MESH_BED_CALIBRATION_SHOW_LCD */ if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 31a46: 43 e0 ldi r20, 0x03 ; 3 31a48: 60 e0 ldi r22, 0x00 ; 0 31a4a: 70 e0 ldi r23, 0x00 ; 0 31a4c: 80 e2 ldi r24, 0x20 ; 32 31a4e: 91 ec ldi r25, 0xC1 ; 193 31a50: 0f 94 ba 56 call 0x2ad74 ; 0x2ad74 31a54: 58 2e mov r5, r24 31a56: 0f 90 pop r0 31a58: 0f 90 pop r0 31a5a: 0f 90 pop r0 31a5c: 0f 90 pop r0 31a5e: 88 23 and r24, r24 31a60: 09 f4 brne .+2 ; 0x31a64 31a62: 77 cf rjmp .-274 ; 0x31952 31a64: a7 9c mul r10, r7 31a66: f0 01 movw r30, r0 31a68: 11 24 eor r1, r1 31a6a: e8 0d add r30, r8 31a6c: f1 1d adc r31, r1 31a6e: ee 0f add r30, r30 31a70: ff 1f adc r31, r31 31a72: ee 0f add r30, r30 31a74: ff 1f adc r31, r31 31a76: e4 56 subi r30, 0x64 ; 100 31a78: fd 4e sbci r31, 0xED ; 237 31a7a: 80 91 fd 11 lds r24, 0x11FD ; 0x8011fd 31a7e: 90 91 fe 11 lds r25, 0x11FE ; 0x8011fe 31a82: a0 91 ff 11 lds r26, 0x11FF ; 0x8011ff 31a86: b0 91 00 12 lds r27, 0x1200 ; 0x801200 31a8a: 81 83 std Z+1, r24 ; 0x01 31a8c: 92 83 std Z+2, r25 ; 0x02 31a8e: a3 83 std Z+3, r26 ; 0x03 31a90: b4 83 std Z+4, r27 ; 0x04 31a92: e9 81 ldd r30, Y+1 ; 0x01 31a94: fa 81 ldd r31, Y+2 ; 0x02 31a96: 31 96 adiw r30, 0x01 ; 1 31a98: fa 83 std Y+2, r31 ; 0x02 31a9a: 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) { 31a9c: 3a 97 sbiw r30, 0x0a ; 10 31a9e: 09 f0 breq .+2 ; 0x31aa2 31aa0: 80 cf rjmp .-256 ; 0x319a2 mbl.set_z(ix, iy, current_position[Z_AXIS]); } { // Verify the span of the Z values. float zmin = mbl.z_values[0][0]; 31aa2: 60 90 9d 12 lds r6, 0x129D ; 0x80129d 31aa6: 70 90 9e 12 lds r7, 0x129E ; 0x80129e 31aaa: 80 90 9f 12 lds r8, 0x129F ; 0x80129f 31aae: 90 90 a0 12 lds r9, 0x12A0 ; 0x8012a0 float zmax = zmin; 31ab2: 46 2c mov r4, r6 31ab4: a7 2c mov r10, r7 31ab6: b8 2c mov r11, r8 31ab8: 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]; 31aba: 1e 82 std Y+6, r1 ; 0x06 31abc: 1d 82 std Y+5, r1 ; 0x05 31abe: 0c e9 ldi r16, 0x9C ; 156 31ac0: 12 e1 ldi r17, 0x12 ; 18 31ac2: 8d 81 ldd r24, Y+5 ; 0x05 31ac4: 9e 81 ldd r25, Y+6 ; 0x06 31ac6: 83 56 subi r24, 0x63 ; 99 31ac8: 9d 4e sbci r25, 0xED ; 237 31aca: 9a 83 std Y+2, r25 ; 0x02 31acc: 89 83 std Y+1, r24 ; 0x01 31ace: 93 e0 ldi r25, 0x03 ; 3 31ad0: 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]); 31ad2: e9 81 ldd r30, Y+1 ; 0x01 31ad4: fa 81 ldd r31, Y+2 ; 0x02 31ad6: c1 90 ld r12, Z+ 31ad8: d1 90 ld r13, Z+ 31ada: e1 90 ld r14, Z+ 31adc: f1 90 ld r15, Z+ 31ade: fa 83 std Y+2, r31 ; 0x02 31ae0: e9 83 std Y+1, r30 ; 0x01 31ae2: 93 01 movw r18, r6 31ae4: a4 01 movw r20, r8 31ae6: c7 01 movw r24, r14 31ae8: b6 01 movw r22, r12 31aea: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 31aee: 18 16 cp r1, r24 31af0: 14 f0 brlt .+4 ; 0x31af6 31af2: 36 01 movw r6, r12 31af4: 47 01 movw r8, r14 zmax = max(zmax, mbl.z_values[j][i]); 31af6: 24 2d mov r18, r4 31af8: 3a 2d mov r19, r10 31afa: 4b 2d mov r20, r11 31afc: 52 2d mov r21, r2 31afe: c7 01 movw r24, r14 31b00: b6 01 movw r22, r12 31b02: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 31b06: 87 fd sbrc r24, 7 31b08: 04 c0 rjmp .+8 ; 0x31b12 31b0a: 4c 2c mov r4, r12 31b0c: ad 2c mov r10, r13 31b0e: be 2c mov r11, r14 31b10: 2f 2c mov r2, r15 31b12: 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) { 31b14: 31 10 cpse r3, r1 31b16: dd cf rjmp .-70 ; 0x31ad2 31b18: 8d 81 ldd r24, Y+5 ; 0x05 31b1a: 9e 81 ldd r25, Y+6 ; 0x06 31b1c: 4c 96 adiw r24, 0x1c ; 28 31b1e: 9e 83 std Y+6, r25 ; 0x06 31b20: 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) 31b22: 84 35 cpi r24, 0x54 ; 84 31b24: 91 05 cpc r25, r1 31b26: 59 f6 brne .-106 ; 0x31abe 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) { 31b28: 93 01 movw r18, r6 31b2a: a4 01 movw r20, r8 31b2c: 64 2d mov r22, r4 31b2e: 7a 2d mov r23, r10 31b30: 8b 2d mov r24, r11 31b32: 92 2d mov r25, r2 31b34: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 31b38: 20 e0 ldi r18, 0x00 ; 0 31b3a: 30 e0 ldi r19, 0x00 ; 0 31b3c: 40 e4 ldi r20, 0x40 ; 64 31b3e: 50 e4 ldi r21, 0x40 ; 64 31b40: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 31b44: 18 16 cp r1, r24 31b46: 2c f5 brge .+74 ; 0x31b92 // 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!"); 31b48: 82 e8 ldi r24, 0x82 ; 130 31b4a: 9d e9 ldi r25, 0x9D ; 157 31b4c: 0e 94 49 72 call 0xe492 ; 0xe492 // 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; 31b50: 51 2c mov r5, r1 31b52: fc 81 ldd r31, Y+4 ; 0x04 31b54: 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); 31b58: 8b 81 ldd r24, Y+3 ; 0x03 31b5a: 0f 94 06 2d call 0x25a0c ; 0x25a0c #ifdef TMC2130 tmc2130_home_exit(); #endif return result; } 31b5e: 85 2d mov r24, r5 31b60: 26 96 adiw r28, 0x06 ; 6 31b62: 0f b6 in r0, 0x3f ; 63 31b64: f8 94 cli 31b66: de bf out 0x3e, r29 ; 62 31b68: 0f be out 0x3f, r0 ; 63 31b6a: cd bf out 0x3d, r28 ; 61 31b6c: df 91 pop r29 31b6e: cf 91 pop r28 31b70: 1f 91 pop r17 31b72: 0f 91 pop r16 31b74: ff 90 pop r15 31b76: ef 90 pop r14 31b78: df 90 pop r13 31b7a: cf 90 pop r12 31b7c: bf 90 pop r11 31b7e: af 90 pop r10 31b80: 9f 90 pop r9 31b82: 8f 90 pop r8 31b84: 7f 90 pop r7 31b86: 6f 90 pop r6 31b88: 5f 90 pop r5 31b8a: 4f 90 pop r4 31b8c: 3f 90 pop r3 31b8e: 2f 90 pop r2 31b90: 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) 31b92: 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; 31b94: 85 ec ldi r24, 0xC5 ; 197 31b96: e8 2e mov r14, r24 31b98: 8f e0 ldi r24, 0x0F ; 15 31b9a: f8 2e mov r15, r24 31b9c: 68 01 movw r12, r16 for (int8_t j = 0; j < 3; ++ j) for (int8_t i = 0; i < 3; ++ i) { 31b9e: 1d 82 std Y+5, r1 ; 0x05 if (i == 0 && j == 0) 31ba0: 9d 81 ldd r25, Y+5 ; 0x05 31ba2: 91 11 cpse r25, r1 31ba4: 03 c0 rjmp .+6 ; 0x31bac 31ba6: e9 81 ldd r30, Y+1 ; 0x01 31ba8: ee 23 and r30, r30 31baa: 29 f1 breq .+74 ; 0x31bf6 continue; float dif = mbl.z_values[j][i] - mbl.z_values[0][0]; 31bac: 20 91 9d 12 lds r18, 0x129D ; 0x80129d 31bb0: 30 91 9e 12 lds r19, 0x129E ; 0x80129e 31bb4: 40 91 9f 12 lds r20, 0x129F ; 0x80129f 31bb8: 50 91 a0 12 lds r21, 0x12A0 ; 0x8012a0 31bbc: f6 01 movw r30, r12 31bbe: 61 81 ldd r22, Z+1 ; 0x01 31bc0: 72 81 ldd r23, Z+2 ; 0x02 31bc2: 83 81 ldd r24, Z+3 ; 0x03 31bc4: 94 81 ldd r25, Z+4 ; 0x04 31bc6: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> int16_t dif_quantized = int16_t(floor(dif * 100.f + 0.5f)); 31bca: 20 e0 ldi r18, 0x00 ; 0 31bcc: 30 e0 ldi r19, 0x00 ; 0 31bce: 48 ec ldi r20, 0xC8 ; 200 31bd0: 52 e4 ldi r21, 0x42 ; 66 31bd2: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 31bd6: 20 e0 ldi r18, 0x00 ; 0 31bd8: 30 e0 ldi r19, 0x00 ; 0 31bda: 40 e0 ldi r20, 0x00 ; 0 31bdc: 5f e3 ldi r21, 0x3F ; 63 31bde: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 31be2: 0f 94 6a a3 call 0x346d4 ; 0x346d4 31be6: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 31bea: c7 01 movw r24, r14 31bec: 0f 94 dd a0 call 0x341ba ; 0x341ba SERIAL_ECHOPGM(", read: "); MYSERIAL.print(dif2, 5); SERIAL_ECHOLNPGM(""); } #endif addr += 2; 31bf0: f2 e0 ldi r31, 0x02 ; 2 31bf2: ef 0e add r14, r31 31bf4: f1 1c adc r15, r1 31bf6: 84 e0 ldi r24, 0x04 ; 4 31bf8: c8 0e add r12, r24 31bfa: d1 1c adc r13, r1 31bfc: 9d 81 ldd r25, Y+5 ; 0x05 31bfe: 9f 5f subi r25, 0xFF ; 255 31c00: 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) { 31c02: 93 30 cpi r25, 0x03 ; 3 31c04: 69 f6 brne .-102 ; 0x31ba0 31c06: 04 5e subi r16, 0xE4 ; 228 31c08: 1f 4f sbci r17, 0xFF ; 255 31c0a: e9 81 ldd r30, Y+1 ; 0x01 31c0c: ef 5f subi r30, 0xFF ; 255 31c0e: 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) 31c10: e3 30 cpi r30, 0x03 ; 3 31c12: 21 f6 brne .-120 ; 0x31b9c #endif addr += 2; } } mbl.reset(); 31c14: 0f 94 b0 56 call 0x2ad60 ; 0x2ad60 go_home_with_z_lift(); 31c18: 0f 94 e5 8b call 0x317ca ; 0x317ca 31c1c: 9a cf rjmp .-204 ; 0x31b52 00031c1e : plan_set_position_curposXYZE(); } static inline void update_current_position_z() { current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 31c1e: 82 e0 ldi r24, 0x02 ; 2 31c20: 0f 94 ba 22 call 0x24574 ; 0x24574 31c24: 60 93 fd 11 sts 0x11FD, r22 ; 0x8011fd 31c28: 70 93 fe 11 sts 0x11FE, r23 ; 0x8011fe 31c2c: 80 93 ff 11 sts 0x11FF, r24 ; 0x8011ff 31c30: 90 93 00 12 sts 0x1200, r25 ; 0x801200 plan_set_z_position(current_position[Z_AXIS]); 31c34: 8d ef ldi r24, 0xFD ; 253 31c36: 91 e1 ldi r25, 0x11 ; 17 31c38: 0d 94 ba 75 jmp 0x2eb74 ; 0x2eb74 00031c3c : * 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() { 31c3c: 4f 92 push r4 31c3e: 5f 92 push r5 31c40: 6f 92 push r6 31c42: 7f 92 push r7 31c44: 8f 92 push r8 31c46: 9f 92 push r9 31c48: af 92 push r10 31c4a: bf 92 push r11 31c4c: cf 92 push r12 31c4e: df 92 push r13 31c50: ef 92 push r14 31c52: ff 92 push r15 31c54: 0f 93 push r16 31c56: 1f 93 push r17 31c58: cf 93 push r28 31c5a: df 93 push r29 float x = current_position[X_AXIS] - world2machine_shift[0]; 31c5c: 05 ef ldi r16, 0xF5 ; 245 31c5e: 11 e1 ldi r17, 0x11 ; 17 31c60: c4 ed ldi r28, 0xD4 ; 212 31c62: d6 e1 ldi r29, 0x16 ; 22 31c64: 28 81 ld r18, Y 31c66: 39 81 ldd r19, Y+1 ; 0x01 31c68: 4a 81 ldd r20, Y+2 ; 0x02 31c6a: 5b 81 ldd r21, Y+3 ; 0x03 31c6c: f8 01 movw r30, r16 31c6e: 60 81 ld r22, Z 31c70: 71 81 ldd r23, Z+1 ; 0x01 31c72: 82 81 ldd r24, Z+2 ; 0x02 31c74: 93 81 ldd r25, Z+3 ; 0x03 31c76: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 31c7a: 4b 01 movw r8, r22 31c7c: 5c 01 movw r10, r24 float y = current_position[Y_AXIS] - world2machine_shift[1]; 31c7e: 2c 81 ldd r18, Y+4 ; 0x04 31c80: 3d 81 ldd r19, Y+5 ; 0x05 31c82: 4e 81 ldd r20, Y+6 ; 0x06 31c84: 5f 81 ldd r21, Y+7 ; 0x07 31c86: f8 01 movw r30, r16 31c88: 64 81 ldd r22, Z+4 ; 0x04 31c8a: 75 81 ldd r23, Z+5 ; 0x05 31c8c: 86 81 ldd r24, Z+6 ; 0x06 31c8e: 97 81 ldd r25, Z+7 ; 0x07 31c90: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 31c94: 6b 01 movw r12, r22 31c96: 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; 31c98: c4 ec ldi r28, 0xC4 ; 196 31c9a: d6 e1 ldi r29, 0x16 ; 22 31c9c: 28 81 ld r18, Y 31c9e: 39 81 ldd r19, Y+1 ; 0x01 31ca0: 4a 81 ldd r20, Y+2 ; 0x02 31ca2: 5b 81 ldd r21, Y+3 ; 0x03 31ca4: c5 01 movw r24, r10 31ca6: b4 01 movw r22, r8 31ca8: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 31cac: 2b 01 movw r4, r22 31cae: 3c 01 movw r6, r24 31cb0: 2c 81 ldd r18, Y+4 ; 0x04 31cb2: 3d 81 ldd r19, Y+5 ; 0x05 31cb4: 4e 81 ldd r20, Y+6 ; 0x06 31cb6: 5f 81 ldd r21, Y+7 ; 0x07 31cb8: c7 01 movw r24, r14 31cba: b6 01 movw r22, r12 31cbc: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 31cc0: 9b 01 movw r18, r22 31cc2: ac 01 movw r20, r24 31cc4: c3 01 movw r24, r6 31cc6: b2 01 movw r22, r4 31cc8: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 31ccc: f8 01 movw r30, r16 31cce: 60 83 st Z, r22 31cd0: 71 83 std Z+1, r23 ; 0x01 31cd2: 82 83 std Z+2, r24 ; 0x02 31cd4: 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; 31cd6: 28 85 ldd r18, Y+8 ; 0x08 31cd8: 39 85 ldd r19, Y+9 ; 0x09 31cda: 4a 85 ldd r20, Y+10 ; 0x0a 31cdc: 5b 85 ldd r21, Y+11 ; 0x0b 31cde: c5 01 movw r24, r10 31ce0: b4 01 movw r22, r8 31ce2: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 31ce6: 4b 01 movw r8, r22 31ce8: 5c 01 movw r10, r24 31cea: 2c 85 ldd r18, Y+12 ; 0x0c 31cec: 3d 85 ldd r19, Y+13 ; 0x0d 31cee: 4e 85 ldd r20, Y+14 ; 0x0e 31cf0: 5f 85 ldd r21, Y+15 ; 0x0f 31cf2: c7 01 movw r24, r14 31cf4: b6 01 movw r22, r12 31cf6: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 31cfa: 9b 01 movw r18, r22 31cfc: ac 01 movw r20, r24 31cfe: c5 01 movw r24, r10 31d00: b4 01 movw r22, r8 31d02: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 31d06: f8 01 movw r30, r16 31d08: 64 83 std Z+4, r22 ; 0x04 31d0a: 75 83 std Z+5, r23 ; 0x05 31d0c: 86 83 std Z+6, r24 ; 0x06 31d0e: 97 83 std Z+7, r25 ; 0x07 } 31d10: df 91 pop r29 31d12: cf 91 pop r28 31d14: 1f 91 pop r17 31d16: 0f 91 pop r16 31d18: ff 90 pop r15 31d1a: ef 90 pop r14 31d1c: df 90 pop r13 31d1e: cf 90 pop r12 31d20: bf 90 pop r11 31d22: af 90 pop r10 31d24: 9f 90 pop r9 31d26: 8f 90 pop r8 31d28: 7f 90 pop r7 31d2a: 6f 90 pop r6 31d2c: 5f 90 pop r5 31d2e: 4f 90 pop r4 31d30: 08 95 ret 00031d32 : } return false; } static void world2machine_update(const float vec_x[2], const float vec_y[2], const float cntr[2]) { 31d32: 4f 92 push r4 31d34: 5f 92 push r5 31d36: 6f 92 push r6 31d38: 7f 92 push r7 31d3a: 8f 92 push r8 31d3c: 9f 92 push r9 31d3e: af 92 push r10 31d40: bf 92 push r11 31d42: cf 92 push r12 31d44: df 92 push r13 31d46: ef 92 push r14 31d48: ff 92 push r15 31d4a: 0f 93 push r16 31d4c: 1f 93 push r17 31d4e: cf 93 push r28 31d50: df 93 push r29 31d52: 00 d0 rcall .+0 ; 0x31d54 31d54: 00 d0 rcall .+0 ; 0x31d56 31d56: 1f 92 push r1 31d58: 1f 92 push r1 31d5a: cd b7 in r28, 0x3d ; 61 31d5c: de b7 in r29, 0x3e ; 62 world2machine_rotation_and_skew[0][0] = vec_x[0]; 31d5e: dc 01 movw r26, r24 31d60: cd 90 ld r12, X+ 31d62: dd 90 ld r13, X+ 31d64: ed 90 ld r14, X+ 31d66: fc 90 ld r15, X 31d68: 13 97 sbiw r26, 0x03 ; 3 31d6a: c0 92 a9 16 sts 0x16A9, r12 ; 0x8016a9 31d6e: d0 92 aa 16 sts 0x16AA, r13 ; 0x8016aa 31d72: e0 92 ab 16 sts 0x16AB, r14 ; 0x8016ab 31d76: f0 92 ac 16 sts 0x16AC, r15 ; 0x8016ac world2machine_rotation_and_skew[1][0] = vec_x[1]; 31d7a: 14 96 adiw r26, 0x04 ; 4 31d7c: 0d 91 ld r16, X+ 31d7e: 1d 91 ld r17, X+ 31d80: 2d 91 ld r18, X+ 31d82: 3c 91 ld r19, X 31d84: 17 97 sbiw r26, 0x07 ; 7 31d86: 09 83 std Y+1, r16 ; 0x01 31d88: 1a 83 std Y+2, r17 ; 0x02 31d8a: 2b 83 std Y+3, r18 ; 0x03 31d8c: 3c 83 std Y+4, r19 ; 0x04 31d8e: 00 93 b1 16 sts 0x16B1, r16 ; 0x8016b1 31d92: 10 93 b2 16 sts 0x16B2, r17 ; 0x8016b2 31d96: 20 93 b3 16 sts 0x16B3, r18 ; 0x8016b3 31d9a: 30 93 b4 16 sts 0x16B4, r19 ; 0x8016b4 world2machine_rotation_and_skew[0][1] = vec_y[0]; 31d9e: db 01 movw r26, r22 31da0: 0d 91 ld r16, X+ 31da2: 1d 91 ld r17, X+ 31da4: 2d 91 ld r18, X+ 31da6: 3c 91 ld r19, X 31da8: 13 97 sbiw r26, 0x03 ; 3 31daa: 0d 83 std Y+5, r16 ; 0x05 31dac: 1e 83 std Y+6, r17 ; 0x06 31dae: 2f 83 std Y+7, r18 ; 0x07 31db0: 38 87 std Y+8, r19 ; 0x08 31db2: 00 93 ad 16 sts 0x16AD, r16 ; 0x8016ad 31db6: 10 93 ae 16 sts 0x16AE, r17 ; 0x8016ae 31dba: 20 93 af 16 sts 0x16AF, r18 ; 0x8016af 31dbe: 30 93 b0 16 sts 0x16B0, r19 ; 0x8016b0 world2machine_rotation_and_skew[1][1] = vec_y[1]; 31dc2: 14 96 adiw r26, 0x04 ; 4 31dc4: 4d 90 ld r4, X+ 31dc6: 5d 90 ld r5, X+ 31dc8: 6d 90 ld r6, X+ 31dca: 7c 90 ld r7, X 31dcc: 17 97 sbiw r26, 0x07 ; 7 31dce: 40 92 b5 16 sts 0x16B5, r4 ; 0x8016b5 31dd2: 50 92 b6 16 sts 0x16B6, r5 ; 0x8016b6 31dd6: 60 92 b7 16 sts 0x16B7, r6 ; 0x8016b7 31dda: 70 92 b8 16 sts 0x16B8, r7 ; 0x8016b8 world2machine_shift[0] = cntr[0]; 31dde: fa 01 movw r30, r20 31de0: 60 81 ld r22, Z 31de2: 71 81 ldd r23, Z+1 ; 0x01 31de4: 82 81 ldd r24, Z+2 ; 0x02 31de6: 93 81 ldd r25, Z+3 ; 0x03 31de8: 60 93 d4 16 sts 0x16D4, r22 ; 0x8016d4 31dec: 70 93 d5 16 sts 0x16D5, r23 ; 0x8016d5 31df0: 80 93 d6 16 sts 0x16D6, r24 ; 0x8016d6 31df4: 90 93 d7 16 sts 0x16D7, r25 ; 0x8016d7 world2machine_shift[1] = cntr[1]; 31df8: 84 80 ldd r8, Z+4 ; 0x04 31dfa: 95 80 ldd r9, Z+5 ; 0x05 31dfc: a6 80 ldd r10, Z+6 ; 0x06 31dfe: b7 80 ldd r11, Z+7 ; 0x07 31e00: 80 92 d8 16 sts 0x16D8, r8 ; 0x8016d8 31e04: 90 92 d9 16 sts 0x16D9, r9 ; 0x8016d9 31e08: a0 92 da 16 sts 0x16DA, r10 ; 0x8016da 31e0c: 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) 31e10: 20 e0 ldi r18, 0x00 ; 0 31e12: 30 e0 ldi r19, 0x00 ; 0 31e14: a9 01 movw r20, r18 31e16: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 31e1a: 81 11 cpse r24, r1 31e1c: aa c0 rjmp .+340 ; 0x31f72 31e1e: 20 e0 ldi r18, 0x00 ; 0 31e20: 30 e0 ldi r19, 0x00 ; 0 31e22: a9 01 movw r20, r18 31e24: c5 01 movw r24, r10 31e26: b4 01 movw r22, r8 31e28: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 31e2c: 81 11 cpse r24, r1 31e2e: a1 c0 rjmp .+322 ; 0x31f72 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; 31e30: 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 || 31e34: 20 e0 ldi r18, 0x00 ; 0 31e36: 30 e0 ldi r19, 0x00 ; 0 31e38: 40 e8 ldi r20, 0x80 ; 128 31e3a: 5f e3 ldi r21, 0x3F ; 63 31e3c: c7 01 movw r24, r14 31e3e: b6 01 movw r22, r12 31e40: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 31e44: 81 11 cpse r24, r1 31e46: 21 c0 rjmp .+66 ; 0x31e8a 31e48: 20 e0 ldi r18, 0x00 ; 0 31e4a: 30 e0 ldi r19, 0x00 ; 0 31e4c: a9 01 movw r20, r18 31e4e: 6d 81 ldd r22, Y+5 ; 0x05 31e50: 7e 81 ldd r23, Y+6 ; 0x06 31e52: 8f 81 ldd r24, Y+7 ; 0x07 31e54: 98 85 ldd r25, Y+8 ; 0x08 31e56: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 31e5a: 81 11 cpse r24, r1 31e5c: 16 c0 rjmp .+44 ; 0x31e8a 31e5e: 20 e0 ldi r18, 0x00 ; 0 31e60: 30 e0 ldi r19, 0x00 ; 0 31e62: a9 01 movw r20, r18 31e64: 69 81 ldd r22, Y+1 ; 0x01 31e66: 7a 81 ldd r23, Y+2 ; 0x02 31e68: 8b 81 ldd r24, Y+3 ; 0x03 31e6a: 9c 81 ldd r25, Y+4 ; 0x04 31e6c: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 31e70: 81 11 cpse r24, r1 31e72: 0b c0 rjmp .+22 ; 0x31e8a world2machine_rotation_and_skew[1][0] != 0.f || world2machine_rotation_and_skew[1][1] != 1.f) { 31e74: 20 e0 ldi r18, 0x00 ; 0 31e76: 30 e0 ldi r19, 0x00 ; 0 31e78: 40 e8 ldi r20, 0x80 ; 128 31e7a: 5f e3 ldi r21, 0x3F ; 63 31e7c: c3 01 movw r24, r6 31e7e: b2 01 movw r22, r4 31e80: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 31e84: 88 23 and r24, r24 31e86: 09 f4 brne .+2 ; 0x31e8a 31e88: 78 c0 rjmp .+240 ; 0x31f7a // Rotation & skew correction. world2machine_correction_mode |= WORLD2MACHINE_CORRECTION_SKEW; 31e8a: 80 91 dc 16 lds r24, 0x16DC ; 0x8016dc 31e8e: 82 60 ori r24, 0x02 ; 2 31e90: 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]; 31e94: a3 01 movw r20, r6 31e96: 92 01 movw r18, r4 31e98: c7 01 movw r24, r14 31e9a: b6 01 movw r22, r12 31e9c: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 31ea0: 4b 01 movw r8, r22 31ea2: 5c 01 movw r10, r24 31ea4: 2d 81 ldd r18, Y+5 ; 0x05 31ea6: 3e 81 ldd r19, Y+6 ; 0x06 31ea8: 4f 81 ldd r20, Y+7 ; 0x07 31eaa: 58 85 ldd r21, Y+8 ; 0x08 31eac: 69 81 ldd r22, Y+1 ; 0x01 31eae: 7a 81 ldd r23, Y+2 ; 0x02 31eb0: 8b 81 ldd r24, Y+3 ; 0x03 31eb2: 9c 81 ldd r25, Y+4 ; 0x04 31eb4: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 31eb8: 9b 01 movw r18, r22 31eba: ac 01 movw r20, r24 31ebc: c5 01 movw r24, r10 31ebe: b4 01 movw r22, r8 31ec0: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 31ec4: 4b 01 movw r8, r22 31ec6: 5c 01 movw r10, r24 world2machine_rotation_and_skew_inv[0][0] = world2machine_rotation_and_skew[1][1] / d; 31ec8: ac 01 movw r20, r24 31eca: 9b 01 movw r18, r22 31ecc: c3 01 movw r24, r6 31ece: b2 01 movw r22, r4 31ed0: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 31ed4: 60 93 c4 16 sts 0x16C4, r22 ; 0x8016c4 31ed8: 70 93 c5 16 sts 0x16C5, r23 ; 0x8016c5 31edc: 80 93 c6 16 sts 0x16C6, r24 ; 0x8016c6 31ee0: 90 93 c7 16 sts 0x16C7, r25 ; 0x8016c7 world2machine_rotation_and_skew_inv[0][1] = -world2machine_rotation_and_skew[0][1] / d; 31ee4: 6d 81 ldd r22, Y+5 ; 0x05 31ee6: 7e 81 ldd r23, Y+6 ; 0x06 31ee8: 8f 81 ldd r24, Y+7 ; 0x07 31eea: 98 85 ldd r25, Y+8 ; 0x08 31eec: 90 58 subi r25, 0x80 ; 128 31eee: a5 01 movw r20, r10 31ef0: 94 01 movw r18, r8 31ef2: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 31ef6: 60 93 c8 16 sts 0x16C8, r22 ; 0x8016c8 31efa: 70 93 c9 16 sts 0x16C9, r23 ; 0x8016c9 31efe: 80 93 ca 16 sts 0x16CA, r24 ; 0x8016ca 31f02: 90 93 cb 16 sts 0x16CB, r25 ; 0x8016cb world2machine_rotation_and_skew_inv[1][0] = -world2machine_rotation_and_skew[1][0] / d; 31f06: 69 81 ldd r22, Y+1 ; 0x01 31f08: 7a 81 ldd r23, Y+2 ; 0x02 31f0a: 8b 81 ldd r24, Y+3 ; 0x03 31f0c: 9c 81 ldd r25, Y+4 ; 0x04 31f0e: 90 58 subi r25, 0x80 ; 128 31f10: a5 01 movw r20, r10 31f12: 94 01 movw r18, r8 31f14: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 31f18: 60 93 cc 16 sts 0x16CC, r22 ; 0x8016cc 31f1c: 70 93 cd 16 sts 0x16CD, r23 ; 0x8016cd 31f20: 80 93 ce 16 sts 0x16CE, r24 ; 0x8016ce 31f24: 90 93 cf 16 sts 0x16CF, r25 ; 0x8016cf world2machine_rotation_and_skew_inv[1][1] = world2machine_rotation_and_skew[0][0] / d; 31f28: a5 01 movw r20, r10 31f2a: 94 01 movw r18, r8 31f2c: c7 01 movw r24, r14 31f2e: b6 01 movw r22, r12 31f30: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__divsf3> 31f34: 60 93 d0 16 sts 0x16D0, r22 ; 0x8016d0 31f38: 70 93 d1 16 sts 0x16D1, r23 ; 0x8016d1 31f3c: 80 93 d2 16 sts 0x16D2, r24 ; 0x8016d2 31f40: 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; } } 31f44: 28 96 adiw r28, 0x08 ; 8 31f46: 0f b6 in r0, 0x3f ; 63 31f48: f8 94 cli 31f4a: de bf out 0x3e, r29 ; 62 31f4c: 0f be out 0x3f, r0 ; 63 31f4e: cd bf out 0x3d, r28 ; 61 31f50: df 91 pop r29 31f52: cf 91 pop r28 31f54: 1f 91 pop r17 31f56: 0f 91 pop r16 31f58: ff 90 pop r15 31f5a: ef 90 pop r14 31f5c: df 90 pop r13 31f5e: cf 90 pop r12 31f60: bf 90 pop r11 31f62: af 90 pop r10 31f64: 9f 90 pop r9 31f66: 8f 90 pop r8 31f68: 7f 90 pop r7 31f6a: 6f 90 pop r6 31f6c: 5f 90 pop r5 31f6e: 4f 90 pop r4 31f70: 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; 31f72: 81 e0 ldi r24, 0x01 ; 1 31f74: 80 93 dc 16 sts 0x16DC, r24 ; 0x8016dc 31f78: 5d cf rjmp .-326 ; 0x31e34 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; 31f7a: 80 e0 ldi r24, 0x00 ; 0 31f7c: 90 e0 ldi r25, 0x00 ; 0 31f7e: a0 e8 ldi r26, 0x80 ; 128 31f80: bf e3 ldi r27, 0x3F ; 63 31f82: 80 93 c4 16 sts 0x16C4, r24 ; 0x8016c4 31f86: 90 93 c5 16 sts 0x16C5, r25 ; 0x8016c5 31f8a: a0 93 c6 16 sts 0x16C6, r26 ; 0x8016c6 31f8e: b0 93 c7 16 sts 0x16C7, r27 ; 0x8016c7 world2machine_rotation_and_skew_inv[0][1] = 0.f; 31f92: 10 92 c8 16 sts 0x16C8, r1 ; 0x8016c8 31f96: 10 92 c9 16 sts 0x16C9, r1 ; 0x8016c9 31f9a: 10 92 ca 16 sts 0x16CA, r1 ; 0x8016ca 31f9e: 10 92 cb 16 sts 0x16CB, r1 ; 0x8016cb world2machine_rotation_and_skew_inv[1][0] = 0.f; 31fa2: 10 92 cc 16 sts 0x16CC, r1 ; 0x8016cc 31fa6: 10 92 cd 16 sts 0x16CD, r1 ; 0x8016cd 31faa: 10 92 ce 16 sts 0x16CE, r1 ; 0x8016ce 31fae: 10 92 cf 16 sts 0x16CF, r1 ; 0x8016cf world2machine_rotation_and_skew_inv[1][1] = 1.f; 31fb2: 80 93 d0 16 sts 0x16D0, r24 ; 0x8016d0 31fb6: 90 93 d1 16 sts 0x16D1, r25 ; 0x8016d1 31fba: a0 93 d2 16 sts 0x16D2, r26 ; 0x8016d2 31fbe: b0 93 d3 16 sts 0x16D3, r27 ; 0x8016d3 31fc2: c0 cf rjmp .-128 ; 0x31f44 00031fc4 : * * 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() { 31fc4: cf 93 push r28 31fc6: df 93 push r29 31fc8: cd b7 in r28, 0x3d ; 61 31fca: de b7 in r29, 0x3e ; 62 31fcc: 68 97 sbiw r28, 0x18 ; 24 31fce: 0f b6 in r0, 0x3f ; 63 31fd0: f8 94 cli 31fd2: de bf out 0x3e, r29 ; 62 31fd4: 0f be out 0x3f, r0 ; 63 31fd6: cd bf out 0x3d, r28 ; 61 const float vx[] = { 1.f, 0.f }; 31fd8: 80 e0 ldi r24, 0x00 ; 0 31fda: 90 e0 ldi r25, 0x00 ; 0 31fdc: a0 e8 ldi r26, 0x80 ; 128 31fde: bf e3 ldi r27, 0x3F ; 63 31fe0: 89 83 std Y+1, r24 ; 0x01 31fe2: 9a 83 std Y+2, r25 ; 0x02 31fe4: ab 83 std Y+3, r26 ; 0x03 31fe6: bc 83 std Y+4, r27 ; 0x04 31fe8: 1d 82 std Y+5, r1 ; 0x05 31fea: 1e 82 std Y+6, r1 ; 0x06 31fec: 1f 82 std Y+7, r1 ; 0x07 31fee: 18 86 std Y+8, r1 ; 0x08 const float vy[] = { 0.f, 1.f }; 31ff0: 19 86 std Y+9, r1 ; 0x09 31ff2: 1a 86 std Y+10, r1 ; 0x0a 31ff4: 1b 86 std Y+11, r1 ; 0x0b 31ff6: 1c 86 std Y+12, r1 ; 0x0c 31ff8: 8d 87 std Y+13, r24 ; 0x0d 31ffa: 9e 87 std Y+14, r25 ; 0x0e 31ffc: af 87 std Y+15, r26 ; 0x0f 31ffe: b8 8b std Y+16, r27 ; 0x10 const float cntr[] = { 0.f, 0.f }; 32000: 19 8a std Y+17, r1 ; 0x11 32002: 1a 8a std Y+18, r1 ; 0x12 32004: 1b 8a std Y+19, r1 ; 0x13 32006: 1c 8a std Y+20, r1 ; 0x14 32008: 1d 8a std Y+21, r1 ; 0x15 3200a: 1e 8a std Y+22, r1 ; 0x16 3200c: 1f 8a std Y+23, r1 ; 0x17 3200e: 18 8e std Y+24, r1 ; 0x18 world2machine_update(vx, vy, cntr); 32010: ae 01 movw r20, r28 32012: 4f 5e subi r20, 0xEF ; 239 32014: 5f 4f sbci r21, 0xFF ; 255 32016: be 01 movw r22, r28 32018: 67 5f subi r22, 0xF7 ; 247 3201a: 7f 4f sbci r23, 0xFF ; 255 3201c: ce 01 movw r24, r28 3201e: 01 96 adiw r24, 0x01 ; 1 32020: 0f 94 99 8e call 0x31d32 ; 0x31d32 } 32024: 68 96 adiw r28, 0x18 ; 24 32026: 0f b6 in r0, 0x3f ; 63 32028: f8 94 cli 3202a: de bf out 0x3e, r29 ; 62 3202c: 0f be out 0x3f, r0 ; 63 3202e: cd bf out 0x3d, r28 ; 61 32030: df 91 pop r29 32032: cf 91 pop r28 32034: 08 95 ret 00032036 : * * 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) { 32036: 80 91 dc 16 lds r24, 0x16DC ; 0x8016dc 3203a: 88 23 and r24, r24 3203c: d1 f0 breq .+52 ; 0x32072 world2machine_reset(); 3203e: 0f 94 e2 8f call 0x31fc4 ; 0x31fc4 st_synchronize(); 32042: 0f 94 ce 22 call 0x2459c ; 0x2459c current_position[X_AXIS] = st_get_position_mm(X_AXIS); 32046: 80 e0 ldi r24, 0x00 ; 0 32048: 0f 94 ba 22 call 0x24574 ; 0x24574 3204c: 60 93 f5 11 sts 0x11F5, r22 ; 0x8011f5 32050: 70 93 f6 11 sts 0x11F6, r23 ; 0x8011f6 32054: 80 93 f7 11 sts 0x11F7, r24 ; 0x8011f7 32058: 90 93 f8 11 sts 0x11F8, r25 ; 0x8011f8 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 3205c: 81 e0 ldi r24, 0x01 ; 1 3205e: 0f 94 ba 22 call 0x24574 ; 0x24574 32062: 60 93 f9 11 sts 0x11F9, r22 ; 0x8011f9 32066: 70 93 fa 11 sts 0x11FA, r23 ; 0x8011fa 3206a: 80 93 fb 11 sts 0x11FB, r24 ; 0x8011fb 3206e: 90 93 fc 11 sts 0x11FC, r25 ; 0x8011fc } } 32072: 08 95 ret 00032074 : if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 32074: 4f ef ldi r20, 0xFF ; 255 32076: 5f ef ldi r21, 0xFF ; 255 32078: ba 01 movw r22, r20 3207a: 85 ee ldi r24, 0xE5 ; 229 3207c: 9f e0 ldi r25, 0x0F ; 15 3207e: 0f 94 d1 a0 call 0x341a2 ; 0x341a2 32082: 4f ef ldi r20, 0xFF ; 255 32084: 5f ef ldi r21, 0xFF ; 255 32086: ba 01 movw r22, r20 32088: 89 ee ldi r24, 0xE9 ; 233 3208a: 9f e0 ldi r25, 0x0F ; 15 3208c: 0f 94 d1 a0 call 0x341a2 ; 0x341a2 32090: 4f ef ldi r20, 0xFF ; 255 32092: 5f ef ldi r21, 0xFF ; 255 32094: ba 01 movw r22, r20 32096: 8d ed ldi r24, 0xDD ; 221 32098: 9f e0 ldi r25, 0x0F ; 15 3209a: 0f 94 d1 a0 call 0x341a2 ; 0x341a2 3209e: 4f ef ldi r20, 0xFF ; 255 320a0: 5f ef ldi r21, 0xFF ; 255 320a2: ba 01 movw r22, r20 320a4: 81 ee ldi r24, 0xE1 ; 225 320a6: 9f e0 ldi r25, 0x0F ; 15 320a8: 0f 94 d1 a0 call 0x341a2 ; 0x341a2 320ac: 4f ef ldi r20, 0xFF ; 255 320ae: 5f ef ldi r21, 0xFF ; 255 320b0: ba 01 movw r22, r20 320b2: 85 ed ldi r24, 0xD5 ; 213 320b4: 9f e0 ldi r25, 0x0F ; 15 320b6: 0f 94 d1 a0 call 0x341a2 ; 0x341a2 320ba: 4f ef ldi r20, 0xFF ; 255 320bc: 5f ef ldi r21, 0xFF ; 255 320be: ba 01 movw r22, r20 320c0: 89 ed ldi r24, 0xD9 ; 217 320c2: 9f e0 ldi r25, 0x0F ; 15 320c4: 0f 94 d1 a0 call 0x341a2 ; 0x341a2 320c8: 4f ef ldi r20, 0xFF ; 255 320ca: 5f ef ldi r21, 0xFF ; 255 320cc: ba 01 movw r22, r20 320ce: 85 ec ldi r24, 0xC5 ; 197 320d0: 9f e0 ldi r25, 0x0F ; 15 320d2: 0f 94 d1 a0 call 0x341a2 ; 0x341a2 320d6: 4f ef ldi r20, 0xFF ; 255 320d8: 5f ef ldi r21, 0xFF ; 255 320da: ba 01 movw r22, r20 320dc: 89 ec ldi r24, 0xC9 ; 201 320de: 9f e0 ldi r25, 0x0F ; 15 320e0: 0f 94 d1 a0 call 0x341a2 ; 0x341a2 320e4: 4f ef ldi r20, 0xFF ; 255 320e6: 5f ef ldi r21, 0xFF ; 255 320e8: ba 01 movw r22, r20 320ea: 8d ec ldi r24, 0xCD ; 205 320ec: 9f e0 ldi r25, 0x0F ; 15 320ee: 0f 94 d1 a0 call 0x341a2 ; 0x341a2 320f2: 4f ef ldi r20, 0xFF ; 255 320f4: 5f ef ldi r21, 0xFF ; 255 320f6: ba 01 movw r22, r20 320f8: 81 ed ldi r24, 0xD1 ; 209 320fa: 9f e0 ldi r25, 0x0F ; 15 320fc: 0d 94 d1 a0 jmp 0x341a2 ; 0x341a2 00032100 : /** * @brief Read and apply validated calibration data from EEPROM */ void world2machine_initialize() { 32100: 4f 92 push r4 32102: 5f 92 push r5 32104: 6f 92 push r6 32106: 7f 92 push r7 32108: 8f 92 push r8 3210a: 9f 92 push r9 3210c: af 92 push r10 3210e: bf 92 push r11 32110: cf 92 push r12 32112: df 92 push r13 32114: ef 92 push r14 32116: ff 92 push r15 32118: 1f 93 push r17 3211a: cf 93 push r28 3211c: df 93 push r29 3211e: cd b7 in r28, 0x3d ; 61 32120: de b7 in r29, 0x3e ; 62 32122: a8 97 sbiw r28, 0x28 ; 40 32124: 0f b6 in r0, 0x3f ; 63 32126: f8 94 cli 32128: de bf out 0x3e, r29 ; 62 3212a: 0f be out 0x3f, r0 ; 63 3212c: 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); 3212e: 48 e0 ldi r20, 0x08 ; 8 32130: 50 e0 ldi r21, 0x00 ; 0 32132: 6d ed ldi r22, 0xDD ; 221 32134: 7f e0 ldi r23, 0x0F ; 15 32136: ce 01 movw r24, r28 32138: 01 96 adiw r24, 0x01 ; 1 3213a: 0f 94 8b a0 call 0x34116 ; 0x34116 eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 3213e: 48 e0 ldi r20, 0x08 ; 8 32140: 50 e0 ldi r21, 0x00 ; 0 32142: 65 ed ldi r22, 0xD5 ; 213 32144: 7f e0 ldi r23, 0x0F ; 15 32146: ce 01 movw r24, r28 32148: 09 96 adiw r24, 0x09 ; 9 3214a: 0f 94 8b a0 call 0x34116 ; 0x34116 eeprom_read_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8); 3214e: 48 e0 ldi r20, 0x08 ; 8 32150: 50 e0 ldi r21, 0x00 ; 0 32152: 65 ee ldi r22, 0xE5 ; 229 32154: 7f e0 ldi r23, 0x0F ; 15 32156: ce 01 movw r24, r28 32158: 41 96 adiw r24, 0x11 ; 17 3215a: 0f 94 8b a0 call 0x34116 ; 0x34116 } static inline bool vec_undef(const float v[2]) { const uint32_t *vx = (const uint32_t*)v; return vx[0] == 0xFFFFFFFF || vx[1] == 0xFFFFFFFF; 3215e: 89 89 ldd r24, Y+17 ; 0x11 32160: 9a 89 ldd r25, Y+18 ; 0x12 32162: ab 89 ldd r26, Y+19 ; 0x13 32164: bc 89 ldd r27, Y+20 ; 0x14 32166: 89 a3 std Y+33, r24 ; 0x21 32168: 9a a3 std Y+34, r25 ; 0x22 3216a: ab a3 std Y+35, r26 ; 0x23 3216c: bc a3 std Y+36, r27 ; 0x24 3216e: 8f 3f cpi r24, 0xFF ; 255 32170: 9f 4f sbci r25, 0xFF ; 255 32172: af 4f sbci r26, 0xFF ; 255 32174: bf 4f sbci r27, 0xFF ; 255 32176: 09 f4 brne .+2 ; 0x3217a 32178: b1 c0 rjmp .+354 ; 0x322dc 3217a: 8d 89 ldd r24, Y+21 ; 0x15 3217c: 9e 89 ldd r25, Y+22 ; 0x16 3217e: af 89 ldd r26, Y+23 ; 0x17 32180: b8 8d ldd r27, Y+24 ; 0x18 32182: 8d a3 std Y+37, r24 ; 0x25 32184: 9e a3 std Y+38, r25 ; 0x26 32186: af a3 std Y+39, r26 ; 0x27 32188: b8 a7 std Y+40, r27 ; 0x28 3218a: 8f 3f cpi r24, 0xFF ; 255 3218c: 9f 4f sbci r25, 0xFF ; 255 3218e: af 4f sbci r26, 0xFF ; 255 32190: bf 4f sbci r27, 0xFF ; 255 32192: 09 f4 brne .+2 ; 0x32196 32194: a3 c0 rjmp .+326 ; 0x322dc 32196: 89 80 ldd r8, Y+1 ; 0x01 32198: 9a 80 ldd r9, Y+2 ; 0x02 3219a: ab 80 ldd r10, Y+3 ; 0x03 3219c: bc 80 ldd r11, Y+4 ; 0x04 3219e: 8f ef ldi r24, 0xFF ; 255 321a0: 88 16 cp r8, r24 321a2: 98 06 cpc r9, r24 321a4: a8 06 cpc r10, r24 321a6: b8 06 cpc r11, r24 321a8: 09 f4 brne .+2 ; 0x321ac 321aa: 98 c0 rjmp .+304 ; 0x322dc 321ac: 8d 81 ldd r24, Y+5 ; 0x05 321ae: 9e 81 ldd r25, Y+6 ; 0x06 321b0: af 81 ldd r26, Y+7 ; 0x07 321b2: b8 85 ldd r27, Y+8 ; 0x08 321b4: 89 8f std Y+25, r24 ; 0x19 321b6: 9a 8f std Y+26, r25 ; 0x1a 321b8: ab 8f std Y+27, r26 ; 0x1b 321ba: bc 8f std Y+28, r27 ; 0x1c 321bc: 8f 3f cpi r24, 0xFF ; 255 321be: 9f 4f sbci r25, 0xFF ; 255 321c0: af 4f sbci r26, 0xFF ; 255 321c2: bf 4f sbci r27, 0xFF ; 255 321c4: 09 f4 brne .+2 ; 0x321c8 321c6: 8a c0 rjmp .+276 ; 0x322dc 321c8: c9 84 ldd r12, Y+9 ; 0x09 321ca: da 84 ldd r13, Y+10 ; 0x0a 321cc: eb 84 ldd r14, Y+11 ; 0x0b 321ce: fc 84 ldd r15, Y+12 ; 0x0c 321d0: 8f ef ldi r24, 0xFF ; 255 321d2: c8 16 cp r12, r24 321d4: d8 06 cpc r13, r24 321d6: e8 06 cpc r14, r24 321d8: f8 06 cpc r15, r24 321da: 09 f4 brne .+2 ; 0x321de 321dc: 7f c0 rjmp .+254 ; 0x322dc 321de: 8d 85 ldd r24, Y+13 ; 0x0d 321e0: 9e 85 ldd r25, Y+14 ; 0x0e 321e2: af 85 ldd r26, Y+15 ; 0x0f 321e4: b8 89 ldd r27, Y+16 ; 0x10 321e6: 8d 8f std Y+29, r24 ; 0x1d 321e8: 9e 8f std Y+30, r25 ; 0x1e 321ea: af 8f std Y+31, r26 ; 0x1f 321ec: b8 a3 std Y+32, r27 ; 0x20 321ee: 8f 3f cpi r24, 0xFF ; 255 321f0: 9f 4f sbci r25, 0xFF ; 255 321f2: af 4f sbci r26, 0xFF ; 255 321f4: bf 4f sbci r27, 0xFF ; 255 321f6: 09 f4 brne .+2 ; 0x321fa 321f8: 71 c0 rjmp .+226 ; 0x322dc reset = true; } else { // Length of the vec_x shall be close to unity. float l = hypot(vec_x[0], vec_x[1]); 321fa: 29 8d ldd r18, Y+25 ; 0x19 321fc: 3a 8d ldd r19, Y+26 ; 0x1a 321fe: 4b 8d ldd r20, Y+27 ; 0x1b 32200: 5c 8d ldd r21, Y+28 ; 0x1c 32202: c5 01 movw r24, r10 32204: b4 01 movw r22, r8 32206: 0f 94 5f a4 call 0x348be ; 0x348be 3220a: 2b 01 movw r4, r22 3220c: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 3220e: 26 e6 ldi r18, 0x66 ; 102 32210: 36 e6 ldi r19, 0x66 ; 102 32212: 46 e6 ldi r20, 0x66 ; 102 32214: 5f e3 ldi r21, 0x3F ; 63 32216: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__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; 3221a: 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) 3221c: 87 fd sbrc r24, 7 3221e: 0b c0 rjmp .+22 ; 0x32236 32220: 2d ec ldi r18, 0xCD ; 205 32222: 3c ec ldi r19, 0xCC ; 204 32224: 4c e8 ldi r20, 0x8C ; 140 32226: 5f e3 ldi r21, 0x3F ; 63 32228: c3 01 movw r24, r6 3222a: b2 01 movw r22, r4 3222c: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 32230: 18 16 cp r1, r24 32232: 0c f0 brlt .+2 ; 0x32236 32234: 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]); 32236: 2d 8d ldd r18, Y+29 ; 0x1d 32238: 3e 8d ldd r19, Y+30 ; 0x1e 3223a: 4f 8d ldd r20, Y+31 ; 0x1f 3223c: 58 a1 ldd r21, Y+32 ; 0x20 3223e: c7 01 movw r24, r14 32240: b6 01 movw r22, r12 32242: 0f 94 5f a4 call 0x348be ; 0x348be 32246: 2b 01 movw r4, r22 32248: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 3224a: 26 e6 ldi r18, 0x66 ; 102 3224c: 36 e6 ldi r19, 0x66 ; 102 3224e: 46 e6 ldi r20, 0x66 ; 102 32250: 5f e3 ldi r21, 0x3F ; 63 32252: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 32256: 87 fd sbrc r24, 7 32258: 7f c0 rjmp .+254 ; 0x32358 3225a: 2d ec ldi r18, 0xCD ; 205 3225c: 3c ec ldi r19, 0xCC ; 204 3225e: 4c e8 ldi r20, 0x8C ; 140 32260: 5f e3 ldi r21, 0x3F ; 63 32262: c3 01 movw r24, r6 32264: b2 01 movw r22, r4 32266: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 3226a: 18 16 cp r1, r24 3226c: 0c f4 brge .+2 ; 0x32270 3226e: 74 c0 rjmp .+232 ; 0x32358 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]); 32270: 2d a1 ldd r18, Y+37 ; 0x25 32272: 3e a1 ldd r19, Y+38 ; 0x26 32274: 4f a1 ldd r20, Y+39 ; 0x27 32276: 58 a5 ldd r21, Y+40 ; 0x28 32278: 69 a1 ldd r22, Y+33 ; 0x21 3227a: 7a a1 ldd r23, Y+34 ; 0x22 3227c: 8b a1 ldd r24, Y+35 ; 0x23 3227e: 9c a1 ldd r25, Y+36 ; 0x24 32280: 0f 94 5f a4 call 0x348be ; 0x348be if (l > 15.f) 32284: 20 e0 ldi r18, 0x00 ; 0 32286: 30 e0 ldi r19, 0x00 ; 0 32288: 40 e7 ldi r20, 0x70 ; 112 3228a: 51 e4 ldi r21, 0x41 ; 65 3228c: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 32290: 18 16 cp r1, r24 32292: 0c f4 brge .+2 ; 0x32296 #if 0 SERIAL_ECHOLNPGM("Zero point correction:"); MYSERIAL.println(l); SERIAL_ECHOLNPGM("Invalid bed correction matrix. Shift out of range."); #endif reset = true; 32294: 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]; 32296: a5 01 movw r20, r10 32298: 94 01 movw r18, r8 3229a: c7 01 movw r24, r14 3229c: b6 01 movw r22, r12 3229e: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 322a2: 6b 01 movw r12, r22 322a4: 7c 01 movw r14, r24 322a6: 2d 8d ldd r18, Y+29 ; 0x1d 322a8: 3e 8d ldd r19, Y+30 ; 0x1e 322aa: 4f 8d ldd r20, Y+31 ; 0x1f 322ac: 58 a1 ldd r21, Y+32 ; 0x20 322ae: 69 8d ldd r22, Y+25 ; 0x19 322b0: 7a 8d ldd r23, Y+26 ; 0x1a 322b2: 8b 8d ldd r24, Y+27 ; 0x1b 322b4: 9c 8d ldd r25, Y+28 ; 0x1c 322b6: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 322ba: 9b 01 movw r18, r22 322bc: ac 01 movw r20, r24 322be: c7 01 movw r24, r14 322c0: b6 01 movw r22, r12 322c2: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> if (fabs(l) > 0.1f) 322c6: 9f 77 andi r25, 0x7F ; 127 322c8: 2d ec ldi r18, 0xCD ; 205 322ca: 3c ec ldi r19, 0xCC ; 204 322cc: 4c ec ldi r20, 0xCC ; 204 322ce: 5d e3 ldi r21, 0x3D ; 61 322d0: 0f 94 4c a4 call 0x34898 ; 0x34898 <__gesf2> 322d4: 18 16 cp r1, r24 322d6: 14 f0 brlt .+4 ; 0x322dc #endif reset = true; } } if (reset) 322d8: 11 23 and r17, r17 322da: f1 f0 breq .+60 ; 0x32318 { #if 0 SERIAL_ECHOLNPGM("Invalid bed correction matrix. Resetting to identity."); #endif reset_bed_offset_and_skew(); 322dc: 0f 94 3a 90 call 0x32074 ; 0x32074 * @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; 322e0: 80 e0 ldi r24, 0x00 ; 0 322e2: 90 e0 ldi r25, 0x00 ; 0 322e4: a0 e8 ldi r26, 0x80 ; 128 322e6: bf e3 ldi r27, 0x3F ; 63 322e8: 89 83 std Y+1, r24 ; 0x01 322ea: 9a 83 std Y+2, r25 ; 0x02 322ec: ab 83 std Y+3, r26 ; 0x03 322ee: bc 83 std Y+4, r27 ; 0x04 vec_x[1] = 0.f; 322f0: 1d 82 std Y+5, r1 ; 0x05 322f2: 1e 82 std Y+6, r1 ; 0x06 322f4: 1f 82 std Y+7, r1 ; 0x07 322f6: 18 86 std Y+8, r1 ; 0x08 vec_y[0] = 0.f; 322f8: 19 86 std Y+9, r1 ; 0x09 322fa: 1a 86 std Y+10, r1 ; 0x0a 322fc: 1b 86 std Y+11, r1 ; 0x0b 322fe: 1c 86 std Y+12, r1 ; 0x0c vec_y[1] = 1.f; 32300: 8d 87 std Y+13, r24 ; 0x0d 32302: 9e 87 std Y+14, r25 ; 0x0e 32304: af 87 std Y+15, r26 ; 0x0f 32306: b8 8b std Y+16, r27 ; 0x10 cntr[0] = 0.f; 32308: 19 8a std Y+17, r1 ; 0x11 3230a: 1a 8a std Y+18, r1 ; 0x12 3230c: 1b 8a std Y+19, r1 ; 0x13 3230e: 1c 8a std Y+20, r1 ; 0x14 #ifdef DEFAULT_Y_OFFSET cntr[1] = DEFAULT_Y_OFFSET; #else cntr[1] = 0.f; 32310: 1d 8a std Y+21, r1 ; 0x15 32312: 1e 8a std Y+22, r1 ; 0x16 32314: 1f 8a std Y+23, r1 ; 0x17 32316: 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); 32318: ae 01 movw r20, r28 3231a: 4f 5e subi r20, 0xEF ; 239 3231c: 5f 4f sbci r21, 0xFF ; 255 3231e: be 01 movw r22, r28 32320: 67 5f subi r22, 0xF7 ; 247 32322: 7f 4f sbci r23, 0xFF ; 255 32324: ce 01 movw r24, r28 32326: 01 96 adiw r24, 0x01 ; 1 32328: 0f 94 99 8e call 0x31d32 ; 0x31d32 MYSERIAL.print(world2machine_shift[0], 5); SERIAL_ECHOPGM(", "); MYSERIAL.print(world2machine_shift[1], 5); SERIAL_ECHOLNPGM(""); #endif } 3232c: a8 96 adiw r28, 0x28 ; 40 3232e: 0f b6 in r0, 0x3f ; 63 32330: f8 94 cli 32332: de bf out 0x3e, r29 ; 62 32334: 0f be out 0x3f, r0 ; 63 32336: cd bf out 0x3d, r28 ; 61 32338: df 91 pop r29 3233a: cf 91 pop r28 3233c: 1f 91 pop r17 3233e: ff 90 pop r15 32340: ef 90 pop r14 32342: df 90 pop r13 32344: cf 90 pop r12 32346: bf 90 pop r11 32348: af 90 pop r10 3234a: 9f 90 pop r9 3234c: 8f 90 pop r8 3234e: 7f 90 pop r7 32350: 6f 90 pop r6 32352: 5f 90 pop r5 32354: 4f 90 pop r4 32356: 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; 32358: 11 e0 ldi r17, 0x01 ; 1 3235a: 8a cf rjmp .-236 ; 0x32270 0003235c : lcd_print_pad_P(title, LCD_WIDTH); lcd_set_cursor(0, 2); } void menu_progressbar_update(uint16_t newVal) { 3235c: cf 93 push r28 uint8_t newCnt = (newVal * LCD_WIDTH) / progressbar_total; 3235e: 24 e1 ldi r18, 0x14 ; 20 32360: ac 01 movw r20, r24 32362: 24 9f mul r18, r20 32364: c0 01 movw r24, r0 32366: 25 9f mul r18, r21 32368: 90 0d add r25, r0 3236a: 11 24 eor r1, r1 3236c: 60 91 a7 16 lds r22, 0x16A7 ; 0x8016a7 32370: 70 91 a8 16 lds r23, 0x16A8 ; 0x8016a8 32374: 0f 94 64 a1 call 0x342c8 ; 0x342c8 <__udivmodhi4> 32378: c6 2f mov r28, r22 3237a: 65 31 cpi r22, 0x15 ; 21 3237c: 08 f0 brcs .+2 ; 0x32380 3237e: c4 e1 ldi r28, 0x14 ; 20 if (newCnt > LCD_WIDTH) newCnt = LCD_WIDTH; while (newCnt > progressbar_block_count) 32380: 80 91 a6 16 lds r24, 0x16A6 ; 0x8016a6 32384: 8c 17 cp r24, r28 32386: 48 f4 brcc .+18 ; 0x3239a } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 32388: 8f ef ldi r24, 0xFF ; 255 3238a: 0e 94 20 6a call 0xd440 ; 0xd440 { lcd_print(LCD_STR_SOLID_BLOCK[0]); progressbar_block_count++; 3238e: 80 91 a6 16 lds r24, 0x16A6 ; 0x8016a6 32392: 8f 5f subi r24, 0xFF ; 255 32394: 80 93 a6 16 sts 0x16A6, r24 ; 0x8016a6 32398: f3 cf rjmp .-26 ; 0x32380 } } 3239a: cf 91 pop r28 3239c: 08 95 ret 0003239e : void menu_progressbar_finish(void) { progressbar_total = 1; 3239e: 81 e0 ldi r24, 0x01 ; 1 323a0: 90 e0 ldi r25, 0x00 ; 0 323a2: 90 93 a8 16 sts 0x16A8, r25 ; 0x8016a8 323a6: 80 93 a7 16 sts 0x16A7, r24 ; 0x8016a7 menu_progressbar_update(1); 323aa: 0f 94 ae 91 call 0x3235c ; 0x3235c _delay(300); 323ae: 6c e2 ldi r22, 0x2C ; 44 323b0: 71 e0 ldi r23, 0x01 ; 1 323b2: 80 e0 ldi r24, 0x00 ; 0 323b4: 90 e0 ldi r25, 0x00 ; 0 323b6: 0d 94 03 0e jmp 0x21c06 ; 0x21c06 000323ba : } static uint8_t progressbar_block_count = 0; static uint16_t progressbar_total = 0; void menu_progressbar_init(uint16_t total, const char* title) { 323ba: 0f 93 push r16 323bc: 1f 93 push r17 323be: cf 93 push r28 323c0: df 93 push r29 323c2: 8c 01 movw r16, r24 323c4: eb 01 movw r28, r22 lcd_clear(); 323c6: 0e 94 a4 69 call 0xd348 ; 0xd348 progressbar_block_count = 0; 323ca: 10 92 a6 16 sts 0x16A6, r1 ; 0x8016a6 progressbar_total = total; 323ce: 10 93 a8 16 sts 0x16A8, r17 ; 0x8016a8 323d2: 00 93 a7 16 sts 0x16A7, r16 ; 0x8016a7 lcd_set_cursor(0, 1); 323d6: 61 e0 ldi r22, 0x01 ; 1 323d8: 80 e0 ldi r24, 0x00 ; 0 323da: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 lcd_print_pad_P(title, LCD_WIDTH); 323de: 64 e1 ldi r22, 0x14 ; 20 323e0: ce 01 movw r24, r28 323e2: 0e 94 46 6b call 0xd68c ; 0xd68c lcd_set_cursor(0, 2); 323e6: 62 e0 ldi r22, 0x02 ; 2 323e8: 80 e0 ldi r24, 0x00 ; 0 } 323ea: df 91 pop r29 323ec: cf 91 pop r28 323ee: 1f 91 pop r17 323f0: 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); 323f2: 0c 94 71 69 jmp 0xd2e2 ; 0xd2e2 000323f6 : } menu_item++; } bool __attribute__((noinline)) menu_item_leave(){ return ((menu_item == menu_line) && menu_clicked && (lcd_encoder == menu_item)) || menu_leaving; 323f6: 80 91 31 04 lds r24, 0x0431 ; 0x800431 323fa: 90 91 30 04 lds r25, 0x0430 ; 0x800430 323fe: 89 13 cpse r24, r25 32400: 0b c0 rjmp .+22 ; 0x32418 32402: 90 91 2f 04 lds r25, 0x042F ; 0x80042f 32406: 99 23 and r25, r25 32408: 39 f0 breq .+14 ; 0x32418 3240a: 20 91 06 05 lds r18, 0x0506 ; 0x800506 3240e: 30 91 07 05 lds r19, 0x0507 ; 0x800507 32412: 82 17 cp r24, r18 32414: 13 06 cpc r1, r19 32416: 39 f0 breq .+14 ; 0x32426 32418: 81 e0 ldi r24, 0x01 ; 1 3241a: 90 91 92 03 lds r25, 0x0392 ; 0x800392 3241e: 91 11 cpse r25, r1 32420: 03 c0 rjmp .+6 ; 0x32428 32422: 80 e0 ldi r24, 0x00 ; 0 32424: 08 95 ret 32426: 81 e0 ldi r24, 0x01 ; 1 } 32428: 08 95 ret 0003242a : //! @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) { 3242a: 0f 93 push r16 3242c: 1f 93 push r17 3242e: cf 93 push r28 32430: df 93 push r29 32432: 8c 01 movw r16, r24 32434: eb 01 movw r28, r22 uint_least8_t index = sprintf_P(buffer.c, PSTR("%.10S "), _T(MSG_SHEET)); 32436: 84 ea ldi r24, 0xA4 ; 164 32438: 93 e4 ldi r25, 0x43 ; 67 3243a: 0e 94 a7 6c call 0xd94e ; 0xd94e 3243e: 9f 93 push r25 32440: 8f 93 push r24 32442: 87 e7 ldi r24, 0x77 ; 119 32444: 9d e9 ldi r25, 0x9D ; 157 32446: 9f 93 push r25 32448: 8f 93 push r24 3244a: df 93 push r29 3244c: cf 93 push r28 3244e: 0f 94 b2 9f call 0x33f64 ; 0x33f64 eeprom_read_block(&(buffer.c[index]), sheet_E.name, 7); 32452: c8 0f add r28, r24 32454: d1 1d adc r29, r1 32456: 47 e0 ldi r20, 0x07 ; 7 32458: 50 e0 ldi r21, 0x00 ; 0 3245a: b8 01 movw r22, r16 3245c: ce 01 movw r24, r28 3245e: 0f 94 8b a0 call 0x34116 ; 0x34116 //index += 7; buffer.c[index + 7] = '\0'; 32462: 1f 82 std Y+7, r1 ; 0x07 32464: 0f 90 pop r0 32466: 0f 90 pop r0 32468: 0f 90 pop r0 3246a: 0f 90 pop r0 3246c: 0f 90 pop r0 3246e: 0f 90 pop r0 } 32470: df 91 pop r29 32472: cf 91 pop r28 32474: 1f 91 pop r17 32476: 0f 91 pop r16 32478: 08 95 ret 0003247a : 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)?'>':' '; 3247a: 20 91 31 04 lds r18, 0x0431 ; 0x800431 3247e: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32482: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32486: 28 17 cp r18, r24 32488: 19 06 cpc r1, r25 3248a: 11 f0 breq .+4 ; 0x32490 3248c: 80 e2 ldi r24, 0x20 ; 32 3248e: 08 95 ret 32490: 8e e3 ldi r24, 0x3E ; 62 } 32492: 08 95 ret 00032494 : static void menu_draw_item_puts_P(char type_char, const char* str) { 32494: 0f 93 push r16 32496: 1f 93 push r17 32498: cf 93 push r28 3249a: c8 2f mov r28, r24 3249c: 8b 01 movw r16, r22 lcd_putc_at(0, menu_row, menu_selection_mark()); 3249e: 0f 94 3d 92 call 0x3247a ; 0x3247a 324a2: 48 2f mov r20, r24 324a4: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 324a8: 80 e0 ldi r24, 0x00 ; 0 324aa: 0e 94 91 69 call 0xd322 ; 0xd322 lcd_print_pad_P(str, LCD_WIDTH - 2); 324ae: 62 e1 ldi r22, 0x12 ; 18 324b0: c8 01 movw r24, r16 324b2: 0e 94 46 6b call 0xd68c ; 0xd68c lcd_putc(type_char); 324b6: 8c 2f mov r24, r28 } 324b8: cf 91 pop r28 324ba: 1f 91 pop r17 324bc: 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); 324be: 0c 94 60 69 jmp 0xd2c0 ; 0xd2c0 000324c2 : } } void menu_item_ret(void) { lcd_draw_update = 2; 324c2: 82 e0 ldi r24, 0x02 ; 2 324c4: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b menu_item++; 324c8: 80 91 31 04 lds r24, 0x0431 ; 0x800431 324cc: 8f 5f subi r24, 0xFF ; 255 324ce: 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 324d2: 84 e0 ldi r24, 0x04 ; 4 324d4: 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 324d8: 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 324dc: 10 92 2f 04 sts 0x042F, r1 ; 0x80042f } 324e0: 08 95 ret 000324e2 : } menu_item++; } void menu_item_gcode_P(const char* str, const char* str_gcode) { 324e2: cf 93 push r28 324e4: df 93 push r29 if (menu_item == menu_line) 324e6: 30 91 31 04 lds r19, 0x0431 ; 0x800431 324ea: 20 91 30 04 lds r18, 0x0430 ; 0x800430 324ee: 32 13 cpse r19, r18 324f0: 20 c0 rjmp .+64 ; 0x32532 324f2: eb 01 movw r28, r22 324f4: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 324f6: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 324fa: 88 23 and r24, r24 324fc: 19 f0 breq .+6 ; 0x32504 324fe: 80 e2 ldi r24, 0x20 ; 32 32500: 0f 94 4a 92 call 0x32494 ; 0x32494 if (menu_clicked && (lcd_encoder == menu_item)) 32504: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32508: 88 23 and r24, r24 3250a: 99 f0 breq .+38 ; 0x32532 3250c: 20 91 31 04 lds r18, 0x0431 ; 0x800431 32510: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32514: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32518: 28 17 cp r18, r24 3251a: 19 06 cpc r1, r25 3251c: 51 f4 brne .+20 ; 0x32532 { if (str_gcode) enquecommand_P(str_gcode); 3251e: 20 97 sbiw r28, 0x00 ; 0 32520: 21 f0 breq .+8 ; 0x3252a 32522: 61 e0 ldi r22, 0x01 ; 1 32524: ce 01 movw r24, r28 32526: 0e 94 ac 7c call 0xf958 ; 0xf958 menu_item_ret(); return; } } menu_item++; } 3252a: df 91 pop r29 3252c: 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(); 3252e: 0d 94 61 92 jmp 0x324c2 ; 0x324c2 return; } } menu_item++; 32532: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32536: 8f 5f subi r24, 0xFF ; 255 32538: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 3253c: df 91 pop r29 3253e: cf 91 pop r28 32540: 08 95 ret 00032542 : //! @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) { 32542: ef 92 push r14 32544: ff 92 push r15 32546: 0f 93 push r16 32548: 1f 93 push r17 3254a: cf 93 push r28 3254c: df 93 push r29 if (menu_item == menu_line) 3254e: 70 91 31 04 lds r23, 0x0431 ; 0x800431 32552: 30 91 30 04 lds r19, 0x0430 ; 0x800430 32556: 73 13 cpse r23, r19 32558: 3f c0 rjmp .+126 ; 0x325d8 3255a: 12 2f mov r17, r18 3255c: ea 01 movw r28, r20 3255e: 06 2f mov r16, r22 32560: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str, number); 32562: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 32566: 88 23 and r24, r24 32568: d1 f0 breq .+52 ; 0x3259e } 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()); 3256a: 0f 94 3d 92 call 0x3247a ; 0x3247a 3256e: 48 2f mov r20, r24 32570: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 32574: 80 e0 ldi r24, 0x00 ; 0 32576: 0e 94 91 69 call 0xd322 ; 0xd322 uint8_t len = lcd_print_pad_P(str, max_strlen); 3257a: 61 e1 ldi r22, 0x11 ; 17 3257c: c7 01 movw r24, r14 3257e: 0e 94 46 6b call 0xd68c ; 0xd68c lcd_putc_at((max_strlen - len) + 2, menu_row, num); 32582: 40 2f mov r20, r16 32584: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 32588: 93 e1 ldi r25, 0x13 ; 19 3258a: 98 1b sub r25, r24 3258c: 89 2f mov r24, r25 3258e: 0e 94 91 69 call 0xd322 ; 0xd322 lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); 32592: 40 e2 ldi r20, 0x20 ; 32 32594: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 32598: 83 e1 ldi r24, 0x13 ; 19 3259a: 0e 94 91 69 call 0xd322 ; 0xd322 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)) 3259e: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 325a2: 88 23 and r24, r24 325a4: c9 f0 breq .+50 ; 0x325d8 325a6: 20 91 31 04 lds r18, 0x0431 ; 0x800431 325aa: 80 91 06 05 lds r24, 0x0506 ; 0x800506 325ae: 90 91 07 05 lds r25, 0x0507 ; 0x800507 325b2: 28 17 cp r18, r24 325b4: 19 06 cpc r1, r25 325b6: 81 f4 brne .+32 ; 0x325d8 { lcd_update_enabled = 0; 325b8: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c if (func) func(fn_par); 325bc: 81 2f mov r24, r17 325be: fe 01 movw r30, r28 325c0: 19 95 eicall lcd_update_enabled = 1; 325c2: 81 e0 ldi r24, 0x01 ; 1 325c4: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c menu_item_ret(); return; } } menu_item++; } 325c8: df 91 pop r29 325ca: cf 91 pop r28 325cc: 1f 91 pop r17 325ce: 0f 91 pop r16 325d0: ff 90 pop r15 325d2: 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(); 325d4: 0d 94 61 92 jmp 0x324c2 ; 0x324c2 return; } } menu_item++; 325d8: 80 91 31 04 lds r24, 0x0431 ; 0x800431 325dc: 8f 5f subi r24, 0xFF ; 255 325de: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 325e2: df 91 pop r29 325e4: cf 91 pop r28 325e6: 1f 91 pop r17 325e8: 0f 91 pop r16 325ea: ff 90 pop r15 325ec: ef 90 pop r14 325ee: 08 95 ret 000325f0 : 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) { 325f0: cf 93 push r28 325f2: df 93 push r29 if (menu_item == menu_line) 325f4: 30 91 31 04 lds r19, 0x0431 ; 0x800431 325f8: 20 91 30 04 lds r18, 0x0430 ; 0x800430 325fc: 32 13 cpse r19, r18 325fe: 21 c0 rjmp .+66 ; 0x32642 32600: eb 01 movw r28, r22 32602: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 32604: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 32608: 88 23 and r24, r24 3260a: 19 f0 breq .+6 ; 0x32612 3260c: 80 e2 ldi r24, 0x20 ; 32 3260e: 0f 94 4a 92 call 0x32494 ; 0x32494 if (menu_clicked && (lcd_encoder == menu_item)) 32612: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32616: 88 23 and r24, r24 32618: a1 f0 breq .+40 ; 0x32642 3261a: 20 91 31 04 lds r18, 0x0431 ; 0x800431 3261e: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32622: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32626: 28 17 cp r18, r24 32628: 19 06 cpc r1, r25 3262a: 59 f4 brne .+22 ; 0x32642 { lcd_update_enabled = 0; 3262c: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c if (func) func(); 32630: fe 01 movw r30, r28 32632: 19 95 eicall lcd_update_enabled = 1; 32634: 81 e0 ldi r24, 0x01 ; 1 32636: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c menu_item_ret(); return; } } menu_item++; } 3263a: df 91 pop r29 3263c: 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(); 3263e: 0d 94 61 92 jmp 0x324c2 ; 0x324c2 return; } } menu_item++; 32642: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32646: 8f 5f subi r24, 0xFF ; 255 32648: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 3264c: df 91 pop r29 3264e: cf 91 pop r28 32650: 08 95 ret 00032652 : menu_item++; } uint8_t menu_item_text_P(const char* str) { if (menu_item == menu_line) 32652: 30 91 31 04 lds r19, 0x0431 ; 0x800431 32656: 20 91 30 04 lds r18, 0x0430 ; 0x800430 3265a: 32 13 cpse r19, r18 3265c: 19 c0 rjmp .+50 ; 0x32690 3265e: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 32660: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 32664: 88 23 and r24, r24 32666: 19 f0 breq .+6 ; 0x3266e 32668: 80 e2 ldi r24, 0x20 ; 32 3266a: 0f 94 4a 92 call 0x32494 ; 0x32494 if (menu_clicked && (lcd_encoder == menu_item)) 3266e: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32672: 88 23 and r24, r24 32674: 69 f0 breq .+26 ; 0x32690 32676: 20 91 31 04 lds r18, 0x0431 ; 0x800431 3267a: 80 91 06 05 lds r24, 0x0506 ; 0x800506 3267e: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32682: 28 17 cp r18, r24 32684: 19 06 cpc r1, r25 32686: 21 f4 brne .+8 ; 0x32690 { menu_item_ret(); 32688: 0f 94 61 92 call 0x324c2 ; 0x324c2 return 1; 3268c: 81 e0 ldi r24, 0x01 ; 1 3268e: 08 95 ret } } menu_item++; 32690: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32694: 8f 5f subi r24, 0xFF ; 255 32696: 80 93 31 04 sts 0x0431, r24 ; 0x800431 return 0; 3269a: 80 e0 ldi r24, 0x00 ; 0 } 3269c: 08 95 ret 0003269e : menu_clicked = lcd_clicked(); // Consume click event } void menu_end(void) { if (menu_row >= LCD_HEIGHT) 3269e: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 326a2: 84 30 cpi r24, 0x04 ; 4 326a4: 38 f5 brcc .+78 ; 0x326f4 { // Early abort if the menu was clicked. The current menu might have changed because of the click event return; } if (lcd_encoder >= menu_item) 326a6: 80 91 31 04 lds r24, 0x0431 ; 0x800431 326aa: 90 e0 ldi r25, 0x00 ; 0 326ac: 20 91 06 05 lds r18, 0x0506 ; 0x800506 326b0: 30 91 07 05 lds r19, 0x0507 ; 0x800507 326b4: 28 17 cp r18, r24 326b6: 39 07 cpc r19, r25 326b8: 44 f0 brlt .+16 ; 0x326ca { lcd_encoder = menu_item - 1; 326ba: 01 97 sbiw r24, 0x01 ; 1 326bc: 90 93 07 05 sts 0x0507, r25 ; 0x800507 326c0: 80 93 06 05 sts 0x0506, r24 ; 0x800506 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 326c4: 87 e0 ldi r24, 0x07 ; 7 326c6: 0f 94 2b 2d call 0x25a56 ; 0x25a56 } if (((uint8_t)lcd_encoder) >= menu_top + LCD_HEIGHT) 326ca: 80 91 06 05 lds r24, 0x0506 ; 0x800506 326ce: 20 91 60 03 lds r18, 0x0360 ; 0x800360 326d2: 30 e0 ldi r19, 0x00 ; 0 326d4: 2d 5f subi r18, 0xFD ; 253 326d6: 3f 4f sbci r19, 0xFF ; 255 326d8: 82 17 cp r24, r18 326da: 13 06 cpc r1, r19 326dc: 59 f0 breq .+22 ; 0x326f4 326de: 54 f0 brlt .+20 ; 0x326f4 { menu_top = lcd_encoder - LCD_HEIGHT + 1; 326e0: 9d ef ldi r25, 0xFD ; 253 326e2: 98 0f add r25, r24 326e4: 90 93 60 03 sts 0x0360, r25 ; 0x800360 menu_line = menu_top - 1; 326e8: 84 50 subi r24, 0x04 ; 4 326ea: 80 93 30 04 sts 0x0430, r24 ; 0x800430 menu_row = -1; 326ee: 8f ef ldi r24, 0xFF ; 255 326f0: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e } } 326f4: 08 95 ret 000326f6 : CRITICAL_SECTION_END; } void menu_start(void) { if (lcd_encoder < 0) 326f6: 80 91 06 05 lds r24, 0x0506 ; 0x800506 326fa: 90 91 07 05 lds r25, 0x0507 ; 0x800507 326fe: 97 ff sbrs r25, 7 32700: 07 c0 rjmp .+14 ; 0x32710 { lcd_encoder = 0; 32702: 10 92 07 05 sts 0x0507, r1 ; 0x800507 32706: 10 92 06 05 sts 0x0506, r1 ; 0x800506 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 3270a: 87 e0 ldi r24, 0x07 ; 7 3270c: 0f 94 2b 2d call 0x25a56 ; 0x25a56 } if (lcd_encoder < menu_top) 32710: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32714: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32718: 20 91 60 03 lds r18, 0x0360 ; 0x800360 3271c: 28 17 cp r18, r24 3271e: 19 06 cpc r1, r25 32720: 19 f0 breq .+6 ; 0x32728 32722: 14 f0 brlt .+4 ; 0x32728 menu_top = lcd_encoder; 32724: 80 93 60 03 sts 0x0360, r24 ; 0x800360 menu_line = menu_top; 32728: 80 91 60 03 lds r24, 0x0360 ; 0x800360 3272c: 80 93 30 04 sts 0x0430, r24 ; 0x800430 menu_clicked = lcd_clicked(); // Consume click event 32730: 0e 94 8e 6b call 0xd71c ; 0xd71c 32734: 80 93 2f 04 sts 0x042F, r24 ; 0x80042f } 32738: 08 95 ret 0003273a : 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)); 3273a: e4 e6 ldi r30, 0x64 ; 100 3273c: f3 e0 ldi r31, 0x03 ; 3 3273e: 80 e2 ldi r24, 0x20 ; 32 32740: df 01 movw r26, r30 32742: 1d 92 st X+, r1 32744: 8a 95 dec r24 32746: e9 f7 brne .-6 ; 0x32742 } 32748: 08 95 ret 0003274a : void menu_goto(menu_func_t menu, const int16_t encoder, bool reset_menu_state, const bool feedback) { 3274a: cf 93 push r28 CRITICAL_SECTION_START; 3274c: 3f b7 in r19, 0x3f ; 63 3274e: f8 94 cli if (menu_menu != menu) 32750: e0 91 d0 03 lds r30, 0x03D0 ; 0x8003d0 32754: f0 91 d1 03 lds r31, 0x03D1 ; 0x8003d1 32758: e8 17 cp r30, r24 3275a: f9 07 cpc r31, r25 3275c: c9 f0 breq .+50 ; 0x32790 3275e: c4 2f mov r28, r20 { menu_menu = menu; 32760: 90 93 d1 03 sts 0x03D1, r25 ; 0x8003d1 32764: 80 93 d0 03 sts 0x03D0, r24 ; 0x8003d0 lcd_encoder = encoder; 32768: 70 93 07 05 sts 0x0507, r23 ; 0x800507 3276c: 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 32770: 10 92 60 03 sts 0x0360, r1 ; 0x800360 lcd_draw_update = 2; // Full LCD re-draw 32774: 82 e0 ldi r24, 0x02 ; 2 32776: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b CRITICAL_SECTION_END; 3277a: 3f bf out 0x3f, r19 ; 63 if (feedback) lcd_beeper_quick_feedback(); 3277c: 22 23 and r18, r18 3277e: 19 f0 breq .+6 ; 0x32786 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 32780: 80 e0 ldi r24, 0x00 ; 0 32782: 0f 94 2b 2d call 0x25a56 ; 0x25a56 if (reset_menu_state) menu_data_reset(); 32786: cc 23 and r28, r28 32788: 21 f0 breq .+8 ; 0x32792 } else CRITICAL_SECTION_END; } 3278a: 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(); 3278c: 0d 94 9d 93 jmp 0x3273a ; 0x3273a } else CRITICAL_SECTION_END; 32790: 3f bf out 0x3f, r19 ; 63 } 32792: cf 91 pop r28 32794: 08 95 ret 00032796 : 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) { 32796: 7f 92 push r7 32798: 8f 92 push r8 3279a: 9f 92 push r9 3279c: af 92 push r10 3279e: bf 92 push r11 327a0: cf 92 push r12 327a2: df 92 push r13 327a4: ef 92 push r14 327a6: ff 92 push r15 327a8: 0f 93 push r16 327aa: 1f 93 push r17 327ac: cf 93 push r28 327ae: df 93 push r29 menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (menu_item == menu_line) 327b0: e0 91 31 04 lds r30, 0x0431 ; 0x800431 327b4: 50 91 30 04 lds r21, 0x0430 ; 0x800430 327b8: e5 13 cpse r30, r21 327ba: 73 c0 rjmp .+230 ; 0x328a2 { int16_t cur_val = (pbits == 8 ? *((uint8_t*)pval) : *((int16_t*)pval)); 327bc: fb 01 movw r30, r22 327be: 48 30 cpi r20, 0x08 ; 8 327c0: 09 f0 breq .+2 ; 0x327c4 327c2: 6c c0 rjmp .+216 ; 0x3289c 327c4: c0 81 ld r28, Z 327c6: d0 e0 ldi r29, 0x00 ; 0 327c8: 49 01 movw r8, r18 327ca: 74 2e mov r7, r20 327cc: 6b 01 movw r12, r22 327ce: 5c 01 movw r10, r24 if (lcd_draw_update) 327d0: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 327d4: 88 23 and r24, r24 327d6: 59 f0 breq .+22 ; 0x327ee { lcd_set_cursor(0, menu_row); 327d8: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 327dc: 80 e0 ldi r24, 0x00 ; 0 327de: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 menu_draw_P(menu_selection_mark(), str, cur_val); 327e2: 0f 94 3d 92 call 0x3247a ; 0x3247a 327e6: ae 01 movw r20, r28 327e8: b5 01 movw r22, r10 327ea: 0f 94 d9 6e call 0x2ddb2 ; 0x2ddb2 } if (menu_clicked && (lcd_encoder == menu_item)) 327ee: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 327f2: 88 23 and r24, r24 327f4: 09 f4 brne .+2 ; 0x327f8 327f6: 55 c0 rjmp .+170 ; 0x328a2 327f8: 90 91 31 04 lds r25, 0x0431 ; 0x800431 327fc: 20 91 06 05 lds r18, 0x0506 ; 0x800506 32800: 30 91 07 05 lds r19, 0x0507 ; 0x800507 32804: 92 17 cp r25, r18 32806: 13 06 cpc r1, r19 32808: 09 f0 breq .+2 ; 0x3280c 3280a: 4b c0 rjmp .+150 ; 0x328a2 } } void menu_submenu_no_reset(menu_func_t submenu, const bool feedback) { if (menu_depth < MENU_DEPTH_MAX) 3280c: 80 91 ad 03 lds r24, 0x03AD ; 0x8003ad 32810: 87 30 cpi r24, 0x07 ; 7 32812: d8 f4 brcc .+54 ; 0x3284a { menu_stack[menu_depth].menu = menu_menu; 32814: 28 2f mov r18, r24 32816: 30 e0 ldi r19, 0x00 ; 0 32818: f9 01 movw r30, r18 3281a: ee 0f add r30, r30 3281c: ff 1f adc r31, r31 3281e: e2 0f add r30, r18 32820: f3 1f adc r31, r19 32822: ef 56 subi r30, 0x6F ; 111 32824: f9 4e sbci r31, 0xE9 ; 233 32826: 20 91 d0 03 lds r18, 0x03D0 ; 0x8003d0 3282a: 30 91 d1 03 lds r19, 0x03D1 ; 0x8003d1 3282e: 31 83 std Z+1, r19 ; 0x01 32830: 20 83 st Z, r18 menu_stack[menu_depth++].position = lcd_encoder; 32832: 8f 5f subi r24, 0xFF ; 255 32834: 80 93 ad 03 sts 0x03AD, r24 ; 0x8003ad 32838: 92 83 std Z+2, r25 ; 0x02 menu_goto(submenu, 0, false, feedback); 3283a: 20 e0 ldi r18, 0x00 ; 0 3283c: 40 e0 ldi r20, 0x00 ; 0 3283e: 70 e0 ldi r23, 0x00 ; 0 32840: 60 e0 ldi r22, 0x00 ; 0 32842: 87 e9 ldi r24, 0x97 ; 151 32844: 97 e3 ldi r25, 0x37 ; 55 32846: 0f 94 a5 93 call 0x3274a ; 0x3274a 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; 3284a: b0 92 65 03 sts 0x0365, r11 ; 0x800365 3284e: a0 92 64 03 sts 0x0364, r10 ; 0x800364 _md->editValuePtr = pval; 32852: d0 92 68 03 sts 0x0368, r13 ; 0x800368 32856: c0 92 67 03 sts 0x0367, r12 ; 0x800367 _md->editValueBits = pbits; 3285a: 70 92 66 03 sts 0x0366, r7 ; 0x800366 _md->currentValue = cur_val; 3285e: d0 93 6a 03 sts 0x036A, r29 ; 0x80036a 32862: c0 93 69 03 sts 0x0369, r28 ; 0x800369 _md->minEditValue = min_val; 32866: 90 92 6c 03 sts 0x036C, r9 ; 0x80036c 3286a: 80 92 6b 03 sts 0x036B, r8 ; 0x80036b _md->maxEditValue = max_val; 3286e: 10 93 6e 03 sts 0x036E, r17 ; 0x80036e 32872: 00 93 6d 03 sts 0x036D, r16 ; 0x80036d _md->minJumpValue = jmp_val; 32876: f0 92 70 03 sts 0x0370, r15 ; 0x800370 3287a: e0 92 6f 03 sts 0x036F, r14 ; 0x80036f menu_item_ret(); return; } } menu_item++; } 3287e: df 91 pop r29 32880: cf 91 pop r28 32882: 1f 91 pop r17 32884: 0f 91 pop r16 32886: ff 90 pop r15 32888: ef 90 pop r14 3288a: df 90 pop r13 3288c: cf 90 pop r12 3288e: bf 90 pop r11 32890: af 90 pop r10 32892: 9f 90 pop r9 32894: 8f 90 pop r8 32896: 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(); 32898: 0d 94 61 92 jmp 0x324c2 ; 0x324c2 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)); 3289c: c0 81 ld r28, Z 3289e: d1 81 ldd r29, Z+1 ; 0x01 328a0: 93 cf rjmp .-218 ; 0x327c8 _md->minJumpValue = jmp_val; menu_item_ret(); return; } } menu_item++; 328a2: 80 91 31 04 lds r24, 0x0431 ; 0x800431 328a6: 8f 5f subi r24, 0xFF ; 255 328a8: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 328ac: df 91 pop r29 328ae: cf 91 pop r28 328b0: 1f 91 pop r17 328b2: 0f 91 pop r16 328b4: ff 90 pop r15 328b6: ef 90 pop r14 328b8: df 90 pop r13 328ba: cf 90 pop r12 328bc: bf 90 pop r11 328be: af 90 pop r10 328c0: 9f 90 pop r9 328c2: 8f 90 pop r8 328c4: 7f 90 pop r7 328c6: 08 95 ret 000328c8 <_menu_edit_P()>: } static void _menu_edit_P() { menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (lcd_draw_update) 328c8: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 328cc: 88 23 and r24, r24 328ce: 09 f4 brne .+2 ; 0x328d2 <_menu_edit_P()+0xa> 328d0: 52 c0 rjmp .+164 ; 0x32976 <_menu_edit_P()+0xae> { // handle initial value jumping if (_md->minJumpValue && lcd_encoder) { 328d2: 20 91 6f 03 lds r18, 0x036F ; 0x80036f 328d6: 30 91 70 03 lds r19, 0x0370 ; 0x800370 328da: 80 91 6b 03 lds r24, 0x036B ; 0x80036b 328de: 90 91 6c 03 lds r25, 0x036C ; 0x80036c 328e2: 21 15 cp r18, r1 328e4: 31 05 cpc r19, r1 328e6: d9 f0 breq .+54 ; 0x3291e <_menu_edit_P()+0x56> 328e8: 40 91 06 05 lds r20, 0x0506 ; 0x800506 328ec: 50 91 07 05 lds r21, 0x0507 ; 0x800507 328f0: 41 15 cp r20, r1 328f2: 51 05 cpc r21, r1 328f4: a1 f0 breq .+40 ; 0x3291e <_menu_edit_P()+0x56> if (lcd_encoder > 0 && _md->currentValue == _md->minEditValue) { 328f6: 7c f0 brlt .+30 ; 0x32916 <_menu_edit_P()+0x4e> 328f8: 40 91 69 03 lds r20, 0x0369 ; 0x800369 328fc: 50 91 6a 03 lds r21, 0x036A ; 0x80036a 32900: 48 17 cp r20, r24 32902: 59 07 cpc r21, r25 32904: 41 f4 brne .+16 ; 0x32916 <_menu_edit_P()+0x4e> _md->currentValue = _md->minJumpValue; 32906: 30 93 6a 03 sts 0x036A, r19 ; 0x80036a 3290a: 20 93 69 03 sts 0x0369, r18 ; 0x800369 lcd_encoder = 0; 3290e: 10 92 07 05 sts 0x0507, r1 ; 0x800507 32912: 10 92 06 05 sts 0x0506, r1 ; 0x800506 } // disable after first use and/or if the initial value is not minEditValue _md->minJumpValue = 0; 32916: 10 92 70 03 sts 0x0370, r1 ; 0x800370 3291a: 10 92 6f 03 sts 0x036F, r1 ; 0x80036f } _md->currentValue += lcd_encoder; 3291e: 20 91 69 03 lds r18, 0x0369 ; 0x800369 32922: 30 91 6a 03 lds r19, 0x036A ; 0x80036a 32926: 40 91 06 05 lds r20, 0x0506 ; 0x800506 3292a: 50 91 07 05 lds r21, 0x0507 ; 0x800507 3292e: 24 0f add r18, r20 32930: 35 1f adc r19, r21 lcd_encoder = 0; // Consume knob rotation event 32932: 10 92 07 05 sts 0x0507, r1 ; 0x800507 32936: 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); 3293a: 28 17 cp r18, r24 3293c: 39 07 cpc r19, r25 3293e: 44 f0 brlt .+16 ; 0x32950 <_menu_edit_P()+0x88> 32940: 80 91 6d 03 lds r24, 0x036D ; 0x80036d 32944: 90 91 6e 03 lds r25, 0x036E ; 0x80036e 32948: 28 17 cp r18, r24 3294a: 39 07 cpc r19, r25 3294c: 0c f4 brge .+2 ; 0x32950 <_menu_edit_P()+0x88> 3294e: c9 01 movw r24, r18 32950: 90 93 6a 03 sts 0x036A, r25 ; 0x80036a 32954: 80 93 69 03 sts 0x0369, r24 ; 0x800369 lcd_set_cursor(0, 1); 32958: 61 e0 ldi r22, 0x01 ; 1 3295a: 80 e0 ldi r24, 0x00 ; 0 3295c: 0e 94 71 69 call 0xd2e2 ; 0xd2e2 menu_draw_P(' ', _md->editLabel, _md->currentValue); 32960: 40 91 69 03 lds r20, 0x0369 ; 0x800369 32964: 50 91 6a 03 lds r21, 0x036A ; 0x80036a 32968: 60 91 64 03 lds r22, 0x0364 ; 0x800364 3296c: 70 91 65 03 lds r23, 0x0365 ; 0x800365 32970: 80 e2 ldi r24, 0x20 ; 32 32972: 0f 94 d9 6e call 0x2ddb2 ; 0x2ddb2 } if (lcd_clicked()) 32976: 0e 94 8e 6b call 0xd71c ; 0xd71c 3297a: 88 23 and r24, r24 3297c: 41 f1 breq .+80 ; 0x329ce <_menu_edit_P()+0x106> 3297e: e0 91 67 03 lds r30, 0x0367 ; 0x800367 32982: f0 91 68 03 lds r31, 0x0368 ; 0x800368 32986: 80 91 69 03 lds r24, 0x0369 ; 0x800369 3298a: 90 91 6a 03 lds r25, 0x036A ; 0x80036a { if (_md->editValueBits == 8) 3298e: 20 91 66 03 lds r18, 0x0366 ; 0x800366 *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; 32992: 80 83 st Z, r24 lcd_set_cursor(0, 1); menu_draw_P(' ', _md->editLabel, _md->currentValue); } if (lcd_clicked()) { if (_md->editValueBits == 8) 32994: 28 30 cpi r18, 0x08 ; 8 32996: c9 f4 brne .+50 ; 0x329ca <_menu_edit_P()+0x102> menu_back(1); } void menu_back_no_reset(void) { if (menu_depth > 0) 32998: 80 91 ad 03 lds r24, 0x03AD ; 0x8003ad 3299c: 88 23 and r24, r24 3299e: b9 f0 breq .+46 ; 0x329ce <_menu_edit_P()+0x106> { menu_depth--; 329a0: 81 50 subi r24, 0x01 ; 1 329a2: 80 93 ad 03 sts 0x03AD, r24 ; 0x8003ad menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, false); 329a6: 90 e0 ldi r25, 0x00 ; 0 329a8: fc 01 movw r30, r24 329aa: ee 0f add r30, r30 329ac: ff 1f adc r31, r31 329ae: e8 0f add r30, r24 329b0: f9 1f adc r31, r25 329b2: ef 56 subi r30, 0x6F ; 111 329b4: f9 4e sbci r31, 0xE9 ; 233 329b6: 62 81 ldd r22, Z+2 ; 0x02 329b8: 06 2e mov r0, r22 329ba: 00 0c add r0, r0 329bc: 77 0b sbc r23, r23 329be: 20 e0 ldi r18, 0x00 ; 0 329c0: 40 e0 ldi r20, 0x00 ; 0 329c2: 80 81 ld r24, Z 329c4: 91 81 ldd r25, Z+1 ; 0x01 329c6: 0d 94 a5 93 jmp 0x3274a ; 0x3274a if (lcd_clicked()) { if (_md->editValueBits == 8) *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; else *((int16_t*)(_md->editValuePtr)) = _md->currentValue; 329ca: 91 83 std Z+1, r25 ; 0x01 329cc: e5 cf rjmp .-54 ; 0x32998 <_menu_edit_P()+0xd0> menu_back_no_reset(); } } 329ce: 08 95 ret 000329d0 : if (lcd_clicked()) menu_back(); } void menu_submenu(menu_func_t submenu, const bool feedback) { 329d0: dc 01 movw r26, r24 329d2: 26 2f mov r18, r22 if (menu_depth < MENU_DEPTH_MAX) 329d4: 90 91 ad 03 lds r25, 0x03AD ; 0x8003ad 329d8: 97 30 cpi r25, 0x07 ; 7 329da: d8 f4 brcc .+54 ; 0x32a12 { menu_stack[menu_depth].menu = menu_menu; 329dc: 49 2f mov r20, r25 329de: 50 e0 ldi r21, 0x00 ; 0 329e0: fa 01 movw r30, r20 329e2: ee 0f add r30, r30 329e4: ff 1f adc r31, r31 329e6: e4 0f add r30, r20 329e8: f5 1f adc r31, r21 329ea: ef 56 subi r30, 0x6F ; 111 329ec: f9 4e sbci r31, 0xE9 ; 233 329ee: 40 91 d0 03 lds r20, 0x03D0 ; 0x8003d0 329f2: 50 91 d1 03 lds r21, 0x03D1 ; 0x8003d1 329f6: 51 83 std Z+1, r21 ; 0x01 329f8: 40 83 st Z, r20 menu_stack[menu_depth++].position = lcd_encoder; 329fa: 80 91 06 05 lds r24, 0x0506 ; 0x800506 329fe: 9f 5f subi r25, 0xFF ; 255 32a00: 90 93 ad 03 sts 0x03AD, r25 ; 0x8003ad 32a04: 82 83 std Z+2, r24 ; 0x02 menu_goto(submenu, 0, true, feedback); 32a06: 41 e0 ldi r20, 0x01 ; 1 32a08: 70 e0 ldi r23, 0x00 ; 0 32a0a: 60 e0 ldi r22, 0x00 ; 0 32a0c: cd 01 movw r24, r26 32a0e: 0d 94 a5 93 jmp 0x3274a ; 0x3274a } } 32a12: 08 95 ret 00032a14 : } menu_item++; } void menu_item_toggle_P(const char* str, const char* toggle, menu_func_t func, const uint8_t settings) { 32a14: 8f 92 push r8 32a16: 9f 92 push r9 32a18: af 92 push r10 32a1a: bf 92 push r11 32a1c: cf 92 push r12 32a1e: df 92 push r13 32a20: ef 92 push r14 32a22: ff 92 push r15 32a24: 0f 93 push r16 32a26: 1f 93 push r17 32a28: cf 93 push r28 32a2a: df 93 push r29 if (menu_item == menu_line) 32a2c: e0 91 31 04 lds r30, 0x0431 ; 0x800431 32a30: 30 91 30 04 lds r19, 0x0430 ; 0x800430 32a34: e3 13 cpse r30, r19 32a36: 73 c0 rjmp .+230 ; 0x32b1e 32a38: c2 2f mov r28, r18 32a3a: 6a 01 movw r12, r20 32a3c: 7b 01 movw r14, r22 32a3e: 5c 01 movw r10, r24 { if (lcd_draw_update) menu_draw_toggle_puts_P(str, toggle, settings | (menu_selection_mark()=='>')); 32a40: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 32a44: 88 23 and r24, r24 32a46: a1 f1 breq .+104 ; 0x32ab0 32a48: 0f 94 3d 92 call 0x3247a ; 0x3247a 32a4c: 01 e0 ldi r16, 0x01 ; 1 32a4e: 8e 33 cpi r24, 0x3E ; 62 32a50: 09 f0 breq .+2 ; 0x32a54 32a52: 00 e0 ldi r16, 0x00 ; 0 32a54: 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; 32a56: 80 2f mov r24, r16 32a58: 82 70 andi r24, 0x02 ; 2 32a5a: 88 2e mov r8, r24 const char eol = (toggle == NULL) ? LCD_STR_ARROW_RIGHT[0] : ' '; 32a5c: e1 14 cp r14, r1 32a5e: f1 04 cpc r15, r1 32a60: 09 f4 brne .+2 ; 0x32a64 32a62: 6f c0 rjmp .+222 ; 0x32b42 32a64: e7 01 movw r28, r14 32a66: 90 e2 ldi r25, 0x20 ; 32 32a68: 99 2e mov r9, r25 if (toggle == NULL) toggle = _T(MSG_NA); uint8_t len = 4 + (is_progmem ? strlen_P(toggle) : strlen(toggle)); 32a6a: 88 20 and r8, r8 32a6c: 09 f4 brne .+2 ; 0x32a70 32a6e: 41 c0 rjmp .+130 ; 0x32af2 32a70: ce 01 movw r24, r28 32a72: 0f 94 59 9e call 0x33cb2 ; 0x33cb2 <__strlen_P> 32a76: 14 e0 ldi r17, 0x04 ; 4 32a78: 18 0f add r17, r24 lcd_putc_at(0, menu_row, (settings & 0x01) ? '>' : ' '); 32a7a: 4e e3 ldi r20, 0x3E ; 62 32a7c: 00 ff sbrs r16, 0 32a7e: 40 e2 ldi r20, 0x20 ; 32 32a80: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 32a84: 80 e0 ldi r24, 0x00 ; 0 32a86: 0e 94 91 69 call 0xd322 ; 0xd322 lcd_print_pad_P(str, LCD_WIDTH - len); 32a8a: 64 e1 ldi r22, 0x14 ; 20 32a8c: 61 1b sub r22, r17 32a8e: c5 01 movw r24, r10 32a90: 0e 94 46 6b call 0xd68c ; 0xd68c lcd_putc('['); 32a94: 8b e5 ldi r24, 0x5B ; 91 32a96: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 if (is_progmem) { lcd_puts_P(toggle); 32a9a: 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) 32a9c: 88 20 and r8, r8 32a9e: 89 f1 breq .+98 ; 0x32b02 { lcd_puts_P(toggle); 32aa0: 0e 94 5c 69 call 0xd2b8 ; 0xd2b8 } else { lcd_print(toggle); } lcd_putc(']'); 32aa4: 8d e5 ldi r24, 0x5D ; 93 32aa6: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 lcd_putc(eol); 32aaa: 89 2d mov r24, r9 32aac: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 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)) 32ab0: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32ab4: 88 23 and r24, r24 32ab6: 99 f1 breq .+102 ; 0x32b1e 32ab8: 20 91 31 04 lds r18, 0x0431 ; 0x800431 32abc: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32ac0: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32ac4: 28 17 cp r18, r24 32ac6: 19 06 cpc r1, r25 32ac8: 51 f5 brne .+84 ; 0x32b1e { if (toggle == NULL) // print N/A warning message 32aca: ef 28 or r14, r15 32acc: e9 f4 brne .+58 ; 0x32b08 { menu_submenu(func); 32ace: 60 e0 ldi r22, 0x00 ; 0 32ad0: c6 01 movw r24, r12 32ad2: 0f 94 e8 94 call 0x329d0 ; 0x329d0 menu_item_ret(); return; } } menu_item++; } 32ad6: df 91 pop r29 32ad8: cf 91 pop r28 32ada: 1f 91 pop r17 32adc: 0f 91 pop r16 32ade: ff 90 pop r15 32ae0: ef 90 pop r14 32ae2: df 90 pop r13 32ae4: cf 90 pop r12 32ae6: bf 90 pop r11 32ae8: af 90 pop r10 32aea: 9f 90 pop r9 32aec: 8f 90 pop r8 { lcd_update_enabled = 0; if (func) func(); lcd_update_enabled = 1; } menu_item_ret(); 32aee: 0d 94 61 92 jmp 0x324c2 ; 0x324c2 //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)); 32af2: fe 01 movw r30, r28 32af4: 01 90 ld r0, Z+ 32af6: 00 20 and r0, r0 32af8: e9 f7 brne .-6 ; 0x32af4 32afa: ec 1b sub r30, r28 32afc: 13 e0 ldi r17, 0x03 ; 3 32afe: 1e 0f add r17, r30 32b00: bc cf rjmp .-136 ; 0x32a7a lcd_putc('['); if (is_progmem) { lcd_puts_P(toggle); } else { lcd_print(toggle); 32b02: 0e 94 78 6b call 0xd6f0 ; 0xd6f0 32b06: ce cf rjmp .-100 ; 0x32aa4 { menu_submenu(func); } else // do the actual toggling { lcd_update_enabled = 0; 32b08: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c if (func) func(); 32b0c: c1 14 cp r12, r1 32b0e: d1 04 cpc r13, r1 32b10: 11 f0 breq .+4 ; 0x32b16 32b12: f6 01 movw r30, r12 32b14: 19 95 eicall lcd_update_enabled = 1; 32b16: 81 e0 ldi r24, 0x01 ; 1 32b18: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c 32b1c: dc cf rjmp .-72 ; 0x32ad6 } menu_item_ret(); return; } } menu_item++; 32b1e: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32b22: 8f 5f subi r24, 0xFF ; 255 32b24: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 32b28: df 91 pop r29 32b2a: cf 91 pop r28 32b2c: 1f 91 pop r17 32b2e: 0f 91 pop r16 32b30: ff 90 pop r15 32b32: ef 90 pop r14 32b34: df 90 pop r13 32b36: cf 90 pop r12 32b38: bf 90 pop r11 32b3a: af 90 pop r10 32b3c: 9f 90 pop r9 32b3e: 8f 90 pop r8 32b40: 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); 32b42: 8c e8 ldi r24, 0x8C ; 140 32b44: 9d e3 ldi r25, 0x3D ; 61 32b46: 0e 94 a7 6c call 0xd94e ; 0xd94e 32b4a: 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] : ' '; 32b4c: 8e e7 ldi r24, 0x7E ; 126 32b4e: 98 2e mov r9, r24 32b50: 8c cf rjmp .-232 ; 0x32a6a 00032b52 : } menu_item++; } void menu_item_submenu_E(const Sheet &sheet, menu_func_t submenu) { 32b52: 0f 93 push r16 32b54: 1f 93 push r17 32b56: cf 93 push r28 32b58: df 93 push r29 32b5a: cd b7 in r28, 0x3d ; 61 32b5c: de b7 in r29, 0x3e ; 62 32b5e: 63 97 sbiw r28, 0x13 ; 19 32b60: 0f b6 in r0, 0x3f ; 63 32b62: f8 94 cli 32b64: de bf out 0x3e, r29 ; 62 32b66: 0f be out 0x3f, r0 ; 63 32b68: cd bf out 0x3d, r28 ; 61 if (menu_item == menu_line) 32b6a: 30 91 31 04 lds r19, 0x0431 ; 0x800431 32b6e: 20 91 30 04 lds r18, 0x0430 ; 0x800430 32b72: 32 13 cpse r19, r18 32b74: 38 c0 rjmp .+112 ; 0x32be6 32b76: 8b 01 movw r16, r22 { if (lcd_draw_update) menu_draw_item_puts_E(LCD_STR_ARROW_RIGHT[0], sheet); 32b78: 20 91 5b 02 lds r18, 0x025B ; 0x80025b 32b7c: 22 23 and r18, r18 32b7e: a9 f0 breq .+42 ; 0x32baa static void menu_draw_item_puts_E(char type_char, const Sheet &sheet) { SheetFormatBuffer buffer; menu_format_sheet_E(sheet, buffer); 32b80: be 01 movw r22, r28 32b82: 6f 5f subi r22, 0xFF ; 255 32b84: 7f 4f sbci r23, 0xFF ; 255 32b86: 0f 94 15 92 call 0x3242a ; 0x3242a lcd_putc_at(0, menu_row, menu_selection_mark()); 32b8a: 0f 94 3d 92 call 0x3247a ; 0x3247a 32b8e: 48 2f mov r20, r24 32b90: 60 91 2e 04 lds r22, 0x042E ; 0x80042e 32b94: 80 e0 ldi r24, 0x00 ; 0 32b96: 0e 94 91 69 call 0xd322 ; 0xd322 lcd_print_pad(buffer.c, LCD_WIDTH - 2); 32b9a: 62 e1 ldi r22, 0x12 ; 18 32b9c: ce 01 movw r24, r28 32b9e: 01 96 adiw r24, 0x01 ; 1 32ba0: 0e 94 60 6b call 0xd6c0 ; 0xd6c0 lcd_putc(type_char); 32ba4: 8e e7 ldi r24, 0x7E ; 126 32ba6: 0e 94 60 69 call 0xd2c0 ; 0xd2c0 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)) 32baa: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32bae: 88 23 and r24, r24 32bb0: d1 f0 breq .+52 ; 0x32be6 32bb2: 20 91 31 04 lds r18, 0x0431 ; 0x800431 32bb6: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32bba: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32bbe: 28 17 cp r18, r24 32bc0: 19 06 cpc r1, r25 32bc2: 89 f4 brne .+34 ; 0x32be6 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); 32bc4: 60 e0 ldi r22, 0x00 ; 0 32bc6: c8 01 movw r24, r16 32bc8: 0f 94 e8 94 call 0x329d0 ; 0x329d0 menu_item_ret(); 32bcc: 0f 94 61 92 call 0x324c2 ; 0x324c2 menu_item_ret(); return; } } menu_item++; } 32bd0: 63 96 adiw r28, 0x13 ; 19 32bd2: 0f b6 in r0, 0x3f ; 63 32bd4: f8 94 cli 32bd6: de bf out 0x3e, r29 ; 62 32bd8: 0f be out 0x3f, r0 ; 63 32bda: cd bf out 0x3d, r28 ; 61 32bdc: df 91 pop r29 32bde: cf 91 pop r28 32be0: 1f 91 pop r17 32be2: 0f 91 pop r16 32be4: 08 95 ret menu_submenu(submenu); menu_item_ret(); return; } } menu_item++; 32be6: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32bea: 8f 5f subi r24, 0xFF ; 255 32bec: 80 93 31 04 sts 0x0431, r24 ; 0x800431 32bf0: ef cf rjmp .-34 ; 0x32bd0 00032bf2 : menu_item++; return 0; } void menu_item_submenu_P(const char* str, menu_func_t submenu) { 32bf2: cf 93 push r28 32bf4: df 93 push r29 if (menu_item == menu_line) 32bf6: 30 91 31 04 lds r19, 0x0431 ; 0x800431 32bfa: 20 91 30 04 lds r18, 0x0430 ; 0x800430 32bfe: 32 13 cpse r19, r18 32c00: 1e c0 rjmp .+60 ; 0x32c3e 32c02: eb 01 movw r28, r22 32c04: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_ARROW_RIGHT[0], str); 32c06: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 32c0a: 88 23 and r24, r24 32c0c: 19 f0 breq .+6 ; 0x32c14 32c0e: 8e e7 ldi r24, 0x7E ; 126 32c10: 0f 94 4a 92 call 0x32494 ; 0x32494 if (menu_clicked && (lcd_encoder == menu_item)) 32c14: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32c18: 88 23 and r24, r24 32c1a: 89 f0 breq .+34 ; 0x32c3e 32c1c: 20 91 31 04 lds r18, 0x0431 ; 0x800431 32c20: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32c24: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32c28: 28 17 cp r18, r24 32c2a: 19 06 cpc r1, r25 32c2c: 41 f4 brne .+16 ; 0x32c3e { menu_submenu(submenu); 32c2e: 60 e0 ldi r22, 0x00 ; 0 32c30: ce 01 movw r24, r28 32c32: 0f 94 e8 94 call 0x329d0 ; 0x329d0 menu_item_ret(); return; } } menu_item++; } 32c36: df 91 pop r29 32c38: 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(); 32c3a: 0d 94 61 92 jmp 0x324c2 ; 0x324c2 return; } } menu_item++; 32c3e: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32c42: 8f 5f subi r24, 0xFF ; 255 32c44: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 32c48: df 91 pop r29 32c4a: cf 91 pop r28 32c4c: 08 95 ret 00032c4e : menu_row = -1; } } void menu_back(uint8_t nLevel) { 32c4e: 98 2f mov r25, r24 menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 32c50: 80 91 ad 03 lds r24, 0x03AD ; 0x8003ad 32c54: 98 17 cp r25, r24 32c56: a8 f4 brcc .+42 ; 0x32c82 32c58: 89 1b sub r24, r25 32c5a: 80 93 ad 03 sts 0x03AD, r24 ; 0x8003ad menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); 32c5e: 90 e0 ldi r25, 0x00 ; 0 32c60: fc 01 movw r30, r24 32c62: ee 0f add r30, r30 32c64: ff 1f adc r31, r31 32c66: e8 0f add r30, r24 32c68: f9 1f adc r31, r25 32c6a: ef 56 subi r30, 0x6F ; 111 32c6c: f9 4e sbci r31, 0xE9 ; 233 32c6e: 62 81 ldd r22, Z+2 ; 0x02 32c70: 06 2e mov r0, r22 32c72: 00 0c add r0, r0 32c74: 77 0b sbc r23, r23 32c76: 20 e0 ldi r18, 0x00 ; 0 32c78: 41 e0 ldi r20, 0x01 ; 1 32c7a: 80 81 ld r24, Z 32c7c: 91 81 ldd r25, Z+1 ; 0x01 32c7e: 0d 94 a5 93 jmp 0x3274a ; 0x3274a } } void menu_back(uint8_t nLevel) { menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 32c82: 80 e0 ldi r24, 0x00 ; 0 32c84: ea cf rjmp .-44 ; 0x32c5a 00032c86 : menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); } void menu_back(void) { menu_back(1); 32c86: 81 e0 ldi r24, 0x01 ; 1 32c88: 0d 94 27 96 jmp 0x32c4e ; 0x32c4e 00032c8c : menu_item++; } void menu_item_back_P(const char* str) { if (menu_item == menu_line) 32c8c: 30 91 31 04 lds r19, 0x0431 ; 0x800431 32c90: 20 91 30 04 lds r18, 0x0430 ; 0x800430 32c94: 32 13 cpse r19, r18 32c96: 19 c0 rjmp .+50 ; 0x32cca 32c98: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_UPLEVEL[0], str); 32c9a: 80 91 5b 02 lds r24, 0x025B ; 0x80025b 32c9e: 88 23 and r24, r24 32ca0: 19 f0 breq .+6 ; 0x32ca8 32ca2: 83 e8 ldi r24, 0x83 ; 131 32ca4: 0f 94 4a 92 call 0x32494 ; 0x32494 if (menu_clicked && (lcd_encoder == menu_item)) 32ca8: 80 91 2f 04 lds r24, 0x042F ; 0x80042f 32cac: 88 23 and r24, r24 32cae: 69 f0 breq .+26 ; 0x32cca 32cb0: 20 91 31 04 lds r18, 0x0431 ; 0x800431 32cb4: 80 91 06 05 lds r24, 0x0506 ; 0x800506 32cb8: 90 91 07 05 lds r25, 0x0507 ; 0x800507 32cbc: 28 17 cp r18, r24 32cbe: 19 06 cpc r1, r25 32cc0: 21 f4 brne .+8 ; 0x32cca { menu_back(); 32cc2: 0f 94 43 96 call 0x32c86 ; 0x32c86 menu_item_ret(); 32cc6: 0d 94 61 92 jmp 0x324c2 ; 0x324c2 return; } } menu_item++; 32cca: 80 91 31 04 lds r24, 0x0431 ; 0x800431 32cce: 8f 5f subi r24, 0xFF ; 255 32cd0: 80 93 31 04 sts 0x0431, r24 ; 0x800431 } 32cd4: 08 95 ret 00032cd6 : }; 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() { 32cd6: ef 92 push r14 32cd8: ff 92 push r15 32cda: 0f 93 push r16 32cdc: 1f 93 push r17 32cde: cf 93 push r28 32ce0: df 93 push r29 32ce2: 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) 32ce6: 80 91 71 03 lds r24, 0x0371 ; 0x800371 32cea: 81 11 cpse r24, r1 32cec: 23 c0 rjmp .+70 ; 0x32d34 { _md->status = 1; // Menu entered for the first time 32cee: 81 e0 ldi r24, 0x01 ; 1 32cf0: 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; 32cf4: 81 e0 ldi r24, 0x01 ; 1 32cf6: 90 e0 ldi r25, 0x00 ; 0 32cf8: 20 91 65 12 lds r18, 0x1265 ; 0x801265 32cfc: 30 91 66 12 lds r19, 0x1266 ; 0x801266 32d00: 27 30 cpi r18, 0x07 ; 7 32d02: 31 48 sbci r19, 0x81 ; 129 32d04: 11 f0 breq .+4 ; 0x32d0a 32d06: 90 e0 ldi r25, 0x00 ; 0 32d08: 80 e0 ldi r24, 0x00 ; 0 memcpy_P(&(_md->item), &TuneItems[offset], sizeof(TuneItem)); 32d0a: bc 01 movw r22, r24 32d0c: 66 0f add r22, r22 32d0e: 77 1f adc r23, r23 32d10: 68 0f add r22, r24 32d12: 79 1f adc r23, r25 32d14: 62 55 subi r22, 0x52 ; 82 32d16: 72 46 sbci r23, 0x62 ; 98 32d18: 43 e0 ldi r20, 0x03 ; 3 32d1a: 50 e0 ldi r21, 0x00 ; 0 32d1c: 83 e7 ldi r24, 0x73 ; 115 32d1e: 93 e0 ldi r25, 0x03 ; 3 32d20: 0f 94 35 9e call 0x33c6a ; 0x33c6a // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); 32d24: 80 91 73 03 lds r24, 0x0373 ; 0x800373 32d28: 0e 94 b7 f7 call 0x1ef6e ; 0x1ef6e _md->currentValue = mmu2.GetLastReadRegisterValue(); 32d2c: 80 91 90 12 lds r24, 0x1290 ; 0x801290 32d30: 80 93 72 03 sts 0x0372, r24 ; 0x800372 } MENU_BEGIN(); 32d34: 0f 94 7b 93 call 0x326f6 ; 0x326f6 32d38: 10 92 2e 04 sts 0x042E, r1 ; 0x80042e 32d3c: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 32d40: 84 30 cpi r24, 0x04 ; 4 32d42: e0 f5 brcc .+120 ; 0x32dbc 32d44: 10 92 31 04 sts 0x0431, r1 ; 0x800431 ON_MENU_LEAVE( 32d48: 0f 94 fb 91 call 0x323f6 ; 0x323f6 32d4c: 88 23 and r24, r24 32d4e: 89 f0 breq .+34 ; 0x32d72 32d50: 60 91 72 03 lds r22, 0x0372 ; 0x800372 32d54: 70 e0 ldi r23, 0x00 ; 0 32d56: 80 91 73 03 lds r24, 0x0373 ; 0x800373 32d5a: 0e 94 9c bf call 0x17f38 ; 0x17f38 32d5e: 10 92 ad 0d sts 0x0DAD, r1 ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.458> &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 32d62: df 91 pop r29 32d64: cf 91 pop r28 32d66: 1f 91 pop r17 32d68: 0f 91 pop r16 32d6a: ff 90 pop r15 32d6c: ef 90 pop r14 mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); ON_MENU_LEAVE( 32d6e: 0c 94 6d fe jmp 0x1fcda ; 0x1fcda mmu2.WriteRegister(_md->item.address, (uint16_t)_md->currentValue); putErrorScreenToSleep = false; lcd_return_to_status(); return; ); MENU_ITEM_BACK_P(_T(MSG_DONE)); 32d72: 88 e8 ldi r24, 0x88 ; 136 32d74: 92 e6 ldi r25, 0x62 ; 98 32d76: 0e 94 a7 6c call 0xd94e ; 0xd94e 32d7a: 0f 94 46 96 call 0x32c8c ; 0x32c8c MENU_ITEM_EDIT_int3_P( 32d7e: 00 91 75 03 lds r16, 0x0375 ; 0x800375 32d82: 10 e0 ldi r17, 0x00 ; 0 32d84: c0 91 74 03 lds r28, 0x0374 ; 0x800374 32d88: d0 e0 ldi r29, 0x00 ; 0 32d8a: 8a e7 ldi r24, 0x7A ; 122 32d8c: 92 e6 ldi r25, 0x62 ; 98 32d8e: 0e 94 a7 6c call 0xd94e ; 0xd94e 32d92: f1 2c mov r15, r1 32d94: e1 2c mov r14, r1 32d96: 9e 01 movw r18, r28 32d98: 48 e0 ldi r20, 0x08 ; 8 32d9a: 62 e7 ldi r22, 0x72 ; 114 32d9c: 73 e0 ldi r23, 0x03 ; 3 32d9e: 0f 94 cb 93 call 0x32796 ; 0x32796 _T(MSG_MMU_SENSITIVITY), &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); 32da2: 0f 94 4f 93 call 0x3269e ; 0x3269e // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); 32da6: 80 91 2e 04 lds r24, 0x042E ; 0x80042e 32daa: 8f 5f subi r24, 0xFF ; 255 32dac: 80 93 2e 04 sts 0x042E, r24 ; 0x80042e 32db0: 80 91 30 04 lds r24, 0x0430 ; 0x800430 32db4: 8f 5f subi r24, 0xFF ; 255 32db6: 80 93 30 04 sts 0x0430, r24 ; 0x800430 32dba: c0 cf rjmp .-128 ; 0x32d3c &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 32dbc: df 91 pop r29 32dbe: cf 91 pop r28 32dc0: 1f 91 pop r17 32dc2: 0f 91 pop r16 32dc4: ff 90 pop r15 32dc6: ef 90 pop r14 32dc8: 08 95 ret 00032dca : } } void menu_back_if_clicked(void) { if (lcd_clicked()) 32dca: 0e 94 8e 6b call 0xd71c ; 0xd71c 32dce: 81 11 cpse r24, r1 menu_back(); 32dd0: 0d 94 43 96 jmp 0x32c86 ; 0x32c86 } 32dd4: 08 95 ret 00032dd6 : } // Private Methods ///////////////////////////////////////////////////////////// void MarlinSerial::printNumber(unsigned long n, uint8_t base) { 32dd6: 8f 92 push r8 32dd8: 9f 92 push r9 32dda: af 92 push r10 32ddc: bf 92 push r11 32dde: ef 92 push r14 32de0: ff 92 push r15 32de2: 0f 93 push r16 32de4: 1f 93 push r17 32de6: cf 93 push r28 32de8: df 93 push r29 32dea: cd b7 in r28, 0x3d ; 61 32dec: de b7 in r29, 0x3e ; 62 32dee: a0 97 sbiw r28, 0x20 ; 32 32df0: 0f b6 in r0, 0x3f ; 63 32df2: f8 94 cli 32df4: de bf out 0x3e, r29 ; 62 32df6: 0f be out 0x3f, r0 ; 63 32df8: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) { 32dfa: 61 15 cp r22, r1 32dfc: 71 05 cpc r23, r1 32dfe: 81 05 cpc r24, r1 32e00: 91 05 cpc r25, r1 32e02: 99 f4 brne .+38 ; 0x32e2a } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32e04: 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)); } 32e06: a0 96 adiw r28, 0x20 ; 32 32e08: 0f b6 in r0, 0x3f ; 63 32e0a: f8 94 cli 32e0c: de bf out 0x3e, r29 ; 62 32e0e: 0f be out 0x3f, r0 ; 63 32e10: cd bf out 0x3d, r28 ; 61 32e12: df 91 pop r29 32e14: cf 91 pop r28 32e16: 1f 91 pop r17 32e18: 0f 91 pop r16 32e1a: ff 90 pop r15 32e1c: ef 90 pop r14 32e1e: bf 90 pop r11 32e20: af 90 pop r10 32e22: 9f 90 pop r9 32e24: 8f 90 pop r8 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32e26: 0c 94 37 70 jmp 0xe06e ; 0xe06e // 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; 32e2a: 00 e0 ldi r16, 0x00 ; 0 print('0'); return; } while (n > 0) { buf[i++] = n % base; 32e2c: 84 2e mov r8, r20 32e2e: 91 2c mov r9, r1 32e30: b1 2c mov r11, r1 32e32: a1 2c mov r10, r1 32e34: 9e 01 movw r18, r28 32e36: 2f 5f subi r18, 0xFF ; 255 32e38: 3f 4f sbci r19, 0xFF ; 255 32e3a: 79 01 movw r14, r18 32e3c: a5 01 movw r20, r10 32e3e: 94 01 movw r18, r8 32e40: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> 32e44: f7 01 movw r30, r14 32e46: e0 0f add r30, r16 32e48: f1 1d adc r31, r1 32e4a: 60 83 st Z, r22 n /= base; 32e4c: b9 01 movw r22, r18 32e4e: ca 01 movw r24, r20 print('0'); return; } while (n > 0) { buf[i++] = n % base; 32e50: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { print('0'); return; } while (n > 0) { 32e52: 61 15 cp r22, r1 32e54: 71 05 cpc r23, r1 32e56: 81 05 cpc r24, r1 32e58: 91 05 cpc r25, r1 32e5a: 81 f7 brne .-32 ; 0x32e3c 32e5c: 0e 0d add r16, r14 32e5e: 1f 2d mov r17, r15 32e60: 11 1d adc r17, r1 buf[i++] = n % base; n /= base; } for (; i > 0; i--) 32e62: e0 16 cp r14, r16 32e64: f1 06 cpc r15, r17 32e66: 59 f0 breq .+22 ; 0x32e7e print((char) (buf[i - 1] < 10 ? 32e68: f8 01 movw r30, r16 32e6a: 82 91 ld r24, -Z 32e6c: 8f 01 movw r16, r30 32e6e: 8a 30 cpi r24, 0x0A ; 10 32e70: 20 f4 brcc .+8 ; 0x32e7a '0' + buf[i - 1] : 32e72: 80 5d subi r24, 0xD0 ; 208 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32e74: 0e 94 37 70 call 0xe06e ; 0xe06e 32e78: f4 cf rjmp .-24 ; 0x32e62 } for (; i > 0; i--) print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); 32e7a: 89 5c subi r24, 0xC9 ; 201 32e7c: fb cf rjmp .-10 ; 0x32e74 } 32e7e: a0 96 adiw r28, 0x20 ; 32 32e80: 0f b6 in r0, 0x3f ; 63 32e82: f8 94 cli 32e84: de bf out 0x3e, r29 ; 62 32e86: 0f be out 0x3f, r0 ; 63 32e88: cd bf out 0x3d, r28 ; 61 32e8a: df 91 pop r29 32e8c: cf 91 pop r28 32e8e: 1f 91 pop r17 32e90: 0f 91 pop r16 32e92: ff 90 pop r15 32e94: ef 90 pop r14 32e96: bf 90 pop r11 32e98: af 90 pop r10 32e9a: 9f 90 pop r9 32e9c: 8f 90 pop r8 32e9e: 08 95 ret 00032ea0 : static void prusa_stat_farm_number() { SERIAL_ECHOPGM("[PFN:0]"); } static void prusa_stat_diameter() { SERIAL_ECHOPGM("[DIA:"); 32ea0: 81 e0 ldi r24, 0x01 ; 1 32ea2: 9f e9 ldi r25, 0x9F ; 159 32ea4: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHO(eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)); 32ea8: 85 ea ldi r24, 0xA5 ; 165 32eaa: 9d e0 ldi r25, 0x0D ; 13 32eac: 0f 94 a9 a0 call 0x34152 ; 0x34152 print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 32eb0: bc 01 movw r22, r24 32eb2: 90 e0 ldi r25, 0x00 ; 0 32eb4: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 32eb6: 4a e0 ldi r20, 0x0A ; 10 32eb8: 0f 94 eb 96 call 0x32dd6 ; 0x32dd6 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32ebc: 8d e5 ldi r24, 0x5D ; 93 32ebe: 0c 94 37 70 jmp 0xe06e ; 0xe06e 00032ec2 : void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); } void MarlinSerial::print(long n, int base) 32ec2: cf 92 push r12 32ec4: df 92 push r13 32ec6: ef 92 push r14 32ec8: ff 92 push r15 32eca: 6b 01 movw r12, r22 32ecc: 7c 01 movw r14, r24 { if (base == 0) { write(n); } else if (base == 10) { if (n < 0) { 32ece: f7 fe sbrs r15, 7 32ed0: 0b c0 rjmp .+22 ; 0x32ee8 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32ed2: 8d e2 ldi r24, 0x2D ; 45 32ed4: 0e 94 37 70 call 0xe06e ; 0xe06e } else if (base == 10) { if (n < 0) { print('-'); n = -n; 32ed8: f0 94 com r15 32eda: e0 94 com r14 32edc: d0 94 com r13 32ede: c0 94 com r12 32ee0: c1 1c adc r12, r1 32ee2: d1 1c adc r13, r1 32ee4: e1 1c adc r14, r1 32ee6: f1 1c adc r15, r1 } printNumber(n, 10); 32ee8: 4a e0 ldi r20, 0x0A ; 10 32eea: c7 01 movw r24, r14 32eec: b6 01 movw r22, r12 } else { printNumber(n, base); } } 32eee: ff 90 pop r15 32ef0: ef 90 pop r14 32ef2: df 90 pop r13 32ef4: cf 90 pop r12 } else if (base == 10) { if (n < 0) { print('-'); n = -n; } printNumber(n, 10); 32ef6: 0d 94 eb 96 jmp 0x32dd6 ; 0x32dd6 00032efa : SERIAL_ECHO(c); SERIAL_ECHO(']'); prusa_stat_farm_number(); } static void prusa_statistics_case0(uint8_t statnr) { 32efa: cf 93 push r28 32efc: c8 2f mov r28, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32efe: 8b e7 ldi r24, 0x7B ; 123 32f00: 0e 94 37 70 call 0xe06e ; 0xe06e SERIAL_ECHO('{'); prusa_stat_printerstatus(statnr); 32f04: 8c 2f mov r24, r28 32f06: 0f 94 5b 6c call 0x2d8b6 ; 0x2d8b6 prusa_stat_farm_number(); 32f0a: 0f 94 57 6c call 0x2d8ae ; 0x2d8ae SERIAL_ECHO(current_temperature_bed); SERIAL_ECHO(']'); } static void prusa_stat_printinfo() { SERIAL_ECHOPGM("[TFU:"); 32f0e: 8d ee ldi r24, 0xED ; 237 32f10: 9e e9 ldi r25, 0x9E ; 158 32f12: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 32f16: 60 91 84 06 lds r22, 0x0684 ; 0x800684 32f1a: 70 91 85 06 lds r23, 0x0685 ; 0x800685 32f1e: 80 91 86 06 lds r24, 0x0686 ; 0x800686 32f22: 90 91 87 06 lds r25, 0x0687 ; 0x800687 32f26: 4a e0 ldi r20, 0x0A ; 10 32f28: 0f 94 eb 96 call 0x32dd6 ; 0x32dd6 SERIAL_ECHO(total_filament_used); SERIAL_ECHOPGM("][PCD:"); 32f2c: 86 ee ldi r24, 0xE6 ; 230 32f2e: 9e e9 ldi r25, 0x9E ; 158 32f30: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 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;}; 32f34: 80 91 fd 15 lds r24, 0x15FD ; 0x8015fd 32f38: 88 23 and r24, r24 32f3a: 09 f4 brne .+2 ; 0x32f3e 32f3c: 5e c0 rjmp .+188 ; 0x32ffa 32f3e: 80 91 77 16 lds r24, 0x1677 ; 0x801677 32f42: 90 91 78 16 lds r25, 0x1678 ; 0x801678 32f46: a0 91 79 16 lds r26, 0x1679 ; 0x801679 32f4a: b0 91 7a 16 lds r27, 0x167A ; 0x80167a 32f4e: 00 97 sbiw r24, 0x00 ; 0 32f50: a1 05 cpc r26, r1 32f52: b1 05 cpc r27, r1 32f54: 09 f4 brne .+2 ; 0x32f58 32f56: 51 c0 rjmp .+162 ; 0x32ffa 32f58: bc 01 movw r22, r24 32f5a: cd 01 movw r24, r26 32f5c: 6d 59 subi r22, 0x9D ; 157 32f5e: 7f 4f sbci r23, 0xFF ; 255 32f60: 8f 4f sbci r24, 0xFF ; 255 32f62: 9f 4f sbci r25, 0xFF ; 255 32f64: 24 e6 ldi r18, 0x64 ; 100 32f66: 30 e0 ldi r19, 0x00 ; 0 32f68: 40 e0 ldi r20, 0x00 ; 0 32f6a: 50 e0 ldi r21, 0x00 ; 0 32f6c: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> 32f70: 60 91 7e 16 lds r22, 0x167E ; 0x80167e 32f74: 70 91 7f 16 lds r23, 0x167F ; 0x80167f 32f78: 80 91 80 16 lds r24, 0x1680 ; 0x801680 32f7c: 90 91 81 16 lds r25, 0x1681 ; 0x801681 32f80: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 32f84: 62 2f mov r22, r18 32f86: 70 e0 ldi r23, 0x00 ; 0 32f88: 90 e0 ldi r25, 0x00 ; 0 32f8a: 80 e0 ldi r24, 0x00 ; 0 32f8c: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_ECHO((int)card.percentDone()); SERIAL_ECHOPGM("][FEM:"); 32f90: 8f ed ldi r24, 0xDF ; 223 32f92: 9e e9 ldi r25, 0x9E ; 158 32f94: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 32f98: 60 91 8e 02 lds r22, 0x028E ; 0x80028e 32f9c: 70 91 8f 02 lds r23, 0x028F ; 0x80028f 32fa0: 07 2e mov r0, r23 32fa2: 00 0c add r0, r0 32fa4: 88 0b sbc r24, r24 32fa6: 99 0b sbc r25, r25 32fa8: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_ECHO(feedmultiply); SERIAL_ECHOPGM("][FNM:"); 32fac: 88 ed ldi r24, 0xD8 ; 216 32fae: 9e e9 ldi r25, 0x9E ; 158 32fb0: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHO(card.longFilename[0] ? card.longFilename : card.filename); 32fb4: 80 91 81 13 lds r24, 0x1381 ; 0x801381 32fb8: 81 11 cpse r24, r1 32fba: 21 c0 rjmp .+66 ; 0x32ffe 32fbc: 8c e6 ldi r24, 0x6C ; 108 32fbe: 93 e1 ldi r25, 0x13 ; 19 32fc0: 0e 94 a0 7c call 0xf940 ; 0xf940 SERIAL_ECHOPGM("][TIM:"); 32fc4: 81 ed ldi r24, 0xD1 ; 209 32fc6: 9e e9 ldi r25, 0x9E ; 158 32fc8: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 if (print_job_timer.isRunning()) { 32fcc: 80 91 59 03 lds r24, 0x0359 ; 0x800359 32fd0: 81 30 cpi r24, 0x01 ; 1 32fd2: c1 f4 brne .+48 ; 0x33004 SERIAL_ECHO(print_job_timer.duration()); 32fd4: 0f 94 f2 1c call 0x239e4 ; 0x239e4 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 32fd8: 4a e0 ldi r20, 0x0A ; 10 32fda: 0f 94 eb 96 call 0x32dd6 ; 0x32dd6 } else { SERIAL_ECHO(0); } SERIAL_ECHOPGM("][FWR:"); 32fde: 8a ec ldi r24, 0xCA ; 202 32fe0: 9e e9 ldi r25, 0x9E ; 158 32fe2: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 SERIAL_ECHORPGM(FW_VERSION_STR_P()); 32fe6: 83 ec ldi r24, 0xC3 ; 195 32fe8: 9e e9 ldi r25, 0x9E ; 158 32fea: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 32fee: 8d e5 ldi r24, 0x5D ; 93 32ff0: 0e 94 37 70 call 0xe06e ; 0xe06e static void prusa_statistics_case0(uint8_t statnr) { SERIAL_ECHO('{'); prusa_stat_printerstatus(statnr); prusa_stat_farm_number(); prusa_stat_printinfo(); } 32ff4: cf 91 pop r28 SERIAL_ECHO(0); } SERIAL_ECHOPGM("][FWR:"); SERIAL_ECHORPGM(FW_VERSION_STR_P()); SERIAL_ECHO(']'); prusa_stat_diameter(); 32ff6: 0d 94 50 97 jmp 0x32ea0 ; 0x32ea0 32ffa: 20 e0 ldi r18, 0x00 ; 0 32ffc: c3 cf rjmp .-122 ; 0x32f84 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); 32ffe: 81 e8 ldi r24, 0x81 ; 129 33000: 93 e1 ldi r25, 0x13 ; 19 33002: de cf rjmp .-68 ; 0x32fc0 33004: 60 e0 ldi r22, 0x00 ; 0 33006: 70 e0 ldi r23, 0x00 ; 0 33008: cb 01 movw r24, r22 3300a: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 3300e: e7 cf rjmp .-50 ; 0x32fde 00033010 : '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); } void MarlinSerial::printFloat(double number, uint8_t digits) { 33010: 8f 92 push r8 33012: 9f 92 push r9 33014: af 92 push r10 33016: bf 92 push r11 33018: cf 92 push r12 3301a: df 92 push r13 3301c: ef 92 push r14 3301e: ff 92 push r15 33020: cf 93 push r28 33022: 6b 01 movw r12, r22 33024: 7c 01 movw r14, r24 33026: b4 2e mov r11, r20 // Handle negative numbers if (number < 0.0) 33028: 20 e0 ldi r18, 0x00 ; 0 3302a: 30 e0 ldi r19, 0x00 ; 0 3302c: a9 01 movw r20, r18 3302e: 0f 94 b8 a2 call 0x34570 ; 0x34570 <__cmpsf2> 33032: 87 ff sbrs r24, 7 33034: 07 c0 rjmp .+14 ; 0x33044 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 33036: 8d e2 ldi r24, 0x2D ; 45 33038: 0e 94 37 70 call 0xe06e ; 0xe06e { // Handle negative numbers if (number < 0.0) { print('-'); number = -number; 3303c: f7 fa bst r15, 7 3303e: f0 94 com r15 33040: f7 f8 bld r15, 7 33042: 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; 33052: 20 e0 ldi r18, 0x00 ; 0 33054: 30 e0 ldi r19, 0x00 ; 0 33056: 40 e2 ldi r20, 0x20 ; 32 33058: 51 e4 ldi r21, 0x41 ; 65 3305a: 0f 94 c2 a2 call 0x34584 ; 0x34584 <__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; 33062: 9b 01 movw r18, r22 33064: ac 01 movw r20, r24 33066: c7 01 movw r24, r14 33068: b6 01 movw r22, r12 3306a: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 3306e: 6b 01 movw r12, r22 33070: 7c 01 movw r14, r24 // Extract the integer part of the number and print it unsigned long int_part = (unsigned long)number; 33072: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 33076: 4b 01 movw r8, r22 33078: 5c 01 movw r10, r24 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 3307a: 4a e0 ldi r20, 0x0A ; 10 3307c: 0f 94 eb 96 call 0x32dd6 ; 0x32dd6 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) 33080: cc 23 and r28, r28 33082: 91 f1 breq .+100 ; 0x330e8 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; 33084: c5 01 movw r24, r10 33086: b4 01 movw r22, r8 33088: 0f 94 27 9b call 0x3364e ; 0x3364e <__floatunsisf> 3308c: 9b 01 movw r18, r22 3308e: ac 01 movw r20, r24 33090: c7 01 movw r24, r14 33092: b6 01 movw r22, r12 33094: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 33098: 6b 01 movw r12, r22 3309a: 7c 01 movw r14, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3309c: 8e e2 ldi r24, 0x2E ; 46 3309e: 0e 94 37 70 call 0xe06e ; 0xe06e // 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) 330a2: c1 50 subi r28, 0x01 ; 1 330a4: 08 f1 brcs .+66 ; 0x330e8 { remainder *= 10.0; 330a6: 20 e0 ldi r18, 0x00 ; 0 330a8: 30 e0 ldi r19, 0x00 ; 0 330aa: 40 e2 ldi r20, 0x20 ; 32 330ac: 51 e4 ldi r21, 0x41 ; 65 330ae: c7 01 movw r24, r14 330b0: b6 01 movw r22, r12 330b2: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 330b6: 4b 01 movw r8, r22 330b8: 5c 01 movw r10, r24 int toPrint = int(remainder); 330ba: 0f 94 34 a3 call 0x34668 ; 0x34668 <__fixsfsi> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 330be: 6b 01 movw r12, r22 330c0: 77 0f add r23, r23 330c2: ee 08 sbc r14, r14 330c4: ff 08 sbc r15, r15 330c6: c7 01 movw r24, r14 330c8: b6 01 movw r22, r12 330ca: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 while (digits-- > 0) { remainder *= 10.0; int toPrint = int(remainder); print(toPrint); remainder -= toPrint; 330ce: c7 01 movw r24, r14 330d0: b6 01 movw r22, r12 330d2: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 330d6: 9b 01 movw r18, r22 330d8: ac 01 movw r20, r24 330da: c5 01 movw r24, r10 330dc: b4 01 movw r22, r8 330de: 0f 94 c2 a1 call 0x34384 ; 0x34384 <__subsf3> 330e2: 6b 01 movw r12, r22 330e4: 7c 01 movw r14, r24 330e6: dd cf rjmp .-70 ; 0x330a2 } } 330e8: cf 91 pop r28 330ea: ff 90 pop r15 330ec: ef 90 pop r14 330ee: df 90 pop r13 330f0: cf 90 pop r12 330f2: bf 90 pop r11 330f4: af 90 pop r10 330f6: 9f 90 pop r9 330f8: 8f 90 pop r8 330fa: 08 95 ret 000330fc : SERIAL_ECHO(eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)); SERIAL_ECHO(']'); } static void prusa_stat_temperatures() { SERIAL_ECHOPGM("[ST0:"); 330fc: 8c e1 ldi r24, 0x1C ; 28 330fe: 9f e9 ldi r25, 0x9F ; 159 33100: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 33104: 60 91 f1 11 lds r22, 0x11F1 ; 0x8011f1 33108: 70 91 f2 11 lds r23, 0x11F2 ; 0x8011f2 3310c: 07 2e mov r0, r23 3310e: 00 0c add r0, r0 33110: 88 0b sbc r24, r24 33112: 99 0b sbc r25, r25 33114: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_ECHO(target_temperature[0]); SERIAL_ECHOPGM("][STB:"); 33118: 85 e1 ldi r24, 0x15 ; 21 3311a: 9f e9 ldi r25, 0x9F ; 159 3311c: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 33120: 60 91 ed 11 lds r22, 0x11ED ; 0x8011ed 33124: 70 91 ee 11 lds r23, 0x11EE ; 0x8011ee 33128: 07 2e mov r0, r23 3312a: 00 0c add r0, r0 3312c: 88 0b sbc r24, r24 3312e: 99 0b sbc r25, r25 33130: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 SERIAL_ECHO(target_temperature_bed); SERIAL_ECHOPGM("][AT0:"); 33134: 8e e0 ldi r24, 0x0E ; 14 33136: 9f e9 ldi r25, 0x9F ; 159 33138: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 3313c: 60 91 c4 0d lds r22, 0x0DC4 ; 0x800dc4 33140: 70 91 c5 0d lds r23, 0x0DC5 ; 0x800dc5 33144: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 33148: 90 91 c7 0d lds r25, 0x0DC7 ; 0x800dc7 3314c: 42 e0 ldi r20, 0x02 ; 2 3314e: 0f 94 08 98 call 0x33010 ; 0x33010 SERIAL_ECHO(current_temperature[0]); SERIAL_ECHOPGM("][ATB:"); 33152: 87 e0 ldi r24, 0x07 ; 7 33154: 9f e9 ldi r25, 0x9F ; 159 33156: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 3315a: 60 91 8a 03 lds r22, 0x038A ; 0x80038a 3315e: 70 91 8b 03 lds r23, 0x038B ; 0x80038b 33162: 80 91 8c 03 lds r24, 0x038C ; 0x80038c 33166: 90 91 8d 03 lds r25, 0x038D ; 0x80038d 3316a: 42 e0 ldi r20, 0x02 ; 2 3316c: 0f 94 08 98 call 0x33010 ; 0x33010 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 33170: 8d e5 ldi r24, 0x5D ; 93 33172: 0c 94 37 70 jmp 0xe06e ; 0xe06e 00033176 : 33176: 8a e0 ldi r24, 0x0A ; 10 33178: 0c 94 37 70 jmp 0xe06e ; 0xe06e 0003317c : } } #endif //PRUSA_M28 void prusa_statistics(uint8_t _message) { 3317c: cf 93 push r28 const uint8_t _fil_nr = 0; if (!farm_mode) 3317e: 90 91 ca 0d lds r25, 0x0DCA ; 0x800dca 33182: 99 23 and r25, r25 33184: 09 f4 brne .+2 ; 0x33188 33186: f6 c0 rjmp .+492 ; 0x33374 33188: c8 2f mov r28, r24 return; switch (_message) { 3318a: 87 30 cpi r24, 0x07 ; 7 3318c: 09 f4 brne .+2 ; 0x33190 3318e: be c0 rjmp .+380 ; 0x3330c 33190: 08 f0 brcs .+2 ; 0x33194 33192: 46 c0 rjmp .+140 ; 0x33220 33194: 83 30 cpi r24, 0x03 ; 3 33196: 09 f4 brne .+2 ; 0x3319a 33198: ed c0 rjmp .+474 ; 0x33374 3319a: 80 f5 brcc .+96 ; 0x331fc 3319c: 81 30 cpi r24, 0x01 ; 1 3319e: 09 f4 brne .+2 ; 0x331a2 331a0: 88 c0 rjmp .+272 ; 0x332b2 331a2: 08 f4 brcc .+2 ; 0x331a6 331a4: 60 c0 rjmp .+192 ; 0x33266 331a6: 8b e7 ldi r24, 0x7B ; 123 331a8: 0e 94 37 70 call 0xe06e ; 0xe06e farm_timer = 1; break; case 2: // heating done SERIAL_ECHO('{'); prusa_stat_printerstatus(3); 331ac: 83 e0 ldi r24, 0x03 ; 3 331ae: 0f 94 5b 6c call 0x2d8b6 ; 0x2d8b6 prusa_stat_farm_number(); 331b2: 0f 94 57 6c call 0x2d8ae ; 0x2d8ae 331b6: 8d e7 ldi r24, 0x7D ; 125 331b8: 0e 94 37 70 call 0xe06e ; 0xe06e } void MarlinSerial::println(char c, int base) { print(c, base); println(); 331bc: 0f 94 bb 98 call 0x33176 ; 0x33176 SERIAL_ECHOLN('}'); status_number = 3; 331c0: c3 e0 ldi r28, 0x03 ; 3 331c2: c0 93 f7 16 sts 0x16F7, r28 ; 0x8016f7 <_ZL13status_number.lto_priv.496> farm_timer = 1; 331c6: 81 e0 ldi r24, 0x01 ; 1 331c8: 80 93 76 02 sts 0x0276, r24 ; 0x800276 <_ZL10farm_timer.lto_priv.447> if (IS_SD_PRINTING || (eFilamentAction != FilamentAction::None)) { 331cc: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 331d0: 81 11 cpse r24, r1 331d2: 05 c0 rjmp .+10 ; 0x331de 331d4: 80 91 62 03 lds r24, 0x0362 ; 0x800362 331d8: 88 23 and r24, r24 331da: 09 f4 brne .+2 ; 0x331de 331dc: 78 c0 rjmp .+240 ; 0x332ce } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 331de: 8b e7 ldi r24, 0x7B ; 123 331e0: 0e 94 37 70 call 0xe06e ; 0xe06e SERIAL_ECHO('{'); prusa_stat_printerstatus(4); 331e4: 84 e0 ldi r24, 0x04 ; 4 331e6: 0f 94 5b 6c call 0x2d8b6 ; 0x2d8b6 prusa_stat_farm_number(); 331ea: 0f 94 57 6c call 0x2d8ae ; 0x2d8ae status_number = 4; 331ee: 84 e0 ldi r24, 0x04 ; 4 331f0: 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; 331f4: 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; 331f6: 80 93 76 02 sts 0x0276, r24 ; 0x800276 <_ZL10farm_timer.lto_priv.447> 331fa: 1e c0 rjmp .+60 ; 0x33238 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 331fc: 85 30 cpi r24, 0x05 ; 5 331fe: 09 f4 brne .+2 ; 0x33202 33200: 71 c0 rjmp .+226 ; 0x332e4 // 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:"); 33202: 84 e5 ldi r24, 0x54 ; 84 33204: 9f e9 ldi r25, 0x9F ; 159 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 33206: c6 30 cpi r28, 0x06 ; 6 33208: 08 f4 brcc .+2 ; 0x3320c 3320a: 6e c0 rjmp .+220 ; 0x332e8 prusa_stat_printerstatus(status_number); prusa_stat_farm_number(); farm_timer = 2; break; case 6: // print done SERIAL_ECHOPGM("{[PRN:8]"); 3320c: 8d e3 ldi r24, 0x3D ; 61 3320e: 9f e9 ldi r25, 0x9F ; 159 33210: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 prusa_stat_farm_number(); 33214: 0f 94 57 6c call 0x2d8ae ; 0x2d8ae status_number = 8; 33218: 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; 3321a: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 <_ZL13status_number.lto_priv.496> 3321e: 74 c0 rjmp .+232 ; 0x33308 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 33220: 86 31 cpi r24, 0x16 ; 22 33222: 09 f4 brne .+2 ; 0x33226 33224: 9b c0 rjmp .+310 ; 0x3335c 33226: 70 f4 brcc .+28 ; 0x33244 33228: 84 31 cpi r24, 0x14 ; 20 3322a: 09 f4 brne .+2 ; 0x3322e 3322c: 80 c0 rjmp .+256 ; 0x3332e 3322e: 08 f0 brcs .+2 ; 0x33232 33230: 89 c0 rjmp .+274 ; 0x33344 33232: 88 30 cpi r24, 0x08 ; 8 33234: 09 f4 brne .+2 ; 0x33238 33236: 72 c0 rjmp .+228 ; 0x3331c 33238: 8d e7 ldi r24, 0x7D ; 125 3323a: 0e 94 37 70 call 0xe06e ; 0xe06e prusa_stat_temperatures(); prusa_stat_farm_number(); break; } SERIAL_ECHOLN('}'); } 3323e: cf 91 pop r28 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 33240: 0d 94 bb 98 jmp 0x33176 ; 0x33176 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 33244: 8b 35 cpi r24, 0x5B ; 91 33246: 09 f4 brne .+2 ; 0x3324a 33248: 91 c0 rjmp .+290 ; 0x3336c 3324a: 30 f4 brcc .+12 ; 0x33258 prusa_stat_farm_number(); status_number = 5; break; case 90: // Error - Thermal Runaway prusa_statistics_err('1'); 3324c: 81 e3 ldi r24, 0x31 ; 49 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 3324e: ca 35 cpi r28, 0x5A ; 90 33250: 99 f7 brne .-26 ; 0x33238 break; case 92: // Error - Min temp prusa_statistics_err('3'); break; case 93: // Error - Max temp prusa_statistics_err('4'); 33252: 0f 94 68 6c call 0x2d8d0 ; 0x2d8d0 33256: f0 cf rjmp .-32 ; 0x33238 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 33258: 8c 35 cpi r24, 0x5C ; 92 3325a: 09 f4 brne .+2 ; 0x3325e 3325c: 89 c0 rjmp .+274 ; 0x33370 break; case 92: // Error - Min temp prusa_statistics_err('3'); break; case 93: // Error - Max temp prusa_statistics_err('4'); 3325e: 84 e3 ldi r24, 0x34 ; 52 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 33260: cd 35 cpi r28, 0x5D ; 93 33262: b9 f3 breq .-18 ; 0x33252 33264: e9 cf rjmp .-46 ; 0x33238 case 0: // default message if (busy_state == PAUSED_FOR_USER) { 33266: 80 91 78 02 lds r24, 0x0278 ; 0x800278 3326a: 84 30 cpi r24, 0x04 ; 4 3326c: 21 f4 brne .+8 ; 0x33276 prusa_statistics_case0(15); 3326e: 8f e0 ldi r24, 0x0F ; 15 } else if (printingIsPaused()) { prusa_statistics_case0(14); 33270: 0f 94 7d 97 call 0x32efa ; 0x32efa 33274: e1 cf rjmp .-62 ; 0x33238 switch (_message) { case 0: // default message if (busy_state == PAUSED_FOR_USER) { prusa_statistics_case0(15); } else if (printingIsPaused()) { 33276: 0e 94 b3 60 call 0xc166 ; 0xc166 3327a: 88 23 and r24, r24 3327c: 11 f0 breq .+4 ; 0x33282 prusa_statistics_case0(14); 3327e: 8e e0 ldi r24, 0x0E ; 14 33280: f7 cf rjmp .-18 ; 0x33270 } else if (IS_SD_PRINTING || (eFilamentAction != FilamentAction::None)) { 33282: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 33286: 81 11 cpse r24, r1 33288: 04 c0 rjmp .+8 ; 0x33292 3328a: 80 91 62 03 lds r24, 0x0362 ; 0x800362 3328e: 88 23 and r24, r24 33290: 11 f0 breq .+4 ; 0x33296 prusa_statistics_case0(4); 33292: 84 e0 ldi r24, 0x04 ; 4 33294: ed cf rjmp .-38 ; 0x33270 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 33296: 8b e7 ldi r24, 0x7B ; 123 33298: 0e 94 37 70 call 0xe06e ; 0xe06e } else { SERIAL_ECHO('{'); prusa_stat_printerstatus(1); 3329c: 81 e0 ldi r24, 0x01 ; 1 3329e: 0f 94 5b 6c call 0x2d8b6 ; 0x2d8b6 prusa_stat_farm_number(); 332a2: 0f 94 57 6c call 0x2d8ae ; 0x2d8ae prusa_stat_diameter(); 332a6: 0f 94 50 97 call 0x32ea0 ; 0x32ea0 status_number = 1; 332aa: 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; 332ac: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 <_ZL13status_number.lto_priv.496> 332b0: c3 cf rjmp .-122 ; 0x33238 332b2: 8b e7 ldi r24, 0x7B ; 123 332b4: 0e 94 37 70 call 0xe06e ; 0xe06e } break; case 1: // 1 heating SERIAL_ECHO('{'); prusa_stat_printerstatus(2); 332b8: 82 e0 ldi r24, 0x02 ; 2 332ba: 0f 94 5b 6c call 0x2d8b6 ; 0x2d8b6 prusa_stat_farm_number(); 332be: 0f 94 57 6c call 0x2d8ae ; 0x2d8ae status_number = 2; 332c2: 82 e0 ldi r24, 0x02 ; 2 332c4: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 <_ZL13status_number.lto_priv.496> farm_timer = 1; 332c8: c0 93 76 02 sts 0x0276, r28 ; 0x800276 <_ZL10farm_timer.lto_priv.447> 332cc: b5 cf rjmp .-150 ; 0x33238 332ce: 8b e7 ldi r24, 0x7B ; 123 332d0: 0e 94 37 70 call 0xe06e ; 0xe06e prusa_stat_farm_number(); status_number = 4; } else { SERIAL_ECHO('{'); prusa_stat_printerstatus(3); 332d4: 83 e0 ldi r24, 0x03 ; 3 332d6: 0f 94 5b 6c call 0x2d8b6 ; 0x2d8b6 prusa_stat_farm_number(); 332da: 0f 94 57 6c call 0x2d8ae ; 0x2d8ae status_number = 3; 332de: c0 93 f7 16 sts 0x16F7, r28 ; 0x8016f7 <_ZL13status_number.lto_priv.496> 332e2: 88 cf rjmp .-240 ; 0x331f4 prusa_stat_printerstatus(status_number); prusa_stat_farm_number(); farm_timer = 2; break; case 5: // print not succesfull SERIAL_ECHOPGM("{[RES:0][FIL:"); 332e4: 86 e4 ldi r24, 0x46 ; 70 332e6: 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:"); 332e8: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 332ec: 60 e0 ldi r22, 0x00 ; 0 332ee: 70 e0 ldi r23, 0x00 ; 0 332f0: cb 01 movw r24, r22 332f2: 0f 94 61 97 call 0x32ec2 ; 0x32ec2 332f6: 8d e5 ldi r24, 0x5D ; 93 332f8: 0e 94 37 70 call 0xe06e ; 0xe06e MYSERIAL.print(int(_fil_nr)); SERIAL_ECHO(']'); prusa_stat_printerstatus(status_number); 332fc: 80 91 f7 16 lds r24, 0x16F7 ; 0x8016f7 <_ZL13status_number.lto_priv.496> 33300: 0f 94 5b 6c call 0x2d8b6 ; 0x2d8b6 prusa_stat_farm_number(); 33304: 0f 94 57 6c call 0x2d8ae ; 0x2d8ae farm_timer = 2; 33308: 82 e0 ldi r24, 0x02 ; 2 3330a: 75 cf rjmp .-278 ; 0x331f6 prusa_stat_farm_number(); status_number = 8; farm_timer = 2; break; case 7: // print done - stopped SERIAL_ECHOPGM("{[PRN:9]"); 3330c: 84 e3 ldi r24, 0x34 ; 52 3330e: 9f e9 ldi r25, 0x9F ; 159 33310: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 prusa_stat_farm_number(); 33314: 0f 94 57 6c call 0x2d8ae ; 0x2d8ae status_number = 9; 33318: 89 e0 ldi r24, 0x09 ; 9 3331a: 7f cf rjmp .-258 ; 0x3321a farm_timer = 2; break; case 8: // printer started SERIAL_ECHOPGM("{[PRN:0]"); 3331c: 8b e2 ldi r24, 0x2B ; 43 3331e: 9f e9 ldi r25, 0x9F ; 159 33320: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 prusa_stat_farm_number(); 33324: 0f 94 57 6c call 0x2d8ae ; 0x2d8ae status_number = 0; 33328: 10 92 f7 16 sts 0x16F7, r1 ; 0x8016f7 <_ZL13status_number.lto_priv.496> 3332c: ed cf rjmp .-38 ; 0x33308 3332e: 8b e7 ldi r24, 0x7B ; 123 33330: 0e 94 37 70 call 0xe06e ; 0xe06e farm_timer = 2; break; case 20: // echo farm no SERIAL_ECHO('{'); prusa_stat_printerstatus(status_number); 33334: 80 91 f7 16 lds r24, 0x16F7 ; 0x8016f7 <_ZL13status_number.lto_priv.496> 33338: 0f 94 5b 6c call 0x2d8b6 ; 0x2d8b6 prusa_stat_farm_number(); 3333c: 0f 94 57 6c call 0x2d8ae ; 0x2d8ae farm_timer = 4; 33340: 84 e0 ldi r24, 0x04 ; 4 33342: 59 cf rjmp .-334 ; 0x331f6 33344: 8b e7 ldi r24, 0x7B ; 123 33346: 0e 94 37 70 call 0xe06e ; 0xe06e break; case 21: // temperatures SERIAL_ECHO('{'); prusa_stat_temperatures(); 3334a: 0f 94 7e 98 call 0x330fc ; 0x330fc prusa_stat_farm_number(); 3334e: 0f 94 57 6c call 0x2d8ae ; 0x2d8ae prusa_stat_printerstatus(status_number); 33352: 80 91 f7 16 lds r24, 0x16F7 ; 0x8016f7 <_ZL13status_number.lto_priv.496> 33356: 0f 94 5b 6c call 0x2d8b6 ; 0x2d8b6 3335a: 6e cf rjmp .-292 ; 0x33238 break; case 22: // waiting for filament change SERIAL_ECHOPGM("{[PRN:5]"); 3335c: 82 e2 ldi r24, 0x22 ; 34 3335e: 9f e9 ldi r25, 0x9F ; 159 33360: 0e 94 50 70 call 0xe0a0 ; 0xe0a0 prusa_stat_farm_number(); 33364: 0f 94 57 6c call 0x2d8ae ; 0x2d8ae status_number = 5; 33368: 85 e0 ldi r24, 0x05 ; 5 3336a: a0 cf rjmp .-192 ; 0x332ac case 90: // Error - Thermal Runaway prusa_statistics_err('1'); break; case 91: // Error - Thermal Runaway Preheat prusa_statistics_err('2'); 3336c: 82 e3 ldi r24, 0x32 ; 50 3336e: 71 cf rjmp .-286 ; 0x33252 break; case 92: // Error - Min temp prusa_statistics_err('3'); 33370: 83 e3 ldi r24, 0x33 ; 51 33372: 6f cf rjmp .-290 ; 0x33252 prusa_stat_temperatures(); prusa_stat_farm_number(); break; } SERIAL_ECHOLN('}'); } 33374: cf 91 pop r28 33376: 08 95 ret 00033378 : 33378: 0e 94 a0 7c call 0xf940 ; 0xf940 }*/ void MarlinSerial::println(const char c[]) { print(c); println(); 3337c: 0d 94 bb 98 jmp 0x33176 ; 0x33176 00033380 <__vector_36>: #endif //DEBUG_DUMP_TO_2ND_SERIAL } } ISR(USART1_RX_vect) { 33380: 1f 92 push r1 33382: 0f 92 push r0 33384: 0f b6 in r0, 0x3f ; 63 33386: 0f 92 push r0 33388: 11 24 eor r1, r1 3338a: 0b b6 in r0, 0x3b ; 59 3338c: 0f 92 push r0 3338e: 2f 93 push r18 33390: 3f 93 push r19 33392: 4f 93 push r20 33394: 6f 93 push r22 33396: 7f 93 push r23 33398: 8f 93 push r24 3339a: 9f 93 push r25 3339c: ef 93 push r30 3339e: ff 93 push r31 // Test for a framing error. if (UCSR1A & (1< 333a4: 84 ff sbrs r24, 4 333a6: 12 c0 rjmp .+36 ; 0x333cc <__vector_36+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)UDR1); 333a8: 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 } } 333ac: ff 91 pop r31 333ae: ef 91 pop r30 333b0: 9f 91 pop r25 333b2: 8f 91 pop r24 333b4: 7f 91 pop r23 333b6: 6f 91 pop r22 333b8: 4f 91 pop r20 333ba: 3f 91 pop r19 333bc: 2f 91 pop r18 333be: 0f 90 pop r0 333c0: 0b be out 0x3b, r0 ; 59 333c2: 0f 90 pop r0 333c4: 0f be out 0x3f, r0 ; 63 333c6: 0f 90 pop r0 333c8: 1f 90 pop r1 333ca: 18 95 reti (void)(*(char *)UDR1); } else { // Read the input register. unsigned char c = UDR1; 333cc: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> if (selectedSerialPort == 1) 333d0: 80 91 04 05 lds r24, 0x0504 ; 0x800504 333d4: 81 30 cpi r24, 0x01 ; 1 333d6: 51 f7 brne .-44 ; 0x333ac <__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; 333d8: 20 91 af 05 lds r18, 0x05AF ; 0x8005af 333dc: 30 91 b0 05 lds r19, 0x05B0 ; 0x8005b0 333e0: c9 01 movw r24, r18 333e2: 01 96 adiw r24, 0x01 ; 1 333e4: 8f 77 andi r24, 0x7F ; 127 333e6: 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) { 333e8: 60 91 b1 05 lds r22, 0x05B1 ; 0x8005b1 333ec: 70 91 b2 05 lds r23, 0x05B2 ; 0x8005b2 333f0: 86 17 cp r24, r22 333f2: 97 07 cpc r25, r23 333f4: d9 f2 breq .-74 ; 0x333ac <__vector_36+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 333f6: 21 5d subi r18, 0xD1 ; 209 333f8: 3a 4f sbci r19, 0xFA ; 250 333fa: f9 01 movw r30, r18 333fc: 40 83 st Z, r20 rx_buffer.head = i; 333fe: 90 93 b0 05 sts 0x05B0, r25 ; 0x8005b0 33402: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af 33406: d2 cf rjmp .-92 ; 0x333ac <__vector_36+0x2c> 00033408 <__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) { 33408: 1f 92 push r1 3340a: 0f 92 push r0 3340c: 0f b6 in r0, 0x3f ; 63 3340e: 0f 92 push r0 33410: 11 24 eor r1, r1 33412: 0b b6 in r0, 0x3b ; 59 33414: 0f 92 push r0 33416: 2f 93 push r18 33418: 3f 93 push r19 3341a: 4f 93 push r20 3341c: 6f 93 push r22 3341e: 7f 93 push r23 33420: 8f 93 push r24 33422: 9f 93 push r25 33424: ef 93 push r30 33426: ff 93 push r31 // Test for a framing error. if (M_UCSRxA & (1< 3342c: 84 ff sbrs r24, 4 3342e: 12 c0 rjmp .+36 ; 0x33454 <__vector_25+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)M_UDRx); 33430: 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 } } 33434: ff 91 pop r31 33436: ef 91 pop r30 33438: 9f 91 pop r25 3343a: 8f 91 pop r24 3343c: 7f 91 pop r23 3343e: 6f 91 pop r22 33440: 4f 91 pop r20 33442: 3f 91 pop r19 33444: 2f 91 pop r18 33446: 0f 90 pop r0 33448: 0b be out 0x3b, r0 ; 59 3344a: 0f 90 pop r0 3344c: 0f be out 0x3f, r0 ; 63 3344e: 0f 90 pop r0 33450: 1f 90 pop r1 33452: 18 95 reti (void)(*(char *)M_UDRx); } else { // Read the input register. unsigned char c = M_UDRx; 33454: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> if (selectedSerialPort == 0) 33458: 80 91 04 05 lds r24, 0x0504 ; 0x800504 3345c: 81 11 cpse r24, r1 3345e: ea cf rjmp .-44 ; 0x33434 <__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; 33460: 20 91 af 05 lds r18, 0x05AF ; 0x8005af 33464: 30 91 b0 05 lds r19, 0x05B0 ; 0x8005b0 33468: c9 01 movw r24, r18 3346a: 01 96 adiw r24, 0x01 ; 1 3346c: 8f 77 andi r24, 0x7F ; 127 3346e: 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) { 33470: 60 91 b1 05 lds r22, 0x05B1 ; 0x8005b1 33474: 70 91 b2 05 lds r23, 0x05B2 ; 0x8005b2 33478: 86 17 cp r24, r22 3347a: 97 07 cpc r25, r23 3347c: d9 f2 breq .-74 ; 0x33434 <__vector_25+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 3347e: 21 5d subi r18, 0xD1 ; 209 33480: 3a 4f sbci r19, 0xFA ; 250 33482: f9 01 movw r30, r18 33484: 40 83 st Z, r20 rx_buffer.head = i; 33486: 90 93 b0 05 sts 0x05B0, r25 ; 0x8005b0 3348a: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af 3348e: d2 cf rjmp .-92 ; 0x33434 <__vector_25+0x2c> 00033490 : * 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) { 33490: 2f 92 push r2 33492: 3f 92 push r3 33494: 4f 92 push r4 33496: 5f 92 push r5 33498: 6f 92 push r6 3349a: 7f 92 push r7 3349c: 8f 92 push r8 3349e: 9f 92 push r9 334a0: af 92 push r10 334a2: bf 92 push r11 334a4: cf 92 push r12 334a6: df 92 push r13 334a8: ef 92 push r14 334aa: ff 92 push r15 334ac: 0f 93 push r16 334ae: 1f 93 push r17 334b0: cf 93 push r28 334b2: df 93 push r29 334b4: cd b7 in r28, 0x3d ; 61 334b6: de b7 in r29, 0x3e ; 62 334b8: c2 54 subi r28, 0x42 ; 66 334ba: d1 09 sbc r29, r1 334bc: 0f b6 in r0, 0x3f ; 63 334be: f8 94 cli 334c0: de bf out 0x3e, r29 ; 62 334c2: 0f be out 0x3f, r0 ; 63 334c4: cd bf out 0x3d, r28 ; 61 334c6: 4c 01 movw r8, r24 334c8: 5b 01 movw r10, r22 334ca: 6a 01 movw r12, r20 334cc: 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) {} 334ce: 19 82 std Y+1, r1 ; 0x01 334d0: 1c 82 std Y+4, r1 ; 0x04 334d2: 1c 8e std Y+28, r1 ; 0x1c 334d4: 1f 8e std Y+31, r1 ; 0x1f uint8_t dname[11]; SdBaseFile dir1, dir2; SdBaseFile *parent = dirFile; SdBaseFile *sub = &dir1; if (!dirFile) goto fail; 334d6: 67 2b or r22, r23 334d8: 21 f5 brne .+72 ; 0x33522 sub = parent != &dir1 ? &dir1 : &dir2; } return open(parent, dname, oflag); fail: return false; 334da: 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; 334dc: ce 01 movw r24, r28 334de: 4c 96 adiw r24, 0x1c ; 28 334e0: 0e 94 31 70 call 0xe062 ; 0xe062 334e4: ce 01 movw r24, r28 334e6: 01 96 adiw r24, 0x01 ; 1 334e8: 0e 94 31 70 call 0xe062 ; 0xe062 } return open(parent, dname, oflag); fail: return false; } 334ec: 81 2f mov r24, r17 334ee: ce 5b subi r28, 0xBE ; 190 334f0: df 4f sbci r29, 0xFF ; 255 334f2: 0f b6 in r0, 0x3f ; 63 334f4: f8 94 cli 334f6: de bf out 0x3e, r29 ; 62 334f8: 0f be out 0x3f, r0 ; 63 334fa: cd bf out 0x3d, r28 ; 61 334fc: df 91 pop r29 334fe: cf 91 pop r28 33500: 1f 91 pop r17 33502: 0f 91 pop r16 33504: ff 90 pop r15 33506: ef 90 pop r14 33508: df 90 pop r13 3350a: cf 90 pop r12 3350c: bf 90 pop r11 3350e: af 90 pop r10 33510: 9f 90 pop r9 33512: 8f 90 pop r8 33514: 7f 90 pop r7 33516: 6f 90 pop r6 33518: 5f 90 pop r5 3351a: 4f 90 pop r4 3351c: 3f 90 pop r3 3351e: 2f 90 pop r2 33520: 08 95 ret SdBaseFile *sub = &dir1; if (!dirFile) goto fail; // error if already open if (isOpen()) goto fail; 33522: fc 01 movw r30, r24 33524: 83 81 ldd r24, Z+3 ; 0x03 33526: 81 11 cpse r24, r1 33528: d8 cf rjmp .-80 ; 0x334da if (*path == '/') { 3352a: fa 01 movw r30, r20 3352c: 80 81 ld r24, Z 3352e: 8f 32 cpi r24, 0x2F ; 47 33530: c1 f4 brne .+48 ; 0x33562 33532: ca 01 movw r24, r20 33534: 6c 01 movw r12, r24 33536: 01 96 adiw r24, 0x01 ; 1 while (*path == '/') path++; 33538: f6 01 movw r30, r12 3353a: 20 81 ld r18, Z 3353c: 2f 32 cpi r18, 0x2F ; 47 3353e: d1 f3 breq .-12 ; 0x33534 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; 33540: f5 01 movw r30, r10 33542: 83 81 ldd r24, Z+3 ; 0x03 33544: 82 50 subi r24, 0x02 ; 2 if (!dirFile->isRoot()) { 33546: 82 30 cpi r24, 0x02 ; 2 33548: 60 f0 brcs .+24 ; 0x33562 if (!dir2.openRoot(dirFile->vol_)) goto fail; 3354a: 61 8d ldd r22, Z+25 ; 0x19 3354c: 72 8d ldd r23, Z+26 ; 0x1a 3354e: ce 01 movw r24, r28 33550: 4c 96 adiw r24, 0x1c ; 28 33552: 0f 94 01 6f call 0x2de02 ; 0x2de02 parent = &dir2; 33556: 8e 01 movw r16, r28 33558: 04 5e subi r16, 0xE4 ; 228 3355a: 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; 3355c: 81 11 cpse r24, r1 3355e: 02 c0 rjmp .+4 ; 0x33564 33560: bc cf rjmp .-136 ; 0x334da // error if already open if (isOpen()) goto fail; if (*path == '/') { while (*path == '/') path++; if (!dirFile->isRoot()) { 33562: 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; 33564: ce 01 movw r24, r28 33566: 01 96 adiw r24, 0x01 ; 1 33568: 7c 01 movw r14, r24 3356a: 3c 01 movw r6, r24 3356c: 2e 01 movw r4, r28 3356e: 9c e1 ldi r25, 0x1C ; 28 33570: 49 0e add r4, r25 33572: 51 1c adc r5, r1 33574: 23 96 adiw r28, 0x03 ; 3 33576: ef ae std Y+63, r14 ; 0x3f 33578: 23 97 sbiw r28, 0x03 ; 3 3357a: 2f 2c mov r2, r15 3357c: fe 01 movw r30, r28 3357e: f7 96 adiw r30, 0x37 ; 55 33580: cf 01 movw r24, r30 33582: 0b 96 adiw r24, 0x0b ; 11 33584: 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++] = ' '; 33586: 20 e2 ldi r18, 0x20 ; 32 33588: 21 93 st Z+, r18 3358a: e8 17 cp r30, r24 3358c: f9 07 cpc r31, r25 3358e: d9 f7 brne .-10 ; 0x33586 33590: 96 01 movw r18, r12 i = 0; 33592: 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 33594: 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 != '/') { 33596: d9 01 movw r26, r18 33598: 8d 91 ld r24, X+ 3359a: 88 23 and r24, r24 3359c: 49 f1 breq .+82 ; 0x335f0 3359e: 8f 32 cpi r24, 0x2F ; 47 335a0: 39 f1 breq .+78 ; 0x335f0 c = *str++; 335a2: 28 2f mov r18, r24 if (c == '.') { 335a4: 8e 32 cpi r24, 0x2E ; 46 335a6: 39 f4 brne .+14 ; 0x335b6 if (n == 10) goto fail; // only one dot allowed 335a8: 6a 30 cpi r22, 0x0A ; 10 335aa: 09 f4 brne .+2 ; 0x335ae 335ac: 96 cf rjmp .-212 ; 0x334da n = 10; // max index for full 8.3 name i = 8; // place for extension 335ae: 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 335b0: 6a e0 ldi r22, 0x0A ; 10 335b2: 9d 01 movw r18, r26 335b4: f0 cf rjmp .-32 ; 0x33596 335b6: e2 e6 ldi r30, 0x62 ; 98 335b8: 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; 335ba: 34 91 lpm r19, Z 335bc: 33 23 and r19, r19 335be: 21 f0 breq .+8 ; 0x335c8 335c0: 31 96 adiw r30, 0x01 ; 1 335c2: 83 13 cpse r24, r19 335c4: fa cf rjmp .-12 ; 0x335ba 335c6: 89 cf rjmp .-238 ; 0x334da // check size and only allow ASCII printable characters if (i > n || c < 0X21 || c > 0X7E)goto fail; 335c8: 69 17 cp r22, r25 335ca: 08 f4 brcc .+2 ; 0x335ce 335cc: 86 cf rjmp .-244 ; 0x334da 335ce: 3f ed ldi r19, 0xDF ; 223 335d0: 38 0f add r19, r24 335d2: 3e 35 cpi r19, 0x5E ; 94 335d4: 08 f0 brcs .+2 ; 0x335d8 335d6: 81 cf rjmp .-254 ; 0x334da // only upper case allowed in 8.3 names - convert lower to upper name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); 335d8: 3f e9 ldi r19, 0x9F ; 159 335da: 38 0f add r19, r24 335dc: 3a 31 cpi r19, 0x1A ; 26 335de: 10 f4 brcc .+4 ; 0x335e4 335e0: 20 ee ldi r18, 0xE0 ; 224 335e2: 28 0f add r18, r24 335e4: fa 01 movw r30, r20 335e6: e9 0f add r30, r25 335e8: f1 1d adc r31, r1 335ea: 20 83 st Z, r18 335ec: 9f 5f subi r25, 0xFF ; 255 335ee: e1 cf rjmp .-62 ; 0x335b2 if (!dir2.openRoot(dirFile->vol_)) goto fail; parent = &dir2; } } while (1) { if (!make83Name(path, dname, &path)) goto fail; 335f0: 8f a9 ldd r24, Y+55 ; 0x37 335f2: 80 32 cpi r24, 0x20 ; 32 335f4: 09 f4 brne .+2 ; 0x335f8 335f6: 71 cf rjmp .-286 ; 0x334da 335f8: 69 01 movw r12, r18 while (*path == '/') path++; 335fa: f9 01 movw r30, r18 335fc: 80 81 ld r24, Z 335fe: 2f 5f subi r18, 0xFF ; 255 33600: 3f 4f sbci r19, 0xFF ; 255 33602: 8f 32 cpi r24, 0x2F ; 47 33604: c9 f3 breq .-14 ; 0x335f8 if (!*path) break; 33606: 88 23 and r24, r24 33608: d9 f0 breq .+54 ; 0x33640 if (!sub->open(parent, dname, O_READ)) goto fail; 3360a: 21 e0 ldi r18, 0x01 ; 1 3360c: b8 01 movw r22, r16 3360e: c7 01 movw r24, r14 33610: 0f 94 47 73 call 0x2e68e ; 0x2e68e 33614: 88 23 and r24, r24 33616: 09 f4 brne .+2 ; 0x3361a 33618: 60 cf rjmp .-320 ; 0x334da if (parent != dirFile) parent->close(); 3361a: 0a 15 cp r16, r10 3361c: 1b 05 cpc r17, r11 3361e: 19 f0 breq .+6 ; 0x33626 33620: c8 01 movw r24, r16 33622: 0f 94 51 6f call 0x2dea2 ; 0x2dea2 parent = sub; sub = parent != &dir1 ? &dir1 : &dir2; 33626: 94 2d mov r25, r4 33628: 85 2d mov r24, r5 3362a: 6e 14 cp r6, r14 3362c: 7f 04 cpc r7, r15 3362e: 21 f0 breq .+8 ; 0x33638 33630: 23 96 adiw r28, 0x03 ; 3 33632: 9f ad ldd r25, Y+63 ; 0x3f 33634: 23 97 sbiw r28, 0x03 ; 3 33636: 82 2d mov r24, r2 33638: 87 01 movw r16, r14 3363a: e9 2e mov r14, r25 3363c: f8 2e mov r15, r24 3363e: 9e cf rjmp .-196 ; 0x3357c } return open(parent, dname, oflag); 33640: 23 2d mov r18, r3 33642: b8 01 movw r22, r16 33644: c4 01 movw r24, r8 33646: 0f 94 47 73 call 0x2e68e ; 0x2e68e 3364a: 18 2f mov r17, r24 3364c: 47 cf rjmp .-370 ; 0x334dc 0003364e <__floatunsisf>: 3364e: e8 94 clt 33650: 09 c0 rjmp .+18 ; 0x33664 <__floatsisf+0x12> 00033652 <__floatsisf>: 33652: 97 fb bst r25, 7 33654: 3e f4 brtc .+14 ; 0x33664 <__floatsisf+0x12> 33656: 90 95 com r25 33658: 80 95 com r24 3365a: 70 95 com r23 3365c: 61 95 neg r22 3365e: 7f 4f sbci r23, 0xFF ; 255 33660: 8f 4f sbci r24, 0xFF ; 255 33662: 9f 4f sbci r25, 0xFF ; 255 33664: 99 23 and r25, r25 33666: a9 f0 breq .+42 ; 0x33692 <__floatsisf+0x40> 33668: f9 2f mov r31, r25 3366a: 96 e9 ldi r25, 0x96 ; 150 3366c: bb 27 eor r27, r27 3366e: 93 95 inc r25 33670: f6 95 lsr r31 33672: 87 95 ror r24 33674: 77 95 ror r23 33676: 67 95 ror r22 33678: b7 95 ror r27 3367a: f1 11 cpse r31, r1 3367c: f8 cf rjmp .-16 ; 0x3366e <__floatsisf+0x1c> 3367e: fa f4 brpl .+62 ; 0x336be <__floatsisf+0x6c> 33680: bb 0f add r27, r27 33682: 11 f4 brne .+4 ; 0x33688 <__floatsisf+0x36> 33684: 60 ff sbrs r22, 0 33686: 1b c0 rjmp .+54 ; 0x336be <__floatsisf+0x6c> 33688: 6f 5f subi r22, 0xFF ; 255 3368a: 7f 4f sbci r23, 0xFF ; 255 3368c: 8f 4f sbci r24, 0xFF ; 255 3368e: 9f 4f sbci r25, 0xFF ; 255 33690: 16 c0 rjmp .+44 ; 0x336be <__floatsisf+0x6c> 33692: 88 23 and r24, r24 33694: 11 f0 breq .+4 ; 0x3369a <__floatsisf+0x48> 33696: 96 e9 ldi r25, 0x96 ; 150 33698: 11 c0 rjmp .+34 ; 0x336bc <__floatsisf+0x6a> 3369a: 77 23 and r23, r23 3369c: 21 f0 breq .+8 ; 0x336a6 <__floatsisf+0x54> 3369e: 9e e8 ldi r25, 0x8E ; 142 336a0: 87 2f mov r24, r23 336a2: 76 2f mov r23, r22 336a4: 05 c0 rjmp .+10 ; 0x336b0 <__floatsisf+0x5e> 336a6: 66 23 and r22, r22 336a8: 71 f0 breq .+28 ; 0x336c6 <__floatsisf+0x74> 336aa: 96 e8 ldi r25, 0x86 ; 134 336ac: 86 2f mov r24, r22 336ae: 70 e0 ldi r23, 0x00 ; 0 336b0: 60 e0 ldi r22, 0x00 ; 0 336b2: 2a f0 brmi .+10 ; 0x336be <__floatsisf+0x6c> 336b4: 9a 95 dec r25 336b6: 66 0f add r22, r22 336b8: 77 1f adc r23, r23 336ba: 88 1f adc r24, r24 336bc: da f7 brpl .-10 ; 0x336b4 <__floatsisf+0x62> 336be: 88 0f add r24, r24 336c0: 96 95 lsr r25 336c2: 87 95 ror r24 336c4: 97 f9 bld r25, 7 336c6: 08 95 ret 000336c8 : 336c8: 9b 01 movw r18, r22 336ca: ac 01 movw r20, r24 336cc: 0d 94 68 9b jmp 0x336d0 ; 0x336d0 <__mulsf3> 000336d0 <__mulsf3>: 336d0: 0f 94 7b 9b call 0x336f6 ; 0x336f6 <__mulsf3x> 336d4: 0d 94 ec 9b jmp 0x337d8 ; 0x337d8 <__fp_round> 336d8: 0f 94 de 9b call 0x337bc ; 0x337bc <__fp_pscA> 336dc: 38 f0 brcs .+14 ; 0x336ec <__mulsf3+0x1c> 336de: 0f 94 e5 9b call 0x337ca ; 0x337ca <__fp_pscB> 336e2: 20 f0 brcs .+8 ; 0x336ec <__mulsf3+0x1c> 336e4: 95 23 and r25, r21 336e6: 11 f0 breq .+4 ; 0x336ec <__mulsf3+0x1c> 336e8: 0d 94 d5 9b jmp 0x337aa ; 0x337aa <__fp_inf> 336ec: 0d 94 db 9b jmp 0x337b6 ; 0x337b6 <__fp_nan> 336f0: 11 24 eor r1, r1 336f2: 0d 94 20 9c jmp 0x33840 ; 0x33840 <__fp_szero> 000336f6 <__mulsf3x>: 336f6: 0f 94 fd 9b call 0x337fa ; 0x337fa <__fp_split3> 336fa: 70 f3 brcs .-36 ; 0x336d8 <__mulsf3+0x8> 000336fc <__mulsf3_pse>: 336fc: 95 9f mul r25, r21 336fe: c1 f3 breq .-16 ; 0x336f0 <__mulsf3+0x20> 33700: 95 0f add r25, r21 33702: 50 e0 ldi r21, 0x00 ; 0 33704: 55 1f adc r21, r21 33706: 62 9f mul r22, r18 33708: f0 01 movw r30, r0 3370a: 72 9f mul r23, r18 3370c: bb 27 eor r27, r27 3370e: f0 0d add r31, r0 33710: b1 1d adc r27, r1 33712: 63 9f mul r22, r19 33714: aa 27 eor r26, r26 33716: f0 0d add r31, r0 33718: b1 1d adc r27, r1 3371a: aa 1f adc r26, r26 3371c: 64 9f mul r22, r20 3371e: 66 27 eor r22, r22 33720: b0 0d add r27, r0 33722: a1 1d adc r26, r1 33724: 66 1f adc r22, r22 33726: 82 9f mul r24, r18 33728: 22 27 eor r18, r18 3372a: b0 0d add r27, r0 3372c: a1 1d adc r26, r1 3372e: 62 1f adc r22, r18 33730: 73 9f mul r23, r19 33732: b0 0d add r27, r0 33734: a1 1d adc r26, r1 33736: 62 1f adc r22, r18 33738: 83 9f mul r24, r19 3373a: a0 0d add r26, r0 3373c: 61 1d adc r22, r1 3373e: 22 1f adc r18, r18 33740: 74 9f mul r23, r20 33742: 33 27 eor r19, r19 33744: a0 0d add r26, r0 33746: 61 1d adc r22, r1 33748: 23 1f adc r18, r19 3374a: 84 9f mul r24, r20 3374c: 60 0d add r22, r0 3374e: 21 1d adc r18, r1 33750: 82 2f mov r24, r18 33752: 76 2f mov r23, r22 33754: 6a 2f mov r22, r26 33756: 11 24 eor r1, r1 33758: 9f 57 subi r25, 0x7F ; 127 3375a: 50 40 sbci r21, 0x00 ; 0 3375c: 9a f0 brmi .+38 ; 0x33784 <__mulsf3_pse+0x88> 3375e: f1 f0 breq .+60 ; 0x3379c <__mulsf3_pse+0xa0> 33760: 88 23 and r24, r24 33762: 4a f0 brmi .+18 ; 0x33776 <__mulsf3_pse+0x7a> 33764: ee 0f add r30, r30 33766: ff 1f adc r31, r31 33768: bb 1f adc r27, r27 3376a: 66 1f adc r22, r22 3376c: 77 1f adc r23, r23 3376e: 88 1f adc r24, r24 33770: 91 50 subi r25, 0x01 ; 1 33772: 50 40 sbci r21, 0x00 ; 0 33774: a9 f7 brne .-22 ; 0x33760 <__mulsf3_pse+0x64> 33776: 9e 3f cpi r25, 0xFE ; 254 33778: 51 05 cpc r21, r1 3377a: 80 f0 brcs .+32 ; 0x3379c <__mulsf3_pse+0xa0> 3377c: 0d 94 d5 9b jmp 0x337aa ; 0x337aa <__fp_inf> 33780: 0d 94 20 9c jmp 0x33840 ; 0x33840 <__fp_szero> 33784: 5f 3f cpi r21, 0xFF ; 255 33786: e4 f3 brlt .-8 ; 0x33780 <__mulsf3_pse+0x84> 33788: 98 3e cpi r25, 0xE8 ; 232 3378a: d4 f3 brlt .-12 ; 0x33780 <__mulsf3_pse+0x84> 3378c: 86 95 lsr r24 3378e: 77 95 ror r23 33790: 67 95 ror r22 33792: b7 95 ror r27 33794: f7 95 ror r31 33796: e7 95 ror r30 33798: 9f 5f subi r25, 0xFF ; 255 3379a: c1 f7 brne .-16 ; 0x3378c <__mulsf3_pse+0x90> 3379c: fe 2b or r31, r30 3379e: 88 0f add r24, r24 337a0: 91 1d adc r25, r1 337a2: 96 95 lsr r25 337a4: 87 95 ror r24 337a6: 97 f9 bld r25, 7 337a8: 08 95 ret 000337aa <__fp_inf>: 337aa: 97 f9 bld r25, 7 337ac: 9f 67 ori r25, 0x7F ; 127 337ae: 80 e8 ldi r24, 0x80 ; 128 337b0: 70 e0 ldi r23, 0x00 ; 0 337b2: 60 e0 ldi r22, 0x00 ; 0 337b4: 08 95 ret 000337b6 <__fp_nan>: 337b6: 9f ef ldi r25, 0xFF ; 255 337b8: 80 ec ldi r24, 0xC0 ; 192 337ba: 08 95 ret 000337bc <__fp_pscA>: 337bc: 00 24 eor r0, r0 337be: 0a 94 dec r0 337c0: 16 16 cp r1, r22 337c2: 17 06 cpc r1, r23 337c4: 18 06 cpc r1, r24 337c6: 09 06 cpc r0, r25 337c8: 08 95 ret 000337ca <__fp_pscB>: 337ca: 00 24 eor r0, r0 337cc: 0a 94 dec r0 337ce: 12 16 cp r1, r18 337d0: 13 06 cpc r1, r19 337d2: 14 06 cpc r1, r20 337d4: 05 06 cpc r0, r21 337d6: 08 95 ret 000337d8 <__fp_round>: 337d8: 09 2e mov r0, r25 337da: 03 94 inc r0 337dc: 00 0c add r0, r0 337de: 11 f4 brne .+4 ; 0x337e4 <__fp_round+0xc> 337e0: 88 23 and r24, r24 337e2: 52 f0 brmi .+20 ; 0x337f8 <__fp_round+0x20> 337e4: bb 0f add r27, r27 337e6: 40 f4 brcc .+16 ; 0x337f8 <__fp_round+0x20> 337e8: bf 2b or r27, r31 337ea: 11 f4 brne .+4 ; 0x337f0 <__fp_round+0x18> 337ec: 60 ff sbrs r22, 0 337ee: 04 c0 rjmp .+8 ; 0x337f8 <__fp_round+0x20> 337f0: 6f 5f subi r22, 0xFF ; 255 337f2: 7f 4f sbci r23, 0xFF ; 255 337f4: 8f 4f sbci r24, 0xFF ; 255 337f6: 9f 4f sbci r25, 0xFF ; 255 337f8: 08 95 ret 000337fa <__fp_split3>: 337fa: 57 fd sbrc r21, 7 337fc: 90 58 subi r25, 0x80 ; 128 337fe: 44 0f add r20, r20 33800: 55 1f adc r21, r21 33802: 59 f0 breq .+22 ; 0x3381a <__fp_splitA+0x10> 33804: 5f 3f cpi r21, 0xFF ; 255 33806: 71 f0 breq .+28 ; 0x33824 <__fp_splitA+0x1a> 33808: 47 95 ror r20 0003380a <__fp_splitA>: 3380a: 88 0f add r24, r24 3380c: 97 fb bst r25, 7 3380e: 99 1f adc r25, r25 33810: 61 f0 breq .+24 ; 0x3382a <__fp_splitA+0x20> 33812: 9f 3f cpi r25, 0xFF ; 255 33814: 79 f0 breq .+30 ; 0x33834 <__fp_splitA+0x2a> 33816: 87 95 ror r24 33818: 08 95 ret 3381a: 12 16 cp r1, r18 3381c: 13 06 cpc r1, r19 3381e: 14 06 cpc r1, r20 33820: 55 1f adc r21, r21 33822: f2 cf rjmp .-28 ; 0x33808 <__fp_split3+0xe> 33824: 46 95 lsr r20 33826: f1 df rcall .-30 ; 0x3380a <__fp_splitA> 33828: 08 c0 rjmp .+16 ; 0x3383a <__fp_splitA+0x30> 3382a: 16 16 cp r1, r22 3382c: 17 06 cpc r1, r23 3382e: 18 06 cpc r1, r24 33830: 99 1f adc r25, r25 33832: f1 cf rjmp .-30 ; 0x33816 <__fp_splitA+0xc> 33834: 86 95 lsr r24 33836: 71 05 cpc r23, r1 33838: 61 05 cpc r22, r1 3383a: 08 94 sec 3383c: 08 95 ret 0003383e <__fp_zero>: 3383e: e8 94 clt 00033840 <__fp_szero>: 33840: bb 27 eor r27, r27 33842: 66 27 eor r22, r22 33844: 77 27 eor r23, r23 33846: cb 01 movw r24, r22 33848: 97 f9 bld r25, 7 3384a: 08 95 ret 0003384c : 3384c: 3f 92 push r3 3384e: 4f 92 push r4 33850: 5f 92 push r5 33852: 6f 92 push r6 33854: 7f 92 push r7 33856: 8f 92 push r8 33858: 9f 92 push r9 3385a: af 92 push r10 3385c: bf 92 push r11 3385e: cf 92 push r12 33860: df 92 push r13 33862: ef 92 push r14 33864: ff 92 push r15 33866: 0f 93 push r16 33868: 1f 93 push r17 3386a: cf 93 push r28 3386c: df 93 push r29 3386e: 5c 01 movw r10, r24 33870: 6b 01 movw r12, r22 33872: 7a 01 movw r14, r20 33874: 61 15 cp r22, r1 33876: 71 05 cpc r23, r1 33878: 19 f0 breq .+6 ; 0x33880 3387a: fb 01 movw r30, r22 3387c: 91 83 std Z+1, r25 ; 0x01 3387e: 80 83 st Z, r24 33880: e1 14 cp r14, r1 33882: f1 04 cpc r15, r1 33884: 51 f0 breq .+20 ; 0x3389a 33886: c7 01 movw r24, r14 33888: 02 97 sbiw r24, 0x02 ; 2 3388a: 83 97 sbiw r24, 0x23 ; 35 3388c: 30 f0 brcs .+12 ; 0x3389a 3388e: 40 e0 ldi r20, 0x00 ; 0 33890: 30 e0 ldi r19, 0x00 ; 0 33892: 20 e0 ldi r18, 0x00 ; 0 33894: 90 e0 ldi r25, 0x00 ; 0 33896: 6b c0 rjmp .+214 ; 0x3396e 33898: 5e 01 movw r10, r28 3389a: e5 01 movw r28, r10 3389c: 21 96 adiw r28, 0x01 ; 1 3389e: f5 01 movw r30, r10 338a0: 10 81 ld r17, Z 338a2: 81 2f mov r24, r17 338a4: 90 e0 ldi r25, 0x00 ; 0 338a6: 0f 94 2c 9e call 0x33c58 ; 0x33c58 338aa: 89 2b or r24, r25 338ac: a9 f7 brne .-22 ; 0x33898 338ae: 1d 32 cpi r17, 0x2D ; 45 338b0: 01 f5 brne .+64 ; 0x338f2 338b2: 21 96 adiw r28, 0x01 ; 1 338b4: f5 01 movw r30, r10 338b6: 11 81 ldd r17, Z+1 ; 0x01 338b8: 01 e0 ldi r16, 0x01 ; 1 338ba: e1 14 cp r14, r1 338bc: f1 04 cpc r15, r1 338be: 09 f4 brne .+2 ; 0x338c2 338c0: e6 c0 rjmp .+460 ; 0x33a8e 338c2: f0 e1 ldi r31, 0x10 ; 16 338c4: ef 16 cp r14, r31 338c6: f1 04 cpc r15, r1 338c8: 09 f0 breq .+2 ; 0x338cc 338ca: 88 c0 rjmp .+272 ; 0x339dc 338cc: 10 33 cpi r17, 0x30 ; 48 338ce: 59 f4 brne .+22 ; 0x338e6 338d0: 88 81 ld r24, Y 338d2: 8f 7d andi r24, 0xDF ; 223 338d4: 88 35 cpi r24, 0x58 ; 88 338d6: 09 f0 breq .+2 ; 0x338da 338d8: 7c c0 rjmp .+248 ; 0x339d2 338da: 19 81 ldd r17, Y+1 ; 0x01 338dc: 22 96 adiw r28, 0x02 ; 2 338de: 02 60 ori r16, 0x02 ; 2 338e0: f0 e1 ldi r31, 0x10 ; 16 338e2: ef 2e mov r14, r31 338e4: f1 2c mov r15, r1 338e6: 81 2c mov r8, r1 338e8: 91 2c mov r9, r1 338ea: a1 2c mov r10, r1 338ec: 88 e0 ldi r24, 0x08 ; 8 338ee: b8 2e mov r11, r24 338f0: 92 c0 rjmp .+292 ; 0x33a16 338f2: 1b 32 cpi r17, 0x2B ; 43 338f4: 21 f4 brne .+8 ; 0x338fe 338f6: e5 01 movw r28, r10 338f8: 22 96 adiw r28, 0x02 ; 2 338fa: f5 01 movw r30, r10 338fc: 11 81 ldd r17, Z+1 ; 0x01 338fe: 00 e0 ldi r16, 0x00 ; 0 33900: dc cf rjmp .-72 ; 0x338ba 33902: ea e0 ldi r30, 0x0A ; 10 33904: ee 16 cp r14, r30 33906: f1 04 cpc r15, r1 33908: 09 f4 brne .+2 ; 0x3390c 3390a: c7 c0 rjmp .+398 ; 0x33a9a 3390c: f0 e1 ldi r31, 0x10 ; 16 3390e: ef 16 cp r14, r31 33910: f1 04 cpc r15, r1 33912: 09 f0 breq .+2 ; 0x33916 33914: 73 c0 rjmp .+230 ; 0x339fc 33916: e7 cf rjmp .-50 ; 0x338e6 33918: 78 e0 ldi r23, 0x08 ; 8 3391a: e7 2e mov r14, r23 3391c: f1 2c mov r15, r1 3391e: 81 2c mov r8, r1 33920: 91 2c mov r9, r1 33922: a1 2c mov r10, r1 33924: 60 e1 ldi r22, 0x10 ; 16 33926: b6 2e mov r11, r22 33928: 76 c0 rjmp .+236 ; 0x33a16 3392a: 21 e0 ldi r18, 0x01 ; 1 3392c: ad c0 rjmp .+346 ; 0x33a88 3392e: 30 2f mov r19, r16 33930: 31 70 andi r19, 0x01 ; 1 33932: c1 14 cp r12, r1 33934: d1 04 cpc r13, r1 33936: 31 f0 breq .+12 ; 0x33944 33938: 22 23 and r18, r18 3393a: 71 f1 breq .+92 ; 0x33998 3393c: 21 97 sbiw r28, 0x01 ; 1 3393e: f6 01 movw r30, r12 33940: d1 83 std Z+1, r29 ; 0x01 33942: c0 83 st Z, r28 33944: 27 ff sbrs r18, 7 33946: 2e c0 rjmp .+92 ; 0x339a4 33948: 60 e0 ldi r22, 0x00 ; 0 3394a: 70 e0 ldi r23, 0x00 ; 0 3394c: 80 e0 ldi r24, 0x00 ; 0 3394e: 90 e8 ldi r25, 0x80 ; 128 33950: 31 11 cpse r19, r1 33952: 04 c0 rjmp .+8 ; 0x3395c 33954: 6f ef ldi r22, 0xFF ; 255 33956: 7f ef ldi r23, 0xFF ; 255 33958: 8f ef ldi r24, 0xFF ; 255 3395a: 9f e7 ldi r25, 0x7F ; 127 3395c: 22 e2 ldi r18, 0x22 ; 34 3395e: 30 e0 ldi r19, 0x00 ; 0 33960: 30 93 f9 16 sts 0x16F9, r19 ; 0x8016f9 33964: 20 93 f8 16 sts 0x16F8, r18 ; 0x8016f8 33968: 46 2f mov r20, r22 3396a: 37 2f mov r19, r23 3396c: 28 2f mov r18, r24 3396e: 64 2f mov r22, r20 33970: 73 2f mov r23, r19 33972: 82 2f mov r24, r18 33974: df 91 pop r29 33976: cf 91 pop r28 33978: 1f 91 pop r17 3397a: 0f 91 pop r16 3397c: ff 90 pop r15 3397e: ef 90 pop r14 33980: df 90 pop r13 33982: cf 90 pop r12 33984: bf 90 pop r11 33986: af 90 pop r10 33988: 9f 90 pop r9 3398a: 8f 90 pop r8 3398c: 7f 90 pop r7 3398e: 6f 90 pop r6 33990: 5f 90 pop r5 33992: 4f 90 pop r4 33994: 3f 90 pop r3 33996: 08 95 ret 33998: 01 ff sbrs r16, 1 3399a: 04 c0 rjmp .+8 ; 0x339a4 3399c: 22 97 sbiw r28, 0x02 ; 2 3399e: f6 01 movw r30, r12 339a0: d1 83 std Z+1, r29 ; 0x01 339a2: c0 83 st Z, r28 339a4: 33 23 and r19, r19 339a6: 41 f0 breq .+16 ; 0x339b8 339a8: 90 95 com r25 339aa: 80 95 com r24 339ac: 70 95 com r23 339ae: 61 95 neg r22 339b0: 7f 4f sbci r23, 0xFF ; 255 339b2: 8f 4f sbci r24, 0xFF ; 255 339b4: 9f 4f sbci r25, 0xFF ; 255 339b6: d8 cf rjmp .-80 ; 0x33968 339b8: 97 ff sbrs r25, 7 339ba: d6 cf rjmp .-84 ; 0x33968 339bc: 82 e2 ldi r24, 0x22 ; 34 339be: 90 e0 ldi r25, 0x00 ; 0 339c0: 90 93 f9 16 sts 0x16F9, r25 ; 0x8016f9 339c4: 80 93 f8 16 sts 0x16F8, r24 ; 0x8016f8 339c8: 6f ef ldi r22, 0xFF ; 255 339ca: 7f ef ldi r23, 0xFF ; 255 339cc: 8f ef ldi r24, 0xFF ; 255 339ce: 9f e7 ldi r25, 0x7F ; 127 339d0: cb cf rjmp .-106 ; 0x33968 339d2: 10 e3 ldi r17, 0x30 ; 48 339d4: e1 14 cp r14, r1 339d6: f1 04 cpc r15, r1 339d8: 09 f4 brne .+2 ; 0x339dc 339da: 9e cf rjmp .-196 ; 0x33918 339dc: 28 e0 ldi r18, 0x08 ; 8 339de: e2 16 cp r14, r18 339e0: f1 04 cpc r15, r1 339e2: 09 f4 brne .+2 ; 0x339e6 339e4: 9c cf rjmp .-200 ; 0x3391e 339e6: 0c f0 brlt .+2 ; 0x339ea 339e8: 8c cf rjmp .-232 ; 0x33902 339ea: 81 2c mov r8, r1 339ec: 91 2c mov r9, r1 339ee: a1 2c mov r10, r1 339f0: e0 e4 ldi r30, 0x40 ; 64 339f2: be 2e mov r11, r30 339f4: 82 e0 ldi r24, 0x02 ; 2 339f6: e8 16 cp r14, r24 339f8: f1 04 cpc r15, r1 339fa: 69 f0 breq .+26 ; 0x33a16 339fc: 60 e0 ldi r22, 0x00 ; 0 339fe: 70 e0 ldi r23, 0x00 ; 0 33a00: 80 e0 ldi r24, 0x00 ; 0 33a02: 90 e8 ldi r25, 0x80 ; 128 33a04: 97 01 movw r18, r14 33a06: 0f 2c mov r0, r15 33a08: 00 0c add r0, r0 33a0a: 44 0b sbc r20, r20 33a0c: 55 0b sbc r21, r21 33a0e: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> 33a12: 49 01 movw r8, r18 33a14: 5a 01 movw r10, r20 33a16: 20 e0 ldi r18, 0x00 ; 0 33a18: 60 e0 ldi r22, 0x00 ; 0 33a1a: 70 e0 ldi r23, 0x00 ; 0 33a1c: cb 01 movw r24, r22 33a1e: 27 01 movw r4, r14 33a20: 0f 2c mov r0, r15 33a22: 00 0c add r0, r0 33a24: 66 08 sbc r6, r6 33a26: 77 08 sbc r7, r7 33a28: fe 01 movw r30, r28 33a2a: 50 ed ldi r21, 0xD0 ; 208 33a2c: 35 2e mov r3, r21 33a2e: 31 0e add r3, r17 33a30: 39 e0 ldi r19, 0x09 ; 9 33a32: 33 15 cp r19, r3 33a34: 70 f4 brcc .+28 ; 0x33a52 33a36: 3f eb ldi r19, 0xBF ; 191 33a38: 31 0f add r19, r17 33a3a: 49 ec ldi r20, 0xC9 ; 201 33a3c: 34 2e mov r3, r20 33a3e: 3a 31 cpi r19, 0x1A ; 26 33a40: 38 f0 brcs .+14 ; 0x33a50 33a42: 3f e9 ldi r19, 0x9F ; 159 33a44: 31 0f add r19, r17 33a46: 3a 31 cpi r19, 0x1A ; 26 33a48: 08 f0 brcs .+2 ; 0x33a4c 33a4a: 71 cf rjmp .-286 ; 0x3392e 33a4c: 39 ea ldi r19, 0xA9 ; 169 33a4e: 33 2e mov r3, r19 33a50: 31 0e add r3, r17 33a52: 3e 14 cp r3, r14 33a54: 1f 04 cpc r1, r15 33a56: 0c f0 brlt .+2 ; 0x33a5a 33a58: 6a cf rjmp .-300 ; 0x3392e 33a5a: 27 fd sbrc r18, 7 33a5c: 15 c0 rjmp .+42 ; 0x33a88 33a5e: 86 16 cp r8, r22 33a60: 97 06 cpc r9, r23 33a62: a8 06 cpc r10, r24 33a64: b9 06 cpc r11, r25 33a66: 78 f0 brcs .+30 ; 0x33a86 33a68: a3 01 movw r20, r6 33a6a: 92 01 movw r18, r4 33a6c: 0f 94 fe a0 call 0x341fc ; 0x341fc <__mulsi3> 33a70: 63 0d add r22, r3 33a72: 71 1d adc r23, r1 33a74: 81 1d adc r24, r1 33a76: 91 1d adc r25, r1 33a78: 61 30 cpi r22, 0x01 ; 1 33a7a: 71 05 cpc r23, r1 33a7c: 81 05 cpc r24, r1 33a7e: 20 e8 ldi r18, 0x80 ; 128 33a80: 92 07 cpc r25, r18 33a82: 08 f4 brcc .+2 ; 0x33a86 33a84: 52 cf rjmp .-348 ; 0x3392a 33a86: 2f ef ldi r18, 0xFF ; 255 33a88: 21 96 adiw r28, 0x01 ; 1 33a8a: 10 81 ld r17, Z 33a8c: cd cf rjmp .-102 ; 0x33a28 33a8e: 10 33 cpi r17, 0x30 ; 48 33a90: 09 f4 brne .+2 ; 0x33a94 33a92: 1e cf rjmp .-452 ; 0x338d0 33a94: 2a e0 ldi r18, 0x0A ; 10 33a96: e2 2e mov r14, r18 33a98: f1 2c mov r15, r1 33a9a: 9c ec ldi r25, 0xCC ; 204 33a9c: 89 2e mov r8, r25 33a9e: 98 2c mov r9, r8 33aa0: a8 2c mov r10, r8 33aa2: 9c e0 ldi r25, 0x0C ; 12 33aa4: b9 2e mov r11, r25 33aa6: b7 cf rjmp .-146 ; 0x33a16 00033aa8 <__ftoa_engine>: 33aa8: 28 30 cpi r18, 0x08 ; 8 33aaa: 08 f0 brcs .+2 ; 0x33aae <__ftoa_engine+0x6> 33aac: 27 e0 ldi r18, 0x07 ; 7 33aae: 33 27 eor r19, r19 33ab0: da 01 movw r26, r20 33ab2: 99 0f add r25, r25 33ab4: 31 1d adc r19, r1 33ab6: 87 fd sbrc r24, 7 33ab8: 91 60 ori r25, 0x01 ; 1 33aba: 00 96 adiw r24, 0x00 ; 0 33abc: 61 05 cpc r22, r1 33abe: 71 05 cpc r23, r1 33ac0: 39 f4 brne .+14 ; 0x33ad0 <__ftoa_engine+0x28> 33ac2: 32 60 ori r19, 0x02 ; 2 33ac4: 2e 5f subi r18, 0xFE ; 254 33ac6: 3d 93 st X+, r19 33ac8: 30 e3 ldi r19, 0x30 ; 48 33aca: 2a 95 dec r18 33acc: e1 f7 brne .-8 ; 0x33ac6 <__ftoa_engine+0x1e> 33ace: 08 95 ret 33ad0: 9f 3f cpi r25, 0xFF ; 255 33ad2: 30 f0 brcs .+12 ; 0x33ae0 <__ftoa_engine+0x38> 33ad4: 80 38 cpi r24, 0x80 ; 128 33ad6: 71 05 cpc r23, r1 33ad8: 61 05 cpc r22, r1 33ada: 09 f0 breq .+2 ; 0x33ade <__ftoa_engine+0x36> 33adc: 3c 5f subi r19, 0xFC ; 252 33ade: 3c 5f subi r19, 0xFC ; 252 33ae0: 3d 93 st X+, r19 33ae2: 91 30 cpi r25, 0x01 ; 1 33ae4: 08 f0 brcs .+2 ; 0x33ae8 <__ftoa_engine+0x40> 33ae6: 80 68 ori r24, 0x80 ; 128 33ae8: 91 1d adc r25, r1 33aea: df 93 push r29 33aec: cf 93 push r28 33aee: 1f 93 push r17 33af0: 0f 93 push r16 33af2: ff 92 push r15 33af4: ef 92 push r14 33af6: 19 2f mov r17, r25 33af8: 98 7f andi r25, 0xF8 ; 248 33afa: 96 95 lsr r25 33afc: e9 2f mov r30, r25 33afe: 96 95 lsr r25 33b00: 96 95 lsr r25 33b02: e9 0f add r30, r25 33b04: ff 27 eor r31, r31 33b06: e0 56 subi r30, 0x60 ; 96 33b08: fe 48 sbci r31, 0x8E ; 142 33b0a: 99 27 eor r25, r25 33b0c: 33 27 eor r19, r19 33b0e: ee 24 eor r14, r14 33b10: ff 24 eor r15, r15 33b12: a7 01 movw r20, r14 33b14: e7 01 movw r28, r14 33b16: 05 90 lpm r0, Z+ 33b18: 08 94 sec 33b1a: 07 94 ror r0 33b1c: 28 f4 brcc .+10 ; 0x33b28 <__ftoa_engine+0x80> 33b1e: 36 0f add r19, r22 33b20: e7 1e adc r14, r23 33b22: f8 1e adc r15, r24 33b24: 49 1f adc r20, r25 33b26: 51 1d adc r21, r1 33b28: 66 0f add r22, r22 33b2a: 77 1f adc r23, r23 33b2c: 88 1f adc r24, r24 33b2e: 99 1f adc r25, r25 33b30: 06 94 lsr r0 33b32: a1 f7 brne .-24 ; 0x33b1c <__ftoa_engine+0x74> 33b34: 05 90 lpm r0, Z+ 33b36: 07 94 ror r0 33b38: 28 f4 brcc .+10 ; 0x33b44 <__ftoa_engine+0x9c> 33b3a: e7 0e add r14, r23 33b3c: f8 1e adc r15, r24 33b3e: 49 1f adc r20, r25 33b40: 56 1f adc r21, r22 33b42: c1 1d adc r28, r1 33b44: 77 0f add r23, r23 33b46: 88 1f adc r24, r24 33b48: 99 1f adc r25, r25 33b4a: 66 1f adc r22, r22 33b4c: 06 94 lsr r0 33b4e: a1 f7 brne .-24 ; 0x33b38 <__ftoa_engine+0x90> 33b50: 05 90 lpm r0, Z+ 33b52: 07 94 ror r0 33b54: 28 f4 brcc .+10 ; 0x33b60 <__ftoa_engine+0xb8> 33b56: f8 0e add r15, r24 33b58: 49 1f adc r20, r25 33b5a: 56 1f adc r21, r22 33b5c: c7 1f adc r28, r23 33b5e: d1 1d adc r29, r1 33b60: 88 0f add r24, r24 33b62: 99 1f adc r25, r25 33b64: 66 1f adc r22, r22 33b66: 77 1f adc r23, r23 33b68: 06 94 lsr r0 33b6a: a1 f7 brne .-24 ; 0x33b54 <__ftoa_engine+0xac> 33b6c: 05 90 lpm r0, Z+ 33b6e: 07 94 ror r0 33b70: 20 f4 brcc .+8 ; 0x33b7a <__ftoa_engine+0xd2> 33b72: 49 0f add r20, r25 33b74: 56 1f adc r21, r22 33b76: c7 1f adc r28, r23 33b78: d8 1f adc r29, r24 33b7a: 99 0f add r25, r25 33b7c: 66 1f adc r22, r22 33b7e: 77 1f adc r23, r23 33b80: 88 1f adc r24, r24 33b82: 06 94 lsr r0 33b84: a9 f7 brne .-22 ; 0x33b70 <__ftoa_engine+0xc8> 33b86: 84 91 lpm r24, Z 33b88: 10 95 com r17 33b8a: 17 70 andi r17, 0x07 ; 7 33b8c: 41 f0 breq .+16 ; 0x33b9e <__ftoa_engine+0xf6> 33b8e: d6 95 lsr r29 33b90: c7 95 ror r28 33b92: 57 95 ror r21 33b94: 47 95 ror r20 33b96: f7 94 ror r15 33b98: e7 94 ror r14 33b9a: 1a 95 dec r17 33b9c: c1 f7 brne .-16 ; 0x33b8e <__ftoa_engine+0xe6> 33b9e: e6 e4 ldi r30, 0x46 ; 70 33ba0: f1 e7 ldi r31, 0x71 ; 113 33ba2: 68 94 set 33ba4: 15 90 lpm r1, Z+ 33ba6: 15 91 lpm r17, Z+ 33ba8: 35 91 lpm r19, Z+ 33baa: 65 91 lpm r22, Z+ 33bac: 95 91 lpm r25, Z+ 33bae: 05 90 lpm r0, Z+ 33bb0: 7f e2 ldi r23, 0x2F ; 47 33bb2: 73 95 inc r23 33bb4: e1 18 sub r14, r1 33bb6: f1 0a sbc r15, r17 33bb8: 43 0b sbc r20, r19 33bba: 56 0b sbc r21, r22 33bbc: c9 0b sbc r28, r25 33bbe: d0 09 sbc r29, r0 33bc0: c0 f7 brcc .-16 ; 0x33bb2 <__ftoa_engine+0x10a> 33bc2: e1 0c add r14, r1 33bc4: f1 1e adc r15, r17 33bc6: 43 1f adc r20, r19 33bc8: 56 1f adc r21, r22 33bca: c9 1f adc r28, r25 33bcc: d0 1d adc r29, r0 33bce: 7e f4 brtc .+30 ; 0x33bee <__ftoa_engine+0x146> 33bd0: 70 33 cpi r23, 0x30 ; 48 33bd2: 11 f4 brne .+4 ; 0x33bd8 <__ftoa_engine+0x130> 33bd4: 8a 95 dec r24 33bd6: e6 cf rjmp .-52 ; 0x33ba4 <__ftoa_engine+0xfc> 33bd8: e8 94 clt 33bda: 01 50 subi r16, 0x01 ; 1 33bdc: 30 f0 brcs .+12 ; 0x33bea <__ftoa_engine+0x142> 33bde: 08 0f add r16, r24 33be0: 0a f4 brpl .+2 ; 0x33be4 <__ftoa_engine+0x13c> 33be2: 00 27 eor r16, r16 33be4: 02 17 cp r16, r18 33be6: 08 f4 brcc .+2 ; 0x33bea <__ftoa_engine+0x142> 33be8: 20 2f mov r18, r16 33bea: 23 95 inc r18 33bec: 02 2f mov r16, r18 33bee: 7a 33 cpi r23, 0x3A ; 58 33bf0: 28 f0 brcs .+10 ; 0x33bfc <__ftoa_engine+0x154> 33bf2: 79 e3 ldi r23, 0x39 ; 57 33bf4: 7d 93 st X+, r23 33bf6: 2a 95 dec r18 33bf8: e9 f7 brne .-6 ; 0x33bf4 <__ftoa_engine+0x14c> 33bfa: 10 c0 rjmp .+32 ; 0x33c1c <__ftoa_engine+0x174> 33bfc: 7d 93 st X+, r23 33bfe: 2a 95 dec r18 33c00: 89 f6 brne .-94 ; 0x33ba4 <__ftoa_engine+0xfc> 33c02: 06 94 lsr r0 33c04: 97 95 ror r25 33c06: 67 95 ror r22 33c08: 37 95 ror r19 33c0a: 17 95 ror r17 33c0c: 17 94 ror r1 33c0e: e1 18 sub r14, r1 33c10: f1 0a sbc r15, r17 33c12: 43 0b sbc r20, r19 33c14: 56 0b sbc r21, r22 33c16: c9 0b sbc r28, r25 33c18: d0 09 sbc r29, r0 33c1a: 98 f0 brcs .+38 ; 0x33c42 <__ftoa_engine+0x19a> 33c1c: 23 95 inc r18 33c1e: 7e 91 ld r23, -X 33c20: 73 95 inc r23 33c22: 7a 33 cpi r23, 0x3A ; 58 33c24: 08 f0 brcs .+2 ; 0x33c28 <__ftoa_engine+0x180> 33c26: 70 e3 ldi r23, 0x30 ; 48 33c28: 7c 93 st X, r23 33c2a: 20 13 cpse r18, r16 33c2c: b8 f7 brcc .-18 ; 0x33c1c <__ftoa_engine+0x174> 33c2e: 7e 91 ld r23, -X 33c30: 70 61 ori r23, 0x10 ; 16 33c32: 7d 93 st X+, r23 33c34: 30 f0 brcs .+12 ; 0x33c42 <__ftoa_engine+0x19a> 33c36: 83 95 inc r24 33c38: 71 e3 ldi r23, 0x31 ; 49 33c3a: 7d 93 st X+, r23 33c3c: 70 e3 ldi r23, 0x30 ; 48 33c3e: 2a 95 dec r18 33c40: e1 f7 brne .-8 ; 0x33c3a <__ftoa_engine+0x192> 33c42: 11 24 eor r1, r1 33c44: ef 90 pop r14 33c46: ff 90 pop r15 33c48: 0f 91 pop r16 33c4a: 1f 91 pop r17 33c4c: cf 91 pop r28 33c4e: df 91 pop r29 33c50: 99 27 eor r25, r25 33c52: 87 fd sbrc r24, 7 33c54: 90 95 com r25 33c56: 08 95 ret 00033c58 : 33c58: 91 11 cpse r25, r1 33c5a: 0d 94 88 a0 jmp 0x34110 ; 0x34110 <__ctype_isfalse> 33c5e: 80 32 cpi r24, 0x20 ; 32 33c60: 19 f0 breq .+6 ; 0x33c68 33c62: 89 50 subi r24, 0x09 ; 9 33c64: 85 50 subi r24, 0x05 ; 5 33c66: c8 f7 brcc .-14 ; 0x33c5a 33c68: 08 95 ret 00033c6a : 33c6a: fb 01 movw r30, r22 33c6c: dc 01 movw r26, r24 33c6e: 02 c0 rjmp .+4 ; 0x33c74 33c70: 05 90 lpm r0, Z+ 33c72: 0d 92 st X+, r0 33c74: 41 50 subi r20, 0x01 ; 1 33c76: 50 40 sbci r21, 0x00 ; 0 33c78: d8 f7 brcc .-10 ; 0x33c70 33c7a: 08 95 ret 00033c7c : 33c7c: fb 01 movw r30, r22 33c7e: dc 01 movw r26, r24 33c80: 0d 90 ld r0, X+ 33c82: 00 20 and r0, r0 33c84: e9 f7 brne .-6 ; 0x33c80 33c86: 11 97 sbiw r26, 0x01 ; 1 33c88: 05 90 lpm r0, Z+ 33c8a: 0d 92 st X+, r0 33c8c: 00 20 and r0, r0 33c8e: e1 f7 brne .-8 ; 0x33c88 33c90: 08 95 ret 00033c92 : 33c92: fb 01 movw r30, r22 33c94: dc 01 movw r26, r24 33c96: 8d 91 ld r24, X+ 33c98: 05 90 lpm r0, Z+ 33c9a: 80 19 sub r24, r0 33c9c: 01 10 cpse r0, r1 33c9e: d9 f3 breq .-10 ; 0x33c96 33ca0: 99 0b sbc r25, r25 33ca2: 08 95 ret 00033ca4 : 33ca4: fb 01 movw r30, r22 33ca6: dc 01 movw r26, r24 33ca8: 05 90 lpm r0, Z+ 33caa: 0d 92 st X+, r0 33cac: 00 20 and r0, r0 33cae: e1 f7 brne .-8 ; 0x33ca8 33cb0: 08 95 ret 00033cb2 <__strlen_P>: 33cb2: fc 01 movw r30, r24 33cb4: 05 90 lpm r0, Z+ 33cb6: 00 20 and r0, r0 33cb8: e9 f7 brne .-6 ; 0x33cb4 <__strlen_P+0x2> 33cba: 80 95 com r24 33cbc: 90 95 com r25 33cbe: 8e 0f add r24, r30 33cc0: 9f 1f adc r25, r31 33cc2: 08 95 ret 00033cc4 : 33cc4: fb 01 movw r30, r22 33cc6: dc 01 movw r26, r24 33cc8: 41 50 subi r20, 0x01 ; 1 33cca: 50 40 sbci r21, 0x00 ; 0 33ccc: 88 f0 brcs .+34 ; 0x33cf0 33cce: 8d 91 ld r24, X+ 33cd0: 81 34 cpi r24, 0x41 ; 65 33cd2: 1c f0 brlt .+6 ; 0x33cda 33cd4: 8b 35 cpi r24, 0x5B ; 91 33cd6: 0c f4 brge .+2 ; 0x33cda 33cd8: 80 5e subi r24, 0xE0 ; 224 33cda: 65 91 lpm r22, Z+ 33cdc: 61 34 cpi r22, 0x41 ; 65 33cde: 1c f0 brlt .+6 ; 0x33ce6 33ce0: 6b 35 cpi r22, 0x5B ; 91 33ce2: 0c f4 brge .+2 ; 0x33ce6 33ce4: 60 5e subi r22, 0xE0 ; 224 33ce6: 86 1b sub r24, r22 33ce8: 61 11 cpse r22, r1 33cea: 71 f3 breq .-36 ; 0x33cc8 33cec: 99 0b sbc r25, r25 33cee: 08 95 ret 33cf0: 88 1b sub r24, r24 33cf2: fc cf rjmp .-8 ; 0x33cec 00033cf4 : 33cf4: fb 01 movw r30, r22 33cf6: dc 01 movw r26, r24 33cf8: 41 50 subi r20, 0x01 ; 1 33cfa: 50 40 sbci r21, 0x00 ; 0 33cfc: 30 f0 brcs .+12 ; 0x33d0a 33cfe: 8d 91 ld r24, X+ 33d00: 05 90 lpm r0, Z+ 33d02: 80 19 sub r24, r0 33d04: 19 f4 brne .+6 ; 0x33d0c 33d06: 00 20 and r0, r0 33d08: b9 f7 brne .-18 ; 0x33cf8 33d0a: 88 1b sub r24, r24 33d0c: 99 0b sbc r25, r25 33d0e: 08 95 ret 00033d10 : 33d10: fb 01 movw r30, r22 33d12: dc 01 movw r26, r24 33d14: 41 50 subi r20, 0x01 ; 1 33d16: 50 40 sbci r21, 0x00 ; 0 33d18: 48 f0 brcs .+18 ; 0x33d2c 33d1a: 05 90 lpm r0, Z+ 33d1c: 0d 92 st X+, r0 33d1e: 00 20 and r0, r0 33d20: c9 f7 brne .-14 ; 0x33d14 33d22: 01 c0 rjmp .+2 ; 0x33d26 33d24: 1d 92 st X+, r1 33d26: 41 50 subi r20, 0x01 ; 1 33d28: 50 40 sbci r21, 0x00 ; 0 33d2a: e0 f7 brcc .-8 ; 0x33d24 33d2c: 08 95 ret 00033d2e : 33d2e: fc 01 movw r30, r24 33d30: 05 90 lpm r0, Z+ 33d32: 61 50 subi r22, 0x01 ; 1 33d34: 70 40 sbci r23, 0x00 ; 0 33d36: 01 10 cpse r0, r1 33d38: d8 f7 brcc .-10 ; 0x33d30 33d3a: 80 95 com r24 33d3c: 90 95 com r25 33d3e: 8e 0f add r24, r30 33d40: 9f 1f adc r25, r31 33d42: 08 95 ret 00033d44 : 33d44: fb 01 movw r30, r22 33d46: 55 91 lpm r21, Z+ 33d48: 55 23 and r21, r21 33d4a: a9 f0 breq .+42 ; 0x33d76 33d4c: bf 01 movw r22, r30 33d4e: dc 01 movw r26, r24 33d50: 4d 91 ld r20, X+ 33d52: 45 17 cp r20, r21 33d54: 41 11 cpse r20, r1 33d56: e1 f7 brne .-8 ; 0x33d50 33d58: 59 f4 brne .+22 ; 0x33d70 33d5a: cd 01 movw r24, r26 33d5c: 05 90 lpm r0, Z+ 33d5e: 00 20 and r0, r0 33d60: 49 f0 breq .+18 ; 0x33d74 33d62: 4d 91 ld r20, X+ 33d64: 40 15 cp r20, r0 33d66: 41 11 cpse r20, r1 33d68: c9 f3 breq .-14 ; 0x33d5c 33d6a: fb 01 movw r30, r22 33d6c: 41 11 cpse r20, r1 33d6e: ef cf rjmp .-34 ; 0x33d4e 33d70: 81 e0 ldi r24, 0x01 ; 1 33d72: 90 e0 ldi r25, 0x00 ; 0 33d74: 01 97 sbiw r24, 0x01 ; 1 33d76: 08 95 ret 00033d78 : 33d78: fc 01 movw r30, r24 33d7a: 61 50 subi r22, 0x01 ; 1 33d7c: 70 40 sbci r23, 0x00 ; 0 33d7e: 01 90 ld r0, Z+ 33d80: 01 10 cpse r0, r1 33d82: d8 f7 brcc .-10 ; 0x33d7a 33d84: 80 95 com r24 33d86: 90 95 com r25 33d88: 8e 0f add r24, r30 33d8a: 9f 1f adc r25, r31 33d8c: 08 95 ret 00033d8e : 33d8e: cf 93 push r28 33d90: df 93 push r29 33d92: ec 01 movw r28, r24 33d94: 2b 81 ldd r18, Y+3 ; 0x03 33d96: 20 ff sbrs r18, 0 33d98: 1a c0 rjmp .+52 ; 0x33dce 33d9a: 26 ff sbrs r18, 6 33d9c: 0c c0 rjmp .+24 ; 0x33db6 33d9e: 2f 7b andi r18, 0xBF ; 191 33da0: 2b 83 std Y+3, r18 ; 0x03 33da2: 8e 81 ldd r24, Y+6 ; 0x06 33da4: 9f 81 ldd r25, Y+7 ; 0x07 33da6: 01 96 adiw r24, 0x01 ; 1 33da8: 9f 83 std Y+7, r25 ; 0x07 33daa: 8e 83 std Y+6, r24 ; 0x06 33dac: 8a 81 ldd r24, Y+2 ; 0x02 33dae: 90 e0 ldi r25, 0x00 ; 0 33db0: df 91 pop r29 33db2: cf 91 pop r28 33db4: 08 95 ret 33db6: 22 ff sbrs r18, 2 33db8: 18 c0 rjmp .+48 ; 0x33dea 33dba: e8 81 ld r30, Y 33dbc: f9 81 ldd r31, Y+1 ; 0x01 33dbe: 80 81 ld r24, Z 33dc0: 08 2e mov r0, r24 33dc2: 00 0c add r0, r0 33dc4: 99 0b sbc r25, r25 33dc6: 00 97 sbiw r24, 0x00 ; 0 33dc8: 29 f4 brne .+10 ; 0x33dd4 33dca: 20 62 ori r18, 0x20 ; 32 33dcc: 2b 83 std Y+3, r18 ; 0x03 33dce: 8f ef ldi r24, 0xFF ; 255 33dd0: 9f ef ldi r25, 0xFF ; 255 33dd2: ee cf rjmp .-36 ; 0x33db0 33dd4: 31 96 adiw r30, 0x01 ; 1 33dd6: f9 83 std Y+1, r31 ; 0x01 33dd8: e8 83 st Y, r30 33dda: 2e 81 ldd r18, Y+6 ; 0x06 33ddc: 3f 81 ldd r19, Y+7 ; 0x07 33dde: 2f 5f subi r18, 0xFF ; 255 33de0: 3f 4f sbci r19, 0xFF ; 255 33de2: 3f 83 std Y+7, r19 ; 0x07 33de4: 2e 83 std Y+6, r18 ; 0x06 33de6: 99 27 eor r25, r25 33de8: e3 cf rjmp .-58 ; 0x33db0 33dea: ea 85 ldd r30, Y+10 ; 0x0a 33dec: fb 85 ldd r31, Y+11 ; 0x0b 33dee: 19 95 eicall 33df0: 97 ff sbrs r25, 7 33df2: f3 cf rjmp .-26 ; 0x33dda 33df4: 2b 81 ldd r18, Y+3 ; 0x03 33df6: 01 96 adiw r24, 0x01 ; 1 33df8: 21 f0 breq .+8 ; 0x33e02 33dfa: 80 e2 ldi r24, 0x20 ; 32 33dfc: 82 2b or r24, r18 33dfe: 8b 83 std Y+3, r24 ; 0x03 33e00: e6 cf rjmp .-52 ; 0x33dce 33e02: 80 e1 ldi r24, 0x10 ; 16 33e04: fb cf rjmp .-10 ; 0x33dfc 00033e06 : 33e06: 0f 93 push r16 33e08: 1f 93 push r17 33e0a: cf 93 push r28 33e0c: df 93 push r29 33e0e: 18 2f mov r17, r24 33e10: 09 2f mov r16, r25 33e12: eb 01 movw r28, r22 33e14: 8b 81 ldd r24, Y+3 ; 0x03 33e16: 81 fd sbrc r24, 1 33e18: 09 c0 rjmp .+18 ; 0x33e2c 33e1a: 1f ef ldi r17, 0xFF ; 255 33e1c: 0f ef ldi r16, 0xFF ; 255 33e1e: 81 2f mov r24, r17 33e20: 90 2f mov r25, r16 33e22: df 91 pop r29 33e24: cf 91 pop r28 33e26: 1f 91 pop r17 33e28: 0f 91 pop r16 33e2a: 08 95 ret 33e2c: 82 ff sbrs r24, 2 33e2e: 14 c0 rjmp .+40 ; 0x33e58 33e30: 2e 81 ldd r18, Y+6 ; 0x06 33e32: 3f 81 ldd r19, Y+7 ; 0x07 33e34: 8c 81 ldd r24, Y+4 ; 0x04 33e36: 9d 81 ldd r25, Y+5 ; 0x05 33e38: 28 17 cp r18, r24 33e3a: 39 07 cpc r19, r25 33e3c: 3c f4 brge .+14 ; 0x33e4c 33e3e: e8 81 ld r30, Y 33e40: f9 81 ldd r31, Y+1 ; 0x01 33e42: cf 01 movw r24, r30 33e44: 01 96 adiw r24, 0x01 ; 1 33e46: 99 83 std Y+1, r25 ; 0x01 33e48: 88 83 st Y, r24 33e4a: 10 83 st Z, r17 33e4c: 8e 81 ldd r24, Y+6 ; 0x06 33e4e: 9f 81 ldd r25, Y+7 ; 0x07 33e50: 01 96 adiw r24, 0x01 ; 1 33e52: 9f 83 std Y+7, r25 ; 0x07 33e54: 8e 83 std Y+6, r24 ; 0x06 33e56: e3 cf rjmp .-58 ; 0x33e1e 33e58: e8 85 ldd r30, Y+8 ; 0x08 33e5a: f9 85 ldd r31, Y+9 ; 0x09 33e5c: 81 2f mov r24, r17 33e5e: 19 95 eicall 33e60: 89 2b or r24, r25 33e62: a1 f3 breq .-24 ; 0x33e4c 33e64: da cf rjmp .-76 ; 0x33e1a 00033e66 : 33e66: ef 92 push r14 33e68: ff 92 push r15 33e6a: 0f 93 push r16 33e6c: 1f 93 push r17 33e6e: cf 93 push r28 33e70: df 93 push r29 33e72: 8c 01 movw r16, r24 33e74: 7b 01 movw r14, r22 33e76: db 01 movw r26, r22 33e78: 13 96 adiw r26, 0x03 ; 3 33e7a: 8c 91 ld r24, X 33e7c: d0 e0 ldi r29, 0x00 ; 0 33e7e: c0 e0 ldi r28, 0x00 ; 0 33e80: 81 fd sbrc r24, 1 33e82: 0f c0 rjmp .+30 ; 0x33ea2 33e84: cf ef ldi r28, 0xFF ; 255 33e86: df ef ldi r29, 0xFF ; 255 33e88: 10 c0 rjmp .+32 ; 0x33eaa 33e8a: d7 01 movw r26, r14 33e8c: 18 96 adiw r26, 0x08 ; 8 33e8e: ed 91 ld r30, X+ 33e90: fc 91 ld r31, X 33e92: b7 01 movw r22, r14 33e94: 19 95 eicall 33e96: 89 2b or r24, r25 33e98: 11 f0 breq .+4 ; 0x33e9e 33e9a: cf ef ldi r28, 0xFF ; 255 33e9c: df ef ldi r29, 0xFF ; 255 33e9e: 0f 5f subi r16, 0xFF ; 255 33ea0: 1f 4f sbci r17, 0xFF ; 255 33ea2: f8 01 movw r30, r16 33ea4: 84 91 lpm r24, Z 33ea6: 81 11 cpse r24, r1 33ea8: f0 cf rjmp .-32 ; 0x33e8a 33eaa: ce 01 movw r24, r28 33eac: df 91 pop r29 33eae: cf 91 pop r28 33eb0: 1f 91 pop r17 33eb2: 0f 91 pop r16 33eb4: ff 90 pop r15 33eb6: ef 90 pop r14 33eb8: 08 95 ret 00033eba : 33eba: 0f 93 push r16 33ebc: 1f 93 push r17 33ebe: cf 93 push r28 33ec0: df 93 push r29 33ec2: cd b7 in r28, 0x3d ; 61 33ec4: de b7 in r29, 0x3e ; 62 33ec6: ae 01 movw r20, r28 33ec8: 48 5f subi r20, 0xF8 ; 248 33eca: 5f 4f sbci r21, 0xFF ; 255 33ecc: da 01 movw r26, r20 33ece: 6d 91 ld r22, X+ 33ed0: 7d 91 ld r23, X+ 33ed2: ad 01 movw r20, r26 33ed4: 0e ef ldi r16, 0xFE ; 254 33ed6: 16 e1 ldi r17, 0x16 ; 22 33ed8: f8 01 movw r30, r16 33eda: 82 81 ldd r24, Z+2 ; 0x02 33edc: 93 81 ldd r25, Z+3 ; 0x03 33ede: dc 01 movw r26, r24 33ee0: 13 96 adiw r26, 0x03 ; 3 33ee2: 2c 91 ld r18, X 33ee4: 13 97 sbiw r26, 0x03 ; 3 33ee6: 28 60 ori r18, 0x08 ; 8 33ee8: 13 96 adiw r26, 0x03 ; 3 33eea: 2c 93 st X, r18 33eec: 0e 94 eb 50 call 0xa1d6 ; 0xa1d6 33ef0: d8 01 movw r26, r16 33ef2: 12 96 adiw r26, 0x02 ; 2 33ef4: ed 91 ld r30, X+ 33ef6: fc 91 ld r31, X 33ef8: 23 81 ldd r18, Z+3 ; 0x03 33efa: 27 7f andi r18, 0xF7 ; 247 33efc: 23 83 std Z+3, r18 ; 0x03 33efe: df 91 pop r29 33f00: cf 91 pop r28 33f02: 1f 91 pop r17 33f04: 0f 91 pop r16 33f06: 08 95 ret 00033f08 : 33f08: 0f 93 push r16 33f0a: 1f 93 push r17 33f0c: cf 93 push r28 33f0e: df 93 push r29 33f10: 8c 01 movw r16, r24 33f12: e0 91 00 17 lds r30, 0x1700 ; 0x801700 <__iob+0x2> 33f16: f0 91 01 17 lds r31, 0x1701 ; 0x801701 <__iob+0x3> 33f1a: 83 81 ldd r24, Z+3 ; 0x03 33f1c: d0 e0 ldi r29, 0x00 ; 0 33f1e: c0 e0 ldi r28, 0x00 ; 0 33f20: 81 fd sbrc r24, 1 33f22: 0a c0 rjmp .+20 ; 0x33f38 33f24: cf ef ldi r28, 0xFF ; 255 33f26: df ef ldi r29, 0xFF ; 255 33f28: 17 c0 rjmp .+46 ; 0x33f58 33f2a: 19 95 eicall 33f2c: 89 2b or r24, r25 33f2e: 11 f0 breq .+4 ; 0x33f34 33f30: cf ef ldi r28, 0xFF ; 255 33f32: df ef ldi r29, 0xFF ; 255 33f34: 0f 5f subi r16, 0xFF ; 255 33f36: 1f 4f sbci r17, 0xFF ; 255 33f38: f8 01 movw r30, r16 33f3a: 84 91 lpm r24, Z 33f3c: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> 33f40: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> 33f44: db 01 movw r26, r22 33f46: 18 96 adiw r26, 0x08 ; 8 33f48: ed 91 ld r30, X+ 33f4a: fc 91 ld r31, X 33f4c: 81 11 cpse r24, r1 33f4e: ed cf rjmp .-38 ; 0x33f2a 33f50: 8a e0 ldi r24, 0x0A ; 10 33f52: 19 95 eicall 33f54: 89 2b or r24, r25 33f56: 31 f7 brne .-52 ; 0x33f24 33f58: ce 01 movw r24, r28 33f5a: df 91 pop r29 33f5c: cf 91 pop r28 33f5e: 1f 91 pop r17 33f60: 0f 91 pop r16 33f62: 08 95 ret 00033f64 : 33f64: 0f 93 push r16 33f66: 1f 93 push r17 33f68: cf 93 push r28 33f6a: df 93 push r29 33f6c: cd b7 in r28, 0x3d ; 61 33f6e: de b7 in r29, 0x3e ; 62 33f70: 2e 97 sbiw r28, 0x0e ; 14 33f72: 0f b6 in r0, 0x3f ; 63 33f74: f8 94 cli 33f76: de bf out 0x3e, r29 ; 62 33f78: 0f be out 0x3f, r0 ; 63 33f7a: cd bf out 0x3d, r28 ; 61 33f7c: 0e 89 ldd r16, Y+22 ; 0x16 33f7e: 1f 89 ldd r17, Y+23 ; 0x17 33f80: 8e e0 ldi r24, 0x0E ; 14 33f82: 8c 83 std Y+4, r24 ; 0x04 33f84: 1a 83 std Y+2, r17 ; 0x02 33f86: 09 83 std Y+1, r16 ; 0x01 33f88: 8f ef ldi r24, 0xFF ; 255 33f8a: 9f e7 ldi r25, 0x7F ; 127 33f8c: 9e 83 std Y+6, r25 ; 0x06 33f8e: 8d 83 std Y+5, r24 ; 0x05 33f90: ae 01 movw r20, r28 33f92: 46 5e subi r20, 0xE6 ; 230 33f94: 5f 4f sbci r21, 0xFF ; 255 33f96: 68 8d ldd r22, Y+24 ; 0x18 33f98: 79 8d ldd r23, Y+25 ; 0x19 33f9a: ce 01 movw r24, r28 33f9c: 01 96 adiw r24, 0x01 ; 1 33f9e: 0e 94 eb 50 call 0xa1d6 ; 0xa1d6 33fa2: 2f 81 ldd r18, Y+7 ; 0x07 33fa4: 38 85 ldd r19, Y+8 ; 0x08 33fa6: 02 0f add r16, r18 33fa8: 13 1f adc r17, r19 33faa: f8 01 movw r30, r16 33fac: 10 82 st Z, r1 33fae: 2e 96 adiw r28, 0x0e ; 14 33fb0: 0f b6 in r0, 0x3f ; 63 33fb2: f8 94 cli 33fb4: de bf out 0x3e, r29 ; 62 33fb6: 0f be out 0x3f, r0 ; 63 33fb8: cd bf out 0x3d, r28 ; 61 33fba: df 91 pop r29 33fbc: cf 91 pop r28 33fbe: 1f 91 pop r17 33fc0: 0f 91 pop r16 33fc2: 08 95 ret 00033fc4 : 33fc4: cf 93 push r28 33fc6: df 93 push r29 33fc8: ec 01 movw r28, r24 33fca: 8b 81 ldd r24, Y+3 ; 0x03 33fcc: 88 60 ori r24, 0x08 ; 8 33fce: 8b 83 std Y+3, r24 ; 0x03 33fd0: ce 01 movw r24, r28 33fd2: 0e 94 eb 50 call 0xa1d6 ; 0xa1d6 33fd6: 2b 81 ldd r18, Y+3 ; 0x03 33fd8: 27 7f andi r18, 0xF7 ; 247 33fda: 2b 83 std Y+3, r18 ; 0x03 33fdc: df 91 pop r29 33fde: cf 91 pop r28 33fe0: 08 95 ret 00033fe2 : 33fe2: 0f 93 push r16 33fe4: 1f 93 push r17 33fe6: cf 93 push r28 33fe8: df 93 push r29 33fea: cd b7 in r28, 0x3d ; 61 33fec: de b7 in r29, 0x3e ; 62 33fee: 2e 97 sbiw r28, 0x0e ; 14 33ff0: 0f b6 in r0, 0x3f ; 63 33ff2: f8 94 cli 33ff4: de bf out 0x3e, r29 ; 62 33ff6: 0f be out 0x3f, r0 ; 63 33ff8: cd bf out 0x3d, r28 ; 61 33ffa: 8c 01 movw r16, r24 33ffc: fa 01 movw r30, r20 33ffe: 8e e0 ldi r24, 0x0E ; 14 34000: 8c 83 std Y+4, r24 ; 0x04 34002: 1a 83 std Y+2, r17 ; 0x02 34004: 09 83 std Y+1, r16 ; 0x01 34006: 77 ff sbrs r23, 7 34008: 02 c0 rjmp .+4 ; 0x3400e 3400a: 60 e0 ldi r22, 0x00 ; 0 3400c: 70 e8 ldi r23, 0x80 ; 128 3400e: 61 50 subi r22, 0x01 ; 1 34010: 71 09 sbc r23, r1 34012: 7e 83 std Y+6, r23 ; 0x06 34014: 6d 83 std Y+5, r22 ; 0x05 34016: a9 01 movw r20, r18 34018: bf 01 movw r22, r30 3401a: ce 01 movw r24, r28 3401c: 01 96 adiw r24, 0x01 ; 1 3401e: 0e 94 eb 50 call 0xa1d6 ; 0xa1d6 34022: 4d 81 ldd r20, Y+5 ; 0x05 34024: 5e 81 ldd r21, Y+6 ; 0x06 34026: 57 fd sbrc r21, 7 34028: 0a c0 rjmp .+20 ; 0x3403e 3402a: 2f 81 ldd r18, Y+7 ; 0x07 3402c: 38 85 ldd r19, Y+8 ; 0x08 3402e: 42 17 cp r20, r18 34030: 53 07 cpc r21, r19 34032: 0c f4 brge .+2 ; 0x34036 34034: 9a 01 movw r18, r20 34036: 02 0f add r16, r18 34038: 13 1f adc r17, r19 3403a: f8 01 movw r30, r16 3403c: 10 82 st Z, r1 3403e: 2e 96 adiw r28, 0x0e ; 14 34040: 0f b6 in r0, 0x3f ; 63 34042: f8 94 cli 34044: de bf out 0x3e, r29 ; 62 34046: 0f be out 0x3f, r0 ; 63 34048: cd bf out 0x3d, r28 ; 61 3404a: df 91 pop r29 3404c: cf 91 pop r28 3404e: 1f 91 pop r17 34050: 0f 91 pop r16 34052: 08 95 ret 00034054 <__ultoa_invert>: 34054: fa 01 movw r30, r20 34056: aa 27 eor r26, r26 34058: 28 30 cpi r18, 0x08 ; 8 3405a: 51 f1 breq .+84 ; 0x340b0 <__ultoa_invert+0x5c> 3405c: 20 31 cpi r18, 0x10 ; 16 3405e: 81 f1 breq .+96 ; 0x340c0 <__ultoa_invert+0x6c> 34060: e8 94 clt 34062: 6f 93 push r22 34064: 6e 7f andi r22, 0xFE ; 254 34066: 6e 5f subi r22, 0xFE ; 254 34068: 7f 4f sbci r23, 0xFF ; 255 3406a: 8f 4f sbci r24, 0xFF ; 255 3406c: 9f 4f sbci r25, 0xFF ; 255 3406e: af 4f sbci r26, 0xFF ; 255 34070: b1 e0 ldi r27, 0x01 ; 1 34072: 3e d0 rcall .+124 ; 0x340f0 <__ultoa_invert+0x9c> 34074: b4 e0 ldi r27, 0x04 ; 4 34076: 3c d0 rcall .+120 ; 0x340f0 <__ultoa_invert+0x9c> 34078: 67 0f add r22, r23 3407a: 78 1f adc r23, r24 3407c: 89 1f adc r24, r25 3407e: 9a 1f adc r25, r26 34080: a1 1d adc r26, r1 34082: 68 0f add r22, r24 34084: 79 1f adc r23, r25 34086: 8a 1f adc r24, r26 34088: 91 1d adc r25, r1 3408a: a1 1d adc r26, r1 3408c: 6a 0f add r22, r26 3408e: 71 1d adc r23, r1 34090: 81 1d adc r24, r1 34092: 91 1d adc r25, r1 34094: a1 1d adc r26, r1 34096: 20 d0 rcall .+64 ; 0x340d8 <__ultoa_invert+0x84> 34098: 09 f4 brne .+2 ; 0x3409c <__ultoa_invert+0x48> 3409a: 68 94 set 3409c: 3f 91 pop r19 3409e: 2a e0 ldi r18, 0x0A ; 10 340a0: 26 9f mul r18, r22 340a2: 11 24 eor r1, r1 340a4: 30 19 sub r19, r0 340a6: 30 5d subi r19, 0xD0 ; 208 340a8: 31 93 st Z+, r19 340aa: de f6 brtc .-74 ; 0x34062 <__ultoa_invert+0xe> 340ac: cf 01 movw r24, r30 340ae: 08 95 ret 340b0: 46 2f mov r20, r22 340b2: 47 70 andi r20, 0x07 ; 7 340b4: 40 5d subi r20, 0xD0 ; 208 340b6: 41 93 st Z+, r20 340b8: b3 e0 ldi r27, 0x03 ; 3 340ba: 0f d0 rcall .+30 ; 0x340da <__ultoa_invert+0x86> 340bc: c9 f7 brne .-14 ; 0x340b0 <__ultoa_invert+0x5c> 340be: f6 cf rjmp .-20 ; 0x340ac <__ultoa_invert+0x58> 340c0: 46 2f mov r20, r22 340c2: 4f 70 andi r20, 0x0F ; 15 340c4: 40 5d subi r20, 0xD0 ; 208 340c6: 4a 33 cpi r20, 0x3A ; 58 340c8: 18 f0 brcs .+6 ; 0x340d0 <__ultoa_invert+0x7c> 340ca: 49 5d subi r20, 0xD9 ; 217 340cc: 31 fd sbrc r19, 1 340ce: 40 52 subi r20, 0x20 ; 32 340d0: 41 93 st Z+, r20 340d2: 02 d0 rcall .+4 ; 0x340d8 <__ultoa_invert+0x84> 340d4: a9 f7 brne .-22 ; 0x340c0 <__ultoa_invert+0x6c> 340d6: ea cf rjmp .-44 ; 0x340ac <__ultoa_invert+0x58> 340d8: b4 e0 ldi r27, 0x04 ; 4 340da: a6 95 lsr r26 340dc: 97 95 ror r25 340de: 87 95 ror r24 340e0: 77 95 ror r23 340e2: 67 95 ror r22 340e4: ba 95 dec r27 340e6: c9 f7 brne .-14 ; 0x340da <__ultoa_invert+0x86> 340e8: 00 97 sbiw r24, 0x00 ; 0 340ea: 61 05 cpc r22, r1 340ec: 71 05 cpc r23, r1 340ee: 08 95 ret 340f0: 9b 01 movw r18, r22 340f2: ac 01 movw r20, r24 340f4: 0a 2e mov r0, r26 340f6: 06 94 lsr r0 340f8: 57 95 ror r21 340fa: 47 95 ror r20 340fc: 37 95 ror r19 340fe: 27 95 ror r18 34100: ba 95 dec r27 34102: c9 f7 brne .-14 ; 0x340f6 <__ultoa_invert+0xa2> 34104: 62 0f add r22, r18 34106: 73 1f adc r23, r19 34108: 84 1f adc r24, r20 3410a: 95 1f adc r25, r21 3410c: a0 1d adc r26, r0 3410e: 08 95 ret 00034110 <__ctype_isfalse>: 34110: 99 27 eor r25, r25 34112: 88 27 eor r24, r24 00034114 <__ctype_istrue>: 34114: 08 95 ret 00034116 : 34116: dc 01 movw r26, r24 34118: cb 01 movw r24, r22 0003411a : 3411a: fc 01 movw r30, r24 3411c: f9 99 sbic 0x1f, 1 ; 31 3411e: fe cf rjmp .-4 ; 0x3411c 34120: 06 c0 rjmp .+12 ; 0x3412e 34122: f2 bd out 0x22, r31 ; 34 34124: e1 bd out 0x21, r30 ; 33 34126: f8 9a sbi 0x1f, 0 ; 31 34128: 31 96 adiw r30, 0x01 ; 1 3412a: 00 b4 in r0, 0x20 ; 32 3412c: 0d 92 st X+, r0 3412e: 41 50 subi r20, 0x01 ; 1 34130: 50 40 sbci r21, 0x00 ; 0 34132: b8 f7 brcc .-18 ; 0x34122 34134: 08 95 ret 00034136 : 34136: f9 99 sbic 0x1f, 1 ; 31 34138: fe cf rjmp .-4 ; 0x34136 3413a: 92 bd out 0x22, r25 ; 34 3413c: 81 bd out 0x21, r24 ; 33 3413e: f8 9a sbi 0x1f, 0 ; 31 34140: 99 27 eor r25, r25 34142: 80 b5 in r24, 0x20 ; 32 34144: 08 95 ret 00034146 : 34146: a6 e1 ldi r26, 0x16 ; 22 34148: b0 e0 ldi r27, 0x00 ; 0 3414a: 44 e0 ldi r20, 0x04 ; 4 3414c: 50 e0 ldi r21, 0x00 ; 0 3414e: 0d 94 8d a0 jmp 0x3411a ; 0x3411a 00034152 : 34152: a8 e1 ldi r26, 0x18 ; 24 34154: b0 e0 ldi r27, 0x00 ; 0 34156: 42 e0 ldi r20, 0x02 ; 2 34158: 50 e0 ldi r21, 0x00 ; 0 3415a: 0d 94 8d a0 jmp 0x3411a ; 0x3411a 0003415e : 3415e: dc 01 movw r26, r24 34160: a4 0f add r26, r20 34162: b5 1f adc r27, r21 34164: 41 50 subi r20, 0x01 ; 1 34166: 50 40 sbci r21, 0x00 ; 0 34168: 48 f0 brcs .+18 ; 0x3417c 3416a: cb 01 movw r24, r22 3416c: 84 0f add r24, r20 3416e: 95 1f adc r25, r21 34170: 2e 91 ld r18, -X 34172: 0f 94 c0 a0 call 0x34180 ; 0x34180 34176: 41 50 subi r20, 0x01 ; 1 34178: 50 40 sbci r21, 0x00 ; 0 3417a: d0 f7 brcc .-12 ; 0x34170 3417c: 08 95 ret 0003417e : 3417e: 26 2f mov r18, r22 00034180 : 34180: f9 99 sbic 0x1f, 1 ; 31 34182: fe cf rjmp .-4 ; 0x34180 34184: 92 bd out 0x22, r25 ; 34 34186: 81 bd out 0x21, r24 ; 33 34188: f8 9a sbi 0x1f, 0 ; 31 3418a: 01 97 sbiw r24, 0x01 ; 1 3418c: 00 b4 in r0, 0x20 ; 32 3418e: 02 16 cp r0, r18 34190: 39 f0 breq .+14 ; 0x341a0 34192: 1f ba out 0x1f, r1 ; 31 34194: 20 bd out 0x20, r18 ; 32 34196: 0f b6 in r0, 0x3f ; 63 34198: f8 94 cli 3419a: fa 9a sbi 0x1f, 2 ; 31 3419c: f9 9a sbi 0x1f, 1 ; 31 3419e: 0f be out 0x3f, r0 ; 63 341a0: 08 95 ret 000341a2 : 341a2: 03 96 adiw r24, 0x03 ; 3 341a4: 27 2f mov r18, r23 341a6: 0f 94 c0 a0 call 0x34180 ; 0x34180 341aa: 0f 94 bf a0 call 0x3417e ; 0x3417e 341ae: 25 2f mov r18, r21 341b0: 0f 94 c0 a0 call 0x34180 ; 0x34180 341b4: 24 2f mov r18, r20 341b6: 0d 94 c0 a0 jmp 0x34180 ; 0x34180 000341ba : 341ba: 01 96 adiw r24, 0x01 ; 1 341bc: 27 2f mov r18, r23 341be: 0f 94 c0 a0 call 0x34180 ; 0x34180 341c2: 0d 94 bf a0 jmp 0x3417e ; 0x3417e 000341c6 : 341c6: 26 2f mov r18, r22 000341c8 : 341c8: f9 99 sbic 0x1f, 1 ; 31 341ca: fe cf rjmp .-4 ; 0x341c8 341cc: 1f ba out 0x1f, r1 ; 31 341ce: 92 bd out 0x22, r25 ; 34 341d0: 81 bd out 0x21, r24 ; 33 341d2: 20 bd out 0x20, r18 ; 32 341d4: 0f b6 in r0, 0x3f ; 63 341d6: f8 94 cli 341d8: fa 9a sbi 0x1f, 2 ; 31 341da: f9 9a sbi 0x1f, 1 ; 31 341dc: 0f be out 0x3f, r0 ; 63 341de: 01 96 adiw r24, 0x01 ; 1 341e0: 08 95 ret 000341e2 : 341e2: 24 2f mov r18, r20 341e4: 0f 94 e4 a0 call 0x341c8 ; 0x341c8 341e8: 25 2f mov r18, r21 341ea: 0f 94 e4 a0 call 0x341c8 ; 0x341c8 341ee: 0d 94 f9 a0 jmp 0x341f2 ; 0x341f2 000341f2 : 341f2: 0f 94 e3 a0 call 0x341c6 ; 0x341c6 341f6: 27 2f mov r18, r23 341f8: 0d 94 e4 a0 jmp 0x341c8 ; 0x341c8 000341fc <__mulsi3>: 341fc: db 01 movw r26, r22 341fe: 8f 93 push r24 34200: 9f 93 push r25 34202: 0f 94 30 a1 call 0x34260 ; 0x34260 <__muluhisi3> 34206: bf 91 pop r27 34208: af 91 pop r26 3420a: a2 9f mul r26, r18 3420c: 80 0d add r24, r0 3420e: 91 1d adc r25, r1 34210: a3 9f mul r26, r19 34212: 90 0d add r25, r0 34214: b2 9f mul r27, r18 34216: 90 0d add r25, r0 34218: 11 24 eor r1, r1 3421a: 08 95 ret 0003421c <__udivmodsi4>: 3421c: a1 e2 ldi r26, 0x21 ; 33 3421e: 1a 2e mov r1, r26 34220: aa 1b sub r26, r26 34222: bb 1b sub r27, r27 34224: fd 01 movw r30, r26 34226: 0d c0 rjmp .+26 ; 0x34242 <__udivmodsi4_ep> 00034228 <__udivmodsi4_loop>: 34228: aa 1f adc r26, r26 3422a: bb 1f adc r27, r27 3422c: ee 1f adc r30, r30 3422e: ff 1f adc r31, r31 34230: a2 17 cp r26, r18 34232: b3 07 cpc r27, r19 34234: e4 07 cpc r30, r20 34236: f5 07 cpc r31, r21 34238: 20 f0 brcs .+8 ; 0x34242 <__udivmodsi4_ep> 3423a: a2 1b sub r26, r18 3423c: b3 0b sbc r27, r19 3423e: e4 0b sbc r30, r20 34240: f5 0b sbc r31, r21 00034242 <__udivmodsi4_ep>: 34242: 66 1f adc r22, r22 34244: 77 1f adc r23, r23 34246: 88 1f adc r24, r24 34248: 99 1f adc r25, r25 3424a: 1a 94 dec r1 3424c: 69 f7 brne .-38 ; 0x34228 <__udivmodsi4_loop> 3424e: 60 95 com r22 34250: 70 95 com r23 34252: 80 95 com r24 34254: 90 95 com r25 34256: 9b 01 movw r18, r22 34258: ac 01 movw r20, r24 3425a: bd 01 movw r22, r26 3425c: cf 01 movw r24, r30 3425e: 08 95 ret 00034260 <__muluhisi3>: 34260: 0f 94 3b a1 call 0x34276 ; 0x34276 <__umulhisi3> 34264: a5 9f mul r26, r21 34266: 90 0d add r25, r0 34268: b4 9f mul r27, r20 3426a: 90 0d add r25, r0 3426c: a4 9f mul r26, r20 3426e: 80 0d add r24, r0 34270: 91 1d adc r25, r1 34272: 11 24 eor r1, r1 34274: 08 95 ret 00034276 <__umulhisi3>: 34276: a2 9f mul r26, r18 34278: b0 01 movw r22, r0 3427a: b3 9f mul r27, r19 3427c: c0 01 movw r24, r0 3427e: a3 9f mul r26, r19 34280: 70 0d add r23, r0 34282: 81 1d adc r24, r1 34284: 11 24 eor r1, r1 34286: 91 1d adc r25, r1 34288: b2 9f mul r27, r18 3428a: 70 0d add r23, r0 3428c: 81 1d adc r24, r1 3428e: 11 24 eor r1, r1 34290: 91 1d adc r25, r1 34292: 08 95 ret 00034294 <__udivmodqi4>: 34294: 99 1b sub r25, r25 34296: 79 e0 ldi r23, 0x09 ; 9 34298: 04 c0 rjmp .+8 ; 0x342a2 <__udivmodqi4_ep> 0003429a <__udivmodqi4_loop>: 3429a: 99 1f adc r25, r25 3429c: 96 17 cp r25, r22 3429e: 08 f0 brcs .+2 ; 0x342a2 <__udivmodqi4_ep> 342a0: 96 1b sub r25, r22 000342a2 <__udivmodqi4_ep>: 342a2: 88 1f adc r24, r24 342a4: 7a 95 dec r23 342a6: c9 f7 brne .-14 ; 0x3429a <__udivmodqi4_loop> 342a8: 80 95 com r24 342aa: 08 95 ret 000342ac <__divmodqi4>: 342ac: 87 fb bst r24, 7 342ae: 08 2e mov r0, r24 342b0: 06 26 eor r0, r22 342b2: 87 fd sbrc r24, 7 342b4: 81 95 neg r24 342b6: 67 fd sbrc r22, 7 342b8: 61 95 neg r22 342ba: 0f 94 4a a1 call 0x34294 ; 0x34294 <__udivmodqi4> 342be: 0e f4 brtc .+2 ; 0x342c2 <__divmodqi4_1> 342c0: 91 95 neg r25 000342c2 <__divmodqi4_1>: 342c2: 07 fc sbrc r0, 7 342c4: 81 95 neg r24 000342c6 <__divmodqi4_exit>: 342c6: 08 95 ret 000342c8 <__udivmodhi4>: 342c8: aa 1b sub r26, r26 342ca: bb 1b sub r27, r27 342cc: 51 e1 ldi r21, 0x11 ; 17 342ce: 07 c0 rjmp .+14 ; 0x342de <__udivmodhi4_ep> 000342d0 <__udivmodhi4_loop>: 342d0: aa 1f adc r26, r26 342d2: bb 1f adc r27, r27 342d4: a6 17 cp r26, r22 342d6: b7 07 cpc r27, r23 342d8: 10 f0 brcs .+4 ; 0x342de <__udivmodhi4_ep> 342da: a6 1b sub r26, r22 342dc: b7 0b sbc r27, r23 000342de <__udivmodhi4_ep>: 342de: 88 1f adc r24, r24 342e0: 99 1f adc r25, r25 342e2: 5a 95 dec r21 342e4: a9 f7 brne .-22 ; 0x342d0 <__udivmodhi4_loop> 342e6: 80 95 com r24 342e8: 90 95 com r25 342ea: bc 01 movw r22, r24 342ec: cd 01 movw r24, r26 342ee: 08 95 ret 000342f0 <__divmodhi4>: 342f0: 97 fb bst r25, 7 342f2: 07 2e mov r0, r23 342f4: 16 f4 brtc .+4 ; 0x342fa <__divmodhi4+0xa> 342f6: 00 94 com r0 342f8: 07 d0 rcall .+14 ; 0x34308 <__divmodhi4_neg1> 342fa: 77 fd sbrc r23, 7 342fc: 09 d0 rcall .+18 ; 0x34310 <__divmodhi4_neg2> 342fe: 0f 94 64 a1 call 0x342c8 ; 0x342c8 <__udivmodhi4> 34302: 07 fc sbrc r0, 7 34304: 05 d0 rcall .+10 ; 0x34310 <__divmodhi4_neg2> 34306: 3e f4 brtc .+14 ; 0x34316 <__divmodhi4_exit> 00034308 <__divmodhi4_neg1>: 34308: 90 95 com r25 3430a: 81 95 neg r24 3430c: 9f 4f sbci r25, 0xFF ; 255 3430e: 08 95 ret 00034310 <__divmodhi4_neg2>: 34310: 70 95 com r23 34312: 61 95 neg r22 34314: 7f 4f sbci r23, 0xFF ; 255 00034316 <__divmodhi4_exit>: 34316: 08 95 ret 00034318 <__divmodsi4>: 34318: 05 2e mov r0, r21 3431a: 97 fb bst r25, 7 3431c: 1e f4 brtc .+6 ; 0x34324 <__divmodsi4+0xc> 3431e: 00 94 com r0 34320: 0f 94 a3 a1 call 0x34346 ; 0x34346 <__negsi2> 34324: 57 fd sbrc r21, 7 34326: 07 d0 rcall .+14 ; 0x34336 <__divmodsi4_neg2> 34328: 0f 94 0e a1 call 0x3421c ; 0x3421c <__udivmodsi4> 3432c: 07 fc sbrc r0, 7 3432e: 03 d0 rcall .+6 ; 0x34336 <__divmodsi4_neg2> 34330: 4e f4 brtc .+18 ; 0x34344 <__divmodsi4_exit> 34332: 0d 94 a3 a1 jmp 0x34346 ; 0x34346 <__negsi2> 00034336 <__divmodsi4_neg2>: 34336: 50 95 com r21 34338: 40 95 com r20 3433a: 30 95 com r19 3433c: 21 95 neg r18 3433e: 3f 4f sbci r19, 0xFF ; 255 34340: 4f 4f sbci r20, 0xFF ; 255 34342: 5f 4f sbci r21, 0xFF ; 255 00034344 <__divmodsi4_exit>: 34344: 08 95 ret 00034346 <__negsi2>: 34346: 90 95 com r25 34348: 80 95 com r24 3434a: 70 95 com r23 3434c: 61 95 neg r22 3434e: 7f 4f sbci r23, 0xFF ; 255 34350: 8f 4f sbci r24, 0xFF ; 255 34352: 9f 4f sbci r25, 0xFF ; 255 34354: 08 95 ret 00034356 <__tablejump2__>: 34356: ee 0f add r30, r30 34358: ff 1f adc r31, r31 3435a: 88 1f adc r24, r24 3435c: 8b bf out 0x3b, r24 ; 59 3435e: 07 90 elpm r0, Z+ 34360: f6 91 elpm r31, Z 34362: e0 2d mov r30, r0 34364: 19 94 eijmp 00034366 <__mulhisi3>: 34366: 0f 94 3b a1 call 0x34276 ; 0x34276 <__umulhisi3> 3436a: 33 23 and r19, r19 3436c: 12 f4 brpl .+4 ; 0x34372 <__mulhisi3+0xc> 3436e: 8a 1b sub r24, r26 34370: 9b 0b sbc r25, r27 34372: 0d 94 bd a1 jmp 0x3437a ; 0x3437a <__usmulhisi3_tail> 00034376 <__usmulhisi3>: 34376: 0f 94 3b a1 call 0x34276 ; 0x34276 <__umulhisi3> 0003437a <__usmulhisi3_tail>: 3437a: b7 ff sbrs r27, 7 3437c: 08 95 ret 3437e: 82 1b sub r24, r18 34380: 93 0b sbc r25, r19 34382: 08 95 ret 00034384 <__subsf3>: 34384: 50 58 subi r21, 0x80 ; 128 00034386 <__addsf3>: 34386: bb 27 eor r27, r27 34388: aa 27 eor r26, r26 3438a: 0f 94 da a1 call 0x343b4 ; 0x343b4 <__addsf3x> 3438e: 0d 94 ec 9b jmp 0x337d8 ; 0x337d8 <__fp_round> 34392: 0f 94 de 9b call 0x337bc ; 0x337bc <__fp_pscA> 34396: 38 f0 brcs .+14 ; 0x343a6 <__addsf3+0x20> 34398: 0f 94 e5 9b call 0x337ca ; 0x337ca <__fp_pscB> 3439c: 20 f0 brcs .+8 ; 0x343a6 <__addsf3+0x20> 3439e: 39 f4 brne .+14 ; 0x343ae <__addsf3+0x28> 343a0: 9f 3f cpi r25, 0xFF ; 255 343a2: 19 f4 brne .+6 ; 0x343aa <__addsf3+0x24> 343a4: 26 f4 brtc .+8 ; 0x343ae <__addsf3+0x28> 343a6: 0d 94 db 9b jmp 0x337b6 ; 0x337b6 <__fp_nan> 343aa: 0e f4 brtc .+2 ; 0x343ae <__addsf3+0x28> 343ac: e0 95 com r30 343ae: e7 fb bst r30, 7 343b0: 0d 94 d5 9b jmp 0x337aa ; 0x337aa <__fp_inf> 000343b4 <__addsf3x>: 343b4: e9 2f mov r30, r25 343b6: 0f 94 fd 9b call 0x337fa ; 0x337fa <__fp_split3> 343ba: 58 f3 brcs .-42 ; 0x34392 <__addsf3+0xc> 343bc: ba 17 cp r27, r26 343be: 62 07 cpc r22, r18 343c0: 73 07 cpc r23, r19 343c2: 84 07 cpc r24, r20 343c4: 95 07 cpc r25, r21 343c6: 20 f0 brcs .+8 ; 0x343d0 <__addsf3x+0x1c> 343c8: 79 f4 brne .+30 ; 0x343e8 <__addsf3x+0x34> 343ca: a6 f5 brtc .+104 ; 0x34434 <__addsf3x+0x80> 343cc: 0d 94 1f 9c jmp 0x3383e ; 0x3383e <__fp_zero> 343d0: 0e f4 brtc .+2 ; 0x343d4 <__addsf3x+0x20> 343d2: e0 95 com r30 343d4: 0b 2e mov r0, r27 343d6: ba 2f mov r27, r26 343d8: a0 2d mov r26, r0 343da: 0b 01 movw r0, r22 343dc: b9 01 movw r22, r18 343de: 90 01 movw r18, r0 343e0: 0c 01 movw r0, r24 343e2: ca 01 movw r24, r20 343e4: a0 01 movw r20, r0 343e6: 11 24 eor r1, r1 343e8: ff 27 eor r31, r31 343ea: 59 1b sub r21, r25 343ec: 99 f0 breq .+38 ; 0x34414 <__addsf3x+0x60> 343ee: 59 3f cpi r21, 0xF9 ; 249 343f0: 50 f4 brcc .+20 ; 0x34406 <__addsf3x+0x52> 343f2: 50 3e cpi r21, 0xE0 ; 224 343f4: 68 f1 brcs .+90 ; 0x34450 <__addsf3x+0x9c> 343f6: 1a 16 cp r1, r26 343f8: f0 40 sbci r31, 0x00 ; 0 343fa: a2 2f mov r26, r18 343fc: 23 2f mov r18, r19 343fe: 34 2f mov r19, r20 34400: 44 27 eor r20, r20 34402: 58 5f subi r21, 0xF8 ; 248 34404: f3 cf rjmp .-26 ; 0x343ec <__addsf3x+0x38> 34406: 46 95 lsr r20 34408: 37 95 ror r19 3440a: 27 95 ror r18 3440c: a7 95 ror r26 3440e: f0 40 sbci r31, 0x00 ; 0 34410: 53 95 inc r21 34412: c9 f7 brne .-14 ; 0x34406 <__addsf3x+0x52> 34414: 7e f4 brtc .+30 ; 0x34434 <__addsf3x+0x80> 34416: 1f 16 cp r1, r31 34418: ba 0b sbc r27, r26 3441a: 62 0b sbc r22, r18 3441c: 73 0b sbc r23, r19 3441e: 84 0b sbc r24, r20 34420: ba f0 brmi .+46 ; 0x34450 <__addsf3x+0x9c> 34422: 91 50 subi r25, 0x01 ; 1 34424: a1 f0 breq .+40 ; 0x3444e <__addsf3x+0x9a> 34426: ff 0f add r31, r31 34428: bb 1f adc r27, r27 3442a: 66 1f adc r22, r22 3442c: 77 1f adc r23, r23 3442e: 88 1f adc r24, r24 34430: c2 f7 brpl .-16 ; 0x34422 <__addsf3x+0x6e> 34432: 0e c0 rjmp .+28 ; 0x34450 <__addsf3x+0x9c> 34434: ba 0f add r27, r26 34436: 62 1f adc r22, r18 34438: 73 1f adc r23, r19 3443a: 84 1f adc r24, r20 3443c: 48 f4 brcc .+18 ; 0x34450 <__addsf3x+0x9c> 3443e: 87 95 ror r24 34440: 77 95 ror r23 34442: 67 95 ror r22 34444: b7 95 ror r27 34446: f7 95 ror r31 34448: 9e 3f cpi r25, 0xFE ; 254 3444a: 08 f0 brcs .+2 ; 0x3444e <__addsf3x+0x9a> 3444c: b0 cf rjmp .-160 ; 0x343ae <__addsf3+0x28> 3444e: 93 95 inc r25 34450: 88 0f add r24, r24 34452: 08 f0 brcs .+2 ; 0x34456 <__addsf3x+0xa2> 34454: 99 27 eor r25, r25 34456: ee 0f add r30, r30 34458: 97 95 ror r25 3445a: 87 95 ror r24 3445c: 08 95 ret 3445e: 0f 94 de 9b call 0x337bc ; 0x337bc <__fp_pscA> 34462: 60 f0 brcs .+24 ; 0x3447c <__addsf3x+0xc8> 34464: 80 e8 ldi r24, 0x80 ; 128 34466: 91 e0 ldi r25, 0x01 ; 1 34468: 09 f4 brne .+2 ; 0x3446c <__addsf3x+0xb8> 3446a: 9e ef ldi r25, 0xFE ; 254 3446c: 0f 94 e5 9b call 0x337ca ; 0x337ca <__fp_pscB> 34470: 28 f0 brcs .+10 ; 0x3447c <__addsf3x+0xc8> 34472: 40 e8 ldi r20, 0x80 ; 128 34474: 51 e0 ldi r21, 0x01 ; 1 34476: 71 f4 brne .+28 ; 0x34494 34478: 5e ef ldi r21, 0xFE ; 254 3447a: 0c c0 rjmp .+24 ; 0x34494 3447c: 0d 94 db 9b jmp 0x337b6 ; 0x337b6 <__fp_nan> 34480: 0d 94 1f 9c jmp 0x3383e ; 0x3383e <__fp_zero> 00034484 : 34484: e9 2f mov r30, r25 34486: e0 78 andi r30, 0x80 ; 128 34488: 0f 94 fd 9b call 0x337fa ; 0x337fa <__fp_split3> 3448c: 40 f3 brcs .-48 ; 0x3445e <__addsf3x+0xaa> 3448e: 09 2e mov r0, r25 34490: 05 2a or r0, r21 34492: b1 f3 breq .-20 ; 0x34480 <__addsf3x+0xcc> 34494: 26 17 cp r18, r22 34496: 37 07 cpc r19, r23 34498: 48 07 cpc r20, r24 3449a: 59 07 cpc r21, r25 3449c: 38 f0 brcs .+14 ; 0x344ac 3449e: 0e 2e mov r0, r30 344a0: 07 f8 bld r0, 7 344a2: e0 25 eor r30, r0 344a4: 69 f0 breq .+26 ; 0x344c0 344a6: e0 25 eor r30, r0 344a8: e0 64 ori r30, 0x40 ; 64 344aa: 0a c0 rjmp .+20 ; 0x344c0 344ac: ef 63 ori r30, 0x3F ; 63 344ae: 07 f8 bld r0, 7 344b0: 00 94 com r0 344b2: 07 fa bst r0, 7 344b4: db 01 movw r26, r22 344b6: b9 01 movw r22, r18 344b8: 9d 01 movw r18, r26 344ba: dc 01 movw r26, r24 344bc: ca 01 movw r24, r20 344be: ad 01 movw r20, r26 344c0: ef 93 push r30 344c2: 0f 94 d9 a2 call 0x345b2 ; 0x345b2 <__divsf3_pse> 344c6: 0f 94 ec 9b call 0x337d8 ; 0x337d8 <__fp_round> 344ca: 0f 94 72 a2 call 0x344e4 ; 0x344e4 344ce: 5f 91 pop r21 344d0: 55 23 and r21, r21 344d2: 39 f0 breq .+14 ; 0x344e2 344d4: 2b ed ldi r18, 0xDB ; 219 344d6: 3f e0 ldi r19, 0x0F ; 15 344d8: 49 e4 ldi r20, 0x49 ; 73 344da: 50 fd sbrc r21, 0 344dc: 49 ec ldi r20, 0xC9 ; 201 344de: 0d 94 c3 a1 jmp 0x34386 ; 0x34386 <__addsf3> 344e2: 08 95 ret 000344e4 : 344e4: df 93 push r29 344e6: dd 27 eor r29, r29 344e8: b9 2f mov r27, r25 344ea: bf 77 andi r27, 0x7F ; 127 344ec: 40 e8 ldi r20, 0x80 ; 128 344ee: 5f e3 ldi r21, 0x3F ; 63 344f0: 16 16 cp r1, r22 344f2: 17 06 cpc r1, r23 344f4: 48 07 cpc r20, r24 344f6: 5b 07 cpc r21, r27 344f8: 18 f4 brcc .+6 ; 0x34500 344fa: d9 2f mov r29, r25 344fc: 0f 94 be a4 call 0x3497c ; 0x3497c 34500: 9f 93 push r25 34502: 8f 93 push r24 34504: 7f 93 push r23 34506: 6f 93 push r22 34508: 0f 94 64 9b call 0x336c8 ; 0x336c8 3450c: e4 e8 ldi r30, 0x84 ; 132 3450e: fc e6 ldi r31, 0x6C ; 108 34510: 0f 94 ce a3 call 0x3479c ; 0x3479c <__fp_powser> 34514: 0f 94 ec 9b call 0x337d8 ; 0x337d8 <__fp_round> 34518: 2f 91 pop r18 3451a: 3f 91 pop r19 3451c: 4f 91 pop r20 3451e: 5f 91 pop r21 34520: 0f 94 7b 9b call 0x336f6 ; 0x336f6 <__mulsf3x> 34524: dd 23 and r29, r29 34526: 51 f0 breq .+20 ; 0x3453c 34528: 90 58 subi r25, 0x80 ; 128 3452a: a2 ea ldi r26, 0xA2 ; 162 3452c: 2a ed ldi r18, 0xDA ; 218 3452e: 3f e0 ldi r19, 0x0F ; 15 34530: 49 ec ldi r20, 0xC9 ; 201 34532: 5f e3 ldi r21, 0x3F ; 63 34534: d0 78 andi r29, 0x80 ; 128 34536: 5d 27 eor r21, r29 34538: 0f 94 da a1 call 0x343b4 ; 0x343b4 <__addsf3x> 3453c: df 91 pop r29 3453e: 0d 94 ec 9b jmp 0x337d8 ; 0x337d8 <__fp_round> 00034542 : 34542: 0f 94 34 a4 call 0x34868 ; 0x34868 <__fp_trunc> 34546: 90 f0 brcs .+36 ; 0x3456c 34548: 9f 37 cpi r25, 0x7F ; 127 3454a: 48 f4 brcc .+18 ; 0x3455e 3454c: 91 11 cpse r25, r1 3454e: 16 f4 brtc .+4 ; 0x34554 34550: 0d 94 20 9c jmp 0x33840 ; 0x33840 <__fp_szero> 34554: 60 e0 ldi r22, 0x00 ; 0 34556: 70 e0 ldi r23, 0x00 ; 0 34558: 80 e8 ldi r24, 0x80 ; 128 3455a: 9f e3 ldi r25, 0x3F ; 63 3455c: 08 95 ret 3455e: 26 f0 brts .+8 ; 0x34568 34560: 1b 16 cp r1, r27 34562: 61 1d adc r22, r1 34564: 71 1d adc r23, r1 34566: 81 1d adc r24, r1 34568: 0d 94 a5 a3 jmp 0x3474a ; 0x3474a <__fp_mintl> 3456c: 0d 94 c0 a3 jmp 0x34780 ; 0x34780 <__fp_mpack> 00034570 <__cmpsf2>: 34570: 0f 94 81 a3 call 0x34702 ; 0x34702 <__fp_cmp> 34574: 08 f4 brcc .+2 ; 0x34578 <__cmpsf2+0x8> 34576: 81 e0 ldi r24, 0x01 ; 1 34578: 08 95 ret 0003457a : 3457a: 0f 94 f7 a3 call 0x347ee ; 0x347ee <__fp_rempio2> 3457e: e3 95 inc r30 34580: 0d 94 20 a4 jmp 0x34840 ; 0x34840 <__fp_sinus> 00034584 <__divsf3>: 34584: 0f 94 d6 a2 call 0x345ac ; 0x345ac <__divsf3x> 34588: 0d 94 ec 9b jmp 0x337d8 ; 0x337d8 <__fp_round> 3458c: 0f 94 e5 9b call 0x337ca ; 0x337ca <__fp_pscB> 34590: 58 f0 brcs .+22 ; 0x345a8 <__divsf3+0x24> 34592: 0f 94 de 9b call 0x337bc ; 0x337bc <__fp_pscA> 34596: 40 f0 brcs .+16 ; 0x345a8 <__divsf3+0x24> 34598: 29 f4 brne .+10 ; 0x345a4 <__divsf3+0x20> 3459a: 5f 3f cpi r21, 0xFF ; 255 3459c: 29 f0 breq .+10 ; 0x345a8 <__divsf3+0x24> 3459e: 0d 94 d5 9b jmp 0x337aa ; 0x337aa <__fp_inf> 345a2: 51 11 cpse r21, r1 345a4: 0d 94 20 9c jmp 0x33840 ; 0x33840 <__fp_szero> 345a8: 0d 94 db 9b jmp 0x337b6 ; 0x337b6 <__fp_nan> 000345ac <__divsf3x>: 345ac: 0f 94 fd 9b call 0x337fa ; 0x337fa <__fp_split3> 345b0: 68 f3 brcs .-38 ; 0x3458c <__divsf3+0x8> 000345b2 <__divsf3_pse>: 345b2: 99 23 and r25, r25 345b4: b1 f3 breq .-20 ; 0x345a2 <__divsf3+0x1e> 345b6: 55 23 and r21, r21 345b8: 91 f3 breq .-28 ; 0x3459e <__divsf3+0x1a> 345ba: 95 1b sub r25, r21 345bc: 55 0b sbc r21, r21 345be: bb 27 eor r27, r27 345c0: aa 27 eor r26, r26 345c2: 62 17 cp r22, r18 345c4: 73 07 cpc r23, r19 345c6: 84 07 cpc r24, r20 345c8: 38 f0 brcs .+14 ; 0x345d8 <__divsf3_pse+0x26> 345ca: 9f 5f subi r25, 0xFF ; 255 345cc: 5f 4f sbci r21, 0xFF ; 255 345ce: 22 0f add r18, r18 345d0: 33 1f adc r19, r19 345d2: 44 1f adc r20, r20 345d4: aa 1f adc r26, r26 345d6: a9 f3 breq .-22 ; 0x345c2 <__divsf3_pse+0x10> 345d8: 35 d0 rcall .+106 ; 0x34644 <__divsf3_pse+0x92> 345da: 0e 2e mov r0, r30 345dc: 3a f0 brmi .+14 ; 0x345ec <__divsf3_pse+0x3a> 345de: e0 e8 ldi r30, 0x80 ; 128 345e0: 32 d0 rcall .+100 ; 0x34646 <__divsf3_pse+0x94> 345e2: 91 50 subi r25, 0x01 ; 1 345e4: 50 40 sbci r21, 0x00 ; 0 345e6: e6 95 lsr r30 345e8: 00 1c adc r0, r0 345ea: ca f7 brpl .-14 ; 0x345de <__divsf3_pse+0x2c> 345ec: 2b d0 rcall .+86 ; 0x34644 <__divsf3_pse+0x92> 345ee: fe 2f mov r31, r30 345f0: 29 d0 rcall .+82 ; 0x34644 <__divsf3_pse+0x92> 345f2: 66 0f add r22, r22 345f4: 77 1f adc r23, r23 345f6: 88 1f adc r24, r24 345f8: bb 1f adc r27, r27 345fa: 26 17 cp r18, r22 345fc: 37 07 cpc r19, r23 345fe: 48 07 cpc r20, r24 34600: ab 07 cpc r26, r27 34602: b0 e8 ldi r27, 0x80 ; 128 34604: 09 f0 breq .+2 ; 0x34608 <__divsf3_pse+0x56> 34606: bb 0b sbc r27, r27 34608: 80 2d mov r24, r0 3460a: bf 01 movw r22, r30 3460c: ff 27 eor r31, r31 3460e: 93 58 subi r25, 0x83 ; 131 34610: 5f 4f sbci r21, 0xFF ; 255 34612: 3a f0 brmi .+14 ; 0x34622 <__divsf3_pse+0x70> 34614: 9e 3f cpi r25, 0xFE ; 254 34616: 51 05 cpc r21, r1 34618: 78 f0 brcs .+30 ; 0x34638 <__divsf3_pse+0x86> 3461a: 0d 94 d5 9b jmp 0x337aa ; 0x337aa <__fp_inf> 3461e: 0d 94 20 9c jmp 0x33840 ; 0x33840 <__fp_szero> 34622: 5f 3f cpi r21, 0xFF ; 255 34624: e4 f3 brlt .-8 ; 0x3461e <__divsf3_pse+0x6c> 34626: 98 3e cpi r25, 0xE8 ; 232 34628: d4 f3 brlt .-12 ; 0x3461e <__divsf3_pse+0x6c> 3462a: 86 95 lsr r24 3462c: 77 95 ror r23 3462e: 67 95 ror r22 34630: b7 95 ror r27 34632: f7 95 ror r31 34634: 9f 5f subi r25, 0xFF ; 255 34636: c9 f7 brne .-14 ; 0x3462a <__divsf3_pse+0x78> 34638: 88 0f add r24, r24 3463a: 91 1d adc r25, r1 3463c: 96 95 lsr r25 3463e: 87 95 ror r24 34640: 97 f9 bld r25, 7 34642: 08 95 ret 34644: e1 e0 ldi r30, 0x01 ; 1 34646: 66 0f add r22, r22 34648: 77 1f adc r23, r23 3464a: 88 1f adc r24, r24 3464c: bb 1f adc r27, r27 3464e: 62 17 cp r22, r18 34650: 73 07 cpc r23, r19 34652: 84 07 cpc r24, r20 34654: ba 07 cpc r27, r26 34656: 20 f0 brcs .+8 ; 0x34660 <__divsf3_pse+0xae> 34658: 62 1b sub r22, r18 3465a: 73 0b sbc r23, r19 3465c: 84 0b sbc r24, r20 3465e: ba 0b sbc r27, r26 34660: ee 1f adc r30, r30 34662: 88 f7 brcc .-30 ; 0x34646 <__divsf3_pse+0x94> 34664: e0 95 com r30 34666: 08 95 ret 00034668 <__fixsfsi>: 34668: 0f 94 3b a3 call 0x34676 ; 0x34676 <__fixunssfsi> 3466c: 68 94 set 3466e: b1 11 cpse r27, r1 34670: 0d 94 20 9c jmp 0x33840 ; 0x33840 <__fp_szero> 34674: 08 95 ret 00034676 <__fixunssfsi>: 34676: 0f 94 05 9c call 0x3380a ; 0x3380a <__fp_splitA> 3467a: 88 f0 brcs .+34 ; 0x3469e <__fixunssfsi+0x28> 3467c: 9f 57 subi r25, 0x7F ; 127 3467e: 98 f0 brcs .+38 ; 0x346a6 <__fixunssfsi+0x30> 34680: b9 2f mov r27, r25 34682: 99 27 eor r25, r25 34684: b7 51 subi r27, 0x17 ; 23 34686: b0 f0 brcs .+44 ; 0x346b4 <__fixunssfsi+0x3e> 34688: e1 f0 breq .+56 ; 0x346c2 <__fixunssfsi+0x4c> 3468a: 66 0f add r22, r22 3468c: 77 1f adc r23, r23 3468e: 88 1f adc r24, r24 34690: 99 1f adc r25, r25 34692: 1a f0 brmi .+6 ; 0x3469a <__fixunssfsi+0x24> 34694: ba 95 dec r27 34696: c9 f7 brne .-14 ; 0x3468a <__fixunssfsi+0x14> 34698: 14 c0 rjmp .+40 ; 0x346c2 <__fixunssfsi+0x4c> 3469a: b1 30 cpi r27, 0x01 ; 1 3469c: 91 f0 breq .+36 ; 0x346c2 <__fixunssfsi+0x4c> 3469e: 0f 94 1f 9c call 0x3383e ; 0x3383e <__fp_zero> 346a2: b1 e0 ldi r27, 0x01 ; 1 346a4: 08 95 ret 346a6: 0d 94 1f 9c jmp 0x3383e ; 0x3383e <__fp_zero> 346aa: 67 2f mov r22, r23 346ac: 78 2f mov r23, r24 346ae: 88 27 eor r24, r24 346b0: b8 5f subi r27, 0xF8 ; 248 346b2: 39 f0 breq .+14 ; 0x346c2 <__fixunssfsi+0x4c> 346b4: b9 3f cpi r27, 0xF9 ; 249 346b6: cc f3 brlt .-14 ; 0x346aa <__fixunssfsi+0x34> 346b8: 86 95 lsr r24 346ba: 77 95 ror r23 346bc: 67 95 ror r22 346be: b3 95 inc r27 346c0: d9 f7 brne .-10 ; 0x346b8 <__fixunssfsi+0x42> 346c2: 3e f4 brtc .+14 ; 0x346d2 <__fixunssfsi+0x5c> 346c4: 90 95 com r25 346c6: 80 95 com r24 346c8: 70 95 com r23 346ca: 61 95 neg r22 346cc: 7f 4f sbci r23, 0xFF ; 255 346ce: 8f 4f sbci r24, 0xFF ; 255 346d0: 9f 4f sbci r25, 0xFF ; 255 346d2: 08 95 ret 000346d4 : 346d4: 0f 94 34 a4 call 0x34868 ; 0x34868 <__fp_trunc> 346d8: 90 f0 brcs .+36 ; 0x346fe 346da: 9f 37 cpi r25, 0x7F ; 127 346dc: 48 f4 brcc .+18 ; 0x346f0 346de: 91 11 cpse r25, r1 346e0: 16 f0 brts .+4 ; 0x346e6 346e2: 0d 94 20 9c jmp 0x33840 ; 0x33840 <__fp_szero> 346e6: 60 e0 ldi r22, 0x00 ; 0 346e8: 70 e0 ldi r23, 0x00 ; 0 346ea: 80 e8 ldi r24, 0x80 ; 128 346ec: 9f eb ldi r25, 0xBF ; 191 346ee: 08 95 ret 346f0: 26 f4 brtc .+8 ; 0x346fa 346f2: 1b 16 cp r1, r27 346f4: 61 1d adc r22, r1 346f6: 71 1d adc r23, r1 346f8: 81 1d adc r24, r1 346fa: 0d 94 a5 a3 jmp 0x3474a ; 0x3474a <__fp_mintl> 346fe: 0d 94 c0 a3 jmp 0x34780 ; 0x34780 <__fp_mpack> 00034702 <__fp_cmp>: 34702: 99 0f add r25, r25 34704: 00 08 sbc r0, r0 34706: 55 0f add r21, r21 34708: aa 0b sbc r26, r26 3470a: e0 e8 ldi r30, 0x80 ; 128 3470c: fe ef ldi r31, 0xFE ; 254 3470e: 16 16 cp r1, r22 34710: 17 06 cpc r1, r23 34712: e8 07 cpc r30, r24 34714: f9 07 cpc r31, r25 34716: c0 f0 brcs .+48 ; 0x34748 <__fp_cmp+0x46> 34718: 12 16 cp r1, r18 3471a: 13 06 cpc r1, r19 3471c: e4 07 cpc r30, r20 3471e: f5 07 cpc r31, r21 34720: 98 f0 brcs .+38 ; 0x34748 <__fp_cmp+0x46> 34722: 62 1b sub r22, r18 34724: 73 0b sbc r23, r19 34726: 84 0b sbc r24, r20 34728: 95 0b sbc r25, r21 3472a: 39 f4 brne .+14 ; 0x3473a <__fp_cmp+0x38> 3472c: 0a 26 eor r0, r26 3472e: 61 f0 breq .+24 ; 0x34748 <__fp_cmp+0x46> 34730: 23 2b or r18, r19 34732: 24 2b or r18, r20 34734: 25 2b or r18, r21 34736: 21 f4 brne .+8 ; 0x34740 <__fp_cmp+0x3e> 34738: 08 95 ret 3473a: 0a 26 eor r0, r26 3473c: 09 f4 brne .+2 ; 0x34740 <__fp_cmp+0x3e> 3473e: a1 40 sbci r26, 0x01 ; 1 34740: a6 95 lsr r26 34742: 8f ef ldi r24, 0xFF ; 255 34744: 81 1d adc r24, r1 34746: 81 1d adc r24, r1 34748: 08 95 ret 0003474a <__fp_mintl>: 3474a: 88 23 and r24, r24 3474c: 71 f4 brne .+28 ; 0x3476a <__fp_mintl+0x20> 3474e: 77 23 and r23, r23 34750: 21 f0 breq .+8 ; 0x3475a <__fp_mintl+0x10> 34752: 98 50 subi r25, 0x08 ; 8 34754: 87 2b or r24, r23 34756: 76 2f mov r23, r22 34758: 07 c0 rjmp .+14 ; 0x34768 <__fp_mintl+0x1e> 3475a: 66 23 and r22, r22 3475c: 11 f4 brne .+4 ; 0x34762 <__fp_mintl+0x18> 3475e: 99 27 eor r25, r25 34760: 0d c0 rjmp .+26 ; 0x3477c <__fp_mintl+0x32> 34762: 90 51 subi r25, 0x10 ; 16 34764: 86 2b or r24, r22 34766: 70 e0 ldi r23, 0x00 ; 0 34768: 60 e0 ldi r22, 0x00 ; 0 3476a: 2a f0 brmi .+10 ; 0x34776 <__fp_mintl+0x2c> 3476c: 9a 95 dec r25 3476e: 66 0f add r22, r22 34770: 77 1f adc r23, r23 34772: 88 1f adc r24, r24 34774: da f7 brpl .-10 ; 0x3476c <__fp_mintl+0x22> 34776: 88 0f add r24, r24 34778: 96 95 lsr r25 3477a: 87 95 ror r24 3477c: 97 f9 bld r25, 7 3477e: 08 95 ret 00034780 <__fp_mpack>: 34780: 9f 3f cpi r25, 0xFF ; 255 34782: 31 f0 breq .+12 ; 0x34790 <__fp_mpack_finite+0xc> 00034784 <__fp_mpack_finite>: 34784: 91 50 subi r25, 0x01 ; 1 34786: 20 f4 brcc .+8 ; 0x34790 <__fp_mpack_finite+0xc> 34788: 87 95 ror r24 3478a: 77 95 ror r23 3478c: 67 95 ror r22 3478e: b7 95 ror r27 34790: 88 0f add r24, r24 34792: 91 1d adc r25, r1 34794: 96 95 lsr r25 34796: 87 95 ror r24 34798: 97 f9 bld r25, 7 3479a: 08 95 ret 0003479c <__fp_powser>: 3479c: df 93 push r29 3479e: cf 93 push r28 347a0: 1f 93 push r17 347a2: 0f 93 push r16 347a4: ff 92 push r15 347a6: ef 92 push r14 347a8: df 92 push r13 347aa: 7b 01 movw r14, r22 347ac: 8c 01 movw r16, r24 347ae: 68 94 set 347b0: 06 c0 rjmp .+12 ; 0x347be <__fp_powser+0x22> 347b2: da 2e mov r13, r26 347b4: ef 01 movw r28, r30 347b6: 0f 94 7b 9b call 0x336f6 ; 0x336f6 <__mulsf3x> 347ba: fe 01 movw r30, r28 347bc: e8 94 clt 347be: a5 91 lpm r26, Z+ 347c0: 25 91 lpm r18, Z+ 347c2: 35 91 lpm r19, Z+ 347c4: 45 91 lpm r20, Z+ 347c6: 55 91 lpm r21, Z+ 347c8: a6 f3 brts .-24 ; 0x347b2 <__fp_powser+0x16> 347ca: ef 01 movw r28, r30 347cc: 0f 94 da a1 call 0x343b4 ; 0x343b4 <__addsf3x> 347d0: fe 01 movw r30, r28 347d2: 97 01 movw r18, r14 347d4: a8 01 movw r20, r16 347d6: da 94 dec r13 347d8: 69 f7 brne .-38 ; 0x347b4 <__fp_powser+0x18> 347da: df 90 pop r13 347dc: ef 90 pop r14 347de: ff 90 pop r15 347e0: 0f 91 pop r16 347e2: 1f 91 pop r17 347e4: cf 91 pop r28 347e6: df 91 pop r29 347e8: 08 95 ret 347ea: 0d 94 db 9b jmp 0x337b6 ; 0x337b6 <__fp_nan> 000347ee <__fp_rempio2>: 347ee: 0f 94 05 9c call 0x3380a ; 0x3380a <__fp_splitA> 347f2: d8 f3 brcs .-10 ; 0x347ea <__fp_powser+0x4e> 347f4: e8 94 clt 347f6: e0 e0 ldi r30, 0x00 ; 0 347f8: bb 27 eor r27, r27 347fa: 9f 57 subi r25, 0x7F ; 127 347fc: f0 f0 brcs .+60 ; 0x3483a <__fp_rempio2+0x4c> 347fe: 2a ed ldi r18, 0xDA ; 218 34800: 3f e0 ldi r19, 0x0F ; 15 34802: 49 ec ldi r20, 0xC9 ; 201 34804: 06 c0 rjmp .+12 ; 0x34812 <__fp_rempio2+0x24> 34806: ee 0f add r30, r30 34808: bb 0f add r27, r27 3480a: 66 1f adc r22, r22 3480c: 77 1f adc r23, r23 3480e: 88 1f adc r24, r24 34810: 28 f0 brcs .+10 ; 0x3481c <__fp_rempio2+0x2e> 34812: b2 3a cpi r27, 0xA2 ; 162 34814: 62 07 cpc r22, r18 34816: 73 07 cpc r23, r19 34818: 84 07 cpc r24, r20 3481a: 28 f0 brcs .+10 ; 0x34826 <__fp_rempio2+0x38> 3481c: b2 5a subi r27, 0xA2 ; 162 3481e: 62 0b sbc r22, r18 34820: 73 0b sbc r23, r19 34822: 84 0b sbc r24, r20 34824: e3 95 inc r30 34826: 9a 95 dec r25 34828: 72 f7 brpl .-36 ; 0x34806 <__fp_rempio2+0x18> 3482a: 80 38 cpi r24, 0x80 ; 128 3482c: 30 f4 brcc .+12 ; 0x3483a <__fp_rempio2+0x4c> 3482e: 9a 95 dec r25 34830: bb 0f add r27, r27 34832: 66 1f adc r22, r22 34834: 77 1f adc r23, r23 34836: 88 1f adc r24, r24 34838: d2 f7 brpl .-12 ; 0x3482e <__fp_rempio2+0x40> 3483a: 90 48 sbci r25, 0x80 ; 128 3483c: 0d 94 c2 a3 jmp 0x34784 ; 0x34784 <__fp_mpack_finite> 00034840 <__fp_sinus>: 34840: ef 93 push r30 34842: e0 ff sbrs r30, 0 34844: 07 c0 rjmp .+14 ; 0x34854 <__fp_sinus+0x14> 34846: a2 ea ldi r26, 0xA2 ; 162 34848: 2a ed ldi r18, 0xDA ; 218 3484a: 3f e0 ldi r19, 0x0F ; 15 3484c: 49 ec ldi r20, 0xC9 ; 201 3484e: 5f eb ldi r21, 0xBF ; 191 34850: 0f 94 da a1 call 0x343b4 ; 0x343b4 <__addsf3x> 34854: 0f 94 ec 9b call 0x337d8 ; 0x337d8 <__fp_round> 34858: 0f 90 pop r0 3485a: 03 94 inc r0 3485c: 01 fc sbrc r0, 1 3485e: 90 58 subi r25, 0x80 ; 128 34860: e1 eb ldi r30, 0xB1 ; 177 34862: fc e6 ldi r31, 0x6C ; 108 34864: 0d 94 17 a6 jmp 0x34c2e ; 0x34c2e <__fp_powsodd> 00034868 <__fp_trunc>: 34868: 0f 94 05 9c call 0x3380a ; 0x3380a <__fp_splitA> 3486c: a0 f0 brcs .+40 ; 0x34896 <__fp_trunc+0x2e> 3486e: be e7 ldi r27, 0x7E ; 126 34870: b9 17 cp r27, r25 34872: 88 f4 brcc .+34 ; 0x34896 <__fp_trunc+0x2e> 34874: bb 27 eor r27, r27 34876: 9f 38 cpi r25, 0x8F ; 143 34878: 60 f4 brcc .+24 ; 0x34892 <__fp_trunc+0x2a> 3487a: 16 16 cp r1, r22 3487c: b1 1d adc r27, r1 3487e: 67 2f mov r22, r23 34880: 78 2f mov r23, r24 34882: 88 27 eor r24, r24 34884: 98 5f subi r25, 0xF8 ; 248 34886: f7 cf rjmp .-18 ; 0x34876 <__fp_trunc+0xe> 34888: 86 95 lsr r24 3488a: 77 95 ror r23 3488c: 67 95 ror r22 3488e: b1 1d adc r27, r1 34890: 93 95 inc r25 34892: 96 39 cpi r25, 0x96 ; 150 34894: c8 f3 brcs .-14 ; 0x34888 <__fp_trunc+0x20> 34896: 08 95 ret 00034898 <__gesf2>: 34898: 0f 94 81 a3 call 0x34702 ; 0x34702 <__fp_cmp> 3489c: 08 f4 brcc .+2 ; 0x348a0 <__gesf2+0x8> 3489e: 8f ef ldi r24, 0xFF ; 255 348a0: 08 95 ret 348a2: 0f 94 de 9b call 0x337bc ; 0x337bc <__fp_pscA> 348a6: 29 f0 breq .+10 ; 0x348b2 <__gesf2+0x1a> 348a8: 0f 94 e5 9b call 0x337ca ; 0x337ca <__fp_pscB> 348ac: 11 f0 breq .+4 ; 0x348b2 <__gesf2+0x1a> 348ae: 0d 94 db 9b jmp 0x337b6 ; 0x337b6 <__fp_nan> 348b2: 0d 94 d5 9b jmp 0x337aa ; 0x337aa <__fp_inf> 348b6: b9 01 movw r22, r18 348b8: ca 01 movw r24, r20 348ba: 0d 94 c0 a3 jmp 0x34780 ; 0x34780 <__fp_mpack> 000348be : 348be: 9f 77 andi r25, 0x7F ; 127 348c0: 5f 77 andi r21, 0x7F ; 127 348c2: 0f 94 fd 9b call 0x337fa ; 0x337fa <__fp_split3> 348c6: 68 f3 brcs .-38 ; 0x348a2 <__gesf2+0xa> 348c8: 99 23 and r25, r25 348ca: a9 f3 breq .-22 ; 0x348b6 <__gesf2+0x1e> 348cc: 55 23 and r21, r21 348ce: a9 f3 breq .-22 ; 0x348ba <__gesf2+0x22> 348d0: ff 27 eor r31, r31 348d2: 95 17 cp r25, r21 348d4: 58 f4 brcc .+22 ; 0x348ec 348d6: e5 2f mov r30, r21 348d8: e9 1b sub r30, r25 348da: ed 30 cpi r30, 0x0D ; 13 348dc: 60 f7 brcc .-40 ; 0x348b6 <__gesf2+0x1e> 348de: 5e 3b cpi r21, 0xBE ; 190 348e0: 10 f0 brcs .+4 ; 0x348e6 348e2: f1 e4 ldi r31, 0x41 ; 65 348e4: 1c c0 rjmp .+56 ; 0x3491e 348e6: 90 34 cpi r25, 0x40 ; 64 348e8: e0 f4 brcc .+56 ; 0x34922 348ea: 0a c0 rjmp .+20 ; 0x34900 348ec: e9 2f mov r30, r25 348ee: e5 1b sub r30, r21 348f0: ed 30 cpi r30, 0x0D ; 13 348f2: 18 f7 brcc .-58 ; 0x348ba <__gesf2+0x22> 348f4: 9e 3b cpi r25, 0xBE ; 190 348f6: 10 f0 brcs .+4 ; 0x348fc 348f8: f1 e4 ldi r31, 0x41 ; 65 348fa: 11 c0 rjmp .+34 ; 0x3491e 348fc: 50 34 cpi r21, 0x40 ; 64 348fe: 88 f4 brcc .+34 ; 0x34922 34900: f9 ea ldi r31, 0xA9 ; 169 34902: 88 23 and r24, r24 34904: 2a f0 brmi .+10 ; 0x34910 34906: 9a 95 dec r25 34908: 66 0f add r22, r22 3490a: 77 1f adc r23, r23 3490c: 88 1f adc r24, r24 3490e: da f7 brpl .-10 ; 0x34906 34910: 44 23 and r20, r20 34912: 2a f0 brmi .+10 ; 0x3491e 34914: 5a 95 dec r21 34916: 22 0f add r18, r18 34918: 33 1f adc r19, r19 3491a: 44 1f adc r20, r20 3491c: da f7 brpl .-10 ; 0x34914 3491e: 9f 1b sub r25, r31 34920: 5f 1b sub r21, r31 34922: ff 93 push r31 34924: 1f 93 push r17 34926: 0f 93 push r16 34928: ff 92 push r15 3492a: ef 92 push r14 3492c: 79 01 movw r14, r18 3492e: 8a 01 movw r16, r20 34930: bb 27 eor r27, r27 34932: ab 2f mov r26, r27 34934: 9b 01 movw r18, r22 34936: ac 01 movw r20, r24 34938: 0f 94 7e 9b call 0x336fc ; 0x336fc <__mulsf3_pse> 3493c: 97 01 movw r18, r14 3493e: a8 01 movw r20, r16 34940: bf 93 push r27 34942: 7b 01 movw r14, r22 34944: 8c 01 movw r16, r24 34946: aa 27 eor r26, r26 34948: ba 2f mov r27, r26 3494a: b9 01 movw r22, r18 3494c: ca 01 movw r24, r20 3494e: 0f 94 7e 9b call 0x336fc ; 0x336fc <__mulsf3_pse> 34952: af 91 pop r26 34954: 97 01 movw r18, r14 34956: a8 01 movw r20, r16 34958: ef 90 pop r14 3495a: ff 90 pop r15 3495c: 0f 91 pop r16 3495e: 1f 91 pop r17 34960: 0f 94 da a1 call 0x343b4 ; 0x343b4 <__addsf3x> 34964: 0f 94 ec 9b call 0x337d8 ; 0x337d8 <__fp_round> 34968: 0f 94 91 a5 call 0x34b22 ; 0x34b22 3496c: 4f 91 pop r20 3496e: 40 ff sbrs r20, 0 34970: 08 95 ret 34972: 55 27 eor r21, r21 34974: 47 fd sbrc r20, 7 34976: 50 95 com r21 34978: 0d 94 ca a4 jmp 0x34994 ; 0x34994 0003497c : 3497c: 9b 01 movw r18, r22 3497e: ac 01 movw r20, r24 34980: 60 e0 ldi r22, 0x00 ; 0 34982: 70 e0 ldi r23, 0x00 ; 0 34984: 80 e8 ldi r24, 0x80 ; 128 34986: 9f e3 ldi r25, 0x3F ; 63 34988: 0d 94 c2 a2 jmp 0x34584 ; 0x34584 <__divsf3> 3498c: 0d 94 d5 9b jmp 0x337aa ; 0x337aa <__fp_inf> 34990: 0d 94 c0 a3 jmp 0x34780 ; 0x34780 <__fp_mpack> 00034994 : 34994: 0f 94 05 9c call 0x3380a ; 0x3380a <__fp_splitA> 34998: d8 f3 brcs .-10 ; 0x34990 3499a: 99 23 and r25, r25 3499c: c9 f3 breq .-14 ; 0x34990 3499e: 94 0f add r25, r20 349a0: 51 1d adc r21, r1 349a2: a3 f3 brvs .-24 ; 0x3498c 349a4: 91 50 subi r25, 0x01 ; 1 349a6: 50 40 sbci r21, 0x00 ; 0 349a8: 94 f0 brlt .+36 ; 0x349ce 349aa: 59 f0 breq .+22 ; 0x349c2 349ac: 88 23 and r24, r24 349ae: 32 f0 brmi .+12 ; 0x349bc 349b0: 66 0f add r22, r22 349b2: 77 1f adc r23, r23 349b4: 88 1f adc r24, r24 349b6: 91 50 subi r25, 0x01 ; 1 349b8: 50 40 sbci r21, 0x00 ; 0 349ba: c1 f7 brne .-16 ; 0x349ac 349bc: 9e 3f cpi r25, 0xFE ; 254 349be: 51 05 cpc r21, r1 349c0: 2c f7 brge .-54 ; 0x3498c 349c2: 88 0f add r24, r24 349c4: 91 1d adc r25, r1 349c6: 96 95 lsr r25 349c8: 87 95 ror r24 349ca: 97 f9 bld r25, 7 349cc: 08 95 ret 349ce: 5f 3f cpi r21, 0xFF ; 255 349d0: ac f0 brlt .+42 ; 0x349fc 349d2: 98 3e cpi r25, 0xE8 ; 232 349d4: 9c f0 brlt .+38 ; 0x349fc 349d6: bb 27 eor r27, r27 349d8: 86 95 lsr r24 349da: 77 95 ror r23 349dc: 67 95 ror r22 349de: b7 95 ror r27 349e0: 08 f4 brcc .+2 ; 0x349e4 349e2: b1 60 ori r27, 0x01 ; 1 349e4: 93 95 inc r25 349e6: c1 f7 brne .-16 ; 0x349d8 349e8: bb 0f add r27, r27 349ea: 58 f7 brcc .-42 ; 0x349c2 349ec: 11 f4 brne .+4 ; 0x349f2 349ee: 60 ff sbrs r22, 0 349f0: e8 cf rjmp .-48 ; 0x349c2 349f2: 6f 5f subi r22, 0xFF ; 255 349f4: 7f 4f sbci r23, 0xFF ; 255 349f6: 8f 4f sbci r24, 0xFF ; 255 349f8: 9f 4f sbci r25, 0xFF ; 255 349fa: e3 cf rjmp .-58 ; 0x349c2 349fc: 0d 94 20 9c jmp 0x33840 ; 0x33840 <__fp_szero> 00034a00 : 34a00: 0f 94 05 9c call 0x3380a ; 0x3380a <__fp_splitA> 34a04: 58 f1 brcs .+86 ; 0x34a5c 34a06: 9e 57 subi r25, 0x7E ; 126 34a08: 60 f1 brcs .+88 ; 0x34a62 34a0a: 98 51 subi r25, 0x18 ; 24 34a0c: a0 f0 brcs .+40 ; 0x34a36 34a0e: e9 f0 breq .+58 ; 0x34a4a 34a10: 98 30 cpi r25, 0x08 ; 8 34a12: 20 f5 brcc .+72 ; 0x34a5c 34a14: 09 2e mov r0, r25 34a16: 99 27 eor r25, r25 34a18: 66 0f add r22, r22 34a1a: 77 1f adc r23, r23 34a1c: 88 1f adc r24, r24 34a1e: 99 1f adc r25, r25 34a20: 0a 94 dec r0 34a22: d1 f7 brne .-12 ; 0x34a18 34a24: 12 c0 rjmp .+36 ; 0x34a4a 34a26: 06 2e mov r0, r22 34a28: 67 2f mov r22, r23 34a2a: 78 2f mov r23, r24 34a2c: 88 27 eor r24, r24 34a2e: 98 5f subi r25, 0xF8 ; 248 34a30: 11 f4 brne .+4 ; 0x34a36 34a32: 00 0c add r0, r0 34a34: 07 c0 rjmp .+14 ; 0x34a44 34a36: 99 3f cpi r25, 0xF9 ; 249 34a38: b4 f3 brlt .-20 ; 0x34a26 34a3a: 86 95 lsr r24 34a3c: 77 95 ror r23 34a3e: 67 95 ror r22 34a40: 93 95 inc r25 34a42: d9 f7 brne .-10 ; 0x34a3a 34a44: 61 1d adc r22, r1 34a46: 71 1d adc r23, r1 34a48: 81 1d adc r24, r1 34a4a: 3e f4 brtc .+14 ; 0x34a5a 34a4c: 90 95 com r25 34a4e: 80 95 com r24 34a50: 70 95 com r23 34a52: 61 95 neg r22 34a54: 7f 4f sbci r23, 0xFF ; 255 34a56: 8f 4f sbci r24, 0xFF ; 255 34a58: 9f 4f sbci r25, 0xFF ; 255 34a5a: 08 95 ret 34a5c: 68 94 set 34a5e: 0d 94 20 9c jmp 0x33840 ; 0x33840 <__fp_szero> 34a62: 0d 94 1f 9c jmp 0x3383e ; 0x3383e <__fp_zero> 00034a66 : 34a66: fa 01 movw r30, r20 34a68: ee 0f add r30, r30 34a6a: ff 1f adc r31, r31 34a6c: 30 96 adiw r30, 0x00 ; 0 34a6e: 21 05 cpc r18, r1 34a70: 31 05 cpc r19, r1 34a72: a1 f1 breq .+104 ; 0x34adc 34a74: 61 15 cp r22, r1 34a76: 71 05 cpc r23, r1 34a78: 61 f4 brne .+24 ; 0x34a92 34a7a: 80 38 cpi r24, 0x80 ; 128 34a7c: bf e3 ldi r27, 0x3F ; 63 34a7e: 9b 07 cpc r25, r27 34a80: 49 f1 breq .+82 ; 0x34ad4 34a82: 68 94 set 34a84: 90 38 cpi r25, 0x80 ; 128 34a86: 81 05 cpc r24, r1 34a88: 61 f0 breq .+24 ; 0x34aa2 34a8a: 80 38 cpi r24, 0x80 ; 128 34a8c: bf ef ldi r27, 0xFF ; 255 34a8e: 9b 07 cpc r25, r27 34a90: 41 f0 breq .+16 ; 0x34aa2 34a92: 99 23 and r25, r25 34a94: 4a f5 brpl .+82 ; 0x34ae8 34a96: ff 3f cpi r31, 0xFF ; 255 34a98: e1 05 cpc r30, r1 34a9a: 31 05 cpc r19, r1 34a9c: 21 05 cpc r18, r1 34a9e: 19 f1 breq .+70 ; 0x34ae6 34aa0: e8 94 clt 34aa2: 08 94 sec 34aa4: e7 95 ror r30 34aa6: d9 01 movw r26, r18 34aa8: aa 23 and r26, r26 34aaa: 29 f4 brne .+10 ; 0x34ab6 34aac: ab 2f mov r26, r27 34aae: be 2f mov r27, r30 34ab0: f8 5f subi r31, 0xF8 ; 248 34ab2: d0 f3 brcs .-12 ; 0x34aa8 34ab4: 10 c0 rjmp .+32 ; 0x34ad6 34ab6: ff 5f subi r31, 0xFF ; 255 34ab8: 70 f4 brcc .+28 ; 0x34ad6 34aba: a6 95 lsr r26 34abc: e0 f7 brcc .-8 ; 0x34ab6 34abe: f7 39 cpi r31, 0x97 ; 151 34ac0: 50 f0 brcs .+20 ; 0x34ad6 34ac2: 19 f0 breq .+6 ; 0x34aca 34ac4: ff 3a cpi r31, 0xAF ; 175 34ac6: 38 f4 brcc .+14 ; 0x34ad6 34ac8: 9f 77 andi r25, 0x7F ; 127 34aca: 9f 93 push r25 34acc: 0d d0 rcall .+26 ; 0x34ae8 34ace: 0f 90 pop r0 34ad0: 07 fc sbrc r0, 7 34ad2: 90 58 subi r25, 0x80 ; 128 34ad4: 08 95 ret 34ad6: 46 f0 brts .+16 ; 0x34ae8 34ad8: 0d 94 db 9b jmp 0x337b6 ; 0x337b6 <__fp_nan> 34adc: 60 e0 ldi r22, 0x00 ; 0 34ade: 70 e0 ldi r23, 0x00 ; 0 34ae0: 80 e8 ldi r24, 0x80 ; 128 34ae2: 9f e3 ldi r25, 0x3F ; 63 34ae4: 08 95 ret 34ae6: 4f e7 ldi r20, 0x7F ; 127 34ae8: 9f 77 andi r25, 0x7F ; 127 34aea: 5f 93 push r21 34aec: 4f 93 push r20 34aee: 3f 93 push r19 34af0: 2f 93 push r18 34af2: 0f 94 33 a6 call 0x34c66 ; 0x34c66 34af6: 2f 91 pop r18 34af8: 3f 91 pop r19 34afa: 4f 91 pop r20 34afc: 5f 91 pop r21 34afe: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 34b02: 0d 94 de a5 jmp 0x34bbc ; 0x34bbc 00034b06 : 34b06: 9f 93 push r25 34b08: 0f 94 f7 a3 call 0x347ee ; 0x347ee <__fp_rempio2> 34b0c: 0f 90 pop r0 34b0e: 07 fc sbrc r0, 7 34b10: ee 5f subi r30, 0xFE ; 254 34b12: 0d 94 20 a4 jmp 0x34840 ; 0x34840 <__fp_sinus> 34b16: 19 f4 brne .+6 ; 0x34b1e 34b18: 16 f4 brtc .+4 ; 0x34b1e 34b1a: 0d 94 db 9b jmp 0x337b6 ; 0x337b6 <__fp_nan> 34b1e: 0d 94 c0 a3 jmp 0x34780 ; 0x34780 <__fp_mpack> 00034b22 : 34b22: 0f 94 05 9c call 0x3380a ; 0x3380a <__fp_splitA> 34b26: b8 f3 brcs .-18 ; 0x34b16 34b28: 99 23 and r25, r25 34b2a: c9 f3 breq .-14 ; 0x34b1e 34b2c: b6 f3 brts .-20 ; 0x34b1a 34b2e: 9f 57 subi r25, 0x7F ; 127 34b30: 55 0b sbc r21, r21 34b32: 87 ff sbrs r24, 7 34b34: 0f 94 10 a6 call 0x34c20 ; 0x34c20 <__fp_norm2> 34b38: 00 24 eor r0, r0 34b3a: a0 e6 ldi r26, 0x60 ; 96 34b3c: 40 ea ldi r20, 0xA0 ; 160 34b3e: 90 01 movw r18, r0 34b40: 80 58 subi r24, 0x80 ; 128 34b42: 56 95 lsr r21 34b44: 97 95 ror r25 34b46: 28 f4 brcc .+10 ; 0x34b52 34b48: 80 5c subi r24, 0xC0 ; 192 34b4a: 66 0f add r22, r22 34b4c: 77 1f adc r23, r23 34b4e: 88 1f adc r24, r24 34b50: 20 f0 brcs .+8 ; 0x34b5a 34b52: 26 17 cp r18, r22 34b54: 37 07 cpc r19, r23 34b56: 48 07 cpc r20, r24 34b58: 30 f4 brcc .+12 ; 0x34b66 34b5a: 62 1b sub r22, r18 34b5c: 73 0b sbc r23, r19 34b5e: 84 0b sbc r24, r20 34b60: 20 29 or r18, r0 34b62: 31 29 or r19, r1 34b64: 4a 2b or r20, r26 34b66: a6 95 lsr r26 34b68: 17 94 ror r1 34b6a: 07 94 ror r0 34b6c: 20 25 eor r18, r0 34b6e: 31 25 eor r19, r1 34b70: 4a 27 eor r20, r26 34b72: 58 f7 brcc .-42 ; 0x34b4a 34b74: 66 0f add r22, r22 34b76: 77 1f adc r23, r23 34b78: 88 1f adc r24, r24 34b7a: 20 f0 brcs .+8 ; 0x34b84 34b7c: 26 17 cp r18, r22 34b7e: 37 07 cpc r19, r23 34b80: 48 07 cpc r20, r24 34b82: 30 f4 brcc .+12 ; 0x34b90 34b84: 62 0b sbc r22, r18 34b86: 73 0b sbc r23, r19 34b88: 84 0b sbc r24, r20 34b8a: 20 0d add r18, r0 34b8c: 31 1d adc r19, r1 34b8e: 41 1d adc r20, r1 34b90: a0 95 com r26 34b92: 81 f7 brne .-32 ; 0x34b74 34b94: b9 01 movw r22, r18 34b96: 84 2f mov r24, r20 34b98: 91 58 subi r25, 0x81 ; 129 34b9a: 88 0f add r24, r24 34b9c: 96 95 lsr r25 34b9e: 87 95 ror r24 34ba0: 08 95 ret 00034ba2 <__unordsf2>: 34ba2: 0f 94 81 a3 call 0x34702 ; 0x34702 <__fp_cmp> 34ba6: 88 0b sbc r24, r24 34ba8: 99 0b sbc r25, r25 34baa: 08 95 ret 34bac: 29 f4 brne .+10 ; 0x34bb8 <__unordsf2+0x16> 34bae: 16 f0 brts .+4 ; 0x34bb4 <__unordsf2+0x12> 34bb0: 0d 94 d5 9b jmp 0x337aa ; 0x337aa <__fp_inf> 34bb4: 0d 94 1f 9c jmp 0x3383e ; 0x3383e <__fp_zero> 34bb8: 0d 94 db 9b jmp 0x337b6 ; 0x337b6 <__fp_nan> 00034bbc : 34bbc: 0f 94 05 9c call 0x3380a ; 0x3380a <__fp_splitA> 34bc0: a8 f3 brcs .-22 ; 0x34bac <__unordsf2+0xa> 34bc2: 96 38 cpi r25, 0x86 ; 134 34bc4: a0 f7 brcc .-24 ; 0x34bae <__unordsf2+0xc> 34bc6: 07 f8 bld r0, 7 34bc8: 0f 92 push r0 34bca: e8 94 clt 34bcc: 2b e3 ldi r18, 0x3B ; 59 34bce: 3a ea ldi r19, 0xAA ; 170 34bd0: 48 eb ldi r20, 0xB8 ; 184 34bd2: 5f e7 ldi r21, 0x7F ; 127 34bd4: 0f 94 7e 9b call 0x336fc ; 0x336fc <__mulsf3_pse> 34bd8: 0f 92 push r0 34bda: 0f 92 push r0 34bdc: 0f 92 push r0 34bde: 4d b7 in r20, 0x3d ; 61 34be0: 5e b7 in r21, 0x3e ; 62 34be2: 0f 92 push r0 34be4: 0f 94 7b a6 call 0x34cf6 ; 0x34cf6 34be8: ef ec ldi r30, 0xCF ; 207 34bea: fc e6 ldi r31, 0x6C ; 108 34bec: 0f 94 ce a3 call 0x3479c ; 0x3479c <__fp_powser> 34bf0: 4f 91 pop r20 34bf2: 5f 91 pop r21 34bf4: ef 91 pop r30 34bf6: ff 91 pop r31 34bf8: e5 95 asr r30 34bfa: ee 1f adc r30, r30 34bfc: ff 1f adc r31, r31 34bfe: 49 f0 breq .+18 ; 0x34c12 34c00: fe 57 subi r31, 0x7E ; 126 34c02: e0 68 ori r30, 0x80 ; 128 34c04: 44 27 eor r20, r20 34c06: ee 0f add r30, r30 34c08: 44 1f adc r20, r20 34c0a: fa 95 dec r31 34c0c: e1 f7 brne .-8 ; 0x34c06 34c0e: 41 95 neg r20 34c10: 55 0b sbc r21, r21 34c12: 0f 94 ca a4 call 0x34994 ; 0x34994 34c16: 0f 90 pop r0 34c18: 07 fe sbrs r0, 7 34c1a: 0d 94 be a4 jmp 0x3497c ; 0x3497c 34c1e: 08 95 ret 00034c20 <__fp_norm2>: 34c20: 91 50 subi r25, 0x01 ; 1 34c22: 50 40 sbci r21, 0x00 ; 0 34c24: 66 0f add r22, r22 34c26: 77 1f adc r23, r23 34c28: 88 1f adc r24, r24 34c2a: d2 f7 brpl .-12 ; 0x34c20 <__fp_norm2> 34c2c: 08 95 ret 00034c2e <__fp_powsodd>: 34c2e: 9f 93 push r25 34c30: 8f 93 push r24 34c32: 7f 93 push r23 34c34: 6f 93 push r22 34c36: ff 93 push r31 34c38: ef 93 push r30 34c3a: 9b 01 movw r18, r22 34c3c: ac 01 movw r20, r24 34c3e: 0f 94 68 9b call 0x336d0 ; 0x336d0 <__mulsf3> 34c42: ef 91 pop r30 34c44: ff 91 pop r31 34c46: 0f 94 ce a3 call 0x3479c ; 0x3479c <__fp_powser> 34c4a: 2f 91 pop r18 34c4c: 3f 91 pop r19 34c4e: 4f 91 pop r20 34c50: 5f 91 pop r21 34c52: 0d 94 68 9b jmp 0x336d0 ; 0x336d0 <__mulsf3> 34c56: 16 f0 brts .+4 ; 0x34c5c <__fp_powsodd+0x2e> 34c58: 0d 94 c0 a3 jmp 0x34780 ; 0x34780 <__fp_mpack> 34c5c: 0d 94 db 9b jmp 0x337b6 ; 0x337b6 <__fp_nan> 34c60: 68 94 set 34c62: 0d 94 d5 9b jmp 0x337aa ; 0x337aa <__fp_inf> 00034c66 : 34c66: 0f 94 05 9c call 0x3380a ; 0x3380a <__fp_splitA> 34c6a: a8 f3 brcs .-22 ; 0x34c56 <__fp_powsodd+0x28> 34c6c: 99 23 and r25, r25 34c6e: c1 f3 breq .-16 ; 0x34c60 <__fp_powsodd+0x32> 34c70: ae f3 brts .-22 ; 0x34c5c <__fp_powsodd+0x2e> 34c72: df 93 push r29 34c74: cf 93 push r28 34c76: 1f 93 push r17 34c78: 0f 93 push r16 34c7a: ff 92 push r15 34c7c: c9 2f mov r28, r25 34c7e: dd 27 eor r29, r29 34c80: 88 23 and r24, r24 34c82: 2a f0 brmi .+10 ; 0x34c8e 34c84: 21 97 sbiw r28, 0x01 ; 1 34c86: 66 0f add r22, r22 34c88: 77 1f adc r23, r23 34c8a: 88 1f adc r24, r24 34c8c: da f7 brpl .-10 ; 0x34c84 34c8e: 20 e0 ldi r18, 0x00 ; 0 34c90: 30 e0 ldi r19, 0x00 ; 0 34c92: 40 e8 ldi r20, 0x80 ; 128 34c94: 5f eb ldi r21, 0xBF ; 191 34c96: 9f e3 ldi r25, 0x3F ; 63 34c98: 88 39 cpi r24, 0x98 ; 152 34c9a: 20 f0 brcs .+8 ; 0x34ca4 34c9c: 80 3e cpi r24, 0xE0 ; 224 34c9e: 38 f0 brcs .+14 ; 0x34cae 34ca0: 21 96 adiw r28, 0x01 ; 1 34ca2: 8f 77 andi r24, 0x7F ; 127 34ca4: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 34ca8: e7 ef ldi r30, 0xF7 ; 247 34caa: fc e6 ldi r31, 0x6C ; 108 34cac: 04 c0 rjmp .+8 ; 0x34cb6 34cae: 0f 94 c3 a1 call 0x34386 ; 0x34386 <__addsf3> 34cb2: e4 e2 ldi r30, 0x24 ; 36 34cb4: fd e6 ldi r31, 0x6D ; 109 34cb6: 0f 94 ce a3 call 0x3479c ; 0x3479c <__fp_powser> 34cba: 8b 01 movw r16, r22 34cbc: be 01 movw r22, r28 34cbe: ec 01 movw r28, r24 34cc0: fb 2e mov r15, r27 34cc2: 6f 57 subi r22, 0x7F ; 127 34cc4: 71 09 sbc r23, r1 34cc6: 75 95 asr r23 34cc8: 77 1f adc r23, r23 34cca: 88 0b sbc r24, r24 34ccc: 99 0b sbc r25, r25 34cce: 0f 94 29 9b call 0x33652 ; 0x33652 <__floatsisf> 34cd2: 28 e1 ldi r18, 0x18 ; 24 34cd4: 32 e7 ldi r19, 0x72 ; 114 34cd6: 41 e3 ldi r20, 0x31 ; 49 34cd8: 5f e3 ldi r21, 0x3F ; 63 34cda: 0f 94 7b 9b call 0x336f6 ; 0x336f6 <__mulsf3x> 34cde: af 2d mov r26, r15 34ce0: 98 01 movw r18, r16 34ce2: ae 01 movw r20, r28 34ce4: ff 90 pop r15 34ce6: 0f 91 pop r16 34ce8: 1f 91 pop r17 34cea: cf 91 pop r28 34cec: df 91 pop r29 34cee: 0f 94 da a1 call 0x343b4 ; 0x343b4 <__addsf3x> 34cf2: 0d 94 ec 9b jmp 0x337d8 ; 0x337d8 <__fp_round> 00034cf6 : 34cf6: fa 01 movw r30, r20 34cf8: dc 01 movw r26, r24 34cfa: aa 0f add r26, r26 34cfc: bb 1f adc r27, r27 34cfe: 9b 01 movw r18, r22 34d00: ac 01 movw r20, r24 34d02: bf 57 subi r27, 0x7F ; 127 34d04: 28 f4 brcc .+10 ; 0x34d10 34d06: 22 27 eor r18, r18 34d08: 33 27 eor r19, r19 34d0a: 44 27 eor r20, r20 34d0c: 50 78 andi r21, 0x80 ; 128 34d0e: 20 c0 rjmp .+64 ; 0x34d50 34d10: b7 51 subi r27, 0x17 ; 23 34d12: 90 f4 brcc .+36 ; 0x34d38 34d14: ab 2f mov r26, r27 34d16: 00 24 eor r0, r0 34d18: 46 95 lsr r20 34d1a: 37 95 ror r19 34d1c: 27 95 ror r18 34d1e: 01 1c adc r0, r1 34d20: a3 95 inc r26 34d22: d2 f3 brmi .-12 ; 0x34d18 34d24: 00 20 and r0, r0 34d26: 71 f0 breq .+28 ; 0x34d44 34d28: 22 0f add r18, r18 34d2a: 33 1f adc r19, r19 34d2c: 44 1f adc r20, r20 34d2e: b3 95 inc r27 34d30: da f3 brmi .-10 ; 0x34d28 34d32: 0e d0 rcall .+28 ; 0x34d50 34d34: 0d 94 c2 a1 jmp 0x34384 ; 0x34384 <__subsf3> 34d38: 61 30 cpi r22, 0x01 ; 1 34d3a: 71 05 cpc r23, r1 34d3c: a0 e8 ldi r26, 0x80 ; 128 34d3e: 8a 07 cpc r24, r26 34d40: b9 46 sbci r27, 0x69 ; 105 34d42: 30 f4 brcc .+12 ; 0x34d50 34d44: 9b 01 movw r18, r22 34d46: ac 01 movw r20, r24 34d48: 66 27 eor r22, r22 34d4a: 77 27 eor r23, r23 34d4c: 88 27 eor r24, r24 34d4e: 90 78 andi r25, 0x80 ; 128 34d50: 30 96 adiw r30, 0x00 ; 0 34d52: 21 f0 breq .+8 ; 0x34d5c 34d54: 20 83 st Z, r18 34d56: 31 83 std Z+1, r19 ; 0x01 34d58: 42 83 std Z+2, r20 ; 0x02 34d5a: 53 83 std Z+3, r21 ; 0x03 34d5c: 08 95 ret 00034d5e : 34d5e: 91 11 cpse r25, r1 34d60: 08 95 ret 34d62: 81 54 subi r24, 0x41 ; 65 34d64: 8a 51 subi r24, 0x1A ; 26 34d66: 08 f4 brcc .+2 ; 0x34d6a 34d68: 80 5e subi r24, 0xE0 ; 224 34d6a: 85 5a subi r24, 0xA5 ; 165 34d6c: 08 95 ret 00034d6e : 34d6e: fb 01 movw r30, r22 34d70: dc 01 movw r26, r24 34d72: 04 c0 rjmp .+8 ; 0x34d7c 34d74: 8d 91 ld r24, X+ 34d76: 01 90 ld r0, Z+ 34d78: 80 19 sub r24, r0 34d7a: 21 f4 brne .+8 ; 0x34d84 34d7c: 41 50 subi r20, 0x01 ; 1 34d7e: 50 40 sbci r21, 0x00 ; 0 34d80: c8 f7 brcc .-14 ; 0x34d74 34d82: 88 1b sub r24, r24 34d84: 99 0b sbc r25, r25 34d86: 08 95 ret 00034d88 : 34d88: fb 01 movw r30, r22 34d8a: dc 01 movw r26, r24 34d8c: 02 c0 rjmp .+4 ; 0x34d92 34d8e: 01 90 ld r0, Z+ 34d90: 0d 92 st X+, r0 34d92: 41 50 subi r20, 0x01 ; 1 34d94: 50 40 sbci r21, 0x00 ; 0 34d96: d8 f7 brcc .-10 ; 0x34d8e 34d98: 08 95 ret 00034d9a : 34d9a: dc 01 movw r26, r24 34d9c: 01 c0 rjmp .+2 ; 0x34da0 34d9e: 6d 93 st X+, r22 34da0: 41 50 subi r20, 0x01 ; 1 34da2: 50 40 sbci r21, 0x00 ; 0 34da4: e0 f7 brcc .-8 ; 0x34d9e 34da6: 08 95 ret 00034da8 : 34da8: fb 01 movw r30, r22 34daa: dc 01 movw r26, r24 34dac: 8d 91 ld r24, X+ 34dae: 81 34 cpi r24, 0x41 ; 65 34db0: 1c f0 brlt .+6 ; 0x34db8 34db2: 8b 35 cpi r24, 0x5B ; 91 34db4: 0c f4 brge .+2 ; 0x34db8 34db6: 80 5e subi r24, 0xE0 ; 224 34db8: 61 91 ld r22, Z+ 34dba: 61 34 cpi r22, 0x41 ; 65 34dbc: 1c f0 brlt .+6 ; 0x34dc4 34dbe: 6b 35 cpi r22, 0x5B ; 91 34dc0: 0c f4 brge .+2 ; 0x34dc4 34dc2: 60 5e subi r22, 0xE0 ; 224 34dc4: 86 1b sub r24, r22 34dc6: 61 11 cpse r22, r1 34dc8: 89 f3 breq .-30 ; 0x34dac 34dca: 99 0b sbc r25, r25 34dcc: 08 95 ret 00034dce : 34dce: fb 01 movw r30, r22 34dd0: dc 01 movw r26, r24 34dd2: 0d 90 ld r0, X+ 34dd4: 00 20 and r0, r0 34dd6: e9 f7 brne .-6 ; 0x34dd2 34dd8: 11 97 sbiw r26, 0x01 ; 1 34dda: 01 90 ld r0, Z+ 34ddc: 0d 92 st X+, r0 34dde: 00 20 and r0, r0 34de0: e1 f7 brne .-8 ; 0x34dda 34de2: 08 95 ret 00034de4 : 34de4: fc 01 movw r30, r24 34de6: 81 91 ld r24, Z+ 34de8: 86 17 cp r24, r22 34dea: 21 f0 breq .+8 ; 0x34df4 34dec: 88 23 and r24, r24 34dee: d9 f7 brne .-10 ; 0x34de6 34df0: 99 27 eor r25, r25 34df2: 08 95 ret 34df4: 31 97 sbiw r30, 0x01 ; 1 34df6: cf 01 movw r24, r30 34df8: 08 95 ret 00034dfa : 34dfa: fb 01 movw r30, r22 34dfc: dc 01 movw r26, r24 34dfe: 8d 91 ld r24, X+ 34e00: 01 90 ld r0, Z+ 34e02: 80 19 sub r24, r0 34e04: 01 10 cpse r0, r1 34e06: d9 f3 breq .-10 ; 0x34dfe 34e08: 99 0b sbc r25, r25 34e0a: 08 95 ret 00034e0c : 34e0c: fb 01 movw r30, r22 34e0e: dc 01 movw r26, r24 34e10: 01 90 ld r0, Z+ 34e12: 0d 92 st X+, r0 34e14: 00 20 and r0, r0 34e16: e1 f7 brne .-8 ; 0x34e10 34e18: 08 95 ret 00034e1a : 34e1a: fb 01 movw r30, r22 34e1c: dc 01 movw r26, r24 34e1e: 41 50 subi r20, 0x01 ; 1 34e20: 50 40 sbci r21, 0x00 ; 0 34e22: 30 f0 brcs .+12 ; 0x34e30 34e24: 8d 91 ld r24, X+ 34e26: 01 90 ld r0, Z+ 34e28: 80 19 sub r24, r0 34e2a: 19 f4 brne .+6 ; 0x34e32 34e2c: 00 20 and r0, r0 34e2e: b9 f7 brne .-18 ; 0x34e1e 34e30: 88 1b sub r24, r24 34e32: 99 0b sbc r25, r25 34e34: 08 95 ret 00034e36 : 34e36: fb 01 movw r30, r22 34e38: dc 01 movw r26, r24 34e3a: 41 50 subi r20, 0x01 ; 1 34e3c: 50 40 sbci r21, 0x00 ; 0 34e3e: 48 f0 brcs .+18 ; 0x34e52 34e40: 01 90 ld r0, Z+ 34e42: 0d 92 st X+, r0 34e44: 00 20 and r0, r0 34e46: c9 f7 brne .-14 ; 0x34e3a 34e48: 01 c0 rjmp .+2 ; 0x34e4c 34e4a: 1d 92 st X+, r1 34e4c: 41 50 subi r20, 0x01 ; 1 34e4e: 50 40 sbci r21, 0x00 ; 0 34e50: e0 f7 brcc .-8 ; 0x34e4a 34e52: 08 95 ret 00034e54 : 34e54: 0f 93 push r16 34e56: 1f 93 push r17 34e58: cf 93 push r28 34e5a: df 93 push r29 34e5c: e0 91 00 17 lds r30, 0x1700 ; 0x801700 <__iob+0x2> 34e60: f0 91 01 17 lds r31, 0x1701 ; 0x801701 <__iob+0x3> 34e64: 23 81 ldd r18, Z+3 ; 0x03 34e66: ec 01 movw r28, r24 34e68: 10 e0 ldi r17, 0x00 ; 0 34e6a: 00 e0 ldi r16, 0x00 ; 0 34e6c: 21 fd sbrc r18, 1 34e6e: 08 c0 rjmp .+16 ; 0x34e80 34e70: 0f ef ldi r16, 0xFF ; 255 34e72: 1f ef ldi r17, 0xFF ; 255 34e74: 14 c0 rjmp .+40 ; 0x34e9e 34e76: 19 95 eicall 34e78: 89 2b or r24, r25 34e7a: 11 f0 breq .+4 ; 0x34e80 34e7c: 0f ef ldi r16, 0xFF ; 255 34e7e: 1f ef ldi r17, 0xFF ; 255 34e80: 89 91 ld r24, Y+ 34e82: 60 91 00 17 lds r22, 0x1700 ; 0x801700 <__iob+0x2> 34e86: 70 91 01 17 lds r23, 0x1701 ; 0x801701 <__iob+0x3> 34e8a: db 01 movw r26, r22 34e8c: 18 96 adiw r26, 0x08 ; 8 34e8e: ed 91 ld r30, X+ 34e90: fc 91 ld r31, X 34e92: 81 11 cpse r24, r1 34e94: f0 cf rjmp .-32 ; 0x34e76 34e96: 8a e0 ldi r24, 0x0A ; 10 34e98: 19 95 eicall 34e9a: 89 2b or r24, r25 34e9c: 49 f7 brne .-46 ; 0x34e70 34e9e: c8 01 movw r24, r16 34ea0: df 91 pop r29 34ea2: cf 91 pop r28 34ea4: 1f 91 pop r17 34ea6: 0f 91 pop r16 34ea8: 08 95 ret 00034eaa <__do_global_dtors>: 34eaa: 10 e5 ldi r17, 0x50 ; 80 34eac: c7 eb ldi r28, 0xB7 ; 183 34eae: d0 e5 ldi r29, 0x50 ; 80 34eb0: 00 e0 ldi r16, 0x00 ; 0 34eb2: 06 c0 rjmp .+12 ; 0x34ec0 <__do_global_dtors+0x16> 34eb4: 80 2f mov r24, r16 34eb6: fe 01 movw r30, r28 34eb8: 0f 94 ab a1 call 0x34356 ; 0x34356 <__tablejump2__> 34ebc: 21 96 adiw r28, 0x01 ; 1 34ebe: 01 1d adc r16, r1 34ec0: c8 3b cpi r28, 0xB8 ; 184 34ec2: d1 07 cpc r29, r17 34ec4: 80 e0 ldi r24, 0x00 ; 0 34ec6: 08 07 cpc r16, r24 34ec8: a9 f7 brne .-22 ; 0x34eb4 <__do_global_dtors+0xa> 34eca: f8 94 cli 00034ecc <__stop_program>: 34ecc: ff cf rjmp .-2 ; 0x34ecc <__stop_program>